vxe-table 3.19.22 → 3.19.25

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 (40) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/src/methods.js +11 -4
  6. package/es/toolbar/src/toolbar.js +103 -81
  7. package/es/toolbar/style.css +11 -4
  8. package/es/toolbar/style.min.css +1 -1
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/log.js +1 -1
  11. package/es/vxe-toolbar/style.css +11 -4
  12. package/es/vxe-toolbar/style.min.css +1 -1
  13. package/lib/index.css +1 -1
  14. package/lib/index.min.css +1 -1
  15. package/lib/index.umd.js +133 -111
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/style.css +1 -1
  18. package/lib/style.min.css +1 -1
  19. package/lib/table/src/methods.js +11 -4
  20. package/lib/table/src/methods.min.js +1 -1
  21. package/lib/toolbar/src/toolbar.js +127 -105
  22. package/lib/toolbar/src/toolbar.min.js +1 -1
  23. package/lib/toolbar/style/style.css +11 -4
  24. package/lib/toolbar/style/style.min.css +1 -1
  25. package/lib/ui/index.js +1 -1
  26. package/lib/ui/index.min.js +1 -1
  27. package/lib/ui/src/log.js +1 -1
  28. package/lib/ui/src/log.min.js +1 -1
  29. package/lib/vxe-toolbar/style/style.css +11 -4
  30. package/lib/vxe-toolbar/style/style.min.css +1 -1
  31. package/package.json +2 -3
  32. package/packages/table/src/methods.ts +20 -9
  33. package/packages/toolbar/src/toolbar.ts +117 -83
  34. package/styles/components/toolbar.scss +11 -4
  35. /package/es/{iconfont.1764380622607.ttf → iconfont.1764811551687.ttf} +0 -0
  36. /package/es/{iconfont.1764380622607.woff → iconfont.1764811551687.woff} +0 -0
  37. /package/es/{iconfont.1764380622607.woff2 → iconfont.1764811551687.woff2} +0 -0
  38. /package/lib/{iconfont.1764380622607.ttf → iconfont.1764811551687.ttf} +0 -0
  39. /package/lib/{iconfont.1764380622607.woff → iconfont.1764811551687.woff} +0 -0
  40. /package/lib/{iconfont.1764380622607.woff2 → iconfont.1764811551687.woff2} +0 -0
@@ -472,52 +472,72 @@ export default /* define-vxe-component start */ defineVxeComponent({
472
472
  const { buttons } = props
473
473
  const { connectTable } = internalData
474
474
  const $table = connectTable
475
+ const buttonsSlot = slots.buttons
475
476
  const buttonPrefixSlot = slots.buttonPrefix || slots['button-prefix']
476
477
  const buttonSuffixSlot = slots.buttonSuffix || slots['button-suffix']
477
- const btnVNs: VxeComponentSlotType[] = []
478
+ const lbVNs: VxeComponentSlotType[] = []
478
479
  if (buttonPrefixSlot) {
479
- btnVNs.push(...getSlotVNs(buttonPrefixSlot.call($xeToolbar, { buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
480
- }
481
- if (buttons) {
482
- buttons.forEach((item) => {
483
- const { dropdowns, buttonRender } = item
484
- if (item.visible !== false) {
485
- const compConf = buttonRender ? renderer.get(buttonRender.name) : null
486
- if (buttonRender && compConf && compConf.renderToolbarButton) {
487
- const toolbarButtonClassName = compConf.toolbarButtonClassName
488
- const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table!, button: item }
489
- btnVNs.push(
490
- h('span', {
491
- class: ['vxe-button--item', toolbarButtonClassName ? (XEUtils.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName) : '']
492
- }, getSlotVNs(compConf.renderToolbarButton(h, buttonRender, params)))
493
- )
494
- } else {
495
- if (VxeUIButtonComponent) {
480
+ lbVNs.push(
481
+ h('span', {
482
+ key: 'tbp',
483
+ class: 'vxe-button--prefix-wrapper'
484
+ }, getSlotVNs(buttonPrefixSlot.call($xeToolbar, { buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
485
+ )
486
+ }
487
+ if (buttons || buttonsSlot) {
488
+ const btnVNs: VxeComponentSlotType[] = []
489
+ if (buttons) {
490
+ buttons.forEach((item) => {
491
+ const { dropdowns, buttonRender } = item
492
+ if (item.visible !== false) {
493
+ const compConf = buttonRender ? renderer.get(buttonRender.name) : null
494
+ if (buttonRender && compConf && compConf.renderToolbarButton) {
495
+ const toolbarButtonClassName = compConf.toolbarButtonClassName
496
+ const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table!, button: item }
496
497
  btnVNs.push(
497
- h(VxeUIButtonComponent, {
498
- props: Object.assign({}, item, {
499
- content: item.content || item.name,
500
- options: undefined
501
- }),
502
- on: {
503
- click: (eventParams: VxeButtonDefines.ClickEventParams) => $xeToolbar.btnEvent(eventParams, item)
504
- },
505
- scopedSlots: dropdowns && dropdowns.length
506
- ? {
507
- dropdowns: () => $xeToolbar.renderDropdowns(h, item, true)
508
- }
509
- : {}
510
- })
498
+ h('span', {
499
+ class: ['vxe-button--item', toolbarButtonClassName ? (XEUtils.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName) : '']
500
+ }, getSlotVNs(compConf.renderToolbarButton(h, buttonRender, params)))
511
501
  )
502
+ } else {
503
+ if (VxeUIButtonComponent) {
504
+ btnVNs.push(
505
+ h(VxeUIButtonComponent, {
506
+ props: Object.assign({}, item, {
507
+ content: item.content || item.name,
508
+ options: undefined
509
+ }),
510
+ on: {
511
+ click: (eventParams: VxeButtonDefines.ClickEventParams) => $xeToolbar.btnEvent(eventParams, item)
512
+ },
513
+ scopedSlots: dropdowns && dropdowns.length
514
+ ? {
515
+ dropdowns: () => $xeToolbar.renderDropdowns(h, item, true)
516
+ }
517
+ : {}
518
+ })
519
+ )
520
+ }
512
521
  }
513
522
  }
514
- }
515
- })
523
+ })
524
+ }
525
+ lbVNs.push(
526
+ h('span', {
527
+ key: 'tti',
528
+ class: 'vxe-button--item-wrapper'
529
+ }, buttonsSlot ? getSlotVNs(buttonsSlot.call($xeToolbar, { buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : btnVNs)
530
+ )
516
531
  }
517
532
  if (buttonSuffixSlot) {
518
- btnVNs.push(...getSlotVNs(buttonSuffixSlot.call($xeToolbar, { buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
533
+ lbVNs.push(
534
+ h('span', {
535
+ key: 'tbs',
536
+ class: 'vxe-button--suffix-wrapper'
537
+ }, getSlotVNs(buttonSuffixSlot.call($xeToolbar, { buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
538
+ )
519
539
  }
520
- return btnVNs
540
+ return lbVNs
521
541
  },
522
542
  /**
523
543
  * 渲染右侧工具
@@ -536,55 +556,75 @@ export default /* define-vxe-component start */ defineVxeComponent({
536
556
  const { tools } = props
537
557
  const { connectTable } = internalData
538
558
  const $table = connectTable
559
+ const toolsSlot = slots.tools
539
560
  const toolPrefixSlot = slots.toolPrefix || slots['tool-prefix']
540
561
  const toolSuffixSlot = slots.toolSuffix || slots['tool-suffix']
541
- const btnVNs: VxeComponentSlotType[] = []
562
+ const rtVNs: VxeComponentSlotType[] = []
542
563
  if (toolPrefixSlot) {
543
- btnVNs.push(...getSlotVNs(toolPrefixSlot.call($xeToolbar, { tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
544
- }
545
- if (tools) {
546
- tools.forEach((item, tIndex) => {
547
- const { dropdowns, toolRender } = item
548
- if (item.visible !== false) {
549
- const rdName = toolRender ? toolRender.name : null
550
- const compConf = toolRender ? renderer.get(rdName) : null
551
- if (toolRender && compConf && compConf.renderToolbarTool) {
552
- const toolbarToolClassName = compConf.toolbarToolClassName
553
- const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table!, tool: item }
554
- btnVNs.push(
555
- h('span', {
556
- key: rdName as string,
557
- class: ['vxe-tool--item', toolbarToolClassName ? (XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName) : '']
558
- }, getSlotVNs(compConf.renderToolbarTool(h, toolRender, params)))
559
- )
560
- } else {
561
- if (VxeUIButtonComponent) {
564
+ rtVNs.push(
565
+ h('span', {
566
+ key: 'ttp',
567
+ class: 'vxe-tool--prefix-wrapper'
568
+ }, getSlotVNs(toolPrefixSlot.call($xeToolbar, { tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
569
+ )
570
+ }
571
+ if (tools || toolsSlot) {
572
+ const btnVNs: VxeComponentSlotType[] = []
573
+ if (tools) {
574
+ tools.forEach((item, tIndex) => {
575
+ const { dropdowns, toolRender } = item
576
+ if (item.visible !== false) {
577
+ const rdName = toolRender ? toolRender.name : null
578
+ const compConf = toolRender ? renderer.get(rdName) : null
579
+ if (toolRender && compConf && compConf.renderToolbarTool) {
580
+ const toolbarToolClassName = compConf.toolbarToolClassName
581
+ const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table!, tool: item }
562
582
  btnVNs.push(
563
- h(VxeUIButtonComponent, {
564
- key: tIndex,
565
- props: Object.assign({}, item, {
566
- content: item.content || item.name,
567
- options: undefined
568
- }),
569
- on: {
570
- click: (eventParams: VxeButtonDefines.ClickEventParams) => $xeToolbar.tolEvent(eventParams, item)
571
- },
572
- scopedSlots: dropdowns && dropdowns.length
573
- ? {
574
- dropdowns: () => $xeToolbar.renderDropdowns(h, item, false)
575
- }
576
- : {}
577
- })
583
+ h('span', {
584
+ key: rdName as string,
585
+ class: ['vxe-tool--item', toolbarToolClassName ? (XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName) : '']
586
+ }, getSlotVNs(compConf.renderToolbarTool(h, toolRender, params)))
578
587
  )
588
+ } else {
589
+ if (VxeUIButtonComponent) {
590
+ btnVNs.push(
591
+ h(VxeUIButtonComponent, {
592
+ key: tIndex,
593
+ props: Object.assign({}, item, {
594
+ content: item.content || item.name,
595
+ options: undefined
596
+ }),
597
+ on: {
598
+ click: (eventParams: VxeButtonDefines.ClickEventParams) => $xeToolbar.tolEvent(eventParams, item)
599
+ },
600
+ scopedSlots: dropdowns && dropdowns.length
601
+ ? {
602
+ dropdowns: () => $xeToolbar.renderDropdowns(h, item, false)
603
+ }
604
+ : {}
605
+ })
606
+ )
607
+ }
579
608
  }
580
609
  }
581
- }
582
- })
610
+ })
611
+ }
612
+ rtVNs.push(
613
+ h('span', {
614
+ key: 'tti',
615
+ class: 'vxe-tool--item-wrapper'
616
+ }, toolsSlot ? getSlotVNs(toolsSlot.call($xeToolbar, { tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : btnVNs)
617
+ )
583
618
  }
584
619
  if (toolSuffixSlot) {
585
- btnVNs.push(...getSlotVNs(toolSuffixSlot.call($xeToolbar, { tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
620
+ rtVNs.push(
621
+ h('span', {
622
+ key: 'tts',
623
+ class: 'vxe-tool--suffix-wrapper'
624
+ }, getSlotVNs(toolSuffixSlot.call($xeToolbar, { tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
625
+ )
586
626
  }
587
- return btnVNs
627
+ return rtVNs
588
628
  },
589
629
  renderToolImport (h: CreateElement) {
590
630
  // 使用已安装的组件,如果未安装则不渲染
@@ -734,17 +774,11 @@ export default /* define-vxe-component start */ defineVxeComponent({
734
774
  renderVN (h: CreateElement): VNode {
735
775
  const $xeToolbar = this
736
776
  const props = $xeToolbar
737
- const slots = $xeToolbar.$scopedSlots
738
- const internalData = $xeToolbar.internalData
739
777
  const $xeGrid = $xeToolbar.$xeGrid
740
778
  const $xeGantt = $xeToolbar.$xeGantt
741
779
  const $xeGGWrapper = $xeGrid || $xeGantt
742
780
 
743
781
  const { perfect, loading, refresh, zoom, custom, className } = props
744
- const { connectTable } = internalData
745
- const $table = connectTable
746
- const toolsSlot = slots.tools
747
- const buttonsSlot = slots.buttons
748
782
  const vSize = $xeToolbar.computeSize
749
783
  return h('div', {
750
784
  ref: 'refElem',
@@ -756,10 +790,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
756
790
  }, [
757
791
  h('div', {
758
792
  class: 'vxe-buttons--wrapper'
759
- }, buttonsSlot ? buttonsSlot({ $grid: $xeGrid, $gantt: $xeGantt, $table: $table }) : $xeToolbar.renderLeftBtns(h)),
793
+ }, $xeToolbar.renderLeftBtns(h)),
760
794
  h('div', {
761
795
  class: 'vxe-tools--wrapper'
762
- }, toolsSlot ? toolsSlot({ $grid: $xeGrid, $gantt: $xeGantt, $table: $table }) : $xeToolbar.renderRightTools(h)),
796
+ }, $xeToolbar.renderRightTools(h)),
763
797
  h('div', {
764
798
  class: 'vxe-tools--operate'
765
799
  }, [
@@ -68,10 +68,6 @@
68
68
  display: flex;
69
69
  align-items: center;
70
70
  }
71
- .vxe-buttons--wrapper,
72
- .vxe-tools--wrapper {
73
- flex-wrap: wrap;
74
- }
75
71
  .vxe-tools--operate {
76
72
  flex-shrink: 0;
77
73
  }
@@ -84,6 +80,17 @@
84
80
  }
85
81
  }
86
82
  }
83
+ .vxe-button--item-wrapper,
84
+ .vxe-tool--item-wrapper,
85
+ .vxe-button--prefix-wrapper,
86
+ .vxe-button--suffix-wrapper,
87
+ .vxe-tool--prefix-wrapper,
88
+ .vxe-tool--suffix-wrapper {
89
+ display: flex;
90
+ align-items: center;
91
+ flex-shrink: 0;
92
+ flex-wrap: wrap;
93
+ }
87
94
  }
88
95
 
89
96
  .vxe-toolbar {