@konstructio/ui 0.1.2-alpha.47 → 0.1.2-alpha.49
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/assets/icons/index.js +7 -0
- package/dist/components/Badge/Badge.js +36 -35
- package/dist/components/Counter/Counter.js +23 -23
- package/dist/components/ImageUpload/ImageUpload.js +8 -8
- package/dist/components/Input/Input.js +185 -118
- package/dist/components/Input/Input.variants.js +16 -20
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +19 -19
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +11 -15
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +18 -26
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +8 -8
- package/dist/components/MultiSelectDropdown/components/List/List.js +12 -19
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +6 -4
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +79 -65
- package/dist/components/PhoneNumberInput/components/Wrapper.js +43 -36
- package/dist/components/RadioGroup/RadioGroup.js +9 -9
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Typography/Typography.variants.js +6 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +14 -14
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +20 -16
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +60 -60
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +8 -8
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +32 -21
- package/dist/components/VirtualizedTable/components/Header/Header.js +15 -15
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +8 -8
- package/dist/index.d.ts +1875 -10
- package/dist/package.json +4 -4
- package/dist/styles.css +1 -1
- package/package.json +4 -4
|
@@ -1,36 +1,29 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { cn as m } from "../../../../utils/index.js";
|
|
3
|
-
import { Item as
|
|
4
|
-
import {
|
|
5
|
-
import { useMultiSelectDropdown as c } from "../../contexts/MultiSelectDropdown.hook.js";
|
|
3
|
+
import { Item as t } from "../Item/Item.js";
|
|
4
|
+
import { listVariants as c } from "./List.variants.js";
|
|
6
5
|
import { Typography as d } from "../../../Typography/Typography.js";
|
|
6
|
+
import { useMultiSelectDropdown as p } from "../../contexts/MultiSelectDropdown.hook.js";
|
|
7
7
|
const y = ({ theme: s }) => {
|
|
8
|
-
const { options:
|
|
9
|
-
return /* @__PURE__ */ e("ul", { role: "listbox", "data-theme": s, className: m(
|
|
10
|
-
|
|
8
|
+
const { options: i, selectedOptions: n, isLoading: l, noOptionsText: r } = p();
|
|
9
|
+
return /* @__PURE__ */ e("ul", { role: "listbox", "data-theme": s, className: m(c()), children: l ? /* @__PURE__ */ e(
|
|
10
|
+
t,
|
|
11
11
|
{
|
|
12
12
|
option: { id: "loading", label: "Loading..." },
|
|
13
13
|
className: "select-none pointer-events-none",
|
|
14
14
|
isSelected: !1
|
|
15
15
|
},
|
|
16
16
|
"loading"
|
|
17
|
-
) :
|
|
18
|
-
|
|
17
|
+
) : i.length > 0 ? i.map((o) => /* @__PURE__ */ e(
|
|
18
|
+
t,
|
|
19
19
|
{
|
|
20
|
-
option:
|
|
20
|
+
option: o,
|
|
21
21
|
isSelected: n.some(
|
|
22
|
-
(
|
|
22
|
+
(a) => a.id === o.id
|
|
23
23
|
)
|
|
24
24
|
},
|
|
25
|
-
|
|
26
|
-
)) : /* @__PURE__ */ e("li", { className: "select-none", children: /* @__PURE__ */ e(
|
|
27
|
-
d,
|
|
28
|
-
{
|
|
29
|
-
variant: "body2",
|
|
30
|
-
className: "text-zinc-800 dark:text-slate-50 italic px-2 py-2",
|
|
31
|
-
children: a ?? "No options"
|
|
32
|
-
}
|
|
33
|
-
) }) });
|
|
25
|
+
o.id
|
|
26
|
+
)) : /* @__PURE__ */ e("li", { className: "select-none", children: /* @__PURE__ */ e(d, { variant: "body2", className: "italic px-2 py-2", children: r ?? "No options" }) }) });
|
|
34
27
|
};
|
|
35
28
|
export {
|
|
36
29
|
y as List
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
const
|
|
1
|
+
import { c as a } from "../../../../index-D29mdTf5.js";
|
|
2
|
+
const o = a([
|
|
3
3
|
"absolute",
|
|
4
4
|
"bg-white",
|
|
5
5
|
"border",
|
|
@@ -16,8 +16,10 @@ const a = o([
|
|
|
16
16
|
"animate-in",
|
|
17
17
|
"fade-in-50",
|
|
18
18
|
"overflow-hidden",
|
|
19
|
-
"border-gray-200"
|
|
19
|
+
"border-gray-200",
|
|
20
|
+
"dark:border-metal-700",
|
|
21
|
+
"dark:bg-metal-800"
|
|
20
22
|
]);
|
|
21
23
|
export {
|
|
22
|
-
|
|
24
|
+
o as listVariants
|
|
23
25
|
};
|
|
@@ -1,82 +1,96 @@
|
|
|
1
1
|
import "../Item/Item.js";
|
|
2
|
-
import { List as
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
import { List as S } from "../List/List.js";
|
|
3
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef as k, useId as O, useImperativeHandle as C } from "react";
|
|
5
|
+
import { S as D } from "../../../../loader-juvMSJ9L.js";
|
|
6
|
+
import { Badge as L } from "../../../Badge/Badge.js";
|
|
7
|
+
import { Typography as p } from "../../../Typography/Typography.js";
|
|
8
|
+
import { cn as a } from "../../../../utils/index.js";
|
|
9
|
+
import { useMultiSelectDropdown as M } from "../../hooks/useMultiSelectDropdown.js";
|
|
10
|
+
import { labelVariants as R, multiSelectDropdownVariants as I, wrapperVariants as V } from "../../MultiSelectDropdown.variants.js";
|
|
11
|
+
import { X as j } from "../../../../x-BXShoIAM.js";
|
|
12
|
+
import { C as W } from "../../../../chevron-up-DEfvgPCw.js";
|
|
13
|
+
import { useMultiSelectDropdown as $ } from "../../contexts/MultiSelectDropdown.hook.js";
|
|
14
|
+
const B = k(
|
|
15
|
+
({
|
|
16
|
+
isRequired: c,
|
|
17
|
+
label: n,
|
|
18
|
+
labelClassName: d,
|
|
19
|
+
name: s,
|
|
20
|
+
placeholder: f = "",
|
|
21
|
+
theme: u,
|
|
22
|
+
wrapperClassName: h
|
|
23
|
+
}, x) => {
|
|
24
|
+
const N = O(), i = s ? `${N}-name` : "id", {
|
|
25
|
+
inputRef: t,
|
|
26
|
+
isLoading: w,
|
|
27
|
+
isOpen: o,
|
|
28
|
+
selectedOptions: m,
|
|
29
|
+
onOpen: g,
|
|
30
|
+
onRemoveOption: v
|
|
31
|
+
} = $(), { wrapperRef: b, handleOpen: y } = M();
|
|
32
|
+
return C(x, () => t.current, [t]), /* @__PURE__ */ l(
|
|
24
33
|
"div",
|
|
25
34
|
{
|
|
26
|
-
ref:
|
|
27
|
-
className:
|
|
28
|
-
|
|
29
|
-
className:
|
|
35
|
+
ref: b,
|
|
36
|
+
className: a(
|
|
37
|
+
V({
|
|
38
|
+
className: h
|
|
30
39
|
})
|
|
31
40
|
),
|
|
32
|
-
"data-theme":
|
|
41
|
+
"data-theme": u,
|
|
33
42
|
children: [
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
n ? /* @__PURE__ */ l(
|
|
44
|
+
p,
|
|
36
45
|
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
component: "label",
|
|
47
|
+
variant: "labelLarge",
|
|
48
|
+
htmlFor: i,
|
|
49
|
+
className: a(
|
|
50
|
+
R({
|
|
51
|
+
className: d
|
|
41
52
|
})
|
|
42
53
|
),
|
|
43
|
-
onClick: () =>
|
|
44
|
-
children:
|
|
54
|
+
onClick: () => g(!0),
|
|
55
|
+
children: [
|
|
56
|
+
n,
|
|
57
|
+
" ",
|
|
58
|
+
c && /* @__PURE__ */ e(
|
|
59
|
+
p,
|
|
60
|
+
{
|
|
61
|
+
component: "span",
|
|
62
|
+
className: "text-red-500 dark:text-red-500 text-sm font-normal",
|
|
63
|
+
children: "*"
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
45
67
|
}
|
|
46
68
|
) : null,
|
|
47
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ l(
|
|
48
70
|
"div",
|
|
49
71
|
{
|
|
50
|
-
id:
|
|
51
|
-
className:
|
|
72
|
+
id: i,
|
|
73
|
+
className: a(I()),
|
|
52
74
|
role: "combobox",
|
|
53
|
-
onClick:
|
|
54
|
-
"aria-expanded":
|
|
75
|
+
onClick: y,
|
|
76
|
+
"aria-expanded": o,
|
|
55
77
|
children: [
|
|
56
|
-
|
|
57
|
-
|
|
78
|
+
m.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: f }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: m.map((r) => /* @__PURE__ */ e(
|
|
79
|
+
L,
|
|
58
80
|
{
|
|
59
|
-
|
|
60
|
-
label:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
rightIcon: /* @__PURE__ */ e(
|
|
64
|
-
j,
|
|
65
|
-
{
|
|
66
|
-
className: "w-2 h-2",
|
|
67
|
-
onClick: () => L(a)
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
"data-value": a.label
|
|
81
|
+
"data-value": r.label,
|
|
82
|
+
label: r.value ?? r.label ?? "",
|
|
83
|
+
className: "select-none",
|
|
84
|
+
rightIcon: /* @__PURE__ */ e(j, { onClick: () => v(r) })
|
|
71
85
|
},
|
|
72
|
-
|
|
86
|
+
r.id
|
|
73
87
|
)) }),
|
|
74
|
-
|
|
75
|
-
|
|
88
|
+
w ? /* @__PURE__ */ e(D, { className: "w-4 h-4 animate-spin shrink-0 text-gray-400" }) : /* @__PURE__ */ e(
|
|
89
|
+
W,
|
|
76
90
|
{
|
|
77
|
-
className:
|
|
78
|
-
"w-4 h-4
|
|
79
|
-
|
|
91
|
+
className: a(
|
|
92
|
+
"w-4 h-4 transition-all duration-50 shrink-0 text-gray-400",
|
|
93
|
+
o ? "rotate-0" : "rotate-180"
|
|
80
94
|
)
|
|
81
95
|
}
|
|
82
96
|
)
|
|
@@ -86,20 +100,20 @@ const j = (r) => /* @__PURE__ */ c.createElement("svg", { width: 9, height: 9, v
|
|
|
86
100
|
/* @__PURE__ */ e(
|
|
87
101
|
"input",
|
|
88
102
|
{
|
|
89
|
-
ref:
|
|
103
|
+
ref: t,
|
|
90
104
|
type: "text",
|
|
91
|
-
name:
|
|
105
|
+
name: s,
|
|
92
106
|
className: "hidden",
|
|
93
107
|
readOnly: !0
|
|
94
108
|
}
|
|
95
109
|
),
|
|
96
|
-
|
|
110
|
+
o ? /* @__PURE__ */ e(S, {}) : null
|
|
97
111
|
]
|
|
98
112
|
}
|
|
99
113
|
);
|
|
100
114
|
}
|
|
101
115
|
);
|
|
102
|
-
|
|
116
|
+
B.displayName = "MultiSelectDropdownWrapper";
|
|
103
117
|
export {
|
|
104
|
-
|
|
118
|
+
B as Wrapper
|
|
105
119
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./FlagSelectorList/FlagSelectorList.js";
|
|
2
2
|
import { jsxs as Z, jsx as V } from "react/jsx-runtime";
|
|
3
3
|
import { i as Ae } from "../../../index-BmVmDQGH.js";
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { Typography as
|
|
4
|
+
import { useRef as te, useMemo as Ne, forwardRef as Be, useId as Re, useImperativeHandle as Ge, useCallback as Le, useEffect as se } from "react";
|
|
5
|
+
import { Typography as X } from "../../Typography/Typography.js";
|
|
6
6
|
import { cn as pe } from "../../../utils/index.js";
|
|
7
7
|
import { labelVariants as Ve, phoneNumberInputVariants as xe } from "../PhoneNumberInput.variants.js";
|
|
8
8
|
import { usePhoneNumberContext as Ke } from "../contexts/phone-number.hook.js";
|
|
@@ -90,7 +90,7 @@ function Y(e) {
|
|
|
90
90
|
}
|
|
91
91
|
function _e(e, t) {
|
|
92
92
|
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
|
|
93
|
-
e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t &&
|
|
93
|
+
e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && ne(e, t);
|
|
94
94
|
}
|
|
95
95
|
function we() {
|
|
96
96
|
try {
|
|
@@ -140,10 +140,10 @@ function We(e, t) {
|
|
|
140
140
|
}
|
|
141
141
|
return o;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
return
|
|
143
|
+
function ne(e, t) {
|
|
144
|
+
return ne = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
145
145
|
return n.__proto__ = r, n;
|
|
146
|
-
},
|
|
146
|
+
}, ne(e, t);
|
|
147
147
|
}
|
|
148
148
|
function U(e, t) {
|
|
149
149
|
var n, r = t.replacementChars, o = t.replacement, a = t.separate, l = r, u = "", i = Oe(e);
|
|
@@ -188,7 +188,7 @@ function Pe(e, t) {
|
|
|
188
188
|
function K(e) {
|
|
189
189
|
return e.length > 0 ? Se({}, e, /./) : {};
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function re(e, t) {
|
|
192
192
|
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++) {
|
|
193
193
|
var b = Object.prototype.hasOwnProperty.call(l, c[f]);
|
|
194
194
|
b && i[f] !== void 0 && i[f] !== c[f] ? p += i[f] : b && u && (p += c[f]);
|
|
@@ -200,7 +200,7 @@ function Me(e, t) {
|
|
|
200
200
|
return ke(U(e, { replacementChars: n.replace(a, ""), replacement: o, separate: !1 }), { mask: n, replacement: o, separate: !1, showMask: !1 });
|
|
201
201
|
}
|
|
202
202
|
function Ze(e, t) {
|
|
203
|
-
var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a =
|
|
203
|
+
var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = re(e, { mask: n, replacement: o, separate: !1 }), l = RegExp("[^".concat(Object.keys(o).join(""), "]"), "g");
|
|
204
204
|
return U(a, { replacementChars: n.replace(l, ""), replacement: o, separate: !1 });
|
|
205
205
|
}
|
|
206
206
|
function Je(e, t) {
|
|
@@ -231,7 +231,7 @@ function Xe(e, t, n) {
|
|
|
231
231
|
if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
232
232
|
return a;
|
|
233
233
|
})(r);
|
|
234
|
-
})(e,
|
|
234
|
+
})(e, oe() ? Reflect.construct(t, n || [], z(e).constructor) : t.apply(e, n));
|
|
235
235
|
}
|
|
236
236
|
function Ee(e, t) {
|
|
237
237
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
@@ -263,13 +263,13 @@ function tt(e, t) {
|
|
|
263
263
|
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
|
|
264
264
|
e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && H(e, t);
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function oe() {
|
|
267
267
|
try {
|
|
268
268
|
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {
|
|
269
269
|
})));
|
|
270
270
|
} catch {
|
|
271
271
|
}
|
|
272
|
-
return (
|
|
272
|
+
return (oe = function() {
|
|
273
273
|
return !!e;
|
|
274
274
|
})();
|
|
275
275
|
}
|
|
@@ -316,9 +316,9 @@ function H(e, t) {
|
|
|
316
316
|
return n.__proto__ = r, n;
|
|
317
317
|
}, H(e, t);
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function ae(e) {
|
|
320
320
|
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
321
|
-
return
|
|
321
|
+
return ae = function(n) {
|
|
322
322
|
if (n === null || !(function(o) {
|
|
323
323
|
try {
|
|
324
324
|
return Function.toString.call(o).indexOf("[native code]") !== -1;
|
|
@@ -333,7 +333,7 @@ function re(e) {
|
|
|
333
333
|
}
|
|
334
334
|
function r() {
|
|
335
335
|
return (function(o, a, l) {
|
|
336
|
-
if (
|
|
336
|
+
if (oe()) return Reflect.construct.apply(null, arguments);
|
|
337
337
|
var u = [null];
|
|
338
338
|
u.push.apply(u, a);
|
|
339
339
|
var i = new (o.bind.apply(o, u))();
|
|
@@ -341,7 +341,7 @@ function re(e) {
|
|
|
341
341
|
})(n, arguments, z(this).constructor);
|
|
342
342
|
}
|
|
343
343
|
return r.prototype = Object.create(n.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), H(r, n);
|
|
344
|
-
},
|
|
344
|
+
}, ae(e);
|
|
345
345
|
}
|
|
346
346
|
var $ = (function(e) {
|
|
347
347
|
function t(n) {
|
|
@@ -349,7 +349,7 @@ var $ = (function(e) {
|
|
|
349
349
|
return Ee(this, t), (r = Xe(this, t, [n])).name = "SyntheticChangeError", r;
|
|
350
350
|
}
|
|
351
351
|
return tt(t, e), Ce(t);
|
|
352
|
-
})(
|
|
352
|
+
})(ae(Error)), ye, rt = ["options"], ge = ["text", "email", "tel", "search", "url"], je = Ce((function e(t) {
|
|
353
353
|
var n = t.init, r = t.tracking;
|
|
354
354
|
Ee(this, e);
|
|
355
355
|
var o = /* @__PURE__ */ new WeakMap();
|
|
@@ -399,7 +399,7 @@ var $ = (function(e) {
|
|
|
399
399
|
};
|
|
400
400
|
}));
|
|
401
401
|
ye = je, Object.defineProperty(ye.prototype, Symbol.toStringTag, { writable: !1, enumerable: !1, configurable: !0, value: "Input" });
|
|
402
|
-
var
|
|
402
|
+
var ee = function(e) {
|
|
403
403
|
return function() {
|
|
404
404
|
for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r];
|
|
405
405
|
return new e("".concat(n.join(`
|
|
@@ -419,11 +419,11 @@ var Te = (function(e) {
|
|
|
419
419
|
var a = o.initialValue, l = o.controlled, u = x(r), i = u.mask, c = u.replacement, p = u.separate, f = u.showMask;
|
|
420
420
|
return a = l || a ? a : f ? i : "", process.env.NODE_ENV !== "production" && (function(b) {
|
|
421
421
|
var M = b.initialValue, j = b.mask, h = b.replacement;
|
|
422
|
-
M.length > j.length && console.error(
|
|
422
|
+
M.length > j.length && console.error(ee(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."));
|
|
423
423
|
var m = Object.keys(h).filter((function(d) {
|
|
424
424
|
return d.length > 1;
|
|
425
425
|
}));
|
|
426
|
-
m.length > 0 && console.error(
|
|
426
|
+
m.length > 0 && console.error(ee(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(m.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."));
|
|
427
427
|
for (var s = j.slice(0, M.length), O = -1, S = 0; S < s.length; S++) {
|
|
428
428
|
var w = Object.prototype.hasOwnProperty.call(h, s[S]);
|
|
429
429
|
if (!(s[S] === M[S] || w && h[s[S]].test(M[S]))) {
|
|
@@ -431,7 +431,7 @@ var Te = (function(e) {
|
|
|
431
431
|
break;
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
O !== -1 && console.error(
|
|
434
|
+
O !== -1 && console.error(ee(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."));
|
|
435
435
|
})({ initialValue: a, mask: i, replacement: c }), { value: a, options: { mask: i, replacement: c, separate: p } };
|
|
436
436
|
}, tracking: function(o) {
|
|
437
437
|
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 = We(f, at), h = j.mask, m = 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);
|
|
@@ -439,7 +439,7 @@ var Te = (function(e) {
|
|
|
439
439
|
w === null ? i = "" : w !== !0 && w !== void 0 && (i = w);
|
|
440
440
|
var d = M?.(S);
|
|
441
441
|
d?.mask !== void 0 && (h = d.mask), d?.replacement !== void 0 && (m = typeof d?.replacement == "string" ? K(d?.replacement) : d.replacement), d?.showMask !== void 0 && (s = d.showMask), d?.separate !== void 0 && (O = d.separate);
|
|
442
|
-
var y =
|
|
442
|
+
var y = re(l, J({ end: c }, u)), v = re(l, J({ start: p }, u)), k = RegExp("[^".concat(Object.keys(m).join(""), "]"), "g"), P = h.replace(k, "");
|
|
443
443
|
if (y && (y = U(y, { replacementChars: P, replacement: m, separate: O }), P = P.slice(y.length)), i && (i = U(i, { replacementChars: P, replacement: m, separate: !1 }), P = P.slice(i.length)), a === "insert" && i === "") throw new $("The character does not match the key value of the `replacement` object.");
|
|
444
444
|
if (O) {
|
|
445
445
|
var g = h.slice(c, p).replace(k, ""), T = g.length - i.length;
|
|
@@ -447,12 +447,12 @@ var Te = (function(e) {
|
|
|
447
447
|
}
|
|
448
448
|
v && (v = U(v, { replacementChars: P, replacement: m, separate: O }));
|
|
449
449
|
var C = ke(y + i + v, { mask: h, replacement: m, separate: O, showMask: s }), E = (function(I) {
|
|
450
|
-
var N, B, D, F = I.inputType, R = I.value, _ = I.addedValue, A = I.beforeChangeValue, W = I.mask,
|
|
451
|
-
var
|
|
452
|
-
return
|
|
453
|
-
})),
|
|
450
|
+
var N, B, D, F = I.inputType, R = I.value, _ = I.addedValue, A = I.beforeChangeValue, W = I.mask, ie = I.replacement, Ie = I.separate, Q = Pe(R, { mask: W, replacement: ie }).filter((function(q) {
|
|
451
|
+
var ce = q.type;
|
|
452
|
+
return ce === "input" || Ie && ce === "replacement";
|
|
453
|
+
})), le = (N = Q[A.length + _.length - 1]) === null || N === void 0 ? void 0 : N.index, G = (B = Q[A.length - 1]) === null || B === void 0 ? void 0 : B.index, L = (D = Q[A.length + _.length]) === null || D === void 0 ? void 0 : D.index;
|
|
454
454
|
if (F === "insert") {
|
|
455
|
-
if (
|
|
455
|
+
if (le !== void 0) return le + 1;
|
|
456
456
|
if (L !== void 0) return L;
|
|
457
457
|
if (G !== void 0) return G + 1;
|
|
458
458
|
}
|
|
@@ -464,10 +464,10 @@ var Te = (function(e) {
|
|
|
464
464
|
if (G !== void 0) return G + 1;
|
|
465
465
|
if (L !== void 0) return L;
|
|
466
466
|
}
|
|
467
|
-
var
|
|
468
|
-
return Object.prototype.hasOwnProperty.call(
|
|
467
|
+
var ue = R.split("").findIndex((function(q) {
|
|
468
|
+
return Object.prototype.hasOwnProperty.call(ie, q);
|
|
469
469
|
}));
|
|
470
|
-
return
|
|
470
|
+
return ue !== -1 ? ue : R.length;
|
|
471
471
|
})({ inputType: a, value: C, addedValue: i, beforeChangeValue: y, mask: h, replacement: m, separate: O });
|
|
472
472
|
return { value: C, selectionStart: E, selectionEnd: E, options: { mask: h, replacement: m, separate: O } };
|
|
473
473
|
} }])).format = function(o) {
|
|
@@ -484,7 +484,7 @@ var Te = (function(e) {
|
|
|
484
484
|
})();
|
|
485
485
|
be = Te, Object.defineProperty(be.prototype, Symbol.toStringTag, { writable: !1, enumerable: !1, configurable: !0, value: "Mask" });
|
|
486
486
|
function ot() {
|
|
487
|
-
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 =
|
|
487
|
+
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 = te(null), i = te({ mask: t, replacement: n, showMask: r, separate: o, track: a, modify: l });
|
|
488
488
|
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, Ne((function() {
|
|
489
489
|
return qe(u, new Te(i.current));
|
|
490
490
|
}), []);
|
|
@@ -512,7 +512,7 @@ const Ot = Be(
|
|
|
512
512
|
showPlaceHolder: M,
|
|
513
513
|
...j
|
|
514
514
|
}, h) => {
|
|
515
|
-
const m = u ?? Re(), s =
|
|
515
|
+
const m = u ?? Re(), s = te(null), {
|
|
516
516
|
isOpenSelector: O,
|
|
517
517
|
value: S,
|
|
518
518
|
selectedCountry: w,
|
|
@@ -529,7 +529,7 @@ const Ot = Be(
|
|
|
529
529
|
},
|
|
530
530
|
[w.prefix, d]
|
|
531
531
|
);
|
|
532
|
-
return
|
|
532
|
+
return se(() => {
|
|
533
533
|
const g = new AbortController(), T = (E) => {
|
|
534
534
|
E.key === "Escape" && y(!1);
|
|
535
535
|
}, C = (E) => {
|
|
@@ -550,7 +550,7 @@ const Ot = Be(
|
|
|
550
550
|
), () => {
|
|
551
551
|
g.abort();
|
|
552
552
|
};
|
|
553
|
-
}, [y, s]),
|
|
553
|
+
}, [y, s]), se(() => {
|
|
554
554
|
k.current && (k.current.value = w.prefix + " ");
|
|
555
555
|
}, [w.code]), /* @__PURE__ */ Z("div", { className: "w-full flex flex-col gap-2", children: [
|
|
556
556
|
a ? /* @__PURE__ */ Z(
|
|
@@ -561,7 +561,14 @@ const Ot = Be(
|
|
|
561
561
|
onClick: () => !e && k.current?.focus(),
|
|
562
562
|
children: [
|
|
563
563
|
a,
|
|
564
|
-
o && /* @__PURE__ */ V(
|
|
564
|
+
o && /* @__PURE__ */ V(
|
|
565
|
+
X,
|
|
566
|
+
{
|
|
567
|
+
component: "span",
|
|
568
|
+
className: "text-red-600 dark:text-red-500 ml-1",
|
|
569
|
+
children: "*"
|
|
570
|
+
}
|
|
571
|
+
)
|
|
565
572
|
]
|
|
566
573
|
}
|
|
567
574
|
) : null,
|
|
@@ -618,7 +625,7 @@ const Ot = Be(
|
|
|
618
625
|
}
|
|
619
626
|
),
|
|
620
627
|
t ? /* @__PURE__ */ V(
|
|
621
|
-
|
|
628
|
+
X,
|
|
622
629
|
{
|
|
623
630
|
component: "span",
|
|
624
631
|
className: "text-xs text-red-700 dark:text-red-500",
|
|
@@ -626,7 +633,7 @@ const Ot = Be(
|
|
|
626
633
|
}
|
|
627
634
|
) : null,
|
|
628
635
|
!t && n ? /* @__PURE__ */ V(
|
|
629
|
-
|
|
636
|
+
X,
|
|
630
637
|
{
|
|
631
638
|
component: "span",
|
|
632
639
|
className: pe(
|
|
@@ -8,11 +8,11 @@ const y = ({
|
|
|
8
8
|
asChild: m,
|
|
9
9
|
className: s,
|
|
10
10
|
defaultChecked: c,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
direction: a,
|
|
12
|
+
name: i,
|
|
13
|
+
options: d,
|
|
14
|
+
theme: n,
|
|
15
|
+
wrapperClassName: p,
|
|
16
16
|
onValueChange: t
|
|
17
17
|
}) => {
|
|
18
18
|
const f = m ? k : "div", [l, S] = x(
|
|
@@ -27,14 +27,14 @@ const y = ({
|
|
|
27
27
|
f,
|
|
28
28
|
{
|
|
29
29
|
className: r(
|
|
30
|
-
R({ className:
|
|
30
|
+
R({ className: p, direction: a })
|
|
31
31
|
),
|
|
32
|
-
"data-theme":
|
|
33
|
-
children:
|
|
32
|
+
"data-theme": n,
|
|
33
|
+
children: d.map(({ value: o, ...N }) => /* @__PURE__ */ e(
|
|
34
34
|
G,
|
|
35
35
|
{
|
|
36
36
|
value: o,
|
|
37
|
-
name:
|
|
37
|
+
name: i,
|
|
38
38
|
className: r(s),
|
|
39
39
|
checked: l === o,
|
|
40
40
|
onChange: () => h(o),
|
|
@@ -87,7 +87,7 @@ const de = [
|
|
|
87
87
|
onClick: () => !t && j(),
|
|
88
88
|
children: [
|
|
89
89
|
v,
|
|
90
|
-
h && /* @__PURE__ */ r("span", { className: "text-red-600 ml-1", children: "*" })
|
|
90
|
+
h && /* @__PURE__ */ r("span", { className: "text-red-600 dark:text-red-500 ml-1", children: "*" })
|
|
91
91
|
]
|
|
92
92
|
}
|
|
93
93
|
) : null,
|
|
@@ -18,7 +18,12 @@ const a = t(
|
|
|
18
18
|
"leading-5",
|
|
19
19
|
"tracking-[0.1px]"
|
|
20
20
|
],
|
|
21
|
-
labelLarge: [
|
|
21
|
+
labelLarge: [
|
|
22
|
+
"text-sm",
|
|
23
|
+
"font-medium",
|
|
24
|
+
"text-slate-500",
|
|
25
|
+
"dark:text-metal-50"
|
|
26
|
+
],
|
|
22
27
|
labelMedium: [
|
|
23
28
|
"text-[12px]",
|
|
24
29
|
"font-medium",
|