vxe-table 3.14.0 → 3.14.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 (46) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/module/edit/mixin.js +95 -65
  3. package/es/table/module/keyboard/mixin.js +3 -2
  4. package/es/table/module/validator/mixin.js +2 -5
  5. package/es/table/src/body.js +6 -7
  6. package/es/table/src/methods.js +301 -286
  7. package/es/table/src/table.js +21 -15
  8. package/es/ui/index.js +1 -1
  9. package/es/ui/src/dom.js +0 -1
  10. package/es/ui/src/log.js +1 -1
  11. package/lib/index.umd.js +501 -498
  12. package/lib/index.umd.min.js +1 -1
  13. package/lib/style.css +1 -1
  14. package/lib/table/module/edit/mixin.js +108 -99
  15. package/lib/table/module/edit/mixin.min.js +1 -1
  16. package/lib/table/module/keyboard/mixin.js +2 -1
  17. package/lib/table/module/keyboard/mixin.min.js +1 -1
  18. package/lib/table/module/validator/mixin.js +3 -9
  19. package/lib/table/module/validator/mixin.min.js +1 -1
  20. package/lib/table/src/body.js +6 -7
  21. package/lib/table/src/body.min.js +1 -1
  22. package/lib/table/src/methods.js +352 -355
  23. package/lib/table/src/methods.min.js +1 -1
  24. package/lib/table/src/table.js +21 -15
  25. package/lib/table/src/table.min.js +1 -1
  26. package/lib/ui/index.js +1 -1
  27. package/lib/ui/index.min.js +1 -1
  28. package/lib/ui/src/dom.js +0 -2
  29. package/lib/ui/src/dom.min.js +1 -1
  30. package/lib/ui/src/log.js +1 -1
  31. package/lib/ui/src/log.min.js +1 -1
  32. package/package.json +2 -2
  33. package/packages/table/module/edit/mixin.ts +129 -89
  34. package/packages/table/module/keyboard/mixin.ts +4 -2
  35. package/packages/table/module/validator/mixin.ts +3 -6
  36. package/packages/table/src/body.ts +6 -7
  37. package/packages/table/src/methods.ts +345 -301
  38. package/packages/table/src/table.ts +24 -18
  39. package/packages/table/src/util.ts +2 -2
  40. package/packages/ui/src/dom.ts +0 -2
  41. /package/es/{iconfont.1742955973002.ttf → iconfont.1743125678150.ttf} +0 -0
  42. /package/es/{iconfont.1742955973002.woff → iconfont.1743125678150.woff} +0 -0
  43. /package/es/{iconfont.1742955973002.woff2 → iconfont.1743125678150.woff2} +0 -0
  44. /package/lib/{iconfont.1742955973002.ttf → iconfont.1743125678150.ttf} +0 -0
  45. /package/lib/{iconfont.1742955973002.woff → iconfont.1743125678150.woff} +0 -0
  46. /package/lib/{iconfont.1742955973002.woff2 → iconfont.1743125678150.woff2} +0 -0
@@ -570,9 +570,7 @@ export default {
570
570
  focused: {
571
571
  row: null,
572
572
  column: null
573
- },
574
- insertMaps: {},
575
- removeMaps: {}
573
+ }
576
574
  },
577
575
  // 存放 tooltip 相关信息
578
576
  tooltipStore: {
@@ -696,7 +694,7 @@ export default {
696
694
  return Object.assign({ message: 'default' }, getConfig().table.validConfig, this.validConfig)
697
695
  },
698
696
  sXOpts () {
699
- return this.computeSXOpts
697
+ return this.computeVirtualXOpts
700
698
  },
701
699
  computeSXOpts () {
702
700
  return this.computeVirtualXOpts
@@ -704,15 +702,15 @@ export default {
704
702
  computeScrollXThreshold () {
705
703
  const $xeTable = this
706
704
 
707
- const sXOpts = $xeTable.computeSXOpts
708
- const { threshold } = sXOpts
705
+ const virtualXOpts = $xeTable.computeVirtualXOpts
706
+ const { threshold } = virtualXOpts
709
707
  if (threshold) {
710
708
  return XEUtils.toNumber(threshold)
711
709
  }
712
710
  return 0
713
711
  },
714
712
  sYOpts () {
715
- return this.computeSYOpts
713
+ return this.computeVirtualYOpts
716
714
  },
717
715
  computeSYOpts () {
718
716
  return this.computeVirtualYOpts
@@ -750,8 +748,8 @@ export default {
750
748
  computeScrollYThreshold () {
751
749
  const $xeTable = this
752
750
 
753
- const sYOpts = $xeTable.computeSYOpts
754
- const { threshold } = sYOpts
751
+ const virtualYOpts = $xeTable.computeVirtualYOpts
752
+ const { threshold } = virtualYOpts
755
753
  if (threshold) {
756
754
  return XEUtils.toNumber(threshold)
757
755
  }
@@ -1202,16 +1200,19 @@ export default {
1202
1200
  }
1203
1201
  },
1204
1202
  tabsResizeFlag () {
1205
- const $xeTable = this
1203
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1206
1204
  const $xeTabs = $xeTable.$xeTabs
1207
1205
 
1208
1206
  return $xeTabs ? $xeTabs.reactData.resizeFlag : null
1207
+ },
1208
+ computeVxeLanguage () {
1209
+ return VxeUI.getLanguage()
1209
1210
  }
1210
1211
  } as any,
1211
1212
  watch: {
1212
1213
  data (value: any) {
1213
- const $xeTable = this
1214
- const reactData = $xeTable
1214
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1215
+ const reactData = $xeTable as unknown as TableReactData
1215
1216
 
1216
1217
  const { initStatus } = this
1217
1218
  if (value && value.length >= 50000) {
@@ -1283,6 +1284,9 @@ export default {
1283
1284
  computeScrollbarYToLeft () {
1284
1285
  this.reLayoutFlag++
1285
1286
  },
1287
+ computeVxeLanguage () {
1288
+ this.reLayoutFlag++
1289
+ },
1286
1290
  reLayoutFlag () {
1287
1291
  const $xeTable = this
1288
1292
 
@@ -1381,11 +1385,11 @@ export default {
1381
1385
  tableFullColumn: [],
1382
1386
  // 渲染所有列
1383
1387
  visibleColumn: [],
1384
- // 缓存数据集
1388
+ // 总的缓存数据集
1385
1389
  fullAllDataRowIdData: {},
1386
- fullDataRowMap: new Map(),
1390
+ // 渲染中缓存数据
1391
+ sourceDataRowIdData: {},
1387
1392
  fullDataRowIdData: {},
1388
- fullColumnMap: new Map(),
1389
1393
  fullColumnIdData: {},
1390
1394
  fullColumnFieldData: {},
1391
1395
 
@@ -1401,6 +1405,10 @@ export default {
1401
1405
  selectCheckboxMaps: {},
1402
1406
  // 已标记的对象集
1403
1407
  pendingRowMaps: {},
1408
+ // 已新增的临时行
1409
+ insertRowMaps: {},
1410
+ // 已删除行
1411
+ removeRowMaps: {},
1404
1412
 
1405
1413
  swYSize: 0,
1406
1414
  swYInterval: 0,
@@ -1409,7 +1417,6 @@ export default {
1409
1417
 
1410
1418
  const { data, exportConfig, importConfig, treeConfig, showOverflow } = props
1411
1419
  const { scrollXStore, scrollYStore } = internalData
1412
- const sYOpts = $xeTable.computeSYOpts
1413
1420
  const editOpts = $xeTable.computeEditOpts
1414
1421
  const treeOpts = $xeTable.computeTreeOpts
1415
1422
  const radioOpts = $xeTable.computeRadioOpts
@@ -1574,8 +1581,7 @@ export default {
1574
1581
  Object.assign(scrollYStore, {
1575
1582
  startIndex: 0,
1576
1583
  endIndex: 1,
1577
- visibleSize: 0,
1578
- adaptive: sYOpts.adaptive !== false
1584
+ visibleSize: 0
1579
1585
  })
1580
1586
  Object.assign(scrollXStore, {
1581
1587
  startIndex: 0,
@@ -69,8 +69,8 @@ export const convertHeaderColumnToRows = (originColumns: any) => {
69
69
  return rows
70
70
  }
71
71
 
72
- export function restoreScrollLocation ($xeTable: any, scrollLeft: any, scrollTop: any) {
73
- const internalData = $xeTable
72
+ export function restoreScrollLocation ($xeTable: VxeTableConstructor, scrollLeft: number, scrollTop: number) {
73
+ const internalData = $xeTable as unknown as TableInternalData
74
74
 
75
75
  return $xeTable.clearScroll().then(() => {
76
76
  if (scrollLeft || scrollTop) {
@@ -2,8 +2,6 @@ import XEUtils from 'xe-utils'
2
2
 
3
3
  const reClsMap: { [key: string]: any } = {}
4
4
 
5
- export const browse = XEUtils.browse()
6
-
7
5
  let tpImgEl: HTMLImageElement | undefined
8
6
 
9
7
  export function initTpImg () {