lkt-menu 2.0.11 → 2.0.13

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.css CHANGED
@@ -1 +1 @@
1
- .lkt-menu{width:var(--lkt-menu--container--width);overflow:auto;max-height:var(--lkt-menu--container--max-height);display:flex;flex-direction:var(--lkt-menu--container--flex-direction);align-items:var(--lkt-menu--container--align-items)}.lkt-menu-main{background:var(--lkt-menu--background);padding:var(--lkt-menu--padding);max-width:var(--lkt-menu--max-width);width:var(--lkt-menu--width);height:100%;display:var(--lkt-menu--display);flex-direction:var(--lkt-menu--flex-direction);align-items:var(--lkt-menu--align-items);gap:var(--lkt-menu--entry--gap);position:relative}.lkt-menu-entry-toggle-inner{transition:all linear .2s}.lkt-menu-entry-toggle-inner.is-opened{transform:rotate(180deg)}.lkt-entry-content{display:inline-flex;flex-direction:row;gap:var(--lkt-menu--gap)}.lkt-menu-entry-toggle{display:inline-flex;flex-direction:row;align-items:center;justify-content:center}.lkt-menu-entries{align-items:var(--lkt-menu--entries--align-items);background:var(--lkt-menu--entries--background);display:flex;flex-direction:var(--lkt-menu--entries--flex-direction);width:var(--lkt-menu--entries--width)}.lkt-menu-entry{padding:var(--lkt-menu--entry--padding)}.lkt-menu-entry .lkt-anchor{width:100%}.lkt-menu-entry-main{display:flex;justify-content:space-between;position:relative}.lkt-entry-content{font-size:var(--lkt-menu--font-size);width:100%}.lkt-menu-outside{position:absolute;top:0;right:0;left:0;bottom:0;background:var(--lkt-menu--outside--background);z-index:-1}.lkt-menu-entry-children{padding:var(--lkt-menu--children--padding)}.lkt-menu-entry-text{padding:var(--lkt-menu--text-without-icon--padding)}.lkt-menu.has-icon .lkt-menu-entry-text{padding:var(--lkt-menu--text--padding)}.lkt-menu.has-icon .lkt-menu-entry-icon+.lkt-menu-entry-text{padding:var(--lkt-menu--text-with-icon--padding)}.lkt-menu.type-hidden{position:fixed;width:100%;background:var(--lkt-menu--container--background);transition:var(--lkt-menu--container--transition);z-index:400}.lkt-menu.type-hidden.left-hidden,.lkt-menu.type-hidden.right-hidden{top:var(--lkt-menu--container--top);bottom:var(--lkt-menu--container--bottom)}.lkt-menu.type-hidden.bottom-hidden,.lkt-menu.type-hidden.top-hidden{left:var(--lkt-menu--container--left);right:var(--lkt-menu--container--right)}.lkt-menu.type-hidden .lkt-menu-main{z-index:402}.lkt-menu.type-hidden .lkt-menu-outside{z-index:401}.lkt-menu.type-hidden .lkt-menu-outside{opacity:0;transition:all linear .4s .1s}.lkt-menu.type-hidden.is-visible .lkt-menu-outside{opacity:1}.lkt-menu.type-hidden.left-hidden{left:-100%}.lkt-menu.type-hidden.left-hidden.is-visible{left:0}.lkt-menu.type-hidden.right-hidden{justify-content:flex-end;right:-100%}.lkt-menu.type-hidden.right-hidden.is-visible{right:0}.lkt-menu.type-hidden.bottom-hidden{justify-content:flex-end;bottom:-100%}.lkt-menu.type-hidden.bottom-hidden.is-visible{bottom:0}.lkt-menu.type-hidden.top-hidden{top:-100%}.lkt-menu.type-hidden.top-hidden.is-visible{top:0}
1
+ .lkt-menu{width:var(--lkt-menu--container--width);overflow:auto;max-height:var(--lkt-menu--container--max-height);display:flex;flex-direction:var(--lkt-menu--container--flex-direction);align-items:var(--lkt-menu--container--align-items)}.lkt-menu-main{background:var(--lkt-menu--background);padding:var(--lkt-menu--padding);max-width:var(--lkt-menu--max-width);width:var(--lkt-menu--width);height:100%;display:var(--lkt-menu--display);flex-direction:var(--lkt-menu--flex-direction);align-items:var(--lkt-menu--align-items);gap:var(--lkt-menu--entry--gap);position:relative}.lkt-menu-entry-toggle-inner{transition:all linear .2s}.lkt-menu-entry-toggle-inner.is-opened{transform:rotate(180deg)}.lkt-entry-content{display:inline-flex;flex-direction:row;gap:var(--lkt-menu--gap)}.lkt-menu-entry-toggle{display:inline-flex;flex-direction:row;align-items:center;justify-content:center}.lkt-menu-entries{align-items:var(--lkt-menu--entries--align-items);background:var(--lkt-menu--entries--background);display:flex;flex-direction:var(--lkt-menu--entries--flex-direction);width:var(--lkt-menu--entries--width)}.lkt-menu-entry{padding:var(--lkt-menu--entry--padding)}.lkt-menu-entry .lkt-anchor{width:100%}.lkt-menu-entry-main{display:flex;justify-content:space-between;position:relative}.lkt-entry-content{font-size:var(--lkt-menu--font-size);width:100%}.lkt-menu-outside{position:absolute;top:0;right:0;left:0;bottom:0;background:var(--lkt-menu--outside--background);z-index:-1}.lkt-menu-entry-children{padding:var(--lkt-menu--children--padding)}.lkt-menu-entry-text{padding:var(--lkt-menu--text-without-icon--padding)}.lkt-menu.has-icon .lkt-menu-entry-text{padding:var(--lkt-menu--text--padding)}.lkt-menu.has-icon .lkt-menu-entry-icon+.lkt-menu-entry-text{padding:var(--lkt-menu--text-with-icon--padding)}.lkt-menu.type-hidden{position:fixed;width:100%;background:var(--lkt-menu--container--background);transition:var(--lkt-menu--container--transition);z-index:400}.lkt-menu.type-hidden.left-hidden,.lkt-menu.type-hidden.right-hidden{top:var(--lkt-menu--container--top);bottom:var(--lkt-menu--container--bottom)}.lkt-menu.type-hidden.bottom-hidden,.lkt-menu.type-hidden.top-hidden{left:var(--lkt-menu--container--left);right:var(--lkt-menu--container--right)}.lkt-menu.type-hidden .lkt-menu-main{z-index:402}.lkt-menu.type-hidden .lkt-menu-outside{z-index:401}.lkt-menu.type-hidden .lkt-menu-outside{opacity:var(--lkt-menu--outside--hidden--opacity);transition:all linear .4s .1s}.lkt-menu.type-hidden.is-visible .lkt-menu-outside{opacity:var(--lkt-menu--outside--visible--opacity)}.lkt-menu.type-hidden.left-hidden{left:-100%}.lkt-menu.type-hidden.left-hidden.is-visible{left:0}.lkt-menu.type-hidden.right-hidden{justify-content:flex-end;right:-100%}.lkt-menu.type-hidden.right-hidden.is-visible{right:0}.lkt-menu.type-hidden.bottom-hidden{justify-content:flex-end;bottom:-100%}.lkt-menu.type-hidden.bottom-hidden.is-visible{bottom:var(--lkt-menu--container--bottom);top:var(--lkt-menu--container--top)}.lkt-menu.type-hidden.bottom-hidden .lkt-menu-main{margin-top:auto;height:auto}.lkt-menu.type-hidden.top-hidden{top:-100%}.lkt-menu.type-hidden.top-hidden.is-visible{top:var(--lkt-menu--container--top)}
package/dist/build.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- declare namespace $e {
1
+ declare namespace Se {
2
2
  function install(s: any): void;
3
3
  }
4
- declare function Oe(s: any): boolean;
5
- export { $e as default, Oe as setMenuToggleSlot };
4
+ declare function Me(s: any): boolean;
5
+ export { Se as default, Me as setMenuToggleSlot };
package/dist/build.js CHANGED
@@ -1,158 +1,172 @@
1
- import { defineComponent as X, ref as T, useSlots as Y, computed as r, watch as S, onMounted as Z, resolveComponent as E, createElementBlock as d, openBlock as u, normalizeClass as g, createElementVNode as _, createCommentVNode as f, createBlock as y, unref as p, normalizeProps as H, mergeProps as I, createSlots as q, withCtx as h, renderSlot as k, toDisplayString as ee, resolveDynamicComponent as te, Fragment as x, renderList as j, mergeDefaults as le } from "vue";
2
- import { MenuEntryType as R, MenuController as W, MenuType as Q, getDefaultValues as ne, Menu as oe } from "lkt-vue-kernel";
3
- import { useRouter as ue } from "vue-router";
4
- import { DataState as se } from "lkt-data-state";
5
- import { httpCall as ie } from "lkt-http-client";
6
- const G = (s, V) => (V.forEach((o) => {
1
+ import { defineComponent as Z, ref as L, useSlots as x, computed as c, watch as K, onMounted as ee, resolveComponent as I, createElementBlock as p, openBlock as u, normalizeClass as O, createElementVNode as V, createCommentVNode as C, createBlock as f, unref as r, normalizeProps as W, mergeProps as R, createSlots as q, withCtx as g, renderSlot as k, toDisplayString as le, resolveDynamicComponent as ne, Fragment as te, renderList as P, mergeDefaults as oe } from "vue";
2
+ import { MenuEntryType as T, MenuController as j, MenuType as Y, getDefaultValues as ue, Menu as se } from "lkt-vue-kernel";
3
+ import { useRouter as ie } from "vue-router";
4
+ import { DataState as ae } from "lkt-data-state";
5
+ import { httpCall as re } from "lkt-http-client";
6
+ const G = (s, b) => (b.forEach((o) => {
7
7
  o.key && !s.includes(o.key) && s.push(o.key), o.children && o.children.length > 0 && G(s, o.children);
8
- }), s), L = class L {
8
+ }), s), U = class U {
9
9
  };
10
- L.toggleSlot = "", L.debugEnabled = !1;
11
- let M = L;
12
- const ae = ["id"], re = { class: "lkt-menu-entry-main" }, ce = { class: "lkt-entry-content" }, de = {
10
+ U.toggleSlot = "", U.debugEnabled = !1;
11
+ let E = U;
12
+ const ce = ["id"], de = { class: "lkt-menu-entry-main" }, ve = { class: "lkt-entry-content" }, pe = {
13
13
  key: 0,
14
14
  class: "lkt-menu-entry-icon"
15
- }, pe = {
15
+ }, me = {
16
16
  key: 1,
17
17
  class: "lkt-menu-entry-text"
18
- }, ve = {
18
+ }, ke = {
19
19
  key: 0,
20
20
  class: "lkt-menu-entry-children"
21
- }, me = /* @__PURE__ */ X({
21
+ }, ye = /* @__PURE__ */ Z({
22
22
  __name: "MenuItem",
23
23
  props: {
24
- modelValue: { default: () => ({}) }
24
+ modelValue: { default: () => ({}) },
25
+ menuKey: {},
26
+ closeOnClickEntry: { type: Boolean }
25
27
  },
26
28
  emits: [
27
29
  "update:modelValue"
28
30
  ],
29
- setup(s, { emit: V }) {
30
- const o = V, v = s, e = T(v.modelValue), c = Y(), a = ue(), A = T(!1), K = () => {
31
+ setup(s, { emit: b }) {
32
+ const o = b, d = s, e = L(d.modelValue), v = x(), a = ie(), A = L(!1), B = () => {
31
33
  e.value.isOpened = !e.value.isOpened;
32
- }, b = () => {
34
+ }, $ = () => {
33
35
  var t, l;
34
- return typeof e.value.children < "u" && ((t = e.value.children) == null ? void 0 : t.length) > 0 && !e.value.keepOpenOnChildClick && K(), typeof ((l = e.value.events) == null ? void 0 : l.click) == "function" && e.value.events.click({
36
+ return typeof e.value.children < "u" && ((t = e.value.children) == null ? void 0 : t.length) > 0 && !e.value.keepOpenOnChildClick && B(), typeof ((l = e.value.events) == null ? void 0 : l.click) == "function" && e.value.events.click({
35
37
  entry: e.value
36
38
  }), 1;
37
- }, D = r(() => c["icon-" + e.value.key] || e.value.icon !== ""), P = r(() => {
39
+ }, D = c(() => v["icon-" + e.value.key] || e.value.icon !== ""), w = c(() => {
38
40
  let t = [];
39
41
  return D.value && t.push("has-icon"), A.value && t.push("is-active"), e.value.type && t.push(`is-${e.value.type}`), t.join(" ");
40
- }), U = r(() => {
42
+ }), F = c(() => {
41
43
  var l;
42
44
  return G([], ((l = e.value) == null ? void 0 : l.children) ?? []);
43
- }), w = r(() => {
45
+ }), J = c(() => {
44
46
  let t = [];
45
- for (let l in c)
46
- l.startsWith("icon-") && U.value.includes(l.substring(5)) && t.push(l);
47
+ for (let l in v)
48
+ l.startsWith("icon-") && F.value.includes(l.substring(5)) && t.push(l);
47
49
  return t;
48
- }), F = r(() => e.value.isActive ? !0 : typeof e.value.isActiveChecker == "function" ? !!e.value.isActiveChecker({
50
+ }), z = c(() => e.value.isActive ? !0 : typeof e.value.isActiveChecker == "function" ? !!e.value.isActiveChecker({
49
51
  entry: e.value
50
- }) : !1), N = r(() => !!M.toggleSlot), n = r(() => M.toggleSlot);
51
- return S(() => v.modelValue, (t) => {
52
+ }) : !1), N = c(() => !!E.toggleSlot), n = c(() => E.toggleSlot);
53
+ return K(() => d.modelValue, (t) => {
52
54
  e.value = t;
53
- }, { deep: !0 }), S(e, (t) => {
55
+ }, { deep: !0 }), K(e, (t) => {
54
56
  o("update:modelValue", t);
55
- }, { deep: !0 }), Z(() => {
57
+ }, { deep: !0 }), ee(() => {
56
58
  var l, i, m;
57
59
  let t = a == null ? void 0 : a.currentRoute;
58
60
  if (t) {
59
61
  if (t.value.path === ((l = e.value.anchor) == null ? void 0 : l.to))
60
62
  e.value.isOpened = !0;
61
63
  else if (typeof e.value.children < "u" && ((i = e.value.children) == null ? void 0 : i.length) > 0) {
62
- let C = !1;
63
- (m = e.value.children) == null || m.forEach((J) => {
64
- var $;
65
- t.value.path === (($ = J.anchor) == null ? void 0 : $.to) && (C = !0);
66
- }), C && (e.value.isOpened = !0);
64
+ let S = !1;
65
+ (m = e.value.children) == null || m.forEach((H) => {
66
+ var M;
67
+ t.value.path === ((M = H.anchor) == null ? void 0 : M.to) && (S = !0);
68
+ }), S && (e.value.isOpened = !0);
67
69
  }
68
70
  }
69
71
  }), (t, l) => {
70
- var $;
71
- const i = E("lkt-button"), m = E("lkt-header"), C = E("lkt-anchor"), J = E("menu-item", !0);
72
- return u(), d("div", {
73
- class: g(["lkt-menu-entry", P.value]),
72
+ var M;
73
+ const i = I("lkt-button"), m = I("lkt-header"), S = I("lkt-anchor"), H = I("menu-item", !0);
74
+ return u(), p("div", {
75
+ class: O(["lkt-menu-entry", w.value]),
74
76
  id: `entry-${e.value.key}`
75
77
  }, [
76
- _("div", re, [
77
- e.value.type === p(R).Button ? (u(), y(i, H(I({ key: 0 }, e.value.button)), q({ _: 2 }, [
78
- p(c).tooltip ? {
78
+ V("div", de, [
79
+ e.value.type === r(T).Button ? (u(), f(i, W(R({ key: 0 }, e.value.button)), q({ _: 2 }, [
80
+ r(v).tooltip ? {
79
81
  name: "tooltip",
80
- fn: h(() => [
82
+ fn: g(() => [
81
83
  k(t.$slots, "tooltip")
82
84
  ]),
83
85
  key: "0"
84
86
  } : void 0,
85
- p(c).split ? {
87
+ r(v).split ? {
86
88
  name: "split",
87
- fn: h(() => [
89
+ fn: g(() => [
88
90
  k(t.$slots, "split")
89
91
  ]),
90
92
  key: "1"
91
93
  } : void 0
92
- ]), 1040)) : e.value.type === p(R).Header ? (u(), y(m, H(I({ key: 1 }, e.value.header)), null, 16)) : e.value.type === p(R).Anchor ? (u(), y(C, H(I({ key: 2 }, e.value.anchor)), null, 16)) : (u(), y(C, I({ key: 3 }, e.value.anchor, {
93
- "on-click": b,
94
- "is-active": F.value,
95
- onActive: l[0] || (l[0] = (O) => A.value = O)
94
+ ]), 1040)) : e.value.type === r(T).Header ? (u(), f(m, W(R({ key: 1 }, e.value.header)), null, 16)) : e.value.type === r(T).Anchor ? (u(), f(S, W(R({ key: 2 }, {
95
+ ...e.value.anchor
96
+ })), null, 16)) : (u(), f(S, R({ key: 3 }, {
97
+ ...e.value.anchor,
98
+ events: {
99
+ ...e.value.anchor.events,
100
+ click: (y) => {
101
+ var _, h, Q, X;
102
+ t.closeOnClickEntry && r(j).closeMenu(d.menuKey), typeof ((h = (_ = e.value.anchor) == null ? void 0 : _.events) == null ? void 0 : h.click) == "function" && ((X = (Q = e.value.anchor) == null ? void 0 : Q.events) == null || X.click(y));
103
+ }
104
+ }
105
+ }, {
106
+ "on-click": $,
107
+ "is-active": z.value,
108
+ onActive: l[0] || (l[0] = (y) => A.value = y)
96
109
  }), {
97
- text: h(({ text: O }) => [
98
- _("div", ce, [
99
- D.value ? (u(), d("div", de, [
100
- p(c)["icon-" + e.value.key] ? k(t.$slots, "icon-" + e.value.key, {
110
+ text: g(({ text: y }) => [
111
+ V("div", ve, [
112
+ D.value ? (u(), p("div", pe, [
113
+ r(v)["icon-" + e.value.key] ? k(t.$slots, "icon-" + e.value.key, {
101
114
  key: e.value.key,
102
115
  entry: e.value
103
- }) : e.value.icon !== "" ? (u(), d("i", {
116
+ }) : e.value.icon !== "" ? (u(), p("i", {
104
117
  key: 1,
105
- class: g(e.value.icon)
106
- }, null, 2)) : f("", !0)
107
- ])) : f("", !0),
108
- O !== "" ? (u(), d("div", pe, ee(O), 1)) : f("", !0)
118
+ class: O(e.value.icon)
119
+ }, null, 2)) : C("", !0)
120
+ ])) : C("", !0),
121
+ y !== "" ? (u(), p("div", me, le(y), 1)) : C("", !0)
109
122
  ])
110
123
  ]),
111
124
  _: 3
112
125
  }, 16, ["is-active"])),
113
- e.value.type !== p(R).Button && e.value.children && (($ = e.value.children) == null ? void 0 : $.length) > 0 ? (u(), d("div", {
126
+ e.value.type !== r(T).Button && e.value.children && ((M = e.value.children) == null ? void 0 : M.length) > 0 ? (u(), p("div", {
114
127
  key: 4,
115
128
  class: "lkt-menu-entry-toggle",
116
- onClick: K
129
+ onClick: B
117
130
  }, [
118
- N.value ? (u(), y(te(n.value), {
131
+ N.value ? (u(), f(ne(n.value), {
119
132
  key: 0,
120
- class: g(["lkt-menu-entry-toggle-inner", e.value.isOpened ? "is-opened" : ""])
121
- }, null, 8, ["class"])) : (u(), d("div", {
133
+ class: O(["lkt-menu-entry-toggle-inner", e.value.isOpened ? "is-opened" : ""])
134
+ }, null, 8, ["class"])) : (u(), p("div", {
122
135
  key: 1,
123
- class: g(["lkt-menu-entry-toggle-inner", e.value.isOpened ? "is-opened" : ""])
136
+ class: O(["lkt-menu-entry-toggle-inner", e.value.isOpened ? "is-opened" : ""])
124
137
  }, l[1] || (l[1] = [
125
- _("i", { class: "lkt-icn-angle-bottom" }, null, -1)
138
+ V("i", { class: "lkt-icn-angle-bottom" }, null, -1)
126
139
  ]), 2))
127
- ])) : f("", !0)
140
+ ])) : C("", !0)
128
141
  ]),
129
- e.value.isOpened ? (u(), d("div", ve, [
130
- (u(!0), d(x, null, j(e.value.children, (O, z) => (u(), y(J, {
131
- modelValue: e.value.children[z],
132
- "onUpdate:modelValue": (B) => e.value.children[z] = B,
133
- key: e.value.children[z].key
142
+ e.value.isOpened ? (u(), p("div", ke, [
143
+ (u(!0), p(te, null, P(e.value.children, (y, _) => (u(), f(H, {
144
+ modelValue: e.value.children[_],
145
+ "onUpdate:modelValue": (h) => e.value.children[_] = h,
146
+ key: e.value.children[_].key
134
147
  }, q({ _: 2 }, [
135
- j(w.value, (B) => ({
136
- name: B,
137
- fn: h(() => [
138
- k(t.$slots, B)
148
+ P(J.value, (h) => ({
149
+ name: h,
150
+ fn: g(() => [
151
+ k(t.$slots, h)
139
152
  ])
140
153
  }))
141
154
  ]), 1032, ["modelValue", "onUpdate:modelValue"]))), 128))
142
- ])) : f("", !0)
143
- ], 10, ae);
155
+ ])) : C("", !0)
156
+ ], 10, ce);
144
157
  };
145
158
  }
146
- }), ke = ["role"], ye = { class: "lkt-menu-main" }, he = { class: "lkt-menu-entries" }, fe = /* @__PURE__ */ X({
159
+ }), he = ["role"], fe = { class: "lkt-menu-main" }, ge = { class: "lkt-menu-entries" }, _e = /* @__PURE__ */ Z({
147
160
  __name: "LktMenu",
148
- props: /* @__PURE__ */ le({
161
+ props: /* @__PURE__ */ oe({
149
162
  modelValue: {},
150
163
  type: {},
151
164
  menuKey: { type: [String, Number, Function] },
152
165
  hiddenPosition: {},
153
166
  closeOnClickOutside: { type: Boolean },
167
+ closeOnClickEntry: { type: Boolean },
154
168
  http: {}
155
- }, ne(oe)),
169
+ }, ue(se)),
156
170
  emits: [
157
171
  "update:modelValue",
158
172
  "click-outside",
@@ -161,99 +175,101 @@ const ae = ["id"], re = { class: "lkt-menu-entry-main" }, ce = { class: "lkt-ent
161
175
  "response",
162
176
  "error"
163
177
  ],
164
- setup(s, { emit: V }) {
178
+ setup(s, { emit: b }) {
165
179
  var N;
166
- const o = s, v = V, e = T(!1), c = Y(), a = T(o.modelValue), A = (n) => {
180
+ const o = s, d = b, e = L(!1), v = x(), a = L(o.modelValue), A = (n) => {
167
181
  let t = {};
168
182
  typeof n == "object" && Object.keys(n).length > 0 && (t = JSON.parse(JSON.stringify(n)));
169
183
  for (let l in t)
170
184
  (Array.isArray(t[l]) || typeof t[l] == "object") && (t[l] = JSON.stringify(t[l]));
171
185
  return t;
172
186
  };
173
- S(() => W.config.value, (n) => {
187
+ K(() => j.config.value, (n) => {
174
188
  }, { deep: !0 });
175
- const K = r(() => {
189
+ const B = c(() => {
176
190
  let n = [
177
191
  `type-${o.type}`
178
192
  ];
179
- return o.menuKey && n.push(o.menuKey), e.value && n.push("is-visible"), o.type === Q.Hidden && n.push(`${o.hiddenPosition}-hidden`), n.join(" ");
193
+ return o.menuKey && n.push(o.menuKey), e.value && n.push("is-visible"), o.type === Y.Hidden && n.push(`${o.hiddenPosition}-hidden`), n.join(" ");
180
194
  });
181
- let b = new se({});
182
- b.increment(A(((N = o.http) == null ? void 0 : N.data) ?? {}));
183
- const D = r(() => G([], a.value)), P = r(() => {
195
+ let $ = new ae({});
196
+ $.increment(A(((N = o.http) == null ? void 0 : N.data) ?? {}));
197
+ const D = c(() => G([], a.value)), w = c(() => {
184
198
  let n = [];
185
- for (let t in c)
199
+ for (let t in v)
186
200
  t.startsWith("icon-") && D.value.includes(t.substring(5)) && n.push(t);
187
201
  return n;
188
- }), U = () => {
202
+ }), F = () => {
189
203
  var t, l;
190
204
  if (!((t = o.http) != null && t.resource)) return;
191
- let n = b.getData();
192
- v("loading"), ie((l = o.http) == null ? void 0 : l.resource, n).then((i) => {
193
- b.turnStoredIntoOriginal(), a.value = i.data, v("results", i.data), v("response", i);
205
+ let n = $.getData();
206
+ d("loading"), re((l = o.http) == null ? void 0 : l.resource, n).then((i) => {
207
+ $.turnStoredIntoOriginal(), a.value = i.data, d("results", i.data), d("response", i);
194
208
  }).catch((i) => {
195
- v("error", i);
209
+ d("error", i);
196
210
  });
197
- }, w = () => {
198
- o.closeOnClickOutside && W.closeMenu(o.menuKey), v("click-outside");
211
+ }, J = () => {
212
+ o.closeOnClickOutside && j.closeMenu(o.menuKey), d("click-outside");
199
213
  };
200
- S(() => o.modelValue, (n) => {
214
+ K(() => o.modelValue, (n) => {
201
215
  a.value = n;
202
- }, { deep: !0 }), S(a, (n) => {
203
- v("update:modelValue", n);
204
- }, { deep: !0 }), Z(() => {
205
- W.addMenu(o.menuKey, e), U();
216
+ }, { deep: !0 }), K(a, (n) => {
217
+ d("update:modelValue", n);
218
+ }, { deep: !0 }), ee(() => {
219
+ j.addMenu(o.menuKey, e), F();
206
220
  });
207
- const F = r(() => {
208
- if (o.type === Q.TabList) return "tablist";
221
+ const z = c(() => {
222
+ if (o.type === Y.TabList) return "tablist";
209
223
  });
210
- return (n, t) => (u(), d("div", {
211
- class: g(["lkt-menu", K.value]),
212
- role: F.value
224
+ return (n, t) => (u(), p("div", {
225
+ class: O(["lkt-menu", B.value]),
226
+ role: z.value
213
227
  }, [
214
- _("div", ye, [
215
- p(c).before ? k(n.$slots, "before", { key: 0 }) : f("", !0),
216
- _("div", he, [
217
- (u(!0), d(x, null, j(a.value, (l, i) => (u(), y(me, {
228
+ V("div", fe, [
229
+ r(v).before ? k(n.$slots, "before", { key: 0 }) : C("", !0),
230
+ V("div", ge, [
231
+ (u(!0), p(te, null, P(a.value, (l, i) => (u(), f(ye, {
218
232
  modelValue: a.value[i],
219
233
  "onUpdate:modelValue": (m) => a.value[i] = m,
220
- class: g(l.class)
234
+ class: O(l.class),
235
+ "menu-key": n.menuKey,
236
+ "close-on-click-entry": n.closeOnClickEntry
221
237
  }, q({ _: 2 }, [
222
- j(P.value, (m) => ({
238
+ P(w.value, (m) => ({
223
239
  name: m,
224
- fn: h(() => [
240
+ fn: g(() => [
225
241
  k(n.$slots, m)
226
242
  ])
227
243
  })),
228
- p(c)[`tooltip-${l.key}`] ? {
244
+ r(v)[`tooltip-${l.key}`] ? {
229
245
  name: "tooltip",
230
- fn: h(() => [
246
+ fn: g(() => [
231
247
  k(n.$slots, `tooltip-${l.key}`)
232
248
  ]),
233
249
  key: "0"
234
250
  } : void 0,
235
- p(c)[`split-${l.key}`] ? {
251
+ r(v)[`split-${l.key}`] ? {
236
252
  name: "split",
237
- fn: h(() => [
253
+ fn: g(() => [
238
254
  k(n.$slots, `split-${l.key}`)
239
255
  ]),
240
256
  key: "1"
241
257
  } : void 0
242
- ]), 1032, ["modelValue", "onUpdate:modelValue", "class"]))), 256))
258
+ ]), 1032, ["modelValue", "onUpdate:modelValue", "class", "menu-key", "close-on-click-entry"]))), 256))
243
259
  ])
244
260
  ]),
245
- _("div", {
261
+ V("div", {
246
262
  class: "lkt-menu-outside",
247
- onClick: w
263
+ onClick: J
248
264
  })
249
- ], 10, ke));
265
+ ], 10, he));
250
266
  }
251
- }), $e = {
267
+ }), Se = {
252
268
  install: (s) => {
253
- s.component("lkt-menu") === void 0 && s.component("lkt-menu", fe);
269
+ s.component("lkt-menu") === void 0 && s.component("lkt-menu", _e);
254
270
  }
255
- }, Oe = (s) => (M.toggleSlot = s, !0);
271
+ }, Me = (s) => (E.toggleSlot = s, !0);
256
272
  export {
257
- $e as default,
258
- Oe as setMenuToggleSlot
273
+ Se as default,
274
+ Me as setMenuToggleSlot
259
275
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-menu",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lkt",
package/theme/default.css CHANGED
@@ -29,6 +29,8 @@
29
29
 
30
30
  /** Colors: Outside */
31
31
  --lkt-menu--outside--background: rgba(255, 255, 255, 0.75);
32
+ --lkt-menu--outside--hidden--opacity: 0;
33
+ --lkt-menu--outside--visible--opacity: 1;
32
34
 
33
35
  /** Event: Hover */
34
36
  --lkt-menu--hover--text-decoration: none;