vxe-table 4.12.0-beta.8 → 4.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/grid/src/grid.js +58 -44
- 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/hook.js +1 -1
- package/es/table/module/custom/panel.js +4 -2
- package/es/table/module/edit/hook.js +11 -12
- package/es/table/module/export/export-panel.js +3 -2
- package/es/table/module/export/import-panel.js +3 -2
- package/es/table/module/filter/panel.js +12 -2
- package/es/table/module/keyboard/hook.js +105 -30
- package/es/table/module/menu/hook.js +2 -1
- package/es/table/module/validator/hook.js +4 -3
- package/es/table/render/index.js +3 -3
- package/es/table/src/body.js +40 -21
- package/es/table/src/cell.js +43 -24
- package/es/table/src/columnInfo.js +2 -2
- package/es/table/src/footer.js +12 -7
- package/es/table/src/header.js +12 -7
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +444 -423
- package/es/table/src/util.js +34 -6
- 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 +55 -48
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +515 -302
- 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-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/hook.js +1 -1
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +4 -2
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/hook.js +13 -13
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/export-panel.js +3 -2
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +3 -2
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/filter/panel.js +8 -2
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +113 -31
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/module/menu/hook.js +2 -1
- package/lib/table/module/menu/hook.min.js +1 -1
- package/lib/table/module/validator/hook.js +5 -4
- package/lib/table/module/validator/hook.min.js +1 -1
- package/lib/table/render/index.js +4 -3
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +48 -20
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +49 -25
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +2 -4
- 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/header.js +12 -5
- package/lib/table/src/header.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 +534 -459
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +36 -6
- package/lib/table/src/util.min.js +1 -1
- 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 +62 -50
- 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/hook.ts +1 -1
- package/packages/table/module/custom/panel.ts +6 -2
- package/packages/table/module/edit/hook.ts +12 -12
- package/packages/table/module/export/export-panel.ts +4 -2
- package/packages/table/module/export/import-panel.ts +4 -2
- package/packages/table/module/filter/panel.ts +12 -2
- package/packages/table/module/keyboard/hook.ts +106 -32
- package/packages/table/module/menu/hook.ts +3 -1
- package/packages/table/module/validator/hook.ts +5 -3
- package/packages/table/render/index.ts +3 -4
- package/packages/table/src/body.ts +41 -21
- package/packages/table/src/cell.ts +43 -24
- package/packages/table/src/columnInfo.ts +3 -2
- package/packages/table/src/footer.ts +13 -7
- package/packages/table/src/header.ts +13 -7
- package/packages/table/src/props.ts +4 -0
- package/packages/table/src/table.ts +451 -421
- package/packages/table/src/util.ts +39 -6
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1741333670965.ttf → iconfont.1742955995631.ttf} +0 -0
- /package/es/{iconfont.1741333670965.woff → iconfont.1742955995631.woff} +0 -0
- /package/es/{iconfont.1741333670965.woff2 → iconfont.1742955995631.woff2} +0 -0
- /package/lib/{iconfont.1741333670965.ttf → iconfont.1742955995631.ttf} +0 -0
- /package/lib/{iconfont.1741333670965.woff → iconfont.1742955995631.woff} +0 -0
- /package/lib/{iconfont.1741333670965.woff2 → iconfont.1742955995631.woff2} +0 -0
|
@@ -228,15 +228,27 @@ function getFooterContent (params: VxeTableDefines.CellRenderFooterParams & { $t
|
|
|
228
228
|
})
|
|
229
229
|
if (footerFormatter) {
|
|
230
230
|
if (XEUtils.isFunction(footerFormatter)) {
|
|
231
|
-
return
|
|
231
|
+
return [
|
|
232
|
+
h('span', {
|
|
233
|
+
class: 'vxe-cell--label'
|
|
234
|
+
}, `${footerFormatter(footParams)}`)
|
|
235
|
+
]
|
|
232
236
|
}
|
|
233
237
|
const isArr = XEUtils.isArray(footerFormatter)
|
|
234
238
|
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter)
|
|
235
239
|
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null
|
|
236
240
|
if (footerFormatMethod) {
|
|
237
|
-
return
|
|
241
|
+
return [
|
|
242
|
+
h('span', {
|
|
243
|
+
class: 'vxe-cell--label'
|
|
244
|
+
}, `${isArr ? footerFormatMethod(footParams, ...footerFormatter.slice(1)) : footerFormatMethod(footParams)}`)
|
|
245
|
+
]
|
|
238
246
|
}
|
|
239
|
-
return
|
|
247
|
+
return [
|
|
248
|
+
h('span', {
|
|
249
|
+
class: 'vxe-cell--label'
|
|
250
|
+
}, '')
|
|
251
|
+
]
|
|
240
252
|
}
|
|
241
253
|
if (renderOpts) {
|
|
242
254
|
const compConf = renderer.get(renderOpts.name)
|
|
@@ -248,7 +260,9 @@ function getFooterContent (params: VxeTableDefines.CellRenderFooterParams & { $t
|
|
|
248
260
|
}
|
|
249
261
|
}
|
|
250
262
|
return [
|
|
251
|
-
|
|
263
|
+
h('span', {
|
|
264
|
+
class: 'vxe-cell--label'
|
|
265
|
+
}, formatText(itemValue, 1))
|
|
252
266
|
]
|
|
253
267
|
}
|
|
254
268
|
|
|
@@ -415,8 +429,8 @@ export const Cell = {
|
|
|
415
429
|
const tableReactData = $table.reactData
|
|
416
430
|
const tableInternalData = $table.internalData
|
|
417
431
|
const { computeTreeOpts } = $table.getComputeMaps()
|
|
418
|
-
const {
|
|
419
|
-
const { fullAllDataRowIdData } = tableInternalData
|
|
432
|
+
const { treeExpandedFlag } = tableReactData
|
|
433
|
+
const { fullAllDataRowIdData, treeExpandedMaps, treeExpandLazyLoadedMaps } = tableInternalData
|
|
420
434
|
const treeOpts = computeTreeOpts.value
|
|
421
435
|
const { row, column, level } = params
|
|
422
436
|
const { slots } = column
|
|
@@ -436,7 +450,7 @@ export const Cell = {
|
|
|
436
450
|
}
|
|
437
451
|
if (!isHidden) {
|
|
438
452
|
const rowid = getRowid($table, row)
|
|
439
|
-
isActive = !!treeExpandedMaps[rowid]
|
|
453
|
+
isActive = !!treeExpandedFlag && !!treeExpandedMaps[rowid]
|
|
440
454
|
if (lazy) {
|
|
441
455
|
const rest = fullAllDataRowIdData[rowid]
|
|
442
456
|
isLazyLoading = !!treeExpandLazyLoadedMaps[rowid]
|
|
@@ -598,7 +612,8 @@ export const Cell = {
|
|
|
598
612
|
const headerSlot = slots ? slots.header : null
|
|
599
613
|
const titleSlot = slots ? slots.title : null
|
|
600
614
|
const checkboxOpts = computeCheckboxOpts.value
|
|
601
|
-
const headerTitle =
|
|
615
|
+
const { checkStrictly, showHeader, headerTitle } = checkboxOpts
|
|
616
|
+
const colTitle = column.getTitle()
|
|
602
617
|
const ons: Record<string, any> = {}
|
|
603
618
|
if (!isHidden) {
|
|
604
619
|
ons.onClick = (evnt: MouseEvent) => {
|
|
@@ -611,11 +626,11 @@ export const Cell = {
|
|
|
611
626
|
if (headerSlot) {
|
|
612
627
|
return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, $table.callSlot(headerSlot, checkboxParams)))
|
|
613
628
|
}
|
|
614
|
-
if (
|
|
629
|
+
if (checkStrictly ? !showHeader : showHeader === false) {
|
|
615
630
|
return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, [
|
|
616
631
|
h('span', {
|
|
617
632
|
class: 'vxe-checkbox--label'
|
|
618
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams) :
|
|
633
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)
|
|
619
634
|
]))
|
|
620
635
|
}
|
|
621
636
|
return renderHeaderCellBaseVNs(params,
|
|
@@ -626,17 +641,17 @@ export const Cell = {
|
|
|
626
641
|
'is--disabled': isAllCheckboxDisabled,
|
|
627
642
|
'is--indeterminate': isAllCheckboxIndeterminate
|
|
628
643
|
}],
|
|
629
|
-
title: getI18n('vxe.table.allTitle')
|
|
644
|
+
title: XEUtils.eqNull(headerTitle) ? getI18n('vxe.table.allTitle') : `${headerTitle || ''}`,
|
|
630
645
|
...ons
|
|
631
646
|
}, [
|
|
632
647
|
h('span', {
|
|
633
648
|
class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
634
649
|
})
|
|
635
|
-
].concat(titleSlot ||
|
|
650
|
+
].concat(titleSlot || colTitle
|
|
636
651
|
? [
|
|
637
652
|
h('span', {
|
|
638
653
|
class: 'vxe-checkbox--label'
|
|
639
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams) :
|
|
654
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)
|
|
640
655
|
]
|
|
641
656
|
: []))
|
|
642
657
|
])
|
|
@@ -646,8 +661,10 @@ export const Cell = {
|
|
|
646
661
|
const { $table, row, column, isHidden } = params
|
|
647
662
|
const tableProps = $table.props
|
|
648
663
|
const tableReactData = $table.reactData
|
|
664
|
+
const tableInternalData = $table.internalData
|
|
649
665
|
const { treeConfig } = tableProps
|
|
650
|
-
const {
|
|
666
|
+
const { updateCheckboxFlag } = tableReactData
|
|
667
|
+
const { selectCheckboxMaps, treeIndeterminateRowMaps } = tableInternalData
|
|
651
668
|
const { computeCheckboxOpts } = $table.getComputeMaps()
|
|
652
669
|
const checkboxOpts = computeCheckboxOpts.value
|
|
653
670
|
const { labelField, checkMethod, visibleMethod } = checkboxOpts
|
|
@@ -661,7 +678,7 @@ export const Cell = {
|
|
|
661
678
|
const ons: Record<string, any> = {}
|
|
662
679
|
if (!isHidden) {
|
|
663
680
|
const rowid = getRowid($table, row)
|
|
664
|
-
isChecked = !!selectCheckboxMaps[rowid]
|
|
681
|
+
isChecked = !!updateCheckboxFlag && !!selectCheckboxMaps[rowid]
|
|
665
682
|
ons.onClick = (evnt: MouseEvent) => {
|
|
666
683
|
if (!isDisabled && isVisible) {
|
|
667
684
|
$table.triggerCheckRowEvent(evnt, params, !isChecked)
|
|
@@ -671,7 +688,7 @@ export const Cell = {
|
|
|
671
688
|
isDisabled = !checkMethod({ row })
|
|
672
689
|
}
|
|
673
690
|
if (treeConfig) {
|
|
674
|
-
indeterminate = !!
|
|
691
|
+
indeterminate = !!treeIndeterminateRowMaps[rowid]
|
|
675
692
|
}
|
|
676
693
|
}
|
|
677
694
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
|
|
@@ -712,8 +729,10 @@ export const Cell = {
|
|
|
712
729
|
const { $table, row, column, isHidden } = params
|
|
713
730
|
const tableProps = $table.props
|
|
714
731
|
const tableReactData = $table.reactData
|
|
732
|
+
const tableInternalData = $table.internalData
|
|
715
733
|
const { treeConfig } = tableProps
|
|
716
|
-
const {
|
|
734
|
+
const { updateCheckboxFlag } = tableReactData
|
|
735
|
+
const { treeIndeterminateRowMaps } = tableInternalData
|
|
717
736
|
const { computeCheckboxOpts } = $table.getComputeMaps()
|
|
718
737
|
const checkboxOpts = computeCheckboxOpts.value
|
|
719
738
|
const { labelField, checkField, checkMethod, visibleMethod } = checkboxOpts
|
|
@@ -728,7 +747,7 @@ export const Cell = {
|
|
|
728
747
|
const ons: Record<string, any> = {}
|
|
729
748
|
if (!isHidden) {
|
|
730
749
|
const rowid = getRowid($table, row)
|
|
731
|
-
isChecked = XEUtils.get(row, checkField
|
|
750
|
+
isChecked = !!updateCheckboxFlag && XEUtils.get(row, checkField)
|
|
732
751
|
ons.onClick = (evnt: MouseEvent) => {
|
|
733
752
|
if (!isDisabled && isVisible) {
|
|
734
753
|
$table.triggerCheckRowEvent(evnt, params, !isChecked)
|
|
@@ -738,7 +757,7 @@ export const Cell = {
|
|
|
738
757
|
isDisabled = !checkMethod({ row })
|
|
739
758
|
}
|
|
740
759
|
if (treeConfig) {
|
|
741
|
-
isIndeterminate = !!
|
|
760
|
+
isIndeterminate = !!treeIndeterminateRowMaps[rowid]
|
|
742
761
|
}
|
|
743
762
|
}
|
|
744
763
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate }
|
|
@@ -781,8 +800,8 @@ export const Cell = {
|
|
|
781
800
|
*/
|
|
782
801
|
renderExpandCell (params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
783
802
|
const { $table, isHidden, row, column } = params
|
|
784
|
-
const
|
|
785
|
-
const { rowExpandedMaps, rowExpandLazyLoadedMaps } =
|
|
803
|
+
const tableInternalData = $table.internalData
|
|
804
|
+
const { rowExpandedMaps, rowExpandLazyLoadedMaps } = tableInternalData
|
|
786
805
|
const { computeExpandOpts } = $table.getComputeMaps()
|
|
787
806
|
const expandOpts = computeExpandOpts.value
|
|
788
807
|
const { lazy, labelField, iconLoaded, showIcon, iconOpen, iconClose, visibleMethod } = expandOpts
|
|
@@ -889,7 +908,7 @@ export const Cell = {
|
|
|
889
908
|
const { $table, column } = params
|
|
890
909
|
const { computeSortOpts } = $table.getComputeMaps()
|
|
891
910
|
const sortOpts = computeSortOpts.value
|
|
892
|
-
const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
|
|
911
|
+
const { showIcon, allowBtn, ascTitle, descTitle, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
|
|
893
912
|
const { order } = column
|
|
894
913
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
895
914
|
return [
|
|
@@ -900,7 +919,7 @@ export const Cell = {
|
|
|
900
919
|
class: ['vxe-sort--asc-btn', iconAsc || getIcon().TABLE_SORT_ASC, {
|
|
901
920
|
'sort--active': order === 'asc'
|
|
902
921
|
}],
|
|
903
|
-
title: getI18n('vxe.table.sortAsc')
|
|
922
|
+
title: XEUtils.eqNull(ascTitle) ? getI18n('vxe.table.sortAsc') : `${ascTitle || ''}`,
|
|
904
923
|
onClick: allowBtn
|
|
905
924
|
? (evnt: Event) => {
|
|
906
925
|
evnt.stopPropagation()
|
|
@@ -912,7 +931,7 @@ export const Cell = {
|
|
|
912
931
|
class: ['vxe-sort--desc-btn', iconDesc || getIcon().TABLE_SORT_DESC, {
|
|
913
932
|
'sort--active': order === 'desc'
|
|
914
933
|
}],
|
|
915
|
-
title: getI18n('vxe.table.sortDesc')
|
|
934
|
+
title: XEUtils.eqNull(descTitle) ? getI18n('vxe.table.sortDesc') : `${descTitle || ''}`,
|
|
916
935
|
onClick: allowBtn
|
|
917
936
|
? (evnt: Event) => {
|
|
918
937
|
evnt.stopPropagation()
|
|
@@ -10,10 +10,11 @@ const { getI18n, formats } = VxeUI
|
|
|
10
10
|
export class ColumnInfo {
|
|
11
11
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
12
12
|
constructor ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, _vm: any, { renderHeader, renderCell, renderFooter, renderData }: any = {}) {
|
|
13
|
-
const
|
|
13
|
+
const tableProps = $xeTable.props
|
|
14
|
+
const $xeGrid = $xeTable.xeGrid
|
|
15
|
+
|
|
14
16
|
const formatter: string | any[] = _vm.formatter
|
|
15
17
|
const visible = XEUtils.isBoolean(_vm.visible) ? _vm.visible : true
|
|
16
|
-
const { props: tableProps } = $xeTable
|
|
17
18
|
|
|
18
19
|
const types = ['seq', 'checkbox', 'radio', 'expand', 'html']
|
|
19
20
|
if (_vm.type && types.indexOf(_vm.type) === -1) {
|
|
@@ -58,10 +58,12 @@ export default defineComponent({
|
|
|
58
58
|
const refFooterXSpace = ref() as Ref<HTMLDivElement>
|
|
59
59
|
|
|
60
60
|
const renderRows = (tableColumn: VxeTableDefines.ColumnInfo[], footerTableData: any[], row: any, $rowIndex: number, _rowIndex: number) => {
|
|
61
|
+
const $xeGrid = $xeTable.xeGrid
|
|
62
|
+
|
|
61
63
|
const { fixedType } = props
|
|
62
64
|
const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
63
65
|
const { scrollXLoad, scrollYLoad, overflowX, currentColumn, mergeFooterList } = tableReactData
|
|
64
|
-
const { scrollXStore } = tableInternalData
|
|
66
|
+
const { fullColumnIdData, scrollXStore } = tableInternalData
|
|
65
67
|
const tooltipOpts = computeTooltipOpts.value
|
|
66
68
|
const resizableOpts = computeResizableOpts.value
|
|
67
69
|
const { isAllColumnDrag } = resizableOpts
|
|
@@ -74,6 +76,7 @@ export default defineComponent({
|
|
|
74
76
|
return tableColumn.map((column, $columnIndex) => {
|
|
75
77
|
const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column
|
|
76
78
|
const colid = column.id
|
|
79
|
+
const colRest = fullColumnIdData[colid] || {}
|
|
77
80
|
const renderOpts = editRender || cellRender
|
|
78
81
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null
|
|
79
82
|
const showAllTip = tooltipOpts.showAll
|
|
@@ -89,14 +92,14 @@ export default defineComponent({
|
|
|
89
92
|
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
|
|
90
93
|
const attrs: any = { colid }
|
|
91
94
|
const tfOns: any = {}
|
|
92
|
-
const columnIndex =
|
|
93
|
-
const _columnIndex =
|
|
95
|
+
const columnIndex = colRest.index
|
|
96
|
+
const _columnIndex = colRest._index
|
|
94
97
|
const itemIndex = _columnIndex
|
|
95
98
|
const cellParams: VxeTableDefines.CellRenderFooterParams & {
|
|
96
99
|
$table: VxeTableConstructor<any> & VxeTablePrivateMethods
|
|
97
100
|
} = {
|
|
98
101
|
$table: $xeTable,
|
|
99
|
-
$grid: $
|
|
102
|
+
$grid: $xeGrid,
|
|
100
103
|
row,
|
|
101
104
|
rowIndex: _rowIndex,
|
|
102
105
|
_rowIndex,
|
|
@@ -272,7 +275,7 @@ export default defineComponent({
|
|
|
272
275
|
const { fixedType, fixedColumn, tableColumn } = props
|
|
273
276
|
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
274
277
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
275
|
-
const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
278
|
+
const { isGroup, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
276
279
|
|
|
277
280
|
let renderColumnList = tableColumn
|
|
278
281
|
let isOptimizeMode = false
|
|
@@ -285,7 +288,7 @@ export default defineComponent({
|
|
|
285
288
|
}
|
|
286
289
|
}
|
|
287
290
|
|
|
288
|
-
if (fixedType || !overflowX) {
|
|
291
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
289
292
|
renderColumnList = visibleColumn
|
|
290
293
|
}
|
|
291
294
|
|
|
@@ -354,7 +357,10 @@ export default defineComponent({
|
|
|
354
357
|
}, renderColumnList.map((column, $columnIndex) => {
|
|
355
358
|
return h('col', {
|
|
356
359
|
name: column.id,
|
|
357
|
-
key: $columnIndex
|
|
360
|
+
key: $columnIndex,
|
|
361
|
+
style: {
|
|
362
|
+
width: `${column.renderWidth}px`
|
|
363
|
+
}
|
|
358
364
|
})
|
|
359
365
|
})),
|
|
360
366
|
/**
|
|
@@ -43,10 +43,12 @@ export default defineComponent({
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
const renderRows = (isGroup: boolean, isOptimizeMode: boolean, cols: VxeTableDefines.ColumnInfo[], $rowIndex: number) => {
|
|
46
|
+
const $xeGrid = $xeTable.xeGrid
|
|
47
|
+
|
|
46
48
|
const { fixedType } = props
|
|
47
49
|
const { resizable: allResizable, columnKey, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps
|
|
48
50
|
const { currentColumn, dragCol, scrollXLoad, scrollYLoad, overflowX } = tableReactData
|
|
49
|
-
const { scrollXStore } = tableInternalData
|
|
51
|
+
const { fullColumnIdData, scrollXStore } = tableInternalData
|
|
50
52
|
const columnOpts = computeColumnOpts.value
|
|
51
53
|
const columnDragOpts = computeColumnDragOpts.value
|
|
52
54
|
const cellOpts = computeCellOpts.value
|
|
@@ -57,6 +59,7 @@ export default defineComponent({
|
|
|
57
59
|
return cols.map((column, $columnIndex) => {
|
|
58
60
|
const { type, showHeaderOverflow, headerAlign, align, filters, headerClassName, editRender, cellRender } = column
|
|
59
61
|
const colid = column.id
|
|
62
|
+
const colRest = fullColumnIdData[colid] || {}
|
|
60
63
|
const renderOpts = editRender || cellRender
|
|
61
64
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null
|
|
62
65
|
const isColGroup = column.children && column.children.length
|
|
@@ -74,11 +77,11 @@ export default defineComponent({
|
|
|
74
77
|
firstFilterOption = filters[0]
|
|
75
78
|
hasFilter = filters.some((item) => item.checked)
|
|
76
79
|
}
|
|
77
|
-
const columnIndex =
|
|
78
|
-
const _columnIndex =
|
|
80
|
+
const columnIndex = colRest.index
|
|
81
|
+
const _columnIndex = colRest._index
|
|
79
82
|
const cellParams: VxeTableDefines.CellRenderHeaderParams & {
|
|
80
83
|
$table: VxeTableConstructor & VxeTablePrivateMethods
|
|
81
|
-
} = { $table: $xeTable, $grid: $
|
|
84
|
+
} = { $table: $xeTable, $grid: $xeGrid, $rowIndex, column, columnIndex, $columnIndex, _columnIndex, firstFilterOption, fixed: fixedType, type: renderType, isHidden: fixedHiddenColumn, hasFilter }
|
|
82
85
|
const thAttrs: Record<string, string | number | null> = {
|
|
83
86
|
colid,
|
|
84
87
|
colspan: column.colSpan > 1 ? column.colSpan : null,
|
|
@@ -223,7 +226,7 @@ export default defineComponent({
|
|
|
223
226
|
const renderVN = () => {
|
|
224
227
|
const { fixedType, fixedColumn, tableColumn } = props
|
|
225
228
|
const { mouseConfig, showHeaderOverflow: allColumnHeaderOverflow, spanMethod, footerSpanMethod } = tableProps
|
|
226
|
-
const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
229
|
+
const { isGroup, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
227
230
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
228
231
|
|
|
229
232
|
const mouseOpts = computeMouseOpts.value
|
|
@@ -243,7 +246,7 @@ export default defineComponent({
|
|
|
243
246
|
}
|
|
244
247
|
}
|
|
245
248
|
|
|
246
|
-
if (fixedType || !overflowX) {
|
|
249
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
247
250
|
renderColumnList = visibleColumn
|
|
248
251
|
}
|
|
249
252
|
|
|
@@ -317,7 +320,10 @@ export default defineComponent({
|
|
|
317
320
|
}, renderColumnList.map((column, $columnIndex) => {
|
|
318
321
|
return h('col', {
|
|
319
322
|
name: column.id,
|
|
320
|
-
key: $columnIndex
|
|
323
|
+
key: $columnIndex,
|
|
324
|
+
style: {
|
|
325
|
+
width: `${column.renderWidth}px`
|
|
326
|
+
}
|
|
321
327
|
})
|
|
322
328
|
})),
|
|
323
329
|
/**
|
|
@@ -188,6 +188,8 @@ export default {
|
|
|
188
188
|
resizeConfig: Object as PropType<VxeTablePropTypes.ResizeConfig>,
|
|
189
189
|
// 列配置信息
|
|
190
190
|
columnConfig: Object as PropType<VxeTablePropTypes.ColumnConfig>,
|
|
191
|
+
// 当前列配置信息
|
|
192
|
+
currentColumnConfig: Object as PropType<VxeTablePropTypes.CurrentColumnConfig>,
|
|
191
193
|
// 单元格配置信息
|
|
192
194
|
cellConfig: Object as PropType<VxeTablePropTypes.CellConfig>,
|
|
193
195
|
// 表头单元格配置信息
|
|
@@ -196,6 +198,8 @@ export default {
|
|
|
196
198
|
footerCellConfig: Object as PropType<VxeTablePropTypes.FooterCellConfig>,
|
|
197
199
|
// 行配置信息
|
|
198
200
|
rowConfig: Object as PropType<VxeTablePropTypes.RowConfig>,
|
|
201
|
+
// 当前行配置信息
|
|
202
|
+
currentRowConfig: Object as PropType<VxeTablePropTypes.CurrentRowConfig>,
|
|
199
203
|
// 已废弃,被 rowDragConfig 替换
|
|
200
204
|
dragConfig: Object as PropType<VxeTablePropTypes.DragConfig>,
|
|
201
205
|
// 行拖拽排序配置项
|