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