vxe-table 4.7.4 → 4.7.6

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.
Files changed (44) hide show
  1. package/es/style.css +1 -1
  2. package/es/style.min.css +1 -1
  3. package/es/table/module/custom/hook.js +18 -2
  4. package/es/table/module/custom/panel.js +263 -159
  5. package/es/table/module/export/hook.js +17 -0
  6. package/es/table/src/columnInfo.js +2 -0
  7. package/es/table/src/table.js +11 -7
  8. package/es/table/style.css +79 -13
  9. package/es/table/style.min.css +1 -1
  10. package/es/toolbar/src/toolbar.js +1 -1
  11. package/es/ui/index.js +4 -2
  12. package/es/vxe-table/style.css +79 -13
  13. package/es/vxe-table/style.min.css +1 -1
  14. package/lib/index.umd.js +236 -92
  15. package/lib/index.umd.min.js +1 -1
  16. package/lib/style.css +1 -1
  17. package/lib/style.min.css +1 -1
  18. package/lib/table/module/custom/hook.js +23 -2
  19. package/lib/table/module/custom/hook.min.js +1 -1
  20. package/lib/table/module/custom/panel.js +174 -80
  21. package/lib/table/module/custom/panel.min.js +1 -1
  22. package/lib/table/module/export/hook.js +19 -0
  23. package/lib/table/module/export/hook.min.js +1 -1
  24. package/lib/table/src/columnInfo.js +2 -0
  25. package/lib/table/src/columnInfo.min.js +1 -1
  26. package/lib/table/src/table.js +14 -7
  27. package/lib/table/src/table.min.js +1 -1
  28. package/lib/table/style/style.css +79 -13
  29. package/lib/table/style/style.min.css +1 -1
  30. package/lib/toolbar/src/toolbar.js +1 -1
  31. package/lib/toolbar/src/toolbar.min.js +1 -1
  32. package/lib/ui/index.js +4 -2
  33. package/lib/ui/index.min.js +1 -1
  34. package/lib/vxe-table/style/style.css +79 -13
  35. package/lib/vxe-table/style/style.min.css +1 -1
  36. package/package.json +2 -2
  37. package/packages/table/module/custom/hook.ts +19 -3
  38. package/packages/table/module/custom/panel.ts +272 -165
  39. package/packages/table/module/export/hook.ts +17 -0
  40. package/packages/table/src/columnInfo.ts +4 -0
  41. package/packages/table/src/table.ts +11 -7
  42. package/packages/toolbar/src/toolbar.ts +1 -1
  43. package/packages/ui/index.ts +2 -0
  44. package/styles/components/table-module/custom.scss +82 -6
package/lib/index.umd.js CHANGED
@@ -1791,8 +1791,8 @@ var external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_ =
1791
1791
  var external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_default = /*#__PURE__*/__webpack_require__.n(external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_);
1792
1792
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
1793
1793
 
1794
- external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_.VxeUI.version = "4.7.4";
1795
- external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_.VxeUI.tableVersion = "4.7.4";
1794
+ external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_.VxeUI.version = "4.7.6";
1795
+ external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_.VxeUI.tableVersion = "4.7.6";
1796
1796
  external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_.VxeUI.setConfig({
1797
1797
  emptyCell: ' ',
1798
1798
  table: {
@@ -1848,6 +1848,7 @@ external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_.VxeUI.
1848
1848
  // },
1849
1849
  customConfig: {
1850
1850
  allowFixed: true,
1851
+ allowSort: true,
1851
1852
  showFooter: true
1852
1853
  // storage: false,
1853
1854
  // checkMethod () {}
@@ -2005,6 +2006,7 @@ external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_.VxeUI.
2005
2006
  TABLE_CHECKBOX_INDETERMINATE: iconPrefix + 'checkbox-indeterminate-fill',
2006
2007
  TABLE_RADIO_CHECKED: iconPrefix + 'radio-checked-fill',
2007
2008
  TABLE_RADIO_UNCHECKED: iconPrefix + 'radio-unchecked',
2009
+ TABLE_CUSTOM_SORT: iconPrefix + 'drag-handle',
2008
2010
  // toolbar
2009
2011
  TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
2010
2012
  TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'repeat roll',
@@ -2361,6 +2363,8 @@ class ColumnInfo {
2361
2363
  // 列排序
2362
2364
  sortNumber: 0,
2363
2365
  renderSortNumber: 0,
2366
+ renderFixed: '',
2367
+ renderVisible: false,
2364
2368
  renderWidth: 0,
2365
2369
  renderHeight: 0,
2366
2370
  resizeWidth: 0,
@@ -6399,6 +6403,7 @@ const {
6399
6403
  setup(props) {
6400
6404
  const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', {});
6401
6405
  const {
6406
+ props: tableProps,
6402
6407
  reactData
6403
6408
  } = $xeTable;
6404
6409
  const {
@@ -6425,25 +6430,78 @@ const {
6425
6430
  customStore.activeWrapper = false;
6426
6431
  setTimeout(() => {
6427
6432
  if (!customStore.activeBtn && !customStore.activeWrapper) {
6428
- $xeTable.customColseEvent(evnt);
6433
+ $xeTable.customCloseEvent(evnt);
6429
6434
  }
6430
6435
  }, 300);
6431
6436
  };
6437
+ const getStoreData = () => {
6438
+ return {};
6439
+ };
6440
+ const handleSaveStore = type => {
6441
+ const {
6442
+ id
6443
+ } = tableProps;
6444
+ const customOpts = computeCustomOpts.value;
6445
+ const {
6446
+ storage,
6447
+ updateStore
6448
+ } = customOpts;
6449
+ if (storage && id && updateStore) {
6450
+ updateStore({
6451
+ id,
6452
+ type,
6453
+ storeData: getStoreData()
6454
+ });
6455
+ }
6456
+ };
6432
6457
  const confirmCustomEvent = evnt => {
6433
- updateColumnSort();
6458
+ const {
6459
+ customColumnList
6460
+ } = reactData;
6461
+ customColumnList.forEach((column, index) => {
6462
+ const sortIndex = index + 1;
6463
+ column.renderSortNumber = sortIndex;
6464
+ column.fixed = column.renderFixed;
6465
+ column.visible = column.renderVisible;
6466
+ });
6434
6467
  $xeTable.closeCustom();
6435
6468
  $xeTable.emitCustomEvent('confirm', evnt);
6469
+ handleSaveStore('confirm');
6436
6470
  };
6437
6471
  const cancelCustomEvent = evnt => {
6472
+ const {
6473
+ customStore
6474
+ } = props;
6475
+ const {
6476
+ customColumnList
6477
+ } = reactData;
6478
+ const {
6479
+ oldSortMaps,
6480
+ oldFixedMaps,
6481
+ oldVisibleMaps
6482
+ } = customStore;
6483
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
6484
+ const colid = column.getKey();
6485
+ const visible = !!oldVisibleMaps[colid];
6486
+ const fixed = oldFixedMaps[colid] || '';
6487
+ column.renderVisible = visible;
6488
+ column.visible = visible;
6489
+ column.renderFixed = fixed;
6490
+ column.fixed = fixed;
6491
+ column.renderSortNumber = oldSortMaps[colid] || 0;
6492
+ }, {
6493
+ children: 'children'
6494
+ });
6438
6495
  $xeTable.closeCustom();
6439
6496
  $xeTable.emitCustomEvent('cancel', evnt);
6440
6497
  };
6441
- const resetCustomEvent = evnt => {
6498
+ const handleResetCustomEvent = evnt => {
6442
6499
  $xeTable.resetColumn(true);
6443
6500
  $xeTable.closeCustom();
6444
6501
  $xeTable.emitCustomEvent('reset', evnt);
6502
+ handleSaveStore('confirm');
6445
6503
  };
6446
- const resetPopupCustomEvent = evnt => {
6504
+ const resetCustomEvent = evnt => {
6447
6505
  if (external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_.VxeUI.modal) {
6448
6506
  external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_.VxeUI.modal.confirm({
6449
6507
  content: panel_getI18n('vxe.custom.cstmConfirmRestore'),
@@ -6451,11 +6509,11 @@ const {
6451
6509
  escClosable: true
6452
6510
  }).then(type => {
6453
6511
  if (type === 'confirm') {
6454
- resetCustomEvent(evnt);
6512
+ handleResetCustomEvent(evnt);
6455
6513
  }
6456
6514
  });
6457
6515
  } else {
6458
- resetCustomEvent(evnt);
6516
+ handleResetCustomEvent(evnt);
6459
6517
  }
6460
6518
  };
6461
6519
  const handleOptionCheck = column => {
@@ -6468,17 +6526,17 @@ const {
6468
6526
  parent
6469
6527
  } = matchObj;
6470
6528
  if (parent.children && parent.children.length) {
6471
- parent.visible = parent.children.every(column => column.visible);
6472
- parent.halfVisible = !parent.visible && parent.children.some(column => column.visible || column.halfVisible);
6529
+ parent.renderVisible = parent.children.every(column => column.renderVisible);
6530
+ parent.halfVisible = !parent.renderVisible && parent.children.some(column => column.renderVisible || column.halfVisible);
6473
6531
  handleOptionCheck(parent);
6474
6532
  }
6475
6533
  }
6476
6534
  };
6477
6535
  const changeCheckboxOption = column => {
6478
- const isChecked = !column.visible;
6536
+ const isChecked = !column.renderVisible;
6479
6537
  const customOpts = computeCustomOpts.value;
6480
6538
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], item => {
6481
- item.visible = isChecked;
6539
+ item.renderVisible = isChecked;
6482
6540
  item.halfVisible = false;
6483
6541
  });
6484
6542
  handleOptionCheck(column);
@@ -6489,20 +6547,22 @@ const {
6489
6547
  };
6490
6548
  const changeFixedOption = (column, colFixed) => {
6491
6549
  const isMaxFixedColumn = computeIsMaxFixedColumn.value;
6492
- if (column.fixed === colFixed) {
6493
- $xeTable.clearColumnFixed(column);
6550
+ if (column.renderFixed === colFixed) {
6551
+ column.renderFixed = '';
6552
+ // $xeTable.clearColumnFixed(column)
6494
6553
  } else {
6495
- if (!isMaxFixedColumn || column.fixed) {
6496
- $xeTable.setColumnFixed(column, colFixed);
6554
+ if (!isMaxFixedColumn || column.renderFixed) {
6555
+ column.renderFixed = colFixed;
6556
+ // $xeTable.setColumnFixed(column, colFixed)
6497
6557
  }
6498
6558
  }
6499
6559
  };
6500
- const changePopupFixedOption = column => {
6501
- const isMaxFixedColumn = computeIsMaxFixedColumn.value;
6502
- if (!isMaxFixedColumn) {
6503
- $xeTable.setColumnFixed(column, column.fixed);
6504
- }
6505
- };
6560
+ // const changePopupFixedOption = () => {
6561
+ // const isMaxFixedColumn = computeIsMaxFixedColumn.value
6562
+ // if (!isMaxFixedColumn) {
6563
+ // // $xeTable.setColumnFixed(column, column.fixed)
6564
+ // }
6565
+ // }
6506
6566
  const allCustomEvent = () => {
6507
6567
  const {
6508
6568
  customStore
@@ -6519,7 +6579,7 @@ const {
6519
6579
  if (!checkMethod || checkMethod({
6520
6580
  column
6521
6581
  })) {
6522
- column.visible = isAll;
6582
+ column.renderVisible = isAll;
6523
6583
  column.halfVisible = false;
6524
6584
  }
6525
6585
  });
@@ -6554,16 +6614,6 @@ const {
6554
6614
  evnt.dataTransfer.setDragImage(img, 0, 0);
6555
6615
  }
6556
6616
  };
6557
- const updateColumnSort = () => {
6558
- const {
6559
- customColumnList
6560
- } = reactData;
6561
- // 更新顺序
6562
- customColumnList.forEach((column, index) => {
6563
- const sortIndex = index + 1;
6564
- column.renderSortNumber = sortIndex;
6565
- });
6566
- };
6567
6617
  const sortDragendEvent = evnt => {
6568
6618
  const {
6569
6619
  customColumnList
@@ -6603,8 +6653,6 @@ const {
6603
6653
  }
6604
6654
  removeClass(trEl, 'active--drag-target');
6605
6655
  removeClass(trEl, 'active--drag-origin');
6606
- // 更新顺序
6607
- updateColumnSort();
6608
6656
  };
6609
6657
  const sortDragoverEvent = evnt => {
6610
6658
  const trEl = evnt.currentTarget;
@@ -6652,6 +6700,8 @@ const {
6652
6700
  const {
6653
6701
  checkMethod,
6654
6702
  visibleMethod,
6703
+ allowSort,
6704
+ allowFixed,
6655
6705
  trigger
6656
6706
  } = customOpts;
6657
6707
  const isMaxFixedColumn = computeIsMaxFixedColumn.value;
@@ -6667,7 +6717,7 @@ const {
6667
6717
  column
6668
6718
  }) : true;
6669
6719
  if (isVisible) {
6670
- const isChecked = column.visible;
6720
+ const isChecked = column.renderVisible;
6671
6721
  const isIndeterminate = column.halfVisible;
6672
6722
  const isColGroup = column.children && column.children.length;
6673
6723
  const colTitle = formatText(column.getTitle(), 1);
@@ -6676,16 +6726,20 @@ const {
6676
6726
  }) : false;
6677
6727
  colVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
6678
6728
  key: column.id,
6729
+ colid: column.id,
6679
6730
  class: ['vxe-table-custom--option', `level--${column.level}`, {
6680
6731
  'is--group': isColGroup
6681
- }]
6732
+ }],
6733
+ onDragstart: sortDragstartEvent,
6734
+ onDragend: sortDragendEvent,
6735
+ onDragover: sortDragoverEvent
6682
6736
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6683
- title: colTitle,
6684
6737
  class: ['vxe-table-custom--checkbox-option', {
6685
6738
  'is--checked': isChecked,
6686
6739
  'is--indeterminate': isIndeterminate,
6687
6740
  'is--disabled': isDisabled
6688
6741
  }],
6742
+ title: panel_getI18n('vxe.custom.setting.colVisible'),
6689
6743
  onClick: () => {
6690
6744
  if (!isDisabled) {
6691
6745
  changeCheckboxOption(column);
@@ -6693,29 +6747,39 @@ const {
6693
6747
  }
6694
6748
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6695
6749
  class: ['vxe-checkbox--icon', isIndeterminate ? panel_getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? panel_getIcon().TABLE_CHECKBOX_CHECKED : panel_getIcon().TABLE_CHECKBOX_UNCHECKED]
6696
- }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6697
- class: 'vxe-checkbox--label'
6698
- }, colTitle)]), !parent && customOpts.allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6750
+ })]), allowSort && column.level === 1 ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6751
+ class: 'vxe-table-custom--sort-option'
6752
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6753
+ class: 'vxe-table-custom--sort-btn',
6754
+ title: panel_getI18n('vxe.custom.setting.sortHelpTip'),
6755
+ onMousedown: sortMousedownEvent,
6756
+ onMouseup: sortMouseupEvent
6757
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
6758
+ class: panel_getIcon().TABLE_CUSTOM_SORT
6759
+ })])]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6760
+ class: 'vxe-table-custom--checkbox-label',
6761
+ title: colTitle
6762
+ }, colTitle), !parent && allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6699
6763
  class: 'vxe-table-custom--fixed-option'
6700
6764
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6701
- class: ['vxe-table-custom--fixed-left-option', column.fixed === 'left' ? panel_getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : panel_getIcon().TOOLBAR_TOOLS_FIXED_LEFT, {
6702
- 'is--checked': column.fixed === 'left',
6703
- 'is--disabled': isMaxFixedColumn && !column.fixed
6765
+ class: ['vxe-table-custom--fixed-left-option', column.renderFixed === 'left' ? panel_getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : panel_getIcon().TOOLBAR_TOOLS_FIXED_LEFT, {
6766
+ 'is--checked': column.renderFixed === 'left',
6767
+ 'is--disabled': isMaxFixedColumn && !column.renderFixed
6704
6768
  }],
6705
- title: panel_getI18n(column.fixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft'),
6769
+ title: panel_getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft'),
6706
6770
  onClick: () => {
6707
6771
  changeFixedOption(column, 'left');
6708
6772
  }
6709
6773
  }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6710
- class: ['vxe-table-custom--fixed-right-option', column.fixed === 'right' ? panel_getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : panel_getIcon().TOOLBAR_TOOLS_FIXED_RIGHT, {
6711
- 'is--checked': column.fixed === 'right',
6712
- 'is--disabled': isMaxFixedColumn && !column.fixed
6774
+ class: ['vxe-table-custom--fixed-right-option', column.renderFixed === 'right' ? panel_getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : panel_getIcon().TOOLBAR_TOOLS_FIXED_RIGHT, {
6775
+ 'is--checked': column.renderFixed === 'right',
6776
+ 'is--disabled': isMaxFixedColumn && !column.renderFixed
6713
6777
  }],
6714
- title: panel_getI18n(column.fixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight'),
6778
+ title: panel_getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight'),
6715
6779
  onClick: () => {
6716
6780
  changeFixedOption(column, 'right');
6717
6781
  }
6718
- })]) : null]));
6782
+ })]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]));
6719
6783
  }
6720
6784
  });
6721
6785
  const isAllChecked = customStore.isAll;
@@ -6726,7 +6790,7 @@ const {
6726
6790
  class: ['vxe-table-custom-wrapper', {
6727
6791
  'is--active': customStore.visible
6728
6792
  }]
6729
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
6793
+ }, customStore.visible ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
6730
6794
  class: 'vxe-table-custom--header'
6731
6795
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
6732
6796
  class: 'vxe-table-custom--option'
@@ -6741,21 +6805,34 @@ const {
6741
6805
  class: ['vxe-checkbox--icon', isAllIndeterminate ? panel_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? panel_getIcon().TABLE_CHECKBOX_CHECKED : panel_getIcon().TABLE_CHECKBOX_UNCHECKED]
6742
6806
  }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6743
6807
  class: 'vxe-checkbox--label'
6744
- }, panel_getI18n('vxe.toolbar.customAll'))])])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
6808
+ }, panel_getI18n('vxe.toolbar.customAll'))])])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6809
+ ref: bodyElemRef,
6810
+ class: 'vxe-table-custom--list-wrapper'
6811
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
6745
6812
  class: 'vxe-table-custom--body',
6813
+ name: 'vxe-table-custom--list',
6814
+ tag: 'ul',
6746
6815
  style: maxHeight ? {
6747
6816
  maxHeight: `${maxHeight}px`
6748
6817
  } : {},
6749
6818
  ...customWrapperOns
6750
- }, colVNs), customOpts.showFooter ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6819
+ }, {
6820
+ default: () => colVNs
6821
+ }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6822
+ ref: dragHintElemRef,
6823
+ class: 'vxe-table-custom-popup--drag-hint'
6824
+ }, panel_getI18n('vxe.custom.cstmDragTarget', [dragColumn.value ? dragColumn.value.getTitle() : '']))]), customOpts.showFooter ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6751
6825
  class: 'vxe-table-custom--footer'
6752
6826
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
6753
6827
  class: 'btn--reset',
6754
6828
  onClick: resetCustomEvent
6755
- }, customOpts.resetButtonText || panel_getI18n('vxe.toolbar.customRestore')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
6829
+ }, customOpts.resetButtonText || panel_getI18n('vxe.table.customRestore')), customOpts.immediate ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
6830
+ class: 'btn--cancel',
6831
+ onClick: cancelCustomEvent
6832
+ }, customOpts.resetButtonText || panel_getI18n('vxe.table.customCancel')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
6756
6833
  class: 'btn--confirm',
6757
6834
  onClick: confirmCustomEvent
6758
- }, customOpts.confirmButtonText || panel_getI18n('vxe.toolbar.customConfirm'))]) : null]);
6835
+ }, customOpts.confirmButtonText || panel_getI18n('vxe.table.customConfirm'))]) : null] : []);
6759
6836
  };
6760
6837
  const renderPopupPanel = () => {
6761
6838
  const {
@@ -6766,6 +6843,8 @@ const {
6766
6843
  } = reactData;
6767
6844
  const customOpts = computeCustomOpts.value;
6768
6845
  const {
6846
+ allowSort,
6847
+ allowFixed,
6769
6848
  checkMethod,
6770
6849
  visibleMethod
6771
6850
  } = customOpts;
@@ -6777,7 +6856,7 @@ const {
6777
6856
  column
6778
6857
  }) : true;
6779
6858
  if (isVisible) {
6780
- const isChecked = column.visible;
6859
+ const isChecked = column.renderVisible;
6781
6860
  const isIndeterminate = column.halfVisible;
6782
6861
  const colTitle = formatText(column.getTitle(), 1);
6783
6862
  const isColGroup = column.children && column.children.length;
@@ -6794,19 +6873,6 @@ const {
6794
6873
  onDragend: sortDragendEvent,
6795
6874
  onDragover: sortDragoverEvent
6796
6875
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
6797
- class: 'vxe-table-custom-popup--column-item col--sort'
6798
- }, [column.level === 1 ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6799
- class: 'vxe-table-custom-popup--column-sort-btn',
6800
- onMousedown: sortMousedownEvent,
6801
- onMouseup: sortMouseupEvent
6802
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
6803
- class: 'vxe-icon-sort'
6804
- })]) : null]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
6805
- class: 'vxe-table-custom-popup--column-item col--name'
6806
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6807
- class: 'vxe-table-custom-popup--name',
6808
- title: colTitle
6809
- }, colTitle)]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
6810
6876
  class: 'vxe-table-custom-popup--column-item col--visible'
6811
6877
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6812
6878
  class: ['vxe-table-custom--checkbox-option', {
@@ -6814,6 +6880,7 @@ const {
6814
6880
  'is--indeterminate': isIndeterminate,
6815
6881
  'is--disabled': isDisabled
6816
6882
  }],
6883
+ title: panel_getI18n('vxe.custom.setting.colVisible'),
6817
6884
  onClick: () => {
6818
6885
  if (!isDisabled) {
6819
6886
  changeCheckboxOption(column);
@@ -6821,10 +6888,24 @@ const {
6821
6888
  }
6822
6889
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6823
6890
  class: ['vxe-checkbox--icon', isIndeterminate ? panel_getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? panel_getIcon().TABLE_CHECKBOX_CHECKED : panel_getIcon().TABLE_CHECKBOX_UNCHECKED]
6824
- })])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
6891
+ })])]), allowSort ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
6892
+ class: 'vxe-table-custom-popup--column-item col--sort'
6893
+ }, [column.level === 1 ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6894
+ class: 'vxe-table-custom-popup--column-sort-btn',
6895
+ title: panel_getI18n('vxe.custom.setting.sortHelpTip'),
6896
+ onMousedown: sortMousedownEvent,
6897
+ onMouseup: sortMouseupEvent
6898
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
6899
+ class: panel_getIcon().TABLE_CUSTOM_SORT
6900
+ })]) : null]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
6901
+ class: 'vxe-table-custom-popup--column-item col--name'
6902
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6903
+ class: 'vxe-table-custom-popup--name',
6904
+ title: colTitle
6905
+ }, colTitle)]), allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
6825
6906
  class: 'vxe-table-custom-popup--column-item col--fixed'
6826
- }, [!parent && customOpts.allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)('vxe-radio-group'), {
6827
- modelValue: column.fixed || '',
6907
+ }, [!parent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)('vxe-radio-group'), {
6908
+ modelValue: column.renderFixed || '',
6828
6909
  type: 'button',
6829
6910
  size: 'mini',
6830
6911
  options: [{
@@ -6840,14 +6921,16 @@ const {
6840
6921
  disabled: isMaxFixedColumn
6841
6922
  }],
6842
6923
  'onUpdate:modelValue'(value) {
6843
- column.fixed = value;
6844
- },
6845
- onChange() {
6846
- changePopupFixedOption(column);
6924
+ column.renderFixed = value;
6847
6925
  }
6848
- }) : null])]));
6926
+ // onChange () {
6927
+ // changePopupFixedOption(column)
6928
+ // }
6929
+ }) : null]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]));
6849
6930
  }
6850
6931
  });
6932
+ const isAllChecked = customStore.isAll;
6933
+ const isAllIndeterminate = customStore.isIndeterminate;
6851
6934
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)('vxe-modal'), {
6852
6935
  key: 'popup',
6853
6936
  className: 'vxe-table-custom-popup-wrapper vxe-table--ignore-clear',
@@ -6877,15 +6960,30 @@ const {
6877
6960
  style: {
6878
6961
  width: '80px'
6879
6962
  }
6880
- }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
6963
+ }), allowSort ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
6881
6964
  style: {
6882
6965
  width: '80px'
6883
6966
  }
6884
- }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
6967
+ }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
6968
+ style: {
6969
+ minWidth: '120px'
6970
+ }
6971
+ }), allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
6885
6972
  style: {
6886
6973
  width: '200px'
6887
6974
  }
6888
- })]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6975
+ }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6976
+ class: ['vxe-table-custom--checkbox-option', {
6977
+ 'is--checked': isAllChecked,
6978
+ 'is--indeterminate': isAllIndeterminate
6979
+ }],
6980
+ title: panel_getI18n('vxe.table.allTitle'),
6981
+ onClick: allCustomEvent
6982
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6983
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? panel_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? panel_getIcon().TABLE_CHECKBOX_CHECKED : panel_getIcon().TABLE_CHECKBOX_UNCHECKED]
6984
+ }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6985
+ class: 'vxe-checkbox--label'
6986
+ }, panel_getI18n('vxe.toolbar.customAll'))])]), allowSort ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
6889
6987
  class: 'vxe-table-custom-popup--table-sort-help-title'
6890
6988
  }, panel_getI18n('vxe.custom.setting.colSort')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)('vxe-tooltip'), {
6891
6989
  enterable: true,
@@ -6896,7 +6994,7 @@ const {
6896
6994
  class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
6897
6995
  });
6898
6996
  }
6899
- })]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, panel_getI18n('vxe.custom.setting.colTitle')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, panel_getI18n('vxe.custom.setting.colVisible')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, panel_getI18n('vxe.custom.setting.colFixed', [columnOpts.maxFixedSize || 0]))])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
6997
+ })]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, panel_getI18n('vxe.custom.setting.colTitle')), allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, panel_getI18n('vxe.custom.setting.colFixed', [columnOpts.maxFixedSize || 0])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
6900
6998
  class: 'vxe-table-custom--body',
6901
6999
  tag: 'tbody',
6902
7000
  name: 'vxe-table-custom--list'
@@ -6912,7 +7010,7 @@ const {
6912
7010
  class: 'vxe-table-custom-popup--footer'
6913
7011
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)('vxe-button'), {
6914
7012
  content: customOpts.resetButtonText || panel_getI18n('vxe.custom.cstmRestore'),
6915
- onClick: resetPopupCustomEvent
7013
+ onClick: resetCustomEvent
6916
7014
  }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)((0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)('vxe-button'), {
6917
7015
  content: customOpts.resetButtonText || panel_getI18n('vxe.custom.cstmCancel'),
6918
7016
  onClick: cancelCustomEvent
@@ -7960,7 +8058,10 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
7960
8058
  activeBtn: false,
7961
8059
  activeWrapper: false,
7962
8060
  visible: false,
7963
- maxHeight: 0
8061
+ maxHeight: 0,
8062
+ oldSortMaps: {},
8063
+ oldFixedMaps: {},
8064
+ oldVisibleMaps: {}
7964
8065
  },
7965
8066
  customColumnList: [],
7966
8067
  // 当前选中的筛选列
@@ -8734,7 +8835,8 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
8734
8835
  } = props;
8735
8836
  const customOpts = computeCustomOpts.value;
8736
8837
  const {
8737
- storage
8838
+ storage,
8839
+ restoreStore
8738
8840
  } = customOpts;
8739
8841
  const isAllCustom = storage === true;
8740
8842
  const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
@@ -8742,6 +8844,11 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
8742
8844
  const isCustomVisible = isAllCustom || storageOpts.visible;
8743
8845
  const isCustomFixed = isAllCustom || storageOpts.fixed;
8744
8846
  const isCustomSort = isAllCustom || storageOpts.sort;
8847
+ if (storage && id && restoreStore) {
8848
+ restoreStore({
8849
+ id
8850
+ });
8851
+ }
8745
8852
  if (customConfig && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
8746
8853
  const customMap = {};
8747
8854
  if (!id) {
@@ -14017,11 +14124,9 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
14017
14124
  columnWidthStorage = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isPlainObject(columnSortStorageMap[id]) ? columnSortStorageMap[id] : {};
14018
14125
  // 排序只支持一级
14019
14126
  collectColumn.forEach(column => {
14020
- if (column.sortNumber !== column.renderSortNumber) {
14021
- const colKey = column.getKey();
14022
- if (colKey) {
14023
- columnWidthStorage[colKey] = column.renderSortNumber;
14024
- }
14127
+ const colKey = column.getKey();
14128
+ if (colKey) {
14129
+ columnWidthStorage[colKey] = column.renderSortNumber;
14025
14130
  }
14026
14131
  });
14027
14132
  }
@@ -19239,6 +19344,25 @@ export_hook_hooks.add('tableExportModule', {
19239
19344
  }
19240
19345
  });
19241
19346
  },
19347
+ getPrintHtml(options) {
19348
+ const printOpts = computePrintOpts.value;
19349
+ const opts = Object.assign({
19350
+ original: false
19351
+ // beforePrintMethod
19352
+ }, printOpts, options, {
19353
+ type: 'html',
19354
+ download: false,
19355
+ remote: false,
19356
+ print: true
19357
+ });
19358
+ return exportMethods.exportData(opts).then(({
19359
+ content
19360
+ }) => {
19361
+ return {
19362
+ html: content
19363
+ };
19364
+ });
19365
+ },
19242
19366
  openImport(options) {
19243
19367
  const {
19244
19368
  treeConfig,
@@ -20368,6 +20492,7 @@ validator_hook_hooks.add('tableValidatorModule', {
20368
20492
  ;// CONCATENATED MODULE: ./packages/table/module/custom/hook.ts
20369
20493
 
20370
20494
 
20495
+
20371
20496
  const tableCustomMethodKeys = ['openCustom', 'closeCustom'];
20372
20497
  external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_.VxeUI.hooks.add('tableCustomModule', {
20373
20498
  setupTable($xeTable) {
@@ -20409,9 +20534,28 @@ external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_.VxeUI.
20409
20534
  initStore,
20410
20535
  customStore
20411
20536
  } = reactData;
20537
+ const {
20538
+ collectColumn
20539
+ } = internalData;
20540
+ const sortMaps = {};
20541
+ const fixedMaps = {};
20542
+ const visibleMaps = {};
20543
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, column => {
20544
+ const colid = column.getKey();
20545
+ column.renderFixed = column.fixed;
20546
+ column.renderVisible = column.visible;
20547
+ sortMaps[colid] = column.renderSortNumber;
20548
+ fixedMaps[colid] = column.fixed;
20549
+ visibleMaps[colid] = column.visible;
20550
+ }, {
20551
+ children: 'children'
20552
+ });
20553
+ customStore.oldSortMaps = sortMaps;
20554
+ customStore.oldFixedMaps = fixedMaps;
20555
+ customStore.oldVisibleMaps = visibleMaps;
20556
+ reactData.customColumnList = collectColumn.slice(0);
20412
20557
  customStore.visible = true;
20413
20558
  initStore.custom = true;
20414
- reactData.customColumnList = internalData.collectColumn.slice(0);
20415
20559
  checkCustomStatus();
20416
20560
  calcMaxHeight();
20417
20561
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => calcMaxHeight());
@@ -20484,7 +20628,7 @@ external_root_VxeUI_commonjs_vxe_pc_ui_commonjs2_vxe_pc_ui_amd_vxe_pc_ui_.VxeUI.
20484
20628
  $xeTable.emitCustomEvent('open', evnt);
20485
20629
  }
20486
20630
  },
20487
- customColseEvent(evnt) {
20631
+ customCloseEvent(evnt) {
20488
20632
  const {
20489
20633
  customStore
20490
20634
  } = reactData;
@@ -21440,7 +21584,7 @@ const {
21440
21584
  customStore.activeBtn = false;
21441
21585
  setTimeout(() => {
21442
21586
  if (!customStore.activeBtn && !customStore.activeWrapper) {
21443
- $xeTable.customColseEvent($event);
21587
+ $xeTable.customCloseEvent($event);
21444
21588
  }
21445
21589
  }, 350);
21446
21590
  };