@yourgoods/ui-smart 0.53.40 → 0.53.41
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-qxT8FfU4.js → ProfileEmailDialog-4HkiA_2Q.js} +2 -2
- package/dist/{ProfilePasswordDialog-BtEJQ1DH.js → ProfilePasswordDialog-s_Sl_ble.js} +1 -1
- package/dist/{ProfilePhoneDialog-BG0Ir2WE.js → ProfilePhoneDialog-onT68yJt.js} +2 -2
- package/dist/{index-uvkFVxI2.js → index-AKLe2RA9.js} +112 -112
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-DECY6G57.js → useRateLimitToast-BUp9bvlH.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-BUp9bvlH.js";
|
|
3
|
+
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-AKLe2RA9.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-AKLe2RA9.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-BUp9bvlH.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-AKLe2RA9.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 We, defineComponent as ee, defineAsyncComponent as te, watch as Ne, createBlock as $, createCommentVNode as D, unref as
|
|
1
|
+
import { ref as E, shallowRef as We, defineComponent as ee, defineAsyncComponent as te, watch as Ne, createBlock as $, createCommentVNode as D, unref as f, openBlock as N, resolveDynamicComponent as Ye, mergeProps as Ke, computed as I, reactive as ae, onMounted as Xe, createElementBlock as V, Fragment as Ce, createVNode as b, createElementVNode as ne, withCtx as O, toDisplayString as G, createTextVNode as oe, Teleport as he, Transition as He, withDirectives as Ze, vShow as Qe } from "vue";
|
|
2
2
|
import et from "axios";
|
|
3
3
|
import { PInputFileUploader as tt, PInput as j, IconFilledEditMd as Z, PButton as ye, PImageCropper as at, PToast as nt, PTeleportContainer as ke, PToastContainer as ot, IconPhoneMd as rt, IconMailMd as lt } from "@profeat/ui-kit";
|
|
4
4
|
function st(l, s = 2) {
|
|
5
5
|
if (l === 0)
|
|
6
6
|
return "0 B";
|
|
7
|
-
const a = 1024, n = ["B", "KB", "MB", "GB", "TB", "PB", "EB"],
|
|
8
|
-
return `${Number.parseFloat((l / a **
|
|
7
|
+
const a = 1024, n = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], g = Math.floor(Math.log(l) / Math.log(a));
|
|
8
|
+
return `${Number.parseFloat((l / a ** g).toFixed(s))} ${n[g]}`;
|
|
9
9
|
}
|
|
10
10
|
const it = {
|
|
11
11
|
"image/jpeg": "JPEG",
|
|
@@ -49,10 +49,10 @@ function de() {
|
|
|
49
49
|
async function ie(l, s, a) {
|
|
50
50
|
return de().post(l, s, a);
|
|
51
51
|
}
|
|
52
|
-
async function
|
|
52
|
+
async function mt(l, s) {
|
|
53
53
|
return de().get(l, s);
|
|
54
54
|
}
|
|
55
|
-
async function
|
|
55
|
+
async function ct(l, s) {
|
|
56
56
|
return de().delete(l, s);
|
|
57
57
|
}
|
|
58
58
|
async function pt(l) {
|
|
@@ -62,12 +62,12 @@ async function pt(l) {
|
|
|
62
62
|
return s.data;
|
|
63
63
|
}
|
|
64
64
|
const Q = E(null), re = We(null);
|
|
65
|
-
function
|
|
65
|
+
function me() {
|
|
66
66
|
return {
|
|
67
67
|
currentDialog: Q,
|
|
68
68
|
dialogPayload: re,
|
|
69
|
-
openDialog: (n,
|
|
70
|
-
Q.value = n, re.value =
|
|
69
|
+
openDialog: (n, g) => {
|
|
70
|
+
Q.value = n, re.value = g ?? null;
|
|
71
71
|
},
|
|
72
72
|
closeDialog: () => {
|
|
73
73
|
Q.value = null, re.value = null;
|
|
@@ -225,32 +225,32 @@ const ue = {
|
|
|
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: te(() => import("./ProfileEmailDialog-
|
|
230
|
-
phone: te(() => import("./ProfilePhoneDialog-
|
|
231
|
-
password: te(() => import("./ProfilePasswordDialog-
|
|
228
|
+
const a = s, n = E(!0), { currentDialog: g, dialogPayload: v, closeDialog: S } = me(), p = {
|
|
229
|
+
email: te(() => import("./ProfileEmailDialog-4HkiA_2Q.js")),
|
|
230
|
+
phone: te(() => import("./ProfilePhoneDialog-onT68yJt.js")),
|
|
231
|
+
password: te(() => import("./ProfilePasswordDialog-s_Sl_ble.js"))
|
|
232
232
|
}, i = ({ email: P }) => {
|
|
233
233
|
a("update-email-field", P);
|
|
234
234
|
}, h = ({ phone: P }) => {
|
|
235
235
|
a("update-phone-field", P);
|
|
236
236
|
};
|
|
237
|
-
return Ne(
|
|
237
|
+
return Ne(g, (P) => {
|
|
238
238
|
n.value = !!P;
|
|
239
|
-
}), (P,
|
|
239
|
+
}), (P, m) => f(g) ? (N(), $(Ye(p[f(g)]), Ke({
|
|
240
240
|
key: 0,
|
|
241
241
|
modelValue: n.value,
|
|
242
|
-
"onUpdate:modelValue":
|
|
242
|
+
"onUpdate:modelValue": m[0] || (m[0] = (d) => n.value = d),
|
|
243
243
|
language: P.language,
|
|
244
244
|
provider: P.provider,
|
|
245
245
|
"disable-add-phone": P.disableAddPhone
|
|
246
|
-
},
|
|
247
|
-
onClose:
|
|
248
|
-
onCleanInputErrors:
|
|
249
|
-
onOnUpdateJwt:
|
|
246
|
+
}, f(v), {
|
|
247
|
+
onClose: f(S),
|
|
248
|
+
onCleanInputErrors: m[1] || (m[1] = (d) => a("clean-input-errors")),
|
|
249
|
+
onOnUpdateJwt: m[2] || (m[2] = (d, w, o) => a("on-update-jwt", d, w, o)),
|
|
250
250
|
onSubmitEmail: i,
|
|
251
251
|
onSubmitPhone: h,
|
|
252
|
-
onOnPasswordError:
|
|
253
|
-
onOnToast:
|
|
252
|
+
onOnPasswordError: m[3] || (m[3] = (d, w) => a("on-password-error", d, w)),
|
|
253
|
+
onOnToast: m[4] || (m[4] = (d) => a("on-toast", d))
|
|
254
254
|
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : D("", !0);
|
|
255
255
|
}
|
|
256
256
|
}), gt = { class: "base-container" }, vt = {
|
|
@@ -286,7 +286,7 @@ const ue = {
|
|
|
286
286
|
},
|
|
287
287
|
emits: ["open-email-dialog", "open-phone-dialog", "open-password-dialog", "on-update-jwt", "on-password-error", "update-tokens"],
|
|
288
288
|
setup(l, { emit: s }) {
|
|
289
|
-
const a = l, n = s,
|
|
289
|
+
const a = l, n = s, g = I(() => a.language ?? "ru"), v = (e) => ue[g.value][e] || e, { openDialog: S } = me(), p = ae({ firstName: "", lastName: "" }), i = E({ firstName: "", lastName: "" }), h = ae({ firstName: !1, lastName: !1, email: !1, phone: !1 }), P = E(""), m = E(""), d = E(""), w = E(!1), o = ae({
|
|
290
290
|
value: null,
|
|
291
291
|
loading: !1,
|
|
292
292
|
accept: ["image/png", "image/jpeg"],
|
|
@@ -294,23 +294,23 @@ const ue = {
|
|
|
294
294
|
// 10 MB
|
|
295
295
|
imageBinary: null,
|
|
296
296
|
imageContent: ""
|
|
297
|
-
}), x = E(""), z = E(!1), L = E(!0), _ = E(!0), q = E(void 0), u = E(""), y = I(() => R(
|
|
297
|
+
}), x = E(""), z = E(!1), L = E(!0), _ = E(!0), q = E(void 0), u = E(""), y = I(() => R(p.firstName, h.firstName)), c = I(() => R(p.lastName, h.lastName)), A = I(() => h.email && !m.value.trim() ? "Введите e-mail" : ""), k = I(() => h.phone && !d.value.trim() ? "Введите номер телефона" : ""), F = (e) => a.fields.some((t) => t.key === e), M = (e) => e && e.trim() ? "edit" : "bind", U = () => setTimeout(() => {
|
|
298
298
|
var e;
|
|
299
299
|
return (e = document.activeElement) == null ? void 0 : e.blur();
|
|
300
|
-
}, 0), J = I(() => !!(
|
|
300
|
+
}, 0), J = I(() => !!(m.value && m.value.trim() !== "")), W = I(() => o.imageContent ? v("Загрузить другое фото") : v("Загрузить фото")), R = (e, t) => {
|
|
301
301
|
if (!t) return "";
|
|
302
302
|
const r = e.trim();
|
|
303
303
|
return r ? r.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
|
|
304
304
|
}, Be = (e) => S("email", { mode: e ? "edit" : "bind", initialEmail: e }), De = () => {
|
|
305
|
-
U(), h.email = !1, _.value = !1, n("open-email-dialog",
|
|
305
|
+
U(), h.email = !1, _.value = !1, n("open-email-dialog", m.value, M(m.value)), Be(m.value);
|
|
306
306
|
}, Ue = () => {
|
|
307
307
|
U(), h.phone = !1, L.value = !1, n("open-phone-dialog", d.value, M(d.value));
|
|
308
308
|
}, Ve = async (e, t, r) => {
|
|
309
|
-
e === "email" && r && (
|
|
309
|
+
e === "email" && r && (m.value = r), e === "phone" && r && (d.value = r), n("on-update-jwt");
|
|
310
310
|
}, Ae = (e) => {
|
|
311
311
|
d.value = e;
|
|
312
312
|
}, Fe = (e) => {
|
|
313
|
-
|
|
313
|
+
m.value = e;
|
|
314
314
|
}, Se = (e, t) => {
|
|
315
315
|
z.value = !0, n("on-password-error", e, t);
|
|
316
316
|
}, xe = () => {
|
|
@@ -319,26 +319,26 @@ const ue = {
|
|
|
319
319
|
z.value = !0, q.value = e.color ?? "", u.value = e.text ?? "";
|
|
320
320
|
}, K = (e) => {
|
|
321
321
|
if (h[e] = !0, e === "firstName" || e === "lastName") {
|
|
322
|
-
const t =
|
|
323
|
-
t.length > 40 && (
|
|
322
|
+
const t = p[e];
|
|
323
|
+
t.length > 40 && (p[e] = t.slice(0, 40));
|
|
324
324
|
}
|
|
325
325
|
}, Me = (e) => {
|
|
326
326
|
var X, H;
|
|
327
327
|
if (x.value = "", !e) {
|
|
328
|
-
|
|
328
|
+
ce();
|
|
329
329
|
return;
|
|
330
330
|
}
|
|
331
331
|
const t = ((X = e.fileBinary) == null ? void 0 : X.type) ?? "", r = ((H = e.fileBinary) == null ? void 0 : H.size) ?? 0, B = !["image/png", "image/jpeg"].includes(t), T = r > o.uploadLimit;
|
|
332
332
|
if (B || T) {
|
|
333
|
-
x.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ",
|
|
333
|
+
x.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", ce();
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
336
|
o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "", w.value = !0;
|
|
337
|
-
},
|
|
337
|
+
}, ce = () => {
|
|
338
338
|
o.value = null, o.imageBinary = null, o.imageContent = "", w.value = !1;
|
|
339
339
|
}, $e = async () => {
|
|
340
340
|
try {
|
|
341
|
-
const t = (await
|
|
341
|
+
const t = (await ct("/users/profile/delete/avatar")).data;
|
|
342
342
|
return (t == null ? void 0 : t.success) === !0;
|
|
343
343
|
} catch (e) {
|
|
344
344
|
return console.error("Ошибка при удалении аватара:", e), !1;
|
|
@@ -371,7 +371,7 @@ const ue = {
|
|
|
371
371
|
} catch (C) {
|
|
372
372
|
console.error(C), Y({
|
|
373
373
|
color: "error",
|
|
374
|
-
text:
|
|
374
|
+
text: v("Не удалось сохранить изменения. Попробуйте позже")
|
|
375
375
|
}), o.imageContent = t;
|
|
376
376
|
} finally {
|
|
377
377
|
o.loading = !1;
|
|
@@ -384,14 +384,14 @@ const ue = {
|
|
|
384
384
|
));
|
|
385
385
|
}, fe = E(!1), ge = async (e) => {
|
|
386
386
|
var r, C;
|
|
387
|
-
const t = (r =
|
|
387
|
+
const t = (r = p[e]) == null ? void 0 : r.trim();
|
|
388
388
|
if (t)
|
|
389
389
|
try {
|
|
390
390
|
fe.value = !0;
|
|
391
391
|
const T = (C = (await ie("/users/profile/update-name", { [e]: t })).data) == null ? void 0 : C.data;
|
|
392
|
-
T != null && T.user && (
|
|
393
|
-
firstName:
|
|
394
|
-
lastName:
|
|
392
|
+
T != null && T.user && (p.firstName = T.user.firstName ?? p.firstName, p.lastName = T.user.lastName ?? p.lastName, i.value = {
|
|
393
|
+
firstName: p.firstName,
|
|
394
|
+
lastName: p.lastName
|
|
395
395
|
});
|
|
396
396
|
} catch (B) {
|
|
397
397
|
throw B;
|
|
@@ -417,7 +417,7 @@ const ue = {
|
|
|
417
417
|
email: X,
|
|
418
418
|
phoneNumber: H
|
|
419
419
|
} = r;
|
|
420
|
-
P.value = C ?? "",
|
|
420
|
+
P.value = C ?? "", p.firstName = B ?? "", p.lastName = T ?? "", m.value = X ?? "", d.value = H ?? "", o.imageContent = await Ge(), i.value = {
|
|
421
421
|
firstName: B ?? "",
|
|
422
422
|
lastName: T ?? ""
|
|
423
423
|
};
|
|
@@ -427,7 +427,7 @@ const ue = {
|
|
|
427
427
|
}, Ge = async () => {
|
|
428
428
|
var e;
|
|
429
429
|
try {
|
|
430
|
-
const r = (e = (await
|
|
430
|
+
const r = (e = (await mt("/users/profile/avatar")).data) == null ? void 0 : e.data;
|
|
431
431
|
return r ? je(r) : "";
|
|
432
432
|
} catch (t) {
|
|
433
433
|
return console.error("Ошибка при загрузке метаданных аватара:", t), "";
|
|
@@ -445,7 +445,7 @@ const ue = {
|
|
|
445
445
|
const ve = I(() => {
|
|
446
446
|
if (!i.value.firstName && !i.value.lastName)
|
|
447
447
|
return !1;
|
|
448
|
-
const e =
|
|
448
|
+
const e = p.firstName.trim(), t = p.lastName.trim(), r = i.value.firstName.trim(), C = i.value.lastName.trim(), B = e !== r || t !== C, T = e.length >= 2 && t.length >= 2;
|
|
449
449
|
return B && T;
|
|
450
450
|
}), qe = async () => {
|
|
451
451
|
if (ve.value)
|
|
@@ -454,7 +454,7 @@ const ue = {
|
|
|
454
454
|
} catch (e) {
|
|
455
455
|
console.error(e), Y({
|
|
456
456
|
color: "error",
|
|
457
|
-
text:
|
|
457
|
+
text: v("Не удалось сохранить изменения. Попробуйте позже")
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
460
|
}, Je = () => {
|
|
@@ -466,7 +466,7 @@ const ue = {
|
|
|
466
466
|
dt(a.accessToken, a.requestUrl, a.throttlerPrefix), await Oe();
|
|
467
467
|
}), (e, t) => (N(), V(Ce, null, [
|
|
468
468
|
b(ft, {
|
|
469
|
-
language:
|
|
469
|
+
language: g.value,
|
|
470
470
|
provider: e.provider,
|
|
471
471
|
"disable-add-phone": e.disableAddPhone,
|
|
472
472
|
onCleanInputErrors: xe,
|
|
@@ -477,7 +477,7 @@ const ue = {
|
|
|
477
477
|
onOnToast: Y
|
|
478
478
|
}, null, 8, ["language", "provider", "disable-add-phone"]),
|
|
479
479
|
ne("div", gt, [
|
|
480
|
-
F("avatar") ? (N(), $(
|
|
480
|
+
F("avatar") ? (N(), $(f(tt), {
|
|
481
481
|
key: 0,
|
|
482
482
|
modelValue: o.value,
|
|
483
483
|
"onUpdate:modelValue": [
|
|
@@ -488,7 +488,7 @@ const ue = {
|
|
|
488
488
|
class: "avatar-input",
|
|
489
489
|
src: o.imageContent,
|
|
490
490
|
loading: o.loading,
|
|
491
|
-
label:
|
|
491
|
+
label: v("Загрузить фото"),
|
|
492
492
|
"upload-limit": o.uploadLimit,
|
|
493
493
|
accept: "image/jpeg, image/png",
|
|
494
494
|
onDelete: $e,
|
|
@@ -498,38 +498,38 @@ const ue = {
|
|
|
498
498
|
oe(G(W.value), 1)
|
|
499
499
|
]),
|
|
500
500
|
subtext: O(() => [
|
|
501
|
-
x.value ? (N(), V("span", vt, G(x.value), 1)) : (N(), V("span", ht, G(`${
|
|
501
|
+
x.value ? (N(), V("span", vt, G(x.value), 1)) : (N(), V("span", ht, G(`${v("Формат")} ${f(ut)(o.accept).join(", ")} ${v("до")} ${f(st)(o.uploadLimit)}`), 1))
|
|
502
502
|
]),
|
|
503
503
|
_: 1
|
|
504
504
|
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : D("", !0),
|
|
505
505
|
F("firstName") ? (N(), V("div", yt, [
|
|
506
|
-
b(
|
|
507
|
-
modelValue:
|
|
508
|
-
"onUpdate:modelValue": t[2] || (t[2] = (r) =>
|
|
506
|
+
b(f(j), {
|
|
507
|
+
modelValue: p.firstName,
|
|
508
|
+
"onUpdate:modelValue": t[2] || (t[2] = (r) => p.firstName = r),
|
|
509
509
|
size: "large",
|
|
510
|
-
label:
|
|
510
|
+
label: v("Имя"),
|
|
511
511
|
error: y.value,
|
|
512
512
|
onBlur: t[3] || (t[3] = (r) => h.firstName = !0),
|
|
513
513
|
onInput: t[4] || (t[4] = (r) => K("firstName"))
|
|
514
514
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
515
|
-
b(
|
|
515
|
+
b(f(Z), { class: "icon-locked" })
|
|
516
516
|
])) : D("", !0),
|
|
517
517
|
F("lastName") ? (N(), V("div", wt, [
|
|
518
|
-
b(
|
|
519
|
-
modelValue:
|
|
520
|
-
"onUpdate:modelValue": t[5] || (t[5] = (r) =>
|
|
518
|
+
b(f(j), {
|
|
519
|
+
modelValue: p.lastName,
|
|
520
|
+
"onUpdate:modelValue": t[5] || (t[5] = (r) => p.lastName = r),
|
|
521
521
|
size: "large",
|
|
522
|
-
label:
|
|
523
|
-
error:
|
|
522
|
+
label: v("Фамилия"),
|
|
523
|
+
error: c.value,
|
|
524
524
|
onBlur: t[6] || (t[6] = (r) => h.lastName = !0),
|
|
525
525
|
onInput: t[7] || (t[7] = (r) => K("lastName"))
|
|
526
526
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
527
|
-
b(
|
|
527
|
+
b(f(Z), { class: "icon-locked" })
|
|
528
528
|
])) : D("", !0),
|
|
529
529
|
F("email") ? (N(), V("div", Et, [
|
|
530
|
-
b(
|
|
531
|
-
modelValue:
|
|
532
|
-
"onUpdate:modelValue": t[8] || (t[8] = (r) =>
|
|
530
|
+
b(f(j), {
|
|
531
|
+
modelValue: m.value,
|
|
532
|
+
"onUpdate:modelValue": t[8] || (t[8] = (r) => m.value = r),
|
|
533
533
|
size: "large",
|
|
534
534
|
"text-size": "medium",
|
|
535
535
|
label: "E-mail",
|
|
@@ -541,15 +541,15 @@ const ue = {
|
|
|
541
541
|
onInput: t[10] || (t[10] = (r) => K("email")),
|
|
542
542
|
onClick: De
|
|
543
543
|
}, null, 8, ["modelValue", "error"]),
|
|
544
|
-
b(
|
|
544
|
+
b(f(Z), { class: "icon-locked" })
|
|
545
545
|
])) : D("", !0),
|
|
546
546
|
F("phone") ? (N(), V("div", bt, [
|
|
547
|
-
b(
|
|
547
|
+
b(f(j), {
|
|
548
548
|
modelValue: d.value,
|
|
549
549
|
"onUpdate:modelValue": t[11] || (t[11] = (r) => d.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" },
|
|
@@ -558,25 +558,25 @@ const ue = {
|
|
|
558
558
|
onInput: t[13] || (t[13] = (r) => K("phone")),
|
|
559
559
|
onClick: Ue
|
|
560
560
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
561
|
-
b(
|
|
561
|
+
b(f(Z), { class: "icon-locked" })
|
|
562
562
|
])) : D("", !0),
|
|
563
563
|
ne("div", Pt, [
|
|
564
|
-
J.value ? (N(), $(
|
|
564
|
+
J.value ? (N(), $(f(ye), {
|
|
565
565
|
key: 0,
|
|
566
566
|
color: "secondary",
|
|
567
567
|
onClick: Je
|
|
568
568
|
}, {
|
|
569
569
|
default: O(() => [
|
|
570
|
-
oe(G(
|
|
570
|
+
oe(G(v("Сменить пароль")), 1)
|
|
571
571
|
]),
|
|
572
572
|
_: 1
|
|
573
573
|
})) : D("", !0),
|
|
574
|
-
b(
|
|
574
|
+
b(f(ye), {
|
|
575
575
|
disabled: !ve.value,
|
|
576
576
|
onClick: qe
|
|
577
577
|
}, {
|
|
578
578
|
default: O(() => [
|
|
579
|
-
oe(G(
|
|
579
|
+
oe(G(v("Сохранить")), 1)
|
|
580
580
|
]),
|
|
581
581
|
_: 1
|
|
582
582
|
}, 8, ["disabled"])
|
|
@@ -587,7 +587,7 @@ const ue = {
|
|
|
587
587
|
to: "body"
|
|
588
588
|
}, [
|
|
589
589
|
w.value ? (N(), V("div", Nt, [
|
|
590
|
-
b(
|
|
590
|
+
b(f(at), {
|
|
591
591
|
"circle-mode": !0,
|
|
592
592
|
"model-value": o.imageContent,
|
|
593
593
|
onClose: Le,
|
|
@@ -600,7 +600,7 @@ const ue = {
|
|
|
600
600
|
ne("div", Ct, [
|
|
601
601
|
b(He, { name: "list" }, {
|
|
602
602
|
default: O(() => [
|
|
603
|
-
Ze(b(
|
|
603
|
+
Ze(b(f(nt), {
|
|
604
604
|
class: "toast",
|
|
605
605
|
color: q.value,
|
|
606
606
|
text: u.value,
|
|
@@ -613,13 +613,13 @@ const ue = {
|
|
|
613
613
|
})
|
|
614
614
|
])
|
|
615
615
|
])),
|
|
616
|
-
b(
|
|
616
|
+
b(f(ke))
|
|
617
617
|
], 64));
|
|
618
618
|
}
|
|
619
619
|
}), Te = (l, s) => {
|
|
620
620
|
const a = l.__vccOpts || l;
|
|
621
|
-
for (const [n,
|
|
622
|
-
a[n] =
|
|
621
|
+
for (const [n, g] of s)
|
|
622
|
+
a[n] = g;
|
|
623
623
|
return a;
|
|
624
624
|
}, Tt = /* @__PURE__ */ Te(kt, [["__scopeId", "data-v-4e8a6f81"]]), Rt = /* @__PURE__ */ ee({
|
|
625
625
|
__name: "index",
|
|
@@ -636,17 +636,17 @@ const ue = {
|
|
|
636
636
|
},
|
|
637
637
|
emits: ["on-update-jwt", "update-tokens"],
|
|
638
638
|
setup(l, { emit: s }) {
|
|
639
|
-
const a = s, { openDialog: n } =
|
|
639
|
+
const a = s, { openDialog: n } = me(), g = (i, h) => {
|
|
640
640
|
n("email", { initialEmail: i, mode: h });
|
|
641
|
-
},
|
|
641
|
+
}, v = (i, h) => {
|
|
642
642
|
n("phone", { initialPhone: i, mode: h });
|
|
643
643
|
}, S = () => {
|
|
644
644
|
n("password");
|
|
645
|
-
},
|
|
645
|
+
}, p = (i, h, P) => {
|
|
646
646
|
a("on-update-jwt", i, h, P);
|
|
647
647
|
};
|
|
648
648
|
return (i, h) => (N(), V(Ce, null, [
|
|
649
|
-
b(
|
|
649
|
+
b(f(ot)),
|
|
650
650
|
b(Tt, {
|
|
651
651
|
"throttler-prefix": i.throttlerPrefix,
|
|
652
652
|
provider: i.provider,
|
|
@@ -657,12 +657,12 @@ const ue = {
|
|
|
657
657
|
"refresh-token": i.refreshToken,
|
|
658
658
|
"aws-storage-url": i.awsStorageUrl,
|
|
659
659
|
"disable-add-phone": i.disableAddPhone,
|
|
660
|
-
onOpenEmailDialog:
|
|
661
|
-
onOpenPhoneDialog:
|
|
660
|
+
onOpenEmailDialog: g,
|
|
661
|
+
onOpenPhoneDialog: v,
|
|
662
662
|
onOpenPasswordDialog: S,
|
|
663
|
-
onOnUpdateJwt:
|
|
663
|
+
onOnUpdateJwt: p
|
|
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(f(ke))
|
|
666
666
|
], 64));
|
|
667
667
|
}
|
|
668
668
|
}), It = 10, Bt = 10, Dt = 15;
|
|
@@ -684,7 +684,7 @@ function le(l) {
|
|
|
684
684
|
}
|
|
685
685
|
function Ut(l, s) {
|
|
686
686
|
let a = 0, n = !1;
|
|
687
|
-
return l.split("").filter((
|
|
687
|
+
return l.split("").filter((g, v) => g === "+" ? v !== 0 || n ? !1 : (n = !0, !0) : /\d/.test(g) ? (a++, a <= s) : !1).join("");
|
|
688
688
|
}
|
|
689
689
|
function Vt(l) {
|
|
690
690
|
return l.startsWith("+") || /^\d/.test(l);
|
|
@@ -695,9 +695,9 @@ function Pe(l) {
|
|
|
695
695
|
}
|
|
696
696
|
const Ie = /^[\d\s()+]+$/;
|
|
697
697
|
function Ft(l, s) {
|
|
698
|
-
var n,
|
|
698
|
+
var n, g;
|
|
699
699
|
const a = l.trim();
|
|
700
|
-
return (n = s.phone) != null && n.enabled && Ie.test(a) && /\d/.test(a) && !a.includes("@") ? "phone" : (
|
|
700
|
+
return (n = s.phone) != null && n.enabled && Ie.test(a) && /\d/.test(a) && !a.includes("@") ? "phone" : (g = s.email) != null && g.enabled ? "email" : null;
|
|
701
701
|
}
|
|
702
702
|
const St = { class: "smart-input" }, xt = /* @__PURE__ */ ee({
|
|
703
703
|
__name: "index",
|
|
@@ -713,16 +713,16 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ ee({
|
|
|
713
713
|
},
|
|
714
714
|
emits: ["update:modelValue", "validity-change", "type-change"],
|
|
715
715
|
setup(l, { emit: s }) {
|
|
716
|
-
const a = l, n = s,
|
|
717
|
-
function
|
|
718
|
-
return y ? y in ue[
|
|
716
|
+
const a = l, n = s, g = I(() => a.locale ?? "ru"), v = (u) => ue[g.value][u] || u, S = I(() => a.label ? v(a.label) : v("Email или телефон"));
|
|
717
|
+
function p(u, y) {
|
|
718
|
+
return y ? y in ue[g.value] ? v(y) : y : v(u);
|
|
719
719
|
}
|
|
720
720
|
const i = I(() => {
|
|
721
|
-
var u, y,
|
|
721
|
+
var u, y, c, A, k, F, M, U, J, W, R;
|
|
722
722
|
return {
|
|
723
723
|
mode: ((u = a.config) == null ? void 0 : u.mode) ?? "auto",
|
|
724
724
|
phone: {
|
|
725
|
-
enabled: ((
|
|
725
|
+
enabled: ((c = (y = a.config) == null ? void 0 : y.phone) == null ? void 0 : c.enabled) ?? !0,
|
|
726
726
|
minDigits: ((k = (A = a.config) == null ? void 0 : A.phone) == null ? void 0 : k.minDigits) ?? 10,
|
|
727
727
|
maxDigits: ((M = (F = a.config) == null ? void 0 : F.phone) == null ? void 0 : M.maxDigits) ?? 15,
|
|
728
728
|
autoPlus: ((J = (U = a.config) == null ? void 0 : U.phone) == null ? void 0 : J.autoPlus) ?? !0
|
|
@@ -743,46 +743,46 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ ee({
|
|
|
743
743
|
return a.errorMessages.invalidEmail;
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
|
-
const P = E(null),
|
|
746
|
+
const P = E(null), m = E(""), d = E(a.modelValue ?? ""), w = E(null), o = E(null), x = I(() => o.value ? p(
|
|
747
747
|
o.value,
|
|
748
748
|
h(o.value)
|
|
749
749
|
) : "");
|
|
750
750
|
Ne(() => a.modelValue, (u) => {
|
|
751
|
-
u !== void 0 && (d.value = u,
|
|
751
|
+
u !== void 0 && (d.value = u, m.value = u);
|
|
752
752
|
});
|
|
753
753
|
function z(u) {
|
|
754
754
|
o.value = null;
|
|
755
|
-
const
|
|
756
|
-
if (
|
|
755
|
+
const c = u.target.value;
|
|
756
|
+
if (c.trim() === "") {
|
|
757
757
|
w.value = null, o.value = null, n("type-change", null), n("update:modelValue", ""), n("validity-change", !1);
|
|
758
758
|
return;
|
|
759
759
|
}
|
|
760
|
-
const A = i.value.mode === "auto" ? Ft(
|
|
761
|
-
if (w.value = A, n("type-change", A), le(
|
|
762
|
-
o.value = "Допустимы только цифры и знак + в начале", n("validity-change", !1);
|
|
760
|
+
const A = i.value.mode === "auto" ? Ft(c, i.value) : i.value.mode;
|
|
761
|
+
if (w.value = A, n("type-change", A), le(c) && Vt(c)) {
|
|
762
|
+
d.value = c, n("update:modelValue", c), o.value = "Допустимы только цифры и знак + в начале", n("validity-change", !1);
|
|
763
763
|
return;
|
|
764
764
|
}
|
|
765
765
|
if (A === "email") {
|
|
766
|
-
const k = Pe(
|
|
767
|
-
d.value =
|
|
766
|
+
const k = Pe(c);
|
|
767
|
+
d.value = c, m.value = c, n("update:modelValue", c), n("validity-change", k);
|
|
768
768
|
return;
|
|
769
769
|
}
|
|
770
770
|
if (A === "phone") {
|
|
771
771
|
const k = we(
|
|
772
|
-
|
|
772
|
+
c,
|
|
773
773
|
i.value.phone.autoPlus,
|
|
774
774
|
a.locale
|
|
775
775
|
);
|
|
776
776
|
if (Ee(k).length > i.value.phone.maxDigits) {
|
|
777
|
-
const U = Ut(
|
|
777
|
+
const U = Ut(c, i.value.phone.maxDigits);
|
|
778
778
|
d.value = U, n("update:modelValue", U), q(U);
|
|
779
779
|
return;
|
|
780
780
|
}
|
|
781
|
-
if (d.value =
|
|
782
|
-
Ie.test(
|
|
781
|
+
if (d.value = c, le(c)) {
|
|
782
|
+
Ie.test(c) && (o.value = "Допустимы только цифры и знак + в начале", n("validity-change", !1));
|
|
783
783
|
return;
|
|
784
784
|
}
|
|
785
|
-
d.value = k, n("update:modelValue", k),
|
|
785
|
+
d.value = k, n("update:modelValue", k), m.value = k;
|
|
786
786
|
const M = be(
|
|
787
787
|
k,
|
|
788
788
|
i.value.phone.minDigits,
|
|
@@ -807,12 +807,12 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ ee({
|
|
|
807
807
|
o.value = "Это не похоже на номер телефона", n("validity-change", !1);
|
|
808
808
|
return;
|
|
809
809
|
}
|
|
810
|
-
const
|
|
810
|
+
const c = be(
|
|
811
811
|
u,
|
|
812
812
|
i.value.phone.minDigits,
|
|
813
813
|
i.value.phone.maxDigits
|
|
814
814
|
);
|
|
815
|
-
o.value =
|
|
815
|
+
o.value = c ? null : "Это не похоже на номер телефона", n("validity-change", c);
|
|
816
816
|
}
|
|
817
817
|
if (w.value === "email") {
|
|
818
818
|
const u = Pe(d.value);
|
|
@@ -828,13 +828,13 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ ee({
|
|
|
828
828
|
function q(u) {
|
|
829
829
|
const y = _();
|
|
830
830
|
if (!y) return;
|
|
831
|
-
const
|
|
831
|
+
const c = y.selectionStart ?? u.length;
|
|
832
832
|
y.value = u, requestAnimationFrame(() => {
|
|
833
|
-
y.setSelectionRange(
|
|
833
|
+
y.setSelectionRange(c, c);
|
|
834
834
|
});
|
|
835
835
|
}
|
|
836
836
|
return (u, y) => (N(), V("div", St, [
|
|
837
|
-
b(
|
|
837
|
+
b(f(j), {
|
|
838
838
|
ref_key: "inputRef",
|
|
839
839
|
ref: P,
|
|
840
840
|
"model-value": d.value,
|
|
@@ -846,23 +846,23 @@ const St = { class: "smart-input" }, xt = /* @__PURE__ */ ee({
|
|
|
846
846
|
onInput: z,
|
|
847
847
|
onBlur: L
|
|
848
848
|
}, null, 8, ["model-value", "readonly", "error", "type", "size", "label"]),
|
|
849
|
-
w.value === "phone" ? (N(), $(
|
|
849
|
+
w.value === "phone" ? (N(), $(f(rt), {
|
|
850
850
|
key: 0,
|
|
851
851
|
class: "smart-input__icon"
|
|
852
852
|
})) : D("", !0),
|
|
853
|
-
w.value === "email" ? (N(), $(
|
|
853
|
+
w.value === "email" ? (N(), $(f(lt), {
|
|
854
854
|
key: 1,
|
|
855
855
|
class: "smart-input__icon"
|
|
856
856
|
})) : D("", !0)
|
|
857
857
|
]));
|
|
858
858
|
}
|
|
859
|
-
}), Ot = /* @__PURE__ */ Te(xt, [["__scopeId", "data-v-
|
|
859
|
+
}), Ot = /* @__PURE__ */ Te(xt, [["__scopeId", "data-v-2650fe95"]]);
|
|
860
860
|
export {
|
|
861
861
|
_t as B,
|
|
862
862
|
Lt as C,
|
|
863
863
|
Te as _,
|
|
864
864
|
Rt as a,
|
|
865
|
-
|
|
865
|
+
mt as g,
|
|
866
866
|
Ot as i,
|
|
867
867
|
ie as p,
|
|
868
868
|
ue as t
|
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-2650fe95]{position:relative;width:100%}.smart-input__icon[data-v-2650fe95]{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-AKLe2RA9.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-AKLe2RA9.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")}`;
|