@canvas-components/list-table 0.3.27 → 0.3.29
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 +25 -8
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +25 -8
- package/package.json +6 -6
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1182,6 +1182,11 @@ function saveHeaderSettingsColumn(columns, draft) {
|
|
|
1182
1182
|
return "\u5BBD\u5EA6\u987B\u4ECB\u4E8E\u6700\u5C0F\u5BBD\u5EA6\u548C\u6700\u5927\u5BBD\u5EA6\u4E4B\u95F4";
|
|
1183
1183
|
}
|
|
1184
1184
|
if (existing && !existing.userDefined) {
|
|
1185
|
+
if (draft.visible !== void 0) {
|
|
1186
|
+
if (!setHeaderColumnVisible(columns, draft.key, draft.visible)) {
|
|
1187
|
+
return "\u8BE5\u5217\u4E0D\u53EF\u9690\u85CF\uFF0C\u4E14\u8868\u683C\u81F3\u5C11\u9700\u8981\u5C55\u793A\u4E00\u5217";
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1185
1190
|
existing.title = title;
|
|
1186
1191
|
existing.settingTitle = title;
|
|
1187
1192
|
existing.userTitle = title;
|
|
@@ -1199,6 +1204,11 @@ function saveHeaderSettingsColumn(columns, draft) {
|
|
|
1199
1204
|
if (isHeaderDataIndexUsed(columns, dataIndex, draft.key)) {
|
|
1200
1205
|
return "\u8BE5 dataIndex \u5DF2\u88AB\u5176\u4ED6\u5217\u4F7F\u7528";
|
|
1201
1206
|
}
|
|
1207
|
+
if (existing && draft.visible !== void 0) {
|
|
1208
|
+
if (!setHeaderColumnVisible(columns, draft.key, draft.visible)) {
|
|
1209
|
+
return "\u8BE5\u5217\u4E0D\u53EF\u9690\u85CF\uFF0C\u4E14\u8868\u683C\u81F3\u5C11\u9700\u8981\u5C55\u793A\u4E00\u5217";
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1202
1212
|
const column = existing ?? { key: createUserColumnKey(columns) };
|
|
1203
1213
|
column.title = title;
|
|
1204
1214
|
column.settingTitle = title;
|
|
@@ -1207,6 +1217,7 @@ function saveHeaderSettingsColumn(columns, draft) {
|
|
|
1207
1217
|
column.minWidth = minWidth;
|
|
1208
1218
|
column.maxWidth = maxWidth;
|
|
1209
1219
|
column.fixed = draft.fixed;
|
|
1220
|
+
if (!existing) column.hidden = draft.visible === false;
|
|
1210
1221
|
column.userDefined = true;
|
|
1211
1222
|
column.allowSort = true;
|
|
1212
1223
|
column.sorter = true;
|
|
@@ -1214,6 +1225,8 @@ function saveHeaderSettingsColumn(columns, draft) {
|
|
|
1214
1225
|
moveColumnToOrder(siblings, existing, draft.order);
|
|
1215
1226
|
} else if (!existing) {
|
|
1216
1227
|
siblings.splice((draft.order ?? maxOrder) - 1, 0, column);
|
|
1228
|
+
if (draft.visible === false) normalizeHiddenState(columns);
|
|
1229
|
+
else setHeaderColumnVisible(columns, resolveColumnKey(column), true);
|
|
1217
1230
|
}
|
|
1218
1231
|
draft.key = resolveColumnKey(column);
|
|
1219
1232
|
return null;
|
|
@@ -19300,7 +19313,7 @@ var ListTableContentActionController = class {
|
|
|
19300
19313
|
options = { ...this.options.getOptions().exportOptions, ...options };
|
|
19301
19314
|
this.startExportTask(
|
|
19302
19315
|
(fileName, settings) => exportAllRowsXlsxContent({
|
|
19303
|
-
rows: this.options.getOptions().dataSource,
|
|
19316
|
+
rows: this.options.getExportRows?.() ?? this.options.getOptions().dataSource,
|
|
19304
19317
|
columns: getListTableExportCandidateColumns(
|
|
19305
19318
|
this.options.getOptions().columns
|
|
19306
19319
|
),
|
|
@@ -30260,7 +30273,7 @@ var ListTableEventController = class {
|
|
|
30260
30273
|
this.host.bodyTooltipController.clear();
|
|
30261
30274
|
},
|
|
30262
30275
|
getRows: () => this.host.getDisplayData(),
|
|
30263
|
-
getAllRows: () => this.host.
|
|
30276
|
+
getAllRows: () => this.host.getBaseDisplayData?.() ?? this.host.getDisplayData(),
|
|
30264
30277
|
getExportSummaryEnabled: () => Boolean(this.host.currentRenderSnapshot?.hasSummary),
|
|
30265
30278
|
getExportSortState: () => this.host.getSortState(),
|
|
30266
30279
|
getExportColumns: () => getListTableExportCandidateColumns(this.host.options.columns),
|
|
@@ -31586,7 +31599,7 @@ var ListTableEventController = class {
|
|
|
31586
31599
|
const contextMenu = nestedFeatures.length > 0 ? { features: nestedFeatures } : false;
|
|
31587
31600
|
const actions = createListTableContextMenuActions({
|
|
31588
31601
|
getRows: () => resolveNestedTableDisplayRows(content, getNestedState()),
|
|
31589
|
-
getAllRows: () => content
|
|
31602
|
+
getAllRows: () => resolveNestedTableDisplayRows(content, getNestedState()),
|
|
31590
31603
|
getExportSummaryEnabled: () => getNestedState()?.summaryVisible === true,
|
|
31591
31604
|
getExportSortState: () => getNestedState()?.sortState ?? [],
|
|
31592
31605
|
getColumns: () => columns,
|
|
@@ -33055,6 +33068,7 @@ function createListTableEventHost(core) {
|
|
|
33055
33068
|
// 可见行在百万行窗口化后只包含当前视口;事件层需要完整的查询结果,
|
|
33056
33069
|
// 否则自动列宽等基于全局 dataRowIndex 的逻辑会在深滚动时丢失采样行。
|
|
33057
33070
|
getDisplayData: () => core.queryController.getDisplayData(),
|
|
33071
|
+
getBaseDisplayData: () => core.queryController.getBaseDisplayData(),
|
|
33058
33072
|
getSortState: () => core.storeFacade.sortState,
|
|
33059
33073
|
getSummaryValueMap: () => core.summaryController.getSummaryValueMap(),
|
|
33060
33074
|
getSummaryValuesAsync: (snapshot) => core.summaryController.getSummaryValuesAsync(snapshot),
|
|
@@ -37073,6 +37087,7 @@ function assembleListTableCoreControllers(core, options) {
|
|
|
37073
37087
|
core.contentActionController = new ListTableContentActionController({
|
|
37074
37088
|
getSummaryVisible: () => Boolean(getCurrentRenderSnapshot()?.hasSummary),
|
|
37075
37089
|
getSortState: () => core.storeFacade.sortState,
|
|
37090
|
+
getExportRows: () => core.queryController.getBaseDisplayData(),
|
|
37076
37091
|
getOptions: () => core.options,
|
|
37077
37092
|
getLeafColumns: () => core.leafColumns,
|
|
37078
37093
|
overlayController: core.overlayController,
|
|
@@ -37509,6 +37524,7 @@ var ListTableCore = class {
|
|
|
37509
37524
|
* @param options 新配置。
|
|
37510
37525
|
*/
|
|
37511
37526
|
updateOptions(options) {
|
|
37527
|
+
const preserveTooltipAndFilterPanel = options.storageKey === this.options.storageKey;
|
|
37512
37528
|
const preserveContextMenu = options.dataSource !== this.options.dataSource || this.overlayController.shouldPreserveHeaderContextMenuOnOptionsUpdate();
|
|
37513
37529
|
this.persistenceController.invalidate();
|
|
37514
37530
|
if (options.storageKey === this.options.storageKey) {
|
|
@@ -37601,7 +37617,8 @@ var ListTableCore = class {
|
|
|
37601
37617
|
host.renderer?.updateDebugOptions(options.debug ?? {});
|
|
37602
37618
|
this.hideFloatingOverlays({
|
|
37603
37619
|
includeLoading: true,
|
|
37604
|
-
preserveContextMenu
|
|
37620
|
+
preserveContextMenu,
|
|
37621
|
+
preserveTooltipAndFilterPanel
|
|
37605
37622
|
});
|
|
37606
37623
|
this.refreshRuntimeColumns();
|
|
37607
37624
|
if (shouldPersistColumnConfig) {
|
|
@@ -37769,8 +37786,10 @@ var ListTableCore = class {
|
|
|
37769
37786
|
if (params?.includeLoading) {
|
|
37770
37787
|
this.overlayController.hideLoading();
|
|
37771
37788
|
}
|
|
37772
|
-
|
|
37773
|
-
|
|
37789
|
+
if (!params?.preserveTooltipAndFilterPanel) {
|
|
37790
|
+
this.overlayController.hideTooltip();
|
|
37791
|
+
this.overlayController.hideFilterPanel();
|
|
37792
|
+
}
|
|
37774
37793
|
this.overlayController.hideFixedPopup();
|
|
37775
37794
|
if (!params?.preserveContextMenu) {
|
|
37776
37795
|
this.overlayController.hideHeaderContextMenu();
|
|
@@ -37908,5 +37927,3 @@ exports.listTableAntdIconNames = listTableAntdIconNames;
|
|
|
37908
37927
|
exports.listTableBuiltinIconNames = listTableBuiltinIconNames;
|
|
37909
37928
|
exports.listTableIconNames = listTableIconNames;
|
|
37910
37929
|
exports.resetListTableStoredColumnConfig = resetListTableStoredColumnConfig;
|
|
37911
|
-
//# sourceMappingURL=index.cjs.map
|
|
37912
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1345,6 +1345,8 @@ interface HeaderContextMenuColumnDraft {
|
|
|
1345
1345
|
minWidth?: number;
|
|
1346
1346
|
maxWidth?: number;
|
|
1347
1347
|
fixed?: "left" | "right";
|
|
1348
|
+
/** 本次保存后是否展示该列;省略时保留现有状态。 */
|
|
1349
|
+
visible?: boolean;
|
|
1348
1350
|
sortOrder?: "ascend" | "descend" | null;
|
|
1349
1351
|
order?: number;
|
|
1350
1352
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1345,6 +1345,8 @@ interface HeaderContextMenuColumnDraft {
|
|
|
1345
1345
|
minWidth?: number;
|
|
1346
1346
|
maxWidth?: number;
|
|
1347
1347
|
fixed?: "left" | "right";
|
|
1348
|
+
/** 本次保存后是否展示该列;省略时保留现有状态。 */
|
|
1349
|
+
visible?: boolean;
|
|
1348
1350
|
sortOrder?: "ascend" | "descend" | null;
|
|
1349
1351
|
order?: number;
|
|
1350
1352
|
}
|
package/dist/index.js
CHANGED
|
@@ -1160,6 +1160,11 @@ function saveHeaderSettingsColumn(columns, draft) {
|
|
|
1160
1160
|
return "\u5BBD\u5EA6\u987B\u4ECB\u4E8E\u6700\u5C0F\u5BBD\u5EA6\u548C\u6700\u5927\u5BBD\u5EA6\u4E4B\u95F4";
|
|
1161
1161
|
}
|
|
1162
1162
|
if (existing && !existing.userDefined) {
|
|
1163
|
+
if (draft.visible !== void 0) {
|
|
1164
|
+
if (!setHeaderColumnVisible(columns, draft.key, draft.visible)) {
|
|
1165
|
+
return "\u8BE5\u5217\u4E0D\u53EF\u9690\u85CF\uFF0C\u4E14\u8868\u683C\u81F3\u5C11\u9700\u8981\u5C55\u793A\u4E00\u5217";
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1163
1168
|
existing.title = title;
|
|
1164
1169
|
existing.settingTitle = title;
|
|
1165
1170
|
existing.userTitle = title;
|
|
@@ -1177,6 +1182,11 @@ function saveHeaderSettingsColumn(columns, draft) {
|
|
|
1177
1182
|
if (isHeaderDataIndexUsed(columns, dataIndex, draft.key)) {
|
|
1178
1183
|
return "\u8BE5 dataIndex \u5DF2\u88AB\u5176\u4ED6\u5217\u4F7F\u7528";
|
|
1179
1184
|
}
|
|
1185
|
+
if (existing && draft.visible !== void 0) {
|
|
1186
|
+
if (!setHeaderColumnVisible(columns, draft.key, draft.visible)) {
|
|
1187
|
+
return "\u8BE5\u5217\u4E0D\u53EF\u9690\u85CF\uFF0C\u4E14\u8868\u683C\u81F3\u5C11\u9700\u8981\u5C55\u793A\u4E00\u5217";
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1180
1190
|
const column = existing ?? { key: createUserColumnKey(columns) };
|
|
1181
1191
|
column.title = title;
|
|
1182
1192
|
column.settingTitle = title;
|
|
@@ -1185,6 +1195,7 @@ function saveHeaderSettingsColumn(columns, draft) {
|
|
|
1185
1195
|
column.minWidth = minWidth;
|
|
1186
1196
|
column.maxWidth = maxWidth;
|
|
1187
1197
|
column.fixed = draft.fixed;
|
|
1198
|
+
if (!existing) column.hidden = draft.visible === false;
|
|
1188
1199
|
column.userDefined = true;
|
|
1189
1200
|
column.allowSort = true;
|
|
1190
1201
|
column.sorter = true;
|
|
@@ -1192,6 +1203,8 @@ function saveHeaderSettingsColumn(columns, draft) {
|
|
|
1192
1203
|
moveColumnToOrder(siblings, existing, draft.order);
|
|
1193
1204
|
} else if (!existing) {
|
|
1194
1205
|
siblings.splice((draft.order ?? maxOrder) - 1, 0, column);
|
|
1206
|
+
if (draft.visible === false) normalizeHiddenState(columns);
|
|
1207
|
+
else setHeaderColumnVisible(columns, resolveColumnKey(column), true);
|
|
1195
1208
|
}
|
|
1196
1209
|
draft.key = resolveColumnKey(column);
|
|
1197
1210
|
return null;
|
|
@@ -19278,7 +19291,7 @@ var ListTableContentActionController = class {
|
|
|
19278
19291
|
options = { ...this.options.getOptions().exportOptions, ...options };
|
|
19279
19292
|
this.startExportTask(
|
|
19280
19293
|
(fileName, settings) => exportAllRowsXlsxContent({
|
|
19281
|
-
rows: this.options.getOptions().dataSource,
|
|
19294
|
+
rows: this.options.getExportRows?.() ?? this.options.getOptions().dataSource,
|
|
19282
19295
|
columns: getListTableExportCandidateColumns(
|
|
19283
19296
|
this.options.getOptions().columns
|
|
19284
19297
|
),
|
|
@@ -30238,7 +30251,7 @@ var ListTableEventController = class {
|
|
|
30238
30251
|
this.host.bodyTooltipController.clear();
|
|
30239
30252
|
},
|
|
30240
30253
|
getRows: () => this.host.getDisplayData(),
|
|
30241
|
-
getAllRows: () => this.host.
|
|
30254
|
+
getAllRows: () => this.host.getBaseDisplayData?.() ?? this.host.getDisplayData(),
|
|
30242
30255
|
getExportSummaryEnabled: () => Boolean(this.host.currentRenderSnapshot?.hasSummary),
|
|
30243
30256
|
getExportSortState: () => this.host.getSortState(),
|
|
30244
30257
|
getExportColumns: () => getListTableExportCandidateColumns(this.host.options.columns),
|
|
@@ -31564,7 +31577,7 @@ var ListTableEventController = class {
|
|
|
31564
31577
|
const contextMenu = nestedFeatures.length > 0 ? { features: nestedFeatures } : false;
|
|
31565
31578
|
const actions = createListTableContextMenuActions({
|
|
31566
31579
|
getRows: () => resolveNestedTableDisplayRows(content, getNestedState()),
|
|
31567
|
-
getAllRows: () => content
|
|
31580
|
+
getAllRows: () => resolveNestedTableDisplayRows(content, getNestedState()),
|
|
31568
31581
|
getExportSummaryEnabled: () => getNestedState()?.summaryVisible === true,
|
|
31569
31582
|
getExportSortState: () => getNestedState()?.sortState ?? [],
|
|
31570
31583
|
getColumns: () => columns,
|
|
@@ -33033,6 +33046,7 @@ function createListTableEventHost(core) {
|
|
|
33033
33046
|
// 可见行在百万行窗口化后只包含当前视口;事件层需要完整的查询结果,
|
|
33034
33047
|
// 否则自动列宽等基于全局 dataRowIndex 的逻辑会在深滚动时丢失采样行。
|
|
33035
33048
|
getDisplayData: () => core.queryController.getDisplayData(),
|
|
33049
|
+
getBaseDisplayData: () => core.queryController.getBaseDisplayData(),
|
|
33036
33050
|
getSortState: () => core.storeFacade.sortState,
|
|
33037
33051
|
getSummaryValueMap: () => core.summaryController.getSummaryValueMap(),
|
|
33038
33052
|
getSummaryValuesAsync: (snapshot) => core.summaryController.getSummaryValuesAsync(snapshot),
|
|
@@ -37051,6 +37065,7 @@ function assembleListTableCoreControllers(core, options) {
|
|
|
37051
37065
|
core.contentActionController = new ListTableContentActionController({
|
|
37052
37066
|
getSummaryVisible: () => Boolean(getCurrentRenderSnapshot()?.hasSummary),
|
|
37053
37067
|
getSortState: () => core.storeFacade.sortState,
|
|
37068
|
+
getExportRows: () => core.queryController.getBaseDisplayData(),
|
|
37054
37069
|
getOptions: () => core.options,
|
|
37055
37070
|
getLeafColumns: () => core.leafColumns,
|
|
37056
37071
|
overlayController: core.overlayController,
|
|
@@ -37487,6 +37502,7 @@ var ListTableCore = class {
|
|
|
37487
37502
|
* @param options 新配置。
|
|
37488
37503
|
*/
|
|
37489
37504
|
updateOptions(options) {
|
|
37505
|
+
const preserveTooltipAndFilterPanel = options.storageKey === this.options.storageKey;
|
|
37490
37506
|
const preserveContextMenu = options.dataSource !== this.options.dataSource || this.overlayController.shouldPreserveHeaderContextMenuOnOptionsUpdate();
|
|
37491
37507
|
this.persistenceController.invalidate();
|
|
37492
37508
|
if (options.storageKey === this.options.storageKey) {
|
|
@@ -37579,7 +37595,8 @@ var ListTableCore = class {
|
|
|
37579
37595
|
host.renderer?.updateDebugOptions(options.debug ?? {});
|
|
37580
37596
|
this.hideFloatingOverlays({
|
|
37581
37597
|
includeLoading: true,
|
|
37582
|
-
preserveContextMenu
|
|
37598
|
+
preserveContextMenu,
|
|
37599
|
+
preserveTooltipAndFilterPanel
|
|
37583
37600
|
});
|
|
37584
37601
|
this.refreshRuntimeColumns();
|
|
37585
37602
|
if (shouldPersistColumnConfig) {
|
|
@@ -37747,8 +37764,10 @@ var ListTableCore = class {
|
|
|
37747
37764
|
if (params?.includeLoading) {
|
|
37748
37765
|
this.overlayController.hideLoading();
|
|
37749
37766
|
}
|
|
37750
|
-
|
|
37751
|
-
|
|
37767
|
+
if (!params?.preserveTooltipAndFilterPanel) {
|
|
37768
|
+
this.overlayController.hideTooltip();
|
|
37769
|
+
this.overlayController.hideFilterPanel();
|
|
37770
|
+
}
|
|
37752
37771
|
this.overlayController.hideFixedPopup();
|
|
37753
37772
|
if (!params?.preserveContextMenu) {
|
|
37754
37773
|
this.overlayController.hideHeaderContextMenu();
|
|
@@ -37878,5 +37897,3 @@ __publicField(ListTable, "SELECTION_COLUMN", SELECTION_COLUMN);
|
|
|
37878
37897
|
__publicField(ListTable, "ROW_SELECTION_COLUMN", ROW_SELECTION_COLUMN);
|
|
37879
37898
|
|
|
37880
37899
|
export { EXPAND_COLUMN, ListTable, ROW_SELECTION_COLUMN, SELECTION_COLUMN, getListTableStoredPageSize, listTableAntdIconNames, listTableBuiltinIconNames, listTableIconNames, resetListTableStoredColumnConfig };
|
|
37881
|
-
//# sourceMappingURL=index.js.map
|
|
37882
|
-
//# sourceMappingURL=index.js.map
|
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.29",
|
|
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/barcode": "0.2.
|
|
31
|
-
"@canvas-components/
|
|
32
|
-
"@canvas-components/utils": "0.2.
|
|
33
|
-
"@canvas-components/
|
|
34
|
-
"@canvas-components/chart": "0.3.
|
|
30
|
+
"@canvas-components/barcode": "0.2.2",
|
|
31
|
+
"@canvas-components/stats": "0.1.4",
|
|
32
|
+
"@canvas-components/utils": "0.2.8",
|
|
33
|
+
"@canvas-components/qrcode": "0.2.2",
|
|
34
|
+
"@canvas-components/chart": "0.3.7"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsup --config tsup.config.ts"
|