@helsenorge/designsystem-react 15.7.2 → 16.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Button.js +2 -2
- package/lib/Button.js.map +1 -1
- package/lib/CHANGELOG.md +2664 -997
- package/lib/Close.js +1 -1
- package/lib/Close.js.map +1 -1
- package/lib/Drawer.js +3 -4
- package/lib/Drawer.js.map +1 -1
- package/lib/DrawerNavigation.js +1 -0
- package/lib/DrawerNavigation.js.map +1 -1
- package/lib/Duolist.js +5 -1
- package/lib/Duolist.js.map +1 -1
- package/lib/ElementHeader.js.map +1 -1
- package/lib/Expander.js +1 -0
- package/lib/Expander.js.map +1 -1
- package/lib/FilterLinkList.js +1 -1
- package/lib/FilterLinkList.js.map +1 -1
- package/lib/FormGroup.js +3 -3
- package/lib/FormGroup.js.map +1 -1
- package/lib/HelpDetails.js +1 -1
- package/lib/HelpTriggerIcon.js +2 -2
- package/lib/HelpTriggerIcon.js.map +1 -1
- package/lib/HelpTriggerStandalone.js +1 -1
- package/lib/HelpTriggerStandalone.js.map +1 -1
- package/lib/HorizontalScroll.js +6 -10
- package/lib/HorizontalScroll.js.map +1 -1
- package/lib/LazyIcon.js +1 -0
- package/lib/LazyIcon.js.map +1 -1
- package/lib/LazyIllustration.js +2 -0
- package/lib/LazyIllustration.js.map +1 -1
- package/lib/LinkList.js +10 -10
- package/lib/LinkList.js.map +1 -1
- package/lib/ListEditMode.js +1 -1
- package/lib/ListEditMode.js.map +1 -1
- package/lib/PopOver.js +2 -2
- package/lib/PopOver.js.map +1 -1
- package/lib/Radio.js +65 -55
- package/lib/Radio.js.map +1 -1
- package/lib/Radio2.js +74 -0
- package/lib/Radio2.js.map +1 -0
- package/lib/RadioMarker.js +2 -2
- package/lib/RadioMarker.js.map +1 -1
- package/lib/StackedCellContent.js +15 -0
- package/lib/StackedCellContent.js.map +1 -0
- package/lib/TabList.js +5 -5
- package/lib/TabList.js.map +1 -1
- package/lib/TabPanel.js +1 -0
- package/lib/TabPanel.js.map +1 -1
- package/lib/TableContext.js +26 -0
- package/lib/TableContext.js.map +1 -0
- package/lib/Toggle.js +2 -2
- package/lib/Toggle.js.map +1 -1
- package/lib/UNSAFE_TableBody.js +22 -0
- package/lib/UNSAFE_TableBody.js.map +1 -0
- package/lib/UNSAFE_TableCell.js +26 -0
- package/lib/UNSAFE_TableCell.js.map +1 -0
- package/lib/UNSAFE_TableDetail.js +17 -0
- package/lib/UNSAFE_TableDetail.js.map +1 -0
- package/lib/UNSAFE_TableExpandedRow.js +46 -0
- package/lib/UNSAFE_TableExpandedRow.js.map +1 -0
- package/lib/UNSAFE_TableHead.js +25 -0
- package/lib/UNSAFE_TableHead.js.map +1 -0
- package/lib/UNSAFE_TableHeadCell.js +182 -0
- package/lib/UNSAFE_TableHeadCell.js.map +1 -0
- package/lib/UNSAFE_TableRow.js +130 -0
- package/lib/UNSAFE_TableRow.js.map +1 -0
- package/lib/VisualRadio.js +1 -1
- package/lib/VisualRadio.js.map +1 -1
- package/lib/__mocks__/ResizeObserver.js +4 -1
- package/lib/__mocks__/ResizeObserver.js.map +1 -1
- package/lib/components/AnchorLink/styles.module.scss +3 -4
- package/lib/components/ArticleTeaser/styles.module.scss +12 -12
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/Button/styles.module.scss +111 -60
- package/lib/components/Button/styles.module.scss.d.ts +1 -1
- package/lib/components/Checkbox/CheckboxMarker/styles.module.scss +6 -6
- package/lib/components/Chip/styles.module.scss +2 -3
- package/lib/components/Close/styles.module.scss +2 -3
- package/lib/components/DictionaryTrigger/index.js +26 -1
- package/lib/{DictionaryTrigger.js.map → components/DictionaryTrigger/index.js.map} +1 -1
- package/lib/components/DictionaryTrigger/styles.module.scss +6 -8
- package/lib/components/Drawer/Drawer.d.ts +0 -4
- package/lib/components/Drawer/DrawerBackButton.module.scss +1 -2
- package/lib/components/Drawer/styles.module.scss +6 -3
- package/lib/components/Dropdown/SingleSelect/styles.module.scss +0 -2
- package/lib/components/Dropdown/index.js +9 -17
- package/lib/components/Dropdown/index.js.map +1 -1
- package/lib/components/Dropdown/styles.module.scss +12 -14
- package/lib/components/Duolist/Duolist.d.ts +14 -2
- package/lib/components/Duolist/styles.module.scss +28 -8
- package/lib/components/Duolist/styles.module.scss.d.ts +3 -0
- package/lib/components/ElementHeader/ElementHeader.d.ts +1 -1
- package/lib/components/ElementHeader/styles.module.scss +1 -1
- package/lib/components/EmptyState/styles.module.scss +1 -2
- package/lib/components/ErrorWrapper/styles.module.scss +3 -3
- package/lib/components/Expander/styles.module.scss +0 -2
- package/lib/components/Expander/styles.module.scss.d.ts +1 -1
- package/lib/components/ExpanderHierarchy/index.js +1 -0
- package/lib/components/ExpanderHierarchy/index.js.map +1 -1
- package/lib/components/ExpanderList/index.js +21 -19
- package/lib/components/ExpanderList/index.js.map +1 -1
- package/lib/components/ExpanderList/styles.module.scss +11 -11
- package/lib/components/FavoriteButton/index.js +3 -3
- package/lib/components/FavoriteButton/index.js.map +1 -1
- package/lib/components/FavoriteButton/styles.module.scss +0 -1
- package/lib/components/Filter/FilterButton/styles.module.scss +5 -6
- package/lib/components/Filter/FilterButtonAndChipsWrapper/styles.module.scss +0 -1
- package/lib/components/Filter/FilterDrawer/styles.module.scss +0 -1
- package/lib/components/Filter/FilterLinkList/FilterLinkList.module.scss +5 -6
- package/lib/components/Filter/FilterOverviewSearch/styles.module.scss +1 -4
- package/lib/components/Filter/FilterSearch/styles.module.scss +14 -15
- package/lib/components/Filter/FilterSort/styles.module.scss +1 -2
- package/lib/components/Filter/FilterStateWrapper/styles.module.scss +0 -2
- package/lib/components/Filter/LoaderSpinner/styles.module.scss +2 -4
- package/lib/components/FormFieldTag/styles.module.scss +0 -1
- package/lib/components/FormGroup/styles.module.scss +0 -1
- package/lib/components/HelpBubble/styles.module.scss +0 -1
- package/lib/components/HelpDetails/styles.module.scss +2 -4
- package/lib/components/HelpDrawer/styles.module.scss +1 -2
- package/lib/components/HelpPanel/HelpPanel.d.ts +2 -2
- package/lib/components/HelpPanel/index.js +1 -17
- package/lib/components/HelpPanel/index.js.map +1 -1
- package/lib/components/HelpPanel/styles.module.scss +2 -22
- package/lib/components/HelpPanel/styles.module.scss.d.ts +0 -4
- package/lib/components/HelpTeaser/styles.module.scss +7 -9
- package/lib/components/HelpTriggerIcon/HelpTriggerIcon.d.ts +2 -2
- package/lib/components/HelpTriggerIcon/styles.module.scss +20 -22
- package/lib/components/HelpTriggerIcon/styles.module.scss.d.ts +1 -1
- package/lib/components/HelpTriggerInline/styles.module.scss +3 -5
- package/lib/components/HelpTriggerStandalone/styles.module.scss +3 -5
- package/lib/components/HighlightPanel/styles.module.scss +2 -3
- package/lib/components/HorizontalScroll/HorizontalScroll.d.ts +0 -4
- package/lib/components/HorizontalScroll/styles.module.scss +1 -4
- package/lib/components/HorizontalScroll/styles.module.scss.d.ts +0 -1
- package/lib/components/Icons/AdditionalIconInformation.d.ts +4 -0
- package/lib/components/Icons/AdditionalIconInformation.js +14 -10
- package/lib/components/Icons/AdditionalIconInformation.js.map +1 -1
- package/lib/components/Icons/HistoryDocument.js +6 -7
- package/lib/components/Icons/HistoryDocument.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/Icons/YesNo.d.ts +3 -0
- package/lib/components/Icons/YesNo.js +53 -0
- package/lib/components/Icons/YesNo.js.map +1 -0
- package/lib/components/Illustrations/IllustrationNames.d.ts +1 -1
- package/lib/components/Illustrations/IllustrationNames.js +2 -0
- package/lib/components/Illustrations/IllustrationNames.js.map +1 -1
- package/lib/components/Illustrations/MoveAway.d.ts +11 -0
- package/lib/components/Illustrations/MoveAway.js +18 -0
- package/lib/components/Illustrations/MoveAway.js.map +1 -0
- package/lib/components/Illustrations/MoveAwayMedium.d.ts +3 -0
- package/lib/components/Illustrations/MoveAwayMedium.js +114 -0
- package/lib/components/Illustrations/MoveAwayMedium.js.map +1 -0
- package/lib/components/InfoTeaser/styles.module.scss +6 -8
- package/lib/components/Label/styles.module.scss +1 -1
- package/lib/components/LinkList/LinkList.d.ts +1 -1
- package/lib/components/LinkList/styles.module.scss +9 -11
- package/lib/components/LinkList/styles.module.scss.d.ts +1 -1
- package/lib/components/ListEditMode/styles.module.scss +5 -7
- package/lib/components/Loader/Loader.d.ts +1 -1
- package/lib/components/Loader/index.js +4 -4
- package/lib/components/Loader/index.js.map +1 -1
- package/lib/components/Loader/styles.module.scss +7 -7
- package/lib/components/Loader/styles.module.scss.d.ts +3 -3
- package/lib/components/Modal/constants.d.ts +1 -1
- package/lib/components/Modal/index.js +6 -3
- package/lib/components/Modal/index.js.map +1 -1
- package/lib/components/Modal/styles.module.scss +14 -19
- package/lib/components/Modal/styles.module.scss.d.ts +2 -3
- package/lib/components/Panel/index.js +1 -1
- package/lib/components/Panel/index.js.map +1 -1
- package/lib/components/Panel/styles.module.scss +15 -16
- package/lib/components/Panel/styles.module.scss.d.ts +1 -1
- package/lib/components/PopMenu/PopMenu.d.ts +4 -0
- package/lib/components/PopMenu/index.js +10 -5
- package/lib/components/PopMenu/index.js.map +1 -1
- package/lib/components/PopOver/styles.module.scss +1 -3
- package/lib/components/Progressbar/Progressbar.d.ts +1 -1
- package/lib/components/Progressbar/constants.d.ts +1 -1
- package/lib/components/Progressbar/index.js +4 -4
- package/lib/components/Progressbar/index.js.map +1 -1
- package/lib/components/Radio/Radio.d.ts +28 -0
- package/lib/components/Radio/index.d.ts +3 -0
- package/lib/components/Radio/index.js +7 -0
- package/lib/components/Radio/index.js.map +1 -0
- package/lib/components/{RadioButton → Radio}/styles.module.scss +8 -9
- package/lib/components/Radio/styles.module.scss.d.ts +26 -0
- package/lib/components/ServiceMessage/styles.module.scss +20 -22
- package/lib/components/Slider/styles.module.scss +1 -2
- package/lib/components/StatusDot/styles.module.scss +4 -5
- package/lib/components/StickyNote/index.js +2 -2
- package/lib/components/StickyNote/index.js.map +1 -1
- package/lib/components/StickyNote/styles.module.scss +9 -10
- package/lib/components/Table/index.js +0 -1
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Tabs/TabList/styles.module.scss +20 -18
- package/lib/components/Tabs/TabPanel/styles.module.scss +2 -3
- package/lib/components/Tabs/styles.module.scss +0 -1
- package/lib/components/Tag/styles.module.scss +0 -1
- package/lib/components/Tile/styles.module.scss +5 -7
- package/lib/components/Toast/styles.module.scss +0 -1
- package/lib/components/Toggle/styles.module.scss +9 -10
- package/lib/components/UNSAFE_Table/StackedCellContent.d.ts +9 -0
- package/lib/components/UNSAFE_Table/TableCaption.d.ts +10 -0
- package/lib/components/UNSAFE_Table/TableContext.d.ts +22 -0
- package/lib/components/UNSAFE_Table/UNSAFE_Table.d.ts +37 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableBody/UNSAFE_TableBody.d.ts +10 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableBody/index.d.ts +3 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableBody/index.js +2 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableCell/UNSAFE_TableCell.d.ts +15 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableCell/index.d.ts +3 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableCell/index.js +7 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableCell/index.js.map +1 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableDetail/UNSAFE_TableDetail.d.ts +12 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableDetail/index.d.ts +3 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableDetail/index.js +7 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableDetail/index.js.map +1 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableExpandedRow/UNSAFE_TableExpandedRow.d.ts +17 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableExpandedRow/index.d.ts +3 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableExpandedRow/index.js +7 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableExpandedRow/index.js.map +1 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableExpanderCell/UNSAFE_TableExpanderCellMobile.d.ts +4 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableHead/UNSAFE_TableHead.d.ts +8 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableHead/index.d.ts +3 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableHead/index.js +7 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableHead/index.js.map +1 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableHeadCell/UNSAFE_TableHeadCell.d.ts +15 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableHeadCell/index.d.ts +3 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableHeadCell/index.js +2 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TablePopMenuCell/UNSAFE_TablePopMenuCell.d.ts +8 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableRow/UNSAFE_TableRow.d.ts +20 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableRow/index.d.ts +3 -0
- package/lib/components/UNSAFE_Table/UNSAFE_TableRow/index.js +2 -0
- package/lib/components/UNSAFE_Table/constants.d.ts +29 -0
- package/lib/components/UNSAFE_Table/index.d.ts +19 -0
- package/lib/components/UNSAFE_Table/index.js +182 -0
- package/lib/components/UNSAFE_Table/index.js.map +1 -0
- package/lib/components/UNSAFE_Table/resourceHelper.d.ts +3 -0
- package/lib/components/UNSAFE_Table/styles.module.scss +621 -0
- package/lib/components/UNSAFE_Table/styles.module.scss.d.ts +62 -0
- package/lib/components/UNSAFE_Table/useTableExpandedRows.d.ts +12 -0
- package/lib/components/UNSAFE_Table/useTableShowMore.d.ts +25 -0
- package/lib/components/UNSAFE_Table/utils.d.ts +47 -0
- package/lib/components/Validation/index.js +2 -2
- package/lib/components/Validation/index.js.map +1 -1
- package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss +0 -2
- package/lib/components/VisualCheckboxCloud/styles.module.scss +0 -1
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss +0 -2
- package/lib/components/VisualCheckboxGroup/styles.module.scss +0 -1
- package/lib/components/VisualContentgroupWithImage/styles.module.scss +0 -1
- package/lib/components/VisualRadioCloud/Radio/index.js +1 -1
- package/lib/components/VisualRadioCloud/Radio/styles.module.scss +0 -2
- package/lib/components/VisualRadioCloud/index.js +1 -1
- package/lib/components/VisualRadioCloud/styles.module.scss +0 -1
- package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss +0 -2
- package/lib/components/VisualRadioGroup/styles.module.scss +0 -1
- package/lib/constants.d.ts +2 -3
- package/lib/constants.js +2 -3
- package/lib/constants.js.map +1 -1
- package/lib/constants3.js +42 -0
- package/lib/constants3.js.map +1 -0
- package/lib/floating-ui.react.js +3 -460
- package/lib/floating-ui.react.js.map +1 -1
- package/lib/hooks/useDismissablePopover.d.ts +20 -0
- package/lib/hooks/useDismissablePopover.js +66 -0
- package/lib/hooks/useDismissablePopover.js.map +1 -0
- package/lib/hooks/useOutsideEvent.d.ts +3 -0
- package/lib/hooks/useOutsideEvent.js +24 -3
- package/lib/hooks/useOutsideEvent.js.map +1 -1
- package/lib/hooks/useReturnFocusOnClose.d.ts +7 -0
- package/lib/hooks/useReturnFocusOnClose.js +22 -0
- package/lib/hooks/useReturnFocusOnClose.js.map +1 -0
- package/lib/hooks/useSort.d.ts +88 -0
- package/lib/hooks/useSort.js +91 -0
- package/lib/hooks/useSort.js.map +1 -0
- package/lib/hooks/useSort.test.js +11739 -0
- package/lib/hooks/useSort.test.js.map +1 -0
- package/lib/hooks/useSynchronousResizeObserver.d.ts +11 -0
- package/lib/hooks/useSynchronousResizeObserver.js +29 -0
- package/lib/hooks/useSynchronousResizeObserver.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lib/resources/HN.Designsystem.Table.nb-NO.json.d.ts +9 -0
- package/lib/resources/Resources.d.ts +19 -0
- package/lib/rolldown-runtime.js +33 -0
- package/lib/scss/_font-mixins.scss +28 -1
- package/lib/scss/_visual-form.scss +47 -47
- package/lib/scss/helsenorge.scss +1 -0
- package/lib/scss/supernova/styles/colors.css +177 -122
- package/lib/scss/supernova/styles/typography.css +58 -51
- package/lib/scss/supernova-legacy/index.css +2 -0
- package/lib/scss/supernova-legacy/styles/legacy-colors.css +111 -0
- package/lib/scss/typography.module.scss +8 -0
- package/lib/scss/typography.module.scss.d.ts +2 -0
- package/lib/scss/typography.stories.tsx +8 -0
- package/lib/utils/formSpacing.js +3 -3
- package/lib/utils/formSpacing.js.map +1 -1
- package/lib/utils/uuid.js +1 -12
- package/lib/utils/uuid.js.map +1 -1
- package/package.json +61 -15
- package/scss/_font-mixins.scss +28 -1
- package/scss/_visual-form.scss +47 -47
- package/scss/helsenorge.scss +1 -0
- package/scss/supernova/styles/colors.css +177 -122
- package/scss/supernova/styles/typography.css +58 -51
- package/scss/supernova-legacy/index.css +2 -0
- package/scss/supernova-legacy/styles/legacy-colors.css +111 -0
- package/scss/typography.module.scss +8 -0
- package/scss/typography.module.scss.d.ts +2 -0
- package/scss/typography.stories.tsx +8 -0
- package/lib/DictionaryTrigger.js +0 -27
- package/lib/RadioButton.js +0 -84
- package/lib/RadioButton.js.map +0 -1
- package/lib/components/HelpTooltip/HelpTooltip.d.ts +0 -12
- package/lib/components/HelpTooltip/index.d.ts +0 -3
- package/lib/components/HelpTooltip/index.js +0 -48
- package/lib/components/HelpTooltip/index.js.map +0 -1
- package/lib/components/RadioButton/RadioButton.d.ts +0 -28
- package/lib/components/RadioButton/index.d.ts +0 -3
- package/lib/components/RadioButton/index.js +0 -7
- package/lib/components/RadioButton/index.js.map +0 -1
- package/lib/components/RadioButton/styles.module.scss.d.ts +0 -26
- package/lib/designsystem-react.css +0 -273
- /package/lib/components/{RadioButton → Radio}/RadioMarker/RadioMarker.d.ts +0 -0
- /package/lib/components/{RadioButton → Radio}/RadioMarker/styles.module.scss +0 -0
- /package/lib/components/{RadioButton → Radio}/RadioMarker/styles.module.scss.d.ts +0 -0
package/lib/floating-ui.react.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
import { useLayoutEffect } from "react";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import * as ReactDOM from "react-dom";
|
|
4
|
+
import * as ReactDOM$1 from "react-dom";
|
|
5
5
|
//#region ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
6
6
|
function hasWindow() {
|
|
7
7
|
return typeof window !== "undefined";
|
|
@@ -601,9 +601,6 @@ function isAndroid() {
|
|
|
601
601
|
const re = /android/i;
|
|
602
602
|
return re.test(getPlatform()) || re.test(getUserAgent());
|
|
603
603
|
}
|
|
604
|
-
function isMac() {
|
|
605
|
-
return getPlatform().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
606
|
-
}
|
|
607
604
|
function isJSDOM() {
|
|
608
605
|
return getUserAgent().includes("jsdom/");
|
|
609
606
|
}
|
|
@@ -653,14 +650,6 @@ function isTypeableCombobox(element) {
|
|
|
653
650
|
if (!element) return false;
|
|
654
651
|
return element.getAttribute("role") === "combobox" && isTypeableElement(element);
|
|
655
652
|
}
|
|
656
|
-
function matchesFocusVisible(element) {
|
|
657
|
-
if (!element || isJSDOM()) return true;
|
|
658
|
-
try {
|
|
659
|
-
return element.matches(":focus-visible");
|
|
660
|
-
} catch (_e) {
|
|
661
|
-
return true;
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
653
|
function getFloatingFocusElement(floatingElement) {
|
|
665
654
|
if (!floatingElement) return null;
|
|
666
655
|
return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE$1) ? floatingElement : floatingElement.querySelector("[data-floating-ui-focusable]") || floatingElement;
|
|
@@ -1870,7 +1859,7 @@ function useFloating$1(options) {
|
|
|
1870
1859
|
};
|
|
1871
1860
|
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
1872
1861
|
dataRef.current = fullData;
|
|
1873
|
-
ReactDOM.flushSync(() => {
|
|
1862
|
+
ReactDOM$1.flushSync(() => {
|
|
1874
1863
|
setData(fullData);
|
|
1875
1864
|
});
|
|
1876
1865
|
}
|
|
@@ -2283,357 +2272,6 @@ function clearTimeoutIfSet(timeoutRef) {
|
|
|
2283
2272
|
timeoutRef.current = -1;
|
|
2284
2273
|
}
|
|
2285
2274
|
}
|
|
2286
|
-
var safePolygonIdentifier = /*#__PURE__*/ createAttribute("safe-polygon");
|
|
2287
|
-
function getDelay(value, prop, pointerType) {
|
|
2288
|
-
if (pointerType && !isMouseLikePointerType(pointerType)) return 0;
|
|
2289
|
-
if (typeof value === "number") return value;
|
|
2290
|
-
if (typeof value === "function") {
|
|
2291
|
-
const result = value();
|
|
2292
|
-
if (typeof result === "number") return result;
|
|
2293
|
-
return result == null ? void 0 : result[prop];
|
|
2294
|
-
}
|
|
2295
|
-
return value == null ? void 0 : value[prop];
|
|
2296
|
-
}
|
|
2297
|
-
function getRestMs(value) {
|
|
2298
|
-
if (typeof value === "function") return value();
|
|
2299
|
-
return value;
|
|
2300
|
-
}
|
|
2301
|
-
/**
|
|
2302
|
-
* Opens the floating element while hovering over the reference element, like
|
|
2303
|
-
* CSS `:hover`.
|
|
2304
|
-
* @see https://floating-ui.com/docs/useHover
|
|
2305
|
-
*/
|
|
2306
|
-
function useHover(context, props) {
|
|
2307
|
-
if (props === void 0) props = {};
|
|
2308
|
-
const { open, onOpenChange, dataRef, events, elements } = context;
|
|
2309
|
-
const { enabled = true, delay = 0, handleClose = null, mouseOnly = false, restMs = 0, move = true } = props;
|
|
2310
|
-
const tree = useFloatingTree();
|
|
2311
|
-
const parentId = useFloatingParentNodeId();
|
|
2312
|
-
const handleCloseRef = useLatestRef$1(handleClose);
|
|
2313
|
-
const delayRef = useLatestRef$1(delay);
|
|
2314
|
-
const openRef = useLatestRef$1(open);
|
|
2315
|
-
const restMsRef = useLatestRef$1(restMs);
|
|
2316
|
-
const pointerTypeRef = React$1.useRef();
|
|
2317
|
-
const timeoutRef = React$1.useRef(-1);
|
|
2318
|
-
const handlerRef = React$1.useRef();
|
|
2319
|
-
const restTimeoutRef = React$1.useRef(-1);
|
|
2320
|
-
const blockMouseMoveRef = React$1.useRef(true);
|
|
2321
|
-
const performedPointerEventsMutationRef = React$1.useRef(false);
|
|
2322
|
-
const unbindMouseMoveRef = React$1.useRef(() => {});
|
|
2323
|
-
const restTimeoutPendingRef = React$1.useRef(false);
|
|
2324
|
-
const isHoverOpen = useEffectEvent(() => {
|
|
2325
|
-
var _dataRef$current$open;
|
|
2326
|
-
const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type;
|
|
2327
|
-
return (type == null ? void 0 : type.includes("mouse")) && type !== "mousedown";
|
|
2328
|
-
});
|
|
2329
|
-
React$1.useEffect(() => {
|
|
2330
|
-
if (!enabled) return;
|
|
2331
|
-
function onOpenChange(_ref) {
|
|
2332
|
-
let { open } = _ref;
|
|
2333
|
-
if (!open) {
|
|
2334
|
-
clearTimeoutIfSet(timeoutRef);
|
|
2335
|
-
clearTimeoutIfSet(restTimeoutRef);
|
|
2336
|
-
blockMouseMoveRef.current = true;
|
|
2337
|
-
restTimeoutPendingRef.current = false;
|
|
2338
|
-
}
|
|
2339
|
-
}
|
|
2340
|
-
events.on("openchange", onOpenChange);
|
|
2341
|
-
return () => {
|
|
2342
|
-
events.off("openchange", onOpenChange);
|
|
2343
|
-
};
|
|
2344
|
-
}, [enabled, events]);
|
|
2345
|
-
React$1.useEffect(() => {
|
|
2346
|
-
if (!enabled) return;
|
|
2347
|
-
if (!handleCloseRef.current) return;
|
|
2348
|
-
if (!open) return;
|
|
2349
|
-
function onLeave(event) {
|
|
2350
|
-
if (isHoverOpen()) onOpenChange(false, event, "hover");
|
|
2351
|
-
}
|
|
2352
|
-
const html = getDocument$1(elements.floating).documentElement;
|
|
2353
|
-
html.addEventListener("mouseleave", onLeave);
|
|
2354
|
-
return () => {
|
|
2355
|
-
html.removeEventListener("mouseleave", onLeave);
|
|
2356
|
-
};
|
|
2357
|
-
}, [
|
|
2358
|
-
elements.floating,
|
|
2359
|
-
open,
|
|
2360
|
-
onOpenChange,
|
|
2361
|
-
enabled,
|
|
2362
|
-
handleCloseRef,
|
|
2363
|
-
isHoverOpen
|
|
2364
|
-
]);
|
|
2365
|
-
const closeWithDelay = React$1.useCallback(function(event, runElseBranch, reason) {
|
|
2366
|
-
if (runElseBranch === void 0) runElseBranch = true;
|
|
2367
|
-
if (reason === void 0) reason = "hover";
|
|
2368
|
-
const closeDelay = getDelay(delayRef.current, "close", pointerTypeRef.current);
|
|
2369
|
-
if (closeDelay && !handlerRef.current) {
|
|
2370
|
-
clearTimeoutIfSet(timeoutRef);
|
|
2371
|
-
timeoutRef.current = window.setTimeout(() => onOpenChange(false, event, reason), closeDelay);
|
|
2372
|
-
} else if (runElseBranch) {
|
|
2373
|
-
clearTimeoutIfSet(timeoutRef);
|
|
2374
|
-
onOpenChange(false, event, reason);
|
|
2375
|
-
}
|
|
2376
|
-
}, [delayRef, onOpenChange]);
|
|
2377
|
-
const cleanupMouseMoveHandler = useEffectEvent(() => {
|
|
2378
|
-
unbindMouseMoveRef.current();
|
|
2379
|
-
handlerRef.current = void 0;
|
|
2380
|
-
});
|
|
2381
|
-
const clearPointerEvents = useEffectEvent(() => {
|
|
2382
|
-
if (performedPointerEventsMutationRef.current) {
|
|
2383
|
-
const body = getDocument$1(elements.floating).body;
|
|
2384
|
-
body.style.pointerEvents = "";
|
|
2385
|
-
body.removeAttribute(safePolygonIdentifier);
|
|
2386
|
-
performedPointerEventsMutationRef.current = false;
|
|
2387
|
-
}
|
|
2388
|
-
});
|
|
2389
|
-
const isClickLikeOpenEvent = useEffectEvent(() => {
|
|
2390
|
-
return dataRef.current.openEvent ? ["click", "mousedown"].includes(dataRef.current.openEvent.type) : false;
|
|
2391
|
-
});
|
|
2392
|
-
React$1.useEffect(() => {
|
|
2393
|
-
if (!enabled) return;
|
|
2394
|
-
function onReferenceMouseEnter(event) {
|
|
2395
|
-
clearTimeoutIfSet(timeoutRef);
|
|
2396
|
-
blockMouseMoveRef.current = false;
|
|
2397
|
-
if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current) || getRestMs(restMsRef.current) > 0 && !getDelay(delayRef.current, "open")) return;
|
|
2398
|
-
const openDelay = getDelay(delayRef.current, "open", pointerTypeRef.current);
|
|
2399
|
-
if (openDelay) timeoutRef.current = window.setTimeout(() => {
|
|
2400
|
-
if (!openRef.current) onOpenChange(true, event, "hover");
|
|
2401
|
-
}, openDelay);
|
|
2402
|
-
else if (!open) onOpenChange(true, event, "hover");
|
|
2403
|
-
}
|
|
2404
|
-
function onReferenceMouseLeave(event) {
|
|
2405
|
-
if (isClickLikeOpenEvent()) {
|
|
2406
|
-
clearPointerEvents();
|
|
2407
|
-
return;
|
|
2408
|
-
}
|
|
2409
|
-
unbindMouseMoveRef.current();
|
|
2410
|
-
const doc = getDocument$1(elements.floating);
|
|
2411
|
-
clearTimeoutIfSet(restTimeoutRef);
|
|
2412
|
-
restTimeoutPendingRef.current = false;
|
|
2413
|
-
if (handleCloseRef.current && dataRef.current.floatingContext) {
|
|
2414
|
-
if (!open) clearTimeoutIfSet(timeoutRef);
|
|
2415
|
-
handlerRef.current = handleCloseRef.current({
|
|
2416
|
-
...dataRef.current.floatingContext,
|
|
2417
|
-
tree,
|
|
2418
|
-
x: event.clientX,
|
|
2419
|
-
y: event.clientY,
|
|
2420
|
-
onClose() {
|
|
2421
|
-
clearPointerEvents();
|
|
2422
|
-
cleanupMouseMoveHandler();
|
|
2423
|
-
if (!isClickLikeOpenEvent()) closeWithDelay(event, true, "safe-polygon");
|
|
2424
|
-
}
|
|
2425
|
-
});
|
|
2426
|
-
const handler = handlerRef.current;
|
|
2427
|
-
doc.addEventListener("mousemove", handler);
|
|
2428
|
-
unbindMouseMoveRef.current = () => {
|
|
2429
|
-
doc.removeEventListener("mousemove", handler);
|
|
2430
|
-
};
|
|
2431
|
-
return;
|
|
2432
|
-
}
|
|
2433
|
-
if (pointerTypeRef.current === "touch" ? !contains(elements.floating, event.relatedTarget) : true) closeWithDelay(event);
|
|
2434
|
-
}
|
|
2435
|
-
function onScrollMouseLeave(event) {
|
|
2436
|
-
if (isClickLikeOpenEvent()) return;
|
|
2437
|
-
if (!dataRef.current.floatingContext) return;
|
|
2438
|
-
handleCloseRef.current == null || handleCloseRef.current({
|
|
2439
|
-
...dataRef.current.floatingContext,
|
|
2440
|
-
tree,
|
|
2441
|
-
x: event.clientX,
|
|
2442
|
-
y: event.clientY,
|
|
2443
|
-
onClose() {
|
|
2444
|
-
clearPointerEvents();
|
|
2445
|
-
cleanupMouseMoveHandler();
|
|
2446
|
-
if (!isClickLikeOpenEvent()) closeWithDelay(event);
|
|
2447
|
-
}
|
|
2448
|
-
})(event);
|
|
2449
|
-
}
|
|
2450
|
-
function onFloatingMouseEnter() {
|
|
2451
|
-
clearTimeoutIfSet(timeoutRef);
|
|
2452
|
-
}
|
|
2453
|
-
function onFloatingMouseLeave(event) {
|
|
2454
|
-
if (!isClickLikeOpenEvent()) closeWithDelay(event, false);
|
|
2455
|
-
}
|
|
2456
|
-
if (isElement(elements.domReference)) {
|
|
2457
|
-
const reference = elements.domReference;
|
|
2458
|
-
const floating = elements.floating;
|
|
2459
|
-
if (open) reference.addEventListener("mouseleave", onScrollMouseLeave);
|
|
2460
|
-
if (move) reference.addEventListener("mousemove", onReferenceMouseEnter, { once: true });
|
|
2461
|
-
reference.addEventListener("mouseenter", onReferenceMouseEnter);
|
|
2462
|
-
reference.addEventListener("mouseleave", onReferenceMouseLeave);
|
|
2463
|
-
if (floating) {
|
|
2464
|
-
floating.addEventListener("mouseleave", onScrollMouseLeave);
|
|
2465
|
-
floating.addEventListener("mouseenter", onFloatingMouseEnter);
|
|
2466
|
-
floating.addEventListener("mouseleave", onFloatingMouseLeave);
|
|
2467
|
-
}
|
|
2468
|
-
return () => {
|
|
2469
|
-
if (open) reference.removeEventListener("mouseleave", onScrollMouseLeave);
|
|
2470
|
-
if (move) reference.removeEventListener("mousemove", onReferenceMouseEnter);
|
|
2471
|
-
reference.removeEventListener("mouseenter", onReferenceMouseEnter);
|
|
2472
|
-
reference.removeEventListener("mouseleave", onReferenceMouseLeave);
|
|
2473
|
-
if (floating) {
|
|
2474
|
-
floating.removeEventListener("mouseleave", onScrollMouseLeave);
|
|
2475
|
-
floating.removeEventListener("mouseenter", onFloatingMouseEnter);
|
|
2476
|
-
floating.removeEventListener("mouseleave", onFloatingMouseLeave);
|
|
2477
|
-
}
|
|
2478
|
-
};
|
|
2479
|
-
}
|
|
2480
|
-
}, [
|
|
2481
|
-
elements,
|
|
2482
|
-
enabled,
|
|
2483
|
-
context,
|
|
2484
|
-
mouseOnly,
|
|
2485
|
-
move,
|
|
2486
|
-
closeWithDelay,
|
|
2487
|
-
cleanupMouseMoveHandler,
|
|
2488
|
-
clearPointerEvents,
|
|
2489
|
-
onOpenChange,
|
|
2490
|
-
open,
|
|
2491
|
-
openRef,
|
|
2492
|
-
tree,
|
|
2493
|
-
delayRef,
|
|
2494
|
-
handleCloseRef,
|
|
2495
|
-
dataRef,
|
|
2496
|
-
isClickLikeOpenEvent,
|
|
2497
|
-
restMsRef
|
|
2498
|
-
]);
|
|
2499
|
-
index$1(() => {
|
|
2500
|
-
var _handleCloseRef$curre;
|
|
2501
|
-
if (!enabled) return;
|
|
2502
|
-
if (open && (_handleCloseRef$curre = handleCloseRef.current) != null && (_handleCloseRef$curre = _handleCloseRef$curre.__options) != null && _handleCloseRef$curre.blockPointerEvents && isHoverOpen()) {
|
|
2503
|
-
performedPointerEventsMutationRef.current = true;
|
|
2504
|
-
const floatingEl = elements.floating;
|
|
2505
|
-
if (isElement(elements.domReference) && floatingEl) {
|
|
2506
|
-
var _tree$nodesRef$curren;
|
|
2507
|
-
const body = getDocument$1(elements.floating).body;
|
|
2508
|
-
body.setAttribute(safePolygonIdentifier, "");
|
|
2509
|
-
const ref = elements.domReference;
|
|
2510
|
-
const parentFloating = tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find((node) => node.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren.elements.floating;
|
|
2511
|
-
if (parentFloating) parentFloating.style.pointerEvents = "";
|
|
2512
|
-
body.style.pointerEvents = "none";
|
|
2513
|
-
ref.style.pointerEvents = "auto";
|
|
2514
|
-
floatingEl.style.pointerEvents = "auto";
|
|
2515
|
-
return () => {
|
|
2516
|
-
body.style.pointerEvents = "";
|
|
2517
|
-
ref.style.pointerEvents = "";
|
|
2518
|
-
floatingEl.style.pointerEvents = "";
|
|
2519
|
-
};
|
|
2520
|
-
}
|
|
2521
|
-
}
|
|
2522
|
-
}, [
|
|
2523
|
-
enabled,
|
|
2524
|
-
open,
|
|
2525
|
-
parentId,
|
|
2526
|
-
elements,
|
|
2527
|
-
tree,
|
|
2528
|
-
handleCloseRef,
|
|
2529
|
-
isHoverOpen
|
|
2530
|
-
]);
|
|
2531
|
-
index$1(() => {
|
|
2532
|
-
if (!open) {
|
|
2533
|
-
pointerTypeRef.current = void 0;
|
|
2534
|
-
restTimeoutPendingRef.current = false;
|
|
2535
|
-
cleanupMouseMoveHandler();
|
|
2536
|
-
clearPointerEvents();
|
|
2537
|
-
}
|
|
2538
|
-
}, [
|
|
2539
|
-
open,
|
|
2540
|
-
cleanupMouseMoveHandler,
|
|
2541
|
-
clearPointerEvents
|
|
2542
|
-
]);
|
|
2543
|
-
React$1.useEffect(() => {
|
|
2544
|
-
return () => {
|
|
2545
|
-
cleanupMouseMoveHandler();
|
|
2546
|
-
clearTimeoutIfSet(timeoutRef);
|
|
2547
|
-
clearTimeoutIfSet(restTimeoutRef);
|
|
2548
|
-
clearPointerEvents();
|
|
2549
|
-
};
|
|
2550
|
-
}, [
|
|
2551
|
-
enabled,
|
|
2552
|
-
elements.domReference,
|
|
2553
|
-
cleanupMouseMoveHandler,
|
|
2554
|
-
clearPointerEvents
|
|
2555
|
-
]);
|
|
2556
|
-
const reference = React$1.useMemo(() => {
|
|
2557
|
-
function setPointerRef(event) {
|
|
2558
|
-
pointerTypeRef.current = event.pointerType;
|
|
2559
|
-
}
|
|
2560
|
-
return {
|
|
2561
|
-
onPointerDown: setPointerRef,
|
|
2562
|
-
onPointerEnter: setPointerRef,
|
|
2563
|
-
onMouseMove(event) {
|
|
2564
|
-
const { nativeEvent } = event;
|
|
2565
|
-
function handleMouseMove() {
|
|
2566
|
-
if (!blockMouseMoveRef.current && !openRef.current) onOpenChange(true, nativeEvent, "hover");
|
|
2567
|
-
}
|
|
2568
|
-
if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current)) return;
|
|
2569
|
-
if (open || getRestMs(restMsRef.current) === 0) return;
|
|
2570
|
-
if (restTimeoutPendingRef.current && event.movementX ** 2 + event.movementY ** 2 < 2) return;
|
|
2571
|
-
clearTimeoutIfSet(restTimeoutRef);
|
|
2572
|
-
if (pointerTypeRef.current === "touch") handleMouseMove();
|
|
2573
|
-
else {
|
|
2574
|
-
restTimeoutPendingRef.current = true;
|
|
2575
|
-
restTimeoutRef.current = window.setTimeout(handleMouseMove, getRestMs(restMsRef.current));
|
|
2576
|
-
}
|
|
2577
|
-
}
|
|
2578
|
-
};
|
|
2579
|
-
}, [
|
|
2580
|
-
mouseOnly,
|
|
2581
|
-
onOpenChange,
|
|
2582
|
-
open,
|
|
2583
|
-
openRef,
|
|
2584
|
-
restMsRef
|
|
2585
|
-
]);
|
|
2586
|
-
return React$1.useMemo(() => enabled ? { reference } : {}, [enabled, reference]);
|
|
2587
|
-
}
|
|
2588
|
-
var NOOP = () => {};
|
|
2589
|
-
var FloatingDelayGroupContext = /*#__PURE__*/ React$1.createContext({
|
|
2590
|
-
delay: 0,
|
|
2591
|
-
initialDelay: 0,
|
|
2592
|
-
timeoutMs: 0,
|
|
2593
|
-
currentId: null,
|
|
2594
|
-
setCurrentId: NOOP,
|
|
2595
|
-
setState: NOOP,
|
|
2596
|
-
isInstantPhase: false
|
|
2597
|
-
});
|
|
2598
|
-
/**
|
|
2599
|
-
* Provides context for a group of floating elements that should share a
|
|
2600
|
-
* `delay`.
|
|
2601
|
-
* @see https://floating-ui.com/docs/FloatingDelayGroup
|
|
2602
|
-
*/
|
|
2603
|
-
function FloatingDelayGroup(props) {
|
|
2604
|
-
const { children, delay, timeoutMs = 0 } = props;
|
|
2605
|
-
const [state, setState] = React$1.useReducer((prev, next) => ({
|
|
2606
|
-
...prev,
|
|
2607
|
-
...next
|
|
2608
|
-
}), {
|
|
2609
|
-
delay,
|
|
2610
|
-
timeoutMs,
|
|
2611
|
-
initialDelay: delay,
|
|
2612
|
-
currentId: null,
|
|
2613
|
-
isInstantPhase: false
|
|
2614
|
-
});
|
|
2615
|
-
const initialCurrentIdRef = React$1.useRef(null);
|
|
2616
|
-
const setCurrentId = React$1.useCallback((currentId) => {
|
|
2617
|
-
setState({ currentId });
|
|
2618
|
-
}, []);
|
|
2619
|
-
index$1(() => {
|
|
2620
|
-
if (state.currentId) {
|
|
2621
|
-
if (initialCurrentIdRef.current === null) initialCurrentIdRef.current = state.currentId;
|
|
2622
|
-
else if (!state.isInstantPhase) setState({ isInstantPhase: true });
|
|
2623
|
-
} else {
|
|
2624
|
-
if (state.isInstantPhase) setState({ isInstantPhase: false });
|
|
2625
|
-
initialCurrentIdRef.current = null;
|
|
2626
|
-
}
|
|
2627
|
-
}, [state.currentId, state.isInstantPhase]);
|
|
2628
|
-
return /*#__PURE__*/ jsx(FloatingDelayGroupContext.Provider, {
|
|
2629
|
-
value: React$1.useMemo(() => ({
|
|
2630
|
-
...state,
|
|
2631
|
-
setState,
|
|
2632
|
-
setCurrentId
|
|
2633
|
-
}), [state, setCurrentId]),
|
|
2634
|
-
children
|
|
2635
|
-
});
|
|
2636
|
-
}
|
|
2637
2275
|
var rafId = 0;
|
|
2638
2276
|
function enqueueFocus(el, options) {
|
|
2639
2277
|
if (options === void 0) options = {};
|
|
@@ -3667,101 +3305,6 @@ function useFloating(_temp) {
|
|
|
3667
3305
|
context
|
|
3668
3306
|
]);
|
|
3669
3307
|
}
|
|
3670
|
-
function isMacSafari() {
|
|
3671
|
-
return isMac() && isSafari();
|
|
3672
|
-
}
|
|
3673
|
-
/**
|
|
3674
|
-
* Opens the floating element while the reference element has focus, like CSS
|
|
3675
|
-
* `:focus`.
|
|
3676
|
-
* @see https://floating-ui.com/docs/useFocus
|
|
3677
|
-
*/
|
|
3678
|
-
function useFocus(context, props) {
|
|
3679
|
-
if (props === void 0) props = {};
|
|
3680
|
-
const { open, onOpenChange, events, dataRef, elements } = context;
|
|
3681
|
-
const { enabled = true, visibleOnly = true } = props;
|
|
3682
|
-
const blockFocusRef = React$1.useRef(false);
|
|
3683
|
-
const timeoutRef = React$1.useRef(-1);
|
|
3684
|
-
const keyboardModalityRef = React$1.useRef(true);
|
|
3685
|
-
React$1.useEffect(() => {
|
|
3686
|
-
if (!enabled) return;
|
|
3687
|
-
const win = getWindow(elements.domReference);
|
|
3688
|
-
function onBlur() {
|
|
3689
|
-
if (!open && isHTMLElement(elements.domReference) && elements.domReference === activeElement(getDocument$1(elements.domReference))) blockFocusRef.current = true;
|
|
3690
|
-
}
|
|
3691
|
-
function onKeyDown() {
|
|
3692
|
-
keyboardModalityRef.current = true;
|
|
3693
|
-
}
|
|
3694
|
-
function onPointerDown() {
|
|
3695
|
-
keyboardModalityRef.current = false;
|
|
3696
|
-
}
|
|
3697
|
-
win.addEventListener("blur", onBlur);
|
|
3698
|
-
if (isMacSafari()) {
|
|
3699
|
-
win.addEventListener("keydown", onKeyDown, true);
|
|
3700
|
-
win.addEventListener("pointerdown", onPointerDown, true);
|
|
3701
|
-
}
|
|
3702
|
-
return () => {
|
|
3703
|
-
win.removeEventListener("blur", onBlur);
|
|
3704
|
-
if (isMacSafari()) {
|
|
3705
|
-
win.removeEventListener("keydown", onKeyDown, true);
|
|
3706
|
-
win.removeEventListener("pointerdown", onPointerDown, true);
|
|
3707
|
-
}
|
|
3708
|
-
};
|
|
3709
|
-
}, [
|
|
3710
|
-
elements.domReference,
|
|
3711
|
-
open,
|
|
3712
|
-
enabled
|
|
3713
|
-
]);
|
|
3714
|
-
React$1.useEffect(() => {
|
|
3715
|
-
if (!enabled) return;
|
|
3716
|
-
function onOpenChange(_ref) {
|
|
3717
|
-
let { reason } = _ref;
|
|
3718
|
-
if (reason === "reference-press" || reason === "escape-key") blockFocusRef.current = true;
|
|
3719
|
-
}
|
|
3720
|
-
events.on("openchange", onOpenChange);
|
|
3721
|
-
return () => {
|
|
3722
|
-
events.off("openchange", onOpenChange);
|
|
3723
|
-
};
|
|
3724
|
-
}, [events, enabled]);
|
|
3725
|
-
React$1.useEffect(() => {
|
|
3726
|
-
return () => {
|
|
3727
|
-
clearTimeoutIfSet(timeoutRef);
|
|
3728
|
-
};
|
|
3729
|
-
}, []);
|
|
3730
|
-
const reference = React$1.useMemo(() => ({
|
|
3731
|
-
onMouseLeave() {
|
|
3732
|
-
blockFocusRef.current = false;
|
|
3733
|
-
},
|
|
3734
|
-
onFocus(event) {
|
|
3735
|
-
if (blockFocusRef.current) return;
|
|
3736
|
-
const target = getTarget(event.nativeEvent);
|
|
3737
|
-
if (visibleOnly && isElement(target)) {
|
|
3738
|
-
if (isMacSafari() && !event.relatedTarget) {
|
|
3739
|
-
if (!keyboardModalityRef.current && !isTypeableElement(target)) return;
|
|
3740
|
-
} else if (!matchesFocusVisible(target)) return;
|
|
3741
|
-
}
|
|
3742
|
-
onOpenChange(true, event.nativeEvent, "focus");
|
|
3743
|
-
},
|
|
3744
|
-
onBlur(event) {
|
|
3745
|
-
blockFocusRef.current = false;
|
|
3746
|
-
const relatedTarget = event.relatedTarget;
|
|
3747
|
-
const nativeEvent = event.nativeEvent;
|
|
3748
|
-
const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside";
|
|
3749
|
-
timeoutRef.current = window.setTimeout(() => {
|
|
3750
|
-
var _dataRef$current$floa;
|
|
3751
|
-
const activeEl = activeElement(elements.domReference ? elements.domReference.ownerDocument : document);
|
|
3752
|
-
if (!relatedTarget && activeEl === elements.domReference) return;
|
|
3753
|
-
if (contains((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains(elements.domReference, activeEl) || movedToFocusGuard) return;
|
|
3754
|
-
onOpenChange(false, nativeEvent, "focus");
|
|
3755
|
-
});
|
|
3756
|
-
}
|
|
3757
|
-
}), [
|
|
3758
|
-
dataRef,
|
|
3759
|
-
elements.domReference,
|
|
3760
|
-
onOpenChange,
|
|
3761
|
-
visibleOnly
|
|
3762
|
-
]);
|
|
3763
|
-
return React$1.useMemo(() => enabled ? { reference } : {}, [enabled, reference]);
|
|
3764
|
-
}
|
|
3765
3308
|
function mergeProps(userProps, propsList, elementKey) {
|
|
3766
3309
|
const map = /* @__PURE__ */ new Map();
|
|
3767
3310
|
const isItem = elementKey === "item";
|
|
@@ -3827,6 +3370,6 @@ function useInteractions(propsList) {
|
|
|
3827
3370
|
]);
|
|
3828
3371
|
}
|
|
3829
3372
|
//#endregion
|
|
3830
|
-
export {
|
|
3373
|
+
export { useFloating as a, arrow as c, offset as d, shift as f, useDismiss as i, flip as l, autoUpdate as m, FloatingFocusManager as n, useInteractions as o, size as p, useClick as r, useMergeRefs as s, FloatingArrow as t, hide as u };
|
|
3831
3374
|
|
|
3832
3375
|
//# sourceMappingURL=floating-ui.react.js.map
|