vxe-table 4.7.77 → 4.7.79

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 (69) hide show
  1. package/README.en.md +1 -1
  2. package/README.ja-JP.md +1 -1
  3. package/README.md +1 -1
  4. package/README.zh-TW.md +1 -1
  5. package/es/grid/src/grid.js +45 -36
  6. package/es/style.css +1 -1
  7. package/es/table/module/custom/panel.js +5 -0
  8. package/es/table/render/index.js +4 -25
  9. package/es/table/src/body.js +26 -2
  10. package/es/table/src/cell.js +6 -6
  11. package/es/table/src/column.js +45 -18
  12. package/es/table/src/footer.js +16 -4
  13. package/es/table/src/group.js +18 -12
  14. package/es/table/src/header.js +4 -1
  15. package/es/table/src/props.js +96 -24
  16. package/es/table/src/table.js +2 -4
  17. package/es/table/src/util.js +1 -1
  18. package/es/toolbar/src/toolbar.js +89 -68
  19. package/es/ui/index.js +2 -2
  20. package/es/ui/src/log.js +1 -1
  21. package/es/ui/src/vn.js +23 -0
  22. package/lib/grid/src/grid.js +45 -39
  23. package/lib/grid/src/grid.min.js +1 -1
  24. package/lib/index.umd.js +278 -198
  25. package/lib/index.umd.min.js +1 -1
  26. package/lib/style.css +1 -1
  27. package/lib/table/module/custom/panel.js +7 -0
  28. package/lib/table/module/custom/panel.min.js +1 -1
  29. package/lib/table/render/index.js +7 -28
  30. package/lib/table/render/index.min.js +1 -1
  31. package/lib/table/src/cell.js +3 -3
  32. package/lib/table/src/cell.min.js +1 -1
  33. package/lib/table/src/column.js +16 -10
  34. package/lib/table/src/column.min.js +1 -1
  35. package/lib/table/src/group.js +17 -11
  36. package/lib/table/src/group.min.js +1 -1
  37. package/lib/table/src/table.js +2 -4
  38. package/lib/table/src/table.min.js +1 -1
  39. package/lib/table/src/util.js +1 -1
  40. package/lib/table/src/util.min.js +1 -1
  41. package/lib/toolbar/src/toolbar.js +109 -76
  42. package/lib/toolbar/src/toolbar.min.js +1 -1
  43. package/lib/ui/index.js +2 -2
  44. package/lib/ui/index.min.js +1 -1
  45. package/lib/ui/src/log.js +1 -1
  46. package/lib/ui/src/log.min.js +1 -1
  47. package/lib/ui/src/vn.js +25 -0
  48. package/lib/ui/src/vn.min.js +1 -1
  49. package/package.json +2 -2
  50. package/packages/grid/src/grid.ts +54 -44
  51. package/packages/table/module/custom/panel.ts +5 -0
  52. package/packages/table/render/index.ts +4 -27
  53. package/packages/table/src/body.ts +26 -2
  54. package/packages/table/src/cell.ts +9 -8
  55. package/packages/table/src/column.ts +47 -20
  56. package/packages/table/src/footer.ts +16 -4
  57. package/packages/table/src/group.ts +19 -13
  58. package/packages/table/src/header.ts +4 -1
  59. package/packages/table/src/props.ts +97 -24
  60. package/packages/table/src/table.ts +2 -4
  61. package/packages/table/src/util.ts +2 -2
  62. package/packages/toolbar/src/toolbar.ts +97 -75
  63. package/packages/ui/src/vn.ts +25 -0
  64. /package/es/{iconfont.1725604498089.ttf → iconfont.1726116305532.ttf} +0 -0
  65. /package/es/{iconfont.1725604498089.woff → iconfont.1726116305532.woff} +0 -0
  66. /package/es/{iconfont.1725604498089.woff2 → iconfont.1726116305532.woff2} +0 -0
  67. /package/lib/{iconfont.1725604498089.ttf → iconfont.1726116305532.ttf} +0 -0
  68. /package/lib/{iconfont.1725604498089.woff → iconfont.1726116305532.woff} +0 -0
  69. /package/lib/{iconfont.1725604498089.woff2 → iconfont.1726116305532.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -1794,6 +1794,8 @@ var core_ = __webpack_require__(4345);
1794
1794
  var external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_ = __webpack_require__(8871);
1795
1795
  var external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default = /*#__PURE__*/__webpack_require__.n(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_);
1796
1796
  ;// CONCATENATED MODULE: ./node_modules/dom-zindex/es/index.esm.js
1797
+ var winDom = null;
1798
+ var bodyEl = null;
1797
1799
  var storeEl = null;
1798
1800
  var storeId = 'z-index-manage';
1799
1801
  var styleEl = null;
@@ -1804,19 +1806,34 @@ var storeData = {
1804
1806
  m: 1000,
1805
1807
  s: 1000
1806
1808
  };
1807
- function isDocument() {
1808
- return typeof document !== 'undefined';
1809
+ function getDocument() {
1810
+ if (!winDom) {
1811
+ if (typeof document !== 'undefined') {
1812
+ winDom = document;
1813
+ }
1814
+ }
1815
+ return winDom;
1816
+ }
1817
+ function getBody() {
1818
+ if (winDom && !bodyEl) {
1819
+ bodyEl = winDom.body || winDom.getElementsByTagName('body')[0];
1820
+ }
1821
+ return bodyEl;
1809
1822
  }
1810
1823
  function getDomMaxZIndex() {
1811
1824
  var max = 0;
1812
- if (isDocument()) {
1813
- var allElem = document.body.getElementsByTagName('*');
1814
- for (var i = 0; i < allElem.length; i++) {
1815
- var elem = allElem[i];
1816
- if (elem && elem.style && elem.nodeType === 1) {
1817
- var zIndex = elem.style.zIndex;
1818
- if (zIndex && /^\d+$/.test(zIndex)) {
1819
- max = Math.max(max, Number(zIndex));
1825
+ var dom = getDocument();
1826
+ if (dom) {
1827
+ var body = getBody();
1828
+ if (body) {
1829
+ var allElem = body.getElementsByTagName('*');
1830
+ for (var i = 0; i < allElem.length; i++) {
1831
+ var elem = allElem[i];
1832
+ if (elem && elem.style && elem.nodeType === 1) {
1833
+ var zIndex = elem.style.zIndex;
1834
+ if (zIndex && /^\d+$/.test(zIndex)) {
1835
+ max = Math.max(max, Number(zIndex));
1836
+ }
1820
1837
  }
1821
1838
  }
1822
1839
  }
@@ -1825,12 +1842,13 @@ function getDomMaxZIndex() {
1825
1842
  }
1826
1843
  function getStyle() {
1827
1844
  if (!styleEl) {
1828
- if (isDocument()) {
1829
- styleEl = document.getElementById(styleId);
1845
+ var dom = getDocument();
1846
+ if (dom) {
1847
+ styleEl = dom.getElementById(styleId);
1830
1848
  if (!styleEl) {
1831
- styleEl = document.createElement('style');
1849
+ styleEl = dom.createElement('style');
1832
1850
  styleEl.id = styleId;
1833
- document.getElementsByTagName('head')[0].appendChild(styleEl);
1851
+ dom.getElementsByTagName('head')[0].appendChild(styleEl);
1834
1852
  }
1835
1853
  }
1836
1854
  }
@@ -1844,17 +1862,21 @@ function updateVar() {
1844
1862
  styEl.innerHTML = ':root{' + prefixes + 'main' + propKey + ':' + getCurrent() + ';' + prefixes + 'sub' + propKey + ':' + getSubCurrent() + '}';
1845
1863
  }
1846
1864
  }
1847
- function getDom() {
1865
+ function getStoreDom() {
1848
1866
  if (!storeEl) {
1849
- if (isDocument()) {
1850
- storeEl = document.getElementById(storeId);
1867
+ var dom = getDocument();
1868
+ if (dom) {
1869
+ storeEl = dom.getElementById(storeId);
1851
1870
  if (!storeEl) {
1852
- storeEl = document.createElement('div');
1853
- storeEl.id = storeId;
1854
- storeEl.style.display = 'none';
1855
- document.body.appendChild(storeEl);
1856
- setCurrent(storeData.m);
1857
- setSubCurrent(storeData.s);
1871
+ var body = getBody();
1872
+ if (body) {
1873
+ storeEl = dom.createElement('div');
1874
+ storeEl.id = storeId;
1875
+ storeEl.style.display = 'none';
1876
+ body.appendChild(storeEl);
1877
+ setCurrent(storeData.m);
1878
+ setSubCurrent(storeData.s);
1879
+ }
1858
1880
  }
1859
1881
  }
1860
1882
  }
@@ -1865,12 +1887,12 @@ function createSetHandle(key) {
1865
1887
  if (value) {
1866
1888
  value = Number(value);
1867
1889
  storeData[key] = value;
1868
- var doc = getDom();
1869
- if (doc) {
1870
- if (doc.dataset) {
1871
- doc.dataset[key] = value + '';
1890
+ var el = getStoreDom();
1891
+ if (el) {
1892
+ if (el.dataset) {
1893
+ el.dataset[key] = value + '';
1872
1894
  } else {
1873
- doc.setAttribute('data-' + key, value + '');
1895
+ el.setAttribute('data-' + key, value + '');
1874
1896
  }
1875
1897
  }
1876
1898
  }
@@ -1882,9 +1904,9 @@ var setCurrent = createSetHandle(storeMainKey);
1882
1904
  function createGetHandle(key, nextMethod) {
1883
1905
  return function getCurrent(currZindex) {
1884
1906
  var zIndex;
1885
- var doc = getDom();
1886
- if (doc) {
1887
- var domVal = doc.dataset ? doc.dataset[key] : doc.getAttribute('data-' + key);
1907
+ var el = getStoreDom();
1908
+ if (el) {
1909
+ var domVal = el.dataset ? el.dataset[key] : el.getAttribute('data-' + key);
1888
1910
  if (domVal) {
1889
1911
  zIndex = Number(domVal);
1890
1912
  }
@@ -1976,9 +1998,9 @@ function eqEmptyValue(cellValue) {
1976
1998
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
1977
1999
 
1978
2000
 
1979
- const version = "4.7.77";
2001
+ const version = "4.7.79";
1980
2002
  core_.VxeUI.version = version;
1981
- core_.VxeUI.tableVersion = "4.7.77";
2003
+ core_.VxeUI.tableVersion = "4.7.79";
1982
2004
  core_.VxeUI.setConfig({
1983
2005
  emptyCell: ' ',
1984
2006
  table: {
@@ -2360,7 +2382,7 @@ var es_array_push = __webpack_require__(4114);
2360
2382
  const {
2361
2383
  log: log_log
2362
2384
  } = core_.VxeUI;
2363
- const log_version = `table v${"4.7.77"}`;
2385
+ const log_version = `table v${"4.7.79"}`;
2364
2386
  const warnLog = log_log.create('warn', log_version);
2365
2387
  const errLog = log_log.create('error', log_version);
2366
2388
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -3000,7 +3022,7 @@ function assembleColumn($xeTable, elem, column, colgroup) {
3000
3022
  staticColumns
3001
3023
  } = reactData;
3002
3024
  const parentElem = elem.parentNode;
3003
- const parentColumn = colgroup ? colgroup.column : null;
3025
+ const parentColumn = colgroup ? colgroup.columnConfig : null;
3004
3026
  const parentCols = parentColumn ? parentColumn.children : staticColumns;
3005
3027
  if (parentElem && parentCols) {
3006
3028
  parentCols.splice(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayIndexOf(parentElem.children, elem), 0, column);
@@ -3197,6 +3219,29 @@ function colToVisible($xeTable, column) {
3197
3219
  function getOnName(type) {
3198
3220
  return 'on' + type.substring(0, 1).toLocaleUpperCase() + type.substring(1);
3199
3221
  }
3222
+ function getModelEvent(renderOpts) {
3223
+ switch (renderOpts.name) {
3224
+ case 'input':
3225
+ case 'textarea':
3226
+ return 'input';
3227
+ case 'select':
3228
+ return 'change';
3229
+ }
3230
+ return 'update:modelValue';
3231
+ }
3232
+ function getChangeEvent(renderOpts) {
3233
+ switch (renderOpts.name) {
3234
+ case 'input':
3235
+ case 'textarea':
3236
+ case 'VxeInput':
3237
+ case 'VxeNumberInput':
3238
+ case 'VxeTextarea':
3239
+ case '$input':
3240
+ case '$textarea':
3241
+ return 'input';
3242
+ }
3243
+ return 'change';
3244
+ }
3200
3245
  function getSlotVNs(vns) {
3201
3246
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(vns)) {
3202
3247
  return vns;
@@ -3507,11 +3552,11 @@ const Cell = {
3507
3552
  const cellPlaceholder = editRender ? editRender.placeholder : '';
3508
3553
  return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3509
3554
  class: 'vxe-cell--label'
3510
- }, editRender && eqEmptyValue(cellValue) ? [
3555
+ }, [
3511
3556
  // 如果设置占位符
3512
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3557
+ editRender && eqEmptyValue(cellValue) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3513
3558
  class: 'vxe-cell--placeholder'
3514
- }, formatText(getFuncText(cellPlaceholder), 1))] : formatText(cellValue, 1))];
3559
+ }, formatText(getFuncText(cellPlaceholder), 1)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', formatText(cellValue, 1))])];
3515
3560
  },
3516
3561
  renderTreeCell(params) {
3517
3562
  return Cell.renderTreeIcon(params, Cell.renderDefaultCell(params));
@@ -4442,25 +4487,31 @@ const columnProps = {
4442
4487
  slots
4443
4488
  }) {
4444
4489
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
4445
- const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', {});
4446
- const parentColgroup = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeColgroup', null);
4447
- const column = cell.createColumn($xeTable, props);
4448
- column.slots = slots;
4490
+ const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
4491
+ const $xeColgroup = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeColgroup', null);
4492
+ if (!$xeTable) {
4493
+ return () => (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
4494
+ }
4495
+ const columnConfig = cell.createColumn($xeTable, props);
4496
+ columnConfig.slots = slots;
4449
4497
  const renderVN = () => {
4450
4498
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
4451
4499
  ref: refElem
4452
4500
  });
4453
4501
  };
4454
4502
  const $xeColumn = {
4455
- column,
4503
+ columnConfig,
4456
4504
  renderVN
4457
4505
  };
4458
- watchColumn($xeTable, props, column);
4506
+ watchColumn($xeTable, props, columnConfig);
4459
4507
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
4460
- assembleColumn($xeTable, refElem.value, column, parentColgroup);
4508
+ const elem = refElem.value;
4509
+ if (elem) {
4510
+ assembleColumn($xeTable, elem, columnConfig, $xeColgroup);
4511
+ }
4461
4512
  });
4462
4513
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
4463
- destroyColumn($xeTable, column);
4514
+ destroyColumn($xeTable, columnConfig);
4464
4515
  });
4465
4516
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeColumn', $xeColumn);
4466
4517
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeGrid', null);
@@ -4497,21 +4548,27 @@ const Column = VxeColumn;
4497
4548
  slots
4498
4549
  }) {
4499
4550
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
4500
- const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', {});
4501
- const parentColgroup = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeColgroup', null);
4502
- const column = cell.createColumn($xeTable, props);
4551
+ const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
4552
+ const $xeParentColgroup = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeColgroup', null);
4553
+ if (!$xeTable) {
4554
+ return () => (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
4555
+ }
4556
+ const columnConfig = cell.createColumn($xeTable, props);
4503
4557
  const columnSlots = {};
4504
4558
  if (slots.header) {
4505
4559
  columnSlots.header = slots.header;
4506
4560
  }
4507
- column.slots = columnSlots;
4508
- column.children = [];
4509
- watchColumn($xeTable, props, column);
4561
+ columnConfig.slots = columnSlots;
4562
+ columnConfig.children = [];
4563
+ watchColumn($xeTable, props, columnConfig);
4510
4564
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
4511
- assembleColumn($xeTable, refElem.value, column, parentColgroup);
4565
+ const elem = refElem.value;
4566
+ if (elem) {
4567
+ assembleColumn($xeTable, elem, columnConfig, $xeParentColgroup);
4568
+ }
4512
4569
  });
4513
4570
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
4514
- destroyColumn($xeTable, column);
4571
+ destroyColumn($xeTable, columnConfig);
4515
4572
  });
4516
4573
  const renderVN = () => {
4517
4574
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
@@ -4519,7 +4576,7 @@ const Column = VxeColumn;
4519
4576
  }, slots.default ? slots.default() : []);
4520
4577
  };
4521
4578
  const $xeColgroup = {
4522
- column
4579
+ columnConfig
4523
4580
  };
4524
4581
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeColgroup', $xeColgroup);
4525
4582
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeGrid', null);
@@ -7391,9 +7448,16 @@ const {
7391
7448
  };
7392
7449
  if (true) {
7393
7450
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
7451
+ const customOpts = computeCustomOpts.value;
7452
+ const {
7453
+ mode
7454
+ } = customOpts;
7394
7455
  if (!VxeUIModalComponent) {
7395
7456
  errLog('vxe.error.reqComp', ['vxe-modal']);
7396
7457
  }
7458
+ if (!VxeUIDrawerComponent && mode === 'drawer') {
7459
+ errLog('vxe.error.reqComp', ['vxe-drawer']);
7460
+ }
7397
7461
  if (!VxeUIButtonComponent) {
7398
7462
  errLog('vxe.error.reqComp', ['vxe-button']);
7399
7463
  }
@@ -16391,9 +16455,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16391
16455
  table_globalEvents.on($xeTable, 'mousewheel', handleGlobalMousewheelEvent);
16392
16456
  table_globalEvents.on($xeTable, 'keydown', handleGlobalKeydownEvent);
16393
16457
  table_globalEvents.on($xeTable, 'resize', handleGlobalResizeEvent);
16394
- if ($xeTable.handleGlobalContextmenuEvent) {
16395
- table_globalEvents.on($xeTable, 'contextmenu', $xeTable.handleGlobalContextmenuEvent);
16396
- }
16458
+ table_globalEvents.on($xeTable, 'contextmenu', $xeTable.handleGlobalContextmenuEvent);
16397
16459
  tablePrivateMethods.preventEvent(null, 'mounted', {
16398
16460
  $table: $xeTable
16399
16461
  });
@@ -16614,7 +16676,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16614
16676
  storeData: reactData.importStore
16615
16677
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(),
16616
16678
  /**
16617
- * 导出/导出
16679
+ * 导出
16618
16680
  */
16619
16681
  initStore.export && (props.exportConfig || props.printConfig) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(export_panel, {
16620
16682
  defaultOptions: reactData.exportParams,
@@ -21496,27 +21558,6 @@ const componentDefaultModelProp = 'modelValue';
21496
21558
  const defaultCompProps = {
21497
21559
  transfer: true
21498
21560
  };
21499
- function getModelEvent(renderOpts) {
21500
- switch (renderOpts.name) {
21501
- case 'input':
21502
- case 'textarea':
21503
- return 'input';
21504
- }
21505
- return 'update:modelValue';
21506
- }
21507
- function getChangeEvent(renderOpts) {
21508
- switch (renderOpts.name) {
21509
- case 'input':
21510
- case 'textarea':
21511
- case 'VxeInput':
21512
- case 'VxeNumberInput':
21513
- case 'VxeTextarea':
21514
- case '$input':
21515
- case '$textarea':
21516
- return 'input';
21517
- }
21518
- return 'change';
21519
- }
21520
21561
  function parseDate(value, props) {
21521
21562
  return value && props.valueFormat ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(value, props.valueFormat) : value;
21522
21563
  }
@@ -21620,7 +21661,7 @@ function getCellLabelVNs(renderOpts, params, cellLabel) {
21620
21661
  * @param modelFunc
21621
21662
  * @param changeFunc
21622
21663
  */
21623
- function getElementOns(renderOpts, params, modelFunc, changeFunc) {
21664
+ function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
21624
21665
  const {
21625
21666
  events
21626
21667
  } = renderOpts;
@@ -21747,7 +21788,7 @@ function getNativeEditOns(renderOpts, params) {
21747
21788
  const {
21748
21789
  model
21749
21790
  } = column;
21750
- return getElementOns(renderOpts, params, evnt => {
21791
+ return getNativeElementOns(renderOpts, params, evnt => {
21751
21792
  // 处理 model 值双向绑定
21752
21793
  const cellValue = evnt.target.value;
21753
21794
  if (isImmediateCell(renderOpts, params)) {
@@ -21763,7 +21804,7 @@ function getNativeEditOns(renderOpts, params) {
21763
21804
  });
21764
21805
  }
21765
21806
  function getNativeFilterOns(renderOpts, params, option) {
21766
- return getElementOns(renderOpts, params, evnt => {
21807
+ return getNativeElementOns(renderOpts, params, evnt => {
21767
21808
  // 处理 model 值双向绑定
21768
21809
  option.data = evnt.target.value;
21769
21810
  }, () => {
@@ -22536,8 +22577,12 @@ const {
22536
22577
  } = toolbar_useFns.useSize(props);
22537
22578
  const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
22538
22579
  isRefresh: false,
22580
+ connectFlag: 0,
22539
22581
  columns: []
22540
22582
  });
22583
+ const internalData = {
22584
+ connectTable: null
22585
+ };
22541
22586
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
22542
22587
  const refMaps = {
22543
22588
  refElem
@@ -22547,12 +22592,11 @@ const {
22547
22592
  props,
22548
22593
  context,
22549
22594
  reactData,
22595
+ internalData,
22550
22596
  getRefMaps: () => refMaps
22551
22597
  };
22552
22598
  let toolbarMethods = {};
22553
22599
  const $xeGrid = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeGrid', null);
22554
- const refTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
22555
- const connectFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
22556
22600
  const computeRefreshOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
22557
22601
  return Object.assign({}, toolbar_getConfig().toolbar.refresh, props.refresh);
22558
22602
  });
@@ -22572,8 +22616,11 @@ const {
22572
22616
  return Object.assign({}, toolbar_getConfig().toolbar.custom, props.custom);
22573
22617
  });
22574
22618
  const computeTableCustomOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
22575
- const $table = refTable.value;
22576
- if (connectFlag.value || $table) {
22619
+ const {
22620
+ connectTable
22621
+ } = internalData;
22622
+ const $table = connectTable;
22623
+ if (reactData.connectFlag || $table) {
22577
22624
  if ($table) {
22578
22625
  const {
22579
22626
  computeCustomOpts
@@ -22590,7 +22637,10 @@ const {
22590
22637
  return tableCustomOpts.trigger;
22591
22638
  });
22592
22639
  const checkTable = () => {
22593
- const $table = refTable.value;
22640
+ const {
22641
+ connectTable
22642
+ } = internalData;
22643
+ const $table = connectTable;
22594
22644
  if ($table) {
22595
22645
  return true;
22596
22646
  }
@@ -22599,7 +22649,10 @@ const {
22599
22649
  const handleClickSettingEvent = ({
22600
22650
  $event
22601
22651
  }) => {
22602
- const $table = refTable.value;
22652
+ const {
22653
+ connectTable
22654
+ } = internalData;
22655
+ const $table = connectTable;
22603
22656
  if ($table) {
22604
22657
  if ($table.triggerCustomEvent) {
22605
22658
  $table.triggerCustomEvent($event);
@@ -22611,7 +22664,10 @@ const {
22611
22664
  const handleMouseenterSettingEvent = ({
22612
22665
  $event
22613
22666
  }) => {
22614
- const $table = refTable.value;
22667
+ const {
22668
+ connectTable
22669
+ } = internalData;
22670
+ const $table = connectTable;
22615
22671
  if ($table) {
22616
22672
  $table.customOpenEvent($event);
22617
22673
  } else {
@@ -22621,7 +22677,10 @@ const {
22621
22677
  const handleMouseleaveSettingEvent = ({
22622
22678
  $event
22623
22679
  }) => {
22624
- const $table = refTable.value;
22680
+ const {
22681
+ connectTable
22682
+ } = internalData;
22683
+ const $table = connectTable;
22625
22684
  if ($table) {
22626
22685
  const {
22627
22686
  customStore
@@ -22670,7 +22729,10 @@ const {
22670
22729
  }
22671
22730
  };
22672
22731
  const btnEvent = (evnt, item) => {
22673
- const $table = refTable.value;
22732
+ const {
22733
+ connectTable
22734
+ } = internalData;
22735
+ const $table = connectTable;
22674
22736
  const {
22675
22737
  code
22676
22738
  } = item;
@@ -22701,7 +22763,10 @@ const {
22701
22763
  }
22702
22764
  };
22703
22765
  const tolEvent = (evnt, item) => {
22704
- const $table = refTable.value;
22766
+ const {
22767
+ connectTable
22768
+ } = internalData;
22769
+ const $table = connectTable;
22705
22770
  const {
22706
22771
  code
22707
22772
  } = item;
@@ -22733,7 +22798,10 @@ const {
22733
22798
  };
22734
22799
  const importEvent = () => {
22735
22800
  if (checkTable()) {
22736
- const $table = refTable.value;
22801
+ const {
22802
+ connectTable
22803
+ } = internalData;
22804
+ const $table = connectTable;
22737
22805
  if ($table) {
22738
22806
  $table.openImport();
22739
22807
  }
@@ -22741,7 +22809,10 @@ const {
22741
22809
  };
22742
22810
  const exportEvent = () => {
22743
22811
  if (checkTable()) {
22744
- const $table = refTable.value;
22812
+ const {
22813
+ connectTable
22814
+ } = internalData;
22815
+ const $table = connectTable;
22745
22816
  if ($table) {
22746
22817
  $table.openExport();
22747
22818
  }
@@ -22749,12 +22820,29 @@ const {
22749
22820
  };
22750
22821
  const printEvent = () => {
22751
22822
  if (checkTable()) {
22752
- const $table = refTable.value;
22823
+ const {
22824
+ connectTable
22825
+ } = internalData;
22826
+ const $table = connectTable;
22753
22827
  if ($table) {
22754
22828
  $table.openPrint();
22755
22829
  }
22756
22830
  }
22757
22831
  };
22832
+ const dispatchEvent = (type, params, evnt) => {
22833
+ emit(type, toolbar_createEvent(evnt, {
22834
+ $toolbar: $xeToolbar
22835
+ }, params));
22836
+ };
22837
+ toolbarMethods = {
22838
+ dispatchEvent,
22839
+ syncUpdate(params) {
22840
+ internalData.connectTable = params.$table;
22841
+ reactData.columns = params.collectColumn;
22842
+ reactData.connectFlag++;
22843
+ }
22844
+ };
22845
+ Object.assign($xeToolbar, toolbarMethods);
22758
22846
  const renderDropdowns = (item, isBtn) => {
22759
22847
  const {
22760
22848
  dropdowns
@@ -22791,14 +22879,10 @@ const {
22791
22879
  const {
22792
22880
  buttons
22793
22881
  } = props;
22794
- const $table = refTable.value;
22795
- const buttonsSlot = slots.buttons;
22796
- if (buttonsSlot) {
22797
- return getSlotVNs(buttonsSlot({
22798
- $grid: $xeGrid,
22799
- $table: $table
22800
- }));
22801
- }
22882
+ const {
22883
+ connectTable
22884
+ } = internalData;
22885
+ const $table = connectTable;
22802
22886
  const btnVNs = [];
22803
22887
  if (buttons) {
22804
22888
  buttons.forEach(item => {
@@ -22854,14 +22938,10 @@ const {
22854
22938
  const {
22855
22939
  tools
22856
22940
  } = props;
22857
- const $table = refTable.value;
22858
- const toolsSlot = slots.tools;
22859
- if (toolsSlot) {
22860
- return getSlotVNs(toolsSlot({
22861
- $grid: $xeGrid,
22862
- $table: $table
22863
- }));
22864
- }
22941
+ const {
22942
+ connectTable
22943
+ } = internalData;
22944
+ const $table = connectTable;
22865
22945
  const btnVNs = [];
22866
22946
  if (tools) {
22867
22947
  tools.forEach((item, tIndex) => {
@@ -22985,47 +23065,6 @@ const {
22985
23065
  ...customBtnOns
22986
23066
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
22987
23067
  };
22988
- toolbarMethods = {
22989
- dispatchEvent(type, params, evnt) {
22990
- emit(type, toolbar_createEvent(evnt, {
22991
- $toolbar: $xeToolbar
22992
- }, params));
22993
- },
22994
- syncUpdate(params) {
22995
- const {
22996
- collectColumn
22997
- } = params;
22998
- refTable.value = params.$table;
22999
- reactData.columns = collectColumn;
23000
- connectFlag.value++;
23001
- }
23002
- };
23003
- Object.assign($xeToolbar, toolbarMethods);
23004
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
23005
- const {
23006
- refresh
23007
- } = props;
23008
- const refreshOpts = computeRefreshOpts.value;
23009
- const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
23010
- if (refresh && !$xeGrid && !queryMethod) {
23011
- warnLog('vxe.error.notFunc', ['queryMethod']);
23012
- }
23013
- const customOpts = computeCustomOpts.value;
23014
- if (true) {
23015
- if (customOpts.isFooter) {
23016
- warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
23017
- }
23018
- if (customOpts.showFooter) {
23019
- warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter']);
23020
- }
23021
- if (customOpts.immediate) {
23022
- warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate']);
23023
- }
23024
- if (customOpts.trigger) {
23025
- warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger']);
23026
- }
23027
- }
23028
- });
23029
23068
  const renderVN = () => {
23030
23069
  const {
23031
23070
  perfect,
@@ -23035,7 +23074,13 @@ const {
23035
23074
  custom,
23036
23075
  className
23037
23076
  } = props;
23077
+ const {
23078
+ connectTable
23079
+ } = internalData;
23038
23080
  const vSize = computeSize.value;
23081
+ const toolsSlot = slots.tools;
23082
+ const buttonsSlot = slots.buttons;
23083
+ const $table = connectTable;
23039
23084
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
23040
23085
  ref: refElem,
23041
23086
  class: ['vxe-toolbar', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
@@ -23047,22 +23092,51 @@ const {
23047
23092
  }]
23048
23093
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
23049
23094
  class: 'vxe-buttons--wrapper'
23050
- }, renderBtns()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
23095
+ }, buttonsSlot ? buttonsSlot({
23096
+ $grid: $xeGrid,
23097
+ $table: $table
23098
+ }) : renderBtns()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
23051
23099
  class: 'vxe-tools--wrapper'
23052
- }, renderRightTools()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
23100
+ }, toolsSlot ? toolsSlot({
23101
+ $grid: $xeGrid,
23102
+ $table: $table
23103
+ }) : renderRightTools()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
23053
23104
  class: 'vxe-tools--operate'
23054
23105
  }, [props.import ? renderToolImport() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), props.export ? renderToolExport() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), props.print ? renderToolPrint() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), refresh ? renderToolRefresh() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), zoom && $xeGrid ? renderToolZoom() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), custom ? renderToolCustom() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]);
23055
23106
  };
23056
23107
  $xeToolbar.renderVN = renderVN;
23057
- if (true) {
23058
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
23108
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
23109
+ const {
23110
+ refresh
23111
+ } = props;
23112
+ const refreshOpts = computeRefreshOpts.value;
23113
+ const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
23114
+ if (refresh && !$xeGrid && !queryMethod) {
23115
+ warnLog('vxe.error.notFunc', ['queryMethod']);
23116
+ }
23117
+ const customOpts = computeCustomOpts.value;
23118
+ if (true) {
23119
+ if (customOpts.isFooter) {
23120
+ warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
23121
+ }
23122
+ if (customOpts.showFooter) {
23123
+ warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter']);
23124
+ }
23125
+ if (customOpts.immediate) {
23126
+ warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate']);
23127
+ }
23128
+ if (customOpts.trigger) {
23129
+ warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger']);
23130
+ }
23131
+ }
23132
+ if (true) {
23059
23133
  if (props.refresh || props.import || props.export || props.print || props.zoom) {
23060
23134
  if (!VxeUIButtonComponent) {
23061
23135
  errLog('vxe.error.reqComp', ['vxe-button']);
23062
23136
  }
23063
23137
  }
23064
- });
23065
- }
23138
+ }
23139
+ });
23066
23140
  return $xeToolbar;
23067
23141
  },
23068
23142
  render() {
@@ -23220,28 +23294,6 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
23220
23294
  });
23221
23295
  return rest;
23222
23296
  });
23223
- const refMaps = {
23224
- refElem,
23225
- refTable,
23226
- refForm,
23227
- refToolbar,
23228
- refPager
23229
- };
23230
- const computeMaps = {
23231
- computeProxyOpts,
23232
- computePagerOpts,
23233
- computeFormOpts,
23234
- computeToolbarOpts,
23235
- computeZoomOpts
23236
- };
23237
- const $xeGrid = {
23238
- xID,
23239
- props: props,
23240
- context,
23241
- reactData,
23242
- getRefMaps: () => refMaps,
23243
- getComputeMaps: () => computeMaps
23244
- };
23245
23297
  const computeTableProps = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
23246
23298
  const {
23247
23299
  seqConfig,
@@ -23281,6 +23333,37 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
23281
23333
  }
23282
23334
  return tableProps;
23283
23335
  });
23336
+ const computeCurrLayout = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
23337
+ const {
23338
+ layouts
23339
+ } = props;
23340
+ if (layouts && layouts.length) {
23341
+ return layouts;
23342
+ }
23343
+ return grid_getConfig().grid.layouts || ['Form', 'Toolbar', 'Top', 'Table', 'Bottom', 'Pager'];
23344
+ });
23345
+ const refMaps = {
23346
+ refElem,
23347
+ refTable,
23348
+ refForm,
23349
+ refToolbar,
23350
+ refPager
23351
+ };
23352
+ const computeMaps = {
23353
+ computeProxyOpts,
23354
+ computePagerOpts,
23355
+ computeFormOpts,
23356
+ computeToolbarOpts,
23357
+ computeZoomOpts
23358
+ };
23359
+ const $xeGrid = {
23360
+ xID,
23361
+ props: props,
23362
+ context,
23363
+ reactData,
23364
+ getRefMaps: () => refMaps,
23365
+ getComputeMaps: () => computeMaps
23366
+ };
23284
23367
  const initToolbar = () => {
23285
23368
  const toolbarOpts = computeToolbarOpts.value;
23286
23369
  if (props.toolbarConfig && isEnableConf(toolbarOpts)) {
@@ -23775,13 +23858,9 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
23775
23858
  }
23776
23859
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
23777
23860
  };
23778
- const defaultLayouts = ['Form', 'Toolbar', 'Top', 'Table', 'Bottom', 'Pager'];
23779
23861
  const renderLayout = () => {
23780
- const {
23781
- layouts
23782
- } = props;
23783
23862
  const vns = [];
23784
- const currLayouts = layouts && layouts.length ? layouts : grid_getConfig().grid.layouts || defaultLayouts;
23863
+ const currLayouts = computeCurrLayout.value;
23785
23864
  currLayouts.forEach(name => {
23786
23865
  switch (name) {
23787
23866
  case 'Form':
@@ -23869,12 +23948,20 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
23869
23948
  }
23870
23949
  }
23871
23950
  };
23951
+ const handleGlobalKeydownEvent = evnt => {
23952
+ const zoomOpts = computeZoomOpts.value;
23953
+ const isEsc = grid_globalEvents.hasKey(evnt, grid_GLOBAL_EVENT_KEYS.ESCAPE);
23954
+ if (isEsc && reactData.isZMax && zoomOpts.escRestore !== false) {
23955
+ gridPrivateMethods.triggerZoomEvent(evnt);
23956
+ }
23957
+ };
23958
+ const dispatchEvent = (type, params, evnt) => {
23959
+ emit(type, grid_createEvent(evnt, {
23960
+ $grid: $xeGrid
23961
+ }, params));
23962
+ };
23872
23963
  const gridMethods = {
23873
- dispatchEvent(type, params, evnt) {
23874
- emit(type, grid_createEvent(evnt, {
23875
- $grid: $xeGrid
23876
- }, params));
23877
- },
23964
+ dispatchEvent,
23878
23965
  /**
23879
23966
  * 提交指令,支持 code 或 button
23880
23967
  * @param {String/Object} code 字符串或对象
@@ -24487,13 +24574,6 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
24487
24574
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.proxyConfig, () => {
24488
24575
  initProxy();
24489
24576
  });
24490
- const handleGlobalKeydownEvent = evnt => {
24491
- const zoomOpts = computeZoomOpts.value;
24492
- const isEsc = grid_globalEvents.hasKey(evnt, grid_GLOBAL_EVENT_KEYS.ESCAPE);
24493
- if (isEsc && reactData.isZMax && zoomOpts.escRestore !== false) {
24494
- gridPrivateMethods.triggerZoomEvent(evnt);
24495
- }
24496
- };
24497
24577
  grid_hooks.forEach(options => {
24498
24578
  const {
24499
24579
  setupGrid