vxe-table 4.23.19 → 4.23.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.
Files changed (127) hide show
  1. package/dist/all.esm.js +289 -253
  2. package/dist/all.esm.min.js +3 -3
  3. package/dist/style.css +4 -1
  4. package/dist/style.mini.css +1 -1
  5. package/es/components.d.ts +1 -3
  6. package/es/components.js +1 -2
  7. package/es/esm.index.d.ts +7 -0
  8. package/es/esm.index.js +8 -0
  9. package/es/style.css +4 -1
  10. package/es/style.mini.css +1 -1
  11. package/es/table/src/table.js +6 -2
  12. package/es/table/style.css +4 -1
  13. package/es/table/style.mini.css +1 -1
  14. package/es/ui/abandon.d.ts +82 -0
  15. package/es/ui/abandon.js +90 -0
  16. package/es/ui/index.d.ts +1 -83
  17. package/es/ui/index.js +2 -89
  18. package/es/ui/src/log.js +1 -1
  19. package/es/vxe-table/style.css +4 -1
  20. package/es/vxe-table/style.mini.css +1 -1
  21. package/lib/components.d.ts +1 -3
  22. package/lib/components.js +1 -2
  23. package/lib/esm.index.d.ts +7 -0
  24. package/lib/esm.index.js +39 -0
  25. package/lib/index.umd.js +254 -249
  26. package/lib/index.umd.min.js +3 -3
  27. package/lib/style.css +4 -1
  28. package/lib/style.mini.css +1 -1
  29. package/lib/table/src/table.js +6 -2
  30. package/lib/table/style/style.css +4 -1
  31. package/lib/table/style/style.mini.css +1 -1
  32. package/lib/ui/abandon.d.ts +82 -0
  33. package/lib/ui/abandon.js +110 -0
  34. package/lib/ui/index.d.ts +1 -83
  35. package/lib/ui/index.js +3 -89
  36. package/lib/ui/src/log.js +1 -1
  37. package/lib/vxe-table/style/style.css +4 -1
  38. package/lib/vxe-table/style/style.mini.css +1 -1
  39. package/package.json +1 -1
  40. package/packages/colgroup/index.ts +22 -22
  41. package/packages/column/index.ts +22 -22
  42. package/packages/components.ts +42 -45
  43. package/packages/esm.index.ts +10 -0
  44. package/packages/grid/index.ts +18 -18
  45. package/packages/grid/src/emits.ts +5 -5
  46. package/packages/grid/src/grid.ts +2220 -2220
  47. package/packages/grid/src/props.ts +22 -22
  48. package/packages/index.ts +13 -13
  49. package/packages/locale/lang/ar-EG.ts +914 -914
  50. package/packages/locale/lang/de-DE.ts +914 -914
  51. package/packages/locale/lang/en-US.ts +914 -914
  52. package/packages/locale/lang/es-ES.ts +914 -914
  53. package/packages/locale/lang/fr-FR.ts +914 -914
  54. package/packages/locale/lang/hu-HU.ts +914 -914
  55. package/packages/locale/lang/hy-AM.ts +914 -914
  56. package/packages/locale/lang/id-ID.ts +914 -914
  57. package/packages/locale/lang/it-IT.ts +914 -914
  58. package/packages/locale/lang/ja-JP.ts +914 -914
  59. package/packages/locale/lang/ko-KR.ts +914 -914
  60. package/packages/locale/lang/ms-MY.ts +914 -914
  61. package/packages/locale/lang/nb-NO.ts +914 -914
  62. package/packages/locale/lang/pt-BR.ts +914 -914
  63. package/packages/locale/lang/ru-RU.ts +914 -914
  64. package/packages/locale/lang/th-TH.ts +914 -914
  65. package/packages/locale/lang/ug-CN.ts +914 -914
  66. package/packages/locale/lang/uk-UA.ts +914 -914
  67. package/packages/locale/lang/uz-UZ.ts +914 -914
  68. package/packages/locale/lang/vi-VN.ts +914 -914
  69. package/packages/locale/lang/zh-CHT.ts +914 -914
  70. package/packages/locale/lang/zh-CN.ts +914 -914
  71. package/packages/locale/lang/zh-HK.ts +914 -914
  72. package/packages/locale/lang/zh-MO.ts +914 -914
  73. package/packages/locale/lang/zh-TC.ts +914 -914
  74. package/packages/locale/lang/zh-TW.ts +914 -914
  75. package/packages/table/index.ts +26 -26
  76. package/packages/table/module/custom/hook.ts +510 -510
  77. package/packages/table/module/custom/panel.ts +2002 -2002
  78. package/packages/table/module/edit/hook.ts +1232 -1232
  79. package/packages/table/module/export/export-panel.ts +697 -697
  80. package/packages/table/module/export/hook.ts +2158 -2158
  81. package/packages/table/module/export/import-panel.ts +319 -319
  82. package/packages/table/module/export/util.ts +25 -25
  83. package/packages/table/module/filter/hook.ts +505 -505
  84. package/packages/table/module/filter/panel.ts +368 -368
  85. package/packages/table/module/keyboard/hook.ts +498 -498
  86. package/packages/table/module/menu/hook.ts +330 -330
  87. package/packages/table/module/menu/panel.ts +272 -272
  88. package/packages/table/module/validator/hook.ts +653 -653
  89. package/packages/table/render/index.ts +1819 -1819
  90. package/packages/table/src/body.ts +1078 -1078
  91. package/packages/table/src/cell.ts +1524 -1524
  92. package/packages/table/src/column.ts +192 -192
  93. package/packages/table/src/columnInfo.ts +232 -232
  94. package/packages/table/src/emits.ts +134 -134
  95. package/packages/table/src/footer.ts +425 -425
  96. package/packages/table/src/group.ts +67 -67
  97. package/packages/table/src/header.ts +661 -661
  98. package/packages/table/src/props.ts +336 -336
  99. package/packages/table/src/store.ts +14 -14
  100. package/packages/table/src/table.ts +8 -3
  101. package/packages/table/src/use/cell-view.ts +41 -41
  102. package/packages/table/src/use/index.ts +1 -1
  103. package/packages/table/src/util.ts +1206 -1206
  104. package/packages/toolbar/index.ts +18 -18
  105. package/packages/toolbar/src/toolbar.ts +768 -768
  106. package/packages/ui/abandon.ts +136 -0
  107. package/packages/ui/index.ts +404 -524
  108. package/packages/ui/src/anime.ts +51 -51
  109. package/packages/ui/src/comp.ts +3 -3
  110. package/packages/ui/src/dom.ts +466 -466
  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/styles/components/table.scss +2 -1
  117. package/types/all.d.ts +76 -76
  118. package/types/index.d.ts +4 -4
  119. /package/dist/{iconfont.1794474448348.ttf → iconfont.1794983806256.ttf} +0 -0
  120. /package/dist/{iconfont.1794474448348.woff → iconfont.1794983806256.woff} +0 -0
  121. /package/dist/{iconfont.1794474448348.woff2 → iconfont.1794983806256.woff2} +0 -0
  122. /package/es/{iconfont.1794474448348.ttf → iconfont.1794983806256.ttf} +0 -0
  123. /package/es/{iconfont.1794474448348.woff → iconfont.1794983806256.woff} +0 -0
  124. /package/es/{iconfont.1794474448348.woff2 → iconfont.1794983806256.woff2} +0 -0
  125. /package/lib/{iconfont.1794474448348.ttf → iconfont.1794983806256.ttf} +0 -0
  126. /package/lib/{iconfont.1794474448348.woff → iconfont.1794983806256.woff} +0 -0
  127. /package/lib/{iconfont.1794474448348.woff2 → iconfont.1794983806256.woff2} +0 -0
@@ -1,510 +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(
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
- })
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
+ })