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