The adapter for a specific UI/Form state framework. All adapter should handle 'required', 'fullWidth', 'disabled', 'label', 'help' props of a field. You can create an adapter to support other UI frameworks. We have provided antd, formik and formik + MUI adapter.

interface NiceFormAdapter {
    defaultViewWidget?: string | ReactComponent;
    defaultWidget?: string | ReactComponent;
    getFieldValue?: ((fieldName, meta, ...args) => any);
    labelStyle?: CSSProperties;
    metaConverter?: ((meta) => NormalizedFormMeta);
    processMeta?: ((meta) => NiceFormMeta);
    renderField?: ((param0) => null | ReactElement<any, string | JSXElementConstructor<any>>);
    renderFieldWithoutLabel?: ((__namedParameters) => null | ReactElement<any, string | JSXElementConstructor<any>>);
    widgetMap?: NiceFormWidgetMap;
}

Properties

defaultViewWidget?: string | ReactComponent

The default widget component or widget id for fields in view mode.

defaultWidget?: string | ReactComponent

The default widget component or widget id for fields in edit mode.

getFieldValue?: ((fieldName, meta, ...args) => any)

Get the field value from the form meta.

Type declaration

    • (fieldName, meta, ...args): any
    • Parameters

      Returns any

labelStyle?: CSSProperties
metaConverter?: ((meta) => NormalizedFormMeta)

Convert user input form meta to the meta that the adapter needs.

Type declaration

Returns

processMeta?: ((meta) => NiceFormMeta)

Process the meta before rendering.

Type declaration

Returns

renderField?: ((param0) => null | ReactElement<any, string | JSXElementConstructor<any>>)

Render the field by NiceFormMeta and NormalizedFormField.

Type declaration

Returns

renderFieldWithoutLabel?: ((__namedParameters) => null | ReactElement<any, string | JSXElementConstructor<any>>)

Type declaration

widgetMap?: NiceFormWidgetMap

An adapter can provides additional string to component widget map together with field meta converters..

Generated using TypeDoc