vxe-table 3.15.5 → 3.15.6
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +3 -2
- package/es/locale/lang/de-DE.js +3 -2
- package/es/locale/lang/en-US.js +2 -1
- package/es/locale/lang/es-ES.js +3 -2
- package/es/locale/lang/fr-FR.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +2 -1
- package/es/locale/lang/id-ID.js +2 -1
- package/es/locale/lang/it-IT.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +2 -1
- package/es/locale/lang/th-TH.js +2 -1
- package/es/locale/lang/ug-CN.js +2 -1
- package/es/locale/lang/uk-UA.js +2 -1
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +62 -37
- package/es/table/module/custom/panel.js +7 -7
- package/es/table/module/export/mixin.js +13 -12
- package/es/table/module/keyboard/mixin.js +3 -2
- package/es/table/src/body.js +49 -16
- package/es/table/src/cell.js +137 -45
- package/es/table/src/column.js +2 -0
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/methods.js +977 -495
- package/es/table/src/props.js +9 -7
- package/es/table/src/table.js +108 -35
- package/es/table/style.css +70 -40
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +13 -1
- package/es/ui/src/dom.js +3 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +70 -40
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +1729 -858
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +3 -2
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +3 -2
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -1
- package/lib/locale/lang/es-ES.js +3 -2
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +3 -2
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +2 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +2 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +2 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +2 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +2 -1
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +2 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +2 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +2 -1
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +2 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +74 -48
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +6 -2
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +13 -5
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -1
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/body.js +39 -15
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +157 -36
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +1158 -562
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +9 -7
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +104 -34
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +70 -40
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +13 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +4 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +70 -40
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +3 -2
- package/packages/locale/lang/de-DE.ts +3 -2
- package/packages/locale/lang/en-US.ts +2 -1
- package/packages/locale/lang/es-ES.ts +3 -2
- package/packages/locale/lang/fr-FR.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +2 -1
- package/packages/locale/lang/id-ID.ts +2 -1
- package/packages/locale/lang/it-IT.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +2 -1
- package/packages/locale/lang/th-TH.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +2 -1
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/module/custom/mixin.ts +85 -51
- package/packages/table/module/custom/panel.ts +8 -8
- package/packages/table/module/export/mixin.ts +19 -18
- package/packages/table/module/keyboard/mixin.ts +3 -2
- package/packages/table/src/body.ts +50 -17
- package/packages/table/src/cell.ts +136 -45
- package/packages/table/src/column.ts +2 -0
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/methods.ts +1010 -512
- package/packages/table/src/props.ts +9 -7
- package/packages/table/src/table.ts +122 -38
- package/packages/ui/index.ts +12 -0
- package/packages/ui/src/dom.ts +4 -0
- package/styles/components/table.scss +131 -92
- /package/es/{iconfont.1744880837792.ttf → iconfont.1745197894601.ttf} +0 -0
- /package/es/{iconfont.1744880837792.woff → iconfont.1745197894601.woff} +0 -0
- /package/es/{iconfont.1744880837792.woff2 → iconfont.1745197894601.woff2} +0 -0
- /package/lib/{iconfont.1744880837792.ttf → iconfont.1745197894601.ttf} +0 -0
- /package/lib/{iconfont.1744880837792.woff → iconfont.1745197894601.woff} +0 -0
- /package/lib/{iconfont.1744880837792.woff2 → iconfont.1745197894601.woff2} +0 -0
|
@@ -81,7 +81,8 @@ export default {
|
|
|
81
81
|
maxFixedCol: 'Il numero massimo di colonne bloccate non può superare {0}',
|
|
82
82
|
dragTip: 'Sposta: {0}',
|
|
83
83
|
resizeColTip: '宽:{0} 像素',
|
|
84
|
-
resizeRowTip: '高:{0} 像素'
|
|
84
|
+
resizeRowTip: '高:{0} 像素',
|
|
85
|
+
rowGroupContentTotal: '{0}({1})'
|
|
85
86
|
},
|
|
86
87
|
grid: {
|
|
87
88
|
selectOneRecord: 'Seleziona almeno un record!',
|
|
@@ -81,7 +81,8 @@ export default {
|
|
|
81
81
|
maxFixedCol: '최대 고정 열 수는 {0}을(를) 초과할 수 없습니다.',
|
|
82
82
|
dragTip: '이동: {0}',
|
|
83
83
|
resizeColTip: '宽:{0} 像素',
|
|
84
|
-
resizeRowTip: '高:{0} 像素'
|
|
84
|
+
resizeRowTip: '高:{0} 像素',
|
|
85
|
+
rowGroupContentTotal: '{0}({1})'
|
|
85
86
|
},
|
|
86
87
|
grid: {
|
|
87
88
|
selectOneRecord: '최소한 하나의 레코드를 선택해주세요!',
|
|
@@ -81,7 +81,8 @@ export default {
|
|
|
81
81
|
maxFixedCol: 'Maksimalt antall frosne kolonner kan ikke overstige {0}',
|
|
82
82
|
dragTip: 'Flytt: {0}',
|
|
83
83
|
resizeColTip: '宽:{0} 像素',
|
|
84
|
-
resizeRowTip: '高:{0} 像素'
|
|
84
|
+
resizeRowTip: '高:{0} 像素',
|
|
85
|
+
rowGroupContentTotal: '{0}({1})'
|
|
85
86
|
},
|
|
86
87
|
grid: {
|
|
87
88
|
selectOneRecord: '请至少选择一条记录!',
|
|
@@ -81,7 +81,8 @@ export default {
|
|
|
81
81
|
maxFixedCol: 'The maximum number of Freeze columns cannot exceed {0}',
|
|
82
82
|
dragTip: '移动:{0}',
|
|
83
83
|
resizeColTip: '宽:{0} 像素',
|
|
84
|
-
resizeRowTip: '高:{0} 像素'
|
|
84
|
+
resizeRowTip: '高:{0} 像素',
|
|
85
|
+
rowGroupContentTotal: '{0}({1})'
|
|
85
86
|
},
|
|
86
87
|
grid: {
|
|
87
88
|
selectOneRecord: 'Por favor, selecione pelo menos um registro!',
|
|
@@ -81,7 +81,8 @@ export default {
|
|
|
81
81
|
maxFixedCol: 'Максимальное количество замороженных столбцов не может превышать {0}.',
|
|
82
82
|
dragTip: 'Переместить: {0}',
|
|
83
83
|
resizeColTip: '宽:{0} 像素',
|
|
84
|
-
resizeRowTip: '高:{0} 像素'
|
|
84
|
+
resizeRowTip: '高:{0} 像素',
|
|
85
|
+
rowGroupContentTotal: '{0}({1})'
|
|
85
86
|
},
|
|
86
87
|
grid: {
|
|
87
88
|
selectOneRecord: 'Пожалуйста, выберите хотя бы одну запись!',
|
|
@@ -81,7 +81,8 @@ export default {
|
|
|
81
81
|
maxFixedCol: 'จำนวนคอลัมน์ที่ตรึงไว้สูงสุดต้องไม่เกิน {0}',
|
|
82
82
|
dragTip: 'ย้าย: {0}',
|
|
83
83
|
resizeColTip: '宽:{0} 像素',
|
|
84
|
-
resizeRowTip: '高:{0} 像素'
|
|
84
|
+
resizeRowTip: '高:{0} 像素',
|
|
85
|
+
rowGroupContentTotal: '{0}({1})'
|
|
85
86
|
},
|
|
86
87
|
grid: {
|
|
87
88
|
selectOneRecord: 'โปรดเลือกอย่างน้อยหนึ่งรายการ!',
|
|
@@ -81,7 +81,8 @@ export default {
|
|
|
81
81
|
maxFixedCol: 'توڭلىتىشقا بولىدىغان ئەڭ چوڭ قۇر سانى {0} دانە',
|
|
82
82
|
dragTip: 'يۆتكەش:{0}',
|
|
83
83
|
resizeColTip: '宽:{0} 像素',
|
|
84
|
-
resizeRowTip: '高:{0} 像素'
|
|
84
|
+
resizeRowTip: '高:{0} 像素',
|
|
85
|
+
rowGroupContentTotal: '{0}({1})'
|
|
85
86
|
},
|
|
86
87
|
grid: {
|
|
87
88
|
selectOneRecord: 'كەم بولغاندا بىر تال ئۇچۇر تاللاڭ',
|
|
@@ -81,7 +81,8 @@ export default {
|
|
|
81
81
|
maxFixedCol: 'Максимальна кількість зафіксованих стовпців не повинна перевищувати {0}',
|
|
82
82
|
dragTip: 'Переміщення: {0}',
|
|
83
83
|
resizeColTip: '宽:{0} 像素',
|
|
84
|
-
resizeRowTip: '高:{0} 像素'
|
|
84
|
+
resizeRowTip: '高:{0} 像素',
|
|
85
|
+
rowGroupContentTotal: '{0}({1})'
|
|
85
86
|
},
|
|
86
87
|
grid: {
|
|
87
88
|
selectOneRecord: 'Будь ласка, виберіть хоча б один запис!',
|
|
@@ -1,34 +1,58 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
|
|
3
|
-
import type { VxeColumnPropTypes, VxeTableConstructor, VxeTablePrivateMethods, VxeGridConstructor, GridPrivateMethods } from '../../../../types'
|
|
3
|
+
import type { VxeColumnPropTypes, VxeTableConstructor, VxeTablePrivateMethods, VxeGridConstructor, VxeTableDefines, GridPrivateMethods, TableReactData, TableInternalData } from '../../../../types'
|
|
4
|
+
|
|
5
|
+
function calcMaxHeight ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
6
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
7
|
+
|
|
8
|
+
const { customStore } = reactData
|
|
9
|
+
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
10
|
+
// 判断面板不能大于表格高度
|
|
11
|
+
let tableHeight = 0
|
|
12
|
+
if (el) {
|
|
13
|
+
tableHeight = el.clientHeight - 28
|
|
14
|
+
}
|
|
15
|
+
customStore.maxHeight = Math.max(88, tableHeight)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function emitCustomEvent ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, type: VxeTableDefines.CustomType, evnt: Event) {
|
|
19
|
+
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor & GridPrivateMethods
|
|
20
|
+
|
|
21
|
+
const comp = $xeGrid || $xeTable
|
|
22
|
+
comp.dispatchEvent('custom', { type }, evnt)
|
|
23
|
+
}
|
|
4
24
|
|
|
5
25
|
export default {
|
|
6
26
|
methods: {
|
|
7
27
|
_openCustom () {
|
|
8
|
-
const $xeTable = this
|
|
9
|
-
const reactData = $xeTable
|
|
28
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
29
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
10
30
|
|
|
11
31
|
const { initStore, customStore } = reactData
|
|
12
32
|
customStore.visible = true
|
|
13
33
|
initStore.custom = true
|
|
14
34
|
$xeTable.handleUpdateCustomColumn()
|
|
15
35
|
$xeTable.checkCustomStatus()
|
|
16
|
-
$xeTable
|
|
17
|
-
return
|
|
36
|
+
calcMaxHeight($xeTable)
|
|
37
|
+
return $xeTable.$nextTick().then(() => calcMaxHeight($xeTable))
|
|
18
38
|
},
|
|
19
39
|
_closeCustom () {
|
|
20
|
-
const
|
|
40
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
41
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
42
|
+
|
|
43
|
+
const { customStore } = reactData
|
|
44
|
+
const customOpts = $xeTable.computeCustomOpts
|
|
21
45
|
if (customStore.visible) {
|
|
22
46
|
customStore.visible = false
|
|
23
47
|
if (!customOpts.immediate) {
|
|
24
|
-
|
|
48
|
+
$xeTable.handleCustom()
|
|
25
49
|
}
|
|
26
50
|
}
|
|
27
|
-
return
|
|
51
|
+
return $xeTable.$nextTick()
|
|
28
52
|
},
|
|
29
53
|
_saveCustom () {
|
|
30
|
-
const $xeTable = this
|
|
31
|
-
const reactData = $xeTable
|
|
54
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
55
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
32
56
|
|
|
33
57
|
const { customOpts, customColumnList } = this
|
|
34
58
|
const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts
|
|
@@ -65,10 +89,12 @@ export default {
|
|
|
65
89
|
return $xeTable.saveCustomStore('confirm')
|
|
66
90
|
},
|
|
67
91
|
_cancelCustom () {
|
|
68
|
-
const $xeTable = this
|
|
92
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
93
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
69
94
|
|
|
70
|
-
const {
|
|
95
|
+
const { customColumnList, customStore } = reactData
|
|
71
96
|
const { oldSortMaps, oldFixedMaps, oldVisibleMaps } = customStore
|
|
97
|
+
const customOpts = $xeTable.computeCustomOpts
|
|
72
98
|
const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts
|
|
73
99
|
XEUtils.eachTree(customColumnList, column => {
|
|
74
100
|
const colid = column.getKey()
|
|
@@ -92,11 +118,12 @@ export default {
|
|
|
92
118
|
return $xeTable.$nextTick()
|
|
93
119
|
},
|
|
94
120
|
_resetCustom (options: any) {
|
|
95
|
-
const $xeTable = this
|
|
96
|
-
const reactData = $xeTable
|
|
97
|
-
const internalData = $xeTable
|
|
121
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
122
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
123
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
98
124
|
|
|
99
|
-
const { collectColumn
|
|
125
|
+
const { collectColumn } = internalData
|
|
126
|
+
const customOpts = $xeTable.computeCustomOpts
|
|
100
127
|
const { checkMethod } = customOpts
|
|
101
128
|
const opts = Object.assign({
|
|
102
129
|
visible: true,
|
|
@@ -114,7 +141,7 @@ export default {
|
|
|
114
141
|
if (opts.sort) {
|
|
115
142
|
column.renderSortNumber = column.sortNumber
|
|
116
143
|
}
|
|
117
|
-
if (!checkMethod || checkMethod({ column })) {
|
|
144
|
+
if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
|
|
118
145
|
column.visible = column.defaultVisible
|
|
119
146
|
}
|
|
120
147
|
column.renderResizeWidth = column.renderWidth
|
|
@@ -129,19 +156,20 @@ export default {
|
|
|
129
156
|
return this.setCustomAllCheckbox(isAll)
|
|
130
157
|
},
|
|
131
158
|
_setCustomAllCheckbox (checked: boolean) {
|
|
132
|
-
const $xeTable = this
|
|
133
|
-
const reactData = $xeTable
|
|
159
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
160
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
134
161
|
|
|
135
|
-
const { customStore } =
|
|
136
|
-
const { customColumnList
|
|
162
|
+
const { customStore } = reactData
|
|
163
|
+
const { customColumnList } = reactData
|
|
164
|
+
const customOpts = $xeTable.computeCustomOpts
|
|
137
165
|
const { checkMethod, visibleMethod } = customOpts
|
|
138
166
|
const isAll = !!checked
|
|
139
167
|
if (customOpts.immediate) {
|
|
140
168
|
XEUtils.eachTree(customColumnList, (column) => {
|
|
141
|
-
if (visibleMethod && !visibleMethod({ column })) {
|
|
169
|
+
if (visibleMethod && !visibleMethod({ $table: $xeTable, column })) {
|
|
142
170
|
return
|
|
143
171
|
}
|
|
144
|
-
if (checkMethod && !checkMethod({ column })) {
|
|
172
|
+
if (checkMethod && !checkMethod({ $table: $xeTable, column })) {
|
|
145
173
|
return
|
|
146
174
|
}
|
|
147
175
|
column.visible = isAll
|
|
@@ -154,10 +182,10 @@ export default {
|
|
|
154
182
|
$xeTable.saveCustomStore('update:visible')
|
|
155
183
|
} else {
|
|
156
184
|
XEUtils.eachTree(customColumnList, (column) => {
|
|
157
|
-
if (visibleMethod && !visibleMethod({ column })) {
|
|
185
|
+
if (visibleMethod && !visibleMethod({ $table: $xeTable, column })) {
|
|
158
186
|
return
|
|
159
187
|
}
|
|
160
|
-
if (checkMethod && !checkMethod({ column })) {
|
|
188
|
+
if (checkMethod && !checkMethod({ $table: $xeTable, column })) {
|
|
161
189
|
return
|
|
162
190
|
}
|
|
163
191
|
column.renderVisible = isAll
|
|
@@ -167,60 +195,66 @@ export default {
|
|
|
167
195
|
}
|
|
168
196
|
$xeTable.checkCustomStatus()
|
|
169
197
|
},
|
|
170
|
-
calcMaxHeight () {
|
|
171
|
-
const { $el, customStore } = this
|
|
172
|
-
// 判断面板不能大于表格高度
|
|
173
|
-
let tableHeight = 0
|
|
174
|
-
if ($el) {
|
|
175
|
-
tableHeight = $el.clientHeight - 28
|
|
176
|
-
}
|
|
177
|
-
customStore.maxHeight = Math.max(88, tableHeight)
|
|
178
|
-
},
|
|
179
198
|
checkCustomStatus () {
|
|
180
|
-
const
|
|
199
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
200
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
201
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
202
|
+
|
|
203
|
+
const { customStore } = reactData
|
|
204
|
+
const { collectColumn } = internalData
|
|
205
|
+
const customOpts = $xeTable.computeCustomOpts
|
|
181
206
|
const { checkMethod } = customOpts
|
|
182
|
-
customStore.isAll = collectColumn.every((column
|
|
183
|
-
customStore.isIndeterminate = !customStore.isAll && collectColumn.some((column
|
|
207
|
+
customStore.isAll = collectColumn.every((column) => (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false) || column.renderVisible)
|
|
208
|
+
customStore.isIndeterminate = !customStore.isAll && collectColumn.some((column) => (!checkMethod || checkMethod({ $table: $xeTable, column })) && (column.renderVisible || column.halfVisible))
|
|
184
209
|
},
|
|
185
210
|
emitCustomEvent (type: any, evnt: any) {
|
|
186
211
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
187
212
|
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor & GridPrivateMethods
|
|
188
213
|
|
|
189
214
|
const comp = $xeGrid || $xeTable
|
|
190
|
-
comp
|
|
215
|
+
comp.dispatchEvent('custom', { type }, evnt)
|
|
191
216
|
},
|
|
192
217
|
triggerCustomEvent (evnt: any) {
|
|
193
|
-
const
|
|
218
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
219
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
220
|
+
|
|
221
|
+
const { customStore } = reactData
|
|
194
222
|
if (customStore.visible) {
|
|
195
223
|
this.closeCustom()
|
|
196
|
-
|
|
224
|
+
emitCustomEvent($xeTable, 'close', evnt)
|
|
197
225
|
} else {
|
|
198
226
|
customStore.btnEl = evnt.target
|
|
199
227
|
this.openCustom()
|
|
200
|
-
|
|
228
|
+
emitCustomEvent($xeTable, 'open', evnt)
|
|
201
229
|
}
|
|
202
230
|
},
|
|
203
231
|
customOpenEvent (evnt: any) {
|
|
204
|
-
const
|
|
205
|
-
|
|
232
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
233
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
234
|
+
|
|
235
|
+
const { customStore } = reactData
|
|
236
|
+
if (customStore.visible) {
|
|
206
237
|
customStore.activeBtn = true
|
|
207
238
|
customStore.btnEl = evnt.target
|
|
208
|
-
|
|
209
|
-
|
|
239
|
+
$xeTable.openCustom()
|
|
240
|
+
emitCustomEvent($xeTable, 'open', evnt)
|
|
210
241
|
}
|
|
211
242
|
},
|
|
212
243
|
customCloseEvent (evnt: any) {
|
|
213
|
-
const
|
|
244
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
245
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
246
|
+
|
|
247
|
+
const { customStore } = reactData
|
|
214
248
|
if (customStore.visible) {
|
|
215
249
|
customStore.activeBtn = false
|
|
216
|
-
|
|
217
|
-
|
|
250
|
+
$xeTable.closeCustom()
|
|
251
|
+
emitCustomEvent($xeTable, 'close', evnt)
|
|
218
252
|
}
|
|
219
253
|
},
|
|
220
254
|
handleUpdateCustomColumn () {
|
|
221
|
-
const $xeTable = this
|
|
222
|
-
const reactData = $xeTable
|
|
223
|
-
const internalData = $xeTable
|
|
255
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
256
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
257
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
224
258
|
|
|
225
259
|
const { customStore } = reactData
|
|
226
260
|
const { collectColumn } = internalData
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CreateElement, VNode } from 'vue'
|
|
2
2
|
import { VxeUI } from '../../../ui'
|
|
3
3
|
import { formatText } from '../../../ui/src/utils'
|
|
4
|
-
import { getTpImg, addClass, removeClass } from '../../../ui/src/dom'
|
|
4
|
+
import { getTpImg, addClass, removeClass, hasControlKey } from '../../../ui/src/dom'
|
|
5
5
|
import { errLog } from '../../../ui/src/log'
|
|
6
6
|
import XEUtils from 'xe-utils'
|
|
7
7
|
|
|
@@ -136,13 +136,13 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
|
|
|
136
136
|
isCustomStatus
|
|
137
137
|
}
|
|
138
138
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
139
|
-
const isVisible = visibleMethod ? visibleMethod({ column }) : true
|
|
139
|
+
const isVisible = visibleMethod ? visibleMethod({ $table: $xeTable, column }) : true
|
|
140
140
|
if (isVisible) {
|
|
141
141
|
const isChecked = column.renderVisible
|
|
142
142
|
const isIndeterminate = column.halfVisible
|
|
143
143
|
const isColGroup = column.children && column.children.length
|
|
144
144
|
const colTitle = formatText(column.getTitle(), 1)
|
|
145
|
-
const isDisabled = checkMethod ? !checkMethod({ column }) : false
|
|
145
|
+
const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false
|
|
146
146
|
const isHidden = !isChecked
|
|
147
147
|
colVNs.push(
|
|
148
148
|
h('li', {
|
|
@@ -445,7 +445,7 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
|
|
|
445
445
|
isCustomStatus
|
|
446
446
|
}
|
|
447
447
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
448
|
-
const isVisible = visibleMethod ? visibleMethod({ column }) : true
|
|
448
|
+
const isVisible = visibleMethod ? visibleMethod({ $table: $xeTable, column }) : true
|
|
449
449
|
if (isVisible) {
|
|
450
450
|
// 默认继承调整宽度
|
|
451
451
|
let customMinWidth = 0
|
|
@@ -470,7 +470,7 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
|
|
|
470
470
|
const isIndeterminate = column.halfVisible
|
|
471
471
|
const colTitle = formatText(column.getTitle(), 1)
|
|
472
472
|
const isColGroup = column.children && column.children.length
|
|
473
|
-
const isDisabled = checkMethod ? !checkMethod({ column }) : false
|
|
473
|
+
const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false
|
|
474
474
|
const isHidden = !isChecked
|
|
475
475
|
trVNs.push(
|
|
476
476
|
h('tr', {
|
|
@@ -1273,7 +1273,7 @@ export default {
|
|
|
1273
1273
|
removeClass(trEl, 'active--drag-target')
|
|
1274
1274
|
removeClass(trEl, 'active--drag-origin')
|
|
1275
1275
|
},
|
|
1276
|
-
sortDragoverEvent (evnt:
|
|
1276
|
+
sortDragoverEvent (evnt: DragEvent) {
|
|
1277
1277
|
const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
1278
1278
|
|
|
1279
1279
|
const { dragCol } = this
|
|
@@ -1283,7 +1283,7 @@ export default {
|
|
|
1283
1283
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
1284
1284
|
const { isCrossDrag, isToChildDrag } = columnDragOpts
|
|
1285
1285
|
const optEl = evnt.currentTarget as HTMLElement
|
|
1286
|
-
const
|
|
1286
|
+
const isControlKey = hasControlKey(evnt)
|
|
1287
1287
|
const colid = optEl.getAttribute('colid')
|
|
1288
1288
|
const column = $xeTable.getColumnById(colid)
|
|
1289
1289
|
// 是否移入有效列
|
|
@@ -1300,7 +1300,7 @@ export default {
|
|
|
1300
1300
|
showDropTip(this, evnt, optEl, false, dragPos)
|
|
1301
1301
|
return
|
|
1302
1302
|
}
|
|
1303
|
-
this.prevDragToChild = !!((isCrossDrag && isToChildDrag) &&
|
|
1303
|
+
this.prevDragToChild = !!((isCrossDrag && isToChildDrag) && isControlKey && immediate)
|
|
1304
1304
|
this.prevDragCol = column
|
|
1305
1305
|
this.prevDragPos = dragPos
|
|
1306
1306
|
showDropTip(this, evnt, optEl, true, dragPos)
|
|
@@ -25,11 +25,12 @@ function hasTreeChildren ($xeTable: VxeTableConstructor, row: any) {
|
|
|
25
25
|
return row[childrenField] && row[childrenField].length
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function getSeq ($xeTable: VxeTableConstructor, cellValue: any, row: any, $rowIndex:
|
|
28
|
+
function getSeq ($xeTable: VxeTableConstructor, cellValue: any, row: any, $rowIndex: number, column: VxeTableDefines.ColumnInfo, $columnIndex: number) {
|
|
29
29
|
const seqOpts = $xeTable.computeSeqOpts
|
|
30
|
-
const seqMethod = seqOpts.seqMethod || column.seqMethod
|
|
30
|
+
const seqMethod = seqOpts.seqMethod || (column as any).seqMethod
|
|
31
31
|
if (seqMethod) {
|
|
32
32
|
return seqMethod({
|
|
33
|
+
$table: $xeTable,
|
|
33
34
|
row,
|
|
34
35
|
rowIndex: $xeTable.getRowIndex(row),
|
|
35
36
|
$rowIndex,
|
|
@@ -116,12 +117,12 @@ function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropType
|
|
|
116
117
|
case 'checkbox':
|
|
117
118
|
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row))
|
|
118
119
|
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : ''
|
|
119
|
-
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ row })
|
|
120
|
+
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row })
|
|
120
121
|
break
|
|
121
122
|
case 'radio':
|
|
122
123
|
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row))
|
|
123
124
|
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : ''
|
|
124
|
-
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ row })
|
|
125
|
+
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row })
|
|
125
126
|
break
|
|
126
127
|
default:
|
|
127
128
|
if (opts.original) {
|
|
@@ -174,12 +175,12 @@ function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropType
|
|
|
174
175
|
case 'checkbox':
|
|
175
176
|
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row))
|
|
176
177
|
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : ''
|
|
177
|
-
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ row })
|
|
178
|
+
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row })
|
|
178
179
|
break
|
|
179
180
|
case 'radio':
|
|
180
181
|
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row))
|
|
181
182
|
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : ''
|
|
182
|
-
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ row })
|
|
183
|
+
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row })
|
|
183
184
|
break
|
|
184
185
|
default:
|
|
185
186
|
if (opts.original) {
|
|
@@ -204,11 +205,11 @@ function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropType
|
|
|
204
205
|
})
|
|
205
206
|
}
|
|
206
207
|
|
|
207
|
-
function getExportData ($xeTable:
|
|
208
|
+
function getExportData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: VxeTablePropTypes.ExportHandleOptions) {
|
|
208
209
|
const { columns, dataFilterMethod } = opts
|
|
209
210
|
let datas = opts.data
|
|
210
211
|
if (dataFilterMethod) {
|
|
211
|
-
datas = datas.filter((row
|
|
212
|
+
datas = datas.filter((row, index) => dataFilterMethod({ $table: $xeTable, row, $rowIndex: index }))
|
|
212
213
|
}
|
|
213
214
|
return getBodyLabelData($xeTable, opts, columns, datas)
|
|
214
215
|
}
|
|
@@ -217,16 +218,16 @@ function getBooleanValue (cellValue: any) {
|
|
|
217
218
|
return cellValue === 'TRUE' || cellValue === 'true' || cellValue === true
|
|
218
219
|
}
|
|
219
220
|
|
|
220
|
-
function getHeaderTitle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts:
|
|
221
|
+
function getHeaderTitle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: VxeTablePropTypes.ExportHandleOptions, column: VxeTableDefines.ColumnInfo) {
|
|
221
222
|
const columnOpts = $xeTable.computeColumnOpts
|
|
222
223
|
const headExportMethod = column.headerExportMethod || columnOpts.headerExportMethod
|
|
223
224
|
return headExportMethod ? headExportMethod({ column, options: opts, $table: $xeTable }) : ((opts.isTitle ? column.getTitle() : column.field) || '')
|
|
224
225
|
}
|
|
225
226
|
|
|
226
|
-
function getFooterCellValue ($xeTable: any, opts:
|
|
227
|
+
function getFooterCellValue ($xeTable: any, opts: VxeTablePropTypes.ExportHandleOptions, row: any, column: VxeTableDefines.ColumnInfo) {
|
|
227
228
|
const columnOpts = $xeTable.computeColumnOpts
|
|
228
229
|
const renderOpts = column.editRender || column.cellRender
|
|
229
|
-
let footLabelMethod = column.footerExportMethod
|
|
230
|
+
let footLabelMethod: VxeColumnPropTypes.FooterExportMethod | undefined = column.footerExportMethod
|
|
230
231
|
if (!footLabelMethod && renderOpts && renderOpts.name) {
|
|
231
232
|
const compConf = renderer.get(renderOpts.name)
|
|
232
233
|
if (compConf) {
|
|
@@ -247,9 +248,9 @@ function getFooterCellValue ($xeTable: any, opts: any, row: any, column: any) {
|
|
|
247
248
|
return XEUtils.get(row, column.field)
|
|
248
249
|
}
|
|
249
250
|
|
|
250
|
-
function getFooterData (opts: VxeTablePropTypes.ExportHandleOptions, footerTableData: any[]) {
|
|
251
|
+
function getFooterData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: VxeTablePropTypes.ExportHandleOptions, footerTableData: any[]) {
|
|
251
252
|
const { footerFilterMethod } = opts
|
|
252
|
-
return footerFilterMethod ? footerTableData.filter((items: any, index: any) => footerFilterMethod({ items, $rowIndex: index })) : footerTableData
|
|
253
|
+
return footerFilterMethod ? footerTableData.filter((items: any, index: any) => footerFilterMethod({ $table: $xeTable, items, $rowIndex: index })) : footerTableData
|
|
253
254
|
}
|
|
254
255
|
|
|
255
256
|
function getCsvCellTypeLabel (column: any, cellValue: any) {
|
|
@@ -294,7 +295,7 @@ function toCsv ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: Vx
|
|
|
294
295
|
})
|
|
295
296
|
if (opts.isFooter) {
|
|
296
297
|
const { footerTableData } = reactData
|
|
297
|
-
const footers = getFooterData(opts, footerTableData)
|
|
298
|
+
const footers = getFooterData($xeTable, opts, footerTableData)
|
|
298
299
|
footers.forEach((row) => {
|
|
299
300
|
content += columns.map(column => toTxtCellLabel(getFooterCellValue($xeTable, opts, row, column))).join(',') + enterSymbol
|
|
300
301
|
})
|
|
@@ -314,7 +315,7 @@ function toTxt ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: Vx
|
|
|
314
315
|
})
|
|
315
316
|
if (opts.isFooter) {
|
|
316
317
|
const { footerTableData } = reactData
|
|
317
|
-
const footers = getFooterData(opts, footerTableData)
|
|
318
|
+
const footers = getFooterData($xeTable, opts, footerTableData)
|
|
318
319
|
footers.forEach((row) => {
|
|
319
320
|
content += columns.map(column => toTxtCellLabel(getFooterCellValue($xeTable, opts, row, column))).join('\t') + enterSymbol
|
|
320
321
|
})
|
|
@@ -484,7 +485,7 @@ function toHtml ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: V
|
|
|
484
485
|
}
|
|
485
486
|
if (isFooter) {
|
|
486
487
|
const { footerTableData } = reactData
|
|
487
|
-
const footers = getFooterData(opts, footerTableData)
|
|
488
|
+
const footers = getFooterData($xeTable, opts, footerTableData)
|
|
488
489
|
if (footers.length) {
|
|
489
490
|
tables.push('<tfoot>')
|
|
490
491
|
footers.forEach((row: any) => {
|
|
@@ -539,7 +540,7 @@ function toXML ($xeTable: any, opts: any, columns: any[], datas: any[]) {
|
|
|
539
540
|
})
|
|
540
541
|
if (opts.isFooter) {
|
|
541
542
|
const { footerTableData } = reactData
|
|
542
|
-
const footers = getFooterData(opts, footerTableData)
|
|
543
|
+
const footers = getFooterData($xeTable, opts, footerTableData)
|
|
543
544
|
footers.forEach((row: any) => {
|
|
544
545
|
xml += `<Row>${columns.map(column => `<Cell><Data ss:Type="String">${getFooterCellValue($xeTable, opts, row, column)}</Data></Cell>`).join('')}</Row>`
|
|
545
546
|
})
|
|
@@ -1131,7 +1132,7 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
|
|
|
1131
1132
|
}
|
|
1132
1133
|
column.checked = isChecked
|
|
1133
1134
|
column.halfChecked = false
|
|
1134
|
-
column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ column }) : false)
|
|
1135
|
+
column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false)
|
|
1135
1136
|
})
|
|
1136
1137
|
// 更新条件
|
|
1137
1138
|
Object.assign(exportStore, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import { getRefElem } from '../../src/util'
|
|
3
|
-
import { hasClass, getAbsolutePos, addClass, removeClass } from '../../../ui/src/dom'
|
|
3
|
+
import { hasClass, getAbsolutePos, addClass, removeClass, hasControlKey } from '../../../ui/src/dom'
|
|
4
4
|
|
|
5
5
|
import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines, TableReactData, TableInternalData } from '../../../../types'
|
|
6
6
|
|
|
@@ -437,8 +437,9 @@ export default {
|
|
|
437
437
|
const rangeRows = getCheckboxRangeRows(this, evnt, params, trElem, trRect, offsetClientTop, offsetTop < marginSize ? -rangeHeight : rangeHeight)
|
|
438
438
|
// 至少滑动 10px 才能有效匹配
|
|
439
439
|
if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
|
|
440
|
+
const isControlKey = hasControlKey(evnt)
|
|
440
441
|
lastRangeRows = rangeRows
|
|
441
|
-
if (
|
|
442
|
+
if (isControlKey) {
|
|
442
443
|
rangeRows.forEach((row: any) => {
|
|
443
444
|
$xeTable.handleBatchSelectRows([row], selectRecords.indexOf(row) === -1)
|
|
444
445
|
})
|