@react-spectrum/listbox 3.10.2-nightly.3940 → 3.10.2-nightly.3960
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 +28 -15
- package/dist/main.css +1 -1
- package/dist/main.js +27 -14
- package/dist/main.js.map +1 -1
- package/dist/module.js +28 -15
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/ListBox.tsx +1 -1
- package/src/ListBoxBase.tsx +21 -10
- package/src/ListBoxSection.tsx +10 -10
package/dist/import.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {useListState as $j8tbs$useListState} from "@react-stately/list";
|
|
|
6
6
|
import {useListBox as $j8tbs$useListBox, useOption as $j8tbs$useOption, useListBoxSection as $j8tbs$useListBoxSection} from "@react-aria/listbox";
|
|
7
7
|
import {FocusScope as $j8tbs$FocusScope, FocusRing as $j8tbs$FocusRing} from "@react-aria/focus";
|
|
8
8
|
import {ListLayout as $j8tbs$ListLayout} from "@react-stately/layout";
|
|
9
|
-
import {mergeProps as $j8tbs$mergeProps, filterDOMProps as $j8tbs$filterDOMProps} from "@react-aria/utils";
|
|
9
|
+
import {useLayoutEffect as $j8tbs$useLayoutEffect, mergeProps as $j8tbs$mergeProps, filterDOMProps as $j8tbs$filterDOMProps} from "@react-aria/utils";
|
|
10
10
|
import {ProgressCircle as $j8tbs$ProgressCircle} from "@react-spectrum/progress";
|
|
11
11
|
import {useCollator as $j8tbs$useCollator, useLocalizedStringFormatter as $j8tbs$useLocalizedStringFormatter, useLocale as $j8tbs$useLocale} from "@react-aria/i18n";
|
|
12
12
|
import {useProvider as $j8tbs$useProvider} from "@react-spectrum/provider";
|
|
@@ -524,8 +524,7 @@ function $86983ea1fa3f7312$export$feb3b6b552c14a12(props) {
|
|
|
524
524
|
|
|
525
525
|
|
|
526
526
|
function $92d678ed88836094$export$dca12b0bb56e4fc(props) {
|
|
527
|
-
let { children: children ,
|
|
528
|
-
let item = reusableView.content;
|
|
527
|
+
let { children: children , layoutInfo: layoutInfo , headerLayoutInfo: headerLayoutInfo , virtualizer: virtualizer , item: item } = props;
|
|
529
528
|
let { headingProps: headingProps , groupProps: groupProps } = (0, $j8tbs$useListBoxSection)({
|
|
530
529
|
heading: item.rendered,
|
|
531
530
|
"aria-label": item["aria-label"]
|
|
@@ -535,7 +534,8 @@ function $92d678ed88836094$export$dca12b0bb56e4fc(props) {
|
|
|
535
534
|
});
|
|
536
535
|
let headerRef = (0, $j8tbs$useRef)();
|
|
537
536
|
(0, $j8tbs$useVirtualizerItem)({
|
|
538
|
-
|
|
537
|
+
layoutInfo: headerLayoutInfo,
|
|
538
|
+
virtualizer: virtualizer,
|
|
539
539
|
ref: headerRef
|
|
540
540
|
});
|
|
541
541
|
let { direction: direction } = (0, $j8tbs$useLocale)();
|
|
@@ -543,7 +543,7 @@ function $92d678ed88836094$export$dca12b0bb56e4fc(props) {
|
|
|
543
543
|
return /*#__PURE__*/ (0, $j8tbs$react).createElement((0, $j8tbs$Fragment), null, /*#__PURE__*/ (0, $j8tbs$react).createElement("div", {
|
|
544
544
|
role: "presentation",
|
|
545
545
|
ref: headerRef,
|
|
546
|
-
style: (0, $j8tbs$layoutInfoToStyle)(
|
|
546
|
+
style: (0, $j8tbs$layoutInfoToStyle)(headerLayoutInfo, direction)
|
|
547
547
|
}, item.key !== state.collection.getFirstKey() && /*#__PURE__*/ (0, $j8tbs$react).createElement("div", {
|
|
548
548
|
...separatorProps,
|
|
549
549
|
className: (0, $j8tbs$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-divider")
|
|
@@ -552,7 +552,7 @@ function $92d678ed88836094$export$dca12b0bb56e4fc(props) {
|
|
|
552
552
|
className: (0, $j8tbs$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-sectionHeading")
|
|
553
553
|
}, item.rendered)), /*#__PURE__*/ (0, $j8tbs$react).createElement("div", {
|
|
554
554
|
...groupProps,
|
|
555
|
-
style: (0, $j8tbs$layoutInfoToStyle)(
|
|
555
|
+
style: (0, $j8tbs$layoutInfoToStyle)(layoutInfo, direction),
|
|
556
556
|
className: (0, $j8tbs$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu")
|
|
557
557
|
}, children));
|
|
558
558
|
}
|
|
@@ -566,7 +566,7 @@ function $92d678ed88836094$export$dca12b0bb56e4fc(props) {
|
|
|
566
566
|
|
|
567
567
|
|
|
568
568
|
|
|
569
|
-
function $3247d4a89e6094e9$export$25768ea656ae32a7(state) {
|
|
569
|
+
function $3247d4a89e6094e9$export$25768ea656ae32a7(state, isLoading) {
|
|
570
570
|
let { scale: scale } = (0, $j8tbs$useProvider)();
|
|
571
571
|
let collator = (0, $j8tbs$useCollator)({
|
|
572
572
|
usage: "search",
|
|
@@ -585,6 +585,17 @@ function $3247d4a89e6094e9$export$25768ea656ae32a7(state) {
|
|
|
585
585
|
]);
|
|
586
586
|
layout.collection = state.collection;
|
|
587
587
|
layout.disabledKeys = state.disabledKeys;
|
|
588
|
+
(0, $j8tbs$useLayoutEffect)(()=>{
|
|
589
|
+
// Sync loading state into the layout.
|
|
590
|
+
if (layout.isLoading !== isLoading) {
|
|
591
|
+
var _layout_virtualizer;
|
|
592
|
+
layout.isLoading = isLoading;
|
|
593
|
+
(_layout_virtualizer = layout.virtualizer) === null || _layout_virtualizer === void 0 ? void 0 : _layout_virtualizer.relayoutNow();
|
|
594
|
+
}
|
|
595
|
+
}, [
|
|
596
|
+
layout,
|
|
597
|
+
isLoading
|
|
598
|
+
]);
|
|
588
599
|
return layout;
|
|
589
600
|
}
|
|
590
601
|
/** @private */ function $3247d4a89e6094e9$var$ListBoxBase(props, ref) {
|
|
@@ -596,19 +607,20 @@ function $3247d4a89e6094e9$export$25768ea656ae32a7(state) {
|
|
|
596
607
|
}, state, ref);
|
|
597
608
|
let { styleProps: styleProps } = (0, $j8tbs$useStyleProps)(props);
|
|
598
609
|
let stringFormatter = (0, $j8tbs$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($07d5971c39cb246a$exports))));
|
|
599
|
-
// Sync loading state into the layout.
|
|
600
|
-
layout.isLoading = props.isLoading;
|
|
601
610
|
let renderWrapper = (parent, reusableView, children, renderChildren)=>{
|
|
602
611
|
if (reusableView.viewType === "section") return /*#__PURE__*/ (0, $j8tbs$react).createElement((0, $92d678ed88836094$export$dca12b0bb56e4fc), {
|
|
603
612
|
key: reusableView.key,
|
|
604
|
-
|
|
605
|
-
|
|
613
|
+
item: reusableView.content,
|
|
614
|
+
layoutInfo: reusableView.layoutInfo,
|
|
615
|
+
virtualizer: reusableView.virtualizer,
|
|
616
|
+
headerLayoutInfo: children.find((c)=>c.viewType === "header").layoutInfo
|
|
606
617
|
}, renderChildren(children.filter((c)=>c.viewType === "item")));
|
|
607
618
|
return /*#__PURE__*/ (0, $j8tbs$react).createElement((0, $j8tbs$VirtualizerItem), {
|
|
608
619
|
key: reusableView.key,
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
620
|
+
layoutInfo: reusableView.layoutInfo,
|
|
621
|
+
virtualizer: reusableView.virtualizer,
|
|
622
|
+
parent: parent === null || parent === void 0 ? void 0 : parent.layoutInfo
|
|
623
|
+
}, reusableView.rendered);
|
|
612
624
|
};
|
|
613
625
|
return /*#__PURE__*/ (0, $j8tbs$react).createElement((0, $0c6f792811e33483$export$7ff8f37d2d81a48d).Provider, {
|
|
614
626
|
value: state
|
|
@@ -617,6 +629,7 @@ function $3247d4a89e6094e9$export$25768ea656ae32a7(state) {
|
|
|
617
629
|
...(0, $j8tbs$mergeProps)(listBoxProps, domProps),
|
|
618
630
|
ref: ref,
|
|
619
631
|
focusedKey: state.selectionManager.focusedKey,
|
|
632
|
+
autoFocus: !!props.autoFocus,
|
|
620
633
|
sizeToFit: "height",
|
|
621
634
|
scrollDirection: "vertical",
|
|
622
635
|
className: (0, $j8tbs$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu", styleProps.className),
|
|
@@ -672,7 +685,7 @@ const $3247d4a89e6094e9$export$1afdcf349979fb7e = /*#__PURE__*/ (0, $j8tbs$react
|
|
|
672
685
|
|
|
673
686
|
function $3136257018b1a220$var$ListBox(props, ref) {
|
|
674
687
|
let state = (0, $j8tbs$useListState)(props);
|
|
675
|
-
let layout = (0, $3247d4a89e6094e9$export$25768ea656ae32a7)(state);
|
|
688
|
+
let layout = (0, $3247d4a89e6094e9$export$25768ea656ae32a7)(state, props.isLoading);
|
|
676
689
|
let domRef = (0, $j8tbs$useDOMRef)(ref);
|
|
677
690
|
return /*#__PURE__*/ (0, $j8tbs$react).createElement((0, $3247d4a89e6094e9$export$1afdcf349979fb7e), {
|
|
678
691
|
...props,
|
package/dist/main.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{font-synthesis:weight}.spectrum-Menu-popover_7ea47c{max-width:320px}[dir=ltr] .spectrum-Menu_7ea47c{text-align:left}[dir=rtl] .spectrum-Menu_7ea47c{text-align:right}.spectrum-Menu_7ea47c{box-sizing:border-box;padding:var(--spectrum-popover-padding-y,var(--spectrum-global-dimension-size-50))0;-webkit-user-select:none;user-select:none;margin:0;list-style-type:none;display:block;overflow-y:auto}.spectrum-Menu_7ea47c .spectrum-Menu-sectionHeading_7ea47c{margin-top:var(--spectrum-global-dimension-size-75);margin-bottom:var(--spectrum-global-dimension-size-40)}.spectrum-Menu_7ea47c:focus{outline:none}.spectrum-Menu-checkmark_7ea47c{opacity:1;padding-top:calc(var(--spectrum-selectlist-option-icon-padding-y) - var(--spectrum-selectlist-option-padding-height));transform:scale(1)}[dir=ltr] .spectrum-Menu-item_7ea47c{border-left:var(--spectrum-selectlist-border-size-key-focus,var(--spectrum-global-dimension-static-size-25))solid transparent}[dir=rtl] .spectrum-Menu-item_7ea47c{border-right:var(--spectrum-selectlist-border-size-key-focus,var(--spectrum-global-dimension-static-size-25))solid transparent}.spectrum-Menu-item_7ea47c{cursor:default;box-sizing:border-box;font-size:var(--spectrum-selectlist-option-text-size,var(--spectrum-alias-font-size-default));font-weight:var(--spectrum-selectlist-option-text-font-weight,var(--spectrum-global-font-weight-regular));margin:0;font-style:normal;text-decoration:none;position:relative}.spectrum-Menu-item_7ea47c:focus{outline:none}.spectrum-Menu-item_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c{display:block}[dir=ltr] .spectrum-Menu-item_7ea47c .spectrum-Icon_7ea47c+.spectrum-Menu-itemLabel_7ea47c,[dir=ltr] .spectrum-Menu-item_7ea47c .spectrum-Menu-itemIcon_7ea47c+.spectrum-Menu-itemLabel_7ea47c{margin-left:var(--spectrum-selectlist-thumbnail-image-padding-x,var(--spectrum-global-dimension-size-100))}[dir=rtl] .spectrum-Menu-item_7ea47c .spectrum-Icon_7ea47c+.spectrum-Menu-itemLabel_7ea47c,[dir=rtl] .spectrum-Menu-item_7ea47c .spectrum-Menu-itemIcon_7ea47c+.spectrum-Menu-itemLabel_7ea47c{margin-right:var(--spectrum-selectlist-thumbnail-image-padding-x,var(--spectrum-global-dimension-size-100))}.spectrum-Menu-itemLabel_7ea47c{line-height:var(--spectrum-global-font-line-height-small,1.3);word-break:break-word;grid-area:text}.spectrum-Menu-itemLabel--wrapping_7ea47c{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.spectrum-Menu-checkmark_7ea47c{grid-area:checkmark;place-self:flex-start end;display:none}.spectrum-Menu-divider_7ea47c{box-sizing:content-box;height:var(--spectrum-selectlist-divider-size,var(--spectrum-alias-border-size-thick));margin:calc(var(--spectrum-selectlist-divider-padding,3px)/2)var(--spectrum-global-dimension-size-150);border:none;padding:0;overflow:visible}[dir=ltr] .spectrum-Menu-sectionHeading_7ea47c{padding-left:var(--spectrum-global-dimension-size-150)}[dir=rtl] .spectrum-Menu-sectionHeading_7ea47c{padding-right:var(--spectrum-global-dimension-size-150)}[dir=ltr] .spectrum-Menu-sectionHeading_7ea47c{padding-right:var(--spectrum-global-dimension-size-450)}[dir=rtl] .spectrum-Menu-sectionHeading_7ea47c{padding-left:var(--spectrum-global-dimension-size-450)}.spectrum-Menu-sectionHeading_7ea47c{margin:var(--spectrum-global-dimension-size-75)0 0 0;font-size:var(--spectrum-global-dimension-font-size-100);font-weight:var(--spectrum-global-font-weight-bold,700);line-height:var(--spectrum-alias-line-height-medium,var(--spectrum-global-dimension-size-250));padding-top:0;padding-bottom:0;display:block}.spectrum-Menu_7ea47c .spectrum-Menu_7ea47c{margin:0;display:block}.spectrum-Menu-itemGrid_7ea47c{display:-ms-grid;-ms-grid-columns:calc(var(--spectrum-global-dimension-size-150) - var(--spectrum-selectlist-border-size-key-focus,var(--spectrum-global-dimension-static-size-25)))auto 1fr auto auto auto var(--spectrum-global-dimension-size-150);grid-template-columns:calc(var(--spectrum-global-dimension-size-150) - var(--spectrum-selectlist-border-size-key-focus,var(--spectrum-global-dimension-static-size-25)))auto 1fr auto auto auto var(--spectrum-global-dimension-size-150);-ms-grid-rows:var(--spectrum-selectlist-option-padding-height)1fr auto var(--spectrum-selectlist-option-padding-height);grid-template-rows:var(--spectrum-selectlist-option-padding-height)1fr auto var(--spectrum-selectlist-option-padding-height);grid-template-areas:". . . . . . ."".icon text checkmark end keyboard."".icon description checkmark end keyboard."". . . . . . .";display:grid}.spectrum-Menu-item_7ea47c.is-selectable_7ea47c .spectrum-Menu-itemGrid_7ea47c{-ms-grid-columns:calc(var(--spectrum-global-dimension-size-150) - var(--spectrum-selectlist-border-size-key-focus,var(--spectrum-global-dimension-static-size-25)))auto 1fr calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-selectlist-option-icon-padding-x,var(--spectrum-global-dimension-size-150)))auto auto var(--spectrum-global-dimension-size-150);grid-template-columns:calc(var(--spectrum-global-dimension-size-150) - var(--spectrum-selectlist-border-size-key-focus,var(--spectrum-global-dimension-static-size-25)))auto 1fr calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-selectlist-option-icon-padding-x,var(--spectrum-global-dimension-size-150)))auto auto var(--spectrum-global-dimension-size-150)}[dir=ltr] .spectrum-Menu_7ea47c .spectrum-Menu-end_7ea47c{padding-left:var(--spectrum-global-dimension-size-125)}[dir=rtl] .spectrum-Menu_7ea47c .spectrum-Menu-end_7ea47c{padding-right:var(--spectrum-global-dimension-size-125)}.spectrum-Menu_7ea47c .spectrum-Menu-end_7ea47c{grid-area:end;place-self:flex-start end}[dir=ltr] .spectrum-Menu-icon_7ea47c{padding-right:var(--spectrum-global-dimension-size-100)}[dir=rtl] .spectrum-Menu-icon_7ea47c{padding-left:var(--spectrum-global-dimension-size-100)}.spectrum-Menu-icon_7ea47c{padding-top:var(--spectrum-global-dimension-size-10);grid-area:icon}.spectrum-Menu-description_7ea47c{line-height:var(--spectrum-global-font-line-height-small,1.3);font-size:var(--spectrum-global-dimension-size-150);grid-area:description}[dir=ltr] .spectrum-Menu-keyboard_7ea47c{padding-left:var(--spectrum-global-dimension-size-125)}[dir=rtl] .spectrum-Menu-keyboard_7ea47c{padding-right:var(--spectrum-global-dimension-size-125)}.spectrum-Menu-keyboard_7ea47c{grid-area:keyboard;align-self:flex-start;font-family:adobe-clean,Source Sans Pro,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Ubuntu,Trebuchet MS,Lucida Grande,sans-serif}.spectrum-Menu_7ea47c{--spectrum-heading-subtitle3-text-color:var(--spectrum-global-color-gray-900);background-color:var(--spectrum-selectlist-background-color,var(--spectrum-alias-background-color-transparent))}.spectrum-Menu-item_7ea47c{background-color:var(--spectrum-selectlist-option-background-color,var(--spectrum-alias-background-color-transparent));color:var(--spectrum-selectlist-option-text-color,var(--spectrum-alias-text-color))}[dir=ltr] .spectrum-Menu-item_7ea47c.focus-ring_7ea47c,[dir=ltr] .spectrum-Menu-item_7ea47c.is-focused_7ea47c{border-left-color:var(--spectrum-selectlist-option-focus-indicator-color,var(--spectrum-alias-border-color-focus))}[dir=rtl] .spectrum-Menu-item_7ea47c.focus-ring_7ea47c,[dir=rtl] .spectrum-Menu-item_7ea47c.is-focused_7ea47c{border-right-color:var(--spectrum-selectlist-option-focus-indicator-color,var(--spectrum-alias-border-color-focus))}.spectrum-Menu-item_7ea47c.focus-ring_7ea47c,.spectrum-Menu-item_7ea47c.is-focused_7ea47c{background-color:var(--spectrum-selectlist-option-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay));color:var(--spectrum-selectlist-option-text-color-key-focus,var(--spectrum-alias-text-color))}.spectrum-Menu-item_7ea47c.is-hovered_7ea47c,.spectrum-Menu-item_7ea47c:focus,.spectrum-Menu-item_7ea47c.is-highlighted_7ea47c,.spectrum-Menu-item_7ea47c.is-open_7ea47c{background-color:var(--spectrum-selectlist-option-background-color-hover,var(--spectrum-alias-background-color-hover-overlay));color:var(--spectrum-selectlist-option-text-color-hover,var(--spectrum-alias-text-color))}.spectrum-Menu-item_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c{color:var(--spectrum-selectlist-option-icon-color-selected,var(--spectrum-alias-icon-color-selected))}.spectrum-Menu-item_7ea47c .is-active_7ea47c,.spectrum-Menu-item_7ea47c:active{background-color:var(--spectrum-selectlist-option-background-color-down,var(--spectrum-alias-background-color-hover-overlay))}.spectrum-Menu-item_7ea47c.is-disabled_7ea47c{background-color:var(--spectrum-selectlist-option-background-color-disabled,var(--spectrum-alias-background-color-transparent));color:var(--spectrum-selectlist-option-text-color-disabled,var(--spectrum-alias-text-color-disabled));cursor:default;background-image:none}.spectrum-Menu-sectionHeading_7ea47c{color:var(--spectrum-heading-subtitle3-text-color,var(--spectrum-global-color-gray-700))}.spectrum-Menu-divider_7ea47c{background-color:var(--spectrum-global-color-gray-300)}.spectrum-Menu-description_7ea47c{color:var(--spectrum-global-color-gray-700)}@media (forced-colors:active){.spectrum-Menu-divider_7ea47c{background-color:CanvasText;forced-color-adjust:none}.spectrum-Menu-item_7ea47c{forced-color-adjust:none;--spectrum-heading-subtitle3-text-color:ButtonText;--spectrum-selectlist-background-color:ButtonFace;--spectrum-selectlist-divider-color:ButtonText;--spectrum-selectlist-option-background-color:ButtonFace;--spectrum-selectlist-option-background-color-disabled:ButtonFace;--spectrum-selectlist-option-background-color-down:ButtonFace;--spectrum-selectlist-option-background-color-hover:Highlight;--spectrum-selectlist-option-background-color-key-focus:Highlight;--spectrum-selectlist-option-focus-indicator-color:Highlight;--spectrum-selectlist-option-icon-color-selected:Highlight;--spectrum-selectlist-option-text-color:ButtonText;--spectrum-selectlist-option-text-color-disabled:GrayText;--spectrum-selectlist-option-text-color-hover:HighlightText;--spectrum-selectlist-option-text-color-key-focus:HighlightText;--spectrum-alias-border-color-focus:Highlight}.spectrum-Menu-item_7ea47c .spectrum-Menu-description_7ea47c{color:var(--spectrum-selectlist-option-text-color,var(--spectrum-alias-text-color))}.spectrum-Menu-item_7ea47c.is-hovered_7ea47c,.spectrum-Menu-item_7ea47c:focus,.spectrum-Menu-item_7ea47c.is-highlighted_7ea47c,.spectrum-Menu-item_7ea47c.is-open_7ea47c,.spectrum-Menu-item_7ea47c.focus-ring_7ea47c,.spectrum-Menu-item_7ea47c.is-focused_7ea47c{background-color:var(--spectrum-selectlist-option-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay));color:var(--spectrum-selectlist-option-text-color-key-focus,var(--spectrum-alias-text-color))}.spectrum-Menu-item_7ea47c.is-hovered_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c,.spectrum-Menu-item_7ea47c:focus.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c,.spectrum-Menu-item_7ea47c.is-highlighted_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c,.spectrum-Menu-item_7ea47c.is-open_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c,.spectrum-Menu-item_7ea47c.focus-ring_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c,.spectrum-Menu-item_7ea47c.is-focused_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c{color:HighlightText}.spectrum-Menu-item_7ea47c.is-hovered_7ea47c .spectrum-Menu-description_7ea47c,.spectrum-Menu-item_7ea47c:focus .spectrum-Menu-description_7ea47c,.spectrum-Menu-item_7ea47c.is-highlighted_7ea47c .spectrum-Menu-description_7ea47c,.spectrum-Menu-item_7ea47c.is-open_7ea47c .spectrum-Menu-description_7ea47c,.spectrum-Menu-item_7ea47c.focus-ring_7ea47c .spectrum-Menu-description_7ea47c,.spectrum-Menu-item_7ea47c.is-focused_7ea47c .spectrum-Menu-description_7ea47c{color:var(--spectrum-selectlist-option-text-color-key-focus,var(--spectrum-alias-text-color));background-color:var(--spectrum-selectlist-option-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay))}}
|
|
1
|
+
:root{font-synthesis:weight}.spectrum-Menu-popover_7ea47c{max-width:320px}[dir=ltr] .spectrum-Menu_7ea47c{text-align:left}[dir=rtl] .spectrum-Menu_7ea47c{text-align:right}.spectrum-Menu_7ea47c{box-sizing:border-box;padding:var(--spectrum-popover-padding-y,var(--spectrum-global-dimension-size-50))0;-webkit-user-select:none;user-select:none;margin:0;list-style-type:none;display:block;overflow-y:auto}.spectrum-Menu_7ea47c .spectrum-Menu-sectionHeading_7ea47c{margin-top:var(--spectrum-global-dimension-size-75);margin-bottom:var(--spectrum-global-dimension-size-40)}.spectrum-Menu_7ea47c:focus{outline:none}.spectrum-Menu-checkmark_7ea47c{opacity:1;padding-top:calc(var(--spectrum-selectlist-option-icon-padding-y) - var(--spectrum-selectlist-option-padding-height));transform:scale(1)}[dir=ltr] .spectrum-Menu-item_7ea47c{border-left:var(--spectrum-selectlist-border-size-key-focus,var(--spectrum-global-dimension-static-size-25))solid transparent}[dir=rtl] .spectrum-Menu-item_7ea47c{border-right:var(--spectrum-selectlist-border-size-key-focus,var(--spectrum-global-dimension-static-size-25))solid transparent}.spectrum-Menu-item_7ea47c{cursor:default;box-sizing:border-box;font-size:var(--spectrum-selectlist-option-text-size,var(--spectrum-alias-font-size-default));font-weight:var(--spectrum-selectlist-option-text-font-weight,var(--spectrum-global-font-weight-regular));margin:0;font-style:normal;text-decoration:none;position:relative}.spectrum-Menu-item_7ea47c:focus{outline:none}.spectrum-Menu-item_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c{display:block}[dir=ltr] .spectrum-Menu-item_7ea47c .spectrum-Icon_7ea47c+.spectrum-Menu-itemLabel_7ea47c,[dir=ltr] .spectrum-Menu-item_7ea47c .spectrum-Menu-itemIcon_7ea47c+.spectrum-Menu-itemLabel_7ea47c{margin-left:var(--spectrum-selectlist-thumbnail-image-padding-x,var(--spectrum-global-dimension-size-100))}[dir=rtl] .spectrum-Menu-item_7ea47c .spectrum-Icon_7ea47c+.spectrum-Menu-itemLabel_7ea47c,[dir=rtl] .spectrum-Menu-item_7ea47c .spectrum-Menu-itemIcon_7ea47c+.spectrum-Menu-itemLabel_7ea47c{margin-right:var(--spectrum-selectlist-thumbnail-image-padding-x,var(--spectrum-global-dimension-size-100))}.spectrum-Menu-itemLabel_7ea47c{line-height:var(--spectrum-global-font-line-height-small,1.3);word-break:break-word;grid-area:text}.spectrum-Menu-itemLabel--wrapping_7ea47c{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.spectrum-Menu-checkmark_7ea47c{grid-area:checkmark;place-self:flex-start end;display:none}.spectrum-Menu-divider_7ea47c{box-sizing:content-box;height:var(--spectrum-selectlist-divider-size,var(--spectrum-alias-border-size-thick));margin:calc(var(--spectrum-selectlist-divider-padding,3px)/2)var(--spectrum-global-dimension-size-150);border:none;padding:0;overflow:visible}[dir=ltr] .spectrum-Menu-sectionHeading_7ea47c{padding-left:var(--spectrum-global-dimension-size-150)}[dir=rtl] .spectrum-Menu-sectionHeading_7ea47c{padding-right:var(--spectrum-global-dimension-size-150)}[dir=ltr] .spectrum-Menu-sectionHeading_7ea47c{padding-right:var(--spectrum-global-dimension-size-450)}[dir=rtl] .spectrum-Menu-sectionHeading_7ea47c{padding-left:var(--spectrum-global-dimension-size-450)}.spectrum-Menu-sectionHeading_7ea47c{margin:var(--spectrum-global-dimension-size-75)0 0 0;font-size:var(--spectrum-global-dimension-font-size-100);font-weight:var(--spectrum-global-font-weight-bold,700);line-height:var(--spectrum-alias-line-height-medium,var(--spectrum-global-dimension-size-250));padding-top:0;padding-bottom:0;display:block}.spectrum-Menu_7ea47c .spectrum-Menu_7ea47c{margin:0;display:block}.spectrum-Menu-itemGrid_7ea47c{display:-ms-grid;-ms-grid-columns:calc(var(--spectrum-global-dimension-size-150) - var(--spectrum-selectlist-border-size-key-focus,var(--spectrum-global-dimension-static-size-25)))auto 1fr auto auto auto var(--spectrum-global-dimension-size-150);grid-template-columns:calc(var(--spectrum-global-dimension-size-150) - var(--spectrum-selectlist-border-size-key-focus,var(--spectrum-global-dimension-static-size-25)))auto 1fr auto auto auto var(--spectrum-global-dimension-size-150);-ms-grid-rows:var(--spectrum-selectlist-option-padding-height)1fr auto var(--spectrum-selectlist-option-padding-height);grid-template-rows:var(--spectrum-selectlist-option-padding-height)1fr auto var(--spectrum-selectlist-option-padding-height);grid-template-areas:". . . . . . ."".icon text checkmark end keyboard."".icon description checkmark end keyboard."". . . . . . .";display:grid}.spectrum-Menu-item_7ea47c.is-selectable_7ea47c .spectrum-Menu-itemGrid_7ea47c{-ms-grid-columns:calc(var(--spectrum-global-dimension-size-150) - var(--spectrum-selectlist-border-size-key-focus,var(--spectrum-global-dimension-static-size-25)))auto 1fr calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-selectlist-option-icon-padding-x,var(--spectrum-global-dimension-size-150)))auto auto var(--spectrum-global-dimension-size-150);grid-template-columns:calc(var(--spectrum-global-dimension-size-150) - var(--spectrum-selectlist-border-size-key-focus,var(--spectrum-global-dimension-static-size-25)))auto 1fr calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-selectlist-option-icon-padding-x,var(--spectrum-global-dimension-size-150)))auto auto var(--spectrum-global-dimension-size-150)}[dir=ltr] .spectrum-Menu_7ea47c .spectrum-Menu-end_7ea47c{padding-left:var(--spectrum-global-dimension-size-250)}[dir=rtl] .spectrum-Menu_7ea47c .spectrum-Menu-end_7ea47c{padding-right:var(--spectrum-global-dimension-size-250)}.spectrum-Menu_7ea47c .spectrum-Menu-end_7ea47c{grid-area:end;place-self:flex-start end}[dir=ltr] .spectrum-Menu-icon_7ea47c{padding-right:var(--spectrum-global-dimension-size-100)}[dir=rtl] .spectrum-Menu-icon_7ea47c{padding-left:var(--spectrum-global-dimension-size-100)}.spectrum-Menu-icon_7ea47c{padding-top:var(--spectrum-global-dimension-size-10);grid-area:icon}.spectrum-Menu-description_7ea47c{line-height:var(--spectrum-global-font-line-height-small,1.3);font-size:var(--spectrum-global-dimension-size-150);grid-area:description}[dir=ltr] .spectrum-Menu-keyboard_7ea47c{padding-left:var(--spectrum-global-dimension-size-125)}[dir=rtl] .spectrum-Menu-keyboard_7ea47c{padding-right:var(--spectrum-global-dimension-size-125)}.spectrum-Menu-keyboard_7ea47c{grid-area:keyboard;align-self:flex-start;font-family:adobe-clean,Source Sans Pro,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Ubuntu,Trebuchet MS,Lucida Grande,sans-serif}.spectrum-Menu_7ea47c{--spectrum-heading-subtitle3-text-color:var(--spectrum-global-color-gray-900);background-color:var(--spectrum-selectlist-background-color,var(--spectrum-alias-background-color-transparent))}.spectrum-Menu-item_7ea47c{background-color:var(--spectrum-selectlist-option-background-color,var(--spectrum-alias-background-color-transparent));color:var(--spectrum-selectlist-option-text-color,var(--spectrum-alias-text-color))}[dir=ltr] .spectrum-Menu-item_7ea47c.focus-ring_7ea47c,[dir=ltr] .spectrum-Menu-item_7ea47c.is-focused_7ea47c{border-left-color:var(--spectrum-selectlist-option-focus-indicator-color,var(--spectrum-alias-border-color-focus))}[dir=rtl] .spectrum-Menu-item_7ea47c.focus-ring_7ea47c,[dir=rtl] .spectrum-Menu-item_7ea47c.is-focused_7ea47c{border-right-color:var(--spectrum-selectlist-option-focus-indicator-color,var(--spectrum-alias-border-color-focus))}.spectrum-Menu-item_7ea47c.focus-ring_7ea47c,.spectrum-Menu-item_7ea47c.is-focused_7ea47c{background-color:var(--spectrum-selectlist-option-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay));color:var(--spectrum-selectlist-option-text-color-key-focus,var(--spectrum-alias-text-color))}.spectrum-Menu-item_7ea47c.is-hovered_7ea47c,.spectrum-Menu-item_7ea47c:focus,.spectrum-Menu-item_7ea47c.is-highlighted_7ea47c,.spectrum-Menu-item_7ea47c.is-open_7ea47c{background-color:var(--spectrum-selectlist-option-background-color-hover,var(--spectrum-alias-background-color-hover-overlay));color:var(--spectrum-selectlist-option-text-color-hover,var(--spectrum-alias-text-color))}.spectrum-Menu-item_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c{color:var(--spectrum-selectlist-option-icon-color-selected,var(--spectrum-alias-icon-color-selected))}.spectrum-Menu-item_7ea47c .is-active_7ea47c,.spectrum-Menu-item_7ea47c:active{background-color:var(--spectrum-selectlist-option-background-color-down,var(--spectrum-alias-background-color-hover-overlay))}.spectrum-Menu-item_7ea47c.is-disabled_7ea47c{background-color:var(--spectrum-selectlist-option-background-color-disabled,var(--spectrum-alias-background-color-transparent));color:var(--spectrum-selectlist-option-text-color-disabled,var(--spectrum-alias-text-color-disabled));cursor:default;background-image:none}.spectrum-Menu-item_7ea47c.is-disabled_7ea47c .spectrum-Menu-description_7ea47c{color:var(--spectrum-selectlist-option-text-color-disabled,var(--spectrum-alias-text-color-disabled))}.spectrum-Menu-sectionHeading_7ea47c{color:var(--spectrum-heading-subtitle3-text-color,var(--spectrum-global-color-gray-700))}.spectrum-Menu-divider_7ea47c{background-color:var(--spectrum-global-color-gray-300)}.spectrum-Menu-description_7ea47c{color:var(--spectrum-global-color-gray-700)}@media (forced-colors:active){.spectrum-Menu-divider_7ea47c{background-color:CanvasText;forced-color-adjust:none}.spectrum-Menu-item_7ea47c{forced-color-adjust:none;--spectrum-heading-subtitle3-text-color:ButtonText;--spectrum-selectlist-background-color:ButtonFace;--spectrum-selectlist-divider-color:ButtonText;--spectrum-selectlist-option-background-color:ButtonFace;--spectrum-selectlist-option-background-color-disabled:ButtonFace;--spectrum-selectlist-option-background-color-down:ButtonFace;--spectrum-selectlist-option-background-color-hover:Highlight;--spectrum-selectlist-option-background-color-key-focus:Highlight;--spectrum-selectlist-option-focus-indicator-color:Highlight;--spectrum-selectlist-option-icon-color-selected:Highlight;--spectrum-selectlist-option-text-color:ButtonText;--spectrum-selectlist-option-text-color-disabled:GrayText;--spectrum-selectlist-option-text-color-hover:HighlightText;--spectrum-selectlist-option-text-color-key-focus:HighlightText;--spectrum-alias-border-color-focus:Highlight}.spectrum-Menu-item_7ea47c .spectrum-Menu-description_7ea47c{color:var(--spectrum-selectlist-option-text-color,var(--spectrum-alias-text-color))}.spectrum-Menu-item_7ea47c.is-hovered_7ea47c,.spectrum-Menu-item_7ea47c:focus,.spectrum-Menu-item_7ea47c.is-highlighted_7ea47c,.spectrum-Menu-item_7ea47c.is-open_7ea47c,.spectrum-Menu-item_7ea47c.focus-ring_7ea47c,.spectrum-Menu-item_7ea47c.is-focused_7ea47c{background-color:var(--spectrum-selectlist-option-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay));color:var(--spectrum-selectlist-option-text-color-key-focus,var(--spectrum-alias-text-color))}.spectrum-Menu-item_7ea47c.is-hovered_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c,.spectrum-Menu-item_7ea47c:focus.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c,.spectrum-Menu-item_7ea47c.is-highlighted_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c,.spectrum-Menu-item_7ea47c.is-open_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c,.spectrum-Menu-item_7ea47c.focus-ring_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c,.spectrum-Menu-item_7ea47c.is-focused_7ea47c.is-selected_7ea47c .spectrum-Menu-checkmark_7ea47c{color:HighlightText}.spectrum-Menu-item_7ea47c.is-hovered_7ea47c .spectrum-Menu-description_7ea47c,.spectrum-Menu-item_7ea47c:focus .spectrum-Menu-description_7ea47c,.spectrum-Menu-item_7ea47c.is-highlighted_7ea47c .spectrum-Menu-description_7ea47c,.spectrum-Menu-item_7ea47c.is-open_7ea47c .spectrum-Menu-description_7ea47c,.spectrum-Menu-item_7ea47c.focus-ring_7ea47c .spectrum-Menu-description_7ea47c,.spectrum-Menu-item_7ea47c.is-focused_7ea47c .spectrum-Menu-description_7ea47c{color:var(--spectrum-selectlist-option-text-color-key-focus,var(--spectrum-alias-text-color));background-color:var(--spectrum-selectlist-option-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay))}}
|
package/dist/main.js
CHANGED
|
@@ -530,8 +530,7 @@ function $2205d250ee1cb1ac$export$feb3b6b552c14a12(props) {
|
|
|
530
530
|
|
|
531
531
|
|
|
532
532
|
function $0f5fd8483f48ef09$export$dca12b0bb56e4fc(props) {
|
|
533
|
-
let { children: children ,
|
|
534
|
-
let item = reusableView.content;
|
|
533
|
+
let { children: children , layoutInfo: layoutInfo , headerLayoutInfo: headerLayoutInfo , virtualizer: virtualizer , item: item } = props;
|
|
535
534
|
let { headingProps: headingProps , groupProps: groupProps } = (0, $3Fwf2$reactarialistbox.useListBoxSection)({
|
|
536
535
|
heading: item.rendered,
|
|
537
536
|
"aria-label": item["aria-label"]
|
|
@@ -541,7 +540,8 @@ function $0f5fd8483f48ef09$export$dca12b0bb56e4fc(props) {
|
|
|
541
540
|
});
|
|
542
541
|
let headerRef = (0, $3Fwf2$react.useRef)();
|
|
543
542
|
(0, $3Fwf2$reactariavirtualizer.useVirtualizerItem)({
|
|
544
|
-
|
|
543
|
+
layoutInfo: headerLayoutInfo,
|
|
544
|
+
virtualizer: virtualizer,
|
|
545
545
|
ref: headerRef
|
|
546
546
|
});
|
|
547
547
|
let { direction: direction } = (0, $3Fwf2$reactariai18n.useLocale)();
|
|
@@ -549,7 +549,7 @@ function $0f5fd8483f48ef09$export$dca12b0bb56e4fc(props) {
|
|
|
549
549
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($3Fwf2$react))).createElement((0, $3Fwf2$react.Fragment), null, /*#__PURE__*/ (0, ($parcel$interopDefault($3Fwf2$react))).createElement("div", {
|
|
550
550
|
role: "presentation",
|
|
551
551
|
ref: headerRef,
|
|
552
|
-
style: (0, $3Fwf2$reactariavirtualizer.layoutInfoToStyle)(
|
|
552
|
+
style: (0, $3Fwf2$reactariavirtualizer.layoutInfoToStyle)(headerLayoutInfo, direction)
|
|
553
553
|
}, item.key !== state.collection.getFirstKey() && /*#__PURE__*/ (0, ($parcel$interopDefault($3Fwf2$react))).createElement("div", {
|
|
554
554
|
...separatorProps,
|
|
555
555
|
className: (0, $3Fwf2$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3deee0fd2b46e64f$exports))), "spectrum-Menu-divider")
|
|
@@ -558,7 +558,7 @@ function $0f5fd8483f48ef09$export$dca12b0bb56e4fc(props) {
|
|
|
558
558
|
className: (0, $3Fwf2$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3deee0fd2b46e64f$exports))), "spectrum-Menu-sectionHeading")
|
|
559
559
|
}, item.rendered)), /*#__PURE__*/ (0, ($parcel$interopDefault($3Fwf2$react))).createElement("div", {
|
|
560
560
|
...groupProps,
|
|
561
|
-
style: (0, $3Fwf2$reactariavirtualizer.layoutInfoToStyle)(
|
|
561
|
+
style: (0, $3Fwf2$reactariavirtualizer.layoutInfoToStyle)(layoutInfo, direction),
|
|
562
562
|
className: (0, $3Fwf2$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3deee0fd2b46e64f$exports))), "spectrum-Menu")
|
|
563
563
|
}, children));
|
|
564
564
|
}
|
|
@@ -572,7 +572,7 @@ function $0f5fd8483f48ef09$export$dca12b0bb56e4fc(props) {
|
|
|
572
572
|
|
|
573
573
|
|
|
574
574
|
|
|
575
|
-
function $60eb4b34c53310cb$export$25768ea656ae32a7(state) {
|
|
575
|
+
function $60eb4b34c53310cb$export$25768ea656ae32a7(state, isLoading) {
|
|
576
576
|
let { scale: scale } = (0, $3Fwf2$reactspectrumprovider.useProvider)();
|
|
577
577
|
let collator = (0, $3Fwf2$reactariai18n.useCollator)({
|
|
578
578
|
usage: "search",
|
|
@@ -591,6 +591,17 @@ function $60eb4b34c53310cb$export$25768ea656ae32a7(state) {
|
|
|
591
591
|
]);
|
|
592
592
|
layout.collection = state.collection;
|
|
593
593
|
layout.disabledKeys = state.disabledKeys;
|
|
594
|
+
(0, $3Fwf2$reactariautils.useLayoutEffect)(()=>{
|
|
595
|
+
// Sync loading state into the layout.
|
|
596
|
+
if (layout.isLoading !== isLoading) {
|
|
597
|
+
var _layout_virtualizer;
|
|
598
|
+
layout.isLoading = isLoading;
|
|
599
|
+
(_layout_virtualizer = layout.virtualizer) === null || _layout_virtualizer === void 0 ? void 0 : _layout_virtualizer.relayoutNow();
|
|
600
|
+
}
|
|
601
|
+
}, [
|
|
602
|
+
layout,
|
|
603
|
+
isLoading
|
|
604
|
+
]);
|
|
594
605
|
return layout;
|
|
595
606
|
}
|
|
596
607
|
/** @private */ function $60eb4b34c53310cb$var$ListBoxBase(props, ref) {
|
|
@@ -602,19 +613,20 @@ function $60eb4b34c53310cb$export$25768ea656ae32a7(state) {
|
|
|
602
613
|
}, state, ref);
|
|
603
614
|
let { styleProps: styleProps } = (0, $3Fwf2$reactspectrumutils.useStyleProps)(props);
|
|
604
615
|
let stringFormatter = (0, $3Fwf2$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($b48c40096cc25703$exports))));
|
|
605
|
-
// Sync loading state into the layout.
|
|
606
|
-
layout.isLoading = props.isLoading;
|
|
607
616
|
let renderWrapper = (parent, reusableView, children, renderChildren)=>{
|
|
608
617
|
if (reusableView.viewType === "section") return /*#__PURE__*/ (0, ($parcel$interopDefault($3Fwf2$react))).createElement((0, $0f5fd8483f48ef09$export$dca12b0bb56e4fc), {
|
|
609
618
|
key: reusableView.key,
|
|
610
|
-
|
|
611
|
-
|
|
619
|
+
item: reusableView.content,
|
|
620
|
+
layoutInfo: reusableView.layoutInfo,
|
|
621
|
+
virtualizer: reusableView.virtualizer,
|
|
622
|
+
headerLayoutInfo: children.find((c)=>c.viewType === "header").layoutInfo
|
|
612
623
|
}, renderChildren(children.filter((c)=>c.viewType === "item")));
|
|
613
624
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($3Fwf2$react))).createElement((0, $3Fwf2$reactariavirtualizer.VirtualizerItem), {
|
|
614
625
|
key: reusableView.key,
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
626
|
+
layoutInfo: reusableView.layoutInfo,
|
|
627
|
+
virtualizer: reusableView.virtualizer,
|
|
628
|
+
parent: parent === null || parent === void 0 ? void 0 : parent.layoutInfo
|
|
629
|
+
}, reusableView.rendered);
|
|
618
630
|
};
|
|
619
631
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($3Fwf2$react))).createElement((0, $611e93c7b7c0413c$export$7ff8f37d2d81a48d).Provider, {
|
|
620
632
|
value: state
|
|
@@ -623,6 +635,7 @@ function $60eb4b34c53310cb$export$25768ea656ae32a7(state) {
|
|
|
623
635
|
...(0, $3Fwf2$reactariautils.mergeProps)(listBoxProps, domProps),
|
|
624
636
|
ref: ref,
|
|
625
637
|
focusedKey: state.selectionManager.focusedKey,
|
|
638
|
+
autoFocus: !!props.autoFocus,
|
|
626
639
|
sizeToFit: "height",
|
|
627
640
|
scrollDirection: "vertical",
|
|
628
641
|
className: (0, $3Fwf2$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3deee0fd2b46e64f$exports))), "spectrum-Menu", styleProps.className),
|
|
@@ -678,7 +691,7 @@ const $60eb4b34c53310cb$export$1afdcf349979fb7e = /*#__PURE__*/ (0, ($parcel$int
|
|
|
678
691
|
|
|
679
692
|
function $582d86e45be55635$var$ListBox(props, ref) {
|
|
680
693
|
let state = (0, $3Fwf2$reactstatelylist.useListState)(props);
|
|
681
|
-
let layout = (0, $60eb4b34c53310cb$export$25768ea656ae32a7)(state);
|
|
694
|
+
let layout = (0, $60eb4b34c53310cb$export$25768ea656ae32a7)(state, props.isLoading);
|
|
682
695
|
let domRef = (0, $3Fwf2$reactspectrumutils.useDOMRef)(ref);
|
|
683
696
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($3Fwf2$react))).createElement((0, $60eb4b34c53310cb$export$1afdcf349979fb7e), {
|
|
684
697
|
...props,
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;;;;AEZA,4BAAiB;IAAG,WAAW,CAAC,eAAe,CAAC;IAC9C,eAAe,CAAC,oBAAoB,CAAC;AACvC;;ADFA;;AEAA,4BAAiB;IAAG,WAAW,CAAC,YAAY,CAAC;IAC3C,eAAe,CAAC,mBAAmB,CAAC;AACtC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,WAAW,CAAC;IAC1C,eAAe,CAAC,mBAAmB,CAAC;AACtC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,YAAY,CAAC;IAC3C,eAAe,CAAC,kBAAkB,CAAC;AACrC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;IACvC,eAAe,CAAC,cAAc,CAAC;AACjC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,UAAU,CAAC;IACzC,eAAe,CAAC,uBAAuB,CAAC;AAC1C;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;IACvC,eAAe,CAAC,aAAa,CAAC;AACh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GACD,MAAM,0DAAW,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;;AD1BlC","sources":["packages/@react-spectrum/listbox/src/index.ts","packages/@react-spectrum/listbox/src/ListBox.tsx","packages/@react-spectrum/listbox/src/ListBoxBase.tsx","packages/@react-spectrum/listbox/intl/*.js","packages/@react-spectrum/listbox/intl/ar-AE.json","packages/@react-spectrum/listbox/intl/bg-BG.json","packages/@react-spectrum/listbox/intl/cs-CZ.json","packages/@react-spectrum/listbox/intl/da-DK.json","packages/@react-spectrum/listbox/intl/de-DE.json","packages/@react-spectrum/listbox/intl/el-GR.json","packages/@react-spectrum/listbox/intl/en-US.json","packages/@react-spectrum/listbox/intl/es-ES.json","packages/@react-spectrum/listbox/intl/et-EE.json","packages/@react-spectrum/listbox/intl/fi-FI.json","packages/@react-spectrum/listbox/intl/fr-FR.json","packages/@react-spectrum/listbox/intl/he-IL.json","packages/@react-spectrum/listbox/intl/hr-HR.json","packages/@react-spectrum/listbox/intl/hu-HU.json","packages/@react-spectrum/listbox/intl/it-IT.json","packages/@react-spectrum/listbox/intl/ja-JP.json","packages/@react-spectrum/listbox/intl/ko-KR.json","packages/@react-spectrum/listbox/intl/lt-LT.json","packages/@react-spectrum/listbox/intl/lv-LV.json","packages/@react-spectrum/listbox/intl/nb-NO.json","packages/@react-spectrum/listbox/intl/nl-NL.json","packages/@react-spectrum/listbox/intl/pl-PL.json","packages/@react-spectrum/listbox/intl/pt-BR.json","packages/@react-spectrum/listbox/intl/pt-PT.json","packages/@react-spectrum/listbox/intl/ro-RO.json","packages/@react-spectrum/listbox/intl/ru-RU.json","packages/@react-spectrum/listbox/intl/sk-SK.json","packages/@react-spectrum/listbox/intl/sl-SI.json","packages/@react-spectrum/listbox/intl/sr-SP.json","packages/@react-spectrum/listbox/intl/sv-SE.json","packages/@react-spectrum/listbox/intl/tr-TR.json","packages/@react-spectrum/listbox/intl/uk-UA.json","packages/@react-spectrum/listbox/intl/zh-CN.json","packages/@react-spectrum/listbox/intl/zh-TW.json","packages/@react-spectrum/listbox/src/ListBoxContext.ts","packages/@react-spectrum/listbox/src/ListBoxOption.tsx","packages/@adobe/spectrum-css-temp/components/menu/vars.css","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\n/// <reference types=\"css-module-types\" />\n\nexport {ListBox} from './ListBox';\nexport {useListBoxLayout, ListBoxBase} from './ListBoxBase';\nexport {Item, Section} from '@react-stately/collections';\nexport type {SpectrumListBoxProps} from '@react-types/listbox';\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 {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\nfunction ListBox<T extends object>(props: SpectrumListBoxProps<T>, ref: DOMRef<HTMLDivElement>) {\n let state = useListState(props);\n let layout = useListBoxLayout(state);\n let domRef = useDOMRef(ref);\n\n return (\n <ListBoxBase\n {...props}\n ref={domRef}\n state={state}\n layout={layout} />\n );\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\n\n/**\n * A list of options that can allow selection of one or more.\n */\nconst _ListBox = React.forwardRef(ListBox) as <T>(props: SpectrumListBoxProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_ListBox as ListBox};\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 {AriaLabelingProps, DOMProps, FocusStrategy, Node, 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 {ListBoxOption} from './ListBoxOption';\nimport {ListBoxSection} from './ListBoxSection';\nimport {ListLayout} from '@react-stately/layout';\nimport {ListState} from '@react-stately/list';\nimport {mergeProps} from '@react-aria/utils';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {HTMLAttributes, ReactElement, ReactNode, RefObject, useMemo} from 'react';\nimport {ReusableView} from '@react-stately/virtualizer';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {useCollator, 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: ListLayout<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 transitionDuration?: number,\n isLoading?: boolean,\n onLoadMore?: () => void,\n renderEmptyState?: () => ReactNode,\n onScroll?: () => void\n}\n\n/** @private */\nexport function useListBoxLayout<T>(state: ListState<T>): ListLayout<T> {\n let {scale} = useProvider();\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let layout = useMemo(() =>\n new ListLayout<T>({\n estimatedRowHeight: scale === 'large' ? 48 : 32,\n estimatedHeadingHeight: scale === 'large' ? 33 : 26,\n padding: scale === 'large' ? 5 : 4, // TODO: get from DNA\n loaderHeight: 40,\n placeholderHeight: scale === 'large' ? 48 : 32,\n collator\n })\n , [collator, scale]);\n\n layout.collection = state.collection;\n layout.disabledKeys = state.disabledKeys;\n return layout;\n}\n\n/** @private */\nfunction ListBoxBase<T>(props: ListBoxBaseProps<T>, ref: RefObject<HTMLDivElement>) {\n let {layout, state, shouldSelectOnPressUp, focusOnPointerEnter, shouldUseVirtualFocus, domProps = {}, transitionDuration = 0, onScroll} = props;\n let {listBoxProps} = useListBox({\n ...props,\n keyboardDelegate: layout,\n isVirtualized: true\n }, state, ref);\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n\n // Sync loading state into the layout.\n layout.isLoading = props.isLoading;\n\n // This overrides collection view's renderWrapper to support heirarchy 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>, unknown>;\n let renderWrapper = (parent: View, reusableView: View, children: View[], renderChildren: (views: View[]) => ReactElement[]) => {\n if (reusableView.viewType === 'section') {\n return (\n <ListBoxSection\n key={reusableView.key}\n reusableView={reusableView}\n header={children.find(c => c.viewType === 'header')}>\n {renderChildren(children.filter(c => c.viewType === 'item'))}\n </ListBoxSection>\n );\n }\n\n return (\n <VirtualizerItem\n key={reusableView.key}\n reusableView={reusableView}\n parent={parent} />\n );\n };\n\n return (\n <ListBoxContext.Provider value={state}>\n <FocusScope>\n <Virtualizer\n {...styleProps}\n {...mergeProps(listBoxProps, domProps)}\n ref={ref}\n focusedKey={state.selectionManager.focusedKey}\n sizeToFit=\"height\"\n scrollDirection=\"vertical\"\n className={\n classNames(\n styles,\n 'spectrum-Menu',\n styleProps.className\n )\n }\n layout={layout}\n collection={state.collection}\n renderWrapper={renderWrapper}\n transitionDuration={transitionDuration}\n isLoading={props.isLoading}\n onLoadMore={props.onLoadMore}\n shouldUseVirtualFocus={shouldUseVirtualFocus}\n onScroll={onScroll}>\n {(type, item: Node<T>) => {\n if (type === 'item') {\n return (\n <ListBoxOption\n item={item}\n shouldSelectOnPressUp={shouldSelectOnPressUp}\n shouldFocusOnHover={focusOnPointerEnter}\n shouldUseVirtualFocus={shouldUseVirtualFocus} />\n );\n } else if (type === 'loader') {\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 } else if (type === 'placeholder') {\n let emptyState = props.renderEmptyState ? props.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 }}\n </Virtualizer>\n </FocusScope>\n </ListBoxContext.Provider>\n );\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\nconst _ListBoxBase = React.forwardRef(ListBoxBase) as <T>(props: ListBoxBaseProps<T> & {ref?: RefObject<HTMLDivElement>}) => ReactElement;\nexport {_ListBoxBase as ListBoxBase};\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"loading\": \"جارٍ التحميل...\",\n \"loadingMore\": \"جارٍ تحميل المزيد...\"\n}\n","{\n \"loading\": \"Зареждане...\",\n \"loadingMore\": \"Зареждане на още...\"\n}\n","{\n \"loading\": \"Načítání...\",\n \"loadingMore\": \"Načítání dalších...\"\n}\n","{\n \"loading\": \"Indlæser ...\",\n \"loadingMore\": \"Indlæser flere ...\"\n}\n","{\n \"loading\": \"Laden...\",\n \"loadingMore\": \"Mehr laden ...\"\n}\n","{\n \"loading\": \"Φόρτωση...\",\n \"loadingMore\": \"Φόρτωση περισσότερων...\"\n}\n","{\n \"loading\": \"Loading…\",\n \"loadingMore\": \"Loading more…\"\n}\n","{\n \"loading\": \"Cargando…\",\n \"loadingMore\": \"Cargando más…\"\n}\n","{\n \"loading\": \"Laadimine...\",\n \"loadingMore\": \"Laadi rohkem...\"\n}\n","{\n \"loading\": \"Ladataan…\",\n \"loadingMore\": \"Ladataan lisää…\"\n}\n","{\n \"loading\": \"Chargement...\",\n \"loadingMore\": \"Chargement supplémentaire...\"\n}\n","{\n \"loading\": \"טוען...\",\n \"loadingMore\": \"טוען עוד...\"\n}\n","{\n \"loading\": \"Učitavam...\",\n \"loadingMore\": \"Učitavam još...\"\n}\n","{\n \"loading\": \"Betöltés folyamatban…\",\n \"loadingMore\": \"Továbbiak betöltése folyamatban…\"\n}\n","{\n \"loading\": \"Caricamento...\",\n \"loadingMore\": \"Caricamento altri...\"\n}\n","{\n \"loading\": \"読み込み中...\",\n \"loadingMore\": \"さらに読み込み中...\"\n}\n","{\n \"loading\": \"로드 중\",\n \"loadingMore\": \"추가 로드 중\"\n}\n","{\n \"loading\": \"Įkeliama...\",\n \"loadingMore\": \"Įkeliama daugiau...\"\n}\n","{\n \"loading\": \"Notiek ielāde...\",\n \"loadingMore\": \"Tiek ielādēts vēl...\"\n}\n","{\n \"loading\": \"Laster inn ...\",\n \"loadingMore\": \"Laster inn flere ...\"\n}\n","{\n \"loading\": \"Laden...\",\n \"loadingMore\": \"Meer laden...\"\n}\n","{\n \"loading\": \"Ładowanie...\",\n \"loadingMore\": \"Wczytywanie większej liczby...\"\n}\n","{\n \"loading\": \"Carregando...\",\n \"loadingMore\": \"Carregando mais...\"\n}\n","{\n \"loading\": \"A carregar...\",\n \"loadingMore\": \"A carregar mais...\"\n}\n","{\n \"loading\": \"Se încarcă...\",\n \"loadingMore\": \"Se încarcă mai multe...\"\n}\n","{\n \"loading\": \"Загрузка...\",\n \"loadingMore\": \"Дополнительная загрузка...\"\n}\n","{\n \"loading\": \"Načítava sa...\",\n \"loadingMore\": \"Načítava sa viac...\"\n}\n","{\n \"loading\": \"Nalaganje...\",\n \"loadingMore\": \"Nalaganje več vsebine...\"\n}\n","{\n \"loading\": \"Učitavam...\",\n \"loadingMore\": \"Učitavam još...\"\n}\n","{\n \"loading\": \"Läser in...\",\n \"loadingMore\": \"Läser in mer...\"\n}\n","{\n \"loading\": \"Yükleniyor...\",\n \"loadingMore\": \"Daha fazla yükleniyor...\"\n}\n","{\n \"loading\": \"Завантаження…\",\n \"loadingMore\": \"Завантаження інших об’єктів...\"\n}\n","{\n \"loading\": \"正在加载...\",\n \"loadingMore\": \"正在加载更多...\"\n}\n","{\n \"loading\": \"正在載入\",\n \"loadingMore\": \"正在載入更多…\"\n}\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 {ListState} from '@react-stately/list';\nimport React from 'react';\n\nexport const ListBoxContext = React.createContext<ListState<unknown>>(null);\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 CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, ClearSlots, SlotProvider} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {Grid} from '@react-spectrum/layout';\nimport {isFocusVisible, useHover} from '@react-aria/interactions';\nimport {ListBoxContext} from './ListBoxContext';\nimport {Node} from '@react-types/shared';\nimport React, {useContext} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useOption} from '@react-aria/listbox';\nimport {useRef} from 'react';\n\ninterface OptionProps<T> {\n item: Node<T>,\n shouldSelectOnPressUp?: boolean,\n shouldFocusOnHover?: boolean,\n shouldUseVirtualFocus?: boolean\n}\n\n/** @private */\nexport function ListBoxOption<T>(props: OptionProps<T>) {\n let {\n item,\n shouldSelectOnPressUp,\n shouldFocusOnHover,\n shouldUseVirtualFocus\n } = props;\n\n let {\n rendered,\n key\n } = item;\n let domProps = filterDOMProps(item.props);\n delete domProps.id;\n let state = useContext(ListBoxContext);\n\n let ref = useRef<HTMLDivElement>();\n let {optionProps, labelProps, descriptionProps, isSelected, isDisabled, isFocused} = useOption(\n {\n 'aria-label': item['aria-label'],\n key,\n shouldSelectOnPressUp,\n shouldFocusOnHover,\n isVirtualized: true,\n shouldUseVirtualFocus\n },\n state,\n ref\n );\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled\n });\n\n let contents = typeof rendered === 'string'\n ? <Text>{rendered}</Text>\n : rendered;\n\n let isKeyboardModality = isFocusVisible();\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n <div\n {...mergeProps(optionProps, shouldFocusOnHover ? {} : hoverProps, domProps)}\n ref={ref}\n className={classNames(\n styles,\n 'spectrum-Menu-item',\n {\n // If using virtual focus, apply focused styles to the item when the user is interacting with keyboard modality\n 'is-focused': shouldUseVirtualFocus && isFocused && isKeyboardModality,\n 'is-disabled': isDisabled,\n 'is-selected': isSelected,\n 'is-selectable': state.selectionManager.selectionMode !== 'none',\n // When shouldFocusOnHover is false, apply hover styles both when hovered with the mouse.\n // Otherwise, apply hover styles when focused using non-keyboard modality.\n 'is-hovered': (isHovered && !shouldFocusOnHover) || (isFocused && !isKeyboardModality)\n }\n )}>\n <Grid\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Menu-itemGrid'\n )\n }>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {UNSAFE_className: styles['spectrum-Menu-itemLabel'], ...labelProps},\n icon: {size: 'S', UNSAFE_className: styles['spectrum-Menu-icon']},\n description: {UNSAFE_className: styles['spectrum-Menu-description'], ...descriptionProps}\n }}>\n {contents}\n {isSelected &&\n <CheckmarkMedium\n slot=\"checkmark\"\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Menu-checkmark'\n )\n } />\n }\n </SlotProvider>\n </ClearSlots>\n </Grid>\n </div>\n </FocusRing>\n );\n}\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\n@import './index.css';\n@import './skin.css';\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 {classNames} from '@react-spectrum/utils';\nimport {layoutInfoToStyle, useVirtualizerItem} from '@react-aria/virtualizer';\nimport {ListBoxContext} from './ListBoxContext';\nimport {Node} from '@react-types/shared';\nimport React, {Fragment, ReactNode, useContext, useRef} from 'react';\nimport {ReusableView} from '@react-stately/virtualizer';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {useListBoxSection} from '@react-aria/listbox';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSeparator} from '@react-aria/separator';\n\ninterface ListBoxSectionProps<T> {\n reusableView: ReusableView<Node<T>, unknown>,\n header: ReusableView<Node<T>, unknown>,\n children?: ReactNode\n}\n\n/** @private */\nexport function ListBoxSection<T>(props: ListBoxSectionProps<T>) {\n let {children, reusableView, header} = props;\n let item = reusableView.content;\n let {headingProps, groupProps} = useListBoxSection({\n heading: item.rendered,\n 'aria-label': item['aria-label']\n });\n\n let {separatorProps} = useSeparator({\n elementType: 'li'\n });\n\n let headerRef = useRef();\n useVirtualizerItem({\n reusableView: header,\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(header.layoutInfo, direction)}>\n {item.key !== state.collection.getFirstKey() &&\n <div\n {...separatorProps}\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(reusableView.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":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;;;;AEZA,4BAAiB;IAAG,WAAW,CAAC,eAAe,CAAC;IAC9C,eAAe,CAAC,oBAAoB,CAAC;AACvC;;ADFA;;AEAA,4BAAiB;IAAG,WAAW,CAAC,YAAY,CAAC;IAC3C,eAAe,CAAC,mBAAmB,CAAC;AACtC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,WAAW,CAAC;IAC1C,eAAe,CAAC,mBAAmB,CAAC;AACtC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,YAAY,CAAC;IAC3C,eAAe,CAAC,kBAAkB,CAAC;AACrC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;IACvC,eAAe,CAAC,cAAc,CAAC;AACjC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,UAAU,CAAC;IACzC,eAAe,CAAC,uBAAu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BACvE,iEAAiE;gBACjE,MAAK;eACJ;QAGP,CAAC;IACH;AAKV;AAEA,wFAAwF;AACxF,2GAA2G;AAC3G,MAAM,0DAAe,CAAA,GAAA,sCAAK,AAAD,EAAE,UAAU,CAAC;;CDjLrC,GAED;;;;AAOA,SAAS,8BAA0B,KAA8B,EAAE,GAA2B,EAAE;IAC9F,IAAI,QAAQ,CAAA,GAAA,oCAAW,EAAE;IACzB,IAAI,SAAS,CAAA,GAAA,yCAAgB,AAAD,EAAE,OAAO,MAAM,SAAS;IACpD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,0DAAC,CAAA,GAAA,yCAAW,AAAD;QACR,GAAG,KAAK;QACT,KAAK;QACL,OAAO;QACP,QAAQ;;AAEd;AAEA,wFAAwF;AACxF,2GAA2G;AAG3G;;CAEC,GACD,MAAM,0DAAW,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;;AD1BlC","sources":["packages/@react-spectrum/listbox/src/index.ts","packages/@react-spectrum/listbox/src/ListBox.tsx","packages/@react-spectrum/listbox/src/ListBoxBase.tsx","packages/@react-spectrum/listbox/intl/*.js","packages/@react-spectrum/listbox/intl/ar-AE.json","packages/@react-spectrum/listbox/intl/bg-BG.json","packages/@react-spectrum/listbox/intl/cs-CZ.json","packages/@react-spectrum/listbox/intl/da-DK.json","packages/@react-spectrum/listbox/intl/de-DE.json","packages/@react-spectrum/listbox/intl/el-GR.json","packages/@react-spectrum/listbox/intl/en-US.json","packages/@react-spectrum/listbox/intl/es-ES.json","packages/@react-spectrum/listbox/intl/et-EE.json","packages/@react-spectrum/listbox/intl/fi-FI.json","packages/@react-spectrum/listbox/intl/fr-FR.json","packages/@react-spectrum/listbox/intl/he-IL.json","packages/@react-spectrum/listbox/intl/hr-HR.json","packages/@react-spectrum/listbox/intl/hu-HU.json","packages/@react-spectrum/listbox/intl/it-IT.json","packages/@react-spectrum/listbox/intl/ja-JP.json","packages/@react-spectrum/listbox/intl/ko-KR.json","packages/@react-spectrum/listbox/intl/lt-LT.json","packages/@react-spectrum/listbox/intl/lv-LV.json","packages/@react-spectrum/listbox/intl/nb-NO.json","packages/@react-spectrum/listbox/intl/nl-NL.json","packages/@react-spectrum/listbox/intl/pl-PL.json","packages/@react-spectrum/listbox/intl/pt-BR.json","packages/@react-spectrum/listbox/intl/pt-PT.json","packages/@react-spectrum/listbox/intl/ro-RO.json","packages/@react-spectrum/listbox/intl/ru-RU.json","packages/@react-spectrum/listbox/intl/sk-SK.json","packages/@react-spectrum/listbox/intl/sl-SI.json","packages/@react-spectrum/listbox/intl/sr-SP.json","packages/@react-spectrum/listbox/intl/sv-SE.json","packages/@react-spectrum/listbox/intl/tr-TR.json","packages/@react-spectrum/listbox/intl/uk-UA.json","packages/@react-spectrum/listbox/intl/zh-CN.json","packages/@react-spectrum/listbox/intl/zh-TW.json","packages/@react-spectrum/listbox/src/ListBoxContext.ts","packages/@react-spectrum/listbox/src/ListBoxOption.tsx","packages/@adobe/spectrum-css-temp/components/menu/vars.css","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\n/// <reference types=\"css-module-types\" />\n\nexport {ListBox} from './ListBox';\nexport {useListBoxLayout, ListBoxBase} from './ListBoxBase';\nexport {Item, Section} from '@react-stately/collections';\nexport type {SpectrumListBoxProps} from '@react-types/listbox';\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 {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\nfunction ListBox<T extends object>(props: SpectrumListBoxProps<T>, ref: DOMRef<HTMLDivElement>) {\n let state = useListState(props);\n let layout = useListBoxLayout(state, props.isLoading);\n let domRef = useDOMRef(ref);\n\n return (\n <ListBoxBase\n {...props}\n ref={domRef}\n state={state}\n layout={layout} />\n );\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\n\n/**\n * A list of options that can allow selection of one or more.\n */\nconst _ListBox = React.forwardRef(ListBox) as <T>(props: SpectrumListBoxProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_ListBox as ListBox};\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 {AriaLabelingProps, DOMProps, FocusStrategy, Node, 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 {ListBoxOption} from './ListBoxOption';\nimport {ListBoxSection} from './ListBoxSection';\nimport {ListLayout} from '@react-stately/layout';\nimport {ListState} from '@react-stately/list';\nimport {mergeProps, useLayoutEffect} from '@react-aria/utils';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {HTMLAttributes, ReactElement, ReactNode, RefObject, useMemo} from 'react';\nimport {ReusableView} from '@react-stately/virtualizer';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {useCollator, 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: ListLayout<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 transitionDuration?: number,\n isLoading?: boolean,\n onLoadMore?: () => void,\n renderEmptyState?: () => ReactNode,\n onScroll?: () => void\n}\n\n/** @private */\nexport function useListBoxLayout<T>(state: ListState<T>, isLoading: boolean): ListLayout<T> {\n let {scale} = useProvider();\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let layout = useMemo(() =>\n new ListLayout<T>({\n estimatedRowHeight: scale === 'large' ? 48 : 32,\n estimatedHeadingHeight: scale === 'large' ? 33 : 26,\n padding: scale === 'large' ? 5 : 4, // TODO: get from DNA\n loaderHeight: 40,\n placeholderHeight: scale === 'large' ? 48 : 32,\n collator\n })\n , [collator, scale]);\n\n layout.collection = state.collection;\n layout.disabledKeys = state.disabledKeys;\n\n useLayoutEffect(() => {\n // Sync loading state into the layout.\n if (layout.isLoading !== isLoading) {\n layout.isLoading = isLoading;\n layout.virtualizer?.relayoutNow();\n }\n }, [layout, isLoading]);\n return layout;\n}\n\n/** @private */\nfunction ListBoxBase<T>(props: ListBoxBaseProps<T>, ref: RefObject<HTMLDivElement>) {\n let {layout, state, shouldSelectOnPressUp, focusOnPointerEnter, shouldUseVirtualFocus, domProps = {}, transitionDuration = 0, onScroll} = props;\n let {listBoxProps} = useListBox({\n ...props,\n keyboardDelegate: layout,\n isVirtualized: true\n }, state, ref);\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n\n // This overrides collection view's renderWrapper to support heirarchy 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 = (parent: View, 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}>\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 return (\n <ListBoxContext.Provider value={state}>\n <FocusScope>\n <Virtualizer\n {...styleProps}\n {...mergeProps(listBoxProps, domProps)}\n ref={ref}\n focusedKey={state.selectionManager.focusedKey}\n autoFocus={!!props.autoFocus}\n sizeToFit=\"height\"\n scrollDirection=\"vertical\"\n className={\n classNames(\n styles,\n 'spectrum-Menu',\n styleProps.className\n )\n }\n layout={layout}\n collection={state.collection}\n renderWrapper={renderWrapper}\n transitionDuration={transitionDuration}\n isLoading={props.isLoading}\n onLoadMore={props.onLoadMore}\n shouldUseVirtualFocus={shouldUseVirtualFocus}\n onScroll={onScroll}>\n {(type, item: Node<T>) => {\n if (type === 'item') {\n return (\n <ListBoxOption\n item={item}\n shouldSelectOnPressUp={shouldSelectOnPressUp}\n shouldFocusOnHover={focusOnPointerEnter}\n shouldUseVirtualFocus={shouldUseVirtualFocus} />\n );\n } else if (type === 'loader') {\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 } else if (type === 'placeholder') {\n let emptyState = props.renderEmptyState ? props.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 }}\n </Virtualizer>\n </FocusScope>\n </ListBoxContext.Provider>\n );\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\nconst _ListBoxBase = React.forwardRef(ListBoxBase) as <T>(props: ListBoxBaseProps<T> & {ref?: RefObject<HTMLDivElement>}) => ReactElement;\nexport {_ListBoxBase as ListBoxBase};\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"loading\": \"جارٍ التحميل...\",\n \"loadingMore\": \"جارٍ تحميل المزيد...\"\n}\n","{\n \"loading\": \"Зареждане...\",\n \"loadingMore\": \"Зареждане на още...\"\n}\n","{\n \"loading\": \"Načítání...\",\n \"loadingMore\": \"Načítání dalších...\"\n}\n","{\n \"loading\": \"Indlæser ...\",\n \"loadingMore\": \"Indlæser flere ...\"\n}\n","{\n \"loading\": \"Laden...\",\n \"loadingMore\": \"Mehr laden ...\"\n}\n","{\n \"loading\": \"Φόρτωση...\",\n \"loadingMore\": \"Φόρτωση περισσότερων...\"\n}\n","{\n \"loading\": \"Loading…\",\n \"loadingMore\": \"Loading more…\"\n}\n","{\n \"loading\": \"Cargando…\",\n \"loadingMore\": \"Cargando más…\"\n}\n","{\n \"loading\": \"Laadimine...\",\n \"loadingMore\": \"Laadi rohkem...\"\n}\n","{\n \"loading\": \"Ladataan…\",\n \"loadingMore\": \"Ladataan lisää…\"\n}\n","{\n \"loading\": \"Chargement...\",\n \"loadingMore\": \"Chargement supplémentaire...\"\n}\n","{\n \"loading\": \"טוען...\",\n \"loadingMore\": \"טוען עוד...\"\n}\n","{\n \"loading\": \"Učitavam...\",\n \"loadingMore\": \"Učitavam još...\"\n}\n","{\n \"loading\": \"Betöltés folyamatban…\",\n \"loadingMore\": \"Továbbiak betöltése folyamatban…\"\n}\n","{\n \"loading\": \"Caricamento...\",\n \"loadingMore\": \"Caricamento altri...\"\n}\n","{\n \"loading\": \"読み込み中...\",\n \"loadingMore\": \"さらに読み込み中...\"\n}\n","{\n \"loading\": \"로드 중\",\n \"loadingMore\": \"추가 로드 중\"\n}\n","{\n \"loading\": \"Įkeliama...\",\n \"loadingMore\": \"Įkeliama daugiau...\"\n}\n","{\n \"loading\": \"Notiek ielāde...\",\n \"loadingMore\": \"Tiek ielādēts vēl...\"\n}\n","{\n \"loading\": \"Laster inn ...\",\n \"loadingMore\": \"Laster inn flere ...\"\n}\n","{\n \"loading\": \"Laden...\",\n \"loadingMore\": \"Meer laden...\"\n}\n","{\n \"loading\": \"Ładowanie...\",\n \"loadingMore\": \"Wczytywanie większej liczby...\"\n}\n","{\n \"loading\": \"Carregando...\",\n \"loadingMore\": \"Carregando mais...\"\n}\n","{\n \"loading\": \"A carregar...\",\n \"loadingMore\": \"A carregar mais...\"\n}\n","{\n \"loading\": \"Se încarcă...\",\n \"loadingMore\": \"Se încarcă mai multe...\"\n}\n","{\n \"loading\": \"Загрузка...\",\n \"loadingMore\": \"Дополнительная загрузка...\"\n}\n","{\n \"loading\": \"Načítava sa...\",\n \"loadingMore\": \"Načítava sa viac...\"\n}\n","{\n \"loading\": \"Nalaganje...\",\n \"loadingMore\": \"Nalaganje več vsebine...\"\n}\n","{\n \"loading\": \"Učitavam...\",\n \"loadingMore\": \"Učitavam još...\"\n}\n","{\n \"loading\": \"Läser in...\",\n \"loadingMore\": \"Läser in mer...\"\n}\n","{\n \"loading\": \"Yükleniyor...\",\n \"loadingMore\": \"Daha fazla yükleniyor...\"\n}\n","{\n \"loading\": \"Завантаження…\",\n \"loadingMore\": \"Завантаження інших об’єктів...\"\n}\n","{\n \"loading\": \"正在加载...\",\n \"loadingMore\": \"正在加载更多...\"\n}\n","{\n \"loading\": \"正在載入\",\n \"loadingMore\": \"正在載入更多…\"\n}\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 {ListState} from '@react-stately/list';\nimport React from 'react';\n\nexport const ListBoxContext = React.createContext<ListState<unknown>>(null);\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 CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, ClearSlots, SlotProvider} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {Grid} from '@react-spectrum/layout';\nimport {isFocusVisible, useHover} from '@react-aria/interactions';\nimport {ListBoxContext} from './ListBoxContext';\nimport {Node} from '@react-types/shared';\nimport React, {useContext} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useOption} from '@react-aria/listbox';\nimport {useRef} from 'react';\n\ninterface OptionProps<T> {\n item: Node<T>,\n shouldSelectOnPressUp?: boolean,\n shouldFocusOnHover?: boolean,\n shouldUseVirtualFocus?: boolean\n}\n\n/** @private */\nexport function ListBoxOption<T>(props: OptionProps<T>) {\n let {\n item,\n shouldSelectOnPressUp,\n shouldFocusOnHover,\n shouldUseVirtualFocus\n } = props;\n\n let {\n rendered,\n key\n } = item;\n let domProps = filterDOMProps(item.props);\n delete domProps.id;\n let state = useContext(ListBoxContext);\n\n let ref = useRef<HTMLDivElement>();\n let {optionProps, labelProps, descriptionProps, isSelected, isDisabled, isFocused} = useOption(\n {\n 'aria-label': item['aria-label'],\n key,\n shouldSelectOnPressUp,\n shouldFocusOnHover,\n isVirtualized: true,\n shouldUseVirtualFocus\n },\n state,\n ref\n );\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled\n });\n\n let contents = typeof rendered === 'string'\n ? <Text>{rendered}</Text>\n : rendered;\n\n let isKeyboardModality = isFocusVisible();\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n <div\n {...mergeProps(optionProps, shouldFocusOnHover ? {} : hoverProps, domProps)}\n ref={ref}\n className={classNames(\n styles,\n 'spectrum-Menu-item',\n {\n // If using virtual focus, apply focused styles to the item when the user is interacting with keyboard modality\n 'is-focused': shouldUseVirtualFocus && isFocused && isKeyboardModality,\n 'is-disabled': isDisabled,\n 'is-selected': isSelected,\n 'is-selectable': state.selectionManager.selectionMode !== 'none',\n // When shouldFocusOnHover is false, apply hover styles both when hovered with the mouse.\n // Otherwise, apply hover styles when focused using non-keyboard modality.\n 'is-hovered': (isHovered && !shouldFocusOnHover) || (isFocused && !isKeyboardModality)\n }\n )}>\n <Grid\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Menu-itemGrid'\n )\n }>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {UNSAFE_className: styles['spectrum-Menu-itemLabel'], ...labelProps},\n icon: {size: 'S', UNSAFE_className: styles['spectrum-Menu-icon']},\n description: {UNSAFE_className: styles['spectrum-Menu-description'], ...descriptionProps}\n }}>\n {contents}\n {isSelected &&\n <CheckmarkMedium\n slot=\"checkmark\"\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Menu-checkmark'\n )\n } />\n }\n </SlotProvider>\n </ClearSlots>\n </Grid>\n </div>\n </FocusRing>\n );\n}\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\n@import './index.css';\n@import './skin.css';\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 {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';\nimport {useSeparator} from '@react-aria/separator';\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 {separatorProps} = useSeparator({\n elementType: 'li'\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 {...separatorProps}\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":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -6,7 +6,7 @@ import {useListState as $j8tbs$useListState} from "@react-stately/list";
|
|
|
6
6
|
import {useListBox as $j8tbs$useListBox, useOption as $j8tbs$useOption, useListBoxSection as $j8tbs$useListBoxSection} from "@react-aria/listbox";
|
|
7
7
|
import {FocusScope as $j8tbs$FocusScope, FocusRing as $j8tbs$FocusRing} from "@react-aria/focus";
|
|
8
8
|
import {ListLayout as $j8tbs$ListLayout} from "@react-stately/layout";
|
|
9
|
-
import {mergeProps as $j8tbs$mergeProps, filterDOMProps as $j8tbs$filterDOMProps} from "@react-aria/utils";
|
|
9
|
+
import {useLayoutEffect as $j8tbs$useLayoutEffect, mergeProps as $j8tbs$mergeProps, filterDOMProps as $j8tbs$filterDOMProps} from "@react-aria/utils";
|
|
10
10
|
import {ProgressCircle as $j8tbs$ProgressCircle} from "@react-spectrum/progress";
|
|
11
11
|
import {useCollator as $j8tbs$useCollator, useLocalizedStringFormatter as $j8tbs$useLocalizedStringFormatter, useLocale as $j8tbs$useLocale} from "@react-aria/i18n";
|
|
12
12
|
import {useProvider as $j8tbs$useProvider} from "@react-spectrum/provider";
|
|
@@ -524,8 +524,7 @@ function $86983ea1fa3f7312$export$feb3b6b552c14a12(props) {
|
|
|
524
524
|
|
|
525
525
|
|
|
526
526
|
function $92d678ed88836094$export$dca12b0bb56e4fc(props) {
|
|
527
|
-
let { children: children ,
|
|
528
|
-
let item = reusableView.content;
|
|
527
|
+
let { children: children , layoutInfo: layoutInfo , headerLayoutInfo: headerLayoutInfo , virtualizer: virtualizer , item: item } = props;
|
|
529
528
|
let { headingProps: headingProps , groupProps: groupProps } = (0, $j8tbs$useListBoxSection)({
|
|
530
529
|
heading: item.rendered,
|
|
531
530
|
"aria-label": item["aria-label"]
|
|
@@ -535,7 +534,8 @@ function $92d678ed88836094$export$dca12b0bb56e4fc(props) {
|
|
|
535
534
|
});
|
|
536
535
|
let headerRef = (0, $j8tbs$useRef)();
|
|
537
536
|
(0, $j8tbs$useVirtualizerItem)({
|
|
538
|
-
|
|
537
|
+
layoutInfo: headerLayoutInfo,
|
|
538
|
+
virtualizer: virtualizer,
|
|
539
539
|
ref: headerRef
|
|
540
540
|
});
|
|
541
541
|
let { direction: direction } = (0, $j8tbs$useLocale)();
|
|
@@ -543,7 +543,7 @@ function $92d678ed88836094$export$dca12b0bb56e4fc(props) {
|
|
|
543
543
|
return /*#__PURE__*/ (0, $j8tbs$react).createElement((0, $j8tbs$Fragment), null, /*#__PURE__*/ (0, $j8tbs$react).createElement("div", {
|
|
544
544
|
role: "presentation",
|
|
545
545
|
ref: headerRef,
|
|
546
|
-
style: (0, $j8tbs$layoutInfoToStyle)(
|
|
546
|
+
style: (0, $j8tbs$layoutInfoToStyle)(headerLayoutInfo, direction)
|
|
547
547
|
}, item.key !== state.collection.getFirstKey() && /*#__PURE__*/ (0, $j8tbs$react).createElement("div", {
|
|
548
548
|
...separatorProps,
|
|
549
549
|
className: (0, $j8tbs$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-divider")
|
|
@@ -552,7 +552,7 @@ function $92d678ed88836094$export$dca12b0bb56e4fc(props) {
|
|
|
552
552
|
className: (0, $j8tbs$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu-sectionHeading")
|
|
553
553
|
}, item.rendered)), /*#__PURE__*/ (0, $j8tbs$react).createElement("div", {
|
|
554
554
|
...groupProps,
|
|
555
|
-
style: (0, $j8tbs$layoutInfoToStyle)(
|
|
555
|
+
style: (0, $j8tbs$layoutInfoToStyle)(layoutInfo, direction),
|
|
556
556
|
className: (0, $j8tbs$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu")
|
|
557
557
|
}, children));
|
|
558
558
|
}
|
|
@@ -566,7 +566,7 @@ function $92d678ed88836094$export$dca12b0bb56e4fc(props) {
|
|
|
566
566
|
|
|
567
567
|
|
|
568
568
|
|
|
569
|
-
function $3247d4a89e6094e9$export$25768ea656ae32a7(state) {
|
|
569
|
+
function $3247d4a89e6094e9$export$25768ea656ae32a7(state, isLoading) {
|
|
570
570
|
let { scale: scale } = (0, $j8tbs$useProvider)();
|
|
571
571
|
let collator = (0, $j8tbs$useCollator)({
|
|
572
572
|
usage: "search",
|
|
@@ -585,6 +585,17 @@ function $3247d4a89e6094e9$export$25768ea656ae32a7(state) {
|
|
|
585
585
|
]);
|
|
586
586
|
layout.collection = state.collection;
|
|
587
587
|
layout.disabledKeys = state.disabledKeys;
|
|
588
|
+
(0, $j8tbs$useLayoutEffect)(()=>{
|
|
589
|
+
// Sync loading state into the layout.
|
|
590
|
+
if (layout.isLoading !== isLoading) {
|
|
591
|
+
var _layout_virtualizer;
|
|
592
|
+
layout.isLoading = isLoading;
|
|
593
|
+
(_layout_virtualizer = layout.virtualizer) === null || _layout_virtualizer === void 0 ? void 0 : _layout_virtualizer.relayoutNow();
|
|
594
|
+
}
|
|
595
|
+
}, [
|
|
596
|
+
layout,
|
|
597
|
+
isLoading
|
|
598
|
+
]);
|
|
588
599
|
return layout;
|
|
589
600
|
}
|
|
590
601
|
/** @private */ function $3247d4a89e6094e9$var$ListBoxBase(props, ref) {
|
|
@@ -596,19 +607,20 @@ function $3247d4a89e6094e9$export$25768ea656ae32a7(state) {
|
|
|
596
607
|
}, state, ref);
|
|
597
608
|
let { styleProps: styleProps } = (0, $j8tbs$useStyleProps)(props);
|
|
598
609
|
let stringFormatter = (0, $j8tbs$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($07d5971c39cb246a$exports))));
|
|
599
|
-
// Sync loading state into the layout.
|
|
600
|
-
layout.isLoading = props.isLoading;
|
|
601
610
|
let renderWrapper = (parent, reusableView, children, renderChildren)=>{
|
|
602
611
|
if (reusableView.viewType === "section") return /*#__PURE__*/ (0, $j8tbs$react).createElement((0, $92d678ed88836094$export$dca12b0bb56e4fc), {
|
|
603
612
|
key: reusableView.key,
|
|
604
|
-
|
|
605
|
-
|
|
613
|
+
item: reusableView.content,
|
|
614
|
+
layoutInfo: reusableView.layoutInfo,
|
|
615
|
+
virtualizer: reusableView.virtualizer,
|
|
616
|
+
headerLayoutInfo: children.find((c)=>c.viewType === "header").layoutInfo
|
|
606
617
|
}, renderChildren(children.filter((c)=>c.viewType === "item")));
|
|
607
618
|
return /*#__PURE__*/ (0, $j8tbs$react).createElement((0, $j8tbs$VirtualizerItem), {
|
|
608
619
|
key: reusableView.key,
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
620
|
+
layoutInfo: reusableView.layoutInfo,
|
|
621
|
+
virtualizer: reusableView.virtualizer,
|
|
622
|
+
parent: parent === null || parent === void 0 ? void 0 : parent.layoutInfo
|
|
623
|
+
}, reusableView.rendered);
|
|
612
624
|
};
|
|
613
625
|
return /*#__PURE__*/ (0, $j8tbs$react).createElement((0, $0c6f792811e33483$export$7ff8f37d2d81a48d).Provider, {
|
|
614
626
|
value: state
|
|
@@ -617,6 +629,7 @@ function $3247d4a89e6094e9$export$25768ea656ae32a7(state) {
|
|
|
617
629
|
...(0, $j8tbs$mergeProps)(listBoxProps, domProps),
|
|
618
630
|
ref: ref,
|
|
619
631
|
focusedKey: state.selectionManager.focusedKey,
|
|
632
|
+
autoFocus: !!props.autoFocus,
|
|
620
633
|
sizeToFit: "height",
|
|
621
634
|
scrollDirection: "vertical",
|
|
622
635
|
className: (0, $j8tbs$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($286d1cb34bb7dc84$exports))), "spectrum-Menu", styleProps.className),
|
|
@@ -672,7 +685,7 @@ const $3247d4a89e6094e9$export$1afdcf349979fb7e = /*#__PURE__*/ (0, $j8tbs$react
|
|
|
672
685
|
|
|
673
686
|
function $3136257018b1a220$var$ListBox(props, ref) {
|
|
674
687
|
let state = (0, $j8tbs$useListState)(props);
|
|
675
|
-
let layout = (0, $3247d4a89e6094e9$export$25768ea656ae32a7)(state);
|
|
688
|
+
let layout = (0, $3247d4a89e6094e9$export$25768ea656ae32a7)(state, props.isLoading);
|
|
676
689
|
let domRef = (0, $j8tbs$useDOMRef)(ref);
|
|
677
690
|
return /*#__PURE__*/ (0, $j8tbs$react).createElement((0, $3247d4a89e6094e9$export$1afdcf349979fb7e), {
|
|
678
691
|
...props,
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;;;;AEZA,4BAAiB;IAAG,WAAW,CAAC,eAAe,CAAC;IAC9C,eAAe,CAAC,oBAAoB,CAAC;AACvC;;ADFA;;AEAA,4BAAiB;IAAG,WAAW,CAAC,YAAY,CAAC;IAC3C,eAAe,CAAC,mBAAmB,CAAC;AACtC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,WAAW,CAAC;IAC1C,eAAe,CAAC,mBAAmB,CAAC;AACtC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,YAAY,CAAC;IAC3C,eAAe,CAAC,kBAAkB,CAAC;AACrC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;IACvC,eAAe,CAAC,cAAc,CAAC;AACjC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,UAAU,CAAC;IACzC,eAAe,CAAC,uBAAuB,CAAC;AAC1C;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;IACvC,eAAe,CAAC,aAAa,CAAC;AAChC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,SAAS,CAAC;IACxC,eAAe,C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-spectrum/listbox/src/index.ts","packages/@react-spectrum/listbox/src/ListBox.tsx","packages/@react-spectrum/listbox/src/ListBoxBase.tsx","packages/@react-spectrum/listbox/intl/*.js","packages/@react-spectrum/listbox/intl/ar-AE.json","packages/@react-spectrum/listbox/intl/bg-BG.json","packages/@react-spectrum/listbox/intl/cs-CZ.json","packages/@react-spectrum/listbox/intl/da-DK.json","packages/@react-spectrum/listbox/intl/de-DE.json","packages/@react-spectrum/listbox/intl/el-GR.json","packages/@react-spectrum/listbox/intl/en-US.json","packages/@react-spectrum/listbox/intl/es-ES.json","packages/@react-spectrum/listbox/intl/et-EE.json","packages/@react-spectrum/listbox/intl/fi-FI.json","packages/@react-spectrum/listbox/intl/fr-FR.json","packages/@react-spectrum/listbox/intl/he-IL.json","packages/@react-spectrum/listbox/intl/hr-HR.json","packages/@react-spectrum/listbox/intl/hu-HU.json","packages/@react-spectrum/listbox/intl/it-IT.json","packages/@react-spectrum/listbox/intl/ja-JP.json","packages/@react-spectrum/listbox/intl/ko-KR.json","packages/@react-spectrum/listbox/intl/lt-LT.json","packages/@react-spectrum/listbox/intl/lv-LV.json","packages/@react-spectrum/listbox/intl/nb-NO.json","packages/@react-spectrum/listbox/intl/nl-NL.json","packages/@react-spectrum/listbox/intl/pl-PL.json","packages/@react-spectrum/listbox/intl/pt-BR.json","packages/@react-spectrum/listbox/intl/pt-PT.json","packages/@react-spectrum/listbox/intl/ro-RO.json","packages/@react-spectrum/listbox/intl/ru-RU.json","packages/@react-spectrum/listbox/intl/sk-SK.json","packages/@react-spectrum/listbox/intl/sl-SI.json","packages/@react-spectrum/listbox/intl/sr-SP.json","packages/@react-spectrum/listbox/intl/sv-SE.json","packages/@react-spectrum/listbox/intl/tr-TR.json","packages/@react-spectrum/listbox/intl/uk-UA.json","packages/@react-spectrum/listbox/intl/zh-CN.json","packages/@react-spectrum/listbox/intl/zh-TW.json","packages/@react-spectrum/listbox/src/ListBoxContext.ts","packages/@react-spectrum/listbox/src/ListBoxOption.tsx","packages/@adobe/spectrum-css-temp/components/menu/vars.css","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\n/// <reference types=\"css-module-types\" />\n\nexport {ListBox} from './ListBox';\nexport {useListBoxLayout, ListBoxBase} from './ListBoxBase';\nexport {Item, Section} from '@react-stately/collections';\nexport type {SpectrumListBoxProps} from '@react-types/listbox';\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 {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\nfunction ListBox<T extends object>(props: SpectrumListBoxProps<T>, ref: DOMRef<HTMLDivElement>) {\n let state = useListState(props);\n let layout = useListBoxLayout(state);\n let domRef = useDOMRef(ref);\n\n return (\n <ListBoxBase\n {...props}\n ref={domRef}\n state={state}\n layout={layout} />\n );\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\n\n/**\n * A list of options that can allow selection of one or more.\n */\nconst _ListBox = React.forwardRef(ListBox) as <T>(props: SpectrumListBoxProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_ListBox as ListBox};\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 {AriaLabelingProps, DOMProps, FocusStrategy, Node, 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 {ListBoxOption} from './ListBoxOption';\nimport {ListBoxSection} from './ListBoxSection';\nimport {ListLayout} from '@react-stately/layout';\nimport {ListState} from '@react-stately/list';\nimport {mergeProps} from '@react-aria/utils';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {HTMLAttributes, ReactElement, ReactNode, RefObject, useMemo} from 'react';\nimport {ReusableView} from '@react-stately/virtualizer';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {useCollator, 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: ListLayout<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 transitionDuration?: number,\n isLoading?: boolean,\n onLoadMore?: () => void,\n renderEmptyState?: () => ReactNode,\n onScroll?: () => void\n}\n\n/** @private */\nexport function useListBoxLayout<T>(state: ListState<T>): ListLayout<T> {\n let {scale} = useProvider();\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let layout = useMemo(() =>\n new ListLayout<T>({\n estimatedRowHeight: scale === 'large' ? 48 : 32,\n estimatedHeadingHeight: scale === 'large' ? 33 : 26,\n padding: scale === 'large' ? 5 : 4, // TODO: get from DNA\n loaderHeight: 40,\n placeholderHeight: scale === 'large' ? 48 : 32,\n collator\n })\n , [collator, scale]);\n\n layout.collection = state.collection;\n layout.disabledKeys = state.disabledKeys;\n return layout;\n}\n\n/** @private */\nfunction ListBoxBase<T>(props: ListBoxBaseProps<T>, ref: RefObject<HTMLDivElement>) {\n let {layout, state, shouldSelectOnPressUp, focusOnPointerEnter, shouldUseVirtualFocus, domProps = {}, transitionDuration = 0, onScroll} = props;\n let {listBoxProps} = useListBox({\n ...props,\n keyboardDelegate: layout,\n isVirtualized: true\n }, state, ref);\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n\n // Sync loading state into the layout.\n layout.isLoading = props.isLoading;\n\n // This overrides collection view's renderWrapper to support heirarchy 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>, unknown>;\n let renderWrapper = (parent: View, reusableView: View, children: View[], renderChildren: (views: View[]) => ReactElement[]) => {\n if (reusableView.viewType === 'section') {\n return (\n <ListBoxSection\n key={reusableView.key}\n reusableView={reusableView}\n header={children.find(c => c.viewType === 'header')}>\n {renderChildren(children.filter(c => c.viewType === 'item'))}\n </ListBoxSection>\n );\n }\n\n return (\n <VirtualizerItem\n key={reusableView.key}\n reusableView={reusableView}\n parent={parent} />\n );\n };\n\n return (\n <ListBoxContext.Provider value={state}>\n <FocusScope>\n <Virtualizer\n {...styleProps}\n {...mergeProps(listBoxProps, domProps)}\n ref={ref}\n focusedKey={state.selectionManager.focusedKey}\n sizeToFit=\"height\"\n scrollDirection=\"vertical\"\n className={\n classNames(\n styles,\n 'spectrum-Menu',\n styleProps.className\n )\n }\n layout={layout}\n collection={state.collection}\n renderWrapper={renderWrapper}\n transitionDuration={transitionDuration}\n isLoading={props.isLoading}\n onLoadMore={props.onLoadMore}\n shouldUseVirtualFocus={shouldUseVirtualFocus}\n onScroll={onScroll}>\n {(type, item: Node<T>) => {\n if (type === 'item') {\n return (\n <ListBoxOption\n item={item}\n shouldSelectOnPressUp={shouldSelectOnPressUp}\n shouldFocusOnHover={focusOnPointerEnter}\n shouldUseVirtualFocus={shouldUseVirtualFocus} />\n );\n } else if (type === 'loader') {\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 } else if (type === 'placeholder') {\n let emptyState = props.renderEmptyState ? props.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 }}\n </Virtualizer>\n </FocusScope>\n </ListBoxContext.Provider>\n );\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\nconst _ListBoxBase = React.forwardRef(ListBoxBase) as <T>(props: ListBoxBaseProps<T> & {ref?: RefObject<HTMLDivElement>}) => ReactElement;\nexport {_ListBoxBase as ListBoxBase};\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"loading\": \"جارٍ التحميل...\",\n \"loadingMore\": \"جارٍ تحميل المزيد...\"\n}\n","{\n \"loading\": \"Зареждане...\",\n \"loadingMore\": \"Зареждане на още...\"\n}\n","{\n \"loading\": \"Načítání...\",\n \"loadingMore\": \"Načítání dalších...\"\n}\n","{\n \"loading\": \"Indlæser ...\",\n \"loadingMore\": \"Indlæser flere ...\"\n}\n","{\n \"loading\": \"Laden...\",\n \"loadingMore\": \"Mehr laden ...\"\n}\n","{\n \"loading\": \"Φόρτωση...\",\n \"loadingMore\": \"Φόρτωση περισσότερων...\"\n}\n","{\n \"loading\": \"Loading…\",\n \"loadingMore\": \"Loading more…\"\n}\n","{\n \"loading\": \"Cargando…\",\n \"loadingMore\": \"Cargando más…\"\n}\n","{\n \"loading\": \"Laadimine...\",\n \"loadingMore\": \"Laadi rohkem...\"\n}\n","{\n \"loading\": \"Ladataan…\",\n \"loadingMore\": \"Ladataan lisää…\"\n}\n","{\n \"loading\": \"Chargement...\",\n \"loadingMore\": \"Chargement supplémentaire...\"\n}\n","{\n \"loading\": \"טוען...\",\n \"loadingMore\": \"טוען עוד...\"\n}\n","{\n \"loading\": \"Učitavam...\",\n \"loadingMore\": \"Učitavam još...\"\n}\n","{\n \"loading\": \"Betöltés folyamatban…\",\n \"loadingMore\": \"Továbbiak betöltése folyamatban…\"\n}\n","{\n \"loading\": \"Caricamento...\",\n \"loadingMore\": \"Caricamento altri...\"\n}\n","{\n \"loading\": \"読み込み中...\",\n \"loadingMore\": \"さらに読み込み中...\"\n}\n","{\n \"loading\": \"로드 중\",\n \"loadingMore\": \"추가 로드 중\"\n}\n","{\n \"loading\": \"Įkeliama...\",\n \"loadingMore\": \"Įkeliama daugiau...\"\n}\n","{\n \"loading\": \"Notiek ielāde...\",\n \"loadingMore\": \"Tiek ielādēts vēl...\"\n}\n","{\n \"loading\": \"Laster inn ...\",\n \"loadingMore\": \"Laster inn flere ...\"\n}\n","{\n \"loading\": \"Laden...\",\n \"loadingMore\": \"Meer laden...\"\n}\n","{\n \"loading\": \"Ładowanie...\",\n \"loadingMore\": \"Wczytywanie większej liczby...\"\n}\n","{\n \"loading\": \"Carregando...\",\n \"loadingMore\": \"Carregando mais...\"\n}\n","{\n \"loading\": \"A carregar...\",\n \"loadingMore\": \"A carregar mais...\"\n}\n","{\n \"loading\": \"Se încarcă...\",\n \"loadingMore\": \"Se încarcă mai multe...\"\n}\n","{\n \"loading\": \"Загрузка...\",\n \"loadingMore\": \"Дополнительная загрузка...\"\n}\n","{\n \"loading\": \"Načítava sa...\",\n \"loadingMore\": \"Načítava sa viac...\"\n}\n","{\n \"loading\": \"Nalaganje...\",\n \"loadingMore\": \"Nalaganje več vsebine...\"\n}\n","{\n \"loading\": \"Učitavam...\",\n \"loadingMore\": \"Učitavam još...\"\n}\n","{\n \"loading\": \"Läser in...\",\n \"loadingMore\": \"Läser in mer...\"\n}\n","{\n \"loading\": \"Yükleniyor...\",\n \"loadingMore\": \"Daha fazla yükleniyor...\"\n}\n","{\n \"loading\": \"Завантаження…\",\n \"loadingMore\": \"Завантаження інших об’єктів...\"\n}\n","{\n \"loading\": \"正在加载...\",\n \"loadingMore\": \"正在加载更多...\"\n}\n","{\n \"loading\": \"正在載入\",\n \"loadingMore\": \"正在載入更多…\"\n}\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 {ListState} from '@react-stately/list';\nimport React from 'react';\n\nexport const ListBoxContext = React.createContext<ListState<unknown>>(null);\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 CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, ClearSlots, SlotProvider} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {Grid} from '@react-spectrum/layout';\nimport {isFocusVisible, useHover} from '@react-aria/interactions';\nimport {ListBoxContext} from './ListBoxContext';\nimport {Node} from '@react-types/shared';\nimport React, {useContext} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useOption} from '@react-aria/listbox';\nimport {useRef} from 'react';\n\ninterface OptionProps<T> {\n item: Node<T>,\n shouldSelectOnPressUp?: boolean,\n shouldFocusOnHover?: boolean,\n shouldUseVirtualFocus?: boolean\n}\n\n/** @private */\nexport function ListBoxOption<T>(props: OptionProps<T>) {\n let {\n item,\n shouldSelectOnPressUp,\n shouldFocusOnHover,\n shouldUseVirtualFocus\n } = props;\n\n let {\n rendered,\n key\n } = item;\n let domProps = filterDOMProps(item.props);\n delete domProps.id;\n let state = useContext(ListBoxContext);\n\n let ref = useRef<HTMLDivElement>();\n let {optionProps, labelProps, descriptionProps, isSelected, isDisabled, isFocused} = useOption(\n {\n 'aria-label': item['aria-label'],\n key,\n shouldSelectOnPressUp,\n shouldFocusOnHover,\n isVirtualized: true,\n shouldUseVirtualFocus\n },\n state,\n ref\n );\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled\n });\n\n let contents = typeof rendered === 'string'\n ? <Text>{rendered}</Text>\n : rendered;\n\n let isKeyboardModality = isFocusVisible();\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n <div\n {...mergeProps(optionProps, shouldFocusOnHover ? {} : hoverProps, domProps)}\n ref={ref}\n className={classNames(\n styles,\n 'spectrum-Menu-item',\n {\n // If using virtual focus, apply focused styles to the item when the user is interacting with keyboard modality\n 'is-focused': shouldUseVirtualFocus && isFocused && isKeyboardModality,\n 'is-disabled': isDisabled,\n 'is-selected': isSelected,\n 'is-selectable': state.selectionManager.selectionMode !== 'none',\n // When shouldFocusOnHover is false, apply hover styles both when hovered with the mouse.\n // Otherwise, apply hover styles when focused using non-keyboard modality.\n 'is-hovered': (isHovered && !shouldFocusOnHover) || (isFocused && !isKeyboardModality)\n }\n )}>\n <Grid\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Menu-itemGrid'\n )\n }>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {UNSAFE_className: styles['spectrum-Menu-itemLabel'], ...labelProps},\n icon: {size: 'S', UNSAFE_className: styles['spectrum-Menu-icon']},\n description: {UNSAFE_className: styles['spectrum-Menu-description'], ...descriptionProps}\n }}>\n {contents}\n {isSelected &&\n <CheckmarkMedium\n slot=\"checkmark\"\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Menu-checkmark'\n )\n } />\n }\n </SlotProvider>\n </ClearSlots>\n </Grid>\n </div>\n </FocusRing>\n );\n}\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\n@import './index.css';\n@import './skin.css';\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 {classNames} from '@react-spectrum/utils';\nimport {layoutInfoToStyle, useVirtualizerItem} from '@react-aria/virtualizer';\nimport {ListBoxContext} from './ListBoxContext';\nimport {Node} from '@react-types/shared';\nimport React, {Fragment, ReactNode, useContext, useRef} from 'react';\nimport {ReusableView} from '@react-stately/virtualizer';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {useListBoxSection} from '@react-aria/listbox';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSeparator} from '@react-aria/separator';\n\ninterface ListBoxSectionProps<T> {\n reusableView: ReusableView<Node<T>, unknown>,\n header: ReusableView<Node<T>, unknown>,\n children?: ReactNode\n}\n\n/** @private */\nexport function ListBoxSection<T>(props: ListBoxSectionProps<T>) {\n let {children, reusableView, header} = props;\n let item = reusableView.content;\n let {headingProps, groupProps} = useListBoxSection({\n heading: item.rendered,\n 'aria-label': item['aria-label']\n });\n\n let {separatorProps} = useSeparator({\n elementType: 'li'\n });\n\n let headerRef = useRef();\n useVirtualizerItem({\n reusableView: header,\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(header.layoutInfo, direction)}>\n {item.key !== state.collection.getFirstKey() &&\n <div\n {...separatorProps}\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(reusableView.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":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;;;;AEZA,4BAAiB;IAAG,WAAW,CAAC,eAAe,CAAC;IAC9C,eAAe,CAAC,oBAAoB,CAAC;AACvC;;ADFA;;AEAA,4BAAiB;IAAG,WAAW,CAAC,YAAY,CAAC;IAC3C,eAAe,CAAC,mBAAmB,CAAC;AACtC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,WAAW,CAAC;IAC1C,eAAe,CAAC,mBAAmB,CAAC;AACtC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,YAAY,CAAC;IAC3C,eAAe,CAAC,kBAAkB,CAAC;AACrC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;IACvC,eAAe,CAAC,cAAc,CAAC;AACjC;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,UAAU,CAAC;IACzC,eAAe,CAAC,uBAAuB,CAAC;AAC1C;;;;ACFA,4BAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;IACvC,eAAe,CAAC,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MAAM,0DAAe,CAAA,GAAA,YAAK,AAAD,EAAE,UAAU,CAAC;;CDjLrC,GAED;;;;AAOA,SAAS,8BAA0B,KAA8B,EAAE,GAA2B,EAAE;IAC9F,IAAI,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACzB,IAAI,SAAS,CAAA,GAAA,yCAAgB,AAAD,EAAE,OAAO,MAAM,SAAS;IACpD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,yCAAW,AAAD;QACR,GAAG,KAAK;QACT,KAAK;QACL,OAAO;QACP,QAAQ;;AAEd;AAEA,wFAAwF;AACxF,2GAA2G;AAG3G;;CAEC,GACD,MAAM,0DAAW,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;;AD1BlC","sources":["packages/@react-spectrum/listbox/src/index.ts","packages/@react-spectrum/listbox/src/ListBox.tsx","packages/@react-spectrum/listbox/src/ListBoxBase.tsx","packages/@react-spectrum/listbox/intl/*.js","packages/@react-spectrum/listbox/intl/ar-AE.json","packages/@react-spectrum/listbox/intl/bg-BG.json","packages/@react-spectrum/listbox/intl/cs-CZ.json","packages/@react-spectrum/listbox/intl/da-DK.json","packages/@react-spectrum/listbox/intl/de-DE.json","packages/@react-spectrum/listbox/intl/el-GR.json","packages/@react-spectrum/listbox/intl/en-US.json","packages/@react-spectrum/listbox/intl/es-ES.json","packages/@react-spectrum/listbox/intl/et-EE.json","packages/@react-spectrum/listbox/intl/fi-FI.json","packages/@react-spectrum/listbox/intl/fr-FR.json","packages/@react-spectrum/listbox/intl/he-IL.json","packages/@react-spectrum/listbox/intl/hr-HR.json","packages/@react-spectrum/listbox/intl/hu-HU.json","packages/@react-spectrum/listbox/intl/it-IT.json","packages/@react-spectrum/listbox/intl/ja-JP.json","packages/@react-spectrum/listbox/intl/ko-KR.json","packages/@react-spectrum/listbox/intl/lt-LT.json","packages/@react-spectrum/listbox/intl/lv-LV.json","packages/@react-spectrum/listbox/intl/nb-NO.json","packages/@react-spectrum/listbox/intl/nl-NL.json","packages/@react-spectrum/listbox/intl/pl-PL.json","packages/@react-spectrum/listbox/intl/pt-BR.json","packages/@react-spectrum/listbox/intl/pt-PT.json","packages/@react-spectrum/listbox/intl/ro-RO.json","packages/@react-spectrum/listbox/intl/ru-RU.json","packages/@react-spectrum/listbox/intl/sk-SK.json","packages/@react-spectrum/listbox/intl/sl-SI.json","packages/@react-spectrum/listbox/intl/sr-SP.json","packages/@react-spectrum/listbox/intl/sv-SE.json","packages/@react-spectrum/listbox/intl/tr-TR.json","packages/@react-spectrum/listbox/intl/uk-UA.json","packages/@react-spectrum/listbox/intl/zh-CN.json","packages/@react-spectrum/listbox/intl/zh-TW.json","packages/@react-spectrum/listbox/src/ListBoxContext.ts","packages/@react-spectrum/listbox/src/ListBoxOption.tsx","packages/@adobe/spectrum-css-temp/components/menu/vars.css","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\n/// <reference types=\"css-module-types\" />\n\nexport {ListBox} from './ListBox';\nexport {useListBoxLayout, ListBoxBase} from './ListBoxBase';\nexport {Item, Section} from '@react-stately/collections';\nexport type {SpectrumListBoxProps} from '@react-types/listbox';\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 {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\nfunction ListBox<T extends object>(props: SpectrumListBoxProps<T>, ref: DOMRef<HTMLDivElement>) {\n let state = useListState(props);\n let layout = useListBoxLayout(state, props.isLoading);\n let domRef = useDOMRef(ref);\n\n return (\n <ListBoxBase\n {...props}\n ref={domRef}\n state={state}\n layout={layout} />\n );\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\n\n/**\n * A list of options that can allow selection of one or more.\n */\nconst _ListBox = React.forwardRef(ListBox) as <T>(props: SpectrumListBoxProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_ListBox as ListBox};\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 {AriaLabelingProps, DOMProps, FocusStrategy, Node, 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 {ListBoxOption} from './ListBoxOption';\nimport {ListBoxSection} from './ListBoxSection';\nimport {ListLayout} from '@react-stately/layout';\nimport {ListState} from '@react-stately/list';\nimport {mergeProps, useLayoutEffect} from '@react-aria/utils';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {HTMLAttributes, ReactElement, ReactNode, RefObject, useMemo} from 'react';\nimport {ReusableView} from '@react-stately/virtualizer';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {useCollator, 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: ListLayout<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 transitionDuration?: number,\n isLoading?: boolean,\n onLoadMore?: () => void,\n renderEmptyState?: () => ReactNode,\n onScroll?: () => void\n}\n\n/** @private */\nexport function useListBoxLayout<T>(state: ListState<T>, isLoading: boolean): ListLayout<T> {\n let {scale} = useProvider();\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let layout = useMemo(() =>\n new ListLayout<T>({\n estimatedRowHeight: scale === 'large' ? 48 : 32,\n estimatedHeadingHeight: scale === 'large' ? 33 : 26,\n padding: scale === 'large' ? 5 : 4, // TODO: get from DNA\n loaderHeight: 40,\n placeholderHeight: scale === 'large' ? 48 : 32,\n collator\n })\n , [collator, scale]);\n\n layout.collection = state.collection;\n layout.disabledKeys = state.disabledKeys;\n\n useLayoutEffect(() => {\n // Sync loading state into the layout.\n if (layout.isLoading !== isLoading) {\n layout.isLoading = isLoading;\n layout.virtualizer?.relayoutNow();\n }\n }, [layout, isLoading]);\n return layout;\n}\n\n/** @private */\nfunction ListBoxBase<T>(props: ListBoxBaseProps<T>, ref: RefObject<HTMLDivElement>) {\n let {layout, state, shouldSelectOnPressUp, focusOnPointerEnter, shouldUseVirtualFocus, domProps = {}, transitionDuration = 0, onScroll} = props;\n let {listBoxProps} = useListBox({\n ...props,\n keyboardDelegate: layout,\n isVirtualized: true\n }, state, ref);\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n\n // This overrides collection view's renderWrapper to support heirarchy 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 = (parent: View, 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}>\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 return (\n <ListBoxContext.Provider value={state}>\n <FocusScope>\n <Virtualizer\n {...styleProps}\n {...mergeProps(listBoxProps, domProps)}\n ref={ref}\n focusedKey={state.selectionManager.focusedKey}\n autoFocus={!!props.autoFocus}\n sizeToFit=\"height\"\n scrollDirection=\"vertical\"\n className={\n classNames(\n styles,\n 'spectrum-Menu',\n styleProps.className\n )\n }\n layout={layout}\n collection={state.collection}\n renderWrapper={renderWrapper}\n transitionDuration={transitionDuration}\n isLoading={props.isLoading}\n onLoadMore={props.onLoadMore}\n shouldUseVirtualFocus={shouldUseVirtualFocus}\n onScroll={onScroll}>\n {(type, item: Node<T>) => {\n if (type === 'item') {\n return (\n <ListBoxOption\n item={item}\n shouldSelectOnPressUp={shouldSelectOnPressUp}\n shouldFocusOnHover={focusOnPointerEnter}\n shouldUseVirtualFocus={shouldUseVirtualFocus} />\n );\n } else if (type === 'loader') {\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 } else if (type === 'placeholder') {\n let emptyState = props.renderEmptyState ? props.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 }}\n </Virtualizer>\n </FocusScope>\n </ListBoxContext.Provider>\n );\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\nconst _ListBoxBase = React.forwardRef(ListBoxBase) as <T>(props: ListBoxBaseProps<T> & {ref?: RefObject<HTMLDivElement>}) => ReactElement;\nexport {_ListBoxBase as ListBoxBase};\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"loading\": \"جارٍ التحميل...\",\n \"loadingMore\": \"جارٍ تحميل المزيد...\"\n}\n","{\n \"loading\": \"Зареждане...\",\n \"loadingMore\": \"Зареждане на още...\"\n}\n","{\n \"loading\": \"Načítání...\",\n \"loadingMore\": \"Načítání dalších...\"\n}\n","{\n \"loading\": \"Indlæser ...\",\n \"loadingMore\": \"Indlæser flere ...\"\n}\n","{\n \"loading\": \"Laden...\",\n \"loadingMore\": \"Mehr laden ...\"\n}\n","{\n \"loading\": \"Φόρτωση...\",\n \"loadingMore\": \"Φόρτωση περισσότερων...\"\n}\n","{\n \"loading\": \"Loading…\",\n \"loadingMore\": \"Loading more…\"\n}\n","{\n \"loading\": \"Cargando…\",\n \"loadingMore\": \"Cargando más…\"\n}\n","{\n \"loading\": \"Laadimine...\",\n \"loadingMore\": \"Laadi rohkem...\"\n}\n","{\n \"loading\": \"Ladataan…\",\n \"loadingMore\": \"Ladataan lisää…\"\n}\n","{\n \"loading\": \"Chargement...\",\n \"loadingMore\": \"Chargement supplémentaire...\"\n}\n","{\n \"loading\": \"טוען...\",\n \"loadingMore\": \"טוען עוד...\"\n}\n","{\n \"loading\": \"Učitavam...\",\n \"loadingMore\": \"Učitavam još...\"\n}\n","{\n \"loading\": \"Betöltés folyamatban…\",\n \"loadingMore\": \"Továbbiak betöltése folyamatban…\"\n}\n","{\n \"loading\": \"Caricamento...\",\n \"loadingMore\": \"Caricamento altri...\"\n}\n","{\n \"loading\": \"読み込み中...\",\n \"loadingMore\": \"さらに読み込み中...\"\n}\n","{\n \"loading\": \"로드 중\",\n \"loadingMore\": \"추가 로드 중\"\n}\n","{\n \"loading\": \"Įkeliama...\",\n \"loadingMore\": \"Įkeliama daugiau...\"\n}\n","{\n \"loading\": \"Notiek ielāde...\",\n \"loadingMore\": \"Tiek ielādēts vēl...\"\n}\n","{\n \"loading\": \"Laster inn ...\",\n \"loadingMore\": \"Laster inn flere ...\"\n}\n","{\n \"loading\": \"Laden...\",\n \"loadingMore\": \"Meer laden...\"\n}\n","{\n \"loading\": \"Ładowanie...\",\n \"loadingMore\": \"Wczytywanie większej liczby...\"\n}\n","{\n \"loading\": \"Carregando...\",\n \"loadingMore\": \"Carregando mais...\"\n}\n","{\n \"loading\": \"A carregar...\",\n \"loadingMore\": \"A carregar mais...\"\n}\n","{\n \"loading\": \"Se încarcă...\",\n \"loadingMore\": \"Se încarcă mai multe...\"\n}\n","{\n \"loading\": \"Загрузка...\",\n \"loadingMore\": \"Дополнительная загрузка...\"\n}\n","{\n \"loading\": \"Načítava sa...\",\n \"loadingMore\": \"Načítava sa viac...\"\n}\n","{\n \"loading\": \"Nalaganje...\",\n \"loadingMore\": \"Nalaganje več vsebine...\"\n}\n","{\n \"loading\": \"Učitavam...\",\n \"loadingMore\": \"Učitavam još...\"\n}\n","{\n \"loading\": \"Läser in...\",\n \"loadingMore\": \"Läser in mer...\"\n}\n","{\n \"loading\": \"Yükleniyor...\",\n \"loadingMore\": \"Daha fazla yükleniyor...\"\n}\n","{\n \"loading\": \"Завантаження…\",\n \"loadingMore\": \"Завантаження інших об’єктів...\"\n}\n","{\n \"loading\": \"正在加载...\",\n \"loadingMore\": \"正在加载更多...\"\n}\n","{\n \"loading\": \"正在載入\",\n \"loadingMore\": \"正在載入更多…\"\n}\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 {ListState} from '@react-stately/list';\nimport React from 'react';\n\nexport const ListBoxContext = React.createContext<ListState<unknown>>(null);\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 CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, ClearSlots, SlotProvider} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {Grid} from '@react-spectrum/layout';\nimport {isFocusVisible, useHover} from '@react-aria/interactions';\nimport {ListBoxContext} from './ListBoxContext';\nimport {Node} from '@react-types/shared';\nimport React, {useContext} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/menu/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useOption} from '@react-aria/listbox';\nimport {useRef} from 'react';\n\ninterface OptionProps<T> {\n item: Node<T>,\n shouldSelectOnPressUp?: boolean,\n shouldFocusOnHover?: boolean,\n shouldUseVirtualFocus?: boolean\n}\n\n/** @private */\nexport function ListBoxOption<T>(props: OptionProps<T>) {\n let {\n item,\n shouldSelectOnPressUp,\n shouldFocusOnHover,\n shouldUseVirtualFocus\n } = props;\n\n let {\n rendered,\n key\n } = item;\n let domProps = filterDOMProps(item.props);\n delete domProps.id;\n let state = useContext(ListBoxContext);\n\n let ref = useRef<HTMLDivElement>();\n let {optionProps, labelProps, descriptionProps, isSelected, isDisabled, isFocused} = useOption(\n {\n 'aria-label': item['aria-label'],\n key,\n shouldSelectOnPressUp,\n shouldFocusOnHover,\n isVirtualized: true,\n shouldUseVirtualFocus\n },\n state,\n ref\n );\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled\n });\n\n let contents = typeof rendered === 'string'\n ? <Text>{rendered}</Text>\n : rendered;\n\n let isKeyboardModality = isFocusVisible();\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n <div\n {...mergeProps(optionProps, shouldFocusOnHover ? {} : hoverProps, domProps)}\n ref={ref}\n className={classNames(\n styles,\n 'spectrum-Menu-item',\n {\n // If using virtual focus, apply focused styles to the item when the user is interacting with keyboard modality\n 'is-focused': shouldUseVirtualFocus && isFocused && isKeyboardModality,\n 'is-disabled': isDisabled,\n 'is-selected': isSelected,\n 'is-selectable': state.selectionManager.selectionMode !== 'none',\n // When shouldFocusOnHover is false, apply hover styles both when hovered with the mouse.\n // Otherwise, apply hover styles when focused using non-keyboard modality.\n 'is-hovered': (isHovered && !shouldFocusOnHover) || (isFocused && !isKeyboardModality)\n }\n )}>\n <Grid\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Menu-itemGrid'\n )\n }>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {UNSAFE_className: styles['spectrum-Menu-itemLabel'], ...labelProps},\n icon: {size: 'S', UNSAFE_className: styles['spectrum-Menu-icon']},\n description: {UNSAFE_className: styles['spectrum-Menu-description'], ...descriptionProps}\n }}>\n {contents}\n {isSelected &&\n <CheckmarkMedium\n slot=\"checkmark\"\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Menu-checkmark'\n )\n } />\n }\n </SlotProvider>\n </ClearSlots>\n </Grid>\n </div>\n </FocusRing>\n );\n}\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\n@import './index.css';\n@import './skin.css';\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 {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';\nimport {useSeparator} from '@react-aria/separator';\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 {separatorProps} = useSeparator({\n elementType: 'li'\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 {...separatorProps}\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":"module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ interface ListBoxBaseProps<T> extends AriaListBoxOptions<T>, DOMProps, AriaLabel
|
|
|
21
21
|
onScroll?: () => void;
|
|
22
22
|
}
|
|
23
23
|
/** @private */
|
|
24
|
-
export function useListBoxLayout<T>(state: ListState<T
|
|
24
|
+
export function useListBoxLayout<T>(state: ListState<T>, isLoading: boolean): ListLayout<T>;
|
|
25
25
|
export const ListBoxBase: <T>(props: ListBoxBaseProps<T> & {
|
|
26
26
|
ref?: RefObject<HTMLDivElement>;
|
|
27
27
|
}) => ReactElement;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AGgCA,2BAA2B,CAAC,CAAE,SAAQ,mBAAmB,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU;IAClG,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IACtB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IACpC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,eAAe,WAAW,CAAC,CAAC;IACvC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,SAAS,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,eAAe;AACf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ectrum/listbox/src/packages/@react-spectrum/listbox/src/ListBoxOption.tsx","packages/@react-spectrum/listbox/src/packages/@react-spectrum/listbox/src/ListBoxSection.tsx","packages/@react-spectrum/listbox/src/packages/@react-spectrum/listbox/src/ListBoxBase.tsx","packages/@react-spectrum/listbox/src/packages/@react-spectrum/listbox/src/ListBox.tsx","packages/@react-spectrum/listbox/src/packages/@react-spectrum/listbox/src/index.ts","packages/@react-spectrum/listbox/src/index.ts"],"sourcesContent":[null,null,null,null,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\n/// <reference types=\"css-module-types\" />\n\nexport {ListBox} from './ListBox';\nexport {useListBoxLayout, ListBoxBase} from './ListBoxBase';\nexport {Item, Section} from '@react-stately/collections';\nexport type {SpectrumListBoxProps} from '@react-types/listbox';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/listbox",
|
|
3
|
-
"version": "3.10.2-nightly.
|
|
3
|
+
"version": "3.10.2-nightly.3960+16f72e9fb",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,28 +36,28 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/focus": "3.0.0-nightly.
|
|
40
|
-
"@react-aria/i18n": "3.0.0-nightly.
|
|
41
|
-
"@react-aria/interactions": "3.0.0-nightly.
|
|
42
|
-
"@react-aria/listbox": "3.9.2-nightly.
|
|
43
|
-
"@react-aria/separator": "3.0.0-nightly.
|
|
44
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
45
|
-
"@react-aria/virtualizer": "3.8.2-nightly.
|
|
46
|
-
"@react-spectrum/layout": "3.5.3-nightly.
|
|
47
|
-
"@react-spectrum/progress": "3.0.0-nightly.
|
|
48
|
-
"@react-spectrum/text": "3.4.3-nightly.
|
|
49
|
-
"@react-spectrum/utils": "3.0.0-nightly.
|
|
50
|
-
"@react-stately/collections": "3.0.0-nightly.
|
|
51
|
-
"@react-stately/layout": "3.12.2-nightly.
|
|
52
|
-
"@react-stately/list": "3.8.2-nightly.
|
|
53
|
-
"@react-stately/virtualizer": "3.5.3-nightly.
|
|
54
|
-
"@react-types/listbox": "3.4.3-nightly.
|
|
55
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
56
|
-
"@spectrum-icons/ui": "3.0.0-nightly.
|
|
39
|
+
"@react-aria/focus": "3.0.0-nightly.2258+16f72e9fb",
|
|
40
|
+
"@react-aria/i18n": "3.0.0-nightly.2258+16f72e9fb",
|
|
41
|
+
"@react-aria/interactions": "3.0.0-nightly.2258+16f72e9fb",
|
|
42
|
+
"@react-aria/listbox": "3.9.2-nightly.3960+16f72e9fb",
|
|
43
|
+
"@react-aria/separator": "3.0.0-nightly.2258+16f72e9fb",
|
|
44
|
+
"@react-aria/utils": "3.0.0-nightly.2258+16f72e9fb",
|
|
45
|
+
"@react-aria/virtualizer": "3.8.2-nightly.3960+16f72e9fb",
|
|
46
|
+
"@react-spectrum/layout": "3.5.3-nightly.3960+16f72e9fb",
|
|
47
|
+
"@react-spectrum/progress": "3.0.0-nightly.2258+16f72e9fb",
|
|
48
|
+
"@react-spectrum/text": "3.4.3-nightly.3960+16f72e9fb",
|
|
49
|
+
"@react-spectrum/utils": "3.0.0-nightly.2258+16f72e9fb",
|
|
50
|
+
"@react-stately/collections": "3.0.0-nightly.2258+16f72e9fb",
|
|
51
|
+
"@react-stately/layout": "3.12.2-nightly.3960+16f72e9fb",
|
|
52
|
+
"@react-stately/list": "3.8.2-nightly.3960+16f72e9fb",
|
|
53
|
+
"@react-stately/virtualizer": "3.5.3-nightly.3960+16f72e9fb",
|
|
54
|
+
"@react-types/listbox": "3.4.3-nightly.3960+16f72e9fb",
|
|
55
|
+
"@react-types/shared": "3.0.0-nightly.2258+16f72e9fb",
|
|
56
|
+
"@spectrum-icons/ui": "3.0.0-nightly.2258+16f72e9fb",
|
|
57
57
|
"@swc/helpers": "^0.4.14"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@adobe/spectrum-css-temp": "3.0.0-nightly.
|
|
60
|
+
"@adobe/spectrum-css-temp": "3.0.0-nightly.2258+16f72e9fb"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@react-spectrum/provider": "^3.2.0",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "16f72e9fbfc28adf104c3cb7557f1d3cab617960"
|
|
71
71
|
}
|
package/src/ListBox.tsx
CHANGED
|
@@ -19,7 +19,7 @@ import {useListState} from '@react-stately/list';
|
|
|
19
19
|
|
|
20
20
|
function ListBox<T extends object>(props: SpectrumListBoxProps<T>, ref: DOMRef<HTMLDivElement>) {
|
|
21
21
|
let state = useListState(props);
|
|
22
|
-
let layout = useListBoxLayout(state);
|
|
22
|
+
let layout = useListBoxLayout(state, props.isLoading);
|
|
23
23
|
let domRef = useDOMRef(ref);
|
|
24
24
|
|
|
25
25
|
return (
|
package/src/ListBoxBase.tsx
CHANGED
|
@@ -21,7 +21,7 @@ import {ListBoxOption} from './ListBoxOption';
|
|
|
21
21
|
import {ListBoxSection} from './ListBoxSection';
|
|
22
22
|
import {ListLayout} from '@react-stately/layout';
|
|
23
23
|
import {ListState} from '@react-stately/list';
|
|
24
|
-
import {mergeProps} from '@react-aria/utils';
|
|
24
|
+
import {mergeProps, useLayoutEffect} from '@react-aria/utils';
|
|
25
25
|
import {ProgressCircle} from '@react-spectrum/progress';
|
|
26
26
|
import React, {HTMLAttributes, ReactElement, ReactNode, RefObject, useMemo} from 'react';
|
|
27
27
|
import {ReusableView} from '@react-stately/virtualizer';
|
|
@@ -48,7 +48,7 @@ interface ListBoxBaseProps<T> extends AriaListBoxOptions<T>, DOMProps, AriaLabel
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/** @private */
|
|
51
|
-
export function useListBoxLayout<T>(state: ListState<T
|
|
51
|
+
export function useListBoxLayout<T>(state: ListState<T>, isLoading: boolean): ListLayout<T> {
|
|
52
52
|
let {scale} = useProvider();
|
|
53
53
|
let collator = useCollator({usage: 'search', sensitivity: 'base'});
|
|
54
54
|
let layout = useMemo(() =>
|
|
@@ -64,6 +64,14 @@ export function useListBoxLayout<T>(state: ListState<T>): ListLayout<T> {
|
|
|
64
64
|
|
|
65
65
|
layout.collection = state.collection;
|
|
66
66
|
layout.disabledKeys = state.disabledKeys;
|
|
67
|
+
|
|
68
|
+
useLayoutEffect(() => {
|
|
69
|
+
// Sync loading state into the layout.
|
|
70
|
+
if (layout.isLoading !== isLoading) {
|
|
71
|
+
layout.isLoading = isLoading;
|
|
72
|
+
layout.virtualizer?.relayoutNow();
|
|
73
|
+
}
|
|
74
|
+
}, [layout, isLoading]);
|
|
67
75
|
return layout;
|
|
68
76
|
}
|
|
69
77
|
|
|
@@ -78,19 +86,18 @@ function ListBoxBase<T>(props: ListBoxBaseProps<T>, ref: RefObject<HTMLDivElemen
|
|
|
78
86
|
let {styleProps} = useStyleProps(props);
|
|
79
87
|
let stringFormatter = useLocalizedStringFormatter(intlMessages);
|
|
80
88
|
|
|
81
|
-
// Sync loading state into the layout.
|
|
82
|
-
layout.isLoading = props.isLoading;
|
|
83
|
-
|
|
84
89
|
// This overrides collection view's renderWrapper to support heirarchy of items in sections.
|
|
85
90
|
// The header is extracted from the children so it can receive ARIA labeling properties.
|
|
86
|
-
type View = ReusableView<Node<T>,
|
|
91
|
+
type View = ReusableView<Node<T>, ReactNode>;
|
|
87
92
|
let renderWrapper = (parent: View, reusableView: View, children: View[], renderChildren: (views: View[]) => ReactElement[]) => {
|
|
88
93
|
if (reusableView.viewType === 'section') {
|
|
89
94
|
return (
|
|
90
95
|
<ListBoxSection
|
|
91
96
|
key={reusableView.key}
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
item={reusableView.content}
|
|
98
|
+
layoutInfo={reusableView.layoutInfo}
|
|
99
|
+
virtualizer={reusableView.virtualizer}
|
|
100
|
+
headerLayoutInfo={children.find(c => c.viewType === 'header').layoutInfo}>
|
|
94
101
|
{renderChildren(children.filter(c => c.viewType === 'item'))}
|
|
95
102
|
</ListBoxSection>
|
|
96
103
|
);
|
|
@@ -99,8 +106,11 @@ function ListBoxBase<T>(props: ListBoxBaseProps<T>, ref: RefObject<HTMLDivElemen
|
|
|
99
106
|
return (
|
|
100
107
|
<VirtualizerItem
|
|
101
108
|
key={reusableView.key}
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
layoutInfo={reusableView.layoutInfo}
|
|
110
|
+
virtualizer={reusableView.virtualizer}
|
|
111
|
+
parent={parent?.layoutInfo}>
|
|
112
|
+
{reusableView.rendered}
|
|
113
|
+
</VirtualizerItem>
|
|
104
114
|
);
|
|
105
115
|
};
|
|
106
116
|
|
|
@@ -112,6 +122,7 @@ function ListBoxBase<T>(props: ListBoxBaseProps<T>, ref: RefObject<HTMLDivElemen
|
|
|
112
122
|
{...mergeProps(listBoxProps, domProps)}
|
|
113
123
|
ref={ref}
|
|
114
124
|
focusedKey={state.selectionManager.focusedKey}
|
|
125
|
+
autoFocus={!!props.autoFocus}
|
|
115
126
|
sizeToFit="height"
|
|
116
127
|
scrollDirection="vertical"
|
|
117
128
|
className={
|
package/src/ListBoxSection.tsx
CHANGED
|
@@ -11,26 +11,25 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import {classNames} from '@react-spectrum/utils';
|
|
14
|
-
import {
|
|
14
|
+
import {LayoutInfo} from '@react-stately/virtualizer';
|
|
15
|
+
import {layoutInfoToStyle, useVirtualizerItem, VirtualizerItemOptions} from '@react-aria/virtualizer';
|
|
15
16
|
import {ListBoxContext} from './ListBoxContext';
|
|
16
17
|
import {Node} from '@react-types/shared';
|
|
17
18
|
import React, {Fragment, ReactNode, useContext, useRef} from 'react';
|
|
18
|
-
import {ReusableView} from '@react-stately/virtualizer';
|
|
19
19
|
import styles from '@adobe/spectrum-css-temp/components/menu/vars.css';
|
|
20
20
|
import {useListBoxSection} from '@react-aria/listbox';
|
|
21
21
|
import {useLocale} from '@react-aria/i18n';
|
|
22
22
|
import {useSeparator} from '@react-aria/separator';
|
|
23
23
|
|
|
24
|
-
interface ListBoxSectionProps<T> {
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
interface ListBoxSectionProps<T> extends Omit<VirtualizerItemOptions, 'ref'> {
|
|
25
|
+
headerLayoutInfo: LayoutInfo,
|
|
26
|
+
item: Node<T>,
|
|
27
27
|
children?: ReactNode
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/** @private */
|
|
31
31
|
export function ListBoxSection<T>(props: ListBoxSectionProps<T>) {
|
|
32
|
-
let {children,
|
|
33
|
-
let item = reusableView.content;
|
|
32
|
+
let {children, layoutInfo, headerLayoutInfo, virtualizer, item} = props;
|
|
34
33
|
let {headingProps, groupProps} = useListBoxSection({
|
|
35
34
|
heading: item.rendered,
|
|
36
35
|
'aria-label': item['aria-label']
|
|
@@ -42,7 +41,8 @@ export function ListBoxSection<T>(props: ListBoxSectionProps<T>) {
|
|
|
42
41
|
|
|
43
42
|
let headerRef = useRef();
|
|
44
43
|
useVirtualizerItem({
|
|
45
|
-
|
|
44
|
+
layoutInfo: headerLayoutInfo,
|
|
45
|
+
virtualizer,
|
|
46
46
|
ref: headerRef
|
|
47
47
|
});
|
|
48
48
|
|
|
@@ -51,7 +51,7 @@ export function ListBoxSection<T>(props: ListBoxSectionProps<T>) {
|
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
53
|
<Fragment>
|
|
54
|
-
<div role="presentation" ref={headerRef} style={layoutInfoToStyle(
|
|
54
|
+
<div role="presentation" ref={headerRef} style={layoutInfoToStyle(headerLayoutInfo, direction)}>
|
|
55
55
|
{item.key !== state.collection.getFirstKey() &&
|
|
56
56
|
<div
|
|
57
57
|
{...separatorProps}
|
|
@@ -75,7 +75,7 @@ export function ListBoxSection<T>(props: ListBoxSectionProps<T>) {
|
|
|
75
75
|
</div>
|
|
76
76
|
<div
|
|
77
77
|
{...groupProps}
|
|
78
|
-
style={layoutInfoToStyle(
|
|
78
|
+
style={layoutInfoToStyle(layoutInfo, direction)}
|
|
79
79
|
className={
|
|
80
80
|
classNames(
|
|
81
81
|
styles,
|