vxe-table 3.9.0-rc.12 → 3.9.0-rc.14
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/grid/src/grid.js +82 -51
- 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 +8 -8
- package/es/table/module/export/export-panel.js +28 -0
- package/es/table/module/export/import-panel.js +20 -1
- 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 +2 -1
- package/es/table/src/body.js +1 -0
- package/es/table/src/columnInfo.js +1 -1
- package/es/table/src/methods.js +23 -23
- package/es/table/src/props.js +65 -15
- package/es/table/src/table.js +48 -24
- package/es/table/src/util.js +1 -1
- package/es/table/style.css +39 -20
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +3 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +39 -20
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +78 -54
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +246 -144
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/panel.js +12 -7
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +8 -8
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +28 -0
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +20 -1
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +11 -11
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +2 -2
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +4 -4
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +2 -1
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +1 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -1
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +23 -23
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +7 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +33 -16
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +1 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +39 -20
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +3 -2
- 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 +39 -20
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +90 -51
- package/packages/table/module/custom/panel.ts +186 -175
- package/packages/table/module/edit/mixin.ts +8 -8
- package/packages/table/module/export/export-panel.ts +32 -0
- package/packages/table/module/export/import-panel.ts +24 -1
- 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 +2 -1
- package/packages/table/src/body.ts +1 -0
- package/packages/table/src/columnInfo.ts +1 -1
- package/packages/table/src/methods.ts +23 -23
- package/packages/table/src/props.ts +68 -15
- package/packages/table/src/table.ts +53 -24
- package/packages/table/src/util.ts +1 -1
- package/packages/ui/index.ts +1 -0
- package/styles/components/table.scss +80 -14
- /package/es/{iconfont.1727008685370.ttf → iconfont.1727151996913.ttf} +0 -0
- /package/es/{iconfont.1727008685370.woff → iconfont.1727151996913.woff} +0 -0
- /package/es/{iconfont.1727008685370.woff2 → iconfont.1727151996913.woff2} +0 -0
- /package/lib/{iconfont.1727008685370.ttf → iconfont.1727151996913.ttf} +0 -0
- /package/lib/{iconfont.1727008685370.woff → iconfont.1727151996913.woff} +0 -0
- /package/lib/{iconfont.1727008685370.woff2 → iconfont.1727151996913.woff2} +0 -0
package/es/grid/src/grid.js
CHANGED
|
@@ -7,11 +7,15 @@ import VxeToolbarComponent from '../../toolbar/src/toolbar';
|
|
|
7
7
|
import tableComponentProps from '../../table/src/props';
|
|
8
8
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
9
9
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
10
|
-
const { getConfig, getI18n, commands, globalEvents, globalMixins } = VxeUI;
|
|
10
|
+
const { getConfig, getI18n, commands, globalEvents, globalMixins, renderEmptyElement } = VxeUI;
|
|
11
11
|
const methods = {};
|
|
12
12
|
const propKeys = Object.keys(tableComponentProps);
|
|
13
|
-
function renderDefaultForm(h,
|
|
14
|
-
const
|
|
13
|
+
function renderDefaultForm(h, $xeGrid) {
|
|
14
|
+
const VxeUIFormComponent = VxeUI.getComponent('VxeForm');
|
|
15
|
+
const props = $xeGrid;
|
|
16
|
+
const slots = $xeGrid.$scopedSlots;
|
|
17
|
+
const { proxyConfig, formConfig } = props;
|
|
18
|
+
const { proxyOpts, formData, formOpts } = $xeGrid;
|
|
15
19
|
if (isEnableConf(formConfig) && formOpts.items && formOpts.items.length) {
|
|
16
20
|
const formSlots = {};
|
|
17
21
|
if (!formOpts.inited) {
|
|
@@ -19,7 +23,7 @@ function renderDefaultForm(h, _vm) {
|
|
|
19
23
|
const beforeItem = proxyOpts.beforeItem;
|
|
20
24
|
if (proxyOpts && beforeItem) {
|
|
21
25
|
formOpts.items.forEach((item) => {
|
|
22
|
-
beforeItem.call(
|
|
26
|
+
beforeItem.call($xeGrid, { $grid: $xeGrid, item });
|
|
23
27
|
});
|
|
24
28
|
}
|
|
25
29
|
}
|
|
@@ -27,39 +31,41 @@ function renderDefaultForm(h, _vm) {
|
|
|
27
31
|
formOpts.items.forEach((item) => {
|
|
28
32
|
XEUtils.each(item.slots, (func) => {
|
|
29
33
|
if (!XEUtils.isFunction(func)) {
|
|
30
|
-
if (
|
|
31
|
-
formSlots[func] =
|
|
34
|
+
if (slots[func]) {
|
|
35
|
+
formSlots[func] = slots[func];
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
});
|
|
35
39
|
});
|
|
36
40
|
return [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
VxeUIFormComponent
|
|
42
|
+
? h(VxeUIFormComponent, {
|
|
43
|
+
props: Object.assign({}, formOpts, {
|
|
44
|
+
data: proxyConfig && proxyOpts.form ? formData : formOpts.data
|
|
45
|
+
}),
|
|
46
|
+
on: {
|
|
47
|
+
submit: $xeGrid.submitEvent,
|
|
48
|
+
reset: $xeGrid.resetEvent,
|
|
49
|
+
collapse: $xeGrid.collapseEvent,
|
|
50
|
+
'submit-invalid': $xeGrid.submitInvalidEvent
|
|
51
|
+
},
|
|
52
|
+
scopedSlots: formSlots
|
|
53
|
+
})
|
|
54
|
+
: renderEmptyElement($xeGrid)
|
|
49
55
|
];
|
|
50
56
|
}
|
|
51
57
|
return [];
|
|
52
58
|
}
|
|
53
|
-
function getFuncSlot(
|
|
54
|
-
const
|
|
59
|
+
function getFuncSlot($xeGrid, optSlots, slotKey) {
|
|
60
|
+
const slots = $xeGrid.$scopedSlots;
|
|
55
61
|
const funcSlot = optSlots[slotKey];
|
|
56
62
|
if (funcSlot) {
|
|
57
63
|
if (XEUtils.isString(funcSlot)) {
|
|
58
|
-
if (
|
|
59
|
-
return
|
|
64
|
+
if (slots[funcSlot]) {
|
|
65
|
+
return slots[funcSlot];
|
|
60
66
|
}
|
|
61
67
|
else {
|
|
62
|
-
if (process.env.
|
|
68
|
+
if (process.env.NODE_ENV === 'development') {
|
|
63
69
|
errLog('vxe.error.notSlot', [funcSlot]);
|
|
64
70
|
}
|
|
65
71
|
}
|
|
@@ -76,7 +82,7 @@ function getToolbarSlots(_vm) {
|
|
|
76
82
|
let buttonsSlot;
|
|
77
83
|
let toolsSlot;
|
|
78
84
|
const slots = {};
|
|
79
|
-
if (process.env.
|
|
85
|
+
if (process.env.NODE_ENV === 'development') {
|
|
80
86
|
if ($scopedSlots.buttons && (!toolbarOptSlots || toolbarOptSlots.buttons !== 'buttons')) {
|
|
81
87
|
warnLog('vxe.error.reqProp', ['toolbar-config.slots.buttons']);
|
|
82
88
|
}
|
|
@@ -240,8 +246,11 @@ function renderBottom(h, _vm) {
|
|
|
240
246
|
/**
|
|
241
247
|
* 渲染分页
|
|
242
248
|
*/
|
|
243
|
-
function renderPager(h,
|
|
244
|
-
const
|
|
249
|
+
function renderPager(h, $xeGrid) {
|
|
250
|
+
const VxeUIPagerComponent = VxeUI.getComponent('VxePager');
|
|
251
|
+
const props = $xeGrid;
|
|
252
|
+
const { pagerConfig, proxyConfig } = props;
|
|
253
|
+
const { $scopedSlots, tablePage } = $xeGrid;
|
|
245
254
|
const pagerSlot = $scopedSlots.pager;
|
|
246
255
|
const hasPager = !!(pagerSlot || isEnableConf(pagerConfig));
|
|
247
256
|
if (hasPager) {
|
|
@@ -250,18 +259,20 @@ function renderPager(h, _vm) {
|
|
|
250
259
|
ref: 'pagerWrapper',
|
|
251
260
|
class: 'vxe-grid--pager-wrapper'
|
|
252
261
|
}, pagerSlot
|
|
253
|
-
? pagerSlot.call(
|
|
262
|
+
? pagerSlot.call($xeGrid, { $grid: $xeGrid }, h)
|
|
254
263
|
: [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
264
|
+
VxeUIPagerComponent
|
|
265
|
+
? h(VxeUIPagerComponent, {
|
|
266
|
+
props: Object.assign(Object.assign({}, $xeGrid.pagerOpts), (proxyConfig ? tablePage : {})),
|
|
267
|
+
on: {
|
|
268
|
+
'page-change': $xeGrid.pageChangeEvent
|
|
269
|
+
},
|
|
270
|
+
scopedSlots: getPagerSlots($xeGrid)
|
|
271
|
+
})
|
|
272
|
+
: renderEmptyElement($xeGrid)
|
|
262
273
|
]);
|
|
263
274
|
}
|
|
264
|
-
return
|
|
275
|
+
return renderEmptyElement($xeGrid);
|
|
265
276
|
}
|
|
266
277
|
const defaultLayouts = ['Form', 'Toolbar', 'Top', 'Table', 'Bottom', 'Pager'];
|
|
267
278
|
function renderLayout(h, _vm) {
|
|
@@ -296,7 +307,7 @@ function renderLayout(h, _vm) {
|
|
|
296
307
|
vns.push(renderPager(h, _vm));
|
|
297
308
|
break;
|
|
298
309
|
default:
|
|
299
|
-
if (process.env.
|
|
310
|
+
if (process.env.NODE_ENV === 'development') {
|
|
300
311
|
errLog('vxe.error.notProp', [`layouts -> ${name}`]);
|
|
301
312
|
}
|
|
302
313
|
break;
|
|
@@ -322,6 +333,7 @@ export default {
|
|
|
322
333
|
};
|
|
323
334
|
},
|
|
324
335
|
data() {
|
|
336
|
+
var _a;
|
|
325
337
|
return {
|
|
326
338
|
tableLoading: false,
|
|
327
339
|
isZMax: false,
|
|
@@ -332,7 +344,7 @@ export default {
|
|
|
332
344
|
tZindex: 0,
|
|
333
345
|
tablePage: {
|
|
334
346
|
total: 0,
|
|
335
|
-
pageSize: getConfig().pager.pageSize || 10,
|
|
347
|
+
pageSize: ((_a = getConfig().pager) === null || _a === void 0 ? void 0 : _a.pageSize) || 10,
|
|
336
348
|
currentPage: 1
|
|
337
349
|
}
|
|
338
350
|
};
|
|
@@ -431,11 +443,13 @@ export default {
|
|
|
431
443
|
}
|
|
432
444
|
},
|
|
433
445
|
created() {
|
|
446
|
+
const $xeGrid = this;
|
|
447
|
+
const props = $xeGrid;
|
|
434
448
|
// const { data, formOpts, proxyOpts, proxyConfig } = this
|
|
435
449
|
// if (proxyConfig && (data || (proxyOpts.form && formOpts.data))) {
|
|
436
450
|
// errLog('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config'])
|
|
437
451
|
// }
|
|
438
|
-
if (process.env.
|
|
452
|
+
if (process.env.NODE_ENV === 'development') {
|
|
439
453
|
if (this.toolbar) {
|
|
440
454
|
warnLog('vxe.error.delProp', ['grid.toolbar', 'grid.toolbar-config']);
|
|
441
455
|
}
|
|
@@ -446,6 +460,23 @@ export default {
|
|
|
446
460
|
// warnLog('vxe.error.delProp', ['proxy-config.props', 'proxy-config.response'])
|
|
447
461
|
// }
|
|
448
462
|
}
|
|
463
|
+
if (process.env.NODE_ENV === 'development') {
|
|
464
|
+
// 使用已安装的组件,如果未安装则不渲染
|
|
465
|
+
const VxeUIFormComponent = VxeUI.getComponent('VxeForm');
|
|
466
|
+
const VxeUIPagerComponent = VxeUI.getComponent('VxePager');
|
|
467
|
+
$xeGrid.$nextTick(() => {
|
|
468
|
+
if (props.formConfig) {
|
|
469
|
+
if (!VxeUIFormComponent) {
|
|
470
|
+
errLog('vxe.error.reqComp', ['vxe-form']);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
if (props.pagerConfig) {
|
|
474
|
+
if (!VxeUIPagerComponent) {
|
|
475
|
+
errLog('vxe.error.reqComp', ['vxe-pager']);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
}
|
|
449
480
|
this.initPages();
|
|
450
481
|
globalEvents.on(this, 'keydown', this.handleGlobalKeydownEvent);
|
|
451
482
|
},
|
|
@@ -717,7 +748,7 @@ export default {
|
|
|
717
748
|
});
|
|
718
749
|
}
|
|
719
750
|
else {
|
|
720
|
-
if (process.env.
|
|
751
|
+
if (process.env.NODE_ENV === 'development') {
|
|
721
752
|
errLog('vxe.error.notFunc', ['proxy-config.ajax.query']);
|
|
722
753
|
}
|
|
723
754
|
}
|
|
@@ -745,7 +776,7 @@ export default {
|
|
|
745
776
|
$xetable.setPendingRow(removeRecords, false);
|
|
746
777
|
if (isRespMsg) {
|
|
747
778
|
// 检测弹窗模块
|
|
748
|
-
if (process.env.
|
|
779
|
+
if (process.env.NODE_ENV === 'development') {
|
|
749
780
|
if (!VxeUI.modal) {
|
|
750
781
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
751
782
|
}
|
|
@@ -767,7 +798,7 @@ export default {
|
|
|
767
798
|
this.tableLoading = false;
|
|
768
799
|
if (isRespMsg) {
|
|
769
800
|
// 检测弹窗模块
|
|
770
|
-
if (process.env.
|
|
801
|
+
if (process.env.NODE_ENV === 'development') {
|
|
771
802
|
if (!VxeUI.modal) {
|
|
772
803
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
773
804
|
}
|
|
@@ -784,7 +815,7 @@ export default {
|
|
|
784
815
|
else {
|
|
785
816
|
if (isActiveMsg) {
|
|
786
817
|
// 检测弹窗模块
|
|
787
|
-
if (process.env.
|
|
818
|
+
if (process.env.NODE_ENV === 'development') {
|
|
788
819
|
if (!VxeUI.modal) {
|
|
789
820
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
790
821
|
}
|
|
@@ -794,7 +825,7 @@ export default {
|
|
|
794
825
|
}
|
|
795
826
|
}
|
|
796
827
|
else {
|
|
797
|
-
if (process.env.
|
|
828
|
+
if (process.env.NODE_ENV === 'development') {
|
|
798
829
|
errLog('vxe.error.notFunc', ['proxy-config.ajax.delete']);
|
|
799
830
|
}
|
|
800
831
|
}
|
|
@@ -835,7 +866,7 @@ export default {
|
|
|
835
866
|
$xetable.clearPendingRow();
|
|
836
867
|
if (isRespMsg) {
|
|
837
868
|
// 检测弹窗模块
|
|
838
|
-
if (process.env.
|
|
869
|
+
if (process.env.NODE_ENV === 'development') {
|
|
839
870
|
if (!VxeUI.modal) {
|
|
840
871
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
841
872
|
}
|
|
@@ -857,7 +888,7 @@ export default {
|
|
|
857
888
|
this.tableLoading = false;
|
|
858
889
|
if (isRespMsg) {
|
|
859
890
|
// 检测弹窗模块
|
|
860
|
-
if (process.env.
|
|
891
|
+
if (process.env.NODE_ENV === 'development') {
|
|
861
892
|
if (!VxeUI.modal) {
|
|
862
893
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
863
894
|
}
|
|
@@ -873,7 +904,7 @@ export default {
|
|
|
873
904
|
else {
|
|
874
905
|
if (isActiveMsg) {
|
|
875
906
|
// 检测弹窗模块
|
|
876
|
-
if (process.env.
|
|
907
|
+
if (process.env.NODE_ENV === 'development') {
|
|
877
908
|
if (!VxeUI.modal) {
|
|
878
909
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
879
910
|
}
|
|
@@ -884,7 +915,7 @@ export default {
|
|
|
884
915
|
});
|
|
885
916
|
}
|
|
886
917
|
else {
|
|
887
|
-
if (process.env.
|
|
918
|
+
if (process.env.NODE_ENV === 'development') {
|
|
888
919
|
errLog('vxe.error.notFunc', ['proxy-config.ajax.save']);
|
|
889
920
|
}
|
|
890
921
|
}
|
|
@@ -897,7 +928,7 @@ export default {
|
|
|
897
928
|
gCommandOpts.commandMethod({ code, button, $grid: this, $table: $xetable }, ...args);
|
|
898
929
|
}
|
|
899
930
|
else {
|
|
900
|
-
if (process.env.
|
|
931
|
+
if (process.env.NODE_ENV === 'development') {
|
|
901
932
|
errLog('vxe.error.notCommands', [code]);
|
|
902
933
|
}
|
|
903
934
|
}
|
|
@@ -927,7 +958,7 @@ export default {
|
|
|
927
958
|
}
|
|
928
959
|
else {
|
|
929
960
|
// 检测弹窗模块
|
|
930
|
-
if (process.env.
|
|
961
|
+
if (process.env.NODE_ENV === 'development') {
|
|
931
962
|
if (!VxeUI.modal) {
|
|
932
963
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
933
964
|
}
|
|
@@ -980,7 +1011,7 @@ export default {
|
|
|
980
1011
|
else {
|
|
981
1012
|
if (isActiveMsg) {
|
|
982
1013
|
// 检测弹窗模块
|
|
983
|
-
if (process.env.
|
|
1014
|
+
if (process.env.NODE_ENV === 'development') {
|
|
984
1015
|
if (!VxeUI.modal) {
|
|
985
1016
|
errLog('vxe.error.reqModule', ['Modal']);
|
|
986
1017
|
}
|
|
@@ -1097,7 +1128,7 @@ export default {
|
|
|
1097
1128
|
};
|
|
1098
1129
|
}
|
|
1099
1130
|
return null;
|
|
1100
|
-
} }), (process.env.
|
|
1131
|
+
} }), (process.env.NODE_ENV === 'development'
|
|
1101
1132
|
? {
|
|
1102
1133
|
loadColumn(columns) {
|
|
1103
1134
|
const { $scopedSlots } = this;
|