@yourgoods/ui-smart 0.53.9 → 0.53.11
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-B0ASyvCM.js → ProfileEmailDialog-DnKsPdDB.js} +2 -2
- package/dist/{ProfilePasswordDialog-CE7gwOr_.js → ProfilePasswordDialog-C2tTv-7a.js} +1 -1
- package/dist/{ProfilePhoneDialog-DXpYjYST.js → ProfilePhoneDialog-B_Xmv8pU.js} +2 -2
- package/dist/{index-DV7lsQmp.js → index-D8ILKk9J.js} +270 -264
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-Bl7rwiIQ.js → useRateLimitToast-BZGqhNmu.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-BZGqhNmu.js";
|
|
3
|
+
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-D8ILKk9J.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-D8ILKk9J.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-BZGqhNmu.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-D8ILKk9J.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
|
|
1
|
+
import { ref as y, shallowRef as Re, defineComponent as Y, defineAsyncComponent as K, watch as fe, createBlock as $, createCommentVNode as B, unref as p, openBlock as b, resolveDynamicComponent as _e, mergeProps as Oe, computed as V, reactive as Z, onMounted as Ge, createElementBlock as D, Fragment as ge, createVNode as w, createElementVNode as H, withCtx as z, toDisplayString as L, createTextVNode as Q, Teleport as ce, Transition as qe, withDirectives as je, vShow as Je } from "vue";
|
|
2
2
|
import We from "axios";
|
|
3
|
-
import { PInputFileUploader as Ye, PInput as
|
|
4
|
-
function et(l,
|
|
3
|
+
import { PInputFileUploader as Ye, PInput as R, IconFilledEditMd as J, PButton as pe, PImageCropper as Xe, PToast as Ke, PTeleportContainer as ve, PToastContainer as Ze, IconPhoneMd as He, IconMailMd as Qe } from "@profeat/ui-kit";
|
|
4
|
+
function et(l, s = 2) {
|
|
5
5
|
if (l === 0)
|
|
6
6
|
return "0 B";
|
|
7
|
-
const
|
|
8
|
-
return `${Number.parseFloat((l /
|
|
7
|
+
const a = 1024, r = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], m = Math.floor(Math.log(l) / Math.log(a));
|
|
8
|
+
return `${Number.parseFloat((l / a ** m).toFixed(s))} ${r[m]}`;
|
|
9
9
|
}
|
|
10
10
|
const tt = {
|
|
11
11
|
"image/jpeg": "JPEG",
|
|
@@ -16,9 +16,9 @@ const tt = {
|
|
|
16
16
|
// ...
|
|
17
17
|
};
|
|
18
18
|
function at(l) {
|
|
19
|
-
return l.map((
|
|
20
|
-
var
|
|
21
|
-
return tt[
|
|
19
|
+
return l.map((s) => {
|
|
20
|
+
var a;
|
|
21
|
+
return tt[s] || ((a = s.split("/")[1]) == null ? void 0 : a.toUpperCase());
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
const $t = {
|
|
@@ -29,12 +29,12 @@ const $t = {
|
|
|
29
29
|
VERIFY_EMAIL: "verify-email"
|
|
30
30
|
};
|
|
31
31
|
let te = null;
|
|
32
|
-
function ot(l,
|
|
32
|
+
function ot(l, s, a) {
|
|
33
33
|
te = We.create({
|
|
34
|
-
baseURL:
|
|
34
|
+
baseURL: s,
|
|
35
35
|
headers: {
|
|
36
36
|
Authorization: `Bearer ${l}`,
|
|
37
|
-
"x-throttler-prefix":
|
|
37
|
+
"x-throttler-prefix": a ?? "throttler_profile_edit"
|
|
38
38
|
// здесь можно словить баг, который может быть сложно отследить, если будет передаваться пустой прелфикс
|
|
39
39
|
// 'Content-Type': 'application/json',
|
|
40
40
|
},
|
|
@@ -46,28 +46,28 @@ function oe() {
|
|
|
46
46
|
throw new Error("Axios instance not initialized. Call initAxios(token, baseUrl) first.");
|
|
47
47
|
return te;
|
|
48
48
|
}
|
|
49
|
-
async function ae(l,
|
|
50
|
-
return oe().post(l,
|
|
49
|
+
async function ae(l, s, a) {
|
|
50
|
+
return oe().post(l, s, a);
|
|
51
51
|
}
|
|
52
|
-
async function nt(l,
|
|
53
|
-
return oe().get(l,
|
|
52
|
+
async function nt(l, s) {
|
|
53
|
+
return oe().get(l, s);
|
|
54
54
|
}
|
|
55
|
-
async function rt(l,
|
|
56
|
-
return oe().delete(l,
|
|
55
|
+
async function rt(l, s) {
|
|
56
|
+
return oe().delete(l, s);
|
|
57
57
|
}
|
|
58
58
|
async function lt(l) {
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
59
|
+
const s = await ae("/users/profile/me", l);
|
|
60
|
+
if (s.status !== 200 && s.status !== 201 || !s.data)
|
|
61
61
|
throw new Error("Ошибка при получении профиля пользователя");
|
|
62
|
-
return
|
|
62
|
+
return s.data;
|
|
63
63
|
}
|
|
64
|
-
const W =
|
|
64
|
+
const W = y(null), ee = Re(null);
|
|
65
65
|
function ne() {
|
|
66
66
|
return {
|
|
67
67
|
currentDialog: W,
|
|
68
68
|
dialogPayload: ee,
|
|
69
|
-
openDialog: (r,
|
|
70
|
-
W.value = r, ee.value =
|
|
69
|
+
openDialog: (r, m) => {
|
|
70
|
+
W.value = r, ee.value = m ?? null;
|
|
71
71
|
},
|
|
72
72
|
closeDialog: () => {
|
|
73
73
|
W.value = null, ee.value = null;
|
|
@@ -216,42 +216,42 @@ const st = {
|
|
|
216
216
|
disableAddPhone: { type: Boolean }
|
|
217
217
|
},
|
|
218
218
|
emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
|
|
219
|
-
setup(l, { emit:
|
|
220
|
-
const
|
|
221
|
-
email: K(() => import("./ProfileEmailDialog-
|
|
222
|
-
phone: K(() => import("./ProfilePhoneDialog-
|
|
223
|
-
password: K(() => import("./ProfilePasswordDialog-
|
|
224
|
-
},
|
|
225
|
-
|
|
226
|
-
},
|
|
227
|
-
|
|
219
|
+
setup(l, { emit: s }) {
|
|
220
|
+
const a = s, r = y(!0), { currentDialog: m, dialogPayload: g, closeDialog: T } = ne(), u = {
|
|
221
|
+
email: K(() => import("./ProfileEmailDialog-DnKsPdDB.js")),
|
|
222
|
+
phone: K(() => import("./ProfilePhoneDialog-B_Xmv8pU.js")),
|
|
223
|
+
password: K(() => import("./ProfilePasswordDialog-C2tTv-7a.js"))
|
|
224
|
+
}, d = ({ email: E }) => {
|
|
225
|
+
a("update-email-field", E);
|
|
226
|
+
}, c = ({ phone: E }) => {
|
|
227
|
+
a("update-phone-field", E);
|
|
228
228
|
};
|
|
229
|
-
return fe(
|
|
229
|
+
return fe(m, (E) => {
|
|
230
230
|
r.value = !!E;
|
|
231
|
-
}), (E, f) =>
|
|
231
|
+
}), (E, f) => p(m) ? (b(), $(_e(u[p(m)]), Oe({
|
|
232
232
|
key: 0,
|
|
233
233
|
modelValue: r.value,
|
|
234
234
|
"onUpdate:modelValue": f[0] || (f[0] = (v) => r.value = v),
|
|
235
235
|
language: E.language,
|
|
236
236
|
provider: E.provider,
|
|
237
237
|
"disable-add-phone": E.disableAddPhone
|
|
238
|
-
},
|
|
239
|
-
onClose:
|
|
240
|
-
onCleanInputErrors: f[1] || (f[1] = (v) =>
|
|
241
|
-
onOnUpdateJwt: f[2] || (f[2] = (v,
|
|
242
|
-
onSubmitEmail:
|
|
243
|
-
onSubmitPhone:
|
|
244
|
-
onOnPasswordError: f[3] || (f[3] = (v,
|
|
245
|
-
onOnToast: f[4] || (f[4] = (v) =>
|
|
246
|
-
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) :
|
|
238
|
+
}, p(g), {
|
|
239
|
+
onClose: p(T),
|
|
240
|
+
onCleanInputErrors: f[1] || (f[1] = (v) => a("clean-input-errors")),
|
|
241
|
+
onOnUpdateJwt: f[2] || (f[2] = (v, i, o) => a("on-update-jwt", v, i, o)),
|
|
242
|
+
onSubmitEmail: d,
|
|
243
|
+
onSubmitPhone: c,
|
|
244
|
+
onOnPasswordError: f[3] || (f[3] = (v, i) => a("on-password-error", v, i)),
|
|
245
|
+
onOnToast: f[4] || (f[4] = (v) => a("on-toast", v))
|
|
246
|
+
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : B("", !0);
|
|
247
247
|
}
|
|
248
248
|
}), ut = { class: "base-container" }, dt = {
|
|
249
249
|
key: 0,
|
|
250
250
|
style: { color: "#E46060" }
|
|
251
|
-
}, mt = { key: 1 },
|
|
251
|
+
}, mt = { key: 1 }, ct = {
|
|
252
252
|
key: 1,
|
|
253
253
|
class: "input-wrapper"
|
|
254
|
-
},
|
|
254
|
+
}, pt = {
|
|
255
255
|
key: 2,
|
|
256
256
|
class: "input-wrapper"
|
|
257
257
|
}, ft = {
|
|
@@ -277,8 +277,8 @@ const st = {
|
|
|
277
277
|
disableAddPhone: { type: Boolean }
|
|
278
278
|
},
|
|
279
279
|
emits: ["open-email-dialog", "open-phone-dialog", "open-password-dialog", "on-update-jwt", "on-password-error", "update-tokens"],
|
|
280
|
-
setup(l, { emit:
|
|
281
|
-
const
|
|
280
|
+
setup(l, { emit: s }) {
|
|
281
|
+
const a = l, r = s, m = V(() => a.language ?? "ru"), g = (e) => st[m.value][e] || e, { openDialog: T } = ne(), u = Z({ firstName: "", lastName: "" }), d = y({ firstName: "", lastName: "" }), c = Z({ firstName: !1, lastName: !1, email: !1, phone: !1 }), E = y(""), f = y(""), v = y(""), i = y(!1), o = Z({
|
|
282
282
|
value: null,
|
|
283
283
|
loading: !1,
|
|
284
284
|
accept: ["image/png", "image/jpeg"],
|
|
@@ -286,17 +286,17 @@ const st = {
|
|
|
286
286
|
// 10 MB
|
|
287
287
|
imageBinary: null,
|
|
288
288
|
imageContent: ""
|
|
289
|
-
}),
|
|
289
|
+
}), h = y(""), C = y(!1), I = y(!0), A = y(!0), F = y(void 0), P = y(""), x = V(() => le(u.firstName, c.firstName)), S = V(() => le(u.lastName, c.lastName)), _ = V(() => c.email && !f.value.trim() ? "Введите e-mail" : ""), ye = V(() => c.phone && !v.value.trim() ? "Введите номер телефона" : ""), M = (e) => a.fields.some((t) => t.key === e), re = (e) => e && e.trim() ? "edit" : "bind", X = () => setTimeout(() => {
|
|
290
290
|
var e;
|
|
291
291
|
return (e = document.activeElement) == null ? void 0 : e.blur();
|
|
292
|
-
}, 0), we =
|
|
292
|
+
}, 0), we = V(() => !!(f.value && f.value.trim() !== "")), be = V(() => o.imageContent ? g("Загрузить другое фото") : g("Загрузить фото")), le = (e, t) => {
|
|
293
293
|
if (!t) return "";
|
|
294
294
|
const n = e.trim();
|
|
295
295
|
return n ? n.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
|
|
296
|
-
}, Ee = (e) =>
|
|
297
|
-
X(),
|
|
296
|
+
}, Ee = (e) => T("email", { mode: e ? "edit" : "bind", initialEmail: e }), Pe = () => {
|
|
297
|
+
X(), c.email = !1, A.value = !1, r("open-email-dialog", f.value, re(f.value)), Ee(f.value);
|
|
298
298
|
}, Ne = () => {
|
|
299
|
-
X(),
|
|
299
|
+
X(), c.phone = !1, I.value = !1, r("open-phone-dialog", v.value, re(v.value));
|
|
300
300
|
}, Ce = async (e, t, n) => {
|
|
301
301
|
e === "email" && n && (f.value = n), e === "phone" && n && (v.value = n), r("on-update-jwt");
|
|
302
302
|
}, ke = (e) => {
|
|
@@ -304,30 +304,30 @@ const st = {
|
|
|
304
304
|
}, Te = (e) => {
|
|
305
305
|
f.value = e;
|
|
306
306
|
}, Ue = (e, t) => {
|
|
307
|
-
|
|
307
|
+
C.value = !0, r("on-password-error", e, t);
|
|
308
308
|
}, Be = () => {
|
|
309
|
-
|
|
310
|
-
},
|
|
311
|
-
|
|
309
|
+
I.value = !1, A.value = !1;
|
|
310
|
+
}, O = (e) => {
|
|
311
|
+
C.value = !0, F.value = e.color ?? "", P.value = e.text ?? "";
|
|
312
312
|
}, G = (e) => {
|
|
313
|
-
if (
|
|
314
|
-
const t =
|
|
315
|
-
t.length > 40 && (
|
|
313
|
+
if (c[e] = !0, e === "firstName" || e === "lastName") {
|
|
314
|
+
const t = u[e];
|
|
315
|
+
t.length > 40 && (u[e] = t.slice(0, 40));
|
|
316
316
|
}
|
|
317
317
|
}, De = (e) => {
|
|
318
318
|
var q, j;
|
|
319
|
-
if (
|
|
319
|
+
if (h.value = "", !e) {
|
|
320
320
|
se();
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
|
-
const t = ((q = e.fileBinary) == null ? void 0 : q.type) ?? "", n = ((j = e.fileBinary) == null ? void 0 : j.size) ?? 0,
|
|
324
|
-
if (
|
|
325
|
-
|
|
323
|
+
const t = ((q = e.fileBinary) == null ? void 0 : q.type) ?? "", n = ((j = e.fileBinary) == null ? void 0 : j.size) ?? 0, U = !["image/png", "image/jpeg"].includes(t), k = n > o.uploadLimit;
|
|
324
|
+
if (U || k) {
|
|
325
|
+
h.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", se();
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
|
-
|
|
328
|
+
o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "", i.value = !0;
|
|
329
329
|
}, se = () => {
|
|
330
|
-
|
|
330
|
+
o.value = null, o.imageBinary = null, o.imageContent = "", i.value = !1;
|
|
331
331
|
}, Ie = async () => {
|
|
332
332
|
try {
|
|
333
333
|
const t = (await rt("/users/profile/delete/avatar")).data;
|
|
@@ -336,82 +336,82 @@ const st = {
|
|
|
336
336
|
return console.error("Ошибка при удалении аватара:", e), !1;
|
|
337
337
|
}
|
|
338
338
|
}, Ae = () => {
|
|
339
|
-
|
|
339
|
+
h.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", o.value = null, o.imageBinary = null, o.imageContent = "", i.value = !1;
|
|
340
340
|
}, ie = async (e, t, n = "image/png") => {
|
|
341
341
|
if (!e) return null;
|
|
342
|
-
const
|
|
343
|
-
return new File([
|
|
342
|
+
const U = await (await fetch(e)).blob();
|
|
343
|
+
return new File([U], t, { type: n });
|
|
344
344
|
}, Ve = () => {
|
|
345
|
-
|
|
345
|
+
o.value = null, o.imageBinary = null, o.imageContent = "", i.value = !1;
|
|
346
346
|
}, Fe = async (e) => {
|
|
347
|
-
|
|
348
|
-
const t =
|
|
349
|
-
if (
|
|
347
|
+
i.value = !1;
|
|
348
|
+
const t = o.imageContent;
|
|
349
|
+
if (o.imageContent = e, !o.imageBinary) return;
|
|
350
350
|
const n = await ie(
|
|
351
351
|
e,
|
|
352
|
-
|
|
353
|
-
|
|
352
|
+
o.imageBinary.name,
|
|
353
|
+
o.imageBinary.type || "image/png"
|
|
354
354
|
);
|
|
355
355
|
if (!n) {
|
|
356
|
-
|
|
356
|
+
o.imageContent = t;
|
|
357
357
|
return;
|
|
358
358
|
}
|
|
359
359
|
try {
|
|
360
|
-
|
|
360
|
+
o.loading = !0;
|
|
361
361
|
const N = new FormData();
|
|
362
362
|
N.append("file", n), await ae(`/users/profile/avatar/${E.value}`, N, { headers: { "Content-Type": void 0 } });
|
|
363
363
|
} catch (N) {
|
|
364
|
-
console.error(N),
|
|
364
|
+
console.error(N), O({
|
|
365
365
|
color: "error",
|
|
366
366
|
text: g("Не удалось сохранить изменения. Попробуйте позже")
|
|
367
|
-
}),
|
|
367
|
+
}), o.imageContent = t;
|
|
368
368
|
} finally {
|
|
369
|
-
|
|
369
|
+
o.loading = !1;
|
|
370
370
|
}
|
|
371
371
|
}, Se = async (e) => {
|
|
372
|
-
|
|
372
|
+
o.imageContent = e ?? "", o.imageBinary && (o.imageBinary = await ie(
|
|
373
373
|
e ?? "",
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
o.imageBinary.name,
|
|
375
|
+
o.imageBinary.type || "image/png"
|
|
376
376
|
));
|
|
377
|
-
}, ue =
|
|
377
|
+
}, ue = y(!1), de = async (e) => {
|
|
378
378
|
var n, N;
|
|
379
|
-
const t = (n =
|
|
379
|
+
const t = (n = u[e]) == null ? void 0 : n.trim();
|
|
380
380
|
if (t)
|
|
381
381
|
try {
|
|
382
382
|
ue.value = !0;
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
firstName:
|
|
386
|
-
lastName:
|
|
383
|
+
const k = (N = (await ae("/users/profile/update-name", { [e]: t })).data) == null ? void 0 : N.data;
|
|
384
|
+
k != null && k.user && (u.firstName = k.user.firstName ?? u.firstName, u.lastName = k.user.lastName ?? u.lastName, d.value = {
|
|
385
|
+
firstName: u.firstName,
|
|
386
|
+
lastName: u.lastName
|
|
387
387
|
});
|
|
388
|
-
} catch (
|
|
389
|
-
throw
|
|
388
|
+
} catch (U) {
|
|
389
|
+
throw U;
|
|
390
390
|
} finally {
|
|
391
391
|
ue.value = !1;
|
|
392
392
|
}
|
|
393
393
|
}, $e = async () => {
|
|
394
394
|
var e;
|
|
395
|
-
if (!
|
|
395
|
+
if (!a.accessToken)
|
|
396
396
|
throw console.error("Access token не передан в props"), new Error("Access token is required");
|
|
397
397
|
try {
|
|
398
398
|
const n = (e = (await lt({
|
|
399
|
-
accessToken:
|
|
400
|
-
refreshToken:
|
|
399
|
+
accessToken: a.accessToken,
|
|
400
|
+
refreshToken: a.refreshToken ?? "",
|
|
401
401
|
excludeFields: []
|
|
402
402
|
})).data) == null ? void 0 : e.user;
|
|
403
403
|
if (!n)
|
|
404
404
|
throw console.error("Данные пользователя отсутствуют в ответе сервера"), new Error("User data is missing from the response");
|
|
405
405
|
const {
|
|
406
406
|
userId: N,
|
|
407
|
-
privateFirstName:
|
|
408
|
-
privateLastName:
|
|
407
|
+
privateFirstName: U,
|
|
408
|
+
privateLastName: k,
|
|
409
409
|
email: q,
|
|
410
410
|
phoneNumber: j
|
|
411
411
|
} = n;
|
|
412
|
-
E.value = N ?? "",
|
|
413
|
-
firstName:
|
|
414
|
-
lastName:
|
|
412
|
+
E.value = N ?? "", u.firstName = U ?? "", u.lastName = k ?? "", f.value = q ?? "", v.value = j ?? "", o.imageContent = await xe(), d.value = {
|
|
413
|
+
firstName: U ?? "",
|
|
414
|
+
lastName: k ?? ""
|
|
415
415
|
};
|
|
416
416
|
} catch (t) {
|
|
417
417
|
console.error("Критическая ошибка при загрузке профиля:", t);
|
|
@@ -429,22 +429,22 @@ const st = {
|
|
|
429
429
|
if (!e)
|
|
430
430
|
return "";
|
|
431
431
|
try {
|
|
432
|
-
return new URL(e.key,
|
|
432
|
+
return new URL(e.key, a.awsStorageUrl).toString();
|
|
433
433
|
} catch (t) {
|
|
434
434
|
return console.error("Ошибка при составлении URL аватара:", t), "";
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
-
const me =
|
|
438
|
-
if (!
|
|
437
|
+
const me = V(() => {
|
|
438
|
+
if (!d.value.firstName && !d.value.lastName)
|
|
439
439
|
return !1;
|
|
440
|
-
const e =
|
|
441
|
-
return
|
|
440
|
+
const e = u.firstName.trim(), t = u.lastName.trim(), n = d.value.firstName.trim(), N = d.value.lastName.trim(), U = e !== n || t !== N, k = e.length >= 2 && t.length >= 2;
|
|
441
|
+
return U && k;
|
|
442
442
|
}), ze = async () => {
|
|
443
443
|
if (me.value)
|
|
444
444
|
try {
|
|
445
|
-
await Promise.all([de("firstName"), de("lastName")]), r("on-update-jwt"),
|
|
445
|
+
await Promise.all([de("firstName"), de("lastName")]), r("on-update-jwt"), O({ color: "success", text: "Изменения сохранены" });
|
|
446
446
|
} catch (e) {
|
|
447
|
-
console.error(e),
|
|
447
|
+
console.error(e), O({
|
|
448
448
|
color: "error",
|
|
449
449
|
text: g("Не удалось сохранить изменения. Попробуйте позже")
|
|
450
450
|
});
|
|
@@ -453,12 +453,12 @@ const st = {
|
|
|
453
453
|
X(), r("open-password-dialog");
|
|
454
454
|
};
|
|
455
455
|
return Ge(async () => {
|
|
456
|
-
if (!
|
|
457
|
-
if (!
|
|
458
|
-
ot(
|
|
459
|
-
}), (e, t) => (b(),
|
|
460
|
-
|
|
461
|
-
language:
|
|
456
|
+
if (!a.accessToken) throw new Error("Access token не передан в props");
|
|
457
|
+
if (!a.requestUrl) throw new Error("auth-backend url не передан в props");
|
|
458
|
+
ot(a.accessToken, a.requestUrl, a.throttlerPrefix), await $e();
|
|
459
|
+
}), (e, t) => (b(), D(ge, null, [
|
|
460
|
+
w(it, {
|
|
461
|
+
language: m.value,
|
|
462
462
|
provider: e.provider,
|
|
463
463
|
"disable-add-phone": e.disableAddPhone,
|
|
464
464
|
onCleanInputErrors: Be,
|
|
@@ -466,60 +466,60 @@ const st = {
|
|
|
466
466
|
onUpdatePhoneField: ke,
|
|
467
467
|
onUpdateEmailField: Te,
|
|
468
468
|
onOnPasswordError: Ue,
|
|
469
|
-
onOnToast:
|
|
469
|
+
onOnToast: O
|
|
470
470
|
}, null, 8, ["language", "provider", "disable-add-phone"]),
|
|
471
471
|
H("div", ut, [
|
|
472
|
-
|
|
472
|
+
M("avatar") ? (b(), $(p(Ye), {
|
|
473
473
|
key: 0,
|
|
474
|
-
modelValue:
|
|
474
|
+
modelValue: o.value,
|
|
475
475
|
"onUpdate:modelValue": [
|
|
476
|
-
t[0] || (t[0] = (n) =>
|
|
476
|
+
t[0] || (t[0] = (n) => o.value = n),
|
|
477
477
|
t[1] || (t[1] = (n) => De(n))
|
|
478
478
|
],
|
|
479
479
|
type: "img",
|
|
480
480
|
class: "avatar-input",
|
|
481
|
-
src:
|
|
482
|
-
loading:
|
|
481
|
+
src: o.imageContent,
|
|
482
|
+
loading: o.loading,
|
|
483
483
|
label: g("Загрузить фото"),
|
|
484
|
-
"upload-limit":
|
|
484
|
+
"upload-limit": o.uploadLimit,
|
|
485
485
|
accept: "image/jpeg, image/png",
|
|
486
486
|
onDelete: Ie,
|
|
487
487
|
"onChange:error": Ae
|
|
488
488
|
}, {
|
|
489
|
-
afterLoadLabel:
|
|
490
|
-
Q(
|
|
489
|
+
afterLoadLabel: z(() => [
|
|
490
|
+
Q(L(be.value), 1)
|
|
491
491
|
]),
|
|
492
|
-
subtext:
|
|
493
|
-
|
|
492
|
+
subtext: z(() => [
|
|
493
|
+
h.value ? (b(), D("span", dt, L(h.value), 1)) : (b(), D("span", mt, L(`${g("Формат")} ${p(at)(o.accept).join(", ")} ${g("до")} ${p(et)(o.uploadLimit)}`), 1))
|
|
494
494
|
]),
|
|
495
495
|
_: 1
|
|
496
|
-
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) :
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
modelValue:
|
|
500
|
-
"onUpdate:modelValue": t[2] || (t[2] = (n) =>
|
|
496
|
+
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : B("", !0),
|
|
497
|
+
M("firstName") ? (b(), D("div", ct, [
|
|
498
|
+
w(p(R), {
|
|
499
|
+
modelValue: u.firstName,
|
|
500
|
+
"onUpdate:modelValue": t[2] || (t[2] = (n) => u.firstName = n),
|
|
501
501
|
size: "large",
|
|
502
502
|
label: g("Имя"),
|
|
503
|
-
error:
|
|
504
|
-
onBlur: t[3] || (t[3] = (n) =>
|
|
503
|
+
error: x.value,
|
|
504
|
+
onBlur: t[3] || (t[3] = (n) => c.firstName = !0),
|
|
505
505
|
onInput: t[4] || (t[4] = (n) => G("firstName"))
|
|
506
506
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
507
|
-
|
|
508
|
-
])) :
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
modelValue:
|
|
512
|
-
"onUpdate:modelValue": t[5] || (t[5] = (n) =>
|
|
507
|
+
w(p(J), { class: "icon-locked" })
|
|
508
|
+
])) : B("", !0),
|
|
509
|
+
M("lastName") ? (b(), D("div", pt, [
|
|
510
|
+
w(p(R), {
|
|
511
|
+
modelValue: u.lastName,
|
|
512
|
+
"onUpdate:modelValue": t[5] || (t[5] = (n) => u.lastName = n),
|
|
513
513
|
size: "large",
|
|
514
514
|
label: g("Фамилия"),
|
|
515
|
-
error:
|
|
516
|
-
onBlur: t[6] || (t[6] = (n) =>
|
|
515
|
+
error: S.value,
|
|
516
|
+
onBlur: t[6] || (t[6] = (n) => c.lastName = !0),
|
|
517
517
|
onInput: t[7] || (t[7] = (n) => G("lastName"))
|
|
518
518
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
519
|
-
|
|
520
|
-
])) :
|
|
521
|
-
|
|
522
|
-
|
|
519
|
+
w(p(J), { class: "icon-locked" })
|
|
520
|
+
])) : B("", !0),
|
|
521
|
+
M("email") ? (b(), D("div", ft, [
|
|
522
|
+
w(p(R), {
|
|
523
523
|
modelValue: f.value,
|
|
524
524
|
"onUpdate:modelValue": t[8] || (t[8] = (n) => f.value = n),
|
|
525
525
|
size: "large",
|
|
@@ -528,15 +528,15 @@ const st = {
|
|
|
528
528
|
type: "email",
|
|
529
529
|
readonly: "",
|
|
530
530
|
style: { cursor: "pointer" },
|
|
531
|
-
error:
|
|
532
|
-
onBlur: t[9] || (t[9] = (n) =>
|
|
531
|
+
error: _.value && A.value,
|
|
532
|
+
onBlur: t[9] || (t[9] = (n) => c.email = !0),
|
|
533
533
|
onInput: t[10] || (t[10] = (n) => G("email")),
|
|
534
534
|
onClick: Pe
|
|
535
535
|
}, null, 8, ["modelValue", "error"]),
|
|
536
|
-
|
|
537
|
-
])) :
|
|
538
|
-
|
|
539
|
-
|
|
536
|
+
w(p(J), { class: "icon-locked" })
|
|
537
|
+
])) : B("", !0),
|
|
538
|
+
M("phone") ? (b(), D("div", gt, [
|
|
539
|
+
w(p(R), {
|
|
540
540
|
modelValue: v.value,
|
|
541
541
|
"onUpdate:modelValue": t[11] || (t[11] = (n) => v.value = n),
|
|
542
542
|
size: "large",
|
|
@@ -545,74 +545,74 @@ const st = {
|
|
|
545
545
|
type: "tel",
|
|
546
546
|
readonly: "",
|
|
547
547
|
style: { cursor: "pointer" },
|
|
548
|
-
error: ye.value &&
|
|
549
|
-
onBlur: t[12] || (t[12] = (n) =>
|
|
548
|
+
error: ye.value && I.value,
|
|
549
|
+
onBlur: t[12] || (t[12] = (n) => c.phone = !0),
|
|
550
550
|
onInput: t[13] || (t[13] = (n) => G("phone")),
|
|
551
551
|
onClick: Ne
|
|
552
552
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
553
|
-
|
|
554
|
-
])) :
|
|
553
|
+
w(p(J), { class: "icon-locked" })
|
|
554
|
+
])) : B("", !0),
|
|
555
555
|
H("div", vt, [
|
|
556
|
-
we.value ? (b(),
|
|
556
|
+
we.value ? (b(), $(p(pe), {
|
|
557
557
|
key: 0,
|
|
558
558
|
color: "secondary",
|
|
559
559
|
onClick: Le
|
|
560
560
|
}, {
|
|
561
|
-
default:
|
|
562
|
-
Q(
|
|
561
|
+
default: z(() => [
|
|
562
|
+
Q(L(g("Сменить пароль")), 1)
|
|
563
563
|
]),
|
|
564
564
|
_: 1
|
|
565
|
-
})) :
|
|
566
|
-
|
|
565
|
+
})) : B("", !0),
|
|
566
|
+
w(p(pe), {
|
|
567
567
|
disabled: !me.value,
|
|
568
568
|
onClick: ze
|
|
569
569
|
}, {
|
|
570
|
-
default:
|
|
571
|
-
Q(
|
|
570
|
+
default: z(() => [
|
|
571
|
+
Q(L(g("Сохранить")), 1)
|
|
572
572
|
]),
|
|
573
573
|
_: 1
|
|
574
574
|
}, 8, ["disabled"])
|
|
575
575
|
])
|
|
576
576
|
]),
|
|
577
|
-
|
|
577
|
+
i.value ? (b(), $(ce, {
|
|
578
578
|
key: 0,
|
|
579
579
|
to: "body"
|
|
580
580
|
}, [
|
|
581
|
-
|
|
582
|
-
|
|
581
|
+
i.value ? (b(), D("div", ht, [
|
|
582
|
+
w(p(Xe), {
|
|
583
583
|
"circle-mode": !0,
|
|
584
|
-
"model-value":
|
|
584
|
+
"model-value": o.imageContent,
|
|
585
585
|
onClose: Ve,
|
|
586
586
|
onSave: t[14] || (t[14] = (n) => Fe(n)),
|
|
587
587
|
"onUpdate:modelValue": t[15] || (t[15] = (n) => Se(n))
|
|
588
588
|
}, null, 8, ["model-value"])
|
|
589
|
-
])) :
|
|
590
|
-
])) :
|
|
591
|
-
(b(),
|
|
589
|
+
])) : B("", !0)
|
|
590
|
+
])) : B("", !0),
|
|
591
|
+
(b(), $(ce, { to: "#toast-root" }, [
|
|
592
592
|
H("div", yt, [
|
|
593
|
-
|
|
594
|
-
default:
|
|
595
|
-
je(
|
|
593
|
+
w(qe, { name: "list" }, {
|
|
594
|
+
default: z(() => [
|
|
595
|
+
je(w(p(Ke), {
|
|
596
596
|
class: "toast",
|
|
597
597
|
color: F.value,
|
|
598
|
-
text:
|
|
599
|
-
onClose: t[16] || (t[16] = (n) =>
|
|
598
|
+
text: P.value,
|
|
599
|
+
onClose: t[16] || (t[16] = (n) => C.value = !1)
|
|
600
600
|
}, null, 8, ["color", "text"]), [
|
|
601
|
-
[Je,
|
|
601
|
+
[Je, C.value]
|
|
602
602
|
])
|
|
603
603
|
]),
|
|
604
604
|
_: 1
|
|
605
605
|
})
|
|
606
606
|
])
|
|
607
607
|
])),
|
|
608
|
-
|
|
608
|
+
w(p(ve))
|
|
609
609
|
], 64));
|
|
610
610
|
}
|
|
611
|
-
}), he = (l,
|
|
612
|
-
const
|
|
613
|
-
for (const [r,
|
|
614
|
-
|
|
615
|
-
return
|
|
611
|
+
}), he = (l, s) => {
|
|
612
|
+
const a = l.__vccOpts || l;
|
|
613
|
+
for (const [r, m] of s)
|
|
614
|
+
a[r] = m;
|
|
615
|
+
return a;
|
|
616
616
|
}, bt = /* @__PURE__ */ he(wt, [["__scopeId", "data-v-a56fcdbb"]]), Mt = /* @__PURE__ */ Y({
|
|
617
617
|
__name: "index",
|
|
618
618
|
props: {
|
|
@@ -627,49 +627,49 @@ const st = {
|
|
|
627
627
|
disableAddPhone: { type: Boolean }
|
|
628
628
|
},
|
|
629
629
|
emits: ["on-update-jwt", "update-tokens"],
|
|
630
|
-
setup(l, { emit:
|
|
631
|
-
const
|
|
632
|
-
r("email", { initialEmail:
|
|
633
|
-
}, g = (
|
|
634
|
-
r("phone", { initialPhone:
|
|
635
|
-
},
|
|
630
|
+
setup(l, { emit: s }) {
|
|
631
|
+
const a = s, { openDialog: r } = ne(), m = (d, c) => {
|
|
632
|
+
r("email", { initialEmail: d, mode: c });
|
|
633
|
+
}, g = (d, c) => {
|
|
634
|
+
r("phone", { initialPhone: d, mode: c });
|
|
635
|
+
}, T = () => {
|
|
636
636
|
r("password");
|
|
637
|
-
},
|
|
638
|
-
|
|
637
|
+
}, u = (d, c, E) => {
|
|
638
|
+
a("on-update-jwt", d, c, E);
|
|
639
639
|
};
|
|
640
|
-
return (
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
"throttler-prefix":
|
|
644
|
-
provider:
|
|
645
|
-
"request-url":
|
|
646
|
-
language:
|
|
647
|
-
fields:
|
|
648
|
-
"access-token":
|
|
649
|
-
"refresh-token":
|
|
650
|
-
"aws-storage-url":
|
|
651
|
-
"disable-add-phone":
|
|
652
|
-
onOpenEmailDialog:
|
|
640
|
+
return (d, c) => (b(), D(ge, null, [
|
|
641
|
+
w(p(Ze)),
|
|
642
|
+
w(bt, {
|
|
643
|
+
"throttler-prefix": d.throttlerPrefix,
|
|
644
|
+
provider: d.provider,
|
|
645
|
+
"request-url": d.requestUrl,
|
|
646
|
+
language: d.language,
|
|
647
|
+
fields: d.fields,
|
|
648
|
+
"access-token": d.accessToken,
|
|
649
|
+
"refresh-token": d.refreshToken,
|
|
650
|
+
"aws-storage-url": d.awsStorageUrl,
|
|
651
|
+
"disable-add-phone": d.disableAddPhone,
|
|
652
|
+
onOpenEmailDialog: m,
|
|
653
653
|
onOpenPhoneDialog: g,
|
|
654
|
-
onOpenPasswordDialog:
|
|
655
|
-
onOnUpdateJwt:
|
|
654
|
+
onOpenPasswordDialog: T,
|
|
655
|
+
onOnUpdateJwt: u
|
|
656
656
|
}, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token", "aws-storage-url", "disable-add-phone"]),
|
|
657
|
-
|
|
657
|
+
w(p(ve))
|
|
658
658
|
], 64));
|
|
659
659
|
}
|
|
660
660
|
}), Et = 10, Pt = 15;
|
|
661
|
-
function Nt(l,
|
|
661
|
+
function Nt(l, s, a) {
|
|
662
662
|
let r = l.replace(/[^\d+]/g, "");
|
|
663
|
-
return
|
|
663
|
+
return a != null && a.startsWith("ru") && r.startsWith("8") ? r = `+7${r.slice(1)}` : s && r && !r.startsWith("+") && (r = `+${r}`), r;
|
|
664
664
|
}
|
|
665
665
|
function Ct(l) {
|
|
666
666
|
return l.startsWith("+") ? l.slice(1).replace(/\D/g, "") : l.replace(/\D/g, "");
|
|
667
667
|
}
|
|
668
|
-
function kt(l,
|
|
668
|
+
function kt(l, s = Et, a = Pt) {
|
|
669
669
|
if (!l.startsWith("+"))
|
|
670
670
|
return !1;
|
|
671
671
|
const r = l.slice(1);
|
|
672
|
-
return !(!/^\d+$/.test(r) || r.length <
|
|
672
|
+
return !(!/^\d+$/.test(r) || r.length < s || r.length > a);
|
|
673
673
|
}
|
|
674
674
|
function Tt(l) {
|
|
675
675
|
return /[^\d+]/.test(l);
|
|
@@ -678,10 +678,10 @@ const Ut = /^[\w.%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;
|
|
|
678
678
|
function Bt(l) {
|
|
679
679
|
return Ut.test(l);
|
|
680
680
|
}
|
|
681
|
-
function Dt(l,
|
|
682
|
-
var r,
|
|
683
|
-
const
|
|
684
|
-
return (r =
|
|
681
|
+
function Dt(l, s) {
|
|
682
|
+
var r, m;
|
|
683
|
+
const a = l.trim();
|
|
684
|
+
return (r = s.phone) != null && r.enabled && (a.startsWith("+") || /^\d+$/.test(a)) ? "phone" : (m = s.email) != null && m.enabled ? "email" : null;
|
|
685
685
|
}
|
|
686
686
|
const It = { class: "smart-input" }, At = /* @__PURE__ */ Y({
|
|
687
687
|
__name: "index",
|
|
@@ -696,86 +696,92 @@ const It = { class: "smart-input" }, At = /* @__PURE__ */ Y({
|
|
|
696
696
|
errorMessages: {}
|
|
697
697
|
},
|
|
698
698
|
emits: ["update:modelValue", "validity-change", "type-change"],
|
|
699
|
-
setup(l, { emit:
|
|
700
|
-
const
|
|
701
|
-
var
|
|
699
|
+
setup(l, { emit: s }) {
|
|
700
|
+
const a = l, r = s, m = V(() => {
|
|
701
|
+
var i, o, h, C, I, A, F, P, x, S, _;
|
|
702
702
|
return {
|
|
703
|
-
mode: ((
|
|
703
|
+
mode: ((i = a.config) == null ? void 0 : i.mode) ?? "auto",
|
|
704
704
|
phone: {
|
|
705
|
-
enabled: ((
|
|
706
|
-
minDigits: ((
|
|
707
|
-
maxDigits: ((F = (
|
|
708
|
-
autoPlus: ((
|
|
705
|
+
enabled: ((h = (o = a.config) == null ? void 0 : o.phone) == null ? void 0 : h.enabled) ?? !0,
|
|
706
|
+
minDigits: ((I = (C = a.config) == null ? void 0 : C.phone) == null ? void 0 : I.minDigits) ?? 10,
|
|
707
|
+
maxDigits: ((F = (A = a.config) == null ? void 0 : A.phone) == null ? void 0 : F.maxDigits) ?? 15,
|
|
708
|
+
autoPlus: ((x = (P = a.config) == null ? void 0 : P.phone) == null ? void 0 : x.autoPlus) ?? !0
|
|
709
709
|
},
|
|
710
710
|
email: {
|
|
711
|
-
enabled: ((
|
|
711
|
+
enabled: ((_ = (S = a.config) == null ? void 0 : S.email) == null ? void 0 : _.enabled) ?? !0
|
|
712
712
|
}
|
|
713
713
|
};
|
|
714
|
-
}), g =
|
|
715
|
-
fe(() =>
|
|
716
|
-
|
|
714
|
+
}), g = y(null), T = y(""), u = y(a.modelValue ?? ""), d = y(null), c = y("");
|
|
715
|
+
fe(() => a.modelValue, (i) => {
|
|
716
|
+
i !== void 0 && (u.value = i, T.value = i);
|
|
717
717
|
});
|
|
718
|
-
function E(
|
|
719
|
-
var
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
718
|
+
function E(i) {
|
|
719
|
+
var I, A, F;
|
|
720
|
+
const h = i.target.value, C = m.value.mode === "auto" ? Dt(h, m.value) : m.value.mode;
|
|
721
|
+
if (d.value = C, r("type-change", C), C === "email") {
|
|
722
|
+
const P = Bt(h);
|
|
723
|
+
c.value = P ? "" : ((I = a.errorMessages) == null ? void 0 : I.invalidEmail) ?? "Это не похоже на email", T.value = h, u.value = h, r("update:modelValue", h), r("validity-change", P);
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
if (C === "phone") {
|
|
727
|
+
if (Tt(h)) {
|
|
728
|
+
c.value = ((A = a.errorMessages) == null ? void 0 : A.invalidPhoneChars) ?? "Допустимы только цифры и знак +", v(T.value), r("validity-change", !1);
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
const P = Nt(
|
|
732
|
+
h,
|
|
733
|
+
m.value.phone.autoPlus,
|
|
734
|
+
a.locale
|
|
729
735
|
);
|
|
730
|
-
if (Ct(
|
|
731
|
-
v(
|
|
736
|
+
if (Ct(P).length > m.value.phone.maxDigits) {
|
|
737
|
+
v(T.value), r("validity-change", !1);
|
|
732
738
|
return;
|
|
733
739
|
}
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
)
|
|
740
|
+
const S = kt(
|
|
741
|
+
P,
|
|
742
|
+
m.value.phone.minDigits,
|
|
743
|
+
m.value.phone.maxDigits
|
|
744
|
+
);
|
|
745
|
+
c.value = S ? "" : ((F = a.errorMessages) == null ? void 0 : F.invalidPhoneLength) ?? "Это не похоже на номер телефона", T.value = P, u.value = P, r("update:modelValue", P), r("validity-change", S);
|
|
746
|
+
return;
|
|
739
747
|
}
|
|
740
|
-
a === "email" && (P = Bt(s), P || (m.value = ((F = o.errorMessages) == null ? void 0 : F.invalidEmail) ?? "Это не похоже на email"), r("validity-change", P)), d.value = w, r("update:modelValue", w);
|
|
741
748
|
}
|
|
742
749
|
function f() {
|
|
743
|
-
var
|
|
744
|
-
const
|
|
745
|
-
return
|
|
750
|
+
var o;
|
|
751
|
+
const i = (o = g.value) == null ? void 0 : o.$el;
|
|
752
|
+
return i ? i.querySelector("input") : null;
|
|
746
753
|
}
|
|
747
|
-
function v(
|
|
748
|
-
const
|
|
749
|
-
if (!
|
|
750
|
-
const
|
|
751
|
-
|
|
752
|
-
|
|
754
|
+
function v(i) {
|
|
755
|
+
const o = f();
|
|
756
|
+
if (!o) return;
|
|
757
|
+
const h = o.selectionStart ?? i.length;
|
|
758
|
+
o.value = i, requestAnimationFrame(() => {
|
|
759
|
+
o.setSelectionRange(h - 1, h - 1);
|
|
753
760
|
});
|
|
754
761
|
}
|
|
755
|
-
return (
|
|
756
|
-
|
|
762
|
+
return (i, o) => (b(), D("div", It, [
|
|
763
|
+
w(p(R), {
|
|
757
764
|
ref_key: "inputRef",
|
|
758
765
|
ref: g,
|
|
759
|
-
"model-value":
|
|
760
|
-
readonly:
|
|
761
|
-
error:
|
|
762
|
-
type:
|
|
763
|
-
size:
|
|
764
|
-
label:
|
|
765
|
-
|
|
766
|
-
"onUpdate:modelValue": E
|
|
766
|
+
"model-value": u.value,
|
|
767
|
+
readonly: i.disabled,
|
|
768
|
+
error: c.value,
|
|
769
|
+
type: i.type ?? "text",
|
|
770
|
+
size: i.size ?? "large",
|
|
771
|
+
label: i.label ?? "Email или телефон",
|
|
772
|
+
onInput: E
|
|
767
773
|
}, null, 8, ["model-value", "readonly", "error", "type", "size", "label"]),
|
|
768
|
-
|
|
774
|
+
d.value === "phone" ? (b(), $(p(He), {
|
|
769
775
|
key: 0,
|
|
770
776
|
class: "smart-input__icon"
|
|
771
|
-
})) :
|
|
772
|
-
|
|
777
|
+
})) : B("", !0),
|
|
778
|
+
d.value === "email" ? (b(), $(p(Qe), {
|
|
773
779
|
key: 1,
|
|
774
780
|
class: "smart-input__icon"
|
|
775
|
-
})) :
|
|
781
|
+
})) : B("", !0)
|
|
776
782
|
]));
|
|
777
783
|
}
|
|
778
|
-
}), zt = /* @__PURE__ */ he(At, [["__scopeId", "data-v-
|
|
784
|
+
}), zt = /* @__PURE__ */ he(At, [["__scopeId", "data-v-103cdf1d"]]);
|
|
779
785
|
export {
|
|
780
786
|
xt as B,
|
|
781
787
|
$t as C,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
import { a as o, i as r } from "./index-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".avatar-input[data-v-a56fcdbb] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-a56fcdbb] .p-input-file:hover .overlay{visibility:visible}.smart-input[data-v-103cdf1d]{position:relative;width:100%}.smart-input__icon[data-v-103cdf1d]{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(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { a as o, i as r } from "./index-D8ILKk9J.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-D8ILKk9J.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")}`;
|