@theh0n/ui 1.1.1 → 1.1.4
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/README.md +1 -1
- package/dist/components/Skeleton.d.ts +16 -0
- package/dist/components/Tabs.d.ts +37 -0
- package/dist/composables/useWebDialog.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +515 -324
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import './index.css';const
|
|
1
|
+
import { defineComponent as I, ref as O, computed as y, openBlock as l, createElementBlock as u, normalizeClass as k, Fragment as Z, renderList as ae, createElementVNode as m, renderSlot as C, toDisplayString as x, createCommentVNode as b, createVNode as A, Transition as q, withCtx as H, withDirectives as he, vShow as ve, watch as E, shallowRef as ie, createBlock as V, Teleport as J, unref as _, normalizeStyle as R, resolveDynamicComponent as K, normalizeProps as me, mergeProps as X, createTextVNode as j, onMounted as G, onUnmounted as ye, withModifiers as F, onBeforeUnmount as pe, nextTick as ge } from "vue";
|
|
2
|
+
import './index.css';const te = {
|
|
3
3
|
colors: {
|
|
4
4
|
primary: "#171f2a",
|
|
5
5
|
secondary: "#202a38",
|
|
@@ -18,21 +18,21 @@ import './index.css';const U = {
|
|
|
18
18
|
fontFamily: '"Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif',
|
|
19
19
|
focusRingColor: "rgba(79, 70, 229, 0.4)"
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function _e(e) {
|
|
22
22
|
if (!e)
|
|
23
|
-
return
|
|
24
|
-
const n =
|
|
25
|
-
return
|
|
23
|
+
return ne(te);
|
|
24
|
+
const n = ne(te);
|
|
25
|
+
return le(n, e);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function be(e) {
|
|
28
28
|
if (typeof window > "u" || typeof document > "u")
|
|
29
29
|
return;
|
|
30
|
-
const n = document.documentElement, t =
|
|
31
|
-
Object.entries(t).forEach(([
|
|
32
|
-
n.style.setProperty(
|
|
30
|
+
const n = document.documentElement, t = ke(e);
|
|
31
|
+
Object.entries(t).forEach(([r, o]) => {
|
|
32
|
+
n.style.setProperty(r, o);
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function ke(e) {
|
|
36
36
|
return {
|
|
37
37
|
"--h0n-primary": e.colors.primary,
|
|
38
38
|
"--h0n-secondary": e.colors.secondary,
|
|
@@ -49,28 +49,28 @@ function he(e) {
|
|
|
49
49
|
"--h0n-focus-ring": e.focusRingColor
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function le(e, n) {
|
|
53
53
|
const t = Array.isArray(e) ? [...e] : { ...e };
|
|
54
|
-
return n && Object.entries(n).forEach(([
|
|
54
|
+
return n && Object.entries(n).forEach(([r, o]) => {
|
|
55
55
|
if (o === void 0)
|
|
56
56
|
return;
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
const v = e[r];
|
|
58
|
+
oe(v) && oe(o) ? t[r] = le(
|
|
59
|
+
v,
|
|
60
60
|
o
|
|
61
|
-
) : t[
|
|
61
|
+
) : t[r] = o;
|
|
62
62
|
}), t;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function ne(e) {
|
|
65
65
|
return JSON.parse(JSON.stringify(e));
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function oe(e) {
|
|
68
68
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const $e = ["disabled", "aria-expanded", "aria-controls", "onClick"], we = { class: "h0n-ui-accordion__title" }, Ce = { class: "h0n-ui-accordion__title-text" }, xe = {
|
|
71
71
|
key: 0,
|
|
72
72
|
class: "h0n-ui-accordion__badge"
|
|
73
|
-
},
|
|
73
|
+
}, Oe = ["id", "aria-label"], Ie = { class: "h0n-ui-accordion__body-inner" }, Se = { key: 0 }, Be = /* @__PURE__ */ I({
|
|
74
74
|
__name: "Accordion",
|
|
75
75
|
props: {
|
|
76
76
|
items: { default: () => [] },
|
|
@@ -81,90 +81,90 @@ const ye = ["disabled", "aria-expanded", "aria-controls", "onClick"], pe = { cla
|
|
|
81
81
|
},
|
|
82
82
|
emits: ["update:modelValue", "toggle"],
|
|
83
83
|
setup(e, { emit: n }) {
|
|
84
|
-
const t = e,
|
|
84
|
+
const t = e, r = n;
|
|
85
85
|
function o(a) {
|
|
86
86
|
return a == null ? [] : Array.isArray(a) ? t.multiple ? a : a.slice(0, 1) : [a];
|
|
87
87
|
}
|
|
88
|
-
const
|
|
89
|
-
() => t.modelValue !== void 0 ? o(t.modelValue) :
|
|
90
|
-
),
|
|
88
|
+
const v = O(o(t.defaultOpen)), f = y(
|
|
89
|
+
() => t.modelValue !== void 0 ? o(t.modelValue) : v.value
|
|
90
|
+
), h = y(() => new Set(f.value));
|
|
91
91
|
function d(a) {
|
|
92
|
-
return
|
|
92
|
+
return h.value.has(a);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
t.modelValue === void 0 && (
|
|
94
|
+
function c(a) {
|
|
95
|
+
t.modelValue === void 0 && (v.value = a), r("update:modelValue", t.multiple ? a : a[0] ?? null);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
const
|
|
97
|
+
function p(a) {
|
|
98
|
+
const i = [...f.value];
|
|
99
99
|
if (t.multiple) {
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
|
|
100
|
+
const w = new Set(i);
|
|
101
|
+
w.has(a) ? w.delete(a) : w.add(a);
|
|
102
|
+
const B = Array.from(w);
|
|
103
|
+
c(B), r("toggle", { id: a, open: w.has(a) });
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
const
|
|
107
|
-
|
|
106
|
+
const s = i[0] === a;
|
|
107
|
+
c(s ? [] : [a]), r("toggle", { id: a, open: !s });
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function S(a) {
|
|
110
110
|
return `h0n-ui-accordion-body-${String(a)}`;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function T(a) {
|
|
113
113
|
return a.querySelector(".h0n-ui-accordion__body-inner");
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
function L(a) {
|
|
116
|
+
const i = a, s = T(i);
|
|
117
|
+
s && (i.style.height = "0px", i.style.opacity = "0", requestAnimationFrame(() => {
|
|
118
|
+
i.style.height = `${s.scrollHeight}px`, i.style.opacity = "1";
|
|
119
119
|
}));
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
const
|
|
123
|
-
|
|
121
|
+
function P(a) {
|
|
122
|
+
const i = a;
|
|
123
|
+
i.style.height = "auto", i.style.opacity = "";
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
function D(a) {
|
|
126
|
+
const i = a, s = T(i);
|
|
127
|
+
s && (i.style.height = `${s.scrollHeight}px`, i.style.opacity = "1", i.offsetHeight, requestAnimationFrame(() => {
|
|
128
|
+
i.style.height = "0px", i.style.opacity = "0";
|
|
129
129
|
}));
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
const
|
|
133
|
-
|
|
131
|
+
function g(a) {
|
|
132
|
+
const i = a;
|
|
133
|
+
i.style.height = "", i.style.opacity = "";
|
|
134
134
|
}
|
|
135
|
-
return (a,
|
|
135
|
+
return (a, i) => (l(), u("div", {
|
|
136
136
|
class: k(["h0n-ui-accordion", { "is-compact": e.compact }])
|
|
137
137
|
}, [
|
|
138
|
-
(
|
|
139
|
-
key:
|
|
138
|
+
(l(!0), u(Z, null, ae(e.items, (s) => (l(), u("div", {
|
|
139
|
+
key: s.id,
|
|
140
140
|
class: k(["h0n-ui-accordion__item", {
|
|
141
|
-
"is-open": d(
|
|
142
|
-
"is-disabled": !!
|
|
141
|
+
"is-open": d(s.id),
|
|
142
|
+
"is-disabled": !!s.disabled
|
|
143
143
|
}])
|
|
144
144
|
}, [
|
|
145
|
-
|
|
145
|
+
m("button", {
|
|
146
146
|
class: "h0n-ui-accordion__header",
|
|
147
147
|
type: "button",
|
|
148
|
-
disabled:
|
|
149
|
-
"aria-expanded": d(
|
|
150
|
-
"aria-controls":
|
|
151
|
-
onClick: (
|
|
148
|
+
disabled: s.disabled,
|
|
149
|
+
"aria-expanded": d(s.id) ? "true" : "false",
|
|
150
|
+
"aria-controls": S(s.id),
|
|
151
|
+
onClick: ($) => p(s.id)
|
|
152
152
|
}, [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
item:
|
|
156
|
-
open: d(
|
|
153
|
+
m("span", we, [
|
|
154
|
+
C(a.$slots, "header", {
|
|
155
|
+
item: s,
|
|
156
|
+
open: d(s.id)
|
|
157
157
|
}, () => [
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
m("span", Ce, x(s.title), 1),
|
|
159
|
+
s.badge ? (l(), u("span", xe, x(s.badge), 1)) : b("", !0)
|
|
160
160
|
])
|
|
161
161
|
]),
|
|
162
|
-
|
|
162
|
+
i[0] || (i[0] = m("svg", {
|
|
163
163
|
class: "h0n-ui-accordion__chevron",
|
|
164
164
|
viewBox: "0 0 20 20",
|
|
165
165
|
"aria-hidden": "true"
|
|
166
166
|
}, [
|
|
167
|
-
|
|
167
|
+
m("path", {
|
|
168
168
|
d: "M5 7.5L10 12.5L15 7.5",
|
|
169
169
|
fill: "none",
|
|
170
170
|
stroke: "currentColor",
|
|
@@ -173,31 +173,31 @@ const ye = ["disabled", "aria-expanded", "aria-controls", "onClick"], pe = { cla
|
|
|
173
173
|
"stroke-linejoin": "round"
|
|
174
174
|
})
|
|
175
175
|
], -1))
|
|
176
|
-
], 8,
|
|
177
|
-
A(
|
|
176
|
+
], 8, $e),
|
|
177
|
+
A(q, {
|
|
178
178
|
name: "h0n-ui-accordion",
|
|
179
|
-
onEnter:
|
|
180
|
-
onAfterEnter:
|
|
181
|
-
onLeave:
|
|
182
|
-
onAfterLeave:
|
|
179
|
+
onEnter: L,
|
|
180
|
+
onAfterEnter: P,
|
|
181
|
+
onLeave: D,
|
|
182
|
+
onAfterLeave: g
|
|
183
183
|
}, {
|
|
184
|
-
default:
|
|
185
|
-
|
|
184
|
+
default: H(() => [
|
|
185
|
+
he(m("div", {
|
|
186
186
|
class: "h0n-ui-accordion__body",
|
|
187
|
-
id:
|
|
187
|
+
id: S(s.id),
|
|
188
188
|
role: "region",
|
|
189
|
-
"aria-label":
|
|
189
|
+
"aria-label": s.title
|
|
190
190
|
}, [
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
item:
|
|
194
|
-
open: d(
|
|
191
|
+
m("div", Ie, [
|
|
192
|
+
C(a.$slots, "body", {
|
|
193
|
+
item: s,
|
|
194
|
+
open: d(s.id)
|
|
195
195
|
}, () => [
|
|
196
|
-
|
|
196
|
+
s.body ? (l(), u("p", Se, x(s.body), 1)) : b("", !0)
|
|
197
197
|
])
|
|
198
198
|
])
|
|
199
|
-
], 8,
|
|
200
|
-
[
|
|
199
|
+
], 8, Oe), [
|
|
200
|
+
[ve, d(s.id)]
|
|
201
201
|
])
|
|
202
202
|
]),
|
|
203
203
|
_: 2
|
|
@@ -206,64 +206,64 @@ const ye = ["disabled", "aria-expanded", "aria-controls", "onClick"], pe = { cla
|
|
|
206
206
|
], 2));
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
|
-
function
|
|
209
|
+
function Q() {
|
|
210
210
|
return typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : Date.now().toString(36) + Math.random().toString(36).slice(2, 10);
|
|
211
211
|
}
|
|
212
|
-
const
|
|
213
|
-
function
|
|
214
|
-
const e =
|
|
215
|
-
function n(
|
|
216
|
-
return
|
|
212
|
+
const se = 1e4, z = O([]);
|
|
213
|
+
function N() {
|
|
214
|
+
const e = y(() => z.value.at(-1) ?? null);
|
|
215
|
+
function n(h) {
|
|
216
|
+
return z.value.findIndex((d) => d.id === h);
|
|
217
217
|
}
|
|
218
|
-
function t(
|
|
219
|
-
const d = n(
|
|
220
|
-
return d === -1 ?
|
|
218
|
+
function t(h) {
|
|
219
|
+
const d = n(h);
|
|
220
|
+
return d === -1 ? se : se + d * 2;
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
return t(
|
|
222
|
+
function r(h) {
|
|
223
|
+
return t(h) + 1;
|
|
224
224
|
}
|
|
225
|
-
function o(
|
|
226
|
-
const d =
|
|
227
|
-
return
|
|
225
|
+
function o(h) {
|
|
226
|
+
const d = h.id ?? Q();
|
|
227
|
+
return v(d), z.value.push({
|
|
228
228
|
showOverlay: !0,
|
|
229
229
|
closeOnOverlay: !0,
|
|
230
230
|
closeOnEsc: !0,
|
|
231
|
-
...
|
|
231
|
+
...h,
|
|
232
232
|
id: d
|
|
233
233
|
}), d;
|
|
234
234
|
}
|
|
235
|
-
function h
|
|
236
|
-
const d = n(
|
|
237
|
-
d !== -1 &&
|
|
235
|
+
function v(h) {
|
|
236
|
+
const d = n(h);
|
|
237
|
+
d !== -1 && z.value.splice(d, 1);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function f() {
|
|
240
240
|
e.value?.onRequestClose?.();
|
|
241
241
|
}
|
|
242
|
-
return
|
|
243
|
-
() =>
|
|
244
|
-
(
|
|
245
|
-
document.documentElement.classList.toggle("no-scroll",
|
|
242
|
+
return E(
|
|
243
|
+
() => z.value.length,
|
|
244
|
+
(h) => {
|
|
245
|
+
document.documentElement.classList.toggle("no-scroll", h > 0);
|
|
246
246
|
},
|
|
247
247
|
{ immediate: !0 }
|
|
248
248
|
), {
|
|
249
|
-
stack:
|
|
249
|
+
stack: z,
|
|
250
250
|
top: e,
|
|
251
251
|
push: o,
|
|
252
|
-
remove:
|
|
253
|
-
requestCloseTop:
|
|
252
|
+
remove: v,
|
|
253
|
+
requestCloseTop: f,
|
|
254
254
|
getBackdropZIndex: t,
|
|
255
|
-
getContentZIndex:
|
|
255
|
+
getContentZIndex: r
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
const
|
|
259
|
-
let
|
|
260
|
-
function
|
|
261
|
-
const e =
|
|
262
|
-
function n(
|
|
258
|
+
const M = ie(null);
|
|
259
|
+
let W = null;
|
|
260
|
+
function Re() {
|
|
261
|
+
const e = N();
|
|
262
|
+
function n(r) {
|
|
263
263
|
return new Promise((o) => {
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
id:
|
|
264
|
+
const v = Q();
|
|
265
|
+
W = o, M.value = { ...r, id: v }, e.push({
|
|
266
|
+
id: v,
|
|
267
267
|
showOverlay: !0,
|
|
268
268
|
closeOnOverlay: !0,
|
|
269
269
|
closeOnEsc: !0,
|
|
@@ -271,67 +271,67 @@ function ke() {
|
|
|
271
271
|
});
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
|
-
function t(
|
|
275
|
-
if (!
|
|
276
|
-
const o =
|
|
277
|
-
|
|
274
|
+
function t(r) {
|
|
275
|
+
if (!M.value) return;
|
|
276
|
+
const o = M.value.id;
|
|
277
|
+
M.value = null, e.remove(o), W?.(r), W = null;
|
|
278
278
|
}
|
|
279
279
|
return {
|
|
280
|
-
active:
|
|
280
|
+
active: M,
|
|
281
281
|
open: n,
|
|
282
282
|
close: t
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
|
-
const
|
|
285
|
+
const Te = {
|
|
286
286
|
class: "h0n-alert",
|
|
287
287
|
role: "dialog",
|
|
288
288
|
"aria-modal": "true"
|
|
289
|
-
},
|
|
289
|
+
}, Le = {
|
|
290
290
|
key: 0,
|
|
291
291
|
class: "h0n-alert__header"
|
|
292
|
-
},
|
|
292
|
+
}, ze = { class: "h0n-alert__title" }, Ee = { class: "h0n-alert__body" }, Ve = { key: 1 }, Ae = /* @__PURE__ */ I({
|
|
293
293
|
__name: "Alert",
|
|
294
294
|
setup(e) {
|
|
295
|
-
const { active: n, close: t } =
|
|
296
|
-
() => n.value ?
|
|
295
|
+
const { active: n, close: t } = Re(), { getContentZIndex: r } = N(), o = () => t(!0), v = () => t(!1), f = () => t(!0), h = y(() => n.value?.type === "info"), d = y(
|
|
296
|
+
() => n.value ? r(n.value.id) : void 0
|
|
297
297
|
);
|
|
298
|
-
return (
|
|
299
|
-
A(
|
|
298
|
+
return (c, p) => (l(), V(J, { to: "body" }, [
|
|
299
|
+
A(q, {
|
|
300
300
|
name: "h0n-alert-scale",
|
|
301
301
|
appear: ""
|
|
302
302
|
}, {
|
|
303
|
-
default:
|
|
304
|
-
|
|
303
|
+
default: H(() => [
|
|
304
|
+
_(n) ? (l(), u("div", {
|
|
305
305
|
key: 0,
|
|
306
306
|
class: "h0n-alert-layer",
|
|
307
|
-
style:
|
|
307
|
+
style: R({ zIndex: d.value })
|
|
308
308
|
}, [
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
309
|
+
m("section", Te, [
|
|
310
|
+
_(n).title || c.$slots.header ? (l(), u("header", Le, [
|
|
311
|
+
C(c.$slots, "header", {}, () => [
|
|
312
|
+
m("h4", ze, x(_(n).title), 1)
|
|
313
313
|
], !0)
|
|
314
|
-
])) :
|
|
315
|
-
|
|
316
|
-
|
|
314
|
+
])) : b("", !0),
|
|
315
|
+
m("div", Ee, [
|
|
316
|
+
_(n).component ? (l(), V(K(_(n).component), me(X({ key: 0 }, _(n).props)), null, 16)) : _(n).message ? (l(), u("p", Ve, x(_(n).message), 1)) : b("", !0)
|
|
317
317
|
]),
|
|
318
|
-
|
|
319
|
-
class: k(["h0n-alert__actions", { "is-single":
|
|
318
|
+
m("footer", {
|
|
319
|
+
class: k(["h0n-alert__actions", { "is-single": h.value }])
|
|
320
320
|
}, [
|
|
321
|
-
|
|
321
|
+
h.value ? (l(), u("button", {
|
|
322
322
|
key: 0,
|
|
323
323
|
class: "h0n-alert__btn h0n-alert__btn--primary",
|
|
324
324
|
type: "button",
|
|
325
|
-
onClick:
|
|
326
|
-
}, " Ok ")) : (
|
|
327
|
-
|
|
325
|
+
onClick: f
|
|
326
|
+
}, " Ok ")) : (l(), u(Z, { key: 1 }, [
|
|
327
|
+
m("button", {
|
|
328
328
|
class: "h0n-alert__btn is-danger",
|
|
329
329
|
type: "button",
|
|
330
|
-
onClick:
|
|
330
|
+
onClick: v
|
|
331
331
|
}, " Cancel "),
|
|
332
|
-
|
|
332
|
+
m("button", {
|
|
333
333
|
class: k(["h0n-alert__btn h0n-alert__btn--primary", {
|
|
334
|
-
"is-danger":
|
|
334
|
+
"is-danger": _(n).type === "danger"
|
|
335
335
|
}]),
|
|
336
336
|
type: "button",
|
|
337
337
|
onClick: o
|
|
@@ -339,18 +339,18 @@ const Ce = {
|
|
|
339
339
|
], 64))
|
|
340
340
|
], 2)
|
|
341
341
|
])
|
|
342
|
-
], 4)) :
|
|
342
|
+
], 4)) : b("", !0)
|
|
343
343
|
]),
|
|
344
344
|
_: 3
|
|
345
345
|
})
|
|
346
346
|
]));
|
|
347
347
|
}
|
|
348
|
-
}),
|
|
348
|
+
}), He = (e, n) => {
|
|
349
349
|
const t = e.__vccOpts || e;
|
|
350
|
-
for (const [
|
|
351
|
-
t[
|
|
350
|
+
for (const [r, o] of n)
|
|
351
|
+
t[r] = o;
|
|
352
352
|
return t;
|
|
353
|
-
},
|
|
353
|
+
}, Pe = /* @__PURE__ */ He(Ae, [["__scopeId", "data-v-290cad87"]]), re = /* @__PURE__ */ I({
|
|
354
354
|
__name: "Spinner",
|
|
355
355
|
props: {
|
|
356
356
|
size: {},
|
|
@@ -358,26 +358,26 @@ const Ce = {
|
|
|
358
358
|
},
|
|
359
359
|
setup(e) {
|
|
360
360
|
const t = e.size ?? "md";
|
|
361
|
-
return (
|
|
362
|
-
class: k(["h0n-ui-spinner", [`h0n-ui-spinner--${
|
|
361
|
+
return (r, o) => (l(), u("div", {
|
|
362
|
+
class: k(["h0n-ui-spinner", [`h0n-ui-spinner--${_(t)}`, e.color]]),
|
|
363
363
|
role: "status",
|
|
364
364
|
"aria-label": "Loading"
|
|
365
365
|
}, null, 2));
|
|
366
366
|
}
|
|
367
|
-
}),
|
|
367
|
+
}), De = ["type", "disabled", "aria-busy"], Me = {
|
|
368
368
|
key: 0,
|
|
369
369
|
class: "h0n-ui-btn__icon h0n-ui-btn__icon--left"
|
|
370
|
-
},
|
|
370
|
+
}, Ue = {
|
|
371
371
|
key: 1,
|
|
372
372
|
class: "h0n-ui-btn__label"
|
|
373
|
-
},
|
|
373
|
+
}, qe = {
|
|
374
374
|
key: 2,
|
|
375
375
|
class: "h0n-ui-btn__spinner",
|
|
376
376
|
"aria-hidden": "true"
|
|
377
|
-
},
|
|
377
|
+
}, Ne = {
|
|
378
378
|
key: 3,
|
|
379
379
|
class: "h0n-ui-btn__icon h0n-ui-btn__icon--right"
|
|
380
|
-
},
|
|
380
|
+
}, je = /* @__PURE__ */ I({
|
|
381
381
|
__name: "Button",
|
|
382
382
|
props: {
|
|
383
383
|
text: {},
|
|
@@ -394,74 +394,74 @@ const Ce = {
|
|
|
394
394
|
},
|
|
395
395
|
emits: ["click", "done", "error"],
|
|
396
396
|
setup(e, { emit: n }) {
|
|
397
|
-
const t = e,
|
|
398
|
-
() =>
|
|
397
|
+
const t = e, r = n, o = O(!1), v = y(() => t.loading !== void 0), f = y(
|
|
398
|
+
() => v.value ? !!t.loading : o.value
|
|
399
399
|
);
|
|
400
|
-
function
|
|
401
|
-
|
|
400
|
+
function h(c) {
|
|
401
|
+
v.value || (o.value = c);
|
|
402
402
|
}
|
|
403
|
-
async function d(
|
|
404
|
-
if (!(t.disabled ||
|
|
403
|
+
async function d(c) {
|
|
404
|
+
if (!(t.disabled || f.value) && (r("click", c), !!t.action))
|
|
405
405
|
try {
|
|
406
|
-
|
|
407
|
-
} catch (
|
|
408
|
-
|
|
406
|
+
h(!0), await t.action(), r("done");
|
|
407
|
+
} catch (p) {
|
|
408
|
+
r("error", p);
|
|
409
409
|
} finally {
|
|
410
|
-
|
|
410
|
+
h(!1);
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
return (
|
|
413
|
+
return (c, p) => (l(), u("button", {
|
|
414
414
|
class: k(["h0n-ui-btn", [
|
|
415
415
|
`h0n-ui-btn--${e.variant}`,
|
|
416
416
|
`h0n-ui-btn--${e.size}`,
|
|
417
417
|
`h0n-ui-btn--text-${e.position}`,
|
|
418
418
|
{
|
|
419
|
-
"h0n-ui-btn--loading":
|
|
419
|
+
"h0n-ui-btn--loading": f.value,
|
|
420
420
|
"h0n-ui-btn--pill": e.pill,
|
|
421
421
|
"h0n-ui-btn--radius": e.border,
|
|
422
422
|
"h0n-ui-btn--block": e.block
|
|
423
423
|
}
|
|
424
424
|
]]),
|
|
425
425
|
type: e.type,
|
|
426
|
-
disabled: e.disabled ||
|
|
427
|
-
"aria-busy":
|
|
426
|
+
disabled: e.disabled || f.value,
|
|
427
|
+
"aria-busy": f.value ? "true" : void 0,
|
|
428
428
|
onClick: d
|
|
429
429
|
}, [
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
])) :
|
|
433
|
-
|
|
434
|
-
A(
|
|
435
|
-
])) : (
|
|
436
|
-
|
|
437
|
-
|
|
430
|
+
c.$slots.left && !f.value ? (l(), u("span", Me, [
|
|
431
|
+
C(c.$slots, "left")
|
|
432
|
+
])) : b("", !0),
|
|
433
|
+
f.value ? (l(), u("span", qe, [
|
|
434
|
+
A(re, { size: "sm" })
|
|
435
|
+
])) : (l(), u("span", Ue, [
|
|
436
|
+
C(c.$slots, "default", {}, () => [
|
|
437
|
+
j(x(e.text), 1)
|
|
438
438
|
])
|
|
439
439
|
])),
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
])) :
|
|
443
|
-
], 10,
|
|
440
|
+
c.$slots.right && !f.value ? (l(), u("span", Ne, [
|
|
441
|
+
C(c.$slots, "right")
|
|
442
|
+
])) : b("", !0)
|
|
443
|
+
], 10, De));
|
|
444
444
|
}
|
|
445
|
-
}),
|
|
445
|
+
}), Fe = { class: "h0n-ui-card" }, We = {
|
|
446
446
|
key: 0,
|
|
447
447
|
class: "h0n-ui-card--title"
|
|
448
|
-
},
|
|
448
|
+
}, Ze = /* @__PURE__ */ I({
|
|
449
449
|
__name: "Card",
|
|
450
450
|
props: {
|
|
451
451
|
title: {}
|
|
452
452
|
},
|
|
453
453
|
setup(e) {
|
|
454
|
-
return (n, t) => (
|
|
455
|
-
e.title ? (
|
|
456
|
-
|
|
454
|
+
return (n, t) => (l(), u("section", Fe, [
|
|
455
|
+
e.title ? (l(), u("p", We, x(e.title), 1)) : b("", !0),
|
|
456
|
+
C(n.$slots, "default")
|
|
457
457
|
]));
|
|
458
458
|
}
|
|
459
|
-
}),
|
|
460
|
-
function
|
|
461
|
-
const e =
|
|
462
|
-
function n(
|
|
463
|
-
const o =
|
|
464
|
-
|
|
459
|
+
}), U = ie(null);
|
|
460
|
+
function Je() {
|
|
461
|
+
const e = N();
|
|
462
|
+
function n(r) {
|
|
463
|
+
const o = Q();
|
|
464
|
+
U.value = { ...r, id: o }, e.push({
|
|
465
465
|
id: o,
|
|
466
466
|
showOverlay: !0,
|
|
467
467
|
closeOnOverlay: !0,
|
|
@@ -470,83 +470,140 @@ function Me() {
|
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
function t() {
|
|
473
|
-
|
|
473
|
+
U.value && (e.remove(U.value.id), U.value = null);
|
|
474
474
|
}
|
|
475
475
|
return {
|
|
476
|
-
active:
|
|
476
|
+
active: U,
|
|
477
477
|
open: n,
|
|
478
478
|
close: t
|
|
479
479
|
};
|
|
480
480
|
}
|
|
481
|
-
const
|
|
481
|
+
const Ke = { class: "content-title-dialog" }, Xe = {
|
|
482
482
|
key: 0,
|
|
483
483
|
class: "title-dialog"
|
|
484
|
-
},
|
|
484
|
+
}, Ge = {
|
|
485
|
+
key: 0,
|
|
486
|
+
class: "h0n-dialog-bg-hero"
|
|
487
|
+
}, Qe = { class: "h0n-dialog-content" }, Ye = /* @__PURE__ */ I({
|
|
485
488
|
__name: "Dialog",
|
|
486
489
|
setup(e) {
|
|
487
|
-
const { active: n, close: t } =
|
|
488
|
-
|
|
490
|
+
const { active: n, close: t } = Je(), { getContentZIndex: r } = N(), o = O("bottom");
|
|
491
|
+
E(
|
|
489
492
|
() => n.value?.side,
|
|
490
|
-
(
|
|
491
|
-
|
|
493
|
+
(g) => {
|
|
494
|
+
g && (o.value = g);
|
|
492
495
|
},
|
|
493
496
|
{ immediate: !0 }
|
|
494
497
|
);
|
|
495
|
-
const
|
|
496
|
-
() => n.value ?
|
|
497
|
-
);
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
498
|
+
const v = y(() => `h0n-slide-${o.value}`), f = y(
|
|
499
|
+
() => n.value ? r(n.value.id) : void 0
|
|
500
|
+
), h = y(() => n.value?.backgroundUrl?.trim() ?? ""), d = O(""), c = /* @__PURE__ */ new Set();
|
|
501
|
+
let p = 0;
|
|
502
|
+
const S = y(() => h.value.length > 0), T = y(
|
|
503
|
+
() => d.value.length > 0
|
|
504
|
+
), L = (g) => new Promise((a) => {
|
|
505
|
+
setTimeout(a, g);
|
|
506
|
+
}), P = (g) => new Promise((a, i) => {
|
|
507
|
+
const s = new Image();
|
|
508
|
+
s.decoding = "async", s.fetchPriority = "low", s.onload = async () => {
|
|
509
|
+
try {
|
|
510
|
+
typeof s.decode == "function" && await s.decode();
|
|
511
|
+
} catch {
|
|
512
|
+
}
|
|
513
|
+
a();
|
|
514
|
+
}, s.onerror = () => {
|
|
515
|
+
i(new Error("Failed to load dialog background image"));
|
|
516
|
+
}, s.src = g;
|
|
517
|
+
}), D = y(() => T.value ? {
|
|
518
|
+
"--h0n-dialog-bg-image": `url("${d.value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}")`
|
|
519
|
+
} : void 0);
|
|
520
|
+
return E(
|
|
521
|
+
h,
|
|
522
|
+
async (g, a, i) => {
|
|
523
|
+
const s = ++p;
|
|
524
|
+
let $ = !1;
|
|
525
|
+
if (i(() => {
|
|
526
|
+
$ = !0;
|
|
527
|
+
}), d.value = "", !!g) {
|
|
528
|
+
if (c.has(g)) {
|
|
529
|
+
d.value = g;
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
if (await L(140), !($ || s !== p))
|
|
533
|
+
try {
|
|
534
|
+
if (await P(g), $ || s !== p) return;
|
|
535
|
+
c.add(g), d.value = g;
|
|
536
|
+
} catch {
|
|
537
|
+
if ($ || s !== p) return;
|
|
538
|
+
d.value = "";
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
{ immediate: !0 }
|
|
543
|
+
), (g, a) => (l(), V(J, { to: "body" }, [
|
|
544
|
+
A(q, {
|
|
545
|
+
name: v.value,
|
|
501
546
|
appear: ""
|
|
502
547
|
}, {
|
|
503
|
-
default:
|
|
504
|
-
|
|
548
|
+
default: H(() => [
|
|
549
|
+
_(n) ? (l(), u("div", {
|
|
505
550
|
key: 0,
|
|
506
551
|
class: k(["h0n-dialog-layer", `is-${o.value}`]),
|
|
507
|
-
style:
|
|
552
|
+
style: R({ zIndex: f.value })
|
|
508
553
|
}, [
|
|
509
|
-
|
|
510
|
-
class: k(["h0n-dialog-panel",
|
|
554
|
+
m("section", {
|
|
555
|
+
class: k(["h0n-dialog-panel", [
|
|
556
|
+
`is-${_(n).side}`,
|
|
557
|
+
{ "has-background-image": S.value }
|
|
558
|
+
]]),
|
|
559
|
+
style: R(D.value)
|
|
511
560
|
}, [
|
|
512
|
-
|
|
513
|
-
class: k(["h0n-dialog-header",
|
|
561
|
+
m("header", {
|
|
562
|
+
class: k(["h0n-dialog-header", [
|
|
563
|
+
`is-${_(n).side}`,
|
|
564
|
+
{ "has-background-image": S.value }
|
|
565
|
+
]])
|
|
514
566
|
}, [
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
567
|
+
m("div", Ke, [
|
|
568
|
+
_(n).title ? (l(), u("p", Xe, x(_(n).title), 1)) : b("", !0),
|
|
569
|
+
C(g.$slots, "dialogHeader")
|
|
518
570
|
]),
|
|
519
|
-
|
|
571
|
+
m("button", {
|
|
520
572
|
class: "h0n-dialog-close",
|
|
521
|
-
onClick:
|
|
573
|
+
onClick: a[0] || (a[0] = (i) => _(t)())
|
|
522
574
|
}, " x ")
|
|
523
575
|
], 2),
|
|
524
|
-
|
|
525
|
-
(
|
|
576
|
+
S.value ? (l(), u("div", Ge, [
|
|
577
|
+
m("div", {
|
|
578
|
+
class: k(["h0n-dialog-bg-image", { "is-loaded": T.value }])
|
|
579
|
+
}, null, 2)
|
|
580
|
+
])) : b("", !0),
|
|
581
|
+
m("div", Qe, [
|
|
582
|
+
(l(), V(K(_(n).component), X(_(n).props, { onClose: _(t) }), null, 16, ["onClose"]))
|
|
526
583
|
])
|
|
527
|
-
],
|
|
528
|
-
], 6)) :
|
|
584
|
+
], 6)
|
|
585
|
+
], 6)) : b("", !0)
|
|
529
586
|
]),
|
|
530
587
|
_: 3
|
|
531
588
|
}, 8, ["name"])
|
|
532
589
|
]));
|
|
533
590
|
}
|
|
534
|
-
}),
|
|
591
|
+
}), et = { class: "h0n-ui-menu-item__left" }, tt = {
|
|
535
592
|
key: 0,
|
|
536
593
|
class: "h0n-ui-menu-item__icon"
|
|
537
|
-
},
|
|
594
|
+
}, nt = { class: "h0n-ui-menu-item__text" }, ot = {
|
|
538
595
|
key: 0,
|
|
539
596
|
class: "h0n-ui-menu-item__desc"
|
|
540
|
-
},
|
|
597
|
+
}, st = {
|
|
541
598
|
key: 0,
|
|
542
599
|
class: "h0n-ui-menu-item__right"
|
|
543
|
-
},
|
|
600
|
+
}, at = {
|
|
544
601
|
key: 0,
|
|
545
602
|
class: "h0n-ui-menu-item__right-text"
|
|
546
|
-
},
|
|
603
|
+
}, it = {
|
|
547
604
|
key: 0,
|
|
548
605
|
class: "h0n-ui-menu-item__chevron"
|
|
549
|
-
},
|
|
606
|
+
}, lt = /* @__PURE__ */ I({
|
|
550
607
|
__name: "Menu",
|
|
551
608
|
props: {
|
|
552
609
|
title: {},
|
|
@@ -561,60 +618,60 @@ const je = { class: "content-title-dialog" }, qe = {
|
|
|
561
618
|
},
|
|
562
619
|
emits: ["click"],
|
|
563
620
|
setup(e, { emit: n }) {
|
|
564
|
-
const t = e,
|
|
621
|
+
const t = e, r = n, o = y(() => !!t.to), v = y(() => t.as ?? (o.value ? "a" : "div")), f = y(() => t.chevron !== void 0 ? t.chevron : o.value), h = y(() => t.disabled ? {
|
|
565
622
|
role: "button",
|
|
566
623
|
tabindex: -1
|
|
567
624
|
} : t.as ? t.to ? { to: t.to } : {} : o.value ? { href: "#" } : { role: "button", tabindex: 0 });
|
|
568
|
-
function d(
|
|
625
|
+
function d(c) {
|
|
569
626
|
if (t.disabled) {
|
|
570
|
-
|
|
627
|
+
c.preventDefault(), c.stopPropagation();
|
|
571
628
|
return;
|
|
572
629
|
}
|
|
573
|
-
!t.as && o.value &&
|
|
630
|
+
!t.as && o.value && c.preventDefault(), r("click", c);
|
|
574
631
|
}
|
|
575
|
-
return (
|
|
632
|
+
return (c, p) => (l(), V(K(v.value), X({ class: "h0n-ui-menu-item" }, h.value, {
|
|
576
633
|
"aria-disabled": e.disabled || void 0,
|
|
577
634
|
onClick: d
|
|
578
635
|
}), {
|
|
579
|
-
default:
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
636
|
+
default: H(() => [
|
|
637
|
+
m("div", et, [
|
|
638
|
+
c.$slots.icon || e.icon ? (l(), u("div", tt, [
|
|
639
|
+
C(c.$slots, "icon", {}, () => [
|
|
640
|
+
j(x(e.icon), 1)
|
|
584
641
|
])
|
|
585
|
-
])) :
|
|
586
|
-
|
|
587
|
-
|
|
642
|
+
])) : b("", !0),
|
|
643
|
+
m("div", nt, [
|
|
644
|
+
m("p", {
|
|
588
645
|
class: k(["h0n-ui-menu-item__title", { "is-danger": e.danger }])
|
|
589
646
|
}, [
|
|
590
|
-
|
|
591
|
-
|
|
647
|
+
C(c.$slots, "title", {}, () => [
|
|
648
|
+
j(x(e.title), 1)
|
|
592
649
|
])
|
|
593
650
|
], 2),
|
|
594
|
-
e.description ||
|
|
595
|
-
|
|
596
|
-
|
|
651
|
+
e.description || c.$slots.description ? (l(), u("p", ot, [
|
|
652
|
+
C(c.$slots, "description", {}, () => [
|
|
653
|
+
j(x(e.description), 1)
|
|
597
654
|
])
|
|
598
|
-
])) :
|
|
655
|
+
])) : b("", !0)
|
|
599
656
|
])
|
|
600
657
|
]),
|
|
601
|
-
e.right ||
|
|
602
|
-
|
|
603
|
-
e.right ? (
|
|
658
|
+
e.right || c.$slots.right || f.value ? (l(), u("div", st, [
|
|
659
|
+
C(c.$slots, "right", {}, () => [
|
|
660
|
+
e.right ? (l(), u("p", at, x(e.right), 1)) : b("", !0)
|
|
604
661
|
]),
|
|
605
|
-
|
|
606
|
-
])) :
|
|
662
|
+
f.value ? (l(), u("span", it, "›")) : b("", !0)
|
|
663
|
+
])) : b("", !0)
|
|
607
664
|
]),
|
|
608
665
|
_: 3
|
|
609
666
|
}, 16, ["aria-disabled"]));
|
|
610
667
|
}
|
|
611
|
-
}),
|
|
668
|
+
}), rt = {
|
|
612
669
|
key: 0,
|
|
613
670
|
class: "h0n-ui-image__loader"
|
|
614
|
-
},
|
|
671
|
+
}, ct = {
|
|
615
672
|
key: 1,
|
|
616
673
|
class: "h0n-ui-image__error"
|
|
617
|
-
},
|
|
674
|
+
}, ut = ["src"], dt = ["src", "alt"], ft = /* @__PURE__ */ I({
|
|
618
675
|
__name: "Image",
|
|
619
676
|
props: {
|
|
620
677
|
src: {},
|
|
@@ -625,110 +682,244 @@ const je = { class: "content-title-dialog" }, qe = {
|
|
|
625
682
|
radius: {}
|
|
626
683
|
},
|
|
627
684
|
setup(e) {
|
|
628
|
-
const n = e, t =
|
|
629
|
-
function
|
|
685
|
+
const n = e, t = O("loading");
|
|
686
|
+
function r() {
|
|
630
687
|
t.value = "loading";
|
|
631
|
-
const
|
|
632
|
-
|
|
688
|
+
const f = new Image();
|
|
689
|
+
f.src = n.src, f.onload = () => {
|
|
633
690
|
t.value = "loaded";
|
|
634
|
-
},
|
|
691
|
+
}, f.onerror = () => {
|
|
635
692
|
t.value = "error";
|
|
636
693
|
};
|
|
637
694
|
}
|
|
638
|
-
|
|
695
|
+
G(() => {
|
|
639
696
|
if (n.lazy && "IntersectionObserver" in window) {
|
|
640
|
-
const
|
|
641
|
-
|
|
697
|
+
const f = new IntersectionObserver(([h]) => {
|
|
698
|
+
h.isIntersecting && (r(), f.disconnect());
|
|
642
699
|
});
|
|
643
|
-
|
|
700
|
+
f.observe(document.body);
|
|
644
701
|
} else
|
|
645
|
-
|
|
646
|
-
}),
|
|
647
|
-
const o =
|
|
702
|
+
r();
|
|
703
|
+
}), E(() => n.src, r);
|
|
704
|
+
const o = y(() => ({
|
|
648
705
|
borderRadius: typeof n.radius == "number" ? `${n.radius}px` : n.radius
|
|
649
|
-
})),
|
|
706
|
+
})), v = y(() => ({
|
|
650
707
|
objectFit: n.fit
|
|
651
708
|
}));
|
|
652
|
-
return (
|
|
709
|
+
return (f, h) => (l(), u("div", {
|
|
653
710
|
class: k(["h0n-ui-image", t.value]),
|
|
654
|
-
style:
|
|
711
|
+
style: R(o.value)
|
|
655
712
|
}, [
|
|
656
|
-
t.value === "loading" ? (
|
|
657
|
-
e.fallback ? (
|
|
713
|
+
t.value === "loading" ? (l(), u("div", rt)) : t.value === "error" ? (l(), u("div", ct, [
|
|
714
|
+
e.fallback ? (l(), u("img", {
|
|
658
715
|
key: 0,
|
|
659
716
|
src: e.fallback
|
|
660
|
-
}, null, 8,
|
|
661
|
-
])) : (
|
|
717
|
+
}, null, 8, ut)) : b("", !0)
|
|
718
|
+
])) : (l(), u("img", {
|
|
662
719
|
key: 2,
|
|
663
720
|
src: e.src,
|
|
664
721
|
alt: e.alt,
|
|
665
|
-
style:
|
|
722
|
+
style: R(v.value),
|
|
666
723
|
draggable: "false"
|
|
667
|
-
}, null, 12,
|
|
724
|
+
}, null, 12, dt))
|
|
668
725
|
], 6));
|
|
669
726
|
}
|
|
670
|
-
}),
|
|
727
|
+
}), ht = /* @__PURE__ */ I({
|
|
671
728
|
__name: "Overlay",
|
|
672
729
|
setup(e) {
|
|
673
|
-
const { top: n, getBackdropZIndex: t, requestCloseTop:
|
|
730
|
+
const { top: n, getBackdropZIndex: t, requestCloseTop: r } = N(), o = y(() => !!n.value && n.value.showOverlay !== !1), v = y(() => {
|
|
674
731
|
if (n.value?.id)
|
|
675
732
|
return t(n.value.id);
|
|
676
733
|
});
|
|
677
|
-
function
|
|
734
|
+
function f() {
|
|
678
735
|
}
|
|
679
|
-
function
|
|
680
|
-
const
|
|
681
|
-
!
|
|
736
|
+
function h(c) {
|
|
737
|
+
const p = n.value;
|
|
738
|
+
!p || p.closeOnOverlay === !1 || r();
|
|
682
739
|
}
|
|
683
|
-
function d(
|
|
684
|
-
const
|
|
685
|
-
!
|
|
740
|
+
function d(c) {
|
|
741
|
+
const p = n.value;
|
|
742
|
+
!p || p.closeOnEsc === !1 || c.key === "Escape" && r();
|
|
686
743
|
}
|
|
687
|
-
return
|
|
688
|
-
A(
|
|
689
|
-
default:
|
|
690
|
-
o.value ? (
|
|
744
|
+
return G(() => window.addEventListener("keydown", d)), ye(() => window.removeEventListener("keydown", d)), (c, p) => (l(), V(J, { to: "body" }, [
|
|
745
|
+
A(q, { name: "h0n-ui-fade" }, {
|
|
746
|
+
default: H(() => [
|
|
747
|
+
o.value ? (l(), u("div", {
|
|
691
748
|
key: 0,
|
|
692
749
|
class: "h0n-ui-overlay",
|
|
693
|
-
style:
|
|
694
|
-
onPointerdown:
|
|
695
|
-
onPointerup:
|
|
696
|
-
onClick:
|
|
697
|
-
}, null, 36)) :
|
|
750
|
+
style: R({ zIndex: v.value }),
|
|
751
|
+
onPointerdown: F(f, ["self", "prevent", "stop"]),
|
|
752
|
+
onPointerup: F(f, ["self", "prevent", "stop"]),
|
|
753
|
+
onClick: F(h, ["self", "prevent", "stop"])
|
|
754
|
+
}, null, 36)) : b("", !0)
|
|
698
755
|
]),
|
|
699
756
|
_: 1
|
|
700
757
|
})
|
|
701
758
|
]));
|
|
702
759
|
}
|
|
760
|
+
}), vt = /* @__PURE__ */ I({
|
|
761
|
+
__name: "Skeleton",
|
|
762
|
+
props: {
|
|
763
|
+
width: { default: "100%" },
|
|
764
|
+
height: { default: 12 },
|
|
765
|
+
radius: { default: 8 },
|
|
766
|
+
variant: { default: "rect" },
|
|
767
|
+
animated: { type: Boolean, default: !0 }
|
|
768
|
+
},
|
|
769
|
+
setup(e) {
|
|
770
|
+
const n = e, t = (o) => typeof o == "number" ? `${o}px` : o, r = y(() => {
|
|
771
|
+
const o = {
|
|
772
|
+
width: t(n.width),
|
|
773
|
+
height: t(n.height),
|
|
774
|
+
borderRadius: t(n.radius)
|
|
775
|
+
};
|
|
776
|
+
return n.variant === "circle" ? { ...o, borderRadius: "999px" } : n.variant === "round" ? { ...o, borderRadius: "14px" } : o;
|
|
777
|
+
});
|
|
778
|
+
return (o, v) => (l(), u("div", {
|
|
779
|
+
class: k(["h0n-skeleton", { "is-animated": e.animated }]),
|
|
780
|
+
style: R(r.value)
|
|
781
|
+
}, null, 6));
|
|
782
|
+
}
|
|
783
|
+
}), mt = { class: "h0n-tabs" }, yt = ["onClick"], pt = { class: "h0n-tabs__label" }, gt = {
|
|
784
|
+
key: 0,
|
|
785
|
+
class: "h0n-tabs__content"
|
|
786
|
+
}, _t = /* @__PURE__ */ I({
|
|
787
|
+
__name: "Tabs",
|
|
788
|
+
props: {
|
|
789
|
+
modelValue: {},
|
|
790
|
+
tabs: {}
|
|
791
|
+
},
|
|
792
|
+
emits: ["update:modelValue"],
|
|
793
|
+
setup(e, { emit: n }) {
|
|
794
|
+
const t = e, r = n, o = y(
|
|
795
|
+
() => t.tabs.findIndex((i) => i.value === t.modelValue)
|
|
796
|
+
), v = O(null), f = O(null), h = O(0), d = O(0), c = O("forward");
|
|
797
|
+
let p = 0;
|
|
798
|
+
const S = () => {
|
|
799
|
+
L("auto");
|
|
800
|
+
}, T = () => {
|
|
801
|
+
const i = f.value;
|
|
802
|
+
return i ? i.querySelector(".h0n-tabs__tab.is-active") : null;
|
|
803
|
+
}, L = async (i = "smooth") => {
|
|
804
|
+
const s = ++p;
|
|
805
|
+
if (await ge(), s !== p) return;
|
|
806
|
+
const $ = f.value, w = T(), B = v.value;
|
|
807
|
+
if (!w || !$) {
|
|
808
|
+
h.value = 0, d.value = 0;
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
const ce = w.querySelector(".h0n-tabs__label") ?? w, ue = $.getBoundingClientRect(), Y = ce.getBoundingClientRect();
|
|
812
|
+
if (h.value = Y.left - ue.left, d.value = Y.width, !B) return;
|
|
813
|
+
const de = w.offsetLeft + w.offsetWidth / 2 - B.clientWidth / 2, fe = Math.max(B.scrollWidth - B.clientWidth, 0), ee = Math.min(Math.max(de, 0), fe);
|
|
814
|
+
Math.abs(B.scrollLeft - ee) < 1 || B.scrollTo({
|
|
815
|
+
left: ee,
|
|
816
|
+
behavior: i
|
|
817
|
+
});
|
|
818
|
+
}, P = y(() => ({
|
|
819
|
+
left: "0px",
|
|
820
|
+
width: `${d.value}px`,
|
|
821
|
+
transform: `translateX(${h.value}px)`
|
|
822
|
+
}));
|
|
823
|
+
E(
|
|
824
|
+
() => o.value,
|
|
825
|
+
(i, s) => {
|
|
826
|
+
if (s === void 0 || s === -1 || i === -1) {
|
|
827
|
+
c.value = "forward";
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
830
|
+
c.value = i >= s ? "forward" : "backward";
|
|
831
|
+
}
|
|
832
|
+
);
|
|
833
|
+
const D = y(
|
|
834
|
+
() => c.value === "forward" ? "h0n-tabs-slide-left" : "h0n-tabs-slide-right"
|
|
835
|
+
), g = y(
|
|
836
|
+
() => t.tabs.length > 0 && t.tabs.length <= 3
|
|
837
|
+
), a = (i) => {
|
|
838
|
+
r("update:modelValue", i);
|
|
839
|
+
};
|
|
840
|
+
return G(() => {
|
|
841
|
+
L("auto"), window.addEventListener("resize", S);
|
|
842
|
+
}), pe(() => {
|
|
843
|
+
p++, window.removeEventListener("resize", S);
|
|
844
|
+
}), E(
|
|
845
|
+
() => [t.modelValue, t.tabs.length],
|
|
846
|
+
() => {
|
|
847
|
+
L();
|
|
848
|
+
}
|
|
849
|
+
), (i, s) => (l(), u("div", mt, [
|
|
850
|
+
m("div", {
|
|
851
|
+
ref_key: "scrollerRef",
|
|
852
|
+
ref: v,
|
|
853
|
+
class: "h0n-tabs__scroller"
|
|
854
|
+
}, [
|
|
855
|
+
m("div", {
|
|
856
|
+
ref_key: "listRef",
|
|
857
|
+
ref: f,
|
|
858
|
+
class: k(["h0n-tabs__list", { "is-even": g.value }])
|
|
859
|
+
}, [
|
|
860
|
+
(l(!0), u(Z, null, ae(e.tabs, ($, w) => (l(), u("button", {
|
|
861
|
+
key: `${String($.value)}-${w}`,
|
|
862
|
+
class: k(["h0n-tabs__tab", { "is-active": $.value === e.modelValue }]),
|
|
863
|
+
type: "button",
|
|
864
|
+
onClick: (B) => a($.value)
|
|
865
|
+
}, [
|
|
866
|
+
m("span", pt, x($.label), 1)
|
|
867
|
+
], 10, yt))), 128)),
|
|
868
|
+
m("span", {
|
|
869
|
+
class: "h0n-tabs__indicator",
|
|
870
|
+
style: R(P.value)
|
|
871
|
+
}, null, 4)
|
|
872
|
+
], 2)
|
|
873
|
+
], 512),
|
|
874
|
+
i.$slots.default ? (l(), u("div", gt, [
|
|
875
|
+
A(q, {
|
|
876
|
+
name: D.value,
|
|
877
|
+
mode: "out-in"
|
|
878
|
+
}, {
|
|
879
|
+
default: H(() => [
|
|
880
|
+
(l(), u("div", {
|
|
881
|
+
key: e.modelValue,
|
|
882
|
+
class: "h0n-tabs__panel"
|
|
883
|
+
}, [
|
|
884
|
+
C(i.$slots, "default", { activeTab: e.modelValue })
|
|
885
|
+
]))
|
|
886
|
+
]),
|
|
887
|
+
_: 3
|
|
888
|
+
}, 8, ["name"])
|
|
889
|
+
])) : b("", !0)
|
|
890
|
+
]));
|
|
891
|
+
}
|
|
703
892
|
});
|
|
704
|
-
function
|
|
705
|
-
const n =
|
|
893
|
+
function bt(e) {
|
|
894
|
+
const n = kt(e);
|
|
706
895
|
return {
|
|
707
896
|
install(t) {
|
|
708
|
-
t.component("H0Accordion",
|
|
897
|
+
t.component("H0Accordion", Be), t.component("H0Alert", Pe), t.component("H0Button", je), t.component("H0Card", Ze), t.component("H0Dialog", Ye), t.component("H0Spinner", re), t.component("H0Menu", lt), t.component("H0Image", ft), t.component("H0Overlay", ht), t.component("H0Skeleton", vt), t.component("H0Tabs", _t), be(n.theme);
|
|
709
898
|
}
|
|
710
899
|
};
|
|
711
900
|
}
|
|
712
|
-
const
|
|
713
|
-
function
|
|
901
|
+
const Ct = bt();
|
|
902
|
+
function kt(e) {
|
|
714
903
|
return {
|
|
715
904
|
autoRegisterComponents: e?.autoRegisterComponents ?? !0,
|
|
716
|
-
theme:
|
|
905
|
+
theme: _e(e?.theme)
|
|
717
906
|
};
|
|
718
907
|
}
|
|
719
908
|
export {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
909
|
+
Be as Accordion,
|
|
910
|
+
Pe as Alert,
|
|
911
|
+
je as Button,
|
|
912
|
+
Ze as Card,
|
|
913
|
+
Ye as Dialog,
|
|
914
|
+
ft as Image,
|
|
915
|
+
lt as Menu,
|
|
916
|
+
ht as Overlay,
|
|
917
|
+
vt as Skeleton,
|
|
918
|
+
re as Spinner,
|
|
919
|
+
_t as Tabs,
|
|
920
|
+
bt as createH0NPlugin,
|
|
921
|
+
Ct as h0nUi,
|
|
922
|
+
N as useOverlayStack,
|
|
923
|
+
Re as useWebAlert,
|
|
924
|
+
Je as useWebDialog
|
|
734
925
|
};
|