@yourgoods/ui-smart 0.53.1 → 0.53.2
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-CD76TKwr.js → ProfileEmailDialog-B6z854fI.js} +2 -2
- package/dist/{ProfilePasswordDialog-BXoZ16Z1.js → ProfilePasswordDialog-0-DWUWWy.js} +1 -1
- package/dist/{ProfilePhoneDialog-CYQqEfo6.js → ProfilePhoneDialog-lTYWd7Fh.js} +2 -2
- package/dist/{index-C_oi-ArN.js → index-Dj7mvO3s.js} +105 -103
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-CnywCMJ5.js → useRateLimitToast-gOJ9qTgF.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-gOJ9qTgF.js";
|
|
3
|
+
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-Dj7mvO3s.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-Dj7mvO3s.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-gOJ9qTgF.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-Dj7mvO3s.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 w, shallowRef as _e, defineComponent as j, defineAsyncComponent as q, watch as me, createBlock as I, createCommentVNode as C, unref as
|
|
1
|
+
import { ref as w, shallowRef as _e, defineComponent as j, defineAsyncComponent as q, watch as me, createBlock as I, createCommentVNode as C, unref as g, openBlock as b, resolveDynamicComponent as Oe, mergeProps as Re, computed as U, reactive as W, onMounted as Ge, createElementBlock as k, Fragment as pe, createVNode as h, createElementVNode as Y, withCtx as S, 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
3
|
import { PInputFileUploader as Ye, PInput as z, 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
4
|
function et(r, s = 2) {
|
|
5
5
|
if (r === 0)
|
|
6
6
|
return "0 B";
|
|
7
|
-
const a = 1024, l = ["B", "KB", "MB", "GB", "TB", "PB", "EB"],
|
|
8
|
-
return `${Number.parseFloat((r / a **
|
|
7
|
+
const a = 1024, l = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], m = Math.floor(Math.log(r) / Math.log(a));
|
|
8
|
+
return `${Number.parseFloat((r / a ** m).toFixed(s))} ${l[m]}`;
|
|
9
9
|
}
|
|
10
10
|
const tt = {
|
|
11
11
|
"image/jpeg": "JPEG",
|
|
@@ -66,8 +66,8 @@ function ee() {
|
|
|
66
66
|
return {
|
|
67
67
|
currentDialog: G,
|
|
68
68
|
dialogPayload: K,
|
|
69
|
-
openDialog: (l,
|
|
70
|
-
G.value = l, K.value =
|
|
69
|
+
openDialog: (l, m) => {
|
|
70
|
+
G.value = l, K.value = m ?? null;
|
|
71
71
|
},
|
|
72
72
|
closeDialog: () => {
|
|
73
73
|
G.value = null, K.value = null;
|
|
@@ -217,32 +217,32 @@ const st = {
|
|
|
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(r, { emit: s }) {
|
|
220
|
-
const a = s, l = w(!0), { currentDialog:
|
|
221
|
-
email: q(() => import("./ProfileEmailDialog-
|
|
222
|
-
phone: q(() => import("./ProfilePhoneDialog-
|
|
223
|
-
password: q(() => import("./ProfilePasswordDialog-
|
|
224
|
-
},
|
|
225
|
-
a("update-email-field",
|
|
226
|
-
}, i = ({ phone:
|
|
227
|
-
a("update-phone-field",
|
|
220
|
+
const a = s, l = w(!0), { currentDialog: m, dialogPayload: v, closeDialog: T } = ee(), d = {
|
|
221
|
+
email: q(() => import("./ProfileEmailDialog-B6z854fI.js")),
|
|
222
|
+
phone: q(() => import("./ProfilePhoneDialog-lTYWd7Fh.js")),
|
|
223
|
+
password: q(() => import("./ProfilePasswordDialog-0-DWUWWy.js"))
|
|
224
|
+
}, p = ({ email: f }) => {
|
|
225
|
+
a("update-email-field", f);
|
|
226
|
+
}, i = ({ phone: f }) => {
|
|
227
|
+
a("update-phone-field", f);
|
|
228
228
|
};
|
|
229
|
-
return me(
|
|
230
|
-
l.value = !!
|
|
231
|
-
}), (
|
|
229
|
+
return me(m, (f) => {
|
|
230
|
+
l.value = !!f;
|
|
231
|
+
}), (f, u) => g(m) ? (b(), I(Oe(d[g(m)]), Re({
|
|
232
232
|
key: 0,
|
|
233
233
|
modelValue: l.value,
|
|
234
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
235
|
-
language:
|
|
236
|
-
provider:
|
|
237
|
-
"disable-add-phone":
|
|
238
|
-
},
|
|
239
|
-
onClose:
|
|
240
|
-
onCleanInputErrors: u[1] || (u[1] = (
|
|
241
|
-
onOnUpdateJwt: u[2] || (u[2] = (
|
|
242
|
-
onSubmitEmail:
|
|
234
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => l.value = c),
|
|
235
|
+
language: f.language,
|
|
236
|
+
provider: f.provider,
|
|
237
|
+
"disable-add-phone": f.disableAddPhone
|
|
238
|
+
}, g(v), {
|
|
239
|
+
onClose: g(T),
|
|
240
|
+
onCleanInputErrors: u[1] || (u[1] = (c) => a("clean-input-errors")),
|
|
241
|
+
onOnUpdateJwt: u[2] || (u[2] = (c, y, n) => a("on-update-jwt", c, y, n)),
|
|
242
|
+
onSubmitEmail: p,
|
|
243
243
|
onSubmitPhone: i,
|
|
244
|
-
onOnPasswordError: u[3] || (u[3] = (
|
|
245
|
-
onOnToast: u[4] || (u[4] = (
|
|
244
|
+
onOnPasswordError: u[3] || (u[3] = (c, y) => a("on-password-error", c, y)),
|
|
245
|
+
onOnToast: u[4] || (u[4] = (c) => a("on-toast", c))
|
|
246
246
|
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : C("", !0);
|
|
247
247
|
}
|
|
248
248
|
}), ut = { class: "base-container" }, dt = {
|
|
@@ -278,7 +278,7 @@ const st = {
|
|
|
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(r, { emit: s }) {
|
|
281
|
-
const a = r, l = s,
|
|
281
|
+
const a = r, l = s, m = U(() => a.language ?? "ru"), v = (e) => st[m.value][e] || e, { openDialog: T } = ee(), d = W({ firstName: "", lastName: "" }), p = w({ firstName: "", lastName: "" }), i = W({ firstName: !1, lastName: !1, email: !1, phone: !1 }), f = w(""), u = w(""), c = w(""), y = w(!1), n = W({
|
|
282
282
|
value: null,
|
|
283
283
|
loading: !1,
|
|
284
284
|
accept: ["image/png", "image/jpeg"],
|
|
@@ -286,7 +286,7 @@ const st = {
|
|
|
286
286
|
// 10 MB
|
|
287
287
|
imageBinary: null,
|
|
288
288
|
imageContent: ""
|
|
289
|
-
}), B = w(""), D = w(!1), A = w(!0), F = w(!0), V = w(void 0), te = w(""), ge = U(() => oe(d.firstName, i.firstName)), ve = U(() => oe(d.lastName, i.lastName)), he = U(() => i.email && !u.value.trim() ? "Введите e-mail" : ""), ye = U(() => i.phone && !
|
|
289
|
+
}), B = w(""), D = w(!1), A = w(!0), F = w(!0), V = w(void 0), te = w(""), ge = U(() => oe(d.firstName, i.firstName)), ve = U(() => oe(d.lastName, i.lastName)), he = U(() => i.email && !u.value.trim() ? "Введите e-mail" : ""), ye = U(() => i.phone && !c.value.trim() ? "Введите номер телефона" : ""), x = (e) => a.fields.some((t) => t.key === e), ae = (e) => e && e.trim() ? "edit" : "bind", J = () => setTimeout(() => {
|
|
290
290
|
var e;
|
|
291
291
|
return (e = document.activeElement) == null ? void 0 : e.blur();
|
|
292
292
|
}, 0), we = U(() => !!(u.value && u.value.trim() !== "")), be = U(() => n.imageContent ? v("Загрузить другое фото") : v("Загрузить фото")), oe = (e, t) => {
|
|
@@ -296,11 +296,11 @@ const st = {
|
|
|
296
296
|
}, Ee = (e) => T("email", { mode: e ? "edit" : "bind", initialEmail: e }), Pe = () => {
|
|
297
297
|
J(), i.email = !1, F.value = !1, l("open-email-dialog", u.value, ae(u.value)), Ee(u.value);
|
|
298
298
|
}, Ne = () => {
|
|
299
|
-
J(), i.phone = !1, A.value = !1, l("open-phone-dialog",
|
|
299
|
+
J(), i.phone = !1, A.value = !1, l("open-phone-dialog", c.value, ae(c.value));
|
|
300
300
|
}, Ce = async (e, t, o) => {
|
|
301
|
-
e === "email" && o && (u.value = o), e === "phone" && o && (
|
|
301
|
+
e === "email" && o && (u.value = o), e === "phone" && o && (c.value = o), l("on-update-jwt");
|
|
302
302
|
}, ke = (e) => {
|
|
303
|
-
|
|
303
|
+
c.value = e;
|
|
304
304
|
}, Te = (e) => {
|
|
305
305
|
u.value = e;
|
|
306
306
|
}, Ue = (e, t) => {
|
|
@@ -359,7 +359,7 @@ const st = {
|
|
|
359
359
|
try {
|
|
360
360
|
n.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), L({
|
|
365
365
|
color: "error",
|
|
@@ -381,7 +381,7 @@ const st = {
|
|
|
381
381
|
try {
|
|
382
382
|
le.value = !0;
|
|
383
383
|
const P = (E = (await H("/users/profile/update-name", { [e]: t })).data) == null ? void 0 : E.data;
|
|
384
|
-
P != null && P.user && (d.firstName = P.user.firstName ?? d.firstName, d.lastName = P.user.lastName ?? d.lastName,
|
|
384
|
+
P != null && P.user && (d.firstName = P.user.firstName ?? d.firstName, d.lastName = P.user.lastName ?? d.lastName, p.value = {
|
|
385
385
|
firstName: d.firstName,
|
|
386
386
|
lastName: d.lastName
|
|
387
387
|
});
|
|
@@ -409,7 +409,7 @@ const st = {
|
|
|
409
409
|
email: _,
|
|
410
410
|
phoneNumber: O
|
|
411
411
|
} = o;
|
|
412
|
-
|
|
412
|
+
f.value = E ?? "", d.firstName = N ?? "", d.lastName = P ?? "", u.value = _ ?? "", c.value = O ?? "", n.imageContent = await $e(), p.value = {
|
|
413
413
|
firstName: N ?? "",
|
|
414
414
|
lastName: P ?? ""
|
|
415
415
|
};
|
|
@@ -435,9 +435,9 @@ const st = {
|
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
const ie = U(() => {
|
|
438
|
-
if (!
|
|
438
|
+
if (!p.value.firstName && !p.value.lastName)
|
|
439
439
|
return !1;
|
|
440
|
-
const e = d.firstName.trim(), t = d.lastName.trim(), o =
|
|
440
|
+
const e = d.firstName.trim(), t = d.lastName.trim(), o = p.value.firstName.trim(), E = p.value.lastName.trim(), N = e !== o || t !== E, P = e.length >= 2 && t.length >= 2;
|
|
441
441
|
return N && P;
|
|
442
442
|
}), Le = async () => {
|
|
443
443
|
if (ie.value)
|
|
@@ -458,7 +458,7 @@ const st = {
|
|
|
458
458
|
ot(a.accessToken, a.requestUrl, a.throttlerPrefix), await Se();
|
|
459
459
|
}), (e, t) => (b(), k(pe, null, [
|
|
460
460
|
h(it, {
|
|
461
|
-
language:
|
|
461
|
+
language: m.value,
|
|
462
462
|
provider: e.provider,
|
|
463
463
|
"disable-add-phone": e.disableAddPhone,
|
|
464
464
|
onCleanInputErrors: Be,
|
|
@@ -469,7 +469,7 @@ const st = {
|
|
|
469
469
|
onOnToast: L
|
|
470
470
|
}, null, 8, ["language", "provider", "disable-add-phone"]),
|
|
471
471
|
Y("div", ut, [
|
|
472
|
-
x("avatar") ? (b(), I(
|
|
472
|
+
x("avatar") ? (b(), I(g(Ye), {
|
|
473
473
|
key: 0,
|
|
474
474
|
modelValue: n.value,
|
|
475
475
|
"onUpdate:modelValue": [
|
|
@@ -490,12 +490,12 @@ const st = {
|
|
|
490
490
|
X($(be.value), 1)
|
|
491
491
|
]),
|
|
492
492
|
subtext: S(() => [
|
|
493
|
-
B.value ? (b(), k("span", dt, $(B.value), 1)) : (b(), k("span", mt, $(`${v("Формат")} ${
|
|
493
|
+
B.value ? (b(), k("span", dt, $(B.value), 1)) : (b(), k("span", mt, $(`${v("Формат")} ${g(at)(n.accept).join(", ")} ${v("до")} ${g(et)(n.uploadLimit)}`), 1))
|
|
494
494
|
]),
|
|
495
495
|
_: 1
|
|
496
496
|
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : C("", !0),
|
|
497
497
|
x("firstName") ? (b(), k("div", pt, [
|
|
498
|
-
h(
|
|
498
|
+
h(g(z), {
|
|
499
499
|
modelValue: d.firstName,
|
|
500
500
|
"onUpdate:modelValue": t[2] || (t[2] = (o) => d.firstName = o),
|
|
501
501
|
size: "large",
|
|
@@ -504,10 +504,10 @@ const st = {
|
|
|
504
504
|
onBlur: t[3] || (t[3] = (o) => i.firstName = !0),
|
|
505
505
|
onInput: t[4] || (t[4] = (o) => M("firstName"))
|
|
506
506
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
507
|
-
h(
|
|
507
|
+
h(g(R), { class: "icon-locked" })
|
|
508
508
|
])) : C("", !0),
|
|
509
509
|
x("lastName") ? (b(), k("div", ct, [
|
|
510
|
-
h(
|
|
510
|
+
h(g(z), {
|
|
511
511
|
modelValue: d.lastName,
|
|
512
512
|
"onUpdate:modelValue": t[5] || (t[5] = (o) => d.lastName = o),
|
|
513
513
|
size: "large",
|
|
@@ -516,10 +516,10 @@ const st = {
|
|
|
516
516
|
onBlur: t[6] || (t[6] = (o) => i.lastName = !0),
|
|
517
517
|
onInput: t[7] || (t[7] = (o) => M("lastName"))
|
|
518
518
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
519
|
-
h(
|
|
519
|
+
h(g(R), { class: "icon-locked" })
|
|
520
520
|
])) : C("", !0),
|
|
521
521
|
x("email") ? (b(), k("div", ft, [
|
|
522
|
-
h(
|
|
522
|
+
h(g(z), {
|
|
523
523
|
modelValue: u.value,
|
|
524
524
|
"onUpdate:modelValue": t[8] || (t[8] = (o) => u.value = o),
|
|
525
525
|
size: "large",
|
|
@@ -533,12 +533,12 @@ const st = {
|
|
|
533
533
|
onInput: t[10] || (t[10] = (o) => M("email")),
|
|
534
534
|
onClick: Pe
|
|
535
535
|
}, null, 8, ["modelValue", "error"]),
|
|
536
|
-
h(
|
|
536
|
+
h(g(R), { class: "icon-locked" })
|
|
537
537
|
])) : C("", !0),
|
|
538
538
|
x("phone") ? (b(), k("div", gt, [
|
|
539
|
-
h(
|
|
540
|
-
modelValue:
|
|
541
|
-
"onUpdate:modelValue": t[11] || (t[11] = (o) =>
|
|
539
|
+
h(g(z), {
|
|
540
|
+
modelValue: c.value,
|
|
541
|
+
"onUpdate:modelValue": t[11] || (t[11] = (o) => c.value = o),
|
|
542
542
|
size: "large",
|
|
543
543
|
"text-size": "medium",
|
|
544
544
|
label: v("Номер телефона"),
|
|
@@ -550,10 +550,10 @@ const st = {
|
|
|
550
550
|
onInput: t[13] || (t[13] = (o) => M("phone")),
|
|
551
551
|
onClick: Ne
|
|
552
552
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
553
|
-
h(
|
|
553
|
+
h(g(R), { class: "icon-locked" })
|
|
554
554
|
])) : C("", !0),
|
|
555
555
|
Y("div", vt, [
|
|
556
|
-
we.value ? (b(), I(
|
|
556
|
+
we.value ? (b(), I(g(de), {
|
|
557
557
|
key: 0,
|
|
558
558
|
color: "secondary",
|
|
559
559
|
onClick: Me
|
|
@@ -563,7 +563,7 @@ const st = {
|
|
|
563
563
|
]),
|
|
564
564
|
_: 1
|
|
565
565
|
})) : C("", !0),
|
|
566
|
-
h(
|
|
566
|
+
h(g(de), {
|
|
567
567
|
disabled: !ie.value,
|
|
568
568
|
onClick: Le
|
|
569
569
|
}, {
|
|
@@ -579,7 +579,7 @@ const st = {
|
|
|
579
579
|
to: "body"
|
|
580
580
|
}, [
|
|
581
581
|
y.value ? (b(), k("div", ht, [
|
|
582
|
-
h(
|
|
582
|
+
h(g(Xe), {
|
|
583
583
|
"circle-mode": !0,
|
|
584
584
|
"model-value": n.imageContent,
|
|
585
585
|
onClose: Fe,
|
|
@@ -592,7 +592,7 @@ const st = {
|
|
|
592
592
|
Y("div", yt, [
|
|
593
593
|
h(je, { name: "list" }, {
|
|
594
594
|
default: S(() => [
|
|
595
|
-
Je(h(
|
|
595
|
+
Je(h(g(Ke), {
|
|
596
596
|
class: "toast",
|
|
597
597
|
color: V.value,
|
|
598
598
|
text: te.value,
|
|
@@ -605,13 +605,13 @@ const st = {
|
|
|
605
605
|
})
|
|
606
606
|
])
|
|
607
607
|
])),
|
|
608
|
-
h(
|
|
608
|
+
h(g(ce))
|
|
609
609
|
], 64));
|
|
610
610
|
}
|
|
611
611
|
}), fe = (r, s) => {
|
|
612
612
|
const a = r.__vccOpts || r;
|
|
613
|
-
for (const [l,
|
|
614
|
-
a[l] =
|
|
613
|
+
for (const [l, m] of s)
|
|
614
|
+
a[l] = m;
|
|
615
615
|
return a;
|
|
616
616
|
}, bt = /* @__PURE__ */ fe(wt, [["__scopeId", "data-v-a56fcdbb"]]), $t = /* @__PURE__ */ j({
|
|
617
617
|
__name: "index",
|
|
@@ -628,33 +628,33 @@ const st = {
|
|
|
628
628
|
},
|
|
629
629
|
emits: ["on-update-jwt", "update-tokens"],
|
|
630
630
|
setup(r, { emit: s }) {
|
|
631
|
-
const a = s, { openDialog: l } = ee(),
|
|
632
|
-
l("email", { initialEmail:
|
|
633
|
-
}, v = (
|
|
634
|
-
l("phone", { initialPhone:
|
|
631
|
+
const a = s, { openDialog: l } = ee(), m = (p, i) => {
|
|
632
|
+
l("email", { initialEmail: p, mode: i });
|
|
633
|
+
}, v = (p, i) => {
|
|
634
|
+
l("phone", { initialPhone: p, mode: i });
|
|
635
635
|
}, T = () => {
|
|
636
636
|
l("password");
|
|
637
|
-
}, d = (
|
|
638
|
-
a("on-update-jwt",
|
|
637
|
+
}, d = (p, i, f) => {
|
|
638
|
+
a("on-update-jwt", p, i, f);
|
|
639
639
|
};
|
|
640
|
-
return (
|
|
641
|
-
h(
|
|
640
|
+
return (p, i) => (b(), k(pe, null, [
|
|
641
|
+
h(g(Ze)),
|
|
642
642
|
h(bt, {
|
|
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": p.throttlerPrefix,
|
|
644
|
+
provider: p.provider,
|
|
645
|
+
"request-url": p.requestUrl,
|
|
646
|
+
language: p.language,
|
|
647
|
+
fields: p.fields,
|
|
648
|
+
"access-token": p.accessToken,
|
|
649
|
+
"refresh-token": p.refreshToken,
|
|
650
|
+
"aws-storage-url": p.awsStorageUrl,
|
|
651
|
+
"disable-add-phone": p.disableAddPhone,
|
|
652
|
+
onOpenEmailDialog: m,
|
|
653
653
|
onOpenPhoneDialog: v,
|
|
654
654
|
onOpenPasswordDialog: T,
|
|
655
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
|
}), Et = 10, Pt = 15;
|
|
@@ -676,8 +676,9 @@ function Ut(r) {
|
|
|
676
676
|
return Tt.test(r);
|
|
677
677
|
}
|
|
678
678
|
function Bt(r, s) {
|
|
679
|
-
var
|
|
680
|
-
|
|
679
|
+
var l, m;
|
|
680
|
+
const a = r.trim();
|
|
681
|
+
return (l = s.phone) != null && l.enabled && (a.startsWith("+") || /^\d+$/.test(a)) ? "phone" : (m = s.email) != null && m.enabled ? "email" : null;
|
|
681
682
|
}
|
|
682
683
|
const Dt = { class: "smart-input" }, It = /* @__PURE__ */ j({
|
|
683
684
|
__name: "index",
|
|
@@ -688,13 +689,13 @@ const Dt = { class: "smart-input" }, It = /* @__PURE__ */ j({
|
|
|
688
689
|
},
|
|
689
690
|
emits: ["update:modelValue", "validity-change", "type-change"],
|
|
690
691
|
setup(r, { emit: s }) {
|
|
691
|
-
const a = r, l = s,
|
|
692
|
-
var i,
|
|
692
|
+
const a = r, l = s, m = U(() => {
|
|
693
|
+
var i, f, u, c, y, n, B, D, A, F, V;
|
|
693
694
|
return {
|
|
694
695
|
mode: ((i = a.config) == null ? void 0 : i.mode) ?? "auto",
|
|
695
696
|
phone: {
|
|
696
|
-
enabled: ((u = (
|
|
697
|
-
minDigits: ((y = (
|
|
697
|
+
enabled: ((u = (f = a.config) == null ? void 0 : f.phone) == null ? void 0 : u.enabled) ?? !0,
|
|
698
|
+
minDigits: ((y = (c = a.config) == null ? void 0 : c.phone) == null ? void 0 : y.minDigits) ?? 10,
|
|
698
699
|
maxDigits: ((B = (n = a.config) == null ? void 0 : n.phone) == null ? void 0 : B.maxDigits) ?? 15,
|
|
699
700
|
autoPlus: ((A = (D = a.config) == null ? void 0 : D.phone) == null ? void 0 : A.autoPlus) ?? !0
|
|
700
701
|
},
|
|
@@ -702,61 +703,62 @@ const Dt = { class: "smart-input" }, It = /* @__PURE__ */ j({
|
|
|
702
703
|
enabled: ((V = (F = a.config) == null ? void 0 : F.email) == null ? void 0 : V.enabled) ?? !0
|
|
703
704
|
}
|
|
704
705
|
};
|
|
705
|
-
}), v = w(a.modelValue ?? ""), T = w(
|
|
706
|
+
}), v = w(a.modelValue ?? ""), T = w(null), d = w("");
|
|
706
707
|
me(
|
|
707
708
|
() => a.modelValue,
|
|
708
709
|
(i) => {
|
|
709
710
|
i !== void 0 && (v.value = i);
|
|
710
711
|
}
|
|
711
712
|
);
|
|
712
|
-
function
|
|
713
|
+
function p(i) {
|
|
713
714
|
d.value = "";
|
|
714
|
-
const
|
|
715
|
-
T.value =
|
|
715
|
+
const f = m.value.mode === "auto" ? Bt(i, m.value) : m.value.mode;
|
|
716
|
+
T.value = f, l("type-change", f);
|
|
716
717
|
let u = i;
|
|
717
|
-
if (
|
|
718
|
-
const
|
|
718
|
+
if (f === "phone") {
|
|
719
|
+
const c = Nt(
|
|
719
720
|
i,
|
|
720
|
-
|
|
721
|
+
m.value.phone.autoPlus
|
|
721
722
|
);
|
|
722
|
-
i !==
|
|
723
|
-
|
|
724
|
-
|
|
723
|
+
i !== c && (d.value = "Допустимы только цифры и знак + в начале"), u = Ct(
|
|
724
|
+
c,
|
|
725
|
+
m.value.phone.maxDigits
|
|
725
726
|
);
|
|
726
727
|
const y = kt(
|
|
727
728
|
u,
|
|
728
|
-
|
|
729
|
-
|
|
729
|
+
m.value.phone.minDigits,
|
|
730
|
+
m.value.phone.maxDigits
|
|
730
731
|
);
|
|
731
732
|
l("validity-change", y), !y && !d.value && (d.value = "Это не похоже на номер телефона");
|
|
732
733
|
}
|
|
733
|
-
if (
|
|
734
|
-
|
|
735
|
-
|
|
734
|
+
if (f === "email") {
|
|
735
|
+
u = i;
|
|
736
|
+
const c = Ut(i);
|
|
737
|
+
l("validity-change", c), c || (d.value = "Это не похоже на email");
|
|
736
738
|
}
|
|
737
739
|
v.value = u, l("update:modelValue", u);
|
|
738
740
|
}
|
|
739
|
-
return (i,
|
|
740
|
-
h(
|
|
741
|
+
return (i, f) => (b(), k("div", Dt, [
|
|
742
|
+
h(g(z), {
|
|
741
743
|
"model-value": v.value,
|
|
742
744
|
readonly: i.disabled,
|
|
743
745
|
error: d.value,
|
|
744
746
|
type: "text",
|
|
745
747
|
size: "large",
|
|
746
748
|
label: "Email или телефон",
|
|
747
|
-
onInput:
|
|
749
|
+
onInput: f[0] || (f[0] = (u) => p(u.target.value))
|
|
748
750
|
}, null, 8, ["model-value", "readonly", "error"]),
|
|
749
|
-
T.value === "phone" ? (b(), I(
|
|
751
|
+
T.value === "phone" ? (b(), I(g(He), {
|
|
750
752
|
key: 0,
|
|
751
753
|
class: "smart-input__icon"
|
|
752
754
|
})) : C("", !0),
|
|
753
|
-
T.value === "email" ? (b(), I(
|
|
755
|
+
T.value === "email" ? (b(), I(g(Qe), {
|
|
754
756
|
key: 1,
|
|
755
757
|
class: "smart-input__icon"
|
|
756
758
|
})) : C("", !0)
|
|
757
759
|
]));
|
|
758
760
|
}
|
|
759
|
-
}), zt = /* @__PURE__ */ fe(It, [["__scopeId", "data-v-
|
|
761
|
+
}), zt = /* @__PURE__ */ fe(It, [["__scopeId", "data-v-8ba08b36"]]);
|
|
760
762
|
export {
|
|
761
763
|
St as B,
|
|
762
764
|
xt 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-8ba08b36]{position:relative;width:100%}.smart-input__icon[data-v-8ba08b36]{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-Dj7mvO3s.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-Dj7mvO3s.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")}`;
|