mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-05 05:29:47 +08:00
!3605 chore(#I65LDR): update unit test for Anchor and update document
* test: 增加 IsAnimation 单元测试 * refactor: 移除 ElementReference * chore: 更新资源文件 * doc: 更新文档 * doc: 更新示例 * Merge branch 'main' into dev-confirm-button * chore: 修复资源文件 * doc: 添加 PopConfirmButton BodyTemplate 文档
This commit is contained in:
parent
a216a9792f
commit
51e1944a1f
@ -300,7 +300,10 @@
|
||||
"P24": "custom style",
|
||||
"P25": "Set the <code>CssClass</code> custom component style",
|
||||
"P26": "custom style button",
|
||||
"P27": "Are you sure you want to delete the data?"
|
||||
"P27": "Are you sure you want to delete the data?",
|
||||
"BodyTemplateTitle": "Customize the PopConfirmButton content",
|
||||
"BodyTemplateIntro": "Customize the content by setting <code>the BodyTemplate</code> property",
|
||||
"BodyTemplateButtonText": "Customize content"
|
||||
},
|
||||
"BootstrapBlazor.Shared.Samples.Popovers": {
|
||||
"H1": "Popover popup component",
|
||||
@ -1886,7 +1889,7 @@
|
||||
"TipsP": "<code>Tab</code> components are generally used in two ways:",
|
||||
"TipsLi1": "Split as data",
|
||||
"TipsLi2": "Page navigation",
|
||||
"TipsDiv": "The default behavior of this component is data segmentation,Clicking on the <code>TabItem</code> title does not navigate, and if you need to navigate the address bar, set the <code>ClickTabToNavigation</code> property to <code>true</code>,When you click on the <code>TabItem</code> title, the address bar redirects navigation, mostly for the background management system to be used in conjunction with the <code>Menu</code> components,The actual combat can refer to the <code>multi-label</code> mode in the <a href='layout-page' target='_blank'>background template simulator</a>, When you have <code>Razor Component</code> in the additional Assemblies, set the <code>AdditionalAssemblies</code> property value correctly so that the route within the label component is resolved correctly, and the relevant documentation <a href='https://docs.microsoft.com/zh-cn/aspnet/core/blazor/fundamentals/routing?WT.mc_id-DT-MVP-5004174-view-aspnetcore-3.1-route-to-components-from-multiple-assemblies' target'_blank'>[Portal]</a>",
|
||||
"TipsDiv": "The default behavior of this component is data segmentation,Clicking on the <code>TabItem</code> title does not navigate, and if you need to navigate the address bar, set the <code>ClickTabToNavigation</code> property to <code>true</code>,When you click on the <code>TabItem</code> title, the address bar redirects navigation, mostly for the background management system to be used in conjunction with the <code>Menu</code> components,The actual combat can refer to the <code>multi-label</code> mode in the <a href='layout-page' target='_blank'>background template simulator</a>, When you have <code>Razor Component</code> in the additional Assemblies, set the <code>AdditionalAssemblies</code> property value correctly so that the route within the label component is resolved correctly, and the relevant documentation <a href='https://docs.microsoft.com/zh-cn/aspnet/core/blazor/fundamentals/routing?WT.mc_id-DT-MVP-5004174-view-aspnetcore-3.1-route-to-components-from-multiple-assemblies' target='_blank'>[Portal]</a>",
|
||||
"TipsP2": "This component adapts to width height, etc., and scroll arrows can appear left and right or up and down when appropriate",
|
||||
"InfoTitle": "Set additional information during tab navigation",
|
||||
"InfoItem2": "Tab properties can be set when navigating using the built-in extension method <code>Navigator.NavigateTo(\"provider\", \"url\", \"text\", \"icon\", \"closable\")</code>",
|
||||
@ -2644,9 +2647,9 @@
|
||||
"Title": "Markdown",
|
||||
"H1": "A text editor that provides support for the Markdown syntax",
|
||||
"P1": "Precautions",
|
||||
"P2": "This component relies on <a href='https://www.nuget.org/packages?q=BootstrapBlazor.Markdown' target'_blank'><code>BootstrapBlazor.Markdown</code></a>, which needs to reference its component package when using this component",
|
||||
"P2": "This component relies on <a href='https://www.nuget.org/packages?q=BootstrapBlazor.Markdown' target='_blank'> <code>BootstrapBlazor.Markdown</code></a>, which needs to reference its component package when using this component",
|
||||
"P3": "Nuget Install",
|
||||
"P4": "Use nuget.org to install <a href='https://www.nuget.org/packages?q=BootstrapBlazor.Markdown' target'_blank'><code>BootstrapBlazor.Markdown</code></a> component",
|
||||
"P4": "Use nuget.org to install <a href='https://www.nuget.org/packages?q=BootstrapBlazor.Markdown' target='_blank'><code>BootstrapBlazor.Markdown</code></a> component",
|
||||
"Css": "CSS file",
|
||||
"CssText": "dynamic import css",
|
||||
"Js": "JS file",
|
||||
@ -3102,7 +3105,7 @@
|
||||
"AvatarUploadP2": "Round avatar frame",
|
||||
"AvatarUploadP3": "When you set up <code>IsSingle</code>, you can upload only one image or file",
|
||||
"AvatarUploadP4": " <div>The component provides <code>Accept</code> property for upload file filtering, in this case the circular avatar box accepts both GIF and JPEG images, sets the <code>Accept='image/gif, image/jpeg'</code> and can be written as: <code>Accept='image/*'</code> if you don't restrict the format of the image. Whether this property is not secure or should be to file format validation using the <b>server-side authentication </b></div>",
|
||||
"AvatarUploadP5": "RELATED: <a href='https://www.runoob.com/tags/att-input-accept.html' target='_blank'>[Accept]</a> < a href='http://www.iana.org/assignments/media-types/media-types.xhtml' target='_blank' >[Media Types]</a>",
|
||||
"AvatarUploadP5": "RELATED: <a href='https://www.runoob.com/tags/att-input-accept.html' target='_blank'>[Accept]</a> <a href='http://www.iana.org/assignments/media-types/media-types.xhtml' target='_blank'>[Media Types]</a>",
|
||||
"AvatarUploadP6": "Set the preview address <code>PrevUrl</code> with the <code>DefaultFileList</code> property",
|
||||
"AvatarUploadP7": "Verify that an example of using a picture box is used in the form",
|
||||
"AvatarUploadButtonText": "Submit",
|
||||
@ -3724,7 +3727,7 @@
|
||||
"BasicUsageIntro": "Put your own components inside the <code>GroupBox</code>",
|
||||
"GroupTitle": "An example of a form",
|
||||
"GroupP1": "I'm an example of <code>GroupBox</code>",
|
||||
"GroupP2": "For more examples, please refer to the <code>EditorForms</code> Form Example < a href'editorforms' target'_blank'> the portal </a>",
|
||||
"GroupP2": "For more examples, please refer to the <code>EditorForms</code> Form Example <a href='editorforms' target='_blank'> the portal </a>",
|
||||
"AttTitle": "Set the component title"
|
||||
},
|
||||
"BootstrapBlazor.Shared.Samples.LinkButtons": {
|
||||
@ -4941,10 +4944,10 @@
|
||||
"H2": "By setting <code>ShowExportButton</code> to display the export button, the component has built-in export Excel function",
|
||||
"P1": "The export function provides an export callback method <code>OnExportAsync</code>, which can be used to export data by providing a custom export method. If no data export method is provided, the component will export data according to the injected export service",
|
||||
"P2": "Precautions",
|
||||
"P3": "<code>BootstrapBlazor.TableExport</code></a>, the component package uses the <code>EPPlus</code> component to provide the function of exporting to <code>Excel</code>, and its component package can be referenced if necessary",
|
||||
"P3": "<code>BootstrapBlazor.TableExport</code>, the component package uses the <code>EPPlus</code> component to provide the function of exporting to <code>Excel</code>, and its component package can be referenced if necessary",
|
||||
"P4": "Nuget Install",
|
||||
"P5": "",
|
||||
"P6": "Use nuget.org to install <a href='https://www.nuget.org/packages?q=BootstrapBlazor.TableExport' target'_blank'><code>BootstrapBlazor.TableExport</code></a> component",
|
||||
"P6": "Use nuget.org to install <a href='https://www.nuget.org/packages?q=BootstrapBlazor.TableExport' target='_blank'><code>BootstrapBlazor.TableExport</code></a> component",
|
||||
"P7": "inject service",
|
||||
"P8": "Add BootstrapBlazor component",
|
||||
"P9": "Add Table Excel export service",
|
||||
@ -5271,9 +5274,9 @@
|
||||
"SignatureText": "Signature",
|
||||
"CleanText": "Clean",
|
||||
"P1": "Precautions",
|
||||
"P2": "This component relies on <a href='https://www.nuget.org/packages?q=BootstrapBlazor.SignaturePad' target'_blank'><code>BootstrapBlazor.SignaturePad</code></a>, which needs to reference its component package when using this component",
|
||||
"P2": "This component relies on <a href='https://www.nuget.org/packages?q=BootstrapBlazor.SignaturePad' target='_blank'><code>BootstrapBlazor.SignaturePad</code></a>, which needs to reference its component package when using this component",
|
||||
"P3": "Nuget Install",
|
||||
"P4": "Install <code>BootstrapBlazor.SignaturePad</code> component <a href='https://www.nuget.org/packages?q=BootstrapBlazor.SignaturePad' target'_blank'>nuget.org</a>"
|
||||
"P4": "Install <code>BootstrapBlazor.SignaturePad</code> component <a href='https://www.nuget.org/packages?q=BootstrapBlazor.SignaturePad' target='_blank'>nuget.org</a>"
|
||||
},
|
||||
"BootstrapBlazor.Shared.Samples.SpeechWaves": {
|
||||
"SpeechWaveTitle": "SpeechWave",
|
||||
@ -5317,9 +5320,9 @@
|
||||
"BootstrapBlazor.Shared.Samples.OnScreenKeyboards": {
|
||||
"Title": "On-Screen keyboard",
|
||||
"P1": "Precautions",
|
||||
"P2": "This component relies on <a href='https://www.nuget.org/packages?q=BootstrapBlazor.OnScreenKeyboard' target'_blank'><code>BootstrapBlazor.OnScreenKeyboard</code></a>, which needs to reference its component package when using this component",
|
||||
"P2": "This component relies on <a href='https://www.nuget.org/packages?q=BootstrapBlazor.OnScreenKeyboard' target='_blank'><code>BootstrapBlazor.OnScreenKeyboard</code></a>, which needs to reference its component package when using this component",
|
||||
"P3": "Nuget Install",
|
||||
"P4": "Use nuget.org to install <a href='https://www.nuget.org/packages?q=BootstrapBlazor.OnScreenKeyboard' target'_blank'><code>BootstrapBlazor.OnScreenKeyboard</code></a> component",
|
||||
"P4": "Use nuget.org to install <a href='https://www.nuget.org/packages?q=BootstrapBlazor.OnScreenKeyboard' target='_blank'><code>BootstrapBlazor.OnScreenKeyboard</code></a> component",
|
||||
"BaseUsageText": "Basic usage",
|
||||
"BlockKeyboardTypeAllTitle": "Full Keyboard",
|
||||
"BlockKeyboardTypekeyboard": "Keyboard",
|
||||
@ -5352,9 +5355,9 @@
|
||||
"GetBatteryLevelButtonText": "Get Battery Level",
|
||||
"Url3": "3. Battery Level",
|
||||
"P1": "Precautions",
|
||||
"P2": "This component relies on <a href='https://www.nuget.org/packages?q=BootstrapBlazor.Bluetooth' target'_blank'><code>BootstrapBlazor.Bluetooth</code></a>, which needs to reference its component package when using this component",
|
||||
"P2": "This component relies on <a href='https://www.nuget.org/packages?q=BootstrapBlazor.Bluetooth' target='_blank'><code>BootstrapBlazor.Bluetooth</code></a>, which needs to reference its component package when using this component",
|
||||
"P3": "Nuget Install",
|
||||
"P4": "Use nuget.org to install <a href='https://www.nuget.org/packages?q=BootstrapBlazor.Bluetooth' target'_blank'><code>BootstrapBlazor.Bluetooth</code></a> component",
|
||||
"P4": "Use nuget.org to install <a href='https://www.nuget.org/packages?q=BootstrapBlazor.Bluetooth' target='_blank'><code>BootstrapBlazor.Bluetooth</code></a> component",
|
||||
"Tips": "ServiceUUID, Default <code>0xff00</code><br/>Common Printers ServiceUUID:<br/><code>0000ff00-0000-1000-8000-00805f9b34fb</code><br/><code>e7810a71-73ae-499d-8c15-faa9aef0c3f2</code><br/><code>0000fee7-0000-1000-8000-00805f9b34fb</code><br/>Set up component services UUID : <code>printer.Opt.ServiceUuid=?</code>"
|
||||
},
|
||||
"BootstrapBlazor.Shared.Samples.FileIcons": {
|
||||
@ -5383,8 +5386,8 @@
|
||||
"BaseUsageText3": "Force use Pdf.js browser.",
|
||||
"BaseUsageIntro3": "Can be use advanced parameters",
|
||||
"P1": "Precautions",
|
||||
"P2": "This component relies on <a href='https://www.nuget.org/packages?q=BootstrapBlazor.PdfReader' target'_blank'><code>BootstrapBlazor.PdfReader</code></a>, which needs to reference its component package when using this component",
|
||||
"P2": "This component relies on <a href='https://www.nuget.org/packages?q=BootstrapBlazor.PdfReader' target='_blank'><code>BootstrapBlazor.PdfReader</code></a>, which needs to reference its component package when using this component",
|
||||
"P3": "Nuget Install",
|
||||
"P4": "Use nuget.org to install <a href='https://www.nuget.org/packages?q=BootstrapBlazor.PdfReader' target'_blank'><code>BootstrapBlazor.PdfReader</code></a> component"
|
||||
"P4": "Use nuget.org to install <a href='https://www.nuget.org/packages?q=BootstrapBlazor.PdfReader' target='_blank'><code>BootstrapBlazor.PdfReader</code></a> component"
|
||||
}
|
||||
}
|
||||
|
@ -301,7 +301,10 @@
|
||||
"P24": "自定义样式",
|
||||
"P25": "设置 <code>CssClass</code> 自定义组件样式",
|
||||
"P26": "自定义样式按钮",
|
||||
"P27": "确定删除数据吗?"
|
||||
"P27": "确定删除数据吗?",
|
||||
"BodyTemplateTitle": "自定义 PopConfirmButton 内容",
|
||||
"BodyTemplateIntro": "通过设置 <code>BodyTemplate</code> 属性,自定义内容",
|
||||
"BodyTemplateButtonText": "自定义内容"
|
||||
},
|
||||
"BootstrapBlazor.Shared.Samples.Popovers": {
|
||||
"H1": "Popover 弹出窗组件",
|
||||
|
@ -67,6 +67,18 @@
|
||||
ConfirmButtonColor="Color.Danger" Text="@Localizer["P26"]" Content="@Localizer["P27"]" CustomClass="custom-popover" />
|
||||
</DemoBlock>
|
||||
|
||||
<DemoBlock Title="@Localizer["BodyTemplateTitle"]" Introduction="@Localizer["BodyTemplateIntro"]" Name="BodyTemplate">
|
||||
<PopConfirmButton Placement="Placement.Top" ConfirmIcon="fa-solid fa-triangle-exclamation text-info" Color="Color.Primary"
|
||||
ConfirmButtonColor="Color.Info" Text="@Localizer["BodyTemplateButtonText"]">
|
||||
<BodyTemplate>
|
||||
<div class="d-flex align-items-center">
|
||||
<span class="me-2">Label: </span>
|
||||
<BootstrapInput TValue="string" />
|
||||
</div>
|
||||
</BodyTemplate>
|
||||
</PopConfirmButton>
|
||||
</DemoBlock>
|
||||
|
||||
<AttributeTable Items="@GetAttributes()" />
|
||||
|
||||
<EventTable Items="@GetEvents()" />
|
||||
|
@ -94,7 +94,7 @@ public sealed partial class PopoverConfirms
|
||||
Description = "Show title",
|
||||
Type = "string",
|
||||
ValueList = "",
|
||||
DefaultValue = "删除"
|
||||
DefaultValue = "Delete"
|
||||
},
|
||||
new AttributeItem() {
|
||||
Name = "Icon",
|
||||
@ -108,7 +108,7 @@ public sealed partial class PopoverConfirms
|
||||
Description = "Close button display text",
|
||||
Type = "string",
|
||||
ValueList = "",
|
||||
DefaultValue = "关闭"
|
||||
DefaultValue = "Close"
|
||||
},
|
||||
new AttributeItem() {
|
||||
Name = "CloseButtonColor",
|
||||
@ -129,7 +129,7 @@ public sealed partial class PopoverConfirms
|
||||
Description = "Confirm button display text",
|
||||
Type = "string",
|
||||
ValueList = "",
|
||||
DefaultValue = "确定"
|
||||
DefaultValue = "Ok"
|
||||
},
|
||||
new AttributeItem() {
|
||||
Name = "ConfirmButtonColor",
|
||||
|
@ -10,8 +10,6 @@ namespace BootstrapBlazor.Components;
|
||||
[JSModuleAutoLoader]
|
||||
public partial class Drawer
|
||||
{
|
||||
private ElementReference DrawerElement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得 组件样式
|
||||
/// </summary>
|
||||
|
@ -32,6 +32,27 @@ public class AnchorTest : BootstrapBlazorTestBase
|
||||
Assert.Contains("data-bb-container=\"anchor\"", cut.Markup);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsAnimation_Ok()
|
||||
{
|
||||
var cut = Context.RenderComponent<Anchor>(builder =>
|
||||
{
|
||||
builder.Add(a => a.IsAnimation, false);
|
||||
builder.Add(a => a.ChildContent, new RenderFragment(builder =>
|
||||
{
|
||||
builder.OpenElement(1, "div");
|
||||
builder.AddAttribute(2, "id", "anchor");
|
||||
builder.CloseElement();
|
||||
}));
|
||||
});
|
||||
cut.DoesNotContain("data-bb-animation");
|
||||
cut.SetParametersAndRender(pb =>
|
||||
{
|
||||
pb.Add(a => a.IsAnimation, true);
|
||||
});
|
||||
cut.Contains("data-bb-animation=\"true\"");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Offset_Ok()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user