vxe-table 4.8.0 → 4.8.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/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 +53 -24
- 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 +74 -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 +74 -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 +359 -82
- 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 +60 -24
- 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 +74 -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 +74 -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 +57 -24
- 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 +9 -3
- package/styles/components/table.scss +80 -0
- /package/es/{iconfont.1730681238555.ttf → iconfont.1730873064176.ttf} +0 -0
- /package/es/{iconfont.1730681238555.woff → iconfont.1730873064176.woff} +0 -0
- /package/es/{iconfont.1730681238555.woff2 → iconfont.1730873064176.woff2} +0 -0
- /package/lib/{iconfont.1730681238555.ttf → iconfont.1730873064176.ttf} +0 -0
- /package/lib/{iconfont.1730681238555.woff → iconfont.1730873064176.woff} +0 -0
- /package/lib/{iconfont.1730681238555.woff2 → iconfont.1730873064176.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,33 @@ function renderTitleSuffixIcon(params) {
|
|
|
40
40
|
]
|
|
41
41
|
: [];
|
|
42
42
|
}
|
|
43
|
+
function renderCellDragIcon(params) {
|
|
44
|
+
const { $table } = params;
|
|
45
|
+
return h('span', {
|
|
46
|
+
key: 'dg',
|
|
47
|
+
class: 'vxe-cell--drag-handle',
|
|
48
|
+
onMousedown(evnt) {
|
|
49
|
+
$table.handleCellDragMousedownEvent(evnt, params);
|
|
50
|
+
},
|
|
51
|
+
onMouseup: $table.handleCellDragMouseupEvent
|
|
52
|
+
}, [
|
|
53
|
+
h('i', {
|
|
54
|
+
class: 'vxe-table-icon-drag-handle'
|
|
55
|
+
})
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
58
|
+
function renderCellBaseVNs(params, content) {
|
|
59
|
+
const { $table, column } = params;
|
|
60
|
+
const { dragSort } = column;
|
|
61
|
+
const vns = XEUtils.isArray(content) ? content : [content];
|
|
62
|
+
const { computeRowOpts, computeDragOpts } = $table.getComputeMaps();
|
|
63
|
+
const rowOpts = computeRowOpts.value;
|
|
64
|
+
const dragOpts = computeDragOpts.value;
|
|
65
|
+
if (dragSort && rowOpts.drag && dragOpts.showIcon) {
|
|
66
|
+
vns.unshift(renderCellDragIcon(params));
|
|
67
|
+
}
|
|
68
|
+
return vns;
|
|
69
|
+
}
|
|
43
70
|
function renderTitleContent(params, content) {
|
|
44
71
|
const { $table, column } = params;
|
|
45
72
|
const { props, reactData } = $table;
|
|
@@ -233,7 +260,7 @@ export const Cell = {
|
|
|
233
260
|
const renderOpts = editRender || cellRender;
|
|
234
261
|
const defaultSlot = slots ? slots.default : null;
|
|
235
262
|
if (defaultSlot) {
|
|
236
|
-
return $table.callSlot(defaultSlot, params);
|
|
263
|
+
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
237
264
|
}
|
|
238
265
|
if (renderOpts) {
|
|
239
266
|
const compConf = renderer.get(renderOpts.name);
|
|
@@ -242,13 +269,13 @@ export const Cell = {
|
|
|
242
269
|
const rtDefault = compConf.renderTableDefault || compConf.renderDefault;
|
|
243
270
|
const renderFn = editRender ? rtCell : rtDefault;
|
|
244
271
|
if (renderFn) {
|
|
245
|
-
return getSlotVNs(renderFn(renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params)));
|
|
272
|
+
return renderCellBaseVNs(params, getSlotVNs(renderFn(renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params))));
|
|
246
273
|
}
|
|
247
274
|
}
|
|
248
275
|
}
|
|
249
276
|
const cellValue = $table.getCellLabel(row, column);
|
|
250
277
|
const cellPlaceholder = editRender ? editRender.placeholder : '';
|
|
251
|
-
return [
|
|
278
|
+
return renderCellBaseVNs(params, [
|
|
252
279
|
h('span', {
|
|
253
280
|
class: 'vxe-cell--label'
|
|
254
281
|
}, [
|
|
@@ -259,7 +286,7 @@ export const Cell = {
|
|
|
259
286
|
}, formatText(getFuncText(cellPlaceholder), 1))
|
|
260
287
|
: h('span', formatText(cellValue, 1))
|
|
261
288
|
])
|
|
262
|
-
];
|
|
289
|
+
]);
|
|
263
290
|
},
|
|
264
291
|
renderTreeCell(params) {
|
|
265
292
|
return Cell.renderTreeIcon(params, Cell.renderDefaultCell(params));
|
|
@@ -354,11 +381,13 @@ export const Cell = {
|
|
|
354
381
|
const { slots } = column;
|
|
355
382
|
const defaultSlot = slots ? slots.default : null;
|
|
356
383
|
if (defaultSlot) {
|
|
357
|
-
return $table.callSlot(defaultSlot, params);
|
|
384
|
+
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
358
385
|
}
|
|
359
386
|
const { seq } = params;
|
|
360
387
|
const seqMethod = seqOpts.seqMethod;
|
|
361
|
-
return
|
|
388
|
+
return renderCellBaseVNs(params, [
|
|
389
|
+
h('span', `${formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)
|
|
390
|
+
]);
|
|
362
391
|
},
|
|
363
392
|
renderTreeIndexCell(params) {
|
|
364
393
|
return Cell.renderTreeIcon(params, Cell.renderSeqCell(params));
|
|
@@ -408,7 +437,7 @@ export const Cell = {
|
|
|
408
437
|
}
|
|
409
438
|
const radioParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible });
|
|
410
439
|
if (radioSlot) {
|
|
411
|
-
return $table.callSlot(radioSlot, radioParams);
|
|
440
|
+
return renderCellBaseVNs(params, $table.callSlot(radioSlot, radioParams));
|
|
412
441
|
}
|
|
413
442
|
const radioVNs = [];
|
|
414
443
|
if (isVisible) {
|
|
@@ -421,12 +450,12 @@ export const Cell = {
|
|
|
421
450
|
class: 'vxe-radio--label'
|
|
422
451
|
}, defaultSlot ? $table.callSlot(defaultSlot, radioParams) : XEUtils.get(row, labelField)));
|
|
423
452
|
}
|
|
424
|
-
return [
|
|
453
|
+
return renderCellBaseVNs(params, [
|
|
425
454
|
h('span', Object.assign({ class: ['vxe-cell--radio', {
|
|
426
455
|
'is--checked': isChecked,
|
|
427
456
|
'is--disabled': isDisabled
|
|
428
457
|
}] }, ons), radioVNs)
|
|
429
|
-
];
|
|
458
|
+
]);
|
|
430
459
|
},
|
|
431
460
|
renderTreeRadioCell(params) {
|
|
432
461
|
return Cell.renderTreeIcon(params, Cell.renderRadioCell(params));
|
|
@@ -519,7 +548,7 @@ export const Cell = {
|
|
|
519
548
|
}
|
|
520
549
|
const checkboxParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate });
|
|
521
550
|
if (checkboxSlot) {
|
|
522
|
-
return $table.callSlot(checkboxSlot, checkboxParams);
|
|
551
|
+
return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams));
|
|
523
552
|
}
|
|
524
553
|
const checkVNs = [];
|
|
525
554
|
if (isVisible) {
|
|
@@ -532,14 +561,14 @@ export const Cell = {
|
|
|
532
561
|
class: 'vxe-checkbox--label'
|
|
533
562
|
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField)));
|
|
534
563
|
}
|
|
535
|
-
return [
|
|
564
|
+
return renderCellBaseVNs(params, [
|
|
536
565
|
h('span', Object.assign({ class: ['vxe-cell--checkbox', {
|
|
537
566
|
'is--checked': isChecked,
|
|
538
567
|
'is--disabled': isDisabled,
|
|
539
568
|
'is--indeterminate': indeterminate,
|
|
540
569
|
'is--hidden': !isVisible
|
|
541
570
|
}] }, ons), checkVNs)
|
|
542
|
-
];
|
|
571
|
+
]);
|
|
543
572
|
},
|
|
544
573
|
renderTreeSelectionCell(params) {
|
|
545
574
|
return Cell.renderTreeIcon(params, Cell.renderCheckboxCell(params));
|
|
@@ -580,7 +609,7 @@ export const Cell = {
|
|
|
580
609
|
}
|
|
581
610
|
const checkboxParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate });
|
|
582
611
|
if (checkboxSlot) {
|
|
583
|
-
return $table.callSlot(checkboxSlot, checkboxParams);
|
|
612
|
+
return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams));
|
|
584
613
|
}
|
|
585
614
|
const checkVNs = [];
|
|
586
615
|
if (isVisible) {
|
|
@@ -593,14 +622,14 @@ export const Cell = {
|
|
|
593
622
|
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField)));
|
|
594
623
|
}
|
|
595
624
|
}
|
|
596
|
-
return [
|
|
625
|
+
return renderCellBaseVNs(params, [
|
|
597
626
|
h('span', Object.assign({ class: ['vxe-cell--checkbox', {
|
|
598
627
|
'is--checked': isChecked,
|
|
599
628
|
'is--disabled': isDisabled,
|
|
600
629
|
'is--indeterminate': indeterminateField && !isChecked ? row[indeterminateField] : isIndeterminate,
|
|
601
630
|
'is--hidden': !isVisible
|
|
602
631
|
}] }, ons), checkVNs)
|
|
603
|
-
];
|
|
632
|
+
]);
|
|
604
633
|
},
|
|
605
634
|
renderTreeSelectionCellByProp(params) {
|
|
606
635
|
return Cell.renderTreeIcon(params, Cell.renderCheckboxCellByProp(params));
|
|
@@ -621,7 +650,7 @@ export const Cell = {
|
|
|
621
650
|
let isAceived = false;
|
|
622
651
|
let isLazyLoading = false;
|
|
623
652
|
if (iconSlot) {
|
|
624
|
-
return $table.callSlot(iconSlot, params);
|
|
653
|
+
return renderCellBaseVNs(params, $table.callSlot(iconSlot, params));
|
|
625
654
|
}
|
|
626
655
|
if (!isHidden) {
|
|
627
656
|
const rowid = getRowid($table, row);
|
|
@@ -630,7 +659,7 @@ export const Cell = {
|
|
|
630
659
|
isLazyLoading = !!rowExpandLazyLoadedMaps[rowid];
|
|
631
660
|
}
|
|
632
661
|
}
|
|
633
|
-
return [
|
|
662
|
+
return renderCellBaseVNs(params, [
|
|
634
663
|
showIcon && (!visibleMethod || visibleMethod(params))
|
|
635
664
|
? h('span', {
|
|
636
665
|
class: ['vxe-table--expanded', {
|
|
@@ -644,13 +673,13 @@ export const Cell = {
|
|
|
644
673
|
class: ['vxe-table--expand-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_EXPAND_LOADED) : (isAceived ? (iconOpen || getIcon().TABLE_EXPAND_OPEN) : (iconClose || getIcon().TABLE_EXPAND_CLOSE))]
|
|
645
674
|
})
|
|
646
675
|
])
|
|
647
|
-
:
|
|
676
|
+
: renderEmptyElement($table),
|
|
648
677
|
defaultSlot || labelField
|
|
649
678
|
? h('span', {
|
|
650
679
|
class: 'vxe-table--expand-label'
|
|
651
680
|
}, defaultSlot ? $table.callSlot(defaultSlot, params) : XEUtils.get(row, labelField))
|
|
652
|
-
:
|
|
653
|
-
];
|
|
681
|
+
: renderEmptyElement($table)
|
|
682
|
+
]);
|
|
654
683
|
},
|
|
655
684
|
renderExpandData(params) {
|
|
656
685
|
const { $table, column } = params;
|
|
@@ -678,14 +707,14 @@ export const Cell = {
|
|
|
678
707
|
const { slots } = column;
|
|
679
708
|
const defaultSlot = slots ? slots.default : null;
|
|
680
709
|
if (defaultSlot) {
|
|
681
|
-
return $table.callSlot(defaultSlot, params);
|
|
710
|
+
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
682
711
|
}
|
|
683
|
-
return [
|
|
712
|
+
return renderCellBaseVNs(params, [
|
|
684
713
|
h('span', {
|
|
685
714
|
class: 'vxe-cell--html',
|
|
686
715
|
innerHTML: getDefaultCellLabel(params)
|
|
687
716
|
})
|
|
688
|
-
];
|
|
717
|
+
]);
|
|
689
718
|
},
|
|
690
719
|
renderTreeHTMLCell(params) {
|
|
691
720
|
return Cell.renderTreeIcon(params, Cell.renderHTMLCell(params));
|
package/es/table/src/column.js
CHANGED
package/es/table/src/emits.js
CHANGED