@heito/hxui 1.0.11
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 +3 -0
- package/dist/index.es.js +794 -0
- package/dist/index.umd.js +56 -0
- package/dist/style.css +1 -0
- package/dist/types/components/animations/Height.vue.d.ts +40 -0
- package/dist/types/components/index.d.ts +12 -0
- package/dist/types/components/modules/ui/SelectOption.vue.d.ts +26 -0
- package/dist/types/components/ui/Button.vue.d.ts +24 -0
- package/dist/types/components/ui/ButtonGroup.vue.d.ts +12 -0
- package/dist/types/components/ui/Checkbox.vue.d.ts +26 -0
- package/dist/types/components/ui/Dialog.vue.d.ts +56 -0
- package/dist/types/components/ui/Image.vue.d.ts +6 -0
- package/dist/types/components/ui/Input.vue.d.ts +41 -0
- package/dist/types/components/ui/Label.vue.d.ts +12 -0
- package/dist/types/components/ui/Popover.vue.d.ts +45 -0
- package/dist/types/components/ui/Select.vue.d.ts +33 -0
- package/dist/types/components/ui/Skeleton.vue.d.ts +23 -0
- package/dist/types/components/ui/Tooltip.vue.d.ts +31 -0
- package/dist/types/components/ui/menu/Menu.vue.d.ts +19 -0
- package/dist/types/components/ui/menu/MenuButton.vue.d.ts +15 -0
- package/dist/types/components/ui/menu/MenuChildren.vue.d.ts +22 -0
- package/dist/types/components/ui/menu/MenuGroup.vue.d.ts +2 -0
- package/dist/types/components/ui/menu/MenuLabel.vue.d.ts +12 -0
- package/dist/types/components/ui/menu/MenuRadio.vue.d.ts +24 -0
- package/dist/types/components/ui/menu/MenuSeparator.vue.d.ts +2 -0
- package/dist/types/components/ui/notifications/Group.vue.d.ts +16 -0
- package/dist/types/components/ui/notifications/Notification.vue.d.ts +48 -0
- package/dist/types/index.d.ts +5 -0
- package/package.json +64 -0
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,794 @@
|
|
|
1
|
+
import { defineComponent as C, createElementBlock as g, openBlock as u, normalizeClass as O, renderSlot as w, mergeModels as K, useSlots as J, useModel as ce, withDirectives as A, createElementVNode as d, vModelDynamic as ke, ref as B, computed as E, onUnmounted as fe, Fragment as S, createBlock as M, Teleport as x, createVNode as k, Transition as U, withCtx as P, normalizeStyle as D, vShow as j, nextTick as $e, createCommentVNode as T, toDisplayString as b, h as q, renderList as Q, mergeProps as be, withModifiers as z, unref as ee, createTextVNode as ae, watch as Ce, onMounted as _e } from "vue";
|
|
2
|
+
const Be = ["disabled"], Pe = /* @__PURE__ */ C({
|
|
3
|
+
__name: "Button",
|
|
4
|
+
props: {
|
|
5
|
+
variant: { default: "default" },
|
|
6
|
+
disabled: { type: Boolean, default: !1 }
|
|
7
|
+
},
|
|
8
|
+
emits: {
|
|
9
|
+
click(o) {
|
|
10
|
+
return o;
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
setup(o, { emit: i }) {
|
|
14
|
+
const s = i;
|
|
15
|
+
return (t, e) => (u(), g("button", {
|
|
16
|
+
class: O(["ui-button", t.variant]),
|
|
17
|
+
disabled: t.disabled,
|
|
18
|
+
onClick: e[0] || (e[0] = (n) => s("click", n))
|
|
19
|
+
}, [
|
|
20
|
+
w(t.$slots, "default", {}, void 0, !0)
|
|
21
|
+
], 10, Be));
|
|
22
|
+
}
|
|
23
|
+
}), _ = (o, i) => {
|
|
24
|
+
const s = o.__vccOpts || o;
|
|
25
|
+
for (const [t, e] of i)
|
|
26
|
+
s[t] = e;
|
|
27
|
+
return s;
|
|
28
|
+
}, ve = /* @__PURE__ */ _(Pe, [["__scopeId", "data-v-33152a56"]]), Oe = ["type", "placeholder", "min", "max", "maxlength"], Se = /* @__PURE__ */ C({
|
|
29
|
+
__name: "Input",
|
|
30
|
+
props: /* @__PURE__ */ K({
|
|
31
|
+
type: { default: "text" },
|
|
32
|
+
disabled: { type: Boolean },
|
|
33
|
+
placeholder: {},
|
|
34
|
+
min: {},
|
|
35
|
+
max: {}
|
|
36
|
+
}, {
|
|
37
|
+
value: {},
|
|
38
|
+
valueModifiers: {}
|
|
39
|
+
}),
|
|
40
|
+
emits: /* @__PURE__ */ K({
|
|
41
|
+
input(o) {
|
|
42
|
+
return o;
|
|
43
|
+
},
|
|
44
|
+
change(o) {
|
|
45
|
+
return o;
|
|
46
|
+
},
|
|
47
|
+
focus(o) {
|
|
48
|
+
return o;
|
|
49
|
+
},
|
|
50
|
+
blur(o) {
|
|
51
|
+
return o;
|
|
52
|
+
}
|
|
53
|
+
}, ["update:value"]),
|
|
54
|
+
setup(o, { emit: i }) {
|
|
55
|
+
J();
|
|
56
|
+
const s = ce(o, "value", {
|
|
57
|
+
set(e) {
|
|
58
|
+
return e;
|
|
59
|
+
}
|
|
60
|
+
}), t = i;
|
|
61
|
+
return (e, n) => (u(), g("label", {
|
|
62
|
+
class: O(["ui-input", e.type])
|
|
63
|
+
}, [
|
|
64
|
+
A(d("input", {
|
|
65
|
+
type: e.type,
|
|
66
|
+
"onUpdate:modelValue": n[0] || (n[0] = (l) => s.value = l),
|
|
67
|
+
placeholder: e.placeholder,
|
|
68
|
+
min: e.min,
|
|
69
|
+
max: e.max,
|
|
70
|
+
maxlength: e.max,
|
|
71
|
+
onInput: n[1] || (n[1] = (l) => t("input", l)),
|
|
72
|
+
onChange: n[2] || (n[2] = (l) => t("change", l)),
|
|
73
|
+
onFocus: n[3] || (n[3] = (l) => t("focus", l)),
|
|
74
|
+
onBlur: n[4] || (n[4] = (l) => t("blur", l))
|
|
75
|
+
}, null, 40, Oe), [
|
|
76
|
+
[ke, s.value]
|
|
77
|
+
])
|
|
78
|
+
], 2));
|
|
79
|
+
}
|
|
80
|
+
}), Ie = /* @__PURE__ */ _(Se, [["__scopeId", "data-v-2f67079f"]]), Me = /* @__PURE__ */ C({
|
|
81
|
+
__name: "Popover",
|
|
82
|
+
props: {
|
|
83
|
+
side: { default: () => "bottom" },
|
|
84
|
+
fixed: { type: Boolean, default: !1 },
|
|
85
|
+
transition: { default: () => "show" },
|
|
86
|
+
collisionPadding: { default: () => 4 },
|
|
87
|
+
closeOnClickOutside: { type: Boolean, default: !0 },
|
|
88
|
+
style: { default: "" }
|
|
89
|
+
},
|
|
90
|
+
emits: ["show", "hide"],
|
|
91
|
+
setup(o, { emit: i }) {
|
|
92
|
+
J();
|
|
93
|
+
const s = i, t = o, e = B(!1), n = B(null), l = E(() => {
|
|
94
|
+
const v = typeof t.side == "string" ? [t.side, "center"] : t.side;
|
|
95
|
+
return n.value !== null && (v[0] = n.value), v;
|
|
96
|
+
});
|
|
97
|
+
let r = null, f = null, m = null;
|
|
98
|
+
function $(v) {
|
|
99
|
+
e.value = !0, r = v, s("show");
|
|
100
|
+
}
|
|
101
|
+
function p() {
|
|
102
|
+
e.value = !1, r = null, s("hide");
|
|
103
|
+
}
|
|
104
|
+
function c(v) {
|
|
105
|
+
e.value ? p() : $(v);
|
|
106
|
+
}
|
|
107
|
+
function a(v, y) {
|
|
108
|
+
if (!v || !y) return;
|
|
109
|
+
const { width: N, height: F, x: Y, y: G, top: R, left: H, right: W, bottom: Z } = v?.getBoundingClientRect(), { width: ne, height: ie } = y?.getBoundingClientRect(), [X] = l.value, [le, se] = typeof t.collisionPadding == "number" ? [t.collisionPadding, t.collisionPadding] : t.collisionPadding;
|
|
110
|
+
n.value = null, X === "top" && R - ie - se < 0 ? n.value = "bottom" : X === "left" && H - ne - le < 0 ? n.value = "right" : X === "bottom" && ie + Z > window.innerHeight ? n.value = "top" : X === "right" && ne + W > window.innerWidth && (n.value = "left"), y.style.setProperty("--gap-h", `${le}px`), y.style.setProperty("--gap-v", `${se}px`), y.style.setProperty("--target-width", `${N}px`), y.style.setProperty("--target-height", `${F}px`), y.style.setProperty("--target-x", `${Y}px`), y.style.setProperty("--target-y", `${G}px`);
|
|
111
|
+
}
|
|
112
|
+
function h() {
|
|
113
|
+
f && document.removeEventListener("scroll", f), m && document.removeEventListener("click", m), f = null, m = null;
|
|
114
|
+
}
|
|
115
|
+
function I(v) {
|
|
116
|
+
if (!r) return;
|
|
117
|
+
const y = r?.currentTarget;
|
|
118
|
+
f = () => {
|
|
119
|
+
!e.value || !y || a(y, v);
|
|
120
|
+
}, m = (N) => {
|
|
121
|
+
!t?.closeOnClickOutside || (N.composedPath?.() || N.path)?.includes(v) || p();
|
|
122
|
+
}, document.addEventListener("scroll", f, { capture: !0, passive: !0 }), $e(() => {
|
|
123
|
+
a(y, v), setTimeout(() => m && document.addEventListener("click", m), 10);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function L() {
|
|
127
|
+
h(), r = null, n.value = null;
|
|
128
|
+
}
|
|
129
|
+
return fe(() => {
|
|
130
|
+
L();
|
|
131
|
+
}), (v, y) => (u(), g(S, null, [
|
|
132
|
+
w(v.$slots, "default", {
|
|
133
|
+
show: $,
|
|
134
|
+
hide: p,
|
|
135
|
+
toggle: c,
|
|
136
|
+
isOpened: e.value
|
|
137
|
+
}, void 0, !0),
|
|
138
|
+
(u(), M(x, { to: "body" }, [
|
|
139
|
+
k(U, {
|
|
140
|
+
name: typeof v.transition == "string" ? v.transition : v.transition?.name,
|
|
141
|
+
onBeforeEnter: I,
|
|
142
|
+
onAfterLeave: L
|
|
143
|
+
}, {
|
|
144
|
+
default: P(() => [
|
|
145
|
+
A(d("div", {
|
|
146
|
+
class: O(["ui-popover", ...l.value, { fixed: v.fixed }]),
|
|
147
|
+
role: "dialog",
|
|
148
|
+
"aria-modal": "true",
|
|
149
|
+
style: D(v.style)
|
|
150
|
+
}, [
|
|
151
|
+
w(v.$slots, "content", {}, void 0, !0)
|
|
152
|
+
], 6), [
|
|
153
|
+
[j, e.value]
|
|
154
|
+
])
|
|
155
|
+
]),
|
|
156
|
+
_: 3
|
|
157
|
+
}, 8, ["name"])
|
|
158
|
+
]))
|
|
159
|
+
], 64));
|
|
160
|
+
}
|
|
161
|
+
}), ge = /* @__PURE__ */ _(Me, [["__scopeId", "data-v-c4802e87"]]), Ee = { key: 0 }, Te = { key: 1 }, Le = /* @__PURE__ */ C({
|
|
162
|
+
__name: "SelectOption",
|
|
163
|
+
props: {
|
|
164
|
+
option: {}
|
|
165
|
+
},
|
|
166
|
+
emits: {
|
|
167
|
+
click(o, i) {
|
|
168
|
+
return { event: o, option: i };
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
setup(o, { emit: i }) {
|
|
172
|
+
const s = i, t = o;
|
|
173
|
+
function e(n) {
|
|
174
|
+
t?.option?.type !== "option" || t?.option?.disabled === !0 || s("click", n, t.option);
|
|
175
|
+
}
|
|
176
|
+
return (n, l) => (u(), g("div", {
|
|
177
|
+
class: O(["option", !n.option?.type || n.option?.type === "option" ? "default" : n.option?.type, { disabled: n.option?.type === "option" && n.option?.disabled }]),
|
|
178
|
+
onClick: e
|
|
179
|
+
}, [
|
|
180
|
+
n.option?.type === "option" ? (u(), g("div", Ee, [
|
|
181
|
+
d("div", null, b(n.option?.label || n.option?.value), 1),
|
|
182
|
+
d("div", null, b(n.option?.text), 1)
|
|
183
|
+
])) : n.option?.type === "label" ? (u(), g("span", Te, b(n.option?.value), 1)) : n.option?.type === "separator" ? (u(), g(S, { key: 2 }, [], 64)) : T("", !0)
|
|
184
|
+
], 2));
|
|
185
|
+
}
|
|
186
|
+
}), re = /* @__PURE__ */ _(Le, [["__scopeId", "data-v-1fea3155"]]);
|
|
187
|
+
/**
|
|
188
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/
|
|
193
|
+
const Ne = (o) => {
|
|
194
|
+
for (const i in o)
|
|
195
|
+
if (i.startsWith("aria-") || i === "role" || i === "title")
|
|
196
|
+
return !0;
|
|
197
|
+
return !1;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/
|
|
205
|
+
const ue = (o) => o === "";
|
|
206
|
+
/**
|
|
207
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/
|
|
212
|
+
const He = (...o) => o.filter((i, s, t) => !!i && i.trim() !== "" && t.indexOf(i) === s).join(" ").trim();
|
|
213
|
+
/**
|
|
214
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/
|
|
219
|
+
const de = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
220
|
+
/**
|
|
221
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/
|
|
226
|
+
const Ae = (o) => o.replace(
|
|
227
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
228
|
+
(i, s, t) => t ? t.toUpperCase() : s.toLowerCase()
|
|
229
|
+
);
|
|
230
|
+
/**
|
|
231
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/
|
|
236
|
+
const De = (o) => {
|
|
237
|
+
const i = Ae(o);
|
|
238
|
+
return i.charAt(0).toUpperCase() + i.slice(1);
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/
|
|
246
|
+
var V = {
|
|
247
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
248
|
+
width: 24,
|
|
249
|
+
height: 24,
|
|
250
|
+
viewBox: "0 0 24 24",
|
|
251
|
+
fill: "none",
|
|
252
|
+
stroke: "currentColor",
|
|
253
|
+
"stroke-width": 2,
|
|
254
|
+
"stroke-linecap": "round",
|
|
255
|
+
"stroke-linejoin": "round"
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/
|
|
263
|
+
const Ve = ({
|
|
264
|
+
name: o,
|
|
265
|
+
iconNode: i,
|
|
266
|
+
absoluteStrokeWidth: s,
|
|
267
|
+
"absolute-stroke-width": t,
|
|
268
|
+
strokeWidth: e,
|
|
269
|
+
"stroke-width": n,
|
|
270
|
+
size: l = V.width,
|
|
271
|
+
color: r = V.stroke,
|
|
272
|
+
...f
|
|
273
|
+
}, { slots: m }) => q(
|
|
274
|
+
"svg",
|
|
275
|
+
{
|
|
276
|
+
...V,
|
|
277
|
+
...f,
|
|
278
|
+
width: l,
|
|
279
|
+
height: l,
|
|
280
|
+
stroke: r,
|
|
281
|
+
"stroke-width": ue(s) || ue(t) || s === !0 || t === !0 ? Number(e || n || V["stroke-width"]) * 24 / Number(l) : e || n || V["stroke-width"],
|
|
282
|
+
class: He(
|
|
283
|
+
"lucide",
|
|
284
|
+
f.class,
|
|
285
|
+
...o ? [`lucide-${de(De(o))}-icon`, `lucide-${de(o)}`] : ["lucide-icon"]
|
|
286
|
+
),
|
|
287
|
+
...!m.default && !Ne(f) && { "aria-hidden": "true" }
|
|
288
|
+
},
|
|
289
|
+
[...i.map(($) => q(...$)), ...m.default ? [m.default()] : []]
|
|
290
|
+
);
|
|
291
|
+
/**
|
|
292
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the ISC license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/
|
|
297
|
+
const he = (o, i) => (s, { slots: t, attrs: e }) => q(
|
|
298
|
+
Ve,
|
|
299
|
+
{
|
|
300
|
+
...e,
|
|
301
|
+
...s,
|
|
302
|
+
iconNode: i,
|
|
303
|
+
name: o
|
|
304
|
+
},
|
|
305
|
+
t
|
|
306
|
+
);
|
|
307
|
+
/**
|
|
308
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
309
|
+
*
|
|
310
|
+
* This source code is licensed under the ISC license.
|
|
311
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
+
*/
|
|
313
|
+
const je = he("chevrons-up-down", [
|
|
314
|
+
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
315
|
+
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
316
|
+
]);
|
|
317
|
+
/**
|
|
318
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
319
|
+
*
|
|
320
|
+
* This source code is licensed under the ISC license.
|
|
321
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
+
*/
|
|
323
|
+
const me = he("x", [
|
|
324
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
325
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
326
|
+
]), ze = { class: "options" }, Ue = /* @__PURE__ */ C({
|
|
327
|
+
__name: "Select",
|
|
328
|
+
props: {
|
|
329
|
+
value: { type: [String, Number, Boolean] },
|
|
330
|
+
placeholder: {},
|
|
331
|
+
disabled: { type: Boolean, default: !1 },
|
|
332
|
+
side: { default: "bottom" },
|
|
333
|
+
options: {}
|
|
334
|
+
},
|
|
335
|
+
emits: {
|
|
336
|
+
select(o) {
|
|
337
|
+
return o;
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
setup(o, { emit: i }) {
|
|
341
|
+
const s = i, t = o, e = B(169), n = B(t?.value), l = E(
|
|
342
|
+
() => t.options?.map(({ type: p, ...c }) => ({
|
|
343
|
+
type: p ?? "option",
|
|
344
|
+
...c
|
|
345
|
+
})) ?? []
|
|
346
|
+
), r = E(
|
|
347
|
+
() => l.value.find((p) => p.type === "option" && p.value === n.value) ?? null
|
|
348
|
+
);
|
|
349
|
+
let f;
|
|
350
|
+
function m(p) {
|
|
351
|
+
p.type === "option" && (n.value = p?.value, s("select", p), f && f());
|
|
352
|
+
}
|
|
353
|
+
function $(p, c) {
|
|
354
|
+
const a = p?.currentTarget;
|
|
355
|
+
a && (c(p), f = () => c(p), e.value = Math.min(Math.max(a?.clientWidth, 169), window.innerWidth > 512 ? 512 : window.innerWidth - 24));
|
|
356
|
+
}
|
|
357
|
+
return (p, c) => (u(), g("div", {
|
|
358
|
+
class: O(["ui-select", { selected: !!r.value }])
|
|
359
|
+
}, [
|
|
360
|
+
k(ge, {
|
|
361
|
+
side: p.side,
|
|
362
|
+
style: D({ width: `${e.value}px` })
|
|
363
|
+
}, {
|
|
364
|
+
default: P(({ toggle: a }) => [
|
|
365
|
+
k(ve, {
|
|
366
|
+
variant: "outline",
|
|
367
|
+
disabled: p.disabled,
|
|
368
|
+
onClick: z((h) => $(h, a), ["prevent", "stop"])
|
|
369
|
+
}, {
|
|
370
|
+
default: P(() => [
|
|
371
|
+
d("span", null, b(r.value ? r.value?.label || r.value?.value : p.placeholder), 1),
|
|
372
|
+
k(ee(je), { style: { opacity: ".5" } })
|
|
373
|
+
]),
|
|
374
|
+
_: 2
|
|
375
|
+
}, 1032, ["disabled", "onClick"])
|
|
376
|
+
]),
|
|
377
|
+
content: P(() => [
|
|
378
|
+
d("div", ze, [
|
|
379
|
+
(u(!0), g(S, null, Q(l.value, (a, h) => (u(), g(S, { key: h }, [
|
|
380
|
+
a?.type === "label" || a?.type === "separator" || a.type === "option" && a?.useDefaultStyle === !0 ? (u(), M(re, {
|
|
381
|
+
key: 0,
|
|
382
|
+
option: a,
|
|
383
|
+
onClick: (I) => m(a)
|
|
384
|
+
}, null, 8, ["option", "onClick"])) : w(p.$slots, "option", be({
|
|
385
|
+
key: 1,
|
|
386
|
+
ref_for: !0
|
|
387
|
+
}, { option: a, index: h, select: () => m(a) }), () => [
|
|
388
|
+
k(re, {
|
|
389
|
+
option: a,
|
|
390
|
+
onClick: (I) => m(a)
|
|
391
|
+
}, null, 8, ["option", "onClick"])
|
|
392
|
+
], !0)
|
|
393
|
+
], 64))), 128))
|
|
394
|
+
])
|
|
395
|
+
]),
|
|
396
|
+
_: 3
|
|
397
|
+
}, 8, ["side", "style"])
|
|
398
|
+
], 2));
|
|
399
|
+
}
|
|
400
|
+
}), Fe = /* @__PURE__ */ _(Ue, [["__scopeId", "data-v-760682cb"]]), Ge = {
|
|
401
|
+
key: 0,
|
|
402
|
+
class: "header"
|
|
403
|
+
}, Re = { class: "buttons" }, We = ["onClick"], Ze = /* @__PURE__ */ C({
|
|
404
|
+
__name: "Dialog",
|
|
405
|
+
props: {
|
|
406
|
+
title: {},
|
|
407
|
+
description: {},
|
|
408
|
+
side: { default: () => "center" },
|
|
409
|
+
transition: { default: () => "show-dialog" },
|
|
410
|
+
collisionPadding: { default: () => 24 },
|
|
411
|
+
closeOnClickOutside: { type: Boolean, default: !0 },
|
|
412
|
+
buttons: { default: () => [] },
|
|
413
|
+
style: { type: [Boolean, null, String, Object, Array] }
|
|
414
|
+
},
|
|
415
|
+
emits: ["update:open", "show", "hide"],
|
|
416
|
+
setup(o, { emit: i }) {
|
|
417
|
+
const s = J(), t = i, e = o, n = B(!1), l = E(() => typeof e.side == "string" ? [e.side, "center"] : e.side), r = E(() => typeof e.collisionPadding == "number" ? [e.collisionPadding, e.collisionPadding] : e.collisionPadding), f = E(() => !!e.title || !!e.description || !!s.title || !!s.description);
|
|
418
|
+
function m(a) {
|
|
419
|
+
n.value = a, t("update:open", a);
|
|
420
|
+
}
|
|
421
|
+
function $(a) {
|
|
422
|
+
m(!0), t("show");
|
|
423
|
+
}
|
|
424
|
+
function p() {
|
|
425
|
+
m(!1), t("hide");
|
|
426
|
+
}
|
|
427
|
+
function c(a) {
|
|
428
|
+
n.value ? p() : $();
|
|
429
|
+
}
|
|
430
|
+
return (a, h) => (u(), g(S, null, [
|
|
431
|
+
w(a.$slots, "default", {
|
|
432
|
+
show: $,
|
|
433
|
+
hide: p,
|
|
434
|
+
toggle: c,
|
|
435
|
+
isOpened: n.value
|
|
436
|
+
}, void 0, !0),
|
|
437
|
+
(u(), M(x, { to: "body" }, [
|
|
438
|
+
k(U, {
|
|
439
|
+
name: typeof a.transition == "string" ? a.transition : a.transition?.name
|
|
440
|
+
}, {
|
|
441
|
+
default: P(() => [
|
|
442
|
+
A(d("div", {
|
|
443
|
+
class: O(["dialog", ...l.value]),
|
|
444
|
+
style: D({ "--gap-v": r.value[0] + "px", "--gap-h": r.value[1] + "px" })
|
|
445
|
+
}, [
|
|
446
|
+
d("div", {
|
|
447
|
+
class: "background",
|
|
448
|
+
onClick: h[0] || (h[0] = z((I) => a.closeOnClickOutside && p(), ["prevent", "stop"]))
|
|
449
|
+
}),
|
|
450
|
+
d("div", {
|
|
451
|
+
class: "content",
|
|
452
|
+
style: D(a.style)
|
|
453
|
+
}, [
|
|
454
|
+
f.value ? (u(), g("div", Ge, [
|
|
455
|
+
d("h2", null, [
|
|
456
|
+
w(a.$slots, "title", {}, () => [
|
|
457
|
+
ae(b(a.title), 1)
|
|
458
|
+
], !0)
|
|
459
|
+
]),
|
|
460
|
+
d("p", null, [
|
|
461
|
+
w(a.$slots, "description", {}, () => [
|
|
462
|
+
ae(b(a.description), 1)
|
|
463
|
+
], !0)
|
|
464
|
+
])
|
|
465
|
+
])) : T("", !0),
|
|
466
|
+
w(a.$slots, "content", {
|
|
467
|
+
show: $,
|
|
468
|
+
hide: p,
|
|
469
|
+
toggle: c,
|
|
470
|
+
isOpened: n.value
|
|
471
|
+
}, void 0, !0),
|
|
472
|
+
d("div", Re, [
|
|
473
|
+
d("div", { onClick: p }, [
|
|
474
|
+
k(ee(me), { size: 16 })
|
|
475
|
+
]),
|
|
476
|
+
(u(!0), g(S, null, Q(a.buttons, (I, L) => (u(), g("div", {
|
|
477
|
+
key: L,
|
|
478
|
+
onClick: z((v) => I?.click?.(v), ["prevent", "stop"])
|
|
479
|
+
}, null, 8, We))), 128))
|
|
480
|
+
])
|
|
481
|
+
], 4)
|
|
482
|
+
], 6), [
|
|
483
|
+
[j, n.value]
|
|
484
|
+
])
|
|
485
|
+
]),
|
|
486
|
+
_: 3
|
|
487
|
+
}, 8, ["name"])
|
|
488
|
+
]))
|
|
489
|
+
], 64));
|
|
490
|
+
}
|
|
491
|
+
}), Xe = /* @__PURE__ */ _(Ze, [["__scopeId", "data-v-ad7af199"]]), qe = /* @__PURE__ */ C({
|
|
492
|
+
__name: "Tooltip",
|
|
493
|
+
props: /* @__PURE__ */ K({
|
|
494
|
+
side: { default: () => "top" },
|
|
495
|
+
collisionPadding: { default: () => 8 },
|
|
496
|
+
delay: { default: 100 }
|
|
497
|
+
}, {
|
|
498
|
+
open: { type: Boolean },
|
|
499
|
+
openModifiers: {}
|
|
500
|
+
}),
|
|
501
|
+
emits: ["update:open"],
|
|
502
|
+
setup(o) {
|
|
503
|
+
const i = J(), s = ce(o, "open");
|
|
504
|
+
B();
|
|
505
|
+
const t = o, e = B(null), n = E(() => {
|
|
506
|
+
const c = typeof t.side == "string" ? [t.side, "center"] : t.side;
|
|
507
|
+
return e.value !== null && (c[0] = e.value), c;
|
|
508
|
+
});
|
|
509
|
+
let l = null, r = null;
|
|
510
|
+
function f(c) {
|
|
511
|
+
if (!c || !r) return;
|
|
512
|
+
const a = r.target, { width: h, height: I, x: L, y: v, top: y, left: N, right: F, bottom: Y } = a?.getBoundingClientRect(), { width: G, height: R } = c?.getBoundingClientRect(), [H] = n.value, [W, Z] = typeof t.collisionPadding == "number" ? [t.collisionPadding, t.collisionPadding] : t.collisionPadding;
|
|
513
|
+
H === "top" && y - R - Z < 0 ? e.value = "bottom" : H === "left" && N - G - W < 0 ? e.value = "right" : H === "bottom" && R + Y > window.innerHeight ? e.value = "top" : H === "right" && G + F > window.innerWidth && (e.value = "left"), c.style.setProperty("--gap-h", `${W}px`), c.style.setProperty("--gap-v", `${Z}px`), c.style.setProperty("--target-width", `${h}px`), c.style.setProperty("--target-height", `${I}px`), c.style.setProperty("--target-x", `${L}px`), c.style.setProperty("--target-y", `${v}px`);
|
|
514
|
+
}
|
|
515
|
+
function m(c) {
|
|
516
|
+
l && clearTimeout(l), r = c, l = setTimeout(() => {
|
|
517
|
+
s.value = !0;
|
|
518
|
+
}, t.delay);
|
|
519
|
+
}
|
|
520
|
+
const $ = () => {
|
|
521
|
+
l && (clearTimeout(l), l = null), r = null, s.value = !1;
|
|
522
|
+
};
|
|
523
|
+
function p() {
|
|
524
|
+
return (i.trigger?.() || []).map((a) => q(a.type, {
|
|
525
|
+
...a.props,
|
|
526
|
+
onMouseenter(h) {
|
|
527
|
+
m(h), a.props?.onMouseenter?.(h);
|
|
528
|
+
},
|
|
529
|
+
onMouseleave(h) {
|
|
530
|
+
$(), a.props?.onMouseleave?.(h);
|
|
531
|
+
},
|
|
532
|
+
onFocus(h) {
|
|
533
|
+
m(h), a.props?.onFocus?.(h);
|
|
534
|
+
},
|
|
535
|
+
onBlur(h) {
|
|
536
|
+
$(), a.props?.onBlur?.(h);
|
|
537
|
+
}
|
|
538
|
+
}, a.children));
|
|
539
|
+
}
|
|
540
|
+
return fe(() => {
|
|
541
|
+
l && clearTimeout(l);
|
|
542
|
+
}), (c, a) => (u(), g(S, null, [
|
|
543
|
+
k(p),
|
|
544
|
+
(u(), M(x, { to: "body" }, [
|
|
545
|
+
k(U, {
|
|
546
|
+
name: "show",
|
|
547
|
+
onBeforeEnter: a[0] || (a[0] = (h) => f(h))
|
|
548
|
+
}, {
|
|
549
|
+
default: P(() => [
|
|
550
|
+
s.value ? (u(), g("div", {
|
|
551
|
+
key: 0,
|
|
552
|
+
class: O(["tooltip", ...n.value])
|
|
553
|
+
}, [
|
|
554
|
+
w(c.$slots, "default", {}, void 0, !0)
|
|
555
|
+
], 2)) : T("", !0)
|
|
556
|
+
]),
|
|
557
|
+
_: 3
|
|
558
|
+
})
|
|
559
|
+
]))
|
|
560
|
+
], 64));
|
|
561
|
+
}
|
|
562
|
+
}), Je = /* @__PURE__ */ _(qe, [["__scopeId", "data-v-bccd013d"]]), Qe = /* @__PURE__ */ C({
|
|
563
|
+
__name: "Skeleton",
|
|
564
|
+
props: {
|
|
565
|
+
ready: { type: Boolean, default: !1 },
|
|
566
|
+
w: { default: "16px" },
|
|
567
|
+
h: { default: "16px" }
|
|
568
|
+
},
|
|
569
|
+
setup(o) {
|
|
570
|
+
return (i, s) => i.ready ? w(i.$slots, "default", { key: 0 }, void 0, !0) : (u(), g("div", {
|
|
571
|
+
key: 1,
|
|
572
|
+
class: "ui-skeleton",
|
|
573
|
+
style: D({ "--w": i.w, "--h": i.h })
|
|
574
|
+
}, [
|
|
575
|
+
s[0] || (s[0] = d("div", null, null, -1)),
|
|
576
|
+
w(i.$slots, "content", {}, void 0, !0)
|
|
577
|
+
], 4));
|
|
578
|
+
}
|
|
579
|
+
}), ye = /* @__PURE__ */ _(Qe, [["__scopeId", "data-v-3b7cd939"]]), Ye = ["src", "alt"], Ke = /* @__PURE__ */ C({
|
|
580
|
+
__name: "Image",
|
|
581
|
+
props: {
|
|
582
|
+
src: {},
|
|
583
|
+
alt: {}
|
|
584
|
+
},
|
|
585
|
+
setup(o) {
|
|
586
|
+
const i = o, s = B("loading");
|
|
587
|
+
Ce(() => i.src, () => t());
|
|
588
|
+
function t() {
|
|
589
|
+
const e = new Image();
|
|
590
|
+
s.value = "loading", e.onload = () => {
|
|
591
|
+
s.value = "ready";
|
|
592
|
+
}, e.onerror = () => {
|
|
593
|
+
s.value = "error";
|
|
594
|
+
}, e.src = i.src;
|
|
595
|
+
}
|
|
596
|
+
return _e(() => t()), (e, n) => (u(), g(S, null, [
|
|
597
|
+
k(U, { name: "fade" }, {
|
|
598
|
+
default: P(() => [
|
|
599
|
+
A(d("img", {
|
|
600
|
+
class: "ui-image",
|
|
601
|
+
src: e.src,
|
|
602
|
+
alt: e.alt
|
|
603
|
+
}, null, 8, Ye), [
|
|
604
|
+
[j, s.value === "ready"]
|
|
605
|
+
])
|
|
606
|
+
]),
|
|
607
|
+
_: 1
|
|
608
|
+
}),
|
|
609
|
+
A(k(ye, {
|
|
610
|
+
class: "ui-image",
|
|
611
|
+
ready: !1
|
|
612
|
+
}, null, 512), [
|
|
613
|
+
[j, s.value !== "ready"]
|
|
614
|
+
])
|
|
615
|
+
], 64));
|
|
616
|
+
}
|
|
617
|
+
}), te = /* @__PURE__ */ _(Ke, [["__scopeId", "data-v-9ea0741f"]]), xe = /* @__PURE__ */ C({
|
|
618
|
+
__name: "Height",
|
|
619
|
+
props: {
|
|
620
|
+
showed: { type: Boolean },
|
|
621
|
+
opacity: { type: Boolean, default: !1 },
|
|
622
|
+
duration: { type: Number, default: 0.3 }
|
|
623
|
+
},
|
|
624
|
+
setup(o) {
|
|
625
|
+
const i = o, s = B({
|
|
626
|
+
"--opacity": i.opacity ? 0 : 1,
|
|
627
|
+
"--duration": (i.duration || 0.3) + "s"
|
|
628
|
+
});
|
|
629
|
+
function t(l) {
|
|
630
|
+
l.style.height = "auto";
|
|
631
|
+
const { height: r } = window.getComputedStyle(l);
|
|
632
|
+
l.style.height = "0px", l.offsetHeight, l.style.height = r;
|
|
633
|
+
}
|
|
634
|
+
function e(l) {
|
|
635
|
+
l.style.removeProperty("height");
|
|
636
|
+
}
|
|
637
|
+
function n(l) {
|
|
638
|
+
const { height: r } = window.getComputedStyle(l);
|
|
639
|
+
l.style.height = r, l.offsetHeight, l.style.height = "0px";
|
|
640
|
+
}
|
|
641
|
+
return (l, r) => (u(), M(U, {
|
|
642
|
+
name: "height",
|
|
643
|
+
onEnter: r[0] || (r[0] = (f) => t(f)),
|
|
644
|
+
onAfterEnter: r[1] || (r[1] = (f) => e(f)),
|
|
645
|
+
onLeave: r[2] || (r[2] = (f) => n(f)),
|
|
646
|
+
onAfterLeave: r[3] || (r[3] = (f) => e(f))
|
|
647
|
+
}, {
|
|
648
|
+
default: P(() => [
|
|
649
|
+
o.showed ? (u(), g("div", {
|
|
650
|
+
key: 0,
|
|
651
|
+
class: "height-content",
|
|
652
|
+
style: D(s.value)
|
|
653
|
+
}, [
|
|
654
|
+
w(l.$slots, "default", {}, void 0, !0)
|
|
655
|
+
], 4)) : T("", !0)
|
|
656
|
+
]),
|
|
657
|
+
_: 3
|
|
658
|
+
}));
|
|
659
|
+
}
|
|
660
|
+
}), oe = /* @__PURE__ */ _(xe, [["__scopeId", "data-v-925752b4"]]), et = { class: "content" }, tt = { class: "buttons" }, ot = ["onClick"], nt = { class: "options" }, it = /* @__PURE__ */ C({
|
|
661
|
+
__name: "Notification",
|
|
662
|
+
props: {
|
|
663
|
+
notification: {},
|
|
664
|
+
showButtons: { type: Boolean },
|
|
665
|
+
showOptions: { type: Boolean }
|
|
666
|
+
},
|
|
667
|
+
emits: {
|
|
668
|
+
hide() {
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
setup(o, { emit: i }) {
|
|
672
|
+
const s = i, t = B(!1);
|
|
673
|
+
return (e, n) => (u(), g("div", {
|
|
674
|
+
class: O(["notification", { hide: t.value }])
|
|
675
|
+
}, [
|
|
676
|
+
w(e.$slots, "before", {}, void 0, !0),
|
|
677
|
+
d("header", null, [
|
|
678
|
+
e.notification?.icon || e.notification?.image ? (u(), g("div", {
|
|
679
|
+
key: 0,
|
|
680
|
+
class: O(["i", {
|
|
681
|
+
image: e.notification?.image,
|
|
682
|
+
icon: e.notification?.icon
|
|
683
|
+
}])
|
|
684
|
+
}, [
|
|
685
|
+
e.notification?.image ? (u(), M(te, {
|
|
686
|
+
key: 0,
|
|
687
|
+
src: e.notification?.image
|
|
688
|
+
}, null, 8, ["src"])) : T("", !0)
|
|
689
|
+
], 2)) : T("", !0),
|
|
690
|
+
d("div", et, [
|
|
691
|
+
d("div", null, b(e.notification?.title), 1),
|
|
692
|
+
d("div", null, b(e.notification?.text), 1)
|
|
693
|
+
])
|
|
694
|
+
]),
|
|
695
|
+
k(oe, {
|
|
696
|
+
showed: e.showButtons && e.notification?.buttons?.length > 0
|
|
697
|
+
}, {
|
|
698
|
+
default: P(() => [
|
|
699
|
+
d("ul", tt, [
|
|
700
|
+
(u(!0), g(S, null, Q(e.notification?.buttons, (l) => (u(), g("li", {
|
|
701
|
+
key: l?.label,
|
|
702
|
+
onClick: z((r) => l?.click ? l?.click(r) : null, ["stop", "prevent"])
|
|
703
|
+
}, [
|
|
704
|
+
d("div", null, [
|
|
705
|
+
d("div", null, b(l?.label), 1),
|
|
706
|
+
d("div", null, b(l?.text), 1)
|
|
707
|
+
])
|
|
708
|
+
], 8, ot))), 128))
|
|
709
|
+
])
|
|
710
|
+
]),
|
|
711
|
+
_: 1
|
|
712
|
+
}, 8, ["showed"]),
|
|
713
|
+
A(d("ul", nt, [
|
|
714
|
+
d("li", {
|
|
715
|
+
onClick: n[0] || (n[0] = z((l) => s("hide"), ["stop", "prevent"]))
|
|
716
|
+
}, [
|
|
717
|
+
k(ee(me))
|
|
718
|
+
])
|
|
719
|
+
], 512), [
|
|
720
|
+
[j, e.showOptions && e.notification?.mode === "fixed"]
|
|
721
|
+
]),
|
|
722
|
+
w(e.$slots, "default", {}, void 0, !0)
|
|
723
|
+
], 2));
|
|
724
|
+
}
|
|
725
|
+
}), we = /* @__PURE__ */ _(it, [["__scopeId", "data-v-1e6c986c"]]), lt = { class: "content" }, st = /* @__PURE__ */ C({
|
|
726
|
+
__name: "Group",
|
|
727
|
+
props: {
|
|
728
|
+
name: {},
|
|
729
|
+
group: {}
|
|
730
|
+
},
|
|
731
|
+
setup(o) {
|
|
732
|
+
const i = B(!1);
|
|
733
|
+
return (s, t) => (u(), g("div", {
|
|
734
|
+
class: O(["group", { active: i.value }])
|
|
735
|
+
}, [
|
|
736
|
+
d("header", {
|
|
737
|
+
onClick: t[0] || (t[0] = (e) => i.value = !i.value)
|
|
738
|
+
}, [
|
|
739
|
+
s.group?.image ? (u(), M(te, {
|
|
740
|
+
key: 0,
|
|
741
|
+
src: s.group?.image
|
|
742
|
+
}, null, 8, ["src"])) : T("", !0),
|
|
743
|
+
d("div", lt, [
|
|
744
|
+
d("div", null, b(s.group?.title || s.name), 1),
|
|
745
|
+
d("div", null, b(s.group?.text), 1)
|
|
746
|
+
])
|
|
747
|
+
]),
|
|
748
|
+
k(oe, { showed: i.value }, {
|
|
749
|
+
default: P(() => [
|
|
750
|
+
d("ul", null, [
|
|
751
|
+
(u(!0), g(S, null, Q(s.group.list, (e) => (u(), M(we, {
|
|
752
|
+
key: e.id,
|
|
753
|
+
notification: e,
|
|
754
|
+
"show-buttons": !0
|
|
755
|
+
}, null, 8, ["notification"]))), 128))
|
|
756
|
+
])
|
|
757
|
+
]),
|
|
758
|
+
_: 1
|
|
759
|
+
}, 8, ["showed"])
|
|
760
|
+
], 2));
|
|
761
|
+
}
|
|
762
|
+
}), at = /* @__PURE__ */ _(st, [["__scopeId", "data-v-36c3285a"]]), pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
763
|
+
__proto__: null,
|
|
764
|
+
AnimationHeight: oe,
|
|
765
|
+
Button: ve,
|
|
766
|
+
Dialog: Xe,
|
|
767
|
+
Image: te,
|
|
768
|
+
Input: Ie,
|
|
769
|
+
NotificationCard: we,
|
|
770
|
+
NotificationGroup: at,
|
|
771
|
+
Popover: ge,
|
|
772
|
+
Select: Fe,
|
|
773
|
+
Skeleton: ye,
|
|
774
|
+
Tooltip: Je
|
|
775
|
+
}, Symbol.toStringTag, { value: "Module" })), ut = {
|
|
776
|
+
install(o) {
|
|
777
|
+
for (const i in pe)
|
|
778
|
+
o.component(i, pe[i]);
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
export {
|
|
782
|
+
oe as AnimationHeight,
|
|
783
|
+
ve as Button,
|
|
784
|
+
Xe as Dialog,
|
|
785
|
+
te as Image,
|
|
786
|
+
Ie as Input,
|
|
787
|
+
we as NotificationCard,
|
|
788
|
+
at as NotificationGroup,
|
|
789
|
+
ge as Popover,
|
|
790
|
+
Fe as Select,
|
|
791
|
+
ye as Skeleton,
|
|
792
|
+
Je as Tooltip,
|
|
793
|
+
ut as default
|
|
794
|
+
};
|