xtreme-ui 0.0.106 → 0.0.107
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Select/Select.tsx"],"names":[],"mappings":"AAeA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,MAAM,CAAC,CAAC,EAAG,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Select/Select.tsx"],"names":[],"mappings":"AAeA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,MAAM,CAAC,CAAC,EAAG,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,2CA6EhD"}
|
|
@@ -1,61 +1,62 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { isEqual as
|
|
7
|
-
import { Icon as
|
|
2
|
+
import { jsxs as O, jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { useId as j, useState as y, useMemo as z } from "react";
|
|
4
|
+
import H from "clsx";
|
|
5
|
+
import q from "react-select";
|
|
6
|
+
import { isEqual as h } from "../../../utils/function/common.js";
|
|
7
|
+
import { Icon as D } from "../Icon/Icon.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
function
|
|
9
|
+
function k(S) {
|
|
10
10
|
const {
|
|
11
|
-
className:
|
|
11
|
+
className: v,
|
|
12
12
|
multi: l = !1,
|
|
13
13
|
placeholder: a = "Select an option",
|
|
14
|
-
noOptionsMessage:
|
|
14
|
+
noOptionsMessage: x,
|
|
15
15
|
icon: n,
|
|
16
16
|
size: i = "default",
|
|
17
|
-
iconType:
|
|
18
|
-
clearable:
|
|
17
|
+
iconType: g = "regular",
|
|
18
|
+
clearable: b = !0,
|
|
19
19
|
searchable: m = !0,
|
|
20
20
|
disabled: C = !1,
|
|
21
|
-
loading:
|
|
21
|
+
loading: N = !1,
|
|
22
22
|
options: o,
|
|
23
23
|
value: t,
|
|
24
24
|
onChange: p
|
|
25
|
-
} =
|
|
25
|
+
} = S, u = j(), [f, d] = y(!1), I = z(() => {
|
|
26
26
|
if (l) {
|
|
27
27
|
const e = t ?? [];
|
|
28
|
-
return o.filter((s) => e.some((r) =>
|
|
28
|
+
return o.filter((s) => e.some((r) => h(s.value, r)));
|
|
29
29
|
} else
|
|
30
|
-
return o.find((e) =>
|
|
31
|
-
}, [l, o, t]), M =
|
|
30
|
+
return o.find((e) => h(e.value, t)) || null;
|
|
31
|
+
}, [l, o, t]), M = H(
|
|
32
32
|
"xtrSelectWrapper",
|
|
33
33
|
i && `${i}Size`,
|
|
34
34
|
l ? "multi" : "single",
|
|
35
35
|
n && "withIcon",
|
|
36
36
|
!!t && "withValue",
|
|
37
|
-
|
|
37
|
+
f && "open",
|
|
38
38
|
!m && "noSearch",
|
|
39
|
-
|
|
39
|
+
v
|
|
40
40
|
);
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ O("div", { className: M, children: [
|
|
42
42
|
/* @__PURE__ */ c(
|
|
43
|
-
|
|
43
|
+
q,
|
|
44
44
|
{
|
|
45
45
|
className: "xtrSelect",
|
|
46
46
|
classNamePrefix: "xtrSelect",
|
|
47
|
+
id: u,
|
|
47
48
|
isMulti: l,
|
|
48
|
-
menuIsOpen:
|
|
49
|
-
onMenuOpen: () =>
|
|
50
|
-
onMenuClose: () =>
|
|
51
|
-
noOptionsMessage:
|
|
49
|
+
menuIsOpen: f,
|
|
50
|
+
onMenuOpen: () => d(!0),
|
|
51
|
+
onMenuClose: () => d(!1),
|
|
52
|
+
noOptionsMessage: x,
|
|
52
53
|
placeholder: a,
|
|
53
|
-
isClearable:
|
|
54
|
+
isClearable: b,
|
|
54
55
|
isSearchable: m,
|
|
55
56
|
isDisabled: C,
|
|
56
|
-
isLoading:
|
|
57
|
+
isLoading: N,
|
|
57
58
|
options: o,
|
|
58
|
-
value:
|
|
59
|
+
value: I,
|
|
59
60
|
onChange: (e) => {
|
|
60
61
|
if (l) {
|
|
61
62
|
const s = (e == null ? void 0 : e.map((r) => r.value)) ?? [];
|
|
@@ -67,10 +68,10 @@ function $(h) {
|
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
),
|
|
70
|
-
a && !l && /* @__PURE__ */ c("
|
|
71
|
-
n && /* @__PURE__ */ c(
|
|
71
|
+
a && !l && /* @__PURE__ */ c("label", { className: "placeholder", htmlFor: u, children: a }),
|
|
72
|
+
n && /* @__PURE__ */ c(D, { className: "xtrSelectIcon", code: n, type: g })
|
|
72
73
|
] });
|
|
73
74
|
}
|
|
74
75
|
export {
|
|
75
|
-
|
|
76
|
+
k as Select
|
|
76
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textfield.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/Textfield.tsx"],"names":[],"mappings":"AAMA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"Textfield.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/Textfield.tsx"],"names":[],"mappings":"AAMA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,SAAS,8GA4GpB,CAAC"}
|
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as k, useMemo as
|
|
4
|
-
import
|
|
5
|
-
import { Icon as
|
|
2
|
+
import { jsxs as w, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as k, useId as D, useMemo as f } from "react";
|
|
4
|
+
import L from "clsx";
|
|
5
|
+
import { Icon as U } from "../Icon/Icon.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
const
|
|
7
|
+
const B = k((g, T) => {
|
|
8
8
|
const {
|
|
9
|
-
className:
|
|
9
|
+
className: I,
|
|
10
10
|
style: v,
|
|
11
11
|
type: e = "text",
|
|
12
12
|
textarea: o,
|
|
13
13
|
placeholder: n,
|
|
14
|
-
autoComplete:
|
|
14
|
+
autoComplete: m = "off",
|
|
15
15
|
active: C,
|
|
16
|
-
autoFocus:
|
|
16
|
+
autoFocus: d,
|
|
17
17
|
icon: a,
|
|
18
|
-
iconType:
|
|
18
|
+
iconType: E = "regular",
|
|
19
19
|
value: l,
|
|
20
|
-
onChange:
|
|
21
|
-
onFocus:
|
|
22
|
-
onBlur:
|
|
23
|
-
onKeyUp:
|
|
24
|
-
onKeyDown:
|
|
20
|
+
onChange: h,
|
|
21
|
+
onFocus: x,
|
|
22
|
+
onBlur: y,
|
|
23
|
+
onKeyUp: s,
|
|
24
|
+
onKeyDown: c,
|
|
25
25
|
onEnterKey: i
|
|
26
|
-
} =
|
|
26
|
+
} = g, u = D(), p = f(() => {
|
|
27
27
|
if (o === !0) return null;
|
|
28
28
|
if (a) return a;
|
|
29
29
|
if (e === "number") return "23";
|
|
30
30
|
if (e === "search") return "f002";
|
|
31
31
|
if (e === "password") return "f30d";
|
|
32
|
-
}, [o, a, e]),
|
|
32
|
+
}, [o, a, e]), F = f(() => {
|
|
33
33
|
if (n) return n;
|
|
34
34
|
if (e === "number") return "Enter a number";
|
|
35
35
|
if (e === "search") return "Search";
|
|
36
36
|
if (e === "password") return "Enter password";
|
|
37
37
|
if (e === "phone") return "Enter phone number";
|
|
38
|
-
}, [n, e]), K =
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
t.key === "Enter" && (i == null || i(t)),
|
|
42
|
-
}, j =
|
|
38
|
+
}, [n, e]), K = f(() => e === "phone" ? "number" : e, [e]), b = (t) => {
|
|
39
|
+
s == null || s(t);
|
|
40
|
+
}, N = (t) => {
|
|
41
|
+
t.key === "Enter" && (i == null || i(t)), c == null || c(t);
|
|
42
|
+
}, j = L(
|
|
43
43
|
"xtrTextfield",
|
|
44
|
-
|
|
44
|
+
p && "withIcon",
|
|
45
45
|
o && "textarea",
|
|
46
46
|
l && "hasValue",
|
|
47
47
|
e === "phone" && "phone",
|
|
48
48
|
C && "active",
|
|
49
|
-
|
|
49
|
+
I
|
|
50
50
|
);
|
|
51
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ w(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
|
-
ref:
|
|
54
|
+
ref: T,
|
|
55
55
|
className: j,
|
|
56
56
|
role: "textbox",
|
|
57
57
|
style: v,
|
|
58
58
|
children: [
|
|
59
|
-
|
|
60
|
-
e === "phone" && /* @__PURE__ */
|
|
59
|
+
p && !o && /* @__PURE__ */ r(U, { code: p, type: E }),
|
|
60
|
+
e === "phone" && /* @__PURE__ */ w("div", { className: "dialCode", children: [
|
|
61
61
|
/* @__PURE__ */ r("span", { style: { backgroundImage: "url(https://flagcdn.com/in.svg)" } }),
|
|
62
62
|
/* @__PURE__ */ r("p", { children: "+91" })
|
|
63
63
|
] }),
|
|
@@ -65,36 +65,38 @@ const L = k((w, g) => {
|
|
|
65
65
|
"textarea",
|
|
66
66
|
{
|
|
67
67
|
className: "input",
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
id: u,
|
|
69
|
+
autoFocus: d,
|
|
70
|
+
autoComplete: m,
|
|
70
71
|
value: l,
|
|
71
|
-
onChange:
|
|
72
|
-
onFocus:
|
|
73
|
-
onBlur:
|
|
74
|
-
onKeyUp:
|
|
75
|
-
onKeyDown:
|
|
72
|
+
onChange: h,
|
|
73
|
+
onFocus: x,
|
|
74
|
+
onBlur: y,
|
|
75
|
+
onKeyUp: b,
|
|
76
|
+
onKeyDown: N
|
|
76
77
|
}
|
|
77
78
|
) : /* @__PURE__ */ r(
|
|
78
79
|
"input",
|
|
79
80
|
{
|
|
80
81
|
className: "input",
|
|
82
|
+
id: u,
|
|
81
83
|
type: K,
|
|
82
|
-
autoFocus:
|
|
83
|
-
autoComplete:
|
|
84
|
+
autoFocus: d,
|
|
85
|
+
autoComplete: m,
|
|
84
86
|
value: l,
|
|
85
|
-
onChange:
|
|
86
|
-
onFocus:
|
|
87
|
-
onBlur:
|
|
88
|
-
onKeyUp:
|
|
89
|
-
onKeyDown:
|
|
87
|
+
onChange: h,
|
|
88
|
+
onFocus: x,
|
|
89
|
+
onBlur: y,
|
|
90
|
+
onKeyUp: b,
|
|
91
|
+
onKeyDown: N
|
|
90
92
|
}
|
|
91
93
|
),
|
|
92
|
-
/* @__PURE__ */ r("label", { className: "placeholder", children:
|
|
94
|
+
/* @__PURE__ */ r("label", { className: "placeholder", htmlFor: u, children: F })
|
|
93
95
|
]
|
|
94
96
|
}
|
|
95
97
|
);
|
|
96
98
|
});
|
|
97
|
-
|
|
99
|
+
B.displayName = "Textfield";
|
|
98
100
|
export {
|
|
99
|
-
|
|
101
|
+
B as Textfield
|
|
100
102
|
};
|