vxe-table 3.11.26 → 3.11.27-beta.0

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 (134) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/locale/lang/ar-EG.js +2 -2
  4. package/es/locale/lang/de-DE.js +2 -2
  5. package/es/locale/lang/en-US.js +2 -2
  6. package/es/locale/lang/es-ES.js +2 -2
  7. package/es/locale/lang/fr-FR.js +2 -2
  8. package/es/locale/lang/hu-HU.js +2 -2
  9. package/es/locale/lang/hy-AM.js +2 -2
  10. package/es/locale/lang/ja-JP.js +2 -2
  11. package/es/locale/lang/ko-KR.js +2 -2
  12. package/es/locale/lang/nb-NO.js +2 -2
  13. package/es/locale/lang/pt-BR.js +2 -2
  14. package/es/locale/lang/ru-RU.js +2 -2
  15. package/es/locale/lang/ug-CN.js +2 -2
  16. package/es/locale/lang/uk-UA.js +2 -2
  17. package/es/locale/lang/vi-VN.js +2 -2
  18. package/es/locale/lang/zh-CHT.js +2 -2
  19. package/es/locale/lang/zh-CN.js +2 -2
  20. package/es/style.css +1 -1
  21. package/es/style.min.css +1 -1
  22. package/es/table/src/body.js +2 -2
  23. package/es/table/src/cell.js +2 -2
  24. package/es/table/src/column.js +10 -8
  25. package/es/table/src/group.js +37 -6
  26. package/es/table/src/methods.js +167 -70
  27. package/es/table/src/util.js +0 -1
  28. package/es/table/style.css +5 -0
  29. package/es/table/style.min.css +1 -1
  30. package/es/ui/index.js +1 -1
  31. package/es/ui/src/log.js +1 -1
  32. package/es/vxe-table/style.css +5 -0
  33. package/es/vxe-table/style.min.css +1 -1
  34. package/lib/index.css +1 -1
  35. package/lib/index.min.css +1 -1
  36. package/lib/index.umd.js +244 -99
  37. package/lib/index.umd.min.js +1 -1
  38. package/lib/locale/lang/ar-EG.js +2 -2
  39. package/lib/locale/lang/ar-EG.min.js +1 -1
  40. package/lib/locale/lang/de-DE.js +2 -2
  41. package/lib/locale/lang/de-DE.min.js +1 -1
  42. package/lib/locale/lang/en-US.js +2 -2
  43. package/lib/locale/lang/en-US.min.js +1 -1
  44. package/lib/locale/lang/en-US.umd.js +2 -2
  45. package/lib/locale/lang/es-ES.js +2 -2
  46. package/lib/locale/lang/es-ES.min.js +1 -1
  47. package/lib/locale/lang/es-ES.umd.js +2 -2
  48. package/lib/locale/lang/fr-FR.js +2 -2
  49. package/lib/locale/lang/fr-FR.min.js +1 -1
  50. package/lib/locale/lang/hu-HU.js +2 -2
  51. package/lib/locale/lang/hu-HU.min.js +1 -1
  52. package/lib/locale/lang/hu-HU.umd.js +2 -2
  53. package/lib/locale/lang/hy-AM.js +2 -2
  54. package/lib/locale/lang/hy-AM.min.js +1 -1
  55. package/lib/locale/lang/ja-JP.js +2 -2
  56. package/lib/locale/lang/ja-JP.min.js +1 -1
  57. package/lib/locale/lang/ja-JP.umd.js +2 -2
  58. package/lib/locale/lang/ko-KR.js +2 -2
  59. package/lib/locale/lang/ko-KR.min.js +1 -1
  60. package/lib/locale/lang/ko-KR.umd.js +2 -2
  61. package/lib/locale/lang/nb-NO.js +2 -2
  62. package/lib/locale/lang/nb-NO.min.js +1 -1
  63. package/lib/locale/lang/pt-BR.js +2 -2
  64. package/lib/locale/lang/pt-BR.min.js +1 -1
  65. package/lib/locale/lang/pt-BR.umd.js +2 -2
  66. package/lib/locale/lang/ru-RU.js +2 -2
  67. package/lib/locale/lang/ru-RU.min.js +1 -1
  68. package/lib/locale/lang/ru-RU.umd.js +2 -2
  69. package/lib/locale/lang/ug-CN.js +2 -2
  70. package/lib/locale/lang/ug-CN.min.js +1 -1
  71. package/lib/locale/lang/uk-UA.js +2 -2
  72. package/lib/locale/lang/uk-UA.min.js +1 -1
  73. package/lib/locale/lang/uk-UA.umd.js +2 -2
  74. package/lib/locale/lang/vi-VN.js +2 -2
  75. package/lib/locale/lang/vi-VN.min.js +1 -1
  76. package/lib/locale/lang/zh-CHT.js +2 -2
  77. package/lib/locale/lang/zh-CHT.min.js +1 -1
  78. package/lib/locale/lang/zh-CHT.umd.js +2 -2
  79. package/lib/locale/lang/zh-CN.js +2 -2
  80. package/lib/locale/lang/zh-CN.min.js +1 -1
  81. package/lib/locale/lang/zh-CN.umd.js +2 -2
  82. package/lib/style.css +1 -1
  83. package/lib/style.min.css +1 -1
  84. package/lib/table/src/body.js +2 -2
  85. package/lib/table/src/body.min.js +1 -1
  86. package/lib/table/src/cell.js +2 -1
  87. package/lib/table/src/cell.min.js +1 -1
  88. package/lib/table/src/column.js +11 -9
  89. package/lib/table/src/column.min.js +1 -1
  90. package/lib/table/src/group.js +39 -6
  91. package/lib/table/src/group.min.js +1 -1
  92. package/lib/table/src/methods.js +182 -72
  93. package/lib/table/src/methods.min.js +1 -1
  94. package/lib/table/src/util.js +0 -1
  95. package/lib/table/src/util.min.js +1 -1
  96. package/lib/table/style/style.css +5 -0
  97. package/lib/table/style/style.min.css +1 -1
  98. package/lib/ui/index.js +1 -1
  99. package/lib/ui/index.min.js +1 -1
  100. package/lib/ui/src/log.js +1 -1
  101. package/lib/ui/src/log.min.js +1 -1
  102. package/lib/vxe-table/style/style.css +5 -0
  103. package/lib/vxe-table/style/style.min.css +1 -1
  104. package/package.json +2 -2
  105. package/packages/locale/lang/ar-EG.ts +2 -2
  106. package/packages/locale/lang/de-DE.ts +2 -2
  107. package/packages/locale/lang/en-US.ts +2 -2
  108. package/packages/locale/lang/es-ES.ts +2 -2
  109. package/packages/locale/lang/fr-FR.ts +2 -2
  110. package/packages/locale/lang/hu-HU.ts +2 -2
  111. package/packages/locale/lang/hy-AM.ts +2 -2
  112. package/packages/locale/lang/ja-JP.ts +2 -2
  113. package/packages/locale/lang/ko-KR.ts +2 -2
  114. package/packages/locale/lang/nb-NO.ts +2 -2
  115. package/packages/locale/lang/pt-BR.ts +2 -2
  116. package/packages/locale/lang/ru-RU.ts +2 -2
  117. package/packages/locale/lang/ug-CN.ts +2 -2
  118. package/packages/locale/lang/uk-UA.ts +2 -2
  119. package/packages/locale/lang/vi-VN.ts +2 -2
  120. package/packages/locale/lang/zh-CHT.ts +2 -2
  121. package/packages/locale/lang/zh-CN.ts +2 -2
  122. package/packages/table/src/body.ts +2 -2
  123. package/packages/table/src/cell.ts +2 -2
  124. package/packages/table/src/column.ts +10 -8
  125. package/packages/table/src/group.ts +40 -6
  126. package/packages/table/src/methods.ts +183 -83
  127. package/packages/table/src/util.ts +0 -1
  128. package/styles/components/table.scss +5 -0
  129. /package/es/{iconfont.1733885890565.ttf → iconfont.1733931178504.ttf} +0 -0
  130. /package/es/{iconfont.1733885890565.woff → iconfont.1733931178504.woff} +0 -0
  131. /package/es/{iconfont.1733885890565.woff2 → iconfont.1733931178504.woff2} +0 -0
  132. /package/lib/{iconfont.1733885890565.ttf → iconfont.1733931178504.ttf} +0 -0
  133. /package/lib/{iconfont.1733885890565.woff → iconfont.1733931178504.woff} +0 -0
  134. /package/lib/{iconfont.1733885890565.woff2 → iconfont.1733931178504.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.11.26";
2223
+ const version = "3.11.27-beta.0";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2789,7 +2789,7 @@ function isNodeElement(elem) {
2789
2789
  const {
2790
2790
  log: log_log
2791
2791
  } = core_.VxeUI;
2792
- const log_version = `table v${"3.11.26"}`;
2792
+ const log_version = `table v${"3.11.27-beta.0"}`;
2793
2793
  const warnLog = log_log.create('warn', log_version);
2794
2794
  const errLog = log_log.create('error', log_version);
2795
2795
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -3097,7 +3097,6 @@ function assembleColumn(_vm) {
3097
3097
  columnConfig
3098
3098
  } = _vm;
3099
3099
  const groupConfig = $xecolumn ? $xecolumn.columnConfig : null;
3100
- columnConfig.slots = _vm.$scopedSlots;
3101
3100
  if (groupConfig) {
3102
3101
  if (true) {
3103
3102
  if ($xecolumn.$options._componentTag === 'vxe-table-column') {
@@ -3629,12 +3628,13 @@ function renderHeaderCellDragIcon(h, params) {
3629
3628
  const {
3630
3629
  showIcon,
3631
3630
  icon,
3631
+ isCrossDrag,
3632
3632
  visibleMethod,
3633
3633
  disabledMethod
3634
3634
  } = columnDragOpts;
3635
3635
  const isDisabled = disabledMethod && disabledMethod(params);
3636
3636
  if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
3637
- if (!(column.fixed || column.parentId)) {
3637
+ if (!column.fixed && (isCrossDrag || !column.parentId)) {
3638
3638
  return h('span', {
3639
3639
  key: 'dg',
3640
3640
  class: ['vxe-cell--drag-handle', {
@@ -4638,10 +4638,13 @@ const Cell = {
4638
4638
  }
4639
4639
  };
4640
4640
  /* harmony default export */ var cell = (Cell);
4641
+ ;// CONCATENATED MODULE: ./packages/ui/src/comp.ts
4642
+ const defineVxeComponent = options => options;
4641
4643
  ;// CONCATENATED MODULE: ./packages/table/src/column.ts
4642
4644
 
4643
4645
 
4644
- const props = {
4646
+
4647
+ const columnProps = {
4645
4648
  // 列唯一主键
4646
4649
  colId: [String, Number],
4647
4650
  // 渲染类型 seq,radio,checkbox,expand,html
@@ -4757,9 +4760,9 @@ const props = {
4757
4760
  // 额外的参数
4758
4761
  params: Object
4759
4762
  };
4760
- const watch = {};
4761
- Object.keys(props).forEach(name => {
4762
- watch[name] = function (value) {
4763
+ const columnWatch = {};
4764
+ Object.keys(columnProps).forEach(name => {
4765
+ columnWatch[name] = function (value) {
4763
4766
  this.columnConfig.update(name, value);
4764
4767
  if (this.$xetable) {
4765
4768
  if (name === 'filters') {
@@ -4771,9 +4774,9 @@ Object.keys(props).forEach(name => {
4771
4774
  }
4772
4775
  };
4773
4776
  });
4774
- /* harmony default export */ var column = ({
4777
+ /* harmony default export */ var column = (defineVxeComponent({
4775
4778
  name: 'VxeColumn',
4776
- props,
4779
+ props: columnProps,
4777
4780
  provide() {
4778
4781
  return {
4779
4782
  $xecolumn: this,
@@ -4788,11 +4791,12 @@ Object.keys(props).forEach(name => {
4788
4791
  default: null
4789
4792
  }
4790
4793
  },
4791
- watch,
4794
+ watch: columnWatch,
4792
4795
  created() {
4793
4796
  this.columnConfig = this.createColumn(this.$xetable, this);
4794
4797
  },
4795
4798
  mounted() {
4799
+ this.columnConfig.slots = this.$scopedSlots;
4796
4800
  assembleColumn(this);
4797
4801
  },
4798
4802
  destroyed() {
@@ -4802,7 +4806,7 @@ Object.keys(props).forEach(name => {
4802
4806
  return h('div', this.$slots.default);
4803
4807
  },
4804
4808
  methods: cell
4805
- });
4809
+ }));
4806
4810
  ;// CONCATENATED MODULE: ./packages/column/index.ts
4807
4811
 
4808
4812
 
@@ -4823,16 +4827,49 @@ const Column = VxeColumn;
4823
4827
  /* harmony default export */ var packages_column = ((/* unused pure expression or super */ null && (VxeColumn)));
4824
4828
  ;// CONCATENATED MODULE: ./packages/table/src/group.ts
4825
4829
 
4826
- /* harmony default export */ var group = ({
4830
+
4831
+
4832
+
4833
+ /* harmony default export */ var group = (defineVxeComponent({
4827
4834
  name: 'VxeColgroup',
4828
- extends: column,
4835
+ props: columnProps,
4829
4836
  provide() {
4830
4837
  return {
4831
- xecolgroup: this,
4838
+ $xecolumn: this,
4832
4839
  $xegrid: null
4833
4840
  };
4834
- }
4835
- });
4841
+ },
4842
+ inject: {
4843
+ $xetable: {
4844
+ default: null
4845
+ },
4846
+ $xecolumn: {
4847
+ default: null
4848
+ }
4849
+ },
4850
+ watch: columnWatch,
4851
+ created() {
4852
+ this.columnConfig = this.createColumn(this.$xetable, this);
4853
+ },
4854
+ mounted() {
4855
+ const {
4856
+ $scopedSlots
4857
+ } = this;
4858
+ const columnSlots = {};
4859
+ if ($scopedSlots.header) {
4860
+ columnSlots.header = $scopedSlots.header;
4861
+ }
4862
+ this.columnConfig.slots = columnSlots;
4863
+ assembleColumn(this);
4864
+ },
4865
+ destroyed() {
4866
+ destroyColumn(this);
4867
+ },
4868
+ render(h) {
4869
+ return h('div', this.$slots.default);
4870
+ },
4871
+ methods: cell
4872
+ }));
4836
4873
  ;// CONCATENATED MODULE: ./packages/colgroup/index.ts
4837
4874
 
4838
4875
 
@@ -4872,6 +4909,7 @@ const {
4872
4909
  // const isWebkit = browse['-webkit'] && !browse.edge
4873
4910
  // const debounceScrollYDuration = browse.msie ? 80 : 20
4874
4911
  const customStorageKey = 'VXE_CUSTOM_STORE';
4912
+ const tpImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
4875
4913
  // 获取所有的列,排除分组
4876
4914
  const getColumnList = columns => {
4877
4915
  const result = [];
@@ -5384,11 +5422,18 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
5384
5422
  if (cdLineEl) {
5385
5423
  if (showLine) {
5386
5424
  const thRect = thEl.getBoundingClientRect();
5425
+ const offsetTop = Math.max(0, thRect.y - wrapperRect.y);
5387
5426
  cdLineEl.style.display = 'block';
5427
+ cdLineEl.style.top = `${offsetTop}px`;
5388
5428
  cdLineEl.style.left = `${Math.max(1, thRect.x - wrapperRect.x)}px`;
5389
5429
  cdLineEl.style.width = `${thRect.width}px`;
5390
- cdLineEl.style.height = `${wrapperRect.height - scrollbarHeight}px`;
5430
+ if (prevDragToChild) {
5431
+ cdLineEl.style.height = `${thRect.height}px`;
5432
+ } else {
5433
+ cdLineEl.style.height = `${wrapperRect.height - offsetTop - scrollbarHeight}px`;
5434
+ }
5391
5435
  cdLineEl.setAttribute('drag-pos', dragPos);
5436
+ cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
5392
5437
  } else {
5393
5438
  cdLineEl.style.display = '';
5394
5439
  }
@@ -5950,12 +5995,12 @@ const Methods = {
5950
5995
  height: 0
5951
5996
  };
5952
5997
  }
5998
+ cacheItem.row = row;
5999
+ cacheItem.items = items;
6000
+ cacheItem.parent = parent;
6001
+ cacheItem.level = level;
6002
+ cacheItem.index = treeConfig && parent ? -1 : index;
5953
6003
  if (isSource) {
5954
- cacheItem.row = row;
5955
- cacheItem.items = items;
5956
- cacheItem.parent = parent;
5957
- cacheItem.level = level;
5958
- cacheItem.index = treeConfig && parent ? -1 : index;
5959
6004
  fullDataRowIdMaps[rowid] = cacheItem;
5960
6005
  }
5961
6006
  fullAllDataRowIdMaps[rowid] = cacheItem;
@@ -6070,18 +6115,26 @@ const Methods = {
6070
6115
  * 牺牲数据组装的耗时,用来换取使用过程中的流畅
6071
6116
  */
6072
6117
  cacheColumnMap() {
6118
+ const $xeTable = this;
6119
+ const props = $xeTable;
6120
+ const reactData = $xeTable;
6121
+ const internalData = $xeTable;
6073
6122
  const {
6074
6123
  tableFullColumn,
6075
- collectColumn,
6076
- fullColumnMap,
6077
- showOverflow,
6078
- columnOpts,
6079
- rowOpts
6080
- } = this;
6081
- const fullColumnIdData = this.fullColumnIdData = {};
6082
- const fullColumnFieldData = this.fullColumnFieldData = {};
6124
+ collectColumn
6125
+ } = internalData;
6126
+ const fullColumnIdData = internalData.fullColumnIdData = {};
6127
+ const fullColumnFieldData = internalData.fullColumnFieldData = {};
6128
+ const mouseOpts = $xeTable.computeMouseOpts;
6129
+ const columnOpts = $xeTable.computeColumnOpts;
6130
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
6131
+ const {
6132
+ isCrossDrag,
6133
+ isSelfToChildDrag
6134
+ } = columnDragOpts;
6135
+ const rowOpts = $xeTable.computeRowOpts;
6083
6136
  const isGroup = collectColumn.some(hasChildrenList);
6084
- let isAllOverflow = !!showOverflow;
6137
+ let isAllOverflow = !!props.showOverflow;
6085
6138
  let expandColumn;
6086
6139
  let treeNodeColumn;
6087
6140
  let checkboxColumn;
@@ -6097,6 +6150,8 @@ const Methods = {
6097
6150
  treeNode
6098
6151
  } = column;
6099
6152
  const rest = {
6153
+ $index: -1,
6154
+ _index: -1,
6100
6155
  column,
6101
6156
  colid,
6102
6157
  index,
@@ -6105,12 +6160,14 @@ const Methods = {
6105
6160
  width: 0
6106
6161
  };
6107
6162
  if (field) {
6108
- if (true) {
6109
- if (fullColumnFieldData[field]) {
6110
- warnLog('vxe.error.colRepet', ['field', field]);
6111
- }
6163
+ if (fullColumnFieldData[field]) {
6164
+ errLog('vxe.error.colRepet', ['field', field]);
6112
6165
  }
6113
6166
  fullColumnFieldData[field] = rest;
6167
+ } else {
6168
+ if (isCrossDrag || isSelfToChildDrag) {
6169
+ errLog('vxe.error.emptyProp', ['column.field']);
6170
+ }
6114
6171
  }
6115
6172
  if (!hasFixed && fixed) {
6116
6173
  hasFixed = fixed;
@@ -6154,27 +6211,6 @@ const Methods = {
6154
6211
  }
6155
6212
  }
6156
6213
  }
6157
- if (true) {
6158
- if (this.showOverflow && column.showOverflow === false) {
6159
- warnLog('vxe.error.errConflicts', [`table.show-overflow=${this.showOverflow}`, `column.show-overflow=${column.showOverflow}`]);
6160
- }
6161
- if (this.showHeaderOverflow && column.showHeaderOverflow === false) {
6162
- warnLog('vxe.error.errConflicts', [`table.show-header-overflow=${this.showHeaderOverflow}`, `column.show-header-overflow=${column.showHeaderOverflow}`]);
6163
- }
6164
- if (this.showFooterOverflow && column.showFooterOverflow === false) {
6165
- warnLog('vxe.error.errConflicts', [`table.show-footer-overflow=${this.showFooterOverflow}`, `column.show-footer-overflow=${column.showFooterOverflow}`]);
6166
- }
6167
- }
6168
- if (true) {
6169
- if (htmlColumn) {
6170
- if (!columnOpts.useKey) {
6171
- errLog('vxe.error.reqProp', ['column-config.useKey', 'column.type=html']);
6172
- }
6173
- if (!rowOpts.useKey) {
6174
- errLog('vxe.error.reqProp', ['row-config.useKey', 'column.type=html']);
6175
- }
6176
- }
6177
- }
6178
6214
  if (isAllOverflow && column.showOverflow === false) {
6179
6215
  isAllOverflow = false;
6180
6216
  }
@@ -6182,9 +6218,7 @@ const Methods = {
6182
6218
  errLog('vxe.error.colRepet', ['colId', colid]);
6183
6219
  }
6184
6220
  fullColumnIdData[colid] = rest;
6185
- fullColumnMap.set(column, rest);
6186
6221
  };
6187
- fullColumnMap.clear();
6188
6222
  if (isGroup) {
6189
6223
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parent, nodes) => {
6190
6224
  column.level = nodes.length;
@@ -6194,14 +6228,24 @@ const Methods = {
6194
6228
  tableFullColumn.forEach(handleFunc);
6195
6229
  }
6196
6230
  if (true) {
6197
- if (expandColumn && this.mouseOpts.area) {
6231
+ if (expandColumn && mouseOpts.area) {
6198
6232
  errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand']);
6199
6233
  }
6200
6234
  }
6201
- this.isGroup = isGroup;
6202
- this.treeNodeColumn = treeNodeColumn;
6203
- this.expandColumn = expandColumn;
6204
- this.isAllOverflow = isAllOverflow;
6235
+ if (true) {
6236
+ if (htmlColumn) {
6237
+ if (!columnOpts.useKey) {
6238
+ errLog('vxe.error.reqProp', ['column-config.useKey & column.type=html']);
6239
+ }
6240
+ if (!rowOpts.useKey) {
6241
+ errLog('vxe.error.reqProp', ['row-config.useKey & column.type=html']);
6242
+ }
6243
+ }
6244
+ }
6245
+ reactData.isGroup = isGroup;
6246
+ reactData.treeNodeColumn = treeNodeColumn;
6247
+ reactData.expandColumn = expandColumn;
6248
+ reactData.isAllOverflow = isAllOverflow;
6205
6249
  },
6206
6250
  /**
6207
6251
  * 根据 tr 元素获取对应的 row 信息
@@ -8010,6 +8054,10 @@ const Methods = {
8010
8054
  const {
8011
8055
  rceTimeout
8012
8056
  } = internalData;
8057
+ const el = $xeTable.$refs.refElem;
8058
+ if (!el || !el.clientWidth) {
8059
+ $xeTable.autoCellWidth();
8060
+ }
8013
8061
  if (rceTimeout) {
8014
8062
  clearTimeout(rceTimeout);
8015
8063
  $xeTable.$nextTick(() => {
@@ -10869,8 +10917,9 @@ const Methods = {
10869
10917
  * 行拖拽
10870
10918
  */
10871
10919
  handleRowDragDragstartEvent(evnt) {
10872
- const img = new Image();
10873
10920
  if (evnt.dataTransfer) {
10921
+ const img = new Image();
10922
+ img.src = tpImg;
10874
10923
  evnt.dataTransfer.setDragImage(img, 0, 0);
10875
10924
  }
10876
10925
  },
@@ -10954,8 +11003,8 @@ const Methods = {
10954
11003
  return;
10955
11004
  }
10956
11005
  if (oldAllMaps[newRowid]) {
11006
+ isSelfToChildStatus = true;
10957
11007
  if (!isSelfToChildDrag) {
10958
- isSelfToChildStatus = true;
10959
11008
  if (core_.VxeUI.modal) {
10960
11009
  core_.VxeUI.modal.message({
10961
11010
  status: 'error',
@@ -11031,7 +11080,7 @@ const Methods = {
11031
11080
  }
11032
11081
  reactData.isDragRowMove = true;
11033
11082
  $xeTable.handleTableData(treeConfig && transform);
11034
- $xeTable.cacheRowMap(true);
11083
+ $xeTable.cacheRowMap();
11035
11084
  $xeTable.updateScrollYStatus();
11036
11085
  if (!(treeConfig && transform)) {
11037
11086
  $xeTable.updateAfterDataIndex();
@@ -11059,6 +11108,7 @@ const Methods = {
11059
11108
  }
11060
11109
  hideDropTip($xeTable);
11061
11110
  clearRowDropOrigin($xeTable);
11111
+ internalData.prevDragToChild = false;
11062
11112
  reactData.dragRow = null;
11063
11113
  reactData.dragCol = null;
11064
11114
  setTimeout(() => {
@@ -11167,8 +11217,9 @@ const Methods = {
11167
11217
  * 列拖拽
11168
11218
  */
11169
11219
  handleHeaderCellDragDragstartEvent(evnt) {
11170
- const img = new Image();
11171
11220
  if (evnt.dataTransfer) {
11221
+ const img = new Image();
11222
+ img.src = tpImg;
11172
11223
  evnt.dataTransfer.setDragImage(img, 0, 0);
11173
11224
  }
11174
11225
  },
@@ -11182,6 +11233,9 @@ const Methods = {
11182
11233
  } = props;
11183
11234
  const columnDragOpts = $xeTable.computeColumnDragOpts;
11184
11235
  const {
11236
+ isCrossDrag,
11237
+ isSelfToChildDrag,
11238
+ isToChildDrag,
11185
11239
  dragEndMethod
11186
11240
  } = columnDragOpts;
11187
11241
  const {
@@ -11190,38 +11244,126 @@ const Methods = {
11190
11244
  const {
11191
11245
  collectColumn,
11192
11246
  prevDragCol,
11193
- prevDragPos
11247
+ prevDragPos,
11248
+ prevDragToChild
11194
11249
  } = internalData;
11195
11250
  const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
11196
11251
  if (prevDragCol && dragCol) {
11197
11252
  // 判断是否有拖动
11198
11253
  if (prevDragCol !== dragCol) {
11254
+ const oldColumn = dragCol;
11255
+ const newColumn = prevDragCol;
11199
11256
  Promise.resolve(dragEndMethod ? dragEndMethod({
11200
- oldColumn: dragCol,
11201
- newColumn: prevDragCol,
11257
+ oldColumn,
11258
+ newColumn,
11202
11259
  dragPos: prevDragPos,
11203
11260
  offsetIndex: dragOffsetIndex
11204
11261
  }) : true).then(status => {
11205
11262
  if (!status) {
11206
11263
  return;
11207
11264
  }
11265
+ let oafIndex = -1;
11266
+ let nafIndex = -1;
11267
+ const oldAllMaps = {};
11268
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([oldColumn], column => {
11269
+ oldAllMaps[column.id] = column;
11270
+ });
11271
+ let isSelfToChildStatus = false;
11272
+ if (oldColumn.parentId && newColumn.parentId) {
11273
+ // 子到子
11274
+ if (!isCrossDrag) {
11275
+ return;
11276
+ }
11277
+ if (oldAllMaps[newColumn.id]) {
11278
+ isSelfToChildStatus = true;
11279
+ if (!isSelfToChildDrag) {
11280
+ if (core_.VxeUI.modal) {
11281
+ core_.VxeUI.modal.message({
11282
+ status: 'error',
11283
+ content: methods_getI18n('vxe.error.treeDragChild')
11284
+ });
11285
+ }
11286
+ return;
11287
+ }
11288
+ }
11289
+ } else if (oldColumn.parentId) {
11290
+ // 子到根
11291
+ if (!isCrossDrag) {
11292
+ return;
11293
+ }
11294
+ } else if (newColumn.parentId) {
11295
+ // 根到子
11296
+ if (!isCrossDrag) {
11297
+ return;
11298
+ }
11299
+ if (oldAllMaps[newColumn.id]) {
11300
+ isSelfToChildStatus = true;
11301
+ if (!isSelfToChildDrag) {
11302
+ if (core_.VxeUI.modal) {
11303
+ core_.VxeUI.modal.message({
11304
+ status: 'error',
11305
+ content: methods_getI18n('vxe.error.treeDragChild')
11306
+ });
11307
+ }
11308
+ return;
11309
+ }
11310
+ }
11311
+ } else {
11312
+ // 根到根
11313
+ }
11314
+ const oldewMatchRest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(collectColumn, item => item.id === oldColumn.id);
11315
+ // 改变层级
11316
+ if (isSelfToChildStatus && isSelfToChildDrag) {
11317
+ if (oldewMatchRest) {
11318
+ const {
11319
+ items: oCols,
11320
+ index: oIndex
11321
+ } = oldewMatchRest;
11322
+ const childList = oldColumn.children || [];
11323
+ childList.forEach(column => {
11324
+ column.parentId = oldColumn.parentId;
11325
+ });
11326
+ oCols.splice(oIndex, 1, ...childList);
11327
+ oldColumn.children = [];
11328
+ }
11329
+ } else {
11330
+ if (oldewMatchRest) {
11331
+ const {
11332
+ items: oCols,
11333
+ index: oIndex,
11334
+ parent: oParent
11335
+ } = oldewMatchRest;
11336
+ oCols.splice(oIndex, 1);
11337
+ if (!oParent) {
11338
+ oafIndex = oIndex;
11339
+ }
11340
+ }
11341
+ }
11342
+ const newMatchRest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(collectColumn, item => item.id === newColumn.id);
11343
+ if (newMatchRest) {
11344
+ const {
11345
+ items: nCols,
11346
+ index: nIndex,
11347
+ parent: nParent
11348
+ } = newMatchRest;
11349
+ // 转子级
11350
+ if (isToChildDrag && prevDragToChild) {
11351
+ oldColumn.parentId = newColumn.id;
11352
+ newColumn.children = (newColumn.children || []).concat([oldColumn]);
11353
+ } else {
11354
+ oldColumn.parentId = newColumn.parentId;
11355
+ nCols.splice(nIndex + dragOffsetIndex, 0, oldColumn);
11356
+ }
11357
+ if (!nParent) {
11358
+ nafIndex = nIndex;
11359
+ }
11360
+ }
11208
11361
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parent) => {
11209
11362
  if (!parent) {
11210
11363
  const sortIndex = index + 1;
11211
11364
  column.renderSortNumber = sortIndex;
11212
11365
  }
11213
11366
  });
11214
- const oafIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(collectColumn, item => item.id === dragCol.id);
11215
- const nafIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(collectColumn, item => item.id === prevDragCol.id) + dragOffsetIndex;
11216
- const newTargetCol = collectColumn[nafIndex];
11217
- if (newTargetCol) {
11218
- // 插入最后位置
11219
- dragCol.renderSortNumber = newTargetCol.renderSortNumber;
11220
- newTargetCol.renderSortNumber = dragCol.renderSortNumber + 0.5;
11221
- } else {
11222
- // 插入新位置
11223
- dragCol.renderSortNumber = collectColumn.length + 1.5;
11224
- }
11225
11367
  reactData.isDragColMove = true;
11226
11368
  if (mouseConfig) {
11227
11369
  if ($xeTable.clearSelected) {
@@ -11232,14 +11374,12 @@ const Methods = {
11232
11374
  $xeTable.clearCopyCellArea();
11233
11375
  }
11234
11376
  }
11235
- $xeTable.analyColumnWidth();
11236
- $xeTable.$nextTick().then(() => {
11377
+ $xeTable.refreshColumn(true).then(() => {
11237
11378
  $xeTable.updateCellAreas();
11238
- $xeTable.refreshColumn(true);
11239
11379
  });
11240
11380
  $xeTable.dispatchEvent('column-dragend', {
11241
- oldColumn: dragCol,
11242
- newColumn: prevDragCol,
11381
+ oldColumn,
11382
+ newColumn,
11243
11383
  dragPos: prevDragPos,
11244
11384
  offsetIndex: dragOffsetIndex,
11245
11385
  _index: {
@@ -11253,6 +11393,7 @@ const Methods = {
11253
11393
  }
11254
11394
  hideDropTip($xeTable);
11255
11395
  clearColDropOrigin($xeTable);
11396
+ internalData.prevDragToChild = false;
11256
11397
  reactData.dragRow = null;
11257
11398
  reactData.dragCol = null;
11258
11399
  setTimeout(() => {
@@ -11266,10 +11407,16 @@ const Methods = {
11266
11407
  const {
11267
11408
  dragCol
11268
11409
  } = reactData;
11410
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
11411
+ const {
11412
+ isToChildDrag,
11413
+ isCrossDrag
11414
+ } = columnDragOpts;
11269
11415
  if (!dragCol) {
11270
11416
  evnt.preventDefault();
11271
11417
  return;
11272
11418
  }
11419
+ const hasCtrlKey = evnt.ctrlKey;
11273
11420
  const thEl = evnt.currentTarget;
11274
11421
  const colid = thEl.getAttribute('colid');
11275
11422
  const column = $xeTable.getColumnById(colid);
@@ -11280,11 +11427,11 @@ const Methods = {
11280
11427
  } = reactData;
11281
11428
  const offsetX = evnt.clientX - thEl.getBoundingClientRect().x;
11282
11429
  const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right';
11283
- if (dragCol.id === column.id || column.parentId) {
11430
+ if (dragCol && dragCol.id === column.id || !isCrossDrag && column.parentId) {
11284
11431
  showDropTip($xeTable, evnt, null, thEl, false, dragPos);
11285
11432
  return;
11286
11433
  }
11287
- internalData.prevDragToChild = false;
11434
+ internalData.prevDragToChild = !!(isToChildDrag && hasCtrlKey);
11288
11435
  internalData.prevDragCol = column;
11289
11436
  internalData.prevDragPos = dragPos;
11290
11437
  showDropTip($xeTable, evnt, null, thEl, true, dragPos);
@@ -13748,7 +13895,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
13748
13895
  'col--valid-error': !!errorValidItem,
13749
13896
  'col--current': currentColumn === column
13750
13897
  }, getClass(compCellClassName, params), getClass(className, params), getClass(allCellClassName, params)],
13751
- key: columnKey || columnOpts.useKey || rowOpts.useKey ? column.id : $columnIndex,
13898
+ key: columnKey || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
13752
13899
  attrs,
13753
13900
  style: Object.assign({
13754
13901
  height: cellHeight
@@ -13886,7 +14033,7 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
13886
14033
  rowid
13887
14034
  },
13888
14035
  style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
13889
- key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
14036
+ key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex,
13890
14037
  nativeOn: trOn
13891
14038
  }, tdVNs) : h('tr', {
13892
14039
  class: trClass,
@@ -15233,7 +15380,7 @@ function footer_renderHeads(h, _vm, footerTableData) {
15233
15380
  const {
15234
15381
  getConfig: props_getConfig
15235
15382
  } = core_.VxeUI;
15236
- /* harmony default export */ var src_props = ({
15383
+ /* harmony default export */ var props = ({
15237
15384
  /** 基本属性 */
15238
15385
  id: [String, Function],
15239
15386
  // 数据
@@ -22686,7 +22833,7 @@ function handleUupdateResize(_vm) {
22686
22833
  /* harmony default export */ var table = ({
22687
22834
  name: 'VxeTable',
22688
22835
  mixins: [table_globalMixins.sizeMixin, mixin, menu_mixin, edit_mixin, export_mixin, keyboard_mixin, validator_mixin, custom_mixin],
22689
- props: src_props,
22836
+ props: props,
22690
22837
  provide() {
22691
22838
  return {
22692
22839
  $xetable: this,
@@ -24011,8 +24158,6 @@ function handleUupdateResize(_vm) {
24011
24158
  },
24012
24159
  methods: methods
24013
24160
  });
24014
- ;// CONCATENATED MODULE: ./packages/ui/src/comp.ts
24015
- const defineVxeComponent = options => options;
24016
24161
  ;// CONCATENATED MODULE: ./packages/toolbar/src/toolbar.ts
24017
24162
 
24018
24163
 
@@ -24800,7 +24945,7 @@ const {
24800
24945
  renderEmptyElement: grid_renderEmptyElement
24801
24946
  } = core_.VxeUI;
24802
24947
  const grid_methods = {};
24803
- const propKeys = Object.keys(src_props);
24948
+ const propKeys = Object.keys(props);
24804
24949
  function renderDefaultForm(h, $xeGrid) {
24805
24950
  const VxeUIFormComponent = core_.VxeUI.getComponent('VxeForm');
24806
24951
  const props = $xeGrid;
@@ -25157,7 +25302,7 @@ Object.keys(table.methods).forEach(name => {
25157
25302
  name: 'VxeGrid',
25158
25303
  mixins: [grid_globalMixins.sizeMixin],
25159
25304
  props: {
25160
- ...src_props,
25305
+ ...props,
25161
25306
  layouts: Array,
25162
25307
  columns: Array,
25163
25308
  pagerConfig: [Boolean, Object],
@@ -27422,8 +27567,8 @@ const Toolbar = VxeToolbar;
27422
27567
  notExp: '该浏览器不支持导入/导出功能',
27423
27568
  impFields: '导入失败,请检查字段名和数据格式是否正确',
27424
27569
  treeNotImp: '树表格不支持导入',
27425
- treeCrossDrag: '只能拖拽第一层级的数据',
27426
- treeDragChild: '父级数据不能拖拽到自己的子级中',
27570
+ treeCrossDrag: '只能拖拽第一层级',
27571
+ treeDragChild: '父级不能拖拽到自己的子级中',
27427
27572
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
27428
27573
  },
27429
27574
  table: {