How to use the react-admin.addField function in react-admin

To help you get started, we’ve selected a few react-admin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AudienceHero / AudienceHero / src / AudienceHero / Bundle / PodcastBundle / Resources / modules / backoffice / input / ITunesCategoryInput.js View on Github external
isRequired: PropTypes.bool,
    label: PropTypes.string,
    meta: PropTypes.object,
    options: PropTypes.object,
    resource: PropTypes.string,
    source: PropTypes.string,
    locale: PropTypes.string.isRequired,
};

ITunesCategoryInput.defaultProps = {
    allowEmpty: false,
    options: {},
    choices: iTunesCategories,
};

export default translate(addField(ITunesCategoryInput));
github AudienceHero / AudienceHero / src / AudienceHero / Bundle / CoreBundle / Resources / modules / backoffice / input / SelectArrayInput.js View on Github external
translate: PropTypes.func.isRequired,
    translateChoice: PropTypes.bool.isRequired,
};

SelectArrayInput.defaultProps = {
    choices: [],
    onBlur: () => true,
    onChange: () => true,
    onFocus: () => true,
    options: {},
    optionText: 'name',
    optionValue: 'id',
    translateChoice: true,
};

export default translate(addField(SelectArrayInput));
github AudienceHero / AudienceHero / src / AudienceHero / Bundle / CoreBundle / Resources / modules / backoffice / input / CountryInput.js View on Github external
};

const enhance = compose(
    translate,
    connect(
        ({ locale, ah_core }) => ({
            locale,
            countries: ah_core.i18n['countries'],
        }),
        {
            fetchCountryList: fetchCountryListAction,
        }
    )
);

const EnhancedCountryInput = addField(enhance(CountryInput));

EnhancedCountryInput.defaultProps = {
    allowEmpty: false,
    options: {},
    locale: 'en',
};

export default EnhancedCountryInput;
github AudienceHero / AudienceHero / src / AudienceHero / Bundle / CoreBundle / Resources / modules / backoffice / input / ReferenceArrayInput.js View on Github external
}, []),
        matchingReferences: getPossibleReferences(
            state,
            referenceSource(props.resource, props.source),
            props.reference,
            referenceIds
        ),
    };
}

const ConnectedReferenceInput = connect(mapStateToProps, {
    crudGetMany: crudGetManyAction,
    crudGetMatching: crudGetMatchingAction,
})(ReferenceArrayInput);

export default addField(ConnectedReferenceInput);