@sendelius/vue 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Cookie.css +1 -1
- package/dist/Manrope-Bold.woff2 +0 -0
- package/dist/Manrope-ExtraBold.woff2 +0 -0
- package/dist/Manrope-Light.woff2 +0 -0
- package/dist/Manrope-Medium.woff2 +0 -0
- package/dist/Manrope-Regular.woff2 +0 -0
- package/dist/Manrope-Semibold.woff2 +0 -0
- package/dist/Manrope-Thin.woff2 +0 -0
- package/dist/{Popup-BIJpeS3t.js → Popup-DpbA-yj5.js} +1 -1
- package/dist/Popup.css +1 -1
- package/dist/Progress.css +1 -1
- package/dist/ThemeSwitcher.css +1 -0
- package/dist/index.js +59 -58
- package/dist/style.css +1 -0
- package/dist/style.d.ts +1 -0
- package/dist/theme/init.d.ts +1 -0
- package/dist/theme/init.js +5 -0
- package/dist/ui/cookie/Cookie.js +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/popup/Popup.js +1 -1
- package/dist/ui/progress/Progress.js +1 -1
- package/dist/ui/theme/ThemeSwitcher.d.ts +4 -0
- package/dist/ui/theme/ThemeSwitcher.js +46 -0
- package/dist/ui/theme/ThemeSwitcher.vue.d.ts +15 -0
- package/dist/ui/theme/init.d.ts +0 -0
- package/package.json +4 -2
package/dist/Cookie.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cookie[data-v-
|
|
1
|
+
.cookie[data-v-ff77de9a]{background:var(--snd-block);color:var(--snd-text-primary);box-shadow:var(--snd-shadow-primary);z-index:100100;border-radius:10px;justify-content:center;align-items:center;padding:10px 20px;font-size:1.0769rem;display:flex;position:fixed;bottom:20px;left:50%;transform:translate(-50%)}.cookie[data-v-ff77de9a] a{color:var(--snd-accent-primary);text-decoration:none}.cookie[data-v-ff77de9a] a:hover{color:var(--snd-accent-primary-hover)}.cookie button[data-v-ff77de9a]{margin-left:8px}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/Popup.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.popup-wrap[data-v-
|
|
1
|
+
.popup-wrap[data-v-f127fcdb]{z-index:100500;background:var(--snd-popup-overflow);justify-content:center;align-items:flex-start;padding:20px;display:flex;position:fixed;inset:0;overflow:auto}.popup-wrap .popup[data-v-f127fcdb]{background:var(--snd-popup);width:100%;max-width:600px;box-shadow:0 10px 40px var(--snd-popup-shadow);border-radius:10px;padding:20px;position:relative}.popup-wrap .popup .popup-title[data-v-f127fcdb]{color:var(--snd-text-primary);margin-bottom:10px;font-size:1.3846rem;font-weight:600}.popup-wrap .popup .popup-close[data-v-f127fcdb]{justify-content:center;align-items:center;padding:0;display:flex;position:absolute;top:5px;right:5px}.popup-enter-active[data-v-f127fcdb],.popup-leave-active[data-v-f127fcdb]{transition:opacity .2s}.popup-enter-active .popup[data-v-f127fcdb],.popup-leave-active .popup[data-v-f127fcdb]{transition:transform .2s,opacity .2s}.popup-enter-from[data-v-f127fcdb],.popup-leave-to[data-v-f127fcdb]{opacity:0}.popup-enter-from .popup[data-v-f127fcdb],.popup-leave-to .popup[data-v-f127fcdb]{opacity:0;transform:translateY(-10px)scale(.98)}body.popupIsOpen{overflow:hidden}body.popupIsOpen #app{filter:blur(2px)}
|
package/dist/Progress.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.progress[data-v-
|
|
1
|
+
.progress[data-v-b8d72681]{align-items:center;gap:6px;display:flex}.progress .progress-loader[data-v-b8d72681]{border:2px solid var(--snd-accent-primary);box-sizing:border-box;border-bottom-color:#0000;border-radius:50%;width:15px;min-width:15px;height:15px;animation:1s linear infinite sndProgressRotate-b8d72681;display:inline-block}@keyframes sndProgressRotate-b8d72681{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.theme-switcher[data-v-9bc0735c]{align-items:center;gap:4px;display:flex}.theme-switcher button[data-v-9bc0735c]{cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;width:36px;height:36px;padding:0;transition:color .2s;display:flex}.theme-switcher button .icon[data-v-9bc0735c]{color:var(--snd-icons)}.theme-switcher button:hover .icon[data-v-9bc0735c]{color:var(--snd-accent-primary)}:root[data-theme=light] .theme-switcher__light .icon[data-v-9bc0735c],:root[data-theme=dark] .theme-switcher__dark .icon[data-v-9bc0735c]{color:var(--snd-icons-active)}
|
package/dist/index.js
CHANGED
|
@@ -12,13 +12,14 @@ import u from "./ui/form/Checkbox.js";
|
|
|
12
12
|
import d from "./ui/notice/Warning.js";
|
|
13
13
|
import f from "./ui/notice/Error.js";
|
|
14
14
|
import p from "./ui/notice/Success.js";
|
|
15
|
-
import { n as m, t as h } from "./Popup-
|
|
15
|
+
import { n as m, t as h } from "./Popup-DpbA-yj5.js";
|
|
16
16
|
import g from "./ui/table/Table.js";
|
|
17
|
-
import _ from "
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
17
|
+
import _ from "./ui/theme/ThemeSwitcher.js";
|
|
18
|
+
import v from "axios";
|
|
19
|
+
import { defineStore as y } from "pinia";
|
|
20
|
+
import { ref as b } from "vue";
|
|
20
21
|
// src/config/config.js
|
|
21
|
-
var
|
|
22
|
+
var x = {
|
|
22
23
|
router: null,
|
|
23
24
|
api: { default: "" },
|
|
24
25
|
endpoints: {
|
|
@@ -44,13 +45,13 @@ var b = {
|
|
|
44
45
|
onUnauthorized: null,
|
|
45
46
|
onLogout: null
|
|
46
47
|
}
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
...
|
|
48
|
+
}, S = (e = {}) => {
|
|
49
|
+
x = {
|
|
50
|
+
...x,
|
|
50
51
|
...e
|
|
51
52
|
};
|
|
52
|
-
},
|
|
53
|
-
let e =
|
|
53
|
+
}, C = () => x, w = {}, T = () => {
|
|
54
|
+
let e = C(), t = {
|
|
54
55
|
withCredentials: !0,
|
|
55
56
|
headers: {
|
|
56
57
|
"Content-Type": "application/json",
|
|
@@ -58,16 +59,16 @@ var b = {
|
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
61
|
return Object.entries(e.api).forEach(([e, n]) => {
|
|
61
|
-
|
|
62
|
+
w[e] = v.create({
|
|
62
63
|
...t,
|
|
63
64
|
baseURL: n
|
|
64
65
|
});
|
|
65
|
-
}),
|
|
66
|
-
},
|
|
67
|
-
let t =
|
|
66
|
+
}), w;
|
|
67
|
+
}, E = (e = "default") => {
|
|
68
|
+
let t = w[e] || w.default;
|
|
68
69
|
if (!t) throw Error("@sendelius/vue: API-клиенты не инициализированы. Вызови initApi().");
|
|
69
70
|
return t;
|
|
70
|
-
},
|
|
71
|
+
}, D = class extends Error {
|
|
71
72
|
constructor({ status: e = null, data: t = null } = {}) {
|
|
72
73
|
let n = t?.error, r = {
|
|
73
74
|
code: n?.code ?? "UNKNOWN_ERROR",
|
|
@@ -78,8 +79,8 @@ var b = {
|
|
|
78
79
|
}
|
|
79
80
|
};
|
|
80
81
|
// src/api/requests.js
|
|
81
|
-
async function
|
|
82
|
-
let a =
|
|
82
|
+
async function O(e, t, n = {}, r = {}, i = "default") {
|
|
83
|
+
let a = E(i), o;
|
|
83
84
|
try {
|
|
84
85
|
o = e === "get" ? await a.get(t, {
|
|
85
86
|
params: n,
|
|
@@ -89,30 +90,30 @@ async function D(e, t, n = {}, r = {}, i = "default") {
|
|
|
89
90
|
...r
|
|
90
91
|
}) : await a[e](t, n, r);
|
|
91
92
|
} catch (e) {
|
|
92
|
-
throw e.response?.status === 401 &&
|
|
93
|
+
throw e.response?.status === 401 && C().callbacks.onUnauthorized?.(), new D({
|
|
93
94
|
status: e.response?.status ?? null,
|
|
94
95
|
data: e.response?.data ?? null
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
98
|
let s = o.data;
|
|
98
|
-
if (s?.status !== "success") throw new
|
|
99
|
+
if (s?.status !== "success") throw new D({
|
|
99
100
|
status: o.status,
|
|
100
101
|
data: s
|
|
101
102
|
});
|
|
102
103
|
return s;
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
+
function k(e = "default") {
|
|
105
106
|
return {
|
|
106
|
-
get: (t, n = {}, r = {}) =>
|
|
107
|
-
post: (t, n = {}, r = {}) =>
|
|
108
|
-
put: (t, n = {}, r = {}) =>
|
|
109
|
-
patch: (t, n = {}, r = {}) =>
|
|
110
|
-
remove: (t, n = {}, r = {}) =>
|
|
111
|
-
request: (t, n, r = {}, i = {}) =>
|
|
107
|
+
get: (t, n = {}, r = {}) => O("get", t, n, r, e),
|
|
108
|
+
post: (t, n = {}, r = {}) => O("post", t, n, r, e),
|
|
109
|
+
put: (t, n = {}, r = {}) => O("put", t, n, r, e),
|
|
110
|
+
patch: (t, n = {}, r = {}) => O("patch", t, n, r, e),
|
|
111
|
+
remove: (t, n = {}, r = {}) => O("delete", t, n, r, e),
|
|
112
|
+
request: (t, n, r = {}, i = {}) => O(t, n, r, i, e)
|
|
112
113
|
};
|
|
113
114
|
}
|
|
114
115
|
// src/auth/auth.js
|
|
115
|
-
var { get:
|
|
116
|
+
var { get: A, post: j, remove: M } = k("auth"), N = y("auth", {
|
|
116
117
|
state: () => ({
|
|
117
118
|
user: {},
|
|
118
119
|
avatar: {
|
|
@@ -127,7 +128,7 @@ var { get: k, post: A, remove: j } = O("auth"), M = v("auth", {
|
|
|
127
128
|
async init(e = !0) {
|
|
128
129
|
if (this.isInit && e) return this.isAuth;
|
|
129
130
|
try {
|
|
130
|
-
let e = await
|
|
131
|
+
let e = await A(C().endpoints.auth.me);
|
|
131
132
|
e?.user ? (this.user = e.user, this.avatar = e.user.avatar ?? this.avatar, this.isAuth = !0) : this.clear();
|
|
132
133
|
} catch {
|
|
133
134
|
this.clear();
|
|
@@ -139,24 +140,24 @@ var { get: k, post: A, remove: j } = O("auth"), M = v("auth", {
|
|
|
139
140
|
async login(e, t, n) {
|
|
140
141
|
n ||= "";
|
|
141
142
|
try {
|
|
142
|
-
await
|
|
143
|
+
await j(C().endpoints.auth.login, {
|
|
143
144
|
login: e,
|
|
144
145
|
password: t,
|
|
145
146
|
captcha: n
|
|
146
147
|
}), await this.init(!1);
|
|
147
|
-
let r =
|
|
148
|
-
return r && await r.push(
|
|
148
|
+
let r = C().router;
|
|
149
|
+
return r && await r.push(C().redirects.afterLogin), !0;
|
|
149
150
|
} catch (e) {
|
|
150
151
|
throw e;
|
|
151
152
|
}
|
|
152
153
|
},
|
|
153
154
|
async logout() {
|
|
154
155
|
try {
|
|
155
|
-
await
|
|
156
|
+
await M(C().endpoints.auth.logout);
|
|
156
157
|
} finally {
|
|
157
|
-
this.clear(),
|
|
158
|
-
let e =
|
|
159
|
-
e && await e.push(
|
|
158
|
+
this.clear(), C().callbacks.onLogout?.();
|
|
159
|
+
let e = C().router;
|
|
160
|
+
e && await e.push(C().redirects.afterLogout);
|
|
160
161
|
}
|
|
161
162
|
},
|
|
162
163
|
clear() {
|
|
@@ -168,61 +169,61 @@ var { get: k, post: A, remove: j } = O("auth"), M = v("auth", {
|
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
});
|
|
171
|
-
function
|
|
172
|
-
return
|
|
172
|
+
function P() {
|
|
173
|
+
return N();
|
|
173
174
|
}
|
|
174
175
|
// src/captcha/captcha.js
|
|
175
|
-
var { get:
|
|
176
|
-
async function I() {
|
|
177
|
-
let e = await L(), t = await z(e.challenge);
|
|
178
|
-
return R(e.id, t);
|
|
179
|
-
}
|
|
176
|
+
var { get: F, post: I } = k("auth");
|
|
180
177
|
async function L() {
|
|
181
|
-
|
|
178
|
+
let e = await R(), t = await B(e.challenge);
|
|
179
|
+
return z(e.id, t);
|
|
180
|
+
}
|
|
181
|
+
async function R() {
|
|
182
|
+
return F(C().endpoints.captcha.challenge);
|
|
182
183
|
}
|
|
183
|
-
async function
|
|
184
|
-
return (await
|
|
184
|
+
async function z(e, t) {
|
|
185
|
+
return (await I(C().endpoints.captcha.verify, {
|
|
185
186
|
id: e,
|
|
186
187
|
nonce: t
|
|
187
188
|
}))?.token;
|
|
188
189
|
}
|
|
189
|
-
async function
|
|
190
|
+
async function B(e) {
|
|
190
191
|
let t = "0".repeat(4), n = 0;
|
|
191
192
|
for (;;) {
|
|
192
|
-
if ((await
|
|
193
|
+
if ((await V(`${e}:${n}`)).startsWith(t)) return n;
|
|
193
194
|
n++;
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
|
-
async function
|
|
197
|
+
async function V(e) {
|
|
197
198
|
let t = new TextEncoder().encode(e), n = await crypto.subtle.digest("SHA-256", t);
|
|
198
199
|
return Array.from(new Uint8Array(n)).map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
199
200
|
}
|
|
200
201
|
// src/captcha/store.js
|
|
201
|
-
var
|
|
202
|
-
let e =
|
|
202
|
+
var H = y("captcha", () => {
|
|
203
|
+
let e = b(""), t = b(!1), n = b(!1), r = null;
|
|
203
204
|
return {
|
|
204
205
|
token: e,
|
|
205
206
|
isInit: t,
|
|
206
207
|
isLoading: n,
|
|
207
|
-
init: async () => t.value ? e.value : r || (n.value = !0, r =
|
|
208
|
+
init: async () => t.value ? e.value : r || (n.value = !0, r = L().then((n) => (e.value = n, t.value = !0, n)).finally(() => {
|
|
208
209
|
n.value = !1, r = null;
|
|
209
210
|
}), r)
|
|
210
211
|
};
|
|
211
212
|
});
|
|
212
|
-
function
|
|
213
|
-
return
|
|
213
|
+
function U() {
|
|
214
|
+
return H();
|
|
214
215
|
}
|
|
215
216
|
// src/helpers/declension.js
|
|
216
|
-
function
|
|
217
|
+
function W(e, t, n, r) {
|
|
217
218
|
let i = Math.abs(e) % 100, a = i % 10, o;
|
|
218
219
|
return o = i >= 11 && i <= 19 ? r : a === 1 ? t : a >= 2 && a <= 4 ? n : r, `${e} ${o}`;
|
|
219
220
|
}
|
|
220
221
|
// src/helpers/title.js
|
|
221
|
-
function
|
|
222
|
-
t ??=
|
|
222
|
+
function G(e, t, n) {
|
|
223
|
+
t ??= C().title.default, n ??= C().title.separator, t || (n = ""), document.title = e ? `${e}${n}${t}` : t;
|
|
223
224
|
}
|
|
224
225
|
// src/helpers/objects.js
|
|
225
|
-
function
|
|
226
|
+
function K(e) {
|
|
226
227
|
return Array.isArray(e) ? e.length === 0 : e && typeof e == "object" ? Object.keys(e).length === 0 : !0;
|
|
227
228
|
}
|
|
228
|
-
export {
|
|
229
|
+
export { D as ApiError, i as SndAutocomplete, t as SndBtn, u as SndCheckbox, n as SndCookie, f as SndError, r as SndInput, s as SndInputCity, c as SndInputDate, l as SndInputPassword, a as SndInputPhone, h as SndPopup, e as SndProgress, o as SndSelect, p as SndSuccess, g as SndTable, _ as SndThemeSwitcher, d as SndWarning, S as configure, W as declension, E as getClient, C as getConfig, T as initApi, K as isEmpty, G as setTitle, k as useApi, P as useAuth, U as useCaptcha, m as usePopup };
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--snd-font-family:"Manrope";--snd-font-size:15px;--snd-scrollbar-light:#d5d8ea;--snd-scrollbar-dark:#111424}:root[data-theme=light]{--snd-background:#edf1ff;--snd-text-primary:#111424;--snd-text-secondary:#484e71;--snd-accent-primary:#266ccb;--snd-accent-primary-hover:#205cae;--snd-accent-primary-dark:#1c4d8f;--snd-scrollbar:var(--snd-scrollbar-light);--snd-shadow-primary:0 12px 32px 0 #2517790f;--snd-shadow-secondary:0 8px 24px #00000014;--snd-icons:#9299c3;--snd-icons-active:#111424;--snd-block:#fff;--snd-popup:#edf1ff;--snd-popup-overflow:#11142480}:root[data-theme=dark]{--snd-background:#111424;--snd-text-primary:#fff;--snd-text-secondary:#b1b4c7;--snd-accent-primary:#2f80ed;--snd-accent-primary-hover:#276fcf;--snd-accent-primary-dark:#1d4f91;--snd-scrollbar:var(--snd-scrollbar-dark);--snd-shadow-primary:0 12px 32px 0 #00000026;--snd-shadow-secondary:0 8px 24px #00000014;--snd-icons:#747a9c;--snd-icons-active:#fff;--snd-block:#122136;--snd-popup:#122136;--snd-popup-overflow:#11142480}:root{--color-white:#fff;--color-white-blue:#edf1ff;--color-white-blue-alpha-50:#edf1ff80;--color-white-blue-light:#f6f8ff;--color-primary:#2f80ed;--color-primary-hover:#276fcf;--color-primary-dark:#1d4f91;--color-black:#111424;--color-black-alpha-50:#11142480;--color-navy:#0b1f3b;--color-navy-medium:#0e2749;--color-navy-light:#122136;--color-slate:#1e3452;--color-slate-light:#484e71;--color-slate-alpha-30:#223c504d;--color-gray-blue:#747a9c;--color-gray-blue-light:#9299c3;--color-gray-blue-medium:#b1b4c7;--color-gray-blue-lighter:#d5d8ea;--color-gray-blue-lightest:#dee2fb;--color-gray-light:#e5e7eb;--color-red:#c10d18;--color-red-medium:#9c060f;--color-red-dark:#5f080d;--color-red-light:#f91523;--color-green:#06a76a;--color-green-dark:#05774c;--shadow-primary:0 12px 32px 0 #2517790f;--shadow-secondary:0 8px 24px #00000014}:root[data-theme=light]{--theme-background:var(--color-white-blue);--theme-background-alpha:var(--color-white-blue-alpha-50);--theme-scrollbar:var(--color-gray-blue-lighter);--theme-text-primary:var(--color-black);--theme-text-secondary:var(--color-slate-light);--theme-icons:var(--color-gray-blue-light);--theme-icons-active:var(--color-black);--theme-block:var(--color-white);--theme-menu-mobile-border:var(--color-gray-blue-light);--color-primary:#266ccb;--color-primary-hover:#205cae;--color-primary-dark:#1c4d8f}:root[data-theme=dark]{--theme-background:var(--color-black);--theme-background-alpha:var(--color-black-alpha-50);--theme-scrollbar:var(--color-black);--theme-text-primary:var(--color-white);--theme-text-secondary:var(--color-gray-blue-medium);--theme-icons:var(--color-gray-blue);--theme-icons-active:var(--color-white);--theme-block:var(--color-navy-light);--theme-menu-mobile-border:var(--color-slate);--shadow-primary:0 12px 32px 0 #00000026}@font-face{font-family:Manrope;src:url(/Manrope-Bold.woff2)format("woff2");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:Manrope;src:url(/Manrope-Semibold.woff2)format("woff2");font-weight:600;font-style:normal;font-display:swap}@font-face{font-family:Manrope;src:url(/Manrope-Regular.woff2)format("woff2");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:Manrope;src:url(/Manrope-Light.woff2)format("woff2");font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:Manrope;src:url(/Manrope-Thin.woff2)format("woff2");font-weight:100;font-style:normal;font-display:swap}@font-face{font-family:Manrope;src:url(/Manrope-Medium.woff2)format("woff2");font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:Manrope;src:url(/Manrope-ExtraBold.woff2)format("woff2");font-weight:800;font-style:normal;font-display:swap}*{box-sizing:border-box;outline:none}html{font-family:var(--snd-font-family), sans-serif;font-size:var(--snd-font-size)}body{background:var(--snd-background);min-width:320px;min-height:100vh;color:var(--snd-text-secondary);margin:0;padding:0}body.isLoaded,body.isLoaded *{transition:background .2s linear,background-color .2s linear,color .2s linear,border-color .2s linear,fill .2s linear,stroke .2s linear}body.noScroll{overflow:hidden}#app{flex-direction:column;justify-content:flex-start;align-items:center;min-height:100vh;display:flex}.container{width:100%;max-width:1440px}input,button,select,textarea,.btn{font-family:var(--snd-font-family), sans-serif;font-size:1rem}strong{color:var(--snd-text-primary);font-weight:600}a:not(.btn){color:var(--snd-accent-primary);font-weight:500;text-decoration:none}a:not(.btn):hover{color:var(--snd-accent-primary-hover);text-decoration:underline}p{margin:8px 0}p:first-child{margin-top:0}p:last-child{margin-bottom:0}@media screen and (width<=900px){#app{flex-direction:column}}*{scrollbar-width:thin;scrollbar-color:var(--snd-accent-primary-dark) var(--snd-scrollbar)}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{border:2px solid;border-radius:10px}::-webkit-scrollbar-track{background:var(--snd-scrollbar)}::-webkit-scrollbar-thumb{background-color:var(--snd-accent-primary-dark);border-color:var(--snd-scrollbar)}.scrollbar-light,.scrollbar-light *{scrollbar-color:var(--snd-accent-primary-dark) var(--snd-scrollbar-light)}.scrollbar-light::-webkit-scrollbar-track{background:var(--snd-scrollbar-light)}.scrollbar-light ::-webkit-scrollbar-track{background:var(--snd-scrollbar-light)}.scrollbar-light::-webkit-scrollbar-thumb{background-color:var(--snd-accent-primary-dark);border-color:var(--snd-scrollbar-light)}.scrollbar-light ::-webkit-scrollbar-thumb{background-color:var(--snd-accent-primary-dark);border-color:var(--snd-scrollbar-light)}.scrollbar-dark,.scrollbar-dark *{scrollbar-color:var(--snd-accent-primary-dark) var(--snd-scrollbar-dark)}.scrollbar-dark::-webkit-scrollbar-track{background:var(--snd-scrollbar-dark)}.scrollbar-dark ::-webkit-scrollbar-track{background:var(--snd-scrollbar-dark)}.scrollbar-dark::-webkit-scrollbar-thumb{background-color:var(--snd-accent-primary-dark);border-color:var(--snd-scrollbar-dark)}.scrollbar-dark ::-webkit-scrollbar-thumb{background-color:var(--snd-accent-primary-dark);border-color:var(--snd-scrollbar-dark)}
|
package/dist/style.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/ui/cookie/Cookie.js
CHANGED
package/dist/ui/index.d.ts
CHANGED
|
@@ -15,3 +15,4 @@ export { default as SndPopup } from './popup/Popup.vue';
|
|
|
15
15
|
export { usePopup } from './popup/usePopup';
|
|
16
16
|
export { default as SndProgress } from './progress/Progress.vue';
|
|
17
17
|
export { default as SndTable } from './table/Table.vue';
|
|
18
|
+
export { default as SndThemeSwitcher } from './theme/ThemeSwitcher.vue';
|
package/dist/ui/popup/Popup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as default } from "../../Popup-
|
|
1
|
+
export { t as default } from "../../Popup-DpbA-yj5.js";
|
|
@@ -19,5 +19,5 @@ var c = {
|
|
|
19
19
|
setup(e) {
|
|
20
20
|
return (l, u) => e.show ? (o(), r("div", c, [e.label ? (o(), r(t, { key: 0 }, [a(s(e.label) + " ...", 1)], 64)) : n("", !0), u[0] ||= i("span", { class: "progress-loader" }, null, -1)])) : n("", !0);
|
|
21
21
|
}
|
|
22
|
-
}, [["__scopeId", "data-v-
|
|
22
|
+
}, [["__scopeId", "data-v-b8d72681"]]);
|
|
23
23
|
export { l as default };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { t as e } from "../../_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
2
|
+
import { createElementBlock as t, createElementVNode as n, createStaticVNode as r, onMounted as i, openBlock as a, ref as o } from "vue";
|
|
3
|
+
import '../../ThemeSwitcher.css';// src/ui/theme/ThemeSwitcher.vue
|
|
4
|
+
var s = { class: "theme-switcher" }, c = ["aria-pressed"], l = ["width", "height"], u = ["aria-pressed"], d = ["width", "height"], f = /*#__PURE__*/ e({
|
|
5
|
+
__name: "ThemeSwitcher",
|
|
6
|
+
props: { iconSize: {
|
|
7
|
+
type: [String, Number],
|
|
8
|
+
default: 20
|
|
9
|
+
} },
|
|
10
|
+
setup(e) {
|
|
11
|
+
let f = o("light"), p = (e) => {
|
|
12
|
+
f.value = e, document.documentElement.setAttribute("data-theme", e), localStorage.setItem("theme", e);
|
|
13
|
+
};
|
|
14
|
+
return i(() => {
|
|
15
|
+
let e = document.documentElement.getAttribute("data-theme");
|
|
16
|
+
(e === "light" || e === "dark") && (f.value = document.documentElement.getAttribute("data-theme") || "light");
|
|
17
|
+
}), (i, o) => (a(), t("div", s, [n("button", {
|
|
18
|
+
class: "theme-switcher__dark",
|
|
19
|
+
type: "button",
|
|
20
|
+
"aria-label": "Тёмная тема",
|
|
21
|
+
"aria-pressed": f.value === "dark",
|
|
22
|
+
onClick: o[0] ||= (e) => p("dark")
|
|
23
|
+
}, [(a(), t("svg", {
|
|
24
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
+
width: e.iconSize,
|
|
26
|
+
height: e.iconSize,
|
|
27
|
+
viewBox: "0 0 24 24",
|
|
28
|
+
fill: "currentColor",
|
|
29
|
+
class: "icon icon-moon"
|
|
30
|
+
}, [...o[2] ||= [n("path", { d: "M12 1.992a10 10 0 1 0 9.236 13.838c.341 -.82 -.476 -1.644 -1.298 -1.31a6.5 6.5 0 0 1 -6.864 -10.787l.077 -.08c.551 -.63 .113 -1.653 -.758 -1.653h-.266l-.068 -.006l-.06 -.002z" }, null, -1)]], 8, l))], 8, c), n("button", {
|
|
31
|
+
class: "theme-switcher__light",
|
|
32
|
+
type: "button",
|
|
33
|
+
"aria-label": "Светлая тема",
|
|
34
|
+
"aria-pressed": f.value === "light",
|
|
35
|
+
onClick: o[1] ||= (e) => p("light")
|
|
36
|
+
}, [(a(), t("svg", {
|
|
37
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38
|
+
width: e.iconSize,
|
|
39
|
+
height: e.iconSize,
|
|
40
|
+
viewBox: "0 0 24 24",
|
|
41
|
+
fill: "currentColor",
|
|
42
|
+
class: "icon icon-sun"
|
|
43
|
+
}, [...o[3] ||= [r("<path d=\"M12 19a1 1 0 0 1 .993 .883l.007 .117v1a1 1 0 0 1 -1.993 .117l-.007 -.117v-1a1 1 0 0 1 1 -1z\" data-v-9bc0735c></path><path d=\"M18.313 16.91l.094 .083l.7 .7a1 1 0 0 1 -1.32 1.497l-.094 -.083l-.7 -.7a1 1 0 0 1 1.218 -1.567l.102 .07z\" data-v-9bc0735c></path><path d=\"M7.007 16.993a1 1 0 0 1 .083 1.32l-.083 .094l-.7 .7a1 1 0 0 1 -1.497 -1.32l.083 -.094l.7 -.7a1 1 0 0 1 1.414 0z\" data-v-9bc0735c></path><path d=\"M4 11a1 1 0 0 1 .117 1.993l-.117 .007h-1a1 1 0 0 1 -.117 -1.993l.117 -.007h1z\" data-v-9bc0735c></path><path d=\"M21 11a1 1 0 0 1 .117 1.993l-.117 .007h-1a1 1 0 0 1 -.117 -1.993l.117 -.007h1z\" data-v-9bc0735c></path><path d=\"M6.213 4.81l.094 .083l.7 .7a1 1 0 0 1 -1.32 1.497l-.094 -.083l-.7 -.7a1 1 0 0 1 1.217 -1.567l.102 .07z\" data-v-9bc0735c></path><path d=\"M19.107 4.893a1 1 0 0 1 .083 1.32l-.083 .094l-.7 .7a1 1 0 0 1 -1.497 -1.32l.083 -.094l.7 -.7a1 1 0 0 1 1.414 0z\" data-v-9bc0735c></path><path d=\"M12 2a1 1 0 0 1 .993 .883l.007 .117v1a1 1 0 0 1 -1.993 .117l-.007 -.117v-1a1 1 0 0 1 1 -1z\" data-v-9bc0735c></path><path d=\"M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z\" data-v-9bc0735c></path>", 9)]], 8, d))], 8, u)]));
|
|
44
|
+
}
|
|
45
|
+
}, [["__scopeId", "data-v-9bc0735c"]]);
|
|
46
|
+
export { f as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
iconSize: {
|
|
3
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
4
|
+
default: number;
|
|
5
|
+
};
|
|
6
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
7
|
+
iconSize: {
|
|
8
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
9
|
+
default: number;
|
|
10
|
+
};
|
|
11
|
+
}>> & Readonly<{}>, {
|
|
12
|
+
iconSize: string | number;
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
|
|
15
|
+
export default component;
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
".": {
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"import": "./dist/index.js"
|
|
19
|
-
}
|
|
19
|
+
},
|
|
20
|
+
"./style": "./dist/style.css",
|
|
21
|
+
"./theme/init": "./dist/theme/init.js"
|
|
20
22
|
},
|
|
21
23
|
"repository": {
|
|
22
24
|
"type": "git",
|
|
@@ -48,5 +50,5 @@
|
|
|
48
50
|
"@parcel/watcher@2.6.0": true,
|
|
49
51
|
"vue-demi@0.14.10": true
|
|
50
52
|
},
|
|
51
|
-
"version": "0.
|
|
53
|
+
"version": "0.6.0"
|
|
52
54
|
}
|