vxe-table 3.12.0-beta.8 → 3.12.0

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 (79) hide show
  1. package/es/locale/lang/de-DE.js +490 -490
  2. package/es/locale/lang/en-US.js +438 -438
  3. package/es/locale/lang/it-IT.js +692 -0
  4. package/es/locale/lang/ru-RU.js +36 -36
  5. package/es/locale/lang/th-TH.js +692 -0
  6. package/es/locale/lang/zh-CHT.js +19 -19
  7. package/es/style.css +1 -1
  8. package/es/table/module/custom/panel.js +5 -5
  9. package/es/table/module/export/mixin.js +208 -140
  10. package/es/table/module/validator/mixin.js +2 -6
  11. package/es/table/src/cell.js +88 -61
  12. package/es/table/src/column.js +2 -2
  13. package/es/table/src/group.js +2 -2
  14. package/es/table/src/methods.js +112 -87
  15. package/es/table/src/table.js +7 -11
  16. package/es/toolbar/src/toolbar.js +22 -4
  17. package/es/ui/index.js +2 -2
  18. package/es/ui/src/log.js +1 -1
  19. package/es/ui/src/vn.js +3 -0
  20. package/lib/index.umd.js +513 -362
  21. package/lib/index.umd.min.js +1 -1
  22. package/lib/locale/lang/de-DE.js +490 -490
  23. package/lib/locale/lang/de-DE.min.js +1 -1
  24. package/lib/locale/lang/en-US.js +438 -438
  25. package/lib/locale/lang/en-US.min.js +1 -1
  26. package/lib/locale/lang/en-US.umd.js +438 -438
  27. package/lib/locale/lang/it-IT.js +698 -0
  28. package/lib/locale/lang/it-IT.min.js +1 -0
  29. package/lib/locale/lang/ru-RU.js +36 -36
  30. package/lib/locale/lang/ru-RU.min.js +1 -1
  31. package/lib/locale/lang/ru-RU.umd.js +36 -36
  32. package/lib/locale/lang/th-TH.js +698 -0
  33. package/lib/locale/lang/th-TH.min.js +1 -0
  34. package/lib/locale/lang/zh-CHT.js +19 -19
  35. package/lib/locale/lang/zh-CHT.min.js +1 -1
  36. package/lib/locale/lang/zh-CHT.umd.js +19 -19
  37. package/lib/style.css +1 -1
  38. package/lib/table/module/custom/panel.js +5 -5
  39. package/lib/table/module/custom/panel.min.js +1 -1
  40. package/lib/table/module/export/mixin.js +239 -167
  41. package/lib/table/module/export/mixin.min.js +1 -1
  42. package/lib/table/module/validator/mixin.js +1 -6
  43. package/lib/table/module/validator/mixin.min.js +1 -1
  44. package/lib/table/src/cell.js +109 -83
  45. package/lib/table/src/cell.min.js +1 -1
  46. package/lib/table/src/methods.js +112 -87
  47. package/lib/table/src/methods.min.js +1 -1
  48. package/lib/table/src/table.js +4 -9
  49. package/lib/table/src/table.min.js +1 -1
  50. package/lib/toolbar/src/toolbar.js +36 -2
  51. package/lib/toolbar/src/toolbar.min.js +1 -1
  52. package/lib/ui/index.js +2 -2
  53. package/lib/ui/index.min.js +1 -1
  54. package/lib/ui/src/log.js +1 -1
  55. package/lib/ui/src/log.min.js +1 -1
  56. package/lib/ui/src/vn.js +3 -0
  57. package/lib/ui/src/vn.min.js +1 -1
  58. package/package.json +3 -3
  59. package/packages/locale/lang/de-DE.ts +492 -491
  60. package/packages/locale/lang/en-US.ts +438 -438
  61. package/packages/locale/lang/it-IT.ts +692 -0
  62. package/packages/locale/lang/ru-RU.ts +36 -36
  63. package/packages/locale/lang/th-TH.ts +692 -0
  64. package/packages/locale/lang/zh-CHT.ts +19 -19
  65. package/packages/table/module/custom/panel.ts +5 -5
  66. package/packages/table/module/export/mixin.ts +227 -156
  67. package/packages/table/module/validator/mixin.ts +2 -6
  68. package/packages/table/src/cell.ts +141 -108
  69. package/packages/table/src/methods.ts +136 -105
  70. package/packages/table/src/table.ts +8 -12
  71. package/packages/toolbar/src/toolbar.ts +26 -8
  72. package/packages/ui/index.ts +1 -1
  73. package/packages/ui/src/vn.ts +4 -1
  74. /package/es/{iconfont.1735299026800.ttf → iconfont.1735661059384.ttf} +0 -0
  75. /package/es/{iconfont.1735299026800.woff → iconfont.1735661059384.woff} +0 -0
  76. /package/es/{iconfont.1735299026800.woff2 → iconfont.1735661059384.woff2} +0 -0
  77. /package/lib/{iconfont.1735299026800.ttf → iconfont.1735661059384.ttf} +0 -0
  78. /package/lib/{iconfont.1735299026800.woff → iconfont.1735661059384.woff} +0 -0
  79. /package/lib/{iconfont.1735299026800.woff2 → iconfont.1735661059384.woff2} +0 -0
@@ -5,8 +5,8 @@ import { VxeUI } from '../../ui'
5
5
  import { getSlotVNs } from '../../ui/src/vn'
6
6
  import { warnLog, errLog } from '../../ui/src/log'
7
7
 
8
- import type { ValueOf, VxeButtonComponent, VxeComponentSizeType } from 'vxe-pc-ui'
9
- import type { VxeGridConstructor, GridPrivateMethods, ToolbarInternalData, VxeTablePrivateMethods, VxeTableDefines, VxeToolbarEmits, VxeToolbarPropTypes, VxeTableConstructor, VxeTablePropTypes, ToolbarReactData } from '../../../types'
8
+ import type { ValueOf, VxeButtonComponent, VxeComponentSizeType, VxeComponentSlotType } from 'vxe-pc-ui'
9
+ import type { VxeGridConstructor, GridPrivateMethods, ToolbarInternalData, VxeTableDefines, VxeToolbarEmits, VxeToolbarPropTypes, VxeTablePropTypes, ToolbarReactData, VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
10
10
 
11
11
  const { getConfig, getIcon, getI18n, renderer, commands, createEvent, globalMixins, renderEmptyElement } = VxeUI
12
12
 
@@ -139,13 +139,13 @@ export default defineVxeComponent({
139
139
  },
140
140
  syncUpdate (params: {
141
141
  collectColumn: VxeTableDefines.ColumnInfo<any>[]
142
- $table: VxeTableConstructor<any> & VxeTablePrivateMethods<any>
142
+ $table: VxeTableConstructor
143
143
  }) {
144
144
  const $xeToolbar = this
145
145
  const reactData = $xeToolbar.reactData
146
146
  const internalData = $xeToolbar.internalData
147
147
 
148
- internalData.connectTable = params.$table
148
+ internalData.connectTable = params.$table as (VxeTableConstructor & VxeTablePrivateMethods)
149
149
  reactData.columns = params.collectColumn
150
150
  reactData.connectFlag++
151
151
  },
@@ -376,19 +376,25 @@ export default defineVxeComponent({
376
376
  /**
377
377
  * 渲染按钮
378
378
  */
379
- renderBtns (h: CreateElement): VNode[] {
379
+ renderLeftBtns (h: CreateElement): VxeComponentSlotType[] {
380
380
  // 使用已安装的组件,如果未安装则不渲染
381
381
  const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
382
382
 
383
383
  const $xeToolbar = this
384
384
  const props = $xeToolbar
385
+ const slots = $xeToolbar.$scopedSlots
385
386
  const internalData = $xeToolbar.internalData
386
387
  const $xeGrid = $xeToolbar.$xeGrid
387
388
 
388
389
  const { buttons } = props
389
390
  const { connectTable } = internalData
390
391
  const $table = connectTable
391
- const btnVNs: VNode[] = []
392
+ const buttonPrefixSlot = slots.buttonPrefix || slots['button-prefix']
393
+ const buttonSuffixSlot = slots.buttonSuffix || slots['button-suffix']
394
+ const btnVNs: VxeComponentSlotType[] = []
395
+ if (buttonPrefixSlot) {
396
+ btnVNs.push(...getSlotVNs(buttonPrefixSlot.call($xeToolbar, { buttons: buttons || [], $grid: $xeGrid, $table: $table })))
397
+ }
392
398
  if (buttons) {
393
399
  buttons.forEach((item) => {
394
400
  const { dropdowns, buttonRender } = item
@@ -440,6 +446,9 @@ export default defineVxeComponent({
440
446
  }
441
447
  })
442
448
  }
449
+ if (buttonSuffixSlot) {
450
+ btnVNs.push(...getSlotVNs(buttonSuffixSlot.call($xeToolbar, { buttons: buttons || [], $grid: $xeGrid, $table: $table })))
451
+ }
443
452
  return btnVNs
444
453
  },
445
454
  /**
@@ -451,13 +460,19 @@ export default defineVxeComponent({
451
460
 
452
461
  const $xeToolbar = this
453
462
  const props = $xeToolbar
463
+ const slots = $xeToolbar.$scopedSlots
454
464
  const internalData = $xeToolbar.internalData
455
465
  const $xeGrid = $xeToolbar.$xeGrid
456
466
 
457
467
  const { tools } = props
458
468
  const { connectTable } = internalData
459
469
  const $table = connectTable
460
- const btnVNs: VNode[] = []
470
+ const toolPrefixSlot = slots.toolPrefix || slots['tool-prefix']
471
+ const toolSuffixSlot = slots.toolSuffix || slots['tool-suffix']
472
+ const btnVNs: VxeComponentSlotType[] = []
473
+ if (toolPrefixSlot) {
474
+ btnVNs.push(...getSlotVNs(toolPrefixSlot.call($xeToolbar, { tools: tools || [], $grid: $xeGrid, $table: $table })))
475
+ }
461
476
  if (tools) {
462
477
  tools.forEach((item, tIndex) => {
463
478
  const { dropdowns, toolRender } = item
@@ -512,6 +527,9 @@ export default defineVxeComponent({
512
527
  }
513
528
  })
514
529
  }
530
+ if (toolSuffixSlot) {
531
+ btnVNs.push(...getSlotVNs(toolSuffixSlot.call($xeToolbar, { tools: tools || [], $grid: $xeGrid, $table: $table })))
532
+ }
515
533
  return btnVNs
516
534
  },
517
535
  renderToolImport (h: CreateElement) {
@@ -680,7 +698,7 @@ export default defineVxeComponent({
680
698
  }, [
681
699
  h('div', {
682
700
  class: 'vxe-buttons--wrapper'
683
- }, buttonsSlot ? buttonsSlot({ $grid: $xeGrid, $table: $table }) : $xeToolbar.renderBtns(h)),
701
+ }, buttonsSlot ? buttonsSlot({ $grid: $xeGrid, $table: $table }) : $xeToolbar.renderLeftBtns(h)),
684
702
  h('div', {
685
703
  class: 'vxe-tools--wrapper'
686
704
  }, toolsSlot ? toolsSlot({ $grid: $xeGrid, $table: $table }) : $xeToolbar.renderRightTools(h)),
@@ -37,7 +37,7 @@ VxeUI.setConfig({
37
37
  // keyField: '_X_ROW_KEY' // 行数据的唯一主键字段名
38
38
  // },
39
39
  resizeConfig: {
40
- // refreshDelay: 250
40
+ // refreshDelay: 20
41
41
  },
42
42
  resizableConfig: {
43
43
  dragMode: 'auto',
@@ -31,7 +31,10 @@ export function getChangeEvent (renderOpts: any) {
31
31
  return 'change'
32
32
  }
33
33
 
34
- export function getSlotVNs (vns: VxeComponentSlotType | VxeComponentSlotType[]) {
34
+ export function getSlotVNs (vns: VxeComponentSlotType | VxeComponentSlotType[] | undefined) {
35
+ if (vns === null || vns === undefined) {
36
+ return []
37
+ }
35
38
  if (XEUtils.isArray(vns)) {
36
39
  return vns
37
40
  }