@canvas-components/list-table 0.3.28 → 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 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;
@@ -37511,6 +37524,7 @@ var ListTableCore = class {
37511
37524
  * @param options 新配置。
37512
37525
  */
37513
37526
  updateOptions(options) {
37527
+ const preserveTooltipAndFilterPanel = options.storageKey === this.options.storageKey;
37514
37528
  const preserveContextMenu = options.dataSource !== this.options.dataSource || this.overlayController.shouldPreserveHeaderContextMenuOnOptionsUpdate();
37515
37529
  this.persistenceController.invalidate();
37516
37530
  if (options.storageKey === this.options.storageKey) {
@@ -37603,7 +37617,8 @@ var ListTableCore = class {
37603
37617
  host.renderer?.updateDebugOptions(options.debug ?? {});
37604
37618
  this.hideFloatingOverlays({
37605
37619
  includeLoading: true,
37606
- preserveContextMenu
37620
+ preserveContextMenu,
37621
+ preserveTooltipAndFilterPanel
37607
37622
  });
37608
37623
  this.refreshRuntimeColumns();
37609
37624
  if (shouldPersistColumnConfig) {
@@ -37771,8 +37786,10 @@ var ListTableCore = class {
37771
37786
  if (params?.includeLoading) {
37772
37787
  this.overlayController.hideLoading();
37773
37788
  }
37774
- this.overlayController.hideTooltip();
37775
- this.overlayController.hideFilterPanel();
37789
+ if (!params?.preserveTooltipAndFilterPanel) {
37790
+ this.overlayController.hideTooltip();
37791
+ this.overlayController.hideFilterPanel();
37792
+ }
37776
37793
  this.overlayController.hideFixedPopup();
37777
37794
  if (!params?.preserveContextMenu) {
37778
37795
  this.overlayController.hideHeaderContextMenu();
@@ -37910,5 +37927,3 @@ exports.listTableAntdIconNames = listTableAntdIconNames;
37910
37927
  exports.listTableBuiltinIconNames = listTableBuiltinIconNames;
37911
37928
  exports.listTableIconNames = listTableIconNames;
37912
37929
  exports.resetListTableStoredColumnConfig = resetListTableStoredColumnConfig;
37913
- //# sourceMappingURL=index.cjs.map
37914
- //# 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;
@@ -37489,6 +37502,7 @@ var ListTableCore = class {
37489
37502
  * @param options 新配置。
37490
37503
  */
37491
37504
  updateOptions(options) {
37505
+ const preserveTooltipAndFilterPanel = options.storageKey === this.options.storageKey;
37492
37506
  const preserveContextMenu = options.dataSource !== this.options.dataSource || this.overlayController.shouldPreserveHeaderContextMenuOnOptionsUpdate();
37493
37507
  this.persistenceController.invalidate();
37494
37508
  if (options.storageKey === this.options.storageKey) {
@@ -37581,7 +37595,8 @@ var ListTableCore = class {
37581
37595
  host.renderer?.updateDebugOptions(options.debug ?? {});
37582
37596
  this.hideFloatingOverlays({
37583
37597
  includeLoading: true,
37584
- preserveContextMenu
37598
+ preserveContextMenu,
37599
+ preserveTooltipAndFilterPanel
37585
37600
  });
37586
37601
  this.refreshRuntimeColumns();
37587
37602
  if (shouldPersistColumnConfig) {
@@ -37749,8 +37764,10 @@ var ListTableCore = class {
37749
37764
  if (params?.includeLoading) {
37750
37765
  this.overlayController.hideLoading();
37751
37766
  }
37752
- this.overlayController.hideTooltip();
37753
- this.overlayController.hideFilterPanel();
37767
+ if (!params?.preserveTooltipAndFilterPanel) {
37768
+ this.overlayController.hideTooltip();
37769
+ this.overlayController.hideFilterPanel();
37770
+ }
37754
37771
  this.overlayController.hideFixedPopup();
37755
37772
  if (!params?.preserveContextMenu) {
37756
37773
  this.overlayController.hideHeaderContextMenu();
@@ -37880,5 +37897,3 @@ __publicField(ListTable, "SELECTION_COLUMN", SELECTION_COLUMN);
37880
37897
  __publicField(ListTable, "ROW_SELECTION_COLUMN", ROW_SELECTION_COLUMN);
37881
37898
 
37882
37899
  export { EXPAND_COLUMN, ListTable, ROW_SELECTION_COLUMN, SELECTION_COLUMN, getListTableStoredPageSize, listTableAntdIconNames, listTableBuiltinIconNames, listTableIconNames, resetListTableStoredColumnConfig };
37883
- //# sourceMappingURL=index.js.map
37884
- //# 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.28",
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/chart": "0.3.5",
31
- "@canvas-components/qrcode": "0.2.0",
32
- "@canvas-components/barcode": "0.2.0",
33
- "@canvas-components/utils": "0.2.6",
34
- "@canvas-components/stats": "0.1.2"
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"