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