spicykatsu 0.0.36 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/spicykatsu.es.js +330 -263
- package/dist/spicykatsu.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/spicykatsu.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as w, watch as Y, openBlock as n, createBlock as R, Transition as E, withCtx as z, createElementBlock as s, normalizeClass as k, withKeys as A, toDisplayString as h, createCommentVNode as v, renderSlot as b, computed as C, normalizeStyle as I, onMounted as q, onUnmounted as G, createElementVNode as f, createVNode as J, Fragment as D, renderList as F, withDirectives as _, vModelCheckbox as Q, createTextVNode as U, vModelText as W, mergeProps as Z, withModifiers as N, reactive as ee, nextTick as te } from "vue";
|
|
2
2
|
const le = ["aria-label"], oe = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "spicyAlertIcon"
|
|
@@ -20,40 +20,41 @@ const le = ["aria-label"], oe = {
|
|
|
20
20
|
autoClose: { type: Number, default: 0 }
|
|
21
21
|
},
|
|
22
22
|
setup(e) {
|
|
23
|
-
const t = e, l =
|
|
23
|
+
const t = e, l = w(!0), a = () => {
|
|
24
24
|
l.value = !1;
|
|
25
25
|
};
|
|
26
|
-
return
|
|
26
|
+
return Y(
|
|
27
27
|
() => t.autoClose,
|
|
28
28
|
(o) => {
|
|
29
29
|
o > 0 && setTimeout(() => {
|
|
30
30
|
l.value = !1;
|
|
31
31
|
}, o);
|
|
32
32
|
}
|
|
33
|
-
), (o,
|
|
34
|
-
default:
|
|
33
|
+
), (o, r) => (n(), R(E, { name: "fade" }, {
|
|
34
|
+
default: z(() => [
|
|
35
35
|
l.value ? (n(), s("div", {
|
|
36
36
|
key: 0,
|
|
37
|
-
class:
|
|
37
|
+
class: k(["spicyAlert", e.variant]),
|
|
38
38
|
"aria-atomic": "true",
|
|
39
39
|
"aria-label": e.text,
|
|
40
40
|
role: "alert",
|
|
41
|
-
onKeydown:
|
|
41
|
+
onKeydown: A(a, ["enter"])
|
|
42
42
|
}, [
|
|
43
|
-
e.iconOnly || e.text ? (n(), s("span", oe,
|
|
44
|
-
!e.iconOnly && e.text ? (n(), s("span", ae,
|
|
43
|
+
e.iconOnly || e.text ? (n(), s("span", oe, h(e.icon), 1)) : v("", !0),
|
|
44
|
+
!e.iconOnly && e.text ? (n(), s("span", ae, h(e.text), 1)) : v("", !0),
|
|
45
45
|
e.closable ? (n(), s("button", {
|
|
46
46
|
key: 2,
|
|
47
47
|
class: "spicyAlertCloseBtn",
|
|
48
48
|
onClick: a,
|
|
49
49
|
"aria-label": "Close alert"
|
|
50
|
-
}, " X ")) :
|
|
51
|
-
|
|
50
|
+
}, " X ")) : v("", !0),
|
|
51
|
+
b(o.$slots, "default")
|
|
52
|
+
], 42, le)) : v("", !0)
|
|
52
53
|
]),
|
|
53
|
-
_:
|
|
54
|
+
_: 3
|
|
54
55
|
}));
|
|
55
56
|
}
|
|
56
|
-
}, se = ["disabled", "aria-label", "aria-disabled"], ie = {
|
|
57
|
+
}, se = ["disabled", "aria-label", "aria-disabled", "tabindex"], ie = {
|
|
57
58
|
key: 0,
|
|
58
59
|
class: "spicyBtnIcon"
|
|
59
60
|
}, re = {
|
|
@@ -75,40 +76,41 @@ const le = ["aria-label"], oe = {
|
|
|
75
76
|
hoverColor: String,
|
|
76
77
|
borderColor: String,
|
|
77
78
|
// Custom color (if outlined variant)
|
|
78
|
-
fontSize: { type: [Number, String], default:
|
|
79
|
+
fontSize: { type: [Number, String], default: 16 },
|
|
79
80
|
fontWeight: { type: [Number, String], default: 500 }
|
|
80
81
|
},
|
|
81
82
|
emits: ["click"],
|
|
82
83
|
setup(e, { emit: t }) {
|
|
83
|
-
const l = e, a =
|
|
84
|
-
"--skFontSize": l.fontSize,
|
|
84
|
+
const l = e, a = C(() => ({
|
|
85
|
+
"--skFontSize": typeof l.fontSize == "number" ? `${l.fontSize}px` : l.fontSize,
|
|
85
86
|
"--skFontWeight": l.fontWeight,
|
|
86
87
|
"--skBgColor": l.bgColor,
|
|
87
88
|
"--skTextColor": l.textColor,
|
|
88
89
|
"--skBorderColor": l.borderColor,
|
|
89
90
|
"--hoverColor": l.hoverColor
|
|
90
91
|
}));
|
|
91
|
-
return (o,
|
|
92
|
-
class:
|
|
92
|
+
return (o, r) => (n(), s("button", {
|
|
93
|
+
class: k(["spicyBtn", { outlined: e.variant === "outlined", disabled: e.disabled }]),
|
|
93
94
|
style: I({ ...a.value }),
|
|
94
95
|
disabled: e.disabled,
|
|
95
|
-
onClick:
|
|
96
|
+
onClick: r[0] || (r[0] = (d) => o.$emit("click")),
|
|
96
97
|
role: "button",
|
|
97
98
|
"aria-label": e.text,
|
|
98
|
-
"aria-disabled": e.disabled
|
|
99
|
+
"aria-disabled": e.disabled,
|
|
100
|
+
tabindex: e.disabled ? -1 : 0
|
|
99
101
|
}, [
|
|
100
|
-
e.icon ? (n(), s("span", ie,
|
|
101
|
-
e.text ? (n(), s("span", re,
|
|
102
|
-
|
|
102
|
+
e.icon ? (n(), s("span", ie, h(e.icon), 1)) : v("", !0),
|
|
103
|
+
e.text ? (n(), s("span", re, h(e.text), 1)) : v("", !0),
|
|
104
|
+
b(o.$slots, "default")
|
|
103
105
|
], 14, se));
|
|
104
106
|
}
|
|
105
107
|
}, ue = { class: "spicyCarouselWrapper" }, de = ["aria-label"], ye = { class: "spicyCarouselInfoText" }, pe = { class: "spicyCarouselTitle" }, fe = { key: 0 }, ve = {
|
|
106
108
|
key: 0,
|
|
107
109
|
class: "spicyCarouselNavControls"
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
],
|
|
111
|
-
|
|
110
|
+
}, he = /* @__PURE__ */ f("span", { class: "spicyCarouselPrevBtnIcon" }, "<", -1), ge = [
|
|
111
|
+
he
|
|
112
|
+
], me = /* @__PURE__ */ f("span", { class: "spicyCarouselNextBtnIcon" }, ">", -1), be = [
|
|
113
|
+
me
|
|
112
114
|
], Se = {
|
|
113
115
|
key: 1,
|
|
114
116
|
class: "spicyCarouselPagination"
|
|
@@ -130,100 +132,123 @@ const le = ["aria-label"], oe = {
|
|
|
130
132
|
},
|
|
131
133
|
setup(e) {
|
|
132
134
|
let t, l, a = !1;
|
|
133
|
-
const o = e,
|
|
135
|
+
const o = e, r = C(() => ({
|
|
134
136
|
"--width": o.width,
|
|
135
137
|
"--height": o.height,
|
|
136
138
|
"--activeColor": o.activeColor
|
|
137
|
-
})),
|
|
138
|
-
let
|
|
139
|
-
const
|
|
139
|
+
})), d = C(() => o.slides[u.value].title), y = C(() => i.value.fullScreen === !1 ? !1 : o.fullScreen), u = w(o.initialSlide), i = C(() => o.slides[u.value]);
|
|
140
|
+
let c;
|
|
141
|
+
const p = () => {
|
|
140
142
|
u.value = (u.value - 1 + o.slides.length) % o.slides.length;
|
|
141
|
-
}, C = () => {
|
|
142
|
-
u.value = (u.value + 1) % o.slides.length;
|
|
143
|
-
}, h = (m) => {
|
|
144
|
-
u.value = m;
|
|
145
143
|
}, $ = () => {
|
|
146
|
-
|
|
144
|
+
u.value = (u.value + 1) % o.slides.length;
|
|
145
|
+
}, g = (S) => {
|
|
146
|
+
u.value = S;
|
|
147
|
+
}, B = () => {
|
|
148
|
+
clearInterval(c);
|
|
147
149
|
}, T = () => {
|
|
148
|
-
o.autoplay && (
|
|
149
|
-
},
|
|
150
|
+
o.autoplay && (c = setInterval($, o.autoplaySpeed));
|
|
151
|
+
}, x = () => {
|
|
150
152
|
window.open(i.value.img);
|
|
151
|
-
},
|
|
152
|
-
o.enableImageClick &&
|
|
153
|
-
}, O = (
|
|
154
|
-
t =
|
|
155
|
-
},
|
|
153
|
+
}, m = () => {
|
|
154
|
+
o.enableImageClick && x();
|
|
155
|
+
}, O = (S) => {
|
|
156
|
+
t = S.touches[0].clientX, l = S.touches[0].clientY, a = !1;
|
|
157
|
+
}, X = (S) => {
|
|
156
158
|
if (!a) {
|
|
157
|
-
const P =
|
|
158
|
-
Math.abs(P) > Math.abs(L) && (P > 40 ? (
|
|
159
|
+
const P = S.touches[0].clientX - t, L = S.touches[0].clientY - l;
|
|
160
|
+
Math.abs(P) > Math.abs(L) && (P > 40 ? (p(), a = !0) : P < -40 && ($(), a = !0));
|
|
159
161
|
}
|
|
160
162
|
};
|
|
161
|
-
return
|
|
162
|
-
o.autoplay && (
|
|
163
|
-
}),
|
|
164
|
-
clearInterval(
|
|
165
|
-
}), (
|
|
166
|
-
|
|
163
|
+
return q(() => {
|
|
164
|
+
o.autoplay && (c = setInterval($, o.autoplaySpeed));
|
|
165
|
+
}), G(() => {
|
|
166
|
+
clearInterval(c);
|
|
167
|
+
}), (S, P) => (n(), s("div", ue, [
|
|
168
|
+
f("div", {
|
|
167
169
|
class: "spicyCarouselContainer",
|
|
168
|
-
style: I({ ...
|
|
169
|
-
onMouseenter:
|
|
170
|
+
style: I({ ...r.value }),
|
|
171
|
+
onMouseenter: B,
|
|
170
172
|
onMouseleave: T,
|
|
171
173
|
onTouchstart: O,
|
|
172
|
-
onTouchmove:
|
|
174
|
+
onTouchmove: X
|
|
173
175
|
}, [
|
|
174
|
-
|
|
176
|
+
J(E, {
|
|
175
177
|
name: "slide",
|
|
176
178
|
mode: "out-in"
|
|
177
179
|
}, {
|
|
178
|
-
default:
|
|
180
|
+
default: z(() => [
|
|
179
181
|
(n(), s("div", {
|
|
180
|
-
class:
|
|
182
|
+
class: k(["spicyCarouselSlide", { pointCursor: o.enableImageClick }]),
|
|
181
183
|
key: u.value,
|
|
182
184
|
style: I({ backgroundImage: `url(${i.value.img})` }),
|
|
183
|
-
onClick:
|
|
185
|
+
onClick: m
|
|
184
186
|
}, [
|
|
185
187
|
e.slides[u.value].text ? (n(), s("div", {
|
|
186
188
|
key: 0,
|
|
187
|
-
class:
|
|
189
|
+
class: k(["spicyCarouselTextOverlay", { fullScreen: y.value }]),
|
|
188
190
|
"aria-label": e.slides[u.value].text
|
|
189
191
|
}, [
|
|
190
|
-
|
|
191
|
-
], 10, de)) :
|
|
192
|
-
|
|
192
|
+
f("span", ye, h(e.slides[u.value].text), 1)
|
|
193
|
+
], 10, de)) : v("", !0),
|
|
194
|
+
b(S.$slots, "default")
|
|
193
195
|
], 6))
|
|
194
196
|
]),
|
|
195
197
|
_: 3
|
|
196
198
|
})
|
|
197
199
|
], 36),
|
|
198
|
-
|
|
199
|
-
|
|
200
|
+
f("div", pe, [
|
|
201
|
+
d.value ? (n(), s("h2", fe, h(i.value.title), 1)) : v("", !0)
|
|
200
202
|
]),
|
|
201
203
|
e.showNavigation ? (n(), s("div", ve, [
|
|
202
|
-
|
|
204
|
+
f("button", {
|
|
203
205
|
class: "spicyCarouselPrevBtn",
|
|
204
|
-
onClick:
|
|
205
|
-
},
|
|
206
|
-
|
|
206
|
+
onClick: p
|
|
207
|
+
}, ge),
|
|
208
|
+
f("button", {
|
|
207
209
|
class: "spicyCarouselNextBtn",
|
|
208
|
-
onClick:
|
|
209
|
-
},
|
|
210
|
-
])) :
|
|
210
|
+
onClick: $
|
|
211
|
+
}, be)
|
|
212
|
+
])) : v("", !0),
|
|
211
213
|
e.showPagination ? (n(), s("div", Se, [
|
|
212
|
-
(n(!0), s(
|
|
213
|
-
key:
|
|
214
|
-
onClick: (
|
|
215
|
-
class:
|
|
214
|
+
(n(!0), s(D, null, F(e.slides, (L, V) => (n(), s("button", {
|
|
215
|
+
key: V,
|
|
216
|
+
onClick: (ht) => g(V),
|
|
217
|
+
class: k(["spicyCarouselPageBtn", { active: V === u.value }])
|
|
216
218
|
}, [
|
|
217
|
-
|
|
219
|
+
f("span", ke, h(V + 1), 1)
|
|
218
220
|
], 10, Ce))), 128))
|
|
219
|
-
])) :
|
|
221
|
+
])) : v("", !0)
|
|
220
222
|
]));
|
|
221
223
|
}
|
|
222
|
-
},
|
|
224
|
+
}, $e = {
|
|
225
|
+
__name: "SpicyDivider",
|
|
226
|
+
props: {
|
|
227
|
+
variant: { type: String, default: "solid", validator: (e) => ["solid", "dashed"].includes(e) },
|
|
228
|
+
width: { type: String, default: "100%" },
|
|
229
|
+
height: { type: String, default: "1px" },
|
|
230
|
+
bgColor: { type: String, default: "var(--skBgColor)" }
|
|
231
|
+
},
|
|
232
|
+
setup(e) {
|
|
233
|
+
const t = e, l = C(() => ({
|
|
234
|
+
width: t.width,
|
|
235
|
+
height: t.height,
|
|
236
|
+
borderBottom: `${t.height} ${t.variant} ${t.bgColor}`
|
|
237
|
+
}));
|
|
238
|
+
return (a, o) => (n(), s("div", {
|
|
239
|
+
class: "spicyDivider",
|
|
240
|
+
style: I(l.value),
|
|
241
|
+
role: "separator",
|
|
242
|
+
"aria-orientation": "horizontal"
|
|
243
|
+
}, [
|
|
244
|
+
b(a.$slots, "default")
|
|
245
|
+
], 4));
|
|
246
|
+
}
|
|
247
|
+
}, xe = { class: "kbContainer" }, Be = { class: "kbSidebar" }, Te = ["onUpdate:modelValue"], Me = { class: "spicyKB" }, De = ["onMousedown", "onTouchstart", "onClick"], Fe = { class: "keyText" }, Ie = {
|
|
223
248
|
__name: "SpicyKeyboard",
|
|
224
249
|
emits: ["input"],
|
|
225
250
|
setup(e, { emit: t }) {
|
|
226
|
-
const l =
|
|
251
|
+
const l = w(null), a = w([
|
|
227
252
|
{
|
|
228
253
|
label: "Function Keys",
|
|
229
254
|
visible: !1,
|
|
@@ -280,15 +305,15 @@ const le = ["aria-label"], oe = {
|
|
|
280
305
|
["0", "."]
|
|
281
306
|
]
|
|
282
307
|
}
|
|
283
|
-
]), o =
|
|
284
|
-
() => a.value.filter((
|
|
285
|
-
),
|
|
286
|
-
l.value =
|
|
287
|
-
},
|
|
308
|
+
]), o = C(
|
|
309
|
+
() => a.value.filter((p) => p.visible).map((p) => p)
|
|
310
|
+
), r = t, d = (p) => {
|
|
311
|
+
l.value = p;
|
|
312
|
+
}, y = () => {
|
|
288
313
|
l.value = null;
|
|
289
|
-
}, u = (
|
|
290
|
-
|
|
291
|
-
}, i = (
|
|
314
|
+
}, u = (p) => {
|
|
315
|
+
r("input", p);
|
|
316
|
+
}, i = (p) => [
|
|
292
317
|
"Backspace",
|
|
293
318
|
"Tab",
|
|
294
319
|
"Caps",
|
|
@@ -306,57 +331,57 @@ const le = ["aria-label"], oe = {
|
|
|
306
331
|
"PgUp",
|
|
307
332
|
"PgDn",
|
|
308
333
|
"NumLock"
|
|
309
|
-
].includes(
|
|
310
|
-
const
|
|
311
|
-
return
|
|
334
|
+
].includes(p) ? `key-${p.toLowerCase()}` : "", c = (p, $, g) => {
|
|
335
|
+
const B = (x) => ["Backspace", "Tab", "Caps", "Enter", "Shift", "Space"].includes(x), T = (x) => ["Ctrl", "Win", "Alt", "Fn"].includes(x);
|
|
336
|
+
return B(p) ? "key-wide" : T(p) ? "key-small" : $[g].length === 1 ? "key-fullwidth" : "";
|
|
312
337
|
};
|
|
313
|
-
return (
|
|
314
|
-
|
|
315
|
-
(n(!0), s(
|
|
338
|
+
return (p, $) => (n(), s("div", xe, [
|
|
339
|
+
f("div", Be, [
|
|
340
|
+
(n(!0), s(D, null, F(a.value, (g, B) => (n(), s("div", {
|
|
316
341
|
class: "sidebar",
|
|
317
|
-
key:
|
|
342
|
+
key: B
|
|
318
343
|
}, [
|
|
319
|
-
|
|
320
|
-
|
|
344
|
+
f("label", null, [
|
|
345
|
+
_(f("input", {
|
|
321
346
|
type: "checkbox",
|
|
322
|
-
"onUpdate:modelValue": (T) =>
|
|
347
|
+
"onUpdate:modelValue": (T) => g.visible = T
|
|
323
348
|
}, null, 8, Te), [
|
|
324
|
-
[
|
|
349
|
+
[Q, g.visible]
|
|
325
350
|
]),
|
|
326
|
-
U(" " +
|
|
351
|
+
U(" " + h(g.label), 1)
|
|
327
352
|
])
|
|
328
353
|
]))), 128))
|
|
329
354
|
]),
|
|
330
|
-
|
|
331
|
-
(n(!0), s(
|
|
332
|
-
class:
|
|
333
|
-
key:
|
|
355
|
+
f("div", Me, [
|
|
356
|
+
(n(!0), s(D, null, F(o.value, (g, B) => (n(), s("div", {
|
|
357
|
+
class: k(["kbSection", { [g.label.toLowerCase().replace(/\s+/g, "")]: !0 }]),
|
|
358
|
+
key: B
|
|
334
359
|
}, [
|
|
335
|
-
(n(!0), s(
|
|
360
|
+
(n(!0), s(D, null, F(g.layout, (T, x) => (n(), s("div", {
|
|
336
361
|
class: "spicyKBRow",
|
|
337
|
-
key:
|
|
362
|
+
key: x
|
|
338
363
|
}, [
|
|
339
|
-
(n(!0), s(
|
|
340
|
-
key:
|
|
341
|
-
class:
|
|
342
|
-
{ "is-active": l.value ===
|
|
343
|
-
i(
|
|
344
|
-
|
|
364
|
+
(n(!0), s(D, null, F(T, (m) => (n(), s("button", {
|
|
365
|
+
key: m,
|
|
366
|
+
class: k(["spicyKBKey", [
|
|
367
|
+
{ "is-active": l.value === m },
|
|
368
|
+
i(m),
|
|
369
|
+
c(m, g.layout, x)
|
|
345
370
|
]]),
|
|
346
|
-
onMousedown: (O) =>
|
|
347
|
-
onMouseup:
|
|
348
|
-
onTouchstart: (O) =>
|
|
349
|
-
onTouchend:
|
|
350
|
-
onClick: (O) => u(
|
|
371
|
+
onMousedown: (O) => d(m),
|
|
372
|
+
onMouseup: y,
|
|
373
|
+
onTouchstart: (O) => d(m),
|
|
374
|
+
onTouchend: y,
|
|
375
|
+
onClick: (O) => u(m)
|
|
351
376
|
}, [
|
|
352
|
-
|
|
353
|
-
], 42,
|
|
377
|
+
f("span", Fe, h(m), 1)
|
|
378
|
+
], 42, De))), 128))
|
|
354
379
|
]))), 128))
|
|
355
380
|
], 2))), 128))
|
|
356
381
|
])
|
|
357
382
|
]));
|
|
358
383
|
}
|
|
359
|
-
},
|
|
384
|
+
}, Oe = { class: "spicyInputLabel" }, Pe = ["placeholder", "aria-label"], Ve = {
|
|
360
385
|
key: 0,
|
|
361
386
|
class: "spicyInputError"
|
|
362
387
|
}, Ae = {
|
|
@@ -373,33 +398,33 @@ const le = ["aria-label"], oe = {
|
|
|
373
398
|
}
|
|
374
399
|
},
|
|
375
400
|
setup(e) {
|
|
376
|
-
const l =
|
|
377
|
-
l.value =
|
|
378
|
-
},
|
|
401
|
+
const l = w(e.value), a = w(!1), o = (y) => {
|
|
402
|
+
l.value = y.target.value;
|
|
403
|
+
}, r = () => {
|
|
379
404
|
a.value = !1;
|
|
380
|
-
},
|
|
405
|
+
}, d = () => {
|
|
381
406
|
a.value = !0;
|
|
382
407
|
};
|
|
383
|
-
return (
|
|
384
|
-
class:
|
|
408
|
+
return (y, u) => (n(), s("div", {
|
|
409
|
+
class: k(["spicyInputWrapper", [e.variant, { hasValue: l.value || e.value, hasFocus: a.value, hasError: e.error }]])
|
|
385
410
|
}, [
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
class:
|
|
411
|
+
f("label", Oe, h(e.label), 1),
|
|
412
|
+
_(f("input", {
|
|
413
|
+
class: k(["spicyInput", e.variant]),
|
|
389
414
|
"onUpdate:modelValue": u[0] || (u[0] = (i) => l.value = i),
|
|
390
415
|
placeholder: e.placeholder,
|
|
391
416
|
onInput: o,
|
|
392
|
-
onBlur:
|
|
393
|
-
onFocus:
|
|
417
|
+
onBlur: r,
|
|
418
|
+
onFocus: d,
|
|
394
419
|
"aria-label": e.label
|
|
395
|
-
}, null, 42,
|
|
396
|
-
[
|
|
420
|
+
}, null, 42, Pe), [
|
|
421
|
+
[W, l.value]
|
|
397
422
|
]),
|
|
398
|
-
|
|
399
|
-
e.error ? (n(), s("span",
|
|
423
|
+
b(y.$slots, "default"),
|
|
424
|
+
e.error ? (n(), s("span", Ve, h(e.error), 1)) : v("", !0)
|
|
400
425
|
], 2));
|
|
401
426
|
}
|
|
402
|
-
}, _e = { class: "spicyModalHeader" }, Ke = { class: "spicyModalActions" }, Le = ["onClick"],
|
|
427
|
+
}, _e = { class: "spicyModalHeader" }, Ke = { class: "spicyModalActions" }, Le = ["onClick"], Ne = {
|
|
403
428
|
__name: "SpicyModal",
|
|
404
429
|
props: {
|
|
405
430
|
width: { type: String, default: "50%" },
|
|
@@ -414,50 +439,90 @@ const le = ["aria-label"], oe = {
|
|
|
414
439
|
},
|
|
415
440
|
emits: ["update:visible"],
|
|
416
441
|
setup(e, { emit: t }) {
|
|
417
|
-
const l = e, a =
|
|
442
|
+
const l = e, a = C(() => ({
|
|
418
443
|
"--width": l.width,
|
|
419
444
|
"--height": l.height,
|
|
420
445
|
"--skBorderRadius": l.borderRadius,
|
|
421
446
|
"--skBgColor": l.bgColor
|
|
422
|
-
})), o = t,
|
|
447
|
+
})), o = t, r = () => {
|
|
423
448
|
o("update:visible", !1);
|
|
424
|
-
},
|
|
425
|
-
l.closeOnClick &&
|
|
449
|
+
}, d = (y) => {
|
|
450
|
+
l.closeOnClick && y.target.classList.contains("spicyModalOverlay") && r();
|
|
426
451
|
};
|
|
427
|
-
return (
|
|
452
|
+
return (y, u) => e.visible ? (n(), s("div", {
|
|
428
453
|
key: 0,
|
|
429
454
|
class: "spicyModalOverlay",
|
|
430
|
-
onClick:
|
|
455
|
+
onClick: d
|
|
431
456
|
}, [
|
|
432
|
-
|
|
457
|
+
f("div", {
|
|
433
458
|
class: "spicyModal",
|
|
434
459
|
style: I({ ...a.value })
|
|
435
460
|
}, [
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
U(
|
|
461
|
+
f("header", _e, [
|
|
462
|
+
b(y.$slots, "spicyModalHeader", { title: e.modalTitle }, () => [
|
|
463
|
+
U(h(e.modalTitle), 1)
|
|
439
464
|
])
|
|
440
465
|
]),
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
466
|
+
b(y.$slots, "default"),
|
|
467
|
+
f("div", Ke, [
|
|
468
|
+
b(y.$slots, "spicyModalActions"),
|
|
444
469
|
e.actions.length === 0 && e.closeBtn ? (n(), s("button", {
|
|
445
470
|
key: 0,
|
|
446
471
|
class: "spicyModalCloseBtn spicyModalActionBtn",
|
|
447
|
-
onClick:
|
|
448
|
-
}, " Close ")) :
|
|
449
|
-
(n(!0), s(
|
|
472
|
+
onClick: r
|
|
473
|
+
}, " Close ")) : v("", !0),
|
|
474
|
+
(n(!0), s(D, null, F(e.actions, (i) => (n(), s("button", {
|
|
450
475
|
class: "spicyModalExtraBtn spicyModalActionBtn",
|
|
451
476
|
key: i.label,
|
|
452
477
|
onClick: i.handler
|
|
453
|
-
},
|
|
478
|
+
}, h(i.label), 9, Le))), 128))
|
|
454
479
|
])
|
|
455
480
|
], 4)
|
|
456
|
-
])) :
|
|
481
|
+
])) : v("", !0);
|
|
482
|
+
}
|
|
483
|
+
}, Ye = { class: "spicySlider" }, Ee = {
|
|
484
|
+
key: 0,
|
|
485
|
+
class: "spicySliderLabel"
|
|
486
|
+
}, ze = ["min", "max", "step"], Ue = {
|
|
487
|
+
__name: "SpicySlider",
|
|
488
|
+
props: {
|
|
489
|
+
min: { type: Number, default: 0 },
|
|
490
|
+
max: { type: Number, default: 100 },
|
|
491
|
+
step: { type: Number, default: 1 },
|
|
492
|
+
label: { type: String, default: "" },
|
|
493
|
+
modelValue: { type: Number, default: 0 }
|
|
494
|
+
},
|
|
495
|
+
emits: ["update:modelValue"],
|
|
496
|
+
setup(e, { emit: t }) {
|
|
497
|
+
const l = e, a = t, o = w(l.modelValue);
|
|
498
|
+
Y(
|
|
499
|
+
() => l.modelValue,
|
|
500
|
+
(d) => {
|
|
501
|
+
o.value = d;
|
|
502
|
+
}
|
|
503
|
+
);
|
|
504
|
+
const r = (d) => {
|
|
505
|
+
a("update:modelValue", Number(d.target.value));
|
|
506
|
+
};
|
|
507
|
+
return (d, y) => (n(), s("div", Ye, [
|
|
508
|
+
e.label ? (n(), s("label", Ee, h(e.label), 1)) : v("", !0),
|
|
509
|
+
_(f("input", {
|
|
510
|
+
class: "spicySliderInput",
|
|
511
|
+
type: "range",
|
|
512
|
+
min: e.min,
|
|
513
|
+
max: e.max,
|
|
514
|
+
step: e.step,
|
|
515
|
+
"onUpdate:modelValue": y[0] || (y[0] = (u) => o.value = u),
|
|
516
|
+
onInput: r
|
|
517
|
+
}, null, 40, ze), [
|
|
518
|
+
[W, o.value]
|
|
519
|
+
]),
|
|
520
|
+
b(d.$slots, "default")
|
|
521
|
+
]));
|
|
457
522
|
}
|
|
458
|
-
},
|
|
459
|
-
|
|
460
|
-
],
|
|
523
|
+
}, We = ["tabindex", "aria-label", "aria-checked", "onKeydown"], He = /* @__PURE__ */ f("div", { class: "spicyToggleKnob" }, null, -1), je = [
|
|
524
|
+
He
|
|
525
|
+
], Xe = {
|
|
461
526
|
__name: "SpicyToggle",
|
|
462
527
|
props: {
|
|
463
528
|
modelValue: Boolean,
|
|
@@ -478,33 +543,33 @@ const le = ["aria-label"], oe = {
|
|
|
478
543
|
},
|
|
479
544
|
emits: ["update:modelValue"],
|
|
480
545
|
setup(e, { emit: t }) {
|
|
481
|
-
const l = e, a =
|
|
546
|
+
const l = e, a = C(() => ({
|
|
482
547
|
"--skBorderColor": l.borderColor,
|
|
483
548
|
"--activeColor": l.activeColor
|
|
484
|
-
})), o = t,
|
|
549
|
+
})), o = t, r = () => {
|
|
485
550
|
o("update:modelValue", !l.modelValue);
|
|
486
551
|
};
|
|
487
|
-
return (
|
|
552
|
+
return (d, y) => (n(), s("div", Z({
|
|
488
553
|
class: ["spicyToggle", { outlined: e.variant === "outlined", "is-active": e.modelValue }],
|
|
489
|
-
tabindex:
|
|
554
|
+
tabindex: d.disabled ? -1 : 0,
|
|
490
555
|
role: "switch",
|
|
491
556
|
style: { ...a.value },
|
|
492
557
|
"aria-label": e.label,
|
|
493
558
|
"aria-checked": e.modelValue.toString(),
|
|
494
|
-
onClick:
|
|
559
|
+
onClick: r,
|
|
495
560
|
onKeydown: [
|
|
496
|
-
|
|
497
|
-
|
|
561
|
+
A(N(r, ["prevent"]), ["space"]),
|
|
562
|
+
A(N(r, ["prevent"]), ["enter"])
|
|
498
563
|
]
|
|
499
|
-
},
|
|
564
|
+
}, d.$attrs), je, 16, We));
|
|
500
565
|
}
|
|
501
|
-
},
|
|
566
|
+
}, Re = ["aria-hidden"], qe = {
|
|
502
567
|
key: 0,
|
|
503
568
|
class: "spicyTooltipIcon"
|
|
504
|
-
},
|
|
569
|
+
}, Ge = ["aria-label"], Je = {
|
|
505
570
|
key: 2,
|
|
506
571
|
class: "spicyTooltipIcon"
|
|
507
|
-
},
|
|
572
|
+
}, Qe = {
|
|
508
573
|
__name: "SpicyTooltip",
|
|
509
574
|
props: {
|
|
510
575
|
text: String,
|
|
@@ -517,44 +582,44 @@ const le = ["aria-label"], oe = {
|
|
|
517
582
|
}
|
|
518
583
|
},
|
|
519
584
|
setup(e) {
|
|
520
|
-
const t = e, l =
|
|
585
|
+
const t = e, l = w(!1), a = w(null), o = ee({
|
|
521
586
|
position: "absolute",
|
|
522
587
|
top: "0px",
|
|
523
588
|
left: "0px",
|
|
524
589
|
maxWidth: "175px"
|
|
525
|
-
}),
|
|
526
|
-
const
|
|
527
|
-
|
|
528
|
-
},
|
|
529
|
-
top: (i,
|
|
530
|
-
o.left = `${i.left + (i.width -
|
|
590
|
+
}), r = (i) => {
|
|
591
|
+
const c = i.right - window.innerWidth;
|
|
592
|
+
c > 0 && (o.left = `${parseInt(o.left) - c - 5}px`), i.left < 0 && (o.left = "5px");
|
|
593
|
+
}, d = {
|
|
594
|
+
top: (i, c) => {
|
|
595
|
+
o.left = `${i.left + (i.width - c.width) / 2}px`, o.top = `${i.top - c.height - 5}px`;
|
|
531
596
|
},
|
|
532
|
-
bottom: (i,
|
|
533
|
-
o.left = `${i.left + (i.width -
|
|
597
|
+
bottom: (i, c) => {
|
|
598
|
+
o.left = `${i.left + (i.width - c.width) / 2}px`, o.top = `${i.bottom + 5}px`;
|
|
534
599
|
},
|
|
535
|
-
left: (i,
|
|
536
|
-
o.left = `${i.left -
|
|
600
|
+
left: (i, c) => {
|
|
601
|
+
o.left = `${i.left - c.width - 5}px`, o.top = `${i.top + (i.height - c.height) / 2}px`;
|
|
537
602
|
},
|
|
538
|
-
right: (i,
|
|
539
|
-
o.left = `${i.right + 5}px`, o.top = `${i.top + (i.height -
|
|
603
|
+
right: (i, c) => {
|
|
604
|
+
o.left = `${i.right + 5}px`, o.top = `${i.top + (i.height - c.height) / 2}px`;
|
|
540
605
|
}
|
|
541
|
-
},
|
|
606
|
+
}, y = () => {
|
|
542
607
|
l.value = !0, te(() => {
|
|
543
608
|
if (a.value && l.value) {
|
|
544
|
-
const i = a.value.getBoundingClientRect(),
|
|
545
|
-
|
|
609
|
+
const i = a.value.getBoundingClientRect(), c = a.value.querySelector(".spicyTooltip").getBoundingClientRect(), p = d[t.position];
|
|
610
|
+
p(i, c), r(c);
|
|
546
611
|
}
|
|
547
612
|
});
|
|
548
613
|
}, u = () => {
|
|
549
614
|
l.value = !1;
|
|
550
615
|
};
|
|
551
|
-
return (i,
|
|
552
|
-
onMouseover:
|
|
616
|
+
return (i, c) => (n(), s("div", {
|
|
617
|
+
onMouseover: y,
|
|
553
618
|
onMouseleave: u,
|
|
554
619
|
ref_key: "host",
|
|
555
620
|
ref: a
|
|
556
621
|
}, [
|
|
557
|
-
|
|
622
|
+
b(i.$slots, "default"),
|
|
558
623
|
l.value ? (n(), s("div", {
|
|
559
624
|
key: 0,
|
|
560
625
|
class: "spicyTooltip",
|
|
@@ -562,18 +627,18 @@ const le = ["aria-label"], oe = {
|
|
|
562
627
|
role: "tooltip",
|
|
563
628
|
"aria-hidden": !l.value
|
|
564
629
|
}, [
|
|
565
|
-
e.prependIcon ? (n(), s("span",
|
|
630
|
+
e.prependIcon ? (n(), s("span", qe, h(e.prependIcon), 1)) : v("", !0),
|
|
566
631
|
e.text ? (n(), s("span", {
|
|
567
632
|
key: 1,
|
|
568
633
|
class: "spicyTooltipText",
|
|
569
634
|
"aria-label": e.text
|
|
570
|
-
},
|
|
571
|
-
e.appendIcon ? (n(), s("span",
|
|
572
|
-
], 12,
|
|
635
|
+
}, h(e.text), 9, Ge)) : v("", !0),
|
|
636
|
+
e.appendIcon ? (n(), s("span", Je, h(e.appendIcon), 1)) : v("", !0)
|
|
637
|
+
], 12, Re)) : v("", !0)
|
|
573
638
|
], 544));
|
|
574
639
|
}
|
|
575
640
|
};
|
|
576
|
-
function
|
|
641
|
+
function H(e, t) {
|
|
577
642
|
const l = {
|
|
578
643
|
YYYY: () => e.getFullYear().toString(),
|
|
579
644
|
MM: () => (e.getMonth() + 1).toString().padStart(2, "0"),
|
|
@@ -581,55 +646,55 @@ function W(e, t) {
|
|
|
581
646
|
};
|
|
582
647
|
return t.replace(/YYYY|MM|DD/g, (a) => l[a]());
|
|
583
648
|
}
|
|
584
|
-
function
|
|
649
|
+
function Ze(e) {
|
|
585
650
|
const [t, l, a] = e.split("-");
|
|
586
651
|
return new Date(Number(t), Number(l) - 1, Number(a));
|
|
587
652
|
}
|
|
588
|
-
function
|
|
653
|
+
function et(e, t) {
|
|
589
654
|
const l = Math.abs(t.getTime() - e.getTime());
|
|
590
655
|
return Math.ceil(l / (1e3 * 60 * 60 * 24));
|
|
591
656
|
}
|
|
592
|
-
function
|
|
657
|
+
function tt(e, t) {
|
|
593
658
|
const l = new Date(e);
|
|
594
659
|
return l.setDate(e.getDate() + t), l;
|
|
595
660
|
}
|
|
596
|
-
function
|
|
661
|
+
function lt(e, t) {
|
|
597
662
|
const l = new Date(e);
|
|
598
663
|
return l.setDate(e.getDate() - t), l;
|
|
599
664
|
}
|
|
600
|
-
function
|
|
665
|
+
function ot(e) {
|
|
601
666
|
const t = /* @__PURE__ */ new Date();
|
|
602
667
|
return e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
|
|
603
668
|
}
|
|
604
|
-
function
|
|
669
|
+
function at(e) {
|
|
605
670
|
const t = /* @__PURE__ */ new Date();
|
|
606
671
|
return t.setDate(t.getDate() - 1), e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
|
|
607
672
|
}
|
|
608
|
-
function
|
|
673
|
+
function nt(e) {
|
|
609
674
|
const t = /* @__PURE__ */ new Date();
|
|
610
675
|
return t.setDate(t.getDate() + 1), e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
|
|
611
676
|
}
|
|
612
|
-
function
|
|
677
|
+
function st(e = "YYYY-MM-DD", t = { show: !0, separator: "-" }) {
|
|
613
678
|
if (typeof e != "string" || typeof t != "object" || !t.hasOwnProperty("show") || typeof t.show != "boolean")
|
|
614
679
|
throw new Error(
|
|
615
680
|
'Invalid parameters: Please provide a valid format string and options object with a boolean "show" property.'
|
|
616
681
|
);
|
|
617
|
-
let a =
|
|
682
|
+
let a = H(/* @__PURE__ */ new Date(), e);
|
|
618
683
|
return t.separator && t.separator !== "-" && (a = a.replace(/-/g, t.separator)), t.show ? { value: a, isVisible: !0 } : { value: a, isVisible: !1 };
|
|
619
684
|
}
|
|
620
|
-
const
|
|
685
|
+
const mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
621
686
|
__proto__: null,
|
|
622
|
-
currentDate:
|
|
623
|
-
dateAdd:
|
|
624
|
-
dateDiff:
|
|
625
|
-
dateIsToday:
|
|
626
|
-
dateIsTomorrow:
|
|
627
|
-
dateIsYesterday:
|
|
628
|
-
dateSubtract:
|
|
629
|
-
formatDate:
|
|
630
|
-
parseDate:
|
|
687
|
+
currentDate: st,
|
|
688
|
+
dateAdd: tt,
|
|
689
|
+
dateDiff: et,
|
|
690
|
+
dateIsToday: ot,
|
|
691
|
+
dateIsTomorrow: nt,
|
|
692
|
+
dateIsYesterday: at,
|
|
693
|
+
dateSubtract: lt,
|
|
694
|
+
formatDate: H,
|
|
695
|
+
parseDate: Ze
|
|
631
696
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
632
|
-
function
|
|
697
|
+
function it(e) {
|
|
633
698
|
const t = /* @__PURE__ */ new WeakMap();
|
|
634
699
|
function l(a) {
|
|
635
700
|
if (M(a) || typeof a != "object")
|
|
@@ -638,48 +703,48 @@ function lt(e) {
|
|
|
638
703
|
return t.get(a);
|
|
639
704
|
const o = Array.isArray(a) ? [] : {};
|
|
640
705
|
t.set(a, o);
|
|
641
|
-
for (const
|
|
642
|
-
Object.prototype.hasOwnProperty.call(a,
|
|
706
|
+
for (const r in a)
|
|
707
|
+
Object.prototype.hasOwnProperty.call(a, r) && (o[r] = l(a[r]));
|
|
643
708
|
return o;
|
|
644
709
|
}
|
|
645
710
|
return l(e);
|
|
646
711
|
}
|
|
647
|
-
function
|
|
712
|
+
function j(...e) {
|
|
648
713
|
const t = {};
|
|
649
714
|
return e.forEach((l) => {
|
|
650
715
|
if (!M(l)) {
|
|
651
716
|
for (const a in l)
|
|
652
717
|
if (Object.prototype.hasOwnProperty.call(l, a)) {
|
|
653
718
|
const o = l[a];
|
|
654
|
-
o !== void 0 && (typeof o == "object" && o !== null && !Array.isArray(o) ? t[a] =
|
|
719
|
+
o !== void 0 && (typeof o == "object" && o !== null && !Array.isArray(o) ? t[a] = j(t[a] || {}, o) : t[a] = o);
|
|
655
720
|
}
|
|
656
721
|
}
|
|
657
722
|
}), t;
|
|
658
723
|
}
|
|
659
|
-
function
|
|
724
|
+
function rt(...e) {
|
|
660
725
|
return M(e[0]) ? e[0] : Object.assign({}, ...e);
|
|
661
726
|
}
|
|
662
|
-
function
|
|
727
|
+
function ct(e) {
|
|
663
728
|
return M(e) ? [] : Object.keys(e);
|
|
664
729
|
}
|
|
665
|
-
function
|
|
730
|
+
function ut(e) {
|
|
666
731
|
return M(e) ? [] : Object.values(e);
|
|
667
732
|
}
|
|
668
|
-
function
|
|
733
|
+
function dt(e) {
|
|
669
734
|
return M(e) ? [] : Object.entries(e);
|
|
670
735
|
}
|
|
671
736
|
function M(e) {
|
|
672
737
|
return e === null || typeof e != "object" ? !1 : Array.isArray(e) ? e.length === 0 : Object.keys(e).length === 0;
|
|
673
738
|
}
|
|
674
|
-
const
|
|
739
|
+
const bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
675
740
|
__proto__: null,
|
|
676
|
-
deepClone:
|
|
677
|
-
deepMerge:
|
|
678
|
-
getObjectEntries:
|
|
679
|
-
getObjectKeys:
|
|
680
|
-
getObjectValues:
|
|
741
|
+
deepClone: it,
|
|
742
|
+
deepMerge: j,
|
|
743
|
+
getObjectEntries: dt,
|
|
744
|
+
getObjectKeys: ct,
|
|
745
|
+
getObjectValues: ut,
|
|
681
746
|
isObjectEmpty: M,
|
|
682
|
-
mergeObjects:
|
|
747
|
+
mergeObjects: rt
|
|
683
748
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
684
749
|
function K(e) {
|
|
685
750
|
try {
|
|
@@ -688,33 +753,33 @@ function K(e) {
|
|
|
688
753
|
return console.error("Invalid URL:", t), !1;
|
|
689
754
|
}
|
|
690
755
|
}
|
|
691
|
-
function
|
|
756
|
+
function yt(e) {
|
|
692
757
|
return K(e) ? new URL(e).hostname : null;
|
|
693
758
|
}
|
|
694
|
-
function
|
|
759
|
+
function pt(e, t) {
|
|
695
760
|
if (!K(e)) return e;
|
|
696
761
|
const l = new URL(e);
|
|
697
762
|
return Object.keys(t).forEach((a) => l.searchParams.append(a, t[a])), l.toString();
|
|
698
763
|
}
|
|
699
|
-
function
|
|
764
|
+
function ft(e, t, l = "https") {
|
|
700
765
|
if (!["http", "https", "ftp", "sftp", "ftps", "ssh"].includes(l.toLowerCase()))
|
|
701
766
|
throw new Error("Invalid protocol: " + l);
|
|
702
767
|
if (!/^(?!:\/\/)([a-z0-9-]+\.)*[a-z0-9-]+$/i.test(e))
|
|
703
768
|
throw new Error("Invalid hostname: " + e);
|
|
704
769
|
return t.startsWith("/") || (t = "/" + t), t.endsWith("/") && t.length > 1 && (t = t.slice(0, -1)), t === "/" && (t = ""), `${l.toLowerCase()}://${e}${t}`;
|
|
705
770
|
}
|
|
706
|
-
const
|
|
771
|
+
const St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
707
772
|
__proto__: null,
|
|
708
|
-
appendParamsToUrl:
|
|
709
|
-
generateUrl:
|
|
710
|
-
getHostname:
|
|
773
|
+
appendParamsToUrl: pt,
|
|
774
|
+
generateUrl: ft,
|
|
775
|
+
getHostname: yt,
|
|
711
776
|
isUrlValid: K
|
|
712
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
777
|
+
}, Symbol.toStringTag, { value: "Module" })), vt = ':root{--skBgColor: #28292a;--skBgSecondaryColor: #424344;--skBorderColor: #515353;--skPrimaryColor: #811faf;--skSecondaryColor: #0066b3;--skAccentColor: #004a77;--skHoverColor: #656769;--skTextColor: #ddd;--disabledOpacity: .5;--skLabelFocus: var(--skPrimaryColor);--skFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;--skFontSize: 14px;--skFontWeight: 500;--skBorderWidth: 2px;--skBorderRadius: 4px}.spicyText{color:var(--skTextColor);font-family:var(--skFontFamily);font-size:var(--skFontSize)}.spicyHeader{color:var(--skTextColor);font-family:var(--skFontFamily);font-size:24px;font-weight:700}.spicyLink:hover{color:var(--skHoverColor)}.spicyLink:active{color:var(--skPrimaryColor)}.spicyLink:focus{color:var(--skLabelFocus)}.spicyLink:disabled{opacity:var(--disabledOpacity)}', Ct = {
|
|
713
778
|
install(e, t = {}) {
|
|
714
779
|
const { useComponents: l = !0, useStyles: a = !0 } = t;
|
|
715
|
-
if (l && (e.component("SpicyAlert", ne), e.component("SpicyBtn", ce), e.component("SpicyCarousel", we), e.component("SpicyKeyboard",
|
|
780
|
+
if (l && (e.component("SpicyAlert", ne), e.component("SpicyBtn", ce), e.component("SpicyCarousel", we), e.component("SpicyDivider", $e), e.component("SpicyKeyboard", Ie), e.component("SpicyLabel", Ae), e.component("SpicyModal", Ne), e.component("SpicySlider", Ue), e.component("SpicyToggle", Xe), e.component("SpicyTooltip", Qe)), a) {
|
|
716
781
|
const o = document.createElement("style");
|
|
717
|
-
o.textContent =
|
|
782
|
+
o.textContent = vt, document.head.appendChild(o);
|
|
718
783
|
}
|
|
719
784
|
}
|
|
720
785
|
};
|
|
@@ -722,34 +787,36 @@ export {
|
|
|
722
787
|
ne as SpicyAlert,
|
|
723
788
|
ce as SpicyBtn,
|
|
724
789
|
we as SpicyCarousel,
|
|
725
|
-
|
|
726
|
-
|
|
790
|
+
$e as SpicyDivider,
|
|
791
|
+
Ct as SpicyKatsu,
|
|
792
|
+
Ie as SpicyKeyboard,
|
|
727
793
|
Ae as SpicyLabel,
|
|
728
|
-
|
|
729
|
-
Ue as
|
|
730
|
-
Xe as
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
794
|
+
Ne as SpicyModal,
|
|
795
|
+
Ue as SpicySlider,
|
|
796
|
+
Xe as SpicyToggle,
|
|
797
|
+
Qe as SpicyTooltip,
|
|
798
|
+
pt as appendParamsToUrl,
|
|
799
|
+
st as currentDate,
|
|
800
|
+
tt as dateAdd,
|
|
801
|
+
et as dateDiff,
|
|
802
|
+
ot as dateIsToday,
|
|
803
|
+
nt as dateIsTomorrow,
|
|
804
|
+
at as dateIsYesterday,
|
|
805
|
+
lt as dateSubtract,
|
|
806
|
+
mt as dateUtils,
|
|
807
|
+
it as deepClone,
|
|
808
|
+
j as deepMerge,
|
|
809
|
+
H as formatDate,
|
|
810
|
+
ft as generateUrl,
|
|
811
|
+
yt as getHostname,
|
|
812
|
+
dt as getObjectEntries,
|
|
813
|
+
ct as getObjectKeys,
|
|
814
|
+
ut as getObjectValues,
|
|
748
815
|
M as isObjectEmpty,
|
|
749
816
|
K as isUrlValid,
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
817
|
+
rt as mergeObjects,
|
|
818
|
+
bt as objUtils,
|
|
819
|
+
Ze as parseDate,
|
|
820
|
+
vt as spicyStyles,
|
|
821
|
+
St as urlUtils
|
|
755
822
|
};
|
package/dist/spicykatsu.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.SpicyKatsu={},r.Vue))})(this,function(r,e){"use strict";const ee=["aria-label"],te={key:0,class:"spicyAlertIcon"},le={key:1,class:"spicyAlertText"},V={__name:"SpicyAlert",props:{variant:{type:String,default:"info",validator:t=>["info","success","warning","error","custom"].includes(t)},text:{type:String,default:""},icon:String,iconOnly:Boolean,closable:{type:Boolean,default:!1},autoClose:{type:Number,default:0}},setup(t){const l=t,o=e.ref(!0),a=()=>{o.value=!1};return e.watch(()=>l.autoClose,n=>{n>0&&setTimeout(()=>{o.value=!1},n)}),(n,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["spicyAlert",t.variant]),"aria-atomic":"true","aria-label":t.text,role:"alert",onKeydown:e.withKeys(a,["enter"])},[t.iconOnly||t.text?(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(t.icon),1)):e.createCommentVNode("",!0),!t.iconOnly&&t.text?(e.openBlock(),e.createElementBlock("span",le,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0),t.closable?(e.openBlock(),e.createElementBlock("button",{key:2,class:"spicyAlertCloseBtn",onClick:a,"aria-label":"Close alert"}," X ")):e.createCommentVNode("",!0)],42,ee)):e.createCommentVNode("",!0)]),_:1}))}},oe=["disabled","aria-label","aria-disabled"],ne={key:0,class:"spicyBtnIcon"},ae={key:1,class:"spicyBtnText"},N={__name:"SpicyBtn",props:{variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)},disabled:{type:Boolean,default:!1},text:{type:String,default:"Button"},icon:String,bgColor:String,textColor:String,hoverColor:String,borderColor:String,fontSize:{type:[Number,String],default:14},fontWeight:{type:[Number,String],default:500}},emits:["click"],setup(t,{emit:l}){const o=t,a=e.computed(()=>({"--skFontSize":o.fontSize,"--skFontWeight":o.fontWeight,"--skBgColor":o.bgColor,"--skTextColor":o.textColor,"--skBorderColor":o.borderColor,"--hoverColor":o.hoverColor}));return(n,c)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["spicyBtn",{outlined:t.variant==="outlined",disabled:t.disabled}]),style:e.normalizeStyle({...a.value}),disabled:t.disabled,onClick:c[0]||(c[0]=u=>n.$emit("click")),role:"button","aria-label":t.text,"aria-disabled":t.disabled},[t.icon?(e.openBlock(),e.createElementBlock("span",ne,e.toDisplayString(t.icon),1)):e.createCommentVNode("",!0),t.text?(e.openBlock(),e.createElementBlock("span",ae,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"default")],14,oe))}},re={class:"spicyCarouselWrapper"},ie=["aria-label"],se={class:"spicyCarouselInfoText"},ce={class:"spicyCarouselTitle"},de={key:0},ye={key:0,class:"spicyCarouselNavControls"},pe=[e.createElementVNode("span",{class:"spicyCarouselPrevBtnIcon"},"<",-1)],ue=[e.createElementVNode("span",{class:"spicyCarouselNextBtnIcon"},">",-1)],fe={key:1,class:"spicyCarouselPagination"},me=["onClick"],ge={class:"spicyCarouselPage"},M={__name:"SpicyCarousel",props:{autoplay:{type:Boolean,default:!1},autoplaySpeed:{type:Number,default:5e3},showNavigation:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},activeColor:{type:String,default:"#00ffea80"},loop:{type:Boolean,default:!0},initialSlide:{type:Number,default:0},slides:{type:Array,required:!0},width:{type:String,default:"580px"},height:{type:String,default:"360px"},fullScreen:{type:Boolean,default:!1},enableImageClick:{type:Boolean,default:!1}},setup(t){let l,o,a=!1;const n=t,c=e.computed(()=>({"--width":n.width,"--height":n.height,"--activeColor":n.activeColor})),u=e.computed(()=>n.slides[d.value].title),p=e.computed(()=>i.value.fullScreen===!1?!1:n.fullScreen),d=e.ref(n.initialSlide),i=e.computed(()=>n.slides[d.value]);let s;const y=()=>{d.value=(d.value-1+n.slides.length)%n.slides.length},k=()=>{d.value=(d.value+1)%n.slides.length},f=g=>{d.value=g},b=()=>{clearInterval(s)},C=()=>{n.autoplay&&(s=setInterval(k,n.autoplaySpeed))},S=()=>{window.open(i.value.img)},m=()=>{n.enableImageClick&&S()},w=g=>{l=g.touches[0].clientX,o=g.touches[0].clientY,a=!1},Le=g=>{if(!a){const E=g.touches[0].clientX-l,v=g.touches[0].clientY-o;Math.abs(E)>Math.abs(v)&&(E>40?(y(),a=!0):E<-40&&(k(),a=!0))}};return e.onMounted(()=>{n.autoplay&&(s=setInterval(k,n.autoplaySpeed))}),e.onUnmounted(()=>{clearInterval(s)}),(g,E)=>(e.openBlock(),e.createElementBlock("div",re,[e.createElementVNode("div",{class:"spicyCarouselContainer",style:e.normalizeStyle({...c.value}),onMouseenter:b,onMouseleave:C,onTouchstart:w,onTouchmove:Le},[e.createVNode(e.Transition,{name:"slide",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["spicyCarouselSlide",{pointCursor:n.enableImageClick}]),key:d.value,style:e.normalizeStyle({backgroundImage:`url(${i.value.img})`}),onClick:m},[t.slides[d.value].text?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["spicyCarouselTextOverlay",{fullScreen:p.value}]),"aria-label":t.slides[d.value].text},[e.createElementVNode("span",se,e.toDisplayString(t.slides[d.value].text),1)],10,ie)):e.createCommentVNode("",!0),e.renderSlot(g.$slots,"default")],6))]),_:3})],36),e.createElementVNode("div",ce,[u.value?(e.openBlock(),e.createElementBlock("h2",de,e.toDisplayString(i.value.title),1)):e.createCommentVNode("",!0)]),t.showNavigation?(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("button",{class:"spicyCarouselPrevBtn",onClick:y},pe),e.createElementVNode("button",{class:"spicyCarouselNextBtn",onClick:k},ue)])):e.createCommentVNode("",!0),t.showPagination?(e.openBlock(),e.createElementBlock("div",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.slides,(v,T)=>(e.openBlock(),e.createElementBlock("button",{key:T,onClick:We=>f(T),class:e.normalizeClass(["spicyCarouselPageBtn",{active:T===d.value}])},[e.createElementVNode("span",ge,e.toDisplayString(T+1),1)],10,me))),128))])):e.createCommentVNode("",!0)]))}},he={class:"kbContainer"},ke={class:"kbSidebar"},Se=["onUpdate:modelValue"],be={class:"spicyKB"},Ce=["onMousedown","onTouchstart","onClick"],Be={class:"keyText"},F={__name:"SpicyKeyboard",emits:["input"],setup(t,{emit:l}){const o=e.ref(null),a=e.ref([{label:"Function Keys",visible:!1,layout:[["Esc","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","PrtScr","ScrLk","Pause"]]},{label:"Main Keys",visible:!0,layout:[["`","1","2","3","4","5","6","7","8","9","0","-","=","Backspace"],["Tab","Q","W","E","R","T","Y","U","I","O","P","[","]","\\"],["Caps","A","S","D","F","G","H","J","K","L",";","'","Enter"],["Shift","Z","X","C","V","B","N","M",",",".","/","Shift"],["Ctrl","Win","Alt","Space","Alt","Fn","Ctrl"]]},{label:"Arrow Keys",visible:!0,layout:[["Ins","Home","PgUp"],["Del","End","PgDn"],["↑","←","↓","→"]]},{label:"Numpad",visible:!0,layout:[["NumLock","/","*","-"],["7","8","9","+"],["4","5","6"],["1","2","3","Enter"],["0","."]]}]),n=e.computed(()=>a.value.filter(y=>y.visible).map(y=>y)),c=l,u=y=>{o.value=y},p=()=>{o.value=null},d=y=>{c("input",y)},i=y=>["Backspace","Tab","Caps","Enter","Shift","Ctrl","Win","Alt","Space","Fn","Ins","Del","Home","End","PgUp","PgDn","NumLock"].includes(y)?`key-${y.toLowerCase()}`:"",s=(y,k,f)=>{const b=S=>["Backspace","Tab","Caps","Enter","Shift","Space"].includes(S),C=S=>["Ctrl","Win","Alt","Fn"].includes(S);return b(y)?"key-wide":C(y)?"key-small":k[f].length===1?"key-fullwidth":""};return(y,k)=>(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(f,b)=>(e.openBlock(),e.createElementBlock("div",{class:"sidebar",key:b},[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":C=>f.visible=C},null,8,Se),[[e.vModelCheckbox,f.visible]]),e.createTextVNode(" "+e.toDisplayString(f.label),1)])]))),128))]),e.createElementVNode("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(f,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["kbSection",{[f.label.toLowerCase().replace(/\s+/g,"")]:!0}]),key:b},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.layout,(C,S)=>(e.openBlock(),e.createElementBlock("div",{class:"spicyKBRow",key:S},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C,m=>(e.openBlock(),e.createElementBlock("button",{key:m,class:e.normalizeClass(["spicyKBKey",[{"is-active":o.value===m},i(m),s(m,f.layout,S)]]),onMousedown:w=>u(m),onMouseup:p,onTouchstart:w=>u(m),onTouchend:p,onClick:w=>d(m)},[e.createElementVNode("span",Be,e.toDisplayString(m),1)],42,Ce))),128))]))),128))],2))),128))])]))}},we={class:"spicyInputLabel"},Ee=["placeholder","aria-label"],Te={key:0,class:"spicyInputError"},I={__name:"SpicyLabel",props:{value:{type:String,default:""},placeholder:{type:String,default:""},label:{type:String,default:""},error:{type:String,default:""},variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)}},setup(t){const l=t,o=e.ref(l.value),a=e.ref(!1),n=p=>{o.value=p.target.value},c=()=>{a.value=!1},u=()=>{a.value=!0};return(p,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["spicyInputWrapper",[t.variant,{hasValue:o.value||t.value,hasFocus:a.value,hasError:t.error}]])},[e.createElementVNode("label",we,e.toDisplayString(t.label),1),e.withDirectives(e.createElementVNode("input",{class:e.normalizeClass(["spicyInput",t.variant]),"onUpdate:modelValue":d[0]||(d[0]=i=>o.value=i),placeholder:t.placeholder,onInput:n,onBlur:c,onFocus:u,"aria-label":t.label},null,42,Ee),[[e.vModelText,o.value]]),e.renderSlot(p.$slots,"default"),t.error?(e.openBlock(),e.createElementBlock("span",Te,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)],2))}},De={class:"spicyModalHeader"},$e={class:"spicyModalActions"},Ve=["onClick"],O={__name:"SpicyModal",props:{width:{type:String,default:"50%"},height:{type:String,default:"auto"},borderRadius:{type:String,default:"8px"},bgColor:{type:String,default:"#2b2b2b"},visible:{type:Boolean,default:!1},closeBtn:{type:Boolean,default:!1},actions:{type:Array,default:()=>[]},closeOnClick:{type:Boolean,default:!0},modalTitle:{type:String,default:""}},emits:["update:visible"],setup(t,{emit:l}){const o=t,a=e.computed(()=>({"--width":o.width,"--height":o.height,"--skBorderRadius":o.borderRadius,"--skBgColor":o.bgColor})),n=l,c=()=>{n("update:visible",!1)},u=p=>{o.closeOnClick&&p.target.classList.contains("spicyModalOverlay")&&c()};return(p,d)=>t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"spicyModalOverlay",onClick:u},[e.createElementVNode("div",{class:"spicyModal",style:e.normalizeStyle({...a.value})},[e.createElementVNode("header",De,[e.renderSlot(p.$slots,"spicyModalHeader",{title:t.modalTitle},()=>[e.createTextVNode(e.toDisplayString(t.modalTitle),1)])]),e.renderSlot(p.$slots,"default"),e.createElementVNode("div",$e,[e.renderSlot(p.$slots,"spicyModalActions"),t.actions.length===0&&t.closeBtn?(e.openBlock(),e.createElementBlock("button",{key:0,class:"spicyModalCloseBtn spicyModalActionBtn",onClick:c}," Close ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,i=>(e.openBlock(),e.createElementBlock("button",{class:"spicyModalExtraBtn spicyModalActionBtn",key:i.label,onClick:i.handler},e.toDisplayString(i.label),9,Ve))),128))])],4)])):e.createCommentVNode("",!0)}},Ne=["aria-label","aria-checked","onKeydown"],Me=[e.createElementVNode("div",{class:"spicyToggleKnob"},null,-1)],_={__name:"SpicyToggle",props:{modelValue:Boolean,label:{type:String,default:"Toggle"},variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)},borderColor:String,activeColor:{type:String,default:"var(--skPrimaryColor)"}},emits:["update:modelValue"],setup(t,{emit:l}){const o=t,a=e.computed(()=>({"--skBorderColor":o.borderColor,"--activeColor":o.activeColor})),n=l,c=()=>{n("update:modelValue",!o.modelValue)};return(u,p)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["spicyToggle",{outlined:t.variant==="outlined","is-active":t.modelValue}],tabindex:"0",role:"switch",style:{...a.value},"aria-label":t.label,"aria-checked":t.modelValue.toString(),onClick:c,onKeydown:[e.withKeys(e.withModifiers(c,["prevent"]),["space"]),e.withKeys(e.withModifiers(c,["prevent"]),["enter"])]},u.$attrs),Me,16,Ne))}},Fe=["aria-hidden"],Ie={key:0,class:"spicyTooltipIcon"},Oe=["aria-label"],_e={key:2,class:"spicyTooltipIcon"},K={__name:"SpicyTooltip",props:{text:String,prependIcon:String,appendIcon:String,position:{type:String,default:"top",validator:t=>["top","bottom","left","right"].includes(t)}},setup(t){const l=t,o=e.ref(!1),a=e.ref(null),n=e.reactive({position:"absolute",top:"0px",left:"0px",maxWidth:"175px"}),c=i=>{const s=i.right-window.innerWidth;s>0&&(n.left=`${parseInt(n.left)-s-5}px`),i.left<0&&(n.left="5px")},u={top:(i,s)=>{n.left=`${i.left+(i.width-s.width)/2}px`,n.top=`${i.top-s.height-5}px`},bottom:(i,s)=>{n.left=`${i.left+(i.width-s.width)/2}px`,n.top=`${i.bottom+5}px`},left:(i,s)=>{n.left=`${i.left-s.width-5}px`,n.top=`${i.top+(i.height-s.height)/2}px`},right:(i,s)=>{n.left=`${i.right+5}px`,n.top=`${i.top+(i.height-s.height)/2}px`}},p=()=>{o.value=!0,e.nextTick(()=>{if(a.value&&o.value){const i=a.value.getBoundingClientRect(),s=a.value.querySelector(".spicyTooltip").getBoundingClientRect(),y=u[l.position];y(i,s),c(s)}})},d=()=>{o.value=!1};return(i,s)=>(e.openBlock(),e.createElementBlock("div",{onMouseover:p,onMouseleave:d,ref_key:"host",ref:a},[e.renderSlot(i.$slots,"default"),o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"spicyTooltip",style:e.normalizeStyle(n),role:"tooltip","aria-hidden":!o.value},[t.prependIcon?(e.openBlock(),e.createElementBlock("span",Ie,e.toDisplayString(t.prependIcon),1)):e.createCommentVNode("",!0),t.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:"spicyTooltipText","aria-label":t.text},e.toDisplayString(t.text),9,Oe)):e.createCommentVNode("",!0),t.appendIcon?(e.openBlock(),e.createElementBlock("span",_e,e.toDisplayString(t.appendIcon),1)):e.createCommentVNode("",!0)],12,Fe)):e.createCommentVNode("",!0)],544))}};function D(t,l){const o={YYYY:()=>t.getFullYear().toString(),MM:()=>(t.getMonth()+1).toString().padStart(2,"0"),DD:()=>t.getDate().toString().padStart(2,"0")};return l.replace(/YYYY|MM|DD/g,a=>o[a]())}function P(t){const[l,o,a]=t.split("-");return new Date(Number(l),Number(o)-1,Number(a))}function x(t,l){const o=Math.abs(l.getTime()-t.getTime());return Math.ceil(o/(1e3*60*60*24))}function A(t,l){const o=new Date(t);return o.setDate(t.getDate()+l),o}function L(t,l){const o=new Date(t);return o.setDate(t.getDate()-l),o}function z(t){const l=new Date;return t.getDate()===l.getDate()&&t.getMonth()===l.getMonth()&&t.getFullYear()===l.getFullYear()}function Y(t){const l=new Date;return l.setDate(l.getDate()-1),t.getDate()===l.getDate()&&t.getMonth()===l.getMonth()&&t.getFullYear()===l.getFullYear()}function U(t){const l=new Date;return l.setDate(l.getDate()+1),t.getDate()===l.getDate()&&t.getMonth()===l.getMonth()&&t.getFullYear()===l.getFullYear()}function W(t="YYYY-MM-DD",l={show:!0,separator:"-"}){if(typeof t!="string"||typeof l!="object"||!l.hasOwnProperty("show")||typeof l.show!="boolean")throw new Error('Invalid parameters: Please provide a valid format string and options object with a boolean "show" property.');let a=D(new Date,t);return l.separator&&l.separator!=="-"&&(a=a.replace(/-/g,l.separator)),l.show?{value:a,isVisible:!0}:{value:a,isVisible:!1}}const Ke=Object.freeze(Object.defineProperty({__proto__:null,currentDate:W,dateAdd:A,dateDiff:x,dateIsToday:z,dateIsTomorrow:U,dateIsYesterday:Y,dateSubtract:L,formatDate:D,parseDate:P},Symbol.toStringTag,{value:"Module"}));function j(t){const l=new WeakMap;function o(a){if(h(a)||typeof a!="object")return a;if(l.has(a))return l.get(a);const n=Array.isArray(a)?[]:{};l.set(a,n);for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(n[c]=o(a[c]));return n}return o(t)}function $(...t){const l={};return t.forEach(o=>{if(!h(o)){for(const a in o)if(Object.prototype.hasOwnProperty.call(o,a)){const n=o[a];n!==void 0&&(typeof n=="object"&&n!==null&&!Array.isArray(n)?l[a]=$(l[a]||{},n):l[a]=n)}}}),l}function H(...t){return h(t[0])?t[0]:Object.assign({},...t)}function X(t){return h(t)?[]:Object.keys(t)}function R(t){return h(t)?[]:Object.values(t)}function q(t){return h(t)?[]:Object.entries(t)}function h(t){return t===null||typeof t!="object"?!1:Array.isArray(t)?t.length===0:Object.keys(t).length===0}const Pe=Object.freeze(Object.defineProperty({__proto__:null,deepClone:j,deepMerge:$,getObjectEntries:q,getObjectKeys:X,getObjectValues:R,isObjectEmpty:h,mergeObjects:H},Symbol.toStringTag,{value:"Module"}));function B(t){try{return new URL(t),!0}catch(l){return console.error("Invalid URL:",l),!1}}function G(t){return B(t)?new URL(t).hostname:null}function J(t,l){if(!B(t))return t;const o=new URL(t);return Object.keys(l).forEach(a=>o.searchParams.append(a,l[a])),o.toString()}function Q(t,l,o="https"){if(!["http","https","ftp","sftp","ftps","ssh"].includes(o.toLowerCase()))throw new Error("Invalid protocol: "+o);if(!/^(?!:\/\/)([a-z0-9-]+\.)*[a-z0-9-]+$/i.test(t))throw new Error("Invalid hostname: "+t);return l.startsWith("/")||(l="/"+l),l.endsWith("/")&&l.length>1&&(l=l.slice(0,-1)),l==="/"&&(l=""),`${o.toLowerCase()}://${t}${l}`}const xe=Object.freeze(Object.defineProperty({__proto__:null,appendParamsToUrl:J,generateUrl:Q,getHostname:G,isUrlValid:B},Symbol.toStringTag,{value:"Module"})),Z=':root{--skBgColor: #28292a;--skBgSecondaryColor: #424344;--skBorderColor: #515353;--skPrimaryColor: #811faf;--skSecondaryColor: #0066b3;--skAccentColor: #004a77;--skHoverColor: #656769;--skTextColor: #ddd;--disabledOpacity: .5;--skLabelFocus: var(--skPrimaryColor);--skFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;--skFontSize: 14px;--skFontWeight: 500;--skBorderWidth: 2px;--skBorderRadius: 4px}.spicyText{color:var(--skTextColor);font-family:var(--skFontFamily);font-size:var(--skFontSize)}.spicyHeader{color:var(--skTextColor);font-family:var(--skFontFamily);font-size:24px;font-weight:700}.spicyLink:hover{color:var(--skHoverColor)}.spicyLink:active{color:var(--skPrimaryColor)}.spicyLink:focus{color:var(--skLabelFocus)}.spicyLink:disabled{opacity:var(--disabledOpacity)}',Ae={install(t,l={}){const{useComponents:o=!0,useStyles:a=!0}=l;if(o&&(t.component("SpicyAlert",V),t.component("SpicyBtn",N),t.component("SpicyCarousel",M),t.component("SpicyKeyboard",F),t.component("SpicyLabel",I),t.component("SpicyModal",O),t.component("SpicyToggle",_),t.component("SpicyTooltip",K)),a){const n=document.createElement("style");n.textContent=Z,document.head.appendChild(n)}}};r.SpicyAlert=V,r.SpicyBtn=N,r.SpicyCarousel=M,r.SpicyKatsu=Ae,r.SpicyKeyboard=F,r.SpicyLabel=I,r.SpicyModal=O,r.SpicyToggle=_,r.SpicyTooltip=K,r.appendParamsToUrl=J,r.currentDate=W,r.dateAdd=A,r.dateDiff=x,r.dateIsToday=z,r.dateIsTomorrow=U,r.dateIsYesterday=Y,r.dateSubtract=L,r.dateUtils=Ke,r.deepClone=j,r.deepMerge=$,r.formatDate=D,r.generateUrl=Q,r.getHostname=G,r.getObjectEntries=q,r.getObjectKeys=X,r.getObjectValues=R,r.isObjectEmpty=h,r.isUrlValid=B,r.mergeObjects=H,r.objUtils=Pe,r.parseDate=P,r.spicyStyles=Z,r.urlUtils=xe,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i.SpicyKatsu={},i.Vue))})(this,function(i,e){"use strict";const le=["aria-label"],oe={key:0,class:"spicyAlertIcon"},ne={key:1,class:"spicyAlertText"},T={__name:"SpicyAlert",props:{variant:{type:String,default:"info",validator:t=>["info","success","warning","error","custom"].includes(t)},text:{type:String,default:""},icon:String,iconOnly:Boolean,closable:{type:Boolean,default:!1},autoClose:{type:Number,default:0}},setup(t){const l=t,o=e.ref(!0),a=()=>{o.value=!1};return e.watch(()=>l.autoClose,n=>{n>0&&setTimeout(()=>{o.value=!1},n)}),(n,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["spicyAlert",t.variant]),"aria-atomic":"true","aria-label":t.text,role:"alert",onKeydown:e.withKeys(a,["enter"])},[t.iconOnly||t.text?(e.openBlock(),e.createElementBlock("span",oe,e.toDisplayString(t.icon),1)):e.createCommentVNode("",!0),!t.iconOnly&&t.text?(e.openBlock(),e.createElementBlock("span",ne,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0),t.closable?(e.openBlock(),e.createElementBlock("button",{key:2,class:"spicyAlertCloseBtn",onClick:a,"aria-label":"Close alert"}," X ")):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"default")],42,le)):e.createCommentVNode("",!0)]),_:3}))}},ae=["disabled","aria-label","aria-disabled","tabindex"],ie={key:0,class:"spicyBtnIcon"},re={key:1,class:"spicyBtnText"},N={__name:"SpicyBtn",props:{variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)},disabled:{type:Boolean,default:!1},text:{type:String,default:"Button"},icon:String,bgColor:String,textColor:String,hoverColor:String,borderColor:String,fontSize:{type:[Number,String],default:16},fontWeight:{type:[Number,String],default:500}},emits:["click"],setup(t,{emit:l}){const o=t,a=e.computed(()=>({"--skFontSize":typeof o.fontSize=="number"?`${o.fontSize}px`:o.fontSize,"--skFontWeight":o.fontWeight,"--skBgColor":o.bgColor,"--skTextColor":o.textColor,"--skBorderColor":o.borderColor,"--hoverColor":o.hoverColor}));return(n,s)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["spicyBtn",{outlined:t.variant==="outlined",disabled:t.disabled}]),style:e.normalizeStyle({...a.value}),disabled:t.disabled,onClick:s[0]||(s[0]=y=>n.$emit("click")),role:"button","aria-label":t.text,"aria-disabled":t.disabled,tabindex:t.disabled?-1:0},[t.icon?(e.openBlock(),e.createElementBlock("span",ie,e.toDisplayString(t.icon),1)):e.createCommentVNode("",!0),t.text?(e.openBlock(),e.createElementBlock("span",re,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"default")],14,ae))}},se={class:"spicyCarouselWrapper"},ce=["aria-label"],de={class:"spicyCarouselInfoText"},ye={class:"spicyCarouselTitle"},pe={key:0},ue={key:0,class:"spicyCarouselNavControls"},me=[e.createElementVNode("span",{class:"spicyCarouselPrevBtnIcon"},"<",-1)],fe=[e.createElementVNode("span",{class:"spicyCarouselNextBtnIcon"},">",-1)],ge={key:1,class:"spicyCarouselPagination"},he=["onClick"],ke={class:"spicyCarouselPage"},M={__name:"SpicyCarousel",props:{autoplay:{type:Boolean,default:!1},autoplaySpeed:{type:Number,default:5e3},showNavigation:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},activeColor:{type:String,default:"#00ffea80"},loop:{type:Boolean,default:!0},initialSlide:{type:Number,default:0},slides:{type:Array,required:!0},width:{type:String,default:"580px"},height:{type:String,default:"360px"},fullScreen:{type:Boolean,default:!1},enableImageClick:{type:Boolean,default:!1}},setup(t){let l,o,a=!1;const n=t,s=e.computed(()=>({"--width":n.width,"--height":n.height,"--activeColor":n.activeColor})),y=e.computed(()=>n.slides[d.value].title),p=e.computed(()=>r.value.fullScreen===!1?!1:n.fullScreen),d=e.ref(n.initialSlide),r=e.computed(()=>n.slides[d.value]);let c;const u=()=>{d.value=(d.value-1+n.slides.length)%n.slides.length},k=()=>{d.value=(d.value+1)%n.slides.length},m=g=>{d.value=g},b=()=>{clearInterval(c)},C=()=>{n.autoplay&&(c=setInterval(k,n.autoplaySpeed))},S=()=>{window.open(r.value.img)},f=()=>{n.enableImageClick&&S()},w=g=>{l=g.touches[0].clientX,o=g.touches[0].clientY,a=!1},je=g=>{if(!a){const E=g.touches[0].clientX-l,te=g.touches[0].clientY-o;Math.abs(E)>Math.abs(te)&&(E>40?(u(),a=!0):E<-40&&(k(),a=!0))}};return e.onMounted(()=>{n.autoplay&&(c=setInterval(k,n.autoplaySpeed))}),e.onUnmounted(()=>{clearInterval(c)}),(g,E)=>(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",{class:"spicyCarouselContainer",style:e.normalizeStyle({...s.value}),onMouseenter:b,onMouseleave:C,onTouchstart:w,onTouchmove:je},[e.createVNode(e.Transition,{name:"slide",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["spicyCarouselSlide",{pointCursor:n.enableImageClick}]),key:d.value,style:e.normalizeStyle({backgroundImage:`url(${r.value.img})`}),onClick:f},[t.slides[d.value].text?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["spicyCarouselTextOverlay",{fullScreen:p.value}]),"aria-label":t.slides[d.value].text},[e.createElementVNode("span",de,e.toDisplayString(t.slides[d.value].text),1)],10,ce)):e.createCommentVNode("",!0),e.renderSlot(g.$slots,"default")],6))]),_:3})],36),e.createElementVNode("div",ye,[y.value?(e.openBlock(),e.createElementBlock("h2",pe,e.toDisplayString(r.value.title),1)):e.createCommentVNode("",!0)]),t.showNavigation?(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("button",{class:"spicyCarouselPrevBtn",onClick:u},me),e.createElementVNode("button",{class:"spicyCarouselNextBtn",onClick:k},fe)])):e.createCommentVNode("",!0),t.showPagination?(e.openBlock(),e.createElementBlock("div",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.slides,(te,$)=>(e.openBlock(),e.createElementBlock("button",{key:$,onClick:qe=>m($),class:e.normalizeClass(["spicyCarouselPageBtn",{active:$===d.value}])},[e.createElementVNode("span",ke,e.toDisplayString($+1),1)],10,he))),128))])):e.createCommentVNode("",!0)]))}},F={__name:"SpicyDivider",props:{variant:{type:String,default:"solid",validator:t=>["solid","dashed"].includes(t)},width:{type:String,default:"100%"},height:{type:String,default:"1px"},bgColor:{type:String,default:"var(--skBgColor)"}},setup(t){const l=t,o=e.computed(()=>({width:l.width,height:l.height,borderBottom:`${l.height} ${l.variant} ${l.bgColor}`}));return(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:"spicyDivider",style:e.normalizeStyle(o.value),role:"separator","aria-orientation":"horizontal"},[e.renderSlot(a.$slots,"default")],4))}},Se={class:"kbContainer"},be={class:"kbSidebar"},Ce=["onUpdate:modelValue"],Be={class:"spicyKB"},we=["onMousedown","onTouchstart","onClick"],Ee={class:"keyText"},I={__name:"SpicyKeyboard",emits:["input"],setup(t,{emit:l}){const o=e.ref(null),a=e.ref([{label:"Function Keys",visible:!1,layout:[["Esc","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","PrtScr","ScrLk","Pause"]]},{label:"Main Keys",visible:!0,layout:[["`","1","2","3","4","5","6","7","8","9","0","-","=","Backspace"],["Tab","Q","W","E","R","T","Y","U","I","O","P","[","]","\\"],["Caps","A","S","D","F","G","H","J","K","L",";","'","Enter"],["Shift","Z","X","C","V","B","N","M",",",".","/","Shift"],["Ctrl","Win","Alt","Space","Alt","Fn","Ctrl"]]},{label:"Arrow Keys",visible:!0,layout:[["Ins","Home","PgUp"],["Del","End","PgDn"],["↑","←","↓","→"]]},{label:"Numpad",visible:!0,layout:[["NumLock","/","*","-"],["7","8","9","+"],["4","5","6"],["1","2","3","Enter"],["0","."]]}]),n=e.computed(()=>a.value.filter(u=>u.visible).map(u=>u)),s=l,y=u=>{o.value=u},p=()=>{o.value=null},d=u=>{s("input",u)},r=u=>["Backspace","Tab","Caps","Enter","Shift","Ctrl","Win","Alt","Space","Fn","Ins","Del","Home","End","PgUp","PgDn","NumLock"].includes(u)?`key-${u.toLowerCase()}`:"",c=(u,k,m)=>{const b=S=>["Backspace","Tab","Caps","Enter","Shift","Space"].includes(S),C=S=>["Ctrl","Win","Alt","Fn"].includes(S);return b(u)?"key-wide":C(u)?"key-small":k[m].length===1?"key-fullwidth":""};return(u,k)=>(e.openBlock(),e.createElementBlock("div",Se,[e.createElementVNode("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(m,b)=>(e.openBlock(),e.createElementBlock("div",{class:"sidebar",key:b},[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":C=>m.visible=C},null,8,Ce),[[e.vModelCheckbox,m.visible]]),e.createTextVNode(" "+e.toDisplayString(m.label),1)])]))),128))]),e.createElementVNode("div",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(m,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["kbSection",{[m.label.toLowerCase().replace(/\s+/g,"")]:!0}]),key:b},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.layout,(C,S)=>(e.openBlock(),e.createElementBlock("div",{class:"spicyKBRow",key:S},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C,f=>(e.openBlock(),e.createElementBlock("button",{key:f,class:e.normalizeClass(["spicyKBKey",[{"is-active":o.value===f},r(f),c(f,m.layout,S)]]),onMousedown:w=>y(f),onMouseup:p,onTouchstart:w=>y(f),onTouchend:p,onClick:w=>d(f)},[e.createElementVNode("span",Ee,e.toDisplayString(f),1)],42,we))),128))]))),128))],2))),128))])]))}},$e={class:"spicyInputLabel"},Ve=["placeholder","aria-label"],De={key:0,class:"spicyInputError"},O={__name:"SpicyLabel",props:{value:{type:String,default:""},placeholder:{type:String,default:""},label:{type:String,default:""},error:{type:String,default:""},variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)}},setup(t){const l=t,o=e.ref(l.value),a=e.ref(!1),n=p=>{o.value=p.target.value},s=()=>{a.value=!1},y=()=>{a.value=!0};return(p,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["spicyInputWrapper",[t.variant,{hasValue:o.value||t.value,hasFocus:a.value,hasError:t.error}]])},[e.createElementVNode("label",$e,e.toDisplayString(t.label),1),e.withDirectives(e.createElementVNode("input",{class:e.normalizeClass(["spicyInput",t.variant]),"onUpdate:modelValue":d[0]||(d[0]=r=>o.value=r),placeholder:t.placeholder,onInput:n,onBlur:s,onFocus:y,"aria-label":t.label},null,42,Ve),[[e.vModelText,o.value]]),e.renderSlot(p.$slots,"default"),t.error?(e.openBlock(),e.createElementBlock("span",De,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)],2))}},Te={class:"spicyModalHeader"},Ne={class:"spicyModalActions"},Me=["onClick"],x={__name:"SpicyModal",props:{width:{type:String,default:"50%"},height:{type:String,default:"auto"},borderRadius:{type:String,default:"8px"},bgColor:{type:String,default:"#2b2b2b"},visible:{type:Boolean,default:!1},closeBtn:{type:Boolean,default:!1},actions:{type:Array,default:()=>[]},closeOnClick:{type:Boolean,default:!0},modalTitle:{type:String,default:""}},emits:["update:visible"],setup(t,{emit:l}){const o=t,a=e.computed(()=>({"--width":o.width,"--height":o.height,"--skBorderRadius":o.borderRadius,"--skBgColor":o.bgColor})),n=l,s=()=>{n("update:visible",!1)},y=p=>{o.closeOnClick&&p.target.classList.contains("spicyModalOverlay")&&s()};return(p,d)=>t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"spicyModalOverlay",onClick:y},[e.createElementVNode("div",{class:"spicyModal",style:e.normalizeStyle({...a.value})},[e.createElementVNode("header",Te,[e.renderSlot(p.$slots,"spicyModalHeader",{title:t.modalTitle},()=>[e.createTextVNode(e.toDisplayString(t.modalTitle),1)])]),e.renderSlot(p.$slots,"default"),e.createElementVNode("div",Ne,[e.renderSlot(p.$slots,"spicyModalActions"),t.actions.length===0&&t.closeBtn?(e.openBlock(),e.createElementBlock("button",{key:0,class:"spicyModalCloseBtn spicyModalActionBtn",onClick:s}," Close ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,r=>(e.openBlock(),e.createElementBlock("button",{class:"spicyModalExtraBtn spicyModalActionBtn",key:r.label,onClick:r.handler},e.toDisplayString(r.label),9,Me))),128))])],4)])):e.createCommentVNode("",!0)}},Fe={class:"spicySlider"},Ie={key:0,class:"spicySliderLabel"},Oe=["min","max","step"],_={__name:"SpicySlider",props:{min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},label:{type:String,default:""},modelValue:{type:Number,default:0}},emits:["update:modelValue"],setup(t,{emit:l}){const o=t,a=l,n=e.ref(o.modelValue);e.watch(()=>o.modelValue,y=>{n.value=y});const s=y=>{a("update:modelValue",Number(y.target.value))};return(y,p)=>(e.openBlock(),e.createElementBlock("div",Fe,[t.label?(e.openBlock(),e.createElementBlock("label",Ie,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{class:"spicySliderInput",type:"range",min:t.min,max:t.max,step:t.step,"onUpdate:modelValue":p[0]||(p[0]=d=>n.value=d),onInput:s},null,40,Oe),[[e.vModelText,n.value]]),e.renderSlot(y.$slots,"default")]))}},xe=["tabindex","aria-label","aria-checked","onKeydown"],_e=[e.createElementVNode("div",{class:"spicyToggleKnob"},null,-1)],K={__name:"SpicyToggle",props:{modelValue:Boolean,label:{type:String,default:"Toggle"},variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)},borderColor:String,activeColor:{type:String,default:"var(--skPrimaryColor)"}},emits:["update:modelValue"],setup(t,{emit:l}){const o=t,a=e.computed(()=>({"--skBorderColor":o.borderColor,"--activeColor":o.activeColor})),n=l,s=()=>{n("update:modelValue",!o.modelValue)};return(y,p)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["spicyToggle",{outlined:t.variant==="outlined","is-active":t.modelValue}],tabindex:y.disabled?-1:0,role:"switch",style:{...a.value},"aria-label":t.label,"aria-checked":t.modelValue.toString(),onClick:s,onKeydown:[e.withKeys(e.withModifiers(s,["prevent"]),["space"]),e.withKeys(e.withModifiers(s,["prevent"]),["enter"])]},y.$attrs),_e,16,xe))}},Ke=["aria-hidden"],Pe={key:0,class:"spicyTooltipIcon"},Le=["aria-label"],ze={key:2,class:"spicyTooltipIcon"},P={__name:"SpicyTooltip",props:{text:String,prependIcon:String,appendIcon:String,position:{type:String,default:"top",validator:t=>["top","bottom","left","right"].includes(t)}},setup(t){const l=t,o=e.ref(!1),a=e.ref(null),n=e.reactive({position:"absolute",top:"0px",left:"0px",maxWidth:"175px"}),s=r=>{const c=r.right-window.innerWidth;c>0&&(n.left=`${parseInt(n.left)-c-5}px`),r.left<0&&(n.left="5px")},y={top:(r,c)=>{n.left=`${r.left+(r.width-c.width)/2}px`,n.top=`${r.top-c.height-5}px`},bottom:(r,c)=>{n.left=`${r.left+(r.width-c.width)/2}px`,n.top=`${r.bottom+5}px`},left:(r,c)=>{n.left=`${r.left-c.width-5}px`,n.top=`${r.top+(r.height-c.height)/2}px`},right:(r,c)=>{n.left=`${r.right+5}px`,n.top=`${r.top+(r.height-c.height)/2}px`}},p=()=>{o.value=!0,e.nextTick(()=>{if(a.value&&o.value){const r=a.value.getBoundingClientRect(),c=a.value.querySelector(".spicyTooltip").getBoundingClientRect(),u=y[l.position];u(r,c),s(c)}})},d=()=>{o.value=!1};return(r,c)=>(e.openBlock(),e.createElementBlock("div",{onMouseover:p,onMouseleave:d,ref_key:"host",ref:a},[e.renderSlot(r.$slots,"default"),o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"spicyTooltip",style:e.normalizeStyle(n),role:"tooltip","aria-hidden":!o.value},[t.prependIcon?(e.openBlock(),e.createElementBlock("span",Pe,e.toDisplayString(t.prependIcon),1)):e.createCommentVNode("",!0),t.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:"spicyTooltipText","aria-label":t.text},e.toDisplayString(t.text),9,Le)):e.createCommentVNode("",!0),t.appendIcon?(e.openBlock(),e.createElementBlock("span",ze,e.toDisplayString(t.appendIcon),1)):e.createCommentVNode("",!0)],12,Ke)):e.createCommentVNode("",!0)],544))}};function V(t,l){const o={YYYY:()=>t.getFullYear().toString(),MM:()=>(t.getMonth()+1).toString().padStart(2,"0"),DD:()=>t.getDate().toString().padStart(2,"0")};return l.replace(/YYYY|MM|DD/g,a=>o[a]())}function L(t){const[l,o,a]=t.split("-");return new Date(Number(l),Number(o)-1,Number(a))}function z(t,l){const o=Math.abs(l.getTime()-t.getTime());return Math.ceil(o/(1e3*60*60*24))}function A(t,l){const o=new Date(t);return o.setDate(t.getDate()+l),o}function Y(t,l){const o=new Date(t);return o.setDate(t.getDate()-l),o}function U(t){const l=new Date;return t.getDate()===l.getDate()&&t.getMonth()===l.getMonth()&&t.getFullYear()===l.getFullYear()}function W(t){const l=new Date;return l.setDate(l.getDate()-1),t.getDate()===l.getDate()&&t.getMonth()===l.getMonth()&&t.getFullYear()===l.getFullYear()}function j(t){const l=new Date;return l.setDate(l.getDate()+1),t.getDate()===l.getDate()&&t.getMonth()===l.getMonth()&&t.getFullYear()===l.getFullYear()}function H(t="YYYY-MM-DD",l={show:!0,separator:"-"}){if(typeof t!="string"||typeof l!="object"||!l.hasOwnProperty("show")||typeof l.show!="boolean")throw new Error('Invalid parameters: Please provide a valid format string and options object with a boolean "show" property.');let a=V(new Date,t);return l.separator&&l.separator!=="-"&&(a=a.replace(/-/g,l.separator)),l.show?{value:a,isVisible:!0}:{value:a,isVisible:!1}}const Ae=Object.freeze(Object.defineProperty({__proto__:null,currentDate:H,dateAdd:A,dateDiff:z,dateIsToday:U,dateIsTomorrow:j,dateIsYesterday:W,dateSubtract:Y,formatDate:V,parseDate:L},Symbol.toStringTag,{value:"Module"}));function X(t){const l=new WeakMap;function o(a){if(h(a)||typeof a!="object")return a;if(l.has(a))return l.get(a);const n=Array.isArray(a)?[]:{};l.set(a,n);for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&(n[s]=o(a[s]));return n}return o(t)}function D(...t){const l={};return t.forEach(o=>{if(!h(o)){for(const a in o)if(Object.prototype.hasOwnProperty.call(o,a)){const n=o[a];n!==void 0&&(typeof n=="object"&&n!==null&&!Array.isArray(n)?l[a]=D(l[a]||{},n):l[a]=n)}}}),l}function R(...t){return h(t[0])?t[0]:Object.assign({},...t)}function q(t){return h(t)?[]:Object.keys(t)}function G(t){return h(t)?[]:Object.values(t)}function J(t){return h(t)?[]:Object.entries(t)}function h(t){return t===null||typeof t!="object"?!1:Array.isArray(t)?t.length===0:Object.keys(t).length===0}const Ye=Object.freeze(Object.defineProperty({__proto__:null,deepClone:X,deepMerge:D,getObjectEntries:J,getObjectKeys:q,getObjectValues:G,isObjectEmpty:h,mergeObjects:R},Symbol.toStringTag,{value:"Module"}));function B(t){try{return new URL(t),!0}catch(l){return console.error("Invalid URL:",l),!1}}function Q(t){return B(t)?new URL(t).hostname:null}function Z(t,l){if(!B(t))return t;const o=new URL(t);return Object.keys(l).forEach(a=>o.searchParams.append(a,l[a])),o.toString()}function v(t,l,o="https"){if(!["http","https","ftp","sftp","ftps","ssh"].includes(o.toLowerCase()))throw new Error("Invalid protocol: "+o);if(!/^(?!:\/\/)([a-z0-9-]+\.)*[a-z0-9-]+$/i.test(t))throw new Error("Invalid hostname: "+t);return l.startsWith("/")||(l="/"+l),l.endsWith("/")&&l.length>1&&(l=l.slice(0,-1)),l==="/"&&(l=""),`${o.toLowerCase()}://${t}${l}`}const Ue=Object.freeze(Object.defineProperty({__proto__:null,appendParamsToUrl:Z,generateUrl:v,getHostname:Q,isUrlValid:B},Symbol.toStringTag,{value:"Module"})),ee=':root{--skBgColor: #28292a;--skBgSecondaryColor: #424344;--skBorderColor: #515353;--skPrimaryColor: #811faf;--skSecondaryColor: #0066b3;--skAccentColor: #004a77;--skHoverColor: #656769;--skTextColor: #ddd;--disabledOpacity: .5;--skLabelFocus: var(--skPrimaryColor);--skFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;--skFontSize: 14px;--skFontWeight: 500;--skBorderWidth: 2px;--skBorderRadius: 4px}.spicyText{color:var(--skTextColor);font-family:var(--skFontFamily);font-size:var(--skFontSize)}.spicyHeader{color:var(--skTextColor);font-family:var(--skFontFamily);font-size:24px;font-weight:700}.spicyLink:hover{color:var(--skHoverColor)}.spicyLink:active{color:var(--skPrimaryColor)}.spicyLink:focus{color:var(--skLabelFocus)}.spicyLink:disabled{opacity:var(--disabledOpacity)}',We={install(t,l={}){const{useComponents:o=!0,useStyles:a=!0}=l;if(o&&(t.component("SpicyAlert",T),t.component("SpicyBtn",N),t.component("SpicyCarousel",M),t.component("SpicyDivider",F),t.component("SpicyKeyboard",I),t.component("SpicyLabel",O),t.component("SpicyModal",x),t.component("SpicySlider",_),t.component("SpicyToggle",K),t.component("SpicyTooltip",P)),a){const n=document.createElement("style");n.textContent=ee,document.head.appendChild(n)}}};i.SpicyAlert=T,i.SpicyBtn=N,i.SpicyCarousel=M,i.SpicyDivider=F,i.SpicyKatsu=We,i.SpicyKeyboard=I,i.SpicyLabel=O,i.SpicyModal=x,i.SpicySlider=_,i.SpicyToggle=K,i.SpicyTooltip=P,i.appendParamsToUrl=Z,i.currentDate=H,i.dateAdd=A,i.dateDiff=z,i.dateIsToday=U,i.dateIsTomorrow=j,i.dateIsYesterday=W,i.dateSubtract=Y,i.dateUtils=Ae,i.deepClone=X,i.deepMerge=D,i.formatDate=V,i.generateUrl=v,i.getHostname=Q,i.getObjectEntries=J,i.getObjectKeys=q,i.getObjectValues=G,i.isObjectEmpty=h,i.isUrlValid=B,i.mergeObjects=R,i.objUtils=Ye,i.parseDate=L,i.spicyStyles=ee,i.urlUtils=Ue,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.fade-enter-active,.fade-leave-active{transition:opacity .35s}.fade-enter,.fade-leave-to{opacity:0}.spicyAlert{display:flex;align-items:center;padding:12px;border-radius:4px;margin-bottom:12px}.spicyAlertIcon{margin-right:8px}.spicyAlertCloseBtn{margin-left:auto;background:none;border:none;cursor:pointer}.info{background-color:#e0e0e0;color:#333}.success{background-color:#bcf7c9;color:#155724}.warning{background-color:#fff3cd;color:#856404}.error{background-color:#ffbdc2;color:#911f2a}.spicyBtn{padding:8px 16px;background-color:var(--skBgColor, #28292a);border:none;border-radius:4px;color:var(--skTextColor, #ddd);cursor:pointer;font-size:
|
|
1
|
+
.fade-enter-active,.fade-leave-active{transition:opacity .35s}.fade-enter,.fade-leave-to{opacity:0}.spicyAlert{display:flex;align-items:center;padding:12px;border-radius:4px;margin-bottom:12px}.spicyAlertIcon{margin-right:8px}.spicyAlertCloseBtn{margin-left:auto;background:none;border:none;cursor:pointer}.info{background-color:#e0e0e0;color:#333}.success{background-color:#bcf7c9;color:#155724}.warning{background-color:#fff3cd;color:#856404}.error{background-color:#ffbdc2;color:#911f2a}.spicyBtn{padding:8px 16px;background-color:var(--skBgColor, #28292a);border:none;border-radius:4px;color:var(--skTextColor, #ddd);cursor:pointer;font-size:var(--skFontSize, 16px);font-weight:var(--skFontWeight, 500);transition:background-color .25s}.spicyBtn.outlined{background-color:var(--skBgColor, transparent);border:2px solid var(--skBorderColor, #515353);color:var(--skTextColor, #ddd)}.spicyBtn.disabled{opacity:.5;cursor:not-allowed}.spicyBtn:hover:not(.disabled){background-color:var(--hoverColor, grey)}.spicyBtn.outlined:hover:not(.disabled){background-color:var(--hoverColor, grey);color:var(--skTextColor, #ddd)}.spicyBtnIcon{margin-right:6px}.spicyCarouselWrapper{position:relative;width:var(--width, 580px);height:var(--height, 360px);padding:30px;display:flex;align-items:center;justify-content:center}.spicyCarouselTitle{position:absolute;top:0;width:var(--width, 580px);background-color:#0009;height:30px;color:#ccc;font-size:18px;font-weight:700}.spicyCarouselContainer{position:relative;overflow:hidden;width:100%;height:100%;border-radius:var(--borderRadius);background-color:#0009}.spicyCarouselSlide{position:absolute;top:0;left:0;width:100%;height:100%;background-size:cover;background-position:center;background-repeat:no-repeat;transition:opacity .3s ease}.spicyCarouselTextOverlay{position:absolute;bottom:10px;left:10px;background-color:#000000bf;padding:10px;color:#ccc;font-size:18px;font-weight:700;text-shadow:2px 2px 4px rgba(0,0,0,.5);border-radius:4px}.spicyCarouselTextOverlay.fullScreen{top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;text-align:center;background-color:#0000004d}.slide-enter-active,.slide-leave-active{transition:opacity .3s}.slide-enter,.slide-leave-to{opacity:0}.spicyCarouselNavControls{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:space-between;align-items:center;pointer-events:none}.spicyCarouselNextBtn{border-radius:0 6px 6px 0}.spicyCarouselPrevBtn{border-radius:6px 0 0 6px}.spicyCarouselPrevBtn,.spicyCarouselNextBtn{border:none;font-size:24px;color:#ccc;cursor:pointer;background:#0009;height:100%;width:30px;display:flex;align-items:center;justify-content:center;transition:transform .3s;pointer-events:auto;z-index:2}.spicyCarouselPrevBtn:hover,.spicyCarouselNextBtn:hover{background:var(--skPrimaryColor)}.spicyCarouselPagination{position:absolute;background:#0009;bottom:0;left:50%;height:30px;width:var(--width, 580px);transform:translate(-50%);display:flex;gap:8px;z-index:2;align-items:center;justify-content:center;pointer-events:auto}.spicyCarouselPageBtn{border:none;color:#fff;cursor:pointer;background:#00b7ff80;height:26px;width:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:transform .3s}.spicyCarouselPageBtn.active,.spicyCarouselPageBtn:hover{background:var(--skPrimaryColor)}.pointCursor{cursor:pointer}.spicyDivider{width:100%;border:none}.kbContainer{display:flex;gap:10px;padding:10px;border:1px solid #ccc;border-radius:5px;background-color:#f0f0f0}.kbSidebar{display:flex;flex-direction:column;gap:5px}.sidebar label{display:flex;align-items:center;gap:5px}.spicyKB{display:flex;flex-direction:row;gap:5px;background-color:#333;border-radius:5px;padding:10px}.kbSection{display:flex;flex-direction:column;gap:5px}.spicyKBRow{display:flex;gap:5px}.spicyKBKey{padding:10px;border:1px solid #ccc;border-radius:5px;background-color:#f0f0f0;cursor:pointer;transition:background-color .2s ease;font-family:Courier New,Courier,monospace;font-weight:700;text-transform:uppercase}.spicyKBKey:hover,.spicyKBKey.is-active{background-color:#e0e0e0}.key-backspace{width:100px}.key-tab,.key-caps,.key-enter,.key-shift{width:120px}.key-ctrl,.key-win,.key-alt,.key-fn{width:70px}.key-space{width:400px}.key-fullwidth{width:100%}.key-small{width:60px}.key-wide{width:80px}.keyText{-webkit-user-select:none;user-select:none}.spicyInputWrapper{display:flex;flex-direction:column;position:relative}.spicyInputLabel{position:absolute;top:12px;left:16px;color:var(--textColor, var(--skTextColor));transition:top .25s,font-size .25s,color .25s;pointer-events:none;font-size:18px;background-color:transparent}.spicyInput{padding:20px 16px 8px;border:none;border-bottom:1px solid var(--skBorderColor, #515353);font-size:16px;width:100%;box-sizing:border-box;transition:border-color .25s;background-color:transparent;color:var(--textColor, var(--skTextColor, #ddd))}.spicyInputWrapper .spicyInput:focus{outline:none;border-color:var(--skLabelFocus)}.outlined .spicyInput{border:1px solid var(--skBorderColor, #515353);border-radius:4px}.filled .spicyInput{border:none;border-bottom:1px solid var(--skBorderColor, #515353)}.hasValue .spicyInputLabel,.hasFocus .spicyInputLabel{top:-18px;font-size:16px;color:var(--skLabelFocus);font-weight:700}.hasError .spicyInput{border-color:red}.spicyInputError{color:red;font-size:12px}.spicyModalOverlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#0009;display:flex;justify-content:center;align-items:center;z-index:1000}.spicyModal{padding:20px;box-shadow:0 0 6px 2px #0003;transition:transform .3s ease-out;font-size:15px;border-radius:var(--skBorderRadius);background-color:var(--skBgColor);z-index:1001}.spicyModalHeader{text-align:center;font-size:20px;font-weight:700}.spicyModalActions{margin-top:20px;text-align:right}.spicyModalActionBtn{background-color:transparent;border:none;color:var(--skTextColor, #ddd);cursor:pointer}.spicyModalActionBtn:hover{text-decoration:underline}.spicySlider{width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.spicySliderLabel{margin-bottom:5px;font-size:16px}.spicySliderInput{width:100%}.spicyToggle{width:50px;height:24px;background-color:var(--skBgSecondaryColor, #424344);border-radius:30px;cursor:pointer;padding:2px;transition:background-color .2s;display:inline-flex;align-items:center}.spicyToggle.is-active{background-color:var(--activeColor, var(--skPrimaryColor))}.spicyToggleKnob{width:20px;height:20px;background-color:#fff;border-radius:50%;transition:transform .2s;box-shadow:0 2px 4px #0003}.spicyToggle.is-active .spicyToggleKnob{transform:translate(26px)}.spicyToggle.outlined{background-color:transparent;border:2px solid var(--skBorderColor, #515353)}.spicyToggle.outlined.is-active{background-color:var(--activeColor, var(--skPrimaryColor));border-color:var(--activeColor, var(--skPrimaryColor))}.spicyTooltip{z-index:9999;background-color:var(--skBgColor);color:var(--skTextColor);padding:8px;border-radius:4px;font-size:15px;border:1px solid var(--skBorderColor);display:flex;align-items:center;justify-content:center}.spicyTooltipIcon{font-size:18px}
|