import BasicNumber from '../../basic/number'
import { useFormInput } from '../../../hooks/form-input'
import { formInputProps } from '../../form-input-props'
import './index.less'
export default {
  name: 'ToleranceNumber',
  props: formInputProps,
  setup (props, context) {
    const { proxyValue, proxyOtherValue, width } = useFormInput(props, context)
    return () => <div class={'extension-tolerance-number'} style={{ width: width.value }}>
      <BasicNumber v-model={proxyValue.value} config={props.config}/>
      <span class={'extension-tolerance-number__joint'}>±</span>
      <BasicNumber v-model={proxyOtherValue[0].value} config={{ ...props.config, noPrecision: true }}/>
    </div>
  }
}
