"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NumberField = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const react_imask_next_1 = require("react-imask-next");
const TextField_1 = require("../TextField");
const useLogic_1 = require("./useLogic");
const MaskedNumberField = (0, react_imask_next_1.IMaskMixin)(({ typedValue, onChange, ...props }) => {
    const textFieldProps = props;
    return (0, jsx_runtime_1.jsx)(TextField_1.TextField, { ...textFieldProps });
});
exports.NumberField = (0, react_1.forwardRef)((props, ref) => {
    const { maskProps } = (0, useLogic_1.useLogic)(props);
    return ((0, jsx_runtime_1.jsx)(MaskedNumberField, { inputRef: ref, unmask: "typed", mask: Number, thousandsSeparator: ' ', ...props, ...maskProps }));
});
