@yourgoods/ui-smart 0.53.34 → 0.53.35
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-9P3utupX.js → ProfileEmailDialog-D-8LeXGU.js} +2 -2
- package/dist/{ProfilePasswordDialog-BVosb7I-.js → ProfilePasswordDialog-CB0dWsQw.js} +1 -1
- package/dist/{ProfilePhoneDialog-BNV_fkht.js → ProfilePhoneDialog-xDSuU34T.js} +2 -2
- package/dist/{index-De1pwitQ.js → index-wqXW8c3G.js} +109 -109
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-BU4T05XK.js → useRateLimitToast-DZAG_bOv.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-DZAG_bOv.js";
|
|
3
|
+
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-wqXW8c3G.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-wqXW8c3G.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-DZAG_bOv.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-wqXW8c3G.js";
|
|
5
5
|
const _e = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: "12",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as y, shallowRef as je, defineComponent as X, defineAsyncComponent as Z, watch as we, createBlock as
|
|
1
|
+
import { ref as y, shallowRef as je, defineComponent as X, defineAsyncComponent as Z, watch as we, createBlock as M, createCommentVNode as I, unref as p, openBlock as E, resolveDynamicComponent as qe, mergeProps as Je, computed as F, reactive as H, onMounted as We, createElementBlock as V, Fragment as be, createVNode as w, createElementVNode as Q, withCtx as L, toDisplayString as R, createTextVNode as ee, Teleport as pe, Transition as Ye, withDirectives as Xe, vShow as Ke } from "vue";
|
|
2
2
|
import Ze from "axios";
|
|
3
|
-
import { PInputFileUploader as He, PInput as
|
|
3
|
+
import { PInputFileUploader as He, PInput as _, IconFilledEditMd as W, PButton as fe, PImageCropper as Qe, PToast as ea, PTeleportContainer as Ee, PToastContainer as aa, IconPhoneMd as ta, IconMailMd as oa } from "@profeat/ui-kit";
|
|
4
4
|
function na(l, s = 2) {
|
|
5
5
|
if (l === 0)
|
|
6
6
|
return "0 B";
|
|
@@ -217,31 +217,31 @@ const ma = {
|
|
|
217
217
|
},
|
|
218
218
|
emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
|
|
219
219
|
setup(l, { emit: s }) {
|
|
220
|
-
const t = s, n = y(!0), { currentDialog: i, dialogPayload: g, closeDialog:
|
|
221
|
-
email: Z(() => import("./ProfileEmailDialog-
|
|
222
|
-
phone: Z(() => import("./ProfilePhoneDialog-
|
|
223
|
-
password: Z(() => import("./ProfilePasswordDialog-
|
|
224
|
-
}, d = ({ email:
|
|
225
|
-
t("update-email-field",
|
|
226
|
-
}, m = ({ phone:
|
|
227
|
-
t("update-phone-field",
|
|
220
|
+
const t = s, n = y(!0), { currentDialog: i, dialogPayload: g, closeDialog: A } = re(), u = {
|
|
221
|
+
email: Z(() => import("./ProfileEmailDialog-D-8LeXGU.js")),
|
|
222
|
+
phone: Z(() => import("./ProfilePhoneDialog-xDSuU34T.js")),
|
|
223
|
+
password: Z(() => import("./ProfilePasswordDialog-CB0dWsQw.js"))
|
|
224
|
+
}, d = ({ email: P }) => {
|
|
225
|
+
t("update-email-field", P);
|
|
226
|
+
}, m = ({ phone: P }) => {
|
|
227
|
+
t("update-phone-field", P);
|
|
228
228
|
};
|
|
229
|
-
return we(i, (
|
|
230
|
-
n.value = !!
|
|
231
|
-
}), (
|
|
229
|
+
return we(i, (P) => {
|
|
230
|
+
n.value = !!P;
|
|
231
|
+
}), (P, f) => p(i) ? (E(), M(qe(u[p(i)]), Je({
|
|
232
232
|
key: 0,
|
|
233
233
|
modelValue: n.value,
|
|
234
234
|
"onUpdate:modelValue": f[0] || (f[0] = (h) => n.value = h),
|
|
235
|
-
language:
|
|
236
|
-
provider:
|
|
237
|
-
"disable-add-phone":
|
|
235
|
+
language: P.language,
|
|
236
|
+
provider: P.provider,
|
|
237
|
+
"disable-add-phone": P.disableAddPhone
|
|
238
238
|
}, p(g), {
|
|
239
|
-
onClose: p(
|
|
239
|
+
onClose: p(A),
|
|
240
240
|
onCleanInputErrors: f[1] || (f[1] = (h) => t("clean-input-errors")),
|
|
241
|
-
onOnUpdateJwt: f[2] || (f[2] = (h,
|
|
241
|
+
onOnUpdateJwt: f[2] || (f[2] = (h, C, o) => t("on-update-jwt", h, C, o)),
|
|
242
242
|
onSubmitEmail: d,
|
|
243
243
|
onSubmitPhone: m,
|
|
244
|
-
onOnPasswordError: f[3] || (f[3] = (h,
|
|
244
|
+
onOnPasswordError: f[3] || (f[3] = (h, C) => t("on-password-error", h, C)),
|
|
245
245
|
onOnToast: f[4] || (f[4] = (h) => t("on-toast", h))
|
|
246
246
|
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : I("", !0);
|
|
247
247
|
}
|
|
@@ -278,7 +278,7 @@ const ma = {
|
|
|
278
278
|
},
|
|
279
279
|
emits: ["open-email-dialog", "open-phone-dialog", "open-password-dialog", "on-update-jwt", "on-password-error", "update-tokens"],
|
|
280
280
|
setup(l, { emit: s }) {
|
|
281
|
-
const t = l, n = s, i =
|
|
281
|
+
const t = l, n = s, i = F(() => t.language ?? "ru"), g = (e) => ma[i.value][e] || e, { openDialog: A } = re(), u = H({ firstName: "", lastName: "" }), d = y({ firstName: "", lastName: "" }), m = H({ firstName: !1, lastName: !1, email: !1, phone: !1 }), P = y(""), f = y(""), h = y(""), C = y(!1), o = H({
|
|
282
282
|
value: null,
|
|
283
283
|
loading: !1,
|
|
284
284
|
accept: ["image/png", "image/jpeg"],
|
|
@@ -286,17 +286,17 @@ const ma = {
|
|
|
286
286
|
// 10 MB
|
|
287
287
|
imageBinary: null,
|
|
288
288
|
imageContent: ""
|
|
289
|
-
}), v = y(""), c = y(!1),
|
|
289
|
+
}), v = y(""), c = y(!1), b = y(!0), U = y(!0), B = y(void 0), N = y(""), $ = F(() => se(u.firstName, m.firstName)), x = F(() => se(u.lastName, m.lastName)), S = F(() => m.email && !f.value.trim() ? "Введите e-mail" : ""), O = F(() => m.phone && !h.value.trim() ? "Введите номер телефона" : ""), z = (e) => t.fields.some((a) => a.key === e), le = (e) => e && e.trim() ? "edit" : "bind", K = () => setTimeout(() => {
|
|
290
290
|
var e;
|
|
291
291
|
return (e = document.activeElement) == null ? void 0 : e.blur();
|
|
292
|
-
}, 0), Ne =
|
|
292
|
+
}, 0), Ne = F(() => !!(f.value && f.value.trim() !== "")), Ce = F(() => o.imageContent ? g("Загрузить другое фото") : g("Загрузить фото")), se = (e, a) => {
|
|
293
293
|
if (!a) return "";
|
|
294
294
|
const r = e.trim();
|
|
295
295
|
return r ? r.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
|
|
296
|
-
}, ke = (e) =>
|
|
297
|
-
K(), m.email = !1,
|
|
296
|
+
}, ke = (e) => A("email", { mode: e ? "edit" : "bind", initialEmail: e }), Te = () => {
|
|
297
|
+
K(), m.email = !1, U.value = !1, n("open-email-dialog", f.value, le(f.value)), ke(f.value);
|
|
298
298
|
}, Be = () => {
|
|
299
|
-
K(), m.phone = !1,
|
|
299
|
+
K(), m.phone = !1, b.value = !1, n("open-phone-dialog", h.value, le(h.value));
|
|
300
300
|
}, De = async (e, a, r) => {
|
|
301
301
|
e === "email" && r && (f.value = r), e === "phone" && r && (h.value = r), n("on-update-jwt");
|
|
302
302
|
}, Ie = (e) => {
|
|
@@ -306,9 +306,9 @@ const ma = {
|
|
|
306
306
|
}, Ve = (e, a) => {
|
|
307
307
|
c.value = !0, n("on-password-error", e, a);
|
|
308
308
|
}, Ae = () => {
|
|
309
|
-
|
|
309
|
+
b.value = !1, U.value = !1;
|
|
310
310
|
}, G = (e) => {
|
|
311
|
-
c.value = !0,
|
|
311
|
+
c.value = !0, B.value = e.color ?? "", N.value = e.text ?? "";
|
|
312
312
|
}, j = (e) => {
|
|
313
313
|
if (m[e] = !0, e === "firstName" || e === "lastName") {
|
|
314
314
|
const a = u[e];
|
|
@@ -325,9 +325,9 @@ const ma = {
|
|
|
325
325
|
v.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", ie();
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
|
-
o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "",
|
|
328
|
+
o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "", C.value = !0;
|
|
329
329
|
}, ie = () => {
|
|
330
|
-
o.value = null, o.imageBinary = null, o.imageContent = "",
|
|
330
|
+
o.value = null, o.imageBinary = null, o.imageContent = "", C.value = !1;
|
|
331
331
|
}, Se = async () => {
|
|
332
332
|
try {
|
|
333
333
|
const a = (await ua("/users/profile/delete/avatar")).data;
|
|
@@ -336,15 +336,15 @@ const ma = {
|
|
|
336
336
|
return console.error("Ошибка при удалении аватара:", e), !1;
|
|
337
337
|
}
|
|
338
338
|
}, Me = () => {
|
|
339
|
-
v.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", o.value = null, o.imageBinary = null, o.imageContent = "",
|
|
339
|
+
v.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", o.value = null, o.imageBinary = null, o.imageContent = "", C.value = !1;
|
|
340
340
|
}, ue = async (e, a, r = "image/png") => {
|
|
341
341
|
if (!e) return null;
|
|
342
342
|
const D = await (await fetch(e)).blob();
|
|
343
343
|
return new File([D], a, { type: r });
|
|
344
344
|
}, xe = () => {
|
|
345
|
-
o.value = null, o.imageBinary = null, o.imageContent = "",
|
|
345
|
+
o.value = null, o.imageBinary = null, o.imageContent = "", C.value = !1;
|
|
346
346
|
}, $e = async (e) => {
|
|
347
|
-
|
|
347
|
+
C.value = !1;
|
|
348
348
|
const a = o.imageContent;
|
|
349
349
|
if (o.imageContent = e, !o.imageBinary) return;
|
|
350
350
|
const r = await ue(
|
|
@@ -358,10 +358,10 @@ const ma = {
|
|
|
358
358
|
}
|
|
359
359
|
try {
|
|
360
360
|
o.loading = !0;
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
} catch (
|
|
364
|
-
console.error(
|
|
361
|
+
const k = new FormData();
|
|
362
|
+
k.append("file", r), await oe(`/users/profile/avatar/${P.value}`, k, { headers: { "Content-Type": void 0 } });
|
|
363
|
+
} catch (k) {
|
|
364
|
+
console.error(k), G({
|
|
365
365
|
color: "error",
|
|
366
366
|
text: g("Не удалось сохранить изменения. Попробуйте позже")
|
|
367
367
|
}), o.imageContent = a;
|
|
@@ -375,12 +375,12 @@ const ma = {
|
|
|
375
375
|
o.imageBinary.type || "image/png"
|
|
376
376
|
));
|
|
377
377
|
}, de = y(!1), me = async (e) => {
|
|
378
|
-
var r,
|
|
378
|
+
var r, k;
|
|
379
379
|
const a = (r = u[e]) == null ? void 0 : r.trim();
|
|
380
380
|
if (a)
|
|
381
381
|
try {
|
|
382
382
|
de.value = !0;
|
|
383
|
-
const T = (
|
|
383
|
+
const T = (k = (await oe("/users/profile/update-name", { [e]: a })).data) == null ? void 0 : k.data;
|
|
384
384
|
T != null && T.user && (u.firstName = T.user.firstName ?? u.firstName, u.lastName = T.user.lastName ?? u.lastName, d.value = {
|
|
385
385
|
firstName: u.firstName,
|
|
386
386
|
lastName: u.lastName
|
|
@@ -403,13 +403,13 @@ const ma = {
|
|
|
403
403
|
if (!r)
|
|
404
404
|
throw console.error("Данные пользователя отсутствуют в ответе сервера"), new Error("User data is missing from the response");
|
|
405
405
|
const {
|
|
406
|
-
userId:
|
|
406
|
+
userId: k,
|
|
407
407
|
privateFirstName: D,
|
|
408
408
|
privateLastName: T,
|
|
409
409
|
email: q,
|
|
410
410
|
phoneNumber: J
|
|
411
411
|
} = r;
|
|
412
|
-
|
|
412
|
+
P.value = k ?? "", u.firstName = D ?? "", u.lastName = T ?? "", f.value = q ?? "", h.value = J ?? "", o.imageContent = await Re(), d.value = {
|
|
413
413
|
firstName: D ?? "",
|
|
414
414
|
lastName: T ?? ""
|
|
415
415
|
};
|
|
@@ -434,10 +434,10 @@ const ma = {
|
|
|
434
434
|
return console.error("Ошибка при составлении URL аватара:", a), "";
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
-
const ce =
|
|
437
|
+
const ce = F(() => {
|
|
438
438
|
if (!d.value.firstName && !d.value.lastName)
|
|
439
439
|
return !1;
|
|
440
|
-
const e = u.firstName.trim(), a = u.lastName.trim(), r = d.value.firstName.trim(),
|
|
440
|
+
const e = u.firstName.trim(), a = u.lastName.trim(), r = d.value.firstName.trim(), k = d.value.lastName.trim(), D = e !== r || a !== k, T = e.length >= 2 && a.length >= 2;
|
|
441
441
|
return D && T;
|
|
442
442
|
}), Oe = async () => {
|
|
443
443
|
if (ce.value)
|
|
@@ -456,7 +456,7 @@ const ma = {
|
|
|
456
456
|
if (!t.accessToken) throw new Error("Access token не передан в props");
|
|
457
457
|
if (!t.requestUrl) throw new Error("auth-backend url не передан в props");
|
|
458
458
|
sa(t.accessToken, t.requestUrl, t.throttlerPrefix), await Le();
|
|
459
|
-
}), (e, a) => (
|
|
459
|
+
}), (e, a) => (E(), V(be, null, [
|
|
460
460
|
w(ca, {
|
|
461
461
|
language: i.value,
|
|
462
462
|
provider: e.provider,
|
|
@@ -469,7 +469,7 @@ const ma = {
|
|
|
469
469
|
onOnToast: G
|
|
470
470
|
}, null, 8, ["language", "provider", "disable-add-phone"]),
|
|
471
471
|
Q("div", pa, [
|
|
472
|
-
|
|
472
|
+
z("avatar") ? (E(), M(p(He), {
|
|
473
473
|
key: 0,
|
|
474
474
|
modelValue: o.value,
|
|
475
475
|
"onUpdate:modelValue": [
|
|
@@ -486,40 +486,40 @@ const ma = {
|
|
|
486
486
|
onDelete: Se,
|
|
487
487
|
"onChange:error": Me
|
|
488
488
|
}, {
|
|
489
|
-
afterLoadLabel:
|
|
490
|
-
ee(
|
|
489
|
+
afterLoadLabel: L(() => [
|
|
490
|
+
ee(R(Ce.value), 1)
|
|
491
491
|
]),
|
|
492
|
-
subtext:
|
|
493
|
-
v.value ? (
|
|
492
|
+
subtext: L(() => [
|
|
493
|
+
v.value ? (E(), V("span", fa, R(v.value), 1)) : (E(), V("span", ga, R(`${g("Формат")} ${p(la)(o.accept).join(", ")} ${g("до")} ${p(na)(o.uploadLimit)}`), 1))
|
|
494
494
|
]),
|
|
495
495
|
_: 1
|
|
496
496
|
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : I("", !0),
|
|
497
|
-
|
|
498
|
-
w(p(
|
|
497
|
+
z("firstName") ? (E(), V("div", va, [
|
|
498
|
+
w(p(_), {
|
|
499
499
|
modelValue: u.firstName,
|
|
500
500
|
"onUpdate:modelValue": a[2] || (a[2] = (r) => u.firstName = r),
|
|
501
501
|
size: "large",
|
|
502
502
|
label: g("Имя"),
|
|
503
|
-
error:
|
|
503
|
+
error: $.value,
|
|
504
504
|
onBlur: a[3] || (a[3] = (r) => m.firstName = !0),
|
|
505
505
|
onInput: a[4] || (a[4] = (r) => j("firstName"))
|
|
506
506
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
507
507
|
w(p(W), { class: "icon-locked" })
|
|
508
508
|
])) : I("", !0),
|
|
509
|
-
|
|
510
|
-
w(p(
|
|
509
|
+
z("lastName") ? (E(), V("div", ha, [
|
|
510
|
+
w(p(_), {
|
|
511
511
|
modelValue: u.lastName,
|
|
512
512
|
"onUpdate:modelValue": a[5] || (a[5] = (r) => u.lastName = r),
|
|
513
513
|
size: "large",
|
|
514
514
|
label: g("Фамилия"),
|
|
515
|
-
error:
|
|
515
|
+
error: x.value,
|
|
516
516
|
onBlur: a[6] || (a[6] = (r) => m.lastName = !0),
|
|
517
517
|
onInput: a[7] || (a[7] = (r) => j("lastName"))
|
|
518
518
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
519
519
|
w(p(W), { class: "icon-locked" })
|
|
520
520
|
])) : I("", !0),
|
|
521
|
-
|
|
522
|
-
w(p(
|
|
521
|
+
z("email") ? (E(), V("div", ya, [
|
|
522
|
+
w(p(_), {
|
|
523
523
|
modelValue: f.value,
|
|
524
524
|
"onUpdate:modelValue": a[8] || (a[8] = (r) => f.value = r),
|
|
525
525
|
size: "large",
|
|
@@ -528,15 +528,15 @@ const ma = {
|
|
|
528
528
|
type: "email",
|
|
529
529
|
readonly: "",
|
|
530
530
|
style: { cursor: "pointer" },
|
|
531
|
-
error:
|
|
531
|
+
error: S.value && U.value,
|
|
532
532
|
onBlur: a[9] || (a[9] = (r) => m.email = !0),
|
|
533
533
|
onInput: a[10] || (a[10] = (r) => j("email")),
|
|
534
534
|
onClick: Te
|
|
535
535
|
}, null, 8, ["modelValue", "error"]),
|
|
536
536
|
w(p(W), { class: "icon-locked" })
|
|
537
537
|
])) : I("", !0),
|
|
538
|
-
|
|
539
|
-
w(p(
|
|
538
|
+
z("phone") ? (E(), V("div", wa, [
|
|
539
|
+
w(p(_), {
|
|
540
540
|
modelValue: h.value,
|
|
541
541
|
"onUpdate:modelValue": a[11] || (a[11] = (r) => h.value = r),
|
|
542
542
|
size: "large",
|
|
@@ -545,7 +545,7 @@ const ma = {
|
|
|
545
545
|
type: "tel",
|
|
546
546
|
readonly: "",
|
|
547
547
|
style: { cursor: "pointer" },
|
|
548
|
-
error:
|
|
548
|
+
error: O.value && b.value,
|
|
549
549
|
onBlur: a[12] || (a[12] = (r) => m.phone = !0),
|
|
550
550
|
onInput: a[13] || (a[13] = (r) => j("phone")),
|
|
551
551
|
onClick: Be
|
|
@@ -553,13 +553,13 @@ const ma = {
|
|
|
553
553
|
w(p(W), { class: "icon-locked" })
|
|
554
554
|
])) : I("", !0),
|
|
555
555
|
Q("div", ba, [
|
|
556
|
-
Ne.value ? (
|
|
556
|
+
Ne.value ? (E(), M(p(fe), {
|
|
557
557
|
key: 0,
|
|
558
558
|
color: "secondary",
|
|
559
559
|
onClick: Ge
|
|
560
560
|
}, {
|
|
561
|
-
default:
|
|
562
|
-
ee(
|
|
561
|
+
default: L(() => [
|
|
562
|
+
ee(R(g("Сменить пароль")), 1)
|
|
563
563
|
]),
|
|
564
564
|
_: 1
|
|
565
565
|
})) : I("", !0),
|
|
@@ -567,18 +567,18 @@ const ma = {
|
|
|
567
567
|
disabled: !ce.value,
|
|
568
568
|
onClick: Oe
|
|
569
569
|
}, {
|
|
570
|
-
default:
|
|
571
|
-
ee(
|
|
570
|
+
default: L(() => [
|
|
571
|
+
ee(R(g("Сохранить")), 1)
|
|
572
572
|
]),
|
|
573
573
|
_: 1
|
|
574
574
|
}, 8, ["disabled"])
|
|
575
575
|
])
|
|
576
576
|
]),
|
|
577
|
-
|
|
577
|
+
C.value ? (E(), M(pe, {
|
|
578
578
|
key: 0,
|
|
579
579
|
to: "body"
|
|
580
580
|
}, [
|
|
581
|
-
|
|
581
|
+
C.value ? (E(), V("div", Ea, [
|
|
582
582
|
w(p(Qe), {
|
|
583
583
|
"circle-mode": !0,
|
|
584
584
|
"model-value": o.imageContent,
|
|
@@ -588,14 +588,14 @@ const ma = {
|
|
|
588
588
|
}, null, 8, ["model-value"])
|
|
589
589
|
])) : I("", !0)
|
|
590
590
|
])) : I("", !0),
|
|
591
|
-
(
|
|
591
|
+
(E(), M(pe, { to: "#toast-root" }, [
|
|
592
592
|
Q("div", Pa, [
|
|
593
593
|
w(Ye, { name: "list" }, {
|
|
594
|
-
default:
|
|
594
|
+
default: L(() => [
|
|
595
595
|
Xe(w(p(ea), {
|
|
596
596
|
class: "toast",
|
|
597
|
-
color:
|
|
598
|
-
text:
|
|
597
|
+
color: B.value,
|
|
598
|
+
text: N.value,
|
|
599
599
|
onClose: a[16] || (a[16] = (r) => c.value = !1)
|
|
600
600
|
}, null, 8, ["color", "text"]), [
|
|
601
601
|
[Ke, c.value]
|
|
@@ -632,12 +632,12 @@ const ma = {
|
|
|
632
632
|
n("email", { initialEmail: d, mode: m });
|
|
633
633
|
}, g = (d, m) => {
|
|
634
634
|
n("phone", { initialPhone: d, mode: m });
|
|
635
|
-
},
|
|
635
|
+
}, A = () => {
|
|
636
636
|
n("password");
|
|
637
|
-
}, u = (d, m,
|
|
638
|
-
t("on-update-jwt", d, m,
|
|
637
|
+
}, u = (d, m, P) => {
|
|
638
|
+
t("on-update-jwt", d, m, P);
|
|
639
639
|
};
|
|
640
|
-
return (d, m) => (
|
|
640
|
+
return (d, m) => (E(), V(be, null, [
|
|
641
641
|
w(p(aa)),
|
|
642
642
|
w(Ca, {
|
|
643
643
|
"throttler-prefix": d.throttlerPrefix,
|
|
@@ -651,7 +651,7 @@ const ma = {
|
|
|
651
651
|
"disable-add-phone": d.disableAddPhone,
|
|
652
652
|
onOpenEmailDialog: i,
|
|
653
653
|
onOpenPhoneDialog: g,
|
|
654
|
-
onOpenPasswordDialog:
|
|
654
|
+
onOpenPasswordDialog: A,
|
|
655
655
|
onOnUpdateJwt: u
|
|
656
656
|
}, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token", "aws-storage-url", "disable-add-phone"]),
|
|
657
657
|
w(p(Ee))
|
|
@@ -701,85 +701,85 @@ const Aa = { class: "smart-input" }, Fa = /* @__PURE__ */ X({
|
|
|
701
701
|
},
|
|
702
702
|
emits: ["update:modelValue", "validity-change", "type-change"],
|
|
703
703
|
setup(l, { emit: s }) {
|
|
704
|
-
const t = l, n = s, i =
|
|
705
|
-
var o, v, c,
|
|
704
|
+
const t = l, n = s, i = F(() => {
|
|
705
|
+
var o, v, c, b, U, B, N, $, x, S, O;
|
|
706
706
|
return {
|
|
707
707
|
mode: ((o = t.config) == null ? void 0 : o.mode) ?? "auto",
|
|
708
708
|
phone: {
|
|
709
709
|
enabled: ((c = (v = t.config) == null ? void 0 : v.phone) == null ? void 0 : c.enabled) ?? !0,
|
|
710
|
-
minDigits: ((
|
|
711
|
-
maxDigits: ((
|
|
712
|
-
autoPlus: ((
|
|
710
|
+
minDigits: ((U = (b = t.config) == null ? void 0 : b.phone) == null ? void 0 : U.minDigits) ?? 10,
|
|
711
|
+
maxDigits: ((N = (B = t.config) == null ? void 0 : B.phone) == null ? void 0 : N.maxDigits) ?? 15,
|
|
712
|
+
autoPlus: ((x = ($ = t.config) == null ? void 0 : $.phone) == null ? void 0 : x.autoPlus) ?? !0
|
|
713
713
|
},
|
|
714
714
|
email: {
|
|
715
|
-
enabled: ((
|
|
715
|
+
enabled: ((O = (S = t.config) == null ? void 0 : S.email) == null ? void 0 : O.enabled) ?? !0
|
|
716
716
|
}
|
|
717
717
|
};
|
|
718
|
-
}), g = y(null),
|
|
718
|
+
}), g = y(null), A = y(""), u = y(t.modelValue ?? ""), d = y(null), m = y("");
|
|
719
719
|
we(() => t.modelValue, (o) => {
|
|
720
|
-
o !== void 0 && (u.value = o,
|
|
720
|
+
o !== void 0 && (u.value = o, A.value = o);
|
|
721
721
|
});
|
|
722
|
-
function
|
|
723
|
-
var
|
|
722
|
+
function P(o) {
|
|
723
|
+
var U, B;
|
|
724
724
|
m.value = "";
|
|
725
725
|
const c = o.target.value;
|
|
726
726
|
if (c.trim() === "") {
|
|
727
727
|
d.value = null, m.value = "", n("type-change", null), n("update:modelValue", ""), n("validity-change", !1);
|
|
728
728
|
return;
|
|
729
729
|
}
|
|
730
|
-
const
|
|
731
|
-
if (d.value =
|
|
730
|
+
const b = i.value.mode === "auto" ? Va(c, i.value) : i.value.mode;
|
|
731
|
+
if (d.value = b, n("type-change", b), b === "email") {
|
|
732
732
|
const N = ye(c);
|
|
733
|
-
m.value = c.length === 0 || N ? "" : ((
|
|
733
|
+
m.value = c.length === 0 || N ? "" : ((U = t.errorMessages) == null ? void 0 : U.invalidEmail) ?? "Это не похоже на email", u.value = c, A.value = c, n("update:modelValue", c), n("validity-change", N);
|
|
734
734
|
return;
|
|
735
735
|
}
|
|
736
|
-
if (
|
|
736
|
+
if (b === "phone") {
|
|
737
737
|
const N = ge(
|
|
738
738
|
c,
|
|
739
739
|
i.value.phone.autoPlus,
|
|
740
740
|
t.locale
|
|
741
741
|
);
|
|
742
742
|
if (ve(N).length > i.value.phone.maxDigits) {
|
|
743
|
-
const
|
|
744
|
-
u.value =
|
|
743
|
+
const S = Ia(c, i.value.phone.maxDigits);
|
|
744
|
+
u.value = S, n("update:modelValue", S), C(S);
|
|
745
745
|
return;
|
|
746
746
|
}
|
|
747
747
|
if (u.value = c, Da(c)) {
|
|
748
|
-
m.value = ((
|
|
748
|
+
m.value = ((B = t.errorMessages) == null ? void 0 : B.invalidPhoneChars) ?? "Допустимы только цифры и знак +", n("validity-change", !1);
|
|
749
749
|
return;
|
|
750
750
|
}
|
|
751
|
-
u.value = N, n("update:modelValue", N),
|
|
751
|
+
u.value = N, n("update:modelValue", N), A.value = N;
|
|
752
752
|
const x = he(
|
|
753
753
|
N,
|
|
754
754
|
i.value.phone.minDigits,
|
|
755
755
|
i.value.phone.maxDigits
|
|
756
756
|
);
|
|
757
|
-
|
|
757
|
+
n("validity-change", x);
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
760
|
function f() {
|
|
761
|
-
var o, v;
|
|
761
|
+
var o, v, c;
|
|
762
762
|
if (console.debug("✅[event] onBlur is working"), !!d.value) {
|
|
763
763
|
if (d.value === "phone") {
|
|
764
|
-
const
|
|
764
|
+
const b = ge(
|
|
765
765
|
u.value,
|
|
766
766
|
i.value.phone.autoPlus,
|
|
767
767
|
t.locale
|
|
768
768
|
);
|
|
769
|
-
if (ve(
|
|
769
|
+
if (ve(b).length < Ta) {
|
|
770
770
|
m.value = ((o = t.errorMessages) == null ? void 0 : o.invalidPhoneLength) ?? "Это не похоже на номер телефона", n("validity-change", !1);
|
|
771
771
|
return;
|
|
772
772
|
}
|
|
773
773
|
const B = he(
|
|
774
|
-
|
|
774
|
+
b,
|
|
775
775
|
i.value.phone.minDigits,
|
|
776
776
|
i.value.phone.maxDigits
|
|
777
777
|
);
|
|
778
|
-
n("validity-change", B);
|
|
778
|
+
m.value = B ? "" : ((v = t.errorMessages) == null ? void 0 : v.invalidPhoneLength) ?? "Это не похоже на номер телефона", n("validity-change", B);
|
|
779
779
|
}
|
|
780
780
|
if (d.value === "email") {
|
|
781
|
-
const
|
|
782
|
-
m.value =
|
|
781
|
+
const b = ye(u.value);
|
|
782
|
+
m.value = b ? "" : ((c = t.errorMessages) == null ? void 0 : c.invalidEmail) ?? "Это не похоже на email", n("validity-change", b);
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
785
|
}
|
|
@@ -788,7 +788,7 @@ const Aa = { class: "smart-input" }, Fa = /* @__PURE__ */ X({
|
|
|
788
788
|
const o = (v = g.value) == null ? void 0 : v.$el;
|
|
789
789
|
return o ? o.querySelector("input") : null;
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function C(o) {
|
|
792
792
|
const v = h();
|
|
793
793
|
if (!v) return;
|
|
794
794
|
const c = v.selectionStart ?? o.length;
|
|
@@ -796,8 +796,8 @@ const Aa = { class: "smart-input" }, Fa = /* @__PURE__ */ X({
|
|
|
796
796
|
v.setSelectionRange(c, c);
|
|
797
797
|
});
|
|
798
798
|
}
|
|
799
|
-
return (o, v) => (
|
|
800
|
-
w(p(
|
|
799
|
+
return (o, v) => (E(), V("div", Aa, [
|
|
800
|
+
w(p(_), {
|
|
801
801
|
ref_key: "inputRef",
|
|
802
802
|
ref: g,
|
|
803
803
|
"model-value": u.value,
|
|
@@ -806,20 +806,20 @@ const Aa = { class: "smart-input" }, Fa = /* @__PURE__ */ X({
|
|
|
806
806
|
type: o.type ?? "text",
|
|
807
807
|
size: o.size ?? "large",
|
|
808
808
|
label: o.label ?? "Email или телефон",
|
|
809
|
-
onInput:
|
|
809
|
+
onInput: P,
|
|
810
810
|
onBlur: f
|
|
811
811
|
}, null, 8, ["model-value", "readonly", "error", "type", "size", "label"]),
|
|
812
|
-
d.value === "phone" ? (
|
|
812
|
+
d.value === "phone" ? (E(), M(p(ta), {
|
|
813
813
|
key: 0,
|
|
814
814
|
class: "smart-input__icon"
|
|
815
815
|
})) : I("", !0),
|
|
816
|
-
d.value === "email" ? (
|
|
816
|
+
d.value === "email" ? (E(), M(p(oa), {
|
|
817
817
|
key: 1,
|
|
818
818
|
class: "smart-input__icon"
|
|
819
819
|
})) : I("", !0)
|
|
820
820
|
]));
|
|
821
821
|
}
|
|
822
|
-
}), Ra = /* @__PURE__ */ Pe(Fa, [["__scopeId", "data-v-
|
|
822
|
+
}), Ra = /* @__PURE__ */ Pe(Fa, [["__scopeId", "data-v-81ec52e1"]]);
|
|
823
823
|
export {
|
|
824
824
|
za as B,
|
|
825
825
|
$a as C,
|
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-a56fcdbb] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-a56fcdbb] .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-a56fcdbb] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-a56fcdbb] .p-input-file:hover .overlay{visibility:visible}.smart-input[data-v-81ec52e1]{position:relative;width:100%}.smart-input__icon[data-v-81ec52e1]{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-wqXW8c3G.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-wqXW8c3G.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")}`;
|