vxe-table 4.19.22 → 4.19.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/dist/all.esm.js +630 -332
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/{iconfont.1782890314097.ttf → iconfont.1783046321610.ttf} +0 -0
- package/es/iconfont.1783046321610.woff +0 -0
- package/es/iconfont.1783046321610.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/hook.js +83 -12
- package/es/table/module/custom/panel.js +398 -257
- package/es/table/src/columnInfo.js +14 -8
- package/es/table/src/emits.js +3 -0
- package/es/table/src/table.js +76 -45
- package/es/table/src/util.js +32 -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.1782890314097.ttf → iconfont.1783046321610.ttf} +0 -0
- package/lib/iconfont.1783046321610.woff +0 -0
- package/lib/iconfont.1783046321610.woff2 +0 -0
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +518 -179
- 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/hook.js +90 -10
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +333 -141
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/src/columnInfo.js +17 -7
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/table.js +9 -9
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +38 -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/hook.ts +83 -12
- package/packages/table/module/custom/panel.ts +481 -286
- package/packages/table/src/columnInfo.ts +14 -8
- package/packages/table/src/emits.ts +3 -0
- package/packages/table/src/table.ts +87 -46
- package/packages/table/src/util.ts +35 -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.1782890314097.woff +0 -0
- package/es/iconfont.1782890314097.woff2 +0 -0
- package/lib/iconfont.1782890314097.woff +0 -0
- package/lib/iconfont.1782890314097.woff2 +0 -0
|
@@ -4,6 +4,7 @@ import XEUtils from 'xe-utils';
|
|
|
4
4
|
import { getColumnList } from '../../src/util';
|
|
5
5
|
import { toCssUnit } from '../../../ui/src/dom';
|
|
6
6
|
const tableCustomMethodKeys = ['openCustom', 'closeCustom', 'getCustomVisible', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox'];
|
|
7
|
+
const customColumnCssKeys = ['checkbox', 'sort', 'title', 'width', 'fixed', 'align', 'header-align', 'footer-align'];
|
|
7
8
|
VxeUI.hooks.add('tableCustomModule', {
|
|
8
9
|
setupTable($xeTable) {
|
|
9
10
|
const { reactData, internalData } = $xeTable;
|
|
@@ -17,14 +18,15 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
17
18
|
const customOpts = computeCustomOpts.value;
|
|
18
19
|
const { mode, placement, popupOptions } = customOpts;
|
|
19
20
|
const showSimple = !(mode === 'modal' || mode === 'drawer');
|
|
20
|
-
const { transfer, maxHeight } = popupOptions || {};
|
|
21
|
+
const { transfer, minWidth, maxWidth, maxHeight } = popupOptions || {};
|
|
21
22
|
const customSimpleMode = computeCustomSimpleMode.value;
|
|
22
23
|
const showCustomSimpleOutside = customSimpleMode === 'outside';
|
|
23
24
|
const bodyEl = document.documentElement;
|
|
24
25
|
let wrapperEl = refElem.value;
|
|
25
26
|
let popupTop = 0;
|
|
26
27
|
let popupMaxHeight = 0;
|
|
27
|
-
const
|
|
28
|
+
const defPupStys = {};
|
|
29
|
+
const panePupStys = {};
|
|
28
30
|
if ($xeGantt) {
|
|
29
31
|
const { refGanttContainerElem } = $xeGantt.getRefMaps();
|
|
30
32
|
const ganttContainerElem = refGanttContainerElem.value;
|
|
@@ -57,24 +59,41 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
57
59
|
}
|
|
58
60
|
if (!placement || !(['left', 'right', 'bottom-left', 'bottom-right'].includes(placement))) {
|
|
59
61
|
if (popupTop) {
|
|
60
|
-
|
|
62
|
+
defPupStys.top = toCssUnit(popupTop);
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
if (showSimple && transfer) {
|
|
64
66
|
if (placement === 'bottom-left' || placement === 'bottom-right') {
|
|
65
|
-
|
|
67
|
+
defPupStys.bottom = toCssUnit(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1);
|
|
66
68
|
}
|
|
67
69
|
if (placement === 'top-left' || placement === 'bottom-left') {
|
|
68
|
-
|
|
70
|
+
defPupStys.left = toCssUnit(tableRect.left);
|
|
69
71
|
}
|
|
70
72
|
else if (!placement || placement === 'top-right' || placement === 'bottom-right') {
|
|
71
|
-
|
|
73
|
+
defPupStys.right = toCssUnit(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1);
|
|
72
74
|
}
|
|
73
75
|
}
|
|
76
|
+
// 同步表格的css变量到弹窗中
|
|
77
|
+
const bodyComputeStyle = getComputedStyle(bodyEl);
|
|
78
|
+
const tableComputeStyle = getComputedStyle(wrapperEl);
|
|
79
|
+
customColumnCssKeys.forEach(key => {
|
|
80
|
+
const currCssKey = `--vxe-ui-vxe-table-custom-column-${key}-${key === 'title' ? 'min-' : ''}width`;
|
|
81
|
+
const currCssVal = tableComputeStyle.getPropertyValue(currCssKey);
|
|
82
|
+
if (currCssVal && currCssVal !== bodyComputeStyle.getPropertyValue(currCssKey)) {
|
|
83
|
+
panePupStys[currCssKey] = currCssVal;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
if (minWidth) {
|
|
87
|
+
defPupStys['--vxe-ui-vxe-table-custom-default-min-width'] = toCssUnit(minWidth);
|
|
88
|
+
}
|
|
89
|
+
if (maxWidth) {
|
|
90
|
+
defPupStys['--vxe-ui-vxe-table-custom-default-max-width'] = toCssUnit(maxWidth);
|
|
91
|
+
}
|
|
74
92
|
if (popupMxHeight) {
|
|
75
|
-
|
|
93
|
+
defPupStys.maxHeight = toCssUnit(popupMxHeight);
|
|
76
94
|
}
|
|
77
|
-
customStore.
|
|
95
|
+
customStore.defPopupStyle = defPupStys;
|
|
96
|
+
customStore.panePopupStyle = panePupStys;
|
|
78
97
|
customStore.maxHeight = popupMxHeight;
|
|
79
98
|
return nextTick();
|
|
80
99
|
};
|
|
@@ -123,6 +142,9 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
123
142
|
column.renderFixed = column.fixed;
|
|
124
143
|
column.renderVisible = column.visible;
|
|
125
144
|
column.renderResizeWidth = column.renderWidth;
|
|
145
|
+
column.renderAlign = column.align;
|
|
146
|
+
column.renderHeaderAlign = column.headerAlign;
|
|
147
|
+
column.renderFooterAlign = column.footerAlign;
|
|
126
148
|
sortMaps[colid] = column.renderSortNumber;
|
|
127
149
|
fixedMaps[colid] = column.fixed;
|
|
128
150
|
visibleMaps[colid] = column.visible;
|
|
@@ -154,8 +176,17 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
154
176
|
const saveCustom = (isDirectly) => {
|
|
155
177
|
const { customColumnList, aggHandleFields, rowGroupList } = reactData;
|
|
156
178
|
const customOpts = computeCustomOpts.value;
|
|
157
|
-
const { allowVisible, allowSort, allowFixed, allowResizable, allowGroup, allowValues } = customOpts;
|
|
158
|
-
if (
|
|
179
|
+
const { allowVisible, allowSort, allowFixed, allowResizable, allowAlign, allowHeaderAlign, allowFooterAlign, allowGroup, allowValues } = customOpts;
|
|
180
|
+
if (isDirectly) {
|
|
181
|
+
XEUtils.eachTree(customColumnList, (column) => {
|
|
182
|
+
if (allowResizable) {
|
|
183
|
+
if (column.renderVisible && (!column.children || !column.children.length)) {
|
|
184
|
+
column.resizeWidth = Math.max(0, XEUtils.toNumber(column.renderWidth));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
159
190
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
|
|
160
191
|
if (parentColumn) {
|
|
161
192
|
// 更新子列信息
|
|
@@ -181,6 +212,15 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
181
212
|
if (allowVisible) {
|
|
182
213
|
column.visible = column.renderVisible;
|
|
183
214
|
}
|
|
215
|
+
if (allowAlign) {
|
|
216
|
+
column.align = column.renderAlign;
|
|
217
|
+
}
|
|
218
|
+
if (allowHeaderAlign) {
|
|
219
|
+
column.headerAlign = column.renderHeaderAlign;
|
|
220
|
+
}
|
|
221
|
+
if (allowFooterAlign) {
|
|
222
|
+
column.footerAlign = column.renderFooterAlign;
|
|
223
|
+
}
|
|
184
224
|
if (allowGroup && allowValues) {
|
|
185
225
|
column.aggFunc = column.renderAggFn;
|
|
186
226
|
}
|
|
@@ -211,7 +251,7 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
211
251
|
const { customColumnList, customStore } = reactData;
|
|
212
252
|
const { oldSortMaps, oldFixedMaps, oldVisibleMaps } = customStore;
|
|
213
253
|
const customOpts = computeCustomOpts.value;
|
|
214
|
-
const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts;
|
|
254
|
+
const { allowVisible, allowSort, allowFixed, allowAlign, allowHeaderAlign, allowFooterAlign, allowResizable, allowGroup, allowValues } = customOpts;
|
|
215
255
|
XEUtils.eachTree(customColumnList, column => {
|
|
216
256
|
const colid = column.getKey();
|
|
217
257
|
const visible = !!oldVisibleMaps[colid];
|
|
@@ -230,6 +270,21 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
230
270
|
if (allowResizable) {
|
|
231
271
|
column.renderResizeWidth = column.renderWidth;
|
|
232
272
|
}
|
|
273
|
+
if (allowAlign) {
|
|
274
|
+
column.align = column.renderAlign;
|
|
275
|
+
}
|
|
276
|
+
if (allowHeaderAlign) {
|
|
277
|
+
column.headerAlign = column.renderHeaderAlign;
|
|
278
|
+
}
|
|
279
|
+
if (allowFooterAlign) {
|
|
280
|
+
column.footerAlign = column.renderFooterAlign;
|
|
281
|
+
}
|
|
282
|
+
if (allowGroup) {
|
|
283
|
+
// 无
|
|
284
|
+
}
|
|
285
|
+
if (allowValues) {
|
|
286
|
+
// 无
|
|
287
|
+
}
|
|
233
288
|
}, { children: 'children' });
|
|
234
289
|
return nextTick();
|
|
235
290
|
};
|
|
@@ -292,7 +347,10 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
292
347
|
resizable: options === true,
|
|
293
348
|
fixed: options === true,
|
|
294
349
|
sort: options === true,
|
|
295
|
-
aggFunc: options === true
|
|
350
|
+
aggFunc: options === true,
|
|
351
|
+
align: options === true,
|
|
352
|
+
headerAlign: options === true,
|
|
353
|
+
footerAlign: options === true
|
|
296
354
|
}, options);
|
|
297
355
|
const allCols = [];
|
|
298
356
|
XEUtils.eachTree(collectColumn, (column) => {
|
|
@@ -301,6 +359,7 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
301
359
|
}
|
|
302
360
|
if (opts.fixed) {
|
|
303
361
|
column.fixed = column.defaultFixed;
|
|
362
|
+
column.renderFixed = column.defaultFixed;
|
|
304
363
|
}
|
|
305
364
|
if (opts.sort) {
|
|
306
365
|
column.renderSortNumber = column.sortNumber;
|
|
@@ -309,6 +368,18 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
309
368
|
if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
|
|
310
369
|
column.visible = column.defaultVisible;
|
|
311
370
|
}
|
|
371
|
+
if (opts.align) {
|
|
372
|
+
column.align = column.defaultAlign;
|
|
373
|
+
column.renderAlign = column.defaultAlign;
|
|
374
|
+
}
|
|
375
|
+
if (opts.headerAlign) {
|
|
376
|
+
column.headerAlign = column.defaultHeaderAlign;
|
|
377
|
+
column.renderHeaderAlign = column.defaultHeaderAlign;
|
|
378
|
+
}
|
|
379
|
+
if (opts.footerAlign) {
|
|
380
|
+
column.footerAlign = column.defaultFooterAlign;
|
|
381
|
+
column.renderFooterAlign = column.defaultFooterAlign;
|
|
382
|
+
}
|
|
312
383
|
if (opts.aggFunc) {
|
|
313
384
|
column.aggFunc = column.defaultAggFunc;
|
|
314
385
|
column.renderAggFn = column.defaultAggFunc;
|