vxe-table 4.13.40 → 4.13.41
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.
- package/es/style.css +1 -1
- package/es/table/src/cell.js +14 -14
- package/es/toolbar/src/toolbar.js +152 -59
- package/es/ui/index.js +9 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +204 -102
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/cell.js +16 -16
- package/lib/table/src/cell.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +178 -84
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +9 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/toolbar/src/toolbar.ts +154 -56
- /package/es/{iconfont.1750082858834.ttf → iconfont.1750153812846.ttf} +0 -0
- /package/es/{iconfont.1750082858834.woff → iconfont.1750153812846.woff} +0 -0
- /package/es/{iconfont.1750082858834.woff2 → iconfont.1750153812846.woff2} +0 -0
- /package/lib/{iconfont.1750082858834.ttf → iconfont.1750153812846.ttf} +0 -0
- /package/lib/{iconfont.1750082858834.woff → iconfont.1750153812846.woff} +0 -0
- /package/lib/{iconfont.1750082858834.woff2 → iconfont.1750153812846.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${"4.13.
|
|
11
|
+
const version = `table v${"4.13.41"}`;
|
|
12
12
|
const warnLog = exports.warnLog = log.create('warn', version);
|
|
13
13
|
const errLog = exports.errLog = log.create('error', version);
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -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 v4.13.
|
|
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 v4.13.41",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { VxeUI } from '../../ui'
|
|
|
5
5
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
6
6
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
7
7
|
|
|
8
|
-
import type { ValueOf, VxeButtonComponent, VxeButtonEvents, VxeComponentSlotType } from 'vxe-pc-ui'
|
|
8
|
+
import type { ValueOf, VxeButtonComponent, VxeButtonEvents, VxeComponentSlotType, VxeButtonDefines } from 'vxe-pc-ui'
|
|
9
9
|
import type { VxeGridConstructor, GridPrivateMethods, ToolbarMethods, ToolbarInternalData, VxeToolbarConstructor, VxeToolbarEmits, VxeToolbarPropTypes, ToolbarPrivateRef, ToolbarReactData, VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
|
|
10
10
|
|
|
11
11
|
const { getConfig, getIcon, getI18n, renderer, commands, createEvent, useFns } = VxeUI
|
|
@@ -15,11 +15,17 @@ export default defineVxeComponent({
|
|
|
15
15
|
props: {
|
|
16
16
|
loading: Boolean,
|
|
17
17
|
refresh: [Boolean, Object] as PropType<VxeToolbarPropTypes.Refresh>,
|
|
18
|
+
refreshOptions: Object as PropType<VxeToolbarPropTypes.RefreshOptions>,
|
|
18
19
|
import: [Boolean, Object] as PropType<VxeToolbarPropTypes.Import>,
|
|
20
|
+
importOptions: Object as PropType<VxeToolbarPropTypes.ImportOptions>,
|
|
19
21
|
export: [Boolean, Object] as PropType<VxeToolbarPropTypes.Export>,
|
|
22
|
+
exportOptions: Object as PropType<VxeToolbarPropTypes.ExportOptions>,
|
|
20
23
|
print: [Boolean, Object] as PropType<VxeToolbarPropTypes.Print>,
|
|
24
|
+
printOptions: Object as PropType<VxeToolbarPropTypes.PrintOptions>,
|
|
21
25
|
zoom: [Boolean, Object] as PropType< VxeToolbarPropTypes.Zoom>,
|
|
26
|
+
zoomOptions: Object as PropType< VxeToolbarPropTypes.ZoomOptions>,
|
|
22
27
|
custom: [Boolean, Object] as PropType<VxeToolbarPropTypes.Custom>,
|
|
28
|
+
customOptions: Object as PropType<VxeToolbarPropTypes.CustomOptions>,
|
|
23
29
|
buttons: {
|
|
24
30
|
type: Array as PropType<VxeToolbarPropTypes.Buttons>,
|
|
25
31
|
default: () => getConfig().toolbar.buttons
|
|
@@ -82,27 +88,27 @@ export default defineVxeComponent({
|
|
|
82
88
|
const $xeGrid = inject<(VxeGridConstructor & GridPrivateMethods) | null>('$xeGrid', null)
|
|
83
89
|
|
|
84
90
|
const computeRefreshOpts = computed(() => {
|
|
85
|
-
return Object.assign({}, XEUtils.clone(getConfig().toolbar.refresh, true), props.refresh) as VxeToolbarPropTypes.
|
|
91
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.refresh, true), props.refreshOptions, props.refresh) as VxeToolbarPropTypes.RefreshOptions
|
|
86
92
|
})
|
|
87
93
|
|
|
88
94
|
const computeImportOpts = computed(() => {
|
|
89
|
-
return Object.assign({}, XEUtils.clone(getConfig().toolbar.import, true), props.import) as VxeToolbarPropTypes.
|
|
95
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.import, true), props.importOptions, props.import) as VxeToolbarPropTypes.ImportOptions
|
|
90
96
|
})
|
|
91
97
|
|
|
92
98
|
const computeExportOpts = computed(() => {
|
|
93
|
-
return Object.assign({}, XEUtils.clone(getConfig().toolbar.export, true), props.export) as VxeToolbarPropTypes.
|
|
99
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.export, true), props.exportOptions, props.export) as VxeToolbarPropTypes.ExportOptions
|
|
94
100
|
})
|
|
95
101
|
|
|
96
102
|
const computePrintOpts = computed(() => {
|
|
97
|
-
return Object.assign({}, XEUtils.clone(getConfig().toolbar.print, true), props.print) as VxeToolbarPropTypes.
|
|
103
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.print, true), props.printOptions, props.print) as VxeToolbarPropTypes.PrintOptions
|
|
98
104
|
})
|
|
99
105
|
|
|
100
106
|
const computeZoomOpts = computed(() => {
|
|
101
|
-
return Object.assign({}, XEUtils.clone(getConfig().toolbar.zoom, true), props.zoom) as VxeToolbarPropTypes.
|
|
107
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.zoom, true), props.zoomOptions, props.zoom) as VxeToolbarPropTypes.ZoomOptions
|
|
102
108
|
})
|
|
103
109
|
|
|
104
110
|
const computeCustomOpts = computed(() => {
|
|
105
|
-
return Object.assign({}, XEUtils.clone(getConfig().toolbar.custom, true), props.custom) as VxeToolbarPropTypes.
|
|
111
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.custom, true), props.customOptions, props.custom) as VxeToolbarPropTypes.CustomOptions
|
|
106
112
|
})
|
|
107
113
|
|
|
108
114
|
const computeTableCustomOpts = computed(() => {
|
|
@@ -189,66 +195,42 @@ export default defineVxeComponent({
|
|
|
189
195
|
const zoomEvent: VxeButtonEvents.Click = ({ $event }) => {
|
|
190
196
|
if ($xeGrid) {
|
|
191
197
|
$xeGrid.triggerZoomEvent($event)
|
|
198
|
+
} else {
|
|
199
|
+
warnLog('vxe.error.notProp', ['zoom'])
|
|
192
200
|
}
|
|
193
201
|
}
|
|
194
202
|
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
$xeGrid.triggerToolbarBtnEvent(item, evnt)
|
|
202
|
-
} else {
|
|
203
|
-
const gCommandOpts = commands.get(code)
|
|
204
|
-
const params = { code, button: item, $table: $table!, $grid: $xeGrid, $event: evnt }
|
|
205
|
-
if (gCommandOpts) {
|
|
206
|
-
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
|
|
207
|
-
if (tCommandMethod) {
|
|
208
|
-
tCommandMethod(params)
|
|
209
|
-
} else {
|
|
210
|
-
errLog('vxe.error.notCommands', [code])
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
$xeToolbar.dispatchEvent('button-click', params, evnt)
|
|
203
|
+
const importEvent = () => {
|
|
204
|
+
if (checkTable()) {
|
|
205
|
+
const { connectTable } = internalData
|
|
206
|
+
const $table = connectTable
|
|
207
|
+
if ($table) {
|
|
208
|
+
$table.importData()
|
|
214
209
|
}
|
|
215
210
|
}
|
|
216
211
|
}
|
|
217
212
|
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
$xeGrid.triggerToolbarTolEvent(item, evnt)
|
|
225
|
-
} else {
|
|
226
|
-
const gCommandOpts = commands.get(code)
|
|
227
|
-
const params = { code, button: null, tool: item, $table: $table!, $grid: $xeGrid, $event: evnt }
|
|
228
|
-
if (gCommandOpts) {
|
|
229
|
-
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
|
|
230
|
-
if (tCommandMethod) {
|
|
231
|
-
tCommandMethod(params)
|
|
232
|
-
} else {
|
|
233
|
-
errLog('vxe.error.notCommands', [code])
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
$xeToolbar.dispatchEvent('tool-click', params, evnt)
|
|
213
|
+
const openImportEvent = () => {
|
|
214
|
+
if (checkTable()) {
|
|
215
|
+
const { connectTable } = internalData
|
|
216
|
+
const $table = connectTable
|
|
217
|
+
if ($table) {
|
|
218
|
+
$table.openImport()
|
|
237
219
|
}
|
|
238
220
|
}
|
|
239
221
|
}
|
|
240
222
|
|
|
241
|
-
const
|
|
223
|
+
const exportEvent = () => {
|
|
242
224
|
if (checkTable()) {
|
|
243
225
|
const { connectTable } = internalData
|
|
244
226
|
const $table = connectTable
|
|
245
227
|
if ($table) {
|
|
246
|
-
$table.
|
|
228
|
+
$table.exportData()
|
|
247
229
|
}
|
|
248
230
|
}
|
|
249
231
|
}
|
|
250
232
|
|
|
251
|
-
const
|
|
233
|
+
const openExportEvent = () => {
|
|
252
234
|
if (checkTable()) {
|
|
253
235
|
const { connectTable } = internalData
|
|
254
236
|
const $table = connectTable
|
|
@@ -259,6 +241,16 @@ export default defineVxeComponent({
|
|
|
259
241
|
}
|
|
260
242
|
|
|
261
243
|
const printEvent = () => {
|
|
244
|
+
if (checkTable()) {
|
|
245
|
+
const { connectTable } = internalData
|
|
246
|
+
const $table = connectTable
|
|
247
|
+
if ($table) {
|
|
248
|
+
$table.print()
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const openPrintEvent = () => {
|
|
262
254
|
if (checkTable()) {
|
|
263
255
|
const { connectTable } = internalData
|
|
264
256
|
const $table = connectTable
|
|
@@ -268,6 +260,93 @@ export default defineVxeComponent({
|
|
|
268
260
|
}
|
|
269
261
|
}
|
|
270
262
|
|
|
263
|
+
const handleDefaultCodeEvent = (eventParams: VxeButtonDefines.ClickEventParams, item: VxeToolbarPropTypes.ButtonConfig | VxeToolbarPropTypes.ToolConfig, cb: () => void) => {
|
|
264
|
+
switch (item.code) {
|
|
265
|
+
case 'print':
|
|
266
|
+
printEvent()
|
|
267
|
+
break
|
|
268
|
+
case 'open_print':
|
|
269
|
+
openPrintEvent()
|
|
270
|
+
break
|
|
271
|
+
case 'custom':
|
|
272
|
+
handleClickSettingEvent(eventParams)
|
|
273
|
+
break
|
|
274
|
+
case 'export':
|
|
275
|
+
exportEvent()
|
|
276
|
+
break
|
|
277
|
+
case 'open_export':
|
|
278
|
+
openExportEvent()
|
|
279
|
+
break
|
|
280
|
+
case 'import':
|
|
281
|
+
importEvent()
|
|
282
|
+
break
|
|
283
|
+
case 'open_import':
|
|
284
|
+
openImportEvent()
|
|
285
|
+
break
|
|
286
|
+
case 'zoom':
|
|
287
|
+
zoomEvent(eventParams)
|
|
288
|
+
break
|
|
289
|
+
case 'refresh':
|
|
290
|
+
refreshEvent(eventParams)
|
|
291
|
+
break
|
|
292
|
+
default:
|
|
293
|
+
cb()
|
|
294
|
+
break
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const btnEvent = (eventParams: VxeButtonDefines.ClickEventParams, item: VxeToolbarPropTypes.ButtonConfig) => {
|
|
299
|
+
const { $event } = eventParams
|
|
300
|
+
const { connectTable } = internalData
|
|
301
|
+
const $table = connectTable
|
|
302
|
+
const { code } = item
|
|
303
|
+
if (code) {
|
|
304
|
+
handleDefaultCodeEvent(eventParams, item, () => {
|
|
305
|
+
if ($xeGrid) {
|
|
306
|
+
$xeGrid.triggerToolbarBtnEvent(item, $event)
|
|
307
|
+
} else {
|
|
308
|
+
const gCommandOpts = commands.get(code)
|
|
309
|
+
const params = { code, button: item, $table: $table!, $grid: $xeGrid, $event }
|
|
310
|
+
if (gCommandOpts) {
|
|
311
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
|
|
312
|
+
if (tCommandMethod) {
|
|
313
|
+
tCommandMethod(params)
|
|
314
|
+
} else {
|
|
315
|
+
errLog('vxe.error.notCommands', [code])
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
$xeToolbar.dispatchEvent('button-click', params, $event)
|
|
319
|
+
}
|
|
320
|
+
})
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
const tolEvent = (eventParams: VxeButtonDefines.ClickEventParams, item: VxeToolbarPropTypes.ToolConfig) => {
|
|
325
|
+
const { $event } = eventParams
|
|
326
|
+
const { connectTable } = internalData
|
|
327
|
+
const $table = connectTable
|
|
328
|
+
const { code } = item
|
|
329
|
+
if (code) {
|
|
330
|
+
handleDefaultCodeEvent(eventParams, item, () => {
|
|
331
|
+
if ($xeGrid) {
|
|
332
|
+
$xeGrid.triggerToolbarTolEvent(item, $event)
|
|
333
|
+
} else {
|
|
334
|
+
const gCommandOpts = commands.get(code)
|
|
335
|
+
const params = { code, button: null, tool: item, $table: $table!, $grid: $xeGrid, $event }
|
|
336
|
+
if (gCommandOpts) {
|
|
337
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
|
|
338
|
+
if (tCommandMethod) {
|
|
339
|
+
tCommandMethod(params)
|
|
340
|
+
} else {
|
|
341
|
+
errLog('vxe.error.notCommands', [code])
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
$xeToolbar.dispatchEvent('tool-click', params, $event)
|
|
345
|
+
}
|
|
346
|
+
})
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
271
350
|
const dispatchEvent = (type: ValueOf<VxeToolbarEmits>, params: Record<string, any>, evnt: Event | null) => {
|
|
272
351
|
emit(type, createEvent(evnt, { $toolbar: $xeToolbar }, params))
|
|
273
352
|
}
|
|
@@ -308,7 +387,7 @@ export default defineVxeComponent({
|
|
|
308
387
|
permissionCode: child.permissionCode,
|
|
309
388
|
prefixTooltip: child.prefixTooltip,
|
|
310
389
|
suffixTooltip: child.suffixTooltip,
|
|
311
|
-
onClick: (
|
|
390
|
+
onClick: (eventParams) => isBtn ? btnEvent(eventParams, child) : tolEvent(eventParams, child)
|
|
312
391
|
})
|
|
313
392
|
: createCommentVNode()
|
|
314
393
|
})
|
|
@@ -365,7 +444,7 @@ export default defineVxeComponent({
|
|
|
365
444
|
destroyOnClose: item.destroyOnClose,
|
|
366
445
|
placement: item.placement,
|
|
367
446
|
transfer: item.transfer,
|
|
368
|
-
onClick: (
|
|
447
|
+
onClick: (eventParams) => btnEvent(eventParams, item)
|
|
369
448
|
}, dropdowns && dropdowns.length
|
|
370
449
|
? {
|
|
371
450
|
dropdowns: () => renderDropdowns(item, true)
|
|
@@ -433,7 +512,7 @@ export default defineVxeComponent({
|
|
|
433
512
|
destroyOnClose: item.destroyOnClose,
|
|
434
513
|
placement: item.placement,
|
|
435
514
|
transfer: item.transfer,
|
|
436
|
-
onClick: (
|
|
515
|
+
onClick: (eventParams) => tolEvent(eventParams, item)
|
|
437
516
|
}, dropdowns && dropdowns.length
|
|
438
517
|
? {
|
|
439
518
|
dropdowns: () => renderDropdowns(item, false)
|
|
@@ -459,7 +538,7 @@ export default defineVxeComponent({
|
|
|
459
538
|
circle: true,
|
|
460
539
|
icon: importOpts.icon || getIcon().TOOLBAR_TOOLS_IMPORT,
|
|
461
540
|
title: getI18n('vxe.toolbar.import'),
|
|
462
|
-
onClick:
|
|
541
|
+
onClick: openImportEvent
|
|
463
542
|
})
|
|
464
543
|
: createCommentVNode()
|
|
465
544
|
}
|
|
@@ -472,7 +551,7 @@ export default defineVxeComponent({
|
|
|
472
551
|
circle: true,
|
|
473
552
|
icon: exportOpts.icon || getIcon().TOOLBAR_TOOLS_EXPORT,
|
|
474
553
|
title: getI18n('vxe.toolbar.export'),
|
|
475
|
-
onClick:
|
|
554
|
+
onClick: openExportEvent
|
|
476
555
|
})
|
|
477
556
|
: createCommentVNode()
|
|
478
557
|
}
|
|
@@ -485,7 +564,7 @@ export default defineVxeComponent({
|
|
|
485
564
|
circle: true,
|
|
486
565
|
icon: printOpts.icon || getIcon().TOOLBAR_TOOLS_PRINT,
|
|
487
566
|
title: getI18n('vxe.toolbar.print'),
|
|
488
|
-
onClick:
|
|
567
|
+
onClick: openPrintEvent
|
|
489
568
|
})
|
|
490
569
|
: createCommentVNode()
|
|
491
570
|
}
|
|
@@ -584,12 +663,31 @@ export default defineVxeComponent({
|
|
|
584
663
|
$xeToolbar.renderVN = renderVN
|
|
585
664
|
|
|
586
665
|
nextTick(() => {
|
|
587
|
-
const { refresh } = props
|
|
588
666
|
const refreshOpts = computeRefreshOpts.value
|
|
589
667
|
const queryMethod = refreshOpts.queryMethod || refreshOpts.query
|
|
590
|
-
if (refresh && !$xeGrid && !queryMethod) {
|
|
668
|
+
if (props.refresh && !$xeGrid && !queryMethod) {
|
|
591
669
|
warnLog('vxe.error.notFunc', ['queryMethod'])
|
|
592
670
|
}
|
|
671
|
+
|
|
672
|
+
if (XEUtils.isPlainObject(props.custom)) {
|
|
673
|
+
warnLog('vxe.error.delProp', ['custom={...}', 'custom=boolean & custom-options={...}'])
|
|
674
|
+
}
|
|
675
|
+
if (XEUtils.isPlainObject(props.print)) {
|
|
676
|
+
warnLog('vxe.error.delProp', ['print={...}', 'print=boolean & print-options={...}'])
|
|
677
|
+
}
|
|
678
|
+
if (XEUtils.isPlainObject(props.export)) {
|
|
679
|
+
warnLog('vxe.error.delProp', ['export={...}', 'export=boolean & export-options={...}'])
|
|
680
|
+
}
|
|
681
|
+
if (XEUtils.isPlainObject(props.import)) {
|
|
682
|
+
warnLog('vxe.error.delProp', ['import={...}', 'import=boolean & import-options={...}'])
|
|
683
|
+
}
|
|
684
|
+
if (XEUtils.isPlainObject(props.refresh)) {
|
|
685
|
+
warnLog('vxe.error.delProp', ['refresh={...}', 'refresh=boolean & refresh-options={...}'])
|
|
686
|
+
}
|
|
687
|
+
if (XEUtils.isPlainObject(props.refresh)) {
|
|
688
|
+
warnLog('vxe.error.delProp', ['zoom={...}', 'zoom=boolean & zoom-options={...}'])
|
|
689
|
+
}
|
|
690
|
+
|
|
593
691
|
const customOpts = computeCustomOpts.value
|
|
594
692
|
if (customOpts.isFooter) {
|
|
595
693
|
warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter'])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|