@phila/phila-ui-core 3.0.0-beta.6 → 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/NOTICE.md +30 -0
- package/README.md +17 -63
- package/dist/icons.d.ts +355 -0
- package/dist/icons.js +1 -0
- package/dist/icons.mjs +2263 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.js +1 -1
- package/dist/index.mjs +153 -160
- package/dist/phila-icons.css +903 -0
- package/dist/styles/elements/icons.css +13 -19
- package/package.json +16 -8
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import
|
|
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
|
|
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
|
|
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
|
|
21
|
-
function
|
|
19
|
+
const z = I("");
|
|
20
|
+
function J() {
|
|
22
21
|
return {
|
|
23
|
-
inputValue:
|
|
22
|
+
inputValue: z,
|
|
24
23
|
setInputValue: (e) => {
|
|
25
|
-
|
|
24
|
+
z.value = e;
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
27
|
}
|
|
29
|
-
const c =
|
|
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:
|
|
38
|
-
function
|
|
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 && !
|
|
46
|
-
const
|
|
47
|
-
typeof
|
|
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:
|
|
52
|
-
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
|
-
},
|
|
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 } =
|
|
71
|
-
return (
|
|
72
|
-
|
|
73
|
-
(d(!0),
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
81
|
+
}, me = /* @__PURE__ */ C(fe, [["__scopeId", "data-v-caba8dd2"]]), pe = ["for"], ge = {
|
|
83
82
|
key: 0,
|
|
84
83
|
class: "required"
|
|
85
|
-
},
|
|
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(),
|
|
91
|
+
return (e, i) => (d(), y("label", {
|
|
93
92
|
class: "input-label",
|
|
94
93
|
for: t.id
|
|
95
94
|
}, [
|
|
96
|
-
|
|
97
|
-
t.required ? (d(),
|
|
98
|
-
], 8,
|
|
95
|
+
L(e.$slots, "default", {}, void 0, !0),
|
|
96
|
+
t.required ? (d(), y("span", ge, "*")) : O("", !0)
|
|
97
|
+
], 8, pe));
|
|
99
98
|
}
|
|
100
|
-
}),
|
|
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 } =
|
|
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
|
-
|
|
131
|
-
),
|
|
132
|
-
invalid: !
|
|
133
|
-
})), l = (_) => (o.value = _.target.value,
|
|
134
|
-
n.validateOnBlur && m(),
|
|
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
|
-
|
|
135
|
+
s("focus");
|
|
137
136
|
};
|
|
138
|
-
return
|
|
137
|
+
return U(() => {
|
|
139
138
|
b();
|
|
140
|
-
}),
|
|
139
|
+
}), G(() => {
|
|
141
140
|
n.validateOnMount && m();
|
|
142
|
-
}), (_, a) => (d(),
|
|
143
|
-
class:
|
|
141
|
+
}), (_, a) => (d(), y("div", {
|
|
142
|
+
class: te(["input-wrap", { hasError: !T(g) }])
|
|
144
143
|
}, [
|
|
145
|
-
n.label ? (d(), E(
|
|
144
|
+
n.label ? (d(), E(he, {
|
|
146
145
|
key: 0,
|
|
147
146
|
id: n.id,
|
|
148
147
|
required: n.required
|
|
149
148
|
}, {
|
|
150
|
-
default:
|
|
151
|
-
W(
|
|
149
|
+
default: A(() => [
|
|
150
|
+
W(q(n.label), 1)
|
|
152
151
|
]),
|
|
153
152
|
_: 1
|
|
154
153
|
}, 8, ["id", "required"])) : O("", !0),
|
|
155
|
-
|
|
156
|
-
ne(
|
|
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
|
-
}),
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
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,
|
|
189
|
-
e.
|
|
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
|
-
|
|
192
|
-
}
|
|
189
|
+
class: "phila-icon-core__svg"
|
|
190
|
+
})) : e.svgRaw ? (d(), y("span", {
|
|
193
191
|
key: 1,
|
|
194
|
-
class:
|
|
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,
|
|
200
|
-
key:
|
|
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,
|
|
198
|
+
}, null, 8, Oe)) : O("", !0)
|
|
204
199
|
], 16));
|
|
205
200
|
}
|
|
206
|
-
}),
|
|
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
|
-
|
|
217
|
-
iconClass: {},
|
|
211
|
+
icon: {},
|
|
218
212
|
src: {},
|
|
219
213
|
svgRaw: {},
|
|
220
214
|
variant: {}
|
|
221
215
|
},
|
|
222
216
|
setup(t) {
|
|
223
|
-
const e = t, i =
|
|
224
|
-
if (
|
|
225
|
-
switch (
|
|
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
|
|
225
|
+
return s.size || "medium";
|
|
232
226
|
}
|
|
233
227
|
else
|
|
234
|
-
switch (
|
|
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 =
|
|
235
|
+
}, n = p(
|
|
242
236
|
() => ({
|
|
243
|
-
|
|
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 (
|
|
255
|
-
i.value && !e.iconRight ? (d(), E(
|
|
256
|
-
e.iconOnly ? O("", !0) : (d(),
|
|
257
|
-
|
|
258
|
-
W(
|
|
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(
|
|
254
|
+
i.value && e.iconRight ? (d(), E(F, R(B({ key: 2 }, n.value)), null, 16)) : O("", !0)
|
|
262
255
|
], 64));
|
|
263
256
|
}
|
|
264
|
-
}),
|
|
265
|
-
function
|
|
266
|
-
const t = ie("router", null), e =
|
|
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
|
|
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 } =
|
|
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 (
|
|
296
|
-
default:
|
|
297
|
-
|
|
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
|
-
}),
|
|
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 =
|
|
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
|
|
316
|
-
if (
|
|
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 (
|
|
319
|
-
|
|
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 (
|
|
324
|
-
|
|
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 = (
|
|
330
|
-
|
|
322
|
+
}, m = (r) => {
|
|
323
|
+
r.target.removeAttribute("tabindex");
|
|
331
324
|
};
|
|
332
|
-
return
|
|
333
|
-
const
|
|
334
|
-
if (
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}), o.value = Array.from(
|
|
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
|
|
341
|
-
|
|
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((
|
|
347
|
-
|
|
339
|
+
o.value.forEach((r) => {
|
|
340
|
+
r.removeEventListener("keydown", g), r.removeEventListener("blur", m);
|
|
348
341
|
});
|
|
349
|
-
}), (
|
|
342
|
+
}), (r, l) => (d(), E(S(n.as || "span"), B({
|
|
350
343
|
ref_key: "focusTrap",
|
|
351
344
|
ref: i
|
|
352
|
-
},
|
|
353
|
-
default:
|
|
354
|
-
|
|
345
|
+
}, T(b)), {
|
|
346
|
+
default: A(() => [
|
|
347
|
+
L(r.$slots, "default")
|
|
355
348
|
]),
|
|
356
349
|
_: 3
|
|
357
350
|
}, 16));
|
|
358
351
|
}
|
|
359
|
-
}), u =
|
|
352
|
+
}), u = P({}), x = I(), D = 400, $ = I(null), j = {
|
|
360
353
|
id: "default-item",
|
|
361
354
|
group: "global"
|
|
362
355
|
};
|
|
363
|
-
function
|
|
364
|
-
const e = t.group ||
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
u[e][w].visible = w === a ?
|
|
368
|
-
}) : u[e][a].visible =
|
|
369
|
-
}, n = (a = !0,
|
|
370
|
-
clearTimeout(
|
|
371
|
-
},
|
|
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
|
-
},
|
|
377
|
-
|
|
378
|
-
}, m = (a) => (
|
|
369
|
+
}, g = (a) => (v) => {
|
|
370
|
+
v.key === "Escape" && (o(a, !1), h());
|
|
371
|
+
}, m = (a) => (v) => {
|
|
379
372
|
if (!u[e]) return;
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
},
|
|
383
|
-
(u[e]?.[a ?? i]).mouseOverToggle === !0 && ($.value = a ?? i,
|
|
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
|
-
},
|
|
378
|
+
}, D));
|
|
386
379
|
}, l = (a) => {
|
|
387
|
-
(u[e]?.[a ?? i]).mouseOverToggle === !0 && ($.value = null, clearTimeout(
|
|
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
|
-
},
|
|
390
|
-
},
|
|
391
|
-
const
|
|
392
|
-
|
|
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",
|
|
388
|
+
document.removeEventListener("click", m(a)), document.removeEventListener("touchend", m(a)), document.removeEventListener("keydown", g(a));
|
|
396
389
|
});
|
|
397
390
|
};
|
|
398
|
-
|
|
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 _ =
|
|
398
|
+
const _ = p(() => t.id ? {
|
|
406
399
|
"data-toggle": `visibility-${i}`,
|
|
407
|
-
onClick: () => n(!
|
|
400
|
+
onClick: () => n(!s(i))
|
|
408
401
|
} : {});
|
|
409
402
|
return {
|
|
410
403
|
visibilityState: u,
|
|
411
404
|
create: b,
|
|
412
405
|
setState: o,
|
|
413
|
-
isVisible:
|
|
414
|
-
onMouseEnter:
|
|
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
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
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
|
};
|