vxe-table 4.19.22 → 4.19.23

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 (179) hide show
  1. package/dist/all.esm.js +630 -332
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/{iconfont.1782890314097.ttf → iconfont.1783046321610.ttf} +0 -0
  5. package/es/iconfont.1783046321610.woff +0 -0
  6. package/es/iconfont.1783046321610.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/columnInfo.js +14 -8
  36. package/es/table/src/emits.js +3 -0
  37. package/es/table/src/table.js +76 -45
  38. package/es/table/src/util.js +32 -1
  39. package/es/table/style.css +96 -49
  40. package/es/table/style.min.css +1 -1
  41. package/es/ui/index.js +16 -4
  42. package/es/ui/src/log.js +1 -1
  43. package/es/vxe-table/style.css +96 -49
  44. package/es/vxe-table/style.min.css +1 -1
  45. package/lib/{iconfont.1782890314097.ttf → iconfont.1783046321610.ttf} +0 -0
  46. package/lib/iconfont.1783046321610.woff +0 -0
  47. package/lib/iconfont.1783046321610.woff2 +0 -0
  48. package/lib/index.css +1 -1
  49. package/lib/index.min.css +1 -1
  50. package/lib/index.umd.js +518 -179
  51. package/lib/index.umd.min.js +1 -1
  52. package/lib/locale/lang/ar-EG.js +12 -3
  53. package/lib/locale/lang/ar-EG.min.js +1 -1
  54. package/lib/locale/lang/ar-EG.umd.js +12 -3
  55. package/lib/locale/lang/de-DE.js +12 -3
  56. package/lib/locale/lang/de-DE.min.js +1 -1
  57. package/lib/locale/lang/de-DE.umd.js +12 -3
  58. package/lib/locale/lang/en-US.js +16 -7
  59. package/lib/locale/lang/en-US.min.js +1 -1
  60. package/lib/locale/lang/en-US.umd.js +16 -7
  61. package/lib/locale/lang/es-ES.js +12 -3
  62. package/lib/locale/lang/es-ES.min.js +1 -1
  63. package/lib/locale/lang/es-ES.umd.js +12 -3
  64. package/lib/locale/lang/fr-FR.js +12 -3
  65. package/lib/locale/lang/fr-FR.min.js +1 -1
  66. package/lib/locale/lang/fr-FR.umd.js +12 -3
  67. package/lib/locale/lang/hu-HU.js +12 -3
  68. package/lib/locale/lang/hu-HU.min.js +1 -1
  69. package/lib/locale/lang/hu-HU.umd.js +12 -3
  70. package/lib/locale/lang/hy-AM.js +12 -3
  71. package/lib/locale/lang/hy-AM.min.js +1 -1
  72. package/lib/locale/lang/hy-AM.umd.js +12 -3
  73. package/lib/locale/lang/id-ID.js +12 -3
  74. package/lib/locale/lang/id-ID.min.js +1 -1
  75. package/lib/locale/lang/id-ID.umd.js +12 -3
  76. package/lib/locale/lang/it-IT.js +11 -2
  77. package/lib/locale/lang/it-IT.min.js +1 -1
  78. package/lib/locale/lang/it-IT.umd.js +11 -2
  79. package/lib/locale/lang/ja-JP.js +12 -3
  80. package/lib/locale/lang/ja-JP.min.js +1 -1
  81. package/lib/locale/lang/ja-JP.umd.js +12 -3
  82. package/lib/locale/lang/ko-KR.js +12 -3
  83. package/lib/locale/lang/ko-KR.min.js +1 -1
  84. package/lib/locale/lang/ko-KR.umd.js +12 -3
  85. package/lib/locale/lang/ms-MY.js +12 -3
  86. package/lib/locale/lang/ms-MY.min.js +1 -1
  87. package/lib/locale/lang/ms-MY.umd.js +12 -3
  88. package/lib/locale/lang/nb-NO.js +12 -3
  89. package/lib/locale/lang/nb-NO.min.js +1 -1
  90. package/lib/locale/lang/nb-NO.umd.js +12 -3
  91. package/lib/locale/lang/pt-BR.js +12 -3
  92. package/lib/locale/lang/pt-BR.min.js +1 -1
  93. package/lib/locale/lang/pt-BR.umd.js +12 -3
  94. package/lib/locale/lang/ru-RU.js +12 -3
  95. package/lib/locale/lang/ru-RU.min.js +1 -1
  96. package/lib/locale/lang/ru-RU.umd.js +12 -3
  97. package/lib/locale/lang/th-TH.js +12 -3
  98. package/lib/locale/lang/th-TH.min.js +1 -1
  99. package/lib/locale/lang/th-TH.umd.js +12 -3
  100. package/lib/locale/lang/ug-CN.js +12 -3
  101. package/lib/locale/lang/ug-CN.min.js +1 -1
  102. package/lib/locale/lang/ug-CN.umd.js +12 -3
  103. package/lib/locale/lang/uk-UA.js +12 -3
  104. package/lib/locale/lang/uk-UA.min.js +1 -1
  105. package/lib/locale/lang/uk-UA.umd.js +12 -3
  106. package/lib/locale/lang/uz-UZ.js +12 -3
  107. package/lib/locale/lang/uz-UZ.min.js +1 -1
  108. package/lib/locale/lang/uz-UZ.umd.js +12 -3
  109. package/lib/locale/lang/vi-VN.js +11 -2
  110. package/lib/locale/lang/vi-VN.min.js +1 -1
  111. package/lib/locale/lang/vi-VN.umd.js +11 -2
  112. package/lib/locale/lang/zh-CHT.js +14 -5
  113. package/lib/locale/lang/zh-CHT.min.js +1 -1
  114. package/lib/locale/lang/zh-CHT.umd.js +14 -5
  115. package/lib/locale/lang/zh-CN.js +14 -5
  116. package/lib/locale/lang/zh-CN.min.js +1 -1
  117. package/lib/locale/lang/zh-CN.umd.js +14 -5
  118. package/lib/style.css +1 -1
  119. package/lib/style.min.css +1 -1
  120. package/lib/table/module/custom/hook.js +90 -10
  121. package/lib/table/module/custom/hook.min.js +1 -1
  122. package/lib/table/module/custom/panel.js +333 -141
  123. package/lib/table/module/custom/panel.min.js +1 -1
  124. package/lib/table/src/columnInfo.js +17 -7
  125. package/lib/table/src/columnInfo.min.js +1 -1
  126. package/lib/table/src/emits.js +1 -1
  127. package/lib/table/src/emits.min.js +1 -1
  128. package/lib/table/src/table.js +9 -9
  129. package/lib/table/src/table.min.js +1 -1
  130. package/lib/table/src/util.js +38 -1
  131. package/lib/table/src/util.min.js +1 -1
  132. package/lib/table/style/style.css +96 -49
  133. package/lib/table/style/style.min.css +1 -1
  134. package/lib/ui/index.js +16 -4
  135. package/lib/ui/index.min.js +1 -1
  136. package/lib/ui/src/log.js +1 -1
  137. package/lib/ui/src/log.min.js +1 -1
  138. package/lib/vxe-table/style/style.css +96 -49
  139. package/lib/vxe-table/style/style.min.css +1 -1
  140. package/package.json +2 -2
  141. package/packages/locale/lang/ar-EG.ts +12 -3
  142. package/packages/locale/lang/de-DE.ts +12 -3
  143. package/packages/locale/lang/en-US.ts +16 -7
  144. package/packages/locale/lang/es-ES.ts +12 -3
  145. package/packages/locale/lang/fr-FR.ts +12 -3
  146. package/packages/locale/lang/hu-HU.ts +12 -3
  147. package/packages/locale/lang/hy-AM.ts +12 -3
  148. package/packages/locale/lang/id-ID.ts +12 -3
  149. package/packages/locale/lang/it-IT.ts +11 -2
  150. package/packages/locale/lang/ja-JP.ts +12 -3
  151. package/packages/locale/lang/ko-KR.ts +12 -3
  152. package/packages/locale/lang/ms-MY.ts +12 -3
  153. package/packages/locale/lang/nb-NO.ts +12 -3
  154. package/packages/locale/lang/pt-BR.ts +12 -3
  155. package/packages/locale/lang/ru-RU.ts +12 -3
  156. package/packages/locale/lang/th-TH.ts +12 -3
  157. package/packages/locale/lang/ug-CN.ts +12 -3
  158. package/packages/locale/lang/uk-UA.ts +12 -3
  159. package/packages/locale/lang/uz-UZ.ts +12 -3
  160. package/packages/locale/lang/vi-VN.ts +11 -2
  161. package/packages/locale/lang/zh-CHT.ts +14 -5
  162. package/packages/locale/lang/zh-CN.ts +14 -5
  163. package/packages/table/module/custom/hook.ts +83 -12
  164. package/packages/table/module/custom/panel.ts +481 -286
  165. package/packages/table/src/columnInfo.ts +14 -8
  166. package/packages/table/src/emits.ts +3 -0
  167. package/packages/table/src/table.ts +87 -46
  168. package/packages/table/src/util.ts +35 -1
  169. package/packages/ui/index.ts +15 -3
  170. package/styles/components/icon.scss +29 -2
  171. package/styles/components/table-module/custom.scss +88 -67
  172. package/styles/icon/iconfont.ttf +0 -0
  173. package/styles/icon/iconfont.woff +0 -0
  174. package/styles/icon/iconfont.woff2 +0 -0
  175. package/styles/theme/base.scss +11 -0
  176. package/es/iconfont.1782890314097.woff +0 -0
  177. package/es/iconfont.1782890314097.woff2 +0 -0
  178. package/lib/iconfont.1782890314097.woff +0 -0
  179. package/lib/iconfont.1782890314097.woff2 +0 -0
@@ -4,6 +4,7 @@ import XEUtils from 'xe-utils';
4
4
  import { getColumnList } from '../../src/util';
5
5
  import { toCssUnit } from '../../../ui/src/dom';
6
6
  const tableCustomMethodKeys = ['openCustom', 'closeCustom', 'getCustomVisible', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox'];
7
+ const customColumnCssKeys = ['checkbox', 'sort', 'title', 'width', 'fixed', 'align', 'header-align', 'footer-align'];
7
8
  VxeUI.hooks.add('tableCustomModule', {
8
9
  setupTable($xeTable) {
9
10
  const { reactData, internalData } = $xeTable;
@@ -17,14 +18,15 @@ VxeUI.hooks.add('tableCustomModule', {
17
18
  const customOpts = computeCustomOpts.value;
18
19
  const { mode, placement, popupOptions } = customOpts;
19
20
  const showSimple = !(mode === 'modal' || mode === 'drawer');
20
- const { transfer, maxHeight } = popupOptions || {};
21
+ const { transfer, minWidth, maxWidth, maxHeight } = popupOptions || {};
21
22
  const customSimpleMode = computeCustomSimpleMode.value;
22
23
  const showCustomSimpleOutside = customSimpleMode === 'outside';
23
24
  const bodyEl = document.documentElement;
24
25
  let wrapperEl = refElem.value;
25
26
  let popupTop = 0;
26
27
  let popupMaxHeight = 0;
27
- const popupStys = {};
28
+ const defPupStys = {};
29
+ const panePupStys = {};
28
30
  if ($xeGantt) {
29
31
  const { refGanttContainerElem } = $xeGantt.getRefMaps();
30
32
  const ganttContainerElem = refGanttContainerElem.value;
@@ -57,24 +59,41 @@ VxeUI.hooks.add('tableCustomModule', {
57
59
  }
58
60
  if (!placement || !(['left', 'right', 'bottom-left', 'bottom-right'].includes(placement))) {
59
61
  if (popupTop) {
60
- popupStys.top = toCssUnit(popupTop);
62
+ defPupStys.top = toCssUnit(popupTop);
61
63
  }
62
64
  }
63
65
  if (showSimple && transfer) {
64
66
  if (placement === 'bottom-left' || placement === 'bottom-right') {
65
- popupStys.bottom = toCssUnit(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1);
67
+ defPupStys.bottom = toCssUnit(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1);
66
68
  }
67
69
  if (placement === 'top-left' || placement === 'bottom-left') {
68
- popupStys.left = toCssUnit(tableRect.left);
70
+ defPupStys.left = toCssUnit(tableRect.left);
69
71
  }
70
72
  else if (!placement || placement === 'top-right' || placement === 'bottom-right') {
71
- popupStys.right = toCssUnit(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1);
73
+ defPupStys.right = toCssUnit(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1);
72
74
  }
73
75
  }
76
+ // 同步表格的css变量到弹窗中
77
+ const bodyComputeStyle = getComputedStyle(bodyEl);
78
+ const tableComputeStyle = getComputedStyle(wrapperEl);
79
+ customColumnCssKeys.forEach(key => {
80
+ const currCssKey = `--vxe-ui-vxe-table-custom-column-${key}-${key === 'title' ? 'min-' : ''}width`;
81
+ const currCssVal = tableComputeStyle.getPropertyValue(currCssKey);
82
+ if (currCssVal && currCssVal !== bodyComputeStyle.getPropertyValue(currCssKey)) {
83
+ panePupStys[currCssKey] = currCssVal;
84
+ }
85
+ });
86
+ if (minWidth) {
87
+ defPupStys['--vxe-ui-vxe-table-custom-default-min-width'] = toCssUnit(minWidth);
88
+ }
89
+ if (maxWidth) {
90
+ defPupStys['--vxe-ui-vxe-table-custom-default-max-width'] = toCssUnit(maxWidth);
91
+ }
74
92
  if (popupMxHeight) {
75
- popupStys.maxHeight = toCssUnit(popupMxHeight);
93
+ defPupStys.maxHeight = toCssUnit(popupMxHeight);
76
94
  }
77
- customStore.popupStyle = popupStys;
95
+ customStore.defPopupStyle = defPupStys;
96
+ customStore.panePopupStyle = panePupStys;
78
97
  customStore.maxHeight = popupMxHeight;
79
98
  return nextTick();
80
99
  };
@@ -123,6 +142,9 @@ VxeUI.hooks.add('tableCustomModule', {
123
142
  column.renderFixed = column.fixed;
124
143
  column.renderVisible = column.visible;
125
144
  column.renderResizeWidth = column.renderWidth;
145
+ column.renderAlign = column.align;
146
+ column.renderHeaderAlign = column.headerAlign;
147
+ column.renderFooterAlign = column.footerAlign;
126
148
  sortMaps[colid] = column.renderSortNumber;
127
149
  fixedMaps[colid] = column.fixed;
128
150
  visibleMaps[colid] = column.visible;
@@ -154,8 +176,17 @@ VxeUI.hooks.add('tableCustomModule', {
154
176
  const saveCustom = (isDirectly) => {
155
177
  const { customColumnList, aggHandleFields, rowGroupList } = reactData;
156
178
  const customOpts = computeCustomOpts.value;
157
- const { allowVisible, allowSort, allowFixed, allowResizable, allowGroup, allowValues } = customOpts;
158
- if (!isDirectly) {
179
+ const { allowVisible, allowSort, allowFixed, allowResizable, allowAlign, allowHeaderAlign, allowFooterAlign, allowGroup, allowValues } = customOpts;
180
+ if (isDirectly) {
181
+ XEUtils.eachTree(customColumnList, (column) => {
182
+ if (allowResizable) {
183
+ if (column.renderVisible && (!column.children || !column.children.length)) {
184
+ column.resizeWidth = Math.max(0, XEUtils.toNumber(column.renderWidth));
185
+ }
186
+ }
187
+ });
188
+ }
189
+ else {
159
190
  XEUtils.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
160
191
  if (parentColumn) {
161
192
  // 更新子列信息
@@ -181,6 +212,15 @@ VxeUI.hooks.add('tableCustomModule', {
181
212
  if (allowVisible) {
182
213
  column.visible = column.renderVisible;
183
214
  }
215
+ if (allowAlign) {
216
+ column.align = column.renderAlign;
217
+ }
218
+ if (allowHeaderAlign) {
219
+ column.headerAlign = column.renderHeaderAlign;
220
+ }
221
+ if (allowFooterAlign) {
222
+ column.footerAlign = column.renderFooterAlign;
223
+ }
184
224
  if (allowGroup && allowValues) {
185
225
  column.aggFunc = column.renderAggFn;
186
226
  }
@@ -211,7 +251,7 @@ VxeUI.hooks.add('tableCustomModule', {
211
251
  const { customColumnList, customStore } = reactData;
212
252
  const { oldSortMaps, oldFixedMaps, oldVisibleMaps } = customStore;
213
253
  const customOpts = computeCustomOpts.value;
214
- const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts;
254
+ const { allowVisible, allowSort, allowFixed, allowAlign, allowHeaderAlign, allowFooterAlign, allowResizable, allowGroup, allowValues } = customOpts;
215
255
  XEUtils.eachTree(customColumnList, column => {
216
256
  const colid = column.getKey();
217
257
  const visible = !!oldVisibleMaps[colid];
@@ -230,6 +270,21 @@ VxeUI.hooks.add('tableCustomModule', {
230
270
  if (allowResizable) {
231
271
  column.renderResizeWidth = column.renderWidth;
232
272
  }
273
+ if (allowAlign) {
274
+ column.align = column.renderAlign;
275
+ }
276
+ if (allowHeaderAlign) {
277
+ column.headerAlign = column.renderHeaderAlign;
278
+ }
279
+ if (allowFooterAlign) {
280
+ column.footerAlign = column.renderFooterAlign;
281
+ }
282
+ if (allowGroup) {
283
+ // 无
284
+ }
285
+ if (allowValues) {
286
+ // 无
287
+ }
233
288
  }, { children: 'children' });
234
289
  return nextTick();
235
290
  };
@@ -292,7 +347,10 @@ VxeUI.hooks.add('tableCustomModule', {
292
347
  resizable: options === true,
293
348
  fixed: options === true,
294
349
  sort: options === true,
295
- aggFunc: options === true
350
+ aggFunc: options === true,
351
+ align: options === true,
352
+ headerAlign: options === true,
353
+ footerAlign: options === true
296
354
  }, options);
297
355
  const allCols = [];
298
356
  XEUtils.eachTree(collectColumn, (column) => {
@@ -301,6 +359,7 @@ VxeUI.hooks.add('tableCustomModule', {
301
359
  }
302
360
  if (opts.fixed) {
303
361
  column.fixed = column.defaultFixed;
362
+ column.renderFixed = column.defaultFixed;
304
363
  }
305
364
  if (opts.sort) {
306
365
  column.renderSortNumber = column.sortNumber;
@@ -309,6 +368,18 @@ VxeUI.hooks.add('tableCustomModule', {
309
368
  if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
310
369
  column.visible = column.defaultVisible;
311
370
  }
371
+ if (opts.align) {
372
+ column.align = column.defaultAlign;
373
+ column.renderAlign = column.defaultAlign;
374
+ }
375
+ if (opts.headerAlign) {
376
+ column.headerAlign = column.defaultHeaderAlign;
377
+ column.renderHeaderAlign = column.defaultHeaderAlign;
378
+ }
379
+ if (opts.footerAlign) {
380
+ column.footerAlign = column.defaultFooterAlign;
381
+ column.renderFooterAlign = column.defaultFooterAlign;
382
+ }
312
383
  if (opts.aggFunc) {
313
384
  column.aggFunc = column.defaultAggFunc;
314
385
  column.renderAggFn = column.defaultAggFunc;