@react-spectrum/listbox 3.15.10 → 3.16.0
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/import.mjs +6 -4
- package/dist/main.js +10 -8
- package/dist/main.js.map +1 -1
- package/dist/module.js +6 -4
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +5 -0
- package/package.json +14 -42
- package/src/index.ts +6 -4
- package/dist/ListBox.main.js +0 -43
- package/dist/ListBox.main.js.map +0 -1
- package/dist/ListBox.mjs +0 -34
- package/dist/ListBox.module.js +0 -34
- package/dist/ListBox.module.js.map +0 -1
- package/dist/ListBoxBase.main.js +0 -165
- package/dist/ListBoxBase.main.js.map +0 -1
- package/dist/ListBoxBase.mjs +0 -159
- package/dist/ListBoxBase.module.js +0 -159
- package/dist/ListBoxBase.module.js.map +0 -1
- package/dist/ListBoxContext.main.js +0 -27
- package/dist/ListBoxContext.main.js.map +0 -1
- package/dist/ListBoxContext.mjs +0 -18
- package/dist/ListBoxContext.module.js +0 -18
- package/dist/ListBoxContext.module.js.map +0 -1
- package/dist/ListBoxLayout.main.js +0 -79
- package/dist/ListBoxLayout.main.js.map +0 -1
- package/dist/ListBoxLayout.mjs +0 -74
- package/dist/ListBoxLayout.module.js +0 -74
- package/dist/ListBoxLayout.module.js.map +0 -1
- package/dist/ListBoxOption.main.js +0 -105
- package/dist/ListBoxOption.main.js.map +0 -1
- package/dist/ListBoxOption.mjs +0 -100
- package/dist/ListBoxOption.module.js +0 -100
- package/dist/ListBoxOption.module.js.map +0 -1
- package/dist/ListBoxSection.main.js +0 -69
- package/dist/ListBoxSection.main.js.map +0 -1
- package/dist/ListBoxSection.mjs +0 -64
- package/dist/ListBoxSection.module.js +0 -64
- package/dist/ListBoxSection.module.js.map +0 -1
- package/dist/ar-AE.main.js +0 -7
- package/dist/ar-AE.main.js.map +0 -1
- package/dist/ar-AE.mjs +0 -9
- package/dist/ar-AE.module.js +0 -9
- package/dist/ar-AE.module.js.map +0 -1
- package/dist/bg-BG.main.js +0 -7
- package/dist/bg-BG.main.js.map +0 -1
- package/dist/bg-BG.mjs +0 -9
- package/dist/bg-BG.module.js +0 -9
- package/dist/bg-BG.module.js.map +0 -1
- package/dist/cs-CZ.main.js +0 -7
- package/dist/cs-CZ.main.js.map +0 -1
- package/dist/cs-CZ.mjs +0 -9
- package/dist/cs-CZ.module.js +0 -9
- package/dist/cs-CZ.module.js.map +0 -1
- package/dist/da-DK.main.js +0 -7
- package/dist/da-DK.main.js.map +0 -1
- package/dist/da-DK.mjs +0 -9
- package/dist/da-DK.module.js +0 -9
- package/dist/da-DK.module.js.map +0 -1
- package/dist/de-DE.main.js +0 -7
- package/dist/de-DE.main.js.map +0 -1
- package/dist/de-DE.mjs +0 -9
- package/dist/de-DE.module.js +0 -9
- package/dist/de-DE.module.js.map +0 -1
- package/dist/el-GR.main.js +0 -7
- package/dist/el-GR.main.js.map +0 -1
- package/dist/el-GR.mjs +0 -9
- package/dist/el-GR.module.js +0 -9
- package/dist/el-GR.module.js.map +0 -1
- package/dist/en-US.main.js +0 -7
- package/dist/en-US.main.js.map +0 -1
- package/dist/en-US.mjs +0 -9
- package/dist/en-US.module.js +0 -9
- package/dist/en-US.module.js.map +0 -1
- package/dist/es-ES.main.js +0 -7
- package/dist/es-ES.main.js.map +0 -1
- package/dist/es-ES.mjs +0 -9
- package/dist/es-ES.module.js +0 -9
- package/dist/es-ES.module.js.map +0 -1
- package/dist/et-EE.main.js +0 -7
- package/dist/et-EE.main.js.map +0 -1
- package/dist/et-EE.mjs +0 -9
- package/dist/et-EE.module.js +0 -9
- package/dist/et-EE.module.js.map +0 -1
- package/dist/fi-FI.main.js +0 -7
- package/dist/fi-FI.main.js.map +0 -1
- package/dist/fi-FI.mjs +0 -9
- package/dist/fi-FI.module.js +0 -9
- package/dist/fi-FI.module.js.map +0 -1
- package/dist/fr-FR.main.js +0 -7
- package/dist/fr-FR.main.js.map +0 -1
- package/dist/fr-FR.mjs +0 -9
- package/dist/fr-FR.module.js +0 -9
- package/dist/fr-FR.module.js.map +0 -1
- package/dist/he-IL.main.js +0 -7
- package/dist/he-IL.main.js.map +0 -1
- package/dist/he-IL.mjs +0 -9
- package/dist/he-IL.module.js +0 -9
- package/dist/he-IL.module.js.map +0 -1
- package/dist/hr-HR.main.js +0 -7
- package/dist/hr-HR.main.js.map +0 -1
- package/dist/hr-HR.mjs +0 -9
- package/dist/hr-HR.module.js +0 -9
- package/dist/hr-HR.module.js.map +0 -1
- package/dist/hu-HU.main.js +0 -7
- package/dist/hu-HU.main.js.map +0 -1
- package/dist/hu-HU.mjs +0 -9
- package/dist/hu-HU.module.js +0 -9
- package/dist/hu-HU.module.js.map +0 -1
- package/dist/intlStrings.main.js +0 -108
- package/dist/intlStrings.main.js.map +0 -1
- package/dist/intlStrings.mjs +0 -110
- package/dist/intlStrings.module.js +0 -110
- package/dist/intlStrings.module.js.map +0 -1
- package/dist/it-IT.main.js +0 -7
- package/dist/it-IT.main.js.map +0 -1
- package/dist/it-IT.mjs +0 -9
- package/dist/it-IT.module.js +0 -9
- package/dist/it-IT.module.js.map +0 -1
- package/dist/ja-JP.main.js +0 -7
- package/dist/ja-JP.main.js.map +0 -1
- package/dist/ja-JP.mjs +0 -9
- package/dist/ja-JP.module.js +0 -9
- package/dist/ja-JP.module.js.map +0 -1
- package/dist/ko-KR.main.js +0 -7
- package/dist/ko-KR.main.js.map +0 -1
- package/dist/ko-KR.mjs +0 -9
- package/dist/ko-KR.module.js +0 -9
- package/dist/ko-KR.module.js.map +0 -1
- package/dist/listbox.a566c7a6.css +0 -570
- package/dist/listbox.a566c7a6.css.map +0 -1
- package/dist/lt-LT.main.js +0 -7
- package/dist/lt-LT.main.js.map +0 -1
- package/dist/lt-LT.mjs +0 -9
- package/dist/lt-LT.module.js +0 -9
- package/dist/lt-LT.module.js.map +0 -1
- package/dist/lv-LV.main.js +0 -7
- package/dist/lv-LV.main.js.map +0 -1
- package/dist/lv-LV.mjs +0 -9
- package/dist/lv-LV.module.js +0 -9
- package/dist/lv-LV.module.js.map +0 -1
- package/dist/menu_vars_css.main.js +0 -177
- package/dist/menu_vars_css.main.js.map +0 -1
- package/dist/menu_vars_css.mjs +0 -179
- package/dist/menu_vars_css.module.js +0 -179
- package/dist/menu_vars_css.module.js.map +0 -1
- package/dist/nb-NO.main.js +0 -7
- package/dist/nb-NO.main.js.map +0 -1
- package/dist/nb-NO.mjs +0 -9
- package/dist/nb-NO.module.js +0 -9
- package/dist/nb-NO.module.js.map +0 -1
- package/dist/nl-NL.main.js +0 -7
- package/dist/nl-NL.main.js.map +0 -1
- package/dist/nl-NL.mjs +0 -9
- package/dist/nl-NL.module.js +0 -9
- package/dist/nl-NL.module.js.map +0 -1
- package/dist/pl-PL.main.js +0 -7
- package/dist/pl-PL.main.js.map +0 -1
- package/dist/pl-PL.mjs +0 -9
- package/dist/pl-PL.module.js +0 -9
- package/dist/pl-PL.module.js.map +0 -1
- package/dist/pt-BR.main.js +0 -7
- package/dist/pt-BR.main.js.map +0 -1
- package/dist/pt-BR.mjs +0 -9
- package/dist/pt-BR.module.js +0 -9
- package/dist/pt-BR.module.js.map +0 -1
- package/dist/pt-PT.main.js +0 -7
- package/dist/pt-PT.main.js.map +0 -1
- package/dist/pt-PT.mjs +0 -9
- package/dist/pt-PT.module.js +0 -9
- package/dist/pt-PT.module.js.map +0 -1
- package/dist/ro-RO.main.js +0 -7
- package/dist/ro-RO.main.js.map +0 -1
- package/dist/ro-RO.mjs +0 -9
- package/dist/ro-RO.module.js +0 -9
- package/dist/ro-RO.module.js.map +0 -1
- package/dist/ru-RU.main.js +0 -7
- package/dist/ru-RU.main.js.map +0 -1
- package/dist/ru-RU.mjs +0 -9
- package/dist/ru-RU.module.js +0 -9
- package/dist/ru-RU.module.js.map +0 -1
- package/dist/sk-SK.main.js +0 -7
- package/dist/sk-SK.main.js.map +0 -1
- package/dist/sk-SK.mjs +0 -9
- package/dist/sk-SK.module.js +0 -9
- package/dist/sk-SK.module.js.map +0 -1
- package/dist/sl-SI.main.js +0 -7
- package/dist/sl-SI.main.js.map +0 -1
- package/dist/sl-SI.mjs +0 -9
- package/dist/sl-SI.module.js +0 -9
- package/dist/sl-SI.module.js.map +0 -1
- package/dist/sr-SP.main.js +0 -7
- package/dist/sr-SP.main.js.map +0 -1
- package/dist/sr-SP.mjs +0 -9
- package/dist/sr-SP.module.js +0 -9
- package/dist/sr-SP.module.js.map +0 -1
- package/dist/sv-SE.main.js +0 -7
- package/dist/sv-SE.main.js.map +0 -1
- package/dist/sv-SE.mjs +0 -9
- package/dist/sv-SE.module.js +0 -9
- package/dist/sv-SE.module.js.map +0 -1
- package/dist/tr-TR.main.js +0 -7
- package/dist/tr-TR.main.js.map +0 -1
- package/dist/tr-TR.mjs +0 -9
- package/dist/tr-TR.module.js +0 -9
- package/dist/tr-TR.module.js.map +0 -1
- package/dist/types.d.ts +0 -52
- package/dist/types.d.ts.map +0 -1
- package/dist/uk-UA.main.js +0 -7
- package/dist/uk-UA.main.js.map +0 -1
- package/dist/uk-UA.mjs +0 -9
- package/dist/uk-UA.module.js +0 -9
- package/dist/uk-UA.module.js.map +0 -1
- package/dist/zh-CN.main.js +0 -7
- package/dist/zh-CN.main.js.map +0 -1
- package/dist/zh-CN.mjs +0 -9
- package/dist/zh-CN.module.js +0 -9
- package/dist/zh-CN.module.js.map +0 -1
- package/dist/zh-TW.main.js +0 -7
- package/dist/zh-TW.main.js.map +0 -1
- package/dist/zh-TW.mjs +0 -9
- package/dist/zh-TW.module.js +0 -9
- package/dist/zh-TW.module.js.map +0 -1
- package/src/ListBox.tsx +0 -39
- package/src/ListBoxBase.tsx +0 -183
- package/src/ListBoxContext.ts +0 -23
- package/src/ListBoxLayout.ts +0 -88
- package/src/ListBoxOption.tsx +0 -113
- package/src/ListBoxSection.tsx +0 -85
package/dist/import.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {ListBox as $
|
|
2
|
-
import {
|
|
3
|
-
import {Item as $
|
|
1
|
+
import {ListBox as $17aec7942a75a401$re_export$ListBox} from "@adobe/react-spectrum/ListBox";
|
|
2
|
+
import {useListBoxLayout as $17aec7942a75a401$re_export$useListBoxLayout, ListBoxBase as $17aec7942a75a401$re_export$ListBoxBase} from "@adobe/react-spectrum/private/listbox/ListBoxBase";
|
|
3
|
+
import {Item as $17aec7942a75a401$re_export$Item} from "react-stately/Item";
|
|
4
|
+
import {Section as $17aec7942a75a401$re_export$Section} from "react-stately/Section";
|
|
4
5
|
|
|
5
6
|
/*
|
|
6
7
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -18,5 +19,6 @@ import {Item as $ee97ea796309b076$re_export$Item, Section as $ee97ea796309b076$r
|
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
export {$17aec7942a75a401$re_export$ListBox as ListBox, $17aec7942a75a401$re_export$useListBoxLayout as useListBoxLayout, $17aec7942a75a401$re_export$ListBoxBase as ListBoxBase, $17aec7942a75a401$re_export$Item as Item, $17aec7942a75a401$re_export$Section as Section};
|
|
22
24
|
//# sourceMappingURL=module.js.map
|
package/dist/main.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
1
|
+
var $aSmhB$adobereactspectrumListBox = require("@adobe/react-spectrum/ListBox");
|
|
2
|
+
var $aSmhB$adobereactspectrumprivatelistboxListBoxBase = require("@adobe/react-spectrum/private/listbox/ListBoxBase");
|
|
3
|
+
var $aSmhB$reactstatelyItem = require("react-stately/Item");
|
|
4
|
+
var $aSmhB$reactstatelySection = require("react-stately/Section");
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
function $parcel$export(e, n, v, s) {
|
|
7
8
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
$parcel$export(module.exports, "ListBox", ()
|
|
11
|
-
$parcel$export(module.exports, "useListBoxLayout", ()
|
|
12
|
-
$parcel$export(module.exports, "ListBoxBase", ()
|
|
13
|
-
$parcel$export(module.exports, "Item", ()
|
|
14
|
-
$parcel$export(module.exports, "Section", ()
|
|
11
|
+
$parcel$export(module.exports, "ListBox", function () { return $aSmhB$adobereactspectrumListBox.ListBox; });
|
|
12
|
+
$parcel$export(module.exports, "useListBoxLayout", function () { return $aSmhB$adobereactspectrumprivatelistboxListBoxBase.useListBoxLayout; });
|
|
13
|
+
$parcel$export(module.exports, "ListBoxBase", function () { return $aSmhB$adobereactspectrumprivatelistboxListBoxBase.ListBoxBase; });
|
|
14
|
+
$parcel$export(module.exports, "Item", function () { return $aSmhB$reactstatelyItem.Item; });
|
|
15
|
+
$parcel$export(module.exports, "Section", function () { return $aSmhB$reactstatelySection.Section; });
|
|
15
16
|
/*
|
|
16
17
|
* Copyright 2020 Adobe. All rights reserved.
|
|
17
18
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -28,4 +29,5 @@ $parcel$export(module.exports, "Section", () => $3Fwf2$reactstatelycollections.S
|
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
|
|
32
|
+
|
|
31
33
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/listbox/src/index.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\n/// <reference types=\"css-module-types\" />\n\nexport {ListBox} from '@adobe/react-spectrum/ListBox';\n\nexport {useListBoxLayout, ListBoxBase} from '@adobe/react-spectrum/private/listbox/ListBoxBase';\nexport type {SpectrumListBoxProps} from '@adobe/react-spectrum/ListBox';\nexport {Item} from 'react-stately/Item';\nexport {Section} from 'react-stately/Section';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {ListBox as $
|
|
2
|
-
import {
|
|
3
|
-
import {Item as $
|
|
1
|
+
import {ListBox as $17aec7942a75a401$re_export$ListBox} from "@adobe/react-spectrum/ListBox";
|
|
2
|
+
import {useListBoxLayout as $17aec7942a75a401$re_export$useListBoxLayout, ListBoxBase as $17aec7942a75a401$re_export$ListBoxBase} from "@adobe/react-spectrum/private/listbox/ListBoxBase";
|
|
3
|
+
import {Item as $17aec7942a75a401$re_export$Item} from "react-stately/Item";
|
|
4
|
+
import {Section as $17aec7942a75a401$re_export$Section} from "react-stately/Section";
|
|
4
5
|
|
|
5
6
|
/*
|
|
6
7
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -18,5 +19,6 @@ import {Item as $ee97ea796309b076$re_export$Item, Section as $ee97ea796309b076$r
|
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
export {$17aec7942a75a401$re_export$ListBox as ListBox, $17aec7942a75a401$re_export$useListBoxLayout as useListBoxLayout, $17aec7942a75a401$re_export$ListBoxBase as ListBoxBase, $17aec7942a75a401$re_export$Item as Item, $17aec7942a75a401$re_export$Section as Section};
|
|
22
24
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/listbox/src/index.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\n/// <reference types=\"css-module-types\" />\n\nexport {ListBox} from '@adobe/react-spectrum/ListBox';\n\nexport {useListBoxLayout, ListBoxBase} from '@adobe/react-spectrum/private/listbox/ListBoxBase';\nexport type {SpectrumListBoxProps} from '@adobe/react-spectrum/ListBox';\nexport {Item} from 'react-stately/Item';\nexport {Section} from 'react-stately/Section';\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ListBox } from '@adobe/react-spectrum/ListBox';
|
|
2
|
+
export { useListBoxLayout, ListBoxBase } from '@adobe/react-spectrum/private/listbox/ListBoxBase';
|
|
3
|
+
export type { SpectrumListBoxProps } from '@adobe/react-spectrum/ListBox';
|
|
4
|
+
export { Item } from 'react-stately/Item';
|
|
5
|
+
export { Section } from 'react-stately/Section';
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/listbox",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/module.js",
|
|
8
8
|
"exports": {
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"./dist/types.d.ts",
|
|
12
|
-
"./
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
9
|
+
".": {
|
|
10
|
+
"source": "./src/index.ts",
|
|
11
|
+
"types": "./dist/types/src/index.d.ts",
|
|
12
|
+
"import": "./dist/import.mjs",
|
|
13
|
+
"require": "./dist/main.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
16
|
},
|
|
17
|
-
"types": "dist/types.d.ts",
|
|
17
|
+
"types": "dist/types/src/index.d.ts",
|
|
18
18
|
"source": "src/index.ts",
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
@@ -24,51 +24,23 @@
|
|
|
24
24
|
"*.css"
|
|
25
25
|
],
|
|
26
26
|
"targets": {
|
|
27
|
-
"
|
|
28
|
-
"includeNodeModules": [
|
|
29
|
-
"@adobe/spectrum-css-temp"
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
"module": {
|
|
33
|
-
"includeNodeModules": [
|
|
34
|
-
"@adobe/spectrum-css-temp"
|
|
35
|
-
]
|
|
36
|
-
}
|
|
27
|
+
"types": false
|
|
37
28
|
},
|
|
38
29
|
"repository": {
|
|
39
30
|
"type": "git",
|
|
40
31
|
"url": "https://github.com/adobe/react-spectrum"
|
|
41
32
|
},
|
|
42
33
|
"dependencies": {
|
|
43
|
-
"@react-
|
|
44
|
-
"@
|
|
45
|
-
"
|
|
46
|
-
"@react-aria/listbox": "^3.15.2",
|
|
47
|
-
"@react-aria/utils": "^3.33.0",
|
|
48
|
-
"@react-aria/virtualizer": "^4.1.12",
|
|
49
|
-
"@react-spectrum/layout": "^3.6.21",
|
|
50
|
-
"@react-spectrum/progress": "^3.7.22",
|
|
51
|
-
"@react-spectrum/text": "^3.5.24",
|
|
52
|
-
"@react-spectrum/utils": "^3.12.11",
|
|
53
|
-
"@react-stately/collections": "^3.12.9",
|
|
54
|
-
"@react-stately/layout": "^4.5.3",
|
|
55
|
-
"@react-stately/list": "^3.13.3",
|
|
56
|
-
"@react-stately/virtualizer": "^4.4.5",
|
|
57
|
-
"@react-types/listbox": "^3.7.5",
|
|
58
|
-
"@react-types/shared": "^3.33.0",
|
|
59
|
-
"@spectrum-icons/ui": "^3.6.22",
|
|
60
|
-
"@swc/helpers": "^0.5.0"
|
|
61
|
-
},
|
|
62
|
-
"devDependencies": {
|
|
63
|
-
"@adobe/spectrum-css-temp": "3.0.0-alpha.1"
|
|
34
|
+
"@adobe/react-spectrum": "3.47.0",
|
|
35
|
+
"@swc/helpers": "^0.5.0",
|
|
36
|
+
"react-stately": "3.46.0"
|
|
64
37
|
},
|
|
65
38
|
"peerDependencies": {
|
|
66
|
-
"@react-spectrum/provider": "^3.2.0",
|
|
67
39
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
68
40
|
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
69
41
|
},
|
|
70
42
|
"publishConfig": {
|
|
71
43
|
"access": "public"
|
|
72
44
|
},
|
|
73
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
|
|
74
46
|
}
|
package/src/index.ts
CHANGED
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
/// <reference types="css-module-types" />
|
|
14
14
|
|
|
15
|
-
export {ListBox} from '
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
export type {SpectrumListBoxProps} from '@react-
|
|
15
|
+
export {ListBox} from '@adobe/react-spectrum/ListBox';
|
|
16
|
+
|
|
17
|
+
export {useListBoxLayout, ListBoxBase} from '@adobe/react-spectrum/private/listbox/ListBoxBase';
|
|
18
|
+
export type {SpectrumListBoxProps} from '@adobe/react-spectrum/ListBox';
|
|
19
|
+
export {Item} from 'react-stately/Item';
|
|
20
|
+
export {Section} from 'react-stately/Section';
|
package/dist/ListBox.main.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
var $60eb4b34c53310cb$exports = require("./ListBoxBase.main.js");
|
|
2
|
-
var $kvNjb$react = require("react");
|
|
3
|
-
var $kvNjb$reactspectrumutils = require("@react-spectrum/utils");
|
|
4
|
-
var $kvNjb$reactstatelylist = require("@react-stately/list");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function $parcel$interopDefault(a) {
|
|
8
|
-
return a && a.__esModule ? a.default : a;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function $parcel$export(e, n, v, s) {
|
|
12
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
$parcel$export(module.exports, "ListBox", () => $582d86e45be55635$export$41f133550aa26f48);
|
|
16
|
-
/*
|
|
17
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
18
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
19
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
20
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
21
|
-
*
|
|
22
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
23
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
24
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
25
|
-
* governing permissions and limitations under the License.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const $582d86e45be55635$export$41f133550aa26f48 = /*#__PURE__*/ (0, ($parcel$interopDefault($kvNjb$react))).forwardRef(function ListBox(props, ref) {
|
|
31
|
-
let state = (0, $kvNjb$reactstatelylist.useListState)(props);
|
|
32
|
-
let layout = (0, $60eb4b34c53310cb$exports.useListBoxLayout)();
|
|
33
|
-
let domRef = (0, $kvNjb$reactspectrumutils.useDOMRef)(ref);
|
|
34
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($kvNjb$react))).createElement((0, $60eb4b34c53310cb$exports.ListBoxBase), {
|
|
35
|
-
...props,
|
|
36
|
-
ref: domRef,
|
|
37
|
-
state: state,
|
|
38
|
-
layout: layout
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
//# sourceMappingURL=ListBox.main.js.map
|
package/dist/ListBox.main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAgBM,MAAM,0DAAU,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,QAA0B,KAA8B,EAAE,GAA2B;IACpI,IAAI,QAAQ,CAAA,GAAA,oCAAW,EAAE;IACzB,IAAI,SAAS,CAAA,GAAA,0CAAe;IAC5B,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,0DAAC,CAAA,GAAA,qCAAU;QACR,GAAG,KAAK;QACT,KAAK;QACL,OAAO;QACP,QAAQ;;AAEd","sources":["packages/@react-spectrum/listbox/src/ListBox.tsx"],"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\nimport {DOMRef} from '@react-types/shared';\nimport {ListBoxBase, useListBoxLayout} from './ListBoxBase';\nimport React, {ReactElement} from 'react';\nimport {SpectrumListBoxProps} from '@react-types/listbox';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useListState} from '@react-stately/list';\n\n// forwardRef doesn't support generic parameters, so cast the result to the correct type\n// https://stackoverflow.com/questions/58469229/react-with-typescript-generics-while-using-react-forwardref\n\n\n/**\n * A list of options that can allow selection of one or more.\n */\nexport const ListBox = React.forwardRef(function ListBox<T extends object>(props: SpectrumListBoxProps<T>, ref: DOMRef<HTMLDivElement>) {\n let state = useListState(props);\n let layout = useListBoxLayout();\n let domRef = useDOMRef(ref);\n\n return (\n <ListBoxBase\n {...props}\n ref={domRef}\n state={state}\n layout={layout} />\n );\n}) as <T>(props: SpectrumListBoxProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"ListBox.main.js.map"}
|
package/dist/ListBox.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {ListBoxBase as $3247d4a89e6094e9$export$1afdcf349979fb7e, useListBoxLayout as $3247d4a89e6094e9$export$25768ea656ae32a7} from "./ListBoxBase.mjs";
|
|
2
|
-
import $7rJGh$react from "react";
|
|
3
|
-
import {useDOMRef as $7rJGh$useDOMRef} from "@react-spectrum/utils";
|
|
4
|
-
import {useListState as $7rJGh$useListState} from "@react-stately/list";
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
8
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
10
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
13
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
|
-
* governing permissions and limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const $3136257018b1a220$export$41f133550aa26f48 = /*#__PURE__*/ (0, $7rJGh$react).forwardRef(function ListBox(props, ref) {
|
|
21
|
-
let state = (0, $7rJGh$useListState)(props);
|
|
22
|
-
let layout = (0, $3247d4a89e6094e9$export$25768ea656ae32a7)();
|
|
23
|
-
let domRef = (0, $7rJGh$useDOMRef)(ref);
|
|
24
|
-
return /*#__PURE__*/ (0, $7rJGh$react).createElement((0, $3247d4a89e6094e9$export$1afdcf349979fb7e), {
|
|
25
|
-
...props,
|
|
26
|
-
ref: domRef,
|
|
27
|
-
state: state,
|
|
28
|
-
layout: layout
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export {$3136257018b1a220$export$41f133550aa26f48 as ListBox};
|
|
34
|
-
//# sourceMappingURL=ListBox.module.js.map
|
package/dist/ListBox.module.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {ListBoxBase as $3247d4a89e6094e9$export$1afdcf349979fb7e, useListBoxLayout as $3247d4a89e6094e9$export$25768ea656ae32a7} from "./ListBoxBase.module.js";
|
|
2
|
-
import $7rJGh$react from "react";
|
|
3
|
-
import {useDOMRef as $7rJGh$useDOMRef} from "@react-spectrum/utils";
|
|
4
|
-
import {useListState as $7rJGh$useListState} from "@react-stately/list";
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
8
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
10
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
13
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
|
-
* governing permissions and limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const $3136257018b1a220$export$41f133550aa26f48 = /*#__PURE__*/ (0, $7rJGh$react).forwardRef(function ListBox(props, ref) {
|
|
21
|
-
let state = (0, $7rJGh$useListState)(props);
|
|
22
|
-
let layout = (0, $3247d4a89e6094e9$export$25768ea656ae32a7)();
|
|
23
|
-
let domRef = (0, $7rJGh$useDOMRef)(ref);
|
|
24
|
-
return /*#__PURE__*/ (0, $7rJGh$react).createElement((0, $3247d4a89e6094e9$export$1afdcf349979fb7e), {
|
|
25
|
-
...props,
|
|
26
|
-
ref: domRef,
|
|
27
|
-
state: state,
|
|
28
|
-
layout: layout
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export {$3136257018b1a220$export$41f133550aa26f48 as ListBox};
|
|
34
|
-
//# sourceMappingURL=ListBox.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAgBM,MAAM,0DAAU,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,QAA0B,KAA8B,EAAE,GAA2B;IACpI,IAAI,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACzB,IAAI,SAAS,CAAA,GAAA,yCAAe;IAC5B,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,yCAAU;QACR,GAAG,KAAK;QACT,KAAK;QACL,OAAO;QACP,QAAQ;;AAEd","sources":["packages/@react-spectrum/listbox/src/ListBox.tsx"],"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\nimport {DOMRef} from '@react-types/shared';\nimport {ListBoxBase, useListBoxLayout} from './ListBoxBase';\nimport React, {ReactElement} from 'react';\nimport {SpectrumListBoxProps} from '@react-types/listbox';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useListState} from '@react-stately/list';\n\n// forwardRef doesn't support generic parameters, so cast the result to the correct type\n// https://stackoverflow.com/questions/58469229/react-with-typescript-generics-while-using-react-forwardref\n\n\n/**\n * A list of options that can allow selection of one or more.\n */\nexport const ListBox = React.forwardRef(function ListBox<T extends object>(props: SpectrumListBoxProps<T>, ref: DOMRef<HTMLDivElement>) {\n let state = useListState(props);\n let layout = useListBoxLayout();\n let domRef = useDOMRef(ref);\n\n return (\n <ListBoxBase\n {...props}\n ref={domRef}\n state={state}\n layout={layout} />\n );\n}) as <T>(props: SpectrumListBoxProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"ListBox.module.js.map"}
|
package/dist/ListBoxBase.main.js
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
var $3d9fe9b46e2d649a$exports = require("./intlStrings.main.js");
|
|
2
|
-
var $611e93c7b7c0413c$exports = require("./ListBoxContext.main.js");
|
|
3
|
-
var $570d5c216669f686$exports = require("./ListBoxLayout.main.js");
|
|
4
|
-
var $2205d250ee1cb1ac$exports = require("./ListBoxOption.main.js");
|
|
5
|
-
var $0f5fd8483f48ef09$exports = require("./ListBoxSection.main.js");
|
|
6
|
-
require("./listbox.a566c7a6.css");
|
|
7
|
-
var $3deee0fd2b46e64f$exports = require("./menu_vars_css.main.js");
|
|
8
|
-
var $7w19U$reactarialistbox = require("@react-aria/listbox");
|
|
9
|
-
var $7w19U$reactspectrumutils = require("@react-spectrum/utils");
|
|
10
|
-
var $7w19U$reactariafocus = require("@react-aria/focus");
|
|
11
|
-
var $7w19U$reactariautils = require("@react-aria/utils");
|
|
12
|
-
var $7w19U$reactspectrumprogress = require("@react-spectrum/progress");
|
|
13
|
-
var $7w19U$react = require("react");
|
|
14
|
-
var $7w19U$reactariai18n = require("@react-aria/i18n");
|
|
15
|
-
var $7w19U$reactspectrumprovider = require("@react-spectrum/provider");
|
|
16
|
-
var $7w19U$reactariavirtualizer = require("@react-aria/virtualizer");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function $parcel$interopDefault(a) {
|
|
20
|
-
return a && a.__esModule ? a.default : a;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function $parcel$export(e, n, v, s) {
|
|
24
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
$parcel$export(module.exports, "useListBoxLayout", () => $60eb4b34c53310cb$export$25768ea656ae32a7);
|
|
28
|
-
$parcel$export(module.exports, "ListBoxBase", () => $60eb4b34c53310cb$export$1afdcf349979fb7e);
|
|
29
|
-
/*
|
|
30
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
31
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
32
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
33
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
34
|
-
*
|
|
35
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
36
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
37
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
38
|
-
* governing permissions and limitations under the License.
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
function $60eb4b34c53310cb$export$25768ea656ae32a7() {
|
|
55
|
-
let { scale: scale } = (0, $7w19U$reactspectrumprovider.useProvider)();
|
|
56
|
-
let layout = (0, $7w19U$react.useMemo)(()=>new (0, $570d5c216669f686$exports.ListBoxLayout)({
|
|
57
|
-
estimatedRowHeight: scale === 'large' ? 48 : 32,
|
|
58
|
-
estimatedHeadingHeight: scale === 'large' ? 33 : 26,
|
|
59
|
-
paddingY: scale === 'large' ? 5 : 4,
|
|
60
|
-
placeholderHeight: scale === 'large' ? 48 : 32
|
|
61
|
-
}), [
|
|
62
|
-
scale
|
|
63
|
-
]);
|
|
64
|
-
return layout;
|
|
65
|
-
}
|
|
66
|
-
const $60eb4b34c53310cb$export$1afdcf349979fb7e = /*#__PURE__*/ (0, ($parcel$interopDefault($7w19U$react))).forwardRef(function ListBoxBase(props, ref) {
|
|
67
|
-
let { layout: layout, state: state, shouldFocusOnHover: shouldFocusOnHover = false, shouldUseVirtualFocus: shouldUseVirtualFocus = false, domProps: domProps = {}, isLoading: isLoading, showLoadingSpinner: showLoadingSpinner = isLoading, onScroll: onScroll, renderEmptyState: renderEmptyState } = props;
|
|
68
|
-
let objectRef = (0, $7w19U$reactariautils.useObjectRef)(ref);
|
|
69
|
-
let { listBoxProps: listBoxProps } = (0, $7w19U$reactarialistbox.useListBox)({
|
|
70
|
-
...props,
|
|
71
|
-
layoutDelegate: layout,
|
|
72
|
-
isVirtualized: true
|
|
73
|
-
}, state, objectRef);
|
|
74
|
-
let { styleProps: styleProps } = (0, $7w19U$reactspectrumutils.useStyleProps)(props);
|
|
75
|
-
let renderWrapper = (0, $7w19U$react.useCallback)((parent, reusableView, children, renderChildren)=>{
|
|
76
|
-
var _children_find;
|
|
77
|
-
var _children_find_layoutInfo;
|
|
78
|
-
if (reusableView.viewType === 'section') return /*#__PURE__*/ (0, ($parcel$interopDefault($7w19U$react))).createElement((0, $0f5fd8483f48ef09$exports.ListBoxSection), {
|
|
79
|
-
key: reusableView.key,
|
|
80
|
-
item: reusableView.content,
|
|
81
|
-
layoutInfo: reusableView.layoutInfo,
|
|
82
|
-
virtualizer: reusableView.virtualizer,
|
|
83
|
-
headerLayoutInfo: (_children_find_layoutInfo = (_children_find = children.find((c)=>c.viewType === 'header')) === null || _children_find === void 0 ? void 0 : _children_find.layoutInfo) !== null && _children_find_layoutInfo !== void 0 ? _children_find_layoutInfo : null
|
|
84
|
-
}, renderChildren(children.filter((c)=>c.viewType === 'item')));
|
|
85
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($7w19U$react))).createElement((0, $7w19U$reactariavirtualizer.VirtualizerItem), {
|
|
86
|
-
key: reusableView.key,
|
|
87
|
-
layoutInfo: reusableView.layoutInfo,
|
|
88
|
-
virtualizer: reusableView.virtualizer,
|
|
89
|
-
parent: parent === null || parent === void 0 ? void 0 : parent.layoutInfo
|
|
90
|
-
}, reusableView.rendered);
|
|
91
|
-
}, []);
|
|
92
|
-
let focusedKey = state.selectionManager.focusedKey;
|
|
93
|
-
let persistedKeys = (0, $7w19U$react.useMemo)(()=>focusedKey != null ? new Set([
|
|
94
|
-
focusedKey
|
|
95
|
-
]) : null, [
|
|
96
|
-
focusedKey
|
|
97
|
-
]);
|
|
98
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($7w19U$react))).createElement((0, $611e93c7b7c0413c$exports.ListBoxContext).Provider, {
|
|
99
|
-
value: {
|
|
100
|
-
state: state,
|
|
101
|
-
renderEmptyState: renderEmptyState,
|
|
102
|
-
shouldFocusOnHover: shouldFocusOnHover,
|
|
103
|
-
shouldUseVirtualFocus: shouldUseVirtualFocus
|
|
104
|
-
}
|
|
105
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($7w19U$react))).createElement((0, $7w19U$reactariafocus.FocusScope), null, /*#__PURE__*/ (0, ($parcel$interopDefault($7w19U$react))).createElement((0, $7w19U$reactariavirtualizer.Virtualizer), {
|
|
106
|
-
...styleProps,
|
|
107
|
-
...(0, $7w19U$reactariautils.mergeProps)(listBoxProps, domProps),
|
|
108
|
-
ref: objectRef,
|
|
109
|
-
persistedKeys: persistedKeys,
|
|
110
|
-
autoFocus: !!props.autoFocus || undefined,
|
|
111
|
-
scrollDirection: "vertical",
|
|
112
|
-
className: (0, $7w19U$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3deee0fd2b46e64f$exports))), 'spectrum-Menu', styleProps.className),
|
|
113
|
-
layout: layout,
|
|
114
|
-
layoutOptions: (0, $7w19U$react.useMemo)(()=>({
|
|
115
|
-
isLoading: showLoadingSpinner
|
|
116
|
-
}), [
|
|
117
|
-
showLoadingSpinner
|
|
118
|
-
]),
|
|
119
|
-
collection: state.collection,
|
|
120
|
-
renderWrapper: renderWrapper,
|
|
121
|
-
isLoading: isLoading,
|
|
122
|
-
onLoadMore: props.onLoadMore,
|
|
123
|
-
onScroll: onScroll
|
|
124
|
-
}, (0, $7w19U$react.useCallback)((type, item)=>{
|
|
125
|
-
if (type === 'item') return /*#__PURE__*/ (0, ($parcel$interopDefault($7w19U$react))).createElement((0, $2205d250ee1cb1ac$exports.ListBoxOption), {
|
|
126
|
-
item: item
|
|
127
|
-
});
|
|
128
|
-
else if (type === 'loader') return /*#__PURE__*/ (0, ($parcel$interopDefault($7w19U$react))).createElement($60eb4b34c53310cb$var$LoadingState, null);
|
|
129
|
-
else if (type === 'placeholder') return /*#__PURE__*/ (0, ($parcel$interopDefault($7w19U$react))).createElement($60eb4b34c53310cb$var$EmptyState, null);
|
|
130
|
-
else return null;
|
|
131
|
-
}, []))));
|
|
132
|
-
});
|
|
133
|
-
function $60eb4b34c53310cb$var$LoadingState() {
|
|
134
|
-
let { state: state } = (0, $7w19U$react.useContext)((0, $611e93c7b7c0413c$exports.ListBoxContext));
|
|
135
|
-
let stringFormatter = (0, $7w19U$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($3d9fe9b46e2d649a$exports))), '@react-spectrum/listbox');
|
|
136
|
-
return(// aria-selected isn't needed here since this option is not selectable.
|
|
137
|
-
// eslint-disable-next-line jsx-a11y/role-has-required-aria-props
|
|
138
|
-
/*#__PURE__*/ (0, ($parcel$interopDefault($7w19U$react))).createElement("div", {
|
|
139
|
-
role: "option",
|
|
140
|
-
style: {
|
|
141
|
-
display: 'flex',
|
|
142
|
-
alignItems: 'center',
|
|
143
|
-
justifyContent: 'center',
|
|
144
|
-
height: '100%'
|
|
145
|
-
}
|
|
146
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($7w19U$react))).createElement((0, $7w19U$reactspectrumprogress.ProgressCircle), {
|
|
147
|
-
isIndeterminate: true,
|
|
148
|
-
size: "S",
|
|
149
|
-
"aria-label": state.collection.size > 0 ? stringFormatter.format('loadingMore') : stringFormatter.format('loading'),
|
|
150
|
-
UNSAFE_className: (0, $7w19U$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3deee0fd2b46e64f$exports))), 'spectrum-Dropdown-progressCircle')
|
|
151
|
-
})));
|
|
152
|
-
}
|
|
153
|
-
function $60eb4b34c53310cb$var$EmptyState() {
|
|
154
|
-
let { renderEmptyState: renderEmptyState } = (0, $7w19U$react.useContext)((0, $611e93c7b7c0413c$exports.ListBoxContext));
|
|
155
|
-
let emptyState = renderEmptyState ? renderEmptyState() : null;
|
|
156
|
-
if (emptyState == null) return null;
|
|
157
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($7w19U$react))).createElement("div", {
|
|
158
|
-
// aria-selected isn't needed here since this option is not selectable.
|
|
159
|
-
// eslint-disable-next-line jsx-a11y/role-has-required-aria-props
|
|
160
|
-
role: "option"
|
|
161
|
-
}, emptyState);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
//# sourceMappingURL=ListBoxBase.main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"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","sources":["packages/@react-spectrum/listbox/src/ListBoxBase.tsx"],"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\nimport {AriaLabelingProps, DOMProps, FocusStrategy, Node, RefObject, StyleProps} from '@react-types/shared';\nimport {AriaListBoxOptions, useListBox} from '@react-aria/listbox';\nimport {classNames, useStyleProps} from '@react-spectrum/utils';\nimport {FocusScope} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListBoxContext} from './ListBoxContext';\nimport {ListBoxLayout} from './ListBoxLayout';\nimport {ListBoxOption} from './ListBoxOption';\nimport {ListBoxSection} from './ListBoxSection';\nimport {ListState} from '@react-stately/list';\nimport {mergeProps, useObjectRef} from '@react-aria/utils';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {ForwardedRef, HTMLAttributes, ReactElement, ReactNode, useCallback, useContext, useMemo} from 'react';\nimport {ReusableView} from '@react-stately/virtualizer';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProvider} from '@react-spectrum/provider';\nimport {Virtualizer, VirtualizerItem} from '@react-aria/virtualizer';\n\ninterface ListBoxBaseProps<T> extends AriaListBoxOptions<T>, DOMProps, AriaLabelingProps, StyleProps {\n layout: ListBoxLayout<T>,\n state: ListState<T>,\n autoFocus?: boolean | FocusStrategy,\n shouldFocusWrap?: boolean,\n shouldSelectOnPressUp?: boolean,\n focusOnPointerEnter?: boolean,\n domProps?: HTMLAttributes<HTMLElement>,\n disallowEmptySelection?: boolean,\n shouldUseVirtualFocus?: boolean,\n isLoading?: boolean,\n showLoadingSpinner?: boolean,\n onLoadMore?: () => void,\n renderEmptyState?: () => ReactNode,\n onScroll?: () => void\n}\n\n/** @private */\nexport function useListBoxLayout<T>(): ListBoxLayout<T> {\n let {scale} = useProvider();\n let layout = useMemo(() =>\n new ListBoxLayout<T>({\n estimatedRowHeight: scale === 'large' ? 48 : 32,\n estimatedHeadingHeight: scale === 'large' ? 33 : 26,\n paddingY: scale === 'large' ? 5 : 4, // TODO: get from DNA\n placeholderHeight: scale === 'large' ? 48 : 32\n })\n , [scale]);\n\n return layout;\n}\n\n// forwardRef doesn't support generic parameters, so cast the result to the correct type\n// https://stackoverflow.com/questions/58469229/react-with-typescript-generics-while-using-react-forwardref\n/** @private */\nexport const ListBoxBase = React.forwardRef(function ListBoxBase<T extends object>(props: ListBoxBaseProps<T>, ref: ForwardedRef<HTMLDivElement | null>) {\n let {layout, state, shouldFocusOnHover = false, shouldUseVirtualFocus = false, domProps = {}, isLoading, showLoadingSpinner = isLoading, onScroll, renderEmptyState} = props;\n let objectRef = useObjectRef(ref);\n let {listBoxProps} = useListBox({\n ...props,\n layoutDelegate: layout,\n isVirtualized: true\n }, state, objectRef);\n let {styleProps} = useStyleProps(props);\n\n // This overrides collection view's renderWrapper to support hierarchy of items in sections.\n // The header is extracted from the children so it can receive ARIA labeling properties.\n type View = ReusableView<Node<T>, ReactNode>;\n let renderWrapper = useCallback((parent: View | null, reusableView: View, children: View[], renderChildren: (views: View[]) => ReactElement[]) => {\n if (reusableView.viewType === 'section') {\n return (\n <ListBoxSection\n key={reusableView.key}\n item={reusableView.content!}\n layoutInfo={reusableView.layoutInfo!}\n virtualizer={reusableView.virtualizer}\n headerLayoutInfo={children.find(c => c.viewType === 'header')?.layoutInfo ?? null}>\n {renderChildren(children.filter(c => c.viewType === 'item'))}\n </ListBoxSection>\n );\n }\n\n return (\n <VirtualizerItem\n key={reusableView.key}\n layoutInfo={reusableView.layoutInfo!}\n virtualizer={reusableView.virtualizer}\n parent={parent?.layoutInfo}>\n {reusableView.rendered}\n </VirtualizerItem>\n );\n }, []);\n\n let focusedKey = state.selectionManager.focusedKey;\n let persistedKeys = useMemo(() => focusedKey != null ? new Set([focusedKey]) : null, [focusedKey]);\n\n return (\n <ListBoxContext.Provider value={{state, renderEmptyState, shouldFocusOnHover, shouldUseVirtualFocus}}>\n <FocusScope>\n <Virtualizer\n {...styleProps}\n {...mergeProps(listBoxProps, domProps)}\n ref={objectRef}\n persistedKeys={persistedKeys}\n autoFocus={!!props.autoFocus || undefined}\n scrollDirection=\"vertical\"\n className={\n classNames(\n styles,\n 'spectrum-Menu',\n styleProps.className\n )\n }\n layout={layout}\n layoutOptions={useMemo(() => ({\n isLoading: showLoadingSpinner\n }), [showLoadingSpinner])}\n collection={state.collection}\n renderWrapper={renderWrapper}\n isLoading={isLoading}\n onLoadMore={props.onLoadMore}\n onScroll={onScroll}>\n {useCallback((type, item: Node<T>): ReactNode => {\n if (type === 'item') {\n return <ListBoxOption item={item} />;\n } else if (type === 'loader') {\n return <LoadingState />;\n } else if (type === 'placeholder') {\n return <EmptyState />;\n } else {\n return null;\n }\n }, [])}\n </Virtualizer>\n </FocusScope>\n </ListBoxContext.Provider>\n );\n}) as <T>(props: ListBoxBaseProps<T> & {ref?: RefObject<HTMLDivElement | null>}) => ReactElement;\n\nfunction LoadingState() {\n let {state} = useContext(ListBoxContext)!;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/listbox');\n return (\n // aria-selected isn't needed here since this option is not selectable.\n // eslint-disable-next-line jsx-a11y/role-has-required-aria-props\n <div role=\"option\" style={{display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%'}}>\n <ProgressCircle\n isIndeterminate\n size=\"S\"\n aria-label={state.collection.size > 0 ? stringFormatter.format('loadingMore') : stringFormatter.format('loading')}\n UNSAFE_className={classNames(styles, 'spectrum-Dropdown-progressCircle')} />\n </div>\n );\n}\n\nfunction EmptyState() {\n let {renderEmptyState} = useContext(ListBoxContext)!;\n let emptyState = renderEmptyState ? renderEmptyState() : null;\n if (emptyState == null) {\n return null;\n }\n\n return (\n <div\n // aria-selected isn't needed here since this option is not selectable.\n // eslint-disable-next-line jsx-a11y/role-has-required-aria-props\n role=\"option\">\n {emptyState}\n </div>\n );\n}\n"],"names":[],"version":3,"file":"ListBoxBase.main.js.map"}
|