lkt-menu 1.4.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 -159
- package/dist/build.js +145 -219
- package/dist/lib-components/LktMenu.vue.d.ts +3 -4
- package/package.json +2 -2
- package/src/lib-components/LktMenu.vue +1 -2
package/dist/build.d.ts
CHANGED
|
@@ -1,162 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
icon
|
|
15
|
-
|
|
16
|
-
isOpened
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
};
|
|
59
|
-
onClick: any;
|
|
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
|
-
};
|
|
78
|
-
isActiveChecker: any;
|
|
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
|
-
};
|
|
116
|
-
label: any;
|
|
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;
|
|
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;
|
|
136
50
|
doClose: () => void;
|
|
137
|
-
|
|
138
|
-
|
|
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;
|
|
51
|
+
feed: (data?: import("lkt-vue-kernel").LktObject, target?: z | undefined) => void;
|
|
52
|
+
assignProp: (key: string, value: any) => void;
|
|
157
53
|
};
|
|
158
|
-
declare namespace
|
|
159
|
-
function install(
|
|
54
|
+
declare namespace _e {
|
|
55
|
+
function install(u: any): void;
|
|
160
56
|
}
|
|
161
|
-
declare function
|
|
162
|
-
|
|
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,211 +1,137 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import "lkt-string-tools";
|
|
6
|
-
import { __ as se } from "lkt-i18n";
|
|
7
|
-
import { useRouter as ie } from "vue-router";
|
|
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";
|
|
8
5
|
import { DataState as ue } from "lkt-data-state";
|
|
9
|
-
import { httpCall as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
feed(t = {}, l = this) {
|
|
14
|
-
if (typeof t == "object") for (let [s, r] of Object.entries(t)) l.assignProp(s, r);
|
|
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;
|
|
43
|
-
}
|
|
44
|
-
setOnClick(t) {
|
|
45
|
-
return this.onClick = t, this;
|
|
46
|
-
}
|
|
47
|
-
setIsActiveChecker(t) {
|
|
48
|
-
return this.isActiveChecker = t, this;
|
|
49
|
-
}
|
|
50
|
-
setIsActive(t = !0) {
|
|
51
|
-
return this.isActive = t, this;
|
|
52
|
-
}
|
|
53
|
-
setLabel(t) {
|
|
54
|
-
return this.label = t, this;
|
|
55
|
-
}
|
|
56
|
-
setIcon(t) {
|
|
57
|
-
return this.icon = t, this;
|
|
58
|
-
}
|
|
59
|
-
doClose() {
|
|
60
|
-
this.isOpened = !1;
|
|
61
|
-
}
|
|
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;
|
|
74
|
-
};
|
|
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 {
|
|
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 {
|
|
84
10
|
};
|
|
85
|
-
|
|
86
|
-
let
|
|
87
|
-
const
|
|
11
|
+
I.toggleSlot = "", I.debugEnabled = !1;
|
|
12
|
+
let y = I;
|
|
13
|
+
const re = { class: "lkt-menu-entry-main" }, ae = { class: "lkt-entry-content" }, se = {
|
|
88
14
|
key: 0,
|
|
89
15
|
class: "lkt-menu-entry-icon"
|
|
90
|
-
},
|
|
16
|
+
}, ie = {
|
|
91
17
|
key: 1,
|
|
92
18
|
class: "lkt-menu-entry-text"
|
|
93
|
-
},
|
|
19
|
+
}, ce = {
|
|
94
20
|
key: 0,
|
|
95
21
|
class: "lkt-menu-entry-children"
|
|
96
|
-
},
|
|
22
|
+
}, de = /* @__PURE__ */ K({
|
|
97
23
|
__name: "MenuItem",
|
|
98
24
|
props: {
|
|
99
|
-
modelValue: { default: () => new
|
|
25
|
+
modelValue: { default: () => new z() }
|
|
100
26
|
},
|
|
101
27
|
emits: [
|
|
102
28
|
"update:modelValue"
|
|
103
29
|
],
|
|
104
|
-
setup(
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
var
|
|
109
|
-
return ((
|
|
110
|
-
entry:
|
|
111
|
-
}), 1) : (typeof
|
|
112
|
-
entry:
|
|
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
|
|
113
39
|
}), 1);
|
|
114
|
-
},
|
|
115
|
-
let
|
|
116
|
-
return
|
|
117
|
-
}),
|
|
118
|
-
let
|
|
119
|
-
for (let
|
|
120
|
-
|
|
121
|
-
return
|
|
122
|
-
}),
|
|
123
|
-
entry:
|
|
124
|
-
}) : !1),
|
|
125
|
-
return M(() =>
|
|
126
|
-
|
|
127
|
-
}, { deep: !0 }), M(
|
|
128
|
-
|
|
129
|
-
}, { deep: !0 }),
|
|
130
|
-
var
|
|
131
|
-
let
|
|
132
|
-
if (
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
else if (((
|
|
136
|
-
let
|
|
137
|
-
(
|
|
138
|
-
|
|
139
|
-
}),
|
|
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);
|
|
140
66
|
}
|
|
141
67
|
}
|
|
142
|
-
}), (
|
|
143
|
-
var
|
|
144
|
-
const
|
|
145
|
-
return
|
|
146
|
-
class: D(["lkt-menu-entry",
|
|
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])
|
|
147
73
|
}, [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
to:
|
|
151
|
-
"on-click":
|
|
152
|
-
"is-active":
|
|
153
|
-
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)
|
|
154
80
|
}, {
|
|
155
|
-
default:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
key:
|
|
160
|
-
entry:
|
|
161
|
-
}) :
|
|
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", {
|
|
162
88
|
key: 1,
|
|
163
|
-
class: D(
|
|
164
|
-
}, null, 2)) :
|
|
165
|
-
])) :
|
|
166
|
-
|
|
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)
|
|
167
93
|
])
|
|
168
94
|
]),
|
|
169
95
|
_: 3
|
|
170
96
|
}, 8, ["to", "is-active"]),
|
|
171
|
-
((
|
|
97
|
+
((O = e.value.children) == null ? void 0 : O.length) > 0 ? (r(), c("div", {
|
|
172
98
|
key: 0,
|
|
173
99
|
class: "lkt-menu-entry-toggle",
|
|
174
|
-
onClick:
|
|
100
|
+
onClick: g
|
|
175
101
|
}, [
|
|
176
|
-
|
|
102
|
+
f.value ? (r(), L(X(q.value), {
|
|
177
103
|
key: 0,
|
|
178
|
-
class: D(["lkt-menu-entry-toggle-inner",
|
|
179
|
-
}, null, 8, ["class"])) : (
|
|
104
|
+
class: D(["lkt-menu-entry-toggle-inner", e.value.isOpened ? "is-opened" : ""])
|
|
105
|
+
}, null, 8, ["class"])) : (r(), c("div", {
|
|
180
106
|
key: 1,
|
|
181
|
-
class: D(["lkt-menu-entry-toggle-inner lkt-menu-entry-toggle-triangle",
|
|
107
|
+
class: D(["lkt-menu-entry-toggle-inner lkt-menu-entry-toggle-triangle", e.value.isOpened ? "is-opened" : ""])
|
|
182
108
|
}, null, 2))
|
|
183
|
-
])) :
|
|
109
|
+
])) : h("", !0)
|
|
184
110
|
]),
|
|
185
|
-
|
|
186
|
-
(
|
|
187
|
-
modelValue:
|
|
188
|
-
"onUpdate:modelValue": (
|
|
189
|
-
key:
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
name:
|
|
193
|
-
fn:
|
|
194
|
-
|
|
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)
|
|
195
121
|
])
|
|
196
122
|
}))
|
|
197
123
|
]), 1032, ["modelValue", "onUpdate:modelValue"]))), 128))
|
|
198
|
-
])) :
|
|
124
|
+
])) : h("", !0)
|
|
199
125
|
], 2);
|
|
200
126
|
};
|
|
201
127
|
}
|
|
202
|
-
}),
|
|
128
|
+
}), ve = { class: "lkt-menu-container" }, me = { class: "lkt-menu" }, pe = /* @__PURE__ */ K({
|
|
203
129
|
__name: "LktMenu",
|
|
204
|
-
props: /* @__PURE__ */
|
|
130
|
+
props: /* @__PURE__ */ Y({
|
|
205
131
|
modelValue: {},
|
|
206
132
|
resource: {},
|
|
207
133
|
resourceData: {}
|
|
208
|
-
},
|
|
134
|
+
}, te(le)),
|
|
209
135
|
emits: [
|
|
210
136
|
"update:modelValue",
|
|
211
137
|
"click-outside",
|
|
@@ -214,69 +140,69 @@ const qe = { class: "lkt-menu-entry-main" }, Ge = { class: "lkt-entry-content" }
|
|
|
214
140
|
"response",
|
|
215
141
|
"error"
|
|
216
142
|
],
|
|
217
|
-
setup(
|
|
218
|
-
const
|
|
219
|
-
let
|
|
220
|
-
typeof
|
|
221
|
-
for (let
|
|
222
|
-
(Array.isArray(
|
|
223
|
-
return
|
|
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;
|
|
224
150
|
};
|
|
225
|
-
let
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
let
|
|
229
|
-
for (let
|
|
230
|
-
|
|
231
|
-
return
|
|
232
|
-
}),
|
|
233
|
-
if (!
|
|
234
|
-
let
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}).catch((
|
|
238
|
-
|
|
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);
|
|
239
165
|
});
|
|
240
|
-
},
|
|
241
|
-
|
|
166
|
+
}, $ = () => {
|
|
167
|
+
d("click-outside");
|
|
242
168
|
};
|
|
243
|
-
return M(() =>
|
|
244
|
-
|
|
245
|
-
}, { deep: !0 }), M(
|
|
246
|
-
|
|
247
|
-
}, { deep: !0 }),
|
|
248
|
-
|
|
249
|
-
(
|
|
250
|
-
modelValue:
|
|
251
|
-
"onUpdate:modelValue": (
|
|
252
|
-
key:
|
|
253
|
-
},
|
|
254
|
-
|
|
255
|
-
name:
|
|
256
|
-
fn:
|
|
257
|
-
|
|
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)
|
|
258
184
|
])
|
|
259
185
|
}))
|
|
260
186
|
]), 1032, ["modelValue", "onUpdate:modelValue"]))), 128))
|
|
261
187
|
]),
|
|
262
|
-
|
|
188
|
+
A("div", {
|
|
263
189
|
class: "lkt-menu-outside",
|
|
264
|
-
onClick:
|
|
190
|
+
onClick: $
|
|
265
191
|
})
|
|
266
192
|
]));
|
|
267
193
|
}
|
|
268
|
-
}),
|
|
269
|
-
install: (
|
|
270
|
-
|
|
194
|
+
}), _e = {
|
|
195
|
+
install: (u) => {
|
|
196
|
+
u.component("lkt-menu") === void 0 && u.component("lkt-menu", pe);
|
|
271
197
|
}
|
|
272
|
-
},
|
|
273
|
-
key:
|
|
274
|
-
href:
|
|
275
|
-
label:
|
|
276
|
-
})),
|
|
198
|
+
}, Ve = (u, m, o) => Z(new z({
|
|
199
|
+
key: u,
|
|
200
|
+
href: m,
|
|
201
|
+
label: o
|
|
202
|
+
})), Ce = (u) => (y.toggleSlot = u, !0);
|
|
277
203
|
export {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
204
|
+
be as MenuEntry,
|
|
205
|
+
Ve as createMenuEntry,
|
|
206
|
+
_e as default,
|
|
207
|
+
Ce as setMenuToggleSlot
|
|
282
208
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import MenuItem from '../components/MenuItem.vue';
|
|
2
|
-
import { LktObject } from 'lkt-
|
|
3
|
-
import { MenuConfig } from 'lkt-vue-kernel';
|
|
2
|
+
import { LktObject, MenuConfig } from 'lkt-vue-kernel';
|
|
4
3
|
declare const entries: import("vue").Ref<{
|
|
5
4
|
key?: string | undefined;
|
|
6
5
|
href?: string | undefined;
|
|
@@ -58,7 +57,7 @@ declare const __VLS_self: import("vue").DefineComponent<MenuConfig, {
|
|
|
58
57
|
onResponse?: ((...args: any[]) => any) | undefined;
|
|
59
58
|
}>, {
|
|
60
59
|
resource: string;
|
|
61
|
-
resourceData:
|
|
60
|
+
resourceData: LktObject;
|
|
62
61
|
modelValue: import("lkt-vue-kernel").MenuEntryConfig[];
|
|
63
62
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
64
63
|
declare const __VLS_component: import("vue").DefineComponent<MenuConfig, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -77,7 +76,7 @@ declare const __VLS_component: import("vue").DefineComponent<MenuConfig, {}, {},
|
|
|
77
76
|
onResponse?: ((...args: any[]) => any) | undefined;
|
|
78
77
|
}>, {
|
|
79
78
|
resource: string;
|
|
80
|
-
resourceData:
|
|
79
|
+
resourceData: LktObject;
|
|
81
80
|
modelValue: import("lkt-vue-kernel").MenuEntryConfig[];
|
|
82
81
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
83
82
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lkt-menu",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lkt",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"lkt-data-state": "^1.0.11",
|
|
55
55
|
"lkt-http-client": "^1.0.34",
|
|
56
56
|
"lkt-i18n": "^1.0.6",
|
|
57
|
-
"lkt-vue-kernel": "
|
|
57
|
+
"lkt-vue-kernel": "1.0.44",
|
|
58
58
|
"vue": "^3.3.0",
|
|
59
59
|
"vue-router": "^4.3.3"
|
|
60
60
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import MenuItem from '../components/MenuItem.vue';
|
|
3
3
|
import { computed, ref, useSlots, watch } from 'vue';
|
|
4
|
-
import { LktObject } from 'lkt-
|
|
4
|
+
import { getDefaultValues, LktObject, Menu, MenuConfig } from 'lkt-vue-kernel';
|
|
5
5
|
import { fetchKeys } from '../functions/helpers';
|
|
6
6
|
import { DataState } from 'lkt-data-state';
|
|
7
7
|
import { httpCall, HTTPResponse } from 'lkt-http-client';
|
|
8
|
-
import { getDefaultValues, Menu, MenuConfig } from 'lkt-vue-kernel';
|
|
9
8
|
|
|
10
9
|
const props = withDefaults(defineProps<MenuConfig>(), getDefaultValues(Menu));
|
|
11
10
|
|