@react-stately/menu 3.2.4-nightly.3040 → 3.2.4-nightly.3064
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 +40 -38
- package/dist/main.js.map +1 -1
- package/dist/module.js +31 -33
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/main.js
CHANGED
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
} = require("react");
|
|
1
|
+
var $6hBbk$reactstatelyoverlays = require("@react-stately/overlays");
|
|
2
|
+
var $6hBbk$react = require("react");
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function $parcel$interopDefault(a) {
|
|
12
|
-
return a && a.__esModule ? a.default : a;
|
|
13
|
-
}
|
|
4
|
+
function $parcel$exportWildcard(dest, source) {
|
|
5
|
+
Object.keys(source).forEach(function(key) {
|
|
6
|
+
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function useMenuTriggerState(props) {
|
|
20
|
-
let overlayTriggerState = useOverlayTriggerState(props);
|
|
21
|
-
let [focusStrategy, setFocusStrategy] = useState(null);
|
|
22
|
-
return _babelRuntimeHelpersExtends({
|
|
23
|
-
focusStrategy
|
|
24
|
-
}, overlayTriggerState, {
|
|
25
|
-
open(focusStrategy) {
|
|
26
|
-
if (focusStrategy === void 0) {
|
|
27
|
-
focusStrategy = null;
|
|
10
|
+
Object.defineProperty(dest, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return source[key];
|
|
28
14
|
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
29
17
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
return dest;
|
|
19
|
+
}
|
|
20
|
+
function $parcel$export(e, n, v, s) {
|
|
21
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
22
|
+
}
|
|
23
|
+
var $e0dda98f10bdcda4$exports = {};
|
|
24
|
+
|
|
25
|
+
$parcel$export($e0dda98f10bdcda4$exports, "useMenuTriggerState", () => $e0dda98f10bdcda4$export$79fefeb1c2091ac3);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
function $e0dda98f10bdcda4$export$79fefeb1c2091ac3(props) {
|
|
29
|
+
let overlayTriggerState = $6hBbk$reactstatelyoverlays.useOverlayTriggerState(props);
|
|
30
|
+
let [focusStrategy1, setFocusStrategy] = $6hBbk$react.useState(null);
|
|
31
|
+
return {
|
|
32
|
+
focusStrategy: focusStrategy1,
|
|
33
|
+
...overlayTriggerState,
|
|
34
|
+
open (focusStrategy = null) {
|
|
35
|
+
setFocusStrategy(focusStrategy);
|
|
36
|
+
overlayTriggerState.open();
|
|
37
|
+
},
|
|
38
|
+
toggle (focusStrategy = null) {
|
|
39
|
+
setFocusStrategy(focusStrategy);
|
|
40
|
+
overlayTriggerState.toggle();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
33
44
|
|
|
34
|
-
toggle(focusStrategy) {
|
|
35
|
-
if (focusStrategy === void 0) {
|
|
36
|
-
focusStrategy = null;
|
|
37
|
-
}
|
|
38
45
|
|
|
39
|
-
|
|
40
|
-
overlayTriggerState.toggle();
|
|
41
|
-
}
|
|
46
|
+
$parcel$exportWildcard(module.exports, $e0dda98f10bdcda4$exports);
|
|
42
47
|
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
48
|
|
|
46
|
-
exports.useMenuTriggerState = useMenuTriggerState;
|
|
47
49
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;SCgCgB,yCAAmB,CAAC,KAAuB,EAAqB,CAAC;IAC/E,GAAG,CAAC,mBAAmB,GAAG,kDAAsB,CAAC,KAAK;IACtD,GAAG,EAAE,cAAa,EAAE,gBAAgB,IAAI,qBAAQ,CAAgB,IAAI;IAEpE,MAAM,CAAC,CAAC;uBACN,cAAa;WACV,mBAAmB;QACtB,IAAI,EAAC,aAA4B,GAAG,IAAI,EAAE,CAAC;YACzC,gBAAgB,CAAC,aAAa;YAC9B,mBAAmB,CAAC,IAAI;QAC1B,CAAC;QACD,MAAM,EAAC,aAA4B,GAAG,IAAI,EAAE,CAAC;YAC3C,gBAAgB,CAAC,aAAa;YAC9B,mBAAmB,CAAC,MAAM;QAC5B,CAAC;IACH,CAAC;AACH,CAAC","sources":["packages/@react-stately/menu/src/index.ts","packages/@react-stately/menu/src/useMenuTriggerState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './useMenuTriggerState';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusStrategy} from '@react-types/shared';\nimport {MenuTriggerProps} from '@react-types/menu';\nimport {OverlayTriggerState, useOverlayTriggerState} from '@react-stately/overlays';\nimport {useState} from 'react';\n\nexport interface MenuTriggerState extends OverlayTriggerState {\n /** Controls which item will be auto focused when the menu opens. */\n readonly focusStrategy: FocusStrategy,\n\n /** Opens the menu. */\n open(focusStrategy?: FocusStrategy | null): void,\n\n /** Toggles the menu. */\n toggle(focusStrategy?: FocusStrategy | null): void\n}\n\n/**\n * Manages state for a menu trigger. Tracks whether the menu is currently open,\n * and controls which item will receive focus when it opens.\n */\nexport function useMenuTriggerState(props: MenuTriggerProps): MenuTriggerState {\n let overlayTriggerState = useOverlayTriggerState(props);\n let [focusStrategy, setFocusStrategy] = useState<FocusStrategy>(null);\n\n return {\n focusStrategy,\n ...overlayTriggerState,\n open(focusStrategy: FocusStrategy = null) {\n setFocusStrategy(focusStrategy);\n overlayTriggerState.open();\n },\n toggle(focusStrategy: FocusStrategy = null) {\n setFocusStrategy(focusStrategy);\n overlayTriggerState.toggle();\n }\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
setFocusStrategy(focusStrategy);
|
|
30
|
-
overlayTriggerState.toggle();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
});
|
|
1
|
+
import {useOverlayTriggerState as $jpa6g$useOverlayTriggerState} from "@react-stately/overlays";
|
|
2
|
+
import {useState as $jpa6g$useState} from "react";
|
|
3
|
+
|
|
4
|
+
function $parcel$export(e, n, v, s) {
|
|
5
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
6
|
+
}
|
|
7
|
+
var $44e14547c566e800$exports = {};
|
|
8
|
+
|
|
9
|
+
$parcel$export($44e14547c566e800$exports, "useMenuTriggerState", () => $44e14547c566e800$export$79fefeb1c2091ac3);
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $44e14547c566e800$export$79fefeb1c2091ac3(props) {
|
|
13
|
+
let overlayTriggerState = $jpa6g$useOverlayTriggerState(props);
|
|
14
|
+
let [focusStrategy1, setFocusStrategy] = $jpa6g$useState(null);
|
|
15
|
+
return {
|
|
16
|
+
focusStrategy: focusStrategy1,
|
|
17
|
+
...overlayTriggerState,
|
|
18
|
+
open (focusStrategy = null) {
|
|
19
|
+
setFocusStrategy(focusStrategy);
|
|
20
|
+
overlayTriggerState.open();
|
|
21
|
+
},
|
|
22
|
+
toggle (focusStrategy = null) {
|
|
23
|
+
setFocusStrategy(focusStrategy);
|
|
24
|
+
overlayTriggerState.toggle();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
34
27
|
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export {$44e14547c566e800$export$79fefeb1c2091ac3 as useMenuTriggerState};
|
|
35
33
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;SCgCgB,yCAAmB,CAAC,KAAuB,EAAqB,CAAC;IAC/E,GAAG,CAAC,mBAAmB,GAAG,6BAAsB,CAAC,KAAK;IACtD,GAAG,EAAE,cAAa,EAAE,gBAAgB,IAAI,eAAQ,CAAgB,IAAI;IAEpE,MAAM,CAAC,CAAC;uBACN,cAAa;WACV,mBAAmB;QACtB,IAAI,EAAC,aAA4B,GAAG,IAAI,EAAE,CAAC;YACzC,gBAAgB,CAAC,aAAa;YAC9B,mBAAmB,CAAC,IAAI;QAC1B,CAAC;QACD,MAAM,EAAC,aAA4B,GAAG,IAAI,EAAE,CAAC;YAC3C,gBAAgB,CAAC,aAAa;YAC9B,mBAAmB,CAAC,MAAM;QAC5B,CAAC;IACH,CAAC;AACH,CAAC","sources":["packages/@react-stately/menu/src/index.ts","packages/@react-stately/menu/src/useMenuTriggerState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './useMenuTriggerState';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusStrategy} from '@react-types/shared';\nimport {MenuTriggerProps} from '@react-types/menu';\nimport {OverlayTriggerState, useOverlayTriggerState} from '@react-stately/overlays';\nimport {useState} from 'react';\n\nexport interface MenuTriggerState extends OverlayTriggerState {\n /** Controls which item will be auto focused when the menu opens. */\n readonly focusStrategy: FocusStrategy,\n\n /** Opens the menu. */\n open(focusStrategy?: FocusStrategy | null): void,\n\n /** Toggles the menu. */\n toggle(focusStrategy?: FocusStrategy | null): void\n}\n\n/**\n * Manages state for a menu trigger. Tracks whether the menu is currently open,\n * and controls which item will receive focus when it opens.\n */\nexport function useMenuTriggerState(props: MenuTriggerProps): MenuTriggerState {\n let overlayTriggerState = useOverlayTriggerState(props);\n let [focusStrategy, setFocusStrategy] = useState<FocusStrategy>(null);\n\n return {\n focusStrategy,\n ...overlayTriggerState,\n open(focusStrategy: FocusStrategy = null) {\n setFocusStrategy(focusStrategy);\n overlayTriggerState.open();\n },\n toggle(focusStrategy: FocusStrategy = null) {\n setFocusStrategy(focusStrategy);\n overlayTriggerState.toggle();\n }\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;AAiBA,iCAAkC,SAAQ,mBAAmB;IAC3D,oEAAoE;IACpE,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAEtC,sBAAsB;IACtB,IAAI,CAAC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAAC;IAEjD,wBAAwB;IACxB,MAAM,CAAC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAAA;CACnD;AAED;;;GAGG;AACH,oCAAoC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,CAgB7E","sources":["packages/@react-stately/menu/src/packages/@react-stately/menu/src/useMenuTriggerState.ts","packages/@react-stately/menu/src/packages/@react-stately/menu/src/index.ts","packages/@react-stately/menu/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './useMenuTriggerState';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/menu",
|
|
3
|
-
"version": "3.2.4-nightly.
|
|
3
|
+
"version": "3.2.4-nightly.3064+5115b76b6",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-stately/overlays": "3.1.4-nightly.
|
|
22
|
-
"@react-stately/utils": "3.0.0-nightly.
|
|
23
|
-
"@react-types/menu": "3.4.2-nightly.
|
|
24
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
21
|
+
"@react-stately/overlays": "3.1.4-nightly.3064+5115b76b6",
|
|
22
|
+
"@react-stately/utils": "3.0.0-nightly.1373+5115b76b6",
|
|
23
|
+
"@react-types/menu": "3.4.2-nightly.3064+5115b76b6",
|
|
24
|
+
"@react-types/shared": "3.0.0-nightly.1373+5115b76b6"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "5115b76b63cba6843d5e7de2ef5ec3a41a1bff3c"
|
|
33
33
|
}
|