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