lkt-menu 1.2.0 → 1.4.1
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 +56 -39
- package/dist/build.js +159 -169
- package/dist/components/MenuItem.vue.d.ts +135 -37
- package/dist/functions/helpers.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib-components/LktMenu.vue.d.ts +37 -51
- package/package.json +6 -6
- package/src/components/MenuItem.vue +17 -9
- package/src/lib-components/LktMenu.vue +15 -17
package/dist/build.d.ts
CHANGED
|
@@ -1,42 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
key
|
|
4
|
-
href
|
|
5
|
-
label
|
|
6
|
-
icon
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import { MenuEntry as be } from "lkt-vue-kernel";
|
|
2
|
+
declare function Ve(u: any, m: any, o: any): {
|
|
3
|
+
key?: string | undefined;
|
|
4
|
+
href?: string | undefined;
|
|
5
|
+
label?: string | undefined;
|
|
6
|
+
icon?: string | undefined;
|
|
7
|
+
isActiveChecker?: Function | undefined;
|
|
8
|
+
isOpened?: boolean | undefined;
|
|
9
|
+
isActive?: boolean | undefined;
|
|
10
|
+
parent?: {
|
|
11
|
+
key?: string | undefined;
|
|
12
|
+
href?: string | undefined;
|
|
13
|
+
label?: string | undefined;
|
|
14
|
+
icon?: string | undefined;
|
|
15
|
+
isActiveChecker?: Function | undefined;
|
|
16
|
+
isOpened?: boolean | undefined;
|
|
17
|
+
isActive?: boolean | undefined;
|
|
18
|
+
parent?: /*elided*/ any | undefined;
|
|
19
|
+
children?: /*elided*/ any[] | undefined;
|
|
20
|
+
events?: {
|
|
21
|
+
click?: Function | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
onClick?: Function | undefined;
|
|
24
|
+
} | undefined;
|
|
25
|
+
children?: {
|
|
26
|
+
key?: string | undefined;
|
|
27
|
+
href?: string | undefined;
|
|
28
|
+
label?: string | undefined;
|
|
29
|
+
icon?: string | undefined;
|
|
30
|
+
isActiveChecker?: Function | undefined;
|
|
31
|
+
isOpened?: boolean | undefined;
|
|
32
|
+
isActive?: boolean | undefined;
|
|
33
|
+
parent?: /*elided*/ any | undefined;
|
|
34
|
+
children?: /*elided*/ any[] | undefined;
|
|
35
|
+
events?: {
|
|
36
|
+
click?: Function | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
onClick?: Function | undefined;
|
|
39
|
+
}[] | undefined;
|
|
40
|
+
events?: {
|
|
41
|
+
click?: Function | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
onClick?: Function | undefined;
|
|
44
|
+
setChildren: (children: z[]) => z;
|
|
45
|
+
setOnClick: (fn: Function) => z;
|
|
46
|
+
setIsActiveChecker: (fn: Function) => z;
|
|
47
|
+
setIsActive: (enabled?: boolean) => z;
|
|
48
|
+
setLabel: (str: string) => z;
|
|
49
|
+
setIcon: (str: string) => z;
|
|
36
50
|
doClose: () => void;
|
|
51
|
+
feed: (data?: import("lkt-vue-kernel").LktObject, target?: z | undefined) => void;
|
|
52
|
+
assignProp: (key: string, value: any) => void;
|
|
37
53
|
};
|
|
38
|
-
declare namespace
|
|
39
|
-
function install(
|
|
54
|
+
declare namespace _e {
|
|
55
|
+
function install(u: any): void;
|
|
40
56
|
}
|
|
41
|
-
declare function
|
|
42
|
-
|
|
57
|
+
declare function Ce(u: any): boolean;
|
|
58
|
+
import { MenuEntry as z } from "lkt-vue-kernel";
|
|
59
|
+
export { be as MenuEntry, Ve as createMenuEntry, _e as default, Ce as setMenuToggleSlot };
|
package/dist/build.js
CHANGED
|
@@ -1,218 +1,208 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import "lkt-
|
|
4
|
-
import {
|
|
5
|
-
import { DataState as
|
|
6
|
-
import { httpCall as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
setChildren(r) {
|
|
12
|
-
return r.forEach((a) => a.parent = this), this.children = r, this;
|
|
13
|
-
}
|
|
14
|
-
setOnClick(r) {
|
|
15
|
-
return this.onClick = r, this;
|
|
16
|
-
}
|
|
17
|
-
setIsActiveChecker(r) {
|
|
18
|
-
return this.isActiveChecker = r, this;
|
|
19
|
-
}
|
|
20
|
-
setIsActive(r = !0) {
|
|
21
|
-
return this.isActive = r, this;
|
|
22
|
-
}
|
|
23
|
-
setLabel(r) {
|
|
24
|
-
return this.label = r, this;
|
|
25
|
-
}
|
|
26
|
-
setIcon(r) {
|
|
27
|
-
return this.icon = r, this;
|
|
28
|
-
}
|
|
29
|
-
doClose() {
|
|
30
|
-
this.isOpened = !1;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const T = (e, r) => (r.forEach((a) => {
|
|
34
|
-
e.includes(a.key) || e.push(a.key), a.children.length > 0 && T(e, a.children);
|
|
35
|
-
}), e), w = class w {
|
|
1
|
+
import { defineComponent as K, ref as R, useSlots as T, computed as i, watch as M, onMounted as G, resolveComponent as J, createElementBlock as c, openBlock as r, normalizeClass as D, createElementVNode as A, createCommentVNode as h, createVNode as H, withCtx as j, renderSlot as x, unref as P, toDisplayString as Q, createBlock as L, resolveDynamicComponent as X, Fragment as F, renderList as E, createSlots as W, mergeDefaults as Y, reactive as Z } from "vue";
|
|
2
|
+
import { MenuEntry as z, extractI18nValue as ee, getDefaultValues as te, Menu as le } from "lkt-vue-kernel";
|
|
3
|
+
import { MenuEntry as be } from "lkt-vue-kernel";
|
|
4
|
+
import { useRouter as ne } from "vue-router";
|
|
5
|
+
import { DataState as ue } from "lkt-data-state";
|
|
6
|
+
import { httpCall as oe } from "lkt-http-client";
|
|
7
|
+
const U = (u, m) => (m.forEach((o) => {
|
|
8
|
+
u.includes(o.key) || u.push(o.key), o.children.length > 0 && U(u, o.children);
|
|
9
|
+
}), u), I = class I {
|
|
36
10
|
};
|
|
37
|
-
|
|
38
|
-
let y =
|
|
39
|
-
|
|
40
|
-
let r = String(e);
|
|
41
|
-
return r.startsWith("__:") ? Z(r.substring(3)) : r;
|
|
42
|
-
};
|
|
43
|
-
const Re = { class: "lkt-menu-entry-main" }, Te = { class: "lkt-entry-content" }, Pe = {
|
|
11
|
+
I.toggleSlot = "", I.debugEnabled = !1;
|
|
12
|
+
let y = I;
|
|
13
|
+
const re = { class: "lkt-menu-entry-main" }, ae = { class: "lkt-entry-content" }, se = {
|
|
44
14
|
key: 0,
|
|
45
15
|
class: "lkt-menu-entry-icon"
|
|
46
|
-
},
|
|
16
|
+
}, ie = {
|
|
47
17
|
key: 1,
|
|
48
18
|
class: "lkt-menu-entry-text"
|
|
49
|
-
},
|
|
19
|
+
}, ce = {
|
|
50
20
|
key: 0,
|
|
51
21
|
class: "lkt-menu-entry-children"
|
|
52
|
-
},
|
|
22
|
+
}, de = /* @__PURE__ */ K({
|
|
53
23
|
__name: "MenuItem",
|
|
54
24
|
props: {
|
|
55
|
-
modelValue: { default: () => new
|
|
25
|
+
modelValue: { default: () => new z() }
|
|
56
26
|
},
|
|
57
|
-
emits: [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
27
|
+
emits: [
|
|
28
|
+
"update:modelValue"
|
|
29
|
+
],
|
|
30
|
+
setup(u, { emit: m }) {
|
|
31
|
+
const o = m, d = u, e = R(d.modelValue), s = T(), k = ne(), p = R(!1), g = () => {
|
|
32
|
+
e.value.isOpened = !e.value.isOpened;
|
|
33
|
+
}, N = () => {
|
|
34
|
+
var t, a;
|
|
35
|
+
return ((t = e.value.children) == null ? void 0 : t.length) > 0 && g(), typeof ((a = e.value.events) == null ? void 0 : a.click) == "function" ? (e.value.events.click({
|
|
36
|
+
entry: e.value
|
|
37
|
+
}), 1) : (typeof e.value.onClick == "function" && e.value.onClick({
|
|
38
|
+
entry: e.value
|
|
39
|
+
}), 1);
|
|
40
|
+
}, _ = i(() => s["icon-" + e.value.key] || e.value.icon !== ""), $ = i(() => {
|
|
41
|
+
let t = [];
|
|
42
|
+
return _.value && t.push("has-icon"), p.value && t.push("is-active"), t.join(" ");
|
|
43
|
+
}), n = i(() => U([], e.value.children)), l = i(() => {
|
|
44
|
+
let t = [];
|
|
45
|
+
for (let a in s)
|
|
46
|
+
a.startsWith("icon-") && n.value.includes(a.substring(5)) && t.push(a);
|
|
47
|
+
return t;
|
|
48
|
+
}), v = i(() => ee(e.value.label)), V = i(() => e.value.isActive ? !0 : typeof e.value.isActiveChecker == "function" ? !!e.value.isActiveChecker({
|
|
49
|
+
entry: e.value
|
|
50
|
+
}) : !1), f = i(() => !!y.toggleSlot), q = i(() => y.toggleSlot);
|
|
51
|
+
return M(() => d.modelValue, (t) => {
|
|
52
|
+
e.value = t;
|
|
53
|
+
}, { deep: !0 }), M(e, (t) => {
|
|
54
|
+
o("update:modelValue", t);
|
|
55
|
+
}, { deep: !0 }), G(() => {
|
|
56
|
+
var a, C;
|
|
57
|
+
let t = k == null ? void 0 : k.currentRoute;
|
|
58
|
+
if (t) {
|
|
59
|
+
if (t.value.path === e.value.href)
|
|
60
|
+
e.value.isOpened = !0;
|
|
61
|
+
else if (((a = e.value.children) == null ? void 0 : a.length) > 0) {
|
|
62
|
+
let S = !1;
|
|
63
|
+
(C = e.value.children) == null || C.forEach((O) => {
|
|
64
|
+
t.value.path === O.href && (S = !0);
|
|
65
|
+
}), S && (e.value.isOpened = !0);
|
|
88
66
|
}
|
|
89
67
|
}
|
|
90
|
-
}), (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
68
|
+
}), (t, a) => {
|
|
69
|
+
var O;
|
|
70
|
+
const C = J("lkt-anchor"), S = J("menu-item", !0);
|
|
71
|
+
return r(), c("div", {
|
|
72
|
+
class: D(["lkt-menu-entry", $.value])
|
|
94
73
|
}, [
|
|
95
|
-
A("div",
|
|
96
|
-
|
|
97
|
-
to:
|
|
98
|
-
"on-click":
|
|
99
|
-
"is-active":
|
|
100
|
-
onActive:
|
|
74
|
+
A("div", re, [
|
|
75
|
+
H(C, {
|
|
76
|
+
to: e.value.href,
|
|
77
|
+
"on-click": N,
|
|
78
|
+
"is-active": V.value,
|
|
79
|
+
onActive: a[0] || (a[0] = (B) => p.value = B)
|
|
101
80
|
}, {
|
|
102
|
-
default:
|
|
103
|
-
A("div",
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
key:
|
|
107
|
-
entry:
|
|
108
|
-
}) :
|
|
81
|
+
default: j(() => [
|
|
82
|
+
A("div", ae, [
|
|
83
|
+
_.value ? (r(), c("div", se, [
|
|
84
|
+
P(s)["icon-" + e.value.key] ? x(t.$slots, "icon-" + e.value.key, {
|
|
85
|
+
key: e.value.key,
|
|
86
|
+
entry: e.value
|
|
87
|
+
}) : e.value.icon !== "" ? (r(), c("i", {
|
|
109
88
|
key: 1,
|
|
110
|
-
class:
|
|
111
|
-
}, null, 2)) :
|
|
112
|
-
])) :
|
|
113
|
-
|
|
89
|
+
class: D(e.value.icon)
|
|
90
|
+
}, null, 2)) : h("", !0)
|
|
91
|
+
])) : h("", !0),
|
|
92
|
+
e.value.label !== "" ? (r(), c("div", ie, Q(v.value), 1)) : h("", !0)
|
|
114
93
|
])
|
|
115
94
|
]),
|
|
116
95
|
_: 3
|
|
117
96
|
}, 8, ["to", "is-active"]),
|
|
118
|
-
|
|
97
|
+
((O = e.value.children) == null ? void 0 : O.length) > 0 ? (r(), c("div", {
|
|
119
98
|
key: 0,
|
|
120
99
|
class: "lkt-menu-entry-toggle",
|
|
121
100
|
onClick: g
|
|
122
101
|
}, [
|
|
123
|
-
|
|
102
|
+
f.value ? (r(), L(X(q.value), {
|
|
124
103
|
key: 0,
|
|
125
|
-
class:
|
|
126
|
-
}, null, 8, ["class"])) : (
|
|
104
|
+
class: D(["lkt-menu-entry-toggle-inner", e.value.isOpened ? "is-opened" : ""])
|
|
105
|
+
}, null, 8, ["class"])) : (r(), c("div", {
|
|
127
106
|
key: 1,
|
|
128
|
-
class:
|
|
107
|
+
class: D(["lkt-menu-entry-toggle-inner lkt-menu-entry-toggle-triangle", e.value.isOpened ? "is-opened" : ""])
|
|
129
108
|
}, null, 2))
|
|
130
|
-
])) :
|
|
109
|
+
])) : h("", !0)
|
|
131
110
|
]),
|
|
132
|
-
|
|
133
|
-
(
|
|
134
|
-
modelValue:
|
|
135
|
-
"onUpdate:modelValue": (
|
|
136
|
-
key:
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
name:
|
|
140
|
-
fn:
|
|
141
|
-
|
|
111
|
+
e.value.isOpened ? (r(), c("div", ce, [
|
|
112
|
+
(r(!0), c(F, null, E(e.value.children, (B, w) => (r(), L(S, {
|
|
113
|
+
modelValue: e.value.children[w],
|
|
114
|
+
"onUpdate:modelValue": (b) => e.value.children[w] = b,
|
|
115
|
+
key: e.value.children[w].key
|
|
116
|
+
}, W({ _: 2 }, [
|
|
117
|
+
E(l.value, (b) => ({
|
|
118
|
+
name: b,
|
|
119
|
+
fn: j(() => [
|
|
120
|
+
x(t.$slots, b)
|
|
142
121
|
])
|
|
143
122
|
}))
|
|
144
123
|
]), 1032, ["modelValue", "onUpdate:modelValue"]))), 128))
|
|
145
|
-
])) :
|
|
124
|
+
])) : h("", !0)
|
|
146
125
|
], 2);
|
|
147
126
|
};
|
|
148
127
|
}
|
|
149
|
-
}),
|
|
128
|
+
}), ve = { class: "lkt-menu-container" }, me = { class: "lkt-menu" }, pe = /* @__PURE__ */ K({
|
|
150
129
|
__name: "LktMenu",
|
|
151
|
-
props: {
|
|
152
|
-
modelValue: {
|
|
153
|
-
resource: {
|
|
154
|
-
resourceData: {
|
|
155
|
-
},
|
|
156
|
-
emits: [
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
130
|
+
props: /* @__PURE__ */ Y({
|
|
131
|
+
modelValue: {},
|
|
132
|
+
resource: {},
|
|
133
|
+
resourceData: {}
|
|
134
|
+
}, te(le)),
|
|
135
|
+
emits: [
|
|
136
|
+
"update:modelValue",
|
|
137
|
+
"click-outside",
|
|
138
|
+
"loading",
|
|
139
|
+
"results",
|
|
140
|
+
"response",
|
|
141
|
+
"error"
|
|
142
|
+
],
|
|
143
|
+
setup(u, { emit: m }) {
|
|
144
|
+
const o = u, d = m, e = T(), s = R(o.modelValue), k = (n) => {
|
|
145
|
+
let l = {};
|
|
146
|
+
typeof n == "object" && Object.keys(n).length > 0 && (l = JSON.parse(JSON.stringify(n)));
|
|
147
|
+
for (let v in l)
|
|
148
|
+
(Array.isArray(l[v]) || typeof l[v] == "object") && (l[v] = JSON.stringify(l[v]));
|
|
149
|
+
return l;
|
|
164
150
|
};
|
|
165
|
-
let
|
|
166
|
-
|
|
167
|
-
const g =
|
|
168
|
-
let
|
|
169
|
-
for (let
|
|
170
|
-
|
|
171
|
-
return
|
|
172
|
-
}),
|
|
173
|
-
if (!
|
|
174
|
-
let
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}).catch((
|
|
178
|
-
|
|
151
|
+
let p = new ue({});
|
|
152
|
+
p.increment(k(o.resourceData));
|
|
153
|
+
const g = i(() => U([], s.value)), N = i(() => {
|
|
154
|
+
let n = [];
|
|
155
|
+
for (let l in e)
|
|
156
|
+
l.startsWith("icon-") && g.value.includes(l.substring(5)) && n.push(l);
|
|
157
|
+
return n;
|
|
158
|
+
}), _ = () => {
|
|
159
|
+
if (!o.resource) return;
|
|
160
|
+
let n = p.getData();
|
|
161
|
+
d("loading"), oe(o.resource, n).then((l) => {
|
|
162
|
+
p.turnStoredIntoOriginal(), s.value = l.data, d("results", l.data), d("response", l);
|
|
163
|
+
}).catch((l) => {
|
|
164
|
+
d("error", l);
|
|
179
165
|
});
|
|
180
|
-
},
|
|
181
|
-
|
|
166
|
+
}, $ = () => {
|
|
167
|
+
d("click-outside");
|
|
182
168
|
};
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
}, { deep: !0 }),
|
|
186
|
-
|
|
187
|
-
}, { deep: !0 }),
|
|
188
|
-
A("div",
|
|
189
|
-
(
|
|
190
|
-
modelValue:
|
|
191
|
-
"onUpdate:modelValue": (
|
|
192
|
-
key:
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
name:
|
|
196
|
-
fn:
|
|
197
|
-
|
|
169
|
+
return M(() => o.modelValue, (n) => {
|
|
170
|
+
s.value = n;
|
|
171
|
+
}, { deep: !0 }), M(s, (n) => {
|
|
172
|
+
d("update:modelValue", n);
|
|
173
|
+
}, { deep: !0 }), _(), (n, l) => (r(), c("div", ve, [
|
|
174
|
+
A("div", me, [
|
|
175
|
+
(r(!0), c(F, null, E(s.value, (v, V) => (r(), L(de, {
|
|
176
|
+
modelValue: s.value[V],
|
|
177
|
+
"onUpdate:modelValue": (f) => s.value[V] = f,
|
|
178
|
+
key: v.key
|
|
179
|
+
}, W({ _: 2 }, [
|
|
180
|
+
E(N.value, (f) => ({
|
|
181
|
+
name: f,
|
|
182
|
+
fn: j(() => [
|
|
183
|
+
x(n.$slots, f)
|
|
198
184
|
])
|
|
199
185
|
}))
|
|
200
186
|
]), 1032, ["modelValue", "onUpdate:modelValue"]))), 128))
|
|
201
187
|
]),
|
|
202
188
|
A("div", {
|
|
203
189
|
class: "lkt-menu-outside",
|
|
204
|
-
onClick:
|
|
190
|
+
onClick: $
|
|
205
191
|
})
|
|
206
192
|
]));
|
|
207
193
|
}
|
|
208
|
-
}),
|
|
209
|
-
install: (
|
|
210
|
-
|
|
194
|
+
}), _e = {
|
|
195
|
+
install: (u) => {
|
|
196
|
+
u.component("lkt-menu") === void 0 && u.component("lkt-menu", pe);
|
|
211
197
|
}
|
|
212
|
-
},
|
|
198
|
+
}, Ve = (u, m, o) => Z(new z({
|
|
199
|
+
key: u,
|
|
200
|
+
href: m,
|
|
201
|
+
label: o
|
|
202
|
+
})), Ce = (u) => (y.toggleSlot = u, !0);
|
|
213
203
|
export {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
204
|
+
be as MenuEntry,
|
|
205
|
+
Ve as createMenuEntry,
|
|
206
|
+
_e as default,
|
|
207
|
+
Ce as setMenuToggleSlot
|
|
218
208
|
};
|
|
@@ -1,19 +1,49 @@
|
|
|
1
|
-
import { MenuEntry } from '
|
|
2
|
-
import { LktObject } from 'lkt-ts-interfaces';
|
|
1
|
+
import { LktObject, MenuEntry } from 'lkt-vue-kernel';
|
|
3
2
|
type __VLS_Props = {
|
|
4
3
|
modelValue?: MenuEntry;
|
|
5
4
|
};
|
|
6
5
|
declare const entry: import("vue").Ref<{
|
|
7
|
-
key
|
|
8
|
-
href
|
|
9
|
-
label
|
|
10
|
-
icon
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
key?: string | undefined;
|
|
7
|
+
href?: string | undefined;
|
|
8
|
+
label?: string | undefined;
|
|
9
|
+
icon?: string | undefined;
|
|
10
|
+
isActiveChecker?: Function | undefined;
|
|
11
|
+
isOpened?: boolean | undefined;
|
|
12
|
+
isActive?: boolean | undefined;
|
|
13
|
+
parent?: {
|
|
14
|
+
key?: string | undefined;
|
|
15
|
+
href?: string | undefined;
|
|
16
|
+
label?: string | undefined;
|
|
17
|
+
icon?: string | undefined;
|
|
18
|
+
isActiveChecker?: Function | undefined;
|
|
19
|
+
isOpened?: boolean | undefined;
|
|
20
|
+
isActive?: boolean | undefined;
|
|
21
|
+
parent?: /*elided*/ any | undefined;
|
|
22
|
+
children?: /*elided*/ any[] | undefined;
|
|
23
|
+
events?: {
|
|
24
|
+
click?: Function | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
onClick?: Function | undefined;
|
|
27
|
+
} | undefined;
|
|
28
|
+
children?: {
|
|
29
|
+
key?: string | undefined;
|
|
30
|
+
href?: string | undefined;
|
|
31
|
+
label?: string | undefined;
|
|
32
|
+
icon?: string | undefined;
|
|
33
|
+
isActiveChecker?: Function | undefined;
|
|
34
|
+
isOpened?: boolean | undefined;
|
|
35
|
+
isActive?: boolean | undefined;
|
|
36
|
+
parent?: /*elided*/ any | undefined;
|
|
37
|
+
children?: /*elided*/ any[] | undefined;
|
|
38
|
+
events?: {
|
|
39
|
+
click?: Function | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
onClick?: Function | undefined;
|
|
42
|
+
}[] | undefined;
|
|
43
|
+
events?: {
|
|
44
|
+
click?: Function | undefined;
|
|
45
|
+
} | undefined;
|
|
46
|
+
onClick?: Function | undefined;
|
|
17
47
|
setChildren: (children: MenuEntry[]) => MenuEntry;
|
|
18
48
|
setOnClick: (fn: Function) => MenuEntry;
|
|
19
49
|
setIsActiveChecker: (fn: Function) => MenuEntry;
|
|
@@ -21,17 +51,50 @@ declare const entry: import("vue").Ref<{
|
|
|
21
51
|
setLabel: (str: string) => MenuEntry;
|
|
22
52
|
setIcon: (str: string) => MenuEntry;
|
|
23
53
|
doClose: () => void;
|
|
54
|
+
feed: (data?: LktObject, target?: MenuEntry | undefined) => void;
|
|
55
|
+
assignProp: (key: string, value: any) => void;
|
|
24
56
|
}, MenuEntry | {
|
|
25
|
-
key
|
|
26
|
-
href
|
|
27
|
-
label
|
|
28
|
-
icon
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
57
|
+
key?: string | undefined;
|
|
58
|
+
href?: string | undefined;
|
|
59
|
+
label?: string | undefined;
|
|
60
|
+
icon?: string | undefined;
|
|
61
|
+
isActiveChecker?: Function | undefined;
|
|
62
|
+
isOpened?: boolean | undefined;
|
|
63
|
+
isActive?: boolean | undefined;
|
|
64
|
+
parent?: {
|
|
65
|
+
key?: string | undefined;
|
|
66
|
+
href?: string | undefined;
|
|
67
|
+
label?: string | undefined;
|
|
68
|
+
icon?: string | undefined;
|
|
69
|
+
isActiveChecker?: Function | undefined;
|
|
70
|
+
isOpened?: boolean | undefined;
|
|
71
|
+
isActive?: boolean | undefined;
|
|
72
|
+
parent?: /*elided*/ any | undefined;
|
|
73
|
+
children?: /*elided*/ any[] | undefined;
|
|
74
|
+
events?: {
|
|
75
|
+
click?: Function | undefined;
|
|
76
|
+
} | undefined;
|
|
77
|
+
onClick?: Function | undefined;
|
|
78
|
+
} | undefined;
|
|
79
|
+
children?: {
|
|
80
|
+
key?: string | undefined;
|
|
81
|
+
href?: string | undefined;
|
|
82
|
+
label?: string | undefined;
|
|
83
|
+
icon?: string | undefined;
|
|
84
|
+
isActiveChecker?: Function | undefined;
|
|
85
|
+
isOpened?: boolean | undefined;
|
|
86
|
+
isActive?: boolean | undefined;
|
|
87
|
+
parent?: /*elided*/ any | undefined;
|
|
88
|
+
children?: /*elided*/ any[] | undefined;
|
|
89
|
+
events?: {
|
|
90
|
+
click?: Function | undefined;
|
|
91
|
+
} | undefined;
|
|
92
|
+
onClick?: Function | undefined;
|
|
93
|
+
}[] | undefined;
|
|
94
|
+
events?: {
|
|
95
|
+
click?: Function | undefined;
|
|
96
|
+
} | undefined;
|
|
97
|
+
onClick?: Function | undefined;
|
|
35
98
|
setChildren: (children: MenuEntry[]) => MenuEntry;
|
|
36
99
|
setOnClick: (fn: Function) => MenuEntry;
|
|
37
100
|
setIsActiveChecker: (fn: Function) => MenuEntry;
|
|
@@ -39,6 +102,8 @@ declare const entry: import("vue").Ref<{
|
|
|
39
102
|
setLabel: (str: string) => MenuEntry;
|
|
40
103
|
setIcon: (str: string) => MenuEntry;
|
|
41
104
|
doClose: () => void;
|
|
105
|
+
feed: (data?: LktObject, target?: MenuEntry | undefined) => void;
|
|
106
|
+
assignProp: (key: string, value: any) => void;
|
|
42
107
|
}>, slots: Readonly<{
|
|
43
108
|
[name: string]: import("vue").Slot<any> | undefined;
|
|
44
109
|
}>, isActive: import("vue").Ref<boolean, boolean>;
|
|
@@ -46,19 +111,50 @@ declare const onClickToggle: () => void, onClick: () => number;
|
|
|
46
111
|
declare const canRenderIcon: import("vue").ComputedRef<boolean | import("vue").Slot<any>>, classes: import("vue").ComputedRef<string>;
|
|
47
112
|
declare const entryIconSlots: import("vue").ComputedRef<LktObject>, computedLabel: import("vue").ComputedRef<any>, computedIsActive: import("vue").ComputedRef<boolean>, hasToggleSlot: import("vue").ComputedRef<boolean>, toggleSlot: import("vue").ComputedRef<string | import("vue").Component>;
|
|
48
113
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
49
|
-
declare var
|
|
50
|
-
key: string;
|
|
114
|
+
declare var __VLS_9: string, __VLS_10: {
|
|
115
|
+
key: string | undefined;
|
|
51
116
|
entry: {
|
|
52
|
-
key
|
|
53
|
-
href
|
|
54
|
-
label
|
|
55
|
-
icon
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
117
|
+
key?: string | undefined;
|
|
118
|
+
href?: string | undefined;
|
|
119
|
+
label?: string | undefined;
|
|
120
|
+
icon?: string | undefined;
|
|
121
|
+
isActiveChecker?: Function | undefined;
|
|
122
|
+
isOpened?: boolean | undefined;
|
|
123
|
+
isActive?: boolean | undefined;
|
|
124
|
+
parent?: {
|
|
125
|
+
key?: string | undefined;
|
|
126
|
+
href?: string | undefined;
|
|
127
|
+
label?: string | undefined;
|
|
128
|
+
icon?: string | undefined;
|
|
129
|
+
isActiveChecker?: Function | undefined;
|
|
130
|
+
isOpened?: boolean | undefined;
|
|
131
|
+
isActive?: boolean | undefined;
|
|
132
|
+
parent?: /*elided*/ any | undefined;
|
|
133
|
+
children?: /*elided*/ any[] | undefined;
|
|
134
|
+
events?: {
|
|
135
|
+
click?: Function | undefined;
|
|
136
|
+
} | undefined;
|
|
137
|
+
onClick?: Function | undefined;
|
|
138
|
+
} | undefined;
|
|
139
|
+
children?: {
|
|
140
|
+
key?: string | undefined;
|
|
141
|
+
href?: string | undefined;
|
|
142
|
+
label?: string | undefined;
|
|
143
|
+
icon?: string | undefined;
|
|
144
|
+
isActiveChecker?: Function | undefined;
|
|
145
|
+
isOpened?: boolean | undefined;
|
|
146
|
+
isActive?: boolean | undefined;
|
|
147
|
+
parent?: /*elided*/ any | undefined;
|
|
148
|
+
children?: /*elided*/ any[] | undefined;
|
|
149
|
+
events?: {
|
|
150
|
+
click?: Function | undefined;
|
|
151
|
+
} | undefined;
|
|
152
|
+
onClick?: Function | undefined;
|
|
153
|
+
}[] | undefined;
|
|
154
|
+
events?: {
|
|
155
|
+
click?: Function | undefined;
|
|
156
|
+
} | undefined;
|
|
157
|
+
onClick?: Function | undefined;
|
|
62
158
|
setChildren: (children: MenuEntry[]) => MenuEntry;
|
|
63
159
|
setOnClick: (fn: Function) => MenuEntry;
|
|
64
160
|
setIsActiveChecker: (fn: Function) => MenuEntry;
|
|
@@ -66,12 +162,14 @@ declare var __VLS_10: string, __VLS_11: {
|
|
|
66
162
|
setLabel: (str: string) => MenuEntry;
|
|
67
163
|
setIcon: (str: string) => MenuEntry;
|
|
68
164
|
doClose: () => void;
|
|
165
|
+
feed: (data?: LktObject, target?: MenuEntry | undefined) => void;
|
|
166
|
+
assignProp: (key: string, value: any) => void;
|
|
69
167
|
};
|
|
70
|
-
},
|
|
168
|
+
}, __VLS_24: any, __VLS_25: {};
|
|
71
169
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
72
|
-
[K in NonNullable<typeof
|
|
170
|
+
[K in NonNullable<typeof __VLS_9>]?: (props: typeof __VLS_10) => any;
|
|
73
171
|
} & {
|
|
74
|
-
[K in NonNullable<typeof
|
|
172
|
+
[K in NonNullable<typeof __VLS_24>]?: (props: typeof __VLS_25) => any;
|
|
75
173
|
}>;
|
|
76
174
|
declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
|
77
175
|
entry: typeof entry;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MenuEntry } from "
|
|
1
|
+
import { MenuEntry } from "lkt-vue-kernel";
|
|
2
2
|
export declare const fetchKeys: (r: string[], entries: MenuEntry[]) => string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component, Plugin } from 'vue';
|
|
2
2
|
import "../style.css";
|
|
3
|
-
import { MenuEntry } from "
|
|
3
|
+
import { MenuEntry } from "lkt-vue-kernel";
|
|
4
4
|
declare const LktMenu: Plugin;
|
|
5
5
|
export default LktMenu;
|
|
6
6
|
export declare const createMenuEntry: (key: string, href: string, label: string) => MenuEntry;
|
|
@@ -1,56 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { LktObject } from "lkt-ts-interfaces";
|
|
4
|
-
type __VLS_Props = {
|
|
5
|
-
modelValue?: MenuEntry[];
|
|
6
|
-
resource?: string;
|
|
7
|
-
resourceData: LktObject;
|
|
8
|
-
};
|
|
1
|
+
import MenuItem from '../components/MenuItem.vue';
|
|
2
|
+
import { LktObject, MenuConfig } from 'lkt-vue-kernel';
|
|
9
3
|
declare const entries: import("vue").Ref<{
|
|
10
|
-
key
|
|
11
|
-
href
|
|
12
|
-
label
|
|
13
|
-
icon
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
children: /*elided*/ any[];
|
|
38
|
-
setChildren: (children: MenuEntry[]) => MenuEntry;
|
|
39
|
-
setOnClick: (fn: Function) => MenuEntry;
|
|
40
|
-
setIsActiveChecker: (fn: Function) => MenuEntry;
|
|
41
|
-
setIsActive: (enabled?: boolean) => MenuEntry;
|
|
42
|
-
setLabel: (str: string) => MenuEntry;
|
|
43
|
-
setIcon: (str: string) => MenuEntry;
|
|
44
|
-
doClose: () => void;
|
|
4
|
+
key?: string | undefined;
|
|
5
|
+
href?: string | undefined;
|
|
6
|
+
label?: string | undefined;
|
|
7
|
+
icon?: string | undefined;
|
|
8
|
+
isActiveChecker?: Function | undefined;
|
|
9
|
+
isOpened?: boolean | undefined;
|
|
10
|
+
isActive?: boolean | undefined;
|
|
11
|
+
parent?: /*elided*/ any | undefined;
|
|
12
|
+
children?: /*elided*/ any[] | undefined;
|
|
13
|
+
events?: {
|
|
14
|
+
click?: Function | undefined;
|
|
15
|
+
} | undefined;
|
|
16
|
+
onClick?: Function | undefined;
|
|
17
|
+
}[], import("lkt-vue-kernel").MenuEntryConfig[] | {
|
|
18
|
+
key?: string | undefined;
|
|
19
|
+
href?: string | undefined;
|
|
20
|
+
label?: string | undefined;
|
|
21
|
+
icon?: string | undefined;
|
|
22
|
+
isActiveChecker?: Function | undefined;
|
|
23
|
+
isOpened?: boolean | undefined;
|
|
24
|
+
isActive?: boolean | undefined;
|
|
25
|
+
parent?: /*elided*/ any | undefined;
|
|
26
|
+
children?: /*elided*/ any[] | undefined;
|
|
27
|
+
events?: {
|
|
28
|
+
click?: Function | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
onClick?: Function | undefined;
|
|
45
31
|
}[]>;
|
|
46
32
|
declare const entryIconSlots: import("vue").ComputedRef<LktObject>;
|
|
47
33
|
declare const onClickOutside: () => void;
|
|
48
34
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
49
|
-
declare var
|
|
35
|
+
declare var __VLS_8: any, __VLS_9: {};
|
|
50
36
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
51
|
-
[K in NonNullable<typeof
|
|
37
|
+
[K in NonNullable<typeof __VLS_8>]?: (props: typeof __VLS_9) => any;
|
|
52
38
|
}>;
|
|
53
|
-
declare const __VLS_self: import("vue").DefineComponent<
|
|
39
|
+
declare const __VLS_self: import("vue").DefineComponent<MenuConfig, {
|
|
54
40
|
MenuItem: typeof MenuItem;
|
|
55
41
|
entries: typeof entries;
|
|
56
42
|
entryIconSlots: typeof entryIconSlots;
|
|
@@ -62,7 +48,7 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
|
|
62
48
|
"update:modelValue": (...args: any[]) => void;
|
|
63
49
|
"click-outside": (...args: any[]) => void;
|
|
64
50
|
response: (...args: any[]) => void;
|
|
65
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
51
|
+
}, string, import("vue").PublicProps, Readonly<MenuConfig> & Readonly<{
|
|
66
52
|
onError?: ((...args: any[]) => any) | undefined;
|
|
67
53
|
onLoading?: ((...args: any[]) => any) | undefined;
|
|
68
54
|
onResults?: ((...args: any[]) => any) | undefined;
|
|
@@ -72,16 +58,16 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
|
|
72
58
|
}>, {
|
|
73
59
|
resource: string;
|
|
74
60
|
resourceData: LktObject;
|
|
75
|
-
modelValue:
|
|
61
|
+
modelValue: import("lkt-vue-kernel").MenuEntryConfig[];
|
|
76
62
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
77
|
-
declare const __VLS_component: import("vue").DefineComponent<
|
|
63
|
+
declare const __VLS_component: import("vue").DefineComponent<MenuConfig, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
78
64
|
error: (...args: any[]) => void;
|
|
79
65
|
loading: (...args: any[]) => void;
|
|
80
66
|
results: (...args: any[]) => void;
|
|
81
67
|
"update:modelValue": (...args: any[]) => void;
|
|
82
68
|
"click-outside": (...args: any[]) => void;
|
|
83
69
|
response: (...args: any[]) => void;
|
|
84
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
70
|
+
}, string, import("vue").PublicProps, Readonly<MenuConfig> & Readonly<{
|
|
85
71
|
onError?: ((...args: any[]) => any) | undefined;
|
|
86
72
|
onLoading?: ((...args: any[]) => any) | undefined;
|
|
87
73
|
onResults?: ((...args: any[]) => any) | undefined;
|
|
@@ -91,7 +77,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
91
77
|
}>, {
|
|
92
78
|
resource: string;
|
|
93
79
|
resourceData: LktObject;
|
|
94
|
-
modelValue:
|
|
80
|
+
modelValue: import("lkt-vue-kernel").MenuEntryConfig[];
|
|
95
81
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
96
82
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
97
83
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lkt-menu",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lkt",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"vue-tsc": "^2.2.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"lkt-anchor": "^1.
|
|
54
|
-
"lkt-data-state": "^1.0.
|
|
55
|
-
"lkt-http-client": "^1.0.
|
|
56
|
-
"lkt-i18n": "^1.0.
|
|
57
|
-
"lkt-vue-kernel": "
|
|
53
|
+
"lkt-anchor": "^1.2.4",
|
|
54
|
+
"lkt-data-state": "^1.0.11",
|
|
55
|
+
"lkt-http-client": "^1.0.34",
|
|
56
|
+
"lkt-i18n": "^1.0.6",
|
|
57
|
+
"lkt-vue-kernel": "1.0.44",
|
|
58
58
|
"vue": "^3.3.0",
|
|
59
59
|
"vue-router": "^4.3.3"
|
|
60
60
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { MenuEntry } from '
|
|
2
|
+
import { extractI18nValue, LktObject, MenuEntry } from 'lkt-vue-kernel';
|
|
3
3
|
import { computed, onMounted, ref, useSlots, watch } from 'vue';
|
|
4
|
-
import { LktObject } from 'lkt-ts-interfaces';
|
|
5
4
|
import { fetchKeys } from '../functions/helpers';
|
|
6
5
|
import { useRouter } from 'vue-router';
|
|
7
6
|
import { Settings } from '../settings/Settings';
|
|
8
|
-
import { extractI18nValue } from 'lkt-vue-kernel';
|
|
9
7
|
|
|
10
|
-
const emit = defineEmits([
|
|
8
|
+
const emit = defineEmits([
|
|
9
|
+
'update:modelValue'
|
|
10
|
+
]);
|
|
11
11
|
|
|
12
12
|
const props = withDefaults(defineProps<{
|
|
13
13
|
modelValue?: MenuEntry
|
|
14
14
|
}>(), {
|
|
15
|
-
modelValue: () => (new MenuEntry(
|
|
15
|
+
modelValue: () => (new MenuEntry())
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
const entry = ref(props.modelValue),
|
|
@@ -24,7 +24,15 @@ const onClickToggle = () => {
|
|
|
24
24
|
entry.value.isOpened = !entry.value.isOpened;
|
|
25
25
|
},
|
|
26
26
|
onClick = () => {
|
|
27
|
-
if (entry.value.children
|
|
27
|
+
if (entry.value.children?.length > 0) onClickToggle();
|
|
28
|
+
|
|
29
|
+
if (typeof entry.value.events?.click === 'function') {
|
|
30
|
+
entry.value.events.click({
|
|
31
|
+
entry: entry.value
|
|
32
|
+
});
|
|
33
|
+
return 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
28
36
|
if (typeof entry.value.onClick === 'function') {
|
|
29
37
|
entry.value.onClick({
|
|
30
38
|
entry: entry.value
|
|
@@ -95,9 +103,9 @@ onMounted(() => {
|
|
|
95
103
|
if (currentRoute.value.path === entry.value.href) {
|
|
96
104
|
entry.value.isOpened = true;
|
|
97
105
|
|
|
98
|
-
} else if (entry.value.children
|
|
106
|
+
} else if (entry.value.children?.length > 0) {
|
|
99
107
|
let opened = false;
|
|
100
|
-
entry.value.children
|
|
108
|
+
entry.value.children?.forEach((child) => {
|
|
101
109
|
if (currentRoute.value.path === child.href) opened = true;
|
|
102
110
|
});
|
|
103
111
|
|
|
@@ -133,7 +141,7 @@ onMounted(() => {
|
|
|
133
141
|
</div>
|
|
134
142
|
</lkt-anchor>
|
|
135
143
|
|
|
136
|
-
<div class="lkt-menu-entry-toggle" v-if="entry.children
|
|
144
|
+
<div class="lkt-menu-entry-toggle" v-if="entry.children?.length > 0" @click="onClickToggle">
|
|
137
145
|
<template v-if="hasToggleSlot">
|
|
138
146
|
<component :is="toggleSlot" class="lkt-menu-entry-toggle-inner" :class="entry.isOpened ? 'is-opened' : '' "/>
|
|
139
147
|
</template>
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {httpCall, HTTPResponse} from "lkt-http-client";
|
|
2
|
+
import MenuItem from '../components/MenuItem.vue';
|
|
3
|
+
import { computed, ref, useSlots, watch } from 'vue';
|
|
4
|
+
import { getDefaultValues, LktObject, Menu, MenuConfig } from 'lkt-vue-kernel';
|
|
5
|
+
import { fetchKeys } from '../functions/helpers';
|
|
6
|
+
import { DataState } from 'lkt-data-state';
|
|
7
|
+
import { httpCall, HTTPResponse } from 'lkt-http-client';
|
|
9
8
|
|
|
10
|
-
const props = withDefaults(defineProps<
|
|
11
|
-
modelValue?: MenuEntry[]
|
|
12
|
-
resource?: string
|
|
13
|
-
resourceData: LktObject
|
|
14
|
-
}>(), {
|
|
15
|
-
modelValue: () => [],
|
|
16
|
-
resource: '',
|
|
17
|
-
resourceData: () => ({}),
|
|
18
|
-
});
|
|
9
|
+
const props = withDefaults(defineProps<MenuConfig>(), getDefaultValues(Menu));
|
|
19
10
|
|
|
20
|
-
const emit = defineEmits([
|
|
11
|
+
const emit = defineEmits([
|
|
12
|
+
'update:modelValue',
|
|
13
|
+
'click-outside',
|
|
14
|
+
'loading',
|
|
15
|
+
'results',
|
|
16
|
+
'response',
|
|
17
|
+
'error'
|
|
18
|
+
]);
|
|
21
19
|
|
|
22
20
|
const slots = useSlots();
|
|
23
21
|
|