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