vxe-table 4.16.0-beta.2 → 4.16.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 (41) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/module/custom/hook.js +10 -3
  3. package/es/table/module/custom/panel.js +139 -126
  4. package/es/table/module/keyboard/hook.js +2 -2
  5. package/es/table/src/table.js +50 -13
  6. package/es/table/src/util.js +1 -0
  7. package/es/toolbar/src/toolbar.js +26 -24
  8. package/es/ui/index.js +1 -1
  9. package/es/ui/src/log.js +1 -1
  10. package/lib/index.umd.js +81 -46
  11. package/lib/index.umd.min.js +1 -1
  12. package/lib/style.css +1 -1
  13. package/lib/table/module/custom/hook.js +12 -3
  14. package/lib/table/module/custom/hook.min.js +1 -1
  15. package/lib/table/module/custom/panel.js +23 -9
  16. package/lib/table/module/custom/panel.min.js +1 -1
  17. package/lib/table/module/keyboard/hook.js +2 -2
  18. package/lib/table/module/keyboard/hook.min.js +1 -1
  19. package/lib/table/src/table.js +15 -13
  20. package/lib/table/src/table.min.js +1 -1
  21. package/lib/table/src/util.js +1 -0
  22. package/lib/table/src/util.min.js +1 -1
  23. package/lib/toolbar/src/toolbar.js +27 -17
  24. package/lib/toolbar/src/toolbar.min.js +1 -1
  25. package/lib/ui/index.js +1 -1
  26. package/lib/ui/index.min.js +1 -1
  27. package/lib/ui/src/log.js +1 -1
  28. package/lib/ui/src/log.min.js +1 -1
  29. package/package.json +1 -1
  30. package/packages/table/module/custom/hook.ts +10 -3
  31. package/packages/table/module/custom/panel.ts +150 -135
  32. package/packages/table/module/keyboard/hook.ts +2 -2
  33. package/packages/table/src/table.ts +50 -13
  34. package/packages/table/src/util.ts +2 -0
  35. package/packages/toolbar/src/toolbar.ts +27 -25
  36. /package/es/{iconfont.1755245648660.ttf → iconfont.1755566168906.ttf} +0 -0
  37. /package/es/{iconfont.1755245648660.woff → iconfont.1755566168906.woff} +0 -0
  38. /package/es/{iconfont.1755245648660.woff2 → iconfont.1755566168906.woff2} +0 -0
  39. /package/lib/{iconfont.1755245648660.ttf → iconfont.1755566168906.ttf} +0 -0
  40. /package/lib/{iconfont.1755245648660.woff → iconfont.1755566168906.woff} +0 -0
  41. /package/lib/{iconfont.1755245648660.woff2 → iconfont.1755566168906.woff2} +0 -0
@@ -53,6 +53,9 @@ export default defineVxeComponent({
53
53
  const xID = XEUtils.uniqueId();
54
54
  // 使用已安装的组件,如果未安装则不渲染
55
55
  const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
56
+ const $xeGrid = inject('$xeGrid', null);
57
+ const $xeGantt = inject('$xeGantt', null);
58
+ const $xeGGWrapper = $xeGrid || $xeGantt;
56
59
  const { computeSize } = useFns.useSize(props);
57
60
  const reactData = reactive({
58
61
  isRefresh: false,
@@ -73,7 +76,6 @@ export default defineVxeComponent({
73
76
  getRefMaps: () => refMaps
74
77
  };
75
78
  let toolbarMethods = {};
76
- const $xeGrid = inject('$xeGrid', null);
77
79
  const computeRefreshOpts = computed(() => {
78
80
  return Object.assign({}, XEUtils.clone(getConfig().toolbar.refresh, true), props.refreshOptions, props.refresh);
79
81
  });
@@ -160,17 +162,17 @@ export default defineVxeComponent({
160
162
  reactData.isRefresh = false;
161
163
  }
162
164
  }
163
- else if ($xeGrid) {
165
+ else if ($xeGGWrapper) {
164
166
  reactData.isRefresh = true;
165
- $xeGrid.triggerToolbarCommitEvent({ code: refreshOpts.code || 'reload' }, $event).catch((e) => e).then(() => {
167
+ $xeGGWrapper.triggerToolbarCommitEvent({ code: refreshOpts.code || 'reload' }, $event).catch(() => { }).then(() => {
166
168
  reactData.isRefresh = false;
167
169
  });
168
170
  }
169
171
  }
170
172
  };
171
173
  const zoomEvent = ({ $event }) => {
172
- if ($xeGrid) {
173
- $xeGrid.triggerZoomEvent($event);
174
+ if ($xeGGWrapper) {
175
+ $xeGGWrapper.triggerZoomEvent($event);
174
176
  }
175
177
  else {
176
178
  warnLog('vxe.error.notProp', ['zoom']);
@@ -271,12 +273,12 @@ export default defineVxeComponent({
271
273
  const { code } = item;
272
274
  if (code) {
273
275
  handleDefaultCodeEvent(eventParams, item, () => {
274
- if ($xeGrid) {
275
- $xeGrid.triggerToolbarBtnEvent(item, $event);
276
+ if ($xeGGWrapper) {
277
+ $xeGGWrapper.triggerToolbarBtnEvent(item, $event);
276
278
  }
277
279
  else {
278
280
  const gCommandOpts = commands.get(code);
279
- const params = { code, button: item, $table: $table, $grid: $xeGrid, $gantt: null, $event };
281
+ const params = { code, button: item, $table: $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
280
282
  if (gCommandOpts) {
281
283
  const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
282
284
  if (tCommandMethod) {
@@ -298,12 +300,12 @@ export default defineVxeComponent({
298
300
  const { code } = item;
299
301
  if (code) {
300
302
  handleDefaultCodeEvent(eventParams, item, () => {
301
- if ($xeGrid) {
302
- $xeGrid.triggerToolbarTolEvent(item, $event);
303
+ if ($xeGGWrapper) {
304
+ $xeGGWrapper.triggerToolbarTolEvent(item, $event);
303
305
  }
304
306
  else {
305
307
  const gCommandOpts = commands.get(code);
306
- const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $gantt: null, $event };
308
+ const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
307
309
  if (gCommandOpts) {
308
310
  const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
309
311
  if (tCommandMethod) {
@@ -373,7 +375,7 @@ export default defineVxeComponent({
373
375
  const buttonSuffixSlot = slots.buttonSuffix || slots['button-suffix'];
374
376
  const btnVNs = [];
375
377
  if (buttonPrefixSlot) {
376
- btnVNs.push(...getSlotVNs(buttonPrefixSlot({ buttons: buttons || [], $grid: $xeGrid, $table: $table })));
378
+ btnVNs.push(...getSlotVNs(buttonPrefixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })));
377
379
  }
378
380
  if (buttons) {
379
381
  buttons.forEach((item, index) => {
@@ -382,7 +384,7 @@ export default defineVxeComponent({
382
384
  const compConf = buttonRender ? renderer.get(buttonRender.name) : null;
383
385
  if (buttonRender && compConf && compConf.renderToolbarButton) {
384
386
  const toolbarButtonClassName = compConf.toolbarButtonClassName;
385
- const params = { $grid: $xeGrid, $table: $table, button: item };
387
+ const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, button: item };
386
388
  btnVNs.push(h('span', {
387
389
  key: `br${item.code || index}`,
388
390
  class: ['vxe-button--item', toolbarButtonClassName ? (XEUtils.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName) : '']
@@ -421,7 +423,7 @@ export default defineVxeComponent({
421
423
  });
422
424
  }
423
425
  if (buttonSuffixSlot) {
424
- btnVNs.push(...getSlotVNs(buttonSuffixSlot({ buttons: buttons || [], $grid: $xeGrid, $table: $table })));
426
+ btnVNs.push(...getSlotVNs(buttonSuffixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })));
425
427
  }
426
428
  return btnVNs;
427
429
  };
@@ -436,7 +438,7 @@ export default defineVxeComponent({
436
438
  const toolSuffixSlot = slots.toolSuffix || slots['tool-suffix'];
437
439
  const btnVNs = [];
438
440
  if (toolPrefixSlot) {
439
- btnVNs.push(...getSlotVNs(toolPrefixSlot({ tools: tools || [], $grid: $xeGrid, $table: $table })));
441
+ btnVNs.push(...getSlotVNs(toolPrefixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })));
440
442
  }
441
443
  if (tools) {
442
444
  tools.forEach((item, tIndex) => {
@@ -446,7 +448,7 @@ export default defineVxeComponent({
446
448
  const compConf = toolRender ? renderer.get(rdName) : null;
447
449
  if (toolRender && compConf && compConf.renderToolbarTool) {
448
450
  const toolbarToolClassName = compConf.toolbarToolClassName;
449
- const params = { $grid: $xeGrid, $table: $table, tool: item };
451
+ const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, tool: item };
450
452
  btnVNs.push(h('span', {
451
453
  key: rdName,
452
454
  class: ['vxe-tool--item', toolbarToolClassName ? (XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName) : '']
@@ -485,7 +487,7 @@ export default defineVxeComponent({
485
487
  });
486
488
  }
487
489
  if (toolSuffixSlot) {
488
- btnVNs.push(...getSlotVNs(toolSuffixSlot({ tools: tools || [], $grid: $xeGrid, $table: $table })));
490
+ btnVNs.push(...getSlotVNs(toolSuffixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })));
489
491
  }
490
492
  return btnVNs;
491
493
  };
@@ -539,12 +541,12 @@ export default defineVxeComponent({
539
541
  };
540
542
  const renderToolZoom = () => {
541
543
  const zoomOpts = computeZoomOpts.value;
542
- return $xeGrid && VxeUIButtonComponent
544
+ return $xeGGWrapper && VxeUIButtonComponent
543
545
  ? h(VxeUIButtonComponent, {
544
546
  key: 'zoom',
545
547
  circle: true,
546
- icon: $xeGrid.isMaximized() ? (zoomOpts.iconOut || getIcon().TOOLBAR_TOOLS_MINIMIZE) : (zoomOpts.iconIn || getIcon().TOOLBAR_TOOLS_FULLSCREEN),
547
- title: getI18n(`vxe.toolbar.zoom${$xeGrid.isMaximized() ? 'Out' : 'In'}`),
548
+ icon: $xeGGWrapper.isMaximized() ? (zoomOpts.iconOut || getIcon().TOOLBAR_TOOLS_MINIMIZE) : (zoomOpts.iconIn || getIcon().TOOLBAR_TOOLS_FULLSCREEN),
549
+ title: getI18n(`vxe.toolbar.zoom${$xeGGWrapper.isMaximized() ? 'Out' : 'In'}`),
548
550
  onClick: zoomEvent
549
551
  })
550
552
  : createCommentVNode();
@@ -586,10 +588,10 @@ export default defineVxeComponent({
586
588
  }, [
587
589
  h('div', {
588
590
  class: 'vxe-buttons--wrapper'
589
- }, buttonsSlot ? buttonsSlot({ $grid: $xeGrid, $table: $table }) : renderLeftBtns()),
591
+ }, buttonsSlot ? buttonsSlot({ $grid: $xeGrid, $gantt: $xeGantt, $table: $table }) : renderLeftBtns()),
590
592
  h('div', {
591
593
  class: 'vxe-tools--wrapper'
592
- }, toolsSlot ? toolsSlot({ $grid: $xeGrid, $table: $table }) : renderRightTools()),
594
+ }, toolsSlot ? toolsSlot({ $grid: $xeGrid, $gantt: $xeGantt, $table: $table }) : renderRightTools()),
593
595
  h('div', {
594
596
  class: 'vxe-tools--operate'
595
597
  }, [
@@ -597,7 +599,7 @@ export default defineVxeComponent({
597
599
  props.export ? renderToolExport() : createCommentVNode(),
598
600
  props.print ? renderToolPrint() : createCommentVNode(),
599
601
  refresh ? renderToolRefresh() : createCommentVNode(),
600
- zoom && $xeGrid ? renderToolZoom() : createCommentVNode(),
602
+ zoom && $xeGGWrapper ? renderToolZoom() : createCommentVNode(),
601
603
  custom ? renderToolCustom() : createCommentVNode()
602
604
  ])
603
605
  ]);
@@ -606,7 +608,7 @@ export default defineVxeComponent({
606
608
  nextTick(() => {
607
609
  const refreshOpts = computeRefreshOpts.value;
608
610
  const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
609
- if (props.refresh && !$xeGrid && !queryMethod) {
611
+ if (props.refresh && !$xeGGWrapper && !queryMethod) {
610
612
  warnLog('vxe.error.notFunc', ['queryMethod']);
611
613
  }
612
614
  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 = "4.16.0-beta.2";
3
+ export const version = "4.16.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${"4.16.0-beta.2"}`;
3
+ const version = `table v${"4.16.0-beta.4"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);