vxe-table 4.17.22 → 4.17.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/table.js +5 -1
  6. package/es/toolbar/src/toolbar.js +91 -67
  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 +125 -101
  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/table.js +2 -2
  20. package/lib/table/src/table.min.js +1 -1
  21. package/lib/toolbar/src/toolbar.js +123 -99
  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/table.ts +6 -2
  33. package/packages/toolbar/src/toolbar.ts +115 -79
  34. package/styles/components/toolbar.scss +11 -4
  35. /package/es/{iconfont.1764380640866.ttf → iconfont.1764811572357.ttf} +0 -0
  36. /package/es/{iconfont.1764380640866.woff → iconfont.1764811572357.woff} +0 -0
  37. /package/es/{iconfont.1764380640866.woff2 → iconfont.1764811572357.woff2} +0 -0
  38. /package/lib/{iconfont.1764380640866.ttf → iconfont.1764811572357.ttf} +0 -0
  39. /package/lib/{iconfont.1764380640866.woff → iconfont.1764811572357.woff} +0 -0
  40. /package/lib/{iconfont.1764380640866.woff2 → iconfont.1764811572357.woff2} +0 -0
@@ -398,51 +398,71 @@ export default defineVxeComponent({
398
398
  const { buttons } = props
399
399
  const { connectTable } = internalData
400
400
  const $table = connectTable
401
+ const buttonsSlot = slots.buttons
401
402
  const buttonPrefixSlot = slots.buttonPrefix || slots['button-prefix']
402
403
  const buttonSuffixSlot = slots.buttonSuffix || slots['button-suffix']
403
- const btnVNs: VxeComponentSlotType[] = []
404
+ const lbVNs: VxeComponentSlotType[] = []
404
405
  if (buttonPrefixSlot) {
405
- btnVNs.push(...getSlotVNs(buttonPrefixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
406
- }
407
- if (buttons) {
408
- buttons.forEach((item, index) => {
409
- const { dropdowns, buttonRender } = item
410
- if (item.visible !== false) {
411
- const compConf = buttonRender ? renderer.get(buttonRender.name) : null
412
- if (buttonRender && compConf && compConf.renderToolbarButton) {
413
- const toolbarButtonClassName = compConf.toolbarButtonClassName
414
- const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table!, button: item }
415
- btnVNs.push(
416
- h('span', {
417
- key: `br${item.code || index}`,
418
- class: ['vxe-button--item', toolbarButtonClassName ? (XEUtils.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName) : '']
419
- }, getSlotVNs(compConf.renderToolbarButton(buttonRender, params)))
420
- )
421
- } else {
422
- if (VxeUIButtonComponent) {
406
+ lbVNs.push(
407
+ h('span', {
408
+ key: 'tbp',
409
+ class: 'vxe-button--prefix-wrapper'
410
+ }, getSlotVNs(buttonPrefixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
411
+ )
412
+ }
413
+ if (buttons || buttonsSlot) {
414
+ const btnVNs: VxeComponentSlotType[] = []
415
+ if (buttons) {
416
+ buttons.forEach((item, index) => {
417
+ const { dropdowns, buttonRender } = item
418
+ if (item.visible !== false) {
419
+ const compConf = buttonRender ? renderer.get(buttonRender.name) : null
420
+ if (buttonRender && compConf && compConf.renderToolbarButton) {
421
+ const toolbarButtonClassName = compConf.toolbarButtonClassName
422
+ const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table!, button: item }
423
423
  btnVNs.push(
424
- h(VxeUIButtonComponent, {
425
- key: `bd${item.code || index}`,
426
- ...Object.assign({}, item, {
427
- content: item.content || item.name,
428
- options: undefined
429
- }),
430
- onClick: (eventParams) => btnEvent(eventParams, item)
431
- }, dropdowns && dropdowns.length
432
- ? {
433
- dropdowns: () => renderDropdowns(item, true)
434
- }
435
- : {})
424
+ h('span', {
425
+ key: `br${item.code || index}`,
426
+ class: ['vxe-button--item', toolbarButtonClassName ? (XEUtils.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName) : '']
427
+ }, getSlotVNs(compConf.renderToolbarButton(buttonRender, params)))
436
428
  )
429
+ } else {
430
+ if (VxeUIButtonComponent) {
431
+ btnVNs.push(
432
+ h(VxeUIButtonComponent, {
433
+ key: `bd${item.code || index}`,
434
+ ...Object.assign({}, item, {
435
+ content: item.content || item.name,
436
+ options: undefined
437
+ }),
438
+ onClick: (eventParams) => btnEvent(eventParams, item)
439
+ }, dropdowns && dropdowns.length
440
+ ? {
441
+ dropdowns: () => renderDropdowns(item, true)
442
+ }
443
+ : {})
444
+ )
445
+ }
437
446
  }
438
447
  }
439
- }
440
- })
448
+ })
449
+ }
450
+ lbVNs.push(
451
+ h('span', {
452
+ key: 'tti',
453
+ class: 'vxe-button--item-wrapper'
454
+ }, buttonsSlot ? getSlotVNs(buttonsSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : btnVNs)
455
+ )
441
456
  }
442
457
  if (buttonSuffixSlot) {
443
- btnVNs.push(...getSlotVNs(buttonSuffixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
444
- }
445
- return btnVNs
458
+ lbVNs.push(
459
+ h('span', {
460
+ key: 'tbs',
461
+ class: 'vxe-button--suffix-wrapper'
462
+ }, getSlotVNs(buttonSuffixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
463
+ )
464
+ }
465
+ return lbVNs
446
466
  }
447
467
 
448
468
  /**
@@ -452,52 +472,72 @@ export default defineVxeComponent({
452
472
  const { tools } = props
453
473
  const { connectTable } = internalData
454
474
  const $table = connectTable
475
+ const toolsSlot = slots.tools
455
476
  const toolPrefixSlot = slots.toolPrefix || slots['tool-prefix']
456
477
  const toolSuffixSlot = slots.toolSuffix || slots['tool-suffix']
457
- const btnVNs: VxeComponentSlotType[] = []
478
+ const rtVNs: VxeComponentSlotType[] = []
458
479
  if (toolPrefixSlot) {
459
- btnVNs.push(...getSlotVNs(toolPrefixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
460
- }
461
- if (tools) {
462
- tools.forEach((item, tIndex) => {
463
- const { dropdowns, toolRender } = item
464
- if (item.visible !== false) {
465
- const rdName = toolRender ? toolRender.name : null
466
- const compConf = toolRender ? renderer.get(rdName) : null
467
- if (toolRender && compConf && compConf.renderToolbarTool) {
468
- const toolbarToolClassName = compConf.toolbarToolClassName
469
- const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table!, tool: item }
470
- btnVNs.push(
471
- h('span', {
472
- key: rdName as string,
473
- class: ['vxe-tool--item', toolbarToolClassName ? (XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName) : '']
474
- }, getSlotVNs(compConf.renderToolbarTool(toolRender, params)))
475
- )
476
- } else {
477
- if (VxeUIButtonComponent) {
480
+ rtVNs.push(
481
+ h('span', {
482
+ key: 'ttp',
483
+ class: 'vxe-tool--prefix-wrapper'
484
+ }, getSlotVNs(toolPrefixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
485
+ )
486
+ }
487
+ if (tools || toolsSlot) {
488
+ const btnVNs: VxeComponentSlotType[] = []
489
+ if (tools) {
490
+ tools.forEach((item, tIndex) => {
491
+ const { dropdowns, toolRender } = item
492
+ if (item.visible !== false) {
493
+ const rdName = toolRender ? toolRender.name : null
494
+ const compConf = toolRender ? renderer.get(rdName) : null
495
+ if (toolRender && compConf && compConf.renderToolbarTool) {
496
+ const toolbarToolClassName = compConf.toolbarToolClassName
497
+ const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table!, tool: item }
478
498
  btnVNs.push(
479
- h(VxeUIButtonComponent, {
480
- key: tIndex,
481
- ...Object.assign({}, item, {
482
- content: item.content || item.name,
483
- options: undefined
484
- }),
485
- onClick: (eventParams) => tolEvent(eventParams, item)
486
- }, dropdowns && dropdowns.length
487
- ? {
488
- dropdowns: () => renderDropdowns(item, false)
489
- }
490
- : {})
499
+ h('span', {
500
+ key: rdName as string,
501
+ class: ['vxe-tool--item', toolbarToolClassName ? (XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName) : '']
502
+ }, getSlotVNs(compConf.renderToolbarTool(toolRender, params)))
491
503
  )
504
+ } else {
505
+ if (VxeUIButtonComponent) {
506
+ btnVNs.push(
507
+ h(VxeUIButtonComponent, {
508
+ key: tIndex,
509
+ ...Object.assign({}, item, {
510
+ content: item.content || item.name,
511
+ options: undefined
512
+ }),
513
+ onClick: (eventParams) => tolEvent(eventParams, item)
514
+ }, dropdowns && dropdowns.length
515
+ ? {
516
+ dropdowns: () => renderDropdowns(item, false)
517
+ }
518
+ : {})
519
+ )
520
+ }
492
521
  }
493
522
  }
494
- }
495
- })
523
+ })
524
+ }
525
+ rtVNs.push(
526
+ h('span', {
527
+ key: 'tti',
528
+ class: 'vxe-tool--item-wrapper'
529
+ }, toolsSlot ? getSlotVNs(toolsSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : btnVNs)
530
+ )
496
531
  }
497
532
  if (toolSuffixSlot) {
498
- btnVNs.push(...getSlotVNs(toolSuffixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
499
- }
500
- return btnVNs
533
+ rtVNs.push(
534
+ h('span', {
535
+ key: 'tts',
536
+ class: 'vxe-tool--suffix-wrapper'
537
+ }, getSlotVNs(toolSuffixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })))
538
+ )
539
+ }
540
+ return rtVNs
501
541
  }
502
542
 
503
543
  const renderToolImport = () => {
@@ -597,11 +637,7 @@ export default defineVxeComponent({
597
637
 
598
638
  const renderVN = () => {
599
639
  const { perfect, loading, refresh, zoom, custom, className } = props
600
- const { connectTable } = internalData
601
640
  const vSize = computeSize.value
602
- const toolsSlot = slots.tools
603
- const buttonsSlot = slots.buttons
604
- const $table = connectTable
605
641
 
606
642
  return h('div', {
607
643
  ref: refElem,
@@ -613,10 +649,10 @@ export default defineVxeComponent({
613
649
  }, [
614
650
  h('div', {
615
651
  class: 'vxe-buttons--wrapper'
616
- }, buttonsSlot ? buttonsSlot({ $grid: $xeGrid, $gantt: $xeGantt, $table: $table }) : renderLeftBtns()),
652
+ }, renderLeftBtns()),
617
653
  h('div', {
618
654
  class: 'vxe-tools--wrapper'
619
- }, toolsSlot ? toolsSlot({ $grid: $xeGrid, $gantt: $xeGantt, $table: $table }) : renderRightTools()),
655
+ }, renderRightTools()),
620
656
  h('div', {
621
657
  class: 'vxe-tools--operate'
622
658
  }, [
@@ -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 {