vxe-table 4.23.8 → 4.23.9

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.
Files changed (126) hide show
  1. package/dist/all.esm.js +5715 -3783
  2. package/es/components.d.ts +1 -0
  3. package/es/components.js +2 -7
  4. package/es/grid/src/emits.js +1 -15
  5. package/es/grid/src/grid.js +397 -120
  6. package/es/index.esm.js +1 -0
  7. package/es/index.js +1 -0
  8. package/es/table/module/custom/hook.js +49 -42
  9. package/es/table/module/custom/panel.js +777 -527
  10. package/es/table/module/edit/hook.js +140 -62
  11. package/es/table/module/export/export-panel.js +399 -316
  12. package/es/table/module/export/hook.js +395 -337
  13. package/es/table/module/export/import-panel.js +152 -123
  14. package/es/table/module/filter/hook.js +16 -2
  15. package/es/table/module/filter/panel.js +146 -84
  16. package/es/table/module/keyboard/hook.js +8 -4
  17. package/es/table/module/menu/panel.js +197 -126
  18. package/es/table/render/index.js +151 -98
  19. package/es/table/src/body.js +355 -233
  20. package/es/table/src/cell.js +426 -269
  21. package/es/table/src/columnInfo.js +1 -0
  22. package/es/table/src/footer.js +144 -99
  23. package/es/table/src/group.js +7 -3
  24. package/es/table/src/header.js +229 -172
  25. package/es/table/src/table.js +1503 -1030
  26. package/es/table/src/util.js +15 -19
  27. package/es/toolbar/src/toolbar.js +132 -75
  28. package/es/ui/index.js +1 -1
  29. package/es/ui/src/dom.js +9 -6
  30. package/es/ui/src/log.js +1 -1
  31. package/es/ui/src/utils.d.ts +1 -1
  32. package/lib/components.js +2 -7
  33. package/lib/grid/src/emits.js +1 -15
  34. package/lib/grid/src/grid.js +397 -120
  35. package/lib/index.common.js +1 -0
  36. package/lib/index.js +1 -0
  37. package/lib/index.umd.js +5732 -3800
  38. package/lib/index.umd.min.js +3 -3
  39. package/lib/table/module/custom/hook.js +49 -42
  40. package/lib/table/module/custom/panel.js +777 -527
  41. package/lib/table/module/edit/hook.js +140 -62
  42. package/lib/table/module/export/export-panel.js +399 -316
  43. package/lib/table/module/export/hook.js +395 -337
  44. package/lib/table/module/export/import-panel.js +152 -123
  45. package/lib/table/module/filter/hook.js +16 -2
  46. package/lib/table/module/filter/panel.js +146 -84
  47. package/lib/table/module/keyboard/hook.js +8 -4
  48. package/lib/table/module/menu/panel.js +197 -126
  49. package/lib/table/render/index.js +151 -98
  50. package/lib/table/src/body.js +355 -233
  51. package/lib/table/src/cell.js +426 -269
  52. package/lib/table/src/columnInfo.js +1 -0
  53. package/lib/table/src/footer.js +144 -99
  54. package/lib/table/src/group.js +7 -3
  55. package/lib/table/src/header.js +229 -172
  56. package/lib/table/src/table.js +1471 -1029
  57. package/lib/table/src/util.js +15 -19
  58. package/lib/toolbar/src/toolbar.js +132 -75
  59. package/lib/ui/index.js +1 -1
  60. package/lib/ui/src/dom.js +9 -6
  61. package/lib/ui/src/log.js +1 -1
  62. package/package.json +2 -2
  63. package/packages/colgroup/index.ts +22 -22
  64. package/packages/column/index.ts +22 -22
  65. package/packages/components.ts +41 -44
  66. package/packages/grid/index.ts +18 -18
  67. package/packages/grid/src/emits.ts +5 -19
  68. package/packages/grid/src/grid.ts +2229 -1925
  69. package/packages/grid/src/props.ts +22 -23
  70. package/packages/index.ts +11 -11
  71. package/packages/locale/lang/fr-FR.ts +15 -15
  72. package/packages/locale/lang/it-IT.ts +4 -4
  73. package/packages/locale/lang/uk-UA.ts +1 -1
  74. package/packages/locale/lang/uz-UZ.ts +13 -13
  75. package/packages/locale/lang/zh-CN.ts +907 -907
  76. package/packages/table/index.ts +26 -26
  77. package/packages/table/module/custom/hook.ts +510 -503
  78. package/packages/table/module/custom/panel.ts +2002 -1743
  79. package/packages/table/module/edit/hook.ts +1224 -1131
  80. package/packages/table/module/export/export-panel.ts +697 -611
  81. package/packages/table/module/export/hook.ts +2160 -2059
  82. package/packages/table/module/export/import-panel.ts +319 -279
  83. package/packages/table/module/export/util.ts +25 -24
  84. package/packages/table/module/filter/hook.ts +519 -501
  85. package/packages/table/module/filter/panel.ts +368 -304
  86. package/packages/table/module/keyboard/hook.ts +498 -494
  87. package/packages/table/module/menu/hook.ts +330 -330
  88. package/packages/table/module/menu/panel.ts +272 -201
  89. package/packages/table/module/validator/hook.ts +653 -635
  90. package/packages/table/render/index.ts +1819 -1744
  91. package/packages/table/src/body.ts +1078 -955
  92. package/packages/table/src/cell.ts +1524 -1359
  93. package/packages/table/src/column.ts +192 -192
  94. package/packages/table/src/columnInfo.ts +232 -232
  95. package/packages/table/src/emits.ts +134 -134
  96. package/packages/table/src/footer.ts +425 -380
  97. package/packages/table/src/group.ts +67 -63
  98. package/packages/table/src/header.ts +642 -581
  99. package/packages/table/src/props.ts +336 -336
  100. package/packages/table/src/store.ts +14 -14
  101. package/packages/table/src/table.ts +16011 -15454
  102. package/packages/table/src/use/cell-view.ts +41 -44
  103. package/packages/table/src/use/index.ts +1 -1
  104. package/packages/table/src/util.ts +1206 -1216
  105. package/packages/toolbar/index.ts +18 -18
  106. package/packages/toolbar/src/toolbar.ts +768 -706
  107. package/packages/ui/index.ts +519 -520
  108. package/packages/ui/src/anime.ts +51 -52
  109. package/packages/ui/src/comp.ts +3 -3
  110. package/packages/ui/src/dom.ts +466 -463
  111. package/packages/ui/src/log.ts +19 -19
  112. package/packages/ui/src/utils.ts +66 -66
  113. package/packages/ui/src/vn.ts +55 -55
  114. package/packages/v-x-e-table/index.d.ts +3 -3
  115. package/packages/v-x-e-table/index.ts +3 -3
  116. package/types/all.d.ts +76 -76
  117. package/types/index.d.ts +4 -4
  118. /package/dist/{iconfont.1793007753347.ttf → iconfont.1793009263429.ttf} +0 -0
  119. /package/dist/{iconfont.1793007753347.woff → iconfont.1793009263429.woff} +0 -0
  120. /package/dist/{iconfont.1793007753347.woff2 → iconfont.1793009263429.woff2} +0 -0
  121. /package/es/{iconfont.1793007753347.ttf → iconfont.1793009263429.ttf} +0 -0
  122. /package/es/{iconfont.1793007753347.woff → iconfont.1793009263429.woff} +0 -0
  123. /package/es/{iconfont.1793007753347.woff2 → iconfont.1793009263429.woff2} +0 -0
  124. /package/lib/{iconfont.1793007753347.ttf → iconfont.1793009263429.ttf} +0 -0
  125. /package/lib/{iconfont.1793007753347.woff → iconfont.1793009263429.woff} +0 -0
  126. /package/lib/{iconfont.1793007753347.woff2 → iconfont.1793009263429.woff2} +0 -0
@@ -1,503 +1,510 @@
1
- import { nextTick } from 'vue'
2
- import { VxeUI } from '@vxe-ui/core'
3
- import XEUtils from 'xe-utils'
4
- import { getColumnList } from '../../src/util'
5
- import { toCssUnit } from '../../../ui/src/dom'
6
-
7
- import type { TableCustomMethods, TableCustomPrivateMethods, VxeColumnPropTypes, VxeTableDefines, VxeComponentStyleType } from '../../../../types'
8
-
9
- const tableCustomMethodKeys: (keyof TableCustomMethods)[] = ['openCustom', 'closeCustom', 'getCustomVisible', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox']
10
-
11
- const customColumnCssKeys = ['checkbox', 'sort', 'title', 'width', 'fixed', 'align', 'header-align', 'footer-align']
12
-
13
- VxeUI.hooks.add('tableCustomModule', {
14
- setupTable ($xeTable) {
15
- const { reactData, internalData } = $xeTable
16
- const { computeCustomOpts, computeRowGroupFields, computeCustomSimpleMode } = $xeTable.getComputeMaps()
17
- const { refElem } = $xeTable.getRefMaps()
18
-
19
- const $xeGrid = $xeTable.xeGrid
20
- const $xeGantt = $xeTable.xeGantt
21
- const $xeGGWrapper = $xeGrid || $xeGantt
22
-
23
- const updatePopupStyle = () => {
24
- const { customStore } = reactData
25
- const customOpts = computeCustomOpts.value
26
- const { mode, placement, popupOptions } = customOpts
27
- const showSimple = !(mode === 'modal' || mode === 'drawer')
28
- const { transfer, minWidth, maxWidth, maxHeight } = popupOptions || {}
29
- const customSimpleMode = computeCustomSimpleMode.value
30
- const showCustomSimpleOutside = customSimpleMode === 'outside'
31
- const bodyEl = document.documentElement
32
- let wrapperEl = refElem.value
33
- let popupTop = 0
34
- let popupMaxHeight: string | number = 0
35
- const defPupStys: VxeComponentStyleType = {}
36
- const panePupStys: VxeComponentStyleType = {}
37
- if ($xeGantt) {
38
- const { refGanttContainerElem } = $xeGantt.getRefMaps()
39
- const ganttContainerElem = refGanttContainerElem.value
40
- if (ganttContainerElem) {
41
- wrapperEl = ganttContainerElem
42
- }
43
- }
44
- const tableRect = wrapperEl.getBoundingClientRect()
45
- // 多种模式,指定元素插入
46
- if (showSimple && transfer) {
47
- popupTop = tableRect.top + bodyEl.scrollTop
48
- popupMaxHeight = XEUtils.eqNull(maxHeight) ? 360 : maxHeight
49
- } else if (showCustomSimpleOutside) {
50
- if ($xeGGWrapper && wrapperEl) {
51
- popupTop = wrapperEl.offsetTop
52
- }
53
- popupMaxHeight = XEUtils.eqNull(maxHeight) ? 360 : maxHeight
54
- } else {
55
- // 判断面板不能大于表格高度
56
- if (wrapperEl) {
57
- popupMaxHeight = wrapperEl.clientHeight - 22
58
- }
59
- popupMaxHeight = Math.max(88, popupMaxHeight)
60
- }
61
- let popupMxHeight: string | number = 0
62
- if (!(placement === 'left' || placement === 'right')) {
63
- popupMxHeight = XEUtils.eqNull(maxHeight) ? popupMaxHeight : maxHeight
64
- }
65
- if (!placement || !(['left', 'right', 'bottom-left', 'bottom-right'].includes(placement))) {
66
- if (popupTop) {
67
- defPupStys.top = toCssUnit(popupTop)
68
- }
69
- }
70
-
71
- if (showSimple && transfer) {
72
- if (placement === 'bottom-left' || placement === 'bottom-right') {
73
- defPupStys.bottom = toCssUnit(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1)
74
- }
75
- if (placement === 'top-left' || placement === 'bottom-left') {
76
- defPupStys.left = toCssUnit(tableRect.left)
77
- } else if (!placement || placement === 'top-right' || placement === 'bottom-right') {
78
- defPupStys.right = toCssUnit(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1)
79
- }
80
- }
81
-
82
- // 同步表格的css变量到弹窗中
83
- const bodyComputeStyle = getComputedStyle(bodyEl)
84
- const tableComputeStyle = getComputedStyle(wrapperEl)
85
- customColumnCssKeys.forEach(key => {
86
- const currCssKey = `--vxe-ui-vxe-table-custom-column-${key}-${key === 'title' ? 'min-' : ''}width`
87
- const currCssVal = tableComputeStyle.getPropertyValue(currCssKey)
88
- if (currCssVal && currCssVal !== bodyComputeStyle.getPropertyValue(currCssKey)) {
89
- panePupStys[currCssKey] = currCssVal
90
- }
91
- })
92
- if (minWidth) {
93
- defPupStys['--vxe-ui-vxe-table-custom-default-min-width'] = toCssUnit(minWidth)
94
- }
95
- if (maxWidth) {
96
- defPupStys['--vxe-ui-vxe-table-custom-default-max-width'] = toCssUnit(maxWidth)
97
- }
98
- if (popupMxHeight) {
99
- defPupStys.maxHeight = toCssUnit(popupMxHeight)
100
- }
101
- customStore.defPopupStyle = defPupStys
102
- customStore.panePopupStyle = panePupStys
103
- customStore.maxHeight = popupMxHeight
104
- return nextTick()
105
- }
106
-
107
- const openCustom = () => {
108
- const { initStore, customStore } = reactData
109
- const customOpts = computeCustomOpts.value
110
- const { mode, popupOptions } = customOpts
111
- const showSimple = !(mode === 'modal' || mode === 'drawer')
112
- const { transfer } = popupOptions || {}
113
- const customSimpleMode = computeCustomSimpleMode.value
114
- const showCustomSimpleOutside = customSimpleMode === 'outside'
115
- let cpToElem = null
116
- // 多种模式,指定元素插入
117
- if (showSimple && transfer) {
118
- cpToElem = document.body
119
- } else {
120
- if (showCustomSimpleOutside && $xeGGWrapper) {
121
- const { refPopupContainerElem } = $xeGGWrapper.getRefMaps()
122
- const popupContainerElem = refPopupContainerElem.value
123
- if (popupContainerElem) {
124
- cpToElem = popupContainerElem
125
- }
126
- }
127
- }
128
- if (internalData.customPopupToElem !== cpToElem) {
129
- reactData.ctPopupFlag++
130
- }
131
- internalData.customPopupToElem = cpToElem
132
- customStore.visible = true
133
- initStore.custom = true
134
- handleUpdateCustomColumn()
135
- checkCustomStatus()
136
- updatePopupStyle()
137
- return nextTick().then(() => updatePopupStyle())
138
- }
139
-
140
- const handleUpdateCustomColumn = () => {
141
- const { customStore } = reactData
142
- const { collectColumn } = internalData
143
- if (customStore.visible) {
144
- const sortMaps: Record<string, number> = {}
145
- const fixedMaps: Record<string, VxeColumnPropTypes.Fixed> = {}
146
- const visibleMaps: Record<string, boolean> = {}
147
- XEUtils.eachTree(collectColumn, column => {
148
- const colid = column.getKey()
149
- column.renderFixed = column.fixed
150
- column.renderVisible = column.visible
151
- column.renderResizeWidth = column.renderWidth
152
- column.renderAlign = column.align
153
- column.renderHeaderAlign = column.headerAlign
154
- column.renderFooterAlign = column.footerAlign
155
- sortMaps[colid] = column.renderSortNumber
156
- fixedMaps[colid] = column.fixed
157
- visibleMaps[colid] = column.visible
158
- })
159
- customStore.oldSortMaps = sortMaps
160
- customStore.oldFixedMaps = fixedMaps
161
- customStore.oldVisibleMaps = visibleMaps
162
- reactData.customColumnList = collectColumn.slice(0)
163
- }
164
- }
165
-
166
- const closeCustom = () => {
167
- const { customStore } = reactData
168
- const customOpts = computeCustomOpts.value
169
- if (customStore.visible) {
170
- customStore.visible = false
171
- if (!customOpts.immediate) {
172
- $xeTable.handleCustom()
173
- }
174
- }
175
- return nextTick()
176
- }
177
-
178
- const toggleCustom = () => {
179
- const { customStore } = reactData
180
- if (customStore.visible) {
181
- return closeCustom()
182
- }
183
- return openCustom()
184
- }
185
-
186
- const saveCustom = (isDirectly?: boolean) => {
187
- const { customColumnList, aggHandleFields, rowGroupList } = reactData
188
- const customOpts = computeCustomOpts.value
189
- const { allowVisible, allowSort, allowFixed, allowResizable, allowAlign, allowHeaderAlign, allowFooterAlign, allowGroup, allowValues } = customOpts
190
- if (isDirectly) {
191
- XEUtils.eachTree(customColumnList, (column) => {
192
- if (allowResizable) {
193
- if (column.renderVisible && (!column.children || !column.children.length)) {
194
- column.resizeWidth = Math.max(0, XEUtils.toNumber(column.renderWidth))
195
- }
196
- }
197
- })
198
- } else {
199
- XEUtils.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
200
- if (parentColumn) {
201
- // 更新子列信息
202
- column.fixed = parentColumn.fixed
203
- } else {
204
- if (allowSort) {
205
- const sortIndex = index + 1
206
- column.renderSortNumber = sortIndex
207
- }
208
- if (allowFixed) {
209
- column.fixed = column.renderFixed
210
- }
211
- }
212
- if (allowResizable) {
213
- if (column.renderVisible && (!column.children || !column.children.length)) {
214
- if (column.renderResizeWidth !== column.renderWidth) {
215
- column.resizeWidth = column.renderResizeWidth
216
- column.renderWidth = column.renderResizeWidth
217
- }
218
- }
219
- }
220
- if (allowVisible) {
221
- column.visible = column.renderVisible
222
- }
223
- if (allowAlign) {
224
- column.align = column.renderAlign
225
- }
226
- if (allowHeaderAlign) {
227
- column.headerAlign = column.renderHeaderAlign
228
- }
229
- if (allowFooterAlign) {
230
- column.footerAlign = column.renderFooterAlign
231
- }
232
- if (allowGroup && allowValues) {
233
- column.aggFunc = column.renderAggFn
234
- }
235
- })
236
- }
237
- reactData.isCustomStatus = true
238
- if (allowGroup && !!$xeTable.handlePivotTableAggData) {
239
- if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
240
- // 更新数据分组
241
- if (aggHandleFields.length) {
242
- $xeTable.setRowGroups(aggHandleFields)
243
- } else {
244
- $xeTable.clearRowGroups()
245
- }
246
- } else if (allowValues) {
247
- // 更新聚合函数
248
- $xeTable.handleUpdateAggData()
249
- }
250
- }
251
- if (allowSort) {
252
- internalData.collectColumn = customColumnList
253
- }
254
- return $xeTable.saveCustomStore('confirm')
255
- }
256
-
257
- const cancelCustom = () => {
258
- const { customColumnList, customStore } = reactData
259
- const { oldSortMaps, oldFixedMaps, oldVisibleMaps } = customStore
260
- const customOpts = computeCustomOpts.value
261
- const { allowVisible, allowSort, allowFixed, allowAlign, allowHeaderAlign, allowFooterAlign, allowResizable, allowGroup, allowValues } = customOpts
262
- XEUtils.eachTree(customColumnList, column => {
263
- const colid = column.getKey()
264
- const visible = !!oldVisibleMaps[colid]
265
- const fixed = oldFixedMaps[colid] || ''
266
- if (allowVisible) {
267
- column.renderVisible = visible
268
- column.visible = visible
269
- }
270
- if (allowFixed) {
271
- column.renderFixed = fixed
272
- column.fixed = fixed
273
- }
274
- if (allowSort) {
275
- column.renderSortNumber = oldSortMaps[colid] || 0
276
- }
277
- if (allowResizable) {
278
- column.renderResizeWidth = column.renderWidth
279
- }
280
- if (allowAlign) {
281
- column.align = column.renderAlign
282
- }
283
- if (allowHeaderAlign) {
284
- column.headerAlign = column.renderHeaderAlign
285
- }
286
- if (allowFooterAlign) {
287
- column.footerAlign = column.renderFooterAlign
288
- }
289
- if (allowGroup) {
290
- // 无
291
- }
292
- if (allowValues) {
293
- // 无
294
- }
295
- }, { children: 'children' })
296
- return nextTick()
297
- }
298
-
299
- const setCustomAllCheckbox = (checked: boolean) => {
300
- const { customStore } = reactData
301
- const { customColumnList } = reactData
302
- const customOpts = computeCustomOpts.value
303
- const { checkMethod, visibleMethod } = customOpts
304
- const isAll = !!checked
305
- if (customOpts.immediate) {
306
- XEUtils.eachTree(customColumnList, (column) => {
307
- if (visibleMethod && !visibleMethod({ $table: $xeTable, column })) {
308
- return
309
- }
310
- if (checkMethod && !checkMethod({ $table: $xeTable, column })) {
311
- return
312
- }
313
- column.visible = isAll
314
- column.renderVisible = isAll
315
- column.halfVisible = false
316
- })
317
- customStore.isAll = isAll
318
- reactData.isCustomStatus = true
319
- $xeTable.handleCustom()
320
- $xeTable.saveCustomStore('update:visible')
321
- } else {
322
- XEUtils.eachTree(customColumnList, (column) => {
323
- if (visibleMethod && !visibleMethod({ $table: $xeTable, column })) {
324
- return
325
- }
326
- if (checkMethod && !checkMethod({ $table: $xeTable, column })) {
327
- return
328
- }
329
- column.renderVisible = isAll
330
- column.halfVisible = false
331
- })
332
- customStore.isAll = isAll
333
- }
334
- $xeTable.checkCustomStatus()
335
- return nextTick()
336
- }
337
-
338
- const customMethods: TableCustomMethods = {
339
- getCustomVisible () {
340
- const { customStore } = reactData
341
- return customStore.visible
342
- },
343
- openCustom,
344
- closeCustom,
345
- toggleCustom,
346
- saveCustom,
347
- cancelCustom,
348
- resetCustom (options) {
349
- const { rowGroupList } = reactData
350
- const { collectColumn } = internalData
351
- const customOpts = computeCustomOpts.value
352
- const { checkMethod } = customOpts
353
- const opts: VxeTableDefines.VxeTableCustomStorageObj = Object.assign({
354
- visible: true,
355
- resizable: options === true,
356
- fixed: options === true,
357
- sort: options === true,
358
- aggFunc: options === true,
359
- align: options === true,
360
- headerAlign: options === true,
361
- footerAlign: options === true
362
- }, options)
363
- const allCols: VxeTableDefines.ColumnInfo[] = []
364
- XEUtils.eachTree(collectColumn, (column) => {
365
- if (opts.resizable) {
366
- column.resizeWidth = 0
367
- }
368
- if (opts.fixed) {
369
- column.fixed = column.defaultFixed
370
- column.renderFixed = column.defaultFixed
371
- }
372
- if (opts.sort) {
373
- column.renderSortNumber = column.sortNumber
374
- column.parentId = column.defaultParentId
375
- }
376
- if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
377
- column.visible = column.defaultVisible
378
- }
379
- if (opts.align) {
380
- column.align = column.defaultAlign
381
- column.renderAlign = column.defaultAlign
382
- }
383
- if (opts.headerAlign) {
384
- column.headerAlign = column.defaultHeaderAlign
385
- column.renderHeaderAlign = column.defaultHeaderAlign
386
- }
387
- if (opts.footerAlign) {
388
- column.footerAlign = column.defaultFooterAlign
389
- column.renderFooterAlign = column.defaultFooterAlign
390
- }
391
- if (opts.aggFunc) {
392
- column.aggFunc = column.defaultAggFunc
393
- column.renderAggFn = column.defaultAggFunc
394
- }
395
- column.renderResizeWidth = column.renderWidth
396
- allCols.push(column)
397
- })
398
- if (opts.sort) {
399
- const newCollectCols = XEUtils.toArrayTree(XEUtils.orderBy(allCols, 'renderSortNumber'), { key: 'id', parentKey: 'parentId', children: 'children' })
400
- internalData.collectColumn = newCollectCols
401
- internalData.tableFullColumn = getColumnList(newCollectCols)
402
- }
403
- reactData.isCustomStatus = false
404
- return $xeTable.handleCustom().then(() => {
405
- if (opts.aggFunc && !!$xeTable.handlePivotTableAggData) {
406
- const rowGroupFields = computeRowGroupFields.value
407
- if (rowGroupFields ? rowGroupFields.length : rowGroupList.length) {
408
- if (rowGroupFields && rowGroupFields.length) {
409
- $xeTable.setRowGroups(rowGroupFields)
410
- } else {
411
- $xeTable.clearRowGroups()
412
- }
413
- } else {
414
- $xeTable.handleUpdateAggData()
415
- }
416
- }
417
- $xeTable.saveCustomStore('reset')
418
- })
419
- },
420
- toggleCustomAllCheckbox () {
421
- const { customStore } = reactData
422
- const isAll = !customStore.isAll
423
- return setCustomAllCheckbox(isAll)
424
- },
425
- setCustomAllCheckbox
426
- }
427
-
428
- const checkCustomStatus = () => {
429
- const { customStore } = reactData
430
- const { collectColumn } = internalData
431
- const customOpts = computeCustomOpts.value
432
- const { checkMethod } = customOpts
433
- customStore.isAll = collectColumn.every((column) => (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false) || column.renderVisible)
434
- customStore.isIndeterminate = !customStore.isAll && collectColumn.some((column) => (!checkMethod || checkMethod({ $table: $xeTable, column })) && (column.renderVisible || column.halfVisible))
435
- }
436
-
437
- const emitCustomEvent = (type: VxeTableDefines.CustomType, evnt: Event) => {
438
- $xeTable.dispatchEvent('custom', { type }, evnt)
439
- }
440
-
441
- const customPrivateMethods: TableCustomPrivateMethods = {
442
- checkCustomStatus,
443
- emitCustomEvent,
444
- triggerCustomEvent (evnt) {
445
- const reactData = $xeTable.reactData
446
-
447
- const { customStore } = reactData
448
- if (customStore.visible) {
449
- closeCustom()
450
- emitCustomEvent('close', evnt)
451
- $xeTable.dispatchEvent('custom-close', {}, evnt)
452
- } else {
453
- customStore.btnEl = evnt.target as HTMLDivElement
454
- openCustom()
455
- emitCustomEvent('open', evnt)
456
- $xeTable.dispatchEvent('custom-open', {}, evnt)
457
- }
458
- },
459
- customOpenEvent (evnt) {
460
- const reactData = $xeTable.reactData
461
-
462
- const { customStore } = reactData
463
- if (!customStore.visible) {
464
- customStore.activeBtn = true
465
- customStore.btnEl = evnt.target as HTMLDivElement
466
- $xeTable.openCustom()
467
- $xeTable.emitCustomEvent('open', evnt)
468
- $xeTable.dispatchEvent('custom-open', {}, evnt)
469
- }
470
- },
471
- customCloseEvent (evnt) {
472
- const reactData = $xeTable.reactData
473
-
474
- const { customStore } = reactData
475
- if (customStore.visible) {
476
- customStore.activeBtn = false
477
- $xeTable.closeCustom()
478
- $xeTable.emitCustomEvent('close', evnt)
479
- $xeTable.dispatchEvent('custom-close', {}, evnt)
480
- }
481
- },
482
- handleUpdateCustomColumn,
483
- handleCustomStyle () {
484
- const reactData = $xeTable.reactData
485
-
486
- const { customStore } = reactData
487
- if (!customStore.visible) {
488
- return nextTick()
489
- }
490
- reactData.isCustomDragStatus = false
491
- return updatePopupStyle()
492
- }
493
- }
494
-
495
- return { ...customMethods, ...customPrivateMethods }
496
- },
497
- setupGrid ($xeGrid) {
498
- return $xeGrid.extendTableMethods(tableCustomMethodKeys)
499
- },
500
- setupGantt ($xeGantt) {
501
- return $xeGantt.extendTableMethods(tableCustomMethodKeys)
502
- }
503
- })
1
+ import { nextTick } from 'vue'
2
+ import { VxeUI } from '@vxe-ui/core'
3
+ import XEUtils from 'xe-utils'
4
+ import { getColumnList } from '../../src/util'
5
+ import { toCssUnit } from '../../../ui/src/dom'
6
+
7
+ import type { TableCustomMethods, TableCustomPrivateMethods, VxeColumnPropTypes, VxeTableDefines, VxeComponentStyleType } from '../../../../types'
8
+
9
+ const tableCustomMethodKeys: (keyof TableCustomMethods)[] = ['openCustom', 'closeCustom', 'getCustomVisible', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox']
10
+
11
+ const customColumnCssKeys = ['checkbox', 'sort', 'title', 'width', 'fixed', 'align', 'header-align', 'footer-align']
12
+
13
+ VxeUI.hooks.add('tableCustomModule', {
14
+ setupTable($xeTable) {
15
+ const { reactData, internalData } = $xeTable
16
+ const { computeCustomOpts, computeRowGroupFields, computeCustomSimpleMode } = $xeTable.getComputeMaps()
17
+ const { refElem } = $xeTable.getRefMaps()
18
+
19
+ const $xeGrid = $xeTable.xeGrid
20
+ const $xeGantt = $xeTable.xeGantt
21
+ const $xeGGWrapper = $xeGrid || $xeGantt
22
+
23
+ const updatePopupStyle = () => {
24
+ const { customStore } = reactData
25
+ const customOpts = computeCustomOpts.value
26
+ const { mode, placement, popupOptions } = customOpts
27
+ const showSimple = !(mode === 'modal' || mode === 'drawer')
28
+ const { transfer, minWidth, maxWidth, maxHeight } = popupOptions || {}
29
+ const customSimpleMode = computeCustomSimpleMode.value
30
+ const showCustomSimpleOutside = customSimpleMode === 'outside'
31
+ const bodyEl = document.documentElement
32
+ let wrapperEl = refElem.value
33
+ let popupTop = 0
34
+ let popupMaxHeight: string | number = 0
35
+ const defPupStys: VxeComponentStyleType = {}
36
+ const panePupStys: VxeComponentStyleType = {}
37
+ if ($xeGantt) {
38
+ const { refGanttContainerElem } = $xeGantt.getRefMaps()
39
+ const ganttContainerElem = refGanttContainerElem.value
40
+ if (ganttContainerElem) {
41
+ wrapperEl = ganttContainerElem
42
+ }
43
+ }
44
+ const tableRect = wrapperEl.getBoundingClientRect()
45
+ // 多种模式,指定元素插入
46
+ if (showSimple && transfer) {
47
+ popupTop = tableRect.top + bodyEl.scrollTop
48
+ popupMaxHeight = XEUtils.eqNull(maxHeight) ? 360 : maxHeight
49
+ } else if (showCustomSimpleOutside) {
50
+ if ($xeGGWrapper && wrapperEl) {
51
+ popupTop = wrapperEl.offsetTop
52
+ }
53
+ popupMaxHeight = XEUtils.eqNull(maxHeight) ? 360 : maxHeight
54
+ } else {
55
+ // 判断面板不能大于表格高度
56
+ if (wrapperEl) {
57
+ popupMaxHeight = wrapperEl.clientHeight - 22
58
+ }
59
+ popupMaxHeight = Math.max(88, popupMaxHeight)
60
+ }
61
+ let popupMxHeight: string | number = 0
62
+ if (!(placement === 'left' || placement === 'right')) {
63
+ popupMxHeight = XEUtils.eqNull(maxHeight) ? popupMaxHeight : maxHeight
64
+ }
65
+ if (!placement || !['left', 'right', 'bottom-left', 'bottom-right'].includes(placement)) {
66
+ if (popupTop) {
67
+ defPupStys.top = toCssUnit(popupTop)
68
+ }
69
+ }
70
+
71
+ if (showSimple && transfer) {
72
+ if (placement === 'bottom-left' || placement === 'bottom-right') {
73
+ defPupStys.bottom = toCssUnit(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1)
74
+ }
75
+ if (placement === 'top-left' || placement === 'bottom-left') {
76
+ defPupStys.left = toCssUnit(tableRect.left)
77
+ } else if (!placement || placement === 'top-right' || placement === 'bottom-right') {
78
+ defPupStys.right = toCssUnit(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1)
79
+ }
80
+ }
81
+
82
+ // 同步表格的css变量到弹窗中
83
+ const bodyComputeStyle = getComputedStyle(bodyEl)
84
+ const tableComputeStyle = getComputedStyle(wrapperEl)
85
+ customColumnCssKeys.forEach((key) => {
86
+ const currCssKey = `--vxe-ui-vxe-table-custom-column-${key}-${key === 'title' ? 'min-' : ''}width`
87
+ const currCssVal = tableComputeStyle.getPropertyValue(currCssKey)
88
+ if (currCssVal && currCssVal !== bodyComputeStyle.getPropertyValue(currCssKey)) {
89
+ panePupStys[currCssKey] = currCssVal
90
+ }
91
+ })
92
+ if (minWidth) {
93
+ defPupStys['--vxe-ui-vxe-table-custom-default-min-width'] = toCssUnit(minWidth)
94
+ }
95
+ if (maxWidth) {
96
+ defPupStys['--vxe-ui-vxe-table-custom-default-max-width'] = toCssUnit(maxWidth)
97
+ }
98
+ if (popupMxHeight) {
99
+ defPupStys.maxHeight = toCssUnit(popupMxHeight)
100
+ }
101
+ customStore.defPopupStyle = defPupStys
102
+ customStore.panePopupStyle = panePupStys
103
+ customStore.maxHeight = popupMxHeight
104
+ return nextTick()
105
+ }
106
+
107
+ const openCustom = () => {
108
+ const { initStore, customStore } = reactData
109
+ const customOpts = computeCustomOpts.value
110
+ const { mode, popupOptions } = customOpts
111
+ const showSimple = !(mode === 'modal' || mode === 'drawer')
112
+ const { transfer } = popupOptions || {}
113
+ const customSimpleMode = computeCustomSimpleMode.value
114
+ const showCustomSimpleOutside = customSimpleMode === 'outside'
115
+ let cpToElem = null
116
+ // 多种模式,指定元素插入
117
+ if (showSimple && transfer) {
118
+ cpToElem = document.body
119
+ } else {
120
+ if (showCustomSimpleOutside && $xeGGWrapper) {
121
+ const { refPopupContainerElem } = $xeGGWrapper.getRefMaps()
122
+ const popupContainerElem = refPopupContainerElem.value
123
+ if (popupContainerElem) {
124
+ cpToElem = popupContainerElem
125
+ }
126
+ }
127
+ }
128
+ if (internalData.customPopupToElem !== cpToElem) {
129
+ reactData.ctPopupFlag++
130
+ }
131
+ internalData.customPopupToElem = cpToElem
132
+ customStore.visible = true
133
+ initStore.custom = true
134
+ handleUpdateCustomColumn()
135
+ checkCustomStatus()
136
+ updatePopupStyle()
137
+ return nextTick().then(() => updatePopupStyle())
138
+ }
139
+
140
+ const handleUpdateCustomColumn = () => {
141
+ const { customStore } = reactData
142
+ const { collectColumn } = internalData
143
+ if (customStore.visible) {
144
+ const sortMaps: Record<string, number> = {}
145
+ const fixedMaps: Record<string, VxeColumnPropTypes.Fixed> = {}
146
+ const visibleMaps: Record<string, boolean> = {}
147
+ XEUtils.eachTree(collectColumn, (column) => {
148
+ const colid = column.getKey()
149
+ column.renderFixed = column.fixed
150
+ column.renderVisible = column.visible
151
+ column.renderResizeWidth = column.renderWidth
152
+ column.renderAlign = column.align
153
+ column.renderHeaderAlign = column.headerAlign
154
+ column.renderFooterAlign = column.footerAlign
155
+ sortMaps[colid] = column.renderSortNumber
156
+ fixedMaps[colid] = column.fixed
157
+ visibleMaps[colid] = column.visible
158
+ })
159
+ customStore.oldSortMaps = sortMaps
160
+ customStore.oldFixedMaps = fixedMaps
161
+ customStore.oldVisibleMaps = visibleMaps
162
+ reactData.customColumnList = collectColumn.slice(0)
163
+ }
164
+ }
165
+
166
+ const closeCustom = () => {
167
+ const { customStore } = reactData
168
+ const customOpts = computeCustomOpts.value
169
+ if (customStore.visible) {
170
+ customStore.visible = false
171
+ if (!customOpts.immediate) {
172
+ $xeTable.handleCustom()
173
+ }
174
+ }
175
+ return nextTick()
176
+ }
177
+
178
+ const toggleCustom = () => {
179
+ const { customStore } = reactData
180
+ if (customStore.visible) {
181
+ return closeCustom()
182
+ }
183
+ return openCustom()
184
+ }
185
+
186
+ const saveCustom = (isDirectly?: boolean) => {
187
+ const { customColumnList, aggHandleFields, rowGroupList } = reactData
188
+ const customOpts = computeCustomOpts.value
189
+ const { allowVisible, allowSort, allowFixed, allowResizable, allowAlign, allowHeaderAlign, allowFooterAlign, allowGroup, allowValues } = customOpts
190
+ if (isDirectly) {
191
+ XEUtils.eachTree(customColumnList, (column) => {
192
+ if (allowResizable) {
193
+ if (column.renderVisible && (!column.children || !column.children.length)) {
194
+ column.resizeWidth = Math.max(0, XEUtils.toNumber(column.renderWidth))
195
+ }
196
+ }
197
+ })
198
+ } else {
199
+ XEUtils.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
200
+ if (parentColumn) {
201
+ // 更新子列信息
202
+ column.fixed = parentColumn.fixed
203
+ } else {
204
+ if (allowSort) {
205
+ const sortIndex = index + 1
206
+ column.renderSortNumber = sortIndex
207
+ }
208
+ if (allowFixed) {
209
+ column.fixed = column.renderFixed
210
+ }
211
+ }
212
+ if (allowResizable) {
213
+ if (column.renderVisible && (!column.children || !column.children.length)) {
214
+ if (column.renderResizeWidth !== column.renderWidth) {
215
+ column.resizeWidth = column.renderResizeWidth
216
+ column.renderWidth = column.renderResizeWidth
217
+ }
218
+ }
219
+ }
220
+ if (allowVisible) {
221
+ column.visible = column.renderVisible
222
+ }
223
+ if (allowAlign) {
224
+ column.align = column.renderAlign
225
+ }
226
+ if (allowHeaderAlign) {
227
+ column.headerAlign = column.renderHeaderAlign
228
+ }
229
+ if (allowFooterAlign) {
230
+ column.footerAlign = column.renderFooterAlign
231
+ }
232
+ if (allowGroup && allowValues) {
233
+ column.aggFunc = column.renderAggFn
234
+ }
235
+ })
236
+ }
237
+ reactData.isCustomStatus = true
238
+ if (allowGroup && !!$xeTable.handlePivotTableAggData) {
239
+ if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
240
+ // 更新数据分组
241
+ if (aggHandleFields.length) {
242
+ $xeTable.setRowGroups(aggHandleFields)
243
+ } else {
244
+ $xeTable.clearRowGroups()
245
+ }
246
+ } else if (allowValues) {
247
+ // 更新聚合函数
248
+ $xeTable.handleUpdateAggData()
249
+ }
250
+ }
251
+ if (allowSort) {
252
+ internalData.collectColumn = customColumnList
253
+ }
254
+ return $xeTable.saveCustomStore('confirm')
255
+ }
256
+
257
+ const cancelCustom = () => {
258
+ const { customColumnList, customStore } = reactData
259
+ const { oldSortMaps, oldFixedMaps, oldVisibleMaps } = customStore
260
+ const customOpts = computeCustomOpts.value
261
+ const { allowVisible, allowSort, allowFixed, allowAlign, allowHeaderAlign, allowFooterAlign, allowResizable, allowGroup, allowValues } = customOpts
262
+ XEUtils.eachTree(
263
+ customColumnList,
264
+ (column) => {
265
+ const colid = column.getKey()
266
+ const visible = !!oldVisibleMaps[colid]
267
+ const fixed = oldFixedMaps[colid] || ''
268
+ if (allowVisible) {
269
+ column.renderVisible = visible
270
+ column.visible = visible
271
+ }
272
+ if (allowFixed) {
273
+ column.renderFixed = fixed
274
+ column.fixed = fixed
275
+ }
276
+ if (allowSort) {
277
+ column.renderSortNumber = oldSortMaps[colid] || 0
278
+ }
279
+ if (allowResizable) {
280
+ column.renderResizeWidth = column.renderWidth
281
+ }
282
+ if (allowAlign) {
283
+ column.align = column.renderAlign
284
+ }
285
+ if (allowHeaderAlign) {
286
+ column.headerAlign = column.renderHeaderAlign
287
+ }
288
+ if (allowFooterAlign) {
289
+ column.footerAlign = column.renderFooterAlign
290
+ }
291
+ if (allowGroup) {
292
+ // 无
293
+ }
294
+ if (allowValues) {
295
+ // 无
296
+ }
297
+ },
298
+ { children: 'children' }
299
+ )
300
+ return nextTick()
301
+ }
302
+
303
+ const setCustomAllCheckbox = (checked: boolean) => {
304
+ const { customStore } = reactData
305
+ const { customColumnList } = reactData
306
+ const customOpts = computeCustomOpts.value
307
+ const { checkMethod, visibleMethod } = customOpts
308
+ const isAll = !!checked
309
+ if (customOpts.immediate) {
310
+ XEUtils.eachTree(customColumnList, (column) => {
311
+ if (visibleMethod && !visibleMethod({ $table: $xeTable, column })) {
312
+ return
313
+ }
314
+ if (checkMethod && !checkMethod({ $table: $xeTable, column })) {
315
+ return
316
+ }
317
+ column.visible = isAll
318
+ column.renderVisible = isAll
319
+ column.halfVisible = false
320
+ })
321
+ customStore.isAll = isAll
322
+ reactData.isCustomStatus = true
323
+ $xeTable.handleCustom()
324
+ $xeTable.saveCustomStore('update:visible')
325
+ } else {
326
+ XEUtils.eachTree(customColumnList, (column) => {
327
+ if (visibleMethod && !visibleMethod({ $table: $xeTable, column })) {
328
+ return
329
+ }
330
+ if (checkMethod && !checkMethod({ $table: $xeTable, column })) {
331
+ return
332
+ }
333
+ column.renderVisible = isAll
334
+ column.halfVisible = false
335
+ })
336
+ customStore.isAll = isAll
337
+ }
338
+ $xeTable.checkCustomStatus()
339
+ return nextTick()
340
+ }
341
+
342
+ const customMethods: TableCustomMethods = {
343
+ getCustomVisible() {
344
+ const { customStore } = reactData
345
+ return customStore.visible
346
+ },
347
+ openCustom,
348
+ closeCustom,
349
+ toggleCustom,
350
+ saveCustom,
351
+ cancelCustom,
352
+ resetCustom(options) {
353
+ const { rowGroupList } = reactData
354
+ const { collectColumn } = internalData
355
+ const customOpts = computeCustomOpts.value
356
+ const { checkMethod } = customOpts
357
+ const opts: VxeTableDefines.VxeTableCustomStorageObj = Object.assign(
358
+ {
359
+ visible: true,
360
+ resizable: options === true,
361
+ fixed: options === true,
362
+ sort: options === true,
363
+ aggFunc: options === true,
364
+ align: options === true,
365
+ headerAlign: options === true,
366
+ footerAlign: options === true
367
+ },
368
+ options
369
+ )
370
+ const allCols: VxeTableDefines.ColumnInfo[] = []
371
+ XEUtils.eachTree(collectColumn, (column) => {
372
+ if (opts.resizable) {
373
+ column.resizeWidth = 0
374
+ }
375
+ if (opts.fixed) {
376
+ column.fixed = column.defaultFixed
377
+ column.renderFixed = column.defaultFixed
378
+ }
379
+ if (opts.sort) {
380
+ column.renderSortNumber = column.sortNumber
381
+ column.parentId = column.defaultParentId
382
+ }
383
+ if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
384
+ column.visible = column.defaultVisible
385
+ }
386
+ if (opts.align) {
387
+ column.align = column.defaultAlign
388
+ column.renderAlign = column.defaultAlign
389
+ }
390
+ if (opts.headerAlign) {
391
+ column.headerAlign = column.defaultHeaderAlign
392
+ column.renderHeaderAlign = column.defaultHeaderAlign
393
+ }
394
+ if (opts.footerAlign) {
395
+ column.footerAlign = column.defaultFooterAlign
396
+ column.renderFooterAlign = column.defaultFooterAlign
397
+ }
398
+ if (opts.aggFunc) {
399
+ column.aggFunc = column.defaultAggFunc
400
+ column.renderAggFn = column.defaultAggFunc
401
+ }
402
+ column.renderResizeWidth = column.renderWidth
403
+ allCols.push(column)
404
+ })
405
+ if (opts.sort) {
406
+ const newCollectCols = XEUtils.toArrayTree(XEUtils.orderBy(allCols, 'renderSortNumber'), { key: 'id', parentKey: 'parentId', children: 'children' })
407
+ internalData.collectColumn = newCollectCols
408
+ internalData.tableFullColumn = getColumnList(newCollectCols)
409
+ }
410
+ reactData.isCustomStatus = false
411
+ return $xeTable.handleCustom().then(() => {
412
+ if (opts.aggFunc && !!$xeTable.handlePivotTableAggData) {
413
+ const rowGroupFields = computeRowGroupFields.value
414
+ if (rowGroupFields ? rowGroupFields.length : rowGroupList.length) {
415
+ if (rowGroupFields && rowGroupFields.length) {
416
+ $xeTable.setRowGroups(rowGroupFields)
417
+ } else {
418
+ $xeTable.clearRowGroups()
419
+ }
420
+ } else {
421
+ $xeTable.handleUpdateAggData()
422
+ }
423
+ }
424
+ $xeTable.saveCustomStore('reset')
425
+ })
426
+ },
427
+ toggleCustomAllCheckbox() {
428
+ const { customStore } = reactData
429
+ const isAll = !customStore.isAll
430
+ return setCustomAllCheckbox(isAll)
431
+ },
432
+ setCustomAllCheckbox
433
+ }
434
+
435
+ const checkCustomStatus = () => {
436
+ const { customStore } = reactData
437
+ const { collectColumn } = internalData
438
+ const customOpts = computeCustomOpts.value
439
+ const { checkMethod } = customOpts
440
+ customStore.isAll = collectColumn.every((column) => (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false) || column.renderVisible)
441
+ customStore.isIndeterminate = !customStore.isAll && collectColumn.some((column) => (!checkMethod || checkMethod({ $table: $xeTable, column })) && (column.renderVisible || column.halfVisible))
442
+ }
443
+
444
+ const emitCustomEvent = (type: VxeTableDefines.CustomType, evnt: Event) => {
445
+ $xeTable.dispatchEvent('custom', { type }, evnt)
446
+ }
447
+
448
+ const customPrivateMethods: TableCustomPrivateMethods = {
449
+ checkCustomStatus,
450
+ emitCustomEvent,
451
+ triggerCustomEvent(evnt) {
452
+ const reactData = $xeTable.reactData
453
+
454
+ const { customStore } = reactData
455
+ if (customStore.visible) {
456
+ closeCustom()
457
+ emitCustomEvent('close', evnt)
458
+ $xeTable.dispatchEvent('custom-close', {}, evnt)
459
+ } else {
460
+ customStore.btnEl = evnt.target as HTMLDivElement
461
+ openCustom()
462
+ emitCustomEvent('open', evnt)
463
+ $xeTable.dispatchEvent('custom-open', {}, evnt)
464
+ }
465
+ },
466
+ customOpenEvent(evnt) {
467
+ const reactData = $xeTable.reactData
468
+
469
+ const { customStore } = reactData
470
+ if (!customStore.visible) {
471
+ customStore.activeBtn = true
472
+ customStore.btnEl = evnt.target as HTMLDivElement
473
+ $xeTable.openCustom()
474
+ $xeTable.emitCustomEvent('open', evnt)
475
+ $xeTable.dispatchEvent('custom-open', {}, evnt)
476
+ }
477
+ },
478
+ customCloseEvent(evnt) {
479
+ const reactData = $xeTable.reactData
480
+
481
+ const { customStore } = reactData
482
+ if (customStore.visible) {
483
+ customStore.activeBtn = false
484
+ $xeTable.closeCustom()
485
+ $xeTable.emitCustomEvent('close', evnt)
486
+ $xeTable.dispatchEvent('custom-close', {}, evnt)
487
+ }
488
+ },
489
+ handleUpdateCustomColumn,
490
+ handleCustomStyle() {
491
+ const reactData = $xeTable.reactData
492
+
493
+ const { customStore } = reactData
494
+ if (!customStore.visible) {
495
+ return nextTick()
496
+ }
497
+ reactData.isCustomDragStatus = false
498
+ return updatePopupStyle()
499
+ }
500
+ }
501
+
502
+ return { ...customMethods, ...customPrivateMethods }
503
+ },
504
+ setupGrid($xeGrid) {
505
+ return $xeGrid.extendTableMethods(tableCustomMethodKeys)
506
+ },
507
+ setupGantt($xeGantt) {
508
+ return $xeGantt.extendTableMethods(tableCustomMethodKeys)
509
+ }
510
+ })