@yourgoods/ui-smart 0.51.0 → 0.51.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-CLM-pIRG.js → ProfileEmailDialog-BIv-HIyo.js} +2 -2
- package/dist/{ProfilePasswordDialog-BY5VAdH3.js → ProfilePasswordDialog-DSGWbmTB.js} +1 -1
- package/dist/{ProfilePhoneDialog-BdAKmUji.js → ProfilePhoneDialog-DzGWg6Di.js} +31 -31
- package/dist/components/PEditUserContact/PEditUserContact.vue.d.ts +2 -2
- package/dist/components/PEditUserContact/ProfileDialogs/DialogManager.vue.d.ts +2 -2
- package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/AddNewPhoneContent.vue.d.ts +2 -1
- package/dist/components/PEditUserContact/ProfileDialogs/ProfilePhoneDialog.vue.d.ts +1 -1
- package/dist/components/PEditUserContact/index.vue.d.ts +2 -2
- package/dist/{index-5nM1qYsp.js → index-DdkjHGxk.js} +60 -60
- package/dist/index.js +2 -2
- package/dist/useRateLimitToast-D_PBZ8lw.js +132 -0
- package/package.json +1 -1
- package/dist/useRateLimitToast-BS-y9G79.js +0 -151
|
@@ -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-D_PBZ8lw.js";
|
|
3
|
+
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-DdkjHGxk.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-DdkjHGxk.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
|
-
import { createElementBlock as S, openBlock as v, createElementVNode as H, defineComponent as he, reactive as ve, watch as _, ref as
|
|
2
|
-
import { _ as we, c as Ne, a as He, u as Ge, P as
|
|
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-D_PBZ8lw.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
|
|
4
|
+
import { C as j, t as De, p as te, g as Ae } from "./index-DdkjHGxk.js";
|
|
5
5
|
const _e = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: "12",
|
|
@@ -59,14 +59,14 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
59
59
|
const f = (h) => {
|
|
60
60
|
c.touched[h] = !0;
|
|
61
61
|
};
|
|
62
|
-
let p =
|
|
62
|
+
let p = O("");
|
|
63
63
|
const z = (h) => {
|
|
64
64
|
const y = h.target;
|
|
65
65
|
let i = ((y == null ? void 0 : y.value) ?? "").replace(/\D/g, "");
|
|
66
66
|
i.length < 4 && u("on-clear-code-error"), i.length > 4 && (i = i.slice(0, 4)), x.value = i, y && y.value !== i && (y.value = i), i.length === 4 && i !== p.value && (p.value = i, u("on-match-code", { phone: e.value, code: i }));
|
|
67
67
|
}, Y = () => u("on-send-code-again", { phone: c.phoneModel }), K = () => {
|
|
68
68
|
u("on-send-only-sms", { phone: c.phoneModel });
|
|
69
|
-
}, { phoneModel: e, codeModel: x, touched: P } = Ce(c), C = I(() => P.value.phone && !e.value.trim() ? "Введите телефон" : E.phoneError),
|
|
69
|
+
}, { phoneModel: e, codeModel: x, touched: P } = Ce(c), C = I(() => P.value.phone && !e.value.trim() ? "Введите телефон" : E.phoneError), D = I(() => E.isNotMatchCode ? "Неверный код" : P.value.code ? x.value.trim() ? E.codeError ?? null : "Введите код" : "");
|
|
70
70
|
return (h, y) => (v(), S("div", tt, [
|
|
71
71
|
H("div", ot, [
|
|
72
72
|
H("div", nt, G(h.hintText), 1),
|
|
@@ -104,7 +104,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
104
104
|
"text-size": "medium",
|
|
105
105
|
label: "Код",
|
|
106
106
|
type: "text",
|
|
107
|
-
error:
|
|
107
|
+
error: D.value,
|
|
108
108
|
onInput: z,
|
|
109
109
|
onBlur: y[5] || (y[5] = (i) => f("code"))
|
|
110
110
|
}, null, 8, ["modelValue", "error"])
|
|
@@ -170,7 +170,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
170
170
|
},
|
|
171
171
|
emits: ["update:phone", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-send-only-sms", "on-clear-code-error"],
|
|
172
172
|
setup(U, { emit: V }) {
|
|
173
|
-
const E = U, u = V, c =
|
|
173
|
+
const E = U, u = V, c = O(!1), f = O(""), p = ve({
|
|
174
174
|
touched: { phone: !1, code: !1 },
|
|
175
175
|
phoneModel: "",
|
|
176
176
|
codeModel: ""
|
|
@@ -206,8 +206,8 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
206
206
|
console.error("Неизвестная ошибка при проверке доступности телефона:", l), f.value = "Это не похоже на номер телефона";
|
|
207
207
|
}
|
|
208
208
|
};
|
|
209
|
-
let C =
|
|
210
|
-
const
|
|
209
|
+
let C = O("");
|
|
210
|
+
const D = (t) => {
|
|
211
211
|
const l = t.target;
|
|
212
212
|
let s = ((l == null ? void 0 : l.value) ?? "").replace(/\D/g, "");
|
|
213
213
|
s.length < 4 && u("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4)), L.value = s, l && l.value !== s && (l.value = s), s.length === 4 && s !== C.value && (C.value = s, u("on-match-code", { phone: i.value, code: s }));
|
|
@@ -273,7 +273,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
273
273
|
label: "Код",
|
|
274
274
|
type: "text",
|
|
275
275
|
error: Q.value,
|
|
276
|
-
onInput:
|
|
276
|
+
onInput: D,
|
|
277
277
|
onBlur: l[4] || (l[4] = (s) => z("code"))
|
|
278
278
|
}, null, 8, ["modelValue", "error"])
|
|
279
279
|
])) : B("", !0),
|
|
@@ -328,11 +328,11 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
328
328
|
loading: { type: Boolean },
|
|
329
329
|
isTg: { type: Boolean },
|
|
330
330
|
product: {},
|
|
331
|
-
|
|
331
|
+
disableAddPhone: { type: Boolean, default: !1 }
|
|
332
332
|
},
|
|
333
333
|
emits: ["update:phone", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-send-only-sms", "on-clear-code-error"],
|
|
334
334
|
setup(U, { emit: V }) {
|
|
335
|
-
const E = U, u = V, c =
|
|
335
|
+
const E = U, u = V, c = O(!1), f = O(""), p = ve({
|
|
336
336
|
touched: { phone: !1, code: !1 },
|
|
337
337
|
phoneModel: "",
|
|
338
338
|
codeModel: ""
|
|
@@ -369,7 +369,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
369
369
|
}
|
|
370
370
|
};
|
|
371
371
|
let C = "";
|
|
372
|
-
const
|
|
372
|
+
const D = (t) => {
|
|
373
373
|
const l = t.target;
|
|
374
374
|
let s = l.value.replace(/\D/g, "");
|
|
375
375
|
s.length < 4 && u("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4), l.value = s), p.codeModel = s, s.length === 4 && s !== C && (C = s, u("on-match-code", { phone: p.phoneModel, code: s }));
|
|
@@ -405,7 +405,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
405
405
|
label: "Телефон",
|
|
406
406
|
type: "tel",
|
|
407
407
|
error: A.value,
|
|
408
|
-
disabled: !!t.
|
|
408
|
+
disabled: !!t.disableAddPhone,
|
|
409
409
|
onBlur: l[1] || (l[1] = (s) => z("phone")),
|
|
410
410
|
onInput: K
|
|
411
411
|
}, null, 8, ["modelValue", "error", "disabled"]),
|
|
@@ -436,7 +436,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
436
436
|
label: "Код",
|
|
437
437
|
type: "text",
|
|
438
438
|
error: Q.value,
|
|
439
|
-
onInput:
|
|
439
|
+
onInput: D,
|
|
440
440
|
onBlur: l[4] || (l[4] = (s) => z("code"))
|
|
441
441
|
}, null, 8, ["modelValue", "error"])
|
|
442
442
|
])) : B("", !0),
|
|
@@ -478,23 +478,23 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
478
478
|
initialPhone: { default: "" },
|
|
479
479
|
language: {},
|
|
480
480
|
provider: {},
|
|
481
|
-
|
|
481
|
+
disableAddPhone: { type: Boolean },
|
|
482
482
|
mode: { default: void 0 }
|
|
483
483
|
},
|
|
484
484
|
emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
|
|
485
485
|
setup(U, { expose: V, emit: E }) {
|
|
486
|
-
const u = U, c = E, f =
|
|
486
|
+
const u = U, c = E, f = O(u.modelValue);
|
|
487
487
|
_(
|
|
488
488
|
() => u.modelValue,
|
|
489
489
|
(n) => f.value = n
|
|
490
490
|
), _(f, (n) => c("update:modelValue", n));
|
|
491
|
-
const p = I(() => u.language ?? "ru"), z = (n) =>
|
|
491
|
+
const p = I(() => u.language ?? "ru"), z = (n) => De[p.value] && De[p.value][n] || (u.title ?? n), Y = I(() => u.title ?? z("Смена номера телефона")), K = I(() => u.hintText ?? z("Чтобы продолжить, введите новый номер")), e = ve({
|
|
492
492
|
oldPhone: u.initialPhone ?? "",
|
|
493
493
|
newPhone: "",
|
|
494
494
|
code: "",
|
|
495
495
|
addPhone: "",
|
|
496
496
|
addCode: ""
|
|
497
|
-
}), x =
|
|
497
|
+
}), x = O(j.OLD), P = O(null), C = O(!1), D = O(!1), h = O("tg"), y = I(() => h.value === "tg"), i = O(!1), { startTimer: L, remainingSeconds: ie, isAvailableForSendAgain: A, totalRateAttempts: Q, currentRateAttempt: t } = He(), { showRateLimitToast: l } = Je(c), { isEditFlow: s, getFlow: me } = Ge(O(u.mode)), re = I(() => A.value ? "Повторить" : `${ie.value}`), oe = O(ae), ue = I(() => oe.value === 0), Fe = (n) => new Promise((a) => setTimeout(a, n));
|
|
498
498
|
async function fe(n = "email") {
|
|
499
499
|
var o;
|
|
500
500
|
return (o = (await Ae("/users/profile/session/get-edit-session", { params: { field: n } })).data) == null ? void 0 : o.data;
|
|
@@ -589,7 +589,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
589
589
|
step: a
|
|
590
590
|
}), ne = ((o = k.data) == null ? void 0 : o.nextStep) ?? ((T = ($ = k.data) == null ? void 0 : $.data) == null ? void 0 : T.nextStep), pe = ((R = (N = k.data) == null ? void 0 : N.data) == null ? void 0 : R.rateLimit) ?? ((q = k.data) == null ? void 0 : q.rateLimit) ?? null;
|
|
591
591
|
if (!(((W = k.data) == null ? void 0 : W.data.success) ?? ((w = k.data) == null ? void 0 : w.success))) {
|
|
592
|
-
l(pe),
|
|
592
|
+
l(pe), D.value = !0;
|
|
593
593
|
return;
|
|
594
594
|
}
|
|
595
595
|
if (!ne) return k;
|
|
@@ -601,7 +601,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
601
601
|
} catch (M) {
|
|
602
602
|
const k = (m = (g = M == null ? void 0 : M.response) == null ? void 0 : g.data) == null ? void 0 : m.rateLimit;
|
|
603
603
|
if (((d = M == null ? void 0 : M.response) == null ? void 0 : d.status) === 429 && k) {
|
|
604
|
-
l(k),
|
|
604
|
+
l(k), D.value = !0;
|
|
605
605
|
return;
|
|
606
606
|
}
|
|
607
607
|
throw M;
|
|
@@ -707,14 +707,14 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
707
707
|
code: n
|
|
708
708
|
}), M = ((a = d.data) == null ? void 0 : a.nextStep) ?? (($ = (o = d.data) == null ? void 0 : o.data) == null ? void 0 : $.nextStep), k = ((N = (T = d.data) == null ? void 0 : T.data) == null ? void 0 : N.rateLimit) ?? ((R = d.data) == null ? void 0 : R.rateLimit) ?? null;
|
|
709
709
|
if (!(((q = d.data) == null ? void 0 : q.data.success) ?? ((W = d.data) == null ? void 0 : W.success))) {
|
|
710
|
-
l(k),
|
|
710
|
+
l(k), D.value = !0;
|
|
711
711
|
return;
|
|
712
712
|
}
|
|
713
713
|
return M && M === j.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.addPhone, code: n }), c("on-update-jwt", "phone", "bind", e.addPhone), c("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), P.value = null, c("close")), d;
|
|
714
714
|
} catch (d) {
|
|
715
715
|
const M = (g = (w = d == null ? void 0 : d.response) == null ? void 0 : w.data) == null ? void 0 : g.rateLimit;
|
|
716
716
|
if (((m = d == null ? void 0 : d.response) == null ? void 0 : m.status) === 429 && M) {
|
|
717
|
-
l(M),
|
|
717
|
+
l(M), D.value = !0;
|
|
718
718
|
return;
|
|
719
719
|
}
|
|
720
720
|
throw d;
|
|
@@ -784,7 +784,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
784
784
|
]),
|
|
785
785
|
default: X(() => [
|
|
786
786
|
r(s) ? (v(), S("div", Vt, [
|
|
787
|
-
C.value ? (v(), J(
|
|
787
|
+
C.value ? (v(), J(Oe, { key: 0 })) : B("", !0),
|
|
788
788
|
x.value === r(j).OLD ? (v(), J(dt, {
|
|
789
789
|
key: 1,
|
|
790
790
|
phone: e.oldPhone,
|
|
@@ -793,7 +793,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
793
793
|
"onUpdate:code": a[1] || (a[1] = (o) => e.code = o),
|
|
794
794
|
"rate-limit-text": re.value,
|
|
795
795
|
"is-final-limit": ue.value,
|
|
796
|
-
"is-not-match-code":
|
|
796
|
+
"is-not-match-code": D.value,
|
|
797
797
|
loading: C.value,
|
|
798
798
|
"is-tg": y.value,
|
|
799
799
|
product: n.provider,
|
|
@@ -813,7 +813,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
813
813
|
"hint-text": K.value,
|
|
814
814
|
"rate-limit-text": re.value,
|
|
815
815
|
"is-final-limit": ue.value,
|
|
816
|
-
"is-not-match-code":
|
|
816
|
+
"is-not-match-code": D.value,
|
|
817
817
|
loading: C.value,
|
|
818
818
|
"is-tg": y.value,
|
|
819
819
|
product: n.provider,
|
|
@@ -822,12 +822,12 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
822
822
|
onOnSendOnlySms: ye,
|
|
823
823
|
onOnMatchCode: xe,
|
|
824
824
|
onOnMatchCodeError: Ve,
|
|
825
|
-
onOnClearCodeError: a[9] || (a[9] = (o) =>
|
|
825
|
+
onOnClearCodeError: a[9] || (a[9] = (o) => D.value = !1)
|
|
826
826
|
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "product"])) : x.value === r(j).COMPLETED ? (v(), S("div", $t, [
|
|
827
827
|
H("p", null, G(z("Телефон успешно изменен")), 1)
|
|
828
828
|
])) : B("", !0)
|
|
829
829
|
])) : (v(), S("div", Bt, [
|
|
830
|
-
C.value ? (v(), J(
|
|
830
|
+
C.value ? (v(), J(Oe, { key: 0 })) : B("", !0),
|
|
831
831
|
b(bt, {
|
|
832
832
|
phone: e.addPhone,
|
|
833
833
|
"onUpdate:phone": a[10] || (a[10] = (o) => e.addPhone = o),
|
|
@@ -838,17 +838,17 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
838
838
|
"hint-text": r(s) ? K.value : "Чтобы продолжить, введите новый номер",
|
|
839
839
|
"rate-limit-text": re.value,
|
|
840
840
|
"is-final-limit": ue.value,
|
|
841
|
-
"is-not-match-code":
|
|
841
|
+
"is-not-match-code": D.value,
|
|
842
842
|
loading: C.value,
|
|
843
843
|
"is-tg": y.value,
|
|
844
|
-
"
|
|
844
|
+
"disable-add-phone": n.disableAddPhone,
|
|
845
845
|
product: n.provider,
|
|
846
846
|
onOnSendCode: a[13] || (a[13] = (o) => ge({ value: e.addPhone, field: "phone" })),
|
|
847
847
|
onOnSendCodeAgain: a[14] || (a[14] = (o) => ge({ value: e.addPhone, field: "phone", isOnlySms: !y.value && i.value })),
|
|
848
848
|
onOnSendOnlySms: ye,
|
|
849
849
|
onOnMatchCode: Ee,
|
|
850
850
|
onOnMatchCodeError: Le
|
|
851
|
-
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "
|
|
851
|
+
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "disable-add-phone", "product"])
|
|
852
852
|
]))
|
|
853
853
|
]),
|
|
854
854
|
_: 1
|
|
@@ -14,7 +14,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
14
14
|
type?: string;
|
|
15
15
|
}>;
|
|
16
16
|
awsStorageUrl: string;
|
|
17
|
-
|
|
17
|
+
disableAddPhone: boolean;
|
|
18
18
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
19
19
|
"on-update-jwt": (flow?: "email" | "phone" | "password" | undefined, mode?: ModeType | undefined, newValue?: string | undefined) => any;
|
|
20
20
|
"on-password-error": (field: "email" | "phone" | "password", message: string) => any;
|
|
@@ -36,7 +36,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
36
36
|
type?: string;
|
|
37
37
|
}>;
|
|
38
38
|
awsStorageUrl: string;
|
|
39
|
-
|
|
39
|
+
disableAddPhone: boolean;
|
|
40
40
|
}> & Readonly<{
|
|
41
41
|
"onOn-update-jwt"?: ((flow?: "email" | "phone" | "password" | undefined, mode?: ModeType | undefined, newValue?: string | undefined) => any) | undefined;
|
|
42
42
|
"onOn-password-error"?: ((field: "email" | "phone" | "password", message: string) => any) | undefined;
|
|
@@ -3,7 +3,7 @@ import { EmitToastType, LangFormatType, ProviderType } from '../types';
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<{
|
|
4
4
|
language: LangFormatType;
|
|
5
5
|
provider: ProviderType;
|
|
6
|
-
|
|
6
|
+
disableAddPhone: boolean;
|
|
7
7
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
8
8
|
"on-toast": (value: EmitToastType) => any;
|
|
9
9
|
"clean-input-errors": () => any;
|
|
@@ -14,7 +14,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
14
14
|
}, string, import('vue').PublicProps, Readonly<{
|
|
15
15
|
language: LangFormatType;
|
|
16
16
|
provider: ProviderType;
|
|
17
|
-
|
|
17
|
+
disableAddPhone: boolean;
|
|
18
18
|
}> & Readonly<{
|
|
19
19
|
"onOn-toast"?: ((value: EmitToastType) => any) | undefined;
|
|
20
20
|
"onClean-input-errors"?: (() => any) | undefined;
|
package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/AddNewPhoneContent.vue.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ interface Props {
|
|
|
13
13
|
loading: boolean;
|
|
14
14
|
isTg: boolean;
|
|
15
15
|
product: Provider;
|
|
16
|
-
|
|
16
|
+
disableAddPhone: boolean;
|
|
17
17
|
}
|
|
18
18
|
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
19
19
|
edit: (field: "phone") => any;
|
|
@@ -70,5 +70,6 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
70
70
|
phoneError: string;
|
|
71
71
|
showPhone: boolean;
|
|
72
72
|
sendCodeBySmsText: string;
|
|
73
|
+
disableAddPhone: boolean;
|
|
73
74
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
74
75
|
export default _default;
|
|
@@ -14,7 +14,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
14
14
|
type?: string;
|
|
15
15
|
}>;
|
|
16
16
|
awsStorageUrl: string;
|
|
17
|
-
|
|
17
|
+
disableAddPhone: boolean;
|
|
18
18
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
19
19
|
"on-update-jwt": (flow?: "email" | "phone" | "password" | undefined, mode?: ModeType | undefined, newValue?: string | undefined) => any;
|
|
20
20
|
"update-tokens": (accessToken: string, refreshToken: string) => any;
|
|
@@ -32,7 +32,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
32
32
|
type?: string;
|
|
33
33
|
}>;
|
|
34
34
|
awsStorageUrl: string;
|
|
35
|
-
|
|
35
|
+
disableAddPhone: boolean;
|
|
36
36
|
}> & Readonly<{
|
|
37
37
|
"onOn-update-jwt"?: ((flow?: "email" | "phone" | "password" | undefined, mode?: ModeType | undefined, newValue?: string | undefined) => any) | undefined;
|
|
38
38
|
"onUpdate-tokens"?: ((accessToken: string, refreshToken: string) => any) | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as w, shallowRef as Le, defineComponent as H, defineAsyncComponent as J, watch as ze, createBlock as I, createCommentVNode as C, unref as m, openBlock as y, resolveDynamicComponent as Me, mergeProps as Re, computed as T, reactive as q, onMounted as Ge, createElementBlock as k, Fragment as me, createVNode as g, createElementVNode as Y, withCtx as
|
|
1
|
+
import { ref as w, shallowRef as Le, defineComponent as H, defineAsyncComponent as J, watch as ze, createBlock as I, createCommentVNode as C, unref as m, openBlock as y, resolveDynamicComponent as Me, mergeProps as Re, computed as T, reactive as q, onMounted as Ge, createElementBlock as k, Fragment as me, createVNode as g, createElementVNode as Y, withCtx as F, toDisplayString as D, createTextVNode as _, Teleport as ue, Transition as je, withDirectives as Je, vShow as qe } from "vue";
|
|
2
2
|
import Ye from "axios";
|
|
3
3
|
import { PInputFileUploader as _e, PInput as L, IconFilledEditMd as z, PButton as de, PImageCropper as We, PToast as Ke, PTeleportContainer as pe, PToastContainer as Ze } from "@profeat/ui-kit";
|
|
4
4
|
function He(l, r = 2) {
|
|
@@ -21,7 +21,7 @@ function Xe(l) {
|
|
|
21
21
|
return Qe[r] || ((n = r.split("/")[1]) == null ? void 0 : n.toUpperCase());
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const Na = {
|
|
25
25
|
OLD: "old",
|
|
26
26
|
NEW: "new",
|
|
27
27
|
COMPLETED: "completed"
|
|
@@ -212,14 +212,14 @@ const na = {
|
|
|
212
212
|
props: {
|
|
213
213
|
language: {},
|
|
214
214
|
provider: {},
|
|
215
|
-
|
|
215
|
+
disableAddPhone: { type: Boolean }
|
|
216
216
|
},
|
|
217
217
|
emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
|
|
218
218
|
setup(l, { emit: r }) {
|
|
219
219
|
const n = r, u = w(!0), { currentDialog: v, dialogPayload: c, closeDialog: U } = X(), i = {
|
|
220
|
-
email: J(() => import("./ProfileEmailDialog-
|
|
221
|
-
phone: J(() => import("./ProfilePhoneDialog-
|
|
222
|
-
password: J(() => import("./ProfilePasswordDialog-
|
|
220
|
+
email: J(() => import("./ProfileEmailDialog-BIv-HIyo.js")),
|
|
221
|
+
phone: J(() => import("./ProfilePhoneDialog-DzGWg6Di.js")),
|
|
222
|
+
password: J(() => import("./ProfilePasswordDialog-DSGWbmTB.js"))
|
|
223
223
|
}, s = ({ email: h }) => {
|
|
224
224
|
n("update-email-field", h);
|
|
225
225
|
}, p = ({ phone: h }) => {
|
|
@@ -233,16 +233,16 @@ const na = {
|
|
|
233
233
|
"onUpdate:modelValue": d[0] || (d[0] = (f) => u.value = f),
|
|
234
234
|
language: h.language,
|
|
235
235
|
provider: h.provider,
|
|
236
|
-
"
|
|
236
|
+
"disable-add-phone": h.disableAddPhone
|
|
237
237
|
}, m(c), {
|
|
238
238
|
onClose: m(U),
|
|
239
239
|
onCleanInputErrors: d[1] || (d[1] = (f) => n("clean-input-errors")),
|
|
240
|
-
onOnUpdateJwt: d[2] || (d[2] = (f,
|
|
240
|
+
onOnUpdateJwt: d[2] || (d[2] = (f, N, o) => n("on-update-jwt", f, N, o)),
|
|
241
241
|
onSubmitEmail: s,
|
|
242
242
|
onSubmitPhone: p,
|
|
243
|
-
onOnPasswordError: d[3] || (d[3] = (f,
|
|
243
|
+
onOnPasswordError: d[3] || (d[3] = (f, N) => n("on-password-error", f, N)),
|
|
244
244
|
onOnToast: d[4] || (d[4] = (f) => n("on-toast", f))
|
|
245
|
-
}), null, 16, ["modelValue", "language", "provider", "
|
|
245
|
+
}), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : C("", !0);
|
|
246
246
|
}
|
|
247
247
|
}), sa = { class: "base-container" }, la = {
|
|
248
248
|
key: 0,
|
|
@@ -273,11 +273,11 @@ const na = {
|
|
|
273
273
|
refreshToken: {},
|
|
274
274
|
fields: {},
|
|
275
275
|
awsStorageUrl: {},
|
|
276
|
-
|
|
276
|
+
disableAddPhone: { type: Boolean }
|
|
277
277
|
},
|
|
278
278
|
emits: ["open-email-dialog", "open-phone-dialog", "open-password-dialog", "on-update-jwt", "on-password-error", "update-tokens"],
|
|
279
279
|
setup(l, { emit: r }) {
|
|
280
|
-
const n = l, u = r, v = T(() => n.language ?? "ru"), c = (e) => na[v.value][e] || e, { openDialog: U } = X(), i = q({ firstName: "", lastName: "" }), s = w({ firstName: "", lastName: "" }), p = q({ firstName: !1, lastName: !1, email: !1, phone: !1 }), h = w(""), d = w(""), f = w(""),
|
|
280
|
+
const n = l, u = r, v = T(() => n.language ?? "ru"), c = (e) => na[v.value][e] || e, { openDialog: U } = X(), i = q({ firstName: "", lastName: "" }), s = w({ firstName: "", lastName: "" }), p = q({ firstName: !1, lastName: !1, email: !1, phone: !1 }), h = w(""), d = w(""), f = w(""), N = w(!1), o = q({
|
|
281
281
|
value: null,
|
|
282
282
|
loading: !1,
|
|
283
283
|
accept: ["image/png", "image/jpeg"],
|
|
@@ -285,7 +285,7 @@ const na = {
|
|
|
285
285
|
// 10 MB
|
|
286
286
|
imageBinary: null,
|
|
287
287
|
imageContent: ""
|
|
288
|
-
}), B = w(""), S = w(!1), R = w(!0), G = w(!0), ee = w(void 0), ae = w(""), ce = T(() => oe(i.firstName, p.firstName)), fe = T(() => oe(i.lastName, p.lastName)), ge = T(() => p.email && !d.value.trim() ? "Введите e-mail" : ""), ve = T(() => p.phone && !f.value.trim() ? "Введите номер телефона" : ""),
|
|
288
|
+
}), B = w(""), S = w(!1), R = w(!0), G = w(!0), ee = w(void 0), ae = w(""), ce = T(() => oe(i.firstName, p.firstName)), fe = T(() => oe(i.lastName, p.lastName)), ge = T(() => p.email && !d.value.trim() ? "Введите e-mail" : ""), ve = T(() => p.phone && !f.value.trim() ? "Введите номер телефона" : ""), A = (e) => n.fields.some((a) => a.key === e), te = (e) => e && e.trim() ? "edit" : "bind", j = () => setTimeout(() => {
|
|
289
289
|
var e;
|
|
290
290
|
return (e = document.activeElement) == null ? void 0 : e.blur();
|
|
291
291
|
}, 0), he = T(() => !!(d.value && d.value.trim() !== "")), we = T(() => o.imageContent ? c("Загрузить другое фото") : c("Загрузить фото")), oe = (e, a) => {
|
|
@@ -294,9 +294,9 @@ const na = {
|
|
|
294
294
|
return t ? t.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
|
|
295
295
|
}, ye = (e) => U("email", { mode: e ? "edit" : "bind", initialEmail: e }), Ee = () => {
|
|
296
296
|
j(), p.email = !1, G.value = !1, u("open-email-dialog", d.value, te(d.value)), ye(d.value);
|
|
297
|
-
},
|
|
297
|
+
}, be = () => {
|
|
298
298
|
j(), p.phone = !1, R.value = !1, u("open-phone-dialog", f.value, te(f.value));
|
|
299
|
-
},
|
|
299
|
+
}, Ne = async (e, a, t) => {
|
|
300
300
|
e === "email" && t && (d.value = t), e === "phone" && t && (f.value = t), u("on-update-jwt");
|
|
301
301
|
}, Pe = (e) => {
|
|
302
302
|
f.value = e;
|
|
@@ -319,14 +319,14 @@ const na = {
|
|
|
319
319
|
ne();
|
|
320
320
|
return;
|
|
321
321
|
}
|
|
322
|
-
const a = (($ = e.fileBinary) == null ? void 0 : $.type) ?? "", t = ((O = e.fileBinary) == null ? void 0 : O.size) ?? 0, P = !["image/png", "image/jpeg"].includes(a),
|
|
323
|
-
if (P ||
|
|
322
|
+
const a = (($ = e.fileBinary) == null ? void 0 : $.type) ?? "", t = ((O = e.fileBinary) == null ? void 0 : O.size) ?? 0, P = !["image/png", "image/jpeg"].includes(a), b = t > o.uploadLimit;
|
|
323
|
+
if (P || b) {
|
|
324
324
|
B.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", ne();
|
|
325
325
|
return;
|
|
326
326
|
}
|
|
327
|
-
o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "",
|
|
327
|
+
o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "", N.value = !0;
|
|
328
328
|
}, ne = () => {
|
|
329
|
-
o.value = null, o.imageBinary = null, o.imageContent = "",
|
|
329
|
+
o.value = null, o.imageBinary = null, o.imageContent = "", N.value = !1;
|
|
330
330
|
}, Be = async () => {
|
|
331
331
|
try {
|
|
332
332
|
const a = (await ta("/users/profile/delete/avatar")).data;
|
|
@@ -334,16 +334,16 @@ const na = {
|
|
|
334
334
|
} catch (e) {
|
|
335
335
|
return console.error("Ошибка при удалении аватара:", e), !1;
|
|
336
336
|
}
|
|
337
|
-
},
|
|
338
|
-
B.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", o.value = null, o.imageBinary = null, o.imageContent = "",
|
|
337
|
+
}, Ae = () => {
|
|
338
|
+
B.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", o.value = null, o.imageBinary = null, o.imageContent = "", N.value = !1;
|
|
339
339
|
}, re = async (e, a, t = "image/png") => {
|
|
340
340
|
if (!e) return null;
|
|
341
341
|
const P = await (await fetch(e)).blob();
|
|
342
342
|
return new File([P], a, { type: t });
|
|
343
|
-
},
|
|
344
|
-
o.value = null, o.imageBinary = null, o.imageContent = "",
|
|
345
|
-
},
|
|
346
|
-
|
|
343
|
+
}, Fe = () => {
|
|
344
|
+
o.value = null, o.imageBinary = null, o.imageContent = "", N.value = !1;
|
|
345
|
+
}, De = async (e) => {
|
|
346
|
+
N.value = !1;
|
|
347
347
|
const a = o.imageContent;
|
|
348
348
|
if (o.imageContent = e, !o.imageBinary) return;
|
|
349
349
|
const t = await re(
|
|
@@ -379,8 +379,8 @@ const na = {
|
|
|
379
379
|
if (a)
|
|
380
380
|
try {
|
|
381
381
|
se.value = !0;
|
|
382
|
-
const
|
|
383
|
-
|
|
382
|
+
const b = (E = (await Z("/users/profile/update-name", { [e]: a })).data) == null ? void 0 : E.data;
|
|
383
|
+
b != null && b.user && (i.firstName = b.user.firstName ?? i.firstName, i.lastName = b.user.lastName ?? i.lastName, s.value = {
|
|
384
384
|
firstName: i.firstName,
|
|
385
385
|
lastName: i.lastName
|
|
386
386
|
});
|
|
@@ -404,13 +404,13 @@ const na = {
|
|
|
404
404
|
const {
|
|
405
405
|
userId: E,
|
|
406
406
|
privateFirstName: P,
|
|
407
|
-
privateLastName:
|
|
407
|
+
privateLastName: b,
|
|
408
408
|
email: $,
|
|
409
409
|
phoneNumber: O
|
|
410
410
|
} = t;
|
|
411
|
-
h.value = E ?? "", i.firstName = P ?? "", i.lastName =
|
|
411
|
+
h.value = E ?? "", i.firstName = P ?? "", i.lastName = b ?? "", d.value = $ ?? "", f.value = O ?? "", o.imageContent = await Ve(), s.value = {
|
|
412
412
|
firstName: P ?? "",
|
|
413
|
-
lastName:
|
|
413
|
+
lastName: b ?? ""
|
|
414
414
|
};
|
|
415
415
|
} catch (a) {
|
|
416
416
|
console.error("Критическая ошибка при загрузке профиля:", a);
|
|
@@ -436,8 +436,8 @@ const na = {
|
|
|
436
436
|
const ie = T(() => {
|
|
437
437
|
if (!s.value.firstName && !s.value.lastName)
|
|
438
438
|
return !1;
|
|
439
|
-
const e = i.firstName.trim(), a = i.lastName.trim(), t = s.value.firstName.trim(), E = s.value.lastName.trim(), P = e !== t || a !== E,
|
|
440
|
-
return P &&
|
|
439
|
+
const e = i.firstName.trim(), a = i.lastName.trim(), t = s.value.firstName.trim(), E = s.value.lastName.trim(), P = e !== t || a !== E, b = e.length >= 2 && a.length >= 2;
|
|
440
|
+
return P && b;
|
|
441
441
|
}), $e = async () => {
|
|
442
442
|
if (ie.value)
|
|
443
443
|
try {
|
|
@@ -459,16 +459,16 @@ const na = {
|
|
|
459
459
|
g(ra, {
|
|
460
460
|
language: v.value,
|
|
461
461
|
provider: e.provider,
|
|
462
|
-
"
|
|
462
|
+
"disable-add-phone": e.disableAddPhone,
|
|
463
463
|
onCleanInputErrors: Te,
|
|
464
|
-
onOnUpdateJwt:
|
|
464
|
+
onOnUpdateJwt: Ne,
|
|
465
465
|
onUpdatePhoneField: Pe,
|
|
466
466
|
onUpdateEmailField: Ce,
|
|
467
467
|
onOnPasswordError: ke,
|
|
468
468
|
onOnToast: V
|
|
469
|
-
}, null, 8, ["language", "provider", "
|
|
469
|
+
}, null, 8, ["language", "provider", "disable-add-phone"]),
|
|
470
470
|
Y("div", sa, [
|
|
471
|
-
|
|
471
|
+
A("avatar") ? (y(), I(m(_e), {
|
|
472
472
|
key: 0,
|
|
473
473
|
modelValue: o.value,
|
|
474
474
|
"onUpdate:modelValue": [
|
|
@@ -483,17 +483,17 @@ const na = {
|
|
|
483
483
|
"upload-limit": o.uploadLimit,
|
|
484
484
|
accept: "image/jpeg, image/png",
|
|
485
485
|
onDelete: Be,
|
|
486
|
-
"onChange:error":
|
|
486
|
+
"onChange:error": Ae
|
|
487
487
|
}, {
|
|
488
|
-
afterLoadLabel:
|
|
489
|
-
_(
|
|
488
|
+
afterLoadLabel: F(() => [
|
|
489
|
+
_(D(we.value), 1)
|
|
490
490
|
]),
|
|
491
|
-
subtext:
|
|
492
|
-
B.value ? (y(), k("span", la,
|
|
491
|
+
subtext: F(() => [
|
|
492
|
+
B.value ? (y(), k("span", la, D(B.value), 1)) : (y(), k("span", ia, D(`${c("Формат")} ${m(Xe)(o.accept).join(", ")} ${c("до")} ${m(He)(o.uploadLimit)}`), 1))
|
|
493
493
|
]),
|
|
494
494
|
_: 1
|
|
495
495
|
}, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : C("", !0),
|
|
496
|
-
|
|
496
|
+
A("firstName") ? (y(), k("div", ua, [
|
|
497
497
|
g(m(L), {
|
|
498
498
|
modelValue: i.firstName,
|
|
499
499
|
"onUpdate:modelValue": a[2] || (a[2] = (t) => i.firstName = t),
|
|
@@ -505,7 +505,7 @@ const na = {
|
|
|
505
505
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
506
506
|
g(m(z), { class: "icon-locked" })
|
|
507
507
|
])) : C("", !0),
|
|
508
|
-
|
|
508
|
+
A("lastName") ? (y(), k("div", da, [
|
|
509
509
|
g(m(L), {
|
|
510
510
|
modelValue: i.lastName,
|
|
511
511
|
"onUpdate:modelValue": a[5] || (a[5] = (t) => i.lastName = t),
|
|
@@ -517,7 +517,7 @@ const na = {
|
|
|
517
517
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
518
518
|
g(m(z), { class: "icon-locked" })
|
|
519
519
|
])) : C("", !0),
|
|
520
|
-
|
|
520
|
+
A("email") ? (y(), k("div", ma, [
|
|
521
521
|
g(m(L), {
|
|
522
522
|
modelValue: d.value,
|
|
523
523
|
"onUpdate:modelValue": a[8] || (a[8] = (t) => d.value = t),
|
|
@@ -534,7 +534,7 @@ const na = {
|
|
|
534
534
|
}, null, 8, ["modelValue", "error"]),
|
|
535
535
|
g(m(z), { class: "icon-locked" })
|
|
536
536
|
])) : C("", !0),
|
|
537
|
-
|
|
537
|
+
A("phone") ? (y(), k("div", pa, [
|
|
538
538
|
g(m(L), {
|
|
539
539
|
modelValue: f.value,
|
|
540
540
|
"onUpdate:modelValue": a[11] || (a[11] = (t) => f.value = t),
|
|
@@ -547,7 +547,7 @@ const na = {
|
|
|
547
547
|
error: ve.value && R.value,
|
|
548
548
|
onBlur: a[12] || (a[12] = (t) => p.phone = !0),
|
|
549
549
|
onInput: a[13] || (a[13] = (t) => x("phone")),
|
|
550
|
-
onClick:
|
|
550
|
+
onClick: be
|
|
551
551
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
552
552
|
g(m(z), { class: "icon-locked" })
|
|
553
553
|
])) : C("", !0),
|
|
@@ -557,8 +557,8 @@ const na = {
|
|
|
557
557
|
color: "secondary",
|
|
558
558
|
onClick: Oe
|
|
559
559
|
}, {
|
|
560
|
-
default:
|
|
561
|
-
_(
|
|
560
|
+
default: F(() => [
|
|
561
|
+
_(D(c("Сменить пароль")), 1)
|
|
562
562
|
]),
|
|
563
563
|
_: 1
|
|
564
564
|
})) : C("", !0),
|
|
@@ -566,23 +566,23 @@ const na = {
|
|
|
566
566
|
disabled: !ie.value,
|
|
567
567
|
onClick: $e
|
|
568
568
|
}, {
|
|
569
|
-
default:
|
|
570
|
-
_(
|
|
569
|
+
default: F(() => [
|
|
570
|
+
_(D(c("Сохранить")), 1)
|
|
571
571
|
]),
|
|
572
572
|
_: 1
|
|
573
573
|
}, 8, ["disabled"])
|
|
574
574
|
])
|
|
575
575
|
]),
|
|
576
|
-
|
|
576
|
+
N.value ? (y(), I(ue, {
|
|
577
577
|
key: 0,
|
|
578
578
|
to: "body"
|
|
579
579
|
}, [
|
|
580
|
-
|
|
580
|
+
N.value ? (y(), k("div", fa, [
|
|
581
581
|
g(m(We), {
|
|
582
582
|
"circle-mode": !0,
|
|
583
583
|
"model-value": o.imageContent,
|
|
584
|
-
onClose:
|
|
585
|
-
onSave: a[14] || (a[14] = (t) =>
|
|
584
|
+
onClose: Fe,
|
|
585
|
+
onSave: a[14] || (a[14] = (t) => De(t)),
|
|
586
586
|
"onUpdate:modelValue": a[15] || (a[15] = (t) => Ie(t))
|
|
587
587
|
}, null, 8, ["model-value"])
|
|
588
588
|
])) : C("", !0)
|
|
@@ -590,7 +590,7 @@ const na = {
|
|
|
590
590
|
(y(), I(ue, { to: "#toast-root" }, [
|
|
591
591
|
Y("div", ga, [
|
|
592
592
|
g(je, { name: "list" }, {
|
|
593
|
-
default:
|
|
593
|
+
default: F(() => [
|
|
594
594
|
Je(g(m(Ke), {
|
|
595
595
|
class: "toast",
|
|
596
596
|
color: ee.value,
|
|
@@ -612,7 +612,7 @@ const na = {
|
|
|
612
612
|
for (const [u, v] of r)
|
|
613
613
|
n[u] = v;
|
|
614
614
|
return n;
|
|
615
|
-
}, wa = /* @__PURE__ */ ha(va, [["__scopeId", "data-v-
|
|
615
|
+
}, wa = /* @__PURE__ */ ha(va, [["__scopeId", "data-v-74ba6f97"]]), Ca = /* @__PURE__ */ H({
|
|
616
616
|
__name: "index",
|
|
617
617
|
props: {
|
|
618
618
|
throttlerPrefix: {},
|
|
@@ -623,7 +623,7 @@ const na = {
|
|
|
623
623
|
language: {},
|
|
624
624
|
fields: {},
|
|
625
625
|
awsStorageUrl: {},
|
|
626
|
-
|
|
626
|
+
disableAddPhone: { type: Boolean }
|
|
627
627
|
},
|
|
628
628
|
emits: ["on-update-jwt", "update-tokens"],
|
|
629
629
|
setup(l, { emit: r }) {
|
|
@@ -647,19 +647,19 @@ const na = {
|
|
|
647
647
|
"access-token": s.accessToken,
|
|
648
648
|
"refresh-token": s.refreshToken,
|
|
649
649
|
"aws-storage-url": s.awsStorageUrl,
|
|
650
|
-
"
|
|
650
|
+
"disable-add-phone": s.disableAddPhone,
|
|
651
651
|
onOpenEmailDialog: v,
|
|
652
652
|
onOpenPhoneDialog: c,
|
|
653
653
|
onOpenPasswordDialog: U,
|
|
654
654
|
onOnUpdateJwt: i
|
|
655
|
-
}, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token", "aws-storage-url", "
|
|
655
|
+
}, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token", "aws-storage-url", "disable-add-phone"]),
|
|
656
656
|
g(m(pe))
|
|
657
657
|
], 64));
|
|
658
658
|
}
|
|
659
659
|
});
|
|
660
660
|
export {
|
|
661
661
|
Pa as B,
|
|
662
|
-
|
|
662
|
+
Na as C,
|
|
663
663
|
ha as _,
|
|
664
664
|
Ca as a,
|
|
665
665
|
aa as g,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".avatar-input[data-v-
|
|
2
|
-
import { a as o } from "./index-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".avatar-input[data-v-74ba6f97] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-74ba6f97] .p-input-file:hover .overlay{visibility:visible}.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:440px;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
import { a as o } from "./index-DdkjHGxk.js";
|
|
3
3
|
export {
|
|
4
4
|
o as PEditUserContact
|
|
5
5
|
};
|
|
@@ -0,0 +1,132 @@
|
|
|
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
|
+
import { PLoader as $ } from "@profeat/ui-kit";
|
|
3
|
+
import { _ as b, g as C, p as R } from "./index-DdkjHGxk.js";
|
|
4
|
+
function g(s) {
|
|
5
|
+
const e = Math.floor(s / 60), a = s % 60;
|
|
6
|
+
return `${String(e).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
|
|
7
|
+
}
|
|
8
|
+
function q() {
|
|
9
|
+
let s = null;
|
|
10
|
+
const e = n(0), a = n(!1), t = n("00:00"), o = n(0), l = n(0), r = n(!1);
|
|
11
|
+
return {
|
|
12
|
+
startTimer: (u, m) => {
|
|
13
|
+
s && clearInterval(s), r.value = !1, e.value = u, a.value = u > 0, t.value = g(u);
|
|
14
|
+
const k = Date.now() + u * 1e3;
|
|
15
|
+
s = setInterval(() => {
|
|
16
|
+
e.value > 1 ? (e.value = Math.max(0, Math.round((k - Date.now()) / 1e3)), t.value = g(e.value)) : (clearInterval(s), e.value = 0, a.value = !1, r.value = !0, m && typeof m == "function" && m());
|
|
17
|
+
}, 1e3);
|
|
18
|
+
},
|
|
19
|
+
isShowRateTimers: a,
|
|
20
|
+
remainingSeconds: t,
|
|
21
|
+
totalRateAttempts: o,
|
|
22
|
+
currentRateAttempt: l,
|
|
23
|
+
isAvailableForSendAgain: r
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const S = /* @__PURE__ */ L({
|
|
27
|
+
__name: "ProfileOverlayLoading",
|
|
28
|
+
setup(s) {
|
|
29
|
+
return (e, a) => (v(), p("div", {
|
|
30
|
+
class: c(e.$style.loaderOverlay)
|
|
31
|
+
}, [
|
|
32
|
+
w(_($), {
|
|
33
|
+
class: "relative m-auto",
|
|
34
|
+
size: "normal"
|
|
35
|
+
})
|
|
36
|
+
], 2));
|
|
37
|
+
}
|
|
38
|
+
}), F = "_loaderOverlay_cpu73_1", M = {
|
|
39
|
+
loaderOverlay: F
|
|
40
|
+
}, x = {
|
|
41
|
+
$style: M
|
|
42
|
+
}, G = /* @__PURE__ */ b(S, [["__cssModules", x], ["__scopeId", "data-v-9e697525"]]);
|
|
43
|
+
function H(s) {
|
|
44
|
+
const e = n("edit"), a = T(() => s.value === "edit" && e.value === "edit");
|
|
45
|
+
return {
|
|
46
|
+
modeFlowFromBack: e,
|
|
47
|
+
isEditFlow: a,
|
|
48
|
+
getFlow: async (o) => {
|
|
49
|
+
const r = (await C("/users/profile/session/flow", { params: { field: o } })).data.data;
|
|
50
|
+
return e.value = r.mode, r.mode;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const J = async (s, e) => {
|
|
55
|
+
try {
|
|
56
|
+
return await R("/users/profile/contact/check-availability", {
|
|
57
|
+
email: s,
|
|
58
|
+
phone: e
|
|
59
|
+
});
|
|
60
|
+
} catch (a) {
|
|
61
|
+
throw console.error("Ошибка проверки доступности", a), a;
|
|
62
|
+
}
|
|
63
|
+
}, A = {
|
|
64
|
+
key: 0,
|
|
65
|
+
class: "spacer",
|
|
66
|
+
style: { height: "20px", width: "100%" }
|
|
67
|
+
}, O = { key: 1 }, B = { style: { display: "flex", "align-items": "center", "justify-content": "space-between" } }, D = "dialogDefaultContainerRateLimitText", I = "dialogDefaultContainerRateLimitTextActive", N = "finalLimitWrapper", P = "finalLimitText", V = "finalLimitLink", K = /* @__PURE__ */ L({
|
|
68
|
+
__name: "ThrottlerTimer",
|
|
69
|
+
props: {
|
|
70
|
+
loading: { type: Boolean, default: !1 },
|
|
71
|
+
rateLimitText: {},
|
|
72
|
+
isFinalLimit: { type: Boolean },
|
|
73
|
+
onSendAgain: {},
|
|
74
|
+
product: {}
|
|
75
|
+
},
|
|
76
|
+
setup(s) {
|
|
77
|
+
const e = s, a = T(() => e.rateLimitText === "Повторить");
|
|
78
|
+
return (t, o) => t.loading ? (v(), p("div", A)) : (v(), p("div", O, [
|
|
79
|
+
t.isFinalLimit ? t.isFinalLimit && t.rateLimitText !== "Повторить" ? d(t.$slots, "final", { key: 1 }, () => [
|
|
80
|
+
i("div", {
|
|
81
|
+
class: c(N)
|
|
82
|
+
}, [
|
|
83
|
+
i("div", {
|
|
84
|
+
class: c(P)
|
|
85
|
+
}, [
|
|
86
|
+
o[1] || (o[1] = f(" Вы слишком часто запрашивали код. ")),
|
|
87
|
+
o[2] || (o[2] = i("br", null, null, -1)),
|
|
88
|
+
f(" Новый код можно получить через " + y(t.rateLimitText) + ". ", 1)
|
|
89
|
+
]),
|
|
90
|
+
i("span", { style: { display: "inline" } }, [
|
|
91
|
+
o[3] || (o[3] = f(" Если есть вопросы — ")),
|
|
92
|
+
i("a", {
|
|
93
|
+
class: c(V),
|
|
94
|
+
href: "https://t.me/yg_support_bot",
|
|
95
|
+
target: "_blank"
|
|
96
|
+
}, "пишите в Telegram.")
|
|
97
|
+
])
|
|
98
|
+
])
|
|
99
|
+
]) : h("", !0) : d(t.$slots, "active", { key: 0 }, () => [
|
|
100
|
+
i("div", B, [
|
|
101
|
+
i("span", {
|
|
102
|
+
class: c([D, { [I]: a.value }]),
|
|
103
|
+
onClick: o[0] || (o[0] = (l) => a.value && t.onSendAgain())
|
|
104
|
+
}, y(a.value ? "Повторить" : `Повторить через ${t.rateLimitText}`), 3),
|
|
105
|
+
d(t.$slots, "extra")
|
|
106
|
+
])
|
|
107
|
+
])
|
|
108
|
+
]));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
function Q(s) {
|
|
112
|
+
return { showRateLimitToast: (t) => {
|
|
113
|
+
if (!t) return;
|
|
114
|
+
const { attemptsLeft: o } = t, l = {
|
|
115
|
+
2: "Осталось 2 попытки. После исчерпания лимита ввод кода будет заблокирован на 5 минут",
|
|
116
|
+
1: "Осталась 1 попытка. После следующей ошибки ввод кода будет заблокирован на 5 минут",
|
|
117
|
+
0: "Достигнут лимит попыток ввода кода. Попробуйте снова через 5 минут"
|
|
118
|
+
};
|
|
119
|
+
l[o] && s("on-toast", {
|
|
120
|
+
color: "error",
|
|
121
|
+
text: l[o]
|
|
122
|
+
});
|
|
123
|
+
} };
|
|
124
|
+
}
|
|
125
|
+
export {
|
|
126
|
+
G as P,
|
|
127
|
+
K as _,
|
|
128
|
+
q as a,
|
|
129
|
+
Q as b,
|
|
130
|
+
J as c,
|
|
131
|
+
H as u
|
|
132
|
+
};
|
package/package.json
CHANGED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { ref as r, defineComponent as _, createElementBlock as f, openBlock as v, normalizeClass as c, createVNode as T, unref as h, computed as L, renderSlot as m, createCommentVNode as b, createElementVNode as n, toDisplayString as g, createTextVNode as p } from "vue";
|
|
2
|
-
import { PLoader as k } from "@profeat/ui-kit";
|
|
3
|
-
import { _ as $, g as C, p as R } from "./index-5nM1qYsp.js";
|
|
4
|
-
function y(e) {
|
|
5
|
-
const a = Math.floor(e / 60), s = e % 60;
|
|
6
|
-
return `${String(a).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
|
|
7
|
-
}
|
|
8
|
-
function G() {
|
|
9
|
-
let e = null;
|
|
10
|
-
const a = r(0), s = r(!1), t = r("00:00"), o = r(0), i = r(0), l = r(!1);
|
|
11
|
-
return {
|
|
12
|
-
startTimer: (u, d) => {
|
|
13
|
-
e && clearInterval(e), l.value = !1, a.value = u, s.value = u > 0, t.value = y(u);
|
|
14
|
-
const w = Date.now() + u * 1e3;
|
|
15
|
-
e = setInterval(() => {
|
|
16
|
-
a.value > 1 ? (a.value = Math.max(0, Math.round((w - Date.now()) / 1e3)), t.value = y(a.value)) : (clearInterval(e), a.value = 0, s.value = !1, l.value = !0, d && typeof d == "function" && d());
|
|
17
|
-
}, 1e3);
|
|
18
|
-
},
|
|
19
|
-
isShowRateTimers: s,
|
|
20
|
-
remainingSeconds: t,
|
|
21
|
-
totalRateAttempts: o,
|
|
22
|
-
currentRateAttempt: i,
|
|
23
|
-
isAvailableForSendAgain: l
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
const S = /* @__PURE__ */ _({
|
|
27
|
-
__name: "ProfileOverlayLoading",
|
|
28
|
-
setup(e) {
|
|
29
|
-
return (a, s) => (v(), f("div", {
|
|
30
|
-
class: c(a.$style.loaderOverlay)
|
|
31
|
-
}, [
|
|
32
|
-
T(h(k), {
|
|
33
|
-
class: "relative m-auto",
|
|
34
|
-
size: "normal"
|
|
35
|
-
})
|
|
36
|
-
], 2));
|
|
37
|
-
}
|
|
38
|
-
}), F = "_loaderOverlay_cpu73_1", M = {
|
|
39
|
-
loaderOverlay: F
|
|
40
|
-
}, A = {
|
|
41
|
-
$style: M
|
|
42
|
-
}, H = /* @__PURE__ */ $(S, [["__cssModules", A], ["__scopeId", "data-v-9e697525"]]);
|
|
43
|
-
function J(e) {
|
|
44
|
-
const a = r("edit"), s = L(() => e.value === "edit" && a.value === "edit");
|
|
45
|
-
return {
|
|
46
|
-
modeFlowFromBack: a,
|
|
47
|
-
isEditFlow: s,
|
|
48
|
-
getFlow: async (o) => {
|
|
49
|
-
const l = (await C("/users/profile/session/flow", { params: { field: o } })).data.data;
|
|
50
|
-
return a.value = l.mode, l.mode;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
const K = async (e, a) => {
|
|
55
|
-
try {
|
|
56
|
-
return await R("/users/profile/contact/check-availability", {
|
|
57
|
-
email: e,
|
|
58
|
-
phone: a
|
|
59
|
-
});
|
|
60
|
-
} catch (s) {
|
|
61
|
-
throw console.error("Ошибка проверки доступности", s), s;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
function x(e) {
|
|
65
|
-
switch (e) {
|
|
66
|
-
case "widget":
|
|
67
|
-
return "https://t.me/yourgoodwidget_bot";
|
|
68
|
-
case "planner":
|
|
69
|
-
return "https://t.me/Yourgood_planner_bot";
|
|
70
|
-
case "sendbot":
|
|
71
|
-
return "https://t.me/care_sendbot";
|
|
72
|
-
case "logic":
|
|
73
|
-
return "https://t.me/yourgoodwidget_bot";
|
|
74
|
-
case "crm":
|
|
75
|
-
return "https://t.me/YourgoodsCRM_bot";
|
|
76
|
-
case "dengi":
|
|
77
|
-
return "https://t.me/yourgoodwidget_bot";
|
|
78
|
-
default:
|
|
79
|
-
return "https://t.me/yourgoodwidget_bot";
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
const O = {
|
|
83
|
-
key: 0,
|
|
84
|
-
class: "spacer",
|
|
85
|
-
style: { height: "20px", width: "100%" }
|
|
86
|
-
}, B = { key: 1 }, D = { style: { display: "flex", "align-items": "center", "justify-content": "space-between" } }, I = { style: { display: "inline" } }, N = ["href"], P = "dialogDefaultContainerRateLimitText", V = "dialogDefaultContainerRateLimitTextActive", E = "finalLimitWrapper", z = "finalLimitText", W = "finalLimitLink", Q = /* @__PURE__ */ _({
|
|
87
|
-
__name: "ThrottlerTimer",
|
|
88
|
-
props: {
|
|
89
|
-
loading: { type: Boolean, default: !1 },
|
|
90
|
-
rateLimitText: {},
|
|
91
|
-
isFinalLimit: { type: Boolean },
|
|
92
|
-
onSendAgain: {},
|
|
93
|
-
product: {}
|
|
94
|
-
},
|
|
95
|
-
setup(e) {
|
|
96
|
-
const a = e, s = L(() => a.rateLimitText === "Повторить");
|
|
97
|
-
return (t, o) => t.loading ? (v(), f("div", O)) : (v(), f("div", B, [
|
|
98
|
-
t.isFinalLimit ? t.isFinalLimit && t.rateLimitText !== "Повторить" ? m(t.$slots, "final", { key: 1 }, () => [
|
|
99
|
-
n("div", {
|
|
100
|
-
class: c(E)
|
|
101
|
-
}, [
|
|
102
|
-
n("div", {
|
|
103
|
-
class: c(z)
|
|
104
|
-
}, [
|
|
105
|
-
o[1] || (o[1] = p(" Вы слишком часто запрашивали код. ")),
|
|
106
|
-
o[2] || (o[2] = n("br", null, null, -1)),
|
|
107
|
-
p(" Новый код можно получить через " + g(t.rateLimitText) + ". ", 1)
|
|
108
|
-
]),
|
|
109
|
-
n("span", I, [
|
|
110
|
-
o[3] || (o[3] = p(" Если есть вопросы — ")),
|
|
111
|
-
n("a", {
|
|
112
|
-
class: c(W),
|
|
113
|
-
href: h(x)(t.product),
|
|
114
|
-
target: "_blank"
|
|
115
|
-
}, "пишите в Telegram.", 8, N)
|
|
116
|
-
])
|
|
117
|
-
])
|
|
118
|
-
]) : b("", !0) : m(t.$slots, "active", { key: 0 }, () => [
|
|
119
|
-
n("div", D, [
|
|
120
|
-
n("span", {
|
|
121
|
-
class: c([P, { [V]: s.value }]),
|
|
122
|
-
onClick: o[0] || (o[0] = (i) => s.value && t.onSendAgain())
|
|
123
|
-
}, g(s.value ? "Повторить" : `Повторить через ${t.rateLimitText}`), 3),
|
|
124
|
-
m(t.$slots, "extra")
|
|
125
|
-
])
|
|
126
|
-
])
|
|
127
|
-
]));
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
function X(e) {
|
|
131
|
-
return { showRateLimitToast: (t) => {
|
|
132
|
-
if (!t) return;
|
|
133
|
-
const { attemptsLeft: o } = t, i = {
|
|
134
|
-
2: "Осталось 2 попытки. После исчерпания лимита ввод кода будет заблокирован на 5 минут",
|
|
135
|
-
1: "Осталась 1 попытка. После следующей ошибки ввод кода будет заблокирован на 5 минут",
|
|
136
|
-
0: "Достигнут лимит попыток ввода кода. Попробуйте снова через 5 минут"
|
|
137
|
-
};
|
|
138
|
-
i[o] && e("on-toast", {
|
|
139
|
-
color: "error",
|
|
140
|
-
text: i[o]
|
|
141
|
-
});
|
|
142
|
-
} };
|
|
143
|
-
}
|
|
144
|
-
export {
|
|
145
|
-
H as P,
|
|
146
|
-
Q as _,
|
|
147
|
-
G as a,
|
|
148
|
-
X as b,
|
|
149
|
-
K as c,
|
|
150
|
-
J as u
|
|
151
|
-
};
|