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