vxe-table 3.9.0-rc.9 → 3.9.1

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 (222) hide show
  1. package/README.md +80 -9
  2. package/es/grid/src/grid.js +116 -62
  3. package/es/grid/style.css +0 -1
  4. package/es/grid/style.min.css +1 -1
  5. package/es/index.esm.js +22 -3
  6. package/es/locale/lang/en-US.js +6 -2
  7. package/es/locale/lang/es-ES.js +5 -1
  8. package/es/locale/lang/hu-HU.js +5 -1
  9. package/es/locale/lang/ja-JP.js +5 -1
  10. package/es/locale/lang/ko-KR.js +5 -1
  11. package/es/locale/lang/pt-BR.js +5 -1
  12. package/es/locale/lang/ru-RU.js +5 -1
  13. package/es/locale/lang/uk-UA.js +5 -1
  14. package/es/locale/lang/vi-VN.js +5 -1
  15. package/es/locale/lang/zh-CHT.js +5 -1
  16. package/es/locale/lang/zh-CN.js +5 -1
  17. package/es/style.css +1 -1
  18. package/es/style.min.css +1 -1
  19. package/es/table/module/custom/panel.js +183 -173
  20. package/es/table/module/edit/mixin.js +35 -40
  21. package/es/table/module/export/export-panel.js +32 -4
  22. package/es/table/module/export/import-panel.js +25 -6
  23. package/es/table/module/export/mixin.js +11 -11
  24. package/es/table/module/menu/mixin.js +2 -2
  25. package/es/table/module/validator/mixin.js +4 -4
  26. package/es/table/render/index.js +17 -11
  27. package/es/table/src/body.js +1 -0
  28. package/es/table/src/columnInfo.js +3 -3
  29. package/es/table/src/methods.js +69 -55
  30. package/es/table/src/props.js +65 -15
  31. package/es/table/src/table.js +63 -29
  32. package/es/table/src/util.js +3 -2
  33. package/es/table/style.css +37 -48
  34. package/es/table/style.min.css +1 -1
  35. package/es/toolbar/src/toolbar.js +21 -7
  36. package/es/toolbar/style.css +0 -1
  37. package/es/toolbar/style.min.css +1 -1
  38. package/es/ui/index.js +5 -3
  39. package/es/ui/src/log.js +1 -1
  40. package/es/vxe-grid/style.css +0 -1
  41. package/es/vxe-grid/style.min.css +1 -1
  42. package/es/vxe-table/style.css +37 -48
  43. package/es/vxe-table/style.min.css +1 -1
  44. package/es/vxe-toolbar/style.css +0 -1
  45. package/es/vxe-toolbar/style.min.css +1 -1
  46. package/lib/colgroup/index.js +3 -3
  47. package/lib/colgroup/index.min.js +1 -1
  48. package/lib/column/index.js +3 -3
  49. package/lib/column/index.min.js +1 -1
  50. package/lib/components.js +9 -11
  51. package/lib/components.min.js +1 -1
  52. package/lib/grid/index.js +3 -3
  53. package/lib/grid/index.min.js +1 -1
  54. package/lib/grid/src/grid.js +577 -487
  55. package/lib/grid/src/grid.min.js +1 -1
  56. package/lib/grid/style/style.css +0 -1
  57. package/lib/grid/style/style.min.css +1 -1
  58. package/lib/index.common.js +3 -4
  59. package/lib/index.umd.js +9148 -17246
  60. package/lib/index.umd.min.js +1 -1
  61. package/lib/locale/lang/en-US.js +6 -2
  62. package/lib/locale/lang/en-US.min.js +1 -1
  63. package/lib/locale/lang/en-US.umd.js +6 -2
  64. package/lib/locale/lang/es-ES.js +5 -1
  65. package/lib/locale/lang/es-ES.min.js +1 -1
  66. package/lib/locale/lang/es-ES.umd.js +5 -1
  67. package/lib/locale/lang/hu-HU.js +5 -1
  68. package/lib/locale/lang/hu-HU.min.js +1 -1
  69. package/lib/locale/lang/hu-HU.umd.js +5 -1
  70. package/lib/locale/lang/ja-JP.js +5 -1
  71. package/lib/locale/lang/ja-JP.min.js +1 -1
  72. package/lib/locale/lang/ja-JP.umd.js +5 -1
  73. package/lib/locale/lang/ko-KR.js +5 -1
  74. package/lib/locale/lang/ko-KR.min.js +1 -1
  75. package/lib/locale/lang/ko-KR.umd.js +5 -1
  76. package/lib/locale/lang/pt-BR.js +5 -1
  77. package/lib/locale/lang/pt-BR.min.js +1 -1
  78. package/lib/locale/lang/pt-BR.umd.js +5 -1
  79. package/lib/locale/lang/ru-RU.js +5 -1
  80. package/lib/locale/lang/ru-RU.min.js +1 -1
  81. package/lib/locale/lang/ru-RU.umd.js +5 -1
  82. package/lib/locale/lang/uk-UA.js +5 -1
  83. package/lib/locale/lang/uk-UA.min.js +1 -1
  84. package/lib/locale/lang/uk-UA.umd.js +5 -1
  85. package/lib/locale/lang/vi-VN.js +5 -1
  86. package/lib/locale/lang/vi-VN.min.js +1 -1
  87. package/lib/locale/lang/zh-CHT.js +5 -1
  88. package/lib/locale/lang/zh-CHT.min.js +1 -1
  89. package/lib/locale/lang/zh-CHT.umd.js +5 -1
  90. package/lib/locale/lang/zh-CN.js +5 -1
  91. package/lib/locale/lang/zh-CN.min.js +1 -1
  92. package/lib/locale/lang/zh-CN.umd.js +5 -1
  93. package/lib/style.css +1 -1
  94. package/lib/style.min.css +1 -1
  95. package/lib/table/index.js +4 -4
  96. package/lib/table/index.min.js +1 -1
  97. package/lib/table/module/custom/mixin.js +53 -44
  98. package/lib/table/module/custom/mixin.min.js +1 -1
  99. package/lib/table/module/custom/panel.js +310 -239
  100. package/lib/table/module/custom/panel.min.js +1 -1
  101. package/lib/table/module/edit/mixin.js +434 -383
  102. package/lib/table/module/edit/mixin.min.js +1 -1
  103. package/lib/table/module/export/export-panel.js +136 -106
  104. package/lib/table/module/export/export-panel.min.js +1 -1
  105. package/lib/table/module/export/import-panel.js +75 -54
  106. package/lib/table/module/export/import-panel.min.js +1 -1
  107. package/lib/table/module/export/mixin.js +592 -597
  108. package/lib/table/module/export/mixin.min.js +1 -1
  109. package/lib/table/module/export/util.js +6 -4
  110. package/lib/table/module/export/util.min.js +1 -1
  111. package/lib/table/module/filter/mixin.js +147 -118
  112. package/lib/table/module/filter/mixin.min.js +1 -1
  113. package/lib/table/module/filter/panel.js +86 -65
  114. package/lib/table/module/filter/panel.min.js +1 -1
  115. package/lib/table/module/keyboard/mixin.js +163 -151
  116. package/lib/table/module/keyboard/mixin.min.js +1 -1
  117. package/lib/table/module/menu/mixin.js +125 -114
  118. package/lib/table/module/menu/mixin.min.js +1 -1
  119. package/lib/table/module/menu/panel.js +36 -34
  120. package/lib/table/module/menu/panel.min.js +1 -1
  121. package/lib/table/module/validator/mixin.js +225 -214
  122. package/lib/table/module/validator/mixin.min.js +1 -1
  123. package/lib/table/render/index.js +401 -297
  124. package/lib/table/render/index.min.js +1 -1
  125. package/lib/table/src/body.js +411 -349
  126. package/lib/table/src/body.min.js +1 -1
  127. package/lib/table/src/cell.js +470 -344
  128. package/lib/table/src/cell.min.js +1 -1
  129. package/lib/table/src/column.js +10 -10
  130. package/lib/table/src/column.min.js +1 -1
  131. package/lib/table/src/columnInfo.js +46 -55
  132. package/lib/table/src/columnInfo.min.js +1 -1
  133. package/lib/table/src/footer.js +157 -132
  134. package/lib/table/src/footer.min.js +1 -1
  135. package/lib/table/src/group.js +1 -1
  136. package/lib/table/src/group.min.js +1 -1
  137. package/lib/table/src/header.js +170 -153
  138. package/lib/table/src/header.min.js +1 -1
  139. package/lib/table/src/methods.js +2770 -2491
  140. package/lib/table/src/methods.min.js +1 -1
  141. package/lib/table/src/props.js +33 -74
  142. package/lib/table/src/props.min.js +1 -1
  143. package/lib/table/src/table.js +436 -395
  144. package/lib/table/src/table.min.js +1 -1
  145. package/lib/table/src/util.js +143 -131
  146. package/lib/table/src/util.min.js +1 -1
  147. package/lib/table/style/style.css +37 -48
  148. package/lib/table/style/style.min.css +1 -1
  149. package/lib/toolbar/index.js +3 -3
  150. package/lib/toolbar/index.min.js +1 -1
  151. package/lib/toolbar/src/toolbar.js +332 -284
  152. package/lib/toolbar/src/toolbar.min.js +1 -1
  153. package/lib/toolbar/style/style.css +0 -1
  154. package/lib/toolbar/style/style.min.css +1 -1
  155. package/lib/ui/index.js +50 -41
  156. package/lib/ui/index.min.js +1 -1
  157. package/lib/ui/src/comp.js +2 -3
  158. package/lib/ui/src/comp.min.js +1 -1
  159. package/lib/ui/src/dom.js +29 -28
  160. package/lib/ui/src/dom.min.js +1 -1
  161. package/lib/ui/src/log.js +6 -4
  162. package/lib/ui/src/log.min.js +1 -1
  163. package/lib/ui/src/utils.js +7 -7
  164. package/lib/v-x-e-table/index.js +3 -4
  165. package/lib/v-x-e-table/index.min.js +1 -1
  166. package/lib/vxe-colgroup/index.js +3 -4
  167. package/lib/vxe-colgroup/index.min.js +1 -1
  168. package/lib/vxe-column/index.js +3 -4
  169. package/lib/vxe-column/index.min.js +1 -1
  170. package/lib/vxe-grid/index.js +3 -4
  171. package/lib/vxe-grid/index.min.js +1 -1
  172. package/lib/vxe-grid/style/style.css +0 -1
  173. package/lib/vxe-grid/style/style.min.css +1 -1
  174. package/lib/vxe-table/index.js +3 -4
  175. package/lib/vxe-table/index.min.js +1 -1
  176. package/lib/vxe-table/style/style.css +37 -48
  177. package/lib/vxe-table/style/style.min.css +1 -1
  178. package/lib/vxe-toolbar/index.js +3 -4
  179. package/lib/vxe-toolbar/index.min.js +1 -1
  180. package/lib/vxe-toolbar/style/style.css +0 -1
  181. package/lib/vxe-toolbar/style/style.min.css +1 -1
  182. package/lib/vxe-ui/index.js +3 -4
  183. package/lib/vxe-ui/index.min.js +1 -1
  184. package/lib/vxe-v-x-e-table/index.js +3 -4
  185. package/lib/vxe-v-x-e-table/index.min.js +1 -1
  186. package/package.json +5 -4
  187. package/packages/grid/src/grid.ts +123 -61
  188. package/packages/locale/lang/en-US.ts +6 -2
  189. package/packages/locale/lang/es-ES.ts +5 -1
  190. package/packages/locale/lang/hu-HU.ts +5 -1
  191. package/packages/locale/lang/ja-JP.ts +5 -1
  192. package/packages/locale/lang/ko-KR.ts +5 -1
  193. package/packages/locale/lang/pt-BR.ts +5 -1
  194. package/packages/locale/lang/ru-RU.ts +5 -1
  195. package/packages/locale/lang/uk-UA.ts +5 -1
  196. package/packages/locale/lang/vi-VN.ts +5 -1
  197. package/packages/locale/lang/zh-CHT.ts +5 -1
  198. package/packages/locale/lang/zh-CN.ts +5 -1
  199. package/packages/table/module/custom/panel.ts +186 -175
  200. package/packages/table/module/edit/mixin.ts +34 -39
  201. package/packages/table/module/export/export-panel.ts +36 -4
  202. package/packages/table/module/export/import-panel.ts +29 -6
  203. package/packages/table/module/export/mixin.ts +11 -11
  204. package/packages/table/module/menu/mixin.ts +2 -2
  205. package/packages/table/module/validator/mixin.ts +4 -4
  206. package/packages/table/render/index.ts +20 -11
  207. package/packages/table/src/body.ts +1 -0
  208. package/packages/table/src/columnInfo.ts +3 -3
  209. package/packages/table/src/methods.ts +70 -55
  210. package/packages/table/src/props.ts +68 -15
  211. package/packages/table/src/table.ts +71 -26
  212. package/packages/table/src/util.ts +3 -2
  213. package/packages/toolbar/src/toolbar.ts +21 -7
  214. package/packages/ui/index.ts +3 -1
  215. package/styles/components/table.scss +82 -17
  216. package/types/all.d.ts +1 -0
  217. /package/es/{iconfont.1726453742001.ttf → iconfont.1728483486168.ttf} +0 -0
  218. /package/es/{iconfont.1726453742001.woff → iconfont.1728483486168.woff} +0 -0
  219. /package/es/{iconfont.1726453742001.woff2 → iconfont.1728483486168.woff2} +0 -0
  220. /package/lib/{iconfont.1726453742001.ttf → iconfont.1728483486168.ttf} +0 -0
  221. /package/lib/{iconfont.1726453742001.woff → iconfont.1728483486168.woff} +0 -0
  222. /package/lib/{iconfont.1726453742001.woff2 → iconfont.1728483486168.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, VxeTabsConstructor, VxeTabsPrivateMethods } from 'vxe-pc-ui'
27
+
26
28
  const { getConfig, getI18n, renderer, globalResize, globalEvents, globalMixins } = VxeUI
27
29
 
28
30
  /**
@@ -124,6 +126,9 @@ export default {
124
126
  }
125
127
  },
126
128
  inject: {
129
+ $xeTabs: {
130
+ default: null
131
+ },
127
132
  $xeGrid: {
128
133
  default: null
129
134
  },
@@ -351,6 +356,9 @@ export default {
351
356
  }
352
357
  },
353
358
  computed: {
359
+ ...({} as {
360
+ $xeTabs(): (VxeTabsConstructor & VxeTabsPrivateMethods) | null
361
+ }),
354
362
  tableId () {
355
363
  const { id } = this
356
364
  if (id) {
@@ -489,10 +497,6 @@ export default {
489
497
  computeFNROpts () {
490
498
  return Object.assign({}, getConfig().table.fnrConfig, this.fnrConfig)
491
499
  },
492
- hasTip () {
493
- return true
494
- // return VXETable._tooltip
495
- },
496
500
  headerCtxMenu () {
497
501
  const headerOpts = this.ctxMenuOpts.header
498
502
  return headerOpts && headerOpts.options ? headerOpts.options : []
@@ -625,6 +629,12 @@ export default {
625
629
  return true
626
630
  }
627
631
  return false
632
+ },
633
+ tabsResizeFlag () {
634
+ const $xeTable = this
635
+ const $xeTabs = $xeTable.$xeTabs
636
+
637
+ return $xeTabs ? $xeTabs.reactData.resizeFlag : null
628
638
  }
629
639
  } as any,
630
640
  watch: {
@@ -686,6 +696,9 @@ export default {
686
696
  })
687
697
  }
688
698
  },
699
+ tabsResizeFlag () {
700
+ this.handleGlobalResizeEvent()
701
+ },
689
702
  mergeCells (value: any) {
690
703
  this.clearMergeCells()
691
704
  this.$nextTick(() => this.setMergeCells(value))
@@ -745,7 +758,7 @@ export default {
745
758
  fullColumnFieldData: {}
746
759
  })
747
760
 
748
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
761
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
749
762
  if (this.rowId) {
750
763
  warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField'])
751
764
  }
@@ -795,7 +808,7 @@ export default {
795
808
  }
796
809
  }
797
810
 
798
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
811
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
799
812
  const customOpts = this.customOpts
800
813
  if (!this.id && this.customConfig && (customOpts.storage === true || (customOpts.storage && customOpts.storage.resizable) || (customOpts.storage && customOpts.storage.visible))) {
801
814
  errLog('vxe.error.reqProp', ['id'])
@@ -836,7 +849,7 @@ export default {
836
849
  }
837
850
 
838
851
  // v4 中只支持对象类型
839
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
852
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
840
853
  // 在 v3.0 中废弃 context-menu
841
854
  if (this.contextMenu) {
842
855
  warnLog('vxe.error.delProp', ['context-menu', 'menu-config'])
@@ -880,7 +893,7 @@ export default {
880
893
  }
881
894
 
882
895
  // 检查是否有安装需要的模块
883
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
896
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
884
897
  if (this.editConfig && !this._insert) {
885
898
  errLog('vxe.error.reqModule', ['Edit'])
886
899
  }
@@ -927,7 +940,10 @@ export default {
927
940
  this.preventEvent(null, 'created')
928
941
  },
929
942
  mounted () {
930
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
943
+ const $xeTable = this
944
+ const props = $xeTable
945
+
946
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
931
947
  const { $listeners } = this
932
948
  if (!this.menuConfig && ($listeners['menu-click'] || $listeners['cell-menu'] || $listeners['header-cell-menu'] || $listeners['footer-cell-menu'])) {
933
949
  warnLog('vxe.error.reqProp', ['menu-config'])
@@ -936,12 +952,34 @@ export default {
936
952
  warnLog('vxe.error.reqProp', ['tooltip-config'])
937
953
  }
938
954
  }
955
+
956
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
957
+ // 使用已安装的组件,如果未安装则不渲染
958
+ const VxeUILoadingComponent = VxeUI.getComponent<VxeLoadingComponent>('VxeLoading')
959
+ const VxeUITooltipComponent = VxeUI.getComponent<VxeTooltipComponent>('VxeTooltip')
960
+
961
+ $xeTable.$nextTick(() => {
962
+ if (props.loading) {
963
+ if (!VxeUILoadingComponent) {
964
+ errLog('vxe.error.reqComp', ['vxe-loading'])
965
+ }
966
+ }
967
+ if ((props.showOverflow === true || props.showOverflow === 'tooltip') ||
968
+ (props.showHeaderOverflow === true || props.showHeaderOverflow === 'tooltip') ||
969
+ (props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip') ||
970
+ props.tooltipConfig || props.editRules) {
971
+ if (!VxeUITooltipComponent) {
972
+ errLog('vxe.error.reqComp', ['vxe-tooltip'])
973
+ }
974
+ }
975
+ })
976
+ }
939
977
  if (this.autoResize) {
940
978
  const handleWrapperResize = this.resizeOpts.refreshDelay ? XEUtils.throttle(() => this.recalculate(true), this.resizeOpts.refreshDelay, { leading: true, trailing: true }) : null
941
979
  const resizeObserver = globalResize.create(handleWrapperResize
942
980
  ? () => {
943
981
  if (this.autoResize) {
944
- requestAnimationFrame(handleWrapperResize)
982
+ handleWrapperResize()
945
983
  }
946
984
  }
947
985
  : () => {
@@ -983,6 +1021,10 @@ export default {
983
1021
  this.preventEvent(null, 'destroyed')
984
1022
  },
985
1023
  render (h: CreateElement) {
1024
+ // 使用已安装的组件,如果未安装则不渲染
1025
+ const VxeUILoadingComponent = VxeUI.getComponent<VxeLoadingComponent>('VxeLoading')
1026
+ const VxeUITooltipComponent = VxeUI.getComponent<VxeTooltipComponent>('VxeTooltip')
1027
+
986
1028
  const {
987
1029
  _e,
988
1030
  $scopedSlots,
@@ -1001,7 +1043,7 @@ export default {
1001
1043
  treeConfig,
1002
1044
  mouseConfig,
1003
1045
  mouseOpts,
1004
- vSize,
1046
+ computeSize,
1005
1047
  validOpts,
1006
1048
  showFooter,
1007
1049
  overflowX,
@@ -1021,7 +1063,6 @@ export default {
1021
1063
  ctxMenuStore,
1022
1064
  ctxMenuOpts,
1023
1065
  footerTableData,
1024
- hasTip,
1025
1066
  columnOpts,
1026
1067
  rowOpts,
1027
1068
  checkboxOpts,
@@ -1030,6 +1071,7 @@ export default {
1030
1071
  } = this
1031
1072
  const { leftList, rightList } = columnStore
1032
1073
  const currLoading = this._isLoading || loading
1074
+ const vSize = computeSize
1033
1075
  return h('div', {
1034
1076
  class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
1035
1077
  [`valid-msg--${validOpts.msgMode}`]: !!editRules,
@@ -1049,6 +1091,7 @@ export default {
1049
1091
  'is--fixed-left': leftList.length,
1050
1092
  'is--fixed-right': rightList.length,
1051
1093
  'is--animat': !!this.animat,
1094
+ 'is--padding': this.padding,
1052
1095
  'is--round': this.round,
1053
1096
  'is--stripe': !treeConfig && stripe,
1054
1097
  'is--loading': currLoading,
@@ -1162,14 +1205,16 @@ export default {
1162
1205
  /**
1163
1206
  * 加载中
1164
1207
  */
1165
- h('vxe-loading', {
1166
- class: 'vxe-table--loading',
1167
- props: {
1168
- value: currLoading,
1169
- icon: loadingOpts.icon,
1170
- text: loadingOpts.text
1171
- }
1172
- }, this.callSlot($scopedSlots.loading, {}, h)),
1208
+ VxeUILoadingComponent
1209
+ ? h(VxeUILoadingComponent, {
1210
+ class: 'vxe-table--loading',
1211
+ props: {
1212
+ value: currLoading,
1213
+ icon: loadingOpts.icon,
1214
+ text: loadingOpts.text
1215
+ }
1216
+ }, this.callSlot($scopedSlots.loading, {}, h))
1217
+ : _e(),
1173
1218
  /**
1174
1219
  * 自定义列
1175
1220
  */
@@ -1230,8 +1275,8 @@ export default {
1230
1275
  /**
1231
1276
  * 通用提示
1232
1277
  */
1233
- hasTip
1234
- ? h('vxe-tooltip', {
1278
+ VxeUITooltipComponent
1279
+ ? h(VxeUITooltipComponent, {
1235
1280
  ref: 'commTip',
1236
1281
  props: {
1237
1282
  isArrow: false,
@@ -1242,8 +1287,8 @@ export default {
1242
1287
  /**
1243
1288
  * 工具提示
1244
1289
  */
1245
- hasTip
1246
- ? h('vxe-tooltip', {
1290
+ VxeUITooltipComponent
1291
+ ? h(VxeUITooltipComponent, {
1247
1292
  ref: 'tooltip',
1248
1293
  props: Object.assign({}, this.tipConfig, this.tooltipStore.currOpts)
1249
1294
  })
@@ -1251,8 +1296,8 @@ export default {
1251
1296
  /**
1252
1297
  * 校验提示
1253
1298
  */
1254
- hasTip && this.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip')
1255
- ? h('vxe-tooltip', {
1299
+ VxeUITooltipComponent && this.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip')
1300
+ ? h(VxeUITooltipComponent, {
1256
1301
  ref: 'validTip',
1257
1302
  class: [{
1258
1303
  '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: {
@@ -130,6 +130,26 @@
130
130
  }
131
131
  }
132
132
  }
133
+ .vxe-body--column {
134
+ &.col--height {
135
+ &.col--active {
136
+ & > .vxe-cell {
137
+ height: 100%;
138
+ }
139
+ }
140
+ & > .vxe-cell {
141
+ & > .vxe-textarea,
142
+ & > .vxe-default-textarea {
143
+ height: 100%;
144
+ }
145
+ }
146
+ }
147
+ .vxe-cell--label {
148
+ &.is--textarea {
149
+ white-space: pre-line;
150
+ }
151
+ }
152
+ }
133
153
 
134
154
  .vxe-table--checkbox-range,
135
155
  .vxe-table--cell-main-area,
@@ -456,12 +476,12 @@
456
476
  // vertical-align: middle;
457
477
  // }
458
478
  .vxe-cell--required-icon {
459
- margin-right: 0.1em;
479
+ padding-right: 0.1em;
460
480
  }
461
481
  .vxe-cell--edit-icon,
462
482
  .vxe-cell-title-prefix-icon,
463
483
  .vxe-cell-title-suffix-icon {
464
- margin-right: 0.2em;
484
+ padding: 0.2em;
465
485
  }
466
486
  .vxe-cell-title-prefix-icon,
467
487
  .vxe-cell-title-suffix-icon {
@@ -512,12 +532,12 @@
512
532
  font-family: var(--vxe-ui-font-family);
513
533
  direction: ltr;
514
534
  .vxe-table--body-wrapper {
515
- table {
535
+ & > table {
516
536
  background-color: var(--vxe-ui-layout-background-color);
517
537
  }
518
538
  }
519
539
  .vxe-table--footer-wrapper {
520
- table {
540
+ & > table {
521
541
  background-color: var(--vxe-ui-table-footer-background-color);
522
542
  }
523
543
  }
@@ -678,15 +698,25 @@
678
698
  }
679
699
  }
680
700
  }
701
+ &.is--padding {
702
+ .vxe-body--column {
703
+ &:not(.col--ellipsis) {
704
+ padding: var(--vxe-ui-table-column-padding-default);
705
+ }
706
+ }
707
+ }
708
+ .vxe-header--column,
709
+ .vxe-footer--column {
710
+ &:not(.col--ellipsis) {
711
+ padding: var(--vxe-ui-table-column-padding-default);
712
+ }
713
+ }
681
714
  .vxe-header--column,
682
715
  .vxe-body--column,
683
716
  .vxe-footer--column {
684
717
  position: relative;
685
718
  line-height: var(--vxe-ui-table-row-line-height);
686
719
  text-align: left;
687
- &:not(.col--ellipsis) {
688
- padding: var(--vxe-ui-table-column-padding-default);
689
- }
690
720
  &.col--current {
691
721
  background-color: var(--vxe-ui-table-column-current-background-color);
692
722
  // .vxe-tree--btn-wrapper {
@@ -731,6 +761,27 @@
731
761
  .vxe-table--footer-wrapper {
732
762
  border-top: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
733
763
  }
764
+ // &.border--default,
765
+ // &.border--full,
766
+ // &.border--inner,
767
+ // &.border--outer {
768
+ // .vxe-body--row {
769
+ // &:last-child {
770
+ // & > .vxe-body--column {
771
+ // & > .vxe-cell {
772
+ // border-bottom: 1px solid transparent;
773
+ // }
774
+ // }
775
+ // }
776
+ // }
777
+ // .vxe-body--column {
778
+ // &:first-child {
779
+ // & > .vxe-cell {
780
+ // border-left: 1px solid transparent;
781
+ // }
782
+ // }
783
+ // }
784
+ // }
734
785
  &.border--default,
735
786
  &.border--full,
736
787
  &.border--outer {
@@ -883,11 +934,16 @@
883
934
  }
884
935
  }
885
936
  }
937
+
938
+ &.is--padding {
939
+ .vxe-cell {
940
+ padding-left: var(--vxe-ui-table-cell-padding-left);
941
+ padding-right: var(--vxe-ui-table-cell-padding-right);
942
+ }
943
+ }
886
944
  .vxe-cell {
887
945
  white-space: pre-line;
888
946
  word-break: break-all;
889
- padding-left: var(--vxe-ui-table-cell-padding-left);
890
- padding-right: var(--vxe-ui-table-cell-padding-right);
891
947
  }
892
948
 
893
949
  // 单元格占位符
@@ -1146,6 +1202,7 @@
1146
1202
  }
1147
1203
  }
1148
1204
 
1205
+
1149
1206
  /*溢出列*/
1150
1207
  .vxe-header--column,
1151
1208
  .vxe-body--column,
@@ -1159,8 +1216,10 @@
1159
1216
  white-space: nowrap;
1160
1217
  }
1161
1218
  }
1162
- & > .vxe-cell {
1163
- max-height: var(--vxe-ui-table-row-height-default);
1219
+ &:not(.col--height) {
1220
+ & > .vxe-cell {
1221
+ max-height: var(--vxe-ui-table-row-height-default);
1222
+ }
1164
1223
  }
1165
1224
  }
1166
1225
  }
@@ -1170,8 +1229,10 @@
1170
1229
  .vxe-footer--column {
1171
1230
  &.col--ellipsis {
1172
1231
  @extend %MediumColumnHeight;
1173
- & > .vxe-cell {
1174
- max-height: var(--vxe-ui-table-row-height-medium);
1232
+ &:not(.col--height) {
1233
+ & > .vxe-cell {
1234
+ max-height: var(--vxe-ui-table-row-height-medium);
1235
+ }
1175
1236
  }
1176
1237
  }
1177
1238
  }
@@ -1188,8 +1249,10 @@
1188
1249
  .vxe-footer--column {
1189
1250
  &.col--ellipsis {
1190
1251
  @extend %SmallColumnHeight;
1191
- & > .vxe-cell {
1192
- max-height: var(--vxe-ui-table-row-height-small);
1252
+ &:not(.col--height) {
1253
+ & > .vxe-cell {
1254
+ max-height: var(--vxe-ui-table-row-height-small);
1255
+ }
1193
1256
  }
1194
1257
  }
1195
1258
  }
@@ -1206,8 +1269,10 @@
1206
1269
  .vxe-footer--column {
1207
1270
  &.col--ellipsis {
1208
1271
  @extend %MiniColumnHeight;
1209
- & > .vxe-cell {
1210
- max-height: var(--vxe-ui-table-row-height-mini);
1272
+ &:not(.col--height) {
1273
+ & > .vxe-cell {
1274
+ max-height: var(--vxe-ui-table-row-height-mini);
1275
+ }
1211
1276
  }
1212
1277
  }
1213
1278
  }
package/types/all.d.ts CHANGED
@@ -7,6 +7,7 @@ declare global {
7
7
  * @deprecated
8
8
  */
9
9
  VXETable: VxeUIExport;
10
+ VxeUITable: VxeUIExport;
10
11
  }
11
12
  }
12
13