vxe-table 3.9.0-rc.2 → 3.9.0-rc.21

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 (186) hide show
  1. package/es/grid/src/grid.js +120 -66
  2. package/es/locale/lang/en-US.js +2 -8
  3. package/es/locale/lang/es-ES.js +2 -1
  4. package/es/locale/lang/hu-HU.d.ts +2 -0
  5. package/es/locale/lang/hu-HU.js +497 -501
  6. package/es/locale/lang/ja-JP.js +2 -8
  7. package/es/locale/lang/ko-KR.d.ts +2 -0
  8. package/es/locale/lang/ko-KR.js +2 -8
  9. package/es/locale/lang/pt-BR.js +2 -8
  10. package/es/locale/lang/ru-RU.d.ts +2 -0
  11. package/es/locale/lang/ru-RU.js +497 -503
  12. package/es/locale/lang/uk-UA.d.ts +2 -0
  13. package/es/locale/lang/uk-UA.js +667 -0
  14. package/es/locale/lang/vi-VN.js +2 -8
  15. package/es/locale/lang/zh-CHT.d.ts +2 -0
  16. package/es/locale/lang/zh-CHT.js +667 -0
  17. package/es/locale/lang/zh-CN.js +2 -8
  18. package/es/locale/lang/zh-HK.js +2 -2
  19. package/es/locale/lang/zh-MO.js +2 -2
  20. package/es/locale/lang/zh-TC.js +2 -673
  21. package/es/locale/lang/zh-TW.js +2 -2
  22. package/es/style.css +1 -1
  23. package/es/style.min.css +1 -1
  24. package/es/table/index.js +29 -3
  25. package/es/table/module/custom/panel.js +183 -173
  26. package/es/table/module/edit/mixin.js +33 -24
  27. package/es/table/module/export/export-panel.js +32 -4
  28. package/es/table/module/export/import-panel.js +24 -5
  29. package/es/table/module/export/mixin.js +11 -11
  30. package/es/table/module/menu/mixin.js +2 -2
  31. package/es/table/module/validator/mixin.js +4 -4
  32. package/es/table/render/index.js +23 -38
  33. package/es/table/src/body.js +1 -0
  34. package/es/table/src/columnInfo.js +3 -3
  35. package/es/table/src/methods.js +48 -40
  36. package/es/table/src/props.js +65 -15
  37. package/es/table/src/table.js +161 -55
  38. package/es/table/src/util.js +3 -2
  39. package/es/table/style.css +37 -23
  40. package/es/table/style.min.css +1 -1
  41. package/es/toolbar/src/toolbar.js +21 -7
  42. package/es/ui/index.js +5 -4
  43. package/es/ui/src/log.js +1 -1
  44. package/es/ui/src/vn.js +24 -1
  45. package/es/vxe-table/style.css +37 -23
  46. package/es/vxe-table/style.min.css +1 -1
  47. package/lib/grid/src/grid.js +115 -68
  48. package/lib/grid/src/grid.min.js +1 -1
  49. package/lib/index.umd.js +632 -330
  50. package/lib/index.umd.min.js +1 -1
  51. package/lib/locale/lang/en-US.js +2 -8
  52. package/lib/locale/lang/en-US.min.js +1 -1
  53. package/lib/locale/lang/en-US.umd.js +2 -8
  54. package/lib/locale/lang/es-ES.js +2 -1
  55. package/lib/locale/lang/es-ES.min.js +1 -1
  56. package/lib/locale/lang/es-ES.umd.js +2 -1
  57. package/lib/locale/lang/hu-HU.d.ts +2 -0
  58. package/lib/locale/lang/hu-HU.js +497 -501
  59. package/lib/locale/lang/hu-HU.min.js +1 -1
  60. package/lib/locale/lang/hu-HU.umd.js +687 -0
  61. package/lib/locale/lang/ja-JP.js +2 -8
  62. package/lib/locale/lang/ja-JP.min.js +1 -1
  63. package/lib/locale/lang/ja-JP.umd.js +2 -8
  64. package/lib/locale/lang/ko-KR.d.ts +2 -0
  65. package/lib/locale/lang/ko-KR.js +2 -8
  66. package/lib/locale/lang/ko-KR.min.js +1 -1
  67. package/lib/locale/lang/ko-KR.umd.js +687 -0
  68. package/lib/locale/lang/pt-BR.js +2 -8
  69. package/lib/locale/lang/pt-BR.min.js +1 -1
  70. package/lib/locale/lang/pt-BR.umd.js +2 -8
  71. package/lib/locale/lang/ru-RU.d.ts +2 -0
  72. package/lib/locale/lang/ru-RU.js +497 -503
  73. package/lib/locale/lang/ru-RU.min.js +1 -1
  74. package/lib/locale/lang/ru-RU.umd.js +687 -0
  75. package/lib/locale/lang/uk-UA.d.ts +2 -0
  76. package/lib/locale/lang/uk-UA.js +673 -0
  77. package/lib/locale/lang/uk-UA.min.js +1 -0
  78. package/lib/locale/lang/uk-UA.umd.js +687 -0
  79. package/lib/locale/lang/vi-VN.js +2 -8
  80. package/lib/locale/lang/vi-VN.min.js +1 -1
  81. package/lib/locale/lang/zh-CHT.d.ts +2 -0
  82. package/lib/locale/lang/zh-CHT.js +673 -0
  83. package/lib/locale/lang/zh-CHT.min.js +1 -0
  84. package/lib/locale/lang/zh-CHT.umd.js +687 -0
  85. package/lib/locale/lang/zh-CN.js +2 -8
  86. package/lib/locale/lang/zh-CN.min.js +1 -1
  87. package/lib/locale/lang/zh-CN.umd.js +2 -8
  88. package/lib/locale/lang/zh-HK.js +2 -2
  89. package/lib/locale/lang/zh-HK.min.js +1 -1
  90. package/lib/locale/lang/zh-HK.umd.js +7 -677
  91. package/lib/locale/lang/zh-MO.js +2 -2
  92. package/lib/locale/lang/zh-MO.min.js +1 -1
  93. package/lib/locale/lang/zh-MO.umd.js +7 -677
  94. package/lib/locale/lang/zh-TC.js +3 -673
  95. package/lib/locale/lang/zh-TC.min.js +1 -1
  96. package/lib/locale/lang/zh-TC.umd.js +7 -677
  97. package/lib/locale/lang/zh-TW.js +2 -2
  98. package/lib/locale/lang/zh-TW.min.js +1 -1
  99. package/lib/locale/lang/zh-TW.umd.js +7 -677
  100. package/lib/style.css +1 -1
  101. package/lib/style.min.css +1 -1
  102. package/lib/table/index.js +30 -3
  103. package/lib/table/index.min.js +1 -1
  104. package/lib/table/module/custom/panel.js +12 -7
  105. package/lib/table/module/custom/panel.min.js +1 -1
  106. package/lib/table/module/edit/mixin.js +32 -23
  107. package/lib/table/module/edit/mixin.min.js +1 -1
  108. package/lib/table/module/export/export-panel.js +31 -4
  109. package/lib/table/module/export/export-panel.min.js +1 -1
  110. package/lib/table/module/export/import-panel.js +23 -5
  111. package/lib/table/module/export/import-panel.min.js +1 -1
  112. package/lib/table/module/export/mixin.js +11 -11
  113. package/lib/table/module/export/mixin.min.js +1 -1
  114. package/lib/table/module/menu/mixin.js +2 -2
  115. package/lib/table/module/menu/mixin.min.js +1 -1
  116. package/lib/table/module/validator/mixin.js +4 -4
  117. package/lib/table/module/validator/mixin.min.js +1 -1
  118. package/lib/table/render/index.js +27 -41
  119. package/lib/table/render/index.min.js +1 -1
  120. package/lib/table/src/body.js +1 -1
  121. package/lib/table/src/body.min.js +1 -1
  122. package/lib/table/src/columnInfo.js +3 -3
  123. package/lib/table/src/columnInfo.min.js +1 -1
  124. package/lib/table/src/methods.js +47 -40
  125. package/lib/table/src/methods.min.js +1 -1
  126. package/lib/table/src/props.js +7 -0
  127. package/lib/table/src/props.min.js +1 -1
  128. package/lib/table/src/table.js +147 -48
  129. package/lib/table/src/table.min.js +1 -1
  130. package/lib/table/src/util.js +3 -2
  131. package/lib/table/src/util.min.js +1 -1
  132. package/lib/table/style/style.css +37 -23
  133. package/lib/table/style/style.min.css +1 -1
  134. package/lib/toolbar/src/toolbar.js +21 -7
  135. package/lib/toolbar/src/toolbar.min.js +1 -1
  136. package/lib/ui/index.js +6 -5
  137. package/lib/ui/index.min.js +1 -1
  138. package/lib/ui/src/log.js +1 -1
  139. package/lib/ui/src/log.min.js +1 -1
  140. package/lib/ui/src/vn.js +26 -1
  141. package/lib/ui/src/vn.min.js +1 -1
  142. package/lib/vxe-table/style/style.css +37 -23
  143. package/lib/vxe-table/style/style.min.css +1 -1
  144. package/package.json +2 -2
  145. package/packages/grid/src/grid.ts +127 -65
  146. package/packages/locale/lang/en-US.ts +2 -10
  147. package/packages/locale/lang/es-ES.ts +2 -1
  148. package/packages/locale/lang/hu-HU.ts +497 -503
  149. package/packages/locale/lang/ja-JP.ts +2 -10
  150. package/packages/locale/lang/ko-KR.ts +2 -10
  151. package/packages/locale/lang/pt-BR.ts +2 -10
  152. package/packages/locale/lang/ru-RU.ts +497 -505
  153. package/packages/locale/lang/uk-UA.ts +667 -0
  154. package/packages/locale/lang/vi-VN.ts +2 -10
  155. package/packages/locale/lang/zh-CHT.ts +667 -0
  156. package/packages/locale/lang/zh-CN.ts +2 -10
  157. package/packages/locale/lang/zh-HK.ts +2 -2
  158. package/packages/locale/lang/zh-MO.ts +2 -2
  159. package/packages/locale/lang/zh-TC.ts +2 -674
  160. package/packages/locale/lang/zh-TW.ts +2 -2
  161. package/packages/table/index.ts +28 -5
  162. package/packages/table/module/custom/panel.ts +186 -175
  163. package/packages/table/module/edit/mixin.ts +32 -23
  164. package/packages/table/module/export/export-panel.ts +36 -4
  165. package/packages/table/module/export/import-panel.ts +28 -5
  166. package/packages/table/module/export/mixin.ts +11 -11
  167. package/packages/table/module/menu/mixin.ts +2 -2
  168. package/packages/table/module/validator/mixin.ts +4 -4
  169. package/packages/table/render/index.ts +26 -40
  170. package/packages/table/src/body.ts +1 -0
  171. package/packages/table/src/columnInfo.ts +3 -3
  172. package/packages/table/src/methods.ts +47 -40
  173. package/packages/table/src/props.ts +68 -15
  174. package/packages/table/src/table.ts +167 -56
  175. package/packages/table/src/util.ts +3 -2
  176. package/packages/toolbar/src/toolbar.ts +21 -7
  177. package/packages/ui/index.ts +3 -2
  178. package/packages/ui/src/vn.ts +26 -1
  179. package/styles/components/table.scss +82 -17
  180. package/types/all.d.ts +2 -2
  181. /package/es/{iconfont.1726028471123.ttf → iconfont.1727868548661.ttf} +0 -0
  182. /package/es/{iconfont.1726028471123.woff → iconfont.1727868548661.woff} +0 -0
  183. /package/es/{iconfont.1726028471123.woff2 → iconfont.1727868548661.woff2} +0 -0
  184. /package/lib/{iconfont.1726028471123.ttf → iconfont.1727868548661.ttf} +0 -0
  185. /package/lib/{iconfont.1726028471123.woff → iconfont.1727868548661.woff} +0 -0
  186. /package/lib/{iconfont.1726028471123.woff2 → iconfont.1727868548661.woff2} +0 -0
@@ -1,5 +1,8 @@
1
+ import { PropType } from 'vue'
1
2
  import { VxeUI } from '../../ui'
2
3
 
4
+ import type { VxeTablePropTypes } from '../../../types'
5
+
3
6
  const { getConfig } = VxeUI
4
7
 
5
8
  export default {
@@ -10,39 +13,89 @@ export default {
10
13
  // 表格的高度
11
14
  height: [Number, String],
12
15
  // 表格的最小高度
13
- minHeight: { type: [Number, String], default: () => getConfig().table.minHeight },
16
+ minHeight: {
17
+ type: [Number, String],
18
+ default: () => getConfig().table.minHeight
19
+ },
14
20
  // 表格的最大高度
15
21
  maxHeight: [Number, String],
16
22
  // 已废弃,被 column-config.resizable 替换
17
- resizable: { type: Boolean, default: () => getConfig().table.resizable },
23
+ resizable: {
24
+ type: Boolean,
25
+ default: () => getConfig().table.resizable
26
+ },
18
27
  // 是否带有斑马纹
19
- stripe: { type: Boolean, default: () => getConfig().table.stripe },
28
+ stripe: {
29
+ type: Boolean,
30
+ default: () => getConfig().table.stripe
31
+ },
20
32
  // 是否带有边框
21
- border: { type: [Boolean, String], default: () => getConfig().table.border },
33
+ border: {
34
+ type: [Boolean, String],
35
+ default: () => getConfig().table.border
36
+ },
37
+ // 单元格是否有边距
38
+ padding: {
39
+ type: Boolean as PropType<VxeTablePropTypes.Padding>,
40
+ default: () => getConfig().table.padding
41
+ },
22
42
  // 是否圆角边框
23
- round: { type: Boolean, default: () => getConfig().table.round },
43
+ round: {
44
+ type: Boolean,
45
+ default: () => getConfig().table.round
46
+ },
24
47
  // 表格的尺寸
25
- size: { type: String, default: () => getConfig().table.size || getConfig().size },
48
+ size: {
49
+ type: String,
50
+ default: () => getConfig().table.size || getConfig().size
51
+ },
26
52
  // 列的宽度是否自撑开(可能会被废弃的参数,不要使用)
27
- fit: { type: Boolean, default: () => getConfig().table.fit },
53
+ fit: {
54
+ type: Boolean,
55
+ default: () => getConfig().table.fit
56
+ },
28
57
  // 表格是否加载中
29
58
  loading: Boolean,
30
59
  // 所有的列对其方式
31
- align: { type: String, default: () => getConfig().table.align },
60
+ align: {
61
+ type: String,
62
+ default: () => getConfig().table.align
63
+ },
32
64
  // 所有的表头列的对齐方式
33
- headerAlign: { type: String, default: () => getConfig().table.headerAlign },
65
+ headerAlign: {
66
+ type: String,
67
+ default: () => getConfig().table.headerAlign
68
+ },
34
69
  // 所有的表尾列的对齐方式
35
- footerAlign: { type: String, default: () => getConfig().table.footerAlign },
70
+ footerAlign: {
71
+ type: String,
72
+ default: () => getConfig().table.footerAlign
73
+ },
36
74
  // 是否显示表头
37
- showHeader: { type: Boolean, default: () => getConfig().table.showHeader },
75
+ showHeader: {
76
+ type: Boolean,
77
+ default: () => getConfig().table.showHeader
78
+ },
38
79
  // 已废弃,被 row-config.isCurrent 替换
39
- highlightCurrentRow: { type: Boolean, default: () => getConfig().table.highlightCurrentRow },
80
+ highlightCurrentRow: {
81
+ type: Boolean,
82
+ default: () => getConfig().table.highlightCurrentRow
83
+ },
40
84
  // 已废弃,被 row-config.isHover 替换
41
- highlightHoverRow: { type: Boolean, default: () => getConfig().table.highlightHoverRow },
85
+ highlightHoverRow: {
86
+ type: Boolean,
87
+ default: () => getConfig().table.highlightHoverRow
88
+ },
42
89
  // 已废弃,被 column-config.isCurrent 替换
43
- highlightCurrentColumn: { type: Boolean, default: () => getConfig().table.highlightCurrentColumn },
90
+ highlightCurrentColumn: {
91
+ type: Boolean,
92
+ default: () => getConfig().table.highlightCurrentColumn
93
+ },
44
94
  // 已废弃,被 column-config.isHover 替换
45
- highlightHoverColumn: { type: Boolean, default: () => getConfig().table.highlightHoverColumn },
95
+ highlightHoverColumn: {
96
+ type: Boolean,
97
+ default: () => getConfig().table.highlightHoverColumn
98
+ },
46
99
  // 已废弃,直接删除
47
100
  highlightCell: Boolean,
48
101
  // 是否显示表尾合计
@@ -23,6 +23,8 @@ import keyboardMixin from '../module/keyboard/mixin'
23
23
  import validatorMixin from '../module/validator/mixin'
24
24
  import customMixin from '../module/custom/mixin'
25
25
 
26
+ import type { VxeLoadingComponent, VxeTooltipComponent } from 'vxe-pc-ui'
27
+
26
28
  const { getConfig, getI18n, renderer, globalResize, globalEvents, globalMixins } = VxeUI
27
29
 
28
30
  /**
@@ -362,13 +364,22 @@ export default {
362
364
  return ''
363
365
  },
364
366
  validOpts () {
365
- return Object.assign({ message: 'default' }, getConfig().table.validConfig, this.validConfig)
367
+ return this.computeValidOpts
368
+ },
369
+ computeValidOpts () {
370
+ return Object.assign({ message: 'default' }, XEUtils.clone(getConfig().table.validConfig, true), this.validConfig)
366
371
  },
367
372
  sXOpts () {
368
- return Object.assign({}, getConfig().table.scrollX, this.scrollX)
373
+ return this.computeSXOpts
374
+ },
375
+ computeSXOpts () {
376
+ return Object.assign({}, XEUtils.clone(getConfig().table.scrollX, true), this.scrollX)
369
377
  },
370
378
  sYOpts () {
371
- return Object.assign({}, getConfig().table.scrollY, this.scrollY)
379
+ return this.computeSYOpts
380
+ },
381
+ computeSYOpts () {
382
+ return Object.assign({}, XEUtils.clone(getConfig().table.scrollY, true), this.scrollY)
372
383
  },
373
384
  rowHeightMaps () {
374
385
  return {
@@ -379,28 +390,52 @@ export default {
379
390
  }
380
391
  },
381
392
  columnOpts () {
382
- return Object.assign({}, getConfig().table.columnConfig, this.columnConfig)
393
+ return this.computeColumnOpts
394
+ },
395
+ computeColumnOpts () {
396
+ return Object.assign({}, XEUtils.clone(getConfig().table.columnConfig, true), this.columnConfig)
383
397
  },
384
398
  rowOpts () {
385
- return Object.assign({}, getConfig().table.rowConfig, this.rowConfig)
399
+ return this.computeRowOpts
400
+ },
401
+ computeRowOpts () {
402
+ return Object.assign({}, XEUtils.clone(getConfig().table.rowConfig, true), this.rowConfig)
386
403
  },
387
404
  resizeOpts () {
388
- return Object.assign({}, getConfig().table.resizeConfig, this.resizeConfig)
405
+ return this.computeResizeOpts
406
+ },
407
+ computeResizeOpts () {
408
+ return Object.assign({}, XEUtils.clone(getConfig().table.resizeConfig, true), this.resizeConfig)
389
409
  },
390
410
  resizableOpts () {
391
- return Object.assign({}, getConfig().table.resizableConfig, this.resizableConfig)
411
+ return this.computeResizableOpts
412
+ },
413
+ computeResizableOpts () {
414
+ return Object.assign({}, XEUtils.clone(getConfig().table.resizableConfig, true), this.resizableConfig)
392
415
  },
393
416
  seqOpts () {
394
- return Object.assign({ startIndex: 0 }, getConfig().table.seqConfig, this.seqConfig)
417
+ return this.computeSeqOpts
418
+ },
419
+ computeSeqOpts () {
420
+ return Object.assign({ startIndex: 0 }, XEUtils.clone(getConfig().table.seqConfig, true), this.seqConfig)
395
421
  },
396
422
  radioOpts () {
397
- return Object.assign({}, getConfig().table.radioConfig, this.radioConfig)
423
+ return this.computeRadioOpts
424
+ },
425
+ computeRadioOpts () {
426
+ return Object.assign({}, XEUtils.clone(getConfig().table.radioConfig, true), this.radioConfig)
398
427
  },
399
428
  checkboxOpts () {
400
- return Object.assign({}, getConfig().table.checkboxConfig, this.checkboxConfig)
429
+ return this.computeCheckboxOpts
430
+ },
431
+ computeCheckboxOpts () {
432
+ return Object.assign({}, XEUtils.clone(getConfig().table.checkboxConfig, true), this.checkboxConfig)
401
433
  },
402
434
  tooltipOpts () {
403
- return Object.assign({}, getConfig().tooltip, getConfig().table.tooltipConfig, this.tooltipConfig)
435
+ return this.computeTooltipOpts
436
+ },
437
+ computeTooltipOpts () {
438
+ return Object.assign({}, XEUtils.clone(getConfig().tooltip, true), XEUtils.clone(getConfig().table.tooltipConfig, true), this.tooltipConfig)
404
439
  },
405
440
  tipConfig () {
406
441
  return { ...this.tooltipOpts }
@@ -409,32 +444,52 @@ export default {
409
444
  return Object.assign({ isArrow: false }, this.tooltipOpts)
410
445
  },
411
446
  editOpts () {
412
- return Object.assign({}, getConfig().table.editConfig, this.editConfig)
447
+ return this.computeEditOpts
448
+ },
449
+ computeEditOpts () {
450
+ return Object.assign({}, XEUtils.clone(getConfig().table.editConfig, true), this.editConfig)
413
451
  },
414
452
  sortOpts () {
415
- return Object.assign({ orders: ['asc', 'desc', null] }, getConfig().table.sortConfig, this.sortConfig)
453
+ return this.computeSortOpts
454
+ },
455
+ computeSortOpts () {
456
+ return Object.assign({ orders: ['asc', 'desc', null] }, XEUtils.clone(getConfig().table.sortConfig, true), this.sortConfig)
416
457
  },
417
458
  filterOpts () {
418
- return Object.assign({}, getConfig().table.filterConfig, this.filterConfig)
459
+ return this.computeFilterOpts
460
+ },
461
+ computeFilterOpts () {
462
+ return Object.assign({}, XEUtils.clone(getConfig().table.filterConfig, true), this.filterConfig)
419
463
  },
420
464
  mouseOpts () {
421
- return Object.assign({}, getConfig().table.mouseConfig, this.mouseConfig)
465
+ return this.computeMouseOpts
466
+ },
467
+ computeMouseOpts () {
468
+ return Object.assign({}, XEUtils.clone(getConfig().table.mouseConfig, true), this.mouseConfig)
422
469
  },
423
470
  areaOpts () {
424
- return Object.assign({}, getConfig().table.areaConfig, this.areaConfig)
471
+ return this.computeAreaOpts
472
+ },
473
+ computeAreaOpts () {
474
+ return Object.assign({}, XEUtils.clone(getConfig().table.areaConfig, true), this.areaConfig)
425
475
  },
426
476
  keyboardOpts () {
427
- return Object.assign({}, getConfig().table.keyboardConfig, this.keyboardConfig)
477
+ return this.computeKeyboardOpts
478
+ },
479
+ computeKeyboardOpts () {
480
+ return Object.assign({}, XEUtils.clone(getConfig().table.keyboardConfig, true), this.keyboardConfig)
428
481
  },
429
482
  clipOpts () {
430
- return Object.assign({}, getConfig().table.clipConfig, this.clipConfig)
483
+ return this.computeClipOpts
484
+ },
485
+ computeClipOpts () {
486
+ return Object.assign({}, XEUtils.clone(getConfig().table.clipConfig, true), this.clipConfig)
431
487
  },
432
488
  fnrOpts () {
433
- return Object.assign({}, getConfig().table.fnrConfig, this.fnrConfig)
489
+ return this.computeFNROpts
434
490
  },
435
- hasTip () {
436
- return true
437
- // return VXETable._tooltip
491
+ computeFNROpts () {
492
+ return Object.assign({}, XEUtils.clone(getConfig().table.fnrConfig, true), this.fnrConfig)
438
493
  },
439
494
  headerCtxMenu () {
440
495
  const headerOpts = this.ctxMenuOpts.header
@@ -451,9 +506,6 @@ export default {
451
506
  isCtxMenu () {
452
507
  return !!((this.contextMenu || this.menuConfig) && isEnableConf(this.ctxMenuOpts) && (this.headerCtxMenu.length || this.bodyCtxMenu.length || this.footerCtxMenu.length))
453
508
  },
454
- ctxMenuOpts () {
455
- return Object.assign({}, getConfig().table.menuConfig, this.contextMenu, this.menuConfig)
456
- },
457
509
  ctxMenuList () {
458
510
  const rest: any[] = []
459
511
  this.ctxMenuStore.list.forEach((list: any[]) => {
@@ -463,36 +515,63 @@ export default {
463
515
  })
464
516
  return rest
465
517
  },
518
+ ctxMenuOpts () {
519
+ return this.computeMenuOpts
520
+ },
521
+ computeMenuOpts () {
522
+ return Object.assign({}, XEUtils.clone(getConfig().table.menuConfig, true), this.contextMenu, this.menuConfig)
523
+ },
466
524
  exportOpts () {
467
- return Object.assign({}, getConfig().table.exportConfig, this.exportConfig)
525
+ return this.computeExportOpts
526
+ },
527
+ computeExportOpts () {
528
+ return Object.assign({}, XEUtils.clone(getConfig().table.exportConfig, true), this.exportConfig)
468
529
  },
469
530
  importOpts () {
470
- return Object.assign({}, getConfig().table.importConfig, this.importConfig)
531
+ return this.computeImportOpts
532
+ },
533
+ computeImportOpts () {
534
+ return Object.assign({}, XEUtils.clone(getConfig().table.importConfig, true), this.importConfig)
471
535
  },
472
536
  printOpts () {
473
- return Object.assign({}, getConfig().table.printConfig, this.printConfig)
537
+ return this.computePrintOpts
538
+ },
539
+ computePrintOpts () {
540
+ return Object.assign({}, XEUtils.clone(getConfig().table.printConfig, true), this.printConfig)
474
541
  },
475
542
  expandOpts () {
476
- return Object.assign({}, getConfig().table.expandConfig, this.expandConfig)
543
+ return this.computeExpandOpts
544
+ },
545
+ computeExpandOpts () {
546
+ return Object.assign({}, XEUtils.clone(getConfig().table.expandConfig, true), this.expandConfig)
477
547
  },
478
548
  treeOpts () {
479
- return Object.assign({}, getConfig().table.treeConfig, this.treeConfig)
549
+ return this.computeTreeOpts
550
+ },
551
+ computeTreeOpts () {
552
+ return Object.assign({}, XEUtils.clone(getConfig().table.treeConfig, true), this.treeConfig)
480
553
  },
481
554
  emptyOpts () {
482
- return Object.assign({}, getConfig().table.emptyRender, this.emptyRender)
555
+ return this.computeEmptyOpts
556
+ },
557
+ computeEmptyOpts () {
558
+ return Object.assign({}, XEUtils.clone(getConfig().table.emptyRender, true), this.emptyRender)
483
559
  },
484
560
  loadingOpts () {
485
- return Object.assign({}, getConfig().table.loadingConfig, this.loadingConfig)
561
+ return this.computeLoadingOpts
562
+ },
563
+ computeLoadingOpts () {
564
+ return Object.assign({}, XEUtils.clone(getConfig().table.loadingConfig, true), this.loadingConfig)
486
565
  },
487
566
  cellOffsetWidth () {
488
567
  return this.border ? Math.max(2, Math.ceil(this.scrollbarWidth / this.tableColumn.length)) : 1
489
568
  },
490
- computeCustomOpts () {
491
- return Object.assign({}, getConfig().table.customConfig, this.customConfig)
492
- },
493
569
  customOpts () {
494
570
  return this.computeCustomOpts
495
571
  },
572
+ computeCustomOpts () {
573
+ return Object.assign({}, XEUtils.clone(getConfig().table.customConfig, true), this.customConfig)
574
+ },
496
575
  autoWidthColumnList () {
497
576
  const { tableColumn, visibleColumn } = this
498
577
  return tableColumn.length || visibleColumn.length ? visibleColumn.filter((column: any) => column.width === 'auto' || column.minWidth === 'auto') : []
@@ -664,7 +743,7 @@ export default {
664
743
  fullColumnFieldData: {}
665
744
  })
666
745
 
667
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
746
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
668
747
  if (this.rowId) {
669
748
  warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField'])
670
749
  }
@@ -714,7 +793,7 @@ export default {
714
793
  }
715
794
  }
716
795
 
717
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
796
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
718
797
  const customOpts = this.customOpts
719
798
  if (!this.id && this.customConfig && (customOpts.storage === true || (customOpts.storage && customOpts.storage.resizable) || (customOpts.storage && customOpts.storage.visible))) {
720
799
  errLog('vxe.error.reqProp', ['id'])
@@ -755,7 +834,7 @@ export default {
755
834
  }
756
835
 
757
836
  // v4 中只支持对象类型
758
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
837
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
759
838
  // 在 v3.0 中废弃 context-menu
760
839
  if (this.contextMenu) {
761
840
  warnLog('vxe.error.delProp', ['context-menu', 'menu-config'])
@@ -799,7 +878,7 @@ export default {
799
878
  }
800
879
 
801
880
  // 检查是否有安装需要的模块
802
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
881
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
803
882
  if (this.editConfig && !this._insert) {
804
883
  errLog('vxe.error.reqModule', ['Edit'])
805
884
  }
@@ -846,7 +925,10 @@ export default {
846
925
  this.preventEvent(null, 'created')
847
926
  },
848
927
  mounted () {
849
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
928
+ const $xeTable = this
929
+ const props = $xeTable
930
+
931
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
850
932
  const { $listeners } = this
851
933
  if (!this.menuConfig && ($listeners['menu-click'] || $listeners['cell-menu'] || $listeners['header-cell-menu'] || $listeners['footer-cell-menu'])) {
852
934
  warnLog('vxe.error.reqProp', ['menu-config'])
@@ -855,6 +937,28 @@ export default {
855
937
  warnLog('vxe.error.reqProp', ['tooltip-config'])
856
938
  }
857
939
  }
940
+
941
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
942
+ // 使用已安装的组件,如果未安装则不渲染
943
+ const VxeUILoadingComponent = VxeUI.getComponent<VxeLoadingComponent>('VxeLoading')
944
+ const VxeUITooltipComponent = VxeUI.getComponent<VxeTooltipComponent>('VxeTooltip')
945
+
946
+ $xeTable.$nextTick(() => {
947
+ if (props.loading) {
948
+ if (!VxeUILoadingComponent) {
949
+ errLog('vxe.error.reqComp', ['vxe-loading'])
950
+ }
951
+ }
952
+ if ((props.showOverflow === true || props.showOverflow === 'tooltip') ||
953
+ (props.showHeaderOverflow === true || props.showHeaderOverflow === 'tooltip') ||
954
+ (props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip') ||
955
+ props.tooltipConfig || props.editRules) {
956
+ if (!VxeUITooltipComponent) {
957
+ errLog('vxe.error.reqComp', ['vxe-tooltip'])
958
+ }
959
+ }
960
+ })
961
+ }
858
962
  if (this.autoResize) {
859
963
  const handleWrapperResize = this.resizeOpts.refreshDelay ? XEUtils.throttle(() => this.recalculate(true), this.resizeOpts.refreshDelay, { leading: true, trailing: true }) : null
860
964
  const resizeObserver = globalResize.create(handleWrapperResize
@@ -902,6 +1006,10 @@ export default {
902
1006
  this.preventEvent(null, 'destroyed')
903
1007
  },
904
1008
  render (h: CreateElement) {
1009
+ // 使用已安装的组件,如果未安装则不渲染
1010
+ const VxeUILoadingComponent = VxeUI.getComponent<VxeLoadingComponent>('VxeLoading')
1011
+ const VxeUITooltipComponent = VxeUI.getComponent<VxeTooltipComponent>('VxeTooltip')
1012
+
905
1013
  const {
906
1014
  _e,
907
1015
  $scopedSlots,
@@ -920,7 +1028,7 @@ export default {
920
1028
  treeConfig,
921
1029
  mouseConfig,
922
1030
  mouseOpts,
923
- vSize,
1031
+ computeSize,
924
1032
  validOpts,
925
1033
  showFooter,
926
1034
  overflowX,
@@ -940,7 +1048,6 @@ export default {
940
1048
  ctxMenuStore,
941
1049
  ctxMenuOpts,
942
1050
  footerTableData,
943
- hasTip,
944
1051
  columnOpts,
945
1052
  rowOpts,
946
1053
  checkboxOpts,
@@ -949,6 +1056,7 @@ export default {
949
1056
  } = this
950
1057
  const { leftList, rightList } = columnStore
951
1058
  const currLoading = this._isLoading || loading
1059
+ const vSize = computeSize
952
1060
  return h('div', {
953
1061
  class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
954
1062
  [`valid-msg--${validOpts.msgMode}`]: !!editRules,
@@ -968,6 +1076,7 @@ export default {
968
1076
  'is--fixed-left': leftList.length,
969
1077
  'is--fixed-right': rightList.length,
970
1078
  'is--animat': !!this.animat,
1079
+ 'is--padding': this.padding,
971
1080
  'is--round': this.round,
972
1081
  'is--stripe': !treeConfig && stripe,
973
1082
  'is--loading': currLoading,
@@ -1081,14 +1190,16 @@ export default {
1081
1190
  /**
1082
1191
  * 加载中
1083
1192
  */
1084
- h('vxe-loading', {
1085
- class: 'vxe-table--loading',
1086
- props: {
1087
- value: currLoading,
1088
- icon: loadingOpts.icon,
1089
- text: loadingOpts.text
1090
- }
1091
- }, this.callSlot($scopedSlots.loading, {}, h)),
1193
+ VxeUILoadingComponent
1194
+ ? h(VxeUILoadingComponent, {
1195
+ class: 'vxe-table--loading',
1196
+ props: {
1197
+ value: currLoading,
1198
+ icon: loadingOpts.icon,
1199
+ text: loadingOpts.text
1200
+ }
1201
+ }, this.callSlot($scopedSlots.loading, {}, h))
1202
+ : _e(),
1092
1203
  /**
1093
1204
  * 自定义列
1094
1205
  */
@@ -1149,8 +1260,8 @@ export default {
1149
1260
  /**
1150
1261
  * 通用提示
1151
1262
  */
1152
- hasTip
1153
- ? h('vxe-tooltip', {
1263
+ VxeUITooltipComponent
1264
+ ? h(VxeUITooltipComponent, {
1154
1265
  ref: 'commTip',
1155
1266
  props: {
1156
1267
  isArrow: false,
@@ -1161,8 +1272,8 @@ export default {
1161
1272
  /**
1162
1273
  * 工具提示
1163
1274
  */
1164
- hasTip
1165
- ? h('vxe-tooltip', {
1275
+ VxeUITooltipComponent
1276
+ ? h(VxeUITooltipComponent, {
1166
1277
  ref: 'tooltip',
1167
1278
  props: Object.assign({}, this.tipConfig, this.tooltipStore.currOpts)
1168
1279
  })
@@ -1170,8 +1281,8 @@ export default {
1170
1281
  /**
1171
1282
  * 校验提示
1172
1283
  */
1173
- hasTip && this.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip')
1174
- ? h('vxe-tooltip', {
1284
+ VxeUITooltipComponent && this.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip')
1285
+ ? h(VxeUITooltipComponent, {
1175
1286
  ref: 'validTip',
1176
1287
  class: [{
1177
1288
  'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete'
@@ -151,7 +151,7 @@ export function assembleColumn (_vm: any) {
151
151
  const groupConfig = $xecolumn ? $xecolumn.columnConfig : null
152
152
  columnConfig.slots = _vm.$scopedSlots
153
153
  if (groupConfig) {
154
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
154
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
155
155
  if ($xecolumn.$options._componentTag === 'vxe-table-column') {
156
156
  errLog('vxe.error.groupTag', [`<vxe-table-colgroup title=${$xecolumn.title} ...>`, `<vxe-table-column title=${$xecolumn.title} ...>`])
157
157
  } else if ($xecolumn.$options._componentTag === 'vxe-column') {
@@ -271,7 +271,8 @@ function countTreeExpand (prevRow: any, params: any) {
271
271
  }
272
272
 
273
273
  export function getOffsetSize ($xetable: any) {
274
- return lineOffsetSizes[$xetable.vSize] || 0
274
+ const vSize = $xetable.computeSize
275
+ return lineOffsetSizes[vSize] || 0
275
276
  }
276
277
 
277
278
  export function calcTreeLine (params: any, items: any, rIndex: any) {
@@ -71,37 +71,37 @@ export default defineVxeComponent({
71
71
  const $xeToolbar = this
72
72
  const props = $xeToolbar
73
73
 
74
- return Object.assign({}, getConfig().toolbar.refresh, props.refresh) as VxeToolbarPropTypes.RefreshOpts
74
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.refresh, true), props.refresh) as VxeToolbarPropTypes.RefreshOpts
75
75
  },
76
76
  computeImportOpts () {
77
77
  const $xeToolbar = this
78
78
  const props = $xeToolbar
79
79
 
80
- return Object.assign({}, getConfig().toolbar.import, props.import) as VxeToolbarPropTypes.ImportOpts
80
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.import, true), props.import) as VxeToolbarPropTypes.ImportOpts
81
81
  },
82
82
  computeExportOpts () {
83
83
  const $xeToolbar = this
84
84
  const props = $xeToolbar
85
85
 
86
- return Object.assign({}, getConfig().toolbar.export, props.export) as VxeToolbarPropTypes.ExportOpts
86
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.export, true), props.export) as VxeToolbarPropTypes.ExportOpts
87
87
  },
88
88
  computePrintOpts () {
89
89
  const $xeToolbar = this
90
90
  const props = $xeToolbar
91
91
 
92
- return Object.assign({}, getConfig().toolbar.print, props.print) as VxeToolbarPropTypes.PrintOpts
92
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.print, true), props.print) as VxeToolbarPropTypes.PrintOpts
93
93
  },
94
94
  computeZoomOpts () {
95
95
  const $xeToolbar = this
96
96
  const props = $xeToolbar
97
97
 
98
- return Object.assign({}, getConfig().toolbar.zoom, props.zoom) as VxeToolbarPropTypes.ZoomOpts
98
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.zoom, true), props.zoom) as VxeToolbarPropTypes.ZoomOpts
99
99
  },
100
100
  computeCustomOpts () {
101
101
  const $xeToolbar = this
102
102
  const props = $xeToolbar
103
103
 
104
- return Object.assign({}, getConfig().toolbar.custom, props.custom) as VxeToolbarPropTypes.CustomOpts
104
+ return Object.assign({}, XEUtils.clone(getConfig().toolbar.custom, true), props.custom) as VxeToolbarPropTypes.CustomOpts
105
105
  },
106
106
  computeTableCustomOpts (this: any) {
107
107
  const $xeToolbar = this
@@ -357,7 +357,12 @@ export default defineVxeComponent({
357
357
  circle: child.circle,
358
358
  round: child.round,
359
359
  status: child.status,
360
- content: child.name
360
+ content: child.name,
361
+ title: child.title,
362
+ routerLink: child.routerLink,
363
+ permissionCode: child.permissionCode,
364
+ prefixTooltip: child.prefixTooltip,
365
+ suffixTooltip: child.suffixTooltip
361
366
  },
362
367
  on: {
363
368
  click: ({ $event }: any) => isBtn ? $xeToolbar.btnEvent($event, child) : $xeToolbar.tolEvent($event, child)
@@ -411,7 +416,11 @@ export default defineVxeComponent({
411
416
  round: item.round,
412
417
  status: item.status,
413
418
  content: item.name,
419
+ title: item.title,
420
+ routerLink: item.routerLink,
414
421
  permissionCode: item.permissionCode,
422
+ prefixTooltip: item.prefixTooltip,
423
+ suffixTooltip: item.suffixTooltip,
415
424
  destroyOnClose: item.destroyOnClose,
416
425
  placement: item.placement,
417
426
  transfer: item.transfer
@@ -479,6 +488,11 @@ export default defineVxeComponent({
479
488
  round: item.round,
480
489
  status: item.status,
481
490
  content: item.name,
491
+ title: item.title,
492
+ routerLink: item.routerLink,
493
+ permissionCode: item.permissionCode,
494
+ prefixTooltip: item.prefixTooltip,
495
+ suffixTooltip: item.suffixTooltip,
482
496
  destroyOnClose: item.destroyOnClose,
483
497
  placement: item.placement,
484
498
  transfer: item.transfer
@@ -17,6 +17,7 @@ VxeUI.setConfig({
17
17
  animat: true,
18
18
  delayHover: 250,
19
19
  autoResize: true,
20
+ padding: true,
20
21
  minHeight: 144,
21
22
  // keepSource: false,
22
23
  // showOverflow: null,
@@ -108,7 +109,8 @@ VxeUI.setConfig({
108
109
  editConfig: {
109
110
  // mode: 'cell',
110
111
  showIcon: true,
111
- showAsterisk: true
112
+ showAsterisk: true,
113
+ autoFocus: true
112
114
  },
113
115
  importConfig: {
114
116
  _typeMaps: {
@@ -271,7 +273,6 @@ export const interceptor = VxeUI.interceptor
271
273
  export const clipboard = VxeUI.clipboard
272
274
  export const log = VxeUI.log
273
275
 
274
- export const hooks = VxeUI.hooks
275
276
  export const use = VxeUI.use
276
277
 
277
278
  /**