@react-spectrum/listbox 3.12.8-nightly.4552 → 3.12.8-nightly.4558
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/ListBox.main.js +48 -0
- package/dist/ListBox.main.js.map +1 -0
- package/dist/ListBox.mjs +39 -0
- package/dist/ListBox.module.js +39 -0
- package/dist/ListBox.module.js.map +1 -0
- package/dist/ListBoxBase.main.js +168 -0
- package/dist/ListBoxBase.main.js.map +1 -0
- package/dist/ListBoxBase.mjs +162 -0
- package/dist/ListBoxBase.module.js +162 -0
- package/dist/ListBoxBase.module.js.map +1 -0
- package/dist/ListBoxContext.main.js +27 -0
- package/dist/ListBoxContext.main.js.map +1 -0
- package/dist/ListBoxContext.mjs +18 -0
- package/dist/ListBoxContext.module.js +18 -0
- package/dist/ListBoxContext.module.js.map +1 -0
- package/dist/ListBoxOption.main.js +108 -0
- package/dist/ListBoxOption.main.js.map +1 -0
- package/dist/ListBoxOption.mjs +103 -0
- package/dist/ListBoxOption.module.js +103 -0
- package/dist/ListBoxOption.module.js.map +1 -0
- package/dist/ListBoxSection.main.js +69 -0
- package/dist/ListBoxSection.main.js.map +1 -0
- package/dist/ListBoxSection.mjs +64 -0
- package/dist/ListBoxSection.module.js +64 -0
- package/dist/ListBoxSection.module.js.map +1 -0
- package/dist/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/import.mjs +2 -615
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/main.js +5 -614
- package/dist/main.js.map +1 -1
- package/dist/menu_vars_css.main.js +177 -0
- package/dist/menu_vars_css.main.js.map +1 -0
- package/dist/menu_vars_css.mjs +179 -0
- package/dist/menu_vars_css.module.js +179 -0
- package/dist/menu_vars_css.module.js.map +1 -0
- package/dist/module.js +2 -615
- package/dist/module.js.map +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/{main.css → vars.5bf8960a.css} +1 -1
- package/dist/{main.css.map → vars.5bf8960a.css.map} +1 -1
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +20 -20
- package/dist/module.css +0 -563
- package/dist/module.css.map +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var $611e93c7b7c0413c$exports = require("./ListBoxContext.main.js");
|
|
2
|
+
require("./vars.5bf8960a.css");
|
|
3
|
+
var $3deee0fd2b46e64f$exports = require("./menu_vars_css.main.js");
|
|
4
|
+
var $cCu2p$reactspectrumutils = require("@react-spectrum/utils");
|
|
5
|
+
var $cCu2p$reactariavirtualizer = require("@react-aria/virtualizer");
|
|
6
|
+
var $cCu2p$react = require("react");
|
|
7
|
+
var $cCu2p$reactarialistbox = require("@react-aria/listbox");
|
|
8
|
+
var $cCu2p$reactariai18n = require("@react-aria/i18n");
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
function $parcel$interopDefault(a) {
|
|
12
|
+
return a && a.__esModule ? a.default : a;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function $parcel$export(e, n, v, s) {
|
|
16
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
$parcel$export(module.exports, "ListBoxSection", () => $0f5fd8483f48ef09$export$dca12b0bb56e4fc);
|
|
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
|
+
*/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
function $0f5fd8483f48ef09$export$dca12b0bb56e4fc(props) {
|
|
38
|
+
let { children: children, layoutInfo: layoutInfo, headerLayoutInfo: headerLayoutInfo, virtualizer: virtualizer, item: item } = props;
|
|
39
|
+
let { headingProps: headingProps, groupProps: groupProps } = (0, $cCu2p$reactarialistbox.useListBoxSection)({
|
|
40
|
+
heading: item.rendered,
|
|
41
|
+
"aria-label": item["aria-label"]
|
|
42
|
+
});
|
|
43
|
+
let headerRef = (0, $cCu2p$react.useRef)();
|
|
44
|
+
(0, $cCu2p$reactariavirtualizer.useVirtualizerItem)({
|
|
45
|
+
layoutInfo: headerLayoutInfo,
|
|
46
|
+
virtualizer: virtualizer,
|
|
47
|
+
ref: headerRef
|
|
48
|
+
});
|
|
49
|
+
let { direction: direction } = (0, $cCu2p$reactariai18n.useLocale)();
|
|
50
|
+
let state = (0, $cCu2p$react.useContext)((0, $611e93c7b7c0413c$exports.ListBoxContext));
|
|
51
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($cCu2p$react))).createElement((0, $cCu2p$react.Fragment), null, /*#__PURE__*/ (0, ($parcel$interopDefault($cCu2p$react))).createElement("div", {
|
|
52
|
+
role: "presentation",
|
|
53
|
+
ref: headerRef,
|
|
54
|
+
style: (0, $cCu2p$reactariavirtualizer.layoutInfoToStyle)(headerLayoutInfo, direction)
|
|
55
|
+
}, item.key !== state.collection.getFirstKey() && /*#__PURE__*/ (0, ($parcel$interopDefault($cCu2p$react))).createElement("div", {
|
|
56
|
+
role: "presentation",
|
|
57
|
+
className: (0, $cCu2p$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3deee0fd2b46e64f$exports))), "spectrum-Menu-divider")
|
|
58
|
+
}), item.rendered && /*#__PURE__*/ (0, ($parcel$interopDefault($cCu2p$react))).createElement("div", {
|
|
59
|
+
...headingProps,
|
|
60
|
+
className: (0, $cCu2p$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3deee0fd2b46e64f$exports))), "spectrum-Menu-sectionHeading")
|
|
61
|
+
}, item.rendered)), /*#__PURE__*/ (0, ($parcel$interopDefault($cCu2p$react))).createElement("div", {
|
|
62
|
+
...groupProps,
|
|
63
|
+
style: (0, $cCu2p$reactariavirtualizer.layoutInfoToStyle)(layoutInfo, direction),
|
|
64
|
+
className: (0, $cCu2p$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3deee0fd2b46e64f$exports))), "spectrum-Menu")
|
|
65
|
+
}, children));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=ListBoxSection.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAmBM,SAAS,yCAAkB,KAA6B;IAC7D,IAAI,YAAC,QAAQ,cAAE,UAAU,oBAAE,gBAAgB,eAAE,WAAW,QAAE,IAAI,EAAC,GAAG;IAClE,IAAI,gBAAC,YAAY,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE;QACjD,SAAS,KAAK,QAAQ;QACtB,cAAc,IAAI,CAAC,aAAa;IAClC;IAEA,IAAI,YAAY,CAAA,GAAA,mBAAK;IACrB,CAAA,GAAA,8CAAiB,EAAE;QACjB,YAAY;qBACZ;QACA,KAAK;IACP;IAEA,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,8BAAQ;IAC1B,IAAI,QAAQ,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,wCAAa;IAEpC,qBACE,0DAAC,CAAA,GAAA,qBAAO,uBACN,0DAAC;QAAI,MAAK;QAAe,KAAK;QAAW,OAAO,CAAA,GAAA,6CAAgB,EAAE,kBAAkB;OACjF,KAAK,GAAG,KAAK,MAAM,UAAU,CAAC,WAAW,oBACxC,0DAAC;QACC,MAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL;QAGL,KAAK,QAAQ,kBACZ,0DAAC;QACE,GAAG,YAAY;QAChB,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL;OAGH,KAAK,QAAQ,kBAIpB,0DAAC;QACE,GAAG,UAAU;QACd,OAAO,CAAA,GAAA,6CAAgB,EAAE,YAAY;QACrC,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL;OAGH;AAIT","sources":["packages/@react-spectrum/listbox/src/ListBoxSection.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 {classNames} from '@react-spectrum/utils';\nimport {LayoutInfo} from '@react-stately/virtualizer';\nimport {layoutInfoToStyle, useVirtualizerItem, VirtualizerItemOptions} from '@react-aria/virtualizer';\nimport {ListBoxContext} from './ListBoxContext';\nimport {Node} from '@react-types/shared';\nimport React, {Fragment, ReactNode, useContext, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {useListBoxSection} from '@react-aria/listbox';\nimport {useLocale} from '@react-aria/i18n';\n\ninterface ListBoxSectionProps<T> extends Omit<VirtualizerItemOptions, 'ref'> {\n headerLayoutInfo: LayoutInfo,\n item: Node<T>,\n children?: ReactNode\n}\n\n/** @private */\nexport function ListBoxSection<T>(props: ListBoxSectionProps<T>) {\n let {children, layoutInfo, headerLayoutInfo, virtualizer, item} = props;\n let {headingProps, groupProps} = useListBoxSection({\n heading: item.rendered,\n 'aria-label': item['aria-label']\n });\n\n let headerRef = useRef();\n useVirtualizerItem({\n layoutInfo: headerLayoutInfo,\n virtualizer,\n ref: headerRef\n });\n\n let {direction} = useLocale();\n let state = useContext(ListBoxContext);\n\n return (\n <Fragment>\n <div role=\"presentation\" ref={headerRef} style={layoutInfoToStyle(headerLayoutInfo, direction)}>\n {item.key !== state.collection.getFirstKey() &&\n <div\n role=\"presentation\"\n className={classNames(\n styles,\n 'spectrum-Menu-divider'\n )} />\n }\n {item.rendered &&\n <div\n {...headingProps}\n className={\n classNames(\n styles,\n 'spectrum-Menu-sectionHeading'\n )\n }>\n {item.rendered}\n </div>\n }\n </div>\n <div\n {...groupProps}\n style={layoutInfoToStyle(layoutInfo, direction)}\n className={\n classNames(\n styles,\n 'spectrum-Menu'\n )\n }>\n {children}\n </div>\n </Fragment>\n );\n}\n"],"names":[],"version":3,"file":"ListBoxSection.main.js.map"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {ListBoxContext as $0c6f792811e33483$export$7ff8f37d2d81a48d} from "./ListBoxContext.mjs";
|
|
2
|
+
import "./vars.5bf8960a.css";
|
|
3
|
+
import $dzUX8$menu_vars_cssmodulejs from "./menu_vars_css.mjs";
|
|
4
|
+
import {classNames as $dzUX8$classNames} from "@react-spectrum/utils";
|
|
5
|
+
import {useVirtualizerItem as $dzUX8$useVirtualizerItem, layoutInfoToStyle as $dzUX8$layoutInfoToStyle} from "@react-aria/virtualizer";
|
|
6
|
+
import $dzUX8$react, {useRef as $dzUX8$useRef, useContext as $dzUX8$useContext, Fragment as $dzUX8$Fragment} from "react";
|
|
7
|
+
import {useListBoxSection as $dzUX8$useListBoxSection} from "@react-aria/listbox";
|
|
8
|
+
import {useLocale as $dzUX8$useLocale} from "@react-aria/i18n";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
function $parcel$interopDefault(a) {
|
|
12
|
+
return a && a.__esModule ? a.default : a;
|
|
13
|
+
}
|
|
14
|
+
/*
|
|
15
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
16
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
17
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
18
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
*
|
|
20
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
21
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
22
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
23
|
+
* governing permissions and limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
function $92d678ed88836094$export$dca12b0bb56e4fc(props) {
|
|
32
|
+
let { children: children, layoutInfo: layoutInfo, headerLayoutInfo: headerLayoutInfo, virtualizer: virtualizer, item: item } = props;
|
|
33
|
+
let { headingProps: headingProps, groupProps: groupProps } = (0, $dzUX8$useListBoxSection)({
|
|
34
|
+
heading: item.rendered,
|
|
35
|
+
"aria-label": item["aria-label"]
|
|
36
|
+
});
|
|
37
|
+
let headerRef = (0, $dzUX8$useRef)();
|
|
38
|
+
(0, $dzUX8$useVirtualizerItem)({
|
|
39
|
+
layoutInfo: headerLayoutInfo,
|
|
40
|
+
virtualizer: virtualizer,
|
|
41
|
+
ref: headerRef
|
|
42
|
+
});
|
|
43
|
+
let { direction: direction } = (0, $dzUX8$useLocale)();
|
|
44
|
+
let state = (0, $dzUX8$useContext)((0, $0c6f792811e33483$export$7ff8f37d2d81a48d));
|
|
45
|
+
return /*#__PURE__*/ (0, $dzUX8$react).createElement((0, $dzUX8$Fragment), null, /*#__PURE__*/ (0, $dzUX8$react).createElement("div", {
|
|
46
|
+
role: "presentation",
|
|
47
|
+
ref: headerRef,
|
|
48
|
+
style: (0, $dzUX8$layoutInfoToStyle)(headerLayoutInfo, direction)
|
|
49
|
+
}, item.key !== state.collection.getFirstKey() && /*#__PURE__*/ (0, $dzUX8$react).createElement("div", {
|
|
50
|
+
role: "presentation",
|
|
51
|
+
className: (0, $dzUX8$classNames)((0, ($parcel$interopDefault($dzUX8$menu_vars_cssmodulejs))), "spectrum-Menu-divider")
|
|
52
|
+
}), item.rendered && /*#__PURE__*/ (0, $dzUX8$react).createElement("div", {
|
|
53
|
+
...headingProps,
|
|
54
|
+
className: (0, $dzUX8$classNames)((0, ($parcel$interopDefault($dzUX8$menu_vars_cssmodulejs))), "spectrum-Menu-sectionHeading")
|
|
55
|
+
}, item.rendered)), /*#__PURE__*/ (0, $dzUX8$react).createElement("div", {
|
|
56
|
+
...groupProps,
|
|
57
|
+
style: (0, $dzUX8$layoutInfoToStyle)(layoutInfo, direction),
|
|
58
|
+
className: (0, $dzUX8$classNames)((0, ($parcel$interopDefault($dzUX8$menu_vars_cssmodulejs))), "spectrum-Menu")
|
|
59
|
+
}, children));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export {$92d678ed88836094$export$dca12b0bb56e4fc as ListBoxSection};
|
|
64
|
+
//# sourceMappingURL=ListBoxSection.mjs.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {ListBoxContext as $0c6f792811e33483$export$7ff8f37d2d81a48d} from "./ListBoxContext.module.js";
|
|
2
|
+
import "./vars.5bf8960a.css";
|
|
3
|
+
import $dzUX8$menu_vars_cssmodulejs from "./menu_vars_css.module.js";
|
|
4
|
+
import {classNames as $dzUX8$classNames} from "@react-spectrum/utils";
|
|
5
|
+
import {useVirtualizerItem as $dzUX8$useVirtualizerItem, layoutInfoToStyle as $dzUX8$layoutInfoToStyle} from "@react-aria/virtualizer";
|
|
6
|
+
import $dzUX8$react, {useRef as $dzUX8$useRef, useContext as $dzUX8$useContext, Fragment as $dzUX8$Fragment} from "react";
|
|
7
|
+
import {useListBoxSection as $dzUX8$useListBoxSection} from "@react-aria/listbox";
|
|
8
|
+
import {useLocale as $dzUX8$useLocale} from "@react-aria/i18n";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
function $parcel$interopDefault(a) {
|
|
12
|
+
return a && a.__esModule ? a.default : a;
|
|
13
|
+
}
|
|
14
|
+
/*
|
|
15
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
16
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
17
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
18
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
*
|
|
20
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
21
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
22
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
23
|
+
* governing permissions and limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
function $92d678ed88836094$export$dca12b0bb56e4fc(props) {
|
|
32
|
+
let { children: children, layoutInfo: layoutInfo, headerLayoutInfo: headerLayoutInfo, virtualizer: virtualizer, item: item } = props;
|
|
33
|
+
let { headingProps: headingProps, groupProps: groupProps } = (0, $dzUX8$useListBoxSection)({
|
|
34
|
+
heading: item.rendered,
|
|
35
|
+
"aria-label": item["aria-label"]
|
|
36
|
+
});
|
|
37
|
+
let headerRef = (0, $dzUX8$useRef)();
|
|
38
|
+
(0, $dzUX8$useVirtualizerItem)({
|
|
39
|
+
layoutInfo: headerLayoutInfo,
|
|
40
|
+
virtualizer: virtualizer,
|
|
41
|
+
ref: headerRef
|
|
42
|
+
});
|
|
43
|
+
let { direction: direction } = (0, $dzUX8$useLocale)();
|
|
44
|
+
let state = (0, $dzUX8$useContext)((0, $0c6f792811e33483$export$7ff8f37d2d81a48d));
|
|
45
|
+
return /*#__PURE__*/ (0, $dzUX8$react).createElement((0, $dzUX8$Fragment), null, /*#__PURE__*/ (0, $dzUX8$react).createElement("div", {
|
|
46
|
+
role: "presentation",
|
|
47
|
+
ref: headerRef,
|
|
48
|
+
style: (0, $dzUX8$layoutInfoToStyle)(headerLayoutInfo, direction)
|
|
49
|
+
}, item.key !== state.collection.getFirstKey() && /*#__PURE__*/ (0, $dzUX8$react).createElement("div", {
|
|
50
|
+
role: "presentation",
|
|
51
|
+
className: (0, $dzUX8$classNames)((0, ($parcel$interopDefault($dzUX8$menu_vars_cssmodulejs))), "spectrum-Menu-divider")
|
|
52
|
+
}), item.rendered && /*#__PURE__*/ (0, $dzUX8$react).createElement("div", {
|
|
53
|
+
...headingProps,
|
|
54
|
+
className: (0, $dzUX8$classNames)((0, ($parcel$interopDefault($dzUX8$menu_vars_cssmodulejs))), "spectrum-Menu-sectionHeading")
|
|
55
|
+
}, item.rendered)), /*#__PURE__*/ (0, $dzUX8$react).createElement("div", {
|
|
56
|
+
...groupProps,
|
|
57
|
+
style: (0, $dzUX8$layoutInfoToStyle)(layoutInfo, direction),
|
|
58
|
+
className: (0, $dzUX8$classNames)((0, ($parcel$interopDefault($dzUX8$menu_vars_cssmodulejs))), "spectrum-Menu")
|
|
59
|
+
}, children));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export {$92d678ed88836094$export$dca12b0bb56e4fc as ListBoxSection};
|
|
64
|
+
//# sourceMappingURL=ListBoxSection.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAmBM,SAAS,yCAAkB,KAA6B;IAC7D,IAAI,YAAC,QAAQ,cAAE,UAAU,oBAAE,gBAAgB,eAAE,WAAW,QAAE,IAAI,EAAC,GAAG;IAClE,IAAI,gBAAC,YAAY,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;QACjD,SAAS,KAAK,QAAQ;QACtB,cAAc,IAAI,CAAC,aAAa;IAClC;IAEA,IAAI,YAAY,CAAA,GAAA,aAAK;IACrB,CAAA,GAAA,yBAAiB,EAAE;QACjB,YAAY;qBACZ;QACA,KAAK;IACP;IAEA,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAC1B,IAAI,QAAQ,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAa;IAEpC,qBACE,gCAAC,CAAA,GAAA,eAAO,uBACN,gCAAC;QAAI,MAAK;QAAe,KAAK;QAAW,OAAO,CAAA,GAAA,wBAAgB,EAAE,kBAAkB;OACjF,KAAK,GAAG,KAAK,MAAM,UAAU,CAAC,WAAW,oBACxC,gCAAC;QACC,MAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,sDAAK,GACL;QAGL,KAAK,QAAQ,kBACZ,gCAAC;QACE,GAAG,YAAY;QAChB,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,sDAAK,GACL;OAGH,KAAK,QAAQ,kBAIpB,gCAAC;QACE,GAAG,UAAU;QACd,OAAO,CAAA,GAAA,wBAAgB,EAAE,YAAY;QACrC,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,sDAAK,GACL;OAGH;AAIT","sources":["packages/@react-spectrum/listbox/src/ListBoxSection.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 {classNames} from '@react-spectrum/utils';\nimport {LayoutInfo} from '@react-stately/virtualizer';\nimport {layoutInfoToStyle, useVirtualizerItem, VirtualizerItemOptions} from '@react-aria/virtualizer';\nimport {ListBoxContext} from './ListBoxContext';\nimport {Node} from '@react-types/shared';\nimport React, {Fragment, ReactNode, useContext, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {useListBoxSection} from '@react-aria/listbox';\nimport {useLocale} from '@react-aria/i18n';\n\ninterface ListBoxSectionProps<T> extends Omit<VirtualizerItemOptions, 'ref'> {\n headerLayoutInfo: LayoutInfo,\n item: Node<T>,\n children?: ReactNode\n}\n\n/** @private */\nexport function ListBoxSection<T>(props: ListBoxSectionProps<T>) {\n let {children, layoutInfo, headerLayoutInfo, virtualizer, item} = props;\n let {headingProps, groupProps} = useListBoxSection({\n heading: item.rendered,\n 'aria-label': item['aria-label']\n });\n\n let headerRef = useRef();\n useVirtualizerItem({\n layoutInfo: headerLayoutInfo,\n virtualizer,\n ref: headerRef\n });\n\n let {direction} = useLocale();\n let state = useContext(ListBoxContext);\n\n return (\n <Fragment>\n <div role=\"presentation\" ref={headerRef} style={layoutInfoToStyle(headerLayoutInfo, direction)}>\n {item.key !== state.collection.getFirstKey() &&\n <div\n role=\"presentation\"\n className={classNames(\n styles,\n 'spectrum-Menu-divider'\n )} />\n }\n {item.rendered &&\n <div\n {...headingProps}\n className={\n classNames(\n styles,\n 'spectrum-Menu-sectionHeading'\n )\n }>\n {item.rendered}\n </div>\n }\n </div>\n <div\n {...groupProps}\n style={layoutInfoToStyle(layoutInfo, direction)}\n className={\n classNames(\n styles,\n 'spectrum-Menu'\n )\n }>\n {children}\n </div>\n </Fragment>\n );\n}\n"],"names":[],"version":3,"file":"ListBoxSection.module.js.map"}
|
package/dist/ar-AE.mjs
CHANGED
package/dist/bg-BG.mjs
CHANGED
package/dist/cs-CZ.mjs
CHANGED
package/dist/da-DK.mjs
CHANGED
package/dist/de-DE.mjs
CHANGED
package/dist/el-GR.mjs
CHANGED
package/dist/en-US.mjs
CHANGED
package/dist/es-ES.mjs
CHANGED
package/dist/et-EE.mjs
CHANGED
package/dist/fi-FI.mjs
CHANGED
package/dist/fr-FR.mjs
CHANGED
package/dist/he-IL.mjs
CHANGED
package/dist/hr-HR.mjs
CHANGED
package/dist/hu-HU.mjs
CHANGED