vxe-table 3.19.39 → 3.20.0-beta.1

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 (109) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.esm.js +2 -1
  3. package/es/index.min.css +1 -1
  4. package/es/style.css +1 -1
  5. package/es/style.min.css +1 -1
  6. package/es/table/module/custom/mixin.js +6 -4
  7. package/es/table/module/custom/panel.js +806 -799
  8. package/es/table/module/edit/mixin.js +43 -31
  9. package/es/table/module/export/export-panel.js +511 -458
  10. package/es/table/module/export/import-panel.js +224 -192
  11. package/es/table/module/keyboard/mixin.js +2 -2
  12. package/es/table/module/menu/panel.js +165 -161
  13. package/es/table/module/validator/mixin.js +255 -236
  14. package/es/table/src/body.js +2 -1
  15. package/es/table/src/cell.js +2 -2
  16. package/es/table/src/methods.js +33 -43
  17. package/es/table/src/table.js +13 -249
  18. package/es/table/src/util.js +242 -0
  19. package/es/table/style.css +23 -50
  20. package/es/table/style.min.css +1 -1
  21. package/es/ui/index.js +2 -2
  22. package/es/ui/src/dom.js +22 -0
  23. package/es/ui/src/log.js +1 -1
  24. package/es/vxe-table/style.css +23 -50
  25. package/es/vxe-table/style.min.css +1 -1
  26. package/lib/index.common.js +2 -1
  27. package/lib/index.css +1 -1
  28. package/lib/index.min.css +1 -1
  29. package/lib/index.umd.js +3640 -4790
  30. package/lib/index.umd.min.js +1 -1
  31. package/lib/style.css +1 -1
  32. package/lib/style.min.css +1 -1
  33. package/lib/table/module/custom/mixin.js +6 -4
  34. package/lib/table/module/custom/mixin.min.js +1 -1
  35. package/lib/table/module/custom/panel.js +693 -685
  36. package/lib/table/module/custom/panel.min.js +1 -1
  37. package/lib/table/module/edit/mixin.js +47 -31
  38. package/lib/table/module/edit/mixin.min.js +1 -1
  39. package/lib/table/module/export/export-panel.js +450 -384
  40. package/lib/table/module/export/export-panel.min.js +1 -1
  41. package/lib/table/module/export/import-panel.js +200 -159
  42. package/lib/table/module/export/import-panel.min.js +1 -1
  43. package/lib/table/module/keyboard/mixin.js +2 -2
  44. package/lib/table/module/keyboard/mixin.min.js +1 -1
  45. package/lib/table/module/menu/panel.js +119 -114
  46. package/lib/table/module/menu/panel.min.js +1 -1
  47. package/lib/table/module/validator/mixin.js +271 -259
  48. package/lib/table/module/validator/mixin.min.js +1 -1
  49. package/lib/table/src/body.js +2 -1
  50. package/lib/table/src/body.min.js +1 -1
  51. package/lib/table/src/cell.js +2 -2
  52. package/lib/table/src/cell.min.js +1 -1
  53. package/lib/table/src/methods.js +33 -45
  54. package/lib/table/src/methods.min.js +1 -1
  55. package/lib/table/src/table.js +12 -248
  56. package/lib/table/src/table.min.js +1 -1
  57. package/lib/table/src/util.js +243 -0
  58. package/lib/table/src/util.min.js +1 -1
  59. package/lib/table/style/style.css +23 -50
  60. package/lib/table/style/style.min.css +1 -1
  61. package/lib/ui/index.js +2 -2
  62. package/lib/ui/index.min.js +1 -1
  63. package/lib/ui/src/dom.js +22 -0
  64. package/lib/ui/src/dom.min.js +1 -1
  65. package/lib/ui/src/log.js +1 -1
  66. package/lib/ui/src/log.min.js +1 -1
  67. package/lib/v-x-e-table/index.js +2 -1
  68. package/lib/v-x-e-table/index.min.js +1 -1
  69. package/lib/vxe-colgroup/index.js +2 -1
  70. package/lib/vxe-colgroup/index.min.js +1 -1
  71. package/lib/vxe-column/index.js +2 -1
  72. package/lib/vxe-column/index.min.js +1 -1
  73. package/lib/vxe-grid/index.js +2 -1
  74. package/lib/vxe-grid/index.min.js +1 -1
  75. package/lib/vxe-table/index.js +2 -1
  76. package/lib/vxe-table/index.min.js +1 -1
  77. package/lib/vxe-table/style/style.css +23 -50
  78. package/lib/vxe-table/style/style.min.css +1 -1
  79. package/lib/vxe-toolbar/index.js +2 -1
  80. package/lib/vxe-toolbar/index.min.js +1 -1
  81. package/lib/vxe-ui/index.js +2 -1
  82. package/lib/vxe-ui/index.min.js +1 -1
  83. package/lib/vxe-v-x-e-table/index.js +2 -1
  84. package/lib/vxe-v-x-e-table/index.min.js +1 -1
  85. package/package.json +1 -1
  86. package/packages/table/module/custom/mixin.ts +7 -4
  87. package/packages/table/module/custom/panel.ts +846 -839
  88. package/packages/table/module/edit/mixin.ts +55 -35
  89. package/packages/table/module/export/export-panel.ts +545 -469
  90. package/packages/table/module/export/import-panel.ts +245 -202
  91. package/packages/table/module/filter/panel.ts +4 -18
  92. package/packages/table/module/keyboard/mixin.ts +2 -2
  93. package/packages/table/module/menu/panel.ts +171 -163
  94. package/packages/table/module/validator/mixin.ts +279 -240
  95. package/packages/table/src/body.ts +2 -1
  96. package/packages/table/src/cell.ts +2 -2
  97. package/packages/table/src/methods.ts +43 -45
  98. package/packages/table/src/table.ts +14 -260
  99. package/packages/table/src/util.ts +254 -0
  100. package/packages/ui/index.ts +1 -1
  101. package/packages/ui/src/dom.ts +22 -0
  102. package/styles/components/table.scss +5 -2
  103. package/styles/theme/base.scss +2 -1
  104. /package/es/{iconfont.1767145426781.ttf → iconfont.1767492234857.ttf} +0 -0
  105. /package/es/{iconfont.1767145426781.woff → iconfont.1767492234857.woff} +0 -0
  106. /package/es/{iconfont.1767145426781.woff2 → iconfont.1767492234857.woff2} +0 -0
  107. /package/lib/{iconfont.1767145426781.ttf → iconfont.1767492234857.ttf} +0 -0
  108. /package/lib/{iconfont.1767145426781.woff → iconfont.1767492234857.woff} +0 -0
  109. /package/lib/{iconfont.1767145426781.woff2 → iconfont.1767492234857.woff2} +0 -0
@@ -1,4 +1,5 @@
1
- import { CreateElement, VNode } from 'vue'
1
+ import { CreateElement, VNode, PropType } from 'vue'
2
+ import { defineVxeComponent } from '../../../ui/src/comp'
2
3
  import { VxeUI } from '../../../ui'
3
4
  import { formatText } from '../../../ui/src/utils'
4
5
  import { getTpImg, addClass, removeClass, hasControlKey } from '../../../ui/src/dom'
@@ -65,819 +66,12 @@ function hideDropTip ($xeTableCustomPanel: VxeTableCustomPanelConstructor) {
65
66
  }
66
67
  }
67
68
 
68
- const renderDragTip = (h: CreateElement, $xeTableCustomPanel: VxeTableCustomPanelConstructor) => {
69
- const $xeTable = $xeTableCustomPanel.$xeTable
70
- const customPanelReactData = $xeTableCustomPanel.reactData
71
-
72
- const { dragTipText } = customPanelReactData
73
- const columnDragOpts = $xeTable.computeColumnDragOpts
74
- return h('div', {}, [
75
- h('div', {
76
- ref: 'refDragLineElem',
77
- class: ['vxe-table-custom-popup--drag-line', {
78
- 'is--guides': columnDragOpts.showGuidesStatus
79
- }]
80
- }),
81
- h('div', {
82
- ref: 'refDragTipElem',
83
- class: 'vxe-table-custom-popup--drag-tip'
84
- }, [
85
- h('div', {
86
- class: 'vxe-table-custom-popup--drag-tip-wrapper'
87
- }, [
88
- h('div', {
89
- class: 'vxe-table-custom-popup--drag-tip-status'
90
- }, [
91
- h('span', {
92
- class: ['vxe-table-custom-popup--drag-tip-normal-status', getIcon().TABLE_DRAG_STATUS_ROW]
93
- }),
94
- h('span', {
95
- class: ['vxe-table-custom-popup--drag-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
96
- }),
97
- h('span', {
98
- class: ['vxe-table-custom-popup--drag-tip-group-status', getIcon().TABLE_DRAG_STATUS_AGG_GROUP]
99
- }),
100
- h('span', {
101
- class: ['vxe-table-custom-popup--drag-tip-values-status', getIcon().TABLE_DRAG_STATUS_AGG_VALUES]
102
- }),
103
- h('span', {
104
- class: ['vxe-table-custom-popup--drag-tip-disabled-status', getIcon().TABLE_DRAG_DISABLED]
105
- })
106
- ]),
107
- h('div', {
108
- class: 'vxe-table-custom-popup--drag-tip-content'
109
- }, `${dragTipText || ''}`)
110
- ])
111
- ])
112
- ])
113
- }
114
-
115
- const renderSimplePanel = (h: CreateElement, _vm: any) => {
116
- const VxeUIButtonComponent = VxeUI.getComponent('VxeButton')
117
-
118
- const props = _vm
119
-
120
- const $xeTable = _vm.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
121
- const tableProps = $xeTable
122
- const tableReactData = $xeTable as unknown as TableReactData
123
- const $xeGrid = $xeTable.$xeGrid
124
- const $xeGantt = $xeTable.$xeGantt
125
-
126
- const { customStore } = props
127
- const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps
128
- const { isCustomStatus, customColumnList } = tableReactData
129
- const customOpts = $xeTable.computeCustomOpts
130
- const { immediate } = customOpts
131
- const columnDragOpts = $xeTable.computeColumnDragOpts
132
- const { maxHeight } = customStore
133
- const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts
134
- const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
135
- const { isCrossDrag } = columnDragOpts
136
- const slots = customOpts.slots || {}
137
- const headerSlot = slots.header
138
- const topSlot = slots.top
139
- const bottomSlot = slots.bottom
140
- const defaultSlot = slots.default
141
- const footerSlot = slots.footer
142
- const colVNs: any[] = []
143
- const customWrapperOns: any = {}
144
- const isAllChecked = customStore.isAll
145
- const isAllIndeterminate = customStore.isIndeterminate
146
- // hover 触发
147
- if (trigger === 'hover') {
148
- customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent
149
- customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent
150
- }
151
- const params = {
152
- $table: $xeTable,
153
- $grid: $xeGrid,
154
- $gantt: $xeGantt,
155
- columns: customColumnList,
156
- isAllChecked,
157
- isAllIndeterminate,
158
- isCustomStatus
159
- }
160
- XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
161
- const isVisible = visibleMethod ? visibleMethod({ $table: $xeTable, column }) : true
162
- if (isVisible) {
163
- const isChecked = column.renderVisible
164
- const isIndeterminate = column.halfVisible
165
- const isColGroup = column.children && column.children.length
166
- const colTitle = formatText(column.getTitle(), 1)
167
- const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false
168
- const isHidden = !isChecked
169
- colVNs.push(
170
- h('li', {
171
- key: column.id,
172
- attrs: {
173
- colid: column.id
174
- },
175
- class: ['vxe-table-custom--option', `level--${column.level}`, {
176
- 'is--hidden': isDisabled || isHidden,
177
- 'is--group': isColGroup
178
- }],
179
- on: {
180
- dragstart: _vm.sortDragstartEvent,
181
- dragend: _vm.sortDragendEvent,
182
- dragover: _vm.sortDragoverEvent
183
- }
184
- }, [
185
- allowVisible
186
- ? h('div', {
187
- class: ['vxe-table-custom--checkbox-option', {
188
- 'is--checked': isChecked,
189
- 'is--indeterminate': isIndeterminate,
190
- 'is--disabled': isDisabled
191
- }],
192
- attrs: {
193
- title: getI18n('vxe.custom.setting.colVisible')
194
- },
195
- on: {
196
- click: (evnt: MouseEvent) => {
197
- if (!isDisabled) {
198
- _vm.changeCheckboxOption(column, evnt)
199
- }
200
- }
201
- }
202
- }, [
203
- h('span', {
204
- class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
205
- })
206
- ])
207
- : renderEmptyElement($xeTable),
208
- h('div', {
209
- class: 'vxe-table-custom--name-option'
210
- }, [
211
- allowSort && ((isCrossDrag ? immediate : false) || column.level === 1)
212
- ? h('div', {
213
- class: 'vxe-table-custom--sort-option'
214
- }, [
215
- h('span', {
216
- class: ['vxe-table-custom--sort-btn', {
217
- 'is--disabled': isHidden
218
- }],
219
- attrs: {
220
- title: getI18n('vxe.custom.setting.sortHelpTip')
221
- },
222
- on: isHidden
223
- ? {}
224
- : {
225
- mousedown: _vm.sortMousedownEvent,
226
- mouseup: _vm.sortMouseupEvent
227
- }
228
- }, [
229
- h('i', {
230
- class: getIcon().TABLE_CUSTOM_SORT
231
- })
232
- ])
233
- ])
234
- : renderEmptyElement($xeTable),
235
- column.type === 'html'
236
- ? h('div', {
237
- key: '1',
238
- class: 'vxe-table-custom--checkbox-label',
239
- domProps: {
240
- innerHTML: colTitle
241
- }
242
- })
243
- : h('div', {
244
- key: '0',
245
- class: 'vxe-table-custom--checkbox-label',
246
- attrs: {
247
- title: colTitle
248
- }
249
- }, colTitle)
250
- ]),
251
- !parent && allowFixed
252
- ? h('div', {
253
- class: 'vxe-table-custom--fixed-option'
254
- }, [
255
- h(VxeUIButtonComponent, {
256
- props: {
257
- mode: 'text',
258
- icon: column.renderFixed === 'left' ? getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_LEFT,
259
- status: column.renderFixed === 'left' ? 'primary' : '',
260
- disabled: isHidden || (isMaxFixedColumn && !column.renderFixed),
261
- title: getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
262
- },
263
- on: {
264
- click: ({ $event }: VxeButtonDefines.ClickEventParams) => {
265
- _vm.changeFixedOption(column, 'left', $event)
266
- }
267
- }
268
- }),
269
- h(VxeUIButtonComponent, {
270
- props: {
271
- mode: 'text',
272
- icon: column.renderFixed === 'right' ? getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_RIGHT,
273
- status: column.renderFixed === 'right' ? 'primary' : '',
274
- disabled: isHidden || (isMaxFixedColumn && !column.renderFixed),
275
- title: getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
276
- },
277
- on: {
278
- click: ({ $event }: VxeButtonDefines.ClickEventParams) => {
279
- _vm.changeFixedOption(column, 'right', $event)
280
- }
281
- }
282
- })
283
- ])
284
- : renderEmptyElement($xeTable)
285
- ])
286
- )
287
- }
288
- })
289
- return h('div', {
290
- ref: 'refElem',
291
- key: 'simple',
292
- class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
293
- 'is--active': customStore.visible
294
- }],
295
- style: maxHeight && !['left', 'right'].includes(placement || '')
296
- ? {
297
- maxHeight: `${maxHeight}px`
298
- }
299
- : {}
300
- }, customStore.visible
301
- ? [
302
- h('div', {
303
- ref: 'refBodyWrapperElem',
304
- class: 'vxe-table-custom-simple--body-wrapper'
305
- }, [
306
- !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel
307
- ? h($xeTable.getPivotTableAggregateSimplePanel(), {
308
- props: {
309
- customStore
310
- }
311
- })
312
- : renderEmptyElement($xeTable),
313
- h('div', {
314
- ref: 'refCustomBodyElem',
315
- class: 'vxe-table-custom--handle-wrapper'
316
- }, [
317
- h('div', {
318
- class: 'vxe-table-custom--header'
319
- }, headerSlot
320
- ? $xeTable.callSlot(headerSlot, params, h)
321
- : [
322
- h('ul', {
323
- class: 'vxe-table-custom--panel-list'
324
- }, [
325
- h('li', {
326
- class: 'vxe-table-custom--option'
327
- }, [
328
- allowVisible
329
- ? h('div', {
330
- class: ['vxe-table-custom--checkbox-option', {
331
- 'is--checked': isAllChecked,
332
- 'is--indeterminate': isAllIndeterminate
333
- }],
334
- attrs: {
335
- title: getI18n('vxe.table.allTitle')
336
- },
337
- on: {
338
- click: _vm.allOptionEvent
339
- }
340
- }, [
341
- h('span', {
342
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
343
- }),
344
- h('span', {
345
- class: 'vxe-checkbox--label'
346
- }, getI18n('vxe.toolbar.customAll'))
347
- ])
348
- : h('span', {
349
- class: 'vxe-checkbox--label'
350
- }, getI18n('vxe.table.customTitle'))
351
- ])
352
- ])
353
- ]),
354
- h('div', {
355
- class: 'vxe-table-custom--body'
356
- }, [
357
- topSlot
358
- ? h('div', {
359
- class: 'vxe-table-custom--panel-top'
360
- }, $xeTable.callSlot(topSlot, params, h))
361
- : renderEmptyElement($xeTable),
362
- defaultSlot
363
- ? h('div', {
364
- class: 'vxe-table-custom--panel-body'
365
- }, $xeTable.callSlot(defaultSlot, params, h))
366
- : h('transition-group', {
367
- class: 'vxe-table-custom--panel-list',
368
- props: {
369
- name: 'vxe-table-custom--list',
370
- tag: 'ul'
371
- },
372
- on: customWrapperOns
373
- }, colVNs),
374
- bottomSlot
375
- ? h('div', {
376
- class: 'vxe-table-custom--panel-bottom'
377
- }, $xeTable.callSlot(bottomSlot, params, h))
378
- : renderEmptyElement($xeTable)
379
- ]),
380
- customOpts.showFooter
381
- ? h('div', {
382
- class: 'vxe-table-custom--footer'
383
- }, footerSlot
384
- ? $xeTable.callSlot(footerSlot, params, h)
385
- : [
386
- h('div', {
387
- class: 'vxe-table-custom--footer-buttons'
388
- }, [
389
- h(VxeUIButtonComponent, {
390
- props: {
391
- mode: 'text',
392
- content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
393
- disabled: !isCustomStatus
394
- },
395
- on: {
396
- click: _vm.resetCustomEvent
397
- }
398
- }),
399
- immediate
400
- ? h(VxeUIButtonComponent, {
401
- props: {
402
- mode: 'text',
403
- content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
404
- },
405
- on: {
406
- click: _vm.cancelCloseEvent
407
- }
408
- })
409
- : h(VxeUIButtonComponent, {
410
- props: {
411
- mode: 'text',
412
- content: customOpts.resetButtonText || getI18n('vxe.table.customCancel')
413
- },
414
- on: {
415
- click: _vm.cancelCustomEvent
416
- }
417
- }),
418
- immediate
419
- ? renderEmptyElement($xeTable)
420
- : h(VxeUIButtonComponent, {
421
- props: {
422
- mode: 'text',
423
- status: 'primary',
424
- content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm')
425
- },
426
- on: {
427
- click: _vm.confirmCustomEvent
428
- }
429
- })
430
- ])
431
- ])
432
- : null
433
- ]),
434
- renderDragTip(h, _vm)
435
- ])
436
- ]
437
- : [])
438
- }
439
-
440
- const renderPopupPanel = (h: CreateElement, $xeTableCustomPanel: VxeTableCustomPanelConstructor) => {
441
- const VxeUIModalComponent = VxeUI.getComponent('VxeModal')
442
- const VxeUIDrawerComponent = VxeUI.getComponent('VxeDrawer')
443
- const VxeUIButtonComponent = VxeUI.getComponent('VxeButton')
444
- const VxeUINumberInputComponent = VxeUI.getComponent('VxeNumberInput')
445
-
446
- const _vm = $xeTableCustomPanel as any
447
- const props = $xeTableCustomPanel
448
-
449
- const $xeTable = $xeTableCustomPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
450
- const tableProps = $xeTable
451
- const tableReactData = $xeTable as unknown as TableReactData
452
- const $xeGrid = $xeTable.$xeGrid
453
- const $xeGantt = $xeTable.$xeGantt
454
-
455
- const { customStore } = props
456
- const { treeConfig, rowGroupConfig, aggregateConfig, resizable: allResizable } = tableProps
457
- const { isCustomStatus, customColumnList } = tableReactData
458
- const customOpts = $xeTable.computeCustomOpts
459
- const { immediate } = customOpts
460
- const columnDragOpts = $xeTable.computeColumnDragOpts
461
- const { mode, modalOptions, drawerOptions, allowVisible, allowSort, allowFixed, allowResizable, checkMethod, visibleMethod } = customOpts
462
- const columnOpts = $xeTable.computeColumnOpts
463
- const { maxFixedSize } = columnOpts
464
- const resizableOpts = $xeTable.computeResizableOpts
465
- const { minWidth: reMinWidth, maxWidth: reMaxWidth } = resizableOpts
466
- const modalOpts = Object.assign({}, modalOptions)
467
- const drawerOpts = Object.assign({}, drawerOptions)
468
- const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
469
- const { isCrossDrag } = columnDragOpts
470
- const slots = customOpts.slots || {}
471
- const headerSlot = slots.header
472
- const topSlot = slots.top
473
- const bottomSlot = slots.bottom
474
- const defaultSlot = slots.default
475
- const footerSlot = slots.footer
476
- const trVNs: VNode[] = []
477
- const isAllChecked = customStore.isAll
478
- const isAllIndeterminate = customStore.isIndeterminate
479
- const params = {
480
- $table: $xeTable,
481
- $grid: $xeGrid,
482
- $gantt: $xeGantt,
483
- columns: customColumnList,
484
- isAllChecked,
485
- isAllIndeterminate,
486
- isCustomStatus
487
- }
488
- XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
489
- const isVisible = visibleMethod ? visibleMethod({ $table: $xeTable, column }) : true
490
- if (isVisible) {
491
- // 默认继承调整宽度
492
- let customMinWidth = 0
493
- let customMaxWidth = 0
494
- if (allowResizable) {
495
- const resizeParams = {
496
- $table: $xeTable,
497
- column,
498
- columnIndex: index,
499
- $columnIndex: index,
500
- $rowIndex: -1
501
- }
502
- if (reMinWidth) {
503
- customMinWidth = XEUtils.toNumber(XEUtils.isFunction(reMinWidth) ? reMinWidth(resizeParams) : reMinWidth)
504
- }
505
- if (reMaxWidth) {
506
- customMaxWidth = XEUtils.toNumber(XEUtils.isFunction(reMaxWidth) ? reMaxWidth(resizeParams) : reMaxWidth)
507
- }
508
- }
509
-
510
- const isChecked = column.renderVisible
511
- const isIndeterminate = column.halfVisible
512
- const colTitle = formatText(column.getTitle(), 1)
513
- const isColGroup = column.children && column.children.length
514
- const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false
515
- const isHidden = !isChecked
516
- trVNs.push(
517
- h('tr', {
518
- key: column.id,
519
- attrs: {
520
- colid: column.id
521
- },
522
- class: [`vxe-table-custom-popup--row level--${column.level}`, {
523
- 'is--group': isColGroup
524
- }],
525
- on: {
526
- dragstart: _vm.sortDragstartEvent,
527
- dragend: _vm.sortDragendEvent,
528
- dragover: _vm.sortDragoverEvent
529
- }
530
- }, [
531
- allowVisible
532
- ? h('td', {
533
- class: 'vxe-table-custom-popup--column-item col--visible'
534
- }, [
535
- h('div', {
536
- class: ['vxe-table-custom--checkbox-option', {
537
- 'is--checked': isChecked,
538
- 'is--indeterminate': isIndeterminate,
539
- 'is--disabled': isDisabled
540
- }],
541
- attrs: {
542
- title: getI18n('vxe.custom.setting.colVisible')
543
- },
544
- on: {
545
- click: (evnt: MouseEvent) => {
546
- if (!isDisabled) {
547
- _vm.changeCheckboxOption(column, evnt)
548
- }
549
- }
550
- }
551
- }, [
552
- h('span', {
553
- class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
554
- })
555
- ])
556
- ])
557
- : renderEmptyElement($xeTable),
558
- h('td', {
559
- class: 'vxe-table-custom-popup--column-item col--name'
560
- }, [
561
- h('div', {
562
- class: 'vxe-table-custom-popup--name'
563
- }, [
564
- allowSort
565
- ? ((isCrossDrag ? immediate : false) || column.level === 1
566
- ? h('div', {
567
- class: ['vxe-table-custom-popup--column-sort-btn', {
568
- 'is--disabled': isHidden
569
- }],
570
- attrs: {
571
- title: getI18n('vxe.custom.setting.sortHelpTip')
572
- },
573
- on: (isHidden
574
- ? {}
575
- : {
576
- mousedown: _vm.sortMousedownEvent,
577
- mouseup: _vm.sortMouseupEvent
578
- })
579
- }, [
580
- h('i', {
581
- class: getIcon().TABLE_CUSTOM_SORT
582
- })
583
- ])
584
- : h('div', {
585
- class: 'vxe-table-custom-popup--column-sort-placeholder'
586
- }))
587
- : renderEmptyElement($xeTable),
588
- column.type === 'html'
589
- ? h('div', {
590
- key: '1',
591
- class: 'vxe-table-custom-popup--title',
592
- domProps: {
593
- innerHTML: colTitle
594
- }
595
- })
596
- : h('div', {
597
- key: '0',
598
- class: 'vxe-table-custom-popup--title',
599
- attrs: {
600
- title: colTitle
601
- }
602
- }, colTitle)
603
- ])
604
- ]),
605
- allowResizable
606
- ? h('td', {
607
- class: 'vxe-table-custom-popup--column-item col--resizable'
608
- }, [
609
- (
610
- (column.children && column.children.length) ||
611
- !(XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
612
- )
613
- ? h('span', '-')
614
- : (VxeUINumberInputComponent
615
- ? h(VxeUINumberInputComponent, {
616
- props: {
617
- type: 'integer',
618
- immediate: false,
619
- disabled: isHidden,
620
- value: column.renderResizeWidth,
621
- min: customMinWidth || undefined,
622
- max: customMaxWidth || undefined
623
- },
624
- on: {
625
- modelValue (value: any) {
626
- column.renderResizeWidth = Math.max(0, Number(value))
627
- },
628
- change () {
629
- _vm.changeColumnWidth(column)
630
- }
631
- }
632
- })
633
- : renderEmptyElement($xeTableCustomPanel)
634
- )
635
- ])
636
- : renderEmptyElement($xeTable),
637
- allowFixed
638
- ? h('td', {
639
- class: 'vxe-table-custom-popup--column-item col--fixed'
640
- }, [
641
- parent
642
- ? h('span', '-')
643
- : h('vxe-radio-group', {
644
- props: {
645
- value: column.renderFixed || '',
646
- type: 'button',
647
- size: 'mini',
648
- disabled: isHidden,
649
- options: [
650
- { label: getI18n('vxe.custom.setting.fixedLeft'), value: 'left', disabled: isHidden || isMaxFixedColumn },
651
- { label: getI18n('vxe.custom.setting.fixedUnset'), value: '', disabled: isHidden },
652
- { label: getI18n('vxe.custom.setting.fixedRight'), value: 'right', disabled: isHidden || isMaxFixedColumn }
653
- ]
654
- },
655
- on: {
656
- change ({ label, $event }: VxeRadioGroupDefines.ChangeEventParams) {
657
- _vm.changeFixedOption(column, label, $event)
658
- }
659
- }
660
- })
661
- ])
662
- : renderEmptyElement($xeTable)
663
- ])
664
- )
665
- }
666
- })
667
- const scopedSlots: Record<string, any> = {
668
- default: () => {
669
- return h('div', {
670
- ref: 'refBodyWrapperElem',
671
- class: 'vxe-table-custom-popup--body-wrapper'
672
- }, defaultSlot
673
- ? $xeTable.callSlot(defaultSlot, params, h)
674
- : [
675
- h('div', {
676
- ref: 'refCustomBodyElem',
677
- class: 'vxe-table-custom-popup--handle-wrapper'
678
- }, [
679
- topSlot
680
- ? h('div', {
681
- class: 'vxe-table-custom-popup--table-top'
682
- }, $xeTable.callSlot(topSlot, params, h))
683
- : renderEmptyElement($xeTable),
684
- h('div', {
685
- class: 'vxe-table-custom-popup--table-wrapper'
686
- }, [
687
- h('table', {}, [
688
- h('colgroup', {}, [
689
- allowVisible
690
- ? h('col', {
691
- class: 'vxe-table-custom-popup--table-col-seq'
692
- })
693
- : renderEmptyElement($xeTable),
694
- h('col', {
695
- class: 'vxe-table-custom-popup--table-col-title'
696
- }),
697
- allowResizable
698
- ? h('col', {
699
- class: 'vxe-table-custom-popup--table-col-width'
700
- })
701
- : renderEmptyElement($xeTable),
702
- allowFixed
703
- ? h('col', {
704
- class: 'vxe-table-custom-popup--table-col-fixed'
705
- })
706
- : renderEmptyElement($xeTable)
707
- ]),
708
- h('thead', {}, [
709
- h('tr', {}, [
710
- allowVisible
711
- ? h('th', {}, [
712
- h('div', {
713
- class: ['vxe-table-custom--checkbox-option', {
714
- 'is--checked': isAllChecked,
715
- 'is--indeterminate': isAllIndeterminate
716
- }],
717
- attrs: {
718
- title: getI18n('vxe.table.allTitle')
719
- },
720
- on: {
721
- click: _vm.allOptionEvent
722
- }
723
-
724
- }, [
725
- h('span', {
726
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
727
- }),
728
- h('span', {
729
- class: 'vxe-checkbox--label'
730
- }, getI18n('vxe.toolbar.customAll'))
731
- ])
732
- ])
733
- : renderEmptyElement($xeTable),
734
- h('th', {}, getI18n('vxe.custom.setting.colTitle')),
735
- allowResizable
736
- ? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
737
- : renderEmptyElement($xeTable),
738
- allowFixed
739
- ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize]))
740
- : renderEmptyElement($xeTable)
741
- ])
742
- ]),
743
- h('transition-group', {
744
- class: 'vxe-table-custom--panel-list',
745
- props: {
746
- tag: 'tbody',
747
- name: 'vxe-table-custom--list'
748
- }
749
- }, trVNs)
750
- ])
751
- ]),
752
- bottomSlot
753
- ? h('div', {
754
- class: 'vxe-table-custom-popup--table-bottom'
755
- }, $xeTable.callSlot(bottomSlot, params, h))
756
- : renderEmptyElement($xeTable),
757
- renderDragTip(h, _vm)
758
- ]),
759
- !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel
760
- ? h($xeTable.getPivotTableAggregatePopupPanel(), {
761
- props: {
762
- customStore
763
- }
764
- })
765
- : renderEmptyElement($xeTable)
766
- ])
767
- },
768
- footer: () => {
769
- if (footerSlot) {
770
- return $xeTable.callSlot(footerSlot, params, h)
771
- }
772
- return h('div', {
773
- class: 'vxe-table-custom-popup--footer'
774
- }, [
775
- h(VxeUIButtonComponent, {
776
- props: {
777
- content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore'),
778
- disabled: !isCustomStatus
779
- },
780
- on: {
781
- click: _vm.resetCustomEvent
782
- }
783
- }),
784
- immediate
785
- ? h(VxeUIButtonComponent, {
786
- props: {
787
- content: customOpts.resetButtonText || getI18n('vxe.table.customClose')
788
- },
789
- on: {
790
- click: _vm.cancelCloseEvent
791
- }
792
- })
793
- : h(VxeUIButtonComponent, {
794
- props: {
795
- content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
796
- },
797
- on: {
798
- click: _vm.cancelCustomEvent
799
- }
800
- }),
801
- immediate
802
- ? renderEmptyElement($xeTable)
803
- : h(VxeUIButtonComponent, {
804
- props: {
805
- status: 'primary',
806
- content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
807
- },
808
- on: {
809
- click: _vm.confirmCustomEvent
810
- }
811
- })
812
- ])
813
- }
814
- }
815
- if (headerSlot) {
816
- scopedSlots.header = () => $xeTable.callSlot(headerSlot, params, h)
817
- }
818
- if (mode === 'drawer') {
819
- return VxeUIDrawerComponent
820
- ? h(VxeUIDrawerComponent, {
821
- key: 'drawer',
822
- props: {
823
- className: ['vxe-table-custom-drawer-wrapper', 'vxe-table--ignore-clear', drawerOpts.className || ''].join(' '),
824
- value: customStore.visible,
825
- title: drawerOpts.title || getI18n('vxe.custom.cstmTitle'),
826
- width: drawerOpts.width || Math.min(880, Math.floor(document.documentElement.clientWidth * 0.6)),
827
- position: drawerOpts.position,
828
- resize: !!drawerOpts.resize,
829
- escClosable: !!drawerOpts.escClosable,
830
- maskClosable: !!drawerOpts.maskClosable,
831
- destroyOnClose: true,
832
- showFooter: true
833
- },
834
- on: {
835
- input (value: any) {
836
- customStore.visible = value
837
- }
838
- },
839
- scopedSlots
840
- })
841
- : renderEmptyElement($xeTableCustomPanel)
842
- }
843
- return VxeUIModalComponent
844
- ? h(VxeUIModalComponent, {
845
- key: 'modal',
846
- props: {
847
- className: ['vxe-table-custom-popup-wrapper', 'vxe-table--ignore-clear', modalOpts.className || ''].join(' '),
848
- value: customStore.visible,
849
- title: modalOpts.title || getI18n('vxe.custom.cstmTitle'),
850
- width: modalOpts.width || Math.min(880, document.documentElement.clientWidth),
851
- minWidth: modalOpts.minWidth || 700,
852
- height: modalOpts.height || Math.min(680, document.documentElement.clientHeight),
853
- minHeight: modalOpts.minHeight || 400,
854
- showZoom: modalOpts.showZoom,
855
- showMaximize: modalOpts.showMaximize,
856
- showMinimize: modalOpts.showMinimize,
857
- mask: modalOpts.mask,
858
- lockView: modalOpts.lockView,
859
- resize: modalOpts.resize,
860
- escClosable: !!modalOpts.escClosable,
861
- maskClosable: !!modalOpts.maskClosable,
862
- destroyOnClose: true,
863
- showFooter: true
864
- },
865
- on: {
866
- input (value: any) {
867
- customStore.visible = value
868
- }
869
- },
870
- scopedSlots
871
- })
872
- : renderEmptyElement($xeTableCustomPanel)
873
- }
874
-
875
- export default {
69
+ export default /* define-vxe-component start */ defineVxeComponent({
876
70
  name: 'VxeTableCustomPanel',
877
71
  props: {
878
72
  customStore: {
879
- type: Object,
880
- default: () => ({})
73
+ type: Object as PropType<VxeTableDefines.VxeTableCustomStoreObj>,
74
+ default: () => ({} as VxeTableDefines.VxeTableCustomStoreObj)
881
75
  }
882
76
  },
883
77
  provide () {
@@ -914,9 +108,12 @@ export default {
914
108
  }
915
109
  },
916
110
  computed: {
111
+ ...({} as {
112
+ $xeTable(): VxeTableConstructor & VxeTablePrivateMethods
113
+ })
917
114
  },
918
115
  created () {
919
- const $xeTableCustomPanel = this as any
116
+ const $xeTableCustomPanel = this
920
117
 
921
118
  const VxeUIModalComponent = VxeUI.getComponent('VxeModal')
922
119
  const VxeUIDrawerComponent = VxeUI.getComponent('VxeDrawer')
@@ -946,27 +143,18 @@ export default {
946
143
  }
947
144
  })
948
145
  },
949
- render (h: CreateElement) {
950
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
951
- const $xeTable = $xeTableCustomPanel.$xeTable
952
-
953
- const customOpts = $xeTable.computeCustomOpts
954
- if (['modal', 'drawer', 'popup'].includes(`${customOpts.mode}`)) {
955
- return renderPopupPanel(h, $xeTableCustomPanel)
956
- }
957
- return renderSimplePanel(h, $xeTableCustomPanel)
958
- },
959
146
  methods: {
960
147
  handleWrapperMouseenterEvent (evnt: any) {
961
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
148
+ const $xeTableCustomPanel = this
149
+ const props = $xeTableCustomPanel
962
150
  const $xeTable = $xeTableCustomPanel.$xeTable
963
151
 
964
- const { customStore } = this
152
+ const { customStore } = props
965
153
  customStore.activeWrapper = true
966
154
  $xeTable.customOpenEvent(evnt)
967
155
  },
968
156
  handleWrapperMouseleaveEvent (evnt: any) {
969
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
157
+ const $xeTableCustomPanel = this
970
158
  const $xeTable = $xeTableCustomPanel.$xeTable
971
159
  const props = $xeTableCustomPanel
972
160
 
@@ -982,7 +170,7 @@ export default {
982
170
  return {}
983
171
  },
984
172
  confirmCustomEvent ({ $event }: VxeButtonDefines.ClickEventParams) {
985
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
173
+ const $xeTableCustomPanel = this
986
174
  const $xeTable = $xeTableCustomPanel.$xeTable
987
175
  const tableReactData = $xeTable as unknown as TableReactData
988
176
 
@@ -993,14 +181,14 @@ export default {
993
181
  $xeTable.emitCustomEvent('close', $event)
994
182
  },
995
183
  cancelCloseEvent ({ $event }: VxeButtonDefines.ClickEventParams) {
996
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
184
+ const $xeTableCustomPanel = this
997
185
  const $xeTable = $xeTableCustomPanel.$xeTable
998
186
 
999
187
  $xeTable.closeCustom()
1000
188
  $xeTable.emitCustomEvent('close', $event)
1001
189
  },
1002
190
  cancelCustomEvent ({ $event }: VxeButtonDefines.ClickEventParams) {
1003
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
191
+ const $xeTableCustomPanel = this
1004
192
  const $xeTable = $xeTableCustomPanel.$xeTable
1005
193
 
1006
194
  $xeTable.cancelCustom()
@@ -1009,7 +197,7 @@ export default {
1009
197
  $xeTable.emitCustomEvent('close', $event)
1010
198
  },
1011
199
  handleResetCustomEvent (evnt: Event) {
1012
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
200
+ const $xeTableCustomPanel = this
1013
201
  const $xeTable = $xeTableCustomPanel.$xeTable
1014
202
 
1015
203
  $xeTable.resetCustom(true)
@@ -1033,7 +221,7 @@ export default {
1033
221
  }
1034
222
  },
1035
223
  handleOptionCheck (column: VxeTableDefines.ColumnInfo) {
1036
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
224
+ const $xeTableCustomPanel = this
1037
225
  const $xeTable = $xeTableCustomPanel.$xeTable
1038
226
  const tableReactData = $xeTable as unknown as TableReactData
1039
227
 
@@ -1049,7 +237,7 @@ export default {
1049
237
  }
1050
238
  },
1051
239
  changeCheckboxOption (column: VxeTableDefines.ColumnInfo, evnt: MouseEvent) {
1052
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
240
+ const $xeTableCustomPanel = this
1053
241
  const $xeTable = $xeTableCustomPanel.$xeTable
1054
242
  const tableReactData = $xeTable as unknown as TableReactData
1055
243
 
@@ -1075,7 +263,7 @@ export default {
1075
263
  $xeTable.dispatchEvent('custom-visible-change', { column, checked: isChecked }, evnt)
1076
264
  },
1077
265
  changeColumnWidth (column: VxeTableDefines.ColumnInfo) {
1078
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
266
+ const $xeTableCustomPanel = this
1079
267
  const $xeTable = $xeTableCustomPanel.$xeTable
1080
268
  const tableReactData = $xeTable as unknown as TableReactData
1081
269
 
@@ -1091,7 +279,7 @@ export default {
1091
279
  }
1092
280
  },
1093
281
  changeFixedOption (column: VxeTableDefines.ColumnInfo, colFixed: VxeColumnPropTypes.Fixed, evnt: Event) {
1094
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
282
+ const $xeTableCustomPanel = this
1095
283
  const $xeTable = $xeTableCustomPanel.$xeTable
1096
284
  const tableReactData = $xeTable as unknown as TableReactData
1097
285
 
@@ -1137,7 +325,7 @@ export default {
1137
325
  }
1138
326
  },
1139
327
  allOptionEvent (evnt: MouseEvent) {
1140
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
328
+ const $xeTableCustomPanel = this
1141
329
  const $xeTable = $xeTableCustomPanel.$xeTable
1142
330
  const tableReactData = $xeTable as unknown as TableReactData
1143
331
 
@@ -1147,7 +335,7 @@ export default {
1147
335
  $xeTable.dispatchEvent('custom-visible-all', { checked: isAll }, evnt)
1148
336
  },
1149
337
  updateColDropTipContent () {
1150
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
338
+ const $xeTableCustomPanel = this
1151
339
  const $xeTable = $xeTableCustomPanel.$xeTable
1152
340
  const customPanelReactData = $xeTableCustomPanel.reactData
1153
341
 
@@ -1167,7 +355,7 @@ export default {
1167
355
  customPanelReactData.dragTipText = tipContent
1168
356
  },
1169
357
  sortMousedownEvent (evnt: MouseEvent) {
1170
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
358
+ const $xeTableCustomPanel = this
1171
359
  const $xeTable = $xeTableCustomPanel.$xeTable
1172
360
  const customPanelReactData = $xeTableCustomPanel.reactData
1173
361
 
@@ -1200,7 +388,7 @@ export default {
1200
388
  removeClass(trEl, 'active--drag-origin')
1201
389
  },
1202
390
  sortDragstartEvent (evnt: any) {
1203
- const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
391
+ const $xeTableCustomPanel = this
1204
392
  const customPanelInternalData = $xeTableCustomPanel.internalData
1205
393
 
1206
394
  if (evnt.dataTransfer) {
@@ -1446,6 +634,825 @@ export default {
1446
634
  customPanelInternalData.prevDragPos = dragPos
1447
635
  showDropTip($xeTableCustomPanel, evnt, optEl, true, dragPos)
1448
636
  }
637
+ },
638
+
639
+ renderDragTip (h: CreateElement) {
640
+ const $xeTableCustomPanel = this
641
+ const $xeTable = $xeTableCustomPanel.$xeTable
642
+ const customPanelReactData = $xeTableCustomPanel.reactData
643
+
644
+ const { dragTipText } = customPanelReactData
645
+ const columnDragOpts = $xeTable.computeColumnDragOpts
646
+ return h('div', {}, [
647
+ h('div', {
648
+ ref: 'refDragLineElem',
649
+ class: ['vxe-table-custom-popup--drag-line', {
650
+ 'is--guides': columnDragOpts.showGuidesStatus
651
+ }]
652
+ }),
653
+ h('div', {
654
+ ref: 'refDragTipElem',
655
+ class: 'vxe-table-custom-popup--drag-tip'
656
+ }, [
657
+ h('div', {
658
+ class: 'vxe-table-custom-popup--drag-tip-wrapper'
659
+ }, [
660
+ h('div', {
661
+ class: 'vxe-table-custom-popup--drag-tip-status'
662
+ }, [
663
+ h('span', {
664
+ class: ['vxe-table-custom-popup--drag-tip-normal-status', getIcon().TABLE_DRAG_STATUS_ROW]
665
+ }),
666
+ h('span', {
667
+ class: ['vxe-table-custom-popup--drag-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
668
+ }),
669
+ h('span', {
670
+ class: ['vxe-table-custom-popup--drag-tip-group-status', getIcon().TABLE_DRAG_STATUS_AGG_GROUP]
671
+ }),
672
+ h('span', {
673
+ class: ['vxe-table-custom-popup--drag-tip-values-status', getIcon().TABLE_DRAG_STATUS_AGG_VALUES]
674
+ }),
675
+ h('span', {
676
+ class: ['vxe-table-custom-popup--drag-tip-disabled-status', getIcon().TABLE_DRAG_DISABLED]
677
+ })
678
+ ]),
679
+ h('div', {
680
+ class: 'vxe-table-custom-popup--drag-tip-content'
681
+ }, `${dragTipText || ''}`)
682
+ ])
683
+ ])
684
+ ])
685
+ },
686
+ renderSimplePanel (h: CreateElement) {
687
+ const VxeUIButtonComponent = VxeUI.getComponent('VxeButton')
688
+
689
+ const $xeTableCustomPanel = this
690
+ const props = $xeTableCustomPanel
691
+ const $xeTable = $xeTableCustomPanel.$xeTable
692
+
693
+ const tableProps = $xeTable
694
+ const tableReactData = $xeTable as unknown as TableReactData
695
+ const $xeGrid = $xeTable.$xeGrid
696
+ const $xeGantt = $xeTable.$xeGantt
697
+
698
+ const { customStore } = props
699
+ const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps
700
+ const { isCustomStatus, customColumnList } = tableReactData
701
+ const customOpts = $xeTable.computeCustomOpts
702
+ const { immediate } = customOpts
703
+ const columnDragOpts = $xeTable.computeColumnDragOpts
704
+ const { maxHeight } = customStore
705
+ const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts
706
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
707
+ const { isCrossDrag } = columnDragOpts
708
+ const slots = customOpts.slots || {}
709
+ const headerSlot = slots.header
710
+ const topSlot = slots.top
711
+ const bottomSlot = slots.bottom
712
+ const defaultSlot = slots.default
713
+ const footerSlot = slots.footer
714
+ const colVNs: any[] = []
715
+ const customWrapperOns: any = {}
716
+ const isAllChecked = customStore.isAll
717
+ const isAllIndeterminate = customStore.isIndeterminate
718
+ // hover 触发
719
+ if (trigger === 'hover') {
720
+ customWrapperOns.mouseenter = $xeTableCustomPanel.handleWrapperMouseenterEvent
721
+ customWrapperOns.mouseleave = $xeTableCustomPanel.handleWrapperMouseleaveEvent
722
+ }
723
+ const params = {
724
+ $table: $xeTable,
725
+ $grid: $xeGrid,
726
+ $gantt: $xeGantt,
727
+ columns: customColumnList,
728
+ isAllChecked,
729
+ isAllIndeterminate,
730
+ isCustomStatus
731
+ }
732
+ XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
733
+ const isVisible = visibleMethod ? visibleMethod({ $table: $xeTable, column }) : true
734
+ if (isVisible) {
735
+ const isChecked = column.renderVisible
736
+ const isIndeterminate = column.halfVisible
737
+ const isColGroup = column.children && column.children.length
738
+ const colTitle = formatText(column.getTitle(), 1)
739
+ const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false
740
+ const isHidden = !isChecked
741
+ colVNs.push(
742
+ h('li', {
743
+ key: column.id,
744
+ attrs: {
745
+ colid: column.id
746
+ },
747
+ class: ['vxe-table-custom--option', `level--${column.level}`, {
748
+ 'is--hidden': isDisabled || isHidden,
749
+ 'is--group': isColGroup
750
+ }],
751
+ on: {
752
+ dragstart: $xeTableCustomPanel.sortDragstartEvent,
753
+ dragend: $xeTableCustomPanel.sortDragendEvent,
754
+ dragover: $xeTableCustomPanel.sortDragoverEvent
755
+ }
756
+ }, [
757
+ allowVisible
758
+ ? h('div', {
759
+ class: ['vxe-table-custom--checkbox-option', {
760
+ 'is--checked': isChecked,
761
+ 'is--indeterminate': isIndeterminate,
762
+ 'is--disabled': isDisabled
763
+ }],
764
+ attrs: {
765
+ title: getI18n('vxe.custom.setting.colVisible')
766
+ },
767
+ on: {
768
+ click: (evnt: MouseEvent) => {
769
+ if (!isDisabled) {
770
+ $xeTableCustomPanel.changeCheckboxOption(column, evnt)
771
+ }
772
+ }
773
+ }
774
+ }, [
775
+ h('span', {
776
+ class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
777
+ })
778
+ ])
779
+ : renderEmptyElement($xeTable),
780
+ h('div', {
781
+ class: 'vxe-table-custom--name-option'
782
+ }, [
783
+ allowSort && ((isCrossDrag ? immediate : false) || column.level === 1)
784
+ ? h('div', {
785
+ class: 'vxe-table-custom--sort-option'
786
+ }, [
787
+ h('span', {
788
+ class: ['vxe-table-custom--sort-btn', {
789
+ 'is--disabled': isHidden
790
+ }],
791
+ attrs: {
792
+ title: getI18n('vxe.custom.setting.sortHelpTip')
793
+ },
794
+ on: isHidden
795
+ ? {}
796
+ : {
797
+ mousedown: $xeTableCustomPanel.sortMousedownEvent,
798
+ mouseup: $xeTableCustomPanel.sortMouseupEvent
799
+ }
800
+ }, [
801
+ h('i', {
802
+ class: getIcon().TABLE_CUSTOM_SORT
803
+ })
804
+ ])
805
+ ])
806
+ : renderEmptyElement($xeTable),
807
+ column.type === 'html'
808
+ ? h('div', {
809
+ key: '1',
810
+ class: 'vxe-table-custom--checkbox-label',
811
+ domProps: {
812
+ innerHTML: colTitle
813
+ }
814
+ })
815
+ : h('div', {
816
+ key: '0',
817
+ class: 'vxe-table-custom--checkbox-label',
818
+ attrs: {
819
+ title: colTitle
820
+ }
821
+ }, colTitle)
822
+ ]),
823
+ !parent && allowFixed
824
+ ? h('div', {
825
+ class: 'vxe-table-custom--fixed-option'
826
+ }, [
827
+ h(VxeUIButtonComponent, {
828
+ props: {
829
+ mode: 'text',
830
+ icon: column.renderFixed === 'left' ? getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_LEFT,
831
+ status: column.renderFixed === 'left' ? 'primary' : '',
832
+ disabled: isHidden || (isMaxFixedColumn && !column.renderFixed),
833
+ title: getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
834
+ },
835
+ on: {
836
+ click: ({ $event }: VxeButtonDefines.ClickEventParams) => {
837
+ $xeTableCustomPanel.changeFixedOption(column, 'left', $event)
838
+ }
839
+ }
840
+ }),
841
+ h(VxeUIButtonComponent, {
842
+ props: {
843
+ mode: 'text',
844
+ icon: column.renderFixed === 'right' ? getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_RIGHT,
845
+ status: column.renderFixed === 'right' ? 'primary' : '',
846
+ disabled: isHidden || (isMaxFixedColumn && !column.renderFixed),
847
+ title: getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
848
+ },
849
+ on: {
850
+ click: ({ $event }: VxeButtonDefines.ClickEventParams) => {
851
+ $xeTableCustomPanel.changeFixedOption(column, 'right', $event)
852
+ }
853
+ }
854
+ })
855
+ ])
856
+ : renderEmptyElement($xeTable)
857
+ ])
858
+ )
859
+ }
860
+ })
861
+ return h('div', {
862
+ ref: 'refElem',
863
+ key: 'simple',
864
+ class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
865
+ 'is--active': customStore.visible
866
+ }],
867
+ style: maxHeight && !['left', 'right'].includes(placement || '')
868
+ ? {
869
+ maxHeight: `${maxHeight}px`
870
+ }
871
+ : {}
872
+ }, customStore.visible
873
+ ? [
874
+ h('div', {
875
+ ref: 'refBodyWrapperElem',
876
+ class: 'vxe-table-custom-simple--body-wrapper'
877
+ }, [
878
+ !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel
879
+ ? h($xeTable.getPivotTableAggregateSimplePanel(), {
880
+ props: {
881
+ customStore
882
+ }
883
+ })
884
+ : renderEmptyElement($xeTable),
885
+ h('div', {
886
+ ref: 'refCustomBodyElem',
887
+ class: 'vxe-table-custom--handle-wrapper'
888
+ }, [
889
+ h('div', {
890
+ class: 'vxe-table-custom--header'
891
+ }, headerSlot
892
+ ? $xeTable.callSlot(headerSlot, params, h)
893
+ : [
894
+ h('ul', {
895
+ class: 'vxe-table-custom--panel-list'
896
+ }, [
897
+ h('li', {
898
+ class: 'vxe-table-custom--option'
899
+ }, [
900
+ allowVisible
901
+ ? h('div', {
902
+ class: ['vxe-table-custom--checkbox-option', {
903
+ 'is--checked': isAllChecked,
904
+ 'is--indeterminate': isAllIndeterminate
905
+ }],
906
+ attrs: {
907
+ title: getI18n('vxe.table.allTitle')
908
+ },
909
+ on: {
910
+ click: $xeTableCustomPanel.allOptionEvent
911
+ }
912
+ }, [
913
+ h('span', {
914
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
915
+ }),
916
+ h('span', {
917
+ class: 'vxe-checkbox--label'
918
+ }, getI18n('vxe.toolbar.customAll'))
919
+ ])
920
+ : h('span', {
921
+ class: 'vxe-checkbox--label'
922
+ }, getI18n('vxe.table.customTitle'))
923
+ ])
924
+ ])
925
+ ]),
926
+ h('div', {
927
+ class: 'vxe-table-custom--body'
928
+ }, [
929
+ topSlot
930
+ ? h('div', {
931
+ class: 'vxe-table-custom--panel-top'
932
+ }, $xeTable.callSlot(topSlot, params, h))
933
+ : renderEmptyElement($xeTable),
934
+ defaultSlot
935
+ ? h('div', {
936
+ class: 'vxe-table-custom--panel-body'
937
+ }, $xeTable.callSlot(defaultSlot, params, h))
938
+ : h('transition-group', {
939
+ class: 'vxe-table-custom--panel-list',
940
+ props: {
941
+ name: 'vxe-table-custom--list',
942
+ tag: 'ul'
943
+ },
944
+ on: customWrapperOns
945
+ }, colVNs),
946
+ bottomSlot
947
+ ? h('div', {
948
+ class: 'vxe-table-custom--panel-bottom'
949
+ }, $xeTable.callSlot(bottomSlot, params, h))
950
+ : renderEmptyElement($xeTable)
951
+ ]),
952
+ customOpts.showFooter
953
+ ? h('div', {
954
+ class: 'vxe-table-custom--footer'
955
+ }, footerSlot
956
+ ? $xeTable.callSlot(footerSlot, params, h)
957
+ : [
958
+ h('div', {
959
+ class: 'vxe-table-custom--footer-buttons'
960
+ }, [
961
+ h(VxeUIButtonComponent, {
962
+ props: {
963
+ mode: 'text',
964
+ content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
965
+ disabled: !isCustomStatus
966
+ },
967
+ on: {
968
+ click: $xeTableCustomPanel.resetCustomEvent
969
+ }
970
+ }),
971
+ immediate
972
+ ? h(VxeUIButtonComponent, {
973
+ props: {
974
+ mode: 'text',
975
+ content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
976
+ },
977
+ on: {
978
+ click: $xeTableCustomPanel.cancelCloseEvent
979
+ }
980
+ })
981
+ : h(VxeUIButtonComponent, {
982
+ props: {
983
+ mode: 'text',
984
+ content: customOpts.resetButtonText || getI18n('vxe.table.customCancel')
985
+ },
986
+ on: {
987
+ click: $xeTableCustomPanel.cancelCustomEvent
988
+ }
989
+ }),
990
+ immediate
991
+ ? renderEmptyElement($xeTable)
992
+ : h(VxeUIButtonComponent, {
993
+ props: {
994
+ mode: 'text',
995
+ status: 'primary',
996
+ content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm')
997
+ },
998
+ on: {
999
+ click: $xeTableCustomPanel.confirmCustomEvent
1000
+ }
1001
+ })
1002
+ ])
1003
+ ])
1004
+ : null
1005
+ ]),
1006
+ $xeTableCustomPanel.renderDragTip(h)
1007
+ ])
1008
+ ]
1009
+ : [])
1010
+ },
1011
+ renderPopupPanel (h: CreateElement) {
1012
+ const VxeUIModalComponent = VxeUI.getComponent('VxeModal')
1013
+ const VxeUIDrawerComponent = VxeUI.getComponent('VxeDrawer')
1014
+ const VxeUIButtonComponent = VxeUI.getComponent('VxeButton')
1015
+ const VxeUINumberInputComponent = VxeUI.getComponent('VxeNumberInput')
1016
+
1017
+ const $xeTableCustomPanel = this
1018
+ const props = $xeTableCustomPanel
1019
+ const $xeTable = $xeTableCustomPanel.$xeTable
1020
+ const tableProps = $xeTable
1021
+ const tableReactData = $xeTable as unknown as TableReactData
1022
+ const $xeGrid = $xeTable.$xeGrid
1023
+ const $xeGantt = $xeTable.$xeGantt
1024
+
1025
+ const { customStore } = props
1026
+ const { treeConfig, rowGroupConfig, aggregateConfig, resizable: allResizable } = tableProps
1027
+ const { isCustomStatus, customColumnList } = tableReactData
1028
+ const customOpts = $xeTable.computeCustomOpts
1029
+ const { immediate } = customOpts
1030
+ const columnDragOpts = $xeTable.computeColumnDragOpts
1031
+ const { mode, modalOptions, drawerOptions, allowVisible, allowSort, allowFixed, allowResizable, checkMethod, visibleMethod } = customOpts
1032
+ const columnOpts = $xeTable.computeColumnOpts
1033
+ const { maxFixedSize } = columnOpts
1034
+ const resizableOpts = $xeTable.computeResizableOpts
1035
+ const { minWidth: reMinWidth, maxWidth: reMaxWidth } = resizableOpts
1036
+ const modalOpts = Object.assign({}, modalOptions)
1037
+ const drawerOpts = Object.assign({}, drawerOptions)
1038
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
1039
+ const { isCrossDrag } = columnDragOpts
1040
+ const slots = customOpts.slots || {}
1041
+ const headerSlot = slots.header
1042
+ const topSlot = slots.top
1043
+ const bottomSlot = slots.bottom
1044
+ const defaultSlot = slots.default
1045
+ const footerSlot = slots.footer
1046
+ const trVNs: VNode[] = []
1047
+ const isAllChecked = customStore.isAll
1048
+ const isAllIndeterminate = customStore.isIndeterminate
1049
+ const params = {
1050
+ $table: $xeTable,
1051
+ $grid: $xeGrid,
1052
+ $gantt: $xeGantt,
1053
+ columns: customColumnList,
1054
+ isAllChecked,
1055
+ isAllIndeterminate,
1056
+ isCustomStatus
1057
+ }
1058
+ XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
1059
+ const isVisible = visibleMethod ? visibleMethod({ $table: $xeTable, column }) : true
1060
+ if (isVisible) {
1061
+ // 默认继承调整宽度
1062
+ let customMinWidth = 0
1063
+ let customMaxWidth = 0
1064
+ if (allowResizable) {
1065
+ const resizeParams = {
1066
+ $table: $xeTable,
1067
+ column,
1068
+ columnIndex: index,
1069
+ $columnIndex: index,
1070
+ $rowIndex: -1
1071
+ }
1072
+ if (reMinWidth) {
1073
+ customMinWidth = XEUtils.toNumber(XEUtils.isFunction(reMinWidth) ? reMinWidth(resizeParams) : reMinWidth)
1074
+ }
1075
+ if (reMaxWidth) {
1076
+ customMaxWidth = XEUtils.toNumber(XEUtils.isFunction(reMaxWidth) ? reMaxWidth(resizeParams) : reMaxWidth)
1077
+ }
1078
+ }
1079
+
1080
+ const isChecked = column.renderVisible
1081
+ const isIndeterminate = column.halfVisible
1082
+ const colTitle = formatText(column.getTitle(), 1)
1083
+ const isColGroup = column.children && column.children.length
1084
+ const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false
1085
+ const isHidden = !isChecked
1086
+ trVNs.push(
1087
+ h('tr', {
1088
+ key: column.id,
1089
+ attrs: {
1090
+ colid: column.id
1091
+ },
1092
+ class: [`vxe-table-custom-popup--row level--${column.level}`, {
1093
+ 'is--group': isColGroup
1094
+ }],
1095
+ on: {
1096
+ dragstart: $xeTableCustomPanel.sortDragstartEvent,
1097
+ dragend: $xeTableCustomPanel.sortDragendEvent,
1098
+ dragover: $xeTableCustomPanel.sortDragoverEvent
1099
+ }
1100
+ }, [
1101
+ allowVisible
1102
+ ? h('td', {
1103
+ class: 'vxe-table-custom-popup--column-item col--visible'
1104
+ }, [
1105
+ h('div', {
1106
+ class: ['vxe-table-custom--checkbox-option', {
1107
+ 'is--checked': isChecked,
1108
+ 'is--indeterminate': isIndeterminate,
1109
+ 'is--disabled': isDisabled
1110
+ }],
1111
+ attrs: {
1112
+ title: getI18n('vxe.custom.setting.colVisible')
1113
+ },
1114
+ on: {
1115
+ click: (evnt: MouseEvent) => {
1116
+ if (!isDisabled) {
1117
+ $xeTableCustomPanel.changeCheckboxOption(column, evnt)
1118
+ }
1119
+ }
1120
+ }
1121
+ }, [
1122
+ h('span', {
1123
+ class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
1124
+ })
1125
+ ])
1126
+ ])
1127
+ : renderEmptyElement($xeTable),
1128
+ h('td', {
1129
+ class: 'vxe-table-custom-popup--column-item col--name'
1130
+ }, [
1131
+ h('div', {
1132
+ class: 'vxe-table-custom-popup--name'
1133
+ }, [
1134
+ allowSort
1135
+ ? ((isCrossDrag ? immediate : false) || column.level === 1
1136
+ ? h('div', {
1137
+ class: ['vxe-table-custom-popup--column-sort-btn', {
1138
+ 'is--disabled': isHidden
1139
+ }],
1140
+ attrs: {
1141
+ title: getI18n('vxe.custom.setting.sortHelpTip')
1142
+ },
1143
+ on: (isHidden
1144
+ ? {}
1145
+ : {
1146
+ mousedown: $xeTableCustomPanel.sortMousedownEvent,
1147
+ mouseup: $xeTableCustomPanel.sortMouseupEvent
1148
+ })
1149
+ }, [
1150
+ h('i', {
1151
+ class: getIcon().TABLE_CUSTOM_SORT
1152
+ })
1153
+ ])
1154
+ : h('div', {
1155
+ class: 'vxe-table-custom-popup--column-sort-placeholder'
1156
+ }))
1157
+ : renderEmptyElement($xeTable),
1158
+ column.type === 'html'
1159
+ ? h('div', {
1160
+ key: '1',
1161
+ class: 'vxe-table-custom-popup--title',
1162
+ domProps: {
1163
+ innerHTML: colTitle
1164
+ }
1165
+ })
1166
+ : h('div', {
1167
+ key: '0',
1168
+ class: 'vxe-table-custom-popup--title',
1169
+ attrs: {
1170
+ title: colTitle
1171
+ }
1172
+ }, colTitle)
1173
+ ])
1174
+ ]),
1175
+ allowResizable
1176
+ ? h('td', {
1177
+ class: 'vxe-table-custom-popup--column-item col--resizable'
1178
+ }, [
1179
+ (
1180
+ (column.children && column.children.length) ||
1181
+ !(XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
1182
+ )
1183
+ ? h('span', '-')
1184
+ : (VxeUINumberInputComponent
1185
+ ? h(VxeUINumberInputComponent, {
1186
+ props: {
1187
+ type: 'integer',
1188
+ immediate: false,
1189
+ disabled: isHidden,
1190
+ value: column.renderResizeWidth,
1191
+ min: customMinWidth || undefined,
1192
+ max: customMaxWidth || undefined
1193
+ },
1194
+ on: {
1195
+ modelValue (value: any) {
1196
+ column.renderResizeWidth = Math.max(0, Number(value))
1197
+ },
1198
+ change () {
1199
+ $xeTableCustomPanel.changeColumnWidth(column)
1200
+ }
1201
+ }
1202
+ })
1203
+ : renderEmptyElement($xeTableCustomPanel)
1204
+ )
1205
+ ])
1206
+ : renderEmptyElement($xeTable),
1207
+ allowFixed
1208
+ ? h('td', {
1209
+ class: 'vxe-table-custom-popup--column-item col--fixed'
1210
+ }, [
1211
+ parent
1212
+ ? h('span', '-')
1213
+ : h('vxe-radio-group', {
1214
+ props: {
1215
+ value: column.renderFixed || '',
1216
+ type: 'button',
1217
+ size: 'mini',
1218
+ disabled: isHidden,
1219
+ options: [
1220
+ { label: getI18n('vxe.custom.setting.fixedLeft'), value: 'left', disabled: isHidden || isMaxFixedColumn },
1221
+ { label: getI18n('vxe.custom.setting.fixedUnset'), value: '', disabled: isHidden },
1222
+ { label: getI18n('vxe.custom.setting.fixedRight'), value: 'right', disabled: isHidden || isMaxFixedColumn }
1223
+ ]
1224
+ },
1225
+ on: {
1226
+ change ({ label, $event }: VxeRadioGroupDefines.ChangeEventParams) {
1227
+ $xeTableCustomPanel.changeFixedOption(column, label, $event)
1228
+ }
1229
+ }
1230
+ })
1231
+ ])
1232
+ : renderEmptyElement($xeTable)
1233
+ ])
1234
+ )
1235
+ }
1236
+ })
1237
+ const scopedSlots: Record<string, any> = {
1238
+ default: () => {
1239
+ return h('div', {
1240
+ ref: 'refBodyWrapperElem',
1241
+ class: 'vxe-table-custom-popup--body-wrapper'
1242
+ }, defaultSlot
1243
+ ? $xeTable.callSlot(defaultSlot, params, h)
1244
+ : [
1245
+ h('div', {
1246
+ ref: 'refCustomBodyElem',
1247
+ class: 'vxe-table-custom-popup--handle-wrapper'
1248
+ }, [
1249
+ topSlot
1250
+ ? h('div', {
1251
+ class: 'vxe-table-custom-popup--table-top'
1252
+ }, $xeTable.callSlot(topSlot, params, h))
1253
+ : renderEmptyElement($xeTable),
1254
+ h('div', {
1255
+ class: 'vxe-table-custom-popup--table-wrapper'
1256
+ }, [
1257
+ h('table', {}, [
1258
+ h('colgroup', {}, [
1259
+ allowVisible
1260
+ ? h('col', {
1261
+ class: 'vxe-table-custom-popup--table-col-seq'
1262
+ })
1263
+ : renderEmptyElement($xeTable),
1264
+ h('col', {
1265
+ class: 'vxe-table-custom-popup--table-col-title'
1266
+ }),
1267
+ allowResizable
1268
+ ? h('col', {
1269
+ class: 'vxe-table-custom-popup--table-col-width'
1270
+ })
1271
+ : renderEmptyElement($xeTable),
1272
+ allowFixed
1273
+ ? h('col', {
1274
+ class: 'vxe-table-custom-popup--table-col-fixed'
1275
+ })
1276
+ : renderEmptyElement($xeTable)
1277
+ ]),
1278
+ h('thead', {}, [
1279
+ h('tr', {}, [
1280
+ allowVisible
1281
+ ? h('th', {}, [
1282
+ h('div', {
1283
+ class: ['vxe-table-custom--checkbox-option', {
1284
+ 'is--checked': isAllChecked,
1285
+ 'is--indeterminate': isAllIndeterminate
1286
+ }],
1287
+ attrs: {
1288
+ title: getI18n('vxe.table.allTitle')
1289
+ },
1290
+ on: {
1291
+ click: $xeTableCustomPanel.allOptionEvent
1292
+ }
1293
+
1294
+ }, [
1295
+ h('span', {
1296
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
1297
+ }),
1298
+ h('span', {
1299
+ class: 'vxe-checkbox--label'
1300
+ }, getI18n('vxe.toolbar.customAll'))
1301
+ ])
1302
+ ])
1303
+ : renderEmptyElement($xeTable),
1304
+ h('th', {}, getI18n('vxe.custom.setting.colTitle')),
1305
+ allowResizable
1306
+ ? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
1307
+ : renderEmptyElement($xeTable),
1308
+ allowFixed
1309
+ ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize]))
1310
+ : renderEmptyElement($xeTable)
1311
+ ])
1312
+ ]),
1313
+ h('transition-group', {
1314
+ class: 'vxe-table-custom--panel-list',
1315
+ props: {
1316
+ tag: 'tbody',
1317
+ name: 'vxe-table-custom--list'
1318
+ }
1319
+ }, trVNs)
1320
+ ])
1321
+ ]),
1322
+ bottomSlot
1323
+ ? h('div', {
1324
+ class: 'vxe-table-custom-popup--table-bottom'
1325
+ }, $xeTable.callSlot(bottomSlot, params, h))
1326
+ : renderEmptyElement($xeTable),
1327
+ $xeTableCustomPanel.renderDragTip(h)
1328
+ ]),
1329
+ !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel
1330
+ ? h($xeTable.getPivotTableAggregatePopupPanel(), {
1331
+ props: {
1332
+ customStore
1333
+ }
1334
+ })
1335
+ : renderEmptyElement($xeTable)
1336
+ ])
1337
+ },
1338
+ footer: () => {
1339
+ if (footerSlot) {
1340
+ return $xeTable.callSlot(footerSlot, params, h)
1341
+ }
1342
+ return h('div', {
1343
+ class: 'vxe-table-custom-popup--footer'
1344
+ }, [
1345
+ h(VxeUIButtonComponent, {
1346
+ props: {
1347
+ content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore'),
1348
+ disabled: !isCustomStatus
1349
+ },
1350
+ on: {
1351
+ click: $xeTableCustomPanel.resetCustomEvent
1352
+ }
1353
+ }),
1354
+ immediate
1355
+ ? h(VxeUIButtonComponent, {
1356
+ props: {
1357
+ content: customOpts.resetButtonText || getI18n('vxe.table.customClose')
1358
+ },
1359
+ on: {
1360
+ click: $xeTableCustomPanel.cancelCloseEvent
1361
+ }
1362
+ })
1363
+ : h(VxeUIButtonComponent, {
1364
+ props: {
1365
+ content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
1366
+ },
1367
+ on: {
1368
+ click: $xeTableCustomPanel.cancelCustomEvent
1369
+ }
1370
+ }),
1371
+ immediate
1372
+ ? renderEmptyElement($xeTable)
1373
+ : h(VxeUIButtonComponent, {
1374
+ props: {
1375
+ status: 'primary',
1376
+ content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
1377
+ },
1378
+ on: {
1379
+ click: $xeTableCustomPanel.confirmCustomEvent
1380
+ }
1381
+ })
1382
+ ])
1383
+ }
1384
+ }
1385
+ if (headerSlot) {
1386
+ scopedSlots.header = () => $xeTable.callSlot(headerSlot, params, h)
1387
+ }
1388
+ if (mode === 'drawer') {
1389
+ return VxeUIDrawerComponent
1390
+ ? h(VxeUIDrawerComponent, {
1391
+ key: 'drawer',
1392
+ props: {
1393
+ className: ['vxe-table-custom-drawer-wrapper', 'vxe-table--ignore-clear', drawerOpts.className || ''].join(' '),
1394
+ value: customStore.visible,
1395
+ title: drawerOpts.title || getI18n('vxe.custom.cstmTitle'),
1396
+ width: drawerOpts.width || Math.min(880, Math.floor(document.documentElement.clientWidth * 0.6)),
1397
+ position: drawerOpts.position,
1398
+ resize: !!drawerOpts.resize,
1399
+ escClosable: !!drawerOpts.escClosable,
1400
+ maskClosable: !!drawerOpts.maskClosable,
1401
+ destroyOnClose: true,
1402
+ showFooter: true
1403
+ },
1404
+ on: {
1405
+ input (value: any) {
1406
+ customStore.visible = value
1407
+ }
1408
+ },
1409
+ scopedSlots
1410
+ })
1411
+ : renderEmptyElement($xeTableCustomPanel)
1412
+ }
1413
+ return VxeUIModalComponent
1414
+ ? h(VxeUIModalComponent, {
1415
+ key: 'modal',
1416
+ props: {
1417
+ className: ['vxe-table-custom-popup-wrapper', 'vxe-table--ignore-clear', modalOpts.className || ''].join(' '),
1418
+ value: customStore.visible,
1419
+ title: modalOpts.title || getI18n('vxe.custom.cstmTitle'),
1420
+ width: modalOpts.width || Math.min(880, document.documentElement.clientWidth),
1421
+ minWidth: modalOpts.minWidth || 700,
1422
+ height: modalOpts.height || Math.min(680, document.documentElement.clientHeight),
1423
+ minHeight: modalOpts.minHeight || 400,
1424
+ showZoom: modalOpts.showZoom,
1425
+ showMaximize: modalOpts.showMaximize,
1426
+ showMinimize: modalOpts.showMinimize,
1427
+ mask: modalOpts.mask,
1428
+ lockView: modalOpts.lockView,
1429
+ resize: modalOpts.resize,
1430
+ escClosable: !!modalOpts.escClosable,
1431
+ maskClosable: !!modalOpts.maskClosable,
1432
+ destroyOnClose: true,
1433
+ showFooter: true
1434
+ },
1435
+ on: {
1436
+ input (value: any) {
1437
+ customStore.visible = value
1438
+ }
1439
+ },
1440
+ scopedSlots
1441
+ })
1442
+ : renderEmptyElement($xeTableCustomPanel)
1443
+ },
1444
+ renderVN (h: CreateElement) {
1445
+ const $xeTableCustomPanel = this
1446
+ const $xeTable = $xeTableCustomPanel.$xeTable
1447
+
1448
+ const customOpts = $xeTable.computeCustomOpts
1449
+ if (['modal', 'drawer', 'popup'].includes(`${customOpts.mode}`)) {
1450
+ return $xeTableCustomPanel.renderPopupPanel(h)
1451
+ }
1452
+ return $xeTableCustomPanel.renderSimplePanel(h)
1449
1453
  }
1450
- } as any
1451
- }
1454
+ },
1455
+ render (h: CreateElement) {
1456
+ return (this as any).renderVN(h)
1457
+ }
1458
+ }) /* define-vxe-component end */