@rjsf/react-bootstrap 6.0.0-beta.1 → 6.0.0-beta.11
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 +4 -2
- package/dist/index.js +84 -79
- package/dist/index.js.map +4 -4
- package/dist/react-bootstrap.esm.js +82 -77
- package/dist/react-bootstrap.esm.js.map +4 -4
- package/dist/react-bootstrap.umd.js +39 -39
- package/lib/CheckboxWidget/CheckboxWidget.js +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/DescriptionField/DescriptionField.d.ts +5 -1
- package/lib/DescriptionField/DescriptionField.js +9 -4
- package/lib/DescriptionField/DescriptionField.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/Templates/Templates.js +2 -0
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/CheckboxWidget/CheckboxWidget.tsx +2 -5
- package/src/DescriptionField/DescriptionField.tsx +15 -10
- package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +15 -0
- package/src/MultiSchemaFieldTemplate/index.ts +2 -0
- package/src/Templates/Templates.ts +2 -0
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.11",
|
|
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.
|
|
65
|
-
"@rjsf/utils": "^6.
|
|
64
|
+
"@rjsf/core": "^6.0.0-beta",
|
|
65
|
+
"@rjsf/utils": "^6.0.0-beta",
|
|
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.11",
|
|
75
|
+
"@rjsf/snapshot-tests": "^6.0.0-beta.11",
|
|
76
|
+
"@rjsf/utils": "^6.0.0-beta.11",
|
|
77
|
+
"@rjsf/validator-ajv8": "^6.0.0-beta.11",
|
|
78
78
|
"eslint": "^8.56.0",
|
|
79
79
|
"react-bootstrap": "^2.10.9"
|
|
80
80
|
},
|
|
@@ -49,11 +49,8 @@ export default function CheckboxWidget<
|
|
|
49
49
|
|
|
50
50
|
const description = options.description || schema.description;
|
|
51
51
|
return (
|
|
52
|
-
<Form.Group
|
|
53
|
-
|
|
54
|
-
aria-describedby={ariaDescribedByIds<T>(id)}
|
|
55
|
-
>
|
|
56
|
-
{!hideLabel && !!description && (
|
|
52
|
+
<Form.Group className={disabled || readonly ? 'disabled' : ''} aria-describedby={ariaDescribedByIds<T>(id)}>
|
|
53
|
+
{!hideLabel && description && (
|
|
57
54
|
<DescriptionFieldTemplate
|
|
58
55
|
id={descriptionId<T>(id)}
|
|
59
56
|
description={description}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
import { RichDescription } from '@rjsf/core';
|
|
2
3
|
|
|
4
|
+
/** The `DescriptionField` is the template to use to render the description of a field
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `DescriptionFieldProps` for this component
|
|
7
|
+
*/
|
|
3
8
|
export default function DescriptionField<
|
|
4
9
|
T = any,
|
|
5
10
|
S extends StrictRJSFSchema = RJSFSchema,
|
|
6
11
|
F extends FormContextType = any,
|
|
7
|
-
>({ id, description }: DescriptionFieldProps<T, S, F>) {
|
|
8
|
-
if (description) {
|
|
9
|
-
return
|
|
10
|
-
<div>
|
|
11
|
-
<div id={id} className='mb-3'>
|
|
12
|
-
{description}
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
);
|
|
12
|
+
>({ id, description, registry, uiSchema }: DescriptionFieldProps<T, S, F>) {
|
|
13
|
+
if (!description) {
|
|
14
|
+
return null;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
return
|
|
17
|
+
return (
|
|
18
|
+
<div>
|
|
19
|
+
<div id={id} className='mb-3'>
|
|
20
|
+
<RichDescription description={description} registry={registry} uiSchema={uiSchema} />
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
19
24
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FormContextType, MultiSchemaFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
import Card from 'react-bootstrap/Card';
|
|
3
|
+
|
|
4
|
+
export default function MultiSchemaFieldTemplate<
|
|
5
|
+
T = any,
|
|
6
|
+
S extends StrictRJSFSchema = RJSFSchema,
|
|
7
|
+
F extends FormContextType = any,
|
|
8
|
+
>({ selector, optionSchemaField }: MultiSchemaFieldTemplateProps<T, S, F>) {
|
|
9
|
+
return (
|
|
10
|
+
<Card style={{ marginBottom: '1rem' }}>
|
|
11
|
+
<Card.Body>{selector}</Card.Body>
|
|
12
|
+
<Card.Body>{optionSchemaField}</Card.Body>
|
|
13
|
+
</Card>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -9,6 +9,7 @@ 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';
|
|
13
14
|
import SubmitButton from '../SubmitButton';
|
|
14
15
|
import TitleField from '../TitleField';
|
|
@@ -38,6 +39,7 @@ export function generateTemplates<
|
|
|
38
39
|
FieldHelpTemplate,
|
|
39
40
|
FieldTemplate,
|
|
40
41
|
GridTemplate,
|
|
42
|
+
MultiSchemaFieldTemplate,
|
|
41
43
|
ObjectFieldTemplate,
|
|
42
44
|
TitleFieldTemplate: TitleField,
|
|
43
45
|
WrapIfAdditionalTemplate,
|