vxe-table 3.10.4 → 3.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/es/grid/src/grid.js +1 -1
  2. package/es/style.css +1 -1
  3. package/es/style.min.css +1 -1
  4. package/es/table/module/custom/mixin.js +130 -2
  5. package/es/table/module/custom/panel.js +327 -338
  6. package/es/table/module/export/export-panel.js +2 -2
  7. package/es/table/src/methods.js +25 -38
  8. package/es/table/style.css +42 -37
  9. package/es/table/style.min.css +1 -1
  10. package/es/ui/index.js +1 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-table/style.css +42 -37
  13. package/es/vxe-table/style.min.css +1 -1
  14. package/lib/grid/src/grid.js +1 -1
  15. package/lib/grid/src/grid.min.js +1 -1
  16. package/lib/index.umd.js +387 -306
  17. package/lib/index.umd.min.js +1 -1
  18. package/lib/style.css +1 -1
  19. package/lib/style.min.css +1 -1
  20. package/lib/table/module/custom/mixin.js +176 -2
  21. package/lib/table/module/custom/mixin.min.js +1 -1
  22. package/lib/table/module/custom/panel.js +182 -255
  23. package/lib/table/module/custom/panel.min.js +1 -1
  24. package/lib/table/module/export/export-panel.js +2 -2
  25. package/lib/table/module/export/export-panel.min.js +1 -1
  26. package/lib/table/src/methods.js +24 -44
  27. package/lib/table/src/methods.min.js +1 -1
  28. package/lib/table/style/style.css +42 -37
  29. package/lib/table/style/style.min.css +1 -1
  30. package/lib/ui/index.js +1 -1
  31. package/lib/ui/index.min.js +1 -1
  32. package/lib/ui/src/log.js +1 -1
  33. package/lib/ui/src/log.min.js +1 -1
  34. package/lib/vxe-table/style/style.css +42 -37
  35. package/lib/vxe-table/style/style.min.css +1 -1
  36. package/package.json +2 -2
  37. package/packages/grid/src/grid.ts +1 -1
  38. package/packages/table/module/custom/mixin.ts +131 -2
  39. package/packages/table/module/custom/panel.ts +332 -337
  40. package/packages/table/module/export/export-panel.ts +2 -2
  41. package/packages/table/src/methods.ts +24 -37
  42. package/styles/components/table-module/custom.scss +21 -5
  43. /package/es/{iconfont.1730945625063.ttf → iconfont.1730978752470.ttf} +0 -0
  44. /package/es/{iconfont.1730945625063.woff → iconfont.1730978752470.woff} +0 -0
  45. /package/es/{iconfont.1730945625063.woff2 → iconfont.1730978752470.woff2} +0 -0
  46. /package/lib/{iconfont.1730945625063.ttf → iconfont.1730978752470.ttf} +0 -0
  47. /package/lib/{iconfont.1730945625063.woff → iconfont.1730978752470.woff} +0 -0
  48. /package/lib/{iconfont.1730945625063.woff2 → iconfont.1730978752470.woff2} +0 -0
@@ -28,10 +28,17 @@ function updateDropHint (_vm: any, evnt: any) {
28
28
  const renderSimplePanel = (h: CreateElement, _vm: any) => {
29
29
  const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
30
30
 
31
- const { _e, $xetable, customStore, dragColumn } = _vm
32
- const { customColumnList, customOpts, isMaxFixedColumn } = $xetable
31
+ const $xeTable = _vm.$xeTable
32
+ const { _e, customStore, dragColumn } = _vm
33
+ const { customColumnList, customOpts, isMaxFixedColumn } = $xeTable
33
34
  const { maxHeight } = customStore
34
35
  const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts
36
+ const slots = customOpts.slots || {}
37
+ const headerSlot = slots.header
38
+ const topSlot = slots.top
39
+ const bottomSlot = slots.bottom
40
+ const defaultSlot = slots.default
41
+ const footerSlot = slots.footer
35
42
  const colVNs: any[] = []
36
43
  const customWrapperOns: any = {}
37
44
  // hover 触发
@@ -39,6 +46,15 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
39
46
  customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent
40
47
  customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent
41
48
  }
49
+ const isAllChecked = customStore.isAll
50
+ const isAllIndeterminate = customStore.isIndeterminate
51
+ const params = {
52
+ $table: $xeTable,
53
+ $grid: $xeTable.xegrid,
54
+ columns: customColumnList,
55
+ isAllChecked,
56
+ isAllIndeterminate
57
+ }
42
58
  XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
43
59
  const isVisible = visibleMethod ? visibleMethod({ column }) : true
44
60
  if (isVisible) {
@@ -164,8 +180,6 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
164
180
  )
165
181
  }
166
182
  })
167
- const isAllChecked = customStore.isAll
168
- const isAllIndeterminate = customStore.isIndeterminate
169
183
  return h('div', {
170
184
  key: 'simple',
171
185
  class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
@@ -178,49 +192,69 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
178
192
  : {}
179
193
  }, customStore.visible
180
194
  ? [
181
- h('ul', {
195
+ h('div', {
182
196
  class: 'vxe-table-custom--header'
183
- }, [
184
- h('li', {
185
- class: 'vxe-table-custom--option'
186
- }, [
187
- allowVisible
188
- ? h('div', {
189
- class: ['vxe-table-custom--checkbox-option', {
190
- 'is--checked': isAllChecked,
191
- 'is--indeterminate': isAllIndeterminate
192
- }],
193
- attrs: {
194
- title: getI18n('vxe.table.allTitle')
195
- },
196
- on: {
197
- click: _vm.allOptionEvent
198
- }
197
+ }, headerSlot
198
+ ? $xeTable.callSlot(headerSlot, params, h)
199
+ : [
200
+ h('ul', {
201
+ class: 'vxe-table-custom--panel-list'
199
202
  }, [
200
- h('span', {
201
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
202
- }),
203
- h('span', {
204
- class: 'vxe-checkbox--label'
205
- }, getI18n('vxe.toolbar.customAll'))
203
+ h('li', {
204
+ class: 'vxe-table-custom--option'
205
+ }, [
206
+ allowVisible
207
+ ? h('div', {
208
+ class: ['vxe-table-custom--checkbox-option', {
209
+ 'is--checked': isAllChecked,
210
+ 'is--indeterminate': isAllIndeterminate
211
+ }],
212
+ attrs: {
213
+ title: getI18n('vxe.table.allTitle')
214
+ },
215
+ on: {
216
+ click: _vm.allOptionEvent
217
+ }
218
+ }, [
219
+ h('span', {
220
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
221
+ }),
222
+ h('span', {
223
+ class: 'vxe-checkbox--label'
224
+ }, getI18n('vxe.toolbar.customAll'))
225
+ ])
226
+ : h('span', {
227
+ class: 'vxe-checkbox--label'
228
+ }, getI18n('vxe.table.customTitle'))
229
+ ])
206
230
  ])
207
- : h('span', {
208
- class: 'vxe-checkbox--label'
209
- }, getI18n('vxe.table.customTitle'))
210
- ])
211
- ]),
231
+ ]),
212
232
  h('div', {
213
233
  ref: 'bodyElemRef',
214
- class: 'vxe-table-custom--list-wrapper'
234
+ class: 'vxe-table-custom--body'
215
235
  }, [
216
- h('transition-group', {
217
- class: 'vxe-table-custom--body',
218
- props: {
219
- name: 'vxe-table-custom--list',
220
- tag: 'ul'
221
- },
222
- on: customWrapperOns
223
- }, colVNs),
236
+ topSlot
237
+ ? h('div', {
238
+ class: 'vxe-table-custom--panel-top'
239
+ }, $xeTable.callSlot(topSlot, params, h))
240
+ : renderEmptyElement($xeTable),
241
+ defaultSlot
242
+ ? h('div', {
243
+ class: 'vxe-table-custom--panel-body'
244
+ }, $xeTable.callSlot(defaultSlot, params, h))
245
+ : h('transition-group', {
246
+ class: 'vxe-table-custom--panel-list',
247
+ props: {
248
+ name: 'vxe-table-custom--list',
249
+ tag: 'ul'
250
+ },
251
+ on: customWrapperOns
252
+ }, colVNs),
253
+ bottomSlot
254
+ ? h('div', {
255
+ class: 'vxe-table-custom--panel-bottom'
256
+ }, $xeTable.callSlot(bottomSlot, params, h))
257
+ : renderEmptyElement($xeTable),
224
258
  h('div', {
225
259
  ref: 'dragHintElemRef',
226
260
  class: 'vxe-table-custom-popup--drag-hint'
@@ -229,48 +263,54 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
229
263
  customOpts.showFooter
230
264
  ? h('div', {
231
265
  class: 'vxe-table-custom--footer'
232
- }, [
233
- h(VxeUIButtonComponent, {
234
- props: {
235
- mode: 'text',
236
- content: customOpts.resetButtonText || getI18n('vxe.table.customRestore')
237
- },
238
- on: {
239
- click: _vm.resetCustomEvent
240
- }
241
- }),
242
- customOpts.immediate
243
- ? h(VxeUIButtonComponent, {
244
- props: {
245
- mode: 'text',
246
- content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
247
- },
248
- on: {
249
- click: _vm.cancelCloseEvent
250
- }
251
- })
252
- : h(VxeUIButtonComponent, {
253
- props: {
254
- mode: 'text',
255
- content: customOpts.resetButtonText || getI18n('vxe.table.customCancel')
256
- },
257
- on: {
258
- click: _vm.cancelCustomEvent
259
- }
260
- }),
261
- customOpts.immediate
262
- ? _e()
263
- : h(VxeUIButtonComponent, {
264
- props: {
265
- mode: 'text',
266
- status: 'primary',
267
- content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm')
268
- },
269
- on: {
270
- click: _vm.confirmCustomEvent
271
- }
272
- })
273
- ])
266
+ }, footerSlot
267
+ ? $xeTable.callSlot(footerSlot, params, h)
268
+ : [
269
+ h('div', {
270
+ class: 'vxe-table-custom--footer-buttons'
271
+ }, [
272
+ h(VxeUIButtonComponent, {
273
+ props: {
274
+ mode: 'text',
275
+ content: customOpts.resetButtonText || getI18n('vxe.table.customRestore')
276
+ },
277
+ on: {
278
+ click: _vm.resetCustomEvent
279
+ }
280
+ }),
281
+ customOpts.immediate
282
+ ? h(VxeUIButtonComponent, {
283
+ props: {
284
+ mode: 'text',
285
+ content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
286
+ },
287
+ on: {
288
+ click: _vm.cancelCloseEvent
289
+ }
290
+ })
291
+ : h(VxeUIButtonComponent, {
292
+ props: {
293
+ mode: 'text',
294
+ content: customOpts.resetButtonText || getI18n('vxe.table.customCancel')
295
+ },
296
+ on: {
297
+ click: _vm.cancelCustomEvent
298
+ }
299
+ }),
300
+ customOpts.immediate
301
+ ? _e()
302
+ : h(VxeUIButtonComponent, {
303
+ props: {
304
+ mode: 'text',
305
+ status: 'primary',
306
+ content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm')
307
+ },
308
+ on: {
309
+ click: _vm.confirmCustomEvent
310
+ }
311
+ })
312
+ ])
313
+ ])
274
314
  : null
275
315
  ]
276
316
  : [])
@@ -283,12 +323,28 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
283
323
  const VxeUITooltipComponent = VxeUI.getComponent<VxeTooltipComponent>('VxeTooltip')
284
324
  const $xeTableCustomPanel = _vm
285
325
 
286
- const { _e, $xetable, customStore } = _vm
287
- const { customOpts, customColumnList, columnOpts, isMaxFixedColumn } = $xetable
326
+ const $xeTable = _vm.$xeTable
327
+ const { _e, customStore } = _vm
328
+ const { customOpts, customColumnList, columnOpts, isMaxFixedColumn } = $xeTable
288
329
  const { modalOptions, allowVisible, allowSort, allowFixed, allowResizable, checkMethod, visibleMethod } = customOpts
289
330
  const { maxFixedSize } = columnOpts
290
331
  const modalOpts = Object.assign({}, modalOptions)
332
+ const slots = customOpts.slots || {}
333
+ const headerSlot = slots.header
334
+ const topSlot = slots.top
335
+ const bottomSlot = slots.bottom
336
+ const defaultSlot = slots.default
337
+ const footerSlot = slots.footer
291
338
  const trVNs: VNode[] = []
339
+ const isAllChecked = customStore.isAll
340
+ const isAllIndeterminate = customStore.isIndeterminate
341
+ const params = {
342
+ $table: $xeTable,
343
+ $grid: $xeTable.xegrid,
344
+ columns: customColumnList,
345
+ isAllChecked,
346
+ isAllIndeterminate
347
+ }
292
348
  XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
293
349
  const isVisible = visibleMethod ? visibleMethod({ column }) : true
294
350
  if (isVisible) {
@@ -438,8 +494,165 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
438
494
  )
439
495
  }
440
496
  })
441
- const isAllChecked = customStore.isAll
442
- const isAllIndeterminate = customStore.isIndeterminate
497
+ const scopedSlots: Record<string, any> = {
498
+ default: () => {
499
+ if (defaultSlot) {
500
+ return $xeTable.callSlot(defaultSlot, params, h)
501
+ }
502
+ return h('div', {
503
+ ref: 'bodyElemRef',
504
+ class: 'vxe-table-custom-popup--body'
505
+ }, [
506
+ topSlot
507
+ ? h('div', {
508
+ class: 'vxe-table-custom-popup--table-top'
509
+ }, $xeTable.callSlot(topSlot, params, h))
510
+ : renderEmptyElement($xeTable),
511
+ h('div', {
512
+ class: 'vxe-table-custom-popup--table-wrapper'
513
+ }, [
514
+ h('table', {}, [
515
+ h('colgroup', {}, [
516
+ allowVisible
517
+ ? h('col', {
518
+ class: 'vxe-table-custom-popup--table-col-seq'
519
+ })
520
+ : _e(),
521
+ allowSort
522
+ ? h('col', {
523
+ class: 'vxe-table-custom-popup--table-col-sort'
524
+ })
525
+ : _e(),
526
+ h('col', {
527
+ class: 'vxe-table-custom-popup--table-col-title'
528
+ }),
529
+ allowResizable
530
+ ? h('col', {
531
+ class: 'vxe-table-custom-popup--table-col-width'
532
+ })
533
+ : _e(),
534
+ allowFixed
535
+ ? h('col', {
536
+ class: 'vxe-table-custom-popup--table-col-fixed'
537
+ })
538
+ : _e()
539
+ ]),
540
+ h('thead', {}, [
541
+ h('tr', {}, [
542
+ allowVisible
543
+ ? h('th', {}, [
544
+ h('div', {
545
+ class: ['vxe-table-custom--checkbox-option', {
546
+ 'is--checked': isAllChecked,
547
+ 'is--indeterminate': isAllIndeterminate
548
+ }],
549
+ attrs: {
550
+ title: getI18n('vxe.table.allTitle')
551
+ },
552
+ on: {
553
+ click: _vm.allOptionEvent
554
+ }
555
+
556
+ }, [
557
+ h('span', {
558
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
559
+ }),
560
+ h('span', {
561
+ class: 'vxe-checkbox--label'
562
+ }, getI18n('vxe.toolbar.customAll'))
563
+ ])
564
+ ])
565
+ : _e(),
566
+ allowSort
567
+ ? h('th', {}, [
568
+ h('span', {
569
+ class: 'vxe-table-custom-popup--table-sort-help-title'
570
+ }, getI18n('vxe.custom.setting.colSort')),
571
+ VxeUITooltipComponent
572
+ ? h(VxeUITooltipComponent, {
573
+ props: {
574
+ enterable: true,
575
+ content: getI18n('vxe.custom.setting.sortHelpTip'),
576
+ popupClassName: 'vxe-table--ignore-clear'
577
+ },
578
+ scopedSlots: {
579
+ default: () => {
580
+ return h('i', {
581
+ class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
582
+ })
583
+ }
584
+ }
585
+ })
586
+ : renderEmptyElement($xeTableCustomPanel)
587
+ ])
588
+ : _e(),
589
+ h('th', {}, getI18n('vxe.custom.setting.colTitle')),
590
+ allowResizable
591
+ ? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
592
+ : _e(),
593
+ allowFixed
594
+ ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize]))
595
+ : _e()
596
+ ])
597
+ ]),
598
+ h('transition-group', {
599
+ class: 'vxe-table-custom--panel-list',
600
+ props: {
601
+ tag: 'tbody',
602
+ name: 'vxe-table-custom--list'
603
+ }
604
+ }, trVNs)
605
+ ])
606
+ ]),
607
+ bottomSlot
608
+ ? h('div', {
609
+ class: 'vxe-table-custom-popup--table-bottom'
610
+ }, $xeTable.callSlot(bottomSlot, params, h))
611
+ : renderEmptyElement($xeTable),
612
+ h('div', {
613
+ ref: 'dragHintElemRef',
614
+ class: 'vxe-table-custom-popup--drag-hint'
615
+ }, getI18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))
616
+ ])
617
+ },
618
+ footer: () => {
619
+ if (footerSlot) {
620
+ return $xeTable.callSlot(footerSlot, params, h)
621
+ }
622
+ return h('div', {
623
+ class: 'vxe-table-custom-popup--footer'
624
+ }, [
625
+ h(VxeUIButtonComponent, {
626
+ props: {
627
+ content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore')
628
+ },
629
+ on: {
630
+ click: _vm.resetCustomEvent
631
+ }
632
+ }),
633
+ h(VxeUIButtonComponent, {
634
+ props: {
635
+ content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
636
+ },
637
+ on: {
638
+ click: _vm.cancelCustomEvent
639
+ }
640
+ }),
641
+ h(VxeUIButtonComponent, {
642
+ props: {
643
+ status: 'primary',
644
+ content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
645
+ },
646
+ on: {
647
+ click: _vm.confirmCustomEvent
648
+ }
649
+ })
650
+ ])
651
+ }
652
+ }
653
+ if (headerSlot) {
654
+ scopedSlots.header = () => $xeTable.callSlot(headerSlot, params, h)
655
+ }
443
656
  return VxeUIModalComponent
444
657
  ? h(VxeUIModalComponent, {
445
658
  key: 'modal',
@@ -451,10 +664,12 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
451
664
  minWidth: modalOpts.minWidth || 700,
452
665
  height: modalOpts.height || Math.min(680, document.documentElement.clientHeight),
453
666
  minHeight: modalOpts.minHeight || 400,
454
- showZoom: !!modalOpts.showZoom,
455
- mask: !!modalOpts.mask,
456
- lockView: !!modalOpts.lockView,
457
- resize: !!modalOpts.resize,
667
+ showZoom: modalOpts.showZoom,
668
+ showMaximize: modalOpts.showMaximize,
669
+ showMinimize: modalOpts.showMinimize,
670
+ mask: modalOpts.mask,
671
+ lockView: modalOpts.lockView,
672
+ resize: modalOpts.resize,
458
673
  escClosable: !!modalOpts.escClosable,
459
674
  destroyOnClose: true,
460
675
  showFooter: true
@@ -464,156 +679,7 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
464
679
  customStore.visible = value
465
680
  }
466
681
  },
467
- scopedSlots: {
468
- default: () => {
469
- return h('div', {
470
- ref: 'bodyElemRef',
471
- class: 'vxe-table-custom-popup--body'
472
- }, [
473
- h('div', {
474
- class: 'vxe-table-custom-popup--table-wrapper'
475
- }, [
476
- h('table', {}, [
477
- h('colgroup', {}, [
478
- allowVisible
479
- ? h('col', {
480
- style: {
481
- width: '80px'
482
- }
483
- })
484
- : _e(),
485
- allowSort
486
- ? h('col', {
487
- style: {
488
- width: '80px'
489
- }
490
- })
491
- : _e(),
492
- h('col', {
493
- style: {
494
- minWidth: '120px'
495
- }
496
- }),
497
- allowResizable
498
- ? h('col', {
499
- style: {
500
- width: '140px'
501
- }
502
- })
503
- : _e(),
504
- allowFixed
505
- ? h('col', {
506
- style: {
507
- width: '200px'
508
- }
509
- })
510
- : _e()
511
- ]),
512
- h('thead', {}, [
513
- h('tr', {}, [
514
- allowVisible
515
- ? h('th', {}, [
516
- h('div', {
517
- class: ['vxe-table-custom--checkbox-option', {
518
- 'is--checked': isAllChecked,
519
- 'is--indeterminate': isAllIndeterminate
520
- }],
521
- attrs: {
522
- title: getI18n('vxe.table.allTitle')
523
- },
524
- on: {
525
- click: _vm.allOptionEvent
526
- }
527
-
528
- }, [
529
- h('span', {
530
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
531
- }),
532
- h('span', {
533
- class: 'vxe-checkbox--label'
534
- }, getI18n('vxe.toolbar.customAll'))
535
- ])
536
- ])
537
- : _e(),
538
- allowSort
539
- ? h('th', {}, [
540
- h('span', {
541
- class: 'vxe-table-custom-popup--table-sort-help-title'
542
- }, getI18n('vxe.custom.setting.colSort')),
543
- VxeUITooltipComponent
544
- ? h(VxeUITooltipComponent, {
545
- props: {
546
- enterable: true,
547
- content: getI18n('vxe.custom.setting.sortHelpTip'),
548
- popupClassName: 'vxe-table--ignore-clear'
549
- },
550
- scopedSlots: {
551
- default: () => {
552
- return h('i', {
553
- class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
554
- })
555
- }
556
- }
557
- })
558
- : renderEmptyElement($xeTableCustomPanel)
559
- ])
560
- : _e(),
561
- h('th', {}, getI18n('vxe.custom.setting.colTitle')),
562
- allowResizable
563
- ? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
564
- : _e(),
565
- allowFixed
566
- ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize]))
567
- : _e()
568
- ])
569
- ]),
570
- h('transition-group', {
571
- class: 'vxe-table-custom--body',
572
- props: {
573
- tag: 'tbody',
574
- name: 'vxe-table-custom--list'
575
- }
576
- }, trVNs)
577
- ])
578
- ]),
579
- h('div', {
580
- ref: 'dragHintElemRef',
581
- class: 'vxe-table-custom-popup--drag-hint'
582
- }, getI18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))
583
- ])
584
- },
585
- footer: () => {
586
- return h('div', {
587
- class: 'vxe-table-custom-popup--footer'
588
- }, [
589
- h(VxeUIButtonComponent, {
590
- props: {
591
- content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore')
592
- },
593
- on: {
594
- click: _vm.resetCustomEvent
595
- }
596
- }),
597
- h(VxeUIButtonComponent, {
598
- props: {
599
- content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
600
- },
601
- on: {
602
- click: _vm.cancelCustomEvent
603
- }
604
- }),
605
- h(VxeUIButtonComponent, {
606
- props: {
607
- status: 'primary',
608
- content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
609
- },
610
- on: {
611
- click: _vm.confirmCustomEvent
612
- }
613
- })
614
- ])
615
- }
616
- }
682
+ scopedSlots
617
683
  })
618
684
  : renderEmptyElement($xeTableCustomPanel)
619
685
  }
@@ -627,6 +693,9 @@ export default {
627
693
  }
628
694
  },
629
695
  inject: {
696
+ $xeTable: {
697
+ default: null
698
+ },
630
699
  $xetable: {
631
700
  default: null
632
701
  }
@@ -691,81 +760,36 @@ export default {
691
760
  customStore.activeWrapper = false
692
761
  setTimeout(() => {
693
762
  if (!customStore.activeBtn && !customStore.activeWrapper) {
694
- $xetable.customColseEvent(evnt)
763
+ $xetable.customCloseEvent(evnt)
695
764
  }
696
765
  }, 300)
697
766
  },
698
767
  getStoreData () {
699
768
  return {}
700
769
  },
701
- confirmCustomEvent (evnt: any) {
702
- const { $xetable } = this
703
- const { customOpts, customColumnList } = $xetable
704
- const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts
705
- XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
706
- if (parent) {
707
- // 更新子列信息
708
- column.fixed = parent.fixed
709
- } else {
710
- if (allowSort) {
711
- const sortIndex = index + 1
712
- column.renderSortNumber = sortIndex
713
- }
714
- if (allowFixed) {
715
- column.fixed = column.renderFixed
716
- }
717
- }
718
- if (allowResizable) {
719
- if (column.renderVisible && (!column.children || column.children.length)) {
720
- if (column.renderResizeWidth !== column.renderWidth) {
721
- column.resizeWidth = column.renderResizeWidth
722
- column.renderWidth = column.renderResizeWidth
723
- }
724
- }
725
- }
726
- if (allowVisible) {
727
- column.visible = column.renderVisible
728
- }
729
- })
730
- $xetable.closeCustom()
731
- $xetable.emitCustomEvent('confirm', evnt)
732
- $xetable.saveCustomStore('confirm')
770
+ confirmCustomEvent ({ $event }: any) {
771
+ const $xeTable = this.$xeTable
772
+
773
+ $xeTable.saveCustom()
774
+ $xeTable.closeCustom()
775
+ $xeTable.emitCustomEvent('confirm', $event)
733
776
  },
734
777
  cancelCloseEvent ({ $event }: any) {
735
- const { $xetable } = this
736
- $xetable.closeCustom()
737
- $xetable.emitCustomEvent('cancel', $event)
778
+ const $xeTable = this.$xeTable
779
+
780
+ $xeTable.closeCustom()
781
+ $xeTable.emitCustomEvent('close', $event)
738
782
  },
739
- cancelCustomEvent (evnt: any) {
740
- const { $xetable } = this
741
- const { customStore, customOpts, customColumnList } = $xetable
742
- const { oldSortMaps, oldFixedMaps, oldVisibleMaps } = customStore
743
- const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts
744
- XEUtils.eachTree(customColumnList, column => {
745
- const colid = column.getKey()
746
- const visible = !!oldVisibleMaps[colid]
747
- const fixed = oldFixedMaps[colid] || ''
748
- if (allowVisible) {
749
- column.renderVisible = visible
750
- column.visible = visible
751
- }
752
- if (allowFixed) {
753
- column.renderFixed = fixed
754
- column.fixed = fixed
755
- }
756
- if (allowSort) {
757
- column.renderSortNumber = oldSortMaps[colid] || 0
758
- }
759
- if (allowResizable) {
760
- column.renderResizeWidth = column.renderWidth
761
- }
762
- }, { children: 'children' })
763
- $xetable.closeCustom()
764
- $xetable.emitCustomEvent('cancel', evnt)
783
+ cancelCustomEvent ({ $event }: any) {
784
+ const $xeTable = this.$xeTable
785
+
786
+ $xeTable.cancelCustom()
787
+ $xeTable.closeCustom()
788
+ $xeTable.emitCustomEvent('cancel', $event)
765
789
  },
766
790
  handleResetCustomEvent (evnt: any) {
767
791
  const { $xetable } = this
768
- $xetable.resetColumn(true)
792
+ $xetable.resetCustom(true)
769
793
  $xetable.closeCustom()
770
794
  $xetable.emitCustomEvent('reset', evnt)
771
795
  },
@@ -867,39 +891,9 @@ export default {
867
891
  }
868
892
  },
869
893
  allOptionEvent () {
870
- const { $xetable, customStore } = this
871
- const { customColumnList, customOpts } = $xetable
872
- const { checkMethod, visibleMethod } = customOpts
873
- const isAll = !customStore.isAll
874
- if (customOpts.immediate) {
875
- XEUtils.eachTree(customColumnList, (column) => {
876
- if (visibleMethod && !visibleMethod({ column })) {
877
- return
878
- }
879
- if (checkMethod && !checkMethod({ column })) {
880
- return
881
- }
882
- column.visible = isAll
883
- column.renderVisible = isAll
884
- column.halfVisible = false
885
- })
886
- customStore.isAll = isAll
887
- $xetable.handleCustom()
888
- $xetable.saveCustomStore('update:visible')
889
- } else {
890
- XEUtils.eachTree(customColumnList, (column) => {
891
- if (visibleMethod && !visibleMethod({ column })) {
892
- return
893
- }
894
- if (checkMethod && !checkMethod({ column })) {
895
- return
896
- }
897
- column.renderVisible = isAll
898
- column.halfVisible = false
899
- })
900
- customStore.isAll = isAll
901
- }
902
- $xetable.checkCustomStatus()
894
+ const { $xetable } = this
895
+
896
+ $xetable.toggleCustomAllCheckbox()
903
897
  },
904
898
  sortMousedownEvent (evnt: MouseEvent) {
905
899
  const { $xetable } = this
@@ -911,6 +905,7 @@ export default {
911
905
  trEl.draggable = true
912
906
  this.dragColumn = column
913
907
  addClass(trEl, 'active--drag-origin')
908
+ updateDropHint(this, evnt)
914
909
  },
915
910
  sortMouseupEvent (evnt: MouseEvent) {
916
911
  const btnEl = evnt.currentTarget as HTMLElement