vxe-table 3.18.0-beta.0 → 3.18.0-beta.1

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 (77) hide show
  1. package/es/grid/src/grid.js +3 -1
  2. package/es/style.css +1 -1
  3. package/es/table/module/custom/mixin.js +4 -2
  4. package/es/table/module/custom/panel.js +4 -0
  5. package/es/table/module/export/export-panel.js +3 -0
  6. package/es/table/module/export/import-panel.js +3 -0
  7. package/es/table/module/export/mixin.js +41 -22
  8. package/es/table/module/menu/mixin.js +5 -3
  9. package/es/table/src/body.js +6 -1
  10. package/es/table/src/column.js +2 -1
  11. package/es/table/src/columnInfo.js +6 -2
  12. package/es/table/src/footer.js +2 -0
  13. package/es/table/src/group.js +2 -1
  14. package/es/table/src/header.js +2 -0
  15. package/es/table/src/methods.js +35 -16
  16. package/es/table/src/table.js +10 -5
  17. package/es/ui/index.js +1 -1
  18. package/es/ui/src/log.js +1 -1
  19. package/lib/grid/src/grid.js +3 -1
  20. package/lib/grid/src/grid.min.js +1 -1
  21. package/lib/index.umd.js +154 -54
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/table/module/custom/mixin.js +4 -2
  25. package/lib/table/module/custom/mixin.min.js +1 -1
  26. package/lib/table/module/custom/panel.js +4 -0
  27. package/lib/table/module/custom/panel.min.js +1 -1
  28. package/lib/table/module/export/export-panel.js +3 -0
  29. package/lib/table/module/export/export-panel.min.js +1 -1
  30. package/lib/table/module/export/import-panel.js +3 -0
  31. package/lib/table/module/export/import-panel.min.js +1 -1
  32. package/lib/table/module/export/mixin.js +49 -18
  33. package/lib/table/module/export/mixin.min.js +1 -1
  34. package/lib/table/module/menu/mixin.js +8 -3
  35. package/lib/table/module/menu/mixin.min.js +1 -1
  36. package/lib/table/src/body.js +7 -1
  37. package/lib/table/src/body.min.js +1 -1
  38. package/lib/table/src/column.js +2 -1
  39. package/lib/table/src/column.min.js +1 -1
  40. package/lib/table/src/columnInfo.js +11 -5
  41. package/lib/table/src/columnInfo.min.js +1 -1
  42. package/lib/table/src/footer.js +2 -0
  43. package/lib/table/src/footer.min.js +1 -1
  44. package/lib/table/src/group.js +2 -1
  45. package/lib/table/src/group.min.js +1 -1
  46. package/lib/table/src/header.js +2 -0
  47. package/lib/table/src/header.min.js +1 -1
  48. package/lib/table/src/methods.js +40 -17
  49. package/lib/table/src/methods.min.js +1 -1
  50. package/lib/table/src/table.js +12 -3
  51. package/lib/table/src/table.min.js +1 -1
  52. package/lib/ui/index.js +1 -1
  53. package/lib/ui/index.min.js +1 -1
  54. package/lib/ui/src/log.js +1 -1
  55. package/lib/ui/src/log.min.js +1 -1
  56. package/package.json +1 -1
  57. package/packages/grid/src/grid.ts +3 -1
  58. package/packages/table/module/custom/mixin.ts +7 -5
  59. package/packages/table/module/custom/panel.ts +4 -0
  60. package/packages/table/module/export/export-panel.ts +3 -0
  61. package/packages/table/module/export/import-panel.ts +3 -0
  62. package/packages/table/module/export/mixin.ts +43 -22
  63. package/packages/table/module/menu/mixin.ts +8 -6
  64. package/packages/table/src/body.ts +6 -1
  65. package/packages/table/src/column.ts +2 -1
  66. package/packages/table/src/columnInfo.ts +8 -4
  67. package/packages/table/src/footer.ts +2 -0
  68. package/packages/table/src/group.ts +2 -1
  69. package/packages/table/src/header.ts +5 -1
  70. package/packages/table/src/methods.ts +46 -27
  71. package/packages/table/src/table.ts +10 -5
  72. /package/es/{iconfont.1755178463571.ttf → iconfont.1755232583063.ttf} +0 -0
  73. /package/es/{iconfont.1755178463571.woff → iconfont.1755232583063.woff} +0 -0
  74. /package/es/{iconfont.1755178463571.woff2 → iconfont.1755232583063.woff2} +0 -0
  75. /package/lib/{iconfont.1755178463571.ttf → iconfont.1755232583063.ttf} +0 -0
  76. /package/lib/{iconfont.1755178463571.woff → iconfont.1755232583063.woff} +0 -0
  77. /package/lib/{iconfont.1755178463571.woff2 → iconfont.1755232583063.woff2} +0 -0
@@ -4449,9 +4449,11 @@ const Methods = {
4449
4449
  const $xeTable = this;
4450
4450
  // const slots = $xeTable.$scopedSlots
4451
4451
  const $xeGrid = $xeTable.$xeGrid;
4452
+ const $xeGantt = $xeTable.$xeGantt;
4453
+ const $xeGGWrapper = $xeGrid || $xeGantt;
4452
4454
  if (slotFunc) {
4453
- if ($xeGrid) {
4454
- return $xeGrid.callSlot(slotFunc, params, h, vNodes);
4455
+ if ($xeGGWrapper) {
4456
+ return $xeGGWrapper.callSlot(slotFunc, params, h, vNodes);
4455
4457
  }
4456
4458
  // if (XEUtils.isString(slotFunc)) {
4457
4459
  // slotFunc = slots[slotFunc] || null
@@ -4472,10 +4474,12 @@ const Methods = {
4472
4474
  getParentElem() {
4473
4475
  const $xeTable = this;
4474
4476
  const $xeGrid = $xeTable.$xeGrid;
4477
+ const $xeGantt = $xeTable.$xeGantt;
4478
+ const $xeGGWrapper = $xeGrid || $xeGantt;
4475
4479
  const {
4476
4480
  $el
4477
4481
  } = this;
4478
- return $xeGrid ? $xeGrid.$el.parentNode : $el.parentNode;
4482
+ return $xeGGWrapper ? $xeGGWrapper.$el.parentNode : $el.parentNode;
4479
4483
  },
4480
4484
  /**
4481
4485
  * 获取父容器的高度
@@ -4483,6 +4487,8 @@ const Methods = {
4483
4487
  getParentHeight() {
4484
4488
  const $xeTable = this;
4485
4489
  const $xeGrid = $xeTable.$xeGrid;
4490
+ const $xeGantt = $xeTable.$xeGantt;
4491
+ const $xeGGWrapper = $xeGrid || $xeGantt;
4486
4492
  const props = $xeTable;
4487
4493
  const {
4488
4494
  height
@@ -4493,8 +4499,8 @@ const Methods = {
4493
4499
  const parentPaddingSize = height === '100%' || height === 'auto' ? (0, _dom.getPaddingTopBottomSize)(parentElem) : 0;
4494
4500
  let parentWrapperHeight = 0;
4495
4501
  if (parentElem) {
4496
- if ($xeGrid && (0, _dom.hasClass)(parentElem, 'vxe-grid--table-wrapper')) {
4497
- parentWrapperHeight = $xeGrid.getParentHeight();
4502
+ if ($xeGGWrapper && (0, _dom.hasClass)(parentElem, 'vxe-grid--table-wrapper')) {
4503
+ parentWrapperHeight = $xeGGWrapper.getParentHeight();
4498
4504
  } else {
4499
4505
  parentWrapperHeight = parentElem.clientHeight;
4500
4506
  }
@@ -4511,7 +4517,9 @@ const Methods = {
4511
4517
  getExcludeHeight() {
4512
4518
  const $xeTable = this;
4513
4519
  const $xeGrid = $xeTable.$xeGrid;
4514
- return $xeGrid ? $xeGrid.getExcludeHeight() : 0;
4520
+ const $xeGantt = $xeTable.$xeGantt;
4521
+ const $xeGGWrapper = $xeGrid || $xeGantt;
4522
+ return $xeGGWrapper ? $xeGGWrapper.getExcludeHeight() : 0;
4515
4523
  },
4516
4524
  /**
4517
4525
  * 重置表格的一切数据状态
@@ -7017,6 +7025,7 @@ const Methods = {
7017
7025
  preventEvent(evnt, type, args, next, end) {
7018
7026
  const $xeTable = this;
7019
7027
  const $xeGrid = $xeTable.$xeGrid;
7028
+ const $xeGantt = $xeTable.$xeGantt;
7020
7029
  let evntList = interceptor.get(type);
7021
7030
  // 兼容老版本
7022
7031
  if (!evntList.length && type === 'event.clearEdit') {
@@ -7031,8 +7040,9 @@ const Methods = {
7031
7040
  for (let i = 0; i < evntList.length; i++) {
7032
7041
  const func = evntList[i];
7033
7042
  const fnRest = func(Object.assign({
7034
- $grid: $xeGrid,
7035
7043
  $table: $xeTable,
7044
+ $grid: $xeGrid,
7045
+ $gantt: $xeGantt,
7036
7046
  $event: evnt
7037
7047
  }, args));
7038
7048
  if (fnRest === false) {
@@ -7060,6 +7070,8 @@ const Methods = {
7060
7070
  handleGlobalMousedownEvent(evnt) {
7061
7071
  const $xeTable = this;
7062
7072
  const $xeGrid = $xeTable.$xeGrid;
7073
+ const $xeGantt = $xeTable.$xeGantt;
7074
+ const $xeGGWrapper = $xeGrid || $xeGantt;
7063
7075
  const {
7064
7076
  $el,
7065
7077
  $refs,
@@ -7160,7 +7172,7 @@ const Methods = {
7160
7172
  }
7161
7173
  }
7162
7174
  } else if (mouseConfig) {
7163
- if (!(0, _dom.getEventTargetNode)(evnt, $el).flag && !($xeGrid && (0, _dom.getEventTargetNode)(evnt, $xeGrid.$el).flag) && !(tableMenu && (0, _dom.getEventTargetNode)(evnt, tableMenu.$el).flag) && !($toolbar && (0, _dom.getEventTargetNode)(evnt, $toolbar.$el).flag)) {
7175
+ if (!(0, _dom.getEventTargetNode)(evnt, $el).flag && !($xeGGWrapper && (0, _dom.getEventTargetNode)(evnt, $xeGGWrapper.$el).flag) && !(tableMenu && (0, _dom.getEventTargetNode)(evnt, tableMenu.$el).flag) && !($toolbar && (0, _dom.getEventTargetNode)(evnt, $toolbar.$el).flag)) {
7164
7176
  if (this.clearSelected) {
7165
7177
  this.clearSelected();
7166
7178
  }
@@ -7184,7 +7196,7 @@ const Methods = {
7184
7196
  if (ctxMenuStore.visible && tableMenu && !(0, _dom.getEventTargetNode)(evnt, tableMenu.$el).flag) {
7185
7197
  this.closeMenu();
7186
7198
  }
7187
- const isActivated = (0, _dom.getEventTargetNode)(evnt, ($xeGrid || this).$el).flag;
7199
+ const isActivated = (0, _dom.getEventTargetNode)(evnt, ($xeGGWrapper || $xeTable).$el).flag;
7188
7200
  // 如果存在校验,点击了表格之外则清除
7189
7201
  if (!isActivated && editRules && validOpts.autoClear) {
7190
7202
  this.validErrorMaps = {};
@@ -7262,6 +7274,7 @@ const Methods = {
7262
7274
  const internalData = $xeTable;
7263
7275
  const reactData = $xeTable;
7264
7276
  const $xeGrid = $xeTable.$xeGrid;
7277
+ const $xeGantt = $xeTable.$xeGantt;
7265
7278
  // 该行为只对当前激活的表格有效
7266
7279
  if (internalData.isActivated) {
7267
7280
  $xeTable.preventEvent(evnt, 'event.keydown', null, () => {
@@ -7487,7 +7500,8 @@ const Methods = {
7487
7500
  column: selected.column,
7488
7501
  columnIndex: $xeTable.getColumnIndex(selected.column),
7489
7502
  $table: $xeTable,
7490
- $grid: $xeGrid
7503
+ $grid: $xeGrid,
7504
+ $gantt: $xeGantt
7491
7505
  };
7492
7506
  // 是否被禁用
7493
7507
  if (!beforeEditMethod || beforeEditMethod(params)) {
@@ -7515,7 +7529,8 @@ const Methods = {
7515
7529
  column: selected.column,
7516
7530
  columnIndex: $xeTable.getColumnIndex(selected.column),
7517
7531
  $table: $xeTable,
7518
- $grid: $xeGrid
7532
+ $grid: $xeGrid,
7533
+ $gantt: $xeGantt
7519
7534
  };
7520
7535
  // 是否被禁用
7521
7536
  if (!beforeEditMethod || beforeEditMethod(params)) {
@@ -7546,7 +7561,8 @@ const Methods = {
7546
7561
  rowIndex: $xeTable.getRowIndex(parentRow),
7547
7562
  $rowIndex: $xeTable.getVMRowIndex(parentRow),
7548
7563
  $table: $xeTable,
7549
- $grid: $xeGrid
7564
+ $grid: $xeGrid,
7565
+ $gantt: $xeGantt
7550
7566
  };
7551
7567
  $xeTable.setTreeExpand(parentRow, false).then(() => $xeTable.scrollToRow(parentRow)).then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
7552
7568
  }
@@ -7567,7 +7583,8 @@ const Methods = {
7567
7583
  column: selected.column,
7568
7584
  columnIndex: $xeTable.getColumnIndex(selected.column),
7569
7585
  $table: $xeTable,
7570
- $grid: $xeGrid
7586
+ $grid: $xeGrid,
7587
+ $gantt: $xeGantt
7571
7588
  };
7572
7589
  if (!beforeEditMethod || beforeEditMethod(params)) {
7573
7590
  if (editMethod) {
@@ -12540,6 +12557,7 @@ const Methods = {
12540
12557
  const reactData = $xeTable;
12541
12558
  const internalData = $xeTable;
12542
12559
  const $xeGrid = $xeTable.$xeGrid;
12560
+ const $xeGantt = $xeTable.$xeGantt;
12543
12561
  const {
12544
12562
  showFooter,
12545
12563
  footerData,
@@ -12557,7 +12575,8 @@ const Methods = {
12557
12575
  columns: visibleColumn,
12558
12576
  data: afterFullData,
12559
12577
  $table: $xeTable,
12560
- $grid: $xeGrid
12578
+ $grid: $xeGrid,
12579
+ $gantt: $xeGantt
12561
12580
  }) : [];
12562
12581
  }
12563
12582
  reactData.footerTableData = footData;
@@ -12725,20 +12744,24 @@ const Methods = {
12725
12744
  dispatchEvent(type, params, evnt) {
12726
12745
  const $xeTable = this;
12727
12746
  const $xeGrid = $xeTable.$xeGrid;
12747
+ const $xeGantt = $xeTable.$xeGantt;
12728
12748
  $xeTable.$emit(type, createEvent(evnt, {
12729
12749
  $table: $xeTable,
12730
- $grid: $xeGrid
12750
+ $grid: $xeGrid,
12751
+ $gantt: $xeGantt
12731
12752
  }, params));
12732
12753
  },
12733
12754
  // 已废弃,使用 dispatchEvent
12734
12755
  emitEvent(type, params, evnt) {
12735
12756
  const $xeTable = this;
12736
12757
  const $xeGrid = $xeTable.$xeGrid;
12737
- this.$emit(type, Object.assign({
12758
+ const $xeGantt = $xeTable.$xeGantt;
12759
+ $xeTable.$emit(type, createEvent(evnt, {
12738
12760
  $table: $xeTable,
12739
12761
  $grid: $xeGrid,
12762
+ $gantt: $xeGantt,
12740
12763
  $event: evnt
12741
- }, params));
12764
+ }));
12742
12765
  },
12743
12766
  focus() {
12744
12767
  this.isActivated = true;