"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NumberInput = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const uikit_1 = require("@gravity-ui/uikit");
const is_number_1 = tslib_1.__importDefault(require("is-number"));
const NumberInput = (props) => {
    const { value, onUpdate, min, max, ...textInputProps } = props;
    return ((0, jsx_runtime_1.jsx)(uikit_1.TextInput, { value: (0, is_number_1.default)(value) ? String(value) : '', onUpdate: (v) => {
            if ((0, is_number_1.default)(v)) {
                onUpdate(parseInt(v, 10));
            }
            else {
                onUpdate();
            }
        }, controlProps: { min, max }, type: "number", ...textInputProps }));
};
exports.NumberInput = NumberInput;
//# sourceMappingURL=NumberInput.js.map
