@yourgoods/ui-smart 0.3.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 +2 -0
- package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/NewPhoneContent.vue.d.ts +2 -0
- package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/OldPhoneContent.vue.d.ts +2 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/{index-rDbP74yn.js → index-BAX9rbeD.js} +249 -224
- package/dist/index.js +1 -1
- package/dist/locales/index.d.ts +6 -2
- package/dist/{useRateLimitToast-D3SdHQJl.js → useRateLimitToast-BROS1T6Q.js} +12 -11
- package/dist/utils/formatPhone.d.ts +5 -0
- package/package.json +1 -1
- package/dist/ProfileEmailDialog-rL4YTLa1.js +0 -777
- package/dist/ProfilePasswordDialog-DmfK_fyQ.js +0 -269
- package/dist/ProfilePhoneDialog-Df3-2osj.js +0 -778
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import
|
|
3
|
-
import { PInputFileUploader as
|
|
4
|
-
function
|
|
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
5
|
if (d === 0)
|
|
6
6
|
return "0 B";
|
|
7
|
-
const n = 1024, u = ["B", "KB", "MB", "GB", "TB", "PB", "EB"],
|
|
8
|
-
return `${Number.parseFloat((d / n **
|
|
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,22 +15,22 @@ const je = {
|
|
|
15
15
|
"application/zip": "ZIP Archive"
|
|
16
16
|
// ...
|
|
17
17
|
};
|
|
18
|
-
function
|
|
18
|
+
function Ye(d) {
|
|
19
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
|
-
let
|
|
32
|
-
function
|
|
33
|
-
|
|
31
|
+
let q = null;
|
|
32
|
+
function _e(d, r) {
|
|
33
|
+
q = ze.create({
|
|
34
34
|
baseURL: r,
|
|
35
35
|
headers: {
|
|
36
36
|
Authorization: `Bearer ${d}`,
|
|
@@ -40,38 +40,38 @@ function Je(d, r) {
|
|
|
40
40
|
validateStatus: () => !0
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
if (!
|
|
43
|
+
function me() {
|
|
44
|
+
if (!q)
|
|
45
45
|
throw new Error("Axios instance not initialized. Call initAxios(token, baseUrl) first.");
|
|
46
|
-
return
|
|
46
|
+
return q;
|
|
47
47
|
}
|
|
48
48
|
async function Y(d, r, n) {
|
|
49
|
-
return
|
|
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
|
|
54
|
+
async function We(d) {
|
|
55
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
|
|
60
|
+
const O = v(null), J = Ve(null);
|
|
61
61
|
function W() {
|
|
62
62
|
return {
|
|
63
|
-
currentDialog:
|
|
64
|
-
dialogPayload:
|
|
65
|
-
openDialog: (u,
|
|
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: (u) =>
|
|
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 Ge = {
|
|
|
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 Ge = {
|
|
|
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,7 +204,7 @@ const Ge = {
|
|
|
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: {},
|
|
@@ -208,49 +212,49 @@ const Ge = {
|
|
|
208
212
|
},
|
|
209
213
|
emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
|
|
210
214
|
setup(d, { emit: r }) {
|
|
211
|
-
const n = r, u =
|
|
212
|
-
email:
|
|
213
|
-
phone:
|
|
214
|
-
password:
|
|
215
|
-
}, m = ({ email:
|
|
216
|
-
n("update-email-field",
|
|
217
|
-
},
|
|
218
|
-
n("update-phone-field",
|
|
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
|
-
u.value = !!
|
|
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
228
|
modelValue: u.value,
|
|
225
|
-
"onUpdate:modelValue":
|
|
226
|
-
language:
|
|
227
|
-
provider:
|
|
228
|
-
},
|
|
229
|
-
onClose:
|
|
230
|
-
onCleanInputErrors:
|
|
231
|
-
onOnUpdateJwt:
|
|
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)),
|
|
232
236
|
onSubmitEmail: m,
|
|
233
|
-
onSubmitPhone:
|
|
234
|
-
onOnPasswordError:
|
|
235
|
-
onOnToast:
|
|
236
|
-
}), null, 16, ["modelValue", "language", "provider", "onClose"])) :
|
|
237
|
+
onSubmitPhone: c,
|
|
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))
|
|
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: {},
|
|
@@ -263,7 +267,7 @@ const Ge = {
|
|
|
263
267
|
},
|
|
264
268
|
emits: ["open-email-dialog", "open-phone-dialog", "open-password-dialog", "on-update-jwt", "on-password-error", "update-tokens"],
|
|
265
269
|
setup(d, { emit: r }) {
|
|
266
|
-
const n = d, u = 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,118 +275,138 @@ const Ge = {
|
|
|
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
|
-
},
|
|
286
|
-
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
}, Ne = () => {
|
|
290
|
-
|
|
291
|
-
},
|
|
292
|
-
|
|
293
|
-
},
|
|
294
|
-
|
|
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");
|
|
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
|
+
}
|
|
295
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
328
|
const t = new FormData();
|
|
314
|
-
t.append("file", a), await Y(`/users/profile/avatar/${
|
|
329
|
+
t.append("file", a), await Y(`/users/profile/avatar/${y.value}`, {
|
|
315
330
|
body: t
|
|
316
331
|
});
|
|
317
332
|
} catch {
|
|
318
333
|
} finally {
|
|
319
334
|
o.loading = !1;
|
|
320
335
|
}
|
|
321
|
-
},
|
|
322
|
-
o.imageContent = e ?? "", o.imageBinary && (o.imageBinary = await
|
|
336
|
+
}, Ue = async (e) => {
|
|
337
|
+
o.imageContent = e ?? "", o.imageBinary && (o.imageBinary = await te(
|
|
323
338
|
e ?? "",
|
|
324
339
|
o.imageBinary.name,
|
|
325
340
|
o.imageBinary.type || "image/png"
|
|
326
341
|
));
|
|
327
|
-
},
|
|
328
|
-
var t,
|
|
329
|
-
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();
|
|
330
345
|
if (a)
|
|
331
346
|
try {
|
|
332
|
-
|
|
333
|
-
const
|
|
334
|
-
|
|
335
|
-
firstName:
|
|
336
|
-
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
|
|
337
352
|
});
|
|
338
|
-
} catch {
|
|
353
|
+
} catch (T) {
|
|
354
|
+
throw T;
|
|
339
355
|
} finally {
|
|
340
|
-
|
|
356
|
+
oe.value = !1;
|
|
341
357
|
}
|
|
342
|
-
},
|
|
358
|
+
}, Fe = async () => {
|
|
343
359
|
var e;
|
|
344
360
|
if (!n.accessToken) throw new Error("Access token не передан в props");
|
|
345
361
|
try {
|
|
346
|
-
const t = (e = (await
|
|
362
|
+
const t = (e = (await We({
|
|
347
363
|
accessToken: n.accessToken,
|
|
348
364
|
refreshToken: n.refreshToken ?? "",
|
|
349
365
|
excludeFields: []
|
|
350
366
|
})).data) == null ? void 0 : e.user;
|
|
351
367
|
if (!t) throw new Error("user data отсутствует в response");
|
|
352
|
-
|
|
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 ?? "" };
|
|
353
369
|
} catch {
|
|
354
370
|
}
|
|
355
371
|
};
|
|
356
|
-
|
|
357
|
-
() => [
|
|
372
|
+
se(
|
|
373
|
+
() => [l.firstName, l.lastName],
|
|
358
374
|
([e, a]) => {
|
|
359
|
-
const t = e.trim() !== m.value.firstName.trim() ||
|
|
360
|
-
|
|
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;
|
|
361
377
|
},
|
|
362
378
|
{ immediate: !0 }
|
|
363
379
|
);
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
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");
|
|
368
392
|
};
|
|
369
|
-
return
|
|
393
|
+
return $e(async () => {
|
|
370
394
|
if (!n.accessToken) throw new Error("Access token не передан в props");
|
|
371
395
|
if (!n.requestUrl) throw new Error("auth-backend url не передан в props");
|
|
372
|
-
|
|
373
|
-
}), (e, a) => (
|
|
374
|
-
|
|
375
|
-
language:
|
|
396
|
+
_e(n.accessToken, n.requestUrl), await Fe();
|
|
397
|
+
}), (e, a) => (h(), P(ie, null, [
|
|
398
|
+
g(Ze, {
|
|
399
|
+
language: w.value,
|
|
376
400
|
provider: e.provider,
|
|
377
|
-
onCleanInputErrors:
|
|
378
|
-
onOnUpdateJwt:
|
|
379
|
-
onUpdatePhoneField:
|
|
380
|
-
onUpdateEmailField:
|
|
381
|
-
onOnPasswordError:
|
|
382
|
-
onOnToast:
|
|
401
|
+
onCleanInputErrors: Ce,
|
|
402
|
+
onOnUpdateJwt: ye,
|
|
403
|
+
onUpdatePhoneField: Ne,
|
|
404
|
+
onUpdateEmailField: Ee,
|
|
405
|
+
onOnPasswordError: Pe,
|
|
406
|
+
onOnToast: z
|
|
383
407
|
}, null, 8, ["language", "provider"]),
|
|
384
|
-
|
|
385
|
-
|
|
408
|
+
G("div", He, [
|
|
409
|
+
U("avatar") ? (h(), I(i(Le), {
|
|
386
410
|
key: 0,
|
|
387
411
|
modelValue: o.value,
|
|
388
412
|
"onUpdate:modelValue": [
|
|
@@ -393,132 +417,133 @@ const Ge = {
|
|
|
393
417
|
src: o.imageContent,
|
|
394
418
|
accept: o.accept,
|
|
395
419
|
loading: o.loading,
|
|
396
|
-
label:
|
|
397
|
-
"upload-limit": o.uploadLimit
|
|
420
|
+
label: p("Загрузить фото"),
|
|
421
|
+
"upload-limit": o.uploadLimit,
|
|
422
|
+
"onChange:error": ke
|
|
398
423
|
}, {
|
|
399
|
-
afterLoadLabel:
|
|
400
|
-
|
|
424
|
+
afterLoadLabel: F(() => [
|
|
425
|
+
j(D(p("Загрузить фото")), 1)
|
|
401
426
|
]),
|
|
402
|
-
subtext:
|
|
403
|
-
|
|
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))
|
|
404
429
|
]),
|
|
405
430
|
_: 1
|
|
406
|
-
}, 8, ["modelValue", "src", "accept", "loading", "label", "upload-limit"])) :
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
modelValue:
|
|
410
|
-
"onUpdate:modelValue": a[2] || (a[2] = (t) =>
|
|
431
|
+
}, 8, ["modelValue", "src", "accept", "loading", "label", "upload-limit"])) : E("", !0),
|
|
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),
|
|
411
436
|
size: "large",
|
|
412
|
-
label:
|
|
413
|
-
error:
|
|
414
|
-
onBlur: a[3] || (a[3] = (t) =>
|
|
415
|
-
onInput: a[4] || (a[4] = (t) =>
|
|
437
|
+
label: p("Имя"),
|
|
438
|
+
error: de.value,
|
|
439
|
+
onBlur: a[3] || (a[3] = (t) => c.firstName = !0),
|
|
440
|
+
onInput: a[4] || (a[4] = (t) => A("firstName"))
|
|
416
441
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
417
|
-
|
|
418
|
-
])) :
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
modelValue:
|
|
422
|
-
"onUpdate:modelValue": a[5] || (a[5] = (t) =>
|
|
442
|
+
g(i(S), { class: "icon-locked" })
|
|
443
|
+
])) : E("", !0),
|
|
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),
|
|
423
448
|
size: "large",
|
|
424
|
-
label:
|
|
425
|
-
error:
|
|
426
|
-
onBlur: a[6] || (a[6] = (t) =>
|
|
427
|
-
onInput: a[7] || (a[7] = (t) =>
|
|
449
|
+
label: p("Фамилия"),
|
|
450
|
+
error: pe.value,
|
|
451
|
+
onBlur: a[6] || (a[6] = (t) => c.lastName = !0),
|
|
452
|
+
onInput: a[7] || (a[7] = (t) => A("lastName"))
|
|
428
453
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
429
|
-
|
|
430
|
-
])) :
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
modelValue:
|
|
434
|
-
"onUpdate:modelValue": a[8] || (a[8] = (t) =>
|
|
454
|
+
g(i(S), { class: "icon-locked" })
|
|
455
|
+
])) : E("", !0),
|
|
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),
|
|
435
460
|
size: "large",
|
|
436
461
|
"text-size": "medium",
|
|
437
462
|
label: "E-mail",
|
|
438
463
|
type: "email",
|
|
439
464
|
readonly: "",
|
|
440
465
|
style: { cursor: "pointer" },
|
|
441
|
-
error:
|
|
442
|
-
onBlur: a[9] || (a[9] = (t) =>
|
|
443
|
-
onInput: a[10] || (a[10] = (t) =>
|
|
444
|
-
onClick:
|
|
466
|
+
error: ce.value && H.value,
|
|
467
|
+
onBlur: a[9] || (a[9] = (t) => c.email = !0),
|
|
468
|
+
onInput: a[10] || (a[10] = (t) => A("email")),
|
|
469
|
+
onClick: he
|
|
445
470
|
}, null, 8, ["modelValue", "error"]),
|
|
446
|
-
|
|
447
|
-
])) :
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
modelValue:
|
|
451
|
-
"onUpdate:modelValue": a[11] || (a[11] = (t) =>
|
|
471
|
+
g(i(S), { class: "icon-locked" })
|
|
472
|
+
])) : E("", !0),
|
|
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),
|
|
452
477
|
size: "large",
|
|
453
478
|
"text-size": "medium",
|
|
454
|
-
label:
|
|
479
|
+
label: p("Номер телефона"),
|
|
455
480
|
type: "tel",
|
|
456
481
|
readonly: "",
|
|
457
482
|
style: { cursor: "pointer" },
|
|
458
|
-
error:
|
|
459
|
-
onBlur: a[12] || (a[12] = (t) =>
|
|
460
|
-
onInput: a[13] || (a[13] = (t) =>
|
|
461
|
-
onClick:
|
|
483
|
+
error: fe.value && Z.value,
|
|
484
|
+
onBlur: a[12] || (a[12] = (t) => c.phone = !0),
|
|
485
|
+
onInput: a[13] || (a[13] = (t) => A("phone")),
|
|
486
|
+
onClick: we
|
|
462
487
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
463
|
-
|
|
464
|
-
])) :
|
|
465
|
-
|
|
466
|
-
|
|
488
|
+
g(i(S), { class: "icon-locked" })
|
|
489
|
+
])) : E("", !0),
|
|
490
|
+
G("div", na, [
|
|
491
|
+
ge.value ? (h(), I(i(le), {
|
|
467
492
|
key: 0,
|
|
468
493
|
color: "secondary",
|
|
469
|
-
onClick:
|
|
494
|
+
onClick: Ie
|
|
470
495
|
}, {
|
|
471
|
-
default:
|
|
472
|
-
|
|
496
|
+
default: F(() => [
|
|
497
|
+
j(D(p("Сменить пароль")), 1)
|
|
473
498
|
]),
|
|
474
499
|
_: 1
|
|
475
|
-
})) :
|
|
476
|
-
|
|
477
|
-
disabled: !
|
|
478
|
-
onClick:
|
|
500
|
+
})) : E("", !0),
|
|
501
|
+
g(i(le), {
|
|
502
|
+
disabled: !V.value,
|
|
503
|
+
onClick: De
|
|
479
504
|
}, {
|
|
480
|
-
default:
|
|
481
|
-
|
|
505
|
+
default: F(() => [
|
|
506
|
+
j(D(p("Сохранить")), 1)
|
|
482
507
|
]),
|
|
483
508
|
_: 1
|
|
484
509
|
}, 8, ["disabled"])
|
|
485
510
|
])
|
|
486
511
|
]),
|
|
487
|
-
|
|
512
|
+
N.value ? (h(), I(re, {
|
|
488
513
|
key: 0,
|
|
489
514
|
to: "body"
|
|
490
515
|
}, [
|
|
491
|
-
|
|
492
|
-
|
|
516
|
+
N.value ? (h(), P("div", ra, [
|
|
517
|
+
g(i(Re), {
|
|
493
518
|
"circle-mode": !0,
|
|
494
519
|
"model-value": o.imageContent,
|
|
495
|
-
onClose:
|
|
496
|
-
onSave: a[14] || (a[14] = (t) =>
|
|
497
|
-
"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))
|
|
498
523
|
}, null, 8, ["model-value"])
|
|
499
|
-
])) :
|
|
500
|
-
])) :
|
|
501
|
-
(
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
default:
|
|
505
|
-
|
|
524
|
+
])) : E("", !0)
|
|
525
|
+
])) : E("", !0),
|
|
526
|
+
(h(), I(re, { to: "#toast-root" }, [
|
|
527
|
+
G("div", la, [
|
|
528
|
+
g(Se, { name: "list" }, {
|
|
529
|
+
default: F(() => [
|
|
530
|
+
Oe(g(i(Ge), {
|
|
506
531
|
class: "toast",
|
|
507
|
-
color:
|
|
508
|
-
text:
|
|
509
|
-
onClose: a[16] || (a[16] = (t) =>
|
|
532
|
+
color: Q.value,
|
|
533
|
+
text: X.value,
|
|
534
|
+
onClose: a[16] || (a[16] = (t) => x.value = !1)
|
|
510
535
|
}, null, 8, ["color", "text"]), [
|
|
511
|
-
[
|
|
536
|
+
[Me, x.value]
|
|
512
537
|
])
|
|
513
538
|
]),
|
|
514
539
|
_: 1
|
|
515
540
|
})
|
|
516
541
|
])
|
|
517
542
|
])),
|
|
518
|
-
|
|
543
|
+
g(i(ue))
|
|
519
544
|
], 64));
|
|
520
545
|
}
|
|
521
|
-
}),
|
|
546
|
+
}), fa = /* @__PURE__ */ _({
|
|
522
547
|
__name: "index",
|
|
523
548
|
props: {
|
|
524
549
|
throttlerPrefix: {},
|
|
@@ -531,18 +556,18 @@ const Ge = {
|
|
|
531
556
|
},
|
|
532
557
|
emits: ["on-update-jwt", "update-tokens"],
|
|
533
558
|
setup(d, { emit: r }) {
|
|
534
|
-
const n = r, { openDialog: u } = W(),
|
|
535
|
-
u("email", { initialEmail: m, mode:
|
|
536
|
-
},
|
|
537
|
-
u("phone", { initialPhone: m, mode:
|
|
538
|
-
},
|
|
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 = () => {
|
|
539
564
|
u("password");
|
|
540
|
-
},
|
|
541
|
-
n("on-update-jwt", m,
|
|
565
|
+
}, l = (m, c, y) => {
|
|
566
|
+
n("on-update-jwt", m, c, y);
|
|
542
567
|
};
|
|
543
|
-
return (m,
|
|
544
|
-
|
|
545
|
-
|
|
568
|
+
return (m, c) => (h(), P(ie, null, [
|
|
569
|
+
g(i(je)),
|
|
570
|
+
g(sa, {
|
|
546
571
|
"throttler-prefix": m.throttlerPrefix,
|
|
547
572
|
provider: m.provider,
|
|
548
573
|
"request-url": m.requestUrl,
|
|
@@ -550,20 +575,20 @@ const Ge = {
|
|
|
550
575
|
fields: m.fields,
|
|
551
576
|
"access-token": m.accessToken,
|
|
552
577
|
"refresh-token": m.refreshToken,
|
|
553
|
-
onOpenEmailDialog:
|
|
554
|
-
onOpenPhoneDialog:
|
|
555
|
-
onOpenPasswordDialog:
|
|
556
|
-
onOnUpdateJwt:
|
|
578
|
+
onOpenEmailDialog: w,
|
|
579
|
+
onOpenPhoneDialog: p,
|
|
580
|
+
onOpenPasswordDialog: B,
|
|
581
|
+
onOnUpdateJwt: l
|
|
557
582
|
}, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token"]),
|
|
558
|
-
|
|
583
|
+
g(i(ue))
|
|
559
584
|
], 64));
|
|
560
585
|
}
|
|
561
586
|
});
|
|
562
587
|
export {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
588
|
+
pa as B,
|
|
589
|
+
da as C,
|
|
590
|
+
fa as _,
|
|
591
|
+
ca as g,
|
|
567
592
|
Y as p,
|
|
568
|
-
|
|
593
|
+
Ke as t
|
|
569
594
|
};
|