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.
- package/es/{iconfont.1782890276645.ttf → iconfont.1783046294821.ttf} +0 -0
- package/es/iconfont.1783046294821.woff +0 -0
- package/es/iconfont.1783046294821.woff2 +0 -0
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +12 -3
- package/es/locale/lang/de-DE.js +12 -3
- package/es/locale/lang/en-US.js +16 -7
- package/es/locale/lang/es-ES.js +12 -3
- package/es/locale/lang/fr-FR.js +12 -3
- package/es/locale/lang/hu-HU.js +12 -3
- package/es/locale/lang/hy-AM.js +12 -3
- package/es/locale/lang/id-ID.js +12 -3
- package/es/locale/lang/it-IT.js +11 -2
- package/es/locale/lang/ja-JP.js +12 -3
- package/es/locale/lang/ko-KR.js +12 -3
- package/es/locale/lang/ms-MY.js +12 -3
- package/es/locale/lang/nb-NO.js +12 -3
- package/es/locale/lang/pt-BR.js +12 -3
- package/es/locale/lang/ru-RU.js +12 -3
- package/es/locale/lang/th-TH.js +12 -3
- package/es/locale/lang/ug-CN.js +12 -3
- package/es/locale/lang/uk-UA.js +12 -3
- package/es/locale/lang/uz-UZ.js +12 -3
- package/es/locale/lang/vi-VN.js +11 -2
- package/es/locale/lang/zh-CHT.js +14 -5
- package/es/locale/lang/zh-CN.js +14 -5
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +84 -13
- package/es/table/module/custom/panel.js +485 -312
- package/es/table/src/columnInfo.js +13 -7
- package/es/table/src/methods.js +100 -59
- package/es/table/src/util.js +31 -1
- package/es/table/style.css +96 -49
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +16 -4
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +96 -49
- package/es/vxe-table/style.min.css +1 -1
- package/lib/{iconfont.1782890276645.ttf → iconfont.1783046294821.ttf} +0 -0
- package/lib/iconfont.1783046294821.woff +0 -0
- package/lib/iconfont.1783046294821.woff2 +0 -0
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +557 -194
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +12 -3
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +12 -3
- package/lib/locale/lang/de-DE.js +12 -3
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +12 -3
- package/lib/locale/lang/en-US.js +16 -7
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +16 -7
- package/lib/locale/lang/es-ES.js +12 -3
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +12 -3
- package/lib/locale/lang/fr-FR.js +12 -3
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +12 -3
- package/lib/locale/lang/hu-HU.js +12 -3
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +12 -3
- package/lib/locale/lang/hy-AM.js +12 -3
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +12 -3
- package/lib/locale/lang/id-ID.js +12 -3
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +12 -3
- package/lib/locale/lang/it-IT.js +11 -2
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +11 -2
- package/lib/locale/lang/ja-JP.js +12 -3
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +12 -3
- package/lib/locale/lang/ko-KR.js +12 -3
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +12 -3
- package/lib/locale/lang/ms-MY.js +12 -3
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +12 -3
- package/lib/locale/lang/nb-NO.js +12 -3
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +12 -3
- package/lib/locale/lang/pt-BR.js +12 -3
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +12 -3
- package/lib/locale/lang/ru-RU.js +12 -3
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +12 -3
- package/lib/locale/lang/th-TH.js +12 -3
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +12 -3
- package/lib/locale/lang/ug-CN.js +12 -3
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +12 -3
- package/lib/locale/lang/uk-UA.js +12 -3
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +12 -3
- package/lib/locale/lang/uz-UZ.js +12 -3
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +12 -3
- package/lib/locale/lang/vi-VN.js +11 -2
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +11 -2
- package/lib/locale/lang/zh-CHT.js +14 -5
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +14 -5
- package/lib/locale/lang/zh-CN.js +14 -5
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +14 -5
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +91 -11
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +376 -158
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/src/columnInfo.js +16 -6
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +9 -8
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +35 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +96 -49
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +16 -4
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +96 -49
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +12 -3
- package/packages/locale/lang/de-DE.ts +12 -3
- package/packages/locale/lang/en-US.ts +16 -7
- package/packages/locale/lang/es-ES.ts +12 -3
- package/packages/locale/lang/fr-FR.ts +12 -3
- package/packages/locale/lang/hu-HU.ts +12 -3
- package/packages/locale/lang/hy-AM.ts +12 -3
- package/packages/locale/lang/id-ID.ts +12 -3
- package/packages/locale/lang/it-IT.ts +11 -2
- package/packages/locale/lang/ja-JP.ts +12 -3
- package/packages/locale/lang/ko-KR.ts +12 -3
- package/packages/locale/lang/ms-MY.ts +12 -3
- package/packages/locale/lang/nb-NO.ts +12 -3
- package/packages/locale/lang/pt-BR.ts +12 -3
- package/packages/locale/lang/ru-RU.ts +12 -3
- package/packages/locale/lang/th-TH.ts +12 -3
- package/packages/locale/lang/ug-CN.ts +12 -3
- package/packages/locale/lang/uk-UA.ts +12 -3
- package/packages/locale/lang/uz-UZ.ts +12 -3
- package/packages/locale/lang/vi-VN.ts +11 -2
- package/packages/locale/lang/zh-CHT.ts +14 -5
- package/packages/locale/lang/zh-CN.ts +14 -5
- package/packages/table/module/custom/mixin.ts +85 -14
- package/packages/table/module/custom/panel.ts +538 -307
- package/packages/table/src/columnInfo.ts +13 -7
- package/packages/table/src/methods.ts +116 -60
- package/packages/table/src/util.ts +34 -1
- package/packages/ui/index.ts +15 -3
- package/styles/components/icon.scss +29 -2
- package/styles/components/table-module/custom.scss +88 -67
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/styles/theme/base.scss +11 -0
- package/es/iconfont.1782890276645.woff +0 -0
- package/es/iconfont.1782890276645.woff2 +0 -0
- package/lib/iconfont.1782890276645.woff +0 -0
- 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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
78
|
+
defPupStys.left = (0, _dom.toCssUnit)(tableRect.left);
|
|
75
79
|
} else if (!placement || placement === 'top-right' || placement === 'bottom-right') {
|
|
76
|
-
|
|
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
|
-
|
|
100
|
+
defPupStys.maxHeight = (0, _dom.toCssUnit)(popupMxHeight);
|
|
81
101
|
}
|
|
82
|
-
customStore.
|
|
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 (
|
|
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 &&
|
|
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
|
-
|
|
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,
|
|
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)}}};
|