@react-stately/select 3.3.4-nightly.3598 → 3.3.4-nightly.3600
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 +24 -4
- package/dist/main.js.map +1 -1
- package/dist/module.mjs +24 -4
- package/dist/module.mjs.map +1 -1
- package/package.json +10 -10
package/dist/main.js
CHANGED
|
@@ -7,19 +7,39 @@ function $parcel$export(e, n, v, s) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
$parcel$export(module.exports, "useSelectState", () => $80ebb60e77198879$export$5159ec8b34d4ec12);
|
|
10
|
-
|
|
10
|
+
/*
|
|
11
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
12
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
17
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
18
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
|
+
* governing permissions and limitations under the License.
|
|
20
|
+
*/ /*
|
|
21
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
22
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
23
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
24
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
27
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
28
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
29
|
+
* governing permissions and limitations under the License.
|
|
30
|
+
*/
|
|
11
31
|
|
|
12
32
|
|
|
13
33
|
function $80ebb60e77198879$export$5159ec8b34d4ec12(props) {
|
|
14
|
-
let triggerState = $aJE2N$reactstatelymenu.useMenuTriggerState(props);
|
|
15
|
-
let listState = $aJE2N$reactstatelylist.useSingleSelectListState({
|
|
34
|
+
let triggerState = (0, $aJE2N$reactstatelymenu.useMenuTriggerState)(props);
|
|
35
|
+
let listState = (0, $aJE2N$reactstatelylist.useSingleSelectListState)({
|
|
16
36
|
...props,
|
|
17
37
|
onSelectionChange: (key)=>{
|
|
18
38
|
if (props.onSelectionChange != null) props.onSelectionChange(key);
|
|
19
39
|
triggerState.close();
|
|
20
40
|
}
|
|
21
41
|
});
|
|
22
|
-
let [isFocused, setFocused] = $aJE2N$react.useState(false);
|
|
42
|
+
let [isFocused, setFocused] = (0, $aJE2N$react.useState)(false);
|
|
23
43
|
return {
|
|
24
44
|
...listState,
|
|
25
45
|
...triggerState,
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;;AAkBO,SAAS,0CAAiC,KAAqB,EAAmB;IACvF,IAAI,eAAe,CAAA,GAAA,2CAAkB,EAAE;IACvC,IAAI,YAAY,CAAA,GAAA,gDAAuB,EAAE;QACvC,GAAG,KAAK;QACR,mBAAmB,CAAC,MAAQ;YAC1B,IAAI,MAAM,iBAAiB,IAAI,IAAI,EACjC,MAAM,iBAAiB,CAAC;YAG1B,aAAa,KAAK;QACpB;IACF;IAEA,IAAI,CAAC,WAAW,WAAW,GAAG,CAAA,GAAA,qBAAO,EAAE,KAAK;IAE5C,OAAO;QACL,GAAG,SAAS;QACZ,GAAG,YAAY;QACf,QAAO;YACL,yCAAyC;YACzC,IAAI,UAAU,UAAU,CAAC,IAAI,KAAK,GAChC,aAAa,IAAI;QAErB;QACA,QAAO,aAAa,EAAE;YACpB,IAAI,UAAU,UAAU,CAAC,IAAI,KAAK,GAChC,aAAa,MAAM,CAAC;QAExB;mBACA;oBACA;IACF;AACF;;CDpDC,GAED","sources":["packages/@react-stately/select/src/index.ts","packages/@react-stately/select/src/useSelectState.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 {useSelectState} from './useSelectState';\n\nexport type {SelectProps} from '@react-types/select';\nexport type {SelectState} from './useSelectState';\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 {MenuTriggerState, useMenuTriggerState} from '@react-stately/menu';\nimport {SelectProps} from '@react-types/select';\nimport {SingleSelectListState, useSingleSelectListState} from '@react-stately/list';\nimport {useState} from 'react';\n\nexport interface SelectState<T> extends SingleSelectListState<T>, MenuTriggerState {\n /** Whether the select is currently focused. */\n readonly isFocused: boolean,\n\n /** Sets whether the select is focused. */\n setFocused(isFocused: boolean): void\n}\n\n/**\n * Provides state management for a select component. Handles building a collection\n * of items from props, handles the open state for the popup menu, and manages\n * multiple selection state.\n */\nexport function useSelectState<T extends object>(props: SelectProps<T>): SelectState<T> {\n let triggerState = useMenuTriggerState(props);\n let listState = useSingleSelectListState({\n ...props,\n onSelectionChange: (key) => {\n if (props.onSelectionChange != null) {\n props.onSelectionChange(key);\n }\n\n triggerState.close();\n }\n });\n\n let [isFocused, setFocused] = useState(false);\n\n return {\n ...listState,\n ...triggerState,\n open() {\n // Don't open if the collection is empty.\n if (listState.collection.size !== 0) {\n triggerState.open();\n }\n },\n toggle(focusStrategy) {\n if (listState.collection.size !== 0) {\n triggerState.toggle(focusStrategy);\n }\n },\n isFocused,\n setFocused\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.mjs
CHANGED
|
@@ -2,19 +2,39 @@ import {useMenuTriggerState as $e17gp$useMenuTriggerState} from "@react-stately/
|
|
|
2
2
|
import {useSingleSelectListState as $e17gp$useSingleSelectListState} from "@react-stately/list";
|
|
3
3
|
import {useState as $e17gp$useState} from "react";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/*
|
|
6
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
7
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
* governing permissions and limitations under the License.
|
|
15
|
+
*/ /*
|
|
16
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
17
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
19
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
22
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
23
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
24
|
+
* governing permissions and limitations under the License.
|
|
25
|
+
*/
|
|
6
26
|
|
|
7
27
|
|
|
8
28
|
function $2bc3a590c5373a4e$export$5159ec8b34d4ec12(props) {
|
|
9
|
-
let triggerState = $e17gp$useMenuTriggerState(props);
|
|
10
|
-
let listState = $e17gp$useSingleSelectListState({
|
|
29
|
+
let triggerState = (0, $e17gp$useMenuTriggerState)(props);
|
|
30
|
+
let listState = (0, $e17gp$useSingleSelectListState)({
|
|
11
31
|
...props,
|
|
12
32
|
onSelectionChange: (key)=>{
|
|
13
33
|
if (props.onSelectionChange != null) props.onSelectionChange(key);
|
|
14
34
|
triggerState.close();
|
|
15
35
|
}
|
|
16
36
|
});
|
|
17
|
-
let [isFocused, setFocused] = $e17gp$useState(false);
|
|
37
|
+
let [isFocused, setFocused] = (0, $e17gp$useState)(false);
|
|
18
38
|
return {
|
|
19
39
|
...listState,
|
|
20
40
|
...triggerState,
|
package/dist/module.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;;AAkBO,SAAS,0CAAiC,KAAqB,EAAmB;IACvF,IAAI,eAAe,CAAA,GAAA,0BAAkB,EAAE;IACvC,IAAI,YAAY,CAAA,GAAA,+BAAuB,EAAE;QACvC,GAAG,KAAK;QACR,mBAAmB,CAAC,MAAQ;YAC1B,IAAI,MAAM,iBAAiB,IAAI,IAAI,EACjC,MAAM,iBAAiB,CAAC;YAG1B,aAAa,KAAK;QACpB;IACF;IAEA,IAAI,CAAC,WAAW,WAAW,GAAG,CAAA,GAAA,eAAO,EAAE,KAAK;IAE5C,OAAO;QACL,GAAG,SAAS;QACZ,GAAG,YAAY;QACf,QAAO;YACL,yCAAyC;YACzC,IAAI,UAAU,UAAU,CAAC,IAAI,KAAK,GAChC,aAAa,IAAI;QAErB;QACA,QAAO,aAAa,EAAE;YACpB,IAAI,UAAU,UAAU,CAAC,IAAI,KAAK,GAChC,aAAa,MAAM,CAAC;QAExB;mBACA;oBACA;IACF;AACF;;CDpDC,GAED","sources":["packages/@react-stately/select/src/index.ts","packages/@react-stately/select/src/useSelectState.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 {useSelectState} from './useSelectState';\n\nexport type {SelectProps} from '@react-types/select';\nexport type {SelectState} from './useSelectState';\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 {MenuTriggerState, useMenuTriggerState} from '@react-stately/menu';\nimport {SelectProps} from '@react-types/select';\nimport {SingleSelectListState, useSingleSelectListState} from '@react-stately/list';\nimport {useState} from 'react';\n\nexport interface SelectState<T> extends SingleSelectListState<T>, MenuTriggerState {\n /** Whether the select is currently focused. */\n readonly isFocused: boolean,\n\n /** Sets whether the select is focused. */\n setFocused(isFocused: boolean): void\n}\n\n/**\n * Provides state management for a select component. Handles building a collection\n * of items from props, handles the open state for the popup menu, and manages\n * multiple selection state.\n */\nexport function useSelectState<T extends object>(props: SelectProps<T>): SelectState<T> {\n let triggerState = useMenuTriggerState(props);\n let listState = useSingleSelectListState({\n ...props,\n onSelectionChange: (key) => {\n if (props.onSelectionChange != null) {\n props.onSelectionChange(key);\n }\n\n triggerState.close();\n }\n });\n\n let [isFocused, setFocused] = useState(false);\n\n return {\n ...listState,\n ...triggerState,\n open() {\n // Don't open if the collection is empty.\n if (listState.collection.size !== 0) {\n triggerState.open();\n }\n },\n toggle(focusStrategy) {\n if (listState.collection.size !== 0) {\n triggerState.toggle(focusStrategy);\n }\n },\n isFocused,\n setFocused\n };\n}\n"],"names":[],"version":3,"file":"module.mjs.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/select",
|
|
3
|
-
"version": "3.3.4-nightly.
|
|
3
|
+
"version": "3.3.4-nightly.3600+bfce84fee",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@
|
|
26
|
-
"@react-stately/
|
|
27
|
-
"@react-stately/
|
|
28
|
-
"@react-stately/
|
|
29
|
-
"@react-stately/
|
|
30
|
-
"@react-
|
|
31
|
-
"@react-types/
|
|
32
|
-
"@
|
|
25
|
+
"@react-stately/collections": "3.0.0-nightly.1900+bfce84fee",
|
|
26
|
+
"@react-stately/list": "3.6.1-nightly.3600+bfce84fee",
|
|
27
|
+
"@react-stately/menu": "3.4.4-nightly.3600+bfce84fee",
|
|
28
|
+
"@react-stately/selection": "3.0.0-nightly.1900+bfce84fee",
|
|
29
|
+
"@react-stately/utils": "3.0.0-nightly.1900+bfce84fee",
|
|
30
|
+
"@react-types/select": "3.6.6-nightly.3600+bfce84fee",
|
|
31
|
+
"@react-types/shared": "3.0.0-nightly.1900+bfce84fee",
|
|
32
|
+
"@swc/helpers": "^0.4.14"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "bfce84fee12a027d9cbc38b43e1747e3e4b4b169"
|
|
41
41
|
}
|