vxe-table 3.9.0-rc.9 → 3.9.1
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/README.md +80 -9
- package/es/grid/src/grid.js +116 -62
- package/es/grid/style.css +0 -1
- package/es/grid/style.min.css +1 -1
- package/es/index.esm.js +22 -3
- package/es/locale/lang/en-US.js +6 -2
- package/es/locale/lang/es-ES.js +5 -1
- package/es/locale/lang/hu-HU.js +5 -1
- package/es/locale/lang/ja-JP.js +5 -1
- package/es/locale/lang/ko-KR.js +5 -1
- package/es/locale/lang/pt-BR.js +5 -1
- package/es/locale/lang/ru-RU.js +5 -1
- package/es/locale/lang/uk-UA.js +5 -1
- package/es/locale/lang/vi-VN.js +5 -1
- package/es/locale/lang/zh-CHT.js +5 -1
- package/es/locale/lang/zh-CN.js +5 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/panel.js +183 -173
- package/es/table/module/edit/mixin.js +35 -40
- package/es/table/module/export/export-panel.js +32 -4
- package/es/table/module/export/import-panel.js +25 -6
- package/es/table/module/export/mixin.js +11 -11
- package/es/table/module/menu/mixin.js +2 -2
- package/es/table/module/validator/mixin.js +4 -4
- package/es/table/render/index.js +17 -11
- package/es/table/src/body.js +1 -0
- package/es/table/src/columnInfo.js +3 -3
- package/es/table/src/methods.js +69 -55
- package/es/table/src/props.js +65 -15
- package/es/table/src/table.js +63 -29
- package/es/table/src/util.js +3 -2
- package/es/table/style.css +37 -48
- package/es/table/style.min.css +1 -1
- package/es/toolbar/src/toolbar.js +21 -7
- package/es/toolbar/style.css +0 -1
- package/es/toolbar/style.min.css +1 -1
- package/es/ui/index.js +5 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-grid/style.css +0 -1
- package/es/vxe-grid/style.min.css +1 -1
- package/es/vxe-table/style.css +37 -48
- package/es/vxe-table/style.min.css +1 -1
- package/es/vxe-toolbar/style.css +0 -1
- package/es/vxe-toolbar/style.min.css +1 -1
- package/lib/colgroup/index.js +3 -3
- package/lib/colgroup/index.min.js +1 -1
- package/lib/column/index.js +3 -3
- package/lib/column/index.min.js +1 -1
- package/lib/components.js +9 -11
- package/lib/components.min.js +1 -1
- package/lib/grid/index.js +3 -3
- package/lib/grid/index.min.js +1 -1
- package/lib/grid/src/grid.js +577 -487
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/style/style.css +0 -1
- package/lib/grid/style/style.min.css +1 -1
- package/lib/index.common.js +3 -4
- package/lib/index.umd.js +9148 -17246
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +6 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +6 -2
- package/lib/locale/lang/es-ES.js +5 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +5 -1
- package/lib/locale/lang/hu-HU.js +5 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +5 -1
- package/lib/locale/lang/ja-JP.js +5 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +5 -1
- package/lib/locale/lang/ko-KR.js +5 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +5 -1
- package/lib/locale/lang/pt-BR.js +5 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +5 -1
- package/lib/locale/lang/ru-RU.js +5 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +5 -1
- package/lib/locale/lang/uk-UA.js +5 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +5 -1
- package/lib/locale/lang/vi-VN.js +5 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +5 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +5 -1
- package/lib/locale/lang/zh-CN.js +5 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +5 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/index.js +4 -4
- package/lib/table/index.min.js +1 -1
- package/lib/table/module/custom/mixin.js +53 -44
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +310 -239
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +434 -383
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +136 -106
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +75 -54
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +592 -597
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/export/util.js +6 -4
- package/lib/table/module/export/util.min.js +1 -1
- package/lib/table/module/filter/mixin.js +147 -118
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +86 -65
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +163 -151
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +125 -114
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +36 -34
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +225 -214
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +401 -297
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +411 -349
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +470 -344
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +10 -10
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +46 -55
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +157 -132
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/group.js +1 -1
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/header.js +170 -153
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +2770 -2491
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +33 -74
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +436 -395
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +143 -131
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +37 -48
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/index.js +3 -3
- package/lib/toolbar/index.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +332 -284
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/toolbar/style/style.css +0 -1
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/ui/index.js +50 -41
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/comp.js +2 -3
- package/lib/ui/src/comp.min.js +1 -1
- package/lib/ui/src/dom.js +29 -28
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +6 -4
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/utils.js +7 -7
- package/lib/v-x-e-table/index.js +3 -4
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/vxe-colgroup/index.js +3 -4
- package/lib/vxe-colgroup/index.min.js +1 -1
- package/lib/vxe-column/index.js +3 -4
- package/lib/vxe-column/index.min.js +1 -1
- package/lib/vxe-grid/index.js +3 -4
- package/lib/vxe-grid/index.min.js +1 -1
- package/lib/vxe-grid/style/style.css +0 -1
- package/lib/vxe-grid/style/style.min.css +1 -1
- package/lib/vxe-table/index.js +3 -4
- package/lib/vxe-table/index.min.js +1 -1
- package/lib/vxe-table/style/style.css +37 -48
- package/lib/vxe-table/style/style.min.css +1 -1
- package/lib/vxe-toolbar/index.js +3 -4
- package/lib/vxe-toolbar/index.min.js +1 -1
- package/lib/vxe-toolbar/style/style.css +0 -1
- package/lib/vxe-toolbar/style/style.min.css +1 -1
- package/lib/vxe-ui/index.js +3 -4
- package/lib/vxe-ui/index.min.js +1 -1
- package/lib/vxe-v-x-e-table/index.js +3 -4
- package/lib/vxe-v-x-e-table/index.min.js +1 -1
- package/package.json +5 -4
- package/packages/grid/src/grid.ts +123 -61
- package/packages/locale/lang/en-US.ts +6 -2
- package/packages/locale/lang/es-ES.ts +5 -1
- package/packages/locale/lang/hu-HU.ts +5 -1
- package/packages/locale/lang/ja-JP.ts +5 -1
- package/packages/locale/lang/ko-KR.ts +5 -1
- package/packages/locale/lang/pt-BR.ts +5 -1
- package/packages/locale/lang/ru-RU.ts +5 -1
- package/packages/locale/lang/uk-UA.ts +5 -1
- package/packages/locale/lang/vi-VN.ts +5 -1
- package/packages/locale/lang/zh-CHT.ts +5 -1
- package/packages/locale/lang/zh-CN.ts +5 -1
- package/packages/table/module/custom/panel.ts +186 -175
- package/packages/table/module/edit/mixin.ts +34 -39
- package/packages/table/module/export/export-panel.ts +36 -4
- package/packages/table/module/export/import-panel.ts +29 -6
- package/packages/table/module/export/mixin.ts +11 -11
- package/packages/table/module/menu/mixin.ts +2 -2
- package/packages/table/module/validator/mixin.ts +4 -4
- package/packages/table/render/index.ts +20 -11
- package/packages/table/src/body.ts +1 -0
- package/packages/table/src/columnInfo.ts +3 -3
- package/packages/table/src/methods.ts +70 -55
- package/packages/table/src/props.ts +68 -15
- package/packages/table/src/table.ts +71 -26
- package/packages/table/src/util.ts +3 -2
- package/packages/toolbar/src/toolbar.ts +21 -7
- package/packages/ui/index.ts +3 -1
- package/styles/components/table.scss +82 -17
- package/types/all.d.ts +1 -0
- /package/es/{iconfont.1726453742001.ttf → iconfont.1728483486168.ttf} +0 -0
- /package/es/{iconfont.1726453742001.woff → iconfont.1728483486168.woff} +0 -0
- /package/es/{iconfont.1726453742001.woff2 → iconfont.1728483486168.woff2} +0 -0
- /package/lib/{iconfont.1726453742001.ttf → iconfont.1728483486168.ttf} +0 -0
- /package/lib/{iconfont.1726453742001.woff → iconfont.1728483486168.woff} +0 -0
- /package/lib/{iconfont.1726453742001.woff2 → iconfont.1728483486168.woff2} +0 -0
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { VxeUI } from '../../../ui';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import { parseFile } from '../../../ui/src/utils';
|
|
4
|
-
|
|
5
|
-
const { getI18n, getIcon } = VxeUI;
|
|
4
|
+
import { errLog } from '../../../ui/src/log';
|
|
5
|
+
const { getI18n, getIcon, globalMixins } = VxeUI;
|
|
6
6
|
export default {
|
|
7
7
|
name: 'VxeTableImportPanel',
|
|
8
|
+
mixins: [
|
|
9
|
+
globalMixins.sizeMixin
|
|
10
|
+
],
|
|
8
11
|
props: {
|
|
9
12
|
defaultOptions: Object,
|
|
10
13
|
storeData: Object
|
|
@@ -19,9 +22,6 @@ export default {
|
|
|
19
22
|
};
|
|
20
23
|
},
|
|
21
24
|
computed: {
|
|
22
|
-
vSize() {
|
|
23
|
-
return this.size || this.$parent.size || this.$parent.vSize;
|
|
24
|
-
},
|
|
25
25
|
selectName() {
|
|
26
26
|
return `${this.storeData.filename}.${this.storeData.type}`;
|
|
27
27
|
},
|
|
@@ -38,6 +38,25 @@ export default {
|
|
|
38
38
|
return `*.${typeList.map((item) => item.value).join(', *.')}`;
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
+
created() {
|
|
42
|
+
const $xeTableImportPanel = this;
|
|
43
|
+
if (process.env.NODE_ENV === 'development') {
|
|
44
|
+
const VxeUIModalComponent = VxeUI.getComponent('VxeModal');
|
|
45
|
+
const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
|
|
46
|
+
const VxeUISelectComponent = VxeUI.getComponent('VxeSelect');
|
|
47
|
+
$xeTableImportPanel.$nextTick(() => {
|
|
48
|
+
if (!VxeUIModalComponent) {
|
|
49
|
+
errLog('vxe.error.reqComp', ['vxe-modal']);
|
|
50
|
+
}
|
|
51
|
+
if (!VxeUIButtonComponent) {
|
|
52
|
+
errLog('vxe.error.reqComp', ['vxe-button']);
|
|
53
|
+
}
|
|
54
|
+
if (!VxeUISelectComponent) {
|
|
55
|
+
errLog('vxe.error.reqComp', ['vxe-select']);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
},
|
|
41
60
|
render(h) {
|
|
42
61
|
const { hasFile, parseTypeLabel, defaultOptions, storeData, selectName } = this;
|
|
43
62
|
return h('vxe-modal', {
|
|
@@ -45,7 +64,7 @@ export default {
|
|
|
45
64
|
props: {
|
|
46
65
|
value: storeData.visible,
|
|
47
66
|
title: getI18n('vxe.import.impTitle'),
|
|
48
|
-
width:
|
|
67
|
+
width: 540,
|
|
49
68
|
mask: true,
|
|
50
69
|
lockView: true,
|
|
51
70
|
showFooter: false,
|
|
@@ -559,7 +559,7 @@ function downloadFile($xetable, opts, content) {
|
|
|
559
559
|
saveLocalFile({ filename, type, content }).then(() => {
|
|
560
560
|
if (opts.message !== false) {
|
|
561
561
|
// 检测弹窗模块
|
|
562
|
-
if (process.env.
|
|
562
|
+
if (process.env.NODE_ENV === 'development') {
|
|
563
563
|
if (!VxeUI.modal) {
|
|
564
564
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
565
565
|
}
|
|
@@ -777,7 +777,7 @@ function handleImport($xetable, content, opts) {
|
|
|
777
777
|
}
|
|
778
778
|
if (opts.message !== false) {
|
|
779
779
|
// 检测弹窗模块
|
|
780
|
-
if (process.env.
|
|
780
|
+
if (process.env.NODE_ENV === 'development') {
|
|
781
781
|
if (!VxeUI.modal) {
|
|
782
782
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
783
783
|
}
|
|
@@ -793,7 +793,7 @@ function handleImport($xetable, content, opts) {
|
|
|
793
793
|
}
|
|
794
794
|
else if (opts.message !== false) {
|
|
795
795
|
// 检测弹窗模块
|
|
796
|
-
if (process.env.
|
|
796
|
+
if (process.env.NODE_ENV === 'development') {
|
|
797
797
|
if (!VxeUI.modal) {
|
|
798
798
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
799
799
|
}
|
|
@@ -812,7 +812,7 @@ function handleFileImport($xetable, file, opts) {
|
|
|
812
812
|
if (!importMethod && !XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)) {
|
|
813
813
|
if (opts.message !== false) {
|
|
814
814
|
// 检测弹窗模块
|
|
815
|
-
if (process.env.
|
|
815
|
+
if (process.env.NODE_ENV === 'development') {
|
|
816
816
|
if (!VxeUI.modal) {
|
|
817
817
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
818
818
|
}
|
|
@@ -865,7 +865,7 @@ function handleFileImport($xetable, file, opts) {
|
|
|
865
865
|
}
|
|
866
866
|
else {
|
|
867
867
|
// 不支持的浏览器
|
|
868
|
-
if (process.env.
|
|
868
|
+
if (process.env.NODE_ENV === 'development') {
|
|
869
869
|
errLog('vxe.error.notExp');
|
|
870
870
|
}
|
|
871
871
|
_importResolve({ status: true });
|
|
@@ -921,7 +921,7 @@ export function readLocalFile(options = {}) {
|
|
|
921
921
|
else {
|
|
922
922
|
if (options.message !== false) {
|
|
923
923
|
// 检测弹窗模块
|
|
924
|
-
if (process.env.
|
|
924
|
+
if (process.env.NODE_ENV === 'development') {
|
|
925
925
|
if (!VxeUI.modal) {
|
|
926
926
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
927
927
|
}
|
|
@@ -1239,7 +1239,7 @@ export default {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
// 检查类型,如果为自定义导出,则不需要校验类型
|
|
1241
1241
|
if (!opts.exportMethod && !XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)) {
|
|
1242
|
-
if (process.env.
|
|
1242
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1243
1243
|
errLog('vxe.error.notType', [type]);
|
|
1244
1244
|
}
|
|
1245
1245
|
const params = { status: false };
|
|
@@ -1262,7 +1262,7 @@ export default {
|
|
|
1262
1262
|
}
|
|
1263
1263
|
}
|
|
1264
1264
|
else if (mode === 'all') {
|
|
1265
|
-
if (process.env.
|
|
1265
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1266
1266
|
if (!$xegrid) {
|
|
1267
1267
|
warnLog('vxe.error.errProp', ['all', 'mode=current,selected']);
|
|
1268
1268
|
}
|
|
@@ -1272,7 +1272,7 @@ export default {
|
|
|
1272
1272
|
const ajaxMethods = ajax.queryAll;
|
|
1273
1273
|
const queryAllSuccessMethods = ajax.queryAllSuccess;
|
|
1274
1274
|
const queryAllErrorMethods = ajax.queryAllError;
|
|
1275
|
-
if (process.env.
|
|
1275
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1276
1276
|
if (!ajaxMethods) {
|
|
1277
1277
|
warnLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll']);
|
|
1278
1278
|
}
|
|
@@ -1443,7 +1443,7 @@ export default {
|
|
|
1443
1443
|
},
|
|
1444
1444
|
_openExport(options) {
|
|
1445
1445
|
const { exportOpts } = this;
|
|
1446
|
-
if (process.env.
|
|
1446
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1447
1447
|
if (!this.exportConfig) {
|
|
1448
1448
|
errLog('vxe.error.reqProp', ['export-config']);
|
|
1449
1449
|
}
|
|
@@ -1452,7 +1452,7 @@ export default {
|
|
|
1452
1452
|
},
|
|
1453
1453
|
_openPrint(options) {
|
|
1454
1454
|
const { printOpts } = this;
|
|
1455
|
-
if (process.env.
|
|
1455
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1456
1456
|
if (!this.printConfig) {
|
|
1457
1457
|
errLog('vxe.error.reqProp', ['print-config']);
|
|
1458
1458
|
}
|
|
@@ -110,7 +110,7 @@ export default {
|
|
|
110
110
|
this.handleOpenMenuEvent(evnt, layout, params);
|
|
111
111
|
// 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
|
|
112
112
|
if (this.$listeners[`${typePrefix}cell-context-menu`]) {
|
|
113
|
-
if (process.env.
|
|
113
|
+
if (process.env.NODE_ENV === 'development') {
|
|
114
114
|
warnLog('vxe.error.delEvent', [`${typePrefix}cell-context-menu`, `${typePrefix}cell-menu`]);
|
|
115
115
|
}
|
|
116
116
|
this.emitEvent(`${typePrefix}cell-context-menu`, params, evnt);
|
|
@@ -267,7 +267,7 @@ export default {
|
|
|
267
267
|
}
|
|
268
268
|
// 在 v4 中废弃事件 context-menu-click
|
|
269
269
|
if (this.$listeners['context-menu-click']) {
|
|
270
|
-
if (process.env.
|
|
270
|
+
if (process.env.NODE_ENV === 'development') {
|
|
271
271
|
warnLog('vxe.error.delEvent', ['context-menu-click', 'menu-click']);
|
|
272
272
|
}
|
|
273
273
|
this.emitEvent('context-menu-click', params, evnt);
|
|
@@ -67,7 +67,7 @@ export default {
|
|
|
67
67
|
* 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
|
|
68
68
|
*/
|
|
69
69
|
_fullValidate(rows, cb) {
|
|
70
|
-
if (process.env.
|
|
70
|
+
if (process.env.NODE_ENV === 'development') {
|
|
71
71
|
if (XEUtils.isFunction(cb)) {
|
|
72
72
|
warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)']);
|
|
73
73
|
}
|
|
@@ -78,7 +78,7 @@ export default {
|
|
|
78
78
|
* 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
|
|
79
79
|
*/
|
|
80
80
|
_validate(rows, cb) {
|
|
81
|
-
if (process.env.
|
|
81
|
+
if (process.env.NODE_ENV === 'development') {
|
|
82
82
|
if (XEUtils.isFunction(cb)) {
|
|
83
83
|
warnLog('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)']);
|
|
84
84
|
}
|
|
@@ -314,13 +314,13 @@ export default {
|
|
|
314
314
|
customValid = gvItem.cellValidatorMethod(validParams);
|
|
315
315
|
}
|
|
316
316
|
else {
|
|
317
|
-
if (process.env.
|
|
317
|
+
if (process.env.NODE_ENV === 'development') {
|
|
318
318
|
warnLog('vxe.error.notValidators', [validator]);
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
else {
|
|
323
|
-
if (process.env.
|
|
323
|
+
if (process.env.NODE_ENV === 'development') {
|
|
324
324
|
errLog('vxe.error.notValidators', [validator]);
|
|
325
325
|
}
|
|
326
326
|
}
|
package/es/table/render/index.js
CHANGED
|
@@ -15,7 +15,7 @@ function getFormatDate(value, props, defaultFormat) {
|
|
|
15
15
|
return XEUtils.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
|
|
16
16
|
}
|
|
17
17
|
function getLabelFormatDate(value, props) {
|
|
18
|
-
return getFormatDate(value, props, getI18n(`vxe.input.date.labelFormat.${props.type}`));
|
|
18
|
+
return getFormatDate(value, props, getI18n(`vxe.input.date.labelFormat.${props.type || 'date'}`));
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* 已废弃
|
|
@@ -588,15 +588,7 @@ renderer.mixin({
|
|
|
588
588
|
const { row, column } = params;
|
|
589
589
|
let cellValue = XEUtils.get(row, column.field);
|
|
590
590
|
if (cellValue) {
|
|
591
|
-
|
|
592
|
-
case 'date':
|
|
593
|
-
case 'week':
|
|
594
|
-
case 'month':
|
|
595
|
-
case 'quarter':
|
|
596
|
-
case 'year':
|
|
597
|
-
cellValue = getLabelFormatDate(cellValue, props);
|
|
598
|
-
break;
|
|
599
|
-
}
|
|
591
|
+
cellValue = getLabelFormatDate(cellValue, props);
|
|
600
592
|
}
|
|
601
593
|
return getCellLabelVNs(h, renderOpts, params, cellValue);
|
|
602
594
|
},
|
|
@@ -605,7 +597,8 @@ renderer.mixin({
|
|
|
605
597
|
tableFilterDefaultMethod: handleFilterMethod
|
|
606
598
|
},
|
|
607
599
|
VxeTextarea: {
|
|
608
|
-
tableAutoFocus: '
|
|
600
|
+
tableAutoFocus: 'textarea',
|
|
601
|
+
renderTableEdit: defaultEditRender
|
|
609
602
|
},
|
|
610
603
|
VxeButton: {
|
|
611
604
|
renderTableDefault: buttonCellRender
|
|
@@ -700,6 +693,19 @@ renderer.mixin({
|
|
|
700
693
|
];
|
|
701
694
|
}
|
|
702
695
|
},
|
|
696
|
+
VxeTextEllipsis: {
|
|
697
|
+
renderTableDefault(h, renderOpts, params) {
|
|
698
|
+
const { row, column } = params;
|
|
699
|
+
const { props } = renderOpts;
|
|
700
|
+
const cellValue = getCellValue(row, column);
|
|
701
|
+
return [
|
|
702
|
+
h(getDefaultComponent(renderOpts), {
|
|
703
|
+
props: Object.assign(Object.assign({}, props), { content: cellValue }),
|
|
704
|
+
on: getEditOns(renderOpts, params)
|
|
705
|
+
})
|
|
706
|
+
];
|
|
707
|
+
}
|
|
708
|
+
},
|
|
703
709
|
// 以下已废弃
|
|
704
710
|
$input: {
|
|
705
711
|
tableAutoFocus: '.vxe-input--inner',
|
package/es/table/src/body.js
CHANGED
|
@@ -236,6 +236,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
236
236
|
'col--tree-node': treeNode,
|
|
237
237
|
'col--edit': isEdit,
|
|
238
238
|
'col--ellipsis': hasEllipsis,
|
|
239
|
+
'col--height': !!rowOpts.height,
|
|
239
240
|
'fixed--hidden': fixedHiddenColumn,
|
|
240
241
|
'col--dirty': isDirty,
|
|
241
242
|
'col--active': editConfig && isEdit && (actived.row === row && (actived.column === column || editOpts.mode === 'row')),
|
|
@@ -11,7 +11,7 @@ export class ColumnInfo {
|
|
|
11
11
|
const proxyOpts = $xegrid ? $xegrid.proxyOpts : null;
|
|
12
12
|
const formatter = _vm.formatter;
|
|
13
13
|
const visible = XEUtils.isBoolean(_vm.visible) ? _vm.visible : true;
|
|
14
|
-
if (process.env.
|
|
14
|
+
if (process.env.NODE_ENV === 'development') {
|
|
15
15
|
const types = ['seq', 'checkbox', 'radio', 'expand', 'html'];
|
|
16
16
|
if (_vm.type && types.indexOf(_vm.type) === -1) {
|
|
17
17
|
warnLog('vxe.error.errProp', [`type=${_vm.type}`, types.join(', ')]);
|
|
@@ -39,13 +39,13 @@ export class ColumnInfo {
|
|
|
39
39
|
if (formatter) {
|
|
40
40
|
if (XEUtils.isString(formatter)) {
|
|
41
41
|
const gFormatOpts = formats.get(formatter) || XEUtils[formatter];
|
|
42
|
-
if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.cellFormatMethod)) {
|
|
42
|
+
if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
|
|
43
43
|
errLog('vxe.error.notFormats', [formatter]);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
else if (XEUtils.isArray(formatter)) {
|
|
47
47
|
const gFormatOpts = formats.get(formatter[0]) || XEUtils[formatter[0]];
|
|
48
|
-
if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.cellFormatMethod)) {
|
|
48
|
+
if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
|
|
49
49
|
errLog('vxe.error.notFormats', [formatter[0]]);
|
|
50
50
|
}
|
|
51
51
|
}
|
package/es/table/src/methods.js
CHANGED
|
@@ -90,14 +90,15 @@ function computeVirtualX(_vm) {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
return { toVisibleIndex: Math.max(0, toVisibleIndex), visibleSize: Math.max(
|
|
93
|
+
return { toVisibleIndex: Math.max(0, toVisibleIndex), visibleSize: Math.max(6, visibleSize) };
|
|
94
94
|
}
|
|
95
|
-
return { toVisibleIndex: 0, visibleSize:
|
|
95
|
+
return { toVisibleIndex: 0, visibleSize: 6 };
|
|
96
96
|
}
|
|
97
97
|
function computeVirtualY(_vm) {
|
|
98
|
-
const { $refs,
|
|
98
|
+
const { $refs, computeSize, rowHeightMaps } = _vm;
|
|
99
99
|
const { tableHeader, tableBody } = $refs;
|
|
100
100
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
101
|
+
const vSize = computeSize;
|
|
101
102
|
if (tableBodyElem) {
|
|
102
103
|
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
103
104
|
let rowHeight = 0;
|
|
@@ -382,7 +383,7 @@ const Methods = {
|
|
|
382
383
|
if (treeConfig) {
|
|
383
384
|
// 树结构自动转换
|
|
384
385
|
if (treeOpts.transform) {
|
|
385
|
-
if (process.env.
|
|
386
|
+
if (process.env.NODE_ENV === 'development') {
|
|
386
387
|
if (!treeOpts.rowField) {
|
|
387
388
|
errLog('vxe.error.reqProp', ['table.tree-config.rowField']);
|
|
388
389
|
}
|
|
@@ -437,7 +438,7 @@ const Methods = {
|
|
|
437
438
|
if (keepSource) {
|
|
438
439
|
this.cacheSourceMap(fullData);
|
|
439
440
|
}
|
|
440
|
-
if (process.env.
|
|
441
|
+
if (process.env.NODE_ENV === 'development') {
|
|
441
442
|
if (sYLoad) {
|
|
442
443
|
if (!(this.height || this.maxHeight)) {
|
|
443
444
|
errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
|
|
@@ -571,7 +572,7 @@ const Methods = {
|
|
|
571
572
|
this.tableData = tableData.slice(0);
|
|
572
573
|
}
|
|
573
574
|
else {
|
|
574
|
-
if (process.env.
|
|
575
|
+
if (process.env.NODE_ENV === 'development') {
|
|
575
576
|
warnLog('vxe.error.reqProp', ['keep-source']);
|
|
576
577
|
}
|
|
577
578
|
}
|
|
@@ -621,7 +622,7 @@ const Methods = {
|
|
|
621
622
|
this.clearMergeCells();
|
|
622
623
|
this.clearMergeFooterItems();
|
|
623
624
|
this.handleTableData(true);
|
|
624
|
-
if (process.env.
|
|
625
|
+
if (process.env.NODE_ENV === 'development') {
|
|
625
626
|
if ((this.scrollXLoad || this.scrollYLoad) && this.expandColumn) {
|
|
626
627
|
warnLog('vxe.error.scrollErrProp', ['column.type=expand']);
|
|
627
628
|
}
|
|
@@ -638,13 +639,14 @@ const Methods = {
|
|
|
638
639
|
* 更新数据行的 Map
|
|
639
640
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
640
641
|
*/
|
|
641
|
-
cacheRowMap(
|
|
642
|
-
const { treeConfig, treeOpts, tableFullData,
|
|
643
|
-
let { fullDataRowIdData, fullAllDataRowIdData } = this;
|
|
642
|
+
cacheRowMap(isSource) {
|
|
643
|
+
const { treeConfig, treeOpts, tableFullData, fullAllDataRowIdData, fullAllDataRowMap, tableFullTreeData } = this;
|
|
644
644
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
645
645
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
646
646
|
const rowkey = getRowkey(this);
|
|
647
647
|
const isLazy = treeConfig && treeOpts.lazy;
|
|
648
|
+
const fullAllDataRowIdMaps = {};
|
|
649
|
+
const fullDataRowIdMaps = {};
|
|
648
650
|
const handleCache = (row, index, items, path, parent, nodes) => {
|
|
649
651
|
let rowid = getRowid(this, row);
|
|
650
652
|
const seq = treeConfig && path ? toTreePathSeq(path) : index + 1;
|
|
@@ -656,19 +658,20 @@ const Methods = {
|
|
|
656
658
|
if (isLazy && row[hasChildField] && XEUtils.isUndefined(row[childrenField])) {
|
|
657
659
|
row[childrenField] = null;
|
|
658
660
|
}
|
|
659
|
-
|
|
660
|
-
if (
|
|
661
|
-
|
|
662
|
-
|
|
661
|
+
let cacheItem = fullAllDataRowIdData[rowid];
|
|
662
|
+
if (!cacheItem) {
|
|
663
|
+
cacheItem = { row, rowid, seq, index: -1, _index: -1, $index: -1, items, parent, level };
|
|
664
|
+
}
|
|
665
|
+
if (isSource) {
|
|
666
|
+
cacheItem.index = treeConfig && parent ? -1 : index;
|
|
667
|
+
fullDataRowIdMaps[rowid] = cacheItem;
|
|
663
668
|
}
|
|
664
|
-
|
|
665
|
-
fullAllDataRowMap.set(row, rest);
|
|
669
|
+
fullAllDataRowIdMaps[rowid] = cacheItem;
|
|
666
670
|
};
|
|
667
|
-
if (
|
|
668
|
-
|
|
669
|
-
fullDataRowMap.clear();
|
|
671
|
+
if (isSource) {
|
|
672
|
+
this.fullDataRowIdData = fullDataRowIdMaps;
|
|
670
673
|
}
|
|
671
|
-
|
|
674
|
+
this.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
672
675
|
fullAllDataRowMap.clear();
|
|
673
676
|
if (treeConfig) {
|
|
674
677
|
XEUtils.eachTree(tableFullTreeData, handleCache, { children: childrenField });
|
|
@@ -761,7 +764,7 @@ const Methods = {
|
|
|
761
764
|
const { id: colid, field, fixed, type, treeNode } = column;
|
|
762
765
|
const rest = { column, colid, index, items, parent };
|
|
763
766
|
if (field) {
|
|
764
|
-
if (process.env.
|
|
767
|
+
if (process.env.NODE_ENV === 'development') {
|
|
765
768
|
if (fullColumnFieldData[field]) {
|
|
766
769
|
warnLog('vxe.error.colRepet', ['field', field]);
|
|
767
770
|
}
|
|
@@ -775,7 +778,7 @@ const Methods = {
|
|
|
775
778
|
htmlColumn = column;
|
|
776
779
|
}
|
|
777
780
|
if (treeNode) {
|
|
778
|
-
if (process.env.
|
|
781
|
+
if (process.env.NODE_ENV === 'development') {
|
|
779
782
|
if (treeNodeColumn) {
|
|
780
783
|
warnLog('vxe.error.colRepet', ['tree-node', treeNode]);
|
|
781
784
|
}
|
|
@@ -785,7 +788,7 @@ const Methods = {
|
|
|
785
788
|
}
|
|
786
789
|
}
|
|
787
790
|
else if (type === 'expand') {
|
|
788
|
-
if (process.env.
|
|
791
|
+
if (process.env.NODE_ENV === 'development') {
|
|
789
792
|
if (expandColumn) {
|
|
790
793
|
warnLog('vxe.error.colRepet', ['type', type]);
|
|
791
794
|
}
|
|
@@ -794,7 +797,7 @@ const Methods = {
|
|
|
794
797
|
expandColumn = column;
|
|
795
798
|
}
|
|
796
799
|
}
|
|
797
|
-
if (process.env.
|
|
800
|
+
if (process.env.NODE_ENV === 'development') {
|
|
798
801
|
if (type === 'checkbox') {
|
|
799
802
|
if (checkboxColumn) {
|
|
800
803
|
warnLog('vxe.error.colRepet', ['type', type]);
|
|
@@ -812,7 +815,7 @@ const Methods = {
|
|
|
812
815
|
}
|
|
813
816
|
}
|
|
814
817
|
}
|
|
815
|
-
if (process.env.
|
|
818
|
+
if (process.env.NODE_ENV === 'development') {
|
|
816
819
|
if (this.showOverflow && column.showOverflow === false) {
|
|
817
820
|
warnLog('vxe.error.errConflicts', [`table.show-overflow=${this.showOverflow}`, `column.show-overflow=${column.showOverflow}`]);
|
|
818
821
|
}
|
|
@@ -823,7 +826,7 @@ const Methods = {
|
|
|
823
826
|
warnLog('vxe.error.errConflicts', [`table.show-footer-overflow=${this.showFooterOverflow}`, `column.show-footer-overflow=${column.showFooterOverflow}`]);
|
|
824
827
|
}
|
|
825
828
|
}
|
|
826
|
-
if (process.env.
|
|
829
|
+
if (process.env.NODE_ENV === 'development') {
|
|
827
830
|
if (htmlColumn) {
|
|
828
831
|
if (!columnOpts.useKey) {
|
|
829
832
|
errLog('vxe.error.reqProp', ['column-config.useKey', 'column.type=html']);
|
|
@@ -852,7 +855,7 @@ const Methods = {
|
|
|
852
855
|
else {
|
|
853
856
|
tableFullColumn.forEach(handleFunc);
|
|
854
857
|
}
|
|
855
|
-
if (process.env.
|
|
858
|
+
if (process.env.NODE_ENV === 'development') {
|
|
856
859
|
if (expandColumn && this.mouseOpts.area) {
|
|
857
860
|
errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand']);
|
|
858
861
|
}
|
|
@@ -923,7 +926,7 @@ const Methods = {
|
|
|
923
926
|
},
|
|
924
927
|
// 在 v3 中废弃
|
|
925
928
|
_getRowIndex(row) {
|
|
926
|
-
if (process.env.
|
|
929
|
+
if (process.env.NODE_ENV === 'development') {
|
|
927
930
|
warnLog('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex']);
|
|
928
931
|
}
|
|
929
932
|
return this.getVTRowIndex(row);
|
|
@@ -937,7 +940,7 @@ const Methods = {
|
|
|
937
940
|
},
|
|
938
941
|
// 在 v3 中废弃
|
|
939
942
|
$getRowIndex(row) {
|
|
940
|
-
if (process.env.
|
|
943
|
+
if (process.env.NODE_ENV === 'development') {
|
|
941
944
|
warnLog('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex']);
|
|
942
945
|
}
|
|
943
946
|
return this.getVMRowIndex(row);
|
|
@@ -958,7 +961,7 @@ const Methods = {
|
|
|
958
961
|
},
|
|
959
962
|
// 在 v3 中废弃
|
|
960
963
|
_getColumnIndex(column) {
|
|
961
|
-
if (process.env.
|
|
964
|
+
if (process.env.NODE_ENV === 'development') {
|
|
962
965
|
warnLog('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex']);
|
|
963
966
|
}
|
|
964
967
|
return this.getVTColumnIndex(column);
|
|
@@ -972,7 +975,7 @@ const Methods = {
|
|
|
972
975
|
},
|
|
973
976
|
// 在 v3 中废弃
|
|
974
977
|
$getColumnIndex(column) {
|
|
975
|
-
if (process.env.
|
|
978
|
+
if (process.env.NODE_ENV === 'development') {
|
|
976
979
|
warnLog('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex']);
|
|
977
980
|
}
|
|
978
981
|
return this.getVMColumnIndex(column);
|
|
@@ -1060,7 +1063,7 @@ const Methods = {
|
|
|
1060
1063
|
revertData(rows, field) {
|
|
1061
1064
|
const { keepSource, tableSourceData, treeConfig } = this;
|
|
1062
1065
|
if (!keepSource) {
|
|
1063
|
-
if (process.env.
|
|
1066
|
+
if (process.env.NODE_ENV === 'development') {
|
|
1064
1067
|
warnLog('vxe.error.reqProp', ['keep-source']);
|
|
1065
1068
|
}
|
|
1066
1069
|
return this.$nextTick();
|
|
@@ -1173,11 +1176,13 @@ const Methods = {
|
|
|
1173
1176
|
const formatParams = { cellValue, row, rowIndex: this.getRowIndex(row), column, columnIndex: this.getColumnIndex(column) };
|
|
1174
1177
|
if (XEUtils.isString(formatter)) {
|
|
1175
1178
|
const gFormatOpts = formats.get(formatter);
|
|
1176
|
-
|
|
1179
|
+
const tcFormatMethod = gFormatOpts ? (gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod) : null;
|
|
1180
|
+
cellLabel = tcFormatMethod ? tcFormatMethod(formatParams) : '';
|
|
1177
1181
|
}
|
|
1178
1182
|
else if (XEUtils.isArray(formatter)) {
|
|
1179
1183
|
const gFormatOpts = formats.get(formatter[0]);
|
|
1180
|
-
|
|
1184
|
+
const tcFormatMethod = gFormatOpts ? (gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod) : null;
|
|
1185
|
+
cellLabel = tcFormatMethod ? tcFormatMethod(formatParams, ...formatter.slice(1)) : '';
|
|
1181
1186
|
}
|
|
1182
1187
|
else {
|
|
1183
1188
|
cellLabel = formatter(formatParams);
|
|
@@ -1387,8 +1392,8 @@ const Methods = {
|
|
|
1387
1392
|
if (valueList.length && !allRemoteFilter) {
|
|
1388
1393
|
const { filterMethod, filterRender, field } = column;
|
|
1389
1394
|
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
1390
|
-
const compFilterMethod = compConf
|
|
1391
|
-
const
|
|
1395
|
+
const compFilterMethod = compConf ? (compConf.tableFilterMethod || compConf.filterMethod) : null;
|
|
1396
|
+
const tdFilterMethod = compConf ? (compConf.tableFilterDefaultMethod || compConf.defaultTableFilterMethod || compConf.defaultFilterMethod) : null;
|
|
1392
1397
|
const cellValue = getCellValue(row, column);
|
|
1393
1398
|
if (filterMethod) {
|
|
1394
1399
|
return itemList.some((item) => filterMethod({ value: item.value, option: item, cellValue, row, column, $table: this }));
|
|
@@ -1399,8 +1404,8 @@ const Methods = {
|
|
|
1399
1404
|
else if (allFilterMethod) {
|
|
1400
1405
|
return allFilterMethod({ options: itemList, values: valueList, cellValue, row, column });
|
|
1401
1406
|
}
|
|
1402
|
-
else if (
|
|
1403
|
-
return itemList.some((item) =>
|
|
1407
|
+
else if (tdFilterMethod) {
|
|
1408
|
+
return itemList.some((item) => tdFilterMethod({ value: item.value, option: item, cellValue, row, column, $table: this }));
|
|
1404
1409
|
}
|
|
1405
1410
|
return valueList.indexOf(XEUtils.get(row, field)) > -1;
|
|
1406
1411
|
}
|
|
@@ -2003,7 +2008,7 @@ const Methods = {
|
|
|
2003
2008
|
this.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
|
|
2004
2009
|
Object.assign(columnStore, { leftList, centerList, rightList });
|
|
2005
2010
|
if (scrollXLoad) {
|
|
2006
|
-
if (process.env.
|
|
2011
|
+
if (process.env.NODE_ENV === 'development') {
|
|
2007
2012
|
// if (this.showHeader && !this.showHeaderOverflow) {
|
|
2008
2013
|
// warnLog('vxe.error.reqProp', ['show-header-overflow'])
|
|
2009
2014
|
// }
|
|
@@ -2126,6 +2131,10 @@ const Methods = {
|
|
|
2126
2131
|
const bodyElem = tableBody ? tableBody.$el : null;
|
|
2127
2132
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
2128
2133
|
const footerElem = tableFooter ? tableFooter.$el : null;
|
|
2134
|
+
const el = this.$el;
|
|
2135
|
+
if (!el || !el.clientWidth) {
|
|
2136
|
+
return this.$nextTick();
|
|
2137
|
+
}
|
|
2129
2138
|
if (bodyElem) {
|
|
2130
2139
|
this.calcCellWidth();
|
|
2131
2140
|
this.autoCellWidth(headerElem, bodyElem, footerElem);
|
|
@@ -2158,10 +2167,21 @@ const Methods = {
|
|
|
2158
2167
|
paddingSize = Math.floor(XEUtils.toNumber(cellStyle.paddingLeft) + XEUtils.toNumber(cellStyle.paddingRight)) + 2;
|
|
2159
2168
|
}
|
|
2160
2169
|
let colWidth = column.renderAutoWidth - paddingSize;
|
|
2161
|
-
XEUtils.arrayEach(cellElList, (
|
|
2162
|
-
const
|
|
2163
|
-
|
|
2164
|
-
|
|
2170
|
+
XEUtils.arrayEach(cellElList, (itemEl) => {
|
|
2171
|
+
const cellEl = itemEl;
|
|
2172
|
+
const thElem = cellEl.parentNode;
|
|
2173
|
+
let titleWidth = 0;
|
|
2174
|
+
if (`${thElem.tagName}`.toLowerCase() === 'th') {
|
|
2175
|
+
XEUtils.arrayEach(cellEl.children, (btnEl) => {
|
|
2176
|
+
titleWidth += btnEl.offsetWidth + 1;
|
|
2177
|
+
});
|
|
2178
|
+
}
|
|
2179
|
+
else {
|
|
2180
|
+
const labelEl = cellEl.firstChild;
|
|
2181
|
+
titleWidth = labelEl.offsetWidth;
|
|
2182
|
+
}
|
|
2183
|
+
if (titleWidth) {
|
|
2184
|
+
colWidth = Math.max(colWidth, Math.ceil(titleWidth) + 4);
|
|
2165
2185
|
}
|
|
2166
2186
|
});
|
|
2167
2187
|
column.renderAutoWidth = colWidth + paddingSize;
|
|
@@ -2587,7 +2607,7 @@ const Methods = {
|
|
|
2587
2607
|
// 兼容老版本
|
|
2588
2608
|
if (!evntList.length && type === 'event.clearEdit') {
|
|
2589
2609
|
evntList = interceptor.get('event.clearActived');
|
|
2590
|
-
if (process.env.
|
|
2610
|
+
if (process.env.NODE_ENV === 'development') {
|
|
2591
2611
|
if (evntList.length) {
|
|
2592
2612
|
warnLog('vxe.error.delEvent', ['event.clearActived', 'event.clearEdit']);
|
|
2593
2613
|
}
|
|
@@ -3012,12 +3032,6 @@ const Methods = {
|
|
|
3012
3032
|
setCellValue(selected.row, selected.column, null);
|
|
3013
3033
|
this.handleEdit(selected.args, evnt);
|
|
3014
3034
|
}
|
|
3015
|
-
const afterEditMethod = editOpts.afterEditMethod;
|
|
3016
|
-
if (afterEditMethod) {
|
|
3017
|
-
this.$nextTick(() => {
|
|
3018
|
-
afterEditMethod(params);
|
|
3019
|
-
});
|
|
3020
|
-
}
|
|
3021
3035
|
}
|
|
3022
3036
|
}
|
|
3023
3037
|
}
|
|
@@ -4457,7 +4471,7 @@ const Methods = {
|
|
|
4457
4471
|
},
|
|
4458
4472
|
// 在 v3 中废弃
|
|
4459
4473
|
getSortColumn() {
|
|
4460
|
-
if (process.env.
|
|
4474
|
+
if (process.env.NODE_ENV === 'development') {
|
|
4461
4475
|
warnLog('vxe.error.delFunc', ['getSortColumn', 'getSortColumns']);
|
|
4462
4476
|
}
|
|
4463
4477
|
return XEUtils.find(this.tableFullColumn, column => (column.sortable || column.remoteSort) && column.order);
|
|
@@ -4554,7 +4568,7 @@ const Methods = {
|
|
|
4554
4568
|
return this.$nextTick();
|
|
4555
4569
|
},
|
|
4556
4570
|
reloadExpandContent(row) {
|
|
4557
|
-
if (process.env.
|
|
4571
|
+
if (process.env.NODE_ENV === 'development') {
|
|
4558
4572
|
warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand']);
|
|
4559
4573
|
}
|
|
4560
4574
|
// 即将废弃
|
|
@@ -4721,7 +4735,7 @@ const Methods = {
|
|
|
4721
4735
|
return !!rowExpandedMaps[rowid];
|
|
4722
4736
|
},
|
|
4723
4737
|
isExpandByRow(row) {
|
|
4724
|
-
if (process.env.
|
|
4738
|
+
if (process.env.NODE_ENV === 'development') {
|
|
4725
4739
|
warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow']);
|
|
4726
4740
|
}
|
|
4727
4741
|
// 即将废弃
|
|
@@ -4839,7 +4853,7 @@ const Methods = {
|
|
|
4839
4853
|
return this.$nextTick();
|
|
4840
4854
|
},
|
|
4841
4855
|
reloadTreeChilds(row) {
|
|
4842
|
-
if (process.env.
|
|
4856
|
+
if (process.env.NODE_ENV === 'development') {
|
|
4843
4857
|
warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand']);
|
|
4844
4858
|
}
|
|
4845
4859
|
// 即将废弃
|
|
@@ -5615,7 +5629,7 @@ const Methods = {
|
|
|
5615
5629
|
const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,getPrintHtml,exportData,openImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom'.split(',');
|
|
5616
5630
|
funcs.forEach(name => {
|
|
5617
5631
|
Methods[name] = function (...args) {
|
|
5618
|
-
if (process.env.
|
|
5632
|
+
if (process.env.NODE_ENV === 'development') {
|
|
5619
5633
|
if (!this[`_${name}`]) {
|
|
5620
5634
|
if ('openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',').includes(name)) {
|
|
5621
5635
|
errLog('vxe.error.reqModule', ['VxeTableExportModule']);
|