@chayns-components/core 5.0.21 → 5.0.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 (42) hide show
  1. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js +5 -1
  2. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  3. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js +37 -0
  4. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  5. package/lib/cjs/components/grouped-image/GroupedImage.styles.js +18 -20
  6. package/lib/cjs/components/grouped-image/GroupedImage.styles.js.map +1 -1
  7. package/lib/cjs/components/list/List.js +97 -37
  8. package/lib/cjs/components/list/List.js.map +1 -1
  9. package/lib/cjs/components/list/list-item/ListItem.js +0 -9
  10. package/lib/cjs/components/list/list-item/ListItem.js.map +1 -1
  11. package/lib/cjs/components/number-input/NumberInput.js +213 -132
  12. package/lib/cjs/components/number-input/NumberInput.js.map +1 -1
  13. package/lib/cjs/components/progress-bar/ProgressBar.js +181 -66
  14. package/lib/cjs/components/progress-bar/ProgressBar.js.map +1 -1
  15. package/lib/cjs/components/progress-bar/ProgressBar.styles.js +36 -1
  16. package/lib/cjs/components/progress-bar/ProgressBar.styles.js.map +1 -1
  17. package/lib/cjs/utils/numberInput.js +1 -0
  18. package/lib/cjs/utils/numberInput.js.map +1 -1
  19. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +6 -2
  20. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  21. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js +38 -1
  22. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  23. package/lib/esm/components/grouped-image/GroupedImage.styles.js +18 -20
  24. package/lib/esm/components/grouped-image/GroupedImage.styles.js.map +1 -1
  25. package/lib/esm/components/list/List.js +97 -37
  26. package/lib/esm/components/list/List.js.map +1 -1
  27. package/lib/esm/components/list/list-item/ListItem.js +0 -9
  28. package/lib/esm/components/list/list-item/ListItem.js.map +1 -1
  29. package/lib/esm/components/number-input/NumberInput.js +213 -132
  30. package/lib/esm/components/number-input/NumberInput.js.map +1 -1
  31. package/lib/esm/components/progress-bar/ProgressBar.js +173 -68
  32. package/lib/esm/components/progress-bar/ProgressBar.js.map +1 -1
  33. package/lib/esm/components/progress-bar/ProgressBar.styles.js +36 -1
  34. package/lib/esm/components/progress-bar/ProgressBar.styles.js.map +1 -1
  35. package/lib/esm/utils/numberInput.js +1 -0
  36. package/lib/esm/utils/numberInput.js.map +1 -1
  37. package/lib/types/components/color-scheme-provider/ColorSchemeProvider.styles.d.ts +7 -3
  38. package/lib/types/components/grouped-image/GroupedImage.styles.d.ts +3 -1
  39. package/lib/types/components/list/List.d.ts +0 -1
  40. package/lib/types/components/progress-bar/ProgressBar.d.ts +9 -1
  41. package/lib/types/components/progress-bar/ProgressBar.styles.d.ts +7 -0
  42. package/package.json +2 -2
@@ -4,155 +4,236 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ var _reactCompilerRuntime = require("react-compiler-runtime");
7
8
  var _react = _interopRequireWildcard(require("react"));
8
9
  var _numberInput = require("../../constants/numberInput");
9
10
  var _numberInput2 = require("../../utils/numberInput");
10
11
  var _Input = _interopRequireDefault(require("../input/Input"));
11
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
13
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
- const NumberInput = ({
14
- isDecimalInput,
15
- isMoneyInput,
16
- isTimeInput,
17
- isInvalid,
18
- maxNumber = Infinity,
19
- value,
20
- shouldTriggerChangeOnFormat = true,
21
- placeholder,
22
- onBlur,
23
- isDisabled,
24
- onChange,
25
- shouldShowOnlyBottomBorder,
26
- minNumber = -Infinity
27
- }) => {
28
- // the plainText will be shown in the input, when it is in focus
29
- const [plainText, setPlainText] = (0, _react.useState)('');
30
- // the formattedValue will be shown in the input, when it is not in focus
31
- const [formattedValue, setFormattedValue] = (0, _react.useState)('');
14
+ const NumberInput = t0 => {
15
+ "use memo";
16
+
17
+ const $ = (0, _reactCompilerRuntime.c)(41);
18
+ const {
19
+ isDecimalInput,
20
+ isMoneyInput,
21
+ isTimeInput,
22
+ isInvalid,
23
+ maxNumber: t1,
24
+ value,
25
+ shouldTriggerChangeOnFormat: t2,
26
+ placeholder,
27
+ onBlur,
28
+ isDisabled,
29
+ onChange,
30
+ shouldShowOnlyBottomBorder,
31
+ minNumber: t3
32
+ } = t0;
33
+ const maxNumber = t1 === undefined ? Infinity : t1;
34
+ const shouldTriggerChangeOnFormat = t2 === undefined ? true : t2;
35
+ const minNumber = t3 === undefined ? -Infinity : t3;
36
+ const [plainText, setPlainText] = (0, _react.useState)("");
37
+ const [formattedValue, setFormattedValue] = (0, _react.useState)("");
32
38
  const [hasFocus, setHasFocus] = (0, _react.useState)(false);
33
39
  const [shouldRemainPlaceholder, setShouldRemainPlaceholder] = (0, _react.useState)(false);
34
40
  const [isValueInvalid, setIsValueInvalid] = (0, _react.useState)(false);
35
- const localPlaceholder = placeholder ?? (isMoneyInput ? '€' : undefined);
41
+ const localPlaceholder = placeholder ?? (isMoneyInput ? "\u20AC" : undefined);
36
42
  const initialInputRef = (0, _react.useRef)(true);
37
- const onLocalChange = event => {
38
- const newValue = event.target.value;
39
- initialInputRef.current = false;
40
- const sanitizedValueString = newValue
41
- // Removes everything except numbers, commas and points
42
- .replace(_numberInput.NUMBER_CLEAR_REGEX, '');
43
- if (isTimeInput && (sanitizedValueString.includes(':') && sanitizedValueString.length > 5 || !sanitizedValueString.includes(':') && sanitizedValueString.length > 4)) {
44
- return;
45
- }
46
- const valueToCheck = sanitizedValueString.replaceAll(',', '.');
47
- if (!(0, _numberInput2.isValidString)({
48
- string: valueToCheck,
49
- isMoneyInput,
50
- isDecimalInput,
51
- isTimeInput
52
- })) {
53
- return;
54
- }
55
- if (maxNumber && Number(valueToCheck) > maxNumber || minNumber && Number(valueToCheck) < minNumber) {
56
- return;
57
- }
58
- if (newValue.length === 1 && newValue.match(/^[0-9]+$/) === null) {
59
- setShouldRemainPlaceholder(true);
60
- } else {
61
- setShouldRemainPlaceholder(false);
62
- }
63
- setPlainText(sanitizedValueString.replaceAll('.', ','));
64
- if (typeof onChange === 'function') {
65
- onChange(sanitizedValueString.replaceAll('.', ','));
66
- }
67
- };
68
- const onLocalBlur = () => {
69
- const sanitizedValue = plainText;
70
- let newIsInvalid = false;
71
- let parsedNumber = null;
72
- if (!isTimeInput) {
73
- parsedNumber = (0, _numberInput2.parseFloatWithDecimals)({
74
- stringValue: sanitizedValue.replace(',', '.').replaceAll(':', '').replace('€', ''),
75
- decimals: isMoneyInput ? 2 : undefined
76
- });
77
- if (parsedNumber && parsedNumber !== 0 && (parsedNumber > maxNumber || parsedNumber < minNumber)) {
78
- newIsInvalid = true;
43
+ let t4;
44
+ if ($[0] !== isDecimalInput || $[1] !== isMoneyInput || $[2] !== isTimeInput || $[3] !== maxNumber || $[4] !== minNumber || $[5] !== onChange) {
45
+ t4 = event => {
46
+ const newValue = event.target.value;
47
+ initialInputRef.current = false;
48
+ const sanitizedValueString = newValue.replace(_numberInput.NUMBER_CLEAR_REGEX, "");
49
+ if (isTimeInput && (sanitizedValueString.includes(":") && sanitizedValueString.length > 5 || !sanitizedValueString.includes(":") && sanitizedValueString.length > 4)) {
50
+ return;
79
51
  }
80
- setIsValueInvalid(newIsInvalid);
81
- }
82
- const newStringValue = plainText.length === 0 ? '' : (0, _numberInput2.formateNumber)({
83
- number: isTimeInput ? sanitizedValue : parsedNumber,
84
- isMoneyInput,
85
- isTimeInput
86
- });
87
- setFormattedValue(`${newStringValue} ${isMoneyInput ? '€' : ''}`);
88
- setPlainText(newStringValue.replaceAll('.', ''));
89
- setHasFocus(false);
90
- if (typeof onChange === 'function' && shouldTriggerChangeOnFormat) {
91
- onChange(newStringValue.replaceAll('.', ''));
92
- }
93
- if (typeof onBlur === 'function') {
94
- if (isTimeInput) {
95
- onBlur(newStringValue, newIsInvalid);
52
+ const valueToCheck = sanitizedValueString.replaceAll(",", ".");
53
+ if (!(0, _numberInput2.isValidString)({
54
+ string: valueToCheck,
55
+ isMoneyInput,
56
+ isDecimalInput,
57
+ isTimeInput
58
+ })) {
59
+ return;
60
+ }
61
+ if (maxNumber && Number(valueToCheck) > maxNumber || minNumber && Number(valueToCheck) < minNumber) {
62
+ return;
63
+ }
64
+ if (newValue.length === 1 && newValue.match(/^[0-9]+$/) === null) {
65
+ setShouldRemainPlaceholder(true);
96
66
  } else {
97
- onBlur(parsedNumber, newIsInvalid);
67
+ setShouldRemainPlaceholder(false);
98
68
  }
99
- }
100
- };
101
- const onLocalFocus = () => {
102
- // formattedValue will be a number string with german number format (e.g. 1.000,00)
103
- // It will remove all dots, so that the user can type in the number
104
- setPlainText(formattedValue.replaceAll('.', '').replace('€', '').replaceAll(' ', ''));
105
-
106
- // This will update the external state
107
- if (typeof onChange === 'function' && shouldTriggerChangeOnFormat) {
108
- onChange(formattedValue.replaceAll('.', '').replace('€', '').replaceAll(' ', ''));
109
- }
110
- setIsValueInvalid(false);
111
- setHasFocus(true);
112
- };
113
-
114
- // updates the formattedValue, when the value changes
115
- (0, _react.useEffect)(() => {
116
- let parsedNumber = null;
117
- if (!isTimeInput) {
118
- parsedNumber = (0, _numberInput2.parseFloatWithDecimals)({
119
- stringValue: plainText.replace(',', '.').replaceAll(':', '').replace('€', '').replaceAll(' ', ''),
120
- decimals: isMoneyInput ? 2 : undefined
69
+ setPlainText(sanitizedValueString.replaceAll(".", ","));
70
+ if (typeof onChange === "function") {
71
+ onChange(sanitizedValueString.replaceAll(".", ","));
72
+ }
73
+ };
74
+ $[0] = isDecimalInput;
75
+ $[1] = isMoneyInput;
76
+ $[2] = isTimeInput;
77
+ $[3] = maxNumber;
78
+ $[4] = minNumber;
79
+ $[5] = onChange;
80
+ $[6] = t4;
81
+ } else {
82
+ t4 = $[6];
83
+ }
84
+ const onLocalChange = t4;
85
+ let t5;
86
+ if ($[7] !== isMoneyInput || $[8] !== isTimeInput || $[9] !== maxNumber || $[10] !== minNumber || $[11] !== onBlur || $[12] !== onChange || $[13] !== plainText || $[14] !== shouldTriggerChangeOnFormat) {
87
+ t5 = () => {
88
+ const sanitizedValue = plainText;
89
+ let newIsInvalid = false;
90
+ let parsedNumber = null;
91
+ if (!isTimeInput) {
92
+ parsedNumber = (0, _numberInput2.parseFloatWithDecimals)({
93
+ stringValue: sanitizedValue.replace(",", ".").replaceAll(":", "").replace("\u20AC", ""),
94
+ decimals: isMoneyInput ? 2 : undefined
95
+ });
96
+ if (parsedNumber && parsedNumber !== 0 && (parsedNumber > maxNumber || parsedNumber < minNumber)) {
97
+ newIsInvalid = true;
98
+ }
99
+ setIsValueInvalid(newIsInvalid);
100
+ }
101
+ const newStringValue = plainText.length === 0 ? "" : (0, _numberInput2.formateNumber)({
102
+ number: isTimeInput ? sanitizedValue : parsedNumber,
103
+ isMoneyInput,
104
+ isTimeInput
121
105
  });
122
-
123
- // checks, if a given number is invalid, if the input is not in focus
124
- if (!hasFocus) {
125
- if (parsedNumber === null && initialInputRef.current) {
126
- setIsValueInvalid(false);
106
+ setFormattedValue(`${newStringValue} ${isMoneyInput ? "\u20AC" : ""}`);
107
+ setPlainText(newStringValue.replaceAll(".", ""));
108
+ setHasFocus(false);
109
+ if (typeof onChange === "function" && shouldTriggerChangeOnFormat) {
110
+ onChange(newStringValue.replaceAll(".", ""));
111
+ }
112
+ if (typeof onBlur === "function") {
113
+ if (isTimeInput) {
114
+ onBlur(newStringValue, newIsInvalid);
127
115
  } else {
128
- setIsValueInvalid(parsedNumber === null || parsedNumber > maxNumber || parsedNumber < minNumber);
116
+ onBlur(parsedNumber, newIsInvalid);
117
+ }
118
+ }
119
+ };
120
+ $[7] = isMoneyInput;
121
+ $[8] = isTimeInput;
122
+ $[9] = maxNumber;
123
+ $[10] = minNumber;
124
+ $[11] = onBlur;
125
+ $[12] = onChange;
126
+ $[13] = plainText;
127
+ $[14] = shouldTriggerChangeOnFormat;
128
+ $[15] = t5;
129
+ } else {
130
+ t5 = $[15];
131
+ }
132
+ const onLocalBlur = t5;
133
+ let t6;
134
+ if ($[16] !== formattedValue || $[17] !== onChange || $[18] !== shouldTriggerChangeOnFormat) {
135
+ t6 = () => {
136
+ setPlainText(formattedValue.replaceAll(".", "").replace("\u20AC", "").replaceAll(" ", ""));
137
+ if (typeof onChange === "function" && shouldTriggerChangeOnFormat) {
138
+ onChange(formattedValue.replaceAll(".", "").replace("\u20AC", "").replaceAll(" ", ""));
139
+ }
140
+ setIsValueInvalid(false);
141
+ setHasFocus(true);
142
+ };
143
+ $[16] = formattedValue;
144
+ $[17] = onChange;
145
+ $[18] = shouldTriggerChangeOnFormat;
146
+ $[19] = t6;
147
+ } else {
148
+ t6 = $[19];
149
+ }
150
+ const onLocalFocus = t6;
151
+ let t7;
152
+ let t8;
153
+ if ($[20] !== hasFocus || $[21] !== isMoneyInput || $[22] !== isTimeInput || $[23] !== maxNumber || $[24] !== minNumber || $[25] !== plainText) {
154
+ t7 = () => {
155
+ let parsedNumber_0 = null;
156
+ if (!isTimeInput) {
157
+ parsedNumber_0 = (0, _numberInput2.parseFloatWithDecimals)({
158
+ stringValue: plainText.replace(",", ".").replaceAll(":", "").replace("\u20AC", "").replaceAll(" ", ""),
159
+ decimals: isMoneyInput ? 2 : undefined
160
+ });
161
+ if (!hasFocus) {
162
+ if (parsedNumber_0 === null && initialInputRef.current) {
163
+ setIsValueInvalid(false);
164
+ } else {
165
+ setIsValueInvalid(parsedNumber_0 === null || parsedNumber_0 > maxNumber || parsedNumber_0 < minNumber);
166
+ }
129
167
  }
130
168
  }
131
- }
132
- setFormattedValue(plainText.length === 0 ? '' : `${(0, _numberInput2.formateNumber)({
133
- number: isTimeInput ? plainText : parsedNumber,
134
- isMoneyInput,
135
- isTimeInput
136
- })}${isMoneyInput ? ' €' : ''}`);
137
- }, [hasFocus, isMoneyInput, isTimeInput, maxNumber, minNumber, plainText]);
138
- (0, _react.useEffect)(() => {
139
- if (typeof value === 'string') {
140
- setPlainText(value.replace('€', '').replaceAll(' ', ''));
141
- }
142
- }, [value]);
143
- return /*#__PURE__*/_react.default.createElement(_Input.default, {
144
- shouldRemainPlaceholder: shouldRemainPlaceholder,
145
- shouldShowOnlyBottomBorder: shouldShowOnlyBottomBorder,
146
- inputMode: "decimal",
147
- onChange: onLocalChange,
148
- value: hasFocus ? plainText : formattedValue,
149
- placeholder: localPlaceholder,
150
- onBlur: onLocalBlur,
151
- onFocus: onLocalFocus,
152
- isDisabled: isDisabled,
153
- isInvalid: typeof isInvalid === 'boolean' ? isInvalid : isValueInvalid,
154
- shouldShowCenteredContent: shouldShowOnlyBottomBorder
155
- });
169
+ setFormattedValue(plainText.length === 0 ? "" : `${(0, _numberInput2.formateNumber)({
170
+ number: isTimeInput ? plainText : parsedNumber_0,
171
+ isMoneyInput,
172
+ isTimeInput
173
+ })}${isMoneyInput ? " \u20AC" : ""}`);
174
+ };
175
+ t8 = [hasFocus, isMoneyInput, isTimeInput, maxNumber, minNumber, plainText];
176
+ $[20] = hasFocus;
177
+ $[21] = isMoneyInput;
178
+ $[22] = isTimeInput;
179
+ $[23] = maxNumber;
180
+ $[24] = minNumber;
181
+ $[25] = plainText;
182
+ $[26] = t7;
183
+ $[27] = t8;
184
+ } else {
185
+ t7 = $[26];
186
+ t8 = $[27];
187
+ }
188
+ (0, _react.useEffect)(t7, t8);
189
+ let t10;
190
+ let t9;
191
+ if ($[28] !== value) {
192
+ t9 = () => {
193
+ if (typeof value === "string") {
194
+ setPlainText(value.replace("\u20AC", "").replaceAll(" ", ""));
195
+ }
196
+ };
197
+ t10 = [value];
198
+ $[28] = value;
199
+ $[29] = t10;
200
+ $[30] = t9;
201
+ } else {
202
+ t10 = $[29];
203
+ t9 = $[30];
204
+ }
205
+ (0, _react.useEffect)(t9, t10);
206
+ const t11 = hasFocus ? plainText : formattedValue;
207
+ const t12 = typeof isInvalid === "boolean" ? isInvalid : isValueInvalid;
208
+ let t13;
209
+ if ($[31] !== isDisabled || $[32] !== localPlaceholder || $[33] !== onLocalBlur || $[34] !== onLocalChange || $[35] !== onLocalFocus || $[36] !== shouldRemainPlaceholder || $[37] !== shouldShowOnlyBottomBorder || $[38] !== t11 || $[39] !== t12) {
210
+ t13 = /*#__PURE__*/_react.default.createElement(_Input.default, {
211
+ shouldRemainPlaceholder: shouldRemainPlaceholder,
212
+ shouldShowOnlyBottomBorder: shouldShowOnlyBottomBorder,
213
+ inputMode: "decimal",
214
+ onChange: onLocalChange,
215
+ value: t11,
216
+ placeholder: localPlaceholder,
217
+ onBlur: onLocalBlur,
218
+ onFocus: onLocalFocus,
219
+ isDisabled: isDisabled,
220
+ isInvalid: t12,
221
+ shouldShowCenteredContent: shouldShowOnlyBottomBorder
222
+ });
223
+ $[31] = isDisabled;
224
+ $[32] = localPlaceholder;
225
+ $[33] = onLocalBlur;
226
+ $[34] = onLocalChange;
227
+ $[35] = onLocalFocus;
228
+ $[36] = shouldRemainPlaceholder;
229
+ $[37] = shouldShowOnlyBottomBorder;
230
+ $[38] = t11;
231
+ $[39] = t12;
232
+ $[40] = t13;
233
+ } else {
234
+ t13 = $[40];
235
+ }
236
+ return t13;
156
237
  };
157
238
  NumberInput.displayName = 'NumberInput';
158
239
  var _default = exports.default = NumberInput;
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.js","names":["_react","_interopRequireWildcard","require","_numberInput","_numberInput2","_Input","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","NumberInput","isDecimalInput","isMoneyInput","isTimeInput","isInvalid","maxNumber","Infinity","value","shouldTriggerChangeOnFormat","placeholder","onBlur","isDisabled","onChange","shouldShowOnlyBottomBorder","minNumber","plainText","setPlainText","useState","formattedValue","setFormattedValue","hasFocus","setHasFocus","shouldRemainPlaceholder","setShouldRemainPlaceholder","isValueInvalid","setIsValueInvalid","localPlaceholder","undefined","initialInputRef","useRef","onLocalChange","event","newValue","target","current","sanitizedValueString","replace","NUMBER_CLEAR_REGEX","includes","length","valueToCheck","replaceAll","isValidString","string","Number","match","onLocalBlur","sanitizedValue","newIsInvalid","parsedNumber","parseFloatWithDecimals","stringValue","decimals","newStringValue","formateNumber","number","onLocalFocus","useEffect","createElement","inputMode","onFocus","shouldShowCenteredContent","displayName","_default","exports"],"sources":["../../../../src/components/number-input/NumberInput.tsx"],"sourcesContent":["import React, { ChangeEventHandler, FC, useEffect, useRef, useState } from 'react';\nimport { NUMBER_CLEAR_REGEX } from '../../constants/numberInput';\nimport { formateNumber, isValidString, parseFloatWithDecimals } from '../../utils/numberInput';\nimport Input from '../input/Input';\n\nexport type NumberInputProps = {\n /**\n * Applies rules for decimal input.\n * Enables the user to input one zero as number before the comma\n */\n isDecimalInput?: boolean;\n /**\n * Whether the input is disabled\n */\n isDisabled?: boolean;\n /**\n * Whether the value is invalid.\n */\n isInvalid?: boolean;\n /**\n * Applies rules for money input.\n * Rules: only two decimal places, one zero before the comma\n */\n isMoneyInput?: boolean;\n /**\n * Whether the value should be formatted as a time.\n */\n isTimeInput?: boolean;\n /**\n * Limits the number to this value\n */\n maxNumber?: number;\n /**\n * Limits the number to this value\n */\n minNumber?: number;\n /**\n * Callback function that is called when the input gets out of focus\n */\n onBlur?: (newNumber: number | string | null, isInvalid: boolean) => void;\n /**\n * Callback function that is called when the input changes\n * It will pass the text from the input\n */\n onChange?: (newValue: string) => void;\n /**\n * Placeholder for the input field\n */\n placeholder?: string;\n /**\n * Whether only the bottom border should be displayed\n */\n shouldShowOnlyBottomBorder?: boolean;\n /**\n * Whether the onChange function should be triggert when the value is formatted on the focus or blur\n */\n shouldTriggerChangeOnFormat?: boolean;\n /**\n * The value, that should be displayed in the input, when it is in focus.\n * You can also pass a stringified number as default value.\n * NOTE: If you pass a stringified number, it will be formatted to the selected format\n */\n value?: string;\n};\n\nconst NumberInput: FC<NumberInputProps> = ({\n isDecimalInput,\n isMoneyInput,\n isTimeInput,\n isInvalid,\n maxNumber = Infinity,\n value,\n shouldTriggerChangeOnFormat = true,\n placeholder,\n onBlur,\n isDisabled,\n onChange,\n shouldShowOnlyBottomBorder,\n minNumber = -Infinity,\n}) => {\n // the plainText will be shown in the input, when it is in focus\n const [plainText, setPlainText] = useState<string>('');\n // the formattedValue will be shown in the input, when it is not in focus\n const [formattedValue, setFormattedValue] = useState<string>('');\n const [hasFocus, setHasFocus] = useState<boolean>(false);\n const [shouldRemainPlaceholder, setShouldRemainPlaceholder] = useState<boolean>(false);\n\n const [isValueInvalid, setIsValueInvalid] = useState(false);\n const localPlaceholder = placeholder ?? (isMoneyInput ? '€' : undefined);\n\n const initialInputRef = useRef(true);\n\n const onLocalChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n const newValue = event.target.value;\n\n initialInputRef.current = false;\n\n const sanitizedValueString = newValue\n // Removes everything except numbers, commas and points\n .replace(NUMBER_CLEAR_REGEX, '');\n\n if (\n isTimeInput &&\n ((sanitizedValueString.includes(':') && sanitizedValueString.length > 5) ||\n (!sanitizedValueString.includes(':') && sanitizedValueString.length > 4))\n ) {\n return;\n }\n\n const valueToCheck = sanitizedValueString.replaceAll(',', '.');\n\n if (!isValidString({ string: valueToCheck, isMoneyInput, isDecimalInput, isTimeInput })) {\n return;\n }\n\n if (\n (maxNumber && Number(valueToCheck) > maxNumber) ||\n (minNumber && Number(valueToCheck) < minNumber)\n ) {\n return;\n }\n\n if (newValue.length === 1 && newValue.match(/^[0-9]+$/) === null) {\n setShouldRemainPlaceholder(true);\n } else {\n setShouldRemainPlaceholder(false);\n }\n\n setPlainText(sanitizedValueString.replaceAll('.', ','));\n\n if (typeof onChange === 'function') {\n onChange(sanitizedValueString.replaceAll('.', ','));\n }\n };\n\n const onLocalBlur = () => {\n const sanitizedValue = plainText;\n let newIsInvalid = false;\n let parsedNumber = null;\n\n if (!isTimeInput) {\n parsedNumber = parseFloatWithDecimals({\n stringValue: sanitizedValue.replace(',', '.').replaceAll(':', '').replace('€', ''),\n decimals: isMoneyInput ? 2 : undefined,\n });\n\n if (\n parsedNumber &&\n parsedNumber !== 0 &&\n (parsedNumber > maxNumber || parsedNumber < minNumber)\n ) {\n newIsInvalid = true;\n }\n\n setIsValueInvalid(newIsInvalid);\n }\n\n const newStringValue =\n plainText.length === 0\n ? ''\n : formateNumber({\n number: isTimeInput ? sanitizedValue : parsedNumber,\n isMoneyInput,\n isTimeInput,\n });\n\n setFormattedValue(`${newStringValue} ${isMoneyInput ? '€' : ''}`);\n setPlainText(newStringValue.replaceAll('.', ''));\n setHasFocus(false);\n\n if (typeof onChange === 'function' && shouldTriggerChangeOnFormat) {\n onChange(newStringValue.replaceAll('.', ''));\n }\n\n if (typeof onBlur === 'function') {\n if (isTimeInput) {\n onBlur(newStringValue, newIsInvalid);\n } else {\n onBlur(parsedNumber, newIsInvalid);\n }\n }\n };\n\n const onLocalFocus = () => {\n // formattedValue will be a number string with german number format (e.g. 1.000,00)\n // It will remove all dots, so that the user can type in the number\n setPlainText(formattedValue.replaceAll('.', '').replace('€', '').replaceAll(' ', ''));\n\n // This will update the external state\n if (typeof onChange === 'function' && shouldTriggerChangeOnFormat) {\n onChange(formattedValue.replaceAll('.', '').replace('€', '').replaceAll(' ', ''));\n }\n\n setIsValueInvalid(false);\n setHasFocus(true);\n };\n\n // updates the formattedValue, when the value changes\n useEffect(() => {\n let parsedNumber = null;\n\n if (!isTimeInput) {\n parsedNumber = parseFloatWithDecimals({\n stringValue: plainText\n .replace(',', '.')\n .replaceAll(':', '')\n .replace('€', '')\n .replaceAll(' ', ''),\n decimals: isMoneyInput ? 2 : undefined,\n });\n\n // checks, if a given number is invalid, if the input is not in focus\n if (!hasFocus) {\n if (parsedNumber === null && initialInputRef.current) {\n setIsValueInvalid(false);\n } else {\n setIsValueInvalid(\n parsedNumber === null ||\n parsedNumber > maxNumber ||\n parsedNumber < minNumber,\n );\n }\n }\n }\n\n setFormattedValue(\n plainText.length === 0\n ? ''\n : `${formateNumber({\n number: isTimeInput ? plainText : parsedNumber,\n isMoneyInput,\n isTimeInput,\n })}${isMoneyInput ? ' €' : ''}`,\n );\n }, [hasFocus, isMoneyInput, isTimeInput, maxNumber, minNumber, plainText]);\n\n useEffect(() => {\n if (typeof value === 'string') {\n setPlainText(value.replace('€', '').replaceAll(' ', ''));\n }\n }, [value]);\n\n return (\n <Input\n shouldRemainPlaceholder={shouldRemainPlaceholder}\n shouldShowOnlyBottomBorder={shouldShowOnlyBottomBorder}\n inputMode=\"decimal\"\n onChange={onLocalChange}\n value={hasFocus ? plainText : formattedValue}\n placeholder={localPlaceholder}\n onBlur={onLocalBlur}\n onFocus={onLocalFocus}\n isDisabled={isDisabled}\n isInvalid={typeof isInvalid === 'boolean' ? isInvalid : isValueInvalid}\n shouldShowCenteredContent={shouldShowOnlyBottomBorder}\n />\n );\n};\n\nNumberInput.displayName = 'NumberInput';\n\nexport default NumberInput;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAmC,SAAAI,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA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AA,CAAAS,OAAA,CAAA2E,aAAA,CAAC/E,MAAA,CAAAI,OAAK;IACFuC,uBAAuB,EAAEA,uBAAwB;IACjDT,0BAA0B,EAAEA,0BAA2B;IACvD8C,SAAS,EAAC,SAAS;IACnB/C,QAAQ,EAAEkB,aAAc;IACxBvB,KAAK,EAAEa,QAAQ,GAAGL,SAAS,GAAGG,cAAe;IAC7CT,WAAW,EAAEiB,gBAAiB;IAC9BhB,MAAM,EAAEoC,WAAY;IACpBc,OAAO,EAAEJ,YAAa;IACtB7C,UAAU,EAAEA,UAAW;IACvBP,SAAS,EAAE,OAAOA,SAAS,KAAK,SAAS,GAAGA,SAAS,GAAGoB,cAAe;IACvEqC,yBAAyB,EAAEhD;EAA2B,CACzD,CAAC;AAEV,CAAC;AAEDb,WAAW,CAAC8D,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjF,OAAA,GAEzBiB,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"NumberInput.js","names":["_react","_interopRequireWildcard","require","_numberInput","_numberInput2","_Input","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","NumberInput","t0","$","_reactCompilerRuntime","c","isDecimalInput","isMoneyInput","isTimeInput","isInvalid","maxNumber","t1","value","shouldTriggerChangeOnFormat","t2","placeholder","onBlur","isDisabled","onChange","shouldShowOnlyBottomBorder","minNumber","t3","undefined","Infinity","plainText","setPlainText","useState","formattedValue","setFormattedValue","hasFocus","setHasFocus","shouldRemainPlaceholder","setShouldRemainPlaceholder","isValueInvalid","setIsValueInvalid","localPlaceholder","initialInputRef","useRef","t4","event","newValue","target","current","sanitizedValueString","replace","NUMBER_CLEAR_REGEX","includes","length","valueToCheck","replaceAll","isValidString","string","Number","match","onLocalChange","t5","sanitizedValue","newIsInvalid","parsedNumber","parseFloatWithDecimals","stringValue","decimals","newStringValue","formateNumber","number","onLocalBlur","t6","onLocalFocus","t7","t8","parsedNumber_0","useEffect","t10","t9","t11","t12","t13","createElement","inputMode","displayName","_default","exports"],"sources":["../../../../src/components/number-input/NumberInput.tsx"],"sourcesContent":["import React, { ChangeEventHandler, FC, useEffect, useRef, useState } from 'react';\nimport { NUMBER_CLEAR_REGEX } from '../../constants/numberInput';\nimport { formateNumber, isValidString, parseFloatWithDecimals } from '../../utils/numberInput';\nimport Input from '../input/Input';\n\nexport type NumberInputProps = {\n /**\n * Applies rules for decimal input.\n * Enables the user to input one zero as number before the comma\n */\n isDecimalInput?: boolean;\n /**\n * Whether the input is disabled\n */\n isDisabled?: boolean;\n /**\n * Whether the value is invalid.\n */\n isInvalid?: boolean;\n /**\n * Applies rules for money input.\n * Rules: only two decimal places, one zero before the comma\n */\n isMoneyInput?: boolean;\n /**\n * Whether the value should be formatted as a time.\n */\n isTimeInput?: boolean;\n /**\n * Limits the number to this value\n */\n maxNumber?: number;\n /**\n * Limits the number to this value\n */\n minNumber?: number;\n /**\n * Callback function that is called when the input gets out of focus\n */\n onBlur?: (newNumber: number | string | null, isInvalid: boolean) => void;\n /**\n * Callback function that is called when the input changes\n * It will pass the text from the input\n */\n onChange?: (newValue: string) => void;\n /**\n * Placeholder for the input field\n */\n placeholder?: string;\n /**\n * Whether only the bottom border should be displayed\n */\n shouldShowOnlyBottomBorder?: boolean;\n /**\n * Whether the onChange function should be triggert when the value is formatted on the focus or blur\n */\n shouldTriggerChangeOnFormat?: boolean;\n /**\n * The value, that should be displayed in the input, when it is in focus.\n * You can also pass a stringified number as default value.\n * NOTE: If you pass a stringified number, it will be formatted to the selected format\n */\n value?: string;\n};\n\nconst NumberInput: FC<NumberInputProps> = ({\n isDecimalInput,\n isMoneyInput,\n isTimeInput,\n isInvalid,\n maxNumber = Infinity,\n value,\n shouldTriggerChangeOnFormat = true,\n placeholder,\n onBlur,\n isDisabled,\n onChange,\n shouldShowOnlyBottomBorder,\n minNumber = -Infinity,\n}) => {\n 'use memo';\n\n // the plainText will be shown in the input, when it is in focus\n const [plainText, setPlainText] = useState<string>('');\n // the formattedValue will be shown in the input, when it is not in focus\n const [formattedValue, setFormattedValue] = useState<string>('');\n const [hasFocus, setHasFocus] = useState<boolean>(false);\n const [shouldRemainPlaceholder, setShouldRemainPlaceholder] = useState<boolean>(false);\n\n const [isValueInvalid, setIsValueInvalid] = useState(false);\n const localPlaceholder = placeholder ?? (isMoneyInput ? '€' : undefined);\n\n const initialInputRef = useRef(true);\n\n const onLocalChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n const newValue = event.target.value;\n\n initialInputRef.current = false;\n\n const sanitizedValueString = newValue\n // Removes everything except numbers, commas and points\n .replace(NUMBER_CLEAR_REGEX, '');\n\n if (\n isTimeInput &&\n ((sanitizedValueString.includes(':') && sanitizedValueString.length > 5) ||\n (!sanitizedValueString.includes(':') && sanitizedValueString.length > 4))\n ) {\n return;\n }\n\n const valueToCheck = sanitizedValueString.replaceAll(',', '.');\n\n if (!isValidString({ string: valueToCheck, isMoneyInput, isDecimalInput, isTimeInput })) {\n return;\n }\n\n if (\n (maxNumber && Number(valueToCheck) > maxNumber) ||\n (minNumber && Number(valueToCheck) < minNumber)\n ) {\n return;\n }\n\n if (newValue.length === 1 && newValue.match(/^[0-9]+$/) === null) {\n setShouldRemainPlaceholder(true);\n } else {\n setShouldRemainPlaceholder(false);\n }\n\n setPlainText(sanitizedValueString.replaceAll('.', ','));\n\n if (typeof onChange === 'function') {\n onChange(sanitizedValueString.replaceAll('.', ','));\n }\n };\n\n const onLocalBlur = () => {\n const sanitizedValue = plainText;\n let newIsInvalid = false;\n let parsedNumber = null;\n\n if (!isTimeInput) {\n parsedNumber = parseFloatWithDecimals({\n stringValue: sanitizedValue.replace(',', '.').replaceAll(':', '').replace('€', ''),\n decimals: isMoneyInput ? 2 : undefined,\n });\n\n if (\n parsedNumber &&\n parsedNumber !== 0 &&\n (parsedNumber > maxNumber || parsedNumber < minNumber)\n ) {\n newIsInvalid = true;\n }\n\n setIsValueInvalid(newIsInvalid);\n }\n\n const newStringValue =\n plainText.length === 0\n ? ''\n : formateNumber({\n number: isTimeInput ? sanitizedValue : parsedNumber,\n isMoneyInput,\n isTimeInput,\n });\n\n setFormattedValue(`${newStringValue} ${isMoneyInput ? '€' : ''}`);\n setPlainText(newStringValue.replaceAll('.', ''));\n setHasFocus(false);\n\n if (typeof onChange === 'function' && shouldTriggerChangeOnFormat) {\n onChange(newStringValue.replaceAll('.', ''));\n }\n\n if (typeof onBlur === 'function') {\n if (isTimeInput) {\n onBlur(newStringValue, newIsInvalid);\n } else {\n onBlur(parsedNumber, newIsInvalid);\n }\n }\n };\n\n const onLocalFocus = () => {\n // formattedValue will be a number string with german number format (e.g. 1.000,00)\n // It will remove all dots, so that the user can type in the number\n setPlainText(formattedValue.replaceAll('.', '').replace('€', '').replaceAll(' ', ''));\n\n // This will update the external state\n if (typeof onChange === 'function' && shouldTriggerChangeOnFormat) {\n onChange(formattedValue.replaceAll('.', '').replace('€', '').replaceAll(' ', ''));\n }\n\n setIsValueInvalid(false);\n setHasFocus(true);\n };\n\n // updates the formattedValue, when the value changes\n useEffect(() => {\n let parsedNumber = null;\n\n if (!isTimeInput) {\n parsedNumber = parseFloatWithDecimals({\n stringValue: plainText\n .replace(',', '.')\n .replaceAll(':', '')\n .replace('€', '')\n .replaceAll(' ', ''),\n decimals: isMoneyInput ? 2 : undefined,\n });\n\n // checks, if a given number is invalid, if the input is not in focus\n if (!hasFocus) {\n if (parsedNumber === null && initialInputRef.current) {\n setIsValueInvalid(false);\n } else {\n setIsValueInvalid(\n parsedNumber === null ||\n parsedNumber > maxNumber ||\n parsedNumber < minNumber,\n );\n }\n }\n }\n\n setFormattedValue(\n plainText.length === 0\n ? ''\n : `${formateNumber({\n number: isTimeInput ? plainText : parsedNumber,\n isMoneyInput,\n isTimeInput,\n })}${isMoneyInput ? ' €' : ''}`,\n );\n }, [hasFocus, isMoneyInput, isTimeInput, maxNumber, minNumber, plainText]);\n\n useEffect(() => {\n if (typeof value === 'string') {\n setPlainText(value.replace('€', '').replaceAll(' ', ''));\n }\n }, [value]);\n\n return (\n <Input\n shouldRemainPlaceholder={shouldRemainPlaceholder}\n shouldShowOnlyBottomBorder={shouldShowOnlyBottomBorder}\n inputMode=\"decimal\"\n onChange={onLocalChange}\n value={hasFocus ? plainText : formattedValue}\n placeholder={localPlaceholder}\n onBlur={onLocalBlur}\n onFocus={onLocalFocus}\n isDisabled={isDisabled}\n isInvalid={typeof isInvalid === 'boolean' ? isInvalid : isValueInvalid}\n shouldShowCenteredContent={shouldShowOnlyBottomBorder}\n />\n );\n};\n\nNumberInput.displayName = 'NumberInput';\n\nexport default NumberInput;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAmC,SAAAI,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAM,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EA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