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.
- package/dist/prlg-ui.css +1 -1
- package/dist/reka-ui/index.cjs.js +1 -1
- package/dist/reka-ui/index.es.js +12 -7
- package/dist/rekaUI.d.ts +1 -1
- package/dist/utils/phoneMask.util.ts +16 -29
- package/package.json +1 -1
package/dist/reka-ui/index.es.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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-
|
|
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
|
-
|
|
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-
|
|
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
|
@@ -4,34 +4,21 @@
|
|
|
4
4
|
* @returns отформатированный номер телефона в формате +7 (XXX) XXX-XX-XX
|
|
5
5
|
*/
|
|
6
6
|
export function phoneMask(value: string): string {
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
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
|
}
|