vxe-table 3.18.0-beta.2 → 3.18.0-beta.4

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 (49) hide show
  1. package/es/grid/src/grid.js +2 -2
  2. package/es/style.css +1 -1
  3. package/es/table/module/custom/mixin.js +10 -3
  4. package/es/table/module/custom/panel.js +23 -2
  5. package/es/table/module/keyboard/mixin.js +2 -2
  6. package/es/table/src/methods.js +44 -12
  7. package/es/table/src/table.js +9 -1
  8. package/es/table/src/util.js +1 -0
  9. package/es/toolbar/src/toolbar.js +42 -23
  10. package/es/ui/index.js +1 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/lib/grid/src/grid.js +2 -2
  13. package/lib/grid/src/grid.min.js +1 -1
  14. package/lib/index.umd.js +141 -40
  15. package/lib/index.umd.min.js +1 -1
  16. package/lib/style.css +1 -1
  17. package/lib/table/module/custom/mixin.js +10 -3
  18. package/lib/table/module/custom/mixin.min.js +1 -1
  19. package/lib/table/module/custom/panel.js +25 -2
  20. package/lib/table/module/custom/panel.min.js +1 -1
  21. package/lib/table/module/keyboard/mixin.js +2 -2
  22. package/lib/table/module/keyboard/mixin.min.js +1 -1
  23. package/lib/table/src/methods.js +47 -12
  24. package/lib/table/src/methods.min.js +1 -1
  25. package/lib/table/src/table.js +9 -1
  26. package/lib/table/src/table.min.js +1 -1
  27. package/lib/table/src/util.js +1 -0
  28. package/lib/table/src/util.min.js +1 -1
  29. package/lib/toolbar/src/toolbar.js +43 -16
  30. package/lib/toolbar/src/toolbar.min.js +1 -1
  31. package/lib/ui/index.js +1 -1
  32. package/lib/ui/index.min.js +1 -1
  33. package/lib/ui/src/log.js +1 -1
  34. package/lib/ui/src/log.min.js +1 -1
  35. package/package.json +1 -1
  36. package/packages/grid/src/grid.ts +2 -2
  37. package/packages/table/module/custom/mixin.ts +10 -3
  38. package/packages/table/module/custom/panel.ts +24 -2
  39. package/packages/table/module/keyboard/mixin.ts +2 -2
  40. package/packages/table/src/methods.ts +44 -12
  41. package/packages/table/src/table.ts +10 -1
  42. package/packages/table/src/util.ts +2 -0
  43. package/packages/toolbar/src/toolbar.ts +43 -23
  44. /package/es/{iconfont.1755245623987.ttf → iconfont.1755566131950.ttf} +0 -0
  45. /package/es/{iconfont.1755245623987.woff → iconfont.1755566131950.woff} +0 -0
  46. /package/es/{iconfont.1755245623987.woff2 → iconfont.1755566131950.woff2} +0 -0
  47. /package/lib/{iconfont.1755245623987.ttf → iconfont.1755566131950.ttf} +0 -0
  48. /package/lib/{iconfont.1755245623987.woff → iconfont.1755566131950.woff} +0 -0
  49. /package/lib/{iconfont.1755245623987.woff2 → iconfont.1755566131950.woff2} +0 -0
@@ -1,13 +1,20 @@
1
1
  import XEUtils from 'xe-utils';
2
2
  import { getColumnList } from '../../src/util';
3
3
  function calcMaxHeight($xeTable) {
4
+ const $xeGantt = $xeTable.$xeGantt;
4
5
  const reactData = $xeTable;
5
6
  const { customStore } = reactData;
6
- const el = $xeTable.$refs.refElem;
7
+ let wrapperEl = $xeTable.$refs.refElem;
7
8
  // 判断面板不能大于表格高度
8
9
  let tableHeight = 0;
9
- if (el) {
10
- tableHeight = el.clientHeight - 28;
10
+ if ($xeGantt) {
11
+ const ganttContainerElem = $xeGantt.$refs.refGanttContainerElem;
12
+ if (ganttContainerElem) {
13
+ wrapperEl = ganttContainerElem;
14
+ }
15
+ }
16
+ if (wrapperEl) {
17
+ tableHeight = wrapperEl.clientHeight - 28;
11
18
  }
12
19
  customStore.maxHeight = Math.max(88, tableHeight);
13
20
  }
@@ -273,6 +273,7 @@ const renderSimplePanel = (h, _vm) => {
273
273
  }
274
274
  });
275
275
  return h('div', {
276
+ ref: 'refElem',
276
277
  key: 'simple',
277
278
  class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
278
279
  'is--active': customStore.visible
@@ -425,7 +426,7 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
425
426
  const VxeUIModalComponent = VxeUI.getComponent('VxeModal');
426
427
  const VxeUIDrawerComponent = VxeUI.getComponent('VxeDrawer');
427
428
  const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
428
- const VxeUINumberInputComponent = VxeUI.getComponent('VxeInput');
429
+ const VxeUINumberInputComponent = VxeUI.getComponent('VxeNumberInput');
429
430
  const _vm = $xeTableCustomPanel;
430
431
  const props = $xeTableCustomPanel;
431
432
  const $xeTable = $xeTableCustomPanel.$xeTable;
@@ -893,6 +894,8 @@ export default {
893
894
  const VxeUIRadioGroupComponent = VxeUI.getComponent('VxeRadioGroup');
894
895
  $xeTableCustomPanel.$nextTick(() => {
895
896
  const $xeTable = $xeTableCustomPanel.$xeTable;
897
+ const $xeGantt = $xeTable.$xeGantt;
898
+ const tableInternalData = $xeTable;
896
899
  const { customOpts } = $xeTable;
897
900
  const { mode } = customOpts;
898
901
  if (!VxeUIModalComponent && (mode === 'modal')) {
@@ -905,13 +908,31 @@ export default {
905
908
  errLog('vxe.error.reqComp', ['vxe-button']);
906
909
  }
907
910
  if (!VxeUINumberInputComponent) {
908
- errLog('vxe.error.reqComp', ['vxe-input']);
911
+ errLog('vxe.error.reqComp', ['vxe-number-input']);
909
912
  }
910
913
  if (!VxeUIRadioGroupComponent) {
911
914
  errLog('vxe.error.reqComp', ['vxe-radio-group']);
912
915
  }
916
+ if ($xeGantt) {
917
+ const { teleportToWrapperElem } = tableInternalData;
918
+ const el = $xeTableCustomPanel.$refs.refElem;
919
+ if (el && teleportToWrapperElem) {
920
+ teleportToWrapperElem.appendChild(el);
921
+ }
922
+ }
913
923
  });
914
924
  },
925
+ beforeDestroy() {
926
+ const $xeTableCustomPanel = this;
927
+ const $xeTable = $xeTableCustomPanel.$xeTable;
928
+ const $xeGantt = $xeTable.$xeGantt;
929
+ if ($xeGantt) {
930
+ const el = $xeTableCustomPanel.$refs.refElem;
931
+ if (el && el.parentElement) {
932
+ el.parentElement.removeChild(el);
933
+ }
934
+ }
935
+ },
915
936
  render(h) {
916
937
  const $xeTableCustomPanel = this;
917
938
  const $xeTable = $xeTableCustomPanel.$xeTable;
@@ -352,8 +352,8 @@ export default {
352
352
  handleCellMousedownEvent(evnt, params) {
353
353
  const $xeTable = this;
354
354
  const { editConfig, editOpts, handleSelected, checkboxConfig, checkboxOpts, mouseConfig, mouseOpts } = this;
355
- if (mouseConfig && mouseOpts.area && $xeTable.triggerCellAreaModownEvent) {
356
- return $xeTable.triggerCellAreaModownEvent(evnt, params);
355
+ if (mouseConfig && mouseOpts.area && $xeTable.triggerCellAreaModnEvent) {
356
+ return $xeTable.triggerCellAreaModnEvent(evnt, params);
357
357
  }
358
358
  else {
359
359
  if (checkboxConfig && checkboxOpts.range) {
@@ -392,8 +392,8 @@ function updateScrollYStatus($xeTable, fullData) {
392
392
  // 如果gt为0,则总是启用
393
393
  const scrollYLoad = (transform || !treeConfig) && !!virtualYOpts.enabled && virtualYOpts.gt > -1 && (virtualYOpts.gt === 0 || virtualYOpts.gt < allList.length);
394
394
  reactData.scrollYLoad = scrollYLoad;
395
- if ($xeGanttView) {
396
- $xeGanttView.updateScrollYStatus(scrollYLoad);
395
+ if ($xeGanttView && $xeGanttView.handleUpdateSYStatus) {
396
+ $xeGanttView.handleUpdateSYStatus(scrollYLoad);
397
397
  }
398
398
  return scrollYLoad;
399
399
  }
@@ -1221,7 +1221,7 @@ function updateStyle($xeTable) {
1221
1221
  if (mouseConfig && mouseOpts.selected && editStore.selected.row && editStore.selected.column) {
1222
1222
  $xeTable.addCellSelectedClass();
1223
1223
  }
1224
- if ($xeGanttView) {
1224
+ if ($xeGanttView && $xeGanttView.handleUpdateStyle) {
1225
1225
  $xeGanttView.handleUpdateStyle();
1226
1226
  }
1227
1227
  return $xeTable.$nextTick();
@@ -2770,7 +2770,7 @@ function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
2770
2770
  else {
2771
2771
  resolve(handleRecalculateStyle($xeTable, reFull, reWidth, reHeight));
2772
2772
  }
2773
- if ($xeGanttView) {
2773
+ if ($xeGanttView && $xeGanttView.handleLazyRecalculate) {
2774
2774
  $xeGanttView.handleLazyRecalculate();
2775
2775
  }
2776
2776
  internalData.rceTimeout = setTimeout(() => {
@@ -3900,7 +3900,7 @@ const Methods = {
3900
3900
  });
3901
3901
  reactData.tableData = tableData;
3902
3902
  internalData.visibleDataRowIdData = visibleDataRowIdMaps;
3903
- if ($xeGanttView) {
3903
+ if ($xeGanttView && $xeGanttView.updateViewData) {
3904
3904
  $xeGanttView.updateViewData();
3905
3905
  }
3906
3906
  return $xeTable.$nextTick();
@@ -4862,6 +4862,32 @@ const Methods = {
4862
4862
  }
4863
4863
  return [];
4864
4864
  },
4865
+ /**
4866
+ * 只对 tree-config 有效,用于树形结构,获取指定行的层级
4867
+ */
4868
+ getTreeRowLevel(rowOrRowid) {
4869
+ const $xeTable = this;
4870
+ const props = $xeTable;
4871
+ const internalData = $xeTable;
4872
+ const { treeConfig } = props;
4873
+ const { fullAllDataRowIdData } = internalData;
4874
+ if (rowOrRowid && treeConfig) {
4875
+ let rowid;
4876
+ if (XEUtils.isString(rowOrRowid)) {
4877
+ rowid = rowOrRowid;
4878
+ }
4879
+ else {
4880
+ rowid = getRowid($xeTable, rowOrRowid);
4881
+ }
4882
+ if (rowid) {
4883
+ const rest = fullAllDataRowIdData[rowid];
4884
+ if (rest) {
4885
+ return rest.level;
4886
+ }
4887
+ }
4888
+ }
4889
+ return -1;
4890
+ },
4865
4891
  /**
4866
4892
  * 只对 tree-config 有效,获取行的父级
4867
4893
  */
@@ -4881,7 +4907,9 @@ const Methods = {
4881
4907
  }
4882
4908
  if (rowid) {
4883
4909
  const rest = fullAllDataRowIdData[rowid];
4884
- return rest ? rest.parent : null;
4910
+ if (rest) {
4911
+ return rest.parent;
4912
+ }
4885
4913
  }
4886
4914
  }
4887
4915
  return null;
@@ -7570,7 +7598,7 @@ const Methods = {
7570
7598
  XEUtils.arrayEach(el.querySelectorAll(`[rowid="${getRowid($xeTable, row)}"]`), elem => addClass(elem, 'row--current'));
7571
7599
  }
7572
7600
  }
7573
- if ($xeGanttView) {
7601
+ if ($xeGanttView && $xeGanttView.handleUpdateCurrentRow) {
7574
7602
  $xeGanttView.handleUpdateCurrentRow(row);
7575
7603
  }
7576
7604
  return this.$nextTick();
@@ -7629,7 +7657,7 @@ const Methods = {
7629
7657
  if (el) {
7630
7658
  XEUtils.arrayEach(el.querySelectorAll('.row--current'), elem => removeClass(elem, 'row--current'));
7631
7659
  }
7632
- if ($xeGanttView) {
7660
+ if ($xeGanttView && $xeGanttView.handleUpdateCurrentRow) {
7633
7661
  $xeGanttView.handleUpdateCurrentRow();
7634
7662
  }
7635
7663
  return $xeTable.$nextTick();
@@ -7703,7 +7731,7 @@ const Methods = {
7703
7731
  XEUtils.arrayEach(el.querySelectorAll(`.vxe-body--row[rowid="${getRowid($xeTable, row)}"]`), elem => addClass(elem, 'row--hover'));
7704
7732
  }
7705
7733
  internalData.hoverRow = row;
7706
- if ($xeGanttView) {
7734
+ if ($xeGanttView && $xeGanttView.handleUpdateHoverRow) {
7707
7735
  $xeGanttView.handleUpdateHoverRow(row);
7708
7736
  }
7709
7737
  },
@@ -7716,7 +7744,7 @@ const Methods = {
7716
7744
  XEUtils.arrayEach(el.querySelectorAll('.vxe-body--row.row--hover'), elem => removeClass(elem, 'row--hover'));
7717
7745
  }
7718
7746
  internalData.hoverRow = null;
7719
- if ($xeGanttView) {
7747
+ if ($xeGanttView && $xeGanttView.handleUpdateHoverRow) {
7720
7748
  $xeGanttView.handleUpdateHoverRow();
7721
7749
  }
7722
7750
  },
@@ -10390,6 +10418,7 @@ const Methods = {
10390
10418
  const internalData = $xeTable;
10391
10419
  const { scrollXLoad, overflowX, scrollXWidth } = reactData;
10392
10420
  const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData;
10421
+ const $xeGanttView = internalData.xeGanttView;
10393
10422
  const mouseOpts = $xeTable.computeMouseOpts;
10394
10423
  const tableBody = $xeTable.$refs.refTableBody;
10395
10424
  const tableBodyElem = tableBody ? tableBody.$el : null;
@@ -10455,6 +10484,9 @@ const Methods = {
10455
10484
  if (isScrollXBig && mouseOpts.area) {
10456
10485
  errLog('vxe.error.notProp', ['mouse-config.area']);
10457
10486
  }
10487
+ if ($xeGanttView && $xeGanttView.handleUpdateSXSpace) {
10488
+ $xeGanttView.handleUpdateSXSpace();
10489
+ }
10458
10490
  return $xeTable.$nextTick(() => {
10459
10491
  updateStyle($xeTable);
10460
10492
  });
@@ -10573,8 +10605,8 @@ const Methods = {
10573
10605
  if (isScrollYBig && mouseOpts.area) {
10574
10606
  errLog('vxe.error.notProp', ['mouse-config.area']);
10575
10607
  }
10576
- if ($xeGanttView) {
10577
- $xeGanttView.updateScrollYSpace();
10608
+ if ($xeGanttView && $xeGanttView.handleUpdateSYSpace) {
10609
+ $xeGanttView.handleUpdateSYSpace();
10578
10610
  }
10579
10611
  return $xeTable.$nextTick().then(() => {
10580
10612
  updateStyle($xeTable);
@@ -1495,7 +1495,7 @@ export default {
1495
1495
  if (rowOpts.height && !this.showOverflow) {
1496
1496
  warnLog('vxe.error.notProp', ['table.show-overflow']);
1497
1497
  }
1498
- if (!$xeTable.triggerCellAreaModownEvent) {
1498
+ if (!$xeTable.triggerCellAreaModnEvent) {
1499
1499
  if (props.areaConfig) {
1500
1500
  warnLog('vxe.error.notProp', ['area-config']);
1501
1501
  }
@@ -1663,10 +1663,18 @@ export default {
1663
1663
  mounted() {
1664
1664
  const $xeTable = this;
1665
1665
  const props = $xeTable;
1666
+ const internalData = $xeTable;
1667
+ const $xeGantt = $xeTable.$xeGantt;
1666
1668
  const columnOpts = $xeTable.computeColumnOpts;
1667
1669
  const rowOpts = $xeTable.computeRowOpts;
1668
1670
  const customOpts = $xeTable.computeCustomOpts;
1669
1671
  const virtualYOpts = $xeTable.computeVirtualYOpts;
1672
+ if ($xeGantt) {
1673
+ const classifyWrapperEl = $xeGantt.$refs.refClassifyWrapperElem;
1674
+ if (classifyWrapperEl) {
1675
+ internalData.teleportToWrapperElem = classifyWrapperEl;
1676
+ }
1677
+ }
1670
1678
  if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
1671
1679
  initTpImg();
1672
1680
  }
@@ -115,6 +115,7 @@ export function createInternalData() {
115
115
  tBodyHeight: 0,
116
116
  // 表尾高度
117
117
  tFooterHeight: 0,
118
+ teleportToWrapperElem: null,
118
119
  inited: false,
119
120
  tooltipTimeout: null,
120
121
  initStatus: false,
@@ -49,6 +49,9 @@ export default {
49
49
  inject: {
50
50
  $xeGrid: {
51
51
  default: null
52
+ },
53
+ $xeGantt: {
54
+ default: null
52
55
  }
53
56
  },
54
57
  data() {
@@ -183,6 +186,8 @@ export default {
183
186
  const $xeToolbar = this;
184
187
  const reactData = $xeToolbar.reactData;
185
188
  const $xeGrid = $xeToolbar.$xeGrid;
189
+ const $xeGantt = $xeToolbar.$xeGantt;
190
+ const $xeGGWrapper = $xeGrid || $xeGantt;
186
191
  const { isRefresh } = reactData;
187
192
  const refreshOpts = $xeToolbar.computeRefreshOpts;
188
193
  if (!isRefresh) {
@@ -198,9 +203,9 @@ export default {
198
203
  reactData.isRefresh = false;
199
204
  }
200
205
  }
201
- else if ($xeGrid) {
206
+ else if ($xeGGWrapper) {
202
207
  reactData.isRefresh = true;
203
- $xeGrid.triggerToolbarCommitEvent({ code: refreshOpts.code || 'reload' }, $event).catch((e) => e).then(() => {
208
+ $xeGGWrapper.triggerToolbarCommitEvent({ code: refreshOpts.code || 'reload' }, $event).catch(() => { }).then(() => {
204
209
  reactData.isRefresh = false;
205
210
  });
206
211
  }
@@ -209,8 +214,10 @@ export default {
209
214
  zoomEvent({ $event }) {
210
215
  const $xeToolbar = this;
211
216
  const $xeGrid = $xeToolbar.$xeGrid;
212
- if ($xeGrid) {
213
- $xeGrid.triggerZoomEvent($event);
217
+ const $xeGantt = $xeToolbar.$xeGantt;
218
+ const $xeGGWrapper = $xeGrid || $xeGantt;
219
+ if ($xeGGWrapper) {
220
+ $xeGGWrapper.triggerZoomEvent($event);
214
221
  }
215
222
  else {
216
223
  warnLog('vxe.error.notProp', ['zoom']);
@@ -321,18 +328,20 @@ export default {
321
328
  const $xeToolbar = this;
322
329
  const internalData = $xeToolbar.internalData;
323
330
  const $xeGrid = $xeToolbar.$xeGrid;
331
+ const $xeGantt = $xeToolbar.$xeGantt;
332
+ const $xeGGWrapper = $xeGrid || $xeGantt;
324
333
  const { $event } = eventParams;
325
334
  const { connectTable } = internalData;
326
335
  const $table = connectTable;
327
336
  const { code } = item;
328
337
  if (code) {
329
338
  $xeToolbar.handleDefaultCodeEvent(eventParams, item, () => {
330
- if ($xeGrid) {
331
- $xeGrid.triggerToolbarBtnEvent(item, $event);
339
+ if ($xeGGWrapper) {
340
+ $xeGGWrapper.triggerToolbarBtnEvent(item, $event);
332
341
  }
333
342
  else {
334
343
  const gCommandOpts = commands.get(code);
335
- const params = { code, button: item, $table: $table, $grid: $xeGrid, $gantt: null, $event };
344
+ const params = { code, button: item, $table: $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
336
345
  if (gCommandOpts) {
337
346
  const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
338
347
  if (tCommandMethod) {
@@ -351,18 +360,20 @@ export default {
351
360
  const $xeToolbar = this;
352
361
  const internalData = $xeToolbar.internalData;
353
362
  const $xeGrid = $xeToolbar.$xeGrid;
363
+ const $xeGantt = $xeToolbar.$xeGantt;
364
+ const $xeGGWrapper = $xeGrid || $xeGantt;
354
365
  const { $event } = eventParams;
355
366
  const { connectTable } = internalData;
356
367
  const $table = connectTable;
357
368
  const { code } = item;
358
369
  if (code) {
359
370
  $xeToolbar.handleDefaultCodeEvent(eventParams, item, () => {
360
- if ($xeGrid) {
361
- $xeGrid.triggerToolbarTolEvent(item, $event);
371
+ if ($xeGGWrapper) {
372
+ $xeGGWrapper.triggerToolbarTolEvent(item, $event);
362
373
  }
363
374
  else {
364
375
  const gCommandOpts = commands.get(code);
365
- const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $gantt: null, $event };
376
+ const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
366
377
  if (gCommandOpts) {
367
378
  const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
368
379
  if (tCommandMethod) {
@@ -430,6 +441,7 @@ export default {
430
441
  const slots = $xeToolbar.$scopedSlots;
431
442
  const internalData = $xeToolbar.internalData;
432
443
  const $xeGrid = $xeToolbar.$xeGrid;
444
+ const $xeGantt = $xeToolbar.$xeGantt;
433
445
  const { buttons } = props;
434
446
  const { connectTable } = internalData;
435
447
  const $table = connectTable;
@@ -437,7 +449,7 @@ export default {
437
449
  const buttonSuffixSlot = slots.buttonSuffix || slots['button-suffix'];
438
450
  const btnVNs = [];
439
451
  if (buttonPrefixSlot) {
440
- btnVNs.push(...getSlotVNs(buttonPrefixSlot.call($xeToolbar, { buttons: buttons || [], $grid: $xeGrid, $table: $table })));
452
+ btnVNs.push(...getSlotVNs(buttonPrefixSlot.call($xeToolbar, { buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })));
441
453
  }
442
454
  if (buttons) {
443
455
  buttons.forEach((item) => {
@@ -446,7 +458,7 @@ export default {
446
458
  const compConf = buttonRender ? renderer.get(buttonRender.name) : null;
447
459
  if (buttonRender && compConf && compConf.renderToolbarButton) {
448
460
  const toolbarButtonClassName = compConf.toolbarButtonClassName;
449
- const params = { $grid: $xeGrid, $table: $table, button: item };
461
+ const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, button: item };
450
462
  btnVNs.push(h('span', {
451
463
  class: ['vxe-button--item', toolbarButtonClassName ? (XEUtils.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName) : '']
452
464
  }, getSlotVNs(compConf.renderToolbarButton(h, buttonRender, params))));
@@ -488,7 +500,7 @@ export default {
488
500
  });
489
501
  }
490
502
  if (buttonSuffixSlot) {
491
- btnVNs.push(...getSlotVNs(buttonSuffixSlot.call($xeToolbar, { buttons: buttons || [], $grid: $xeGrid, $table: $table })));
503
+ btnVNs.push(...getSlotVNs(buttonSuffixSlot.call($xeToolbar, { buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })));
492
504
  }
493
505
  return btnVNs;
494
506
  },
@@ -503,6 +515,7 @@ export default {
503
515
  const slots = $xeToolbar.$scopedSlots;
504
516
  const internalData = $xeToolbar.internalData;
505
517
  const $xeGrid = $xeToolbar.$xeGrid;
518
+ const $xeGantt = $xeToolbar.$xeGantt;
506
519
  const { tools } = props;
507
520
  const { connectTable } = internalData;
508
521
  const $table = connectTable;
@@ -510,7 +523,7 @@ export default {
510
523
  const toolSuffixSlot = slots.toolSuffix || slots['tool-suffix'];
511
524
  const btnVNs = [];
512
525
  if (toolPrefixSlot) {
513
- btnVNs.push(...getSlotVNs(toolPrefixSlot.call($xeToolbar, { tools: tools || [], $grid: $xeGrid, $table: $table })));
526
+ btnVNs.push(...getSlotVNs(toolPrefixSlot.call($xeToolbar, { tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })));
514
527
  }
515
528
  if (tools) {
516
529
  tools.forEach((item, tIndex) => {
@@ -520,7 +533,7 @@ export default {
520
533
  const compConf = toolRender ? renderer.get(rdName) : null;
521
534
  if (toolRender && compConf && compConf.renderToolbarTool) {
522
535
  const toolbarToolClassName = compConf.toolbarToolClassName;
523
- const params = { $grid: $xeGrid, $table: $table, tool: item };
536
+ const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, tool: item };
524
537
  btnVNs.push(h('span', {
525
538
  key: rdName,
526
539
  class: ['vxe-tool--item', toolbarToolClassName ? (XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName) : '']
@@ -564,7 +577,7 @@ export default {
564
577
  });
565
578
  }
566
579
  if (toolSuffixSlot) {
567
- btnVNs.push(...getSlotVNs(toolSuffixSlot.call($xeToolbar, { tools: tools || [], $grid: $xeGrid, $table: $table })));
580
+ btnVNs.push(...getSlotVNs(toolSuffixSlot.call($xeToolbar, { tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })));
568
581
  }
569
582
  return btnVNs;
570
583
  },
@@ -650,14 +663,16 @@ export default {
650
663
  const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
651
664
  const $xeToolbar = this;
652
665
  const $xeGrid = $xeToolbar.$xeGrid;
666
+ const $xeGantt = $xeToolbar.$xeGantt;
667
+ const $xeGGWrapper = $xeGrid || $xeGantt;
653
668
  const zoomOpts = $xeToolbar.computeZoomOpts;
654
- return $xeGrid && VxeUIButtonComponent
669
+ return $xeGGWrapper && VxeUIButtonComponent
655
670
  ? h(VxeUIButtonComponent, {
656
671
  key: 'zoom',
657
672
  props: {
658
673
  circle: true,
659
- icon: $xeGrid.isMaximized() ? (zoomOpts.iconOut || getIcon().TOOLBAR_TOOLS_MINIMIZE) : (zoomOpts.iconIn || getIcon().TOOLBAR_TOOLS_FULLSCREEN),
660
- title: getI18n(`vxe.toolbar.zoom${$xeGrid.isMaximized() ? 'Out' : 'In'}`)
674
+ icon: $xeGGWrapper.isMaximized() ? (zoomOpts.iconOut || getIcon().TOOLBAR_TOOLS_MINIMIZE) : (zoomOpts.iconIn || getIcon().TOOLBAR_TOOLS_FULLSCREEN),
675
+ title: getI18n(`vxe.toolbar.zoom${$xeGGWrapper.isMaximized() ? 'Out' : 'In'}`)
661
676
  },
662
677
  on: {
663
678
  click: $xeToolbar.zoomEvent
@@ -703,6 +718,8 @@ export default {
703
718
  const slots = $xeToolbar.$scopedSlots;
704
719
  const internalData = $xeToolbar.internalData;
705
720
  const $xeGrid = $xeToolbar.$xeGrid;
721
+ const $xeGantt = $xeToolbar.$xeGantt;
722
+ const $xeGGWrapper = $xeGrid || $xeGantt;
706
723
  const { perfect, loading, refresh, zoom, custom, className } = props;
707
724
  const { connectTable } = internalData;
708
725
  const $table = connectTable;
@@ -719,10 +736,10 @@ export default {
719
736
  }, [
720
737
  h('div', {
721
738
  class: 'vxe-buttons--wrapper'
722
- }, buttonsSlot ? buttonsSlot({ $grid: $xeGrid, $table: $table }) : $xeToolbar.renderLeftBtns(h)),
739
+ }, buttonsSlot ? buttonsSlot({ $grid: $xeGrid, $gantt: $xeGantt, $table: $table }) : $xeToolbar.renderLeftBtns(h)),
723
740
  h('div', {
724
741
  class: 'vxe-tools--wrapper'
725
- }, toolsSlot ? toolsSlot({ $grid: $xeGrid, $table: $table }) : $xeToolbar.renderRightTools(h)),
742
+ }, toolsSlot ? toolsSlot({ $grid: $xeGrid, $gantt: $xeGantt, $table: $table }) : $xeToolbar.renderRightTools(h)),
726
743
  h('div', {
727
744
  class: 'vxe-tools--operate'
728
745
  }, [
@@ -730,7 +747,7 @@ export default {
730
747
  props.export ? $xeToolbar.renderToolExport(h) : renderEmptyElement($xeToolbar),
731
748
  props.print ? $xeToolbar.renderToolPrint(h) : renderEmptyElement($xeToolbar),
732
749
  refresh ? $xeToolbar.renderToolRefresh(h) : renderEmptyElement($xeToolbar),
733
- zoom && $xeGrid ? $xeToolbar.renderToolZoom(h) : renderEmptyElement($xeToolbar),
750
+ zoom && $xeGGWrapper ? $xeToolbar.renderToolZoom(h) : renderEmptyElement($xeToolbar),
734
751
  custom ? $xeToolbar.renderToolCustom(h) : renderEmptyElement($xeToolbar)
735
752
  ])
736
753
  ]);
@@ -740,11 +757,13 @@ export default {
740
757
  const $xeToolbar = this;
741
758
  const props = $xeToolbar;
742
759
  const $xeGrid = $xeToolbar.$xeGrid;
760
+ const $xeGantt = $xeToolbar.$xeGantt;
761
+ const $xeGGWrapper = $xeGrid || $xeGantt;
743
762
  $xeToolbar.$nextTick(() => {
744
763
  const refreshOpts = $xeToolbar.computeRefreshOpts;
745
764
  const $xeTable = $xeToolbar.fintTable();
746
765
  const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
747
- if (props.refresh && !$xeGrid && !queryMethod) {
766
+ if (props.refresh && !$xeGGWrapper && !queryMethod) {
748
767
  warnLog('vxe.error.notFunc', ['queryMethod']);
749
768
  }
750
769
  if (XEUtils.isPlainObject(props.custom)) {
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.18.0-beta.2";
3
+ export const version = "3.18.0-beta.4";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.18.0-beta.2"}`;
3
+ const version = `table v${"3.18.0-beta.4"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
@@ -400,7 +400,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
400
400
  }
401
401
  }
402
402
  },
403
- callSlot(slotFunc, params, h, vNodes) {
403
+ callSlot(slotFunc, params, h) {
404
404
  const $xeGrid = this;
405
405
  const slots = $xeGrid.$scopedSlots;
406
406
  if (slotFunc) {
@@ -408,7 +408,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
408
408
  slotFunc = slots[slotFunc] || null;
409
409
  }
410
410
  if (_xeUtils.default.isFunction(slotFunc)) {
411
- return (0, _vn.getSlotVNs)(slotFunc.call(this, params, h, vNodes));
411
+ return (0, _vn.getSlotVNs)(slotFunc.call(this, params, h));
412
412
  }
413
413
  }
414
414
  return [];