5.0.0-alpha.1 • Published 2 years ago

rjv-react-antd v5.0.0-alpha.1

Weekly downloads
24
License
MIT
Repository
github
Last release
2 years ago

rjv-react-antd

Ant Design's form fields powered by the rjv-react

Install

yarn add rjv rjv-react rjv-react-antd

Components

Form

Combines rjv-react's FormProvider and antd's Form components together.

Properties extend Ant's form props:

NameTypeDefaultDescription
data*anyundefinedinitial form data
refRefObject<FormApi>undefinedref to the FormApi instance
validateTriggerstring'onBlur'when fields should be validated, possible values onBlur, onChange, none
focusFirstErrorbooleantruefocus the first field with an error after a form submitting
onSuccess(data: any) => void | Promise<void>undefinedsuccessful form submission handler
onError(firstErrorField: FirstErrorField) => voidundefinedunsuccessful form submission handler

FormItemField

Helps to create complex form controls.

Properties extend Antd's form item props:

NameTypeDefaultDescription
showAllErrorsbooleantrueshow all errors or the only first

Higher Order Fields (HOF)

InputField

HOF over Antd's Input component

Properties:

NameTypeDefaultDescription
path*stringundefinedpath to the data property
schema*Object<Schema>undefinedvalidation JSON schema
refRefObject<FormApi>undefinedref to the FieldApi instance
dependenciesany[][]external values that affect the validation schema
labelReact.ReactNodeundefinedfield label
helpReact.ReactNodeundefinedfield help
placeholderstringundefinedfield placeholder
inputPropsInputProps{}Antd's InputProps
itemPropsFormItemProps{}Antd's FormItemProps
clearStateOnChangebooleantruemark field as not validated when the field value changes
autoFocusbooleanfalsefocus field on mount
validateTriggerstringinherited from the Form component or 'onBlur'possible values are onBlur, onChange, none

NumberField

HOF over Antd's InputNumber component

Properties:

NameTypeDefaultDescription
path*stringundefinedpath to the data property
schema*Object<Schema>undefinedvalidation JSON schema
refRefObject<FormApi>undefinedref to the FieldApi instance
dependenciesany[][]external values that affect the validation schema
labelReact.ReactNodeundefinedfield label
helpReact.ReactNodeundefinedfield help
placeholderstringundefinedfield placeholder
inputPropsNumberProps{}Antd's NumberProps
itemPropsFormItemProps{}Antd's FormItemProps
clearStateOnChangebooleantruemark field as not validated when the field value changes
autoFocusbooleanfalsefocus field on mount
validateTriggerstringinherited from the Form component or 'onBlur'possible values are onBlur, onChange, none

SelectField

HOF over Antd's Select component

Properties:

NameTypeDefaultDescription
path*stringundefinedpath to the data property
schema*Object<Schema>undefinedvalidation JSON schema
refRefObject<FormApi>undefinedref to the FieldApi instance
dependenciesany[][]external values that affect the validation schema
children*React.ReactNodeArrayundefinedselect options
labelReact.ReactNodeundefinedfield label
helpReact.ReactNodeundefinedfield help
inputPropsSelectProps{}Antd's SelectProps
itemPropsFormItemProps{}Antd's FormItemProps
clearStateOnChangebooleantruemark field as not validated when the field value changes
autoFocusbooleanfalsefocus field on mount
validateTriggerstringinherited from the Form component or 'onBlur'possible values are onBlur, onChange, none

SwitchField

HOF over Antd's Switch component

Properties:

NameTypeDefaultDescription
path*stringundefinedpath to the data property
schema*Object<Schema>undefinedvalidation JSON schema
refRefObject<FormApi>undefinedref to the FieldApi instance
dependenciesany[][]external values that affect the validation schema
labelReact.ReactNodeundefinedfield label
helpReact.ReactNodeundefinedfield help
inputPropsSwitchProps{}Antd's SwitchProps
itemPropsFormItemProps{}Antd's FormItemProps
clearStateOnChangebooleantruemark field as not validated when the field value changes
autoFocusbooleanfalsefocus field on mount
validateTriggerstringinherited from the Form component or 'onChange'possible values are onChange, none. The onBlur value is treated an onChange

CheckboxField

HOF over Antd's Checkbox component

Properties:

NameTypeDefaultDescription
path*stringundefinedpath to the data property
schema*Object<Schema>undefinedvalidation JSON schema
refRefObject<FormApi>undefinedref to the FieldApi instance
dependenciesany[][]external values that affect the validation schema
labelReact.ReactNodeundefinedfield label
helpReact.ReactNodeundefinedfield help
inputPropsCheckboxProps{}Antd's CheckboxProps
itemPropsFormItemProps{}Antd's FormItemProps
clearStateOnChangebooleantruemark field as not validated when the field value changes
autoFocusbooleanfalsefocus field on mount
validateTriggerstringinherited from the Form component or 'onChange'possible values are onChange, none. The onBlur value is treated an onChange

CheckboxGroupField

HOF over Antd's Checkbox.Group component

Properties:

NameTypeDefaultDescription
path*stringundefinedpath to the data property
schema*Object<Schema>undefinedvalidation JSON schema
refRefObject<FormApi>undefinedref to the FieldApi instance
dependenciesany[][]external values that affect the validation schema
children*React.ReactNodeArrayundefinedcheckbox group items
labelReact.ReactNodeundefinedfield label
helpReact.ReactNodeundefinedfield help
inputPropsCheckboxGroupProps{}Antd's CheckboxGroupProps
itemPropsFormItemProps{}Antd's FormItemProps
clearStateOnChangebooleantruemark field as not validated when the field value changes
autoFocusbooleanfalsefocus field on mount
validateTriggerstringinherited from the Form component or 'onChange'possible values are onChange, none. The onBlur value is treated an onChange

RadioGroupField

HOF over Antd's Radio.Group component

Properties:

NameTypeDefaultDescription
path*stringundefinedpath to the data property
schema*Object<Schema>undefinedvalidation JSON schema
refRefObject<FormApi>undefinedref to the FieldApi instance
dependenciesany[][]external values that affect the validation schema
children*React.ReactNodeArrayundefinedradio group items
labelReact.ReactNodeundefinedfield label
helpReact.ReactNodeundefinedfield help
inputPropsRadioGroupProps{}Antd's RadioGroupProps
itemPropsFormItemProps{}Antd's FormItemProps
clearStateOnChangebooleantruemark field as not validated when the field value changes
autoFocusbooleanfalsefocus field on mount
validateTriggerstringinherited from the Form component or 'onChange'possible values are onChange, none. The onBlur value is treated an onChange

RateField

HOF over Antd's Rate component

Properties:

NameTypeDefaultDescription
path*stringundefinedpath to the data property
schema*Object<Schema>undefinedvalidation JSON schema
refRefObject<FormApi>undefinedref to the FieldApi instance
dependenciesany[][]external values that affect the validation schema
labelReact.ReactNodeundefinedfield label
helpReact.ReactNodeundefinedfield help
inputPropsRateProps{}Antd's RateProps
itemPropsFormItemProps{}Antd's FormItemProps
clearStateOnChangebooleantruemark field as not validated when the field value changes
autoFocusbooleanfalsefocus field on mount
validateTriggerstringinherited from the Form component or 'onChange'possible values are onChange, none. The onBlur value is treated an onChange

DatePickerField

HOF over Antd's DatePicker component

Properties:

NameTypeDefaultDescription
path*stringundefinedpath to the data property
schema*Object<Schema>undefinedvalidation JSON schema
refRefObject<FormApi>undefinedref to the FieldApi instance
dependenciesany[][]external values that affect the validation schema
labelReact.ReactNodeundefinedfield label
helpReact.ReactNodeundefinedfield help
inputPropsDatePickerProps{}Antd's DatePickerProps
itemPropsFormItemProps{}Antd's FormItemProps
clearStateOnChangebooleantruemark field as not validated when the field value changes
autoFocusbooleanfalsefocus field on mount
validateTriggerstringinherited from the Form component or 'onBlur'possible values are onBlur, onChange, none

RangePickerField

HOF over Antd's RangePicker component

Properties:

NameTypeDefaultDescription
path*stringundefinedpath to the data property
schema*Object<Schema>undefinedvalidation JSON schema
refRefObject<FormApi>undefinedref to the FieldApi instance
dependenciesany[][]external values that affect the validation schema
labelReact.ReactNodeundefinedfield label
helpReact.ReactNodeundefinedfield help
inputPropsRangePickerProps{}Antd's RangePickerProps
itemPropsFormItemProps{}Antd's FormItemProps
clearStateOnChangebooleantruemark field as not validated when the field value changes
autoFocusbooleanfalsefocus field on mount
validateTriggerstringinherited from the Form component or 'onBlur'possible values are onBlur, onChange, none

License

rjv-react-antd is released under the MIT license. See the LICENSE file for license text and copyright information.