@pismo/marola 2.1.23 → 2.1.25

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