vxe-table 3.9.0-rc.9 → 3.9.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 (222) hide show
  1. package/README.md +1 -1
  2. package/es/grid/src/grid.js +120 -66
  3. package/es/grid/style.css +0 -1
  4. package/es/grid/style.min.css +1 -1
  5. package/es/index.esm.js +22 -3
  6. package/es/locale/lang/en-US.js +2 -1
  7. package/es/locale/lang/es-ES.js +2 -1
  8. package/es/locale/lang/hu-HU.js +2 -1
  9. package/es/locale/lang/ja-JP.js +2 -1
  10. package/es/locale/lang/ko-KR.js +2 -1
  11. package/es/locale/lang/pt-BR.js +2 -1
  12. package/es/locale/lang/ru-RU.js +2 -1
  13. package/es/locale/lang/uk-UA.js +2 -1
  14. package/es/locale/lang/vi-VN.js +2 -1
  15. package/es/locale/lang/zh-CHT.js +2 -1
  16. package/es/locale/lang/zh-CN.js +2 -1
  17. package/es/style.css +1 -1
  18. package/es/style.min.css +1 -1
  19. package/es/table/module/custom/panel.js +183 -173
  20. package/es/table/module/edit/mixin.js +33 -24
  21. package/es/table/module/export/export-panel.js +32 -4
  22. package/es/table/module/export/import-panel.js +25 -6
  23. package/es/table/module/export/mixin.js +11 -11
  24. package/es/table/module/menu/mixin.js +2 -2
  25. package/es/table/module/validator/mixin.js +4 -4
  26. package/es/table/render/index.js +17 -11
  27. package/es/table/src/body.js +1 -0
  28. package/es/table/src/columnInfo.js +3 -3
  29. package/es/table/src/methods.js +54 -42
  30. package/es/table/src/props.js +65 -15
  31. package/es/table/src/table.js +91 -57
  32. package/es/table/src/util.js +3 -2
  33. package/es/table/style.css +37 -48
  34. package/es/table/style.min.css +1 -1
  35. package/es/toolbar/src/toolbar.js +21 -7
  36. package/es/toolbar/style.css +0 -1
  37. package/es/toolbar/style.min.css +1 -1
  38. package/es/ui/index.js +5 -3
  39. package/es/ui/src/log.js +1 -1
  40. package/es/vxe-grid/style.css +0 -1
  41. package/es/vxe-grid/style.min.css +1 -1
  42. package/es/vxe-table/style.css +37 -48
  43. package/es/vxe-table/style.min.css +1 -1
  44. package/es/vxe-toolbar/style.css +0 -1
  45. package/es/vxe-toolbar/style.min.css +1 -1
  46. package/lib/colgroup/index.js +3 -3
  47. package/lib/colgroup/index.min.js +1 -1
  48. package/lib/column/index.js +3 -3
  49. package/lib/column/index.min.js +1 -1
  50. package/lib/components.js +9 -11
  51. package/lib/components.min.js +1 -1
  52. package/lib/grid/index.js +3 -3
  53. package/lib/grid/index.min.js +1 -1
  54. package/lib/grid/src/grid.js +581 -491
  55. package/lib/grid/src/grid.min.js +1 -1
  56. package/lib/grid/style/style.css +0 -1
  57. package/lib/grid/style/style.min.css +1 -1
  58. package/lib/index.common.js +3 -4
  59. package/lib/index.umd.js +9174 -17260
  60. package/lib/index.umd.min.js +1 -1
  61. package/lib/locale/lang/en-US.js +2 -1
  62. package/lib/locale/lang/en-US.min.js +1 -1
  63. package/lib/locale/lang/en-US.umd.js +2 -1
  64. package/lib/locale/lang/es-ES.js +2 -1
  65. package/lib/locale/lang/es-ES.min.js +1 -1
  66. package/lib/locale/lang/es-ES.umd.js +2 -1
  67. package/lib/locale/lang/hu-HU.js +2 -1
  68. package/lib/locale/lang/hu-HU.min.js +1 -1
  69. package/lib/locale/lang/hu-HU.umd.js +2 -1
  70. package/lib/locale/lang/ja-JP.js +2 -1
  71. package/lib/locale/lang/ja-JP.min.js +1 -1
  72. package/lib/locale/lang/ja-JP.umd.js +2 -1
  73. package/lib/locale/lang/ko-KR.js +2 -1
  74. package/lib/locale/lang/ko-KR.min.js +1 -1
  75. package/lib/locale/lang/ko-KR.umd.js +2 -1
  76. package/lib/locale/lang/pt-BR.js +2 -1
  77. package/lib/locale/lang/pt-BR.min.js +1 -1
  78. package/lib/locale/lang/pt-BR.umd.js +2 -1
  79. package/lib/locale/lang/ru-RU.js +2 -1
  80. package/lib/locale/lang/ru-RU.min.js +1 -1
  81. package/lib/locale/lang/ru-RU.umd.js +2 -1
  82. package/lib/locale/lang/uk-UA.js +2 -1
  83. package/lib/locale/lang/uk-UA.min.js +1 -1
  84. package/lib/locale/lang/uk-UA.umd.js +2 -1
  85. package/lib/locale/lang/vi-VN.js +2 -1
  86. package/lib/locale/lang/vi-VN.min.js +1 -1
  87. package/lib/locale/lang/zh-CHT.js +2 -1
  88. package/lib/locale/lang/zh-CHT.min.js +1 -1
  89. package/lib/locale/lang/zh-CHT.umd.js +2 -1
  90. package/lib/locale/lang/zh-CN.js +2 -1
  91. package/lib/locale/lang/zh-CN.min.js +1 -1
  92. package/lib/locale/lang/zh-CN.umd.js +2 -1
  93. package/lib/style.css +1 -1
  94. package/lib/style.min.css +1 -1
  95. package/lib/table/index.js +4 -4
  96. package/lib/table/index.min.js +1 -1
  97. package/lib/table/module/custom/mixin.js +53 -44
  98. package/lib/table/module/custom/mixin.min.js +1 -1
  99. package/lib/table/module/custom/panel.js +310 -239
  100. package/lib/table/module/custom/panel.min.js +1 -1
  101. package/lib/table/module/edit/mixin.js +436 -371
  102. package/lib/table/module/edit/mixin.min.js +1 -1
  103. package/lib/table/module/export/export-panel.js +136 -106
  104. package/lib/table/module/export/export-panel.min.js +1 -1
  105. package/lib/table/module/export/import-panel.js +75 -54
  106. package/lib/table/module/export/import-panel.min.js +1 -1
  107. package/lib/table/module/export/mixin.js +592 -597
  108. package/lib/table/module/export/mixin.min.js +1 -1
  109. package/lib/table/module/export/util.js +6 -4
  110. package/lib/table/module/export/util.min.js +1 -1
  111. package/lib/table/module/filter/mixin.js +147 -118
  112. package/lib/table/module/filter/mixin.min.js +1 -1
  113. package/lib/table/module/filter/panel.js +86 -65
  114. package/lib/table/module/filter/panel.min.js +1 -1
  115. package/lib/table/module/keyboard/mixin.js +163 -151
  116. package/lib/table/module/keyboard/mixin.min.js +1 -1
  117. package/lib/table/module/menu/mixin.js +125 -114
  118. package/lib/table/module/menu/mixin.min.js +1 -1
  119. package/lib/table/module/menu/panel.js +36 -34
  120. package/lib/table/module/menu/panel.min.js +1 -1
  121. package/lib/table/module/validator/mixin.js +225 -214
  122. package/lib/table/module/validator/mixin.min.js +1 -1
  123. package/lib/table/render/index.js +401 -297
  124. package/lib/table/render/index.min.js +1 -1
  125. package/lib/table/src/body.js +411 -349
  126. package/lib/table/src/body.min.js +1 -1
  127. package/lib/table/src/cell.js +470 -344
  128. package/lib/table/src/cell.min.js +1 -1
  129. package/lib/table/src/column.js +10 -10
  130. package/lib/table/src/column.min.js +1 -1
  131. package/lib/table/src/columnInfo.js +46 -55
  132. package/lib/table/src/columnInfo.min.js +1 -1
  133. package/lib/table/src/footer.js +157 -132
  134. package/lib/table/src/footer.min.js +1 -1
  135. package/lib/table/src/group.js +1 -1
  136. package/lib/table/src/group.min.js +1 -1
  137. package/lib/table/src/header.js +170 -153
  138. package/lib/table/src/header.min.js +1 -1
  139. package/lib/table/src/methods.js +2758 -2478
  140. package/lib/table/src/methods.min.js +1 -1
  141. package/lib/table/src/props.js +33 -74
  142. package/lib/table/src/props.min.js +1 -1
  143. package/lib/table/src/table.js +465 -424
  144. package/lib/table/src/table.min.js +1 -1
  145. package/lib/table/src/util.js +143 -131
  146. package/lib/table/src/util.min.js +1 -1
  147. package/lib/table/style/style.css +37 -48
  148. package/lib/table/style/style.min.css +1 -1
  149. package/lib/toolbar/index.js +3 -3
  150. package/lib/toolbar/index.min.js +1 -1
  151. package/lib/toolbar/src/toolbar.js +332 -284
  152. package/lib/toolbar/src/toolbar.min.js +1 -1
  153. package/lib/toolbar/style/style.css +0 -1
  154. package/lib/toolbar/style/style.min.css +1 -1
  155. package/lib/ui/index.js +50 -41
  156. package/lib/ui/index.min.js +1 -1
  157. package/lib/ui/src/comp.js +2 -3
  158. package/lib/ui/src/comp.min.js +1 -1
  159. package/lib/ui/src/dom.js +29 -28
  160. package/lib/ui/src/dom.min.js +1 -1
  161. package/lib/ui/src/log.js +6 -4
  162. package/lib/ui/src/log.min.js +1 -1
  163. package/lib/ui/src/utils.js +7 -7
  164. package/lib/v-x-e-table/index.js +3 -4
  165. package/lib/v-x-e-table/index.min.js +1 -1
  166. package/lib/vxe-colgroup/index.js +3 -4
  167. package/lib/vxe-colgroup/index.min.js +1 -1
  168. package/lib/vxe-column/index.js +3 -4
  169. package/lib/vxe-column/index.min.js +1 -1
  170. package/lib/vxe-grid/index.js +3 -4
  171. package/lib/vxe-grid/index.min.js +1 -1
  172. package/lib/vxe-grid/style/style.css +0 -1
  173. package/lib/vxe-grid/style/style.min.css +1 -1
  174. package/lib/vxe-table/index.js +3 -4
  175. package/lib/vxe-table/index.min.js +1 -1
  176. package/lib/vxe-table/style/style.css +37 -48
  177. package/lib/vxe-table/style/style.min.css +1 -1
  178. package/lib/vxe-toolbar/index.js +3 -4
  179. package/lib/vxe-toolbar/index.min.js +1 -1
  180. package/lib/vxe-toolbar/style/style.css +0 -1
  181. package/lib/vxe-toolbar/style/style.min.css +1 -1
  182. package/lib/vxe-ui/index.js +3 -4
  183. package/lib/vxe-ui/index.min.js +1 -1
  184. package/lib/vxe-v-x-e-table/index.js +3 -4
  185. package/lib/vxe-v-x-e-table/index.min.js +1 -1
  186. package/package.json +5 -4
  187. package/packages/grid/src/grid.ts +127 -65
  188. package/packages/locale/lang/en-US.ts +2 -1
  189. package/packages/locale/lang/es-ES.ts +2 -1
  190. package/packages/locale/lang/hu-HU.ts +2 -1
  191. package/packages/locale/lang/ja-JP.ts +2 -1
  192. package/packages/locale/lang/ko-KR.ts +2 -1
  193. package/packages/locale/lang/pt-BR.ts +2 -1
  194. package/packages/locale/lang/ru-RU.ts +2 -1
  195. package/packages/locale/lang/uk-UA.ts +2 -1
  196. package/packages/locale/lang/vi-VN.ts +2 -1
  197. package/packages/locale/lang/zh-CHT.ts +2 -1
  198. package/packages/locale/lang/zh-CN.ts +2 -1
  199. package/packages/table/module/custom/panel.ts +186 -175
  200. package/packages/table/module/edit/mixin.ts +32 -23
  201. package/packages/table/module/export/export-panel.ts +36 -4
  202. package/packages/table/module/export/import-panel.ts +29 -6
  203. package/packages/table/module/export/mixin.ts +11 -11
  204. package/packages/table/module/menu/mixin.ts +2 -2
  205. package/packages/table/module/validator/mixin.ts +4 -4
  206. package/packages/table/render/index.ts +20 -11
  207. package/packages/table/src/body.ts +1 -0
  208. package/packages/table/src/columnInfo.ts +3 -3
  209. package/packages/table/src/methods.ts +53 -42
  210. package/packages/table/src/props.ts +68 -15
  211. package/packages/table/src/table.ts +99 -54
  212. package/packages/table/src/util.ts +3 -2
  213. package/packages/toolbar/src/toolbar.ts +21 -7
  214. package/packages/ui/index.ts +3 -1
  215. package/styles/components/table.scss +82 -17
  216. package/types/all.d.ts +1 -0
  217. /package/es/{iconfont.1726453742001.ttf → iconfont.1728348263835.ttf} +0 -0
  218. /package/es/{iconfont.1726453742001.woff → iconfont.1728348263835.woff} +0 -0
  219. /package/es/{iconfont.1726453742001.woff2 → iconfont.1728348263835.woff2} +0 -0
  220. /package/lib/{iconfont.1726453742001.ttf → iconfont.1728348263835.ttf} +0 -0
  221. /package/lib/{iconfont.1726453742001.woff → iconfont.1728348263835.woff} +0 -0
  222. /package/lib/{iconfont.1726453742001.woff2 → iconfont.1728348263835.woff2} +0 -0
@@ -10,66 +10,79 @@ var _dom = require("../../../ui/src/dom");
10
10
  var _log = require("../../../ui/src/log");
11
11
  var _xeUtils = _interopRequireDefault(require("xe-utils"));
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- var getI18n = _ui.VxeUI.getI18n,
14
- getIcon = _ui.VxeUI.getIcon;
13
+ const {
14
+ getI18n,
15
+ getIcon,
16
+ renderEmptyElement
17
+ } = _ui.VxeUI;
15
18
  function updateDropHint(_vm, evnt) {
16
- var $refs = _vm.$refs;
17
- var dragHintEl = $refs.dragHintElemRef;
18
- var bodyEl = $refs.bodyElemRef;
19
+ const {
20
+ $refs
21
+ } = _vm;
22
+ const dragHintEl = $refs.dragHintElemRef;
23
+ const bodyEl = $refs.bodyElemRef;
19
24
  if (!bodyEl) {
20
25
  return;
21
26
  }
22
27
  if (dragHintEl) {
23
- var wrapperEl = bodyEl.parentNode;
24
- var wrapperRect = wrapperEl.getBoundingClientRect();
28
+ const wrapperEl = bodyEl.parentNode;
29
+ const wrapperRect = wrapperEl.getBoundingClientRect();
25
30
  dragHintEl.style.display = 'block';
26
- dragHintEl.style.top = "".concat(Math.min(wrapperEl.clientHeight - wrapperEl.scrollTop - dragHintEl.clientHeight, evnt.clientY - wrapperRect.y), "px");
27
- dragHintEl.style.left = "".concat(Math.min(wrapperEl.clientWidth - wrapperEl.scrollLeft - dragHintEl.clientWidth - 16, evnt.clientX - wrapperRect.x), "px");
31
+ dragHintEl.style.top = `${Math.min(wrapperEl.clientHeight - wrapperEl.scrollTop - dragHintEl.clientHeight, evnt.clientY - wrapperRect.y)}px`;
32
+ dragHintEl.style.left = `${Math.min(wrapperEl.clientWidth - wrapperEl.scrollLeft - dragHintEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`;
28
33
  }
29
34
  }
30
- var renderSimplePanel = function renderSimplePanel(h, _vm) {
31
- var VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
32
- var _e = _vm._e,
33
- $xetable = _vm.$xetable,
34
- customStore = _vm.customStore,
35
- dragColumn = _vm.dragColumn;
36
- var customColumnList = $xetable.customColumnList,
37
- customOpts = $xetable.customOpts,
38
- isMaxFixedColumn = $xetable.isMaxFixedColumn;
39
- var maxHeight = customStore.maxHeight;
40
- var checkMethod = customOpts.checkMethod,
41
- visibleMethod = customOpts.visibleMethod,
42
- allowVisible = customOpts.allowVisible,
43
- allowSort = customOpts.allowSort,
44
- allowFixed = customOpts.allowFixed,
45
- trigger = customOpts.trigger,
46
- placement = customOpts.placement;
47
- var colVNs = [];
48
- var customWrapperOns = {};
35
+ const renderSimplePanel = (h, _vm) => {
36
+ const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
37
+ const {
38
+ _e,
39
+ $xetable,
40
+ customStore,
41
+ dragColumn
42
+ } = _vm;
43
+ const {
44
+ customColumnList,
45
+ customOpts,
46
+ isMaxFixedColumn
47
+ } = $xetable;
48
+ const {
49
+ maxHeight
50
+ } = customStore;
51
+ const {
52
+ checkMethod,
53
+ visibleMethod,
54
+ allowVisible,
55
+ allowSort,
56
+ allowFixed,
57
+ trigger,
58
+ placement
59
+ } = customOpts;
60
+ const colVNs = [];
61
+ const customWrapperOns = {};
49
62
  // hover 触发
50
63
  if (trigger === 'hover') {
51
64
  customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
52
65
  customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent;
53
66
  }
54
- _xeUtils.default.eachTree(customColumnList, function (column, index, items, path, parent) {
55
- var isVisible = visibleMethod ? visibleMethod({
56
- column: column
67
+ _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
68
+ const isVisible = visibleMethod ? visibleMethod({
69
+ column
57
70
  }) : true;
58
71
  if (isVisible) {
59
- var isChecked = column.renderVisible;
60
- var isIndeterminate = column.halfVisible;
61
- var isColGroup = column.children && column.children.length;
62
- var colTitle = (0, _utils.formatText)(column.getTitle(), 1);
63
- var isDisabled = checkMethod ? !checkMethod({
64
- column: column
72
+ const isChecked = column.renderVisible;
73
+ const isIndeterminate = column.halfVisible;
74
+ const isColGroup = column.children && column.children.length;
75
+ const colTitle = (0, _utils.formatText)(column.getTitle(), 1);
76
+ const isDisabled = checkMethod ? !checkMethod({
77
+ column
65
78
  }) : false;
66
- var isHidden = !isChecked;
79
+ const isHidden = !isChecked;
67
80
  colVNs.push(h('li', {
68
81
  key: column.id,
69
82
  attrs: {
70
83
  colid: column.id
71
84
  },
72
- class: ['vxe-table-custom--option', "level--".concat(column.level), {
85
+ class: ['vxe-table-custom--option', `level--${column.level}`, {
73
86
  'is--hidden': isHidden,
74
87
  'is--group': isColGroup
75
88
  }],
@@ -88,7 +101,7 @@ var renderSimplePanel = function renderSimplePanel(h, _vm) {
88
101
  title: getI18n('vxe.custom.setting.colVisible')
89
102
  },
90
103
  on: {
91
- click: function click() {
104
+ click: () => {
92
105
  if (!isDisabled) {
93
106
  _vm.changeCheckboxOption(column);
94
107
  }
@@ -134,7 +147,7 @@ var renderSimplePanel = function renderSimplePanel(h, _vm) {
134
147
  title: getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
135
148
  },
136
149
  on: {
137
- click: function click() {
150
+ click: () => {
138
151
  _vm.changeFixedOption(column, 'left');
139
152
  }
140
153
  }
@@ -147,22 +160,22 @@ var renderSimplePanel = function renderSimplePanel(h, _vm) {
147
160
  title: getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
148
161
  },
149
162
  on: {
150
- click: function click() {
163
+ click: () => {
151
164
  _vm.changeFixedOption(column, 'right');
152
165
  }
153
166
  }
154
167
  })]) : _e()]));
155
168
  }
156
169
  });
157
- var isAllChecked = customStore.isAll;
158
- var isAllIndeterminate = customStore.isIndeterminate;
170
+ const isAllChecked = customStore.isAll;
171
+ const isAllIndeterminate = customStore.isIndeterminate;
159
172
  return h('div', {
160
173
  key: 'simple',
161
- class: ['vxe-table-custom-wrapper', "placement--".concat(placement), {
174
+ class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
162
175
  'is--active': customStore.visible
163
176
  }],
164
177
  style: maxHeight && !['left', 'right'].includes(placement) ? {
165
- maxHeight: "".concat(maxHeight, "px")
178
+ maxHeight: `${maxHeight}px`
166
179
  } : {}
167
180
  }, customStore.visible ? [h('ul', {
168
181
  class: 'vxe-table-custom--header'
@@ -235,44 +248,56 @@ var renderSimplePanel = function renderSimplePanel(h, _vm) {
235
248
  }
236
249
  })]) : null] : []);
237
250
  };
238
- var renderPopupPanel = function renderPopupPanel(h, _vm) {
239
- var VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
240
- var _e = _vm._e,
241
- $xetable = _vm.$xetable,
242
- customStore = _vm.customStore;
243
- var customOpts = $xetable.customOpts,
244
- customColumnList = $xetable.customColumnList,
245
- columnOpts = $xetable.columnOpts,
246
- isMaxFixedColumn = $xetable.isMaxFixedColumn;
247
- var modalOptions = customOpts.modalOptions,
248
- allowVisible = customOpts.allowVisible,
249
- allowSort = customOpts.allowSort,
250
- allowFixed = customOpts.allowFixed,
251
- allowResizable = customOpts.allowResizable,
252
- checkMethod = customOpts.checkMethod,
253
- visibleMethod = customOpts.visibleMethod;
254
- var maxFixedSize = columnOpts.maxFixedSize;
255
- var modalOpts = Object.assign({}, modalOptions);
256
- var trVNs = [];
257
- _xeUtils.default.eachTree(customColumnList, function (column, index, items, path, parent) {
258
- var isVisible = visibleMethod ? visibleMethod({
259
- column: column
251
+ const renderPopupPanel = (h, _vm) => {
252
+ const VxeUIModalComponent = _ui.VxeUI.getComponent('VxeModal');
253
+ const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
254
+ const VxeUIInputComponent = _ui.VxeUI.getComponent('VxeInput');
255
+ const VxeUITooltipComponent = _ui.VxeUI.getComponent('VxeTooltip');
256
+ const $xeTableCustomPanel = _vm;
257
+ const {
258
+ _e,
259
+ $xetable,
260
+ customStore
261
+ } = _vm;
262
+ const {
263
+ customOpts,
264
+ customColumnList,
265
+ columnOpts,
266
+ isMaxFixedColumn
267
+ } = $xetable;
268
+ const {
269
+ modalOptions,
270
+ allowVisible,
271
+ allowSort,
272
+ allowFixed,
273
+ allowResizable,
274
+ checkMethod,
275
+ visibleMethod
276
+ } = customOpts;
277
+ const {
278
+ maxFixedSize
279
+ } = columnOpts;
280
+ const modalOpts = Object.assign({}, modalOptions);
281
+ const trVNs = [];
282
+ _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
283
+ const isVisible = visibleMethod ? visibleMethod({
284
+ column
260
285
  }) : true;
261
286
  if (isVisible) {
262
- var isChecked = column.renderVisible;
263
- var isIndeterminate = column.halfVisible;
264
- var colTitle = (0, _utils.formatText)(column.getTitle(), 1);
265
- var isColGroup = column.children && column.children.length;
266
- var isDisabled = checkMethod ? !checkMethod({
267
- column: column
287
+ const isChecked = column.renderVisible;
288
+ const isIndeterminate = column.halfVisible;
289
+ const colTitle = (0, _utils.formatText)(column.getTitle(), 1);
290
+ const isColGroup = column.children && column.children.length;
291
+ const isDisabled = checkMethod ? !checkMethod({
292
+ column
268
293
  }) : false;
269
- var isHidden = !isChecked;
294
+ const isHidden = !isChecked;
270
295
  trVNs.push(h('tr', {
271
296
  key: column.id,
272
297
  attrs: {
273
298
  colid: column.id
274
299
  },
275
- class: ["vxe-table-custom-popup--row level--".concat(column.level), {
300
+ class: [`vxe-table-custom-popup--row level--${column.level}`, {
276
301
  'is--group': isColGroup
277
302
  }],
278
303
  on: {
@@ -292,7 +317,7 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
292
317
  title: getI18n('vxe.custom.setting.colVisible')
293
318
  },
294
319
  on: {
295
- click: function click() {
320
+ click: () => {
296
321
  if (!isDisabled) {
297
322
  _vm.changeCheckboxOption(column);
298
323
  }
@@ -331,18 +356,18 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
331
356
  }
332
357
  }, colTitle)]), allowResizable ? h('td', {
333
358
  class: 'vxe-table-custom-popup--column-item col--resizable'
334
- }, [column.children && column.children.length ? h('span', '-') : h('vxe-input', {
359
+ }, [column.children && column.children.length ? h('span', '-') : VxeUIInputComponent ? h(VxeUIInputComponent, {
335
360
  props: {
336
361
  type: 'integer',
337
362
  disabled: isHidden,
338
363
  value: column.renderResizeWidth
339
364
  },
340
365
  on: {
341
- modelValue: function modelValue(value) {
366
+ modelValue(value) {
342
367
  column.renderResizeWidth = Math.max(0, Number(value));
343
368
  }
344
369
  }
345
- })]) : _e(), allowFixed ? h('td', {
370
+ }) : renderEmptyElement($xeTableCustomPanel)]) : _e(), allowFixed ? h('td', {
346
371
  class: 'vxe-table-custom-popup--column-item col--fixed'
347
372
  }, [parent ? h('span', '-') : h('vxe-radio-group', {
348
373
  props: {
@@ -365,16 +390,16 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
365
390
  }]
366
391
  },
367
392
  on: {
368
- input: function input(value) {
393
+ input(value) {
369
394
  column.renderFixed = value;
370
395
  }
371
396
  }
372
397
  })]) : _e()]));
373
398
  }
374
399
  });
375
- var isAllChecked = customStore.isAll;
376
- var isAllIndeterminate = customStore.isIndeterminate;
377
- return h('vxe-modal', {
400
+ const isAllChecked = customStore.isAll;
401
+ const isAllIndeterminate = customStore.isIndeterminate;
402
+ return VxeUIModalComponent ? h(VxeUIModalComponent, {
378
403
  key: 'modal',
379
404
  props: {
380
405
  className: ['vxe-table-custom-popup-wrapper', 'vxe-table--ignore-clear', modalOpts.className || ''].join(' '),
@@ -393,12 +418,12 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
393
418
  showFooter: true
394
419
  },
395
420
  on: {
396
- input: function input(value) {
421
+ input(value) {
397
422
  customStore.visible = value;
398
423
  }
399
424
  },
400
425
  scopedSlots: {
401
- default: function _default() {
426
+ default: () => {
402
427
  return h('div', {
403
428
  ref: 'bodyElemRef',
404
429
  class: 'vxe-table-custom-popup--body'
@@ -441,20 +466,20 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
441
466
  class: 'vxe-checkbox--label'
442
467
  }, getI18n('vxe.toolbar.customAll'))])]) : _e(), allowSort ? h('th', {}, [h('span', {
443
468
  class: 'vxe-table-custom-popup--table-sort-help-title'
444
- }, getI18n('vxe.custom.setting.colSort')), h('vxe-tooltip', {
469
+ }, getI18n('vxe.custom.setting.colSort')), VxeUITooltipComponent ? h(VxeUITooltipComponent, {
445
470
  props: {
446
471
  enterable: true,
447
472
  content: getI18n('vxe.custom.setting.sortHelpTip'),
448
473
  popupClassName: 'vxe-table--ignore-clear'
449
474
  },
450
475
  scopedSlots: {
451
- default: function _default() {
476
+ default: () => {
452
477
  return h('i', {
453
478
  class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
454
479
  });
455
480
  }
456
481
  }
457
- })]) : _e(), h('th', {}, getI18n('vxe.custom.setting.colTitle')), allowResizable ? h('th', {}, getI18n('vxe.custom.setting.colResizable')) : _e(), allowFixed ? h('th', {}, getI18n("vxe.custom.setting.".concat(maxFixedSize ? 'colFixedMax' : 'colFixed'), [maxFixedSize])) : _e()])]), h('transition-group', {
482
+ }) : renderEmptyElement($xeTableCustomPanel)]) : _e(), h('th', {}, getI18n('vxe.custom.setting.colTitle')), allowResizable ? h('th', {}, getI18n('vxe.custom.setting.colResizable')) : _e(), allowFixed ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : _e()])]), h('transition-group', {
458
483
  class: 'vxe-table-custom--body',
459
484
  props: {
460
485
  tag: 'tbody',
@@ -465,7 +490,7 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
465
490
  class: 'vxe-table-custom-popup--drag-hint'
466
491
  }, getI18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))]);
467
492
  },
468
- footer: function footer() {
493
+ footer: () => {
469
494
  return h('div', {
470
495
  class: 'vxe-table-custom-popup--footer'
471
496
  }, [h(VxeUIButtonComponent, {
@@ -493,16 +518,14 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
493
518
  })]);
494
519
  }
495
520
  }
496
- });
521
+ }) : renderEmptyElement($xeTableCustomPanel);
497
522
  };
498
- var _default2 = exports.default = {
523
+ var _default = exports.default = {
499
524
  name: 'VxeTableCustomPanel',
500
525
  props: {
501
526
  customStore: {
502
527
  type: Object,
503
- default: function _default() {
504
- return {};
505
- }
528
+ default: () => ({})
506
529
  }
507
530
  },
508
531
  inject: {
@@ -510,25 +533,30 @@ var _default2 = exports.default = {
510
533
  default: null
511
534
  }
512
535
  },
513
- data: function data() {
536
+ data() {
514
537
  return {
515
538
  dragColumn: null
516
539
  };
517
540
  },
518
541
  computed: {},
519
- created: function created() {
520
- var _this = this;
542
+ created() {
521
543
  if (process.env.NODE_ENV === 'development') {
522
- var VxeUIModalComponent = _ui.VxeUI.getComponent('VxeModal');
523
- var VxeUIDrawerComponent = _ui.VxeUI.getComponent('VxeDrawer');
524
- var VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
525
- var VxeUIInputComponent = _ui.VxeUI.getComponent('VxeInput');
526
- var VxeUITooltipComponent = _ui.VxeUI.getComponent('VxeTooltip');
527
- var VxeUIRadioGroupComponent = _ui.VxeUI.getComponent('VxeRadioGroup');
528
- this.$nextTick(function () {
529
- var $xetable = _this.$xetable;
530
- var customOpts = $xetable.customOpts;
531
- var mode = customOpts.mode;
544
+ const VxeUIModalComponent = _ui.VxeUI.getComponent('VxeModal');
545
+ const VxeUIDrawerComponent = _ui.VxeUI.getComponent('VxeDrawer');
546
+ const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
547
+ const VxeUIInputComponent = _ui.VxeUI.getComponent('VxeInput');
548
+ const VxeUITooltipComponent = _ui.VxeUI.getComponent('VxeTooltip');
549
+ const VxeUIRadioGroupComponent = _ui.VxeUI.getComponent('VxeRadioGroup');
550
+ this.$nextTick(() => {
551
+ const {
552
+ $xetable
553
+ } = this;
554
+ const {
555
+ customOpts
556
+ } = $xetable;
557
+ const {
558
+ mode
559
+ } = customOpts;
532
560
  if (!VxeUIModalComponent) {
533
561
  (0, _log.errLog)('vxe.error.reqComp', ['vxe-modal']);
534
562
  }
@@ -550,49 +578,63 @@ var _default2 = exports.default = {
550
578
  });
551
579
  }
552
580
  },
553
- render: function render(h) {
554
- var $xetable = this.$xetable;
555
- var customOpts = $xetable.customOpts;
556
- if (['modal', 'popup'].includes("".concat(customOpts.mode))) {
581
+ render(h) {
582
+ const {
583
+ $xetable
584
+ } = this;
585
+ const {
586
+ customOpts
587
+ } = $xetable;
588
+ if (['modal', 'popup'].includes(`${customOpts.mode}`)) {
557
589
  return renderPopupPanel(h, this);
558
590
  }
559
591
  return renderSimplePanel(h, this);
560
592
  },
561
593
  methods: {
562
- handleWrapperMouseenterEvent: function handleWrapperMouseenterEvent(evnt) {
563
- var $xetable = this.$xetable,
564
- customStore = this.customStore;
594
+ handleWrapperMouseenterEvent(evnt) {
595
+ const {
596
+ $xetable,
597
+ customStore
598
+ } = this;
565
599
  customStore.activeWrapper = true;
566
600
  $xetable.customOpenEvent(evnt);
567
601
  },
568
- handleWrapperMouseleaveEvent: function handleWrapperMouseleaveEvent(evnt) {
569
- var $xetable = this.$xetable,
570
- customStore = this.customStore;
602
+ handleWrapperMouseleaveEvent(evnt) {
603
+ const {
604
+ $xetable,
605
+ customStore
606
+ } = this;
571
607
  customStore.activeWrapper = false;
572
- setTimeout(function () {
608
+ setTimeout(() => {
573
609
  if (!customStore.activeBtn && !customStore.activeWrapper) {
574
610
  $xetable.customColseEvent(evnt);
575
611
  }
576
612
  }, 300);
577
613
  },
578
- getStoreData: function getStoreData() {
614
+ getStoreData() {
579
615
  return {};
580
616
  },
581
- confirmCustomEvent: function confirmCustomEvent(evnt) {
582
- var $xetable = this.$xetable;
583
- var customOpts = $xetable.customOpts,
584
- customColumnList = $xetable.customColumnList;
585
- var allowVisible = customOpts.allowVisible,
586
- allowSort = customOpts.allowSort,
587
- allowFixed = customOpts.allowFixed,
588
- allowResizable = customOpts.allowResizable;
589
- _xeUtils.default.eachTree(customColumnList, function (column, index, items, path, parent) {
617
+ confirmCustomEvent(evnt) {
618
+ const {
619
+ $xetable
620
+ } = this;
621
+ const {
622
+ customOpts,
623
+ customColumnList
624
+ } = $xetable;
625
+ const {
626
+ allowVisible,
627
+ allowSort,
628
+ allowFixed,
629
+ allowResizable
630
+ } = customOpts;
631
+ _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
590
632
  if (parent) {
591
633
  // 更新子列信息
592
634
  column.fixed = parent.fixed;
593
635
  } else {
594
636
  if (allowSort) {
595
- var sortIndex = index + 1;
637
+ const sortIndex = index + 1;
596
638
  column.renderSortNumber = sortIndex;
597
639
  }
598
640
  if (allowFixed) {
@@ -615,28 +657,39 @@ var _default2 = exports.default = {
615
657
  $xetable.emitCustomEvent('confirm', evnt);
616
658
  $xetable.saveCustomStore('confirm');
617
659
  },
618
- cancelCloseEvent: function cancelCloseEvent(_ref) {
619
- var $event = _ref.$event;
620
- var $xetable = this.$xetable;
660
+ cancelCloseEvent({
661
+ $event
662
+ }) {
663
+ const {
664
+ $xetable
665
+ } = this;
621
666
  $xetable.closeCustom();
622
667
  $xetable.emitCustomEvent('cancel', $event);
623
668
  },
624
- cancelCustomEvent: function cancelCustomEvent(evnt) {
625
- var $xetable = this.$xetable;
626
- var customStore = $xetable.customStore,
627
- customOpts = $xetable.customOpts,
628
- customColumnList = $xetable.customColumnList;
629
- var oldSortMaps = customStore.oldSortMaps,
630
- oldFixedMaps = customStore.oldFixedMaps,
631
- oldVisibleMaps = customStore.oldVisibleMaps;
632
- var allowVisible = customOpts.allowVisible,
633
- allowSort = customOpts.allowSort,
634
- allowFixed = customOpts.allowFixed,
635
- allowResizable = customOpts.allowResizable;
636
- _xeUtils.default.eachTree(customColumnList, function (column) {
637
- var colid = column.getKey();
638
- var visible = !!oldVisibleMaps[colid];
639
- var fixed = oldFixedMaps[colid] || '';
669
+ cancelCustomEvent(evnt) {
670
+ const {
671
+ $xetable
672
+ } = this;
673
+ const {
674
+ customStore,
675
+ customOpts,
676
+ customColumnList
677
+ } = $xetable;
678
+ const {
679
+ oldSortMaps,
680
+ oldFixedMaps,
681
+ oldVisibleMaps
682
+ } = customStore;
683
+ const {
684
+ allowVisible,
685
+ allowSort,
686
+ allowFixed,
687
+ allowResizable
688
+ } = customOpts;
689
+ _xeUtils.default.eachTree(customColumnList, column => {
690
+ const colid = column.getKey();
691
+ const visible = !!oldVisibleMaps[colid];
692
+ const fixed = oldFixedMaps[colid] || '';
640
693
  if (allowVisible) {
641
694
  column.renderVisible = visible;
642
695
  column.visible = visible;
@@ -657,69 +710,73 @@ var _default2 = exports.default = {
657
710
  $xetable.closeCustom();
658
711
  $xetable.emitCustomEvent('cancel', evnt);
659
712
  },
660
- handleResetCustomEvent: function handleResetCustomEvent(evnt) {
661
- var $xetable = this.$xetable;
713
+ handleResetCustomEvent(evnt) {
714
+ const {
715
+ $xetable
716
+ } = this;
662
717
  $xetable.resetColumn(true);
663
718
  $xetable.closeCustom();
664
719
  $xetable.emitCustomEvent('reset', evnt);
665
720
  },
666
- resetCustomEvent: function resetCustomEvent(evnt) {
667
- var _this2 = this;
721
+ resetCustomEvent(evnt) {
668
722
  if (_ui.VxeUI.modal) {
669
723
  _ui.VxeUI.modal.confirm({
670
724
  content: getI18n('vxe.custom.cstmConfirmRestore'),
671
725
  className: 'vxe-table--ignore-clear',
672
726
  escClosable: true
673
- }).then(function (type) {
727
+ }).then(type => {
674
728
  if (type === 'confirm') {
675
- _this2.handleResetCustomEvent(evnt);
729
+ this.handleResetCustomEvent(evnt);
676
730
  }
677
731
  });
678
732
  } else {
679
733
  this.handleResetCustomEvent(evnt);
680
734
  }
681
735
  },
682
- resetPopupCustomEvent: function resetPopupCustomEvent(evnt) {
683
- var _this3 = this;
736
+ resetPopupCustomEvent(evnt) {
684
737
  if (_ui.VxeUI.modal) {
685
738
  _ui.VxeUI.modal.confirm({
686
739
  content: getI18n('vxe.custom.cstmConfirmRestore'),
687
740
  className: 'vxe-table--ignore-clear',
688
741
  escClosable: true
689
- }).then(function (type) {
742
+ }).then(type => {
690
743
  if (type === 'confirm') {
691
- _this3.resetCustomEvent(evnt);
744
+ this.resetCustomEvent(evnt);
692
745
  }
693
746
  });
694
747
  } else {
695
748
  this.resetCustomEvent(evnt);
696
749
  }
697
750
  },
698
- handleOptionCheck: function handleOptionCheck(column) {
699
- var $xetable = this.$xetable;
700
- var customColumnList = $xetable.customColumnList;
701
- var matchObj = _xeUtils.default.findTree(customColumnList, function (item) {
702
- return item === column;
703
- });
751
+ handleOptionCheck(column) {
752
+ const {
753
+ $xetable
754
+ } = this;
755
+ const {
756
+ customColumnList
757
+ } = $xetable;
758
+ const matchObj = _xeUtils.default.findTree(customColumnList, item => item === column);
704
759
  if (matchObj && matchObj.parent) {
705
- var parent = matchObj.parent;
760
+ const {
761
+ parent
762
+ } = matchObj;
706
763
  if (parent.children && parent.children.length) {
707
- parent.visible = parent.children.every(function (column) {
708
- return column.visible;
709
- });
710
- parent.halfVisible = !parent.visible && parent.children.some(function (column) {
711
- return column.visible || column.halfVisible;
712
- });
764
+ parent.visible = parent.children.every(column => column.visible);
765
+ parent.halfVisible = !parent.visible && parent.children.some(column => column.visible || column.halfVisible);
713
766
  this.handleOptionCheck(parent);
714
767
  }
715
768
  }
716
769
  },
717
- changeCheckboxOption: function changeCheckboxOption(column) {
718
- var $xetable = this.$xetable;
719
- var customOpts = $xetable.customOpts;
720
- var isChecked = !column.renderVisible;
770
+ changeCheckboxOption(column) {
771
+ const {
772
+ $xetable
773
+ } = this;
774
+ const {
775
+ customOpts
776
+ } = $xetable;
777
+ const isChecked = !column.renderVisible;
721
778
  if (customOpts.immediate) {
722
- _xeUtils.default.eachTree([column], function (item) {
779
+ _xeUtils.default.eachTree([column], item => {
723
780
  item.visible = isChecked;
724
781
  item.renderVisible = isChecked;
725
782
  item.halfVisible = false;
@@ -727,7 +784,7 @@ var _default2 = exports.default = {
727
784
  $xetable.handleCustom();
728
785
  $xetable.saveCustomStore('update:visible');
729
786
  } else {
730
- _xeUtils.default.eachTree([column], function (item) {
787
+ _xeUtils.default.eachTree([column], item => {
731
788
  item.renderVisible = isChecked;
732
789
  item.halfVisible = false;
733
790
  });
@@ -735,19 +792,23 @@ var _default2 = exports.default = {
735
792
  this.handleOptionCheck(column);
736
793
  $xetable.checkCustomStatus();
737
794
  },
738
- changeFixedOption: function changeFixedOption(column, colFixed) {
739
- var $xetable = this.$xetable;
740
- var isMaxFixedColumn = $xetable.isMaxFixedColumn,
741
- customOpts = $xetable.customOpts;
795
+ changeFixedOption(column, colFixed) {
796
+ const {
797
+ $xetable
798
+ } = this;
799
+ const {
800
+ isMaxFixedColumn,
801
+ customOpts
802
+ } = $xetable;
742
803
  if (customOpts.immediate) {
743
804
  if (column.renderFixed === colFixed) {
744
- _xeUtils.default.eachTree([column], function (col) {
805
+ _xeUtils.default.eachTree([column], col => {
745
806
  col.fixed = '';
746
807
  col.renderFixed = '';
747
808
  });
748
809
  } else {
749
810
  if (!isMaxFixedColumn || column.renderFixed) {
750
- _xeUtils.default.eachTree([column], function (col) {
811
+ _xeUtils.default.eachTree([column], col => {
751
812
  col.fixed = colFixed;
752
813
  col.renderFixed = colFixed;
753
814
  });
@@ -757,29 +818,35 @@ var _default2 = exports.default = {
757
818
  $xetable.saveCustomStore('update:fixed');
758
819
  } else {
759
820
  if (column.renderFixed === colFixed) {
760
- _xeUtils.default.eachTree([column], function (col) {
821
+ _xeUtils.default.eachTree([column], col => {
761
822
  col.renderFixed = '';
762
823
  });
763
824
  } else {
764
825
  if (!isMaxFixedColumn || column.renderFixed) {
765
- _xeUtils.default.eachTree([column], function (col) {
826
+ _xeUtils.default.eachTree([column], col => {
766
827
  col.renderFixed = colFixed;
767
828
  });
768
829
  }
769
830
  }
770
831
  }
771
832
  },
772
- allOptionEvent: function allOptionEvent() {
773
- var $xetable = this.$xetable,
774
- customStore = this.customStore;
775
- var customColumnList = $xetable.customColumnList,
776
- customOpts = $xetable.customOpts;
777
- var checkMethod = customOpts.checkMethod;
778
- var isAll = !customStore.isAll;
833
+ allOptionEvent() {
834
+ const {
835
+ $xetable,
836
+ customStore
837
+ } = this;
838
+ const {
839
+ customColumnList,
840
+ customOpts
841
+ } = $xetable;
842
+ const {
843
+ checkMethod
844
+ } = customOpts;
845
+ const isAll = !customStore.isAll;
779
846
  if (customOpts.immediate) {
780
- _xeUtils.default.eachTree(customColumnList, function (column) {
847
+ _xeUtils.default.eachTree(customColumnList, column => {
781
848
  if (!checkMethod || checkMethod({
782
- column: column
849
+ column
783
850
  })) {
784
851
  column.visible = isAll;
785
852
  column.renderVisible = isAll;
@@ -790,9 +857,9 @@ var _default2 = exports.default = {
790
857
  $xetable.handleCustom();
791
858
  $xetable.saveCustomStore('update:visible');
792
859
  } else {
793
- _xeUtils.default.eachTree(customColumnList, function (column) {
860
+ _xeUtils.default.eachTree(customColumnList, column => {
794
861
  if (!checkMethod || checkMethod({
795
- column: column
862
+ column
796
863
  })) {
797
864
  column.renderVisible = isAll;
798
865
  column.halfVisible = false;
@@ -802,22 +869,24 @@ var _default2 = exports.default = {
802
869
  }
803
870
  $xetable.checkCustomStatus();
804
871
  },
805
- sortMousedownEvent: function sortMousedownEvent(evnt) {
806
- var $xetable = this.$xetable;
807
- var btnEl = evnt.currentTarget;
808
- var tdEl = btnEl.parentNode;
809
- var trEl = tdEl.parentNode;
810
- var colid = trEl.getAttribute('colid');
811
- var column = $xetable.getColumnById(colid);
872
+ sortMousedownEvent(evnt) {
873
+ const {
874
+ $xetable
875
+ } = this;
876
+ const btnEl = evnt.currentTarget;
877
+ const tdEl = btnEl.parentNode;
878
+ const trEl = tdEl.parentNode;
879
+ const colid = trEl.getAttribute('colid');
880
+ const column = $xetable.getColumnById(colid);
812
881
  trEl.draggable = true;
813
882
  this.dragColumn = column;
814
883
  (0, _dom.addClass)(trEl, 'active--drag-origin');
815
884
  },
816
- sortMouseupEvent: function sortMouseupEvent(evnt) {
817
- var btnEl = evnt.currentTarget;
818
- var tdEl = btnEl.parentNode;
819
- var trEl = tdEl.parentNode;
820
- var dragHintEl = this.$refs.dragHintElemRef;
885
+ sortMouseupEvent(evnt) {
886
+ const btnEl = evnt.currentTarget;
887
+ const tdEl = btnEl.parentNode;
888
+ const trEl = tdEl.parentNode;
889
+ const dragHintEl = this.$refs.dragHintElemRef;
821
890
  trEl.draggable = false;
822
891
  this.dragColumn = null;
823
892
  (0, _dom.removeClass)(trEl, 'active--drag-origin');
@@ -825,41 +894,41 @@ var _default2 = exports.default = {
825
894
  dragHintEl.style.display = '';
826
895
  }
827
896
  },
828
- sortDragstartEvent: function sortDragstartEvent(evnt) {
829
- var img = new Image();
897
+ sortDragstartEvent(evnt) {
898
+ const img = new Image();
830
899
  if (evnt.dataTransfer) {
831
900
  evnt.dataTransfer.setDragImage(img, 0, 0);
832
901
  }
833
902
  },
834
- sortDragendEvent: function sortDragendEvent(evnt) {
835
- var $xetable = this.$xetable,
836
- prevDropTrEl = this.prevDropTrEl;
837
- var customColumnList = $xetable.customColumnList,
838
- customOpts = $xetable.customOpts;
839
- var trEl = evnt.currentTarget;
840
- var dragHintEl = this.$refs.dragHintElemRef;
903
+ sortDragendEvent(evnt) {
904
+ const {
905
+ $xetable,
906
+ prevDropTrEl
907
+ } = this;
908
+ const {
909
+ customColumnList,
910
+ customOpts
911
+ } = $xetable;
912
+ const trEl = evnt.currentTarget;
913
+ const dragHintEl = this.$refs.dragHintElemRef;
841
914
  if (prevDropTrEl) {
842
915
  // 判断是否有拖动
843
916
  if (prevDropTrEl !== trEl) {
844
- var dragOffset = prevDropTrEl.getAttribute('drag-pos');
845
- var colid = trEl.getAttribute('colid');
846
- var column = $xetable.getColumnById(colid);
917
+ const dragOffset = prevDropTrEl.getAttribute('drag-pos');
918
+ const colid = trEl.getAttribute('colid');
919
+ const column = $xetable.getColumnById(colid);
847
920
  if (!column) {
848
921
  return;
849
922
  }
850
- var cIndex = _xeUtils.default.findIndexOf(customColumnList, function (item) {
851
- return item.id === column.id;
852
- });
853
- var targetColid = prevDropTrEl.getAttribute('colid');
854
- var targetColumn = $xetable.getColumnById(targetColid);
923
+ const cIndex = _xeUtils.default.findIndexOf(customColumnList, item => item.id === column.id);
924
+ const targetColid = prevDropTrEl.getAttribute('colid');
925
+ const targetColumn = $xetable.getColumnById(targetColid);
855
926
  if (!targetColumn) {
856
927
  return;
857
928
  }
858
929
  // 移出源位置
859
930
  customColumnList.splice(cIndex, 1);
860
- var tcIndex = _xeUtils.default.findIndexOf(customColumnList, function (item) {
861
- return item.id === targetColumn.id;
862
- });
931
+ const tcIndex = _xeUtils.default.findIndexOf(customColumnList, item => item.id === targetColumn.id);
863
932
  // 插新位置
864
933
  customColumnList.splice(tcIndex + (dragOffset === 'bottom' ? 1 : 0), 0, column);
865
934
  }
@@ -876,9 +945,9 @@ var _default2 = exports.default = {
876
945
  (0, _dom.removeClass)(trEl, 'active--drag-target');
877
946
  (0, _dom.removeClass)(trEl, 'active--drag-origin');
878
947
  if (customOpts.immediate) {
879
- _xeUtils.default.eachTree(customColumnList, function (column, index, items, path, parent) {
948
+ _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
880
949
  if (!parent) {
881
- var sortIndex = index + 1;
950
+ const sortIndex = index + 1;
882
951
  column.renderSortNumber = sortIndex;
883
952
  }
884
953
  });
@@ -886,20 +955,22 @@ var _default2 = exports.default = {
886
955
  $xetable.saveCustomStore('update:sort');
887
956
  }
888
957
  },
889
- sortDragoverEvent: function sortDragoverEvent(evnt) {
890
- var $xetable = this.$xetable,
891
- prevDropTrEl = this.prevDropTrEl;
892
- var trEl = evnt.currentTarget;
958
+ sortDragoverEvent(evnt) {
959
+ const {
960
+ $xetable,
961
+ prevDropTrEl
962
+ } = this;
963
+ const trEl = evnt.currentTarget;
893
964
  if (prevDropTrEl !== trEl) {
894
965
  (0, _dom.removeClass)(prevDropTrEl, 'active--drag-target');
895
966
  }
896
- var colid = trEl.getAttribute('colid');
897
- var column = $xetable.getColumnById(colid);
967
+ const colid = trEl.getAttribute('colid');
968
+ const column = $xetable.getColumnById(colid);
898
969
  // 是否移入有效元行
899
970
  if (column && column.level === 1) {
900
971
  evnt.preventDefault();
901
- var offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
902
- var dragOffset = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
972
+ const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
973
+ const dragOffset = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
903
974
  (0, _dom.addClass)(trEl, 'active--drag-target');
904
975
  trEl.setAttribute('drag-pos', dragOffset);
905
976
  this.prevDropTrEl = trEl;