lawgic-dev-kit 0.21.6 → 0.22.4
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/README.md +54 -54
- package/dist/_virtual/index2.js +2 -3
- package/dist/_virtual/index3.js +3 -3
- package/dist/_virtual/index4.js +3 -5
- package/dist/_virtual/index5.js +5 -2
- package/dist/components/atoms/Checkbox/Checkbox.d.ts +3 -2
- package/dist/components/atoms/Checkbox/Checkbox.js +43 -30
- package/dist/components/atoms/Chip/Chip.d.ts +13 -0
- package/dist/components/atoms/Chip/Chip.js +32 -0
- package/dist/components/atoms/Chip/index.d.ts +1 -0
- package/dist/components/atoms/InformationDisclaimer/InformationDisclaimer.js +17 -30
- package/dist/components/atoms/InformationDisclaimer/InformationDisclaimer.styles.d.ts +8 -2
- package/dist/components/atoms/InformationDisclaimer/InformationDisclaimer.styles.js +46 -12
- package/dist/components/atoms/InformationDisclaimer/InformationDisclaimer.types.d.ts +3 -3
- package/dist/components/atoms/LoadingSpinner/LoadingSpinner.d.ts +1 -1
- package/dist/components/atoms/LoadingSpinner/LoadingSpinner.js +56 -12
- package/dist/components/atoms/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/atoms/PasswordInput/PasswordInput.js +57 -41
- package/dist/components/atoms/PasswordInput/PasswordInput.types.d.ts +1 -0
- package/dist/components/atoms/SelectInput/SelectInput.d.ts +1 -1
- package/dist/components/atoms/SelectInput/SelectInput.js +125 -140
- package/dist/components/atoms/SelectInput/SelectInput.types.d.ts +2 -0
- package/dist/components/atoms/StepIndicator/StepIndicator.d.ts +5 -0
- package/dist/components/atoms/StepIndicator/StepIndicator.js +58 -0
- package/dist/components/atoms/StepIndicator/index.d.ts +1 -0
- package/dist/components/atoms/TextInput/TextInput.js +33 -33
- package/dist/components/atoms/TextInput/TextInput.types.d.ts +1 -1
- package/dist/components/atoms/Toast/Toast.d.ts +2 -3
- package/dist/components/atoms/Toast/Toast.js +46 -53
- package/dist/components/atoms/UncontrolledSelector/UncontrolledSelector.d.ts +1 -0
- package/dist/components/atoms/UncontrolledSelector/UncontrolledSelector.js +98 -84
- package/dist/components/atoms/UncontrolledTextInput/UncontrolledTextInput.js +29 -35
- package/dist/components/atoms/UncontrolledTextInput/UncontrolledTextInput.types.d.ts +1 -1
- package/dist/components/atoms/UploadContainer/UploadContainer.js +4 -4
- package/dist/components/atoms/index.d.ts +2 -1
- package/dist/components/molecules/CalendarSelector/CalendarSelector.js +8 -8
- package/dist/components/molecules/DateInput/DateInput.d.ts +1 -1
- package/dist/components/molecules/EmptyState/EmptyState.d.ts +9 -0
- package/dist/components/molecules/EmptyState/EmptyState.js +16 -0
- package/dist/components/molecules/EmptyState/index.d.ts +1 -0
- package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.d.ts +24 -0
- package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.js +208 -0
- package/dist/components/molecules/MultiSelectDropdown/index.d.ts +1 -0
- package/dist/components/molecules/SingleSelectDropdown/SingleSelectDropdown.d.ts +25 -0
- package/dist/components/molecules/SingleSelectDropdown/SingleSelectDropdown.js +212 -0
- package/dist/components/molecules/SingleSelectDropdown/index.d.ts +1 -0
- package/dist/components/molecules/Stepper/Stepper.d.ts +1 -1
- package/dist/components/molecules/Stepper/Stepper.js +78 -231
- package/dist/components/molecules/Stepper/Stepper.styles.d.ts +7 -3
- package/dist/components/molecules/Stepper/Stepper.styles.js +23 -15
- package/dist/components/molecules/Tooltip/Tooltip.d.ts +20 -0
- package/dist/components/molecules/Tooltip/Tooltip.js +41 -0
- package/dist/components/molecules/UncontrolledDateInput/UncontrolledDateInput.d.ts +1 -1
- package/dist/components/molecules/index.d.ts +4 -0
- package/dist/index.js +139 -129
- package/dist/lawgic-dev-kit.css +1 -1
- package/dist/lawgic-dev-kit.umd.js +109 -97
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js +396 -712
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +33 -81
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +7 -2
- package/dist/node_modules/@fortawesome/pro-light-svg-icons/index.js +14 -49
- package/dist/node_modules/@fortawesome/pro-regular-svg-icons/index.js +32 -12
- package/dist/node_modules/@fortawesome/pro-solid-svg-icons/index.js +14 -9
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +3 -3
- package/dist/src/Root.d.ts +2 -0
- package/dist/src/app.d.ts +1 -0
- package/dist/src/components/atoms/ActionButton/ActionButton.d.ts +11 -0
- package/dist/src/components/atoms/ActionButton/index.d.ts +1 -0
- package/dist/src/components/atoms/AsyncToast/index.d.ts +11 -0
- package/dist/src/components/atoms/Avatar/Avatar.d.ts +11 -0
- package/dist/src/components/atoms/Avatar/index.d.ts +1 -0
- package/dist/src/components/atoms/BoxContainer/BoxContainer.d.ts +4 -0
- package/dist/src/components/atoms/BoxContainer/BoxContainer.types.d.ts +6 -0
- package/dist/src/components/atoms/BoxContainer/index.d.ts +1 -0
- package/dist/src/components/atoms/Button/Button.d.ts +4 -0
- package/dist/src/components/atoms/Button/Button.styles.d.ts +26 -0
- package/dist/src/components/atoms/Button/Button.types.d.ts +12 -0
- package/dist/src/components/atoms/Button/index.d.ts +1 -0
- package/dist/src/components/atoms/CenterModal/CenterModal.d.ts +4 -0
- package/dist/src/components/atoms/CenterModal/CenterModal.types.d.ts +6 -0
- package/dist/src/components/atoms/CenterModal/index.d.ts +1 -0
- package/dist/src/components/atoms/Checkbox/Checkbox.d.ts +13 -0
- package/dist/src/components/atoms/Checkbox/index.d.ts +1 -0
- package/dist/src/components/atoms/Chip/Chip.d.ts +13 -0
- package/dist/src/components/atoms/Chip/index.d.ts +1 -0
- package/dist/src/components/atoms/CircleProgress/CircleProgress.d.ts +22 -0
- package/dist/src/components/atoms/CircleProgress/index.d.ts +1 -0
- package/dist/src/components/atoms/ClickAwayListener/ClickAwayListener.d.ts +4 -0
- package/dist/src/components/atoms/ClickAwayListener/ClickAwayListener.types.d.ts +7 -0
- package/dist/src/components/atoms/ClickAwayListener/index.d.ts +1 -0
- package/dist/src/components/atoms/CountryInput/CountryInput.d.ts +4 -0
- package/dist/src/components/atoms/CountryInput/CountryInput.types.d.ts +37 -0
- package/dist/src/components/atoms/CountryInput/index.d.ts +1 -0
- package/dist/src/components/atoms/CountryLabel/CountryLabel.d.ts +6 -0
- package/dist/src/components/atoms/CountryLabel/index.d.ts +1 -0
- package/dist/src/components/atoms/CountrySelectInput/CountryDropdown.d.ts +4 -0
- package/dist/src/components/atoms/CountrySelectInput/CountryDropdown.types.d.ts +36 -0
- package/dist/src/components/atoms/CountrySelectInput/index.d.ts +1 -0
- package/dist/src/components/atoms/Divider/Divider.d.ts +7 -0
- package/dist/src/components/atoms/Divider/index.d.ts +1 -0
- package/dist/src/components/atoms/FilterPill/FilterPill.d.ts +8 -0
- package/dist/src/components/atoms/FilterPill/index.d.ts +1 -0
- package/dist/src/components/atoms/FloatingCard/FloatingCard.d.ts +4 -0
- package/dist/{components/atoms/Tooltip/Tooltip.types.d.ts → src/components/atoms/FloatingCard/FloatingCard.types.d.ts} +3 -3
- package/dist/src/components/atoms/FloatingCard/index.d.ts +1 -0
- package/dist/src/components/atoms/IconButton/IconButton.d.ts +4 -0
- package/dist/src/components/atoms/IconButton/IconButton.styles.d.ts +10 -0
- package/dist/src/components/atoms/IconButton/IconButton.types.d.ts +11 -0
- package/dist/src/components/atoms/IconButton/index.d.ts +1 -0
- package/dist/src/components/atoms/ImageProfileInput/ImageProfileInput.d.ts +4 -0
- package/dist/src/components/atoms/ImageProfileInput/ImageProfileInput.types.d.ts +12 -0
- package/dist/src/components/atoms/ImageProfileInput/ImageProfileInput.validators.d.ts +9 -0
- package/dist/src/components/atoms/ImageProfileInput/index.d.ts +2 -0
- package/dist/src/components/atoms/IndexedStep/IndexedStep.d.ts +9 -0
- package/dist/src/components/atoms/IndexedStep/index.d.ts +1 -0
- package/dist/src/components/atoms/InfoCard/InfoCard.d.ts +3 -0
- package/dist/src/components/atoms/InfoCard/InfoCard.types.d.ts +6 -0
- package/dist/src/components/atoms/InfoCard/index.d.ts +1 -0
- package/dist/src/components/atoms/InformationDisclaimer/InformationDisclaimer.d.ts +4 -0
- package/dist/src/components/atoms/InformationDisclaimer/InformationDisclaimer.styles.d.ts +9 -0
- package/dist/src/components/atoms/InformationDisclaimer/InformationDisclaimer.types.d.ts +10 -0
- package/dist/src/components/atoms/InformationDisclaimer/index.d.ts +1 -0
- package/dist/src/components/atoms/LoadingProgress/LoadingProgress.d.ts +13 -0
- package/dist/src/components/atoms/LoadingProgress/index.d.ts +1 -0
- package/dist/src/components/atoms/LoadingSpinner/LoadingSpinner.d.ts +8 -0
- package/dist/src/components/atoms/LoadingSpinner/index.d.ts +1 -0
- package/dist/src/components/atoms/PasswordInput/PasswordInput.d.ts +5 -0
- package/dist/src/components/atoms/PasswordInput/PasswordInput.types.d.ts +12 -0
- package/dist/src/components/atoms/PasswordInput/index.d.ts +1 -0
- package/dist/src/components/atoms/PhoneInput/PhoneInput.d.ts +5 -0
- package/dist/src/components/atoms/PhoneInput/PhoneInput.types.d.ts +12 -0
- package/dist/src/components/atoms/PhoneInput/index.d.ts +1 -0
- package/dist/src/components/atoms/Pill/Pill.d.ts +8 -0
- package/dist/src/components/atoms/Pill/index.d.ts +1 -0
- package/dist/src/components/atoms/ProgressBar/ProgressBar.d.ts +3 -0
- package/dist/src/components/atoms/ProgressBar/ProgressBar.styles.d.ts +7 -0
- package/dist/src/components/atoms/ProgressBar/ProgressBar.types.d.ts +6 -0
- package/dist/src/components/atoms/ProgressBar/index.d.ts +1 -0
- package/dist/src/components/atoms/SearchBar/index.d.ts +2 -0
- package/dist/src/components/atoms/SectionButton/SectionButton.d.ts +12 -0
- package/dist/src/components/atoms/SectionButton/desktop/SectionButton.d.ts +3 -0
- package/dist/src/components/atoms/SectionButton/desktop/SectionButton.styles.d.ts +2 -0
- package/dist/src/components/atoms/SectionButton/desktop/SectionButton.types.d.ts +37 -0
- package/dist/src/components/atoms/SectionButton/desktop/index.d.ts +2 -0
- package/dist/src/components/atoms/SectionButton/index.d.ts +1 -0
- package/dist/src/components/atoms/SectionButton/mobile/MobileSectionButton.styles.d.ts +3 -0
- package/dist/src/components/atoms/SectionButton/mobile/SectionButton.d.ts +3 -0
- package/dist/src/components/atoms/SectionButton/mobile/SectionButton.types.d.ts +37 -0
- package/dist/src/components/atoms/SectionButton/mobile/index.d.ts +2 -0
- package/dist/src/components/atoms/SelectInput/SelectInput.d.ts +1 -1
- package/dist/src/components/atoms/SelectInput/SelectInput.types.d.ts +2 -0
- package/dist/src/components/atoms/SelectInput/index.d.ts +1 -0
- package/dist/src/components/atoms/SidebarButton/SidebarButton.d.ts +13 -0
- package/dist/src/components/atoms/SidebarButton/SidebarButton.styles.d.ts +9 -0
- package/dist/src/components/atoms/SidebarButton/index.d.ts +1 -0
- package/dist/src/components/atoms/StepIndicator/StepIndicator.d.ts +5 -0
- package/dist/src/components/atoms/StepIndicator/index.d.ts +1 -0
- package/dist/src/components/atoms/Switch/Switch.d.ts +7 -0
- package/dist/src/components/atoms/Switch/index.d.ts +1 -0
- package/dist/src/components/atoms/Tab/Tab.d.ts +3 -0
- package/dist/src/components/atoms/Tab/Tab.styles.d.ts +6 -0
- package/dist/src/components/atoms/Tab/Tab.types.d.ts +11 -0
- package/dist/src/components/atoms/Tab/index.d.ts +1 -0
- package/dist/src/components/atoms/TextButton/TextButton.d.ts +4 -0
- package/dist/src/components/atoms/TextButton/TextButton.styles.d.ts +2 -0
- package/dist/src/components/atoms/TextButton/TextButton.types.d.ts +6 -0
- package/dist/src/components/atoms/TextButton/index.d.ts +1 -0
- package/dist/src/components/atoms/TextInput/TextInput.d.ts +5 -0
- package/dist/src/components/atoms/TextInput/TextInput.types.d.ts +13 -0
- package/dist/src/components/atoms/TextInput/index.d.ts +1 -0
- package/dist/src/components/atoms/TextStaticInput/TextStaticInput.d.ts +3 -0
- package/dist/src/components/atoms/TextStaticInput/TextStaticInput.types.d.ts +5 -0
- package/dist/src/components/atoms/TextStaticInput/index.d.ts +1 -0
- package/dist/src/components/atoms/ThresholdCircleProgress/ThresholdCircleProgress.d.ts +4 -0
- package/dist/src/components/atoms/ThresholdCircleProgress/ThresholdCircleProgress.types.d.ts +30 -0
- package/dist/src/components/atoms/ThresholdCircleProgress/index.d.ts +1 -0
- package/dist/src/components/atoms/ThresholdProgressBar/ThresholdProgressBar.d.ts +4 -0
- package/dist/src/components/atoms/ThresholdProgressBar/ThresholdProgressBar.types.d.ts +22 -0
- package/dist/src/components/atoms/ThresholdProgressBar/index.d.ts +1 -0
- package/dist/src/components/atoms/Toast/Toast.d.ts +20 -0
- package/dist/src/components/atoms/Toast/index.d.ts +1 -0
- package/dist/src/components/atoms/UncontrolledSelector/UncontrolledSelector.d.ts +1 -0
- package/dist/src/components/atoms/UncontrolledSelector/index.d.ts +1 -0
- package/dist/src/components/atoms/UncontrolledTextInput/UncontrolledTextInput.d.ts +4 -0
- package/dist/src/components/atoms/UncontrolledTextInput/UncontrolledTextInput.types.d.ts +14 -0
- package/dist/src/components/atoms/UncontrolledTextInput/index.d.ts +1 -0
- package/dist/src/components/atoms/UploadContainer/UploadContainer.d.ts +4 -0
- package/dist/src/components/atoms/UploadContainer/UploadContainer.types.d.ts +37 -0
- package/dist/src/components/atoms/UploadContainer/index.d.ts +1 -0
- package/dist/src/components/atoms/index.d.ts +43 -0
- package/dist/src/components/index.d.ts +3 -0
- package/dist/src/components/molecules/AlertModal/AlertModal.d.ts +3 -0
- package/dist/src/components/molecules/AlertModal/AlertModal.types.d.ts +9 -0
- package/dist/src/components/molecules/AlertModal/index.d.ts +2 -0
- package/dist/src/components/molecules/AutocompleteInput/AutocompleteInput.d.ts +3 -0
- package/dist/src/components/molecules/AutocompleteInput/AutocompleteInput.types.d.ts +28 -0
- package/dist/src/components/molecules/AutocompleteInput/index.d.ts +1 -0
- package/dist/src/components/molecules/CalendarSelector/CalendarSelector.d.ts +14 -0
- package/dist/src/components/molecules/CalendarSelector/CalendarSelector.styles.d.ts +36 -0
- package/dist/src/components/molecules/CalendarSelector/PeriodToggle.d.ts +15 -0
- package/dist/src/components/molecules/CalendarSelector/TimeDisplay.d.ts +7 -0
- package/dist/src/components/molecules/CalendarSelector/index.d.ts +1 -0
- package/dist/src/components/molecules/DateInput/DateInput.d.ts +14 -0
- package/dist/src/components/molecules/DateInput/index.d.ts +1 -0
- package/dist/src/components/molecules/DialogModal/DialogModal.d.ts +3 -0
- package/dist/src/components/molecules/DialogModal/DialogModal.types.d.ts +11 -0
- package/dist/src/components/molecules/DialogModal/index.d.ts +1 -0
- package/dist/src/components/molecules/Dropdown/Dropdown.d.ts +3 -0
- package/dist/src/components/molecules/Dropdown/Dropdown.types.d.ts +9 -0
- package/dist/src/components/molecules/Dropdown/index.d.ts +1 -0
- package/dist/src/components/molecules/EmptyState/EmptyState.d.ts +9 -0
- package/dist/src/components/molecules/EmptyState/index.d.ts +1 -0
- package/dist/src/components/molecules/FileUpload/FileUpload.d.ts +4 -0
- package/dist/src/components/molecules/FileUpload/FileUpload.types.d.ts +17 -0
- package/dist/src/components/molecules/FileUpload/index.d.ts +1 -0
- package/dist/src/components/molecules/FiltersMenu/FiltersMenu.d.ts +13 -0
- package/dist/src/components/molecules/FiltersMenu/index.d.ts +1 -0
- package/dist/src/components/molecules/FloatingMenu/FloatingMenu.d.ts +4 -0
- package/dist/src/components/molecules/FloatingMenu/FloatingMenu.types.d.ts +13 -0
- package/dist/src/components/molecules/FloatingMenu/index.d.ts +1 -0
- package/dist/src/components/molecules/IndexedStepper/IndexedStepper.d.ts +7 -0
- package/dist/src/components/molecules/IndexedStepper/index.d.ts +1 -0
- package/dist/src/components/molecules/InformationContainer/InformationContainer.d.ts +14 -0
- package/dist/src/components/molecules/InformationContainer/index.d.ts +1 -0
- package/dist/src/components/molecules/MultiSelectDropdown/MultiSelectDropdown.d.ts +24 -0
- package/dist/src/components/molecules/MultiSelectDropdown/index.d.ts +1 -0
- package/dist/src/components/molecules/PillsContainer/PillsContainer.d.ts +9 -0
- package/dist/src/components/molecules/PillsContainer/index.d.ts +1 -0
- package/dist/src/components/molecules/SearchModal/SearchModal.d.ts +4 -0
- package/dist/src/components/molecules/SearchModal/SearchModal.types.d.ts +5 -0
- package/dist/src/components/molecules/SearchModal/index.d.ts +1 -0
- package/dist/src/components/molecules/SideModal/SideModal.d.ts +4 -0
- package/dist/src/components/molecules/SideModal/SideModal.types.d.ts +11 -0
- package/dist/src/components/molecules/SideModal/index.d.ts +1 -0
- package/dist/src/components/molecules/SingleSelectDropdown/SingleSelectDropdown.d.ts +25 -0
- package/dist/src/components/molecules/SingleSelectDropdown/index.d.ts +1 -0
- package/dist/src/components/molecules/Stepper/Stepper.d.ts +3 -0
- package/dist/src/components/molecules/Stepper/Stepper.styles.d.ts +15 -0
- package/dist/src/components/molecules/Stepper/index.d.ts +1 -0
- package/dist/src/components/molecules/Tabs/Tabs.d.ts +21 -0
- package/dist/src/components/molecules/Tabs/index.d.ts +1 -0
- package/dist/src/components/molecules/Tooltip/Tooltip.d.ts +20 -0
- package/dist/src/components/molecules/Tooltip/index.d.ts +1 -0
- package/dist/src/components/molecules/UncontrolledDateInput/UncontrolledDateInput.d.ts +16 -0
- package/dist/src/components/molecules/UncontrolledDateInput/index.d.ts +1 -0
- package/dist/src/components/molecules/index.d.ts +23 -0
- package/dist/src/components/organisms/index.d.ts +1 -0
- package/dist/src/constants/countries.d.ts +30 -0
- package/dist/src/contexts/index.d.ts +1 -0
- package/dist/src/contexts/themeContext.d.ts +3 -0
- package/dist/src/hooks/index.d.ts +2 -0
- package/dist/src/hooks/useFilterToggler.d.ts +5 -0
- package/dist/src/hooks/useTheme.d.ts +1 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/lab/Laboratory.d.ts +2 -0
- package/dist/src/lab/LaboratoryLayout.d.ts +5 -0
- package/dist/src/lab/index.lab.d.ts +1 -0
- package/dist/src/providers/ThemeProvider.d.ts +7 -0
- package/dist/src/providers/index.d.ts +1 -0
- package/dist/src/themes/default.d.ts +2 -0
- package/dist/src/themes/index.d.ts +2 -0
- package/dist/src/themes/types.d.ts +6 -0
- package/dist/src/types/baseModalProps.d.ts +4 -0
- package/dist/src/types/cycles.d.ts +103 -0
- package/dist/src/types/display.d.ts +2 -0
- package/dist/src/types/fileInfo.d.ts +2 -0
- package/dist/src/types/filters.d.ts +22 -0
- package/dist/src/types/i18n.d.ts +1 -0
- package/dist/src/types/index.d.ts +10 -0
- package/dist/src/types/modal.d.ts +34 -0
- package/dist/src/types/modalType.d.ts +1 -0
- package/dist/src/types/navbarOption.d.ts +7 -0
- package/dist/src/types/sidebarOption.d.ts +7 -0
- package/dist/src/types/stepper.d.ts +23 -0
- package/dist/src/types/styleValues.d.ts +4 -0
- package/dist/src/types/toast.d.ts +29 -0
- package/dist/src/utils/cycles.d.ts +2 -0
- package/dist/src/utils/dates.d.ts +1 -0
- package/dist/src/utils/files.d.ts +8 -0
- package/dist/src/utils/images.d.ts +1 -0
- package/dist/src/utils/index.d.ts +7 -0
- package/dist/src/utils/modal.d.ts +13 -0
- package/dist/src/utils/renderContentOptions.d.ts +3 -0
- package/dist/src/utils/stepper.d.ts +2 -0
- package/dist/src/utils/strings.d.ts +2 -0
- package/dist/src/utils/toast.d.ts +15 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stepper.d.ts +23 -0
- package/dist/types/toast.d.ts +6 -3
- package/dist/utils/stepper.d.ts +2 -0
- package/dist/utils/toast.js +3 -3
- package/dist/vite-env.d.ts +1 -1
- package/dist/vite.config.d.ts +2 -0
- package/package.json +157 -157
- package/dist/components/atoms/Tooltip/Tooltip.d.ts +0 -4
- package/dist/components/atoms/Tooltip/Tooltip.js +0 -121
- package/dist/components/molecules/Stepper/Stepper.types.d.ts +0 -9
- /package/dist/components/{atoms → molecules}/Tooltip/index.d.ts +0 -0
|
@@ -1,902 +1,586 @@
|
|
|
1
1
|
import * as c from "react";
|
|
2
|
-
import { useLayoutEffect as
|
|
3
|
-
import { isMouseLikePointerType as
|
|
2
|
+
import { useLayoutEffect as De, useEffect as Se, useRef as xe } from "react";
|
|
3
|
+
import { isMouseLikePointerType as oe, getDocument as re, isTypeableElement as Te, getTarget as W, isReactEvent as ke, isRootElement as Ie, contains as se, isEventTargetWithin as q } from "./floating-ui.react.utils.js";
|
|
4
4
|
import "../../../../_virtual/jsx-runtime.js";
|
|
5
|
-
import { isElement as
|
|
5
|
+
import { isElement as M, getOverflowAncestors as Z, isHTMLElement as pe, isWebKit as Me, isLastTraversableNode as G, getParentNode as _e, getComputedStyle as Oe } from "../../utils/dist/floating-ui.utils.dom.js";
|
|
6
6
|
import "react-dom";
|
|
7
|
-
import { useFloating as
|
|
8
|
-
import { arrow as
|
|
9
|
-
const
|
|
7
|
+
import { useFloating as Ke } from "../../react-dom/dist/floating-ui.react-dom.js";
|
|
8
|
+
import { arrow as dt, flip as mt, offset as pt, shift as gt, size as vt } from "../../react-dom/dist/floating-ui.react-dom.js";
|
|
9
|
+
const ge = {
|
|
10
10
|
...c
|
|
11
|
-
},
|
|
12
|
-
function
|
|
13
|
-
const
|
|
11
|
+
}, Ae = ge.useInsertionEffect, Le = Ae || ((e) => e());
|
|
12
|
+
function F(e) {
|
|
13
|
+
const o = c.useRef(() => {
|
|
14
14
|
if (process.env.NODE_ENV !== "production")
|
|
15
15
|
throw new Error("Cannot call an event handler while rendering.");
|
|
16
16
|
});
|
|
17
|
-
return
|
|
18
|
-
|
|
17
|
+
return Le(() => {
|
|
18
|
+
o.current = e;
|
|
19
19
|
}), c.useCallback(function() {
|
|
20
|
-
for (var
|
|
20
|
+
for (var r = arguments.length, t = new Array(r), n = 0; n < r; n++)
|
|
21
21
|
t[n] = arguments[n];
|
|
22
|
-
return
|
|
22
|
+
return o.current == null ? void 0 : o.current(...t);
|
|
23
23
|
}, []);
|
|
24
24
|
}
|
|
25
|
-
var
|
|
26
|
-
let
|
|
27
|
-
const
|
|
25
|
+
var B = typeof document < "u" ? De : Se;
|
|
26
|
+
let ce = !1, Ne = 0;
|
|
27
|
+
const ie = () => (
|
|
28
28
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
29
29
|
// on <React 18
|
|
30
|
-
"floating-ui-" + Math.random().toString(36).slice(2, 6) +
|
|
30
|
+
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Ne++
|
|
31
31
|
);
|
|
32
|
-
function
|
|
33
|
-
const [e,
|
|
34
|
-
return
|
|
35
|
-
e == null &&
|
|
32
|
+
function $e() {
|
|
33
|
+
const [e, o] = c.useState(() => ce ? ie() : void 0);
|
|
34
|
+
return B(() => {
|
|
35
|
+
e == null && o(ie());
|
|
36
36
|
}, []), c.useEffect(() => {
|
|
37
|
-
|
|
37
|
+
ce = !0;
|
|
38
38
|
}, []), e;
|
|
39
39
|
}
|
|
40
|
-
const
|
|
41
|
-
let
|
|
42
|
-
process.env.NODE_ENV !== "production" && (
|
|
43
|
-
function
|
|
44
|
-
for (var e,
|
|
45
|
-
|
|
46
|
-
const n = "Floating UI: " +
|
|
47
|
-
if (!((e =
|
|
48
|
-
var
|
|
49
|
-
(
|
|
40
|
+
const Fe = ge.useId, Be = Fe || $e;
|
|
41
|
+
let z;
|
|
42
|
+
process.env.NODE_ENV !== "production" && (z = /* @__PURE__ */ new Set());
|
|
43
|
+
function He() {
|
|
44
|
+
for (var e, o = arguments.length, r = new Array(o), t = 0; t < o; t++)
|
|
45
|
+
r[t] = arguments[t];
|
|
46
|
+
const n = "Floating UI: " + r.join(" ");
|
|
47
|
+
if (!((e = z) != null && e.has(n))) {
|
|
48
|
+
var a;
|
|
49
|
+
(a = z) == null || a.add(n), console.error(n);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function Ue() {
|
|
53
53
|
const e = /* @__PURE__ */ new Map();
|
|
54
54
|
return {
|
|
55
|
-
emit(
|
|
55
|
+
emit(o, r) {
|
|
56
56
|
var t;
|
|
57
|
-
(t = e.get(
|
|
57
|
+
(t = e.get(o)) == null || t.forEach((n) => n(r));
|
|
58
58
|
},
|
|
59
|
-
on(
|
|
60
|
-
e.set(
|
|
59
|
+
on(o, r) {
|
|
60
|
+
e.set(o, [...e.get(o) || [], r]);
|
|
61
61
|
},
|
|
62
|
-
off(
|
|
62
|
+
off(o, r) {
|
|
63
63
|
var t;
|
|
64
|
-
e.set(
|
|
64
|
+
e.set(o, ((t = e.get(o)) == null ? void 0 : t.filter((n) => n !== r)) || []);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const We = /* @__PURE__ */ c.createContext(null), Ve = /* @__PURE__ */ c.createContext(null), je = () => {
|
|
69
69
|
var e;
|
|
70
|
-
return ((e = c.useContext(
|
|
71
|
-
},
|
|
72
|
-
function
|
|
70
|
+
return ((e = c.useContext(We)) == null ? void 0 : e.id) || null;
|
|
71
|
+
}, ve = () => c.useContext(Ve);
|
|
72
|
+
function Ye(e) {
|
|
73
73
|
return "data-floating-ui-" + e;
|
|
74
74
|
}
|
|
75
|
-
function A(e) {
|
|
76
|
-
e.current !== -1 && (clearTimeout(e.current), e.current = -1);
|
|
77
|
-
}
|
|
78
75
|
function j(e) {
|
|
79
|
-
const
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
}),
|
|
83
|
-
}
|
|
84
|
-
const ge = /* @__PURE__ */ fe("safe-polygon");
|
|
85
|
-
function re(e, i, o) {
|
|
86
|
-
return o && !Q(o) ? 0 : typeof e == "number" ? e : e == null ? void 0 : e[i];
|
|
76
|
+
const o = xe(e);
|
|
77
|
+
return B(() => {
|
|
78
|
+
o.current = e;
|
|
79
|
+
}), o;
|
|
87
80
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
dataRef: n,
|
|
94
|
-
events: d,
|
|
95
|
-
elements: s
|
|
96
|
-
} = e, {
|
|
97
|
-
enabled: r = !0,
|
|
98
|
-
delay: E = 0,
|
|
99
|
-
handleClose: f = null,
|
|
100
|
-
mouseOnly: R = !1,
|
|
101
|
-
restMs: y = 0,
|
|
102
|
-
move: C = !0
|
|
103
|
-
} = i, l = ae(), m = le(), u = j(f), w = j(E), P = j(o), x = c.useRef(), h = c.useRef(-1), S = c.useRef(), _ = c.useRef(-1), K = c.useRef(!0), I = c.useRef(!1), H = c.useRef(() => {
|
|
104
|
-
}), T = c.useRef(!1), B = c.useCallback(() => {
|
|
105
|
-
var v;
|
|
106
|
-
const p = (v = n.current.openEvent) == null ? void 0 : v.type;
|
|
107
|
-
return (p == null ? void 0 : p.includes("mouse")) && p !== "mousedown";
|
|
108
|
-
}, [n]);
|
|
109
|
-
c.useEffect(() => {
|
|
110
|
-
if (!r) return;
|
|
111
|
-
function v(p) {
|
|
112
|
-
let {
|
|
113
|
-
open: a
|
|
114
|
-
} = p;
|
|
115
|
-
a || (A(h), A(_), K.current = !0, T.current = !1);
|
|
116
|
-
}
|
|
117
|
-
return d.on("openchange", v), () => {
|
|
118
|
-
d.off("openchange", v);
|
|
119
|
-
};
|
|
120
|
-
}, [r, d]), c.useEffect(() => {
|
|
121
|
-
if (!r || !u.current || !o) return;
|
|
122
|
-
function v(a) {
|
|
123
|
-
B() && t(!1, a, "hover");
|
|
124
|
-
}
|
|
125
|
-
const p = X(s.floating).documentElement;
|
|
126
|
-
return p.addEventListener("mouseleave", v), () => {
|
|
127
|
-
p.removeEventListener("mouseleave", v);
|
|
128
|
-
};
|
|
129
|
-
}, [s.floating, o, t, r, u, B]);
|
|
130
|
-
const F = c.useCallback(function(v, p, a) {
|
|
131
|
-
p === void 0 && (p = !0), a === void 0 && (a = "hover");
|
|
132
|
-
const M = re(w.current, "close", x.current);
|
|
133
|
-
M && !S.current ? (A(h), h.current = window.setTimeout(() => t(!1, v, a), M)) : p && (A(h), t(!1, v, a));
|
|
134
|
-
}, [w, t]), N = V(() => {
|
|
135
|
-
H.current(), S.current = void 0;
|
|
136
|
-
}), W = V(() => {
|
|
137
|
-
if (I.current) {
|
|
138
|
-
const v = X(s.floating).body;
|
|
139
|
-
v.style.pointerEvents = "", v.removeAttribute(ge), I.current = !1;
|
|
140
|
-
}
|
|
141
|
-
}), $ = V(() => n.current.openEvent ? ["click", "mousedown"].includes(n.current.openEvent.type) : !1);
|
|
142
|
-
c.useEffect(() => {
|
|
143
|
-
if (!r) return;
|
|
144
|
-
function v(g) {
|
|
145
|
-
if (A(h), K.current = !1, R && !Q(x.current) || y > 0 && !re(w.current, "open"))
|
|
146
|
-
return;
|
|
147
|
-
const D = re(w.current, "open", x.current);
|
|
148
|
-
D ? h.current = window.setTimeout(() => {
|
|
149
|
-
P.current || t(!0, g, "hover");
|
|
150
|
-
}, D) : o || t(!0, g, "hover");
|
|
151
|
-
}
|
|
152
|
-
function p(g) {
|
|
153
|
-
if ($()) return;
|
|
154
|
-
H.current();
|
|
155
|
-
const D = X(s.floating);
|
|
156
|
-
if (A(_), T.current = !1, u.current && n.current.floatingContext) {
|
|
157
|
-
o || A(h), S.current = u.current({
|
|
158
|
-
...n.current.floatingContext,
|
|
159
|
-
tree: l,
|
|
160
|
-
x: g.clientX,
|
|
161
|
-
y: g.clientY,
|
|
162
|
-
onClose() {
|
|
163
|
-
W(), N(), $() || F(g, !0, "safe-polygon");
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
const ee = S.current;
|
|
167
|
-
D.addEventListener("mousemove", ee), H.current = () => {
|
|
168
|
-
D.removeEventListener("mousemove", ee);
|
|
169
|
-
};
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
(x.current === "touch" ? !z(s.floating, g.relatedTarget) : !0) && F(g);
|
|
173
|
-
}
|
|
174
|
-
function a(g) {
|
|
175
|
-
$() || n.current.floatingContext && (u.current == null || u.current({
|
|
176
|
-
...n.current.floatingContext,
|
|
177
|
-
tree: l,
|
|
178
|
-
x: g.clientX,
|
|
179
|
-
y: g.clientY,
|
|
180
|
-
onClose() {
|
|
181
|
-
W(), N(), $() || F(g);
|
|
182
|
-
}
|
|
183
|
-
})(g));
|
|
184
|
-
}
|
|
185
|
-
if (L(s.domReference)) {
|
|
186
|
-
var M;
|
|
187
|
-
const g = s.domReference;
|
|
188
|
-
return o && g.addEventListener("mouseleave", a), (M = s.floating) == null || M.addEventListener("mouseleave", a), C && g.addEventListener("mousemove", v, {
|
|
189
|
-
once: !0
|
|
190
|
-
}), g.addEventListener("mouseenter", v), g.addEventListener("mouseleave", p), () => {
|
|
191
|
-
var D;
|
|
192
|
-
o && g.removeEventListener("mouseleave", a), (D = s.floating) == null || D.removeEventListener("mouseleave", a), C && g.removeEventListener("mousemove", v), g.removeEventListener("mouseenter", v), g.removeEventListener("mouseleave", p);
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
}, [s, r, e, R, y, C, F, N, W, t, o, P, l, w, u, n, $]), Y(() => {
|
|
196
|
-
var v;
|
|
197
|
-
if (r && o && (v = u.current) != null && v.__options.blockPointerEvents && B()) {
|
|
198
|
-
I.current = !0;
|
|
199
|
-
const a = s.floating;
|
|
200
|
-
if (L(s.domReference) && a) {
|
|
201
|
-
var p;
|
|
202
|
-
const M = X(s.floating).body;
|
|
203
|
-
M.setAttribute(ge, "");
|
|
204
|
-
const g = s.domReference, D = l == null || (p = l.nodesRef.current.find((Z) => Z.id === m)) == null || (p = p.context) == null ? void 0 : p.elements.floating;
|
|
205
|
-
return D && (D.style.pointerEvents = ""), M.style.pointerEvents = "none", g.style.pointerEvents = "auto", a.style.pointerEvents = "auto", () => {
|
|
206
|
-
M.style.pointerEvents = "", g.style.pointerEvents = "", a.style.pointerEvents = "";
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}, [r, o, m, s, l, u, B]), Y(() => {
|
|
211
|
-
o || (x.current = void 0, T.current = !1, N(), W());
|
|
212
|
-
}, [o, N, W]), c.useEffect(() => () => {
|
|
213
|
-
N(), A(h), A(_), W();
|
|
214
|
-
}, [r, s.domReference, N, W]);
|
|
215
|
-
const b = c.useMemo(() => {
|
|
216
|
-
function v(p) {
|
|
217
|
-
x.current = p.pointerType;
|
|
218
|
-
}
|
|
219
|
-
return {
|
|
220
|
-
onPointerDown: v,
|
|
221
|
-
onPointerEnter: v,
|
|
222
|
-
onMouseMove(p) {
|
|
223
|
-
const {
|
|
224
|
-
nativeEvent: a
|
|
225
|
-
} = p;
|
|
226
|
-
function M() {
|
|
227
|
-
!K.current && !P.current && t(!0, a, "hover");
|
|
228
|
-
}
|
|
229
|
-
R && !Q(x.current) || o || y === 0 || T.current && p.movementX ** 2 + p.movementY ** 2 < 2 || (A(_), x.current === "touch" ? M() : (T.current = !0, _.current = window.setTimeout(M, y)));
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
}, [R, t, o, P, y]), k = c.useMemo(() => ({
|
|
233
|
-
onMouseEnter() {
|
|
234
|
-
A(h);
|
|
235
|
-
},
|
|
236
|
-
onMouseLeave(v) {
|
|
237
|
-
$() || F(v.nativeEvent, !1);
|
|
238
|
-
}
|
|
239
|
-
}), [F, $]);
|
|
240
|
-
return c.useMemo(() => r ? {
|
|
241
|
-
reference: b,
|
|
242
|
-
floating: k
|
|
243
|
-
} : {}, [r, b, k]);
|
|
244
|
-
}
|
|
245
|
-
function se(e, i) {
|
|
246
|
-
let o = e.filter((n) => {
|
|
247
|
-
var d;
|
|
248
|
-
return n.parentId === i && ((d = n.context) == null ? void 0 : d.open);
|
|
249
|
-
}), t = o;
|
|
81
|
+
function J(e, o) {
|
|
82
|
+
let r = e.filter((n) => {
|
|
83
|
+
var a;
|
|
84
|
+
return n.parentId === o && ((a = n.context) == null ? void 0 : a.open);
|
|
85
|
+
}), t = r;
|
|
250
86
|
for (; t.length; )
|
|
251
87
|
t = e.filter((n) => {
|
|
252
|
-
var
|
|
253
|
-
return (
|
|
254
|
-
var
|
|
255
|
-
return n.parentId ===
|
|
88
|
+
var a;
|
|
89
|
+
return (a = t) == null ? void 0 : a.some((u) => {
|
|
90
|
+
var s;
|
|
91
|
+
return n.parentId === u.id && ((s = n.context) == null ? void 0 : s.open);
|
|
256
92
|
});
|
|
257
|
-
}),
|
|
258
|
-
return
|
|
93
|
+
}), r = r.concat(t);
|
|
94
|
+
return r;
|
|
259
95
|
}
|
|
260
|
-
const
|
|
261
|
-
function
|
|
262
|
-
return
|
|
96
|
+
const Xe = "data-floating-ui-focusable";
|
|
97
|
+
function ue(e) {
|
|
98
|
+
return pe(e.target) && e.target.tagName === "BUTTON";
|
|
263
99
|
}
|
|
264
|
-
function
|
|
265
|
-
return
|
|
100
|
+
function le(e) {
|
|
101
|
+
return Te(e);
|
|
266
102
|
}
|
|
267
|
-
function
|
|
268
|
-
|
|
103
|
+
function st(e, o) {
|
|
104
|
+
o === void 0 && (o = {});
|
|
269
105
|
const {
|
|
270
|
-
open:
|
|
106
|
+
open: r,
|
|
271
107
|
onOpenChange: t,
|
|
272
108
|
dataRef: n,
|
|
273
109
|
elements: {
|
|
274
|
-
domReference:
|
|
110
|
+
domReference: a
|
|
275
111
|
}
|
|
276
112
|
} = e, {
|
|
277
|
-
enabled:
|
|
278
|
-
event:
|
|
279
|
-
toggle:
|
|
280
|
-
ignoreMouse:
|
|
281
|
-
keyboardHandlers:
|
|
282
|
-
stickIfOpen:
|
|
283
|
-
} =
|
|
284
|
-
onPointerDown(
|
|
285
|
-
|
|
113
|
+
enabled: u = !0,
|
|
114
|
+
event: s = "click",
|
|
115
|
+
toggle: p = !0,
|
|
116
|
+
ignoreMouse: l = !1,
|
|
117
|
+
keyboardHandlers: g = !0,
|
|
118
|
+
stickIfOpen: R = !0
|
|
119
|
+
} = o, E = c.useRef(), f = c.useRef(!1), b = c.useMemo(() => ({
|
|
120
|
+
onPointerDown(i) {
|
|
121
|
+
E.current = i.pointerType;
|
|
286
122
|
},
|
|
287
|
-
onMouseDown(
|
|
288
|
-
const
|
|
289
|
-
|
|
123
|
+
onMouseDown(i) {
|
|
124
|
+
const y = E.current;
|
|
125
|
+
i.button === 0 && s !== "click" && (oe(y) && l || (r && p && (!(n.current.openEvent && R) || n.current.openEvent.type === "mousedown") ? t(!1, i.nativeEvent, "click") : (i.preventDefault(), t(!0, i.nativeEvent, "click"))));
|
|
290
126
|
},
|
|
291
|
-
onClick(
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
|
|
127
|
+
onClick(i) {
|
|
128
|
+
const y = E.current;
|
|
129
|
+
if (s === "mousedown" && E.current) {
|
|
130
|
+
E.current = void 0;
|
|
295
131
|
return;
|
|
296
132
|
}
|
|
297
|
-
|
|
133
|
+
oe(y) && l || (r && p && (!(n.current.openEvent && R) || n.current.openEvent.type === "click") ? t(!1, i.nativeEvent, "click") : t(!0, i.nativeEvent, "click"));
|
|
298
134
|
},
|
|
299
|
-
onKeyDown(
|
|
300
|
-
|
|
135
|
+
onKeyDown(i) {
|
|
136
|
+
E.current = void 0, !(i.defaultPrevented || !g || ue(i)) && (i.key === " " && !le(a) && (i.preventDefault(), f.current = !0), i.key === "Enter" && t(!(r && p), i.nativeEvent, "click"));
|
|
301
137
|
},
|
|
302
|
-
onKeyUp(
|
|
303
|
-
|
|
138
|
+
onKeyUp(i) {
|
|
139
|
+
i.defaultPrevented || !g || ue(i) || le(a) || i.key === " " && f.current && (f.current = !1, t(!(r && p), i.nativeEvent, "click"));
|
|
304
140
|
}
|
|
305
|
-
}), [n,
|
|
306
|
-
return c.useMemo(() =>
|
|
307
|
-
reference:
|
|
308
|
-
} : {}, [
|
|
141
|
+
}), [n, a, s, l, g, t, r, R, p]);
|
|
142
|
+
return c.useMemo(() => u ? {
|
|
143
|
+
reference: b
|
|
144
|
+
} : {}, [u, b]);
|
|
309
145
|
}
|
|
310
|
-
const
|
|
146
|
+
const qe = {
|
|
311
147
|
pointerdown: "onPointerDown",
|
|
312
148
|
mousedown: "onMouseDown",
|
|
313
149
|
click: "onClick"
|
|
314
|
-
},
|
|
150
|
+
}, Ze = {
|
|
315
151
|
pointerdown: "onPointerDownCapture",
|
|
316
152
|
mousedown: "onMouseDownCapture",
|
|
317
153
|
click: "onClickCapture"
|
|
318
|
-
},
|
|
319
|
-
var
|
|
154
|
+
}, ae = (e) => {
|
|
155
|
+
var o, r;
|
|
320
156
|
return {
|
|
321
|
-
escapeKey: typeof e == "boolean" ? e : (
|
|
322
|
-
outsidePress: typeof e == "boolean" ? e : (
|
|
157
|
+
escapeKey: typeof e == "boolean" ? e : (o = e == null ? void 0 : e.escapeKey) != null ? o : !1,
|
|
158
|
+
outsidePress: typeof e == "boolean" ? e : (r = e == null ? void 0 : e.outsidePress) != null ? r : !0
|
|
323
159
|
};
|
|
324
160
|
};
|
|
325
|
-
function
|
|
326
|
-
|
|
161
|
+
function ct(e, o) {
|
|
162
|
+
o === void 0 && (o = {});
|
|
327
163
|
const {
|
|
328
|
-
open:
|
|
164
|
+
open: r,
|
|
329
165
|
onOpenChange: t,
|
|
330
166
|
elements: n,
|
|
331
|
-
dataRef:
|
|
167
|
+
dataRef: a
|
|
332
168
|
} = e, {
|
|
333
|
-
enabled:
|
|
334
|
-
escapeKey:
|
|
335
|
-
outsidePress:
|
|
336
|
-
outsidePressEvent:
|
|
337
|
-
referencePress:
|
|
338
|
-
referencePressEvent:
|
|
339
|
-
ancestorScroll:
|
|
340
|
-
bubbles:
|
|
341
|
-
capture:
|
|
342
|
-
} =
|
|
343
|
-
escapeKey:
|
|
169
|
+
enabled: u = !0,
|
|
170
|
+
escapeKey: s = !0,
|
|
171
|
+
outsidePress: p = !0,
|
|
172
|
+
outsidePressEvent: l = "pointerdown",
|
|
173
|
+
referencePress: g = !1,
|
|
174
|
+
referencePressEvent: R = "pointerdown",
|
|
175
|
+
ancestorScroll: E = !1,
|
|
176
|
+
bubbles: f,
|
|
177
|
+
capture: b
|
|
178
|
+
} = o, i = ve(), y = F(typeof p == "function" ? p : () => !1), h = typeof p == "function" ? y : p, T = c.useRef(!1), v = c.useRef(!1), {
|
|
179
|
+
escapeKey: I,
|
|
180
|
+
outsidePress: L
|
|
181
|
+
} = ae(f), {
|
|
182
|
+
escapeKey: A,
|
|
344
183
|
outsidePress: _
|
|
345
|
-
} =
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
} = be(m), H = c.useRef(!1), T = V((b) => {
|
|
349
|
-
var k;
|
|
350
|
-
if (!o || !s || !r || b.key !== "Escape" || H.current)
|
|
184
|
+
} = ae(b), N = c.useRef(!1), C = F((d) => {
|
|
185
|
+
var w;
|
|
186
|
+
if (!r || !u || !s || d.key !== "Escape" || N.current)
|
|
351
187
|
return;
|
|
352
|
-
const
|
|
353
|
-
if (!
|
|
354
|
-
let
|
|
355
|
-
if (
|
|
356
|
-
var
|
|
357
|
-
if ((
|
|
358
|
-
|
|
188
|
+
const k = (w = a.current.floatingContext) == null ? void 0 : w.nodeId, D = i ? J(i.nodesRef.current, k) : [];
|
|
189
|
+
if (!I && (d.stopPropagation(), D.length > 0)) {
|
|
190
|
+
let m = !0;
|
|
191
|
+
if (D.forEach((P) => {
|
|
192
|
+
var S;
|
|
193
|
+
if ((S = P.context) != null && S.open && !P.context.dataRef.current.__escapeKeyBubbles) {
|
|
194
|
+
m = !1;
|
|
359
195
|
return;
|
|
360
196
|
}
|
|
361
|
-
}), !
|
|
197
|
+
}), !m)
|
|
362
198
|
return;
|
|
363
199
|
}
|
|
364
|
-
t(!1,
|
|
365
|
-
}),
|
|
366
|
-
var
|
|
367
|
-
const
|
|
368
|
-
var
|
|
369
|
-
|
|
200
|
+
t(!1, ke(d) ? d.nativeEvent : d, "escape-key");
|
|
201
|
+
}), H = F((d) => {
|
|
202
|
+
var w;
|
|
203
|
+
const k = () => {
|
|
204
|
+
var D;
|
|
205
|
+
C(d), (D = W(d)) == null || D.removeEventListener("keydown", k);
|
|
370
206
|
};
|
|
371
|
-
(
|
|
372
|
-
}),
|
|
373
|
-
var
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
207
|
+
(w = W(d)) == null || w.addEventListener("keydown", k);
|
|
208
|
+
}), V = F((d) => {
|
|
209
|
+
var w;
|
|
210
|
+
const k = T.current;
|
|
211
|
+
T.current = !1;
|
|
212
|
+
const D = v.current;
|
|
213
|
+
if (v.current = !1, l === "click" && D || k || typeof h == "function" && !h(d))
|
|
378
214
|
return;
|
|
379
|
-
const
|
|
380
|
-
let
|
|
381
|
-
for (;
|
|
382
|
-
const
|
|
383
|
-
if (
|
|
215
|
+
const m = W(d), P = "[" + Ye("inert") + "]", S = re(n.floating).querySelectorAll(P);
|
|
216
|
+
let K = M(m) ? m : null;
|
|
217
|
+
for (; K && !G(K); ) {
|
|
218
|
+
const x = _e(K);
|
|
219
|
+
if (G(x) || !M(x))
|
|
384
220
|
break;
|
|
385
|
-
|
|
221
|
+
K = x;
|
|
386
222
|
}
|
|
387
|
-
if (
|
|
388
|
-
!
|
|
223
|
+
if (S.length && M(m) && !Ie(m) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
224
|
+
!se(m, n.floating) && // If the target root element contains none of the markers, then the
|
|
389
225
|
// element was injected after the floating element rendered.
|
|
390
|
-
Array.from(
|
|
226
|
+
Array.from(S).every((x) => !se(K, x)))
|
|
391
227
|
return;
|
|
392
|
-
if (
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
228
|
+
if (pe(m) && X) {
|
|
229
|
+
const x = G(m), O = Oe(m), U = /auto|scroll/, Re = x || U.test(O.overflowX), ye = x || U.test(O.overflowY), be = Re && m.clientWidth > 0 && m.scrollWidth > m.clientWidth, Ce = ye && m.clientHeight > 0 && m.scrollHeight > m.clientHeight, he = O.direction === "rtl", we = Ce && (he ? d.offsetX <= m.offsetWidth - m.clientWidth : d.offsetX > m.clientWidth), Pe = be && d.offsetY > m.clientHeight;
|
|
230
|
+
if (we || Pe)
|
|
395
231
|
return;
|
|
396
232
|
}
|
|
397
|
-
const
|
|
398
|
-
var
|
|
399
|
-
return
|
|
233
|
+
const te = (w = a.current.floatingContext) == null ? void 0 : w.nodeId, Ee = i && J(i.nodesRef.current, te).some((x) => {
|
|
234
|
+
var O;
|
|
235
|
+
return q(d, (O = x.context) == null ? void 0 : O.elements.floating);
|
|
400
236
|
});
|
|
401
|
-
if (
|
|
237
|
+
if (q(d, n.floating) || q(d, n.domReference) || Ee)
|
|
402
238
|
return;
|
|
403
|
-
const
|
|
404
|
-
if (
|
|
405
|
-
let
|
|
406
|
-
if (
|
|
407
|
-
var
|
|
408
|
-
if ((
|
|
409
|
-
|
|
239
|
+
const ne = i ? J(i.nodesRef.current, te) : [];
|
|
240
|
+
if (ne.length > 0) {
|
|
241
|
+
let x = !0;
|
|
242
|
+
if (ne.forEach((O) => {
|
|
243
|
+
var U;
|
|
244
|
+
if ((U = O.context) != null && U.open && !O.context.dataRef.current.__outsidePressBubbles) {
|
|
245
|
+
x = !1;
|
|
410
246
|
return;
|
|
411
247
|
}
|
|
412
|
-
}), !
|
|
248
|
+
}), !x)
|
|
413
249
|
return;
|
|
414
250
|
}
|
|
415
|
-
t(!1,
|
|
416
|
-
}),
|
|
417
|
-
var
|
|
418
|
-
const
|
|
419
|
-
var
|
|
420
|
-
|
|
251
|
+
t(!1, d, "outside-press");
|
|
252
|
+
}), Y = F((d) => {
|
|
253
|
+
var w;
|
|
254
|
+
const k = () => {
|
|
255
|
+
var D;
|
|
256
|
+
V(d), (D = W(d)) == null || D.removeEventListener(l, k);
|
|
421
257
|
};
|
|
422
|
-
(
|
|
258
|
+
(w = W(d)) == null || w.addEventListener(l, k);
|
|
423
259
|
});
|
|
424
260
|
c.useEffect(() => {
|
|
425
|
-
if (!
|
|
261
|
+
if (!r || !u)
|
|
426
262
|
return;
|
|
427
|
-
|
|
428
|
-
let
|
|
429
|
-
function
|
|
430
|
-
t(!1,
|
|
263
|
+
a.current.__escapeKeyBubbles = I, a.current.__outsidePressBubbles = L;
|
|
264
|
+
let d = -1;
|
|
265
|
+
function w(S) {
|
|
266
|
+
t(!1, S, "ancestor-scroll");
|
|
431
267
|
}
|
|
432
|
-
function
|
|
433
|
-
window.clearTimeout(
|
|
268
|
+
function k() {
|
|
269
|
+
window.clearTimeout(d), N.current = !0;
|
|
434
270
|
}
|
|
435
|
-
function
|
|
436
|
-
|
|
271
|
+
function D() {
|
|
272
|
+
d = window.setTimeout(
|
|
437
273
|
() => {
|
|
438
|
-
|
|
274
|
+
N.current = !1;
|
|
439
275
|
},
|
|
440
276
|
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
441
277
|
// Only apply to WebKit for the test to remain 0ms.
|
|
442
|
-
|
|
278
|
+
Me() ? 5 : 0
|
|
443
279
|
);
|
|
444
280
|
}
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
let
|
|
448
|
-
return
|
|
449
|
-
var
|
|
450
|
-
return
|
|
451
|
-
}),
|
|
452
|
-
|
|
281
|
+
const m = re(n.floating);
|
|
282
|
+
s && (m.addEventListener("keydown", A ? H : C, A), m.addEventListener("compositionstart", k), m.addEventListener("compositionend", D)), h && m.addEventListener(l, _ ? Y : V, _);
|
|
283
|
+
let P = [];
|
|
284
|
+
return E && (M(n.domReference) && (P = Z(n.domReference)), M(n.floating) && (P = P.concat(Z(n.floating))), !M(n.reference) && n.reference && n.reference.contextElement && (P = P.concat(Z(n.reference.contextElement)))), P = P.filter((S) => {
|
|
285
|
+
var K;
|
|
286
|
+
return S !== ((K = m.defaultView) == null ? void 0 : K.visualViewport);
|
|
287
|
+
}), P.forEach((S) => {
|
|
288
|
+
S.addEventListener("scroll", w, {
|
|
453
289
|
passive: !0
|
|
454
290
|
});
|
|
455
291
|
}), () => {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}), window.clearTimeout(
|
|
292
|
+
s && (m.removeEventListener("keydown", A ? H : C, A), m.removeEventListener("compositionstart", k), m.removeEventListener("compositionend", D)), h && m.removeEventListener(l, _ ? Y : V, _), P.forEach((S) => {
|
|
293
|
+
S.removeEventListener("scroll", w);
|
|
294
|
+
}), window.clearTimeout(d);
|
|
459
295
|
};
|
|
460
|
-
}, [
|
|
461
|
-
|
|
462
|
-
}, [
|
|
463
|
-
const
|
|
464
|
-
onKeyDown:
|
|
465
|
-
...
|
|
466
|
-
[
|
|
467
|
-
t(!1,
|
|
296
|
+
}, [a, n, s, h, l, r, t, E, u, I, L, C, A, H, V, _, Y]), c.useEffect(() => {
|
|
297
|
+
T.current = !1;
|
|
298
|
+
}, [h, l]);
|
|
299
|
+
const ee = c.useMemo(() => ({
|
|
300
|
+
onKeyDown: C,
|
|
301
|
+
...g && {
|
|
302
|
+
[qe[R]]: (d) => {
|
|
303
|
+
t(!1, d.nativeEvent, "reference-press");
|
|
468
304
|
},
|
|
469
|
-
...
|
|
470
|
-
onClick(
|
|
471
|
-
t(!1,
|
|
305
|
+
...R !== "click" && {
|
|
306
|
+
onClick(d) {
|
|
307
|
+
t(!1, d.nativeEvent, "reference-press");
|
|
472
308
|
}
|
|
473
309
|
}
|
|
474
310
|
}
|
|
475
|
-
}), [
|
|
476
|
-
onKeyDown:
|
|
311
|
+
}), [C, t, g, R]), X = c.useMemo(() => ({
|
|
312
|
+
onKeyDown: C,
|
|
477
313
|
onMouseDown() {
|
|
478
|
-
|
|
314
|
+
v.current = !0;
|
|
479
315
|
},
|
|
480
316
|
onMouseUp() {
|
|
481
|
-
|
|
317
|
+
v.current = !0;
|
|
482
318
|
},
|
|
483
|
-
[
|
|
484
|
-
|
|
485
|
-
}
|
|
486
|
-
}), [
|
|
487
|
-
return c.useMemo(() =>
|
|
488
|
-
reference:
|
|
489
|
-
floating:
|
|
490
|
-
} : {}, [
|
|
319
|
+
[Ze[l]]: () => {
|
|
320
|
+
T.current = !0;
|
|
321
|
+
}
|
|
322
|
+
}), [C, l]);
|
|
323
|
+
return c.useMemo(() => u ? {
|
|
324
|
+
reference: ee,
|
|
325
|
+
floating: X
|
|
326
|
+
} : {}, [u, ee, X]);
|
|
491
327
|
}
|
|
492
|
-
function
|
|
328
|
+
function Ge(e) {
|
|
493
329
|
const {
|
|
494
|
-
open:
|
|
495
|
-
onOpenChange:
|
|
330
|
+
open: o = !1,
|
|
331
|
+
onOpenChange: r,
|
|
496
332
|
elements: t
|
|
497
|
-
} = e, n =
|
|
333
|
+
} = e, n = Be(), a = c.useRef({}), [u] = c.useState(() => Ue()), s = je() != null;
|
|
498
334
|
if (process.env.NODE_ENV !== "production") {
|
|
499
|
-
const
|
|
500
|
-
|
|
335
|
+
const f = t.reference;
|
|
336
|
+
f && !M(f) && He("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
501
337
|
}
|
|
502
|
-
const [
|
|
503
|
-
|
|
504
|
-
open:
|
|
505
|
-
event:
|
|
506
|
-
reason:
|
|
507
|
-
nested:
|
|
508
|
-
}),
|
|
509
|
-
}),
|
|
510
|
-
setPositionReference:
|
|
511
|
-
}), []),
|
|
512
|
-
reference:
|
|
338
|
+
const [p, l] = c.useState(t.reference), g = F((f, b, i) => {
|
|
339
|
+
a.current.openEvent = f ? b : void 0, u.emit("openchange", {
|
|
340
|
+
open: f,
|
|
341
|
+
event: b,
|
|
342
|
+
reason: i,
|
|
343
|
+
nested: s
|
|
344
|
+
}), r == null || r(f, b, i);
|
|
345
|
+
}), R = c.useMemo(() => ({
|
|
346
|
+
setPositionReference: l
|
|
347
|
+
}), []), E = c.useMemo(() => ({
|
|
348
|
+
reference: p || t.reference || null,
|
|
513
349
|
floating: t.floating || null,
|
|
514
350
|
domReference: t.reference
|
|
515
|
-
}), [
|
|
351
|
+
}), [p, t.reference, t.floating]);
|
|
516
352
|
return c.useMemo(() => ({
|
|
517
|
-
dataRef:
|
|
518
|
-
open:
|
|
519
|
-
onOpenChange:
|
|
520
|
-
elements:
|
|
521
|
-
events:
|
|
353
|
+
dataRef: a,
|
|
354
|
+
open: o,
|
|
355
|
+
onOpenChange: g,
|
|
356
|
+
elements: E,
|
|
357
|
+
events: u,
|
|
522
358
|
floatingId: n,
|
|
523
|
-
refs:
|
|
524
|
-
}), [
|
|
359
|
+
refs: R
|
|
360
|
+
}), [o, g, E, u, n, R]);
|
|
525
361
|
}
|
|
526
|
-
function
|
|
362
|
+
function it(e) {
|
|
527
363
|
e === void 0 && (e = {});
|
|
528
364
|
const {
|
|
529
|
-
nodeId:
|
|
530
|
-
} = e,
|
|
365
|
+
nodeId: o
|
|
366
|
+
} = e, r = Ge({
|
|
531
367
|
...e,
|
|
532
368
|
elements: {
|
|
533
369
|
reference: null,
|
|
534
370
|
floating: null,
|
|
535
371
|
...e.elements
|
|
536
372
|
}
|
|
537
|
-
}), t = e.rootContext ||
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
}, [
|
|
541
|
-
const
|
|
373
|
+
}), t = e.rootContext || r, n = t.elements, [a, u] = c.useState(null), [s, p] = c.useState(null), g = (n == null ? void 0 : n.domReference) || a, R = c.useRef(null), E = ve();
|
|
374
|
+
B(() => {
|
|
375
|
+
g && (R.current = g);
|
|
376
|
+
}, [g]);
|
|
377
|
+
const f = Ke({
|
|
542
378
|
...e,
|
|
543
379
|
elements: {
|
|
544
380
|
...n,
|
|
545
|
-
...
|
|
546
|
-
reference:
|
|
381
|
+
...s && {
|
|
382
|
+
reference: s
|
|
547
383
|
}
|
|
548
384
|
}
|
|
549
|
-
}),
|
|
550
|
-
const
|
|
551
|
-
getBoundingClientRect: () =>
|
|
552
|
-
contextElement:
|
|
553
|
-
} :
|
|
554
|
-
|
|
555
|
-
}, [
|
|
556
|
-
(
|
|
385
|
+
}), b = c.useCallback((v) => {
|
|
386
|
+
const I = M(v) ? {
|
|
387
|
+
getBoundingClientRect: () => v.getBoundingClientRect(),
|
|
388
|
+
contextElement: v
|
|
389
|
+
} : v;
|
|
390
|
+
p(I), f.refs.setReference(I);
|
|
391
|
+
}, [f.refs]), i = c.useCallback((v) => {
|
|
392
|
+
(M(v) || v === null) && (R.current = v, u(v)), (M(f.refs.reference.current) || f.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
557
393
|
// `null` to support `positionReference` + an unstable `reference`
|
|
558
394
|
// callback ref.
|
|
559
|
-
|
|
560
|
-
}, [
|
|
561
|
-
...
|
|
562
|
-
setReference:
|
|
563
|
-
setPositionReference:
|
|
564
|
-
domReference: y
|
|
565
|
-
}), [l.refs, u, m]), P = c.useMemo(() => ({
|
|
566
|
-
...l.elements,
|
|
395
|
+
v !== null && !M(v)) && f.refs.setReference(v);
|
|
396
|
+
}, [f.refs]), y = c.useMemo(() => ({
|
|
397
|
+
...f.refs,
|
|
398
|
+
setReference: i,
|
|
399
|
+
setPositionReference: b,
|
|
567
400
|
domReference: R
|
|
568
|
-
}), [
|
|
569
|
-
...
|
|
401
|
+
}), [f.refs, i, b]), h = c.useMemo(() => ({
|
|
402
|
+
...f.elements,
|
|
403
|
+
domReference: g
|
|
404
|
+
}), [f.elements, g]), T = c.useMemo(() => ({
|
|
405
|
+
...f,
|
|
570
406
|
...t,
|
|
571
|
-
refs:
|
|
572
|
-
elements:
|
|
573
|
-
nodeId:
|
|
574
|
-
}), [
|
|
575
|
-
return
|
|
576
|
-
t.dataRef.current.floatingContext =
|
|
577
|
-
const
|
|
578
|
-
|
|
407
|
+
refs: y,
|
|
408
|
+
elements: h,
|
|
409
|
+
nodeId: o
|
|
410
|
+
}), [f, y, h, o, t]);
|
|
411
|
+
return B(() => {
|
|
412
|
+
t.dataRef.current.floatingContext = T;
|
|
413
|
+
const v = E == null ? void 0 : E.nodesRef.current.find((I) => I.id === o);
|
|
414
|
+
v && (v.context = T);
|
|
579
415
|
}), c.useMemo(() => ({
|
|
580
|
-
...
|
|
581
|
-
context:
|
|
582
|
-
refs:
|
|
583
|
-
elements:
|
|
584
|
-
}), [
|
|
416
|
+
...f,
|
|
417
|
+
context: T,
|
|
418
|
+
refs: y,
|
|
419
|
+
elements: h
|
|
420
|
+
}), [f, y, h, T]);
|
|
585
421
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
const
|
|
589
|
-
|
|
590
|
-
onOpenChange: t,
|
|
591
|
-
events: n,
|
|
592
|
-
dataRef: d,
|
|
593
|
-
elements: s
|
|
594
|
-
} = e, {
|
|
595
|
-
enabled: r = !0,
|
|
596
|
-
visibleOnly: E = !0
|
|
597
|
-
} = i, f = c.useRef(!1), R = c.useRef(-1), y = c.useRef(!0);
|
|
598
|
-
c.useEffect(() => {
|
|
599
|
-
if (!r) return;
|
|
600
|
-
const l = Be(s.domReference);
|
|
601
|
-
function m() {
|
|
602
|
-
!o && ue(s.domReference) && s.domReference === me(X(s.domReference)) && (f.current = !0);
|
|
603
|
-
}
|
|
604
|
-
function u() {
|
|
605
|
-
y.current = !0;
|
|
606
|
-
}
|
|
607
|
-
return l.addEventListener("blur", m), l.addEventListener("keydown", u, !0), () => {
|
|
608
|
-
l.removeEventListener("blur", m), l.removeEventListener("keydown", u, !0);
|
|
609
|
-
};
|
|
610
|
-
}, [s.domReference, o, r]), c.useEffect(() => {
|
|
611
|
-
if (!r) return;
|
|
612
|
-
function l(m) {
|
|
613
|
-
let {
|
|
614
|
-
reason: u
|
|
615
|
-
} = m;
|
|
616
|
-
(u === "reference-press" || u === "escape-key") && (f.current = !0);
|
|
617
|
-
}
|
|
618
|
-
return n.on("openchange", l), () => {
|
|
619
|
-
n.off("openchange", l);
|
|
620
|
-
};
|
|
621
|
-
}, [n, r]), c.useEffect(() => () => {
|
|
622
|
-
A(R);
|
|
623
|
-
}, []);
|
|
624
|
-
const C = c.useMemo(() => ({
|
|
625
|
-
onPointerDown(l) {
|
|
626
|
-
Ne(l.nativeEvent) || (y.current = !1);
|
|
627
|
-
},
|
|
628
|
-
onMouseLeave() {
|
|
629
|
-
f.current = !1;
|
|
630
|
-
},
|
|
631
|
-
onFocus(l) {
|
|
632
|
-
if (f.current) return;
|
|
633
|
-
const m = G(l.nativeEvent);
|
|
634
|
-
if (E && L(m))
|
|
635
|
-
try {
|
|
636
|
-
if (Ke() && Fe()) throw Error();
|
|
637
|
-
if (!m.matches(":focus-visible")) return;
|
|
638
|
-
} catch {
|
|
639
|
-
if (!y.current && !we(m))
|
|
640
|
-
return;
|
|
641
|
-
}
|
|
642
|
-
t(!0, l.nativeEvent, "focus");
|
|
643
|
-
},
|
|
644
|
-
onBlur(l) {
|
|
645
|
-
f.current = !1;
|
|
646
|
-
const m = l.relatedTarget, u = l.nativeEvent, w = L(m) && m.hasAttribute(fe("focus-guard")) && m.getAttribute("data-type") === "outside";
|
|
647
|
-
R.current = window.setTimeout(() => {
|
|
648
|
-
var P;
|
|
649
|
-
const x = me(s.domReference ? s.domReference.ownerDocument : document);
|
|
650
|
-
!m && x === s.domReference || z((P = d.current.floatingContext) == null ? void 0 : P.refs.floating.current, x) || z(s.domReference, x) || w || t(!1, u, "focus");
|
|
651
|
-
});
|
|
652
|
-
}
|
|
653
|
-
}), [d, s.domReference, t, E]);
|
|
654
|
-
return c.useMemo(() => r ? {
|
|
655
|
-
reference: C
|
|
656
|
-
} : {}, [r, C]);
|
|
657
|
-
}
|
|
658
|
-
const ye = "active", he = "selected";
|
|
659
|
-
function ce(e, i, o) {
|
|
660
|
-
const t = /* @__PURE__ */ new Map(), n = o === "item";
|
|
661
|
-
let d = e;
|
|
422
|
+
const fe = "active", de = "selected";
|
|
423
|
+
function Q(e, o, r) {
|
|
424
|
+
const t = /* @__PURE__ */ new Map(), n = r === "item";
|
|
425
|
+
let a = e;
|
|
662
426
|
if (n && e) {
|
|
663
427
|
const {
|
|
664
|
-
[
|
|
665
|
-
[
|
|
666
|
-
...
|
|
428
|
+
[fe]: u,
|
|
429
|
+
[de]: s,
|
|
430
|
+
...p
|
|
667
431
|
} = e;
|
|
668
|
-
|
|
432
|
+
a = p;
|
|
669
433
|
}
|
|
670
434
|
return {
|
|
671
|
-
...
|
|
435
|
+
...r === "floating" && {
|
|
672
436
|
tabIndex: -1,
|
|
673
|
-
[
|
|
437
|
+
[Xe]: ""
|
|
674
438
|
},
|
|
675
|
-
...
|
|
676
|
-
...
|
|
677
|
-
const
|
|
678
|
-
return typeof
|
|
679
|
-
}).concat(e).reduce((
|
|
680
|
-
let [
|
|
681
|
-
if (!(n && [
|
|
682
|
-
if (
|
|
683
|
-
if (t.has(
|
|
684
|
-
var
|
|
685
|
-
(
|
|
686
|
-
for (var
|
|
687
|
-
|
|
688
|
-
return (
|
|
439
|
+
...a,
|
|
440
|
+
...o.map((u) => {
|
|
441
|
+
const s = u ? u[r] : null;
|
|
442
|
+
return typeof s == "function" ? e ? s(e) : null : s;
|
|
443
|
+
}).concat(e).reduce((u, s) => (s && Object.entries(s).forEach((p) => {
|
|
444
|
+
let [l, g] = p;
|
|
445
|
+
if (!(n && [fe, de].includes(l)))
|
|
446
|
+
if (l.indexOf("on") === 0) {
|
|
447
|
+
if (t.has(l) || t.set(l, []), typeof g == "function") {
|
|
448
|
+
var R;
|
|
449
|
+
(R = t.get(l)) == null || R.push(g), u[l] = function() {
|
|
450
|
+
for (var E, f = arguments.length, b = new Array(f), i = 0; i < f; i++)
|
|
451
|
+
b[i] = arguments[i];
|
|
452
|
+
return (E = t.get(l)) == null ? void 0 : E.map((y) => y(...b)).find((y) => y !== void 0);
|
|
689
453
|
};
|
|
690
454
|
}
|
|
691
455
|
} else
|
|
692
|
-
|
|
693
|
-
}),
|
|
456
|
+
u[l] = g;
|
|
457
|
+
}), u), {})
|
|
694
458
|
};
|
|
695
459
|
}
|
|
696
|
-
function
|
|
460
|
+
function ut(e) {
|
|
697
461
|
e === void 0 && (e = []);
|
|
698
|
-
const
|
|
699
|
-
(
|
|
700
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
701
|
-
i
|
|
702
|
-
), d = c.useCallback(
|
|
703
|
-
(r) => ce(r, e, "floating"),
|
|
462
|
+
const o = e.map((s) => s == null ? void 0 : s.reference), r = e.map((s) => s == null ? void 0 : s.floating), t = e.map((s) => s == null ? void 0 : s.item), n = c.useCallback(
|
|
463
|
+
(s) => Q(s, e, "reference"),
|
|
704
464
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
705
465
|
o
|
|
706
|
-
),
|
|
707
|
-
(
|
|
466
|
+
), a = c.useCallback(
|
|
467
|
+
(s) => Q(s, e, "floating"),
|
|
468
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
469
|
+
r
|
|
470
|
+
), u = c.useCallback(
|
|
471
|
+
(s) => Q(s, e, "item"),
|
|
708
472
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
709
473
|
t
|
|
710
474
|
);
|
|
711
475
|
return c.useMemo(() => ({
|
|
712
476
|
getReferenceProps: n,
|
|
713
|
-
getFloatingProps:
|
|
714
|
-
getItemProps:
|
|
715
|
-
}), [n,
|
|
477
|
+
getFloatingProps: a,
|
|
478
|
+
getItemProps: u
|
|
479
|
+
}), [n, a, u]);
|
|
716
480
|
}
|
|
717
|
-
const
|
|
718
|
-
function
|
|
719
|
-
|
|
720
|
-
i === void 0 && (i = {});
|
|
721
|
-
const {
|
|
722
|
-
open: t,
|
|
723
|
-
floatingId: n
|
|
724
|
-
} = e, {
|
|
725
|
-
enabled: d = !0,
|
|
726
|
-
role: s = "dialog"
|
|
727
|
-
} = i, r = (o = st.get(s)) != null ? o : s, E = Pe(), R = le() != null, y = c.useMemo(() => r === "tooltip" || s === "label" ? {
|
|
728
|
-
["aria-" + (s === "label" ? "labelledby" : "describedby")]: t ? n : void 0
|
|
729
|
-
} : {
|
|
730
|
-
"aria-expanded": t ? "true" : "false",
|
|
731
|
-
"aria-haspopup": r === "alertdialog" ? "dialog" : r,
|
|
732
|
-
"aria-controls": t ? n : void 0,
|
|
733
|
-
...r === "listbox" && {
|
|
734
|
-
role: "combobox"
|
|
735
|
-
},
|
|
736
|
-
...r === "menu" && {
|
|
737
|
-
id: E
|
|
738
|
-
},
|
|
739
|
-
...r === "menu" && R && {
|
|
740
|
-
role: "menuitem"
|
|
741
|
-
},
|
|
742
|
-
...s === "select" && {
|
|
743
|
-
"aria-autocomplete": "none"
|
|
744
|
-
},
|
|
745
|
-
...s === "combobox" && {
|
|
746
|
-
"aria-autocomplete": "list"
|
|
747
|
-
}
|
|
748
|
-
}, [r, n, R, t, E, s]), C = c.useMemo(() => {
|
|
749
|
-
const m = {
|
|
750
|
-
id: n,
|
|
751
|
-
...r && {
|
|
752
|
-
role: r
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
return r === "tooltip" || s === "label" ? m : {
|
|
756
|
-
...m,
|
|
757
|
-
...r === "menu" && {
|
|
758
|
-
"aria-labelledby": E
|
|
759
|
-
}
|
|
760
|
-
};
|
|
761
|
-
}, [r, n, E, s]), l = c.useCallback((m) => {
|
|
762
|
-
let {
|
|
763
|
-
active: u,
|
|
764
|
-
selected: w
|
|
765
|
-
} = m;
|
|
766
|
-
const P = {
|
|
767
|
-
role: "option",
|
|
768
|
-
...u && {
|
|
769
|
-
id: n + "-option"
|
|
770
|
-
}
|
|
771
|
-
};
|
|
772
|
-
switch (s) {
|
|
773
|
-
case "select":
|
|
774
|
-
return {
|
|
775
|
-
...P,
|
|
776
|
-
"aria-selected": u && w
|
|
777
|
-
};
|
|
778
|
-
case "combobox":
|
|
779
|
-
return {
|
|
780
|
-
...P,
|
|
781
|
-
...u && {
|
|
782
|
-
"aria-selected": !0
|
|
783
|
-
}
|
|
784
|
-
};
|
|
785
|
-
}
|
|
786
|
-
return {};
|
|
787
|
-
}, [n, s]);
|
|
788
|
-
return c.useMemo(() => d ? {
|
|
789
|
-
reference: y,
|
|
790
|
-
floating: C,
|
|
791
|
-
item: l
|
|
792
|
-
} : {}, [d, y, C, l]);
|
|
481
|
+
const me = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (o, r) => (r ? "-" : "") + o.toLowerCase());
|
|
482
|
+
function $(e, o) {
|
|
483
|
+
return typeof e == "function" ? e(o) : e;
|
|
793
484
|
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
return
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
const [o, t] = c.useState(e);
|
|
800
|
-
return e && !o && t(!0), c.useEffect(() => {
|
|
801
|
-
if (!e && o) {
|
|
802
|
-
const n = setTimeout(() => t(!1), i);
|
|
485
|
+
function Je(e, o) {
|
|
486
|
+
const [r, t] = c.useState(e);
|
|
487
|
+
return e && !r && t(!0), c.useEffect(() => {
|
|
488
|
+
if (!e && r) {
|
|
489
|
+
const n = setTimeout(() => t(!1), o);
|
|
803
490
|
return () => clearTimeout(n);
|
|
804
491
|
}
|
|
805
|
-
}, [e,
|
|
492
|
+
}, [e, r, o]), r;
|
|
806
493
|
}
|
|
807
|
-
function
|
|
808
|
-
|
|
494
|
+
function Qe(e, o) {
|
|
495
|
+
o === void 0 && (o = {});
|
|
809
496
|
const {
|
|
810
|
-
open:
|
|
497
|
+
open: r,
|
|
811
498
|
elements: {
|
|
812
499
|
floating: t
|
|
813
500
|
}
|
|
814
501
|
} = e, {
|
|
815
502
|
duration: n = 250
|
|
816
|
-
} =
|
|
817
|
-
return !
|
|
503
|
+
} = o, u = (typeof n == "number" ? n : n.close) || 0, [s, p] = c.useState("unmounted"), l = Je(r, u);
|
|
504
|
+
return !l && s === "close" && p("unmounted"), B(() => {
|
|
818
505
|
if (t) {
|
|
819
|
-
if (
|
|
820
|
-
|
|
821
|
-
const
|
|
822
|
-
|
|
506
|
+
if (r) {
|
|
507
|
+
p("initial");
|
|
508
|
+
const g = requestAnimationFrame(() => {
|
|
509
|
+
p("open");
|
|
823
510
|
});
|
|
824
511
|
return () => {
|
|
825
|
-
cancelAnimationFrame(
|
|
512
|
+
cancelAnimationFrame(g);
|
|
826
513
|
};
|
|
827
514
|
}
|
|
828
|
-
|
|
515
|
+
p("close");
|
|
829
516
|
}
|
|
830
|
-
}, [
|
|
831
|
-
isMounted:
|
|
832
|
-
status:
|
|
517
|
+
}, [r, t]), {
|
|
518
|
+
isMounted: l,
|
|
519
|
+
status: s
|
|
833
520
|
};
|
|
834
521
|
}
|
|
835
|
-
function
|
|
836
|
-
|
|
522
|
+
function lt(e, o) {
|
|
523
|
+
o === void 0 && (o = {});
|
|
837
524
|
const {
|
|
838
|
-
initial:
|
|
525
|
+
initial: r = {
|
|
839
526
|
opacity: 0
|
|
840
527
|
},
|
|
841
528
|
open: t,
|
|
842
529
|
close: n,
|
|
843
|
-
common:
|
|
844
|
-
duration:
|
|
845
|
-
} =
|
|
846
|
-
side:
|
|
847
|
-
placement:
|
|
848
|
-
}), [
|
|
849
|
-
|
|
850
|
-
|
|
530
|
+
common: a,
|
|
531
|
+
duration: u = 250
|
|
532
|
+
} = o, s = e.placement, p = s.split("-")[0], l = c.useMemo(() => ({
|
|
533
|
+
side: p,
|
|
534
|
+
placement: s
|
|
535
|
+
}), [p, s]), g = typeof u == "number", R = (g ? u : u.open) || 0, E = (g ? u : u.close) || 0, [f, b] = c.useState(() => ({
|
|
536
|
+
...$(a, l),
|
|
537
|
+
...$(r, l)
|
|
851
538
|
})), {
|
|
852
|
-
isMounted:
|
|
853
|
-
status:
|
|
854
|
-
} =
|
|
855
|
-
duration:
|
|
856
|
-
}),
|
|
857
|
-
return
|
|
858
|
-
const
|
|
859
|
-
if (
|
|
860
|
-
transitionProperty:
|
|
861
|
-
...
|
|
862
|
-
...
|
|
863
|
-
})),
|
|
864
|
-
transitionProperty: Object.keys(
|
|
865
|
-
transitionDuration:
|
|
866
|
-
...
|
|
867
|
-
...
|
|
868
|
-
}),
|
|
869
|
-
const
|
|
870
|
-
|
|
871
|
-
transitionProperty: Object.keys(
|
|
872
|
-
transitionDuration:
|
|
873
|
-
...
|
|
874
|
-
...
|
|
539
|
+
isMounted: i,
|
|
540
|
+
status: y
|
|
541
|
+
} = Qe(e, {
|
|
542
|
+
duration: u
|
|
543
|
+
}), h = j(r), T = j(t), v = j(n), I = j(a);
|
|
544
|
+
return B(() => {
|
|
545
|
+
const L = $(h.current, l), A = $(v.current, l), _ = $(I.current, l), N = $(T.current, l) || Object.keys(L).reduce((C, H) => (C[H] = "", C), {});
|
|
546
|
+
if (y === "initial" && b((C) => ({
|
|
547
|
+
transitionProperty: C.transitionProperty,
|
|
548
|
+
..._,
|
|
549
|
+
...L
|
|
550
|
+
})), y === "open" && b({
|
|
551
|
+
transitionProperty: Object.keys(N).map(me).join(","),
|
|
552
|
+
transitionDuration: R + "ms",
|
|
553
|
+
..._,
|
|
554
|
+
...N
|
|
555
|
+
}), y === "close") {
|
|
556
|
+
const C = A || L;
|
|
557
|
+
b({
|
|
558
|
+
transitionProperty: Object.keys(C).map(me).join(","),
|
|
559
|
+
transitionDuration: E + "ms",
|
|
560
|
+
..._,
|
|
561
|
+
...C
|
|
875
562
|
});
|
|
876
563
|
}
|
|
877
|
-
}, [
|
|
878
|
-
isMounted:
|
|
879
|
-
styles:
|
|
564
|
+
}, [E, v, h, T, I, R, y, l]), {
|
|
565
|
+
isMounted: i,
|
|
566
|
+
styles: f
|
|
880
567
|
};
|
|
881
568
|
}
|
|
882
569
|
export {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
yt as useRole,
|
|
900
|
-
it as useTransitionStatus,
|
|
901
|
-
ht as useTransitionStyles
|
|
570
|
+
dt as arrow,
|
|
571
|
+
mt as flip,
|
|
572
|
+
Z as getOverflowAncestors,
|
|
573
|
+
pt as offset,
|
|
574
|
+
gt as shift,
|
|
575
|
+
vt as size,
|
|
576
|
+
st as useClick,
|
|
577
|
+
ct as useDismiss,
|
|
578
|
+
it as useFloating,
|
|
579
|
+
je as useFloatingParentNodeId,
|
|
580
|
+
Ge as useFloatingRootContext,
|
|
581
|
+
ve as useFloatingTree,
|
|
582
|
+
Be as useId,
|
|
583
|
+
ut as useInteractions,
|
|
584
|
+
Qe as useTransitionStatus,
|
|
585
|
+
lt as useTransitionStyles
|
|
902
586
|
};
|