vxe-table 4.16.0-beta.3 → 4.16.0-beta.5
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/module/custom/hook.js +10 -3
- package/es/table/module/custom/panel.js +139 -126
- package/es/table/module/keyboard/hook.js +2 -2
- package/es/table/src/cell.js +4 -0
- package/es/table/src/table.js +49 -12
- package/es/table/src/util.js +1 -0
- package/es/toolbar/src/toolbar.js +26 -24
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +90 -47
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/hook.js +12 -3
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +23 -9
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +2 -2
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/cell.js +8 -0
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/table.js +16 -14
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +1 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +27 -17
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +1 -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/table/module/custom/hook.ts +10 -3
- package/packages/table/module/custom/panel.ts +150 -135
- package/packages/table/module/keyboard/hook.ts +2 -2
- package/packages/table/src/cell.ts +4 -0
- package/packages/table/src/table.ts +49 -12
- package/packages/table/src/util.ts +2 -0
- package/packages/toolbar/src/toolbar.ts +27 -25
- /package/es/{iconfont.1755253968888.ttf → iconfont.1755588973979.ttf} +0 -0
- /package/es/{iconfont.1755253968888.woff → iconfont.1755588973979.woff} +0 -0
- /package/es/{iconfont.1755253968888.woff2 → iconfont.1755588973979.woff2} +0 -0
- /package/lib/{iconfont.1755253968888.ttf → iconfont.1755588973979.ttf} +0 -0
- /package/lib/{iconfont.1755253968888.woff → iconfont.1755588973979.woff} +0 -0
- /package/lib/{iconfont.1755253968888.woff2 → iconfont.1755588973979.woff2} +0 -0
|
@@ -53,6 +53,9 @@ export default defineVxeComponent({
|
|
|
53
53
|
const xID = XEUtils.uniqueId();
|
|
54
54
|
// 使用已安装的组件,如果未安装则不渲染
|
|
55
55
|
const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
|
|
56
|
+
const $xeGrid = inject('$xeGrid', null);
|
|
57
|
+
const $xeGantt = inject('$xeGantt', null);
|
|
58
|
+
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
56
59
|
const { computeSize } = useFns.useSize(props);
|
|
57
60
|
const reactData = reactive({
|
|
58
61
|
isRefresh: false,
|
|
@@ -73,7 +76,6 @@ export default defineVxeComponent({
|
|
|
73
76
|
getRefMaps: () => refMaps
|
|
74
77
|
};
|
|
75
78
|
let toolbarMethods = {};
|
|
76
|
-
const $xeGrid = inject('$xeGrid', null);
|
|
77
79
|
const computeRefreshOpts = computed(() => {
|
|
78
80
|
return Object.assign({}, XEUtils.clone(getConfig().toolbar.refresh, true), props.refreshOptions, props.refresh);
|
|
79
81
|
});
|
|
@@ -160,17 +162,17 @@ export default defineVxeComponent({
|
|
|
160
162
|
reactData.isRefresh = false;
|
|
161
163
|
}
|
|
162
164
|
}
|
|
163
|
-
else if ($
|
|
165
|
+
else if ($xeGGWrapper) {
|
|
164
166
|
reactData.isRefresh = true;
|
|
165
|
-
$
|
|
167
|
+
$xeGGWrapper.triggerToolbarCommitEvent({ code: refreshOpts.code || 'reload' }, $event).catch(() => { }).then(() => {
|
|
166
168
|
reactData.isRefresh = false;
|
|
167
169
|
});
|
|
168
170
|
}
|
|
169
171
|
}
|
|
170
172
|
};
|
|
171
173
|
const zoomEvent = ({ $event }) => {
|
|
172
|
-
if ($
|
|
173
|
-
$
|
|
174
|
+
if ($xeGGWrapper) {
|
|
175
|
+
$xeGGWrapper.triggerZoomEvent($event);
|
|
174
176
|
}
|
|
175
177
|
else {
|
|
176
178
|
warnLog('vxe.error.notProp', ['zoom']);
|
|
@@ -271,12 +273,12 @@ export default defineVxeComponent({
|
|
|
271
273
|
const { code } = item;
|
|
272
274
|
if (code) {
|
|
273
275
|
handleDefaultCodeEvent(eventParams, item, () => {
|
|
274
|
-
if ($
|
|
275
|
-
$
|
|
276
|
+
if ($xeGGWrapper) {
|
|
277
|
+
$xeGGWrapper.triggerToolbarBtnEvent(item, $event);
|
|
276
278
|
}
|
|
277
279
|
else {
|
|
278
280
|
const gCommandOpts = commands.get(code);
|
|
279
|
-
const params = { code, button: item, $table: $table, $grid: $xeGrid, $gantt:
|
|
281
|
+
const params = { code, button: item, $table: $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
|
|
280
282
|
if (gCommandOpts) {
|
|
281
283
|
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
282
284
|
if (tCommandMethod) {
|
|
@@ -298,12 +300,12 @@ export default defineVxeComponent({
|
|
|
298
300
|
const { code } = item;
|
|
299
301
|
if (code) {
|
|
300
302
|
handleDefaultCodeEvent(eventParams, item, () => {
|
|
301
|
-
if ($
|
|
302
|
-
$
|
|
303
|
+
if ($xeGGWrapper) {
|
|
304
|
+
$xeGGWrapper.triggerToolbarTolEvent(item, $event);
|
|
303
305
|
}
|
|
304
306
|
else {
|
|
305
307
|
const gCommandOpts = commands.get(code);
|
|
306
|
-
const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $gantt:
|
|
308
|
+
const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
|
|
307
309
|
if (gCommandOpts) {
|
|
308
310
|
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
309
311
|
if (tCommandMethod) {
|
|
@@ -373,7 +375,7 @@ export default defineVxeComponent({
|
|
|
373
375
|
const buttonSuffixSlot = slots.buttonSuffix || slots['button-suffix'];
|
|
374
376
|
const btnVNs = [];
|
|
375
377
|
if (buttonPrefixSlot) {
|
|
376
|
-
btnVNs.push(...getSlotVNs(buttonPrefixSlot({ buttons: buttons || [], $grid: $xeGrid, $table: $table })));
|
|
378
|
+
btnVNs.push(...getSlotVNs(buttonPrefixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })));
|
|
377
379
|
}
|
|
378
380
|
if (buttons) {
|
|
379
381
|
buttons.forEach((item, index) => {
|
|
@@ -382,7 +384,7 @@ export default defineVxeComponent({
|
|
|
382
384
|
const compConf = buttonRender ? renderer.get(buttonRender.name) : null;
|
|
383
385
|
if (buttonRender && compConf && compConf.renderToolbarButton) {
|
|
384
386
|
const toolbarButtonClassName = compConf.toolbarButtonClassName;
|
|
385
|
-
const params = { $grid: $xeGrid, $table: $table, button: item };
|
|
387
|
+
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, button: item };
|
|
386
388
|
btnVNs.push(h('span', {
|
|
387
389
|
key: `br${item.code || index}`,
|
|
388
390
|
class: ['vxe-button--item', toolbarButtonClassName ? (XEUtils.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName) : '']
|
|
@@ -421,7 +423,7 @@ export default defineVxeComponent({
|
|
|
421
423
|
});
|
|
422
424
|
}
|
|
423
425
|
if (buttonSuffixSlot) {
|
|
424
|
-
btnVNs.push(...getSlotVNs(buttonSuffixSlot({ buttons: buttons || [], $grid: $xeGrid, $table: $table })));
|
|
426
|
+
btnVNs.push(...getSlotVNs(buttonSuffixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })));
|
|
425
427
|
}
|
|
426
428
|
return btnVNs;
|
|
427
429
|
};
|
|
@@ -436,7 +438,7 @@ export default defineVxeComponent({
|
|
|
436
438
|
const toolSuffixSlot = slots.toolSuffix || slots['tool-suffix'];
|
|
437
439
|
const btnVNs = [];
|
|
438
440
|
if (toolPrefixSlot) {
|
|
439
|
-
btnVNs.push(...getSlotVNs(toolPrefixSlot({ tools: tools || [], $grid: $xeGrid, $table: $table })));
|
|
441
|
+
btnVNs.push(...getSlotVNs(toolPrefixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })));
|
|
440
442
|
}
|
|
441
443
|
if (tools) {
|
|
442
444
|
tools.forEach((item, tIndex) => {
|
|
@@ -446,7 +448,7 @@ export default defineVxeComponent({
|
|
|
446
448
|
const compConf = toolRender ? renderer.get(rdName) : null;
|
|
447
449
|
if (toolRender && compConf && compConf.renderToolbarTool) {
|
|
448
450
|
const toolbarToolClassName = compConf.toolbarToolClassName;
|
|
449
|
-
const params = { $grid: $xeGrid, $table: $table, tool: item };
|
|
451
|
+
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, tool: item };
|
|
450
452
|
btnVNs.push(h('span', {
|
|
451
453
|
key: rdName,
|
|
452
454
|
class: ['vxe-tool--item', toolbarToolClassName ? (XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName) : '']
|
|
@@ -485,7 +487,7 @@ export default defineVxeComponent({
|
|
|
485
487
|
});
|
|
486
488
|
}
|
|
487
489
|
if (toolSuffixSlot) {
|
|
488
|
-
btnVNs.push(...getSlotVNs(toolSuffixSlot({ tools: tools || [], $grid: $xeGrid, $table: $table })));
|
|
490
|
+
btnVNs.push(...getSlotVNs(toolSuffixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })));
|
|
489
491
|
}
|
|
490
492
|
return btnVNs;
|
|
491
493
|
};
|
|
@@ -539,12 +541,12 @@ export default defineVxeComponent({
|
|
|
539
541
|
};
|
|
540
542
|
const renderToolZoom = () => {
|
|
541
543
|
const zoomOpts = computeZoomOpts.value;
|
|
542
|
-
return $
|
|
544
|
+
return $xeGGWrapper && VxeUIButtonComponent
|
|
543
545
|
? h(VxeUIButtonComponent, {
|
|
544
546
|
key: 'zoom',
|
|
545
547
|
circle: true,
|
|
546
|
-
icon: $
|
|
547
|
-
title: getI18n(`vxe.toolbar.zoom${$
|
|
548
|
+
icon: $xeGGWrapper.isMaximized() ? (zoomOpts.iconOut || getIcon().TOOLBAR_TOOLS_MINIMIZE) : (zoomOpts.iconIn || getIcon().TOOLBAR_TOOLS_FULLSCREEN),
|
|
549
|
+
title: getI18n(`vxe.toolbar.zoom${$xeGGWrapper.isMaximized() ? 'Out' : 'In'}`),
|
|
548
550
|
onClick: zoomEvent
|
|
549
551
|
})
|
|
550
552
|
: createCommentVNode();
|
|
@@ -586,10 +588,10 @@ export default defineVxeComponent({
|
|
|
586
588
|
}, [
|
|
587
589
|
h('div', {
|
|
588
590
|
class: 'vxe-buttons--wrapper'
|
|
589
|
-
}, buttonsSlot ? buttonsSlot({ $grid: $xeGrid, $table: $table }) : renderLeftBtns()),
|
|
591
|
+
}, buttonsSlot ? buttonsSlot({ $grid: $xeGrid, $gantt: $xeGantt, $table: $table }) : renderLeftBtns()),
|
|
590
592
|
h('div', {
|
|
591
593
|
class: 'vxe-tools--wrapper'
|
|
592
|
-
}, toolsSlot ? toolsSlot({ $grid: $xeGrid, $table: $table }) : renderRightTools()),
|
|
594
|
+
}, toolsSlot ? toolsSlot({ $grid: $xeGrid, $gantt: $xeGantt, $table: $table }) : renderRightTools()),
|
|
593
595
|
h('div', {
|
|
594
596
|
class: 'vxe-tools--operate'
|
|
595
597
|
}, [
|
|
@@ -597,7 +599,7 @@ export default defineVxeComponent({
|
|
|
597
599
|
props.export ? renderToolExport() : createCommentVNode(),
|
|
598
600
|
props.print ? renderToolPrint() : createCommentVNode(),
|
|
599
601
|
refresh ? renderToolRefresh() : createCommentVNode(),
|
|
600
|
-
zoom && $
|
|
602
|
+
zoom && $xeGGWrapper ? renderToolZoom() : createCommentVNode(),
|
|
601
603
|
custom ? renderToolCustom() : createCommentVNode()
|
|
602
604
|
])
|
|
603
605
|
]);
|
|
@@ -606,7 +608,7 @@ export default defineVxeComponent({
|
|
|
606
608
|
nextTick(() => {
|
|
607
609
|
const refreshOpts = computeRefreshOpts.value;
|
|
608
610
|
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
609
|
-
if (props.refresh && !$
|
|
611
|
+
if (props.refresh && !$xeGGWrapper && !queryMethod) {
|
|
610
612
|
warnLog('vxe.error.notFunc', ['queryMethod']);
|
|
611
613
|
}
|
|
612
614
|
if (XEUtils.isPlainObject(props.custom)) {
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED