vxe-table 4.23.7 → 4.23.9

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 (148) hide show
  1. package/dist/all.esm.js +5859 -4018
  2. package/es/colgroup/index.js +1 -1
  3. package/es/column/index.js +1 -1
  4. package/es/components.d.ts +3 -0
  5. package/es/components.js +4 -8
  6. package/es/grid/index.js +1 -1
  7. package/es/grid/src/emits.js +1 -15
  8. package/es/grid/src/grid.js +398 -121
  9. package/es/grid/src/props.js +1 -1
  10. package/es/index.esm.js +6 -0
  11. package/es/index.js +6 -0
  12. package/es/table/index.js +1 -1
  13. package/es/table/module/custom/hook.js +50 -43
  14. package/es/table/module/custom/panel.js +778 -528
  15. package/es/table/module/edit/hook.js +141 -63
  16. package/es/table/module/export/export-panel.js +400 -317
  17. package/es/table/module/export/hook.js +396 -338
  18. package/es/table/module/export/import-panel.js +153 -124
  19. package/es/table/module/filter/hook.js +17 -3
  20. package/es/table/module/filter/panel.js +147 -85
  21. package/es/table/module/keyboard/hook.js +9 -5
  22. package/es/table/module/menu/hook.js +1 -1
  23. package/es/table/module/menu/panel.js +198 -127
  24. package/es/table/module/validator/hook.js +1 -1
  25. package/es/table/render/index.js +152 -99
  26. package/es/table/src/body.js +356 -234
  27. package/es/table/src/cell.js +427 -270
  28. package/es/table/src/columnInfo.js +2 -1
  29. package/es/table/src/footer.js +145 -100
  30. package/es/table/src/group.js +7 -3
  31. package/es/table/src/header.js +230 -173
  32. package/es/table/src/props.js +1 -1
  33. package/es/table/src/table.js +1504 -1031
  34. package/es/table/src/util.js +15 -19
  35. package/es/toolbar/index.js +1 -1
  36. package/es/toolbar/src/toolbar.js +133 -76
  37. package/es/ui/index.d.ts +0 -1
  38. package/es/ui/index.js +1 -2
  39. package/es/ui/src/dom.js +9 -6
  40. package/es/ui/src/log.js +1 -1
  41. package/es/ui/src/utils.d.ts +1 -1
  42. package/es/v-x-e-table/index.d.ts +0 -1
  43. package/es/v-x-e-table/index.js +0 -1
  44. package/lib/colgroup/index.js +5 -5
  45. package/lib/column/index.js +5 -5
  46. package/lib/components.js +8 -12
  47. package/lib/grid/index.js +4 -4
  48. package/lib/grid/src/emits.js +1 -15
  49. package/lib/grid/src/grid.js +419 -142
  50. package/lib/grid/src/props.js +2 -2
  51. package/lib/index.common.js +6 -0
  52. package/lib/index.js +6 -0
  53. package/lib/index.umd.js +5825 -3945
  54. package/lib/index.umd.min.js +3 -3
  55. package/lib/table/index.js +5 -5
  56. package/lib/table/module/custom/hook.js +51 -44
  57. package/lib/table/module/custom/panel.js +790 -540
  58. package/lib/table/module/edit/hook.js +142 -64
  59. package/lib/table/module/export/export-panel.js +406 -323
  60. package/lib/table/module/export/hook.js +419 -361
  61. package/lib/table/module/export/import-panel.js +157 -128
  62. package/lib/table/module/filter/hook.js +18 -4
  63. package/lib/table/module/filter/panel.js +149 -87
  64. package/lib/table/module/keyboard/hook.js +10 -6
  65. package/lib/table/module/menu/hook.js +2 -2
  66. package/lib/table/module/menu/panel.js +199 -128
  67. package/lib/table/module/validator/hook.js +2 -2
  68. package/lib/table/render/index.js +153 -100
  69. package/lib/table/src/body.js +357 -235
  70. package/lib/table/src/cell.js +428 -271
  71. package/lib/table/src/columnInfo.js +3 -2
  72. package/lib/table/src/footer.js +146 -101
  73. package/lib/table/src/group.js +7 -3
  74. package/lib/table/src/header.js +231 -174
  75. package/lib/table/src/props.js +2 -2
  76. package/lib/table/src/table.js +1487 -1045
  77. package/lib/table/src/util.js +15 -19
  78. package/lib/toolbar/index.js +4 -4
  79. package/lib/toolbar/src/toolbar.js +135 -78
  80. package/lib/ui/index.js +1 -3
  81. package/lib/ui/src/dom.js +9 -6
  82. package/lib/ui/src/log.js +1 -1
  83. package/lib/v-x-e-table/index.js +0 -2
  84. package/package.json +8 -3
  85. package/packages/colgroup/index.ts +22 -22
  86. package/packages/column/index.ts +22 -22
  87. package/packages/components.ts +41 -43
  88. package/packages/grid/index.ts +18 -18
  89. package/packages/grid/src/emits.ts +5 -19
  90. package/packages/grid/src/grid.ts +2229 -1925
  91. package/packages/grid/src/props.ts +22 -23
  92. package/packages/index.ts +11 -4
  93. package/packages/locale/lang/fr-FR.ts +15 -15
  94. package/packages/locale/lang/it-IT.ts +4 -4
  95. package/packages/locale/lang/uk-UA.ts +1 -1
  96. package/packages/locale/lang/uz-UZ.ts +13 -13
  97. package/packages/locale/lang/zh-CN.ts +907 -907
  98. package/packages/table/index.ts +26 -26
  99. package/packages/table/module/custom/hook.ts +510 -503
  100. package/packages/table/module/custom/panel.ts +2002 -1743
  101. package/packages/table/module/edit/hook.ts +1224 -1131
  102. package/packages/table/module/export/export-panel.ts +697 -611
  103. package/packages/table/module/export/hook.ts +2160 -2059
  104. package/packages/table/module/export/import-panel.ts +319 -279
  105. package/packages/table/module/export/util.ts +25 -24
  106. package/packages/table/module/filter/hook.ts +519 -501
  107. package/packages/table/module/filter/panel.ts +368 -304
  108. package/packages/table/module/keyboard/hook.ts +498 -494
  109. package/packages/table/module/menu/hook.ts +330 -330
  110. package/packages/table/module/menu/panel.ts +272 -201
  111. package/packages/table/module/validator/hook.ts +653 -635
  112. package/packages/table/render/index.ts +1819 -1744
  113. package/packages/table/src/body.ts +1078 -955
  114. package/packages/table/src/cell.ts +1524 -1359
  115. package/packages/table/src/column.ts +192 -192
  116. package/packages/table/src/columnInfo.ts +232 -232
  117. package/packages/table/src/emits.ts +134 -134
  118. package/packages/table/src/footer.ts +425 -380
  119. package/packages/table/src/group.ts +67 -63
  120. package/packages/table/src/header.ts +642 -581
  121. package/packages/table/src/props.ts +336 -336
  122. package/packages/table/src/store.ts +14 -14
  123. package/packages/table/src/table.ts +16011 -15454
  124. package/packages/table/src/use/cell-view.ts +41 -44
  125. package/packages/table/src/use/index.ts +1 -1
  126. package/packages/table/src/util.ts +1206 -1216
  127. package/packages/toolbar/index.ts +18 -18
  128. package/packages/toolbar/src/toolbar.ts +768 -706
  129. package/packages/ui/index.ts +519 -521
  130. package/packages/ui/src/anime.ts +51 -52
  131. package/packages/ui/src/comp.ts +3 -3
  132. package/packages/ui/src/dom.ts +466 -463
  133. package/packages/ui/src/log.ts +19 -19
  134. package/packages/ui/src/utils.ts +66 -66
  135. package/packages/ui/src/vn.ts +55 -55
  136. package/packages/v-x-e-table/index.d.ts +3 -4
  137. package/packages/v-x-e-table/index.ts +3 -4
  138. package/types/all.d.ts +76 -76
  139. package/types/index.d.ts +4 -4
  140. /package/dist/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
  141. /package/dist/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
  142. /package/dist/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
  143. /package/es/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
  144. /package/es/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
  145. /package/es/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
  146. /package/lib/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
  147. /package/lib/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
  148. /package/lib/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
@@ -1,521 +1,519 @@
1
- import { VxeUI } from '@vxe-ui/core'
2
- import { getFuncText } from './src/utils'
3
-
4
- import type { VxeUploadDefines, VxePrintDefines, VxeGlobalConfig } from 'vxe-pc-ui'
5
-
6
- export const version = process.env.VUE_APP_VXE_VERSION as string
7
-
8
- VxeUI.version = version
9
- VxeUI.tableVersion = version
10
-
11
- VxeUI.setConfig({
12
- emptyCell: ' ',
13
-
14
- table: {
15
- fit: true,
16
- showHeader: true,
17
- animat: true,
18
- delayHover: 250,
19
- autoResize: true,
20
- // minHeight: null,
21
- // keepSource: false,
22
- // showOverflow: null,
23
- // showHeaderOverflow: null,
24
- // showFooterOverflow: null,
25
- // resizeInterval: 500,
26
- // size: null,
27
- // zIndex: null,
28
- // stripe: false,
29
- // border: false,
30
- // round: false,
31
- // emptyText: '暂无数据',
32
- // emptyRender: {
33
- // name: ''
34
- // },
35
- // rowConfig: {
36
- // keyField: '_X_ROW_KEY' // 行数据的唯一主键字段名
37
- // },
38
- resizeConfig: {
39
- // refreshDelay: 20
40
- },
41
- resizableConfig: {
42
- dragMode: 'auto',
43
- showDragTip: true,
44
- isSyncAutoHeight: true,
45
- isSyncAutoWidth: true,
46
- minHeight: 18
47
- },
48
- currentRowConfig: {
49
- strict: true
50
- },
51
- currentColumnConfig: {
52
- strict: true
53
- },
54
- radioConfig: {
55
- // trigger: 'default'
56
- strict: true
57
- },
58
- rowDragConfig: {
59
- showIcon: true,
60
- animation: true,
61
- showGuidesStatus: true,
62
- showDragTip: true
63
- },
64
- columnDragConfig: {
65
- showIcon: true,
66
- animation: true,
67
- showGuidesStatus: true,
68
- showDragTip: true
69
- },
70
- checkboxConfig: {
71
- // trigger: 'default',
72
- strict: true
73
- },
74
- tooltipConfig: {
75
- mode: 'tooltip',
76
- enterable: true,
77
- defaultPlacement: 'top'
78
- },
79
- headerTooltipConfig: {
80
- mode: 'tooltip',
81
- enterable: true
82
- },
83
- footerTooltipConfig: {
84
- mode: 'tooltip',
85
- enterable: true
86
- },
87
- validConfig: {
88
- showErrorMessage: true,
89
- autoClear: true,
90
- autoPos: true,
91
- message: 'inline',
92
- msgMode: 'single',
93
- theme: 'beautify'
94
- },
95
- columnConfig: {
96
- autoOptions: {
97
- isCalcHeader: true,
98
- isCalcBody: true,
99
- isCalcFooter: true
100
- },
101
- maxFixedSize: 4
102
- },
103
- cellConfig: {
104
- padding: true
105
- },
106
- headerCellConfig: {
107
- height: 'unset'
108
- },
109
- footerCellConfig: {
110
- height: 'unset'
111
- },
112
- menuConfig: {
113
- // visibleMethod () {},
114
- // transfer: false,
115
- destroyOnClose: true
116
- },
117
- customConfig: {
118
- // enabled: false,
119
- allowVisible: true,
120
- allowResizable: true,
121
- allowFixed: true,
122
- allowSort: true,
123
- allowAlign: true,
124
- showSortDragButton: true,
125
- showFooter: true,
126
- placement: 'top-right',
127
- // storage: false,
128
- storeOptions: {
129
- visible: true,
130
- resizable: true,
131
- sort: true,
132
- fixed: true,
133
- align: true,
134
- headerAlign: true,
135
- footerAlign: true,
136
- aggFunc: true
137
- },
138
- // autoAggGroupValues: false,
139
- // checkMethod () {},
140
- modalOptions: {
141
- showMaximize: true,
142
- mask: true,
143
- lockView: true,
144
- resize: true,
145
- escClosable: true
146
- },
147
- drawerOptions: {
148
- mask: true,
149
- lockView: true,
150
- escClosable: true,
151
- resize: true
152
- }
153
- },
154
- sortConfig: {
155
- // remote: false,
156
- // trigger: 'default',
157
- // orders: ['asc', 'desc', null],
158
- // sortMethod: null,
159
- showIcon: true,
160
- allowClear: true,
161
- allowBtn: true,
162
- iconLayout: 'vertical'
163
- },
164
- filterConfig: {
165
- // remote: false,
166
- // filterMethod: null,
167
- // isEvery: false,
168
- // transfer: false,
169
- destroyOnClose: true,
170
- multiple: true,
171
- showIcon: true,
172
- maxHeight: 320
173
- },
174
- floatingFilterConfig: {
175
- // enabled: false
176
- },
177
- aggregateConfig: {
178
- padding: true,
179
- placement: 'left',
180
- rowField: 'id',
181
- parentField: '_X_ROW_PARENT_KEY',
182
- childrenField: '_X_ROW_CHILDREN',
183
- mapChildrenField: '_X_ROW_CHILD_LIST',
184
- indent: 20,
185
- showIcon: true,
186
- maxGroupSize: 4,
187
- showAggFuncTitle: true
188
- },
189
- treeConfig: {
190
- padding: true,
191
- rowField: 'id',
192
- parentField: 'parentId',
193
- childrenField: 'children',
194
- hasChildField: 'hasChild',
195
- mapChildrenField: '_X_ROW_CHILD',
196
- indent: 20,
197
- showIcon: true,
198
- showRootLine: true
199
- },
200
- expandConfig: {
201
- // trigger: 'default',
202
- showIcon: true,
203
- mode: 'fixed'
204
- },
205
- editConfig: {
206
- // mode: 'cell',
207
- // cache: true,
208
- showIcon: true,
209
- showAsterisk: true,
210
- autoFocus: true,
211
- isReuseKeep: true
212
- },
213
- importConfig: {
214
- _typeMaps: {
215
- csv: 1,
216
- html: 1,
217
- xml: 1,
218
- txt: 1
219
- }
220
- },
221
- exportConfig: {
222
- _typeMaps: {
223
- csv: 1,
224
- html: 1,
225
- xml: 1,
226
- txt: 1
227
- }
228
- },
229
- printConfig: {
230
- },
231
- mouseConfig: {
232
- extension: true
233
- },
234
- keyboardConfig: {
235
- isAll: true,
236
- isEsc: true
237
- },
238
- areaConfig: {
239
- autoClear: true,
240
- selectCellByHeader: true,
241
- selectCellByBody: true,
242
- extendDirection: {
243
- top: true,
244
- left: true,
245
- bottom: true,
246
- right: true
247
- }
248
- },
249
- clipConfig: {
250
- isCopy: true,
251
- isCut: true,
252
- isPaste: true
253
- },
254
- fnrConfig: {
255
- isFind: true,
256
- isReplace: true
257
- },
258
- virtualXConfig: {
259
- // enabled: false,
260
- gt: 24,
261
- preSize: 1,
262
- oSize: 0
263
- },
264
- virtualYConfig: {
265
- // enabled: false,
266
- // mode: 'wheel',
267
- gt: 100,
268
- preSize: 1,
269
- oSize: 0
270
- },
271
- scrollbarConfig: {
272
- // xConfig: {
273
- // // position: 'bottom',
274
- // // visible: true
275
- // },
276
- // yConfig: {
277
- // // position: 'right',
278
- // // visible: true
279
- // }
280
- },
281
- undoRedoHistoryConfig: {
282
- stackSize: 50
283
- }
284
- },
285
- grid: {
286
- // size: null,
287
- // zoomConfig: {
288
- // escRestore: true
289
- // },
290
- formConfig: {
291
- enabled: true
292
- },
293
- pagerConfig: {
294
- enabled: true
295
- // perfect: false
296
- },
297
- toolbarConfig: {
298
- enabled: true
299
- // perfect: false
300
- },
301
- proxyConfig: {
302
- enabled: true,
303
- autoLoad: true,
304
- showLoading: true,
305
- showResponseMsg: true,
306
- showActionMsg: true,
307
- response: {
308
- list: 'list',
309
- result: 'result',
310
- total: 'page.total',
311
- footerData: 'footerData',
312
- message: 'message'
313
- }
314
- // beforeItem: null,
315
- // beforeColumn: null,
316
- // beforeQuery: null,
317
- // afterQuery: null,
318
- // beforeDelete: null,
319
- // afterDelete: null,
320
- // beforeSave: null,
321
- // afterSave: null
322
- }
323
- },
324
- toolbar: {
325
- // size: null,
326
- // import: {
327
- // mode: 'covering'
328
- // },
329
- // export: {
330
- // types: ['csv', 'html', 'xml', 'txt']
331
- // },
332
- // buttons: []
333
- },
334
-
335
- gantt: {}
336
- })
337
-
338
- const iconPrefix = 'vxe-table-icon-'
339
-
340
- VxeUI.setIcon({
341
- // table
342
- TABLE_SORT_ASC: iconPrefix + 'caret-up',
343
- TABLE_SORT_DESC: iconPrefix + 'caret-down',
344
- TABLE_FILTER_NONE: iconPrefix + 'funnel',
345
- TABLE_FILTER_MATCH: iconPrefix + 'funnel',
346
- TABLE_EDIT: iconPrefix + 'edit',
347
- TABLE_TITLE_PREFIX: iconPrefix + 'question-circle-fill',
348
- TABLE_TITLE_SUFFIX: iconPrefix + 'question-circle-fill',
349
- TABLE_TREE_LOADED: iconPrefix + 'spinner roll',
350
- TABLE_TREE_OPEN: iconPrefix + 'caret-right rotate90',
351
- TABLE_TREE_CLOSE: iconPrefix + 'caret-right',
352
- TABLE_EXPAND_LOADED: iconPrefix + 'spinner roll',
353
- TABLE_EXPAND_OPEN: iconPrefix + 'arrow-right rotate90',
354
- TABLE_EXPAND_CLOSE: iconPrefix + 'arrow-right',
355
- TABLE_CHECKBOX_CHECKED: iconPrefix + 'checkbox-checked-fill',
356
- TABLE_CHECKBOX_UNCHECKED: iconPrefix + 'checkbox-unchecked',
357
- TABLE_CHECKBOX_INDETERMINATE: iconPrefix + 'checkbox-indeterminate-fill',
358
- TABLE_CHECKBOX_DISABLED_UNCHECKED: iconPrefix + 'checkbox-unchecked-fill',
359
- TABLE_RADIO_CHECKED: iconPrefix + 'radio-checked-fill',
360
- TABLE_RADIO_UNCHECKED: iconPrefix + 'radio-unchecked',
361
- TABLE_RADIO_DISABLED_UNCHECKED: iconPrefix + 'radio-unchecked-fill',
362
- TABLE_CUSTOM_SORT: iconPrefix + 'drag-handle',
363
- TABLE_CUSTOM_FIXED_LEFT: iconPrefix + 'fixed-left',
364
- TABLE_CUSTOM_FIXED_RIGHT: iconPrefix + 'fixed-right',
365
- TABLE_CUSTOM_ALIGN_LEFT: iconPrefix + 'align-left',
366
- TABLE_CUSTOM_ALIGN_CENTER: iconPrefix + 'align-center',
367
- TABLE_CUSTOM_ALIGN_RIGHT: iconPrefix + 'align-right',
368
- TABLE_CUSTOM_MOVE_UP: iconPrefix + 'arrows-up',
369
- TABLE_CUSTOM_MOVE_DN: iconPrefix + 'arrows-down',
370
- TABLE_CUSTOM_PUT_TOP: iconPrefix + 'top',
371
- TABLE_CUSTOM_PUT_BOTTOM: iconPrefix + 'bottom',
372
- TABLE_MENU_OPTIONS: iconPrefix + 'arrow-right',
373
- TABLE_MENU_OPTION_LOADING: iconPrefix + 'repeat roll',
374
- TABLE_DRAG_ROW: iconPrefix + 'drag-handle',
375
- TABLE_DRAG_COLUMN: iconPrefix + 'drag-handle',
376
- TABLE_DRAG_STATUS_ROW: iconPrefix + 'sort',
377
- TABLE_DRAG_STATUS_SUB_ROW: iconPrefix + 'add-sub',
378
- TABLE_DRAG_STATUS_AGG_GROUP: iconPrefix + 'grouping',
379
- TABLE_DRAG_STATUS_AGG_VALUES: iconPrefix + 'values',
380
- TABLE_DRAG_STATUS_COLUMN: iconPrefix + 'swap',
381
- TABLE_DRAG_DISABLED: iconPrefix + 'no-drop',
382
- TABLE_ROW_GROUP_OPEN: iconPrefix + 'arrow-right rotate90',
383
- TABLE_ROW_GROUP_CLOSE: iconPrefix + 'arrow-right',
384
- TABLE_AGGREGATE_GROUPING: iconPrefix + 'grouping',
385
- TABLE_AGGREGATE_VALUES: iconPrefix + 'values',
386
- TABLE_AGGREGATE_SORT: iconPrefix + 'drag-handle',
387
- TABLE_AGGREGATE_DELETE: iconPrefix + 'close',
388
-
389
- // toolbar
390
- TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
391
- TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'repeat roll',
392
- TOOLBAR_TOOLS_IMPORT: iconPrefix + 'upload',
393
- TOOLBAR_TOOLS_EXPORT: iconPrefix + 'download',
394
- TOOLBAR_TOOLS_PRINT: iconPrefix + 'print',
395
- TOOLBAR_TOOLS_FULLSCREEN: iconPrefix + 'fullscreen',
396
- TOOLBAR_TOOLS_MINIMIZE: iconPrefix + 'minimize',
397
- TOOLBAR_TOOLS_CUSTOM: iconPrefix + 'setting',
398
- TOOLBAR_TOOLS_FIXED_LEFT: iconPrefix + 'fixed-left',
399
- TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE: iconPrefix + 'fixed-left-fill',
400
- TOOLBAR_TOOLS_FIXED_RIGHT: iconPrefix + 'fixed-right',
401
- TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE: iconPrefix + 'fixed-right-fill'
402
- })
403
-
404
- /**
405
- * 已废弃
406
- * @deprecated
407
- */
408
- export const setup = (options?: VxeGlobalConfig) => {
409
- return VxeUI.setConfig(options)
410
- }
411
- VxeUI.setup = setup
412
- /**
413
- * 已废弃
414
- * @deprecated
415
- */
416
- export const config = (options?: VxeGlobalConfig) => {
417
- return VxeUI.setConfig(options)
418
- }
419
- VxeUI.config = config
420
- /**
421
- * 已废弃
422
- * @deprecated
423
- */
424
- export const t = (key: string, args?: any) => {
425
- return VxeUI.getI18n(key, args)
426
- }
427
- VxeUI.t = t
428
- /**
429
- * 已废弃
430
- * @deprecated
431
- */
432
- export const _t = (content: string | number | boolean | null | undefined, args?: any) => {
433
- return getFuncText(content, args)
434
- }
435
- VxeUI._t = _t
436
-
437
- /**
438
- * 已废弃,兼容老版本
439
- * @deprecated
440
- */
441
- export const VXETable = VxeUI
442
-
443
- /**
444
- * 已废弃,兼容老版本
445
- * @deprecated
446
- */
447
- export const saveFile: VxeUploadDefines.SaveFileFunction = (options) => {
448
- return VxeUI.saveFile(options)
449
- }
450
- /**
451
- * 已废弃,兼容老版本
452
- * @deprecated
453
- */
454
- export const readFile: VxeUploadDefines.ReadFileFunction = (options) => {
455
- return VxeUI.readFile(options)
456
- }
457
- /**
458
- * 已废弃,兼容老版本
459
- * @deprecated
460
- */
461
- export const print: VxePrintDefines.PrintFunction = (options) => {
462
- return VxeUI.print(options)
463
- }
464
- /**
465
- * 已废弃,兼容老版本
466
- * @deprecated
467
- */
468
- export const modal = {
469
- /**
470
- * 已废弃,兼容老版本
471
- * @deprecated
472
- */
473
- get (id: any) {
474
- return VxeUI.modal.get(id)
475
- },
476
- /**
477
- * 已废弃,兼容老版本
478
- * @deprecated
479
- */
480
- close (id: any) {
481
- return VxeUI.modal.close(id)
482
- },
483
- /**
484
- * 已废弃,兼容老版本
485
- * @deprecated
486
- */
487
- open (options: any) {
488
- return VxeUI.modal.open(options)
489
- },
490
- /**
491
- * 已废弃,兼容老版本
492
- * @deprecated
493
- */
494
- alert (content: any, title: any, options: any) {
495
- return VxeUI.modal.alert(content, title, options)
496
- },
497
- /**
498
- * 已废弃,兼容老版本
499
- * @deprecated
500
- */
501
- confirm (content: any, title: any, options: any) {
502
- return VxeUI.modal.confirm(content, title, options)
503
- },
504
- /**
505
- * 已废弃,兼容老版本
506
- * @deprecated
507
- */
508
- message (content: any, options: any) {
509
- return VxeUI.modal.message(content, options)
510
- },
511
- /**
512
- * 已废弃,兼容老版本
513
- * @deprecated
514
- */
515
- notification (content: any, title: any, options: any) {
516
- return VxeUI.modal.notification(content, title, options)
517
- }
518
- }
519
-
520
- export * from '@vxe-ui/core'
521
- export default VxeUI
1
+ import { VxeUI } from '@vxe-ui/core'
2
+ import { getFuncText } from './src/utils'
3
+
4
+ import type { VxeUploadDefines, VxePrintDefines, VxeGlobalConfig } from 'vxe-pc-ui'
5
+
6
+ export const version = process.env.VUE_APP_VXE_VERSION as string
7
+
8
+ VxeUI.version = version
9
+ VxeUI.tableVersion = version
10
+
11
+ VxeUI.setConfig({
12
+ emptyCell: ' ',
13
+
14
+ table: {
15
+ fit: true,
16
+ showHeader: true,
17
+ animat: true,
18
+ delayHover: 250,
19
+ autoResize: true,
20
+ // minHeight: null,
21
+ // keepSource: false,
22
+ // showOverflow: null,
23
+ // showHeaderOverflow: null,
24
+ // showFooterOverflow: null,
25
+ // resizeInterval: 500,
26
+ // size: null,
27
+ // zIndex: null,
28
+ // stripe: false,
29
+ // border: false,
30
+ // round: false,
31
+ // emptyText: '暂无数据',
32
+ // emptyRender: {
33
+ // name: ''
34
+ // },
35
+ // rowConfig: {
36
+ // keyField: '_X_ROW_KEY' // 行数据的唯一主键字段名
37
+ // },
38
+ resizeConfig: {
39
+ // refreshDelay: 20
40
+ },
41
+ resizableConfig: {
42
+ dragMode: 'auto',
43
+ showDragTip: true,
44
+ isSyncAutoHeight: true,
45
+ isSyncAutoWidth: true,
46
+ minHeight: 18
47
+ },
48
+ currentRowConfig: {
49
+ strict: true
50
+ },
51
+ currentColumnConfig: {
52
+ strict: true
53
+ },
54
+ radioConfig: {
55
+ // trigger: 'default'
56
+ strict: true
57
+ },
58
+ rowDragConfig: {
59
+ showIcon: true,
60
+ animation: true,
61
+ showGuidesStatus: true,
62
+ showDragTip: true
63
+ },
64
+ columnDragConfig: {
65
+ showIcon: true,
66
+ animation: true,
67
+ showGuidesStatus: true,
68
+ showDragTip: true
69
+ },
70
+ checkboxConfig: {
71
+ // trigger: 'default',
72
+ strict: true
73
+ },
74
+ tooltipConfig: {
75
+ mode: 'tooltip',
76
+ enterable: true,
77
+ defaultPlacement: 'top'
78
+ },
79
+ headerTooltipConfig: {
80
+ mode: 'tooltip',
81
+ enterable: true
82
+ },
83
+ footerTooltipConfig: {
84
+ mode: 'tooltip',
85
+ enterable: true
86
+ },
87
+ validConfig: {
88
+ showErrorMessage: true,
89
+ autoClear: true,
90
+ autoPos: true,
91
+ message: 'inline',
92
+ msgMode: 'single',
93
+ theme: 'beautify'
94
+ },
95
+ columnConfig: {
96
+ autoOptions: {
97
+ isCalcHeader: true,
98
+ isCalcBody: true,
99
+ isCalcFooter: true
100
+ },
101
+ maxFixedSize: 4
102
+ },
103
+ cellConfig: {
104
+ padding: true
105
+ },
106
+ headerCellConfig: {
107
+ height: 'unset'
108
+ },
109
+ footerCellConfig: {
110
+ height: 'unset'
111
+ },
112
+ menuConfig: {
113
+ // visibleMethod () {},
114
+ // transfer: false,
115
+ destroyOnClose: true
116
+ },
117
+ customConfig: {
118
+ // enabled: false,
119
+ allowVisible: true,
120
+ allowResizable: true,
121
+ allowFixed: true,
122
+ allowSort: true,
123
+ allowAlign: true,
124
+ showSortDragButton: true,
125
+ showFooter: true,
126
+ placement: 'top-right',
127
+ // storage: false,
128
+ storeOptions: {
129
+ visible: true,
130
+ resizable: true,
131
+ sort: true,
132
+ fixed: true,
133
+ align: true,
134
+ headerAlign: true,
135
+ footerAlign: true,
136
+ aggFunc: true
137
+ },
138
+ // autoAggGroupValues: false,
139
+ // checkMethod () {},
140
+ modalOptions: {
141
+ showMaximize: true,
142
+ mask: true,
143
+ lockView: true,
144
+ resize: true,
145
+ escClosable: true
146
+ },
147
+ drawerOptions: {
148
+ mask: true,
149
+ lockView: true,
150
+ escClosable: true,
151
+ resize: true
152
+ }
153
+ },
154
+ sortConfig: {
155
+ // remote: false,
156
+ // trigger: 'default',
157
+ // orders: ['asc', 'desc', null],
158
+ // sortMethod: null,
159
+ showIcon: true,
160
+ allowClear: true,
161
+ allowBtn: true,
162
+ iconLayout: 'vertical'
163
+ },
164
+ filterConfig: {
165
+ // remote: false,
166
+ // filterMethod: null,
167
+ // isEvery: false,
168
+ // transfer: false,
169
+ destroyOnClose: true,
170
+ multiple: true,
171
+ showIcon: true,
172
+ maxHeight: 320
173
+ },
174
+ floatingFilterConfig: {
175
+ // enabled: false
176
+ },
177
+ aggregateConfig: {
178
+ padding: true,
179
+ placement: 'left',
180
+ rowField: 'id',
181
+ parentField: '_X_ROW_PARENT_KEY',
182
+ childrenField: '_X_ROW_CHILDREN',
183
+ mapChildrenField: '_X_ROW_CHILD_LIST',
184
+ indent: 20,
185
+ showIcon: true,
186
+ maxGroupSize: 4,
187
+ showAggFuncTitle: true
188
+ },
189
+ treeConfig: {
190
+ padding: true,
191
+ rowField: 'id',
192
+ parentField: 'parentId',
193
+ childrenField: 'children',
194
+ hasChildField: 'hasChild',
195
+ mapChildrenField: '_X_ROW_CHILD',
196
+ indent: 20,
197
+ showIcon: true,
198
+ showRootLine: true
199
+ },
200
+ expandConfig: {
201
+ // trigger: 'default',
202
+ showIcon: true,
203
+ mode: 'fixed'
204
+ },
205
+ editConfig: {
206
+ // mode: 'cell',
207
+ // cache: true,
208
+ showIcon: true,
209
+ showAsterisk: true,
210
+ autoFocus: true,
211
+ isReuseKeep: true
212
+ },
213
+ importConfig: {
214
+ _typeMaps: {
215
+ csv: 1,
216
+ html: 1,
217
+ xml: 1,
218
+ txt: 1
219
+ }
220
+ },
221
+ exportConfig: {
222
+ _typeMaps: {
223
+ csv: 1,
224
+ html: 1,
225
+ xml: 1,
226
+ txt: 1
227
+ }
228
+ },
229
+ printConfig: {},
230
+ mouseConfig: {
231
+ extension: true
232
+ },
233
+ keyboardConfig: {
234
+ isAll: true,
235
+ isEsc: true
236
+ },
237
+ areaConfig: {
238
+ autoClear: true,
239
+ selectCellByHeader: true,
240
+ selectCellByBody: true,
241
+ extendDirection: {
242
+ top: true,
243
+ left: true,
244
+ bottom: true,
245
+ right: true
246
+ }
247
+ },
248
+ clipConfig: {
249
+ isCopy: true,
250
+ isCut: true,
251
+ isPaste: true
252
+ },
253
+ fnrConfig: {
254
+ isFind: true,
255
+ isReplace: true
256
+ },
257
+ virtualXConfig: {
258
+ // enabled: false,
259
+ gt: 24,
260
+ preSize: 1,
261
+ oSize: 0
262
+ },
263
+ virtualYConfig: {
264
+ // enabled: false,
265
+ // mode: 'wheel',
266
+ gt: 100,
267
+ preSize: 1,
268
+ oSize: 0
269
+ },
270
+ scrollbarConfig: {
271
+ // xConfig: {
272
+ // // position: 'bottom',
273
+ // // visible: true
274
+ // },
275
+ // yConfig: {
276
+ // // position: 'right',
277
+ // // visible: true
278
+ // }
279
+ },
280
+ undoRedoHistoryConfig: {
281
+ stackSize: 50
282
+ }
283
+ },
284
+ grid: {
285
+ // size: null,
286
+ // zoomConfig: {
287
+ // escRestore: true
288
+ // },
289
+ formConfig: {
290
+ enabled: true
291
+ },
292
+ pagerConfig: {
293
+ enabled: true
294
+ // perfect: false
295
+ },
296
+ toolbarConfig: {
297
+ enabled: true
298
+ // perfect: false
299
+ },
300
+ proxyConfig: {
301
+ enabled: true,
302
+ autoLoad: true,
303
+ showLoading: true,
304
+ showResponseMsg: true,
305
+ showActionMsg: true,
306
+ response: {
307
+ list: 'list',
308
+ result: 'result',
309
+ total: 'page.total',
310
+ footerData: 'footerData',
311
+ message: 'message'
312
+ }
313
+ // beforeItem: null,
314
+ // beforeColumn: null,
315
+ // beforeQuery: null,
316
+ // afterQuery: null,
317
+ // beforeDelete: null,
318
+ // afterDelete: null,
319
+ // beforeSave: null,
320
+ // afterSave: null
321
+ }
322
+ },
323
+ toolbar: {
324
+ // size: null,
325
+ // import: {
326
+ // mode: 'covering'
327
+ // },
328
+ // export: {
329
+ // types: ['csv', 'html', 'xml', 'txt']
330
+ // },
331
+ // buttons: []
332
+ },
333
+
334
+ gantt: {}
335
+ })
336
+
337
+ const iconPrefix = 'vxe-table-icon-'
338
+
339
+ VxeUI.setIcon({
340
+ // table
341
+ TABLE_SORT_ASC: iconPrefix + 'caret-up',
342
+ TABLE_SORT_DESC: iconPrefix + 'caret-down',
343
+ TABLE_FILTER_NONE: iconPrefix + 'funnel',
344
+ TABLE_FILTER_MATCH: iconPrefix + 'funnel',
345
+ TABLE_EDIT: iconPrefix + 'edit',
346
+ TABLE_TITLE_PREFIX: iconPrefix + 'question-circle-fill',
347
+ TABLE_TITLE_SUFFIX: iconPrefix + 'question-circle-fill',
348
+ TABLE_TREE_LOADED: iconPrefix + 'spinner roll',
349
+ TABLE_TREE_OPEN: iconPrefix + 'caret-right rotate90',
350
+ TABLE_TREE_CLOSE: iconPrefix + 'caret-right',
351
+ TABLE_EXPAND_LOADED: iconPrefix + 'spinner roll',
352
+ TABLE_EXPAND_OPEN: iconPrefix + 'arrow-right rotate90',
353
+ TABLE_EXPAND_CLOSE: iconPrefix + 'arrow-right',
354
+ TABLE_CHECKBOX_CHECKED: iconPrefix + 'checkbox-checked-fill',
355
+ TABLE_CHECKBOX_UNCHECKED: iconPrefix + 'checkbox-unchecked',
356
+ TABLE_CHECKBOX_INDETERMINATE: iconPrefix + 'checkbox-indeterminate-fill',
357
+ TABLE_CHECKBOX_DISABLED_UNCHECKED: iconPrefix + 'checkbox-unchecked-fill',
358
+ TABLE_RADIO_CHECKED: iconPrefix + 'radio-checked-fill',
359
+ TABLE_RADIO_UNCHECKED: iconPrefix + 'radio-unchecked',
360
+ TABLE_RADIO_DISABLED_UNCHECKED: iconPrefix + 'radio-unchecked-fill',
361
+ TABLE_CUSTOM_SORT: iconPrefix + 'drag-handle',
362
+ TABLE_CUSTOM_FIXED_LEFT: iconPrefix + 'fixed-left',
363
+ TABLE_CUSTOM_FIXED_RIGHT: iconPrefix + 'fixed-right',
364
+ TABLE_CUSTOM_ALIGN_LEFT: iconPrefix + 'align-left',
365
+ TABLE_CUSTOM_ALIGN_CENTER: iconPrefix + 'align-center',
366
+ TABLE_CUSTOM_ALIGN_RIGHT: iconPrefix + 'align-right',
367
+ TABLE_CUSTOM_MOVE_UP: iconPrefix + 'arrows-up',
368
+ TABLE_CUSTOM_MOVE_DN: iconPrefix + 'arrows-down',
369
+ TABLE_CUSTOM_PUT_TOP: iconPrefix + 'top',
370
+ TABLE_CUSTOM_PUT_BOTTOM: iconPrefix + 'bottom',
371
+ TABLE_MENU_OPTIONS: iconPrefix + 'arrow-right',
372
+ TABLE_MENU_OPTION_LOADING: iconPrefix + 'repeat roll',
373
+ TABLE_DRAG_ROW: iconPrefix + 'drag-handle',
374
+ TABLE_DRAG_COLUMN: iconPrefix + 'drag-handle',
375
+ TABLE_DRAG_STATUS_ROW: iconPrefix + 'sort',
376
+ TABLE_DRAG_STATUS_SUB_ROW: iconPrefix + 'add-sub',
377
+ TABLE_DRAG_STATUS_AGG_GROUP: iconPrefix + 'grouping',
378
+ TABLE_DRAG_STATUS_AGG_VALUES: iconPrefix + 'values',
379
+ TABLE_DRAG_STATUS_COLUMN: iconPrefix + 'swap',
380
+ TABLE_DRAG_DISABLED: iconPrefix + 'no-drop',
381
+ TABLE_ROW_GROUP_OPEN: iconPrefix + 'arrow-right rotate90',
382
+ TABLE_ROW_GROUP_CLOSE: iconPrefix + 'arrow-right',
383
+ TABLE_AGGREGATE_GROUPING: iconPrefix + 'grouping',
384
+ TABLE_AGGREGATE_VALUES: iconPrefix + 'values',
385
+ TABLE_AGGREGATE_SORT: iconPrefix + 'drag-handle',
386
+ TABLE_AGGREGATE_DELETE: iconPrefix + 'close',
387
+
388
+ // toolbar
389
+ TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
390
+ TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'repeat roll',
391
+ TOOLBAR_TOOLS_IMPORT: iconPrefix + 'upload',
392
+ TOOLBAR_TOOLS_EXPORT: iconPrefix + 'download',
393
+ TOOLBAR_TOOLS_PRINT: iconPrefix + 'print',
394
+ TOOLBAR_TOOLS_FULLSCREEN: iconPrefix + 'fullscreen',
395
+ TOOLBAR_TOOLS_MINIMIZE: iconPrefix + 'minimize',
396
+ TOOLBAR_TOOLS_CUSTOM: iconPrefix + 'setting',
397
+ TOOLBAR_TOOLS_FIXED_LEFT: iconPrefix + 'fixed-left',
398
+ TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE: iconPrefix + 'fixed-left-fill',
399
+ TOOLBAR_TOOLS_FIXED_RIGHT: iconPrefix + 'fixed-right',
400
+ TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE: iconPrefix + 'fixed-right-fill'
401
+ })
402
+
403
+ /**
404
+ * 已废弃
405
+ * @deprecated
406
+ */
407
+ export const setup = (options?: VxeGlobalConfig) => {
408
+ return VxeUI.setConfig(options)
409
+ }
410
+ VxeUI.setup = setup
411
+ /**
412
+ * 已废弃
413
+ * @deprecated
414
+ */
415
+ export const config = (options?: VxeGlobalConfig) => {
416
+ return VxeUI.setConfig(options)
417
+ }
418
+ VxeUI.config = config
419
+ /**
420
+ * 已废弃
421
+ * @deprecated
422
+ */
423
+ export const t = (key: string, args?: any) => {
424
+ return VxeUI.getI18n(key, args)
425
+ }
426
+ VxeUI.t = t
427
+ /**
428
+ * 已废弃
429
+ * @deprecated
430
+ */
431
+ export const _t = (content: string | number | boolean | null | undefined, args?: any) => {
432
+ return getFuncText(content, args)
433
+ }
434
+ VxeUI._t = _t
435
+
436
+ /**
437
+ * 已废弃,兼容老版本
438
+ * @deprecated
439
+ */
440
+ export const VXETable = VxeUI
441
+
442
+ /**
443
+ * 已废弃,兼容老版本
444
+ * @deprecated
445
+ */
446
+ export const saveFile: VxeUploadDefines.SaveFileFunction = (options) => {
447
+ return VxeUI.saveFile(options)
448
+ }
449
+ /**
450
+ * 已废弃,兼容老版本
451
+ * @deprecated
452
+ */
453
+ export const readFile: VxeUploadDefines.ReadFileFunction = (options) => {
454
+ return VxeUI.readFile(options)
455
+ }
456
+ /**
457
+ * 已废弃,兼容老版本
458
+ * @deprecated
459
+ */
460
+ export const print: VxePrintDefines.PrintFunction = (options) => {
461
+ return VxeUI.print(options)
462
+ }
463
+ /**
464
+ * 已废弃,兼容老版本
465
+ * @deprecated
466
+ */
467
+ export const modal = {
468
+ /**
469
+ * 已废弃,兼容老版本
470
+ * @deprecated
471
+ */
472
+ get(id: any) {
473
+ return VxeUI.modal.get(id)
474
+ },
475
+ /**
476
+ * 已废弃,兼容老版本
477
+ * @deprecated
478
+ */
479
+ close(id: any) {
480
+ return VxeUI.modal.close(id)
481
+ },
482
+ /**
483
+ * 已废弃,兼容老版本
484
+ * @deprecated
485
+ */
486
+ open(options: any) {
487
+ return VxeUI.modal.open(options)
488
+ },
489
+ /**
490
+ * 已废弃,兼容老版本
491
+ * @deprecated
492
+ */
493
+ alert(content: any, title: any, options: any) {
494
+ return VxeUI.modal.alert(content, title, options)
495
+ },
496
+ /**
497
+ * 已废弃,兼容老版本
498
+ * @deprecated
499
+ */
500
+ confirm(content: any, title: any, options: any) {
501
+ return VxeUI.modal.confirm(content, title, options)
502
+ },
503
+ /**
504
+ * 已废弃,兼容老版本
505
+ * @deprecated
506
+ */
507
+ message(content: any, options: any) {
508
+ return VxeUI.modal.message(content, options)
509
+ },
510
+ /**
511
+ * 已废弃,兼容老版本
512
+ * @deprecated
513
+ */
514
+ notification(content: any, title: any, options: any) {
515
+ return VxeUI.modal.notification(content, title, options)
516
+ }
517
+ }
518
+
519
+ export default VxeUI