@yourgoods/ui-smart 0.53.2 → 0.53.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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-gOJ9qTgF.js";
3
- import { C as F, _ as He, B as qe, p as W, g as je } from "./index-Dj7mvO3s.js";
2
+ import { _ as ve, c as ke, u as Re, a as ze, P as Me, b as We } from "./useRateLimitToast-CEQjEdb2.js";
3
+ import { C as F, _ as He, B as qe, p as W, g as je } from "./index-DqZ_s8Rq.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-Dj7mvO3s.js";
2
+ import { C as I, p as D, g as Ve } from "./index-DqZ_s8Rq.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-gOJ9qTgF.js";
2
+ import { _ as we, c as Ne, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-CEQjEdb2.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-Dj7mvO3s.js";
4
+ import { C as j, t as De, p as te, g as Ae } from "./index-DqZ_s8Rq.js";
5
5
  const _e = {
6
6
  xmlns: "http://www.w3.org/2000/svg",
7
7
  width: "12",
@@ -218,9 +218,9 @@ const st = {
218
218
  emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
219
219
  setup(r, { emit: s }) {
220
220
  const a = s, l = w(!0), { currentDialog: m, dialogPayload: v, closeDialog: T } = ee(), d = {
221
- email: q(() => import("./ProfileEmailDialog-B6z854fI.js")),
222
- phone: q(() => import("./ProfilePhoneDialog-lTYWd7Fh.js")),
223
- password: q(() => import("./ProfilePasswordDialog-0-DWUWWy.js"))
221
+ email: q(() => import("./ProfileEmailDialog-BzQ5wM2_.js")),
222
+ phone: q(() => import("./ProfilePhoneDialog-DAFzkfUi.js")),
223
+ password: q(() => import("./ProfilePasswordDialog-DrussWPO.js"))
224
224
  }, p = ({ email: f }) => {
225
225
  a("update-email-field", f);
226
226
  }, i = ({ phone: f }) => {
@@ -286,7 +286,7 @@ const st = {
286
286
  // 10 MB
287
287
  imageBinary: null,
288
288
  imageContent: ""
289
- }), B = w(""), D = w(!1), A = w(!0), F = w(!0), V = w(void 0), te = w(""), ge = U(() => oe(d.firstName, i.firstName)), ve = U(() => oe(d.lastName, i.lastName)), he = U(() => i.email && !u.value.trim() ? "Введите e-mail" : ""), ye = U(() => i.phone && !c.value.trim() ? "Введите номер телефона" : ""), x = (e) => a.fields.some((t) => t.key === e), ae = (e) => e && e.trim() ? "edit" : "bind", J = () => setTimeout(() => {
289
+ }), B = w(""), D = w(!1), A = w(!0), V = w(!0), F = w(void 0), te = w(""), ge = U(() => oe(d.firstName, i.firstName)), ve = U(() => oe(d.lastName, i.lastName)), he = U(() => i.email && !u.value.trim() ? "Введите e-mail" : ""), ye = U(() => i.phone && !c.value.trim() ? "Введите номер телефона" : ""), x = (e) => a.fields.some((t) => t.key === e), ae = (e) => e && e.trim() ? "edit" : "bind", J = () => setTimeout(() => {
290
290
  var e;
291
291
  return (e = document.activeElement) == null ? void 0 : e.blur();
292
292
  }, 0), we = U(() => !!(u.value && u.value.trim() !== "")), be = U(() => n.imageContent ? v("Загрузить другое фото") : v("Загрузить фото")), oe = (e, t) => {
@@ -294,7 +294,7 @@ const st = {
294
294
  const o = e.trim();
295
295
  return o ? o.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
296
296
  }, Ee = (e) => T("email", { mode: e ? "edit" : "bind", initialEmail: e }), Pe = () => {
297
- J(), i.email = !1, F.value = !1, l("open-email-dialog", u.value, ae(u.value)), Ee(u.value);
297
+ J(), i.email = !1, V.value = !1, l("open-email-dialog", u.value, ae(u.value)), Ee(u.value);
298
298
  }, Ne = () => {
299
299
  J(), i.phone = !1, A.value = !1, l("open-phone-dialog", c.value, ae(c.value));
300
300
  }, Ce = async (e, t, o) => {
@@ -306,9 +306,9 @@ const st = {
306
306
  }, Ue = (e, t) => {
307
307
  D.value = !0, l("on-password-error", e, t);
308
308
  }, Be = () => {
309
- A.value = !1, F.value = !1;
309
+ A.value = !1, V.value = !1;
310
310
  }, L = (e) => {
311
- D.value = !0, V.value = e.color ?? "", te.value = e.text ?? "";
311
+ D.value = !0, F.value = e.color ?? "", te.value = e.text ?? "";
312
312
  }, M = (e) => {
313
313
  if (i[e] = !0, e === "firstName" || e === "lastName") {
314
314
  const t = d[e];
@@ -341,9 +341,9 @@ const st = {
341
341
  if (!e) return null;
342
342
  const N = await (await fetch(e)).blob();
343
343
  return new File([N], t, { type: o });
344
- }, Fe = () => {
344
+ }, Ve = () => {
345
345
  n.value = null, n.imageBinary = null, n.imageContent = "", y.value = !1;
346
- }, Ve = async (e) => {
346
+ }, Fe = async (e) => {
347
347
  y.value = !1;
348
348
  const t = n.imageContent;
349
349
  if (n.imageContent = e, !n.imageBinary) return;
@@ -528,7 +528,7 @@ const st = {
528
528
  type: "email",
529
529
  readonly: "",
530
530
  style: { cursor: "pointer" },
531
- error: he.value && F.value,
531
+ error: he.value && V.value,
532
532
  onBlur: t[9] || (t[9] = (o) => i.email = !0),
533
533
  onInput: t[10] || (t[10] = (o) => M("email")),
534
534
  onClick: Pe
@@ -582,8 +582,8 @@ const st = {
582
582
  h(g(Xe), {
583
583
  "circle-mode": !0,
584
584
  "model-value": n.imageContent,
585
- onClose: Fe,
586
- onSave: t[14] || (t[14] = (o) => Ve(o)),
585
+ onClose: Ve,
586
+ onSave: t[14] || (t[14] = (o) => Fe(o)),
587
587
  "onUpdate:modelValue": t[15] || (t[15] = (o) => xe(o))
588
588
  }, null, 8, ["model-value"])
589
589
  ])) : C("", !0)
@@ -594,7 +594,7 @@ const st = {
594
594
  default: S(() => [
595
595
  Je(h(g(Ke), {
596
596
  class: "toast",
597
- color: V.value,
597
+ color: F.value,
598
598
  text: te.value,
599
599
  onClose: t[16] || (t[16] = (o) => D.value = !1)
600
600
  }, null, 8, ["color", "text"]), [
@@ -690,7 +690,7 @@ const Dt = { class: "smart-input" }, It = /* @__PURE__ */ j({
690
690
  emits: ["update:modelValue", "validity-change", "type-change"],
691
691
  setup(r, { emit: s }) {
692
692
  const a = r, l = s, m = U(() => {
693
- var i, f, u, c, y, n, B, D, A, F, V;
693
+ var i, f, u, c, y, n, B, D, A, V, F;
694
694
  return {
695
695
  mode: ((i = a.config) == null ? void 0 : i.mode) ?? "auto",
696
696
  phone: {
@@ -700,7 +700,7 @@ const Dt = { class: "smart-input" }, It = /* @__PURE__ */ j({
700
700
  autoPlus: ((A = (D = a.config) == null ? void 0 : D.phone) == null ? void 0 : A.autoPlus) ?? !0
701
701
  },
702
702
  email: {
703
- enabled: ((V = (F = a.config) == null ? void 0 : F.email) == null ? void 0 : V.enabled) ?? !0
703
+ enabled: ((F = (V = a.config) == null ? void 0 : V.email) == null ? void 0 : F.enabled) ?? !0
704
704
  }
705
705
  };
706
706
  }), v = w(a.modelValue ?? ""), T = w(null), d = w("");
@@ -711,7 +711,8 @@ const Dt = { class: "smart-input" }, It = /* @__PURE__ */ j({
711
711
  }
712
712
  );
713
713
  function p(i) {
714
- d.value = "";
714
+ if (d.value = "", typeof i != "string")
715
+ return;
715
716
  const f = m.value.mode === "auto" ? Bt(i, m.value) : m.value.mode;
716
717
  T.value = f, l("type-change", f);
717
718
  let u = i;
@@ -732,22 +733,24 @@ const Dt = { class: "smart-input" }, It = /* @__PURE__ */ j({
732
733
  l("validity-change", y), !y && !d.value && (d.value = "Это не похоже на номер телефона");
733
734
  }
734
735
  if (f === "email") {
735
- u = i;
736
736
  const c = Ut(i);
737
737
  l("validity-change", c), c || (d.value = "Это не похоже на email");
738
738
  }
739
- v.value = u, l("update:modelValue", u);
739
+ u !== v.value && (v.value = u, l("update:modelValue", u));
740
740
  }
741
741
  return (i, f) => (b(), k("div", Dt, [
742
742
  h(g(z), {
743
- "model-value": v.value,
743
+ modelValue: v.value,
744
+ "onUpdate:modelValue": [
745
+ f[0] || (f[0] = (u) => v.value = u),
746
+ p
747
+ ],
744
748
  readonly: i.disabled,
745
749
  error: d.value,
746
750
  type: "text",
747
751
  size: "large",
748
- label: "Email или телефон",
749
- onInput: f[0] || (f[0] = (u) => p(u.target.value))
750
- }, null, 8, ["model-value", "readonly", "error"]),
752
+ label: "Email или телефон"
753
+ }, null, 8, ["modelValue", "readonly", "error"]),
751
754
  T.value === "phone" ? (b(), I(g(He), {
752
755
  key: 0,
753
756
  class: "smart-input__icon"
@@ -758,7 +761,7 @@ const Dt = { class: "smart-input" }, It = /* @__PURE__ */ j({
758
761
  })) : C("", !0)
759
762
  ]));
760
763
  }
761
- }), zt = /* @__PURE__ */ fe(It, [["__scopeId", "data-v-8ba08b36"]]);
764
+ }), zt = /* @__PURE__ */ fe(It, [["__scopeId", "data-v-ec070a7f"]]);
762
765
  export {
763
766
  St as B,
764
767
  xt as C,
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
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-8ba08b36]{position:relative;width:100%}.smart-input__icon[data-v-8ba08b36]{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-Dj7mvO3s.js";
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-ec070a7f]{position:relative;width:100%}.smart-input__icon[data-v-ec070a7f]{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-DqZ_s8Rq.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-Dj7mvO3s.js";
3
+ import { _ as b, g as C, p as R } from "./index-DqZ_s8Rq.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.2",
3
+ "version": "0.53.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",