@yourgoods/ui-smart 0.53.23 → 0.53.24

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.
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as oe, ref as T, reactive as Z, watch as Y, computed as b, toRefs as ce, createElementBlock as I, openBlock as y, createElementVNode as x, createCommentVNode as D, toDisplayString as _, createVNode as $, unref as u, isRef as ee, withCtx as G, createTextVNode as ie, Fragment as Ae, createBlock as H, resolveDynamicComponent as he, onMounted as Fe } from "vue";
2
- import { _ as ve, c as ke, u as Re, a as ze, P as Me, b as We } from "./useRateLimitToast-BKw1kTUV.js";
3
- import { C as F, _ as He, B as qe, p as W, g as je } from "./index-BJsdyXlT.js";
2
+ import { _ as ve, c as ke, u as Re, a as ze, P as Me, b as We } from "./useRateLimitToast-BB-QNm3x.js";
3
+ import { C as F, _ as He, B as qe, p as W, g as je } from "./index-H7gCOqpx.js";
4
4
  import { PInput as J, IconMailMd as pe, PButton as ne, IconEyeMd as Ve, IconEyeClosedMd as be, PDialog as Ge, PTopBar as Ye, IconCrossMd as Je } from "@profeat/ui-kit";
5
5
  const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dialogDefaultContainerTextHint" }, Xe = {
6
6
  key: 0,
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as ye, ref as a, reactive as _, computed as u, watch as Z, onMounted as Ce, createElementBlock as S, openBlock as g, Fragment as ge, createVNode as n, unref as o, withCtx as m, createCommentVNode as ee, createElementVNode as r, toDisplayString as V, createBlock as B, resolveDynamicComponent as $, createTextVNode as z } from "vue";
2
- import { C as I, p as D, g as Ve } from "./index-BJsdyXlT.js";
2
+ import { C as I, p as D, g as Ve } from "./index-H7gCOqpx.js";
3
3
  import { PDialog as be, PInput as M, IconEyeMd as O, IconEyeClosedMd as U, PButton as F, PTopBar as Te, IconCrossMd as Ie, PTeleportContainer as xe } from "@profeat/ui-kit";
4
4
  function ke(b) {
5
5
  return { showPasswordRateLimitToast: (P) => {
@@ -1,7 +1,7 @@
1
1
  import { createElementBlock as S, openBlock as v, createElementVNode as H, defineComponent as he, reactive as ve, watch as _, ref as O, toRefs as Ce, computed as I, createCommentVNode as B, createVNode as b, toDisplayString as G, createBlock as J, createTextVNode as Z, unref as r, isRef as le, withCtx as X, onMounted as We, Fragment as je } from "vue";
2
- import { _ as we, c as Ne, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-BKw1kTUV.js";
2
+ import { _ as we, c as Ne, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-BB-QNm3x.js";
3
3
  import { IconTelegramSm as Pe, PInput as se, IconPhoneMd as Re, IconMailMd as Ke, PButton as ze, PDialog as Qe, PTopBar as Xe, IconCrossMd as Ye, PTeleportContainer as Ze } from "@profeat/ui-kit";
4
- import { C as j, t as De, p as te, g as Ae } from "./index-BJsdyXlT.js";
4
+ import { C as j, t as De, p as te, g as Ae } from "./index-H7gCOqpx.js";
5
5
  const _e = {
6
6
  xmlns: "http://www.w3.org/2000/svg",
7
7
  width: "12",
@@ -1,11 +1,11 @@
1
- import { ref as h, shallowRef as _e, defineComponent as q, defineAsyncComponent as Y, watch as pe, createBlock as x, createCommentVNode as T, unref as f, openBlock as w, resolveDynamicComponent as Re, mergeProps as Oe, computed as V, reactive as X, onMounted as Ge, createElementBlock as B, Fragment as ce, createVNode as y, createElementVNode as K, withCtx as $, toDisplayString as z, createTextVNode as Z, Teleport as de, Transition as je, withDirectives as Je, vShow as qe } from "vue";
1
+ import { ref as h, shallowRef as _e, defineComponent as q, defineAsyncComponent as Y, watch as pe, createBlock as M, createCommentVNode as U, unref as f, openBlock as w, resolveDynamicComponent as Re, mergeProps as Oe, computed as A, reactive as X, onMounted as Ge, createElementBlock as I, Fragment as ce, createVNode as y, createElementVNode as K, withCtx as x, toDisplayString as z, createTextVNode as Z, Teleport as de, Transition as je, withDirectives as Je, vShow as qe } from "vue";
2
2
  import We from "axios";
3
3
  import { PInputFileUploader as Ye, PInput as L, IconFilledEditMd as j, PButton as me, PImageCropper as Xe, PToast as Ke, PTeleportContainer as fe, PToastContainer as Ze, IconPhoneMd as He, IconMailMd as Qe } from "@profeat/ui-kit";
4
4
  function et(l, s = 2) {
5
5
  if (l === 0)
6
6
  return "0 B";
7
- const a = 1024, o = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], u = Math.floor(Math.log(l) / Math.log(a));
8
- return `${Number.parseFloat((l / a ** u).toFixed(s))} ${o[u]}`;
7
+ const a = 1024, o = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], d = Math.floor(Math.log(l) / Math.log(a));
8
+ return `${Number.parseFloat((l / a ** d).toFixed(s))} ${o[d]}`;
9
9
  }
10
10
  const tt = {
11
11
  "image/jpeg": "JPEG",
@@ -21,7 +21,7 @@ function at(l) {
21
21
  return tt[s] || ((a = s.split("/")[1]) == null ? void 0 : a.toUpperCase());
22
22
  });
23
23
  }
24
- const $t = {
24
+ const xt = {
25
25
  OLD: "old",
26
26
  NEW: "new",
27
27
  COMPLETED: "completed"
@@ -66,8 +66,8 @@ function ae() {
66
66
  return {
67
67
  currentDialog: J,
68
68
  dialogPayload: H,
69
- openDialog: (o, u) => {
70
- J.value = o, H.value = u ?? null;
69
+ openDialog: (o, d) => {
70
+ J.value = o, H.value = d ?? null;
71
71
  },
72
72
  closeDialog: () => {
73
73
  J.value = null, H.value = null;
@@ -217,18 +217,18 @@ const st = {
217
217
  },
218
218
  emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
219
219
  setup(l, { emit: s }) {
220
- const a = s, o = h(!0), { currentDialog: u, dialogPayload: v, closeDialog: D } = ae(), d = {
221
- email: Y(() => import("./ProfileEmailDialog-CwSS6XkS.js")),
222
- phone: Y(() => import("./ProfilePhoneDialog-B-cqxdjz.js")),
223
- password: Y(() => import("./ProfilePasswordDialog-BwMtH8wF.js"))
220
+ const a = s, o = h(!0), { currentDialog: d, dialogPayload: v, closeDialog: D } = ae(), u = {
221
+ email: Y(() => import("./ProfileEmailDialog-DI415kxn.js")),
222
+ phone: Y(() => import("./ProfilePhoneDialog-BCL8Cc6z.js")),
223
+ password: Y(() => import("./ProfilePasswordDialog-Cz0ea0L9.js"))
224
224
  }, m = ({ email: b }) => {
225
225
  a("update-email-field", b);
226
- }, p = ({ phone: b }) => {
226
+ }, c = ({ phone: b }) => {
227
227
  a("update-phone-field", b);
228
228
  };
229
- return pe(u, (b) => {
229
+ return pe(d, (b) => {
230
230
  o.value = !!b;
231
- }), (b, i) => f(u) ? (w(), x(Re(d[f(u)]), Oe({
231
+ }), (b, i) => f(d) ? (w(), M(Re(u[f(d)]), Oe({
232
232
  key: 0,
233
233
  modelValue: o.value,
234
234
  "onUpdate:modelValue": i[0] || (i[0] = (g) => o.value = g),
@@ -238,12 +238,12 @@ const st = {
238
238
  }, f(v), {
239
239
  onClose: f(D),
240
240
  onCleanInputErrors: i[1] || (i[1] = (g) => a("clean-input-errors")),
241
- onOnUpdateJwt: i[2] || (i[2] = (g, c, r) => a("on-update-jwt", g, c, r)),
241
+ onOnUpdateJwt: i[2] || (i[2] = (g, p, r) => a("on-update-jwt", g, p, r)),
242
242
  onSubmitEmail: m,
243
- onSubmitPhone: p,
244
- onOnPasswordError: i[3] || (i[3] = (g, c) => a("on-password-error", g, c)),
243
+ onSubmitPhone: c,
244
+ onOnPasswordError: i[3] || (i[3] = (g, p) => a("on-password-error", g, p)),
245
245
  onOnToast: i[4] || (i[4] = (g) => a("on-toast", g))
246
- }), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : T("", !0);
246
+ }), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : U("", !0);
247
247
  }
248
248
  }), ut = { class: "base-container" }, dt = {
249
249
  key: 0,
@@ -278,7 +278,7 @@ const st = {
278
278
  },
279
279
  emits: ["open-email-dialog", "open-phone-dialog", "open-password-dialog", "on-update-jwt", "on-password-error", "update-tokens"],
280
280
  setup(l, { emit: s }) {
281
- const a = l, o = s, u = V(() => a.language ?? "ru"), v = (e) => st[u.value][e] || e, { openDialog: D } = ae(), d = X({ firstName: "", lastName: "" }), m = h({ firstName: "", lastName: "" }), p = X({ firstName: !1, lastName: !1, email: !1, phone: !1 }), b = h(""), i = h(""), g = h(""), c = h(!1), r = X({
281
+ const a = l, o = s, d = A(() => a.language ?? "ru"), v = (e) => st[d.value][e] || e, { openDialog: D } = ae(), u = X({ firstName: "", lastName: "" }), m = h({ firstName: "", lastName: "" }), c = X({ firstName: !1, lastName: !1, email: !1, phone: !1 }), b = h(""), i = h(""), g = h(""), p = h(!1), r = X({
282
282
  value: null,
283
283
  loading: !1,
284
284
  accept: ["image/png", "image/jpeg"],
@@ -286,17 +286,17 @@ const st = {
286
286
  // 10 MB
287
287
  imageBinary: null,
288
288
  imageContent: ""
289
- }), C = h(""), U = h(!1), I = h(!0), E = h(!0), A = h(void 0), F = h(""), S = V(() => ne(d.firstName, p.firstName)), ve = V(() => ne(d.lastName, p.lastName)), he = V(() => p.email && !i.value.trim() ? "Введите e-mail" : ""), ye = V(() => p.phone && !g.value.trim() ? "Введите номер телефона" : ""), M = (e) => a.fields.some((t) => t.key === e), oe = (e) => e && e.trim() ? "edit" : "bind", W = () => setTimeout(() => {
289
+ }), C = h(""), B = h(!1), V = h(!0), E = h(!0), k = h(void 0), F = h(""), S = A(() => ne(u.firstName, c.firstName)), ve = A(() => ne(u.lastName, c.lastName)), he = A(() => c.email && !i.value.trim() ? "Введите e-mail" : ""), ye = A(() => c.phone && !g.value.trim() ? "Введите номер телефона" : ""), $ = (e) => a.fields.some((t) => t.key === e), oe = (e) => e && e.trim() ? "edit" : "bind", W = () => setTimeout(() => {
290
290
  var e;
291
291
  return (e = document.activeElement) == null ? void 0 : e.blur();
292
- }, 0), we = V(() => !!(i.value && i.value.trim() !== "")), be = V(() => r.imageContent ? v("Загрузить другое фото") : v("Загрузить фото")), ne = (e, t) => {
292
+ }, 0), we = A(() => !!(i.value && i.value.trim() !== "")), be = A(() => r.imageContent ? v("Загрузить другое фото") : v("Загрузить фото")), ne = (e, t) => {
293
293
  if (!t) return "";
294
294
  const n = e.trim();
295
295
  return n ? n.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
296
296
  }, Ee = (e) => D("email", { mode: e ? "edit" : "bind", initialEmail: e }), Pe = () => {
297
- W(), p.email = !1, E.value = !1, o("open-email-dialog", i.value, oe(i.value)), Ee(i.value);
297
+ W(), c.email = !1, E.value = !1, o("open-email-dialog", i.value, oe(i.value)), Ee(i.value);
298
298
  }, Ne = () => {
299
- W(), p.phone = !1, I.value = !1, o("open-phone-dialog", g.value, oe(g.value));
299
+ W(), c.phone = !1, V.value = !1, o("open-phone-dialog", g.value, oe(g.value));
300
300
  }, Ce = async (e, t, n) => {
301
301
  e === "email" && n && (i.value = n), e === "phone" && n && (g.value = n), o("on-update-jwt");
302
302
  }, ke = (e) => {
@@ -304,31 +304,31 @@ const st = {
304
304
  }, Te = (e) => {
305
305
  i.value = e;
306
306
  }, Ue = (e, t) => {
307
- U.value = !0, o("on-password-error", e, t);
307
+ B.value = !0, o("on-password-error", e, t);
308
308
  }, Be = () => {
309
- I.value = !1, E.value = !1;
309
+ V.value = !1, E.value = !1;
310
310
  }, _ = (e) => {
311
- U.value = !0, A.value = e.color ?? "", F.value = e.text ?? "";
311
+ B.value = !0, k.value = e.color ?? "", F.value = e.text ?? "";
312
312
  }, R = (e) => {
313
- if (p[e] = !0, e === "firstName" || e === "lastName") {
314
- const t = d[e];
315
- t.length > 40 && (d[e] = t.slice(0, 40));
313
+ if (c[e] = !0, e === "firstName" || e === "lastName") {
314
+ const t = u[e];
315
+ t.length > 40 && (u[e] = t.slice(0, 40));
316
316
  }
317
- }, De = (e) => {
317
+ }, Ie = (e) => {
318
318
  var O, G;
319
319
  if (C.value = "", !e) {
320
320
  re();
321
321
  return;
322
322
  }
323
- const t = ((O = e.fileBinary) == null ? void 0 : O.type) ?? "", n = ((G = e.fileBinary) == null ? void 0 : G.size) ?? 0, k = !["image/png", "image/jpeg"].includes(t), N = n > r.uploadLimit;
324
- if (k || N) {
323
+ const t = ((O = e.fileBinary) == null ? void 0 : O.type) ?? "", n = ((G = e.fileBinary) == null ? void 0 : G.size) ?? 0, T = !["image/png", "image/jpeg"].includes(t), N = n > r.uploadLimit;
324
+ if (T || N) {
325
325
  C.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", re();
326
326
  return;
327
327
  }
328
- r.value = e, r.imageBinary = e.fileBinary ?? null, r.imageContent = e.fileContent ?? "", c.value = !0;
328
+ r.value = e, r.imageBinary = e.fileBinary ?? null, r.imageContent = e.fileContent ?? "", p.value = !0;
329
329
  }, re = () => {
330
- r.value = null, r.imageBinary = null, r.imageContent = "", c.value = !1;
331
- }, Ie = async () => {
330
+ r.value = null, r.imageBinary = null, r.imageContent = "", p.value = !1;
331
+ }, De = async () => {
332
332
  try {
333
333
  const t = (await rt("/users/profile/delete/avatar")).data;
334
334
  return (t == null ? void 0 : t.success) === !0;
@@ -336,15 +336,15 @@ const st = {
336
336
  return console.error("Ошибка при удалении аватара:", e), !1;
337
337
  }
338
338
  }, Ve = () => {
339
- C.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", r.value = null, r.imageBinary = null, r.imageContent = "", c.value = !1;
339
+ C.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", r.value = null, r.imageBinary = null, r.imageContent = "", p.value = !1;
340
340
  }, le = async (e, t, n = "image/png") => {
341
341
  if (!e) return null;
342
- const k = await (await fetch(e)).blob();
343
- return new File([k], t, { type: n });
342
+ const T = await (await fetch(e)).blob();
343
+ return new File([T], t, { type: n });
344
344
  }, Ae = () => {
345
- r.value = null, r.imageBinary = null, r.imageContent = "", c.value = !1;
345
+ r.value = null, r.imageBinary = null, r.imageContent = "", p.value = !1;
346
346
  }, Fe = async (e) => {
347
- c.value = !1;
347
+ p.value = !1;
348
348
  const t = r.imageContent;
349
349
  if (r.imageContent = e, !r.imageBinary) return;
350
350
  const n = await le(
@@ -376,21 +376,21 @@ const st = {
376
376
  ));
377
377
  }, se = h(!1), ie = async (e) => {
378
378
  var n, P;
379
- const t = (n = d[e]) == null ? void 0 : n.trim();
379
+ const t = (n = u[e]) == null ? void 0 : n.trim();
380
380
  if (t)
381
381
  try {
382
382
  se.value = !0;
383
383
  const N = (P = (await ee("/users/profile/update-name", { [e]: t })).data) == null ? void 0 : P.data;
384
- N != null && N.user && (d.firstName = N.user.firstName ?? d.firstName, d.lastName = N.user.lastName ?? d.lastName, m.value = {
385
- firstName: d.firstName,
386
- lastName: d.lastName
384
+ N != null && N.user && (u.firstName = N.user.firstName ?? u.firstName, u.lastName = N.user.lastName ?? u.lastName, m.value = {
385
+ firstName: u.firstName,
386
+ lastName: u.lastName
387
387
  });
388
- } catch (k) {
389
- throw k;
388
+ } catch (T) {
389
+ throw T;
390
390
  } finally {
391
391
  se.value = !1;
392
392
  }
393
- }, xe = async () => {
393
+ }, Me = async () => {
394
394
  var e;
395
395
  if (!a.accessToken)
396
396
  throw console.error("Access token не передан в props"), new Error("Access token is required");
@@ -404,28 +404,28 @@ const st = {
404
404
  throw console.error("Данные пользователя отсутствуют в ответе сервера"), new Error("User data is missing from the response");
405
405
  const {
406
406
  userId: P,
407
- privateFirstName: k,
407
+ privateFirstName: T,
408
408
  privateLastName: N,
409
409
  email: O,
410
410
  phoneNumber: G
411
411
  } = n;
412
- b.value = P ?? "", d.firstName = k ?? "", d.lastName = N ?? "", i.value = O ?? "", g.value = G ?? "", r.imageContent = await Me(), m.value = {
413
- firstName: k ?? "",
412
+ b.value = P ?? "", u.firstName = T ?? "", u.lastName = N ?? "", i.value = O ?? "", g.value = G ?? "", r.imageContent = await $e(), m.value = {
413
+ firstName: T ?? "",
414
414
  lastName: N ?? ""
415
415
  };
416
416
  } catch (t) {
417
417
  console.error("Критическая ошибка при загрузке профиля:", t);
418
418
  }
419
- }, Me = async () => {
419
+ }, $e = async () => {
420
420
  var e;
421
421
  try {
422
422
  const n = (e = (await nt("/users/profile/avatar")).data) == null ? void 0 : e.data;
423
- return n ? $e(n) : "";
423
+ return n ? xe(n) : "";
424
424
  } catch (t) {
425
425
  return console.error("Ошибка при загрузке метаданных аватара:", t), "";
426
426
  }
427
427
  };
428
- function $e(e) {
428
+ function xe(e) {
429
429
  if (!e)
430
430
  return "";
431
431
  try {
@@ -434,11 +434,11 @@ const st = {
434
434
  return console.error("Ошибка при составлении URL аватара:", t), "";
435
435
  }
436
436
  }
437
- const ue = V(() => {
437
+ const ue = A(() => {
438
438
  if (!m.value.firstName && !m.value.lastName)
439
439
  return !1;
440
- const e = d.firstName.trim(), t = d.lastName.trim(), n = m.value.firstName.trim(), P = m.value.lastName.trim(), k = e !== n || t !== P, N = e.length >= 2 && t.length >= 2;
441
- return k && N;
440
+ const e = u.firstName.trim(), t = u.lastName.trim(), n = m.value.firstName.trim(), P = m.value.lastName.trim(), T = e !== n || t !== P, N = e.length >= 2 && t.length >= 2;
441
+ return T && N;
442
442
  }), ze = async () => {
443
443
  if (ue.value)
444
444
  try {
@@ -455,10 +455,10 @@ const st = {
455
455
  return Ge(async () => {
456
456
  if (!a.accessToken) throw new Error("Access token не передан в props");
457
457
  if (!a.requestUrl) throw new Error("auth-backend url не передан в props");
458
- ot(a.accessToken, a.requestUrl, a.throttlerPrefix), await xe();
459
- }), (e, t) => (w(), B(ce, null, [
458
+ ot(a.accessToken, a.requestUrl, a.throttlerPrefix), await Me();
459
+ }), (e, t) => (w(), I(ce, null, [
460
460
  y(it, {
461
- language: u.value,
461
+ language: d.value,
462
462
  provider: e.provider,
463
463
  "disable-add-phone": e.disableAddPhone,
464
464
  onCleanInputErrors: Be,
@@ -469,12 +469,12 @@ const st = {
469
469
  onOnToast: _
470
470
  }, null, 8, ["language", "provider", "disable-add-phone"]),
471
471
  K("div", ut, [
472
- M("avatar") ? (w(), x(f(Ye), {
472
+ $("avatar") ? (w(), M(f(Ye), {
473
473
  key: 0,
474
474
  modelValue: r.value,
475
475
  "onUpdate:modelValue": [
476
476
  t[0] || (t[0] = (n) => r.value = n),
477
- t[1] || (t[1] = (n) => De(n))
477
+ t[1] || (t[1] = (n) => Ie(n))
478
478
  ],
479
479
  type: "img",
480
480
  class: "avatar-input",
@@ -483,42 +483,42 @@ const st = {
483
483
  label: v("Загрузить фото"),
484
484
  "upload-limit": r.uploadLimit,
485
485
  accept: "image/jpeg, image/png",
486
- onDelete: Ie,
486
+ onDelete: De,
487
487
  "onChange:error": Ve
488
488
  }, {
489
- afterLoadLabel: $(() => [
489
+ afterLoadLabel: x(() => [
490
490
  Z(z(be.value), 1)
491
491
  ]),
492
- subtext: $(() => [
493
- C.value ? (w(), B("span", dt, z(C.value), 1)) : (w(), B("span", mt, z(`${v("Формат")} ${f(at)(r.accept).join(", ")} ${v("до")} ${f(et)(r.uploadLimit)}`), 1))
492
+ subtext: x(() => [
493
+ C.value ? (w(), I("span", dt, z(C.value), 1)) : (w(), I("span", mt, z(`${v("Формат")} ${f(at)(r.accept).join(", ")} ${v("до")} ${f(et)(r.uploadLimit)}`), 1))
494
494
  ]),
495
495
  _: 1
496
- }, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : T("", !0),
497
- M("firstName") ? (w(), B("div", pt, [
496
+ }, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : U("", !0),
497
+ $("firstName") ? (w(), I("div", pt, [
498
498
  y(f(L), {
499
- modelValue: d.firstName,
500
- "onUpdate:modelValue": t[2] || (t[2] = (n) => d.firstName = n),
499
+ modelValue: u.firstName,
500
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => u.firstName = n),
501
501
  size: "large",
502
502
  label: v("Имя"),
503
503
  error: S.value,
504
- onBlur: t[3] || (t[3] = (n) => p.firstName = !0),
504
+ onBlur: t[3] || (t[3] = (n) => c.firstName = !0),
505
505
  onInput: t[4] || (t[4] = (n) => R("firstName"))
506
506
  }, null, 8, ["modelValue", "label", "error"]),
507
507
  y(f(j), { class: "icon-locked" })
508
- ])) : T("", !0),
509
- M("lastName") ? (w(), B("div", ct, [
508
+ ])) : U("", !0),
509
+ $("lastName") ? (w(), I("div", ct, [
510
510
  y(f(L), {
511
- modelValue: d.lastName,
512
- "onUpdate:modelValue": t[5] || (t[5] = (n) => d.lastName = n),
511
+ modelValue: u.lastName,
512
+ "onUpdate:modelValue": t[5] || (t[5] = (n) => u.lastName = n),
513
513
  size: "large",
514
514
  label: v("Фамилия"),
515
515
  error: ve.value,
516
- onBlur: t[6] || (t[6] = (n) => p.lastName = !0),
516
+ onBlur: t[6] || (t[6] = (n) => c.lastName = !0),
517
517
  onInput: t[7] || (t[7] = (n) => R("lastName"))
518
518
  }, null, 8, ["modelValue", "label", "error"]),
519
519
  y(f(j), { class: "icon-locked" })
520
- ])) : T("", !0),
521
- M("email") ? (w(), B("div", ft, [
520
+ ])) : U("", !0),
521
+ $("email") ? (w(), I("div", ft, [
522
522
  y(f(L), {
523
523
  modelValue: i.value,
524
524
  "onUpdate:modelValue": t[8] || (t[8] = (n) => i.value = n),
@@ -529,13 +529,13 @@ const st = {
529
529
  readonly: "",
530
530
  style: { cursor: "pointer" },
531
531
  error: he.value && E.value,
532
- onBlur: t[9] || (t[9] = (n) => p.email = !0),
532
+ onBlur: t[9] || (t[9] = (n) => c.email = !0),
533
533
  onInput: t[10] || (t[10] = (n) => R("email")),
534
534
  onClick: Pe
535
535
  }, null, 8, ["modelValue", "error"]),
536
536
  y(f(j), { class: "icon-locked" })
537
- ])) : T("", !0),
538
- M("phone") ? (w(), B("div", gt, [
537
+ ])) : U("", !0),
538
+ $("phone") ? (w(), I("div", gt, [
539
539
  y(f(L), {
540
540
  modelValue: g.value,
541
541
  "onUpdate:modelValue": t[11] || (t[11] = (n) => g.value = n),
@@ -545,40 +545,40 @@ const st = {
545
545
  type: "tel",
546
546
  readonly: "",
547
547
  style: { cursor: "pointer" },
548
- error: ye.value && I.value,
549
- onBlur: t[12] || (t[12] = (n) => p.phone = !0),
548
+ error: ye.value && V.value,
549
+ onBlur: t[12] || (t[12] = (n) => c.phone = !0),
550
550
  onInput: t[13] || (t[13] = (n) => R("phone")),
551
551
  onClick: Ne
552
552
  }, null, 8, ["modelValue", "label", "error"]),
553
553
  y(f(j), { class: "icon-locked" })
554
- ])) : T("", !0),
554
+ ])) : U("", !0),
555
555
  K("div", vt, [
556
- we.value ? (w(), x(f(me), {
556
+ we.value ? (w(), M(f(me), {
557
557
  key: 0,
558
558
  color: "secondary",
559
559
  onClick: Le
560
560
  }, {
561
- default: $(() => [
561
+ default: x(() => [
562
562
  Z(z(v("Сменить пароль")), 1)
563
563
  ]),
564
564
  _: 1
565
- })) : T("", !0),
565
+ })) : U("", !0),
566
566
  y(f(me), {
567
567
  disabled: !ue.value,
568
568
  onClick: ze
569
569
  }, {
570
- default: $(() => [
570
+ default: x(() => [
571
571
  Z(z(v("Сохранить")), 1)
572
572
  ]),
573
573
  _: 1
574
574
  }, 8, ["disabled"])
575
575
  ])
576
576
  ]),
577
- c.value ? (w(), x(de, {
577
+ p.value ? (w(), M(de, {
578
578
  key: 0,
579
579
  to: "body"
580
580
  }, [
581
- c.value ? (w(), B("div", ht, [
581
+ p.value ? (w(), I("div", ht, [
582
582
  y(f(Xe), {
583
583
  "circle-mode": !0,
584
584
  "model-value": r.imageContent,
@@ -586,19 +586,19 @@ const st = {
586
586
  onSave: t[14] || (t[14] = (n) => Fe(n)),
587
587
  "onUpdate:modelValue": t[15] || (t[15] = (n) => Se(n))
588
588
  }, null, 8, ["model-value"])
589
- ])) : T("", !0)
590
- ])) : T("", !0),
591
- (w(), x(de, { to: "#toast-root" }, [
589
+ ])) : U("", !0)
590
+ ])) : U("", !0),
591
+ (w(), M(de, { to: "#toast-root" }, [
592
592
  K("div", yt, [
593
593
  y(je, { name: "list" }, {
594
- default: $(() => [
594
+ default: x(() => [
595
595
  Je(y(f(Ke), {
596
596
  class: "toast",
597
- color: A.value,
597
+ color: k.value,
598
598
  text: F.value,
599
- onClose: t[16] || (t[16] = (n) => U.value = !1)
599
+ onClose: t[16] || (t[16] = (n) => B.value = !1)
600
600
  }, null, 8, ["color", "text"]), [
601
- [qe, U.value]
601
+ [qe, B.value]
602
602
  ])
603
603
  ]),
604
604
  _: 1
@@ -610,8 +610,8 @@ const st = {
610
610
  }
611
611
  }), ge = (l, s) => {
612
612
  const a = l.__vccOpts || l;
613
- for (const [o, u] of s)
614
- a[o] = u;
613
+ for (const [o, d] of s)
614
+ a[o] = d;
615
615
  return a;
616
616
  }, bt = /* @__PURE__ */ ge(wt, [["__scopeId", "data-v-a56fcdbb"]]), Lt = /* @__PURE__ */ q({
617
617
  __name: "index",
@@ -628,16 +628,16 @@ const st = {
628
628
  },
629
629
  emits: ["on-update-jwt", "update-tokens"],
630
630
  setup(l, { emit: s }) {
631
- const a = s, { openDialog: o } = ae(), u = (m, p) => {
632
- o("email", { initialEmail: m, mode: p });
633
- }, v = (m, p) => {
634
- o("phone", { initialPhone: m, mode: p });
631
+ const a = s, { openDialog: o } = ae(), d = (m, c) => {
632
+ o("email", { initialEmail: m, mode: c });
633
+ }, v = (m, c) => {
634
+ o("phone", { initialPhone: m, mode: c });
635
635
  }, D = () => {
636
636
  o("password");
637
- }, d = (m, p, b) => {
638
- a("on-update-jwt", m, p, b);
637
+ }, u = (m, c, b) => {
638
+ a("on-update-jwt", m, c, b);
639
639
  };
640
- return (m, p) => (w(), B(ce, null, [
640
+ return (m, c) => (w(), I(ce, null, [
641
641
  y(f(Ze)),
642
642
  y(bt, {
643
643
  "throttler-prefix": m.throttlerPrefix,
@@ -649,10 +649,10 @@ const st = {
649
649
  "refresh-token": m.refreshToken,
650
650
  "aws-storage-url": m.awsStorageUrl,
651
651
  "disable-add-phone": m.disableAddPhone,
652
- onOpenEmailDialog: u,
652
+ onOpenEmailDialog: d,
653
653
  onOpenPhoneDialog: v,
654
654
  onOpenPasswordDialog: D,
655
- onOnUpdateJwt: d
655
+ onOnUpdateJwt: u
656
656
  }, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token", "aws-storage-url", "disable-add-phone"]),
657
657
  y(f(fe))
658
658
  ], 64));
@@ -676,16 +676,16 @@ function Ut(l) {
676
676
  }
677
677
  function Bt(l, s) {
678
678
  let a = 0, o = !1;
679
- return l.split("").filter((u, v) => u === "+" ? v !== 0 || o ? !1 : (o = !0, !0) : /\d/.test(u) ? (a++, a <= s) : !1).join("");
679
+ return l.split("").filter((d, v) => d === "+" ? v !== 0 || o ? !1 : (o = !0, !0) : /\d/.test(d) ? (a++, a <= s) : !1).join("");
680
680
  }
681
- const Dt = /^[\w.%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;
682
- function It(l) {
683
- return Dt.test(l);
681
+ const It = /^[\w.%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;
682
+ function Dt(l) {
683
+ return It.test(l);
684
684
  }
685
685
  function Vt(l, s) {
686
- var o, u;
686
+ var o, d;
687
687
  const a = l.trim();
688
- return a ? (o = s.phone) != null && o.enabled && (a.startsWith("+") || /^\d+$/.test(a) || /[()\-\s]/.test(a)) ? "phone" : (u = s.email) != null && u.enabled ? "email" : null : null;
688
+ return a ? (o = s.phone) != null && o.enabled && (a.startsWith("+") || /^\d+$/.test(a) || /[()\-\s]/.test(a)) ? "phone" : (d = s.email) != null && d.enabled ? "email" : null : null;
689
689
  }
690
690
  const At = { class: "smart-input" }, Ft = /* @__PURE__ */ q({
691
691
  __name: "index",
@@ -701,90 +701,90 @@ const At = { class: "smart-input" }, Ft = /* @__PURE__ */ q({
701
701
  },
702
702
  emits: ["update:modelValue", "validity-change", "type-change"],
703
703
  setup(l, { emit: s }) {
704
- const a = l, o = s, u = V(() => {
705
- var i, g, c, r, C, U, I, E, A, F, S;
704
+ const a = l, o = s, d = A(() => {
705
+ var i, g, p, r, C, B, V, E, k, F, S;
706
706
  return {
707
707
  mode: ((i = a.config) == null ? void 0 : i.mode) ?? "auto",
708
708
  phone: {
709
- enabled: ((c = (g = a.config) == null ? void 0 : g.phone) == null ? void 0 : c.enabled) ?? !0,
709
+ enabled: ((p = (g = a.config) == null ? void 0 : g.phone) == null ? void 0 : p.enabled) ?? !0,
710
710
  minDigits: ((C = (r = a.config) == null ? void 0 : r.phone) == null ? void 0 : C.minDigits) ?? 10,
711
- maxDigits: ((I = (U = a.config) == null ? void 0 : U.phone) == null ? void 0 : I.maxDigits) ?? 15,
712
- autoPlus: ((A = (E = a.config) == null ? void 0 : E.phone) == null ? void 0 : A.autoPlus) ?? !0
711
+ maxDigits: ((V = (B = a.config) == null ? void 0 : B.phone) == null ? void 0 : V.maxDigits) ?? 15,
712
+ autoPlus: ((k = (E = a.config) == null ? void 0 : E.phone) == null ? void 0 : k.autoPlus) ?? !0
713
713
  },
714
714
  email: {
715
715
  enabled: ((S = (F = a.config) == null ? void 0 : F.email) == null ? void 0 : S.enabled) ?? !0
716
716
  }
717
717
  };
718
- }), v = h(null), D = h(""), d = h(a.modelValue ?? ""), m = h(null), p = h("");
718
+ }), v = h(null), D = h(""), u = h(a.modelValue ?? ""), m = h(null), c = h("");
719
719
  pe(() => a.modelValue, (i) => {
720
- i !== void 0 && (d.value = i, D.value = i);
720
+ i !== void 0 && (u.value = i, D.value = i);
721
721
  });
722
722
  function b(i) {
723
- var C, U, I;
724
- const c = i.target.value;
725
- if (c.trim() === "") {
726
- m.value = null, p.value = "", o("type-change", null), o("update:modelValue", ""), o("validity-change", !1);
723
+ var C, B, V;
724
+ const p = i.target.value;
725
+ if (p.trim() === "") {
726
+ m.value = null, c.value = "", o("type-change", null), o("update:modelValue", ""), o("validity-change", !1);
727
727
  return;
728
728
  }
729
- const r = u.value.mode === "auto" ? Vt(c, u.value) : u.value.mode;
729
+ const r = d.value.mode === "auto" ? Vt(p, d.value) : d.value.mode;
730
730
  if (m.value = r, o("type-change", r), r === "email") {
731
- const E = It(c);
732
- p.value = c.length === 0 || E ? "" : ((C = a.errorMessages) == null ? void 0 : C.invalidEmail) ?? "Это не похоже на email", d.value = c, D.value = c, o("update:modelValue", c), o("validity-change", E);
731
+ const E = Dt(p);
732
+ c.value = p.length === 0 || E ? "" : ((C = a.errorMessages) == null ? void 0 : C.invalidEmail) ?? "Это не похоже на email", u.value = p, D.value = p, o("update:modelValue", p), o("validity-change", E);
733
733
  return;
734
734
  }
735
735
  if (r === "phone") {
736
- if (Ut(c)) {
737
- d.value = c, o("update:modelValue", c), p.value = ((U = a.errorMessages) == null ? void 0 : U.invalidPhoneChars) ?? "Допускаются только цифры и знак + в начале", o("validity-change", !1);
736
+ const E = Bt(p, d.value.phone.maxDigits);
737
+ if (E !== p) {
738
+ u.value = E, o("update:modelValue", E);
738
739
  return;
739
740
  }
740
- const E = Ct(
741
- c,
742
- u.value.phone.autoPlus,
743
- a.locale
744
- ), A = kt(E);
745
- if (A.length > u.value.phone.maxDigits) {
746
- const S = Bt(c, u.value.phone.maxDigits);
747
- d.value = S, o("update:modelValue", S), o("validity-change", !1);
741
+ if (Ut(p)) {
742
+ u.value = p, o("update:modelValue", p), c.value = ((B = a.errorMessages) == null ? void 0 : B.invalidPhoneChars) ?? "Допускаются только цифры и знак + в начале", o("validity-change", !1);
748
743
  return;
749
744
  }
750
- if (d.value = E, o("update:modelValue", E), D.value = E, A.length < Pt) {
751
- p.value = "", o("validity-change", !1);
745
+ const k = Ct(
746
+ p,
747
+ d.value.phone.autoPlus,
748
+ a.locale
749
+ ), F = kt(k);
750
+ if (u.value = k, o("update:modelValue", k), D.value = k, F.length < Pt) {
751
+ c.value = "", o("validity-change", !1);
752
752
  return;
753
753
  }
754
- const F = Tt(
755
- E,
756
- u.value.phone.minDigits,
757
- u.value.phone.maxDigits
754
+ const S = Tt(
755
+ k,
756
+ d.value.phone.minDigits,
757
+ d.value.phone.maxDigits
758
758
  );
759
- p.value = F ? "" : ((I = a.errorMessages) == null ? void 0 : I.invalidPhoneLength) ?? "Это не похоже на номер телефона", o("validity-change", F);
759
+ c.value = S ? "" : ((V = a.errorMessages) == null ? void 0 : V.invalidPhoneLength) ?? "Это не похоже на номер телефона", o("validity-change", S);
760
760
  }
761
761
  }
762
- return (i, g) => (w(), B("div", At, [
762
+ return (i, g) => (w(), I("div", At, [
763
763
  y(f(L), {
764
764
  ref_key: "inputRef",
765
765
  ref: v,
766
- "model-value": d.value,
766
+ "model-value": u.value,
767
767
  readonly: i.disabled,
768
- error: p.value,
768
+ error: c.value,
769
769
  type: i.type ?? "text",
770
770
  size: i.size ?? "large",
771
771
  label: i.label ?? "Email или телефон",
772
772
  onInput: b
773
773
  }, null, 8, ["model-value", "readonly", "error", "type", "size", "label"]),
774
- m.value === "phone" ? (w(), x(f(He), {
774
+ m.value === "phone" ? (w(), M(f(He), {
775
775
  key: 0,
776
776
  class: "smart-input__icon"
777
- })) : T("", !0),
778
- m.value === "email" ? (w(), x(f(Qe), {
777
+ })) : U("", !0),
778
+ m.value === "email" ? (w(), M(f(Qe), {
779
779
  key: 1,
780
780
  class: "smart-input__icon"
781
- })) : T("", !0)
781
+ })) : U("", !0)
782
782
  ]));
783
783
  }
784
- }), _t = /* @__PURE__ */ ge(Ft, [["__scopeId", "data-v-4ef694d8"]]);
784
+ }), _t = /* @__PURE__ */ ge(Ft, [["__scopeId", "data-v-7f1d5cb2"]]);
785
785
  export {
786
786
  zt as B,
787
- $t as C,
787
+ xt as C,
788
788
  ge as _,
789
789
  Lt as a,
790
790
  nt as g,
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".avatar-input[data-v-a56fcdbb] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-a56fcdbb] .p-input-file:hover .overlay{visibility:visible}.smart-input[data-v-4ef694d8]{position:relative;width:100%}.smart-input__icon[data-v-4ef694d8]{position:absolute;top:16px;right:16px;pointer-events:none;opacity:.5}.icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:100%;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;max-width:100%;word-wrap:break-word;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { a as o, i as r } from "./index-BJsdyXlT.js";
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".avatar-input[data-v-a56fcdbb] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-a56fcdbb] .p-input-file:hover .overlay{visibility:visible}.smart-input[data-v-7f1d5cb2]{position:relative;width:100%}.smart-input__icon[data-v-7f1d5cb2]{position:absolute;top:16px;right:16px;pointer-events:none;opacity:.5}.icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:100%;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;max-width:100%;word-wrap:break-word;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { a as o, i as r } from "./index-H7gCOqpx.js";
3
3
  export {
4
4
  o as PEditUserContact,
5
5
  r as PEmailOrPhoneInput
@@ -1,6 +1,6 @@
1
1
  import { ref as n, defineComponent as L, createElementBlock as p, openBlock as v, normalizeClass as c, createVNode as w, unref as _, computed as T, renderSlot as d, createCommentVNode as h, createElementVNode as i, toDisplayString as y, createTextVNode as f } from "vue";
2
2
  import { PLoader as $ } from "@profeat/ui-kit";
3
- import { _ as b, g as C, p as R } from "./index-BJsdyXlT.js";
3
+ import { _ as b, g as C, p as R } from "./index-H7gCOqpx.js";
4
4
  function g(s) {
5
5
  const e = Math.floor(s / 60), a = s % 60;
6
6
  return `${String(e).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yourgoods/ui-smart",
3
- "version": "0.53.23",
3
+ "version": "0.53.24",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",