UNPKG

@aokiapp/rjsf-mantine-theme

Version:

Mantine theme, fields and widgets for react-jsonschema-form

1 lines 1.58 kB
{"version":3,"file":"ErrorListTemplate.mjs","sources":["../../src/templates/ErrorListTemplate.tsx"],"sourcesContent":["import { Alert, List } from '@mantine/core';\nimport { ErrorListProps, FormContextType, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';\nimport { IconZoomExclamation } from '@tabler/icons-react';\n\n/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`\n *\n * @param props - The `ErrorListProps` for this component\n */\nexport default function ErrorList<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({\n errors,\n registry,\n}: ErrorListProps<T, S, F>) {\n const { translateString } = registry;\n return (\n <Alert title={translateString(TranslatableString.ErrorsLabel)} icon={<IconZoomExclamation />}>\n <List size='sm'>\n {errors.map((error, index) => (\n <List.Item key={`error-${index}`}>{error.stack}</List.Item>\n ))}\n </List>\n </Alert>\n );\n}\n"],"names":[],"mappings":";;;;;AAKe,SAAS,SAAS,CAAC;AAClC,EAAE,MAAM;AACR,EAAE,QAAQ;AACV,CAAC,EAAE;AACH,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;AACvC,EAAE,uBAAuB,GAAG,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,IAAI,kBAAkB,GAAG,CAAC,mBAAmB,EAAE,EAAE,CAAC,EAAE,QAAQ,kBAAkB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,qBAAqB,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC9T;;;;"}