vxe-table 4.8.4 → 4.8.6
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 +12 -12
- package/es/grid/src/grid.js +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/hook.js +135 -3
- package/es/table/module/custom/panel.js +179 -181
- package/es/table/module/validator/hook.js +1 -1
- package/es/table/src/body.js +14 -8
- package/es/table/src/table.js +77 -73
- package/es/table/style.css +67 -52
- 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 +67 -52
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +374 -247
- 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/hook.js +177 -3
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +108 -162
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/validator/hook.js +1 -1
- package/lib/table/module/validator/hook.min.js +1 -1
- package/lib/table/src/body.js +5 -3
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +78 -74
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +67 -52
- 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 +67 -52
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +1 -1
- package/packages/table/module/custom/hook.ts +136 -3
- package/packages/table/module/custom/panel.ts +186 -185
- package/packages/table/module/validator/hook.ts +1 -1
- package/packages/table/src/body.ts +14 -8
- package/packages/table/src/table.ts +77 -73
- package/packages/ui/index.ts +2 -1
- package/styles/components/table-module/custom.scss +23 -6
- package/styles/components/table.scss +36 -26
- /package/es/{iconfont.1730946045701.ttf → iconfont.1731028500961.ttf} +0 -0
- /package/es/{iconfont.1730946045701.woff → iconfont.1731028500961.woff} +0 -0
- /package/es/{iconfont.1730946045701.woff2 → iconfont.1731028500961.woff2} +0 -0
- /package/lib/{iconfont.1730946045701.ttf → iconfont.1731028500961.ttf} +0 -0
- /package/lib/{iconfont.1730946045701.woff → iconfont.1731028500961.woff} +0 -0
- /package/lib/{iconfont.1730946045701.woff2 → iconfont.1731028500961.woff2} +0 -0
|
@@ -4,7 +4,7 @@ import { formatText } from '../../../ui/src/utils';
|
|
|
4
4
|
import { addClass, removeClass } from '../../../ui/src/dom';
|
|
5
5
|
import { errLog } from '../../../ui/src/log';
|
|
6
6
|
import XEUtils from 'xe-utils';
|
|
7
|
-
const { getI18n, getIcon } = VxeUI;
|
|
7
|
+
const { getI18n, getIcon, renderEmptyElement } = VxeUI;
|
|
8
8
|
export default defineComponent({
|
|
9
9
|
name: 'TableCustomPanel',
|
|
10
10
|
props: {
|
|
@@ -17,12 +17,12 @@ export default defineComponent({
|
|
|
17
17
|
const VxeUIModalComponent = VxeUI.getComponent('VxeModal');
|
|
18
18
|
const VxeUIDrawerComponent = VxeUI.getComponent('VxeDrawer');
|
|
19
19
|
const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
|
|
20
|
-
const
|
|
20
|
+
const VxeUINumberInputComponent = VxeUI.getComponent('VxeNumberInput');
|
|
21
21
|
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
|
|
22
22
|
const VxeUIRadioGroupComponent = VxeUI.getComponent('VxeRadioGroup');
|
|
23
23
|
const $xeTable = inject('$xeTable', {});
|
|
24
24
|
const { reactData } = $xeTable;
|
|
25
|
-
const { computeCustomOpts, computeColumnOpts, computeIsMaxFixedColumn } = $xeTable.getComputeMaps();
|
|
25
|
+
const { computeCustomOpts, computeColumnOpts, computeIsMaxFixedColumn, computeResizableOpts } = $xeTable.getComputeMaps();
|
|
26
26
|
const refElem = ref();
|
|
27
27
|
const bodyElemRef = ref();
|
|
28
28
|
const dragHintElemRef = ref();
|
|
@@ -43,73 +43,21 @@ export default defineComponent({
|
|
|
43
43
|
}, 300);
|
|
44
44
|
};
|
|
45
45
|
const confirmCustomEvent = ({ $event }) => {
|
|
46
|
-
|
|
47
|
-
const customOpts = computeCustomOpts.value;
|
|
48
|
-
const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts;
|
|
49
|
-
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
50
|
-
if (parent) {
|
|
51
|
-
// 更新子列信息
|
|
52
|
-
column.fixed = parent.fixed;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
if (allowSort) {
|
|
56
|
-
const sortIndex = index + 1;
|
|
57
|
-
column.renderSortNumber = sortIndex;
|
|
58
|
-
}
|
|
59
|
-
if (allowFixed) {
|
|
60
|
-
column.fixed = column.renderFixed;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (allowResizable) {
|
|
64
|
-
if (column.renderVisible && (!column.children || column.children.length)) {
|
|
65
|
-
if (column.renderResizeWidth !== column.renderWidth) {
|
|
66
|
-
column.resizeWidth = column.renderResizeWidth;
|
|
67
|
-
column.renderWidth = column.renderResizeWidth;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (allowVisible) {
|
|
72
|
-
column.visible = column.renderVisible;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
46
|
+
$xeTable.saveCustom();
|
|
75
47
|
$xeTable.closeCustom();
|
|
76
48
|
$xeTable.emitCustomEvent('confirm', $event);
|
|
77
|
-
$xeTable.saveCustomStore('confirm');
|
|
78
49
|
};
|
|
79
50
|
const cancelCloseEvent = ({ $event }) => {
|
|
80
51
|
$xeTable.closeCustom();
|
|
81
52
|
$xeTable.emitCustomEvent('close', $event);
|
|
82
53
|
};
|
|
83
54
|
const cancelCustomEvent = ({ $event }) => {
|
|
84
|
-
|
|
85
|
-
const { customColumnList } = reactData;
|
|
86
|
-
const { oldSortMaps, oldFixedMaps, oldVisibleMaps } = customStore;
|
|
87
|
-
const customOpts = computeCustomOpts.value;
|
|
88
|
-
const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts;
|
|
89
|
-
XEUtils.eachTree(customColumnList, column => {
|
|
90
|
-
const colid = column.getKey();
|
|
91
|
-
const visible = !!oldVisibleMaps[colid];
|
|
92
|
-
const fixed = oldFixedMaps[colid] || '';
|
|
93
|
-
if (allowVisible) {
|
|
94
|
-
column.renderVisible = visible;
|
|
95
|
-
column.visible = visible;
|
|
96
|
-
}
|
|
97
|
-
if (allowFixed) {
|
|
98
|
-
column.renderFixed = fixed;
|
|
99
|
-
column.fixed = fixed;
|
|
100
|
-
}
|
|
101
|
-
if (allowSort) {
|
|
102
|
-
column.renderSortNumber = oldSortMaps[colid] || 0;
|
|
103
|
-
}
|
|
104
|
-
if (allowResizable) {
|
|
105
|
-
column.renderResizeWidth = column.renderWidth;
|
|
106
|
-
}
|
|
107
|
-
}, { children: 'children' });
|
|
55
|
+
$xeTable.cancelCustom();
|
|
108
56
|
$xeTable.closeCustom();
|
|
109
57
|
$xeTable.emitCustomEvent('cancel', $event);
|
|
110
58
|
};
|
|
111
59
|
const handleResetCustomEvent = (evnt) => {
|
|
112
|
-
$xeTable.
|
|
60
|
+
$xeTable.resetCustom(true);
|
|
113
61
|
$xeTable.closeCustom();
|
|
114
62
|
$xeTable.emitCustomEvent('reset', evnt);
|
|
115
63
|
};
|
|
@@ -199,41 +147,7 @@ export default defineComponent({
|
|
|
199
147
|
}
|
|
200
148
|
};
|
|
201
149
|
const allOptionEvent = () => {
|
|
202
|
-
|
|
203
|
-
const { customColumnList } = reactData;
|
|
204
|
-
const customOpts = computeCustomOpts.value;
|
|
205
|
-
const { checkMethod, visibleMethod } = customOpts;
|
|
206
|
-
const isAll = !customStore.isAll;
|
|
207
|
-
if (customOpts.immediate) {
|
|
208
|
-
XEUtils.eachTree(customColumnList, (column) => {
|
|
209
|
-
if (visibleMethod && !visibleMethod({ column })) {
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
if (checkMethod && !checkMethod({ column })) {
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
column.visible = isAll;
|
|
216
|
-
column.renderVisible = isAll;
|
|
217
|
-
column.halfVisible = false;
|
|
218
|
-
});
|
|
219
|
-
customStore.isAll = isAll;
|
|
220
|
-
$xeTable.handleCustom();
|
|
221
|
-
$xeTable.saveCustomStore('update:visible');
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
XEUtils.eachTree(customColumnList, (column) => {
|
|
225
|
-
if (visibleMethod && !visibleMethod({ column })) {
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
if (checkMethod && !checkMethod({ column })) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
column.renderVisible = isAll;
|
|
232
|
-
column.halfVisible = false;
|
|
233
|
-
});
|
|
234
|
-
customStore.isAll = isAll;
|
|
235
|
-
}
|
|
236
|
-
$xeTable.checkCustomStatus();
|
|
150
|
+
$xeTable.toggleCustomAllCheckbox();
|
|
237
151
|
};
|
|
238
152
|
const sortMousedownEvent = (evnt) => {
|
|
239
153
|
const btnEl = evnt.currentTarget;
|
|
@@ -244,6 +158,7 @@ export default defineComponent({
|
|
|
244
158
|
trEl.draggable = true;
|
|
245
159
|
dragColumnRef.value = column;
|
|
246
160
|
addClass(trEl, 'active--drag-origin');
|
|
161
|
+
updateDropHint(evnt);
|
|
247
162
|
};
|
|
248
163
|
const sortMouseupEvent = (evnt) => {
|
|
249
164
|
const btnEl = evnt.currentTarget;
|
|
@@ -351,13 +266,29 @@ export default defineComponent({
|
|
|
351
266
|
const { maxHeight } = customStore;
|
|
352
267
|
const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts;
|
|
353
268
|
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
269
|
+
const slots = customOpts.slots || {};
|
|
270
|
+
const headerSlot = slots.header;
|
|
271
|
+
const topSlot = slots.top;
|
|
272
|
+
const bottomSlot = slots.bottom;
|
|
273
|
+
const defaultSlot = slots.default;
|
|
274
|
+
const footerSlot = slots.footer;
|
|
354
275
|
const colVNs = [];
|
|
355
276
|
const customWrapperOns = {};
|
|
277
|
+
const isAllChecked = customStore.isAll;
|
|
278
|
+
const isAllIndeterminate = customStore.isIndeterminate;
|
|
279
|
+
const dragColumn = dragColumnRef.value;
|
|
356
280
|
// hover 触发
|
|
357
281
|
if (trigger === 'hover') {
|
|
358
282
|
customWrapperOns.onMouseenter = handleWrapperMouseenterEvent;
|
|
359
283
|
customWrapperOns.onMouseleave = handleWrapperMouseleaveEvent;
|
|
360
284
|
}
|
|
285
|
+
const params = {
|
|
286
|
+
$table: $xeTable,
|
|
287
|
+
$grid: $xeTable.xegrid,
|
|
288
|
+
columns: customColumnList,
|
|
289
|
+
isAllChecked,
|
|
290
|
+
isAllIndeterminate
|
|
291
|
+
};
|
|
361
292
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
362
293
|
const isVisible = visibleMethod ? visibleMethod({ column }) : true;
|
|
363
294
|
if (isVisible) {
|
|
@@ -458,9 +389,6 @@ export default defineComponent({
|
|
|
458
389
|
]));
|
|
459
390
|
}
|
|
460
391
|
});
|
|
461
|
-
const isAllChecked = customStore.isAll;
|
|
462
|
-
const isAllIndeterminate = customStore.isIndeterminate;
|
|
463
|
-
const dragColumn = dragColumnRef.value;
|
|
464
392
|
return h('div', {
|
|
465
393
|
ref: refElem,
|
|
466
394
|
key: 'simple',
|
|
@@ -474,40 +402,60 @@ export default defineComponent({
|
|
|
474
402
|
: {}
|
|
475
403
|
}, customStore.visible
|
|
476
404
|
? [
|
|
477
|
-
h('
|
|
405
|
+
h('div', {
|
|
478
406
|
class: 'vxe-table-custom--header'
|
|
479
|
-
},
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
'is--indeterminate': isAllIndeterminate
|
|
488
|
-
}],
|
|
489
|
-
title: getI18n('vxe.table.allTitle'),
|
|
490
|
-
onClick: allOptionEvent
|
|
407
|
+
}, headerSlot
|
|
408
|
+
? $xeTable.callSlot(headerSlot, params)
|
|
409
|
+
: [
|
|
410
|
+
h('ul', {
|
|
411
|
+
class: 'vxe-table-custom--panel-list'
|
|
412
|
+
}, [
|
|
413
|
+
h('li', {
|
|
414
|
+
class: 'vxe-table-custom--option'
|
|
491
415
|
}, [
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
416
|
+
allowVisible
|
|
417
|
+
? h('div', {
|
|
418
|
+
class: ['vxe-table-custom--checkbox-option', {
|
|
419
|
+
'is--checked': isAllChecked,
|
|
420
|
+
'is--indeterminate': isAllIndeterminate
|
|
421
|
+
}],
|
|
422
|
+
title: getI18n('vxe.table.allTitle'),
|
|
423
|
+
onClick: allOptionEvent
|
|
424
|
+
}, [
|
|
425
|
+
h('span', {
|
|
426
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
427
|
+
}),
|
|
428
|
+
h('span', {
|
|
429
|
+
class: 'vxe-checkbox--label'
|
|
430
|
+
}, getI18n('vxe.toolbar.customAll'))
|
|
431
|
+
])
|
|
432
|
+
: h('span', {
|
|
433
|
+
class: 'vxe-checkbox--label'
|
|
434
|
+
}, getI18n('vxe.table.customTitle'))
|
|
498
435
|
])
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
}, getI18n('vxe.table.customTitle'))
|
|
502
|
-
])
|
|
503
|
-
]),
|
|
436
|
+
])
|
|
437
|
+
]),
|
|
504
438
|
h('div', {
|
|
505
439
|
ref: bodyElemRef,
|
|
506
|
-
class: 'vxe-table-custom--
|
|
440
|
+
class: 'vxe-table-custom--body'
|
|
507
441
|
}, [
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
442
|
+
topSlot
|
|
443
|
+
? h('div', {
|
|
444
|
+
class: 'vxe-table-custom--panel-top'
|
|
445
|
+
}, $xeTable.callSlot(topSlot, params))
|
|
446
|
+
: renderEmptyElement($xeTable),
|
|
447
|
+
defaultSlot
|
|
448
|
+
? h('div', {
|
|
449
|
+
class: 'vxe-table-custom--panel-body'
|
|
450
|
+
}, $xeTable.callSlot(defaultSlot, params))
|
|
451
|
+
: h(TransitionGroup, Object.assign({ class: 'vxe-table-custom--panel-list', name: 'vxe-table-custom--list', tag: 'ul' }, customWrapperOns), {
|
|
452
|
+
default: () => colVNs
|
|
453
|
+
}),
|
|
454
|
+
bottomSlot
|
|
455
|
+
? h('div', {
|
|
456
|
+
class: 'vxe-table-custom--panel-bottom'
|
|
457
|
+
}, $xeTable.callSlot(bottomSlot, params))
|
|
458
|
+
: renderEmptyElement($xeTable),
|
|
511
459
|
h('div', {
|
|
512
460
|
ref: dragHintElemRef,
|
|
513
461
|
class: 'vxe-table-custom-popup--drag-hint'
|
|
@@ -516,40 +464,46 @@ export default defineComponent({
|
|
|
516
464
|
customOpts.showFooter
|
|
517
465
|
? h('div', {
|
|
518
466
|
class: 'vxe-table-custom--footer'
|
|
519
|
-
},
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
467
|
+
}, footerSlot
|
|
468
|
+
? $xeTable.callSlot(footerSlot, params)
|
|
469
|
+
: [
|
|
470
|
+
h('div', {
|
|
471
|
+
class: 'vxe-table-custom--footer-buttons'
|
|
472
|
+
}, [
|
|
473
|
+
VxeUIButtonComponent
|
|
474
|
+
? h(VxeUIButtonComponent, {
|
|
475
|
+
mode: 'text',
|
|
476
|
+
content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
|
|
477
|
+
onClick: resetCustomEvent
|
|
478
|
+
})
|
|
479
|
+
: createCommentVNode(),
|
|
480
|
+
customOpts.immediate
|
|
481
|
+
? (VxeUIButtonComponent
|
|
482
|
+
? h(VxeUIButtonComponent, {
|
|
483
|
+
mode: 'text',
|
|
484
|
+
content: customOpts.closeButtonText || getI18n('vxe.table.customClose'),
|
|
485
|
+
onClick: cancelCloseEvent
|
|
486
|
+
})
|
|
487
|
+
: createCommentVNode())
|
|
488
|
+
: (VxeUIButtonComponent
|
|
489
|
+
? h(VxeUIButtonComponent, {
|
|
490
|
+
mode: 'text',
|
|
491
|
+
content: customOpts.cancelButtonText || getI18n('vxe.table.customCancel'),
|
|
492
|
+
onClick: cancelCustomEvent
|
|
493
|
+
})
|
|
494
|
+
: createCommentVNode()),
|
|
495
|
+
customOpts.immediate
|
|
496
|
+
? createCommentVNode()
|
|
497
|
+
: (VxeUIButtonComponent
|
|
498
|
+
? h(VxeUIButtonComponent, {
|
|
499
|
+
mode: 'text',
|
|
500
|
+
status: 'primary',
|
|
501
|
+
content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm'),
|
|
502
|
+
onClick: confirmCustomEvent
|
|
503
|
+
})
|
|
504
|
+
: createCommentVNode())
|
|
505
|
+
])
|
|
506
|
+
])
|
|
553
507
|
: null
|
|
554
508
|
]
|
|
555
509
|
: []);
|
|
@@ -561,14 +515,50 @@ export default defineComponent({
|
|
|
561
515
|
const { modalOptions, drawerOptions, allowVisible, allowSort, allowFixed, allowResizable, checkMethod, visibleMethod } = customOpts;
|
|
562
516
|
const columnOpts = computeColumnOpts.value;
|
|
563
517
|
const { maxFixedSize } = columnOpts;
|
|
518
|
+
const resizableOpts = computeResizableOpts.value;
|
|
519
|
+
const { minWidth: reMinWidth, maxWidth: reMaxWidth } = resizableOpts;
|
|
564
520
|
const { mode } = customOpts;
|
|
565
521
|
const modalOpts = Object.assign({}, modalOptions);
|
|
566
522
|
const drawerOpts = Object.assign({}, drawerOptions);
|
|
567
523
|
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
524
|
+
const slots = customOpts.slots || {};
|
|
525
|
+
const headerSlot = slots.header;
|
|
526
|
+
const topSlot = slots.top;
|
|
527
|
+
const bottomSlot = slots.bottom;
|
|
528
|
+
const defaultSlot = slots.default;
|
|
529
|
+
const footerSlot = slots.footer;
|
|
568
530
|
const trVNs = [];
|
|
531
|
+
const isAllChecked = customStore.isAll;
|
|
532
|
+
const isAllIndeterminate = customStore.isIndeterminate;
|
|
533
|
+
const dragColumn = dragColumnRef.value;
|
|
534
|
+
const params = {
|
|
535
|
+
$table: $xeTable,
|
|
536
|
+
$grid: $xeTable.xegrid,
|
|
537
|
+
columns: customColumnList,
|
|
538
|
+
isAllChecked,
|
|
539
|
+
isAllIndeterminate
|
|
540
|
+
};
|
|
569
541
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
570
542
|
const isVisible = visibleMethod ? visibleMethod({ column }) : true;
|
|
571
543
|
if (isVisible) {
|
|
544
|
+
// 默认继承调整宽度
|
|
545
|
+
let customMinWidth = 0;
|
|
546
|
+
let customMaxWidth = 0;
|
|
547
|
+
if (allowResizable) {
|
|
548
|
+
const resizeParams = {
|
|
549
|
+
$table: $xeTable,
|
|
550
|
+
column,
|
|
551
|
+
columnIndex: index,
|
|
552
|
+
$columnIndex: index,
|
|
553
|
+
$rowIndex: -1
|
|
554
|
+
};
|
|
555
|
+
if (reMinWidth) {
|
|
556
|
+
customMinWidth = XEUtils.toNumber(XEUtils.isFunction(reMinWidth) ? reMinWidth(resizeParams) : reMinWidth);
|
|
557
|
+
}
|
|
558
|
+
if (reMaxWidth) {
|
|
559
|
+
customMaxWidth = XEUtils.toNumber(XEUtils.isFunction(reMaxWidth) ? reMaxWidth(resizeParams) : reMaxWidth);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
572
562
|
const isChecked = column.renderVisible;
|
|
573
563
|
const isIndeterminate = column.halfVisible;
|
|
574
564
|
const colTitle = formatText(column.getTitle(), 1);
|
|
@@ -649,11 +639,13 @@ export default defineComponent({
|
|
|
649
639
|
}, [
|
|
650
640
|
column.children && column.children.length
|
|
651
641
|
? h('span', '-')
|
|
652
|
-
: (
|
|
653
|
-
? h(
|
|
642
|
+
: (VxeUINumberInputComponent
|
|
643
|
+
? h(VxeUINumberInputComponent, {
|
|
654
644
|
type: 'integer',
|
|
655
645
|
disabled: isDisabled || isHidden,
|
|
656
646
|
modelValue: column.renderResizeWidth,
|
|
647
|
+
min: customMinWidth || undefined,
|
|
648
|
+
max: customMaxWidth || undefined,
|
|
657
649
|
'onUpdate:modelValue'(value) {
|
|
658
650
|
column.renderResizeWidth = Math.max(0, Number(value));
|
|
659
651
|
}
|
|
@@ -688,15 +680,20 @@ export default defineComponent({
|
|
|
688
680
|
]));
|
|
689
681
|
}
|
|
690
682
|
});
|
|
691
|
-
const isAllChecked = customStore.isAll;
|
|
692
|
-
const isAllIndeterminate = customStore.isIndeterminate;
|
|
693
|
-
const dragColumn = dragColumnRef.value;
|
|
694
683
|
const scopedSlots = {
|
|
695
684
|
default: () => {
|
|
685
|
+
if (defaultSlot) {
|
|
686
|
+
return $xeTable.callSlot(defaultSlot, params);
|
|
687
|
+
}
|
|
696
688
|
return h('div', {
|
|
697
689
|
ref: bodyElemRef,
|
|
698
690
|
class: 'vxe-table-custom-popup--body'
|
|
699
691
|
}, [
|
|
692
|
+
topSlot
|
|
693
|
+
? h('div', {
|
|
694
|
+
class: 'vxe-table-custom-popup--table-top'
|
|
695
|
+
}, $xeTable.callSlot(topSlot, params))
|
|
696
|
+
: renderEmptyElement($xeTable),
|
|
700
697
|
h('div', {
|
|
701
698
|
class: 'vxe-table-custom-popup--table-wrapper'
|
|
702
699
|
}, [
|
|
@@ -704,35 +701,25 @@ export default defineComponent({
|
|
|
704
701
|
h('colgroup', {}, [
|
|
705
702
|
allowVisible
|
|
706
703
|
? h('col', {
|
|
707
|
-
|
|
708
|
-
width: '80px'
|
|
709
|
-
}
|
|
704
|
+
class: 'vxe-table-custom-popup--table-col-seq'
|
|
710
705
|
})
|
|
711
706
|
: createCommentVNode(),
|
|
712
707
|
allowSort
|
|
713
708
|
? h('col', {
|
|
714
|
-
|
|
715
|
-
width: '80px'
|
|
716
|
-
}
|
|
709
|
+
class: 'vxe-table-custom-popup--table-col-sort'
|
|
717
710
|
})
|
|
718
711
|
: createCommentVNode(),
|
|
719
712
|
h('col', {
|
|
720
|
-
|
|
721
|
-
minWidth: '120px'
|
|
722
|
-
}
|
|
713
|
+
class: 'vxe-table-custom-popup--table-col-title'
|
|
723
714
|
}),
|
|
724
715
|
allowResizable
|
|
725
716
|
? h('col', {
|
|
726
|
-
|
|
727
|
-
width: '140px'
|
|
728
|
-
}
|
|
717
|
+
class: 'vxe-table-custom-popup--table-col-width'
|
|
729
718
|
})
|
|
730
719
|
: createCommentVNode(),
|
|
731
720
|
allowFixed
|
|
732
721
|
? h('col', {
|
|
733
|
-
|
|
734
|
-
width: '200px'
|
|
735
|
-
}
|
|
722
|
+
class: 'vxe-table-custom-popup--table-col-fixed'
|
|
736
723
|
})
|
|
737
724
|
: createCommentVNode()
|
|
738
725
|
]),
|
|
@@ -787,7 +774,7 @@ export default defineComponent({
|
|
|
787
774
|
])
|
|
788
775
|
]),
|
|
789
776
|
h(TransitionGroup, {
|
|
790
|
-
class: 'vxe-table-custom--
|
|
777
|
+
class: 'vxe-table-custom--panel-list',
|
|
791
778
|
tag: 'tbody',
|
|
792
779
|
name: 'vxe-table-custom--list'
|
|
793
780
|
}, {
|
|
@@ -795,6 +782,11 @@ export default defineComponent({
|
|
|
795
782
|
})
|
|
796
783
|
])
|
|
797
784
|
]),
|
|
785
|
+
bottomSlot
|
|
786
|
+
? h('div', {
|
|
787
|
+
class: 'vxe-table-custom-popup--table-bottom'
|
|
788
|
+
}, $xeTable.callSlot(bottomSlot, params))
|
|
789
|
+
: renderEmptyElement($xeTable),
|
|
798
790
|
h('div', {
|
|
799
791
|
ref: dragHintElemRef,
|
|
800
792
|
class: 'vxe-table-custom-popup--drag-hint'
|
|
@@ -802,6 +794,9 @@ export default defineComponent({
|
|
|
802
794
|
]);
|
|
803
795
|
},
|
|
804
796
|
footer: () => {
|
|
797
|
+
if (footerSlot) {
|
|
798
|
+
return $xeTable.callSlot(footerSlot, params);
|
|
799
|
+
}
|
|
805
800
|
return h('div', {
|
|
806
801
|
class: 'vxe-table-custom-popup--footer'
|
|
807
802
|
}, [
|
|
@@ -827,6 +822,9 @@ export default defineComponent({
|
|
|
827
822
|
]);
|
|
828
823
|
}
|
|
829
824
|
};
|
|
825
|
+
if (headerSlot) {
|
|
826
|
+
scopedSlots.header = () => $xeTable.callSlot(headerSlot, params);
|
|
827
|
+
}
|
|
830
828
|
if (mode === 'drawer') {
|
|
831
829
|
return VxeUIDrawerComponent
|
|
832
830
|
? h(VxeUIDrawerComponent, {
|
|
@@ -890,8 +888,8 @@ export default defineComponent({
|
|
|
890
888
|
if (!VxeUIButtonComponent) {
|
|
891
889
|
errLog('vxe.error.reqComp', ['vxe-button']);
|
|
892
890
|
}
|
|
893
|
-
if (!
|
|
894
|
-
errLog('vxe.error.reqComp', ['vxe-input']);
|
|
891
|
+
if (!VxeUINumberInputComponent) {
|
|
892
|
+
errLog('vxe.error.reqComp', ['vxe-number-input']);
|
|
895
893
|
}
|
|
896
894
|
if (!VxeUITooltipComponent) {
|
|
897
895
|
errLog('vxe.error.reqComp', ['vxe-tooltip']);
|
|
@@ -64,7 +64,7 @@ hooks.add('tableValidatorModule', {
|
|
|
64
64
|
const validOpts = computeValidOpts.value;
|
|
65
65
|
if (validOpts.msgMode === 'single') {
|
|
66
66
|
const keys = Object.keys(validErrMaps);
|
|
67
|
-
const resMaps =
|
|
67
|
+
const resMaps = {};
|
|
68
68
|
if (keys.length) {
|
|
69
69
|
const firstKey = keys[0];
|
|
70
70
|
resMaps[firstKey] = validErrMaps[firstKey];
|
package/es/table/src/body.js
CHANGED
|
@@ -288,19 +288,25 @@ export default defineComponent({
|
|
|
288
288
|
const validSlot = slots ? slots.valid : null;
|
|
289
289
|
const validParams = Object.assign(Object.assign({}, params), errorValidItem);
|
|
290
290
|
tdVNs.push(h('div', {
|
|
291
|
-
class: ['vxe-cell--valid-error-
|
|
291
|
+
class: ['vxe-cell--valid-error-tip', getPropClass(validOpts.className, validParams)],
|
|
292
292
|
style: errRule && errRule.maxWidth
|
|
293
293
|
? {
|
|
294
294
|
width: `${errRule.maxWidth}px`
|
|
295
295
|
}
|
|
296
296
|
: null
|
|
297
|
-
},
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
297
|
+
}, [
|
|
298
|
+
h('div', {
|
|
299
|
+
class: `vxe-cell--valid-error-wrapper vxe-cell--valid-error-theme-${validOpts.theme || 'normal'}`
|
|
300
|
+
}, [
|
|
301
|
+
validSlot
|
|
302
|
+
? $xeTable.callSlot(validSlot, validParams)
|
|
303
|
+
: [
|
|
304
|
+
h('span', {
|
|
305
|
+
class: 'vxe-cell--valid-error-msg'
|
|
306
|
+
}, errorValidItem.content)
|
|
307
|
+
]
|
|
308
|
+
])
|
|
309
|
+
]));
|
|
304
310
|
}
|
|
305
311
|
}
|
|
306
312
|
let cellHeight = '';
|