@react-aria/tabs 3.1.2 → 3.1.3-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 +38 -38
- package/dist/module.js +36 -36
- package/package.json +10 -10
package/dist/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
5
|
-
var $
|
|
1
|
+
var $1cJu1$reactariaselection = require("@react-aria/selection");
|
|
2
|
+
var $1cJu1$reactariafocus = require("@react-aria/focus");
|
|
3
|
+
var $1cJu1$react = require("react");
|
|
4
|
+
var $1cJu1$reactariautils = require("@react-aria/utils");
|
|
5
|
+
var $1cJu1$reactariai18n = require("@react-aria/i18n");
|
|
6
6
|
|
|
7
7
|
function $parcel$exportWildcard(dest, source) {
|
|
8
8
|
Object.keys(source).forEach(function(key) {
|
|
@@ -23,31 +23,31 @@ 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 $4eeea1c984cc0628$exports = {};
|
|
27
27
|
|
|
28
|
-
$parcel$export($
|
|
29
|
-
const $
|
|
30
|
-
function $
|
|
28
|
+
$parcel$export($4eeea1c984cc0628$exports, "useTab", () => $4eeea1c984cc0628$export$fdf4756d5b8ef90a);
|
|
29
|
+
const $a217ebca77471970$export$c5f62239608282b6 = new WeakMap();
|
|
30
|
+
function $a217ebca77471970$export$567fc7097e064344(state, key, role) {
|
|
31
31
|
if (typeof key === 'string') key = key.replace(/\s+/g, '');
|
|
32
|
-
let baseId = $
|
|
32
|
+
let baseId = $a217ebca77471970$export$c5f62239608282b6.get(state);
|
|
33
33
|
return `${baseId}-${role}-${key}`;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
function $
|
|
38
|
+
function $4eeea1c984cc0628$export$fdf4756d5b8ef90a(props, state, ref) {
|
|
39
39
|
let { key: key , isDisabled: propsDisabled } = props;
|
|
40
40
|
let { selectionManager: manager , selectedKey: selectedKey } = state;
|
|
41
41
|
let isSelected = key === selectedKey;
|
|
42
42
|
let isDisabled = propsDisabled || state.disabledKeys.has(key);
|
|
43
|
-
let { itemProps: itemProps } = $
|
|
43
|
+
let { itemProps: itemProps } = $1cJu1$reactariaselection.useSelectableItem({
|
|
44
44
|
selectionManager: manager,
|
|
45
45
|
key: key,
|
|
46
46
|
ref: ref,
|
|
47
47
|
isDisabled: isDisabled
|
|
48
48
|
});
|
|
49
|
-
let tabId = $
|
|
50
|
-
let tabPanelId = $
|
|
49
|
+
let tabId = $a217ebca77471970$export$567fc7097e064344(state, key, 'tab');
|
|
50
|
+
let tabPanelId = $a217ebca77471970$export$567fc7097e064344(state, key, 'tabpanel');
|
|
51
51
|
let { tabIndex: tabIndex } = itemProps;
|
|
52
52
|
return {
|
|
53
53
|
tabProps: {
|
|
@@ -63,23 +63,23 @@ function $89ebbca46b589799$export$fdf4756d5b8ef90a(props, state, ref) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
var $
|
|
66
|
+
var $8db1928b18472a1f$exports = {};
|
|
67
67
|
|
|
68
|
-
$parcel$export($
|
|
68
|
+
$parcel$export($8db1928b18472a1f$exports, "useTabPanel", () => $8db1928b18472a1f$export$fae0121b5afe572d);
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
function $
|
|
74
|
-
let [tabIndex, setTabIndex] = $
|
|
73
|
+
function $8db1928b18472a1f$export$fae0121b5afe572d(props, state, ref) {
|
|
74
|
+
let [tabIndex, setTabIndex] = $1cJu1$react.useState(0);
|
|
75
75
|
// The tabpanel should have tabIndex=0 when there are no tabbable elements within it.
|
|
76
76
|
// Otherwise, tabbing from the focused tab should go directly to the first tabbable element
|
|
77
77
|
// within the tabpanel.
|
|
78
|
-
$
|
|
78
|
+
$1cJu1$reactariautils.useLayoutEffect(()=>{
|
|
79
79
|
if (ref === null || ref === void 0 ? void 0 : ref.current) {
|
|
80
80
|
let update = ()=>{
|
|
81
81
|
// Detect if there are any tabbable elements and update the tabIndex accordingly.
|
|
82
|
-
let walker = $
|
|
82
|
+
let walker = $1cJu1$reactariafocus.getFocusableTreeWalker(ref.current, {
|
|
83
83
|
tabbable: true
|
|
84
84
|
});
|
|
85
85
|
setTabIndex(walker.nextNode() ? undefined : 0);
|
|
@@ -103,14 +103,14 @@ function $6e4089dd984c6897$export$fae0121b5afe572d(props, state, ref) {
|
|
|
103
103
|
}, [
|
|
104
104
|
ref
|
|
105
105
|
]);
|
|
106
|
-
const id = $
|
|
107
|
-
const tabPanelProps = $
|
|
106
|
+
const id = $a217ebca77471970$export$567fc7097e064344(state, state === null || state === void 0 ? void 0 : state.selectedKey, 'tabpanel');
|
|
107
|
+
const tabPanelProps = $1cJu1$reactariautils.useLabels({
|
|
108
108
|
...props,
|
|
109
109
|
id: id,
|
|
110
|
-
'aria-labelledby': $
|
|
110
|
+
'aria-labelledby': $a217ebca77471970$export$567fc7097e064344(state, state === null || state === void 0 ? void 0 : state.selectedKey, 'tab')
|
|
111
111
|
});
|
|
112
112
|
return {
|
|
113
|
-
tabPanelProps: $
|
|
113
|
+
tabPanelProps: $1cJu1$reactariautils.mergeProps(tabPanelProps, {
|
|
114
114
|
tabIndex: tabIndex,
|
|
115
115
|
role: 'tabpanel',
|
|
116
116
|
'aria-describedby': props['aria-describedby'],
|
|
@@ -120,13 +120,13 @@ function $6e4089dd984c6897$export$fae0121b5afe572d(props, state, ref) {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
|
|
123
|
-
var $
|
|
123
|
+
var $f2b4a4926440e901$exports = {};
|
|
124
124
|
|
|
125
|
-
$parcel$export($
|
|
125
|
+
$parcel$export($f2b4a4926440e901$exports, "useTabList", () => $f2b4a4926440e901$export$773e389e644c5874);
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
class $
|
|
129
|
+
class $283e5d8830177ead$export$15010ca3c1abe90b {
|
|
130
130
|
getKeyLeftOf(key) {
|
|
131
131
|
if (this.flipDirection) return this.getNextKey(key);
|
|
132
132
|
else {
|
|
@@ -184,18 +184,18 @@ class $4dce8c7e6d6eaebd$export$15010ca3c1abe90b {
|
|
|
184
184
|
|
|
185
185
|
|
|
186
186
|
|
|
187
|
-
function $
|
|
187
|
+
function $f2b4a4926440e901$export$773e389e644c5874(props, state, ref) {
|
|
188
188
|
let { orientation: orientation = 'horizontal' , keyboardActivation: keyboardActivation = 'automatic' } = props;
|
|
189
189
|
let { collection: collection , selectionManager: manager , disabledKeys: disabledKeys } = state;
|
|
190
|
-
let { direction: direction } = $
|
|
191
|
-
let delegate = $
|
|
190
|
+
let { direction: direction } = $1cJu1$reactariai18n.useLocale();
|
|
191
|
+
let delegate = $1cJu1$react.useMemo(()=>new $283e5d8830177ead$export$15010ca3c1abe90b(collection, direction, orientation, disabledKeys)
|
|
192
192
|
, [
|
|
193
193
|
collection,
|
|
194
194
|
disabledKeys,
|
|
195
195
|
orientation,
|
|
196
196
|
direction
|
|
197
197
|
]);
|
|
198
|
-
let { collectionProps: collectionProps } = $
|
|
198
|
+
let { collectionProps: collectionProps } = $1cJu1$reactariaselection.useSelectableCollection({
|
|
199
199
|
ref: ref,
|
|
200
200
|
selectionManager: manager,
|
|
201
201
|
keyboardDelegate: delegate,
|
|
@@ -204,15 +204,15 @@ function $772c13a2b24fa2ac$export$773e389e644c5874(props, state, ref) {
|
|
|
204
204
|
scrollRef: ref
|
|
205
205
|
});
|
|
206
206
|
// Compute base id for all tabs
|
|
207
|
-
let tabsId = $
|
|
208
|
-
$
|
|
209
|
-
let tabListLabelProps = $
|
|
207
|
+
let tabsId = $1cJu1$reactariautils.useId();
|
|
208
|
+
$a217ebca77471970$export$c5f62239608282b6.set(state, tabsId);
|
|
209
|
+
let tabListLabelProps = $1cJu1$reactariautils.useLabels({
|
|
210
210
|
...props,
|
|
211
211
|
id: tabsId
|
|
212
212
|
});
|
|
213
213
|
return {
|
|
214
214
|
tabListProps: {
|
|
215
|
-
...$
|
|
215
|
+
...$1cJu1$reactariautils.mergeProps(collectionProps, tabListLabelProps),
|
|
216
216
|
role: 'tablist',
|
|
217
217
|
'aria-orientation': orientation,
|
|
218
218
|
tabIndex: undefined
|
|
@@ -221,9 +221,9 @@ function $772c13a2b24fa2ac$export$773e389e644c5874(props, state, ref) {
|
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
|
|
224
|
-
$parcel$exportWildcard(module.exports, $
|
|
225
|
-
$parcel$exportWildcard(module.exports, $
|
|
226
|
-
$parcel$exportWildcard(module.exports, $
|
|
224
|
+
$parcel$exportWildcard(module.exports, $4eeea1c984cc0628$exports);
|
|
225
|
+
$parcel$exportWildcard(module.exports, $8db1928b18472a1f$exports);
|
|
226
|
+
$parcel$exportWildcard(module.exports, $f2b4a4926440e901$exports);
|
|
227
227
|
|
|
228
228
|
|
|
229
229
|
//# sourceMappingURL=main.js.map
|
package/dist/module.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import {useSelectableItem as $
|
|
2
|
-
import {getFocusableTreeWalker as $
|
|
3
|
-
import {useState as $
|
|
4
|
-
import {useLayoutEffect as $
|
|
5
|
-
import {useLocale as $
|
|
1
|
+
import {useSelectableItem as $8kq0t$useSelectableItem, useSelectableCollection as $8kq0t$useSelectableCollection} from "@react-aria/selection";
|
|
2
|
+
import {getFocusableTreeWalker as $8kq0t$getFocusableTreeWalker} from "@react-aria/focus";
|
|
3
|
+
import {useState as $8kq0t$useState, useMemo as $8kq0t$useMemo} from "react";
|
|
4
|
+
import {useLayoutEffect as $8kq0t$useLayoutEffect, useLabels as $8kq0t$useLabels, mergeProps as $8kq0t$mergeProps, useId as $8kq0t$useId} from "@react-aria/utils";
|
|
5
|
+
import {useLocale as $8kq0t$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 $0175d55c2a017ebc$exports = {};
|
|
11
11
|
|
|
12
|
-
$parcel$export($
|
|
13
|
-
const $
|
|
14
|
-
function $
|
|
12
|
+
$parcel$export($0175d55c2a017ebc$exports, "useTab", () => $0175d55c2a017ebc$export$fdf4756d5b8ef90a);
|
|
13
|
+
const $99b62ae3ff97ec45$export$c5f62239608282b6 = new WeakMap();
|
|
14
|
+
function $99b62ae3ff97ec45$export$567fc7097e064344(state, key, role) {
|
|
15
15
|
if (typeof key === 'string') key = key.replace(/\s+/g, '');
|
|
16
|
-
let baseId = $
|
|
16
|
+
let baseId = $99b62ae3ff97ec45$export$c5f62239608282b6.get(state);
|
|
17
17
|
return `${baseId}-${role}-${key}`;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
function $
|
|
22
|
+
function $0175d55c2a017ebc$export$fdf4756d5b8ef90a(props, state, ref) {
|
|
23
23
|
let { key: key , isDisabled: propsDisabled } = props;
|
|
24
24
|
let { selectionManager: manager , selectedKey: selectedKey } = state;
|
|
25
25
|
let isSelected = key === selectedKey;
|
|
26
26
|
let isDisabled = propsDisabled || state.disabledKeys.has(key);
|
|
27
|
-
let { itemProps: itemProps } = $
|
|
27
|
+
let { itemProps: itemProps } = $8kq0t$useSelectableItem({
|
|
28
28
|
selectionManager: manager,
|
|
29
29
|
key: key,
|
|
30
30
|
ref: ref,
|
|
31
31
|
isDisabled: isDisabled
|
|
32
32
|
});
|
|
33
|
-
let tabId = $
|
|
34
|
-
let tabPanelId = $
|
|
33
|
+
let tabId = $99b62ae3ff97ec45$export$567fc7097e064344(state, key, 'tab');
|
|
34
|
+
let tabPanelId = $99b62ae3ff97ec45$export$567fc7097e064344(state, key, 'tabpanel');
|
|
35
35
|
let { tabIndex: tabIndex } = itemProps;
|
|
36
36
|
return {
|
|
37
37
|
tabProps: {
|
|
@@ -47,23 +47,23 @@ function $fbeca008f459f5aa$export$fdf4756d5b8ef90a(props, state, ref) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
var $
|
|
50
|
+
var $34bce698202e07cb$exports = {};
|
|
51
51
|
|
|
52
|
-
$parcel$export($
|
|
52
|
+
$parcel$export($34bce698202e07cb$exports, "useTabPanel", () => $34bce698202e07cb$export$fae0121b5afe572d);
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
function $
|
|
58
|
-
let [tabIndex, setTabIndex] = $
|
|
57
|
+
function $34bce698202e07cb$export$fae0121b5afe572d(props, state, ref) {
|
|
58
|
+
let [tabIndex, setTabIndex] = $8kq0t$useState(0);
|
|
59
59
|
// The tabpanel should have tabIndex=0 when there are no tabbable elements within it.
|
|
60
60
|
// Otherwise, tabbing from the focused tab should go directly to the first tabbable element
|
|
61
61
|
// within the tabpanel.
|
|
62
|
-
$
|
|
62
|
+
$8kq0t$useLayoutEffect(()=>{
|
|
63
63
|
if (ref === null || ref === void 0 ? void 0 : ref.current) {
|
|
64
64
|
let update = ()=>{
|
|
65
65
|
// Detect if there are any tabbable elements and update the tabIndex accordingly.
|
|
66
|
-
let walker = $
|
|
66
|
+
let walker = $8kq0t$getFocusableTreeWalker(ref.current, {
|
|
67
67
|
tabbable: true
|
|
68
68
|
});
|
|
69
69
|
setTabIndex(walker.nextNode() ? undefined : 0);
|
|
@@ -87,14 +87,14 @@ function $bc77009ac794dd15$export$fae0121b5afe572d(props, state, ref) {
|
|
|
87
87
|
}, [
|
|
88
88
|
ref
|
|
89
89
|
]);
|
|
90
|
-
const id = $
|
|
91
|
-
const tabPanelProps = $
|
|
90
|
+
const id = $99b62ae3ff97ec45$export$567fc7097e064344(state, state === null || state === void 0 ? void 0 : state.selectedKey, 'tabpanel');
|
|
91
|
+
const tabPanelProps = $8kq0t$useLabels({
|
|
92
92
|
...props,
|
|
93
93
|
id: id,
|
|
94
|
-
'aria-labelledby': $
|
|
94
|
+
'aria-labelledby': $99b62ae3ff97ec45$export$567fc7097e064344(state, state === null || state === void 0 ? void 0 : state.selectedKey, 'tab')
|
|
95
95
|
});
|
|
96
96
|
return {
|
|
97
|
-
tabPanelProps: $
|
|
97
|
+
tabPanelProps: $8kq0t$mergeProps(tabPanelProps, {
|
|
98
98
|
tabIndex: tabIndex,
|
|
99
99
|
role: 'tabpanel',
|
|
100
100
|
'aria-describedby': props['aria-describedby'],
|
|
@@ -104,13 +104,13 @@ function $bc77009ac794dd15$export$fae0121b5afe572d(props, state, ref) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
var $
|
|
107
|
+
var $58d314389b21fa3f$exports = {};
|
|
108
108
|
|
|
109
|
-
$parcel$export($
|
|
109
|
+
$parcel$export($58d314389b21fa3f$exports, "useTabList", () => $58d314389b21fa3f$export$773e389e644c5874);
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
|
|
113
|
-
class $
|
|
113
|
+
class $bfc6f2d60b8a4c40$export$15010ca3c1abe90b {
|
|
114
114
|
getKeyLeftOf(key) {
|
|
115
115
|
if (this.flipDirection) return this.getNextKey(key);
|
|
116
116
|
else {
|
|
@@ -168,18 +168,18 @@ class $d9c38f86f4c836f2$export$15010ca3c1abe90b {
|
|
|
168
168
|
|
|
169
169
|
|
|
170
170
|
|
|
171
|
-
function $
|
|
171
|
+
function $58d314389b21fa3f$export$773e389e644c5874(props, state, ref) {
|
|
172
172
|
let { orientation: orientation = 'horizontal' , keyboardActivation: keyboardActivation = 'automatic' } = props;
|
|
173
173
|
let { collection: collection , selectionManager: manager , disabledKeys: disabledKeys } = state;
|
|
174
|
-
let { direction: direction } = $
|
|
175
|
-
let delegate = $
|
|
174
|
+
let { direction: direction } = $8kq0t$useLocale();
|
|
175
|
+
let delegate = $8kq0t$useMemo(()=>new $bfc6f2d60b8a4c40$export$15010ca3c1abe90b(collection, direction, orientation, disabledKeys)
|
|
176
176
|
, [
|
|
177
177
|
collection,
|
|
178
178
|
disabledKeys,
|
|
179
179
|
orientation,
|
|
180
180
|
direction
|
|
181
181
|
]);
|
|
182
|
-
let { collectionProps: collectionProps } = $
|
|
182
|
+
let { collectionProps: collectionProps } = $8kq0t$useSelectableCollection({
|
|
183
183
|
ref: ref,
|
|
184
184
|
selectionManager: manager,
|
|
185
185
|
keyboardDelegate: delegate,
|
|
@@ -188,15 +188,15 @@ function $67cd7a6663dbdf35$export$773e389e644c5874(props, state, ref) {
|
|
|
188
188
|
scrollRef: ref
|
|
189
189
|
});
|
|
190
190
|
// Compute base id for all tabs
|
|
191
|
-
let tabsId = $
|
|
192
|
-
$
|
|
193
|
-
let tabListLabelProps = $
|
|
191
|
+
let tabsId = $8kq0t$useId();
|
|
192
|
+
$99b62ae3ff97ec45$export$c5f62239608282b6.set(state, tabsId);
|
|
193
|
+
let tabListLabelProps = $8kq0t$useLabels({
|
|
194
194
|
...props,
|
|
195
195
|
id: tabsId
|
|
196
196
|
});
|
|
197
197
|
return {
|
|
198
198
|
tabListProps: {
|
|
199
|
-
...$
|
|
199
|
+
...$8kq0t$mergeProps(collectionProps, tabListLabelProps),
|
|
200
200
|
role: 'tablist',
|
|
201
201
|
'aria-orientation': orientation,
|
|
202
202
|
tabIndex: undefined
|
|
@@ -207,5 +207,5 @@ function $67cd7a6663dbdf35$export$773e389e644c5874(props, state, ref) {
|
|
|
207
207
|
|
|
208
208
|
|
|
209
209
|
|
|
210
|
-
export {$
|
|
210
|
+
export {$0175d55c2a017ebc$export$fdf4756d5b8ef90a as useTab, $34bce698202e07cb$export$fae0121b5afe572d as useTabPanel, $58d314389b21fa3f$export$773e389e644c5874 as useTabList};
|
|
211
211
|
//# sourceMappingURL=module.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/tabs",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3-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": "
|
|
22
|
-
"@react-aria/i18n": "
|
|
23
|
-
"@react-aria/interactions": "
|
|
24
|
-
"@react-aria/selection": "
|
|
25
|
-
"@react-aria/utils": "
|
|
26
|
-
"@react-stately/list": "
|
|
27
|
-
"@react-stately/tabs": "
|
|
28
|
-
"@react-types/shared": "
|
|
29
|
-
"@react-types/tabs": "
|
|
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/list": "3.4.4-nightly.3113+404d41859",
|
|
27
|
+
"@react-stately/tabs": "3.0.0-nightly.1417+404d41859",
|
|
28
|
+
"@react-types/shared": "3.0.0-nightly.1417+404d41859",
|
|
29
|
+
"@react-types/tabs": "3.0.4-nightly.3113+404d41859"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "^16.8.0 || ^17.0.0-rc.1"
|