infinity-forge 0.62.2 → 0.63.0
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/fonts.css +1 -1
- package/dist/infinity-forge.css +2 -3
- package/dist/reset.css +1 -1
- package/dist/ui/components/error-boundary/component.js +2 -2
- package/dist/ui/components/error-boundary/component.js.map +1 -1
- package/dist/ui/components/error-boundary/src/ErrorBoundary.d.ts +21 -0
- package/dist/ui/components/error-boundary/src/ErrorBoundary.js +112 -0
- package/dist/ui/components/error-boundary/src/ErrorBoundary.js.map +1 -0
- package/dist/ui/components/error-boundary/src/ErrorBoundaryContext.d.ts +7 -0
- package/dist/ui/components/error-boundary/src/ErrorBoundaryContext.js +6 -0
- package/dist/ui/components/error-boundary/src/ErrorBoundaryContext.js.map +1 -0
- package/dist/ui/components/error-boundary/src/assertErrorBoundaryContext.d.ts +2 -0
- package/dist/ui/components/error-boundary/src/assertErrorBoundaryContext.js +12 -0
- package/dist/ui/components/error-boundary/src/assertErrorBoundaryContext.js.map +1 -0
- package/dist/ui/components/error-boundary/src/env-conditions/development.d.ts +1 -0
- package/dist/ui/components/error-boundary/src/env-conditions/development.js +5 -0
- package/dist/ui/components/error-boundary/src/env-conditions/development.js.map +1 -0
- package/dist/ui/components/error-boundary/src/env-conditions/production.d.ts +1 -0
- package/dist/ui/components/error-boundary/src/env-conditions/production.js +5 -0
- package/dist/ui/components/error-boundary/src/env-conditions/production.js.map +1 -0
- package/dist/ui/components/error-boundary/src/index.d.ts +5 -0
- package/dist/ui/components/error-boundary/src/index.js +22 -0
- package/dist/ui/components/error-boundary/src/index.js.map +1 -0
- package/dist/ui/components/error-boundary/src/types.d.ts +35 -0
- package/dist/ui/components/error-boundary/src/types.js +3 -0
- package/dist/ui/components/error-boundary/src/types.js.map +1 -0
- package/dist/ui/components/error-boundary/src/useErrorBoundary.d.ts +5 -0
- package/dist/ui/components/error-boundary/src/useErrorBoundary.js +32 -0
- package/dist/ui/components/error-boundary/src/useErrorBoundary.js.map +1 -0
- package/dist/ui/components/error-boundary/src/withErrorBoundary.d.ts +3 -0
- package/dist/ui/components/error-boundary/src/withErrorBoundary.js +27 -0
- package/dist/ui/components/error-boundary/src/withErrorBoundary.js.map +1 -0
- package/dist/ui/components/form/index.d.ts +0 -1
- package/dist/ui/components/form/index.js +0 -1
- package/dist/ui/components/form/index.js.map +1 -1
- package/dist/ui/components/form/input-currency/components/CurrencyInput.d.ts +2 -0
- package/dist/ui/components/form/input-currency/components/CurrencyInput.js +247 -0
- package/dist/ui/components/form/input-currency/components/CurrencyInput.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/CurrencyInputProps.d.ts +160 -0
- package/dist/ui/components/form/input-currency/components/CurrencyInputProps.js +3 -0
- package/dist/ui/components/form/input-currency/components/CurrencyInputProps.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/index.d.ts +1 -0
- package/dist/ui/components/form/input-currency/components/index.js +18 -0
- package/dist/ui/components/form/input-currency/components/index.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/addSeparators.d.ts +4 -0
- package/dist/ui/components/form/input-currency/components/utils/addSeparators.js +12 -0
- package/dist/ui/components/form/input-currency/components/utils/addSeparators.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/cleanValue.d.ts +8 -0
- package/dist/ui/components/form/input-currency/components/utils/cleanValue.js +62 -0
- package/dist/ui/components/form/input-currency/components/utils/cleanValue.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/escapeRegExp.d.ts +6 -0
- package/dist/ui/components/form/input-currency/components/utils/escapeRegExp.js +13 -0
- package/dist/ui/components/form/input-currency/components/utils/escapeRegExp.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/fixedDecimalValue.d.ts +1 -0
- package/dist/ui/components/form/input-currency/components/utils/fixedDecimalValue.js +30 -0
- package/dist/ui/components/form/input-currency/components/utils/fixedDecimalValue.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/formatValue.d.ts +49 -0
- package/dist/ui/components/form/input-currency/components/utils/formatValue.js +132 -0
- package/dist/ui/components/form/input-currency/components/utils/formatValue.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/getLocaleConfig.d.ts +13 -0
- package/dist/ui/components/form/input-currency/components/utils/getLocaleConfig.js +49 -0
- package/dist/ui/components/form/input-currency/components/utils/getLocaleConfig.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/getSuffix.d.ts +6 -0
- package/dist/ui/components/form/input-currency/components/utils/getSuffix.js +12 -0
- package/dist/ui/components/form/input-currency/components/utils/getSuffix.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/index.d.ts +8 -0
- package/dist/ui/components/form/input-currency/components/utils/index.js +25 -0
- package/dist/ui/components/form/input-currency/components/utils/index.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/isNumber.d.ts +1 -0
- package/dist/ui/components/form/input-currency/components/utils/isNumber.js +6 -0
- package/dist/ui/components/form/input-currency/components/utils/isNumber.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/padTrimValue.d.ts +1 -0
- package/dist/ui/components/form/input-currency/components/utils/padTrimValue.js +28 -0
- package/dist/ui/components/form/input-currency/components/utils/padTrimValue.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/parseAbbrValue.d.ts +10 -0
- package/dist/ui/components/form/input-currency/components/utils/parseAbbrValue.js +40 -0
- package/dist/ui/components/form/input-currency/components/utils/parseAbbrValue.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/removeInvalidChars.d.ts +4 -0
- package/dist/ui/components/form/input-currency/components/utils/removeInvalidChars.js +14 -0
- package/dist/ui/components/form/input-currency/components/utils/removeInvalidChars.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/removeSeparators.d.ts +4 -0
- package/dist/ui/components/form/input-currency/components/utils/removeSeparators.js +14 -0
- package/dist/ui/components/form/input-currency/components/utils/removeSeparators.js.map +1 -0
- package/dist/ui/components/form/input-currency/components/utils/repositionCursor.d.ts +16 -0
- package/dist/ui/components/form/input-currency/components/utils/repositionCursor.js +30 -0
- package/dist/ui/components/form/input-currency/components/utils/repositionCursor.js.map +1 -0
- package/dist/ui/components/form/input-currency/index.js +3 -6
- package/dist/ui/components/form/input-currency/index.js.map +1 -1
- package/dist/ui/components/form/input-date-picker/index.d.ts +4 -5
- package/dist/ui/components/form/input-date-picker/index.js +106 -63
- package/dist/ui/components/form/input-date-picker/index.js.map +1 -1
- package/dist/ui/components/form/input-date-picker/styles.js +1 -1
- package/dist/ui/components/form/input-date-picker/styles.js.map +1 -1
- package/dist/ui/components/form/text-editor/index.js +16 -6
- package/dist/ui/components/form/text-editor/index.js.map +1 -1
- package/dist/ui/components/form/text-editor/styles.js +1 -1
- package/dist/ui/components/form/text-editor/styles.js.map +1 -1
- package/package.json +75 -88
- package/dist/react-tool-tip.css +0 -1
- package/dist/ui/components/form/input-date-picker/date_picket_lib_css.d.ts +0 -4
- package/dist/ui/components/form/input-date-picker/date_picket_lib_css.js +0 -14
- package/dist/ui/components/form/input-date-picker/date_picket_lib_css.js.map +0 -1
- package/dist/ui/components/form/input-date-range/index.d.ts +0 -2
- package/dist/ui/components/form/input-date-range/index.js +0 -37
- package/dist/ui/components/form/input-date-range/index.js.map +0 -1
- package/dist/ui/components/form/input-date-range/styles.d.ts +0 -4
- package/dist/ui/components/form/input-date-range/styles.js +0 -14
- package/dist/ui/components/form/input-date-range/styles.js.map +0 -1
- package/dist/ui/components/form/text-editor/configs.d.ts +0 -3
- package/dist/ui/components/form/text-editor/configs.js +0 -23
- package/dist/ui/components/form/text-editor/configs.js.map +0 -1
- package/dist/ui/styles/libs/react-tool-tip.css +0 -109
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.CurrencyInput = void 0;
|
|
26
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
var react_1 = require("react");
|
|
28
|
+
var utils_1 = require("./utils/index.js");
|
|
29
|
+
exports.CurrencyInput = (0, react_1.forwardRef)(function (_a, ref) {
|
|
30
|
+
var _b = _a.allowDecimals, allowDecimals = _b === void 0 ? true : _b, _c = _a.allowNegativeValue, allowNegativeValue = _c === void 0 ? true : _c, id = _a.id, name = _a.name, className = _a.className, customInput = _a.customInput, decimalsLimit = _a.decimalsLimit, defaultValue = _a.defaultValue, _d = _a.disabled, disabled = _d === void 0 ? false : _d, userMaxLength = _a.maxLength, userValue = _a.value, onValueChange = _a.onValueChange, fixedDecimalLength = _a.fixedDecimalLength, placeholder = _a.placeholder, decimalScale = _a.decimalScale, prefix = _a.prefix, suffix = _a.suffix, intlConfig = _a.intlConfig, step = _a.step, min = _a.min, max = _a.max, _e = _a.disableGroupSeparators, disableGroupSeparators = _e === void 0 ? false : _e, _f = _a.disableAbbreviations, disableAbbreviations = _f === void 0 ? false : _f, _decimalSeparator = _a.decimalSeparator, _groupSeparator = _a.groupSeparator, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp, transformRawValue = _a.transformRawValue, _g = _a.formatValueOnBlur, formatValueOnBlur = _g === void 0 ? true : _g, props = __rest(_a, ["allowDecimals", "allowNegativeValue", "id", "name", "className", "customInput", "decimalsLimit", "defaultValue", "disabled", "maxLength", "value", "onValueChange", "fixedDecimalLength", "placeholder", "decimalScale", "prefix", "suffix", "intlConfig", "step", "min", "max", "disableGroupSeparators", "disableAbbreviations", "decimalSeparator", "groupSeparator", "onChange", "onFocus", "onBlur", "onKeyDown", "onKeyUp", "transformRawValue", "formatValueOnBlur"]);
|
|
31
|
+
if (_decimalSeparator && (0, utils_1.isNumber)(_decimalSeparator)) {
|
|
32
|
+
throw new Error('decimalSeparator cannot be a number');
|
|
33
|
+
}
|
|
34
|
+
if (_groupSeparator && (0, utils_1.isNumber)(_groupSeparator)) {
|
|
35
|
+
throw new Error('groupSeparator cannot be a number');
|
|
36
|
+
}
|
|
37
|
+
var localeConfig = (0, react_1.useMemo)(function () { return (0, utils_1.getLocaleConfig)(intlConfig); }, [intlConfig]);
|
|
38
|
+
var decimalSeparator = _decimalSeparator || localeConfig.decimalSeparator || '';
|
|
39
|
+
var groupSeparator = _groupSeparator || localeConfig.groupSeparator || '';
|
|
40
|
+
if (decimalSeparator &&
|
|
41
|
+
groupSeparator &&
|
|
42
|
+
decimalSeparator === groupSeparator &&
|
|
43
|
+
disableGroupSeparators === false) {
|
|
44
|
+
throw new Error('decimalSeparator cannot be the same as groupSeparator');
|
|
45
|
+
}
|
|
46
|
+
var formatValueOptions = {
|
|
47
|
+
decimalSeparator: decimalSeparator,
|
|
48
|
+
groupSeparator: groupSeparator,
|
|
49
|
+
disableGroupSeparators: disableGroupSeparators,
|
|
50
|
+
intlConfig: intlConfig,
|
|
51
|
+
prefix: prefix || localeConfig.prefix,
|
|
52
|
+
suffix: suffix,
|
|
53
|
+
};
|
|
54
|
+
var cleanValueOptions = {
|
|
55
|
+
decimalSeparator: decimalSeparator,
|
|
56
|
+
groupSeparator: groupSeparator,
|
|
57
|
+
allowDecimals: allowDecimals,
|
|
58
|
+
decimalsLimit: decimalsLimit || fixedDecimalLength || 2,
|
|
59
|
+
allowNegativeValue: allowNegativeValue,
|
|
60
|
+
disableAbbreviations: disableAbbreviations,
|
|
61
|
+
prefix: prefix || localeConfig.prefix,
|
|
62
|
+
transformRawValue: transformRawValue,
|
|
63
|
+
};
|
|
64
|
+
var _h = (0, react_1.useState)(function () {
|
|
65
|
+
return defaultValue != null
|
|
66
|
+
? (0, utils_1.formatValue)(__assign(__assign({}, formatValueOptions), { decimalScale: decimalScale, value: String(defaultValue) }))
|
|
67
|
+
: userValue != null
|
|
68
|
+
? (0, utils_1.formatValue)(__assign(__assign({}, formatValueOptions), { decimalScale: decimalScale, value: String(userValue) }))
|
|
69
|
+
: '';
|
|
70
|
+
}), stateValue = _h[0], setStateValue = _h[1];
|
|
71
|
+
var _j = (0, react_1.useState)(false), dirty = _j[0], setDirty = _j[1];
|
|
72
|
+
var _k = (0, react_1.useState)(0), cursor = _k[0], setCursor = _k[1];
|
|
73
|
+
var _l = (0, react_1.useState)(0), changeCount = _l[0], setChangeCount = _l[1];
|
|
74
|
+
var _m = (0, react_1.useState)(null), lastKeyStroke = _m[0], setLastKeyStroke = _m[1];
|
|
75
|
+
var inputRef = (0, react_1.useRef)(null);
|
|
76
|
+
(0, react_1.useImperativeHandle)(ref, function () { return inputRef.current; });
|
|
77
|
+
/**
|
|
78
|
+
* Process change in value
|
|
79
|
+
*/
|
|
80
|
+
var processChange = function (value, selectionStart) {
|
|
81
|
+
setDirty(true);
|
|
82
|
+
var _a = (0, utils_1.repositionCursor)({
|
|
83
|
+
selectionStart: selectionStart,
|
|
84
|
+
value: value,
|
|
85
|
+
lastKeyStroke: lastKeyStroke,
|
|
86
|
+
stateValue: stateValue,
|
|
87
|
+
groupSeparator: groupSeparator,
|
|
88
|
+
}), modifiedValue = _a.modifiedValue, cursorPosition = _a.cursorPosition;
|
|
89
|
+
var stringValue = (0, utils_1.cleanValue)(__assign({ value: modifiedValue }, cleanValueOptions));
|
|
90
|
+
if (userMaxLength && stringValue.replace(/-/g, '').length > userMaxLength) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (stringValue === '' || stringValue === '-' || stringValue === decimalSeparator) {
|
|
94
|
+
onValueChange && onValueChange(undefined, name, { float: null, formatted: '', value: '' });
|
|
95
|
+
setStateValue(stringValue);
|
|
96
|
+
// Always sets cursor after '-' or decimalSeparator input
|
|
97
|
+
setCursor(1);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
var stringValueWithoutSeparator = decimalSeparator
|
|
101
|
+
? stringValue.replace(decimalSeparator, '.')
|
|
102
|
+
: stringValue;
|
|
103
|
+
var numberValue = parseFloat(stringValueWithoutSeparator);
|
|
104
|
+
var formattedValue = (0, utils_1.formatValue)(__assign({ value: stringValue }, formatValueOptions));
|
|
105
|
+
if (cursorPosition != null) {
|
|
106
|
+
// Prevent cursor jumping
|
|
107
|
+
var newCursor = cursorPosition + (formattedValue.length - value.length);
|
|
108
|
+
newCursor = newCursor <= 0 ? (prefix ? prefix.length : 0) : newCursor;
|
|
109
|
+
setCursor(newCursor);
|
|
110
|
+
setChangeCount(changeCount + 1);
|
|
111
|
+
}
|
|
112
|
+
setStateValue(formattedValue);
|
|
113
|
+
if (onValueChange) {
|
|
114
|
+
var values = {
|
|
115
|
+
float: numberValue,
|
|
116
|
+
formatted: formattedValue,
|
|
117
|
+
value: stringValue,
|
|
118
|
+
};
|
|
119
|
+
onValueChange(stringValue, name, values);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Handle change event
|
|
124
|
+
*/
|
|
125
|
+
var handleOnChange = function (event) {
|
|
126
|
+
var _a = event.target, value = _a.value, selectionStart = _a.selectionStart;
|
|
127
|
+
processChange(value, selectionStart);
|
|
128
|
+
onChange && onChange(event);
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Handle focus event
|
|
132
|
+
*/
|
|
133
|
+
var handleOnFocus = function (event) {
|
|
134
|
+
onFocus && onFocus(event);
|
|
135
|
+
return stateValue ? stateValue.length : 0;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Handle blur event
|
|
139
|
+
*
|
|
140
|
+
* Format value by padding/trimming decimals if required by
|
|
141
|
+
*/
|
|
142
|
+
var handleOnBlur = function (event) {
|
|
143
|
+
var value = event.target.value;
|
|
144
|
+
var valueOnly = (0, utils_1.cleanValue)(__assign({ value: value }, cleanValueOptions));
|
|
145
|
+
if (valueOnly === '-' || valueOnly === decimalSeparator || !valueOnly) {
|
|
146
|
+
setStateValue('');
|
|
147
|
+
onBlur && onBlur(event);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
var fixedDecimals = (0, utils_1.fixedDecimalValue)(valueOnly, decimalSeparator, fixedDecimalLength);
|
|
151
|
+
var newValue = (0, utils_1.padTrimValue)(fixedDecimals, decimalSeparator, decimalScale !== undefined ? decimalScale : fixedDecimalLength);
|
|
152
|
+
var numberValue = parseFloat(newValue.replace(decimalSeparator, '.'));
|
|
153
|
+
var formattedValue = (0, utils_1.formatValue)(__assign(__assign({}, formatValueOptions), { value: newValue }));
|
|
154
|
+
if (onValueChange && formatValueOnBlur) {
|
|
155
|
+
onValueChange(newValue, name, {
|
|
156
|
+
float: numberValue,
|
|
157
|
+
formatted: formattedValue,
|
|
158
|
+
value: newValue,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
setStateValue(formattedValue);
|
|
162
|
+
onBlur && onBlur(event);
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Handle key down event
|
|
166
|
+
*
|
|
167
|
+
* Increase or decrease value by step
|
|
168
|
+
*/
|
|
169
|
+
var handleOnKeyDown = function (event) {
|
|
170
|
+
var key = event.key;
|
|
171
|
+
setLastKeyStroke(key);
|
|
172
|
+
if (step && (key === 'ArrowUp' || key === 'ArrowDown')) {
|
|
173
|
+
event.preventDefault();
|
|
174
|
+
setCursor(stateValue.length);
|
|
175
|
+
var currentValue = parseFloat(userValue != null
|
|
176
|
+
? String(userValue).replace(decimalSeparator, '.')
|
|
177
|
+
: (0, utils_1.cleanValue)(__assign({ value: stateValue }, cleanValueOptions))) || 0;
|
|
178
|
+
var newValue = key === 'ArrowUp' ? currentValue + step : currentValue - step;
|
|
179
|
+
if (min !== undefined && newValue < Number(min)) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (max !== undefined && newValue > Number(max)) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
var fixedLength = String(step).includes('.')
|
|
186
|
+
? Number(String(step).split('.')[1].length)
|
|
187
|
+
: undefined;
|
|
188
|
+
processChange(String(fixedLength ? newValue.toFixed(fixedLength) : newValue).replace('.', decimalSeparator));
|
|
189
|
+
}
|
|
190
|
+
onKeyDown && onKeyDown(event);
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Handle key up event
|
|
194
|
+
*
|
|
195
|
+
* Move cursor if there is a suffix to prevent user typing past suffix
|
|
196
|
+
*/
|
|
197
|
+
var handleOnKeyUp = function (event) {
|
|
198
|
+
var key = event.key, selectionStart = event.currentTarget.selectionStart;
|
|
199
|
+
if (key !== 'ArrowUp' && key !== 'ArrowDown' && stateValue !== '-') {
|
|
200
|
+
var suffix_1 = (0, utils_1.getSuffix)(stateValue, { groupSeparator: groupSeparator, decimalSeparator: decimalSeparator });
|
|
201
|
+
if (suffix_1 && selectionStart && selectionStart > stateValue.length - suffix_1.length) {
|
|
202
|
+
/* istanbul ignore else */
|
|
203
|
+
if (inputRef.current) {
|
|
204
|
+
var newCursor = stateValue.length - suffix_1.length;
|
|
205
|
+
inputRef.current.setSelectionRange(newCursor, newCursor);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
onKeyUp && onKeyUp(event);
|
|
210
|
+
};
|
|
211
|
+
// Update state if userValue changes to undefined
|
|
212
|
+
(0, react_1.useEffect)(function () {
|
|
213
|
+
if (userValue == null && defaultValue == null) {
|
|
214
|
+
setStateValue('');
|
|
215
|
+
}
|
|
216
|
+
}, [defaultValue, userValue]);
|
|
217
|
+
(0, react_1.useEffect)(function () {
|
|
218
|
+
// prevent cursor jumping if editing value
|
|
219
|
+
if (dirty &&
|
|
220
|
+
stateValue !== '-' &&
|
|
221
|
+
inputRef.current &&
|
|
222
|
+
document.activeElement === inputRef.current) {
|
|
223
|
+
inputRef.current.setSelectionRange(cursor, cursor);
|
|
224
|
+
}
|
|
225
|
+
}, [stateValue, cursor, inputRef, dirty, changeCount]);
|
|
226
|
+
/**
|
|
227
|
+
* If user has only entered "-" or decimal separator,
|
|
228
|
+
* keep the char to allow them to enter next value
|
|
229
|
+
*/
|
|
230
|
+
var getRenderValue = function () {
|
|
231
|
+
if (userValue != null &&
|
|
232
|
+
stateValue !== '-' &&
|
|
233
|
+
(!decimalSeparator || stateValue !== decimalSeparator)) {
|
|
234
|
+
return (0, utils_1.formatValue)(__assign(__assign({}, formatValueOptions), { decimalScale: dirty ? undefined : decimalScale, value: String(userValue) }));
|
|
235
|
+
}
|
|
236
|
+
return stateValue;
|
|
237
|
+
};
|
|
238
|
+
var inputProps = __assign({ type: 'text', inputMode: 'decimal', id: id, name: name, className: className, onChange: handleOnChange, onBlur: handleOnBlur, onFocus: handleOnFocus, onKeyDown: handleOnKeyDown, onKeyUp: handleOnKeyUp, placeholder: placeholder, disabled: disabled, value: getRenderValue(), ref: inputRef }, props);
|
|
239
|
+
if (customInput) {
|
|
240
|
+
var CustomInput = customInput;
|
|
241
|
+
return (0, jsx_runtime_1.jsx)(CustomInput, __assign({}, inputProps));
|
|
242
|
+
}
|
|
243
|
+
return (0, jsx_runtime_1.jsx)("input", __assign({}, inputProps));
|
|
244
|
+
});
|
|
245
|
+
exports.CurrencyInput.displayName = 'CurrencyInput';
|
|
246
|
+
exports.default = exports.CurrencyInput;
|
|
247
|
+
//# sourceMappingURL=CurrencyInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurrencyInput.js","sourceRoot":"","sources":["../../../../../../src/ui/components/form/input-currency/components/CurrencyInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAQe;AAEf,iCAWiB;AAEJ,QAAA,aAAa,GAAQ,IAAA,kBAAU,EAI1C,UACE,EAkCqB,EACrB,GAAG;IAlCD,IAAA,qBAAoB,EAApB,aAAa,mBAAG,IAAI,KAAA,EACpB,0BAAyB,EAAzB,kBAAkB,mBAAG,IAAI,KAAA,EACzB,EAAE,QAAA,EACF,IAAI,UAAA,EACJ,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,aAAa,mBAAA,EACb,YAAY,kBAAA,EACZ,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EACL,aAAa,eAAA,EACjB,SAAS,WAAA,EAChB,aAAa,mBAAA,EACb,kBAAkB,wBAAA,EAClB,WAAW,iBAAA,EACX,YAAY,kBAAA,EACZ,MAAM,YAAA,EACN,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,IAAI,UAAA,EACJ,GAAG,SAAA,EACH,GAAG,SAAA,EACH,8BAA8B,EAA9B,sBAAsB,mBAAG,KAAK,KAAA,EAC9B,4BAA4B,EAA5B,oBAAoB,mBAAG,KAAK,KAAA,EACV,iBAAiB,sBAAA,EACnB,eAAe,oBAAA,EAC/B,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,MAAM,YAAA,EACN,SAAS,eAAA,EACT,OAAO,aAAA,EACP,iBAAiB,uBAAA,EACjB,yBAAwB,EAAxB,iBAAiB,mBAAG,IAAI,KAAA,EACrB,KAAK,cAjCV,6cAkCC,CADS;IAIV,IAAI,iBAAiB,IAAI,IA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A,EACJ,SAAS,WAAA,EACT,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,eAAe,EAC1B,OAAO,EAAE,aAAa,EACtB,WAAW,aAAA,EACX,QAAQ,UAAA,EACR,KAAK,EAAE,cAAc,EAAE,EACvB,GAAG,EAAE,QAAQ,IACV,KAAK,CACT,CAAC;IAEF,IAAI,WAAW,EAAE,CAAC;QAChB,IAAM,WAAW,GAAG,WAAW,CAAC;QAChC,OAAO,uBAAC,WAAW,eAAK,UAAU,EAAI,CAAC;IACzC,CAAC;IAED,OAAO,6CAAW,UAAU,EAAI,CAAC;AACnC,CAAC,CACF,CAAC;AAEF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAE5C,kBAAe,qBAAa,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import React, { ElementType } from 'react';
|
|
2
|
+
type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
|
|
3
|
+
/**
|
|
4
|
+
* Value in different formats
|
|
5
|
+
*
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
export type CurrencyInputOnChangeValues = {
|
|
9
|
+
/**
|
|
10
|
+
* Value as float or null if empty
|
|
11
|
+
*
|
|
12
|
+
* Example:
|
|
13
|
+
* "1.99" > 1.99
|
|
14
|
+
* "" > null
|
|
15
|
+
*/
|
|
16
|
+
float: number | null;
|
|
17
|
+
/**
|
|
18
|
+
* Value after applying formatting
|
|
19
|
+
*
|
|
20
|
+
* Example: "1000000" > "1,000,0000"
|
|
21
|
+
*/
|
|
22
|
+
formatted: string;
|
|
23
|
+
/**
|
|
24
|
+
* Non formatted value as string
|
|
25
|
+
*/
|
|
26
|
+
value: string;
|
|
27
|
+
};
|
|
28
|
+
export type IntlConfig = {
|
|
29
|
+
locale: string;
|
|
30
|
+
currency?: string;
|
|
31
|
+
};
|
|
32
|
+
export type CurrencyInputProps = Overwrite<React.ComponentPropsWithRef<'input'>, {
|
|
33
|
+
/**
|
|
34
|
+
* Allow decimals
|
|
35
|
+
*
|
|
36
|
+
* Default = true
|
|
37
|
+
*/
|
|
38
|
+
allowDecimals?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Allow user to enter negative value
|
|
41
|
+
*
|
|
42
|
+
* Default = true
|
|
43
|
+
*/
|
|
44
|
+
allowNegativeValue?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Component id
|
|
47
|
+
*/
|
|
48
|
+
id?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Maximum characters the user can enter
|
|
51
|
+
*/
|
|
52
|
+
maxLength?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Class names
|
|
55
|
+
*/
|
|
56
|
+
className?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Custom component
|
|
59
|
+
*
|
|
60
|
+
* Default = <input/>
|
|
61
|
+
*/
|
|
62
|
+
customInput?: ElementType;
|
|
63
|
+
/**
|
|
64
|
+
* Limit length of decimals allowed
|
|
65
|
+
*
|
|
66
|
+
* Default = 2
|
|
67
|
+
*/
|
|
68
|
+
decimalsLimit?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Specify decimal scale for padding/trimming
|
|
71
|
+
*
|
|
72
|
+
* Example:
|
|
73
|
+
* 1.5 -> 1.50
|
|
74
|
+
* 1.234 -> 1.23
|
|
75
|
+
*/
|
|
76
|
+
decimalScale?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Default value if not passing in value via props
|
|
79
|
+
*/
|
|
80
|
+
defaultValue?: number | string;
|
|
81
|
+
/**
|
|
82
|
+
* Disabled
|
|
83
|
+
*
|
|
84
|
+
* Default = false
|
|
85
|
+
*/
|
|
86
|
+
disabled?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Value will always have the specified length of decimals
|
|
89
|
+
*
|
|
90
|
+
* Example:
|
|
91
|
+
* 123 -> 1.23
|
|
92
|
+
*
|
|
93
|
+
* Note: This formatting only happens onBlur
|
|
94
|
+
*/
|
|
95
|
+
fixedDecimalLength?: number;
|
|
96
|
+
/**
|
|
97
|
+
* Handle change in value
|
|
98
|
+
*/
|
|
99
|
+
onValueChange?: (value: string | undefined, name?: string, values?: CurrencyInputOnChangeValues) => void;
|
|
100
|
+
/**
|
|
101
|
+
* Placeholder if there is no value
|
|
102
|
+
*/
|
|
103
|
+
placeholder?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Include a prefix eg. £
|
|
106
|
+
*/
|
|
107
|
+
prefix?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Include a suffix eg. €
|
|
110
|
+
*/
|
|
111
|
+
suffix?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Incremental value change on arrow down and arrow up key press
|
|
114
|
+
*/
|
|
115
|
+
step?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Separator between integer part and fractional part of value.
|
|
118
|
+
*
|
|
119
|
+
* This cannot be a number
|
|
120
|
+
*/
|
|
121
|
+
decimalSeparator?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Separator between thousand, million and billion
|
|
124
|
+
*
|
|
125
|
+
* This cannot be a number
|
|
126
|
+
*/
|
|
127
|
+
groupSeparator?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Disable auto adding separator between values eg. 1000 -> 1,000
|
|
130
|
+
*
|
|
131
|
+
* Default = false
|
|
132
|
+
*/
|
|
133
|
+
disableGroupSeparators?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Disable abbreviations (m, k, b)
|
|
136
|
+
*
|
|
137
|
+
* Default = false
|
|
138
|
+
*/
|
|
139
|
+
disableAbbreviations?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* International locale config, examples:
|
|
142
|
+
* { locale: 'ja-JP', currency: 'JPY' }
|
|
143
|
+
* { locale: 'en-IN', currency: 'INR' }
|
|
144
|
+
*
|
|
145
|
+
* Any prefix, groupSeparator or decimalSeparator options passed in
|
|
146
|
+
* will override Intl Locale config
|
|
147
|
+
*/
|
|
148
|
+
intlConfig?: IntlConfig;
|
|
149
|
+
/**
|
|
150
|
+
* Transform the raw value form the input before parsing
|
|
151
|
+
*/
|
|
152
|
+
transformRawValue?: (rawValue: string) => string;
|
|
153
|
+
/**
|
|
154
|
+
* When set to false, the formatValueOnBlur flag disables the application of the __onValueChange__ function
|
|
155
|
+
* specifically on blur events. If disabled or set to false, the onValueChange will not trigger on blur.
|
|
156
|
+
* Default = true
|
|
157
|
+
*/
|
|
158
|
+
formatValueOnBlur?: boolean;
|
|
159
|
+
}>;
|
|
160
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurrencyInputProps.js","sourceRoot":"","sources":["../../../../../../src/ui/components/form/input-currency/components/CurrencyInputProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./CurrencyInput.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./CurrencyInput.js"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/components/form/input-currency/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addSeparators = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Add group separator to value eg. 1000 > 1,000
|
|
6
|
+
*/
|
|
7
|
+
var addSeparators = function (value, separator) {
|
|
8
|
+
if (separator === void 0) { separator = ','; }
|
|
9
|
+
return value.replace(/\B(?=(\d{3})+(?!\d))/g, separator);
|
|
10
|
+
};
|
|
11
|
+
exports.addSeparators = addSeparators;
|
|
12
|
+
//# sourceMappingURL=addSeparators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addSeparators.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/form/input-currency/components/utils/addSeparators.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACI,IAAM,aAAa,GAAG,UAAC,KAAa,EAAE,SAAe;IAAf,0BAAA,EAAA,eAAe;IAC1D,OAAO,KAAK,CAAC,OAAO,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC;AAC3D,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CurrencyInputProps } from '../CurrencyInputProps.js';
|
|
2
|
+
export type CleanValueOptions = Pick<CurrencyInputProps, 'decimalSeparator' | 'groupSeparator' | 'allowDecimals' | 'decimalsLimit' | 'allowNegativeValue' | 'disableAbbreviations' | 'prefix' | 'transformRawValue'> & {
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Remove prefix, separators and extra decimals from value
|
|
7
|
+
*/
|
|
8
|
+
export declare const cleanValue: ({ value, groupSeparator, decimalSeparator, allowDecimals, decimalsLimit, allowNegativeValue, disableAbbreviations, prefix, transformRawValue, }: CleanValueOptions) => string;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.cleanValue = void 0;
|
|
13
|
+
var parseAbbrValue_1 = require("./parseAbbrValue.js");
|
|
14
|
+
var removeSeparators_1 = require("./removeSeparators.js");
|
|
15
|
+
var removeInvalidChars_1 = require("./removeInvalidChars.js");
|
|
16
|
+
var escapeRegExp_1 = require("./escapeRegExp.js");
|
|
17
|
+
/**
|
|
18
|
+
* Remove prefix, separators and extra decimals from value
|
|
19
|
+
*/
|
|
20
|
+
var cleanValue = function (_a) {
|
|
21
|
+
var value = _a.value, _b = _a.groupSeparator, groupSeparator = _b === void 0 ? ',' : _b, _c = _a.decimalSeparator, decimalSeparator = _c === void 0 ? '.' : _c, _d = _a.allowDecimals, allowDecimals = _d === void 0 ? true : _d, _e = _a.decimalsLimit, decimalsLimit = _e === void 0 ? 2 : _e, _f = _a.allowNegativeValue, allowNegativeValue = _f === void 0 ? true : _f, _g = _a.disableAbbreviations, disableAbbreviations = _g === void 0 ? false : _g, _h = _a.prefix, prefix = _h === void 0 ? '' : _h, _j = _a.transformRawValue, transformRawValue = _j === void 0 ? function (rawValue) { return rawValue; } : _j;
|
|
22
|
+
var transformedValue = transformRawValue(value);
|
|
23
|
+
if (transformedValue === '-') {
|
|
24
|
+
return transformedValue;
|
|
25
|
+
}
|
|
26
|
+
var abbreviations = disableAbbreviations ? [] : ['k', 'm', 'b'];
|
|
27
|
+
var reg = new RegExp("((^|\\D)-\\d)|(-".concat((0, escapeRegExp_1.escapeRegExp)(prefix), ")"));
|
|
28
|
+
var isNegative = reg.test(transformedValue);
|
|
29
|
+
// Is there a digit before the prefix? eg. 1$
|
|
30
|
+
var _k = RegExp("(\\d+)-?".concat((0, escapeRegExp_1.escapeRegExp)(prefix))).exec(value) || [], prefixWithValue = _k[0], preValue = _k[1];
|
|
31
|
+
var withoutPrefix = prefix
|
|
32
|
+
? prefixWithValue
|
|
33
|
+
? transformedValue.replace(prefixWithValue, '').concat(preValue)
|
|
34
|
+
: transformedValue.replace(prefix, '')
|
|
35
|
+
: transformedValue;
|
|
36
|
+
var withoutSeparators = (0, removeSeparators_1.removeSeparators)(withoutPrefix, groupSeparator);
|
|
37
|
+
var withoutInvalidChars = (0, removeInvalidChars_1.removeInvalidChars)(withoutSeparators, __spreadArray([
|
|
38
|
+
groupSeparator,
|
|
39
|
+
decimalSeparator
|
|
40
|
+
], abbreviations, true));
|
|
41
|
+
var valueOnly = withoutInvalidChars;
|
|
42
|
+
if (!disableAbbreviations) {
|
|
43
|
+
// disallow letter without number
|
|
44
|
+
if (abbreviations.some(function (letter) { return letter === withoutInvalidChars.toLowerCase().replace(decimalSeparator, ''); })) {
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
var parsed = (0, parseAbbrValue_1.parseAbbrValue)(withoutInvalidChars, decimalSeparator);
|
|
48
|
+
if (parsed) {
|
|
49
|
+
valueOnly = String(parsed);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
var includeNegative = isNegative && allowNegativeValue ? '-' : '';
|
|
53
|
+
if (decimalSeparator && valueOnly.includes(decimalSeparator)) {
|
|
54
|
+
var _l = withoutInvalidChars.split(decimalSeparator), int = _l[0], decimals = _l[1];
|
|
55
|
+
var trimmedDecimals = decimalsLimit && decimals ? decimals.slice(0, decimalsLimit) : decimals;
|
|
56
|
+
var includeDecimals = allowDecimals ? "".concat(decimalSeparator).concat(trimmedDecimals) : '';
|
|
57
|
+
return "".concat(includeNegative).concat(int).concat(includeDecimals);
|
|
58
|
+
}
|
|
59
|
+
return "".concat(includeNegative).concat(valueOnly);
|
|
60
|
+
};
|
|
61
|
+
exports.cleanValue = cleanValue;
|
|
62
|
+
//# sourceMappingURL=cleanValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanValue.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/form/input-currency/components/utils/cleanValue.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAkD;AAClD,uDAAsD;AACtD,2DAA0D;AAC1D,+CAA8C;AAe9C;;GAEG;AACI,IAAM,UAAU,GAAG,UAAC,EAUP;QATlB,KAAK,WAAA,EACL,sBAAoB,EAApB,cAAc,mBAAG,GAAG,KAAA,EACpB,wBAAsB,EAAtB,gBAAgB,mBAAG,GAAG,KAAA,EACtB,qBAAoB,EAApB,aAAa,mBAAG,IAAI,KAAA,EACpB,qBAAiB,EAAjB,aAAa,mBAAG,CAAC,KAAA,EACjB,0BAAyB,EAAzB,kBAAkB,mBAAG,IAAI,KAAA,EACzB,4BAA4B,EAA5B,oBAAoB,mBAAG,KAAK,KAAA,EAC5B,cAAW,EAAX,MAAM,mBAAG,EAAE,KAAA,EACX,yBAA0C,EAA1C,iBAAiB,mBAAG,UAAC,QAAQ,IAAK,OAAA,QAAQ,EAAR,CAAQ,KAAA;IAE1C,IAAM,gBAAgB,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAElD,IAAI,gBAAgB,KAAK,GAAG,EAAE,CAAC;QAC7B,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,IAAM,aAAa,GAAG,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAClE,IAAM,GAAG,GAAG,IAAI,MAAM,C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C;IAED,IAAM,eAAe,GAAG,UAAU,IAAI,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAEpE,IAAI,gBAAgB,IAAI,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACvD,IAAA,KAAkB,mBAAmB,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAA5D,GAAG,QAAA,EAAE,QAAQ,QAA+C,CAAC;QACpE,IAAM,eAAe,GAAG,aAAa,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QAChG,IAAM,eAAe,GAAG,aAAa,CAAC,CAAC,CAAC,UAAG,gBAAgB,SAAG,eAAe,CAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAErF,OAAO,UAAG,eAAe,SAAG,GAAG,SAAG,eAAe,CAAE,CAAC;IACtD,CAAC;IAED,OAAO,UAAG,eAAe,SAAG,SAAS,CAAE,CAAC;AAC1C,CAAC,CAAC;AA/DW,QAAA,UAAU,cA+DrB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.escapeRegExp = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Escape regex char
|
|
6
|
+
*
|
|
7
|
+
* See: https://stackoverflow.com/questions/17885855/use-dynamic-variable-string-as-regex-pattern-in-javascript
|
|
8
|
+
*/
|
|
9
|
+
var escapeRegExp = function (stringToGoIntoTheRegex) {
|
|
10
|
+
return stringToGoIntoTheRegex.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
11
|
+
};
|
|
12
|
+
exports.escapeRegExp = escapeRegExp;
|
|
13
|
+
//# sourceMappingURL=escapeRegExp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escapeRegExp.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/form/input-currency/components/utils/escapeRegExp.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACI,IAAM,YAAY,GAAG,UAAC,sBAA8B;IACzD,OAAO,sBAAsB,CAAC,OAAO,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;AACzE,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fixedDecimalValue: (value: string, decimalSeparator: string, fixedDecimalLength?: number) => string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fixedDecimalValue = void 0;
|
|
4
|
+
var fixedDecimalValue = function (value, decimalSeparator, fixedDecimalLength) {
|
|
5
|
+
if (fixedDecimalLength !== undefined && value.length > 1) {
|
|
6
|
+
if (fixedDecimalLength === 0) {
|
|
7
|
+
return value.replace(decimalSeparator, '');
|
|
8
|
+
}
|
|
9
|
+
if (value.includes(decimalSeparator)) {
|
|
10
|
+
var _a = value.split(decimalSeparator), int = _a[0], decimals = _a[1];
|
|
11
|
+
if (decimals.length === fixedDecimalLength) {
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
if (decimals.length > fixedDecimalLength) {
|
|
15
|
+
return "".concat(int).concat(decimalSeparator).concat(decimals.slice(0, fixedDecimalLength));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
var reg = value.length > fixedDecimalLength
|
|
19
|
+
? new RegExp("(\\d+)(\\d{".concat(fixedDecimalLength, "})"))
|
|
20
|
+
: new RegExp("(\\d)(\\d+)");
|
|
21
|
+
var match = value.match(reg);
|
|
22
|
+
if (match) {
|
|
23
|
+
var int = match[1], decimals = match[2];
|
|
24
|
+
return "".concat(int).concat(decimalSeparator).concat(decimals);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
};
|
|
29
|
+
exports.fixedDecimalValue = fixedDecimalValue;
|
|
30
|
+
//# sourceMappingURL=fixedDecimalValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixedDecimalValue.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/form/input-currency/components/utils/fixedDecimalValue.ts"],"names":[],"mappings":";;;AAAO,IAAM,iBAAiB,GAAG,UAC/B,KAAa,EACb,gBAAwB,EACxB,kBAA2B;IAE3B,IAAI,kBAAkB,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,IAAI,kBAAkB,KAAK,CAAC,EAAE,CAAC;YAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;QAC7C,CAAC;QAED,IAAI,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC/B,IAAA,KAAkB,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAA9C,GAAG,QAAA,EAAE,QAAQ,QAAiC,CAAC;YAEtD,IAAI,QAAQ,CAAC,MAAM,KAAK,kBAAkB,EAAE,CAAC;gBAC3C,OAAO,KAAK,CAAC;YACf,CAAC;YAED,IAAI,QAAQ,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;gBACzC,OAAO,UAAG,GAAG,SAAG,gBAAgB,SAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAE,CAAC;YAC7E,CAAC;QACH,CAAC;QAED,IAAM,GAAG,GACP,KAAK,CAAC,MAAM,GAAG,kBAAkB;YAC/B,CAAC,CAAC,IAAI,MAAM,CAAC,qBAAc,kBAAkB,OAAI,CAAC;YAClD,CAAC,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;QAEhC,IAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,KAAK,EAAE,CAAC;YACD,IAAA,GAAG,GA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