feat(Table): add AlignLeftText/AlignCenterText/AlignRightText parameter (#3942)

This commit is contained in:
Argo Zhang 2024-07-27 22:03:08 +08:00 committed by GitHub
parent 9b627d009b
commit bd1fc279e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 67 additions and 13 deletions

View File

@ -424,5 +424,12 @@ public partial class Table<TItem>
AdvancedSortModalTitle ??= Localizer[nameof(AdvancedSortModalTitle)];
ColumnWidthTooltipPrefix ??= Localizer[nameof(ColumnWidthTooltipPrefix)];
AlignLeftText ??= Localizer[nameof(AlignLeftText)];
AlignLeftTooltipText ??= Localizer[nameof(AlignLeftTooltipText)];
AlignCenterText ??= Localizer[nameof(AlignCenterText)];
AlignCenterTooltipText ??= Localizer[nameof(AlignCenterTooltipText)];
AlignRightText ??= Localizer[nameof(AlignRightText)];
AlignRightTooltipText ??= Localizer[nameof(AlignRightTooltipText)];
}
}

View File

@ -675,6 +675,48 @@ public partial class Table<TItem> : ITable, IModelEqualityComparer<TItem> where
[Parameter]
public string? ClientTableName { get; set; }
/// <summary>
/// 获得/设置 左对齐显示文本
/// </summary>
[Parameter]
[NotNull]
public string? AlignLeftText { get; set; }
/// <summary>
/// 获得/设置左对齐提示信息文本
/// </summary>
[Parameter]
[NotNull]
public string? AlignLeftTooltipText { get; set; }
/// <summary>
/// 获得/设置 居中对齐显示文本
/// </summary>
[Parameter]
[NotNull]
public string? AlignCenterText { get; set; }
/// <summary>
/// 获得/设置 居中对齐提示信息文本
/// </summary>
[Parameter]
[NotNull]
public string? AlignCenterTooltipText { get; set; }
/// <summary>
/// 获得/设置 右对齐显示文本
/// </summary>
[Parameter]
[NotNull]
public string? AlignRightText { get; set; }
/// <summary>
/// 获得/设置 右对齐提示信息文本
/// </summary>
[Parameter]
[NotNull]
public string? AlignRightTooltipText { get; set; }
[CascadingParameter]
private ContextMenuZone? ContextMenuZone { get; set; }
@ -941,22 +983,22 @@ public partial class Table<TItem> : ITable, IModelEqualityComparer<TItem> where
{
Key = "align-left",
Icon = "fa-solid fa-align-left",
Text = Localizer["AlignLeft"].Value,
Tooltip = Localizer["AlignLeftTooltip"].Value
Text = Localizer["AlignLeftText"].Value,
Tooltip = Localizer["AlignLeftTooltipText"].Value
},
new
{
Key = "align-center",
Icon = "fa-solid fa-align-center",
Text = Localizer["AlignCenter"].Value,
Tooltip = Localizer["AlignCenterTooltip"].Value
Text = Localizer["AlignCenterText"].Value,
Tooltip = Localizer["AlignCenterTooltipText"].Value
},
new
{
Key = "align-left",
Icon = "fa-solid fa-align-right",
Text = Localizer["AlignRight"].Value,
Tooltip = Localizer["AlignRightTooltip"].Value
Text = Localizer["AlignRightText"].Value,
Tooltip = Localizer["AlignRightTooltipText"].Value
}
}
});

View File

@ -240,9 +240,12 @@
"CopyColumnCopiedTooltipText": "Copied!",
"ColumnWidthTooltipPrefix": "width: ",
"ColumnToolboxTitle": "Tools",
"AlignLeft": "Left",
"AlignCenter": "Center",
"AlignRight": "Right"
"AlignLeftText": "Left",
"AlignLeftTooltipText": "Click to align text in this column to the left",
"AlignCenterText": "Center",
"AlignCenterTooltipText": "Click to align text in this column to the center",
"AlignRightText": "Right",
"AlignRightTooltipText": "Click to align text in this column to the right"
},
"BootstrapBlazor.Components.EditDialog": {
"CloseButtonText": "Close",

View File

@ -240,10 +240,12 @@
"CopyColumnCopiedTooltipText": "已拷贝",
"ColumnWidthTooltipPrefix": "宽度:",
"ColumnToolboxTitle": "操作",
"AlignLeft": "左对齐",
"AlignLeftTooltip": "点击后本列文本左对齐",
"AlignCenter": "居中",
"AlignRight": "右对齐"
"AlignLeftText": "左对齐",
"AlignLeftTooltipText": "点击后本列文本左对齐",
"AlignCenterText": "居中",
"AlignCenterTooltipText": "点击后本列文本居中对齐",
"AlignRightText": "右对齐",
"AlignRightTooltipText": "点击后本列文本右对齐"
},
"BootstrapBlazor.Components.EditDialog": {
"CloseButtonText": "关闭",