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/es/table/src/cell.js
CHANGED
|
@@ -367,20 +367,6 @@ export const Cell = {
|
|
|
367
367
|
const { field, slots, editRender, cellRender, rowGroupNode, aggFunc } = column;
|
|
368
368
|
const renderOpts = editRender || cellRender;
|
|
369
369
|
const defaultSlot = slots ? slots.default : null;
|
|
370
|
-
if (defaultSlot) {
|
|
371
|
-
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
372
|
-
}
|
|
373
|
-
if (renderOpts) {
|
|
374
|
-
const compConf = renderer.get(renderOpts.name);
|
|
375
|
-
if (compConf) {
|
|
376
|
-
const rtCell = compConf.renderTableCell || compConf.renderCell;
|
|
377
|
-
const rtDefault = compConf.renderTableDefault || compConf.renderDefault;
|
|
378
|
-
const renderFn = editRender ? rtCell : rtDefault;
|
|
379
|
-
if (renderFn) {
|
|
380
|
-
return renderCellBaseVNs(params, getSlotVNs(renderFn(renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params))));
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
370
|
let cellValue = '';
|
|
385
371
|
if (isRowGroupStatus && field && row.isAggregate) {
|
|
386
372
|
const aggRow = row;
|
|
@@ -429,6 +415,20 @@ export const Cell = {
|
|
|
429
415
|
}
|
|
430
416
|
}
|
|
431
417
|
else {
|
|
418
|
+
if (defaultSlot) {
|
|
419
|
+
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
420
|
+
}
|
|
421
|
+
if (renderOpts) {
|
|
422
|
+
const compConf = renderer.get(renderOpts.name);
|
|
423
|
+
if (compConf) {
|
|
424
|
+
const rtCell = compConf.renderTableCell || compConf.renderCell;
|
|
425
|
+
const rtDefault = compConf.renderTableDefault || compConf.renderDefault;
|
|
426
|
+
const renderFn = editRender ? rtCell : rtDefault;
|
|
427
|
+
if (renderFn) {
|
|
428
|
+
return renderCellBaseVNs(params, getSlotVNs(renderFn(renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params))));
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
432
|
cellValue = $table.getCellLabel(row, column);
|
|
433
433
|
}
|
|
434
434
|
const cellPlaceholder = editRender ? editRender.placeholder : '';
|
|
@@ -10,11 +10,17 @@ export default defineVxeComponent({
|
|
|
10
10
|
props: {
|
|
11
11
|
loading: Boolean,
|
|
12
12
|
refresh: [Boolean, Object],
|
|
13
|
+
refreshOptions: Object,
|
|
13
14
|
import: [Boolean, Object],
|
|
15
|
+
importOptions: Object,
|
|
14
16
|
export: [Boolean, Object],
|
|
17
|
+
exportOptions: Object,
|
|
15
18
|
print: [Boolean, Object],
|
|
19
|
+
printOptions: Object,
|
|
16
20
|
zoom: [Boolean, Object],
|
|
21
|
+
zoomOptions: Object,
|
|
17
22
|
custom: [Boolean, Object],
|
|
23
|
+
customOptions: Object,
|
|
18
24
|
buttons: {
|
|
19
25
|
type: Array,
|
|
20
26
|
default: () => getConfig().toolbar.buttons
|
|
@@ -66,22 +72,22 @@ export default defineVxeComponent({
|
|
|
66
72
|
let toolbarMethods = {};
|
|
67
73
|
const $xeGrid = inject('$xeGrid', null);
|
|
68
74
|
const computeRefreshOpts = computed(() => {
|
|
69
|
-
return Object.assign({}, XEUtils.clone(getConfig().toolbar.refresh, true), props.refresh);
|
|
75
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.refresh, true), props.refreshOptions, props.refresh);
|
|
70
76
|
});
|
|
71
77
|
const computeImportOpts = computed(() => {
|
|
72
|
-
return Object.assign({}, XEUtils.clone(getConfig().toolbar.import, true), props.import);
|
|
78
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.import, true), props.importOptions, props.import);
|
|
73
79
|
});
|
|
74
80
|
const computeExportOpts = computed(() => {
|
|
75
|
-
return Object.assign({}, XEUtils.clone(getConfig().toolbar.export, true), props.export);
|
|
81
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.export, true), props.exportOptions, props.export);
|
|
76
82
|
});
|
|
77
83
|
const computePrintOpts = computed(() => {
|
|
78
|
-
return Object.assign({}, XEUtils.clone(getConfig().toolbar.print, true), props.print);
|
|
84
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.print, true), props.printOptions, props.print);
|
|
79
85
|
});
|
|
80
86
|
const computeZoomOpts = computed(() => {
|
|
81
|
-
return Object.assign({}, XEUtils.clone(getConfig().toolbar.zoom, true), props.zoom);
|
|
87
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.zoom, true), props.zoomOptions, props.zoom);
|
|
82
88
|
});
|
|
83
89
|
const computeCustomOpts = computed(() => {
|
|
84
|
-
return Object.assign({}, XEUtils.clone(getConfig().toolbar.custom, true), props.custom);
|
|
90
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.custom, true), props.customOptions, props.custom);
|
|
85
91
|
});
|
|
86
92
|
const computeTableCustomOpts = computed(() => {
|
|
87
93
|
const { connectTable } = internalData;
|
|
@@ -163,56 +169,20 @@ export default defineVxeComponent({
|
|
|
163
169
|
if ($xeGrid) {
|
|
164
170
|
$xeGrid.triggerZoomEvent($event);
|
|
165
171
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
const { connectTable } = internalData;
|
|
169
|
-
const $table = connectTable;
|
|
170
|
-
const { code } = item;
|
|
171
|
-
if (code) {
|
|
172
|
-
if ($xeGrid) {
|
|
173
|
-
$xeGrid.triggerToolbarBtnEvent(item, evnt);
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
const gCommandOpts = commands.get(code);
|
|
177
|
-
const params = { code, button: item, $table: $table, $grid: $xeGrid, $event: evnt };
|
|
178
|
-
if (gCommandOpts) {
|
|
179
|
-
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
180
|
-
if (tCommandMethod) {
|
|
181
|
-
tCommandMethod(params);
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
errLog('vxe.error.notCommands', [code]);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
$xeToolbar.dispatchEvent('button-click', params, evnt);
|
|
188
|
-
}
|
|
172
|
+
else {
|
|
173
|
+
warnLog('vxe.error.notProp', ['zoom']);
|
|
189
174
|
}
|
|
190
175
|
};
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
$xeGrid.triggerToolbarTolEvent(item, evnt);
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
const gCommandOpts = commands.get(code);
|
|
201
|
-
const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $event: evnt };
|
|
202
|
-
if (gCommandOpts) {
|
|
203
|
-
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
204
|
-
if (tCommandMethod) {
|
|
205
|
-
tCommandMethod(params);
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
errLog('vxe.error.notCommands', [code]);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
$xeToolbar.dispatchEvent('tool-click', params, evnt);
|
|
176
|
+
const importEvent = () => {
|
|
177
|
+
if (checkTable()) {
|
|
178
|
+
const { connectTable } = internalData;
|
|
179
|
+
const $table = connectTable;
|
|
180
|
+
if ($table) {
|
|
181
|
+
$table.importData();
|
|
212
182
|
}
|
|
213
183
|
}
|
|
214
184
|
};
|
|
215
|
-
const
|
|
185
|
+
const openImportEvent = () => {
|
|
216
186
|
if (checkTable()) {
|
|
217
187
|
const { connectTable } = internalData;
|
|
218
188
|
const $table = connectTable;
|
|
@@ -222,6 +192,15 @@ export default defineVxeComponent({
|
|
|
222
192
|
}
|
|
223
193
|
};
|
|
224
194
|
const exportEvent = () => {
|
|
195
|
+
if (checkTable()) {
|
|
196
|
+
const { connectTable } = internalData;
|
|
197
|
+
const $table = connectTable;
|
|
198
|
+
if ($table) {
|
|
199
|
+
$table.exportData();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
const openExportEvent = () => {
|
|
225
204
|
if (checkTable()) {
|
|
226
205
|
const { connectTable } = internalData;
|
|
227
206
|
const $table = connectTable;
|
|
@@ -231,6 +210,15 @@ export default defineVxeComponent({
|
|
|
231
210
|
}
|
|
232
211
|
};
|
|
233
212
|
const printEvent = () => {
|
|
213
|
+
if (checkTable()) {
|
|
214
|
+
const { connectTable } = internalData;
|
|
215
|
+
const $table = connectTable;
|
|
216
|
+
if ($table) {
|
|
217
|
+
$table.print();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
const openPrintEvent = () => {
|
|
234
222
|
if (checkTable()) {
|
|
235
223
|
const { connectTable } = internalData;
|
|
236
224
|
const $table = connectTable;
|
|
@@ -239,6 +227,94 @@ export default defineVxeComponent({
|
|
|
239
227
|
}
|
|
240
228
|
}
|
|
241
229
|
};
|
|
230
|
+
const handleDefaultCodeEvent = (eventParams, item, cb) => {
|
|
231
|
+
switch (item.code) {
|
|
232
|
+
case 'print':
|
|
233
|
+
printEvent();
|
|
234
|
+
break;
|
|
235
|
+
case 'open_print':
|
|
236
|
+
openPrintEvent();
|
|
237
|
+
break;
|
|
238
|
+
case 'custom':
|
|
239
|
+
handleClickSettingEvent(eventParams);
|
|
240
|
+
break;
|
|
241
|
+
case 'export':
|
|
242
|
+
exportEvent();
|
|
243
|
+
break;
|
|
244
|
+
case 'open_export':
|
|
245
|
+
openExportEvent();
|
|
246
|
+
break;
|
|
247
|
+
case 'import':
|
|
248
|
+
importEvent();
|
|
249
|
+
break;
|
|
250
|
+
case 'open_import':
|
|
251
|
+
openImportEvent();
|
|
252
|
+
break;
|
|
253
|
+
case 'zoom':
|
|
254
|
+
zoomEvent(eventParams);
|
|
255
|
+
break;
|
|
256
|
+
case 'refresh':
|
|
257
|
+
refreshEvent(eventParams);
|
|
258
|
+
break;
|
|
259
|
+
default:
|
|
260
|
+
cb();
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
const btnEvent = (eventParams, item) => {
|
|
265
|
+
const { $event } = eventParams;
|
|
266
|
+
const { connectTable } = internalData;
|
|
267
|
+
const $table = connectTable;
|
|
268
|
+
const { code } = item;
|
|
269
|
+
if (code) {
|
|
270
|
+
handleDefaultCodeEvent(eventParams, item, () => {
|
|
271
|
+
if ($xeGrid) {
|
|
272
|
+
$xeGrid.triggerToolbarBtnEvent(item, $event);
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
const gCommandOpts = commands.get(code);
|
|
276
|
+
const params = { code, button: item, $table: $table, $grid: $xeGrid, $event };
|
|
277
|
+
if (gCommandOpts) {
|
|
278
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
279
|
+
if (tCommandMethod) {
|
|
280
|
+
tCommandMethod(params);
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
errLog('vxe.error.notCommands', [code]);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
$xeToolbar.dispatchEvent('button-click', params, $event);
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
const tolEvent = (eventParams, item) => {
|
|
292
|
+
const { $event } = eventParams;
|
|
293
|
+
const { connectTable } = internalData;
|
|
294
|
+
const $table = connectTable;
|
|
295
|
+
const { code } = item;
|
|
296
|
+
if (code) {
|
|
297
|
+
handleDefaultCodeEvent(eventParams, item, () => {
|
|
298
|
+
if ($xeGrid) {
|
|
299
|
+
$xeGrid.triggerToolbarTolEvent(item, $event);
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
const gCommandOpts = commands.get(code);
|
|
303
|
+
const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $event };
|
|
304
|
+
if (gCommandOpts) {
|
|
305
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
306
|
+
if (tCommandMethod) {
|
|
307
|
+
tCommandMethod(params);
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
errLog('vxe.error.notCommands', [code]);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
$xeToolbar.dispatchEvent('tool-click', params, $event);
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
};
|
|
242
318
|
const dispatchEvent = (type, params, evnt) => {
|
|
243
319
|
emit(type, createEvent(evnt, { $toolbar: $xeToolbar }, params));
|
|
244
320
|
};
|
|
@@ -276,7 +352,7 @@ export default defineVxeComponent({
|
|
|
276
352
|
permissionCode: child.permissionCode,
|
|
277
353
|
prefixTooltip: child.prefixTooltip,
|
|
278
354
|
suffixTooltip: child.suffixTooltip,
|
|
279
|
-
onClick: (
|
|
355
|
+
onClick: (eventParams) => isBtn ? btnEvent(eventParams, child) : tolEvent(eventParams, child)
|
|
280
356
|
})
|
|
281
357
|
: createCommentVNode();
|
|
282
358
|
});
|
|
@@ -330,7 +406,7 @@ export default defineVxeComponent({
|
|
|
330
406
|
destroyOnClose: item.destroyOnClose,
|
|
331
407
|
placement: item.placement,
|
|
332
408
|
transfer: item.transfer,
|
|
333
|
-
onClick: (
|
|
409
|
+
onClick: (eventParams) => btnEvent(eventParams, item)
|
|
334
410
|
}, dropdowns && dropdowns.length
|
|
335
411
|
? {
|
|
336
412
|
dropdowns: () => renderDropdowns(item, true)
|
|
@@ -394,7 +470,7 @@ export default defineVxeComponent({
|
|
|
394
470
|
destroyOnClose: item.destroyOnClose,
|
|
395
471
|
placement: item.placement,
|
|
396
472
|
transfer: item.transfer,
|
|
397
|
-
onClick: (
|
|
473
|
+
onClick: (eventParams) => tolEvent(eventParams, item)
|
|
398
474
|
}, dropdowns && dropdowns.length
|
|
399
475
|
? {
|
|
400
476
|
dropdowns: () => renderDropdowns(item, false)
|
|
@@ -418,7 +494,7 @@ export default defineVxeComponent({
|
|
|
418
494
|
circle: true,
|
|
419
495
|
icon: importOpts.icon || getIcon().TOOLBAR_TOOLS_IMPORT,
|
|
420
496
|
title: getI18n('vxe.toolbar.import'),
|
|
421
|
-
onClick:
|
|
497
|
+
onClick: openImportEvent
|
|
422
498
|
})
|
|
423
499
|
: createCommentVNode();
|
|
424
500
|
};
|
|
@@ -430,7 +506,7 @@ export default defineVxeComponent({
|
|
|
430
506
|
circle: true,
|
|
431
507
|
icon: exportOpts.icon || getIcon().TOOLBAR_TOOLS_EXPORT,
|
|
432
508
|
title: getI18n('vxe.toolbar.export'),
|
|
433
|
-
onClick:
|
|
509
|
+
onClick: openExportEvent
|
|
434
510
|
})
|
|
435
511
|
: createCommentVNode();
|
|
436
512
|
};
|
|
@@ -442,7 +518,7 @@ export default defineVxeComponent({
|
|
|
442
518
|
circle: true,
|
|
443
519
|
icon: printOpts.icon || getIcon().TOOLBAR_TOOLS_PRINT,
|
|
444
520
|
title: getI18n('vxe.toolbar.print'),
|
|
445
|
-
onClick:
|
|
521
|
+
onClick: openPrintEvent
|
|
446
522
|
})
|
|
447
523
|
: createCommentVNode();
|
|
448
524
|
};
|
|
@@ -525,12 +601,29 @@ export default defineVxeComponent({
|
|
|
525
601
|
};
|
|
526
602
|
$xeToolbar.renderVN = renderVN;
|
|
527
603
|
nextTick(() => {
|
|
528
|
-
const { refresh } = props;
|
|
529
604
|
const refreshOpts = computeRefreshOpts.value;
|
|
530
605
|
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
531
|
-
if (refresh && !$xeGrid && !queryMethod) {
|
|
606
|
+
if (props.refresh && !$xeGrid && !queryMethod) {
|
|
532
607
|
warnLog('vxe.error.notFunc', ['queryMethod']);
|
|
533
608
|
}
|
|
609
|
+
if (XEUtils.isPlainObject(props.custom)) {
|
|
610
|
+
warnLog('vxe.error.delProp', ['custom={...}', 'custom=boolean & custom-options={...}']);
|
|
611
|
+
}
|
|
612
|
+
if (XEUtils.isPlainObject(props.print)) {
|
|
613
|
+
warnLog('vxe.error.delProp', ['print={...}', 'print=boolean & print-options={...}']);
|
|
614
|
+
}
|
|
615
|
+
if (XEUtils.isPlainObject(props.export)) {
|
|
616
|
+
warnLog('vxe.error.delProp', ['export={...}', 'export=boolean & export-options={...}']);
|
|
617
|
+
}
|
|
618
|
+
if (XEUtils.isPlainObject(props.import)) {
|
|
619
|
+
warnLog('vxe.error.delProp', ['import={...}', 'import=boolean & import-options={...}']);
|
|
620
|
+
}
|
|
621
|
+
if (XEUtils.isPlainObject(props.refresh)) {
|
|
622
|
+
warnLog('vxe.error.delProp', ['refresh={...}', 'refresh=boolean & refresh-options={...}']);
|
|
623
|
+
}
|
|
624
|
+
if (XEUtils.isPlainObject(props.refresh)) {
|
|
625
|
+
warnLog('vxe.error.delProp', ['zoom={...}', 'zoom=boolean & zoom-options={...}']);
|
|
626
|
+
}
|
|
534
627
|
const customOpts = computeCustomOpts.value;
|
|
535
628
|
if (customOpts.isFooter) {
|
|
536
629
|
warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
|
package/es/ui/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
import { getFuncText } from './src/utils';
|
|
3
|
-
export const version = "4.13.
|
|
3
|
+
export const version = "4.13.41";
|
|
4
4
|
VxeUI.version = version;
|
|
5
5
|
VxeUI.tableVersion = version;
|
|
6
6
|
VxeUI.setConfig({
|
|
@@ -94,6 +94,14 @@ VxeUI.setConfig({
|
|
|
94
94
|
showFooter: true,
|
|
95
95
|
placement: 'top-right',
|
|
96
96
|
// storage: false,
|
|
97
|
+
storeOptions: {
|
|
98
|
+
visible: true,
|
|
99
|
+
resizable: true,
|
|
100
|
+
sort: true,
|
|
101
|
+
fixed: true
|
|
102
|
+
// rowGroup: false,
|
|
103
|
+
// aggFunc: false
|
|
104
|
+
},
|
|
97
105
|
// checkMethod () {},
|
|
98
106
|
modalOptions: {
|
|
99
107
|
showMaximize: true,
|
package/es/ui/src/log.js
CHANGED