@bikdotai/bik-component-library 0.0.861 → 0.0.862
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/README.md +4 -0
- package/dist/cjs/components/bik-layout/CommonStyles.js +4 -6
- package/dist/cjs/components/bik-layout/CommonStyles.js.map +1 -1
- package/dist/cjs/components/button/themes.js +3 -3
- package/dist/cjs/components/button/themes.js.map +1 -1
- package/dist/cjs/components/datePicker/DatePicker.js +1 -1
- package/dist/cjs/components/datePicker/DatePicker.js.map +1 -1
- package/dist/cjs/components/datePicker/DatePicker.styled.js +20 -14
- package/dist/cjs/components/datePicker/DatePicker.styled.js.map +1 -1
- package/dist/cjs/components/dropdown/ChipInput.js +1 -1
- package/dist/cjs/components/dropdown/ChipInput.js.map +1 -1
- package/dist/cjs/components/dropdown/Common.styled.js +6 -5
- package/dist/cjs/components/dropdown/Common.styled.js.map +1 -1
- package/dist/cjs/components/dropdown/Dropdown.js +1 -1
- package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +7 -6
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js.map +1 -1
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/input/Input.js.map +1 -1
- package/dist/cjs/components/input/Input.styled.js +25 -12
- package/dist/cjs/components/input/Input.styled.js.map +1 -1
- package/dist/cjs/components/tabs/Tabs.js +1 -1
- package/dist/cjs/components/tabs/Tabs.js.map +1 -1
- package/dist/cjs/components/tabs/Tabs.styles.js +22 -8
- package/dist/cjs/components/tabs/Tabs.styles.js.map +1 -1
- package/dist/cjs/components/tag/Tag.js +1 -1
- package/dist/cjs/components/tag/Tag.js.map +1 -1
- package/dist/cjs/components/tag/Tag.styled.js +4 -0
- package/dist/cjs/components/tag/Tag.styled.js.map +1 -1
- package/dist/cjs/components/tag/model.js.map +1 -1
- package/dist/esm/components/bik-layout/CommonStyles.js +1 -3
- package/dist/esm/components/bik-layout/CommonStyles.js.map +1 -1
- package/dist/esm/components/button/themes.js +1 -1
- package/dist/esm/components/button/themes.js.map +1 -1
- package/dist/esm/components/datePicker/DatePicker.js +22 -21
- package/dist/esm/components/datePicker/DatePicker.js.map +1 -1
- package/dist/esm/components/datePicker/DatePicker.styled.d.ts +10 -0
- package/dist/esm/components/datePicker/DatePicker.styled.js +23 -16
- package/dist/esm/components/datePicker/DatePicker.styled.js.map +1 -1
- package/dist/esm/components/dropdown/ChipInput.d.ts +1 -0
- package/dist/esm/components/dropdown/ChipInput.js +37 -30
- package/dist/esm/components/dropdown/ChipInput.js.map +1 -1
- package/dist/esm/components/dropdown/Common.styled.js +7 -6
- package/dist/esm/components/dropdown/Common.styled.js.map +1 -1
- package/dist/esm/components/dropdown/Dropdown.d.ts +2 -0
- package/dist/esm/components/dropdown/Dropdown.js +96 -89
- package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +186 -175
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +16 -15
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.d.ts +1 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +19 -18
- package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js.map +1 -1
- package/dist/esm/components/dropdown/type.d.ts +4 -0
- package/dist/esm/components/input/Input.js +142 -138
- package/dist/esm/components/input/Input.js.map +1 -1
- package/dist/esm/components/input/Input.model.d.ts +4 -0
- package/dist/esm/components/input/Input.styled.d.ts +2 -0
- package/dist/esm/components/input/Input.styled.js +38 -25
- package/dist/esm/components/input/Input.styled.js.map +1 -1
- package/dist/esm/components/tabs/Tabs.js +105 -81
- package/dist/esm/components/tabs/Tabs.js.map +1 -1
- package/dist/esm/components/tabs/Tabs.model.d.ts +7 -0
- package/dist/esm/components/tabs/Tabs.styles.d.ts +2 -0
- package/dist/esm/components/tabs/Tabs.styles.js +23 -9
- package/dist/esm/components/tabs/Tabs.styles.js.map +1 -1
- package/dist/esm/components/tag/Tag.d.ts +1 -1
- package/dist/esm/components/tag/Tag.js +17 -15
- package/dist/esm/components/tag/Tag.js.map +1 -1
- package/dist/esm/components/tag/Tag.styled.d.ts +1 -0
- package/dist/esm/components/tag/Tag.styled.js +10 -6
- package/dist/esm/components/tag/Tag.styled.js.map +1 -1
- package/dist/esm/components/tag/model.d.ts +5 -0
- package/dist/esm/components/tag/model.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { escapeFormulaInjection as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { isFunction as
|
|
6
|
-
import { TitleSmall as
|
|
7
|
-
import { COLORS as
|
|
1
|
+
import { jsxs as o, jsx as n, Fragment as Ee } from "react/jsx-runtime";
|
|
2
|
+
import He from "../../assets/icons/info.svg.js";
|
|
3
|
+
import { escapeFormulaInjection as _e } from "../../helpers/sanitize.js";
|
|
4
|
+
import { forwardRef as ke, useState as v, useContext as Ae, useRef as Fe, useEffect as d } from "react";
|
|
5
|
+
import { isFunction as ne, shouldSanitizeForType as Re, sanitizeUnsafeInput as De, validateInput as Be } from "./Input-helper.js";
|
|
6
|
+
import { TitleSmall as Oe, BodySecondary as ze } from "../TypographyStyle.js";
|
|
7
|
+
import { COLORS as ie } from "../../constants/Theme.js";
|
|
8
8
|
import Pe from "../../assets/icons/errorInfo.svg.js";
|
|
9
|
-
import { InputStyleContext as
|
|
10
|
-
import { RootContainer as
|
|
11
|
-
import { Button as
|
|
12
|
-
import { Tooltip as
|
|
13
|
-
const
|
|
9
|
+
import { InputStyleContext as Ke } from "./context/InputStyleProvider.js";
|
|
10
|
+
import { RootContainer as Ne, InputFooter as je, MaxCharStyle as le, InputWrapper as Ve, IconHolder as re, PrefixHolder as We, InputContainer as Xe, InputContainerSmall as Ue, InputContainerXSmall as qe, SuffixHolder as Ge, InputHeader as Ye } from "./Input.styled.js";
|
|
11
|
+
import { Button as oe } from "../button/Button.js";
|
|
12
|
+
import { Tooltip as $e } from "../tooltips/Tooltip.js";
|
|
13
|
+
const Je = ke(
|
|
14
14
|
(e, ae) => {
|
|
15
15
|
const {
|
|
16
16
|
placeholder: H,
|
|
17
17
|
leftIcon: _,
|
|
18
18
|
rightIcon: y,
|
|
19
19
|
labelText: T,
|
|
20
|
-
maxCharLimit:
|
|
20
|
+
maxCharLimit: r,
|
|
21
21
|
isRequired: k,
|
|
22
22
|
hintText: A,
|
|
23
23
|
type: c,
|
|
24
24
|
state: b,
|
|
25
|
-
validate:
|
|
26
|
-
variant:
|
|
27
|
-
button:
|
|
25
|
+
validate: ce,
|
|
26
|
+
variant: a,
|
|
27
|
+
button: u,
|
|
28
28
|
suffixText: F,
|
|
29
29
|
prefixText: R,
|
|
30
|
-
onChangeText:
|
|
30
|
+
onChangeText: D,
|
|
31
31
|
value: m,
|
|
32
|
-
noErrorHint:
|
|
33
|
-
reset:
|
|
34
|
-
rangeValidation:
|
|
32
|
+
noErrorHint: se,
|
|
33
|
+
reset: B,
|
|
34
|
+
rangeValidation: ue,
|
|
35
35
|
noKeyDownChange: he,
|
|
36
|
-
version:
|
|
36
|
+
version: de,
|
|
37
37
|
noMaxCharCheck: O,
|
|
38
|
-
labelElement:
|
|
39
|
-
autoGrow:
|
|
38
|
+
labelElement: z,
|
|
39
|
+
autoGrow: S,
|
|
40
40
|
minHeight: M,
|
|
41
|
-
maxHeight:
|
|
42
|
-
labelTextBold:
|
|
43
|
-
truncateText:
|
|
44
|
-
maxCharLimitPosition:
|
|
41
|
+
maxHeight: fe,
|
|
42
|
+
labelTextBold: me,
|
|
43
|
+
truncateText: ge,
|
|
44
|
+
maxCharLimitPosition: P,
|
|
45
45
|
maxCharStyle: K,
|
|
46
|
-
hightlightInputColor:
|
|
46
|
+
hightlightInputColor: xe,
|
|
47
47
|
onKeyDownEvent: N,
|
|
48
|
-
hideInputHeader:
|
|
49
|
-
hideBorder:
|
|
50
|
-
inputWrapperStyles:
|
|
48
|
+
hideInputHeader: Ie,
|
|
49
|
+
hideBorder: Ce,
|
|
50
|
+
inputWrapperStyles: ve,
|
|
51
51
|
minCharsToTrigger: j,
|
|
52
|
-
maxCharAlignment:
|
|
52
|
+
maxCharAlignment: ye,
|
|
53
53
|
isDisabled: V = !1,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
solidDisabled: W = !1,
|
|
55
|
+
allowUnsafeInput: Te,
|
|
56
|
+
preventFormulaInjection: be,
|
|
57
|
+
leftIconStyle: Se
|
|
57
58
|
} = {
|
|
58
59
|
maxCharLimit: 0,
|
|
59
60
|
type: "text",
|
|
@@ -62,206 +63,209 @@ const $e = _e(
|
|
|
62
63
|
minCharsToTrigger: 0,
|
|
63
64
|
maxCharAlignment: !1,
|
|
64
65
|
...e
|
|
65
|
-
},
|
|
66
|
+
}, X = _?.icon, U = y?.icon, [p, I] = v(!1), [Me, w] = v(!1), [h, q] = v(), G = a === "x-small" ? "12px" : a === "small" ? "18px" : "22px", C = Ae(Ke), [Y, L] = v(""), pe = Fe(null), l = ae ?? pe;
|
|
66
67
|
d(() => {
|
|
67
|
-
L(m || ""), !m &&
|
|
68
|
+
L(m || ""), !m && S && (l.current.style.height = M || "48px");
|
|
68
69
|
}, [m]), d(() => {
|
|
69
|
-
|
|
70
|
-
}, [
|
|
71
|
-
const t =
|
|
70
|
+
l.current && e.onReferenceInit?.(l.current);
|
|
71
|
+
}, [l]), d(() => {
|
|
72
|
+
const t = l.current;
|
|
72
73
|
if (t && ["phonenumber", "zip", "number"].includes(c))
|
|
73
|
-
return t.addEventListener("wheel",
|
|
74
|
-
t.removeEventListener("wheel",
|
|
74
|
+
return t.addEventListener("wheel", Q, { passive: !1 }), () => {
|
|
75
|
+
t.removeEventListener("wheel", Q);
|
|
75
76
|
};
|
|
76
77
|
}, []), d(() => {
|
|
77
|
-
|
|
78
|
-
}, [
|
|
79
|
-
w(!!e.isActive), e.isActive &&
|
|
78
|
+
B && L("");
|
|
79
|
+
}, [B]), d(() => {
|
|
80
|
+
w(!!e.isActive), e.isActive && l.current?.focus();
|
|
80
81
|
}, [e.isActive]), d(() => {
|
|
81
|
-
|
|
82
|
+
q(e.errorMessage);
|
|
82
83
|
}, [e.errorMessage]), d(() => {
|
|
83
|
-
I(!1), (e.state === "invalid" ||
|
|
84
|
-
}, [e.state,
|
|
85
|
-
I(!!
|
|
86
|
-
}, [
|
|
84
|
+
I(!1), (e.state === "invalid" || h || e.state === "disabled-invalid") && I(!0), e.state === "active" && l.current?.focus();
|
|
85
|
+
}, [e.state, h]), d(() => {
|
|
86
|
+
I(!!h || e.state === "invalid");
|
|
87
|
+
}, [h, e.state]);
|
|
87
88
|
const f = (t, ...i) => {
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
const i =
|
|
91
|
-
N && (!s.length || s.length >= x) && N(t), !he && (!s.length || s.length >= x) &&
|
|
92
|
-
}, J = (t) => {
|
|
93
|
-
t.preventDefault();
|
|
89
|
+
ne(t) && t(...i);
|
|
90
|
+
}, $ = () => c === "zip" ? 6 : 2e3, J = (t) => {
|
|
91
|
+
const i = r !== 0 ? r : $(), g = [8], x = j, s = t.target.value;
|
|
92
|
+
N && (!s.length || s.length >= x) && N(t), !he && (!s.length || s.length >= x) && D(m || "", t), !O && !g.includes(t.which) && i > 0 && s.length >= i && t.preventDefault();
|
|
94
93
|
}, Q = (t) => {
|
|
94
|
+
t.preventDefault();
|
|
95
|
+
}, Z = (t) => {
|
|
95
96
|
let i = t.target.value;
|
|
96
|
-
const g =
|
|
97
|
-
if (!
|
|
97
|
+
const g = r !== 0 ? r + 1 : $(), x = j;
|
|
98
|
+
if (!Te && Re(c) && (i = De(i)), be && (i = _e(i)), !O && g > 0 && i.length >= g && (i = i.substring(0, g - 1)), e.textControl || L(i || ""), x && i && i.length < x)
|
|
98
99
|
return;
|
|
99
|
-
|
|
100
|
-
const s =
|
|
101
|
-
if (!s || !
|
|
100
|
+
D(i, t), S && (l.current.style.height = `${l.current.scrollHeight}px`, i || (l.current.style.height = M || "48px"));
|
|
101
|
+
const s = ce || Be;
|
|
102
|
+
if (!s || !ne(s))
|
|
102
103
|
return;
|
|
103
|
-
const [
|
|
104
|
+
const [we, Le] = s(
|
|
104
105
|
i,
|
|
105
106
|
c,
|
|
106
|
-
|
|
107
|
+
ue
|
|
107
108
|
);
|
|
108
|
-
I(!
|
|
109
|
-
}, Z = (t) => {
|
|
110
|
-
e.skipFocus || w(!0), f(e.onFocus?.(t));
|
|
109
|
+
I(!we), q(e.errorMessage ? e.errorMessage : Le);
|
|
111
110
|
}, ee = (t) => {
|
|
111
|
+
e.skipFocus || w(!0), f(e.onFocus?.(t));
|
|
112
|
+
}, te = (t) => {
|
|
112
113
|
e.skipFocus || w(!1), f(e.onBlur?.(t));
|
|
113
|
-
}, E = () => /* @__PURE__ */
|
|
114
|
+
}, E = () => /* @__PURE__ */ o(Ee, { children: [
|
|
114
115
|
c !== "multiline" && /* @__PURE__ */ n(
|
|
115
116
|
"input",
|
|
116
117
|
{
|
|
117
|
-
className:
|
|
118
|
+
className: ge ? "truncate-class" : "",
|
|
118
119
|
"data-test": e["data-test"],
|
|
119
120
|
id: e.id,
|
|
120
121
|
style: C?.input ?? {},
|
|
121
|
-
ref:
|
|
122
|
+
ref: l,
|
|
122
123
|
disabled: V,
|
|
123
124
|
type: ["phonenumber", "zip", "number"].includes(c) ? "number" : c,
|
|
124
|
-
value:
|
|
125
|
-
onFocus: (t) =>
|
|
126
|
-
onBlur: (t) =>
|
|
125
|
+
value: Y,
|
|
126
|
+
onFocus: (t) => ee(t),
|
|
127
|
+
onBlur: (t) => te(t),
|
|
127
128
|
placeholder: H || "Enter here",
|
|
128
|
-
onChange:
|
|
129
|
+
onChange: Z,
|
|
129
130
|
onClick: (t) => f(e.onClick),
|
|
130
|
-
onKeyDown: (t) =>
|
|
131
|
+
onKeyDown: (t) => J(t)
|
|
131
132
|
}
|
|
132
133
|
),
|
|
133
134
|
c === "multiline" && /* @__PURE__ */ n(
|
|
134
135
|
"textarea",
|
|
135
136
|
{
|
|
136
137
|
"data-test": e["data-test"],
|
|
137
|
-
value:
|
|
138
|
-
ref:
|
|
139
|
-
onFocus: (t) =>
|
|
140
|
-
onBlur: (t) =>
|
|
138
|
+
value: Y,
|
|
139
|
+
ref: l,
|
|
140
|
+
onFocus: (t) => ee(t),
|
|
141
|
+
onBlur: (t) => te(t),
|
|
141
142
|
onClick: (t) => f(e.onClick),
|
|
142
143
|
disabled: V,
|
|
143
144
|
placeholder: H || "Enter here",
|
|
144
|
-
onChange:
|
|
145
|
-
onKeyDown: (t) =>
|
|
146
|
-
maxLength:
|
|
145
|
+
onChange: Z,
|
|
146
|
+
onKeyDown: (t) => J(t),
|
|
147
|
+
maxLength: r > 0 ? r : void 0
|
|
147
148
|
}
|
|
148
149
|
)
|
|
149
150
|
] });
|
|
150
|
-
return /* @__PURE__ */
|
|
151
|
-
|
|
151
|
+
return /* @__PURE__ */ o(
|
|
152
|
+
Ne,
|
|
152
153
|
{
|
|
153
154
|
width: e.width,
|
|
154
155
|
height: e.height,
|
|
155
156
|
state: b,
|
|
157
|
+
solidDisabled: W,
|
|
156
158
|
type: c,
|
|
157
159
|
style: C?.RootContainer ?? {},
|
|
158
160
|
children: [
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
!
|
|
161
|
-
!!
|
|
162
|
-
|
|
161
|
+
/* @__PURE__ */ o("div", { className: "flex-align-center", children: [
|
|
162
|
+
!se && (!!A || !!h) && /* @__PURE__ */ o(je, { invalid: !!h, children: [
|
|
163
|
+
!!h && /* @__PURE__ */ n(Pe, { width: 16, height: 16 }),
|
|
164
|
+
h || A
|
|
163
165
|
] }),
|
|
164
|
-
|
|
166
|
+
r > 0 && P === "BOTTOM" && /* @__PURE__ */ o(le, { position: "BOTTOM", style: K, children: [
|
|
165
167
|
(m ?? "").toString()?.length ?? 0,
|
|
166
168
|
"/",
|
|
167
|
-
|
|
169
|
+
r
|
|
168
170
|
] })
|
|
169
171
|
] }),
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
|
|
172
|
+
/* @__PURE__ */ o(
|
|
173
|
+
Ve,
|
|
172
174
|
{
|
|
173
|
-
variant:
|
|
175
|
+
variant: a,
|
|
174
176
|
state: b,
|
|
177
|
+
solidDisabled: W,
|
|
175
178
|
width: e.width,
|
|
176
|
-
isActive: b === "active" ||
|
|
177
|
-
isInvalid:
|
|
178
|
-
style: C?.InputWrapper ??
|
|
179
|
-
version:
|
|
179
|
+
isActive: b === "active" || Me,
|
|
180
|
+
isInvalid: p,
|
|
181
|
+
style: C?.InputWrapper ?? ve ?? {},
|
|
182
|
+
version: de,
|
|
180
183
|
height: e.height,
|
|
181
|
-
hightlightInputColor:
|
|
182
|
-
hideBorder:
|
|
184
|
+
hightlightInputColor: xe,
|
|
185
|
+
hideBorder: Ce,
|
|
183
186
|
children: [
|
|
184
|
-
!!
|
|
187
|
+
!!X && /* @__PURE__ */ n(
|
|
185
188
|
re,
|
|
186
189
|
{
|
|
187
|
-
variant:
|
|
188
|
-
iconSize:
|
|
190
|
+
variant: a,
|
|
191
|
+
iconSize: G,
|
|
189
192
|
onClick: () => f(_?.callback),
|
|
190
193
|
isLeft: !0,
|
|
191
194
|
style: {
|
|
192
195
|
...C?.IconHolder ?? {},
|
|
193
|
-
...
|
|
196
|
+
...Se
|
|
194
197
|
},
|
|
195
|
-
children: /* @__PURE__ */ n(
|
|
198
|
+
children: /* @__PURE__ */ n(X, {})
|
|
196
199
|
}
|
|
197
200
|
),
|
|
198
|
-
!!R && /* @__PURE__ */ n(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
!!R && /* @__PURE__ */ n(We, { variant: a, children: R }),
|
|
202
|
+
a === "default" && /* @__PURE__ */ n(
|
|
203
|
+
Xe,
|
|
201
204
|
{
|
|
202
205
|
height: e.height,
|
|
203
206
|
type: e.type,
|
|
204
207
|
minHeight: M,
|
|
205
|
-
maxHeight:
|
|
206
|
-
autoGrow:
|
|
208
|
+
maxHeight: fe,
|
|
209
|
+
autoGrow: S,
|
|
207
210
|
children: E()
|
|
208
211
|
}
|
|
209
212
|
),
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
!!
|
|
213
|
+
a === "small" && /* @__PURE__ */ n(Ue, { height: e.height, type: e.type, children: E() }),
|
|
214
|
+
a === "x-small" && /* @__PURE__ */ n(qe, { height: e.height, type: e.type, children: E() }),
|
|
215
|
+
!!U && /* @__PURE__ */ n(
|
|
213
216
|
re,
|
|
214
217
|
{
|
|
215
|
-
variant:
|
|
216
|
-
iconSize:
|
|
218
|
+
variant: a,
|
|
219
|
+
iconSize: G,
|
|
217
220
|
onClick: () => f(y?.callback),
|
|
218
221
|
isLeft: !1,
|
|
219
222
|
"data-test": y?.["data-test"],
|
|
220
|
-
children: /* @__PURE__ */ n(
|
|
223
|
+
children: /* @__PURE__ */ n(U, {})
|
|
221
224
|
}
|
|
222
225
|
),
|
|
223
|
-
!!F && /* @__PURE__ */ n(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
+
!!F && /* @__PURE__ */ n(Ge, { variant: a, children: F }),
|
|
227
|
+
u && u.text && /* @__PURE__ */ n(
|
|
228
|
+
oe,
|
|
226
229
|
{
|
|
227
|
-
buttonText:
|
|
228
|
-
buttonType:
|
|
229
|
-
onClick: () => f(
|
|
230
|
+
buttonText: u.text,
|
|
231
|
+
buttonType: u.buttonType,
|
|
232
|
+
onClick: () => f(u?.onClick)
|
|
230
233
|
}
|
|
231
234
|
),
|
|
232
|
-
|
|
235
|
+
u && u.buttonProps && /* @__PURE__ */ n(oe, { ...u.buttonProps })
|
|
233
236
|
]
|
|
234
237
|
}
|
|
235
238
|
),
|
|
236
|
-
!
|
|
237
|
-
|
|
239
|
+
!Ie && (!!T || !!r) && /* @__PURE__ */ o(
|
|
240
|
+
Ye,
|
|
238
241
|
{
|
|
239
|
-
invalid:
|
|
240
|
-
maxCharAlignment:
|
|
242
|
+
invalid: p,
|
|
243
|
+
maxCharAlignment: ye,
|
|
241
244
|
children: [
|
|
242
|
-
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
|
|
245
|
+
z && z,
|
|
246
|
+
/* @__PURE__ */ o("div", { className: "label__container", children: [
|
|
247
|
+
me ? /* @__PURE__ */ o(Oe, { children: [
|
|
245
248
|
T,
|
|
246
249
|
k ? /* @__PURE__ */ n("span", { children: "*" }) : ""
|
|
247
|
-
] }) : /* @__PURE__ */
|
|
250
|
+
] }) : /* @__PURE__ */ o(ze, { children: [
|
|
248
251
|
T,
|
|
249
252
|
k ? /* @__PURE__ */ n("span", { children: "*" }) : ""
|
|
250
253
|
] }),
|
|
251
|
-
e.tooltipText && /* @__PURE__ */ n(
|
|
252
|
-
|
|
254
|
+
e.tooltipText && /* @__PURE__ */ n($e, { body: e.tooltipText, placement: "top", children: /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(
|
|
255
|
+
He,
|
|
253
256
|
{
|
|
257
|
+
"data-test": "input-tooltip-icon",
|
|
254
258
|
style: { marginTop: -3 },
|
|
255
|
-
width: 18,
|
|
256
|
-
height: 18,
|
|
257
|
-
color:
|
|
259
|
+
width: e.tooltipIconSize ?? 18,
|
|
260
|
+
height: e.tooltipIconSize ?? 18,
|
|
261
|
+
color: p ? ie.content.negative : e.tooltipIconColor ?? ie.content.primary
|
|
258
262
|
}
|
|
259
263
|
) }) })
|
|
260
264
|
] }),
|
|
261
|
-
|
|
265
|
+
r > 0 && P === "TOP" && /* @__PURE__ */ o(le, { style: K, children: [
|
|
262
266
|
(m ?? "").toString()?.length ?? 0,
|
|
263
267
|
"/",
|
|
264
|
-
|
|
268
|
+
r
|
|
265
269
|
] })
|
|
266
270
|
]
|
|
267
271
|
}
|
|
@@ -271,8 +275,8 @@ const $e = _e(
|
|
|
271
275
|
);
|
|
272
276
|
}
|
|
273
277
|
);
|
|
274
|
-
|
|
278
|
+
Je.displayName = "Input";
|
|
275
279
|
export {
|
|
276
|
-
|
|
280
|
+
Je as Input
|
|
277
281
|
};
|
|
278
282
|
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../../../src/components/input/Input.tsx"],"sourcesContent":["import InfoIcon from '@src/assets/icons/info.svg';\nimport { escapeFormulaInjection } from '@src/helpers/sanitize';\nimport React, {\n\tforwardRef,\n\tMutableRefObject,\n\tRef,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport { Button } from '@src/components/button';\nimport {\n\tisFunction,\n\tsanitizeUnsafeInput,\n\tshouldSanitizeForType,\n\tvalidateInput,\n} from '@src/components/input/Input-helper';\nimport { Tooltip } from '@src/components/tooltips';\nimport { BodySecondary, TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport ErrorIcon from '../../assets/icons/errorInfo.svg';\nimport { InputStyleContext } from './context/InputStyleProvider';\nimport { InputProps, InputTypeI, InputVariant } from './Input.model';\nimport * as SC from './Input.styled';\nimport { PrefixHolder, SuffixHolder } from './Input.styled';\n\nexport const Input = forwardRef(\n\t(\n\t\tprops: InputProps,\n\t\tfRef: React.ForwardedRef<HTMLInputElement | HTMLTextAreaElement | null>,\n\t) => {\n\t\tconst {\n\t\t\tplaceholder,\n\t\t\tleftIcon,\n\t\t\trightIcon,\n\t\t\tlabelText,\n\t\t\tmaxCharLimit,\n\t\t\tisRequired,\n\t\t\thintText,\n\t\t\ttype,\n\t\t\tstate,\n\t\t\tvalidate,\n\t\t\tvariant,\n\t\t\tbutton,\n\t\t\tsuffixText,\n\t\t\tprefixText,\n\t\t\tonChangeText,\n\t\t\tvalue,\n\t\t\tnoErrorHint,\n\t\t\treset,\n\t\t\trangeValidation,\n\t\t\tnoKeyDownChange,\n\t\t\tversion,\n\t\t\tnoMaxCharCheck,\n\t\t\tlabelElement,\n\t\t\tautoGrow,\n\t\t\tminHeight,\n\t\t\tmaxHeight,\n\t\t\tlabelTextBold,\n\t\t\ttruncateText,\n\t\t\tmaxCharLimitPosition,\n\t\t\tmaxCharStyle,\n\t\t\thightlightInputColor,\n\t\t\tonKeyDownEvent,\n\t\t\thideInputHeader,\n\t\t\thideBorder,\n\t\t\tinputWrapperStyles,\n\t\t\tminCharsToTrigger,\n\t\t\tmaxCharAlignment,\n\t\t\tisDisabled = false,\n\t\t\tallowUnsafeInput,\n\t\t\tpreventFormulaInjection,\n\t\t\tleftIconStyle,\n\t\t} = {\n\t\t\tmaxCharLimit: 0,\n\t\t\ttype: 'text' as InputTypeI,\n\t\t\tvariant: 'default' as InputVariant,\n\t\t\tmaxCharLimitPosition: 'TOP',\n\t\t\tminCharsToTrigger: 0,\n\t\t\tmaxCharAlignment: false,\n\t\t\t...props,\n\t\t};\n\t\tconst LeftIcon = leftIcon?.icon;\n\t\tconst RightIcon = rightIcon?.icon;\n\t\tconst [isInvalid, setIsInvalid] = useState<boolean>(false);\n\t\tconst [isActive, setIsActive] = useState<boolean>(false);\n\t\tconst [errorMessage, setErrorMessage] = useState<string>();\n\t\tconst iconSize =\n\t\t\tvariant === 'x-small' ? '12px' : variant === 'small' ? '18px' : '22px';\n\t\tconst stylesFromOutside = useContext(InputStyleContext);\n\t\tconst [inputValue, setInputValue] = useState<string>('');\n\t\tconst _ref = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n\t\tconst inputRef: MutableRefObject<HTMLInputElement | HTMLTextAreaElement> =\n\t\t\t(fRef ?? _ref) as MutableRefObject<\n\t\t\t\tHTMLInputElement | HTMLTextAreaElement\n\t\t\t>;\n\n\t\tuseEffect(() => {\n\t\t\tsetInputValue(value || '');\n\t\t\tif (!value && autoGrow) {\n\t\t\t\tinputRef.current.style.height = minHeight || '48px';\n\t\t\t}\n\t\t}, [value]);\n\n\t\tuseEffect(() => {\n\t\t\tif (!inputRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tprops.onReferenceInit?.(inputRef.current);\n\t\t}, [inputRef]);\n\n\t\tuseEffect(() => {\n\t\t\tconst numberInput = inputRef.current;\n\t\t\tif (numberInput && ['phonenumber', 'zip', 'number'].includes(type)) {\n\t\t\t\tnumberInput.addEventListener('wheel', onWheel, { passive: false });\n\n\t\t\t\treturn () => {\n\t\t\t\t\tnumberInput.removeEventListener('wheel', onWheel);\n\t\t\t\t};\n\t\t\t}\n\t\t}, []);\n\n\t\tuseEffect(() => {\n\t\t\tif (!reset) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetInputValue('');\n\t\t}, [reset]);\n\n\t\tuseEffect(() => {\n\t\t\tsetIsActive(!!props.isActive);\n\t\t\tif (props.isActive) {\n\t\t\t\tinputRef.current?.focus();\n\t\t\t}\n\t\t}, [props.isActive]);\n\n\t\tuseEffect(() => {\n\t\t\tsetErrorMessage(props.errorMessage);\n\t\t}, [props.errorMessage]);\n\n\t\tuseEffect(() => {\n\t\t\tsetIsInvalid(false);\n\t\t\tif (\n\t\t\t\tprops.state === 'invalid' ||\n\t\t\t\terrorMessage ||\n\t\t\t\tprops.state === 'disabled-invalid'\n\t\t\t) {\n\t\t\t\tsetIsInvalid(true);\n\t\t\t}\n\t\t\tif (props.state === 'active') {\n\t\t\t\tinputRef.current?.focus();\n\t\t\t}\n\t\t}, [props.state, errorMessage]);\n\n\t\tuseEffect(() => {\n\t\t\tsetIsInvalid(!!errorMessage || props.state === 'invalid');\n\t\t}, [errorMessage, props.state]);\n\n\t\tconst executeCallback = (cb: any, ...params: any[]): void => {\n\t\t\tif (!isFunction(cb)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcb(...params);\n\t\t};\n\n\t\tconst getMaxChar = () => {\n\t\t\tif (type === 'zip') {\n\t\t\t\treturn 6;\n\t\t\t}\n\t\t\treturn 2000;\n\t\t};\n\n\t\tconst onKeyDown = (e) => {\n\t\t\tconst MAX_CHAR_LIMIT = maxCharLimit !== 0 ? maxCharLimit : getMaxChar();\n\t\t\tconst KEY_CODES_TO_BE_EXCLUDED = [8];\n\t\t\tconst MIN_CHAR_LIMIT = minCharsToTrigger;\n\t\t\tconst inputText = e.target.value;\n\t\t\tif (\n\t\t\t\tonKeyDownEvent &&\n\t\t\t\t(!inputText.length || inputText.length >= MIN_CHAR_LIMIT)\n\t\t\t) {\n\t\t\t\tonKeyDownEvent(e);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!noKeyDownChange &&\n\t\t\t\t(!inputText.length || inputText.length >= MIN_CHAR_LIMIT)\n\t\t\t) {\n\t\t\t\tonChangeText(value || '', e);\n\t\t\t}\n\t\t\tif (noMaxCharCheck) return;\n\n\t\t\tif (\n\t\t\t\t!KEY_CODES_TO_BE_EXCLUDED.includes(e.which) &&\n\t\t\t\tMAX_CHAR_LIMIT > 0 &&\n\t\t\t\tinputText.length >= MAX_CHAR_LIMIT\n\t\t\t) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t};\n\n\t\tconst onWheel = (event) => {\n\t\t\tevent.preventDefault(); // Prevent the default scroll behavior\n\t\t};\n\n\t\tconst onChange = (e) => {\n\t\t\tlet inputText = e.target.value;\n\t\t\tconst MAX_CHAR_LIMIT =\n\t\t\t\tmaxCharLimit !== 0 ? maxCharLimit + 1 : getMaxChar();\n\t\t\tconst MIN_CHAR_LIMIT = minCharsToTrigger;\n\n\t\t\tif (!allowUnsafeInput && shouldSanitizeForType(type)) {\n\t\t\t\tinputText = sanitizeUnsafeInput(inputText);\n\t\t\t}\n\n\t\t\tif (preventFormulaInjection) {\n\t\t\t\tinputText = escapeFormulaInjection(inputText);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!noMaxCharCheck &&\n\t\t\t\tMAX_CHAR_LIMIT > 0 &&\n\t\t\t\tinputText.length >= MAX_CHAR_LIMIT\n\t\t\t) {\n\t\t\t\t// letting user to copy paste text upto max limit instead of blank action\n\t\t\t\tinputText = inputText.substring(0, MAX_CHAR_LIMIT - 1);\n\t\t\t}\n\n\t\t\tif (!props.textControl) {\n\t\t\t\tsetInputValue(inputText || '');\n\t\t\t}\n\t\t\tif (MIN_CHAR_LIMIT && inputText && inputText.length < MIN_CHAR_LIMIT) {\n\t\t\t\t// if minCharsToTrigger exists and is not reached, do nothing\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonChangeText(inputText, e);\n\t\t\tif (autoGrow) {\n\t\t\t\tinputRef.current.style.height = `${inputRef.current.scrollHeight}px`;\n\t\t\t\tif (!inputText) {\n\t\t\t\t\tinputRef.current.style.height = minHeight || '48px';\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst validateFunction = validate || validateInput;\n\t\t\tif (!validateFunction || !isFunction(validateFunction)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst [isValid, error] = validateFunction(\n\t\t\t\tinputText,\n\t\t\t\ttype,\n\t\t\t\trangeValidation,\n\t\t\t);\n\n\t\t\tsetIsInvalid(!isValid);\n\t\t\tsetErrorMessage(props.errorMessage ? props.errorMessage : error);\n\t\t};\n\n\t\tconst onFocus = (e) => {\n\t\t\tif (!props.skipFocus) {\n\t\t\t\tsetIsActive(true);\n\t\t\t}\n\t\t\texecuteCallback(props.onFocus?.(e));\n\t\t};\n\n\t\tconst onBlur = (e) => {\n\t\t\tif (!props.skipFocus) {\n\t\t\t\tsetIsActive(false);\n\t\t\t}\n\t\t\texecuteCallback(props.onBlur?.(e));\n\t\t};\n\n\t\tconst getInputHTML = () => {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t{type !== 'multiline' && (\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName={truncateText ? 'truncate-class' : ''}\n\t\t\t\t\t\t\tdata-test={props['data-test']}\n\t\t\t\t\t\t\tid={props.id}\n\t\t\t\t\t\t\tstyle={stylesFromOutside?.input ?? {}}\n\t\t\t\t\t\t\tref={inputRef as Ref<HTMLInputElement>}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\ttype={\n\t\t\t\t\t\t\t\t['phonenumber', 'zip', 'number'].includes(type)\n\t\t\t\t\t\t\t\t\t? 'number'\n\t\t\t\t\t\t\t\t\t: type\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\tonFocus={(e) => onFocus(e)}\n\t\t\t\t\t\t\tonBlur={(e) => onBlur(e)}\n\t\t\t\t\t\t\tplaceholder={placeholder || 'Enter here'}\n\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\tonClick={(e) => executeCallback(props.onClick)}\n\t\t\t\t\t\t\tonKeyDown={(e) => onKeyDown(e)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{type === 'multiline' && (\n\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\tdata-test={props['data-test']}\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\tref={inputRef as Ref<HTMLTextAreaElement>}\n\t\t\t\t\t\t\tonFocus={(e) => onFocus(e)}\n\t\t\t\t\t\t\tonBlur={(e) => onBlur(e)}\n\t\t\t\t\t\t\tonClick={(e) => executeCallback(props.onClick)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\tplaceholder={placeholder || 'Enter here'}\n\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\tonKeyDown={(e) => onKeyDown(e)}\n\t\t\t\t\t\t\tmaxLength={maxCharLimit > 0 ? maxCharLimit : undefined}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t);\n\t\t};\n\n\t\treturn (\n\t\t\t<SC.RootContainer\n\t\t\t\twidth={props.width}\n\t\t\t\theight={props.height}\n\t\t\t\tstate={state}\n\t\t\t\ttype={type}\n\t\t\t\tstyle={stylesFromOutside?.RootContainer ?? {}}\n\t\t\t>\n\t\t\t\t<div className=\"flex-align-center\">\n\t\t\t\t\t{!noErrorHint && (!!hintText || !!errorMessage) && (\n\t\t\t\t\t\t<SC.InputFooter invalid={!!errorMessage}>\n\t\t\t\t\t\t\t{!!errorMessage && <ErrorIcon width={16} height={16} />}\n\t\t\t\t\t\t\t{errorMessage || hintText}\n\t\t\t\t\t\t</SC.InputFooter>\n\t\t\t\t\t)}\n\t\t\t\t\t{maxCharLimit > 0 && maxCharLimitPosition === 'BOTTOM' && (\n\t\t\t\t\t\t<SC.MaxCharStyle position={'BOTTOM'} style={maxCharStyle}>\n\t\t\t\t\t\t\t{(value ?? '').toString()?.length ?? 0}/{maxCharLimit}\n\t\t\t\t\t\t</SC.MaxCharStyle>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<SC.InputWrapper\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tstate={state}\n\t\t\t\t\twidth={props.width}\n\t\t\t\t\tisActive={state === 'active' || isActive}\n\t\t\t\t\tisInvalid={isInvalid}\n\t\t\t\t\tstyle={stylesFromOutside?.InputWrapper ?? inputWrapperStyles ?? {}}\n\t\t\t\t\tversion={version}\n\t\t\t\t\theight={props.height}\n\t\t\t\t\thightlightInputColor={hightlightInputColor}\n\t\t\t\t\thideBorder={hideBorder}\n\t\t\t\t>\n\t\t\t\t\t{!!LeftIcon && (\n\t\t\t\t\t\t<SC.IconHolder\n\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\t\t\tonClick={() => executeCallback(leftIcon?.callback)}\n\t\t\t\t\t\t\tisLeft={true}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t...(stylesFromOutside?.IconHolder ?? {}),\n\t\t\t\t\t\t\t\t...leftIconStyle,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LeftIcon />\n\t\t\t\t\t\t</SC.IconHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!prefixText && (\n\t\t\t\t\t\t<PrefixHolder variant={variant}>{prefixText}</PrefixHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'default' && (\n\t\t\t\t\t\t<SC.InputContainer\n\t\t\t\t\t\t\theight={props.height}\n\t\t\t\t\t\t\ttype={props.type}\n\t\t\t\t\t\t\tminHeight={minHeight}\n\t\t\t\t\t\t\tmaxHeight={maxHeight}\n\t\t\t\t\t\t\tautoGrow={autoGrow}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{getInputHTML()}\n\t\t\t\t\t\t</SC.InputContainer>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'small' && (\n\t\t\t\t\t\t<SC.InputContainerSmall height={props.height} type={props.type}>\n\t\t\t\t\t\t\t{getInputHTML()}\n\t\t\t\t\t\t</SC.InputContainerSmall>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'x-small' && (\n\t\t\t\t\t\t<SC.InputContainerXSmall height={props.height} type={props.type}>\n\t\t\t\t\t\t\t{getInputHTML()}\n\t\t\t\t\t\t</SC.InputContainerXSmall>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!RightIcon && (\n\t\t\t\t\t\t<SC.IconHolder\n\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\t\t\tonClick={() => executeCallback(rightIcon?.callback)}\n\t\t\t\t\t\t\tisLeft={false}\n\t\t\t\t\t\t\tdata-test={rightIcon?.['data-test']}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RightIcon />\n\t\t\t\t\t\t</SC.IconHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!suffixText && (\n\t\t\t\t\t\t<SuffixHolder variant={variant}>{suffixText}</SuffixHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{button && button.text && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tbuttonText={button.text}\n\t\t\t\t\t\t\tbuttonType={button.buttonType}\n\t\t\t\t\t\t\tonClick={() => executeCallback(button?.onClick)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{button && button.buttonProps && <Button {...button.buttonProps} />}\n\t\t\t\t</SC.InputWrapper>\n\t\t\t\t{!hideInputHeader && (!!labelText || !!maxCharLimit) && (\n\t\t\t\t\t<SC.InputHeader\n\t\t\t\t\t\tinvalid={isInvalid}\n\t\t\t\t\t\tmaxCharAlignment={maxCharAlignment}\n\t\t\t\t\t>\n\t\t\t\t\t\t{labelElement && labelElement}\n\t\t\t\t\t\t<div className=\"label__container\">\n\t\t\t\t\t\t\t{labelTextBold ? (\n\t\t\t\t\t\t\t\t<TitleSmall>\n\t\t\t\t\t\t\t\t\t{labelText}\n\t\t\t\t\t\t\t\t\t{isRequired ? <span>*</span> : ''}\n\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<BodySecondary>\n\t\t\t\t\t\t\t\t\t{labelText}\n\t\t\t\t\t\t\t\t\t{isRequired ? <span>*</span> : ''}\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.tooltipText && (\n\t\t\t\t\t\t\t\t<Tooltip body={props.tooltipText} placement={'top'}>\n\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t<InfoIcon\n\t\t\t\t\t\t\t\t\t\t\tstyle={{ marginTop: -3 }}\n\t\t\t\t\t\t\t\t\t\t\twidth={18}\n\t\t\t\t\t\t\t\t\t\t\theight={18}\n\t\t\t\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t\t\t\tisInvalid\n\t\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.content.negative\n\t\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.primary\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{maxCharLimit > 0 && maxCharLimitPosition === 'TOP' && (\n\t\t\t\t\t\t\t<SC.MaxCharStyle style={maxCharStyle}>\n\t\t\t\t\t\t\t\t{(value ?? '').toString()?.length ?? 0}/{maxCharLimit}\n\t\t\t\t\t\t\t</SC.MaxCharStyle>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</SC.InputHeader>\n\t\t\t\t)}\n\t\t\t</SC.RootContainer>\n\t\t);\n\t},\n);\n\nInput.displayName = 'Input';\n"],"names":["Input","forwardRef","props","fRef","placeholder","leftIcon","rightIcon","labelText","maxCharLimit","isRequired","hintText","type","state","validate","variant","button","suffixText","prefixText","onChangeText","value","noErrorHint","reset","rangeValidation","noKeyDownChange","version","noMaxCharCheck","labelElement","autoGrow","minHeight","maxHeight","labelTextBold","truncateText","maxCharLimitPosition","maxCharStyle","hightlightInputColor","onKeyDownEvent","hideInputHeader","hideBorder","inputWrapperStyles","minCharsToTrigger","maxCharAlignment","isDisabled","allowUnsafeInput","preventFormulaInjection","leftIconStyle","LeftIcon","RightIcon","isInvalid","setIsInvalid","useState","isActive","setIsActive","errorMessage","setErrorMessage","iconSize","stylesFromOutside","useContext","InputStyleContext","inputValue","setInputValue","_ref","useRef","inputRef","useEffect","numberInput","onWheel","executeCallback","cb","params","isFunction","getMaxChar","onKeyDown","e","MAX_CHAR_LIMIT","KEY_CODES_TO_BE_EXCLUDED","MIN_CHAR_LIMIT","inputText","event","onChange","shouldSanitizeForType","sanitizeUnsafeInput","escapeFormulaInjection","validateFunction","validateInput","isValid","error","onFocus","onBlur","getInputHTML","jsxs","Fragment","jsx","SC.RootContainer","SC.InputFooter","ErrorIcon","SC.MaxCharStyle","SC.InputWrapper","SC.IconHolder","PrefixHolder","SC.InputContainer","SC.InputContainerSmall","SC.InputContainerXSmall","SuffixHolder","Button","SC.InputHeader","TitleSmall","BodySecondary","Tooltip","InfoIcon","COLORS"],"mappings":";;;;;;;;;;;;AA2BO,MAAMA,KAAQC;AAAA,EACpB,CACCC,GACAC,OACI;AACJ,UAAM;AAAA,MACL,aAAAC;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,cAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,MAAAC;AAAA,MACA,OAAAC;AAAA,MACA,UAAAC;AAAA,MACA,SAAAC;AAAA,MACA,QAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,OAAAC;AAAA,MACA,aAAAC;AAAA,MACA,OAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,SAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,YAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,YAAAC,IAAa;AAAA,MACb,kBAAAC;AAAA,MACA,yBAAAC;AAAA,MACA,eAAAC;AAAA,IAAA,IACG;AAAA,MACH,cAAc;AAAA,MACd,MAAM;AAAA,MACN,SAAS;AAAA,M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gBAAAkF,EAAC,QAAA,EAAK,UAAA,IAAA,CAAC,IAAU;AAAA,kBAAA,EAAA,CAChC,sBAECe,IAAA,EACC,UAAA;AAAA,oBAAAnG;AAAA,oBACAE,IAAa,gBAAAkF,EAAC,QAAA,EAAK,UAAA,IAAA,CAAC,IAAU;AAAA,kBAAA,GAChC;AAAA,kBAEAzF,EAAM,eACN,gBAAAyF,EAACgB,IAAA,EAAQ,MAAMzG,EAAM,aAAa,WAAW,OAC5C,UAAA,gBAAAyF,EAAC,QAAA,EACA,UAAA,gBAAAA;AAAA,oBAACiB;AAAAA,oBAAA;AAAA,sBACA,OAAO,EAAE,WAAW,GAAA;AAAA,sBACpB,OAAO;AAAA,sBACP,QAAQ;AAAA,sBACR,OACC7D,IACG8D,GAAO,QAAQ,WACfA,GAAO,QAAQ;AAAA,oBAAA;AAAA,kBAAA,GAGrB,EAAA,CACD;AAAA,gBAAA,GAEF;AAAA,gBACCrG,IAAe,KAAKwB,MAAyB,2BAC5C+D,IAAA,EAAgB,OAAO9D,GACrB,UAAA;AAAA,mBAAAd,KAAS,IAAI,SAAA,GAAY,UAAU;AAAA,kBAAE;AAAA,kBAAEX;AAAA,gBAAA,EAAA,CAC1C;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAEF;AAAA,MAAA;AAAA,IAAA;AAAA,EAIJ;AACD;AAEAR,GAAM,cAAc;"}
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../../src/components/input/Input.tsx"],"sourcesContent":["import InfoIcon from '@src/assets/icons/info.svg';\nimport { escapeFormulaInjection } from '@src/helpers/sanitize';\nimport React, {\n\tforwardRef,\n\tMutableRefObject,\n\tRef,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport { Button } from '@src/components/button';\nimport {\n\tisFunction,\n\tsanitizeUnsafeInput,\n\tshouldSanitizeForType,\n\tvalidateInput,\n} from '@src/components/input/Input-helper';\nimport { Tooltip } from '@src/components/tooltips';\nimport { BodySecondary, TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport ErrorIcon from '../../assets/icons/errorInfo.svg';\nimport { InputStyleContext } from './context/InputStyleProvider';\nimport { InputProps, InputTypeI, InputVariant } from './Input.model';\nimport * as SC from './Input.styled';\nimport { PrefixHolder, SuffixHolder } from './Input.styled';\n\nexport const Input = forwardRef(\n\t(\n\t\tprops: InputProps,\n\t\tfRef: React.ForwardedRef<HTMLInputElement | HTMLTextAreaElement | null>,\n\t) => {\n\t\tconst {\n\t\t\tplaceholder,\n\t\t\tleftIcon,\n\t\t\trightIcon,\n\t\t\tlabelText,\n\t\t\tmaxCharLimit,\n\t\t\tisRequired,\n\t\t\thintText,\n\t\t\ttype,\n\t\t\tstate,\n\t\t\tvalidate,\n\t\t\tvariant,\n\t\t\tbutton,\n\t\t\tsuffixText,\n\t\t\tprefixText,\n\t\t\tonChangeText,\n\t\t\tvalue,\n\t\t\tnoErrorHint,\n\t\t\treset,\n\t\t\trangeValidation,\n\t\t\tnoKeyDownChange,\n\t\t\tversion,\n\t\t\tnoMaxCharCheck,\n\t\t\tlabelElement,\n\t\t\tautoGrow,\n\t\t\tminHeight,\n\t\t\tmaxHeight,\n\t\t\tlabelTextBold,\n\t\t\ttruncateText,\n\t\t\tmaxCharLimitPosition,\n\t\t\tmaxCharStyle,\n\t\t\thightlightInputColor,\n\t\t\tonKeyDownEvent,\n\t\t\thideInputHeader,\n\t\t\thideBorder,\n\t\t\tinputWrapperStyles,\n\t\t\tminCharsToTrigger,\n\t\t\tmaxCharAlignment,\n\t\t\tisDisabled = false,\n\t\t\tsolidDisabled = false,\n\t\t\tallowUnsafeInput,\n\t\t\tpreventFormulaInjection,\n\t\t\tleftIconStyle,\n\t\t} = {\n\t\t\tmaxCharLimit: 0,\n\t\t\ttype: 'text' as InputTypeI,\n\t\t\tvariant: 'default' as InputVariant,\n\t\t\tmaxCharLimitPosition: 'TOP',\n\t\t\tminCharsToTrigger: 0,\n\t\t\tmaxCharAlignment: false,\n\t\t\t...props,\n\t\t};\n\t\tconst LeftIcon = leftIcon?.icon;\n\t\tconst RightIcon = rightIcon?.icon;\n\t\tconst [isInvalid, setIsInvalid] = useState<boolean>(false);\n\t\tconst [isActive, setIsActive] = useState<boolean>(false);\n\t\tconst [errorMessage, setErrorMessage] = useState<string>();\n\t\tconst iconSize =\n\t\t\tvariant === 'x-small' ? '12px' : variant === 'small' ? '18px' : '22px';\n\t\tconst stylesFromOutside = useContext(InputStyleContext);\n\t\tconst [inputValue, setInputValue] = useState<string>('');\n\t\tconst _ref = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n\t\tconst inputRef: MutableRefObject<HTMLInputElement | HTMLTextAreaElement> =\n\t\t\t(fRef ?? _ref) as MutableRefObject<\n\t\t\t\tHTMLInputElement | HTMLTextAreaElement\n\t\t\t>;\n\n\t\tuseEffect(() => {\n\t\t\tsetInputValue(value || '');\n\t\t\tif (!value && autoGrow) {\n\t\t\t\tinputRef.current.style.height = minHeight || '48px';\n\t\t\t}\n\t\t}, [value]);\n\n\t\tuseEffect(() => {\n\t\t\tif (!inputRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tprops.onReferenceInit?.(inputRef.current);\n\t\t}, [inputRef]);\n\n\t\tuseEffect(() => {\n\t\t\tconst numberInput = inputRef.current;\n\t\t\tif (numberInput && ['phonenumber', 'zip', 'number'].includes(type)) {\n\t\t\t\tnumberInput.addEventListener('wheel', onWheel, { passive: false });\n\n\t\t\t\treturn () => {\n\t\t\t\t\tnumberInput.removeEventListener('wheel', onWheel);\n\t\t\t\t};\n\t\t\t}\n\t\t}, []);\n\n\t\tuseEffect(() => {\n\t\t\tif (!reset) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetInputValue('');\n\t\t}, [reset]);\n\n\t\tuseEffect(() => {\n\t\t\tsetIsActive(!!props.isActive);\n\t\t\tif (props.isActive) {\n\t\t\t\tinputRef.current?.focus();\n\t\t\t}\n\t\t}, [props.isActive]);\n\n\t\tuseEffect(() => {\n\t\t\tsetErrorMessage(props.errorMessage);\n\t\t}, [props.errorMessage]);\n\n\t\tuseEffect(() => {\n\t\t\tsetIsInvalid(false);\n\t\t\tif (\n\t\t\t\tprops.state === 'invalid' ||\n\t\t\t\terrorMessage ||\n\t\t\t\tprops.state === 'disabled-invalid'\n\t\t\t) {\n\t\t\t\tsetIsInvalid(true);\n\t\t\t}\n\t\t\tif (props.state === 'active') {\n\t\t\t\tinputRef.current?.focus();\n\t\t\t}\n\t\t}, [props.state, errorMessage]);\n\n\t\tuseEffect(() => {\n\t\t\tsetIsInvalid(!!errorMessage || props.state === 'invalid');\n\t\t}, [errorMessage, props.state]);\n\n\t\tconst executeCallback = (cb: any, ...params: any[]): void => {\n\t\t\tif (!isFunction(cb)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcb(...params);\n\t\t};\n\n\t\tconst getMaxChar = () => {\n\t\t\tif (type === 'zip') {\n\t\t\t\treturn 6;\n\t\t\t}\n\t\t\treturn 2000;\n\t\t};\n\n\t\tconst onKeyDown = (e) => {\n\t\t\tconst MAX_CHAR_LIMIT = maxCharLimit !== 0 ? maxCharLimit : getMaxChar();\n\t\t\tconst KEY_CODES_TO_BE_EXCLUDED = [8];\n\t\t\tconst MIN_CHAR_LIMIT = minCharsToTrigger;\n\t\t\tconst inputText = e.target.value;\n\t\t\tif (\n\t\t\t\tonKeyDownEvent &&\n\t\t\t\t(!inputText.length || inputText.length >= MIN_CHAR_LIMIT)\n\t\t\t) {\n\t\t\t\tonKeyDownEvent(e);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!noKeyDownChange &&\n\t\t\t\t(!inputText.length || inputText.length >= MIN_CHAR_LIMIT)\n\t\t\t) {\n\t\t\t\tonChangeText(value || '', e);\n\t\t\t}\n\t\t\tif (noMaxCharCheck) return;\n\n\t\t\tif (\n\t\t\t\t!KEY_CODES_TO_BE_EXCLUDED.includes(e.which) &&\n\t\t\t\tMAX_CHAR_LIMIT > 0 &&\n\t\t\t\tinputText.length >= MAX_CHAR_LIMIT\n\t\t\t) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t};\n\n\t\tconst onWheel = (event) => {\n\t\t\tevent.preventDefault(); // Prevent the default scroll behavior\n\t\t};\n\n\t\tconst onChange = (e) => {\n\t\t\tlet inputText = e.target.value;\n\t\t\tconst MAX_CHAR_LIMIT =\n\t\t\t\tmaxCharLimit !== 0 ? maxCharLimit + 1 : getMaxChar();\n\t\t\tconst MIN_CHAR_LIMIT = minCharsToTrigger;\n\n\t\t\tif (!allowUnsafeInput && shouldSanitizeForType(type)) {\n\t\t\t\tinputText = sanitizeUnsafeInput(inputText);\n\t\t\t}\n\n\t\t\tif (preventFormulaInjection) {\n\t\t\t\tinputText = escapeFormulaInjection(inputText);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!noMaxCharCheck &&\n\t\t\t\tMAX_CHAR_LIMIT > 0 &&\n\t\t\t\tinputText.length >= MAX_CHAR_LIMIT\n\t\t\t) {\n\t\t\t\t// letting user to copy paste text upto max limit instead of blank action\n\t\t\t\tinputText = inputText.substring(0, MAX_CHAR_LIMIT - 1);\n\t\t\t}\n\n\t\t\tif (!props.textControl) {\n\t\t\t\tsetInputValue(inputText || '');\n\t\t\t}\n\t\t\tif (MIN_CHAR_LIMIT && inputText && inputText.length < MIN_CHAR_LIMIT) {\n\t\t\t\t// if minCharsToTrigger exists and is not reached, do nothing\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonChangeText(inputText, e);\n\t\t\tif (autoGrow) {\n\t\t\t\tinputRef.current.style.height = `${inputRef.current.scrollHeight}px`;\n\t\t\t\tif (!inputText) {\n\t\t\t\t\tinputRef.current.style.height = minHeight || '48px';\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst validateFunction = validate || validateInput;\n\t\t\tif (!validateFunction || !isFunction(validateFunction)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst [isValid, error] = validateFunction(\n\t\t\t\tinputText,\n\t\t\t\ttype,\n\t\t\t\trangeValidation,\n\t\t\t);\n\n\t\t\tsetIsInvalid(!isValid);\n\t\t\tsetErrorMessage(props.errorMessage ? props.errorMessage : error);\n\t\t};\n\n\t\tconst onFocus = (e) => {\n\t\t\tif (!props.skipFocus) {\n\t\t\t\tsetIsActive(true);\n\t\t\t}\n\t\t\texecuteCallback(props.onFocus?.(e));\n\t\t};\n\n\t\tconst onBlur = (e) => {\n\t\t\tif (!props.skipFocus) {\n\t\t\t\tsetIsActive(false);\n\t\t\t}\n\t\t\texecuteCallback(props.onBlur?.(e));\n\t\t};\n\n\t\tconst getInputHTML = () => {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t{type !== 'multiline' && (\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName={truncateText ? 'truncate-class' : ''}\n\t\t\t\t\t\t\tdata-test={props['data-test']}\n\t\t\t\t\t\t\tid={props.id}\n\t\t\t\t\t\t\tstyle={stylesFromOutside?.input ?? {}}\n\t\t\t\t\t\t\tref={inputRef as Ref<HTMLInputElement>}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\ttype={\n\t\t\t\t\t\t\t\t['phonenumber', 'zip', 'number'].includes(type)\n\t\t\t\t\t\t\t\t\t? 'number'\n\t\t\t\t\t\t\t\t\t: type\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\tonFocus={(e) => onFocus(e)}\n\t\t\t\t\t\t\tonBlur={(e) => onBlur(e)}\n\t\t\t\t\t\t\tplaceholder={placeholder || 'Enter here'}\n\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\tonClick={(e) => executeCallback(props.onClick)}\n\t\t\t\t\t\t\tonKeyDown={(e) => onKeyDown(e)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{type === 'multiline' && (\n\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\tdata-test={props['data-test']}\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\tref={inputRef as Ref<HTMLTextAreaElement>}\n\t\t\t\t\t\t\tonFocus={(e) => onFocus(e)}\n\t\t\t\t\t\t\tonBlur={(e) => onBlur(e)}\n\t\t\t\t\t\t\tonClick={(e) => executeCallback(props.onClick)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\tplaceholder={placeholder || 'Enter here'}\n\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\tonKeyDown={(e) => onKeyDown(e)}\n\t\t\t\t\t\t\tmaxLength={maxCharLimit > 0 ? maxCharLimit : undefined}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t);\n\t\t};\n\n\t\treturn (\n\t\t\t<SC.RootContainer\n\t\t\t\twidth={props.width}\n\t\t\t\theight={props.height}\n\t\t\t\tstate={state}\n\t\t\t\tsolidDisabled={solidDisabled}\n\t\t\t\ttype={type}\n\t\t\t\tstyle={stylesFromOutside?.RootContainer ?? {}}\n\t\t\t>\n\t\t\t\t<div className=\"flex-align-center\">\n\t\t\t\t\t{!noErrorHint && (!!hintText || !!errorMessage) && (\n\t\t\t\t\t\t<SC.InputFooter invalid={!!errorMessage}>\n\t\t\t\t\t\t\t{!!errorMessage && <ErrorIcon width={16} height={16} />}\n\t\t\t\t\t\t\t{errorMessage || hintText}\n\t\t\t\t\t\t</SC.InputFooter>\n\t\t\t\t\t)}\n\t\t\t\t\t{maxCharLimit > 0 && maxCharLimitPosition === 'BOTTOM' && (\n\t\t\t\t\t\t<SC.MaxCharStyle position={'BOTTOM'} style={maxCharStyle}>\n\t\t\t\t\t\t\t{(value ?? '').toString()?.length ?? 0}/{maxCharLimit}\n\t\t\t\t\t\t</SC.MaxCharStyle>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<SC.InputWrapper\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tstate={state}\n\t\t\t\t\tsolidDisabled={solidDisabled}\n\t\t\t\t\twidth={props.width}\n\t\t\t\t\tisActive={state === 'active' || isActive}\n\t\t\t\t\tisInvalid={isInvalid}\n\t\t\t\t\tstyle={stylesFromOutside?.InputWrapper ?? inputWrapperStyles ?? {}}\n\t\t\t\t\tversion={version}\n\t\t\t\t\theight={props.height}\n\t\t\t\t\thightlightInputColor={hightlightInputColor}\n\t\t\t\t\thideBorder={hideBorder}\n\t\t\t\t>\n\t\t\t\t\t{!!LeftIcon && (\n\t\t\t\t\t\t<SC.IconHolder\n\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\t\t\tonClick={() => executeCallback(leftIcon?.callback)}\n\t\t\t\t\t\t\tisLeft={true}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t...(stylesFromOutside?.IconHolder ?? {}),\n\t\t\t\t\t\t\t\t...leftIconStyle,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LeftIcon />\n\t\t\t\t\t\t</SC.IconHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!prefixText && (\n\t\t\t\t\t\t<PrefixHolder variant={variant}>{prefixText}</PrefixHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'default' && (\n\t\t\t\t\t\t<SC.InputContainer\n\t\t\t\t\t\t\theight={props.height}\n\t\t\t\t\t\t\ttype={props.type}\n\t\t\t\t\t\t\tminHeight={minHeight}\n\t\t\t\t\t\t\tmaxHeight={maxHeight}\n\t\t\t\t\t\t\tautoGrow={autoGrow}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{getInputHTML()}\n\t\t\t\t\t\t</SC.InputContainer>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'small' && (\n\t\t\t\t\t\t<SC.InputContainerSmall height={props.height} type={props.type}>\n\t\t\t\t\t\t\t{getInputHTML()}\n\t\t\t\t\t\t</SC.InputContainerSmall>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'x-small' && (\n\t\t\t\t\t\t<SC.InputContainerXSmall height={props.height} type={props.type}>\n\t\t\t\t\t\t\t{getInputHTML()}\n\t\t\t\t\t\t</SC.InputContainerXSmall>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!RightIcon && (\n\t\t\t\t\t\t<SC.IconHolder\n\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\t\t\tonClick={() => executeCallback(rightIcon?.callback)}\n\t\t\t\t\t\t\tisLeft={false}\n\t\t\t\t\t\t\tdata-test={rightIcon?.['data-test']}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RightIcon />\n\t\t\t\t\t\t</SC.IconHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!suffixText && (\n\t\t\t\t\t\t<SuffixHolder variant={variant}>{suffixText}</SuffixHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{button && button.text && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tbuttonText={button.text}\n\t\t\t\t\t\t\tbuttonType={button.buttonType}\n\t\t\t\t\t\t\tonClick={() => executeCallback(button?.onClick)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{button && button.buttonProps && <Button {...button.buttonProps} />}\n\t\t\t\t</SC.InputWrapper>\n\t\t\t\t{!hideInputHeader && (!!labelText || !!maxCharLimit) && (\n\t\t\t\t\t<SC.InputHeader\n\t\t\t\t\t\tinvalid={isInvalid}\n\t\t\t\t\t\tmaxCharAlignment={maxCharAlignment}\n\t\t\t\t\t>\n\t\t\t\t\t\t{labelElement && labelElement}\n\t\t\t\t\t\t<div className=\"label__container\">\n\t\t\t\t\t\t\t{labelTextBold ? (\n\t\t\t\t\t\t\t\t<TitleSmall>\n\t\t\t\t\t\t\t\t\t{labelText}\n\t\t\t\t\t\t\t\t\t{isRequired ? <span>*</span> : ''}\n\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<BodySecondary>\n\t\t\t\t\t\t\t\t\t{labelText}\n\t\t\t\t\t\t\t\t\t{isRequired ? <span>*</span> : ''}\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.tooltipText && (\n\t\t\t\t\t\t\t\t<Tooltip body={props.tooltipText} placement={'top'}>\n\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t<InfoIcon\n\t\t\t\t\t\t\t\t\t\t\tdata-test=\"input-tooltip-icon\"\n\t\t\t\t\t\t\t\t\t\t\tstyle={{ marginTop: -3 }}\n\t\t\t\t\t\t\t\t\t\t\twidth={props.tooltipIconSize ?? 18}\n\t\t\t\t\t\t\t\t\t\t\theight={props.tooltipIconSize ?? 18}\n\t\t\t\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t\t\t\tisInvalid\n\t\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.content.negative\n\t\t\t\t\t\t\t\t\t\t\t\t\t: props.tooltipIconColor ?? COLORS.content.primary\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{maxCharLimit > 0 && maxCharLimitPosition === 'TOP' && (\n\t\t\t\t\t\t\t<SC.MaxCharStyle style={maxCharStyle}>\n\t\t\t\t\t\t\t\t{(value ?? '').toString()?.length ?? 0}/{maxCharLimit}\n\t\t\t\t\t\t\t</SC.MaxCharStyle>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</SC.InputHeader>\n\t\t\t\t)}\n\t\t\t</SC.RootContainer>\n\t\t);\n\t},\n);\n\nInput.displayName = 'Input';\n"],"names":["Input","forwardRef","props","fRef","placeholder","leftIcon","rightIcon","labelText","maxCharLimit","isRequired","hintText","type","state","validate","variant","button","suffixText","prefixText","onChangeText","value","noErrorHint","reset","rangeValidation","noKeyDownChange","version","noMaxCharCheck","labelElement","autoGrow","minHeight","maxHeight","labelTextBold","truncateText","maxCharLimitPosition","maxCharStyle","hightlightInputColor","onKeyDownEvent","hideInputHeader","hideBorder","inputWrapperStyles","minCharsToTrigger","maxCharAlignment","isDisabled","solidDisabled","allowUnsafeInput","preventFormulaInjection","leftIconStyle","LeftIcon","RightIcon","isInvalid","setIsInvalid","useState","isActive","setIsActive","errorMessage","setErrorMessage","iconSize","stylesFromOutside","useContext","InputStyleContext","inputValue","setInputValue","_ref","useRef","inputRef","useEffect","numberInput","onWheel","executeCallback","cb","params","isFunction","getMaxChar","onKeyDown","e","MAX_CHAR_LIMIT","KEY_CODES_TO_BE_EXCLUDED","MIN_CHAR_LIMIT","inputText","event","onChange","shouldSanitizeForType","sanitizeUnsafeInput","escapeFormulaInjection","validateFunction","validateInput","isValid","error","onFocus","onBlur","getInputHTML","jsxs","Fragment","jsx","SC.RootContainer","SC.InputFooter","ErrorIcon","SC.MaxCharStyle","SC.InputWrapper","SC.IconHolder","PrefixHolder","SC.InputContainer","SC.InputContainerSmall","SC.InputContainerXSmall","SuffixHolder","Button","SC.InputHeader","TitleSmall","BodySecondary","Tooltip","InfoIcon","COLORS"],"mappings":";;;;;;;;;;;;AA2BO,MAAMA,KAAQC;AAAA,EACpB,CACCC,GACAC,OACI;AACJ,UAAM;AAAA,MACL,aAAAC;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,cAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,MAAAC;AAAA,MACA,OAAAC;AAAA,MACA,UAAAC;AAAA,MACA,SAAAC;AAAA,MACA,QAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,OAAAC;AAAA,MACA,aAA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GAEF;AAAA,gBACCtG,IAAe,KAAKwB,MAAyB,2BAC5CgE,IAAA,EAAgB,OAAO/D,GACrB,UAAA;AAAA,mBAAAd,KAAS,IAAI,SAAA,GAAY,UAAU;AAAA,kBAAE;AAAA,kBAAEX;AAAA,gBAAA,EAAA,CAC1C;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAEF;AAAA,MAAA;AAAA,IAAA;AAAA,EAIJ;AACD;AAEAR,GAAM,cAAc;"}
|
|
@@ -58,6 +58,8 @@ export interface InputProps {
|
|
|
58
58
|
textControl?: boolean;
|
|
59
59
|
noMaxCharCheck?: boolean;
|
|
60
60
|
tooltipText?: string;
|
|
61
|
+
tooltipIconSize?: number;
|
|
62
|
+
tooltipIconColor?: string;
|
|
61
63
|
autoGrow?: boolean;
|
|
62
64
|
minHeight?: string;
|
|
63
65
|
maxHeight?: string;
|
|
@@ -73,6 +75,8 @@ export interface InputProps {
|
|
|
73
75
|
inputWrapperStyles?: React.CSSProperties;
|
|
74
76
|
minCharsToTrigger?: number;
|
|
75
77
|
isDisabled?: boolean;
|
|
78
|
+
/** When the input is in a disabled/read-only state, render a solid grey box (background.base) with secondary text and no opacity wash. */
|
|
79
|
+
solidDisabled?: boolean;
|
|
76
80
|
allowUnsafeInput?: boolean;
|
|
77
81
|
preventFormulaInjection?: boolean;
|
|
78
82
|
maxCharAlignment?: boolean;
|
|
@@ -9,6 +9,7 @@ export declare const InputWrapper: import('styled-components').StyledComponent<"
|
|
|
9
9
|
version?: "1.0" | "2.0" | "3.0" | undefined;
|
|
10
10
|
hightlightInputColor?: string | undefined;
|
|
11
11
|
hideBorder?: boolean | undefined;
|
|
12
|
+
solidDisabled?: boolean | undefined;
|
|
12
13
|
}, never>;
|
|
13
14
|
export declare const IconHolder: import('styled-components').StyledComponent<"div", any, {
|
|
14
15
|
isLeft?: boolean | undefined;
|
|
@@ -62,6 +63,7 @@ export declare const RootContainer: import('styled-components').StyledComponent<
|
|
|
62
63
|
height?: string | undefined;
|
|
63
64
|
state?: InputStateI | undefined;
|
|
64
65
|
type: InputTypeI;
|
|
66
|
+
solidDisabled?: boolean | undefined;
|
|
65
67
|
}, never>;
|
|
66
68
|
export declare const PrefixHolder: import('styled-components').StyledComponent<"div", any, {
|
|
67
69
|
numberOfLines?: number | undefined;
|