@yourgoods/ui-smart 0.53.4 → 0.53.6
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-pPqFck-W.js → ProfileEmailDialog-DNqCaOPA.js} +2 -2
- package/dist/{ProfilePasswordDialog-C1TqpH4C.js → ProfilePasswordDialog-CdZ5dWF0.js} +1 -1
- package/dist/{ProfilePhoneDialog-BAcZqi79.js → ProfilePhoneDialog-tKedDfS4.js} +2 -2
- package/dist/components/PEmailOrPhoneInput/utils/phone.d.ts +1 -0
- package/dist/{index-C4QGO5Ga.js → index-CfmFrMSL.js} +251 -237
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-B5pcXwqH.js → useRateLimitToast-DCoAsFEo.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-DCoAsFEo.js";
|
|
3
|
+
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-CfmFrMSL.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-CfmFrMSL.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-DCoAsFEo.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-CfmFrMSL.js";
|
|
5
5
|
const _e = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: "12",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function normalizePhoneInput(raw: string, autoPlus: boolean, locale?: string): string;
|
|
2
|
+
export declare function extractDigits(value: string): string;
|
|
2
3
|
export declare function limitPhoneLength(value: string, maxDigits: number): string;
|
|
3
4
|
export declare function isValidPhone(value: string, minDigits?: number, maxDigits?: number): boolean;
|
|
4
5
|
export declare function hasInvalidPhoneChars(raw: string): boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as w, shallowRef as Oe, defineComponent as j, defineAsyncComponent as q, watch as me, createBlock as
|
|
1
|
+
import { ref as w, shallowRef as Oe, defineComponent as j, defineAsyncComponent as q, watch as me, createBlock as A, createCommentVNode as T, unref as f, openBlock as b, resolveDynamicComponent as _e, mergeProps as Re, computed as D, reactive as W, onMounted as Ge, createElementBlock as U, Fragment as pe, createVNode as h, createElementVNode as Y, withCtx as x, toDisplayString as $, createTextVNode as X, Teleport as ue, Transition as je, withDirectives as Je, vShow as qe } from "vue";
|
|
2
2
|
import We from "axios";
|
|
3
|
-
import { PInputFileUploader as Ye, PInput as
|
|
4
|
-
function ea(
|
|
5
|
-
if (
|
|
3
|
+
import { PInputFileUploader as Ye, PInput as M, IconFilledEditMd as R, PButton as de, PImageCropper as Xe, PToast as Ke, PTeleportContainer as ce, PToastContainer as Ze, IconPhoneMd as He, IconMailMd as Qe } from "@profeat/ui-kit";
|
|
4
|
+
function ea(l, i = 2) {
|
|
5
|
+
if (l === 0)
|
|
6
6
|
return "0 B";
|
|
7
|
-
const t = 1024, n = ["B", "KB", "MB", "GB", "TB", "PB", "EB"],
|
|
8
|
-
return `${Number.parseFloat((
|
|
7
|
+
const t = 1024, n = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], p = Math.floor(Math.log(l) / Math.log(t));
|
|
8
|
+
return `${Number.parseFloat((l / t ** p).toFixed(i))} ${n[p]}`;
|
|
9
9
|
}
|
|
10
10
|
const aa = {
|
|
11
11
|
"image/jpeg": "JPEG",
|
|
@@ -15,13 +15,13 @@ const aa = {
|
|
|
15
15
|
"application/zip": "ZIP Archive"
|
|
16
16
|
// ...
|
|
17
17
|
};
|
|
18
|
-
function ta(
|
|
19
|
-
return
|
|
18
|
+
function ta(l) {
|
|
19
|
+
return l.map((i) => {
|
|
20
20
|
var t;
|
|
21
21
|
return aa[i] || ((t = i.split("/")[1]) == null ? void 0 : t.toUpperCase());
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const xa = {
|
|
25
25
|
OLD: "old",
|
|
26
26
|
NEW: "new",
|
|
27
27
|
COMPLETED: "completed"
|
|
@@ -29,11 +29,11 @@ const Sa = {
|
|
|
29
29
|
VERIFY_EMAIL: "verify-email"
|
|
30
30
|
};
|
|
31
31
|
let Z = null;
|
|
32
|
-
function oa(
|
|
32
|
+
function oa(l, i, t) {
|
|
33
33
|
Z = We.create({
|
|
34
34
|
baseURL: i,
|
|
35
35
|
headers: {
|
|
36
|
-
Authorization: `Bearer ${
|
|
36
|
+
Authorization: `Bearer ${l}`,
|
|
37
37
|
"x-throttler-prefix": t ?? "throttler_profile_edit"
|
|
38
38
|
// здесь можно словить баг, который может быть сложно отследить, если будет передаваться пустой прелфикс
|
|
39
39
|
// 'Content-Type': 'application/json',
|
|
@@ -46,17 +46,17 @@ function Q() {
|
|
|
46
46
|
throw new Error("Axios instance not initialized. Call initAxios(token, baseUrl) first.");
|
|
47
47
|
return Z;
|
|
48
48
|
}
|
|
49
|
-
async function H(
|
|
50
|
-
return Q().post(
|
|
49
|
+
async function H(l, i, t) {
|
|
50
|
+
return Q().post(l, i, t);
|
|
51
51
|
}
|
|
52
|
-
async function na(
|
|
53
|
-
return Q().get(
|
|
52
|
+
async function na(l, i) {
|
|
53
|
+
return Q().get(l, i);
|
|
54
54
|
}
|
|
55
|
-
async function ra(
|
|
56
|
-
return Q().delete(
|
|
55
|
+
async function ra(l, i) {
|
|
56
|
+
return Q().delete(l, i);
|
|
57
57
|
}
|
|
58
|
-
async function la(
|
|
59
|
-
const i = await H("/users/profile/me",
|
|
58
|
+
async function la(l) {
|
|
59
|
+
const i = await H("/users/profile/me", l);
|
|
60
60
|
if (i.status !== 200 && i.status !== 201 || !i.data)
|
|
61
61
|
throw new Error("Ошибка при получении профиля пользователя");
|
|
62
62
|
return i.data;
|
|
@@ -66,8 +66,8 @@ function ee() {
|
|
|
66
66
|
return {
|
|
67
67
|
currentDialog: G,
|
|
68
68
|
dialogPayload: K,
|
|
69
|
-
openDialog: (n,
|
|
70
|
-
G.value = n, K.value =
|
|
69
|
+
openDialog: (n, p) => {
|
|
70
|
+
G.value = n, K.value = p ?? null;
|
|
71
71
|
},
|
|
72
72
|
closeDialog: () => {
|
|
73
73
|
G.value = null, K.value = null;
|
|
@@ -216,34 +216,34 @@ const sa = {
|
|
|
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(
|
|
220
|
-
const t = i, n = w(!0), { currentDialog:
|
|
221
|
-
email: q(() => import("./ProfileEmailDialog-
|
|
222
|
-
phone: q(() => import("./ProfilePhoneDialog-
|
|
223
|
-
password: q(() => import("./ProfilePasswordDialog-
|
|
224
|
-
},
|
|
225
|
-
t("update-email-field",
|
|
226
|
-
},
|
|
227
|
-
t("update-phone-field",
|
|
219
|
+
setup(l, { emit: i }) {
|
|
220
|
+
const t = i, n = w(!0), { currentDialog: p, dialogPayload: v, closeDialog: B } = ee(), u = {
|
|
221
|
+
email: q(() => import("./ProfileEmailDialog-DNqCaOPA.js")),
|
|
222
|
+
phone: q(() => import("./ProfilePhoneDialog-tKedDfS4.js")),
|
|
223
|
+
password: q(() => import("./ProfilePasswordDialog-CdZ5dWF0.js"))
|
|
224
|
+
}, c = ({ email: g }) => {
|
|
225
|
+
t("update-email-field", g);
|
|
226
|
+
}, s = ({ phone: g }) => {
|
|
227
|
+
t("update-phone-field", g);
|
|
228
228
|
};
|
|
229
|
-
return me(
|
|
230
|
-
n.value = !!
|
|
231
|
-
}), (
|
|
229
|
+
return me(p, (g) => {
|
|
230
|
+
n.value = !!g;
|
|
231
|
+
}), (g, d) => f(p) ? (b(), A(_e(u[f(p)]), Re({
|
|
232
232
|
key: 0,
|
|
233
233
|
modelValue: n.value,
|
|
234
|
-
"onUpdate:modelValue":
|
|
235
|
-
language:
|
|
236
|
-
provider:
|
|
237
|
-
"disable-add-phone":
|
|
238
|
-
},
|
|
239
|
-
onClose:
|
|
240
|
-
onCleanInputErrors:
|
|
241
|
-
onOnUpdateJwt:
|
|
242
|
-
onSubmitEmail:
|
|
243
|
-
onSubmitPhone:
|
|
244
|
-
onOnPasswordError:
|
|
245
|
-
onOnToast:
|
|
246
|
-
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) :
|
|
234
|
+
"onUpdate:modelValue": d[0] || (d[0] = (m) => n.value = m),
|
|
235
|
+
language: g.language,
|
|
236
|
+
provider: g.provider,
|
|
237
|
+
"disable-add-phone": g.disableAddPhone
|
|
238
|
+
}, f(v), {
|
|
239
|
+
onClose: f(B),
|
|
240
|
+
onCleanInputErrors: d[1] || (d[1] = (m) => t("clean-input-errors")),
|
|
241
|
+
onOnUpdateJwt: d[2] || (d[2] = (m, y, r) => t("on-update-jwt", m, y, r)),
|
|
242
|
+
onSubmitEmail: c,
|
|
243
|
+
onSubmitPhone: s,
|
|
244
|
+
onOnPasswordError: d[3] || (d[3] = (m, y) => t("on-password-error", m, y)),
|
|
245
|
+
onOnToast: d[4] || (d[4] = (m) => t("on-toast", m))
|
|
246
|
+
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : T("", !0);
|
|
247
247
|
}
|
|
248
248
|
}), ua = { class: "base-container" }, da = {
|
|
249
249
|
key: 0,
|
|
@@ -277,8 +277,8 @@ const sa = {
|
|
|
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(
|
|
281
|
-
const t =
|
|
280
|
+
setup(l, { emit: i }) {
|
|
281
|
+
const t = l, n = i, p = D(() => t.language ?? "ru"), v = (e) => sa[p.value][e] || e, { openDialog: B } = ee(), u = W({ firstName: "", lastName: "" }), c = w({ firstName: "", lastName: "" }), s = W({ firstName: !1, lastName: !1, email: !1, phone: !1 }), g = w(""), d = w(""), m = w(""), y = w(!1), r = W({
|
|
282
282
|
value: null,
|
|
283
283
|
loading: !1,
|
|
284
284
|
accept: ["image/png", "image/jpeg"],
|
|
@@ -286,49 +286,49 @@ const sa = {
|
|
|
286
286
|
// 10 MB
|
|
287
287
|
imageBinary: null,
|
|
288
288
|
imageContent: ""
|
|
289
|
-
}), N = w(""),
|
|
289
|
+
}), N = w(""), C = w(!1), I = w(!0), F = w(!0), V = w(void 0), ae = w(""), ge = D(() => oe(u.firstName, s.firstName)), ve = D(() => oe(u.lastName, s.lastName)), he = D(() => s.email && !d.value.trim() ? "Введите e-mail" : ""), ye = D(() => s.phone && !m.value.trim() ? "Введите номер телефона" : ""), S = (e) => t.fields.some((a) => a.key === e), te = (e) => e && e.trim() ? "edit" : "bind", J = () => setTimeout(() => {
|
|
290
290
|
var e;
|
|
291
291
|
return (e = document.activeElement) == null ? void 0 : e.blur();
|
|
292
|
-
}, 0), we =
|
|
292
|
+
}, 0), we = D(() => !!(d.value && d.value.trim() !== "")), be = D(() => r.imageContent ? v("Загрузить другое фото") : v("Загрузить фото")), oe = (e, a) => {
|
|
293
293
|
if (!a) return "";
|
|
294
294
|
const o = e.trim();
|
|
295
295
|
return o ? o.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
|
|
296
|
-
}, Ee = (e) =>
|
|
297
|
-
J(),
|
|
296
|
+
}, Ee = (e) => B("email", { mode: e ? "edit" : "bind", initialEmail: e }), Pe = () => {
|
|
297
|
+
J(), s.email = !1, F.value = !1, n("open-email-dialog", d.value, te(d.value)), Ee(d.value);
|
|
298
298
|
}, Ne = () => {
|
|
299
|
-
J(),
|
|
299
|
+
J(), s.phone = !1, I.value = !1, n("open-phone-dialog", m.value, te(m.value));
|
|
300
300
|
}, Ce = async (e, a, o) => {
|
|
301
|
-
e === "email" && o && (
|
|
301
|
+
e === "email" && o && (d.value = o), e === "phone" && o && (m.value = o), n("on-update-jwt");
|
|
302
302
|
}, ke = (e) => {
|
|
303
|
-
|
|
303
|
+
m.value = e;
|
|
304
304
|
}, Te = (e) => {
|
|
305
|
-
|
|
305
|
+
d.value = e;
|
|
306
306
|
}, Ue = (e, a) => {
|
|
307
|
-
|
|
307
|
+
C.value = !0, n("on-password-error", e, a);
|
|
308
308
|
}, Be = () => {
|
|
309
|
-
|
|
310
|
-
},
|
|
311
|
-
|
|
309
|
+
I.value = !1, F.value = !1;
|
|
310
|
+
}, z = (e) => {
|
|
311
|
+
C.value = !0, V.value = e.color ?? "", ae.value = e.text ?? "";
|
|
312
312
|
}, L = (e) => {
|
|
313
|
-
if (
|
|
314
|
-
const a =
|
|
315
|
-
a.length > 40 && (
|
|
313
|
+
if (s[e] = !0, e === "firstName" || e === "lastName") {
|
|
314
|
+
const a = u[e];
|
|
315
|
+
a.length > 40 && (u[e] = a.slice(0, 40));
|
|
316
316
|
}
|
|
317
|
-
},
|
|
318
|
-
var O,
|
|
317
|
+
}, De = (e) => {
|
|
318
|
+
var O, _;
|
|
319
319
|
if (N.value = "", !e) {
|
|
320
320
|
ne();
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
|
-
const a = ((O = e.fileBinary) == null ? void 0 : O.type) ?? "", o = ((
|
|
324
|
-
if (
|
|
323
|
+
const a = ((O = e.fileBinary) == null ? void 0 : O.type) ?? "", o = ((_ = e.fileBinary) == null ? void 0 : _.size) ?? 0, k = !["image/png", "image/jpeg"].includes(a), P = o > r.uploadLimit;
|
|
324
|
+
if (k || P) {
|
|
325
325
|
N.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", ne();
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
328
|
r.value = e, r.imageBinary = e.fileBinary ?? null, r.imageContent = e.fileContent ?? "", y.value = !0;
|
|
329
329
|
}, ne = () => {
|
|
330
330
|
r.value = null, r.imageBinary = null, r.imageContent = "", y.value = !1;
|
|
331
|
-
},
|
|
331
|
+
}, Ie = async () => {
|
|
332
332
|
try {
|
|
333
333
|
const a = (await ra("/users/profile/delete/avatar")).data;
|
|
334
334
|
return (a == null ? void 0 : a.success) === !0;
|
|
@@ -339,11 +339,11 @@ const sa = {
|
|
|
339
339
|
N.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", r.value = null, r.imageBinary = null, r.imageContent = "", y.value = !1;
|
|
340
340
|
}, re = async (e, a, o = "image/png") => {
|
|
341
341
|
if (!e) return null;
|
|
342
|
-
const
|
|
343
|
-
return new File([
|
|
344
|
-
},
|
|
342
|
+
const k = await (await fetch(e)).blob();
|
|
343
|
+
return new File([k], a, { type: o });
|
|
344
|
+
}, Fe = () => {
|
|
345
345
|
r.value = null, r.imageBinary = null, r.imageContent = "", y.value = !1;
|
|
346
|
-
},
|
|
346
|
+
}, Ve = async (e) => {
|
|
347
347
|
y.value = !1;
|
|
348
348
|
const a = r.imageContent;
|
|
349
349
|
if (r.imageContent = e, !r.imageBinary) return;
|
|
@@ -359,9 +359,9 @@ const sa = {
|
|
|
359
359
|
try {
|
|
360
360
|
r.loading = !0;
|
|
361
361
|
const E = new FormData();
|
|
362
|
-
E.append("file", o), await H(`/users/profile/avatar/${
|
|
362
|
+
E.append("file", o), await H(`/users/profile/avatar/${g.value}`, E, { headers: { "Content-Type": void 0 } });
|
|
363
363
|
} catch (E) {
|
|
364
|
-
console.error(E),
|
|
364
|
+
console.error(E), z({
|
|
365
365
|
color: "error",
|
|
366
366
|
text: v("Не удалось сохранить изменения. Попробуйте позже")
|
|
367
367
|
}), r.imageContent = a;
|
|
@@ -376,21 +376,21 @@ const sa = {
|
|
|
376
376
|
));
|
|
377
377
|
}, le = w(!1), se = async (e) => {
|
|
378
378
|
var o, E;
|
|
379
|
-
const a = (o =
|
|
379
|
+
const a = (o = u[e]) == null ? void 0 : o.trim();
|
|
380
380
|
if (a)
|
|
381
381
|
try {
|
|
382
382
|
le.value = !0;
|
|
383
383
|
const P = (E = (await H("/users/profile/update-name", { [e]: a })).data) == null ? void 0 : E.data;
|
|
384
|
-
P != null && P.user && (
|
|
385
|
-
firstName:
|
|
386
|
-
lastName:
|
|
384
|
+
P != null && P.user && (u.firstName = P.user.firstName ?? u.firstName, u.lastName = P.user.lastName ?? u.lastName, c.value = {
|
|
385
|
+
firstName: u.firstName,
|
|
386
|
+
lastName: u.lastName
|
|
387
387
|
});
|
|
388
|
-
} catch (
|
|
389
|
-
throw
|
|
388
|
+
} catch (k) {
|
|
389
|
+
throw k;
|
|
390
390
|
} finally {
|
|
391
391
|
le.value = !1;
|
|
392
392
|
}
|
|
393
|
-
},
|
|
393
|
+
}, xe = async () => {
|
|
394
394
|
var e;
|
|
395
395
|
if (!t.accessToken)
|
|
396
396
|
throw console.error("Access token не передан в props"), new Error("Access token is required");
|
|
@@ -404,28 +404,28 @@ const sa = {
|
|
|
404
404
|
throw console.error("Данные пользователя отсутствуют в ответе сервера"), new Error("User data is missing from the response");
|
|
405
405
|
const {
|
|
406
406
|
userId: E,
|
|
407
|
-
privateFirstName:
|
|
407
|
+
privateFirstName: k,
|
|
408
408
|
privateLastName: P,
|
|
409
409
|
email: O,
|
|
410
|
-
phoneNumber:
|
|
410
|
+
phoneNumber: _
|
|
411
411
|
} = o;
|
|
412
|
-
|
|
413
|
-
firstName:
|
|
412
|
+
g.value = E ?? "", u.firstName = k ?? "", u.lastName = P ?? "", d.value = O ?? "", m.value = _ ?? "", r.imageContent = await $e(), c.value = {
|
|
413
|
+
firstName: k ?? "",
|
|
414
414
|
lastName: P ?? ""
|
|
415
415
|
};
|
|
416
416
|
} catch (a) {
|
|
417
417
|
console.error("Критическая ошибка при загрузке профиля:", a);
|
|
418
418
|
}
|
|
419
|
-
},
|
|
419
|
+
}, $e = async () => {
|
|
420
420
|
var e;
|
|
421
421
|
try {
|
|
422
422
|
const o = (e = (await na("/users/profile/avatar")).data) == null ? void 0 : e.data;
|
|
423
|
-
return o ?
|
|
423
|
+
return o ? Me(o) : "";
|
|
424
424
|
} catch (a) {
|
|
425
425
|
return console.error("Ошибка при загрузке метаданных аватара:", a), "";
|
|
426
426
|
}
|
|
427
427
|
};
|
|
428
|
-
function
|
|
428
|
+
function Me(e) {
|
|
429
429
|
if (!e)
|
|
430
430
|
return "";
|
|
431
431
|
try {
|
|
@@ -434,17 +434,17 @@ const sa = {
|
|
|
434
434
|
return console.error("Ошибка при составлении URL аватара:", a), "";
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
-
const ie =
|
|
438
|
-
if (!
|
|
437
|
+
const ie = D(() => {
|
|
438
|
+
if (!c.value.firstName && !c.value.lastName)
|
|
439
439
|
return !1;
|
|
440
|
-
const e =
|
|
441
|
-
return
|
|
442
|
-
}),
|
|
440
|
+
const e = u.firstName.trim(), a = u.lastName.trim(), o = c.value.firstName.trim(), E = c.value.lastName.trim(), k = e !== o || a !== E, P = e.length >= 2 && a.length >= 2;
|
|
441
|
+
return k && P;
|
|
442
|
+
}), ze = async () => {
|
|
443
443
|
if (ie.value)
|
|
444
444
|
try {
|
|
445
|
-
await Promise.all([se("firstName"), se("lastName")]), n("on-update-jwt"),
|
|
445
|
+
await Promise.all([se("firstName"), se("lastName")]), n("on-update-jwt"), z({ color: "success", text: "Изменения сохранены" });
|
|
446
446
|
} catch (e) {
|
|
447
|
-
console.error(e),
|
|
447
|
+
console.error(e), z({
|
|
448
448
|
color: "error",
|
|
449
449
|
text: v("Не удалось сохранить изменения. Попробуйте позже")
|
|
450
450
|
});
|
|
@@ -455,10 +455,10 @@ const sa = {
|
|
|
455
455
|
return Ge(async () => {
|
|
456
456
|
if (!t.accessToken) throw new Error("Access token не передан в props");
|
|
457
457
|
if (!t.requestUrl) throw new Error("auth-backend url не передан в props");
|
|
458
|
-
oa(t.accessToken, t.requestUrl, t.throttlerPrefix), await
|
|
459
|
-
}), (e, a) => (b(),
|
|
458
|
+
oa(t.accessToken, t.requestUrl, t.throttlerPrefix), await xe();
|
|
459
|
+
}), (e, a) => (b(), U(pe, null, [
|
|
460
460
|
h(ia, {
|
|
461
|
-
language:
|
|
461
|
+
language: p.value,
|
|
462
462
|
provider: e.provider,
|
|
463
463
|
"disable-add-phone": e.disableAddPhone,
|
|
464
464
|
onCleanInputErrors: Be,
|
|
@@ -466,15 +466,15 @@ const sa = {
|
|
|
466
466
|
onUpdatePhoneField: ke,
|
|
467
467
|
onUpdateEmailField: Te,
|
|
468
468
|
onOnPasswordError: Ue,
|
|
469
|
-
onOnToast:
|
|
469
|
+
onOnToast: z
|
|
470
470
|
}, null, 8, ["language", "provider", "disable-add-phone"]),
|
|
471
471
|
Y("div", ua, [
|
|
472
|
-
S("avatar") ? (b(),
|
|
472
|
+
S("avatar") ? (b(), A(f(Ye), {
|
|
473
473
|
key: 0,
|
|
474
474
|
modelValue: r.value,
|
|
475
475
|
"onUpdate:modelValue": [
|
|
476
476
|
a[0] || (a[0] = (o) => r.value = o),
|
|
477
|
-
a[1] || (a[1] = (o) =>
|
|
477
|
+
a[1] || (a[1] = (o) => De(o))
|
|
478
478
|
],
|
|
479
479
|
type: "img",
|
|
480
480
|
class: "avatar-input",
|
|
@@ -483,135 +483,135 @@ const sa = {
|
|
|
483
483
|
label: v("Загрузить фото"),
|
|
484
484
|
"upload-limit": r.uploadLimit,
|
|
485
485
|
accept: "image/jpeg, image/png",
|
|
486
|
-
onDelete:
|
|
486
|
+
onDelete: Ie,
|
|
487
487
|
"onChange:error": Ae
|
|
488
488
|
}, {
|
|
489
|
-
afterLoadLabel:
|
|
490
|
-
X(
|
|
489
|
+
afterLoadLabel: x(() => [
|
|
490
|
+
X($(be.value), 1)
|
|
491
491
|
]),
|
|
492
|
-
subtext:
|
|
493
|
-
N.value ? (b(),
|
|
492
|
+
subtext: x(() => [
|
|
493
|
+
N.value ? (b(), U("span", da, $(N.value), 1)) : (b(), U("span", ma, $(`${v("Формат")} ${f(ta)(r.accept).join(", ")} ${v("до")} ${f(ea)(r.uploadLimit)}`), 1))
|
|
494
494
|
]),
|
|
495
495
|
_: 1
|
|
496
|
-
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) :
|
|
497
|
-
S("firstName") ? (b(),
|
|
498
|
-
h(
|
|
499
|
-
modelValue:
|
|
500
|
-
"onUpdate:modelValue": a[2] || (a[2] = (o) =>
|
|
496
|
+
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : T("", !0),
|
|
497
|
+
S("firstName") ? (b(), U("div", pa, [
|
|
498
|
+
h(f(M), {
|
|
499
|
+
modelValue: u.firstName,
|
|
500
|
+
"onUpdate:modelValue": a[2] || (a[2] = (o) => u.firstName = o),
|
|
501
501
|
size: "large",
|
|
502
502
|
label: v("Имя"),
|
|
503
503
|
error: ge.value,
|
|
504
|
-
onBlur: a[3] || (a[3] = (o) =>
|
|
504
|
+
onBlur: a[3] || (a[3] = (o) => s.firstName = !0),
|
|
505
505
|
onInput: a[4] || (a[4] = (o) => L("firstName"))
|
|
506
506
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
507
|
-
h(
|
|
508
|
-
])) :
|
|
509
|
-
S("lastName") ? (b(),
|
|
510
|
-
h(
|
|
511
|
-
modelValue:
|
|
512
|
-
"onUpdate:modelValue": a[5] || (a[5] = (o) =>
|
|
507
|
+
h(f(R), { class: "icon-locked" })
|
|
508
|
+
])) : T("", !0),
|
|
509
|
+
S("lastName") ? (b(), U("div", ca, [
|
|
510
|
+
h(f(M), {
|
|
511
|
+
modelValue: u.lastName,
|
|
512
|
+
"onUpdate:modelValue": a[5] || (a[5] = (o) => u.lastName = o),
|
|
513
513
|
size: "large",
|
|
514
514
|
label: v("Фамилия"),
|
|
515
515
|
error: ve.value,
|
|
516
|
-
onBlur: a[6] || (a[6] = (o) =>
|
|
516
|
+
onBlur: a[6] || (a[6] = (o) => s.lastName = !0),
|
|
517
517
|
onInput: a[7] || (a[7] = (o) => L("lastName"))
|
|
518
518
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
519
|
-
h(
|
|
520
|
-
])) :
|
|
521
|
-
S("email") ? (b(),
|
|
522
|
-
h(
|
|
523
|
-
modelValue:
|
|
524
|
-
"onUpdate:modelValue": a[8] || (a[8] = (o) =>
|
|
519
|
+
h(f(R), { class: "icon-locked" })
|
|
520
|
+
])) : T("", !0),
|
|
521
|
+
S("email") ? (b(), U("div", fa, [
|
|
522
|
+
h(f(M), {
|
|
523
|
+
modelValue: d.value,
|
|
524
|
+
"onUpdate:modelValue": a[8] || (a[8] = (o) => d.value = o),
|
|
525
525
|
size: "large",
|
|
526
526
|
"text-size": "medium",
|
|
527
527
|
label: "E-mail",
|
|
528
528
|
type: "email",
|
|
529
529
|
readonly: "",
|
|
530
530
|
style: { cursor: "pointer" },
|
|
531
|
-
error: he.value &&
|
|
532
|
-
onBlur: a[9] || (a[9] = (o) =>
|
|
531
|
+
error: he.value && F.value,
|
|
532
|
+
onBlur: a[9] || (a[9] = (o) => s.email = !0),
|
|
533
533
|
onInput: a[10] || (a[10] = (o) => L("email")),
|
|
534
534
|
onClick: Pe
|
|
535
535
|
}, null, 8, ["modelValue", "error"]),
|
|
536
|
-
h(
|
|
537
|
-
])) :
|
|
538
|
-
S("phone") ? (b(),
|
|
539
|
-
h(
|
|
540
|
-
modelValue:
|
|
541
|
-
"onUpdate:modelValue": a[11] || (a[11] = (o) =>
|
|
536
|
+
h(f(R), { class: "icon-locked" })
|
|
537
|
+
])) : T("", !0),
|
|
538
|
+
S("phone") ? (b(), U("div", ga, [
|
|
539
|
+
h(f(M), {
|
|
540
|
+
modelValue: m.value,
|
|
541
|
+
"onUpdate:modelValue": a[11] || (a[11] = (o) => m.value = o),
|
|
542
542
|
size: "large",
|
|
543
543
|
"text-size": "medium",
|
|
544
544
|
label: v("Номер телефона"),
|
|
545
545
|
type: "tel",
|
|
546
546
|
readonly: "",
|
|
547
547
|
style: { cursor: "pointer" },
|
|
548
|
-
error: ye.value &&
|
|
549
|
-
onBlur: a[12] || (a[12] = (o) =>
|
|
548
|
+
error: ye.value && I.value,
|
|
549
|
+
onBlur: a[12] || (a[12] = (o) => s.phone = !0),
|
|
550
550
|
onInput: a[13] || (a[13] = (o) => L("phone")),
|
|
551
551
|
onClick: Ne
|
|
552
552
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
553
|
-
h(
|
|
554
|
-
])) :
|
|
553
|
+
h(f(R), { class: "icon-locked" })
|
|
554
|
+
])) : T("", !0),
|
|
555
555
|
Y("div", va, [
|
|
556
|
-
we.value ? (b(),
|
|
556
|
+
we.value ? (b(), A(f(de), {
|
|
557
557
|
key: 0,
|
|
558
558
|
color: "secondary",
|
|
559
559
|
onClick: Le
|
|
560
560
|
}, {
|
|
561
|
-
default:
|
|
562
|
-
X(
|
|
561
|
+
default: x(() => [
|
|
562
|
+
X($(v("Сменить пароль")), 1)
|
|
563
563
|
]),
|
|
564
564
|
_: 1
|
|
565
|
-
})) :
|
|
566
|
-
h(
|
|
565
|
+
})) : T("", !0),
|
|
566
|
+
h(f(de), {
|
|
567
567
|
disabled: !ie.value,
|
|
568
|
-
onClick:
|
|
568
|
+
onClick: ze
|
|
569
569
|
}, {
|
|
570
|
-
default:
|
|
571
|
-
X(
|
|
570
|
+
default: x(() => [
|
|
571
|
+
X($(v("Сохранить")), 1)
|
|
572
572
|
]),
|
|
573
573
|
_: 1
|
|
574
574
|
}, 8, ["disabled"])
|
|
575
575
|
])
|
|
576
576
|
]),
|
|
577
|
-
y.value ? (b(),
|
|
577
|
+
y.value ? (b(), A(ue, {
|
|
578
578
|
key: 0,
|
|
579
579
|
to: "body"
|
|
580
580
|
}, [
|
|
581
|
-
y.value ? (b(),
|
|
582
|
-
h(
|
|
581
|
+
y.value ? (b(), U("div", ha, [
|
|
582
|
+
h(f(Xe), {
|
|
583
583
|
"circle-mode": !0,
|
|
584
584
|
"model-value": r.imageContent,
|
|
585
|
-
onClose:
|
|
586
|
-
onSave: a[14] || (a[14] = (o) =>
|
|
585
|
+
onClose: Fe,
|
|
586
|
+
onSave: a[14] || (a[14] = (o) => Ve(o)),
|
|
587
587
|
"onUpdate:modelValue": a[15] || (a[15] = (o) => Se(o))
|
|
588
588
|
}, null, 8, ["model-value"])
|
|
589
|
-
])) :
|
|
590
|
-
])) :
|
|
591
|
-
(b(),
|
|
589
|
+
])) : T("", !0)
|
|
590
|
+
])) : T("", !0),
|
|
591
|
+
(b(), A(ue, { to: "#toast-root" }, [
|
|
592
592
|
Y("div", ya, [
|
|
593
593
|
h(je, { name: "list" }, {
|
|
594
|
-
default:
|
|
595
|
-
Je(h(
|
|
594
|
+
default: x(() => [
|
|
595
|
+
Je(h(f(Ke), {
|
|
596
596
|
class: "toast",
|
|
597
|
-
color:
|
|
597
|
+
color: V.value,
|
|
598
598
|
text: ae.value,
|
|
599
|
-
onClose: a[16] || (a[16] = (o) =>
|
|
599
|
+
onClose: a[16] || (a[16] = (o) => C.value = !1)
|
|
600
600
|
}, null, 8, ["color", "text"]), [
|
|
601
|
-
[qe,
|
|
601
|
+
[qe, C.value]
|
|
602
602
|
])
|
|
603
603
|
]),
|
|
604
604
|
_: 1
|
|
605
605
|
})
|
|
606
606
|
])
|
|
607
607
|
])),
|
|
608
|
-
h(
|
|
608
|
+
h(f(ce))
|
|
609
609
|
], 64));
|
|
610
610
|
}
|
|
611
|
-
}), fe = (
|
|
612
|
-
const t =
|
|
613
|
-
for (const [n,
|
|
614
|
-
t[n] =
|
|
611
|
+
}), fe = (l, i) => {
|
|
612
|
+
const t = l.__vccOpts || l;
|
|
613
|
+
for (const [n, p] of i)
|
|
614
|
+
t[n] = p;
|
|
615
615
|
return t;
|
|
616
616
|
}, ba = /* @__PURE__ */ fe(wa, [["__scopeId", "data-v-a56fcdbb"]]), Ma = /* @__PURE__ */ j({
|
|
617
617
|
__name: "index",
|
|
@@ -627,60 +627,63 @@ const sa = {
|
|
|
627
627
|
disableAddPhone: { type: Boolean }
|
|
628
628
|
},
|
|
629
629
|
emits: ["on-update-jwt", "update-tokens"],
|
|
630
|
-
setup(
|
|
631
|
-
const t = i, { openDialog: n } = ee(),
|
|
632
|
-
n("email", { initialEmail:
|
|
633
|
-
}, v = (
|
|
634
|
-
n("phone", { initialPhone:
|
|
635
|
-
},
|
|
630
|
+
setup(l, { emit: i }) {
|
|
631
|
+
const t = i, { openDialog: n } = ee(), p = (c, s) => {
|
|
632
|
+
n("email", { initialEmail: c, mode: s });
|
|
633
|
+
}, v = (c, s) => {
|
|
634
|
+
n("phone", { initialPhone: c, mode: s });
|
|
635
|
+
}, B = () => {
|
|
636
636
|
n("password");
|
|
637
|
-
},
|
|
638
|
-
t("on-update-jwt",
|
|
637
|
+
}, u = (c, s, g) => {
|
|
638
|
+
t("on-update-jwt", c, s, g);
|
|
639
639
|
};
|
|
640
|
-
return (
|
|
641
|
-
h(
|
|
640
|
+
return (c, s) => (b(), U(pe, null, [
|
|
641
|
+
h(f(Ze)),
|
|
642
642
|
h(ba, {
|
|
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:
|
|
643
|
+
"throttler-prefix": c.throttlerPrefix,
|
|
644
|
+
provider: c.provider,
|
|
645
|
+
"request-url": c.requestUrl,
|
|
646
|
+
language: c.language,
|
|
647
|
+
fields: c.fields,
|
|
648
|
+
"access-token": c.accessToken,
|
|
649
|
+
"refresh-token": c.refreshToken,
|
|
650
|
+
"aws-storage-url": c.awsStorageUrl,
|
|
651
|
+
"disable-add-phone": c.disableAddPhone,
|
|
652
|
+
onOpenEmailDialog: p,
|
|
653
653
|
onOpenPhoneDialog: v,
|
|
654
|
-
onOpenPasswordDialog:
|
|
655
|
-
onOnUpdateJwt:
|
|
654
|
+
onOpenPasswordDialog: B,
|
|
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
|
-
h(
|
|
657
|
+
h(f(ce))
|
|
658
658
|
], 64));
|
|
659
659
|
}
|
|
660
660
|
}), Ea = 10, Pa = 15;
|
|
661
|
-
function Na(
|
|
662
|
-
let n =
|
|
661
|
+
function Na(l, i, t) {
|
|
662
|
+
let n = l.replace(/[^\d+]/g, "");
|
|
663
663
|
return t != null && t.startsWith("ru") && n.startsWith("8") ? n = `+7${n.slice(1)}` : i && n && !n.startsWith("+") && (n = `+${n}`), n;
|
|
664
664
|
}
|
|
665
|
-
function Ca(
|
|
666
|
-
|
|
665
|
+
function Ca(l) {
|
|
666
|
+
return l.startsWith("+") ? l.slice(1).replace(/\D/g, "") : l.replace(/\D/g, "");
|
|
667
|
+
}
|
|
668
|
+
function ka(l, i = Ea, t = Pa) {
|
|
669
|
+
if (!l.startsWith("+"))
|
|
667
670
|
return !1;
|
|
668
|
-
const n =
|
|
671
|
+
const n = l.slice(1);
|
|
669
672
|
return !(!/^\d+$/.test(n) || n.length < i || n.length > t);
|
|
670
673
|
}
|
|
671
|
-
function
|
|
672
|
-
return /[^\d+]/.test(
|
|
674
|
+
function Ta(l) {
|
|
675
|
+
return /[^\d+]/.test(l);
|
|
673
676
|
}
|
|
674
|
-
const
|
|
675
|
-
function
|
|
676
|
-
return
|
|
677
|
+
const Ua = /^[\w.%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;
|
|
678
|
+
function Ba(l) {
|
|
679
|
+
return Ua.test(l);
|
|
677
680
|
}
|
|
678
|
-
function
|
|
679
|
-
var n,
|
|
680
|
-
const t =
|
|
681
|
-
return (n = i.phone) != null && n.enabled && (t.startsWith("+") || /^\d+$/.test(t)) ? "phone" : (
|
|
681
|
+
function Da(l, i) {
|
|
682
|
+
var n, p;
|
|
683
|
+
const t = l.trim();
|
|
684
|
+
return (n = i.phone) != null && n.enabled && (t.startsWith("+") || /^\d+$/.test(t)) ? "phone" : (p = i.email) != null && p.enabled ? "email" : null;
|
|
682
685
|
}
|
|
683
|
-
const Ia = { class: "smart-input" },
|
|
686
|
+
const Ia = { class: "smart-input" }, Aa = /* @__PURE__ */ j({
|
|
684
687
|
__name: "index",
|
|
685
688
|
props: {
|
|
686
689
|
modelValue: {},
|
|
@@ -693,60 +696,71 @@ const Ia = { class: "smart-input" }, Da = /* @__PURE__ */ j({
|
|
|
693
696
|
errorMessages: {}
|
|
694
697
|
},
|
|
695
698
|
emits: ["update:modelValue", "validity-change", "type-change"],
|
|
696
|
-
setup(
|
|
697
|
-
const t =
|
|
698
|
-
var
|
|
699
|
+
setup(l, { emit: i }) {
|
|
700
|
+
const t = l, n = i, p = D(() => {
|
|
701
|
+
var s, g, d, m, y, r, N, C, I, F, V;
|
|
699
702
|
return {
|
|
700
|
-
mode: ((
|
|
703
|
+
mode: ((s = t.config) == null ? void 0 : s.mode) ?? "auto",
|
|
701
704
|
phone: {
|
|
702
|
-
enabled: ((
|
|
703
|
-
minDigits: ((y = (
|
|
705
|
+
enabled: ((d = (g = t.config) == null ? void 0 : g.phone) == null ? void 0 : d.enabled) ?? !0,
|
|
706
|
+
minDigits: ((y = (m = t.config) == null ? void 0 : m.phone) == null ? void 0 : y.minDigits) ?? 10,
|
|
704
707
|
maxDigits: ((N = (r = t.config) == null ? void 0 : r.phone) == null ? void 0 : N.maxDigits) ?? 15,
|
|
705
|
-
autoPlus: ((
|
|
708
|
+
autoPlus: ((I = (C = t.config) == null ? void 0 : C.phone) == null ? void 0 : I.autoPlus) ?? !0
|
|
706
709
|
},
|
|
707
710
|
email: {
|
|
708
|
-
enabled: ((
|
|
711
|
+
enabled: ((V = (F = t.config) == null ? void 0 : F.email) == null ? void 0 : V.enabled) ?? !0
|
|
709
712
|
}
|
|
710
713
|
};
|
|
711
|
-
}), v = w(t.modelValue ?? ""),
|
|
712
|
-
me(() => t.modelValue, (
|
|
713
|
-
|
|
714
|
+
}), v = w(t.modelValue ?? ""), B = w(null), u = w("");
|
|
715
|
+
me(() => t.modelValue, (s) => {
|
|
716
|
+
s !== void 0 && (v.value = s);
|
|
714
717
|
});
|
|
715
|
-
function
|
|
718
|
+
function c(s) {
|
|
716
719
|
var y, r, N;
|
|
717
|
-
if (
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
let
|
|
721
|
-
|
|
720
|
+
if (u.value = "", typeof s != "string") return;
|
|
721
|
+
const g = p.value.mode === "auto" ? Da(s, p.value) : p.value.mode;
|
|
722
|
+
B.value = g, n("type-change", g);
|
|
723
|
+
let d = s, m = !0;
|
|
724
|
+
if (g === "phone") {
|
|
725
|
+
const C = Na(
|
|
726
|
+
s,
|
|
727
|
+
p.value.phone.autoPlus,
|
|
728
|
+
t.locale
|
|
729
|
+
);
|
|
730
|
+
if (Ca(C).length > p.value.phone.maxDigits)
|
|
731
|
+
return;
|
|
732
|
+
Ta(s) && (u.value = ((y = t.errorMessages) == null ? void 0 : y.invalidPhoneChars) ?? "Допустимы только цифры и знак +", m = !1), ka(
|
|
733
|
+
C,
|
|
734
|
+
p.value.phone.minDigits,
|
|
735
|
+
p.value.phone.maxDigits
|
|
736
|
+
) || (u.value || (u.value = ((r = t.errorMessages) == null ? void 0 : r.invalidPhoneLength) ?? "Это не похоже на номер телефона"), m = !1), d = C, n("validity-change", m);
|
|
737
|
+
}
|
|
738
|
+
g === "email" && (m = Ba(s), m || (u.value = ((N = t.errorMessages) == null ? void 0 : N.invalidEmail) ?? "Это не похоже на email"), n("validity-change", m)), v.value = d, n("update:modelValue", d);
|
|
722
739
|
}
|
|
723
|
-
return (
|
|
724
|
-
h(
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
label: l.label ?? "Email или телефон"
|
|
735
|
-
}, null, 8, ["modelValue", "readonly", "error", "type", "size", "label"]),
|
|
736
|
-
U.value === "phone" ? (b(), D(g(He), {
|
|
740
|
+
return (s, g) => (b(), U("div", Ia, [
|
|
741
|
+
h(f(M), {
|
|
742
|
+
"model-value": v.value,
|
|
743
|
+
readonly: s.disabled,
|
|
744
|
+
error: u.value,
|
|
745
|
+
type: s.type ?? "text",
|
|
746
|
+
size: s.size ?? "large",
|
|
747
|
+
label: s.label ?? "Email или телефон",
|
|
748
|
+
"onUpdate:modelValue": c
|
|
749
|
+
}, null, 8, ["model-value", "readonly", "error", "type", "size", "label"]),
|
|
750
|
+
B.value === "phone" ? (b(), A(f(He), {
|
|
737
751
|
key: 0,
|
|
738
752
|
class: "smart-input__icon"
|
|
739
|
-
})) :
|
|
740
|
-
|
|
753
|
+
})) : T("", !0),
|
|
754
|
+
B.value === "email" ? (b(), A(f(Qe), {
|
|
741
755
|
key: 1,
|
|
742
756
|
class: "smart-input__icon"
|
|
743
|
-
})) :
|
|
757
|
+
})) : T("", !0)
|
|
744
758
|
]));
|
|
745
759
|
}
|
|
746
|
-
}), za = /* @__PURE__ */ fe(
|
|
760
|
+
}), za = /* @__PURE__ */ fe(Aa, [["__scopeId", "data-v-5b8be878"]]);
|
|
747
761
|
export {
|
|
748
762
|
$a as B,
|
|
749
|
-
|
|
763
|
+
xa as C,
|
|
750
764
|
fe as _,
|
|
751
765
|
Ma as a,
|
|
752
766
|
na as g,
|
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 e=document.createElement("style");e.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-5b8be878]{position:relative;width:100%}.smart-input__icon[data-v-5b8be878]{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-CfmFrMSL.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-CfmFrMSL.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")}`;
|