vxe-table 3.15.10 → 3.15.12

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 (102) hide show
  1. package/es/locale/lang/ar-EG.js +511 -511
  2. package/es/locale/lang/de-DE.js +280 -280
  3. package/es/locale/lang/en-US.js +206 -206
  4. package/es/locale/lang/es-ES.js +494 -501
  5. package/es/locale/lang/fr-FR.js +517 -517
  6. package/es/locale/lang/hu-HU.js +372 -372
  7. package/es/locale/lang/id-ID.js +529 -529
  8. package/es/locale/lang/it-IT.js +297 -297
  9. package/es/locale/lang/ja-JP.js +454 -454
  10. package/es/locale/lang/ko-KR.js +415 -415
  11. package/es/locale/lang/nb-NO.js +515 -515
  12. package/es/locale/lang/pt-BR.js +505 -505
  13. package/es/locale/lang/ru-RU.js +326 -326
  14. package/es/locale/lang/th-TH.js +255 -255
  15. package/es/locale/lang/uk-UA.js +450 -450
  16. package/es/locale/lang/vi-VN.js +528 -528
  17. package/es/locale/lang/zh-CHT.js +155 -155
  18. package/es/style.css +1 -1
  19. package/es/table/src/methods.js +48 -48
  20. package/es/table/src/util.js +12 -16
  21. package/es/ui/index.js +1 -1
  22. package/es/ui/src/log.js +1 -1
  23. package/lib/index.umd.js +63 -75
  24. package/lib/index.umd.min.js +1 -1
  25. package/lib/locale/lang/ar-EG.js +511 -511
  26. package/lib/locale/lang/ar-EG.min.js +1 -1
  27. package/lib/locale/lang/de-DE.js +280 -280
  28. package/lib/locale/lang/de-DE.min.js +1 -1
  29. package/lib/locale/lang/en-US.js +206 -206
  30. package/lib/locale/lang/en-US.min.js +1 -1
  31. package/lib/locale/lang/en-US.umd.js +206 -206
  32. package/lib/locale/lang/es-ES.js +494 -501
  33. package/lib/locale/lang/es-ES.min.js +1 -1
  34. package/lib/locale/lang/es-ES.umd.js +494 -501
  35. package/lib/locale/lang/fr-FR.js +517 -517
  36. package/lib/locale/lang/fr-FR.min.js +1 -1
  37. package/lib/locale/lang/hu-HU.js +372 -372
  38. package/lib/locale/lang/hu-HU.min.js +1 -1
  39. package/lib/locale/lang/hu-HU.umd.js +372 -372
  40. package/lib/locale/lang/id-ID.js +529 -529
  41. package/lib/locale/lang/id-ID.min.js +1 -1
  42. package/lib/locale/lang/it-IT.js +297 -297
  43. package/lib/locale/lang/it-IT.min.js +1 -1
  44. package/lib/locale/lang/ja-JP.js +454 -454
  45. package/lib/locale/lang/ja-JP.min.js +1 -1
  46. package/lib/locale/lang/ja-JP.umd.js +454 -454
  47. package/lib/locale/lang/ko-KR.js +415 -415
  48. package/lib/locale/lang/ko-KR.min.js +1 -1
  49. package/lib/locale/lang/ko-KR.umd.js +415 -415
  50. package/lib/locale/lang/nb-NO.js +515 -515
  51. package/lib/locale/lang/nb-NO.min.js +1 -1
  52. package/lib/locale/lang/pt-BR.js +505 -505
  53. package/lib/locale/lang/pt-BR.min.js +1 -1
  54. package/lib/locale/lang/pt-BR.umd.js +505 -505
  55. package/lib/locale/lang/ru-RU.js +326 -326
  56. package/lib/locale/lang/ru-RU.min.js +1 -1
  57. package/lib/locale/lang/ru-RU.umd.js +326 -326
  58. package/lib/locale/lang/th-TH.js +255 -255
  59. package/lib/locale/lang/th-TH.min.js +1 -1
  60. package/lib/locale/lang/uk-UA.js +450 -450
  61. package/lib/locale/lang/uk-UA.min.js +1 -1
  62. package/lib/locale/lang/uk-UA.umd.js +450 -450
  63. package/lib/locale/lang/vi-VN.js +528 -528
  64. package/lib/locale/lang/vi-VN.min.js +1 -1
  65. package/lib/locale/lang/zh-CHT.js +155 -155
  66. package/lib/locale/lang/zh-CHT.min.js +1 -1
  67. package/lib/locale/lang/zh-CHT.umd.js +155 -155
  68. package/lib/style.css +1 -1
  69. package/lib/table/src/methods.js +49 -57
  70. package/lib/table/src/methods.min.js +1 -1
  71. package/lib/table/src/util.js +12 -16
  72. package/lib/table/src/util.min.js +1 -1
  73. package/lib/ui/index.js +1 -1
  74. package/lib/ui/index.min.js +1 -1
  75. package/lib/ui/src/log.js +1 -1
  76. package/lib/ui/src/log.min.js +1 -1
  77. package/package.json +2 -2
  78. package/packages/locale/lang/ar-EG.ts +511 -511
  79. package/packages/locale/lang/de-DE.ts +281 -282
  80. package/packages/locale/lang/en-US.ts +206 -206
  81. package/packages/locale/lang/es-ES.ts +494 -503
  82. package/packages/locale/lang/fr-FR.ts +517 -517
  83. package/packages/locale/lang/hu-HU.ts +372 -372
  84. package/packages/locale/lang/id-ID.ts +529 -529
  85. package/packages/locale/lang/it-IT.ts +297 -297
  86. package/packages/locale/lang/ja-JP.ts +454 -454
  87. package/packages/locale/lang/ko-KR.ts +415 -415
  88. package/packages/locale/lang/nb-NO.ts +515 -515
  89. package/packages/locale/lang/pt-BR.ts +505 -505
  90. package/packages/locale/lang/ru-RU.ts +326 -326
  91. package/packages/locale/lang/th-TH.ts +255 -255
  92. package/packages/locale/lang/uk-UA.ts +450 -450
  93. package/packages/locale/lang/vi-VN.ts +528 -528
  94. package/packages/locale/lang/zh-CHT.ts +155 -155
  95. package/packages/table/src/methods.ts +59 -55
  96. package/packages/table/src/util.ts +12 -17
  97. /package/es/{iconfont.1745546354510.ttf → iconfont.1745723938260.ttf} +0 -0
  98. /package/es/{iconfont.1745546354510.woff → iconfont.1745723938260.woff} +0 -0
  99. /package/es/{iconfont.1745546354510.woff2 → iconfont.1745723938260.woff2} +0 -0
  100. /package/lib/{iconfont.1745546354510.ttf → iconfont.1745723938260.ttf} +0 -0
  101. /package/lib/{iconfont.1745546354510.woff → iconfont.1745723938260.woff} +0 -0
  102. /package/lib/{iconfont.1745546354510.woff2 → iconfont.1745723938260.woff2} +0 -0
@@ -7463,9 +7463,9 @@ const Methods = {
7463
7463
  * 如果是双击模式,则激活为编辑状态
7464
7464
  */
7465
7465
  triggerCellDblclickEvent (evnt: MouseEvent, params: VxeTableDefines.CellRenderBodyParams) {
7466
- const $xeTable = this
7466
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
7467
7467
  const props = $xeTable
7468
- const reactData = $xeTable
7468
+ const reactData = $xeTable as unknown as TableReactData
7469
7469
 
7470
7470
  const { editConfig } = props
7471
7471
  const { editStore, isDragResize } = reactData
@@ -7482,12 +7482,12 @@ const Methods = {
7482
7482
  checkValidate($xeTable, 'blur')
7483
7483
  .catch((e: any) => e)
7484
7484
  .then(() => {
7485
- this.handleEdit(params, evnt)
7485
+ $xeTable.handleEdit(params, evnt)
7486
7486
  .then(() => checkValidate($xeTable, 'change'))
7487
7487
  .catch((e: any) => e)
7488
7488
  })
7489
7489
  } else if (editOpts.mode === 'cell') {
7490
- this.handleEdit(params, evnt)
7490
+ $xeTable.handleEdit(params, evnt)
7491
7491
  .then(() => checkValidate($xeTable, 'change'))
7492
7492
  .catch((e: any) => e)
7493
7493
  }
@@ -7496,7 +7496,7 @@ const Methods = {
7496
7496
  this.emitEvent('cell-dblclick', params, evnt)
7497
7497
  },
7498
7498
  handleColumnSortEvent (evnt: any, column: any) {
7499
- const $xeTable = this
7499
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
7500
7500
  const props = $xeTable
7501
7501
 
7502
7502
  const { mouseConfig } = props
@@ -7514,7 +7514,7 @@ const Methods = {
7514
7514
  * 点击排序事件
7515
7515
  */
7516
7516
  triggerSortEvent (evnt: Event, column: VxeTableDefines.ColumnInfo, order: VxeTablePropTypes.SortOrder) {
7517
- const $xeTable = this
7517
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
7518
7518
 
7519
7519
  const sortOpts = $xeTable.computeSortOpts
7520
7520
  const { multiple, allowClear } = sortOpts
@@ -7534,7 +7534,7 @@ const Methods = {
7534
7534
  row: any
7535
7535
  column: VxeTableDefines.ColumnInfo
7536
7536
  }, cellValue?: any) {
7537
- const $xeTable = this
7537
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
7538
7538
  const reactData = $xeTable as unknown as TableReactData
7539
7539
 
7540
7540
  const { validStore } = reactData
@@ -7566,7 +7566,7 @@ const Methods = {
7566
7566
  * 表头单元格按下事件
7567
7567
  */
7568
7568
  triggerHeaderCellMousedownEvent (evnt: any, params: any) {
7569
- const $xeTable = this
7569
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
7570
7570
  const props = $xeTable
7571
7571
 
7572
7572
  const { mouseConfig } = props
@@ -7600,7 +7600,7 @@ const Methods = {
7600
7600
  * 单元格按下事件
7601
7601
  */
7602
7602
  triggerCellMousedownEvent (evnt: any, params: any) {
7603
- const $xeTable = this
7603
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
7604
7604
 
7605
7605
  const { column } = params
7606
7606
  const { type, treeNode } = column
@@ -8382,7 +8382,7 @@ const Methods = {
8382
8382
  sort (sortConfs: any, sortOrder: any) {
8383
8383
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
8384
8384
 
8385
- const { sortOpts } = this
8385
+ const sortOpts = $xeTable.computeSortOpts
8386
8386
  const { multiple, remote, orders } = sortOpts
8387
8387
  if (sortConfs) {
8388
8388
  if (XEUtils.isString(sortConfs)) {
@@ -8397,20 +8397,20 @@ const Methods = {
8397
8397
  if (sortConfs.length) {
8398
8398
  let firstSortColumn: any
8399
8399
  if (!multiple) {
8400
- clearAllSort(this)
8400
+ clearAllSort($xeTable)
8401
8401
  }
8402
8402
  (multiple ? sortConfs : [sortConfs[0]]).forEach((confs: any, index: any) => {
8403
8403
  let { field, order } = confs
8404
8404
  let column = field
8405
8405
  if (XEUtils.isString(field)) {
8406
- column = this.getColumnByField(field)
8406
+ column = $xeTable.getColumnByField(field)
8407
8407
  }
8408
8408
  if (column && (column.sortable || column.remoteSort)) {
8409
8409
  if (!firstSortColumn) {
8410
8410
  firstSortColumn = column
8411
8411
  }
8412
- if (orders.indexOf(order) === -1) {
8413
- order = getNextSortOrder(this, column)
8412
+ if (orders && orders.indexOf(order) === -1) {
8413
+ order = getNextSortOrder($xeTable, column)
8414
8414
  }
8415
8415
  if (column.order !== order) {
8416
8416
  column.order = order
@@ -8420,17 +8420,18 @@ const Methods = {
8420
8420
  })
8421
8421
  // 如果是服务端排序,则跳过本地排序处理
8422
8422
  if (!remote || (firstSortColumn && firstSortColumn.remoteSort)) {
8423
- this.handleTableData(true)
8423
+ $xeTable.handleTableData(true)
8424
8424
  }
8425
- return this.$nextTick().then(() => {
8426
- this.updateCellAreas()
8425
+ return $xeTable.$nextTick().then(() => {
8426
+ updateRowOffsetTop($xeTable)
8427
+ $xeTable.updateCellAreas()
8427
8428
  return updateStyle($xeTable)
8428
8429
  })
8429
8430
  }
8430
- return this.$nextTick()
8431
+ return $xeTable.$nextTick()
8431
8432
  },
8432
8433
  setSort (sortConfs: VxeTableDefines.SortConfs | VxeTableDefines.SortConfs[], isUpdate?: boolean) {
8433
- const $xeTable = this
8434
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
8434
8435
 
8435
8436
  const sortOpts = $xeTable.computeSortOpts
8436
8437
  const { multiple, remote, orders } = sortOpts
@@ -8453,7 +8454,7 @@ const Methods = {
8453
8454
  firstColumn = column
8454
8455
  }
8455
8456
  if (column && column.sortable) {
8456
- if (orders.indexOf(order) === -1) {
8457
+ if (orders && orders.indexOf(order) === -1) {
8457
8458
  order = getNextSortOrder($xeTable, column)
8458
8459
  }
8459
8460
  if (column.order !== order) {
@@ -8469,6 +8470,7 @@ const Methods = {
8469
8470
  $xeTable.handleColumnSortEvent(new Event('click'), firstColumn)
8470
8471
  }
8471
8472
  return $xeTable.$nextTick().then(() => {
8473
+ updateRowOffsetTop($xeTable)
8472
8474
  $xeTable.updateCellAreas()
8473
8475
  return updateStyle($xeTable)
8474
8476
  })
@@ -8481,21 +8483,24 @@ const Methods = {
8481
8483
  * @param {String} column 列或字段名
8482
8484
  */
8483
8485
  clearSort (fieldOrColumn: any) {
8484
- const $xeTable = this
8486
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
8485
8487
 
8486
- const { sortOpts } = this
8488
+ const sortOpts = $xeTable.computeSortOpts
8487
8489
  if (fieldOrColumn) {
8488
- const column = handleFieldOrColumn(this, fieldOrColumn)
8490
+ const column = handleFieldOrColumn($xeTable, fieldOrColumn)
8489
8491
  if (column) {
8490
8492
  column.order = null
8491
8493
  }
8492
8494
  } else {
8493
- clearAllSort(this)
8495
+ clearAllSort($xeTable)
8494
8496
  }
8495
8497
  if (!sortOpts.remote) {
8496
- this.handleTableData(true)
8498
+ $xeTable.handleTableData(true)
8497
8499
  }
8498
- return this.$nextTick().then(() => updateStyle($xeTable))
8500
+ return $xeTable.$nextTick().then(() => {
8501
+ updateRowOffsetTop($xeTable)
8502
+ return updateStyle($xeTable)
8503
+ })
8499
8504
  },
8500
8505
  // 在 v3 中废弃
8501
8506
  getSortColumn () {
@@ -9878,47 +9883,45 @@ const Methods = {
9878
9883
  */
9879
9884
  scrollTo (scrollLeft: number | null, scrollTop?: number | null) {
9880
9885
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
9886
+ const reactData = $xeTable as unknown as TableReactData
9881
9887
  const internalData = $xeTable as unknown as TableInternalData
9882
9888
 
9883
- const { $refs } = this
9884
- const { refTableBody, refTableHeader, leftBody, rightBody, refTableFooter } = $refs
9885
- const tableBodyElem = refTableBody ? refTableBody.$el : null
9886
- const leftBodyElem = leftBody ? leftBody.$el : null
9887
- const rightBodyElem = rightBody ? rightBody.$el : null
9888
- const tableHeaderElem = refTableHeader ? refTableHeader.$el : null
9889
- const tableFooterElem = refTableFooter ? refTableFooter.$el : null
9889
+ const { elemStore } = internalData
9890
+ const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
9891
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
9892
+ const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
9893
+ const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
9894
+ const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
9895
+ const xHandleEl = $xeTable.$refs.refScrollXHandleElem as HTMLDivElement
9896
+ const yHandleEl = $xeTable.$refs.refScrollYHandleElem as HTMLDivElement
9897
+
9890
9898
  internalData.intoRunScroll = true
9899
+
9891
9900
  if (XEUtils.isNumber(scrollLeft)) {
9892
- const xHandleEl = $xeTable.$refs.refScrollXHandleElem as HTMLDivElement
9893
- if (xHandleEl) {
9894
- setScrollLeft(xHandleEl, scrollLeft)
9895
- } else {
9896
- setScrollLeft(tableBodyElem, scrollLeft)
9897
- setScrollLeft(tableHeaderElem, scrollLeft)
9898
- setScrollLeft(tableFooterElem, scrollLeft)
9899
- }
9901
+ setScrollLeft(xHandleEl, scrollLeft)
9902
+ setScrollLeft(bodyScrollElem, scrollLeft)
9903
+ setScrollLeft(headerScrollElem, scrollLeft)
9904
+ setScrollLeft(footerScrollElem, scrollLeft)
9905
+ loadScrollXData($xeTable)
9900
9906
  }
9901
9907
  if (XEUtils.isNumber(scrollTop)) {
9902
- const yHandleEl = $xeTable.$refs.refScrollYHandleElem as HTMLDivElement
9903
- if (yHandleEl) {
9904
- setScrollTop(yHandleEl, scrollTop)
9905
- } else {
9906
- setScrollTop(tableBodyElem, scrollTop)
9907
- setScrollTop(leftBodyElem, scrollTop)
9908
- setScrollTop(rightBodyElem, scrollTop)
9909
- }
9908
+ setScrollTop(yHandleEl, scrollTop)
9909
+ setScrollTop(bodyScrollElem, scrollTop)
9910
+ setScrollTop(leftScrollElem, scrollTop)
9911
+ setScrollTop(rightScrollElem, scrollTop)
9912
+ loadScrollYData($xeTable)
9910
9913
  }
9911
- if (this.scrollXLoad || this.scrollYLoad) {
9914
+ if (reactData.scrollXLoad || reactData.scrollYLoad) {
9912
9915
  return new Promise<void>(resolve => {
9913
9916
  setTimeout(() => {
9914
9917
  $xeTable.$nextTick(() => {
9915
9918
  internalData.intoRunScroll = false
9916
9919
  resolve()
9917
9920
  })
9918
- })
9921
+ }, 30)
9919
9922
  })
9920
9923
  }
9921
- return this.$nextTick()
9924
+ return $xeTable.$nextTick()
9922
9925
  },
9923
9926
  /**
9924
9927
  * 如果有滚动条,则滚动到对应的行
@@ -9927,15 +9930,16 @@ const Methods = {
9927
9930
  */
9928
9931
  scrollToRow (row: any, fieldOrColumn?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo) {
9929
9932
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
9933
+ const props = $xeTable
9930
9934
  const reactData = $xeTable as unknown as TableReactData
9931
9935
 
9932
9936
  const { isAllOverflow, scrollYLoad, scrollXLoad } = reactData
9933
9937
  const rest = []
9934
9938
  if (row) {
9935
- if (this.treeConfig) {
9936
- rest.push(this.scrollToTreeRow(row))
9939
+ if (props.treeConfig) {
9940
+ rest.push($xeTable.scrollToTreeRow(row))
9937
9941
  } else {
9938
- rest.push(rowToVisible(this, row))
9942
+ rest.push(rowToVisible($xeTable, row))
9939
9943
  }
9940
9944
  }
9941
9945
  if (fieldOrColumn) {
@@ -72,23 +72,18 @@ export const convertHeaderColumnToRows = (originColumns: any) => {
72
72
  export function restoreScrollLocation ($xeTable: VxeTableConstructor, scrollLeft: number, scrollTop: number) {
73
73
  const internalData = $xeTable as unknown as TableInternalData
74
74
 
75
- return $xeTable.clearScroll().then(() => {
76
- if (scrollLeft || scrollTop) {
77
- // 重置最后滚动状态
78
- internalData.lastScrollLeft = 0
79
- internalData.lastScrollTop = 0
80
-
81
- internalData.intoRunScroll = false
82
- internalData.inVirtualScroll = false
83
- internalData.inWheelScroll = false
84
- internalData.inHeaderScroll = false
85
- internalData.inBodyScroll = false
86
- internalData.inFooterScroll = false
87
- internalData.scrollRenderType = ''
88
- // 还原滚动状态
89
- return $xeTable.scrollTo(scrollLeft, scrollTop)
90
- }
91
- })
75
+ if (scrollLeft || scrollTop) {
76
+ internalData.intoRunScroll = false
77
+ internalData.inVirtualScroll = false
78
+ internalData.inWheelScroll = false
79
+ internalData.inHeaderScroll = false
80
+ internalData.inBodyScroll = false
81
+ internalData.inFooterScroll = false
82
+ internalData.scrollRenderType = ''
83
+ // 还原滚动状态
84
+ return $xeTable.scrollTo(scrollLeft, scrollTop)
85
+ }
86
+ return $xeTable.$nextTick()
92
87
  }
93
88
 
94
89
  export function toTreePathSeq (path: any) {