spicykatsu 0.0.1 → 0.0.3
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 -1
- package/dist/spicykatsu.es.js +252 -23
- package/dist/spicykatsu.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +31 -30
- package/.vscode/extensions.json +0 -3
- package/docs/.vitepress/cache/deps/@theme_index.js +0 -269
- package/docs/.vitepress/cache/deps/@theme_index.js.map +0 -7
- package/docs/.vitepress/cache/deps/_metadata.json +0 -40
- package/docs/.vitepress/cache/deps/chunk-4I4JYJZN.js +0 -9088
- package/docs/.vitepress/cache/deps/chunk-4I4JYJZN.js.map +0 -7
- package/docs/.vitepress/cache/deps/chunk-CKQ4TNQ3.js +0 -11402
- package/docs/.vitepress/cache/deps/chunk-CKQ4TNQ3.js.map +0 -7
- package/docs/.vitepress/cache/deps/package.json +0 -3
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +0 -2582
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +0 -7
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +0 -567
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +0 -7
- package/docs/.vitepress/cache/deps/vue.js +0 -323
- package/docs/.vitepress/cache/deps/vue.js.map +0 -7
- package/docs/.vitepress/config.js +0 -15
- package/docs/button.md +0 -16
- package/docs/index.md +0 -1
- package/index.html +0 -11
- package/src/App.vue +0 -25
- package/src/components/SpicyBtn.vue +0 -76
- package/src/index.ts +0 -3
- package/src/main.ts +0 -3
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.json +0 -25
- package/tsconfig.node.json +0 -11
- package/vite.config.ts +0 -22
package/README.md
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
# SpicyKatsuLib
|
|
1
|
+
# SpicyKatsuLib
|
|
2
|
+
|
|
3
|
+
Fun, simple library for Vue3. Something for me to play around with in my projects.
|
|
4
|
+
The idea is to make things simple and lightweight. While keeping functionality.
|
|
5
|
+
|
|
6
|
+
Included will be componenets and utilites. Maybe more in the future.
|
package/dist/spicykatsu.es.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import { openBlock as o, createElementBlock as
|
|
2
|
-
const
|
|
3
|
-
const e = t.__vccOpts || t;
|
|
4
|
-
for (const [i, c] of n)
|
|
5
|
-
e[i] = c;
|
|
6
|
-
return e;
|
|
7
|
-
}, m = ["disabled"], y = {
|
|
1
|
+
import { openBlock as o, createElementBlock as r, normalizeClass as g, normalizeStyle as w, toDisplayString as c, createCommentVNode as s, createElementVNode as y, renderSlot as b, ref as h, withDirectives as M, vModelText as Y, mergeProps as k, withKeys as C, withModifiers as B, createBlock as I, Transition as T, withCtx as V } from "vue";
|
|
2
|
+
const x = ["disabled"], $ = {
|
|
8
3
|
key: 0,
|
|
9
4
|
class: "spicyBtnIcon"
|
|
10
|
-
},
|
|
5
|
+
}, X = {
|
|
11
6
|
__name: "SpicyBtn",
|
|
12
7
|
props: {
|
|
13
8
|
variant: {
|
|
14
9
|
type: String,
|
|
15
10
|
default: "filled",
|
|
16
|
-
validator: (
|
|
11
|
+
validator: (e) => ["outlined", "filled"].includes(e)
|
|
17
12
|
},
|
|
18
13
|
disabled: {
|
|
19
14
|
type: Boolean,
|
|
@@ -23,24 +18,258 @@ const f = (t, n) => {
|
|
|
23
18
|
type: String,
|
|
24
19
|
default: "Button"
|
|
25
20
|
},
|
|
26
|
-
icon: String
|
|
21
|
+
icon: String,
|
|
22
|
+
color: String,
|
|
23
|
+
textColor: String,
|
|
24
|
+
hoverColor: String,
|
|
25
|
+
borderColor: String,
|
|
26
|
+
// Custom color for the button border (if outlined variant)
|
|
27
|
+
fontSize: {
|
|
28
|
+
type: [Number, String],
|
|
29
|
+
default: 14
|
|
30
|
+
},
|
|
31
|
+
fontWeight: {
|
|
32
|
+
type: [Number, String],
|
|
33
|
+
default: 500
|
|
34
|
+
}
|
|
27
35
|
},
|
|
28
36
|
emits: ["click"],
|
|
29
|
-
setup(
|
|
30
|
-
|
|
31
|
-
|
|
37
|
+
setup(e, { emit: t }) {
|
|
38
|
+
return (n, a) => (o(), r("button", {
|
|
39
|
+
class: g(["spicyBtn", { outlined: e.variant === "outlined", disabled: e.disabled }]),
|
|
40
|
+
style: w({ "--color": e.color, "--textColor": e.textColor, "--hoverColor": e.hoverColor }),
|
|
41
|
+
disabled: e.disabled,
|
|
42
|
+
onClick: a[0] || (a[0] = (...l) => n.onClick && n.onClick(...l))
|
|
43
|
+
}, [
|
|
44
|
+
e.icon ? (o(), r("span", $, c(e.icon), 1)) : s("", !0),
|
|
45
|
+
y("span", null, c(e.text), 1),
|
|
46
|
+
b(n.$slots, "default")
|
|
47
|
+
], 14, x));
|
|
48
|
+
}
|
|
49
|
+
}, F = ["placeholder"], O = {
|
|
50
|
+
key: 0,
|
|
51
|
+
class: "spicyInputError"
|
|
52
|
+
}, Z = {
|
|
53
|
+
__name: "SpicyLabel",
|
|
54
|
+
props: {
|
|
55
|
+
value: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: ""
|
|
58
|
+
},
|
|
59
|
+
placeholder: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ""
|
|
62
|
+
},
|
|
63
|
+
label: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "Label"
|
|
66
|
+
},
|
|
67
|
+
error: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: ""
|
|
70
|
+
},
|
|
71
|
+
variant: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: "filled",
|
|
74
|
+
validator: (e) => ["outlined", "filled"].includes(e)
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
setup(e) {
|
|
78
|
+
const t = e, n = `spicyInput-${d()}`, a = h(t.value), l = h(!1);
|
|
79
|
+
function d() {
|
|
80
|
+
const i = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
81
|
+
let u = "";
|
|
82
|
+
for (let f = 0; f < 6; f++)
|
|
83
|
+
u += i.charAt(Math.floor(Math.random() * i.length));
|
|
84
|
+
return u;
|
|
85
|
+
}
|
|
86
|
+
const p = (i) => {
|
|
87
|
+
a.value = i.target.value;
|
|
88
|
+
}, S = () => {
|
|
89
|
+
l.value = !1;
|
|
90
|
+
}, D = () => {
|
|
91
|
+
l.value = !0;
|
|
32
92
|
};
|
|
33
|
-
return (
|
|
34
|
-
class:
|
|
35
|
-
disabled: t.disabled,
|
|
36
|
-
onClick: i
|
|
93
|
+
return (i, u) => (o(), r("div", {
|
|
94
|
+
class: g(["spicyInputWrapper", [e.variant, { hasValue: a.value || e.value, hasFocus: l.value, hasError: e.error }]])
|
|
37
95
|
}, [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
96
|
+
y("label", {
|
|
97
|
+
class: "spicyInputLabel",
|
|
98
|
+
for: n
|
|
99
|
+
}, c(e.label), 1),
|
|
100
|
+
M(y("input", {
|
|
101
|
+
id: n,
|
|
102
|
+
class: g(["spicyInput", e.variant]),
|
|
103
|
+
"onUpdate:modelValue": u[0] || (u[0] = (f) => a.value = f),
|
|
104
|
+
placeholder: e.placeholder,
|
|
105
|
+
onInput: p,
|
|
106
|
+
onBlur: S,
|
|
107
|
+
onFocus: D
|
|
108
|
+
}, null, 42, F), [
|
|
109
|
+
[Y, a.value]
|
|
110
|
+
]),
|
|
111
|
+
b(i.$slots, "default"),
|
|
112
|
+
e.error ? (o(), r("span", O, c(e.error), 1)) : s("", !0)
|
|
113
|
+
], 2));
|
|
114
|
+
}
|
|
115
|
+
}, j = ["aria-checked", "onKeydown"], U = /* @__PURE__ */ y("div", { class: "spicyToggleKnob" }, null, -1), L = [
|
|
116
|
+
U
|
|
117
|
+
], _ = {
|
|
118
|
+
__name: "SpicyToggle",
|
|
119
|
+
props: {
|
|
120
|
+
modelValue: Boolean
|
|
121
|
+
},
|
|
122
|
+
emits: ["update:modelValue"],
|
|
123
|
+
setup(e, { emit: t }) {
|
|
124
|
+
const n = e, a = t, l = () => {
|
|
125
|
+
a("update:modelValue", !n.modelValue);
|
|
126
|
+
};
|
|
127
|
+
return (d, p) => (o(), r("div", k({
|
|
128
|
+
class: ["spicyToggle", { "is-active": e.modelValue }],
|
|
129
|
+
onClick: l,
|
|
130
|
+
role: "switch",
|
|
131
|
+
"aria-checked": e.modelValue.toString(),
|
|
132
|
+
tabindex: "0",
|
|
133
|
+
onKeydown: C(B(l, ["prevent"]), ["space"])
|
|
134
|
+
}, d.$attrs), L, 16, j));
|
|
135
|
+
}
|
|
136
|
+
}, N = {
|
|
137
|
+
key: 0,
|
|
138
|
+
class: "spicyAlertIcon"
|
|
139
|
+
}, A = { key: 1 }, ee = {
|
|
140
|
+
__name: "SpicyAlert",
|
|
141
|
+
props: {
|
|
142
|
+
variant: {
|
|
143
|
+
type: String,
|
|
144
|
+
default: "info",
|
|
145
|
+
validator: (e) => ["info", "success", "warning", "error", "custom"].includes(e)
|
|
146
|
+
},
|
|
147
|
+
text: {
|
|
148
|
+
type: String,
|
|
149
|
+
default: ""
|
|
150
|
+
},
|
|
151
|
+
icon: String,
|
|
152
|
+
iconOnly: Boolean,
|
|
153
|
+
closable: {
|
|
154
|
+
type: Boolean,
|
|
155
|
+
default: !1
|
|
156
|
+
},
|
|
157
|
+
autoClose: {
|
|
158
|
+
type: Number,
|
|
159
|
+
default: 0
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
setup(e) {
|
|
163
|
+
const t = e, n = h(!0), a = () => {
|
|
164
|
+
n.value = !1;
|
|
165
|
+
};
|
|
166
|
+
return t.autoClose > 0 && setTimeout(() => {
|
|
167
|
+
n.value = !1;
|
|
168
|
+
}, t.autoClose), (l, d) => (o(), I(T, { name: "fade" }, {
|
|
169
|
+
default: V(() => [
|
|
170
|
+
n.value ? (o(), r("div", {
|
|
171
|
+
key: 0,
|
|
172
|
+
class: g(["spicyAlert", e.variant])
|
|
173
|
+
}, [
|
|
174
|
+
e.iconOnly || e.text ? (o(), r("span", N, c(e.icon), 1)) : s("", !0),
|
|
175
|
+
!e.iconOnly && e.text ? (o(), r("span", A, c(e.text), 1)) : s("", !0),
|
|
176
|
+
e.closable ? (o(), r("button", {
|
|
177
|
+
key: 2,
|
|
178
|
+
class: "closeButton",
|
|
179
|
+
onClick: a
|
|
180
|
+
}, "×")) : s("", !0)
|
|
181
|
+
], 2)) : s("", !0)
|
|
182
|
+
]),
|
|
183
|
+
_: 1
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
function m(e) {
|
|
188
|
+
try {
|
|
189
|
+
return new URL(e), !0;
|
|
190
|
+
} catch (t) {
|
|
191
|
+
return console.error("Invalid URL:", t), !1;
|
|
42
192
|
}
|
|
43
|
-
}
|
|
193
|
+
}
|
|
194
|
+
function P(e) {
|
|
195
|
+
return m(e) ? new URL(e).hostname : null;
|
|
196
|
+
}
|
|
197
|
+
function z(e, t) {
|
|
198
|
+
if (!m(e))
|
|
199
|
+
return e;
|
|
200
|
+
const n = new URL(e);
|
|
201
|
+
return Object.keys(t).forEach((a) => n.searchParams.append(a, t[a])), n.toString();
|
|
202
|
+
}
|
|
203
|
+
const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
204
|
+
__proto__: null,
|
|
205
|
+
appendParamsToUrl: z,
|
|
206
|
+
getHostname: P,
|
|
207
|
+
isUrlValid: m
|
|
208
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
209
|
+
function v(e, t) {
|
|
210
|
+
const n = {
|
|
211
|
+
YYYY: () => e.getFullYear().toString(),
|
|
212
|
+
MM: () => (e.getMonth() + 1).toString().padStart(2, "0"),
|
|
213
|
+
DD: () => e.getDate().toString().padStart(2, "0")
|
|
214
|
+
};
|
|
215
|
+
return t.replace(
|
|
216
|
+
/YYYY|MM|DD/g,
|
|
217
|
+
(a) => n[a]()
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
function E(e) {
|
|
221
|
+
const [t, n, a] = e.split("-");
|
|
222
|
+
return new Date(Number(t), Number(n) - 1, Number(a));
|
|
223
|
+
}
|
|
224
|
+
function K(e, t) {
|
|
225
|
+
const n = Math.abs(t.getTime() - e.getTime());
|
|
226
|
+
return Math.ceil(n / (1e3 * 60 * 60 * 24));
|
|
227
|
+
}
|
|
228
|
+
function R(e, t) {
|
|
229
|
+
const n = new Date(e);
|
|
230
|
+
return n.setDate(e.getDate() + t), n;
|
|
231
|
+
}
|
|
232
|
+
function W(e, t) {
|
|
233
|
+
const n = new Date(e);
|
|
234
|
+
return n.setDate(e.getDate() - t), n;
|
|
235
|
+
}
|
|
236
|
+
function q(e) {
|
|
237
|
+
const t = /* @__PURE__ */ new Date();
|
|
238
|
+
return e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
|
|
239
|
+
}
|
|
240
|
+
function H(e) {
|
|
241
|
+
const t = /* @__PURE__ */ new Date();
|
|
242
|
+
return t.setDate(t.getDate() - 1), e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
|
|
243
|
+
}
|
|
244
|
+
function G(e) {
|
|
245
|
+
const t = /* @__PURE__ */ new Date();
|
|
246
|
+
return t.setDate(t.getDate() + 1), e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
|
|
247
|
+
}
|
|
248
|
+
function J(e = "YYYY-MM-DD", t = { show: !0, separator: "-" }) {
|
|
249
|
+
if (typeof e != "string" || typeof t != "object" || !t.hasOwnProperty("show") || typeof t.show != "boolean")
|
|
250
|
+
throw new Error(
|
|
251
|
+
'Invalid parameters: Please provide a valid format string and options object with a boolean "show" property.'
|
|
252
|
+
);
|
|
253
|
+
let a = v(/* @__PURE__ */ new Date(), e);
|
|
254
|
+
return t.separator && t.separator !== "-" && (a = a.replace(/-/g, t.separator)), t.show ? { value: a, isVisible: !0 } : { value: a, isVisible: !1 };
|
|
255
|
+
}
|
|
256
|
+
const ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
257
|
+
__proto__: null,
|
|
258
|
+
currentDate: J,
|
|
259
|
+
dateAdd: R,
|
|
260
|
+
dateDiff: K,
|
|
261
|
+
dateIsToday: q,
|
|
262
|
+
dateIsTomorrow: G,
|
|
263
|
+
dateIsYesterday: H,
|
|
264
|
+
dateSubtract: W,
|
|
265
|
+
formatDate: v,
|
|
266
|
+
parseDate: E
|
|
267
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
44
268
|
export {
|
|
45
|
-
|
|
269
|
+
ee as SpicyAlert,
|
|
270
|
+
X as SpicyBtn,
|
|
271
|
+
Z as SpicyLabel,
|
|
272
|
+
_ as SpicyToggle,
|
|
273
|
+
ne as dateUtils,
|
|
274
|
+
te as urlUtils
|
|
46
275
|
};
|
package/dist/spicykatsu.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(l,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(l=typeof globalThis<"u"?globalThis:l||self,t(l.SpicyKatsu={},l.Vue))})(this,function(l,t){"use strict";const m=["disabled"],y={key:0,class:"spicyBtnIcon"},p={__name:"SpicyBtn",props:{variant:{type:String,default:"filled",validator:e=>["outlined","filled"].includes(e)},disabled:{type:Boolean,default:!1},text:{type:String,default:"Button"},icon:String,color:String,textColor:String,hoverColor:String,borderColor:String,fontSize:{type:[Number,String],default:14},fontWeight:{type:[Number,String],default:500}},emits:["click"],setup(e,{emit:n}){return(o,a)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["spicyBtn",{outlined:e.variant==="outlined",disabled:e.disabled}]),style:t.normalizeStyle({"--color":e.color,"--textColor":e.textColor,"--hoverColor":e.hoverColor}),disabled:e.disabled,onClick:a[0]||(a[0]=(...r)=>o.onClick&&o.onClick(...r))},[e.icon?(t.openBlock(),t.createElementBlock("span",y,t.toDisplayString(e.icon),1)):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString(e.text),1),t.renderSlot(o.$slots,"default")],14,m))}},h=["placeholder"],S={key:0,class:"spicyInputError"},b={__name:"SpicyLabel",props:{value:{type:String,default:""},placeholder:{type:String,default:""},label:{type:String,default:"Label"},error:{type:String,default:""},variant:{type:String,default:"filled",validator:e=>["outlined","filled"].includes(e)}},setup(e){const n=e,o=`spicyInput-${s()}`,a=t.ref(n.value),r=t.ref(!1);function s(){const i="0123456789abcdefghijklmnopqrstuvwxyz";let c="";for(let d=0;d<6;d++)c+=i.charAt(Math.floor(Math.random()*i.length));return c}const g=i=>{a.value=i.target.value},z=()=>{r.value=!1},L=()=>{r.value=!0};return(i,c)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["spicyInputWrapper",[e.variant,{hasValue:a.value||e.value,hasFocus:r.value,hasError:e.error}]])},[t.createElementVNode("label",{class:"spicyInputLabel",for:o},t.toDisplayString(e.label),1),t.withDirectives(t.createElementVNode("input",{id:o,class:t.normalizeClass(["spicyInput",e.variant]),"onUpdate:modelValue":c[0]||(c[0]=d=>a.value=d),placeholder:e.placeholder,onInput:g,onBlur:z,onFocus:L},null,42,h),[[t.vModelText,a.value]]),t.renderSlot(i.$slots,"default"),e.error?(t.openBlock(),t.createElementBlock("span",S,t.toDisplayString(e.error),1)):t.createCommentVNode("",!0)],2))}},D=["aria-checked","onKeydown"],k=[t.createElementVNode("div",{class:"spicyToggleKnob"},null,-1)],w={__name:"SpicyToggle",props:{modelValue:Boolean},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,a=n,r=()=>{a("update:modelValue",!o.modelValue)};return(s,g)=>(t.openBlock(),t.createElementBlock("div",t.mergeProps({class:["spicyToggle",{"is-active":e.modelValue}],onClick:r,role:"switch","aria-checked":e.modelValue.toString(),tabindex:"0",onKeydown:t.withKeys(t.withModifiers(r,["prevent"]),["space"])},s.$attrs),k,16,D))}},B={key:0,class:"spicyAlertIcon"},C={key:1},V={__name:"SpicyAlert",props:{variant:{type:String,default:"info",validator:e=>["info","success","warning","error","custom"].includes(e)},text:{type:String,default:""},icon:String,iconOnly:Boolean,closable:{type:Boolean,default:!1},autoClose:{type:Number,default:0}},setup(e){const n=e,o=t.ref(!0),a=()=>{o.value=!1};return n.autoClose>0&&setTimeout(()=>{o.value=!1},n.autoClose),(r,s)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade"},{default:t.withCtx(()=>[o.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["spicyAlert",e.variant])},[e.iconOnly||e.text?(t.openBlock(),t.createElementBlock("span",B,t.toDisplayString(e.icon),1)):t.createCommentVNode("",!0),!e.iconOnly&&e.text?(t.openBlock(),t.createElementBlock("span",C,t.toDisplayString(e.text),1)):t.createCommentVNode("",!0),e.closable?(t.openBlock(),t.createElementBlock("button",{key:2,class:"closeButton",onClick:a},"×")):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0)]),_:1}))}};function u(e){try{return new URL(e),!0}catch(n){return console.error("Invalid URL:",n),!1}}function M(e){return u(e)?new URL(e).hostname:null}function Y(e,n){if(!u(e))return e;const o=new URL(e);return Object.keys(n).forEach(a=>o.searchParams.append(a,n[a])),o.toString()}const T=Object.freeze(Object.defineProperty({__proto__:null,appendParamsToUrl:Y,getHostname:M,isUrlValid:u},Symbol.toStringTag,{value:"Module"}));function f(e,n){const o={YYYY:()=>e.getFullYear().toString(),MM:()=>(e.getMonth()+1).toString().padStart(2,"0"),DD:()=>e.getDate().toString().padStart(2,"0")};return n.replace(/YYYY|MM|DD/g,a=>o[a]())}function E(e){const[n,o,a]=e.split("-");return new Date(Number(n),Number(o)-1,Number(a))}function N(e,n){const o=Math.abs(n.getTime()-e.getTime());return Math.ceil(o/(1e3*60*60*24))}function I(e,n){const o=new Date(e);return o.setDate(e.getDate()+n),o}function $(e,n){const o=new Date(e);return o.setDate(e.getDate()-n),o}function j(e){const n=new Date;return e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear()}function F(e){const n=new Date;return n.setDate(n.getDate()-1),e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear()}function O(e){const n=new Date;return n.setDate(n.getDate()+1),e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear()}function U(e="YYYY-MM-DD",n={show:!0,separator:"-"}){if(typeof e!="string"||typeof n!="object"||!n.hasOwnProperty("show")||typeof n.show!="boolean")throw new Error('Invalid parameters: Please provide a valid format string and options object with a boolean "show" property.');let a=f(new Date,e);return n.separator&&n.separator!=="-"&&(a=a.replace(/-/g,n.separator)),n.show?{value:a,isVisible:!0}:{value:a,isVisible:!1}}const x=Object.freeze(Object.defineProperty({__proto__:null,currentDate:U,dateAdd:I,dateDiff:N,dateIsToday:j,dateIsTomorrow:O,dateIsYesterday:F,dateSubtract:$,formatDate:f,parseDate:E},Symbol.toStringTag,{value:"Module"}));l.SpicyAlert=V,l.SpicyBtn=p,l.SpicyLabel=b,l.SpicyToggle=w,l.dateUtils=x,l.urlUtils=T,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.spicyBtn
|
|
1
|
+
.spicyBtn{padding:8px 16px;background-color:var(--color, var(--primaryColor));border:none;border-radius:4px;color:var(--textColor);cursor:pointer;font-size:14px;font-weight:500;text-transform:uppercase;transition:background-color .25s}.spicyBtn.outlined{background-color:transparent;border:2px solid var(--borderColor);color:#424242}.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(--textColor)}.spicyBtnIcon{margin-right:6px}.spicyInputWrapper{display:flex;flex-direction:column;position:relative}.spicyInputLabel{position:absolute;top:12px;left:16px;color:var(--textColor);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(--borderColor);font-size:16px;width:100%;box-sizing:border-box;transition:border-color .25s;background-color:transparent;color:var(--textColor)}.spicyInputWrapper .spicyInput:focus{outline:none;border-color:var(--labelFocus)}.outlined .spicyInput{border:1px solid var(--borderColor);border-radius:4px}.filled .spicyInput{border:none;border-bottom:1px solid var(--borderColor)}.hasValue .spicyInputLabel,.hasFocus .spicyInputLabel{top:-16px;font-size:16px;color:var(--labelFocus);font-weight:700}.hasError .spicyInput{border-color:red}.spicyInputError{color:red;font-size:12px;margin-top:4px}.spicyToggle{width:50px;height:24px;background-color:var(--borderColor);border-radius:30px;cursor:pointer;padding:2px;transition:background-color .2s;display:inline-flex;align-items:center}.spicyToggle.is-active{background-color:var(--primaryColor)}.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:focus{outline:none;box-shadow:0 0 0 2px #5e138180}.fade-enter-active,.fade-leave-active{transition:opacity .5s}.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:#d4edda;color:#155724}.warning{background-color:#fff3cd;color:#856404}.error{background-color:#ffbdc2;color:#911f2a}.spicyAlertIcon{margin-right:8px}.closeButton{margin-left:auto;background:none;border:none;cursor:pointer}:root{--primaryColor: #5e1381;--primaryColorHover: #811faf;--errorColor: #ff0000;--borderColor: #ccc;--textColor: #ddd;--disabledOpacity: .5;--labelFocus: var(--primaryColor);--fontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;--fontSize: 14px;--fontWeight: 500;--borderWidth: 2px;--borderRadius: 4px}.spicyText{color:var(--textColor);font-family:var(--fontFamily);font-size:var(--fontSize);font-weight:var(--fontWeight)}.spicyHeader{color:var(--textColor);font-family:var(--fontFamily);font-size:24px;font-weight:700}
|
package/package.json
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "spicykatsu",
|
|
3
|
-
"description": "
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"author": "Sato",
|
|
6
|
-
"private": false,
|
|
7
|
-
"version": "0.0.
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "spicykatsu",
|
|
3
|
+
"description": "Simple Library for Vue3.",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "Sato",
|
|
6
|
+
"private": false,
|
|
7
|
+
"version": "0.0.3",
|
|
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
|
+
"docs:dev": "vitepress dev docs",
|
|
20
|
+
"test": "jest"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"vue": "^3.4.21"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@vitejs/plugin-vue": "^5.0.4",
|
|
27
|
+
"typescript": "^5.4.4",
|
|
28
|
+
"vite": "^5.2.8",
|
|
29
|
+
"vue-tsc": "^2.0.10"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/.vscode/extensions.json
DELETED
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useMediaQuery
|
|
3
|
-
} from "./chunk-4I4JYJZN.js";
|
|
4
|
-
import {
|
|
5
|
-
computed,
|
|
6
|
-
ref,
|
|
7
|
-
shallowRef,
|
|
8
|
-
watch
|
|
9
|
-
} from "./chunk-CKQ4TNQ3.js";
|
|
10
|
-
|
|
11
|
-
// node_modules/vitepress/dist/client/theme-default/index.js
|
|
12
|
-
import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/fonts.css";
|
|
13
|
-
|
|
14
|
-
// node_modules/vitepress/dist/client/theme-default/without-fonts.js
|
|
15
|
-
import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/vars.css";
|
|
16
|
-
import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/base.css";
|
|
17
|
-
import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/icons.css";
|
|
18
|
-
import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/utils.css";
|
|
19
|
-
import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/components/custom-block.css";
|
|
20
|
-
import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code.css";
|
|
21
|
-
import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code-group.css";
|
|
22
|
-
import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/components/vp-doc.css";
|
|
23
|
-
import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/components/vp-sponsor.css";
|
|
24
|
-
import VPBadge from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue";
|
|
25
|
-
import Layout from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/Layout.vue";
|
|
26
|
-
import { default as default2 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue";
|
|
27
|
-
import { default as default3 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPImage.vue";
|
|
28
|
-
import { default as default4 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPButton.vue";
|
|
29
|
-
import { default as default5 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPHomeHero.vue";
|
|
30
|
-
import { default as default6 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPHomeFeatures.vue";
|
|
31
|
-
import { default as default7 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPHomeSponsors.vue";
|
|
32
|
-
import { default as default8 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPDocAsideSponsors.vue";
|
|
33
|
-
import { default as default9 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPSponsors.vue";
|
|
34
|
-
import { default as default10 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPTeamPage.vue";
|
|
35
|
-
import { default as default11 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageTitle.vue";
|
|
36
|
-
import { default as default12 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageSection.vue";
|
|
37
|
-
import { default as default13 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPTeamMembers.vue";
|
|
38
|
-
|
|
39
|
-
// node_modules/vitepress/dist/client/shared.js
|
|
40
|
-
var inBrowser = typeof document !== "undefined";
|
|
41
|
-
|
|
42
|
-
// node_modules/vitepress/dist/client/theme-default/support/utils.js
|
|
43
|
-
import { withBase } from "vitepress";
|
|
44
|
-
|
|
45
|
-
// node_modules/vitepress/dist/client/theme-default/composables/data.js
|
|
46
|
-
import { useData as useData$ } from "vitepress";
|
|
47
|
-
var useData = useData$;
|
|
48
|
-
|
|
49
|
-
// node_modules/vitepress/dist/client/theme-default/support/utils.js
|
|
50
|
-
function ensureStartingSlash(path) {
|
|
51
|
-
return /^\//.test(path) ? path : `/${path}`;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// node_modules/vitepress/dist/client/theme-default/support/sidebar.js
|
|
55
|
-
function getSidebar(_sidebar, path) {
|
|
56
|
-
if (Array.isArray(_sidebar))
|
|
57
|
-
return addBase(_sidebar);
|
|
58
|
-
if (_sidebar == null)
|
|
59
|
-
return [];
|
|
60
|
-
path = ensureStartingSlash(path);
|
|
61
|
-
const dir = Object.keys(_sidebar).sort((a, b) => {
|
|
62
|
-
return b.split("/").length - a.split("/").length;
|
|
63
|
-
}).find((dir2) => {
|
|
64
|
-
return path.startsWith(ensureStartingSlash(dir2));
|
|
65
|
-
});
|
|
66
|
-
const sidebar = dir ? _sidebar[dir] : [];
|
|
67
|
-
return Array.isArray(sidebar) ? addBase(sidebar) : addBase(sidebar.items, sidebar.base);
|
|
68
|
-
}
|
|
69
|
-
function getSidebarGroups(sidebar) {
|
|
70
|
-
const groups = [];
|
|
71
|
-
let lastGroupIndex = 0;
|
|
72
|
-
for (const index in sidebar) {
|
|
73
|
-
const item = sidebar[index];
|
|
74
|
-
if (item.items) {
|
|
75
|
-
lastGroupIndex = groups.push(item);
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
if (!groups[lastGroupIndex]) {
|
|
79
|
-
groups.push({ items: [] });
|
|
80
|
-
}
|
|
81
|
-
groups[lastGroupIndex].items.push(item);
|
|
82
|
-
}
|
|
83
|
-
return groups;
|
|
84
|
-
}
|
|
85
|
-
function addBase(items, _base) {
|
|
86
|
-
return [...items].map((_item) => {
|
|
87
|
-
const item = { ..._item };
|
|
88
|
-
const base = item.base || _base;
|
|
89
|
-
if (base && item.link)
|
|
90
|
-
item.link = base + item.link;
|
|
91
|
-
if (item.items)
|
|
92
|
-
item.items = addBase(item.items, base);
|
|
93
|
-
return item;
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// node_modules/vitepress/dist/client/theme-default/composables/hash.js
|
|
98
|
-
var hashRef = ref(inBrowser ? location.hash : "");
|
|
99
|
-
if (inBrowser) {
|
|
100
|
-
window.addEventListener("hashchange", () => {
|
|
101
|
-
hashRef.value = location.hash;
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// node_modules/vitepress/dist/client/theme-default/composables/sidebar.js
|
|
106
|
-
function useSidebar() {
|
|
107
|
-
const { frontmatter, page, theme: theme2 } = useData();
|
|
108
|
-
const is960 = useMediaQuery("(min-width: 960px)");
|
|
109
|
-
const isOpen = ref(false);
|
|
110
|
-
const _sidebar = computed(() => {
|
|
111
|
-
const sidebarConfig = theme2.value.sidebar;
|
|
112
|
-
const relativePath = page.value.relativePath;
|
|
113
|
-
return sidebarConfig ? getSidebar(sidebarConfig, relativePath) : [];
|
|
114
|
-
});
|
|
115
|
-
const sidebar = ref(_sidebar.value);
|
|
116
|
-
watch(_sidebar, (next, prev) => {
|
|
117
|
-
if (JSON.stringify(next) !== JSON.stringify(prev))
|
|
118
|
-
sidebar.value = _sidebar.value;
|
|
119
|
-
});
|
|
120
|
-
const hasSidebar = computed(() => {
|
|
121
|
-
return frontmatter.value.sidebar !== false && sidebar.value.length > 0 && frontmatter.value.layout !== "home";
|
|
122
|
-
});
|
|
123
|
-
const leftAside = computed(() => {
|
|
124
|
-
if (hasAside)
|
|
125
|
-
return frontmatter.value.aside == null ? theme2.value.aside === "left" : frontmatter.value.aside === "left";
|
|
126
|
-
return false;
|
|
127
|
-
});
|
|
128
|
-
const hasAside = computed(() => {
|
|
129
|
-
if (frontmatter.value.layout === "home")
|
|
130
|
-
return false;
|
|
131
|
-
if (frontmatter.value.aside != null)
|
|
132
|
-
return !!frontmatter.value.aside;
|
|
133
|
-
return theme2.value.aside !== false;
|
|
134
|
-
});
|
|
135
|
-
const isSidebarEnabled = computed(() => hasSidebar.value && is960.value);
|
|
136
|
-
const sidebarGroups = computed(() => {
|
|
137
|
-
return hasSidebar.value ? getSidebarGroups(sidebar.value) : [];
|
|
138
|
-
});
|
|
139
|
-
function open() {
|
|
140
|
-
isOpen.value = true;
|
|
141
|
-
}
|
|
142
|
-
function close() {
|
|
143
|
-
isOpen.value = false;
|
|
144
|
-
}
|
|
145
|
-
function toggle() {
|
|
146
|
-
isOpen.value ? close() : open();
|
|
147
|
-
}
|
|
148
|
-
return {
|
|
149
|
-
isOpen,
|
|
150
|
-
sidebar,
|
|
151
|
-
sidebarGroups,
|
|
152
|
-
hasSidebar,
|
|
153
|
-
hasAside,
|
|
154
|
-
leftAside,
|
|
155
|
-
isSidebarEnabled,
|
|
156
|
-
open,
|
|
157
|
-
close,
|
|
158
|
-
toggle
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// node_modules/vitepress/dist/client/theme-default/composables/local-nav.js
|
|
163
|
-
import { onContentUpdated } from "vitepress";
|
|
164
|
-
|
|
165
|
-
// node_modules/vitepress/dist/client/theme-default/composables/outline.js
|
|
166
|
-
import { getScrollOffset } from "vitepress";
|
|
167
|
-
var resolvedHeaders = [];
|
|
168
|
-
function getHeaders(range) {
|
|
169
|
-
const headers = [
|
|
170
|
-
...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)")
|
|
171
|
-
].filter((el) => el.id && el.hasChildNodes()).map((el) => {
|
|
172
|
-
const level = Number(el.tagName[1]);
|
|
173
|
-
return {
|
|
174
|
-
element: el,
|
|
175
|
-
title: serializeHeader(el),
|
|
176
|
-
link: "#" + el.id,
|
|
177
|
-
level
|
|
178
|
-
};
|
|
179
|
-
});
|
|
180
|
-
return resolveHeaders(headers, range);
|
|
181
|
-
}
|
|
182
|
-
function serializeHeader(h) {
|
|
183
|
-
let ret = "";
|
|
184
|
-
for (const node of h.childNodes) {
|
|
185
|
-
if (node.nodeType === 1) {
|
|
186
|
-
if (node.classList.contains("VPBadge") || node.classList.contains("header-anchor") || node.classList.contains("ignore-header")) {
|
|
187
|
-
continue;
|
|
188
|
-
}
|
|
189
|
-
ret += node.textContent;
|
|
190
|
-
} else if (node.nodeType === 3) {
|
|
191
|
-
ret += node.textContent;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
return ret.trim();
|
|
195
|
-
}
|
|
196
|
-
function resolveHeaders(headers, range) {
|
|
197
|
-
if (range === false) {
|
|
198
|
-
return [];
|
|
199
|
-
}
|
|
200
|
-
const levelsRange = (typeof range === "object" && !Array.isArray(range) ? range.level : range) || 2;
|
|
201
|
-
const [high, low] = typeof levelsRange === "number" ? [levelsRange, levelsRange] : levelsRange === "deep" ? [2, 6] : levelsRange;
|
|
202
|
-
headers = headers.filter((h) => h.level >= high && h.level <= low);
|
|
203
|
-
resolvedHeaders.length = 0;
|
|
204
|
-
for (const { element, link } of headers) {
|
|
205
|
-
resolvedHeaders.push({ element, link });
|
|
206
|
-
}
|
|
207
|
-
const ret = [];
|
|
208
|
-
outer:
|
|
209
|
-
for (let i = 0; i < headers.length; i++) {
|
|
210
|
-
const cur = headers[i];
|
|
211
|
-
if (i === 0) {
|
|
212
|
-
ret.push(cur);
|
|
213
|
-
} else {
|
|
214
|
-
for (let j = i - 1; j >= 0; j--) {
|
|
215
|
-
const prev = headers[j];
|
|
216
|
-
if (prev.level < cur.level) {
|
|
217
|
-
;
|
|
218
|
-
(prev.children || (prev.children = [])).push(cur);
|
|
219
|
-
continue outer;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
ret.push(cur);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
return ret;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
// node_modules/vitepress/dist/client/theme-default/composables/local-nav.js
|
|
229
|
-
function useLocalNav() {
|
|
230
|
-
const { theme: theme2, frontmatter } = useData();
|
|
231
|
-
const headers = shallowRef([]);
|
|
232
|
-
const hasLocalNav = computed(() => {
|
|
233
|
-
return headers.value.length > 0;
|
|
234
|
-
});
|
|
235
|
-
onContentUpdated(() => {
|
|
236
|
-
headers.value = getHeaders(frontmatter.value.outline ?? theme2.value.outline);
|
|
237
|
-
});
|
|
238
|
-
return {
|
|
239
|
-
headers,
|
|
240
|
-
hasLocalNav
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// node_modules/vitepress/dist/client/theme-default/without-fonts.js
|
|
245
|
-
var theme = {
|
|
246
|
-
Layout,
|
|
247
|
-
enhanceApp: ({ app }) => {
|
|
248
|
-
app.component("Badge", VPBadge);
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
var without_fonts_default = theme;
|
|
252
|
-
export {
|
|
253
|
-
default2 as VPBadge,
|
|
254
|
-
default4 as VPButton,
|
|
255
|
-
default8 as VPDocAsideSponsors,
|
|
256
|
-
default6 as VPHomeFeatures,
|
|
257
|
-
default5 as VPHomeHero,
|
|
258
|
-
default7 as VPHomeSponsors,
|
|
259
|
-
default3 as VPImage,
|
|
260
|
-
default9 as VPSponsors,
|
|
261
|
-
default13 as VPTeamMembers,
|
|
262
|
-
default10 as VPTeamPage,
|
|
263
|
-
default12 as VPTeamPageSection,
|
|
264
|
-
default11 as VPTeamPageTitle,
|
|
265
|
-
without_fonts_default as default,
|
|
266
|
-
useLocalNav,
|
|
267
|
-
useSidebar
|
|
268
|
-
};
|
|
269
|
-
//# sourceMappingURL=@theme_index.js.map
|