vxe-table 3.15.56 → 3.15.58

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 (64) hide show
  1. package/es/locale/lang/de-DE.js +80 -80
  2. package/es/locale/lang/es-ES.js +79 -79
  3. package/es/locale/lang/ja-JP.js +82 -82
  4. package/es/locale/lang/ko-KR.js +88 -88
  5. package/es/locale/lang/ru-RU.js +84 -84
  6. package/es/locale/lang/vi-VN.js +79 -79
  7. package/es/locale/lang/zh-CHT.js +21 -21
  8. package/es/style.css +1 -1
  9. package/es/table/src/methods.js +2 -2
  10. package/es/table/src/table.js +35 -118
  11. package/es/table/src/util.js +116 -0
  12. package/es/ui/index.js +1 -1
  13. package/es/ui/src/log.js +1 -1
  14. package/lib/index.umd.js +160 -121
  15. package/lib/index.umd.min.js +1 -1
  16. package/lib/locale/lang/de-DE.js +80 -80
  17. package/lib/locale/lang/de-DE.min.js +1 -1
  18. package/lib/locale/lang/de-DE.umd.js +80 -80
  19. package/lib/locale/lang/es-ES.js +79 -79
  20. package/lib/locale/lang/es-ES.min.js +1 -1
  21. package/lib/locale/lang/es-ES.umd.js +79 -79
  22. package/lib/locale/lang/ja-JP.js +82 -82
  23. package/lib/locale/lang/ja-JP.min.js +1 -1
  24. package/lib/locale/lang/ja-JP.umd.js +82 -82
  25. package/lib/locale/lang/ko-KR.js +88 -88
  26. package/lib/locale/lang/ko-KR.min.js +1 -1
  27. package/lib/locale/lang/ko-KR.umd.js +88 -88
  28. package/lib/locale/lang/ru-RU.js +84 -84
  29. package/lib/locale/lang/ru-RU.min.js +1 -1
  30. package/lib/locale/lang/ru-RU.umd.js +84 -84
  31. package/lib/locale/lang/vi-VN.js +79 -79
  32. package/lib/locale/lang/vi-VN.min.js +1 -1
  33. package/lib/locale/lang/vi-VN.umd.js +79 -79
  34. package/lib/locale/lang/zh-CHT.js +21 -21
  35. package/lib/locale/lang/zh-CHT.min.js +1 -1
  36. package/lib/locale/lang/zh-CHT.umd.js +21 -21
  37. package/lib/style.css +1 -1
  38. package/lib/table/src/methods.js +2 -2
  39. package/lib/table/src/methods.min.js +1 -1
  40. package/lib/table/src/table.js +40 -117
  41. package/lib/table/src/table.min.js +1 -1
  42. package/lib/table/src/util.js +117 -0
  43. package/lib/table/src/util.min.js +1 -1
  44. package/lib/ui/index.js +1 -1
  45. package/lib/ui/index.min.js +1 -1
  46. package/lib/ui/src/log.js +1 -1
  47. package/lib/ui/src/log.min.js +1 -1
  48. package/package.json +1 -1
  49. package/packages/locale/lang/de-DE.ts +80 -80
  50. package/packages/locale/lang/es-ES.ts +79 -79
  51. package/packages/locale/lang/ja-JP.ts +82 -82
  52. package/packages/locale/lang/ko-KR.ts +88 -88
  53. package/packages/locale/lang/ru-RU.ts +84 -84
  54. package/packages/locale/lang/vi-VN.ts +79 -79
  55. package/packages/locale/lang/zh-CHT.ts +21 -21
  56. package/packages/table/src/methods.ts +2 -2
  57. package/packages/table/src/table.ts +36 -122
  58. package/packages/table/src/util.ts +120 -0
  59. /package/es/{iconfont.1753525475408.ttf → iconfont.1754455794027.ttf} +0 -0
  60. /package/es/{iconfont.1753525475408.woff → iconfont.1754455794027.woff} +0 -0
  61. /package/es/{iconfont.1753525475408.woff2 → iconfont.1754455794027.woff2} +0 -0
  62. /package/lib/{iconfont.1753525475408.ttf → iconfont.1754455794027.ttf} +0 -0
  63. /package/lib/{iconfont.1753525475408.woff → iconfont.1754455794027.woff} +0 -0
  64. /package/lib/{iconfont.1753525475408.woff2 → iconfont.1754455794027.woff2} +0 -0
@@ -2,7 +2,7 @@ import { CreateElement } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { getFuncText, isEnableConf } from '../../ui/src/utils'
4
4
  import { initTpImg } from '../../ui/src/dom'
5
- import { createHandleGetRowId, getCellHeight, hasDeepKey } from './util'
5
+ import { createInternalData, createHandleGetRowId, getCellHeight, hasDeepKey } from './util'
6
6
  import { VxeUI } from '../../ui'
7
7
  import methods from './methods'
8
8
  import TableBodyComponent from './body'
@@ -26,7 +26,7 @@ import validatorMixin from '../module/validator/mixin'
26
26
  import customMixin from '../module/custom/mixin'
27
27
 
28
28
  import type { VxeLoadingComponent, VxeTooltipComponent, VxeTabsConstructor, VxeTabsPrivateMethods } from 'vxe-pc-ui'
29
- import type { VxeTableConstructor, VxeTablePrivateMethods, TableInternalData, TableReactData, VxeTableDefines } from '../../../types'
29
+ import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTablePropTypes, TableInternalData, TableReactData, VxeTableDefines } from '../../../types'
30
30
 
31
31
  const { getConfig, getIcon, getI18n, renderer, globalResize, globalEvents, globalMixins, renderEmptyElement } = VxeUI
32
32
 
@@ -791,13 +791,41 @@ export default {
791
791
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
792
792
  const props = $xeTable
793
793
 
794
- return Object.assign({}, getConfig().table.virtualXConfig || getConfig().table.scrollX, props.virtualXConfig || props.scrollX)
794
+ const { virtualXConfig, scrollX } = props
795
+ const globalVirtualXConfig = getConfig().table.virtualXConfig
796
+ const globalScrollX = getConfig().table.scrollX
797
+ if (virtualXConfig) {
798
+ return Object.assign({}, globalVirtualXConfig, virtualXConfig) as VxeTablePropTypes.VirtualXConfig & { gt: number }
799
+ }
800
+ if (scrollX) {
801
+ // 已废弃,保留兼容
802
+ return Object.assign({}, globalScrollX, scrollX) as VxeTablePropTypes.VirtualXConfig & { gt: number }
803
+ }
804
+ if (globalVirtualXConfig) {
805
+ return Object.assign({}, globalVirtualXConfig, virtualXConfig) as VxeTablePropTypes.VirtualXConfig & { gt: number }
806
+ }
807
+ // 已废弃,保留兼容
808
+ return Object.assign({}, globalScrollX, scrollX) as VxeTablePropTypes.VirtualXConfig & { gt: number }
795
809
  },
796
810
  computeVirtualYOpts () {
797
811
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
798
812
  const props = $xeTable
799
813
 
800
- return Object.assign({}, getConfig().table.virtualYConfig || getConfig().table.scrollY, props.virtualYConfig || props.scrollY)
814
+ const { virtualYConfig, scrollY } = props
815
+ const globalVirtualYConfig = getConfig().table.virtualYConfig
816
+ const globalScrollY = getConfig().table.scrollY
817
+ if (virtualYConfig) {
818
+ return Object.assign({}, globalVirtualYConfig, virtualYConfig) as VxeTablePropTypes.VirtualYConfig & { gt: number }
819
+ }
820
+ if (scrollY) {
821
+ // 已废弃,保留兼容
822
+ return Object.assign({}, globalScrollY, scrollY) as VxeTablePropTypes.VirtualYConfig & { gt: number }
823
+ }
824
+ if (globalVirtualYConfig) {
825
+ return Object.assign({}, globalVirtualYConfig, virtualYConfig) as VxeTablePropTypes.VirtualYConfig & { gt: number }
826
+ }
827
+ // 已废弃,保留兼容
828
+ return Object.assign({}, globalScrollY, scrollY) as VxeTablePropTypes.VirtualYConfig & { gt: number }
801
829
  },
802
830
  computeScrollbarOpts () {
803
831
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
@@ -1328,7 +1356,7 @@ export default {
1328
1356
  if (value && value.length >= 50000) {
1329
1357
  warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)'])
1330
1358
  }
1331
- this.loadTableData(value || [], false).then(() => {
1359
+ this.loadTableData(value || [], true).then(() => {
1332
1360
  const { scrollXLoad, scrollYLoad, expandColumn } = reactData
1333
1361
  const expandOpts = $xeTable.computeExpandOpts
1334
1362
  this.inited = true
@@ -1465,119 +1493,7 @@ export default {
1465
1493
  const props = $xeTable
1466
1494
  const internalData = $xeTable as unknown as TableInternalData
1467
1495
 
1468
- Object.assign($xeTable, {
1469
- tZindex: 0,
1470
- currKeyField: '',
1471
- isCurrDeepKey: false,
1472
- elemStore: {},
1473
- // 存放横向 X 虚拟滚动相关的信息
1474
- scrollXStore: {
1475
- preloadSize: 0,
1476
- offsetSize: 0,
1477
- visibleSize: 0,
1478
- visibleStartIndex: 0,
1479
- visibleEndIndex: 0,
1480
- startIndex: 0,
1481
- endIndex: 0
1482
- },
1483
- // 存放纵向 Y 虚拟滚动相关信息
1484
- scrollYStore: {
1485
- preloadSize: 0,
1486
- offsetSize: 0,
1487
- visibleSize: 0,
1488
- visibleStartIndex: 0,
1489
- visibleEndIndex: 0,
1490
- startIndex: 0,
1491
- endIndex: 0
1492
- },
1493
- // 表格宽度
1494
- tableWidth: 0,
1495
- // 表格高度
1496
- tableHeight: 0,
1497
- // 表头高度
1498
- headerHeight: 0,
1499
- // 表尾高度
1500
- footerHeight: 0,
1501
- // 当前 hover 行
1502
- // hoverRow: null,
1503
- // 最后滚动位置
1504
- lastScrollLeft: 0,
1505
- lastScrollTop: 0,
1506
- // 单选框属性,已选中保留的行
1507
- radioReserveRow: null,
1508
- // 复选框属性,已选中保留的行集合
1509
- checkboxReserveRowMap: {},
1510
- // 行数据,已展开保留的行集合
1511
- rowExpandedReserveRowMap: {},
1512
- // 树结构数据,已展开保留的行集合
1513
- treeExpandedReserveRowMap: {},
1514
- // 树结构数据,不确定状态的集合
1515
- treeIndeterminateRowMaps: {},
1516
- // 列表完整数据、条件处理后
1517
- tableFullData: [],
1518
- afterFullData: [],
1519
- afterTreeFullData: [],
1520
- afterGroupFullData: [],
1521
- // 列表条件处理后数据集合
1522
- afterFullRowMaps: {},
1523
- // 树结构完整数据、条件处理后
1524
- tableFullTreeData: [],
1525
- // 行分组全量数据、条件处理后
1526
- tableFullGroupData: [],
1527
- tableSynchData: [],
1528
- tableSourceData: [],
1529
- // 收集的列配置(带分组)
1530
- collectColumn: [],
1531
- // 完整所有列(不带分组)
1532
- tableFullColumn: [],
1533
- // 渲染所有列
1534
- visibleColumn: [],
1535
- // 全量数据集(包括当前和已删除)
1536
- fullAllDataRowIdData: {},
1537
- // 数据集(仅当前)
1538
- fullDataRowIdData: {},
1539
- // 数据集(仅可视)
1540
- visibleDataRowIdData: {},
1541
- // 渲染中缓存数据
1542
- sourceDataRowIdData: {},
1543
- fullColumnIdData: {},
1544
- fullColumnFieldData: {},
1545
-
1546
- // 合并单元格的数据
1547
- mergeBodyList: [],
1548
- mergeBodyMaps: {},
1549
- // 合并表尾的数据
1550
- mergeFooterList: [],
1551
- mergeFooterMaps: {},
1552
- // 已合并单元格数据集合
1553
- mergeBodyCellMaps: {},
1554
- // 已合并表尾数据集合
1555
- mergeFooterCellMaps: {},
1556
- // 已展开的行集合
1557
- rowExpandedMaps: {},
1558
- // 懒加载中的展开行的集合
1559
- rowExpandLazyLoadedMaps: {},
1560
- // 已展开的分组行
1561
- rowGroupExpandedMaps: {},
1562
- // 已展开树节点集合
1563
- treeExpandedMaps: {},
1564
- // 懒加载中的树节点的集合
1565
- treeExpandLazyLoadedMaps: {},
1566
- // 复选框属性,已选中的行集合
1567
- selectCheckboxMaps: {},
1568
- // 已标记的对象集
1569
- pendingRowMaps: {},
1570
- // 已新增的临时行
1571
- insertRowMaps: {},
1572
- // 已删除行
1573
- removeRowMaps: {},
1574
-
1575
- cvCacheMaps: {},
1576
-
1577
- swYSize: 0,
1578
- swYInterval: 0,
1579
- swYTotal: 0
1580
- })
1496
+ XEUtils.assign(internalData, createInternalData())
1581
1497
 
1582
1498
  handleKeyField($xeTable)
1583
1499
 
@@ -1927,15 +1843,11 @@ export default {
1927
1843
  },
1928
1844
  beforeDestroy () {
1929
1845
  const $xeTable = this
1930
- const internalData = $xeTable as unknown as TableInternalData
1931
1846
 
1932
1847
  const tableViewportEl = $xeTable.$refs.refTableViewportElem as HTMLDivElement
1933
1848
  if (tableViewportEl) {
1934
1849
  tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent)
1935
1850
  }
1936
- internalData.cvCacheMaps = {}
1937
- internalData.prevDragRow = null
1938
- internalData.prevDragCol = null
1939
1851
  if (this.$resize) {
1940
1852
  this.$resize.disconnect()
1941
1853
  }
@@ -1945,6 +1857,7 @@ export default {
1945
1857
  },
1946
1858
  destroyed () {
1947
1859
  const $xeTable = this
1860
+ const internalData = $xeTable as unknown as TableInternalData
1948
1861
 
1949
1862
  globalEvents.off($xeTable, 'paste')
1950
1863
  globalEvents.off($xeTable, 'copy')
@@ -1956,6 +1869,7 @@ export default {
1956
1869
  globalEvents.off($xeTable, 'resize')
1957
1870
  globalEvents.off($xeTable, 'contextmenu')
1958
1871
  this.preventEvent(null, 'destroyed')
1872
+ XEUtils.assign(internalData, createInternalData())
1959
1873
  },
1960
1874
  render (h: CreateElement) {
1961
1875
  // 使用已安装的组件,如果未安装则不渲染
@@ -6,6 +6,126 @@ import { eqEmptyValue } from '../../ui/src/utils'
6
6
 
7
7
  import type { VxeTableDefines, VxeTableConstructor, TableReactData, TableInternalData, VxeTablePrivateMethods, VxeTablePropTypes } from '../../../types'
8
8
 
9
+ export function createInternalData (): TableInternalData {
10
+ return {
11
+ tZindex: 0,
12
+ currKeyField: '',
13
+ isCurrDeepKey: false,
14
+ elemStore: {},
15
+ // 存放横向 X 虚拟滚动相关的信息
16
+ scrollXStore: {
17
+ preloadSize: 0,
18
+ offsetSize: 0,
19
+ visibleSize: 0,
20
+ visibleStartIndex: 0,
21
+ visibleEndIndex: 0,
22
+ startIndex: 0,
23
+ endIndex: 0
24
+ },
25
+ // 存放纵向 Y 虚拟滚动相关信息
26
+ scrollYStore: {
27
+ preloadSize: 0,
28
+ offsetSize: 0,
29
+ visibleSize: 0,
30
+ visibleStartIndex: 0,
31
+ visibleEndIndex: 0,
32
+ startIndex: 0,
33
+ endIndex: 0
34
+ },
35
+ // 表格宽度
36
+ tableWidth: 0,
37
+ // 表格高度
38
+ tableHeight: 0,
39
+ // 表头高度
40
+ headerHeight: 0,
41
+ // 表尾高度
42
+ footerHeight: 0,
43
+ customHeight: 0,
44
+ customMinHeight: 0,
45
+ customMaxHeight: 0,
46
+ // 当前 hover 行
47
+ hoverRow: null,
48
+ // 最后滚动位置
49
+ lastScrollLeft: 0,
50
+ lastScrollTop: 0,
51
+ // 单选框属性,已选中保留的行
52
+ radioReserveRow: null,
53
+ // 复选框属性,已选中保留的行集合
54
+ checkboxReserveRowMap: {},
55
+ // 行数据,已展开保留的行集合
56
+ rowExpandedReserveRowMap: {},
57
+ // 树结构数据,已展开保留的行集合
58
+ treeExpandedReserveRowMap: {},
59
+ // 树结构数据,不确定状态的集合
60
+ treeIndeterminateRowMaps: {},
61
+ // 列表完整数据、条件处理后
62
+ tableFullData: [],
63
+ afterFullData: [],
64
+ afterTreeFullData: [],
65
+ afterGroupFullData: [],
66
+ // 列表条件处理后数据集合
67
+ afterFullRowMaps: {},
68
+ // 树结构完整数据、条件处理后
69
+ tableFullTreeData: [],
70
+ // 行分组全量数据、条件处理后
71
+ tableFullGroupData: [],
72
+ tableSynchData: [],
73
+ tableSourceData: [],
74
+ // 收集的列配置(带分组)
75
+ collectColumn: [],
76
+ // 完整所有列(不带分组)
77
+ tableFullColumn: [],
78
+ // 渲染所有列
79
+ visibleColumn: [],
80
+ // 全量数据集(包括当前和已删除)
81
+ fullAllDataRowIdData: {},
82
+ // 数据集(仅当前)
83
+ fullDataRowIdData: {},
84
+ // 数据集(仅可视)
85
+ visibleDataRowIdData: {},
86
+ // 渲染中缓存数据
87
+ sourceDataRowIdData: {},
88
+ fullColumnIdData: {},
89
+ fullColumnFieldData: {},
90
+
91
+ // 合并单元格的数据
92
+ mergeBodyList: [],
93
+ mergeBodyMaps: {},
94
+ // 合并表尾的数据
95
+ mergeFooterList: [],
96
+ mergeFooterMaps: {},
97
+ // 已合并单元格数据集合
98
+ mergeBodyCellMaps: {},
99
+ // 已合并表尾数据集合
100
+ mergeFooterCellMaps: {},
101
+ // 已展开的行集合
102
+ rowExpandedMaps: {},
103
+ // 懒加载中的展开行的集合
104
+ rowExpandLazyLoadedMaps: {},
105
+ // 已展开的分组行
106
+ rowGroupExpandedMaps: {},
107
+ // 已展开树节点集合
108
+ treeExpandedMaps: {},
109
+ // 懒加载中的树节点的集合
110
+ treeExpandLazyLoadedMaps: {},
111
+ // 复选框属性,已选中的行集合
112
+ selectCheckboxMaps: {},
113
+ // 已标记的对象集
114
+ pendingRowMaps: {},
115
+ // 已新增的临时行
116
+ insertRowMaps: {},
117
+ // 已删除行
118
+ removeRowMaps: {},
119
+
120
+ cvCacheMaps: {},
121
+
122
+ inited: false,
123
+ tooltipTimeout: null,
124
+ initStatus: false,
125
+ isActivated: false
126
+ }
127
+ }
128
+
9
129
  const getAllConvertColumns = (columns: any, parentColumn?: any) => {
10
130
  const result: any[] = []
11
131
  columns.forEach((column: any) => {