vxe-table 3.12.0-beta.8 → 3.12.0
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/locale/lang/de-DE.js +490 -490
- package/es/locale/lang/en-US.js +438 -438
- package/es/locale/lang/it-IT.js +692 -0
- package/es/locale/lang/ru-RU.js +36 -36
- package/es/locale/lang/th-TH.js +692 -0
- package/es/locale/lang/zh-CHT.js +19 -19
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +5 -5
- package/es/table/module/export/mixin.js +208 -140
- package/es/table/module/validator/mixin.js +2 -6
- package/es/table/src/cell.js +88 -61
- package/es/table/src/column.js +2 -2
- package/es/table/src/group.js +2 -2
- package/es/table/src/methods.js +112 -87
- package/es/table/src/table.js +7 -11
- package/es/toolbar/src/toolbar.js +22 -4
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/vn.js +3 -0
- package/lib/index.umd.js +513 -362
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/de-DE.js +490 -490
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +438 -438
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +438 -438
- package/lib/locale/lang/it-IT.js +698 -0
- package/lib/locale/lang/it-IT.min.js +1 -0
- package/lib/locale/lang/ru-RU.js +36 -36
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +36 -36
- package/lib/locale/lang/th-TH.js +698 -0
- package/lib/locale/lang/th-TH.min.js +1 -0
- package/lib/locale/lang/zh-CHT.js +19 -19
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +19 -19
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +5 -5
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +239 -167
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +1 -6
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/src/cell.js +109 -83
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +112 -87
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +4 -9
- package/lib/table/src/table.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +36 -2
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +2 -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/ui/src/vn.js +3 -0
- package/lib/ui/src/vn.min.js +1 -1
- package/package.json +3 -3
- package/packages/locale/lang/de-DE.ts +492 -491
- package/packages/locale/lang/en-US.ts +438 -438
- package/packages/locale/lang/it-IT.ts +692 -0
- package/packages/locale/lang/ru-RU.ts +36 -36
- package/packages/locale/lang/th-TH.ts +692 -0
- package/packages/locale/lang/zh-CHT.ts +19 -19
- package/packages/table/module/custom/panel.ts +5 -5
- package/packages/table/module/export/mixin.ts +227 -156
- package/packages/table/module/validator/mixin.ts +2 -6
- package/packages/table/src/cell.ts +141 -108
- package/packages/table/src/methods.ts +136 -105
- package/packages/table/src/table.ts +8 -12
- package/packages/toolbar/src/toolbar.ts +26 -8
- package/packages/ui/index.ts +1 -1
- package/packages/ui/src/vn.ts +4 -1
- /package/es/{iconfont.1735299026800.ttf → iconfont.1735661059384.ttf} +0 -0
- /package/es/{iconfont.1735299026800.woff → iconfont.1735661059384.woff} +0 -0
- /package/es/{iconfont.1735299026800.woff2 → iconfont.1735661059384.woff2} +0 -0
- /package/lib/{iconfont.1735299026800.ttf → iconfont.1735661059384.ttf} +0 -0
- /package/lib/{iconfont.1735299026800.woff → iconfont.1735661059384.woff} +0 -0
- /package/lib/{iconfont.1735299026800.woff2 → iconfont.1735661059384.woff2} +0 -0
|
@@ -148,7 +148,7 @@ export default {
|
|
|
148
148
|
*/
|
|
149
149
|
beginValidate(rows, cols, cb, isFull) {
|
|
150
150
|
const validRest = {};
|
|
151
|
-
const { editRules, afterFullData,
|
|
151
|
+
const { editRules, afterFullData, treeConfig, treeOpts } = this;
|
|
152
152
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
153
153
|
let validList;
|
|
154
154
|
if (rows === true) {
|
|
@@ -262,11 +262,7 @@ export default {
|
|
|
262
262
|
else {
|
|
263
263
|
const row = firstErrParams.row;
|
|
264
264
|
const column = firstErrParams.column;
|
|
265
|
-
|
|
266
|
-
const columnIndex = visibleColumn.indexOf(column);
|
|
267
|
-
const targetRow = rowIndex > 0 ? afterFullData[rowIndex - 1] : row;
|
|
268
|
-
const targetColumn = columnIndex > 0 ? visibleColumn[columnIndex - 1] : column;
|
|
269
|
-
this.scrollToRow(targetRow, targetColumn).then(posAndFinish);
|
|
265
|
+
this.scrollToRow(row, column).then(posAndFinish);
|
|
270
266
|
}
|
|
271
267
|
});
|
|
272
268
|
});
|
package/es/table/src/cell.js
CHANGED
|
@@ -77,12 +77,12 @@ function renderCellBaseVNs(h, params, content) {
|
|
|
77
77
|
const { treeConfig, dragConfig } = tableProps;
|
|
78
78
|
const rowOpts = $table.computeRowOpts;
|
|
79
79
|
const rowDragOpts = $table.computeRowDragOpts;
|
|
80
|
-
const { showIcon, isCrossDrag, visibleMethod } = rowDragOpts;
|
|
80
|
+
const { showIcon, isPeerDrag, isCrossDrag, visibleMethod } = rowDragOpts;
|
|
81
81
|
const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null);
|
|
82
82
|
const vns = XEUtils.isArray(content) ? content : [content];
|
|
83
83
|
if (dragSort && rowOpts.drag && ((showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params)))) {
|
|
84
84
|
if (treeConfig) {
|
|
85
|
-
if (isCrossDrag || !level) {
|
|
85
|
+
if (isPeerDrag || isCrossDrag || !level) {
|
|
86
86
|
vns.unshift(renderCellDragIcon(h, params));
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -96,9 +96,9 @@ function renderHeaderCellDragIcon(h, params) {
|
|
|
96
96
|
const { $table, column } = params;
|
|
97
97
|
const columnOpts = $table.computeColumnOpts;
|
|
98
98
|
const columnDragOpts = $table.computeColumnDragOpts;
|
|
99
|
-
const { showIcon, icon, trigger, isCrossDrag, visibleMethod, disabledMethod } = columnDragOpts;
|
|
99
|
+
const { showIcon, icon, trigger, isPeerDrag, isCrossDrag, visibleMethod, disabledMethod } = columnDragOpts;
|
|
100
100
|
if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
|
|
101
|
-
if (!column.fixed && (isCrossDrag || !column.parentId)) {
|
|
101
|
+
if (!column.fixed && (isPeerDrag || isCrossDrag || !column.parentId)) {
|
|
102
102
|
const isDisabled = disabledMethod && disabledMethod(params);
|
|
103
103
|
const ons = {};
|
|
104
104
|
if (trigger !== 'cell') {
|
|
@@ -136,15 +136,18 @@ function renderHeaderCellBaseVNs(h, params, content) {
|
|
|
136
136
|
function renderTitleContent(h, params, content) {
|
|
137
137
|
const { $table, column } = params;
|
|
138
138
|
const { type, showHeaderOverflow } = column;
|
|
139
|
-
const
|
|
140
|
-
const
|
|
139
|
+
const tableProps = $table;
|
|
140
|
+
const tableReactData = $table;
|
|
141
|
+
const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps;
|
|
142
|
+
const tooltipOpts = $table.computeTooltipOpts;
|
|
143
|
+
const showAllTip = tooltipOpts.showAll;
|
|
141
144
|
const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
142
145
|
const showTitle = headOverflow === 'title';
|
|
143
146
|
const showTooltip = headOverflow === true || headOverflow === 'tooltip';
|
|
144
147
|
const ons = {};
|
|
145
148
|
if (showTitle || showTooltip || showAllTip) {
|
|
146
149
|
ons.mouseenter = (evnt) => {
|
|
147
|
-
if (
|
|
150
|
+
if (tableReactData._isResize) {
|
|
148
151
|
return;
|
|
149
152
|
}
|
|
150
153
|
if (showTitle) {
|
|
@@ -157,7 +160,7 @@ function renderTitleContent(h, params, content) {
|
|
|
157
160
|
}
|
|
158
161
|
if (showTooltip || showAllTip) {
|
|
159
162
|
ons.mouseleave = (evnt) => {
|
|
160
|
-
if (
|
|
163
|
+
if (tableReactData._isResize) {
|
|
161
164
|
return;
|
|
162
165
|
}
|
|
163
166
|
if (showTooltip || showAllTip) {
|
|
@@ -182,13 +185,13 @@ function renderTitleContent(h, params, content) {
|
|
|
182
185
|
}
|
|
183
186
|
function formatFooterLabel(footerFormatter, params) {
|
|
184
187
|
if (XEUtils.isFunction(footerFormatter)) {
|
|
185
|
-
return footerFormatter(params)
|
|
188
|
+
return `${footerFormatter(params)}`;
|
|
186
189
|
}
|
|
187
190
|
const isArr = XEUtils.isArray(footerFormatter);
|
|
188
191
|
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter);
|
|
189
192
|
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
190
193
|
if (footerFormatMethod) {
|
|
191
|
-
return isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)
|
|
194
|
+
return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`;
|
|
192
195
|
}
|
|
193
196
|
return '';
|
|
194
197
|
}
|
|
@@ -362,7 +365,11 @@ export const Cell = {
|
|
|
362
365
|
*/
|
|
363
366
|
renderTreeIcon(h, params, cellVNodes) {
|
|
364
367
|
const { $table, isHidden } = params;
|
|
365
|
-
const
|
|
368
|
+
const tableReactData = $table;
|
|
369
|
+
const tableInternalData = $table;
|
|
370
|
+
const { treeExpandedMaps, treeExpandLazyLoadedMaps } = tableReactData;
|
|
371
|
+
const { fullAllDataRowIdData } = tableInternalData;
|
|
372
|
+
const treeOpts = $table.computeTreeOpts;
|
|
366
373
|
const { row, column, level } = params;
|
|
367
374
|
const { slots } = column;
|
|
368
375
|
const { indent, lazy, trigger, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts;
|
|
@@ -370,17 +377,18 @@ export const Cell = {
|
|
|
370
377
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
371
378
|
const rowChilds = row[childrenField];
|
|
372
379
|
const hasChild = rowChilds && rowChilds.length;
|
|
380
|
+
const iconSlot = slots ? slots.icon : null;
|
|
373
381
|
let hasLazyChilds = false;
|
|
374
|
-
let
|
|
382
|
+
let isActive = false;
|
|
375
383
|
let isLazyLoading = false;
|
|
376
384
|
let isLazyLoaded = false;
|
|
377
|
-
const
|
|
378
|
-
if (
|
|
379
|
-
return $table.callSlot(
|
|
385
|
+
const ons = {};
|
|
386
|
+
if (iconSlot) {
|
|
387
|
+
return $table.callSlot(iconSlot, params, h);
|
|
380
388
|
}
|
|
381
389
|
if (!isHidden) {
|
|
382
390
|
const rowid = getRowid($table, row);
|
|
383
|
-
|
|
391
|
+
isActive = !!treeExpandedMaps[rowid];
|
|
384
392
|
if (lazy) {
|
|
385
393
|
const rest = fullAllDataRowIdData[rowid];
|
|
386
394
|
isLazyLoading = !!treeExpandLazyLoadedMaps[rowid];
|
|
@@ -389,14 +397,14 @@ export const Cell = {
|
|
|
389
397
|
}
|
|
390
398
|
}
|
|
391
399
|
if (!trigger || trigger === 'default') {
|
|
392
|
-
|
|
400
|
+
ons.click = (evnt) => {
|
|
393
401
|
$table.triggerTreeExpandEvent(evnt, params);
|
|
394
402
|
};
|
|
395
403
|
}
|
|
396
404
|
return [
|
|
397
405
|
h('div', {
|
|
398
406
|
class: ['vxe-cell--tree-node', {
|
|
399
|
-
'is--active':
|
|
407
|
+
'is--active': isActive
|
|
400
408
|
}],
|
|
401
409
|
style: {
|
|
402
410
|
paddingLeft: `${level * indent}px`
|
|
@@ -406,10 +414,10 @@ export const Cell = {
|
|
|
406
414
|
? [
|
|
407
415
|
h('div', {
|
|
408
416
|
class: 'vxe-tree--btn-wrapper',
|
|
409
|
-
on
|
|
417
|
+
on: ons
|
|
410
418
|
}, [
|
|
411
419
|
h('i', {
|
|
412
|
-
class: ['vxe-tree--node-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_TREE_LOADED) : (
|
|
420
|
+
class: ['vxe-tree--node-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_TREE_LOADED) : (isActive ? (iconOpen || getIcon().TABLE_TREE_OPEN) : (iconClose || getIcon().TABLE_TREE_CLOSE))]
|
|
413
421
|
})
|
|
414
422
|
])
|
|
415
423
|
]
|
|
@@ -430,7 +438,9 @@ export const Cell = {
|
|
|
430
438
|
},
|
|
431
439
|
renderSeqCell(h, params) {
|
|
432
440
|
const { $table, column } = params;
|
|
433
|
-
const
|
|
441
|
+
const tableProps = $table;
|
|
442
|
+
const { treeConfig } = tableProps;
|
|
443
|
+
const seqOpts = $table.computeSeqOpts;
|
|
434
444
|
const { slots } = column;
|
|
435
445
|
if (slots && slots.default) {
|
|
436
446
|
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h));
|
|
@@ -462,7 +472,9 @@ export const Cell = {
|
|
|
462
472
|
},
|
|
463
473
|
renderRadioCell(h, params) {
|
|
464
474
|
const { $table, column, isHidden } = params;
|
|
465
|
-
const
|
|
475
|
+
const tableReactData = $table;
|
|
476
|
+
const { selectRadioRow } = tableReactData;
|
|
477
|
+
const radioOpts = $table.computeRadioOpts;
|
|
466
478
|
const { slots } = column;
|
|
467
479
|
const { labelField, checkMethod, visibleMethod } = radioOpts;
|
|
468
480
|
const { row } = params;
|
|
@@ -517,19 +529,19 @@ export const Cell = {
|
|
|
517
529
|
*/
|
|
518
530
|
renderCheckboxHeader(h, params) {
|
|
519
531
|
const { $table, column, isHidden } = params;
|
|
520
|
-
const
|
|
532
|
+
const tableReactData = $table;
|
|
533
|
+
const { isAllSelected: isAllCheckboxSelected, isIndeterminate: isAllCheckboxIndeterminate } = tableReactData;
|
|
534
|
+
const isAllCheckboxDisabled = $table.computeIsAllCheckboxDisabled;
|
|
521
535
|
const { slots } = column;
|
|
522
536
|
const headerSlot = slots ? slots.header : null;
|
|
523
537
|
const titleSlot = slots ? slots.title : null;
|
|
524
|
-
const checkboxOpts = $table.
|
|
538
|
+
const checkboxOpts = $table.computeCheckboxOpts;
|
|
525
539
|
const headerTitle = column.getTitle();
|
|
526
|
-
|
|
540
|
+
const ons = {};
|
|
527
541
|
if (!isHidden) {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
$table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected);
|
|
532
|
-
}
|
|
542
|
+
ons.click = (evnt) => {
|
|
543
|
+
if (!isAllCheckboxDisabled) {
|
|
544
|
+
$table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected);
|
|
533
545
|
}
|
|
534
546
|
};
|
|
535
547
|
}
|
|
@@ -554,7 +566,7 @@ export const Cell = {
|
|
|
554
566
|
attrs: {
|
|
555
567
|
title: getI18n('vxe.table.allTitle')
|
|
556
568
|
},
|
|
557
|
-
on
|
|
569
|
+
on: ons
|
|
558
570
|
}, [
|
|
559
571
|
h('span', {
|
|
560
572
|
class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
@@ -570,8 +582,12 @@ export const Cell = {
|
|
|
570
582
|
},
|
|
571
583
|
renderCheckboxCell(h, params) {
|
|
572
584
|
const { $table, row, column, isHidden } = params;
|
|
573
|
-
const
|
|
574
|
-
const
|
|
585
|
+
const tableProps = $table;
|
|
586
|
+
const tableReactData = $table;
|
|
587
|
+
const { treeConfig } = tableProps;
|
|
588
|
+
const { selectCheckboxMaps, treeIndeterminateMaps } = tableReactData;
|
|
589
|
+
const checkboxOpts = $table.computeCheckboxOpts;
|
|
590
|
+
const { labelField, checkMethod, visibleMethod } = checkboxOpts;
|
|
575
591
|
const { slots } = column;
|
|
576
592
|
const defaultSlot = slots ? slots.default : null;
|
|
577
593
|
const checkboxSlot = slots ? slots.checkbox : null;
|
|
@@ -579,15 +595,13 @@ export const Cell = {
|
|
|
579
595
|
let isChecked = false;
|
|
580
596
|
const isVisible = !visibleMethod || visibleMethod({ row });
|
|
581
597
|
let isDisabled = !!checkMethod;
|
|
582
|
-
|
|
598
|
+
const ons = {};
|
|
583
599
|
if (!isHidden) {
|
|
584
600
|
const rowid = getRowid($table, row);
|
|
585
601
|
isChecked = !!selectCheckboxMaps[rowid];
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
590
|
-
}
|
|
602
|
+
ons.click = (evnt) => {
|
|
603
|
+
if (!isDisabled && isVisible) {
|
|
604
|
+
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
591
605
|
}
|
|
592
606
|
};
|
|
593
607
|
if (checkMethod) {
|
|
@@ -620,7 +634,7 @@ export const Cell = {
|
|
|
620
634
|
'is--indeterminate': indeterminate,
|
|
621
635
|
'is--hidden': !isVisible
|
|
622
636
|
}],
|
|
623
|
-
on
|
|
637
|
+
on: ons
|
|
624
638
|
}, checkVNs)
|
|
625
639
|
]);
|
|
626
640
|
},
|
|
@@ -629,7 +643,11 @@ export const Cell = {
|
|
|
629
643
|
},
|
|
630
644
|
renderCheckboxCellByProp(h, params) {
|
|
631
645
|
const { $table, row, column, isHidden } = params;
|
|
632
|
-
const
|
|
646
|
+
const tableProps = $table;
|
|
647
|
+
const tableReactData = $table;
|
|
648
|
+
const { treeConfig } = tableProps;
|
|
649
|
+
const { treeIndeterminateMaps } = tableReactData;
|
|
650
|
+
const checkboxOpts = $table.computeCheckboxOpts;
|
|
633
651
|
const { labelField, checkField, checkMethod, visibleMethod } = checkboxOpts;
|
|
634
652
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
635
653
|
const { slots } = column;
|
|
@@ -639,15 +657,13 @@ export const Cell = {
|
|
|
639
657
|
let isChecked = false;
|
|
640
658
|
const isVisible = !visibleMethod || visibleMethod({ row });
|
|
641
659
|
let isDisabled = !!checkMethod;
|
|
642
|
-
|
|
660
|
+
const ons = {};
|
|
643
661
|
if (!isHidden) {
|
|
644
662
|
const rowid = getRowid($table, row);
|
|
645
663
|
isChecked = XEUtils.get(row, checkField);
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
650
|
-
}
|
|
664
|
+
ons.click = (evnt) => {
|
|
665
|
+
if (!isDisabled && isVisible) {
|
|
666
|
+
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
651
667
|
}
|
|
652
668
|
};
|
|
653
669
|
if (checkMethod) {
|
|
@@ -680,7 +696,7 @@ export const Cell = {
|
|
|
680
696
|
'is--indeterminate': indeterminateField && !isChecked ? row[indeterminateField] : isIndeterminate,
|
|
681
697
|
'is--hidden': !isVisible
|
|
682
698
|
}],
|
|
683
|
-
on
|
|
699
|
+
on: ons
|
|
684
700
|
}, checkVNs)
|
|
685
701
|
]);
|
|
686
702
|
},
|
|
@@ -692,18 +708,21 @@ export const Cell = {
|
|
|
692
708
|
*/
|
|
693
709
|
renderExpandCell(h, params) {
|
|
694
710
|
const { $table, isHidden, row, column } = params;
|
|
695
|
-
const
|
|
711
|
+
const tableReactData = $table;
|
|
712
|
+
const { rowExpandedMaps, rowExpandLazyLoadedMaps } = tableReactData;
|
|
713
|
+
const expandOpts = $table.computeExpandOpts;
|
|
696
714
|
const { lazy, labelField, iconLoaded, showIcon, iconOpen, iconClose, visibleMethod } = expandOpts;
|
|
697
715
|
const { slots } = column;
|
|
698
716
|
const defaultSlot = slots ? slots.default : null;
|
|
699
|
-
|
|
717
|
+
const iconSlot = slots ? slots.icon : null;
|
|
718
|
+
let isActive = false;
|
|
700
719
|
let isLazyLoading = false;
|
|
701
|
-
if (
|
|
702
|
-
return renderCellBaseVNs(h, params, $table.callSlot(
|
|
720
|
+
if (iconSlot) {
|
|
721
|
+
return renderCellBaseVNs(h, params, $table.callSlot(iconSlot, params, h));
|
|
703
722
|
}
|
|
704
723
|
if (!isHidden) {
|
|
705
724
|
const rowid = getRowid($table, row);
|
|
706
|
-
|
|
725
|
+
isActive = !!rowExpandedMaps[rowid];
|
|
707
726
|
if (lazy) {
|
|
708
727
|
isLazyLoading = !!rowExpandLazyLoadedMaps[rowid];
|
|
709
728
|
}
|
|
@@ -712,7 +731,7 @@ export const Cell = {
|
|
|
712
731
|
showIcon && (!visibleMethod || visibleMethod(params))
|
|
713
732
|
? h('span', {
|
|
714
733
|
class: ['vxe-table--expanded', {
|
|
715
|
-
'is--active':
|
|
734
|
+
'is--active': isActive
|
|
716
735
|
}],
|
|
717
736
|
on: {
|
|
718
737
|
click(evnt) {
|
|
@@ -721,7 +740,7 @@ export const Cell = {
|
|
|
721
740
|
}
|
|
722
741
|
}, [
|
|
723
742
|
h('i', {
|
|
724
|
-
class: ['vxe-table--expand-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_EXPAND_LOADED) : (
|
|
743
|
+
class: ['vxe-table--expand-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_EXPAND_LOADED) : (isActive ? (iconOpen || getIcon().TABLE_EXPAND_OPEN) : (iconClose || getIcon().TABLE_EXPAND_CLOSE))]
|
|
725
744
|
})
|
|
726
745
|
])
|
|
727
746
|
: renderEmptyElement($table),
|
|
@@ -828,7 +847,9 @@ export const Cell = {
|
|
|
828
847
|
},
|
|
829
848
|
renderFilterIcon(h, params) {
|
|
830
849
|
const { $table, column, hasFilter } = params;
|
|
831
|
-
const
|
|
850
|
+
const tableReactData = $table;
|
|
851
|
+
const { filterStore } = tableReactData;
|
|
852
|
+
const filterOpts = $table.computeFilterOpts;
|
|
832
853
|
const { showIcon, iconNone, iconMatch } = filterOpts;
|
|
833
854
|
return showIcon
|
|
834
855
|
? [
|
|
@@ -859,8 +880,10 @@ export const Cell = {
|
|
|
859
880
|
*/
|
|
860
881
|
renderEditHeader(h, params) {
|
|
861
882
|
const { $table, column } = params;
|
|
862
|
-
const
|
|
863
|
-
const {
|
|
883
|
+
const tableProps = $table;
|
|
884
|
+
const { editConfig, editRules } = tableProps;
|
|
885
|
+
const editOpts = $table.computeEditOpts;
|
|
886
|
+
const { sortable, filters, editRender } = column;
|
|
864
887
|
let isRequired = false;
|
|
865
888
|
if (editRules) {
|
|
866
889
|
const columnRules = XEUtils.get(editRules, column.field);
|
|
@@ -884,14 +907,16 @@ export const Cell = {
|
|
|
884
907
|
];
|
|
885
908
|
}
|
|
886
909
|
return renderHeaderCellBaseVNs(h, params, editIconVNs.concat(Cell.renderHeaderTitle(h, params))
|
|
887
|
-
.concat(sortable
|
|
910
|
+
.concat(sortable ? Cell.renderSortIcon(h, params) : [])
|
|
888
911
|
.concat(filters ? Cell.renderFilterIcon(h, params) : []));
|
|
889
912
|
},
|
|
890
913
|
// 行格编辑模式
|
|
891
914
|
renderRowEdit(h, params) {
|
|
892
915
|
const { $table, column } = params;
|
|
916
|
+
const tableReactData = $table;
|
|
917
|
+
const { editStore } = tableReactData;
|
|
918
|
+
const { actived } = editStore;
|
|
893
919
|
const { editRender } = column;
|
|
894
|
-
const { actived } = $table.editStore;
|
|
895
920
|
return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row);
|
|
896
921
|
},
|
|
897
922
|
renderTreeRowEdit(h, params) {
|
|
@@ -900,8 +925,10 @@ export const Cell = {
|
|
|
900
925
|
// 单元格编辑模式
|
|
901
926
|
renderCellEdit(h, params) {
|
|
902
927
|
const { $table, column } = params;
|
|
928
|
+
const tableReactData = $table;
|
|
929
|
+
const { editStore } = tableReactData;
|
|
930
|
+
const { actived } = editStore;
|
|
903
931
|
const { editRender } = column;
|
|
904
|
-
const { actived } = $table.editStore;
|
|
905
932
|
return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row && actived.column === params.column);
|
|
906
933
|
},
|
|
907
934
|
renderTreeCellEdit(h, params) {
|
package/es/table/src/column.js
CHANGED
|
@@ -108,7 +108,7 @@ Object.keys(columnProps).forEach(name => {
|
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
});
|
|
111
|
-
export default
|
|
111
|
+
export default {
|
|
112
112
|
name: 'VxeColumn',
|
|
113
113
|
props: columnProps,
|
|
114
114
|
provide() {
|
|
@@ -140,4 +140,4 @@ export default defineVxeComponent({
|
|
|
140
140
|
return h('div', this.$slots.default);
|
|
141
141
|
},
|
|
142
142
|
methods: Cell
|
|
143
|
-
}
|
|
143
|
+
};
|
package/es/table/src/group.js
CHANGED
|
@@ -2,7 +2,7 @@ import Cell from './cell';
|
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
3
|
import { assembleColumn, destroyColumn } from './util';
|
|
4
4
|
import { columnProps, columnWatch } from './column';
|
|
5
|
-
export default
|
|
5
|
+
export default {
|
|
6
6
|
name: 'VxeColgroup',
|
|
7
7
|
props: columnProps,
|
|
8
8
|
provide() {
|
|
@@ -39,4 +39,4 @@ export default defineVxeComponent({
|
|
|
39
39
|
return h('div', this.$slots.default);
|
|
40
40
|
},
|
|
41
41
|
methods: Cell
|
|
42
|
-
}
|
|
42
|
+
};
|