@patternfly/react-core 4.206.1 → 4.206.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/CHANGELOG.md +11 -0
- package/dist/esm/components/DataList/DataListCheck.d.ts +9 -3
- package/dist/esm/components/DataList/DataListCheck.d.ts.map +1 -1
- package/dist/esm/components/DataList/DataListCheck.js +2 -2
- package/dist/esm/components/DataList/DataListCheck.js.map +1 -1
- package/dist/js/components/DataList/DataListCheck.d.ts +9 -3
- package/dist/js/components/DataList/DataListCheck.d.ts.map +1 -1
- package/dist/js/components/DataList/DataListCheck.js +2 -2
- package/dist/js/components/DataList/DataListCheck.js.map +1 -1
- package/dist/umd/react-core.js +2 -2
- package/dist/umd/react-core.min.css +31 -31
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/DataList/DataListCheck.tsx +12 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.206.
|
|
3
|
+
"version": "4.206.2",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.57.
|
|
38
|
-
"@patternfly/react-styles": "^4.56.
|
|
39
|
-
"@patternfly/react-tokens": "^4.58.
|
|
37
|
+
"@patternfly/react-icons": "^4.57.2",
|
|
38
|
+
"@patternfly/react-styles": "^4.56.2",
|
|
39
|
+
"@patternfly/react-tokens": "^4.58.2",
|
|
40
40
|
"focus-trap": "6.2.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "34b80701a861cc4135122e08d7e890bab924e3f4"
|
|
64
64
|
}
|
|
@@ -9,14 +9,20 @@ export interface DataListCheckProps extends Omit<React.HTMLProps<HTMLInputElemen
|
|
|
9
9
|
isValid?: boolean;
|
|
10
10
|
/** Flag to show if the DataList checkbox is disabled */
|
|
11
11
|
isDisabled?: boolean;
|
|
12
|
-
/** Flag to show if the DataList checkbox is checked when it is controlled by React state.
|
|
13
|
-
*
|
|
12
|
+
/** Flag to show if the DataList checkbox is checked when it is controlled by React state. Both isChecked and checked are valid,
|
|
13
|
+
* but only use one.
|
|
14
|
+
* To make the DataList checkbox uncontrolled, instead use the defaultChecked prop, but do not use both.
|
|
14
15
|
*/
|
|
15
16
|
isChecked?: boolean;
|
|
17
|
+
/** Flag to show if the DataList checkbox is checked when it is controlled by React state. Both isChecked and checked are valid,
|
|
18
|
+
* but only use one.
|
|
19
|
+
* To make the DataList checkbox uncontrolled, instead use the defaultChecked prop, but do not use both.
|
|
20
|
+
*/
|
|
21
|
+
checked?: boolean;
|
|
16
22
|
/** Flag to set default value of DataList checkbox when it is uncontrolled by React state.
|
|
17
23
|
* To make the DataList checkbox controlled, instead use the isChecked prop, but do not use both.
|
|
18
24
|
*/
|
|
19
|
-
|
|
25
|
+
defaultChecked?: boolean;
|
|
20
26
|
/** A callback for when the DataList checkbox selection changes */
|
|
21
27
|
onChange?: (checked: boolean, event: React.FormEvent<HTMLInputElement>) => void;
|
|
22
28
|
/** Aria-labelledby of the DataList checkbox */
|
|
@@ -33,6 +39,7 @@ export const DataListCheck: React.FunctionComponent<DataListCheckProps> = ({
|
|
|
33
39
|
isDisabled = false,
|
|
34
40
|
isChecked = null,
|
|
35
41
|
checked = null,
|
|
42
|
+
defaultChecked,
|
|
36
43
|
otherControls = false,
|
|
37
44
|
...props
|
|
38
45
|
}: DataListCheckProps) => {
|
|
@@ -44,8 +51,8 @@ export const DataListCheck: React.FunctionComponent<DataListCheckProps> = ({
|
|
|
44
51
|
onChange={event => onChange(event.currentTarget.checked, event)}
|
|
45
52
|
aria-invalid={!isValid}
|
|
46
53
|
disabled={isDisabled}
|
|
47
|
-
{...(
|
|
48
|
-
{...(
|
|
54
|
+
{...([true, false].includes(defaultChecked) && { defaultChecked })}
|
|
55
|
+
{...(![true, false].includes(defaultChecked) && { checked: isChecked || checked })}
|
|
49
56
|
/>
|
|
50
57
|
</div>
|
|
51
58
|
);
|