@react-aria/actiongroup 3.2.2-nightly.3103 → 3.2.4-nightly.3113
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 +22 -22
- package/dist/module.js +21 -21
- package/package.json +11 -11
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
1
|
+
var $hjKwo$reactariafocus = require("@react-aria/focus");
|
|
2
|
+
var $hjKwo$reactariautils = require("@react-aria/utils");
|
|
3
|
+
var $hjKwo$reactariai18n = require("@react-aria/i18n");
|
|
4
|
+
var $hjKwo$react = require("react");
|
|
5
5
|
|
|
6
6
|
function $parcel$exportWildcard(dest, source) {
|
|
7
7
|
Object.keys(source).forEach(function(key) {
|
|
@@ -22,26 +22,26 @@ function $parcel$exportWildcard(dest, source) {
|
|
|
22
22
|
function $parcel$export(e, n, v, s) {
|
|
23
23
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
24
24
|
}
|
|
25
|
-
var $
|
|
25
|
+
var $ceb684449a137553$exports = {};
|
|
26
26
|
|
|
27
|
-
$parcel$export($
|
|
27
|
+
$parcel$export($ceb684449a137553$exports, "useActionGroup", () => $ceb684449a137553$export$f4bf8d43c16de704);
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
const $
|
|
31
|
+
const $ceb684449a137553$var$BUTTON_GROUP_ROLES = {
|
|
32
32
|
'none': 'toolbar',
|
|
33
33
|
'single': 'radiogroup',
|
|
34
34
|
'multiple': 'toolbar'
|
|
35
35
|
};
|
|
36
|
-
function $
|
|
36
|
+
function $ceb684449a137553$export$f4bf8d43c16de704(props, state, ref) {
|
|
37
37
|
let { isDisabled: isDisabled , orientation: orientation = 'horizontal' } = props;
|
|
38
38
|
let allKeys = [
|
|
39
39
|
...state.collection.getKeys()
|
|
40
40
|
];
|
|
41
41
|
if (!allKeys.some((key)=>!state.disabledKeys.has(key)
|
|
42
42
|
)) isDisabled = true;
|
|
43
|
-
let { direction: direction } = $
|
|
44
|
-
let focusManager = $
|
|
43
|
+
let { direction: direction } = $hjKwo$reactariai18n.useLocale();
|
|
44
|
+
let focusManager = $hjKwo$reactariafocus.createFocusManager(ref);
|
|
45
45
|
let flipDirection = direction === 'rtl' && orientation === 'horizontal';
|
|
46
46
|
let onKeyDown = (e)=>{
|
|
47
47
|
if (!e.currentTarget.contains(e.target)) return;
|
|
@@ -70,10 +70,10 @@ function $fa5d02ed092a1b45$export$f4bf8d43c16de704(props, state, ref) {
|
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
|
-
let role = $
|
|
73
|
+
let role = $ceb684449a137553$var$BUTTON_GROUP_ROLES[state.selectionManager.selectionMode];
|
|
74
74
|
return {
|
|
75
75
|
actionGroupProps: {
|
|
76
|
-
...$
|
|
76
|
+
...$hjKwo$reactariautils.filterDOMProps(props, {
|
|
77
77
|
labelable: true
|
|
78
78
|
}),
|
|
79
79
|
role: role,
|
|
@@ -85,27 +85,27 @@ function $fa5d02ed092a1b45$export$f4bf8d43c16de704(props, state, ref) {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
var $
|
|
88
|
+
var $44b92e5de834b44e$exports = {};
|
|
89
89
|
|
|
90
|
-
$parcel$export($
|
|
90
|
+
$parcel$export($44b92e5de834b44e$exports, "useActionGroupItem", () => $44b92e5de834b44e$export$9597202bd3099a29);
|
|
91
91
|
|
|
92
92
|
|
|
93
|
-
const $
|
|
93
|
+
const $44b92e5de834b44e$var$BUTTON_ROLES = {
|
|
94
94
|
'none': null,
|
|
95
95
|
'single': 'radio',
|
|
96
96
|
'multiple': 'checkbox'
|
|
97
97
|
};
|
|
98
|
-
function $
|
|
98
|
+
function $44b92e5de834b44e$export$9597202bd3099a29(props, state, ref) {
|
|
99
99
|
let selectionMode = state.selectionManager.selectionMode;
|
|
100
100
|
let buttonProps = {
|
|
101
|
-
role: $
|
|
101
|
+
role: $44b92e5de834b44e$var$BUTTON_ROLES[selectionMode]
|
|
102
102
|
};
|
|
103
103
|
if (selectionMode !== 'none') {
|
|
104
104
|
let isSelected = state.selectionManager.isSelected(props.key);
|
|
105
105
|
buttonProps['aria-checked'] = isSelected;
|
|
106
106
|
}
|
|
107
107
|
let isFocused = props.key === state.selectionManager.focusedKey;
|
|
108
|
-
let lastRender = $
|
|
108
|
+
let lastRender = $hjKwo$react.useRef({
|
|
109
109
|
isFocused: isFocused,
|
|
110
110
|
state: state
|
|
111
111
|
});
|
|
@@ -115,13 +115,13 @@ function $87e953933c683a6a$export$9597202bd3099a29(props, state, ref) {
|
|
|
115
115
|
};
|
|
116
116
|
// If the focused item is removed from the DOM, reset the focused key to null.
|
|
117
117
|
// eslint-disable-next-line arrow-body-style
|
|
118
|
-
$
|
|
118
|
+
$hjKwo$react.useEffect(()=>{
|
|
119
119
|
return ()=>{
|
|
120
120
|
if (lastRender.current.isFocused) lastRender.current.state.selectionManager.setFocusedKey(null);
|
|
121
121
|
};
|
|
122
122
|
}, []);
|
|
123
123
|
return {
|
|
124
|
-
buttonProps: $
|
|
124
|
+
buttonProps: $hjKwo$reactariautils.mergeProps(buttonProps, {
|
|
125
125
|
tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,
|
|
126
126
|
onFocus () {
|
|
127
127
|
state.selectionManager.setFocusedKey(props.key);
|
|
@@ -134,8 +134,8 @@ function $87e953933c683a6a$export$9597202bd3099a29(props, state, ref) {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
|
|
137
|
-
$parcel$exportWildcard(module.exports, $
|
|
138
|
-
$parcel$exportWildcard(module.exports, $
|
|
137
|
+
$parcel$exportWildcard(module.exports, $ceb684449a137553$exports);
|
|
138
|
+
$parcel$exportWildcard(module.exports, $44b92e5de834b44e$exports);
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
//# sourceMappingURL=main.js.map
|
package/dist/module.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {createFocusManager as $
|
|
2
|
-
import {filterDOMProps as $
|
|
3
|
-
import {useLocale as $
|
|
4
|
-
import {useRef as $
|
|
1
|
+
import {createFocusManager as $1oG4F$createFocusManager} from "@react-aria/focus";
|
|
2
|
+
import {filterDOMProps as $1oG4F$filterDOMProps, mergeProps as $1oG4F$mergeProps} from "@react-aria/utils";
|
|
3
|
+
import {useLocale as $1oG4F$useLocale} from "@react-aria/i18n";
|
|
4
|
+
import {useRef as $1oG4F$useRef, useEffect as $1oG4F$useEffect} from "react";
|
|
5
5
|
|
|
6
6
|
function $parcel$export(e, n, v, s) {
|
|
7
7
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
8
8
|
}
|
|
9
|
-
var $
|
|
9
|
+
var $304ac34015d4535d$exports = {};
|
|
10
10
|
|
|
11
|
-
$parcel$export($
|
|
11
|
+
$parcel$export($304ac34015d4535d$exports, "useActionGroup", () => $304ac34015d4535d$export$f4bf8d43c16de704);
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
const $
|
|
15
|
+
const $304ac34015d4535d$var$BUTTON_GROUP_ROLES = {
|
|
16
16
|
'none': 'toolbar',
|
|
17
17
|
'single': 'radiogroup',
|
|
18
18
|
'multiple': 'toolbar'
|
|
19
19
|
};
|
|
20
|
-
function $
|
|
20
|
+
function $304ac34015d4535d$export$f4bf8d43c16de704(props, state, ref) {
|
|
21
21
|
let { isDisabled: isDisabled , orientation: orientation = 'horizontal' } = props;
|
|
22
22
|
let allKeys = [
|
|
23
23
|
...state.collection.getKeys()
|
|
24
24
|
];
|
|
25
25
|
if (!allKeys.some((key)=>!state.disabledKeys.has(key)
|
|
26
26
|
)) isDisabled = true;
|
|
27
|
-
let { direction: direction } = $
|
|
28
|
-
let focusManager = $
|
|
27
|
+
let { direction: direction } = $1oG4F$useLocale();
|
|
28
|
+
let focusManager = $1oG4F$createFocusManager(ref);
|
|
29
29
|
let flipDirection = direction === 'rtl' && orientation === 'horizontal';
|
|
30
30
|
let onKeyDown = (e)=>{
|
|
31
31
|
if (!e.currentTarget.contains(e.target)) return;
|
|
@@ -54,10 +54,10 @@ function $b3090da67b33a275$export$f4bf8d43c16de704(props, state, ref) {
|
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
let role = $
|
|
57
|
+
let role = $304ac34015d4535d$var$BUTTON_GROUP_ROLES[state.selectionManager.selectionMode];
|
|
58
58
|
return {
|
|
59
59
|
actionGroupProps: {
|
|
60
|
-
...$
|
|
60
|
+
...$1oG4F$filterDOMProps(props, {
|
|
61
61
|
labelable: true
|
|
62
62
|
}),
|
|
63
63
|
role: role,
|
|
@@ -69,27 +69,27 @@ function $b3090da67b33a275$export$f4bf8d43c16de704(props, state, ref) {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
var $
|
|
72
|
+
var $f0ac0fb73c3ec062$exports = {};
|
|
73
73
|
|
|
74
|
-
$parcel$export($
|
|
74
|
+
$parcel$export($f0ac0fb73c3ec062$exports, "useActionGroupItem", () => $f0ac0fb73c3ec062$export$9597202bd3099a29);
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
const $
|
|
77
|
+
const $f0ac0fb73c3ec062$var$BUTTON_ROLES = {
|
|
78
78
|
'none': null,
|
|
79
79
|
'single': 'radio',
|
|
80
80
|
'multiple': 'checkbox'
|
|
81
81
|
};
|
|
82
|
-
function $
|
|
82
|
+
function $f0ac0fb73c3ec062$export$9597202bd3099a29(props, state, ref) {
|
|
83
83
|
let selectionMode = state.selectionManager.selectionMode;
|
|
84
84
|
let buttonProps = {
|
|
85
|
-
role: $
|
|
85
|
+
role: $f0ac0fb73c3ec062$var$BUTTON_ROLES[selectionMode]
|
|
86
86
|
};
|
|
87
87
|
if (selectionMode !== 'none') {
|
|
88
88
|
let isSelected = state.selectionManager.isSelected(props.key);
|
|
89
89
|
buttonProps['aria-checked'] = isSelected;
|
|
90
90
|
}
|
|
91
91
|
let isFocused = props.key === state.selectionManager.focusedKey;
|
|
92
|
-
let lastRender = $
|
|
92
|
+
let lastRender = $1oG4F$useRef({
|
|
93
93
|
isFocused: isFocused,
|
|
94
94
|
state: state
|
|
95
95
|
});
|
|
@@ -99,13 +99,13 @@ function $25a78002b200e341$export$9597202bd3099a29(props, state, ref) {
|
|
|
99
99
|
};
|
|
100
100
|
// If the focused item is removed from the DOM, reset the focused key to null.
|
|
101
101
|
// eslint-disable-next-line arrow-body-style
|
|
102
|
-
$
|
|
102
|
+
$1oG4F$useEffect(()=>{
|
|
103
103
|
return ()=>{
|
|
104
104
|
if (lastRender.current.isFocused) lastRender.current.state.selectionManager.setFocusedKey(null);
|
|
105
105
|
};
|
|
106
106
|
}, []);
|
|
107
107
|
return {
|
|
108
|
-
buttonProps: $
|
|
108
|
+
buttonProps: $1oG4F$mergeProps(buttonProps, {
|
|
109
109
|
tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,
|
|
110
110
|
onFocus () {
|
|
111
111
|
state.selectionManager.setFocusedKey(props.key);
|
|
@@ -120,5 +120,5 @@ function $25a78002b200e341$export$9597202bd3099a29(props, state, ref) {
|
|
|
120
120
|
|
|
121
121
|
|
|
122
122
|
|
|
123
|
-
export {$
|
|
123
|
+
export {$304ac34015d4535d$export$f4bf8d43c16de704 as useActionGroup, $f0ac0fb73c3ec062$export$9597202bd3099a29 as useActionGroupItem};
|
|
124
124
|
//# sourceMappingURL=module.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/actiongroup",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4-nightly.3113+404d41859",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-aria/focus": "3.0.0-nightly.
|
|
22
|
-
"@react-aria/i18n": "3.0.0-nightly.
|
|
23
|
-
"@react-aria/interactions": "3.0.0-nightly.
|
|
24
|
-
"@react-aria/selection": "3.0.0-nightly.
|
|
25
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
26
|
-
"@react-stately/collections": "3.0.0-nightly.
|
|
27
|
-
"@react-stately/list": "3.4.
|
|
28
|
-
"@react-types/actiongroup": "3.2.
|
|
29
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
21
|
+
"@react-aria/focus": "3.0.0-nightly.1417+404d41859",
|
|
22
|
+
"@react-aria/i18n": "3.0.0-nightly.1417+404d41859",
|
|
23
|
+
"@react-aria/interactions": "3.0.0-nightly.1417+404d41859",
|
|
24
|
+
"@react-aria/selection": "3.0.0-nightly.1417+404d41859",
|
|
25
|
+
"@react-aria/utils": "3.0.0-nightly.1417+404d41859",
|
|
26
|
+
"@react-stately/collections": "3.0.0-nightly.1417+404d41859",
|
|
27
|
+
"@react-stately/list": "3.4.4-nightly.3113+404d41859",
|
|
28
|
+
"@react-types/actiongroup": "3.2.4-nightly.3113+404d41859",
|
|
29
|
+
"@react-types/shared": "3.0.0-nightly.1417+404d41859"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
|
|
38
38
|
}
|