@yourgoods/ui-smart 0.35.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-D2y7qY90.js → ProfileEmailDialog-B8rGqu5K.js} +2 -2
- package/dist/{ProfilePasswordDialog-B8CwDh0b.js → ProfilePasswordDialog-DWlq4Drx.js} +1 -1
- package/dist/{ProfilePhoneDialog-Ch-qWb9F.js → ProfilePhoneDialog-CnfsoNAY.js} +2 -2
- package/dist/{index-DSUzLuO8.js → index-B7s2bGRy.js} +205 -195
- package/dist/index.js +2 -2
- package/dist/modules/index.d.ts +1 -2
- package/dist/{useRateLimitToast-CH8-QLGT.js → useRateLimitToast-C3MoKw6n.js} +1 -1
- package/package.json +2 -2
|
@@ -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 _e, PInput 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
|
|
61
|
-
function
|
|
63
|
+
const z = h(null), Y = ze(null);
|
|
64
|
+
function Q() {
|
|
62
65
|
return {
|
|
63
|
-
currentDialog:
|
|
66
|
+
currentDialog: z,
|
|
64
67
|
dialogPayload: Y,
|
|
65
|
-
openDialog: (
|
|
66
|
-
|
|
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,45 +207,42 @@ 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:
|
|
217
|
-
phone:
|
|
218
|
-
password:
|
|
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
|
-
}),
|
|
243
|
-
key: 0,
|
|
244
|
-
class: "input-wrapper"
|
|
245
|
-
}, ia = {
|
|
245
|
+
}), na = { class: "base-container" }, sa = { key: 0 }, la = { key: 1 }, ia = {
|
|
246
246
|
key: 1,
|
|
247
247
|
class: "input-wrapper"
|
|
248
248
|
}, ua = {
|
|
@@ -251,10 +251,13 @@ const aa = {
|
|
|
251
251
|
}, ma = {
|
|
252
252
|
key: 3,
|
|
253
253
|
class: "input-wrapper"
|
|
254
|
-
}, da = {
|
|
254
|
+
}, da = {
|
|
255
|
+
key: 4,
|
|
256
|
+
class: "input-wrapper"
|
|
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,33 +279,33 @@ 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
|
-
|
|
290
|
+
R(), p.email = !1, M.value = !1, i("open-email-dialog", u.value, ae(u.value)), we(u.value);
|
|
288
291
|
}, Ee = () => {
|
|
289
|
-
|
|
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
|
-
|
|
300
|
-
},
|
|
301
|
-
|
|
302
|
+
L.value = !1, M.value = !1;
|
|
303
|
+
}, G = (e) => {
|
|
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
|
-
const a =
|
|
305
|
-
a.length > 40 && (
|
|
307
|
+
const a = l[e];
|
|
308
|
+
a.length > 40 && (l[e] = a.slice(0, 40), console.debug(`[Input Limit] Поле '${e}' достигло 40 символов. Ввод обрезан.`));
|
|
306
309
|
}
|
|
307
310
|
}, Te = (e) => {
|
|
308
311
|
var t;
|
|
@@ -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,34 +346,34 @@ 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
|
-
const a = (t =
|
|
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
|
-
N != null && N.user && (
|
|
353
|
-
firstName:
|
|
354
|
-
lastName:
|
|
362
|
+
N != null && N.user && (l.firstName = N.user.firstName ?? l.firstName, l.lastName = N.user.lastName ?? l.lastName, d.value = {
|
|
363
|
+
firstName: l.firstName,
|
|
364
|
+
lastName: l.lastName
|
|
355
365
|
});
|
|
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 ?? "",
|
|
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
|
-
|
|
406
|
-
() => [
|
|
415
|
+
ue(
|
|
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
|
-
console.error(e),
|
|
428
|
+
console.error(e), G({
|
|
419
429
|
color: "error",
|
|
420
430
|
text: g("Не удалось сохранить изменения. Попробуйте позже")
|
|
421
431
|
});
|
|
422
432
|
}
|
|
423
|
-
},
|
|
424
|
-
|
|
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,
|
|
@@ -436,77 +446,77 @@ const aa = {
|
|
|
436
446
|
onUpdatePhoneField: Ce,
|
|
437
447
|
onUpdateEmailField: Pe,
|
|
438
448
|
onOnPasswordError: be,
|
|
439
|
-
onOnToast:
|
|
449
|
+
onOnToast: G
|
|
440
450
|
}, null, 8, ["language", "provider"]),
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
]),
|
|
467
|
-
B("firstName") ? (w(), b("div",
|
|
468
|
-
f(
|
|
469
|
-
modelValue:
|
|
470
|
-
"onUpdate:modelValue": a[2] || (a[2] = (t) =>
|
|
451
|
+
j("div", na, [
|
|
452
|
+
B("avatar") ? (w(), S(m(_e), {
|
|
453
|
+
key: 0,
|
|
454
|
+
modelValue: o.value,
|
|
455
|
+
"onUpdate:modelValue": [
|
|
456
|
+
a[0] || (a[0] = (t) => o.value = t),
|
|
457
|
+
a[1] || (a[1] = (t) => Te(t))
|
|
458
|
+
],
|
|
459
|
+
type: "img",
|
|
460
|
+
class: "avatar-input",
|
|
461
|
+
src: o.imageContent,
|
|
462
|
+
accept: o.accept,
|
|
463
|
+
loading: o.loading,
|
|
464
|
+
label: g("Загрузить фото"),
|
|
465
|
+
"upload-limit": o.uploadLimit,
|
|
466
|
+
onDelete: Ue,
|
|
467
|
+
"onChange:error": oe
|
|
468
|
+
}, {
|
|
469
|
+
afterLoadLabel: D(() => [
|
|
470
|
+
_(F(he.value), 1)
|
|
471
|
+
]),
|
|
472
|
+
subtext: D(() => [
|
|
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))
|
|
474
|
+
]),
|
|
475
|
+
_: 1
|
|
476
|
+
}, 8, ["modelValue", "src", "accept", "loading", "label", "upload-limit"])) : P("", !0),
|
|
477
|
+
B("firstName") ? (w(), b("div", ia, [
|
|
478
|
+
f(m($), {
|
|
479
|
+
modelValue: l.firstName,
|
|
480
|
+
"onUpdate:modelValue": a[2] || (a[2] = (t) => l.firstName = t),
|
|
471
481
|
size: "large",
|
|
472
482
|
label: g("Имя"),
|
|
473
483
|
error: pe.value,
|
|
474
484
|
onBlur: a[3] || (a[3] = (t) => p.firstName = !0),
|
|
475
485
|
onInput: a[4] || (a[4] = (t) => x("firstName"))
|
|
476
486
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
477
|
-
f(
|
|
487
|
+
f(m(O), { class: "icon-locked" })
|
|
478
488
|
])) : P("", !0),
|
|
479
|
-
B("lastName") ? (w(), b("div",
|
|
480
|
-
f(
|
|
481
|
-
modelValue:
|
|
482
|
-
"onUpdate:modelValue": a[5] || (a[5] = (t) =>
|
|
489
|
+
B("lastName") ? (w(), b("div", ua, [
|
|
490
|
+
f(m($), {
|
|
491
|
+
modelValue: l.lastName,
|
|
492
|
+
"onUpdate:modelValue": a[5] || (a[5] = (t) => l.lastName = t),
|
|
483
493
|
size: "large",
|
|
484
494
|
label: g("Фамилия"),
|
|
485
495
|
error: ce.value,
|
|
486
496
|
onBlur: a[6] || (a[6] = (t) => p.lastName = !0),
|
|
487
497
|
onInput: a[7] || (a[7] = (t) => x("lastName"))
|
|
488
498
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
489
|
-
f(
|
|
499
|
+
f(m(O), { class: "icon-locked" })
|
|
490
500
|
])) : P("", !0),
|
|
491
|
-
B("email") ? (w(), b("div",
|
|
492
|
-
f(
|
|
493
|
-
modelValue:
|
|
494
|
-
"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),
|
|
495
505
|
size: "large",
|
|
496
506
|
"text-size": "medium",
|
|
497
507
|
label: "E-mail",
|
|
498
508
|
type: "email",
|
|
499
509
|
readonly: "",
|
|
500
510
|
style: { cursor: "pointer" },
|
|
501
|
-
error: fe.value &&
|
|
511
|
+
error: fe.value && M.value,
|
|
502
512
|
onBlur: a[9] || (a[9] = (t) => p.email = !0),
|
|
503
513
|
onInput: a[10] || (a[10] = (t) => x("email")),
|
|
504
514
|
onClick: ye
|
|
505
515
|
}, null, 8, ["modelValue", "error"]),
|
|
506
|
-
f(
|
|
516
|
+
f(m(O), { class: "icon-locked" })
|
|
507
517
|
])) : P("", !0),
|
|
508
|
-
B("phone") ? (w(), b("div",
|
|
509
|
-
f(
|
|
518
|
+
B("phone") ? (w(), b("div", da, [
|
|
519
|
+
f(m($), {
|
|
510
520
|
modelValue: c.value,
|
|
511
521
|
"onUpdate:modelValue": a[11] || (a[11] = (t) => c.value = t),
|
|
512
522
|
size: "large",
|
|
@@ -515,75 +525,75 @@ const aa = {
|
|
|
515
525
|
type: "tel",
|
|
516
526
|
readonly: "",
|
|
517
527
|
style: { cursor: "pointer" },
|
|
518
|
-
error: ge.value &&
|
|
528
|
+
error: ge.value && L.value,
|
|
519
529
|
onBlur: a[12] || (a[12] = (t) => p.phone = !0),
|
|
520
530
|
onInput: a[13] || (a[13] = (t) => x("phone")),
|
|
521
531
|
onClick: Ee
|
|
522
532
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
523
|
-
f(
|
|
533
|
+
f(m(O), { class: "icon-locked" })
|
|
524
534
|
])) : P("", !0),
|
|
525
|
-
|
|
526
|
-
ve.value ? (w(), S(
|
|
535
|
+
j("div", pa, [
|
|
536
|
+
ve.value ? (w(), S(m(ie), {
|
|
527
537
|
key: 0,
|
|
528
538
|
color: "secondary",
|
|
529
|
-
onClick:
|
|
539
|
+
onClick: xe
|
|
530
540
|
}, {
|
|
531
541
|
default: D(() => [
|
|
532
|
-
|
|
542
|
+
_(F(g("Сменить пароль")), 1)
|
|
533
543
|
]),
|
|
534
544
|
_: 1
|
|
535
545
|
})) : P("", !0),
|
|
536
|
-
f(
|
|
537
|
-
disabled: !
|
|
546
|
+
f(m(ie), {
|
|
547
|
+
disabled: !A.value,
|
|
538
548
|
onClick: Ve
|
|
539
549
|
}, {
|
|
540
550
|
default: D(() => [
|
|
541
|
-
|
|
551
|
+
_(F(g("Сохранить")), 1)
|
|
542
552
|
]),
|
|
543
553
|
_: 1
|
|
544
554
|
}, 8, ["disabled"])
|
|
545
555
|
])
|
|
546
556
|
]),
|
|
547
|
-
E.value ? (w(), S(
|
|
557
|
+
E.value ? (w(), S(le, {
|
|
548
558
|
key: 0,
|
|
549
559
|
to: "body"
|
|
550
560
|
}, [
|
|
551
|
-
E.value ? (w(), b("div",
|
|
552
|
-
f(
|
|
561
|
+
E.value ? (w(), b("div", ca, [
|
|
562
|
+
f(m(Ye), {
|
|
553
563
|
"circle-mode": !0,
|
|
554
564
|
"model-value": o.imageContent,
|
|
555
|
-
onClose:
|
|
556
|
-
onSave: a[14] || (a[14] = (t) =>
|
|
557
|
-
"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))
|
|
558
568
|
}, null, 8, ["model-value"])
|
|
559
569
|
])) : P("", !0)
|
|
560
570
|
])) : P("", !0),
|
|
561
|
-
(w(), S(
|
|
562
|
-
|
|
563
|
-
f(
|
|
571
|
+
(w(), S(le, { to: "#toast-root" }, [
|
|
572
|
+
j("div", fa, [
|
|
573
|
+
f(Ge, { name: "list" }, {
|
|
564
574
|
default: D(() => [
|
|
565
|
-
|
|
575
|
+
qe(f(m(We), {
|
|
566
576
|
class: "toast",
|
|
567
|
-
color:
|
|
568
|
-
text:
|
|
569
|
-
onClose: a[16] || (a[16] = (t) =>
|
|
577
|
+
color: X.value,
|
|
578
|
+
text: ee.value,
|
|
579
|
+
onClose: a[16] || (a[16] = (t) => V.value = !1)
|
|
570
580
|
}, null, 8, ["color", "text"]), [
|
|
571
|
-
[
|
|
581
|
+
[Je, V.value]
|
|
572
582
|
])
|
|
573
583
|
]),
|
|
574
584
|
_: 1
|
|
575
585
|
})
|
|
576
586
|
])
|
|
577
587
|
])),
|
|
578
|
-
f(
|
|
588
|
+
f(m(de))
|
|
579
589
|
], 64));
|
|
580
590
|
}
|
|
581
|
-
}),
|
|
582
|
-
const r =
|
|
583
|
-
for (const [
|
|
584
|
-
r[
|
|
591
|
+
}), va = (s, n) => {
|
|
592
|
+
const r = s.__vccOpts || s;
|
|
593
|
+
for (const [i, v] of n)
|
|
594
|
+
r[i] = v;
|
|
585
595
|
return r;
|
|
586
|
-
},
|
|
596
|
+
}, ha = /* @__PURE__ */ va(ga, [["__scopeId", "data-v-f55f9c4f"]]), Pa = /* @__PURE__ */ Z({
|
|
587
597
|
__name: "index",
|
|
588
598
|
props: {
|
|
589
599
|
throttlerPrefix: {},
|
|
@@ -596,19 +606,19 @@ const aa = {
|
|
|
596
606
|
awsStorageUrl: {}
|
|
597
607
|
},
|
|
598
608
|
emits: ["on-update-jwt", "update-tokens"],
|
|
599
|
-
setup(
|
|
600
|
-
const r = n, { openDialog:
|
|
601
|
-
|
|
609
|
+
setup(s, { emit: n }) {
|
|
610
|
+
const r = n, { openDialog: i } = Q(), v = (d, p) => {
|
|
611
|
+
i("email", { initialEmail: d, mode: p });
|
|
602
612
|
}, g = (d, p) => {
|
|
603
|
-
|
|
613
|
+
i("phone", { initialPhone: d, mode: p });
|
|
604
614
|
}, U = () => {
|
|
605
|
-
|
|
606
|
-
},
|
|
615
|
+
i("password");
|
|
616
|
+
}, l = (d, p, y) => {
|
|
607
617
|
r("on-update-jwt", d, p, y);
|
|
608
618
|
};
|
|
609
|
-
return (d, p) => (w(), b(
|
|
610
|
-
f(
|
|
611
|
-
f(
|
|
619
|
+
return (d, p) => (w(), b(me, null, [
|
|
620
|
+
f(m(Ke)),
|
|
621
|
+
f(ha, {
|
|
612
622
|
"throttler-prefix": d.throttlerPrefix,
|
|
613
623
|
provider: d.provider,
|
|
614
624
|
"request-url": d.requestUrl,
|
|
@@ -620,18 +630,18 @@ const aa = {
|
|
|
620
630
|
onOpenEmailDialog: v,
|
|
621
631
|
onOpenPhoneDialog: g,
|
|
622
632
|
onOpenPasswordDialog: U,
|
|
623
|
-
onOnUpdateJwt:
|
|
633
|
+
onOnUpdateJwt: l
|
|
624
634
|
}, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token", "aws-storage-url"]),
|
|
625
|
-
f(
|
|
635
|
+
f(m(de))
|
|
626
636
|
], 64));
|
|
627
637
|
}
|
|
628
638
|
});
|
|
629
639
|
export {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
640
|
+
Ca as B,
|
|
641
|
+
Na as C,
|
|
642
|
+
va as _,
|
|
643
|
+
Pa as a,
|
|
644
|
+
ea as g,
|
|
635
645
|
K as p,
|
|
636
|
-
|
|
646
|
+
oa as t
|
|
637
647
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
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")}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yourgoods/ui-smart",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@vue/tsconfig": "^0.5.1",
|
|
33
33
|
"axios": "^1.13.2",
|
|
34
34
|
"rollup-plugin-pure": "0.2.1",
|
|
35
|
-
"sass
|
|
35
|
+
"sass": "^1.70.0",
|
|
36
36
|
"typescript": "^5.5.4",
|
|
37
37
|
"unplugin-icons": "0.20.1",
|
|
38
38
|
"unplugin-vue-components": "0.27.4",
|