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.
- package/es/{iconfont.1782656027274.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 +16 -3
- package/es/locale/lang/de-DE.js +16 -3
- package/es/locale/lang/en-US.js +20 -7
- package/es/locale/lang/es-ES.js +16 -3
- package/es/locale/lang/fr-FR.js +16 -3
- package/es/locale/lang/hu-HU.js +16 -3
- package/es/locale/lang/hy-AM.js +16 -3
- package/es/locale/lang/id-ID.js +16 -3
- package/es/locale/lang/it-IT.js +15 -2
- package/es/locale/lang/ja-JP.js +16 -3
- package/es/locale/lang/ko-KR.js +16 -3
- package/es/locale/lang/ms-MY.js +16 -3
- package/es/locale/lang/nb-NO.js +16 -3
- package/es/locale/lang/pt-BR.js +16 -3
- package/es/locale/lang/ru-RU.js +16 -3
- package/es/locale/lang/th-TH.js +16 -3
- package/es/locale/lang/ug-CN.js +16 -3
- package/es/locale/lang/uk-UA.js +16 -3
- package/es/locale/lang/uz-UZ.js +16 -3
- package/es/locale/lang/vi-VN.js +15 -2
- package/es/locale/lang/zh-CHT.js +18 -5
- package/es/locale/lang/zh-CN.js +18 -5
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +115 -38
- package/es/table/module/custom/panel.js +492 -312
- package/es/table/module/edit/mixin.js +12 -6
- package/es/table/src/columnInfo.js +13 -7
- package/es/table/src/methods.js +105 -60
- 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.1782656027274.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 +612 -226
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +16 -3
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +16 -3
- package/lib/locale/lang/de-DE.js +16 -3
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +16 -3
- package/lib/locale/lang/en-US.js +20 -7
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +20 -7
- package/lib/locale/lang/es-ES.js +16 -3
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +16 -3
- package/lib/locale/lang/fr-FR.js +16 -3
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +16 -3
- package/lib/locale/lang/hu-HU.js +16 -3
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +16 -3
- package/lib/locale/lang/hy-AM.js +16 -3
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +16 -3
- package/lib/locale/lang/id-ID.js +16 -3
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +16 -3
- package/lib/locale/lang/it-IT.js +15 -2
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +15 -2
- package/lib/locale/lang/ja-JP.js +16 -3
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +16 -3
- package/lib/locale/lang/ko-KR.js +16 -3
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +16 -3
- package/lib/locale/lang/ms-MY.js +16 -3
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +16 -3
- package/lib/locale/lang/nb-NO.js +16 -3
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +16 -3
- package/lib/locale/lang/pt-BR.js +16 -3
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +16 -3
- package/lib/locale/lang/ru-RU.js +16 -3
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +16 -3
- package/lib/locale/lang/th-TH.js +16 -3
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +16 -3
- package/lib/locale/lang/ug-CN.js +16 -3
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +16 -3
- package/lib/locale/lang/uk-UA.js +16 -3
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +16 -3
- package/lib/locale/lang/uz-UZ.js +16 -3
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +16 -3
- package/lib/locale/lang/vi-VN.js +15 -2
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +15 -2
- package/lib/locale/lang/zh-CHT.js +18 -5
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +18 -5
- package/lib/locale/lang/zh-CN.js +18 -5
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +18 -5
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +121 -35
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +383 -158
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +12 -6
- package/lib/table/src/columnInfo.js +16 -6
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +11 -10
- 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 +16 -3
- package/packages/locale/lang/de-DE.ts +16 -3
- package/packages/locale/lang/en-US.ts +20 -7
- package/packages/locale/lang/es-ES.ts +16 -3
- package/packages/locale/lang/fr-FR.ts +16 -3
- package/packages/locale/lang/hu-HU.ts +16 -3
- package/packages/locale/lang/hy-AM.ts +16 -3
- package/packages/locale/lang/id-ID.ts +16 -3
- package/packages/locale/lang/it-IT.ts +15 -2
- package/packages/locale/lang/ja-JP.ts +16 -3
- package/packages/locale/lang/ko-KR.ts +16 -3
- package/packages/locale/lang/ms-MY.ts +16 -3
- package/packages/locale/lang/nb-NO.ts +16 -3
- package/packages/locale/lang/pt-BR.ts +16 -3
- package/packages/locale/lang/ru-RU.ts +16 -3
- package/packages/locale/lang/th-TH.ts +16 -3
- package/packages/locale/lang/ug-CN.ts +16 -3
- package/packages/locale/lang/uk-UA.ts +16 -3
- package/packages/locale/lang/uz-UZ.ts +16 -3
- package/packages/locale/lang/vi-VN.ts +15 -2
- package/packages/locale/lang/zh-CHT.ts +18 -5
- package/packages/locale/lang/zh-CN.ts +18 -5
- package/packages/table/module/custom/mixin.ts +115 -38
- package/packages/table/module/custom/panel.ts +545 -307
- package/packages/table/module/edit/mixin.ts +18 -6
- package/packages/table/src/columnInfo.ts +13 -7
- package/packages/table/src/methods.ts +120 -61
- package/packages/table/src/table.ts +6 -6
- 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 +13 -1
- package/es/iconfont.1782656027274.woff +0 -0
- package/es/iconfont.1782656027274.woff2 +0 -0
- package/lib/iconfont.1782656027274.woff +0 -0
- 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
|
|
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
|
}
|
|
@@ -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
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
|
|
209
|
-
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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 &&
|
|
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
|
-
|
|
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,
|
|
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)}}};
|