vxe-table 4.20.2 → 4.20.4

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 (162) hide show
  1. package/dist/all.esm.js +231 -114
  2. package/dist/style.css +1 -1
  3. package/es/locale/lang/ar-EG.js +7 -0
  4. package/es/locale/lang/de-DE.js +7 -0
  5. package/es/locale/lang/en-US.js +7 -0
  6. package/es/locale/lang/es-ES.js +7 -0
  7. package/es/locale/lang/fr-FR.js +7 -0
  8. package/es/locale/lang/hu-HU.js +7 -0
  9. package/es/locale/lang/hy-AM.js +7 -0
  10. package/es/locale/lang/id-ID.js +7 -0
  11. package/es/locale/lang/it-IT.js +7 -0
  12. package/es/locale/lang/ja-JP.js +7 -0
  13. package/es/locale/lang/ko-KR.js +7 -0
  14. package/es/locale/lang/ms-MY.js +7 -0
  15. package/es/locale/lang/nb-NO.js +7 -0
  16. package/es/locale/lang/pt-BR.js +7 -0
  17. package/es/locale/lang/ru-RU.js +7 -0
  18. package/es/locale/lang/th-TH.js +7 -0
  19. package/es/locale/lang/ug-CN.js +7 -0
  20. package/es/locale/lang/uk-UA.js +7 -0
  21. package/es/locale/lang/uz-UZ.js +7 -0
  22. package/es/locale/lang/vi-VN.js +7 -0
  23. package/es/locale/lang/zh-CHT.js +7 -0
  24. package/es/locale/lang/zh-CN.js +7 -0
  25. package/es/style.css +1 -1
  26. package/es/table/module/export/export-panel.js +61 -47
  27. package/es/table/module/export/hook.js +105 -27
  28. package/es/table/module/export/util.js +1 -1
  29. package/es/table/src/body.js +1 -1
  30. package/es/table/src/footer.js +1 -1
  31. package/es/table/src/header.js +5 -3
  32. package/es/table/src/table.js +48 -34
  33. package/es/table/src/util.js +1 -0
  34. package/es/ui/index.js +2 -1
  35. package/es/ui/src/log.js +1 -1
  36. package/lib/index.umd.js +164 -55
  37. package/lib/index.umd.min.js +1 -1
  38. package/lib/locale/lang/ar-EG.js +7 -0
  39. package/lib/locale/lang/ar-EG.min.js +1 -1
  40. package/lib/locale/lang/ar-EG.umd.js +7 -0
  41. package/lib/locale/lang/de-DE.js +7 -0
  42. package/lib/locale/lang/de-DE.min.js +1 -1
  43. package/lib/locale/lang/de-DE.umd.js +7 -0
  44. package/lib/locale/lang/en-US.js +7 -0
  45. package/lib/locale/lang/en-US.min.js +1 -1
  46. package/lib/locale/lang/en-US.umd.js +7 -0
  47. package/lib/locale/lang/es-ES.js +7 -0
  48. package/lib/locale/lang/es-ES.min.js +1 -1
  49. package/lib/locale/lang/es-ES.umd.js +7 -0
  50. package/lib/locale/lang/fr-FR.js +7 -0
  51. package/lib/locale/lang/fr-FR.min.js +1 -1
  52. package/lib/locale/lang/fr-FR.umd.js +7 -0
  53. package/lib/locale/lang/hu-HU.js +7 -0
  54. package/lib/locale/lang/hu-HU.min.js +1 -1
  55. package/lib/locale/lang/hu-HU.umd.js +7 -0
  56. package/lib/locale/lang/hy-AM.js +7 -0
  57. package/lib/locale/lang/hy-AM.min.js +1 -1
  58. package/lib/locale/lang/hy-AM.umd.js +7 -0
  59. package/lib/locale/lang/id-ID.js +7 -0
  60. package/lib/locale/lang/id-ID.min.js +1 -1
  61. package/lib/locale/lang/id-ID.umd.js +7 -0
  62. package/lib/locale/lang/it-IT.js +7 -0
  63. package/lib/locale/lang/it-IT.min.js +1 -1
  64. package/lib/locale/lang/it-IT.umd.js +7 -0
  65. package/lib/locale/lang/ja-JP.js +7 -0
  66. package/lib/locale/lang/ja-JP.min.js +1 -1
  67. package/lib/locale/lang/ja-JP.umd.js +7 -0
  68. package/lib/locale/lang/ko-KR.js +7 -0
  69. package/lib/locale/lang/ko-KR.min.js +1 -1
  70. package/lib/locale/lang/ko-KR.umd.js +7 -0
  71. package/lib/locale/lang/ms-MY.js +7 -0
  72. package/lib/locale/lang/ms-MY.min.js +1 -1
  73. package/lib/locale/lang/ms-MY.umd.js +7 -0
  74. package/lib/locale/lang/nb-NO.js +7 -0
  75. package/lib/locale/lang/nb-NO.min.js +1 -1
  76. package/lib/locale/lang/nb-NO.umd.js +7 -0
  77. package/lib/locale/lang/pt-BR.js +7 -0
  78. package/lib/locale/lang/pt-BR.min.js +1 -1
  79. package/lib/locale/lang/pt-BR.umd.js +7 -0
  80. package/lib/locale/lang/ru-RU.js +7 -0
  81. package/lib/locale/lang/ru-RU.min.js +1 -1
  82. package/lib/locale/lang/ru-RU.umd.js +7 -0
  83. package/lib/locale/lang/th-TH.js +7 -0
  84. package/lib/locale/lang/th-TH.min.js +1 -1
  85. package/lib/locale/lang/th-TH.umd.js +7 -0
  86. package/lib/locale/lang/ug-CN.js +7 -0
  87. package/lib/locale/lang/ug-CN.min.js +1 -1
  88. package/lib/locale/lang/ug-CN.umd.js +7 -0
  89. package/lib/locale/lang/uk-UA.js +7 -0
  90. package/lib/locale/lang/uk-UA.min.js +1 -1
  91. package/lib/locale/lang/uk-UA.umd.js +7 -0
  92. package/lib/locale/lang/uz-UZ.js +7 -0
  93. package/lib/locale/lang/uz-UZ.min.js +1 -1
  94. package/lib/locale/lang/uz-UZ.umd.js +7 -0
  95. package/lib/locale/lang/vi-VN.js +7 -0
  96. package/lib/locale/lang/vi-VN.min.js +1 -1
  97. package/lib/locale/lang/vi-VN.umd.js +7 -0
  98. package/lib/locale/lang/zh-CHT.js +7 -0
  99. package/lib/locale/lang/zh-CHT.min.js +1 -1
  100. package/lib/locale/lang/zh-CHT.umd.js +7 -0
  101. package/lib/locale/lang/zh-CN.js +7 -0
  102. package/lib/locale/lang/zh-CN.min.js +1 -1
  103. package/lib/locale/lang/zh-CN.umd.js +7 -0
  104. package/lib/style.css +1 -1
  105. package/lib/table/module/export/export-panel.js +32 -13
  106. package/lib/table/module/export/export-panel.min.js +1 -1
  107. package/lib/table/module/export/hook.js +105 -27
  108. package/lib/table/module/export/hook.min.js +1 -1
  109. package/lib/table/module/export/util.js +1 -1
  110. package/lib/table/module/export/util.min.js +1 -1
  111. package/lib/table/src/body.js +1 -1
  112. package/lib/table/src/body.min.js +1 -1
  113. package/lib/table/src/footer.js +1 -1
  114. package/lib/table/src/footer.min.js +1 -1
  115. package/lib/table/src/header.js +6 -3
  116. package/lib/table/src/header.min.js +1 -1
  117. package/lib/table/src/table.js +7 -7
  118. package/lib/table/src/table.min.js +1 -1
  119. package/lib/table/src/util.js +1 -0
  120. package/lib/table/src/util.min.js +1 -1
  121. package/lib/ui/index.js +2 -1
  122. package/lib/ui/index.min.js +1 -1
  123. package/lib/ui/src/log.js +1 -1
  124. package/lib/ui/src/log.min.js +1 -1
  125. package/package.json +2 -2
  126. package/packages/locale/lang/ar-EG.ts +7 -0
  127. package/packages/locale/lang/de-DE.ts +7 -0
  128. package/packages/locale/lang/en-US.ts +7 -0
  129. package/packages/locale/lang/es-ES.ts +7 -0
  130. package/packages/locale/lang/fr-FR.ts +7 -0
  131. package/packages/locale/lang/hu-HU.ts +7 -0
  132. package/packages/locale/lang/hy-AM.ts +7 -0
  133. package/packages/locale/lang/id-ID.ts +7 -0
  134. package/packages/locale/lang/it-IT.ts +7 -0
  135. package/packages/locale/lang/ja-JP.ts +7 -0
  136. package/packages/locale/lang/ko-KR.ts +7 -0
  137. package/packages/locale/lang/ms-MY.ts +7 -0
  138. package/packages/locale/lang/nb-NO.ts +7 -0
  139. package/packages/locale/lang/pt-BR.ts +7 -0
  140. package/packages/locale/lang/ru-RU.ts +7 -0
  141. package/packages/locale/lang/th-TH.ts +7 -0
  142. package/packages/locale/lang/ug-CN.ts +7 -0
  143. package/packages/locale/lang/uk-UA.ts +7 -0
  144. package/packages/locale/lang/uz-UZ.ts +7 -0
  145. package/packages/locale/lang/vi-VN.ts +7 -0
  146. package/packages/locale/lang/zh-CHT.ts +7 -0
  147. package/packages/locale/lang/zh-CN.ts +7 -0
  148. package/packages/table/module/export/export-panel.ts +120 -105
  149. package/packages/table/module/export/hook.ts +112 -28
  150. package/packages/table/module/export/util.ts +1 -1
  151. package/packages/table/src/body.ts +1 -1
  152. package/packages/table/src/footer.ts +1 -1
  153. package/packages/table/src/header.ts +5 -3
  154. package/packages/table/src/table.ts +48 -34
  155. package/packages/table/src/util.ts +3 -2
  156. package/packages/ui/index.ts +1 -0
  157. /package/es/{iconfont.1784122393131.ttf → iconfont.1784366386890.ttf} +0 -0
  158. /package/es/{iconfont.1784122393131.woff → iconfont.1784366386890.woff} +0 -0
  159. /package/es/{iconfont.1784122393131.woff2 → iconfont.1784366386890.woff2} +0 -0
  160. /package/lib/{iconfont.1784122393131.ttf → iconfont.1784366386890.ttf} +0 -0
  161. /package/lib/{iconfont.1784122393131.woff → iconfont.1784366386890.woff} +0 -0
  162. /package/lib/{iconfont.1784122393131.woff2 → iconfont.1784366386890.woff2} +0 -0
@@ -4,7 +4,7 @@ import XEUtils from 'xe-utils'
4
4
  import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollTopTo, wheelScrollLeftTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement, hasEventInputTarget } from '../../ui/src/dom'
5
5
  import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
6
6
  import { VxeUI } from '../../ui'
7
- import { createReactData, createInternalData, getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn, getRowMaxHeight, handleCustomStoreConfig } from './util'
7
+ import { createReactData, createInternalData, getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn, getRowMaxHeight, handleCustomStoreConfig, encodeRowid } from './util'
8
8
  import { getSlotVNs } from '../../ui/src/vn'
9
9
  import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime'
10
10
  import { createComponentLog } from '../../ui/src/log'
@@ -2927,7 +2927,8 @@ export default defineVxeComponent({
2927
2927
  handleCheckedAllCheckboxRow(true, true)
2928
2928
  } else if (checkRowKeys) {
2929
2929
  const defSelection: any[] = []
2930
- checkRowKeys.forEach((rowid: any) => {
2930
+ checkRowKeys.forEach((rowKey: any) => {
2931
+ const rowid = encodeRowid(rowKey)
2931
2932
  if (fullDataRowIdData[rowid]) {
2932
2933
  defSelection.push(fullDataRowIdData[rowid].row)
2933
2934
  }
@@ -2945,7 +2946,8 @@ export default defineVxeComponent({
2945
2946
  if (radioConfig) {
2946
2947
  const { fullDataRowIdData } = internalData
2947
2948
  const radioOpts = computeRadioOpts.value
2948
- const { checkRowKey: rowid, reserve } = radioOpts
2949
+ const { checkRowKey: rowKey, reserve } = radioOpts
2950
+ const rowid = rowKey ? encodeRowid(rowKey) : null
2949
2951
  if (rowid) {
2950
2952
  if (fullDataRowIdData[rowid]) {
2951
2953
  handleCheckedRadioRow(fullDataRowIdData[rowid].row, true)
@@ -2971,7 +2973,8 @@ export default defineVxeComponent({
2971
2973
  $xeTable.setAllRowExpand(true)
2972
2974
  } else if (expandRowKeys) {
2973
2975
  const defExpandeds: any[] = []
2974
- expandRowKeys.forEach((rowid: any) => {
2976
+ expandRowKeys.forEach((rowKey: any) => {
2977
+ const rowid = encodeRowid(rowKey)
2975
2978
  if (fullDataRowIdData[rowid]) {
2976
2979
  defExpandeds.push(fullDataRowIdData[rowid].row)
2977
2980
  }
@@ -3228,7 +3231,8 @@ export default defineVxeComponent({
3228
3231
  $xeTable.setAllTreeExpand(true)
3229
3232
  } else if (expandRowKeys) {
3230
3233
  const defExpandeds: any[] = []
3231
- expandRowKeys.forEach((rowid) => {
3234
+ expandRowKeys.forEach((rowKey) => {
3235
+ const rowid = encodeRowid(rowKey)
3232
3236
  const rowRest = fullAllDataRowIdData[rowid]
3233
3237
  if (rowRest) {
3234
3238
  defExpandeds.push(rowRest.row)
@@ -6584,13 +6588,14 @@ export default defineVxeComponent({
6584
6588
  }
6585
6589
  return handleCheckedCheckboxRow(rows, checked, true)
6586
6590
  },
6587
- setCheckboxRowKey (keys: any, checked) {
6591
+ setCheckboxRowByKey (keys: any, checked) {
6588
6592
  const { fullAllDataRowIdData } = internalData
6589
6593
  if (!XEUtils.isArray(keys)) {
6590
6594
  keys = [keys]
6591
6595
  }
6592
6596
  const rows: any = []
6593
- keys.forEach((rowid: string) => {
6597
+ keys.forEach((rowKey: string) => {
6598
+ const rowid = encodeRowid(rowKey)
6594
6599
  const rowRest = fullAllDataRowIdData[rowid]
6595
6600
  if (rowRest) {
6596
6601
  rows.push(rowRest.row)
@@ -6598,6 +6603,9 @@ export default defineVxeComponent({
6598
6603
  })
6599
6604
  return handleCheckedCheckboxRow(rows, checked, true)
6600
6605
  },
6606
+ setCheckboxRowKey (keys, checked) {
6607
+ return $xeTable.setCheckboxRowByKey(keys, checked)
6608
+ },
6601
6609
  isCheckedByCheckboxRow (row) {
6602
6610
  const { updateCheckboxFlag } = reactData
6603
6611
  const { selectCheckboxMaps } = internalData
@@ -6608,11 +6616,12 @@ export default defineVxeComponent({
6608
6616
  }
6609
6617
  return !!updateCheckboxFlag && !!selectCheckboxMaps[getRowid($xeTable, row)]
6610
6618
  },
6611
- isCheckedByCheckboxRowKey (rowid: any) {
6619
+ isCheckedByCheckboxRowKey (rowKey: any) {
6612
6620
  const { updateCheckboxFlag } = reactData
6613
6621
  const { fullAllDataRowIdData, selectCheckboxMaps } = internalData
6614
6622
  const checkboxOpts = computeCheckboxOpts.value
6615
6623
  const { checkField } = checkboxOpts
6624
+ const rowid = encodeRowid(rowKey)
6616
6625
  if (checkField) {
6617
6626
  const rowRest = fullAllDataRowIdData[rowid]
6618
6627
  if (rowRest) {
@@ -6626,8 +6635,9 @@ export default defineVxeComponent({
6626
6635
  const { treeIndeterminateRowMaps } = internalData
6627
6636
  return !!treeIndeterminateRowMaps[getRowid($xeTable, row)] && !$xeTable.isCheckedByCheckboxRow(row)
6628
6637
  },
6629
- isIndeterminateByCheckboxRowKey (rowid: any) {
6638
+ isIndeterminateByCheckboxRowKey (rowKey: any) {
6630
6639
  const { treeIndeterminateRowMaps } = internalData
6640
+ const rowid = encodeRowid(rowKey)
6631
6641
  return !!treeIndeterminateRowMaps[rowid] && !$xeTable.isCheckedByCheckboxRowKey(rowid)
6632
6642
  },
6633
6643
  /**
@@ -6815,14 +6825,18 @@ export default defineVxeComponent({
6815
6825
  * 用于单选行,设置某一行为选中状态
6816
6826
  * @param key 行主键
6817
6827
  */
6818
- setRadioRowKey (rowid: any) {
6828
+ setRadioByRowKey (rowKey: any) {
6819
6829
  const { fullAllDataRowIdData } = internalData
6830
+ const rowid = encodeRowid(rowKey)
6820
6831
  const rowRest = fullAllDataRowIdData[rowid]
6821
6832
  if (rowRest) {
6822
6833
  return handleCheckedRadioRow(rowRest.row, true)
6823
6834
  }
6824
6835
  return nextTick()
6825
6836
  },
6837
+ setRadioRowKey (rowKey) {
6838
+ return $xeTable.setRadioByRowKey(rowKey)
6839
+ },
6826
6840
  /**
6827
6841
  * 用于当前行,手动清空当前高亮的状态
6828
6842
  */
@@ -14933,35 +14947,35 @@ export default defineVxeComponent({
14933
14947
  })
14934
14948
 
14935
14949
  nextTick(() => {
14950
+ const { showOverflow, showHeaderOverflow, showFooterOverflow } = props
14951
+ const tooltipOpts = computeTooltipOpts.value
14952
+ const headerTooltipOpts = computeHeaderTooltipOpts.value
14953
+ const footerTooltipOpts = computeFooterTooltipOpts.value
14936
14954
  if (props.loading) {
14937
14955
  if (!VxeUILoadingComponent && !slots.loading) {
14938
- errLog('vxe.error.errProp', ['loading=true', 'loading=false | <template #loading>...</template>'])
14939
14956
  errLog('vxe.error.reqComp', ['vxe-loading'])
14957
+ errLog('vxe.error.errProp', ['loading=true', 'loading=false | <template #loading>...</template>'])
14940
14958
  }
14941
14959
  }
14942
- if ((props.showOverflow === true || props.showOverflow === 'tooltip') ||
14943
- (props.showHeaderOverflow === true || props.showHeaderOverflow === 'tooltip') ||
14944
- (props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip')) {
14945
- if (!VxeUITooltipComponent) {
14946
- if (props.showOverflow === true) {
14947
- errLog('vxe.error.errProp', ['show-overflow=true', 'show-overflow=title'])
14948
- }
14949
- if (props.showOverflow === 'tooltip') {
14950
- errLog('vxe.error.errProp', ['show-overflow=tooltip', 'show-overflow=title'])
14951
- }
14952
- if (props.showHeaderOverflow === true) {
14953
- errLog('vxe.error.errProp', ['show-header-overflow=true', 'show-header-overflow=title'])
14954
- }
14955
- if (props.showHeaderOverflow === 'tooltip') {
14956
- errLog('vxe.error.errProp', ['show-header-overflow=tooltip', 'show-header-overflow=title'])
14957
- }
14958
- if (props.showFooterOverflow === true) {
14959
- errLog('vxe.error.errProp', ['show-footer-overflow=true', 'show-footer-overflow=title'])
14960
- }
14961
- if (props.showFooterOverflow === 'tooltip') {
14962
- errLog('vxe.error.errProp', ['show-footer-overflow=tooltip', 'show-footer-overflow=title'])
14963
- }
14964
- errLog('vxe.error.reqComp', ['vxe-tooltip'])
14960
+ if (!VxeUITooltipComponent) {
14961
+ errLog('vxe.error.reqComp', ['vxe-tooltip'])
14962
+ if (showOverflow === 'tooltip') {
14963
+ errLog('vxe.error.errProp', ['show-overflow=' + showOverflow, 'show-overflow=false,title,ellipsis'])
14964
+ }
14965
+ if (showOverflow === true && tooltipOpts.mode === 'tooltip') {
14966
+ errLog('vxe.error.notSupportProp', ['show-overflow=' + showOverflow, 'tooltip-config.mode=tooltip', 'tooltip-config.mode=title,ellipsis'])
14967
+ }
14968
+ if (showHeaderOverflow === 'tooltip') {
14969
+ errLog('vxe.error.errProp', ['show-header-overflow=' + showHeaderOverflow, 'show-header-overflow=false,title,ellipsis'])
14970
+ }
14971
+ if (showHeaderOverflow === true && headerTooltipOpts.mode === 'tooltip') {
14972
+ errLog('vxe.error.notSupportProp', ['show-header-overflow=' + showHeaderOverflow, 'header-tooltip-config.mode=tooltip', 'header-tooltip-config.mode=title,ellipsis'])
14973
+ }
14974
+ if (showFooterOverflow === 'tooltip') {
14975
+ errLog('vxe.error.errProp', ['show-footer-overflow=' + showFooterOverflow, 'show-footer-overflow=false,title,ellipsis'])
14976
+ }
14977
+ if (showFooterOverflow === true && footerTooltipOpts.mode === 'tooltip') {
14978
+ errLog('vxe.error.notSupportProp', ['show-footer-overflow=' + showFooterOverflow, 'footer-tooltip-config.mode=tooltip', 'footer-tooltip-config.mode=title,ellipsis'])
14965
14979
  }
14966
14980
  }
14967
14981
  })
@@ -390,6 +390,7 @@ export function createReactData (): TableReactData {
390
390
  mergeFootFlag: 1,
391
391
 
392
392
  rowHeightStore: {
393
+ xlarge: 54,
393
394
  large: 52,
394
395
  default: 48,
395
396
  medium: 44,
@@ -651,11 +652,11 @@ export function createHandleGetRowId ($xeTable: VxeTableConstructor) {
651
652
  }
652
653
 
653
654
  // 编码行主键
654
- export function encodeRowid (rowVal: string) {
655
+ export function encodeRowid (rowVal: string | number) {
655
656
  return XEUtils.eqNull(rowVal) ? '' : encodeURIComponent(rowVal)
656
657
  }
657
658
 
658
- function getDeepRowIdByKey (row: any, rowKey: string) {
659
+ function getDeepRowIdByKey (row: any, rowKey: string | number) {
659
660
  return XEUtils.get(row, rowKey)
660
661
  }
661
662
 
@@ -72,6 +72,7 @@ VxeUI.setConfig({
72
72
  strict: true
73
73
  },
74
74
  tooltipConfig: {
75
+ mode: 'tooltip',
75
76
  enterable: true,
76
77
  defaultPlacement: 'top'
77
78
  },