infinity-forge 7.2.1 → 7.2.2
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.
|
@@ -18,8 +18,7 @@ var formik_1 = require("formik");
|
|
|
18
18
|
var input_control_1 = require("../input-control/index.js");
|
|
19
19
|
var components_1 = require("./components/index.js");
|
|
20
20
|
function InputCurrency(props) {
|
|
21
|
-
var _a;
|
|
22
|
-
var _b = (0, formik_1.useField)({ name: props.name }), field = _b[0], _ = _b[1], handlers = _b[2];
|
|
21
|
+
var _a = (0, formik_1.useField)({ name: props.name }), field = _a[0], _ = _a[1], handlers = _a[2];
|
|
23
22
|
function handleChange(value) {
|
|
24
23
|
var valueToString = typeof value === 'number' ? String(value) : value;
|
|
25
24
|
if (valueToString) {
|
|
@@ -48,15 +47,16 @@ function InputCurrency(props) {
|
|
|
48
47
|
props.onChangeInput && props.onChangeInput('0');
|
|
49
48
|
}
|
|
50
49
|
var value = field.value;
|
|
51
|
-
var memoized = (0, react_1.useMemo)(function () { var _a; return (_a = props === null || props === void 0 ? void 0 : props.controlledInitialValue) === null || _a === void 0 ? void 0 : _a.value; }, [(_a = props === null || props === void 0 ? void 0 : props.controlledInitialValue) === null || _a === void 0 ? void 0 : _a.value]);
|
|
52
50
|
(0, react_1.useEffect)(function () {
|
|
53
|
-
|
|
51
|
+
var _a;
|
|
52
|
+
if ((_a = props === null || props === void 0 ? void 0 : props.controlledInitialValue) === null || _a === void 0 ? void 0 : _a.value) {
|
|
54
53
|
setTimeout(function () {
|
|
55
|
-
|
|
54
|
+
var _a;
|
|
55
|
+
handleChange((_a = props === null || props === void 0 ? void 0 : props.controlledInitialValue) === null || _a === void 0 ? void 0 : _a.value);
|
|
56
56
|
return;
|
|
57
57
|
}, 500);
|
|
58
58
|
}
|
|
59
|
-
}, [
|
|
59
|
+
}, []);
|
|
60
60
|
return ((0, jsx_runtime_1.jsx)(input_control_1.InputControl, __assign({}, props, { children: (0, jsx_runtime_1.jsx)(components_1.CurrencyInput, __assign({}, props, { prefix: typeof (props === null || props === void 0 ? void 0 : props.prefix) !== 'string' ? 'R$ ' : props.prefix, decimalsLimit: (props === null || props === void 0 ? void 0 : props.decimalLimit) || 2, decimalSeparator: (props === null || props === void 0 ? void 0 : props.decimalLimit) === 0 ? "" : ',', groupSeparator: '.', value: value, onValueChange: handleChange, readOnly: props.readOnly, max: props.max })) })));
|
|
61
61
|
}
|
|
62
62
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/components/form/input-currency/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAgBA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/components/form/input-currency/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAgBA,sCAgEC;;AAhFD,+BAA0C;AAE1C,iCAAiC;AAEjC,kDAA+C;AAI/C,2CAA4C;AAQ5C,SAAgB,aAAa,CAAC,KAAsC;IAC5D,IAAA,KAAuB,IAAA,iBAAQ,EAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,EAApD,KAAK,QAAA,EAAE,CAAC,QAAA,EAAE,QAAQ,QAAkC,CAAA;IAE3D,SAAS,YAAY,CAAC,KAAa;QACjC,IAAM,aAAa,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;QAEvE,IAAI,aAAa,EAAE,CAAC;YAClB,IAAM,YAAY,GAAG,UAAU,CAC7B,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,CAAC,GAAG,CAAC,EAAC,CAAC,CAAC,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,C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