vxe-table 4.23.8 → 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 (126) hide show
  1. package/dist/all.esm.js +5715 -3783
  2. package/es/components.d.ts +1 -0
  3. package/es/components.js +2 -7
  4. package/es/grid/src/emits.js +1 -15
  5. package/es/grid/src/grid.js +397 -120
  6. package/es/index.esm.js +1 -0
  7. package/es/index.js +1 -0
  8. package/es/table/module/custom/hook.js +49 -42
  9. package/es/table/module/custom/panel.js +777 -527
  10. package/es/table/module/edit/hook.js +140 -62
  11. package/es/table/module/export/export-panel.js +399 -316
  12. package/es/table/module/export/hook.js +395 -337
  13. package/es/table/module/export/import-panel.js +152 -123
  14. package/es/table/module/filter/hook.js +16 -2
  15. package/es/table/module/filter/panel.js +146 -84
  16. package/es/table/module/keyboard/hook.js +8 -4
  17. package/es/table/module/menu/panel.js +197 -126
  18. package/es/table/render/index.js +151 -98
  19. package/es/table/src/body.js +355 -233
  20. package/es/table/src/cell.js +426 -269
  21. package/es/table/src/columnInfo.js +1 -0
  22. package/es/table/src/footer.js +144 -99
  23. package/es/table/src/group.js +7 -3
  24. package/es/table/src/header.js +229 -172
  25. package/es/table/src/table.js +1503 -1030
  26. package/es/table/src/util.js +15 -19
  27. package/es/toolbar/src/toolbar.js +132 -75
  28. package/es/ui/index.js +1 -1
  29. package/es/ui/src/dom.js +9 -6
  30. package/es/ui/src/log.js +1 -1
  31. package/es/ui/src/utils.d.ts +1 -1
  32. package/lib/components.js +2 -7
  33. package/lib/grid/src/emits.js +1 -15
  34. package/lib/grid/src/grid.js +397 -120
  35. package/lib/index.common.js +1 -0
  36. package/lib/index.js +1 -0
  37. package/lib/index.umd.js +5732 -3800
  38. package/lib/index.umd.min.js +3 -3
  39. package/lib/table/module/custom/hook.js +49 -42
  40. package/lib/table/module/custom/panel.js +777 -527
  41. package/lib/table/module/edit/hook.js +140 -62
  42. package/lib/table/module/export/export-panel.js +399 -316
  43. package/lib/table/module/export/hook.js +395 -337
  44. package/lib/table/module/export/import-panel.js +152 -123
  45. package/lib/table/module/filter/hook.js +16 -2
  46. package/lib/table/module/filter/panel.js +146 -84
  47. package/lib/table/module/keyboard/hook.js +8 -4
  48. package/lib/table/module/menu/panel.js +197 -126
  49. package/lib/table/render/index.js +151 -98
  50. package/lib/table/src/body.js +355 -233
  51. package/lib/table/src/cell.js +426 -269
  52. package/lib/table/src/columnInfo.js +1 -0
  53. package/lib/table/src/footer.js +144 -99
  54. package/lib/table/src/group.js +7 -3
  55. package/lib/table/src/header.js +229 -172
  56. package/lib/table/src/table.js +1471 -1029
  57. package/lib/table/src/util.js +15 -19
  58. package/lib/toolbar/src/toolbar.js +132 -75
  59. package/lib/ui/index.js +1 -1
  60. package/lib/ui/src/dom.js +9 -6
  61. package/lib/ui/src/log.js +1 -1
  62. package/package.json +2 -2
  63. package/packages/colgroup/index.ts +22 -22
  64. package/packages/column/index.ts +22 -22
  65. package/packages/components.ts +41 -44
  66. package/packages/grid/index.ts +18 -18
  67. package/packages/grid/src/emits.ts +5 -19
  68. package/packages/grid/src/grid.ts +2229 -1925
  69. package/packages/grid/src/props.ts +22 -23
  70. package/packages/index.ts +11 -11
  71. package/packages/locale/lang/fr-FR.ts +15 -15
  72. package/packages/locale/lang/it-IT.ts +4 -4
  73. package/packages/locale/lang/uk-UA.ts +1 -1
  74. package/packages/locale/lang/uz-UZ.ts +13 -13
  75. package/packages/locale/lang/zh-CN.ts +907 -907
  76. package/packages/table/index.ts +26 -26
  77. package/packages/table/module/custom/hook.ts +510 -503
  78. package/packages/table/module/custom/panel.ts +2002 -1743
  79. package/packages/table/module/edit/hook.ts +1224 -1131
  80. package/packages/table/module/export/export-panel.ts +697 -611
  81. package/packages/table/module/export/hook.ts +2160 -2059
  82. package/packages/table/module/export/import-panel.ts +319 -279
  83. package/packages/table/module/export/util.ts +25 -24
  84. package/packages/table/module/filter/hook.ts +519 -501
  85. package/packages/table/module/filter/panel.ts +368 -304
  86. package/packages/table/module/keyboard/hook.ts +498 -494
  87. package/packages/table/module/menu/hook.ts +330 -330
  88. package/packages/table/module/menu/panel.ts +272 -201
  89. package/packages/table/module/validator/hook.ts +653 -635
  90. package/packages/table/render/index.ts +1819 -1744
  91. package/packages/table/src/body.ts +1078 -955
  92. package/packages/table/src/cell.ts +1524 -1359
  93. package/packages/table/src/column.ts +192 -192
  94. package/packages/table/src/columnInfo.ts +232 -232
  95. package/packages/table/src/emits.ts +134 -134
  96. package/packages/table/src/footer.ts +425 -380
  97. package/packages/table/src/group.ts +67 -63
  98. package/packages/table/src/header.ts +642 -581
  99. package/packages/table/src/props.ts +336 -336
  100. package/packages/table/src/store.ts +14 -14
  101. package/packages/table/src/table.ts +16011 -15454
  102. package/packages/table/src/use/cell-view.ts +41 -44
  103. package/packages/table/src/use/index.ts +1 -1
  104. package/packages/table/src/util.ts +1206 -1216
  105. package/packages/toolbar/index.ts +18 -18
  106. package/packages/toolbar/src/toolbar.ts +768 -706
  107. package/packages/ui/index.ts +519 -520
  108. package/packages/ui/src/anime.ts +51 -52
  109. package/packages/ui/src/comp.ts +3 -3
  110. package/packages/ui/src/dom.ts +466 -463
  111. package/packages/ui/src/log.ts +19 -19
  112. package/packages/ui/src/utils.ts +66 -66
  113. package/packages/ui/src/vn.ts +55 -55
  114. package/packages/v-x-e-table/index.d.ts +3 -3
  115. package/packages/v-x-e-table/index.ts +3 -3
  116. package/types/all.d.ts +76 -76
  117. package/types/index.d.ts +4 -4
  118. /package/dist/{iconfont.1793007753347.ttf → iconfont.1793009263429.ttf} +0 -0
  119. /package/dist/{iconfont.1793007753347.woff → iconfont.1793009263429.woff} +0 -0
  120. /package/dist/{iconfont.1793007753347.woff2 → iconfont.1793009263429.woff2} +0 -0
  121. /package/es/{iconfont.1793007753347.ttf → iconfont.1793009263429.ttf} +0 -0
  122. /package/es/{iconfont.1793007753347.woff → iconfont.1793009263429.woff} +0 -0
  123. /package/es/{iconfont.1793007753347.woff2 → iconfont.1793009263429.woff2} +0 -0
  124. /package/lib/{iconfont.1793007753347.ttf → iconfont.1793009263429.ttf} +0 -0
  125. /package/lib/{iconfont.1793007753347.woff → iconfont.1793009263429.woff} +0 -0
  126. /package/lib/{iconfont.1793007753347.woff2 → iconfont.1793009263429.woff2} +0 -0
@@ -1,520 +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 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