@rjsf/core
Version:
A simple React component capable of building HTML forms out of a JSON schema.
24 lines (23 loc) • 1.01 kB
JavaScript
import { DEFAULT_ID_PREFIX, DEFAULT_ID_SEPARATOR, englishStringTranslator, } from '@rjsf/utils';
import fields from './components/fields/index.js';
import templates from './components/templates/index.js';
import widgets from './components/widgets/index.js';
/** The default registry consists of all the fields, templates and widgets provided in the core implementation,
* plus an empty `rootSchema` and `formContext. We omit schemaUtils here because it cannot be defaulted without a
* rootSchema and validator. It will be added into the computed registry later in the Form.
*/
export default function getDefaultRegistry() {
return {
fields: fields(),
templates: templates(),
widgets: widgets(),
rootSchema: {},
formContext: {},
translateString: englishStringTranslator,
globalFormOptions: {
idPrefix: DEFAULT_ID_PREFIX,
idSeparator: DEFAULT_ID_SEPARATOR,
useFallbackUiForUnsupportedType: false,
},
};
}