@typeolymp/ui-components 1.19.5 → 1.19.6
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/build/index.es.js +16 -13
- package/build/index.es.js.map +1 -1
- package/build/index.js +16 -13
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -8044,30 +8044,33 @@ var Number$1 = function (props) {
|
|
|
8044
8044
|
inputRef.current.value = "".concat(value);
|
|
8045
8045
|
return value;
|
|
8046
8046
|
};
|
|
8047
|
-
var decrease = function () {
|
|
8048
|
-
var value = parseInt(inputRef.current.value) - 1;
|
|
8049
|
-
setValue(value);
|
|
8050
|
-
inputRef.current.focus();
|
|
8051
|
-
};
|
|
8052
|
-
var increase = function () {
|
|
8053
|
-
var value = parseInt(inputRef.current.value) + 1;
|
|
8054
|
-
setValue(value);
|
|
8055
|
-
inputRef.current.focus();
|
|
8056
|
-
};
|
|
8057
8047
|
var onChange = function () {
|
|
8058
|
-
|
|
8059
|
-
|
|
8048
|
+
if (!props.disabled && !!props.onChange) {
|
|
8049
|
+
var value = parseInt(inputRef.current.value);
|
|
8060
8050
|
props.onChange(value);
|
|
8051
|
+
}
|
|
8061
8052
|
};
|
|
8062
8053
|
var onBlur = function () {
|
|
8063
8054
|
var value = parseInt(inputRef.current.value);
|
|
8064
8055
|
var newValue = setValue(value);
|
|
8065
8056
|
// If the value has changed, call the onChange callback
|
|
8066
8057
|
if (value !== newValue && !!props.onChange)
|
|
8067
|
-
|
|
8058
|
+
onChange();
|
|
8068
8059
|
if (!!props.onBlur)
|
|
8069
8060
|
props.onBlur();
|
|
8070
8061
|
};
|
|
8062
|
+
var decrease = function () {
|
|
8063
|
+
var value = parseInt(inputRef.current.value) - 1;
|
|
8064
|
+
setValue(value);
|
|
8065
|
+
onChange();
|
|
8066
|
+
inputRef.current.focus();
|
|
8067
|
+
};
|
|
8068
|
+
var increase = function () {
|
|
8069
|
+
var value = parseInt(inputRef.current.value) + 1;
|
|
8070
|
+
setValue(value);
|
|
8071
|
+
onChange();
|
|
8072
|
+
inputRef.current.focus();
|
|
8073
|
+
};
|
|
8071
8074
|
return (jsxRuntime.jsxs(Wrapper$6, __assign$2({ disabled: props.disabled }, { children: [jsxRuntime.jsx(Button, { label: "-", disabled: props.disabled, onClick: decrease, tabIndex: -1, type: "button" }), jsxRuntime.jsx(StyledInputNumber, __assign$2({ type: "number" }, props, { defaultValue: props.defaultValue || props.min || 0, onChange: onChange, onBlur: onBlur, ref: inputRef })), jsxRuntime.jsx(Button, { label: "+", disabled: props.disabled, onClick: increase, tabIndex: -1, type: "button" })] })));
|
|
8072
8075
|
};
|
|
8073
8076
|
|