vft 0.0.482 → 0.0.485
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/index.css +1 -1
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/horizontal-menu/horizontal-menu.vue.d.ts +20 -4
- package/es/components/horizontal-menu/horizontal-menu.vue2.js +29 -29
- package/es/components/horizontal-menu/index.d.ts +20 -4
- package/es/components/input/input.vue2.js +4 -4
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/menu/index.d.ts +28 -7
- package/es/components/menu/menu-item-group.vue.d.ts +2 -4
- package/es/components/menu/menu-item.vue.d.ts +1 -17
- package/es/components/menu/menu.vue.d.ts +3 -28
- package/es/components/menu/menu.vue2.js +81 -76
- package/es/components/menu/sub-menu.vue.d.ts +1 -19
- package/es/components/menu/types.d.ts +64 -0
- package/es/components/side-menu/index.d.ts +55 -4
- package/es/components/side-menu/side-menu.vue.d.ts +20 -3
- package/es/components/side-menu/side-menu.vue2.js +166 -139
- package/es/components/side-menu/types.d.ts +13 -2
- package/es/components/super-form/super-form-action.vue2.js +55 -55
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/horizontal-menu/horizontal-menu.vue.d.ts +20 -4
- package/lib/components/horizontal-menu/horizontal-menu.vue2.cjs +1 -1
- package/lib/components/horizontal-menu/index.d.ts +20 -4
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/menu/index.d.ts +28 -7
- package/lib/components/menu/menu-item-group.vue.d.ts +2 -4
- package/lib/components/menu/menu-item.vue.d.ts +1 -17
- package/lib/components/menu/menu.vue.d.ts +3 -28
- package/lib/components/menu/menu.vue2.cjs +1 -1
- package/lib/components/menu/sub-menu.vue.d.ts +1 -19
- package/lib/components/menu/types.d.ts +64 -0
- package/lib/components/side-menu/index.d.ts +55 -4
- package/lib/components/side-menu/side-menu.vue.d.ts +20 -3
- package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
- package/lib/components/side-menu/types.d.ts +13 -2
- package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/theme-style/index.css +1 -1
- package/theme-style/src/menu.scss +54 -0
- package/theme-style/vft-menu.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { isNullOrUndefined as W, isNumber as j, isUrl as be } from "@vft/utils";
|
|
1
|
+
import { defineComponent as H, toRefs as de, useSlots as ce, getCurrentInstance as pe, ref as h, computed as b, watch as fe, onMounted as me, nextTick as ve, createVNode as m, h as y, isVNode as he } from "vue";
|
|
2
|
+
import { VftIcon as ge } from "../icon/index.js";
|
|
3
|
+
import { VftMenu as be, VftSubMenu as ye, VftMenuItem as j, VftMenuItemGroup as Me } from "../menu/index.js";
|
|
5
4
|
import "@vueuse/core";
|
|
6
|
-
import {
|
|
5
|
+
import { isNullOrUndefined as q, isNumber as E, isUrl as Se } from "@vft/utils";
|
|
6
|
+
import { addUnit as O } from "../../utils/helper.js";
|
|
7
7
|
import "lodash-es";
|
|
8
8
|
import "../form/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { useNamespace as
|
|
9
|
+
import { listenerRouteChange as Ce, useRouterHelper as Oe } from "@vft/router";
|
|
10
|
+
import { useSortable as xe } from "@vft/use/sortable";
|
|
11
|
+
import { useNamespace as Te } from "../../hooks/use-namespace/index.js";
|
|
12
12
|
import "../../hooks/use-model-toggle/index.js";
|
|
13
13
|
import "@popperjs/core";
|
|
14
14
|
import "../../hooks/use-z-index/index.js";
|
|
15
|
-
import { useDragLine as
|
|
16
|
-
function
|
|
17
|
-
return typeof g == "function" || Object.prototype.toString.call(g) === "[object Object]" && !
|
|
15
|
+
import { useDragLine as Be } from "./use-drag-line.js";
|
|
16
|
+
function _e(g) {
|
|
17
|
+
return typeof g == "function" || Object.prototype.toString.call(g) === "[object Object]" && !he(g);
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const we = H({
|
|
20
20
|
name: "vft-side-menu"
|
|
21
|
-
}),
|
|
22
|
-
...
|
|
21
|
+
}), Ue = /* @__PURE__ */ H({
|
|
22
|
+
...we,
|
|
23
23
|
props: {
|
|
24
24
|
isFixedLeft: {
|
|
25
25
|
type: Boolean,
|
|
@@ -84,21 +84,39 @@ const _e = J({
|
|
|
84
84
|
disableSubMenuAction: {
|
|
85
85
|
type: Boolean,
|
|
86
86
|
default: !1
|
|
87
|
-
}
|
|
87
|
+
},
|
|
88
|
+
enableScroll: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: !0
|
|
91
|
+
},
|
|
92
|
+
scrollThreshold: {
|
|
93
|
+
default: 10
|
|
94
|
+
},
|
|
95
|
+
scrollMaxHeight: {
|
|
96
|
+
default: 500
|
|
97
|
+
},
|
|
98
|
+
collapseTransition: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: !1
|
|
101
|
+
},
|
|
102
|
+
collapseType: {
|
|
103
|
+
default: void 0
|
|
104
|
+
},
|
|
105
|
+
tooltipCfg: {}
|
|
88
106
|
},
|
|
89
107
|
emits: ["update:collapse", "update:width", "dragEnd", "dragWidthEnd", "select", "subMenuClick", "subMenuOpenClick", "menuItemMouseenter", "menuItemMouseleave"],
|
|
90
108
|
setup(g, {
|
|
91
|
-
expose:
|
|
92
|
-
emit:
|
|
109
|
+
expose: J,
|
|
110
|
+
emit: L
|
|
93
111
|
}) {
|
|
94
|
-
const t = g,
|
|
95
|
-
defaultActive:
|
|
112
|
+
const t = g, r = L, {
|
|
113
|
+
defaultActive: P,
|
|
96
114
|
collapse: f,
|
|
97
115
|
uniqueOpened: U,
|
|
98
116
|
defaultOpeneds: $,
|
|
99
117
|
openMenuCollapse: F,
|
|
100
118
|
defaultOpenedsLevel: M
|
|
101
|
-
} =
|
|
119
|
+
} = de(t), s = Te("side-menu"), d = ce(), x = pe(), T = h(), a = b(() => ({
|
|
102
120
|
path: "path",
|
|
103
121
|
children: "children",
|
|
104
122
|
title: "title",
|
|
@@ -106,195 +124,204 @@ const _e = J({
|
|
|
106
124
|
icon: "icon",
|
|
107
125
|
disabled: "disabled",
|
|
108
126
|
...t.attrMapping
|
|
109
|
-
})),
|
|
110
|
-
const l = [],
|
|
111
|
-
|
|
112
|
-
|
|
127
|
+
})), Y = (e, n = 1 / 0) => {
|
|
128
|
+
const l = [], o = (u, c = 0) => {
|
|
129
|
+
c >= n || u.forEach((i) => {
|
|
130
|
+
i[a.value.children]?.length && (l.push(i[a.value.index]), o(i[a.value.children], c + 1));
|
|
113
131
|
});
|
|
114
132
|
};
|
|
115
|
-
return
|
|
133
|
+
return o(e), l;
|
|
116
134
|
};
|
|
117
|
-
|
|
135
|
+
Ce(({
|
|
118
136
|
route: e
|
|
119
137
|
}) => {
|
|
120
|
-
!e || e.meta?.hideSide && !t.useRouterJump || (
|
|
138
|
+
!e || e.meta?.hideSide && !t.useRouterJump || (T.value = e.path);
|
|
121
139
|
});
|
|
122
|
-
const
|
|
123
|
-
const
|
|
124
|
-
if (t.autoScrollActiveDom &&
|
|
125
|
-
const l =
|
|
126
|
-
|
|
127
|
-
activeDom:
|
|
140
|
+
const Z = (e) => {
|
|
141
|
+
const n = e.e;
|
|
142
|
+
if (t.autoScrollActiveDom && n) {
|
|
143
|
+
const l = E(t.autoScrollActiveDom) ? t.autoScrollActiveDom : 0, o = n.target;
|
|
144
|
+
B({
|
|
145
|
+
activeDom: o,
|
|
128
146
|
offset: l
|
|
129
147
|
});
|
|
130
148
|
}
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
},
|
|
149
|
+
r("subMenuOpenClick", e);
|
|
150
|
+
}, z = (e) => {
|
|
151
|
+
r("subMenuClick", e);
|
|
152
|
+
}, B = ({
|
|
135
153
|
activeDom: e = null,
|
|
136
|
-
offset:
|
|
154
|
+
offset: n = 0,
|
|
137
155
|
delay: l = 300
|
|
138
156
|
} = {}) => {
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
|
|
157
|
+
v.value?.menu && setTimeout(() => {
|
|
158
|
+
const o = e || document.querySelector(".vft-menu-item.is-active") || document.querySelector(".vft-sub-menu.is-active");
|
|
159
|
+
o && (v.value.menu.scrollTop = v.value.menu.scrollTop + (o.getBoundingClientRect().top - v.value.menu.getBoundingClientRect().top) + n);
|
|
142
160
|
}, l);
|
|
143
161
|
}, G = (e) => {
|
|
144
|
-
|
|
162
|
+
r("menuItemMouseenter", e);
|
|
145
163
|
}, K = (e) => {
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
r("menuItemMouseleave", e);
|
|
165
|
+
}, Q = (e, n) => !t.enableScroll || !e ? e : f.value && n > t.scrollThreshold ? y(Me, {
|
|
166
|
+
style: {
|
|
167
|
+
maxHeight: O(t.scrollMaxHeight),
|
|
168
|
+
overflowY: "auto"
|
|
169
|
+
}
|
|
170
|
+
}, () => e) : e, _ = (e, n) => {
|
|
171
|
+
const l = e[a.value.path], o = e[a.value.title], u = e?.[a.value.children], c = e?.[a.value.index], i = e?.[a.value.icon], R = !!e?.[a.value.disabled], I = t.disabledJudgeTurnOver ? !R : R, N = c || l || n + o;
|
|
172
|
+
return u?.length ? y(ye, {
|
|
173
|
+
...e,
|
|
174
|
+
popperAppendToBody: !0,
|
|
175
|
+
key: N,
|
|
176
|
+
index: N,
|
|
177
|
+
title: o,
|
|
178
|
+
icon: i,
|
|
179
|
+
disabled: t.openDisabled && I,
|
|
180
|
+
popperClass: s.e("popper"),
|
|
181
|
+
toolTipCfg: {
|
|
182
|
+
placement: "right",
|
|
183
|
+
"fallback-placements": ["right-start", "right"],
|
|
184
|
+
...t.tooltipCfg
|
|
185
|
+
}
|
|
186
|
+
}, {
|
|
187
|
+
default: () => {
|
|
188
|
+
const ae = u?.map((p, ue) => {
|
|
189
|
+
const C = p[a.value.path], V = p[a.value.index], se = p[a.value.icon], ie = p[a.value.title], W = !!p[a.value.disabled], re = t.disabledJudgeTurnOver ? !W : W;
|
|
190
|
+
return p?.[a.value.children]?.length ? _(p, ue) : (
|
|
166
191
|
// @ts-ignore
|
|
167
|
-
y(
|
|
168
|
-
...
|
|
169
|
-
key:
|
|
170
|
-
index:
|
|
171
|
-
route:
|
|
172
|
-
icon:
|
|
173
|
-
title:
|
|
174
|
-
disabled: t.openDisabled &&
|
|
175
|
-
},
|
|
176
|
-
item:
|
|
192
|
+
y(j, {
|
|
193
|
+
...p,
|
|
194
|
+
key: V || C,
|
|
195
|
+
index: V || C,
|
|
196
|
+
route: C,
|
|
197
|
+
icon: se,
|
|
198
|
+
title: ie,
|
|
199
|
+
disabled: t.openDisabled && re
|
|
200
|
+
}, d.menuItem ? () => d.menuItem?.({
|
|
201
|
+
item: p
|
|
177
202
|
}) : "")
|
|
178
203
|
);
|
|
179
|
-
})
|
|
204
|
+
});
|
|
205
|
+
return Q(ae, u?.length || 0);
|
|
180
206
|
}
|
|
181
|
-
) : y(
|
|
207
|
+
}) : y(j, {
|
|
182
208
|
...e,
|
|
183
|
-
key:
|
|
184
|
-
index:
|
|
185
|
-
title:
|
|
209
|
+
key: c || l,
|
|
210
|
+
index: c || l,
|
|
211
|
+
title: o,
|
|
186
212
|
route: l,
|
|
187
|
-
icon:
|
|
188
|
-
disabled: t.openDisabled &&
|
|
213
|
+
icon: i,
|
|
214
|
+
disabled: t.openDisabled && I,
|
|
189
215
|
onMouseenter: () => G(e),
|
|
190
216
|
onMouseleave: () => K(e)
|
|
191
|
-
},
|
|
217
|
+
}, d.menuItem ? () => d.menuItem?.({
|
|
192
218
|
item: e,
|
|
193
|
-
index:
|
|
219
|
+
index: n
|
|
194
220
|
}) : "");
|
|
195
|
-
},
|
|
221
|
+
}, v = h(), X = b(() => ({
|
|
196
222
|
...t.collapseWidth === 0 && f.value ? {
|
|
197
223
|
width: 0
|
|
198
224
|
} : {},
|
|
199
225
|
height: `calc(100% - ${t.menuTopBottomHeight}px)`
|
|
200
|
-
})), w =
|
|
201
|
-
|
|
226
|
+
})), w = x.appContext.config.globalProperties.$router;
|
|
227
|
+
function ee(e, n) {
|
|
202
228
|
if (t.useRouterJump) {
|
|
203
229
|
const {
|
|
204
|
-
go:
|
|
205
|
-
} =
|
|
206
|
-
let
|
|
207
|
-
e.indexPath.some((i) =>
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
url:
|
|
230
|
+
go: l
|
|
231
|
+
} = Oe(w), o = e.route;
|
|
232
|
+
let u = e.route;
|
|
233
|
+
e.indexPath.some((i) => Se(i)) && (u = e.indexPath.slice(-2).join("/"));
|
|
234
|
+
const c = w.getRoutes().filter((i) => i.path === u)?.[0]?.meta?.linkTarget;
|
|
235
|
+
l(c ? {
|
|
236
|
+
url: o,
|
|
211
237
|
winOpenOpt: {
|
|
212
|
-
target:
|
|
238
|
+
target: c
|
|
213
239
|
}
|
|
214
|
-
} :
|
|
240
|
+
} : o);
|
|
215
241
|
}
|
|
216
|
-
|
|
242
|
+
r("select", e, n);
|
|
217
243
|
}
|
|
218
|
-
const S = h(),
|
|
244
|
+
const S = h(), k = h(), D = h(), te = b(() => ({
|
|
219
245
|
...t.collapseWidth === 0 && f.value ? {
|
|
220
246
|
borderRight: "none"
|
|
221
247
|
} : {},
|
|
222
|
-
width:
|
|
248
|
+
width: O(t.width),
|
|
223
249
|
height: t.height
|
|
224
250
|
}));
|
|
225
|
-
|
|
226
|
-
|
|
251
|
+
fe(() => f.value, (e) => {
|
|
252
|
+
le.value || (e ? r("update:width", t.collapseWidth) : r("update:width", D.value || t.width), D.value = t.width);
|
|
227
253
|
});
|
|
228
254
|
const {
|
|
229
|
-
isDraging:
|
|
230
|
-
} =
|
|
231
|
-
left:
|
|
232
|
-
})), ne = b(() => [
|
|
233
|
-
return
|
|
234
|
-
|
|
255
|
+
isDraging: le
|
|
256
|
+
} = Be(S, k, x), oe = b(() => ({
|
|
257
|
+
left: O(t.width)
|
|
258
|
+
})), ne = b(() => [s.b(), t.isFixedLeft ? s.m("fixed") : ""]), A = h([]);
|
|
259
|
+
return me(() => {
|
|
260
|
+
ve(() => {
|
|
235
261
|
if (t.dragOption?.dragClassName) {
|
|
236
|
-
const e = document.querySelectorAll(`.${
|
|
237
|
-
initSortable:
|
|
238
|
-
} =
|
|
262
|
+
const e = document.querySelectorAll(`.${s.e(t.dragOption?.dragClassName)}`)?.[0], {
|
|
263
|
+
initSortable: n
|
|
264
|
+
} = xe(e, {
|
|
239
265
|
draggable: ".vft-menu-item",
|
|
240
266
|
onEnd: (l) => {
|
|
241
267
|
const {
|
|
242
|
-
oldIndex:
|
|
243
|
-
newIndex:
|
|
268
|
+
oldIndex: o,
|
|
269
|
+
newIndex: u
|
|
244
270
|
} = l;
|
|
245
|
-
|
|
271
|
+
q(o) || q(u) || o === u || r("dragEnd", o, u);
|
|
246
272
|
},
|
|
247
273
|
...t.dragOption
|
|
248
274
|
});
|
|
249
|
-
|
|
275
|
+
n();
|
|
250
276
|
}
|
|
251
277
|
});
|
|
252
|
-
}),
|
|
278
|
+
}), J({
|
|
253
279
|
sideRef: S,
|
|
254
|
-
jumpActiveDom:
|
|
255
|
-
menuRef:
|
|
280
|
+
jumpActiveDom: B,
|
|
281
|
+
menuRef: v
|
|
256
282
|
}), () => {
|
|
257
283
|
let e;
|
|
258
|
-
return M.value && (A.value =
|
|
284
|
+
return M.value && (A.value = Y(t.menus, E(M.value) ? M.value : 1 / 0)), m("div", {
|
|
259
285
|
ref: S,
|
|
260
286
|
class: ne.value,
|
|
261
|
-
style:
|
|
262
|
-
}, [
|
|
263
|
-
class:
|
|
264
|
-
}, [
|
|
265
|
-
ref:
|
|
266
|
-
onSelect:
|
|
267
|
-
onOpen:
|
|
268
|
-
onSubMenuClick:
|
|
269
|
-
defaultActive:
|
|
287
|
+
style: te.value
|
|
288
|
+
}, [d.top ? m("div", {
|
|
289
|
+
class: s.e("top")
|
|
290
|
+
}, [d.top()]) : null, y(m(be, {
|
|
291
|
+
ref: v,
|
|
292
|
+
onSelect: ee,
|
|
293
|
+
onOpen: Z,
|
|
294
|
+
onSubMenuClick: z,
|
|
295
|
+
defaultActive: P?.value || T.value,
|
|
270
296
|
defaultOpeneds: $?.value || A.value,
|
|
271
297
|
disableSubMenuAction: t.disableSubMenuAction,
|
|
272
|
-
class: [
|
|
273
|
-
style:
|
|
298
|
+
class: [s.e("con"), t.dragOption?.dragClassName ? s.e(t.dragOption?.dragClassName) : ""],
|
|
299
|
+
style: X.value,
|
|
274
300
|
collapse: F.value ? f.value : !1,
|
|
275
301
|
uniqueOpened: U.value,
|
|
276
|
-
collapseTransition:
|
|
277
|
-
|
|
302
|
+
collapseTransition: t.collapseTransition,
|
|
303
|
+
collapseType: t.collapseType
|
|
304
|
+
}, _e(e = t.menus.map((n, l) => _(n, l))) ? e : {
|
|
278
305
|
default: () => [e]
|
|
279
|
-
})),
|
|
280
|
-
class:
|
|
281
|
-
}, [
|
|
282
|
-
onClick: () =>
|
|
283
|
-
class: [
|
|
284
|
-
}, [
|
|
306
|
+
})), d.bottom ? m("div", {
|
|
307
|
+
class: s.e("bottom")
|
|
308
|
+
}, [d.bottom()]) : t.showCollapse ? m("div", {
|
|
309
|
+
onClick: () => r("update:collapse", !f.value),
|
|
310
|
+
class: [s.e("bottom"), s.e("collapse")]
|
|
311
|
+
}, [m(ge, {
|
|
285
312
|
style: {
|
|
286
313
|
transform: f.value ? "rotateY(180deg)" : ""
|
|
287
314
|
},
|
|
288
315
|
size: 20,
|
|
289
316
|
icon: "icon-sidebar-collapse"
|
|
290
|
-
}, null)]) : null,
|
|
291
|
-
ref:
|
|
292
|
-
style:
|
|
293
|
-
class:
|
|
317
|
+
}, null)]) : null, d.default?.(), t.dragWidthCfg ? m("div", {
|
|
318
|
+
ref: k,
|
|
319
|
+
style: oe.value,
|
|
320
|
+
class: s.e("drag-bar")
|
|
294
321
|
}, null) : null]);
|
|
295
322
|
};
|
|
296
323
|
}
|
|
297
324
|
});
|
|
298
325
|
export {
|
|
299
|
-
|
|
326
|
+
Ue as default
|
|
300
327
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { MenuItemClicked } from 'vft/es/components/menu';
|
|
2
|
+
import type { ToolTipProps } from 'vft/es/components/tooltip';
|
|
1
3
|
import type Sortable from 'sortablejs';
|
|
2
4
|
import type { SortableEvent } from 'sortablejs';
|
|
5
|
+
import type { NavigationFailure } from 'vue-router';
|
|
3
6
|
/** 菜单项类型 */
|
|
4
7
|
export type MenuType = {
|
|
5
8
|
/** 子菜单列表 */
|
|
@@ -72,11 +75,19 @@ export interface SideMenuProps {
|
|
|
72
75
|
/** 默认选中的菜单索引 */
|
|
73
76
|
defaultActive?: string;
|
|
74
77
|
/** 默认展开的子菜单索引数组 */
|
|
75
|
-
defaultOpeneds?: Array<string
|
|
78
|
+
defaultOpeneds?: Array<string>;
|
|
76
79
|
/** 默认展开的层级深度 */
|
|
77
80
|
defaultOpenedsLevel?: number | boolean;
|
|
78
81
|
/** 禁用子菜单的展开收缩行为 */
|
|
79
82
|
disableSubMenuAction?: boolean;
|
|
83
|
+
enableScroll?: boolean;
|
|
84
|
+
scrollThreshold?: number;
|
|
85
|
+
scrollMaxHeight?: string | number;
|
|
86
|
+
/** 是否开启折叠动画 */
|
|
87
|
+
collapseTransition?: boolean;
|
|
88
|
+
/** 收缩类型 */
|
|
89
|
+
collapseType?: 'menu-title';
|
|
90
|
+
tooltipCfg?: Partial<ToolTipProps>;
|
|
80
91
|
}
|
|
81
92
|
/** 菜单选中事件参数 */
|
|
82
93
|
export interface MenuSelectEventData {
|
|
@@ -96,7 +107,7 @@ export interface SideMenuEmits {
|
|
|
96
107
|
/** 拖拽宽度结束事件 */
|
|
97
108
|
(e: 'dragWidthEnd'): void;
|
|
98
109
|
/** 菜单选中事件 */
|
|
99
|
-
(e: 'select',
|
|
110
|
+
(e: 'select', menuItem: MenuItemClicked, routerResult?: Promise<void | NavigationFailure>): void;
|
|
100
111
|
/** 子菜单点击事件 */
|
|
101
112
|
(e: 'subMenuClick', val: any): void;
|
|
102
113
|
/** 子菜单展开点击事件 */
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as g, computed as
|
|
2
|
-
import { VftButton as
|
|
3
|
-
import { VftFormItem as
|
|
4
|
-
import { VftRow as
|
|
1
|
+
import { defineComponent as g, computed as i, createBlock as l, createCommentVNode as c, openBlock as r, unref as o, normalizeProps as x, mergeProps as p, withCtx as u, createVNode as R, normalizeClass as T, renderSlot as b, createTextVNode as B, toDisplayString as f } from "vue";
|
|
2
|
+
import { VftButton as v } from "../button/index.js";
|
|
3
|
+
import { VftFormItem as N } from "../form/index.js";
|
|
4
|
+
import { VftRow as V } from "../row/index.js";
|
|
5
5
|
import "@vueuse/core";
|
|
6
6
|
import "@vft/utils";
|
|
7
7
|
import "../config-provider/hooks/use-global-config.js";
|
|
8
8
|
import "lodash-es";
|
|
9
|
-
import { useNamespace as
|
|
9
|
+
import { useNamespace as S } from "../../hooks/use-namespace/index.js";
|
|
10
10
|
import "../../hooks/use-model-toggle/index.js";
|
|
11
11
|
import "@popperjs/core";
|
|
12
12
|
import "../../hooks/use-z-index/index.js";
|
|
13
|
-
import { useFormContext as
|
|
14
|
-
const
|
|
13
|
+
import { useFormContext as j } from "./use/use-form-context.js";
|
|
14
|
+
const M = /* @__PURE__ */ g({
|
|
15
15
|
__name: "super-form-action",
|
|
16
16
|
props: {
|
|
17
17
|
showResetButton: { type: Boolean },
|
|
@@ -23,86 +23,86 @@ const Q = /* @__PURE__ */ g({
|
|
|
23
23
|
actionRowOptions: {},
|
|
24
24
|
submitResetReverse: { type: Boolean }
|
|
25
25
|
},
|
|
26
|
-
setup(
|
|
27
|
-
const m =
|
|
26
|
+
setup(t) {
|
|
27
|
+
const m = S("form-action"), { resetAction: d, submitAction: h, commonAction: C } = j(), k = i(() => ({
|
|
28
28
|
justify: "end",
|
|
29
|
-
...
|
|
30
|
-
})),
|
|
31
|
-
() => Object.assign({ btnText: "重置" },
|
|
32
|
-
),
|
|
33
|
-
() => Object.assign({ btnText: "确认" },
|
|
34
|
-
),
|
|
35
|
-
() => Object.assign({ btnText: "取消" },
|
|
29
|
+
...t.actionRowOptions
|
|
30
|
+
})), O = i(
|
|
31
|
+
() => Object.assign({ btnText: "重置" }, t.resetButtonOptions)
|
|
32
|
+
), w = i(
|
|
33
|
+
() => Object.assign({ btnText: "确认" }, t.submitButtonOptions)
|
|
34
|
+
), a = i(
|
|
35
|
+
() => Object.assign({ btnText: "取消" }, t.commonButtonOptions)
|
|
36
36
|
), y = (e) => ({
|
|
37
37
|
type: e ? "warning" : "primary",
|
|
38
|
-
options: e ?
|
|
39
|
-
action: e ?
|
|
38
|
+
options: e ? O.value : w.value,
|
|
39
|
+
action: e ? d : h,
|
|
40
40
|
className: e ? m.e("reset") : m.e("submit"),
|
|
41
|
-
show: e ?
|
|
42
|
-
}),
|
|
43
|
-
() => y(!
|
|
44
|
-
),
|
|
45
|
-
() => y(
|
|
41
|
+
show: e ? t.showResetButton : t.showSubmitButton
|
|
42
|
+
}), n = i(
|
|
43
|
+
() => y(!t.submitResetReverse)
|
|
44
|
+
), s = i(
|
|
45
|
+
() => y(t.submitResetReverse)
|
|
46
46
|
);
|
|
47
|
-
return (e,
|
|
47
|
+
return (e, A) => t.showCommonButton || n.value.show || s.value.show ? (r(), l(o(V), x(p({ key: 0 }, k.value)), {
|
|
48
48
|
default: u(() => [
|
|
49
|
-
|
|
50
|
-
class:
|
|
49
|
+
R(o(N), {
|
|
50
|
+
class: T([{ "submit-block": w.value.block }, o(m).b()])
|
|
51
51
|
}, {
|
|
52
52
|
default: u(() => [
|
|
53
|
-
|
|
54
|
-
class:
|
|
55
|
-
onClick:
|
|
53
|
+
t.showCommonButton && !a.value.isBehind ? (r(), l(o(v), p({ key: 0 }, a.value, {
|
|
54
|
+
class: o(m).e("common"),
|
|
55
|
+
onClick: o(C)
|
|
56
56
|
}), {
|
|
57
57
|
default: u(() => [
|
|
58
|
-
B(f(
|
|
58
|
+
B(f(a.value.btnText), 1)
|
|
59
59
|
]),
|
|
60
60
|
_: 1
|
|
61
|
-
}, 16, ["class", "onClick"])) :
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
}, 16, ["class", "onClick"])) : c("", !0),
|
|
62
|
+
b(e.$slots, "resetBefore"),
|
|
63
|
+
n.value.show ? (r(), l(o(v), p({
|
|
64
64
|
key: 1,
|
|
65
|
-
type:
|
|
66
|
-
},
|
|
67
|
-
onClick:
|
|
68
|
-
class:
|
|
65
|
+
type: n.value.type
|
|
66
|
+
}, n.value.options, {
|
|
67
|
+
onClick: n.value.action,
|
|
68
|
+
class: n.value.className
|
|
69
69
|
}), {
|
|
70
70
|
default: u(() => [
|
|
71
|
-
B(f(
|
|
71
|
+
B(f(n.value.options.btnText), 1)
|
|
72
72
|
]),
|
|
73
73
|
_: 1
|
|
74
|
-
}, 16, ["type", "onClick", "class"])) :
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
}, 16, ["type", "onClick", "class"])) : c("", !0),
|
|
75
|
+
b(e.$slots, "submitBefore"),
|
|
76
|
+
s.value.show ? (r(), l(o(v), p({
|
|
77
77
|
key: 2,
|
|
78
|
-
type:
|
|
79
|
-
},
|
|
80
|
-
onClick:
|
|
81
|
-
class:
|
|
78
|
+
type: s.value.type
|
|
79
|
+
}, s.value.options, {
|
|
80
|
+
onClick: s.value.action,
|
|
81
|
+
class: s.value.className
|
|
82
82
|
}), {
|
|
83
83
|
default: u(() => [
|
|
84
|
-
B(f(
|
|
84
|
+
B(f(s.value.options.btnText), 1)
|
|
85
85
|
]),
|
|
86
86
|
_: 1
|
|
87
|
-
}, 16, ["type", "onClick", "class"])) :
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
class:
|
|
91
|
-
onClick:
|
|
87
|
+
}, 16, ["type", "onClick", "class"])) : c("", !0),
|
|
88
|
+
b(e.$slots, "submitAfter"),
|
|
89
|
+
t.showCommonButton && a.value.isBehind ? (r(), l(o(v), p({ key: 3 }, a.value, {
|
|
90
|
+
class: o(m).e("common"),
|
|
91
|
+
onClick: o(C)
|
|
92
92
|
}), {
|
|
93
93
|
default: u(() => [
|
|
94
|
-
B(f(
|
|
94
|
+
B(f(a.value.btnText), 1)
|
|
95
95
|
]),
|
|
96
96
|
_: 1
|
|
97
|
-
}, 16, ["class", "onClick"])) :
|
|
97
|
+
}, 16, ["class", "onClick"])) : c("", !0)
|
|
98
98
|
]),
|
|
99
99
|
_: 3
|
|
100
100
|
}, 8, ["class"])
|
|
101
101
|
]),
|
|
102
102
|
_: 3
|
|
103
|
-
}, 16));
|
|
103
|
+
}, 16)) : c("", !0);
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
export {
|
|
107
|
-
|
|
107
|
+
M as default
|
|
108
108
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as X, computed as j, ref as re, unref as c, useSlots as oe, createVNode as a, mergeProps as q, withDirectives as ie, vShow as ne,
|
|
1
|
+
import { defineComponent as X, computed as j, ref as re, unref as c, useSlots as oe, createVNode as a, mergeProps as q, withDirectives as ie, vShow as ne, isVNode as le, createTextVNode as O, resolveComponent as N } from "vue";
|
|
2
2
|
import "../alert/index.js";
|
|
3
3
|
import "../avatar/index.js";
|
|
4
4
|
import "../avatar-stack/index.js";
|
package/es/package.json.d.ts
CHANGED
package/es/package.json.js
CHANGED
package/es/utils/vue/vnode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isArray as E, hasOwn as m, camelize as N } from "@vft/utils";
|
|
2
2
|
import { isVNode as o, Fragment as S, Comment as A, Text as s, createCommentVNode as L, createBlock as _, openBlock as C } from "vue";
|
|
3
3
|
import { debugWarn as O } from "../error.js";
|
|
4
4
|
const R = "utils/vue/vnode";
|