push rasad front on new repo

This commit is contained in:
2026-01-18 14:32:49 +03:30
commit 4fe6e70525
2139 changed files with 303150 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
import React from "react";
import PropTypes from "prop-types";
import { NumberFormatBase, useNumericFormat } from "react-number-format";
import { TextField } from "@mui/material";
export const NumberInput = (props) => {
const { format, removeFormatting, ...rest } = useNumericFormat(props);
const _format = (val) => {
const _val = format(val);
return _val;
};
delete rest.onChange;
const _removeFormatting = (val) => {
const _val = val.toLowerCase().replace(/[ ,]/g, "");
return removeFormatting(_val);
};
return (
<NumberFormatBase
customInput={TextField}
removeFormatting={_removeFormatting}
format={_format}
{...rest}
onValueChange={(values) => {
props.onChange({
target: {
name: props.id,
value: values.floatValue,
},
});
}}
/>
);
};
NumberInput.propTypes = {
id: PropTypes.any.isRequired,
onChange: PropTypes.func.isRequired,
};