vxe-table 3.11.22 → 3.11.24

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 (98) hide show
  1. package/es/locale/lang/ar-EG.js +1 -1
  2. package/es/locale/lang/de-DE.js +1 -1
  3. package/es/locale/lang/es-ES.js +2 -2
  4. package/es/locale/lang/fr-FR.js +1 -1
  5. package/es/locale/lang/hu-HU.js +1 -1
  6. package/es/locale/lang/hy-AM.js +1 -1
  7. package/es/locale/lang/ja-JP.js +1 -1
  8. package/es/locale/lang/ko-KR.js +1 -1
  9. package/es/locale/lang/nb-NO.js +1 -1
  10. package/es/locale/lang/pt-BR.js +1 -1
  11. package/es/locale/lang/ru-RU.js +1 -1
  12. package/es/locale/lang/ug-CN.js +1 -1
  13. package/es/locale/lang/uk-UA.js +1 -1
  14. package/es/locale/lang/vi-VN.js +1 -1
  15. package/es/locale/lang/zh-CHT.js +1 -1
  16. package/es/locale/lang/zh-CN.js +1 -1
  17. package/es/style.css +1 -1
  18. package/es/table/render/index.js +26 -6
  19. package/es/table/src/methods.js +23 -5
  20. package/es/ui/index.js +1 -1
  21. package/es/ui/src/log.js +1 -1
  22. package/lib/index.umd.js +78 -17
  23. package/lib/index.umd.min.js +1 -1
  24. package/lib/locale/lang/ar-EG.js +1 -1
  25. package/lib/locale/lang/ar-EG.min.js +1 -1
  26. package/lib/locale/lang/de-DE.js +1 -1
  27. package/lib/locale/lang/de-DE.min.js +1 -1
  28. package/lib/locale/lang/es-ES.js +2 -2
  29. package/lib/locale/lang/es-ES.min.js +1 -1
  30. package/lib/locale/lang/es-ES.umd.js +2 -2
  31. package/lib/locale/lang/fr-FR.js +1 -1
  32. package/lib/locale/lang/fr-FR.min.js +1 -1
  33. package/lib/locale/lang/hu-HU.js +1 -1
  34. package/lib/locale/lang/hu-HU.min.js +1 -1
  35. package/lib/locale/lang/hu-HU.umd.js +1 -1
  36. package/lib/locale/lang/hy-AM.js +1 -1
  37. package/lib/locale/lang/hy-AM.min.js +1 -1
  38. package/lib/locale/lang/ja-JP.js +1 -1
  39. package/lib/locale/lang/ja-JP.min.js +1 -1
  40. package/lib/locale/lang/ja-JP.umd.js +1 -1
  41. package/lib/locale/lang/ko-KR.js +1 -1
  42. package/lib/locale/lang/ko-KR.min.js +1 -1
  43. package/lib/locale/lang/ko-KR.umd.js +1 -1
  44. package/lib/locale/lang/nb-NO.js +1 -1
  45. package/lib/locale/lang/nb-NO.min.js +1 -1
  46. package/lib/locale/lang/pt-BR.js +1 -1
  47. package/lib/locale/lang/pt-BR.min.js +1 -1
  48. package/lib/locale/lang/pt-BR.umd.js +1 -1
  49. package/lib/locale/lang/ru-RU.js +1 -1
  50. package/lib/locale/lang/ru-RU.min.js +1 -1
  51. package/lib/locale/lang/ru-RU.umd.js +1 -1
  52. package/lib/locale/lang/ug-CN.js +1 -1
  53. package/lib/locale/lang/ug-CN.min.js +1 -1
  54. package/lib/locale/lang/uk-UA.js +1 -1
  55. package/lib/locale/lang/uk-UA.min.js +1 -1
  56. package/lib/locale/lang/uk-UA.umd.js +1 -1
  57. package/lib/locale/lang/vi-VN.js +1 -1
  58. package/lib/locale/lang/vi-VN.min.js +1 -1
  59. package/lib/locale/lang/zh-CHT.js +1 -1
  60. package/lib/locale/lang/zh-CHT.min.js +1 -1
  61. package/lib/locale/lang/zh-CHT.umd.js +1 -1
  62. package/lib/locale/lang/zh-CN.js +1 -1
  63. package/lib/locale/lang/zh-CN.min.js +1 -1
  64. package/lib/locale/lang/zh-CN.umd.js +1 -1
  65. package/lib/style.css +1 -1
  66. package/lib/table/render/index.js +38 -6
  67. package/lib/table/render/index.min.js +1 -1
  68. package/lib/table/src/methods.js +36 -8
  69. package/lib/table/src/methods.min.js +1 -1
  70. package/lib/ui/index.js +1 -1
  71. package/lib/ui/index.min.js +1 -1
  72. package/lib/ui/src/log.js +1 -1
  73. package/lib/ui/src/log.min.js +1 -1
  74. package/package.json +2 -2
  75. package/packages/locale/lang/ar-EG.ts +1 -1
  76. package/packages/locale/lang/de-DE.ts +1 -1
  77. package/packages/locale/lang/es-ES.ts +2 -2
  78. package/packages/locale/lang/fr-FR.ts +1 -1
  79. package/packages/locale/lang/hu-HU.ts +1 -1
  80. package/packages/locale/lang/hy-AM.ts +1 -1
  81. package/packages/locale/lang/ja-JP.ts +1 -1
  82. package/packages/locale/lang/ko-KR.ts +1 -1
  83. package/packages/locale/lang/nb-NO.ts +1 -1
  84. package/packages/locale/lang/pt-BR.ts +1 -1
  85. package/packages/locale/lang/ru-RU.ts +1 -1
  86. package/packages/locale/lang/ug-CN.ts +1 -1
  87. package/packages/locale/lang/uk-UA.ts +1 -1
  88. package/packages/locale/lang/vi-VN.ts +1 -1
  89. package/packages/locale/lang/zh-CHT.ts +1 -1
  90. package/packages/locale/lang/zh-CN.ts +1 -1
  91. package/packages/table/render/index.ts +24 -5
  92. package/packages/table/src/methods.ts +25 -5
  93. /package/es/{iconfont.1733702408214.ttf → iconfont.1733816028970.ttf} +0 -0
  94. /package/es/{iconfont.1733702408214.woff → iconfont.1733816028970.woff} +0 -0
  95. /package/es/{iconfont.1733702408214.woff2 → iconfont.1733816028970.woff2} +0 -0
  96. /package/lib/{iconfont.1733702408214.ttf → iconfont.1733816028970.ttf} +0 -0
  97. /package/lib/{iconfont.1733702408214.woff → iconfont.1733816028970.woff} +0 -0
  98. /package/lib/{iconfont.1733702408214.woff2 → iconfont.1733816028970.woff2} +0 -0
package/lib/ui/src/log.js CHANGED
@@ -8,6 +8,6 @@ var _core = require("@vxe-ui/core");
8
8
  const {
9
9
  log
10
10
  } = _core.VxeUI;
11
- const version = `table v${"3.11.22"}`;
11
+ const version = `table v${"3.11.24"}`;
12
12
  const warnLog = exports.warnLog = log.create('warn', version);
13
13
  const errLog = exports.errLog = log.create('error', version);
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v3.11.22",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v3.11.24",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "3.11.22",
3
+ "version": "3.11.24",
4
4
  "description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -28,7 +28,7 @@
28
28
  "style": "lib/style.css",
29
29
  "typings": "types/index.d.ts",
30
30
  "dependencies": {
31
- "vxe-pc-ui": "^3.3.25"
31
+ "vxe-pc-ui": "^3.3.27"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@babel/plugin-transform-modules-commonjs": "^7.25.7",
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: '导入失败,请检查字段名和数据格式是否正确',
49
49
  treeNotImp: '树表格不支持导入',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: '导入失败,请检查字段名和数据格式是否正确',
49
49
  treeNotImp: '树表格不支持导入',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -47,8 +47,8 @@ export default {
47
47
  notExp: 'El navegador no es compatible con la importación / exportación.',
48
48
  impFields: 'Error de importación, por favor revise que el nombre del campo y el formato de datos sean correctos.',
49
49
  treeNotImp: 'La tabla de árbol no soporta importación.',
50
- treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
50
+ treeCrossDrag: 'Only the first level of data can be dragged',
51
+ treeDragChild: 'Parent data cannot be dragged into its own child',
52
52
  reqPlugin: 'Optional extension "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: '导入失败,请检查字段名和数据格式是否正确',
49
49
  treeNotImp: '树表格不支持导入',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: 'Az importálás nem sikerült, ellenőrizze, hogy a mezőnév és az adatformátum helyes-e',
49
49
  treeNotImp: 'A fatáblák nem támogatják az importálást',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: '导入失败,请检查字段名和数据格式是否正确',
49
49
  treeNotImp: '树表格不支持导入',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: 'インポートに失敗しました。フィールド名とデータ形式を確認してください',
49
49
  treeNotImp: 'ツリーテーブルはインポートをサポートしていません',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: '导入失败,请检查字段名和数据格式是否正确',
49
49
  treeNotImp: '树表格不支持导入',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: '导入失败,请检查字段名和数据格式是否正确',
49
49
  treeNotImp: '树表格不支持导入',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: 'Falha na importação, verifique se o nome do campo e o formato dos dados estão corretos.',
49
49
  treeNotImp: 'A tabela de árvore não suporta importação.',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: 'Не удалось выполнить импорт. Проверьте правильность имени поля и формата данных.',
49
49
  treeNotImp: 'Древовидные таблицы не поддерживают импорт.',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: 'ئەكىرىشى مەغلۇپ بولدى،سۆز ھەم ئۇچۇر فورماتىنى تەكشۈرۈڭ',
49
49
  treeNotImp: 'دەرەخ شەكىللىك جەدىۋەلنى ئەكىرىشنى قوللىمايدۇ',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: '导入失败,请检查字段名和数据格式是否正确',
49
49
  treeNotImp: '树表格不支持导入',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: '导入失败,请检查字段名和数据格式是否正确',
49
49
  treeNotImp: '树表格不支持导入',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: '匯入失敗,請檢查欄位名稱和資料格式是否正確',
49
49
  treeNotImp: '樹表格不支援導入',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可選擴展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -48,7 +48,7 @@ export default {
48
48
  impFields: '导入失败,请检查字段名和数据格式是否正确',
49
49
  treeNotImp: '树表格不支持导入',
50
50
  treeCrossDrag: '只能拖拽第一层级的数据',
51
- treeDragChild: '父级数据不能拖拽到子级中',
51
+ treeDragChild: '父级数据不能拖拽到自己的子级中',
52
52
  reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
53
53
  },
54
54
  table: {
@@ -617,17 +617,36 @@ renderer.mixin({
617
617
  renderTableCell (h, renderOpts, params) {
618
618
  const { props = {} } = renderOpts
619
619
  const { row, column } = params
620
- const digits = props.digits || getConfig().numberInput?.digits || 2
620
+ const { type } = props
621
621
  let cellValue = XEUtils.get(row, column.field)
622
622
  if (cellValue) {
623
- switch (props.type) {
624
- case 'float':
625
- cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
626
- break
623
+ if (type === 'float') {
624
+ const digits = props.digits || getConfig().numberInput.digits || 1
625
+ cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
626
+ } else if (type === 'amount') {
627
+ const digits = props.digits || getConfig().numberInput.digits || 2
628
+ cellValue = XEUtils.commafy(XEUtils.toNumber(cellValue), { digits })
627
629
  }
628
630
  }
629
631
  return getCellLabelVNs(h, renderOpts, params, cellValue)
630
632
  },
633
+ renderTableFooter (h, renderOpts, params) {
634
+ const { props = {} } = renderOpts
635
+ const { row, column, _columnIndex } = params
636
+ const { type } = props
637
+ // 兼容老模式
638
+ const cellValue = XEUtils.isArray(row) ? row[_columnIndex] : XEUtils.get(row, column.field)
639
+ if (XEUtils.isNumber(cellValue)) {
640
+ if (type === 'float') {
641
+ const digits = props.digits || getConfig().numberInput.digits || 1
642
+ return XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
643
+ } else if (type === 'amount') {
644
+ const digits = props.digits || getConfig().numberInput.digits || 2
645
+ return XEUtils.commafy(XEUtils.toNumber(cellValue), { digits })
646
+ }
647
+ }
648
+ return getFuncText(cellValue, 1)
649
+ },
631
650
  renderTableDefault: defaultEditRender,
632
651
  renderTableFilter: defaultFilterRender,
633
652
  tableFilterDefaultMethod: handleInputFilterMethod
@@ -969,6 +969,9 @@ const Methods = {
969
969
  cacheItem = { row, rowid, seq, index: -1, _index: -1, $index: -1, items, parent, level, height: 0 }
970
970
  }
971
971
  if (isSource) {
972
+ cacheItem.row = row
973
+ cacheItem.items = items
974
+ cacheItem.parent = parent
972
975
  cacheItem.level = level
973
976
  cacheItem.index = treeConfig && parent ? -1 : index
974
977
  fullDataRowIdMaps[rowid] = cacheItem
@@ -4717,13 +4720,30 @@ const Methods = {
4717
4720
  this.emitEvent('radio-change', { oldValue, newValue, ...params }, evnt)
4718
4721
  }
4719
4722
  },
4723
+ triggerCurrentColumnEvent (evnt: any, params: any) {
4724
+ const $xeTable = this
4725
+
4726
+ const columnOpts = $xeTable.computeColumnOpts
4727
+ const { currentMethod } = columnOpts
4728
+ const { column } = params
4729
+ if (!currentMethod || currentMethod({ column })) {
4730
+ $xeTable.setCurrentColumn(column)
4731
+ }
4732
+ },
4720
4733
  triggerCurrentRowEvent (evnt: any, params: any) {
4721
- const { currentRow: oldValue } = this
4734
+ const $xeTable = this
4735
+ const reactData = $xeTable
4736
+
4737
+ const { currentRow: oldValue } = reactData
4738
+ const rowOpts = $xeTable.computeRowOpts
4739
+ const { currentMethod } = rowOpts
4722
4740
  const { row: newValue } = params
4723
4741
  const isChange = oldValue !== newValue
4724
- this.setCurrentRow(newValue)
4725
- if (isChange) {
4726
- this.emitEvent('current-change', { oldValue, newValue, ...params }, evnt)
4742
+ if (!currentMethod || currentMethod({ row: newValue })) {
4743
+ $xeTable.setCurrentRow(newValue)
4744
+ if (isChange) {
4745
+ $xeTable.dispatchEvent('current-change', { oldValue, newValue, ...params }, evnt)
4746
+ }
4727
4747
  }
4728
4748
  },
4729
4749
  /**
@@ -4839,7 +4859,7 @@ const Methods = {
4839
4859
  }
4840
4860
  this.emitEvent('header-cell-click', Object.assign({ triggerResizable, triggerSort, triggerFilter, cell }, params), evnt)
4841
4861
  if (this.columnOpts.isCurrent || this.highlightCurrentColumn) {
4842
- return this.setCurrentColumn(column)
4862
+ this.triggerCurrentColumnEvent(evnt, params)
4843
4863
  }
4844
4864
  return this.$nextTick()
4845
4865
  },