@dv.net/ui-kit 7.5.9 → 7.5.10
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/assets/UiLayoutMenu.vue_vue_type_script_setup_true_lang.s_cerqGK.js +71 -0
- package/dist/assets/{UiLayoutMenuItem.vue_vue_type_script_setup_true_lang.DFKZwWfN.js → UiLayoutMenuItem.vue_vue_type_script_setup_true_lang.CDnwiaSr.js} +72 -72
- package/dist/components/UiLayoutMenu/UiLayoutMenu.js +1 -1
- package/dist/components/UiLayoutMenu/UiLayoutMenuItem.js +1 -1
- package/dist/components/UiLayoutMenu/types.d.ts +1 -0
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/assets/UiLayoutMenu.vue_vue_type_script_setup_true_lang.Bpce0J4j.js +0 -59
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineComponent as $, computed as c, createElementBlock as l, openBlock as u, normalizeClass as B, Fragment as v, renderList as y, createVNode as g } from "vue";
|
|
2
|
+
import { _ as R } from "./UiLayoutMenuItem.vue_vue_type_script_setup_true_lang.CDnwiaSr.js";
|
|
3
|
+
import "./style.C3xG1ALc.js";
|
|
4
|
+
import { useRoute as C } from "vue-router";
|
|
5
|
+
const L = /* @__PURE__ */ $({
|
|
6
|
+
__name: "UiLayoutMenu",
|
|
7
|
+
props: {
|
|
8
|
+
routeItems: {},
|
|
9
|
+
collapsed: { type: Boolean, default: !1 }
|
|
10
|
+
},
|
|
11
|
+
emits: ["selected"],
|
|
12
|
+
setup(k) {
|
|
13
|
+
const a = k, p = C(), h = (e) => (e.length > 1 ? e.replace(/\/+$/, "") : e).toLowerCase(), M = c(() => {
|
|
14
|
+
const e = (r) => {
|
|
15
|
+
let t = [];
|
|
16
|
+
return r.forEach((o) => {
|
|
17
|
+
t.push(o), o.children?.length && (t = t.concat(e(o.children)));
|
|
18
|
+
}), t;
|
|
19
|
+
};
|
|
20
|
+
return e(a.routeItems);
|
|
21
|
+
}), m = c(() => {
|
|
22
|
+
function e(r, t, o = []) {
|
|
23
|
+
for (const n of t)
|
|
24
|
+
if (n.children && n.children.length > 0 && (n.children.some((i) => i?.path === r) || e(r, n.children, o)))
|
|
25
|
+
return o.push(n?.path), o;
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return e(p?.path, a.routeItems);
|
|
29
|
+
}), d = c(() => {
|
|
30
|
+
const e = h(p.path);
|
|
31
|
+
let r = null;
|
|
32
|
+
const t = (o) => {
|
|
33
|
+
o.forEach((n) => {
|
|
34
|
+
const s = h(n.path), f = s === e, i = s !== "/" && e.startsWith(`${s}/`);
|
|
35
|
+
(f || i) && (!r || s.length > r.length) && (r = s), n.children?.length && t(n.children);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
return t(a.routeItems), r;
|
|
39
|
+
});
|
|
40
|
+
return (e, r) => (u(), l("ul", {
|
|
41
|
+
class: B(["ui-layout-menu", { "is-collapsed": e.collapsed }])
|
|
42
|
+
}, [
|
|
43
|
+
e.collapsed ? (u(!0), l(v, { key: 0 }, y(M.value, (t) => (u(), l("li", {
|
|
44
|
+
key: t?.path
|
|
45
|
+
}, [
|
|
46
|
+
g(R, {
|
|
47
|
+
"route-item": t,
|
|
48
|
+
collapsed: e.collapsed,
|
|
49
|
+
"route-items": e.routeItems,
|
|
50
|
+
parrentRoutes: m.value,
|
|
51
|
+
"active-menu-path": d.value,
|
|
52
|
+
onSelected: r[0] || (r[0] = (o) => e.$emit("selected", o))
|
|
53
|
+
}, null, 8, ["route-item", "collapsed", "route-items", "parrentRoutes", "active-menu-path"])
|
|
54
|
+
]))), 128)) : (u(!0), l(v, { key: 1 }, y(e.routeItems, (t) => (u(), l("li", {
|
|
55
|
+
key: t?.path
|
|
56
|
+
}, [
|
|
57
|
+
g(R, {
|
|
58
|
+
"route-item": t,
|
|
59
|
+
collapsed: e.collapsed,
|
|
60
|
+
"route-items": e.routeItems,
|
|
61
|
+
parrentRoutes: m.value,
|
|
62
|
+
"active-menu-path": d.value,
|
|
63
|
+
onSelected: r[1] || (r[1] = (o) => e.$emit("selected", o))
|
|
64
|
+
}, null, 8, ["route-item", "collapsed", "route-items", "parrentRoutes", "active-menu-path"])
|
|
65
|
+
]))), 128))
|
|
66
|
+
], 2));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
export {
|
|
70
|
+
L as _
|
|
71
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as A, inject as D, ref as O, computed as M, resolveComponent as b, createElementBlock as m, openBlock as o, Fragment as I, createBlock as s, createCommentVNode as u, resolveDynamicComponent as k, withModifiers as P, withCtx as N, createElementVNode as S, withKeys as U, unref as p, normalizeClass as C, withDirectives as v, createVNode as w, vShow as h, toDisplayString as g, renderList as V } from "vue";
|
|
2
2
|
import { _ as R } from "./UiIcon.vue_vue_type_script_setup_true_lang.DFsApq5s.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import {
|
|
5
|
-
import { _ as F } from "./UiAnimation.vue_vue_type_script_setup_true_lang.DaVsSmL9.js";
|
|
4
|
+
import { _ as E } from "./UiAnimation.vue_vue_type_script_setup_true_lang.DaVsSmL9.js";
|
|
6
5
|
import "./style.C3xG1ALc.js";
|
|
7
6
|
/* empty css */
|
|
8
7
|
import "../config/index.js";
|
|
@@ -25,7 +24,8 @@ import "../components/UiDatepicker/composables/useDatePickerPresets.js";
|
|
|
25
24
|
/* empty css */
|
|
26
25
|
/* empty css */
|
|
27
26
|
/* empty css */
|
|
28
|
-
import { menuProvideDefault as
|
|
27
|
+
import { menuProvideDefault as F } from "../components/UiLayout/types.js";
|
|
28
|
+
import "vue-router";
|
|
29
29
|
/* empty css */
|
|
30
30
|
/* empty css */
|
|
31
31
|
/* empty css */
|
|
@@ -33,135 +33,135 @@ import { menuProvideDefault as H } from "../components/UiLayout/types.js";
|
|
|
33
33
|
/* empty css */
|
|
34
34
|
/* empty css */
|
|
35
35
|
/* empty css */
|
|
36
|
-
import { w as
|
|
37
|
-
const
|
|
36
|
+
import { w as K } from "./index.DeYcP251.js";
|
|
37
|
+
const j = {
|
|
38
38
|
key: 3,
|
|
39
39
|
class: "ui-layout-menu-item__indicator"
|
|
40
|
-
},
|
|
40
|
+
}, H = {
|
|
41
41
|
key: 0,
|
|
42
42
|
class: "ui-layout-menu"
|
|
43
|
-
},
|
|
43
|
+
}, ge = /* @__PURE__ */ A({
|
|
44
44
|
__name: "UiLayoutMenuItem",
|
|
45
45
|
props: {
|
|
46
46
|
routeItem: {},
|
|
47
47
|
collapsed: { type: Boolean },
|
|
48
48
|
parrentRoutes: {},
|
|
49
|
-
routeItems: {}
|
|
49
|
+
routeItems: {},
|
|
50
|
+
activeMenuPath: {}
|
|
50
51
|
},
|
|
51
52
|
emits: ["selected"],
|
|
52
|
-
setup(
|
|
53
|
-
const
|
|
54
|
-
const { path: e, meta:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
isSelected: O.includes(d),
|
|
58
|
-
isChildren: o
|
|
59
|
-
};
|
|
60
|
-
const $ = h?.path.split("/").map((l) => l.toLowerCase()), b = d.split("/")[1];
|
|
53
|
+
setup(B) {
|
|
54
|
+
const t = B, { onMenuItemSelect: c } = D("menu") || F, a = O(t.parrentRoutes?.includes(t.routeItem?.path)), y = M(() => t.routeItem?.meta?.isButton), r = M(() => {
|
|
55
|
+
const { path: e, meta: i } = t.routeItem, f = !!i?.isChildren, n = (l) => (l.length > 1 ? l.replace(/\/+$/, "") : l).toLowerCase(), d = n(e), $ = (t.activeMenuPath ? n(t.activeMenuPath) : null) === d, z = !!t.parrentRoutes?.some(
|
|
56
|
+
(l) => n(l) === d
|
|
57
|
+
);
|
|
61
58
|
return {
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
// Parent items are active only when the current route belongs to their declared children tree.
|
|
60
|
+
// Leaf items are active only on exact path match.
|
|
61
|
+
isSelected: $ || z,
|
|
62
|
+
isChildren: f
|
|
64
63
|
};
|
|
65
64
|
});
|
|
66
|
-
function
|
|
67
|
-
|
|
65
|
+
function L() {
|
|
66
|
+
y.value && (t.routeItem.meta.click ? t.routeItem?.meta?.click() : y.value && (a.value = !a.value));
|
|
68
67
|
}
|
|
69
|
-
return
|
|
70
|
-
() =>
|
|
68
|
+
return K(
|
|
69
|
+
() => t.parrentRoutes,
|
|
71
70
|
() => {
|
|
72
|
-
|
|
71
|
+
t.parrentRoutes && t.parrentRoutes?.includes(t.routeItem?.path) && (a.value = !0);
|
|
73
72
|
}
|
|
74
|
-
), (e,
|
|
75
|
-
const
|
|
76
|
-
return
|
|
77
|
-
(
|
|
78
|
-
onClick: L
|
|
73
|
+
), (e, i) => {
|
|
74
|
+
const f = b("UiLayoutMenuItem", !0);
|
|
75
|
+
return o(), m(I, null, [
|
|
76
|
+
(o(), s(k(y.value ? "button" : "RouterLink"), {
|
|
77
|
+
onClick: P(L, ["stop"]),
|
|
79
78
|
to: e.routeItem?.path,
|
|
80
79
|
class: "ui-layout-menu-item__link"
|
|
81
80
|
}, {
|
|
82
|
-
default:
|
|
83
|
-
|
|
84
|
-
class:
|
|
85
|
-
{ "is-selected":
|
|
81
|
+
default: N(() => [
|
|
82
|
+
S("span", {
|
|
83
|
+
class: C(["ui-layout-menu-item", [
|
|
84
|
+
{ "is-selected": r.value.isSelected && !r.value.isChildren },
|
|
86
85
|
{ "is-collapsed": e.collapsed },
|
|
87
86
|
e.routeItem.meta?.class
|
|
88
87
|
]]),
|
|
89
|
-
onClick:
|
|
90
|
-
(...
|
|
91
|
-
onKeyup:
|
|
88
|
+
onClick: i[1] || (i[1] = //@ts-ignore
|
|
89
|
+
(...n) => p(c) && p(c)(...n)),
|
|
90
|
+
onKeyup: i[2] || (i[2] = U(
|
|
92
91
|
//@ts-ignore
|
|
93
|
-
(...
|
|
92
|
+
(...n) => p(c) && p(c)(...n),
|
|
94
93
|
["enter"]
|
|
95
94
|
))
|
|
96
95
|
}, [
|
|
97
|
-
e.routeItem?.meta?.animationIcon ? (
|
|
96
|
+
e.routeItem?.meta?.animationIcon ? (o(), s(p(E), {
|
|
98
97
|
key: 0,
|
|
99
|
-
autoPlay:
|
|
98
|
+
autoPlay: r.value.isSelected,
|
|
100
99
|
width: 24,
|
|
101
100
|
height: 24,
|
|
102
101
|
"icon-component": e.routeItem?.meta?.animationIcon,
|
|
103
102
|
class: "ui-layout-menu-item__animation"
|
|
104
|
-
}, null, 8, ["autoPlay", "icon-component"])) :
|
|
105
|
-
e.routeItem?.meta?.icon && e.routeItem?.meta?.iconActive ? (
|
|
106
|
-
v(
|
|
103
|
+
}, null, 8, ["autoPlay", "icon-component"])) : u("", !0),
|
|
104
|
+
e.routeItem?.meta?.icon && e.routeItem?.meta?.iconActive ? (o(), m(I, { key: 1 }, [
|
|
105
|
+
v(w(R, {
|
|
107
106
|
size: "lg",
|
|
108
107
|
name: e.routeItem.meta.iconActive,
|
|
109
108
|
type: "filled"
|
|
110
109
|
}, null, 8, ["name"]), [
|
|
111
|
-
[
|
|
110
|
+
[h, r.value.isSelected]
|
|
112
111
|
]),
|
|
113
|
-
v(
|
|
112
|
+
v(w(R, {
|
|
114
113
|
size: "lg",
|
|
115
114
|
name: e.routeItem.meta.icon,
|
|
116
115
|
type: "100"
|
|
117
116
|
}, null, 8, ["name"]), [
|
|
118
|
-
[
|
|
117
|
+
[h, !r.value.isSelected]
|
|
119
118
|
])
|
|
120
|
-
], 64)) :
|
|
121
|
-
e.routeItem.meta?.iconComponent ? (
|
|
122
|
-
v((
|
|
123
|
-
[
|
|
119
|
+
], 64)) : u("", !0),
|
|
120
|
+
e.routeItem.meta?.iconComponent ? (o(), m(I, { key: 2 }, [
|
|
121
|
+
v((o(), s(k(e.routeItem.meta?.iconComponentActive), null, null, 512)), [
|
|
122
|
+
[h, r.value.isSelected]
|
|
124
123
|
]),
|
|
125
|
-
v((
|
|
126
|
-
[
|
|
124
|
+
v((o(), s(k(e.routeItem.meta?.iconComponent), null, null, 512)), [
|
|
125
|
+
[h, !r.value.isSelected]
|
|
127
126
|
])
|
|
128
|
-
], 64)) :
|
|
129
|
-
|
|
130
|
-
class:
|
|
131
|
-
},
|
|
132
|
-
e.routeItem.meta.indicator ? (
|
|
133
|
-
e.routeItem.children?.length && !e.collapsed && !e.routeItem.meta.alwaysOpen ? (
|
|
127
|
+
], 64)) : u("", !0),
|
|
128
|
+
S("span", {
|
|
129
|
+
class: C(["ui-layout-menu-item__title", [{ children: r.value.isChildren }, { "children-active": r.value.isSelected }]])
|
|
130
|
+
}, g(e.routeItem.meta?.title), 3),
|
|
131
|
+
e.routeItem.meta.indicator ? (o(), m("span", j, g(e.routeItem.meta.indicator), 1)) : u("", !0),
|
|
132
|
+
e.routeItem.children?.length && !e.collapsed && !e.routeItem.meta.alwaysOpen ? (o(), m("button", {
|
|
134
133
|
key: 4,
|
|
135
|
-
onClick:
|
|
136
|
-
class:
|
|
134
|
+
onClick: i[0] || (i[0] = P((n) => a.value = !a.value, ["stop", "prevent"])),
|
|
135
|
+
class: C(["ui-layout-menu-item__chevron", { "is-open": a.value }])
|
|
137
136
|
}, [
|
|
138
|
-
|
|
137
|
+
w(R, {
|
|
139
138
|
name: "keyboard-arrow-down",
|
|
140
139
|
type: "400"
|
|
141
140
|
})
|
|
142
|
-
], 2)) :
|
|
141
|
+
], 2)) : u("", !0)
|
|
143
142
|
], 34)
|
|
144
143
|
]),
|
|
145
144
|
_: 1
|
|
146
145
|
}, 8, ["to"])),
|
|
147
|
-
e.routeItem?.children && e.routeItem.children?.length && !e.collapsed && (
|
|
148
|
-
(
|
|
149
|
-
key:
|
|
146
|
+
e.routeItem?.children && e.routeItem.children?.length && !e.collapsed && (a.value || e.routeItem.meta.alwaysOpen) ? (o(), m("ul", H, [
|
|
147
|
+
(o(!0), m(I, null, V(e.routeItem.children, (n) => (o(), m("li", {
|
|
148
|
+
key: n?.path
|
|
150
149
|
}, [
|
|
151
|
-
(
|
|
150
|
+
(o(), s(f, {
|
|
152
151
|
routeItems: e.routeItems,
|
|
153
|
-
key:
|
|
154
|
-
"route-item":
|
|
152
|
+
key: n?.path,
|
|
153
|
+
"route-item": n,
|
|
155
154
|
collapsed: e.collapsed,
|
|
156
155
|
parrentRoutes: e.parrentRoutes,
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
"active-menu-path": e.activeMenuPath,
|
|
157
|
+
onSelected: i[3] || (i[3] = (d) => e.$emit("selected", d))
|
|
158
|
+
}, null, 8, ["routeItems", "route-item", "collapsed", "parrentRoutes", "active-menu-path"]))
|
|
159
159
|
]))), 128))
|
|
160
|
-
])) :
|
|
160
|
+
])) : u("", !0)
|
|
161
161
|
], 64);
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
165
|
export {
|
|
166
|
-
|
|
166
|
+
ge as _
|
|
167
167
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as m } from "../../assets/UiLayoutMenuItem.vue_vue_type_script_setup_true_lang.
|
|
1
|
+
import { _ as m } from "../../assets/UiLayoutMenuItem.vue_vue_type_script_setup_true_lang.CDnwiaSr.js";
|
|
2
2
|
import "../../assets/style.C3xG1ALc.js";
|
|
3
3
|
export {
|
|
4
4
|
m as default
|
package/dist/index.js
CHANGED
|
@@ -33,8 +33,8 @@ import { _ as xo } from "./assets/UiLanguages.vue_vue_type_script_setup_true_lan
|
|
|
33
33
|
import { _ as _o } from "./assets/UiLayout.vue_vue_type_script_setup_true_lang.CELUDfDH.js";
|
|
34
34
|
/* empty css */
|
|
35
35
|
import { default as lo } from "./components/UiLayoutAuth/UiLayoutAuth.js";
|
|
36
|
-
import { _ as co } from "./assets/UiLayoutMenu.vue_vue_type_script_setup_true_lang.
|
|
37
|
-
import { _ as yo } from "./assets/UiLayoutMenuItem.vue_vue_type_script_setup_true_lang.
|
|
36
|
+
import { _ as co } from "./assets/UiLayoutMenu.vue_vue_type_script_setup_true_lang.s_cerqGK.js";
|
|
37
|
+
import { _ as yo } from "./assets/UiLayoutMenuItem.vue_vue_type_script_setup_true_lang.CDnwiaSr.js";
|
|
38
38
|
import { _ as To } from "./assets/UiLink.vue_vue_type_script_setup_true_lang.BdNoHssP.js";
|
|
39
39
|
/* empty css */
|
|
40
40
|
import { _ as Lo } from "./assets/UiLoading.vue_vue_type_script_setup_true_lang.CGIpSwtF.js";
|
package/package.json
CHANGED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { defineComponent as k, computed as a, createElementBlock as s, openBlock as u, normalizeClass as F, Fragment as p, renderList as m, createVNode as d } from "vue";
|
|
2
|
-
import { _ as c } from "./UiLayoutMenuItem.vue_vue_type_script_setup_true_lang.DFKZwWfN.js";
|
|
3
|
-
import "./style.C3xG1ALc.js";
|
|
4
|
-
import { useRoute as I } from "vue-router";
|
|
5
|
-
const L = /* @__PURE__ */ k({
|
|
6
|
-
__name: "UiLayoutMenu",
|
|
7
|
-
props: {
|
|
8
|
-
routeItems: {},
|
|
9
|
-
collapsed: { type: Boolean, default: !1 }
|
|
10
|
-
},
|
|
11
|
-
emits: ["selected"],
|
|
12
|
-
setup(f) {
|
|
13
|
-
const n = f, h = I(), y = a(() => {
|
|
14
|
-
const e = (r) => {
|
|
15
|
-
let o = [];
|
|
16
|
-
return r.forEach((t) => {
|
|
17
|
-
o.push(t), t.children?.length && (o = o.concat(e(t.children)));
|
|
18
|
-
}), o;
|
|
19
|
-
};
|
|
20
|
-
return e(n.routeItems);
|
|
21
|
-
}), i = a(() => {
|
|
22
|
-
function e(r, o, t = []) {
|
|
23
|
-
for (const l of o)
|
|
24
|
-
if (l.children && l.children.length > 0 && (l.children.some((R) => R?.path === r) || e(r, l.children, t)))
|
|
25
|
-
return t.push(l?.path), t;
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
return e(h?.path, n.routeItems);
|
|
29
|
-
});
|
|
30
|
-
return (e, r) => (u(), s("ul", {
|
|
31
|
-
class: F(["ui-layout-menu", { "is-collapsed": e.collapsed }])
|
|
32
|
-
}, [
|
|
33
|
-
e.collapsed ? (u(!0), s(p, { key: 0 }, m(y.value, (o) => (u(), s("li", {
|
|
34
|
-
key: o?.path
|
|
35
|
-
}, [
|
|
36
|
-
d(c, {
|
|
37
|
-
"route-item": o,
|
|
38
|
-
collapsed: e.collapsed,
|
|
39
|
-
"route-items": e.routeItems,
|
|
40
|
-
parrentRoutes: i.value,
|
|
41
|
-
onSelected: r[0] || (r[0] = (t) => e.$emit("selected", t))
|
|
42
|
-
}, null, 8, ["route-item", "collapsed", "route-items", "parrentRoutes"])
|
|
43
|
-
]))), 128)) : (u(!0), s(p, { key: 1 }, m(e.routeItems, (o) => (u(), s("li", {
|
|
44
|
-
key: o?.path
|
|
45
|
-
}, [
|
|
46
|
-
d(c, {
|
|
47
|
-
"route-item": o,
|
|
48
|
-
collapsed: e.collapsed,
|
|
49
|
-
"route-items": e.routeItems,
|
|
50
|
-
parrentRoutes: i.value,
|
|
51
|
-
onSelected: r[1] || (r[1] = (t) => e.$emit("selected", t))
|
|
52
|
-
}, null, 8, ["route-item", "collapsed", "route-items", "parrentRoutes"])
|
|
53
|
-
]))), 128))
|
|
54
|
-
], 2));
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
export {
|
|
58
|
-
L as _
|
|
59
|
-
};
|