@yourgoods/ui-smart 0.53.42 → 0.53.43
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/{ProfileEmailDialog-D4tSDyUI.js → ProfileEmailDialog-BFI9bYi5.js} +2 -2
- package/dist/{ProfilePasswordDialog-B4RF8AgG.js → ProfilePasswordDialog-DyoUrSvm.js} +1 -1
- package/dist/{ProfilePhoneDialog-WC0CiV0b.js → ProfilePhoneDialog-qirTfASr.js} +2 -2
- package/dist/{index-N4L6p5wy.js → index-CmZWZWFm.js} +118 -118
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-B79MSgkD.js → useRateLimitToast-C-VKytVF.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as oe, ref as T, reactive as Z, watch as Y, computed as b, toRefs as ce, createElementBlock as I, openBlock as y, createElementVNode as x, createCommentVNode as D, toDisplayString as _, createVNode as $, unref as u, isRef as ee, withCtx as G, createTextVNode as ie, Fragment as Ae, createBlock as H, resolveDynamicComponent as he, onMounted as Fe } from "vue";
|
|
2
|
-
import { _ as ve, c as ke, u as Re, a as ze, P as Me, b as We } from "./useRateLimitToast-
|
|
3
|
-
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-
|
|
2
|
+
import { _ as ve, c as ke, u as Re, a as ze, P as Me, b as We } from "./useRateLimitToast-C-VKytVF.js";
|
|
3
|
+
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-CmZWZWFm.js";
|
|
4
4
|
import { PInput as J, IconMailMd as pe, PButton as ne, IconEyeMd as Ve, IconEyeClosedMd as be, PDialog as Ge, PTopBar as Ye, IconCrossMd as Je } from "@profeat/ui-kit";
|
|
5
5
|
const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dialogDefaultContainerTextHint" }, Xe = {
|
|
6
6
|
key: 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as ye, ref as a, reactive as _, computed as u, watch as Z, onMounted as Ce, createElementBlock as S, openBlock as g, Fragment as ge, createVNode as n, unref as o, withCtx as m, createCommentVNode as ee, createElementVNode as r, toDisplayString as V, createBlock as B, resolveDynamicComponent as $, createTextVNode as z } from "vue";
|
|
2
|
-
import { C as I, p as D, g as Ve } from "./index-
|
|
2
|
+
import { C as I, p as D, g as Ve } from "./index-CmZWZWFm.js";
|
|
3
3
|
import { PDialog as be, PInput as M, IconEyeMd as O, IconEyeClosedMd as U, PButton as F, PTopBar as Te, IconCrossMd as Ie, PTeleportContainer as xe } from "@profeat/ui-kit";
|
|
4
4
|
function ke(b) {
|
|
5
5
|
return { showPasswordRateLimitToast: (P) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createElementBlock as S, openBlock as v, createElementVNode as H, defineComponent as he, reactive as ve, watch as _, ref as O, toRefs as Ce, computed as I, createCommentVNode as B, createVNode as b, toDisplayString as G, createBlock as J, createTextVNode as Z, unref as r, isRef as le, withCtx as X, onMounted as We, Fragment as je } from "vue";
|
|
2
|
-
import { _ as we, c as Ne, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-
|
|
2
|
+
import { _ as we, c as Ne, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-C-VKytVF.js";
|
|
3
3
|
import { IconTelegramSm as Pe, PInput as se, IconPhoneMd as Re, IconMailMd as Ke, PButton as ze, PDialog as Qe, PTopBar as Xe, IconCrossMd as Ye, PTeleportContainer as Ze } from "@profeat/ui-kit";
|
|
4
|
-
import { C as j, t as De, p as te, g as Ae } from "./index-
|
|
4
|
+
import { C as j, t as De, p as te, g as Ae } from "./index-CmZWZWFm.js";
|
|
5
5
|
const _e = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: "12",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as E, shallowRef as Ye, defineComponent as te, defineAsyncComponent as ae, watch as ke, createBlock as M, createCommentVNode as U, unref as
|
|
1
|
+
import { ref as E, shallowRef as Ye, defineComponent as te, defineAsyncComponent as ae, watch as ke, createBlock as M, createCommentVNode as U, unref as v, openBlock as N, resolveDynamicComponent as Ke, mergeProps as Xe, computed as I, reactive as ne, onMounted as He, createElementBlock as V, Fragment as Te, createVNode as b, createElementVNode as oe, withCtx as O, toDisplayString as G, createTextVNode as re, Teleport as we, Transition as Ze, withDirectives as Qe, vShow as et } from "vue";
|
|
2
2
|
import tt from "axios";
|
|
3
|
-
import { PInputFileUploader as at, PInput as j, IconFilledEditMd as Q, PButton as
|
|
3
|
+
import { PInputFileUploader as at, PInput as j, IconFilledEditMd as Q, PButton as Ee, PImageCropper as nt, PToast as ot, PTeleportContainer as Ie, PToastContainer as rt, IconPhoneMd as lt, IconMailMd as st } from "@profeat/ui-kit";
|
|
4
4
|
function it(l, s = 2) {
|
|
5
5
|
if (l === 0)
|
|
6
6
|
return "0 B";
|
|
7
|
-
const a = 1024, n = ["B", "KB", "MB", "GB", "TB", "PB", "EB"],
|
|
8
|
-
return `${Number.parseFloat((l / a **
|
|
7
|
+
const a = 1024, n = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], g = Math.floor(Math.log(l) / Math.log(a));
|
|
8
|
+
return `${Number.parseFloat((l / a ** g).toFixed(s))} ${n[g]}`;
|
|
9
9
|
}
|
|
10
10
|
const ut = {
|
|
11
11
|
"image/jpeg": "JPEG",
|
|
@@ -28,9 +28,9 @@ const Lt = {
|
|
|
28
28
|
}, _t = {
|
|
29
29
|
VERIFY_EMAIL: "verify-email"
|
|
30
30
|
};
|
|
31
|
-
let
|
|
31
|
+
let ue = null;
|
|
32
32
|
function ct(l, s, a) {
|
|
33
|
-
|
|
33
|
+
ue = tt.create({
|
|
34
34
|
baseURL: s,
|
|
35
35
|
headers: {
|
|
36
36
|
Authorization: `Bearer ${l}`,
|
|
@@ -41,33 +41,33 @@ function ct(l, s, a) {
|
|
|
41
41
|
validateStatus: (n) => n >= 200 && n < 300
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
if (!
|
|
44
|
+
function me() {
|
|
45
|
+
if (!ue)
|
|
46
46
|
throw new Error("Axios instance not initialized. Call initAxios(token, baseUrl) first.");
|
|
47
|
-
return
|
|
47
|
+
return ue;
|
|
48
48
|
}
|
|
49
|
-
async function
|
|
50
|
-
return
|
|
49
|
+
async function de(l, s, a) {
|
|
50
|
+
return me().post(l, s, a);
|
|
51
51
|
}
|
|
52
52
|
async function mt(l, s) {
|
|
53
|
-
return
|
|
53
|
+
return me().get(l, s);
|
|
54
54
|
}
|
|
55
55
|
async function pt(l, s) {
|
|
56
|
-
return
|
|
56
|
+
return me().delete(l, s);
|
|
57
57
|
}
|
|
58
58
|
async function ft(l) {
|
|
59
|
-
const s = await
|
|
59
|
+
const s = await de("/users/profile/me", l);
|
|
60
60
|
if (s.status !== 200 && s.status !== 201 || !s.data)
|
|
61
61
|
throw new Error("Ошибка при получении профиля пользователя");
|
|
62
62
|
return s.data;
|
|
63
63
|
}
|
|
64
64
|
const ee = E(null), le = Ye(null);
|
|
65
|
-
function
|
|
65
|
+
function pe() {
|
|
66
66
|
return {
|
|
67
67
|
currentDialog: ee,
|
|
68
68
|
dialogPayload: le,
|
|
69
|
-
openDialog: (n,
|
|
70
|
-
ee.value = n, le.value =
|
|
69
|
+
openDialog: (n, g) => {
|
|
70
|
+
ee.value = n, le.value = g ?? null;
|
|
71
71
|
},
|
|
72
72
|
closeDialog: () => {
|
|
73
73
|
ee.value = null, le.value = null;
|
|
@@ -75,7 +75,7 @@ function me() {
|
|
|
75
75
|
isDialogOpen: (n) => ee.value === n
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
const
|
|
78
|
+
const ce = {
|
|
79
79
|
ru: {
|
|
80
80
|
Имя: "Имя",
|
|
81
81
|
Фамилия: "Фамилия",
|
|
@@ -225,31 +225,31 @@ const de = {
|
|
|
225
225
|
},
|
|
226
226
|
emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
|
|
227
227
|
setup(l, { emit: s }) {
|
|
228
|
-
const a = s, n = E(!0), { currentDialog:
|
|
229
|
-
email: ae(() => import("./ProfileEmailDialog-
|
|
230
|
-
phone: ae(() => import("./ProfilePhoneDialog-
|
|
231
|
-
password: ae(() => import("./ProfilePasswordDialog-
|
|
228
|
+
const a = s, n = E(!0), { currentDialog: g, dialogPayload: h, closeDialog: F } = pe(), m = {
|
|
229
|
+
email: ae(() => import("./ProfileEmailDialog-BFI9bYi5.js")),
|
|
230
|
+
phone: ae(() => import("./ProfilePhoneDialog-qirTfASr.js")),
|
|
231
|
+
password: ae(() => import("./ProfilePasswordDialog-DyoUrSvm.js"))
|
|
232
232
|
}, d = ({ email: C }) => {
|
|
233
233
|
a("update-email-field", C);
|
|
234
234
|
}, u = ({ phone: C }) => {
|
|
235
235
|
a("update-phone-field", C);
|
|
236
236
|
};
|
|
237
|
-
return ke(
|
|
237
|
+
return ke(g, (C) => {
|
|
238
238
|
n.value = !!C;
|
|
239
|
-
}), (C, p) =>
|
|
239
|
+
}), (C, p) => v(g) ? (N(), M(Ke(m[v(g)]), Xe({
|
|
240
240
|
key: 0,
|
|
241
241
|
modelValue: n.value,
|
|
242
242
|
"onUpdate:modelValue": p[0] || (p[0] = (y) => n.value = y),
|
|
243
243
|
language: C.language,
|
|
244
244
|
provider: C.provider,
|
|
245
245
|
"disable-add-phone": C.disableAddPhone
|
|
246
|
-
},
|
|
247
|
-
onClose:
|
|
246
|
+
}, v(h), {
|
|
247
|
+
onClose: v(F),
|
|
248
248
|
onCleanInputErrors: p[1] || (p[1] = (y) => a("clean-input-errors")),
|
|
249
|
-
onOnUpdateJwt: p[2] || (p[2] = (y,
|
|
249
|
+
onOnUpdateJwt: p[2] || (p[2] = (y, f, r) => a("on-update-jwt", y, f, r)),
|
|
250
250
|
onSubmitEmail: d,
|
|
251
251
|
onSubmitPhone: u,
|
|
252
|
-
onOnPasswordError: p[3] || (p[3] = (y,
|
|
252
|
+
onOnPasswordError: p[3] || (p[3] = (y, f) => a("on-password-error", y, f)),
|
|
253
253
|
onOnToast: p[4] || (p[4] = (y) => a("on-toast", y))
|
|
254
254
|
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : U("", !0);
|
|
255
255
|
}
|
|
@@ -286,7 +286,7 @@ const de = {
|
|
|
286
286
|
},
|
|
287
287
|
emits: ["open-email-dialog", "open-phone-dialog", "open-password-dialog", "on-update-jwt", "on-password-error", "update-tokens"],
|
|
288
288
|
setup(l, { emit: s }) {
|
|
289
|
-
const a = l, n = s,
|
|
289
|
+
const a = l, n = s, g = I(() => a.language ?? "ru"), h = (e) => ce[g.value][e] || e, { openDialog: F } = pe(), m = ne({ firstName: "", lastName: "" }), d = E({ firstName: "", lastName: "" }), u = ne({ firstName: !1, lastName: !1, email: !1, phone: !1 }), C = E(""), p = E(""), y = E(""), f = E(!1), r = ne({
|
|
290
290
|
value: null,
|
|
291
291
|
loading: !1,
|
|
292
292
|
accept: ["image/png", "image/jpeg"],
|
|
@@ -297,7 +297,7 @@ const de = {
|
|
|
297
297
|
}), P = E(""), $ = E(!1), L = E(!0), _ = E(!0), q = E(void 0), J = E(""), i = I(() => R(m.firstName, u.firstName)), w = I(() => R(m.lastName, u.lastName)), c = I(() => u.email && !p.value.trim() ? "Введите e-mail" : ""), A = I(() => u.phone && !y.value.trim() ? "Введите номер телефона" : ""), k = (e) => a.fields.some((t) => t.key === e), z = (e) => e && e.trim() ? "edit" : "bind", S = () => setTimeout(() => {
|
|
298
298
|
var e;
|
|
299
299
|
return (e = document.activeElement) == null ? void 0 : e.blur();
|
|
300
|
-
}, 0), x = I(() => !!(p.value && p.value.trim() !== "")), W = I(() => r.imageContent ?
|
|
300
|
+
}, 0), x = I(() => !!(p.value && p.value.trim() !== "")), W = I(() => r.imageContent ? h("Загрузить другое фото") : h("Загрузить фото")), R = (e, t) => {
|
|
301
301
|
if (!t) return "";
|
|
302
302
|
const o = e.trim();
|
|
303
303
|
return o ? o.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
|
|
@@ -325,17 +325,17 @@ const de = {
|
|
|
325
325
|
}, $e = (e) => {
|
|
326
326
|
var H, Z;
|
|
327
327
|
if (P.value = "", !e) {
|
|
328
|
-
|
|
328
|
+
fe();
|
|
329
329
|
return;
|
|
330
330
|
}
|
|
331
331
|
const t = ((H = e.fileBinary) == null ? void 0 : H.type) ?? "", o = ((Z = e.fileBinary) == null ? void 0 : Z.size) ?? 0, D = !["image/png", "image/jpeg"].includes(t), B = o > r.uploadLimit;
|
|
332
332
|
if (D || B) {
|
|
333
|
-
P.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ",
|
|
333
|
+
P.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", fe();
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
|
-
r.value = e, r.imageBinary = e.fileBinary ?? null, r.imageContent = e.fileContent ?? "",
|
|
337
|
-
},
|
|
338
|
-
r.value = null, r.imageBinary = null, r.imageContent = "",
|
|
336
|
+
r.value = e, r.imageBinary = e.fileBinary ?? null, r.imageContent = e.fileContent ?? "", f.value = !0;
|
|
337
|
+
}, fe = () => {
|
|
338
|
+
r.value = null, r.imageBinary = null, r.imageContent = "", f.value = !1;
|
|
339
339
|
}, ze = async () => {
|
|
340
340
|
try {
|
|
341
341
|
const t = (await pt("/users/profile/delete/avatar")).data;
|
|
@@ -344,18 +344,18 @@ const de = {
|
|
|
344
344
|
return console.error("Ошибка при удалении аватара:", e), !1;
|
|
345
345
|
}
|
|
346
346
|
}, Le = () => {
|
|
347
|
-
P.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", r.value = null, r.imageBinary = null, r.imageContent = "",
|
|
348
|
-
},
|
|
347
|
+
P.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", r.value = null, r.imageBinary = null, r.imageContent = "", f.value = !1;
|
|
348
|
+
}, ve = async (e, t, o = "image/png") => {
|
|
349
349
|
if (!e) return null;
|
|
350
350
|
const D = await (await fetch(e)).blob();
|
|
351
351
|
return new File([D], t, { type: o });
|
|
352
352
|
}, _e = () => {
|
|
353
|
-
r.value = null, r.imageBinary = null, r.imageContent = "",
|
|
353
|
+
r.value = null, r.imageBinary = null, r.imageContent = "", f.value = !1;
|
|
354
354
|
}, Re = async (e) => {
|
|
355
|
-
|
|
355
|
+
f.value = !1;
|
|
356
356
|
const t = r.imageContent;
|
|
357
357
|
if (r.imageContent = e, !r.imageBinary) return;
|
|
358
|
-
const o = await
|
|
358
|
+
const o = await ve(
|
|
359
359
|
e,
|
|
360
360
|
r.imageBinary.name,
|
|
361
361
|
r.imageBinary.type || "image/png"
|
|
@@ -367,28 +367,28 @@ const de = {
|
|
|
367
367
|
try {
|
|
368
368
|
r.loading = !0;
|
|
369
369
|
const T = new FormData();
|
|
370
|
-
T.append("file", o), await
|
|
370
|
+
T.append("file", o), await de(`/users/profile/avatar/${C.value}`, T, { headers: { "Content-Type": void 0 } });
|
|
371
371
|
} catch (T) {
|
|
372
372
|
console.error(T), K({
|
|
373
373
|
color: "error",
|
|
374
|
-
text:
|
|
374
|
+
text: h("Не удалось сохранить изменения. Попробуйте позже")
|
|
375
375
|
}), r.imageContent = t;
|
|
376
376
|
} finally {
|
|
377
377
|
r.loading = !1;
|
|
378
378
|
}
|
|
379
379
|
}, Oe = async (e) => {
|
|
380
|
-
r.imageContent = e ?? "", r.imageBinary && (r.imageBinary = await
|
|
380
|
+
r.imageContent = e ?? "", r.imageBinary && (r.imageBinary = await ve(
|
|
381
381
|
e ?? "",
|
|
382
382
|
r.imageBinary.name,
|
|
383
383
|
r.imageBinary.type || "image/png"
|
|
384
384
|
));
|
|
385
|
-
},
|
|
385
|
+
}, ge = E(!1), he = async (e) => {
|
|
386
386
|
var o, T;
|
|
387
387
|
const t = (o = m[e]) == null ? void 0 : o.trim();
|
|
388
388
|
if (t)
|
|
389
389
|
try {
|
|
390
|
-
|
|
391
|
-
const B = (T = (await
|
|
390
|
+
ge.value = !0;
|
|
391
|
+
const B = (T = (await de("/users/profile/update-name", { [e]: t })).data) == null ? void 0 : T.data;
|
|
392
392
|
B != null && B.user && (m.firstName = B.user.firstName ?? m.firstName, m.lastName = B.user.lastName ?? m.lastName, d.value = {
|
|
393
393
|
firstName: m.firstName,
|
|
394
394
|
lastName: m.lastName
|
|
@@ -396,7 +396,7 @@ const de = {
|
|
|
396
396
|
} catch (D) {
|
|
397
397
|
throw D;
|
|
398
398
|
} finally {
|
|
399
|
-
|
|
399
|
+
ge.value = !1;
|
|
400
400
|
}
|
|
401
401
|
}, Ge = async () => {
|
|
402
402
|
var e;
|
|
@@ -442,19 +442,19 @@ const de = {
|
|
|
442
442
|
return console.error("Ошибка при составлении URL аватара:", t), "";
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
const
|
|
445
|
+
const ye = I(() => {
|
|
446
446
|
if (!d.value.firstName && !d.value.lastName)
|
|
447
447
|
return !1;
|
|
448
448
|
const e = m.firstName.trim(), t = m.lastName.trim(), o = d.value.firstName.trim(), T = d.value.lastName.trim(), D = e !== o || t !== T, B = e.length >= 2 && t.length >= 2;
|
|
449
449
|
return D && B;
|
|
450
450
|
}), Je = async () => {
|
|
451
|
-
if (
|
|
451
|
+
if (ye.value)
|
|
452
452
|
try {
|
|
453
|
-
await Promise.all([
|
|
453
|
+
await Promise.all([he("firstName"), he("lastName")]), n("on-update-jwt"), K({ color: "success", text: "Изменения сохранены" });
|
|
454
454
|
} catch (e) {
|
|
455
455
|
console.error(e), K({
|
|
456
456
|
color: "error",
|
|
457
|
-
text:
|
|
457
|
+
text: h("Не удалось сохранить изменения. Попробуйте позже")
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
460
|
}, We = () => {
|
|
@@ -466,7 +466,7 @@ const de = {
|
|
|
466
466
|
ct(a.accessToken, a.requestUrl, a.throttlerPrefix), await Ge();
|
|
467
467
|
}), (e, t) => (N(), V(Te, null, [
|
|
468
468
|
b(vt, {
|
|
469
|
-
language:
|
|
469
|
+
language: g.value,
|
|
470
470
|
provider: e.provider,
|
|
471
471
|
"disable-add-phone": e.disableAddPhone,
|
|
472
472
|
onCleanInputErrors: Me,
|
|
@@ -477,7 +477,7 @@ const de = {
|
|
|
477
477
|
onOnToast: K
|
|
478
478
|
}, null, 8, ["language", "provider", "disable-add-phone"]),
|
|
479
479
|
oe("div", gt, [
|
|
480
|
-
k("avatar") ? (N(), M(
|
|
480
|
+
k("avatar") ? (N(), M(v(at), {
|
|
481
481
|
key: 0,
|
|
482
482
|
modelValue: r.value,
|
|
483
483
|
"onUpdate:modelValue": [
|
|
@@ -488,7 +488,7 @@ const de = {
|
|
|
488
488
|
class: "avatar-input",
|
|
489
489
|
src: r.imageContent,
|
|
490
490
|
loading: r.loading,
|
|
491
|
-
label:
|
|
491
|
+
label: h("Загрузить фото"),
|
|
492
492
|
"upload-limit": r.uploadLimit,
|
|
493
493
|
accept: "image/jpeg, image/png",
|
|
494
494
|
onDelete: ze,
|
|
@@ -498,36 +498,36 @@ const de = {
|
|
|
498
498
|
re(G(W.value), 1)
|
|
499
499
|
]),
|
|
500
500
|
subtext: O(() => [
|
|
501
|
-
P.value ? (N(), V("span", ht, G(P.value), 1)) : (N(), V("span", yt, G(`${
|
|
501
|
+
P.value ? (N(), V("span", ht, G(P.value), 1)) : (N(), V("span", yt, G(`${h("Формат")} ${v(dt)(r.accept).join(", ")} ${h("до")} ${v(it)(r.uploadLimit)}`), 1))
|
|
502
502
|
]),
|
|
503
503
|
_: 1
|
|
504
504
|
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : U("", !0),
|
|
505
505
|
k("firstName") ? (N(), V("div", wt, [
|
|
506
|
-
b(
|
|
506
|
+
b(v(j), {
|
|
507
507
|
modelValue: m.firstName,
|
|
508
508
|
"onUpdate:modelValue": t[2] || (t[2] = (o) => m.firstName = o),
|
|
509
509
|
size: "large",
|
|
510
|
-
label:
|
|
510
|
+
label: h("Имя"),
|
|
511
511
|
error: i.value,
|
|
512
512
|
onBlur: t[3] || (t[3] = (o) => u.firstName = !0),
|
|
513
513
|
onInput: t[4] || (t[4] = (o) => X("firstName"))
|
|
514
514
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
515
|
-
b(
|
|
515
|
+
b(v(Q), { class: "icon-locked" })
|
|
516
516
|
])) : U("", !0),
|
|
517
517
|
k("lastName") ? (N(), V("div", Et, [
|
|
518
|
-
b(
|
|
518
|
+
b(v(j), {
|
|
519
519
|
modelValue: m.lastName,
|
|
520
520
|
"onUpdate:modelValue": t[5] || (t[5] = (o) => m.lastName = o),
|
|
521
521
|
size: "large",
|
|
522
|
-
label:
|
|
522
|
+
label: h("Фамилия"),
|
|
523
523
|
error: w.value,
|
|
524
524
|
onBlur: t[6] || (t[6] = (o) => u.lastName = !0),
|
|
525
525
|
onInput: t[7] || (t[7] = (o) => X("lastName"))
|
|
526
526
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
527
|
-
b(
|
|
527
|
+
b(v(Q), { class: "icon-locked" })
|
|
528
528
|
])) : U("", !0),
|
|
529
529
|
k("email") ? (N(), V("div", bt, [
|
|
530
|
-
b(
|
|
530
|
+
b(v(j), {
|
|
531
531
|
modelValue: p.value,
|
|
532
532
|
"onUpdate:modelValue": t[8] || (t[8] = (o) => p.value = o),
|
|
533
533
|
size: "large",
|
|
@@ -541,15 +541,15 @@ const de = {
|
|
|
541
541
|
onInput: t[10] || (t[10] = (o) => X("email")),
|
|
542
542
|
onClick: Ue
|
|
543
543
|
}, null, 8, ["modelValue", "error"]),
|
|
544
|
-
b(
|
|
544
|
+
b(v(Q), { class: "icon-locked" })
|
|
545
545
|
])) : U("", !0),
|
|
546
546
|
k("phone") ? (N(), V("div", Pt, [
|
|
547
|
-
b(
|
|
547
|
+
b(v(j), {
|
|
548
548
|
modelValue: y.value,
|
|
549
549
|
"onUpdate:modelValue": t[11] || (t[11] = (o) => y.value = o),
|
|
550
550
|
size: "large",
|
|
551
551
|
"text-size": "medium",
|
|
552
|
-
label:
|
|
552
|
+
label: h("Номер телефона"),
|
|
553
553
|
type: "tel",
|
|
554
554
|
readonly: "",
|
|
555
555
|
style: { cursor: "pointer" },
|
|
@@ -558,36 +558,36 @@ const de = {
|
|
|
558
558
|
onInput: t[13] || (t[13] = (o) => X("phone")),
|
|
559
559
|
onClick: Ve
|
|
560
560
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
561
|
-
b(
|
|
561
|
+
b(v(Q), { class: "icon-locked" })
|
|
562
562
|
])) : U("", !0),
|
|
563
563
|
oe("div", Nt, [
|
|
564
|
-
x.value ? (N(), M(
|
|
564
|
+
x.value ? (N(), M(v(Ee), {
|
|
565
565
|
key: 0,
|
|
566
566
|
color: "secondary",
|
|
567
567
|
onClick: We
|
|
568
568
|
}, {
|
|
569
569
|
default: O(() => [
|
|
570
|
-
re(G(
|
|
570
|
+
re(G(h("Сменить пароль")), 1)
|
|
571
571
|
]),
|
|
572
572
|
_: 1
|
|
573
573
|
})) : U("", !0),
|
|
574
|
-
b(
|
|
575
|
-
disabled: !
|
|
574
|
+
b(v(Ee), {
|
|
575
|
+
disabled: !ye.value,
|
|
576
576
|
onClick: Je
|
|
577
577
|
}, {
|
|
578
578
|
default: O(() => [
|
|
579
|
-
re(G(
|
|
579
|
+
re(G(h("Сохранить")), 1)
|
|
580
580
|
]),
|
|
581
581
|
_: 1
|
|
582
582
|
}, 8, ["disabled"])
|
|
583
583
|
])
|
|
584
584
|
]),
|
|
585
|
-
|
|
585
|
+
f.value ? (N(), M(we, {
|
|
586
586
|
key: 0,
|
|
587
587
|
to: "body"
|
|
588
588
|
}, [
|
|
589
|
-
|
|
590
|
-
b(
|
|
589
|
+
f.value ? (N(), V("div", Ct, [
|
|
590
|
+
b(v(nt), {
|
|
591
591
|
"circle-mode": !0,
|
|
592
592
|
"model-value": r.imageContent,
|
|
593
593
|
onClose: _e,
|
|
@@ -596,11 +596,11 @@ const de = {
|
|
|
596
596
|
}, null, 8, ["model-value"])
|
|
597
597
|
])) : U("", !0)
|
|
598
598
|
])) : U("", !0),
|
|
599
|
-
(N(), M(
|
|
599
|
+
(N(), M(we, { to: "#toast-root" }, [
|
|
600
600
|
oe("div", kt, [
|
|
601
601
|
b(Ze, { name: "list" }, {
|
|
602
602
|
default: O(() => [
|
|
603
|
-
Qe(b(
|
|
603
|
+
Qe(b(v(ot), {
|
|
604
604
|
class: "toast",
|
|
605
605
|
color: q.value,
|
|
606
606
|
text: J.value,
|
|
@@ -613,13 +613,13 @@ const de = {
|
|
|
613
613
|
})
|
|
614
614
|
])
|
|
615
615
|
])),
|
|
616
|
-
b(
|
|
616
|
+
b(v(Ie))
|
|
617
617
|
], 64));
|
|
618
618
|
}
|
|
619
619
|
}), Be = (l, s) => {
|
|
620
620
|
const a = l.__vccOpts || l;
|
|
621
|
-
for (const [n,
|
|
622
|
-
a[n] =
|
|
621
|
+
for (const [n, g] of s)
|
|
622
|
+
a[n] = g;
|
|
623
623
|
return a;
|
|
624
624
|
}, It = /* @__PURE__ */ Be(Tt, [["__scopeId", "data-v-4e8a6f81"]]), Rt = /* @__PURE__ */ te({
|
|
625
625
|
__name: "index",
|
|
@@ -636,9 +636,9 @@ const de = {
|
|
|
636
636
|
},
|
|
637
637
|
emits: ["on-update-jwt", "update-tokens"],
|
|
638
638
|
setup(l, { emit: s }) {
|
|
639
|
-
const a = s, { openDialog: n } =
|
|
639
|
+
const a = s, { openDialog: n } = pe(), g = (d, u) => {
|
|
640
640
|
n("email", { initialEmail: d, mode: u });
|
|
641
|
-
},
|
|
641
|
+
}, h = (d, u) => {
|
|
642
642
|
n("phone", { initialPhone: d, mode: u });
|
|
643
643
|
}, F = () => {
|
|
644
644
|
n("password");
|
|
@@ -646,7 +646,7 @@ const de = {
|
|
|
646
646
|
a("on-update-jwt", d, u, C);
|
|
647
647
|
};
|
|
648
648
|
return (d, u) => (N(), V(Te, null, [
|
|
649
|
-
b(
|
|
649
|
+
b(v(rt)),
|
|
650
650
|
b(It, {
|
|
651
651
|
"throttler-prefix": d.throttlerPrefix,
|
|
652
652
|
provider: d.provider,
|
|
@@ -657,23 +657,23 @@ const de = {
|
|
|
657
657
|
"refresh-token": d.refreshToken,
|
|
658
658
|
"aws-storage-url": d.awsStorageUrl,
|
|
659
659
|
"disable-add-phone": d.disableAddPhone,
|
|
660
|
-
onOpenEmailDialog:
|
|
661
|
-
onOpenPhoneDialog:
|
|
660
|
+
onOpenEmailDialog: g,
|
|
661
|
+
onOpenPhoneDialog: h,
|
|
662
662
|
onOpenPasswordDialog: F,
|
|
663
663
|
onOnUpdateJwt: m
|
|
664
664
|
}, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token", "aws-storage-url", "disable-add-phone"]),
|
|
665
|
-
b(
|
|
665
|
+
b(v(Ie))
|
|
666
666
|
], 64));
|
|
667
667
|
}
|
|
668
668
|
}), Bt = 10, Dt = 10, Ut = 15;
|
|
669
|
-
function
|
|
669
|
+
function be(l, s, a) {
|
|
670
670
|
let n = l.replace(/[^\d+]/g, "").replace(/(?!^)\+/g, "");
|
|
671
671
|
return a != null && a.startsWith("ru") && n.startsWith("8") ? n = `+7${n.slice(1)}` : s && n && !n.startsWith("+") && (n = `+${n}`), n;
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function Pe(l) {
|
|
674
674
|
return l.startsWith("+") ? l.slice(1).replace(/\D/g, "") : l.replace(/\D/g, "");
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function Ne(l, s = Bt, a = Ut) {
|
|
677
677
|
if (!l.startsWith("+"))
|
|
678
678
|
return !1;
|
|
679
679
|
const n = l.slice(1);
|
|
@@ -684,9 +684,9 @@ function se(l) {
|
|
|
684
684
|
}
|
|
685
685
|
function Vt(l, s) {
|
|
686
686
|
let a = 0, n = !1;
|
|
687
|
-
return l.split("").filter((
|
|
687
|
+
return l.split("").filter((g, h) => g === "+" ? h !== 0 || n ? !1 : (n = !0, !0) : /\d/.test(g) ? (a++, a <= s) : !1).join("");
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function ie(l) {
|
|
690
690
|
return l.startsWith("+") || /^\d/.test(l);
|
|
691
691
|
}
|
|
692
692
|
const At = /^[\w.%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;
|
|
@@ -695,9 +695,9 @@ function Ce(l) {
|
|
|
695
695
|
}
|
|
696
696
|
const De = /^[\d\s()+]+$/;
|
|
697
697
|
function Ft(l, s) {
|
|
698
|
-
var n,
|
|
698
|
+
var n, g;
|
|
699
699
|
const a = l.trim();
|
|
700
|
-
return (n = s.phone) != null && n.enabled && De.test(a) && /\d/.test(a) && !a.includes("@") ? "phone" : (
|
|
700
|
+
return (n = s.phone) != null && n.enabled && De.test(a) && /\d/.test(a) && !a.includes("@") ? "phone" : (g = s.email) != null && g.enabled ? "email" : null;
|
|
701
701
|
}
|
|
702
702
|
const St = { class: "smart-input" }, xt = /* @__PURE__ */ te({
|
|
703
703
|
__name: "index",
|
|
@@ -713,9 +713,9 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ te({
|
|
|
713
713
|
},
|
|
714
714
|
emits: ["update:modelValue", "validity-change", "type-change"],
|
|
715
715
|
setup(l, { emit: s }) {
|
|
716
|
-
const a = l, n = s,
|
|
716
|
+
const a = l, n = s, g = I(() => a.locale ?? "ru"), h = (i) => ce[g.value][i] || i, F = I(() => f.value ? ie(f.value) ? "phone" : r.value : null), m = I(() => a.label ? h(a.label) : h("Email или телефон"));
|
|
717
717
|
function d(i, w) {
|
|
718
|
-
return w ? w in
|
|
718
|
+
return w ? w in ce[g.value] ? h(w) : w : h(i);
|
|
719
719
|
}
|
|
720
720
|
const u = I(() => {
|
|
721
721
|
var i, w, c, A, k, z, S, x, W, R, Y;
|
|
@@ -743,12 +743,12 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ te({
|
|
|
743
743
|
return a.errorMessages.invalidEmail;
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
|
-
const p = E(null), y = E(""),
|
|
746
|
+
const p = E(null), y = E(""), f = E(a.modelValue ?? ""), r = E(null), P = E(null), $ = I(() => P.value ? d(
|
|
747
747
|
P.value,
|
|
748
748
|
C(P.value)
|
|
749
749
|
) : "");
|
|
750
750
|
ke(() => a.modelValue, (i) => {
|
|
751
|
-
i !== void 0 && (
|
|
751
|
+
i !== void 0 && (f.value = i, y.value = i);
|
|
752
752
|
});
|
|
753
753
|
function L(i) {
|
|
754
754
|
P.value = null;
|
|
@@ -758,32 +758,32 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ te({
|
|
|
758
758
|
return;
|
|
759
759
|
}
|
|
760
760
|
const A = u.value.mode === "auto" ? Ft(c, u.value) : u.value.mode;
|
|
761
|
-
if (r.value = A, n("type-change", A), se(c) &&
|
|
762
|
-
|
|
761
|
+
if (r.value = A, n("type-change", A), se(c) && ie(c)) {
|
|
762
|
+
f.value = c, n("update:modelValue", c), P.value = "Допустимы только цифры и знак + в начале", n("validity-change", !1);
|
|
763
763
|
return;
|
|
764
764
|
}
|
|
765
765
|
if (A === "email") {
|
|
766
766
|
const k = Ce(c);
|
|
767
|
-
|
|
767
|
+
f.value = c, y.value = c, n("update:modelValue", c), n("validity-change", k);
|
|
768
768
|
return;
|
|
769
769
|
}
|
|
770
770
|
if (A === "phone") {
|
|
771
|
-
const k =
|
|
771
|
+
const k = be(
|
|
772
772
|
c,
|
|
773
773
|
u.value.phone.autoPlus,
|
|
774
774
|
a.locale
|
|
775
775
|
);
|
|
776
|
-
if (
|
|
776
|
+
if (Pe(k).length > u.value.phone.maxDigits) {
|
|
777
777
|
const x = Vt(c, u.value.phone.maxDigits);
|
|
778
|
-
|
|
778
|
+
f.value = x, n("update:modelValue", x), J(x);
|
|
779
779
|
return;
|
|
780
780
|
}
|
|
781
|
-
if (
|
|
781
|
+
if (f.value = c, se(c)) {
|
|
782
782
|
De.test(c) && (P.value = "Допустимы только цифры и знак + в начале", n("validity-change", !1));
|
|
783
783
|
return;
|
|
784
784
|
}
|
|
785
|
-
|
|
786
|
-
const S =
|
|
785
|
+
f.value = k, n("update:modelValue", k), y.value = k;
|
|
786
|
+
const S = Ne(
|
|
787
787
|
k,
|
|
788
788
|
u.value.phone.minDigits,
|
|
789
789
|
u.value.phone.maxDigits
|
|
@@ -794,12 +794,12 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ te({
|
|
|
794
794
|
function _() {
|
|
795
795
|
if (console.debug("✅[event] onBlur is working"), !!r.value) {
|
|
796
796
|
if (r.value === "phone") {
|
|
797
|
-
const i =
|
|
798
|
-
|
|
797
|
+
const i = be(
|
|
798
|
+
f.value,
|
|
799
799
|
u.value.phone.autoPlus,
|
|
800
800
|
a.locale
|
|
801
|
-
), w =
|
|
802
|
-
if (se(
|
|
801
|
+
), w = Pe(i);
|
|
802
|
+
if (se(f.value) && ie(f.value)) {
|
|
803
803
|
P.value = "Допустимы только цифры и знак + в начале", n("validity-change", !1);
|
|
804
804
|
return;
|
|
805
805
|
}
|
|
@@ -807,7 +807,7 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ te({
|
|
|
807
807
|
P.value = "Это не похоже на номер телефона", n("validity-change", !1);
|
|
808
808
|
return;
|
|
809
809
|
}
|
|
810
|
-
const c =
|
|
810
|
+
const c = Ne(
|
|
811
811
|
i,
|
|
812
812
|
u.value.phone.minDigits,
|
|
813
813
|
u.value.phone.maxDigits
|
|
@@ -815,7 +815,7 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ te({
|
|
|
815
815
|
P.value = c ? null : "Это не похоже на номер телефона", n("validity-change", c);
|
|
816
816
|
}
|
|
817
817
|
if (r.value === "email") {
|
|
818
|
-
const i = Ce(
|
|
818
|
+
const i = Ce(f.value);
|
|
819
819
|
P.value = i ? null : "Это не похоже на email", n("validity-change", i);
|
|
820
820
|
}
|
|
821
821
|
}
|
|
@@ -834,10 +834,10 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ te({
|
|
|
834
834
|
});
|
|
835
835
|
}
|
|
836
836
|
return (i, w) => (N(), V("div", St, [
|
|
837
|
-
b(
|
|
837
|
+
b(v(j), {
|
|
838
838
|
ref_key: "inputRef",
|
|
839
839
|
ref: p,
|
|
840
|
-
"model-value":
|
|
840
|
+
"model-value": f.value,
|
|
841
841
|
readonly: i.disabled,
|
|
842
842
|
error: $.value,
|
|
843
843
|
type: i.type ?? "text",
|
|
@@ -846,17 +846,17 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ te({
|
|
|
846
846
|
onInput: L,
|
|
847
847
|
onBlur: _
|
|
848
848
|
}, null, 8, ["model-value", "readonly", "error", "type", "size", "label"]),
|
|
849
|
-
F.value === "phone" ? (N(), M(
|
|
849
|
+
F.value === "phone" ? (N(), M(v(lt), {
|
|
850
850
|
key: 0,
|
|
851
851
|
class: "smart-input__icon"
|
|
852
852
|
})) : U("", !0),
|
|
853
|
-
F.value === "email" ? (N(), M(
|
|
853
|
+
F.value === "email" ? (N(), M(v(st), {
|
|
854
854
|
key: 1,
|
|
855
855
|
class: "smart-input__icon"
|
|
856
856
|
})) : U("", !0)
|
|
857
857
|
]));
|
|
858
858
|
}
|
|
859
|
-
}), Ot = /* @__PURE__ */ Be(xt, [["__scopeId", "data-v-
|
|
859
|
+
}), Ot = /* @__PURE__ */ Be(xt, [["__scopeId", "data-v-08952041"]]);
|
|
860
860
|
export {
|
|
861
861
|
_t as B,
|
|
862
862
|
Lt as C,
|
|
@@ -864,6 +864,6 @@ export {
|
|
|
864
864
|
Rt as a,
|
|
865
865
|
mt as g,
|
|
866
866
|
Ot as i,
|
|
867
|
-
|
|
868
|
-
|
|
867
|
+
de as p,
|
|
868
|
+
ce as t
|
|
869
869
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".avatar-input[data-v-4e8a6f81] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-4e8a6f81] .p-input-file:hover .overlay{visibility:visible}.smart-input[data-v-
|
|
2
|
-
import { a as o, i as r } from "./index-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".avatar-input[data-v-4e8a6f81] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-4e8a6f81] .p-input-file:hover .overlay{visibility:visible}.smart-input[data-v-08952041]{position:relative;width:100%}.smart-input__icon[data-v-08952041]{position:absolute;top:16px;right:16px;pointer-events:none;opacity:.5}.icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:100%;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;max-width:100%;word-wrap:break-word;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
import { a as o, i as r } from "./index-CmZWZWFm.js";
|
|
3
3
|
export {
|
|
4
4
|
o as PEditUserContact,
|
|
5
5
|
r as PEmailOrPhoneInput
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as n, defineComponent as L, createElementBlock as p, openBlock as v, normalizeClass as c, createVNode as w, unref as _, computed as T, renderSlot as d, createCommentVNode as h, createElementVNode as i, toDisplayString as y, createTextVNode as f } from "vue";
|
|
2
2
|
import { PLoader as $ } from "@profeat/ui-kit";
|
|
3
|
-
import { _ as b, g as C, p as R } from "./index-
|
|
3
|
+
import { _ as b, g as C, p as R } from "./index-CmZWZWFm.js";
|
|
4
4
|
function g(s) {
|
|
5
5
|
const e = Math.floor(s / 60), a = s % 60;
|
|
6
6
|
return `${String(e).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
|