import { InputNumber, InputNumberProps } from 'antd'; import cx from 'classnames'; import React from 'react'; import type { StdCallback } from './types'; const CLASS_NAME = 'ac-input-number'; export type AcInputNumberProps = { className?: string; value?: number; onChange?: StdCallback; } & InputNumberProps; export class AcInputNumber extends React.Component { static displayName = CLASS_NAME; static formSchema = CLASS_NAME; static defaultProps = {}; state = { value: this.props.value, }; shouldComponentUpdate(inProps: Readonly): boolean { const { value } = inProps; if (value !== this.props.value) this.setState({ value }); return true; } handleChange = (inEvent) => { const { onChange } = this.props; const target = { value: inEvent }; this.setState(target); onChange?.({ target }); }; render() { const { className, value, onChange, ...props } = this.props; const { value: stateValue } = this.state; return ( ); } } export const AcInputNumberFc = (props: AcInputNumberProps) => { return ; };