vxe-table 3.21.21 → 3.21.23

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 (176) hide show
  1. package/es/{iconfont.1782656027274.ttf → iconfont.1783046294821.ttf} +0 -0
  2. package/es/iconfont.1783046294821.woff +0 -0
  3. package/es/iconfont.1783046294821.woff2 +0 -0
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/locale/lang/ar-EG.js +16 -3
  7. package/es/locale/lang/de-DE.js +16 -3
  8. package/es/locale/lang/en-US.js +20 -7
  9. package/es/locale/lang/es-ES.js +16 -3
  10. package/es/locale/lang/fr-FR.js +16 -3
  11. package/es/locale/lang/hu-HU.js +16 -3
  12. package/es/locale/lang/hy-AM.js +16 -3
  13. package/es/locale/lang/id-ID.js +16 -3
  14. package/es/locale/lang/it-IT.js +15 -2
  15. package/es/locale/lang/ja-JP.js +16 -3
  16. package/es/locale/lang/ko-KR.js +16 -3
  17. package/es/locale/lang/ms-MY.js +16 -3
  18. package/es/locale/lang/nb-NO.js +16 -3
  19. package/es/locale/lang/pt-BR.js +16 -3
  20. package/es/locale/lang/ru-RU.js +16 -3
  21. package/es/locale/lang/th-TH.js +16 -3
  22. package/es/locale/lang/ug-CN.js +16 -3
  23. package/es/locale/lang/uk-UA.js +16 -3
  24. package/es/locale/lang/uz-UZ.js +16 -3
  25. package/es/locale/lang/vi-VN.js +15 -2
  26. package/es/locale/lang/zh-CHT.js +18 -5
  27. package/es/locale/lang/zh-CN.js +18 -5
  28. package/es/style.css +1 -1
  29. package/es/style.min.css +1 -1
  30. package/es/table/module/custom/mixin.js +115 -38
  31. package/es/table/module/custom/panel.js +492 -312
  32. package/es/table/module/edit/mixin.js +12 -6
  33. package/es/table/src/columnInfo.js +13 -7
  34. package/es/table/src/methods.js +105 -60
  35. package/es/table/src/util.js +31 -1
  36. package/es/table/style.css +96 -49
  37. package/es/table/style.min.css +1 -1
  38. package/es/ui/index.js +16 -4
  39. package/es/ui/src/log.js +1 -1
  40. package/es/vxe-table/style.css +96 -49
  41. package/es/vxe-table/style.min.css +1 -1
  42. package/lib/{iconfont.1782656027274.ttf → iconfont.1783046294821.ttf} +0 -0
  43. package/lib/iconfont.1783046294821.woff +0 -0
  44. package/lib/iconfont.1783046294821.woff2 +0 -0
  45. package/lib/index.css +1 -1
  46. package/lib/index.min.css +1 -1
  47. package/lib/index.umd.js +612 -226
  48. package/lib/index.umd.min.js +1 -1
  49. package/lib/locale/lang/ar-EG.js +16 -3
  50. package/lib/locale/lang/ar-EG.min.js +1 -1
  51. package/lib/locale/lang/ar-EG.umd.js +16 -3
  52. package/lib/locale/lang/de-DE.js +16 -3
  53. package/lib/locale/lang/de-DE.min.js +1 -1
  54. package/lib/locale/lang/de-DE.umd.js +16 -3
  55. package/lib/locale/lang/en-US.js +20 -7
  56. package/lib/locale/lang/en-US.min.js +1 -1
  57. package/lib/locale/lang/en-US.umd.js +20 -7
  58. package/lib/locale/lang/es-ES.js +16 -3
  59. package/lib/locale/lang/es-ES.min.js +1 -1
  60. package/lib/locale/lang/es-ES.umd.js +16 -3
  61. package/lib/locale/lang/fr-FR.js +16 -3
  62. package/lib/locale/lang/fr-FR.min.js +1 -1
  63. package/lib/locale/lang/fr-FR.umd.js +16 -3
  64. package/lib/locale/lang/hu-HU.js +16 -3
  65. package/lib/locale/lang/hu-HU.min.js +1 -1
  66. package/lib/locale/lang/hu-HU.umd.js +16 -3
  67. package/lib/locale/lang/hy-AM.js +16 -3
  68. package/lib/locale/lang/hy-AM.min.js +1 -1
  69. package/lib/locale/lang/hy-AM.umd.js +16 -3
  70. package/lib/locale/lang/id-ID.js +16 -3
  71. package/lib/locale/lang/id-ID.min.js +1 -1
  72. package/lib/locale/lang/id-ID.umd.js +16 -3
  73. package/lib/locale/lang/it-IT.js +15 -2
  74. package/lib/locale/lang/it-IT.min.js +1 -1
  75. package/lib/locale/lang/it-IT.umd.js +15 -2
  76. package/lib/locale/lang/ja-JP.js +16 -3
  77. package/lib/locale/lang/ja-JP.min.js +1 -1
  78. package/lib/locale/lang/ja-JP.umd.js +16 -3
  79. package/lib/locale/lang/ko-KR.js +16 -3
  80. package/lib/locale/lang/ko-KR.min.js +1 -1
  81. package/lib/locale/lang/ko-KR.umd.js +16 -3
  82. package/lib/locale/lang/ms-MY.js +16 -3
  83. package/lib/locale/lang/ms-MY.min.js +1 -1
  84. package/lib/locale/lang/ms-MY.umd.js +16 -3
  85. package/lib/locale/lang/nb-NO.js +16 -3
  86. package/lib/locale/lang/nb-NO.min.js +1 -1
  87. package/lib/locale/lang/nb-NO.umd.js +16 -3
  88. package/lib/locale/lang/pt-BR.js +16 -3
  89. package/lib/locale/lang/pt-BR.min.js +1 -1
  90. package/lib/locale/lang/pt-BR.umd.js +16 -3
  91. package/lib/locale/lang/ru-RU.js +16 -3
  92. package/lib/locale/lang/ru-RU.min.js +1 -1
  93. package/lib/locale/lang/ru-RU.umd.js +16 -3
  94. package/lib/locale/lang/th-TH.js +16 -3
  95. package/lib/locale/lang/th-TH.min.js +1 -1
  96. package/lib/locale/lang/th-TH.umd.js +16 -3
  97. package/lib/locale/lang/ug-CN.js +16 -3
  98. package/lib/locale/lang/ug-CN.min.js +1 -1
  99. package/lib/locale/lang/ug-CN.umd.js +16 -3
  100. package/lib/locale/lang/uk-UA.js +16 -3
  101. package/lib/locale/lang/uk-UA.min.js +1 -1
  102. package/lib/locale/lang/uk-UA.umd.js +16 -3
  103. package/lib/locale/lang/uz-UZ.js +16 -3
  104. package/lib/locale/lang/uz-UZ.min.js +1 -1
  105. package/lib/locale/lang/uz-UZ.umd.js +16 -3
  106. package/lib/locale/lang/vi-VN.js +15 -2
  107. package/lib/locale/lang/vi-VN.min.js +1 -1
  108. package/lib/locale/lang/vi-VN.umd.js +15 -2
  109. package/lib/locale/lang/zh-CHT.js +18 -5
  110. package/lib/locale/lang/zh-CHT.min.js +1 -1
  111. package/lib/locale/lang/zh-CHT.umd.js +18 -5
  112. package/lib/locale/lang/zh-CN.js +18 -5
  113. package/lib/locale/lang/zh-CN.min.js +1 -1
  114. package/lib/locale/lang/zh-CN.umd.js +18 -5
  115. package/lib/style.css +1 -1
  116. package/lib/style.min.css +1 -1
  117. package/lib/table/module/custom/mixin.js +121 -35
  118. package/lib/table/module/custom/mixin.min.js +1 -1
  119. package/lib/table/module/custom/panel.js +383 -158
  120. package/lib/table/module/custom/panel.min.js +1 -1
  121. package/lib/table/module/edit/mixin.js +12 -6
  122. package/lib/table/src/columnInfo.js +16 -6
  123. package/lib/table/src/columnInfo.min.js +1 -1
  124. package/lib/table/src/methods.js +11 -10
  125. package/lib/table/src/methods.min.js +1 -1
  126. package/lib/table/src/util.js +35 -1
  127. package/lib/table/src/util.min.js +1 -1
  128. package/lib/table/style/style.css +96 -49
  129. package/lib/table/style/style.min.css +1 -1
  130. package/lib/ui/index.js +16 -4
  131. package/lib/ui/index.min.js +1 -1
  132. package/lib/ui/src/log.js +1 -1
  133. package/lib/ui/src/log.min.js +1 -1
  134. package/lib/vxe-table/style/style.css +96 -49
  135. package/lib/vxe-table/style/style.min.css +1 -1
  136. package/package.json +2 -2
  137. package/packages/locale/lang/ar-EG.ts +16 -3
  138. package/packages/locale/lang/de-DE.ts +16 -3
  139. package/packages/locale/lang/en-US.ts +20 -7
  140. package/packages/locale/lang/es-ES.ts +16 -3
  141. package/packages/locale/lang/fr-FR.ts +16 -3
  142. package/packages/locale/lang/hu-HU.ts +16 -3
  143. package/packages/locale/lang/hy-AM.ts +16 -3
  144. package/packages/locale/lang/id-ID.ts +16 -3
  145. package/packages/locale/lang/it-IT.ts +15 -2
  146. package/packages/locale/lang/ja-JP.ts +16 -3
  147. package/packages/locale/lang/ko-KR.ts +16 -3
  148. package/packages/locale/lang/ms-MY.ts +16 -3
  149. package/packages/locale/lang/nb-NO.ts +16 -3
  150. package/packages/locale/lang/pt-BR.ts +16 -3
  151. package/packages/locale/lang/ru-RU.ts +16 -3
  152. package/packages/locale/lang/th-TH.ts +16 -3
  153. package/packages/locale/lang/ug-CN.ts +16 -3
  154. package/packages/locale/lang/uk-UA.ts +16 -3
  155. package/packages/locale/lang/uz-UZ.ts +16 -3
  156. package/packages/locale/lang/vi-VN.ts +15 -2
  157. package/packages/locale/lang/zh-CHT.ts +18 -5
  158. package/packages/locale/lang/zh-CN.ts +18 -5
  159. package/packages/table/module/custom/mixin.ts +115 -38
  160. package/packages/table/module/custom/panel.ts +545 -307
  161. package/packages/table/module/edit/mixin.ts +18 -6
  162. package/packages/table/src/columnInfo.ts +13 -7
  163. package/packages/table/src/methods.ts +120 -61
  164. package/packages/table/src/table.ts +6 -6
  165. package/packages/table/src/util.ts +34 -1
  166. package/packages/ui/index.ts +15 -3
  167. package/styles/components/icon.scss +29 -2
  168. package/styles/components/table-module/custom.scss +88 -67
  169. package/styles/icon/iconfont.ttf +0 -0
  170. package/styles/icon/iconfont.woff +0 -0
  171. package/styles/icon/iconfont.woff2 +0 -0
  172. package/styles/theme/base.scss +13 -1
  173. package/es/iconfont.1782656027274.woff +0 -0
  174. package/es/iconfont.1782656027274.woff2 +0 -0
  175. package/lib/iconfont.1782656027274.woff +0 -0
  176. package/lib/iconfont.1782656027274.woff2 +0 -0
@@ -8,6 +8,7 @@ var _xeUtils = _interopRequireDefault(require("xe-utils"));
8
8
  var _util = require("../../src/util");
9
9
  var _dom = require("../../../ui/src/dom");
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const customColumnCssKeys = ['checkbox', 'sort', 'title', 'width', 'fixed', 'align', 'header-align', 'footer-align'];
11
12
  function updatePopupStyle($xeTable) {
12
13
  const $xeGrid = $xeTable.$xeGrid;
13
14
  const $xeGantt = $xeTable.$xeGantt;
@@ -25,6 +26,8 @@ function updatePopupStyle($xeTable) {
25
26
  const showSimple = !(mode === 'modal' || mode === 'drawer');
26
27
  const {
27
28
  transfer,
29
+ minWidth,
30
+ maxWidth,
28
31
  maxHeight
29
32
  } = popupOptions || {};
30
33
  const customSimpleMode = $xeTable.computeCustomSimpleMode;
@@ -33,7 +36,8 @@ function updatePopupStyle($xeTable) {
33
36
  let wrapperEl = $xeTable.$refs.refElem;
34
37
  let popupTop = 0;
35
38
  let popupMaxHeight = 0;
36
- const popupStys = {};
39
+ const defPupStys = {};
40
+ const panePupStys = {};
37
41
  if ($xeGantt) {
38
42
  const ganttContainerElem = $xeGantt.$refs.refGanttContainerElem;
39
43
  if (ganttContainerElem) {
@@ -63,23 +67,40 @@ function updatePopupStyle($xeTable) {
63
67
  }
64
68
  if (!placement || !['left', 'right', 'bottom-left', 'bottom-right'].includes(placement)) {
65
69
  if (popupTop) {
66
- popupStys.top = (0, _dom.toCssUnit)(popupTop);
70
+ defPupStys.top = (0, _dom.toCssUnit)(popupTop);
67
71
  }
68
72
  }
69
73
  if (showSimple && transfer) {
70
74
  if (placement === 'bottom-left' || placement === 'bottom-right') {
71
- popupStys.bottom = (0, _dom.toCssUnit)(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1);
75
+ defPupStys.bottom = (0, _dom.toCssUnit)(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1);
72
76
  }
73
77
  if (placement === 'top-left' || placement === 'bottom-left') {
74
- popupStys.left = (0, _dom.toCssUnit)(tableRect.left);
78
+ defPupStys.left = (0, _dom.toCssUnit)(tableRect.left);
75
79
  } else if (!placement || placement === 'top-right' || placement === 'bottom-right') {
76
- popupStys.right = (0, _dom.toCssUnit)(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1);
80
+ defPupStys.right = (0, _dom.toCssUnit)(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1);
77
81
  }
78
82
  }
83
+ // 同步表格的css变量到弹窗中
84
+ const bodyComputeStyle = getComputedStyle(bodyEl);
85
+ const tableComputeStyle = getComputedStyle(wrapperEl);
86
+ customColumnCssKeys.forEach(key => {
87
+ const currCssKey = `--vxe-ui-vxe-table-custom-column-${key}-${key === 'title' ? 'min-' : ''}width`;
88
+ const currCssVal = tableComputeStyle.getPropertyValue(currCssKey);
89
+ if (currCssVal && currCssVal !== bodyComputeStyle.getPropertyValue(currCssKey)) {
90
+ panePupStys[currCssKey] = currCssVal;
91
+ }
92
+ });
93
+ if (minWidth) {
94
+ defPupStys['--vxe-ui-vxe-table-custom-default-min-width'] = (0, _dom.toCssUnit)(minWidth);
95
+ }
96
+ if (maxWidth) {
97
+ defPupStys['--vxe-ui-vxe-table-custom-default-max-width'] = (0, _dom.toCssUnit)(maxWidth);
98
+ }
79
99
  if (popupMxHeight) {
80
- popupStys.maxHeight = (0, _dom.toCssUnit)(popupMxHeight);
100
+ defPupStys.maxHeight = (0, _dom.toCssUnit)(popupMxHeight);
81
101
  }
82
- customStore.popupStyle = popupStys;
102
+ customStore.defPopupStyle = defPupStys;
103
+ customStore.panePopupStyle = panePupStys;
83
104
  customStore.maxHeight = popupMxHeight;
84
105
  return $xeTable.$nextTick();
85
106
  }
@@ -178,7 +199,7 @@ var _default = exports.default = {
178
199
  }
179
200
  return $xeTable.openCustom();
180
201
  },
181
- _saveCustom() {
202
+ _saveCustom(isDirectly) {
182
203
  const $xeTable = this;
183
204
  const reactData = $xeTable;
184
205
  const internalData = $xeTable;
@@ -193,39 +214,61 @@ var _default = exports.default = {
193
214
  allowSort,
194
215
  allowFixed,
195
216
  allowResizable,
217
+ allowAlign,
218
+ allowHeaderAlign,
219
+ allowFooterAlign,
196
220
  allowGroup,
197
221
  allowValues
198
222
  } = customOpts;
199
- _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
200
- if (parentColumn) {
201
- // 更新子列信息
202
- column.fixed = parentColumn.fixed;
203
- } else {
204
- if (allowSort) {
205
- const sortIndex = index + 1;
206
- column.renderSortNumber = sortIndex;
223
+ if (isDirectly) {
224
+ _xeUtils.default.eachTree(customColumnList, column => {
225
+ if (allowResizable) {
226
+ if (column.renderVisible && (!column.children || !column.children.length)) {
227
+ column.resizeWidth = Math.max(0, _xeUtils.default.toNumber(column.renderWidth));
228
+ }
207
229
  }
208
- if (allowFixed) {
209
- column.fixed = column.renderFixed;
230
+ });
231
+ } else {
232
+ _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
233
+ if (parentColumn) {
234
+ // 更新子列信息
235
+ column.fixed = parentColumn.fixed;
236
+ } else {
237
+ if (allowSort) {
238
+ const sortIndex = index + 1;
239
+ column.renderSortNumber = sortIndex;
240
+ }
241
+ if (allowFixed) {
242
+ column.fixed = column.renderFixed;
243
+ }
210
244
  }
211
- }
212
- if (allowResizable) {
213
- if (column.renderVisible && (!column.children || !column.children.length)) {
214
- if (column.renderResizeWidth !== column.renderWidth) {
215
- column.resizeWidth = column.renderResizeWidth;
216
- column.renderWidth = column.renderResizeWidth;
245
+ if (allowResizable) {
246
+ if (column.renderVisible && (!column.children || !column.children.length)) {
247
+ if (column.renderResizeWidth !== column.renderWidth) {
248
+ column.resizeWidth = column.renderResizeWidth;
249
+ column.renderWidth = column.renderResizeWidth;
250
+ }
217
251
  }
218
252
  }
219
- }
220
- if (allowVisible) {
221
- column.visible = column.renderVisible;
222
- }
223
- if (allowGroup && allowValues) {
224
- column.aggFunc = column.renderAggFn;
225
- }
226
- });
253
+ if (allowVisible) {
254
+ column.visible = column.renderVisible;
255
+ }
256
+ if (allowAlign) {
257
+ column.align = column.renderAlign;
258
+ }
259
+ if (allowHeaderAlign) {
260
+ column.headerAlign = column.renderHeaderAlign;
261
+ }
262
+ if (allowFooterAlign) {
263
+ column.footerAlign = column.renderFooterAlign;
264
+ }
265
+ if (allowGroup && allowValues) {
266
+ column.aggFunc = column.renderAggFn;
267
+ }
268
+ });
269
+ }
227
270
  reactData.isCustomStatus = true;
228
- if (allowGroup && allowValues && !!$xeTable.handlePivotTableAggData) {
271
+ if (allowGroup && !!$xeTable.handlePivotTableAggData) {
229
272
  if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
230
273
  // 更新数据分组
231
274
  if (aggHandleFields.length) {
@@ -260,7 +303,12 @@ var _default = exports.default = {
260
303
  allowVisible,
261
304
  allowSort,
262
305
  allowFixed,
263
- allowResizable
306
+ allowAlign,
307
+ allowHeaderAlign,
308
+ allowFooterAlign,
309
+ allowResizable,
310
+ allowGroup,
311
+ allowValues
264
312
  } = customOpts;
265
313
  _xeUtils.default.eachTree(customColumnList, column => {
266
314
  const colid = column.getKey();
@@ -280,6 +328,21 @@ var _default = exports.default = {
280
328
  if (allowResizable) {
281
329
  column.renderResizeWidth = column.renderWidth;
282
330
  }
331
+ if (allowAlign) {
332
+ column.align = column.renderAlign;
333
+ }
334
+ if (allowHeaderAlign) {
335
+ column.headerAlign = column.renderHeaderAlign;
336
+ }
337
+ if (allowFooterAlign) {
338
+ column.footerAlign = column.renderFooterAlign;
339
+ }
340
+ if (allowGroup) {
341
+ // 无
342
+ }
343
+ if (allowValues) {
344
+ // 无
345
+ }
283
346
  }, {
284
347
  children: 'children'
285
348
  });
@@ -304,7 +367,10 @@ var _default = exports.default = {
304
367
  resizable: options === true,
305
368
  fixed: options === true,
306
369
  sort: options === true,
307
- aggFunc: options === true
370
+ aggFunc: options === true,
371
+ align: options === true,
372
+ headerAlign: options === true,
373
+ footerAlign: options === true
308
374
  }, options);
309
375
  const allCols = [];
310
376
  _xeUtils.default.eachTree(collectColumn, column => {
@@ -313,6 +379,7 @@ var _default = exports.default = {
313
379
  }
314
380
  if (opts.fixed) {
315
381
  column.fixed = column.defaultFixed;
382
+ column.renderFixed = column.defaultFixed;
316
383
  }
317
384
  if (opts.sort) {
318
385
  column.renderSortNumber = column.sortNumber;
@@ -324,6 +391,18 @@ var _default = exports.default = {
324
391
  })) {
325
392
  column.visible = column.defaultVisible;
326
393
  }
394
+ if (opts.align) {
395
+ column.align = column.defaultAlign;
396
+ column.renderAlign = column.defaultAlign;
397
+ }
398
+ if (opts.headerAlign) {
399
+ column.headerAlign = column.defaultHeaderAlign;
400
+ column.renderHeaderAlign = column.defaultHeaderAlign;
401
+ }
402
+ if (opts.footerAlign) {
403
+ column.footerAlign = column.defaultFooterAlign;
404
+ column.renderFooterAlign = column.defaultFooterAlign;
405
+ }
327
406
  if (opts.aggFunc) {
328
407
  column.aggFunc = column.defaultAggFunc;
329
408
  column.renderAggFn = column.defaultAggFunc;
@@ -462,10 +541,12 @@ var _default = exports.default = {
462
541
  if (customStore.visible) {
463
542
  $xeTable.closeCustom();
464
543
  emitCustomEvent($xeTable, 'close', evnt);
544
+ $xeTable.dispatchEvent('custom-close', {}, evnt);
465
545
  } else {
466
546
  customStore.btnEl = evnt.target;
467
547
  $xeTable.openCustom();
468
548
  emitCustomEvent($xeTable, 'open', evnt);
549
+ $xeTable.dispatchEvent('custom-open', {}, evnt);
469
550
  }
470
551
  },
471
552
  customOpenEvent(evnt) {
@@ -479,6 +560,7 @@ var _default = exports.default = {
479
560
  customStore.btnEl = evnt.target;
480
561
  $xeTable.openCustom();
481
562
  emitCustomEvent($xeTable, 'open', evnt);
563
+ $xeTable.dispatchEvent('custom-open', {}, evnt);
482
564
  }
483
565
  },
484
566
  customCloseEvent(evnt) {
@@ -491,6 +573,7 @@ var _default = exports.default = {
491
573
  customStore.activeBtn = false;
492
574
  $xeTable.closeCustom();
493
575
  emitCustomEvent($xeTable, 'close', evnt);
576
+ $xeTable.dispatchEvent('custom-close', {}, evnt);
494
577
  }
495
578
  },
496
579
  handleUpdateCustomColumn() {
@@ -512,6 +595,9 @@ var _default = exports.default = {
512
595
  column.renderFixed = column.fixed;
513
596
  column.renderVisible = column.visible;
514
597
  column.renderResizeWidth = column.renderWidth;
598
+ column.renderAlign = column.align;
599
+ column.renderHeaderAlign = column.headerAlign;
600
+ column.renderFooterAlign = column.footerAlign;
515
601
  sortMaps[colid] = column.renderSortNumber;
516
602
  fixedMaps[colid] = column.fixed;
517
603
  visibleMaps[colid] = column.visible;
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_util=require("../../src/util"),_dom=require("../../../ui/src/dom");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function updatePopupStyle(e){var t=e.$xeGrid,o=e.$xeGantt,t=t||o,l=e.customStore,{mode:s,placement:i,popupOptions:r}=e.computeCustomOpts,s=!("modal"===s||"drawer"===s),{transfer:r,maxHeight:u}=r||{},n="outside"===e.computeCustomSimpleMode,a=document.documentElement;let d=e.$refs.refElem,m=0,c=0;var h={},o=(d=o&&(o=o.$refs.refGanttContainerElem)?o:d).getBoundingClientRect();c=s&&r?(m=o.top+a.scrollTop,_xeUtils.default.eqNull(u)?360:u):n?(t&&d&&(m=d.offsetTop),_xeUtils.default.eqNull(u)?360:u):(d&&(c=d.clientHeight-22),Math.max(88,c));let p=0;return"left"!==i&&"right"!==i&&(p=_xeUtils.default.eqNull(u)?c:u),i&&["left","right","bottom-left","bottom-right"].includes(i)||m&&(h.top=(0,_dom.toCssUnit)(m)),s&&r&&("bottom-left"!==i&&"bottom-right"!==i||(h.bottom=(0,_dom.toCssUnit)(a.scrollHeight-o.top-o.height+1)),"top-left"===i||"bottom-left"===i?h.left=(0,_dom.toCssUnit)(o.left):i&&"top-right"!==i&&"bottom-right"!==i||(h.right=(0,_dom.toCssUnit)(a.scrollWidth-o.left-o.width+1))),p&&(h.maxHeight=(0,_dom.toCssUnit)(p)),l.popupStyle=h,l.maxHeight=p,e.$nextTick()}function emitCustomEvent(e,t,o){(e.$xeGrid||e.$xeGantt||e).dispatchEvent("custom",{type:t},o)}var _default=exports.default={methods:{_getCustomVisible(){var e=this.customStore;return e.visible},_openCustom(){let e=this;var t=e,o=e,l=e.$xeGrid,s=e.$xeGantt,l=l||s,{initStore:s,customStore:i}=t,{mode:r,popupOptions:u}=e.computeCustomOpts,u=(u||{}).transfer,n=e.computeCustomSimpleMode;let a=e.$refs.refCustomContainerElem;return!("modal"===r||"drawer"===r)&&u?a=document.body:"outside"===n&&l&&(r=l.$refs.refPopupContainerElem)&&(a=r),a&&(u=e.$refs.refCustomPopupToElem)&&u.parentElement!==a&&a.appendChild(u),o.customPopupToElem!==a&&t.ctPopupFlag++,o.customPopupToElem=a,i.visible=!0,s.custom=!0,e.handleUpdateCustomColumn(),e.checkCustomStatus(),updatePopupStyle(e),e.$nextTick().then(()=>updatePopupStyle(e))},_closeCustom(){var e=this,t=e.customStore,o=e.computeCustomOpts;return t.visible&&(t.visible=!1,o.immediate||e.handleCustom()),e.$nextTick()},_toggleCustom(){var e=this.customStore;return e.visible?this.closeCustom():this.openCustom()},_saveCustom(){var e=this,t=e,o=e;let{customColumnList:l,aggHandleFields:s,rowGroupList:i}=t,{allowVisible:r,allowSort:u,allowFixed:n,allowResizable:a,allowGroup:d,allowValues:m}=e.computeCustomOpts;return _xeUtils.default.eachTree(l,(e,t,o,l,s)=>{s?e.fixed=s.fixed:(u&&(e.renderSortNumber=t+1),n&&(e.fixed=e.renderFixed)),!a||!e.renderVisible||e.children&&e.children.length||e.renderResizeWidth!==e.renderWidth&&(e.resizeWidth=e.renderResizeWidth,e.renderWidth=e.renderResizeWidth),r&&(e.visible=e.renderVisible),d&&m&&(e.aggFunc=e.renderAggFn)}),t.isCustomStatus=!0,d&&m&&e.handlePivotTableAggData&&(i.length!==s.length||i.some((e,t)=>e.field!==s[t])?s.length?e.setRowGroups(s):e.clearRowGroups():m&&e.handleUpdateAggData()),u&&(o.collectColumn=l),e.saveCustomStore("confirm")},_cancelCustom(){var{customColumnList:e,customStore:t}=this;let{oldSortMaps:s,oldFixedMaps:i,oldVisibleMaps:r}=t,{allowVisible:u,allowSort:n,allowFixed:a,allowResizable:d}=this.computeCustomOpts;return _xeUtils.default.eachTree(e,e=>{var t=e.getKey(),o=!!r[t],l=i[t]||"";u&&(e.renderVisible=o,e.visible=o),a&&(e.renderFixed=l,e.fixed=l),n&&(e.renderSortNumber=s[t]||0),d&&(e.renderResizeWidth=e.renderWidth)},{children:"children"}),this.$nextTick()},_resetCustom(e){let t=this;var o=t,l=t;let s=o.rowGroupList;var i=l.collectColumn;let r=t.computeCustomOpts.checkMethod,u=Object.assign({visible:!0,resizable:!0===e,fixed:!0===e,sort:!0===e,aggFunc:!0===e},e),n=[];return _xeUtils.default.eachTree(i,e=>{u.resizable&&(e.resizeWidth=0),u.fixed&&(e.fixed=e.defaultFixed),u.sort&&(e.renderSortNumber=e.sortNumber,e.parentId=e.defaultParentId),r&&!r({$table:t,column:e})||(e.visible=e.defaultVisible),u.aggFunc&&(e.aggFunc=e.defaultAggFunc,e.renderAggFn=e.defaultAggFunc),e.renderResizeWidth=e.renderWidth,n.push(e)}),u.sort&&(e=_xeUtils.default.toArrayTree(_xeUtils.default.orderBy(n,"renderSortNumber"),{key:"id",parentKey:"parentId",children:"children"}),l.collectColumn=e,l.tableFullColumn=(0,_util.getColumnList)(e)),o.isCustomStatus=!1,t.handleCustom().then(()=>{var e;u.aggFunc&&t.handlePivotTableAggData&&(((e=t.computeRowGroupFields)||s).length?e&&e.length?t.setRowGroups(e):t.clearRowGroups():t.handleUpdateAggData()),t.saveCustomStore("reset")})},_toggleCustomAllCheckbox(){var e=this.customStore,e=!e.isAll;return this.setCustomAllCheckbox(e)},_setCustomAllCheckbox(e){let t=this;var o=t,l=o.customStore,s=o.customColumnList,i=t.computeCustomOpts;let{checkMethod:r,visibleMethod:u}=i,n=!!e;i.immediate?(_xeUtils.default.eachTree(s,e=>{u&&!u({$table:t,column:e})||r&&!r({$table:t,column:e})||(e.visible=n,e.renderVisible=n,e.halfVisible=!1)}),l.isAll=n,o.isCustomStatus=!0,t.handleCustom(),t.saveCustomStore("update:visible")):(_xeUtils.default.eachTree(s,e=>{u&&!u({$table:t,column:e})||r&&!r({$table:t,column:e})||(e.renderVisible=n,e.halfVisible=!1)}),l.isAll=n),t.checkCustomStatus()},checkCustomStatus(){let t=this;var e=t.customStore,o=t.collectColumn;let l=t.computeCustomOpts.checkMethod;e.isAll=o.every(e=>!!l&&!l({$table:t,column:e})||e.renderVisible),e.isIndeterminate=!e.isAll&&o.some(e=>(!l||l({$table:t,column:e}))&&(e.renderVisible||e.halfVisible))},emitCustomEvent(e,t){this.dispatchEvent("custom",{type:e},t)},triggerCustomEvent(e){var t=this,o=t.customStore;o.visible?(t.closeCustom(),emitCustomEvent(t,"close",e)):(o.btnEl=e.target,t.openCustom(),emitCustomEvent(t,"open",e))},customOpenEvent(e){var t=this.customStore;t.visible&&(t.activeBtn=!0,t.btnEl=e.target,this.openCustom(),emitCustomEvent(this,"open",e))},customCloseEvent(e){var t=this.customStore;t.visible&&(t.activeBtn=!1,this.closeCustom(),emitCustomEvent(this,"close",e))},handleUpdateCustomColumn(){var e=this,t=e.customStore,i=this.collectColumn;if(t.visible){let o={},l={},s={};_xeUtils.default.eachTree(i,e=>{var t=e.getKey();e.renderFixed=e.fixed,e.renderVisible=e.visible,e.renderResizeWidth=e.renderWidth,o[t]=e.renderSortNumber,l[t]=e.fixed,s[t]=e.visible}),t.oldSortMaps=o,t.oldFixedMaps=l,t.oldVisibleMaps=s,e.customColumnList=i.slice(0)}},handleCustomStyle(){return updatePopupStyle(this)}}};
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_util=require("../../src/util"),_dom=require("../../../ui/src/dom");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let customColumnCssKeys=["checkbox","sort","title","width","fixed","align","header-align","footer-align"];function updatePopupStyle(e){var t=e.$xeGrid,l=e.$xeGantt,t=t||l,o=e.customStore,{mode:i,placement:r,popupOptions:s}=e.computeCustomOpts,i=!("modal"===i||"drawer"===i),{transfer:s,minWidth:n,maxWidth:u,maxHeight:a}=s||{},d="outside"===e.computeCustomSimpleMode,m=document.documentElement;let c=e.$refs.refElem,h=0,p=0;var g={};let f={};l=(c=l&&(l=l.$refs.refGanttContainerElem)?l:c).getBoundingClientRect();p=i&&s?(h=l.top+m.scrollTop,_xeUtils.default.eqNull(a)?360:a):d?(t&&c&&(h=c.offsetTop),_xeUtils.default.eqNull(a)?360:a):(c&&(p=c.clientHeight-22),Math.max(88,p));let C=0,b=("left"!==r&&"right"!==r&&(C=_xeUtils.default.eqNull(a)?p:a),r&&["left","right","bottom-left","bottom-right"].includes(r)||h&&(g.top=(0,_dom.toCssUnit)(h)),i&&s&&("bottom-left"!==r&&"bottom-right"!==r||(g.bottom=(0,_dom.toCssUnit)(m.scrollHeight-l.top-l.height+1)),"top-left"===r||"bottom-left"===r?g.left=(0,_dom.toCssUnit)(l.left):r&&"top-right"!==r&&"bottom-right"!==r||(g.right=(0,_dom.toCssUnit)(m.scrollWidth-l.left-l.width+1))),getComputedStyle(m)),v=getComputedStyle(c);return customColumnCssKeys.forEach(e=>{var e=`--vxe-ui-vxe-table-custom-column-${e}-${"title"===e?"min-":""}width`,t=v.getPropertyValue(e);t&&t!==b.getPropertyValue(e)&&(f[e]=t)}),n&&(g["--vxe-ui-vxe-table-custom-default-min-width"]=(0,_dom.toCssUnit)(n)),u&&(g["--vxe-ui-vxe-table-custom-default-max-width"]=(0,_dom.toCssUnit)(u)),C&&(g.maxHeight=(0,_dom.toCssUnit)(C)),o.defPopupStyle=g,o.panePopupStyle=f,o.maxHeight=C,e.$nextTick()}function emitCustomEvent(e,t,l){(e.$xeGrid||e.$xeGantt||e).dispatchEvent("custom",{type:t},l)}var _default=exports.default={methods:{_getCustomVisible(){var e=this.customStore;return e.visible},_openCustom(){let e=this;var t=e,l=e,o=e.$xeGrid,i=e.$xeGantt,o=o||i,{initStore:i,customStore:r}=t,{mode:s,popupOptions:n}=e.computeCustomOpts,n=(n||{}).transfer,u=e.computeCustomSimpleMode;let a=e.$refs.refCustomContainerElem;return!("modal"===s||"drawer"===s)&&n?a=document.body:"outside"===u&&o&&(s=o.$refs.refPopupContainerElem)&&(a=s),a&&(n=e.$refs.refCustomPopupToElem)&&n.parentElement!==a&&a.appendChild(n),l.customPopupToElem!==a&&t.ctPopupFlag++,l.customPopupToElem=a,r.visible=!0,i.custom=!0,e.handleUpdateCustomColumn(),e.checkCustomStatus(),updatePopupStyle(e),e.$nextTick().then(()=>updatePopupStyle(e))},_closeCustom(){var e=this.customStore,t=this.computeCustomOpts;return e.visible&&(e.visible=!1,t.immediate||this.handleCustom()),this.$nextTick()},_toggleCustom(){var e=this.customStore;return e.visible?this.closeCustom():this.openCustom()},_saveCustom(e){var t=this,l=t,o=t;let{customColumnList:i,aggHandleFields:r,rowGroupList:s}=l,{allowVisible:n,allowSort:u,allowFixed:a,allowResizable:d,allowAlign:m,allowHeaderAlign:c,allowFooterAlign:h,allowGroup:p,allowValues:g}=t.computeCustomOpts;return e?_xeUtils.default.eachTree(i,e=>{!d||!e.renderVisible||e.children&&e.children.length||(e.resizeWidth=Math.max(0,_xeUtils.default.toNumber(e.renderWidth)))}):_xeUtils.default.eachTree(i,(e,t,l,o,i)=>{i?e.fixed=i.fixed:(u&&(e.renderSortNumber=t+1),a&&(e.fixed=e.renderFixed)),!d||!e.renderVisible||e.children&&e.children.length||e.renderResizeWidth!==e.renderWidth&&(e.resizeWidth=e.renderResizeWidth,e.renderWidth=e.renderResizeWidth),n&&(e.visible=e.renderVisible),m&&(e.align=e.renderAlign),c&&(e.headerAlign=e.renderHeaderAlign),h&&(e.footerAlign=e.renderFooterAlign),p&&g&&(e.aggFunc=e.renderAggFn)}),l.isCustomStatus=!0,p&&t.handlePivotTableAggData&&(s.length!==r.length||s.some((e,t)=>e.field!==r[t])?r.length?t.setRowGroups(r):t.clearRowGroups():g&&t.handleUpdateAggData()),u&&(o.collectColumn=i),t.saveCustomStore("confirm")},_cancelCustom(){var{customColumnList:e,customStore:t}=this;let{oldSortMaps:i,oldFixedMaps:r,oldVisibleMaps:s}=t,{allowVisible:n,allowSort:u,allowFixed:a,allowAlign:d,allowHeaderAlign:m,allowFooterAlign:c,allowResizable:h,allowGroup:p,allowValues:g}=this.computeCustomOpts;return _xeUtils.default.eachTree(e,e=>{var t=e.getKey(),l=!!s[t],o=r[t]||"";n&&(e.renderVisible=l,e.visible=l),a&&(e.renderFixed=o,e.fixed=o),u&&(e.renderSortNumber=i[t]||0),h&&(e.renderResizeWidth=e.renderWidth),d&&(e.align=e.renderAlign),m&&(e.headerAlign=e.renderHeaderAlign),c&&(e.footerAlign=e.renderFooterAlign),p,g},{children:"children"}),this.$nextTick()},_resetCustom(e){let t=this;var l=t,o=t;let i=l.rowGroupList;var r=o.collectColumn;let s=t.computeCustomOpts.checkMethod,n=Object.assign({visible:!0,resizable:!0===e,fixed:!0===e,sort:!0===e,aggFunc:!0===e,align:!0===e,headerAlign:!0===e,footerAlign:!0===e},e),u=[];return _xeUtils.default.eachTree(r,e=>{n.resizable&&(e.resizeWidth=0),n.fixed&&(e.fixed=e.defaultFixed,e.renderFixed=e.defaultFixed),n.sort&&(e.renderSortNumber=e.sortNumber,e.parentId=e.defaultParentId),s&&!s({$table:t,column:e})||(e.visible=e.defaultVisible),n.align&&(e.align=e.defaultAlign,e.renderAlign=e.defaultAlign),n.headerAlign&&(e.headerAlign=e.defaultHeaderAlign,e.renderHeaderAlign=e.defaultHeaderAlign),n.footerAlign&&(e.footerAlign=e.defaultFooterAlign,e.renderFooterAlign=e.defaultFooterAlign),n.aggFunc&&(e.aggFunc=e.defaultAggFunc,e.renderAggFn=e.defaultAggFunc),e.renderResizeWidth=e.renderWidth,u.push(e)}),n.sort&&(e=_xeUtils.default.toArrayTree(_xeUtils.default.orderBy(u,"renderSortNumber"),{key:"id",parentKey:"parentId",children:"children"}),o.collectColumn=e,o.tableFullColumn=(0,_util.getColumnList)(e)),l.isCustomStatus=!1,t.handleCustom().then(()=>{var e;n.aggFunc&&t.handlePivotTableAggData&&(((e=t.computeRowGroupFields)||i).length?e&&e.length?t.setRowGroups(e):t.clearRowGroups():t.handleUpdateAggData()),t.saveCustomStore("reset")})},_toggleCustomAllCheckbox(){var e=this.customStore,e=!e.isAll;return this.setCustomAllCheckbox(e)},_setCustomAllCheckbox(e){let t=this;var l=t,o=l.customStore,i=l.customColumnList,r=t.computeCustomOpts;let{checkMethod:s,visibleMethod:n}=r,u=!!e;r.immediate?(_xeUtils.default.eachTree(i,e=>{n&&!n({$table:t,column:e})||s&&!s({$table:t,column:e})||(e.visible=u,e.renderVisible=u,e.halfVisible=!1)}),o.isAll=u,l.isCustomStatus=!0,t.handleCustom(),t.saveCustomStore("update:visible")):(_xeUtils.default.eachTree(i,e=>{n&&!n({$table:t,column:e})||s&&!s({$table:t,column:e})||(e.renderVisible=u,e.halfVisible=!1)}),o.isAll=u),t.checkCustomStatus()},checkCustomStatus(){let t=this;var e=t.customStore,l=t.collectColumn;let o=t.computeCustomOpts.checkMethod;e.isAll=l.every(e=>!!o&&!o({$table:t,column:e})||e.renderVisible),e.isIndeterminate=!e.isAll&&l.some(e=>(!o||o({$table:t,column:e}))&&(e.renderVisible||e.halfVisible))},emitCustomEvent(e,t){this.dispatchEvent("custom",{type:e},t)},triggerCustomEvent(e){var t=this,l=t.customStore;l.visible?(t.closeCustom(),emitCustomEvent(t,"close",e),t.dispatchEvent("custom-close",{},e)):(l.btnEl=e.target,t.openCustom(),emitCustomEvent(t,"open",e),t.dispatchEvent("custom-open",{},e))},customOpenEvent(e){var t=this.customStore;t.visible&&(t.activeBtn=!0,t.btnEl=e.target,this.openCustom(),emitCustomEvent(this,"open",e),this.dispatchEvent("custom-open",{},e))},customCloseEvent(e){var t=this.customStore;t.visible&&(t.activeBtn=!1,this.closeCustom(),emitCustomEvent(this,"close",e),this.dispatchEvent("custom-close",{},e))},handleUpdateCustomColumn(){var e=this,t=e.customStore,r=this.collectColumn;if(t.visible){let l={},o={},i={};_xeUtils.default.eachTree(r,e=>{var t=e.getKey();e.renderFixed=e.fixed,e.renderVisible=e.visible,e.renderResizeWidth=e.renderWidth,e.renderAlign=e.align,e.renderHeaderAlign=e.headerAlign,e.renderFooterAlign=e.footerAlign,l[t]=e.renderSortNumber,o[t]=e.fixed,i[t]=e.visible}),t.oldSortMaps=l,t.oldFixedMaps=o,t.oldVisibleMaps=i,e.customColumnList=r.slice(0)}},handleCustomStyle(){return updatePopupStyle(this)}}};