vxe-table 3.16.0-beta.0 → 3.16.0-beta.2

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 (78) hide show
  1. package/es/grid/src/grid.js +864 -690
  2. package/es/index.css +1 -1
  3. package/es/index.min.css +1 -1
  4. package/es/style.css +1 -1
  5. package/es/style.min.css +1 -1
  6. package/es/table/module/custom/mixin.js +0 -4
  7. package/es/table/module/custom/panel.js +0 -1
  8. package/es/table/module/keyboard/mixin.js +2 -2
  9. package/es/table/src/anime.js +46 -0
  10. package/es/table/src/body.js +15 -40
  11. package/es/table/src/columnInfo.js +6 -1
  12. package/es/table/src/footer.js +1 -19
  13. package/es/table/src/header.js +1 -19
  14. package/es/table/src/methods.js +532 -346
  15. package/es/table/src/table.js +22 -3
  16. package/es/table/style.css +8 -8
  17. package/es/table/style.min.css +1 -1
  18. package/es/ui/index.js +3 -2
  19. package/es/ui/src/log.js +1 -1
  20. package/es/vxe-table/style.css +8 -8
  21. package/es/vxe-table/style.min.css +1 -1
  22. package/lib/grid/src/grid.js +969 -808
  23. package/lib/grid/src/grid.min.js +1 -1
  24. package/lib/index.css +1 -1
  25. package/lib/index.min.css +1 -1
  26. package/lib/index.umd.js +1595 -1245
  27. package/lib/index.umd.min.js +1 -1
  28. package/lib/style.css +1 -1
  29. package/lib/style.min.css +1 -1
  30. package/lib/table/module/custom/mixin.js +0 -4
  31. package/lib/table/module/custom/mixin.min.js +1 -1
  32. package/lib/table/module/custom/panel.js +0 -1
  33. package/lib/table/module/custom/panel.min.js +1 -1
  34. package/lib/table/module/keyboard/mixin.js +2 -2
  35. package/lib/table/module/keyboard/mixin.min.js +1 -1
  36. package/lib/table/src/anime.js +56 -0
  37. package/lib/table/src/anime.min.js +1 -0
  38. package/lib/table/src/body.js +3 -28
  39. package/lib/table/src/body.min.js +1 -1
  40. package/lib/table/src/columnInfo.js +6 -1
  41. package/lib/table/src/columnInfo.min.js +1 -1
  42. package/lib/table/src/footer.js +1 -19
  43. package/lib/table/src/footer.min.js +1 -1
  44. package/lib/table/src/header.js +1 -19
  45. package/lib/table/src/header.min.js +1 -1
  46. package/lib/table/src/methods.js +539 -355
  47. package/lib/table/src/methods.min.js +1 -1
  48. package/lib/table/src/table.js +22 -2
  49. package/lib/table/src/table.min.js +1 -1
  50. package/lib/table/style/style.css +8 -8
  51. package/lib/table/style/style.min.css +1 -1
  52. package/lib/ui/index.js +3 -2
  53. package/lib/ui/index.min.js +1 -1
  54. package/lib/ui/src/log.js +1 -1
  55. package/lib/ui/src/log.min.js +1 -1
  56. package/lib/vxe-table/style/style.css +8 -8
  57. package/lib/vxe-table/style/style.min.css +1 -1
  58. package/package.json +1 -1
  59. package/packages/grid/src/grid.ts +1005 -777
  60. package/packages/table/module/custom/mixin.ts +0 -4
  61. package/packages/table/module/custom/panel.ts +0 -1
  62. package/packages/table/module/keyboard/mixin.ts +2 -2
  63. package/packages/table/src/anime.ts +52 -0
  64. package/packages/table/src/body.ts +15 -40
  65. package/packages/table/src/columnInfo.ts +6 -1
  66. package/packages/table/src/footer.ts +1 -19
  67. package/packages/table/src/header.ts +1 -20
  68. package/packages/table/src/methods.ts +554 -360
  69. package/packages/table/src/props.ts +4 -4
  70. package/packages/table/src/table.ts +22 -3
  71. package/packages/ui/index.ts +2 -1
  72. package/styles/components/table.scss +9 -9
  73. /package/es/{iconfont.1750770351840.ttf → iconfont.1751194972120.ttf} +0 -0
  74. /package/es/{iconfont.1750770351840.woff → iconfont.1751194972120.woff} +0 -0
  75. /package/es/{iconfont.1750770351840.woff2 → iconfont.1751194972120.woff2} +0 -0
  76. /package/lib/{iconfont.1750770351840.ttf → iconfont.1751194972120.ttf} +0 -0
  77. /package/lib/{iconfont.1750770351840.woff → iconfont.1751194972120.woff} +0 -0
  78. /package/lib/{iconfont.1750770351840.woff2 → iconfont.1751194972120.woff2} +0 -0
@@ -96,10 +96,6 @@ export default {
96
96
  }
97
97
  })
98
98
  reactData.isCustomStatus = true
99
- reactData.isDragColMove = true
100
- setTimeout(() => {
101
- reactData.isDragColMove = false
102
- }, 1000)
103
99
  return $xeTable.saveCustomStore('confirm').then(() => {
104
100
  if (allowGroup && allowValues && ($xeTable as any).handlePivotTableAggregateData) {
105
101
  if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
@@ -1358,7 +1358,6 @@ export default {
1358
1358
  customColumnList.splice(nafIndex + dragOffsetIndex, 0, dragColumn)
1359
1359
  }
1360
1360
 
1361
- tableReactData.isDragColMove = true
1362
1361
  if (mouseConfig) {
1363
1362
  if ($xeTable.clearSelected) {
1364
1363
  $xeTable.clearSelected()
@@ -346,8 +346,8 @@ export default {
346
346
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
347
347
 
348
348
  const { editConfig, editOpts, handleSelected, checkboxConfig, checkboxOpts, mouseConfig, mouseOpts } = this
349
- if (mouseConfig && mouseOpts.area && $xeTable.triggerCellAreaMousedownEvent) {
350
- return $xeTable.triggerCellAreaMousedownEvent(evnt, params)
349
+ if (mouseConfig && mouseOpts.area && $xeTable.triggerCellAreaMousednEvent) {
350
+ return $xeTable.triggerCellAreaMousednEvent(evnt, params)
351
351
  } else {
352
352
  if (checkboxConfig && checkboxOpts.range) {
353
353
  this.handleCheckboxRangeEvent(evnt, params)
@@ -0,0 +1,52 @@
1
+
2
+ import XEUtils from 'xe-utils'
3
+ import { addClass, removeClass } from '../../ui/src/dom'
4
+
5
+ const rowMoveCls = 'row--drag-move'
6
+ const colMoveClass = 'col--drag-move'
7
+
8
+ /**
9
+ * 上下拖拽
10
+ */
11
+ export function moveRowAnimateToTb (elemList: NodeListOf<HTMLElement> | HTMLDivElement[], offsetTop: number) {
12
+ XEUtils.arrayEach(elemList, trEl => {
13
+ trEl.style.transform = `translateY(${offsetTop}px)`
14
+ })
15
+ requestAnimationFrame(() => {
16
+ XEUtils.arrayEach(elemList, trEl => {
17
+ addClass(trEl, rowMoveCls)
18
+ trEl.style.transform = ''
19
+ })
20
+ })
21
+ }
22
+
23
+ export function clearRowAnimate (elem: HTMLElement | undefined) {
24
+ setTimeout(() => {
25
+ if (elem) {
26
+ XEUtils.arrayEach(elem.querySelectorAll(`.vxe-body--row.${rowMoveCls}`), elem => removeClass(elem, rowMoveCls))
27
+ }
28
+ }, 500)
29
+ }
30
+
31
+ /**
32
+ * 左右拖拽
33
+ */
34
+ export function moveColAnimateToLr (elemList: NodeListOf<HTMLElement> | HTMLDivElement[], offsetLeft: number) {
35
+ XEUtils.arrayEach(elemList, trEl => {
36
+ trEl.style.transform = `translateX(${offsetLeft}px)`
37
+ })
38
+ requestAnimationFrame(() => {
39
+ XEUtils.arrayEach(elemList, trEl => {
40
+ addClass(trEl, colMoveClass)
41
+ trEl.style.transform = ''
42
+ })
43
+ })
44
+ }
45
+
46
+ export function clearColAnimate (elem: HTMLElement | undefined) {
47
+ setTimeout(() => {
48
+ if (elem) {
49
+ XEUtils.arrayEach(elem.querySelectorAll(`.vxe-table--column.${colMoveClass}`), elem => removeClass(elem, colMoveClass))
50
+ }
51
+ }, 500)
52
+ }
@@ -425,7 +425,7 @@ function renderTdColumn (
425
425
 
426
426
  return h('td', {
427
427
  class: [
428
- 'vxe-body--column',
428
+ 'vxe-table--column vxe-body--column',
429
429
  colid,
430
430
  cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '',
431
431
  cellAlign ? `col--${cellAlign}` : '',
@@ -469,7 +469,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
469
469
  const $xeGrid = $xeTable.$xeGrid
470
470
 
471
471
  const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
472
- const { hasFixedColumn, treeExpandedFlag, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, isDragColMove, rowExpandHeightFlag, isRowGroupStatus } = tableReactData
472
+ const { hasFixedColumn, treeExpandedFlag, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData
473
473
  const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData
474
474
  const checkboxOpts = $xeTable.computeCheckboxOpts
475
475
  const radioOpts = $xeTable.computeRadioOpts
@@ -477,7 +477,6 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
477
477
  const editOpts = $xeTable.computeEditOpts
478
478
  const rowOpts = $xeTable.computeRowOpts
479
479
  const columnOpts = $xeTable.computeColumnOpts
480
- const columnDragOpts = $xeTable.computeColumnDragOpts
481
480
  const { transform, seqMode } = treeOpts
482
481
  const childrenField = treeOpts.children || treeOpts.childrenField
483
482
  const rows: any[] = []
@@ -558,29 +557,15 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
558
557
  return renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
559
558
  })
560
559
  rows.push(
561
- !isColLoading && (columnOpts.drag && columnDragOpts.animation)
562
- ? h('transition-group', {
563
- props: {
564
- tag: 'tr',
565
- name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`
566
- },
567
- class: trClass,
568
- attrs: {
569
- rowid
570
- },
571
- style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) as VxeComponentStyleType : undefined,
572
- key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
573
- nativeOn: trOn
574
- }, tdVNs)
575
- : h('tr', {
576
- class: trClass,
577
- attrs: {
578
- rowid
579
- },
580
- style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) as VxeComponentStyleType : undefined,
581
- key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
582
- on: trOn
583
- }, tdVNs)
560
+ h('tr', {
561
+ class: trClass,
562
+ attrs: {
563
+ rowid
564
+ },
565
+ style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) as VxeComponentStyleType : undefined,
566
+ key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
567
+ on: trOn
568
+ }, tdVNs)
584
569
  )
585
570
  // 如果行被展开了
586
571
  if (isExpandRow) {
@@ -744,12 +729,10 @@ export default {
744
729
  const { fixedColumn, fixedType, tableColumn } = props
745
730
 
746
731
  const { spanMethod, footerSpanMethod, mouseConfig } = tableProps
747
- const { isGroup, tableData, isRowLoading, isColLoading, overflowX, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData
732
+ const { isGroup, tableData, isColLoading, overflowX, scrollXLoad, scrollYLoad, isAllOverflow, expandColumn, dragRow, dragCol } = tableReactData
748
733
  const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData
749
- const rowOpts = $xeTable.computeRowOpts
750
734
  const emptyOpts = $xeTable.computeEmptyOpts
751
735
  const mouseOpts = $xeTable.computeMouseOpts
752
- const rowDragOpts = $xeTable.computeRowDragOpts
753
736
  const expandOpts = $xeTable.computeExpandOpts
754
737
 
755
738
  let renderDataList = tableData
@@ -895,17 +878,9 @@ export default {
895
878
  /**
896
879
  * 内容
897
880
  */
898
- !(isRowLoading || isColLoading) && (rowOpts.drag && rowDragOpts.animation)
899
- ? h('transition-group', {
900
- ref: 'refBodyTBody',
901
- props: {
902
- tag: 'tbody',
903
- name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`
904
- }
905
- }, renderRows(h, this, fixedType, isOptimizeMode, renderDataList, renderColumnList))
906
- : h('tbody', {
907
- ref: 'refBodyTBody'
908
- }, renderRows(h, this, fixedType, isOptimizeMode, renderDataList, renderColumnList))
881
+ h('tbody', {
882
+ ref: 'refBodyTBody'
883
+ }, renderRows(h, this, fixedType, isOptimizeMode, renderDataList, renderColumnList))
909
884
  ]),
910
885
  h('div', {
911
886
  class: 'vxe-table--checkbox-range'
@@ -14,7 +14,7 @@ export class ColumnInfo {
14
14
  const tableProps = $xeTable
15
15
  const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor & GridPrivateMethods
16
16
 
17
- const proxyOpts = $xeGrid ? $xeGrid.proxyOpts : null
17
+ const proxyOpts = $xeGrid ? $xeGrid.computeProxyOpts : null
18
18
  const formatter = _vm.formatter
19
19
  const visible = XEUtils.isBoolean(_vm.visible) ? _vm.visible : true
20
20
 
@@ -53,6 +53,11 @@ export class ColumnInfo {
53
53
  }
54
54
  }
55
55
  }
56
+ if (_vm.aggFunc) {
57
+ if (!$xeTable.handlePivotTableAggregateData && _vm.aggFunc !== true) {
58
+ errLog('vxe.error.errProp', [`column.agg-func=${_vm.aggFunc}`, 'column.agg-func=true'])
59
+ }
60
+ }
56
61
 
57
62
  Object.assign(this, {
58
63
  // 基本属性
@@ -145,7 +145,7 @@ function renderRows (h: CreateElement, _vm: any, isOptimizeMode: boolean, tableC
145
145
  }
146
146
 
147
147
  return h('td', {
148
- class: ['vxe-footer--column', column.id, {
148
+ class: ['vxe-table--column vxe-footer--column', column.id, {
149
149
  [`col--${footAlign}`]: footAlign,
150
150
  [`col--${type}`]: type,
151
151
  'col--last': isLastColumn,
@@ -199,33 +199,15 @@ function renderHeads (h: CreateElement, _vm: any, isOptimizeMode: boolean, rende
199
199
  const props = _vm
200
200
  const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
201
201
  const tableProps = $xeTable
202
- const tableReactData = $xeTable as unknown as TableReactData
203
202
 
204
203
  const { fixedType, footerTableData } = props
205
204
 
206
205
  const { footerRowClassName, footerRowStyle } = tableProps
207
- const { isColLoading, isDragColMove } = tableReactData
208
- const columnOpts = $xeTable.computeColumnOpts
209
- const columnDragOpts = $xeTable.computeColumnDragOpts
210
206
 
211
207
  return (footerTableData as any[][]).map((row, $rowIndex) => {
212
208
  const _rowIndex = $rowIndex
213
209
  const rowParams = { $table: $xeTable, row, _rowIndex, $rowIndex, fixed: fixedType, type: renderType }
214
210
 
215
- if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
216
- return h('transition-group', {
217
- key: $rowIndex,
218
- props: {
219
- tag: 'tr',
220
- name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
221
- class: [
222
- 'vxe-footer--row',
223
- footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''
224
- ],
225
- style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) as VxeComponentStyleType : undefined
226
- }
227
- }, renderRows(h, _vm, isOptimizeMode, renderColumnList, footerTableData, row, $rowIndex, _rowIndex))
228
- }
229
211
  return h('tr', {
230
212
  key: $rowIndex,
231
213
  class: [
@@ -116,7 +116,7 @@ const renderRows = (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMode
116
116
  }
117
117
 
118
118
  return h('th', {
119
- class: ['vxe-header--column', colid, {
119
+ class: ['vxe-table--column vxe-header--column', colid, {
120
120
  [`col--${headAlign}`]: headAlign,
121
121
  [`col--${type}`]: type,
122
122
  'col--last': isLastColumn,
@@ -175,33 +175,14 @@ function renderHeads (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMo
175
175
  const props = _vm
176
176
  const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
177
177
  const tableProps = $xeTable
178
- const tableReactData = $xeTable as unknown as TableReactData
179
178
 
180
179
  const { fixedType } = props
181
180
 
182
- const columnOpts = $xeTable.computeColumnOpts
183
- const columnDragOpts = $xeTable.computeColumnDragOpts
184
-
185
181
  const { headerRowClassName, headerRowStyle } = tableProps
186
- const { isColLoading, isDragColMove } = tableReactData
187
182
 
188
183
  return headerGroups.map((cols: any, $rowIndex: any) => {
189
184
  const params = { $table: $xeTable, $rowIndex, fixed: fixedType, type: cellType }
190
185
 
191
- if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
192
- return h('transition-group', {
193
- key: $rowIndex,
194
- props: {
195
- tag: 'tr',
196
- name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
197
- class: [
198
- 'vxe-header--row',
199
- headerRowClassName ? XEUtils.isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ''
200
- ],
201
- style: headerRowStyle ? (XEUtils.isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle) : null
202
- }
203
- }, renderRows(h, _vm, isGroup, isOptimizeMode, cols, $rowIndex))
204
- }
205
186
  return h('tr', {
206
187
  key: $rowIndex,
207
188
  class: [