@helsenorge/designsystem-react 15.4.0 → 15.5.1
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/lib/AnchorLink.js +4 -4
- package/lib/AnchorLink.js.map +1 -1
- package/lib/AsChildSlot.js.map +1 -1
- package/lib/Avatar.js +2 -2
- package/lib/Avatar.js.map +1 -1
- package/lib/Badge.js +2 -2
- package/lib/Badge.js.map +1 -1
- package/lib/Button.js +6 -6
- package/lib/Button.js.map +1 -1
- package/lib/CHANGELOG.md +25 -0
- package/lib/Checkbox.js +12 -10
- package/lib/Checkbox.js.map +1 -1
- package/lib/Checkbox2.js +2 -2
- package/lib/Checkbox2.js.map +1 -1
- package/lib/CheckboxMarker.js +2 -2
- package/lib/CheckboxMarker.js.map +1 -1
- package/lib/Chip.js +4 -4
- package/lib/Chip.js.map +1 -1
- package/lib/Close.js +3 -3
- package/lib/Close.js.map +1 -1
- package/lib/DictionaryTrigger.js +2 -2
- package/lib/DictionaryTrigger.js.map +1 -1
- package/lib/Drawer.js +13 -13
- package/lib/Drawer.js.map +1 -1
- package/lib/DrawerNavigation.js +1 -1
- package/lib/DrawerNavigation.js.map +1 -1
- package/lib/Duolist.js +5 -5
- package/lib/Duolist.js.map +1 -1
- package/lib/ElementHeader.js +9 -9
- package/lib/ElementHeader.js.map +1 -1
- package/lib/ElementHeaderText.js +4 -4
- package/lib/ElementHeaderText.js.map +1 -1
- package/lib/ErrorWrapper.js +3 -2
- package/lib/ErrorWrapper.js.map +1 -1
- package/lib/Expander.js +9 -8
- package/lib/Expander.js.map +1 -1
- package/lib/FilterButton.js +2 -2
- package/lib/FilterButton.js.map +1 -1
- package/lib/FilterButtonAndChipsWrapper.js +2 -2
- package/lib/FilterButtonAndChipsWrapper.js.map +1 -1
- package/lib/FilterDrawer.js.map +1 -1
- package/lib/FilterLinkList.js +5 -4
- package/lib/FilterLinkList.js.map +1 -1
- package/lib/FilterOverviewSearch.js +2 -2
- package/lib/FilterOverviewSearch.js.map +1 -1
- package/lib/FilterResultCountAndSortWrapper.js.map +1 -1
- package/lib/FilterSearch.js +31 -18
- package/lib/FilterSearch.js.map +1 -1
- package/lib/FormFieldTag.js +2 -2
- package/lib/FormFieldTag.js.map +1 -1
- package/lib/FormGroup.js +5 -5
- package/lib/FormGroup.js.map +1 -1
- package/lib/FormLayout.js +3 -3
- package/lib/FormLayout.js.map +1 -1
- package/lib/HelpDetails.js +5 -4
- package/lib/HelpDetails.js.map +1 -1
- package/lib/HelpTriggerIcon.js +2 -2
- package/lib/HelpTriggerIcon.js.map +1 -1
- package/lib/HelpTriggerStandalone.js +2 -2
- package/lib/HelpTriggerStandalone.js.map +1 -1
- package/lib/HighlightPanel.js +4 -4
- package/lib/HighlightPanel.js.map +1 -1
- package/lib/Highlighter.js +1 -1
- package/lib/Highlighter.js.map +1 -1
- package/lib/HorizontalScroll.js +4 -4
- package/lib/HorizontalScroll.js.map +1 -1
- package/lib/Icon.js +2 -2
- package/lib/Icon.js.map +1 -1
- package/lib/Illustration.js.map +1 -1
- package/lib/InfoTeaser.js +3 -3
- package/lib/InfoTeaser.js.map +1 -1
- package/lib/Input.js +12 -6
- package/lib/Input.js.map +1 -1
- package/lib/LazyIcon.js +1 -0
- package/lib/LazyIcon.js.map +1 -1
- package/lib/LazyIllustration.js.map +1 -1
- package/lib/LinkList.js +36 -33
- package/lib/LinkList.js.map +1 -1
- package/lib/List.js +5 -3
- package/lib/List.js.map +1 -1
- package/lib/ListEditMode.js +8 -7
- package/lib/ListEditMode.js.map +1 -1
- package/lib/LoaderSpinner.js.map +1 -1
- package/lib/MaxCharacters.js +2 -2
- package/lib/MaxCharacters.js.map +1 -1
- package/lib/PanelTitle.js +2 -2
- package/lib/PanelTitle.js.map +1 -1
- package/lib/PopOver.js +7 -4
- package/lib/PopOver.js.map +1 -1
- package/lib/Radio.js +2 -2
- package/lib/Radio.js.map +1 -1
- package/lib/RadioButton.js +5 -5
- package/lib/RadioButton.js.map +1 -1
- package/lib/RadioMarker.js +12 -11
- package/lib/RadioMarker.js.map +1 -1
- package/lib/Select.js +4 -4
- package/lib/Select.js.map +1 -1
- package/lib/SingleSelectItem.js +3 -3
- package/lib/SingleSelectItem.js.map +1 -1
- package/lib/Slider.js +10 -8
- package/lib/Slider.js.map +1 -1
- package/lib/Spacer.js +17 -16
- package/lib/Spacer.js.map +1 -1
- package/lib/StatusDot.js +4 -4
- package/lib/StatusDot.js.map +1 -1
- package/lib/StatusDotList.js +2 -2
- package/lib/StatusDotList.js.map +1 -1
- package/lib/StepButtons.js +5 -5
- package/lib/StepButtons.js.map +1 -1
- package/lib/TabList.js +8 -8
- package/lib/TabList.js.map +1 -1
- package/lib/TabPanel.js +3 -2
- package/lib/TabPanel.js.map +1 -1
- package/lib/TableBody.js +4 -3
- package/lib/TableBody.js.map +1 -1
- package/lib/TableCell.js +4 -3
- package/lib/TableCell.js.map +1 -1
- package/lib/TableExpandedRow.js +8 -5
- package/lib/TableExpandedRow.js.map +1 -1
- package/lib/TableExpanderCell.js +4 -3
- package/lib/TableExpanderCell.js.map +1 -1
- package/lib/TableHead.js +9 -8
- package/lib/TableHead.js.map +1 -1
- package/lib/TableHeadCell.js +6 -6
- package/lib/TableHeadCell.js.map +1 -1
- package/lib/TableRow.js +9 -7
- package/lib/TableRow.js.map +1 -1
- package/lib/Textarea.js +6 -6
- package/lib/Textarea.js.map +1 -1
- package/lib/Title.js +21 -18
- package/lib/Title.js.map +1 -1
- package/lib/Toast.js +3 -3
- package/lib/Toast.js.map +1 -1
- package/lib/VisualCheckbox.js +3 -3
- package/lib/VisualCheckbox.js.map +1 -1
- package/lib/VisualRadio.js +3 -3
- package/lib/VisualRadio.js.map +1 -1
- package/lib/__mocks__/matchMedia.js.map +1 -1
- package/lib/__mocks__/usePseudoClasses.js.map +1 -1
- package/lib/__mocks__/useSize.js.map +1 -1
- package/lib/__mocks__/uuid.js +1 -1
- package/lib/__mocks__/uuid.js.map +1 -1
- package/lib/components/ArticleTeaser/index.js +4 -4
- package/lib/components/ArticleTeaser/index.js.map +1 -1
- package/lib/components/Dropdown/index.js +5 -5
- package/lib/components/Dropdown/index.js.map +1 -1
- package/lib/components/DropdownOld/index.js +3 -3
- package/lib/components/DropdownOld/index.js.map +1 -1
- package/lib/components/EmptyState/index.js +3 -5
- package/lib/components/EmptyState/index.js.map +1 -1
- package/lib/components/ExpanderHierarchy/index.js +8 -7
- package/lib/components/ExpanderHierarchy/index.js.map +1 -1
- package/lib/components/ExpanderList/index.js +12 -11
- package/lib/components/ExpanderList/index.js.map +1 -1
- package/lib/components/EyebrowHeader/index.js.map +1 -1
- package/lib/components/FavoriteButton/index.js +11 -9
- package/lib/components/FavoriteButton/index.js.map +1 -1
- package/lib/components/Filter/FilterSearch/FilterSearch.d.ts +2 -0
- package/lib/components/Filter/FilterSearch/styles.module.scss +32 -7
- package/lib/components/Filter/FilterSearch/styles.module.scss.d.ts +2 -0
- package/lib/components/Filter/index.js.map +1 -1
- package/lib/components/HelpBubble/index.js +3 -3
- package/lib/components/HelpBubble/index.js.map +1 -1
- package/lib/components/HelpExpanderInline/index.js.map +1 -1
- package/lib/components/HelpExpanderStandalone/index.js.map +1 -1
- package/lib/components/HelpPanel/index.js +2 -2
- package/lib/components/HelpPanel/index.js.map +1 -1
- package/lib/components/HelpTooltip/index.js +6 -3
- package/lib/components/HelpTooltip/index.js.map +1 -1
- package/lib/components/HelpTriggerInline/index.js +2 -2
- package/lib/components/HelpTriggerInline/index.js.map +1 -1
- package/lib/components/Icons/AlarmClock.js.map +1 -1
- package/lib/components/Icons/ArrowUpRight.js +4 -4
- package/lib/components/Icons/ArrowUpRight.js.map +1 -1
- package/lib/components/Icons/ArrowUpRightLight.d.ts +3 -0
- package/lib/components/Icons/ArrowUpRightLight.js +17 -0
- package/lib/components/Icons/ArrowUpRightLight.js.map +1 -0
- package/lib/components/Icons/Bus.js.map +1 -1
- package/lib/components/Icons/IconNames.d.ts +1 -1
- package/lib/components/Icons/IconNames.js +1 -0
- package/lib/components/Icons/IconNames.js.map +1 -1
- package/lib/components/Illustrations/BabyMobile.js +5 -4
- package/lib/components/Illustrations/BabyMobile.js.map +1 -1
- package/lib/components/Illustrations/BabyMobileMedium.js.map +1 -1
- package/lib/components/Illustrations/Child.js +5 -4
- package/lib/components/Illustrations/Child.js.map +1 -1
- package/lib/components/Illustrations/ChildMedium.js.map +1 -1
- package/lib/components/Illustrations/Doctor.js +10 -8
- package/lib/components/Illustrations/Doctor.js.map +1 -1
- package/lib/components/Illustrations/DoctorMedium.js.map +1 -1
- package/lib/components/Illustrations/DoctorSmall.js.map +1 -1
- package/lib/components/Illustrations/EyeContact.js +5 -4
- package/lib/components/Illustrations/EyeContact.js.map +1 -1
- package/lib/components/Illustrations/EyeContactMedium.js.map +1 -1
- package/lib/components/Illustrations/FacialRecognitionFingerprint.js +5 -4
- package/lib/components/Illustrations/FacialRecognitionFingerprint.js.map +1 -1
- package/lib/components/Illustrations/FacialRecognitionFingerprintMedium.js.map +1 -1
- package/lib/components/Illustrations/GiveBabyFood.js +5 -4
- package/lib/components/Illustrations/GiveBabyFood.js.map +1 -1
- package/lib/components/Illustrations/GiveBabyFoodMedium.js.map +1 -1
- package/lib/components/Illustrations/HealthcarePersonnel.js +10 -8
- package/lib/components/Illustrations/HealthcarePersonnel.js.map +1 -1
- package/lib/components/Illustrations/HealthcarePersonnelMedium.js.map +1 -1
- package/lib/components/Illustrations/HealthcarePersonnelSmall.js.map +1 -1
- package/lib/components/Illustrations/ReadLetters.js +5 -4
- package/lib/components/Illustrations/ReadLetters.js.map +1 -1
- package/lib/components/Illustrations/ReadLettersMedium.js.map +1 -1
- package/lib/components/Illustrations/SkinToSkin.js +5 -4
- package/lib/components/Illustrations/SkinToSkin.js.map +1 -1
- package/lib/components/Illustrations/SkinToSkinMedium.js.map +1 -1
- package/lib/components/Illustrations/Stork.js +5 -4
- package/lib/components/Illustrations/Stork.js.map +1 -1
- package/lib/components/Illustrations/StorkMedium.js.map +1 -1
- package/lib/components/Illustrations/Stroller.js +5 -4
- package/lib/components/Illustrations/Stroller.js.map +1 -1
- package/lib/components/Illustrations/StrollerMedium.js.map +1 -1
- package/lib/components/Illustrations/Support2.js +5 -4
- package/lib/components/Illustrations/Support2.js.map +1 -1
- package/lib/components/Illustrations/Support2Medium.js.map +1 -1
- package/lib/components/Illustrations/Thinking.js +5 -4
- package/lib/components/Illustrations/Thinking.js.map +1 -1
- package/lib/components/Illustrations/ThinkingMedium.js.map +1 -1
- package/lib/components/Loader/index.js +19 -18
- package/lib/components/Loader/index.js.map +1 -1
- package/lib/components/Logo/index.js.map +1 -1
- package/lib/components/Modal/index.js +10 -10
- package/lib/components/Modal/index.js.map +1 -1
- package/lib/components/NotificationPanel/index.js +12 -9
- package/lib/components/NotificationPanel/index.js.map +1 -1
- package/lib/components/Panel/index.js +25 -24
- package/lib/components/Panel/index.js.map +1 -1
- package/lib/components/PanelList/index.js +3 -3
- package/lib/components/PanelList/index.js.map +1 -1
- package/lib/components/PopMenu/index.js +3 -3
- package/lib/components/PopMenu/index.js.map +1 -1
- package/lib/components/Portal/index.js.map +1 -1
- package/lib/components/Progressbar/index.js +7 -6
- package/lib/components/Progressbar/index.js.map +1 -1
- package/lib/components/PromoPanel/PromoPanel.d.ts +2 -2
- package/lib/components/PromoPanel/index.js +13 -9
- package/lib/components/PromoPanel/index.js.map +1 -1
- package/lib/components/RadioButton/RadioMarker/styles.module.scss +3 -9
- package/lib/components/ServiceMessage/index.js +6 -5
- package/lib/components/ServiceMessage/index.js.map +1 -1
- package/lib/components/SharingStatus/index.js +4 -4
- package/lib/components/SharingStatus/index.js.map +1 -1
- package/lib/components/Step/index.js +2 -2
- package/lib/components/Step/index.js.map +1 -1
- package/lib/components/Stepper/index.js +5 -3
- package/lib/components/Stepper/index.js.map +1 -1
- package/lib/components/StickyNote/index.js +8 -8
- package/lib/components/StickyNote/index.js.map +1 -1
- package/lib/components/Table/index.js +5 -8
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Tabs/index.js +4 -4
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/Tag/index.js +3 -2
- package/lib/components/Tag/index.js.map +1 -1
- package/lib/components/TagList/index.js.map +1 -1
- package/lib/components/Tile/index.js +8 -7
- package/lib/components/Tile/index.js.map +1 -1
- package/lib/components/ToastList/index.js +3 -2
- package/lib/components/ToastList/index.js.map +1 -1
- package/lib/components/Toggle/index.js +13 -10
- package/lib/components/Toggle/index.js.map +1 -1
- package/lib/components/Validation/index.js +2 -2
- package/lib/components/Validation/index.js.map +1 -1
- package/lib/components/VisualCheckboxCloud/index.js +2 -2
- package/lib/components/VisualCheckboxCloud/index.js.map +1 -1
- package/lib/components/VisualCheckboxGroup/index.js +3 -3
- package/lib/components/VisualCheckboxGroup/index.js.map +1 -1
- package/lib/components/VisualContentgroupWithImage/index.js +2 -2
- package/lib/components/VisualContentgroupWithImage/index.js.map +1 -1
- package/lib/components/VisualRadioCloud/index.js +2 -2
- package/lib/components/VisualRadioCloud/index.js.map +1 -1
- package/lib/components/VisualRadioGroup/index.js +3 -3
- package/lib/components/VisualRadioGroup/index.js.map +1 -1
- package/lib/floating-ui.react.js +100 -117
- package/lib/floating-ui.react.js.map +1 -1
- package/lib/getFilterChips.js.map +1 -1
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useFocusableElements.js.map +1 -1
- package/lib/hooks/useIsVisible.js.map +1 -1
- package/lib/hooks/useOutsideEvent.js.map +1 -1
- package/lib/hooks/useResizeObserver.js.map +1 -1
- package/lib/hooks/useRovingFocus.js.map +1 -1
- package/lib/hooks/useSize.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/theme/spacers.js +2 -2
- package/lib/theme/spacers.js.map +1 -1
- package/lib/utils/focus.js.map +1 -1
- package/lib/utils/mobile.js.map +1 -1
- package/lib/utils/uuid.js +29 -2
- package/lib/utils/uuid.js.map +1 -0
- package/lib/utils2.js +7 -7
- package/lib/utils2.js.map +1 -1
- package/lib/utils5.js +2 -2
- package/lib/utils5.js.map +1 -1
- package/package.json +1 -1
- package/lib/uuid.js +0 -29
- package/lib/uuid.js.map +0 -1
package/lib/floating-ui.react.js
CHANGED
|
@@ -95,7 +95,7 @@ function getParentNode(node) {
|
|
|
95
95
|
}
|
|
96
96
|
function getNearestOverflowAncestor(node) {
|
|
97
97
|
const parentNode = getParentNode(node);
|
|
98
|
-
if (isLastTraversableNode(parentNode)) return node.ownerDocument
|
|
98
|
+
if (isLastTraversableNode(parentNode)) return (node.ownerDocument || node).body;
|
|
99
99
|
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) return parentNode;
|
|
100
100
|
return getNearestOverflowAncestor(parentNode);
|
|
101
101
|
}
|
|
@@ -214,12 +214,12 @@ function getOppositePlacement(placement) {
|
|
|
214
214
|
return oppositeSideMap[side] + placement.slice(side.length);
|
|
215
215
|
}
|
|
216
216
|
function expandPaddingObject(padding) {
|
|
217
|
+
var _padding$top, _padding$right, _padding$bottom, _padding$left;
|
|
217
218
|
return {
|
|
218
|
-
top: 0,
|
|
219
|
-
right: 0,
|
|
220
|
-
bottom: 0,
|
|
221
|
-
left: 0
|
|
222
|
-
...padding
|
|
219
|
+
top: (_padding$top = padding.top) != null ? _padding$top : 0,
|
|
220
|
+
right: (_padding$right = padding.right) != null ? _padding$right : 0,
|
|
221
|
+
bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
|
|
222
|
+
left: (_padding$left = padding.left) != null ? _padding$left : 0
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
225
|
function getPaddingObject(padding) {
|
|
@@ -244,7 +244,7 @@ function rectToClientRect(rect) {
|
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
246
|
/*!
|
|
247
|
-
* tabbable 6.
|
|
247
|
+
* tabbable 6.5.0
|
|
248
248
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
249
249
|
*/
|
|
250
250
|
var candidateSelector = /* #__PURE__ */ [
|
|
@@ -252,6 +252,7 @@ var candidateSelector = /* #__PURE__ */ [
|
|
|
252
252
|
"select:not([inert]):not([inert] *)",
|
|
253
253
|
"textarea:not([inert]):not([inert] *)",
|
|
254
254
|
"a[href]:not([inert]):not([inert] *)",
|
|
255
|
+
"area[href]:not([inert]):not([inert] *)",
|
|
255
256
|
"button:not([inert]):not([inert] *)",
|
|
256
257
|
"[tabindex]:not(slot):not([inert]):not([inert] *)",
|
|
257
258
|
"audio[controls]:not([inert]):not([inert] *)",
|
|
@@ -472,7 +473,8 @@ var isHidden = function isHidden(node, _ref) {
|
|
|
472
473
|
checkVisibilityCSS: true
|
|
473
474
|
});
|
|
474
475
|
}
|
|
475
|
-
|
|
476
|
+
var visibility = getComputedStyle(node).visibility;
|
|
477
|
+
if (visibility === "hidden" || visibility === "collapse") return true;
|
|
476
478
|
var nodeUnderDetails = matches.call(node, "details>summary:first-of-type") ? node.parentElement : node;
|
|
477
479
|
if (matches.call(nodeUnderDetails, "details:not([open]) *")) return true;
|
|
478
480
|
if (!displayCheck || displayCheck === "full" || displayCheck === "full-native" || displayCheck === "legacy-full") {
|
|
@@ -790,14 +792,8 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
790
792
|
y: reference.y
|
|
791
793
|
};
|
|
792
794
|
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
796
|
-
break;
|
|
797
|
-
case "end":
|
|
798
|
-
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
799
|
-
break;
|
|
800
|
-
}
|
|
795
|
+
const alignment = getAlignment(placement);
|
|
796
|
+
if (alignment) coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
|
|
801
797
|
return coords;
|
|
802
798
|
}
|
|
803
799
|
/**
|
|
@@ -828,10 +824,7 @@ async function detectOverflow(state, options) {
|
|
|
828
824
|
height: rects.floating.height
|
|
829
825
|
} : rects.reference;
|
|
830
826
|
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
831
|
-
const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))
|
|
832
|
-
x: 1,
|
|
833
|
-
y: 1
|
|
834
|
-
} : {
|
|
827
|
+
const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) && await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
|
|
835
828
|
x: 1,
|
|
836
829
|
y: 1
|
|
837
830
|
};
|
|
@@ -951,12 +944,11 @@ var arrow$3 = (options) => ({
|
|
|
951
944
|
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
952
945
|
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
953
946
|
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
954
|
-
const min$1 = minPadding;
|
|
955
947
|
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
956
948
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
957
|
-
const offset = clamp(
|
|
958
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center <
|
|
959
|
-
const alignmentOffset = shouldAddOffset ? center <
|
|
949
|
+
const offset = clamp(minPadding, center, max);
|
|
950
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
951
|
+
const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;
|
|
960
952
|
return {
|
|
961
953
|
[axis]: coords[axis] + alignmentOffset,
|
|
962
954
|
data: {
|
|
@@ -1031,9 +1023,7 @@ var flip$2 = function(options) {
|
|
|
1031
1023
|
if (placement) resetPlacement = placement;
|
|
1032
1024
|
break;
|
|
1033
1025
|
}
|
|
1034
|
-
case "initialPlacement":
|
|
1035
|
-
resetPlacement = initialPlacement;
|
|
1036
|
-
break;
|
|
1026
|
+
case "initialPlacement": resetPlacement = initialPlacement;
|
|
1037
1027
|
}
|
|
1038
1028
|
if (placement !== resetPlacement) return { reset: { placement: resetPlacement } };
|
|
1039
1029
|
}
|
|
@@ -1171,24 +1161,13 @@ var shift$2 = function(options) {
|
|
|
1171
1161
|
y
|
|
1172
1162
|
};
|
|
1173
1163
|
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
1174
|
-
const crossAxis = getSideAxis(
|
|
1164
|
+
const crossAxis = getSideAxis(placement);
|
|
1175
1165
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
1176
1166
|
let mainAxisCoord = coords[mainAxis];
|
|
1177
1167
|
let crossAxisCoord = coords[crossAxis];
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
const min = mainAxisCoord + overflow[minSide];
|
|
1182
|
-
const max = mainAxisCoord - overflow[maxSide];
|
|
1183
|
-
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
1184
|
-
}
|
|
1185
|
-
if (checkCrossAxis) {
|
|
1186
|
-
const minSide = crossAxis === "y" ? "top" : "left";
|
|
1187
|
-
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
|
1188
|
-
const min = crossAxisCoord + overflow[minSide];
|
|
1189
|
-
const max = crossAxisCoord - overflow[maxSide];
|
|
1190
|
-
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
1191
|
-
}
|
|
1168
|
+
const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
|
|
1169
|
+
if (checkMainAxis) mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
|
|
1170
|
+
if (checkCrossAxis) crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
|
|
1192
1171
|
const limitedCoords = limiter.fn({
|
|
1193
1172
|
...state,
|
|
1194
1173
|
[mainAxis]: mainAxisCoord,
|
|
@@ -1220,7 +1199,6 @@ var size$2 = function(options) {
|
|
|
1220
1199
|
name: "size",
|
|
1221
1200
|
options,
|
|
1222
1201
|
async fn(state) {
|
|
1223
|
-
var _state$middlewareData, _state$middlewareData2;
|
|
1224
1202
|
const { placement, rects, platform, elements } = state;
|
|
1225
1203
|
const { apply = () => {}, ...detectOverflowOptions } = evaluate(options, state);
|
|
1226
1204
|
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
@@ -1241,18 +1219,15 @@ var size$2 = function(options) {
|
|
|
1241
1219
|
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
1242
1220
|
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
1243
1221
|
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
1244
|
-
const
|
|
1222
|
+
const shiftData = state.middlewareData.shift;
|
|
1223
|
+
const noShift = !shiftData;
|
|
1245
1224
|
let availableHeight = overflowAvailableHeight;
|
|
1246
1225
|
let availableWidth = overflowAvailableWidth;
|
|
1247
|
-
if (
|
|
1248
|
-
if (
|
|
1226
|
+
if (shiftData != null && shiftData.enabled.x) availableWidth = maximumClippingWidth;
|
|
1227
|
+
if (shiftData != null && shiftData.enabled.y) availableHeight = maximumClippingHeight;
|
|
1249
1228
|
if (noShift && !alignment) {
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
const yMin = max(overflow.top, 0);
|
|
1253
|
-
const yMax = max(overflow.bottom, 0);
|
|
1254
|
-
if (isYAxis) availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
1255
|
-
else availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
1229
|
+
if (isYAxis) availableWidth = width - 2 * max(overflow.left, overflow.right);
|
|
1230
|
+
else availableHeight = height - 2 * max(overflow.top, overflow.bottom);
|
|
1256
1231
|
}
|
|
1257
1232
|
await apply({
|
|
1258
1233
|
...state,
|
|
@@ -1313,8 +1288,7 @@ function getVisualOffsets(element) {
|
|
|
1313
1288
|
}
|
|
1314
1289
|
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
1315
1290
|
if (isFixed === void 0) isFixed = false;
|
|
1316
|
-
|
|
1317
|
-
return isFixed;
|
|
1291
|
+
return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
|
|
1318
1292
|
}
|
|
1319
1293
|
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
1320
1294
|
if (includeScale === void 0) includeScale = false;
|
|
@@ -1322,20 +1296,22 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1322
1296
|
const clientRect = element.getBoundingClientRect();
|
|
1323
1297
|
const domElement = unwrapElement(element);
|
|
1324
1298
|
let scale = createCoords(1);
|
|
1325
|
-
if (includeScale)
|
|
1326
|
-
if (
|
|
1327
|
-
|
|
1299
|
+
if (includeScale) {
|
|
1300
|
+
if (offsetParent) {
|
|
1301
|
+
if (isElement(offsetParent)) scale = getScale(offsetParent);
|
|
1302
|
+
} else scale = getScale(element);
|
|
1303
|
+
}
|
|
1328
1304
|
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
1329
1305
|
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
1330
1306
|
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1331
1307
|
let width = clientRect.width / scale.x;
|
|
1332
1308
|
let height = clientRect.height / scale.y;
|
|
1333
|
-
if (domElement) {
|
|
1309
|
+
if (domElement && offsetParent) {
|
|
1334
1310
|
const win = getWindow(domElement);
|
|
1335
|
-
const offsetWin =
|
|
1311
|
+
const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1336
1312
|
let currentWin = win;
|
|
1337
1313
|
let currentIFrame = getFrameElement(currentWin);
|
|
1338
|
-
while (currentIFrame &&
|
|
1314
|
+
while (currentIFrame && offsetWin !== currentWin) {
|
|
1339
1315
|
const iframeScale = getScale(currentIFrame);
|
|
1340
1316
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1341
1317
|
const css = getComputedStyle$1(currentIFrame);
|
|
@@ -1383,7 +1359,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1383
1359
|
let scale = createCoords(1);
|
|
1384
1360
|
const offsets = createCoords(0);
|
|
1385
1361
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1386
|
-
if (isOffsetParentAnElement || !
|
|
1362
|
+
if (isOffsetParentAnElement || !isFixed) {
|
|
1387
1363
|
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
|
|
1388
1364
|
if (isOffsetParentAnElement) {
|
|
1389
1365
|
const offsetRect = getBoundingClientRect(offsetParent);
|
|
@@ -1401,15 +1377,14 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1401
1377
|
};
|
|
1402
1378
|
}
|
|
1403
1379
|
function getClientRects(element) {
|
|
1404
|
-
return Array.from(element.getClientRects());
|
|
1380
|
+
return element.getClientRects ? Array.from(element.getClientRects()) : [];
|
|
1405
1381
|
}
|
|
1406
|
-
function getDocumentRect(
|
|
1407
|
-
const
|
|
1408
|
-
const
|
|
1409
|
-
const body = element.ownerDocument.body;
|
|
1382
|
+
function getDocumentRect(html) {
|
|
1383
|
+
const scroll = getNodeScroll(html);
|
|
1384
|
+
const body = html.ownerDocument.body;
|
|
1410
1385
|
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1411
1386
|
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1412
|
-
let x = -scroll.scrollLeft + getWindowScrollBarX(
|
|
1387
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(html);
|
|
1413
1388
|
const y = -scroll.scrollTop;
|
|
1414
1389
|
if (getComputedStyle$1(body).direction === "rtl") x += max(html.clientWidth, body.clientWidth) - width;
|
|
1415
1390
|
return {
|
|
@@ -1420,7 +1395,9 @@ function getDocumentRect(element) {
|
|
|
1420
1395
|
};
|
|
1421
1396
|
}
|
|
1422
1397
|
var SCROLLBAR_MAX = 25;
|
|
1423
|
-
function getViewportRect(element, strategy) {
|
|
1398
|
+
function getViewportRect(element, strategy, rootBoundary) {
|
|
1399
|
+
if (rootBoundary === void 0) rootBoundary = "viewport";
|
|
1400
|
+
const isLayoutViewport = rootBoundary === "layoutViewport";
|
|
1424
1401
|
const win = getWindow(element);
|
|
1425
1402
|
const html = getDocumentElement(element);
|
|
1426
1403
|
const visualViewport = win.visualViewport;
|
|
@@ -1429,23 +1406,30 @@ function getViewportRect(element, strategy) {
|
|
|
1429
1406
|
let x = 0;
|
|
1430
1407
|
let y = 0;
|
|
1431
1408
|
if (visualViewport) {
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1409
|
+
const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed";
|
|
1410
|
+
if (isLayoutViewport) {
|
|
1411
|
+
if (!layoutRelativeClientCoords) {
|
|
1412
|
+
x = -visualViewport.offsetLeft;
|
|
1413
|
+
y = -visualViewport.offsetTop;
|
|
1414
|
+
}
|
|
1415
|
+
} else {
|
|
1416
|
+
width = visualViewport.width;
|
|
1417
|
+
height = visualViewport.height;
|
|
1418
|
+
if (layoutRelativeClientCoords) {
|
|
1419
|
+
x = visualViewport.offsetLeft;
|
|
1420
|
+
y = visualViewport.offsetTop;
|
|
1421
|
+
}
|
|
1438
1422
|
}
|
|
1439
1423
|
}
|
|
1440
|
-
|
|
1441
|
-
if (windowScrollbarX <= 0) {
|
|
1424
|
+
if (getWindowScrollBarX(html) <= 0) {
|
|
1442
1425
|
const doc = html.ownerDocument;
|
|
1443
1426
|
const body = doc.body;
|
|
1444
1427
|
const bodyStyles = getComputedStyle(body);
|
|
1445
1428
|
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
1446
|
-
const
|
|
1447
|
-
|
|
1448
|
-
|
|
1429
|
+
const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
1430
|
+
const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth;
|
|
1431
|
+
if (gutter <= SCROLLBAR_MAX) width -= gutter;
|
|
1432
|
+
}
|
|
1449
1433
|
return {
|
|
1450
1434
|
width,
|
|
1451
1435
|
height,
|
|
@@ -1457,7 +1441,7 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
1457
1441
|
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
1458
1442
|
const top = clientRect.top + element.clientTop;
|
|
1459
1443
|
const left = clientRect.left + element.clientLeft;
|
|
1460
|
-
const scale =
|
|
1444
|
+
const scale = getScale(element);
|
|
1461
1445
|
return {
|
|
1462
1446
|
width: element.clientWidth * scale.x,
|
|
1463
1447
|
height: element.clientHeight * scale.y,
|
|
@@ -1467,7 +1451,7 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
1467
1451
|
}
|
|
1468
1452
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1469
1453
|
let rect;
|
|
1470
|
-
if (clippingAncestor === "viewport") rect = getViewportRect(element, strategy);
|
|
1454
|
+
if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") rect = getViewportRect(element, strategy, clippingAncestor);
|
|
1471
1455
|
else if (clippingAncestor === "document") rect = getDocumentRect(getDocumentElement(element));
|
|
1472
1456
|
else if (isElement(clippingAncestor)) rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1473
1457
|
else {
|
|
@@ -1481,24 +1465,19 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
1481
1465
|
}
|
|
1482
1466
|
return rectToClientRect(rect);
|
|
1483
1467
|
}
|
|
1484
|
-
function hasFixedPositionAncestor(element, stopNode) {
|
|
1485
|
-
const parentNode = getParentNode(element);
|
|
1486
|
-
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) return false;
|
|
1487
|
-
return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1488
|
-
}
|
|
1489
1468
|
function getClippingElementAncestors(element, cache) {
|
|
1490
1469
|
const cachedResult = cache.get(element);
|
|
1491
1470
|
if (cachedResult) return cachedResult;
|
|
1492
1471
|
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
1493
|
-
let
|
|
1472
|
+
let lastKeptComputedStyle = null;
|
|
1494
1473
|
const elementIsFixed = getComputedStyle$1(element).position === "fixed";
|
|
1495
1474
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1496
1475
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1497
1476
|
const computedStyle = getComputedStyle$1(currentNode);
|
|
1498
1477
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1499
|
-
|
|
1500
|
-
if (
|
|
1501
|
-
else
|
|
1478
|
+
const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : "";
|
|
1479
|
+
if (!currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static")) result = result.filter((ancestor) => ancestor !== currentNode);
|
|
1480
|
+
else lastKeptComputedStyle = computedStyle;
|
|
1502
1481
|
currentNode = getParentNode(currentNode);
|
|
1503
1482
|
}
|
|
1504
1483
|
cache.set(element, result);
|
|
@@ -1543,18 +1522,15 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1543
1522
|
scrollTop: 0
|
|
1544
1523
|
};
|
|
1545
1524
|
const offsets = createCoords(0);
|
|
1546
|
-
|
|
1547
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
1548
|
-
}
|
|
1549
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1525
|
+
if (isOffsetParentAnElement || !isFixed) {
|
|
1550
1526
|
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
|
|
1551
1527
|
if (isOffsetParentAnElement) {
|
|
1552
1528
|
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1553
1529
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1554
1530
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1555
|
-
}
|
|
1531
|
+
}
|
|
1556
1532
|
}
|
|
1557
|
-
if (
|
|
1533
|
+
if (!isOffsetParentAnElement && documentElement) offsets.x = getWindowScrollBarX(documentElement);
|
|
1558
1534
|
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1559
1535
|
return {
|
|
1560
1536
|
x: rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x,
|
|
@@ -1621,7 +1597,7 @@ var platform = {
|
|
|
1621
1597
|
function rectsAreEqual(a, b) {
|
|
1622
1598
|
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
1623
1599
|
}
|
|
1624
|
-
function observeMove(element, onMove) {
|
|
1600
|
+
function observeMove(element, onMove, ancestorResize) {
|
|
1625
1601
|
let io = null;
|
|
1626
1602
|
let timeoutId;
|
|
1627
1603
|
const root = getDocumentElement(element);
|
|
@@ -1650,6 +1626,7 @@ function observeMove(element, onMove) {
|
|
|
1650
1626
|
let isFirstUpdate = true;
|
|
1651
1627
|
function handleObserve(entries) {
|
|
1652
1628
|
const ratio = entries[0].intersectionRatio;
|
|
1629
|
+
if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) return refresh();
|
|
1653
1630
|
if (ratio !== threshold) {
|
|
1654
1631
|
if (!isFirstUpdate) return refresh();
|
|
1655
1632
|
if (!ratio) timeoutId = setTimeout(() => {
|
|
@@ -1657,7 +1634,6 @@ function observeMove(element, onMove) {
|
|
|
1657
1634
|
}, 1e3);
|
|
1658
1635
|
else refresh(false, ratio);
|
|
1659
1636
|
}
|
|
1660
|
-
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) refresh();
|
|
1661
1637
|
isFirstUpdate = false;
|
|
1662
1638
|
}
|
|
1663
1639
|
try {
|
|
@@ -1670,8 +1646,14 @@ function observeMove(element, onMove) {
|
|
|
1670
1646
|
}
|
|
1671
1647
|
io.observe(element);
|
|
1672
1648
|
}
|
|
1649
|
+
const win = getWindow(element);
|
|
1650
|
+
const handleResize = () => refresh(ancestorResize);
|
|
1651
|
+
win.addEventListener("resize", handleResize);
|
|
1673
1652
|
refresh(true);
|
|
1674
|
-
return
|
|
1653
|
+
return () => {
|
|
1654
|
+
win.removeEventListener("resize", handleResize);
|
|
1655
|
+
cleanup();
|
|
1656
|
+
};
|
|
1675
1657
|
}
|
|
1676
1658
|
/**
|
|
1677
1659
|
* Automatically updates the position of the floating element when necessary.
|
|
@@ -1687,10 +1669,10 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1687
1669
|
const referenceEl = unwrapElement(reference);
|
|
1688
1670
|
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
|
|
1689
1671
|
ancestors.forEach((ancestor) => {
|
|
1690
|
-
ancestorScroll && ancestor.addEventListener("scroll", update
|
|
1672
|
+
ancestorScroll && ancestor.addEventListener("scroll", update);
|
|
1691
1673
|
ancestorResize && ancestor.addEventListener("resize", update);
|
|
1692
1674
|
});
|
|
1693
|
-
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
1675
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;
|
|
1694
1676
|
let reobserveFrame = -1;
|
|
1695
1677
|
let resizeObserver = null;
|
|
1696
1678
|
if (elementResize) {
|
|
@@ -1777,11 +1759,9 @@ var arrow$2 = arrow$3;
|
|
|
1777
1759
|
*/
|
|
1778
1760
|
var computePosition = (reference, floating, options) => {
|
|
1779
1761
|
const cache = /* @__PURE__ */ new Map();
|
|
1780
|
-
const mergedOptions = {
|
|
1781
|
-
platform,
|
|
1782
|
-
...options
|
|
1783
|
-
};
|
|
1762
|
+
const mergedOptions = options != null ? options : {};
|
|
1784
1763
|
const platformWithCache = {
|
|
1764
|
+
...platform,
|
|
1785
1765
|
...mergedOptions.platform,
|
|
1786
1766
|
_c: cache
|
|
1787
1767
|
};
|
|
@@ -3028,12 +3008,13 @@ function FloatingFocusManager(props) {
|
|
|
3028
3008
|
if (disabled) return;
|
|
3029
3009
|
if (!floating) return;
|
|
3030
3010
|
const portalNodes = Array.from((portalContext == null || (_portalContext$portal = portalContext.portalNode) == null ? void 0 : _portalContext$portal.querySelectorAll("[" + createAttribute("portal") + "]")) || []);
|
|
3011
|
+
const rootAncestorComboboxDomReference = (_ancestors$find = (tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : []).find((node) => {
|
|
3012
|
+
var _node$context6;
|
|
3013
|
+
return isTypeableCombobox(((_node$context6 = node.context) == null ? void 0 : _node$context6.elements.domReference) || null);
|
|
3014
|
+
})) == null || (_ancestors$find = _ancestors$find.context) == null ? void 0 : _ancestors$find.elements.domReference;
|
|
3031
3015
|
const insideElements = [
|
|
3032
3016
|
floating,
|
|
3033
|
-
|
|
3034
|
-
var _node$context6;
|
|
3035
|
-
return isTypeableCombobox(((_node$context6 = node.context) == null ? void 0 : _node$context6.elements.domReference) || null);
|
|
3036
|
-
})) == null || (_ancestors$find = _ancestors$find.context) == null ? void 0 : _ancestors$find.elements.domReference,
|
|
3017
|
+
rootAncestorComboboxDomReference,
|
|
3037
3018
|
...portalNodes,
|
|
3038
3019
|
...getInsideElements(),
|
|
3039
3020
|
startDismissButtonRef.current,
|
|
@@ -3277,8 +3258,10 @@ function useClick(context, props) {
|
|
|
3277
3258
|
didKeyDownRef.current = true;
|
|
3278
3259
|
}
|
|
3279
3260
|
if (isAnchorTarget(event)) return;
|
|
3280
|
-
if (event.key === "Enter")
|
|
3281
|
-
|
|
3261
|
+
if (event.key === "Enter") {
|
|
3262
|
+
if (open && toggle) onOpenChange(false, event.nativeEvent, "click");
|
|
3263
|
+
else onOpenChange(true, event.nativeEvent, "click");
|
|
3264
|
+
}
|
|
3282
3265
|
},
|
|
3283
3266
|
onKeyUp(event) {
|
|
3284
3267
|
if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event) || isSpaceIgnored(domReference)) return;
|
|
@@ -3461,7 +3444,7 @@ function useDismiss(context, props) {
|
|
|
3461
3444
|
return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);
|
|
3462
3445
|
});
|
|
3463
3446
|
ancestors.forEach((ancestor) => {
|
|
3464
|
-
ancestor.addEventListener("scroll", onScroll
|
|
3447
|
+
ancestor.addEventListener("scroll", onScroll);
|
|
3465
3448
|
});
|
|
3466
3449
|
return () => {
|
|
3467
3450
|
if (escapeKey) {
|
|
@@ -3596,15 +3579,15 @@ function useFloatingRootContext(options) {
|
|
|
3596
3579
|
* Provides data to position a floating element and context to add interactions.
|
|
3597
3580
|
* @see https://floating-ui.com/docs/useFloating
|
|
3598
3581
|
*/
|
|
3599
|
-
function useFloating(
|
|
3600
|
-
|
|
3582
|
+
function useFloating(_temp) {
|
|
3583
|
+
var _elementsOption$refer, _elementsOption$float;
|
|
3584
|
+
let { elements: elementsOption, ...options } = _temp === void 0 ? {} : _temp;
|
|
3601
3585
|
const { nodeId } = options;
|
|
3602
3586
|
const internalRootContext = useFloatingRootContext({
|
|
3603
3587
|
...options,
|
|
3604
3588
|
elements: {
|
|
3605
|
-
reference: null,
|
|
3606
|
-
floating: null
|
|
3607
|
-
...options.elements
|
|
3589
|
+
reference: (_elementsOption$refer = elementsOption == null ? void 0 : elementsOption.reference) != null ? _elementsOption$refer : null,
|
|
3590
|
+
floating: (_elementsOption$float = elementsOption == null ? void 0 : elementsOption.floating) != null ? _elementsOption$float : null
|
|
3608
3591
|
}
|
|
3609
3592
|
});
|
|
3610
3593
|
const rootContext = options.rootContext || internalRootContext;
|