vxe-table 3.18.0-beta.3 → 3.18.0-beta.5

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 (53) 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/cell.js +7 -2
  7. package/es/table/src/methods.js +44 -12
  8. package/es/table/src/table.js +9 -1
  9. package/es/table/src/util.js +1 -0
  10. package/es/toolbar/src/toolbar.js +42 -23
  11. package/es/ui/index.js +1 -1
  12. package/es/ui/src/log.js +1 -1
  13. package/lib/grid/src/grid.js +2 -2
  14. package/lib/grid/src/grid.min.js +1 -1
  15. package/lib/index.umd.js +152 -42
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/style.css +1 -1
  18. package/lib/table/module/custom/mixin.js +10 -3
  19. package/lib/table/module/custom/mixin.min.js +1 -1
  20. package/lib/table/module/custom/panel.js +25 -2
  21. package/lib/table/module/custom/panel.min.js +1 -1
  22. package/lib/table/module/keyboard/mixin.js +2 -2
  23. package/lib/table/module/keyboard/mixin.min.js +1 -1
  24. package/lib/table/src/cell.js +11 -2
  25. package/lib/table/src/cell.min.js +1 -1
  26. package/lib/table/src/methods.js +47 -12
  27. package/lib/table/src/methods.min.js +1 -1
  28. package/lib/table/src/table.js +9 -1
  29. package/lib/table/src/table.min.js +1 -1
  30. package/lib/table/src/util.js +1 -0
  31. package/lib/table/src/util.min.js +1 -1
  32. package/lib/toolbar/src/toolbar.js +43 -16
  33. package/lib/toolbar/src/toolbar.min.js +1 -1
  34. package/lib/ui/index.js +1 -1
  35. package/lib/ui/index.min.js +1 -1
  36. package/lib/ui/src/log.js +1 -1
  37. package/lib/ui/src/log.min.js +1 -1
  38. package/package.json +1 -1
  39. package/packages/grid/src/grid.ts +2 -2
  40. package/packages/table/module/custom/mixin.ts +10 -3
  41. package/packages/table/module/custom/panel.ts +24 -2
  42. package/packages/table/module/keyboard/mixin.ts +2 -2
  43. package/packages/table/src/cell.ts +7 -2
  44. package/packages/table/src/methods.ts +44 -12
  45. package/packages/table/src/table.ts +10 -1
  46. package/packages/table/src/util.ts +2 -0
  47. package/packages/toolbar/src/toolbar.ts +43 -23
  48. /package/es/{iconfont.1755253931426.ttf → iconfont.1755588944779.ttf} +0 -0
  49. /package/es/{iconfont.1755253931426.woff → iconfont.1755588944779.woff} +0 -0
  50. /package/es/{iconfont.1755253931426.woff2 → iconfont.1755588944779.woff2} +0 -0
  51. /package/lib/{iconfont.1755253931426.ttf → iconfont.1755588944779.ttf} +0 -0
  52. /package/lib/{iconfont.1755253931426.woff → iconfont.1755588944779.woff} +0 -0
  53. /package/lib/{iconfont.1755253931426.woff2 → iconfont.1755588944779.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) {
@@ -369,6 +369,8 @@ export const Cell = {
369
369
  const { isRowGroupStatus } = tableReactData;
370
370
  const { field, slots, editRender, cellRender, rowGroupNode, aggFunc } = column;
371
371
  const renderOpts = editRender || cellRender;
372
+ const defaultSlot = slots ? slots.default : null;
373
+ const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null;
372
374
  let cellValue = '';
373
375
  if (isRowGroupStatus && field && row.isAggregate) {
374
376
  const aggRow = row;
@@ -396,6 +398,9 @@ export const Cell = {
396
398
  */
397
399
  totalValue: childCount
398
400
  };
401
+ if (gcSlot) {
402
+ return renderCellBaseVNs(h, params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childCount }, params), h));
403
+ }
399
404
  if (mode === 'column' ? field === aggRow.groupField : rowGroupNode) {
400
405
  cellValue = groupContent;
401
406
  if (contentMethod) {
@@ -416,8 +421,8 @@ export const Cell = {
416
421
  }
417
422
  }
418
423
  else {
419
- if (slots && slots.default) {
420
- return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h));
424
+ if (defaultSlot) {
425
+ return renderCellBaseVNs(h, params, $table.callSlot(defaultSlot, params, h));
421
426
  }
422
427
  if (renderOpts) {
423
428
  const compConf = renderer.get(renderOpts.name);
@@ -392,7 +392,7 @@ 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) {
395
+ if ($xeGanttView && $xeGanttView.handleUpdateSYStatus) {
396
396
  $xeGanttView.handleUpdateSYStatus(scrollYLoad);
397
397
  }
398
398
  return scrollYLoad;
@@ -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(() => {
@@ -3032,6 +3032,7 @@ function loadTableData($xeTable, datas, isReset) {
3032
3032
  }).then(() => {
3033
3033
  computeScrollLoad($xeTable);
3034
3034
  }).then(() => {
3035
+ const virtualYOpts = $xeTable.computeVirtualYOpts;
3035
3036
  // 是否启用了虚拟滚动
3036
3037
  if (sYLoad) {
3037
3038
  scrollYStore.endIndex = scrollYStore.visibleSize;
@@ -3040,6 +3041,9 @@ function loadTableData($xeTable, datas, isReset) {
3040
3041
  if (reactData.expandColumn && expandOpts.mode !== 'fixed') {
3041
3042
  errLog('vxe.error.notConflictProp', ['column.type="expand', 'expand-config.mode="fixed"']);
3042
3043
  }
3044
+ if (virtualYOpts.mode === 'scroll' && expandOpts.mode === 'fixed') {
3045
+ warnLog('vxe.error.notConflictProp', ['virtual-y-config.mode=scroll', 'expand-config.mode=inside']);
3046
+ }
3043
3047
  // if (showOverflow) {
3044
3048
  // if (!rowOpts.height) {
3045
3049
  // const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
@@ -3756,7 +3760,7 @@ const Methods = {
3756
3760
  const $xeGGWrapper = $xeGrid || $xeGantt;
3757
3761
  if (slotFunc) {
3758
3762
  if ($xeGGWrapper) {
3759
- return $xeGGWrapper.callSlot(slotFunc, params, h, vNodes);
3763
+ return $xeGGWrapper.callSlot(slotFunc, params, h);
3760
3764
  }
3761
3765
  // if (XEUtils.isString(slotFunc)) {
3762
3766
  // slotFunc = slots[slotFunc] || null
@@ -3900,7 +3904,7 @@ const Methods = {
3900
3904
  });
3901
3905
  reactData.tableData = tableData;
3902
3906
  internalData.visibleDataRowIdData = visibleDataRowIdMaps;
3903
- if ($xeGanttView) {
3907
+ if ($xeGanttView && $xeGanttView.updateViewData) {
3904
3908
  $xeGanttView.updateViewData();
3905
3909
  }
3906
3910
  return $xeTable.$nextTick();
@@ -4862,6 +4866,32 @@ const Methods = {
4862
4866
  }
4863
4867
  return [];
4864
4868
  },
4869
+ /**
4870
+ * 只对 tree-config 有效,用于树形结构,获取指定行的层级
4871
+ */
4872
+ getTreeRowLevel(rowOrRowid) {
4873
+ const $xeTable = this;
4874
+ const props = $xeTable;
4875
+ const internalData = $xeTable;
4876
+ const { treeConfig } = props;
4877
+ const { fullAllDataRowIdData } = internalData;
4878
+ if (rowOrRowid && treeConfig) {
4879
+ let rowid;
4880
+ if (XEUtils.isString(rowOrRowid)) {
4881
+ rowid = rowOrRowid;
4882
+ }
4883
+ else {
4884
+ rowid = getRowid($xeTable, rowOrRowid);
4885
+ }
4886
+ if (rowid) {
4887
+ const rest = fullAllDataRowIdData[rowid];
4888
+ if (rest) {
4889
+ return rest.level;
4890
+ }
4891
+ }
4892
+ }
4893
+ return -1;
4894
+ },
4865
4895
  /**
4866
4896
  * 只对 tree-config 有效,获取行的父级
4867
4897
  */
@@ -4881,7 +4911,9 @@ const Methods = {
4881
4911
  }
4882
4912
  if (rowid) {
4883
4913
  const rest = fullAllDataRowIdData[rowid];
4884
- return rest ? rest.parent : null;
4914
+ if (rest) {
4915
+ return rest.parent;
4916
+ }
4885
4917
  }
4886
4918
  }
4887
4919
  return null;
@@ -7570,7 +7602,7 @@ const Methods = {
7570
7602
  XEUtils.arrayEach(el.querySelectorAll(`[rowid="${getRowid($xeTable, row)}"]`), elem => addClass(elem, 'row--current'));
7571
7603
  }
7572
7604
  }
7573
- if ($xeGanttView) {
7605
+ if ($xeGanttView && $xeGanttView.handleUpdateCurrentRow) {
7574
7606
  $xeGanttView.handleUpdateCurrentRow(row);
7575
7607
  }
7576
7608
  return this.$nextTick();
@@ -7629,7 +7661,7 @@ const Methods = {
7629
7661
  if (el) {
7630
7662
  XEUtils.arrayEach(el.querySelectorAll('.row--current'), elem => removeClass(elem, 'row--current'));
7631
7663
  }
7632
- if ($xeGanttView) {
7664
+ if ($xeGanttView && $xeGanttView.handleUpdateCurrentRow) {
7633
7665
  $xeGanttView.handleUpdateCurrentRow();
7634
7666
  }
7635
7667
  return $xeTable.$nextTick();
@@ -7703,7 +7735,7 @@ const Methods = {
7703
7735
  XEUtils.arrayEach(el.querySelectorAll(`.vxe-body--row[rowid="${getRowid($xeTable, row)}"]`), elem => addClass(elem, 'row--hover'));
7704
7736
  }
7705
7737
  internalData.hoverRow = row;
7706
- if ($xeGanttView) {
7738
+ if ($xeGanttView && $xeGanttView.handleUpdateHoverRow) {
7707
7739
  $xeGanttView.handleUpdateHoverRow(row);
7708
7740
  }
7709
7741
  },
@@ -7716,7 +7748,7 @@ const Methods = {
7716
7748
  XEUtils.arrayEach(el.querySelectorAll('.vxe-body--row.row--hover'), elem => removeClass(elem, 'row--hover'));
7717
7749
  }
7718
7750
  internalData.hoverRow = null;
7719
- if ($xeGanttView) {
7751
+ if ($xeGanttView && $xeGanttView.handleUpdateHoverRow) {
7720
7752
  $xeGanttView.handleUpdateHoverRow();
7721
7753
  }
7722
7754
  },
@@ -10456,7 +10488,7 @@ const Methods = {
10456
10488
  if (isScrollXBig && mouseOpts.area) {
10457
10489
  errLog('vxe.error.notProp', ['mouse-config.area']);
10458
10490
  }
10459
- if ($xeGanttView) {
10491
+ if ($xeGanttView && $xeGanttView.handleUpdateSXSpace) {
10460
10492
  $xeGanttView.handleUpdateSXSpace();
10461
10493
  }
10462
10494
  return $xeTable.$nextTick(() => {
@@ -10577,7 +10609,7 @@ const Methods = {
10577
10609
  if (isScrollYBig && mouseOpts.area) {
10578
10610
  errLog('vxe.error.notProp', ['mouse-config.area']);
10579
10611
  }
10580
- if ($xeGanttView) {
10612
+ if ($xeGanttView && $xeGanttView.handleUpdateSYSpace) {
10581
10613
  $xeGanttView.handleUpdateSYSpace();
10582
10614
  }
10583
10615
  return $xeTable.$nextTick().then(() => {
@@ -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.3";
3
+ export const version = "3.18.0-beta.5";
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.3"}`;
3
+ const version = `table v${"3.18.0-beta.5"}`;
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 [];