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
@@ -160,38 +160,40 @@ VxeUI.hooks.add('tableCustomModule', {
160
160
  return openCustom()
161
161
  }
162
162
 
163
- const saveCustom = () => {
163
+ const saveCustom = (isDirectly?: boolean) => {
164
164
  const { customColumnList, aggHandleFields, rowGroupList } = reactData
165
165
  const customOpts = computeCustomOpts.value
166
166
  const { allowVisible, allowSort, allowFixed, allowResizable, allowGroup, allowValues } = customOpts
167
- XEUtils.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
168
- if (parentColumn) {
167
+ if (!isDirectly) {
168
+ XEUtils.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
169
+ if (parentColumn) {
169
170
  // 更新子列信息
170
- column.fixed = parentColumn.fixed
171
- } else {
172
- if (allowSort) {
173
- const sortIndex = index + 1
174
- column.renderSortNumber = sortIndex
175
- }
176
- if (allowFixed) {
177
- column.fixed = column.renderFixed
171
+ column.fixed = parentColumn.fixed
172
+ } else {
173
+ if (allowSort) {
174
+ const sortIndex = index + 1
175
+ column.renderSortNumber = sortIndex
176
+ }
177
+ if (allowFixed) {
178
+ column.fixed = column.renderFixed
179
+ }
178
180
  }
179
- }
180
- if (allowResizable) {
181
- if (column.renderVisible && (!column.children || !column.children.length)) {
182
- if (column.renderResizeWidth !== column.renderWidth) {
183
- column.resizeWidth = column.renderResizeWidth
184
- column.renderWidth = column.renderResizeWidth
181
+ if (allowResizable) {
182
+ if (column.renderVisible && (!column.children || !column.children.length)) {
183
+ if (column.renderResizeWidth !== column.renderWidth) {
184
+ column.resizeWidth = column.renderResizeWidth
185
+ column.renderWidth = column.renderResizeWidth
186
+ }
185
187
  }
186
188
  }
187
- }
188
- if (allowVisible) {
189
- column.visible = column.renderVisible
190
- }
191
- if (allowGroup && allowValues) {
192
- column.aggFunc = column.renderAggFn
193
- }
194
- })
189
+ if (allowVisible) {
190
+ column.visible = column.renderVisible
191
+ }
192
+ if (allowGroup && allowValues) {
193
+ column.aggFunc = column.renderAggFn
194
+ }
195
+ })
196
+ }
195
197
  reactData.isCustomStatus = true
196
198
  if (allowGroup && !!$xeTable.handlePivotTableAggData) {
197
199
  if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
@@ -375,10 +377,12 @@ VxeUI.hooks.add('tableCustomModule', {
375
377
  if (customStore.visible) {
376
378
  closeCustom()
377
379
  emitCustomEvent('close', evnt)
380
+ $xeTable.dispatchEvent('custom-close', {}, evnt)
378
381
  } else {
379
382
  customStore.btnEl = evnt.target as HTMLDivElement
380
383
  openCustom()
381
384
  emitCustomEvent('open', evnt)
385
+ $xeTable.dispatchEvent('custom-open', {}, evnt)
382
386
  }
383
387
  },
384
388
  customOpenEvent (evnt) {
@@ -390,6 +394,7 @@ VxeUI.hooks.add('tableCustomModule', {
390
394
  customStore.btnEl = evnt.target as HTMLDivElement
391
395
  $xeTable.openCustom()
392
396
  $xeTable.emitCustomEvent('open', evnt)
397
+ $xeTable.dispatchEvent('custom-open', {}, evnt)
393
398
  }
394
399
  },
395
400
  customCloseEvent (evnt) {
@@ -400,6 +405,7 @@ VxeUI.hooks.add('tableCustomModule', {
400
405
  customStore.activeBtn = false
401
406
  $xeTable.closeCustom()
402
407
  $xeTable.emitCustomEvent('close', evnt)
408
+ $xeTable.dispatchEvent('custom-close', {}, evnt)
403
409
  }
404
410
  },
405
411
  handleUpdateCustomColumn,
@@ -94,26 +94,33 @@ export default defineVxeComponent({
94
94
  $xeTable.saveCustom()
95
95
  $xeTable.closeCustom()
96
96
  $xeTable.emitCustomEvent('confirm', $event)
97
+ $xeTable.dispatchEvent('custom-confirm', {}, $event)
97
98
  $xeTable.emitCustomEvent('close', $event)
99
+ $xeTable.dispatchEvent('custom-close', {}, $event)
98
100
  }
99
101
 
100
102
  const cancelCloseEvent: VxeButtonEvents.Click = ({ $event }) => {
101
103
  $xeTable.closeCustom()
102
104
  $xeTable.emitCustomEvent('close', $event)
105
+ $xeTable.dispatchEvent('custom-close', {}, $event)
103
106
  }
104
107
 
105
108
  const cancelCustomEvent: VxeButtonEvents.Click = ({ $event }) => {
106
109
  $xeTable.cancelCustom()
107
110
  $xeTable.closeCustom()
108
111
  $xeTable.emitCustomEvent('cancel', $event)
112
+ $xeTable.dispatchEvent('custom-cancel', {}, $event)
109
113
  $xeTable.emitCustomEvent('close', $event)
114
+ $xeTable.dispatchEvent('custom-close', {}, $event)
110
115
  }
111
116
 
112
117
  const handleResetCustomEvent = (evnt: Event) => {
113
118
  $xeTable.resetCustom(true)
114
119
  $xeTable.closeCustom()
115
120
  $xeTable.emitCustomEvent('reset', evnt)
121
+ $xeTable.dispatchEvent('custom-reset', {}, evnt)
116
122
  $xeTable.emitCustomEvent('close', evnt)
123
+ $xeTable.dispatchEvent('custom-close', {}, evnt)
117
124
  }
118
125
 
119
126
  const resetCustomEvent: VxeButtonEvents.Click = ({ $event }) => {
@@ -557,7 +557,6 @@ hooks.add('tableEditModule', {
557
557
  return handleInsertRowAt(records, targetRowOrRowid, true)
558
558
  },
559
559
  insertChild (records, parentRowOrParentId) {
560
- (window as any).aa = internalData
561
560
  return handleInsertChildRowAt(records, parentRowOrParentId, null)
562
561
  },
563
562
  insertChildAt (records, parentRowOrParentId, targetRow) {
@@ -1,9 +1,10 @@
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
 
7
+ import type { VxeComponentStyleType } from 'vxe-pc-ui'
7
8
  import type { TableMenuMethods, TableMenuPrivateMethods } from '../../../../types'
8
9
 
9
10
  const { menus, hooks, globalEvents, GLOBAL_EVENT_KEYS } = VxeUI
@@ -31,7 +32,7 @@ hooks.add('tableMenuModule', {
31
32
  const isContentMenu = computeIsContentMenu.value
32
33
  const menuOpts = computeMenuOpts.value
33
34
  const config = menuOpts[type]
34
- const { zIndex, transfer, visibleMethod } = menuOpts
35
+ const { zIndex, transfer, width, visibleMethod } = menuOpts
35
36
  if (config) {
36
37
  const { options, disabled } = config
37
38
  if (disabled) {
@@ -58,17 +59,21 @@ hooks.add('tableMenuModule', {
58
59
 
59
60
  const handleVisible = () => {
60
61
  internalData._currMenuParams = params
62
+ const ctxStyle: VxeComponentStyleType = {
63
+ zIndex: zIndex || internalData.tZindex,
64
+ top: `${top}px`,
65
+ left: `${left}px`
66
+ }
67
+ if (width) {
68
+ ctxStyle['--vxe-ui-table-menu-item-width'] = toCssUnit(width)
69
+ }
61
70
  Object.assign(ctxMenuStore, {
62
71
  visible: true,
63
72
  list: options,
64
73
  selected: null,
65
74
  selectChild: null,
66
75
  showChild: false,
67
- style: {
68
- zIndex: zIndex || internalData.tZindex,
69
- top: `${top}px`,
70
- left: `${left}px`
71
- }
76
+ style: ctxStyle
72
77
  })
73
78
  nextTick(() => {
74
79
  const tableMenu = refTableMenu.value
@@ -86,6 +86,11 @@ export const tableEmits: VxeTableEmits = [
86
86
  'scroll',
87
87
  'scroll-boundary',
88
88
  'custom',
89
+ 'custom-open',
90
+ 'custom-close',
91
+ 'custom-cancel',
92
+ 'custom-reset',
93
+ 'custom-confirm',
89
94
  'custom-visible-change',
90
95
  'custom-visible-all',
91
96
  'custom-fixed-change',
@@ -9328,11 +9328,14 @@ export default defineVxeComponent({
9328
9328
  // 如果为 null 使用默认逻辑
9329
9329
  if (XEUtils.eqNull(customContent)) {
9330
9330
  isShow = isOver
9331
+ content = cellText
9331
9332
  } else if (customContent !== '' && customContent !== false) {
9332
9333
  // 如果为 '' | false 则不显示
9333
9334
  isShow = true
9335
+ content = customContent
9336
+ } else {
9337
+ content = cellText
9334
9338
  }
9335
- content = cellText
9336
9339
  }
9337
9340
  if (isShow && content) {
9338
9341
  const tipContent = formatText(content)
@@ -11480,6 +11483,7 @@ export default defineVxeComponent({
11480
11483
  if (evnt.dataTransfer) {
11481
11484
  evnt.dataTransfer.setDragImage(getTpImg(), 0, 0)
11482
11485
  }
11486
+ $xeTable.closeTooltip()
11483
11487
  },
11484
11488
  handleRowDragSwapEvent (evnt, isSyncRow, dragRow, prevDragRow, prevDragPos, prevDragToChild) {
11485
11489
  const { treeConfig, dragConfig } = props
@@ -12152,6 +12156,7 @@ export default defineVxeComponent({
12152
12156
  if (evnt.dataTransfer) {
12153
12157
  evnt.dataTransfer.setDragImage(getTpImg(), 0, 0)
12154
12158
  }
12159
+ $xeTable.closeTooltip()
12155
12160
  },
12156
12161
  handleColDragSwapColumn () {
12157
12162
  handleUpdateColumn()
@@ -3,9 +3,10 @@
3
3
  --vxe-ui-font-family: -apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
4
4
 
5
5
  /*font size*/
6
+ --vxe-ui-font-size-large: 16px;
6
7
  --vxe-ui-font-size-default: 14px;
7
8
  --vxe-ui-font-size-medium: 14px;
8
- --vxe-ui-font-size-small: 13px;
9
+ --vxe-ui-font-size-small: 12px;
9
10
  --vxe-ui-font-size-mini: 12px;
10
11
 
11
12
  /*base border*/