File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed
src/BootstrapBlazor/Components/Table Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 1- // Licensed to the .NET Foundation under one or more agreements.
1+ // Licensed to the .NET Foundation under one or more agreements.
22// The .NET Foundation licenses this file to you under the Apache 2.0 License
33// See the LICENSE file in the project root for more information.
44// Maintainer: Argo Zhang([email protected] ) Website: https://www.blazor.zone @@ -175,7 +175,10 @@ private int MultipleSelectColumnLeft()
175175
176176 private string ? MultiColumnStyleString => GetFixedMultipleSelectColumn ? $ "left: { MultipleSelectColumnLeft ( ) } px;" : null ;
177177
178- private int MultiColumnWidth => ShowCheckboxText ? ShowCheckboxTextColumnWidth : CheckboxColumnWidth ;
178+ private int MultiColumnWidth => ShowCheckboxText ? ShowCheckboxTextColumnWidth :
179+ TableSize == TableSize . Normal
180+ ? CheckboxColumnWidth
181+ : CheckboxColumnCompactWidth ;
179182
180183 /// <summary>
181184 /// 获得指定列头固定列样式
@@ -290,7 +293,10 @@ private int CalcMargin()
290293 }
291294 if ( IsMultipleSelect )
292295 {
293- margin += ShowCheckboxText ? ShowCheckboxTextColumnWidth : CheckboxColumnWidth ;
296+ margin += ShowCheckboxText ? ShowCheckboxTextColumnWidth :
297+ TableSize == TableSize . Normal
298+ ? CheckboxColumnWidth
299+ : CheckboxColumnCompactWidth ;
294300 }
295301 if ( ShowLineNo )
296302 {
Original file line number Diff line number Diff line change @@ -339,6 +339,12 @@ private string GetSortTooltip(ITableColumn col) => SortName != col.GetFieldName(
339339 [ Parameter ]
340340 public int CheckboxColumnWidth { get ; set ; }
341341
342+ /// <summary>
343+ /// 获得/设置 紧凑模式下复选框宽度 默认 28
344+ /// </summary>
345+ [ Parameter ]
346+ public int CheckboxColumnCompactWidth { get ; set ; }
347+
342348 /// <summary>
343349 /// 获得/设置 行号列宽度 默认 60
344350 /// </summary>
@@ -877,9 +883,12 @@ private void OnInitParameters()
877883
878884 if ( CheckboxColumnWidth == 0 )
879885 {
880- CheckboxColumnWidth = TableSize == TableSize . Normal
881- ? op . TableSettings . CheckboxColumnWidth
882- : op . TableSettings . CheckboxColumnCompactWidth ;
886+ CheckboxColumnWidth = op . TableSettings . CheckboxColumnWidth ;
887+ }
888+
889+ if ( CheckboxColumnCompactWidth == 0 )
890+ {
891+ CheckboxColumnCompactWidth = op . TableSettings . CheckboxColumnCompactWidth ;
883892 }
884893
885894 if ( op . TableSettings . TableRenderMode != null && RenderMode == TableRenderMode . Auto )
You can’t perform that action at this time.
0 commit comments