vxe-table 4.23.11 → 4.23.12
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/dist/all.esm.js +15834 -15806
- package/dist/all.esm.min.js +3 -0
- package/es/grid/src/grid.js +1665 -1662
- package/es/table/src/column.js +39 -36
- package/es/table/src/group.js +49 -46
- package/es/table/src/table.js +13721 -13706
- package/es/toolbar/src/toolbar.js +595 -592
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +1665 -1662
- package/lib/index.umd.js +15834 -15806
- package/lib/index.umd.min.js +3 -3
- package/lib/locale/ar-EG.umd.min.js +1 -0
- package/lib/locale/de-DE.umd.min.js +1 -0
- package/lib/locale/en-US.umd.min.js +1 -0
- package/lib/locale/es-ES.umd.min.js +1 -0
- package/lib/locale/fr-FR.umd.min.js +1 -0
- package/lib/locale/hu-HU.umd.min.js +1 -0
- package/lib/locale/hy-AM.umd.min.js +1 -0
- package/lib/locale/id-ID.umd.min.js +1 -0
- package/lib/locale/it-IT.umd.min.js +1 -0
- package/lib/locale/ja-JP.umd.min.js +1 -0
- package/lib/locale/ko-KR.umd.min.js +1 -0
- package/lib/locale/lang/ar-EG.umd.min.js +1 -0
- package/lib/locale/lang/de-DE.umd.min.js +1 -0
- package/lib/locale/lang/en-US.umd.min.js +1 -0
- package/lib/locale/lang/es-ES.umd.min.js +1 -0
- package/lib/locale/lang/fr-FR.umd.min.js +1 -0
- package/lib/locale/lang/hu-HU.umd.min.js +1 -0
- package/lib/locale/lang/hy-AM.umd.min.js +1 -0
- package/lib/locale/lang/id-ID.umd.min.js +1 -0
- package/lib/locale/lang/it-IT.umd.min.js +1 -0
- package/lib/locale/lang/ja-JP.umd.min.js +1 -0
- package/lib/locale/lang/ko-KR.umd.min.js +1 -0
- package/lib/locale/lang/ms-MY.umd.min.js +1 -0
- package/lib/locale/lang/nb-NO.umd.min.js +1 -0
- package/lib/locale/lang/pt-BR.umd.min.js +1 -0
- package/lib/locale/lang/ru-RU.umd.min.js +1 -0
- package/lib/locale/lang/th-TH.umd.min.js +1 -0
- package/lib/locale/lang/ug-CN.umd.min.js +1 -0
- package/lib/locale/lang/uk-UA.umd.min.js +1 -0
- package/lib/locale/lang/uz-UZ.umd.min.js +1 -0
- package/lib/locale/lang/vi-VN.umd.min.js +1 -0
- package/lib/locale/lang/zh-CHT.umd.min.js +1 -0
- package/lib/locale/lang/zh-CN.umd.min.js +1 -0
- package/lib/locale/lang/zh-HK.umd.min.js +1 -0
- package/lib/locale/lang/zh-MO.umd.min.js +1 -0
- package/lib/locale/lang/zh-TC.umd.min.js +1 -0
- package/lib/locale/lang/zh-TW.umd.min.js +1 -0
- package/lib/locale/ms-MY.umd.min.js +1 -0
- package/lib/locale/nb-NO.umd.min.js +1 -0
- package/lib/locale/pt-BR.umd.min.js +1 -0
- package/lib/locale/ru-RU.umd.min.js +1 -0
- package/lib/locale/th-TH.umd.min.js +1 -0
- package/lib/locale/ug-CN.umd.min.js +1 -0
- package/lib/locale/uk-UA.umd.min.js +1 -0
- package/lib/locale/uz-UZ.umd.min.js +1 -0
- package/lib/locale/vi-VN.umd.min.js +1 -0
- package/lib/locale/zh-CHT.umd.min.js +1 -0
- package/lib/locale/zh-CN.umd.min.js +1 -0
- package/lib/locale/zh-HK.umd.min.js +1 -0
- package/lib/locale/zh-MO.umd.min.js +1 -0
- package/lib/locale/zh-TC.umd.min.js +1 -0
- package/lib/locale/zh-TW.umd.min.js +1 -0
- package/lib/table/src/column.js +39 -36
- package/lib/table/src/group.js +49 -46
- package/lib/table/src/table.js +13721 -13706
- package/lib/toolbar/src/toolbar.js +595 -592
- package/lib/ui/index.js +2 -1
- package/lib/ui/src/log.js +1 -1
- package/package.json +9 -2
- package/packages/grid/src/grid.ts +2 -2
- package/packages/table/src/column.ts +2 -2
- package/packages/table/src/group.ts +2 -2
- package/packages/table/src/table.ts +55 -26
- package/packages/toolbar/src/toolbar.ts +2 -2
- package/packages/ui/index.ts +1 -0
- /package/dist/{iconfont.1793016957545.ttf → iconfont.1793090564415.ttf} +0 -0
- /package/dist/{iconfont.1793016957545.woff → iconfont.1793090564415.woff} +0 -0
- /package/dist/{iconfont.1793016957545.woff2 → iconfont.1793090564415.woff2} +0 -0
- /package/es/{iconfont.1793016957545.ttf → iconfont.1793090564415.ttf} +0 -0
- /package/es/{iconfont.1793016957545.woff → iconfont.1793090564415.woff} +0 -0
- /package/es/{iconfont.1793016957545.woff2 → iconfont.1793090564415.woff2} +0 -0
- /package/lib/{iconfont.1793016957545.ttf → iconfont.1793090564415.ttf} +0 -0
- /package/lib/{iconfont.1793016957545.woff → iconfont.1793090564415.woff} +0 -0
- /package/lib/{iconfont.1793016957545.woff2 → iconfont.1793090564415.woff2} +0 -0
|
@@ -51,654 +51,657 @@ function createInternalData() {
|
|
|
51
51
|
connectTable: null
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
var toolbar_default = (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
54
|
+
var toolbar_default = (
|
|
55
|
+
/* define-vxe-component start */
|
|
56
|
+
(0, import_comp.defineVxeComponent)({
|
|
57
|
+
name: "VxeToolbar",
|
|
58
|
+
props: {
|
|
59
|
+
loading: Boolean,
|
|
60
|
+
refresh: [Boolean, Object],
|
|
61
|
+
refreshOptions: Object,
|
|
62
|
+
import: [Boolean, Object],
|
|
63
|
+
importOptions: Object,
|
|
64
|
+
export: [Boolean, Object],
|
|
65
|
+
exportOptions: Object,
|
|
66
|
+
print: [Boolean, Object],
|
|
67
|
+
printOptions: Object,
|
|
68
|
+
zoom: [Boolean, Object],
|
|
69
|
+
zoomOptions: Object,
|
|
70
|
+
custom: [Boolean, Object],
|
|
71
|
+
customOptions: Object,
|
|
72
|
+
buttons: {
|
|
73
|
+
type: Array,
|
|
74
|
+
default: () => getConfig().toolbar.buttons
|
|
75
|
+
},
|
|
76
|
+
tools: {
|
|
77
|
+
type: Array,
|
|
78
|
+
default: () => getConfig().toolbar.tools
|
|
79
|
+
},
|
|
80
|
+
perfect: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: () => getConfig().toolbar.perfect
|
|
83
|
+
},
|
|
84
|
+
size: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: () => getConfig().toolbar.size || getConfig().size
|
|
87
|
+
},
|
|
88
|
+
className: [String, Function]
|
|
73
89
|
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
});
|
|
124
|
-
const computeZoomOpts = (0, import_vue.computed)(() => {
|
|
125
|
-
return Object.assign({}, import_xe_utils.default.clone(getConfig().toolbar.zoom, true), props.zoomOptions, props.zoom);
|
|
126
|
-
});
|
|
127
|
-
const computeCustomOpts = (0, import_vue.computed)(() => {
|
|
128
|
-
return Object.assign({}, import_xe_utils.default.clone(getConfig().toolbar.custom, true), props.customOptions, props.custom);
|
|
129
|
-
});
|
|
130
|
-
const computeTableCustomOpts = (0, import_vue.computed)(() => {
|
|
131
|
-
const { connectTable } = internalData;
|
|
132
|
-
const $table = connectTable;
|
|
133
|
-
if (reactData.connectFlag || $table) {
|
|
134
|
-
if ($table) {
|
|
135
|
-
const { computeCustomOpts: computeCustomOpts2 } = $table.getComputeMaps();
|
|
136
|
-
return computeCustomOpts2.value;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return { trigger: "" };
|
|
140
|
-
});
|
|
141
|
-
const computeTrigger = (0, import_vue.computed)(() => {
|
|
142
|
-
const tableCustomOpts = computeTableCustomOpts.value;
|
|
143
|
-
return tableCustomOpts.trigger;
|
|
144
|
-
});
|
|
145
|
-
const checkTable = () => {
|
|
146
|
-
const { connectTable } = internalData;
|
|
147
|
-
const $table = connectTable;
|
|
148
|
-
if ($table) {
|
|
149
|
-
return true;
|
|
150
|
-
}
|
|
151
|
-
errLog("vxe.error.barUnableLink");
|
|
152
|
-
};
|
|
153
|
-
const handleClickSettingEvent = ({ $event }) => {
|
|
154
|
-
const { connectTable } = internalData;
|
|
155
|
-
const $table = connectTable;
|
|
156
|
-
if ($table) {
|
|
157
|
-
if ($table.triggerCustomEvent) {
|
|
158
|
-
$table.triggerCustomEvent($event);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
const handleMouseenterSettingEvent = ({ $event }) => {
|
|
163
|
-
const { connectTable } = internalData;
|
|
164
|
-
const $table = connectTable;
|
|
165
|
-
if ($table) {
|
|
166
|
-
$table.customOpenEvent($event);
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
const handleMouseleaveSettingEvent = ({ $event }) => {
|
|
170
|
-
const { connectTable } = internalData;
|
|
171
|
-
const $table = connectTable;
|
|
172
|
-
if ($table) {
|
|
173
|
-
const { customStore } = $table.reactData;
|
|
174
|
-
customStore.activeBtn = false;
|
|
175
|
-
setTimeout(() => {
|
|
176
|
-
if (!customStore.activeBtn && !customStore.activeWrapper) {
|
|
177
|
-
$table.customCloseEvent($event);
|
|
178
|
-
}
|
|
179
|
-
}, 350);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
const refreshEvent = ({ $event }) => {
|
|
183
|
-
const { isRefresh } = reactData;
|
|
184
|
-
const refreshOpts = computeRefreshOpts.value;
|
|
185
|
-
if (!isRefresh) {
|
|
186
|
-
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
187
|
-
if (queryMethod) {
|
|
188
|
-
reactData.isRefresh = true;
|
|
189
|
-
try {
|
|
190
|
-
Promise.resolve(queryMethod({})).catch((e) => e).then(() => {
|
|
191
|
-
reactData.isRefresh = false;
|
|
192
|
-
});
|
|
193
|
-
} catch (e) {
|
|
194
|
-
reactData.isRefresh = false;
|
|
90
|
+
emits: ["button-click", "tool-click"],
|
|
91
|
+
setup(props, context) {
|
|
92
|
+
const { slots, emit } = context;
|
|
93
|
+
const xID = import_xe_utils.default.uniqueId();
|
|
94
|
+
const VxeUIButtonComponent = import_core.VxeUI.getComponent("VxeButton");
|
|
95
|
+
const $xeGrid = (0, import_vue.inject)("$xeGrid", null);
|
|
96
|
+
const $xeGantt = (0, import_vue.inject)("$xeGantt", null);
|
|
97
|
+
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
98
|
+
const { computeSize } = useFns.useSize(props);
|
|
99
|
+
const reactData = (0, import_vue.reactive)(createReactData());
|
|
100
|
+
const internalData = createInternalData();
|
|
101
|
+
const refElem = (0, import_vue.ref)();
|
|
102
|
+
const refMaps = {
|
|
103
|
+
refElem
|
|
104
|
+
};
|
|
105
|
+
const $xeToolbar = {
|
|
106
|
+
xID,
|
|
107
|
+
props,
|
|
108
|
+
context,
|
|
109
|
+
reactData,
|
|
110
|
+
internalData,
|
|
111
|
+
getRefMaps: () => refMaps
|
|
112
|
+
};
|
|
113
|
+
let toolbarMethods = {};
|
|
114
|
+
const computeRefreshOpts = (0, import_vue.computed)(() => {
|
|
115
|
+
return Object.assign({}, import_xe_utils.default.clone(getConfig().toolbar.refresh, true), props.refreshOptions, props.refresh);
|
|
116
|
+
});
|
|
117
|
+
const computeImportOpts = (0, import_vue.computed)(() => {
|
|
118
|
+
return Object.assign({}, import_xe_utils.default.clone(getConfig().toolbar.import, true), props.importOptions, props.import);
|
|
119
|
+
});
|
|
120
|
+
const computeExportOpts = (0, import_vue.computed)(() => {
|
|
121
|
+
return Object.assign({}, import_xe_utils.default.clone(getConfig().toolbar.export, true), props.exportOptions, props.export);
|
|
122
|
+
});
|
|
123
|
+
const computePrintOpts = (0, import_vue.computed)(() => {
|
|
124
|
+
return Object.assign({}, import_xe_utils.default.clone(getConfig().toolbar.print, true), props.printOptions, props.print);
|
|
125
|
+
});
|
|
126
|
+
const computeZoomOpts = (0, import_vue.computed)(() => {
|
|
127
|
+
return Object.assign({}, import_xe_utils.default.clone(getConfig().toolbar.zoom, true), props.zoomOptions, props.zoom);
|
|
128
|
+
});
|
|
129
|
+
const computeCustomOpts = (0, import_vue.computed)(() => {
|
|
130
|
+
return Object.assign({}, import_xe_utils.default.clone(getConfig().toolbar.custom, true), props.customOptions, props.custom);
|
|
131
|
+
});
|
|
132
|
+
const computeTableCustomOpts = (0, import_vue.computed)(() => {
|
|
133
|
+
const { connectTable } = internalData;
|
|
134
|
+
const $table = connectTable;
|
|
135
|
+
if (reactData.connectFlag || $table) {
|
|
136
|
+
if ($table) {
|
|
137
|
+
const { computeCustomOpts: computeCustomOpts2 } = $table.getComputeMaps();
|
|
138
|
+
return computeCustomOpts2.value;
|
|
195
139
|
}
|
|
196
|
-
} else if ($xeGGWrapper) {
|
|
197
|
-
reactData.isRefresh = true;
|
|
198
|
-
$xeGGWrapper.triggerToolbarCommitEvent({ code: refreshOpts.code || "reload" }, $event).catch(() => {
|
|
199
|
-
}).then(() => {
|
|
200
|
-
reactData.isRefresh = false;
|
|
201
|
-
});
|
|
202
140
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
const importEvent = () => {
|
|
213
|
-
if (checkTable()) {
|
|
141
|
+
return { trigger: "" };
|
|
142
|
+
});
|
|
143
|
+
const computeTrigger = (0, import_vue.computed)(() => {
|
|
144
|
+
const tableCustomOpts = computeTableCustomOpts.value;
|
|
145
|
+
return tableCustomOpts.trigger;
|
|
146
|
+
});
|
|
147
|
+
const checkTable = () => {
|
|
214
148
|
const { connectTable } = internalData;
|
|
215
149
|
const $table = connectTable;
|
|
216
150
|
if ($table) {
|
|
217
|
-
|
|
151
|
+
return true;
|
|
218
152
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (checkTable()) {
|
|
153
|
+
errLog("vxe.error.barUnableLink");
|
|
154
|
+
};
|
|
155
|
+
const handleClickSettingEvent = ({ $event }) => {
|
|
223
156
|
const { connectTable } = internalData;
|
|
224
157
|
const $table = connectTable;
|
|
225
158
|
if ($table) {
|
|
226
|
-
$table.
|
|
159
|
+
if ($table.triggerCustomEvent) {
|
|
160
|
+
$table.triggerCustomEvent($event);
|
|
161
|
+
}
|
|
227
162
|
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const exportEvent = () => {
|
|
231
|
-
if (checkTable()) {
|
|
163
|
+
};
|
|
164
|
+
const handleMouseenterSettingEvent = ({ $event }) => {
|
|
232
165
|
const { connectTable } = internalData;
|
|
233
166
|
const $table = connectTable;
|
|
234
167
|
if ($table) {
|
|
235
|
-
$table.
|
|
168
|
+
$table.customOpenEvent($event);
|
|
236
169
|
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
const openExportEvent = () => {
|
|
240
|
-
if (checkTable()) {
|
|
170
|
+
};
|
|
171
|
+
const handleMouseleaveSettingEvent = ({ $event }) => {
|
|
241
172
|
const { connectTable } = internalData;
|
|
242
173
|
const $table = connectTable;
|
|
243
174
|
if ($table) {
|
|
244
|
-
$table.
|
|
175
|
+
const { customStore } = $table.reactData;
|
|
176
|
+
customStore.activeBtn = false;
|
|
177
|
+
setTimeout(() => {
|
|
178
|
+
if (!customStore.activeBtn && !customStore.activeWrapper) {
|
|
179
|
+
$table.customCloseEvent($event);
|
|
180
|
+
}
|
|
181
|
+
}, 350);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
const refreshEvent = ({ $event }) => {
|
|
185
|
+
const { isRefresh } = reactData;
|
|
186
|
+
const refreshOpts = computeRefreshOpts.value;
|
|
187
|
+
if (!isRefresh) {
|
|
188
|
+
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
189
|
+
if (queryMethod) {
|
|
190
|
+
reactData.isRefresh = true;
|
|
191
|
+
try {
|
|
192
|
+
Promise.resolve(queryMethod({})).catch((e) => e).then(() => {
|
|
193
|
+
reactData.isRefresh = false;
|
|
194
|
+
});
|
|
195
|
+
} catch (e) {
|
|
196
|
+
reactData.isRefresh = false;
|
|
197
|
+
}
|
|
198
|
+
} else if ($xeGGWrapper) {
|
|
199
|
+
reactData.isRefresh = true;
|
|
200
|
+
$xeGGWrapper.triggerToolbarCommitEvent({ code: refreshOpts.code || "reload" }, $event).catch(() => {
|
|
201
|
+
}).then(() => {
|
|
202
|
+
reactData.isRefresh = false;
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
const zoomEvent = ({ $event }) => {
|
|
208
|
+
if ($xeGGWrapper) {
|
|
209
|
+
$xeGGWrapper.triggerZoomEvent($event);
|
|
210
|
+
} else {
|
|
211
|
+
warnLog("vxe.error.notProp", ["zoom"]);
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
const importEvent = () => {
|
|
215
|
+
if (checkTable()) {
|
|
216
|
+
const { connectTable } = internalData;
|
|
217
|
+
const $table = connectTable;
|
|
218
|
+
if ($table) {
|
|
219
|
+
$table.importData();
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
const openImportEvent = () => {
|
|
224
|
+
if (checkTable()) {
|
|
225
|
+
const { connectTable } = internalData;
|
|
226
|
+
const $table = connectTable;
|
|
227
|
+
if ($table) {
|
|
228
|
+
$table.openImport();
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
const exportEvent = () => {
|
|
233
|
+
if (checkTable()) {
|
|
234
|
+
const { connectTable } = internalData;
|
|
235
|
+
const $table = connectTable;
|
|
236
|
+
if ($table) {
|
|
237
|
+
$table.exportData();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
const openExportEvent = () => {
|
|
242
|
+
if (checkTable()) {
|
|
243
|
+
const { connectTable } = internalData;
|
|
244
|
+
const $table = connectTable;
|
|
245
|
+
if ($table) {
|
|
246
|
+
$table.openExport();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
const printEvent = () => {
|
|
251
|
+
if (checkTable()) {
|
|
252
|
+
const { connectTable } = internalData;
|
|
253
|
+
const $table = connectTable;
|
|
254
|
+
if ($table) {
|
|
255
|
+
$table.print();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
const openPrintEvent = () => {
|
|
260
|
+
if (checkTable()) {
|
|
261
|
+
const { connectTable } = internalData;
|
|
262
|
+
const $table = connectTable;
|
|
263
|
+
if ($table) {
|
|
264
|
+
$table.openPrint();
|
|
265
|
+
}
|
|
245
266
|
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
267
|
+
};
|
|
268
|
+
const handleDefaultCodeEvent = (eventParams, item, cb) => {
|
|
269
|
+
switch (item.code) {
|
|
270
|
+
case "print":
|
|
271
|
+
printEvent();
|
|
272
|
+
break;
|
|
273
|
+
case "open_print":
|
|
274
|
+
openPrintEvent();
|
|
275
|
+
break;
|
|
276
|
+
case "custom":
|
|
277
|
+
handleClickSettingEvent(eventParams);
|
|
278
|
+
break;
|
|
279
|
+
case "export":
|
|
280
|
+
exportEvent();
|
|
281
|
+
break;
|
|
282
|
+
case "open_export":
|
|
283
|
+
openExportEvent();
|
|
284
|
+
break;
|
|
285
|
+
case "import":
|
|
286
|
+
importEvent();
|
|
287
|
+
break;
|
|
288
|
+
case "open_import":
|
|
289
|
+
openImportEvent();
|
|
290
|
+
break;
|
|
291
|
+
case "zoom":
|
|
292
|
+
zoomEvent(eventParams);
|
|
293
|
+
break;
|
|
294
|
+
case "refresh":
|
|
295
|
+
refreshEvent(eventParams);
|
|
296
|
+
break;
|
|
297
|
+
default:
|
|
298
|
+
cb();
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
const btnEvent = (eventParams, item) => {
|
|
303
|
+
const { $event } = eventParams;
|
|
250
304
|
const { connectTable } = internalData;
|
|
251
305
|
const $table = connectTable;
|
|
252
|
-
|
|
253
|
-
|
|
306
|
+
const { code } = item;
|
|
307
|
+
if (code) {
|
|
308
|
+
handleDefaultCodeEvent(eventParams, item, () => {
|
|
309
|
+
if ($xeGGWrapper) {
|
|
310
|
+
$xeGGWrapper.triggerToolbarBtnEvent(item, $event);
|
|
311
|
+
} else {
|
|
312
|
+
const gCommandOpts = commands.get(code);
|
|
313
|
+
const params = { code, button: item, $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
|
|
314
|
+
if (gCommandOpts) {
|
|
315
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
316
|
+
if (tCommandMethod) {
|
|
317
|
+
tCommandMethod(params);
|
|
318
|
+
} else {
|
|
319
|
+
errLog("vxe.error.notCommands", [code]);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
$xeToolbar.dispatchEvent("button-click", params, $event);
|
|
323
|
+
}
|
|
324
|
+
});
|
|
254
325
|
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
if (checkTable()) {
|
|
326
|
+
};
|
|
327
|
+
const tolEvent = (eventParams, item) => {
|
|
328
|
+
const { $event } = eventParams;
|
|
259
329
|
const { connectTable } = internalData;
|
|
260
330
|
const $table = connectTable;
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
break;
|
|
277
|
-
case "export":
|
|
278
|
-
exportEvent();
|
|
279
|
-
break;
|
|
280
|
-
case "open_export":
|
|
281
|
-
openExportEvent();
|
|
282
|
-
break;
|
|
283
|
-
case "import":
|
|
284
|
-
importEvent();
|
|
285
|
-
break;
|
|
286
|
-
case "open_import":
|
|
287
|
-
openImportEvent();
|
|
288
|
-
break;
|
|
289
|
-
case "zoom":
|
|
290
|
-
zoomEvent(eventParams);
|
|
291
|
-
break;
|
|
292
|
-
case "refresh":
|
|
293
|
-
refreshEvent(eventParams);
|
|
294
|
-
break;
|
|
295
|
-
default:
|
|
296
|
-
cb();
|
|
297
|
-
break;
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
const btnEvent = (eventParams, item) => {
|
|
301
|
-
const { $event } = eventParams;
|
|
302
|
-
const { connectTable } = internalData;
|
|
303
|
-
const $table = connectTable;
|
|
304
|
-
const { code } = item;
|
|
305
|
-
if (code) {
|
|
306
|
-
handleDefaultCodeEvent(eventParams, item, () => {
|
|
307
|
-
if ($xeGGWrapper) {
|
|
308
|
-
$xeGGWrapper.triggerToolbarBtnEvent(item, $event);
|
|
309
|
-
} else {
|
|
310
|
-
const gCommandOpts = commands.get(code);
|
|
311
|
-
const params = { code, button: item, $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
|
|
312
|
-
if (gCommandOpts) {
|
|
313
|
-
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
314
|
-
if (tCommandMethod) {
|
|
315
|
-
tCommandMethod(params);
|
|
316
|
-
} else {
|
|
317
|
-
errLog("vxe.error.notCommands", [code]);
|
|
331
|
+
const { code } = item;
|
|
332
|
+
if (code) {
|
|
333
|
+
handleDefaultCodeEvent(eventParams, item, () => {
|
|
334
|
+
if ($xeGGWrapper) {
|
|
335
|
+
$xeGGWrapper.triggerToolbarTolEvent(item, $event);
|
|
336
|
+
} else {
|
|
337
|
+
const gCommandOpts = commands.get(code);
|
|
338
|
+
const params = { code, button: null, tool: item, $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
|
|
339
|
+
if (gCommandOpts) {
|
|
340
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
341
|
+
if (tCommandMethod) {
|
|
342
|
+
tCommandMethod(params);
|
|
343
|
+
} else {
|
|
344
|
+
errLog("vxe.error.notCommands", [code]);
|
|
345
|
+
}
|
|
318
346
|
}
|
|
347
|
+
$xeToolbar.dispatchEvent("tool-click", params, $event);
|
|
319
348
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
errLog("vxe.error.notCommands", [code]);
|
|
343
|
-
}
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
353
|
+
emit(type, createEvent(evnt, { $toolbar: $xeToolbar }, params));
|
|
354
|
+
};
|
|
355
|
+
toolbarMethods = {
|
|
356
|
+
dispatchEvent,
|
|
357
|
+
syncUpdate(params) {
|
|
358
|
+
internalData.connectTable = params.$table;
|
|
359
|
+
reactData.columns = params.collectColumn;
|
|
360
|
+
reactData.connectFlag++;
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
Object.assign($xeToolbar, toolbarMethods);
|
|
364
|
+
const renderDropdowns = (item, isBtn) => {
|
|
365
|
+
const { dropdowns } = item;
|
|
366
|
+
const downVNs = [];
|
|
367
|
+
if (dropdowns) {
|
|
368
|
+
return dropdowns.map((child, index) => {
|
|
369
|
+
if (child.visible === false) {
|
|
370
|
+
return (0, import_vue.createCommentVNode)();
|
|
344
371
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}),
|
|
376
|
-
onClick: (eventParams) => isBtn ? btnEvent(eventParams, child) : tolEvent(eventParams, child)
|
|
377
|
-
}) : (0, import_vue.createCommentVNode)();
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
return downVNs;
|
|
381
|
-
};
|
|
382
|
-
const renderLeftBtns = () => {
|
|
383
|
-
const { buttons } = props;
|
|
384
|
-
const { connectTable } = internalData;
|
|
385
|
-
const $table = connectTable;
|
|
386
|
-
const buttonsSlot = slots.buttons;
|
|
387
|
-
const buttonPrefixSlot = slots.buttonPrefix || slots["button-prefix"];
|
|
388
|
-
const buttonSuffixSlot = slots.buttonSuffix || slots["button-suffix"];
|
|
389
|
-
const btnVNs = [];
|
|
390
|
-
if (buttons) {
|
|
391
|
-
const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
|
|
392
|
-
const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
|
|
393
|
-
buttons.forEach((item, index) => {
|
|
394
|
-
const { dropdowns, buttonRender } = item;
|
|
395
|
-
if (item.visible !== false) {
|
|
396
|
-
const compConf = buttonRender && buttonRender.name ? rendererOpts[buttonRender.name] || renderer.get(buttonRender.name) : null;
|
|
397
|
-
if (buttonRender && compConf && compConf.renderToolbarButton) {
|
|
398
|
-
const toolbarButtonClassName = compConf.toolbarButtonClassName;
|
|
399
|
-
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table, button: item };
|
|
400
|
-
btnVNs.push(
|
|
401
|
-
(0, import_vue.h)(
|
|
402
|
-
"span",
|
|
403
|
-
{
|
|
404
|
-
key: `br${item.code || index}`,
|
|
405
|
-
class: ["vxe-button--item", toolbarButtonClassName ? import_xe_utils.default.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName : ""]
|
|
406
|
-
},
|
|
407
|
-
(0, import_vn.getSlotVNs)(compConf.renderToolbarButton(buttonRender, params))
|
|
408
|
-
)
|
|
409
|
-
);
|
|
410
|
-
} else {
|
|
411
|
-
if (VxeUIButtonComponent) {
|
|
372
|
+
return VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
373
|
+
key: index,
|
|
374
|
+
...Object.assign({}, child, {
|
|
375
|
+
content: child.content || child.name,
|
|
376
|
+
options: void 0
|
|
377
|
+
}),
|
|
378
|
+
onClick: (eventParams) => isBtn ? btnEvent(eventParams, child) : tolEvent(eventParams, child)
|
|
379
|
+
}) : (0, import_vue.createCommentVNode)();
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
return downVNs;
|
|
383
|
+
};
|
|
384
|
+
const renderLeftBtns = () => {
|
|
385
|
+
const { buttons } = props;
|
|
386
|
+
const { connectTable } = internalData;
|
|
387
|
+
const $table = connectTable;
|
|
388
|
+
const buttonsSlot = slots.buttons;
|
|
389
|
+
const buttonPrefixSlot = slots.buttonPrefix || slots["button-prefix"];
|
|
390
|
+
const buttonSuffixSlot = slots.buttonSuffix || slots["button-suffix"];
|
|
391
|
+
const btnVNs = [];
|
|
392
|
+
if (buttons) {
|
|
393
|
+
const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
|
|
394
|
+
const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
|
|
395
|
+
buttons.forEach((item, index) => {
|
|
396
|
+
const { dropdowns, buttonRender } = item;
|
|
397
|
+
if (item.visible !== false) {
|
|
398
|
+
const compConf = buttonRender && buttonRender.name ? rendererOpts[buttonRender.name] || renderer.get(buttonRender.name) : null;
|
|
399
|
+
if (buttonRender && compConf && compConf.renderToolbarButton) {
|
|
400
|
+
const toolbarButtonClassName = compConf.toolbarButtonClassName;
|
|
401
|
+
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table, button: item };
|
|
412
402
|
btnVNs.push(
|
|
413
403
|
(0, import_vue.h)(
|
|
414
|
-
|
|
404
|
+
"span",
|
|
415
405
|
{
|
|
416
|
-
key: `
|
|
417
|
-
|
|
418
|
-
content: item.content || item.name,
|
|
419
|
-
options: void 0
|
|
420
|
-
}),
|
|
421
|
-
onClick: (eventParams) => btnEvent(eventParams, item)
|
|
406
|
+
key: `br${item.code || index}`,
|
|
407
|
+
class: ["vxe-button--item", toolbarButtonClassName ? import_xe_utils.default.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName : ""]
|
|
422
408
|
},
|
|
423
|
-
|
|
424
|
-
dropdowns: () => renderDropdowns(item, true)
|
|
425
|
-
} : {}
|
|
409
|
+
(0, import_vn.getSlotVNs)(compConf.renderToolbarButton(buttonRender, params))
|
|
426
410
|
)
|
|
427
411
|
);
|
|
412
|
+
} else {
|
|
413
|
+
if (VxeUIButtonComponent) {
|
|
414
|
+
btnVNs.push(
|
|
415
|
+
(0, import_vue.h)(
|
|
416
|
+
VxeUIButtonComponent,
|
|
417
|
+
{
|
|
418
|
+
key: `bd${item.code || index}`,
|
|
419
|
+
...Object.assign({}, item, {
|
|
420
|
+
content: item.content || item.name,
|
|
421
|
+
options: void 0
|
|
422
|
+
}),
|
|
423
|
+
onClick: (eventParams) => btnEvent(eventParams, item)
|
|
424
|
+
},
|
|
425
|
+
dropdowns && dropdowns.length ? {
|
|
426
|
+
dropdowns: () => renderDropdowns(item, true)
|
|
427
|
+
} : {}
|
|
428
|
+
)
|
|
429
|
+
);
|
|
430
|
+
}
|
|
428
431
|
}
|
|
429
432
|
}
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table, tool: item };
|
|
475
|
-
btnVNs.push(
|
|
476
|
-
(0, import_vue.h)(
|
|
477
|
-
"span",
|
|
478
|
-
{
|
|
479
|
-
key: tIndex,
|
|
480
|
-
class: ["vxe-tool--item", toolbarToolClassName ? import_xe_utils.default.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName : ""]
|
|
481
|
-
},
|
|
482
|
-
(0, import_vn.getSlotVNs)(compConf.renderToolbarTool(toolRender, params))
|
|
483
|
-
)
|
|
484
|
-
);
|
|
485
|
-
} else {
|
|
486
|
-
if (VxeUIButtonComponent) {
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
return [
|
|
436
|
+
(0, import_vue.h)(
|
|
437
|
+
"div",
|
|
438
|
+
{
|
|
439
|
+
class: "vxe-button--prefix-wrapper"
|
|
440
|
+
},
|
|
441
|
+
buttonPrefixSlot ? (0, import_vn.getSlotVNs)(buttonPrefixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : []
|
|
442
|
+
),
|
|
443
|
+
(0, import_vue.h)(
|
|
444
|
+
"div",
|
|
445
|
+
{
|
|
446
|
+
class: "vxe-button--item-wrapper"
|
|
447
|
+
},
|
|
448
|
+
buttonsSlot ? (0, import_vn.getSlotVNs)(buttonsSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : btnVNs
|
|
449
|
+
),
|
|
450
|
+
(0, import_vue.h)(
|
|
451
|
+
"div",
|
|
452
|
+
{
|
|
453
|
+
class: "vxe-button--suffix-wrapper"
|
|
454
|
+
},
|
|
455
|
+
buttonSuffixSlot ? (0, import_vn.getSlotVNs)(buttonSuffixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : []
|
|
456
|
+
)
|
|
457
|
+
];
|
|
458
|
+
};
|
|
459
|
+
const renderRightTools = () => {
|
|
460
|
+
const { tools } = props;
|
|
461
|
+
const { connectTable } = internalData;
|
|
462
|
+
const $table = connectTable;
|
|
463
|
+
const toolsSlot = slots.tools;
|
|
464
|
+
const toolPrefixSlot = slots.toolPrefix || slots["tool-prefix"];
|
|
465
|
+
const toolSuffixSlot = slots.toolSuffix || slots["tool-suffix"];
|
|
466
|
+
const btnVNs = [];
|
|
467
|
+
if (tools) {
|
|
468
|
+
const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
|
|
469
|
+
const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
|
|
470
|
+
tools.forEach((item, tIndex) => {
|
|
471
|
+
const { dropdowns, toolRender } = item;
|
|
472
|
+
if (item.visible !== false) {
|
|
473
|
+
const compConf = toolRender && toolRender.name ? rendererOpts[toolRender.name] || renderer.get(toolRender.name) : null;
|
|
474
|
+
if (toolRender && compConf && compConf.renderToolbarTool) {
|
|
475
|
+
const toolbarToolClassName = compConf.toolbarToolClassName;
|
|
476
|
+
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table, tool: item };
|
|
487
477
|
btnVNs.push(
|
|
488
478
|
(0, import_vue.h)(
|
|
489
|
-
|
|
479
|
+
"span",
|
|
490
480
|
{
|
|
491
481
|
key: tIndex,
|
|
492
|
-
|
|
493
|
-
content: item.content || item.name,
|
|
494
|
-
options: void 0
|
|
495
|
-
}),
|
|
496
|
-
onClick: (eventParams) => tolEvent(eventParams, item)
|
|
482
|
+
class: ["vxe-tool--item", toolbarToolClassName ? import_xe_utils.default.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName : ""]
|
|
497
483
|
},
|
|
498
|
-
|
|
499
|
-
dropdowns: () => renderDropdowns(item, false)
|
|
500
|
-
} : {}
|
|
484
|
+
(0, import_vn.getSlotVNs)(compConf.renderToolbarTool(toolRender, params))
|
|
501
485
|
)
|
|
502
486
|
);
|
|
487
|
+
} else {
|
|
488
|
+
if (VxeUIButtonComponent) {
|
|
489
|
+
btnVNs.push(
|
|
490
|
+
(0, import_vue.h)(
|
|
491
|
+
VxeUIButtonComponent,
|
|
492
|
+
{
|
|
493
|
+
key: tIndex,
|
|
494
|
+
...Object.assign({}, item, {
|
|
495
|
+
content: item.content || item.name,
|
|
496
|
+
options: void 0
|
|
497
|
+
}),
|
|
498
|
+
onClick: (eventParams) => tolEvent(eventParams, item)
|
|
499
|
+
},
|
|
500
|
+
dropdowns && dropdowns.length ? {
|
|
501
|
+
dropdowns: () => renderDropdowns(item, false)
|
|
502
|
+
} : {}
|
|
503
|
+
)
|
|
504
|
+
);
|
|
505
|
+
}
|
|
503
506
|
}
|
|
504
507
|
}
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
return [
|
|
509
|
-
(0, import_vue.h)(
|
|
510
|
-
"div",
|
|
511
|
-
{
|
|
512
|
-
class: "vxe-tool--prefix-wrapper"
|
|
513
|
-
},
|
|
514
|
-
toolPrefixSlot ? (0, import_vn.getSlotVNs)(toolPrefixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : []
|
|
515
|
-
),
|
|
516
|
-
(0, import_vue.h)(
|
|
517
|
-
"div",
|
|
518
|
-
{
|
|
519
|
-
class: "vxe-tool--item-wrapper"
|
|
520
|
-
},
|
|
521
|
-
toolsSlot ? (0, import_vn.getSlotVNs)(toolsSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : btnVNs
|
|
522
|
-
),
|
|
523
|
-
(0, import_vue.h)(
|
|
524
|
-
"div",
|
|
525
|
-
{
|
|
526
|
-
class: "vxe-tool--suffix-wrapper"
|
|
527
|
-
},
|
|
528
|
-
toolSuffixSlot ? (0, import_vn.getSlotVNs)(toolSuffixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : []
|
|
529
|
-
)
|
|
530
|
-
];
|
|
531
|
-
};
|
|
532
|
-
const renderToolImport = () => {
|
|
533
|
-
const importOpts = computeImportOpts.value;
|
|
534
|
-
return VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
535
|
-
key: "import",
|
|
536
|
-
circle: true,
|
|
537
|
-
icon: importOpts.icon || getIcon().TOOLBAR_TOOLS_IMPORT,
|
|
538
|
-
title: getI18n("vxe.toolbar.import"),
|
|
539
|
-
onClick: openImportEvent
|
|
540
|
-
}) : (0, import_vue.createCommentVNode)();
|
|
541
|
-
};
|
|
542
|
-
const renderToolExport = () => {
|
|
543
|
-
const exportOpts = computeExportOpts.value;
|
|
544
|
-
return VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
545
|
-
key: "export",
|
|
546
|
-
circle: true,
|
|
547
|
-
icon: exportOpts.icon || getIcon().TOOLBAR_TOOLS_EXPORT,
|
|
548
|
-
title: getI18n("vxe.toolbar.export"),
|
|
549
|
-
onClick: openExportEvent
|
|
550
|
-
}) : (0, import_vue.createCommentVNode)();
|
|
551
|
-
};
|
|
552
|
-
const renderToolPrint = () => {
|
|
553
|
-
const printOpts = computePrintOpts.value;
|
|
554
|
-
return VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
555
|
-
key: "print",
|
|
556
|
-
circle: true,
|
|
557
|
-
icon: printOpts.icon || getIcon().TOOLBAR_TOOLS_PRINT,
|
|
558
|
-
title: getI18n("vxe.toolbar.print"),
|
|
559
|
-
onClick: openPrintEvent
|
|
560
|
-
}) : (0, import_vue.createCommentVNode)();
|
|
561
|
-
};
|
|
562
|
-
const renderToolRefresh = () => {
|
|
563
|
-
const refreshOpts = computeRefreshOpts.value;
|
|
564
|
-
return VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
565
|
-
key: "refresh",
|
|
566
|
-
circle: true,
|
|
567
|
-
icon: reactData.isRefresh ? refreshOpts.iconLoading || getIcon().TOOLBAR_TOOLS_REFRESH_LOADING : refreshOpts.icon || getIcon().TOOLBAR_TOOLS_REFRESH,
|
|
568
|
-
title: getI18n("vxe.toolbar.refresh"),
|
|
569
|
-
onClick: refreshEvent
|
|
570
|
-
}) : (0, import_vue.createCommentVNode)();
|
|
571
|
-
};
|
|
572
|
-
const renderToolZoom = () => {
|
|
573
|
-
const zoomOpts = computeZoomOpts.value;
|
|
574
|
-
return $xeGGWrapper && VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
575
|
-
key: "zoom",
|
|
576
|
-
circle: true,
|
|
577
|
-
icon: $xeGGWrapper.isMaximized() ? zoomOpts.iconOut || getIcon().TOOLBAR_TOOLS_MINIMIZE : zoomOpts.iconIn || getIcon().TOOLBAR_TOOLS_FULLSCREEN,
|
|
578
|
-
title: getI18n(`vxe.toolbar.zoom${$xeGGWrapper.isMaximized() ? "Out" : "In"}`),
|
|
579
|
-
onClick: zoomEvent
|
|
580
|
-
}) : (0, import_vue.createCommentVNode)();
|
|
581
|
-
};
|
|
582
|
-
const renderToolCustom = () => {
|
|
583
|
-
const customOpts = computeCustomOpts.value;
|
|
584
|
-
const btnTrigger = computeTrigger.value;
|
|
585
|
-
const customBtnOns = {};
|
|
586
|
-
if (btnTrigger === "manual") {
|
|
587
|
-
} else if (btnTrigger === "hover") {
|
|
588
|
-
customBtnOns.onMouseenter = handleMouseenterSettingEvent;
|
|
589
|
-
customBtnOns.onMouseleave = handleMouseleaveSettingEvent;
|
|
590
|
-
} else {
|
|
591
|
-
customBtnOns.onClick = handleClickSettingEvent;
|
|
592
|
-
}
|
|
593
|
-
return VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
594
|
-
key: "custom",
|
|
595
|
-
circle: true,
|
|
596
|
-
icon: customOpts.icon || getIcon().TOOLBAR_TOOLS_CUSTOM,
|
|
597
|
-
title: getI18n("vxe.toolbar.custom"),
|
|
598
|
-
className: "vxe-toolbar-custom-target",
|
|
599
|
-
...customBtnOns
|
|
600
|
-
}) : (0, import_vue.createCommentVNode)();
|
|
601
|
-
};
|
|
602
|
-
const renderVN = () => {
|
|
603
|
-
const { perfect, loading, refresh, zoom, custom, className } = props;
|
|
604
|
-
const vSize = computeSize.value;
|
|
605
|
-
return (0, import_vue.h)(
|
|
606
|
-
"div",
|
|
607
|
-
{
|
|
608
|
-
ref: refElem,
|
|
609
|
-
class: [
|
|
610
|
-
"vxe-toolbar",
|
|
611
|
-
className ? import_xe_utils.default.isFunction(className) ? className({ $toolbar: $xeToolbar }) : className : "",
|
|
612
|
-
{
|
|
613
|
-
[`size--${vSize}`]: vSize,
|
|
614
|
-
"is--perfect": perfect,
|
|
615
|
-
"is--loading": loading
|
|
616
|
-
}
|
|
617
|
-
]
|
|
618
|
-
},
|
|
619
|
-
[
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
return [
|
|
620
511
|
(0, import_vue.h)(
|
|
621
512
|
"div",
|
|
622
513
|
{
|
|
623
|
-
class: "vxe-
|
|
514
|
+
class: "vxe-tool--prefix-wrapper"
|
|
624
515
|
},
|
|
625
|
-
|
|
516
|
+
toolPrefixSlot ? (0, import_vn.getSlotVNs)(toolPrefixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : []
|
|
626
517
|
),
|
|
627
518
|
(0, import_vue.h)(
|
|
628
519
|
"div",
|
|
629
520
|
{
|
|
630
|
-
class: "vxe-
|
|
521
|
+
class: "vxe-tool--item-wrapper"
|
|
631
522
|
},
|
|
632
|
-
|
|
523
|
+
toolsSlot ? (0, import_vn.getSlotVNs)(toolsSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : btnVNs
|
|
633
524
|
),
|
|
634
525
|
(0, import_vue.h)(
|
|
635
526
|
"div",
|
|
636
527
|
{
|
|
637
|
-
class: "vxe-
|
|
528
|
+
class: "vxe-tool--suffix-wrapper"
|
|
638
529
|
},
|
|
639
|
-
[
|
|
640
|
-
props.import ? renderToolImport() : (0, import_vue.createCommentVNode)(),
|
|
641
|
-
props.export ? renderToolExport() : (0, import_vue.createCommentVNode)(),
|
|
642
|
-
props.print ? renderToolPrint() : (0, import_vue.createCommentVNode)(),
|
|
643
|
-
refresh ? renderToolRefresh() : (0, import_vue.createCommentVNode)(),
|
|
644
|
-
zoom && $xeGGWrapper ? renderToolZoom() : (0, import_vue.createCommentVNode)(),
|
|
645
|
-
custom ? renderToolCustom() : (0, import_vue.createCommentVNode)()
|
|
646
|
-
]
|
|
530
|
+
toolSuffixSlot ? (0, import_vn.getSlotVNs)(toolSuffixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : []
|
|
647
531
|
)
|
|
648
|
-
]
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
532
|
+
];
|
|
533
|
+
};
|
|
534
|
+
const renderToolImport = () => {
|
|
535
|
+
const importOpts = computeImportOpts.value;
|
|
536
|
+
return VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
537
|
+
key: "import",
|
|
538
|
+
circle: true,
|
|
539
|
+
icon: importOpts.icon || getIcon().TOOLBAR_TOOLS_IMPORT,
|
|
540
|
+
title: getI18n("vxe.toolbar.import"),
|
|
541
|
+
onClick: openImportEvent
|
|
542
|
+
}) : (0, import_vue.createCommentVNode)();
|
|
543
|
+
};
|
|
544
|
+
const renderToolExport = () => {
|
|
545
|
+
const exportOpts = computeExportOpts.value;
|
|
546
|
+
return VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
547
|
+
key: "export",
|
|
548
|
+
circle: true,
|
|
549
|
+
icon: exportOpts.icon || getIcon().TOOLBAR_TOOLS_EXPORT,
|
|
550
|
+
title: getI18n("vxe.toolbar.export"),
|
|
551
|
+
onClick: openExportEvent
|
|
552
|
+
}) : (0, import_vue.createCommentVNode)();
|
|
553
|
+
};
|
|
554
|
+
const renderToolPrint = () => {
|
|
555
|
+
const printOpts = computePrintOpts.value;
|
|
556
|
+
return VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
557
|
+
key: "print",
|
|
558
|
+
circle: true,
|
|
559
|
+
icon: printOpts.icon || getIcon().TOOLBAR_TOOLS_PRINT,
|
|
560
|
+
title: getI18n("vxe.toolbar.print"),
|
|
561
|
+
onClick: openPrintEvent
|
|
562
|
+
}) : (0, import_vue.createCommentVNode)();
|
|
563
|
+
};
|
|
564
|
+
const renderToolRefresh = () => {
|
|
565
|
+
const refreshOpts = computeRefreshOpts.value;
|
|
566
|
+
return VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
567
|
+
key: "refresh",
|
|
568
|
+
circle: true,
|
|
569
|
+
icon: reactData.isRefresh ? refreshOpts.iconLoading || getIcon().TOOLBAR_TOOLS_REFRESH_LOADING : refreshOpts.icon || getIcon().TOOLBAR_TOOLS_REFRESH,
|
|
570
|
+
title: getI18n("vxe.toolbar.refresh"),
|
|
571
|
+
onClick: refreshEvent
|
|
572
|
+
}) : (0, import_vue.createCommentVNode)();
|
|
573
|
+
};
|
|
574
|
+
const renderToolZoom = () => {
|
|
575
|
+
const zoomOpts = computeZoomOpts.value;
|
|
576
|
+
return $xeGGWrapper && VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
577
|
+
key: "zoom",
|
|
578
|
+
circle: true,
|
|
579
|
+
icon: $xeGGWrapper.isMaximized() ? zoomOpts.iconOut || getIcon().TOOLBAR_TOOLS_MINIMIZE : zoomOpts.iconIn || getIcon().TOOLBAR_TOOLS_FULLSCREEN,
|
|
580
|
+
title: getI18n(`vxe.toolbar.zoom${$xeGGWrapper.isMaximized() ? "Out" : "In"}`),
|
|
581
|
+
onClick: zoomEvent
|
|
582
|
+
}) : (0, import_vue.createCommentVNode)();
|
|
583
|
+
};
|
|
584
|
+
const renderToolCustom = () => {
|
|
585
|
+
const customOpts = computeCustomOpts.value;
|
|
586
|
+
const btnTrigger = computeTrigger.value;
|
|
587
|
+
const customBtnOns = {};
|
|
588
|
+
if (btnTrigger === "manual") {
|
|
589
|
+
} else if (btnTrigger === "hover") {
|
|
590
|
+
customBtnOns.onMouseenter = handleMouseenterSettingEvent;
|
|
591
|
+
customBtnOns.onMouseleave = handleMouseleaveSettingEvent;
|
|
592
|
+
} else {
|
|
593
|
+
customBtnOns.onClick = handleClickSettingEvent;
|
|
594
|
+
}
|
|
595
|
+
return VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
596
|
+
key: "custom",
|
|
597
|
+
circle: true,
|
|
598
|
+
icon: customOpts.icon || getIcon().TOOLBAR_TOOLS_CUSTOM,
|
|
599
|
+
title: getI18n("vxe.toolbar.custom"),
|
|
600
|
+
className: "vxe-toolbar-custom-target",
|
|
601
|
+
...customBtnOns
|
|
602
|
+
}) : (0, import_vue.createCommentVNode)();
|
|
603
|
+
};
|
|
604
|
+
const renderVN = () => {
|
|
605
|
+
const { perfect, loading, refresh, zoom, custom, className } = props;
|
|
606
|
+
const vSize = computeSize.value;
|
|
607
|
+
return (0, import_vue.h)(
|
|
608
|
+
"div",
|
|
609
|
+
{
|
|
610
|
+
ref: refElem,
|
|
611
|
+
class: [
|
|
612
|
+
"vxe-toolbar",
|
|
613
|
+
className ? import_xe_utils.default.isFunction(className) ? className({ $toolbar: $xeToolbar }) : className : "",
|
|
614
|
+
{
|
|
615
|
+
[`size--${vSize}`]: vSize,
|
|
616
|
+
"is--perfect": perfect,
|
|
617
|
+
"is--loading": loading
|
|
618
|
+
}
|
|
619
|
+
]
|
|
620
|
+
},
|
|
621
|
+
[
|
|
622
|
+
(0, import_vue.h)(
|
|
623
|
+
"div",
|
|
624
|
+
{
|
|
625
|
+
class: "vxe-buttons--wrapper"
|
|
626
|
+
},
|
|
627
|
+
renderLeftBtns()
|
|
628
|
+
),
|
|
629
|
+
(0, import_vue.h)(
|
|
630
|
+
"div",
|
|
631
|
+
{
|
|
632
|
+
class: "vxe-tools--wrapper"
|
|
633
|
+
},
|
|
634
|
+
renderRightTools()
|
|
635
|
+
),
|
|
636
|
+
(0, import_vue.h)(
|
|
637
|
+
"div",
|
|
638
|
+
{
|
|
639
|
+
class: "vxe-tools--operate"
|
|
640
|
+
},
|
|
641
|
+
[
|
|
642
|
+
props.import ? renderToolImport() : (0, import_vue.createCommentVNode)(),
|
|
643
|
+
props.export ? renderToolExport() : (0, import_vue.createCommentVNode)(),
|
|
644
|
+
props.print ? renderToolPrint() : (0, import_vue.createCommentVNode)(),
|
|
645
|
+
refresh ? renderToolRefresh() : (0, import_vue.createCommentVNode)(),
|
|
646
|
+
zoom && $xeGGWrapper ? renderToolZoom() : (0, import_vue.createCommentVNode)(),
|
|
647
|
+
custom ? renderToolCustom() : (0, import_vue.createCommentVNode)()
|
|
648
|
+
]
|
|
649
|
+
)
|
|
650
|
+
]
|
|
651
|
+
);
|
|
652
|
+
};
|
|
653
|
+
$xeToolbar.renderVN = renderVN;
|
|
654
|
+
(0, import_vue.nextTick)(() => {
|
|
655
|
+
const refreshOpts = computeRefreshOpts.value;
|
|
656
|
+
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
657
|
+
if (props.refresh && !$xeGGWrapper && !queryMethod) {
|
|
658
|
+
warnLog("vxe.error.notFunc", ["queryMethod"]);
|
|
659
|
+
}
|
|
660
|
+
if (import_xe_utils.default.isPlainObject(props.custom)) {
|
|
661
|
+
warnLog("vxe.error.delProp", ["custom={...}", "custom=boolean & custom-options={...}"]);
|
|
662
|
+
}
|
|
663
|
+
if (import_xe_utils.default.isPlainObject(props.print)) {
|
|
664
|
+
warnLog("vxe.error.delProp", ["print={...}", "print=boolean & print-options={...}"]);
|
|
665
|
+
}
|
|
666
|
+
if (import_xe_utils.default.isPlainObject(props.export)) {
|
|
667
|
+
warnLog("vxe.error.delProp", ["export={...}", "export=boolean & export-options={...}"]);
|
|
668
|
+
}
|
|
669
|
+
if (import_xe_utils.default.isPlainObject(props.import)) {
|
|
670
|
+
warnLog("vxe.error.delProp", ["import={...}", "import=boolean & import-options={...}"]);
|
|
671
|
+
}
|
|
672
|
+
if (import_xe_utils.default.isPlainObject(props.refresh)) {
|
|
673
|
+
warnLog("vxe.error.delProp", ["refresh={...}", "refresh=boolean & refresh-options={...}"]);
|
|
674
|
+
}
|
|
675
|
+
if (import_xe_utils.default.isPlainObject(props.refresh)) {
|
|
676
|
+
warnLog("vxe.error.delProp", ["zoom={...}", "zoom=boolean & zoom-options={...}"]);
|
|
677
|
+
}
|
|
678
|
+
const customOpts = computeCustomOpts.value;
|
|
679
|
+
if (customOpts.isFooter) {
|
|
680
|
+
warnLog("vxe.error.delProp", ["toolbar.custom.isFooter", "table.custom-config.showFooter"]);
|
|
681
|
+
}
|
|
682
|
+
if (customOpts.showFooter) {
|
|
683
|
+
warnLog("vxe.error.delProp", ["toolbar.custom.showFooter", "table.custom-config.showFooter"]);
|
|
684
|
+
}
|
|
685
|
+
if (customOpts.immediate) {
|
|
686
|
+
warnLog("vxe.error.delProp", ["toolbar.custom.immediate", "table.custom-config.immediate"]);
|
|
687
|
+
}
|
|
688
|
+
if (customOpts.trigger) {
|
|
689
|
+
warnLog("vxe.error.delProp", ["toolbar.custom.trigger", "table.custom-config.trigger"]);
|
|
690
|
+
}
|
|
691
|
+
if (props.refresh || props.import || props.export || props.print || props.zoom) {
|
|
692
|
+
if (!VxeUIButtonComponent) {
|
|
693
|
+
errLog("vxe.error.reqComp", ["vxe-button"]);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
(0, import_vue.onBeforeUnmount)(() => {
|
|
698
|
+
import_xe_utils.default.assign(reactData, createReactData());
|
|
699
|
+
import_xe_utils.default.assign(internalData, createInternalData());
|
|
700
|
+
});
|
|
701
|
+
return $xeToolbar;
|
|
702
|
+
},
|
|
703
|
+
render() {
|
|
704
|
+
return this.renderVN();
|
|
705
|
+
}
|
|
706
|
+
})
|
|
707
|
+
);
|