vxe-table 3.21.22 → 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 (172) hide show
  1. package/es/{iconfont.1782890276645.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 +12 -3
  7. package/es/locale/lang/de-DE.js +12 -3
  8. package/es/locale/lang/en-US.js +16 -7
  9. package/es/locale/lang/es-ES.js +12 -3
  10. package/es/locale/lang/fr-FR.js +12 -3
  11. package/es/locale/lang/hu-HU.js +12 -3
  12. package/es/locale/lang/hy-AM.js +12 -3
  13. package/es/locale/lang/id-ID.js +12 -3
  14. package/es/locale/lang/it-IT.js +11 -2
  15. package/es/locale/lang/ja-JP.js +12 -3
  16. package/es/locale/lang/ko-KR.js +12 -3
  17. package/es/locale/lang/ms-MY.js +12 -3
  18. package/es/locale/lang/nb-NO.js +12 -3
  19. package/es/locale/lang/pt-BR.js +12 -3
  20. package/es/locale/lang/ru-RU.js +12 -3
  21. package/es/locale/lang/th-TH.js +12 -3
  22. package/es/locale/lang/ug-CN.js +12 -3
  23. package/es/locale/lang/uk-UA.js +12 -3
  24. package/es/locale/lang/uz-UZ.js +12 -3
  25. package/es/locale/lang/vi-VN.js +11 -2
  26. package/es/locale/lang/zh-CHT.js +14 -5
  27. package/es/locale/lang/zh-CN.js +14 -5
  28. package/es/style.css +1 -1
  29. package/es/style.min.css +1 -1
  30. package/es/table/module/custom/mixin.js +84 -13
  31. package/es/table/module/custom/panel.js +485 -312
  32. package/es/table/src/columnInfo.js +13 -7
  33. package/es/table/src/methods.js +100 -59
  34. package/es/table/src/util.js +31 -1
  35. package/es/table/style.css +96 -49
  36. package/es/table/style.min.css +1 -1
  37. package/es/ui/index.js +16 -4
  38. package/es/ui/src/log.js +1 -1
  39. package/es/vxe-table/style.css +96 -49
  40. package/es/vxe-table/style.min.css +1 -1
  41. package/lib/{iconfont.1782890276645.ttf → iconfont.1783046294821.ttf} +0 -0
  42. package/lib/iconfont.1783046294821.woff +0 -0
  43. package/lib/iconfont.1783046294821.woff2 +0 -0
  44. package/lib/index.css +1 -1
  45. package/lib/index.min.css +1 -1
  46. package/lib/index.umd.js +557 -194
  47. package/lib/index.umd.min.js +1 -1
  48. package/lib/locale/lang/ar-EG.js +12 -3
  49. package/lib/locale/lang/ar-EG.min.js +1 -1
  50. package/lib/locale/lang/ar-EG.umd.js +12 -3
  51. package/lib/locale/lang/de-DE.js +12 -3
  52. package/lib/locale/lang/de-DE.min.js +1 -1
  53. package/lib/locale/lang/de-DE.umd.js +12 -3
  54. package/lib/locale/lang/en-US.js +16 -7
  55. package/lib/locale/lang/en-US.min.js +1 -1
  56. package/lib/locale/lang/en-US.umd.js +16 -7
  57. package/lib/locale/lang/es-ES.js +12 -3
  58. package/lib/locale/lang/es-ES.min.js +1 -1
  59. package/lib/locale/lang/es-ES.umd.js +12 -3
  60. package/lib/locale/lang/fr-FR.js +12 -3
  61. package/lib/locale/lang/fr-FR.min.js +1 -1
  62. package/lib/locale/lang/fr-FR.umd.js +12 -3
  63. package/lib/locale/lang/hu-HU.js +12 -3
  64. package/lib/locale/lang/hu-HU.min.js +1 -1
  65. package/lib/locale/lang/hu-HU.umd.js +12 -3
  66. package/lib/locale/lang/hy-AM.js +12 -3
  67. package/lib/locale/lang/hy-AM.min.js +1 -1
  68. package/lib/locale/lang/hy-AM.umd.js +12 -3
  69. package/lib/locale/lang/id-ID.js +12 -3
  70. package/lib/locale/lang/id-ID.min.js +1 -1
  71. package/lib/locale/lang/id-ID.umd.js +12 -3
  72. package/lib/locale/lang/it-IT.js +11 -2
  73. package/lib/locale/lang/it-IT.min.js +1 -1
  74. package/lib/locale/lang/it-IT.umd.js +11 -2
  75. package/lib/locale/lang/ja-JP.js +12 -3
  76. package/lib/locale/lang/ja-JP.min.js +1 -1
  77. package/lib/locale/lang/ja-JP.umd.js +12 -3
  78. package/lib/locale/lang/ko-KR.js +12 -3
  79. package/lib/locale/lang/ko-KR.min.js +1 -1
  80. package/lib/locale/lang/ko-KR.umd.js +12 -3
  81. package/lib/locale/lang/ms-MY.js +12 -3
  82. package/lib/locale/lang/ms-MY.min.js +1 -1
  83. package/lib/locale/lang/ms-MY.umd.js +12 -3
  84. package/lib/locale/lang/nb-NO.js +12 -3
  85. package/lib/locale/lang/nb-NO.min.js +1 -1
  86. package/lib/locale/lang/nb-NO.umd.js +12 -3
  87. package/lib/locale/lang/pt-BR.js +12 -3
  88. package/lib/locale/lang/pt-BR.min.js +1 -1
  89. package/lib/locale/lang/pt-BR.umd.js +12 -3
  90. package/lib/locale/lang/ru-RU.js +12 -3
  91. package/lib/locale/lang/ru-RU.min.js +1 -1
  92. package/lib/locale/lang/ru-RU.umd.js +12 -3
  93. package/lib/locale/lang/th-TH.js +12 -3
  94. package/lib/locale/lang/th-TH.min.js +1 -1
  95. package/lib/locale/lang/th-TH.umd.js +12 -3
  96. package/lib/locale/lang/ug-CN.js +12 -3
  97. package/lib/locale/lang/ug-CN.min.js +1 -1
  98. package/lib/locale/lang/ug-CN.umd.js +12 -3
  99. package/lib/locale/lang/uk-UA.js +12 -3
  100. package/lib/locale/lang/uk-UA.min.js +1 -1
  101. package/lib/locale/lang/uk-UA.umd.js +12 -3
  102. package/lib/locale/lang/uz-UZ.js +12 -3
  103. package/lib/locale/lang/uz-UZ.min.js +1 -1
  104. package/lib/locale/lang/uz-UZ.umd.js +12 -3
  105. package/lib/locale/lang/vi-VN.js +11 -2
  106. package/lib/locale/lang/vi-VN.min.js +1 -1
  107. package/lib/locale/lang/vi-VN.umd.js +11 -2
  108. package/lib/locale/lang/zh-CHT.js +14 -5
  109. package/lib/locale/lang/zh-CHT.min.js +1 -1
  110. package/lib/locale/lang/zh-CHT.umd.js +14 -5
  111. package/lib/locale/lang/zh-CN.js +14 -5
  112. package/lib/locale/lang/zh-CN.min.js +1 -1
  113. package/lib/locale/lang/zh-CN.umd.js +14 -5
  114. package/lib/style.css +1 -1
  115. package/lib/style.min.css +1 -1
  116. package/lib/table/module/custom/mixin.js +91 -11
  117. package/lib/table/module/custom/mixin.min.js +1 -1
  118. package/lib/table/module/custom/panel.js +376 -158
  119. package/lib/table/module/custom/panel.min.js +1 -1
  120. package/lib/table/src/columnInfo.js +16 -6
  121. package/lib/table/src/columnInfo.min.js +1 -1
  122. package/lib/table/src/methods.js +9 -8
  123. package/lib/table/src/methods.min.js +1 -1
  124. package/lib/table/src/util.js +35 -1
  125. package/lib/table/src/util.min.js +1 -1
  126. package/lib/table/style/style.css +96 -49
  127. package/lib/table/style/style.min.css +1 -1
  128. package/lib/ui/index.js +16 -4
  129. package/lib/ui/index.min.js +1 -1
  130. package/lib/ui/src/log.js +1 -1
  131. package/lib/ui/src/log.min.js +1 -1
  132. package/lib/vxe-table/style/style.css +96 -49
  133. package/lib/vxe-table/style/style.min.css +1 -1
  134. package/package.json +2 -2
  135. package/packages/locale/lang/ar-EG.ts +12 -3
  136. package/packages/locale/lang/de-DE.ts +12 -3
  137. package/packages/locale/lang/en-US.ts +16 -7
  138. package/packages/locale/lang/es-ES.ts +12 -3
  139. package/packages/locale/lang/fr-FR.ts +12 -3
  140. package/packages/locale/lang/hu-HU.ts +12 -3
  141. package/packages/locale/lang/hy-AM.ts +12 -3
  142. package/packages/locale/lang/id-ID.ts +12 -3
  143. package/packages/locale/lang/it-IT.ts +11 -2
  144. package/packages/locale/lang/ja-JP.ts +12 -3
  145. package/packages/locale/lang/ko-KR.ts +12 -3
  146. package/packages/locale/lang/ms-MY.ts +12 -3
  147. package/packages/locale/lang/nb-NO.ts +12 -3
  148. package/packages/locale/lang/pt-BR.ts +12 -3
  149. package/packages/locale/lang/ru-RU.ts +12 -3
  150. package/packages/locale/lang/th-TH.ts +12 -3
  151. package/packages/locale/lang/ug-CN.ts +12 -3
  152. package/packages/locale/lang/uk-UA.ts +12 -3
  153. package/packages/locale/lang/uz-UZ.ts +12 -3
  154. package/packages/locale/lang/vi-VN.ts +11 -2
  155. package/packages/locale/lang/zh-CHT.ts +14 -5
  156. package/packages/locale/lang/zh-CN.ts +14 -5
  157. package/packages/table/module/custom/mixin.ts +85 -14
  158. package/packages/table/module/custom/panel.ts +538 -307
  159. package/packages/table/src/columnInfo.ts +13 -7
  160. package/packages/table/src/methods.ts +116 -60
  161. package/packages/table/src/util.ts +34 -1
  162. package/packages/ui/index.ts +15 -3
  163. package/styles/components/icon.scss +29 -2
  164. package/styles/components/table-module/custom.scss +88 -67
  165. package/styles/icon/iconfont.ttf +0 -0
  166. package/styles/icon/iconfont.woff +0 -0
  167. package/styles/icon/iconfont.woff2 +0 -0
  168. package/styles/theme/base.scss +11 -0
  169. package/es/iconfont.1782890276645.woff +0 -0
  170. package/es/iconfont.1782890276645.woff2 +0 -0
  171. package/lib/iconfont.1782890276645.woff +0 -0
  172. package/lib/iconfont.1782890276645.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
  }
@@ -193,10 +214,21 @@ 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
- if (!isDirectly) {
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
+ }
229
+ }
230
+ });
231
+ } else {
200
232
  _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
201
233
  if (parentColumn) {
202
234
  // 更新子列信息
@@ -221,13 +253,22 @@ var _default = exports.default = {
221
253
  if (allowVisible) {
222
254
  column.visible = column.renderVisible;
223
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
+ }
224
265
  if (allowGroup && allowValues) {
225
266
  column.aggFunc = column.renderAggFn;
226
267
  }
227
268
  });
228
269
  }
229
270
  reactData.isCustomStatus = true;
230
- if (allowGroup && allowValues && !!$xeTable.handlePivotTableAggData) {
271
+ if (allowGroup && !!$xeTable.handlePivotTableAggData) {
231
272
  if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
232
273
  // 更新数据分组
233
274
  if (aggHandleFields.length) {
@@ -262,7 +303,12 @@ var _default = exports.default = {
262
303
  allowVisible,
263
304
  allowSort,
264
305
  allowFixed,
265
- allowResizable
306
+ allowAlign,
307
+ allowHeaderAlign,
308
+ allowFooterAlign,
309
+ allowResizable,
310
+ allowGroup,
311
+ allowValues
266
312
  } = customOpts;
267
313
  _xeUtils.default.eachTree(customColumnList, column => {
268
314
  const colid = column.getKey();
@@ -282,6 +328,21 @@ var _default = exports.default = {
282
328
  if (allowResizable) {
283
329
  column.renderResizeWidth = column.renderWidth;
284
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
+ }
285
346
  }, {
286
347
  children: 'children'
287
348
  });
@@ -306,7 +367,10 @@ var _default = exports.default = {
306
367
  resizable: options === true,
307
368
  fixed: options === true,
308
369
  sort: options === true,
309
- aggFunc: options === true
370
+ aggFunc: options === true,
371
+ align: options === true,
372
+ headerAlign: options === true,
373
+ footerAlign: options === true
310
374
  }, options);
311
375
  const allCols = [];
312
376
  _xeUtils.default.eachTree(collectColumn, column => {
@@ -315,6 +379,7 @@ var _default = exports.default = {
315
379
  }
316
380
  if (opts.fixed) {
317
381
  column.fixed = column.defaultFixed;
382
+ column.renderFixed = column.defaultFixed;
318
383
  }
319
384
  if (opts.sort) {
320
385
  column.renderSortNumber = column.sortNumber;
@@ -326,6 +391,18 @@ var _default = exports.default = {
326
391
  })) {
327
392
  column.visible = column.defaultVisible;
328
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
+ }
329
406
  if (opts.aggFunc) {
330
407
  column.aggFunc = column.defaultAggFunc;
331
408
  column.renderAggFn = column.defaultAggFunc;
@@ -518,6 +595,9 @@ var _default = exports.default = {
518
595
  column.renderFixed = column.fixed;
519
596
  column.renderVisible = column.visible;
520
597
  column.renderResizeWidth = column.renderWidth;
598
+ column.renderAlign = column.align;
599
+ column.renderHeaderAlign = column.headerAlign;
600
+ column.renderFooterAlign = column.footerAlign;
521
601
  sortMaps[colid] = column.renderSortNumber;
522
602
  fixedMaps[colid] = column.fixed;
523
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,s=e.customStore,{mode:l,placement:i,popupOptions:r}=e.computeCustomOpts,l=!("modal"===l||"drawer"===l),{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=l&&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)),l&&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)),s.popupStyle=h,s.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,s=e.$xeGrid,l=e.$xeGantt,s=s||l,{initStore:l,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&&s&&(r=s.$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,l.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(e){var t=this,o=t,s=t;let{customColumnList:l,aggHandleFields:i,rowGroupList:r}=o,{allowVisible:u,allowSort:n,allowFixed:a,allowResizable:d,allowGroup:m,allowValues:c}=t.computeCustomOpts;return e||_xeUtils.default.eachTree(l,(e,t,o,s,l)=>{l?e.fixed=l.fixed:(n&&(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),u&&(e.visible=e.renderVisible),m&&c&&(e.aggFunc=e.renderAggFn)}),o.isCustomStatus=!0,m&&c&&t.handlePivotTableAggData&&(r.length!==i.length||r.some((e,t)=>e.field!==i[t])?i.length?t.setRowGroups(i):t.clearRowGroups():c&&t.handleUpdateAggData()),n&&(s.collectColumn=l),t.saveCustomStore("confirm")},_cancelCustom(){var{customColumnList:e,customStore:t}=this;let{oldSortMaps:l,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],s=i[t]||"";u&&(e.renderVisible=o,e.visible=o),a&&(e.renderFixed=s,e.fixed=s),n&&(e.renderSortNumber=l[t]||0),d&&(e.renderResizeWidth=e.renderWidth)},{children:"children"}),this.$nextTick()},_resetCustom(e){let t=this;var o=t,s=t;let l=o.rowGroupList;var i=s.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"}),s.collectColumn=e,s.tableFullColumn=(0,_util.getColumnList)(e)),o.isCustomStatus=!1,t.handleCustom().then(()=>{var e;u.aggFunc&&t.handlePivotTableAggData&&(((e=t.computeRowGroupFields)||l).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,s=o.customStore,l=o.customColumnList,i=t.computeCustomOpts;let{checkMethod:r,visibleMethod:u}=i,n=!!e;i.immediate?(_xeUtils.default.eachTree(l,e=>{u&&!u({$table:t,column:e})||r&&!r({$table:t,column:e})||(e.visible=n,e.renderVisible=n,e.halfVisible=!1)}),s.isAll=n,o.isCustomStatus=!0,t.handleCustom(),t.saveCustomStore("update:visible")):(_xeUtils.default.eachTree(l,e=>{u&&!u({$table:t,column:e})||r&&!r({$table:t,column:e})||(e.renderVisible=n,e.halfVisible=!1)}),s.isAll=n),t.checkCustomStatus()},checkCustomStatus(){let t=this;var e=t.customStore,o=t.collectColumn;let s=t.computeCustomOpts.checkMethod;e.isAll=o.every(e=>!!s&&!s({$table:t,column:e})||e.renderVisible),e.isIndeterminate=!e.isAll&&o.some(e=>(!s||s({$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),t.dispatchEvent("custom-close",{},e)):(o.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,i=this.collectColumn;if(t.visible){let o={},s={},l={};_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,s[t]=e.fixed,l[t]=e.visible}),t.oldSortMaps=o,t.oldFixedMaps=s,t.oldVisibleMaps=l,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)}}};