vxe-table 4.23.19 → 4.24.0-beta.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 (62) hide show
  1. package/README.md +2 -0
  2. package/dist/all.esm.js +631 -343
  3. package/dist/all.esm.min.js +3 -3
  4. package/dist/style.css +85 -13
  5. package/dist/style.mini.css +1 -1
  6. package/es/components.d.ts +1 -3
  7. package/es/components.js +1 -2
  8. package/es/style.css +85 -13
  9. package/es/style.mini.css +1 -1
  10. package/es/table/module/custom/panel.js +2 -2
  11. package/es/table/module/edit/hook.js +95 -5
  12. package/es/table/src/body.d.ts +2 -2
  13. package/es/table/src/body.js +26 -49
  14. package/es/table/src/table.js +256 -35
  15. package/es/table/style.css +82 -13
  16. package/es/table/style.mini.css +1 -1
  17. package/es/ui/abandon.d.ts +82 -0
  18. package/es/ui/abandon.js +90 -0
  19. package/es/ui/index.d.ts +1 -82
  20. package/es/ui/index.js +6 -91
  21. package/es/ui/src/log.js +1 -1
  22. package/es/vxe-table/style.css +82 -13
  23. package/es/vxe-table/style.mini.css +1 -1
  24. package/lib/components.d.ts +1 -3
  25. package/lib/components.js +1 -2
  26. package/lib/index.umd.js +630 -340
  27. package/lib/index.umd.min.js +3 -3
  28. package/lib/style.css +85 -13
  29. package/lib/style.mini.css +1 -1
  30. package/lib/table/module/custom/panel.js +2 -2
  31. package/lib/table/module/edit/hook.js +95 -5
  32. package/lib/table/src/body.d.ts +2 -2
  33. package/lib/table/src/body.js +26 -49
  34. package/lib/table/src/table.js +256 -35
  35. package/lib/table/style/style.css +82 -13
  36. package/lib/table/style/style.mini.css +1 -1
  37. package/lib/ui/abandon.d.ts +82 -0
  38. package/lib/ui/abandon.js +110 -0
  39. package/lib/ui/index.d.ts +1 -82
  40. package/lib/ui/index.js +7 -91
  41. package/lib/ui/src/log.js +1 -1
  42. package/lib/vxe-table/style/style.css +82 -13
  43. package/lib/vxe-table/style/style.mini.css +1 -1
  44. package/package.json +2 -2
  45. package/packages/components.ts +2 -5
  46. package/packages/table/module/custom/panel.ts +2 -2
  47. package/packages/table/module/edit/hook.ts +95 -5
  48. package/packages/table/src/body.ts +28 -50
  49. package/packages/table/src/table.ts +292 -34
  50. package/packages/ui/abandon.ts +136 -0
  51. package/packages/ui/index.ts +12 -122
  52. package/styles/components/table.scss +141 -87
  53. package/styles/theme/base.scss +3 -0
  54. /package/dist/{iconfont.1794474448348.ttf → iconfont.1794559626301.ttf} +0 -0
  55. /package/dist/{iconfont.1794474448348.woff → iconfont.1794559626301.woff} +0 -0
  56. /package/dist/{iconfont.1794474448348.woff2 → iconfont.1794559626301.woff2} +0 -0
  57. /package/es/{iconfont.1794474448348.ttf → iconfont.1794559626301.ttf} +0 -0
  58. /package/es/{iconfont.1794474448348.woff → iconfont.1794559626301.woff} +0 -0
  59. /package/es/{iconfont.1794474448348.woff2 → iconfont.1794559626301.woff2} +0 -0
  60. /package/lib/{iconfont.1794474448348.ttf → iconfont.1794559626301.ttf} +0 -0
  61. /package/lib/{iconfont.1794474448348.woff → iconfont.1794559626301.woff} +0 -0
  62. /package/lib/{iconfont.1794474448348.woff2 → iconfont.1794559626301.woff2} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "4.23.19",
3
+ "version": "4.24.0-beta.1",
4
4
  "description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -75,7 +75,7 @@
75
75
  "typescript": "~5.9.3",
76
76
  "vue": "3.4.27",
77
77
  "vue-router": "~4.5.1",
78
- "vxe-pc-ui": "4.20.42"
78
+ "vxe-pc-ui": "4.21.0"
79
79
  },
80
80
  "allowScripts": {
81
81
  "esbuild": true,
@@ -28,14 +28,11 @@ if (!VxeUI.hasLanguage('zh-CN')) {
28
28
  }
29
29
  VxeUI.setTheme('light')
30
30
 
31
- // eslint-disable-next-line import/export
32
- export { VxeUI }
33
-
34
- // eslint-disable-next-line import/export
31
+ // 兼容老版本
35
32
  export * from '@vxe-ui/core'
36
33
 
37
34
  // 兼容老版本
38
- export * from './ui'
35
+ export * from './ui/abandon'
39
36
 
40
37
  // Components
41
38
  export * from './table'
@@ -386,8 +386,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
386
386
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0
387
387
 
388
388
  if (prevDragGroupField || prevDragAggFnColid) {
389
- if ($xeTable.handlePivotTableAggPanelDragendEvent) {
390
- $xeTable.handlePivotTableAggPanelDragendEvent(evnt)
389
+ if ($xeTable.handlePivotTableAggPanelDgedEvent) {
390
+ $xeTable.handlePivotTableAggPanelDgedEvent(evnt)
391
391
  }
392
392
  } else if (prevDragCol && dragCol) {
393
393
  // 判断是否有拖动
@@ -116,7 +116,25 @@ hooks.add('tableEditModule', {
116
116
  }
117
117
  pChilds[funcName](item)
118
118
  pMapChilds[funcName](item)
119
- const rest = { row: item, rowid, _seq: -1, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: pChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
119
+ const rest = {
120
+ row: item,
121
+ rowid,
122
+ _seq: -1,
123
+ seq: -1,
124
+ index: -1,
125
+ _index: -1,
126
+ $index: -1,
127
+ treeIndex: -1,
128
+ _tIndex: -1,
129
+ items: pChilds,
130
+ parent: parentRow,
131
+ level: parentLevel + 1,
132
+ linesMask: 0,
133
+ height: 0,
134
+ resizeHeight: 0,
135
+ oTop: 0,
136
+ expandHeight: 0
137
+ }
120
138
  fullDataRowIdData[rowid] = rest
121
139
  fullAllDataRowIdData[rowid] = rest
122
140
  } else {
@@ -125,7 +143,25 @@ hooks.add('tableEditModule', {
125
143
  }
126
144
  afterFullData[funcName](item)
127
145
  tableFullTreeData[funcName](item)
128
- const rest = { row: item, rowid, _seq: -1, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: tableFullTreeData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
146
+ const rest = {
147
+ row: item,
148
+ rowid,
149
+ _seq: -1,
150
+ seq: -1,
151
+ index: -1,
152
+ _index: -1,
153
+ $index: -1,
154
+ treeIndex: -1,
155
+ _tIndex: -1,
156
+ items: tableFullTreeData,
157
+ parent: null,
158
+ level: 0,
159
+ linesMask: 0,
160
+ height: 0,
161
+ resizeHeight: 0,
162
+ oTop: 0,
163
+ expandHeight: 0
164
+ }
129
165
  fullDataRowIdData[rowid] = rest
130
166
  fullAllDataRowIdData[rowid] = rest
131
167
  }
@@ -176,7 +212,25 @@ hooks.add('tableEditModule', {
176
212
  } else {
177
213
  newRecords.forEach((item) => {
178
214
  const rowid = getRowid($xeTable, item)
179
- const rest = { row: item, rowid, _seq: -1, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
215
+ const rest = {
216
+ row: item,
217
+ rowid,
218
+ _seq: -1,
219
+ seq: -1,
220
+ index: -1,
221
+ _index: -1,
222
+ $index: -1,
223
+ treeIndex: -1,
224
+ _tIndex: -1,
225
+ items: afterFullData,
226
+ parent: null,
227
+ level: 0,
228
+ linesMask: 0,
229
+ height: 0,
230
+ resizeHeight: 0,
231
+ oTop: 0,
232
+ expandHeight: 0
233
+ }
180
234
  fullDataRowIdData[rowid] = rest
181
235
  fullAllDataRowIdData[rowid] = rest
182
236
  afterFullData.unshift(item)
@@ -205,7 +259,25 @@ hooks.add('tableEditModule', {
205
259
  } else {
206
260
  newRecords.forEach((item) => {
207
261
  const rowid = getRowid($xeTable, item)
208
- const rest = { row: item, rowid, _seq: -1, seq: -1, index: -1, _index: -1, treeIndex: -1, _tIndex: -1, $index: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
262
+ const rest = {
263
+ row: item,
264
+ rowid,
265
+ _seq: -1,
266
+ seq: -1,
267
+ index: -1,
268
+ _index: -1,
269
+ treeIndex: -1,
270
+ _tIndex: -1,
271
+ $index: -1,
272
+ items: afterFullData,
273
+ parent: null,
274
+ level: 0,
275
+ linesMask: 0,
276
+ height: 0,
277
+ resizeHeight: 0,
278
+ oTop: 0,
279
+ expandHeight: 0
280
+ }
209
281
  fullDataRowIdData[rowid] = rest
210
282
  fullAllDataRowIdData[rowid] = rest
211
283
  afterFullData.push(item)
@@ -245,7 +317,25 @@ hooks.add('tableEditModule', {
245
317
  treeRecords,
246
318
  (item) => {
247
319
  const rowid = getRowid($xeTable, item)
248
- const rest = { row: item, rowid, _seq: -1, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: parentMapChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
320
+ const rest = {
321
+ row: item,
322
+ rowid,
323
+ _seq: -1,
324
+ seq: -1,
325
+ index: -1,
326
+ _index: -1,
327
+ $index: -1,
328
+ treeIndex: -1,
329
+ _tIndex: -1,
330
+ items: parentMapChilds,
331
+ parent: parentRow,
332
+ level: parentLevel + 1,
333
+ linesMask: 0,
334
+ height: 0,
335
+ resizeHeight: 0,
336
+ oTop: 0,
337
+ expandHeight: 0
338
+ }
249
339
  if (item[childrenField]) {
250
340
  item[mapChildrenField] = item[childrenField]
251
341
  }
@@ -1,4 +1,4 @@
1
- import { h, ref, Ref, PropType, inject, nextTick, onMounted, onUnmounted } from 'vue'
1
+ import { h, ref, Ref, PropType, inject, nextTick, onMounted, onUnmounted, VNode } from 'vue'
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import XEUtils from 'xe-utils'
4
4
  import { VxeUI } from '@vxe-ui/core'
@@ -50,7 +50,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
50
50
  computeVirtualXOpts,
51
51
  computeVirtualYOpts,
52
52
  computeIsBodyRenderOptimize,
53
- computeRendererOpts
53
+ computeRendererOpts,
54
+ computeShowTreeLine
54
55
  } = $xeTable.getComputeMaps()
55
56
 
56
57
  const refElem = ref() as Ref<HTMLDivElement>
@@ -70,60 +71,34 @@ export default /* define-vxe-component start */ defineVxeComponent({
70
71
  return !!(isDragResize || (lastSTime && Date.now() < lastSTime + (delayHover as number)))
71
72
  }
72
73
 
73
- const renderLine = (rowid: string, params: VxeTableDefines.CellRenderBodyParams, cellHeight: number): VxeComponentSlotType[] => {
74
+ const renderLine = (rowid: string, params: VxeTableDefines.CellRenderBodyParams): VxeComponentSlotType[] => {
74
75
  const { column } = params
75
76
  const { treeConfig } = tableProps
76
- const cellOpts = computeCellOpts.value
77
- const rowOpts = computeRowOpts.value
78
- const defaultRowHeight = computeDefaultRowHeight.value
79
- const treeOpts = computeTreeOpts.value
80
77
  const { slots, treeNode } = column
81
- const { fullAllDataRowIdData } = tableInternalData
82
- if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
78
+ const lineVNs: VNode[] = []
79
+
80
+ if (treeConfig && treeNode) {
83
81
  if (slots && (slots as any).line) {
84
82
  return $xeTable.callSlot((slots as any).line, params)
85
83
  }
84
+ const treeOpts = computeTreeOpts.value
85
+ const { fullAllDataRowIdData } = tableInternalData
86
+ const { lineType } = treeOpts
86
87
  const rowRest = fullAllDataRowIdData[rowid]
87
- let rLevel = 0
88
- let prevRow = null
89
- let parentRow = null
90
- let lineHeight = ''
91
- if (rowRest) {
92
- rLevel = rowRest.level
93
- prevRow = rowRest.items[rowRest.treeIndex - 1]
94
- parentRow = rowRest.parent
95
- }
96
- if (!rLevel && !treeOpts.showRootLine) {
97
- return []
98
- }
99
- if (prevRow) {
100
- const prevRowRest = fullAllDataRowIdData[getRowid($xeTable, prevRow)] || {}
101
- lineHeight = `${prevRowRest.lineHeight || 0}px`
102
- } else if (rLevel && parentRow) {
103
- const parentRowRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)] || {}
104
- lineHeight = `calc(-1em + ${Math.floor(cellHeight / 2 + getCellRestHeight(parentRowRest, cellOpts, rowOpts, defaultRowHeight) / 2)}px)`
105
- }
106
- return [
107
- h(
108
- 'div',
109
- {
110
- key: 'tl',
111
- class: 'vxe-tree--line-wrapper'
112
- },
113
- [
114
- h('div', {
115
- class: 'vxe-tree--line',
116
- style: {
117
- height: lineHeight,
118
- bottom: `-${Math.floor(cellHeight / 2)}px`,
119
- left: `calc(${rLevel * treeOpts.indent}px + 1em)`
120
- }
88
+ const treeLines = rowRest.treeLines
89
+ if (treeLines) {
90
+ treeLines.forEach((item, i) => {
91
+ lineVNs.push(
92
+ h('span', {
93
+ key: 'le' + i,
94
+ class: ['vxe-tree--line', `type--${lineType || 'solid'}`, item.type],
95
+ style: item.style
121
96
  })
122
- ]
123
- )
124
- ]
97
+ )
98
+ })
99
+ }
125
100
  }
126
- return []
101
+ return lineVNs
127
102
  }
128
103
 
129
104
  /**
@@ -150,6 +125,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
150
125
  const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
151
126
  const { tableData, tableColumn, dragRow, overflowX, overflowY, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps, currColFlag } = tableReactData
152
127
  const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore, keepUpdateFieldMaps, currentCol } = tableInternalData
128
+ const showTreeLine = computeShowTreeLine.value
153
129
  const cellOpts = computeCellOpts.value
154
130
  const validOpts = computeValidOpts.value
155
131
  const checkboxOpts = computeCheckboxOpts.value
@@ -363,6 +339,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
363
339
  }
364
340
  }
365
341
 
342
+ const tdStyle: Record<string, string> = {}
366
343
  const tcStyle: Record<string, string> = {}
367
344
  if (maxHeight) {
368
345
  tcStyle.maxHeight = maxHeight + 'px'
@@ -382,6 +359,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
382
359
  }
383
360
  if (scrollYLoad || scrollXLoad || hasEllipsis || isCsHeight || isRsHeight) {
384
361
  tcStyle.height = cellHeight + 'px'
362
+ tdStyle['--vxe-ui-table-cell-height'] = cellHeight + 'px'
385
363
  } else {
386
364
  tcStyle.minHeight = cellHeight + 'px'
387
365
  }
@@ -407,8 +385,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
407
385
  )
408
386
  } else {
409
387
  // 渲染单元格
410
- if (treeConfig) {
411
- tdVNs.push(...renderLine(rowid, cellParams, cellHeight))
388
+ if (treeConfig && showTreeLine) {
389
+ tdVNs.push(...renderLine(rowid, cellParams))
412
390
  }
413
391
  const clVNs: VxeComponentSlotType[] = []
414
392
  if (!isVNPreEmptyStatus) {
@@ -558,7 +536,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
558
536
  ],
559
537
  key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex,
560
538
  ...tdAttrs,
561
- style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
539
+ style: Object.assign(tdStyle, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
562
540
  ...tdOns
563
541
  },
564
542
  isOptimizeMode && fixedHiddenColumn ? [] : tdVNs