@react-aria/checkbox 3.3.1 → 3.3.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/main.js +27 -27
- package/dist/module.js +25 -25
- package/package.json +8 -8
package/dist/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
5
|
-
var $
|
|
1
|
+
var $k0DcK$react = require("react");
|
|
2
|
+
var $k0DcK$reactariatoggle = require("@react-aria/toggle");
|
|
3
|
+
var $k0DcK$reactariautils = require("@react-aria/utils");
|
|
4
|
+
var $k0DcK$reactarialabel = require("@react-aria/label");
|
|
5
|
+
var $k0DcK$reactstatelytoggle = require("@react-stately/toggle");
|
|
6
6
|
|
|
7
7
|
function $parcel$exportWildcard(dest, source) {
|
|
8
8
|
Object.keys(source).forEach(function(key) {
|
|
@@ -23,16 +23,16 @@ function $parcel$exportWildcard(dest, source) {
|
|
|
23
23
|
function $parcel$export(e, n, v, s) {
|
|
24
24
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
25
25
|
}
|
|
26
|
-
var $
|
|
26
|
+
var $468c774d7db917b7$exports = {};
|
|
27
27
|
|
|
28
|
-
$parcel$export($
|
|
28
|
+
$parcel$export($468c774d7db917b7$exports, "useCheckbox", () => $468c774d7db917b7$export$e375f10ce42261c5);
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
function $
|
|
32
|
-
let { inputProps: inputProps } = $
|
|
31
|
+
function $468c774d7db917b7$export$e375f10ce42261c5(props, state, inputRef) {
|
|
32
|
+
let { inputProps: inputProps } = $k0DcK$reactariatoggle.useToggle(props, state, inputRef);
|
|
33
33
|
let { isSelected: isSelected } = state;
|
|
34
34
|
let { isIndeterminate: isIndeterminate } = props;
|
|
35
|
-
$
|
|
35
|
+
$k0DcK$react.useEffect(()=>{
|
|
36
36
|
// indeterminate is a property, but it can only be set via javascript
|
|
37
37
|
// https://css-tricks.com/indeterminate-checkboxes/
|
|
38
38
|
if (inputRef.current) inputRef.current.indeterminate = isIndeterminate;
|
|
@@ -47,29 +47,29 @@ function $0ec554106b85b62e$export$e375f10ce42261c5(props, state, inputRef) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
var $
|
|
50
|
+
var $253685172d17db7d$exports = {};
|
|
51
51
|
|
|
52
|
-
$parcel$export($
|
|
53
|
-
const $
|
|
52
|
+
$parcel$export($253685172d17db7d$exports, "useCheckboxGroup", () => $253685172d17db7d$export$49ff6f28c54f1cbe);
|
|
53
|
+
const $64fc3370e682155f$export$31440636951aa68c = new WeakMap();
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
function $
|
|
58
|
+
function $253685172d17db7d$export$49ff6f28c54f1cbe(props, state) {
|
|
59
59
|
let { isDisabled: isDisabled , name: name } = props;
|
|
60
|
-
let { labelProps: labelProps , fieldProps: fieldProps } = $
|
|
60
|
+
let { labelProps: labelProps , fieldProps: fieldProps } = $k0DcK$reactarialabel.useLabel({
|
|
61
61
|
...props,
|
|
62
62
|
// Checkbox group is not an HTML input element so it
|
|
63
63
|
// shouldn't be labeled by a <label> element.
|
|
64
64
|
labelElementType: 'span'
|
|
65
65
|
});
|
|
66
|
-
let domProps = $
|
|
66
|
+
let domProps = $k0DcK$reactariautils.filterDOMProps(props, {
|
|
67
67
|
labelable: true
|
|
68
68
|
});
|
|
69
69
|
// Pass name prop from group to all items by attaching to the state.
|
|
70
|
-
$
|
|
70
|
+
$64fc3370e682155f$export$31440636951aa68c.set(state, name);
|
|
71
71
|
return {
|
|
72
|
-
groupProps: $
|
|
72
|
+
groupProps: $k0DcK$reactariautils.mergeProps(domProps, {
|
|
73
73
|
role: 'group',
|
|
74
74
|
'aria-disabled': isDisabled || undefined,
|
|
75
75
|
...fieldProps
|
|
@@ -79,14 +79,14 @@ function $0505cbc377dd66f2$export$49ff6f28c54f1cbe(props, state) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
var $
|
|
82
|
+
var $07e03121d6ac83c8$exports = {};
|
|
83
83
|
|
|
84
|
-
$parcel$export($
|
|
84
|
+
$parcel$export($07e03121d6ac83c8$exports, "useCheckboxGroupItem", () => $07e03121d6ac83c8$export$353b32fc6898d37d);
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
function $
|
|
89
|
-
const toggleState = $
|
|
88
|
+
function $07e03121d6ac83c8$export$353b32fc6898d37d(props, state, inputRef) {
|
|
89
|
+
const toggleState = $k0DcK$reactstatelytoggle.useToggleState({
|
|
90
90
|
isReadOnly: props.isReadOnly || state.isReadOnly,
|
|
91
91
|
isSelected: state.isSelected(props.value),
|
|
92
92
|
onChange (isSelected) {
|
|
@@ -95,11 +95,11 @@ function $2c160cc84b857a22$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
95
95
|
if (props.onChange) props.onChange(isSelected);
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
|
-
let { inputProps: inputProps } = $
|
|
98
|
+
let { inputProps: inputProps } = $468c774d7db917b7$export$e375f10ce42261c5({
|
|
99
99
|
...props,
|
|
100
100
|
isReadOnly: props.isReadOnly || state.isReadOnly,
|
|
101
101
|
isDisabled: props.isDisabled || state.isDisabled,
|
|
102
|
-
name: props.name || $
|
|
102
|
+
name: props.name || $64fc3370e682155f$export$31440636951aa68c.get(state)
|
|
103
103
|
}, toggleState, inputRef);
|
|
104
104
|
return {
|
|
105
105
|
inputProps: inputProps
|
|
@@ -107,9 +107,9 @@ function $2c160cc84b857a22$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
$parcel$exportWildcard(module.exports, $
|
|
111
|
-
$parcel$exportWildcard(module.exports, $
|
|
112
|
-
$parcel$exportWildcard(module.exports, $
|
|
110
|
+
$parcel$exportWildcard(module.exports, $468c774d7db917b7$exports);
|
|
111
|
+
$parcel$exportWildcard(module.exports, $253685172d17db7d$exports);
|
|
112
|
+
$parcel$exportWildcard(module.exports, $07e03121d6ac83c8$exports);
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
//# sourceMappingURL=main.js.map
|
package/dist/module.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {useEffect as $
|
|
2
|
-
import {useToggle as $
|
|
3
|
-
import {filterDOMProps as $
|
|
4
|
-
import {useLabel as $
|
|
5
|
-
import {useToggleState as $
|
|
1
|
+
import {useEffect as $cKEhs$useEffect} from "react";
|
|
2
|
+
import {useToggle as $cKEhs$useToggle} from "@react-aria/toggle";
|
|
3
|
+
import {filterDOMProps as $cKEhs$filterDOMProps, mergeProps as $cKEhs$mergeProps} from "@react-aria/utils";
|
|
4
|
+
import {useLabel as $cKEhs$useLabel} from "@react-aria/label";
|
|
5
|
+
import {useToggleState as $cKEhs$useToggleState} from "@react-stately/toggle";
|
|
6
6
|
|
|
7
7
|
function $parcel$export(e, n, v, s) {
|
|
8
8
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
9
9
|
}
|
|
10
|
-
var $
|
|
10
|
+
var $406796ff087fe49b$exports = {};
|
|
11
11
|
|
|
12
|
-
$parcel$export($
|
|
12
|
+
$parcel$export($406796ff087fe49b$exports, "useCheckbox", () => $406796ff087fe49b$export$e375f10ce42261c5);
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
function $
|
|
16
|
-
let { inputProps: inputProps } = $
|
|
15
|
+
function $406796ff087fe49b$export$e375f10ce42261c5(props, state, inputRef) {
|
|
16
|
+
let { inputProps: inputProps } = $cKEhs$useToggle(props, state, inputRef);
|
|
17
17
|
let { isSelected: isSelected } = state;
|
|
18
18
|
let { isIndeterminate: isIndeterminate } = props;
|
|
19
|
-
$
|
|
19
|
+
$cKEhs$useEffect(()=>{
|
|
20
20
|
// indeterminate is a property, but it can only be set via javascript
|
|
21
21
|
// https://css-tricks.com/indeterminate-checkboxes/
|
|
22
22
|
if (inputRef.current) inputRef.current.indeterminate = isIndeterminate;
|
|
@@ -31,29 +31,29 @@ function $fea2f35efc29884c$export$e375f10ce42261c5(props, state, inputRef) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var $
|
|
34
|
+
var $1e9fce0cfacc738b$exports = {};
|
|
35
35
|
|
|
36
|
-
$parcel$export($
|
|
37
|
-
const $
|
|
36
|
+
$parcel$export($1e9fce0cfacc738b$exports, "useCheckboxGroup", () => $1e9fce0cfacc738b$export$49ff6f28c54f1cbe);
|
|
37
|
+
const $1ae600c947479353$export$31440636951aa68c = new WeakMap();
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
function $
|
|
42
|
+
function $1e9fce0cfacc738b$export$49ff6f28c54f1cbe(props, state) {
|
|
43
43
|
let { isDisabled: isDisabled , name: name } = props;
|
|
44
|
-
let { labelProps: labelProps , fieldProps: fieldProps } = $
|
|
44
|
+
let { labelProps: labelProps , fieldProps: fieldProps } = $cKEhs$useLabel({
|
|
45
45
|
...props,
|
|
46
46
|
// Checkbox group is not an HTML input element so it
|
|
47
47
|
// shouldn't be labeled by a <label> element.
|
|
48
48
|
labelElementType: 'span'
|
|
49
49
|
});
|
|
50
|
-
let domProps = $
|
|
50
|
+
let domProps = $cKEhs$filterDOMProps(props, {
|
|
51
51
|
labelable: true
|
|
52
52
|
});
|
|
53
53
|
// Pass name prop from group to all items by attaching to the state.
|
|
54
|
-
$
|
|
54
|
+
$1ae600c947479353$export$31440636951aa68c.set(state, name);
|
|
55
55
|
return {
|
|
56
|
-
groupProps: $
|
|
56
|
+
groupProps: $cKEhs$mergeProps(domProps, {
|
|
57
57
|
role: 'group',
|
|
58
58
|
'aria-disabled': isDisabled || undefined,
|
|
59
59
|
...fieldProps
|
|
@@ -63,14 +63,14 @@ function $ec288cd435d5d49a$export$49ff6f28c54f1cbe(props, state) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
var $
|
|
66
|
+
var $fba3e38d5ca8983f$exports = {};
|
|
67
67
|
|
|
68
|
-
$parcel$export($
|
|
68
|
+
$parcel$export($fba3e38d5ca8983f$exports, "useCheckboxGroupItem", () => $fba3e38d5ca8983f$export$353b32fc6898d37d);
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
function $
|
|
73
|
-
const toggleState = $
|
|
72
|
+
function $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {
|
|
73
|
+
const toggleState = $cKEhs$useToggleState({
|
|
74
74
|
isReadOnly: props.isReadOnly || state.isReadOnly,
|
|
75
75
|
isSelected: state.isSelected(props.value),
|
|
76
76
|
onChange (isSelected) {
|
|
@@ -79,11 +79,11 @@ function $a84307d0769c22d8$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
79
79
|
if (props.onChange) props.onChange(isSelected);
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
|
-
let { inputProps: inputProps } = $
|
|
82
|
+
let { inputProps: inputProps } = $406796ff087fe49b$export$e375f10ce42261c5({
|
|
83
83
|
...props,
|
|
84
84
|
isReadOnly: props.isReadOnly || state.isReadOnly,
|
|
85
85
|
isDisabled: props.isDisabled || state.isDisabled,
|
|
86
|
-
name: props.name || $
|
|
86
|
+
name: props.name || $1ae600c947479353$export$31440636951aa68c.get(state)
|
|
87
87
|
}, toggleState, inputRef);
|
|
88
88
|
return {
|
|
89
89
|
inputProps: inputProps
|
|
@@ -93,5 +93,5 @@ function $a84307d0769c22d8$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
export {$
|
|
96
|
+
export {$406796ff087fe49b$export$e375f10ce42261c5 as useCheckbox, $1e9fce0cfacc738b$export$49ff6f28c54f1cbe as useCheckboxGroup, $fba3e38d5ca8983f$export$353b32fc6898d37d as useCheckboxGroupItem};
|
|
97
97
|
//# sourceMappingURL=module.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/checkbox",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-aria/label": "^3.2.
|
|
22
|
-
"@react-aria/toggle": "^3.2.
|
|
23
|
-
"@react-aria/utils": "^3.11.
|
|
24
|
-
"@react-stately/checkbox": "^3.0.
|
|
25
|
-
"@react-stately/toggle": "^3.2.
|
|
26
|
-
"@react-types/checkbox": "^3.2.
|
|
21
|
+
"@react-aria/label": "^3.2.4",
|
|
22
|
+
"@react-aria/toggle": "^3.2.2",
|
|
23
|
+
"@react-aria/utils": "^3.11.3",
|
|
24
|
+
"@react-stately/checkbox": "^3.0.6",
|
|
25
|
+
"@react-stately/toggle": "^3.2.6",
|
|
26
|
+
"@react-types/checkbox": "^3.2.6"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "ed8d8d984c2f7f2c31e8b18795b97858a95e4729"
|
|
35
35
|
}
|