lkt-menu 1.2.0 → 1.4.0
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 +155 -35
- package/dist/build.js +220 -156
- 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 +40 -53
- package/package.json +6 -6
- package/src/components/MenuItem.vue +17 -9
- package/src/lib-components/LktMenu.vue +16 -17
package/dist/build.d.ts
CHANGED
|
@@ -1,42 +1,162 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
declare var F: {
|
|
2
|
+
new (t?: {}): {
|
|
3
|
+
setChildren(t: any): /*elided*/ any;
|
|
4
|
+
children: any;
|
|
5
|
+
setOnClick(t: any): /*elided*/ any;
|
|
6
|
+
onClick: any;
|
|
7
|
+
setIsActiveChecker(t: any): /*elided*/ any;
|
|
8
|
+
isActiveChecker: any;
|
|
9
|
+
setIsActive(t?: boolean): /*elided*/ any;
|
|
10
|
+
isActive: boolean | undefined;
|
|
11
|
+
setLabel(t: any): /*elided*/ any;
|
|
12
|
+
label: any;
|
|
13
|
+
setIcon(t: any): /*elided*/ any;
|
|
14
|
+
icon: any;
|
|
15
|
+
doClose(): void;
|
|
16
|
+
isOpened: boolean | undefined;
|
|
17
|
+
feed(t?: {}, l?: /*elided*/ any): void;
|
|
18
|
+
assignProp(t: any, l: any): void;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
declare function dt(e: any, t: any, l: any): {
|
|
22
|
+
setChildren: (t: any) => {
|
|
23
|
+
setChildren(t: any): /*elided*/ any;
|
|
24
|
+
children: any;
|
|
25
|
+
setOnClick(t: any): /*elided*/ any;
|
|
26
|
+
onClick: any;
|
|
27
|
+
setIsActiveChecker(t: any): /*elided*/ any;
|
|
28
|
+
isActiveChecker: any;
|
|
29
|
+
setIsActive(t?: boolean): /*elided*/ any;
|
|
30
|
+
isActive: boolean | undefined;
|
|
31
|
+
setLabel(t: any): /*elided*/ any;
|
|
32
|
+
label: any;
|
|
33
|
+
setIcon(t: any): /*elided*/ any;
|
|
34
|
+
icon: any;
|
|
35
|
+
doClose(): void;
|
|
36
|
+
isOpened: boolean | undefined;
|
|
37
|
+
feed(t?: {}, l?: /*elided*/ any): void;
|
|
38
|
+
assignProp(t: any, l: any): void;
|
|
39
|
+
};
|
|
40
|
+
children: any;
|
|
41
|
+
setOnClick: (t: any) => {
|
|
42
|
+
setChildren(t: any): /*elided*/ any;
|
|
43
|
+
children: any;
|
|
44
|
+
setOnClick(t: any): /*elided*/ any;
|
|
45
|
+
onClick: any;
|
|
46
|
+
setIsActiveChecker(t: any): /*elided*/ any;
|
|
47
|
+
isActiveChecker: any;
|
|
48
|
+
setIsActive(t?: boolean): /*elided*/ any;
|
|
49
|
+
isActive: boolean | undefined;
|
|
50
|
+
setLabel(t: any): /*elided*/ any;
|
|
51
|
+
label: any;
|
|
52
|
+
setIcon(t: any): /*elided*/ any;
|
|
53
|
+
icon: any;
|
|
54
|
+
doClose(): void;
|
|
55
|
+
isOpened: boolean | undefined;
|
|
56
|
+
feed(t?: {}, l?: /*elided*/ any): void;
|
|
57
|
+
assignProp(t: any, l: any): void;
|
|
58
|
+
};
|
|
12
59
|
onClick: any;
|
|
13
|
-
setIsActiveChecker(
|
|
60
|
+
setIsActiveChecker: (t: any) => {
|
|
61
|
+
setChildren(t: any): /*elided*/ any;
|
|
62
|
+
children: any;
|
|
63
|
+
setOnClick(t: any): /*elided*/ any;
|
|
64
|
+
onClick: any;
|
|
65
|
+
setIsActiveChecker(t: any): /*elided*/ any;
|
|
66
|
+
isActiveChecker: any;
|
|
67
|
+
setIsActive(t?: boolean): /*elided*/ any;
|
|
68
|
+
isActive: boolean | undefined;
|
|
69
|
+
setLabel(t: any): /*elided*/ any;
|
|
70
|
+
label: any;
|
|
71
|
+
setIcon(t: any): /*elided*/ any;
|
|
72
|
+
icon: any;
|
|
73
|
+
doClose(): void;
|
|
74
|
+
isOpened: boolean | undefined;
|
|
75
|
+
feed(t?: {}, l?: /*elided*/ any): void;
|
|
76
|
+
assignProp(t: any, l: any): void;
|
|
77
|
+
};
|
|
14
78
|
isActiveChecker: any;
|
|
15
|
-
setIsActive(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
79
|
+
setIsActive: (t?: boolean) => {
|
|
80
|
+
setChildren(t: any): /*elided*/ any;
|
|
81
|
+
children: any;
|
|
82
|
+
setOnClick(t: any): /*elided*/ any;
|
|
83
|
+
onClick: any;
|
|
84
|
+
setIsActiveChecker(t: any): /*elided*/ any;
|
|
85
|
+
isActiveChecker: any;
|
|
86
|
+
setIsActive(t?: boolean): /*elided*/ any;
|
|
87
|
+
isActive: boolean | undefined;
|
|
88
|
+
setLabel(t: any): /*elided*/ any;
|
|
89
|
+
label: any;
|
|
90
|
+
setIcon(t: any): /*elided*/ any;
|
|
91
|
+
icon: any;
|
|
92
|
+
doClose(): void;
|
|
93
|
+
isOpened: boolean | undefined;
|
|
94
|
+
feed(t?: {}, l?: /*elided*/ any): void;
|
|
95
|
+
assignProp(t: any, l: any): void;
|
|
96
|
+
};
|
|
97
|
+
isActive: boolean | undefined;
|
|
98
|
+
setLabel: (t: any) => {
|
|
99
|
+
setChildren(t: any): /*elided*/ any;
|
|
100
|
+
children: any;
|
|
101
|
+
setOnClick(t: any): /*elided*/ any;
|
|
102
|
+
onClick: any;
|
|
103
|
+
setIsActiveChecker(t: any): /*elided*/ any;
|
|
104
|
+
isActiveChecker: any;
|
|
105
|
+
setIsActive(t?: boolean): /*elided*/ any;
|
|
106
|
+
isActive: boolean | undefined;
|
|
107
|
+
setLabel(t: any): /*elided*/ any;
|
|
108
|
+
label: any;
|
|
109
|
+
setIcon(t: any): /*elided*/ any;
|
|
110
|
+
icon: any;
|
|
111
|
+
doClose(): void;
|
|
112
|
+
isOpened: boolean | undefined;
|
|
113
|
+
feed(t?: {}, l?: /*elided*/ any): void;
|
|
114
|
+
assignProp(t: any, l: any): void;
|
|
115
|
+
};
|
|
23
116
|
label: any;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
117
|
+
setIcon: (t: any) => {
|
|
118
|
+
setChildren(t: any): /*elided*/ any;
|
|
119
|
+
children: any;
|
|
120
|
+
setOnClick(t: any): /*elided*/ any;
|
|
121
|
+
onClick: any;
|
|
122
|
+
setIsActiveChecker(t: any): /*elided*/ any;
|
|
123
|
+
isActiveChecker: any;
|
|
124
|
+
setIsActive(t?: boolean): /*elided*/ any;
|
|
125
|
+
isActive: boolean | undefined;
|
|
126
|
+
setLabel(t: any): /*elided*/ any;
|
|
127
|
+
label: any;
|
|
128
|
+
setIcon(t: any): /*elided*/ any;
|
|
129
|
+
icon: any;
|
|
130
|
+
doClose(): void;
|
|
131
|
+
isOpened: boolean | undefined;
|
|
132
|
+
feed(t?: {}, l?: /*elided*/ any): void;
|
|
133
|
+
assignProp(t: any, l: any): void;
|
|
134
|
+
};
|
|
135
|
+
icon: any;
|
|
36
136
|
doClose: () => void;
|
|
137
|
+
isOpened: boolean | undefined;
|
|
138
|
+
feed: (t?: {}, l?: {
|
|
139
|
+
setChildren(t: any): /*elided*/ any;
|
|
140
|
+
children: any;
|
|
141
|
+
setOnClick(t: any): /*elided*/ any;
|
|
142
|
+
onClick: any;
|
|
143
|
+
setIsActiveChecker(t: any): /*elided*/ any;
|
|
144
|
+
isActiveChecker: any;
|
|
145
|
+
setIsActive(t?: boolean): /*elided*/ any;
|
|
146
|
+
isActive: boolean | undefined;
|
|
147
|
+
setLabel(t: any): /*elided*/ any;
|
|
148
|
+
label: any;
|
|
149
|
+
setIcon(t: any): /*elided*/ any;
|
|
150
|
+
icon: any;
|
|
151
|
+
doClose(): void;
|
|
152
|
+
isOpened: boolean | undefined;
|
|
153
|
+
feed(t?: {}, l?: /*elided*/ any): void;
|
|
154
|
+
assignProp(t: any, l: any): void;
|
|
155
|
+
}) => void;
|
|
156
|
+
assignProp: (t: any, l: any) => void;
|
|
37
157
|
};
|
|
38
|
-
declare namespace
|
|
158
|
+
declare namespace ct {
|
|
39
159
|
function install(e: any): void;
|
|
40
160
|
}
|
|
41
|
-
declare function
|
|
42
|
-
export {
|
|
161
|
+
declare function vt(e: any): boolean;
|
|
162
|
+
export { F as MenuEntry, dt as createMenuEntry, ct as default, vt as setMenuToggleSlot };
|
package/dist/build.js
CHANGED
|
@@ -1,218 +1,282 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var Y = Object.defineProperty;
|
|
2
|
+
var Z = (e, t, l) => t in e ? Y(e, t, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[t] = l;
|
|
3
|
+
var n = (e, t, l) => Z(e, typeof t != "symbol" ? t + "" : t, l);
|
|
4
|
+
import { defineComponent as J, ref as B, useSlots as W, computed as m, watch as M, onMounted as ee, resolveComponent as K, createElementBlock as h, openBlock as u, normalizeClass as D, createElementVNode as E, createCommentVNode as g, createVNode as te, withCtx as U, renderSlot as z, unref as re, toDisplayString as le, createBlock as j, resolveDynamicComponent as ae, Fragment as q, renderList as I, createSlots as G, mergeDefaults as ne, reactive as oe } from "vue";
|
|
3
5
|
import "lkt-string-tools";
|
|
4
|
-
import { __ as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { __ as se } from "lkt-i18n";
|
|
7
|
+
import { useRouter as ie } from "vue-router";
|
|
8
|
+
import { DataState as ue } from "lkt-data-state";
|
|
9
|
+
import { httpCall as ce } from "lkt-http-client";
|
|
10
|
+
var de = ((e) => (e.Button = "button", e.Submit = "submit", e.Reset = "reset", e.Anchor = "anchor", e.Content = "content", e.Switch = "switch", e.HiddenSwitch = "hidden-switch", e.Split = "split", e.SplitLazy = "split-lazy", e.SplitEver = "split-ever", e.Tooltip = "tooltip", e.TooltipLazy = "tooltip-lazy", e.TooltipEver = "tooltip-ever", e))(de || {}), ve = ((e) => (e.Text = "text", e.Email = "email", e.Tel = "tel", e.Password = "password", e.Search = "search", e.Number = "number", e.Color = "color", e.Range = "range", e.Textarea = "textarea", e.Html = "html", e.Date = "date", e.File = "file", e.Image = "image", e.Select = "select", e.Check = "check", e.Switch = "switch", e.Calc = "calc", e.Card = "card", e.Elements = "elements", e))(ve || {}), me = ["lktDateProps", "lktStrictItem", "lktExcludedProps"], d, Q = (d = class {
|
|
11
|
+
constructor(t) {
|
|
10
12
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
feed(t = {}, l = this) {
|
|
14
|
+
if (typeof t == "object") for (let [s, r] of Object.entries(t)) l.assignProp(s, r);
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
assignProp(t, l) {
|
|
17
|
+
if (!(me.includes(t) || d.lktExcludedProps.includes(t))) {
|
|
18
|
+
if (d.lktDateProps.includes(t)) {
|
|
19
|
+
this[t] = new Date(l);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
this[t] = l;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}, n(d, "lktAllowUndefinedProps", []), n(d, "lktExcludedProps", []), n(d, "lktDateProps", []), n(d, "lktStrictItem", !1), n(d, "lktDefaultValues", []), d), he = ((e) => (e.Auto = "auto", e.Always = "always", e.Lazy = "lazy", e.Ever = "ever", e))(he || {}), pe = ((e) => (e.Transform = "transform", e.Height = "height", e.Display = "display", e))(pe || {}), fe = ((e) => (e.Href = "href", e.RouterLink = "router-link", e.RouterLinkBack = "router-link-back", e.Mail = "mail", e.Tel = "tel", e.Tab = "tab", e.Download = "download", e.Action = "action", e.Legacy = "", e))(fe || {}), ke = ((e) => (e.None = "", e.Field = "field", e.Button = "button", e.Anchor = "anchor", e))(ke || {}), ye = ((e) => (e.List = "list", e.Inline = "inline", e.Count = "count", e))(ye || {}), ge = ((e) => (e.None = "", e.Focus = "focus", e.Blur = "blur", e.Always = "always", e))(ge || {}), Ce = ((e) => (e.MinStringLength = "min-str", e.MinNumber = "min-num", e.MaxStringLength = "max-str", e.MaxNumber = "max-num", e.Email = "email", e.Empty = "empty", e.EqualTo = "equal-to", e.MinNumbers = "min-numbers", e.MaxNumbers = "max-numbers", e.MinChars = "min-chars", e.MaxChars = "max-chars", e.MinUpperChars = "min-upper-chars", e.MaxUpperChars = "max-upper-chars", e.MinLowerChars = "min-lower-chars", e.MaxLowerChars = "max-lower-chars", e.MinSpecialChars = "min-special-chars", e.MaxSpecialChars = "max-special-chars", e))(Ce || {}), be = ((e) => (e.Ok = "ok", e.Ko = "ko", e.Info = "info", e))(be || {}), xe = ((e) => (e.NotDefined = "", e.Button = "button", e))(xe || {}), Ae = ((e) => (e.Create = "create", e.Update = "update", e.Read = "read", e))(Ae || {}), Se = ((e) => (e.Inline = "inline", e.Modal = "modal", e))(Se || {}), we = ((e) => (e.Top = "top", e.Bottom = "bottom", e))(we || {}), Ve = ((e) => (e.Changed = "changed", e.Always = "always", e.Never = "never", e))(Ve || {}), _e = ((e) => (e.Manual = "manual", e.Auto = "auto", e.Delay = "delay", e))(_e || {}), De = ((e) => (e.Toast = "toast", e.Inline = "inline", e))(De || {}), R, F = (R = class extends Q {
|
|
26
|
+
constructor(t = {}) {
|
|
27
|
+
super();
|
|
28
|
+
n(this, "key", "");
|
|
29
|
+
n(this, "href", "");
|
|
30
|
+
n(this, "label", "");
|
|
31
|
+
n(this, "icon", "");
|
|
32
|
+
n(this, "isActiveChecker");
|
|
33
|
+
n(this, "isOpened", !1);
|
|
34
|
+
n(this, "isActive", !1);
|
|
35
|
+
n(this, "parent");
|
|
36
|
+
n(this, "children");
|
|
37
|
+
n(this, "events", {});
|
|
38
|
+
n(this, "onClick");
|
|
39
|
+
this.feed(t);
|
|
40
|
+
}
|
|
41
|
+
setChildren(t) {
|
|
42
|
+
return t.forEach((l) => l.parent = this), this.children = t, this;
|
|
16
43
|
}
|
|
17
|
-
|
|
18
|
-
return this.
|
|
44
|
+
setOnClick(t) {
|
|
45
|
+
return this.onClick = t, this;
|
|
19
46
|
}
|
|
20
|
-
|
|
21
|
-
return this.
|
|
47
|
+
setIsActiveChecker(t) {
|
|
48
|
+
return this.isActiveChecker = t, this;
|
|
22
49
|
}
|
|
23
|
-
|
|
24
|
-
return this.
|
|
50
|
+
setIsActive(t = !0) {
|
|
51
|
+
return this.isActive = t, this;
|
|
25
52
|
}
|
|
26
|
-
|
|
27
|
-
return this.
|
|
53
|
+
setLabel(t) {
|
|
54
|
+
return this.label = t, this;
|
|
55
|
+
}
|
|
56
|
+
setIcon(t) {
|
|
57
|
+
return this.icon = t, this;
|
|
28
58
|
}
|
|
29
59
|
doClose() {
|
|
30
60
|
this.isOpened = !1;
|
|
31
61
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
62
|
+
}, n(R, "lktDefaultValues", ["key", "href", "label", "icon", "isActiveChecker", "isOpened", "isActive", "parent", "children", "events", "onClick"]), R), T, Me = (T = class extends Q {
|
|
63
|
+
constructor(t = {}) {
|
|
64
|
+
var l;
|
|
65
|
+
super();
|
|
66
|
+
n(this, "modelValue", []);
|
|
67
|
+
n(this, "resource", "");
|
|
68
|
+
n(this, "resourceData", {});
|
|
69
|
+
this.feed(t), this.modelValue = ((l = this.modelValue) == null ? void 0 : l.map((s) => new F(s))) || [];
|
|
70
|
+
}
|
|
71
|
+
}, n(T, "lktDefaultValues", ["modelValue", "resource", "resourceData"]), T), Ee = ((e) => (e.Pages = "pages", e.PrevNext = "prev-next", e.PagesPrevNext = "pages-prev-next", e.PagesPrevNextFirstLast = "pages-prev-next-first-last", e.LoadMore = "load-more", e.Infinite = "infinite", e))(Ee || {}), Ie = ((e) => (e.None = "", e.Incremental = "incremental", e.Decremental = "decremental", e))(Ie || {}), Oe = ((e) => (e.NotDefined = "", e.Hidden = "hidden", e.Integer = "integer", e.Decimal = "decimal", e.Auto = "auto", e))(Oe || {}), Le = ((e) => (e.Table = "table", e.Item = "item", e.Ul = "ul", e.Ol = "ol", e))(Le || {}), Ne = ((e) => (e[e.Auto = 0] = "Auto", e[e.PreferItem = 1] = "PreferItem", e[e.PreferCustomItem = 2] = "PreferCustomItem", e[e.PreferColumns = 3] = "PreferColumns", e))(Ne || {}), Pe = ((e) => (e.NotDefined = "", e.ActionIcon = "action-icon", e))(Pe || {}), Re = ((e) => (e.Message = "message", e.Button = "button", e))(Re || {}), Te = ((e) => (e.Left = "left", e.Center = "center", e.Right = "right", e))(Te || {}), Be = ((e) => (e.Fixed = "fixed", e.Absolute = "absolute", e))(Be || {}), Ue = ((e) => (e.Top = "top", e.Bottom = "bottom", e.Center = "center", e.ReferrerCenter = "referrer-center", e))(Ue || {}), ze = ((e) => (e.Left = "left", e.Right = "right", e.Center = "center", e.LeftCorner = "left-corner", e.RightCorner = "right-corner", e))(ze || {}), je = ((e) => (e.Refresh = "refresh", e.Close = "close", e.ReOpen = "reOpen", e.Exec = "exec", e.Open = "open", e))(je || {}), Fe = ((e) => (e.Modal = "modal", e.Confirm = "confirm", e))(Fe || {}), $e = ((e) => (e.Asc = "asc", e.Desc = "desc", e))($e || {}), He = ((e) => (e.Create = "create", e.Update = "update", e.Edit = "edit", e.Drop = "drop", e.Sort = "sort", e.SwitchEditMode = "switch-edit-mode", e.InlineEdit = "inline-edit", e.InlineCreate = "inline-create", e.ModalCreate = "modal-create", e.InlineCreateEver = "inline-create-ever", e))(He || {}), Ke = ((e) => (e.Lazy = "lazy", e.Ever = "ever", e))(Ke || {}), Je = (e) => {
|
|
72
|
+
let t = String(e);
|
|
73
|
+
return t.startsWith("__:") ? se(t.substring(3)) : t;
|
|
36
74
|
};
|
|
37
|
-
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
let
|
|
41
|
-
return
|
|
75
|
+
function We(e) {
|
|
76
|
+
let t = new e(), l = {};
|
|
77
|
+
if (!Array.isArray(e.lktDefaultValues)) throw new Error("lktDefaultValues must be a keys array.");
|
|
78
|
+
for (let s of e.lktDefaultValues) s in t && (l[s] = t[s]);
|
|
79
|
+
return l;
|
|
80
|
+
}
|
|
81
|
+
const $ = (e, t) => (t.forEach((l) => {
|
|
82
|
+
e.includes(l.key) || e.push(l.key), l.children.length > 0 && $(e, l.children);
|
|
83
|
+
}), e), O = class O {
|
|
42
84
|
};
|
|
43
|
-
|
|
85
|
+
O.toggleSlot = "", O.debugEnabled = !1;
|
|
86
|
+
let C = O;
|
|
87
|
+
const qe = { class: "lkt-menu-entry-main" }, Ge = { class: "lkt-entry-content" }, Qe = {
|
|
44
88
|
key: 0,
|
|
45
89
|
class: "lkt-menu-entry-icon"
|
|
46
|
-
},
|
|
90
|
+
}, Xe = {
|
|
47
91
|
key: 1,
|
|
48
92
|
class: "lkt-menu-entry-text"
|
|
49
|
-
},
|
|
93
|
+
}, Ye = {
|
|
50
94
|
key: 0,
|
|
51
95
|
class: "lkt-menu-entry-children"
|
|
52
|
-
},
|
|
96
|
+
}, Ze = /* @__PURE__ */ J({
|
|
53
97
|
__name: "MenuItem",
|
|
54
98
|
props: {
|
|
55
|
-
modelValue: { default: () => new
|
|
99
|
+
modelValue: { default: () => new F() }
|
|
56
100
|
},
|
|
57
|
-
emits: [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
a
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
101
|
+
emits: [
|
|
102
|
+
"update:modelValue"
|
|
103
|
+
],
|
|
104
|
+
setup(e, { emit: t }) {
|
|
105
|
+
const l = t, s = e, r = B(s.modelValue), v = W(), y = ie(), f = B(!1), b = () => {
|
|
106
|
+
r.value.isOpened = !r.value.isOpened;
|
|
107
|
+
}, L = () => {
|
|
108
|
+
var a, c;
|
|
109
|
+
return ((a = r.value.children) == null ? void 0 : a.length) > 0 && b(), typeof ((c = r.value.events) == null ? void 0 : c.click) == "function" ? (r.value.events.click({
|
|
110
|
+
entry: r.value
|
|
111
|
+
}), 1) : (typeof r.value.onClick == "function" && r.value.onClick({
|
|
112
|
+
entry: r.value
|
|
113
|
+
}), 1);
|
|
114
|
+
}, x = m(() => v["icon-" + r.value.key] || r.value.icon !== ""), N = m(() => {
|
|
115
|
+
let a = [];
|
|
116
|
+
return x.value && a.push("has-icon"), f.value && a.push("is-active"), a.join(" ");
|
|
117
|
+
}), i = m(() => $([], r.value.children)), o = m(() => {
|
|
118
|
+
let a = [];
|
|
119
|
+
for (let c in v)
|
|
120
|
+
c.startsWith("icon-") && i.value.includes(c.substring(5)) && a.push(c);
|
|
121
|
+
return a;
|
|
122
|
+
}), p = m(() => Je(r.value.label)), A = m(() => r.value.isActive ? !0 : typeof r.value.isActiveChecker == "function" ? !!r.value.isActiveChecker({
|
|
123
|
+
entry: r.value
|
|
124
|
+
}) : !1), k = m(() => !!C.toggleSlot), X = m(() => C.toggleSlot);
|
|
125
|
+
return M(() => s.modelValue, (a) => {
|
|
126
|
+
r.value = a;
|
|
127
|
+
}, { deep: !0 }), M(r, (a) => {
|
|
128
|
+
l("update:modelValue", a);
|
|
129
|
+
}, { deep: !0 }), ee(() => {
|
|
130
|
+
var c, S;
|
|
131
|
+
let a = y == null ? void 0 : y.currentRoute;
|
|
132
|
+
if (a) {
|
|
133
|
+
if (a.value.path === r.value.href)
|
|
134
|
+
r.value.isOpened = !0;
|
|
135
|
+
else if (((c = r.value.children) == null ? void 0 : c.length) > 0) {
|
|
136
|
+
let w = !1;
|
|
137
|
+
(S = r.value.children) == null || S.forEach((V) => {
|
|
138
|
+
a.value.path === V.href && (w = !0);
|
|
139
|
+
}), w && (r.value.isOpened = !0);
|
|
88
140
|
}
|
|
89
141
|
}
|
|
90
|
-
}), (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
142
|
+
}), (a, c) => {
|
|
143
|
+
var V;
|
|
144
|
+
const S = K("lkt-anchor"), w = K("menu-item", !0);
|
|
145
|
+
return u(), h("div", {
|
|
146
|
+
class: D(["lkt-menu-entry", N.value])
|
|
94
147
|
}, [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
to:
|
|
98
|
-
"on-click":
|
|
99
|
-
"is-active":
|
|
100
|
-
onActive:
|
|
148
|
+
E("div", qe, [
|
|
149
|
+
te(S, {
|
|
150
|
+
to: r.value.href,
|
|
151
|
+
"on-click": L,
|
|
152
|
+
"is-active": A.value,
|
|
153
|
+
onActive: c[0] || (c[0] = (H) => f.value = H)
|
|
101
154
|
}, {
|
|
102
|
-
default:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
key:
|
|
107
|
-
entry:
|
|
108
|
-
}) :
|
|
155
|
+
default: U(() => [
|
|
156
|
+
E("div", Ge, [
|
|
157
|
+
x.value ? (u(), h("div", Qe, [
|
|
158
|
+
re(v)["icon-" + r.value.key] ? z(a.$slots, "icon-" + r.value.key, {
|
|
159
|
+
key: r.value.key,
|
|
160
|
+
entry: r.value
|
|
161
|
+
}) : r.value.icon !== "" ? (u(), h("i", {
|
|
109
162
|
key: 1,
|
|
110
|
-
class:
|
|
111
|
-
}, null, 2)) :
|
|
112
|
-
])) :
|
|
113
|
-
|
|
163
|
+
class: D(r.value.icon)
|
|
164
|
+
}, null, 2)) : g("", !0)
|
|
165
|
+
])) : g("", !0),
|
|
166
|
+
r.value.label !== "" ? (u(), h("div", Xe, le(p.value), 1)) : g("", !0)
|
|
114
167
|
])
|
|
115
168
|
]),
|
|
116
169
|
_: 3
|
|
117
170
|
}, 8, ["to", "is-active"]),
|
|
118
|
-
|
|
171
|
+
((V = r.value.children) == null ? void 0 : V.length) > 0 ? (u(), h("div", {
|
|
119
172
|
key: 0,
|
|
120
173
|
class: "lkt-menu-entry-toggle",
|
|
121
|
-
onClick:
|
|
174
|
+
onClick: b
|
|
122
175
|
}, [
|
|
123
|
-
|
|
176
|
+
k.value ? (u(), j(ae(X.value), {
|
|
124
177
|
key: 0,
|
|
125
|
-
class:
|
|
126
|
-
}, null, 8, ["class"])) : (
|
|
178
|
+
class: D(["lkt-menu-entry-toggle-inner", r.value.isOpened ? "is-opened" : ""])
|
|
179
|
+
}, null, 8, ["class"])) : (u(), h("div", {
|
|
127
180
|
key: 1,
|
|
128
|
-
class:
|
|
181
|
+
class: D(["lkt-menu-entry-toggle-inner lkt-menu-entry-toggle-triangle", r.value.isOpened ? "is-opened" : ""])
|
|
129
182
|
}, null, 2))
|
|
130
|
-
])) :
|
|
183
|
+
])) : g("", !0)
|
|
131
184
|
]),
|
|
132
|
-
|
|
133
|
-
(
|
|
134
|
-
modelValue:
|
|
135
|
-
"onUpdate:modelValue": (_) =>
|
|
136
|
-
key:
|
|
137
|
-
},
|
|
138
|
-
|
|
185
|
+
r.value.isOpened ? (u(), h("div", Ye, [
|
|
186
|
+
(u(!0), h(q, null, I(r.value.children, (H, P) => (u(), j(w, {
|
|
187
|
+
modelValue: r.value.children[P],
|
|
188
|
+
"onUpdate:modelValue": (_) => r.value.children[P] = _,
|
|
189
|
+
key: r.value.children[P].key
|
|
190
|
+
}, G({ _: 2 }, [
|
|
191
|
+
I(o.value, (_) => ({
|
|
139
192
|
name: _,
|
|
140
|
-
fn:
|
|
141
|
-
|
|
193
|
+
fn: U(() => [
|
|
194
|
+
z(a.$slots, _)
|
|
142
195
|
])
|
|
143
196
|
}))
|
|
144
197
|
]), 1032, ["modelValue", "onUpdate:modelValue"]))), 128))
|
|
145
|
-
])) :
|
|
198
|
+
])) : g("", !0)
|
|
146
199
|
], 2);
|
|
147
200
|
};
|
|
148
201
|
}
|
|
149
|
-
}),
|
|
202
|
+
}), et = { class: "lkt-menu-container" }, tt = { class: "lkt-menu" }, rt = /* @__PURE__ */ J({
|
|
150
203
|
__name: "LktMenu",
|
|
151
|
-
props: {
|
|
152
|
-
modelValue: {
|
|
153
|
-
resource: {
|
|
154
|
-
resourceData: {
|
|
155
|
-
},
|
|
156
|
-
emits: [
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
let
|
|
169
|
-
|
|
170
|
-
n.startsWith("icon-") && g.value.includes(n.substring(5)) && o.push(n);
|
|
204
|
+
props: /* @__PURE__ */ ne({
|
|
205
|
+
modelValue: {},
|
|
206
|
+
resource: {},
|
|
207
|
+
resourceData: {}
|
|
208
|
+
}, We(Me)),
|
|
209
|
+
emits: [
|
|
210
|
+
"update:modelValue",
|
|
211
|
+
"click-outside",
|
|
212
|
+
"loading",
|
|
213
|
+
"results",
|
|
214
|
+
"response",
|
|
215
|
+
"error"
|
|
216
|
+
],
|
|
217
|
+
setup(e, { emit: t }) {
|
|
218
|
+
const l = e, s = t, r = W(), v = B(l.modelValue), y = (i) => {
|
|
219
|
+
let o = {};
|
|
220
|
+
typeof i == "object" && Object.keys(i).length > 0 && (o = JSON.parse(JSON.stringify(i)));
|
|
221
|
+
for (let p in o)
|
|
222
|
+
(Array.isArray(o[p]) || typeof o[p] == "object") && (o[p] = JSON.stringify(o[p]));
|
|
171
223
|
return o;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
224
|
+
};
|
|
225
|
+
let f = new ue({});
|
|
226
|
+
f.increment(y(l.resourceData));
|
|
227
|
+
const b = m(() => $([], v.value)), L = m(() => {
|
|
228
|
+
let i = [];
|
|
229
|
+
for (let o in r)
|
|
230
|
+
o.startsWith("icon-") && b.value.includes(o.substring(5)) && i.push(o);
|
|
231
|
+
return i;
|
|
232
|
+
}), x = () => {
|
|
233
|
+
if (!l.resource) return;
|
|
234
|
+
let i = f.getData();
|
|
235
|
+
s("loading"), ce(l.resource, i).then((o) => {
|
|
236
|
+
f.turnStoredIntoOriginal(), v.value = o.data, s("results", o.data), s("response", o);
|
|
237
|
+
}).catch((o) => {
|
|
238
|
+
s("error", o);
|
|
179
239
|
});
|
|
180
|
-
},
|
|
240
|
+
}, N = () => {
|
|
181
241
|
s("click-outside");
|
|
182
242
|
};
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
}, { deep: !0 }),
|
|
186
|
-
s("update:modelValue",
|
|
187
|
-
}, { deep: !0 }),
|
|
188
|
-
|
|
189
|
-
(
|
|
190
|
-
modelValue:
|
|
191
|
-
"onUpdate:modelValue": (
|
|
192
|
-
key:
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
name:
|
|
196
|
-
fn:
|
|
197
|
-
|
|
243
|
+
return M(() => l.modelValue, (i) => {
|
|
244
|
+
v.value = i;
|
|
245
|
+
}, { deep: !0 }), M(v, (i) => {
|
|
246
|
+
s("update:modelValue", i);
|
|
247
|
+
}, { deep: !0 }), x(), (i, o) => (u(), h("div", et, [
|
|
248
|
+
E("div", tt, [
|
|
249
|
+
(u(!0), h(q, null, I(v.value, (p, A) => (u(), j(Ze, {
|
|
250
|
+
modelValue: v.value[A],
|
|
251
|
+
"onUpdate:modelValue": (k) => v.value[A] = k,
|
|
252
|
+
key: p.key
|
|
253
|
+
}, G({ _: 2 }, [
|
|
254
|
+
I(L.value, (k) => ({
|
|
255
|
+
name: k,
|
|
256
|
+
fn: U(() => [
|
|
257
|
+
z(i.$slots, k)
|
|
198
258
|
])
|
|
199
259
|
}))
|
|
200
260
|
]), 1032, ["modelValue", "onUpdate:modelValue"]))), 128))
|
|
201
261
|
]),
|
|
202
|
-
|
|
262
|
+
E("div", {
|
|
203
263
|
class: "lkt-menu-outside",
|
|
204
|
-
onClick:
|
|
264
|
+
onClick: N
|
|
205
265
|
})
|
|
206
266
|
]));
|
|
207
267
|
}
|
|
208
|
-
}),
|
|
268
|
+
}), ct = {
|
|
209
269
|
install: (e) => {
|
|
210
|
-
e.component("lkt-menu") === void 0 && e.component("lkt-menu",
|
|
270
|
+
e.component("lkt-menu") === void 0 && e.component("lkt-menu", rt);
|
|
211
271
|
}
|
|
212
|
-
},
|
|
272
|
+
}, dt = (e, t, l) => oe(new F({
|
|
273
|
+
key: e,
|
|
274
|
+
href: t,
|
|
275
|
+
label: l
|
|
276
|
+
})), vt = (e) => (C.toggleSlot = e, !0);
|
|
213
277
|
export {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
278
|
+
F as MenuEntry,
|
|
279
|
+
dt as createMenuEntry,
|
|
280
|
+
ct as default,
|
|
281
|
+
vt as setMenuToggleSlot
|
|
218
282
|
};
|
|
@@ -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,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
type __VLS_Props = {
|
|
5
|
-
modelValue?: MenuEntry[];
|
|
6
|
-
resource?: string;
|
|
7
|
-
resourceData: LktObject;
|
|
8
|
-
};
|
|
1
|
+
import MenuItem from '../components/MenuItem.vue';
|
|
2
|
+
import { LktObject } from 'lkt-ts-interfaces';
|
|
3
|
+
import { MenuConfig } from 'lkt-vue-kernel';
|
|
9
4
|
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;
|
|
5
|
+
key?: string | undefined;
|
|
6
|
+
href?: string | undefined;
|
|
7
|
+
label?: string | undefined;
|
|
8
|
+
icon?: string | undefined;
|
|
9
|
+
isActiveChecker?: Function | undefined;
|
|
10
|
+
isOpened?: boolean | undefined;
|
|
11
|
+
isActive?: boolean | undefined;
|
|
12
|
+
parent?: /*elided*/ any | undefined;
|
|
13
|
+
children?: /*elided*/ any[] | undefined;
|
|
14
|
+
events?: {
|
|
15
|
+
click?: Function | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
onClick?: Function | undefined;
|
|
18
|
+
}[], import("lkt-vue-kernel").MenuEntryConfig[] | {
|
|
19
|
+
key?: string | undefined;
|
|
20
|
+
href?: string | undefined;
|
|
21
|
+
label?: string | undefined;
|
|
22
|
+
icon?: string | undefined;
|
|
23
|
+
isActiveChecker?: Function | undefined;
|
|
24
|
+
isOpened?: boolean | undefined;
|
|
25
|
+
isActive?: boolean | undefined;
|
|
26
|
+
parent?: /*elided*/ any | undefined;
|
|
27
|
+
children?: /*elided*/ any[] | undefined;
|
|
28
|
+
events?: {
|
|
29
|
+
click?: Function | undefined;
|
|
30
|
+
} | undefined;
|
|
31
|
+
onClick?: Function | undefined;
|
|
45
32
|
}[]>;
|
|
46
33
|
declare const entryIconSlots: import("vue").ComputedRef<LktObject>;
|
|
47
34
|
declare const onClickOutside: () => void;
|
|
48
35
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
49
|
-
declare var
|
|
36
|
+
declare var __VLS_8: any, __VLS_9: {};
|
|
50
37
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
51
|
-
[K in NonNullable<typeof
|
|
38
|
+
[K in NonNullable<typeof __VLS_8>]?: (props: typeof __VLS_9) => any;
|
|
52
39
|
}>;
|
|
53
|
-
declare const __VLS_self: import("vue").DefineComponent<
|
|
40
|
+
declare const __VLS_self: import("vue").DefineComponent<MenuConfig, {
|
|
54
41
|
MenuItem: typeof MenuItem;
|
|
55
42
|
entries: typeof entries;
|
|
56
43
|
entryIconSlots: typeof entryIconSlots;
|
|
@@ -62,7 +49,7 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
|
|
62
49
|
"update:modelValue": (...args: any[]) => void;
|
|
63
50
|
"click-outside": (...args: any[]) => void;
|
|
64
51
|
response: (...args: any[]) => void;
|
|
65
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
52
|
+
}, string, import("vue").PublicProps, Readonly<MenuConfig> & Readonly<{
|
|
66
53
|
onError?: ((...args: any[]) => any) | undefined;
|
|
67
54
|
onLoading?: ((...args: any[]) => any) | undefined;
|
|
68
55
|
onResults?: ((...args: any[]) => any) | undefined;
|
|
@@ -71,17 +58,17 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
|
|
71
58
|
onResponse?: ((...args: any[]) => any) | undefined;
|
|
72
59
|
}>, {
|
|
73
60
|
resource: string;
|
|
74
|
-
resourceData: LktObject;
|
|
75
|
-
modelValue:
|
|
61
|
+
resourceData: import("lkt-vue-kernel").LktObject;
|
|
62
|
+
modelValue: import("lkt-vue-kernel").MenuEntryConfig[];
|
|
76
63
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
77
|
-
declare const __VLS_component: import("vue").DefineComponent<
|
|
64
|
+
declare const __VLS_component: import("vue").DefineComponent<MenuConfig, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
78
65
|
error: (...args: any[]) => void;
|
|
79
66
|
loading: (...args: any[]) => void;
|
|
80
67
|
results: (...args: any[]) => void;
|
|
81
68
|
"update:modelValue": (...args: any[]) => void;
|
|
82
69
|
"click-outside": (...args: any[]) => void;
|
|
83
70
|
response: (...args: any[]) => void;
|
|
84
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
71
|
+
}, string, import("vue").PublicProps, Readonly<MenuConfig> & Readonly<{
|
|
85
72
|
onError?: ((...args: any[]) => any) | undefined;
|
|
86
73
|
onLoading?: ((...args: any[]) => any) | undefined;
|
|
87
74
|
onResults?: ((...args: any[]) => any) | undefined;
|
|
@@ -90,8 +77,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
90
77
|
onResponse?: ((...args: any[]) => any) | undefined;
|
|
91
78
|
}>, {
|
|
92
79
|
resource: string;
|
|
93
|
-
resourceData: LktObject;
|
|
94
|
-
modelValue:
|
|
80
|
+
resourceData: import("lkt-vue-kernel").LktObject;
|
|
81
|
+
modelValue: import("lkt-vue-kernel").MenuEntryConfig[];
|
|
95
82
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
96
83
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
97
84
|
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.0",
|
|
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": "^1.0.
|
|
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.32",
|
|
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,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import MenuItem from '../components/MenuItem.vue';
|
|
3
|
+
import { computed, ref, useSlots, watch } from 'vue';
|
|
4
|
+
import { LktObject } from 'lkt-ts-interfaces';
|
|
5
|
+
import { fetchKeys } from '../functions/helpers';
|
|
6
|
+
import { DataState } from 'lkt-data-state';
|
|
7
|
+
import { httpCall, HTTPResponse } from 'lkt-http-client';
|
|
8
|
+
import { getDefaultValues, Menu, MenuConfig } from 'lkt-vue-kernel';
|
|
9
9
|
|
|
10
|
-
const props = withDefaults(defineProps<
|
|
11
|
-
modelValue?: MenuEntry[]
|
|
12
|
-
resource?: string
|
|
13
|
-
resourceData: LktObject
|
|
14
|
-
}>(), {
|
|
15
|
-
modelValue: () => [],
|
|
16
|
-
resource: '',
|
|
17
|
-
resourceData: () => ({}),
|
|
18
|
-
});
|
|
10
|
+
const props = withDefaults(defineProps<MenuConfig>(), getDefaultValues(Menu));
|
|
19
11
|
|
|
20
|
-
const emit = defineEmits([
|
|
12
|
+
const emit = defineEmits([
|
|
13
|
+
'update:modelValue',
|
|
14
|
+
'click-outside',
|
|
15
|
+
'loading',
|
|
16
|
+
'results',
|
|
17
|
+
'response',
|
|
18
|
+
'error'
|
|
19
|
+
]);
|
|
21
20
|
|
|
22
21
|
const slots = useSlots();
|
|
23
22
|
|