prlg-ui 1.8.297 → 1.8.299

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.
@@ -21483,8 +21483,11 @@ const BD = /* @__PURE__ */ h({
21483
21483
  }
21484
21484
  });
21485
21485
  function n1(e) {
21486
- let t = e.replace(/\D/g, "");
21487
- return t.length > 11 && (t = t.substring(0, 11)), t.length === 0 ? "" : (t[0] === "8" && (t = "7" + t.substring(1)), t.length === 1 ? `+${t[0]}` : t.length <= 4 ? `+${t[0]} (${t.substring(1)}` : t.length <= 7 ? `+${t[0]} (${t.substring(1, 4)}) ${t.substring(4)}` : t.length <= 9 ? `+${t[0]} (${t.substring(1, 4)}) ${t.substring(4, 7)}-${t.substring(7)}` : `+${t[0]} (${t.substring(1, 4)}) ${t.substring(4, 7)}-${t.substring(7, 9)}-${t.substring(9)}`);
21486
+ let t = e.replace(/\D/g, ""), a = "", r = [];
21487
+ t.length < 12 && (t = t.concat(" ")), r = t.match(/(.{1})(.{3})(.{3})(.{2})(.{2})/), r[1] === "8" && (r[1] = "7"), a = "+" + r[1] + " (" + r[2] + ") " + r[3] + "-" + r[4] + "-" + r[5], a = a.trim();
21488
+ let n = a.replace(/[^\d^\s+()-_]/g, "");
21489
+ const o = n.search(/\d(?!.*\d)/);
21490
+ return n = n.substring(0, o + 1), n;
21488
21491
  }
21489
21492
  const l1 = ["for"], o1 = { key: 0 }, s1 = { class: "input__wrapper" }, i1 = ["value", "id", "placeholder", "name", "disabled", "type", "required", "readonly", "maxlength"], u1 = { class: "input__actions" }, d1 = {
21490
21493
  key: 1,
@@ -21535,7 +21538,8 @@ const l1 = ["for"], o1 = { key: 0 }, s1 = { class: "input__wrapper" }, i1 = ["va
21535
21538
  p.value = r.value || "";
21536
21539
  return;
21537
21540
  }
21538
- r.value = n1(v);
21541
+ const g = n1(v);
21542
+ r.value = g, p.value = g;
21539
21543
  };
21540
21544
  return (c, p) => (f(), R("div", {
21541
21545
  class: Se(s.value)
@@ -21707,7 +21711,7 @@ const l1 = ["for"], o1 = { key: 0 }, s1 = { class: "input__wrapper" }, i1 = ["va
21707
21711
  }, null, 8, ["src", "alt"])) : W("", !0)
21708
21712
  ], 64));
21709
21713
  }
21710
- }), ZS = /* @__PURE__ */ N(q1, [["__scopeId", "data-v-701bbfb9"]]), D1 = /* @__PURE__ */ h({
21714
+ }), ZS = /* @__PURE__ */ N(q1, [["__scopeId", "data-v-e947b4e3"]]), D1 = /* @__PURE__ */ h({
21711
21715
  __name: "PopoverContent",
21712
21716
  props: {
21713
21717
  width: { default: 400 },
@@ -22606,8 +22610,9 @@ const n$ = /* @__PURE__ */ h({
22606
22610
  V(l(xa), {
22607
22611
  modelValue: r.value[g].active,
22608
22612
  "onUpdate:modelValue": (w) => r.value[g].active = w,
22609
- class: "shedule__item-checkbox"
22610
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
22613
+ class: "shedule__item-checkbox",
22614
+ checked: r.value[g].active
22615
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "checked"]),
22611
22616
  z("span", dq, le(_), 1),
22612
22617
  z("div", cq, [
22613
22618
  v[0] || (v[0] = z("span", { class: "shedule__item-time__text" }, "с", -1)),
@@ -22637,7 +22642,7 @@ const n$ = /* @__PURE__ */ h({
22637
22642
  _: 1
22638
22643
  }));
22639
22644
  }
22640
- }), u$ = /* @__PURE__ */ N(pq, [["__scopeId", "data-v-740e69ae"]]), vq = ["width", "height"], yq = /* @__PURE__ */ h({
22645
+ }), u$ = /* @__PURE__ */ N(pq, [["__scopeId", "data-v-107a09d6"]]), vq = ["width", "height"], yq = /* @__PURE__ */ h({
22641
22646
  __name: "Spinner",
22642
22647
  props: {
22643
22648
  color: { default: "currentColor" },
package/dist/rekaUI.d.ts CHANGED
@@ -2748,7 +2748,7 @@ declare interface IDropdownMenuSubContentProps extends DropdownMenuSubContentPro
2748
2748
  width?: number;
2749
2749
  }
2750
2750
 
2751
- declare interface IFile {
2751
+ export declare interface IFile {
2752
2752
  id: string;
2753
2753
  url: string;
2754
2754
  name?: string;
@@ -4,34 +4,21 @@
4
4
  * @returns отформатированный номер телефона в формате +7 (XXX) XXX-XX-XX
5
5
  */
6
6
  export function phoneMask(value: string): string {
7
- // Удаляем все символы кроме цифр и знака +
8
- let digits = value.replace(/\D/g, "");
7
+ let digits = value.replace(/\D/g, '');
8
+ let result = '';
9
+ let array = [];
10
+ if (digits.length < 12) {
11
+ digits = digits.concat(' ');
12
+ }
13
+ array = digits.match(/(.{1})(.{3})(.{3})(.{2})(.{2})/)!;
14
+ if (array[1] === '8') {
15
+ array[1] = '7';
16
+ }
17
+ result = '+' + array[1] + ' (' + array[2] + ') ' + array[3] + '-' + array[4] + '-' + array[5];
18
+ result = result.trim();
19
+ let newString = result.replace(/[^\d^\s+()-_]/g, '');
20
+ const lastDigitIndex = newString.search(/\d(?!.*\d)/);
21
+ newString = newString.substring(0, lastDigitIndex + 1);
9
22
 
10
- // Ограничиваем количество цифр до 11 (максимум для российских номеров)
11
- if (digits.length > 11) {
12
- digits = digits.substring(0, 11);
13
- }
14
-
15
- // Если цифр нет, возвращаем пустую строку
16
- if (digits.length === 0) {
17
- return "";
18
- }
19
-
20
- // Заменяем 8 на 7 для российских номеров
21
- if (digits[0] === "8") {
22
- digits = "7" + digits.substring(1);
23
- }
24
-
25
- // Формируем маску в зависимости от количества цифр
26
- if (digits.length === 1) {
27
- return `+${digits[0]}`;
28
- } else if (digits.length <= 4) {
29
- return `+${digits[0]} (${digits.substring(1)}`;
30
- } else if (digits.length <= 7) {
31
- return `+${digits[0]} (${digits.substring(1, 4)}) ${digits.substring(4)}`;
32
- } else if (digits.length <= 9) {
33
- return `+${digits[0]} (${digits.substring(1, 4)}) ${digits.substring(4, 7)}-${digits.substring(7)}`;
34
- } else {
35
- return `+${digits[0]} (${digits.substring(1, 4)}) ${digits.substring(4, 7)}-${digits.substring(7, 9)}-${digits.substring(9)}`;
36
- }
23
+ return newString;
37
24
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prlg-ui",
3
3
  "private": false,
4
- "version": "1.8.297",
4
+ "version": "1.8.299",
5
5
  "type": "module",
6
6
  "main": "dist/prlg-ui.umd.js",
7
7
  "module": "dist/prlg-ui.es.js",