vxe-table 4.23.11 → 4.23.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 (86) hide show
  1. package/dist/all.esm.js +15834 -15806
  2. package/dist/all.esm.min.js +3 -0
  3. package/es/grid/src/grid.js +1665 -1662
  4. package/es/table/src/column.js +39 -36
  5. package/es/table/src/group.js +49 -46
  6. package/es/table/src/table.js +13721 -13706
  7. package/es/toolbar/src/toolbar.js +595 -592
  8. package/es/ui/index.js +2 -1
  9. package/es/ui/src/log.js +1 -1
  10. package/lib/grid/src/grid.js +1665 -1662
  11. package/lib/index.umd.js +15834 -15806
  12. package/lib/index.umd.min.js +3 -3
  13. package/lib/locale/ar-EG.umd.min.js +1 -0
  14. package/lib/locale/de-DE.umd.min.js +1 -0
  15. package/lib/locale/en-US.umd.min.js +1 -0
  16. package/lib/locale/es-ES.umd.min.js +1 -0
  17. package/lib/locale/fr-FR.umd.min.js +1 -0
  18. package/lib/locale/hu-HU.umd.min.js +1 -0
  19. package/lib/locale/hy-AM.umd.min.js +1 -0
  20. package/lib/locale/id-ID.umd.min.js +1 -0
  21. package/lib/locale/it-IT.umd.min.js +1 -0
  22. package/lib/locale/ja-JP.umd.min.js +1 -0
  23. package/lib/locale/ko-KR.umd.min.js +1 -0
  24. package/lib/locale/lang/ar-EG.umd.min.js +1 -0
  25. package/lib/locale/lang/de-DE.umd.min.js +1 -0
  26. package/lib/locale/lang/en-US.umd.min.js +1 -0
  27. package/lib/locale/lang/es-ES.umd.min.js +1 -0
  28. package/lib/locale/lang/fr-FR.umd.min.js +1 -0
  29. package/lib/locale/lang/hu-HU.umd.min.js +1 -0
  30. package/lib/locale/lang/hy-AM.umd.min.js +1 -0
  31. package/lib/locale/lang/id-ID.umd.min.js +1 -0
  32. package/lib/locale/lang/it-IT.umd.min.js +1 -0
  33. package/lib/locale/lang/ja-JP.umd.min.js +1 -0
  34. package/lib/locale/lang/ko-KR.umd.min.js +1 -0
  35. package/lib/locale/lang/ms-MY.umd.min.js +1 -0
  36. package/lib/locale/lang/nb-NO.umd.min.js +1 -0
  37. package/lib/locale/lang/pt-BR.umd.min.js +1 -0
  38. package/lib/locale/lang/ru-RU.umd.min.js +1 -0
  39. package/lib/locale/lang/th-TH.umd.min.js +1 -0
  40. package/lib/locale/lang/ug-CN.umd.min.js +1 -0
  41. package/lib/locale/lang/uk-UA.umd.min.js +1 -0
  42. package/lib/locale/lang/uz-UZ.umd.min.js +1 -0
  43. package/lib/locale/lang/vi-VN.umd.min.js +1 -0
  44. package/lib/locale/lang/zh-CHT.umd.min.js +1 -0
  45. package/lib/locale/lang/zh-CN.umd.min.js +1 -0
  46. package/lib/locale/lang/zh-HK.umd.min.js +1 -0
  47. package/lib/locale/lang/zh-MO.umd.min.js +1 -0
  48. package/lib/locale/lang/zh-TC.umd.min.js +1 -0
  49. package/lib/locale/lang/zh-TW.umd.min.js +1 -0
  50. package/lib/locale/ms-MY.umd.min.js +1 -0
  51. package/lib/locale/nb-NO.umd.min.js +1 -0
  52. package/lib/locale/pt-BR.umd.min.js +1 -0
  53. package/lib/locale/ru-RU.umd.min.js +1 -0
  54. package/lib/locale/th-TH.umd.min.js +1 -0
  55. package/lib/locale/ug-CN.umd.min.js +1 -0
  56. package/lib/locale/uk-UA.umd.min.js +1 -0
  57. package/lib/locale/uz-UZ.umd.min.js +1 -0
  58. package/lib/locale/vi-VN.umd.min.js +1 -0
  59. package/lib/locale/zh-CHT.umd.min.js +1 -0
  60. package/lib/locale/zh-CN.umd.min.js +1 -0
  61. package/lib/locale/zh-HK.umd.min.js +1 -0
  62. package/lib/locale/zh-MO.umd.min.js +1 -0
  63. package/lib/locale/zh-TC.umd.min.js +1 -0
  64. package/lib/locale/zh-TW.umd.min.js +1 -0
  65. package/lib/table/src/column.js +39 -36
  66. package/lib/table/src/group.js +49 -46
  67. package/lib/table/src/table.js +13721 -13706
  68. package/lib/toolbar/src/toolbar.js +595 -592
  69. package/lib/ui/index.js +2 -1
  70. package/lib/ui/src/log.js +1 -1
  71. package/package.json +9 -2
  72. package/packages/grid/src/grid.ts +2 -2
  73. package/packages/table/src/column.ts +2 -2
  74. package/packages/table/src/group.ts +2 -2
  75. package/packages/table/src/table.ts +55 -26
  76. package/packages/toolbar/src/toolbar.ts +2 -2
  77. package/packages/ui/index.ts +1 -0
  78. /package/dist/{iconfont.1793016957545.ttf → iconfont.1793090564415.ttf} +0 -0
  79. /package/dist/{iconfont.1793016957545.woff → iconfont.1793090564415.woff} +0 -0
  80. /package/dist/{iconfont.1793016957545.woff2 → iconfont.1793090564415.woff2} +0 -0
  81. /package/es/{iconfont.1793016957545.ttf → iconfont.1793090564415.ttf} +0 -0
  82. /package/es/{iconfont.1793016957545.woff → iconfont.1793090564415.woff} +0 -0
  83. /package/es/{iconfont.1793016957545.woff2 → iconfont.1793090564415.woff2} +0 -0
  84. /package/lib/{iconfont.1793016957545.ttf → iconfont.1793090564415.ttf} +0 -0
  85. /package/lib/{iconfont.1793016957545.woff → iconfont.1793090564415.woff} +0 -0
  86. /package/lib/{iconfont.1793016957545.woff2 → iconfont.1793090564415.woff2} +0 -0
package/lib/ui/index.js CHANGED
@@ -33,7 +33,7 @@ __export(ui_exports, {
33
33
  module.exports = __toCommonJS(ui_exports);
34
34
  var import_core = require("@vxe-ui/core");
35
35
  var import_utils = require("./src/utils");
36
- const version = "4.23.11";
36
+ const version = "4.23.12";
37
37
  import_core.VxeUI.version = version;
38
38
  import_core.VxeUI.tableVersion = version;
39
39
  import_core.VxeUI.setConfig({
@@ -143,6 +143,7 @@ import_core.VxeUI.setConfig({
143
143
  },
144
144
  customConfig: {
145
145
  // enabled: false,
146
+ storeDriver: "localStorage",
146
147
  allowVisible: true,
147
148
  allowResizable: true,
148
149
  allowFixed: true,
package/lib/ui/src/log.js CHANGED
@@ -25,7 +25,7 @@ __export(log_exports, {
25
25
  module.exports = __toCommonJS(log_exports);
26
26
  var import_core = require("@vxe-ui/core");
27
27
  const { log } = import_core.VxeUI;
28
- const tableVersion = `table v${"4.23.11"}`;
28
+ const tableVersion = `table v${"4.23.12"}`;
29
29
  function createComponentLog(name) {
30
30
  const uiVersion = import_core.VxeUI.uiVersion ? `ui v${import_core.VxeUI.uiVersion}` : "";
31
31
  const ganttVersion = import_core.VxeUI.ganttVersion ? `gantt v${import_core.VxeUI.ganttVersion}` : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "4.23.11",
3
+ "version": "4.23.12",
4
4
  "description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -75,7 +75,14 @@
75
75
  "typescript": "~5.9.3",
76
76
  "vue": "3.4.27",
77
77
  "vue-router": "~4.5.1",
78
- "vxe-pc-ui": "4.20.31"
78
+ "vxe-pc-ui": "4.20.33"
79
+ },
80
+ "allowScripts": {
81
+ "esbuild@0.28.2": true,
82
+ "@parcel/watcher@2.5.6": true,
83
+ "yorkie@2.0.0": true,
84
+ "core-js@3.49.0": true,
85
+ "es5-ext@0.10.64": true
79
86
  },
80
87
  "vetur": {
81
88
  "tags": "helper/vetur/tags.json",
@@ -254,7 +254,7 @@ function createInternalData(): GridInternalData {
254
254
  }
255
255
  }
256
256
 
257
- export default defineVxeComponent({
257
+ export default /* define-vxe-component start */ defineVxeComponent({
258
258
  name: 'VxeGrid',
259
259
  props: gridProps,
260
260
  emits: gridEmits,
@@ -2226,4 +2226,4 @@ export default defineVxeComponent({
2226
2226
  render() {
2227
2227
  return this.renderVN()
2228
2228
  }
2229
- })
2229
+ }) /* define-vxe-component end */
@@ -145,7 +145,7 @@ export const columnProps = {
145
145
  params: Object as PropType<VxeColumnPropTypes.Params>
146
146
  }
147
147
 
148
- export default defineVxeComponent({
148
+ export default /* define-vxe-component start */ defineVxeComponent({
149
149
  name: 'VxeColumn',
150
150
  props: columnProps,
151
151
  setup(props, { slots }) {
@@ -189,4 +189,4 @@ export default defineVxeComponent({
189
189
 
190
190
  return renderVN
191
191
  }
192
- })
192
+ }) /* define-vxe-component end */
@@ -6,7 +6,7 @@ import Cell from './cell'
6
6
 
7
7
  import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
8
8
 
9
- export default defineVxeComponent({
9
+ export default /* define-vxe-component start */ defineVxeComponent({
10
10
  name: 'VxeColgroup',
11
11
  props: columnProps,
12
12
  setup(props, { slots }) {
@@ -64,4 +64,4 @@ export default defineVxeComponent({
64
64
 
65
65
  return renderVN
66
66
  }
67
- })
67
+ }) /* define-vxe-component end */
@@ -83,7 +83,7 @@ import type {
83
83
 
84
84
  const { warnLog, errLog } = createComponentLog('table')
85
85
 
86
- const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, domUtils, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI
86
+ const { getConfig, getIcon, getI18n, renderer, formats, createEvent, dbUtils, globalResize, interceptor, hooks, domUtils, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI
87
87
 
88
88
  const supportMaxRow = 5e6
89
89
  const customStorageKey = 'VXE_CUSTOM_STORE'
@@ -97,7 +97,7 @@ let crossTableDragRowObj: {
97
97
  $newTable: (VxeTableConstructor & VxeTablePrivateMethods) | null
98
98
  } | null = null
99
99
 
100
- export default defineVxeComponent({
100
+ export default /* define-vxe-component start */ defineVxeComponent({
101
101
  name: 'VxeTable',
102
102
  props: tableProps,
103
103
  emits: tableEmits,
@@ -1080,8 +1080,13 @@ export default defineVxeComponent({
1080
1080
  xegrid: $xeGrid
1081
1081
  } as unknown as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods
1082
1082
 
1083
- const { refTrackXElem, refTrackYElem, refThumbXElem, refThumbYElem, updateThumbSize, updateThumbOffset, clickTrackXEvent, clickTrackYEvent, pointerdownThumbXEvent, pointermoveThumbXEvent, cleatPointerThumbEvent, pointerdownThumbYEvent, pointermoveThumbYEvent } =
1084
- useFns.useInitVScrollbar($xeTable)
1083
+ const customStoreDB = dbUtils
1084
+ ? dbUtils.createStore<VxeTableDefines.CustomStoreData>(customStorageKey, {
1085
+ driver: computeCustomOpts.value.storeDriver
1086
+ })
1087
+ : null
1088
+
1089
+ const { refTrackXElem, refTrackYElem, refThumbXElem, refThumbYElem, updateThumbSize, updateThumbOffset, clickTrackXEvent, clickTrackYEvent, pointerdownThumbXEvent, pointermoveThumbXEvent, cleatPointerThumbEvent, pointerdownThumbYEvent, pointermoveThumbYEvent } = useFns.useInitVScrollbar($xeTable)
1085
1090
 
1086
1091
  const eqCellValue = (newRow: any, oldRow: any, field: string) => {
1087
1092
  const val1 = XEUtils.get(newRow, field)
@@ -1111,19 +1116,43 @@ export default defineVxeComponent({
1111
1116
  return orders[oIndex < orders.length ? oIndex : 0]
1112
1117
  }
1113
1118
 
1114
- const getCustomStorageMap = (id?: string) => {
1115
- const version = getConfig().version
1116
- const rest = XEUtils.toStringJSON(localStorage.getItem(customStorageKey) || '')
1117
- const maps = rest && rest._v === version ? rest : { _v: version }
1118
- return (id ? maps[id] : maps) || {}
1119
+ /**
1120
+ * 获取个性化数据
1121
+ */
1122
+ function getCustomStorageMap(id: string) {
1123
+ if (customStoreDB) {
1124
+ return customStoreDB.getById(id).then(dbRest => dbRest ? dbRest.data : {})
1125
+ }
1126
+
1127
+ // 已废弃,兼容旧版本
1128
+ return new Promise<VxeTableDefines.CustomStoreData>(resolve => {
1129
+ const version = getConfig().version
1130
+ const rest = XEUtils.toStringJSON(localStorage.getItem(customStorageKey) || '')
1131
+ const maps = rest && rest._v === version ? rest : { _v: version }
1132
+ resolve((id ? maps[id] : maps) || {})
1133
+ })
1119
1134
  }
1120
1135
 
1136
+ /**
1137
+ * 更新个性化数据
1138
+ * 储存结构以 id 为 key, 储存个性化数据,上升版本号可以用于重置组件保存的数据
1139
+ * {
1140
+ * [id: string]: VxeTableDefines.CustomStoreData,
1141
+ * v: 1
1142
+ * }
1143
+ */
1121
1144
  const setCustomStorageMap = (id: string, data: any) => {
1145
+ if (customStoreDB) {
1146
+ return customStoreDB.updateById(id, data)
1147
+ }
1148
+
1149
+ // 已废弃,兼容旧版本
1122
1150
  const version = getConfig().version
1123
- const maps = getCustomStorageMap()
1151
+ const rest = XEUtils.toStringJSON(localStorage.getItem(customStorageKey) || '')
1152
+ const maps = rest && rest._v === version ? rest : { _v: version }
1124
1153
  maps[id] = data || undefined
1125
- maps._v = version
1126
1154
  localStorage.setItem(customStorageKey, XEUtils.toJSONString(maps))
1155
+ return Promise.resolve()
1127
1156
  }
1128
1157
 
1129
1158
  const getRecoverRowMaps = (keyMaps: Record<string, any>) => {
@@ -1879,20 +1908,21 @@ export default defineVxeComponent({
1879
1908
  errLog('vxe.error.reqProp', ['id'])
1880
1909
  return
1881
1910
  }
1882
- const storeData: VxeTableDefines.CustomStoreData = getCustomStorageMap(tableId)
1883
- if (restoreStore) {
1884
- return Promise.resolve(restoreStore({ $table: $xeTable, id: tableId, type: 'restore', storeData }))
1885
- .then((storeData) => {
1886
- if (!storeData) {
1887
- return
1888
- }
1889
- return handleCustomRestore(storeData)
1890
- })
1891
- .catch((e) => e)
1892
- } else {
1911
+ return getCustomStorageMap(tableId).then((storeData) => {
1912
+ if (restoreStore) {
1913
+ return Promise.resolve(restoreStore({ $table: $xeTable, id: tableId, type: 'restore', storeData }))
1914
+ .then((storeData) => {
1915
+ if (!storeData) {
1916
+ return
1917
+ }
1918
+ return handleCustomRestore(storeData)
1919
+ })
1920
+ .catch((e) => e)
1921
+ }
1893
1922
  return handleCustomRestore(storeData)
1894
- }
1923
+ })
1895
1924
  }
1925
+ return Promise.resolve()
1896
1926
  }
1897
1927
 
1898
1928
  const updateColumnAllOverflow = () => {
@@ -10691,9 +10721,8 @@ export default defineVxeComponent({
10691
10721
  type,
10692
10722
  storeData
10693
10723
  })
10694
- } else {
10695
- setCustomStorageMap(tableId, type === 'reset' ? null : storeData)
10696
10724
  }
10725
+ return setCustomStorageMap(tableId, type === 'reset' ? null : storeData)
10697
10726
  }
10698
10727
  return nextTick()
10699
10728
  },
@@ -16008,4 +16037,4 @@ export default defineVxeComponent({
16008
16037
  render() {
16009
16038
  return this.renderVN()
16010
16039
  }
16011
- })
16040
+ }) /* define-vxe-component end */
@@ -26,7 +26,7 @@ function createInternalData(): ToolbarInternalData {
26
26
  }
27
27
  }
28
28
 
29
- export default defineVxeComponent({
29
+ export default /* define-vxe-component start */ defineVxeComponent({
30
30
  name: 'VxeToolbar',
31
31
  props: {
32
32
  loading: Boolean,
@@ -765,4 +765,4 @@ export default defineVxeComponent({
765
765
  render() {
766
766
  return this.renderVN()
767
767
  }
768
- })
768
+ }) /* define-vxe-component end */
@@ -116,6 +116,7 @@ VxeUI.setConfig({
116
116
  },
117
117
  customConfig: {
118
118
  // enabled: false,
119
+ storeDriver: 'localStorage',
119
120
  allowVisible: true,
120
121
  allowResizable: true,
121
122
  allowFixed: true,