UNPKG

@appbuckets/react-ui-forms

Version:

An utilities package to manage and create Form using AppBuckets ReactUI

31 lines (28 loc) 887 B
import { __assign } from '../_virtual/_tslib.js'; import * as React from 'react'; import NumericInput from '@appbuckets/react-ui/NumericInput'; import { createHookedField } from '../utils/createHookedField.js'; /* -------- * Component Definition * -------- */ var HookedNumericInput = createHookedField({ displayName: 'HookedNumericInput', Component: function HookedNumericInputComponent(props) { var innerRef = props.innerRef, meta = props.meta, rest = props.rest; return React.createElement( NumericInput, __assign({}, rest, meta.appearance, { ref: innerRef, hint: meta.message }) ); }, parseValue: function (_a) { var _b; var props = _a.props; return (_b = props === null || props === void 0 ? void 0 : props.value) !== null && _b !== void 0 ? _b : null; }, }); export { HookedNumericInput as default };