lkt-menu 2.0.6 → 2.0.8
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/build.d.ts +3 -3
- package/dist/build.js +122 -122
- package/dist/components/MenuItem.vue.d.ts +4500 -1500
- package/dist/lib-components/LktMenu.vue.d.ts +2593 -593
- package/package.json +1 -2
- package/src/components/MenuItem.vue +0 -177
- package/src/lib-components/LktMenu.vue +0 -111
package/dist/build.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare namespace
|
|
1
|
+
declare namespace Ve {
|
|
2
2
|
function install(r: any): void;
|
|
3
3
|
}
|
|
4
|
-
declare function
|
|
5
|
-
export {
|
|
4
|
+
declare function $e(r: any): boolean;
|
|
5
|
+
export { Ve as default, $e as setMenuToggleSlot };
|
package/dist/build.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as G, ref as
|
|
2
|
-
import { MenuEntryType as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { DataState as
|
|
5
|
-
import { httpCall as
|
|
6
|
-
const
|
|
7
|
-
a.key && !r.includes(a.key) && r.push(a.key), a.children && a.children.length > 0 &&
|
|
8
|
-
}), r),
|
|
1
|
+
import { defineComponent as G, ref as W, useSlots as Q, computed as m, watch as U, onMounted as Y, resolveComponent as R, createElementBlock as d, openBlock as u, normalizeClass as O, createElementVNode as _, createCommentVNode as g, createBlock as h, unref as v, normalizeProps as P, mergeProps as j, createSlots as H, withCtx as f, renderSlot as k, toDisplayString as Z, resolveDynamicComponent as x, Fragment as X, renderList as w, mergeDefaults as ee } from "vue";
|
|
2
|
+
import { MenuEntryType as T, getDefaultValues as te, Menu as le } from "lkt-vue-kernel";
|
|
3
|
+
import { useRouter as ne } from "vue-router";
|
|
4
|
+
import { DataState as oe } from "lkt-data-state";
|
|
5
|
+
import { httpCall as ue } from "lkt-http-client";
|
|
6
|
+
const q = (r, V) => (V.forEach((a) => {
|
|
7
|
+
a.key && !r.includes(a.key) && r.push(a.key), a.children && a.children.length > 0 && q(r, a.children);
|
|
8
|
+
}), r), J = class J {
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
const
|
|
10
|
+
J.toggleSlot = "", J.debugEnabled = !1;
|
|
11
|
+
let A = J;
|
|
12
|
+
const se = { class: "lkt-menu-entry-main" }, ae = { class: "lkt-entry-content" }, re = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "lkt-menu-entry-icon"
|
|
15
|
-
},
|
|
15
|
+
}, ie = {
|
|
16
16
|
key: 1,
|
|
17
17
|
class: "lkt-menu-entry-text"
|
|
18
|
-
},
|
|
18
|
+
}, ce = {
|
|
19
19
|
key: 0,
|
|
20
20
|
class: "lkt-menu-entry-children"
|
|
21
|
-
},
|
|
21
|
+
}, de = /* @__PURE__ */ G({
|
|
22
22
|
__name: "MenuItem",
|
|
23
23
|
props: {
|
|
24
24
|
modelValue: { default: () => ({}) }
|
|
@@ -26,115 +26,115 @@ const ue = { class: "lkt-menu-entry-main" }, se = { class: "lkt-entry-content" }
|
|
|
26
26
|
emits: [
|
|
27
27
|
"update:modelValue"
|
|
28
28
|
],
|
|
29
|
-
setup(r, { emit:
|
|
30
|
-
const a =
|
|
29
|
+
setup(r, { emit: V }) {
|
|
30
|
+
const a = V, p = r, e = W(p.modelValue), i = Q(), $ = ne(), y = W(!1), D = () => {
|
|
31
31
|
e.value.isOpened = !e.value.isOpened;
|
|
32
|
-
},
|
|
32
|
+
}, K = () => {
|
|
33
33
|
var t, o;
|
|
34
|
-
return typeof e.value.children < "u" && ((t = e.value.children) == null ? void 0 : t.length) > 0 && !e.value.keepOpenOnChildClick &&
|
|
34
|
+
return typeof e.value.children < "u" && ((t = e.value.children) == null ? void 0 : t.length) > 0 && !e.value.keepOpenOnChildClick && D(), typeof ((o = e.value.events) == null ? void 0 : o.click) == "function" && e.value.events.click({
|
|
35
35
|
entry: e.value
|
|
36
36
|
}), 1;
|
|
37
|
-
},
|
|
37
|
+
}, M = m(() => i["icon-" + e.value.key] || e.value.icon !== ""), L = m(() => {
|
|
38
38
|
let t = [];
|
|
39
|
-
return
|
|
40
|
-
}),
|
|
39
|
+
return M.value && t.push("has-icon"), y.value && t.push("is-active"), e.value.type && t.push(`is-${e.value.type}`), t.join(" ");
|
|
40
|
+
}), E = m(() => {
|
|
41
41
|
var o;
|
|
42
|
-
return
|
|
43
|
-
}), l =
|
|
42
|
+
return q([], ((o = e.value) == null ? void 0 : o.children) ?? []);
|
|
43
|
+
}), l = m(() => {
|
|
44
44
|
let t = [];
|
|
45
45
|
for (let o in i)
|
|
46
|
-
o.startsWith("icon-") &&
|
|
46
|
+
o.startsWith("icon-") && E.value.includes(o.substring(5)) && t.push(o);
|
|
47
47
|
return t;
|
|
48
|
-
}), n =
|
|
48
|
+
}), n = m(() => e.value.isActive ? !0 : typeof e.value.isActiveChecker == "function" ? !!e.value.isActiveChecker({
|
|
49
49
|
entry: e.value
|
|
50
|
-
}) : !1),
|
|
51
|
-
return
|
|
50
|
+
}) : !1), s = m(() => !!A.toggleSlot), c = m(() => A.toggleSlot);
|
|
51
|
+
return U(() => p.modelValue, (t) => {
|
|
52
52
|
e.value = t;
|
|
53
|
-
}, { deep: !0 }),
|
|
53
|
+
}, { deep: !0 }), U(e, (t) => {
|
|
54
54
|
a("update:modelValue", t);
|
|
55
|
-
}, { deep: !0 }),
|
|
56
|
-
var o,
|
|
57
|
-
let t =
|
|
55
|
+
}, { deep: !0 }), Y(() => {
|
|
56
|
+
var o, I, B;
|
|
57
|
+
let t = $ == null ? void 0 : $.currentRoute;
|
|
58
58
|
if (t) {
|
|
59
59
|
if (t.value.path === ((o = e.value.anchor) == null ? void 0 : o.to))
|
|
60
60
|
e.value.isOpened = !0;
|
|
61
|
-
else if (typeof e.value.children < "u" && ((
|
|
62
|
-
let
|
|
63
|
-
(
|
|
64
|
-
var
|
|
65
|
-
t.value.path === ((
|
|
66
|
-
}),
|
|
61
|
+
else if (typeof e.value.children < "u" && ((I = e.value.children) == null ? void 0 : I.length) > 0) {
|
|
62
|
+
let C = !1;
|
|
63
|
+
(B = e.value.children) == null || B.forEach((z) => {
|
|
64
|
+
var S;
|
|
65
|
+
t.value.path === ((S = z.anchor) == null ? void 0 : S.to) && (C = !0);
|
|
66
|
+
}), C && (e.value.isOpened = !0);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
}), (t, o) => {
|
|
70
|
-
var
|
|
71
|
-
const
|
|
72
|
-
return
|
|
73
|
-
class:
|
|
70
|
+
var S;
|
|
71
|
+
const I = R("lkt-button"), B = R("lkt-header"), C = R("lkt-anchor"), z = R("menu-item", !0);
|
|
72
|
+
return u(), d("div", {
|
|
73
|
+
class: O(["lkt-menu-entry", L.value])
|
|
74
74
|
}, [
|
|
75
|
-
|
|
76
|
-
e.value.type ===
|
|
77
|
-
|
|
75
|
+
_("div", se, [
|
|
76
|
+
e.value.type === v(T).Button ? (u(), h(I, P(j({ key: 0 }, e.value.button)), H({ _: 2 }, [
|
|
77
|
+
v(i).tooltip ? {
|
|
78
78
|
name: "tooltip",
|
|
79
|
-
fn:
|
|
80
|
-
|
|
79
|
+
fn: f(() => [
|
|
80
|
+
k(t.$slots, "tooltip")
|
|
81
81
|
]),
|
|
82
82
|
key: "0"
|
|
83
83
|
} : void 0,
|
|
84
|
-
|
|
84
|
+
v(i).split ? {
|
|
85
85
|
name: "split",
|
|
86
|
-
fn:
|
|
87
|
-
|
|
86
|
+
fn: f(() => [
|
|
87
|
+
k(t.$slots, "split")
|
|
88
88
|
]),
|
|
89
89
|
key: "1"
|
|
90
90
|
} : void 0
|
|
91
|
-
]), 1040)) : e.value.type ===
|
|
92
|
-
"on-click":
|
|
91
|
+
]), 1040)) : e.value.type === v(T).Header ? (u(), h(B, P(j({ key: 1 }, e.value.header)), null, 16)) : e.value.type === v(T).Anchor ? (u(), h(C, P(j({ key: 2 }, e.value.anchor)), null, 16)) : (u(), h(C, j({ key: 3 }, e.value.anchor, {
|
|
92
|
+
"on-click": K,
|
|
93
93
|
"is-active": n.value,
|
|
94
|
-
onActive: o[0] || (o[0] = (
|
|
94
|
+
onActive: o[0] || (o[0] = (b) => y.value = b)
|
|
95
95
|
}), {
|
|
96
|
-
text:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
text: f(({ text: b }) => [
|
|
97
|
+
_("div", ae, [
|
|
98
|
+
M.value ? (u(), d("div", re, [
|
|
99
|
+
v(i)["icon-" + e.value.key] ? k(t.$slots, "icon-" + e.value.key, {
|
|
100
100
|
key: e.value.key,
|
|
101
101
|
entry: e.value
|
|
102
|
-
}) : e.value.icon !== "" ? (
|
|
102
|
+
}) : e.value.icon !== "" ? (u(), d("i", {
|
|
103
103
|
key: 1,
|
|
104
|
-
class:
|
|
104
|
+
class: O(e.value.icon)
|
|
105
105
|
}, null, 2)) : g("", !0)
|
|
106
106
|
])) : g("", !0),
|
|
107
|
-
|
|
107
|
+
b !== "" ? (u(), d("div", ie, Z(b), 1)) : g("", !0)
|
|
108
108
|
])
|
|
109
109
|
]),
|
|
110
110
|
_: 3
|
|
111
111
|
}, 16, ["is-active"])),
|
|
112
|
-
e.value.type !==
|
|
113
|
-
key:
|
|
112
|
+
e.value.type !== v(T).Button && e.value.children && ((S = e.value.children) == null ? void 0 : S.length) > 0 ? (u(), d("div", {
|
|
113
|
+
key: 4,
|
|
114
114
|
class: "lkt-menu-entry-toggle",
|
|
115
|
-
onClick:
|
|
115
|
+
onClick: D
|
|
116
116
|
}, [
|
|
117
|
-
|
|
117
|
+
s.value ? (u(), h(x(c.value), {
|
|
118
118
|
key: 0,
|
|
119
|
-
class:
|
|
120
|
-
}, null, 8, ["class"])) : (
|
|
119
|
+
class: O(["lkt-menu-entry-toggle-inner", e.value.isOpened ? "is-opened" : ""])
|
|
120
|
+
}, null, 8, ["class"])) : (u(), d("div", {
|
|
121
121
|
key: 1,
|
|
122
|
-
class:
|
|
122
|
+
class: O(["lkt-menu-entry-toggle-inner", e.value.isOpened ? "is-opened" : ""])
|
|
123
123
|
}, o[1] || (o[1] = [
|
|
124
|
-
|
|
124
|
+
_("i", { class: "lkt-icn-angle-bottom" }, null, -1)
|
|
125
125
|
]), 2))
|
|
126
126
|
])) : g("", !0)
|
|
127
127
|
]),
|
|
128
|
-
e.value.isOpened ? (
|
|
129
|
-
(
|
|
130
|
-
modelValue: e.value.children[
|
|
131
|
-
"onUpdate:modelValue": (N) => e.value.children[
|
|
132
|
-
key: e.value.children[
|
|
133
|
-
},
|
|
134
|
-
|
|
128
|
+
e.value.isOpened ? (u(), d("div", ce, [
|
|
129
|
+
(u(!0), d(X, null, w(e.value.children, (b, F) => (u(), h(z, {
|
|
130
|
+
modelValue: e.value.children[F],
|
|
131
|
+
"onUpdate:modelValue": (N) => e.value.children[F] = N,
|
|
132
|
+
key: e.value.children[F].key
|
|
133
|
+
}, H({ _: 2 }, [
|
|
134
|
+
w(l.value, (N) => ({
|
|
135
135
|
name: N,
|
|
136
|
-
fn:
|
|
137
|
-
|
|
136
|
+
fn: f(() => [
|
|
137
|
+
k(t.$slots, N)
|
|
138
138
|
])
|
|
139
139
|
}))
|
|
140
140
|
]), 1032, ["modelValue", "onUpdate:modelValue"]))), 128))
|
|
@@ -142,12 +142,12 @@ const ue = { class: "lkt-menu-entry-main" }, se = { class: "lkt-entry-content" }
|
|
|
142
142
|
], 2);
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
}),
|
|
145
|
+
}), ve = { class: "lkt-menu" }, pe = { class: "lkt-menu-main" }, me = { class: "lkt-menu-entries" }, ke = /* @__PURE__ */ G({
|
|
146
146
|
__name: "LktMenu",
|
|
147
|
-
props: /* @__PURE__ */
|
|
147
|
+
props: /* @__PURE__ */ ee({
|
|
148
148
|
modelValue: {},
|
|
149
149
|
http: {}
|
|
150
|
-
},
|
|
150
|
+
}, te(le)),
|
|
151
151
|
emits: [
|
|
152
152
|
"update:modelValue",
|
|
153
153
|
"click-outside",
|
|
@@ -156,83 +156,83 @@ const ue = { class: "lkt-menu-entry-main" }, se = { class: "lkt-entry-content" }
|
|
|
156
156
|
"response",
|
|
157
157
|
"error"
|
|
158
158
|
],
|
|
159
|
-
setup(r, { emit:
|
|
160
|
-
var
|
|
161
|
-
const a = r,
|
|
159
|
+
setup(r, { emit: V }) {
|
|
160
|
+
var E;
|
|
161
|
+
const a = r, p = V, e = Q(), i = W(a.modelValue), $ = (l) => {
|
|
162
162
|
let n = {};
|
|
163
163
|
typeof l == "object" && Object.keys(l).length > 0 && (n = JSON.parse(JSON.stringify(l)));
|
|
164
|
-
for (let
|
|
165
|
-
(Array.isArray(n[
|
|
164
|
+
for (let s in n)
|
|
165
|
+
(Array.isArray(n[s]) || typeof n[s] == "object") && (n[s] = JSON.stringify(n[s]));
|
|
166
166
|
return n;
|
|
167
167
|
};
|
|
168
|
-
let y = new
|
|
169
|
-
y.increment(
|
|
170
|
-
const
|
|
168
|
+
let y = new oe({});
|
|
169
|
+
y.increment($(((E = a.http) == null ? void 0 : E.data) ?? {}));
|
|
170
|
+
const D = m(() => q([], i.value)), K = m(() => {
|
|
171
171
|
let l = [];
|
|
172
172
|
for (let n in e)
|
|
173
|
-
n.startsWith("icon-") &&
|
|
173
|
+
n.startsWith("icon-") && D.value.includes(n.substring(5)) && l.push(n);
|
|
174
174
|
return l;
|
|
175
|
-
}),
|
|
176
|
-
var n,
|
|
175
|
+
}), M = () => {
|
|
176
|
+
var n, s;
|
|
177
177
|
if (!((n = a.http) != null && n.resource)) return;
|
|
178
178
|
let l = y.getData();
|
|
179
|
-
|
|
180
|
-
y.turnStoredIntoOriginal(), i.value = c.data,
|
|
179
|
+
p("loading"), ue((s = a.http) == null ? void 0 : s.resource, l).then((c) => {
|
|
180
|
+
y.turnStoredIntoOriginal(), i.value = c.data, p("results", c.data), p("response", c);
|
|
181
181
|
}).catch((c) => {
|
|
182
|
-
|
|
182
|
+
p("error", c);
|
|
183
183
|
});
|
|
184
|
-
},
|
|
185
|
-
|
|
184
|
+
}, L = () => {
|
|
185
|
+
p("click-outside");
|
|
186
186
|
};
|
|
187
|
-
return
|
|
187
|
+
return U(() => a.modelValue, (l) => {
|
|
188
188
|
i.value = l;
|
|
189
|
-
}, { deep: !0 }),
|
|
190
|
-
|
|
191
|
-
}, { deep: !0 }),
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
(
|
|
189
|
+
}, { deep: !0 }), U(i, (l) => {
|
|
190
|
+
p("update:modelValue", l);
|
|
191
|
+
}, { deep: !0 }), M(), (l, n) => (u(), d("div", ve, [
|
|
192
|
+
_("div", pe, [
|
|
193
|
+
v(e).before ? k(l.$slots, "before", { key: 0 }) : g("", !0),
|
|
194
|
+
_("div", me, [
|
|
195
|
+
(u(!0), d(X, null, w(i.value, (s, c) => (u(), h(de, {
|
|
196
196
|
modelValue: i.value[c],
|
|
197
197
|
"onUpdate:modelValue": (t) => i.value[c] = t,
|
|
198
|
-
key:
|
|
199
|
-
class:
|
|
200
|
-
},
|
|
201
|
-
|
|
198
|
+
key: s.key,
|
|
199
|
+
class: O(s.class)
|
|
200
|
+
}, H({ _: 2 }, [
|
|
201
|
+
w(K.value, (t) => ({
|
|
202
202
|
name: t,
|
|
203
|
-
fn:
|
|
204
|
-
|
|
203
|
+
fn: f(() => [
|
|
204
|
+
k(l.$slots, t)
|
|
205
205
|
])
|
|
206
206
|
})),
|
|
207
|
-
|
|
207
|
+
v(e)[`tooltip-${s.key}`] ? {
|
|
208
208
|
name: "tooltip",
|
|
209
|
-
fn:
|
|
210
|
-
|
|
209
|
+
fn: f(() => [
|
|
210
|
+
k(l.$slots, `tooltip-${s.key}`)
|
|
211
211
|
]),
|
|
212
212
|
key: "0"
|
|
213
213
|
} : void 0,
|
|
214
|
-
|
|
214
|
+
v(e)[`split-${s.key}`] ? {
|
|
215
215
|
name: "split",
|
|
216
|
-
fn:
|
|
217
|
-
|
|
216
|
+
fn: f(() => [
|
|
217
|
+
k(l.$slots, `split-${s.key}`)
|
|
218
218
|
]),
|
|
219
219
|
key: "1"
|
|
220
220
|
} : void 0
|
|
221
221
|
]), 1032, ["modelValue", "onUpdate:modelValue", "class"]))), 128))
|
|
222
222
|
])
|
|
223
223
|
]),
|
|
224
|
-
|
|
224
|
+
_("div", {
|
|
225
225
|
class: "lkt-menu-outside",
|
|
226
|
-
onClick:
|
|
226
|
+
onClick: L
|
|
227
227
|
})
|
|
228
228
|
]));
|
|
229
229
|
}
|
|
230
|
-
}),
|
|
230
|
+
}), Ve = {
|
|
231
231
|
install: (r) => {
|
|
232
|
-
r.component("lkt-menu") === void 0 && r.component("lkt-menu",
|
|
232
|
+
r.component("lkt-menu") === void 0 && r.component("lkt-menu", ke);
|
|
233
233
|
}
|
|
234
|
-
},
|
|
234
|
+
}, $e = (r) => (A.toggleSlot = r, !0);
|
|
235
235
|
export {
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
Ve as default,
|
|
237
|
+
$e as setMenuToggleSlot
|
|
238
238
|
};
|