@rjsf/core 5.11.2 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.umd.js +3464 -0
- package/dist/index.esm.js +3814 -0
- package/dist/index.esm.js.map +7 -0
- package/dist/index.js +3714 -5
- package/dist/index.js.map +7 -0
- package/{dist/index.d.ts → lib/components/Form.d.ts} +321 -337
- package/lib/components/Form.js +474 -0
- package/lib/components/Form.js.map +1 -0
- package/lib/components/fields/ArrayField.d.ts +179 -0
- package/lib/components/fields/ArrayField.js +568 -0
- package/lib/components/fields/ArrayField.js.map +1 -0
- package/lib/components/fields/BooleanField.d.ts +9 -0
- package/lib/components/fields/BooleanField.js +62 -0
- package/lib/components/fields/BooleanField.js.map +1 -0
- package/lib/components/fields/MultiSchemaField.d.ts +47 -0
- package/lib/components/fields/MultiSchemaField.js +129 -0
- package/lib/components/fields/MultiSchemaField.js.map +1 -0
- package/lib/components/fields/NullField.d.ts +8 -0
- package/lib/components/fields/NullField.js +17 -0
- package/lib/components/fields/NullField.js.map +1 -0
- package/lib/components/fields/NumberField.d.ts +21 -0
- package/lib/components/fields/NumberField.js +70 -0
- package/lib/components/fields/NumberField.js.map +1 -0
- package/lib/components/fields/ObjectField.d.ts +73 -0
- package/lib/components/fields/ObjectField.js +222 -0
- package/lib/components/fields/ObjectField.js.map +1 -0
- package/lib/components/fields/SchemaField.d.ts +10 -0
- package/lib/components/fields/SchemaField.js +172 -0
- package/lib/components/fields/SchemaField.js.map +1 -0
- package/lib/components/fields/StringField.d.ts +8 -0
- package/lib/components/fields/StringField.js +25 -0
- package/lib/components/fields/StringField.js.map +1 -0
- package/lib/components/fields/index.d.ts +3 -0
- package/lib/components/fields/index.js +24 -0
- package/lib/components/fields/index.js.map +1 -0
- package/lib/components/templates/ArrayFieldDescriptionTemplate.d.ts +8 -0
- package/lib/components/templates/ArrayFieldDescriptionTemplate.js +18 -0
- package/lib/components/templates/ArrayFieldDescriptionTemplate.js.map +1 -0
- package/lib/components/templates/ArrayFieldItemTemplate.d.ts +7 -0
- package/lib/components/templates/ArrayFieldItemTemplate.js +20 -0
- package/lib/components/templates/ArrayFieldItemTemplate.js.map +1 -0
- package/lib/components/templates/ArrayFieldTemplate.d.ts +7 -0
- package/lib/components/templates/ArrayFieldTemplate.js +22 -0
- package/lib/components/templates/ArrayFieldTemplate.js.map +1 -0
- package/lib/components/templates/ArrayFieldTitleTemplate.d.ts +8 -0
- package/lib/components/templates/ArrayFieldTitleTemplate.js +18 -0
- package/lib/components/templates/ArrayFieldTitleTemplate.js.map +1 -0
- package/lib/components/templates/BaseInputTemplate.d.ts +9 -0
- package/lib/components/templates/BaseInputTemplate.js +39 -0
- package/lib/components/templates/BaseInputTemplate.js.map +1 -0
- package/lib/components/templates/ButtonTemplates/AddButton.d.ts +5 -0
- package/lib/components/templates/ButtonTemplates/AddButton.js +10 -0
- package/lib/components/templates/ButtonTemplates/AddButton.js.map +1 -0
- package/lib/components/templates/ButtonTemplates/IconButton.d.ts +7 -0
- package/lib/components/templates/ButtonTemplates/IconButton.js +24 -0
- package/lib/components/templates/ButtonTemplates/IconButton.js.map +1 -0
- package/lib/components/templates/ButtonTemplates/SubmitButton.d.ts +5 -0
- package/lib/components/templates/ButtonTemplates/SubmitButton.js +12 -0
- package/lib/components/templates/ButtonTemplates/SubmitButton.js.map +1 -0
- package/lib/components/templates/ButtonTemplates/index.d.ts +3 -0
- package/lib/components/templates/ButtonTemplates/index.js +15 -0
- package/lib/components/templates/ButtonTemplates/index.js.map +1 -0
- package/lib/components/templates/DescriptionField.d.ts +7 -0
- package/lib/components/templates/DescriptionField.js +18 -0
- package/lib/components/templates/DescriptionField.js.map +1 -0
- package/lib/components/templates/ErrorList.d.ts +7 -0
- package/lib/components/templates/ErrorList.js +13 -0
- package/lib/components/templates/ErrorList.js.map +1 -0
- package/lib/components/templates/FieldErrorTemplate.d.ts +7 -0
- package/lib/components/templates/FieldErrorTemplate.js +19 -0
- package/lib/components/templates/FieldErrorTemplate.js.map +1 -0
- package/lib/components/templates/FieldHelpTemplate.d.ts +7 -0
- package/lib/components/templates/FieldHelpTemplate.js +18 -0
- package/lib/components/templates/FieldHelpTemplate.js.map +1 -0
- package/lib/components/templates/FieldTemplate/FieldTemplate.d.ts +8 -0
- package/lib/components/templates/FieldTemplate/FieldTemplate.js +18 -0
- package/lib/components/templates/FieldTemplate/FieldTemplate.js.map +1 -0
- package/lib/components/templates/FieldTemplate/Label.d.ts +14 -0
- package/lib/components/templates/FieldTemplate/Label.js +14 -0
- package/lib/components/templates/FieldTemplate/Label.js.map +1 -0
- package/lib/components/templates/FieldTemplate/index.d.ts +2 -0
- package/lib/components/templates/FieldTemplate/index.js +3 -0
- package/lib/components/templates/FieldTemplate/index.js.map +1 -0
- package/lib/components/templates/ObjectFieldTemplate.d.ts +9 -0
- package/lib/components/templates/ObjectFieldTemplate.js +18 -0
- package/lib/components/templates/ObjectFieldTemplate.js.map +1 -0
- package/lib/components/templates/TitleField.d.ts +7 -0
- package/lib/components/templates/TitleField.js +11 -0
- package/lib/components/templates/TitleField.js.map +1 -0
- package/lib/components/templates/UnsupportedField.d.ts +9 -0
- package/lib/components/templates/UnsupportedField.js +28 -0
- package/lib/components/templates/UnsupportedField.js.map +1 -0
- package/lib/components/templates/WrapIfAdditionalTemplate.d.ts +8 -0
- package/lib/components/templates/WrapIfAdditionalTemplate.js +21 -0
- package/lib/components/templates/WrapIfAdditionalTemplate.js.map +1 -0
- package/lib/components/templates/index.d.ts +3 -0
- package/lib/components/templates/index.js +36 -0
- package/lib/components/templates/index.js.map +1 -0
- package/lib/components/widgets/AltDateTimeWidget.d.ts +9 -0
- package/lib/components/widgets/AltDateTimeWidget.js +14 -0
- package/lib/components/widgets/AltDateTimeWidget.js.map +1 -0
- package/lib/components/widgets/AltDateWidget.d.ts +7 -0
- package/lib/components/widgets/AltDateWidget.js +77 -0
- package/lib/components/widgets/AltDateWidget.js.map +1 -0
- package/lib/components/widgets/CheckboxWidget.d.ts +9 -0
- package/lib/components/widgets/CheckboxWidget.js +23 -0
- package/lib/components/widgets/CheckboxWidget.js.map +1 -0
- package/lib/components/widgets/CheckboxesWidget.d.ts +9 -0
- package/lib/components/widgets/CheckboxesWidget.js +31 -0
- package/lib/components/widgets/CheckboxesWidget.js.map +1 -0
- package/lib/components/widgets/ColorWidget.d.ts +8 -0
- package/lib/components/widgets/ColorWidget.js +13 -0
- package/lib/components/widgets/ColorWidget.js.map +1 -0
- package/lib/components/widgets/DateTimeWidget.d.ts +8 -0
- package/lib/components/widgets/DateTimeWidget.js +13 -0
- package/lib/components/widgets/DateTimeWidget.js.map +1 -0
- package/lib/components/widgets/DateWidget.d.ts +8 -0
- package/lib/components/widgets/DateWidget.js +15 -0
- package/lib/components/widgets/DateWidget.js.map +1 -0
- package/lib/components/widgets/EmailWidget.d.ts +7 -0
- package/lib/components/widgets/EmailWidget.js +12 -0
- package/lib/components/widgets/EmailWidget.js.map +1 -0
- package/lib/components/widgets/FileWidget.d.ts +8 -0
- package/lib/components/widgets/FileWidget.js +105 -0
- package/lib/components/widgets/FileWidget.js.map +1 -0
- package/lib/components/widgets/HiddenWidget.d.ts +9 -0
- package/lib/components/widgets/HiddenWidget.js +11 -0
- package/lib/components/widgets/HiddenWidget.js.map +1 -0
- package/lib/components/widgets/PasswordWidget.d.ts +7 -0
- package/lib/components/widgets/PasswordWidget.js +12 -0
- package/lib/components/widgets/PasswordWidget.js.map +1 -0
- package/lib/components/widgets/RadioWidget.d.ts +9 -0
- package/lib/components/widgets/RadioWidget.js +24 -0
- package/lib/components/widgets/RadioWidget.js.map +1 -0
- package/lib/components/widgets/RangeWidget.d.ts +8 -0
- package/lib/components/widgets/RangeWidget.js +11 -0
- package/lib/components/widgets/RangeWidget.js.map +1 -0
- package/lib/components/widgets/SelectWidget.d.ts +9 -0
- package/lib/components/widgets/SelectWidget.js +41 -0
- package/lib/components/widgets/SelectWidget.js.map +1 -0
- package/lib/components/widgets/TextWidget.d.ts +7 -0
- package/lib/components/widgets/TextWidget.js +12 -0
- package/lib/components/widgets/TextWidget.js.map +1 -0
- package/lib/components/widgets/TextareaWidget.d.ts +14 -0
- package/lib/components/widgets/TextareaWidget.js +19 -0
- package/lib/components/widgets/TextareaWidget.js.map +1 -0
- package/lib/components/widgets/TimeWidget.d.ts +8 -0
- package/lib/components/widgets/TimeWidget.js +15 -0
- package/lib/components/widgets/TimeWidget.js.map +1 -0
- package/lib/components/widgets/URLWidget.d.ts +7 -0
- package/lib/components/widgets/URLWidget.js +12 -0
- package/lib/components/widgets/URLWidget.js.map +1 -0
- package/lib/components/widgets/UpDownWidget.d.ts +7 -0
- package/lib/components/widgets/UpDownWidget.js +12 -0
- package/lib/components/widgets/UpDownWidget.js.map +1 -0
- package/lib/components/widgets/index.d.ts +3 -0
- package/lib/components/widgets/index.js +44 -0
- package/lib/components/widgets/index.js.map +1 -0
- package/lib/getDefaultRegistry.d.ts +6 -0
- package/lib/getDefaultRegistry.js +19 -0
- package/lib/getDefaultRegistry.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -0
- package/lib/withTheme.d.ts +9 -0
- package/lib/withTheme.js +16 -0
- package/lib/withTheme.js.map +1 -0
- package/package.json +23 -16
- package/src/components/Form.tsx +853 -0
- package/src/components/fields/ArrayField.tsx +875 -0
- package/src/components/fields/BooleanField.tsx +114 -0
- package/src/components/fields/MultiSchemaField.tsx +221 -0
- package/src/components/fields/NullField.tsx +22 -0
- package/src/components/fields/NumberField.tsx +86 -0
- package/src/components/fields/ObjectField.tsx +331 -0
- package/src/components/fields/SchemaField.tsx +360 -0
- package/src/components/fields/StringField.tsx +71 -0
- package/src/components/fields/index.ts +31 -0
- package/src/components/templates/ArrayFieldDescriptionTemplate.tsx +41 -0
- package/src/components/templates/ArrayFieldItemTemplate.tsx +90 -0
- package/src/components/templates/ArrayFieldTemplate.tsx +88 -0
- package/src/components/templates/ArrayFieldTitleTemplate.tsx +43 -0
- package/src/components/templates/BaseInputTemplate.tsx +102 -0
- package/src/components/templates/ButtonTemplates/AddButton.tsx +29 -0
- package/src/components/templates/ButtonTemplates/IconButton.tsx +77 -0
- package/src/components/templates/ButtonTemplates/SubmitButton.tsx +21 -0
- package/src/components/templates/ButtonTemplates/index.ts +22 -0
- package/src/components/templates/DescriptionField.tsx +29 -0
- package/src/components/templates/ErrorList.tsx +35 -0
- package/src/components/templates/FieldErrorTemplate.tsx +33 -0
- package/src/components/templates/FieldHelpTemplate.tsx +29 -0
- package/src/components/templates/FieldTemplate/FieldTemplate.tsx +41 -0
- package/src/components/templates/FieldTemplate/Label.tsx +27 -0
- package/src/components/templates/FieldTemplate/index.ts +3 -0
- package/src/components/templates/ObjectFieldTemplate.tsx +83 -0
- package/src/components/templates/TitleField.tsx +19 -0
- package/src/components/templates/UnsupportedField.tsx +37 -0
- package/src/components/templates/WrapIfAdditionalTemplate.tsx +80 -0
- package/src/components/templates/index.ts +43 -0
- package/src/components/widgets/AltDateTimeWidget.tsx +16 -0
- package/src/components/widgets/AltDateWidget.tsx +198 -0
- package/src/components/widgets/CheckboxWidget.tsx +92 -0
- package/src/components/widgets/CheckboxesWidget.tsx +92 -0
- package/src/components/widgets/ColorWidget.tsx +14 -0
- package/src/components/widgets/DateTimeWidget.tsx +31 -0
- package/src/components/widgets/DateWidget.tsx +17 -0
- package/src/components/widgets/EmailWidget.tsx +13 -0
- package/src/components/widgets/FileWidget.tsx +178 -0
- package/src/components/widgets/HiddenWidget.tsx +15 -0
- package/src/components/widgets/PasswordWidget.tsx +15 -0
- package/src/components/widgets/RadioWidget.tsx +88 -0
- package/src/components/widgets/RangeWidget.tsx +23 -0
- package/src/components/widgets/SelectWidget.tsx +100 -0
- package/src/components/widgets/TextWidget.tsx +13 -0
- package/src/components/widgets/TextareaWidget.tsx +61 -0
- package/src/components/widgets/TimeWidget.tsx +17 -0
- package/src/components/widgets/URLWidget.tsx +13 -0
- package/src/components/widgets/UpDownWidget.tsx +13 -0
- package/src/components/widgets/index.ts +51 -0
- package/src/getDefaultRegistry.ts +24 -0
- package/src/index.ts +8 -0
- package/src/withTheme.tsx +42 -0
- package/dist/core.cjs.development.js +0 -4403
- package/dist/core.cjs.development.js.map +0 -1
- package/dist/core.cjs.production.min.js +0 -2
- package/dist/core.cjs.production.min.js.map +0 -1
- package/dist/core.esm.js +0 -4383
- package/dist/core.esm.js.map +0 -1
- package/dist/core.umd.development.js +0 -4393
- package/dist/core.umd.development.js.map +0 -1
- package/dist/core.umd.production.min.js +0 -2
- package/dist/core.umd.production.min.js.map +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ArrayFieldTitleProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `ArrayFieldTitleTemplate` component renders a `TitleFieldTemplate` with an `id` derived from
|
|
4
|
+
* the `idSchema`.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `ArrayFieldTitleProps` for the component
|
|
7
|
+
*/
|
|
8
|
+
export default function ArrayFieldTitleTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: ArrayFieldTitleProps<T, S, F>): JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getTemplate, getUiOptions, titleId, } from '@rjsf/utils';
|
|
3
|
+
/** The `ArrayFieldTitleTemplate` component renders a `TitleFieldTemplate` with an `id` derived from
|
|
4
|
+
* the `idSchema`.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `ArrayFieldTitleProps` for the component
|
|
7
|
+
*/
|
|
8
|
+
export default function ArrayFieldTitleTemplate(props) {
|
|
9
|
+
const { idSchema, title, schema, uiSchema, required, registry } = props;
|
|
10
|
+
const options = getUiOptions(uiSchema, registry.globalUiOptions);
|
|
11
|
+
const { label: displayLabel = true } = options;
|
|
12
|
+
if (!title || !displayLabel) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, options);
|
|
16
|
+
return (_jsx(TitleFieldTemplate, { id: titleId(idSchema), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ArrayFieldTitleTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrayFieldTitleTemplate.js","sourceRoot":"","sources":["../../../src/components/templates/ArrayFieldTitleTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,OAAO,GAMR,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAI7C,KAAoC;IACpC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACxE,MAAM,OAAO,GAAG,YAAY,CAAU,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAC1E,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAC/C,IAAI,CAAC,KAAK,IAAI,CAAC,YAAY,EAAE;QAC3B,OAAO,IAAI,CAAC;KACb;IACD,MAAM,kBAAkB,GAAiD,WAAW,CAClF,oBAAoB,EACpB,QAAQ,EACR,OAAO,CACR,CAAC;IACF,OAAO,CACL,KAAC,kBAAkB,IACjB,EAAE,EAAE,OAAO,CAAI,QAAQ,CAAC,EACxB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseInputTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
4
|
+
* It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
|
|
5
|
+
* It can be customized/overridden for other themes or individual implementations as needed.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The `WidgetProps` for this template
|
|
8
|
+
*/
|
|
9
|
+
export default function BaseInputTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: BaseInputTemplateProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { ariaDescribedByIds, examplesId, getInputProps, } from '@rjsf/utils';
|
|
5
|
+
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
6
|
+
* It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
|
|
7
|
+
* It can be customized/overridden for other themes or individual implementations as needed.
|
|
8
|
+
*
|
|
9
|
+
* @param props - The `WidgetProps` for this template
|
|
10
|
+
*/
|
|
11
|
+
export default function BaseInputTemplate(props) {
|
|
12
|
+
const { id, name, // remove this from ...rest
|
|
13
|
+
value, readonly, disabled, autofocus, onBlur, onFocus, onChange, onChangeOverride, options, schema, uiSchema, formContext, registry, rawErrors, type, hideLabel, // remove this from ...rest
|
|
14
|
+
hideError } = props, // remove this from ...rest
|
|
15
|
+
rest = __rest(props, ["id", "name", "value", "readonly", "disabled", "autofocus", "onBlur", "onFocus", "onChange", "onChangeOverride", "options", "schema", "uiSchema", "formContext", "registry", "rawErrors", "type", "hideLabel", "hideError"]);
|
|
16
|
+
// Note: since React 15.2.0 we can't forward unknown element attributes, so we
|
|
17
|
+
// exclude the "options" and "schema" ones here.
|
|
18
|
+
if (!id) {
|
|
19
|
+
console.log('No id for', props);
|
|
20
|
+
throw new Error(`no id for props ${JSON.stringify(props)}`);
|
|
21
|
+
}
|
|
22
|
+
const inputProps = Object.assign(Object.assign({}, rest), getInputProps(schema, type, options));
|
|
23
|
+
let inputValue;
|
|
24
|
+
if (inputProps.type === 'number' || inputProps.type === 'integer') {
|
|
25
|
+
inputValue = value || value === 0 ? value : '';
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
inputValue = value == null ? '' : value;
|
|
29
|
+
}
|
|
30
|
+
const _onChange = useCallback(({ target: { value } }) => onChange(value === '' ? options.emptyValue : value), [onChange, options]);
|
|
31
|
+
const _onBlur = useCallback(({ target: { value } }) => onBlur(id, value), [onBlur, id]);
|
|
32
|
+
const _onFocus = useCallback(({ target: { value } }) => onFocus(id, value), [onFocus, id]);
|
|
33
|
+
return (_jsxs(_Fragment, { children: [_jsx("input", Object.assign({ id: id, name: id, className: 'form-control', readOnly: readonly, disabled: disabled, autoFocus: autofocus, value: inputValue }, inputProps, { list: schema.examples ? examplesId(id) : undefined, onChange: onChangeOverride || _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) })), Array.isArray(schema.examples) && (_jsx("datalist", Object.assign({ id: examplesId(id) }, { children: schema.examples
|
|
34
|
+
.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : [])
|
|
35
|
+
.map((example) => {
|
|
36
|
+
return _jsx("option", { value: example }, example);
|
|
37
|
+
}) }), `datalist_${id}`))] }));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=BaseInputTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseInputTemplate.js","sourceRoot":"","sources":["../../../src/components/templates/BaseInputTemplate.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAA2B,WAAW,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EACL,kBAAk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M,CAAC,OAAO,CAAc,CAAC,CAAC,CAAC,EAAE,CAAC;qBACzG,GAAG,CAAC,CAAC,OAAY,EAAE,EAAE;oBACpB,OAAO,iBAAsB,KAAK,EAAE,OAAO,IAAvB,OAAO,CAAoB,CAAC;gBAClD,CAAC,CAAC,KALS,YAAY,EAAE,EAAE,CAMpB,CACZ,IACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `AddButton` renders a button that represent the `Add` action on a form
|
|
4
|
+
*/
|
|
5
|
+
export default function AddButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ className, onClick, disabled, registry, }: IconButtonProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TranslatableString } from '@rjsf/utils';
|
|
3
|
+
import IconButton from './IconButton';
|
|
4
|
+
/** The `AddButton` renders a button that represent the `Add` action on a form
|
|
5
|
+
*/
|
|
6
|
+
export default function AddButton({ className, onClick, disabled, registry, }) {
|
|
7
|
+
const { translateString } = registry;
|
|
8
|
+
return (_jsx("div", Object.assign({ className: 'row' }, { children: _jsx("p", Object.assign({ className: `col-xs-3 col-xs-offset-9 text-right ${className}` }, { children: _jsx(IconButton, { iconType: 'info', icon: 'plus', className: 'btn-add col-xs-12', title: translateString(TranslatableString.AddButton), onClick: onClick, disabled: disabled, registry: registry }) })) })));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=AddButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddButton.js","sourceRoot":"","sources":["../../../../src/components/templates/ButtonTemplates/AddButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjH,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC;GACG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAoF,EACnH,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAQ,GACiB;IACzB,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IACrC,OAAO,CACL,4BAAK,SAAS,EAAC,KAAK,gBAClB,0BAAG,SAAS,EAAE,uCAAuC,SAAS,EAAE,gBAC9D,KAAC,UAAU,IACT,QAAQ,EAAC,MAAM,EACf,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,mBAAmB,EAC7B,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,SAAS,CAAC,EACpD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,IACA,IACA,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
export default function IconButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): JSX.Element;
|
|
4
|
+
export declare function CopyButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): JSX.Element;
|
|
5
|
+
export declare function MoveDownButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): JSX.Element;
|
|
6
|
+
export declare function MoveUpButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): JSX.Element;
|
|
7
|
+
export declare function RemoveButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { TranslatableString } from '@rjsf/utils';
|
|
4
|
+
export default function IconButton(props) {
|
|
5
|
+
const { iconType = 'default', icon, className, uiSchema, registry } = props, otherProps = __rest(props, ["iconType", "icon", "className", "uiSchema", "registry"]);
|
|
6
|
+
return (_jsx("button", Object.assign({ type: 'button', className: `btn btn-${iconType} ${className}` }, otherProps, { children: _jsx("i", { className: `glyphicon glyphicon-${icon}` }) })));
|
|
7
|
+
}
|
|
8
|
+
export function CopyButton(props) {
|
|
9
|
+
const { registry: { translateString }, } = props;
|
|
10
|
+
return (_jsx(IconButton, Object.assign({ title: translateString(TranslatableString.CopyButton), className: 'array-item-copy' }, props, { icon: 'copy' })));
|
|
11
|
+
}
|
|
12
|
+
export function MoveDownButton(props) {
|
|
13
|
+
const { registry: { translateString }, } = props;
|
|
14
|
+
return (_jsx(IconButton, Object.assign({ title: translateString(TranslatableString.MoveDownButton), className: 'array-item-move-down' }, props, { icon: 'arrow-down' })));
|
|
15
|
+
}
|
|
16
|
+
export function MoveUpButton(props) {
|
|
17
|
+
const { registry: { translateString }, } = props;
|
|
18
|
+
return (_jsx(IconButton, Object.assign({ title: translateString(TranslatableString.MoveUpButton), className: 'array-item-move-up' }, props, { icon: 'arrow-up' })));
|
|
19
|
+
}
|
|
20
|
+
export function RemoveButton(props) {
|
|
21
|
+
const { registry: { translateString }, } = props;
|
|
22
|
+
return (_jsx(IconButton, Object.assign({ title: translateString(TranslatableString.RemoveButton), className: 'array-item-remove' }, props, { iconType: 'danger', icon: 'remove' })));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=IconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../../src/components/templates/ButtonTemplates/IconButton.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAkE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjH,MAAM,CAAC,OAAO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,MAAM,UAAU,YAAY,CAC1B,KAA+B;IAE/B,MAAM,EACJ,QAAQ,EAAE,EAAE,eAAe,EAAE,GAC9B,GAAG,KAAK,CAAC;IACV,OAAO,CACL,KAAC,UAAU,kBACT,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,YAAY,CAAC,EACvD,SAAS,EAAC,mBAAmB,IACzB,KAAK,IACT,QAAQ,EAAC,QAAQ,EACjB,IAAI,EAAC,QAAQ,IACb,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, SubmitButtonProps } from '@rjsf/utils';
|
|
3
|
+
/** The `SubmitButton` renders a button that represent the `Submit` action on a form
|
|
4
|
+
*/
|
|
5
|
+
export default function SubmitButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ uiSchema }: SubmitButtonProps<T, S, F>): JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getSubmitButtonOptions } from '@rjsf/utils';
|
|
3
|
+
/** The `SubmitButton` renders a button that represent the `Submit` action on a form
|
|
4
|
+
*/
|
|
5
|
+
export default function SubmitButton({ uiSchema }) {
|
|
6
|
+
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
7
|
+
if (norender) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
return (_jsx("div", { children: _jsx("button", Object.assign({ type: 'submit' }, submitButtonProps, { className: `btn btn-info ${submitButtonProps.className || ''}` }, { children: submitText })) }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=SubmitButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubmitButton.js","sourceRoot":"","sources":["../../../../src/components/templates/ButtonTemplates/SubmitButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAoE,MAAM,aAAa,CAAC;AAEvH;GACG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAIlC,EAAE,QAAQ,EAA8B;IACxC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,iBAAiB,GAAG,EAAE,EAAE,GAAG,sBAAsB,CAAU,QAAQ,CAAC,CAAC;IAC1G,IAAI,QAAQ,EAAE;QACZ,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,wBACE,+BAAQ,IAAI,EAAC,QAAQ,IAAK,iBAAiB,IAAE,SAAS,EAAE,gBAAgB,iBAAiB,CAAC,SAAS,IAAI,EAAE,EAAE,gBACxG,UAAU,IACJ,GACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
|
|
2
|
+
declare function buttonTemplates<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(): TemplatesType<T, S, F>['ButtonTemplates'];
|
|
3
|
+
export default buttonTemplates;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import SubmitButton from './SubmitButton';
|
|
2
|
+
import AddButton from './AddButton';
|
|
3
|
+
import { CopyButton, MoveDownButton, MoveUpButton, RemoveButton } from './IconButton';
|
|
4
|
+
function buttonTemplates() {
|
|
5
|
+
return {
|
|
6
|
+
SubmitButton,
|
|
7
|
+
AddButton,
|
|
8
|
+
CopyButton,
|
|
9
|
+
MoveDownButton,
|
|
10
|
+
MoveUpButton,
|
|
11
|
+
RemoveButton,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export default buttonTemplates;
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/templates/ButtonTemplates/index.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEtF,SAAS,eAAe;IAKtB,OAAO;QACL,YAAY;QACZ,SAAS;QACT,UAAU;QACV,cAAc;QACd,YAAY;QACZ,YAAY;KACb,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `DescriptionField` is the template to use to render the description of a field
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `DescriptionFieldProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function DescriptionField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: DescriptionFieldProps<T, S, F>): JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** The `DescriptionField` is the template to use to render the description of a field
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `DescriptionFieldProps` for this component
|
|
5
|
+
*/
|
|
6
|
+
export default function DescriptionField(props) {
|
|
7
|
+
const { id, description } = props;
|
|
8
|
+
if (!description) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
if (typeof description === 'string') {
|
|
12
|
+
return (_jsx("p", Object.assign({ id: id, className: 'field-description' }, { children: description })));
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
return (_jsx("div", Object.assign({ id: id, className: 'field-description' }, { children: description })));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=DescriptionField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DescriptionField.js","sourceRoot":"","sources":["../../../src/components/templates/DescriptionField.tsx"],"names":[],"mappings":";AAEA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAItC,KAAqC;IACrC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAClC,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACnC,OAAO,CACL,0BAAG,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,mBAAmB,gBACrC,WAAW,IACV,CACL,CAAC;KACH;SAAM;QACL,OAAO,CACL,4BAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,mBAAmB,gBACvC,WAAW,IACR,CACP,CAAC;KACH;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ErrorListProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `ErrorListProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function ErrorList<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ errors, registry, }: ErrorListProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TranslatableString, } from '@rjsf/utils';
|
|
3
|
+
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `ErrorListProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function ErrorList({ errors, registry, }) {
|
|
8
|
+
const { translateString } = registry;
|
|
9
|
+
return (_jsxs("div", Object.assign({ className: 'panel panel-danger errors' }, { children: [_jsx("div", Object.assign({ className: 'panel-heading' }, { children: _jsx("h3", Object.assign({ className: 'panel-title' }, { children: translateString(TranslatableString.ErrorsLabel) })) })), _jsx("ul", Object.assign({ className: 'list-group' }, { children: errors.map((error, i) => {
|
|
10
|
+
return (_jsx("li", Object.assign({ className: 'list-group-item text-danger' }, { children: error.stack }), i));
|
|
11
|
+
}) }))] })));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ErrorList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorList.js","sourceRoot":"","sources":["../../../src/components/templates/ErrorList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAML,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAoF,EACnH,MAAM,EACN,QAAQ,GACgB;IACxB,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IACrC,OAAO,CACL,6BAAK,SAAS,EAAC,2BAA2B,iBACxC,4BAAK,SAAS,EAAC,eAAe,gBAC5B,2BAAI,SAAS,EAAC,aAAa,gBAAE,eAAe,CAAC,kBAAkB,CAAC,WAAW,CAAC,IAAM,IAC9E,EACN,2BAAI,SAAS,EAAC,YAAY,gBACvB,MAAM,CAAC,GAAG,CAAC,CAAC,KAA0B,EAAE,CAAS,EAAE,EAAE;oBACpD,OAAO,CACL,2BAAY,SAAS,EAAC,6BAA6B,gBAChD,KAAK,CAAC,KAAK,KADL,CAAC,CAEL,CACN,CAAC;gBACJ,CAAC,CAAC,IACC,KACD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `FieldErrorProps` for the errors being rendered
|
|
6
|
+
*/
|
|
7
|
+
export default function FieldErrorTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: FieldErrorProps<T, S, F>): JSX.Element | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { errorId } from '@rjsf/utils';
|
|
3
|
+
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `FieldErrorProps` for the errors being rendered
|
|
6
|
+
*/
|
|
7
|
+
export default function FieldErrorTemplate(props) {
|
|
8
|
+
const { errors = [], idSchema } = props;
|
|
9
|
+
if (errors.length === 0) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const id = errorId(idSchema);
|
|
13
|
+
return (_jsx("div", { children: _jsx("ul", Object.assign({ id: id, className: 'error-detail bs-callout bs-callout-info' }, { children: errors
|
|
14
|
+
.filter((elem) => !!elem)
|
|
15
|
+
.map((error, index) => {
|
|
16
|
+
return (_jsx("li", Object.assign({ className: 'text-danger' }, { children: error }), index));
|
|
17
|
+
}) })) }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=FieldErrorTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldErrorTemplate.js","sourceRoot":"","sources":["../../../src/components/templates/FieldErrorTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAkE,MAAM,aAAa,CAAC;AAEtG;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAIxC,KAA+B;IAC/B,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QACvB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,EAAE,GAAG,OAAO,CAAI,QAAQ,CAAC,CAAC;IAEhC,OAAO,CACL,wBACE,2BAAI,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,yCAAyC,gBAC5D,MAAM;iBACJ,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;iBACxB,GAAG,CAAC,CAAC,KAAK,EAAE,KAAa,EAAE,EAAE;gBAC5B,OAAO,CACL,2BAAI,SAAS,EAAC,aAAa,gBACxB,KAAK,KADyB,KAAK,CAEjC,CACN,CAAC;YACJ,CAAC,CAAC,IACD,GACD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `FieldHelpTemplate` component renders any help desired for a field
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `FieldHelpProps` to be rendered
|
|
6
|
+
*/
|
|
7
|
+
export default function FieldHelpTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: FieldHelpProps<T, S, F>): JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { helpId } from '@rjsf/utils';
|
|
3
|
+
/** The `FieldHelpTemplate` component renders any help desired for a field
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `FieldHelpProps` to be rendered
|
|
6
|
+
*/
|
|
7
|
+
export default function FieldHelpTemplate(props) {
|
|
8
|
+
const { idSchema, help } = props;
|
|
9
|
+
if (!help) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const id = helpId(idSchema);
|
|
13
|
+
if (typeof help === 'string') {
|
|
14
|
+
return (_jsx("p", Object.assign({ id: id, className: 'help-block' }, { children: help })));
|
|
15
|
+
}
|
|
16
|
+
return (_jsx("div", Object.assign({ id: id, className: 'help-block' }, { children: help })));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=FieldHelpTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldHelpTemplate.js","sourceRoot":"","sources":["../../../src/components/templates/FieldHelpTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAiE,MAAM,aAAa,CAAC;AAEpG;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAIvC,KAA8B;IAC9B,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACjC,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,IAAI,CAAC;KACb;IACD,MAAM,EAAE,GAAG,MAAM,CAAI,QAAQ,CAAC,CAAC;IAC/B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,CACL,0BAAG,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,YAAY,gBAC9B,IAAI,IACH,CACL,CAAC;KACH;IACD,OAAO,CACL,4BAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,YAAY,gBAChC,IAAI,IACD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
|
|
4
|
+
* content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `FieldTemplateProps` for this component
|
|
7
|
+
*/
|
|
8
|
+
export default function FieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: FieldTemplateProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getTemplate, getUiOptions, } from '@rjsf/utils';
|
|
3
|
+
import Label from './Label';
|
|
4
|
+
/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
|
|
5
|
+
* content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The `FieldTemplateProps` for this component
|
|
8
|
+
*/
|
|
9
|
+
export default function FieldTemplate(props) {
|
|
10
|
+
const { id, label, children, errors, help, description, hidden, required, displayLabel, registry, uiSchema } = props;
|
|
11
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
12
|
+
const WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
|
|
13
|
+
if (hidden) {
|
|
14
|
+
return _jsx("div", Object.assign({ className: 'hidden' }, { children: children }));
|
|
15
|
+
}
|
|
16
|
+
return (_jsxs(WrapIfAdditionalTemplate, Object.assign({}, props, { children: [displayLabel && _jsx(Label, { label: label, required: required, id: id }), displayLabel && description ? description : null, children, errors, help] })));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=FieldTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldTemplate.js","sourceRoot":"","sources":["../../../../src/components/templates/FieldTemplate/FieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAKL,WAAW,EACX,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAInC,KAAkC;IAClC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACrH,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,wBAAwB,GAAG,WAAW,CAC1C,0BAA0B,EAC1B,QAAQ,EACR,SAAS,CACV,CAAC;IACF,IAAI,MAAM,EAAE;QACV,OAAO,4BAAK,SAAS,EAAC,QAAQ,gBAAE,QAAQ,IAAO,CAAC;KACjD;IACD,OAAO,CACL,MAAC,wBAAwB,oBAAK,KAAK,eAChC,YAAY,IAAI,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,GAAI,EACnE,YAAY,IAAI,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAChD,QAAQ,EACR,MAAM,EACN,IAAI,KACoB,CAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type LabelProps = {
|
|
3
|
+
/** The label for the field */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** A boolean value stating if the field is required */
|
|
6
|
+
required?: boolean;
|
|
7
|
+
/** The id of the input field being labeled */
|
|
8
|
+
id?: string;
|
|
9
|
+
};
|
|
10
|
+
/** Renders a label for a field
|
|
11
|
+
*
|
|
12
|
+
* @param props - The `LabelProps` for this component
|
|
13
|
+
*/
|
|
14
|
+
export default function Label(props: LabelProps): JSX.Element | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const REQUIRED_FIELD_SYMBOL = '*';
|
|
3
|
+
/** Renders a label for a field
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `LabelProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function Label(props) {
|
|
8
|
+
const { label, required, id } = props;
|
|
9
|
+
if (!label) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return (_jsxs("label", Object.assign({ className: 'control-label', htmlFor: id }, { children: [label, required && _jsx("span", Object.assign({ className: 'required' }, { children: REQUIRED_FIELD_SYMBOL }))] })));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=Label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../../src/components/templates/FieldTemplate/Label.tsx"],"names":[],"mappings":";AAAA,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAWlC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAiB;IAC7C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IACtC,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,+BAAO,SAAS,EAAC,eAAe,EAAC,OAAO,EAAE,EAAE,iBACzC,KAAK,EACL,QAAQ,IAAI,6BAAM,SAAS,EAAC,UAAU,gBAAE,qBAAqB,IAAQ,KAChE,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/templates/FieldTemplate/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, ObjectFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
|
|
4
|
+
* title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
|
|
5
|
+
* the properties.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The `ObjectFieldTemplateProps` for this component
|
|
8
|
+
*/
|
|
9
|
+
export default function ObjectFieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: ObjectFieldTemplateProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { canExpand, descriptionId, getTemplate, getUiOptions, titleId, } from '@rjsf/utils';
|
|
3
|
+
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
|
|
4
|
+
* title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
|
|
5
|
+
* the properties.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The `ObjectFieldTemplateProps` for this component
|
|
8
|
+
*/
|
|
9
|
+
export default function ObjectFieldTemplate(props) {
|
|
10
|
+
const { description, disabled, formData, idSchema, onAddClick, properties, readonly, registry, required, schema, title, uiSchema, } = props;
|
|
11
|
+
const options = getUiOptions(uiSchema);
|
|
12
|
+
const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, options);
|
|
13
|
+
const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, options);
|
|
14
|
+
// Button templates are not overridden in the uiSchema
|
|
15
|
+
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
16
|
+
return (_jsxs("fieldset", Object.assign({ id: idSchema.$id }, { children: [title && (_jsx(TitleFieldTemplate, { id: titleId(idSchema), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry })), description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(idSchema), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), properties.map((prop) => prop.content), canExpand(schema, uiSchema, formData) && (_jsx(AddButton, { className: 'object-property-expand', onClick: onAddClick(schema), disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }))] })));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ObjectFieldTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectFieldTemplate.js","sourceRoot":"","sources":["../../../src/components/templates/ObjectFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAML,SAAS,EACT,aAAa,EACb,WAAW,EACX,YAAY,EACZ,OAAO,GACR,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAIzC,KAAwC;IACxC,MAAM,EACJ,WAAW,EACX,QAAQ,E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B,QAAQ,EAAE,QAAQ,GAClB,CACH,KACQ,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, TitleFieldProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `TitleField` is the template to use to render the title of a field
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `TitleFieldProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function TitleField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: TitleFieldProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const REQUIRED_FIELD_SYMBOL = '*';
|
|
3
|
+
/** The `TitleField` is the template to use to render the title of a field
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `TitleFieldProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function TitleField(props) {
|
|
8
|
+
const { id, title, required } = props;
|
|
9
|
+
return (_jsxs("legend", Object.assign({ id: id }, { children: [title, required && _jsx("span", Object.assign({ className: 'required' }, { children: REQUIRED_FIELD_SYMBOL }))] })));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=TitleField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TitleField.js","sourceRoot":"","sources":["../../../src/components/templates/TitleField.tsx"],"names":[],"mappings":";AAEA,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,KAA+B;IAE/B,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACtC,OAAO,CACL,gCAAQ,EAAE,EAAE,EAAE,iBACX,KAAK,EACL,QAAQ,IAAI,6BAAM,SAAS,EAAC,UAAU,gBAAE,qBAAqB,IAAQ,KAC/D,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, UnsupportedFieldProps } from '@rjsf/utils';
|
|
3
|
+
/** The `UnsupportedField` component is used to render a field in the schema is one that is not supported by
|
|
4
|
+
* react-jsonschema-form.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `FieldProps` for this template
|
|
7
|
+
*/
|
|
8
|
+
declare function UnsupportedField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: UnsupportedFieldProps<T, S, F>): JSX.Element;
|
|
9
|
+
export default UnsupportedField;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TranslatableString } from '@rjsf/utils';
|
|
3
|
+
import Markdown from 'markdown-to-jsx';
|
|
4
|
+
/** The `UnsupportedField` component is used to render a field in the schema is one that is not supported by
|
|
5
|
+
* react-jsonschema-form.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The `FieldProps` for this template
|
|
8
|
+
*/
|
|
9
|
+
function UnsupportedField(props) {
|
|
10
|
+
const { schema, idSchema, reason, registry } = props;
|
|
11
|
+
const { translateString } = registry;
|
|
12
|
+
let translateEnum = TranslatableString.UnsupportedField;
|
|
13
|
+
const translateParams = [];
|
|
14
|
+
if (idSchema && idSchema.$id) {
|
|
15
|
+
translateEnum = TranslatableString.UnsupportedFieldWithId;
|
|
16
|
+
translateParams.push(idSchema.$id);
|
|
17
|
+
}
|
|
18
|
+
if (reason) {
|
|
19
|
+
translateEnum =
|
|
20
|
+
translateEnum === TranslatableString.UnsupportedField
|
|
21
|
+
? TranslatableString.UnsupportedFieldWithReason
|
|
22
|
+
: TranslatableString.UnsupportedFieldWithIdAndReason;
|
|
23
|
+
translateParams.push(reason);
|
|
24
|
+
}
|
|
25
|
+
return (_jsxs("div", Object.assign({ className: 'unsupported-field' }, { children: [_jsx("p", { children: _jsx(Markdown, { children: translateString(translateEnum, translateParams) }) }), schema && _jsx("pre", { children: JSON.stringify(schema, null, 2) })] })));
|
|
26
|
+
}
|
|
27
|
+
export default UnsupportedField;
|
|
28
|
+
//# sourceMappingURL=UnsupportedField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedField.js","sourceRoot":"","sources":["../../../src/components/templates/UnsupportedField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAiD,kBAAkB,EAAyB,MAAM,aAAa,CAAC;AACvH,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC;;;;GAIG;AACH,SAAS,gBAAgB,CACvB,KAAqC;IAErC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACrD,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IACrC,IAAI,aAAa,GAAuB,kBAAkB,CAAC,gBAAgB,CAAC;IAC5E,MAAM,eAAe,GAAa,EAAE,CAAC;IACrC,IAAI,QAAQ,IAAI,QAAQ,CAAC,GAAG,EAAE;QAC5B,aAAa,GAAG,kBAAkB,CAAC,sBAAsB,CAAC;QAC1D,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;KACpC;IACD,IAAI,MAAM,EAAE;QACV,aAAa;YACX,aAAa,KAAK,kBAAkB,CAAC,gBAAgB;gBACnD,CAAC,CAAC,kBAAkB,CAAC,0BAA0B;gBAC/C,CAAC,CAAC,kBAAkB,CAAC,+BAA+B,CAAC;QACzD,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC9B;IACD,OAAO,CACL,6BAAK,SAAS,EAAC,mBAAmB,iBAChC,sBACE,KAAC,QAAQ,cAAE,eAAe,CAAC,aAAa,EAAE,eAAe,CAAC,GAAY,GACpE,EACH,MAAM,IAAI,wBAAM,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAO,KACnD,CACP,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, WrapIfAdditionalTemplateProps } from '@rjsf/utils';
|
|
3
|
+
/** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
|
|
4
|
+
* part of an `additionalProperties` part of a schema.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `WrapIfAdditionalProps` for this component
|
|
7
|
+
*/
|
|
8
|
+
export default function WrapIfAdditionalTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WrapIfAdditionalTemplateProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ADDITIONAL_PROPERTY_FLAG, TranslatableString, } from '@rjsf/utils';
|
|
3
|
+
import Label from './FieldTemplate/Label';
|
|
4
|
+
/** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
|
|
5
|
+
* part of an `additionalProperties` part of a schema.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The `WrapIfAdditionalProps` for this component
|
|
8
|
+
*/
|
|
9
|
+
export default function WrapIfAdditionalTemplate(props) {
|
|
10
|
+
const { id, classNames, style, disabled, label, onKeyChange, onDropPropertyClick, readonly, required, schema, children, uiSchema, registry, } = props;
|
|
11
|
+
const { templates, translateString } = registry;
|
|
12
|
+
// Button templates are not overridden in the uiSchema
|
|
13
|
+
const { RemoveButton } = templates.ButtonTemplates;
|
|
14
|
+
const keyLabel = translateString(TranslatableString.KeyLabel, [label]);
|
|
15
|
+
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
16
|
+
if (!additional) {
|
|
17
|
+
return (_jsx("div", Object.assign({ className: classNames, style: style }, { children: children })));
|
|
18
|
+
}
|
|
19
|
+
return (_jsx("div", Object.assign({ className: classNames, style: style }, { children: _jsxs("div", Object.assign({ className: 'row' }, { children: [_jsx("div", Object.assign({ className: 'col-xs-5 form-additional' }, { children: _jsxs("div", Object.assign({ className: 'form-group' }, { children: [_jsx(Label, { label: keyLabel, required: required, id: `${id}-key` }), _jsx("input", { className: 'form-control', type: 'text', id: `${id}-key`, onBlur: (event) => onKeyChange(event.target.value), defaultValue: label })] })) })), _jsx("div", Object.assign({ className: 'form-additional form-group col-xs-5' }, { children: children })), _jsx("div", Object.assign({ className: 'col-xs-2' }, { children: _jsx(RemoveButton, { className: 'array-item-remove btn-block', style: { border: '0' }, disabled: disabled || readonly, onClick: onDropPropertyClick(label), uiSchema: uiSchema, registry: registry }) }))] })) })));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=WrapIfAdditionalTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrapIfAdditionalTemplate.js","sourceRoot":"","sources":["../../../src/components/templates/WrapIfAdditionalTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,wBAAwB,EAIxB,kBAAkB,GAEnB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAE1C;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAI9C,KAA6C;IAC7C,MAAM,EACJ,EAAE,EACF,UAAU,EACV,KAAK,EACL,QAAQ,EACR,KAAK,EACL,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IAChD,sDAAsD;IACtD,MAAM,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC,eAAe,CAAC;IACnD,MAAM,QAAQ,GAAG,e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