@pismo/marola 1.1.5 → 1.1.6
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/Dialog.module-CE1Q-5tJ.js +1 -2
- package/dist/Group-ZXteFV4M.js +1 -2
- package/dist/Popover.module-B4boCutS.js +1 -2
- package/dist/SelectButton-DbiTJagF.js +1 -2
- package/dist/Tabs.module-BNRwj3Z0.js +1 -2
- package/dist/Toggle-BuZjueQ7.js +1 -2
- package/dist/components/Adornment/Adornment.js +1 -2
- package/dist/components/Advice/Advice.js +1 -2
- package/dist/components/Alert/Alert.js +1 -2
- package/dist/components/Autocomplete/Autocomplete.js +1 -2
- package/dist/components/Avatar/Avatar.js +1 -2
- package/dist/components/BankCard/BankCard.js +1 -2
- package/dist/components/Button/Button.js +1 -2
- package/dist/components/Calendar/Calendar.js +1 -2
- package/dist/components/Checkbox/Checkbox.js +1 -2
- package/dist/components/Description/Description.js +1 -2
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +1 -2
- package/dist/components/IconButton/IconButton.js +1 -2
- package/dist/components/Input/Input.d.ts +7 -1
- package/dist/components/Input/Input.js +360 -324
- package/dist/components/Input/Input.stories.d.ts +1 -0
- package/dist/components/InputSearch/InputSearch.d.ts +4 -1
- package/dist/components/InputSearch/InputSearch.js +1 -2
- package/dist/components/InputSearch/InputSearch.stories.d.ts +4 -1
- package/dist/components/LoadingSpinner/LoadingSpinner.js +1 -2
- package/dist/components/PageHeader/PageHeader.js +1 -2
- package/dist/components/Pagination/Pagination.js +1 -2
- package/dist/components/RadioButton/RadioButton.js +1 -2
- package/dist/components/ResultWithChips/ResultWithChips.js +1 -2
- package/dist/components/Skeleton/Skeleton.js +1 -2
- package/dist/components/Snackbar/Snackbar.js +1 -2
- package/dist/components/SortTooltip/SortTooltip.js +1 -2
- package/dist/components/Stepper/Stepper.js +1 -2
- package/dist/components/StepperNavigator/StepperNavigator.js +1 -2
- package/dist/components/Table/Table.js +1 -2
- package/dist/components/Tag/Tag.js +1 -2
- package/dist/components/TextDisplay/TextDisplay.js +1 -2
- package/dist/components/Toggle/Toggle.js +1 -2
- package/dist/components/Tooltip/Tooltip.js +1 -2
- package/dist/components/TransactionRow/TransactionRow.js +1 -2
- package/dist/components/Typography/Typography.js +1 -2
- package/dist/utils/inputNumberAsText.d.ts +10 -0
- package/dist/utils/inputNumberAsText.js +42 -0
- package/package.json +2 -2
|
@@ -1,229 +1,229 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { c as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Typography as
|
|
8
|
-
import { g as
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
for (let
|
|
12
|
-
|
|
13
|
-
return "Minified MUI error #" +
|
|
1
|
+
import { jsxs as D, jsx as M } from "react/jsx-runtime";
|
|
2
|
+
import * as V from "react";
|
|
3
|
+
import { forwardRef as _e, useState as fe, useId as me, useMemo as re } from "react";
|
|
4
|
+
import { formatDecimalValue as ie, parseToInteger as he, allowOnlyIntegerNumbers as ge, allowOnlyNumbers as be } from "../../utils/inputNumberAsText.js";
|
|
5
|
+
import { c as k } from "../../clsx-DB4S2d7J.js";
|
|
6
|
+
import { Icon as ye } from "../Icon/Icon.js";
|
|
7
|
+
import { Typography as le } from "../Typography/Typography.js";
|
|
8
|
+
import { g as we, a as Ne, u as xe, f as ue, b as v, _ as Ce, c as se, i as ve, P as t, d as qe, e as Pe } from "../../useSlotProps-C_I1kEHr.js";
|
|
9
|
+
import '../../assets/Input.css';function Re(i) {
|
|
10
|
+
let s = "https://mui.com/production-error/?code=" + i;
|
|
11
|
+
for (let f = 1; f < arguments.length; f += 1)
|
|
12
|
+
s += "&args[]=" + encodeURIComponent(arguments[f]);
|
|
13
|
+
return "Minified MUI error #" + i + "; visit " + s + " for the full message.";
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
return
|
|
15
|
+
const pe = "Input";
|
|
16
|
+
function Ee(i) {
|
|
17
|
+
return we(pe, i);
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
process.env.NODE_ENV !== "production" && (
|
|
22
|
-
function
|
|
23
|
-
return
|
|
19
|
+
Ne(pe, ["root", "formControl", "focused", "disabled", "error", "multiline", "input", "inputMultiline", "inputTypeSearch", "adornedStart", "adornedEnd"]);
|
|
20
|
+
const de = /* @__PURE__ */ V.createContext(void 0);
|
|
21
|
+
process.env.NODE_ENV !== "production" && (de.displayName = "FormControlContext");
|
|
22
|
+
function Ve() {
|
|
23
|
+
return V.useContext(de);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Fe(i = {}) {
|
|
26
26
|
const {
|
|
27
|
-
defaultValue:
|
|
28
|
-
disabled:
|
|
29
|
-
error:
|
|
30
|
-
onBlur:
|
|
31
|
-
onChange:
|
|
32
|
-
onFocus:
|
|
33
|
-
required:
|
|
34
|
-
value:
|
|
35
|
-
inputRef:
|
|
36
|
-
} =
|
|
37
|
-
let
|
|
38
|
-
if (
|
|
39
|
-
var
|
|
40
|
-
if (
|
|
41
|
-
const
|
|
42
|
-
|
|
27
|
+
defaultValue: s,
|
|
28
|
+
disabled: f = !1,
|
|
29
|
+
error: d = !1,
|
|
30
|
+
onBlur: m,
|
|
31
|
+
onChange: N,
|
|
32
|
+
onFocus: F,
|
|
33
|
+
required: S = !1,
|
|
34
|
+
value: c,
|
|
35
|
+
inputRef: O
|
|
36
|
+
} = i, a = Ve();
|
|
37
|
+
let h, g, x, P, q;
|
|
38
|
+
if (a) {
|
|
39
|
+
var C, b, U;
|
|
40
|
+
if (h = void 0, g = (C = a.disabled) != null ? C : !1, x = (b = a.error) != null ? b : !1, P = (U = a.required) != null ? U : !1, q = a.value, process.env.NODE_ENV !== "production") {
|
|
41
|
+
const n = ["defaultValue", "disabled", "error", "required", "value"].filter((l) => i[l] !== void 0);
|
|
42
|
+
n.length > 0 && console.warn(["MUI: You have set props on an input that is inside a FormControl.", "Set these props on a FormControl instead. Otherwise they will be ignored.", `Ignored props: ${n.join(", ")}`].join(`
|
|
43
43
|
`));
|
|
44
44
|
}
|
|
45
45
|
} else
|
|
46
|
-
|
|
46
|
+
h = s, g = f, x = d, P = S, q = c;
|
|
47
47
|
const {
|
|
48
|
-
current:
|
|
49
|
-
} =
|
|
50
|
-
process.env.NODE_ENV !== "production" &&
|
|
48
|
+
current: H
|
|
49
|
+
} = V.useRef(q != null), K = V.useCallback((n) => {
|
|
50
|
+
process.env.NODE_ENV !== "production" && n && n.nodeName !== "INPUT" && !n.focus && console.error(["MUI: You have provided a `slots.input` to the input component", "that does not correctly handle the `ref` prop.", "Make sure the `ref` prop is called with a HTMLInputElement."].join(`
|
|
51
51
|
`));
|
|
52
|
-
}, []),
|
|
53
|
-
|
|
54
|
-
!
|
|
55
|
-
}, [
|
|
56
|
-
const
|
|
57
|
-
var
|
|
58
|
-
if (
|
|
59
|
-
|
|
52
|
+
}, []), R = V.useRef(null), j = xe(R, O, K), [T, I] = V.useState(!1);
|
|
53
|
+
V.useEffect(() => {
|
|
54
|
+
!a && g && T && (I(!1), m == null || m());
|
|
55
|
+
}, [a, g, T, m]);
|
|
56
|
+
const $ = (n) => (l) => {
|
|
57
|
+
var r;
|
|
58
|
+
if (a != null && a.disabled) {
|
|
59
|
+
l.stopPropagation();
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
if ((
|
|
63
|
-
var
|
|
64
|
-
|
|
62
|
+
if ((r = n.onFocus) == null || r.call(n, l), a && a.onFocus) {
|
|
63
|
+
var p;
|
|
64
|
+
a == null || (p = a.onFocus) == null || p.call(a);
|
|
65
65
|
} else
|
|
66
66
|
I(!0);
|
|
67
|
-
},
|
|
68
|
-
var
|
|
69
|
-
(
|
|
70
|
-
},
|
|
71
|
-
var
|
|
72
|
-
if (!
|
|
73
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: Expected valid input target. Did you use a custom `slots.input` and forget to forward refs? See https://mui.com/r/input-component-ref-interface for more info." :
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
var
|
|
77
|
-
|
|
67
|
+
}, L = (n) => (l) => {
|
|
68
|
+
var r;
|
|
69
|
+
(r = n.onBlur) == null || r.call(n, l), a && a.onBlur ? a.onBlur() : I(!1);
|
|
70
|
+
}, Y = (n) => (l, ...r) => {
|
|
71
|
+
var p, E;
|
|
72
|
+
if (!H && (l.target || R.current) == null)
|
|
73
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: Expected valid input target. Did you use a custom `slots.input` and forget to forward refs? See https://mui.com/r/input-component-ref-interface for more info." : Re(17));
|
|
74
|
+
a == null || (p = a.onChange) == null || p.call(a, l), (E = n.onChange) == null || E.call(n, l, ...r);
|
|
75
|
+
}, W = (n) => (l) => {
|
|
76
|
+
var r;
|
|
77
|
+
R.current && l.currentTarget === l.target && R.current.focus(), (r = n.onClick) == null || r.call(n, l);
|
|
78
78
|
};
|
|
79
79
|
return {
|
|
80
|
-
disabled:
|
|
81
|
-
error:
|
|
82
|
-
focused:
|
|
83
|
-
formControlContext:
|
|
84
|
-
getInputProps: (
|
|
85
|
-
const
|
|
86
|
-
onBlur:
|
|
87
|
-
onChange:
|
|
88
|
-
onFocus:
|
|
89
|
-
},
|
|
90
|
-
onBlur:
|
|
91
|
-
onChange:
|
|
92
|
-
onFocus:
|
|
80
|
+
disabled: g,
|
|
81
|
+
error: x,
|
|
82
|
+
focused: T,
|
|
83
|
+
formControlContext: a,
|
|
84
|
+
getInputProps: (n = {}) => {
|
|
85
|
+
const r = v({}, {
|
|
86
|
+
onBlur: m,
|
|
87
|
+
onChange: N,
|
|
88
|
+
onFocus: F
|
|
89
|
+
}, ue(n)), p = v({}, r, {
|
|
90
|
+
onBlur: L(r),
|
|
91
|
+
onChange: Y(r),
|
|
92
|
+
onFocus: $(r)
|
|
93
93
|
});
|
|
94
|
-
return
|
|
95
|
-
"aria-invalid":
|
|
96
|
-
defaultValue:
|
|
97
|
-
value:
|
|
98
|
-
required:
|
|
99
|
-
disabled:
|
|
100
|
-
},
|
|
101
|
-
ref:
|
|
102
|
-
},
|
|
94
|
+
return v({}, p, {
|
|
95
|
+
"aria-invalid": x || void 0,
|
|
96
|
+
defaultValue: h,
|
|
97
|
+
value: q,
|
|
98
|
+
required: P,
|
|
99
|
+
disabled: g
|
|
100
|
+
}, n, {
|
|
101
|
+
ref: j
|
|
102
|
+
}, p);
|
|
103
103
|
},
|
|
104
|
-
getRootProps: (
|
|
105
|
-
const
|
|
106
|
-
return
|
|
107
|
-
onClick:
|
|
104
|
+
getRootProps: (n = {}) => {
|
|
105
|
+
const l = ue(i, ["onBlur", "onChange", "onFocus"]), r = v({}, l, ue(n));
|
|
106
|
+
return v({}, n, r, {
|
|
107
|
+
onClick: W(r)
|
|
108
108
|
});
|
|
109
109
|
},
|
|
110
|
-
inputRef:
|
|
111
|
-
required:
|
|
112
|
-
value:
|
|
110
|
+
inputRef: j,
|
|
111
|
+
required: P,
|
|
112
|
+
value: q
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
const
|
|
115
|
+
const Se = ["aria-describedby", "aria-label", "aria-labelledby", "autoComplete", "autoFocus", "className", "defaultValue", "disabled", "endAdornment", "error", "id", "multiline", "name", "onClick", "onChange", "onKeyDown", "onKeyUp", "onFocus", "onBlur", "placeholder", "readOnly", "required", "startAdornment", "value", "type", "rows", "slotProps", "slots", "minRows", "maxRows"], Oe = (i) => {
|
|
116
116
|
const {
|
|
117
|
-
disabled:
|
|
118
|
-
error:
|
|
119
|
-
focused:
|
|
120
|
-
formControlContext:
|
|
121
|
-
multiline:
|
|
122
|
-
startAdornment:
|
|
123
|
-
endAdornment:
|
|
124
|
-
} =
|
|
125
|
-
return
|
|
126
|
-
root: ["root",
|
|
127
|
-
input: ["input",
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
var
|
|
117
|
+
disabled: s,
|
|
118
|
+
error: f,
|
|
119
|
+
focused: d,
|
|
120
|
+
formControlContext: m,
|
|
121
|
+
multiline: N,
|
|
122
|
+
startAdornment: F,
|
|
123
|
+
endAdornment: S
|
|
124
|
+
} = i;
|
|
125
|
+
return qe({
|
|
126
|
+
root: ["root", s && "disabled", f && "error", d && "focused", !!m && "formControl", N && "multiline", !!F && "adornedStart", !!S && "adornedEnd"],
|
|
127
|
+
input: ["input", s && "disabled", N && "multiline"]
|
|
128
|
+
}, Pe(Ee));
|
|
129
|
+
}, ce = /* @__PURE__ */ V.forwardRef(function(s, f) {
|
|
130
|
+
var d, m, N;
|
|
131
131
|
const {
|
|
132
|
-
"aria-describedby":
|
|
133
|
-
"aria-label":
|
|
134
|
-
"aria-labelledby":
|
|
135
|
-
autoComplete:
|
|
136
|
-
autoFocus:
|
|
137
|
-
className:
|
|
138
|
-
defaultValue:
|
|
139
|
-
disabled:
|
|
140
|
-
endAdornment:
|
|
141
|
-
error:
|
|
142
|
-
id:
|
|
143
|
-
multiline:
|
|
144
|
-
name:
|
|
145
|
-
onClick:
|
|
146
|
-
onChange:
|
|
147
|
-
onKeyDown:
|
|
148
|
-
onKeyUp:
|
|
149
|
-
onFocus:
|
|
132
|
+
"aria-describedby": F,
|
|
133
|
+
"aria-label": S,
|
|
134
|
+
"aria-labelledby": c,
|
|
135
|
+
autoComplete: O,
|
|
136
|
+
autoFocus: a,
|
|
137
|
+
className: h,
|
|
138
|
+
defaultValue: g,
|
|
139
|
+
disabled: x,
|
|
140
|
+
endAdornment: P,
|
|
141
|
+
error: q,
|
|
142
|
+
id: C,
|
|
143
|
+
multiline: b = !1,
|
|
144
|
+
name: U,
|
|
145
|
+
onClick: H,
|
|
146
|
+
onChange: K,
|
|
147
|
+
onKeyDown: R,
|
|
148
|
+
onKeyUp: j,
|
|
149
|
+
onFocus: T,
|
|
150
150
|
onBlur: I,
|
|
151
|
-
placeholder:
|
|
152
|
-
readOnly:
|
|
153
|
-
required:
|
|
154
|
-
startAdornment:
|
|
155
|
-
value:
|
|
156
|
-
type:
|
|
157
|
-
rows:
|
|
158
|
-
slotProps:
|
|
159
|
-
slots:
|
|
160
|
-
minRows:
|
|
161
|
-
maxRows:
|
|
162
|
-
} =
|
|
163
|
-
getRootProps:
|
|
164
|
-
getInputProps:
|
|
165
|
-
focused:
|
|
166
|
-
formControlContext:
|
|
167
|
-
error:
|
|
168
|
-
disabled:
|
|
169
|
-
} =
|
|
170
|
-
disabled:
|
|
171
|
-
defaultValue:
|
|
172
|
-
error:
|
|
151
|
+
placeholder: $,
|
|
152
|
+
readOnly: L,
|
|
153
|
+
required: Y,
|
|
154
|
+
startAdornment: W,
|
|
155
|
+
value: e,
|
|
156
|
+
type: z,
|
|
157
|
+
rows: n,
|
|
158
|
+
slotProps: l = {},
|
|
159
|
+
slots: r = {},
|
|
160
|
+
minRows: p,
|
|
161
|
+
maxRows: E
|
|
162
|
+
} = s, J = Ce(s, Se), {
|
|
163
|
+
getRootProps: Z,
|
|
164
|
+
getInputProps: ee,
|
|
165
|
+
focused: te,
|
|
166
|
+
formControlContext: ne,
|
|
167
|
+
error: oe,
|
|
168
|
+
disabled: Q
|
|
169
|
+
} = Fe({
|
|
170
|
+
disabled: x,
|
|
171
|
+
defaultValue: g,
|
|
172
|
+
error: q,
|
|
173
173
|
onBlur: I,
|
|
174
|
-
onClick:
|
|
175
|
-
onChange:
|
|
176
|
-
onFocus:
|
|
177
|
-
required:
|
|
178
|
-
value:
|
|
179
|
-
}),
|
|
180
|
-
disabled:
|
|
181
|
-
error:
|
|
182
|
-
focused:
|
|
183
|
-
formControlContext:
|
|
184
|
-
multiline:
|
|
185
|
-
type:
|
|
186
|
-
}),
|
|
187
|
-
"aria-describedby":
|
|
188
|
-
"aria-label":
|
|
189
|
-
"aria-labelledby":
|
|
190
|
-
autoComplete:
|
|
191
|
-
autoFocus:
|
|
192
|
-
id:
|
|
193
|
-
onKeyDown:
|
|
194
|
-
onKeyUp:
|
|
195
|
-
name:
|
|
196
|
-
placeholder:
|
|
197
|
-
readOnly:
|
|
198
|
-
type:
|
|
199
|
-
},
|
|
200
|
-
elementType:
|
|
201
|
-
getSlotProps:
|
|
202
|
-
externalSlotProps:
|
|
203
|
-
externalForwardedProps:
|
|
174
|
+
onClick: H,
|
|
175
|
+
onChange: K,
|
|
176
|
+
onFocus: T,
|
|
177
|
+
required: Y,
|
|
178
|
+
value: e
|
|
179
|
+
}), G = b ? void 0 : z ?? "text", o = v({}, s, {
|
|
180
|
+
disabled: Q,
|
|
181
|
+
error: oe,
|
|
182
|
+
focused: te,
|
|
183
|
+
formControlContext: ne,
|
|
184
|
+
multiline: b,
|
|
185
|
+
type: G
|
|
186
|
+
}), y = Oe(o), A = {
|
|
187
|
+
"aria-describedby": F,
|
|
188
|
+
"aria-label": S,
|
|
189
|
+
"aria-labelledby": c,
|
|
190
|
+
autoComplete: O,
|
|
191
|
+
autoFocus: a,
|
|
192
|
+
id: C,
|
|
193
|
+
onKeyDown: R,
|
|
194
|
+
onKeyUp: j,
|
|
195
|
+
name: U,
|
|
196
|
+
placeholder: $,
|
|
197
|
+
readOnly: L,
|
|
198
|
+
type: G
|
|
199
|
+
}, u = (d = r.root) != null ? d : "div", B = se({
|
|
200
|
+
elementType: u,
|
|
201
|
+
getSlotProps: Z,
|
|
202
|
+
externalSlotProps: l.root,
|
|
203
|
+
externalForwardedProps: J,
|
|
204
204
|
additionalProps: {
|
|
205
|
-
ref:
|
|
205
|
+
ref: f
|
|
206
206
|
},
|
|
207
|
-
ownerState:
|
|
208
|
-
className: [
|
|
209
|
-
}),
|
|
210
|
-
elementType:
|
|
211
|
-
getSlotProps: (
|
|
212
|
-
externalSlotProps:
|
|
213
|
-
additionalProps:
|
|
214
|
-
rows:
|
|
215
|
-
},
|
|
216
|
-
minRows:
|
|
217
|
-
maxRows:
|
|
207
|
+
ownerState: o,
|
|
208
|
+
className: [y.root, h]
|
|
209
|
+
}), w = b ? (m = r.textarea) != null ? m : "textarea" : (N = r.input) != null ? N : "input", ae = se({
|
|
210
|
+
elementType: w,
|
|
211
|
+
getSlotProps: (X) => ee(v({}, A, X)),
|
|
212
|
+
externalSlotProps: l.input,
|
|
213
|
+
additionalProps: v({
|
|
214
|
+
rows: b ? n : void 0
|
|
215
|
+
}, b && !ve(w) && {
|
|
216
|
+
minRows: n || p,
|
|
217
|
+
maxRows: n || E
|
|
218
218
|
}),
|
|
219
|
-
ownerState:
|
|
220
|
-
className:
|
|
219
|
+
ownerState: o,
|
|
220
|
+
className: y.input
|
|
221
221
|
});
|
|
222
|
-
return process.env.NODE_ENV !== "production" &&
|
|
223
|
-
children: [
|
|
222
|
+
return process.env.NODE_ENV !== "production" && b && n && (p || E) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), /* @__PURE__ */ D(u, v({}, B, {
|
|
223
|
+
children: [W, /* @__PURE__ */ M(w, v({}, ae)), P]
|
|
224
224
|
}));
|
|
225
225
|
});
|
|
226
|
-
process.env.NODE_ENV !== "production" && (
|
|
226
|
+
process.env.NODE_ENV !== "production" && (ce.propTypes = {
|
|
227
227
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
228
228
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
229
229
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
@@ -231,149 +231,149 @@ process.env.NODE_ENV !== "production" && (se.propTypes = {
|
|
|
231
231
|
/**
|
|
232
232
|
* @ignore
|
|
233
233
|
*/
|
|
234
|
-
"aria-describedby":
|
|
234
|
+
"aria-describedby": t.string,
|
|
235
235
|
/**
|
|
236
236
|
* @ignore
|
|
237
237
|
*/
|
|
238
|
-
"aria-label":
|
|
238
|
+
"aria-label": t.string,
|
|
239
239
|
/**
|
|
240
240
|
* @ignore
|
|
241
241
|
*/
|
|
242
|
-
"aria-labelledby":
|
|
242
|
+
"aria-labelledby": t.string,
|
|
243
243
|
/**
|
|
244
244
|
* This prop helps users to fill forms faster, especially on mobile devices.
|
|
245
245
|
* The name can be confusing, as it's more like an autofill.
|
|
246
246
|
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
|
247
247
|
*/
|
|
248
|
-
autoComplete:
|
|
248
|
+
autoComplete: t.string,
|
|
249
249
|
/**
|
|
250
250
|
* If `true`, the `input` element is focused during the first mount.
|
|
251
251
|
*/
|
|
252
|
-
autoFocus:
|
|
252
|
+
autoFocus: t.bool,
|
|
253
253
|
/**
|
|
254
254
|
* Class name applied to the root element.
|
|
255
255
|
*/
|
|
256
|
-
className:
|
|
256
|
+
className: t.string,
|
|
257
257
|
/**
|
|
258
258
|
* The default value. Use when the component is not controlled.
|
|
259
259
|
*/
|
|
260
|
-
defaultValue:
|
|
260
|
+
defaultValue: t.any,
|
|
261
261
|
/**
|
|
262
262
|
* If `true`, the component is disabled.
|
|
263
263
|
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
|
264
264
|
*/
|
|
265
|
-
disabled:
|
|
265
|
+
disabled: t.bool,
|
|
266
266
|
/**
|
|
267
267
|
* Trailing adornment for this input.
|
|
268
268
|
*/
|
|
269
|
-
endAdornment:
|
|
269
|
+
endAdornment: t.node,
|
|
270
270
|
/**
|
|
271
271
|
* If `true`, the `input` will indicate an error by setting the `aria-invalid` attribute on the input and the `baseui--error` class on the root element.
|
|
272
272
|
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
|
273
273
|
*/
|
|
274
|
-
error:
|
|
274
|
+
error: t.bool,
|
|
275
275
|
/**
|
|
276
276
|
* The id of the `input` element.
|
|
277
277
|
*/
|
|
278
|
-
id:
|
|
278
|
+
id: t.string,
|
|
279
279
|
/**
|
|
280
280
|
* @ignore
|
|
281
281
|
*/
|
|
282
|
-
inputRef:
|
|
283
|
-
current:
|
|
282
|
+
inputRef: t.oneOfType([t.func, t.shape({
|
|
283
|
+
current: t.object
|
|
284
284
|
})]),
|
|
285
285
|
/**
|
|
286
286
|
* Maximum number of rows to display when multiline option is set to true.
|
|
287
287
|
*/
|
|
288
|
-
maxRows:
|
|
288
|
+
maxRows: t.number,
|
|
289
289
|
/**
|
|
290
290
|
* Minimum number of rows to display when multiline option is set to true.
|
|
291
291
|
*/
|
|
292
|
-
minRows:
|
|
292
|
+
minRows: t.number,
|
|
293
293
|
/**
|
|
294
294
|
* If `true`, a `textarea` element is rendered.
|
|
295
295
|
* @default false
|
|
296
296
|
*/
|
|
297
|
-
multiline:
|
|
297
|
+
multiline: t.bool,
|
|
298
298
|
/**
|
|
299
299
|
* Name attribute of the `input` element.
|
|
300
300
|
*/
|
|
301
|
-
name:
|
|
301
|
+
name: t.string,
|
|
302
302
|
/**
|
|
303
303
|
* @ignore
|
|
304
304
|
*/
|
|
305
|
-
onBlur:
|
|
305
|
+
onBlur: t.func,
|
|
306
306
|
/**
|
|
307
307
|
* @ignore
|
|
308
308
|
*/
|
|
309
|
-
onChange:
|
|
309
|
+
onChange: t.func,
|
|
310
310
|
/**
|
|
311
311
|
* @ignore
|
|
312
312
|
*/
|
|
313
|
-
onClick:
|
|
313
|
+
onClick: t.func,
|
|
314
314
|
/**
|
|
315
315
|
* @ignore
|
|
316
316
|
*/
|
|
317
|
-
onFocus:
|
|
317
|
+
onFocus: t.func,
|
|
318
318
|
/**
|
|
319
319
|
* @ignore
|
|
320
320
|
*/
|
|
321
|
-
onKeyDown:
|
|
321
|
+
onKeyDown: t.func,
|
|
322
322
|
/**
|
|
323
323
|
* @ignore
|
|
324
324
|
*/
|
|
325
|
-
onKeyUp:
|
|
325
|
+
onKeyUp: t.func,
|
|
326
326
|
/**
|
|
327
327
|
* The short hint displayed in the `input` before the user enters a value.
|
|
328
328
|
*/
|
|
329
|
-
placeholder:
|
|
329
|
+
placeholder: t.string,
|
|
330
330
|
/**
|
|
331
331
|
* It prevents the user from changing the value of the field
|
|
332
332
|
* (not from interacting with the field).
|
|
333
333
|
*/
|
|
334
|
-
readOnly:
|
|
334
|
+
readOnly: t.bool,
|
|
335
335
|
/**
|
|
336
336
|
* If `true`, the `input` element is required.
|
|
337
337
|
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
|
338
338
|
*/
|
|
339
|
-
required:
|
|
339
|
+
required: t.bool,
|
|
340
340
|
/**
|
|
341
341
|
* Number of rows to display when multiline option is set to true.
|
|
342
342
|
*/
|
|
343
|
-
rows:
|
|
343
|
+
rows: t.number,
|
|
344
344
|
/**
|
|
345
345
|
* The props used for each slot inside the Input.
|
|
346
346
|
* @default {}
|
|
347
347
|
*/
|
|
348
|
-
slotProps:
|
|
349
|
-
input:
|
|
350
|
-
root:
|
|
348
|
+
slotProps: t.shape({
|
|
349
|
+
input: t.oneOfType([t.func, t.object]),
|
|
350
|
+
root: t.oneOfType([t.func, t.object])
|
|
351
351
|
}),
|
|
352
352
|
/**
|
|
353
353
|
* The components used for each slot inside the InputBase.
|
|
354
354
|
* Either a string to use a HTML element or a component.
|
|
355
355
|
* @default {}
|
|
356
356
|
*/
|
|
357
|
-
slots:
|
|
358
|
-
input:
|
|
359
|
-
root:
|
|
360
|
-
textarea:
|
|
357
|
+
slots: t.shape({
|
|
358
|
+
input: t.elementType,
|
|
359
|
+
root: t.elementType,
|
|
360
|
+
textarea: t.elementType
|
|
361
361
|
}),
|
|
362
362
|
/**
|
|
363
363
|
* Leading adornment for this input.
|
|
364
364
|
*/
|
|
365
|
-
startAdornment:
|
|
365
|
+
startAdornment: t.node,
|
|
366
366
|
/**
|
|
367
367
|
* Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
|
|
368
368
|
* @default 'text'
|
|
369
369
|
*/
|
|
370
|
-
type:
|
|
370
|
+
type: t.oneOf(["button", "checkbox", "color", "date", "datetime-local", "email", "file", "hidden", "image", "month", "number", "password", "radio", "range", "reset", "search", "submit", "tel", "text", "time", "url", "week"]),
|
|
371
371
|
/**
|
|
372
372
|
* The value of the `input` element, required for a controlled component.
|
|
373
373
|
*/
|
|
374
|
-
value:
|
|
374
|
+
value: t.any
|
|
375
375
|
});
|
|
376
|
-
const
|
|
376
|
+
const Te = "_input_101pq_57", Ie = "_input__label_101pq_84", _ = {
|
|
377
377
|
"u-typography-h1": "_u-typography-h1_101pq_1",
|
|
378
378
|
"u-typography-h2": "_u-typography-h2_101pq_8",
|
|
379
379
|
"u-typography-h3": "_u-typography-h3_101pq_15",
|
|
@@ -390,7 +390,7 @@ const Fe = "_input_101pq_57", Ie = "_input__label_101pq_84", p = {
|
|
|
390
390
|
"u-typography-base--strikethrough": "_u-typography-base--strikethrough_101pq_68",
|
|
391
391
|
"u-typography-base--underlined": "_u-typography-base--underlined_101pq_71",
|
|
392
392
|
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_101pq_74",
|
|
393
|
-
input:
|
|
393
|
+
input: Te,
|
|
394
394
|
"input__messages-wrapper": "_input__messages-wrapper_101pq_81",
|
|
395
395
|
input__label: Ie,
|
|
396
396
|
"input__input-el-wrapper": "_input__input-el-wrapper_101pq_89",
|
|
@@ -402,123 +402,159 @@ const Fe = "_input_101pq_57", Ie = "_input__label_101pq_84", p = {
|
|
|
402
402
|
"input--disabled": "_input--disabled_101pq_153",
|
|
403
403
|
"input--focused": "_input--focused_101pq_159",
|
|
404
404
|
"input--error": "_input--error_101pq_162"
|
|
405
|
-
},
|
|
405
|
+
}, He = _e(
|
|
406
406
|
({
|
|
407
|
-
label:
|
|
408
|
-
infoMessage:
|
|
409
|
-
error:
|
|
410
|
-
errorMessage:
|
|
411
|
-
leftIcon:
|
|
412
|
-
rightIcon:
|
|
413
|
-
id:
|
|
414
|
-
disabled:
|
|
415
|
-
type:
|
|
416
|
-
maxLength:
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
"data-testid-
|
|
431
|
-
"data-testid-
|
|
432
|
-
"data-testid-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
407
|
+
label: i,
|
|
408
|
+
infoMessage: s,
|
|
409
|
+
error: f,
|
|
410
|
+
errorMessage: d,
|
|
411
|
+
leftIcon: m,
|
|
412
|
+
rightIcon: N,
|
|
413
|
+
id: F,
|
|
414
|
+
disabled: S,
|
|
415
|
+
type: c = "text",
|
|
416
|
+
maxLength: O,
|
|
417
|
+
isInteger: a,
|
|
418
|
+
useCommaInDecimal: h,
|
|
419
|
+
allowNegativeNumbers: g = !1,
|
|
420
|
+
decimalLength: x = 10,
|
|
421
|
+
hideCharsCounter: P = !1,
|
|
422
|
+
required: q,
|
|
423
|
+
onChange: C,
|
|
424
|
+
classNameWrapper: b,
|
|
425
|
+
classNameLabel: U,
|
|
426
|
+
classNameInput: H,
|
|
427
|
+
classNameInfoMessage: K,
|
|
428
|
+
classNameErrorMessage: R,
|
|
429
|
+
classNameCharsCounter: j,
|
|
430
|
+
"data-testid-wrapper": T,
|
|
431
|
+
"data-testid-label": I,
|
|
432
|
+
"data-testid-input": $,
|
|
433
|
+
"data-testid-infoMessage": L,
|
|
434
|
+
"data-testid-errorMessage": Y,
|
|
435
|
+
"data-testid-charsCounter": W,
|
|
436
|
+
...e
|
|
437
|
+
}, z) => {
|
|
438
|
+
var Q, G;
|
|
439
|
+
const [n, l] = fe(
|
|
440
|
+
((Q = e.value) == null ? void 0 : Q.length) || ((G = e.defaultValue) == null ? void 0 : G.length) || 0
|
|
441
|
+
), r = me(), p = F || `input_${r}`;
|
|
442
|
+
Object.assign(e, { "data-testid": $ });
|
|
443
|
+
const E = O && !P, J = (o) => {
|
|
444
|
+
var y, A;
|
|
445
|
+
if (c === "number-as-text") {
|
|
446
|
+
let u = a ? he(o.target.value) : h ? o.target.value.replace(".", ",") : o.target.value.replace(",", ".");
|
|
447
|
+
if (!a && x > 0) {
|
|
448
|
+
const w = String(u), [ae, X] = w.split(/,|\./);
|
|
449
|
+
w !== "" && X && (u = [ae, X.slice(0, x)].join(h ? "," : "."));
|
|
450
|
+
}
|
|
451
|
+
o.target.value = String(u);
|
|
452
|
+
const B = !isNaN(Number(String(u).replace(",", ".")));
|
|
453
|
+
C == null || C({
|
|
454
|
+
...o,
|
|
455
|
+
target: {
|
|
456
|
+
...o.target,
|
|
457
|
+
value: B && String(u).length ? String(Number(String(u).replace(",", "."))) : "",
|
|
458
|
+
valueAsNumber: B && String(u).length ? Number(String(u).replace(",", ".")) : NaN
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
if (c === "number") {
|
|
464
|
+
let u = String(o.target.value);
|
|
465
|
+
const [B, w] = u.split(".");
|
|
466
|
+
u !== "" && (w != null && w.length ? u = [Number(B), w.slice(0, x)].join(".") : u = String(Number(B))), o.target.value = u;
|
|
467
|
+
}
|
|
468
|
+
E && l((A = (y = o == null ? void 0 : o.target) == null ? void 0 : y.value) == null ? void 0 : A.length), C && C(o);
|
|
469
|
+
}, Z = (o) => {
|
|
470
|
+
var y;
|
|
471
|
+
c === "number-as-text" && (a ? ge(o, g) : be(o, g)), (y = e == null ? void 0 : e.onKeyDown) == null || y.call(e, o);
|
|
472
|
+
}, ee = (o) => {
|
|
473
|
+
var y;
|
|
474
|
+
if (c === "number-as-text" && o.target.value.length) {
|
|
475
|
+
const A = a ? o.target.value.replace(/(,\.)/gi, "") : o.target.value.replace(",", ".");
|
|
476
|
+
let u = String(Number(A));
|
|
477
|
+
isNaN(Number(u)) && (u = ""), o.target.value = h ? u.replace(".", ",") : u;
|
|
446
478
|
}
|
|
447
|
-
|
|
448
|
-
},
|
|
449
|
-
type:
|
|
450
|
-
multiline:
|
|
479
|
+
(y = e == null ? void 0 : e.onBlur) == null || y.call(e, o);
|
|
480
|
+
}, te = re(() => e.multiline !== !0 ? {
|
|
481
|
+
type: c === "number-as-text" ? "text" : c,
|
|
482
|
+
multiline: e.multiline
|
|
451
483
|
} : {
|
|
452
484
|
type: void 0,
|
|
453
|
-
multiline:
|
|
454
|
-
rows: (
|
|
455
|
-
minRows:
|
|
456
|
-
maxRows:
|
|
457
|
-
}, [
|
|
458
|
-
return /* @__PURE__ */
|
|
459
|
-
|
|
460
|
-
|
|
485
|
+
multiline: e.multiline,
|
|
486
|
+
rows: (e == null ? void 0 : e.rows) || 5,
|
|
487
|
+
minRows: e == null ? void 0 : e.minRows,
|
|
488
|
+
maxRows: e == null ? void 0 : e.maxRows
|
|
489
|
+
}, [e]), ne = re(() => c === "number-as-text" && (e != null && e.defaultValue) ? ie(e == null ? void 0 : e.defaultValue, h) : e == null ? void 0 : e.defaultValue, [e.defaultValue]), oe = re(() => c === "number-as-text" && (e != null && e.value) ? ie(e == null ? void 0 : e.value, h) : e == null ? void 0 : e.value, [e.value]);
|
|
490
|
+
return /* @__PURE__ */ D("div", { className: k(_.input, b), "data-testid": T, children: [
|
|
491
|
+
i && /* @__PURE__ */ D(
|
|
492
|
+
le,
|
|
461
493
|
{
|
|
462
494
|
bold: !0,
|
|
463
495
|
element: "label",
|
|
464
|
-
elementProps: { htmlFor:
|
|
465
|
-
className:
|
|
466
|
-
"data-testid":
|
|
496
|
+
elementProps: { htmlFor: p },
|
|
497
|
+
className: k(_.input__label, U),
|
|
498
|
+
"data-testid": I,
|
|
467
499
|
children: [
|
|
468
|
-
|
|
469
|
-
|
|
500
|
+
i,
|
|
501
|
+
q && /* @__PURE__ */ M("span", { children: "*" })
|
|
470
502
|
]
|
|
471
503
|
}
|
|
472
504
|
),
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
|
|
505
|
+
/* @__PURE__ */ M(
|
|
506
|
+
ce,
|
|
475
507
|
{
|
|
476
|
-
id:
|
|
477
|
-
disabled:
|
|
478
|
-
error: typeof
|
|
479
|
-
"aria-label":
|
|
508
|
+
id: p,
|
|
509
|
+
disabled: S,
|
|
510
|
+
error: typeof f == "boolean" ? f : !!d,
|
|
511
|
+
"aria-label": i,
|
|
480
512
|
slotProps: {
|
|
481
|
-
root: (
|
|
482
|
-
className:
|
|
483
|
-
[
|
|
484
|
-
[
|
|
485
|
-
[
|
|
513
|
+
root: (o) => ({
|
|
514
|
+
className: k(_["input__input-el-wrapper"], {
|
|
515
|
+
[_["input--disabled"]]: o.disabled,
|
|
516
|
+
[_["input--focused"]]: o.focused,
|
|
517
|
+
[_["input--error"]]: o.error
|
|
486
518
|
})
|
|
487
519
|
}),
|
|
488
520
|
input: {
|
|
489
|
-
ref:
|
|
490
|
-
className:
|
|
491
|
-
maxLength:
|
|
492
|
-
onChange:
|
|
493
|
-
...
|
|
521
|
+
ref: z,
|
|
522
|
+
className: k(_["input__input-el"], H),
|
|
523
|
+
maxLength: O,
|
|
524
|
+
onChange: J,
|
|
525
|
+
...e,
|
|
526
|
+
onKeyDown: Z,
|
|
527
|
+
onBlur: ee,
|
|
528
|
+
defaultValue: ne,
|
|
529
|
+
value: oe
|
|
494
530
|
}
|
|
495
531
|
},
|
|
496
|
-
startAdornment:
|
|
497
|
-
endAdornment:
|
|
498
|
-
...
|
|
532
|
+
startAdornment: m && /* @__PURE__ */ M("span", { className: _["input__left-icon"], children: m }),
|
|
533
|
+
endAdornment: N && /* @__PURE__ */ M("span", { className: _["input__right-icon"], children: N }),
|
|
534
|
+
...te
|
|
499
535
|
}
|
|
500
536
|
),
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
(
|
|
503
|
-
|
|
537
|
+
/* @__PURE__ */ D("div", { className: _["input__messages-wrapper"], children: [
|
|
538
|
+
(d || s) && /* @__PURE__ */ D(
|
|
539
|
+
le,
|
|
504
540
|
{
|
|
505
|
-
className:
|
|
506
|
-
"data-testid":
|
|
541
|
+
className: d ? k(_["input__error-message"], R) : k(_["input__info-message"], K),
|
|
542
|
+
"data-testid": d ? Y : L,
|
|
507
543
|
children: [
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
|
|
544
|
+
/* @__PURE__ */ M(ye, { icon: d ? "circle-exclamation" : "circle-info" }),
|
|
545
|
+
d || s
|
|
510
546
|
]
|
|
511
547
|
}
|
|
512
548
|
),
|
|
513
|
-
|
|
514
|
-
|
|
549
|
+
E && /* @__PURE__ */ D(
|
|
550
|
+
le,
|
|
515
551
|
{
|
|
516
|
-
className:
|
|
517
|
-
"data-testid":
|
|
552
|
+
className: k(_["input__chars-counter"], j),
|
|
553
|
+
"data-testid": W,
|
|
518
554
|
children: [
|
|
519
|
-
|
|
555
|
+
n,
|
|
520
556
|
" / ",
|
|
521
|
-
|
|
557
|
+
O
|
|
522
558
|
]
|
|
523
559
|
}
|
|
524
560
|
)
|
|
@@ -527,5 +563,5 @@ const Fe = "_input_101pq_57", Ie = "_input__label_101pq_84", p = {
|
|
|
527
563
|
}
|
|
528
564
|
);
|
|
529
565
|
export {
|
|
530
|
-
|
|
566
|
+
He as Input
|
|
531
567
|
};
|