@pismo/marola 2.1.22 → 2.1.23
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/components/Input/Input.js +237 -237
- package/package.json +1 -1
|
@@ -1,229 +1,229 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { formatDecimalValue as
|
|
5
|
-
import { c as
|
|
6
|
-
import { Icon as
|
|
1
|
+
import { jsxs as M, jsx as H } from "react/jsx-runtime";
|
|
2
|
+
import * as S from "react";
|
|
3
|
+
import { forwardRef as _e, useState as be, useId as ge, useMemo as ae } from "react";
|
|
4
|
+
import { formatDecimalValue as se, allowOnlyIntegerNumbers as he, allowOnlyNumbers as we, parseToInteger as ye } from "../../utils/inputNumberAsText.js";
|
|
5
|
+
import { c as j } from "../../clsx-OuTLNxxd.js";
|
|
6
|
+
import { Icon as Ne } from "../Icon/Icon.js";
|
|
7
7
|
import { Typography as re } from "../Typography/Typography.js";
|
|
8
|
-
import { g as
|
|
9
|
-
import '../../assets/Input.css';function
|
|
8
|
+
import { g as Ce, a as xe, u as ve, f as ie, _ as v, b as Pe, c as de, i as Re, d as Ee, e as Ve, P as n } from "../../useSlotProps-CYHDC4TN.js";
|
|
9
|
+
import '../../assets/Input.css';function Fe(u) {
|
|
10
10
|
let s = "https://mui.com/production-error/?code=" + u;
|
|
11
11
|
for (let m = 1; m < arguments.length; m += 1)
|
|
12
12
|
s += "&args[]=" + encodeURIComponent(arguments[m]);
|
|
13
13
|
return "Minified MUI error #" + u + "; visit " + s + " for the full message.";
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
return
|
|
15
|
+
const pe = "Input";
|
|
16
|
+
function Se(u) {
|
|
17
|
+
return Ce(pe, u);
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
process.env.NODE_ENV !== "production" && (
|
|
22
|
-
function
|
|
23
|
-
return
|
|
19
|
+
xe(pe, ["root", "formControl", "focused", "disabled", "error", "multiline", "input", "inputMultiline", "inputTypeSearch", "adornedStart", "adornedEnd"]);
|
|
20
|
+
const ce = /* @__PURE__ */ S.createContext(void 0);
|
|
21
|
+
process.env.NODE_ENV !== "production" && (ce.displayName = "FormControlContext");
|
|
22
|
+
function qe() {
|
|
23
|
+
return S.useContext(ce);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Oe(u = {}) {
|
|
26
26
|
const {
|
|
27
27
|
defaultValue: s,
|
|
28
28
|
disabled: m = !1,
|
|
29
29
|
error: p = !1,
|
|
30
30
|
onBlur: _,
|
|
31
|
-
onChange:
|
|
32
|
-
onFocus:
|
|
33
|
-
required:
|
|
31
|
+
onChange: y,
|
|
32
|
+
onFocus: q,
|
|
33
|
+
required: O = !1,
|
|
34
34
|
value: c,
|
|
35
|
-
inputRef:
|
|
36
|
-
} = u, l =
|
|
37
|
-
let b, g,
|
|
35
|
+
inputRef: T
|
|
36
|
+
} = u, l = qe();
|
|
37
|
+
let b, g, N, V, P;
|
|
38
38
|
if (l) {
|
|
39
|
-
var
|
|
40
|
-
if (b = void 0, g = (
|
|
41
|
-
const
|
|
42
|
-
|
|
39
|
+
var C, h, A;
|
|
40
|
+
if (b = void 0, g = (C = l.disabled) != null ? C : !1, N = (h = l.error) != null ? h : !1, V = (A = l.required) != null ? A : !1, P = l.value, process.env.NODE_ENV !== "production") {
|
|
41
|
+
const o = ["defaultValue", "disabled", "error", "required", "value"].filter((r) => u[r] !== void 0);
|
|
42
|
+
o.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: ${o.join(", ")}`].join(`
|
|
43
43
|
`));
|
|
44
44
|
}
|
|
45
45
|
} else
|
|
46
|
-
b = s, g = m,
|
|
46
|
+
b = s, g = m, N = p, V = O, P = c;
|
|
47
47
|
const {
|
|
48
|
-
current:
|
|
49
|
-
} =
|
|
50
|
-
process.env.NODE_ENV !== "production" &&
|
|
48
|
+
current: K
|
|
49
|
+
} = S.useRef(P != null), $ = S.useCallback((o) => {
|
|
50
|
+
process.env.NODE_ENV !== "production" && o && o.nodeName !== "INPUT" && !o.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
|
-
!l && g &&
|
|
55
|
-
}, [l, g,
|
|
56
|
-
const
|
|
52
|
+
}, []), F = S.useRef(null), k = ve(F, T, $), [I, B] = S.useState(!1);
|
|
53
|
+
S.useEffect(() => {
|
|
54
|
+
!l && g && I && (B(!1), _ == null || _());
|
|
55
|
+
}, [l, g, I, _]);
|
|
56
|
+
const L = (o) => (r) => {
|
|
57
57
|
var a;
|
|
58
58
|
if (l != null && l.disabled) {
|
|
59
59
|
r.stopPropagation();
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
if ((a =
|
|
62
|
+
if ((a = o.onFocus) == null || a.call(o, r), l && l.onFocus) {
|
|
63
63
|
var d;
|
|
64
64
|
l == null || (d = l.onFocus) == null || d.call(l);
|
|
65
65
|
} else
|
|
66
|
-
|
|
67
|
-
},
|
|
66
|
+
B(!0);
|
|
67
|
+
}, Y = (o) => (r) => {
|
|
68
68
|
var a;
|
|
69
|
-
(a =
|
|
70
|
-
},
|
|
71
|
-
var d,
|
|
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
|
-
l == null || (d = l.onChange) == null || d.call(l, r), (
|
|
75
|
-
},
|
|
69
|
+
(a = o.onBlur) == null || a.call(o, r), l && l.onBlur ? l.onBlur() : B(!1);
|
|
70
|
+
}, W = (o) => (r, ...a) => {
|
|
71
|
+
var d, R;
|
|
72
|
+
if (!K && (r.target || F.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." : Fe(17));
|
|
74
|
+
l == null || (d = l.onChange) == null || d.call(l, r), (R = o.onChange) == null || R.call(o, r, ...a);
|
|
75
|
+
}, z = (o) => (r) => {
|
|
76
76
|
var a;
|
|
77
|
-
|
|
77
|
+
F.current && r.currentTarget === r.target && F.current.focus(), (a = o.onClick) == null || a.call(o, r);
|
|
78
78
|
};
|
|
79
79
|
return {
|
|
80
80
|
disabled: g,
|
|
81
|
-
error:
|
|
82
|
-
focused:
|
|
81
|
+
error: N,
|
|
82
|
+
focused: I,
|
|
83
83
|
formControlContext: l,
|
|
84
|
-
getInputProps: (
|
|
85
|
-
const a =
|
|
84
|
+
getInputProps: (o = {}) => {
|
|
85
|
+
const a = v({}, {
|
|
86
86
|
onBlur: _,
|
|
87
|
-
onChange:
|
|
88
|
-
onFocus:
|
|
89
|
-
}, ie(
|
|
90
|
-
onBlur:
|
|
91
|
-
onChange:
|
|
92
|
-
onFocus:
|
|
87
|
+
onChange: y,
|
|
88
|
+
onFocus: q
|
|
89
|
+
}, ie(o)), d = v({}, a, {
|
|
90
|
+
onBlur: Y(a),
|
|
91
|
+
onChange: W(a),
|
|
92
|
+
onFocus: L(a)
|
|
93
93
|
});
|
|
94
|
-
return
|
|
95
|
-
"aria-invalid":
|
|
94
|
+
return v({}, d, {
|
|
95
|
+
"aria-invalid": N || void 0,
|
|
96
96
|
defaultValue: b,
|
|
97
97
|
value: P,
|
|
98
|
-
required:
|
|
98
|
+
required: V,
|
|
99
99
|
disabled: g
|
|
100
|
-
},
|
|
101
|
-
ref:
|
|
100
|
+
}, o, {
|
|
101
|
+
ref: k
|
|
102
102
|
}, d);
|
|
103
103
|
},
|
|
104
|
-
getRootProps: (
|
|
105
|
-
const r = ie(u, ["onBlur", "onChange", "onFocus"]), a =
|
|
106
|
-
return
|
|
107
|
-
onClick:
|
|
104
|
+
getRootProps: (o = {}) => {
|
|
105
|
+
const r = ie(u, ["onBlur", "onChange", "onFocus"]), a = v({}, r, ie(o));
|
|
106
|
+
return v({}, o, a, {
|
|
107
|
+
onClick: z(a)
|
|
108
108
|
});
|
|
109
109
|
},
|
|
110
|
-
inputRef:
|
|
111
|
-
required:
|
|
110
|
+
inputRef: k,
|
|
111
|
+
required: V,
|
|
112
112
|
value: P
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
const
|
|
115
|
+
const Te = ["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"], Ie = (u) => {
|
|
116
116
|
const {
|
|
117
117
|
disabled: s,
|
|
118
118
|
error: m,
|
|
119
119
|
focused: p,
|
|
120
120
|
formControlContext: _,
|
|
121
|
-
multiline:
|
|
122
|
-
startAdornment:
|
|
123
|
-
endAdornment:
|
|
121
|
+
multiline: y,
|
|
122
|
+
startAdornment: q,
|
|
123
|
+
endAdornment: O
|
|
124
124
|
} = u;
|
|
125
|
-
return
|
|
126
|
-
root: ["root", s && "disabled", m && "error", p && "focused", !!_ && "formControl",
|
|
127
|
-
input: ["input", s && "disabled",
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
var p, _,
|
|
125
|
+
return Ee({
|
|
126
|
+
root: ["root", s && "disabled", m && "error", p && "focused", !!_ && "formControl", y && "multiline", !!q && "adornedStart", !!O && "adornedEnd"],
|
|
127
|
+
input: ["input", s && "disabled", y && "multiline"]
|
|
128
|
+
}, Ve(Se));
|
|
129
|
+
}, fe = /* @__PURE__ */ S.forwardRef(function(s, m) {
|
|
130
|
+
var p, _, y;
|
|
131
131
|
const {
|
|
132
|
-
"aria-describedby":
|
|
133
|
-
"aria-label":
|
|
132
|
+
"aria-describedby": q,
|
|
133
|
+
"aria-label": O,
|
|
134
134
|
"aria-labelledby": c,
|
|
135
|
-
autoComplete:
|
|
135
|
+
autoComplete: T,
|
|
136
136
|
autoFocus: l,
|
|
137
137
|
className: b,
|
|
138
138
|
defaultValue: g,
|
|
139
|
-
disabled:
|
|
140
|
-
endAdornment:
|
|
139
|
+
disabled: N,
|
|
140
|
+
endAdornment: V,
|
|
141
141
|
error: P,
|
|
142
|
-
id:
|
|
142
|
+
id: C,
|
|
143
143
|
multiline: h = !1,
|
|
144
|
-
name:
|
|
145
|
-
onClick:
|
|
146
|
-
onChange:
|
|
147
|
-
onKeyDown:
|
|
148
|
-
onKeyUp:
|
|
149
|
-
onFocus:
|
|
150
|
-
onBlur:
|
|
151
|
-
placeholder:
|
|
152
|
-
readOnly:
|
|
153
|
-
required:
|
|
154
|
-
startAdornment:
|
|
144
|
+
name: A,
|
|
145
|
+
onClick: K,
|
|
146
|
+
onChange: $,
|
|
147
|
+
onKeyDown: F,
|
|
148
|
+
onKeyUp: k,
|
|
149
|
+
onFocus: I,
|
|
150
|
+
onBlur: B,
|
|
151
|
+
placeholder: L,
|
|
152
|
+
readOnly: Y,
|
|
153
|
+
required: W,
|
|
154
|
+
startAdornment: z,
|
|
155
155
|
value: e,
|
|
156
|
-
type:
|
|
157
|
-
rows:
|
|
156
|
+
type: G,
|
|
157
|
+
rows: o,
|
|
158
158
|
slotProps: r = {},
|
|
159
159
|
slots: a = {},
|
|
160
160
|
minRows: d,
|
|
161
|
-
maxRows:
|
|
162
|
-
} = s,
|
|
163
|
-
getRootProps:
|
|
164
|
-
getInputProps:
|
|
165
|
-
focused:
|
|
166
|
-
formControlContext:
|
|
167
|
-
error:
|
|
168
|
-
disabled:
|
|
169
|
-
} =
|
|
170
|
-
disabled:
|
|
161
|
+
maxRows: R
|
|
162
|
+
} = s, Q = Pe(s, Te), {
|
|
163
|
+
getRootProps: ee,
|
|
164
|
+
getInputProps: ne,
|
|
165
|
+
focused: te,
|
|
166
|
+
formControlContext: oe,
|
|
167
|
+
error: le,
|
|
168
|
+
disabled: X
|
|
169
|
+
} = Oe({
|
|
170
|
+
disabled: N,
|
|
171
171
|
defaultValue: g,
|
|
172
172
|
error: P,
|
|
173
|
-
onBlur:
|
|
174
|
-
onClick:
|
|
175
|
-
onChange:
|
|
176
|
-
onFocus:
|
|
177
|
-
required:
|
|
173
|
+
onBlur: B,
|
|
174
|
+
onClick: K,
|
|
175
|
+
onChange: $,
|
|
176
|
+
onFocus: I,
|
|
177
|
+
required: W,
|
|
178
178
|
value: e
|
|
179
|
-
}),
|
|
180
|
-
disabled:
|
|
181
|
-
error:
|
|
182
|
-
focused:
|
|
183
|
-
formControlContext:
|
|
179
|
+
}), J = h ? void 0 : G ?? "text", t = v({}, s, {
|
|
180
|
+
disabled: X,
|
|
181
|
+
error: le,
|
|
182
|
+
focused: te,
|
|
183
|
+
formControlContext: oe,
|
|
184
184
|
multiline: h,
|
|
185
|
-
type:
|
|
186
|
-
}), w =
|
|
187
|
-
"aria-describedby":
|
|
188
|
-
"aria-label":
|
|
185
|
+
type: J
|
|
186
|
+
}), w = Ie(t), D = {
|
|
187
|
+
"aria-describedby": q,
|
|
188
|
+
"aria-label": O,
|
|
189
189
|
"aria-labelledby": c,
|
|
190
|
-
autoComplete:
|
|
190
|
+
autoComplete: T,
|
|
191
191
|
autoFocus: l,
|
|
192
|
-
id:
|
|
193
|
-
onKeyDown:
|
|
194
|
-
onKeyUp:
|
|
195
|
-
name:
|
|
196
|
-
placeholder:
|
|
197
|
-
readOnly:
|
|
198
|
-
type:
|
|
199
|
-
},
|
|
200
|
-
elementType:
|
|
201
|
-
getSlotProps:
|
|
192
|
+
id: C,
|
|
193
|
+
onKeyDown: F,
|
|
194
|
+
onKeyUp: k,
|
|
195
|
+
name: A,
|
|
196
|
+
placeholder: L,
|
|
197
|
+
readOnly: Y,
|
|
198
|
+
type: J
|
|
199
|
+
}, x = (p = a.root) != null ? p : "div", Z = de({
|
|
200
|
+
elementType: x,
|
|
201
|
+
getSlotProps: ee,
|
|
202
202
|
externalSlotProps: r.root,
|
|
203
|
-
externalForwardedProps:
|
|
203
|
+
externalForwardedProps: Q,
|
|
204
204
|
additionalProps: {
|
|
205
205
|
ref: m
|
|
206
206
|
},
|
|
207
|
-
ownerState:
|
|
207
|
+
ownerState: t,
|
|
208
208
|
className: [w.root, b]
|
|
209
|
-
}),
|
|
210
|
-
elementType:
|
|
211
|
-
getSlotProps: (
|
|
209
|
+
}), i = h ? (_ = a.textarea) != null ? _ : "textarea" : (y = a.input) != null ? y : "input", U = de({
|
|
210
|
+
elementType: i,
|
|
211
|
+
getSlotProps: (E) => ne(v({}, D, E)),
|
|
212
212
|
externalSlotProps: r.input,
|
|
213
|
-
additionalProps:
|
|
214
|
-
rows: h ?
|
|
215
|
-
}, h && !
|
|
216
|
-
minRows:
|
|
217
|
-
maxRows:
|
|
213
|
+
additionalProps: v({
|
|
214
|
+
rows: h ? o : void 0
|
|
215
|
+
}, h && !Re(i) && {
|
|
216
|
+
minRows: o || d,
|
|
217
|
+
maxRows: o || R
|
|
218
218
|
}),
|
|
219
|
-
ownerState:
|
|
219
|
+
ownerState: t,
|
|
220
220
|
className: w.input
|
|
221
221
|
});
|
|
222
|
-
return process.env.NODE_ENV !== "production" && h &&
|
|
223
|
-
children: [
|
|
222
|
+
return process.env.NODE_ENV !== "production" && h && o && (d || R) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), /* @__PURE__ */ M(x, v({}, Z, {
|
|
223
|
+
children: [z, /* @__PURE__ */ H(i, v({}, U)), V]
|
|
224
224
|
}));
|
|
225
225
|
});
|
|
226
|
-
process.env.NODE_ENV !== "production" && (
|
|
226
|
+
process.env.NODE_ENV !== "production" && (fe.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`. │
|
|
@@ -373,11 +373,11 @@ process.env.NODE_ENV !== "production" && (ce.propTypes = {
|
|
|
373
373
|
*/
|
|
374
374
|
value: n.any
|
|
375
375
|
});
|
|
376
|
-
const
|
|
376
|
+
const Be = "_input_101pq_57", Ue = "_input__label_101pq_84", f = {
|
|
377
377
|
"input__input-el": "_input__input-el_101pq_57",
|
|
378
|
-
input:
|
|
378
|
+
input: Be,
|
|
379
379
|
"input__messages-wrapper": "_input__messages-wrapper_101pq_81",
|
|
380
|
-
input__label:
|
|
380
|
+
input__label: Ue,
|
|
381
381
|
"input__input-el-wrapper": "_input__input-el-wrapper_101pq_89",
|
|
382
382
|
"input__left-icon": "_input__left-icon_101pq_111",
|
|
383
383
|
"input__right-icon": "_input__right-icon_101pq_111",
|
|
@@ -387,82 +387,82 @@ const Te = "_input_101pq_57", Ie = "_input__label_101pq_84", f = {
|
|
|
387
387
|
"input--disabled": "_input--disabled_101pq_153",
|
|
388
388
|
"input--focused": "_input--focused_101pq_159",
|
|
389
389
|
"input--error": "_input--error_101pq_162"
|
|
390
|
-
},
|
|
390
|
+
}, $e = _e(
|
|
391
391
|
({
|
|
392
392
|
label: u,
|
|
393
393
|
infoMessage: s,
|
|
394
394
|
error: m,
|
|
395
395
|
errorMessage: p,
|
|
396
396
|
leftIcon: _,
|
|
397
|
-
rightIcon:
|
|
398
|
-
id:
|
|
399
|
-
disabled:
|
|
397
|
+
rightIcon: y,
|
|
398
|
+
id: q,
|
|
399
|
+
disabled: O,
|
|
400
400
|
type: c = "text",
|
|
401
|
-
maxLength:
|
|
401
|
+
maxLength: T,
|
|
402
402
|
isInteger: l,
|
|
403
403
|
useCommaInDecimal: b,
|
|
404
404
|
allowNegativeNumbers: g = !1,
|
|
405
|
-
decimalLength:
|
|
406
|
-
hideCharsCounter:
|
|
405
|
+
decimalLength: N = 10,
|
|
406
|
+
hideCharsCounter: V = !1,
|
|
407
407
|
required: P,
|
|
408
|
-
onChange:
|
|
408
|
+
onChange: C,
|
|
409
409
|
classNameWrapper: h,
|
|
410
|
-
classNameLabel:
|
|
411
|
-
classNameInput:
|
|
412
|
-
classNameInfoMessage:
|
|
413
|
-
classNameErrorMessage:
|
|
414
|
-
classNameCharsCounter:
|
|
415
|
-
"data-testid-wrapper":
|
|
416
|
-
"data-testid-label":
|
|
417
|
-
"data-testid-input":
|
|
418
|
-
"data-testid-infoMessage":
|
|
419
|
-
"data-testid-errorMessage":
|
|
420
|
-
"data-testid-charsCounter":
|
|
410
|
+
classNameLabel: A,
|
|
411
|
+
classNameInput: K,
|
|
412
|
+
classNameInfoMessage: $,
|
|
413
|
+
classNameErrorMessage: F,
|
|
414
|
+
classNameCharsCounter: k,
|
|
415
|
+
"data-testid-wrapper": I,
|
|
416
|
+
"data-testid-label": B,
|
|
417
|
+
"data-testid-input": L,
|
|
418
|
+
"data-testid-infoMessage": Y,
|
|
419
|
+
"data-testid-errorMessage": W,
|
|
420
|
+
"data-testid-charsCounter": z,
|
|
421
421
|
...e
|
|
422
|
-
},
|
|
423
|
-
var
|
|
424
|
-
const [
|
|
425
|
-
((
|
|
426
|
-
), a =
|
|
427
|
-
Object.assign(e, { "data-testid":
|
|
428
|
-
const
|
|
429
|
-
var w,
|
|
422
|
+
}, G) => {
|
|
423
|
+
var X, J;
|
|
424
|
+
const [o, r] = be(
|
|
425
|
+
((X = e.value) == null ? void 0 : X.length) || ((J = e.defaultValue) == null ? void 0 : J.length) || 0
|
|
426
|
+
), a = ge(), d = q || `input_${a}`;
|
|
427
|
+
Object.assign(e, { "data-testid": L });
|
|
428
|
+
const R = T && !V, Q = (t) => {
|
|
429
|
+
var w, D, x, Z;
|
|
430
430
|
if (c === "number-as-text") {
|
|
431
|
-
let i = l ?
|
|
432
|
-
if (!l &&
|
|
433
|
-
const
|
|
434
|
-
|
|
431
|
+
let i = l ? ye(t.target.value) : b ? t.target.value.replace(".", ",") : t.target.value.replace(",", ".");
|
|
432
|
+
if (!l && N > 0) {
|
|
433
|
+
const E = String(i), [me, ue] = E.split(/,|\./);
|
|
434
|
+
E !== "" && ue && (i = [me, ue.slice(0, N)].join(b ? "," : "."));
|
|
435
435
|
}
|
|
436
|
-
|
|
437
|
-
const
|
|
438
|
-
|
|
439
|
-
...
|
|
436
|
+
t.target.value = String(i);
|
|
437
|
+
const U = !isNaN(Number(String(i).replace(",", ".")));
|
|
438
|
+
C == null || C({
|
|
439
|
+
...t,
|
|
440
440
|
target: {
|
|
441
|
-
...
|
|
442
|
-
value:
|
|
443
|
-
valueAsNumber:
|
|
441
|
+
...t.target,
|
|
442
|
+
value: U && String(i).length ? String(Number(String(i).replace(",", "."))) : "",
|
|
443
|
+
valueAsNumber: U && String(i).length ? Number(String(i).replace(",", ".")) : NaN
|
|
444
444
|
}
|
|
445
|
-
});
|
|
445
|
+
}), R && r((D = (w = t == null ? void 0 : t.target) == null ? void 0 : w.value) == null ? void 0 : D.length);
|
|
446
446
|
return;
|
|
447
447
|
}
|
|
448
448
|
if (c === "number") {
|
|
449
|
-
let i = String(
|
|
450
|
-
const [
|
|
451
|
-
i !== "" && (
|
|
449
|
+
let i = String(t.target.value);
|
|
450
|
+
const [U, E] = i.split(".");
|
|
451
|
+
i !== "" && (E != null && E.length ? i = [Number(U), E.slice(0, N)].join(".") : i = String(Number(U))), t.target.value = i;
|
|
452
452
|
}
|
|
453
|
-
|
|
454
|
-
},
|
|
453
|
+
R && r((Z = (x = t == null ? void 0 : t.target) == null ? void 0 : x.value) == null ? void 0 : Z.length), C && C(t);
|
|
454
|
+
}, ee = (t) => {
|
|
455
455
|
var w;
|
|
456
|
-
c === "number-as-text" && (l ?
|
|
457
|
-
},
|
|
456
|
+
c === "number-as-text" && (l ? he(t, g) : we(t, g)), (w = e == null ? void 0 : e.onKeyDown) == null || w.call(e, t);
|
|
457
|
+
}, ne = (t) => {
|
|
458
458
|
var w;
|
|
459
|
-
if (c === "number-as-text" &&
|
|
460
|
-
const
|
|
461
|
-
let
|
|
462
|
-
isNaN(Number(
|
|
459
|
+
if (c === "number-as-text" && t.target.value.length) {
|
|
460
|
+
const D = l ? t.target.value.replace(/(,\.)/gi, "") : t.target.value.replace(",", ".");
|
|
461
|
+
let x = String(Number(D));
|
|
462
|
+
isNaN(Number(x)) && (x = ""), t.target.value = b ? x.replace(".", ",") : x;
|
|
463
463
|
}
|
|
464
|
-
(w = e == null ? void 0 : e.onBlur) == null || w.call(e,
|
|
465
|
-
},
|
|
464
|
+
(w = e == null ? void 0 : e.onBlur) == null || w.call(e, t);
|
|
465
|
+
}, te = ae(() => e.multiline !== !0 ? {
|
|
466
466
|
type: c === "number-as-text" ? "text" : c,
|
|
467
467
|
multiline: e.multiline
|
|
468
468
|
} : {
|
|
@@ -471,75 +471,75 @@ const Te = "_input_101pq_57", Ie = "_input__label_101pq_84", f = {
|
|
|
471
471
|
rows: (e == null ? void 0 : e.rows) || 5,
|
|
472
472
|
minRows: e == null ? void 0 : e.minRows,
|
|
473
473
|
maxRows: e == null ? void 0 : e.maxRows
|
|
474
|
-
}, [e]),
|
|
475
|
-
return /* @__PURE__ */
|
|
476
|
-
u && /* @__PURE__ */
|
|
474
|
+
}, [e]), oe = ae(() => c === "number-as-text" && (e != null && e.defaultValue) ? se(e == null ? void 0 : e.defaultValue, b) : e == null ? void 0 : e.defaultValue, [e.defaultValue]), le = ae(() => c === "number-as-text" && (e != null && e.value) ? se(e == null ? void 0 : e.value, b) : e == null ? void 0 : e.value, [e.value]);
|
|
475
|
+
return /* @__PURE__ */ M("div", { className: j(f.input, h), "data-testid": I, children: [
|
|
476
|
+
u && /* @__PURE__ */ M(
|
|
477
477
|
re,
|
|
478
478
|
{
|
|
479
479
|
bold: !0,
|
|
480
480
|
element: "label",
|
|
481
481
|
elementProps: { htmlFor: d },
|
|
482
|
-
className:
|
|
483
|
-
"data-testid":
|
|
482
|
+
className: j(f.input__label, A),
|
|
483
|
+
"data-testid": B,
|
|
484
484
|
children: [
|
|
485
485
|
u,
|
|
486
|
-
P && /* @__PURE__ */
|
|
486
|
+
P && /* @__PURE__ */ H("span", { children: "*" })
|
|
487
487
|
]
|
|
488
488
|
}
|
|
489
489
|
),
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
-
|
|
490
|
+
/* @__PURE__ */ H(
|
|
491
|
+
fe,
|
|
492
492
|
{
|
|
493
493
|
id: d,
|
|
494
|
-
disabled:
|
|
494
|
+
disabled: O,
|
|
495
495
|
error: typeof m == "boolean" ? m : !!p,
|
|
496
496
|
"aria-label": u,
|
|
497
497
|
slotProps: {
|
|
498
|
-
root: (
|
|
499
|
-
className:
|
|
500
|
-
[f["input--disabled"]]:
|
|
501
|
-
[f["input--focused"]]:
|
|
502
|
-
[f["input--error"]]:
|
|
498
|
+
root: (t) => ({
|
|
499
|
+
className: j(f["input__input-el-wrapper"], {
|
|
500
|
+
[f["input--disabled"]]: t.disabled,
|
|
501
|
+
[f["input--focused"]]: t.focused,
|
|
502
|
+
[f["input--error"]]: t.error
|
|
503
503
|
})
|
|
504
504
|
}),
|
|
505
505
|
input: {
|
|
506
|
-
ref:
|
|
507
|
-
className:
|
|
508
|
-
maxLength:
|
|
509
|
-
onChange:
|
|
506
|
+
ref: G,
|
|
507
|
+
className: j(f["input__input-el"], K),
|
|
508
|
+
maxLength: T,
|
|
509
|
+
onChange: Q,
|
|
510
510
|
...e,
|
|
511
|
-
onKeyDown:
|
|
512
|
-
onBlur:
|
|
513
|
-
defaultValue:
|
|
514
|
-
value:
|
|
511
|
+
onKeyDown: ee,
|
|
512
|
+
onBlur: ne,
|
|
513
|
+
defaultValue: oe,
|
|
514
|
+
value: le
|
|
515
515
|
}
|
|
516
516
|
},
|
|
517
|
-
startAdornment: _ && /* @__PURE__ */
|
|
518
|
-
endAdornment:
|
|
519
|
-
...
|
|
517
|
+
startAdornment: _ && /* @__PURE__ */ H("span", { className: f["input__left-icon"], children: _ }),
|
|
518
|
+
endAdornment: y && /* @__PURE__ */ H("span", { className: f["input__right-icon"], children: y }),
|
|
519
|
+
...te
|
|
520
520
|
}
|
|
521
521
|
),
|
|
522
|
-
/* @__PURE__ */
|
|
523
|
-
(p || s) && /* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ M("div", { className: f["input__messages-wrapper"], children: [
|
|
523
|
+
(p || s) && /* @__PURE__ */ M(
|
|
524
524
|
re,
|
|
525
525
|
{
|
|
526
|
-
className: p ?
|
|
527
|
-
"data-testid": p ?
|
|
526
|
+
className: p ? j(f["input__error-message"], F) : j(f["input__info-message"], $),
|
|
527
|
+
"data-testid": p ? W : Y,
|
|
528
528
|
children: [
|
|
529
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ H(Ne, { icon: p ? "circle-exclamation" : "circle-info" }),
|
|
530
530
|
p || s
|
|
531
531
|
]
|
|
532
532
|
}
|
|
533
533
|
),
|
|
534
|
-
|
|
534
|
+
R && /* @__PURE__ */ M(
|
|
535
535
|
re,
|
|
536
536
|
{
|
|
537
|
-
className:
|
|
538
|
-
"data-testid":
|
|
537
|
+
className: j(f["input__chars-counter"], k),
|
|
538
|
+
"data-testid": z,
|
|
539
539
|
children: [
|
|
540
|
-
|
|
540
|
+
o,
|
|
541
541
|
" / ",
|
|
542
|
-
|
|
542
|
+
T
|
|
543
543
|
]
|
|
544
544
|
}
|
|
545
545
|
)
|
|
@@ -548,5 +548,5 @@ const Te = "_input_101pq_57", Ie = "_input__label_101pq_84", f = {
|
|
|
548
548
|
}
|
|
549
549
|
);
|
|
550
550
|
export {
|
|
551
|
-
|
|
551
|
+
$e as Input
|
|
552
552
|
};
|