spicykatsu 0.0.35 → 0.0.36
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 +301 -303
- package/dist/spicykatsu.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -2
package/dist/spicykatsu.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
1
|
+
import { ref as x, watch as j, openBlock as n, createBlock as X, Transition as V, withCtx as E, createElementBlock as s, normalizeClass as S, withKeys as _, toDisplayString as v, createCommentVNode as f, computed as w, normalizeStyle as I, renderSlot as B, onMounted as R, onUnmounted as q, createElementVNode as y, createVNode as G, Fragment as F, renderList as D, withDirectives as N, vModelCheckbox as J, createTextVNode as U, vModelText as Q, mergeProps as Z, withModifiers as Y, reactive as ee, nextTick as te } from "vue";
|
|
2
|
+
const le = ["aria-label"], oe = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "spicyAlertIcon"
|
|
5
|
-
},
|
|
5
|
+
}, ae = {
|
|
6
6
|
key: 1,
|
|
7
7
|
class: "spicyAlertText"
|
|
8
|
-
},
|
|
8
|
+
}, ne = {
|
|
9
9
|
__name: "SpicyAlert",
|
|
10
10
|
props: {
|
|
11
11
|
variant: {
|
|
@@ -20,46 +20,46 @@ const te = ["aria-label"], le = {
|
|
|
20
20
|
autoClose: { type: Number, default: 0 }
|
|
21
21
|
},
|
|
22
22
|
setup(e) {
|
|
23
|
-
const t = e, l =
|
|
23
|
+
const t = e, l = x(!0), a = () => {
|
|
24
24
|
l.value = !1;
|
|
25
25
|
};
|
|
26
|
-
return
|
|
26
|
+
return j(
|
|
27
27
|
() => t.autoClose,
|
|
28
28
|
(o) => {
|
|
29
29
|
o > 0 && setTimeout(() => {
|
|
30
30
|
l.value = !1;
|
|
31
31
|
}, o);
|
|
32
32
|
}
|
|
33
|
-
), (o, c) => (n(),
|
|
34
|
-
default:
|
|
35
|
-
l.value ? (n(),
|
|
33
|
+
), (o, c) => (n(), X(V, { name: "fade" }, {
|
|
34
|
+
default: E(() => [
|
|
35
|
+
l.value ? (n(), s("div", {
|
|
36
36
|
key: 0,
|
|
37
37
|
class: S(["spicyAlert", e.variant]),
|
|
38
38
|
"aria-atomic": "true",
|
|
39
39
|
"aria-label": e.text,
|
|
40
40
|
role: "alert",
|
|
41
|
-
onKeydown:
|
|
41
|
+
onKeydown: _(a, ["enter"])
|
|
42
42
|
}, [
|
|
43
|
-
e.iconOnly || e.text ? (n(),
|
|
44
|
-
!e.iconOnly && e.text ? (n(),
|
|
45
|
-
e.closable ? (n(),
|
|
43
|
+
e.iconOnly || e.text ? (n(), s("span", oe, v(e.icon), 1)) : f("", !0),
|
|
44
|
+
!e.iconOnly && e.text ? (n(), s("span", ae, v(e.text), 1)) : f("", !0),
|
|
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
|
-
], 42,
|
|
50
|
+
}, " X ")) : f("", !0)
|
|
51
|
+
], 42, le)) : f("", !0)
|
|
52
52
|
]),
|
|
53
53
|
_: 1
|
|
54
54
|
}));
|
|
55
55
|
}
|
|
56
|
-
},
|
|
56
|
+
}, se = ["disabled", "aria-label", "aria-disabled"], ie = {
|
|
57
57
|
key: 0,
|
|
58
58
|
class: "spicyBtnIcon"
|
|
59
|
-
},
|
|
59
|
+
}, re = {
|
|
60
60
|
key: 1,
|
|
61
61
|
class: "spicyBtnText"
|
|
62
|
-
},
|
|
62
|
+
}, ce = {
|
|
63
63
|
__name: "SpicyBtn",
|
|
64
64
|
props: {
|
|
65
65
|
variant: {
|
|
@@ -80,7 +80,7 @@ const te = ["aria-label"], le = {
|
|
|
80
80
|
},
|
|
81
81
|
emits: ["click"],
|
|
82
82
|
setup(e, { emit: t }) {
|
|
83
|
-
const l = e, a =
|
|
83
|
+
const l = e, a = w(() => ({
|
|
84
84
|
"--skFontSize": l.fontSize,
|
|
85
85
|
"--skFontWeight": l.fontWeight,
|
|
86
86
|
"--skBgColor": l.bgColor,
|
|
@@ -88,141 +88,142 @@ const te = ["aria-label"], le = {
|
|
|
88
88
|
"--skBorderColor": l.borderColor,
|
|
89
89
|
"--hoverColor": l.hoverColor
|
|
90
90
|
}));
|
|
91
|
-
return (o, c) => (n(),
|
|
91
|
+
return (o, c) => (n(), s("button", {
|
|
92
92
|
class: S(["spicyBtn", { outlined: e.variant === "outlined", disabled: e.disabled }]),
|
|
93
93
|
style: I({ ...a.value }),
|
|
94
94
|
disabled: e.disabled,
|
|
95
|
-
onClick: c[0] || (c[0] = (
|
|
95
|
+
onClick: c[0] || (c[0] = (g) => o.$emit("click")),
|
|
96
96
|
role: "button",
|
|
97
97
|
"aria-label": e.text,
|
|
98
98
|
"aria-disabled": e.disabled
|
|
99
99
|
}, [
|
|
100
|
-
e.icon ? (n(),
|
|
101
|
-
e.text ? (n(),
|
|
100
|
+
e.icon ? (n(), s("span", ie, v(e.icon), 1)) : f("", !0),
|
|
101
|
+
e.text ? (n(), s("span", re, v(e.text), 1)) : f("", !0),
|
|
102
102
|
B(o.$slots, "default")
|
|
103
|
-
], 14,
|
|
103
|
+
], 14, se));
|
|
104
104
|
}
|
|
105
|
-
},
|
|
105
|
+
}, ue = { class: "spicyCarouselWrapper" }, de = ["aria-label"], ye = { class: "spicyCarouselInfoText" }, pe = { class: "spicyCarouselTitle" }, fe = { key: 0 }, ve = {
|
|
106
106
|
key: 0,
|
|
107
107
|
class: "spicyCarouselNavControls"
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
],
|
|
111
|
-
|
|
112
|
-
],
|
|
108
|
+
}, ge = /* @__PURE__ */ y("span", { class: "spicyCarouselPrevBtnIcon" }, "<", -1), he = [
|
|
109
|
+
ge
|
|
110
|
+
], be = /* @__PURE__ */ y("span", { class: "spicyCarouselNextBtnIcon" }, ">", -1), me = [
|
|
111
|
+
be
|
|
112
|
+
], Se = {
|
|
113
113
|
key: 1,
|
|
114
114
|
class: "spicyCarouselPagination"
|
|
115
|
-
},
|
|
115
|
+
}, Ce = ["onClick"], ke = { class: "spicyCarouselPage" }, we = {
|
|
116
116
|
__name: "SpicyCarousel",
|
|
117
117
|
props: {
|
|
118
118
|
autoplay: { type: Boolean, default: !1 },
|
|
119
119
|
autoplaySpeed: { type: Number, default: 5e3 },
|
|
120
120
|
showNavigation: { type: Boolean, default: !0 },
|
|
121
121
|
showPagination: { type: Boolean, default: !0 },
|
|
122
|
-
activeColor: { type: String, default: "
|
|
122
|
+
activeColor: { type: String, default: "#00ffea80" },
|
|
123
123
|
loop: { type: Boolean, default: !0 },
|
|
124
124
|
initialSlide: { type: Number, default: 0 },
|
|
125
125
|
slides: { type: Array, required: !0 },
|
|
126
|
-
width: { type: String, default: "
|
|
127
|
-
height: { type: String, default: "
|
|
126
|
+
width: { type: String, default: "580px" },
|
|
127
|
+
height: { type: String, default: "360px" },
|
|
128
128
|
fullScreen: { type: Boolean, default: !1 },
|
|
129
129
|
enableImageClick: { type: Boolean, default: !1 }
|
|
130
130
|
},
|
|
131
131
|
setup(e) {
|
|
132
132
|
let t, l, a = !1;
|
|
133
|
-
const o = e, c =
|
|
133
|
+
const o = e, c = w(() => ({
|
|
134
134
|
"--width": o.width,
|
|
135
135
|
"--height": o.height,
|
|
136
136
|
"--activeColor": o.activeColor
|
|
137
|
-
})),
|
|
138
|
-
let
|
|
137
|
+
})), g = w(() => o.slides[u.value].title), p = w(() => i.value.fullScreen === !1 ? !1 : o.fullScreen), u = x(o.initialSlide), i = w(() => o.slides[u.value]);
|
|
138
|
+
let r;
|
|
139
139
|
const d = () => {
|
|
140
|
-
|
|
141
|
-
}, u = () => {
|
|
142
|
-
r.value = (r.value + 1) % o.slides.length;
|
|
143
|
-
}, D = (m) => {
|
|
144
|
-
r.value = m;
|
|
145
|
-
}, h = () => {
|
|
146
|
-
clearInterval(s);
|
|
147
|
-
}, w = () => {
|
|
148
|
-
o.autoplay && (s = setInterval(u, o.autoplaySpeed));
|
|
149
|
-
}, x = () => {
|
|
150
|
-
window.open(g.value.img);
|
|
140
|
+
u.value = (u.value - 1 + o.slides.length) % o.slides.length;
|
|
151
141
|
}, C = () => {
|
|
152
|
-
|
|
153
|
-
},
|
|
154
|
-
|
|
142
|
+
u.value = (u.value + 1) % o.slides.length;
|
|
143
|
+
}, h = (m) => {
|
|
144
|
+
u.value = m;
|
|
145
|
+
}, $ = () => {
|
|
146
|
+
clearInterval(r);
|
|
147
|
+
}, T = () => {
|
|
148
|
+
o.autoplay && (r = setInterval(C, o.autoplaySpeed));
|
|
149
|
+
}, k = () => {
|
|
150
|
+
window.open(i.value.img);
|
|
151
|
+
}, b = () => {
|
|
152
|
+
o.enableImageClick && k();
|
|
155
153
|
}, O = (m) => {
|
|
154
|
+
t = m.touches[0].clientX, l = m.touches[0].clientY, a = !1;
|
|
155
|
+
}, H = (m) => {
|
|
156
156
|
if (!a) {
|
|
157
|
-
const P = m.touches[0].clientX - t,
|
|
158
|
-
Math.abs(P) > Math.abs(
|
|
157
|
+
const P = m.touches[0].clientX - t, L = m.touches[0].clientY - l;
|
|
158
|
+
Math.abs(P) > Math.abs(L) && (P > 40 ? (d(), a = !0) : P < -40 && (C(), a = !0));
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
|
-
return
|
|
162
|
-
o.autoplay && (
|
|
163
|
-
}),
|
|
164
|
-
clearInterval(
|
|
165
|
-
}), (m, P) => (n(),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
e.slides[r.value].text ? (n(), i("div", {
|
|
185
|
-
key: 0,
|
|
186
|
-
class: S(["spicyCarouselTextOverlay", { fullScreen: v.value }]),
|
|
187
|
-
"aria-label": e.slides[r.value].text
|
|
161
|
+
return R(() => {
|
|
162
|
+
o.autoplay && (r = setInterval(C, o.autoplaySpeed));
|
|
163
|
+
}), q(() => {
|
|
164
|
+
clearInterval(r);
|
|
165
|
+
}), (m, P) => (n(), s("div", ue, [
|
|
166
|
+
y("div", {
|
|
167
|
+
class: "spicyCarouselContainer",
|
|
168
|
+
style: I({ ...c.value }),
|
|
169
|
+
onMouseenter: $,
|
|
170
|
+
onMouseleave: T,
|
|
171
|
+
onTouchstart: O,
|
|
172
|
+
onTouchmove: H
|
|
173
|
+
}, [
|
|
174
|
+
G(V, {
|
|
175
|
+
name: "slide",
|
|
176
|
+
mode: "out-in"
|
|
177
|
+
}, {
|
|
178
|
+
default: E(() => [
|
|
179
|
+
(n(), s("div", {
|
|
180
|
+
class: S(["spicyCarouselSlide", { pointCursor: o.enableImageClick }]),
|
|
181
|
+
key: u.value,
|
|
182
|
+
style: I({ backgroundImage: `url(${i.value.img})` }),
|
|
183
|
+
onClick: b
|
|
188
184
|
}, [
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
185
|
+
e.slides[u.value].text ? (n(), s("div", {
|
|
186
|
+
key: 0,
|
|
187
|
+
class: S(["spicyCarouselTextOverlay", { fullScreen: p.value }]),
|
|
188
|
+
"aria-label": e.slides[u.value].text
|
|
189
|
+
}, [
|
|
190
|
+
y("span", ye, v(e.slides[u.value].text), 1)
|
|
191
|
+
], 10, de)) : f("", !0),
|
|
192
|
+
B(m.$slots, "default")
|
|
193
|
+
], 6))
|
|
194
|
+
]),
|
|
195
|
+
_: 3
|
|
196
|
+
})
|
|
197
|
+
], 36),
|
|
198
|
+
y("div", pe, [
|
|
199
|
+
g.value ? (n(), s("h2", fe, v(i.value.title), 1)) : f("", !0)
|
|
200
|
+
]),
|
|
201
|
+
e.showNavigation ? (n(), s("div", ve, [
|
|
202
|
+
y("button", {
|
|
203
|
+
class: "spicyCarouselPrevBtn",
|
|
204
|
+
onClick: d
|
|
205
|
+
}, he),
|
|
206
|
+
y("button", {
|
|
207
|
+
class: "spicyCarouselNextBtn",
|
|
208
|
+
onClick: C
|
|
209
|
+
}, me)
|
|
210
|
+
])) : f("", !0),
|
|
211
|
+
e.showPagination ? (n(), s("div", Se, [
|
|
212
|
+
(n(!0), s(F, null, D(e.slides, (L, A) => (n(), s("button", {
|
|
212
213
|
key: A,
|
|
213
|
-
onClick: (
|
|
214
|
-
class: S(["spicyCarouselPageBtn", { active: A ===
|
|
214
|
+
onClick: (dt) => h(A),
|
|
215
|
+
class: S(["spicyCarouselPageBtn", { active: A === u.value }])
|
|
215
216
|
}, [
|
|
216
|
-
y("span",
|
|
217
|
-
], 10,
|
|
218
|
-
])) :
|
|
219
|
-
]
|
|
217
|
+
y("span", ke, v(A + 1), 1)
|
|
218
|
+
], 10, Ce))), 128))
|
|
219
|
+
])) : f("", !0)
|
|
220
|
+
]));
|
|
220
221
|
}
|
|
221
|
-
},
|
|
222
|
+
}, xe = { class: "kbContainer" }, $e = { class: "kbSidebar" }, Te = ["onUpdate:modelValue"], Be = { class: "spicyKB" }, Me = ["onMousedown", "onTouchstart", "onClick"], Fe = { class: "keyText" }, De = {
|
|
222
223
|
__name: "SpicyKeyboard",
|
|
223
224
|
emits: ["input"],
|
|
224
225
|
setup(e, { emit: t }) {
|
|
225
|
-
const l =
|
|
226
|
+
const l = x(null), a = x([
|
|
226
227
|
{
|
|
227
228
|
label: "Function Keys",
|
|
228
229
|
visible: !1,
|
|
@@ -279,15 +280,15 @@ const te = ["aria-label"], le = {
|
|
|
279
280
|
["0", "."]
|
|
280
281
|
]
|
|
281
282
|
}
|
|
282
|
-
]), o =
|
|
283
|
-
() => a.value.filter((
|
|
284
|
-
), c = t,
|
|
285
|
-
l.value =
|
|
286
|
-
},
|
|
283
|
+
]), o = w(
|
|
284
|
+
() => a.value.filter((d) => d.visible).map((d) => d)
|
|
285
|
+
), c = t, g = (d) => {
|
|
286
|
+
l.value = d;
|
|
287
|
+
}, p = () => {
|
|
287
288
|
l.value = null;
|
|
288
|
-
},
|
|
289
|
-
c("input",
|
|
290
|
-
},
|
|
289
|
+
}, u = (d) => {
|
|
290
|
+
c("input", d);
|
|
291
|
+
}, i = (d) => [
|
|
291
292
|
"Backspace",
|
|
292
293
|
"Tab",
|
|
293
294
|
"Caps",
|
|
@@ -305,60 +306,60 @@ const te = ["aria-label"], le = {
|
|
|
305
306
|
"PgUp",
|
|
306
307
|
"PgDn",
|
|
307
308
|
"NumLock"
|
|
308
|
-
].includes(
|
|
309
|
-
const
|
|
310
|
-
return
|
|
309
|
+
].includes(d) ? `key-${d.toLowerCase()}` : "", r = (d, C, h) => {
|
|
310
|
+
const $ = (k) => ["Backspace", "Tab", "Caps", "Enter", "Shift", "Space"].includes(k), T = (k) => ["Ctrl", "Win", "Alt", "Fn"].includes(k);
|
|
311
|
+
return $(d) ? "key-wide" : T(d) ? "key-small" : C[h].length === 1 ? "key-fullwidth" : "";
|
|
311
312
|
};
|
|
312
|
-
return (
|
|
313
|
-
y("div",
|
|
314
|
-
(n(!0),
|
|
313
|
+
return (d, C) => (n(), s("div", xe, [
|
|
314
|
+
y("div", $e, [
|
|
315
|
+
(n(!0), s(F, null, D(a.value, (h, $) => (n(), s("div", {
|
|
315
316
|
class: "sidebar",
|
|
316
|
-
key:
|
|
317
|
+
key: $
|
|
317
318
|
}, [
|
|
318
319
|
y("label", null, [
|
|
319
|
-
|
|
320
|
+
N(y("input", {
|
|
320
321
|
type: "checkbox",
|
|
321
|
-
"onUpdate:modelValue": (
|
|
322
|
-
}, null, 8,
|
|
323
|
-
[
|
|
322
|
+
"onUpdate:modelValue": (T) => h.visible = T
|
|
323
|
+
}, null, 8, Te), [
|
|
324
|
+
[J, h.visible]
|
|
324
325
|
]),
|
|
325
|
-
U(" " +
|
|
326
|
+
U(" " + v(h.label), 1)
|
|
326
327
|
])
|
|
327
328
|
]))), 128))
|
|
328
329
|
]),
|
|
329
|
-
y("div",
|
|
330
|
-
(n(!0),
|
|
330
|
+
y("div", Be, [
|
|
331
|
+
(n(!0), s(F, null, D(o.value, (h, $) => (n(), s("div", {
|
|
331
332
|
class: S(["kbSection", { [h.label.toLowerCase().replace(/\s+/g, "")]: !0 }]),
|
|
332
|
-
key:
|
|
333
|
+
key: $
|
|
333
334
|
}, [
|
|
334
|
-
(n(!0),
|
|
335
|
+
(n(!0), s(F, null, D(h.layout, (T, k) => (n(), s("div", {
|
|
335
336
|
class: "spicyKBRow",
|
|
336
|
-
key:
|
|
337
|
+
key: k
|
|
337
338
|
}, [
|
|
338
|
-
(n(!0),
|
|
339
|
+
(n(!0), s(F, null, D(T, (b) => (n(), s("button", {
|
|
339
340
|
key: b,
|
|
340
341
|
class: S(["spicyKBKey", [
|
|
341
342
|
{ "is-active": l.value === b },
|
|
342
|
-
|
|
343
|
-
|
|
343
|
+
i(b),
|
|
344
|
+
r(b, h.layout, k)
|
|
344
345
|
]]),
|
|
345
|
-
onMousedown: (O) =>
|
|
346
|
-
onMouseup:
|
|
347
|
-
onTouchstart: (O) =>
|
|
348
|
-
onTouchend:
|
|
349
|
-
onClick: (O) =>
|
|
346
|
+
onMousedown: (O) => g(b),
|
|
347
|
+
onMouseup: p,
|
|
348
|
+
onTouchstart: (O) => g(b),
|
|
349
|
+
onTouchend: p,
|
|
350
|
+
onClick: (O) => u(b)
|
|
350
351
|
}, [
|
|
351
|
-
y("span",
|
|
352
|
-
], 42,
|
|
352
|
+
y("span", Fe, v(b), 1)
|
|
353
|
+
], 42, Me))), 128))
|
|
353
354
|
]))), 128))
|
|
354
355
|
], 2))), 128))
|
|
355
356
|
])
|
|
356
357
|
]));
|
|
357
358
|
}
|
|
358
|
-
},
|
|
359
|
+
}, Ie = { class: "spicyInputLabel" }, Oe = ["placeholder", "aria-label"], Pe = {
|
|
359
360
|
key: 0,
|
|
360
361
|
class: "spicyInputError"
|
|
361
|
-
},
|
|
362
|
+
}, Ae = {
|
|
362
363
|
__name: "SpicyLabel",
|
|
363
364
|
props: {
|
|
364
365
|
value: { type: String, default: "" },
|
|
@@ -372,33 +373,33 @@ const te = ["aria-label"], le = {
|
|
|
372
373
|
}
|
|
373
374
|
},
|
|
374
375
|
setup(e) {
|
|
375
|
-
const l =
|
|
376
|
-
l.value =
|
|
376
|
+
const l = x(e.value), a = x(!1), o = (p) => {
|
|
377
|
+
l.value = p.target.value;
|
|
377
378
|
}, c = () => {
|
|
378
379
|
a.value = !1;
|
|
379
|
-
},
|
|
380
|
+
}, g = () => {
|
|
380
381
|
a.value = !0;
|
|
381
382
|
};
|
|
382
|
-
return (
|
|
383
|
+
return (p, u) => (n(), s("div", {
|
|
383
384
|
class: S(["spicyInputWrapper", [e.variant, { hasValue: l.value || e.value, hasFocus: a.value, hasError: e.error }]])
|
|
384
385
|
}, [
|
|
385
|
-
y("label",
|
|
386
|
-
|
|
386
|
+
y("label", Ie, v(e.label), 1),
|
|
387
|
+
N(y("input", {
|
|
387
388
|
class: S(["spicyInput", e.variant]),
|
|
388
|
-
"onUpdate:modelValue":
|
|
389
|
+
"onUpdate:modelValue": u[0] || (u[0] = (i) => l.value = i),
|
|
389
390
|
placeholder: e.placeholder,
|
|
390
391
|
onInput: o,
|
|
391
392
|
onBlur: c,
|
|
392
|
-
onFocus:
|
|
393
|
+
onFocus: g,
|
|
393
394
|
"aria-label": e.label
|
|
394
|
-
}, null, 42,
|
|
395
|
-
[
|
|
395
|
+
}, null, 42, Oe), [
|
|
396
|
+
[Q, l.value]
|
|
396
397
|
]),
|
|
397
|
-
B(
|
|
398
|
-
e.error ? (n(),
|
|
398
|
+
B(p.$slots, "default"),
|
|
399
|
+
e.error ? (n(), s("span", Pe, v(e.error), 1)) : f("", !0)
|
|
399
400
|
], 2));
|
|
400
401
|
}
|
|
401
|
-
},
|
|
402
|
+
}, _e = { class: "spicyModalHeader" }, Ke = { class: "spicyModalActions" }, Le = ["onClick"], Ye = {
|
|
402
403
|
__name: "SpicyModal",
|
|
403
404
|
props: {
|
|
404
405
|
width: { type: String, default: "50%" },
|
|
@@ -413,50 +414,50 @@ const te = ["aria-label"], le = {
|
|
|
413
414
|
},
|
|
414
415
|
emits: ["update:visible"],
|
|
415
416
|
setup(e, { emit: t }) {
|
|
416
|
-
const l = e, a =
|
|
417
|
+
const l = e, a = w(() => ({
|
|
417
418
|
"--width": l.width,
|
|
418
419
|
"--height": l.height,
|
|
419
420
|
"--skBorderRadius": l.borderRadius,
|
|
420
421
|
"--skBgColor": l.bgColor
|
|
421
422
|
})), o = t, c = () => {
|
|
422
423
|
o("update:visible", !1);
|
|
423
|
-
},
|
|
424
|
-
l.closeOnClick &&
|
|
424
|
+
}, g = (p) => {
|
|
425
|
+
l.closeOnClick && p.target.classList.contains("spicyModalOverlay") && c();
|
|
425
426
|
};
|
|
426
|
-
return (
|
|
427
|
+
return (p, u) => e.visible ? (n(), s("div", {
|
|
427
428
|
key: 0,
|
|
428
429
|
class: "spicyModalOverlay",
|
|
429
|
-
onClick:
|
|
430
|
+
onClick: g
|
|
430
431
|
}, [
|
|
431
432
|
y("div", {
|
|
432
433
|
class: "spicyModal",
|
|
433
434
|
style: I({ ...a.value })
|
|
434
435
|
}, [
|
|
435
|
-
y("header",
|
|
436
|
-
B(
|
|
437
|
-
U(
|
|
436
|
+
y("header", _e, [
|
|
437
|
+
B(p.$slots, "spicyModalHeader", { title: e.modalTitle }, () => [
|
|
438
|
+
U(v(e.modalTitle), 1)
|
|
438
439
|
])
|
|
439
440
|
]),
|
|
440
|
-
B(
|
|
441
|
-
y("div",
|
|
442
|
-
B(
|
|
443
|
-
e.actions.length === 0 && e.closeBtn ? (n(),
|
|
441
|
+
B(p.$slots, "default"),
|
|
442
|
+
y("div", Ke, [
|
|
443
|
+
B(p.$slots, "spicyModalActions"),
|
|
444
|
+
e.actions.length === 0 && e.closeBtn ? (n(), s("button", {
|
|
444
445
|
key: 0,
|
|
445
446
|
class: "spicyModalCloseBtn spicyModalActionBtn",
|
|
446
447
|
onClick: c
|
|
447
|
-
}, " Close ")) :
|
|
448
|
-
(n(!0),
|
|
448
|
+
}, " Close ")) : f("", !0),
|
|
449
|
+
(n(!0), s(F, null, D(e.actions, (i) => (n(), s("button", {
|
|
449
450
|
class: "spicyModalExtraBtn spicyModalActionBtn",
|
|
450
|
-
key:
|
|
451
|
-
onClick:
|
|
452
|
-
},
|
|
451
|
+
key: i.label,
|
|
452
|
+
onClick: i.handler
|
|
453
|
+
}, v(i.label), 9, Le))), 128))
|
|
453
454
|
])
|
|
454
455
|
], 4)
|
|
455
|
-
])) :
|
|
456
|
+
])) : f("", !0);
|
|
456
457
|
}
|
|
457
|
-
},
|
|
458
|
-
|
|
459
|
-
],
|
|
458
|
+
}, Ve = ["aria-label", "aria-checked", "onKeydown"], Ee = /* @__PURE__ */ y("div", { class: "spicyToggleKnob" }, null, -1), Ne = [
|
|
459
|
+
Ee
|
|
460
|
+
], Ue = {
|
|
460
461
|
__name: "SpicyToggle",
|
|
461
462
|
props: {
|
|
462
463
|
modelValue: Boolean,
|
|
@@ -477,13 +478,13 @@ const te = ["aria-label"], le = {
|
|
|
477
478
|
},
|
|
478
479
|
emits: ["update:modelValue"],
|
|
479
480
|
setup(e, { emit: t }) {
|
|
480
|
-
const l = e, a =
|
|
481
|
+
const l = e, a = w(() => ({
|
|
481
482
|
"--skBorderColor": l.borderColor,
|
|
482
483
|
"--activeColor": l.activeColor
|
|
483
484
|
})), o = t, c = () => {
|
|
484
485
|
o("update:modelValue", !l.modelValue);
|
|
485
486
|
};
|
|
486
|
-
return (
|
|
487
|
+
return (g, p) => (n(), s("div", Z({
|
|
487
488
|
class: ["spicyToggle", { outlined: e.variant === "outlined", "is-active": e.modelValue }],
|
|
488
489
|
tabindex: "0",
|
|
489
490
|
role: "switch",
|
|
@@ -492,18 +493,18 @@ const te = ["aria-label"], le = {
|
|
|
492
493
|
"aria-checked": e.modelValue.toString(),
|
|
493
494
|
onClick: c,
|
|
494
495
|
onKeydown: [
|
|
495
|
-
|
|
496
|
-
|
|
496
|
+
_(Y(c, ["prevent"]), ["space"]),
|
|
497
|
+
_(Y(c, ["prevent"]), ["enter"])
|
|
497
498
|
]
|
|
498
|
-
},
|
|
499
|
+
}, g.$attrs), Ne, 16, Ve));
|
|
499
500
|
}
|
|
500
|
-
},
|
|
501
|
+
}, We = ["aria-hidden"], ze = {
|
|
501
502
|
key: 0,
|
|
502
503
|
class: "spicyTooltipIcon"
|
|
503
|
-
},
|
|
504
|
+
}, He = ["aria-label"], je = {
|
|
504
505
|
key: 2,
|
|
505
506
|
class: "spicyTooltipIcon"
|
|
506
|
-
},
|
|
507
|
+
}, Xe = {
|
|
507
508
|
__name: "SpicyTooltip",
|
|
508
509
|
props: {
|
|
509
510
|
text: String,
|
|
@@ -516,59 +517,59 @@ const te = ["aria-label"], le = {
|
|
|
516
517
|
}
|
|
517
518
|
},
|
|
518
519
|
setup(e) {
|
|
519
|
-
const t = e, l =
|
|
520
|
+
const t = e, l = x(!1), a = x(null), o = ee({
|
|
520
521
|
position: "absolute",
|
|
521
522
|
top: "0px",
|
|
522
523
|
left: "0px",
|
|
523
524
|
maxWidth: "175px"
|
|
524
|
-
}), c = (
|
|
525
|
-
const
|
|
526
|
-
|
|
527
|
-
},
|
|
528
|
-
top: (
|
|
529
|
-
o.left = `${
|
|
525
|
+
}), c = (i) => {
|
|
526
|
+
const r = i.right - window.innerWidth;
|
|
527
|
+
r > 0 && (o.left = `${parseInt(o.left) - r - 5}px`), i.left < 0 && (o.left = "5px");
|
|
528
|
+
}, g = {
|
|
529
|
+
top: (i, r) => {
|
|
530
|
+
o.left = `${i.left + (i.width - r.width) / 2}px`, o.top = `${i.top - r.height - 5}px`;
|
|
530
531
|
},
|
|
531
|
-
bottom: (
|
|
532
|
-
o.left = `${
|
|
532
|
+
bottom: (i, r) => {
|
|
533
|
+
o.left = `${i.left + (i.width - r.width) / 2}px`, o.top = `${i.bottom + 5}px`;
|
|
533
534
|
},
|
|
534
|
-
left: (
|
|
535
|
-
o.left = `${
|
|
535
|
+
left: (i, r) => {
|
|
536
|
+
o.left = `${i.left - r.width - 5}px`, o.top = `${i.top + (i.height - r.height) / 2}px`;
|
|
536
537
|
},
|
|
537
|
-
right: (
|
|
538
|
-
o.left = `${
|
|
538
|
+
right: (i, r) => {
|
|
539
|
+
o.left = `${i.right + 5}px`, o.top = `${i.top + (i.height - r.height) / 2}px`;
|
|
539
540
|
}
|
|
540
|
-
},
|
|
541
|
-
l.value = !0,
|
|
541
|
+
}, p = () => {
|
|
542
|
+
l.value = !0, te(() => {
|
|
542
543
|
if (a.value && l.value) {
|
|
543
|
-
const
|
|
544
|
-
|
|
544
|
+
const i = a.value.getBoundingClientRect(), r = a.value.querySelector(".spicyTooltip").getBoundingClientRect(), d = g[t.position];
|
|
545
|
+
d(i, r), c(r);
|
|
545
546
|
}
|
|
546
547
|
});
|
|
547
|
-
},
|
|
548
|
+
}, u = () => {
|
|
548
549
|
l.value = !1;
|
|
549
550
|
};
|
|
550
|
-
return (
|
|
551
|
-
onMouseover:
|
|
552
|
-
onMouseleave:
|
|
551
|
+
return (i, r) => (n(), s("div", {
|
|
552
|
+
onMouseover: p,
|
|
553
|
+
onMouseleave: u,
|
|
553
554
|
ref_key: "host",
|
|
554
555
|
ref: a
|
|
555
556
|
}, [
|
|
556
|
-
B(
|
|
557
|
-
l.value ? (n(),
|
|
557
|
+
B(i.$slots, "default"),
|
|
558
|
+
l.value ? (n(), s("div", {
|
|
558
559
|
key: 0,
|
|
559
560
|
class: "spicyTooltip",
|
|
560
561
|
style: I(o),
|
|
561
562
|
role: "tooltip",
|
|
562
563
|
"aria-hidden": !l.value
|
|
563
564
|
}, [
|
|
564
|
-
e.prependIcon ? (n(),
|
|
565
|
-
e.text ? (n(),
|
|
565
|
+
e.prependIcon ? (n(), s("span", ze, v(e.prependIcon), 1)) : f("", !0),
|
|
566
|
+
e.text ? (n(), s("span", {
|
|
566
567
|
key: 1,
|
|
567
568
|
class: "spicyTooltipText",
|
|
568
569
|
"aria-label": e.text
|
|
569
|
-
},
|
|
570
|
-
e.appendIcon ? (n(),
|
|
571
|
-
], 12,
|
|
570
|
+
}, v(e.text), 9, He)) : f("", !0),
|
|
571
|
+
e.appendIcon ? (n(), s("span", je, v(e.appendIcon), 1)) : f("", !0)
|
|
572
|
+
], 12, We)) : f("", !0)
|
|
572
573
|
], 544));
|
|
573
574
|
}
|
|
574
575
|
};
|
|
@@ -580,35 +581,35 @@ function W(e, t) {
|
|
|
580
581
|
};
|
|
581
582
|
return t.replace(/YYYY|MM|DD/g, (a) => l[a]());
|
|
582
583
|
}
|
|
583
|
-
function
|
|
584
|
+
function Re(e) {
|
|
584
585
|
const [t, l, a] = e.split("-");
|
|
585
586
|
return new Date(Number(t), Number(l) - 1, Number(a));
|
|
586
587
|
}
|
|
587
|
-
function
|
|
588
|
+
function qe(e, t) {
|
|
588
589
|
const l = Math.abs(t.getTime() - e.getTime());
|
|
589
590
|
return Math.ceil(l / (1e3 * 60 * 60 * 24));
|
|
590
591
|
}
|
|
591
|
-
function
|
|
592
|
+
function Ge(e, t) {
|
|
592
593
|
const l = new Date(e);
|
|
593
594
|
return l.setDate(e.getDate() + t), l;
|
|
594
595
|
}
|
|
595
|
-
function
|
|
596
|
+
function Je(e, t) {
|
|
596
597
|
const l = new Date(e);
|
|
597
598
|
return l.setDate(e.getDate() - t), l;
|
|
598
599
|
}
|
|
599
|
-
function
|
|
600
|
+
function Qe(e) {
|
|
600
601
|
const t = /* @__PURE__ */ new Date();
|
|
601
602
|
return e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
|
|
602
603
|
}
|
|
603
|
-
function
|
|
604
|
+
function Ze(e) {
|
|
604
605
|
const t = /* @__PURE__ */ new Date();
|
|
605
606
|
return t.setDate(t.getDate() - 1), e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
|
|
606
607
|
}
|
|
607
|
-
function
|
|
608
|
+
function et(e) {
|
|
608
609
|
const t = /* @__PURE__ */ new Date();
|
|
609
610
|
return t.setDate(t.getDate() + 1), e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
|
|
610
611
|
}
|
|
611
|
-
function
|
|
612
|
+
function tt(e = "YYYY-MM-DD", t = { show: !0, separator: "-" }) {
|
|
612
613
|
if (typeof e != "string" || typeof t != "object" || !t.hasOwnProperty("show") || typeof t.show != "boolean")
|
|
613
614
|
throw new Error(
|
|
614
615
|
'Invalid parameters: Please provide a valid format string and options object with a boolean "show" property.'
|
|
@@ -616,22 +617,22 @@ function Je(e = "YYYY-MM-DD", t = { show: !0, separator: "-" }) {
|
|
|
616
617
|
let a = W(/* @__PURE__ */ new Date(), e);
|
|
617
618
|
return t.separator && t.separator !== "-" && (a = a.replace(/-/g, t.separator)), t.show ? { value: a, isVisible: !0 } : { value: a, isVisible: !1 };
|
|
618
619
|
}
|
|
619
|
-
const
|
|
620
|
+
const pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
620
621
|
__proto__: null,
|
|
621
|
-
currentDate:
|
|
622
|
-
dateAdd:
|
|
623
|
-
dateDiff:
|
|
624
|
-
dateIsToday:
|
|
625
|
-
dateIsTomorrow:
|
|
626
|
-
dateIsYesterday:
|
|
627
|
-
dateSubtract:
|
|
622
|
+
currentDate: tt,
|
|
623
|
+
dateAdd: Ge,
|
|
624
|
+
dateDiff: qe,
|
|
625
|
+
dateIsToday: Qe,
|
|
626
|
+
dateIsTomorrow: et,
|
|
627
|
+
dateIsYesterday: Ze,
|
|
628
|
+
dateSubtract: Je,
|
|
628
629
|
formatDate: W,
|
|
629
|
-
parseDate:
|
|
630
|
+
parseDate: Re
|
|
630
631
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
631
|
-
function
|
|
632
|
+
function lt(e) {
|
|
632
633
|
const t = /* @__PURE__ */ new WeakMap();
|
|
633
634
|
function l(a) {
|
|
634
|
-
if (
|
|
635
|
+
if (M(a) || typeof a != "object")
|
|
635
636
|
return a;
|
|
636
637
|
if (t.has(a))
|
|
637
638
|
return t.get(a);
|
|
@@ -646,112 +647,109 @@ function Qe(e) {
|
|
|
646
647
|
function z(...e) {
|
|
647
648
|
const t = {};
|
|
648
649
|
return e.forEach((l) => {
|
|
649
|
-
if (!
|
|
650
|
+
if (!M(l)) {
|
|
650
651
|
for (const a in l)
|
|
651
652
|
if (Object.prototype.hasOwnProperty.call(l, a)) {
|
|
652
653
|
const o = l[a];
|
|
653
|
-
o !== void 0 && (typeof o == "object" && o !== null && !Array.isArray(o) ? t[a] = z(
|
|
654
|
-
t[a] || {},
|
|
655
|
-
o
|
|
656
|
-
) : t[a] = o);
|
|
654
|
+
o !== void 0 && (typeof o == "object" && o !== null && !Array.isArray(o) ? t[a] = z(t[a] || {}, o) : t[a] = o);
|
|
657
655
|
}
|
|
658
656
|
}
|
|
659
657
|
}), t;
|
|
660
658
|
}
|
|
661
|
-
function
|
|
662
|
-
return
|
|
659
|
+
function ot(...e) {
|
|
660
|
+
return M(e[0]) ? e[0] : Object.assign({}, ...e);
|
|
663
661
|
}
|
|
664
|
-
function
|
|
665
|
-
return
|
|
662
|
+
function at(e) {
|
|
663
|
+
return M(e) ? [] : Object.keys(e);
|
|
666
664
|
}
|
|
667
|
-
function
|
|
668
|
-
return
|
|
665
|
+
function nt(e) {
|
|
666
|
+
return M(e) ? [] : Object.values(e);
|
|
669
667
|
}
|
|
670
|
-
function
|
|
671
|
-
return
|
|
668
|
+
function st(e) {
|
|
669
|
+
return M(e) ? [] : Object.entries(e);
|
|
672
670
|
}
|
|
673
|
-
function
|
|
671
|
+
function M(e) {
|
|
674
672
|
return e === null || typeof e != "object" ? !1 : Array.isArray(e) ? e.length === 0 : Object.keys(e).length === 0;
|
|
675
673
|
}
|
|
676
|
-
const
|
|
674
|
+
const ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
677
675
|
__proto__: null,
|
|
678
|
-
deepClone:
|
|
676
|
+
deepClone: lt,
|
|
679
677
|
deepMerge: z,
|
|
680
|
-
getObjectEntries:
|
|
681
|
-
getObjectKeys:
|
|
682
|
-
getObjectValues:
|
|
683
|
-
isObjectEmpty:
|
|
684
|
-
mergeObjects:
|
|
678
|
+
getObjectEntries: st,
|
|
679
|
+
getObjectKeys: at,
|
|
680
|
+
getObjectValues: nt,
|
|
681
|
+
isObjectEmpty: M,
|
|
682
|
+
mergeObjects: ot
|
|
685
683
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
686
|
-
function
|
|
684
|
+
function K(e) {
|
|
687
685
|
try {
|
|
688
686
|
return new URL(e), !0;
|
|
689
687
|
} catch (t) {
|
|
690
688
|
return console.error("Invalid URL:", t), !1;
|
|
691
689
|
}
|
|
692
690
|
}
|
|
693
|
-
function
|
|
694
|
-
return
|
|
691
|
+
function it(e) {
|
|
692
|
+
return K(e) ? new URL(e).hostname : null;
|
|
695
693
|
}
|
|
696
|
-
function
|
|
697
|
-
if (!
|
|
694
|
+
function rt(e, t) {
|
|
695
|
+
if (!K(e)) return e;
|
|
698
696
|
const l = new URL(e);
|
|
699
697
|
return Object.keys(t).forEach((a) => l.searchParams.append(a, t[a])), l.toString();
|
|
700
698
|
}
|
|
701
|
-
function
|
|
699
|
+
function ct(e, t, l = "https") {
|
|
702
700
|
if (!["http", "https", "ftp", "sftp", "ftps", "ssh"].includes(l.toLowerCase()))
|
|
703
701
|
throw new Error("Invalid protocol: " + l);
|
|
704
702
|
if (!/^(?!:\/\/)([a-z0-9-]+\.)*[a-z0-9-]+$/i.test(e))
|
|
705
703
|
throw new Error("Invalid hostname: " + e);
|
|
706
704
|
return t.startsWith("/") || (t = "/" + t), t.endsWith("/") && t.length > 1 && (t = t.slice(0, -1)), t === "/" && (t = ""), `${l.toLowerCase()}://${e}${t}`;
|
|
707
705
|
}
|
|
708
|
-
const
|
|
706
|
+
const vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
709
707
|
__proto__: null,
|
|
710
|
-
appendParamsToUrl:
|
|
711
|
-
generateUrl:
|
|
712
|
-
getHostname:
|
|
713
|
-
isUrlValid:
|
|
714
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
708
|
+
appendParamsToUrl: rt,
|
|
709
|
+
generateUrl: ct,
|
|
710
|
+
getHostname: it,
|
|
711
|
+
isUrlValid: K
|
|
712
|
+
}, Symbol.toStringTag, { value: "Module" })), ut = ':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)}', gt = {
|
|
715
713
|
install(e, t = {}) {
|
|
716
714
|
const { useComponents: l = !0, useStyles: a = !0 } = t;
|
|
717
|
-
if (l && (e.component("SpicyAlert",
|
|
715
|
+
if (l && (e.component("SpicyAlert", ne), e.component("SpicyBtn", ce), e.component("SpicyCarousel", we), e.component("SpicyKeyboard", De), e.component("SpicyLabel", Ae), e.component("SpicyModal", Ye), e.component("SpicyToggle", Ue), e.component("SpicyTooltip", Xe)), a) {
|
|
718
716
|
const o = document.createElement("style");
|
|
719
|
-
o.textContent =
|
|
717
|
+
o.textContent = ut, document.head.appendChild(o);
|
|
720
718
|
}
|
|
721
719
|
}
|
|
722
720
|
};
|
|
723
721
|
export {
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
722
|
+
ne as SpicyAlert,
|
|
723
|
+
ce as SpicyBtn,
|
|
724
|
+
we as SpicyCarousel,
|
|
725
|
+
gt as SpicyKatsu,
|
|
726
|
+
De as SpicyKeyboard,
|
|
727
|
+
Ae as SpicyLabel,
|
|
728
|
+
Ye as SpicyModal,
|
|
729
|
+
Ue as SpicyToggle,
|
|
730
|
+
Xe as SpicyTooltip,
|
|
731
|
+
rt as appendParamsToUrl,
|
|
732
|
+
tt as currentDate,
|
|
733
|
+
Ge as dateAdd,
|
|
734
|
+
qe as dateDiff,
|
|
735
|
+
Qe as dateIsToday,
|
|
736
|
+
et as dateIsTomorrow,
|
|
737
|
+
Ze as dateIsYesterday,
|
|
738
|
+
Je as dateSubtract,
|
|
739
|
+
pt as dateUtils,
|
|
740
|
+
lt as deepClone,
|
|
743
741
|
z as deepMerge,
|
|
744
742
|
W as formatDate,
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
743
|
+
ct as generateUrl,
|
|
744
|
+
it as getHostname,
|
|
745
|
+
st as getObjectEntries,
|
|
746
|
+
at as getObjectKeys,
|
|
747
|
+
nt as getObjectValues,
|
|
748
|
+
M as isObjectEmpty,
|
|
749
|
+
K as isUrlValid,
|
|
750
|
+
ot as mergeObjects,
|
|
751
|
+
ft as objUtils,
|
|
752
|
+
Re as parseDate,
|
|
753
|
+
ut as spicyStyles,
|
|
754
|
+
vt as urlUtils
|
|
757
755
|
};
|
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]=p=>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=["aria-label"],ie={class:"spicyCarouselInfoText"},se={key:0,class:"spicyCarouselNavControls"},ce=[e.createElementVNode("span",{class:"spicyCarouselPrevBtnIcon"},"<",-1)],de=[e.createElementVNode("span",{class:"spicyCarouselNextBtnIcon"},">",-1)],ye={key:1,class:"spicyCarouselPagination"},pe=["onClick"],ue={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:"rgba(0, 255, 234, 0.5)"},loop:{type:Boolean,default:!0},initialSlide:{type:Number,default:0},slides:{type:Array,required:!0},width:{type:String,default:"540px"},height:{type:String,default:"300px"},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})),p=e.computed(()=>u.value.fullScreen===!1?!1:n.fullScreen),s=e.ref(n.initialSlide),u=e.computed(()=>n.slides[s.value]);let i;const y=()=>{s.value=(s.value-1+n.slides.length)%n.slides.length},d=()=>{s.value=(s.value+1)%n.slides.length},C=g=>{s.value=g},f=()=>{clearInterval(i)},S=()=>{n.autoplay&&(i=setInterval(d,n.autoplaySpeed))},b=()=>{window.open(u.value.img)},k=()=>{n.enableImageClick&&b()},m=g=>{l=g.touches[0].clientX,o=g.touches[0].clientY,a=!1},w=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&&(d(),a=!0))}};return e.onMounted(()=>{n.autoplay&&(i=setInterval(d,n.autoplaySpeed))}),e.onUnmounted(()=>{clearInterval(i)}),(g,E)=>(e.openBlock(),e.createElementBlock("div",{class:"spicyCarouselContainer",style:e.normalizeStyle({...c.value}),onMouseenter:f,onMouseleave:S,onTouchstart:m,onTouchmove:w},[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:s.value,style:e.normalizeStyle({backgroundImage:`url(${u.value.img})`}),onClick:k},[t.slides[s.value].text?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["spicyCarouselTextOverlay",{fullScreen:p.value}]),"aria-label":t.slides[s.value].text},[e.createElementVNode("span",ie,e.toDisplayString(t.slides[s.value].text),1)],10,re)):e.createCommentVNode("",!0),e.renderSlot(g.$slots,"default")],6))]),_:3}),t.showNavigation?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",{class:"spicyCarouselPrevNav"},[e.createElementVNode("button",{class:"spicyCarouselPrevBtn",onClick:y},ce)]),e.createElementVNode("div",{class:"spicyCarouselNextNav"},[e.createElementVNode("button",{class:"spicyCarouselNextBtn",onClick:d},de)])])):e.createCommentVNode("",!0),t.showPagination?(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.slides,(v,T)=>(e.openBlock(),e.createElementBlock("button",{key:T,onClick:_e=>C(T),class:e.normalizeClass(["spicyCarouselPageBtn",{active:T===s.value}])},[e.createElementVNode("span",ue,e.toDisplayString(T+1),1)],10,pe))),128))])):e.createCommentVNode("",!0)],36))}},fe={class:"kbContainer"},me={class:"kbSidebar"},ge=["onUpdate:modelValue"],he={class:"spicyKB"},ke=["onMousedown","onTouchstart","onClick"],Se={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(d=>d.visible).map(d=>d)),c=l,p=d=>{o.value=d},s=()=>{o.value=null},u=d=>{c("input",d)},i=d=>["Backspace","Tab","Caps","Enter","Shift","Ctrl","Win","Alt","Space","Fn","Ins","Del","Home","End","PgUp","PgDn","NumLock"].includes(d)?`key-${d.toLowerCase()}`:"",y=(d,C,f)=>{const S=k=>["Backspace","Tab","Caps","Enter","Shift","Space"].includes(k),b=k=>["Ctrl","Win","Alt","Fn"].includes(k);return S(d)?"key-wide":b(d)?"key-small":C[f].length===1?"key-fullwidth":""};return(d,C)=>(e.openBlock(),e.createElementBlock("div",fe,[e.createElementVNode("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(f,S)=>(e.openBlock(),e.createElementBlock("div",{class:"sidebar",key:S},[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":b=>f.visible=b},null,8,ge),[[e.vModelCheckbox,f.visible]]),e.createTextVNode(" "+e.toDisplayString(f.label),1)])]))),128))]),e.createElementVNode("div",he,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(f,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["kbSection",{[f.label.toLowerCase().replace(/\s+/g,"")]:!0}]),key:S},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.layout,(b,k)=>(e.openBlock(),e.createElementBlock("div",{class:"spicyKBRow",key:k},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b,m=>(e.openBlock(),e.createElementBlock("button",{key:m,class:e.normalizeClass(["spicyKBKey",[{"is-active":o.value===m},i(m),y(m,f.layout,k)]]),onMousedown:w=>p(m),onMouseup:s,onTouchstart:w=>p(m),onTouchend:s,onClick:w=>u(m)},[e.createElementVNode("span",Se,e.toDisplayString(m),1)],42,ke))),128))]))),128))],2))),128))])]))}},be={class:"spicyInputLabel"},Ce=["placeholder","aria-label"],Be={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=s=>{o.value=s.target.value},c=()=>{a.value=!1},p=()=>{a.value=!0};return(s,u)=>(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",be,e.toDisplayString(t.label),1),e.withDirectives(e.createElementVNode("input",{class:e.normalizeClass(["spicyInput",t.variant]),"onUpdate:modelValue":u[0]||(u[0]=i=>o.value=i),placeholder:t.placeholder,onInput:n,onBlur:c,onFocus:p,"aria-label":t.label},null,42,Ce),[[e.vModelText,o.value]]),e.renderSlot(s.$slots,"default"),t.error?(e.openBlock(),e.createElementBlock("span",Be,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)],2))}},we={class:"spicyModalHeader"},Ee={class:"spicyModalActions"},Te=["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)},p=s=>{o.closeOnClick&&s.target.classList.contains("spicyModalOverlay")&&c()};return(s,u)=>t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"spicyModalOverlay",onClick:p},[e.createElementVNode("div",{class:"spicyModal",style:e.normalizeStyle({...a.value})},[e.createElementVNode("header",we,[e.renderSlot(s.$slots,"spicyModalHeader",{title:t.modalTitle},()=>[e.createTextVNode(e.toDisplayString(t.modalTitle),1)])]),e.renderSlot(s.$slots,"default"),e.createElementVNode("div",Ee,[e.renderSlot(s.$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,Te))),128))])],4)])):e.createCommentVNode("",!0)}},$e=["aria-label","aria-checked","onKeydown"],De=[e.createElementVNode("div",{class:"spicyToggleKnob"},null,-1)],P={__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(p,s)=>(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"])]},p.$attrs),De,16,$e))}},Ve=["aria-hidden"],Ne={key:0,class:"spicyTooltipIcon"},Me=["aria-label"],Fe={key:2,class:"spicyTooltipIcon"},x={__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 y=i.right-window.innerWidth;y>0&&(n.left=`${parseInt(n.left)-y-5}px`),i.left<0&&(n.left="5px")},p={top:(i,y)=>{n.left=`${i.left+(i.width-y.width)/2}px`,n.top=`${i.top-y.height-5}px`},bottom:(i,y)=>{n.left=`${i.left+(i.width-y.width)/2}px`,n.top=`${i.bottom+5}px`},left:(i,y)=>{n.left=`${i.left-y.width-5}px`,n.top=`${i.top+(i.height-y.height)/2}px`},right:(i,y)=>{n.left=`${i.right+5}px`,n.top=`${i.top+(i.height-y.height)/2}px`}},s=()=>{o.value=!0,e.nextTick(()=>{if(a.value&&o.value){const i=a.value.getBoundingClientRect(),y=a.value.querySelector(".spicyTooltip").getBoundingClientRect(),d=p[l.position];d(i,y),c(y)}})},u=()=>{o.value=!1};return(i,y)=>(e.openBlock(),e.createElementBlock("div",{onMouseover:s,onMouseleave:u,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",Ne,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,Me)):e.createCommentVNode("",!0),t.appendIcon?(e.openBlock(),e.createElementBlock("span",Fe,e.toDisplayString(t.appendIcon),1)):e.createCommentVNode("",!0)],12,Ve)):e.createCommentVNode("",!0)],544))}};function $(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 K(t){const[l,o,a]=t.split("-");return new Date(Number(l),Number(o)-1,Number(a))}function A(t,l){const o=Math.abs(l.getTime()-t.getTime());return Math.ceil(o/(1e3*60*60*24))}function L(t,l){const o=new Date(t);return o.setDate(t.getDate()+l),o}function _(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=$(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 Ie=Object.freeze(Object.defineProperty({__proto__:null,currentDate:W,dateAdd:L,dateDiff:A,dateIsToday:z,dateIsTomorrow:U,dateIsYesterday:Y,dateSubtract:_,formatDate:$,parseDate:K},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 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 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 Oe=Object.freeze(Object.defineProperty({__proto__:null,deepClone:j,deepMerge:D,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 Pe=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)}',xe={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",P),t.component("SpicyTooltip",x)),a){const n=document.createElement("style");n.textContent=Z,document.head.appendChild(n)}}};r.SpicyAlert=V,r.SpicyBtn=N,r.SpicyCarousel=M,r.SpicyKatsu=xe,r.SpicyKeyboard=F,r.SpicyLabel=I,r.SpicyModal=O,r.SpicyToggle=P,r.SpicyTooltip=x,r.appendParamsToUrl=J,r.currentDate=W,r.dateAdd=L,r.dateDiff=A,r.dateIsToday=z,r.dateIsTomorrow=U,r.dateIsYesterday=Y,r.dateSubtract=_,r.dateUtils=Ie,r.deepClone=j,r.deepMerge=D,r.formatDate=$,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=Oe,r.parseDate=K,r.spicyStyles=Z,r.urlUtils=Pe,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
|
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"})});
|
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:14px;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}.
|
|
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:14px;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)}.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:#000000bf}.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}.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}.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}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Sato",
|
|
6
6
|
"private": false,
|
|
7
|
-
"version": "0.0.
|
|
7
|
+
"version": "0.0.36",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist/",
|
|
10
10
|
"package.json",
|
|
@@ -18,13 +18,15 @@
|
|
|
18
18
|
"publish": "npm publish",
|
|
19
19
|
"docsdev": "vitepress dev docs",
|
|
20
20
|
"docsbuild": "vitepress build docs",
|
|
21
|
-
"docspreview": "vitepress preview docs"
|
|
21
|
+
"docspreview": "vitepress preview docs",
|
|
22
|
+
"prettier": "prettier --config ./.prettier.json --write --ignore-path .gitignore ./src"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"vue": "^3.4.23"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
29
|
+
"prettier": "^3.3.3",
|
|
28
30
|
"typescript": "^5.4.5",
|
|
29
31
|
"vite": "^5.2.9",
|
|
30
32
|
"vitepress": "^1.1.3",
|