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
4 changes: 3 additions & 1 deletion src/BootstrapBlazor.Server/Components/App.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inject IWebHostEnvironment Env
@inject IWebHostEnvironment Env
@inject IStringLocalizer<BaseLayout> Localizer
@inject IOptions<WebsiteOptions> WebsiteOption

Expand All @@ -20,6 +20,8 @@
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="favicon.png">

<ResourcePreloader />

<link rel="stylesheet" href="@Assets["_content/BootstrapBlazor.FontAwesome/css/font-awesome.min.css"]" />
<link rel="stylesheet" href="@Assets["_content/BootstrapBlazor.MaterialDesign/css/md.min.css"]" />
<link rel="stylesheet" href="@Assets["_content/BootstrapBlazor.BootstrapIcon/css/bootstrap.min.css"]" />
Expand Down
48 changes: 24 additions & 24 deletions src/BootstrapBlazor/Attributes/AutoGenerateBaseAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,76 +12,76 @@ namespace BootstrapBlazor.Components;
public abstract class AutoGenerateBaseAttribute : Attribute
{
/// <summary>
/// <para lang="zh">获得/设置 当前列是否可编辑。默认为 true。当设置为 false 时,自动编辑 UI 不会生成此列</para>
/// <para lang="en">Gets or sets whether the current column is editable. Default is true. When set to false, the auto-generated edit UI will not generate this column.</para>
/// <para lang="zh">获得/设置 当前列是否可编辑。默认为 true。当设置为 false 时,自动编辑 UI 不会生成此列</para>
/// <para lang="en">Gets or sets whether the current column is editable. Default is true. When set to false, the auto-generated edit UI will not generate this column</para>
/// </summary>
[Obsolete("Deprecated. If it is editable, use the Readonly parameter. If it is visible, use the Ignore parameter.")]
[ExcludeFromCodeCoverage]
public bool Editable { get; set; } = true;

/// <summary>
/// <para lang="zh">获得/设置 当前列是否渲染。默认为 false。当设置为 true 时,UI 不会生成此列</para>
/// <para lang="en">Gets or sets whether the current column is rendered. Default is false. When set to true, the UI will not generate this column.</para>
/// <para lang="zh">获得/设置 当前列是否渲染。默认为 false。当设置为 true 时,UI 不会生成此列</para>
/// <para lang="en">Gets or sets whether the current column is rendered. Default is false. When set to true, the UI will not generate this column</para>
/// </summary>
public bool Ignore { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 当前编辑项是否只读。默认为 false</para>
/// <para lang="en">Gets or sets whether the current edit item is read-only. Default is false.</para>
/// <para lang="zh">获得/设置 当前编辑项是否只读。默认为 false</para>
/// <para lang="en">Gets or sets whether the current edit item is read-only. Default is false</para>
/// </summary>
public bool Readonly { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 当前编辑项是否可见。默认为 true</para>
/// <para lang="en">Gets or sets whether the current edit item is visible. Default is true.</para>
/// <para lang="zh">获得/设置 当前编辑项是否可见。默认为 true</para>
/// <para lang="en">Gets or sets whether the current edit item is visible. Default is true</para>
/// </summary>
public bool Visible { get; set; } = true;

/// <summary>
/// <para lang="zh">获得/设置 是否允许排序。默认为 false</para>
/// <para lang="en">Gets or sets whether sorting is allowed. Default is false.</para>
/// <para lang="zh">获得/设置 是否允许排序。默认为 false</para>
/// <para lang="en">Gets or sets whether sorting is allowed. Default is false</para>
/// </summary>
public bool Sortable { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 是否允许数据筛选。默认为 false</para>
/// <para lang="en">Gets or sets whether data filtering is allowed. Default is false.</para>
/// <para lang="zh">获得/设置 是否允许数据筛选。默认为 false</para>
/// <para lang="en">Gets or sets whether data filtering is allowed. Default is false</para>
/// </summary>
public bool Filterable { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 此列是否参与搜索。默认为 false</para>
/// <para lang="en">Gets or sets whether the column participates in search. Default is false.</para>
/// <para lang="zh">获得/设置 此列是否参与搜索。默认为 false</para>
/// <para lang="en">Gets or sets whether the column participates in search. Default is false</para>
/// </summary>
public bool Searchable { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 此列是否允许文本换行。默认为 false</para>
/// <para lang="en">Gets or sets whether text wrapping is allowed in this column. Default is false.</para>
/// <para lang="zh">获得/设置 此列是否允许文本换行。默认为 false</para>
/// <para lang="en">Gets or sets whether text wrapping is allowed in this column. Default is false</para>
/// </summary>
public bool TextWrap { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 此列文本溢出时是否显示省略号。默认为 false</para>
/// <para lang="en">Gets or sets whether text overflow is ellipsis in this column. Default is false.</para>
/// <para lang="zh">获得/设置 此列文本溢出时是否显示省略号。默认为 false</para>
/// <para lang="en">Gets or sets whether text overflow is ellipsis in this column. Default is false</para>
/// </summary>
public bool TextEllipsis { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 文本对齐方式。默认为 Alignment.None</para>
/// <para lang="en">Gets or sets the text alignment. Default is Alignment.None.</para>
/// <para lang="zh">获得/设置 文本对齐方式。默认为 Alignment.None</para>
/// <para lang="en">Gets or sets the text alignment. Default is Alignment.None</para>
/// </summary>
public Alignment Align { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 鼠标悬停时是否显示提示信息。默认为 false</para>
/// <para lang="en">Gets or sets whether to show tooltips on mouse hover. Default is false.</para>
/// <para lang="zh">获得/设置 鼠标悬停时是否显示提示信息。默认为 false</para>
/// <para lang="en">Gets or sets whether to show tooltips on mouse hover. Default is false</para>
/// </summary>
public bool ShowTips { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 列是否可以被复制。默认为 false</para>
/// <para lang="en">Gets or sets whether the column can be copied. Default is false.</para>
/// <para lang="zh">获得/设置 列是否可以被复制。默认为 false</para>
/// <para lang="en">Gets or sets whether the column can be copied. Default is false</para>
/// </summary>
public bool ShowCopyColumn { get; set; }
}
28 changes: 14 additions & 14 deletions src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
public bool SkipValidate { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 新建时此列是否只读。默认值为 null,使用 <see cref="IEditorItem.Readonly"/> 值</para>
/// <para lang="en">Gets or sets whether the column is read-only when adding a new item. Default is null, using the <see cref="IEditorItem.Readonly"/> value.</para>
/// <para lang="zh">获得/设置 新建时此列是否只读。默认值为 null,使用 <see cref="IEditorItem.Readonly"/> 值</para>
/// <para lang="en">Gets or sets whether the column is read-only when adding a new item. Default is null, using the <see cref="IEditorItem.Readonly"/> value</para>
/// </summary>
public bool IsReadonlyWhenAdd { get; set; }

Expand All @@ -47,8 +47,8 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
}

/// <summary>
/// <para lang="zh">获得/设置 编辑时此列是否只读。默认值为 null,使用 <see cref="IEditorItem.Readonly"/> 值</para>
/// <para lang="en">Gets or sets whether the column is read-only when editing an item. Default is null, using the <see cref="IEditorItem.Readonly"/> value.</para>
/// <para lang="zh">获得/设置 编辑时此列是否只读。默认值为 null,使用 <see cref="IEditorItem.Readonly"/> 值</para>
/// <para lang="en">Gets or sets whether the column is read-only when editing an item. Default is null, using the <see cref="IEditorItem.Readonly"/> value</para>
/// </summary>
public bool IsReadonlyWhenEdit { get; set; }

Expand All @@ -59,8 +59,8 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
}

/// <summary>
/// <para lang="zh">获得/设置 新建时此列是否可见。默认值为 null,使用 <see cref="AutoGenerateBaseAttribute.Visible"/> 值</para>
/// <para lang="en">Gets or sets whether the column is visible when adding a new item. Default is null, using the <see cref="AutoGenerateBaseAttribute.Visible"/> value.</para>
/// <para lang="zh">获得/设置 新建时此列是否可见。默认值为 null,使用 <see cref="AutoGenerateBaseAttribute.Visible"/> 值</para>
/// <para lang="en">Gets or sets whether the column is visible when adding a new item. Default is null, using the <see cref="AutoGenerateBaseAttribute.Visible"/> value</para>
/// </summary>
public bool IsVisibleWhenAdd { get; set; } = true;

Expand All @@ -71,8 +71,8 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
}

/// <summary>
/// <para lang="zh">获得/设置 编辑时此列是否可见。默认值为 null,使用 <see cref="AutoGenerateBaseAttribute.Visible"/> 值</para>
/// <para lang="en">Gets or sets whether the column is visible when editing an item. Default is null, using the <see cref="AutoGenerateBaseAttribute.Visible"/> value.</para>
/// <para lang="zh">获得/设置 编辑时此列是否可见。默认值为 null,使用 <see cref="AutoGenerateBaseAttribute.Visible"/> 值</para>
/// <para lang="en">Gets or sets whether the column is visible when editing an item. Default is null, using the <see cref="AutoGenerateBaseAttribute.Visible"/> value</para>
/// </summary>
public bool IsVisibleWhenEdit { get; set; } = true;

Expand All @@ -96,8 +96,8 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
public string? RequiredErrorMessage { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 是否显示标签工具提示。通常用于标签文本过长被截断时。默认为 false</para>
/// <para lang="en">Gets or sets whether to show label tooltip. Mostly used when the label text is too long and gets truncated. Default is false.</para>
/// <para lang="zh">获得/设置 是否显示标签工具提示。通常用于标签文本过长被截断时。默认为 false</para>
/// <para lang="en">Gets or sets whether to show label tooltip. Mostly used when the label text is too long and gets truncated. Default is false</para>
/// </summary>
public bool ShowLabelTooltip { get; set; }

Expand All @@ -108,16 +108,16 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
}

/// <summary>
/// <para lang="zh">获得/设置 默认排序顺序。默认为 SortOrder.Unset</para>
/// <para lang="en">Gets or sets the default sort order. Default is SortOrder.Unset.</para>
/// <para lang="zh">获得/设置 默认排序顺序。默认为 SortOrder.Unset</para>
/// <para lang="en">Gets or sets the default sort order. Default is SortOrder.Unset</para>
/// </summary>
public SortOrder DefaultSortOrder { get; set; }

IEnumerable<SelectedItem>? IEditorItem.Items { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 列宽</para>
/// <para lang="en">Gets or sets the column width.</para>
/// <para lang="zh">获得/设置 列宽</para>
/// <para lang="en">Gets or sets the column width</para>
/// </summary>
public int Width { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace BootstrapBlazor.Components;
class BootstrapModuleAutoLoaderAttribute(string? path = null) : JSModuleAutoLoaderAttribute(path)
{
/// <summary>
/// <para lang="zh">获得/设置 模块名称。自动使用 modules 文件夹中的脚本</para>
/// <para lang="en">Gets or sets the module name. Automatically uses scripts from the modules folder.</para>
/// <para lang="zh">获得/设置 模块名称。自动使用 modules 文件夹中的脚本</para>
/// <para lang="en">Gets or sets the module name. Automatically uses scripts from the modules folder</para>
/// </summary>
public string? ModuleName { get; set; }
}
12 changes: 6 additions & 6 deletions src/BootstrapBlazor/Attributes/JSModuleAutoLoaderAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ public class JSModuleAutoLoaderAttribute(string? path = null) : Attribute
public string? Path { get; } = path;

/// <summary>
/// <para lang="zh">表示对 JavaScript 对象的引用。默认值为 false</para>
/// <para lang="en">Represents a reference to a JavaScript object. Default value is false.</para>
/// <para lang="zh">表示对 JavaScript 对象的引用。默认值为 false</para>
/// <para lang="en">Represents a reference to a JavaScript object. Default value is false</para>
/// </summary>
public bool JSObjectReference { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 是否自动调用 init。默认值为 true</para>
/// <para lang="en">Gets or sets whether to automatically invoke init. Default is true.</para>
/// <para lang="zh">获得/设置 是否自动调用 init。默认值为 true</para>
/// <para lang="en">Gets or sets whether to automatically invoke init. Default is true</para>
/// </summary>
public bool AutoInvokeInit { get; set; } = true;

/// <summary>
/// <para lang="zh">获得/设置 是否自动调用 dispose。默认值为 true</para>
/// <para lang="en">Gets or sets whether to automatically invoke dispose. Default is true.</para>
/// <para lang="zh">获得/设置 是否自动调用 dispose。默认值为 true</para>
/// <para lang="en">Gets or sets whether to automatically invoke dispose. Default is true</para>
/// </summary>
public bool AutoInvokeDispose { get; set; } = true;
}
8 changes: 4 additions & 4 deletions src/BootstrapBlazor/Attributes/PlaceHolderAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
namespace BootstrapBlazor.Components;

/// <summary>
/// <para lang="zh">PlaceHolderAttribute 类,用于定义属性的占位符</para>
/// <para lang="en">PlaceHolderAttribute class used to define a placeholder for a property.</para>
/// <para lang="zh">PlaceHolderAttribute 类,用于定义属性的占位符</para>
/// <para lang="en">PlaceHolderAttribute class used to define a placeholder for a property</para>
/// </summary>
/// <param name="placeholder"><para lang="zh">占位符文本</para><para lang="en">The placeholder text.</para></param>
/// <param name="placeholder"><para lang="zh">占位符文本</para><para lang="en">The placeholder text</para></param>
[AttributeUsage(AttributeTargets.Property)]
public class PlaceHolderAttribute(string placeholder) : Attribute
{
/// <summary>
/// <para lang="zh">获得 占位符文本</para>
/// <para lang="en">Gets the placeholder text.</para>
/// <para lang="en">Gets the placeholder text</para>
/// </summary>
public string Text => placeholder;
}
8 changes: 4 additions & 4 deletions src/BootstrapBlazor/Attributes/TabItemOptionAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ public class TabItemOptionAttribute : Attribute
{
/// <summary>
/// <para lang="zh">获得/设置 TabItem 文本</para>
/// <para lang="en">Gets or sets the text of the tab item.</para>
/// <para lang="en">Gets or sets the text of the tab item</para>
/// </summary>
public string? Text { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 当前 TabItem 是否可关闭。默认值为 true</para>
/// <para lang="en">Gets or sets whether the current TabItem is closable. Default is true.</para>
/// <para lang="zh">获得/设置 当前 TabItem 是否可关闭。默认值为 true</para>
/// <para lang="en">Gets or sets whether the current TabItem is closable. Default is true</para>
/// </summary>
public bool Closable { get; set; } = true;

/// <summary>
/// <para lang="zh">获得/设置 图标字符串</para>
/// <para lang="en">Gets or sets the icon string.</para>
/// <para lang="en">Gets or sets the icon string</para>
/// </summary>
public string? Icon { get; set; }
}
12 changes: 6 additions & 6 deletions src/BootstrapBlazor/Attributes/TableMetadataForAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ namespace BootstrapBlazor.Components;

/// <summary>
/// <para lang="zh">定义目标数据类型的 UI 生成元数据组</para>
/// <para lang="zh">通常模型类型位于与 Blazor 组件 UI 层不同的层</para>
/// <para lang="zh">在这种情况下,使用 <see cref="TableMetadataForAttribute"/> 为 Table 组件定义元数据类型</para>
/// <para lang="zh">通常模型类型位于与 Blazor 组件 UI 层不同的层</para>
/// <para lang="zh">在这种情况下,使用 <see cref="TableMetadataForAttribute"/> 为 Table 组件定义元数据类型</para>
/// <para lang="zh">然后使用 <seealso cref="TableMetadataTypeService"/> 注册元数据类型</para>
/// <para lang="en">Define a group of UI generation metadata for target data type</para>
/// <para lang="en">Usually model types are at different layer to the blazor component UI layer.</para>
/// <para lang="en">In this case, use <see cref="TableMetadataForAttribute"/> to define a metadata type for Table component.</para>
/// <para lang="en">Usually model types are at different layer to the blazor component UI layer</para>
/// <para lang="en">In this case, use <see cref="TableMetadataForAttribute"/> to define a metadata type for Table component</para>
/// <para lang="en">Then register metadata type with <seealso cref="TableMetadataTypeService"/></para>
///
/// <example>
Expand Down Expand Up @@ -42,9 +42,9 @@ namespace BootstrapBlazor.Components;
/// public string? Name2 { get; set; }
/// }
/// </code>
/// <para lang="zh">在使用元数据之前,需要注册元数据类型</para>
/// <para lang="zh">在使用元数据之前,需要注册元数据类型</para>
/// <para lang="zh">在程序集中注册元数据类型</para>
/// <para lang="en">before using the metadata, it needs to register the metadata types.</para>
/// <para lang="en">before using the metadata, it needs to register the metadata types</para>
/// <para lang="en">register metadata types in assembly</para>
/// <code>
/// TableMetadataTypeService.RegisterMetadataTypes(typeof(Pig).Assembly);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public partial class AutoComplete

/// <summary>
/// <para lang="zh">获得 清除图标样式</para>
/// <para lang="en">Gets the clear icon class string.</para>
/// <para lang="en">Gets the clear icon class string</para>
/// </summary>
private string? ClearClassString => CssBuilder.Default("clear-icon")
.AddClass($"text-{Color.ToDescriptionString()}", Color != Color.None)
Expand Down Expand Up @@ -176,7 +176,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)

/// <summary>
/// <para lang="zh">获得 是否显示清除按钮</para>
/// <para lang="en">Gets whether show the clear button.</para>
/// <para lang="en">Gets whether show the clear button</para>
/// </summary>
private bool GetClearable() => IsClearable && !IsDisabled;

Expand Down
Loading
Loading