@yourgoods/ui-smart 0.53.6 → 0.53.7
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-DNqCaOPA.js → ProfileEmailDialog-fkiqQ4WV.js} +2 -2
- package/dist/{ProfilePasswordDialog-CdZ5dWF0.js → ProfilePasswordDialog-DYK3bH4Y.js} +1 -1
- package/dist/{ProfilePhoneDialog-tKedDfS4.js → ProfilePhoneDialog-C2iDBDNA.js} +2 -2
- package/dist/{index-CfmFrMSL.js → index-CEiwFzrU.js} +88 -85
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-DCoAsFEo.js → useRateLimitToast-Bfna_sAM.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-Bfna_sAM.js";
|
|
3
|
+
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-CEiwFzrU.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-CEiwFzrU.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-Bfna_sAM.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-CEiwFzrU.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 w, shallowRef as Oe, defineComponent as j, defineAsyncComponent as q, watch as me, createBlock as A, createCommentVNode as T, unref 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 g, openBlock as b, resolveDynamicComponent as Re, mergeProps as _e, 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 M, IconFilledEditMd as
|
|
3
|
+
import { PInputFileUploader as Ye, PInput as M, IconFilledEditMd as _, 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
4
|
function ea(l, i = 2) {
|
|
5
5
|
if (l === 0)
|
|
6
6
|
return "0 B";
|
|
@@ -217,32 +217,32 @@ const sa = {
|
|
|
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: i }) {
|
|
220
|
-
const t = i, n = w(!0), { currentDialog: p, dialogPayload: v, closeDialog: B } = ee(),
|
|
221
|
-
email: q(() => import("./ProfileEmailDialog-
|
|
222
|
-
phone: q(() => import("./ProfilePhoneDialog-
|
|
223
|
-
password: q(() => import("./ProfilePasswordDialog-
|
|
224
|
-
}, c = ({ email:
|
|
225
|
-
t("update-email-field",
|
|
226
|
-
}, s = ({ phone:
|
|
227
|
-
t("update-phone-field",
|
|
220
|
+
const t = i, n = w(!0), { currentDialog: p, dialogPayload: v, closeDialog: B } = ee(), d = {
|
|
221
|
+
email: q(() => import("./ProfileEmailDialog-fkiqQ4WV.js")),
|
|
222
|
+
phone: q(() => import("./ProfilePhoneDialog-C2iDBDNA.js")),
|
|
223
|
+
password: q(() => import("./ProfilePasswordDialog-DYK3bH4Y.js"))
|
|
224
|
+
}, c = ({ email: f }) => {
|
|
225
|
+
t("update-email-field", f);
|
|
226
|
+
}, s = ({ phone: f }) => {
|
|
227
|
+
t("update-phone-field", f);
|
|
228
228
|
};
|
|
229
|
-
return me(p, (
|
|
230
|
-
n.value = !!
|
|
231
|
-
}), (
|
|
229
|
+
return me(p, (f) => {
|
|
230
|
+
n.value = !!f;
|
|
231
|
+
}), (f, u) => g(p) ? (b(), A(Re(d[g(p)]), _e({
|
|
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:
|
|
234
|
+
"onUpdate:modelValue": u[0] || (u[0] = (m) => n.value = m),
|
|
235
|
+
language: f.language,
|
|
236
|
+
provider: f.provider,
|
|
237
|
+
"disable-add-phone": f.disableAddPhone
|
|
238
|
+
}, g(v), {
|
|
239
|
+
onClose: g(B),
|
|
240
|
+
onCleanInputErrors: u[1] || (u[1] = (m) => t("clean-input-errors")),
|
|
241
|
+
onOnUpdateJwt: u[2] || (u[2] = (m, y, r) => t("on-update-jwt", m, y, r)),
|
|
242
242
|
onSubmitEmail: c,
|
|
243
243
|
onSubmitPhone: s,
|
|
244
|
-
onOnPasswordError:
|
|
245
|
-
onOnToast:
|
|
244
|
+
onOnPasswordError: u[3] || (u[3] = (m, y) => t("on-password-error", m, y)),
|
|
245
|
+
onOnToast: u[4] || (u[4] = (m) => t("on-toast", m))
|
|
246
246
|
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : T("", !0);
|
|
247
247
|
}
|
|
248
248
|
}), ua = { class: "base-container" }, da = {
|
|
@@ -278,7 +278,7 @@ const sa = {
|
|
|
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: i }) {
|
|
281
|
-
const t = l, n = i, p = D(() => t.language ?? "ru"), v = (e) => sa[p.value][e] || e, { openDialog: B } = ee(),
|
|
281
|
+
const t = l, n = i, p = D(() => t.language ?? "ru"), v = (e) => sa[p.value][e] || e, { openDialog: B } = ee(), d = W({ firstName: "", lastName: "" }), c = w({ firstName: "", lastName: "" }), s = W({ firstName: !1, lastName: !1, email: !1, phone: !1 }), f = w(""), u = w(""), m = w(""), y = w(!1), r = W({
|
|
282
282
|
value: null,
|
|
283
283
|
loading: !1,
|
|
284
284
|
accept: ["image/png", "image/jpeg"],
|
|
@@ -286,23 +286,23 @@ const sa = {
|
|
|
286
286
|
// 10 MB
|
|
287
287
|
imageBinary: null,
|
|
288
288
|
imageContent: ""
|
|
289
|
-
}), N = w(""), C = w(!1), I = w(!0), F = w(!0), V = w(void 0), ae = w(""), ge = D(() => oe(
|
|
289
|
+
}), N = w(""), C = w(!1), I = w(!0), F = w(!0), V = w(void 0), ae = w(""), ge = D(() => oe(d.firstName, s.firstName)), ve = D(() => oe(d.lastName, s.lastName)), he = D(() => s.email && !u.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 = D(() => !!(
|
|
292
|
+
}, 0), we = D(() => !!(u.value && u.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
296
|
}, Ee = (e) => B("email", { mode: e ? "edit" : "bind", initialEmail: e }), Pe = () => {
|
|
297
|
-
J(), s.email = !1, F.value = !1, n("open-email-dialog",
|
|
297
|
+
J(), s.email = !1, F.value = !1, n("open-email-dialog", u.value, te(u.value)), Ee(u.value);
|
|
298
298
|
}, Ne = () => {
|
|
299
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 && (u.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
|
+
u.value = e;
|
|
306
306
|
}, Ue = (e, a) => {
|
|
307
307
|
C.value = !0, n("on-password-error", e, a);
|
|
308
308
|
}, Be = () => {
|
|
@@ -311,16 +311,16 @@ const sa = {
|
|
|
311
311
|
C.value = !0, V.value = e.color ?? "", ae.value = e.text ?? "";
|
|
312
312
|
}, L = (e) => {
|
|
313
313
|
if (s[e] = !0, e === "firstName" || e === "lastName") {
|
|
314
|
-
const a =
|
|
315
|
-
a.length > 40 && (
|
|
314
|
+
const a = d[e];
|
|
315
|
+
a.length > 40 && (d[e] = a.slice(0, 40));
|
|
316
316
|
}
|
|
317
317
|
}, De = (e) => {
|
|
318
|
-
var O,
|
|
318
|
+
var O, R;
|
|
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 = ((
|
|
323
|
+
const a = ((O = e.fileBinary) == null ? void 0 : O.type) ?? "", o = ((R = e.fileBinary) == null ? void 0 : R.size) ?? 0, k = !["image/png", "image/jpeg"].includes(a), P = o > r.uploadLimit;
|
|
324
324
|
if (k || P) {
|
|
325
325
|
N.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", ne();
|
|
326
326
|
return;
|
|
@@ -359,7 +359,7 @@ 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/${f.value}`, E, { headers: { "Content-Type": void 0 } });
|
|
363
363
|
} catch (E) {
|
|
364
364
|
console.error(E), z({
|
|
365
365
|
color: "error",
|
|
@@ -376,14 +376,14 @@ 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 = d[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 && (d.firstName = P.user.firstName ?? d.firstName, d.lastName = P.user.lastName ?? d.lastName, c.value = {
|
|
385
|
+
firstName: d.firstName,
|
|
386
|
+
lastName: d.lastName
|
|
387
387
|
});
|
|
388
388
|
} catch (k) {
|
|
389
389
|
throw k;
|
|
@@ -407,9 +407,9 @@ const sa = {
|
|
|
407
407
|
privateFirstName: k,
|
|
408
408
|
privateLastName: P,
|
|
409
409
|
email: O,
|
|
410
|
-
phoneNumber:
|
|
410
|
+
phoneNumber: R
|
|
411
411
|
} = o;
|
|
412
|
-
|
|
412
|
+
f.value = E ?? "", d.firstName = k ?? "", d.lastName = P ?? "", u.value = O ?? "", m.value = R ?? "", r.imageContent = await $e(), c.value = {
|
|
413
413
|
firstName: k ?? "",
|
|
414
414
|
lastName: P ?? ""
|
|
415
415
|
};
|
|
@@ -437,7 +437,7 @@ const sa = {
|
|
|
437
437
|
const ie = D(() => {
|
|
438
438
|
if (!c.value.firstName && !c.value.lastName)
|
|
439
439
|
return !1;
|
|
440
|
-
const e =
|
|
440
|
+
const e = d.firstName.trim(), a = d.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
441
|
return k && P;
|
|
442
442
|
}), ze = async () => {
|
|
443
443
|
if (ie.value)
|
|
@@ -469,7 +469,7 @@ const sa = {
|
|
|
469
469
|
onOnToast: z
|
|
470
470
|
}, null, 8, ["language", "provider", "disable-add-phone"]),
|
|
471
471
|
Y("div", ua, [
|
|
472
|
-
S("avatar") ? (b(), A(
|
|
472
|
+
S("avatar") ? (b(), A(g(Ye), {
|
|
473
473
|
key: 0,
|
|
474
474
|
modelValue: r.value,
|
|
475
475
|
"onUpdate:modelValue": [
|
|
@@ -490,38 +490,38 @@ const sa = {
|
|
|
490
490
|
X($(be.value), 1)
|
|
491
491
|
]),
|
|
492
492
|
subtext: x(() => [
|
|
493
|
-
N.value ? (b(), U("span", da, $(N.value), 1)) : (b(), U("span", ma, $(`${v("Формат")} ${
|
|
493
|
+
N.value ? (b(), U("span", da, $(N.value), 1)) : (b(), U("span", ma, $(`${v("Формат")} ${g(ta)(r.accept).join(", ")} ${v("до")} ${g(ea)(r.uploadLimit)}`), 1))
|
|
494
494
|
]),
|
|
495
495
|
_: 1
|
|
496
496
|
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : T("", !0),
|
|
497
497
|
S("firstName") ? (b(), U("div", pa, [
|
|
498
|
-
h(
|
|
499
|
-
modelValue:
|
|
500
|
-
"onUpdate:modelValue": a[2] || (a[2] = (o) =>
|
|
498
|
+
h(g(M), {
|
|
499
|
+
modelValue: d.firstName,
|
|
500
|
+
"onUpdate:modelValue": a[2] || (a[2] = (o) => d.firstName = o),
|
|
501
501
|
size: "large",
|
|
502
502
|
label: v("Имя"),
|
|
503
503
|
error: ge.value,
|
|
504
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(
|
|
507
|
+
h(g(_), { class: "icon-locked" })
|
|
508
508
|
])) : T("", !0),
|
|
509
509
|
S("lastName") ? (b(), U("div", ca, [
|
|
510
|
-
h(
|
|
511
|
-
modelValue:
|
|
512
|
-
"onUpdate:modelValue": a[5] || (a[5] = (o) =>
|
|
510
|
+
h(g(M), {
|
|
511
|
+
modelValue: d.lastName,
|
|
512
|
+
"onUpdate:modelValue": a[5] || (a[5] = (o) => d.lastName = o),
|
|
513
513
|
size: "large",
|
|
514
514
|
label: v("Фамилия"),
|
|
515
515
|
error: ve.value,
|
|
516
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(
|
|
519
|
+
h(g(_), { class: "icon-locked" })
|
|
520
520
|
])) : T("", !0),
|
|
521
521
|
S("email") ? (b(), U("div", fa, [
|
|
522
|
-
h(
|
|
523
|
-
modelValue:
|
|
524
|
-
"onUpdate:modelValue": a[8] || (a[8] = (o) =>
|
|
522
|
+
h(g(M), {
|
|
523
|
+
modelValue: u.value,
|
|
524
|
+
"onUpdate:modelValue": a[8] || (a[8] = (o) => u.value = o),
|
|
525
525
|
size: "large",
|
|
526
526
|
"text-size": "medium",
|
|
527
527
|
label: "E-mail",
|
|
@@ -533,10 +533,10 @@ const sa = {
|
|
|
533
533
|
onInput: a[10] || (a[10] = (o) => L("email")),
|
|
534
534
|
onClick: Pe
|
|
535
535
|
}, null, 8, ["modelValue", "error"]),
|
|
536
|
-
h(
|
|
536
|
+
h(g(_), { class: "icon-locked" })
|
|
537
537
|
])) : T("", !0),
|
|
538
538
|
S("phone") ? (b(), U("div", ga, [
|
|
539
|
-
h(
|
|
539
|
+
h(g(M), {
|
|
540
540
|
modelValue: m.value,
|
|
541
541
|
"onUpdate:modelValue": a[11] || (a[11] = (o) => m.value = o),
|
|
542
542
|
size: "large",
|
|
@@ -550,10 +550,10 @@ const sa = {
|
|
|
550
550
|
onInput: a[13] || (a[13] = (o) => L("phone")),
|
|
551
551
|
onClick: Ne
|
|
552
552
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
553
|
-
h(
|
|
553
|
+
h(g(_), { class: "icon-locked" })
|
|
554
554
|
])) : T("", !0),
|
|
555
555
|
Y("div", va, [
|
|
556
|
-
we.value ? (b(), A(
|
|
556
|
+
we.value ? (b(), A(g(de), {
|
|
557
557
|
key: 0,
|
|
558
558
|
color: "secondary",
|
|
559
559
|
onClick: Le
|
|
@@ -563,7 +563,7 @@ const sa = {
|
|
|
563
563
|
]),
|
|
564
564
|
_: 1
|
|
565
565
|
})) : T("", !0),
|
|
566
|
-
h(
|
|
566
|
+
h(g(de), {
|
|
567
567
|
disabled: !ie.value,
|
|
568
568
|
onClick: ze
|
|
569
569
|
}, {
|
|
@@ -579,7 +579,7 @@ const sa = {
|
|
|
579
579
|
to: "body"
|
|
580
580
|
}, [
|
|
581
581
|
y.value ? (b(), U("div", ha, [
|
|
582
|
-
h(
|
|
582
|
+
h(g(Xe), {
|
|
583
583
|
"circle-mode": !0,
|
|
584
584
|
"model-value": r.imageContent,
|
|
585
585
|
onClose: Fe,
|
|
@@ -592,7 +592,7 @@ const sa = {
|
|
|
592
592
|
Y("div", ya, [
|
|
593
593
|
h(je, { name: "list" }, {
|
|
594
594
|
default: x(() => [
|
|
595
|
-
Je(h(
|
|
595
|
+
Je(h(g(Ke), {
|
|
596
596
|
class: "toast",
|
|
597
597
|
color: V.value,
|
|
598
598
|
text: ae.value,
|
|
@@ -605,7 +605,7 @@ const sa = {
|
|
|
605
605
|
})
|
|
606
606
|
])
|
|
607
607
|
])),
|
|
608
|
-
h(
|
|
608
|
+
h(g(ce))
|
|
609
609
|
], 64));
|
|
610
610
|
}
|
|
611
611
|
}), fe = (l, i) => {
|
|
@@ -634,11 +634,11 @@ const sa = {
|
|
|
634
634
|
n("phone", { initialPhone: c, mode: s });
|
|
635
635
|
}, B = () => {
|
|
636
636
|
n("password");
|
|
637
|
-
},
|
|
638
|
-
t("on-update-jwt", c, s,
|
|
637
|
+
}, d = (c, s, f) => {
|
|
638
|
+
t("on-update-jwt", c, s, f);
|
|
639
639
|
};
|
|
640
640
|
return (c, s) => (b(), U(pe, null, [
|
|
641
|
-
h(
|
|
641
|
+
h(g(Ze)),
|
|
642
642
|
h(ba, {
|
|
643
643
|
"throttler-prefix": c.throttlerPrefix,
|
|
644
644
|
provider: c.provider,
|
|
@@ -652,9 +652,9 @@ const sa = {
|
|
|
652
652
|
onOpenEmailDialog: p,
|
|
653
653
|
onOpenPhoneDialog: v,
|
|
654
654
|
onOpenPasswordDialog: B,
|
|
655
|
-
onOnUpdateJwt:
|
|
655
|
+
onOnUpdateJwt: d
|
|
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(g(ce))
|
|
658
658
|
], 64));
|
|
659
659
|
}
|
|
660
660
|
}), Ea = 10, Pa = 15;
|
|
@@ -698,11 +698,11 @@ const Ia = { class: "smart-input" }, Aa = /* @__PURE__ */ j({
|
|
|
698
698
|
emits: ["update:modelValue", "validity-change", "type-change"],
|
|
699
699
|
setup(l, { emit: i }) {
|
|
700
700
|
const t = l, n = i, p = D(() => {
|
|
701
|
-
var s,
|
|
701
|
+
var s, f, u, m, y, r, N, C, I, F, V;
|
|
702
702
|
return {
|
|
703
703
|
mode: ((s = t.config) == null ? void 0 : s.mode) ?? "auto",
|
|
704
704
|
phone: {
|
|
705
|
-
enabled: ((
|
|
705
|
+
enabled: ((u = (f = t.config) == null ? void 0 : f.phone) == null ? void 0 : u.enabled) ?? !0,
|
|
706
706
|
minDigits: ((y = (m = t.config) == null ? void 0 : m.phone) == null ? void 0 : y.minDigits) ?? 10,
|
|
707
707
|
maxDigits: ((N = (r = t.config) == null ? void 0 : r.phone) == null ? void 0 : N.maxDigits) ?? 15,
|
|
708
708
|
autoPlus: ((I = (C = t.config) == null ? void 0 : C.phone) == null ? void 0 : I.autoPlus) ?? !0
|
|
@@ -711,53 +711,56 @@ const Ia = { class: "smart-input" }, Aa = /* @__PURE__ */ j({
|
|
|
711
711
|
enabled: ((V = (F = t.config) == null ? void 0 : F.email) == null ? void 0 : V.enabled) ?? !0
|
|
712
712
|
}
|
|
713
713
|
};
|
|
714
|
-
}), v = w(t.modelValue ?? ""), B = w(null),
|
|
714
|
+
}), v = w(t.modelValue ?? ""), B = w(null), d = w("");
|
|
715
715
|
me(() => t.modelValue, (s) => {
|
|
716
716
|
s !== void 0 && (v.value = s);
|
|
717
717
|
});
|
|
718
718
|
function c(s) {
|
|
719
719
|
var y, r, N;
|
|
720
|
-
if (
|
|
721
|
-
const
|
|
722
|
-
B.value =
|
|
723
|
-
let
|
|
724
|
-
if (
|
|
720
|
+
if (d.value = "", typeof s != "string") return;
|
|
721
|
+
const f = p.value.mode === "auto" ? Da(s, p.value) : p.value.mode;
|
|
722
|
+
B.value = f, n("type-change", f);
|
|
723
|
+
let u = s, m = !0;
|
|
724
|
+
if (f === "phone") {
|
|
725
725
|
const C = Na(
|
|
726
726
|
s,
|
|
727
727
|
p.value.phone.autoPlus,
|
|
728
728
|
t.locale
|
|
729
729
|
);
|
|
730
|
-
if (Ca(C).length > p.value.phone.maxDigits)
|
|
730
|
+
if (Ca(C).length > p.value.phone.maxDigits) {
|
|
731
|
+
n("validity-change", !1);
|
|
731
732
|
return;
|
|
732
|
-
|
|
733
|
+
}
|
|
734
|
+
Ta(s) && (d.value = ((y = t.errorMessages) == null ? void 0 : y.invalidPhoneChars) ?? "Допустимы только цифры и знак +", m = !1), ka(
|
|
733
735
|
C,
|
|
734
736
|
p.value.phone.minDigits,
|
|
735
737
|
p.value.phone.maxDigits
|
|
736
|
-
) || (
|
|
738
|
+
) || (d.value || (d.value = ((r = t.errorMessages) == null ? void 0 : r.invalidPhoneLength) ?? "Это не похоже на номер телефона"), m = !1), u = C, n("validity-change", m);
|
|
737
739
|
}
|
|
738
|
-
|
|
740
|
+
f === "email" && (m = Ba(s), m || (d.value = ((N = t.errorMessages) == null ? void 0 : N.invalidEmail) ?? "Это не похоже на email"), n("validity-change", m)), v.value = u, n("update:modelValue", u);
|
|
739
741
|
}
|
|
740
|
-
return (s,
|
|
741
|
-
h(
|
|
742
|
+
return (s, f) => (b(), U("div", Ia, [
|
|
743
|
+
h(g(M), {
|
|
742
744
|
"model-value": v.value,
|
|
743
745
|
readonly: s.disabled,
|
|
744
|
-
error:
|
|
746
|
+
error: d.value,
|
|
745
747
|
type: s.type ?? "text",
|
|
746
748
|
size: s.size ?? "large",
|
|
747
749
|
label: s.label ?? "Email или телефон",
|
|
750
|
+
onBeforeInput: f[0] || (f[0] = (u) => console.log("beforeinput", u)),
|
|
748
751
|
"onUpdate:modelValue": c
|
|
749
752
|
}, null, 8, ["model-value", "readonly", "error", "type", "size", "label"]),
|
|
750
|
-
B.value === "phone" ? (b(), A(
|
|
753
|
+
B.value === "phone" ? (b(), A(g(He), {
|
|
751
754
|
key: 0,
|
|
752
755
|
class: "smart-input__icon"
|
|
753
756
|
})) : T("", !0),
|
|
754
|
-
B.value === "email" ? (b(), A(
|
|
757
|
+
B.value === "email" ? (b(), A(g(Qe), {
|
|
755
758
|
key: 1,
|
|
756
759
|
class: "smart-input__icon"
|
|
757
760
|
})) : T("", !0)
|
|
758
761
|
]));
|
|
759
762
|
}
|
|
760
|
-
}), za = /* @__PURE__ */ fe(Aa, [["__scopeId", "data-v-
|
|
763
|
+
}), za = /* @__PURE__ */ fe(Aa, [["__scopeId", "data-v-01dc0d3f"]]);
|
|
761
764
|
export {
|
|
762
765
|
$a as B,
|
|
763
766
|
xa as C,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
import { a as o, i as r } from "./index-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".avatar-input[data-v-a56fcdbb] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-a56fcdbb] .p-input-file:hover .overlay{visibility:visible}.smart-input[data-v-01dc0d3f]{position:relative;width:100%}.smart-input__icon[data-v-01dc0d3f]{position:absolute;top:16px;right:16px;pointer-events:none;opacity:.5}.icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:100%;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;max-width:100%;word-wrap:break-word;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { a as o, i as r } from "./index-CEiwFzrU.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-CEiwFzrU.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")}`;
|