@rjsf/react-bootstrap 6.0.0-beta.19 → 6.0.0-beta.20
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/index.cjs +13 -13
- package/dist/index.cjs.map +2 -2
- package/dist/react-bootstrap.esm.js +13 -13
- package/dist/react-bootstrap.esm.js.map +2 -2
- package/dist/react-bootstrap.umd.js +13 -13
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +3 -3
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- 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/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +5 -5
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +3 -3
- package/src/CheckboxWidget/CheckboxWidget.tsx +2 -2
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +1 -1
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +2 -2
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +2 -2
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +4 -4
- package/src/RadioWidget/RadioWidget.tsx +1 -1
- package/src/SelectWidget/SelectWidget.tsx +1 -1
- package/src/TextareaWidget/TextareaWidget.tsx +1 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rjsf/react-bootstrap",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.20",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@rjsf/core": "^6.0.0-beta.
|
|
65
|
-
"@rjsf/utils": "^6.0.0-beta.
|
|
64
|
+
"@rjsf/core": "^6.0.0-beta.20",
|
|
65
|
+
"@rjsf/utils": "^6.0.0-beta.20",
|
|
66
66
|
"react": ">=18",
|
|
67
67
|
"react-bootstrap": "^2.x"
|
|
68
68
|
},
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
"node": ">=20"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@rjsf/core": "^6.0.0-beta.
|
|
75
|
-
"@rjsf/snapshot-tests": "^6.0.0-beta.
|
|
76
|
-
"@rjsf/utils": "^6.0.0-beta.
|
|
77
|
-
"@rjsf/validator-ajv8": "^6.0.0-beta.
|
|
74
|
+
"@rjsf/core": "^6.0.0-beta.20",
|
|
75
|
+
"@rjsf/snapshot-tests": "^6.0.0-beta.20",
|
|
76
|
+
"@rjsf/utils": "^6.0.0-beta.20",
|
|
77
|
+
"@rjsf/validator-ajv8": "^6.0.0-beta.20",
|
|
78
78
|
"eslint": "^8.57.1",
|
|
79
79
|
"react-bootstrap": "^2.10.10"
|
|
80
80
|
},
|
|
@@ -17,7 +17,7 @@ export default function ArrayFieldTemplate<
|
|
|
17
17
|
S extends StrictRJSFSchema = RJSFSchema,
|
|
18
18
|
F extends FormContextType = any,
|
|
19
19
|
>(props: ArrayFieldTemplateProps<T, S, F>) {
|
|
20
|
-
const { canAdd, disabled,
|
|
20
|
+
const { canAdd, disabled, fieldPathId, uiSchema, items, onAddClick, readonly, registry, required, schema, title } =
|
|
21
21
|
props;
|
|
22
22
|
const uiOptions = getUiOptions<T, S, F>(uiSchema);
|
|
23
23
|
const ArrayFieldDescriptionTemplate = getTemplate<'ArrayFieldDescriptionTemplate', T, S, F>(
|
|
@@ -44,7 +44,7 @@ export default function ArrayFieldTemplate<
|
|
|
44
44
|
<Row className='p-0 m-0'>
|
|
45
45
|
<Col className='p-0 m-0'>
|
|
46
46
|
<ArrayFieldTitleTemplate
|
|
47
|
-
|
|
47
|
+
fieldPathId={fieldPathId}
|
|
48
48
|
title={uiOptions.title || title}
|
|
49
49
|
schema={schema}
|
|
50
50
|
uiSchema={uiSchema}
|
|
@@ -52,13 +52,13 @@ export default function ArrayFieldTemplate<
|
|
|
52
52
|
registry={registry}
|
|
53
53
|
/>
|
|
54
54
|
<ArrayFieldDescriptionTemplate
|
|
55
|
-
|
|
55
|
+
fieldPathId={fieldPathId}
|
|
56
56
|
description={uiOptions.description || schema.description}
|
|
57
57
|
schema={schema}
|
|
58
58
|
uiSchema={uiSchema}
|
|
59
59
|
registry={registry}
|
|
60
60
|
/>
|
|
61
|
-
<Container fluid key={`array-item-list-${
|
|
61
|
+
<Container fluid key={`array-item-list-${fieldPathId.$id}`} className='p-0 m-0'>
|
|
62
62
|
{items &&
|
|
63
63
|
items.map(({ key, ...itemProps }: ArrayFieldItemTemplateType<T, S, F>) => (
|
|
64
64
|
<ArrayFieldItemTemplate key={key} {...itemProps} />
|
|
@@ -69,7 +69,7 @@ export default function ArrayFieldTemplate<
|
|
|
69
69
|
<Col xs={9}></Col>
|
|
70
70
|
<Col xs={3} className='py-4 col-lg-3 col-3'>
|
|
71
71
|
<AddButton
|
|
72
|
-
id={buttonId
|
|
72
|
+
id={buttonId(fieldPathId, 'add')}
|
|
73
73
|
className='rjsf-array-item-add'
|
|
74
74
|
onClick={onAddClick}
|
|
75
75
|
disabled={disabled || readonly}
|
|
@@ -54,17 +54,17 @@ export default function BaseInputTemplate<
|
|
|
54
54
|
disabled={disabled}
|
|
55
55
|
readOnly={readonly}
|
|
56
56
|
className={rawErrors.length > 0 ? 'is-invalid' : ''}
|
|
57
|
-
list={schema.examples ? examplesId
|
|
57
|
+
list={schema.examples ? examplesId(id) : undefined}
|
|
58
58
|
{...inputProps}
|
|
59
59
|
value={value || value === 0 ? value : ''}
|
|
60
60
|
onChange={onChangeOverride || _onChange}
|
|
61
61
|
onBlur={_onBlur}
|
|
62
62
|
onFocus={_onFocus}
|
|
63
|
-
aria-describedby={ariaDescribedByIds
|
|
63
|
+
aria-describedby={ariaDescribedByIds(id, !!schema.examples)}
|
|
64
64
|
/>
|
|
65
65
|
{children}
|
|
66
66
|
{Array.isArray(schema.examples) ? (
|
|
67
|
-
<datalist id={examplesId
|
|
67
|
+
<datalist id={examplesId(id)}>
|
|
68
68
|
{(schema.examples as string[])
|
|
69
69
|
.concat(schema.default && !schema.examples.includes(schema.default) ? ([schema.default] as string[]) : [])
|
|
70
70
|
.map((example: any) => {
|
|
@@ -49,10 +49,10 @@ export default function CheckboxWidget<
|
|
|
49
49
|
|
|
50
50
|
const description = options.description || schema.description;
|
|
51
51
|
return (
|
|
52
|
-
<Form.Group className={disabled || readonly ? 'disabled' : ''} aria-describedby={ariaDescribedByIds
|
|
52
|
+
<Form.Group className={disabled || readonly ? 'disabled' : ''} aria-describedby={ariaDescribedByIds(id)}>
|
|
53
53
|
{!hideLabel && description && (
|
|
54
54
|
<DescriptionFieldTemplate
|
|
55
|
-
id={descriptionId
|
|
55
|
+
id={descriptionId(id)}
|
|
56
56
|
description={description}
|
|
57
57
|
schema={schema}
|
|
58
58
|
uiSchema={uiSchema}
|
|
@@ -10,11 +10,11 @@ export default function FieldErrorTemplate<
|
|
|
10
10
|
S extends StrictRJSFSchema = RJSFSchema,
|
|
11
11
|
F extends FormContextType = any,
|
|
12
12
|
>(props: FieldErrorProps<T, S, F>) {
|
|
13
|
-
const { errors = [],
|
|
13
|
+
const { errors = [], fieldPathId } = props;
|
|
14
14
|
if (errors.length === 0) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
|
-
const id = errorId
|
|
17
|
+
const id = errorId(fieldPathId);
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<ListGroup as='ul' id={id}>
|
|
@@ -10,11 +10,11 @@ export default function FieldHelpTemplate<
|
|
|
10
10
|
S extends StrictRJSFSchema = RJSFSchema,
|
|
11
11
|
F extends FormContextType = any,
|
|
12
12
|
>(props: FieldHelpProps<T, S, F>) {
|
|
13
|
-
const {
|
|
13
|
+
const { fieldPathId, help, hasErrors } = props;
|
|
14
14
|
if (!help) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
|
-
const id = helpId
|
|
17
|
+
const id = helpId(fieldPathId);
|
|
18
18
|
return (
|
|
19
19
|
<Form.Text className={hasErrors ? 'text-danger' : 'text-muted'} id={id}>
|
|
20
20
|
{help}
|
|
@@ -25,7 +25,7 @@ export default function ObjectFieldTemplate<
|
|
|
25
25
|
properties,
|
|
26
26
|
required,
|
|
27
27
|
uiSchema,
|
|
28
|
-
|
|
28
|
+
fieldPathId,
|
|
29
29
|
schema,
|
|
30
30
|
formData,
|
|
31
31
|
onAddClick,
|
|
@@ -48,7 +48,7 @@ export default function ObjectFieldTemplate<
|
|
|
48
48
|
<>
|
|
49
49
|
{title && (
|
|
50
50
|
<TitleFieldTemplate
|
|
51
|
-
id={titleId
|
|
51
|
+
id={titleId(fieldPathId)}
|
|
52
52
|
title={title}
|
|
53
53
|
required={required}
|
|
54
54
|
schema={schema}
|
|
@@ -58,7 +58,7 @@ export default function ObjectFieldTemplate<
|
|
|
58
58
|
)}
|
|
59
59
|
{description && (
|
|
60
60
|
<DescriptionFieldTemplate
|
|
61
|
-
id={descriptionId
|
|
61
|
+
id={descriptionId(fieldPathId)}
|
|
62
62
|
description={description}
|
|
63
63
|
schema={schema}
|
|
64
64
|
uiSchema={uiSchema}
|
|
@@ -75,7 +75,7 @@ export default function ObjectFieldTemplate<
|
|
|
75
75
|
<Row>
|
|
76
76
|
<Col xs={{ offset: 9, span: 3 }} className='py-4'>
|
|
77
77
|
<AddButton
|
|
78
|
-
id={buttonId
|
|
78
|
+
id={buttonId(fieldPathId, 'add')}
|
|
79
79
|
onClick={onAddClick(schema)}
|
|
80
80
|
disabled={disabled || readonly}
|
|
81
81
|
className='rjsf-object-property-expand'
|
|
@@ -55,7 +55,7 @@ export default function RadioWidget<T = any, S extends StrictRJSFSchema = RJSFSc
|
|
|
55
55
|
onChange={_onChange}
|
|
56
56
|
onBlur={_onBlur}
|
|
57
57
|
onFocus={_onFocus}
|
|
58
|
-
aria-describedby={ariaDescribedByIds
|
|
58
|
+
aria-describedby={ariaDescribedByIds(id)}
|
|
59
59
|
/>
|
|
60
60
|
);
|
|
61
61
|
return radio;
|
|
@@ -75,7 +75,7 @@ export default function SelectWidget<
|
|
|
75
75
|
const newValue = getValue(event, multiple);
|
|
76
76
|
onChange(enumOptionsValueForIndex<S>(newValue, enumOptions, optEmptyValue));
|
|
77
77
|
}}
|
|
78
|
-
aria-describedby={ariaDescribedByIds
|
|
78
|
+
aria-describedby={ariaDescribedByIds(id)}
|
|
79
79
|
>
|
|
80
80
|
{showPlaceholderOption && <option value=''>{placeholder}</option>}
|
|
81
81
|
{(enumOptions as any).map(({ value, label }: any, i: number) => {
|
|
@@ -68,7 +68,7 @@ export default function WrapIfAdditionalTemplate<
|
|
|
68
68
|
<Col xs={5}>{children}</Col>
|
|
69
69
|
<Col xs={2} className='py-4 d-grid gap-2'>
|
|
70
70
|
<RemoveButton
|
|
71
|
-
id={buttonId
|
|
71
|
+
id={buttonId(id, 'remove')}
|
|
72
72
|
className='rjsf-object-property-remove w-100'
|
|
73
73
|
disabled={disabled || readonly}
|
|
74
74
|
onClick={onDropPropertyClick(label)}
|