@yourgoods/ui-smart 0.53.28 → 0.53.30
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-0YXeEQpX.js → ProfileEmailDialog-LCVrvwnP.js} +2 -2
- package/dist/{ProfilePasswordDialog-BtLwr4Og.js → ProfilePasswordDialog-BruPsgfm.js} +1 -1
- package/dist/{ProfilePhoneDialog-z4e82VF-.js → ProfilePhoneDialog-Adf9uije.js} +2 -2
- package/dist/{index-DoVvDaz3.js → index-DGkhZigd.js} +88 -88
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-B5XfGdXq.js → useRateLimitToast-TLAOlytL.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-TLAOlytL.js";
|
|
3
|
+
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-DGkhZigd.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-DGkhZigd.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-TLAOlytL.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-DGkhZigd.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 y, shallowRef as Re, defineComponent as X, defineAsyncComponent as Z, watch as ge, createBlock as
|
|
1
|
+
import { ref as y, shallowRef as Re, defineComponent as X, defineAsyncComponent as Z, watch as ge, createBlock as x, createCommentVNode as I, unref as p, openBlock as b, resolveDynamicComponent as _e, mergeProps as Oe, computed as A, reactive as H, onMounted as Ge, createElementBlock as U, Fragment as ve, createVNode as w, createElementVNode as Q, withCtx as R, toDisplayString as _, createTextVNode as ee, Teleport as pe, Transition as je, withDirectives as qe, vShow as Je } from "vue";
|
|
2
2
|
import We from "axios";
|
|
3
3
|
import { PInputFileUploader as Ye, PInput as O, IconFilledEditMd as W, PButton as fe, PImageCropper as Xe, PToast as Ke, PTeleportContainer as he, PToastContainer as Ze, IconPhoneMd as He, IconMailMd as Qe } from "@profeat/ui-kit";
|
|
4
4
|
function et(l, s = 2) {
|
|
5
5
|
if (l === 0)
|
|
6
6
|
return "0 B";
|
|
7
|
-
const a = 1024, o = ["B", "KB", "MB", "GB", "TB", "PB", "EB"],
|
|
8
|
-
return `${Number.parseFloat((l / a **
|
|
7
|
+
const a = 1024, o = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], u = Math.floor(Math.log(l) / Math.log(a));
|
|
8
|
+
return `${Number.parseFloat((l / a ** u).toFixed(s))} ${o[u]}`;
|
|
9
9
|
}
|
|
10
10
|
const tt = {
|
|
11
11
|
"image/jpeg": "JPEG",
|
|
@@ -21,7 +21,7 @@ function at(l) {
|
|
|
21
21
|
return tt[s] || ((a = s.split("/")[1]) == null ? void 0 : a.toUpperCase());
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const xt = {
|
|
25
25
|
OLD: "old",
|
|
26
26
|
NEW: "new",
|
|
27
27
|
COMPLETED: "completed"
|
|
@@ -66,8 +66,8 @@ function re() {
|
|
|
66
66
|
return {
|
|
67
67
|
currentDialog: Y,
|
|
68
68
|
dialogPayload: te,
|
|
69
|
-
openDialog: (o,
|
|
70
|
-
Y.value = o, te.value =
|
|
69
|
+
openDialog: (o, u) => {
|
|
70
|
+
Y.value = o, te.value = u ?? null;
|
|
71
71
|
},
|
|
72
72
|
closeDialog: () => {
|
|
73
73
|
Y.value = null, te.value = null;
|
|
@@ -217,18 +217,18 @@ 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(l, { emit: s }) {
|
|
220
|
-
const a = s, o = y(!0), { currentDialog:
|
|
221
|
-
email: Z(() => import("./ProfileEmailDialog-
|
|
222
|
-
phone: Z(() => import("./ProfilePhoneDialog-
|
|
223
|
-
password: Z(() => import("./ProfilePasswordDialog-
|
|
224
|
-
},
|
|
220
|
+
const a = s, o = y(!0), { currentDialog: u, dialogPayload: v, closeDialog: B } = re(), d = {
|
|
221
|
+
email: Z(() => import("./ProfileEmailDialog-LCVrvwnP.js")),
|
|
222
|
+
phone: Z(() => import("./ProfilePhoneDialog-Adf9uije.js")),
|
|
223
|
+
password: Z(() => import("./ProfilePasswordDialog-BruPsgfm.js"))
|
|
224
|
+
}, m = ({ email: E }) => {
|
|
225
225
|
a("update-email-field", E);
|
|
226
226
|
}, c = ({ phone: E }) => {
|
|
227
227
|
a("update-phone-field", E);
|
|
228
228
|
};
|
|
229
|
-
return ge(
|
|
229
|
+
return ge(u, (E) => {
|
|
230
230
|
o.value = !!E;
|
|
231
|
-
}), (E, f) => p(
|
|
231
|
+
}), (E, f) => p(u) ? (b(), x(_e(d[p(u)]), Oe({
|
|
232
232
|
key: 0,
|
|
233
233
|
modelValue: o.value,
|
|
234
234
|
"onUpdate:modelValue": f[0] || (f[0] = (h) => o.value = h),
|
|
@@ -239,7 +239,7 @@ const st = {
|
|
|
239
239
|
onClose: p(B),
|
|
240
240
|
onCleanInputErrors: f[1] || (f[1] = (h) => a("clean-input-errors")),
|
|
241
241
|
onOnUpdateJwt: f[2] || (f[2] = (h, i, n) => a("on-update-jwt", h, i, n)),
|
|
242
|
-
onSubmitEmail:
|
|
242
|
+
onSubmitEmail: m,
|
|
243
243
|
onSubmitPhone: c,
|
|
244
244
|
onOnPasswordError: f[3] || (f[3] = (h, i) => a("on-password-error", h, i)),
|
|
245
245
|
onOnToast: f[4] || (f[4] = (h) => a("on-toast", h))
|
|
@@ -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(l, { emit: s }) {
|
|
281
|
-
const a = l, o = s,
|
|
281
|
+
const a = l, o = s, u = A(() => a.language ?? "ru"), v = (e) => st[u.value][e] || e, { openDialog: B } = re(), d = H({ firstName: "", lastName: "" }), m = y({ firstName: "", lastName: "" }), c = H({ firstName: !1, lastName: !1, email: !1, phone: !1 }), E = y(""), f = y(""), h = y(""), i = y(!1), n = H({
|
|
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
|
-
}), g = y(""), C = y(!1), D = y(!0), V = y(!0), F = y(void 0), S = y(""), P = A(() => se(
|
|
289
|
+
}), g = y(""), C = y(!1), D = y(!0), V = y(!0), F = y(void 0), S = y(""), P = A(() => se(d.firstName, c.firstName)), M = A(() => se(d.lastName, c.lastName)), $ = A(() => c.email && !f.value.trim() ? "Введите e-mail" : ""), z = A(() => c.phone && !h.value.trim() ? "Введите номер телефона" : ""), L = (e) => a.fields.some((t) => t.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
292
|
}, 0), we = A(() => !!(f.value && f.value.trim() !== "")), be = A(() => n.imageContent ? v("Загрузить другое фото") : v("Загрузить фото")), se = (e, t) => {
|
|
@@ -311,8 +311,8 @@ const st = {
|
|
|
311
311
|
C.value = !0, F.value = e.color ?? "", S.value = e.text ?? "";
|
|
312
312
|
}, j = (e) => {
|
|
313
313
|
if (c[e] = !0, e === "firstName" || e === "lastName") {
|
|
314
|
-
const t =
|
|
315
|
-
t.length > 40 && (
|
|
314
|
+
const t = d[e];
|
|
315
|
+
t.length > 40 && (d[e] = t.slice(0, 40));
|
|
316
316
|
}
|
|
317
317
|
}, Be = (e) => {
|
|
318
318
|
var q, J;
|
|
@@ -376,14 +376,14 @@ const st = {
|
|
|
376
376
|
));
|
|
377
377
|
}, de = y(!1), me = async (e) => {
|
|
378
378
|
var r, N;
|
|
379
|
-
const t = (r =
|
|
379
|
+
const t = (r = d[e]) == null ? void 0 : r.trim();
|
|
380
380
|
if (t)
|
|
381
381
|
try {
|
|
382
382
|
de.value = !0;
|
|
383
383
|
const k = (N = (await oe("/users/profile/update-name", { [e]: t })).data) == null ? void 0 : N.data;
|
|
384
|
-
k != null && k.user && (
|
|
385
|
-
firstName:
|
|
386
|
-
lastName:
|
|
384
|
+
k != null && k.user && (d.firstName = k.user.firstName ?? d.firstName, d.lastName = k.user.lastName ?? d.lastName, m.value = {
|
|
385
|
+
firstName: d.firstName,
|
|
386
|
+
lastName: d.lastName
|
|
387
387
|
});
|
|
388
388
|
} catch (T) {
|
|
389
389
|
throw T;
|
|
@@ -409,23 +409,23 @@ const st = {
|
|
|
409
409
|
email: q,
|
|
410
410
|
phoneNumber: J
|
|
411
411
|
} = r;
|
|
412
|
-
E.value = N ?? "",
|
|
412
|
+
E.value = N ?? "", d.firstName = T ?? "", d.lastName = k ?? "", f.value = q ?? "", h.value = J ?? "", n.imageContent = await $e(), m.value = {
|
|
413
413
|
firstName: T ?? "",
|
|
414
414
|
lastName: k ?? ""
|
|
415
415
|
};
|
|
416
416
|
} catch (t) {
|
|
417
417
|
console.error("Критическая ошибка при загрузке профиля:", t);
|
|
418
418
|
}
|
|
419
|
-
},
|
|
419
|
+
}, $e = async () => {
|
|
420
420
|
var e;
|
|
421
421
|
try {
|
|
422
422
|
const r = (e = (await nt("/users/profile/avatar")).data) == null ? void 0 : e.data;
|
|
423
|
-
return r ?
|
|
423
|
+
return r ? xe(r) : "";
|
|
424
424
|
} catch (t) {
|
|
425
425
|
return console.error("Ошибка при загрузке метаданных аватара:", t), "";
|
|
426
426
|
}
|
|
427
427
|
};
|
|
428
|
-
function
|
|
428
|
+
function xe(e) {
|
|
429
429
|
if (!e)
|
|
430
430
|
return "";
|
|
431
431
|
try {
|
|
@@ -435,9 +435,9 @@ const st = {
|
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
const ce = A(() => {
|
|
438
|
-
if (!
|
|
438
|
+
if (!m.value.firstName && !m.value.lastName)
|
|
439
439
|
return !1;
|
|
440
|
-
const e =
|
|
440
|
+
const e = d.firstName.trim(), t = d.lastName.trim(), r = m.value.firstName.trim(), N = m.value.lastName.trim(), T = e !== r || t !== N, k = e.length >= 2 && t.length >= 2;
|
|
441
441
|
return T && k;
|
|
442
442
|
}), ze = async () => {
|
|
443
443
|
if (ce.value)
|
|
@@ -458,7 +458,7 @@ const st = {
|
|
|
458
458
|
ot(a.accessToken, a.requestUrl, a.throttlerPrefix), await Me();
|
|
459
459
|
}), (e, t) => (b(), U(ve, null, [
|
|
460
460
|
w(it, {
|
|
461
|
-
language:
|
|
461
|
+
language: u.value,
|
|
462
462
|
provider: e.provider,
|
|
463
463
|
"disable-add-phone": e.disableAddPhone,
|
|
464
464
|
onCleanInputErrors: Ue,
|
|
@@ -469,7 +469,7 @@ const st = {
|
|
|
469
469
|
onOnToast: G
|
|
470
470
|
}, null, 8, ["language", "provider", "disable-add-phone"]),
|
|
471
471
|
Q("div", ut, [
|
|
472
|
-
L("avatar") ? (b(),
|
|
472
|
+
L("avatar") ? (b(), x(p(Ye), {
|
|
473
473
|
key: 0,
|
|
474
474
|
modelValue: n.value,
|
|
475
475
|
"onUpdate:modelValue": [
|
|
@@ -496,8 +496,8 @@ const st = {
|
|
|
496
496
|
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : I("", !0),
|
|
497
497
|
L("firstName") ? (b(), U("div", ct, [
|
|
498
498
|
w(p(O), {
|
|
499
|
-
modelValue:
|
|
500
|
-
"onUpdate:modelValue": t[2] || (t[2] = (r) =>
|
|
499
|
+
modelValue: d.firstName,
|
|
500
|
+
"onUpdate:modelValue": t[2] || (t[2] = (r) => d.firstName = r),
|
|
501
501
|
size: "large",
|
|
502
502
|
label: v("Имя"),
|
|
503
503
|
error: P.value,
|
|
@@ -508,8 +508,8 @@ const st = {
|
|
|
508
508
|
])) : I("", !0),
|
|
509
509
|
L("lastName") ? (b(), U("div", pt, [
|
|
510
510
|
w(p(O), {
|
|
511
|
-
modelValue:
|
|
512
|
-
"onUpdate:modelValue": t[5] || (t[5] = (r) =>
|
|
511
|
+
modelValue: d.lastName,
|
|
512
|
+
"onUpdate:modelValue": t[5] || (t[5] = (r) => d.lastName = r),
|
|
513
513
|
size: "large",
|
|
514
514
|
label: v("Фамилия"),
|
|
515
515
|
error: M.value,
|
|
@@ -528,7 +528,7 @@ const st = {
|
|
|
528
528
|
type: "email",
|
|
529
529
|
readonly: "",
|
|
530
530
|
style: { cursor: "pointer" },
|
|
531
|
-
error:
|
|
531
|
+
error: $.value && V.value,
|
|
532
532
|
onBlur: t[9] || (t[9] = (r) => c.email = !0),
|
|
533
533
|
onInput: t[10] || (t[10] = (r) => j("email")),
|
|
534
534
|
onClick: Pe
|
|
@@ -553,7 +553,7 @@ const st = {
|
|
|
553
553
|
w(p(W), { class: "icon-locked" })
|
|
554
554
|
])) : I("", !0),
|
|
555
555
|
Q("div", vt, [
|
|
556
|
-
we.value ? (b(),
|
|
556
|
+
we.value ? (b(), x(p(fe), {
|
|
557
557
|
key: 0,
|
|
558
558
|
color: "secondary",
|
|
559
559
|
onClick: Le
|
|
@@ -574,7 +574,7 @@ const st = {
|
|
|
574
574
|
}, 8, ["disabled"])
|
|
575
575
|
])
|
|
576
576
|
]),
|
|
577
|
-
i.value ? (b(),
|
|
577
|
+
i.value ? (b(), x(pe, {
|
|
578
578
|
key: 0,
|
|
579
579
|
to: "body"
|
|
580
580
|
}, [
|
|
@@ -588,7 +588,7 @@ const st = {
|
|
|
588
588
|
}, null, 8, ["model-value"])
|
|
589
589
|
])) : I("", !0)
|
|
590
590
|
])) : I("", !0),
|
|
591
|
-
(b(),
|
|
591
|
+
(b(), x(pe, { to: "#toast-root" }, [
|
|
592
592
|
Q("div", yt, [
|
|
593
593
|
w(je, { name: "list" }, {
|
|
594
594
|
default: R(() => [
|
|
@@ -610,8 +610,8 @@ const st = {
|
|
|
610
610
|
}
|
|
611
611
|
}), ye = (l, s) => {
|
|
612
612
|
const a = l.__vccOpts || l;
|
|
613
|
-
for (const [o,
|
|
614
|
-
a[o] =
|
|
613
|
+
for (const [o, u] of s)
|
|
614
|
+
a[o] = u;
|
|
615
615
|
return a;
|
|
616
616
|
}, bt = /* @__PURE__ */ ye(wt, [["__scopeId", "data-v-a56fcdbb"]]), Lt = /* @__PURE__ */ X({
|
|
617
617
|
__name: "index",
|
|
@@ -628,38 +628,38 @@ const st = {
|
|
|
628
628
|
},
|
|
629
629
|
emits: ["on-update-jwt", "update-tokens"],
|
|
630
630
|
setup(l, { emit: s }) {
|
|
631
|
-
const a = s, { openDialog: o } = re(),
|
|
632
|
-
o("email", { initialEmail:
|
|
633
|
-
}, v = (
|
|
634
|
-
o("phone", { initialPhone:
|
|
631
|
+
const a = s, { openDialog: o } = re(), u = (m, c) => {
|
|
632
|
+
o("email", { initialEmail: m, mode: c });
|
|
633
|
+
}, v = (m, c) => {
|
|
634
|
+
o("phone", { initialPhone: m, mode: c });
|
|
635
635
|
}, B = () => {
|
|
636
636
|
o("password");
|
|
637
|
-
},
|
|
638
|
-
a("on-update-jwt",
|
|
637
|
+
}, d = (m, c, E) => {
|
|
638
|
+
a("on-update-jwt", m, c, E);
|
|
639
639
|
};
|
|
640
|
-
return (
|
|
640
|
+
return (m, c) => (b(), U(ve, null, [
|
|
641
641
|
w(p(Ze)),
|
|
642
642
|
w(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": m.throttlerPrefix,
|
|
644
|
+
provider: m.provider,
|
|
645
|
+
"request-url": m.requestUrl,
|
|
646
|
+
language: m.language,
|
|
647
|
+
fields: m.fields,
|
|
648
|
+
"access-token": m.accessToken,
|
|
649
|
+
"refresh-token": m.refreshToken,
|
|
650
|
+
"aws-storage-url": m.awsStorageUrl,
|
|
651
|
+
"disable-add-phone": m.disableAddPhone,
|
|
652
|
+
onOpenEmailDialog: u,
|
|
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
657
|
w(p(he))
|
|
658
658
|
], 64));
|
|
659
659
|
}
|
|
660
660
|
}), Et = 10, Pt = 10, Nt = 15;
|
|
661
661
|
function Ct(l, s, a) {
|
|
662
|
-
let o = l.replace(/[^\d+]/g, "");
|
|
662
|
+
let o = l.replace(/[^\d+]/g, "").replace(/(?!^)\+/g, "");
|
|
663
663
|
return a != null && a.startsWith("ru") && o.startsWith("8") ? o = `+7${o.slice(1)}` : s && o && !o.startsWith("+") && (o = `+${o}`), o;
|
|
664
664
|
}
|
|
665
665
|
function kt(l) {
|
|
@@ -672,20 +672,20 @@ function Tt(l, s = Et, a = Nt) {
|
|
|
672
672
|
return !(!/^\d+$/.test(o) || o.length < s || o.length > a);
|
|
673
673
|
}
|
|
674
674
|
function It(l) {
|
|
675
|
-
return
|
|
675
|
+
return !/^\+?\d*$/.test(l);
|
|
676
676
|
}
|
|
677
677
|
function Ut(l, s) {
|
|
678
|
-
let a = 0;
|
|
679
|
-
return l.split("").filter((
|
|
678
|
+
let a = 0, o = !1;
|
|
679
|
+
return l.split("").filter((u, v) => u === "+" ? v !== 0 || o ? !1 : (o = !0, !0) : /\d/.test(u) ? (a++, a <= s) : !1).join("");
|
|
680
680
|
}
|
|
681
681
|
const Bt = /^[\w.%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;
|
|
682
682
|
function Dt(l) {
|
|
683
683
|
return Bt.test(l);
|
|
684
684
|
}
|
|
685
685
|
function Vt(l, s) {
|
|
686
|
-
var o,
|
|
686
|
+
var o, u;
|
|
687
687
|
const a = l.trim();
|
|
688
|
-
return (o = s.phone) != null && o.enabled && /\d/.test(a) && !a.includes("@") ? "phone" : (
|
|
688
|
+
return (o = s.phone) != null && o.enabled && /\d/.test(a) && !a.includes("@") ? "phone" : (u = s.email) != null && u.enabled ? "email" : null;
|
|
689
689
|
}
|
|
690
690
|
const At = { class: "smart-input" }, Ft = /* @__PURE__ */ X({
|
|
691
691
|
__name: "index",
|
|
@@ -701,8 +701,8 @@ const At = { class: "smart-input" }, Ft = /* @__PURE__ */ X({
|
|
|
701
701
|
},
|
|
702
702
|
emits: ["update:modelValue", "validity-change", "type-change"],
|
|
703
703
|
setup(l, { emit: s }) {
|
|
704
|
-
const a = l, o = s,
|
|
705
|
-
var i, n, g, C, D, V, F, S, P, M,
|
|
704
|
+
const a = l, o = s, u = A(() => {
|
|
705
|
+
var i, n, g, C, D, V, F, S, P, M, $;
|
|
706
706
|
return {
|
|
707
707
|
mode: ((i = a.config) == null ? void 0 : i.mode) ?? "auto",
|
|
708
708
|
phone: {
|
|
@@ -712,51 +712,51 @@ const At = { class: "smart-input" }, Ft = /* @__PURE__ */ X({
|
|
|
712
712
|
autoPlus: ((P = (S = a.config) == null ? void 0 : S.phone) == null ? void 0 : P.autoPlus) ?? !0
|
|
713
713
|
},
|
|
714
714
|
email: {
|
|
715
|
-
enabled: ((
|
|
715
|
+
enabled: (($ = (M = a.config) == null ? void 0 : M.email) == null ? void 0 : $.enabled) ?? !0
|
|
716
716
|
}
|
|
717
717
|
};
|
|
718
|
-
}), v = y(null), B = y(""),
|
|
718
|
+
}), v = y(null), B = y(""), d = y(a.modelValue ?? ""), m = y(null), c = y("");
|
|
719
719
|
ge(() => a.modelValue, (i) => {
|
|
720
|
-
i !== void 0 && (
|
|
720
|
+
i !== void 0 && (d.value = i, B.value = i);
|
|
721
721
|
});
|
|
722
722
|
function E(i) {
|
|
723
723
|
var D, V, F, S;
|
|
724
724
|
const g = i.target.value;
|
|
725
725
|
if (g.trim() === "") {
|
|
726
|
-
|
|
726
|
+
m.value = null, c.value = "", o("type-change", null), o("update:modelValue", ""), o("validity-change", !1);
|
|
727
727
|
return;
|
|
728
728
|
}
|
|
729
|
-
const C =
|
|
730
|
-
if (
|
|
729
|
+
const C = u.value.mode === "auto" ? Vt(g, u.value) : u.value.mode;
|
|
730
|
+
if (m.value = C, o("type-change", C), C === "email") {
|
|
731
731
|
const P = Dt(g);
|
|
732
|
-
c.value = g.length === 0 || P ? "" : ((D = a.errorMessages) == null ? void 0 : D.invalidEmail) ?? "Это не похоже на email",
|
|
732
|
+
c.value = g.length === 0 || P ? "" : ((D = a.errorMessages) == null ? void 0 : D.invalidEmail) ?? "Это не похоже на email", d.value = g, B.value = g, o("update:modelValue", g), o("validity-change", P);
|
|
733
733
|
return;
|
|
734
734
|
}
|
|
735
735
|
if (C === "phone") {
|
|
736
736
|
const P = Ct(
|
|
737
737
|
g,
|
|
738
|
-
|
|
738
|
+
u.value.phone.autoPlus,
|
|
739
739
|
a.locale
|
|
740
740
|
), M = kt(P);
|
|
741
|
-
if (M.length >
|
|
742
|
-
const z = Ut(g,
|
|
743
|
-
|
|
741
|
+
if (M.length > u.value.phone.maxDigits) {
|
|
742
|
+
const z = Ut(g, u.value.phone.maxDigits);
|
|
743
|
+
d.value = z, o("update:modelValue", z), h(z);
|
|
744
744
|
return;
|
|
745
745
|
}
|
|
746
|
-
if (
|
|
746
|
+
if (d.value = g, It(g)) {
|
|
747
747
|
c.value = ((V = a.errorMessages) == null ? void 0 : V.invalidPhoneChars) ?? "Допустимы только цифры и знак +", o("validity-change", !1);
|
|
748
748
|
return;
|
|
749
749
|
}
|
|
750
|
-
if (
|
|
750
|
+
if (d.value = P, o("update:modelValue", P), B.value = P, M.length < Pt) {
|
|
751
751
|
c.value = ((F = a.errorMessages) == null ? void 0 : F.invalidPhoneLength) ?? "Это не похоже на номер телефона", o("validity-change", !1);
|
|
752
752
|
return;
|
|
753
753
|
}
|
|
754
|
-
const
|
|
754
|
+
const $ = Tt(
|
|
755
755
|
P,
|
|
756
|
-
|
|
757
|
-
|
|
756
|
+
u.value.phone.minDigits,
|
|
757
|
+
u.value.phone.maxDigits
|
|
758
758
|
);
|
|
759
|
-
c.value =
|
|
759
|
+
c.value = $ ? "" : ((S = a.errorMessages) == null ? void 0 : S.invalidPhoneLength) ?? "Это не похоже на номер телефона", o("validity-change", $);
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
762
|
function f() {
|
|
@@ -776,7 +776,7 @@ const At = { class: "smart-input" }, Ft = /* @__PURE__ */ X({
|
|
|
776
776
|
w(p(O), {
|
|
777
777
|
ref_key: "inputRef",
|
|
778
778
|
ref: v,
|
|
779
|
-
"model-value":
|
|
779
|
+
"model-value": d.value,
|
|
780
780
|
readonly: i.disabled,
|
|
781
781
|
error: c.value,
|
|
782
782
|
type: i.type ?? "text",
|
|
@@ -784,20 +784,20 @@ const At = { class: "smart-input" }, Ft = /* @__PURE__ */ X({
|
|
|
784
784
|
label: i.label ?? "Email или телефон",
|
|
785
785
|
onInput: E
|
|
786
786
|
}, null, 8, ["model-value", "readonly", "error", "type", "size", "label"]),
|
|
787
|
-
|
|
787
|
+
m.value === "phone" ? (b(), x(p(He), {
|
|
788
788
|
key: 0,
|
|
789
789
|
class: "smart-input__icon"
|
|
790
790
|
})) : I("", !0),
|
|
791
|
-
|
|
791
|
+
m.value === "email" ? (b(), x(p(Qe), {
|
|
792
792
|
key: 1,
|
|
793
793
|
class: "smart-input__icon"
|
|
794
794
|
})) : I("", !0)
|
|
795
795
|
]));
|
|
796
796
|
}
|
|
797
|
-
}), Rt = /* @__PURE__ */ ye(Ft, [["__scopeId", "data-v-
|
|
797
|
+
}), Rt = /* @__PURE__ */ ye(Ft, [["__scopeId", "data-v-9c03c5a0"]]);
|
|
798
798
|
export {
|
|
799
799
|
zt as B,
|
|
800
|
-
|
|
800
|
+
xt as C,
|
|
801
801
|
ye as _,
|
|
802
802
|
Lt as a,
|
|
803
803
|
nt as g,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
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-9c03c5a0]{position:relative;width:100%}.smart-input__icon[data-v-9c03c5a0]{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-DGkhZigd.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-DGkhZigd.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")}`;
|