@rjsf/react-bootstrap 6.0.0-beta.8 → 6.0.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/README.md +6 -2
- package/dist/{index.js → index.cjs} +178 -86
- package/dist/index.cjs.map +7 -0
- package/dist/react-bootstrap.esm.js +177 -85
- package/dist/react-bootstrap.esm.js.map +4 -4
- package/dist/react-bootstrap.umd.js +125 -44
- package/lib/AddButton/AddButton.js +1 -1
- package/lib/AddButton/AddButton.js.map +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -2
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +3 -4
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js +2 -2
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +2 -2
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js +2 -2
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +2 -2
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.d.ts +1 -1
- package/lib/FieldTemplate/FieldTemplate.js +2 -2
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/IconButton/IconButton.d.ts +6 -5
- package/lib/IconButton/IconButton.js +1 -1
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.d.ts +2 -0
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js +6 -0
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js.map +1 -0
- package/lib/MultiSchemaFieldTemplate/index.d.ts +2 -0
- package/lib/MultiSchemaFieldTemplate/index.js +3 -0
- package/lib/MultiSchemaFieldTemplate/index.js.map +1 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +3 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.d.ts +10 -0
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +22 -0
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -0
- package/lib/OptionalDataControlsTemplate/index.d.ts +2 -0
- package/lib/OptionalDataControlsTemplate/index.js +3 -0
- package/lib/OptionalDataControlsTemplate/index.js.map +1 -0
- package/lib/RadioWidget/RadioWidget.d.ts +1 -1
- package/lib/RadioWidget/RadioWidget.js +2 -2
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.d.ts +1 -1
- package/lib/SelectWidget/SelectWidget.js +2 -2
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/Templates/Templates.js +4 -0
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/TextareaWidget/TextareaWidget.d.ts +1 -1
- package/lib/TextareaWidget/TextareaWidget.js +2 -2
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
- package/lib/TitleField/TitleField.d.ts +1 -1
- package/lib/TitleField/TitleField.js +9 -2
- package/lib/TitleField/TitleField.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -3
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -16
- package/src/AddButton/AddButton.tsx +1 -1
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +2 -2
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +22 -16
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +5 -4
- package/src/CheckboxWidget/CheckboxWidget.tsx +4 -3
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +15 -3
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +2 -2
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +2 -2
- package/src/FieldTemplate/FieldTemplate.tsx +6 -4
- package/src/IconButton/IconButton.tsx +12 -6
- package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +15 -0
- package/src/MultiSchemaFieldTemplate/index.ts +2 -0
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +10 -6
- package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +47 -0
- package/src/OptionalDataControlsTemplate/index.ts +2 -0
- package/src/RadioWidget/RadioWidget.tsx +3 -2
- package/src/SelectWidget/SelectWidget.tsx +3 -2
- package/src/Templates/Templates.ts +4 -0
- package/src/TextareaWidget/TextareaWidget.tsx +3 -2
- package/src/TitleField/TitleField.tsx +19 -2
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +5 -7
- package/dist/index.js.map +0 -7
|
@@ -6,11 +6,11 @@ import Form from 'react-bootstrap/Form';
|
|
|
6
6
|
* @param props - The `FieldHelpProps` to be rendered
|
|
7
7
|
*/
|
|
8
8
|
export default function FieldHelpTemplate(props) {
|
|
9
|
-
const {
|
|
9
|
+
const { fieldPathId, help, hasErrors } = props;
|
|
10
10
|
if (!help) {
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
|
-
const id = helpId(
|
|
13
|
+
const id = helpId(fieldPathId);
|
|
14
14
|
return (_jsx(Form.Text, { className: hasErrors ? 'text-danger' : 'text-muted', id: id, children: help }));
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=FieldHelpTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldHelpTemplate.js","sourceRoot":"","sources":["../../src/FieldHelpTemplate/FieldHelpTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAiE,MAAM,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAIvC,KAA8B;IAC9B,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"FieldHelpTemplate.js","sourceRoot":"","sources":["../../src/FieldHelpTemplate/FieldHelpTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAiE,MAAM,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAIvC,KAA8B;IAC9B,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC/C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAC/B,OAAO,CACL,KAAC,IAAI,CAAC,IAAI,IAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,YACnE,IAAI,GACK,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
-
export default function FieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, children, displayLabel, rawErrors, errors, help, description, rawDescription, classNames, style, disabled, label, hidden,
|
|
2
|
+
export default function FieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, children, displayLabel, rawErrors, errors, help, description, rawDescription, classNames, style, disabled, label, hidden, onKeyRename, onKeyRenameBlur, onRemoveProperty, readonly, required, schema, uiSchema, registry, }: FieldTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getTemplate, getUiOptions, } from '@rjsf/utils';
|
|
3
3
|
import Form from 'react-bootstrap/Form';
|
|
4
|
-
export default function FieldTemplate({ id, children, displayLabel, rawErrors = [], errors, help, description, rawDescription, classNames, style, disabled, label, hidden,
|
|
4
|
+
export default function FieldTemplate({ id, children, displayLabel, rawErrors = [], errors, help, description, rawDescription, classNames, style, disabled, label, hidden, onKeyRename, onKeyRenameBlur, onRemoveProperty, readonly, required, schema, uiSchema, registry, }) {
|
|
5
5
|
const uiOptions = getUiOptions(uiSchema);
|
|
6
6
|
const WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
|
|
7
7
|
if (hidden) {
|
|
8
8
|
return _jsx("div", { className: 'hidden', children: children });
|
|
9
9
|
}
|
|
10
|
-
return (_jsx(WrapIfAdditionalTemplate, { classNames: classNames, style: style, disabled: disabled, id: id, label: label,
|
|
10
|
+
return (_jsx(WrapIfAdditionalTemplate, { classNames: classNames, style: style, disabled: disabled, id: id, label: label, onKeyRename: onKeyRename, onKeyRenameBlur: onKeyRenameBlur, onRemoveProperty: onRemoveProperty, readonly: readonly, required: required, schema: schema, uiSchema: uiSchema, registry: registry, children: _jsxs(Form.Group, { children: [displayLabel && (_jsxs(Form.Label, { htmlFor: id, className: rawErrors.length > 0 ? 'text-danger' : '', children: [label, required ? '*' : null] })), children, displayLabel && rawDescription && (_jsx(Form.Text, { className: rawErrors.length > 0 ? 'text-danger' : 'text-muted', children: description })), errors, help] }) }));
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=FieldTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldTemplate.js","sourceRoot":"","sources":["../../src/FieldTemplate/FieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,WAAW,EACX,YAAY,GAGb,MAAM,aAAa,CAAC;AACrB,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,MAAM,CAAC,OAAO,UAAU,aAAa,CAInC,EACA,EAAE,EACF,QAAQ,EACR,YAAY,EACZ,SAAS,GAAG,EAAE,EACd,MAAM,EACN,IAAI,EACJ,WAAW,EACX,cAAc,EACd,UAAU,EACV,KAAK,EACL,QAAQ,EACR,KAAK,EACL,MAAM,EACN,
|
|
1
|
+
{"version":3,"file":"FieldTemplate.js","sourceRoot":"","sources":["../../src/FieldTemplate/FieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,WAAW,EACX,YAAY,GAGb,MAAM,aAAa,CAAC;AACrB,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,MAAM,CAAC,OAAO,UAAU,aAAa,CAInC,EACA,EAAE,EACF,QAAQ,EACR,YAAY,EACZ,SAAS,GAAG,EAAE,EACd,MAAM,EACN,IAAI,EACJ,WAAW,EACX,cAAc,EACd,UAAU,EACV,KAAK,EACL,QAAQ,EACR,KAAK,EACL,MAAM,EACN,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,GACoB;IAC5B,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,CAAC;QACX,OAAO,cAAK,SAAS,EAAC,QAAQ,YAAE,QAAQ,GAAO,CAAC;IAClD,CAAC;IACD,OAAO,CACL,KAAC,wBAAwB,IACvB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,YAElB,MAAC,IAAI,CAAC,KAAK,eACR,YAAY,IAAI,CACf,MAAC,IAAI,CAAC,KAAK,IAAC,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAC1E,KAAK,EACL,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IACX,CACd,EACA,QAAQ,EACR,YAAY,IAAI,cAAc,IAAI,CACjC,KAAC,IAAI,CAAC,IAAI,IAAC,SAAS,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,YAAG,WAAW,GAAa,CACrG,EACA,MAAM,EACN,IAAI,IACM,GACY,CAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
import { ButtonProps } from 'react-bootstrap/Button';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
3
|
+
export type BootstrapIconButtonProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> = IconButtonProps<T, S, F> & ButtonProps;
|
|
4
|
+
export default function IconButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: BootstrapIconButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function CopyButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: BootstrapIconButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function MoveDownButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: BootstrapIconButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function MoveUpButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: BootstrapIconButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function RemoveButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: BootstrapIconButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -23,6 +23,6 @@ export function MoveUpButton(props) {
|
|
|
23
23
|
}
|
|
24
24
|
export function RemoveButton(props) {
|
|
25
25
|
const { registry: { translateString }, } = props;
|
|
26
|
-
return (_jsx(IconButton, { title: translateString(TranslatableString.RemoveButton),
|
|
26
|
+
return (_jsx(IconButton, { title: translateString(TranslatableString.RemoveButton), variant: 'danger', ...props, icon: _jsx(IoIosRemove, {}) }));
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=IconButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../src/IconButton/IconButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjH,OAAO,MAAuB,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,WA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CACL,KAAC,UAAU,IAAC,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,cAAc,CAAC,KAAM,KAAK,EAAE,IAAI,EAAE,KAAC,kBAAkB,KAAG,GAAI,CACnH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,KAAwC;IAExC,MAAM,EACJ,QAAQ,EAAE,EAAE,eAAe,EAAE,GAC9B,GAAG,KAAK,CAAC;IACV,OAAO,KAAC,UAAU,IAAC,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,YAAY,CAAC,KAAM,KAAK,EAAE,IAAI,EAAE,KAAC,gBAAgB,KAAG,GAAI,CAAC;AACxH,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,KAAwC;IAExC,MAAM,EACJ,QAAQ,EAAE,EAAE,eAAe,EAAE,GAC9B,GAAG,KAAK,CAAC;IACV,OAAO,CACL,KAAC,UAAU,IACT,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,YAAY,CAAC,EACvD,OAAO,EAAC,QAAQ,KACZ,KAAK,EACT,IAAI,EAAE,KAAC,WAAW,KAAG,GACrB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { FormContextType, MultiSchemaFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
export default function MultiSchemaFieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ selector, optionSchemaField }: MultiSchemaFieldTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Card from 'react-bootstrap/Card';
|
|
3
|
+
export default function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
|
|
4
|
+
return (_jsxs(Card, { style: { marginBottom: '1rem' }, children: [_jsx(Card.Body, { children: selector }), _jsx(Card.Body, { children: optionSchemaField })] }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=MultiSchemaFieldTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiSchemaFieldTemplate.js","sourceRoot":"","sources":["../../src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAI9C,EAAE,QAAQ,EAAE,iBAAiB,EAA0C;IACvE,OAAO,CACL,MAAC,IAAI,IAAC,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,aACnC,KAAC,IAAI,CAAC,IAAI,cAAE,QAAQ,GAAa,EACjC,KAAC,IAAI,CAAC,IAAI,cAAE,iBAAiB,GAAa,IACrC,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/MultiSchemaFieldTemplate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,cAAc,4BAA4B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FormContextType, ObjectFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
-
export default function ObjectFieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ description, title, properties, required, uiSchema,
|
|
2
|
+
export default function ObjectFieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ description, title, properties, required, uiSchema, fieldPathId, schema, formData, optionalDataControl, onAddProperty, disabled, readonly, registry, }: ObjectFieldTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,12 +3,13 @@ import Row from 'react-bootstrap/Row';
|
|
|
3
3
|
import Col from 'react-bootstrap/Col';
|
|
4
4
|
import Container from 'react-bootstrap/Container';
|
|
5
5
|
import { buttonId, canExpand, descriptionId, getTemplate, getUiOptions, titleId, } from '@rjsf/utils';
|
|
6
|
-
export default function ObjectFieldTemplate({ description, title, properties, required, uiSchema,
|
|
6
|
+
export default function ObjectFieldTemplate({ description, title, properties, required, uiSchema, fieldPathId, schema, formData, optionalDataControl, onAddProperty, disabled, readonly, registry, }) {
|
|
7
7
|
const uiOptions = getUiOptions(uiSchema);
|
|
8
8
|
const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, uiOptions);
|
|
9
9
|
const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
|
|
10
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
10
11
|
// Button templates are not overridden in the uiSchema
|
|
11
12
|
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
12
|
-
return (_jsxs(_Fragment, { children: [title && (_jsx(TitleFieldTemplate, { id: titleId(
|
|
13
|
+
return (_jsxs(_Fragment, { children: [title && (_jsx(TitleFieldTemplate, { id: titleId(fieldPathId), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry, optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : undefined })), description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(fieldPathId), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), _jsxs(Container, { fluid: true, className: 'p-0', children: [!showOptionalDataControlInTitle ? optionalDataControl : undefined, properties.map((element, index) => (_jsx(Row, { style: { marginBottom: '10px' }, className: element.hidden ? 'd-none' : undefined, children: _jsxs(Col, { xs: 12, children: [" ", element.content] }) }, index))), canExpand(schema, uiSchema, formData) ? (_jsx(Row, { children: _jsx(Col, { xs: { offset: 9, span: 3 }, className: 'py-4', children: _jsx(AddButton, { id: buttonId(fieldPathId, 'add'), onClick: onAddProperty, disabled: disabled || readonly, className: 'rjsf-object-property-expand', uiSchema: uiSchema, registry: registry }) }) })) : null] })] }));
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=ObjectFieldTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectFieldTemplate.js","sourceRoot":"","sources":["../../src/ObjectFieldTemplate/ObjectFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD,OAAO,EACL,QAAQ,EACR,SAAS,EACT,aAAa,EAEb,WAAW,EACX,YAAY,EAIZ,OAAO,GACR,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAIzC,EACA,WAAW,EACX,KAAK,EACL,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"ObjectFieldTemplate.js","sourceRoot":"","sources":["../../src/ObjectFieldTemplate/ObjectFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD,OAAO,EACL,QAAQ,EACR,SAAS,EACT,aAAa,EAEb,WAAW,EACX,YAAY,EAIZ,OAAO,GACR,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAIzC,EACA,WAAW,EACX,KAAK,EACL,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,MAAM,EACN,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,QAAQ,GAC0B;IAClC,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,kBAAkB,GAAG,WAAW,CAAgC,oBAAoB,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IACjH,MAAM,wBAAwB,GAAG,WAAW,CAC1C,0BAA0B,EAC1B,QAAQ,EACR,SAAS,CACV,CAAC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AAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,EAAC,MAAM,YAC/C,KAAC,SAAS,IACR,EAAE,EAAE,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,EAChC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,SAAS,EAAC,6BAA6B,EACvC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACE,GACF,CACP,CAAC,CAAC,CAAC,IAAI,IACE,IACX,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FormContextType, OptionalDataControlsTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The OptionalDataControlsTemplate renders one of three different states. If
|
|
3
|
+
* there is an `onAddClick()` function, it renders the "Add" button. If there is
|
|
4
|
+
* an `onRemoveClick()` function, it renders the "Remove" button. Otherwise it
|
|
5
|
+
* renders the "No data found" section. All of them use the `label` as either
|
|
6
|
+
* the `title` of buttons or simply outputting it.
|
|
7
|
+
*
|
|
8
|
+
* @param props - The `OptionalDataControlsTemplateProps` for the template
|
|
9
|
+
*/
|
|
10
|
+
export default function OptionalDataControlsTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: OptionalDataControlsTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { BsPlus } from '@react-icons/all-files/bs/BsPlus';
|
|
3
|
+
import IconButton, { RemoveButton } from '../IconButton';
|
|
4
|
+
/** The OptionalDataControlsTemplate renders one of three different states. If
|
|
5
|
+
* there is an `onAddClick()` function, it renders the "Add" button. If there is
|
|
6
|
+
* an `onRemoveClick()` function, it renders the "Remove" button. Otherwise it
|
|
7
|
+
* renders the "No data found" section. All of them use the `label` as either
|
|
8
|
+
* the `title` of buttons or simply outputting it.
|
|
9
|
+
*
|
|
10
|
+
* @param props - The `OptionalDataControlsTemplateProps` for the template
|
|
11
|
+
*/
|
|
12
|
+
export default function OptionalDataControlsTemplate(props) {
|
|
13
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
14
|
+
if (onAddClick) {
|
|
15
|
+
return (_jsx(IconButton, { id: id, registry: registry, className: 'rjsf-add-optional-data', icon: _jsx(BsPlus, {}), onClick: onAddClick, title: label, size: 'sm', variant: 'secondary' }));
|
|
16
|
+
}
|
|
17
|
+
else if (onRemoveClick) {
|
|
18
|
+
return (_jsx(RemoveButton, { id: id, registry: registry, className: 'rjsf-remove-optional-data', onClick: onRemoveClick, title: label, size: 'sm', variant: 'secondary' }));
|
|
19
|
+
}
|
|
20
|
+
return _jsx("em", { id: id, children: label });
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=OptionalDataControlsTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionalDataControlsTemplate.js","sourceRoot":"","sources":["../../src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,OAAO,UAAU,EAAE,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAIlD,KAAiD;IACjD,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IACjE,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CACL,KAAC,UAAU,IACT,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAC,wBAAwB,EAClC,IAAI,EAAE,KAAC,MAAM,KAAG,EAChB,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,WAAW,GACnB,CACH,CAAC;IACJ,CAAC;SAAM,IAAI,aAAa,EAAE,CAAC;QACzB,OAAO,CACL,KAAC,YAAY,IACX,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAC,2BAA2B,EACrC,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,WAAW,GACnB,CACH,CAAC;IACJ,CAAC;IACD,OAAO,aAAI,EAAE,EAAE,EAAE,YAAG,KAAK,GAAM,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/OptionalDataControlsTemplate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,cAAc,gCAAgC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
|
-
export default function RadioWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, options, value, required, disabled, readonly, onChange, onBlur, onFocus, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function RadioWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, htmlName, options, value, required, disabled, readonly, onChange, onBlur, onFocus, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Form from 'react-bootstrap/Form';
|
|
3
3
|
import { ariaDescribedByIds, enumOptionsIsSelected, enumOptionsValueForIndex, optionId, } from '@rjsf/utils';
|
|
4
|
-
export default function RadioWidget({ id, options, value, required, disabled, readonly, onChange, onBlur, onFocus, }) {
|
|
4
|
+
export default function RadioWidget({ id, htmlName, options, value, required, disabled, readonly, onChange, onBlur, onFocus, }) {
|
|
5
5
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
6
6
|
const _onChange = ({ target: { value } }) => onChange(enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
7
7
|
const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
|
|
@@ -11,7 +11,7 @@ export default function RadioWidget({ id, options, value, required, disabled, re
|
|
|
11
11
|
enumOptions.map((option, index) => {
|
|
12
12
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
13
13
|
const checked = enumOptionsIsSelected(option.value, value);
|
|
14
|
-
const radio = (_jsx(Form.Check, { inline: inline, label: option.label, id: optionId(id, index), name: id, type: 'radio', disabled: disabled || itemDisabled || readonly, checked: checked, required: required, value: String(index), onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id) }, index));
|
|
14
|
+
const radio = (_jsx(Form.Check, { inline: inline, label: option.label, id: optionId(id, index), name: htmlName || id, type: 'radio', disabled: disabled || itemDisabled || readonly, checked: checked, required: required, value: String(index), onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id) }, index));
|
|
15
15
|
return radio;
|
|
16
16
|
}) }));
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioWidget.js","sourceRoot":"","sources":["../../src/RadioWidget/RadioWidget.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,sBAAsB,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,QAAQ,GAKT,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,OAAO,UAAU,WAAW,CAAoF,EACrH,EAAE,EACF,OAAO,EACP,KAAK,EACL,QAAQ,E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YACzB,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;YACzB,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBAChC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC9F,MAAM,OAAO,GAAG,qBAAqB,CAAI,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAE9D,MAAM,KAAK,GAAG,CACZ,KAAC,IAAI,CAAC,KAAK,IACT,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EAEvB,IAAI,EAAE,QAAQ,IAAI,EAAE,EACpB,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,IAAI,YAAY,IAAI,QAAQ,EAC9C,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EACpB,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,sBACC,kBAAkB,CAAC,EAAE,CAAC,IAVnC,KAAK,CAWV,CACH,CAAC;gBACF,OAAO,KAAK,CAAC;YACf,CAAC,CAAC,GACO,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
|
-
export default function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ schema, id, options, required, disabled, readonly, value, multiple, autofocus, onChange, onBlur, onFocus, placeholder, rawErrors, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ schema, id, htmlName, options, required, disabled, readonly, value, multiple, autofocus, onChange, onBlur, onFocus, placeholder, rawErrors, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import FormSelect from 'react-bootstrap/FormSelect';
|
|
3
3
|
import { ariaDescribedByIds, enumOptionsIndexForValue, enumOptionsValueForIndex, } from '@rjsf/utils';
|
|
4
|
-
export default function SelectWidget({ schema, id, options, required, disabled, readonly, value, multiple, autofocus, onChange, onBlur, onFocus, placeholder, rawErrors = [], }) {
|
|
4
|
+
export default function SelectWidget({ schema, id, htmlName, options, required, disabled, readonly, value, multiple, autofocus, onChange, onBlur, onFocus, placeholder, rawErrors = [], }) {
|
|
5
5
|
const { enumOptions, enumDisabled, emptyValue: optEmptyValue } = options;
|
|
6
6
|
const emptyValue = multiple ? [] : '';
|
|
7
7
|
function getValue(event, multiple) {
|
|
@@ -17,7 +17,7 @@ export default function SelectWidget({ schema, id, options, required, disabled,
|
|
|
17
17
|
}
|
|
18
18
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
19
19
|
const showPlaceholderOption = !multiple && schema.default === undefined;
|
|
20
|
-
return (_jsxs(FormSelect, { id: id, name: id, value: typeof selectedIndexes === 'undefined' ? emptyValue : selectedIndexes, required: required, multiple: multiple, disabled: disabled || readonly, autoFocus: autofocus, className: rawErrors.length > 0 ? 'is-invalid' : '', onBlur: onBlur &&
|
|
20
|
+
return (_jsxs(FormSelect, { id: id, name: htmlName || id, value: typeof selectedIndexes === 'undefined' ? emptyValue : selectedIndexes, required: required, multiple: multiple, disabled: disabled || readonly, autoFocus: autofocus, className: rawErrors.length > 0 ? 'is-invalid' : '', onBlur: onBlur &&
|
|
21
21
|
((event) => {
|
|
22
22
|
const newValue = getValue(event, multiple);
|
|
23
23
|
onBlur(id, enumOptionsValueForIndex(newValue, enumOptions, optEmptyValue));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectWidget.js","sourceRoot":"","sources":["../../src/SelectWidget/SelectWidget.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,4BAA4B,CAAC;AACpD,OAAO,EACL,kBAAkB,EAElB,wBAAwB,EACxB,wBAAwB,GAIzB,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,OAAO,UAAU,YAAY,CAIlC,EACA,MAAM,EACN,EAAE,EACF,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,WAAW,EACX,SAAS,GAAG,EAAE,GACO;IACrB,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAEzE,MAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAEtC,SAAS,QAAQ,CAAC,KAAqC,EAAE,QAAkB;QACzE,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,EAAE,CAAC,KAAK;iBACZ,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAc,CAAC;iBACjC,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;iBAC9B,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,MAAM,eAAe,GAAG,wBAAwB,CAAI,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IAClF,MAAM,qBAAqB,GAAG,CAAC,QAAQ,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC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/D,WAAmB,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAO,EAAE,CAAS,EAAE,EAAE;gBAC7D,MAAM,QAAQ,GAAQ,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAK,YAAoB,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;gBAChG,OAAO,CACL,iBAAgB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,YAC5D,KAAK,IADK,CAAC,CAEL,CACV,CAAC;YACJ,CAAC,CAAC,IACS,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -9,7 +9,9 @@ import FieldErrorTemplate from '../FieldErrorTemplate';
|
|
|
9
9
|
import FieldHelpTemplate from '../FieldHelpTemplate';
|
|
10
10
|
import FieldTemplate from '../FieldTemplate';
|
|
11
11
|
import GridTemplate from '../GridTemplate';
|
|
12
|
+
import MultiSchemaFieldTemplate from '../MultiSchemaFieldTemplate';
|
|
12
13
|
import ObjectFieldTemplate from '../ObjectFieldTemplate';
|
|
14
|
+
import OptionalDataControlsTemplate from '../OptionalDataControlsTemplate';
|
|
13
15
|
import SubmitButton from '../SubmitButton';
|
|
14
16
|
import TitleField from '../TitleField';
|
|
15
17
|
import WrapIfAdditionalTemplate from '../WrapIfAdditionalTemplate';
|
|
@@ -32,7 +34,9 @@ export function generateTemplates() {
|
|
|
32
34
|
FieldHelpTemplate,
|
|
33
35
|
FieldTemplate,
|
|
34
36
|
GridTemplate,
|
|
37
|
+
MultiSchemaFieldTemplate,
|
|
35
38
|
ObjectFieldTemplate,
|
|
39
|
+
OptionalDataControlsTemplate,
|
|
36
40
|
TitleFieldTemplate: TitleField,
|
|
37
41
|
WrapIfAdditionalTemplate,
|
|
38
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Templates.js","sourceRoot":"","sources":["../../src/Templates/Templates.ts"],"names":[],"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B,CAAC;AACvD,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,wBAAwB,MAAM,6BAA6B,CAAC;AACnE,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AACzD,OAAO,4BAA4B,MAAM,iCAAiC,CAAC;AAC3E,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,wBAAwB,MAAM,6BAA6B,CAAC;AAGnE,MAAM,UAAU,iBAAiB;IAK/B,OAAO;QACL,sBAAsB;QACtB,kBAAkB;QAClB,iBAAiB;QACjB,eAAe,EAAE;YACf,SAAS;YACT,UAAU;YACV,cAAc;YACd,YAAY;YACZ,YAAY;YACZ,YAAY;SACb;QACD,wBAAwB,EAAE,gBAAgB;QAC1C,iBAAiB,EAAE,SAAS;QAC5B,kBAAkB;QAClB,iBAAiB;QACjB,aAAa;QACb,YAAY;QACZ,wBAAwB;QACxB,mBAAmB;QACnB,4BAA4B;QAC5B,kBAAkB,EAAE,UAAU;QAC9B,wBAAwB;KACzB,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,EAAE,CAAC"}
|
|
@@ -2,5 +2,5 @@ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjs
|
|
|
2
2
|
type CustomWidgetProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> = WidgetProps<T, S, F> & {
|
|
3
3
|
options: any;
|
|
4
4
|
};
|
|
5
|
-
export default function TextareaWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, placeholder, value, required, disabled, autofocus, readonly, onBlur, onFocus, onChange, options, }: CustomWidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default function TextareaWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, htmlName, placeholder, value, required, disabled, autofocus, readonly, onBlur, onFocus, onChange, options, }: CustomWidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { ariaDescribedByIds } from '@rjsf/utils';
|
|
3
3
|
import FormControl from 'react-bootstrap/FormControl';
|
|
4
4
|
import InputGroup from 'react-bootstrap/InputGroup';
|
|
5
|
-
export default function TextareaWidget({ id, placeholder, value, required, disabled, autofocus, readonly, onBlur, onFocus, onChange, options, }) {
|
|
5
|
+
export default function TextareaWidget({ id, htmlName, placeholder, value, required, disabled, autofocus, readonly, onBlur, onFocus, onChange, options, }) {
|
|
6
6
|
const _onChange = ({ target: { value } }) => onChange(value === '' ? options.emptyValue : value);
|
|
7
7
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
8
8
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
9
|
-
return (_jsx(InputGroup, { children: _jsx(FormControl, { id: id, name: id, as: 'textarea', placeholder: placeholder, disabled: disabled, readOnly: readonly, value: value, required: required, autoFocus: autofocus, rows: options.rows || 5, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id) }) }));
|
|
9
|
+
return (_jsx(InputGroup, { children: _jsx(FormControl, { id: id, name: htmlName || id, as: 'textarea', placeholder: placeholder, disabled: disabled, readOnly: readonly, value: value, required: required, autoFocus: autofocus, rows: options.rows || 5, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id) }) }));
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=TextareaWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextareaWidget.js","sourceRoot":"","sources":["../../src/TextareaWidget/TextareaWidget.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAA8D,MAAM,aAAa,CAAC;AAC7G,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,UAAU,MAAM,4BAA4B,CAAC;AAUpD,MAAM,CAAC,OAAO,UAAU,cAAc,CAIpC,EACA,EAAE,EACF,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,EACR,OAAO,GACoB;IAC3B,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAoC,EAAE,EAAE,CAC5E,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,CAAC,EAAE,MAAM,EAAmC,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;IACpG,MAAM,QAAQ,GAAG,CAAC,EAAE,MAAM,EAAmC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;IAEtG,OAAO,CACL,KAAC,UAAU,cACT,KAAC,WAAW,IACV,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"TextareaWidget.js","sourceRoot":"","sources":["../../src/TextareaWidget/TextareaWidget.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAA8D,MAAM,aAAa,CAAC;AAC7G,OAAO,WAAW,MAAM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ema, StrictRJSFSchema, TitleFieldProps } from '@rjsf/utils';
|
|
2
|
-
export default function TitleField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, title, uiSchema, }: TitleFieldProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function TitleField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, title, uiSchema, optionalDataControl, }: TitleFieldProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getUiOptions } from '@rjsf/utils';
|
|
3
|
-
|
|
3
|
+
import Row from 'react-bootstrap/Row';
|
|
4
|
+
import Col from 'react-bootstrap/Col';
|
|
5
|
+
import Container from 'react-bootstrap/Container';
|
|
6
|
+
export default function TitleField({ id, title, uiSchema, optionalDataControl, }) {
|
|
4
7
|
const uiOptions = getUiOptions(uiSchema);
|
|
5
|
-
|
|
8
|
+
let heading = _jsx("h5", { children: uiOptions.title || title });
|
|
9
|
+
if (optionalDataControl) {
|
|
10
|
+
heading = (_jsx(Container, { fluid: true, className: 'p-0', children: _jsxs(Row, { children: [_jsx(Col, { xs: '11', children: heading }), _jsx(Col, { xs: '1', style: { marginLeft: '-5px' }, children: optionalDataControl })] }) }));
|
|
11
|
+
}
|
|
12
|
+
return (_jsxs("div", { id: id, className: 'my-1', children: [heading, _jsx("hr", { className: 'border-0 bg-secondary mt-0', style: { height: '1px' } })] }));
|
|
6
13
|
}
|
|
7
14
|
//# sourceMappingURL=TitleField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleField.js","sourceRoot":"","sources":["../../src/TitleField/TitleField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmB,YAAY,EAAiD,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"TitleField.js","sourceRoot":"","sources":["../../src/TitleField/TitleField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmB,YAAY,EAAiD,MAAM,aAAa,CAAC;AAC3G,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAoF,EACpH,EAAE,EACF,KAAK,EACL,QAAQ,EACR,mBAAmB,GACM;IACzB,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,IAAI,OAAO,GAAG,uBAAK,SAAS,CAAC,KAAK,IAAI,KAAK,GAAM,CAAC;IAClD,IAAI,mBAAmB,EAAE,CAAC;QACxB,OAAO,GAAG,CACR,KAAC,SAAS,IAAC,KAAK,QAAC,SAAS,EAAC,KAAK,YAC9B,MAAC,GAAG,eACF,KAAC,GAAG,IAAC,EAAE,EAAC,IAAI,YAAE,OAAO,GAAO,EAC5B,KAAC,GAAG,IAAC,EAAE,EAAC,GAAG,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,YACtC,mBAAmB,GAChB,IACF,GACI,CACb,CAAC;IACJ,CAAC;IACD,OAAO,CACL,eAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,MAAM,aAC1B,OAAO,EACR,aAAI,SAAS,EAAC,4BAA4B,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAI,IACnE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FormContextType, RJSFSchema, StrictRJSFSchema, WrapIfAdditionalTemplateProps } from '@rjsf/utils';
|
|
2
|
-
export default function WrapIfAdditionalTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ classNames, style, children, disabled, id, label,
|
|
2
|
+
export default function WrapIfAdditionalTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ classNames, style, children, disabled, id, label, onRemoveProperty, onKeyRenameBlur, readonly, required, schema, uiSchema, registry, }: WrapIfAdditionalTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { ADDITIONAL_PROPERTY_FLAG, buttonId, TranslatableString, } from '@rjsf/u
|
|
|
3
3
|
import Row from 'react-bootstrap/Row';
|
|
4
4
|
import Col from 'react-bootstrap/Col';
|
|
5
5
|
import Form from 'react-bootstrap/Form';
|
|
6
|
-
export default function WrapIfAdditionalTemplate({ classNames, style, children, disabled, id, label,
|
|
6
|
+
export default function WrapIfAdditionalTemplate({ classNames, style, children, disabled, id, label, onRemoveProperty, onKeyRenameBlur, readonly, required, schema, uiSchema, registry, }) {
|
|
7
7
|
const { templates, translateString } = registry;
|
|
8
8
|
// Button templates are not overridden in the uiSchema
|
|
9
9
|
const { RemoveButton } = templates.ButtonTemplates;
|
|
@@ -12,8 +12,7 @@ export default function WrapIfAdditionalTemplate({ classNames, style, children,
|
|
|
12
12
|
if (!additional) {
|
|
13
13
|
return (_jsx("div", { className: classNames, style: style, children: children }));
|
|
14
14
|
}
|
|
15
|
-
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
16
15
|
const keyId = `${id}-key`;
|
|
17
|
-
return (_jsxs(Row, { className: classNames, style: style, children: [_jsx(Col, { xs: 5, children: _jsxs(Form.Group, { children: [_jsx(Form.Label, { htmlFor: keyId, children: keyLabel }), _jsx(Form.Control, { required: required, defaultValue: label, disabled: disabled || readonly, id: keyId, name: keyId, onBlur: !readonly ?
|
|
16
|
+
return (_jsxs(Row, { className: classNames, style: style, children: [_jsx(Col, { xs: 5, children: _jsxs(Form.Group, { children: [_jsx(Form.Label, { htmlFor: keyId, children: keyLabel }), _jsx(Form.Control, { required: required, defaultValue: label, disabled: disabled || readonly, id: keyId, name: keyId, onBlur: !readonly ? onKeyRenameBlur : undefined, type: 'text' })] }) }), _jsx(Col, { xs: 5, children: children }), _jsx(Col, { xs: 2, className: 'py-4 d-grid gap-2', children: _jsx(RemoveButton, { id: buttonId(id, 'remove'), className: 'rjsf-object-property-remove w-100', disabled: disabled || readonly, onClick: onRemoveProperty, uiSchema: uiSchema, registry: registry }) })] }, keyId));
|
|
18
17
|
}
|
|
19
18
|
//# sourceMappingURL=WrapIfAdditionalTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrapIfAdditionalTemplate.js","sourceRoot":"","sources":["../../src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"WrapIfAdditionalTemplate.js","sourceRoot":"","sources":["../../src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,wBAAwB,EACxB,QAAQ,EAIR,kBAAkB,GAEnB,MAAM,aAAa,CAAC;AAErB,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAI9C,EACA,UAAU,EACV,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,KAAK,EACL,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,GAC+B;IACvC,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,eAAe,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACvE,MAAM,UAAU,GAAG,wBAAwB,IAAI,MAAM,CAAC;IAEtD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,CACL,cAAK,SAAS,EAAE,UAAU,EAAE,KAAK,EAA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