Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,23 @@ private Func&lt;Task&gt;? OnConfirmAsync { get; set; }</Pre>
</PopConfirmButton>
</DemoBlock>

<DemoBlock Title="@Localizer["PopoverConfirmsTriggerTitle"]"
Introduction="@Localizer["PopoverConfirmsTriggerIntro"]"
Name="Trigger">
<PopConfirmButton Placement="Placement.Top"
ConfirmIcon="fa-solid fa-triangle-exclamation text-info"
Color="Color.Primary"
ConfirmButtonColor="Color.Info"
Trigger="hover focus" ShowCloseButton="false" ShowConfirmButton="false"
Text="@Localizer["PopoverConfirmsBodyTemplateButtonText"]">
<BodyTemplate>
<div class="d-flex align-items-center">
Label: Just a demo
</div>
</BodyTemplate>
</PopConfirmButton>
</DemoBlock>

<AttributeTable Items="@GetAttributes()" />

<EventTable Items="@GetEvents()" />
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,30 @@ private static AttributeItem[] GetAttributes() =>
Type = "string",
ValueList = "",
DefaultValue = " "
},
new()
{
Name = nameof(PopConfirmButton.Trigger),
Description = "How pop confirm is triggered",
Type = "string",
ValueList = "click|hover|focus",
DefaultValue = "click"
},
new()
{
Name = nameof(PopConfirmButton.ShowCloseButton),
Description = "Whether to display the close button",
Type = "string",
ValueList = "true/false",
DefaultValue = "true"
},
new()
{
Name = nameof(PopConfirmButton.ShowConfirmButton),
Description = "Whether to display the confirm button",
Type = "string",
ValueList = "true/false",
DefaultValue = "true"
}
];

Expand Down
4 changes: 3 additions & 1 deletion src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@
"PopoverConfirmsShowButtonsTitle": "Custom Component",
"PopoverConfirmsShowButtonsIntro": "By setting <code>ShowCloseButton=\"false\"</code> <code>ShowConfirmButton=\"false\"</code>, you don't display the built-in function buttons, and customize an <b>Approve</b> button in the custom component.",
"PopoverConfirmsShowButtonsButtonText": "Custom Component",
"PopoverConfirmsShowButtonsDesc": "In a custom component, you can call the <code>Close</code> or <code>Confirm</code> method inside the component through cascading parameters"
"PopoverConfirmsShowButtonsDesc": "In a custom component, you can call the <code>Close</code> or <code>Confirm</code> method inside the component through cascading parameters",
"PopoverConfirmsTriggerTitle": "Trigger",
"PopoverConfirmsTriggerIntro": "By setting the <code>Trigger</code> parameter, you can set the way the component pops up the confirmation box. The default value is <code>click</code>. You can also set <code>hover focus</code> to use in combination."
},
"BootstrapBlazor.Server.Components.Components.CustomPopConfirmContent": {
"CustomPopConfirmContentText": "Custom content",
Expand Down
4 changes: 3 additions & 1 deletion src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@
"PopoverConfirmsShowButtonsTitle": "自定义组件",
"PopoverConfirmsShowButtonsIntro": "通过设置 <code>ShowCloseButton=\"false\"</code> <code>ShowConfirmButton=\"false\"</code> 不显示内置功能按钮,在自定义组件中自定义一个 <b>审批</b> 按钮",
"PopoverConfirmsShowButtonsButtonText": "自定义组件",
"PopoverConfirmsShowButtonsDesc": "自定义组件内可通过级联参数调用组件内部的 <code>Close</code> 或者 <code>Confirm</code> 方法"
"PopoverConfirmsShowButtonsDesc": "自定义组件内可通过级联参数调用组件内部的 <code>Close</code> 或者 <code>Confirm</code> 方法",
"PopoverConfirmsTriggerTitle": "触发方式",
"PopoverConfirmsTriggerIntro": "通过设置 <code>Trigger</code> 参数来设置组件弹出确认框的方式,默认值为 <code>click</code> 还可以设置 <code>hover focus</code> 可组合使用"
},
"BootstrapBlazor.Server.Components.Components.CustomPopConfirmContent": {
"CustomPopConfirmContentText": "自定义弹窗内容",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public abstract class PopConfirmButtonBase : ButtonBase
public Placement Placement { get; set; }

/// <summary>
/// 获得/设置 弹窗触发方式 默认 click
/// 获得/设置 弹窗触发方式 默认 click 可设置 hover focus
/// </summary>
[Parameter]
public string? Trigger { get; set; }
Expand Down