@yourgoods/ui-smart 0.41.0 → 0.42.0
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-B5qG1a49.js → ProfileEmailDialog-CGzr5Ocq.js} +2 -2
- package/dist/{ProfilePasswordDialog-CrTrG_OZ.js → ProfilePasswordDialog-B1tiN8io.js} +1 -1
- package/dist/{ProfilePhoneDialog-Cw739x1Q.js → ProfilePhoneDialog-FU-f-BrQ.js} +2 -2
- package/dist/{index-DLfEv7A5.js → index-Djp-dW6j.js} +198 -181
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-Ci3c9oSV.js → useRateLimitToast-DAUQG_SZ.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as te, ref as b, reactive as Q, watch as Y, computed as M, toRefs as re, createElementBlock as k, openBlock as E, createElementVNode as S, createCommentVNode as D, toDisplayString as X, createVNode as $, unref as u, isRef as Z, withCtx as G, createTextVNode as le, Fragment as Oe, createBlock as H, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
|
|
2
|
-
import { T as ue, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-
|
|
3
|
-
import { C as A, _ as ze, B as We, p as W, g as He } from "./index-
|
|
2
|
+
import { T as ue, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-DAUQG_SZ.js";
|
|
3
|
+
import { C as A, _ as ze, B as We, p as W, g as He } from "./index-Djp-dW6j.js";
|
|
4
4
|
import { PInput as J, IconMailMd as me, PButton as oe, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as _e, PTopBar as qe, IconCrossMd as je } from "@profeat/ui-kit";
|
|
5
5
|
const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dialogDefaultContainerTextHint" }, Je = {
|
|
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-Djp-dW6j.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 T, openBlock as h, createElementVNode as U, defineComponent as ue, reactive as ce, watch as Z, ref as O, toRefs as fe, computed as E, createCommentVNode as V, createVNode as S, toDisplayString as H, createBlock as G, createTextVNode as Y, unref as i, isRef as te, withCtx as K, onMounted as Ue, Fragment as qe } from "vue";
|
|
2
|
-
import { T as ge, c as Le, a as We, u as je, P as Ee, b as He } from "./useRateLimitToast-
|
|
2
|
+
import { T as ge, c as Le, a as We, u as je, P as Ee, b as He } from "./useRateLimitToast-DAUQG_SZ.js";
|
|
3
3
|
import { IconTelegramSm as ye, PInput as oe, IconPhoneMd as Ge, IconMailMd as De, PButton as Ae, PDialog as Je, PTopBar as Ke, IconCrossMd as Qe, PTeleportContainer as Xe } from "@profeat/ui-kit";
|
|
4
|
-
import { C as j, t as Ie, p as ee, g as Oe } from "./index-
|
|
4
|
+
import { C as j, t as Ie, p as ee, g as Oe } from "./index-Djp-dW6j.js";
|
|
5
5
|
const Ye = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: "12",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as h, shallowRef as ze, defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { PInputFileUploader as _e, PInput as
|
|
4
|
-
function Ze(
|
|
5
|
-
if (
|
|
1
|
+
import { ref as h, shallowRef as ze, defineComponent as H, defineAsyncComponent as q, watch as ue, createBlock as I, createCommentVNode as b, unref as m, openBlock as y, resolveDynamicComponent as Le, mergeProps as Me, computed as T, reactive as J, onMounted as Re, createElementBlock as k, Fragment as me, createVNode as g, createElementVNode as _, withCtx as D, toDisplayString as F, createTextVNode as Y, Teleport as se, Transition as Ge, withDirectives as je, vShow as qe } from "vue";
|
|
2
|
+
import Je from "axios";
|
|
3
|
+
import { PInputFileUploader as _e, PInput as O, IconFilledEditMd as z, PButton as ie, PImageCropper as Ye, PToast as We, PTeleportContainer as de, PToastContainer as Ke } from "@profeat/ui-kit";
|
|
4
|
+
function Ze(l, n = 2) {
|
|
5
|
+
if (l === 0)
|
|
6
6
|
return "0 B";
|
|
7
|
-
const r = 1024, i = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], v = Math.floor(Math.log(
|
|
8
|
-
return `${Number.parseFloat((
|
|
7
|
+
const r = 1024, i = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], v = Math.floor(Math.log(l) / Math.log(r));
|
|
8
|
+
return `${Number.parseFloat((l / r ** v).toFixed(n))} ${i[v]}`;
|
|
9
9
|
}
|
|
10
10
|
const He = {
|
|
11
11
|
"image/jpeg": "JPEG",
|
|
@@ -15,8 +15,8 @@ const He = {
|
|
|
15
15
|
"application/zip": "ZIP Archive"
|
|
16
16
|
// ...
|
|
17
17
|
};
|
|
18
|
-
function Qe(
|
|
19
|
-
return
|
|
18
|
+
function Qe(l) {
|
|
19
|
+
return l.map((n) => {
|
|
20
20
|
var r;
|
|
21
21
|
return He[n] || ((r = n.split("/")[1]) == null ? void 0 : r.toUpperCase());
|
|
22
22
|
});
|
|
@@ -28,50 +28,50 @@ const Na = {
|
|
|
28
28
|
}, Ca = {
|
|
29
29
|
VERIFY_EMAIL: "verify-email"
|
|
30
30
|
};
|
|
31
|
-
let
|
|
32
|
-
function Xe(
|
|
33
|
-
|
|
31
|
+
let K = null;
|
|
32
|
+
function Xe(l, n) {
|
|
33
|
+
K = Je.create({
|
|
34
34
|
baseURL: n,
|
|
35
35
|
headers: {
|
|
36
|
-
Authorization: `Bearer ${
|
|
36
|
+
Authorization: `Bearer ${l}`,
|
|
37
37
|
// 'Content-Type': 'application/json',
|
|
38
38
|
"x-throttler-prefix": "throttler_profile_edit"
|
|
39
39
|
},
|
|
40
40
|
validateStatus: () => !0
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
if (!
|
|
43
|
+
function Q() {
|
|
44
|
+
if (!K)
|
|
45
45
|
throw new Error("Axios instance not initialized. Call initAxios(token, baseUrl) first.");
|
|
46
|
-
return
|
|
46
|
+
return K;
|
|
47
47
|
}
|
|
48
|
-
async function
|
|
49
|
-
return
|
|
48
|
+
async function Z(l, n, r) {
|
|
49
|
+
return Q().post(l, n, r);
|
|
50
50
|
}
|
|
51
|
-
async function ea(
|
|
52
|
-
return
|
|
51
|
+
async function ea(l, n) {
|
|
52
|
+
return Q().get(l, n);
|
|
53
53
|
}
|
|
54
|
-
async function aa(
|
|
55
|
-
return
|
|
54
|
+
async function aa(l, n) {
|
|
55
|
+
return Q().delete(l, n);
|
|
56
56
|
}
|
|
57
|
-
async function ta(
|
|
58
|
-
const n = await
|
|
57
|
+
async function ta(l) {
|
|
58
|
+
const n = await Z("/users/profile/me", l);
|
|
59
59
|
if (console.log("---res: ", n), n.status !== 200 && n.status !== 201 || !n.data)
|
|
60
60
|
throw new Error("Ошибка при получении профиля пользователя");
|
|
61
61
|
return n.data;
|
|
62
62
|
}
|
|
63
|
-
const
|
|
64
|
-
function
|
|
63
|
+
const L = h(null), W = ze(null);
|
|
64
|
+
function X() {
|
|
65
65
|
return {
|
|
66
|
-
currentDialog:
|
|
67
|
-
dialogPayload:
|
|
66
|
+
currentDialog: L,
|
|
67
|
+
dialogPayload: W,
|
|
68
68
|
openDialog: (i, v) => {
|
|
69
|
-
|
|
69
|
+
L.value = i, W.value = v ?? null;
|
|
70
70
|
},
|
|
71
71
|
closeDialog: () => {
|
|
72
|
-
|
|
72
|
+
L.value = null, W.value = null;
|
|
73
73
|
},
|
|
74
|
-
isDialogOpen: (i) =>
|
|
74
|
+
isDialogOpen: (i) => L.value === i
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
const oa = {
|
|
@@ -207,45 +207,45 @@ const oa = {
|
|
|
207
207
|
"Введите новый номер телефона": "Enter a new phone number",
|
|
208
208
|
"Телефон успешно изменен": "Phone number successfully changed"
|
|
209
209
|
}
|
|
210
|
-
}, ra = /* @__PURE__ */
|
|
210
|
+
}, ra = /* @__PURE__ */ H({
|
|
211
211
|
__name: "DialogManager",
|
|
212
212
|
props: {
|
|
213
213
|
language: {},
|
|
214
214
|
provider: {}
|
|
215
215
|
},
|
|
216
216
|
emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
|
|
217
|
-
setup(
|
|
218
|
-
const r = n, i = h(!0), { currentDialog: v, dialogPayload:
|
|
219
|
-
email: q(() => import("./ProfileEmailDialog-
|
|
220
|
-
phone: q(() => import("./ProfilePhoneDialog-
|
|
221
|
-
password: q(() => import("./ProfilePasswordDialog-
|
|
222
|
-
}, d = ({ email:
|
|
223
|
-
r("update-email-field",
|
|
224
|
-
}, p = ({ phone:
|
|
225
|
-
r("update-phone-field",
|
|
217
|
+
setup(l, { emit: n }) {
|
|
218
|
+
const r = n, i = h(!0), { currentDialog: v, dialogPayload: c, closeDialog: U } = X(), s = {
|
|
219
|
+
email: q(() => import("./ProfileEmailDialog-CGzr5Ocq.js")),
|
|
220
|
+
phone: q(() => import("./ProfilePhoneDialog-FU-f-BrQ.js")),
|
|
221
|
+
password: q(() => import("./ProfilePasswordDialog-B1tiN8io.js"))
|
|
222
|
+
}, d = ({ email: E }) => {
|
|
223
|
+
r("update-email-field", E);
|
|
224
|
+
}, p = ({ phone: E }) => {
|
|
225
|
+
r("update-phone-field", E);
|
|
226
226
|
};
|
|
227
|
-
return ue(v, (
|
|
228
|
-
i.value = !!
|
|
229
|
-
}), (
|
|
227
|
+
return ue(v, (E) => {
|
|
228
|
+
i.value = !!E;
|
|
229
|
+
}), (E, u) => m(v) ? (y(), I(Le(s[m(v)]), Me({
|
|
230
230
|
key: 0,
|
|
231
231
|
modelValue: i.value,
|
|
232
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
233
|
-
language:
|
|
234
|
-
provider:
|
|
235
|
-
}, m(
|
|
232
|
+
"onUpdate:modelValue": u[0] || (u[0] = (f) => i.value = f),
|
|
233
|
+
language: E.language,
|
|
234
|
+
provider: E.provider
|
|
235
|
+
}, m(c), {
|
|
236
236
|
onClose: m(U),
|
|
237
|
-
onCleanInputErrors: u[1] || (u[1] = (
|
|
238
|
-
onOnUpdateJwt: u[2] || (u[2] = (
|
|
237
|
+
onCleanInputErrors: u[1] || (u[1] = (f) => r("clean-input-errors")),
|
|
238
|
+
onOnUpdateJwt: u[2] || (u[2] = (f, P, o) => r("on-update-jwt", f, P, o)),
|
|
239
239
|
onSubmitEmail: d,
|
|
240
240
|
onSubmitPhone: p,
|
|
241
|
-
onOnPasswordError: u[3] || (u[3] = (
|
|
242
|
-
onOnToast: u[4] || (u[4] = (
|
|
243
|
-
}), null, 16, ["modelValue", "language", "provider", "onClose"])) :
|
|
241
|
+
onOnPasswordError: u[3] || (u[3] = (f, P) => r("on-password-error", f, P)),
|
|
242
|
+
onOnToast: u[4] || (u[4] = (f) => r("on-toast", f))
|
|
243
|
+
}), null, 16, ["modelValue", "language", "provider", "onClose"])) : b("", !0);
|
|
244
244
|
}
|
|
245
|
-
}), na = { class: "base-container" },
|
|
245
|
+
}), na = { class: "base-container" }, la = {
|
|
246
246
|
key: 0,
|
|
247
247
|
style: { color: "#E46060" }
|
|
248
|
-
},
|
|
248
|
+
}, sa = { key: 1 }, ia = {
|
|
249
249
|
key: 1,
|
|
250
250
|
class: "input-wrapper"
|
|
251
251
|
}, ua = {
|
|
@@ -260,7 +260,7 @@ const oa = {
|
|
|
260
260
|
}, pa = { class: "buttons-container" }, ca = {
|
|
261
261
|
key: 0,
|
|
262
262
|
class: "centered-overlay"
|
|
263
|
-
}, fa = { class: "toastWrapper" }, ga = /* @__PURE__ */
|
|
263
|
+
}, fa = { class: "toastWrapper" }, ga = /* @__PURE__ */ H({
|
|
264
264
|
__name: "PEditUserContact",
|
|
265
265
|
props: {
|
|
266
266
|
language: {},
|
|
@@ -273,8 +273,8 @@ const oa = {
|
|
|
273
273
|
awsStorageUrl: {}
|
|
274
274
|
},
|
|
275
275
|
emits: ["open-email-dialog", "open-phone-dialog", "open-password-dialog", "on-update-jwt", "on-password-error", "update-tokens"],
|
|
276
|
-
setup(
|
|
277
|
-
const r =
|
|
276
|
+
setup(l, { emit: n }) {
|
|
277
|
+
const r = l, i = n, v = T(() => r.language ?? "ru"), c = (e) => oa[v.value][e] || e, { openDialog: U } = X(), s = J({ firstName: "", lastName: "" }), d = h({ firstName: "", lastName: "" }), p = J({ firstName: !1, lastName: !1, email: !1, phone: !1 }), E = h(""), u = h(""), f = h(""), P = h(!1), o = J({
|
|
278
278
|
value: null,
|
|
279
279
|
loading: !1,
|
|
280
280
|
accept: ["image/png", "image/jpeg"],
|
|
@@ -282,45 +282,50 @@ const oa = {
|
|
|
282
282
|
// 10mb вроде
|
|
283
283
|
imageBinary: null,
|
|
284
284
|
imageContent: ""
|
|
285
|
-
}),
|
|
285
|
+
}), S = h(!1), A = h(!1), V = h(!1), M = h(!0), R = h(!0), ee = h(void 0), ae = h(""), pe = T(() => oe(s.firstName, p.firstName)), ce = T(() => oe(s.lastName, p.lastName)), fe = T(() => p.email && !u.value.trim() ? "Введите e-mail" : ""), ge = T(() => p.phone && !f.value.trim() ? "Введите номер телефона" : ""), B = (e) => r.fields.some((a) => a.key === e), te = (e) => e && e.trim() ? "edit" : "bind", G = () => setTimeout(() => {
|
|
286
286
|
var e;
|
|
287
287
|
return (e = document.activeElement) == null ? void 0 : e.blur();
|
|
288
|
-
}, 0), ve = T(() => !!(u.value && u.value.trim() !== "")), he = T(() => o.imageContent ?
|
|
288
|
+
}, 0), ve = T(() => !!(u.value && u.value.trim() !== "")), he = T(() => o.imageContent ? c("Загрузить другое фото") : c("Загрузить фото")), oe = (e, a) => {
|
|
289
289
|
if (!a) return "";
|
|
290
290
|
const t = e.trim();
|
|
291
291
|
return t ? t.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
|
|
292
292
|
}, we = (e) => U("email", { mode: e ? "edit" : "bind", initialEmail: e }), ye = () => {
|
|
293
|
-
|
|
293
|
+
G(), p.email = !1, R.value = !1, i("open-email-dialog", u.value, te(u.value)), we(u.value);
|
|
294
294
|
}, Ee = () => {
|
|
295
|
-
|
|
295
|
+
G(), p.phone = !1, M.value = !1, i("open-phone-dialog", f.value, te(f.value));
|
|
296
296
|
}, Ne = async (e, a, t) => {
|
|
297
|
-
e === "email" && t && (u.value = t), e === "phone" && t && (
|
|
297
|
+
e === "email" && t && (u.value = t), e === "phone" && t && (f.value = t), i("on-update-jwt");
|
|
298
298
|
}, Ce = (e) => {
|
|
299
|
-
|
|
299
|
+
f.value = e;
|
|
300
300
|
}, Pe = (e) => {
|
|
301
301
|
console.debug("emitUpdateEmailField, цепочка такая: profileEmailDialog -> DialogManager -> PEditUserContact", e), u.value = e;
|
|
302
302
|
}, be = (e, a) => {
|
|
303
303
|
V.value = !0, i("on-password-error", e, a);
|
|
304
304
|
}, ke = () => {
|
|
305
|
-
|
|
306
|
-
}, G = (e) => {
|
|
307
|
-
V.value = !0, X.value = e.color ?? "", ee.value = e.text ?? "";
|
|
305
|
+
M.value = !1, R.value = !1;
|
|
308
306
|
}, x = (e) => {
|
|
307
|
+
V.value = !0, ee.value = e.color ?? "", ae.value = e.text ?? "";
|
|
308
|
+
}, $ = (e) => {
|
|
309
309
|
if (p[e] = !0, e === "firstName" || e === "lastName") {
|
|
310
|
-
const a =
|
|
311
|
-
a.length > 40 && (
|
|
310
|
+
const a = s[e];
|
|
311
|
+
a.length > 40 && (s[e] = a.slice(0, 40), console.debug(`[Input Limit] Поле '${e}' достигло 40 символов. Ввод обрезан.`));
|
|
312
312
|
}
|
|
313
313
|
}, Te = (e) => {
|
|
314
|
-
var
|
|
314
|
+
var C, N;
|
|
315
315
|
if (!e) {
|
|
316
316
|
o.imageContent = "", o.imageBinary = null, o.value = null;
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
|
|
320
|
-
|
|
319
|
+
const a = ["image/png", "image/jpeg"], t = ((C = e.fileBinary) == null ? void 0 : C.type) ?? "";
|
|
320
|
+
if (!a.includes(t)) {
|
|
321
|
+
j(), o.value = null;
|
|
321
322
|
return;
|
|
322
323
|
}
|
|
323
|
-
|
|
324
|
+
if ((((N = e.fileBinary) == null ? void 0 : N.size) ?? 0) > o.uploadLimit) {
|
|
325
|
+
j(), o.value = null;
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
S.value = !1, o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "", P.value = !0;
|
|
324
329
|
}, Ue = async () => {
|
|
325
330
|
try {
|
|
326
331
|
const a = (await aa("/users/profile/delete/avatar")).data;
|
|
@@ -328,50 +333,62 @@ const oa = {
|
|
|
328
333
|
} catch (e) {
|
|
329
334
|
return console.error("Ошибка при удалении аватара:", e), !1;
|
|
330
335
|
}
|
|
331
|
-
},
|
|
332
|
-
|
|
336
|
+
}, j = () => {
|
|
337
|
+
S.value = !0, o.value = null, o.imageBinary = null, o.imageContent = "", P.value = !1;
|
|
333
338
|
}, re = async (e, a, t = "image/png") => {
|
|
334
339
|
if (!e) return null;
|
|
335
340
|
const C = await (await fetch(e)).blob();
|
|
336
341
|
return new File([C], a, { type: t });
|
|
337
342
|
}, Be = () => {
|
|
338
|
-
o.value = null, o.imageBinary = null, o.imageContent = "",
|
|
343
|
+
o.value = null, o.imageBinary = null, o.imageContent = "", P.value = !1;
|
|
339
344
|
}, De = async (e) => {
|
|
340
|
-
|
|
341
|
-
const a =
|
|
342
|
-
if (
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
345
|
+
P.value = !1;
|
|
346
|
+
const a = o.imageContent;
|
|
347
|
+
if (o.imageContent = e, !o.imageBinary) return;
|
|
348
|
+
const t = await re(
|
|
349
|
+
e,
|
|
350
|
+
o.imageBinary.name,
|
|
351
|
+
o.imageBinary.type || "image/png"
|
|
352
|
+
);
|
|
353
|
+
if (!t) {
|
|
354
|
+
o.imageContent = a;
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
try {
|
|
358
|
+
o.loading = !0;
|
|
359
|
+
const w = new FormData();
|
|
360
|
+
w.append("file", t), await Z(`/users/profile/avatar/${E.value}`, w, { headers: { "Content-Type": void 0 } });
|
|
361
|
+
} catch (w) {
|
|
362
|
+
console.error(w), x({
|
|
363
|
+
color: "error",
|
|
364
|
+
text: c("Не удалось сохранить изменения. Попробуйте позже")
|
|
365
|
+
}), o.imageContent = a;
|
|
366
|
+
} finally {
|
|
367
|
+
S.value = !1, o.loading = !1;
|
|
368
|
+
}
|
|
352
369
|
}, Fe = async (e) => {
|
|
353
370
|
o.imageContent = e ?? "", o.imageBinary && (o.imageBinary = await re(
|
|
354
371
|
e ?? "",
|
|
355
372
|
o.imageBinary.name,
|
|
356
373
|
o.imageBinary.type || "image/png"
|
|
357
374
|
));
|
|
358
|
-
}, ne = h(!1),
|
|
359
|
-
var t,
|
|
360
|
-
const a = (t =
|
|
375
|
+
}, ne = h(!1), le = async (e) => {
|
|
376
|
+
var t, w;
|
|
377
|
+
const a = (t = s[e]) == null ? void 0 : t.trim();
|
|
361
378
|
if (a)
|
|
362
379
|
try {
|
|
363
380
|
ne.value = !0;
|
|
364
|
-
const N = (
|
|
365
|
-
N != null && N.user && (
|
|
366
|
-
firstName:
|
|
367
|
-
lastName:
|
|
381
|
+
const N = (w = (await Z("/users/profile/update-name", { [e]: a })).data) == null ? void 0 : w.data;
|
|
382
|
+
N != null && N.user && (s.firstName = N.user.firstName ?? s.firstName, s.lastName = N.user.lastName ?? s.lastName, d.value = {
|
|
383
|
+
firstName: s.firstName,
|
|
384
|
+
lastName: s.lastName
|
|
368
385
|
});
|
|
369
386
|
} catch (C) {
|
|
370
387
|
throw C;
|
|
371
388
|
} finally {
|
|
372
389
|
ne.value = !1;
|
|
373
390
|
}
|
|
374
|
-
},
|
|
391
|
+
}, Ie = async () => {
|
|
375
392
|
var e;
|
|
376
393
|
if (!r.accessToken)
|
|
377
394
|
throw console.error("Access token не передан в props"), new Error("Access token is required");
|
|
@@ -384,20 +401,20 @@ const oa = {
|
|
|
384
401
|
if (!t)
|
|
385
402
|
throw console.error("Данные пользователя отсутствуют в ответе сервера"), new Error("User data is missing from the response");
|
|
386
403
|
const {
|
|
387
|
-
userId:
|
|
404
|
+
userId: w,
|
|
388
405
|
privateFirstName: C,
|
|
389
406
|
privateLastName: N,
|
|
390
407
|
email: $e,
|
|
391
408
|
phoneNumber: Oe
|
|
392
409
|
} = t;
|
|
393
|
-
|
|
410
|
+
E.value = w ?? "", s.firstName = C ?? "", s.lastName = N ?? "", u.value = $e ?? "", f.value = Oe ?? "", o.imageContent = await Se(), d.value = {
|
|
394
411
|
firstName: C ?? "",
|
|
395
412
|
lastName: N ?? ""
|
|
396
413
|
};
|
|
397
414
|
} catch (a) {
|
|
398
415
|
console.error("Критическая ошибка при загрузке профиля:", a);
|
|
399
416
|
}
|
|
400
|
-
},
|
|
417
|
+
}, Se = async () => {
|
|
401
418
|
var e;
|
|
402
419
|
try {
|
|
403
420
|
const t = (e = (await ea("/users/profile/avatar")).data) == null ? void 0 : e.data;
|
|
@@ -416,9 +433,9 @@ const oa = {
|
|
|
416
433
|
}
|
|
417
434
|
}
|
|
418
435
|
ue(
|
|
419
|
-
() => [
|
|
436
|
+
() => [s.firstName, s.lastName],
|
|
420
437
|
([e, a]) => {
|
|
421
|
-
const t = e.trim(),
|
|
438
|
+
const t = e.trim(), w = a.trim(), C = t !== d.value.firstName.trim() || w !== d.value.lastName.trim(), N = t.length >= 2 && w.length >= 2;
|
|
422
439
|
A.value = C && N;
|
|
423
440
|
},
|
|
424
441
|
{ immediate: !0 }
|
|
@@ -426,22 +443,22 @@ const oa = {
|
|
|
426
443
|
const Ve = async () => {
|
|
427
444
|
if (A.value)
|
|
428
445
|
try {
|
|
429
|
-
await Promise.all([
|
|
446
|
+
await Promise.all([le("firstName"), le("lastName")]), A.value = !1, i("on-update-jwt"), x({ color: "success", text: "Изменения сохранены" });
|
|
430
447
|
} catch (e) {
|
|
431
|
-
console.error(e),
|
|
448
|
+
console.error(e), x({
|
|
432
449
|
color: "error",
|
|
433
|
-
text:
|
|
450
|
+
text: c("Не удалось сохранить изменения. Попробуйте позже")
|
|
434
451
|
});
|
|
435
452
|
}
|
|
436
453
|
}, xe = () => {
|
|
437
|
-
|
|
454
|
+
G(), i("open-password-dialog");
|
|
438
455
|
};
|
|
439
456
|
return Re(async () => {
|
|
440
457
|
if (!r.accessToken) throw new Error("Access token не передан в props");
|
|
441
458
|
if (!r.requestUrl) throw new Error("auth-backend url не передан в props");
|
|
442
|
-
Xe(r.accessToken, r.requestUrl), await
|
|
443
|
-
}), (e, a) => (
|
|
444
|
-
|
|
459
|
+
Xe(r.accessToken, r.requestUrl), await Ie();
|
|
460
|
+
}), (e, a) => (y(), k(me, null, [
|
|
461
|
+
g(ra, {
|
|
445
462
|
language: v.value,
|
|
446
463
|
provider: e.provider,
|
|
447
464
|
onCleanInputErrors: ke,
|
|
@@ -449,10 +466,10 @@ const oa = {
|
|
|
449
466
|
onUpdatePhoneField: Ce,
|
|
450
467
|
onUpdateEmailField: Pe,
|
|
451
468
|
onOnPasswordError: be,
|
|
452
|
-
onOnToast:
|
|
469
|
+
onOnToast: x
|
|
453
470
|
}, null, 8, ["language", "provider"]),
|
|
454
|
-
|
|
455
|
-
B("avatar") ? (
|
|
471
|
+
_("div", na, [
|
|
472
|
+
B("avatar") ? (y(), I(m(_e), {
|
|
456
473
|
key: 0,
|
|
457
474
|
modelValue: o.value,
|
|
458
475
|
"onUpdate:modelValue": [
|
|
@@ -464,45 +481,45 @@ const oa = {
|
|
|
464
481
|
src: o.imageContent,
|
|
465
482
|
accept: o.accept,
|
|
466
483
|
loading: o.loading,
|
|
467
|
-
label:
|
|
484
|
+
label: c("Загрузить фото"),
|
|
468
485
|
"upload-limit": o.uploadLimit,
|
|
469
486
|
onDelete: Ue,
|
|
470
|
-
"onChange:error":
|
|
487
|
+
"onChange:error": j
|
|
471
488
|
}, {
|
|
472
489
|
afterLoadLabel: D(() => [
|
|
473
|
-
|
|
490
|
+
Y(F(he.value), 1)
|
|
474
491
|
]),
|
|
475
492
|
subtext: D(() => [
|
|
476
|
-
|
|
493
|
+
S.value ? (y(), k("span", la, F("Размер фото слишком большой. Загрузите JPEG, PNG до 10 MB"))) : (y(), k("span", sa, F(`${c("Формат")} ${m(Qe)(o.accept).join(", ")} ${c("до")} ${m(Ze)(o.uploadLimit)}`), 1))
|
|
477
494
|
]),
|
|
478
495
|
_: 1
|
|
479
|
-
}, 8, ["modelValue", "src", "accept", "loading", "label", "upload-limit"])) :
|
|
480
|
-
B("firstName") ? (
|
|
481
|
-
|
|
482
|
-
modelValue:
|
|
483
|
-
"onUpdate:modelValue": a[2] || (a[2] = (t) =>
|
|
496
|
+
}, 8, ["modelValue", "src", "accept", "loading", "label", "upload-limit"])) : b("", !0),
|
|
497
|
+
B("firstName") ? (y(), k("div", ia, [
|
|
498
|
+
g(m(O), {
|
|
499
|
+
modelValue: s.firstName,
|
|
500
|
+
"onUpdate:modelValue": a[2] || (a[2] = (t) => s.firstName = t),
|
|
484
501
|
size: "large",
|
|
485
|
-
label:
|
|
502
|
+
label: c("Имя"),
|
|
486
503
|
error: pe.value,
|
|
487
504
|
onBlur: a[3] || (a[3] = (t) => p.firstName = !0),
|
|
488
|
-
onInput: a[4] || (a[4] = (t) =>
|
|
505
|
+
onInput: a[4] || (a[4] = (t) => $("firstName"))
|
|
489
506
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
490
|
-
|
|
491
|
-
])) :
|
|
492
|
-
B("lastName") ? (
|
|
493
|
-
|
|
494
|
-
modelValue:
|
|
495
|
-
"onUpdate:modelValue": a[5] || (a[5] = (t) =>
|
|
507
|
+
g(m(z), { class: "icon-locked" })
|
|
508
|
+
])) : b("", !0),
|
|
509
|
+
B("lastName") ? (y(), k("div", ua, [
|
|
510
|
+
g(m(O), {
|
|
511
|
+
modelValue: s.lastName,
|
|
512
|
+
"onUpdate:modelValue": a[5] || (a[5] = (t) => s.lastName = t),
|
|
496
513
|
size: "large",
|
|
497
|
-
label:
|
|
514
|
+
label: c("Фамилия"),
|
|
498
515
|
error: ce.value,
|
|
499
516
|
onBlur: a[6] || (a[6] = (t) => p.lastName = !0),
|
|
500
|
-
onInput: a[7] || (a[7] = (t) =>
|
|
517
|
+
onInput: a[7] || (a[7] = (t) => $("lastName"))
|
|
501
518
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
502
|
-
|
|
503
|
-
])) :
|
|
504
|
-
B("email") ? (
|
|
505
|
-
|
|
519
|
+
g(m(z), { class: "icon-locked" })
|
|
520
|
+
])) : b("", !0),
|
|
521
|
+
B("email") ? (y(), k("div", ma, [
|
|
522
|
+
g(m(O), {
|
|
506
523
|
modelValue: u.value,
|
|
507
524
|
"onUpdate:modelValue": a[8] || (a[8] = (t) => u.value = t),
|
|
508
525
|
size: "large",
|
|
@@ -511,92 +528,92 @@ const oa = {
|
|
|
511
528
|
type: "email",
|
|
512
529
|
readonly: "",
|
|
513
530
|
style: { cursor: "pointer" },
|
|
514
|
-
error: fe.value &&
|
|
531
|
+
error: fe.value && R.value,
|
|
515
532
|
onBlur: a[9] || (a[9] = (t) => p.email = !0),
|
|
516
|
-
onInput: a[10] || (a[10] = (t) =>
|
|
533
|
+
onInput: a[10] || (a[10] = (t) => $("email")),
|
|
517
534
|
onClick: ye
|
|
518
535
|
}, null, 8, ["modelValue", "error"]),
|
|
519
|
-
|
|
520
|
-
])) :
|
|
521
|
-
B("phone") ? (
|
|
522
|
-
|
|
523
|
-
modelValue:
|
|
524
|
-
"onUpdate:modelValue": a[11] || (a[11] = (t) =>
|
|
536
|
+
g(m(z), { class: "icon-locked" })
|
|
537
|
+
])) : b("", !0),
|
|
538
|
+
B("phone") ? (y(), k("div", da, [
|
|
539
|
+
g(m(O), {
|
|
540
|
+
modelValue: f.value,
|
|
541
|
+
"onUpdate:modelValue": a[11] || (a[11] = (t) => f.value = t),
|
|
525
542
|
size: "large",
|
|
526
543
|
"text-size": "medium",
|
|
527
|
-
label:
|
|
544
|
+
label: c("Номер телефона"),
|
|
528
545
|
type: "tel",
|
|
529
546
|
readonly: "",
|
|
530
547
|
style: { cursor: "pointer" },
|
|
531
|
-
error: ge.value &&
|
|
548
|
+
error: ge.value && M.value,
|
|
532
549
|
onBlur: a[12] || (a[12] = (t) => p.phone = !0),
|
|
533
|
-
onInput: a[13] || (a[13] = (t) =>
|
|
550
|
+
onInput: a[13] || (a[13] = (t) => $("phone")),
|
|
534
551
|
onClick: Ee
|
|
535
552
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
536
|
-
|
|
537
|
-
])) :
|
|
538
|
-
|
|
539
|
-
ve.value ? (
|
|
553
|
+
g(m(z), { class: "icon-locked" })
|
|
554
|
+
])) : b("", !0),
|
|
555
|
+
_("div", pa, [
|
|
556
|
+
ve.value ? (y(), I(m(ie), {
|
|
540
557
|
key: 0,
|
|
541
558
|
color: "secondary",
|
|
542
559
|
onClick: xe
|
|
543
560
|
}, {
|
|
544
561
|
default: D(() => [
|
|
545
|
-
|
|
562
|
+
Y(F(c("Сменить пароль")), 1)
|
|
546
563
|
]),
|
|
547
564
|
_: 1
|
|
548
|
-
})) :
|
|
549
|
-
|
|
565
|
+
})) : b("", !0),
|
|
566
|
+
g(m(ie), {
|
|
550
567
|
disabled: !A.value,
|
|
551
568
|
onClick: Ve
|
|
552
569
|
}, {
|
|
553
570
|
default: D(() => [
|
|
554
|
-
|
|
571
|
+
Y(F(c("Сохранить")), 1)
|
|
555
572
|
]),
|
|
556
573
|
_: 1
|
|
557
574
|
}, 8, ["disabled"])
|
|
558
575
|
])
|
|
559
576
|
]),
|
|
560
|
-
|
|
577
|
+
P.value ? (y(), I(se, {
|
|
561
578
|
key: 0,
|
|
562
579
|
to: "body"
|
|
563
580
|
}, [
|
|
564
|
-
|
|
565
|
-
|
|
581
|
+
P.value ? (y(), k("div", ca, [
|
|
582
|
+
g(m(Ye), {
|
|
566
583
|
"circle-mode": !0,
|
|
567
584
|
"model-value": o.imageContent,
|
|
568
585
|
onClose: Be,
|
|
569
586
|
onSave: a[14] || (a[14] = (t) => De(t)),
|
|
570
587
|
"onUpdate:modelValue": a[15] || (a[15] = (t) => Fe(t))
|
|
571
588
|
}, null, 8, ["model-value"])
|
|
572
|
-
])) :
|
|
573
|
-
])) :
|
|
574
|
-
(
|
|
575
|
-
|
|
576
|
-
|
|
589
|
+
])) : b("", !0)
|
|
590
|
+
])) : b("", !0),
|
|
591
|
+
(y(), I(se, { to: "#toast-root" }, [
|
|
592
|
+
_("div", fa, [
|
|
593
|
+
g(Ge, { name: "list" }, {
|
|
577
594
|
default: D(() => [
|
|
578
|
-
|
|
595
|
+
je(g(m(We), {
|
|
579
596
|
class: "toast",
|
|
580
|
-
color:
|
|
581
|
-
text:
|
|
597
|
+
color: ee.value,
|
|
598
|
+
text: ae.value,
|
|
582
599
|
onClose: a[16] || (a[16] = (t) => V.value = !1)
|
|
583
600
|
}, null, 8, ["color", "text"]), [
|
|
584
|
-
[
|
|
601
|
+
[qe, V.value]
|
|
585
602
|
])
|
|
586
603
|
]),
|
|
587
604
|
_: 1
|
|
588
605
|
})
|
|
589
606
|
])
|
|
590
607
|
])),
|
|
591
|
-
|
|
608
|
+
g(m(de))
|
|
592
609
|
], 64));
|
|
593
610
|
}
|
|
594
|
-
}), va = (
|
|
595
|
-
const r =
|
|
611
|
+
}), va = (l, n) => {
|
|
612
|
+
const r = l.__vccOpts || l;
|
|
596
613
|
for (const [i, v] of n)
|
|
597
614
|
r[i] = v;
|
|
598
615
|
return r;
|
|
599
|
-
}, ha = /* @__PURE__ */ va(ga, [["__scopeId", "data-v-
|
|
616
|
+
}, ha = /* @__PURE__ */ va(ga, [["__scopeId", "data-v-e236cb5b"]]), Pa = /* @__PURE__ */ H({
|
|
600
617
|
__name: "index",
|
|
601
618
|
props: {
|
|
602
619
|
throttlerPrefix: {},
|
|
@@ -609,19 +626,19 @@ const oa = {
|
|
|
609
626
|
awsStorageUrl: {}
|
|
610
627
|
},
|
|
611
628
|
emits: ["on-update-jwt", "update-tokens"],
|
|
612
|
-
setup(
|
|
613
|
-
const r = n, { openDialog: i } =
|
|
629
|
+
setup(l, { emit: n }) {
|
|
630
|
+
const r = n, { openDialog: i } = X(), v = (d, p) => {
|
|
614
631
|
i("email", { initialEmail: d, mode: p });
|
|
615
|
-
},
|
|
632
|
+
}, c = (d, p) => {
|
|
616
633
|
i("phone", { initialPhone: d, mode: p });
|
|
617
634
|
}, U = () => {
|
|
618
635
|
i("password");
|
|
619
|
-
},
|
|
620
|
-
r("on-update-jwt", d, p,
|
|
636
|
+
}, s = (d, p, E) => {
|
|
637
|
+
r("on-update-jwt", d, p, E);
|
|
621
638
|
};
|
|
622
|
-
return (d, p) => (
|
|
623
|
-
|
|
624
|
-
|
|
639
|
+
return (d, p) => (y(), k(me, null, [
|
|
640
|
+
g(m(Ke)),
|
|
641
|
+
g(ha, {
|
|
625
642
|
"throttler-prefix": d.throttlerPrefix,
|
|
626
643
|
provider: d.provider,
|
|
627
644
|
"request-url": d.requestUrl,
|
|
@@ -631,11 +648,11 @@ const oa = {
|
|
|
631
648
|
"refresh-token": d.refreshToken,
|
|
632
649
|
"aws-storage-url": d.awsStorageUrl,
|
|
633
650
|
onOpenEmailDialog: v,
|
|
634
|
-
onOpenPhoneDialog:
|
|
651
|
+
onOpenPhoneDialog: c,
|
|
635
652
|
onOpenPasswordDialog: U,
|
|
636
|
-
onOnUpdateJwt:
|
|
653
|
+
onOnUpdateJwt: s
|
|
637
654
|
}, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token", "aws-storage-url"]),
|
|
638
|
-
|
|
655
|
+
g(m(de))
|
|
639
656
|
], 64));
|
|
640
657
|
}
|
|
641
658
|
});
|
|
@@ -645,6 +662,6 @@ export {
|
|
|
645
662
|
va as _,
|
|
646
663
|
Pa as a,
|
|
647
664
|
ea as g,
|
|
648
|
-
|
|
665
|
+
Z as p,
|
|
649
666
|
oa as t
|
|
650
667
|
};
|
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-e236cb5b] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-e236cb5b] .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-Djp-dW6j.js";
|
|
3
3
|
export {
|
|
4
4
|
o as PEditUserContact
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as l, defineComponent as L, createElementBlock as f, openBlock as v, normalizeClass as r, createVNode as E, unref as F, computed as T, renderSlot as d, createCommentVNode as $, createElementVNode as o, toDisplayString as y, createTextVNode as p } from "vue";
|
|
2
2
|
import { PLoader as w } from "@profeat/ui-kit";
|
|
3
|
-
import { _ as g, g as R, p as h } from "./index-
|
|
3
|
+
import { _ as g, g as R, p as h } from "./index-Djp-dW6j.js";
|
|
4
4
|
function C(e) {
|
|
5
5
|
const t = Math.floor(e / 60), a = e % 60;
|
|
6
6
|
return `${String(t).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
|