@phila/phila-ui-core 3.0.0-beta.5 → 3.0.0-beta.7

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/index.mjs CHANGED
@@ -1,9 +1,8 @@
1
- import { ref as L, reactive as j, computed as g, defineComponent as k, createElementBlock as p, createCommentVNode as O, unref as B, openBlock as d, createElementVNode as ee, Fragment as P, renderList as te, toDisplayString as A, renderSlot as V, onBeforeMount as K, onMounted as U, normalizeClass as G, createBlock as E, createVNode as ne, withCtx as q, createTextVNode as W, normalizeProps as R, guardReactiveProps as ae, mergeProps as I, inject as ie, resolveComponent as oe, resolveDynamicComponent as J, useTemplateRef as se, useAttrs as re, onBeforeUnmount as le, nextTick as ue, onUnmounted as ce } from "vue";
2
- import { FontAwesomeIcon as de } from "@fortawesome/vue-fontawesome";
3
- import './index.css';function fe(...t) {
1
+ import { ref as I, reactive as P, computed as p, defineComponent as k, createElementBlock as y, createCommentVNode as O, unref as T, openBlock as d, createElementVNode as Z, Fragment as K, renderList as ee, toDisplayString as q, renderSlot as L, onBeforeMount as U, onMounted as G, normalizeClass as te, createBlock as E, createVNode as ne, withCtx as A, createTextVNode as W, normalizeProps as R, guardReactiveProps as ae, mergeProps as B, resolveDynamicComponent as S, inject as ie, resolveComponent as oe, useTemplateRef as re, useAttrs as se, onBeforeUnmount as le, nextTick as ue, onUnmounted as ce } from "vue";
2
+ import './index.css';function de(...t) {
4
3
  return t.filter(Boolean).join(" ");
5
4
  }
6
- function Ce(t, e) {
5
+ function Ve(t, e) {
7
6
  let i;
8
7
  return (...o) => {
9
8
  i !== void 0 && clearTimeout(i), i = setTimeout(() => {
@@ -11,22 +10,22 @@ function Ce(t, e) {
11
10
  }, e);
12
11
  };
13
12
  }
14
- function Te(t = "phila-ui-") {
13
+ function xe(t = "phila-ui-") {
15
14
  const e = new Uint8Array(16);
16
15
  crypto.getRandomValues(e);
17
16
  const i = Array.from(e, (o) => o.toString(36)).join("").substring(0, 12);
18
17
  return `${t}-${i}`;
19
18
  }
20
- const S = L("");
21
- function Q() {
19
+ const z = I("");
20
+ function J() {
22
21
  return {
23
- inputValue: S,
22
+ inputValue: z,
24
23
  setInputValue: (e) => {
25
- S.value = e;
24
+ z.value = e;
26
25
  }
27
26
  };
28
27
  }
29
- const c = j({
28
+ const c = P({
30
29
  validateOnBlur: !1,
31
30
  validateOnInput: !1,
32
31
  validateOnChange: !1,
@@ -34,28 +33,28 @@ const c = j({
34
33
  required: !1,
35
34
  isValid: !0,
36
35
  errors: []
37
- }), { inputValue: M } = Q();
38
- function X(t, e) {
36
+ }), { inputValue: H } = J();
37
+ function Q(t, e) {
39
38
  return {
40
39
  init: () => {
41
40
  t && (c.validateOnBlur = t.validateOnBlur ?? !1, c.validateOnInput = t.validateOnInput ?? !1, c.validateOnChange = t.validateOnChange ?? !1, c.validateOnMount = t.validateOnMount ?? !1, c.validate = t.validate, c.required = t.required ?? !1, c.errors = t.errors || []);
42
41
  },
43
42
  validation: () => {
44
43
  const n = Object.assign([], t?.errors || []);
45
- if (c.required && !M.value && (c.isValid = !1, n.push("This field is required")), c.validate) {
46
- const r = c.validate(M.value);
47
- typeof r == "string" ? (c.isValid = !1, n.push(r)) : Array.isArray(r) ? (c.isValid = !1, n.push(...r)) : c.isValid = !0;
44
+ if (c.required && !H.value && (c.isValid = !1, n.push("This field is required")), c.validate) {
45
+ const s = c.validate(H.value);
46
+ typeof s == "string" ? (c.isValid = !1, n.push(s)) : Array.isArray(s) ? (c.isValid = !1, n.push(...s)) : c.isValid = !0;
48
47
  }
49
48
  c.errors = n, n.length > 0 ? (c.isValid = !1, e?.("error", n)) : c.isValid = !0;
50
49
  },
51
- isValid: g(() => c.isValid),
52
- errors: g(() => c.errors)
50
+ isValid: p(() => c.isValid),
51
+ errors: p(() => c.errors)
53
52
  };
54
53
  }
55
54
  const ve = {
56
55
  key: 0,
57
56
  class: "input-errors"
58
- }, me = /* @__PURE__ */ k({
57
+ }, fe = /* @__PURE__ */ k({
59
58
  __name: "ErrorList",
60
59
  props: {
61
60
  errors: {},
@@ -67,37 +66,37 @@ const ve = {
67
66
  required: { type: Boolean }
68
67
  },
69
68
  setup(t) {
70
- const { errors: e, isValid: i } = X(), o = t, n = g(() => Object.assign([], e.value, o.errors || []));
71
- return (r, b) => !B(i) && n.value?.length ? (d(), p("div", ve, [
72
- ee("ul", null, [
73
- (d(!0), p(P, null, te(n.value, (y, m) => (d(), p("li", { key: m }, A(y), 1))), 128))
69
+ const { errors: e, isValid: i } = Q(), o = t, n = p(() => Object.assign([], e.value, o.errors || []));
70
+ return (s, b) => !T(i) && n.value?.length ? (d(), y("div", ve, [
71
+ Z("ul", null, [
72
+ (d(!0), y(K, null, ee(n.value, (g, m) => (d(), y("li", { key: m }, q(g), 1))), 128))
74
73
  ])
75
74
  ])) : O("", !0);
76
75
  }
77
- }), T = (t, e) => {
76
+ }), C = (t, e) => {
78
77
  const i = t.__vccOpts || t;
79
78
  for (const [o, n] of e)
80
79
  i[o] = n;
81
80
  return i;
82
- }, pe = /* @__PURE__ */ T(me, [["__scopeId", "data-v-caba8dd2"]]), ge = ["for"], ye = {
81
+ }, me = /* @__PURE__ */ C(fe, [["__scopeId", "data-v-caba8dd2"]]), pe = ["for"], ge = {
83
82
  key: 0,
84
83
  class: "required"
85
- }, he = /* @__PURE__ */ k({
84
+ }, ye = /* @__PURE__ */ k({
86
85
  __name: "InputLabel",
87
86
  props: {
88
87
  id: {},
89
88
  required: { type: Boolean }
90
89
  },
91
90
  setup(t) {
92
- return (e, i) => (d(), p("label", {
91
+ return (e, i) => (d(), y("label", {
93
92
  class: "input-label",
94
93
  for: t.id
95
94
  }, [
96
- V(e.$slots, "default", {}, void 0, !0),
97
- t.required ? (d(), p("span", ye, "*")) : O("", !0)
98
- ], 8, ge));
95
+ L(e.$slots, "default", {}, void 0, !0),
96
+ t.required ? (d(), y("span", ge, "*")) : O("", !0)
97
+ ], 8, pe));
99
98
  }
100
- }), be = /* @__PURE__ */ T(he, [["__scopeId", "data-v-00c91174"]]), _e = /* @__PURE__ */ k({
99
+ }), he = /* @__PURE__ */ C(ye, [["__scopeId", "data-v-00c91174"]]), be = /* @__PURE__ */ k({
101
100
  inheritAttrs: !1,
102
101
  __name: "InputWrap",
103
102
  props: {
@@ -117,7 +116,7 @@ const ve = {
117
116
  },
118
117
  emits: ["update:modelValue", "input", "change", "focus", "blur", "keydown", "keyup", "keypress", "error"],
119
118
  setup(t, { emit: e }) {
120
- const { setInputValue: i } = Q(), o = L(""), n = t, r = e, { init: b, isValid: y, validation: m } = X(
119
+ const { setInputValue: i } = J(), o = I(""), n = t, s = e, { init: b, isValid: g, validation: m } = Q(
121
120
  {
122
121
  validateOnMount: n.validateOnMount ?? !0,
123
122
  validateOnInput: n.validateOnInput ?? !0,
@@ -127,41 +126,40 @@ const ve = {
127
126
  errors: n.errors || [],
128
127
  validate: n.validate
129
128
  },
130
- r
131
- ), s = g(() => ({
132
- invalid: !y.value
133
- })), l = (_) => (o.value = _.target.value, r("update:modelValue", o.value), r("input", o.value), i(o.value), n.validateOnInput && m(), o.value), v = () => {
134
- n.validateOnBlur && m(), r("blur");
129
+ s
130
+ ), r = p(() => ({
131
+ invalid: !g.value
132
+ })), l = (_) => (o.value = _.target.value, s("update:modelValue", o.value), s("input", o.value), i(o.value), n.validateOnInput && m(), o.value), f = () => {
133
+ n.validateOnBlur && m(), s("blur");
135
134
  }, h = () => {
136
- r("focus");
135
+ s("focus");
137
136
  };
138
- return K(() => {
137
+ return U(() => {
139
138
  b();
140
- }), U(() => {
139
+ }), G(() => {
141
140
  n.validateOnMount && m();
142
- }), (_, a) => (d(), p("div", {
143
- class: G(["input-wrap", { hasError: !B(y) }])
141
+ }), (_, a) => (d(), y("div", {
142
+ class: te(["input-wrap", { hasError: !T(g) }])
144
143
  }, [
145
- n.label ? (d(), E(be, {
144
+ n.label ? (d(), E(he, {
146
145
  key: 0,
147
146
  id: n.id,
148
147
  required: n.required
149
148
  }, {
150
- default: q(() => [
151
- W(A(n.label), 1)
149
+ default: A(() => [
150
+ W(q(n.label), 1)
152
151
  ]),
153
152
  _: 1
154
153
  }, 8, ["id", "required"])) : O("", !0),
155
- V(_.$slots, "default", R(ae({ inputValue: o.value, onBlur: v, onFocus: h, onInput: l, isValid: B(y), inputClasses: s.value })), void 0, !0),
156
- ne(pe)
154
+ L(_.$slots, "default", R(ae({ inputValue: o.value, onBlur: f, onFocus: h, onInput: l, isValid: T(g), inputClasses: r.value })), void 0, !0),
155
+ ne(me)
157
156
  ], 2));
158
157
  }
159
- }), $e = /* @__PURE__ */ T(_e, [["__scopeId", "data-v-751bf20e"]]), Oe = ["innerHTML"], ke = ["src", "alt"], Ee = /* @__PURE__ */ k({
158
+ }), Te = /* @__PURE__ */ C(be, [["__scopeId", "data-v-751bf20e"]]), _e = ["innerHTML"], Oe = ["src", "alt"], ke = /* @__PURE__ */ k({
160
159
  __name: "Icon",
161
160
  props: {
162
161
  className: {},
163
- iconDefinition: {},
164
- iconClass: {},
162
+ icon: {},
165
163
  src: {},
166
164
  svgRaw: {},
167
165
  variant: { default: "default" },
@@ -172,38 +170,35 @@ const ve = {
172
170
  ariaLabel: { default: void 0 }
173
171
  },
174
172
  setup(t) {
175
- const e = t, i = g(() => fe(
176
- "phila-icon",
177
- e.size && `phila-icon--${e.size}`,
178
- e.inline && "phila-icon--inline",
179
- e.variant && e.variant !== "default" && `phila-icon--${e.variant}`,
180
- e.shadow && "phila-icon--shadow",
173
+ const e = t, i = p(() => de(
174
+ "phila-icon-core",
175
+ e.size && `phila-icon-core--${e.size}`,
176
+ e.inline && "phila-icon-core--inline",
177
+ e.variant && e.variant !== "default" && `phila-icon-core--${e.variant}`,
178
+ e.shadow && "phila-icon-core--shadow",
181
179
  e.className
182
- )), o = g(() => e.decorative ? {
180
+ )), o = p(() => e.decorative ? {
183
181
  "aria-hidden": !0
184
182
  } : {
185
183
  "aria-label": e.ariaLabel,
186
184
  role: "img"
187
185
  });
188
- return (n, r) => (d(), p("span", I({ class: i.value }, o.value), [
189
- e.iconDefinition ? (d(), E(B(de), {
186
+ return (n, s) => (d(), y("span", B({ class: i.value }, o.value), [
187
+ e.icon ? (d(), E(S(e.icon), {
190
188
  key: 0,
191
- icon: e.iconDefinition
192
- }, null, 8, ["icon"])) : e.iconClass ? (d(), p("i", {
189
+ class: "phila-icon-core__svg"
190
+ })) : e.svgRaw ? (d(), y("span", {
193
191
  key: 1,
194
- class: G(`fa fa-${e.iconClass}`)
195
- }, null, 2)) : e.svgRaw ? (d(), p("span", {
196
- key: 2,
197
- class: "phila-icon__svg",
192
+ class: "phila-icon-core__svg",
198
193
  innerHTML: e.svgRaw
199
- }, null, 8, Oe)) : e.src ? (d(), p("img", {
200
- key: 3,
194
+ }, null, 8, _e)) : e.src ? (d(), y("img", {
195
+ key: 2,
201
196
  src: e.src,
202
197
  alt: e.decorative ? "" : e.ariaLabel || "Icon"
203
- }, null, 8, ke)) : O("", !0)
198
+ }, null, 8, Oe)) : O("", !0)
204
199
  ], 16));
205
200
  }
206
- }), z = /* @__PURE__ */ T(Ee, [["__scopeId", "data-v-1fe4be50"]]), we = { key: 1 }, Re = /* @__PURE__ */ k({
201
+ }), F = /* @__PURE__ */ C(ke, [["__scopeId", "data-v-fe51b404"]]), Ee = { key: 1 }, Ce = /* @__PURE__ */ k({
207
202
  __name: "ActionContent",
208
203
  props: {
209
204
  iconRight: { type: Boolean, default: !1 },
@@ -213,35 +208,33 @@ const ve = {
213
208
  size: { default: void 0 },
214
209
  shadow: { type: Boolean },
215
210
  iconSize: { default: void 0 },
216
- iconDefinition: {},
217
- iconClass: {},
211
+ icon: {},
218
212
  src: {},
219
213
  svgRaw: {},
220
214
  variant: {}
221
215
  },
222
216
  setup(t) {
223
- const e = t, i = g(() => e.iconDefinition || e.iconClass || e.src || e.svgRaw), o = (r) => {
224
- if (r.iconOnly)
225
- switch (r.size) {
217
+ const e = t, i = p(() => e.icon || e.src || e.svgRaw), o = (s) => {
218
+ if (s.iconOnly)
219
+ switch (s.size) {
226
220
  case "small":
227
221
  return "extra-small";
228
222
  case "extra-small":
229
223
  return "xxsmall";
230
224
  default:
231
- return r.size || "medium";
225
+ return s.size || "medium";
232
226
  }
233
227
  else
234
- switch (r.size) {
228
+ switch (s.size) {
235
229
  case "small":
236
230
  case "extra-small":
237
231
  return "xxsmall";
238
232
  default:
239
233
  return "extra-small";
240
234
  }
241
- }, n = g(
235
+ }, n = p(
242
236
  () => ({
243
- iconDefinition: e.iconDefinition,
244
- iconClass: e.iconClass,
237
+ icon: e.icon,
245
238
  src: e.src,
246
239
  svgRaw: e.svgRaw,
247
240
  size: e.iconSize ?? o(e),
@@ -251,25 +244,25 @@ const ve = {
251
244
  shadow: e.shadow
252
245
  })
253
246
  );
254
- return (r, b) => (d(), p(P, null, [
255
- i.value && !e.iconRight ? (d(), E(z, R(I({ key: 0 }, n.value)), null, 16)) : O("", !0),
256
- e.iconOnly ? O("", !0) : (d(), p("span", we, [
257
- V(r.$slots, "default", {}, () => [
258
- W(A(e.text), 1)
247
+ return (s, b) => (d(), y(K, null, [
248
+ i.value && !e.iconRight ? (d(), E(F, R(B({ key: 0 }, n.value)), null, 16)) : O("", !0),
249
+ e.iconOnly ? O("", !0) : (d(), y("span", Ee, [
250
+ L(s.$slots, "default", {}, () => [
251
+ W(q(e.text), 1)
259
252
  ])
260
253
  ])),
261
- i.value && e.iconRight ? (d(), E(z, R(I({ key: 2 }, n.value)), null, 16)) : O("", !0)
254
+ i.value && e.iconRight ? (d(), E(F, R(B({ key: 2 }, n.value)), null, 16)) : O("", !0)
262
255
  ], 64));
263
256
  }
264
- }), H = (t) => "to" in t && t.to !== void 0;
265
- function Be() {
266
- const t = ie("router", null), e = g(() => t !== null);
257
+ }), N = (t) => "to" in t && t.to !== void 0;
258
+ function we() {
259
+ const t = ie("router", null), e = p(() => t !== null);
267
260
  return {
268
261
  router: t,
269
262
  hasRouter: e
270
263
  };
271
264
  }
272
- const Ae = /* @__PURE__ */ k({
265
+ const $e = /* @__PURE__ */ k({
273
266
  __name: "BaseLink",
274
267
  props: {
275
268
  to: {},
@@ -281,7 +274,7 @@ const Ae = /* @__PURE__ */ k({
281
274
  className: {}
282
275
  },
283
276
  setup(t) {
284
- const e = t, { hasRouter: i } = Be(), o = g(() => H(e) && i.value ? oe("RouterLink") : "a"), n = g(() => H(e) ? {
277
+ const e = t, { hasRouter: i } = we(), o = p(() => N(e) && i.value ? oe("RouterLink") : "a"), n = p(() => N(e) ? {
285
278
  to: e.disabled ? void 0 : e.to,
286
279
  ...e.disabled && { "aria-disabled": "true" },
287
280
  ...e.ariaLabel && { "aria-label": e.ariaLabel }
@@ -292,14 +285,14 @@ const Ae = /* @__PURE__ */ k({
292
285
  ...e.disabled && { "aria-disabled": "true" },
293
286
  ...e.ariaLabel && { "aria-label": e.ariaLabel }
294
287
  });
295
- return (r, b) => (d(), E(J(o.value), I({ class: t.className }, n.value), {
296
- default: q(() => [
297
- V(r.$slots, "default")
288
+ return (s, b) => (d(), E(S(o.value), B({ class: t.className }, n.value), {
289
+ default: A(() => [
290
+ L(s.$slots, "default")
298
291
  ]),
299
292
  _: 3
300
293
  }, 16, ["class"]));
301
294
  }
302
- }), Ie = 'a,area,button,iframe,input,object,textarea,select,details,[tabindex]:not([tabindex="-1"])', qe = /* @__PURE__ */ k({
295
+ }), Be = 'a,area,button,iframe,input,object,textarea,select,details,[tabindex]:not([tabindex="-1"])', Re = /* @__PURE__ */ k({
303
296
  __name: "FocusTrap",
304
297
  props: {
305
298
  initialFocusElement: {},
@@ -309,128 +302,128 @@ const Ae = /* @__PURE__ */ k({
309
302
  },
310
303
  emits: ["escape"],
311
304
  setup(t, { emit: e }) {
312
- const i = se("focusTrap"), o = L([]), n = t, r = e, b = re(), y = (s) => {
305
+ const i = re("focusTrap"), o = I([]), n = t, s = e, b = se(), g = (r) => {
313
306
  const l = o.value;
314
307
  if (l.length === 0) return;
315
- const v = l[0], h = l[l.length - 1];
316
- if (s.key === "Tab" && (s.shiftKey ? document.activeElement === v && (n.allowEscape ? r("escape") : (s.preventDefault(), h.focus())) : document.activeElement === h && (n.allowEscape ? r("escape") : (s.preventDefault(), v.focus()))), s.key === "PageUp" && (s.preventDefault(), v.focus()), s.key === "PageDown" && (s.preventDefault(), h.focus()), n.arrowNavigation) {
308
+ const f = l[0], h = l[l.length - 1];
309
+ if (r.key === "Tab" && (r.shiftKey ? document.activeElement === f && (n.allowEscape ? s("escape") : (r.preventDefault(), h.focus())) : document.activeElement === h && (n.allowEscape ? s("escape") : (r.preventDefault(), f.focus()))), r.key === "PageUp" && (r.preventDefault(), f.focus()), r.key === "PageDown" && (r.preventDefault(), h.focus()), n.arrowNavigation) {
317
310
  const _ = l.indexOf(document.activeElement);
318
- if (s.key === "ArrowDown" || s.key === "ArrowRight") {
319
- s.preventDefault();
311
+ if (r.key === "ArrowDown" || r.key === "ArrowRight") {
312
+ r.preventDefault();
320
313
  const a = (_ + 1) % l.length;
321
314
  l[a].focus();
322
315
  }
323
- if (s.key === "ArrowUp" || s.key === "ArrowLeft") {
324
- s.preventDefault();
316
+ if (r.key === "ArrowUp" || r.key === "ArrowLeft") {
317
+ r.preventDefault();
325
318
  const a = (_ - 1 + l.length) % l.length;
326
319
  l[a].focus();
327
320
  }
328
321
  }
329
- }, m = (s) => {
330
- s.target.removeAttribute("tabindex");
322
+ }, m = (r) => {
323
+ r.target.removeAttribute("tabindex");
331
324
  };
332
- return U(() => {
333
- const s = i.value?.querySelectorAll(Ie);
334
- if (s) {
335
- s.forEach((v) => {
336
- v.addEventListener("keydown", y);
337
- }), o.value = Array.from(s);
325
+ return G(() => {
326
+ const r = i.value?.querySelectorAll(Be);
327
+ if (r) {
328
+ r.forEach((f) => {
329
+ f.addEventListener("keydown", g);
330
+ }), o.value = Array.from(r);
338
331
  let l = o.value[0];
339
332
  if (n.initialFocusElement) {
340
- const v = i.value?.querySelector(`${n.initialFocusElement}`);
341
- v && (v.tabIndex === -1 && (v.tabIndex = 0, v.addEventListener("blur", m, { once: !0 })), l = v);
333
+ const f = i.value?.querySelector(`${n.initialFocusElement}`);
334
+ f && (f.tabIndex === -1 && (f.tabIndex = 0, f.addEventListener("blur", m, { once: !0 })), l = f);
342
335
  } else l || (l = i.value, l.tabIndex = 0, l.addEventListener("blur", m, { once: !0 }));
343
336
  l.focus();
344
337
  }
345
338
  }), le(() => {
346
- o.value.forEach((s) => {
347
- s.removeEventListener("keydown", y), s.removeEventListener("blur", m);
339
+ o.value.forEach((r) => {
340
+ r.removeEventListener("keydown", g), r.removeEventListener("blur", m);
348
341
  });
349
- }), (s, l) => (d(), E(J(n.as || "span"), I({
342
+ }), (r, l) => (d(), E(S(n.as || "span"), B({
350
343
  ref_key: "focusTrap",
351
344
  ref: i
352
- }, B(b)), {
353
- default: q(() => [
354
- V(s.$slots, "default")
345
+ }, T(b)), {
346
+ default: A(() => [
347
+ L(r.$slots, "default")
355
348
  ]),
356
349
  _: 3
357
350
  }, 16));
358
351
  }
359
- }), u = j({}), C = L(), F = 400, $ = L(null), N = {
352
+ }), u = P({}), x = I(), D = 400, $ = I(null), j = {
360
353
  id: "default-item",
361
354
  group: "global"
362
355
  };
363
- function De(t) {
364
- const e = t.group || N.group, i = t.id || N.id, o = (a, f) => {
365
- const x = u[e]?.[a];
366
- x && (x.showSingle ? Object.keys(u[e]).forEach((w) => {
367
- u[e][w].visible = w === a ? f : !1;
368
- }) : u[e][a].visible = f);
369
- }, n = (a = !0, f) => {
370
- clearTimeout(C.value), o(f ?? i, a), a && v(f ?? i);
371
- }, r = (a) => u[e]?.[a ?? i]?.visible ?? !1, b = (a) => {
356
+ function qe(t) {
357
+ const e = t.group || j.group, i = t.id || j.id, o = (a, v) => {
358
+ const V = u[e]?.[a];
359
+ V && (V.showSingle ? Object.keys(u[e]).forEach((w) => {
360
+ u[e][w].visible = w === a ? v : !1;
361
+ }) : u[e][a].visible = v);
362
+ }, n = (a = !0, v) => {
363
+ clearTimeout(x.value), o(v ?? i, a), a && f(v ?? i);
364
+ }, s = (a) => u[e]?.[a ?? i]?.visible ?? !1, b = (a) => {
372
365
  u[e] || (u[e] = {}), u[e][a] || (u[e][a] = {
373
366
  group: e,
374
367
  visible: !1
375
368
  }), t.blurHide !== void 0 && (u[e][a].blurHide = t.blurHide), t.showSingle !== void 0 && (u[e][a].showSingle = t.showSingle), t.mouseOverToggle !== void 0 && (u[e][a].mouseOverToggle = t.mouseOverToggle), t.outsideClickHide !== void 0 && (u[e][a].outsideClickHide = t.outsideClickHide), t.escapeKeyHide !== void 0 && (u[e][a].escapeKeyHide = t.escapeKeyHide);
376
- }, y = (a) => (f) => {
377
- f.key === "Escape" && (o(a, !1), h());
378
- }, m = (a) => (f) => {
369
+ }, g = (a) => (v) => {
370
+ v.key === "Escape" && (o(a, !1), h());
371
+ }, m = (a) => (v) => {
379
372
  if (!u[e]) return;
380
- const x = f.target, [w] = Object.keys(u[e]).filter((Z) => u[e][Z].visible === !0), D = document.getElementById(w), Y = document.querySelector(`[data-toggle="visibility-${w}"]`)?.contains(f.target);
381
- D && !D.contains(x) && !Y && (o(a ?? i, !1), h());
382
- }, s = (a) => {
383
- (u[e]?.[a ?? i]).mouseOverToggle === !0 && ($.value = a ?? i, C.value = setTimeout(() => {
373
+ const V = v.target, [w] = Object.keys(u[e]).filter((Y) => u[e][Y].visible === !0), M = document.getElementById(w), X = document.querySelector(`[data-toggle="visibility-${w}"]`)?.contains(v.target);
374
+ M && !M.contains(V) && !X && (o(a ?? i, !1), h());
375
+ }, r = (a) => {
376
+ (u[e]?.[a ?? i]).mouseOverToggle === !0 && ($.value = a ?? i, x.value = setTimeout(() => {
384
377
  n(!0, a);
385
- }, F));
378
+ }, D));
386
379
  }, l = (a) => {
387
- (u[e]?.[a ?? i]).mouseOverToggle === !0 && ($.value = null, clearTimeout(C.value), C.value = setTimeout(() => {
380
+ (u[e]?.[a ?? i]).mouseOverToggle === !0 && ($.value = null, clearTimeout(x.value), x.value = setTimeout(() => {
388
381
  $.value !== (a ?? i) && (o(a ?? i, !1), h());
389
- }, F));
390
- }, v = (a) => {
391
- const f = u[e]?.[a];
392
- f?.outsideClickHide && (document.addEventListener("click", m(a)), document.addEventListener("touchend", m(a))), f?.escapeKeyHide && document.addEventListener("keydown", y(a));
382
+ }, D));
383
+ }, f = (a) => {
384
+ const v = u[e]?.[a];
385
+ v?.outsideClickHide && (document.addEventListener("click", m(a)), document.addEventListener("touchend", m(a))), v?.escapeKeyHide && document.addEventListener("keydown", g(a));
393
386
  }, h = () => {
394
387
  u[e] && Object.keys(u[e]).forEach((a) => {
395
- document.removeEventListener("click", m(a)), document.removeEventListener("touchend", m(a)), document.removeEventListener("keydown", y(a));
388
+ document.removeEventListener("click", m(a)), document.removeEventListener("touchend", m(a)), document.removeEventListener("keydown", g(a));
396
389
  });
397
390
  };
398
- K(() => {
391
+ U(() => {
399
392
  t.id !== void 0 && (b(t.id), ue(() => {
400
393
  t.visibleOnMount && n(!0);
401
394
  }));
402
395
  }), ce(() => {
403
396
  h();
404
397
  });
405
- const _ = g(() => t.id ? {
398
+ const _ = p(() => t.id ? {
406
399
  "data-toggle": `visibility-${i}`,
407
- onclick: () => n(!r(i))
400
+ onClick: () => n(!s(i))
408
401
  } : {});
409
402
  return {
410
403
  visibilityState: u,
411
404
  create: b,
412
405
  setState: o,
413
- isVisible: r,
414
- onMouseEnter: s,
406
+ isVisible: s,
407
+ onMouseEnter: r,
415
408
  onMouseLeave: l,
416
409
  setVisibility: n,
417
410
  toggleProps: _
418
411
  };
419
412
  }
420
413
  export {
421
- Re as ActionContent,
422
- Ae as BaseLink,
423
- pe as ErrorList,
424
- qe as FocusTrap,
425
- z as Icon,
426
- be as InputLabel,
427
- $e as InputWrap,
428
- fe as cn,
429
- Ce as debounce,
430
- Te as generateRandomId,
431
- H as isRouterLink,
432
- Q as useInput,
433
- Be as useRouter,
434
- X as useValidation,
435
- De as useVisibility
414
+ Ce as ActionContent,
415
+ $e as BaseLink,
416
+ me as ErrorList,
417
+ Re as FocusTrap,
418
+ F as Icon,
419
+ he as InputLabel,
420
+ Te as InputWrap,
421
+ de as cn,
422
+ Ve as debounce,
423
+ xe as generateRandomId,
424
+ N as isRouterLink,
425
+ J as useInput,
426
+ we as useRouter,
427
+ Q as useValidation,
428
+ qe as useVisibility
436
429
  };