vxe-table 4.8.0 → 4.8.2
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/en-US.js +4 -2
- package/es/locale/lang/es-ES.js +4 -2
- package/es/locale/lang/hu-HU.js +4 -2
- package/es/locale/lang/ja-JP.js +4 -2
- package/es/locale/lang/ko-KR.js +4 -2
- package/es/locale/lang/pt-BR.js +4 -2
- package/es/locale/lang/ru-RU.js +4 -2
- package/es/locale/lang/uk-UA.js +4 -2
- package/es/locale/lang/vi-VN.js +4 -2
- package/es/locale/lang/zh-CHT.js +4 -2
- package/es/locale/lang/zh-CN.js +4 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/hook.js +7 -4
- package/es/table/src/body.js +22 -8
- package/es/table/src/cell.js +65 -27
- package/es/table/src/column.js +3 -1
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/emits.js +3 -0
- package/es/table/src/props.js +2 -0
- package/es/table/src/table.js +241 -40
- package/es/table/style.css +77 -2
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +4 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +77 -2
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/index.umd.js +378 -85
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +4 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -2
- package/lib/locale/lang/es-ES.js +4 -2
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +4 -2
- package/lib/locale/lang/hu-HU.js +4 -2
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +4 -2
- package/lib/locale/lang/ja-JP.js +4 -2
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +4 -2
- package/lib/locale/lang/ko-KR.js +4 -2
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +4 -2
- package/lib/locale/lang/pt-BR.js +4 -2
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +4 -2
- package/lib/locale/lang/ru-RU.js +4 -2
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -2
- package/lib/locale/lang/uk-UA.js +4 -2
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +4 -2
- package/lib/locale/lang/vi-VN.js +4 -2
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +4 -2
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +4 -2
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +4 -2
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/hook.js +8 -4
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/src/body.js +18 -5
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +79 -27
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +3 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/props.js +2 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +258 -43
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +77 -2
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +4 -1
- 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 +77 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/en-US.ts +4 -2
- package/packages/locale/lang/es-ES.ts +4 -2
- package/packages/locale/lang/hu-HU.ts +4 -2
- package/packages/locale/lang/ja-JP.ts +4 -2
- package/packages/locale/lang/ko-KR.ts +4 -2
- package/packages/locale/lang/pt-BR.ts +4 -2
- package/packages/locale/lang/ru-RU.ts +4 -2
- package/packages/locale/lang/uk-UA.ts +4 -2
- package/packages/locale/lang/vi-VN.ts +4 -2
- package/packages/locale/lang/zh-CHT.ts +4 -2
- package/packages/locale/lang/zh-CN.ts +4 -2
- package/packages/table/module/custom/panel.ts +1 -1
- package/packages/table/module/edit/hook.ts +7 -4
- package/packages/table/src/body.ts +22 -8
- package/packages/table/src/cell.ts +69 -27
- package/packages/table/src/column.ts +3 -1
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/emits.ts +4 -0
- package/packages/table/src/props.ts +2 -0
- package/packages/table/src/table.ts +258 -42
- package/packages/ui/index.ts +3 -0
- package/styles/components/table-module/custom.scss +14 -3
- package/styles/components/table.scss +80 -0
- /package/es/{iconfont.1730681238555.ttf → iconfont.1730898232530.ttf} +0 -0
- /package/es/{iconfont.1730681238555.woff → iconfont.1730898232530.woff} +0 -0
- /package/es/{iconfont.1730681238555.woff2 → iconfont.1730898232530.woff2} +0 -0
- /package/lib/{iconfont.1730681238555.ttf → iconfont.1730898232530.ttf} +0 -0
- /package/lib/{iconfont.1730681238555.woff → iconfont.1730898232530.woff} +0 -0
- /package/lib/{iconfont.1730681238555.woff2 → iconfont.1730898232530.woff2} +0 -0
package/es/table/src/cell.js
CHANGED
|
@@ -5,7 +5,7 @@ import { getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/sr
|
|
|
5
5
|
import { updateCellTitle } from '../../ui/src/dom';
|
|
6
6
|
import { createColumn, getRowid } from './util';
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
8
|
-
const { getI18n, getIcon, renderer, formats } = VxeUI;
|
|
8
|
+
const { getI18n, getIcon, renderer, formats, renderEmptyElement } = VxeUI;
|
|
9
9
|
function renderTitlePrefixIcon(params) {
|
|
10
10
|
const { $table, column } = params;
|
|
11
11
|
const titlePrefix = column.titlePrefix || column.titleHelp;
|
|
@@ -40,6 +40,42 @@ function renderTitleSuffixIcon(params) {
|
|
|
40
40
|
]
|
|
41
41
|
: [];
|
|
42
42
|
}
|
|
43
|
+
function renderCellDragIcon(params) {
|
|
44
|
+
const { $table } = params;
|
|
45
|
+
const { computeDragOpts } = $table.getComputeMaps();
|
|
46
|
+
const dragOpts = computeDragOpts.value;
|
|
47
|
+
const { rowDisabledMethod } = dragOpts;
|
|
48
|
+
const isDisabled = rowDisabledMethod && rowDisabledMethod(params);
|
|
49
|
+
return h('span', {
|
|
50
|
+
key: 'dg',
|
|
51
|
+
class: ['vxe-cell--drag-handle', {
|
|
52
|
+
'is--disabled': isDisabled
|
|
53
|
+
}],
|
|
54
|
+
onMousedown(evnt) {
|
|
55
|
+
if (!isDisabled) {
|
|
56
|
+
$table.handleCellDragMousedownEvent(evnt, params);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
onMouseup: $table.handleCellDragMouseupEvent
|
|
60
|
+
}, [
|
|
61
|
+
h('i', {
|
|
62
|
+
class: 'vxe-table-icon-drag-handle'
|
|
63
|
+
})
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
function renderCellBaseVNs(params, content) {
|
|
67
|
+
const { $table, column } = params;
|
|
68
|
+
const { dragSort } = column;
|
|
69
|
+
const vns = XEUtils.isArray(content) ? content : [content];
|
|
70
|
+
const { computeRowOpts, computeDragOpts } = $table.getComputeMaps();
|
|
71
|
+
const rowOpts = computeRowOpts.value;
|
|
72
|
+
const dragOpts = computeDragOpts.value;
|
|
73
|
+
const { showRowIcon, rowVisibleMethod } = dragOpts;
|
|
74
|
+
if (dragSort && rowOpts.drag && (showRowIcon && (!rowVisibleMethod || rowVisibleMethod(params)))) {
|
|
75
|
+
vns.unshift(renderCellDragIcon(params));
|
|
76
|
+
}
|
|
77
|
+
return vns;
|
|
78
|
+
}
|
|
43
79
|
function renderTitleContent(params, content) {
|
|
44
80
|
const { $table, column } = params;
|
|
45
81
|
const { props, reactData } = $table;
|
|
@@ -233,7 +269,7 @@ export const Cell = {
|
|
|
233
269
|
const renderOpts = editRender || cellRender;
|
|
234
270
|
const defaultSlot = slots ? slots.default : null;
|
|
235
271
|
if (defaultSlot) {
|
|
236
|
-
return $table.callSlot(defaultSlot, params);
|
|
272
|
+
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
237
273
|
}
|
|
238
274
|
if (renderOpts) {
|
|
239
275
|
const compConf = renderer.get(renderOpts.name);
|
|
@@ -242,13 +278,13 @@ export const Cell = {
|
|
|
242
278
|
const rtDefault = compConf.renderTableDefault || compConf.renderDefault;
|
|
243
279
|
const renderFn = editRender ? rtCell : rtDefault;
|
|
244
280
|
if (renderFn) {
|
|
245
|
-
return getSlotVNs(renderFn(renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params)));
|
|
281
|
+
return renderCellBaseVNs(params, getSlotVNs(renderFn(renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params))));
|
|
246
282
|
}
|
|
247
283
|
}
|
|
248
284
|
}
|
|
249
285
|
const cellValue = $table.getCellLabel(row, column);
|
|
250
286
|
const cellPlaceholder = editRender ? editRender.placeholder : '';
|
|
251
|
-
return [
|
|
287
|
+
return renderCellBaseVNs(params, [
|
|
252
288
|
h('span', {
|
|
253
289
|
class: 'vxe-cell--label'
|
|
254
290
|
}, [
|
|
@@ -259,7 +295,7 @@ export const Cell = {
|
|
|
259
295
|
}, formatText(getFuncText(cellPlaceholder), 1))
|
|
260
296
|
: h('span', formatText(cellValue, 1))
|
|
261
297
|
])
|
|
262
|
-
];
|
|
298
|
+
]);
|
|
263
299
|
},
|
|
264
300
|
renderTreeCell(params) {
|
|
265
301
|
return Cell.renderTreeIcon(params, Cell.renderDefaultCell(params));
|
|
@@ -354,11 +390,13 @@ export const Cell = {
|
|
|
354
390
|
const { slots } = column;
|
|
355
391
|
const defaultSlot = slots ? slots.default : null;
|
|
356
392
|
if (defaultSlot) {
|
|
357
|
-
return $table.callSlot(defaultSlot, params);
|
|
393
|
+
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
358
394
|
}
|
|
359
395
|
const { seq } = params;
|
|
360
396
|
const seqMethod = seqOpts.seqMethod;
|
|
361
|
-
return
|
|
397
|
+
return renderCellBaseVNs(params, [
|
|
398
|
+
h('span', `${formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)
|
|
399
|
+
]);
|
|
362
400
|
},
|
|
363
401
|
renderTreeIndexCell(params) {
|
|
364
402
|
return Cell.renderTreeIcon(params, Cell.renderSeqCell(params));
|
|
@@ -408,7 +446,7 @@ export const Cell = {
|
|
|
408
446
|
}
|
|
409
447
|
const radioParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible });
|
|
410
448
|
if (radioSlot) {
|
|
411
|
-
return $table.callSlot(radioSlot, radioParams);
|
|
449
|
+
return renderCellBaseVNs(params, $table.callSlot(radioSlot, radioParams));
|
|
412
450
|
}
|
|
413
451
|
const radioVNs = [];
|
|
414
452
|
if (isVisible) {
|
|
@@ -421,12 +459,12 @@ export const Cell = {
|
|
|
421
459
|
class: 'vxe-radio--label'
|
|
422
460
|
}, defaultSlot ? $table.callSlot(defaultSlot, radioParams) : XEUtils.get(row, labelField)));
|
|
423
461
|
}
|
|
424
|
-
return [
|
|
462
|
+
return renderCellBaseVNs(params, [
|
|
425
463
|
h('span', Object.assign({ class: ['vxe-cell--radio', {
|
|
426
464
|
'is--checked': isChecked,
|
|
427
465
|
'is--disabled': isDisabled
|
|
428
466
|
}] }, ons), radioVNs)
|
|
429
|
-
];
|
|
467
|
+
]);
|
|
430
468
|
},
|
|
431
469
|
renderTreeRadioCell(params) {
|
|
432
470
|
return Cell.renderTreeIcon(params, Cell.renderRadioCell(params));
|
|
@@ -519,7 +557,7 @@ export const Cell = {
|
|
|
519
557
|
}
|
|
520
558
|
const checkboxParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate });
|
|
521
559
|
if (checkboxSlot) {
|
|
522
|
-
return $table.callSlot(checkboxSlot, checkboxParams);
|
|
560
|
+
return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams));
|
|
523
561
|
}
|
|
524
562
|
const checkVNs = [];
|
|
525
563
|
if (isVisible) {
|
|
@@ -532,14 +570,14 @@ export const Cell = {
|
|
|
532
570
|
class: 'vxe-checkbox--label'
|
|
533
571
|
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField)));
|
|
534
572
|
}
|
|
535
|
-
return [
|
|
573
|
+
return renderCellBaseVNs(params, [
|
|
536
574
|
h('span', Object.assign({ class: ['vxe-cell--checkbox', {
|
|
537
575
|
'is--checked': isChecked,
|
|
538
576
|
'is--disabled': isDisabled,
|
|
539
577
|
'is--indeterminate': indeterminate,
|
|
540
578
|
'is--hidden': !isVisible
|
|
541
579
|
}] }, ons), checkVNs)
|
|
542
|
-
];
|
|
580
|
+
]);
|
|
543
581
|
},
|
|
544
582
|
renderTreeSelectionCell(params) {
|
|
545
583
|
return Cell.renderTreeIcon(params, Cell.renderCheckboxCell(params));
|
|
@@ -580,7 +618,7 @@ export const Cell = {
|
|
|
580
618
|
}
|
|
581
619
|
const checkboxParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate });
|
|
582
620
|
if (checkboxSlot) {
|
|
583
|
-
return $table.callSlot(checkboxSlot, checkboxParams);
|
|
621
|
+
return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams));
|
|
584
622
|
}
|
|
585
623
|
const checkVNs = [];
|
|
586
624
|
if (isVisible) {
|
|
@@ -593,14 +631,14 @@ export const Cell = {
|
|
|
593
631
|
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField)));
|
|
594
632
|
}
|
|
595
633
|
}
|
|
596
|
-
return [
|
|
634
|
+
return renderCellBaseVNs(params, [
|
|
597
635
|
h('span', Object.assign({ class: ['vxe-cell--checkbox', {
|
|
598
636
|
'is--checked': isChecked,
|
|
599
637
|
'is--disabled': isDisabled,
|
|
600
638
|
'is--indeterminate': indeterminateField && !isChecked ? row[indeterminateField] : isIndeterminate,
|
|
601
639
|
'is--hidden': !isVisible
|
|
602
640
|
}] }, ons), checkVNs)
|
|
603
|
-
];
|
|
641
|
+
]);
|
|
604
642
|
},
|
|
605
643
|
renderTreeSelectionCellByProp(params) {
|
|
606
644
|
return Cell.renderTreeIcon(params, Cell.renderCheckboxCellByProp(params));
|
|
@@ -621,7 +659,7 @@ export const Cell = {
|
|
|
621
659
|
let isAceived = false;
|
|
622
660
|
let isLazyLoading = false;
|
|
623
661
|
if (iconSlot) {
|
|
624
|
-
return $table.callSlot(iconSlot, params);
|
|
662
|
+
return renderCellBaseVNs(params, $table.callSlot(iconSlot, params));
|
|
625
663
|
}
|
|
626
664
|
if (!isHidden) {
|
|
627
665
|
const rowid = getRowid($table, row);
|
|
@@ -630,7 +668,7 @@ export const Cell = {
|
|
|
630
668
|
isLazyLoading = !!rowExpandLazyLoadedMaps[rowid];
|
|
631
669
|
}
|
|
632
670
|
}
|
|
633
|
-
return [
|
|
671
|
+
return renderCellBaseVNs(params, [
|
|
634
672
|
showIcon && (!visibleMethod || visibleMethod(params))
|
|
635
673
|
? h('span', {
|
|
636
674
|
class: ['vxe-table--expanded', {
|
|
@@ -644,13 +682,13 @@ export const Cell = {
|
|
|
644
682
|
class: ['vxe-table--expand-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_EXPAND_LOADED) : (isAceived ? (iconOpen || getIcon().TABLE_EXPAND_OPEN) : (iconClose || getIcon().TABLE_EXPAND_CLOSE))]
|
|
645
683
|
})
|
|
646
684
|
])
|
|
647
|
-
:
|
|
685
|
+
: renderEmptyElement($table),
|
|
648
686
|
defaultSlot || labelField
|
|
649
687
|
? h('span', {
|
|
650
688
|
class: 'vxe-table--expand-label'
|
|
651
689
|
}, defaultSlot ? $table.callSlot(defaultSlot, params) : XEUtils.get(row, labelField))
|
|
652
|
-
:
|
|
653
|
-
];
|
|
690
|
+
: renderEmptyElement($table)
|
|
691
|
+
]);
|
|
654
692
|
},
|
|
655
693
|
renderExpandData(params) {
|
|
656
694
|
const { $table, column } = params;
|
|
@@ -678,14 +716,14 @@ export const Cell = {
|
|
|
678
716
|
const { slots } = column;
|
|
679
717
|
const defaultSlot = slots ? slots.default : null;
|
|
680
718
|
if (defaultSlot) {
|
|
681
|
-
return $table.callSlot(defaultSlot, params);
|
|
719
|
+
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
682
720
|
}
|
|
683
|
-
return [
|
|
721
|
+
return renderCellBaseVNs(params, [
|
|
684
722
|
h('span', {
|
|
685
723
|
class: 'vxe-cell--html',
|
|
686
724
|
innerHTML: getDefaultCellLabel(params)
|
|
687
725
|
})
|
|
688
|
-
];
|
|
726
|
+
]);
|
|
689
727
|
},
|
|
690
728
|
renderTreeHTMLCell(params) {
|
|
691
729
|
return Cell.renderTreeIcon(params, Cell.renderHTMLCell(params));
|
|
@@ -850,14 +888,14 @@ export const Cell = {
|
|
|
850
888
|
return [];
|
|
851
889
|
}
|
|
852
890
|
if (defaultSlot) {
|
|
853
|
-
return $table.callSlot(defaultSlot, cellParams);
|
|
891
|
+
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, cellParams));
|
|
854
892
|
}
|
|
855
893
|
if (formatter) {
|
|
856
|
-
return [
|
|
894
|
+
return renderCellBaseVNs(params, [
|
|
857
895
|
h('span', {
|
|
858
896
|
class: 'vxe-cell--label'
|
|
859
897
|
}, getDefaultCellLabel(cellParams))
|
|
860
|
-
];
|
|
898
|
+
]);
|
|
861
899
|
}
|
|
862
900
|
return Cell.renderDefaultCell(cellParams);
|
|
863
901
|
}
|
package/es/table/src/column.js
CHANGED
package/es/table/src/emits.js
CHANGED