@react-aria/radio 3.1.7 → 3.1.8
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 +28 -28
- package/dist/module.js +27 -27
- package/package.json +9 -9
package/dist/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
5
|
-
var $
|
|
1
|
+
var $jfuDl$reactariautils = require("@react-aria/utils");
|
|
2
|
+
var $jfuDl$reactariafocus = require("@react-aria/focus");
|
|
3
|
+
var $jfuDl$reactariainteractions = require("@react-aria/interactions");
|
|
4
|
+
var $jfuDl$reactarialabel = require("@react-aria/label");
|
|
5
|
+
var $jfuDl$reactariai18n = require("@react-aria/i18n");
|
|
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 $338761e45a036ef1$exports = {};
|
|
27
27
|
|
|
28
|
-
$parcel$export($
|
|
28
|
+
$parcel$export($338761e45a036ef1$exports, "useRadio", () => $338761e45a036ef1$export$37b0961d2f4751e2);
|
|
29
29
|
|
|
30
|
-
const $
|
|
30
|
+
const $a1e0bad4e707cb8d$export$3b7b268d09480394 = new WeakMap();
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
function $
|
|
35
|
+
function $338761e45a036ef1$export$37b0961d2f4751e2(props, state, ref) {
|
|
36
36
|
let { value: value , children: children , 'aria-label': ariaLabel , 'aria-labelledby': ariaLabelledby } = props;
|
|
37
37
|
const isDisabled = props.isDisabled || state.isDisabled;
|
|
38
38
|
let hasChildren = children != null;
|
|
@@ -43,23 +43,23 @@ function $f4cb2359f8ad57df$export$37b0961d2f4751e2(props, state, ref) {
|
|
|
43
43
|
e.stopPropagation();
|
|
44
44
|
state.setSelectedValue(value);
|
|
45
45
|
};
|
|
46
|
-
let { pressProps: pressProps } = $
|
|
46
|
+
let { pressProps: pressProps } = $jfuDl$reactariainteractions.usePress({
|
|
47
47
|
isDisabled: isDisabled
|
|
48
48
|
});
|
|
49
|
-
let { focusableProps: focusableProps } = $
|
|
49
|
+
let { focusableProps: focusableProps } = $jfuDl$reactariafocus.useFocusable($jfuDl$reactariautils.mergeProps(props, {
|
|
50
50
|
onFocus: ()=>state.setLastFocusedValue(value)
|
|
51
51
|
}), ref);
|
|
52
|
-
let interactions = $
|
|
53
|
-
let domProps = $
|
|
52
|
+
let interactions = $jfuDl$reactariautils.mergeProps(pressProps, focusableProps);
|
|
53
|
+
let domProps = $jfuDl$reactariautils.filterDOMProps(props, {
|
|
54
54
|
labelable: true
|
|
55
55
|
});
|
|
56
56
|
let tabIndex = state.lastFocusedValue === value || state.lastFocusedValue == null ? 0 : -1;
|
|
57
57
|
if (isDisabled) tabIndex = undefined;
|
|
58
58
|
return {
|
|
59
|
-
inputProps: $
|
|
59
|
+
inputProps: $jfuDl$reactariautils.mergeProps(domProps, {
|
|
60
60
|
...interactions,
|
|
61
61
|
type: 'radio',
|
|
62
|
-
name: $
|
|
62
|
+
name: $a1e0bad4e707cb8d$export$3b7b268d09480394.get(state),
|
|
63
63
|
tabIndex: tabIndex,
|
|
64
64
|
disabled: isDisabled,
|
|
65
65
|
checked: checked,
|
|
@@ -70,31 +70,31 @@ function $f4cb2359f8ad57df$export$37b0961d2f4751e2(props, state, ref) {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
var $
|
|
73
|
+
var $dab8d6446eaa2014$exports = {};
|
|
74
74
|
|
|
75
|
-
$parcel$export($
|
|
75
|
+
$parcel$export($dab8d6446eaa2014$exports, "useRadioGroup", () => $dab8d6446eaa2014$export$62b9571f283ff5c2);
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
function $
|
|
82
|
+
function $dab8d6446eaa2014$export$62b9571f283ff5c2(props, state) {
|
|
83
83
|
let { name: name , validationState: validationState , isReadOnly: isReadOnly , isRequired: isRequired , isDisabled: isDisabled , orientation: orientation = 'vertical' } = props;
|
|
84
|
-
let { direction: direction } = $
|
|
85
|
-
let { labelProps: labelProps , fieldProps: fieldProps } = $
|
|
84
|
+
let { direction: direction } = $jfuDl$reactariai18n.useLocale();
|
|
85
|
+
let { labelProps: labelProps , fieldProps: fieldProps } = $jfuDl$reactarialabel.useLabel({
|
|
86
86
|
...props,
|
|
87
87
|
// Radio group is not an HTML input element so it
|
|
88
88
|
// shouldn't be labeled by a <label> element.
|
|
89
89
|
labelElementType: 'span'
|
|
90
90
|
});
|
|
91
|
-
let domProps = $
|
|
91
|
+
let domProps = $jfuDl$reactariautils.filterDOMProps(props, {
|
|
92
92
|
labelable: true
|
|
93
93
|
});
|
|
94
94
|
// When the radio group loses focus, reset the focusable radio to null if
|
|
95
95
|
// there is no selection. This allows tabbing into the group from either
|
|
96
96
|
// direction to go to the first or last radio.
|
|
97
|
-
let { focusWithinProps: focusWithinProps } = $
|
|
97
|
+
let { focusWithinProps: focusWithinProps } = $jfuDl$reactariainteractions.useFocusWithin({
|
|
98
98
|
onBlurWithin () {
|
|
99
99
|
if (!state.selectedValue) state.setLastFocusedValue(null);
|
|
100
100
|
}
|
|
@@ -120,7 +120,7 @@ function $2c583501d4c0a651$export$62b9571f283ff5c2(props, state) {
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
e.preventDefault();
|
|
123
|
-
let walker = $
|
|
123
|
+
let walker = $jfuDl$reactariafocus.getFocusableTreeWalker(e.currentTarget, {
|
|
124
124
|
from: e.target
|
|
125
125
|
});
|
|
126
126
|
let nextElem;
|
|
@@ -143,10 +143,10 @@ function $2c583501d4c0a651$export$62b9571f283ff5c2(props, state) {
|
|
|
143
143
|
state.setSelectedValue(nextElem.value);
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
|
-
let groupName = $
|
|
147
|
-
$
|
|
146
|
+
let groupName = $jfuDl$reactariautils.useId(name);
|
|
147
|
+
$a1e0bad4e707cb8d$export$3b7b268d09480394.set(state, groupName);
|
|
148
148
|
return {
|
|
149
|
-
radioGroupProps: $
|
|
149
|
+
radioGroupProps: $jfuDl$reactariautils.mergeProps(domProps, {
|
|
150
150
|
// https://www.w3.org/TR/wai-aria-1.2/#radiogroup
|
|
151
151
|
role: 'radiogroup',
|
|
152
152
|
onKeyDown: onKeyDown,
|
|
@@ -164,8 +164,8 @@ function $2c583501d4c0a651$export$62b9571f283ff5c2(props, state) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
|
|
167
|
-
$parcel$exportWildcard(module.exports, $
|
|
168
|
-
$parcel$exportWildcard(module.exports, $
|
|
167
|
+
$parcel$exportWildcard(module.exports, $338761e45a036ef1$exports);
|
|
168
|
+
$parcel$exportWildcard(module.exports, $dab8d6446eaa2014$exports);
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
//# sourceMappingURL=main.js.map
|
package/dist/module.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {mergeProps as $
|
|
2
|
-
import {useFocusable as $
|
|
3
|
-
import {usePress as $
|
|
4
|
-
import {useLabel as $
|
|
5
|
-
import {useLocale as $
|
|
1
|
+
import {mergeProps as $2aKPr$mergeProps, filterDOMProps as $2aKPr$filterDOMProps, useId as $2aKPr$useId} from "@react-aria/utils";
|
|
2
|
+
import {useFocusable as $2aKPr$useFocusable, getFocusableTreeWalker as $2aKPr$getFocusableTreeWalker} from "@react-aria/focus";
|
|
3
|
+
import {usePress as $2aKPr$usePress, useFocusWithin as $2aKPr$useFocusWithin} from "@react-aria/interactions";
|
|
4
|
+
import {useLabel as $2aKPr$useLabel} from "@react-aria/label";
|
|
5
|
+
import {useLocale as $2aKPr$useLocale} from "@react-aria/i18n";
|
|
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 $2cd2cc131ce1e951$exports = {};
|
|
11
11
|
|
|
12
|
-
$parcel$export($
|
|
12
|
+
$parcel$export($2cd2cc131ce1e951$exports, "useRadio", () => $2cd2cc131ce1e951$export$37b0961d2f4751e2);
|
|
13
13
|
|
|
14
|
-
const $
|
|
14
|
+
const $a249568f27a21ba9$export$3b7b268d09480394 = new WeakMap();
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
function $
|
|
19
|
+
function $2cd2cc131ce1e951$export$37b0961d2f4751e2(props, state, ref) {
|
|
20
20
|
let { value: value , children: children , 'aria-label': ariaLabel , 'aria-labelledby': ariaLabelledby } = props;
|
|
21
21
|
const isDisabled = props.isDisabled || state.isDisabled;
|
|
22
22
|
let hasChildren = children != null;
|
|
@@ -27,23 +27,23 @@ function $6657631d22f179ad$export$37b0961d2f4751e2(props, state, ref) {
|
|
|
27
27
|
e.stopPropagation();
|
|
28
28
|
state.setSelectedValue(value);
|
|
29
29
|
};
|
|
30
|
-
let { pressProps: pressProps } = $
|
|
30
|
+
let { pressProps: pressProps } = $2aKPr$usePress({
|
|
31
31
|
isDisabled: isDisabled
|
|
32
32
|
});
|
|
33
|
-
let { focusableProps: focusableProps } = $
|
|
33
|
+
let { focusableProps: focusableProps } = $2aKPr$useFocusable($2aKPr$mergeProps(props, {
|
|
34
34
|
onFocus: ()=>state.setLastFocusedValue(value)
|
|
35
35
|
}), ref);
|
|
36
|
-
let interactions = $
|
|
37
|
-
let domProps = $
|
|
36
|
+
let interactions = $2aKPr$mergeProps(pressProps, focusableProps);
|
|
37
|
+
let domProps = $2aKPr$filterDOMProps(props, {
|
|
38
38
|
labelable: true
|
|
39
39
|
});
|
|
40
40
|
let tabIndex = state.lastFocusedValue === value || state.lastFocusedValue == null ? 0 : -1;
|
|
41
41
|
if (isDisabled) tabIndex = undefined;
|
|
42
42
|
return {
|
|
43
|
-
inputProps: $
|
|
43
|
+
inputProps: $2aKPr$mergeProps(domProps, {
|
|
44
44
|
...interactions,
|
|
45
45
|
type: 'radio',
|
|
46
|
-
name: $
|
|
46
|
+
name: $a249568f27a21ba9$export$3b7b268d09480394.get(state),
|
|
47
47
|
tabIndex: tabIndex,
|
|
48
48
|
disabled: isDisabled,
|
|
49
49
|
checked: checked,
|
|
@@ -54,31 +54,31 @@ function $6657631d22f179ad$export$37b0961d2f4751e2(props, state, ref) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
var $
|
|
57
|
+
var $b5bb90da5b40a472$exports = {};
|
|
58
58
|
|
|
59
|
-
$parcel$export($
|
|
59
|
+
$parcel$export($b5bb90da5b40a472$exports, "useRadioGroup", () => $b5bb90da5b40a472$export$62b9571f283ff5c2);
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
function $
|
|
66
|
+
function $b5bb90da5b40a472$export$62b9571f283ff5c2(props, state) {
|
|
67
67
|
let { name: name , validationState: validationState , isReadOnly: isReadOnly , isRequired: isRequired , isDisabled: isDisabled , orientation: orientation = 'vertical' } = props;
|
|
68
|
-
let { direction: direction } = $
|
|
69
|
-
let { labelProps: labelProps , fieldProps: fieldProps } = $
|
|
68
|
+
let { direction: direction } = $2aKPr$useLocale();
|
|
69
|
+
let { labelProps: labelProps , fieldProps: fieldProps } = $2aKPr$useLabel({
|
|
70
70
|
...props,
|
|
71
71
|
// Radio group is not an HTML input element so it
|
|
72
72
|
// shouldn't be labeled by a <label> element.
|
|
73
73
|
labelElementType: 'span'
|
|
74
74
|
});
|
|
75
|
-
let domProps = $
|
|
75
|
+
let domProps = $2aKPr$filterDOMProps(props, {
|
|
76
76
|
labelable: true
|
|
77
77
|
});
|
|
78
78
|
// When the radio group loses focus, reset the focusable radio to null if
|
|
79
79
|
// there is no selection. This allows tabbing into the group from either
|
|
80
80
|
// direction to go to the first or last radio.
|
|
81
|
-
let { focusWithinProps: focusWithinProps } = $
|
|
81
|
+
let { focusWithinProps: focusWithinProps } = $2aKPr$useFocusWithin({
|
|
82
82
|
onBlurWithin () {
|
|
83
83
|
if (!state.selectedValue) state.setLastFocusedValue(null);
|
|
84
84
|
}
|
|
@@ -104,7 +104,7 @@ function $c6603e85cbfc3c71$export$62b9571f283ff5c2(props, state) {
|
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
e.preventDefault();
|
|
107
|
-
let walker = $
|
|
107
|
+
let walker = $2aKPr$getFocusableTreeWalker(e.currentTarget, {
|
|
108
108
|
from: e.target
|
|
109
109
|
});
|
|
110
110
|
let nextElem;
|
|
@@ -127,10 +127,10 @@ function $c6603e85cbfc3c71$export$62b9571f283ff5c2(props, state) {
|
|
|
127
127
|
state.setSelectedValue(nextElem.value);
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
|
-
let groupName = $
|
|
131
|
-
$
|
|
130
|
+
let groupName = $2aKPr$useId(name);
|
|
131
|
+
$a249568f27a21ba9$export$3b7b268d09480394.set(state, groupName);
|
|
132
132
|
return {
|
|
133
|
-
radioGroupProps: $
|
|
133
|
+
radioGroupProps: $2aKPr$mergeProps(domProps, {
|
|
134
134
|
// https://www.w3.org/TR/wai-aria-1.2/#radiogroup
|
|
135
135
|
role: 'radiogroup',
|
|
136
136
|
onKeyDown: onKeyDown,
|
|
@@ -150,5 +150,5 @@ function $c6603e85cbfc3c71$export$62b9571f283ff5c2(props, state) {
|
|
|
150
150
|
|
|
151
151
|
|
|
152
152
|
|
|
153
|
-
export {$
|
|
153
|
+
export {$2cd2cc131ce1e951$export$37b0961d2f4751e2 as useRadio, $b5bb90da5b40a472$export$62b9571f283ff5c2 as useRadioGroup};
|
|
154
154
|
//# sourceMappingURL=module.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/radio",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.8",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-aria/focus": "^3.5.
|
|
22
|
-
"@react-aria/i18n": "^3.3.
|
|
23
|
-
"@react-aria/interactions": "^3.8.
|
|
24
|
-
"@react-aria/label": "^3.2.
|
|
25
|
-
"@react-aria/utils": "^3.11.
|
|
26
|
-
"@react-stately/radio": "^3.3.
|
|
27
|
-
"@react-types/radio": "^3.1.
|
|
21
|
+
"@react-aria/focus": "^3.5.2",
|
|
22
|
+
"@react-aria/i18n": "^3.3.6",
|
|
23
|
+
"@react-aria/interactions": "^3.8.1",
|
|
24
|
+
"@react-aria/label": "^3.2.3",
|
|
25
|
+
"@react-aria/utils": "^3.11.2",
|
|
26
|
+
"@react-stately/radio": "^3.3.4",
|
|
27
|
+
"@react-types/radio": "^3.1.4"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
|
|
36
36
|
}
|