@konstructio/ui 0.1.2-alpha.29 → 0.1.2-alpha.30
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/Modal-5xSxFoaD.js +99 -0
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +4 -4
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +26 -17
- package/dist/components/PhoneNumberInput/components/Wrapper.js +220 -216
- package/dist/components/index.js +1 -1
- package/dist/index.d.ts +12 -9
- package/dist/index.js +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/Modal-Dpk-1N9W.js +0 -98
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Body as g } from "./components/Modal/components/Body/Body.js";
|
|
2
|
+
import { Footer as v } from "./components/Modal/components/Footer/Footer.js";
|
|
3
|
+
import { Header as w } from "./components/Modal/components/Header/Header.js";
|
|
4
|
+
import { jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
5
|
+
import { Children as i, isValidElement as s, useEffect as A } from "react";
|
|
6
|
+
import { createPortal as N } from "react-dom";
|
|
7
|
+
import { R } from "./index-DrWQH0QF.js";
|
|
8
|
+
import { R as k } from "./Combination-VYaRRJBZ.js";
|
|
9
|
+
import { cn as p } from "./utils/index.js";
|
|
10
|
+
import { buttonCloseVariants as x, modalVariants as B } from "./components/Modal/components/Wrapper/Wrapper.variants.js";
|
|
11
|
+
import { X as E } from "./x-DPU9OdYH.js";
|
|
12
|
+
const F = ({
|
|
13
|
+
buttonCloseClassName: m,
|
|
14
|
+
children: e,
|
|
15
|
+
className: d,
|
|
16
|
+
showCloseButton: l = !0,
|
|
17
|
+
theme: a,
|
|
18
|
+
onClose: n
|
|
19
|
+
}) => {
|
|
20
|
+
const c = i.toArray(e).find(
|
|
21
|
+
(o) => s(o) && o.type === r.Header
|
|
22
|
+
), y = i.toArray(e).find(
|
|
23
|
+
(o) => s(o) && o.type === r.Body
|
|
24
|
+
), u = i.toArray(e).find(
|
|
25
|
+
(o) => s(o) && o.type === r.Footer
|
|
26
|
+
), b = i.toArray(e).filter(
|
|
27
|
+
(o) => !s(o) || ![r.Header, r.Body, r.Footer].includes(
|
|
28
|
+
o.type
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
return /* @__PURE__ */ t(k, { children: /* @__PURE__ */ f(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: "fixed inset-0 grid place-content-center",
|
|
35
|
+
"data-theme": a,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ t(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: "absolute inset-0 bg-black opacity-75 animate-in fade-in-0",
|
|
41
|
+
onClick: n,
|
|
42
|
+
role: "presentation"
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
/* @__PURE__ */ f(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
className: p(
|
|
49
|
+
B({
|
|
50
|
+
className: d
|
|
51
|
+
})
|
|
52
|
+
),
|
|
53
|
+
role: "dialog",
|
|
54
|
+
"aria-modal": "true",
|
|
55
|
+
children: [
|
|
56
|
+
c,
|
|
57
|
+
l && /* @__PURE__ */ f(
|
|
58
|
+
"button",
|
|
59
|
+
{
|
|
60
|
+
className: p(
|
|
61
|
+
x({
|
|
62
|
+
className: m
|
|
63
|
+
})
|
|
64
|
+
),
|
|
65
|
+
onClick: n,
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ t(E, {}),
|
|
68
|
+
/* @__PURE__ */ t(R, { children: "Dismiss modal" })
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
y ?? b,
|
|
73
|
+
u
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
) });
|
|
80
|
+
}, r = ({ isOpen: m, onClose: e, container: d, ...l }) => (A(() => {
|
|
81
|
+
const a = new AbortController(), n = (c) => {
|
|
82
|
+
c.code === "Escape" && e?.();
|
|
83
|
+
};
|
|
84
|
+
return window.addEventListener("keydown", n, {
|
|
85
|
+
signal: a.signal
|
|
86
|
+
}), () => {
|
|
87
|
+
a.abort();
|
|
88
|
+
};
|
|
89
|
+
}, [e]), m ? N(
|
|
90
|
+
/* @__PURE__ */ t(F, { ...l, onClose: e }),
|
|
91
|
+
d || document.body
|
|
92
|
+
) : null);
|
|
93
|
+
r.Header = w;
|
|
94
|
+
r.Body = g;
|
|
95
|
+
r.Footer = v;
|
|
96
|
+
export {
|
|
97
|
+
r as M,
|
|
98
|
+
F as W
|
|
99
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
import { M as d } from "../../Modal-
|
|
4
|
+
import { M as d } from "../../Modal-5xSxFoaD.js";
|
|
5
5
|
import "./components/Header/Header.js";
|
|
6
6
|
import "./components/Body/Body.js";
|
|
7
7
|
import "./components/Footer/Footer.js";
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "../../../../index-DrWQH0QF.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../../../../Combination-VYaRRJBZ.js";
|
|
5
|
-
import { W as f } from "../../../../Modal-
|
|
5
|
+
import { W as f } from "../../../../Modal-5xSxFoaD.js";
|
|
6
6
|
import "../../../../utils/index.js";
|
|
7
7
|
import "./Wrapper.variants.js";
|
|
8
8
|
import "../../../../x-DPU9OdYH.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Body as e } from "./Body/Body.js";
|
|
2
2
|
import { Footer as t } from "./Footer/Footer.js";
|
|
3
3
|
import { Header as m } from "./Header/Header.js";
|
|
4
|
-
import { W as a } from "../../../Modal-
|
|
4
|
+
import { W as a } from "../../../Modal-5xSxFoaD.js";
|
|
5
5
|
export {
|
|
6
6
|
e as Body,
|
|
7
7
|
t as Footer,
|
|
@@ -555,8 +555,8 @@ function G(r) {
|
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
557
|
const te = ({
|
|
558
|
-
|
|
559
|
-
|
|
558
|
+
showFlagOnSearch: r,
|
|
559
|
+
showNameOnSearch: l
|
|
560
560
|
}) => {
|
|
561
561
|
const e = R(null), { termOfSearch: t, countries: s, handleSelectCountry: i } = A(), n = F(() => s.filter(
|
|
562
562
|
(a) => a.name.toLocaleLowerCase().includes(t.toLowerCase())
|
|
@@ -608,8 +608,8 @@ const te = ({
|
|
|
608
608
|
component: "span",
|
|
609
609
|
className: "flex gap-2 items-center text-left text-slate-800 dark:text-slate-50",
|
|
610
610
|
children: [
|
|
611
|
-
|
|
612
|
-
|
|
611
|
+
r && /* @__PURE__ */ f(h, {}),
|
|
612
|
+
l && /* @__PURE__ */ f(D, { text: u, prefix: d })
|
|
613
613
|
]
|
|
614
614
|
}
|
|
615
615
|
)
|
package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js
CHANGED
|
@@ -1,27 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { Input as
|
|
4
|
-
import { FlagSelectorList as
|
|
5
|
-
import { usePhoneNumberContext as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as d } from "react";
|
|
3
|
+
import { Input as p } from "../../../Input/Input.js";
|
|
4
|
+
import { FlagSelectorList as c } from "../FlagSelectorList/FlagSelectorList.js";
|
|
5
|
+
import { usePhoneNumberContext as u } from "../../contexts/phone-number.hook.js";
|
|
6
|
+
const S = ({
|
|
7
|
+
placeholder: r = "Search",
|
|
8
|
+
showFlagOnSearch: o,
|
|
9
|
+
showInputFilter: t,
|
|
10
|
+
showNameOnSearch: a,
|
|
11
|
+
showPlaceHolder: s = !0
|
|
10
12
|
}) => {
|
|
11
|
-
const { onChangeTermOfSearch:
|
|
12
|
-
|
|
13
|
+
const { onChangeTermOfSearch: l } = u(), n = d((m) => {
|
|
14
|
+
l(m.target.value);
|
|
13
15
|
}, []);
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
16
|
-
/* @__PURE__ */ e(
|
|
16
|
+
return /* @__PURE__ */ i("div", { className: "absolute top-full mt-1.5 animate-in fade-in-0 zoom-in-95 w-full border border-transparent bg-white shadow-sm py-2 z-10 rounded-sm dark:bg-slate-800 dark:border-slate-600", children: [
|
|
17
|
+
t && /* @__PURE__ */ e("div", { className: "px-6 py-2.5", children: /* @__PURE__ */ e(
|
|
17
18
|
p,
|
|
18
19
|
{
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
isSearch: !0,
|
|
21
|
+
placeholder: s ? r : void 0,
|
|
22
|
+
onChange: n
|
|
23
|
+
}
|
|
24
|
+
) }),
|
|
25
|
+
/* @__PURE__ */ e(
|
|
26
|
+
c,
|
|
27
|
+
{
|
|
28
|
+
showFlagOnSearch: o,
|
|
29
|
+
showNameOnSearch: a
|
|
21
30
|
}
|
|
22
31
|
)
|
|
23
32
|
] });
|
|
24
33
|
};
|
|
25
34
|
export {
|
|
26
|
-
|
|
35
|
+
S as FlagSelectorWrapper
|
|
27
36
|
};
|
|
@@ -14,12 +14,12 @@ function se(e, t) {
|
|
|
14
14
|
return r;
|
|
15
15
|
}
|
|
16
16
|
function Ue(e, t, n) {
|
|
17
|
-
return t = Y(t), function(r,
|
|
18
|
-
if (
|
|
19
|
-
if (
|
|
20
|
-
return function(
|
|
21
|
-
if (
|
|
22
|
-
return
|
|
17
|
+
return t = Y(t), function(r, o) {
|
|
18
|
+
if (o && (typeof o == "object" || typeof o == "function")) return o;
|
|
19
|
+
if (o !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
20
|
+
return function(a) {
|
|
21
|
+
if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
22
|
+
return a;
|
|
23
23
|
}(r);
|
|
24
24
|
}(e, Oe() ? Reflect.construct(t, n || [], Y(e).constructor) : t.apply(e, n));
|
|
25
25
|
}
|
|
@@ -40,46 +40,46 @@ function ge(e, t) {
|
|
|
40
40
|
}
|
|
41
41
|
}(e)) || t) {
|
|
42
42
|
n && (e = n);
|
|
43
|
-
var r = 0,
|
|
43
|
+
var r = 0, o = function() {
|
|
44
44
|
};
|
|
45
|
-
return { s:
|
|
45
|
+
return { s: o, n: function() {
|
|
46
46
|
return r >= e.length ? { done: !0 } : { done: !1, value: e[r++] };
|
|
47
47
|
}, e: function(i) {
|
|
48
48
|
throw i;
|
|
49
|
-
}, f:
|
|
49
|
+
}, f: o };
|
|
50
50
|
}
|
|
51
51
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
52
52
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
53
53
|
}
|
|
54
|
-
var
|
|
54
|
+
var a, l = !0, u = !1;
|
|
55
55
|
return { s: function() {
|
|
56
56
|
n = n.call(e);
|
|
57
57
|
}, n: function() {
|
|
58
58
|
var i = n.next();
|
|
59
59
|
return l = i.done, i;
|
|
60
60
|
}, e: function(i) {
|
|
61
|
-
u = !0,
|
|
61
|
+
u = !0, a = i;
|
|
62
62
|
}, f: function() {
|
|
63
63
|
try {
|
|
64
64
|
l || n.return == null || n.return();
|
|
65
65
|
} finally {
|
|
66
|
-
if (u) throw
|
|
66
|
+
if (u) throw a;
|
|
67
67
|
}
|
|
68
68
|
} };
|
|
69
69
|
}
|
|
70
70
|
function be(e, t, n) {
|
|
71
71
|
return (t = function(r) {
|
|
72
|
-
var
|
|
73
|
-
if (typeof
|
|
74
|
-
var u =
|
|
72
|
+
var o = function(a, l) {
|
|
73
|
+
if (typeof a != "object" || !a) return a;
|
|
74
|
+
var u = a[Symbol.toPrimitive];
|
|
75
75
|
if (u !== void 0) {
|
|
76
|
-
var i = u.call(
|
|
76
|
+
var i = u.call(a, l);
|
|
77
77
|
if (typeof i != "object") return i;
|
|
78
78
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
79
79
|
}
|
|
80
|
-
return (l === "string" ? String : Number)(
|
|
80
|
+
return (l === "string" ? String : Number)(a);
|
|
81
81
|
}(r, "string");
|
|
82
|
-
return typeof
|
|
82
|
+
return typeof o == "symbol" ? o : o + "";
|
|
83
83
|
}(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
|
|
84
84
|
}
|
|
85
85
|
function Y(e) {
|
|
@@ -105,8 +105,8 @@ function pe(e, t) {
|
|
|
105
105
|
var n = Object.keys(e);
|
|
106
106
|
if (Object.getOwnPropertySymbols) {
|
|
107
107
|
var r = Object.getOwnPropertySymbols(e);
|
|
108
|
-
t && (r = r.filter(function(
|
|
109
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
108
|
+
t && (r = r.filter(function(o) {
|
|
109
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
110
110
|
})), n.push.apply(n, r);
|
|
111
111
|
}
|
|
112
112
|
return n;
|
|
@@ -124,7 +124,7 @@ function J(e) {
|
|
|
124
124
|
}
|
|
125
125
|
function _e(e, t) {
|
|
126
126
|
if (e == null) return {};
|
|
127
|
-
var n, r,
|
|
127
|
+
var n, r, o = function(l, u) {
|
|
128
128
|
if (l == null) return {};
|
|
129
129
|
var i = {};
|
|
130
130
|
for (var c in l) if ({}.hasOwnProperty.call(l, c)) {
|
|
@@ -134,10 +134,10 @@ function _e(e, t) {
|
|
|
134
134
|
return i;
|
|
135
135
|
}(e, t);
|
|
136
136
|
if (Object.getOwnPropertySymbols) {
|
|
137
|
-
var
|
|
138
|
-
for (r = 0; r <
|
|
137
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
138
|
+
for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
|
|
139
139
|
}
|
|
140
|
-
return
|
|
140
|
+
return o;
|
|
141
141
|
}
|
|
142
142
|
function te(e, t) {
|
|
143
143
|
return te = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
@@ -145,90 +145,90 @@ function te(e, t) {
|
|
|
145
145
|
}, te(e, t);
|
|
146
146
|
}
|
|
147
147
|
function U(e, t) {
|
|
148
|
-
var n, r = t.replacementChars,
|
|
148
|
+
var n, r = t.replacementChars, o = t.replacement, a = t.separate, l = r, u = "", i = ge(e);
|
|
149
149
|
try {
|
|
150
150
|
for (i.s(); !(n = i.n()).done; ) {
|
|
151
|
-
var c, p = n.value,
|
|
152
|
-
(
|
|
151
|
+
var c, p = n.value, f = !Object.prototype.hasOwnProperty.call(o, p) && ((c = o[l[0]]) === null || c === void 0 ? void 0 : c.test(p));
|
|
152
|
+
(a && p === l[0] || f) && (l = l.slice(1), u += p);
|
|
153
153
|
}
|
|
154
|
-
} catch (
|
|
155
|
-
i.e(
|
|
154
|
+
} catch (b) {
|
|
155
|
+
i.e(b);
|
|
156
156
|
} finally {
|
|
157
157
|
i.f();
|
|
158
158
|
}
|
|
159
159
|
return u;
|
|
160
160
|
}
|
|
161
161
|
function Se(e, t) {
|
|
162
|
-
var n, r = t.mask,
|
|
162
|
+
var n, r = t.mask, o = t.replacement, a = t.separate, l = t.showMask, u = 0, i = "", c = ge(r);
|
|
163
163
|
try {
|
|
164
164
|
for (c.s(); !(n = c.n()).done; ) {
|
|
165
165
|
var p = n.value;
|
|
166
166
|
if (!l && e[u] === void 0) break;
|
|
167
|
-
Object.prototype.hasOwnProperty.call(
|
|
167
|
+
Object.prototype.hasOwnProperty.call(o, p) && e[u] !== void 0 ? i += e[u++] : i += p;
|
|
168
168
|
}
|
|
169
|
-
} catch (
|
|
170
|
-
c.e(
|
|
169
|
+
} catch (b) {
|
|
170
|
+
c.e(b);
|
|
171
171
|
} finally {
|
|
172
172
|
c.f();
|
|
173
173
|
}
|
|
174
|
-
if (
|
|
175
|
-
for (var
|
|
176
|
-
i = i.slice(0,
|
|
174
|
+
if (a && !l) {
|
|
175
|
+
for (var f = r.length - 1; f >= 0 && i[f] === r[f]; f--) ;
|
|
176
|
+
i = i.slice(0, f + 1);
|
|
177
177
|
}
|
|
178
178
|
return i;
|
|
179
179
|
}
|
|
180
180
|
function we(e, t) {
|
|
181
|
-
for (var n = t.mask, r = t.replacement,
|
|
182
|
-
var l, u = (l = e[
|
|
183
|
-
|
|
181
|
+
for (var n = t.mask, r = t.replacement, o = [], a = 0; a < n.length; a++) {
|
|
182
|
+
var l, u = (l = e[a]) !== null && l !== void 0 ? l : n[a], i = Object.prototype.hasOwnProperty.call(r, u) ? "replacement" : e[a] !== void 0 && e[a] !== n[a] ? "input" : "mask";
|
|
183
|
+
o.push({ type: i, value: u, index: a });
|
|
184
184
|
}
|
|
185
|
-
return
|
|
185
|
+
return o;
|
|
186
186
|
}
|
|
187
187
|
function K(e) {
|
|
188
188
|
return e.length > 0 ? be({}, e, /./) : {};
|
|
189
189
|
}
|
|
190
190
|
function ne(e, t) {
|
|
191
|
-
for (var n = t.start, r = n === void 0 ? 0 : n,
|
|
192
|
-
var
|
|
193
|
-
|
|
191
|
+
for (var n = t.start, r = n === void 0 ? 0 : n, o = t.end, a = t.mask, l = t.replacement, u = t.separate, i = e.slice(r, o), c = a.slice(r, o), p = "", f = 0; f < c.length; f++) {
|
|
192
|
+
var b = Object.prototype.hasOwnProperty.call(l, c[f]);
|
|
193
|
+
b && i[f] !== void 0 && i[f] !== c[f] ? p += i[f] : b && u && (p += c[f]);
|
|
194
194
|
}
|
|
195
195
|
return p;
|
|
196
196
|
}
|
|
197
197
|
function ke(e, t) {
|
|
198
|
-
var n = t.mask, r = t.replacement,
|
|
199
|
-
return Se(U(e, { replacementChars: n.replace(
|
|
198
|
+
var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = RegExp("[^".concat(Object.keys(o).join(""), "]"), "g");
|
|
199
|
+
return Se(U(e, { replacementChars: n.replace(a, ""), replacement: o, separate: !1 }), { mask: n, replacement: o, separate: !1, showMask: !1 });
|
|
200
200
|
}
|
|
201
201
|
function We(e, t) {
|
|
202
|
-
var n = t.mask, r = t.replacement,
|
|
203
|
-
return U(
|
|
202
|
+
var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = ne(e, { mask: n, replacement: o, separate: !1 }), l = RegExp("[^".concat(Object.keys(o).join(""), "]"), "g");
|
|
203
|
+
return U(a, { replacementChars: n.replace(l, ""), replacement: o, separate: !1 });
|
|
204
204
|
}
|
|
205
205
|
function Ze(e, t) {
|
|
206
|
-
var n = t.mask, r = t.replacement,
|
|
207
|
-
return we(ke(e, { mask: n, replacement:
|
|
206
|
+
var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r;
|
|
207
|
+
return we(ke(e, { mask: n, replacement: o }), { mask: n, replacement: o });
|
|
208
208
|
}
|
|
209
209
|
var Je = ["[", "]", "\\", "/", "^", "$", ".", "|", "?", "*", "+", "(", ")", "{", "}"];
|
|
210
210
|
function fe(e) {
|
|
211
211
|
return Je.includes(e) ? "\\".concat(e) : e;
|
|
212
212
|
}
|
|
213
213
|
function Ye(e, t) {
|
|
214
|
-
for (var n = t.mask, r = t.replacement,
|
|
214
|
+
for (var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = e === "partial" || e === "partial-inexact", l = e === "full" || e === "partial", u = "", i = 0; i < n.length; i++) {
|
|
215
215
|
var c = n[i];
|
|
216
|
-
i === 0 && (u = "^"),
|
|
216
|
+
i === 0 && (u = "^"), a && (u += "("), u += Object.prototype.hasOwnProperty.call(o, c) ? "".concat(l ? "(?!".concat(fe(c), ")") : "", "(").concat(o[c].source, ")") : fe(c), i === n.length - 1 && (a && (u += ")?".repeat(n.length)), u += "$");
|
|
217
217
|
}
|
|
218
218
|
return u;
|
|
219
219
|
}
|
|
220
220
|
function Qe(e, t) {
|
|
221
|
-
return new Proxy(e, { set: function(n, r,
|
|
222
|
-
return r === "current" && (
|
|
221
|
+
return new Proxy(e, { set: function(n, r, o) {
|
|
222
|
+
return r === "current" && (o !== e.current && (e.current !== null && t.unregister(e.current), o !== null && t.register(o)), n[r] = o, !0);
|
|
223
223
|
} });
|
|
224
224
|
}
|
|
225
225
|
function qe(e, t, n) {
|
|
226
|
-
return t = z(t), function(r,
|
|
227
|
-
if (
|
|
228
|
-
if (
|
|
229
|
-
return function(
|
|
230
|
-
if (
|
|
231
|
-
return
|
|
226
|
+
return t = z(t), function(r, o) {
|
|
227
|
+
if (o && (typeof o == "object" || typeof o == "function")) return o;
|
|
228
|
+
if (o !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
229
|
+
return function(a) {
|
|
230
|
+
if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
231
|
+
return a;
|
|
232
232
|
}(r);
|
|
233
233
|
}(e, ae() ? Reflect.construct(t, n || [], z(e).constructor) : t.apply(e, n));
|
|
234
234
|
}
|
|
@@ -240,17 +240,17 @@ function Me(e, t, n) {
|
|
|
240
240
|
}
|
|
241
241
|
function Xe(e, t, n) {
|
|
242
242
|
return (t = function(r) {
|
|
243
|
-
var
|
|
244
|
-
if (typeof
|
|
245
|
-
var u =
|
|
243
|
+
var o = function(a, l) {
|
|
244
|
+
if (typeof a != "object" || !a) return a;
|
|
245
|
+
var u = a[Symbol.toPrimitive];
|
|
246
246
|
if (u !== void 0) {
|
|
247
|
-
var i = u.call(
|
|
247
|
+
var i = u.call(a, l);
|
|
248
248
|
if (typeof i != "object") return i;
|
|
249
249
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
250
250
|
}
|
|
251
|
-
return (l === "string" ? String : Number)(
|
|
251
|
+
return (l === "string" ? String : Number)(a);
|
|
252
252
|
}(r, "string");
|
|
253
|
-
return typeof
|
|
253
|
+
return typeof o == "symbol" ? o : o + "";
|
|
254
254
|
}(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
|
|
255
255
|
}
|
|
256
256
|
function z(e) {
|
|
@@ -276,8 +276,8 @@ function de(e, t) {
|
|
|
276
276
|
var n = Object.keys(e);
|
|
277
277
|
if (Object.getOwnPropertySymbols) {
|
|
278
278
|
var r = Object.getOwnPropertySymbols(e);
|
|
279
|
-
t && (r = r.filter(function(
|
|
280
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
279
|
+
t && (r = r.filter(function(o) {
|
|
280
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
281
281
|
})), n.push.apply(n, r);
|
|
282
282
|
}
|
|
283
283
|
return n;
|
|
@@ -295,7 +295,7 @@ function ve(e) {
|
|
|
295
295
|
}
|
|
296
296
|
function tt(e, t) {
|
|
297
297
|
if (e == null) return {};
|
|
298
|
-
var n, r,
|
|
298
|
+
var n, r, o = function(l, u) {
|
|
299
299
|
if (l == null) return {};
|
|
300
300
|
var i = {};
|
|
301
301
|
for (var c in l) if ({}.hasOwnProperty.call(l, c)) {
|
|
@@ -305,10 +305,10 @@ function tt(e, t) {
|
|
|
305
305
|
return i;
|
|
306
306
|
}(e, t);
|
|
307
307
|
if (Object.getOwnPropertySymbols) {
|
|
308
|
-
var
|
|
309
|
-
for (r = 0; r <
|
|
308
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
309
|
+
for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
|
|
310
310
|
}
|
|
311
|
-
return
|
|
311
|
+
return o;
|
|
312
312
|
}
|
|
313
313
|
function H(e, t) {
|
|
314
314
|
return H = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
@@ -318,11 +318,11 @@ function H(e, t) {
|
|
|
318
318
|
function re(e) {
|
|
319
319
|
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
320
320
|
return re = function(n) {
|
|
321
|
-
if (n === null || !function(
|
|
321
|
+
if (n === null || !function(o) {
|
|
322
322
|
try {
|
|
323
|
-
return Function.toString.call(
|
|
323
|
+
return Function.toString.call(o).indexOf("[native code]") !== -1;
|
|
324
324
|
} catch {
|
|
325
|
-
return typeof
|
|
325
|
+
return typeof o == "function";
|
|
326
326
|
}
|
|
327
327
|
}(n)) return n;
|
|
328
328
|
if (typeof n != "function") throw new TypeError("Super expression must either be null or a function");
|
|
@@ -331,11 +331,11 @@ function re(e) {
|
|
|
331
331
|
t.set(n, r);
|
|
332
332
|
}
|
|
333
333
|
function r() {
|
|
334
|
-
return function(
|
|
334
|
+
return function(o, a, l) {
|
|
335
335
|
if (ae()) return Reflect.construct.apply(null, arguments);
|
|
336
336
|
var u = [null];
|
|
337
|
-
u.push.apply(u,
|
|
338
|
-
var i = new (
|
|
337
|
+
u.push.apply(u, a);
|
|
338
|
+
var i = new (o.bind.apply(o, u))();
|
|
339
339
|
return l && H(i, l.prototype), i;
|
|
340
340
|
}(n, arguments, z(this).constructor);
|
|
341
341
|
}
|
|
@@ -351,50 +351,50 @@ var $ = function(e) {
|
|
|
351
351
|
}(re(Error)), me, nt = ["options"], he = ["text", "email", "tel", "search", "url"], Ee = Me(function e(t) {
|
|
352
352
|
var n = t.init, r = t.tracking;
|
|
353
353
|
Pe(this, e);
|
|
354
|
-
var
|
|
355
|
-
this.register = function(
|
|
354
|
+
var o = /* @__PURE__ */ new WeakMap();
|
|
355
|
+
this.register = function(a) {
|
|
356
356
|
var l;
|
|
357
|
-
if (he.includes(
|
|
358
|
-
var u = (l =
|
|
359
|
-
Object.defineProperty(
|
|
360
|
-
var
|
|
361
|
-
|
|
362
|
-
} })),
|
|
363
|
-
var
|
|
364
|
-
var
|
|
365
|
-
var
|
|
366
|
-
|
|
357
|
+
if (he.includes(a.type)) {
|
|
358
|
+
var u = (l = a._wrapperState) !== null && l !== void 0 ? l : {}, i = u.initialValue, c = i === void 0 ? "" : i, p = u.controlled, f = p !== void 0 && p, b = n({ initialValue: a.value || c, controlled: f }), M = b.value, j = b.options, h = { value: M, options: j, fallbackOptions: j }, v = { id: -1, cachedId: -1 }, s = { value: "", selectionStart: 0, selectionEnd: 0 }, O = Object.getOwnPropertyDescriptor("_valueTracker" in a ? a : HTMLInputElement.prototype, "value");
|
|
359
|
+
Object.defineProperty(a, "value", ve(ve({}, O), {}, { set: function(y) {
|
|
360
|
+
var m;
|
|
361
|
+
s.value = y, O == null || (m = O.set) === null || m === void 0 || m.call(a, y);
|
|
362
|
+
} })), a.value = M;
|
|
363
|
+
var S = function() {
|
|
364
|
+
var y = function() {
|
|
365
|
+
var m, k;
|
|
366
|
+
s.selectionStart = (m = a.selectionStart) !== null && m !== void 0 ? m : 0, s.selectionEnd = (k = a.selectionEnd) !== null && k !== void 0 ? k : 0, v.id = window.setTimeout(y);
|
|
367
367
|
};
|
|
368
|
-
|
|
369
|
-
},
|
|
370
|
-
window.clearTimeout(
|
|
371
|
-
},
|
|
368
|
+
v.id = window.setTimeout(y);
|
|
369
|
+
}, w = function() {
|
|
370
|
+
window.clearTimeout(v.id), v.id = -1, v.cachedId = -1;
|
|
371
|
+
}, d = function(y) {
|
|
372
372
|
try {
|
|
373
|
-
var
|
|
374
|
-
if (
|
|
375
|
-
|
|
376
|
-
var
|
|
377
|
-
if (
|
|
378
|
-
var
|
|
379
|
-
if (
|
|
380
|
-
var I = "", N =
|
|
381
|
-
if (
|
|
373
|
+
var m, k;
|
|
374
|
+
if (v.cachedId === v.id) throw new $("The input selection has not been updated.");
|
|
375
|
+
v.cachedId = v.id;
|
|
376
|
+
var P = a.value, g = a.selectionStart, T = a.selectionEnd;
|
|
377
|
+
if (g === null || T === null) throw new $("The selection attributes have not been initialized.");
|
|
378
|
+
var C, E = s.value;
|
|
379
|
+
if (y.inputType === void 0 && (s.selectionStart = 0, s.selectionEnd = E.length), g > s.selectionStart ? C = "insert" : g <= s.selectionStart && g < s.selectionEnd ? C = "deleteBackward" : g === s.selectionEnd && P.length < E.length && (C = "deleteForward"), C === void 0 || (C === "deleteBackward" || C === "deleteForward") && P.length > E.length) throw new $("Input type detection error.");
|
|
380
|
+
var I = "", N = s.selectionStart, B = s.selectionEnd;
|
|
381
|
+
if (C === "insert") I = P.slice(s.selectionStart, g);
|
|
382
382
|
else {
|
|
383
|
-
var D =
|
|
384
|
-
N =
|
|
383
|
+
var D = E.length - P.length;
|
|
384
|
+
N = g, B = g + D;
|
|
385
385
|
}
|
|
386
|
-
|
|
387
|
-
var F =
|
|
388
|
-
|
|
386
|
+
h.value !== E ? h.options = h.fallbackOptions : h.fallbackOptions = h.options;
|
|
387
|
+
var F = h.options, R = r({ inputType: C, previousValue: E, previousOptions: F, value: P, addedValue: I, changeStart: N, changeEnd: B, selectionStart: g, selectionEnd: T }), _ = R.options, A = tt(R, nt);
|
|
388
|
+
a.value = A.value, a.setSelectionRange(A.selectionStart, A.selectionEnd), h.value = A.value, h.options = _, s.selectionStart = A.selectionStart, s.selectionEnd = A.selectionEnd, (m = a._valueTracker) === null || m === void 0 || (k = m.setValue) === null || k === void 0 || k.call(m, E);
|
|
389
389
|
} catch (W) {
|
|
390
|
-
if (
|
|
390
|
+
if (a.value = s.value, a.setSelectionRange(s.selectionStart, s.selectionEnd), y.preventDefault(), y.stopPropagation(), W.name !== "SyntheticChangeError") throw W;
|
|
391
391
|
}
|
|
392
392
|
};
|
|
393
|
-
document.activeElement ===
|
|
393
|
+
document.activeElement === a && S(), a.addEventListener("focus", S), a.addEventListener("blur", w), a.addEventListener("input", d), o.set(a, { onFocus: S, onBlur: w, onInput: d });
|
|
394
394
|
} else process.env.NODE_ENV !== "production" && console.warn("Warn: The input element type does not match one of the types: ".concat(he.join(", "), "."));
|
|
395
|
-
}, this.unregister = function(
|
|
396
|
-
var l =
|
|
397
|
-
l !== void 0 && (
|
|
395
|
+
}, this.unregister = function(a) {
|
|
396
|
+
var l = o.get(a);
|
|
397
|
+
l !== void 0 && (a.removeEventListener("focus", l.onFocus), a.removeEventListener("blur", l.onBlur), a.removeEventListener("input", l.onInput), o.delete(a));
|
|
398
398
|
};
|
|
399
399
|
});
|
|
400
400
|
me = Ee, Object.defineProperty(me.prototype, Symbol.toStringTag, { writable: !1, enumerable: !1, configurable: !0, value: "Input" });
|
|
@@ -408,44 +408,44 @@ var X = function(e) {
|
|
|
408
408
|
};
|
|
409
409
|
}, ye, rt = ["track", "modify"];
|
|
410
410
|
function x(e) {
|
|
411
|
-
var t, n, r,
|
|
412
|
-
return { mask: (t = e.mask) !== null && t !== void 0 ? t : "", replacement: typeof e.replacement == "string" ? K(e.replacement) : (n = e.replacement) !== null && n !== void 0 ? n : {}, showMask: (r = e.showMask) !== null && r !== void 0 && r, separate: (
|
|
411
|
+
var t, n, r, o;
|
|
412
|
+
return { mask: (t = e.mask) !== null && t !== void 0 ? t : "", replacement: typeof e.replacement == "string" ? K(e.replacement) : (n = e.replacement) !== null && n !== void 0 ? n : {}, showMask: (r = e.showMask) !== null && r !== void 0 && r, separate: (o = e.separate) !== null && o !== void 0 && o, track: e.track, modify: e.modify };
|
|
413
413
|
}
|
|
414
414
|
var Ce = function(e) {
|
|
415
415
|
function t() {
|
|
416
416
|
var n, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
417
|
-
return $e(this, t), (n = Ue(this, t, [{ init: function(
|
|
418
|
-
var
|
|
419
|
-
return
|
|
420
|
-
var
|
|
421
|
-
|
|
422
|
-
var
|
|
423
|
-
return
|
|
417
|
+
return $e(this, t), (n = Ue(this, t, [{ init: function(o) {
|
|
418
|
+
var a = o.initialValue, l = o.controlled, u = x(r), i = u.mask, c = u.replacement, p = u.separate, f = u.showMask;
|
|
419
|
+
return a = l || a ? a : f ? i : "", process.env.NODE_ENV !== "production" && function(b) {
|
|
420
|
+
var M = b.initialValue, j = b.mask, h = b.replacement;
|
|
421
|
+
M.length > j.length && console.error(X(Error)("The initialized value of the `value` or `defaultValue` property is longer than the value specified in the `mask` property. Check the correctness of the initialized value in the specified property.", 'Invalid value: "'.concat(M, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
422
|
+
var v = Object.keys(h).filter(function(d) {
|
|
423
|
+
return d.length > 1;
|
|
424
424
|
});
|
|
425
|
-
|
|
426
|
-
for (var
|
|
427
|
-
var
|
|
428
|
-
if (!(
|
|
429
|
-
|
|
425
|
+
v.length > 0 && console.error(X(Error)("Object keys in the `replacement` property are longer than one character. Replacement keys must be one character long. Check the correctness of the value in the specified property.", "Invalid keys: ".concat(v.join(", "), "."), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
426
|
+
for (var s = j.slice(0, M.length), O = -1, S = 0; S < s.length; S++) {
|
|
427
|
+
var w = Object.prototype.hasOwnProperty.call(h, s[S]);
|
|
428
|
+
if (!(s[S] === M[S] || w && h[s[S]].test(M[S]))) {
|
|
429
|
+
O = S;
|
|
430
430
|
break;
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
|
-
|
|
434
|
-
}({ initialValue:
|
|
435
|
-
}, tracking: function(
|
|
436
|
-
var
|
|
437
|
-
if (
|
|
438
|
-
|
|
439
|
-
var
|
|
440
|
-
|
|
441
|
-
var
|
|
442
|
-
if (
|
|
443
|
-
if (
|
|
444
|
-
var
|
|
445
|
-
|
|
433
|
+
O !== -1 && console.error(X(Error)("An invalid character was found in the initialized property value `value` or `defaultValue` (index: ".concat(O, "). Check the correctness of the initialized value in the specified property."), 'Invalid value: "'.concat(M, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
434
|
+
}({ initialValue: a, mask: i, replacement: c }), { value: a, options: { mask: i, replacement: c, separate: p } };
|
|
435
|
+
}, tracking: function(o) {
|
|
436
|
+
var a = o.inputType, l = o.previousValue, u = o.previousOptions, i = o.addedValue, c = o.changeStart, p = o.changeEnd, f = x(r), b = f.track, M = f.modify, j = _e(f, rt), h = j.mask, v = j.replacement, s = j.showMask, O = j.separate, S = J(J({}, a === "insert" ? { inputType: a, data: i } : { inputType: a, data: null }), {}, { value: l, selectionStart: c, selectionEnd: p }), w = b?.(S);
|
|
437
|
+
if (w === !1) throw new $("Custom tracking stop.");
|
|
438
|
+
w === null ? i = "" : w !== !0 && w !== void 0 && (i = w);
|
|
439
|
+
var d = M?.(S);
|
|
440
|
+
d?.mask !== void 0 && (h = d.mask), d?.replacement !== void 0 && (v = typeof d?.replacement == "string" ? K(d?.replacement) : d.replacement), d?.showMask !== void 0 && (s = d.showMask), d?.separate !== void 0 && (O = d.separate);
|
|
441
|
+
var y = ne(l, J({ end: c }, u)), m = ne(l, J({ start: p }, u)), k = RegExp("[^".concat(Object.keys(v).join(""), "]"), "g"), P = h.replace(k, "");
|
|
442
|
+
if (y && (y = U(y, { replacementChars: P, replacement: v, separate: O }), P = P.slice(y.length)), i && (i = U(i, { replacementChars: P, replacement: v, separate: !1 }), P = P.slice(i.length)), a === "insert" && i === "") throw new $("The character does not match the key value of the `replacement` object.");
|
|
443
|
+
if (O) {
|
|
444
|
+
var g = h.slice(c, p).replace(k, ""), T = g.length - i.length;
|
|
445
|
+
T < 0 ? m = m.slice(-T) : T > 0 && (m = g.slice(-T) + m);
|
|
446
446
|
}
|
|
447
|
-
|
|
448
|
-
var
|
|
447
|
+
m && (m = U(m, { replacementChars: P, replacement: v, separate: O }));
|
|
448
|
+
var C = Se(y + i + m, { mask: h, replacement: v, separate: O, showMask: s }), E = function(I) {
|
|
449
449
|
var N, B, D, F = I.inputType, R = I.value, _ = I.addedValue, A = I.beforeChangeValue, W = I.mask, oe = I.replacement, je = I.separate, Q = we(R, { mask: W, replacement: oe }).filter(function(q) {
|
|
450
450
|
var ue = q.type;
|
|
451
451
|
return ue === "input" || je && ue === "replacement";
|
|
@@ -467,24 +467,24 @@ var Ce = function(e) {
|
|
|
467
467
|
return Object.prototype.hasOwnProperty.call(oe, q);
|
|
468
468
|
});
|
|
469
469
|
return le !== -1 ? le : R.length;
|
|
470
|
-
}({ inputType:
|
|
471
|
-
return { value:
|
|
472
|
-
} }])).format = function(
|
|
473
|
-
return ke(
|
|
474
|
-
}, n.formatToParts = function(
|
|
475
|
-
return Ze(
|
|
476
|
-
}, n.unformat = function(
|
|
477
|
-
return We(
|
|
478
|
-
}, n.generatePattern = function(
|
|
479
|
-
return Ye(
|
|
470
|
+
}({ inputType: a, value: C, addedValue: i, beforeChangeValue: y, mask: h, replacement: v, separate: O });
|
|
471
|
+
return { value: C, selectionStart: E, selectionEnd: E, options: { mask: h, replacement: v, separate: O } };
|
|
472
|
+
} }])).format = function(o) {
|
|
473
|
+
return ke(o, x(r));
|
|
474
|
+
}, n.formatToParts = function(o) {
|
|
475
|
+
return Ze(o, x(r));
|
|
476
|
+
}, n.unformat = function(o) {
|
|
477
|
+
return We(o, x(r));
|
|
478
|
+
}, n.generatePattern = function(o) {
|
|
479
|
+
return Ye(o, x(r));
|
|
480
480
|
}, n;
|
|
481
481
|
}
|
|
482
482
|
return He(t, Ee), ze(t);
|
|
483
483
|
}();
|
|
484
484
|
ye = Ce, Object.defineProperty(ye.prototype, Symbol.toStringTag, { writable: !1, enumerable: !1, configurable: !0, value: "Mask" });
|
|
485
485
|
function at() {
|
|
486
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.mask, n = e.replacement, r = e.showMask,
|
|
487
|
-
return i.current.mask = t, i.current.replacement = n, i.current.showMask = r, i.current.separate =
|
|
486
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.mask, n = e.replacement, r = e.showMask, o = e.separate, a = e.track, l = e.modify, u = ee(null), i = ee({ mask: t, replacement: n, showMask: r, separate: o, track: a, modify: l });
|
|
487
|
+
return i.current.mask = t, i.current.replacement = n, i.current.showMask = r, i.current.separate = o, i.current.track = a, i.current.modify = l, Ie(function() {
|
|
488
488
|
return Qe(u, new Ce(i.current));
|
|
489
489
|
}, []);
|
|
490
490
|
}
|
|
@@ -496,79 +496,81 @@ Te.registerLocale(lt);
|
|
|
496
496
|
const gt = Ae(
|
|
497
497
|
({
|
|
498
498
|
disabled: e = !1,
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
499
|
+
error: t,
|
|
500
|
+
helperText: n,
|
|
501
|
+
helperTextClassName: r,
|
|
502
|
+
isRequired: o,
|
|
503
|
+
label: a,
|
|
504
|
+
labelClassName: l,
|
|
505
|
+
name: u,
|
|
506
|
+
placeholder: i,
|
|
507
|
+
showFlagOnSearch: c = !0,
|
|
508
|
+
showInputFilter: p = !0,
|
|
509
|
+
showNameOnSearch: f = !0,
|
|
510
|
+
wrapperClassName: b,
|
|
511
|
+
showPlaceHolder: M,
|
|
512
|
+
...j
|
|
513
|
+
}, h) => {
|
|
514
|
+
const v = u ?? Ne(), s = ee(null), {
|
|
515
|
+
isOpenSelector: O,
|
|
516
|
+
value: S,
|
|
517
|
+
selectedCountry: w,
|
|
518
|
+
onChangeValue: d,
|
|
519
|
+
handleOpenSelector: y
|
|
520
|
+
} = xe(), m = typeof t == "string" && t.length >= 0, k = at({
|
|
521
|
+
mask: Ke(w),
|
|
520
522
|
replacement: { _: /\d/ }
|
|
521
523
|
});
|
|
522
|
-
Be(
|
|
523
|
-
const
|
|
524
|
-
(
|
|
525
|
-
|
|
524
|
+
Be(h, () => k.current, [k]);
|
|
525
|
+
const P = Re(
|
|
526
|
+
(g) => {
|
|
527
|
+
g.target.value.startsWith(w.prefix) ? d(g.target.value) : d(`${w.prefix} `);
|
|
526
528
|
},
|
|
527
|
-
[
|
|
529
|
+
[w.prefix, d]
|
|
528
530
|
);
|
|
529
531
|
return ce(() => {
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
},
|
|
533
|
-
|
|
532
|
+
const g = new AbortController(), T = (E) => {
|
|
533
|
+
E.key === "Escape" && y(!1);
|
|
534
|
+
}, C = (E) => {
|
|
535
|
+
s.current?.contains(E.target) || y(!1);
|
|
534
536
|
};
|
|
535
|
-
return document.addEventListener("keydown",
|
|
536
|
-
signal:
|
|
537
|
-
}), document.addEventListener("mousedown",
|
|
538
|
-
signal:
|
|
537
|
+
return document.addEventListener("keydown", T, {
|
|
538
|
+
signal: g.signal
|
|
539
|
+
}), document.addEventListener("mousedown", C, {
|
|
540
|
+
signal: g.signal
|
|
539
541
|
}), document.addEventListener(
|
|
540
542
|
"visibilitychange",
|
|
541
543
|
() => {
|
|
542
|
-
document.hidden &&
|
|
544
|
+
document.hidden && y(!1);
|
|
543
545
|
},
|
|
544
546
|
{
|
|
545
|
-
signal:
|
|
547
|
+
signal: g.signal
|
|
546
548
|
}
|
|
547
549
|
), () => {
|
|
548
|
-
|
|
550
|
+
g.abort();
|
|
549
551
|
};
|
|
550
|
-
}, [
|
|
551
|
-
|
|
552
|
-
}, [
|
|
553
|
-
|
|
552
|
+
}, [y, s]), ce(() => {
|
|
553
|
+
k.current && (k.current.value = w.prefix + " ");
|
|
554
|
+
}, [w.code]), /* @__PURE__ */ Z("div", { className: "w-full flex flex-col gap-2", children: [
|
|
555
|
+
a ? /* @__PURE__ */ Z(
|
|
554
556
|
"label",
|
|
555
557
|
{
|
|
556
|
-
id:
|
|
557
|
-
className: Le({ className:
|
|
558
|
-
onClick: () => !e &&
|
|
558
|
+
id: v,
|
|
559
|
+
className: Le({ className: l }),
|
|
560
|
+
onClick: () => !e && k.current?.focus(),
|
|
559
561
|
children: [
|
|
560
|
-
|
|
561
|
-
|
|
562
|
+
a,
|
|
563
|
+
o && /* @__PURE__ */ V("span", { className: "text-red-600 ml-1", children: "*" })
|
|
562
564
|
]
|
|
563
565
|
}
|
|
564
566
|
) : null,
|
|
565
567
|
/* @__PURE__ */ Z(
|
|
566
568
|
"div",
|
|
567
569
|
{
|
|
568
|
-
ref:
|
|
569
|
-
"data-state":
|
|
570
|
+
ref: s,
|
|
571
|
+
"data-state": O ? "open" : "closed",
|
|
570
572
|
className: Ve({
|
|
571
|
-
className:
|
|
573
|
+
className: b,
|
|
572
574
|
variant: m ? "error" : "default"
|
|
573
575
|
}),
|
|
574
576
|
children: [
|
|
@@ -577,40 +579,42 @@ const gt = Ae(
|
|
|
577
579
|
/* @__PURE__ */ V(
|
|
578
580
|
"input",
|
|
579
581
|
{
|
|
580
|
-
id:
|
|
581
|
-
ref:
|
|
582
|
-
name:
|
|
582
|
+
id: a ? v : void 0,
|
|
583
|
+
ref: k,
|
|
584
|
+
name: u,
|
|
583
585
|
autoComplete: "off",
|
|
584
586
|
className: "outline-0 w-full caret-slate-800 text-slate-800 bg-transparent dark:caret-slate-50 dark:text-slate-50 disabled:cursor-not-allowed disabled:opacity-50",
|
|
585
587
|
type: "tel",
|
|
586
588
|
inputMode: "tel",
|
|
587
|
-
value:
|
|
588
|
-
onChange:
|
|
589
|
+
value: S,
|
|
590
|
+
onChange: P,
|
|
589
591
|
disabled: e,
|
|
590
|
-
...
|
|
592
|
+
...j
|
|
591
593
|
}
|
|
592
594
|
)
|
|
593
595
|
] }),
|
|
594
|
-
|
|
596
|
+
O && /* @__PURE__ */ V(
|
|
595
597
|
Fe,
|
|
596
598
|
{
|
|
597
|
-
|
|
598
|
-
showFlagOnSearch:
|
|
599
|
-
showInputFilter:
|
|
599
|
+
placeholder: i,
|
|
600
|
+
showFlagOnSearch: c,
|
|
601
|
+
showInputFilter: p,
|
|
602
|
+
showNameOnSearch: f,
|
|
603
|
+
showPlaceHolder: M
|
|
600
604
|
}
|
|
601
605
|
)
|
|
602
606
|
]
|
|
603
607
|
}
|
|
604
608
|
),
|
|
605
|
-
|
|
606
|
-
!
|
|
609
|
+
t ? /* @__PURE__ */ V("span", { className: "text-xs text-red-700 dark:text-red-500", children: t }) : null,
|
|
610
|
+
!t && n ? /* @__PURE__ */ V(
|
|
607
611
|
"span",
|
|
608
612
|
{
|
|
609
613
|
className: Ge(
|
|
610
614
|
"text-xs text-slate-600 dark:text-slate-200 kubefirst-dark:text-slate-200",
|
|
611
|
-
|
|
615
|
+
r
|
|
612
616
|
),
|
|
613
|
-
children:
|
|
617
|
+
children: n
|
|
614
618
|
}
|
|
615
619
|
) : null
|
|
616
620
|
] });
|
package/dist/components/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { DropdownButton as h } from "./DropdownButton/DropdownButton.js";
|
|
|
13
13
|
import { Filter as P } from "./Filter/Filter.js";
|
|
14
14
|
import { Input as w } from "./Input/Input.js";
|
|
15
15
|
import { Loading as k } from "./Loading/Loading.js";
|
|
16
|
-
import { M as G } from "../Modal-
|
|
16
|
+
import { M as G } from "../Modal-5xSxFoaD.js";
|
|
17
17
|
import { NumberInput as L } from "./NumberInput/NumberInput.js";
|
|
18
18
|
import { PhoneNumberInput as y } from "./PhoneNumberInput/PhoneNumberInput.js";
|
|
19
19
|
import { PieChart as O } from "./PieChart/PieChart.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -365,6 +365,7 @@ declare interface ModalProps extends PropsWithChildren, VariantProps<typeof moda
|
|
|
365
365
|
className?: string;
|
|
366
366
|
container?: Element | DocumentFragment;
|
|
367
367
|
isOpen?: boolean;
|
|
368
|
+
showCloseButton?: boolean;
|
|
368
369
|
theme?: Theme;
|
|
369
370
|
onClose?: () => void;
|
|
370
371
|
}
|
|
@@ -519,19 +520,21 @@ declare type Props = {
|
|
|
519
520
|
};
|
|
520
521
|
|
|
521
522
|
declare type Props_2 = InputHTMLAttributes<HTMLInputElement> & {
|
|
522
|
-
name?: string;
|
|
523
|
-
label?: string;
|
|
524
|
-
isRequired?: boolean;
|
|
525
|
-
wrapperClassName?: string;
|
|
526
523
|
defaultCountryCode?: RegionCode;
|
|
527
|
-
showNameOnSearch?: boolean;
|
|
528
|
-
showFlagOnSearch?: boolean;
|
|
529
|
-
showInputFilter?: boolean;
|
|
530
524
|
disabled?: boolean;
|
|
531
|
-
|
|
525
|
+
error?: string;
|
|
532
526
|
helperText?: string;
|
|
533
527
|
helperTextClassName?: string;
|
|
534
|
-
|
|
528
|
+
isRequired?: boolean;
|
|
529
|
+
label?: string;
|
|
530
|
+
labelClassName?: string;
|
|
531
|
+
name?: string;
|
|
532
|
+
placeholder?: string;
|
|
533
|
+
showFlagOnSearch?: boolean;
|
|
534
|
+
showInputFilter?: boolean;
|
|
535
|
+
showNameOnSearch?: boolean;
|
|
536
|
+
showPlaceHolder?: boolean;
|
|
537
|
+
wrapperClassName?: string;
|
|
535
538
|
};
|
|
536
539
|
|
|
537
540
|
/**
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import { BadgeMultiSelect as k } from "./components/Filter/components/BadgeDropd
|
|
|
16
16
|
import { DateFilterDropdown as G } from "./components/Filter/components/DateFilterDropdown/DateFilterDropdown.js";
|
|
17
17
|
import { Input as L } from "./components/Input/Input.js";
|
|
18
18
|
import { Loading as y } from "./components/Loading/Loading.js";
|
|
19
|
-
import { M as O } from "./Modal-
|
|
19
|
+
import { M as O } from "./Modal-5xSxFoaD.js";
|
|
20
20
|
import { NumberInput as j } from "./components/NumberInput/NumberInput.js";
|
|
21
21
|
import { PhoneNumberInput as E } from "./components/PhoneNumberInput/PhoneNumberInput.js";
|
|
22
22
|
import { PieChart as J } from "./components/PieChart/PieChart.js";
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.2-alpha.
|
|
5
|
+
"version": "0.1.2-alpha.29",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.2-alpha.
|
|
5
|
+
"version": "0.1.2-alpha.30",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
package/dist/Modal-Dpk-1N9W.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Body as b } from "./components/Modal/components/Body/Body.js";
|
|
2
|
-
import { Footer as g } from "./components/Modal/components/Footer/Footer.js";
|
|
3
|
-
import { Header as v } from "./components/Modal/components/Header/Header.js";
|
|
4
|
-
import { jsx as n, jsxs as f } from "react/jsx-runtime";
|
|
5
|
-
import { Children as i, isValidElement as s, useEffect as w } from "react";
|
|
6
|
-
import { createPortal as A } from "react-dom";
|
|
7
|
-
import { R as N } from "./index-DrWQH0QF.js";
|
|
8
|
-
import { R } from "./Combination-VYaRRJBZ.js";
|
|
9
|
-
import { cn as p } from "./utils/index.js";
|
|
10
|
-
import { buttonCloseVariants as k, modalVariants as x } from "./components/Modal/components/Wrapper/Wrapper.variants.js";
|
|
11
|
-
import { X as B } from "./x-DPU9OdYH.js";
|
|
12
|
-
const E = ({
|
|
13
|
-
children: e,
|
|
14
|
-
theme: t,
|
|
15
|
-
className: m,
|
|
16
|
-
buttonCloseClassName: d,
|
|
17
|
-
onClose: a
|
|
18
|
-
}) => {
|
|
19
|
-
const l = i.toArray(e).find(
|
|
20
|
-
(o) => s(o) && o.type === r.Header
|
|
21
|
-
), c = i.toArray(e).find(
|
|
22
|
-
(o) => s(o) && o.type === r.Body
|
|
23
|
-
), y = i.toArray(e).find(
|
|
24
|
-
(o) => s(o) && o.type === r.Footer
|
|
25
|
-
), u = i.toArray(e).filter(
|
|
26
|
-
(o) => !s(o) || ![r.Header, r.Body, r.Footer].includes(
|
|
27
|
-
o.type
|
|
28
|
-
)
|
|
29
|
-
);
|
|
30
|
-
return /* @__PURE__ */ n(R, { children: /* @__PURE__ */ f(
|
|
31
|
-
"div",
|
|
32
|
-
{
|
|
33
|
-
className: "fixed inset-0 grid place-content-center",
|
|
34
|
-
"data-theme": t,
|
|
35
|
-
children: [
|
|
36
|
-
/* @__PURE__ */ n(
|
|
37
|
-
"div",
|
|
38
|
-
{
|
|
39
|
-
className: "absolute inset-0 bg-black opacity-75 animate-in fade-in-0",
|
|
40
|
-
onClick: a,
|
|
41
|
-
role: "presentation"
|
|
42
|
-
}
|
|
43
|
-
),
|
|
44
|
-
/* @__PURE__ */ f(
|
|
45
|
-
"div",
|
|
46
|
-
{
|
|
47
|
-
className: p(
|
|
48
|
-
x({
|
|
49
|
-
className: m
|
|
50
|
-
})
|
|
51
|
-
),
|
|
52
|
-
role: "dialog",
|
|
53
|
-
"aria-modal": "true",
|
|
54
|
-
children: [
|
|
55
|
-
l,
|
|
56
|
-
/* @__PURE__ */ f(
|
|
57
|
-
"button",
|
|
58
|
-
{
|
|
59
|
-
className: p(
|
|
60
|
-
k({
|
|
61
|
-
className: d
|
|
62
|
-
})
|
|
63
|
-
),
|
|
64
|
-
onClick: a,
|
|
65
|
-
children: [
|
|
66
|
-
/* @__PURE__ */ n(B, {}),
|
|
67
|
-
/* @__PURE__ */ n(N, { children: "Dismiss modal" })
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
),
|
|
71
|
-
c ?? u,
|
|
72
|
-
y
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
) });
|
|
79
|
-
}, r = ({ isOpen: e, onClose: t, container: m, ...d }) => (w(() => {
|
|
80
|
-
const a = new AbortController(), l = (c) => {
|
|
81
|
-
c.code === "Escape" && t?.();
|
|
82
|
-
};
|
|
83
|
-
return window.addEventListener("keydown", l, {
|
|
84
|
-
signal: a.signal
|
|
85
|
-
}), () => {
|
|
86
|
-
a.abort();
|
|
87
|
-
};
|
|
88
|
-
}, [t]), e ? A(
|
|
89
|
-
/* @__PURE__ */ n(E, { ...d, onClose: t }),
|
|
90
|
-
m || document.body
|
|
91
|
-
) : null);
|
|
92
|
-
r.Header = v;
|
|
93
|
-
r.Body = b;
|
|
94
|
-
r.Footer = g;
|
|
95
|
-
export {
|
|
96
|
-
r as M,
|
|
97
|
-
E as W
|
|
98
|
-
};
|