vxe-table 3.14.0-beta.8 → 3.14.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/grid/src/grid.js +75 -50
- package/es/locale/lang/ar-EG.js +7 -1
- package/es/locale/lang/de-DE.js +7 -1
- package/es/locale/lang/en-US.js +7 -1
- package/es/locale/lang/es-ES.js +7 -1
- package/es/locale/lang/fr-FR.js +7 -1
- package/es/locale/lang/hu-HU.js +7 -1
- package/es/locale/lang/hy-AM.js +7 -1
- package/es/locale/lang/id-ID.js +7 -1
- package/es/locale/lang/it-IT.js +7 -1
- package/es/locale/lang/ja-JP.js +7 -1
- package/es/locale/lang/ko-KR.js +7 -1
- package/es/locale/lang/nb-NO.js +7 -1
- package/es/locale/lang/pt-BR.js +7 -1
- package/es/locale/lang/ru-RU.js +7 -1
- package/es/locale/lang/th-TH.js +7 -1
- package/es/locale/lang/ug-CN.js +7 -1
- package/es/locale/lang/uk-UA.js +7 -1
- package/es/locale/lang/vi-VN.js +7 -1
- package/es/locale/lang/zh-CHT.js +7 -1
- package/es/locale/lang/zh-CN.js +7 -1
- package/es/style.css +1 -1
- package/es/table/module/custom/mixin.js +4 -2
- package/es/table/module/custom/panel.js +24 -23
- package/es/table/module/edit/mixin.js +17 -11
- package/es/table/module/export/export-panel.js +5 -4
- package/es/table/module/export/import-panel.js +8 -7
- package/es/table/module/export/mixin.js +30 -27
- package/es/table/module/filter/panel.js +21 -10
- package/es/table/module/keyboard/mixin.js +141 -41
- package/es/table/module/menu/mixin.js +6 -3
- package/es/table/module/menu/panel.js +7 -7
- package/es/table/module/validator/mixin.js +2 -2
- package/es/table/render/index.js +2 -2
- package/es/table/src/body.js +39 -20
- package/es/table/src/cell.js +27 -22
- package/es/table/src/column.js +11 -9
- package/es/table/src/columnInfo.js +6 -6
- package/es/table/src/footer.js +12 -7
- package/es/table/src/group.js +6 -5
- package/es/table/src/header.js +15 -9
- package/es/table/src/methods.js +773 -704
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +85 -49
- package/es/table/src/util.js +55 -20
- package/es/toolbar/src/toolbar.js +3 -3
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/grid/src/grid.js +82 -67
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +1590 -1249
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +7 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +7 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +7 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +7 -1
- package/lib/locale/lang/es-ES.js +7 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +7 -1
- package/lib/locale/lang/fr-FR.js +7 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +7 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +7 -1
- package/lib/locale/lang/hy-AM.js +7 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +7 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +7 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +7 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +7 -1
- package/lib/locale/lang/ko-KR.js +7 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +7 -1
- package/lib/locale/lang/nb-NO.js +7 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +7 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +7 -1
- package/lib/locale/lang/ru-RU.js +7 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +7 -1
- package/lib/locale/lang/th-TH.js +7 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +7 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +7 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +7 -1
- package/lib/locale/lang/vi-VN.js +7 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +7 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +7 -1
- package/lib/locale/lang/zh-CN.js +7 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +7 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/mixin.js +5 -3
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +22 -29
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +19 -13
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +5 -4
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +8 -7
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +35 -34
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +16 -16
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +149 -47
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +6 -3
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +7 -7
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +3 -3
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +3 -2
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +47 -20
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +39 -23
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +11 -9
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +6 -6
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +12 -5
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/group.js +6 -5
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/header.js +16 -8
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +911 -830
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +4 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +93 -52
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +62 -21
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +3 -3
- package/lib/ui/index.js +2 -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/package.json +2 -2
- package/packages/grid/src/grid.ts +88 -59
- package/packages/locale/lang/ar-EG.ts +7 -1
- package/packages/locale/lang/de-DE.ts +7 -1
- package/packages/locale/lang/en-US.ts +7 -1
- package/packages/locale/lang/es-ES.ts +7 -1
- package/packages/locale/lang/fr-FR.ts +7 -1
- package/packages/locale/lang/hu-HU.ts +7 -1
- package/packages/locale/lang/hy-AM.ts +7 -1
- package/packages/locale/lang/id-ID.ts +7 -1
- package/packages/locale/lang/it-IT.ts +7 -1
- package/packages/locale/lang/ja-JP.ts +7 -1
- package/packages/locale/lang/ko-KR.ts +7 -1
- package/packages/locale/lang/nb-NO.ts +7 -1
- package/packages/locale/lang/pt-BR.ts +7 -1
- package/packages/locale/lang/ru-RU.ts +7 -1
- package/packages/locale/lang/th-TH.ts +7 -1
- package/packages/locale/lang/ug-CN.ts +7 -1
- package/packages/locale/lang/uk-UA.ts +7 -1
- package/packages/locale/lang/vi-VN.ts +7 -1
- package/packages/locale/lang/zh-CHT.ts +7 -1
- package/packages/locale/lang/zh-CN.ts +7 -1
- package/packages/table/module/custom/mixin.ts +6 -3
- package/packages/table/module/custom/panel.ts +42 -37
- package/packages/table/module/edit/mixin.ts +20 -14
- package/packages/table/module/export/export-panel.ts +8 -5
- package/packages/table/module/export/import-panel.ts +11 -7
- package/packages/table/module/export/mixin.ts +37 -32
- package/packages/table/module/filter/panel.ts +25 -10
- package/packages/table/module/keyboard/mixin.ts +155 -49
- package/packages/table/module/menu/mixin.ts +12 -6
- package/packages/table/module/menu/panel.ts +10 -7
- package/packages/table/module/validator/mixin.ts +2 -2
- package/packages/table/render/index.ts +2 -2
- package/packages/table/src/body.ts +39 -20
- package/packages/table/src/cell.ts +27 -22
- package/packages/table/src/column.ts +14 -10
- package/packages/table/src/columnInfo.ts +9 -6
- package/packages/table/src/footer.ts +12 -7
- package/packages/table/src/group.ts +9 -5
- package/packages/table/src/header.ts +16 -9
- package/packages/table/src/methods.ts +854 -740
- package/packages/table/src/props.ts +16 -12
- package/packages/table/src/table.ts +99 -52
- package/packages/table/src/util.ts +63 -21
- package/packages/toolbar/src/toolbar.ts +3 -3
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1741333630357.ttf → iconfont.1742955973002.ttf} +0 -0
- /package/es/{iconfont.1741333630357.woff → iconfont.1742955973002.woff} +0 -0
- /package/es/{iconfont.1741333630357.woff2 → iconfont.1742955973002.woff2} +0 -0
- /package/lib/{iconfont.1741333630357.ttf → iconfont.1742955973002.ttf} +0 -0
- /package/lib/{iconfont.1741333630357.woff → iconfont.1742955973002.woff} +0 -0
- /package/lib/{iconfont.1741333630357.woff2 → iconfont.1742955973002.woff2} +0 -0
package/es/table/src/cell.js
CHANGED
|
@@ -304,7 +304,7 @@ function renderFooterHandle(h, params) {
|
|
|
304
304
|
return Cell.renderDefaultFooter(h, params);
|
|
305
305
|
}
|
|
306
306
|
export const Cell = {
|
|
307
|
-
createColumn($
|
|
307
|
+
createColumn($xeTable, _vm) {
|
|
308
308
|
const { type } = _vm;
|
|
309
309
|
const renConfs = {
|
|
310
310
|
renderHeader: renderHeaderHandle,
|
|
@@ -314,7 +314,7 @@ export const Cell = {
|
|
|
314
314
|
if (type === 'expand') {
|
|
315
315
|
renConfs.renderData = Cell.renderExpandData;
|
|
316
316
|
}
|
|
317
|
-
return createColumn($
|
|
317
|
+
return createColumn($xeTable, _vm, renConfs);
|
|
318
318
|
},
|
|
319
319
|
/**
|
|
320
320
|
* 列头标题
|
|
@@ -382,8 +382,8 @@ export const Cell = {
|
|
|
382
382
|
const { $table, isHidden } = params;
|
|
383
383
|
const tableReactData = $table;
|
|
384
384
|
const tableInternalData = $table;
|
|
385
|
-
const {
|
|
386
|
-
const { fullAllDataRowIdData } = tableInternalData;
|
|
385
|
+
const { treeExpandedFlag } = tableReactData;
|
|
386
|
+
const { fullAllDataRowIdData, treeExpandedMaps, treeExpandLazyLoadedMaps } = tableInternalData;
|
|
387
387
|
const treeOpts = $table.computeTreeOpts;
|
|
388
388
|
const { row, column, level } = params;
|
|
389
389
|
const { slots } = column;
|
|
@@ -403,7 +403,7 @@ export const Cell = {
|
|
|
403
403
|
}
|
|
404
404
|
if (!isHidden) {
|
|
405
405
|
const rowid = getRowid($table, row);
|
|
406
|
-
isActive = !!treeExpandedMaps[rowid];
|
|
406
|
+
isActive = !!treeExpandedFlag && !!treeExpandedMaps[rowid];
|
|
407
407
|
if (lazy) {
|
|
408
408
|
const rest = fullAllDataRowIdData[rowid];
|
|
409
409
|
isLazyLoading = !!treeExpandLazyLoadedMaps[rowid];
|
|
@@ -551,7 +551,8 @@ export const Cell = {
|
|
|
551
551
|
const headerSlot = slots ? slots.header : null;
|
|
552
552
|
const titleSlot = slots ? slots.title : null;
|
|
553
553
|
const checkboxOpts = $table.computeCheckboxOpts;
|
|
554
|
-
const headerTitle =
|
|
554
|
+
const { checkStrictly, showHeader, headerTitle } = checkboxOpts;
|
|
555
|
+
const colTitle = column.getTitle();
|
|
555
556
|
const ons = {};
|
|
556
557
|
if (!isHidden) {
|
|
557
558
|
ons.click = (evnt) => {
|
|
@@ -564,11 +565,11 @@ export const Cell = {
|
|
|
564
565
|
if (headerSlot) {
|
|
565
566
|
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h)));
|
|
566
567
|
}
|
|
567
|
-
if (
|
|
568
|
+
if (checkStrictly ? !showHeader : showHeader === false) {
|
|
568
569
|
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [
|
|
569
570
|
h('span', {
|
|
570
571
|
class: 'vxe-checkbox--label'
|
|
571
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) :
|
|
572
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)
|
|
572
573
|
]));
|
|
573
574
|
}
|
|
574
575
|
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [
|
|
@@ -579,18 +580,18 @@ export const Cell = {
|
|
|
579
580
|
'is--indeterminate': isAllCheckboxIndeterminate
|
|
580
581
|
}],
|
|
581
582
|
attrs: {
|
|
582
|
-
title: getI18n('vxe.table.allTitle')
|
|
583
|
+
title: XEUtils.eqNull(headerTitle) ? getI18n('vxe.table.allTitle') : `${headerTitle || ''}`
|
|
583
584
|
},
|
|
584
585
|
on: ons
|
|
585
586
|
}, [
|
|
586
587
|
h('span', {
|
|
587
588
|
class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
588
589
|
})
|
|
589
|
-
].concat(titleSlot ||
|
|
590
|
+
].concat(titleSlot || colTitle
|
|
590
591
|
? [
|
|
591
592
|
h('span', {
|
|
592
593
|
class: 'vxe-checkbox--label'
|
|
593
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) :
|
|
594
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)
|
|
594
595
|
]
|
|
595
596
|
: []))
|
|
596
597
|
]));
|
|
@@ -599,8 +600,10 @@ export const Cell = {
|
|
|
599
600
|
const { $table, row, column, isHidden } = params;
|
|
600
601
|
const tableProps = $table;
|
|
601
602
|
const tableReactData = $table;
|
|
603
|
+
const tableInternalData = $table;
|
|
602
604
|
const { treeConfig } = tableProps;
|
|
603
|
-
const {
|
|
605
|
+
const { updateCheckboxFlag } = tableReactData;
|
|
606
|
+
const { selectCheckboxMaps, treeIndeterminateRowMaps } = tableInternalData;
|
|
604
607
|
const checkboxOpts = $table.computeCheckboxOpts;
|
|
605
608
|
const { labelField, checkMethod, visibleMethod } = checkboxOpts;
|
|
606
609
|
const { slots } = column;
|
|
@@ -613,7 +616,7 @@ export const Cell = {
|
|
|
613
616
|
const ons = {};
|
|
614
617
|
if (!isHidden) {
|
|
615
618
|
const rowid = getRowid($table, row);
|
|
616
|
-
isChecked = !!selectCheckboxMaps[rowid];
|
|
619
|
+
isChecked = !!updateCheckboxFlag && !!selectCheckboxMaps[rowid];
|
|
617
620
|
ons.click = (evnt) => {
|
|
618
621
|
if (!isDisabled && isVisible) {
|
|
619
622
|
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
@@ -623,7 +626,7 @@ export const Cell = {
|
|
|
623
626
|
isDisabled = !checkMethod({ row });
|
|
624
627
|
}
|
|
625
628
|
if (treeConfig) {
|
|
626
|
-
indeterminate = !!
|
|
629
|
+
indeterminate = !!treeIndeterminateRowMaps[rowid];
|
|
627
630
|
}
|
|
628
631
|
}
|
|
629
632
|
const checkboxParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate });
|
|
@@ -660,8 +663,10 @@ export const Cell = {
|
|
|
660
663
|
const { $table, row, column, isHidden } = params;
|
|
661
664
|
const tableProps = $table;
|
|
662
665
|
const tableReactData = $table;
|
|
666
|
+
const tableInternalData = $table;
|
|
663
667
|
const { treeConfig } = tableProps;
|
|
664
|
-
const {
|
|
668
|
+
const { updateCheckboxFlag } = tableReactData;
|
|
669
|
+
const { treeIndeterminateRowMaps } = tableInternalData;
|
|
665
670
|
const checkboxOpts = $table.computeCheckboxOpts;
|
|
666
671
|
const { labelField, checkField, checkMethod, visibleMethod } = checkboxOpts;
|
|
667
672
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
@@ -675,7 +680,7 @@ export const Cell = {
|
|
|
675
680
|
const ons = {};
|
|
676
681
|
if (!isHidden) {
|
|
677
682
|
const rowid = getRowid($table, row);
|
|
678
|
-
isChecked = XEUtils.get(row, checkField);
|
|
683
|
+
isChecked = !!updateCheckboxFlag && XEUtils.get(row, checkField);
|
|
679
684
|
ons.click = (evnt) => {
|
|
680
685
|
if (!isDisabled && isVisible) {
|
|
681
686
|
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
@@ -685,7 +690,7 @@ export const Cell = {
|
|
|
685
690
|
isDisabled = !checkMethod({ row });
|
|
686
691
|
}
|
|
687
692
|
if (treeConfig) {
|
|
688
|
-
isIndeterminate = !!
|
|
693
|
+
isIndeterminate = !!treeIndeterminateRowMaps[rowid];
|
|
689
694
|
}
|
|
690
695
|
}
|
|
691
696
|
const checkboxParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate });
|
|
@@ -723,8 +728,8 @@ export const Cell = {
|
|
|
723
728
|
*/
|
|
724
729
|
renderExpandCell(h, params) {
|
|
725
730
|
const { $table, isHidden, row, column } = params;
|
|
726
|
-
const
|
|
727
|
-
const { rowExpandedMaps, rowExpandLazyLoadedMaps } =
|
|
731
|
+
const tableInternalData = $table;
|
|
732
|
+
const { rowExpandedMaps, rowExpandLazyLoadedMaps } = tableInternalData;
|
|
728
733
|
const expandOpts = $table.computeExpandOpts;
|
|
729
734
|
const { lazy, labelField, iconLoaded, showIcon, iconOpen, iconClose, visibleMethod } = expandOpts;
|
|
730
735
|
const { slots } = column;
|
|
@@ -820,7 +825,7 @@ export const Cell = {
|
|
|
820
825
|
renderSortIcon(h, params) {
|
|
821
826
|
const { $table, column } = params;
|
|
822
827
|
const sortOpts = $table.computeSortOpts;
|
|
823
|
-
const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
|
|
828
|
+
const { showIcon, allowBtn, ascTitle, descTitle, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
|
|
824
829
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
825
830
|
return [
|
|
826
831
|
h('span', {
|
|
@@ -831,7 +836,7 @@ export const Cell = {
|
|
|
831
836
|
'sort--active': column.order === 'asc'
|
|
832
837
|
}],
|
|
833
838
|
attrs: {
|
|
834
|
-
title: getI18n('vxe.table.sortAsc')
|
|
839
|
+
title: XEUtils.eqNull(ascTitle) ? getI18n('vxe.table.sortAsc') : `${ascTitle || ''}`
|
|
835
840
|
},
|
|
836
841
|
on: allowBtn
|
|
837
842
|
? {
|
|
@@ -847,7 +852,7 @@ export const Cell = {
|
|
|
847
852
|
'sort--active': column.order === 'desc'
|
|
848
853
|
}],
|
|
849
854
|
attrs: {
|
|
850
|
-
title: getI18n('vxe.table.sortDesc')
|
|
855
|
+
title: XEUtils.eqNull(descTitle) ? getI18n('vxe.table.sortDesc') : `${descTitle || ''}`
|
|
851
856
|
},
|
|
852
857
|
on: allowBtn
|
|
853
858
|
? {
|
package/es/table/src/column.js
CHANGED
|
@@ -131,14 +131,15 @@ export const columnProps = {
|
|
|
131
131
|
export const columnWatch = {};
|
|
132
132
|
Object.keys(columnProps).forEach(name => {
|
|
133
133
|
columnWatch[name] = function (value) {
|
|
134
|
+
const $xeTable = this.$xeTable;
|
|
134
135
|
this.columnConfig.update(name, value);
|
|
135
|
-
if (
|
|
136
|
+
if ($xeTable) {
|
|
136
137
|
if (name === 'filters') {
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
$xeTable.setFilter(this.columnConfig, value);
|
|
139
|
+
$xeTable.handleUpdateDataQueue();
|
|
139
140
|
}
|
|
140
141
|
else if (['visible', 'fixed', 'width', 'minWidth', 'maxWidth'].includes(name)) {
|
|
141
|
-
|
|
142
|
+
$xeTable.handleRefreshColumnQueue();
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
};
|
|
@@ -148,21 +149,22 @@ export default {
|
|
|
148
149
|
props: columnProps,
|
|
149
150
|
provide() {
|
|
150
151
|
return {
|
|
151
|
-
$
|
|
152
|
-
$
|
|
152
|
+
$xeColumn: this,
|
|
153
|
+
$xeGrid: null
|
|
153
154
|
};
|
|
154
155
|
},
|
|
155
156
|
inject: {
|
|
156
|
-
$
|
|
157
|
+
$xeTable: {
|
|
157
158
|
default: null
|
|
158
159
|
},
|
|
159
|
-
$
|
|
160
|
+
$xeColumn: {
|
|
160
161
|
default: null
|
|
161
162
|
}
|
|
162
163
|
},
|
|
163
164
|
watch: columnWatch,
|
|
164
165
|
created() {
|
|
165
|
-
|
|
166
|
+
const $xeTable = this.$xeTable;
|
|
167
|
+
this.columnConfig = this.createColumn($xeTable, this);
|
|
166
168
|
},
|
|
167
169
|
mounted() {
|
|
168
170
|
this.columnConfig.slots = this.$scopedSlots;
|
|
@@ -6,12 +6,12 @@ import { warnLog, errLog } from '../../ui/src/log';
|
|
|
6
6
|
const { getI18n, formats } = VxeUI;
|
|
7
7
|
export class ColumnInfo {
|
|
8
8
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
9
|
-
constructor($
|
|
10
|
-
const
|
|
11
|
-
const
|
|
9
|
+
constructor($xeTable, _vm, { renderHeader, renderCell, renderFooter, renderData } = {}) {
|
|
10
|
+
const tableProps = $xeTable;
|
|
11
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
12
|
+
const proxyOpts = $xeGrid ? $xeGrid.proxyOpts : null;
|
|
12
13
|
const formatter = _vm.formatter;
|
|
13
14
|
const visible = XEUtils.isBoolean(_vm.visible) ? _vm.visible : true;
|
|
14
|
-
const tableProps = $xetable;
|
|
15
15
|
const types = ['seq', 'checkbox', 'radio', 'expand', 'html'];
|
|
16
16
|
if (_vm.type && types.indexOf(_vm.type) === -1) {
|
|
17
17
|
warnLog('vxe.error.errProp', [`type=${_vm.type}`, types.join(', ')]);
|
|
@@ -24,7 +24,7 @@ export class ColumnInfo {
|
|
|
24
24
|
}
|
|
25
25
|
if (_vm.type === 'expand') {
|
|
26
26
|
const { treeConfig } = tableProps;
|
|
27
|
-
if (treeConfig && ($
|
|
27
|
+
if (treeConfig && ($xeTable.treeOpts.showLine || $xeTable.treeOpts.line)) {
|
|
28
28
|
errLog('vxe.error.errConflicts', ['tree-config.line', 'column.type=expand']);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -136,7 +136,7 @@ export class ColumnInfo {
|
|
|
136
136
|
slots: _vm.slots
|
|
137
137
|
});
|
|
138
138
|
if (proxyOpts && proxyOpts.beforeColumn) {
|
|
139
|
-
proxyOpts.beforeColumn({ $grid: $
|
|
139
|
+
proxyOpts.beforeColumn({ $grid: $xeGrid, column: this });
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
getTitle() {
|
package/es/table/src/footer.js
CHANGED
|
@@ -24,10 +24,11 @@ function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIn
|
|
|
24
24
|
const tableProps = $xeTable;
|
|
25
25
|
const tableReactData = $xeTable;
|
|
26
26
|
const tableInternalData = $xeTable;
|
|
27
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
27
28
|
const { fixedType } = props;
|
|
28
29
|
const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps;
|
|
29
30
|
const { scrollXLoad, scrollYLoad, overflowX, currentColumn, mergeFooterList } = tableReactData;
|
|
30
|
-
const { scrollXStore } = tableInternalData;
|
|
31
|
+
const { fullColumnIdData, scrollXStore } = tableInternalData;
|
|
31
32
|
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
32
33
|
const { isAllColumnDrag } = $xeTable.resizableOpts;
|
|
33
34
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
@@ -38,6 +39,7 @@ function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIn
|
|
|
38
39
|
return tableColumn.map((column, $columnIndex) => {
|
|
39
40
|
const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column;
|
|
40
41
|
const colid = column.id;
|
|
42
|
+
const colRest = fullColumnIdData[colid] || {};
|
|
41
43
|
const renderOpts = editRender || cellRender;
|
|
42
44
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
43
45
|
const showAllTip = tooltipOpts.showAll;
|
|
@@ -53,12 +55,12 @@ function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIn
|
|
|
53
55
|
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable));
|
|
54
56
|
const attrs = { colid };
|
|
55
57
|
const tfOns = {};
|
|
56
|
-
const columnIndex =
|
|
57
|
-
const _columnIndex =
|
|
58
|
+
const columnIndex = colRest.index;
|
|
59
|
+
const _columnIndex = colRest._index;
|
|
58
60
|
const itemIndex = _columnIndex;
|
|
59
61
|
const cellParams = {
|
|
60
62
|
$table: $xeTable,
|
|
61
|
-
$grid: $
|
|
63
|
+
$grid: $xeGrid,
|
|
62
64
|
row,
|
|
63
65
|
rowIndex: _rowIndex,
|
|
64
66
|
_rowIndex,
|
|
@@ -293,7 +295,7 @@ export default {
|
|
|
293
295
|
const { fixedType, fixedColumn, tableColumn } = props;
|
|
294
296
|
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps;
|
|
295
297
|
const { visibleColumn, fullColumnIdData } = tableInternalData;
|
|
296
|
-
const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData;
|
|
298
|
+
const { isGroup, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData;
|
|
297
299
|
let renderColumnList = tableColumn;
|
|
298
300
|
let isOptimizeMode = false;
|
|
299
301
|
// 如果是使用优化模式
|
|
@@ -305,7 +307,7 @@ export default {
|
|
|
305
307
|
isOptimizeMode = true;
|
|
306
308
|
}
|
|
307
309
|
}
|
|
308
|
-
if (fixedType || !overflowX) {
|
|
310
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
309
311
|
renderColumnList = visibleColumn;
|
|
310
312
|
}
|
|
311
313
|
if (fixedType) {
|
|
@@ -380,7 +382,10 @@ export default {
|
|
|
380
382
|
attrs: {
|
|
381
383
|
name: column.id
|
|
382
384
|
},
|
|
383
|
-
key: $columnIndex
|
|
385
|
+
key: $columnIndex,
|
|
386
|
+
style: {
|
|
387
|
+
width: `${column.renderWidth}px`
|
|
388
|
+
}
|
|
384
389
|
});
|
|
385
390
|
})),
|
|
386
391
|
/**
|
package/es/table/src/group.js
CHANGED
|
@@ -7,21 +7,22 @@ export default {
|
|
|
7
7
|
props: columnProps,
|
|
8
8
|
provide() {
|
|
9
9
|
return {
|
|
10
|
-
$
|
|
11
|
-
$
|
|
10
|
+
$xeColumn: this,
|
|
11
|
+
$xeGrid: null
|
|
12
12
|
};
|
|
13
13
|
},
|
|
14
14
|
inject: {
|
|
15
|
-
$
|
|
15
|
+
$xeTable: {
|
|
16
16
|
default: null
|
|
17
17
|
},
|
|
18
|
-
$
|
|
18
|
+
$xeColumn: {
|
|
19
19
|
default: null
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
watch: columnWatch,
|
|
23
23
|
created() {
|
|
24
|
-
|
|
24
|
+
const $xeTable = this.$xeTable;
|
|
25
|
+
this.columnConfig = this.createColumn($xeTable, this);
|
|
25
26
|
},
|
|
26
27
|
mounted() {
|
|
27
28
|
const { $scopedSlots } = this;
|
package/es/table/src/header.js
CHANGED
|
@@ -7,14 +7,14 @@ const cellType = 'header';
|
|
|
7
7
|
const renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) => {
|
|
8
8
|
const props = _vm;
|
|
9
9
|
const $xeTable = _vm.$parent;
|
|
10
|
-
const $xeGrid = $xeTable
|
|
10
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
11
11
|
const tableProps = $xeTable;
|
|
12
12
|
const tableReactData = $xeTable;
|
|
13
13
|
const tableInternalData = $xeTable;
|
|
14
14
|
const { fixedType } = props;
|
|
15
15
|
const { resizable: allResizable, columnKey, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps;
|
|
16
16
|
const { currentColumn, dragCol, scrollXLoad, scrollYLoad, overflowX } = tableReactData;
|
|
17
|
-
const { scrollXStore } = tableInternalData;
|
|
17
|
+
const { fullColumnIdData, scrollXStore } = tableInternalData;
|
|
18
18
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
19
19
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
20
20
|
const cellOpts = $xeTable.computeCellOpts;
|
|
@@ -26,6 +26,7 @@ const renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) => {
|
|
|
26
26
|
const { type, showHeaderOverflow, headerAlign, align, filters, headerClassName, editRender, cellRender } = column;
|
|
27
27
|
// const { enabled } = tooltipOpts
|
|
28
28
|
const colid = column.id;
|
|
29
|
+
const colRest = fullColumnIdData[colid] || {};
|
|
29
30
|
const renderOpts = editRender || cellRender;
|
|
30
31
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null;
|
|
31
32
|
const isColGroup = column.children && column.children.length;
|
|
@@ -43,8 +44,8 @@ const renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) => {
|
|
|
43
44
|
firstFilterOption = filters[0];
|
|
44
45
|
hasFilter = filters.some((item) => item.checked);
|
|
45
46
|
}
|
|
46
|
-
const columnIndex =
|
|
47
|
-
const _columnIndex =
|
|
47
|
+
const columnIndex = colRest.index;
|
|
48
|
+
const _columnIndex = colRest._index;
|
|
48
49
|
const cellParams = { $table: $xeTable, $grid: $xeGrid, $rowIndex, column, columnIndex, $columnIndex, _columnIndex, firstFilterOption, fixed: fixedType, type: cellType, isHidden: fixedHiddenColumn, hasFilter };
|
|
49
50
|
const thAttrs = {
|
|
50
51
|
colid,
|
|
@@ -252,7 +253,7 @@ export default {
|
|
|
252
253
|
const { fixedType, fixedColumn, tableColumn } = props;
|
|
253
254
|
const { headerColumn } = this;
|
|
254
255
|
const { mouseConfig, showHeaderOverflow: allColumnHeaderOverflow, spanMethod, footerSpanMethod } = tableProps;
|
|
255
|
-
const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData;
|
|
256
|
+
const { isGroup, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData;
|
|
256
257
|
const { visibleColumn, fullColumnIdData } = tableInternalData;
|
|
257
258
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
258
259
|
let renderHeaderList = headerColumn;
|
|
@@ -271,7 +272,7 @@ export default {
|
|
|
271
272
|
isOptimizeMode = true;
|
|
272
273
|
}
|
|
273
274
|
}
|
|
274
|
-
if (fixedType || !overflowX) {
|
|
275
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
275
276
|
renderColumnList = visibleColumn;
|
|
276
277
|
}
|
|
277
278
|
if (fixedType) {
|
|
@@ -351,7 +352,10 @@ export default {
|
|
|
351
352
|
attrs: {
|
|
352
353
|
name: column.id
|
|
353
354
|
},
|
|
354
|
-
key: $columnIndex
|
|
355
|
+
key: $columnIndex,
|
|
356
|
+
style: {
|
|
357
|
+
width: `${column.renderWidth}px`
|
|
358
|
+
}
|
|
355
359
|
});
|
|
356
360
|
})),
|
|
357
361
|
/**
|
|
@@ -390,8 +394,10 @@ export default {
|
|
|
390
394
|
},
|
|
391
395
|
methods: {
|
|
392
396
|
uploadColumn() {
|
|
393
|
-
const
|
|
394
|
-
|
|
397
|
+
const $xeTable = this.$parent;
|
|
398
|
+
const tableReactData = $xeTable;
|
|
399
|
+
const { isGroup } = tableReactData;
|
|
400
|
+
this.headerColumn = isGroup ? convertHeaderColumnToRows(this.tableGroupColumn) : [];
|
|
395
401
|
}
|
|
396
402
|
}
|
|
397
403
|
};
|