@canvas-components/list-table 0.3.33 → 0.3.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -5
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +6 -5
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -783,6 +783,7 @@ function normalizeColumn(column, depth, parentKey) {
|
|
|
783
783
|
showExpandIcon: column.showExpandIcon,
|
|
784
784
|
ellipsis: column.ellipsis,
|
|
785
785
|
editable: column.editable,
|
|
786
|
+
showEditIcon: column.showEditIcon,
|
|
786
787
|
formItemProps: column.formItemProps,
|
|
787
788
|
allowSort: column.allowSort ?? (column.sorter != null ? column.sorter !== false : void 0),
|
|
788
789
|
sortValueGetter: column.sortValueGetter,
|
|
@@ -8850,7 +8851,7 @@ function drawHeaderCell(params, cell, clipRect) {
|
|
|
8850
8851
|
);
|
|
8851
8852
|
const isExpandSystemColumn = cell.node.children.length === 0 && cell.node.column.meta?.systemType === "expandable";
|
|
8852
8853
|
const isRowSelectorSystemColumn = cell.node.children.length === 0 && cell.node.column.meta?.systemType === "rowSelector";
|
|
8853
|
-
const isEditableLeaf = cell.node.children.length === 0 && !!cell.node.column.editable;
|
|
8854
|
+
const isEditableLeaf = cell.node.children.length === 0 && !!cell.node.column.editable && cell.node.column.showEditIcon === true;
|
|
8854
8855
|
const visibleState = getHeaderActionVisibilityState(
|
|
8855
8856
|
cell.node.key,
|
|
8856
8857
|
params.hoveredColumnKey,
|
|
@@ -10351,7 +10352,7 @@ function drawBodyNestedTableContent(params) {
|
|
|
10351
10352
|
actionVisibilityState,
|
|
10352
10353
|
allowActions: true,
|
|
10353
10354
|
hasFilter: column.allowFilter === true,
|
|
10354
|
-
hasEdit: !!column.editable
|
|
10355
|
+
hasEdit: !!column.editable && column.showEditIcon === true
|
|
10355
10356
|
});
|
|
10356
10357
|
const headerHighlighted = isNestedTableHeaderHighlighted(
|
|
10357
10358
|
content,
|
|
@@ -10732,7 +10733,7 @@ function drawNestedTableHeaderActions(params) {
|
|
|
10732
10733
|
const { actionTypes, startX, totalWidth } = getHeaderActionLayout({
|
|
10733
10734
|
rect,
|
|
10734
10735
|
hasFilter: column.allowFilter === true,
|
|
10735
|
-
hasEdit: !!column.editable,
|
|
10736
|
+
hasEdit: !!column.editable && column.showEditIcon === true,
|
|
10736
10737
|
visibilityState
|
|
10737
10738
|
});
|
|
10738
10739
|
drawParams.ctx.save();
|
|
@@ -10824,7 +10825,7 @@ function resolveNestedTableHeaderActionVisibility(params) {
|
|
|
10824
10825
|
sorted,
|
|
10825
10826
|
filtered,
|
|
10826
10827
|
fixed,
|
|
10827
|
-
visible: hovered || sorted || filtered || fixed || !!column.editable
|
|
10828
|
+
visible: hovered || sorted || filtered || fixed || !!column.editable && column.showEditIcon === true
|
|
10828
10829
|
};
|
|
10829
10830
|
}
|
|
10830
10831
|
function isNestedTableRowHighlighted(content, record, rowIndex, highlight, highlightMode) {
|
|
@@ -27976,7 +27977,7 @@ function buildListTableContextMenuConfig(params) {
|
|
|
27976
27977
|
summaryVisible,
|
|
27977
27978
|
onToggleSummary: isTableSettingsArea && actions.onToggleSummary ? () => actions.onToggleSummary?.() : void 0
|
|
27978
27979
|
};
|
|
27979
|
-
if (isSummaryArea && !isSelectionColumn && (actions.onChangeSummaryTitle || actions.onClearSummary || actions.onChangeSummaryType || actions.onChangeSummaryRoundingMode)) {
|
|
27980
|
+
if ((isSummaryArea || (isHeaderArea || isBodyArea) && currentColumn?.summaryTitle != null) && !isSelectionColumn && (actions.onChangeSummaryTitle || actions.onClearSummary || actions.onChangeSummaryType || actions.onChangeSummaryRoundingMode)) {
|
|
27980
27981
|
const column = findSummaryColumn(columns, columnKey);
|
|
27981
27982
|
const summary = resolveSummaryConfig2(column?.summary);
|
|
27982
27983
|
summaryConfig.summaryColumnKey = columnKey;
|
package/dist/index.d.cts
CHANGED
|
@@ -959,6 +959,8 @@ interface ListTableNestedTableColumn {
|
|
|
959
959
|
align?: ListTableHorizontalAlign;
|
|
960
960
|
/** 是否允许编辑子表格单元格。 */
|
|
961
961
|
editable?: ListTableEditable<Record<string, unknown>>;
|
|
962
|
+
/** 是否显示可编辑列的表头编辑图标,默认 false;不影响编辑能力。 */
|
|
963
|
+
showEditIcon?: boolean;
|
|
962
964
|
/** 子表格单元格编辑器配置。 */
|
|
963
965
|
formItemProps?: ListTableFormItemProps<Record<string, unknown>>;
|
|
964
966
|
fixed?: "left" | "right";
|
|
@@ -1138,6 +1140,8 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1138
1140
|
ellipsis?: boolean;
|
|
1139
1141
|
/** 是否允许进入编辑输入态。 */
|
|
1140
1142
|
editable?: ListTableEditable<RecordType>;
|
|
1143
|
+
/** 是否显示可编辑列的表头编辑图标,默认 false;不影响编辑能力。 */
|
|
1144
|
+
showEditIcon?: boolean;
|
|
1141
1145
|
/** 编辑器配置,未传时默认使用文本输入。 */
|
|
1142
1146
|
formItemProps?: ListTableFormItemProps<RecordType>;
|
|
1143
1147
|
/** 是否允许拖拽改变列宽。默认取表格级配置。 */
|
package/dist/index.d.ts
CHANGED
|
@@ -959,6 +959,8 @@ interface ListTableNestedTableColumn {
|
|
|
959
959
|
align?: ListTableHorizontalAlign;
|
|
960
960
|
/** 是否允许编辑子表格单元格。 */
|
|
961
961
|
editable?: ListTableEditable<Record<string, unknown>>;
|
|
962
|
+
/** 是否显示可编辑列的表头编辑图标,默认 false;不影响编辑能力。 */
|
|
963
|
+
showEditIcon?: boolean;
|
|
962
964
|
/** 子表格单元格编辑器配置。 */
|
|
963
965
|
formItemProps?: ListTableFormItemProps<Record<string, unknown>>;
|
|
964
966
|
fixed?: "left" | "right";
|
|
@@ -1138,6 +1140,8 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1138
1140
|
ellipsis?: boolean;
|
|
1139
1141
|
/** 是否允许进入编辑输入态。 */
|
|
1140
1142
|
editable?: ListTableEditable<RecordType>;
|
|
1143
|
+
/** 是否显示可编辑列的表头编辑图标,默认 false;不影响编辑能力。 */
|
|
1144
|
+
showEditIcon?: boolean;
|
|
1141
1145
|
/** 编辑器配置,未传时默认使用文本输入。 */
|
|
1142
1146
|
formItemProps?: ListTableFormItemProps<RecordType>;
|
|
1143
1147
|
/** 是否允许拖拽改变列宽。默认取表格级配置。 */
|
package/dist/index.js
CHANGED
|
@@ -761,6 +761,7 @@ function normalizeColumn(column, depth, parentKey) {
|
|
|
761
761
|
showExpandIcon: column.showExpandIcon,
|
|
762
762
|
ellipsis: column.ellipsis,
|
|
763
763
|
editable: column.editable,
|
|
764
|
+
showEditIcon: column.showEditIcon,
|
|
764
765
|
formItemProps: column.formItemProps,
|
|
765
766
|
allowSort: column.allowSort ?? (column.sorter != null ? column.sorter !== false : void 0),
|
|
766
767
|
sortValueGetter: column.sortValueGetter,
|
|
@@ -8828,7 +8829,7 @@ function drawHeaderCell(params, cell, clipRect) {
|
|
|
8828
8829
|
);
|
|
8829
8830
|
const isExpandSystemColumn = cell.node.children.length === 0 && cell.node.column.meta?.systemType === "expandable";
|
|
8830
8831
|
const isRowSelectorSystemColumn = cell.node.children.length === 0 && cell.node.column.meta?.systemType === "rowSelector";
|
|
8831
|
-
const isEditableLeaf = cell.node.children.length === 0 && !!cell.node.column.editable;
|
|
8832
|
+
const isEditableLeaf = cell.node.children.length === 0 && !!cell.node.column.editable && cell.node.column.showEditIcon === true;
|
|
8832
8833
|
const visibleState = getHeaderActionVisibilityState(
|
|
8833
8834
|
cell.node.key,
|
|
8834
8835
|
params.hoveredColumnKey,
|
|
@@ -10329,7 +10330,7 @@ function drawBodyNestedTableContent(params) {
|
|
|
10329
10330
|
actionVisibilityState,
|
|
10330
10331
|
allowActions: true,
|
|
10331
10332
|
hasFilter: column.allowFilter === true,
|
|
10332
|
-
hasEdit: !!column.editable
|
|
10333
|
+
hasEdit: !!column.editable && column.showEditIcon === true
|
|
10333
10334
|
});
|
|
10334
10335
|
const headerHighlighted = isNestedTableHeaderHighlighted(
|
|
10335
10336
|
content,
|
|
@@ -10710,7 +10711,7 @@ function drawNestedTableHeaderActions(params) {
|
|
|
10710
10711
|
const { actionTypes, startX, totalWidth } = getHeaderActionLayout({
|
|
10711
10712
|
rect,
|
|
10712
10713
|
hasFilter: column.allowFilter === true,
|
|
10713
|
-
hasEdit: !!column.editable,
|
|
10714
|
+
hasEdit: !!column.editable && column.showEditIcon === true,
|
|
10714
10715
|
visibilityState
|
|
10715
10716
|
});
|
|
10716
10717
|
drawParams.ctx.save();
|
|
@@ -10802,7 +10803,7 @@ function resolveNestedTableHeaderActionVisibility(params) {
|
|
|
10802
10803
|
sorted,
|
|
10803
10804
|
filtered,
|
|
10804
10805
|
fixed,
|
|
10805
|
-
visible: hovered || sorted || filtered || fixed || !!column.editable
|
|
10806
|
+
visible: hovered || sorted || filtered || fixed || !!column.editable && column.showEditIcon === true
|
|
10806
10807
|
};
|
|
10807
10808
|
}
|
|
10808
10809
|
function isNestedTableRowHighlighted(content, record, rowIndex, highlight, highlightMode) {
|
|
@@ -27954,7 +27955,7 @@ function buildListTableContextMenuConfig(params) {
|
|
|
27954
27955
|
summaryVisible,
|
|
27955
27956
|
onToggleSummary: isTableSettingsArea && actions.onToggleSummary ? () => actions.onToggleSummary?.() : void 0
|
|
27956
27957
|
};
|
|
27957
|
-
if (isSummaryArea && !isSelectionColumn && (actions.onChangeSummaryTitle || actions.onClearSummary || actions.onChangeSummaryType || actions.onChangeSummaryRoundingMode)) {
|
|
27958
|
+
if ((isSummaryArea || (isHeaderArea || isBodyArea) && currentColumn?.summaryTitle != null) && !isSelectionColumn && (actions.onChangeSummaryTitle || actions.onClearSummary || actions.onChangeSummaryType || actions.onChangeSummaryRoundingMode)) {
|
|
27958
27959
|
const column = findSummaryColumn(columns, columnKey);
|
|
27959
27960
|
const summary = resolveSummaryConfig2(column?.summary);
|
|
27960
27961
|
summaryConfig.summaryColumnKey = columnKey;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canvas-components/list-table",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.35",
|
|
4
4
|
"description": "Framework-agnostic list table core engine.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@ant-design/icons-svg": "4.6.0",
|
|
30
|
+
"@canvas-components/utils": "0.2.8",
|
|
31
|
+
"@canvas-components/chart": "0.3.8",
|
|
30
32
|
"@canvas-components/barcode": "0.2.2",
|
|
31
|
-
"@canvas-components/stats": "0.1.4",
|
|
32
33
|
"@canvas-components/qrcode": "0.2.2",
|
|
33
|
-
"@canvas-components/
|
|
34
|
-
"@canvas-components/utils": "0.2.8"
|
|
34
|
+
"@canvas-components/stats": "0.1.4"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsup --config tsup.config.ts"
|