vxe-table 3.14.0-beta.2 → 3.14.0-beta.21
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 +78 -48
- 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/edit/mixin.js +14 -9
- package/es/table/module/filter/panel.js +12 -2
- package/es/table/module/keyboard/mixin.js +86 -21
- package/es/table/module/validator/mixin.js +2 -2
- package/es/table/render/index.js +90 -59
- package/es/table/src/body.js +22 -17
- package/es/table/src/cell.js +25 -20
- package/es/table/src/footer.js +9 -4
- package/es/table/src/header.js +2 -2
- package/es/table/src/methods.js +942 -678
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +74 -32
- package/es/table/src/util.js +65 -7
- package/es/ui/index.js +1 -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 +85 -65
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +1641 -1076
- 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/edit/mixin.js +16 -11
- package/lib/table/module/edit/mixin.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/mixin.js +89 -25
- package/lib/table/module/keyboard/mixin.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 +99 -64
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +27 -17
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +37 -21
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +9 -3
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +2 -1
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +1101 -798
- 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 +79 -31
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +72 -7
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +1 -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 +92 -57
- 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/edit/mixin.ts +17 -12
- package/packages/table/module/filter/panel.ts +12 -2
- package/packages/table/module/keyboard/mixin.ts +94 -27
- package/packages/table/module/validator/mixin.ts +2 -2
- package/packages/table/render/index.ts +89 -57
- package/packages/table/src/body.ts +21 -16
- package/packages/table/src/cell.ts +25 -20
- package/packages/table/src/footer.ts +9 -4
- package/packages/table/src/header.ts +2 -2
- package/packages/table/src/methods.ts +1035 -720
- package/packages/table/src/props.ts +16 -12
- package/packages/table/src/table.ts +87 -35
- package/packages/table/src/util.ts +73 -7
- /package/es/{iconfont.1741079977180.ttf → iconfont.1742437924038.ttf} +0 -0
- /package/es/{iconfont.1741079977180.woff → iconfont.1742437924038.woff} +0 -0
- /package/es/{iconfont.1741079977180.woff2 → iconfont.1742437924038.woff2} +0 -0
- /package/lib/{iconfont.1741079977180.ttf → iconfont.1742437924038.ttf} +0 -0
- /package/lib/{iconfont.1741079977180.woff → iconfont.1742437924038.woff} +0 -0
- /package/lib/{iconfont.1741079977180.woff2 → iconfont.1742437924038.woff2} +0 -0
|
@@ -161,8 +161,8 @@ export default {
|
|
|
161
161
|
|
|
162
162
|
const validRest: any = {}
|
|
163
163
|
const { editRules, treeConfig } = props
|
|
164
|
-
const { editStore
|
|
165
|
-
const { afterFullData } = internalData
|
|
164
|
+
const { editStore } = reactData
|
|
165
|
+
const { afterFullData, pendingRowMaps } = internalData
|
|
166
166
|
const { removeMaps } = editStore
|
|
167
167
|
const treeOpts = $xeTable.computeTreeOpts
|
|
168
168
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
@@ -8,7 +8,7 @@ import { errLog } from '../../ui/src/log'
|
|
|
8
8
|
|
|
9
9
|
import type { VxeGlobalRendererHandles, VxeColumnPropTypes, VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
|
|
10
10
|
|
|
11
|
-
const { getConfig, renderer, getI18n } = VxeUI
|
|
11
|
+
const { getConfig, renderer, getI18n, getComponent } = VxeUI
|
|
12
12
|
|
|
13
13
|
const componentDefaultModelProp = 'value'
|
|
14
14
|
|
|
@@ -48,7 +48,7 @@ function getOldComponent ({ name }: any) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function getDefaultComponent ({ name }: any) {
|
|
51
|
-
return name
|
|
51
|
+
return getComponent(name) || name
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
function handleConfirmFilter (params: any, checked: any, option: any) {
|
|
@@ -620,6 +620,62 @@ function handleExportTreeSelectMethod (params: any) {
|
|
|
620
620
|
return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params)
|
|
621
621
|
}
|
|
622
622
|
|
|
623
|
+
function handleNumberCell (h: CreateElement, renderOpts: VxeGlobalRendererHandles.RenderTableDefaultOptions, params: VxeGlobalRendererHandles.RenderTableDefaultParams) {
|
|
624
|
+
const { props = {}, showNegativeStatus } = renderOpts
|
|
625
|
+
const { row, column } = params
|
|
626
|
+
const { type } = props
|
|
627
|
+
let cellValue = XEUtils.get(row, column.field)
|
|
628
|
+
let isNegative = false
|
|
629
|
+
if (!isEmptyValue(cellValue)) {
|
|
630
|
+
const numberInputConfig = getConfig().numberInput || {}
|
|
631
|
+
if (type === 'float') {
|
|
632
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
|
|
633
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1)
|
|
634
|
+
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
|
|
635
|
+
if (!autoFill) {
|
|
636
|
+
cellValue = XEUtils.toNumber(cellValue)
|
|
637
|
+
}
|
|
638
|
+
if (showNegativeStatus) {
|
|
639
|
+
if (cellValue < 0) {
|
|
640
|
+
isNegative = true
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
} else if (type === 'amount') {
|
|
644
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
|
|
645
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2)
|
|
646
|
+
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false)
|
|
647
|
+
cellValue = XEUtils.toNumber(cellValue)
|
|
648
|
+
if (showNegativeStatus) {
|
|
649
|
+
if (cellValue < 0) {
|
|
650
|
+
isNegative = true
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
cellValue = XEUtils.commafy(cellValue, { digits })
|
|
654
|
+
if (!autoFill) {
|
|
655
|
+
const [iStr, dStr] = cellValue.split('.')
|
|
656
|
+
if (dStr) {
|
|
657
|
+
const dRest = dStr.replace(/0+$/, '')
|
|
658
|
+
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
if (showCurrency) {
|
|
662
|
+
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`
|
|
663
|
+
}
|
|
664
|
+
} else {
|
|
665
|
+
if (showNegativeStatus) {
|
|
666
|
+
if (XEUtils.toNumber(cellValue) < 0) {
|
|
667
|
+
isNegative = true
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative
|
|
673
|
+
? {
|
|
674
|
+
class: 'is--negative'
|
|
675
|
+
}
|
|
676
|
+
: {})
|
|
677
|
+
}
|
|
678
|
+
|
|
623
679
|
/**
|
|
624
680
|
* 表格 - 渲染器
|
|
625
681
|
*/
|
|
@@ -685,64 +741,19 @@ renderer.mixin({
|
|
|
685
741
|
renderTableFilter: defaultFilterRender,
|
|
686
742
|
tableFilterDefaultMethod: handleInputFilterMethod
|
|
687
743
|
},
|
|
744
|
+
FormatNumberInput: {
|
|
745
|
+
renderTableDefault: handleNumberCell,
|
|
746
|
+
tableFilterDefaultMethod: handleInputFilterMethod,
|
|
747
|
+
tableExportMethod (params) {
|
|
748
|
+
const { row, column } = params
|
|
749
|
+
const cellValue = XEUtils.get(row, column.field)
|
|
750
|
+
return cellValue
|
|
751
|
+
}
|
|
752
|
+
},
|
|
688
753
|
VxeNumberInput: {
|
|
689
754
|
tableAutoFocus: 'input',
|
|
690
755
|
renderTableEdit: defaultEditRender,
|
|
691
|
-
renderTableCell
|
|
692
|
-
const { props = {}, showNegativeStatus } = renderOpts
|
|
693
|
-
const { row, column } = params
|
|
694
|
-
const { type } = props
|
|
695
|
-
let cellValue = XEUtils.get(row, column.field)
|
|
696
|
-
let isNegative = false
|
|
697
|
-
if (!isEmptyValue(cellValue)) {
|
|
698
|
-
const numberInputConfig = getConfig().numberInput || {}
|
|
699
|
-
if (type === 'float') {
|
|
700
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
|
|
701
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1)
|
|
702
|
-
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
|
|
703
|
-
if (!autoFill) {
|
|
704
|
-
cellValue = XEUtils.toNumber(cellValue)
|
|
705
|
-
}
|
|
706
|
-
if (showNegativeStatus) {
|
|
707
|
-
if (cellValue < 0) {
|
|
708
|
-
isNegative = true
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
} else if (type === 'amount') {
|
|
712
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
|
|
713
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2)
|
|
714
|
-
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false)
|
|
715
|
-
cellValue = XEUtils.toNumber(cellValue)
|
|
716
|
-
if (showNegativeStatus) {
|
|
717
|
-
if (cellValue < 0) {
|
|
718
|
-
isNegative = true
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
cellValue = XEUtils.commafy(cellValue, { digits })
|
|
722
|
-
if (!autoFill) {
|
|
723
|
-
const [iStr, dStr] = cellValue.split('.')
|
|
724
|
-
if (dStr) {
|
|
725
|
-
const dRest = dStr.replace(/0+$/, '')
|
|
726
|
-
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
if (showCurrency) {
|
|
730
|
-
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`
|
|
731
|
-
}
|
|
732
|
-
} else {
|
|
733
|
-
if (showNegativeStatus) {
|
|
734
|
-
if (XEUtils.toNumber(cellValue) < 0) {
|
|
735
|
-
isNegative = true
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative
|
|
741
|
-
? {
|
|
742
|
-
class: 'is--negative'
|
|
743
|
-
}
|
|
744
|
-
: {})
|
|
745
|
-
},
|
|
756
|
+
renderTableCell: handleNumberCell,
|
|
746
757
|
renderTableFooter (h, renderOpts, params) {
|
|
747
758
|
const { props = {} } = renderOpts
|
|
748
759
|
const { row, column, _columnIndex } = params
|
|
@@ -849,11 +860,22 @@ renderer.mixin({
|
|
|
849
860
|
tableFilterDefaultMethod: handleFilterMethod,
|
|
850
861
|
tableExportMethod: handleExportSelectMethod
|
|
851
862
|
},
|
|
863
|
+
/**
|
|
864
|
+
* 已废弃,被 FormatSelect 替换
|
|
865
|
+
* @deprecated
|
|
866
|
+
*/
|
|
852
867
|
formatOption: {
|
|
853
868
|
renderTableDefault (h, renderOpts, params) {
|
|
854
869
|
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params))
|
|
855
870
|
}
|
|
856
871
|
},
|
|
872
|
+
FormatSelect: {
|
|
873
|
+
renderTableDefault (h, renderOpts, params) {
|
|
874
|
+
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params))
|
|
875
|
+
},
|
|
876
|
+
tableFilterDefaultMethod: handleFilterMethod,
|
|
877
|
+
tableExportMethod: handleExportSelectMethod
|
|
878
|
+
},
|
|
857
879
|
VxeTreeSelect: {
|
|
858
880
|
tableAutoFocus: 'input',
|
|
859
881
|
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
@@ -870,11 +892,21 @@ renderer.mixin({
|
|
|
870
892
|
},
|
|
871
893
|
tableExportMethod: handleExportTreeSelectMethod
|
|
872
894
|
},
|
|
895
|
+
/**
|
|
896
|
+
* 已废弃,被 FormatTreeSelect 替换
|
|
897
|
+
* @deprecated
|
|
898
|
+
*/
|
|
873
899
|
formatTree: {
|
|
874
900
|
renderTableDefault (h, renderOpts, params) {
|
|
875
901
|
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params))
|
|
876
902
|
}
|
|
877
903
|
},
|
|
904
|
+
FormatTreeSelect: {
|
|
905
|
+
renderTableDefault (h, renderOpts, params) {
|
|
906
|
+
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params))
|
|
907
|
+
},
|
|
908
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
909
|
+
},
|
|
878
910
|
VxeColorPicker: {
|
|
879
911
|
tableAutoFocus: 'input',
|
|
880
912
|
renderTableEdit (h, renderOpts, params: VxeGlobalRendererHandles.RenderTableEditParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
@@ -2,7 +2,7 @@ import { PropType, CreateElement } from 'vue'
|
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { VxeUI } from '../../ui'
|
|
4
4
|
import { isEnableConf, getClass } from '../../ui/src/utils'
|
|
5
|
-
import { getOffsetSize, calcTreeLine, mergeBodyMethod, getRowid } from './util'
|
|
5
|
+
import { getOffsetSize, calcTreeLine, mergeBodyMethod, getRowid, createHandleGetRowId } from './util'
|
|
6
6
|
import { updateCellTitle } from '../../ui/src/dom'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
|
|
@@ -22,7 +22,7 @@ const isVMScrollProcess = ($xeTable: VxeTableConstructor & VxeTablePrivateMethod
|
|
|
22
22
|
return !!(isDragResize || (lastScrollTime && Date.now() < lastScrollTime + (delayHover as number)))
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function renderLine (h: CreateElement, _vm: any, params: VxeTableDefines.CellRenderBodyParams, cellHeight: number) {
|
|
25
|
+
function renderLine (h: CreateElement, _vm: any, rowid: string, params: VxeTableDefines.CellRenderBodyParams, cellHeight: number) {
|
|
26
26
|
const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
27
27
|
const tableProps = $xeTable
|
|
28
28
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
@@ -36,7 +36,6 @@ function renderLine (h: CreateElement, _vm: any, params: VxeTableDefines.CellRen
|
|
|
36
36
|
if (slots && (slots as any).line) {
|
|
37
37
|
return $xeTable.callSlot((slots as any).line, params, h)
|
|
38
38
|
}
|
|
39
|
-
const rowid = getRowid($xeTable, row)
|
|
40
39
|
const rest = fullAllDataRowIdData[rowid]
|
|
41
40
|
let rLevel = 0
|
|
42
41
|
let prevRow = null
|
|
@@ -217,6 +216,7 @@ function renderTdColumn (
|
|
|
217
216
|
tdOns.dblclick = (evnt: MouseEvent) => {
|
|
218
217
|
$xeTable.triggerCellDblclickEvent(evnt, cellParams)
|
|
219
218
|
}
|
|
219
|
+
let isMergeCell = false
|
|
220
220
|
// 合并行或列
|
|
221
221
|
if (mergeList.length) {
|
|
222
222
|
const spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex)
|
|
@@ -226,9 +226,11 @@ function renderTdColumn (
|
|
|
226
226
|
return null
|
|
227
227
|
}
|
|
228
228
|
if (rowspan > 1) {
|
|
229
|
+
isMergeCell = true
|
|
229
230
|
tdAttrs.rowspan = rowspan
|
|
230
231
|
}
|
|
231
232
|
if (colspan > 1) {
|
|
233
|
+
isMergeCell = true
|
|
232
234
|
tdAttrs.colspan = colspan
|
|
233
235
|
}
|
|
234
236
|
}
|
|
@@ -263,11 +265,13 @@ function renderTdColumn (
|
|
|
263
265
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
264
266
|
|
|
265
267
|
let isVNPreEmptyStatus = false
|
|
266
|
-
if (!
|
|
267
|
-
if (
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
268
|
+
if (!isMergeCell) {
|
|
269
|
+
if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
|
|
270
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
271
|
+
isVNPreEmptyStatus = true
|
|
272
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
273
|
+
isVNPreEmptyStatus = true
|
|
274
|
+
}
|
|
271
275
|
}
|
|
272
276
|
}
|
|
273
277
|
|
|
@@ -294,7 +298,7 @@ function renderTdColumn (
|
|
|
294
298
|
} else {
|
|
295
299
|
// 渲染单元格
|
|
296
300
|
tdVNs.push(
|
|
297
|
-
...renderLine(h, _vm, cellParams, cellHeight),
|
|
301
|
+
...renderLine(h, _vm, rowid, cellParams, cellHeight),
|
|
298
302
|
h('div', {
|
|
299
303
|
key: 'tc',
|
|
300
304
|
class: ['vxe-cell', {
|
|
@@ -431,8 +435,8 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
431
435
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
432
436
|
|
|
433
437
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
|
|
434
|
-
const { hasFixedColumn,
|
|
435
|
-
const { fullAllDataRowIdData } = tableInternalData
|
|
438
|
+
const { hasFixedColumn, treeExpandedFlag, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, isDragColMove, rowExpandHeightFlag } = tableReactData
|
|
439
|
+
const { fullAllDataRowIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData
|
|
436
440
|
const checkboxOpts = $xeTable.computeCheckboxOpts
|
|
437
441
|
const radioOpts = $xeTable.computeRadioOpts
|
|
438
442
|
const treeOpts = $xeTable.computeTreeOpts
|
|
@@ -443,6 +447,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
443
447
|
const { transform, seqMode } = treeOpts
|
|
444
448
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
445
449
|
const rows: any[] = []
|
|
450
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
446
451
|
tableData.forEach((row, $rowIndex) => {
|
|
447
452
|
const trOn: Record<string, any> = {}
|
|
448
453
|
let rowIndex = $rowIndex
|
|
@@ -463,7 +468,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
463
468
|
$xeTable.clearHoverRow()
|
|
464
469
|
}
|
|
465
470
|
}
|
|
466
|
-
const rowid =
|
|
471
|
+
const rowid = handleGetRowId(row)
|
|
467
472
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
468
473
|
let rowLevel = 0
|
|
469
474
|
let seq: string | number = -1
|
|
@@ -479,7 +484,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
479
484
|
}
|
|
480
485
|
const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
|
|
481
486
|
// 行是否被展开
|
|
482
|
-
const isExpandRow = expandColumn && !!rowExpandedMaps[rowid]
|
|
487
|
+
const isExpandRow = expandColumn && !!rowExpandedFlag && !!rowExpandedMaps[rowid]
|
|
483
488
|
// 树节点是否被展开
|
|
484
489
|
let isExpandTree = false
|
|
485
490
|
let rowChildren = []
|
|
@@ -490,7 +495,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
490
495
|
}
|
|
491
496
|
if (treeConfig && !scrollYLoad && !transform) {
|
|
492
497
|
rowChildren = row[childrenField]
|
|
493
|
-
isExpandTree = rowChildren && rowChildren.length && !!treeExpandedMaps[rowid]
|
|
498
|
+
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid]
|
|
494
499
|
}
|
|
495
500
|
// 拖拽行事件
|
|
496
501
|
if (rowOpts.drag && (!treeConfig || transform)) {
|
|
@@ -509,7 +514,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
509
514
|
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
510
515
|
'row--radio': radioOpts.highlight && selectRadioRow === row,
|
|
511
516
|
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
512
|
-
'row--pending': !!pendingRowMaps[rowid]
|
|
517
|
+
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid]
|
|
513
518
|
},
|
|
514
519
|
rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
|
|
515
520
|
]
|
|
@@ -690,7 +695,7 @@ export default {
|
|
|
690
695
|
}
|
|
691
696
|
}
|
|
692
697
|
|
|
693
|
-
if (fixedType || !overflowX) {
|
|
698
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
694
699
|
renderColumnList = visibleColumn
|
|
695
700
|
}
|
|
696
701
|
|
|
@@ -402,8 +402,8 @@ export const Cell = {
|
|
|
402
402
|
const { $table, isHidden } = params
|
|
403
403
|
const tableReactData = $table as unknown as TableReactData
|
|
404
404
|
const tableInternalData = $table as unknown as TableInternalData
|
|
405
|
-
const {
|
|
406
|
-
const { fullAllDataRowIdData } = tableInternalData
|
|
405
|
+
const { treeExpandedFlag } = tableReactData
|
|
406
|
+
const { fullAllDataRowIdData, treeExpandedMaps, treeExpandLazyLoadedMaps } = tableInternalData
|
|
407
407
|
const treeOpts = $table.computeTreeOpts
|
|
408
408
|
const { row, column, level } = params
|
|
409
409
|
const { slots } = column
|
|
@@ -423,7 +423,7 @@ export const Cell = {
|
|
|
423
423
|
}
|
|
424
424
|
if (!isHidden) {
|
|
425
425
|
const rowid = getRowid($table, row)
|
|
426
|
-
isActive = !!treeExpandedMaps[rowid]
|
|
426
|
+
isActive = !!treeExpandedFlag && !!treeExpandedMaps[rowid]
|
|
427
427
|
if (lazy) {
|
|
428
428
|
const rest = fullAllDataRowIdData[rowid]
|
|
429
429
|
isLazyLoading = !!treeExpandLazyLoadedMaps[rowid]
|
|
@@ -580,7 +580,8 @@ export const Cell = {
|
|
|
580
580
|
const headerSlot = slots ? slots.header : null
|
|
581
581
|
const titleSlot = slots ? slots.title : null
|
|
582
582
|
const checkboxOpts = $table.computeCheckboxOpts
|
|
583
|
-
const headerTitle =
|
|
583
|
+
const { checkStrictly, showHeader, headerTitle } = checkboxOpts
|
|
584
|
+
const colTitle = column.getTitle()
|
|
584
585
|
const ons: Record<string, any> = {}
|
|
585
586
|
if (!isHidden) {
|
|
586
587
|
ons.click = (evnt: any) => {
|
|
@@ -593,11 +594,11 @@ export const Cell = {
|
|
|
593
594
|
if (headerSlot) {
|
|
594
595
|
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h)))
|
|
595
596
|
}
|
|
596
|
-
if (
|
|
597
|
+
if (checkStrictly ? !showHeader : showHeader === false) {
|
|
597
598
|
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [
|
|
598
599
|
h('span', {
|
|
599
600
|
class: 'vxe-checkbox--label'
|
|
600
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) :
|
|
601
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)
|
|
601
602
|
]))
|
|
602
603
|
}
|
|
603
604
|
return renderHeaderCellBaseVNs(h, params,
|
|
@@ -609,18 +610,18 @@ export const Cell = {
|
|
|
609
610
|
'is--indeterminate': isAllCheckboxIndeterminate
|
|
610
611
|
}],
|
|
611
612
|
attrs: {
|
|
612
|
-
title: getI18n('vxe.table.allTitle')
|
|
613
|
+
title: XEUtils.eqNull(headerTitle) ? getI18n('vxe.table.allTitle') : `${headerTitle || ''}`
|
|
613
614
|
},
|
|
614
615
|
on: ons
|
|
615
616
|
}, [
|
|
616
617
|
h('span', {
|
|
617
618
|
class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
618
619
|
})
|
|
619
|
-
].concat(titleSlot ||
|
|
620
|
+
].concat(titleSlot || colTitle
|
|
620
621
|
? [
|
|
621
622
|
h('span', {
|
|
622
623
|
class: 'vxe-checkbox--label'
|
|
623
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) :
|
|
624
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)
|
|
624
625
|
]
|
|
625
626
|
: []))
|
|
626
627
|
])
|
|
@@ -630,8 +631,10 @@ export const Cell = {
|
|
|
630
631
|
const { $table, row, column, isHidden } = params
|
|
631
632
|
const tableProps = $table
|
|
632
633
|
const tableReactData = $table as unknown as TableReactData
|
|
634
|
+
const tableInternalData = $table as unknown as TableInternalData
|
|
633
635
|
const { treeConfig } = tableProps
|
|
634
|
-
const {
|
|
636
|
+
const { updateCheckboxFlag } = tableReactData
|
|
637
|
+
const { selectCheckboxMaps, treeIndeterminateRowMaps } = tableInternalData
|
|
635
638
|
const checkboxOpts = $table.computeCheckboxOpts
|
|
636
639
|
const { labelField, checkMethod, visibleMethod } = checkboxOpts
|
|
637
640
|
const { slots } = column
|
|
@@ -644,7 +647,7 @@ export const Cell = {
|
|
|
644
647
|
const ons: Record<string, any> = {}
|
|
645
648
|
if (!isHidden) {
|
|
646
649
|
const rowid = getRowid($table, row)
|
|
647
|
-
isChecked = !!selectCheckboxMaps[rowid]
|
|
650
|
+
isChecked = !!updateCheckboxFlag && !!selectCheckboxMaps[rowid]
|
|
648
651
|
ons.click = (evnt: any) => {
|
|
649
652
|
if (!isDisabled && isVisible) {
|
|
650
653
|
$table.triggerCheckRowEvent(evnt, params, !isChecked)
|
|
@@ -654,7 +657,7 @@ export const Cell = {
|
|
|
654
657
|
isDisabled = !checkMethod({ row })
|
|
655
658
|
}
|
|
656
659
|
if (treeConfig) {
|
|
657
|
-
indeterminate = !!
|
|
660
|
+
indeterminate = !!treeIndeterminateRowMaps[rowid]
|
|
658
661
|
}
|
|
659
662
|
}
|
|
660
663
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
|
|
@@ -695,8 +698,10 @@ export const Cell = {
|
|
|
695
698
|
const { $table, row, column, isHidden } = params
|
|
696
699
|
const tableProps = $table
|
|
697
700
|
const tableReactData = $table as unknown as TableReactData
|
|
701
|
+
const tableInternalData = $table as unknown as TableInternalData
|
|
698
702
|
const { treeConfig } = tableProps
|
|
699
|
-
const {
|
|
703
|
+
const { updateCheckboxFlag } = tableReactData
|
|
704
|
+
const { treeIndeterminateRowMaps } = tableInternalData
|
|
700
705
|
const checkboxOpts = $table.computeCheckboxOpts
|
|
701
706
|
const { labelField, checkField, checkMethod, visibleMethod } = checkboxOpts
|
|
702
707
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField
|
|
@@ -710,7 +715,7 @@ export const Cell = {
|
|
|
710
715
|
const ons: Record<string, any> = {}
|
|
711
716
|
if (!isHidden) {
|
|
712
717
|
const rowid = getRowid($table, row)
|
|
713
|
-
isChecked = XEUtils.get(row, checkField)
|
|
718
|
+
isChecked = !!updateCheckboxFlag && XEUtils.get(row, checkField)
|
|
714
719
|
ons.click = (evnt: any) => {
|
|
715
720
|
if (!isDisabled && isVisible) {
|
|
716
721
|
$table.triggerCheckRowEvent(evnt, params, !isChecked)
|
|
@@ -720,7 +725,7 @@ export const Cell = {
|
|
|
720
725
|
isDisabled = !checkMethod({ row })
|
|
721
726
|
}
|
|
722
727
|
if (treeConfig) {
|
|
723
|
-
isIndeterminate = !!
|
|
728
|
+
isIndeterminate = !!treeIndeterminateRowMaps[rowid]
|
|
724
729
|
}
|
|
725
730
|
}
|
|
726
731
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate }
|
|
@@ -763,8 +768,8 @@ export const Cell = {
|
|
|
763
768
|
*/
|
|
764
769
|
renderExpandCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
765
770
|
const { $table, isHidden, row, column } = params
|
|
766
|
-
const
|
|
767
|
-
const { rowExpandedMaps, rowExpandLazyLoadedMaps } =
|
|
771
|
+
const tableInternalData = $table as unknown as TableInternalData
|
|
772
|
+
const { rowExpandedMaps, rowExpandLazyLoadedMaps } = tableInternalData
|
|
768
773
|
const expandOpts = $table.computeExpandOpts
|
|
769
774
|
const { lazy, labelField, iconLoaded, showIcon, iconOpen, iconClose, visibleMethod } = expandOpts
|
|
770
775
|
const { slots } = column
|
|
@@ -871,7 +876,7 @@ export const Cell = {
|
|
|
871
876
|
renderSortIcon (h: CreateElement, params: (VxeTableDefines.CellRenderHeaderParams | VxeTableDefines.CellRenderHeaderParams) & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
872
877
|
const { $table, column } = params
|
|
873
878
|
const sortOpts = $table.computeSortOpts
|
|
874
|
-
const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
|
|
879
|
+
const { showIcon, allowBtn, ascTitle, descTitle, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
|
|
875
880
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
876
881
|
return [
|
|
877
882
|
h('span', {
|
|
@@ -882,7 +887,7 @@ export const Cell = {
|
|
|
882
887
|
'sort--active': column.order === 'asc'
|
|
883
888
|
}],
|
|
884
889
|
attrs: {
|
|
885
|
-
title: getI18n('vxe.table.sortAsc')
|
|
890
|
+
title: XEUtils.eqNull(ascTitle) ? getI18n('vxe.table.sortAsc') : `${ascTitle || ''}`
|
|
886
891
|
},
|
|
887
892
|
on: allowBtn
|
|
888
893
|
? {
|
|
@@ -898,7 +903,7 @@ export const Cell = {
|
|
|
898
903
|
'sort--active': column.order === 'desc'
|
|
899
904
|
}],
|
|
900
905
|
attrs: {
|
|
901
|
-
title: getI18n('vxe.table.sortDesc')
|
|
906
|
+
title: XEUtils.eqNull(descTitle) ? getI18n('vxe.table.sortDesc') : `${descTitle || ''}`
|
|
902
907
|
},
|
|
903
908
|
on: allowBtn
|
|
904
909
|
? {
|
|
@@ -110,6 +110,7 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
110
110
|
tfOns.dblclick = (evnt: MouseEvent) => {
|
|
111
111
|
$xeTable.dispatchEvent('footer-cell-dblclick', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
|
|
112
112
|
}
|
|
113
|
+
let isMergeCell = false
|
|
113
114
|
// 合并行或列
|
|
114
115
|
if (mergeFooterList.length) {
|
|
115
116
|
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex)
|
|
@@ -119,9 +120,11 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
119
120
|
return null
|
|
120
121
|
}
|
|
121
122
|
if (rowspan > 1) {
|
|
123
|
+
isMergeCell = true
|
|
122
124
|
attrs.rowspan = rowspan
|
|
123
125
|
}
|
|
124
126
|
if (colspan > 1) {
|
|
127
|
+
isMergeCell = true
|
|
125
128
|
attrs.colspan = colspan
|
|
126
129
|
}
|
|
127
130
|
}
|
|
@@ -142,8 +145,10 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
142
145
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
143
146
|
|
|
144
147
|
let isVNPreEmptyStatus = false
|
|
145
|
-
if (
|
|
146
|
-
|
|
148
|
+
if (!isMergeCell) {
|
|
149
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
150
|
+
isVNPreEmptyStatus = true
|
|
151
|
+
}
|
|
147
152
|
}
|
|
148
153
|
|
|
149
154
|
const tcStyle: Record<string, string> = {}
|
|
@@ -309,7 +314,7 @@ export default {
|
|
|
309
314
|
const { fixedType, fixedColumn, tableColumn } = props
|
|
310
315
|
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
311
316
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
312
|
-
const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
317
|
+
const { isGroup, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
313
318
|
|
|
314
319
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
315
320
|
let isOptimizeMode = false
|
|
@@ -322,7 +327,7 @@ export default {
|
|
|
322
327
|
}
|
|
323
328
|
}
|
|
324
329
|
|
|
325
|
-
if (fixedType || !overflowX) {
|
|
330
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
326
331
|
renderColumnList = visibleColumn
|
|
327
332
|
}
|
|
328
333
|
|
|
@@ -272,7 +272,7 @@ export default {
|
|
|
272
272
|
const { headerColumn } = this
|
|
273
273
|
|
|
274
274
|
const { mouseConfig, showHeaderOverflow: allColumnHeaderOverflow, spanMethod, footerSpanMethod } = tableProps
|
|
275
|
-
const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
275
|
+
const { isGroup, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
276
276
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
277
277
|
|
|
278
278
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
@@ -292,7 +292,7 @@ export default {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
if (fixedType || !overflowX) {
|
|
295
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
296
296
|
renderColumnList = visibleColumn
|
|
297
297
|
}
|
|
298
298
|
|