vxe-table 4.19.20 → 4.19.22

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 (161) hide show
  1. package/dist/all.esm.js +71 -36
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/locale/lang/ar-EG.js +8 -0
  7. package/es/locale/lang/de-DE.js +8 -0
  8. package/es/locale/lang/en-US.js +9 -1
  9. package/es/locale/lang/es-ES.js +8 -0
  10. package/es/locale/lang/fr-FR.js +8 -0
  11. package/es/locale/lang/hu-HU.js +8 -0
  12. package/es/locale/lang/hy-AM.js +8 -0
  13. package/es/locale/lang/id-ID.js +8 -0
  14. package/es/locale/lang/it-IT.js +8 -0
  15. package/es/locale/lang/ja-JP.js +8 -0
  16. package/es/locale/lang/ko-KR.js +8 -0
  17. package/es/locale/lang/ms-MY.js +8 -0
  18. package/es/locale/lang/nb-NO.js +8 -0
  19. package/es/locale/lang/pt-BR.js +8 -0
  20. package/es/locale/lang/ru-RU.js +8 -0
  21. package/es/locale/lang/th-TH.js +8 -0
  22. package/es/locale/lang/ug-CN.js +8 -0
  23. package/es/locale/lang/uk-UA.js +8 -0
  24. package/es/locale/lang/uz-UZ.js +8 -0
  25. package/es/locale/lang/vi-VN.js +8 -0
  26. package/es/locale/lang/zh-CHT.js +8 -0
  27. package/es/locale/lang/zh-CN.js +8 -0
  28. package/es/style.css +1 -1
  29. package/es/style.min.css +1 -1
  30. package/es/table/module/custom/hook.js +32 -26
  31. package/es/table/module/custom/panel.js +7 -0
  32. package/es/table/module/edit/hook.js +0 -1
  33. package/es/table/module/menu/hook.js +11 -7
  34. package/es/table/src/emits.js +5 -0
  35. package/es/table/src/table.js +7 -1
  36. package/es/ui/index.js +1 -1
  37. package/es/ui/src/log.js +1 -1
  38. package/lib/index.css +1 -1
  39. package/lib/index.min.css +1 -1
  40. package/lib/index.umd.js +64 -39
  41. package/lib/index.umd.min.js +1 -1
  42. package/lib/locale/lang/ar-EG.js +8 -0
  43. package/lib/locale/lang/ar-EG.min.js +1 -1
  44. package/lib/locale/lang/ar-EG.umd.js +8 -0
  45. package/lib/locale/lang/de-DE.js +8 -0
  46. package/lib/locale/lang/de-DE.min.js +1 -1
  47. package/lib/locale/lang/de-DE.umd.js +8 -0
  48. package/lib/locale/lang/en-US.js +9 -1
  49. package/lib/locale/lang/en-US.min.js +1 -1
  50. package/lib/locale/lang/en-US.umd.js +9 -1
  51. package/lib/locale/lang/es-ES.js +8 -0
  52. package/lib/locale/lang/es-ES.min.js +1 -1
  53. package/lib/locale/lang/es-ES.umd.js +8 -0
  54. package/lib/locale/lang/fr-FR.js +8 -0
  55. package/lib/locale/lang/fr-FR.min.js +1 -1
  56. package/lib/locale/lang/fr-FR.umd.js +8 -0
  57. package/lib/locale/lang/hu-HU.js +8 -0
  58. package/lib/locale/lang/hu-HU.min.js +1 -1
  59. package/lib/locale/lang/hu-HU.umd.js +8 -0
  60. package/lib/locale/lang/hy-AM.js +8 -0
  61. package/lib/locale/lang/hy-AM.min.js +1 -1
  62. package/lib/locale/lang/hy-AM.umd.js +8 -0
  63. package/lib/locale/lang/id-ID.js +8 -0
  64. package/lib/locale/lang/id-ID.min.js +1 -1
  65. package/lib/locale/lang/id-ID.umd.js +8 -0
  66. package/lib/locale/lang/it-IT.js +8 -0
  67. package/lib/locale/lang/it-IT.min.js +1 -1
  68. package/lib/locale/lang/it-IT.umd.js +8 -0
  69. package/lib/locale/lang/ja-JP.js +8 -0
  70. package/lib/locale/lang/ja-JP.min.js +1 -1
  71. package/lib/locale/lang/ja-JP.umd.js +8 -0
  72. package/lib/locale/lang/ko-KR.js +8 -0
  73. package/lib/locale/lang/ko-KR.min.js +1 -1
  74. package/lib/locale/lang/ko-KR.umd.js +8 -0
  75. package/lib/locale/lang/ms-MY.js +8 -0
  76. package/lib/locale/lang/ms-MY.min.js +1 -1
  77. package/lib/locale/lang/ms-MY.umd.js +8 -0
  78. package/lib/locale/lang/nb-NO.js +8 -0
  79. package/lib/locale/lang/nb-NO.min.js +1 -1
  80. package/lib/locale/lang/nb-NO.umd.js +8 -0
  81. package/lib/locale/lang/pt-BR.js +8 -0
  82. package/lib/locale/lang/pt-BR.min.js +1 -1
  83. package/lib/locale/lang/pt-BR.umd.js +8 -0
  84. package/lib/locale/lang/ru-RU.js +8 -0
  85. package/lib/locale/lang/ru-RU.min.js +1 -1
  86. package/lib/locale/lang/ru-RU.umd.js +8 -0
  87. package/lib/locale/lang/th-TH.js +8 -0
  88. package/lib/locale/lang/th-TH.min.js +1 -1
  89. package/lib/locale/lang/th-TH.umd.js +8 -0
  90. package/lib/locale/lang/ug-CN.js +8 -0
  91. package/lib/locale/lang/ug-CN.min.js +1 -1
  92. package/lib/locale/lang/ug-CN.umd.js +8 -0
  93. package/lib/locale/lang/uk-UA.js +8 -0
  94. package/lib/locale/lang/uk-UA.min.js +1 -1
  95. package/lib/locale/lang/uk-UA.umd.js +8 -0
  96. package/lib/locale/lang/uz-UZ.js +8 -0
  97. package/lib/locale/lang/uz-UZ.min.js +1 -1
  98. package/lib/locale/lang/uz-UZ.umd.js +8 -0
  99. package/lib/locale/lang/vi-VN.js +8 -0
  100. package/lib/locale/lang/vi-VN.min.js +1 -1
  101. package/lib/locale/lang/vi-VN.umd.js +8 -0
  102. package/lib/locale/lang/zh-CHT.js +8 -0
  103. package/lib/locale/lang/zh-CHT.min.js +1 -1
  104. package/lib/locale/lang/zh-CHT.umd.js +8 -0
  105. package/lib/locale/lang/zh-CN.js +8 -0
  106. package/lib/locale/lang/zh-CN.min.js +1 -1
  107. package/lib/locale/lang/zh-CN.umd.js +8 -0
  108. package/lib/style.css +1 -1
  109. package/lib/style.min.css +1 -1
  110. package/lib/table/module/custom/hook.js +32 -26
  111. package/lib/table/module/custom/hook.min.js +1 -1
  112. package/lib/table/module/custom/panel.js +7 -0
  113. package/lib/table/module/custom/panel.min.js +1 -1
  114. package/lib/table/module/edit/hook.js +0 -1
  115. package/lib/table/module/edit/hook.min.js +1 -1
  116. package/lib/table/module/menu/hook.js +10 -5
  117. package/lib/table/module/menu/hook.min.js +1 -1
  118. package/lib/table/src/emits.js +1 -1
  119. package/lib/table/src/emits.min.js +1 -1
  120. package/lib/table/src/table.js +4 -4
  121. package/lib/table/src/table.min.js +1 -1
  122. package/lib/ui/index.js +1 -1
  123. package/lib/ui/index.min.js +1 -1
  124. package/lib/ui/src/log.js +1 -1
  125. package/lib/ui/src/log.min.js +1 -1
  126. package/package.json +2 -2
  127. package/packages/locale/lang/ar-EG.ts +8 -0
  128. package/packages/locale/lang/de-DE.ts +8 -0
  129. package/packages/locale/lang/en-US.ts +9 -1
  130. package/packages/locale/lang/es-ES.ts +8 -0
  131. package/packages/locale/lang/fr-FR.ts +8 -0
  132. package/packages/locale/lang/hu-HU.ts +8 -0
  133. package/packages/locale/lang/hy-AM.ts +8 -0
  134. package/packages/locale/lang/id-ID.ts +8 -0
  135. package/packages/locale/lang/it-IT.ts +8 -0
  136. package/packages/locale/lang/ja-JP.ts +8 -0
  137. package/packages/locale/lang/ko-KR.ts +8 -0
  138. package/packages/locale/lang/ms-MY.ts +8 -0
  139. package/packages/locale/lang/nb-NO.ts +8 -0
  140. package/packages/locale/lang/pt-BR.ts +8 -0
  141. package/packages/locale/lang/ru-RU.ts +8 -0
  142. package/packages/locale/lang/th-TH.ts +8 -0
  143. package/packages/locale/lang/ug-CN.ts +8 -0
  144. package/packages/locale/lang/uk-UA.ts +8 -0
  145. package/packages/locale/lang/uz-UZ.ts +8 -0
  146. package/packages/locale/lang/vi-VN.ts +8 -0
  147. package/packages/locale/lang/zh-CHT.ts +8 -0
  148. package/packages/locale/lang/zh-CN.ts +8 -0
  149. package/packages/table/module/custom/hook.ts +31 -25
  150. package/packages/table/module/custom/panel.ts +7 -0
  151. package/packages/table/module/edit/hook.ts +0 -1
  152. package/packages/table/module/menu/hook.ts +12 -7
  153. package/packages/table/src/emits.ts +5 -0
  154. package/packages/table/src/table.ts +6 -1
  155. package/styles/theme/base.scss +2 -1
  156. /package/es/{iconfont.1782439515438.ttf → iconfont.1782890314097.ttf} +0 -0
  157. /package/es/{iconfont.1782439515438.woff → iconfont.1782890314097.woff} +0 -0
  158. /package/es/{iconfont.1782439515438.woff2 → iconfont.1782890314097.woff2} +0 -0
  159. /package/lib/{iconfont.1782439515438.ttf → iconfont.1782890314097.ttf} +0 -0
  160. /package/lib/{iconfont.1782439515438.woff → iconfont.1782890314097.woff} +0 -0
  161. /package/lib/{iconfont.1782439515438.woff2 → iconfont.1782890314097.woff2} +0 -0
@@ -151,39 +151,41 @@ VxeUI.hooks.add('tableCustomModule', {
151
151
  }
152
152
  return openCustom();
153
153
  };
154
- const saveCustom = () => {
154
+ const saveCustom = (isDirectly) => {
155
155
  const { customColumnList, aggHandleFields, rowGroupList } = reactData;
156
156
  const customOpts = computeCustomOpts.value;
157
157
  const { allowVisible, allowSort, allowFixed, allowResizable, allowGroup, allowValues } = customOpts;
158
- XEUtils.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
159
- if (parentColumn) {
160
- // 更新子列信息
161
- column.fixed = parentColumn.fixed;
162
- }
163
- else {
164
- if (allowSort) {
165
- const sortIndex = index + 1;
166
- column.renderSortNumber = sortIndex;
158
+ if (!isDirectly) {
159
+ XEUtils.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
160
+ if (parentColumn) {
161
+ // 更新子列信息
162
+ column.fixed = parentColumn.fixed;
167
163
  }
168
- if (allowFixed) {
169
- column.fixed = column.renderFixed;
164
+ else {
165
+ if (allowSort) {
166
+ const sortIndex = index + 1;
167
+ column.renderSortNumber = sortIndex;
168
+ }
169
+ if (allowFixed) {
170
+ column.fixed = column.renderFixed;
171
+ }
170
172
  }
171
- }
172
- if (allowResizable) {
173
- if (column.renderVisible && (!column.children || !column.children.length)) {
174
- if (column.renderResizeWidth !== column.renderWidth) {
175
- column.resizeWidth = column.renderResizeWidth;
176
- column.renderWidth = column.renderResizeWidth;
173
+ if (allowResizable) {
174
+ if (column.renderVisible && (!column.children || !column.children.length)) {
175
+ if (column.renderResizeWidth !== column.renderWidth) {
176
+ column.resizeWidth = column.renderResizeWidth;
177
+ column.renderWidth = column.renderResizeWidth;
178
+ }
177
179
  }
178
180
  }
179
- }
180
- if (allowVisible) {
181
- column.visible = column.renderVisible;
182
- }
183
- if (allowGroup && allowValues) {
184
- column.aggFunc = column.renderAggFn;
185
- }
186
- });
181
+ if (allowVisible) {
182
+ column.visible = column.renderVisible;
183
+ }
184
+ if (allowGroup && allowValues) {
185
+ column.aggFunc = column.renderAggFn;
186
+ }
187
+ });
188
+ }
187
189
  reactData.isCustomStatus = true;
188
190
  if (allowGroup && !!$xeTable.handlePivotTableAggData) {
189
191
  if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
@@ -365,11 +367,13 @@ VxeUI.hooks.add('tableCustomModule', {
365
367
  if (customStore.visible) {
366
368
  closeCustom();
367
369
  emitCustomEvent('close', evnt);
370
+ $xeTable.dispatchEvent('custom-close', {}, evnt);
368
371
  }
369
372
  else {
370
373
  customStore.btnEl = evnt.target;
371
374
  openCustom();
372
375
  emitCustomEvent('open', evnt);
376
+ $xeTable.dispatchEvent('custom-open', {}, evnt);
373
377
  }
374
378
  },
375
379
  customOpenEvent(evnt) {
@@ -380,6 +384,7 @@ VxeUI.hooks.add('tableCustomModule', {
380
384
  customStore.btnEl = evnt.target;
381
385
  $xeTable.openCustom();
382
386
  $xeTable.emitCustomEvent('open', evnt);
387
+ $xeTable.dispatchEvent('custom-open', {}, evnt);
383
388
  }
384
389
  },
385
390
  customCloseEvent(evnt) {
@@ -389,6 +394,7 @@ VxeUI.hooks.add('tableCustomModule', {
389
394
  customStore.activeBtn = false;
390
395
  $xeTable.closeCustom();
391
396
  $xeTable.emitCustomEvent('close', evnt);
397
+ $xeTable.dispatchEvent('custom-close', {}, evnt);
392
398
  }
393
399
  },
394
400
  handleUpdateCustomColumn,
@@ -75,23 +75,30 @@ export default defineVxeComponent({
75
75
  $xeTable.saveCustom();
76
76
  $xeTable.closeCustom();
77
77
  $xeTable.emitCustomEvent('confirm', $event);
78
+ $xeTable.dispatchEvent('custom-confirm', {}, $event);
78
79
  $xeTable.emitCustomEvent('close', $event);
80
+ $xeTable.dispatchEvent('custom-close', {}, $event);
79
81
  };
80
82
  const cancelCloseEvent = ({ $event }) => {
81
83
  $xeTable.closeCustom();
82
84
  $xeTable.emitCustomEvent('close', $event);
85
+ $xeTable.dispatchEvent('custom-close', {}, $event);
83
86
  };
84
87
  const cancelCustomEvent = ({ $event }) => {
85
88
  $xeTable.cancelCustom();
86
89
  $xeTable.closeCustom();
87
90
  $xeTable.emitCustomEvent('cancel', $event);
91
+ $xeTable.dispatchEvent('custom-cancel', {}, $event);
88
92
  $xeTable.emitCustomEvent('close', $event);
93
+ $xeTable.dispatchEvent('custom-close', {}, $event);
89
94
  };
90
95
  const handleResetCustomEvent = (evnt) => {
91
96
  $xeTable.resetCustom(true);
92
97
  $xeTable.closeCustom();
93
98
  $xeTable.emitCustomEvent('reset', evnt);
99
+ $xeTable.dispatchEvent('custom-reset', {}, evnt);
94
100
  $xeTable.emitCustomEvent('close', evnt);
101
+ $xeTable.dispatchEvent('custom-close', {}, evnt);
95
102
  };
96
103
  const resetCustomEvent = ({ $event }) => {
97
104
  if (VxeUI.modal) {
@@ -544,7 +544,6 @@ hooks.add('tableEditModule', {
544
544
  return handleInsertRowAt(records, targetRowOrRowid, true);
545
545
  },
546
546
  insertChild(records, parentRowOrParentId) {
547
- window.aa = internalData;
548
547
  return handleInsertChildRowAt(records, parentRowOrParentId, null);
549
548
  },
550
549
  insertChildAt(records, parentRowOrParentId, targetRow) {
@@ -1,7 +1,7 @@
1
1
  import { nextTick } from 'vue';
2
2
  import XEUtils from 'xe-utils';
3
3
  import { VxeUI } from '../../../ui';
4
- import { getDomNode, getAbsolutePos, getEventTargetNode } from '../../../ui/src/dom';
4
+ import { getDomNode, getAbsolutePos, getEventTargetNode, toCssUnit } from '../../../ui/src/dom';
5
5
  import { isEnableConf, hasChildrenList } from '../../../ui/src/utils';
6
6
  const { menus, hooks, globalEvents, GLOBAL_EVENT_KEYS } = VxeUI;
7
7
  const tableMenuMethodKeys = ['closeMenu'];
@@ -23,7 +23,7 @@ hooks.add('tableMenuModule', {
23
23
  const isContentMenu = computeIsContentMenu.value;
24
24
  const menuOpts = computeMenuOpts.value;
25
25
  const config = menuOpts[type];
26
- const { zIndex, transfer, visibleMethod } = menuOpts;
26
+ const { zIndex, transfer, width, visibleMethod } = menuOpts;
27
27
  if (config) {
28
28
  const { options, disabled } = config;
29
29
  if (disabled) {
@@ -49,17 +49,21 @@ hooks.add('tableMenuModule', {
49
49
  }
50
50
  const handleVisible = () => {
51
51
  internalData._currMenuParams = params;
52
+ const ctxStyle = {
53
+ zIndex: zIndex || internalData.tZindex,
54
+ top: `${top}px`,
55
+ left: `${left}px`
56
+ };
57
+ if (width) {
58
+ ctxStyle['--vxe-ui-table-menu-item-width'] = toCssUnit(width);
59
+ }
52
60
  Object.assign(ctxMenuStore, {
53
61
  visible: true,
54
62
  list: options,
55
63
  selected: null,
56
64
  selectChild: null,
57
65
  showChild: false,
58
- style: {
59
- zIndex: zIndex || internalData.tZindex,
60
- top: `${top}px`,
61
- left: `${left}px`
62
- }
66
+ style: ctxStyle
63
67
  });
64
68
  nextTick(() => {
65
69
  const tableMenu = refTableMenu.value;
@@ -74,6 +74,11 @@ export const tableEmits = [
74
74
  'scroll',
75
75
  'scroll-boundary',
76
76
  'custom',
77
+ 'custom-open',
78
+ 'custom-close',
79
+ 'custom-cancel',
80
+ 'custom-reset',
81
+ 'custom-confirm',
77
82
  'custom-visible-change',
78
83
  'custom-visible-all',
79
84
  'custom-fixed-change',
@@ -9166,12 +9166,16 @@ export default defineVxeComponent({
9166
9166
  // 如果为 null 使用默认逻辑
9167
9167
  if (XEUtils.eqNull(customContent)) {
9168
9168
  isShow = isOver;
9169
+ content = cellText;
9169
9170
  }
9170
9171
  else if (customContent !== '' && customContent !== false) {
9171
9172
  // 如果为 '' | false 则不显示
9172
9173
  isShow = true;
9174
+ content = customContent;
9175
+ }
9176
+ else {
9177
+ content = cellText;
9173
9178
  }
9174
- content = cellText;
9175
9179
  }
9176
9180
  if (isShow && content) {
9177
9181
  const tipContent = formatText(content);
@@ -11338,6 +11342,7 @@ export default defineVxeComponent({
11338
11342
  if (evnt.dataTransfer) {
11339
11343
  evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
11340
11344
  }
11345
+ $xeTable.closeTooltip();
11341
11346
  },
11342
11347
  handleRowDragSwapEvent(evnt, isSyncRow, dragRow, prevDragRow, prevDragPos, prevDragToChild) {
11343
11348
  const { treeConfig, dragConfig } = props;
@@ -12002,6 +12007,7 @@ export default defineVxeComponent({
12002
12007
  if (evnt.dataTransfer) {
12003
12008
  evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
12004
12009
  }
12010
+ $xeTable.closeTooltip();
12005
12011
  },
12006
12012
  handleColDragSwapColumn() {
12007
12013
  handleUpdateColumn();
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "4.19.20";
3
+ export const version = "4.19.22";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const tableVersion = `table v${"4.19.20"}`;
3
+ const tableVersion = `table v${"4.19.22"}`;
4
4
  export function createComponentLog(name) {
5
5
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
6
6
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';