vxe-table 3.15.44 → 3.15.45

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 (66) hide show
  1. package/es/{iconfont.1750386589726.ttf → iconfont.1750641764687.ttf} +0 -0
  2. package/es/iconfont.1750641764687.woff +0 -0
  3. package/es/iconfont.1750641764687.woff2 +0 -0
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/style.css +1 -1
  7. package/es/style.min.css +1 -1
  8. package/es/table/module/custom/mixin.js +9 -0
  9. package/es/table/module/custom/panel.js +395 -300
  10. package/es/table/module/edit/mixin.js +27 -10
  11. package/es/table/module/export/mixin.js +19 -6
  12. package/es/table/src/cell.js +4 -4
  13. package/es/table/src/methods.js +3 -3
  14. package/es/table/style.css +37 -9
  15. package/es/table/style.min.css +1 -1
  16. package/es/ui/index.js +5 -1
  17. package/es/ui/src/log.js +1 -1
  18. package/es/vxe-table/style.css +37 -9
  19. package/es/vxe-table/style.min.css +1 -1
  20. package/lib/{iconfont.1750386589726.ttf → iconfont.1750641764687.ttf} +0 -0
  21. package/lib/iconfont.1750641764687.woff +0 -0
  22. package/lib/iconfont.1750641764687.woff2 +0 -0
  23. package/lib/index.css +1 -1
  24. package/lib/index.min.css +1 -1
  25. package/lib/index.umd.js +326 -145
  26. package/lib/index.umd.min.js +1 -1
  27. package/lib/style.css +1 -1
  28. package/lib/style.min.css +1 -1
  29. package/lib/table/module/custom/mixin.js +11 -0
  30. package/lib/table/module/custom/mixin.min.js +1 -1
  31. package/lib/table/module/custom/panel.js +234 -122
  32. package/lib/table/module/custom/panel.min.js +1 -1
  33. package/lib/table/module/edit/mixin.js +49 -10
  34. package/lib/table/module/edit/mixin.min.js +1 -1
  35. package/lib/table/module/export/mixin.js +19 -4
  36. package/lib/table/module/export/mixin.min.js +1 -1
  37. package/lib/table/src/cell.js +4 -4
  38. package/lib/table/src/cell.min.js +1 -1
  39. package/lib/table/src/methods.js +3 -3
  40. package/lib/table/src/methods.min.js +1 -1
  41. package/lib/table/style/style.css +37 -9
  42. package/lib/table/style/style.min.css +1 -1
  43. package/lib/ui/index.js +5 -1
  44. package/lib/ui/index.min.js +1 -1
  45. package/lib/ui/src/log.js +1 -1
  46. package/lib/ui/src/log.min.js +1 -1
  47. package/lib/vxe-table/style/style.css +37 -9
  48. package/lib/vxe-table/style/style.min.css +1 -1
  49. package/package.json +1 -1
  50. package/packages/table/module/custom/mixin.ts +10 -0
  51. package/packages/table/module/custom/panel.ts +413 -313
  52. package/packages/table/module/edit/mixin.ts +28 -10
  53. package/packages/table/module/export/mixin.ts +18 -6
  54. package/packages/table/src/cell.ts +4 -4
  55. package/packages/table/src/methods.ts +3 -3
  56. package/packages/ui/index.ts +4 -0
  57. package/styles/components/icon.scss +9 -1
  58. package/styles/components/table-module/custom.scss +26 -3
  59. package/styles/helpers/baseMixin.scss +16 -2
  60. package/styles/icon/iconfont.ttf +0 -0
  61. package/styles/icon/iconfont.woff +0 -0
  62. package/styles/icon/iconfont.woff2 +0 -0
  63. package/es/iconfont.1750386589726.woff +0 -0
  64. package/es/iconfont.1750386589726.woff2 +0 -0
  65. package/lib/iconfont.1750386589726.woff +0 -0
  66. package/lib/iconfont.1750386589726.woff2 +0 -0
@@ -5,26 +5,33 @@ import { getTpImg, addClass, removeClass, hasControlKey } from '../../../ui/src/
5
5
  import { errLog } from '../../../ui/src/log'
6
6
  import XEUtils from 'xe-utils'
7
7
 
8
- import type { VxeTableDefines, VxeTableConstructor, VxeTablePrivateMethods, TableReactData, TableInternalData } from '../../../../types'
9
- import type { VxeModalComponent, VxeDrawerComponent, VxeButtonComponent, VxeRadioGroupComponent, VxeInputComponent } from 'vxe-pc-ui'
8
+ import type { VxeTableDefines, VxeTableConstructor, VxeTablePrivateMethods, TableReactData, TableInternalData, VxeColumnPropTypes, VxeTableCustomPanelConstructor, TableCustomPanelReactData, TableCustomPanelInternalData } from '../../../../types'
9
+ import type { VxeModalComponent, VxeDrawerComponent, VxeButtonComponent, VxeRadioGroupComponent, VxeInputComponent, VxeButtonDefines, VxeRadioGroupDefines } from 'vxe-pc-ui'
10
10
 
11
11
  const { getI18n, getIcon, renderEmptyElement } = VxeUI
12
12
 
13
- function showDropTip (_vm: any, evnt: DragEvent | MouseEvent, optEl: HTMLElement | null, showLine: boolean, dragPos: string) {
14
- const { prevDragToChild } = _vm
13
+ function showDropTip ($xeTableCustomPanel: VxeTableCustomPanelConstructor, evnt: DragEvent | MouseEvent, optEl: HTMLElement | null, showLine: boolean, dragPos: string) {
14
+ const customPanelInternalData = $xeTableCustomPanel.internalData
15
15
 
16
- const el = _vm.$refs.bodyElemRef as HTMLDivElement
17
- if (!el) {
16
+ const bodyWrapperElem = $xeTableCustomPanel.$refs.refBodyWrapperElem as HTMLDivElement
17
+ if (!bodyWrapperElem) {
18
18
  return
19
19
  }
20
- const wrapperRect = el.getBoundingClientRect()
20
+ const customBodyElem = $xeTableCustomPanel.$refs.refCustomBodyElem as HTMLDivElement
21
+ if (!customBodyElem) {
22
+ return
23
+ }
24
+ const { prevDragToChild } = customPanelInternalData
25
+ const bodyWrapperRect = bodyWrapperElem.getBoundingClientRect()
26
+ const customBodyRect = customBodyElem.getBoundingClientRect()
21
27
  if (optEl) {
22
- const dragLineEl = _vm.$refs.refDragLineElem as HTMLDivElement
28
+ const dragLineEl = $xeTableCustomPanel.$refs.refDragLineElem as HTMLDivElement
23
29
  if (dragLineEl) {
24
30
  if (showLine) {
25
31
  const optRect = optEl.getBoundingClientRect()
26
32
  dragLineEl.style.display = 'block'
27
- dragLineEl.style.top = `${Math.max(1, optRect.y + el.scrollTop - wrapperRect.y)}px`
33
+ dragLineEl.style.left = `${Math.max(0, customBodyRect.x - bodyWrapperRect.x)}px`
34
+ dragLineEl.style.top = `${Math.max(1, optRect.y + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`
28
35
  dragLineEl.style.height = `${optRect.height}px`
29
36
  dragLineEl.style.width = `${optRect.width}px`
30
37
  dragLineEl.setAttribute('drag-pos', dragPos)
@@ -34,18 +41,18 @@ function showDropTip (_vm: any, evnt: DragEvent | MouseEvent, optEl: HTMLElement
34
41
  }
35
42
  }
36
43
  }
37
- const dragTipEl = _vm.$refs.refDragTipElem as HTMLDivElement
44
+ const dragTipEl = $xeTableCustomPanel.$refs.refDragTipElem as HTMLDivElement
38
45
  if (dragTipEl) {
39
46
  dragTipEl.style.display = 'block'
40
- dragTipEl.style.top = `${Math.min(el.clientHeight + el.scrollTop - dragTipEl.clientHeight, evnt.clientY + el.scrollTop - wrapperRect.y)}px`
41
- dragTipEl.style.left = `${Math.min(el.clientWidth + el.scrollLeft - dragTipEl.clientWidth, evnt.clientX + el.scrollLeft - wrapperRect.x)}px`
47
+ dragTipEl.style.top = `${Math.min(bodyWrapperElem.clientHeight + bodyWrapperElem.scrollTop - dragTipEl.clientHeight, evnt.clientY + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`
48
+ dragTipEl.style.left = `${Math.min(bodyWrapperElem.clientWidth + bodyWrapperElem.scrollLeft - dragTipEl.clientWidth, evnt.clientX + bodyWrapperElem.scrollLeft - bodyWrapperRect.x)}px`
42
49
  dragTipEl.setAttribute('drag-status', showLine ? (prevDragToChild ? 'sub' : 'normal') : 'disabled')
43
50
  }
44
51
  }
45
52
 
46
- function hideDropTip (_vm: any) {
47
- const dragTipEl = _vm.$refs.refDragTipElem as HTMLDivElement
48
- const dragLineEl = _vm.$refs.refDragLineElem as HTMLDivElement
53
+ function hideDropTip ($xeTableCustomPanel: VxeTableCustomPanelConstructor) {
54
+ const dragTipEl = $xeTableCustomPanel.$refs.refDragTipElem as HTMLDivElement
55
+ const dragLineEl = $xeTableCustomPanel.$refs.refDragLineElem as HTMLDivElement
49
56
  if (dragTipEl) {
50
57
  dragTipEl.style.display = ''
51
58
  }
@@ -54,10 +61,11 @@ function hideDropTip (_vm: any) {
54
61
  }
55
62
  }
56
63
 
57
- const renderDragTip = (h: CreateElement, _vm: any) => {
58
- const $xeTable = _vm.$xeTable
64
+ const renderDragTip = (h: CreateElement, $xeTableCustomPanel: VxeTableCustomPanelConstructor) => {
65
+ const $xeTable = $xeTableCustomPanel.$xeTable
66
+ const customPanelReactData = $xeTableCustomPanel.reactData
59
67
 
60
- const dragCol = $xeTable.dragColumnRef
68
+ const { dragTipText } = customPanelReactData
61
69
  const columnDragOpts = $xeTable.computeColumnDragOpts
62
70
  return h('div', {}, [
63
71
  h('div', {
@@ -82,13 +90,19 @@ const renderDragTip = (h: CreateElement, _vm: any) => {
82
90
  h('span', {
83
91
  class: ['vxe-table-custom-popup--drag-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
84
92
  }),
93
+ h('span', {
94
+ class: ['vxe-table-custom-popup--drag-tip-group-status', getIcon().TABLE_DRAG_STATUS_AGG_GROUP]
95
+ }),
96
+ h('span', {
97
+ class: ['vxe-table-custom-popup--drag-tip-values-status', getIcon().TABLE_DRAG_STATUS_AGG_VALUES]
98
+ }),
85
99
  h('span', {
86
100
  class: ['vxe-table-custom-popup--drag-tip-disabled-status', getIcon().TABLE_DRAG_DISABLED]
87
101
  })
88
102
  ]),
89
103
  h('div', {
90
104
  class: 'vxe-table-custom-popup--drag-tip-content'
91
- }, getI18n('vxe.custom.cstmDragTarget', [dragCol && dragCol.type !== 'html' ? dragCol.getTitle() : '']))
105
+ }, `${dragTipText || ''}`)
92
106
  ])
93
107
  ])
94
108
  ])
@@ -101,12 +115,12 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
101
115
 
102
116
  const $xeTable = _vm.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
103
117
  const tableProps = $xeTable
104
- const reactData = $xeTable as unknown as TableReactData
118
+ const tableReactData = $xeTable as unknown as TableReactData
105
119
  const $xeGrid = $xeTable.$xeGrid
106
120
 
107
121
  const { customStore } = props
108
122
  const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps
109
- const { isCustomStatus, customColumnList } = reactData
123
+ const { isCustomStatus, customColumnList } = tableReactData
110
124
  const customOpts = $xeTable.computeCustomOpts
111
125
  const { immediate } = customOpts
112
126
  const columnDragOpts = $xeTable.computeColumnDragOpts
@@ -173,9 +187,9 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
173
187
  title: getI18n('vxe.custom.setting.colVisible')
174
188
  },
175
189
  on: {
176
- click: () => {
190
+ click: (evnt: MouseEvent) => {
177
191
  if (!isDisabled) {
178
- _vm.changeCheckboxOption(column)
192
+ _vm.changeCheckboxOption(column, evnt)
179
193
  }
180
194
  }
181
195
  }
@@ -241,8 +255,8 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
241
255
  title: getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
242
256
  },
243
257
  on: {
244
- click: () => {
245
- _vm.changeFixedOption(column, 'left')
258
+ click: ({ $event }: VxeButtonDefines.ClickEventParams) => {
259
+ _vm.changeFixedOption(column, 'left', $event)
246
260
  }
247
261
  }
248
262
  }),
@@ -255,8 +269,8 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
255
269
  title: getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
256
270
  },
257
271
  on: {
258
- click: () => {
259
- _vm.changeFixedOption(column, 'right')
272
+ click: ({ $event }: VxeButtonDefines.ClickEventParams) => {
273
+ _vm.changeFixedOption(column, 'right', $event)
260
274
  }
261
275
  }
262
276
  })
@@ -278,156 +292,161 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
278
292
  : {}
279
293
  }, customStore.visible
280
294
  ? [
281
- !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel
282
- ? h($xeTable.getPivotTableAggregateSimplePanel(), {
283
- props: {
284
- customStore
285
- }
286
- })
287
- : renderEmptyElement($xeTable),
288
295
  h('div', {
289
- class: 'vxe-table-custom--handle-wrapper'
296
+ ref: 'refBodyWrapperElem',
297
+ class: 'vxe-table-custom-body-wrapper'
290
298
  }, [
299
+ !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel
300
+ ? h($xeTable.getPivotTableAggregateSimplePanel(), {
301
+ props: {
302
+ customStore
303
+ }
304
+ })
305
+ : renderEmptyElement($xeTable),
291
306
  h('div', {
292
- class: 'vxe-table-custom--header'
293
- }, headerSlot
294
- ? $xeTable.callSlot(headerSlot, params, h)
295
- : [
296
- h('ul', {
297
- class: 'vxe-table-custom--panel-list'
298
- }, [
299
- h('li', {
300
- class: 'vxe-table-custom--option'
307
+ ref: 'refCustomBodyElem',
308
+ class: 'vxe-table-custom--handle-wrapper'
309
+ }, [
310
+ h('div', {
311
+ class: 'vxe-table-custom--header'
312
+ }, headerSlot
313
+ ? $xeTable.callSlot(headerSlot, params, h)
314
+ : [
315
+ h('ul', {
316
+ class: 'vxe-table-custom--panel-list'
301
317
  }, [
302
- allowVisible
303
- ? h('div', {
304
- class: ['vxe-table-custom--checkbox-option', {
305
- 'is--checked': isAllChecked,
306
- 'is--indeterminate': isAllIndeterminate
307
- }],
308
- attrs: {
309
- title: getI18n('vxe.table.allTitle')
310
- },
311
- on: {
312
- click: _vm.allOptionEvent
313
- }
314
- }, [
315
- h('span', {
316
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
317
- }),
318
- h('span', {
318
+ h('li', {
319
+ class: 'vxe-table-custom--option'
320
+ }, [
321
+ allowVisible
322
+ ? h('div', {
323
+ class: ['vxe-table-custom--checkbox-option', {
324
+ 'is--checked': isAllChecked,
325
+ 'is--indeterminate': isAllIndeterminate
326
+ }],
327
+ attrs: {
328
+ title: getI18n('vxe.table.allTitle')
329
+ },
330
+ on: {
331
+ click: _vm.allOptionEvent
332
+ }
333
+ }, [
334
+ h('span', {
335
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
336
+ }),
337
+ h('span', {
338
+ class: 'vxe-checkbox--label'
339
+ }, getI18n('vxe.toolbar.customAll'))
340
+ ])
341
+ : h('span', {
319
342
  class: 'vxe-checkbox--label'
320
- }, getI18n('vxe.toolbar.customAll'))
321
- ])
322
- : h('span', {
323
- class: 'vxe-checkbox--label'
324
- }, getI18n('vxe.table.customTitle'))
343
+ }, getI18n('vxe.table.customTitle'))
344
+ ])
325
345
  ])
326
- ])
327
- ]),
328
- h('div', {
329
- ref: 'bodyElemRef',
330
- class: 'vxe-table-custom--body'
331
- }, [
332
- topSlot
333
- ? h('div', {
334
- class: 'vxe-table-custom--panel-top'
335
- }, $xeTable.callSlot(topSlot, params, h))
336
- : renderEmptyElement($xeTable),
337
- defaultSlot
338
- ? h('div', {
339
- class: 'vxe-table-custom--panel-body'
340
- }, $xeTable.callSlot(defaultSlot, params, h))
341
- : h('transition-group', {
342
- class: 'vxe-table-custom--panel-list',
343
- props: {
344
- name: 'vxe-table-custom--list',
345
- tag: 'ul'
346
- },
347
- on: customWrapperOns
348
- }, colVNs),
349
- bottomSlot
346
+ ]),
347
+ h('div', {
348
+ class: 'vxe-table-custom--body'
349
+ }, [
350
+ topSlot
351
+ ? h('div', {
352
+ class: 'vxe-table-custom--panel-top'
353
+ }, $xeTable.callSlot(topSlot, params, h))
354
+ : renderEmptyElement($xeTable),
355
+ defaultSlot
356
+ ? h('div', {
357
+ class: 'vxe-table-custom--panel-body'
358
+ }, $xeTable.callSlot(defaultSlot, params, h))
359
+ : h('transition-group', {
360
+ class: 'vxe-table-custom--panel-list',
361
+ props: {
362
+ name: 'vxe-table-custom--list',
363
+ tag: 'ul'
364
+ },
365
+ on: customWrapperOns
366
+ }, colVNs),
367
+ bottomSlot
368
+ ? h('div', {
369
+ class: 'vxe-table-custom--panel-bottom'
370
+ }, $xeTable.callSlot(bottomSlot, params, h))
371
+ : renderEmptyElement($xeTable)
372
+ ]),
373
+ customOpts.showFooter
350
374
  ? h('div', {
351
- class: 'vxe-table-custom--panel-bottom'
352
- }, $xeTable.callSlot(bottomSlot, params, h))
353
- : renderEmptyElement($xeTable),
354
- renderDragTip(h, _vm)
355
- ]),
356
- customOpts.showFooter
357
- ? h('div', {
358
- class: 'vxe-table-custom--footer'
359
- }, footerSlot
360
- ? $xeTable.callSlot(footerSlot, params, h)
361
- : [
362
- h('div', {
363
- class: 'vxe-table-custom--footer-buttons'
364
- }, [
365
- h(VxeUIButtonComponent, {
366
- props: {
367
- mode: 'text',
368
- content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
369
- disabled: !isCustomStatus
370
- },
371
- on: {
372
- click: _vm.resetCustomEvent
373
- }
374
- }),
375
- immediate
376
- ? h(VxeUIButtonComponent, {
377
- props: {
378
- mode: 'text',
379
- content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
380
- },
381
- on: {
382
- click: _vm.cancelCloseEvent
383
- }
384
- })
385
- : h(VxeUIButtonComponent, {
375
+ class: 'vxe-table-custom--footer'
376
+ }, footerSlot
377
+ ? $xeTable.callSlot(footerSlot, params, h)
378
+ : [
379
+ h('div', {
380
+ class: 'vxe-table-custom--footer-buttons'
381
+ }, [
382
+ h(VxeUIButtonComponent, {
386
383
  props: {
387
384
  mode: 'text',
388
- content: customOpts.resetButtonText || getI18n('vxe.table.customCancel')
385
+ content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
386
+ disabled: !isCustomStatus
389
387
  },
390
388
  on: {
391
- click: _vm.cancelCustomEvent
389
+ click: _vm.resetCustomEvent
392
390
  }
393
391
  }),
394
- immediate
395
- ? renderEmptyElement($xeTable)
396
- : h(VxeUIButtonComponent, {
397
- props: {
398
- mode: 'text',
399
- status: 'primary',
400
- content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm')
401
- },
402
- on: {
403
- click: _vm.confirmCustomEvent
404
- }
405
- })
392
+ immediate
393
+ ? h(VxeUIButtonComponent, {
394
+ props: {
395
+ mode: 'text',
396
+ content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
397
+ },
398
+ on: {
399
+ click: _vm.cancelCloseEvent
400
+ }
401
+ })
402
+ : h(VxeUIButtonComponent, {
403
+ props: {
404
+ mode: 'text',
405
+ content: customOpts.resetButtonText || getI18n('vxe.table.customCancel')
406
+ },
407
+ on: {
408
+ click: _vm.cancelCustomEvent
409
+ }
410
+ }),
411
+ immediate
412
+ ? renderEmptyElement($xeTable)
413
+ : h(VxeUIButtonComponent, {
414
+ props: {
415
+ mode: 'text',
416
+ status: 'primary',
417
+ content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm')
418
+ },
419
+ on: {
420
+ click: _vm.confirmCustomEvent
421
+ }
422
+ })
423
+ ])
406
424
  ])
407
- ])
408
- : null
425
+ : null
426
+ ]),
427
+ renderDragTip(h, _vm)
409
428
  ])
410
429
  ]
411
430
  : [])
412
431
  }
413
432
 
414
- const renderPopupPanel = (h: CreateElement, _vm: any) => {
433
+ const renderPopupPanel = (h: CreateElement, $xeTableCustomPanel: VxeTableCustomPanelConstructor) => {
415
434
  const VxeUIModalComponent = VxeUI.getComponent<VxeModalComponent>('VxeModal')
416
435
  const VxeUIDrawerComponent = VxeUI.getComponent<VxeDrawerComponent>('VxeDrawer')
417
436
  const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
418
437
  const VxeUINumberInputComponent = VxeUI.getComponent<VxeInputComponent>('VxeInput')
419
- const $xeTableCustomPanel = _vm
420
438
 
421
- const props = _vm
439
+ const _vm = $xeTableCustomPanel as any
440
+ const props = $xeTableCustomPanel
422
441
 
423
- const $xeTable = _vm.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
442
+ const $xeTable = $xeTableCustomPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
424
443
  const tableProps = $xeTable
425
- const reactData = $xeTable as unknown as TableReactData
444
+ const tableReactData = $xeTable as unknown as TableReactData
426
445
  const $xeGrid = $xeTable.$xeGrid
427
446
 
428
447
  const { customStore } = props
429
448
  const { resizable: allResizable } = tableProps
430
- const { isCustomStatus, customColumnList } = reactData
449
+ const { isCustomStatus, customColumnList } = tableReactData
431
450
  const customOpts = $xeTable.computeCustomOpts
432
451
  const { immediate } = customOpts
433
452
  const columnDragOpts = $xeTable.computeColumnDragOpts
@@ -514,9 +533,9 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
514
533
  title: getI18n('vxe.custom.setting.colVisible')
515
534
  },
516
535
  on: {
517
- click: () => {
536
+ click: (evnt: MouseEvent) => {
518
537
  if (!isDisabled) {
519
- _vm.changeCheckboxOption(column)
538
+ _vm.changeCheckboxOption(column, evnt)
520
539
  }
521
540
  }
522
541
  }
@@ -625,8 +644,8 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
625
644
  ]
626
645
  },
627
646
  on: {
628
- input (value: any) {
629
- _vm.changeFixedOption(column, value)
647
+ change ({ label, $event }: VxeRadioGroupDefines.ChangeEventParams) {
648
+ _vm.changeFixedOption(column, label, $event)
630
649
  }
631
650
  }
632
651
  })
@@ -638,93 +657,97 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
638
657
  })
639
658
  const scopedSlots: Record<string, any> = {
640
659
  default: () => {
641
- if (defaultSlot) {
642
- return $xeTable.callSlot(defaultSlot, params, h)
643
- }
644
660
  return h('div', {
645
- ref: 'bodyElemRef',
646
- class: 'vxe-table-custom-popup--body'
647
- }, [
648
- topSlot
649
- ? h('div', {
650
- class: 'vxe-table-custom-popup--table-top'
651
- }, $xeTable.callSlot(topSlot, params, h))
652
- : renderEmptyElement($xeTable),
653
- h('div', {
654
- class: 'vxe-table-custom-popup--table-wrapper'
655
- }, [
656
- h('table', {}, [
657
- h('colgroup', {}, [
658
- allowVisible
659
- ? h('col', {
660
- class: 'vxe-table-custom-popup--table-col-seq'
661
- })
662
- : renderEmptyElement($xeTable),
663
- h('col', {
664
- class: 'vxe-table-custom-popup--table-col-title'
665
- }),
666
- allowResizable
667
- ? h('col', {
668
- class: 'vxe-table-custom-popup--table-col-width'
669
- })
661
+ ref: 'refBodyWrapperElem',
662
+ class: 'vxe-table-custom-popup--body-wrapper'
663
+ }, defaultSlot
664
+ ? $xeTable.callSlot(defaultSlot, params, h)
665
+ : [
666
+ h('div', {
667
+ ref: 'refCustomBodyElem',
668
+ class: 'vxe-table-custom-popup--handle-wrapper'
669
+ }, [
670
+ topSlot
671
+ ? h('div', {
672
+ class: 'vxe-table-custom-popup--table-top'
673
+ }, $xeTable.callSlot(topSlot, params, h))
670
674
  : renderEmptyElement($xeTable),
671
- allowFixed
672
- ? h('col', {
673
- class: 'vxe-table-custom-popup--table-col-fixed'
674
- })
675
- : renderEmptyElement($xeTable)
676
- ]),
677
- h('thead', {}, [
678
- h('tr', {}, [
679
- allowVisible
680
- ? h('th', {}, [
681
- h('div', {
682
- class: ['vxe-table-custom--checkbox-option', {
683
- 'is--checked': isAllChecked,
684
- 'is--indeterminate': isAllIndeterminate
685
- }],
686
- attrs: {
687
- title: getI18n('vxe.table.allTitle')
688
- },
689
- on: {
690
- click: _vm.allOptionEvent
691
- }
675
+ h('div', {
676
+ class: 'vxe-table-custom-popup--table-wrapper'
677
+ }, [
678
+ h('table', {}, [
679
+ h('colgroup', {}, [
680
+ allowVisible
681
+ ? h('col', {
682
+ class: 'vxe-table-custom-popup--table-col-seq'
683
+ })
684
+ : renderEmptyElement($xeTable),
685
+ h('col', {
686
+ class: 'vxe-table-custom-popup--table-col-title'
687
+ }),
688
+ allowResizable
689
+ ? h('col', {
690
+ class: 'vxe-table-custom-popup--table-col-width'
691
+ })
692
+ : renderEmptyElement($xeTable),
693
+ allowFixed
694
+ ? h('col', {
695
+ class: 'vxe-table-custom-popup--table-col-fixed'
696
+ })
697
+ : renderEmptyElement($xeTable)
698
+ ]),
699
+ h('thead', {}, [
700
+ h('tr', {}, [
701
+ allowVisible
702
+ ? h('th', {}, [
703
+ h('div', {
704
+ class: ['vxe-table-custom--checkbox-option', {
705
+ 'is--checked': isAllChecked,
706
+ 'is--indeterminate': isAllIndeterminate
707
+ }],
708
+ attrs: {
709
+ title: getI18n('vxe.table.allTitle')
710
+ },
711
+ on: {
712
+ click: _vm.allOptionEvent
713
+ }
692
714
 
693
- }, [
694
- h('span', {
695
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
696
- }),
697
- h('span', {
698
- class: 'vxe-checkbox--label'
699
- }, getI18n('vxe.toolbar.customAll'))
715
+ }, [
716
+ h('span', {
717
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
718
+ }),
719
+ h('span', {
720
+ class: 'vxe-checkbox--label'
721
+ }, getI18n('vxe.toolbar.customAll'))
722
+ ])
723
+ ])
724
+ : renderEmptyElement($xeTable),
725
+ h('th', {}, getI18n('vxe.custom.setting.colTitle')),
726
+ allowResizable
727
+ ? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
728
+ : renderEmptyElement($xeTable),
729
+ allowFixed
730
+ ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize]))
731
+ : renderEmptyElement($xeTable)
700
732
  ])
701
- ])
702
- : renderEmptyElement($xeTable),
703
- h('th', {}, getI18n('vxe.custom.setting.colTitle')),
704
- allowResizable
705
- ? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
706
- : renderEmptyElement($xeTable),
707
- allowFixed
708
- ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize]))
709
- : renderEmptyElement($xeTable)
710
- ])
711
- ]),
712
- h('transition-group', {
713
- class: 'vxe-table-custom--panel-list',
714
- props: {
715
- tag: 'tbody',
716
- name: 'vxe-table-custom--list'
717
- }
718
- }, trVNs)
733
+ ]),
734
+ h('transition-group', {
735
+ class: 'vxe-table-custom--panel-list',
736
+ props: {
737
+ tag: 'tbody',
738
+ name: 'vxe-table-custom--list'
739
+ }
740
+ }, trVNs)
741
+ ])
742
+ ]),
743
+ bottomSlot
744
+ ? h('div', {
745
+ class: 'vxe-table-custom-popup--table-bottom'
746
+ }, $xeTable.callSlot(bottomSlot, params, h))
747
+ : renderEmptyElement($xeTable),
748
+ renderDragTip(h, _vm)
749
+ ])
719
750
  ])
720
- ]),
721
- bottomSlot
722
- ? h('div', {
723
- class: 'vxe-table-custom-popup--table-bottom'
724
- }, $xeTable.callSlot(bottomSlot, params, h))
725
- : renderEmptyElement($xeTable),
726
- renderDragTip(h, _vm)
727
- ])
728
751
  },
729
752
  footer: () => {
730
753
  if (footerSlot) {
@@ -841,29 +864,50 @@ export default {
841
864
  default: () => ({})
842
865
  }
843
866
  },
867
+ provide () {
868
+ const $xeTableCustomPanel = this
869
+
870
+ return {
871
+ $xeTableCustomPanel
872
+ }
873
+ },
844
874
  inject: {
845
875
  $xeTable: {
846
876
  default: null
847
877
  }
848
878
  },
849
879
  data () {
880
+ const reactData: TableCustomPanelReactData = {
881
+ dragCol: null,
882
+ dragGroup: null,
883
+ dragValues: null,
884
+ dragTipText: ''
885
+ }
886
+
887
+ const internalData: TableCustomPanelInternalData = {
888
+ // prevDragCol: undefined,
889
+ // prevDragToChild: false,
890
+ // prevDragPos: null
891
+ }
892
+
850
893
  return {
851
- prevDragCol: undefined,
852
- prevDragToChild: false,
853
- prevDragPos: null
894
+ reactData,
895
+ internalData
854
896
  }
855
897
  },
856
898
  computed: {
857
899
  },
858
- created (this: any) {
900
+ created () {
901
+ const $xeTableCustomPanel = this as any
902
+
859
903
  const VxeUIModalComponent = VxeUI.getComponent<VxeModalComponent>('VxeModal')
860
904
  const VxeUIDrawerComponent = VxeUI.getComponent<VxeDrawerComponent>('VxeDrawer')
861
905
  const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
862
906
  const VxeUINumberInputComponent = VxeUI.getComponent<VxeInputComponent>('VxeNumberInput')
863
907
  const VxeUIRadioGroupComponent = VxeUI.getComponent<VxeRadioGroupComponent>('VxeRadioGroup')
864
908
 
865
- this.$nextTick(() => {
866
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
909
+ $xeTableCustomPanel.$nextTick(() => {
910
+ const $xeTable = $xeTableCustomPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
867
911
 
868
912
  const { customOpts } = $xeTable
869
913
  const { mode } = customOpts
@@ -884,27 +928,31 @@ export default {
884
928
  }
885
929
  })
886
930
  },
887
- render (this: any, h: CreateElement) {
888
- const $xeTable = this.$xeTable
931
+ render (h: CreateElement) {
932
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
933
+ const $xeTable = $xeTableCustomPanel.$xeTable
889
934
 
890
935
  const customOpts = $xeTable.computeCustomOpts
891
936
  if (['modal', 'drawer', 'popup'].includes(`${customOpts.mode}`)) {
892
- return renderPopupPanel(h, this)
937
+ return renderPopupPanel(h, $xeTableCustomPanel)
893
938
  }
894
- return renderSimplePanel(h, this)
939
+ return renderSimplePanel(h, $xeTableCustomPanel)
895
940
  },
896
941
  methods: {
897
942
  handleWrapperMouseenterEvent (evnt: any) {
898
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
943
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
944
+ const $xeTable = $xeTableCustomPanel.$xeTable
899
945
 
900
946
  const { customStore } = this
901
947
  customStore.activeWrapper = true
902
948
  $xeTable.customOpenEvent(evnt)
903
949
  },
904
950
  handleWrapperMouseleaveEvent (evnt: any) {
905
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
951
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
952
+ const $xeTable = $xeTableCustomPanel.$xeTable
953
+ const props = $xeTableCustomPanel
906
954
 
907
- const { customStore } = this
955
+ const { customStore } = props
908
956
  customStore.activeWrapper = false
909
957
  setTimeout(() => {
910
958
  if (!customStore.activeBtn && !customStore.activeWrapper) {
@@ -915,36 +963,40 @@ export default {
915
963
  getStoreData () {
916
964
  return {}
917
965
  },
918
- confirmCustomEvent ({ $event }: any) {
919
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
920
- const reactData = $xeTable as unknown as TableReactData
966
+ confirmCustomEvent ({ $event }: VxeButtonDefines.ClickEventParams) {
967
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
968
+ const $xeTable = $xeTableCustomPanel.$xeTable
969
+ const tableReactData = $xeTable as unknown as TableReactData
921
970
 
922
- reactData.isCustomStatus = true
971
+ tableReactData.isCustomStatus = true
923
972
  $xeTable.saveCustom()
924
973
  $xeTable.closeCustom()
925
974
  $xeTable.emitCustomEvent('confirm', $event)
926
975
  },
927
- cancelCloseEvent ({ $event }: any) {
928
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
976
+ cancelCloseEvent ({ $event }: VxeButtonDefines.ClickEventParams) {
977
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
978
+ const $xeTable = $xeTableCustomPanel.$xeTable
929
979
 
930
980
  $xeTable.closeCustom()
931
981
  $xeTable.emitCustomEvent('close', $event)
932
982
  },
933
- cancelCustomEvent ({ $event }: any) {
934
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
983
+ cancelCustomEvent ({ $event }: VxeButtonDefines.ClickEventParams) {
984
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
985
+ const $xeTable = $xeTableCustomPanel.$xeTable
935
986
 
936
987
  $xeTable.cancelCustom()
937
988
  $xeTable.closeCustom()
938
989
  $xeTable.emitCustomEvent('cancel', $event)
939
990
  },
940
- handleResetCustomEvent (evnt: any) {
941
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
991
+ handleResetCustomEvent (evnt: Event) {
992
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
993
+ const $xeTable = $xeTableCustomPanel.$xeTable
942
994
 
943
995
  $xeTable.resetCustom(true)
944
996
  $xeTable.closeCustom()
945
997
  $xeTable.emitCustomEvent('reset', evnt)
946
998
  },
947
- resetCustomEvent (evnt: any) {
999
+ resetCustomEvent (evnt: Event) {
948
1000
  if (VxeUI.modal) {
949
1001
  VxeUI.modal.confirm({
950
1002
  content: getI18n('vxe.custom.cstmConfirmRestore'),
@@ -959,26 +1011,12 @@ export default {
959
1011
  this.handleResetCustomEvent(evnt)
960
1012
  }
961
1013
  },
962
- resetPopupCustomEvent (evnt: any) {
963
- if (VxeUI.modal) {
964
- VxeUI.modal.confirm({
965
- content: getI18n('vxe.custom.cstmConfirmRestore'),
966
- className: 'vxe-table--ignore-clear',
967
- escClosable: true
968
- }).then(type => {
969
- if (type === 'confirm') {
970
- this.resetCustomEvent(evnt)
971
- }
972
- })
973
- } else {
974
- this.resetCustomEvent(evnt)
975
- }
976
- },
977
- handleOptionCheck (column: any) {
978
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
979
- const reactData = $xeTable as unknown as TableReactData
1014
+ handleOptionCheck (column: VxeTableDefines.ColumnInfo) {
1015
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
1016
+ const $xeTable = $xeTableCustomPanel.$xeTable
1017
+ const tableReactData = $xeTable as unknown as TableReactData
980
1018
 
981
- const { customColumnList } = reactData
1019
+ const { customColumnList } = tableReactData
982
1020
  const matchObj = XEUtils.findTree(customColumnList, item => item === column) as any
983
1021
  if (matchObj && matchObj.parent) {
984
1022
  const { parent } = matchObj
@@ -989,9 +1027,10 @@ export default {
989
1027
  }
990
1028
  }
991
1029
  },
992
- changeCheckboxOption (column: any) {
993
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
994
- const reactData = $xeTable as unknown as TableReactData
1030
+ changeCheckboxOption (column: VxeTableDefines.ColumnInfo, evnt: MouseEvent) {
1031
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
1032
+ const $xeTable = $xeTableCustomPanel.$xeTable
1033
+ const tableReactData = $xeTable as unknown as TableReactData
995
1034
 
996
1035
  const customOpts = $xeTable.computeCustomOpts
997
1036
  const isChecked = !column.renderVisible
@@ -1001,7 +1040,7 @@ export default {
1001
1040
  item.renderVisible = isChecked
1002
1041
  item.halfVisible = false
1003
1042
  })
1004
- reactData.isCustomStatus = true
1043
+ tableReactData.isCustomStatus = true
1005
1044
  $xeTable.handleCustom()
1006
1045
  $xeTable.saveCustomStore('update:visible')
1007
1046
  } else {
@@ -1012,66 +1051,104 @@ export default {
1012
1051
  }
1013
1052
  this.handleOptionCheck(column)
1014
1053
  $xeTable.checkCustomStatus()
1054
+ $xeTable.dispatchEvent('custom-visible-change', { column, checked: isChecked }, evnt)
1015
1055
  },
1016
1056
  changeColumnWidth (column: VxeTableDefines.ColumnInfo) {
1017
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
1018
- const reactData = $xeTable as unknown as TableReactData
1057
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
1058
+ const $xeTable = $xeTableCustomPanel.$xeTable
1059
+ const tableReactData = $xeTable as unknown as TableReactData
1019
1060
 
1020
1061
  const customOpts = $xeTable.computeCustomOpts
1021
1062
  if (customOpts.immediate) {
1022
1063
  if (column.renderResizeWidth !== column.renderWidth) {
1023
1064
  column.resizeWidth = column.renderResizeWidth
1024
1065
  column.renderWidth = column.renderResizeWidth
1025
- reactData.isCustomStatus = true
1066
+ tableReactData.isCustomStatus = true
1026
1067
  $xeTable.handleCustom()
1027
1068
  $xeTable.saveCustomStore('update:width')
1028
1069
  }
1029
1070
  }
1030
1071
  },
1031
- changeFixedOption (column: any, colFixed: any) {
1032
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
1033
- const reactData = $xeTable as unknown as TableReactData
1072
+ changeFixedOption (column: VxeTableDefines.ColumnInfo, colFixed: VxeColumnPropTypes.Fixed, evnt: Event) {
1073
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
1074
+ const $xeTable = $xeTableCustomPanel.$xeTable
1075
+ const tableReactData = $xeTable as unknown as TableReactData
1034
1076
 
1035
1077
  const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
1036
1078
  const customOpts = $xeTable.computeCustomOpts
1079
+ let targetFixed: VxeColumnPropTypes.Fixed = null
1037
1080
  if (customOpts.immediate) {
1038
1081
  if (column.renderFixed === colFixed) {
1082
+ targetFixed = ''
1039
1083
  XEUtils.eachTree([column], col => {
1040
1084
  col.fixed = ''
1041
1085
  col.renderFixed = ''
1042
1086
  })
1043
1087
  } else {
1044
1088
  if (!isMaxFixedColumn || column.renderFixed) {
1089
+ targetFixed = colFixed
1045
1090
  XEUtils.eachTree([column], col => {
1046
1091
  col.fixed = colFixed
1047
1092
  col.renderFixed = colFixed
1048
1093
  })
1049
1094
  }
1050
1095
  }
1051
- reactData.isCustomStatus = true
1096
+ tableReactData.isCustomStatus = true
1052
1097
  $xeTable.handleCustom()
1053
1098
  $xeTable.saveCustomStore('update:fixed')
1054
1099
  } else {
1055
1100
  if (column.renderFixed === colFixed) {
1101
+ targetFixed = ''
1056
1102
  XEUtils.eachTree([column], col => {
1057
1103
  col.renderFixed = ''
1058
1104
  })
1059
1105
  } else {
1060
1106
  if (!isMaxFixedColumn || column.renderFixed) {
1107
+ targetFixed = colFixed
1061
1108
  XEUtils.eachTree([column], col => {
1062
1109
  col.renderFixed = colFixed
1063
1110
  })
1064
1111
  }
1065
1112
  }
1066
1113
  }
1114
+ if (!targetFixed !== null) {
1115
+ $xeTable.dispatchEvent('custom-fixed-change', { column, fixed: targetFixed }, evnt)
1116
+ }
1067
1117
  },
1068
- allOptionEvent () {
1069
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
1118
+ allOptionEvent (evnt: MouseEvent) {
1119
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
1120
+ const $xeTable = $xeTableCustomPanel.$xeTable
1121
+ const tableReactData = $xeTable as unknown as TableReactData
1070
1122
 
1123
+ const { customStore } = tableReactData
1124
+ const isAll = !customStore.isAll
1071
1125
  $xeTable.toggleCustomAllCheckbox()
1126
+ $xeTable.dispatchEvent('custom-visible-all', { checked: isAll }, evnt)
1127
+ },
1128
+ updateColDropTipContent () {
1129
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
1130
+ const $xeTable = $xeTableCustomPanel.$xeTable
1131
+ const customPanelReactData = $xeTableCustomPanel.reactData
1132
+
1133
+ const { dragCol } = customPanelReactData
1134
+ const columnDragOpts = $xeTable.computeColumnDragOpts
1135
+ const { tooltipMethod } = columnDragOpts
1136
+ let tipContent = ''
1137
+ if (tooltipMethod) {
1138
+ const dtParams = {
1139
+ $table: $xeTable,
1140
+ column: dragCol as VxeTableDefines.ColumnInfo
1141
+ }
1142
+ tipContent = `${tooltipMethod(dtParams) || ''}`
1143
+ } else {
1144
+ tipContent = getI18n('vxe.custom.cstmDragTarget', [dragCol && dragCol.type !== 'html' ? dragCol.getTitle() : ''])
1145
+ }
1146
+ customPanelReactData.dragTipText = tipContent
1072
1147
  },
1073
1148
  sortMousedownEvent (evnt: MouseEvent) {
1074
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
1149
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
1150
+ const $xeTable = $xeTableCustomPanel.$xeTable
1151
+ const customPanelReactData = $xeTableCustomPanel.reactData
1075
1152
 
1076
1153
  const btnEl = evnt.currentTarget as HTMLElement
1077
1154
  const cellEl = btnEl.parentElement as HTMLElement
@@ -1080,42 +1157,59 @@ export default {
1080
1157
  const colid = trEl.getAttribute('colid')
1081
1158
  const column = $xeTable.getColumnById(colid)
1082
1159
  trEl.draggable = true
1083
- this.dragCol = column
1160
+ customPanelReactData.dragCol = column
1161
+ this.updateColDropTipContent()
1084
1162
  addClass(trEl, 'active--drag-origin')
1085
1163
  },
1086
1164
  sortMouseupEvent (evnt: MouseEvent) {
1165
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
1166
+ const customPanelReactData = $xeTableCustomPanel.reactData
1167
+
1087
1168
  const btnEl = evnt.currentTarget as HTMLElement
1088
1169
  const cellEl = btnEl.parentElement as HTMLElement
1089
1170
  const tdEl = cellEl.parentElement as HTMLElement
1090
1171
  const trEl = tdEl.parentElement as HTMLElement
1091
- hideDropTip(this)
1172
+ hideDropTip($xeTableCustomPanel)
1092
1173
  trEl.draggable = false
1093
- this.dragCol = null
1174
+ customPanelReactData.dragCol = null
1094
1175
  removeClass(trEl, 'active--drag-origin')
1095
1176
  },
1096
1177
  sortDragstartEvent (evnt: any) {
1178
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
1179
+ const customPanelReactData = $xeTableCustomPanel.reactData
1180
+
1097
1181
  if (evnt.dataTransfer) {
1098
1182
  evnt.dataTransfer.setDragImage(getTpImg(), 0, 0)
1099
1183
  }
1184
+ customPanelReactData.dragGroup = null
1185
+ customPanelReactData.dragValues = null
1100
1186
  },
1101
1187
  sortDragendEvent (evnt: any) {
1102
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
1188
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
1189
+ const $xeTable = $xeTableCustomPanel.$xeTable
1103
1190
  const tableProps = $xeTable
1104
- const reactData = $xeTable as unknown as TableReactData
1105
- const internalData = $xeTable as unknown as TableInternalData
1106
-
1107
- const { dragCol, prevDragPos, prevDragCol, prevDragToChild } = this
1191
+ const tableReactData = $xeTable as unknown as TableReactData
1192
+ const tableInternalData = $xeTable as unknown as TableInternalData
1193
+ const customPanelReactData = $xeTableCustomPanel.reactData
1194
+ const customPanelInternalData = $xeTableCustomPanel.internalData
1108
1195
 
1109
1196
  const { mouseConfig } = tableProps
1110
- const { customColumnList } = reactData
1111
- const { collectColumn } = internalData
1197
+ const { customColumnList } = tableReactData
1198
+ const { collectColumn } = tableInternalData
1112
1199
  const customOpts = $xeTable.computeCustomOpts
1113
1200
  const { immediate } = customOpts
1114
1201
  const trEl = evnt.currentTarget as HTMLElement
1115
1202
  const columnDragOpts = $xeTable.computeColumnDragOpts
1116
1203
  const { isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts
1204
+ const { dragCol, dragGroup, dragValues } = customPanelReactData
1205
+ const { prevDragCol, prevDragPos, prevDragToChild } = customPanelInternalData
1117
1206
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0
1118
- if (prevDragCol && dragCol) {
1207
+
1208
+ if (dragGroup || dragValues) {
1209
+ if ($xeTable.handlePivotTableAggregatePanelDragendEvent) {
1210
+ $xeTable.handlePivotTableAggregatePanelDragendEvent(evnt)
1211
+ }
1212
+ } else if (prevDragCol && dragCol) {
1119
1213
  // 判断是否有拖动
1120
1214
  if (prevDragCol !== dragCol) {
1121
1215
  const dragColumn: VxeTableDefines.ColumnInfo = dragCol
@@ -1247,7 +1341,7 @@ export default {
1247
1341
  customColumnList.splice(nafIndex + dragOffsetIndex, 0, dragColumn)
1248
1342
  }
1249
1343
 
1250
- reactData.isDragColMove = true
1344
+ tableReactData.isDragColMove = true
1251
1345
  if (mouseConfig) {
1252
1346
  if ($xeTable.clearSelected) {
1253
1347
  $xeTable.clearSelected()
@@ -1271,7 +1365,7 @@ export default {
1271
1365
  }, evnt)
1272
1366
 
1273
1367
  if (immediate) {
1274
- reactData.customColumnList = collectColumn.slice(0)
1368
+ tableReactData.customColumnList = collectColumn.slice(0)
1275
1369
  $xeTable.handleColDragSwapColumn()
1276
1370
  }
1277
1371
  }).catch(() => {
@@ -1279,18 +1373,22 @@ export default {
1279
1373
  }
1280
1374
  }
1281
1375
 
1282
- hideDropTip(this)
1283
- this.dragCol.value = null
1376
+ hideDropTip($xeTableCustomPanel)
1377
+ customPanelReactData.dragCol = null
1378
+ customPanelReactData.dragGroup = null
1379
+ customPanelReactData.dragValues = null
1284
1380
  trEl.draggable = false
1285
1381
  trEl.removeAttribute('drag-pos')
1286
1382
  removeClass(trEl, 'active--drag-target')
1287
1383
  removeClass(trEl, 'active--drag-origin')
1288
1384
  },
1289
1385
  sortDragoverEvent (evnt: DragEvent) {
1290
- const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
1291
-
1292
- const { dragCol } = this
1386
+ const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
1387
+ const $xeTable = $xeTableCustomPanel.$xeTable
1388
+ const customPanelReactData = $xeTableCustomPanel.reactData
1389
+ const customPanelInternalData = $xeTableCustomPanel.internalData
1293
1390
 
1391
+ const { dragCol } = customPanelReactData
1294
1392
  const customOpts = $xeTable.computeCustomOpts
1295
1393
  const { immediate } = customOpts
1296
1394
  const columnDragOpts = $xeTable.computeColumnDragOpts
@@ -1299,6 +1397,8 @@ export default {
1299
1397
  const isControlKey = hasControlKey(evnt)
1300
1398
  const colid = optEl.getAttribute('colid')
1301
1399
  const column = $xeTable.getColumnById(colid)
1400
+ customPanelReactData.dragGroup = null
1401
+ customPanelReactData.dragValues = null
1302
1402
  // 是否移入有效列
1303
1403
  if (column && (isCrossDrag || column.level === 1)) {
1304
1404
  evnt.preventDefault()
@@ -1310,13 +1410,13 @@ export default {
1310
1410
  (!immediate && column.level > 1) ||
1311
1411
  column.renderFixed
1312
1412
  ) {
1313
- showDropTip(this, evnt, optEl, false, dragPos)
1413
+ showDropTip($xeTableCustomPanel, evnt, optEl, false, dragPos)
1314
1414
  return
1315
1415
  }
1316
- this.prevDragToChild = !!((isCrossDrag && isToChildDrag) && isControlKey && immediate)
1317
- this.prevDragCol = column
1318
- this.prevDragPos = dragPos
1319
- showDropTip(this, evnt, optEl, true, dragPos)
1416
+ customPanelInternalData.prevDragToChild = !!((isCrossDrag && isToChildDrag) && isControlKey && immediate)
1417
+ customPanelInternalData.prevDragCol = column
1418
+ customPanelInternalData.prevDragPos = dragPos
1419
+ showDropTip($xeTableCustomPanel, evnt, optEl, true, dragPos)
1320
1420
  }
1321
1421
  }
1322
1422
  } as any