@dynamic-framework/ui-react 1.32.0 → 1.32.1
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/css/dynamic-ui-non-root.css +3 -1
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +15 -15
- package/dist/css/dynamic-ui-root.min.css +2 -2
- package/dist/css/dynamic-ui.css +17 -15
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +12 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -19
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/style/abstracts/variables/_colors.scss +14 -14
- package/src/style/components/_d-input-pin.scss +1 -0
- package/src/style/root/_root.scss +2 -2
package/dist/index.js
CHANGED
|
@@ -810,27 +810,20 @@ function useInputCurrency(currencyOptions, value, onFocus, onChange, onBlur, ref
|
|
|
810
810
|
color: `var(--${PREFIX_BS}input-currency-symbol-color)`,
|
|
811
811
|
}), []);
|
|
812
812
|
const handleOnChange = React.useCallback((newValue) => {
|
|
813
|
-
const newNumber = (newValue === undefined || newValue === '')
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(innerNumber);
|
|
821
|
-
}, [onChange, innerNumber]);
|
|
813
|
+
const newNumber = (newValue === undefined || newValue === '') ? undefined : Number(newValue);
|
|
814
|
+
if (newNumber !== innerNumber) {
|
|
815
|
+
setInnerNumber(newNumber);
|
|
816
|
+
setInnerString(formatValue(newNumber, currencyOptions));
|
|
817
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newNumber);
|
|
818
|
+
}
|
|
819
|
+
}, [currencyOptions, onChange, innerNumber]);
|
|
822
820
|
React.useEffect(() => {
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
if (value === undefined || value.toString() === '') {
|
|
827
|
-
return '';
|
|
821
|
+
if (value !== innerNumber) {
|
|
822
|
+
setInnerNumber(value);
|
|
823
|
+
setInnerString(formatValue(value, currencyOptions));
|
|
828
824
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
: innerString;
|
|
832
|
-
return valueToUse !== null && valueToUse !== void 0 ? valueToUse : '';
|
|
833
|
-
}, [value, innerType, innerNumber, innerString]);
|
|
825
|
+
}, [value, currencyOptions, innerNumber]);
|
|
826
|
+
const innerValue = React.useMemo(() => { var _a; return (innerType === 'number' ? (_a = innerNumber === null || innerNumber === void 0 ? void 0 : innerNumber.toString()) !== null && _a !== void 0 ? _a : '' : innerString !== null && innerString !== void 0 ? innerString : ''); }, [innerType, innerNumber, innerString]);
|
|
834
827
|
return {
|
|
835
828
|
inputRef,
|
|
836
829
|
innerValue,
|