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