@yourgoods/ui-smart 0.53.20 → 0.53.22
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-CQF6dXtc.js → ProfileEmailDialog-k7_iCzke.js} +2 -2
- package/dist/{ProfilePasswordDialog-CYceZCUY.js → ProfilePasswordDialog-DCC6_Y3N.js} +1 -1
- package/dist/{ProfilePhoneDialog-SC2XgK-8.js → ProfilePhoneDialog-CadUjW63.js} +2 -2
- package/dist/{index-BM2UPwJQ.js → index-BTbdRSyc.js} +89 -85
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-s8hTSxqC.js → useRateLimitToast-Db_dkORY.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-Db_dkORY.js";
|
|
3
|
+
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-BTbdRSyc.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-BTbdRSyc.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-Db_dkORY.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-BTbdRSyc.js";
|
|
5
5
|
const _e = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: "12",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as h, shallowRef as _e, defineComponent as q, defineAsyncComponent as Y, watch as
|
|
1
|
+
import { ref as h, shallowRef as _e, defineComponent as q, defineAsyncComponent as Y, watch as pe, createBlock as x, createCommentVNode as T, unref as f, openBlock as w, resolveDynamicComponent as Re, mergeProps as Oe, computed as V, reactive as X, onMounted as Ge, createElementBlock as B, Fragment as ce, createVNode as y, createElementVNode as K, withCtx as $, toDisplayString as z, createTextVNode as Z, Teleport as de, 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 L, IconFilledEditMd as j, PButton as me, PImageCropper as Xe, PToast as Ke, PTeleportContainer as fe, PToastContainer as Ze, IconPhoneMd as He, IconMailMd as Qe } from "@profeat/ui-kit";
|
|
4
4
|
function ea(l, s = 2) {
|
|
@@ -217,16 +217,16 @@ 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: s }) {
|
|
220
|
-
const t = s, o = h(!0), { currentDialog: m, dialogPayload: v, closeDialog:
|
|
221
|
-
email: Y(() => import("./ProfileEmailDialog-
|
|
222
|
-
phone: Y(() => import("./ProfilePhoneDialog-
|
|
223
|
-
password: Y(() => import("./ProfilePasswordDialog-
|
|
220
|
+
const t = s, o = h(!0), { currentDialog: m, dialogPayload: v, closeDialog: D } = te(), u = {
|
|
221
|
+
email: Y(() => import("./ProfileEmailDialog-k7_iCzke.js")),
|
|
222
|
+
phone: Y(() => import("./ProfilePhoneDialog-CadUjW63.js")),
|
|
223
|
+
password: Y(() => import("./ProfilePasswordDialog-DCC6_Y3N.js"))
|
|
224
224
|
}, d = ({ email: b }) => {
|
|
225
225
|
t("update-email-field", b);
|
|
226
|
-
},
|
|
226
|
+
}, p = ({ phone: b }) => {
|
|
227
227
|
t("update-phone-field", b);
|
|
228
228
|
};
|
|
229
|
-
return
|
|
229
|
+
return pe(m, (b) => {
|
|
230
230
|
o.value = !!b;
|
|
231
231
|
}), (b, i) => f(m) ? (w(), x(Re(u[f(m)]), Oe({
|
|
232
232
|
key: 0,
|
|
@@ -236,22 +236,22 @@ const sa = {
|
|
|
236
236
|
provider: b.provider,
|
|
237
237
|
"disable-add-phone": b.disableAddPhone
|
|
238
238
|
}, f(v), {
|
|
239
|
-
onClose: f(
|
|
239
|
+
onClose: f(D),
|
|
240
240
|
onCleanInputErrors: i[1] || (i[1] = (g) => t("clean-input-errors")),
|
|
241
|
-
onOnUpdateJwt: i[2] || (i[2] = (g,
|
|
241
|
+
onOnUpdateJwt: i[2] || (i[2] = (g, c, r) => t("on-update-jwt", g, c, r)),
|
|
242
242
|
onSubmitEmail: d,
|
|
243
|
-
onSubmitPhone:
|
|
244
|
-
onOnPasswordError: i[3] || (i[3] = (g,
|
|
243
|
+
onSubmitPhone: p,
|
|
244
|
+
onOnPasswordError: i[3] || (i[3] = (g, c) => t("on-password-error", g, c)),
|
|
245
245
|
onOnToast: i[4] || (i[4] = (g) => t("on-toast", g))
|
|
246
246
|
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : T("", !0);
|
|
247
247
|
}
|
|
248
248
|
}), ua = { class: "base-container" }, da = {
|
|
249
249
|
key: 0,
|
|
250
250
|
style: { color: "#E46060" }
|
|
251
|
-
}, ma = { key: 1 },
|
|
251
|
+
}, ma = { key: 1 }, pa = {
|
|
252
252
|
key: 1,
|
|
253
253
|
class: "input-wrapper"
|
|
254
|
-
},
|
|
254
|
+
}, ca = {
|
|
255
255
|
key: 2,
|
|
256
256
|
class: "input-wrapper"
|
|
257
257
|
}, fa = {
|
|
@@ -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: s }) {
|
|
281
|
-
const t = l, o = s, m = V(() => t.language ?? "ru"), v = (e) => sa[m.value][e] || e, { openDialog:
|
|
281
|
+
const t = l, o = s, m = V(() => t.language ?? "ru"), v = (e) => sa[m.value][e] || e, { openDialog: D } = te(), u = X({ firstName: "", lastName: "" }), d = h({ firstName: "", lastName: "" }), p = X({ firstName: !1, lastName: !1, email: !1, phone: !1 }), b = h(""), i = h(""), g = h(""), c = h(!1), r = X({
|
|
282
282
|
value: null,
|
|
283
283
|
loading: !1,
|
|
284
284
|
accept: ["image/png", "image/jpeg"],
|
|
@@ -286,35 +286,35 @@ const sa = {
|
|
|
286
286
|
// 10 MB
|
|
287
287
|
imageBinary: null,
|
|
288
288
|
imageContent: ""
|
|
289
|
-
}), C = h(""),
|
|
289
|
+
}), C = h(""), U = h(!1), I = h(!0), E = h(!0), A = h(void 0), F = h(""), S = V(() => ne(u.firstName, p.firstName)), ve = V(() => ne(u.lastName, p.lastName)), he = V(() => p.email && !i.value.trim() ? "Введите e-mail" : ""), ye = V(() => p.phone && !g.value.trim() ? "Введите номер телефона" : ""), M = (e) => t.fields.some((a) => a.key === e), oe = (e) => e && e.trim() ? "edit" : "bind", W = () => setTimeout(() => {
|
|
290
290
|
var e;
|
|
291
291
|
return (e = document.activeElement) == null ? void 0 : e.blur();
|
|
292
292
|
}, 0), we = V(() => !!(i.value && i.value.trim() !== "")), be = V(() => r.imageContent ? v("Загрузить другое фото") : v("Загрузить фото")), ne = (e, a) => {
|
|
293
293
|
if (!a) return "";
|
|
294
294
|
const n = e.trim();
|
|
295
295
|
return n ? n.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
|
|
296
|
-
}, Ee = (e) =>
|
|
297
|
-
W(),
|
|
296
|
+
}, Ee = (e) => D("email", { mode: e ? "edit" : "bind", initialEmail: e }), Pe = () => {
|
|
297
|
+
W(), p.email = !1, E.value = !1, o("open-email-dialog", i.value, oe(i.value)), Ee(i.value);
|
|
298
298
|
}, Ne = () => {
|
|
299
|
-
W(),
|
|
299
|
+
W(), p.phone = !1, I.value = !1, o("open-phone-dialog", g.value, oe(g.value));
|
|
300
300
|
}, Ce = async (e, a, n) => {
|
|
301
301
|
e === "email" && n && (i.value = n), e === "phone" && n && (g.value = n), o("on-update-jwt");
|
|
302
302
|
}, ke = (e) => {
|
|
303
303
|
g.value = e;
|
|
304
304
|
}, Te = (e) => {
|
|
305
305
|
i.value = e;
|
|
306
|
-
},
|
|
307
|
-
|
|
308
|
-
},
|
|
309
|
-
|
|
306
|
+
}, Ue = (e, a) => {
|
|
307
|
+
U.value = !0, o("on-password-error", e, a);
|
|
308
|
+
}, Be = () => {
|
|
309
|
+
I.value = !1, E.value = !1;
|
|
310
310
|
}, _ = (e) => {
|
|
311
|
-
|
|
311
|
+
U.value = !0, A.value = e.color ?? "", F.value = e.text ?? "";
|
|
312
312
|
}, R = (e) => {
|
|
313
|
-
if (
|
|
313
|
+
if (p[e] = !0, e === "firstName" || e === "lastName") {
|
|
314
314
|
const a = u[e];
|
|
315
315
|
a.length > 40 && (u[e] = a.slice(0, 40));
|
|
316
316
|
}
|
|
317
|
-
},
|
|
317
|
+
}, De = (e) => {
|
|
318
318
|
var O, G;
|
|
319
319
|
if (C.value = "", !e) {
|
|
320
320
|
re();
|
|
@@ -325,10 +325,10 @@ const sa = {
|
|
|
325
325
|
C.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", re();
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
|
-
r.value = e, r.imageBinary = e.fileBinary ?? null, r.imageContent = e.fileContent ?? "",
|
|
328
|
+
r.value = e, r.imageBinary = e.fileBinary ?? null, r.imageContent = e.fileContent ?? "", c.value = !0;
|
|
329
329
|
}, re = () => {
|
|
330
|
-
r.value = null, r.imageBinary = null, r.imageContent = "",
|
|
331
|
-
},
|
|
330
|
+
r.value = null, r.imageBinary = null, r.imageContent = "", c.value = !1;
|
|
331
|
+
}, Ie = async () => {
|
|
332
332
|
try {
|
|
333
333
|
const a = (await ra("/users/profile/delete/avatar")).data;
|
|
334
334
|
return (a == null ? void 0 : a.success) === !0;
|
|
@@ -336,15 +336,15 @@ const sa = {
|
|
|
336
336
|
return console.error("Ошибка при удалении аватара:", e), !1;
|
|
337
337
|
}
|
|
338
338
|
}, Ve = () => {
|
|
339
|
-
C.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", r.value = null, r.imageBinary = null, r.imageContent = "",
|
|
339
|
+
C.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", r.value = null, r.imageBinary = null, r.imageContent = "", c.value = !1;
|
|
340
340
|
}, le = async (e, a, n = "image/png") => {
|
|
341
341
|
if (!e) return null;
|
|
342
342
|
const k = await (await fetch(e)).blob();
|
|
343
343
|
return new File([k], a, { type: n });
|
|
344
344
|
}, Ae = () => {
|
|
345
|
-
r.value = null, r.imageBinary = null, r.imageContent = "",
|
|
345
|
+
r.value = null, r.imageBinary = null, r.imageContent = "", c.value = !1;
|
|
346
346
|
}, Fe = async (e) => {
|
|
347
|
-
|
|
347
|
+
c.value = !1;
|
|
348
348
|
const a = r.imageContent;
|
|
349
349
|
if (r.imageContent = e, !r.imageBinary) return;
|
|
350
350
|
const n = await le(
|
|
@@ -456,16 +456,16 @@ const sa = {
|
|
|
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
|
oa(t.accessToken, t.requestUrl, t.throttlerPrefix), await xe();
|
|
459
|
-
}), (e, a) => (w(),
|
|
459
|
+
}), (e, a) => (w(), B(ce, null, [
|
|
460
460
|
y(ia, {
|
|
461
461
|
language: m.value,
|
|
462
462
|
provider: e.provider,
|
|
463
463
|
"disable-add-phone": e.disableAddPhone,
|
|
464
|
-
onCleanInputErrors:
|
|
464
|
+
onCleanInputErrors: Be,
|
|
465
465
|
onOnUpdateJwt: Ce,
|
|
466
466
|
onUpdatePhoneField: ke,
|
|
467
467
|
onUpdateEmailField: Te,
|
|
468
|
-
onOnPasswordError:
|
|
468
|
+
onOnPasswordError: Ue,
|
|
469
469
|
onOnToast: _
|
|
470
470
|
}, null, 8, ["language", "provider", "disable-add-phone"]),
|
|
471
471
|
K("div", ua, [
|
|
@@ -474,7 +474,7 @@ const sa = {
|
|
|
474
474
|
modelValue: r.value,
|
|
475
475
|
"onUpdate:modelValue": [
|
|
476
476
|
a[0] || (a[0] = (n) => r.value = n),
|
|
477
|
-
a[1] || (a[1] = (n) =>
|
|
477
|
+
a[1] || (a[1] = (n) => De(n))
|
|
478
478
|
],
|
|
479
479
|
type: "img",
|
|
480
480
|
class: "avatar-input",
|
|
@@ -483,42 +483,42 @@ const sa = {
|
|
|
483
483
|
label: v("Загрузить фото"),
|
|
484
484
|
"upload-limit": r.uploadLimit,
|
|
485
485
|
accept: "image/jpeg, image/png",
|
|
486
|
-
onDelete:
|
|
486
|
+
onDelete: Ie,
|
|
487
487
|
"onChange:error": Ve
|
|
488
488
|
}, {
|
|
489
489
|
afterLoadLabel: $(() => [
|
|
490
490
|
Z(z(be.value), 1)
|
|
491
491
|
]),
|
|
492
492
|
subtext: $(() => [
|
|
493
|
-
C.value ? (w(),
|
|
493
|
+
C.value ? (w(), B("span", da, z(C.value), 1)) : (w(), B("span", ma, z(`${v("Формат")} ${f(ta)(r.accept).join(", ")} ${v("до")} ${f(ea)(r.uploadLimit)}`), 1))
|
|
494
494
|
]),
|
|
495
495
|
_: 1
|
|
496
496
|
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : T("", !0),
|
|
497
|
-
M("firstName") ? (w(),
|
|
497
|
+
M("firstName") ? (w(), B("div", pa, [
|
|
498
498
|
y(f(L), {
|
|
499
499
|
modelValue: u.firstName,
|
|
500
500
|
"onUpdate:modelValue": a[2] || (a[2] = (n) => u.firstName = n),
|
|
501
501
|
size: "large",
|
|
502
502
|
label: v("Имя"),
|
|
503
503
|
error: S.value,
|
|
504
|
-
onBlur: a[3] || (a[3] = (n) =>
|
|
504
|
+
onBlur: a[3] || (a[3] = (n) => p.firstName = !0),
|
|
505
505
|
onInput: a[4] || (a[4] = (n) => R("firstName"))
|
|
506
506
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
507
507
|
y(f(j), { class: "icon-locked" })
|
|
508
508
|
])) : T("", !0),
|
|
509
|
-
M("lastName") ? (w(),
|
|
509
|
+
M("lastName") ? (w(), B("div", ca, [
|
|
510
510
|
y(f(L), {
|
|
511
511
|
modelValue: u.lastName,
|
|
512
512
|
"onUpdate:modelValue": a[5] || (a[5] = (n) => u.lastName = n),
|
|
513
513
|
size: "large",
|
|
514
514
|
label: v("Фамилия"),
|
|
515
515
|
error: ve.value,
|
|
516
|
-
onBlur: a[6] || (a[6] = (n) =>
|
|
516
|
+
onBlur: a[6] || (a[6] = (n) => p.lastName = !0),
|
|
517
517
|
onInput: a[7] || (a[7] = (n) => R("lastName"))
|
|
518
518
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
519
519
|
y(f(j), { class: "icon-locked" })
|
|
520
520
|
])) : T("", !0),
|
|
521
|
-
M("email") ? (w(),
|
|
521
|
+
M("email") ? (w(), B("div", fa, [
|
|
522
522
|
y(f(L), {
|
|
523
523
|
modelValue: i.value,
|
|
524
524
|
"onUpdate:modelValue": a[8] || (a[8] = (n) => i.value = n),
|
|
@@ -529,13 +529,13 @@ const sa = {
|
|
|
529
529
|
readonly: "",
|
|
530
530
|
style: { cursor: "pointer" },
|
|
531
531
|
error: he.value && E.value,
|
|
532
|
-
onBlur: a[9] || (a[9] = (n) =>
|
|
532
|
+
onBlur: a[9] || (a[9] = (n) => p.email = !0),
|
|
533
533
|
onInput: a[10] || (a[10] = (n) => R("email")),
|
|
534
534
|
onClick: Pe
|
|
535
535
|
}, null, 8, ["modelValue", "error"]),
|
|
536
536
|
y(f(j), { class: "icon-locked" })
|
|
537
537
|
])) : T("", !0),
|
|
538
|
-
M("phone") ? (w(),
|
|
538
|
+
M("phone") ? (w(), B("div", ga, [
|
|
539
539
|
y(f(L), {
|
|
540
540
|
modelValue: g.value,
|
|
541
541
|
"onUpdate:modelValue": a[11] || (a[11] = (n) => g.value = n),
|
|
@@ -545,8 +545,8 @@ const sa = {
|
|
|
545
545
|
type: "tel",
|
|
546
546
|
readonly: "",
|
|
547
547
|
style: { cursor: "pointer" },
|
|
548
|
-
error: ye.value &&
|
|
549
|
-
onBlur: a[12] || (a[12] = (n) =>
|
|
548
|
+
error: ye.value && I.value,
|
|
549
|
+
onBlur: a[12] || (a[12] = (n) => p.phone = !0),
|
|
550
550
|
onInput: a[13] || (a[13] = (n) => R("phone")),
|
|
551
551
|
onClick: Ne
|
|
552
552
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
@@ -574,11 +574,11 @@ const sa = {
|
|
|
574
574
|
}, 8, ["disabled"])
|
|
575
575
|
])
|
|
576
576
|
]),
|
|
577
|
-
|
|
577
|
+
c.value ? (w(), x(de, {
|
|
578
578
|
key: 0,
|
|
579
579
|
to: "body"
|
|
580
580
|
}, [
|
|
581
|
-
|
|
581
|
+
c.value ? (w(), B("div", ha, [
|
|
582
582
|
y(f(Xe), {
|
|
583
583
|
"circle-mode": !0,
|
|
584
584
|
"model-value": r.imageContent,
|
|
@@ -596,9 +596,9 @@ const sa = {
|
|
|
596
596
|
class: "toast",
|
|
597
597
|
color: A.value,
|
|
598
598
|
text: F.value,
|
|
599
|
-
onClose: a[16] || (a[16] = (n) =>
|
|
599
|
+
onClose: a[16] || (a[16] = (n) => U.value = !1)
|
|
600
600
|
}, null, 8, ["color", "text"]), [
|
|
601
|
-
[qe,
|
|
601
|
+
[qe, U.value]
|
|
602
602
|
])
|
|
603
603
|
]),
|
|
604
604
|
_: 1
|
|
@@ -628,16 +628,16 @@ const sa = {
|
|
|
628
628
|
},
|
|
629
629
|
emits: ["on-update-jwt", "update-tokens"],
|
|
630
630
|
setup(l, { emit: s }) {
|
|
631
|
-
const t = s, { openDialog: o } = te(), m = (d,
|
|
632
|
-
o("email", { initialEmail: d, mode:
|
|
633
|
-
}, v = (d,
|
|
634
|
-
o("phone", { initialPhone: d, mode:
|
|
635
|
-
},
|
|
631
|
+
const t = s, { openDialog: o } = te(), m = (d, p) => {
|
|
632
|
+
o("email", { initialEmail: d, mode: p });
|
|
633
|
+
}, v = (d, p) => {
|
|
634
|
+
o("phone", { initialPhone: d, mode: p });
|
|
635
|
+
}, D = () => {
|
|
636
636
|
o("password");
|
|
637
|
-
}, u = (d,
|
|
638
|
-
t("on-update-jwt", d,
|
|
637
|
+
}, u = (d, p, b) => {
|
|
638
|
+
t("on-update-jwt", d, p, b);
|
|
639
639
|
};
|
|
640
|
-
return (d,
|
|
640
|
+
return (d, p) => (w(), B(ce, null, [
|
|
641
641
|
y(f(Ze)),
|
|
642
642
|
y(ba, {
|
|
643
643
|
"throttler-prefix": d.throttlerPrefix,
|
|
@@ -651,7 +651,7 @@ const sa = {
|
|
|
651
651
|
"disable-add-phone": d.disableAddPhone,
|
|
652
652
|
onOpenEmailDialog: m,
|
|
653
653
|
onOpenPhoneDialog: v,
|
|
654
|
-
onOpenPasswordDialog:
|
|
654
|
+
onOpenPasswordDialog: D,
|
|
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
|
y(f(fe))
|
|
@@ -671,16 +671,16 @@ function Ta(l, s = Ea, t = Na) {
|
|
|
671
671
|
const o = l.slice(1);
|
|
672
672
|
return !(!/^\d+$/.test(o) || o.length < s || o.length > t);
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function Ua(l) {
|
|
675
675
|
return /[^\d+]/.test(l);
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function Ba(l, s) {
|
|
678
678
|
let t = 0;
|
|
679
679
|
return l.split("").filter((o) => /\d/.test(o) ? (t++, t <= s) : !0).join("");
|
|
680
680
|
}
|
|
681
|
-
const
|
|
682
|
-
function
|
|
683
|
-
return
|
|
681
|
+
const Da = /^[\w.%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;
|
|
682
|
+
function Ia(l) {
|
|
683
|
+
return Da.test(l);
|
|
684
684
|
}
|
|
685
685
|
function Va(l, s) {
|
|
686
686
|
var o, m;
|
|
@@ -702,49 +702,53 @@ const Aa = { class: "smart-input" }, Fa = /* @__PURE__ */ q({
|
|
|
702
702
|
emits: ["update:modelValue", "validity-change", "type-change"],
|
|
703
703
|
setup(l, { emit: s }) {
|
|
704
704
|
const t = l, o = s, m = V(() => {
|
|
705
|
-
var i, g,
|
|
705
|
+
var i, g, c, r, C, U, I, E, A, F, S;
|
|
706
706
|
return {
|
|
707
707
|
mode: ((i = t.config) == null ? void 0 : i.mode) ?? "auto",
|
|
708
708
|
phone: {
|
|
709
|
-
enabled: ((
|
|
709
|
+
enabled: ((c = (g = t.config) == null ? void 0 : g.phone) == null ? void 0 : c.enabled) ?? !0,
|
|
710
710
|
minDigits: ((C = (r = t.config) == null ? void 0 : r.phone) == null ? void 0 : C.minDigits) ?? 10,
|
|
711
|
-
maxDigits: ((
|
|
711
|
+
maxDigits: ((I = (U = t.config) == null ? void 0 : U.phone) == null ? void 0 : I.maxDigits) ?? 15,
|
|
712
712
|
autoPlus: ((A = (E = t.config) == null ? void 0 : E.phone) == null ? void 0 : A.autoPlus) ?? !0
|
|
713
713
|
},
|
|
714
714
|
email: {
|
|
715
715
|
enabled: ((S = (F = t.config) == null ? void 0 : F.email) == null ? void 0 : S.enabled) ?? !0
|
|
716
716
|
}
|
|
717
717
|
};
|
|
718
|
-
}), v = h(null),
|
|
719
|
-
|
|
720
|
-
i !== void 0 && (u.value = i,
|
|
718
|
+
}), v = h(null), D = h(""), u = h(t.modelValue ?? ""), d = h(null), p = h("");
|
|
719
|
+
pe(() => t.modelValue, (i) => {
|
|
720
|
+
i !== void 0 && (u.value = i, D.value = i);
|
|
721
721
|
});
|
|
722
722
|
function b(i) {
|
|
723
|
-
var C,
|
|
724
|
-
|
|
725
|
-
|
|
723
|
+
var C, U, I;
|
|
724
|
+
const c = i.target.value;
|
|
725
|
+
if (c.trim() === "") {
|
|
726
|
+
d.value = null, p.value = "", o("type-change", null), o("update:modelValue", ""), o("validity-change", !1);
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
const r = m.value.mode === "auto" ? Va(c, m.value) : m.value.mode;
|
|
726
730
|
if (d.value = r, o("type-change", r), r === "email") {
|
|
727
|
-
const E =
|
|
728
|
-
|
|
731
|
+
const E = Ia(c);
|
|
732
|
+
p.value = c.length === 0 || E ? "" : ((C = t.errorMessages) == null ? void 0 : C.invalidEmail) ?? "Это не похоже на email", u.value = c, D.value = c, o("update:modelValue", c), o("validity-change", E);
|
|
729
733
|
return;
|
|
730
734
|
}
|
|
731
735
|
if (r === "phone") {
|
|
732
736
|
const E = Ca(
|
|
733
|
-
|
|
737
|
+
c,
|
|
734
738
|
m.value.phone.autoPlus,
|
|
735
739
|
t.locale
|
|
736
740
|
), A = ka(E);
|
|
737
741
|
if (A.length > m.value.phone.maxDigits) {
|
|
738
|
-
const S =
|
|
742
|
+
const S = Ba(c, m.value.phone.maxDigits);
|
|
739
743
|
u.value = S, o("update:modelValue", S), o("validity-change", !1);
|
|
740
744
|
return;
|
|
741
745
|
}
|
|
742
|
-
if (u.value =
|
|
743
|
-
|
|
746
|
+
if (u.value = c, o("update:modelValue", c), Ua(c)) {
|
|
747
|
+
p.value = ((U = t.errorMessages) == null ? void 0 : U.invalidPhoneChars) ?? "Допустимы только цифры и знак +", o("validity-change", !1);
|
|
744
748
|
return;
|
|
745
749
|
}
|
|
746
|
-
if (u.value = E, o("update:modelValue", E),
|
|
747
|
-
|
|
750
|
+
if (u.value = E, o("update:modelValue", E), D.value = E, A.length < Pa) {
|
|
751
|
+
p.value = "", o("validity-change", !1);
|
|
748
752
|
return;
|
|
749
753
|
}
|
|
750
754
|
const F = Ta(
|
|
@@ -752,16 +756,16 @@ const Aa = { class: "smart-input" }, Fa = /* @__PURE__ */ q({
|
|
|
752
756
|
m.value.phone.minDigits,
|
|
753
757
|
m.value.phone.maxDigits
|
|
754
758
|
);
|
|
755
|
-
|
|
759
|
+
p.value = F ? "" : ((I = t.errorMessages) == null ? void 0 : I.invalidPhoneLength) ?? "Это не похоже на номер телефона", o("validity-change", F);
|
|
756
760
|
}
|
|
757
761
|
}
|
|
758
|
-
return (i, g) => (w(),
|
|
762
|
+
return (i, g) => (w(), B("div", Aa, [
|
|
759
763
|
y(f(L), {
|
|
760
764
|
ref_key: "inputRef",
|
|
761
765
|
ref: v,
|
|
762
766
|
"model-value": u.value,
|
|
763
767
|
readonly: i.disabled,
|
|
764
|
-
error:
|
|
768
|
+
error: p.value,
|
|
765
769
|
type: i.type ?? "text",
|
|
766
770
|
size: i.size ?? "large",
|
|
767
771
|
label: i.label ?? "Email или телефон",
|
|
@@ -777,7 +781,7 @@ const Aa = { class: "smart-input" }, Fa = /* @__PURE__ */ q({
|
|
|
777
781
|
})) : T("", !0)
|
|
778
782
|
]));
|
|
779
783
|
}
|
|
780
|
-
}), _a = /* @__PURE__ */ ge(Fa, [["__scopeId", "data-v-
|
|
784
|
+
}), _a = /* @__PURE__ */ ge(Fa, [["__scopeId", "data-v-f18a1484"]]);
|
|
781
785
|
export {
|
|
782
786
|
za as B,
|
|
783
787
|
$a 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-f18a1484]{position:relative;width:100%}.smart-input__icon[data-v-f18a1484]{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-BTbdRSyc.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-BTbdRSyc.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")}`;
|