@rjsf/chakra-ui 6.0.0 → 6.0.2
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/chakra-ui.esm.js +60 -55
- package/dist/chakra-ui.esm.js.map +3 -3
- package/dist/chakra-ui.umd.js +34 -30
- package/dist/index.cjs +34 -30
- package/dist/index.cjs.map +2 -2
- package/lib/CheckboxWidget/CheckboxWidget.js +5 -2
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +9 -9
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/CheckboxWidget/CheckboxWidget.tsx +4 -1
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rjsf/chakra-ui",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "Chakra UI theme, fields, and widgets for react-jsonschema-form",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@chakra-ui/react": ">=3.16.1",
|
|
67
|
-
"@rjsf/core": "^6.
|
|
68
|
-
"@rjsf/utils": "^6.
|
|
67
|
+
"@rjsf/core": "^6.x",
|
|
68
|
+
"@rjsf/utils": "^6.x",
|
|
69
69
|
"chakra-react-select": ">=6",
|
|
70
70
|
"react": ">=18"
|
|
71
71
|
},
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
"@emotion/eslint-plugin": "^11.12.0",
|
|
87
87
|
"@emotion/jest": "^11.13.0",
|
|
88
88
|
"@emotion/react": "^11.14.0",
|
|
89
|
-
"@rjsf/core": "^6.
|
|
90
|
-
"@rjsf/snapshot-tests": "^6.
|
|
91
|
-
"@rjsf/utils": "^6.
|
|
92
|
-
"@rjsf/validator-ajv8": "^6.
|
|
89
|
+
"@rjsf/core": "^6.x",
|
|
90
|
+
"@rjsf/snapshot-tests": "^6.x",
|
|
91
|
+
"@rjsf/utils": "^6.x",
|
|
92
|
+
"@rjsf/validator-ajv8": "^6.x",
|
|
93
93
|
"chakra-react-select": "^6.1.0",
|
|
94
94
|
"eslint": "^8.57.1"
|
|
95
95
|
},
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
StrictRJSFSchema,
|
|
11
11
|
RJSFSchema,
|
|
12
12
|
FormContextType,
|
|
13
|
+
getUiOptions,
|
|
13
14
|
} from '@rjsf/utils';
|
|
14
15
|
|
|
15
16
|
import { Field } from '../components/ui/field';
|
|
@@ -46,7 +47,9 @@ export default function CheckboxWidget<
|
|
|
46
47
|
registry,
|
|
47
48
|
options,
|
|
48
49
|
);
|
|
49
|
-
const
|
|
50
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
51
|
+
const isCheckbox = uiOptions.widget === 'checkbox';
|
|
52
|
+
const description = isCheckbox ? undefined : (options.description ?? schema.description);
|
|
50
53
|
|
|
51
54
|
const _onChange = ({ checked }: CheckboxCheckedChangeDetails) => onChange(checked);
|
|
52
55
|
const _onBlur = ({ target }: FocusEvent<HTMLInputElement | any>) => onBlur(id, target && target.checked);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { CheckboxGroup, FieldsetRoot, Stack, Text } from '@chakra-ui/react';
|
|
1
|
+
import { CheckboxGroup, FieldsetRoot, Stack, Text, FieldsetLegend } from '@chakra-ui/react';
|
|
2
2
|
import {
|
|
3
3
|
ariaDescribedByIds,
|
|
4
4
|
enumOptionsIndexForValue,
|
|
5
5
|
enumOptionsValueForIndex,
|
|
6
6
|
FormContextType,
|
|
7
|
-
labelValue,
|
|
8
7
|
optionId,
|
|
9
8
|
RJSFSchema,
|
|
10
9
|
StrictRJSFSchema,
|
|
11
10
|
WidgetProps,
|
|
11
|
+
labelValue,
|
|
12
12
|
} from '@rjsf/utils';
|
|
13
13
|
import { FocusEvent } from 'react';
|
|
14
14
|
|
|
@@ -32,8 +32,8 @@ export default function CheckboxesWidget<
|
|
|
32
32
|
onFocus,
|
|
33
33
|
required,
|
|
34
34
|
label,
|
|
35
|
-
hideLabel,
|
|
36
35
|
rawErrors = [],
|
|
36
|
+
hideLabel,
|
|
37
37
|
uiSchema,
|
|
38
38
|
} = props;
|
|
39
39
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
@@ -55,13 +55,13 @@ export default function CheckboxesWidget<
|
|
|
55
55
|
invalid={rawErrors && rawErrors.length > 0}
|
|
56
56
|
{...(chakraProps as any)}
|
|
57
57
|
>
|
|
58
|
+
{!hideLabel && label && <FieldsetLegend>{labelValue(label)}</FieldsetLegend>}
|
|
58
59
|
<CheckboxGroup
|
|
59
60
|
onValueChange={(option) => onChange(enumOptionsValueForIndex<S>(option, enumOptions, emptyValue))}
|
|
60
61
|
value={selectedIndexes}
|
|
61
62
|
aria-describedby={ariaDescribedByIds(id)}
|
|
62
63
|
readOnly={readonly}
|
|
63
64
|
required={required}
|
|
64
|
-
label={labelValue(label, hideLabel || !label)}
|
|
65
65
|
>
|
|
66
66
|
<Stack direction={row ? 'row' : 'column'}>
|
|
67
67
|
{Array.isArray(enumOptions) &&
|