@yourgoods/ui-smart 0.53.43 → 0.53.45
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-BFI9bYi5.js → ProfileEmailDialog-1PdklFjX.js} +2 -2
- package/dist/{ProfilePasswordDialog-DyoUrSvm.js → ProfilePasswordDialog-Cf5_HAyj.js} +1 -1
- package/dist/{ProfilePhoneDialog-qirTfASr.js → ProfilePhoneDialog-B6_z4IOU.js} +2 -2
- package/dist/{index-CmZWZWFm.js → index-JgKD-0yi.js} +285 -281
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-C-VKytVF.js → useRateLimitToast-CfKIVWV2.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-CfKIVWV2.js";
|
|
3
|
+
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-JgKD-0yi.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-JgKD-0yi.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-CfKIVWV2.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-JgKD-0yi.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
|
|
1
|
+
import { ref as E, shallowRef as Ye, defineComponent as te, defineAsyncComponent as ne, watch as Te, createBlock as $, createCommentVNode as V, unref as p, openBlock as P, resolveDynamicComponent as Ke, mergeProps as Xe, computed as k, reactive as oe, onMounted as He, createElementBlock as F, Fragment as Ie, createVNode as b, createElementVNode as re, withCtx as O, toDisplayString as G, createTextVNode as le, 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 Ee, PImageCropper as nt, PToast as ot, PTeleportContainer as
|
|
3
|
+
import { PInputFileUploader as at, PInput as j, IconFilledEditMd as Q, PButton as Ee, PImageCropper as nt, PToast as ot, PTeleportContainer as Be, 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"], f = Math.floor(Math.log(l) / Math.log(a));
|
|
8
|
+
return `${Number.parseFloat((l / a ** f).toFixed(s))} ${n[f]}`;
|
|
9
9
|
}
|
|
10
10
|
const ut = {
|
|
11
11
|
"image/jpeg": "JPEG",
|
|
@@ -61,16 +61,16 @@ async function ft(l) {
|
|
|
61
61
|
throw new Error("Ошибка при получении профиля пользователя");
|
|
62
62
|
return s.data;
|
|
63
63
|
}
|
|
64
|
-
const ee = E(null),
|
|
64
|
+
const ee = E(null), se = Ye(null);
|
|
65
65
|
function pe() {
|
|
66
66
|
return {
|
|
67
67
|
currentDialog: ee,
|
|
68
|
-
dialogPayload:
|
|
69
|
-
openDialog: (n,
|
|
70
|
-
ee.value = n,
|
|
68
|
+
dialogPayload: se,
|
|
69
|
+
openDialog: (n, f) => {
|
|
70
|
+
ee.value = n, se.value = f ?? null;
|
|
71
71
|
},
|
|
72
72
|
closeDialog: () => {
|
|
73
|
-
ee.value = null,
|
|
73
|
+
ee.value = null, se.value = null;
|
|
74
74
|
},
|
|
75
75
|
isDialogOpen: (n) => ee.value === n
|
|
76
76
|
};
|
|
@@ -225,33 +225,33 @@ const ce = {
|
|
|
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:
|
|
230
|
-
phone:
|
|
231
|
-
password:
|
|
232
|
-
}, d = ({ email:
|
|
233
|
-
a("update-email-field",
|
|
234
|
-
},
|
|
235
|
-
a("update-phone-field",
|
|
228
|
+
const a = s, n = E(!0), { currentDialog: f, dialogPayload: v, closeDialog: A } = pe(), u = {
|
|
229
|
+
email: ne(() => import("./ProfileEmailDialog-1PdklFjX.js")),
|
|
230
|
+
phone: ne(() => import("./ProfilePhoneDialog-B6_z4IOU.js")),
|
|
231
|
+
password: ne(() => import("./ProfilePasswordDialog-Cf5_HAyj.js"))
|
|
232
|
+
}, d = ({ email: c }) => {
|
|
233
|
+
a("update-email-field", c);
|
|
234
|
+
}, h = ({ phone: c }) => {
|
|
235
|
+
a("update-phone-field", c);
|
|
236
236
|
};
|
|
237
|
-
return
|
|
238
|
-
n.value = !!
|
|
239
|
-
}), (
|
|
237
|
+
return Te(f, (c) => {
|
|
238
|
+
n.value = !!c;
|
|
239
|
+
}), (c, g) => p(f) ? (P(), $(Ke(u[p(f)]), Xe({
|
|
240
240
|
key: 0,
|
|
241
241
|
modelValue: n.value,
|
|
242
|
-
"onUpdate:modelValue":
|
|
243
|
-
language:
|
|
244
|
-
provider:
|
|
245
|
-
"disable-add-phone":
|
|
246
|
-
}, v
|
|
247
|
-
onClose:
|
|
248
|
-
onCleanInputErrors:
|
|
249
|
-
onOnUpdateJwt:
|
|
242
|
+
"onUpdate:modelValue": g[0] || (g[0] = (y) => n.value = y),
|
|
243
|
+
language: c.language,
|
|
244
|
+
provider: c.provider,
|
|
245
|
+
"disable-add-phone": c.disableAddPhone
|
|
246
|
+
}, p(v), {
|
|
247
|
+
onClose: p(A),
|
|
248
|
+
onCleanInputErrors: g[1] || (g[1] = (y) => a("clean-input-errors")),
|
|
249
|
+
onOnUpdateJwt: g[2] || (g[2] = (y, C, o) => a("on-update-jwt", y, C, o)),
|
|
250
250
|
onSubmitEmail: d,
|
|
251
|
-
onSubmitPhone:
|
|
252
|
-
onOnPasswordError:
|
|
253
|
-
onOnToast:
|
|
254
|
-
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) :
|
|
251
|
+
onSubmitPhone: h,
|
|
252
|
+
onOnPasswordError: g[3] || (g[3] = (y, C) => a("on-password-error", y, C)),
|
|
253
|
+
onOnToast: g[4] || (g[4] = (y) => a("on-toast", y))
|
|
254
|
+
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : V("", !0);
|
|
255
255
|
}
|
|
256
256
|
}), gt = { class: "base-container" }, ht = {
|
|
257
257
|
key: 0,
|
|
@@ -286,7 +286,7 @@ const ce = {
|
|
|
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, f = k(() => a.language ?? "ru"), v = (e) => ce[f.value][e] || e, { openDialog: A } = pe(), u = oe({ firstName: "", lastName: "" }), d = E({ firstName: "", lastName: "" }), h = oe({ firstName: !1, lastName: !1, email: !1, phone: !1 }), c = E(""), g = E(""), y = E(""), C = E(!1), o = oe({
|
|
290
290
|
value: null,
|
|
291
291
|
loading: !1,
|
|
292
292
|
accept: ["image/png", "image/jpeg"],
|
|
@@ -294,48 +294,48 @@ const ce = {
|
|
|
294
294
|
// 10 MB
|
|
295
295
|
imageBinary: null,
|
|
296
296
|
imageContent: ""
|
|
297
|
-
}),
|
|
297
|
+
}), S = E(""), N = E(!1), L = E(!0), _ = E(!0), q = E(void 0), J = E(""), ae = k(() => R(u.firstName, h.firstName)), i = k(() => R(u.lastName, h.lastName)), w = k(() => h.email && !g.value.trim() ? "Введите e-mail" : ""), m = k(() => h.phone && !y.value.trim() ? "Введите номер телефона" : ""), T = (e) => a.fields.some((t) => t.key === e), I = (e) => e && e.trim() ? "edit" : "bind", M = () => setTimeout(() => {
|
|
298
298
|
var e;
|
|
299
299
|
return (e = document.activeElement) == null ? void 0 : e.blur();
|
|
300
|
-
}, 0),
|
|
300
|
+
}, 0), z = k(() => !!(g.value && g.value.trim() !== "")), x = k(() => o.imageContent ? v("Загрузить другое фото") : v("Загрузить фото")), R = (e, t) => {
|
|
301
301
|
if (!t) return "";
|
|
302
|
-
const
|
|
303
|
-
return
|
|
304
|
-
},
|
|
305
|
-
|
|
302
|
+
const r = e.trim();
|
|
303
|
+
return r ? r.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
|
|
304
|
+
}, W = (e) => A("email", { mode: e ? "edit" : "bind", initialEmail: e }), Y = () => {
|
|
305
|
+
M(), h.email = !1, _.value = !1, n("open-email-dialog", g.value, I(g.value)), W(g.value);
|
|
306
306
|
}, Ve = () => {
|
|
307
|
-
|
|
308
|
-
}, Ae = async (e, t,
|
|
309
|
-
e === "email" &&
|
|
307
|
+
M(), h.phone = !1, L.value = !1, n("open-phone-dialog", y.value, I(y.value));
|
|
308
|
+
}, Ae = async (e, t, r) => {
|
|
309
|
+
e === "email" && r && (g.value = r), e === "phone" && r && (y.value = r), n("on-update-jwt");
|
|
310
310
|
}, Fe = (e) => {
|
|
311
311
|
y.value = e;
|
|
312
312
|
}, Se = (e) => {
|
|
313
|
-
|
|
313
|
+
g.value = e;
|
|
314
314
|
}, xe = (e, t) => {
|
|
315
|
-
|
|
315
|
+
N.value = !0, n("on-password-error", e, t);
|
|
316
316
|
}, Me = () => {
|
|
317
317
|
L.value = !1, _.value = !1;
|
|
318
318
|
}, K = (e) => {
|
|
319
|
-
|
|
319
|
+
N.value = !0, q.value = e.color ?? "", J.value = e.text ?? "";
|
|
320
320
|
}, X = (e) => {
|
|
321
|
-
if (
|
|
322
|
-
const t =
|
|
323
|
-
t.length > 40 && (
|
|
321
|
+
if (h[e] = !0, e === "firstName" || e === "lastName") {
|
|
322
|
+
const t = u[e];
|
|
323
|
+
t.length > 40 && (u[e] = t.slice(0, 40));
|
|
324
324
|
}
|
|
325
325
|
}, $e = (e) => {
|
|
326
326
|
var H, Z;
|
|
327
|
-
if (
|
|
327
|
+
if (S.value = "", !e) {
|
|
328
328
|
fe();
|
|
329
329
|
return;
|
|
330
330
|
}
|
|
331
|
-
const t = ((H = e.fileBinary) == null ? void 0 : H.type) ?? "",
|
|
332
|
-
if (
|
|
333
|
-
|
|
331
|
+
const t = ((H = e.fileBinary) == null ? void 0 : H.type) ?? "", r = ((Z = e.fileBinary) == null ? void 0 : Z.size) ?? 0, U = !["image/png", "image/jpeg"].includes(t), D = r > o.uploadLimit;
|
|
332
|
+
if (U || D) {
|
|
333
|
+
S.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", fe();
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
|
-
|
|
336
|
+
o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "", C.value = !0;
|
|
337
337
|
}, fe = () => {
|
|
338
|
-
|
|
338
|
+
o.value = null, o.imageBinary = null, o.imageContent = "", C.value = !1;
|
|
339
339
|
}, ze = async () => {
|
|
340
340
|
try {
|
|
341
341
|
const t = (await pt("/users/profile/delete/avatar")).data;
|
|
@@ -344,57 +344,57 @@ const ce = {
|
|
|
344
344
|
return console.error("Ошибка при удалении аватара:", e), !1;
|
|
345
345
|
}
|
|
346
346
|
}, Le = () => {
|
|
347
|
-
|
|
348
|
-
}, ve = async (e, t,
|
|
347
|
+
S.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", o.value = null, o.imageBinary = null, o.imageContent = "", C.value = !1;
|
|
348
|
+
}, ve = async (e, t, r = "image/png") => {
|
|
349
349
|
if (!e) return null;
|
|
350
|
-
const
|
|
351
|
-
return new File([
|
|
350
|
+
const U = await (await fetch(e)).blob();
|
|
351
|
+
return new File([U], t, { type: r });
|
|
352
352
|
}, _e = () => {
|
|
353
|
-
|
|
353
|
+
o.value = null, o.imageBinary = null, o.imageContent = "", C.value = !1;
|
|
354
354
|
}, Re = async (e) => {
|
|
355
|
-
|
|
356
|
-
const t =
|
|
357
|
-
if (
|
|
358
|
-
const
|
|
355
|
+
C.value = !1;
|
|
356
|
+
const t = o.imageContent;
|
|
357
|
+
if (o.imageContent = e, !o.imageBinary) return;
|
|
358
|
+
const r = await ve(
|
|
359
359
|
e,
|
|
360
|
-
|
|
361
|
-
|
|
360
|
+
o.imageBinary.name,
|
|
361
|
+
o.imageBinary.type || "image/png"
|
|
362
362
|
);
|
|
363
|
-
if (!
|
|
364
|
-
|
|
363
|
+
if (!r) {
|
|
364
|
+
o.imageContent = t;
|
|
365
365
|
return;
|
|
366
366
|
}
|
|
367
367
|
try {
|
|
368
|
-
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
} catch (
|
|
372
|
-
console.error(
|
|
368
|
+
o.loading = !0;
|
|
369
|
+
const B = new FormData();
|
|
370
|
+
B.append("file", r), await de(`/users/profile/avatar/${c.value}`, B, { headers: { "Content-Type": void 0 } });
|
|
371
|
+
} catch (B) {
|
|
372
|
+
console.error(B), K({
|
|
373
373
|
color: "error",
|
|
374
|
-
text:
|
|
375
|
-
}),
|
|
374
|
+
text: v("Не удалось сохранить изменения. Попробуйте позже")
|
|
375
|
+
}), o.imageContent = t;
|
|
376
376
|
} finally {
|
|
377
|
-
|
|
377
|
+
o.loading = !1;
|
|
378
378
|
}
|
|
379
379
|
}, Oe = async (e) => {
|
|
380
|
-
|
|
380
|
+
o.imageContent = e ?? "", o.imageBinary && (o.imageBinary = await ve(
|
|
381
381
|
e ?? "",
|
|
382
|
-
|
|
383
|
-
|
|
382
|
+
o.imageBinary.name,
|
|
383
|
+
o.imageBinary.type || "image/png"
|
|
384
384
|
));
|
|
385
385
|
}, ge = E(!1), he = async (e) => {
|
|
386
|
-
var
|
|
387
|
-
const t = (
|
|
386
|
+
var r, B;
|
|
387
|
+
const t = (r = u[e]) == null ? void 0 : r.trim();
|
|
388
388
|
if (t)
|
|
389
389
|
try {
|
|
390
390
|
ge.value = !0;
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
firstName:
|
|
394
|
-
lastName:
|
|
391
|
+
const D = (B = (await de("/users/profile/update-name", { [e]: t })).data) == null ? void 0 : B.data;
|
|
392
|
+
D != null && D.user && (u.firstName = D.user.firstName ?? u.firstName, u.lastName = D.user.lastName ?? u.lastName, d.value = {
|
|
393
|
+
firstName: u.firstName,
|
|
394
|
+
lastName: u.lastName
|
|
395
395
|
});
|
|
396
|
-
} catch (
|
|
397
|
-
throw
|
|
396
|
+
} catch (U) {
|
|
397
|
+
throw U;
|
|
398
398
|
} finally {
|
|
399
399
|
ge.value = !1;
|
|
400
400
|
}
|
|
@@ -403,23 +403,23 @@ const ce = {
|
|
|
403
403
|
if (!a.accessToken)
|
|
404
404
|
throw console.error("Access token не передан в props"), new Error("Access token is required");
|
|
405
405
|
try {
|
|
406
|
-
const
|
|
406
|
+
const r = (e = (await ft({
|
|
407
407
|
accessToken: a.accessToken,
|
|
408
408
|
refreshToken: a.refreshToken ?? "",
|
|
409
409
|
excludeFields: []
|
|
410
410
|
})).data) == null ? void 0 : e.user;
|
|
411
|
-
if (!
|
|
411
|
+
if (!r)
|
|
412
412
|
throw console.error("Данные пользователя отсутствуют в ответе сервера"), new Error("User data is missing from the response");
|
|
413
413
|
const {
|
|
414
|
-
userId:
|
|
415
|
-
privateFirstName:
|
|
416
|
-
privateLastName:
|
|
414
|
+
userId: B,
|
|
415
|
+
privateFirstName: U,
|
|
416
|
+
privateLastName: D,
|
|
417
417
|
email: H,
|
|
418
418
|
phoneNumber: Z
|
|
419
|
-
} =
|
|
420
|
-
|
|
421
|
-
firstName:
|
|
422
|
-
lastName:
|
|
419
|
+
} = r;
|
|
420
|
+
c.value = B ?? "", u.firstName = U ?? "", u.lastName = D ?? "", g.value = H ?? "", y.value = Z ?? "", o.imageContent = await je(), d.value = {
|
|
421
|
+
firstName: U ?? "",
|
|
422
|
+
lastName: D ?? ""
|
|
423
423
|
};
|
|
424
424
|
} catch (t) {
|
|
425
425
|
console.error("Критическая ошибка при загрузке профиля:", t);
|
|
@@ -427,8 +427,8 @@ const ce = {
|
|
|
427
427
|
}, je = async () => {
|
|
428
428
|
var e;
|
|
429
429
|
try {
|
|
430
|
-
const
|
|
431
|
-
return
|
|
430
|
+
const r = (e = (await mt("/users/profile/avatar")).data) == null ? void 0 : e.data;
|
|
431
|
+
return r ? qe(r) : "";
|
|
432
432
|
} catch (t) {
|
|
433
433
|
return console.error("Ошибка при загрузке метаданных аватара:", t), "";
|
|
434
434
|
}
|
|
@@ -442,11 +442,11 @@ const ce = {
|
|
|
442
442
|
return console.error("Ошибка при составлении URL аватара:", t), "";
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
const ye =
|
|
445
|
+
const ye = k(() => {
|
|
446
446
|
if (!d.value.firstName && !d.value.lastName)
|
|
447
447
|
return !1;
|
|
448
|
-
const e =
|
|
449
|
-
return
|
|
448
|
+
const e = u.firstName.trim(), t = u.lastName.trim(), r = d.value.firstName.trim(), B = d.value.lastName.trim(), U = e !== r || t !== B, D = e.length >= 2 && t.length >= 2;
|
|
449
|
+
return U && D;
|
|
450
450
|
}), Je = async () => {
|
|
451
451
|
if (ye.value)
|
|
452
452
|
try {
|
|
@@ -454,19 +454,19 @@ const ce = {
|
|
|
454
454
|
} catch (e) {
|
|
455
455
|
console.error(e), K({
|
|
456
456
|
color: "error",
|
|
457
|
-
text:
|
|
457
|
+
text: v("Не удалось сохранить изменения. Попробуйте позже")
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
460
|
}, We = () => {
|
|
461
|
-
|
|
461
|
+
M(), n("open-password-dialog");
|
|
462
462
|
};
|
|
463
463
|
return He(async () => {
|
|
464
464
|
if (!a.accessToken) throw new Error("Access token не передан в props");
|
|
465
465
|
if (!a.requestUrl) throw new Error("auth-backend url не передан в props");
|
|
466
466
|
ct(a.accessToken, a.requestUrl, a.throttlerPrefix), await Ge();
|
|
467
|
-
}), (e, t) => (
|
|
467
|
+
}), (e, t) => (P(), F(Ie, null, [
|
|
468
468
|
b(vt, {
|
|
469
|
-
language:
|
|
469
|
+
language: f.value,
|
|
470
470
|
provider: e.provider,
|
|
471
471
|
"disable-add-phone": e.disableAddPhone,
|
|
472
472
|
onCleanInputErrors: Me,
|
|
@@ -476,152 +476,152 @@ const ce = {
|
|
|
476
476
|
onOnPasswordError: xe,
|
|
477
477
|
onOnToast: K
|
|
478
478
|
}, null, 8, ["language", "provider", "disable-add-phone"]),
|
|
479
|
-
|
|
480
|
-
|
|
479
|
+
re("div", gt, [
|
|
480
|
+
T("avatar") ? (P(), $(p(at), {
|
|
481
481
|
key: 0,
|
|
482
|
-
modelValue:
|
|
482
|
+
modelValue: o.value,
|
|
483
483
|
"onUpdate:modelValue": [
|
|
484
|
-
t[0] || (t[0] = (
|
|
485
|
-
t[1] || (t[1] = (
|
|
484
|
+
t[0] || (t[0] = (r) => o.value = r),
|
|
485
|
+
t[1] || (t[1] = (r) => $e(r))
|
|
486
486
|
],
|
|
487
487
|
type: "img",
|
|
488
488
|
class: "avatar-input",
|
|
489
|
-
src:
|
|
490
|
-
loading:
|
|
491
|
-
label:
|
|
492
|
-
"upload-limit":
|
|
489
|
+
src: o.imageContent,
|
|
490
|
+
loading: o.loading,
|
|
491
|
+
label: v("Загрузить фото"),
|
|
492
|
+
"upload-limit": o.uploadLimit,
|
|
493
493
|
accept: "image/jpeg, image/png",
|
|
494
494
|
onDelete: ze,
|
|
495
495
|
"onChange:error": Le
|
|
496
496
|
}, {
|
|
497
497
|
afterLoadLabel: O(() => [
|
|
498
|
-
|
|
498
|
+
le(G(x.value), 1)
|
|
499
499
|
]),
|
|
500
500
|
subtext: O(() => [
|
|
501
|
-
|
|
501
|
+
S.value ? (P(), F("span", ht, G(S.value), 1)) : (P(), F("span", yt, G(`${v("Формат")} ${p(dt)(o.accept).join(", ")} ${v("до")} ${p(it)(o.uploadLimit)}`), 1))
|
|
502
502
|
]),
|
|
503
503
|
_: 1
|
|
504
|
-
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) :
|
|
505
|
-
|
|
506
|
-
b(
|
|
507
|
-
modelValue:
|
|
508
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
504
|
+
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : V("", !0),
|
|
505
|
+
T("firstName") ? (P(), F("div", wt, [
|
|
506
|
+
b(p(j), {
|
|
507
|
+
modelValue: u.firstName,
|
|
508
|
+
"onUpdate:modelValue": t[2] || (t[2] = (r) => u.firstName = r),
|
|
509
509
|
size: "large",
|
|
510
|
-
label:
|
|
511
|
-
error:
|
|
512
|
-
onBlur: t[3] || (t[3] = (
|
|
513
|
-
onInput: t[4] || (t[4] = (
|
|
510
|
+
label: v("Имя"),
|
|
511
|
+
error: ae.value,
|
|
512
|
+
onBlur: t[3] || (t[3] = (r) => h.firstName = !0),
|
|
513
|
+
onInput: t[4] || (t[4] = (r) => X("firstName"))
|
|
514
514
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
515
|
-
b(
|
|
516
|
-
])) :
|
|
517
|
-
|
|
518
|
-
b(
|
|
519
|
-
modelValue:
|
|
520
|
-
"onUpdate:modelValue": t[5] || (t[5] = (
|
|
515
|
+
b(p(Q), { class: "icon-locked" })
|
|
516
|
+
])) : V("", !0),
|
|
517
|
+
T("lastName") ? (P(), F("div", Et, [
|
|
518
|
+
b(p(j), {
|
|
519
|
+
modelValue: u.lastName,
|
|
520
|
+
"onUpdate:modelValue": t[5] || (t[5] = (r) => u.lastName = r),
|
|
521
521
|
size: "large",
|
|
522
|
-
label:
|
|
523
|
-
error:
|
|
524
|
-
onBlur: t[6] || (t[6] = (
|
|
525
|
-
onInput: t[7] || (t[7] = (
|
|
522
|
+
label: v("Фамилия"),
|
|
523
|
+
error: i.value,
|
|
524
|
+
onBlur: t[6] || (t[6] = (r) => h.lastName = !0),
|
|
525
|
+
onInput: t[7] || (t[7] = (r) => X("lastName"))
|
|
526
526
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
527
|
-
b(
|
|
528
|
-
])) :
|
|
529
|
-
|
|
530
|
-
b(
|
|
531
|
-
modelValue:
|
|
532
|
-
"onUpdate:modelValue": t[8] || (t[8] = (
|
|
527
|
+
b(p(Q), { class: "icon-locked" })
|
|
528
|
+
])) : V("", !0),
|
|
529
|
+
T("email") ? (P(), F("div", bt, [
|
|
530
|
+
b(p(j), {
|
|
531
|
+
modelValue: g.value,
|
|
532
|
+
"onUpdate:modelValue": t[8] || (t[8] = (r) => g.value = r),
|
|
533
533
|
size: "large",
|
|
534
534
|
"text-size": "medium",
|
|
535
535
|
label: "E-mail",
|
|
536
536
|
type: "email",
|
|
537
537
|
readonly: "",
|
|
538
538
|
style: { cursor: "pointer" },
|
|
539
|
-
error:
|
|
540
|
-
onBlur: t[9] || (t[9] = (
|
|
541
|
-
onInput: t[10] || (t[10] = (
|
|
542
|
-
onClick:
|
|
539
|
+
error: w.value && _.value,
|
|
540
|
+
onBlur: t[9] || (t[9] = (r) => h.email = !0),
|
|
541
|
+
onInput: t[10] || (t[10] = (r) => X("email")),
|
|
542
|
+
onClick: Y
|
|
543
543
|
}, null, 8, ["modelValue", "error"]),
|
|
544
|
-
b(
|
|
545
|
-
])) :
|
|
546
|
-
|
|
547
|
-
b(
|
|
544
|
+
b(p(Q), { class: "icon-locked" })
|
|
545
|
+
])) : V("", !0),
|
|
546
|
+
T("phone") ? (P(), F("div", Pt, [
|
|
547
|
+
b(p(j), {
|
|
548
548
|
modelValue: y.value,
|
|
549
|
-
"onUpdate:modelValue": t[11] || (t[11] = (
|
|
549
|
+
"onUpdate:modelValue": t[11] || (t[11] = (r) => y.value = r),
|
|
550
550
|
size: "large",
|
|
551
551
|
"text-size": "medium",
|
|
552
|
-
label:
|
|
552
|
+
label: v("Номер телефона"),
|
|
553
553
|
type: "tel",
|
|
554
554
|
readonly: "",
|
|
555
555
|
style: { cursor: "pointer" },
|
|
556
|
-
error:
|
|
557
|
-
onBlur: t[12] || (t[12] = (
|
|
558
|
-
onInput: t[13] || (t[13] = (
|
|
556
|
+
error: m.value && L.value,
|
|
557
|
+
onBlur: t[12] || (t[12] = (r) => h.phone = !0),
|
|
558
|
+
onInput: t[13] || (t[13] = (r) => X("phone")),
|
|
559
559
|
onClick: Ve
|
|
560
560
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
561
|
-
b(
|
|
562
|
-
])) :
|
|
563
|
-
|
|
564
|
-
|
|
561
|
+
b(p(Q), { class: "icon-locked" })
|
|
562
|
+
])) : V("", !0),
|
|
563
|
+
re("div", Nt, [
|
|
564
|
+
z.value ? (P(), $(p(Ee), {
|
|
565
565
|
key: 0,
|
|
566
566
|
color: "secondary",
|
|
567
567
|
onClick: We
|
|
568
568
|
}, {
|
|
569
569
|
default: O(() => [
|
|
570
|
-
|
|
570
|
+
le(G(v("Сменить пароль")), 1)
|
|
571
571
|
]),
|
|
572
572
|
_: 1
|
|
573
|
-
})) :
|
|
574
|
-
b(
|
|
573
|
+
})) : V("", !0),
|
|
574
|
+
b(p(Ee), {
|
|
575
575
|
disabled: !ye.value,
|
|
576
576
|
onClick: Je
|
|
577
577
|
}, {
|
|
578
578
|
default: O(() => [
|
|
579
|
-
|
|
579
|
+
le(G(v("Сохранить")), 1)
|
|
580
580
|
]),
|
|
581
581
|
_: 1
|
|
582
582
|
}, 8, ["disabled"])
|
|
583
583
|
])
|
|
584
584
|
]),
|
|
585
|
-
|
|
585
|
+
C.value ? (P(), $(we, {
|
|
586
586
|
key: 0,
|
|
587
587
|
to: "body"
|
|
588
588
|
}, [
|
|
589
|
-
|
|
590
|
-
b(
|
|
589
|
+
C.value ? (P(), F("div", Ct, [
|
|
590
|
+
b(p(nt), {
|
|
591
591
|
"circle-mode": !0,
|
|
592
|
-
"model-value":
|
|
592
|
+
"model-value": o.imageContent,
|
|
593
593
|
onClose: _e,
|
|
594
|
-
onSave: t[14] || (t[14] = (
|
|
595
|
-
"onUpdate:modelValue": t[15] || (t[15] = (
|
|
594
|
+
onSave: t[14] || (t[14] = (r) => Re(r)),
|
|
595
|
+
"onUpdate:modelValue": t[15] || (t[15] = (r) => Oe(r))
|
|
596
596
|
}, null, 8, ["model-value"])
|
|
597
|
-
])) :
|
|
598
|
-
])) :
|
|
599
|
-
(
|
|
600
|
-
|
|
597
|
+
])) : V("", !0)
|
|
598
|
+
])) : V("", !0),
|
|
599
|
+
(P(), $(we, { to: "#toast-root" }, [
|
|
600
|
+
re("div", kt, [
|
|
601
601
|
b(Ze, { name: "list" }, {
|
|
602
602
|
default: O(() => [
|
|
603
|
-
Qe(b(
|
|
603
|
+
Qe(b(p(ot), {
|
|
604
604
|
class: "toast",
|
|
605
605
|
color: q.value,
|
|
606
606
|
text: J.value,
|
|
607
|
-
onClose: t[16] || (t[16] = (
|
|
607
|
+
onClose: t[16] || (t[16] = (r) => N.value = !1)
|
|
608
608
|
}, null, 8, ["color", "text"]), [
|
|
609
|
-
[et,
|
|
609
|
+
[et, N.value]
|
|
610
610
|
])
|
|
611
611
|
]),
|
|
612
612
|
_: 1
|
|
613
613
|
})
|
|
614
614
|
])
|
|
615
615
|
])),
|
|
616
|
-
b(
|
|
616
|
+
b(p(Be))
|
|
617
617
|
], 64));
|
|
618
618
|
}
|
|
619
|
-
}),
|
|
619
|
+
}), De = (l, s) => {
|
|
620
620
|
const a = l.__vccOpts || l;
|
|
621
|
-
for (const [n,
|
|
622
|
-
a[n] =
|
|
621
|
+
for (const [n, f] of s)
|
|
622
|
+
a[n] = f;
|
|
623
623
|
return a;
|
|
624
|
-
}, It = /* @__PURE__ */
|
|
624
|
+
}, It = /* @__PURE__ */ De(Tt, [["__scopeId", "data-v-4e8a6f81"]]), Rt = /* @__PURE__ */ te({
|
|
625
625
|
__name: "index",
|
|
626
626
|
props: {
|
|
627
627
|
throttlerPrefix: {},
|
|
@@ -636,17 +636,17 @@ const ce = {
|
|
|
636
636
|
},
|
|
637
637
|
emits: ["on-update-jwt", "update-tokens"],
|
|
638
638
|
setup(l, { emit: s }) {
|
|
639
|
-
const a = s, { openDialog: n } = pe(),
|
|
640
|
-
n("email", { initialEmail: d, mode:
|
|
641
|
-
},
|
|
642
|
-
n("phone", { initialPhone: d, mode:
|
|
643
|
-
},
|
|
639
|
+
const a = s, { openDialog: n } = pe(), f = (d, h) => {
|
|
640
|
+
n("email", { initialEmail: d, mode: h });
|
|
641
|
+
}, v = (d, h) => {
|
|
642
|
+
n("phone", { initialPhone: d, mode: h });
|
|
643
|
+
}, A = () => {
|
|
644
644
|
n("password");
|
|
645
|
-
},
|
|
646
|
-
a("on-update-jwt", d,
|
|
645
|
+
}, u = (d, h, c) => {
|
|
646
|
+
a("on-update-jwt", d, h, c);
|
|
647
647
|
};
|
|
648
|
-
return (d,
|
|
649
|
-
b(
|
|
648
|
+
return (d, h) => (P(), F(Ie, null, [
|
|
649
|
+
b(p(rt)),
|
|
650
650
|
b(It, {
|
|
651
651
|
"throttler-prefix": d.throttlerPrefix,
|
|
652
652
|
provider: d.provider,
|
|
@@ -657,12 +657,12 @@ const ce = {
|
|
|
657
657
|
"refresh-token": d.refreshToken,
|
|
658
658
|
"aws-storage-url": d.awsStorageUrl,
|
|
659
659
|
"disable-add-phone": d.disableAddPhone,
|
|
660
|
-
onOpenEmailDialog:
|
|
661
|
-
onOpenPhoneDialog:
|
|
662
|
-
onOpenPasswordDialog:
|
|
663
|
-
onOnUpdateJwt:
|
|
660
|
+
onOpenEmailDialog: f,
|
|
661
|
+
onOpenPhoneDialog: v,
|
|
662
|
+
onOpenPasswordDialog: A,
|
|
663
|
+
onOnUpdateJwt: u
|
|
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(p(Be))
|
|
666
666
|
], 64));
|
|
667
667
|
}
|
|
668
668
|
}), Bt = 10, Dt = 10, Ut = 15;
|
|
@@ -679,25 +679,25 @@ function Ne(l, s = Bt, a = Ut) {
|
|
|
679
679
|
const n = l.slice(1);
|
|
680
680
|
return !(!/^\d+$/.test(n) || n.length < s || n.length > a);
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function ie(l) {
|
|
683
683
|
return !/^\+?\d*$/.test(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((f, v) => f === "+" ? v !== 0 || n ? !1 : (n = !0, !0) : /\d/.test(f) ? (a++, a <= s) : !1).join("");
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function Ce(l) {
|
|
690
690
|
return l.startsWith("+") || /^\d/.test(l);
|
|
691
691
|
}
|
|
692
692
|
const At = /^[\w.%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;
|
|
693
|
-
function
|
|
693
|
+
function ke(l) {
|
|
694
694
|
return At.test(l);
|
|
695
695
|
}
|
|
696
|
-
const
|
|
696
|
+
const Ue = /^[\d\s()+]+$/;
|
|
697
697
|
function Ft(l, s) {
|
|
698
|
-
var n,
|
|
698
|
+
var n, f;
|
|
699
699
|
const a = l.trim();
|
|
700
|
-
return (n = s.phone) != null && n.enabled &&
|
|
700
|
+
return (n = s.phone) != null && n.enabled && Ue.test(a) && /\d/.test(a) && !a.includes("@") ? "phone" : (f = s.email) != null && f.enabled ? "email" : null;
|
|
701
701
|
}
|
|
702
702
|
const St = { class: "smart-input" }, xt = /* @__PURE__ */ te({
|
|
703
703
|
__name: "index",
|
|
@@ -713,26 +713,29 @@ 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,
|
|
717
|
-
|
|
718
|
-
return
|
|
716
|
+
const a = l, n = s, f = k(() => a.locale ?? "ru"), v = (i) => ce[f.value][i] || i, A = k(() => {
|
|
717
|
+
const i = o.value;
|
|
718
|
+
return i ? Ce(i) ? "phone" : /[^\d+]/.test(i) ? "email" : null : null;
|
|
719
|
+
}), u = k(() => A.value), d = k(() => a.label ? v(a.label) : v("Email или телефон"));
|
|
720
|
+
function h(i, w) {
|
|
721
|
+
return w ? w in ce[f.value] ? v(w) : w : v(i);
|
|
719
722
|
}
|
|
720
|
-
const
|
|
721
|
-
var i, w,
|
|
723
|
+
const c = k(() => {
|
|
724
|
+
var i, w, m, T, I, M, z, x, R, W, Y;
|
|
722
725
|
return {
|
|
723
726
|
mode: ((i = a.config) == null ? void 0 : i.mode) ?? "auto",
|
|
724
727
|
phone: {
|
|
725
|
-
enabled: ((
|
|
726
|
-
minDigits: ((
|
|
727
|
-
maxDigits: ((
|
|
728
|
-
autoPlus: ((
|
|
728
|
+
enabled: ((m = (w = a.config) == null ? void 0 : w.phone) == null ? void 0 : m.enabled) ?? !0,
|
|
729
|
+
minDigits: ((I = (T = a.config) == null ? void 0 : T.phone) == null ? void 0 : I.minDigits) ?? 10,
|
|
730
|
+
maxDigits: ((z = (M = a.config) == null ? void 0 : M.phone) == null ? void 0 : z.maxDigits) ?? 15,
|
|
731
|
+
autoPlus: ((R = (x = a.config) == null ? void 0 : x.phone) == null ? void 0 : R.autoPlus) ?? !0
|
|
729
732
|
},
|
|
730
733
|
email: {
|
|
731
|
-
enabled: ((Y = (
|
|
734
|
+
enabled: ((Y = (W = a.config) == null ? void 0 : W.email) == null ? void 0 : Y.enabled) ?? !0
|
|
732
735
|
}
|
|
733
736
|
};
|
|
734
737
|
});
|
|
735
|
-
function
|
|
738
|
+
function g(i) {
|
|
736
739
|
if (a.errorMessages)
|
|
737
740
|
switch (i) {
|
|
738
741
|
case "Допустимы только цифры и знак + в начале":
|
|
@@ -743,124 +746,125 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ te({
|
|
|
743
746
|
return a.errorMessages.invalidEmail;
|
|
744
747
|
}
|
|
745
748
|
}
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
|
|
749
|
+
const y = E(null), C = E(""), o = E(a.modelValue ?? ""), S = E(null), N = E(null), L = k(() => N.value ? h(
|
|
750
|
+
N.value,
|
|
751
|
+
g(N.value)
|
|
749
752
|
) : "");
|
|
750
|
-
|
|
751
|
-
i !== void 0 && (
|
|
753
|
+
Te(() => a.modelValue, (i) => {
|
|
754
|
+
i !== void 0 && (o.value = i, C.value = i);
|
|
752
755
|
});
|
|
753
|
-
function
|
|
754
|
-
|
|
755
|
-
const
|
|
756
|
-
if (
|
|
757
|
-
|
|
756
|
+
function _(i) {
|
|
757
|
+
N.value = null;
|
|
758
|
+
const m = i.target.value;
|
|
759
|
+
if (m.trim() === "") {
|
|
760
|
+
S.value = null, N.value = null, n("type-change", null), n("update:modelValue", ""), n("validity-change", !1);
|
|
758
761
|
return;
|
|
759
762
|
}
|
|
760
|
-
const
|
|
761
|
-
if (
|
|
762
|
-
|
|
763
|
+
const T = c.value.mode === "auto" ? Ft(m, c.value) : c.value.mode;
|
|
764
|
+
if (S.value = T, n("type-change", T), ie(m) && Ce(m)) {
|
|
765
|
+
o.value = m, n("update:modelValue", m), N.value = "Допустимы только цифры и знак + в начале", n("validity-change", !1);
|
|
763
766
|
return;
|
|
764
767
|
}
|
|
765
|
-
if (
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
+
if (T === "email") {
|
|
769
|
+
const I = ke(m);
|
|
770
|
+
o.value = m, C.value = m, n("update:modelValue", m), n("validity-change", I);
|
|
768
771
|
return;
|
|
769
772
|
}
|
|
770
|
-
if (
|
|
771
|
-
const
|
|
772
|
-
|
|
773
|
-
|
|
773
|
+
if (T === "phone") {
|
|
774
|
+
const I = be(
|
|
775
|
+
m,
|
|
776
|
+
c.value.phone.autoPlus,
|
|
774
777
|
a.locale
|
|
775
778
|
);
|
|
776
|
-
if (Pe(
|
|
777
|
-
const x = Vt(
|
|
778
|
-
|
|
779
|
+
if (Pe(I).length > c.value.phone.maxDigits) {
|
|
780
|
+
const x = Vt(m, c.value.phone.maxDigits);
|
|
781
|
+
o.value = x, n("update:modelValue", x), ae(x);
|
|
779
782
|
return;
|
|
780
783
|
}
|
|
781
|
-
if (
|
|
782
|
-
|
|
784
|
+
if (o.value = m, ie(m)) {
|
|
785
|
+
Ue.test(m) && (N.value = "Допустимы только цифры и знак + в начале", n("validity-change", !1));
|
|
783
786
|
return;
|
|
784
787
|
}
|
|
785
|
-
|
|
786
|
-
const
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
788
|
+
o.value = I, n("update:modelValue", I), C.value = I;
|
|
789
|
+
const z = Ne(
|
|
790
|
+
I,
|
|
791
|
+
c.value.phone.minDigits,
|
|
792
|
+
c.value.phone.maxDigits
|
|
790
793
|
);
|
|
791
|
-
n("validity-change",
|
|
794
|
+
n("validity-change", z);
|
|
792
795
|
}
|
|
793
796
|
}
|
|
794
|
-
function
|
|
795
|
-
if (
|
|
796
|
-
if (
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
u.value.phone.autoPlus,
|
|
800
|
-
a.locale
|
|
801
|
-
), w = Pe(i);
|
|
802
|
-
if (se(f.value) && ie(f.value)) {
|
|
803
|
-
P.value = "Допустимы только цифры и знак + в начале", n("validity-change", !1);
|
|
797
|
+
function q() {
|
|
798
|
+
if (A.value) {
|
|
799
|
+
if (A.value === "phone") {
|
|
800
|
+
if (ie(o.value)) {
|
|
801
|
+
N.value = "Допустимы только цифры и знак + в начале", n("validity-change", !1);
|
|
804
802
|
return;
|
|
805
803
|
}
|
|
806
|
-
|
|
807
|
-
|
|
804
|
+
const i = be(
|
|
805
|
+
o.value,
|
|
806
|
+
c.value.phone.autoPlus,
|
|
807
|
+
a.locale
|
|
808
|
+
);
|
|
809
|
+
if (Pe(i).length < Dt) {
|
|
810
|
+
N.value = "Это не похоже на номер телефона", n("validity-change", !1);
|
|
808
811
|
return;
|
|
809
812
|
}
|
|
810
|
-
const
|
|
813
|
+
const m = Ne(
|
|
811
814
|
i,
|
|
812
|
-
|
|
813
|
-
|
|
815
|
+
c.value.phone.minDigits,
|
|
816
|
+
c.value.phone.maxDigits
|
|
814
817
|
);
|
|
815
|
-
|
|
818
|
+
N.value = m ? null : "Это не похоже на номер телефона", n("validity-change", m);
|
|
819
|
+
return;
|
|
816
820
|
}
|
|
817
|
-
if (
|
|
818
|
-
const i =
|
|
819
|
-
|
|
821
|
+
if (A.value === "email") {
|
|
822
|
+
const i = ke(o.value);
|
|
823
|
+
N.value = i ? null : "Это не похоже на email", n("validity-change", i);
|
|
820
824
|
}
|
|
821
825
|
}
|
|
822
826
|
}
|
|
823
|
-
function
|
|
827
|
+
function J() {
|
|
824
828
|
var w;
|
|
825
|
-
const i = (w =
|
|
829
|
+
const i = (w = y.value) == null ? void 0 : w.$el;
|
|
826
830
|
return i ? i.querySelector("input") : null;
|
|
827
831
|
}
|
|
828
|
-
function
|
|
829
|
-
const w =
|
|
832
|
+
function ae(i) {
|
|
833
|
+
const w = J();
|
|
830
834
|
if (!w) return;
|
|
831
|
-
const
|
|
835
|
+
const m = w.selectionStart ?? i.length;
|
|
832
836
|
w.value = i, requestAnimationFrame(() => {
|
|
833
|
-
w.setSelectionRange(
|
|
837
|
+
w.setSelectionRange(m, m);
|
|
834
838
|
});
|
|
835
839
|
}
|
|
836
|
-
return (i, w) => (
|
|
837
|
-
b(
|
|
840
|
+
return (i, w) => (P(), F("div", St, [
|
|
841
|
+
b(p(j), {
|
|
838
842
|
ref_key: "inputRef",
|
|
839
|
-
ref:
|
|
840
|
-
"model-value":
|
|
843
|
+
ref: y,
|
|
844
|
+
"model-value": o.value,
|
|
841
845
|
readonly: i.disabled,
|
|
842
|
-
error:
|
|
846
|
+
error: L.value,
|
|
843
847
|
type: i.type ?? "text",
|
|
844
848
|
size: i.size ?? "large",
|
|
845
|
-
label:
|
|
846
|
-
onInput:
|
|
847
|
-
onBlur:
|
|
849
|
+
label: d.value,
|
|
850
|
+
onInput: _,
|
|
851
|
+
onBlur: q
|
|
848
852
|
}, null, 8, ["model-value", "readonly", "error", "type", "size", "label"]),
|
|
849
|
-
|
|
853
|
+
u.value === "phone" ? (P(), $(p(lt), {
|
|
850
854
|
key: 0,
|
|
851
855
|
class: "smart-input__icon"
|
|
852
|
-
})) :
|
|
853
|
-
|
|
856
|
+
})) : V("", !0),
|
|
857
|
+
u.value === "email" ? (P(), $(p(st), {
|
|
854
858
|
key: 1,
|
|
855
859
|
class: "smart-input__icon"
|
|
856
|
-
})) :
|
|
860
|
+
})) : V("", !0)
|
|
857
861
|
]));
|
|
858
862
|
}
|
|
859
|
-
}), Ot = /* @__PURE__ */
|
|
863
|
+
}), Ot = /* @__PURE__ */ De(xt, [["__scopeId", "data-v-2e693238"]]);
|
|
860
864
|
export {
|
|
861
865
|
_t as B,
|
|
862
866
|
Lt as C,
|
|
863
|
-
|
|
867
|
+
De as _,
|
|
864
868
|
Rt as a,
|
|
865
869
|
mt as g,
|
|
866
870
|
Ot as i,
|
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-2e693238]{position:relative;width:100%}.smart-input__icon[data-v-2e693238]{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-JgKD-0yi.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-JgKD-0yi.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")}`;
|