vxe-table 4.19.22 → 4.19.24

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 (183) hide show
  1. package/dist/all.esm.js +634 -335
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/{iconfont.1782890314097.ttf → iconfont.1783331249334.ttf} +0 -0
  5. package/es/iconfont.1783331249334.woff +0 -0
  6. package/es/iconfont.1783331249334.woff2 +0 -0
  7. package/es/index.css +1 -1
  8. package/es/index.min.css +1 -1
  9. package/es/locale/lang/ar-EG.js +12 -3
  10. package/es/locale/lang/de-DE.js +12 -3
  11. package/es/locale/lang/en-US.js +16 -7
  12. package/es/locale/lang/es-ES.js +12 -3
  13. package/es/locale/lang/fr-FR.js +12 -3
  14. package/es/locale/lang/hu-HU.js +12 -3
  15. package/es/locale/lang/hy-AM.js +12 -3
  16. package/es/locale/lang/id-ID.js +12 -3
  17. package/es/locale/lang/it-IT.js +11 -2
  18. package/es/locale/lang/ja-JP.js +12 -3
  19. package/es/locale/lang/ko-KR.js +12 -3
  20. package/es/locale/lang/ms-MY.js +12 -3
  21. package/es/locale/lang/nb-NO.js +12 -3
  22. package/es/locale/lang/pt-BR.js +12 -3
  23. package/es/locale/lang/ru-RU.js +12 -3
  24. package/es/locale/lang/th-TH.js +12 -3
  25. package/es/locale/lang/ug-CN.js +12 -3
  26. package/es/locale/lang/uk-UA.js +12 -3
  27. package/es/locale/lang/uz-UZ.js +12 -3
  28. package/es/locale/lang/vi-VN.js +11 -2
  29. package/es/locale/lang/zh-CHT.js +14 -5
  30. package/es/locale/lang/zh-CN.js +14 -5
  31. package/es/style.css +1 -1
  32. package/es/style.min.css +1 -1
  33. package/es/table/module/custom/hook.js +83 -12
  34. package/es/table/module/custom/panel.js +398 -257
  35. package/es/table/src/cell.js +2 -2
  36. package/es/table/src/columnInfo.js +14 -8
  37. package/es/table/src/emits.js +3 -0
  38. package/es/table/src/table.js +78 -46
  39. package/es/table/src/util.js +32 -1
  40. package/es/table/style.css +96 -49
  41. package/es/table/style.min.css +1 -1
  42. package/es/ui/index.js +16 -4
  43. package/es/ui/src/log.js +1 -1
  44. package/es/vxe-table/style.css +96 -49
  45. package/es/vxe-table/style.min.css +1 -1
  46. package/lib/{iconfont.1782890314097.ttf → iconfont.1783331249334.ttf} +0 -0
  47. package/lib/iconfont.1783331249334.woff +0 -0
  48. package/lib/iconfont.1783331249334.woff2 +0 -0
  49. package/lib/index.css +1 -1
  50. package/lib/index.min.css +1 -1
  51. package/lib/index.umd.js +521 -181
  52. package/lib/index.umd.min.js +1 -1
  53. package/lib/locale/lang/ar-EG.js +12 -3
  54. package/lib/locale/lang/ar-EG.min.js +1 -1
  55. package/lib/locale/lang/ar-EG.umd.js +12 -3
  56. package/lib/locale/lang/de-DE.js +12 -3
  57. package/lib/locale/lang/de-DE.min.js +1 -1
  58. package/lib/locale/lang/de-DE.umd.js +12 -3
  59. package/lib/locale/lang/en-US.js +16 -7
  60. package/lib/locale/lang/en-US.min.js +1 -1
  61. package/lib/locale/lang/en-US.umd.js +16 -7
  62. package/lib/locale/lang/es-ES.js +12 -3
  63. package/lib/locale/lang/es-ES.min.js +1 -1
  64. package/lib/locale/lang/es-ES.umd.js +12 -3
  65. package/lib/locale/lang/fr-FR.js +12 -3
  66. package/lib/locale/lang/fr-FR.min.js +1 -1
  67. package/lib/locale/lang/fr-FR.umd.js +12 -3
  68. package/lib/locale/lang/hu-HU.js +12 -3
  69. package/lib/locale/lang/hu-HU.min.js +1 -1
  70. package/lib/locale/lang/hu-HU.umd.js +12 -3
  71. package/lib/locale/lang/hy-AM.js +12 -3
  72. package/lib/locale/lang/hy-AM.min.js +1 -1
  73. package/lib/locale/lang/hy-AM.umd.js +12 -3
  74. package/lib/locale/lang/id-ID.js +12 -3
  75. package/lib/locale/lang/id-ID.min.js +1 -1
  76. package/lib/locale/lang/id-ID.umd.js +12 -3
  77. package/lib/locale/lang/it-IT.js +11 -2
  78. package/lib/locale/lang/it-IT.min.js +1 -1
  79. package/lib/locale/lang/it-IT.umd.js +11 -2
  80. package/lib/locale/lang/ja-JP.js +12 -3
  81. package/lib/locale/lang/ja-JP.min.js +1 -1
  82. package/lib/locale/lang/ja-JP.umd.js +12 -3
  83. package/lib/locale/lang/ko-KR.js +12 -3
  84. package/lib/locale/lang/ko-KR.min.js +1 -1
  85. package/lib/locale/lang/ko-KR.umd.js +12 -3
  86. package/lib/locale/lang/ms-MY.js +12 -3
  87. package/lib/locale/lang/ms-MY.min.js +1 -1
  88. package/lib/locale/lang/ms-MY.umd.js +12 -3
  89. package/lib/locale/lang/nb-NO.js +12 -3
  90. package/lib/locale/lang/nb-NO.min.js +1 -1
  91. package/lib/locale/lang/nb-NO.umd.js +12 -3
  92. package/lib/locale/lang/pt-BR.js +12 -3
  93. package/lib/locale/lang/pt-BR.min.js +1 -1
  94. package/lib/locale/lang/pt-BR.umd.js +12 -3
  95. package/lib/locale/lang/ru-RU.js +12 -3
  96. package/lib/locale/lang/ru-RU.min.js +1 -1
  97. package/lib/locale/lang/ru-RU.umd.js +12 -3
  98. package/lib/locale/lang/th-TH.js +12 -3
  99. package/lib/locale/lang/th-TH.min.js +1 -1
  100. package/lib/locale/lang/th-TH.umd.js +12 -3
  101. package/lib/locale/lang/ug-CN.js +12 -3
  102. package/lib/locale/lang/ug-CN.min.js +1 -1
  103. package/lib/locale/lang/ug-CN.umd.js +12 -3
  104. package/lib/locale/lang/uk-UA.js +12 -3
  105. package/lib/locale/lang/uk-UA.min.js +1 -1
  106. package/lib/locale/lang/uk-UA.umd.js +12 -3
  107. package/lib/locale/lang/uz-UZ.js +12 -3
  108. package/lib/locale/lang/uz-UZ.min.js +1 -1
  109. package/lib/locale/lang/uz-UZ.umd.js +12 -3
  110. package/lib/locale/lang/vi-VN.js +11 -2
  111. package/lib/locale/lang/vi-VN.min.js +1 -1
  112. package/lib/locale/lang/vi-VN.umd.js +11 -2
  113. package/lib/locale/lang/zh-CHT.js +14 -5
  114. package/lib/locale/lang/zh-CHT.min.js +1 -1
  115. package/lib/locale/lang/zh-CHT.umd.js +14 -5
  116. package/lib/locale/lang/zh-CN.js +14 -5
  117. package/lib/locale/lang/zh-CN.min.js +1 -1
  118. package/lib/locale/lang/zh-CN.umd.js +14 -5
  119. package/lib/style.css +1 -1
  120. package/lib/style.min.css +1 -1
  121. package/lib/table/module/custom/hook.js +90 -10
  122. package/lib/table/module/custom/hook.min.js +1 -1
  123. package/lib/table/module/custom/panel.js +333 -141
  124. package/lib/table/module/custom/panel.min.js +1 -1
  125. package/lib/table/src/cell.js +2 -1
  126. package/lib/table/src/cell.min.js +1 -1
  127. package/lib/table/src/columnInfo.js +17 -7
  128. package/lib/table/src/columnInfo.min.js +1 -1
  129. package/lib/table/src/emits.js +1 -1
  130. package/lib/table/src/emits.min.js +1 -1
  131. package/lib/table/src/table.js +10 -10
  132. package/lib/table/src/table.min.js +1 -1
  133. package/lib/table/src/util.js +38 -1
  134. package/lib/table/src/util.min.js +1 -1
  135. package/lib/table/style/style.css +96 -49
  136. package/lib/table/style/style.min.css +1 -1
  137. package/lib/ui/index.js +16 -4
  138. package/lib/ui/index.min.js +1 -1
  139. package/lib/ui/src/log.js +1 -1
  140. package/lib/ui/src/log.min.js +1 -1
  141. package/lib/vxe-table/style/style.css +96 -49
  142. package/lib/vxe-table/style/style.min.css +1 -1
  143. package/package.json +2 -2
  144. package/packages/locale/lang/ar-EG.ts +12 -3
  145. package/packages/locale/lang/de-DE.ts +12 -3
  146. package/packages/locale/lang/en-US.ts +16 -7
  147. package/packages/locale/lang/es-ES.ts +12 -3
  148. package/packages/locale/lang/fr-FR.ts +12 -3
  149. package/packages/locale/lang/hu-HU.ts +12 -3
  150. package/packages/locale/lang/hy-AM.ts +12 -3
  151. package/packages/locale/lang/id-ID.ts +12 -3
  152. package/packages/locale/lang/it-IT.ts +11 -2
  153. package/packages/locale/lang/ja-JP.ts +12 -3
  154. package/packages/locale/lang/ko-KR.ts +12 -3
  155. package/packages/locale/lang/ms-MY.ts +12 -3
  156. package/packages/locale/lang/nb-NO.ts +12 -3
  157. package/packages/locale/lang/pt-BR.ts +12 -3
  158. package/packages/locale/lang/ru-RU.ts +12 -3
  159. package/packages/locale/lang/th-TH.ts +12 -3
  160. package/packages/locale/lang/ug-CN.ts +12 -3
  161. package/packages/locale/lang/uk-UA.ts +12 -3
  162. package/packages/locale/lang/uz-UZ.ts +12 -3
  163. package/packages/locale/lang/vi-VN.ts +11 -2
  164. package/packages/locale/lang/zh-CHT.ts +14 -5
  165. package/packages/locale/lang/zh-CN.ts +14 -5
  166. package/packages/table/module/custom/hook.ts +83 -12
  167. package/packages/table/module/custom/panel.ts +481 -286
  168. package/packages/table/src/cell.ts +2 -2
  169. package/packages/table/src/columnInfo.ts +14 -8
  170. package/packages/table/src/emits.ts +3 -0
  171. package/packages/table/src/table.ts +89 -47
  172. package/packages/table/src/util.ts +35 -1
  173. package/packages/ui/index.ts +15 -3
  174. package/styles/components/icon.scss +29 -2
  175. package/styles/components/table-module/custom.scss +88 -67
  176. package/styles/icon/iconfont.ttf +0 -0
  177. package/styles/icon/iconfont.woff +0 -0
  178. package/styles/icon/iconfont.woff2 +0 -0
  179. package/styles/theme/base.scss +11 -0
  180. package/es/iconfont.1782890314097.woff +0 -0
  181. package/es/iconfont.1782890314097.woff2 +0 -0
  182. package/lib/iconfont.1782890314097.woff +0 -0
  183. package/lib/iconfont.1782890314097.woff2 +0 -0
@@ -175,10 +175,16 @@ export default {
175
175
  colResizable: '列寬(像素)',
176
176
  colVisible: '是否顯示',
177
177
  colFixed: '凍結列',
178
- colFixedMax: '凍結列(最多 {0} 列)',
179
- fixedLeft: '左側',
180
- fixedUnset: '不設置',
181
- fixedRight: '右側',
178
+ colFixedMax: '凍結列({0}',
179
+ colAlign: '对齐方式',
180
+ colHeadAlign: '表头对齐方式',
181
+ colFootAlign: '表尾对齐方式',
182
+ fixedLeft: '左',
183
+ fixedUnset: '无',
184
+ fixedRight: '右',
185
+ alignLeft: '左',
186
+ alignCenter: '中',
187
+ alignRight: '右',
182
188
  moveUp: '上移',
183
189
  moveDn: '下移',
184
190
  putTop: '置顶',
@@ -186,7 +192,10 @@ export default {
186
192
  moveUpTitle: '点击向上移动',
187
193
  moveDnTitle: '点击向下移动',
188
194
  putTopTitle: '点击置顶',
189
- putBottomTitle: '点击置尾'
195
+ putBottomTitle: '点击置尾',
196
+ anLeftTitle: '左对齐',
197
+ anCenterTitle: '居中',
198
+ anRightTitle: '右对齐'
190
199
  }
191
200
  },
192
201
  import: {
@@ -175,10 +175,16 @@ export default {
175
175
  colResizable: '列宽(像素)',
176
176
  colVisible: '是否显示',
177
177
  colFixed: '冻结列',
178
- colFixedMax: '冻结列(最多 {0} 列)',
179
- fixedLeft: '左侧',
180
- fixedUnset: '不设置',
181
- fixedRight: '右侧',
178
+ colFixedMax: '冻结列({0}',
179
+ colAlign: '对齐方式',
180
+ colHeadAlign: '表头对齐方式',
181
+ colFootAlign: '表尾对齐方式',
182
+ fixedLeft: '左',
183
+ fixedUnset: '无',
184
+ fixedRight: '右',
185
+ alignLeft: '左',
186
+ alignCenter: '中',
187
+ alignRight: '右',
182
188
  moveUp: '上移',
183
189
  moveDn: '下移',
184
190
  putTop: '置顶',
@@ -186,7 +192,10 @@ export default {
186
192
  moveUpTitle: '点击向上移动',
187
193
  moveDnTitle: '点击向下移动',
188
194
  putTopTitle: '点击置顶',
189
- putBottomTitle: '点击置尾'
195
+ putBottomTitle: '点击置尾',
196
+ anLeftTitle: '左对齐',
197
+ anCenterTitle: '居中',
198
+ anRightTitle: '右对齐'
190
199
  }
191
200
  },
192
201
  import: {
@@ -8,6 +8,8 @@ import type { TableCustomMethods, TableCustomPrivateMethods, VxeColumnPropTypes,
8
8
 
9
9
  const tableCustomMethodKeys: (keyof TableCustomMethods)[] = ['openCustom', 'closeCustom', 'getCustomVisible', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox']
10
10
 
11
+ const customColumnCssKeys = ['checkbox', 'sort', 'title', 'width', 'fixed', 'align', 'header-align', 'footer-align']
12
+
11
13
  VxeUI.hooks.add('tableCustomModule', {
12
14
  setupTable ($xeTable) {
13
15
  const { reactData, internalData } = $xeTable
@@ -23,14 +25,15 @@ VxeUI.hooks.add('tableCustomModule', {
23
25
  const customOpts = computeCustomOpts.value
24
26
  const { mode, placement, popupOptions } = customOpts
25
27
  const showSimple = !(mode === 'modal' || mode === 'drawer')
26
- const { transfer, maxHeight } = popupOptions || {}
28
+ const { transfer, minWidth, maxWidth, maxHeight } = popupOptions || {}
27
29
  const customSimpleMode = computeCustomSimpleMode.value
28
30
  const showCustomSimpleOutside = customSimpleMode === 'outside'
29
31
  const bodyEl = document.documentElement
30
32
  let wrapperEl = refElem.value
31
33
  let popupTop = 0
32
34
  let popupMaxHeight: string | number = 0
33
- const popupStys: VxeComponentStyleType = {}
35
+ const defPupStys: VxeComponentStyleType = {}
36
+ const panePupStys: VxeComponentStyleType = {}
34
37
  if ($xeGantt) {
35
38
  const { refGanttContainerElem } = $xeGantt.getRefMaps()
36
39
  const ganttContainerElem = refGanttContainerElem.value
@@ -61,25 +64,42 @@ VxeUI.hooks.add('tableCustomModule', {
61
64
  }
62
65
  if (!placement || !(['left', 'right', 'bottom-left', 'bottom-right'].includes(placement))) {
63
66
  if (popupTop) {
64
- popupStys.top = toCssUnit(popupTop)
67
+ defPupStys.top = toCssUnit(popupTop)
65
68
  }
66
69
  }
67
70
 
68
71
  if (showSimple && transfer) {
69
72
  if (placement === 'bottom-left' || placement === 'bottom-right') {
70
- popupStys.bottom = toCssUnit(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1)
73
+ defPupStys.bottom = toCssUnit(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1)
71
74
  }
72
75
  if (placement === 'top-left' || placement === 'bottom-left') {
73
- popupStys.left = toCssUnit(tableRect.left)
76
+ defPupStys.left = toCssUnit(tableRect.left)
74
77
  } else if (!placement || placement === 'top-right' || placement === 'bottom-right') {
75
- popupStys.right = toCssUnit(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1)
78
+ defPupStys.right = toCssUnit(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1)
76
79
  }
77
80
  }
78
81
 
82
+ // 同步表格的css变量到弹窗中
83
+ const bodyComputeStyle = getComputedStyle(bodyEl)
84
+ const tableComputeStyle = getComputedStyle(wrapperEl)
85
+ customColumnCssKeys.forEach(key => {
86
+ const currCssKey = `--vxe-ui-vxe-table-custom-column-${key}-${key === 'title' ? 'min-' : ''}width`
87
+ const currCssVal = tableComputeStyle.getPropertyValue(currCssKey)
88
+ if (currCssVal && currCssVal !== bodyComputeStyle.getPropertyValue(currCssKey)) {
89
+ panePupStys[currCssKey] = currCssVal
90
+ }
91
+ })
92
+ if (minWidth) {
93
+ defPupStys['--vxe-ui-vxe-table-custom-default-min-width'] = toCssUnit(minWidth)
94
+ }
95
+ if (maxWidth) {
96
+ defPupStys['--vxe-ui-vxe-table-custom-default-max-width'] = toCssUnit(maxWidth)
97
+ }
79
98
  if (popupMxHeight) {
80
- popupStys.maxHeight = toCssUnit(popupMxHeight)
99
+ defPupStys.maxHeight = toCssUnit(popupMxHeight)
81
100
  }
82
- customStore.popupStyle = popupStys
101
+ customStore.defPopupStyle = defPupStys
102
+ customStore.panePopupStyle = panePupStys
83
103
  customStore.maxHeight = popupMxHeight
84
104
  return nextTick()
85
105
  }
@@ -129,6 +149,9 @@ VxeUI.hooks.add('tableCustomModule', {
129
149
  column.renderFixed = column.fixed
130
150
  column.renderVisible = column.visible
131
151
  column.renderResizeWidth = column.renderWidth
152
+ column.renderAlign = column.align
153
+ column.renderHeaderAlign = column.headerAlign
154
+ column.renderFooterAlign = column.footerAlign
132
155
  sortMaps[colid] = column.renderSortNumber
133
156
  fixedMaps[colid] = column.fixed
134
157
  visibleMaps[colid] = column.visible
@@ -163,8 +186,16 @@ VxeUI.hooks.add('tableCustomModule', {
163
186
  const saveCustom = (isDirectly?: boolean) => {
164
187
  const { customColumnList, aggHandleFields, rowGroupList } = reactData
165
188
  const customOpts = computeCustomOpts.value
166
- const { allowVisible, allowSort, allowFixed, allowResizable, allowGroup, allowValues } = customOpts
167
- if (!isDirectly) {
189
+ const { allowVisible, allowSort, allowFixed, allowResizable, allowAlign, allowHeaderAlign, allowFooterAlign, allowGroup, allowValues } = customOpts
190
+ if (isDirectly) {
191
+ XEUtils.eachTree(customColumnList, (column) => {
192
+ if (allowResizable) {
193
+ if (column.renderVisible && (!column.children || !column.children.length)) {
194
+ column.resizeWidth = Math.max(0, XEUtils.toNumber(column.renderWidth))
195
+ }
196
+ }
197
+ })
198
+ } else {
168
199
  XEUtils.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
169
200
  if (parentColumn) {
170
201
  // 更新子列信息
@@ -189,6 +220,15 @@ VxeUI.hooks.add('tableCustomModule', {
189
220
  if (allowVisible) {
190
221
  column.visible = column.renderVisible
191
222
  }
223
+ if (allowAlign) {
224
+ column.align = column.renderAlign
225
+ }
226
+ if (allowHeaderAlign) {
227
+ column.headerAlign = column.renderHeaderAlign
228
+ }
229
+ if (allowFooterAlign) {
230
+ column.footerAlign = column.renderFooterAlign
231
+ }
192
232
  if (allowGroup && allowValues) {
193
233
  column.aggFunc = column.renderAggFn
194
234
  }
@@ -218,7 +258,7 @@ VxeUI.hooks.add('tableCustomModule', {
218
258
  const { customColumnList, customStore } = reactData
219
259
  const { oldSortMaps, oldFixedMaps, oldVisibleMaps } = customStore
220
260
  const customOpts = computeCustomOpts.value
221
- const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts
261
+ const { allowVisible, allowSort, allowFixed, allowAlign, allowHeaderAlign, allowFooterAlign, allowResizable, allowGroup, allowValues } = customOpts
222
262
  XEUtils.eachTree(customColumnList, column => {
223
263
  const colid = column.getKey()
224
264
  const visible = !!oldVisibleMaps[colid]
@@ -237,6 +277,21 @@ VxeUI.hooks.add('tableCustomModule', {
237
277
  if (allowResizable) {
238
278
  column.renderResizeWidth = column.renderWidth
239
279
  }
280
+ if (allowAlign) {
281
+ column.align = column.renderAlign
282
+ }
283
+ if (allowHeaderAlign) {
284
+ column.headerAlign = column.renderHeaderAlign
285
+ }
286
+ if (allowFooterAlign) {
287
+ column.footerAlign = column.renderFooterAlign
288
+ }
289
+ if (allowGroup) {
290
+ // 无
291
+ }
292
+ if (allowValues) {
293
+ // 无
294
+ }
240
295
  }, { children: 'children' })
241
296
  return nextTick()
242
297
  }
@@ -300,7 +355,10 @@ VxeUI.hooks.add('tableCustomModule', {
300
355
  resizable: options === true,
301
356
  fixed: options === true,
302
357
  sort: options === true,
303
- aggFunc: options === true
358
+ aggFunc: options === true,
359
+ align: options === true,
360
+ headerAlign: options === true,
361
+ footerAlign: options === true
304
362
  }, options)
305
363
  const allCols: VxeTableDefines.ColumnInfo[] = []
306
364
  XEUtils.eachTree(collectColumn, (column) => {
@@ -309,6 +367,7 @@ VxeUI.hooks.add('tableCustomModule', {
309
367
  }
310
368
  if (opts.fixed) {
311
369
  column.fixed = column.defaultFixed
370
+ column.renderFixed = column.defaultFixed
312
371
  }
313
372
  if (opts.sort) {
314
373
  column.renderSortNumber = column.sortNumber
@@ -317,6 +376,18 @@ VxeUI.hooks.add('tableCustomModule', {
317
376
  if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
318
377
  column.visible = column.defaultVisible
319
378
  }
379
+ if (opts.align) {
380
+ column.align = column.defaultAlign
381
+ column.renderAlign = column.defaultAlign
382
+ }
383
+ if (opts.headerAlign) {
384
+ column.headerAlign = column.defaultHeaderAlign
385
+ column.renderHeaderAlign = column.defaultHeaderAlign
386
+ }
387
+ if (opts.footerAlign) {
388
+ column.footerAlign = column.defaultFooterAlign
389
+ column.renderFooterAlign = column.defaultFooterAlign
390
+ }
320
391
  if (opts.aggFunc) {
321
392
  column.aggFunc = column.defaultAggFunc
322
393
  column.renderAggFn = column.defaultAggFunc