@servicetitan/anvil2 1.30.0 → 1.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/{Alert-DQbOVF2P-CWBL0dB1.js → Alert-BW0jYz7s-C_bALro8.js} +6 -7
- package/dist/{Alert-DQbOVF2P-CWBL0dB1.js.map → Alert-BW0jYz7s-C_bALro8.js.map} +1 -1
- package/dist/{Alert-Cbv8tBx5.js → Alert-KVBpZzAt.js} +2 -2
- package/dist/{Alert-Cbv8tBx5.js.map → Alert-KVBpZzAt.js.map} +1 -1
- package/dist/Alert.js +1 -1
- package/dist/{Announcement-BaytX5oD.js → Announcement-DnaX0j_E.js} +5 -6
- package/dist/{Announcement-BaytX5oD.js.map → Announcement-DnaX0j_E.js.map} +1 -1
- package/dist/Announcement.js +1 -1
- package/dist/{AnvilProvider-H7GLsTTs.js → AnvilProvider-2uSjX-jw.js} +2 -2
- package/dist/{AnvilProvider-H7GLsTTs.js.map → AnvilProvider-2uSjX-jw.js.map} +1 -1
- package/dist/AnvilProvider.js +1 -1
- package/dist/{Avatar-D7OvWjMn.js → Avatar-DrQgvGgD.js} +5 -5
- package/dist/Avatar-DrQgvGgD.js.map +1 -0
- package/dist/Avatar.js +1 -1
- package/dist/{Badge-CQ4Ha9_F.js → Badge-Lt1iCyYK.js} +2 -2
- package/dist/{Badge-CQ4Ha9_F.js.map → Badge-Lt1iCyYK.js.map} +1 -1
- package/dist/Badge.js +1 -1
- package/dist/{Breadcrumbs-C22dKJ0j.js → Breadcrumbs-DicsW4mk.js} +5 -5
- package/dist/{Breadcrumbs-C22dKJ0j.js.map → Breadcrumbs-DicsW4mk.js.map} +1 -1
- package/dist/Breadcrumbs.js +1 -1
- package/dist/{Button-CDE1Yn-v.js → Button-CRGbkHTO.js} +2 -2
- package/dist/{Button-CDE1Yn-v.js.map → Button-CRGbkHTO.js.map} +1 -1
- package/dist/{Button-d6MSiD0q-Cu4AHmR0.js → Button-CpDA5JHI-DOaf7xjY.js} +6 -6
- package/dist/Button-CpDA5JHI-DOaf7xjY.js.map +1 -0
- package/dist/Button.js +1 -1
- package/dist/{Button.module-mMu6tAX3-mMu6tAX3.js → Button.module-BdSA8wlr-BdSA8wlr.js} +2 -6
- package/dist/Button.module-BdSA8wlr-BdSA8wlr.js.map +1 -0
- package/dist/{ButtonCompound-DBnxT5Qg-BeCgteJh.js → ButtonCompound-DbOF1Uyo-D4_cdbXr.js} +3 -3
- package/dist/{ButtonCompound-DBnxT5Qg-BeCgteJh.js.map → ButtonCompound-DbOF1Uyo-D4_cdbXr.js.map} +1 -1
- package/dist/{ButtonCompound-BBWz8boD.js → ButtonCompound-Dq-3iCqQ.js} +2 -2
- package/dist/{ButtonCompound-BBWz8boD.js.map → ButtonCompound-Dq-3iCqQ.js.map} +1 -1
- package/dist/ButtonCompound.js +1 -1
- package/dist/{ButtonLink-CDRjX8oW.js → ButtonLink-B1b4NVwl.js} +2 -2
- package/dist/{ButtonLink-CDRjX8oW.js.map → ButtonLink-B1b4NVwl.js.map} +1 -1
- package/dist/ButtonLink.js +1 -1
- package/dist/{ButtonToggle-NM3o2ytz.js → ButtonToggle-BdIwMXdH.js} +2 -2
- package/dist/{ButtonToggle-NM3o2ytz.js.map → ButtonToggle-BdIwMXdH.js.map} +1 -1
- package/dist/{ButtonToggle-lErSF3Pv-BgLkejfC.js → ButtonToggle-D5b-K9BR-g1A3w7M3.js} +6 -6
- package/dist/{ButtonToggle-lErSF3Pv-BgLkejfC.js.map → ButtonToggle-D5b-K9BR-g1A3w7M3.js.map} +1 -1
- package/dist/ButtonToggle.js +1 -1
- package/dist/{Calendar-B25CTzF_.js → Calendar-CqEPLYlk.js} +2 -2
- package/dist/{Calendar-B25CTzF_.js.map → Calendar-CqEPLYlk.js.map} +1 -1
- package/dist/{Calendar-CP8UPUg1-yIJxH8G4.js → Calendar-DGlqu1W3-Bi5Q7PZR.js} +22 -26
- package/dist/{Calendar-CP8UPUg1-yIJxH8G4.js.map → Calendar-DGlqu1W3-Bi5Q7PZR.js.map} +1 -1
- package/dist/Calendar.js +1 -1
- package/dist/{Card-D5Tu7fxP.js → Card-D-ntWPsN.js} +2 -2
- package/dist/{Card-D5Tu7fxP.js.map → Card-D-ntWPsN.js.map} +1 -1
- package/dist/{Card-BMCXcu4G-1lTzfu7j.js → Card-DukbBYaA-JN-eYW_v.js} +3 -3
- package/dist/{Card-BMCXcu4G-1lTzfu7j.js.map → Card-DukbBYaA-JN-eYW_v.js.map} +1 -1
- package/dist/Card.js +1 -1
- package/dist/{Checkbox-CL5hvL2A-DqrkDLRn.js → Checkbox-B1OkhWY6-DAwwh6to.js} +7 -7
- package/dist/Checkbox-B1OkhWY6-DAwwh6to.js.map +1 -0
- package/dist/{Checkbox-7blvrf_a.js → Checkbox-K1ZrRTEZ.js} +2 -2
- package/dist/{Checkbox-7blvrf_a.js.map → Checkbox-K1ZrRTEZ.js.map} +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/{Checkbox.module-DMrZNVpb-DL8zOKBQ.js → Checkbox.module-DMrZNVpb-DOdjd86H.js} +2 -2
- package/dist/{Checkbox.module-DMrZNVpb-DL8zOKBQ.js.map → Checkbox.module-DMrZNVpb-DOdjd86H.js.map} +1 -1
- package/dist/{Chip-DVIhldss-BFNWyxbZ.js → Chip-BQOzhPQv-DdLdgSqD.js} +7 -9
- package/dist/Chip-BQOzhPQv-DdLdgSqD.js.map +1 -0
- package/dist/{Chip-hM1s-8Zy.js → Chip-DmGfVz7J.js} +9 -5
- package/dist/Chip-DmGfVz7J.js.map +1 -0
- package/dist/Chip.js +1 -1
- package/dist/{Combobox-DB-iA60L.js → Combobox-DLxPUWuK.js} +119 -135
- package/dist/Combobox-DLxPUWuK.js.map +1 -0
- package/dist/Combobox.js +1 -1
- package/dist/{DateField-Be6t2RVY.js → DateField-BwrvVq3b.js} +63 -41
- package/dist/DateField-BwrvVq3b.js.map +1 -0
- package/dist/DateField.js +1 -1
- package/dist/{Details-CSkJPqp0.js → Details-CtCidzce.js} +8 -8
- package/dist/Details-CtCidzce.js.map +1 -0
- package/dist/Details.js +1 -1
- package/dist/{Dialog-7rYeJxoF.js → Dialog-suBVnUvm.js} +2 -2
- package/dist/{Dialog-7rYeJxoF.js.map → Dialog-suBVnUvm.js.map} +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/{Divider-BYJdiS0V.js → Divider-By5PjW0_.js} +2 -2
- package/dist/{Divider-BYJdiS0V.js.map → Divider-By5PjW0_.js.map} +1 -1
- package/dist/Divider.js +1 -1
- package/dist/DndSort.js +101 -103
- package/dist/DndSort.js.map +1 -1
- package/dist/{Drawer-3T2QLWa7.js → Drawer-BoFuipVJ.js} +2 -2
- package/dist/{Drawer-3T2QLWa7.js.map → Drawer-BoFuipVJ.js.map} +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/{EditCard-C6oNHLbs.js → EditCard-DripZNiC.js} +6 -6
- package/dist/{EditCard-C6oNHLbs.js.map → EditCard-DripZNiC.js.map} +1 -1
- package/dist/EditCard.js +1 -1
- package/dist/{Flex-CBbc0w2g.js → Flex-CbkDTKfn.js} +2 -2
- package/dist/{Flex-CBbc0w2g.js.map → Flex-CbkDTKfn.js.map} +1 -1
- package/dist/{Flex-DbC3MGto-Cby3Kmzl.js → Flex-DlNiHX1G-DiUzqGqj.js} +3 -3
- package/dist/{Flex-DbC3MGto-Cby3Kmzl.js.map → Flex-DlNiHX1G-DiUzqGqj.js.map} +1 -1
- package/dist/Flex.js +1 -1
- package/dist/{Grid-d8fZM9zL.js → Grid-LhlvpLTc.js} +2 -2
- package/dist/{Grid-d8fZM9zL.js.map → Grid-LhlvpLTc.js.map} +1 -1
- package/dist/Grid.js +1 -1
- package/dist/{HammerProvider-_IuJrI_8-DvoqhQrc.js → HammerProvider-C9QySDSZ-CLRb96CM.js} +4 -3
- package/dist/{HammerProvider-_IuJrI_8-DvoqhQrc.js.map → HammerProvider-C9QySDSZ-CLRb96CM.js.map} +1 -1
- package/dist/{Helper-xRgl5fRU-Beh4oF7-.js → Helper-DBmwQvEP-Z2T8bXHx.js} +3 -3
- package/dist/{Helper-xRgl5fRU-Beh4oF7-.js.map → Helper-DBmwQvEP-Z2T8bXHx.js.map} +1 -1
- package/dist/{Icon-CBPJUFc8-vsWbtf2w.js → Icon-DuwR7O2z-DwPHQiBF.js} +4 -4
- package/dist/Icon-DuwR7O2z-DwPHQiBF.js.map +1 -0
- package/dist/{Icon-DEnUtsNv.js → Icon-U0zxixxg.js} +2 -2
- package/dist/{Icon-DEnUtsNv.js.map → Icon-U0zxixxg.js.map} +1 -1
- package/dist/Icon.js +1 -1
- package/dist/{InputMask-Dl8W0R4F-CFgFWCfT.js → InputMask-D9odbDSU-BJpRW6S6.js} +4 -4
- package/dist/InputMask-D9odbDSU-BJpRW6S6.js.map +1 -0
- package/dist/{InputMask-DF40Qlfh.js → InputMask-DRNShuT9.js} +2 -2
- package/dist/{InputMask-DF40Qlfh.js.map → InputMask-DRNShuT9.js.map} +1 -1
- package/dist/InputMask.js +1 -1
- package/dist/{Link-D-9J_gG_.js → Link-DDBu_8WX.js} +2 -2
- package/dist/{Link-D-9J_gG_.js.map → Link-DDBu_8WX.js.map} +1 -1
- package/dist/{Link-CFxV5mt6-BRludqlY.js → Link-DIyZHRIV-DXK6prKs.js} +4 -4
- package/dist/{Link-CFxV5mt6-BRludqlY.js.map → Link-DIyZHRIV-DXK6prKs.js.map} +1 -1
- package/dist/Link.js +1 -1
- package/dist/{ListView-D4Oo5dk0.js → ListView-BU0TCQ4k.js} +5 -5
- package/dist/{ListView-D4Oo5dk0.js.map → ListView-BU0TCQ4k.js.map} +1 -1
- package/dist/ListView.js +1 -1
- package/dist/{ListView.module-BqvHsIQ9-BqvHsIQ9.js → ListView.module-3I2M0Pia-3I2M0Pia.js} +2 -4
- package/dist/ListView.module-3I2M0Pia-3I2M0Pia.js.map +1 -0
- package/dist/{Listbox-s35NI8bz.js → Listbox-BQP8FRTF.js} +2 -2
- package/dist/{Listbox-s35NI8bz.js.map → Listbox-BQP8FRTF.js.map} +1 -1
- package/dist/{Listbox-BmSdg9ON-BPZge6P6.js → Listbox-CthJSHQ3-Zsuei4zJ.js} +12 -12
- package/dist/Listbox-CthJSHQ3-Zsuei4zJ.js.map +1 -0
- package/dist/Listbox.js +1 -1
- package/dist/{LocalizationProvider-BMrx361C-CWnp1u1b.js → LocalizationProvider-BrxC1a2D-B1iQENoJ.js} +2 -2
- package/dist/{LocalizationProvider-BMrx361C-CWnp1u1b.js.map → LocalizationProvider-BrxC1a2D-B1iQENoJ.js.map} +1 -1
- package/dist/LocalizationProvider.js +1 -1
- package/dist/{Menu-C2lb6-aj.js → Menu-DyMYxJUM.js} +11 -20
- package/dist/Menu-DyMYxJUM.js.map +1 -0
- package/dist/Menu.js +1 -1
- package/dist/{Overflow-4SGStPcA.js → Overflow-CKVmrb1N.js} +2 -2
- package/dist/{Overflow-4SGStPcA.js.map → Overflow-CKVmrb1N.js.map} +1 -1
- package/dist/{Overflow-BkDEkIkh-doip0lit.js → Overflow-DXWJ1gWT-tN8GInwt.js} +7 -7
- package/dist/Overflow-DXWJ1gWT-tN8GInwt.js.map +1 -0
- package/dist/Overflow.js +1 -1
- package/dist/{Page-DPU93uSw.js → Page-CS_ix1vK.js} +20 -16
- package/dist/Page-CS_ix1vK.js.map +1 -0
- package/dist/Page.js +1 -1
- package/dist/{Popover-DPh9L2_b.js → Popover-DwctvBuT.js} +2 -2
- package/dist/{Popover-DPh9L2_b.js.map → Popover-DwctvBuT.js.map} +1 -1
- package/dist/{Popover-BtFSJ9la-B2Bq0bTL.js → Popover-nXUfj8hV-CfP3czmR.js} +13 -16
- package/dist/Popover-nXUfj8hV-CfP3czmR.js.map +1 -0
- package/dist/Popover.js +1 -1
- package/dist/{ProgressBar-DCHzTUlk.js → ProgressBar-BmVVLmcr.js} +2 -2
- package/dist/{ProgressBar-DCHzTUlk.js.map → ProgressBar-BmVVLmcr.js.map} +1 -1
- package/dist/ProgressBar-C5jHU322-BUKq_wDl.js +2544 -0
- package/dist/ProgressBar-C5jHU322-BUKq_wDl.js.map +1 -0
- package/dist/ProgressBar-C5jHU322.css +736 -0
- package/dist/ProgressBar.js +1 -1
- package/dist/{Radio-_hd4Okk4-CYQgsyUe.js → Radio-DE79qJFW-Dt9tFahU.js} +6 -6
- package/dist/{Radio-_hd4Okk4-CYQgsyUe.js.map → Radio-DE79qJFW-Dt9tFahU.js.map} +1 -1
- package/dist/{Radio-DrKWItPI.js → Radio-vM4P73jb.js} +2 -2
- package/dist/{Radio-DrKWItPI.js.map → Radio-vM4P73jb.js.map} +1 -1
- package/dist/Radio.js +1 -1
- package/dist/{SearchField-Gt55jMYS.js → SearchField-DMx9YWba.js} +6 -9
- package/dist/SearchField-DMx9YWba.js.map +1 -0
- package/dist/SearchField.js +1 -1
- package/dist/{SegmentedControl-CxzfDyuq.js → SegmentedControl-D-kdk7BJ.js} +5 -5
- package/dist/{SegmentedControl-CxzfDyuq.js.map → SegmentedControl-D-kdk7BJ.js.map} +1 -1
- package/dist/SegmentedControl.js +1 -1
- package/dist/SelectCard.js +1 -1
- package/dist/{SelectCardGroup-BqqYDfvw.js → SelectCardGroup-u0bbiRwe.js} +13 -10
- package/dist/SelectCardGroup-u0bbiRwe.js.map +1 -0
- package/dist/{SideNav-B2j-pcOF.js → SideNav-BIV-c-1o.js} +10 -31
- package/dist/SideNav-BIV-c-1o.js.map +1 -0
- package/dist/SideNav.js +1 -1
- package/dist/{Skeleton-B7npJs-G.js → Skeleton-CO1kBH8A.js} +2 -2
- package/dist/{Skeleton-B7npJs-G.js.map → Skeleton-CO1kBH8A.js.map} +1 -1
- package/dist/Skeleton.js +1 -1
- package/dist/{Spinner-DdirfhPp-c7cDfIit.js → Spinner-B55mSnmk-B3oOSVLo.js} +3 -6
- package/dist/Spinner-B55mSnmk-B3oOSVLo.js.map +1 -0
- package/dist/{Spinner-C0SZj1Xr.js → Spinner-DUXjTDlr.js} +2 -2
- package/dist/{Spinner-C0SZj1Xr.js.map → Spinner-DUXjTDlr.js.map} +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/{Stepper-uGzkVA9L.js → Stepper-tJSGpsW1.js} +14 -14
- package/dist/Stepper-tJSGpsW1.js.map +1 -0
- package/dist/Stepper.js +1 -1
- package/dist/{Switch-DksEtlPC.js → Switch-CksM88Ks.js} +3 -3
- package/dist/{Switch-DksEtlPC.js.map → Switch-CksM88Ks.js.map} +1 -1
- package/dist/Switch.js +1 -1
- package/dist/{Tab-Bmh5FvNz.js → Tab-qn_tnvF4.js} +11 -11
- package/dist/Tab-qn_tnvF4.js.map +1 -0
- package/dist/Tab.js +1 -1
- package/dist/{Text-Cww9Ifu2-CQ6MA3B0.js → Text-BCRKWTMM-BvIdEgVR.js} +3 -3
- package/dist/{Text-Cww9Ifu2-CQ6MA3B0.js.map → Text-BCRKWTMM-BvIdEgVR.js.map} +1 -1
- package/dist/{Text-BG5eKasv.js → Text-CF2KcnWA.js} +2 -2
- package/dist/{Text-BG5eKasv.js.map → Text-CF2KcnWA.js.map} +1 -1
- package/dist/Text.js +1 -1
- package/dist/{TextField-D-wM0LoN.js → TextField-CvbgWXp2.js} +2 -2
- package/dist/{TextField-D-wM0LoN.js.map → TextField-CvbgWXp2.js.map} +1 -1
- package/dist/{TextField-D5PH3ElU-CBDiTprI.js → TextField-DmkmyIq0-CWjKLHMx.js} +8 -8
- package/dist/{TextField-D5PH3ElU-CBDiTprI.js.map → TextField-DmkmyIq0-CWjKLHMx.js.map} +1 -1
- package/dist/TextField.js +1 -1
- package/dist/{TextField.module-B411p3ST-B411p3ST.js → TextField.module-ZWACK1yV-ZWACK1yV.js} +2 -4
- package/dist/TextField.module-ZWACK1yV-ZWACK1yV.js.map +1 -0
- package/dist/{Textarea-DC-Mo0BS.js → Textarea-BdIaTJIC.js} +10 -12
- package/dist/Textarea-BdIaTJIC.js.map +1 -0
- package/dist/Textarea.js +1 -1
- package/dist/{ThemeProvider-BvlBau8H-cHEbjUN3.js → ThemeProvider-DrK12Ru--D1_n9ujr.js} +6 -6
- package/dist/ThemeProvider-DrK12Ru--D1_n9ujr.js.map +1 -0
- package/dist/{ThemeProvider-BvlBau8H.css → ThemeProvider-DrK12Ru-.css} +123 -909
- package/dist/{ThemeProvider-C99PP3mE.js → ThemeProvider-DzTAYEYO.js} +2 -2
- package/dist/{ThemeProvider-C99PP3mE.js.map → ThemeProvider-DzTAYEYO.js.map} +1 -1
- package/dist/ThemeProvider.js +1 -1
- package/dist/Toast.js +1 -1
- package/dist/{Toolbar-C3h5EZAS.js → Toolbar-BB7XNCQX.js} +14 -14
- package/dist/Toolbar-BB7XNCQX.js.map +1 -0
- package/dist/Toolbar.js +1 -1
- package/dist/{Tooltip-DSgdpQUh.js → Tooltip-Ccr19EVg.js} +2 -2
- package/dist/{Tooltip-DSgdpQUh.js.map → Tooltip-Ccr19EVg.js.map} +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/{check_circle-C3DDoVXp.js → check_circle-BGfigqq-.js} +4 -2
- package/dist/check_circle-BGfigqq-.js.map +1 -0
- package/dist/components/DateField/DateField.d.ts +3 -1
- package/dist/components/SelectCard/SelectCard.d.ts +4 -1
- package/dist/components/Toast/Toaster.d.ts +11 -5
- package/dist/components/Toast/toast.d.ts +1 -4
- package/dist/{floating-ui.react-4AwURJA3.js → floating-ui.react-Domgunz0.js} +667 -124
- package/dist/floating-ui.react-Domgunz0.js.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useBreakpoint/index.d.ts +1 -0
- package/dist/index.js +54 -53
- package/dist/index.js.map +1 -1
- package/dist/internal/components/Shadow.d.ts +3 -0
- package/dist/{proxy-Cy56d5Wf.js → proxy-CreWmH-e.js} +64 -53
- package/dist/proxy-CreWmH-e.js.map +1 -0
- package/dist/toast-na926t2L.js +96 -0
- package/dist/toast-na926t2L.js.map +1 -0
- package/dist/{use-reduced-motion-BR76mHGj.js → use-reduced-motion-znCm41qB.js} +2 -2
- package/dist/{use-reduced-motion-BR76mHGj.js.map → use-reduced-motion-znCm41qB.js.map} +1 -1
- package/dist/{useAccessibleColor-CR4Gw85S-D9BFnrDq.js → useAccessibleColor-Dc6B_M-Z-BYKjkGRg.js} +4 -4
- package/dist/useAccessibleColor-Dc6B_M-Z-BYKjkGRg.js.map +1 -0
- package/dist/useAccessibleColor.js +1 -1
- package/dist/useBreakpoint-7QkBkSeP-Cv5fnZxs.js +50 -0
- package/dist/useBreakpoint-7QkBkSeP-Cv5fnZxs.js.map +1 -0
- package/dist/useBreakpoint.d.ts +6 -0
- package/dist/useBreakpoint.js +2 -0
- package/dist/useBreakpoint.js.map +1 -0
- package/dist/{useLayoutPropsUtil-nygE3Tbf-DIwTnwoj.js → useLayoutPropsUtil-3B2XYWSr-ChuzrydG.js} +6 -48
- package/dist/useLayoutPropsUtil-3B2XYWSr-ChuzrydG.js.map +1 -0
- package/dist/useLinkStyles.js +1 -1
- package/dist/useSize.js +4 -4
- package/dist/useSize.js.map +1 -1
- package/dist/useTrackingId.js +1 -1
- package/dist/useTrackingId.js.map +1 -1
- package/package.json +4 -7
- package/dist/Avatar-D7OvWjMn.js.map +0 -1
- package/dist/Button-d6MSiD0q-Cu4AHmR0.js.map +0 -1
- package/dist/Button.module-mMu6tAX3-mMu6tAX3.js.map +0 -1
- package/dist/Checkbox-CL5hvL2A-DqrkDLRn.js.map +0 -1
- package/dist/Chip-DVIhldss-BFNWyxbZ.js.map +0 -1
- package/dist/Chip-hM1s-8Zy.js.map +0 -1
- package/dist/Combobox-DB-iA60L.js.map +0 -1
- package/dist/DateField-Be6t2RVY.js.map +0 -1
- package/dist/Details-CSkJPqp0.js.map +0 -1
- package/dist/Dialog-DMSckzRc-COM9hr-y.js +0 -311
- package/dist/Dialog-DMSckzRc-COM9hr-y.js.map +0 -1
- package/dist/Dialog-DMSckzRc.css +0 -140
- package/dist/Drawer-iKaJNkT6-J-zqSmeZ.js +0 -301
- package/dist/Drawer-iKaJNkT6-J-zqSmeZ.js.map +0 -1
- package/dist/Drawer-iKaJNkT6.css +0 -153
- package/dist/Icon-CBPJUFc8-vsWbtf2w.js.map +0 -1
- package/dist/InputMask-Dl8W0R4F-CFgFWCfT.js.map +0 -1
- package/dist/Label-XW1sd1Ih-BheXSCrx.js +0 -51
- package/dist/Label-XW1sd1Ih-BheXSCrx.js.map +0 -1
- package/dist/Label-XW1sd1Ih.css +0 -62
- package/dist/ListView.module-BqvHsIQ9-BqvHsIQ9.js.map +0 -1
- package/dist/Listbox-BmSdg9ON-BPZge6P6.js.map +0 -1
- package/dist/Menu-C2lb6-aj.js.map +0 -1
- package/dist/Overflow-BkDEkIkh-doip0lit.js.map +0 -1
- package/dist/Page-DPU93uSw.js.map +0 -1
- package/dist/Popover-BtFSJ9la-B2Bq0bTL.js.map +0 -1
- package/dist/ProgressBar-DAjwDjpq-DaeVMPEZ.js +0 -130
- package/dist/ProgressBar-DAjwDjpq-DaeVMPEZ.js.map +0 -1
- package/dist/ProgressBar-DAjwDjpq.css +0 -91
- package/dist/SearchField-Gt55jMYS.js.map +0 -1
- package/dist/SelectCardGroup-BqqYDfvw.js.map +0 -1
- package/dist/SideNav-B2j-pcOF.js.map +0 -1
- package/dist/Spinner-DdirfhPp-c7cDfIit.js.map +0 -1
- package/dist/Stepper-uGzkVA9L.js.map +0 -1
- package/dist/Tab-Bmh5FvNz.js.map +0 -1
- package/dist/TextField.module-B411p3ST-B411p3ST.js.map +0 -1
- package/dist/Textarea-DC-Mo0BS.js.map +0 -1
- package/dist/ThemeProvider-BvlBau8H-cHEbjUN3.js.map +0 -1
- package/dist/Toolbar-C3h5EZAS.js.map +0 -1
- package/dist/Tooltip-EEOs63Lz-eY2HC-SU.js +0 -631
- package/dist/Tooltip-EEOs63Lz-eY2HC-SU.js.map +0 -1
- package/dist/Tooltip-EEOs63Lz.css +0 -102
- package/dist/check_circle-C3DDoVXp.js.map +0 -1
- package/dist/floating-ui.react-4AwURJA3.js.map +0 -1
- package/dist/index.esm-CunAFnrh.js +0 -546
- package/dist/index.esm-CunAFnrh.js.map +0 -1
- package/dist/info-CYpG6tcI.js +0 -6
- package/dist/info-CYpG6tcI.js.map +0 -1
- package/dist/proxy-Cy56d5Wf.js.map +0 -1
- package/dist/supportsPopover-8aJR37cf-8aJR37cf.js +0 -6
- package/dist/supportsPopover-8aJR37cf-8aJR37cf.js.map +0 -1
- package/dist/toast-BckKmAqz.js +0 -937
- package/dist/toast-BckKmAqz.js.map +0 -1
- package/dist/toast.css +0 -216
- package/dist/useAccessibleColor-CR4Gw85S-D9BFnrDq.js.map +0 -1
- package/dist/useKeyboardFocusables-CwVMAe5C-DtjYOAmt.js +0 -61
- package/dist/useKeyboardFocusables-CwVMAe5C-DtjYOAmt.js.map +0 -1
- package/dist/useLayoutPropsUtil-nygE3Tbf-DIwTnwoj.js.map +0 -1
- /package/dist/{Alert-DQbOVF2P.css → Alert-BW0jYz7s.css} +0 -0
- /package/dist/{Calendar-CP8UPUg1.css → Calendar-DGlqu1W3.css} +0 -0
- /package/dist/{Card-BMCXcu4G.css → Card-DukbBYaA.css} +0 -0
- /package/dist/{Chip-DVIhldss.css → Chip-BQOzhPQv.css} +0 -0
- /package/dist/{Flex-DbC3MGto.css → Flex-DlNiHX1G.css} +0 -0
- /package/dist/{Helper-xRgl5fRU.css → Helper-DBmwQvEP.css} +0 -0
- /package/dist/{Icon-CBPJUFc8.css → Icon-DuwR7O2z.css} +0 -0
- /package/dist/{Link-CFxV5mt6.css → Link-DIyZHRIV.css} +0 -0
- /package/dist/{Overflow-BkDEkIkh.css → Overflow-DXWJ1gWT.css} +0 -0
- /package/dist/{Popover-BtFSJ9la.css → Popover-nXUfj8hV.css} +0 -0
- /package/dist/{Radio-_hd4Okk4.css → Radio-DE79qJFW.css} +0 -0
- /package/dist/{Spinner-DdirfhPp.css → Spinner-B55mSnmk.css} +0 -0
- /package/dist/{Text-Cww9Ifu2.css → Text-BCRKWTMM.css} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useLayoutEffect, useEffect, useRef } from 'react';
|
|
3
|
-
import { i as isTabbable, t as tabbable } from './index.esm-CunAFnrh.js';
|
|
4
3
|
import * as ReactDOM from 'react-dom';
|
|
5
4
|
|
|
6
5
|
function hasWindow() {
|
|
@@ -17,11 +16,11 @@ function getNodeName(node) {
|
|
|
17
16
|
}
|
|
18
17
|
function getWindow(node) {
|
|
19
18
|
var _node$ownerDocument;
|
|
20
|
-
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ?
|
|
19
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
21
20
|
}
|
|
22
21
|
function getDocumentElement(node) {
|
|
23
22
|
var _ref;
|
|
24
|
-
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ?
|
|
23
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
25
24
|
}
|
|
26
25
|
function isNode(value) {
|
|
27
26
|
if (!hasWindow()) {
|
|
@@ -53,7 +52,7 @@ function isOverflowElement(element) {
|
|
|
53
52
|
overflowX,
|
|
54
53
|
overflowY,
|
|
55
54
|
display
|
|
56
|
-
} = getComputedStyle(element);
|
|
55
|
+
} = getComputedStyle$1(element);
|
|
57
56
|
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
58
57
|
}
|
|
59
58
|
function isTableElement(element) {
|
|
@@ -70,7 +69,7 @@ function isTopLayer(element) {
|
|
|
70
69
|
}
|
|
71
70
|
function isContainingBlock(elementOrCss) {
|
|
72
71
|
const webkit = isWebKit();
|
|
73
|
-
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
72
|
+
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
74
73
|
|
|
75
74
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
76
75
|
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
@@ -95,7 +94,7 @@ function isWebKit() {
|
|
|
95
94
|
function isLastTraversableNode(node) {
|
|
96
95
|
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
97
96
|
}
|
|
98
|
-
function getComputedStyle(element) {
|
|
97
|
+
function getComputedStyle$1(element) {
|
|
99
98
|
return getWindow(element).getComputedStyle(element);
|
|
100
99
|
}
|
|
101
100
|
function getNodeScroll(element) {
|
|
@@ -137,14 +136,14 @@ function getNearestOverflowAncestor(node) {
|
|
|
137
136
|
}
|
|
138
137
|
function getOverflowAncestors(node, list, traverseIframes) {
|
|
139
138
|
var _node$ownerDocument2;
|
|
140
|
-
if (list ===
|
|
139
|
+
if (list === void 0) {
|
|
141
140
|
list = [];
|
|
142
141
|
}
|
|
143
|
-
if (traverseIframes ===
|
|
142
|
+
if (traverseIframes === void 0) {
|
|
144
143
|
traverseIframes = true;
|
|
145
144
|
}
|
|
146
145
|
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
147
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ?
|
|
146
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
148
147
|
const win = getWindow(scrollableAncestor);
|
|
149
148
|
if (isBody) {
|
|
150
149
|
const frameElement = getFrameElement(win);
|
|
@@ -158,7 +157,7 @@ function getFrameElement(win) {
|
|
|
158
157
|
|
|
159
158
|
function activeElement(doc) {
|
|
160
159
|
let activeElement = doc.activeElement;
|
|
161
|
-
while (((_activeElement = activeElement) == null || (_activeElement = _activeElement.shadowRoot) == null ?
|
|
160
|
+
while (((_activeElement = activeElement) == null || (_activeElement = _activeElement.shadowRoot) == null ? void 0 : _activeElement.activeElement) != null) {
|
|
162
161
|
var _activeElement;
|
|
163
162
|
activeElement = activeElement.shadowRoot.activeElement;
|
|
164
163
|
}
|
|
@@ -168,7 +167,7 @@ function contains(parent, child) {
|
|
|
168
167
|
if (!parent || !child) {
|
|
169
168
|
return false;
|
|
170
169
|
}
|
|
171
|
-
const rootNode = child.getRootNode == null ?
|
|
170
|
+
const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();
|
|
172
171
|
|
|
173
172
|
// First, attempt with faster native method
|
|
174
173
|
if (parent.contains(child)) {
|
|
@@ -260,7 +259,7 @@ function isRootElement(element) {
|
|
|
260
259
|
return element.matches('html,body');
|
|
261
260
|
}
|
|
262
261
|
function getDocument(node) {
|
|
263
|
-
return (node == null ?
|
|
262
|
+
return (node == null ? void 0 : node.ownerDocument) || document;
|
|
264
263
|
}
|
|
265
264
|
function isEventTargetWithin(event, node) {
|
|
266
265
|
if (node == null) {
|
|
@@ -344,7 +343,7 @@ function getAlignmentAxis(placement) {
|
|
|
344
343
|
return getOppositeAxis(getSideAxis(placement));
|
|
345
344
|
}
|
|
346
345
|
function getAlignmentSides(placement, rects, rtl) {
|
|
347
|
-
if (rtl ===
|
|
346
|
+
if (rtl === void 0) {
|
|
348
347
|
rtl = false;
|
|
349
348
|
}
|
|
350
349
|
const alignment = getAlignment(placement);
|
|
@@ -430,6 +429,550 @@ function rectToClientRect(rect) {
|
|
|
430
429
|
};
|
|
431
430
|
}
|
|
432
431
|
|
|
432
|
+
/*!
|
|
433
|
+
* tabbable 6.2.0
|
|
434
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
435
|
+
*/
|
|
436
|
+
// NOTE: separate `:not()` selectors has broader browser support than the newer
|
|
437
|
+
// `:not([inert], [inert] *)` (Feb 2023)
|
|
438
|
+
// CAREFUL: JSDom does not support `:not([inert] *)` as a selector; using it causes
|
|
439
|
+
// the entire query to fail, resulting in no nodes found, which will break a lot
|
|
440
|
+
// of things... so we have to rely on JS to identify nodes inside an inert container
|
|
441
|
+
var candidateSelectors = ['input:not([inert])', 'select:not([inert])', 'textarea:not([inert])', 'a[href]:not([inert])', 'button:not([inert])', '[tabindex]:not(slot):not([inert])', 'audio[controls]:not([inert])', 'video[controls]:not([inert])', '[contenteditable]:not([contenteditable="false"]):not([inert])', 'details>summary:first-of-type:not([inert])', 'details:not([inert])'];
|
|
442
|
+
var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
|
|
443
|
+
var NoElement = typeof Element === 'undefined';
|
|
444
|
+
var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
445
|
+
var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {
|
|
446
|
+
var _element$getRootNode;
|
|
447
|
+
return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);
|
|
448
|
+
} : function (element) {
|
|
449
|
+
return element === null || element === void 0 ? void 0 : element.ownerDocument;
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Determines if a node is inert or in an inert ancestor.
|
|
454
|
+
* @param {Element} [node]
|
|
455
|
+
* @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to
|
|
456
|
+
* see if any of them are inert. If false, only `node` itself is considered.
|
|
457
|
+
* @returns {boolean} True if inert itself or by way of being in an inert ancestor.
|
|
458
|
+
* False if `node` is falsy.
|
|
459
|
+
*/
|
|
460
|
+
var isInert = function isInert(node, lookUp) {
|
|
461
|
+
var _node$getAttribute;
|
|
462
|
+
if (lookUp === void 0) {
|
|
463
|
+
lookUp = true;
|
|
464
|
+
}
|
|
465
|
+
// CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`
|
|
466
|
+
// JS API property; we have to check the attribute, which can either be empty or 'true';
|
|
467
|
+
// if it's `null` (not specified) or 'false', it's an active element
|
|
468
|
+
var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');
|
|
469
|
+
var inert = inertAtt === '' || inertAtt === 'true';
|
|
470
|
+
|
|
471
|
+
// NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`
|
|
472
|
+
// if it weren't for `matches()` not being a function on shadow roots; the following
|
|
473
|
+
// code works for any kind of node
|
|
474
|
+
// CAREFUL: JSDom does not appear to support certain selectors like `:not([inert] *)`
|
|
475
|
+
// so it likely would not support `:is([inert] *)` either...
|
|
476
|
+
var result = inert || lookUp && node && isInert(node.parentNode); // recursive
|
|
477
|
+
|
|
478
|
+
return result;
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Determines if a node's content is editable.
|
|
483
|
+
* @param {Element} [node]
|
|
484
|
+
* @returns True if it's content-editable; false if it's not or `node` is falsy.
|
|
485
|
+
*/
|
|
486
|
+
var isContentEditable = function isContentEditable(node) {
|
|
487
|
+
var _node$getAttribute2;
|
|
488
|
+
// CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have
|
|
489
|
+
// to use the attribute directly to check for this, which can either be empty or 'true';
|
|
490
|
+
// if it's `null` (not specified) or 'false', it's a non-editable element
|
|
491
|
+
var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');
|
|
492
|
+
return attValue === '' || attValue === 'true';
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* @param {Element} el container to check in
|
|
497
|
+
* @param {boolean} includeContainer add container to check
|
|
498
|
+
* @param {(node: Element) => boolean} filter filter candidates
|
|
499
|
+
* @returns {Element[]}
|
|
500
|
+
*/
|
|
501
|
+
var getCandidates = function getCandidates(el, includeContainer, filter) {
|
|
502
|
+
// even if `includeContainer=false`, we still have to check it for inertness because
|
|
503
|
+
// if it's inert, all its children are inert
|
|
504
|
+
if (isInert(el)) {
|
|
505
|
+
return [];
|
|
506
|
+
}
|
|
507
|
+
var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
|
|
508
|
+
if (includeContainer && matches.call(el, candidateSelector)) {
|
|
509
|
+
candidates.unshift(el);
|
|
510
|
+
}
|
|
511
|
+
candidates = candidates.filter(filter);
|
|
512
|
+
return candidates;
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* @callback GetShadowRoot
|
|
517
|
+
* @param {Element} element to check for shadow root
|
|
518
|
+
* @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.
|
|
519
|
+
*/
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* @callback ShadowRootFilter
|
|
523
|
+
* @param {Element} shadowHostNode the element which contains shadow content
|
|
524
|
+
* @returns {boolean} true if a shadow root could potentially contain valid candidates.
|
|
525
|
+
*/
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* @typedef {Object} CandidateScope
|
|
529
|
+
* @property {Element} scopeParent contains inner candidates
|
|
530
|
+
* @property {Element[]} candidates list of candidates found in the scope parent
|
|
531
|
+
*/
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* @typedef {Object} IterativeOptions
|
|
535
|
+
* @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;
|
|
536
|
+
* if a function, implies shadow support is enabled and either returns the shadow root of an element
|
|
537
|
+
* or a boolean stating if it has an undisclosed shadow root
|
|
538
|
+
* @property {(node: Element) => boolean} filter filter candidates
|
|
539
|
+
* @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list
|
|
540
|
+
* @property {ShadowRootFilter} shadowRootFilter filter shadow roots;
|
|
541
|
+
*/
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* @param {Element[]} elements list of element containers to match candidates from
|
|
545
|
+
* @param {boolean} includeContainer add container list to check
|
|
546
|
+
* @param {IterativeOptions} options
|
|
547
|
+
* @returns {Array.<Element|CandidateScope>}
|
|
548
|
+
*/
|
|
549
|
+
var getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
|
|
550
|
+
var candidates = [];
|
|
551
|
+
var elementsToCheck = Array.from(elements);
|
|
552
|
+
while (elementsToCheck.length) {
|
|
553
|
+
var element = elementsToCheck.shift();
|
|
554
|
+
if (isInert(element, false)) {
|
|
555
|
+
// no need to look up since we're drilling down
|
|
556
|
+
// anything inside this container will also be inert
|
|
557
|
+
continue;
|
|
558
|
+
}
|
|
559
|
+
if (element.tagName === 'SLOT') {
|
|
560
|
+
// add shadow dom slot scope (slot itself cannot be focusable)
|
|
561
|
+
var assigned = element.assignedElements();
|
|
562
|
+
var content = assigned.length ? assigned : element.children;
|
|
563
|
+
var nestedCandidates = getCandidatesIteratively(content, true, options);
|
|
564
|
+
if (options.flatten) {
|
|
565
|
+
candidates.push.apply(candidates, nestedCandidates);
|
|
566
|
+
} else {
|
|
567
|
+
candidates.push({
|
|
568
|
+
scopeParent: element,
|
|
569
|
+
candidates: nestedCandidates
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
} else {
|
|
573
|
+
// check candidate element
|
|
574
|
+
var validCandidate = matches.call(element, candidateSelector);
|
|
575
|
+
if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
|
|
576
|
+
candidates.push(element);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
// iterate over shadow content if possible
|
|
580
|
+
var shadowRoot = element.shadowRoot ||
|
|
581
|
+
// check for an undisclosed shadow
|
|
582
|
+
typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);
|
|
583
|
+
|
|
584
|
+
// no inert look up because we're already drilling down and checking for inertness
|
|
585
|
+
// on the way down, so all containers to this root node should have already been
|
|
586
|
+
// vetted as non-inert
|
|
587
|
+
var validShadowRoot = !isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));
|
|
588
|
+
if (shadowRoot && validShadowRoot) {
|
|
589
|
+
// add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
|
|
590
|
+
// shadow exists, so look at light dom children as fallback BUT create a scope for any
|
|
591
|
+
// child candidates found because they're likely slotted elements (elements that are
|
|
592
|
+
// children of the web component element (which has the shadow), in the light dom, but
|
|
593
|
+
// slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
|
|
594
|
+
// _after_ we return from this recursive call
|
|
595
|
+
var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
|
|
596
|
+
if (options.flatten) {
|
|
597
|
+
candidates.push.apply(candidates, _nestedCandidates);
|
|
598
|
+
} else {
|
|
599
|
+
candidates.push({
|
|
600
|
+
scopeParent: element,
|
|
601
|
+
candidates: _nestedCandidates
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
} else {
|
|
605
|
+
// there's not shadow so just dig into the element's (light dom) children
|
|
606
|
+
// __without__ giving the element special scope treatment
|
|
607
|
+
elementsToCheck.unshift.apply(elementsToCheck, element.children);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
return candidates;
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* @private
|
|
616
|
+
* Determines if the node has an explicitly specified `tabindex` attribute.
|
|
617
|
+
* @param {HTMLElement} node
|
|
618
|
+
* @returns {boolean} True if so; false if not.
|
|
619
|
+
*/
|
|
620
|
+
var hasTabIndex = function hasTabIndex(node) {
|
|
621
|
+
return !isNaN(parseInt(node.getAttribute('tabindex'), 10));
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Determine the tab index of a given node.
|
|
626
|
+
* @param {HTMLElement} node
|
|
627
|
+
* @returns {number} Tab order (negative, 0, or positive number).
|
|
628
|
+
* @throws {Error} If `node` is falsy.
|
|
629
|
+
*/
|
|
630
|
+
var getTabIndex = function getTabIndex(node) {
|
|
631
|
+
if (!node) {
|
|
632
|
+
throw new Error('No node provided');
|
|
633
|
+
}
|
|
634
|
+
if (node.tabIndex < 0) {
|
|
635
|
+
// in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
|
|
636
|
+
// `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
|
|
637
|
+
// yet they are still part of the regular tab order; in FF, they get a default
|
|
638
|
+
// `tabIndex` of 0; since Chrome still puts those elements in the regular tab
|
|
639
|
+
// order, consider their tab index to be 0.
|
|
640
|
+
// Also browsers do not return `tabIndex` correctly for contentEditable nodes;
|
|
641
|
+
// so if they don't have a tabindex attribute specifically set, assume it's 0.
|
|
642
|
+
if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
|
|
643
|
+
return 0;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
return node.tabIndex;
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Determine the tab index of a given node __for sort order purposes__.
|
|
651
|
+
* @param {HTMLElement} node
|
|
652
|
+
* @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,
|
|
653
|
+
* has tabIndex -1, but needs to be sorted by document order in order for its content to be
|
|
654
|
+
* inserted into the correct sort position.
|
|
655
|
+
* @returns {number} Tab order (negative, 0, or positive number).
|
|
656
|
+
*/
|
|
657
|
+
var getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {
|
|
658
|
+
var tabIndex = getTabIndex(node);
|
|
659
|
+
if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
|
|
660
|
+
return 0;
|
|
661
|
+
}
|
|
662
|
+
return tabIndex;
|
|
663
|
+
};
|
|
664
|
+
var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
|
|
665
|
+
return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
|
|
666
|
+
};
|
|
667
|
+
var isInput = function isInput(node) {
|
|
668
|
+
return node.tagName === 'INPUT';
|
|
669
|
+
};
|
|
670
|
+
var isHiddenInput = function isHiddenInput(node) {
|
|
671
|
+
return isInput(node) && node.type === 'hidden';
|
|
672
|
+
};
|
|
673
|
+
var isDetailsWithSummary = function isDetailsWithSummary(node) {
|
|
674
|
+
var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
|
|
675
|
+
return child.tagName === 'SUMMARY';
|
|
676
|
+
});
|
|
677
|
+
return r;
|
|
678
|
+
};
|
|
679
|
+
var getCheckedRadio = function getCheckedRadio(nodes, form) {
|
|
680
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
681
|
+
if (nodes[i].checked && nodes[i].form === form) {
|
|
682
|
+
return nodes[i];
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
var isTabbableRadio = function isTabbableRadio(node) {
|
|
687
|
+
if (!node.name) {
|
|
688
|
+
return true;
|
|
689
|
+
}
|
|
690
|
+
var radioScope = node.form || getRootNode(node);
|
|
691
|
+
var queryRadios = function queryRadios(name) {
|
|
692
|
+
return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
|
|
693
|
+
};
|
|
694
|
+
var radioSet;
|
|
695
|
+
if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
|
|
696
|
+
radioSet = queryRadios(window.CSS.escape(node.name));
|
|
697
|
+
} else {
|
|
698
|
+
try {
|
|
699
|
+
radioSet = queryRadios(node.name);
|
|
700
|
+
} catch (err) {
|
|
701
|
+
// eslint-disable-next-line no-console
|
|
702
|
+
console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);
|
|
703
|
+
return false;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
var checked = getCheckedRadio(radioSet, node.form);
|
|
707
|
+
return !checked || checked === node;
|
|
708
|
+
};
|
|
709
|
+
var isRadio = function isRadio(node) {
|
|
710
|
+
return isInput(node) && node.type === 'radio';
|
|
711
|
+
};
|
|
712
|
+
var isNonTabbableRadio = function isNonTabbableRadio(node) {
|
|
713
|
+
return isRadio(node) && !isTabbableRadio(node);
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
// determines if a node is ultimately attached to the window's document
|
|
717
|
+
var isNodeAttached = function isNodeAttached(node) {
|
|
718
|
+
var _nodeRoot;
|
|
719
|
+
// The root node is the shadow root if the node is in a shadow DOM; some document otherwise
|
|
720
|
+
// (but NOT _the_ document; see second 'If' comment below for more).
|
|
721
|
+
// If rootNode is shadow root, it'll have a host, which is the element to which the shadow
|
|
722
|
+
// is attached, and the one we need to check if it's in the document or not (because the
|
|
723
|
+
// shadow, and all nodes it contains, is never considered in the document since shadows
|
|
724
|
+
// behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,
|
|
725
|
+
// is hidden, or is not in the document itself but is detached, it will affect the shadow's
|
|
726
|
+
// visibility, including all the nodes it contains). The host could be any normal node,
|
|
727
|
+
// or a custom element (i.e. web component). Either way, that's the one that is considered
|
|
728
|
+
// part of the document, not the shadow root, nor any of its children (i.e. the node being
|
|
729
|
+
// tested).
|
|
730
|
+
// To further complicate things, we have to look all the way up until we find a shadow HOST
|
|
731
|
+
// that is attached (or find none) because the node might be in nested shadows...
|
|
732
|
+
// If rootNode is not a shadow root, it won't have a host, and so rootNode should be the
|
|
733
|
+
// document (per the docs) and while it's a Document-type object, that document does not
|
|
734
|
+
// appear to be the same as the node's `ownerDocument` for some reason, so it's safer
|
|
735
|
+
// to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,
|
|
736
|
+
// using `rootNode.contains(node)` will _always_ be true we'll get false-positives when
|
|
737
|
+
// node is actually detached.
|
|
738
|
+
// NOTE: If `nodeRootHost` or `node` happens to be the `document` itself (which is possible
|
|
739
|
+
// if a tabbable/focusable node was quickly added to the DOM, focused, and then removed
|
|
740
|
+
// from the DOM as in https://github.com/focus-trap/focus-trap-react/issues/905), then
|
|
741
|
+
// `ownerDocument` will be `null`, hence the optional chaining on it.
|
|
742
|
+
var nodeRoot = node && getRootNode(node);
|
|
743
|
+
var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;
|
|
744
|
+
|
|
745
|
+
// in some cases, a detached node will return itself as the root instead of a document or
|
|
746
|
+
// shadow root object, in which case, we shouldn't try to look further up the host chain
|
|
747
|
+
var attached = false;
|
|
748
|
+
if (nodeRoot && nodeRoot !== node) {
|
|
749
|
+
var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;
|
|
750
|
+
attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));
|
|
751
|
+
while (!attached && nodeRootHost) {
|
|
752
|
+
var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;
|
|
753
|
+
// since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,
|
|
754
|
+
// which means we need to get the host's host and check if that parent host is contained
|
|
755
|
+
// in (i.e. attached to) the document
|
|
756
|
+
nodeRoot = getRootNode(nodeRootHost);
|
|
757
|
+
nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;
|
|
758
|
+
attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
return attached;
|
|
762
|
+
};
|
|
763
|
+
var isZeroArea = function isZeroArea(node) {
|
|
764
|
+
var _node$getBoundingClie = node.getBoundingClientRect(),
|
|
765
|
+
width = _node$getBoundingClie.width,
|
|
766
|
+
height = _node$getBoundingClie.height;
|
|
767
|
+
return width === 0 && height === 0;
|
|
768
|
+
};
|
|
769
|
+
var isHidden = function isHidden(node, _ref) {
|
|
770
|
+
var displayCheck = _ref.displayCheck,
|
|
771
|
+
getShadowRoot = _ref.getShadowRoot;
|
|
772
|
+
// NOTE: visibility will be `undefined` if node is detached from the document
|
|
773
|
+
// (see notes about this further down), which means we will consider it visible
|
|
774
|
+
// (this is legacy behavior from a very long way back)
|
|
775
|
+
// NOTE: we check this regardless of `displayCheck="none"` because this is a
|
|
776
|
+
// _visibility_ check, not a _display_ check
|
|
777
|
+
if (getComputedStyle(node).visibility === 'hidden') {
|
|
778
|
+
return true;
|
|
779
|
+
}
|
|
780
|
+
var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
|
|
781
|
+
var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
|
|
782
|
+
if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
|
|
783
|
+
return true;
|
|
784
|
+
}
|
|
785
|
+
if (!displayCheck || displayCheck === 'full' || displayCheck === 'legacy-full') {
|
|
786
|
+
if (typeof getShadowRoot === 'function') {
|
|
787
|
+
// figure out if we should consider the node to be in an undisclosed shadow and use the
|
|
788
|
+
// 'non-zero-area' fallback
|
|
789
|
+
var originalNode = node;
|
|
790
|
+
while (node) {
|
|
791
|
+
var parentElement = node.parentElement;
|
|
792
|
+
var rootNode = getRootNode(node);
|
|
793
|
+
if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow
|
|
794
|
+
) {
|
|
795
|
+
// node has an undisclosed shadow which means we can only treat it as a black box, so we
|
|
796
|
+
// fall back to a non-zero-area test
|
|
797
|
+
return isZeroArea(node);
|
|
798
|
+
} else if (node.assignedSlot) {
|
|
799
|
+
// iterate up slot
|
|
800
|
+
node = node.assignedSlot;
|
|
801
|
+
} else if (!parentElement && rootNode !== node.ownerDocument) {
|
|
802
|
+
// cross shadow boundary
|
|
803
|
+
node = rootNode.host;
|
|
804
|
+
} else {
|
|
805
|
+
// iterate up normal dom
|
|
806
|
+
node = parentElement;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
node = originalNode;
|
|
810
|
+
}
|
|
811
|
+
// else, `getShadowRoot` might be true, but all that does is enable shadow DOM support
|
|
812
|
+
// (i.e. it does not also presume that all nodes might have undisclosed shadows); or
|
|
813
|
+
// it might be a falsy value, which means shadow DOM support is disabled
|
|
814
|
+
|
|
815
|
+
// Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)
|
|
816
|
+
// now we can just test to see if it would normally be visible or not, provided it's
|
|
817
|
+
// attached to the main document.
|
|
818
|
+
// NOTE: We must consider case where node is inside a shadow DOM and given directly to
|
|
819
|
+
// `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.
|
|
820
|
+
|
|
821
|
+
if (isNodeAttached(node)) {
|
|
822
|
+
// this works wherever the node is: if there's at least one client rect, it's
|
|
823
|
+
// somehow displayed; it also covers the CSS 'display: contents' case where the
|
|
824
|
+
// node itself is hidden in place of its contents; and there's no need to search
|
|
825
|
+
// up the hierarchy either
|
|
826
|
+
return !node.getClientRects().length;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
// Else, the node isn't attached to the document, which means the `getClientRects()`
|
|
830
|
+
// API will __always__ return zero rects (this can happen, for example, if React
|
|
831
|
+
// is used to render nodes onto a detached tree, as confirmed in this thread:
|
|
832
|
+
// https://github.com/facebook/react/issues/9117#issuecomment-284228870)
|
|
833
|
+
//
|
|
834
|
+
// It also means that even window.getComputedStyle(node).display will return `undefined`
|
|
835
|
+
// because styles are only computed for nodes that are in the document.
|
|
836
|
+
//
|
|
837
|
+
// NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable
|
|
838
|
+
// somehow. Though it was never stated officially, anyone who has ever used tabbable
|
|
839
|
+
// APIs on nodes in detached containers has actually implicitly used tabbable in what
|
|
840
|
+
// was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck="none"` mode -- essentially
|
|
841
|
+
// considering __everything__ to be visible because of the innability to determine styles.
|
|
842
|
+
//
|
|
843
|
+
// v6.0.0: As of this major release, the default 'full' option __no longer treats detached
|
|
844
|
+
// nodes as visible with the 'none' fallback.__
|
|
845
|
+
if (displayCheck !== 'legacy-full') {
|
|
846
|
+
return true; // hidden
|
|
847
|
+
}
|
|
848
|
+
// else, fallback to 'none' mode and consider the node visible
|
|
849
|
+
} else if (displayCheck === 'non-zero-area') {
|
|
850
|
+
// NOTE: Even though this tests that the node's client rect is non-zero to determine
|
|
851
|
+
// whether it's displayed, and that a detached node will __always__ have a zero-area
|
|
852
|
+
// client rect, we don't special-case for whether the node is attached or not. In
|
|
853
|
+
// this mode, we do want to consider nodes that have a zero area to be hidden at all
|
|
854
|
+
// times, and that includes attached or not.
|
|
855
|
+
return isZeroArea(node);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
// visible, as far as we can tell, or per current `displayCheck=none` mode, we assume
|
|
859
|
+
// it's visible
|
|
860
|
+
return false;
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
// form fields (nested) inside a disabled fieldset are not focusable/tabbable
|
|
864
|
+
// unless they are in the _first_ <legend> element of the top-most disabled
|
|
865
|
+
// fieldset
|
|
866
|
+
var isDisabledFromFieldset = function isDisabledFromFieldset(node) {
|
|
867
|
+
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
|
|
868
|
+
var parentNode = node.parentElement;
|
|
869
|
+
// check if `node` is contained in a disabled <fieldset>
|
|
870
|
+
while (parentNode) {
|
|
871
|
+
if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
|
|
872
|
+
// look for the first <legend> among the children of the disabled <fieldset>
|
|
873
|
+
for (var i = 0; i < parentNode.children.length; i++) {
|
|
874
|
+
var child = parentNode.children.item(i);
|
|
875
|
+
// when the first <legend> (in document order) is found
|
|
876
|
+
if (child.tagName === 'LEGEND') {
|
|
877
|
+
// if its parent <fieldset> is not nested in another disabled <fieldset>,
|
|
878
|
+
// return whether `node` is a descendant of its first <legend>
|
|
879
|
+
return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
// the disabled <fieldset> containing `node` has no <legend>
|
|
883
|
+
return true;
|
|
884
|
+
}
|
|
885
|
+
parentNode = parentNode.parentElement;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
// else, node's tabbable/focusable state should not be affected by a fieldset's
|
|
890
|
+
// enabled/disabled state
|
|
891
|
+
return false;
|
|
892
|
+
};
|
|
893
|
+
var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
|
|
894
|
+
if (node.disabled ||
|
|
895
|
+
// we must do an inert look up to filter out any elements inside an inert ancestor
|
|
896
|
+
// because we're limited in the type of selectors we can use in JSDom (see related
|
|
897
|
+
// note related to `candidateSelectors`)
|
|
898
|
+
isInert(node) || isHiddenInput(node) || isHidden(node, options) ||
|
|
899
|
+
// For a details element with a summary, the summary element gets the focus
|
|
900
|
+
isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
|
|
901
|
+
return false;
|
|
902
|
+
}
|
|
903
|
+
return true;
|
|
904
|
+
};
|
|
905
|
+
var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
|
|
906
|
+
if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
|
|
907
|
+
return false;
|
|
908
|
+
}
|
|
909
|
+
return true;
|
|
910
|
+
};
|
|
911
|
+
var isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {
|
|
912
|
+
var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
|
|
913
|
+
if (isNaN(tabIndex) || tabIndex >= 0) {
|
|
914
|
+
return true;
|
|
915
|
+
}
|
|
916
|
+
// If a custom element has an explicit negative tabindex,
|
|
917
|
+
// browsers will not allow tab targeting said element's children.
|
|
918
|
+
return false;
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* @param {Array.<Element|CandidateScope>} candidates
|
|
923
|
+
* @returns Element[]
|
|
924
|
+
*/
|
|
925
|
+
var sortByOrder = function sortByOrder(candidates) {
|
|
926
|
+
var regularTabbables = [];
|
|
927
|
+
var orderedTabbables = [];
|
|
928
|
+
candidates.forEach(function (item, i) {
|
|
929
|
+
var isScope = !!item.scopeParent;
|
|
930
|
+
var element = isScope ? item.scopeParent : item;
|
|
931
|
+
var candidateTabindex = getSortOrderTabIndex(element, isScope);
|
|
932
|
+
var elements = isScope ? sortByOrder(item.candidates) : element;
|
|
933
|
+
if (candidateTabindex === 0) {
|
|
934
|
+
isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
|
|
935
|
+
} else {
|
|
936
|
+
orderedTabbables.push({
|
|
937
|
+
documentOrder: i,
|
|
938
|
+
tabIndex: candidateTabindex,
|
|
939
|
+
item: item,
|
|
940
|
+
isScope: isScope,
|
|
941
|
+
content: elements
|
|
942
|
+
});
|
|
943
|
+
}
|
|
944
|
+
});
|
|
945
|
+
return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {
|
|
946
|
+
sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
|
|
947
|
+
return acc;
|
|
948
|
+
}, []).concat(regularTabbables);
|
|
949
|
+
};
|
|
950
|
+
var tabbable = function tabbable(container, options) {
|
|
951
|
+
options = options || {};
|
|
952
|
+
var candidates;
|
|
953
|
+
if (options.getShadowRoot) {
|
|
954
|
+
candidates = getCandidatesIteratively([container], options.includeContainer, {
|
|
955
|
+
filter: isNodeMatchingSelectorTabbable.bind(null, options),
|
|
956
|
+
flatten: false,
|
|
957
|
+
getShadowRoot: options.getShadowRoot,
|
|
958
|
+
shadowRootFilter: isValidShadowRootTabbable
|
|
959
|
+
});
|
|
960
|
+
} else {
|
|
961
|
+
candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
|
|
962
|
+
}
|
|
963
|
+
return sortByOrder(candidates);
|
|
964
|
+
};
|
|
965
|
+
var isTabbable = function isTabbable(node, options) {
|
|
966
|
+
options = options || {};
|
|
967
|
+
if (!node) {
|
|
968
|
+
throw new Error('No node provided');
|
|
969
|
+
}
|
|
970
|
+
if (matches.call(node, candidateSelector) === false) {
|
|
971
|
+
return false;
|
|
972
|
+
}
|
|
973
|
+
return isNodeMatchingSelectorTabbable(options, node);
|
|
974
|
+
};
|
|
975
|
+
|
|
433
976
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
434
977
|
let {
|
|
435
978
|
reference,
|
|
@@ -501,7 +1044,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
501
1044
|
platform
|
|
502
1045
|
} = config;
|
|
503
1046
|
const validMiddleware = middleware.filter(Boolean);
|
|
504
|
-
const rtl = await (platform.isRTL == null ?
|
|
1047
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
505
1048
|
let rects = await platform.getElementRects({
|
|
506
1049
|
reference,
|
|
507
1050
|
floating,
|
|
@@ -587,7 +1130,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
587
1130
|
*/
|
|
588
1131
|
async function detectOverflow(state, options) {
|
|
589
1132
|
var _await$platform$isEle;
|
|
590
|
-
if (options ===
|
|
1133
|
+
if (options === void 0) {
|
|
591
1134
|
options = {};
|
|
592
1135
|
}
|
|
593
1136
|
const {
|
|
@@ -609,7 +1152,7 @@ async function detectOverflow(state, options) {
|
|
|
609
1152
|
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
610
1153
|
const element = elements[altBoundary ? altContext : elementContext];
|
|
611
1154
|
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
612
|
-
element: ((_await$platform$isEle = await (platform.isElement == null ?
|
|
1155
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
613
1156
|
boundary,
|
|
614
1157
|
rootBoundary,
|
|
615
1158
|
strategy
|
|
@@ -620,8 +1163,8 @@ async function detectOverflow(state, options) {
|
|
|
620
1163
|
width: rects.floating.width,
|
|
621
1164
|
height: rects.floating.height
|
|
622
1165
|
} : rects.reference;
|
|
623
|
-
const offsetParent = await (platform.getOffsetParent == null ?
|
|
624
|
-
const offsetScale = (await (platform.isElement == null ?
|
|
1166
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
1167
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
625
1168
|
x: 1,
|
|
626
1169
|
y: 1
|
|
627
1170
|
} : {
|
|
@@ -682,11 +1225,11 @@ const arrow$3 = options => ({
|
|
|
682
1225
|
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
683
1226
|
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
684
1227
|
const startDiff = coords[axis] - rects.reference[axis];
|
|
685
|
-
const arrowOffsetParent = await (platform.getOffsetParent == null ?
|
|
1228
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
686
1229
|
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
687
1230
|
|
|
688
1231
|
// DOM platform can return `window` as the `offsetParent`.
|
|
689
|
-
if (!clientSize || !(await (platform.isElement == null ?
|
|
1232
|
+
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
|
690
1233
|
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
691
1234
|
}
|
|
692
1235
|
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
@@ -731,7 +1274,7 @@ const arrow$3 = options => ({
|
|
|
731
1274
|
* @see https://floating-ui.com/docs/flip
|
|
732
1275
|
*/
|
|
733
1276
|
const flip$2 = function (options) {
|
|
734
|
-
if (options ===
|
|
1277
|
+
if (options === void 0) {
|
|
735
1278
|
options = {};
|
|
736
1279
|
}
|
|
737
1280
|
return {
|
|
@@ -767,7 +1310,7 @@ const flip$2 = function (options) {
|
|
|
767
1310
|
const side = getSide(placement);
|
|
768
1311
|
const initialSideAxis = getSideAxis(initialPlacement);
|
|
769
1312
|
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
770
|
-
const rtl = await (platform.isRTL == null ?
|
|
1313
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
771
1314
|
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
772
1315
|
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
773
1316
|
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
@@ -776,7 +1319,7 @@ const flip$2 = function (options) {
|
|
|
776
1319
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
777
1320
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
778
1321
|
const overflows = [];
|
|
779
|
-
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ?
|
|
1322
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
780
1323
|
if (checkMainAxis) {
|
|
781
1324
|
overflows.push(overflow[side]);
|
|
782
1325
|
}
|
|
@@ -792,7 +1335,7 @@ const flip$2 = function (options) {
|
|
|
792
1335
|
// One or more sides is overflowing.
|
|
793
1336
|
if (!overflows.every(side => side <= 0)) {
|
|
794
1337
|
var _middlewareData$flip2, _overflowsData$filter;
|
|
795
|
-
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ?
|
|
1338
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
796
1339
|
const nextPlacement = placements[nextIndex];
|
|
797
1340
|
if (nextPlacement) {
|
|
798
1341
|
// Try next placement and re-run the lifecycle.
|
|
@@ -809,7 +1352,7 @@ const flip$2 = function (options) {
|
|
|
809
1352
|
|
|
810
1353
|
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
811
1354
|
// then find the placement that fits the best on the main crossAxis side.
|
|
812
|
-
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ?
|
|
1355
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
813
1356
|
|
|
814
1357
|
// Otherwise fallback.
|
|
815
1358
|
if (!resetPlacement) {
|
|
@@ -826,7 +1369,7 @@ const flip$2 = function (options) {
|
|
|
826
1369
|
currentSideAxis === 'y';
|
|
827
1370
|
}
|
|
828
1371
|
return true;
|
|
829
|
-
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ?
|
|
1372
|
+
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
830
1373
|
if (placement) {
|
|
831
1374
|
resetPlacement = placement;
|
|
832
1375
|
}
|
|
@@ -859,7 +1402,7 @@ async function convertValueToCoords(state, options) {
|
|
|
859
1402
|
platform,
|
|
860
1403
|
elements
|
|
861
1404
|
} = state;
|
|
862
|
-
const rtl = await (platform.isRTL == null ?
|
|
1405
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
863
1406
|
const side = getSide(placement);
|
|
864
1407
|
const alignment = getAlignment(placement);
|
|
865
1408
|
const isVertical = getSideAxis(placement) === 'y';
|
|
@@ -901,7 +1444,7 @@ async function convertValueToCoords(state, options) {
|
|
|
901
1444
|
* @see https://floating-ui.com/docs/offset
|
|
902
1445
|
*/
|
|
903
1446
|
const offset$2 = function (options) {
|
|
904
|
-
if (options ===
|
|
1447
|
+
if (options === void 0) {
|
|
905
1448
|
options = 0;
|
|
906
1449
|
}
|
|
907
1450
|
return {
|
|
@@ -919,7 +1462,7 @@ const offset$2 = function (options) {
|
|
|
919
1462
|
|
|
920
1463
|
// If the placement is the same and the arrow caused an alignment offset
|
|
921
1464
|
// then we don't need to change the positioning coordinates.
|
|
922
|
-
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ?
|
|
1465
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
923
1466
|
return {};
|
|
924
1467
|
}
|
|
925
1468
|
return {
|
|
@@ -940,7 +1483,7 @@ const offset$2 = function (options) {
|
|
|
940
1483
|
* @see https://floating-ui.com/docs/shift
|
|
941
1484
|
*/
|
|
942
1485
|
const shift$2 = function (options) {
|
|
943
|
-
if (options ===
|
|
1486
|
+
if (options === void 0) {
|
|
944
1487
|
options = {};
|
|
945
1488
|
}
|
|
946
1489
|
return {
|
|
@@ -1015,7 +1558,7 @@ const shift$2 = function (options) {
|
|
|
1015
1558
|
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
1016
1559
|
*/
|
|
1017
1560
|
const limitShift$2 = function (options) {
|
|
1018
|
-
if (options ===
|
|
1561
|
+
if (options === void 0) {
|
|
1019
1562
|
options = {};
|
|
1020
1563
|
}
|
|
1021
1564
|
return {
|
|
@@ -1064,8 +1607,8 @@ const limitShift$2 = function (options) {
|
|
|
1064
1607
|
var _middlewareData$offse, _middlewareData$offse2;
|
|
1065
1608
|
const len = mainAxis === 'y' ? 'width' : 'height';
|
|
1066
1609
|
const isOriginSide = ['top', 'left'].includes(getSide(placement));
|
|
1067
|
-
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ?
|
|
1068
|
-
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ?
|
|
1610
|
+
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
1611
|
+
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
1069
1612
|
if (crossAxisCoord < limitMin) {
|
|
1070
1613
|
crossAxisCoord = limitMin;
|
|
1071
1614
|
} else if (crossAxisCoord > limitMax) {
|
|
@@ -1087,7 +1630,7 @@ const limitShift$2 = function (options) {
|
|
|
1087
1630
|
* @see https://floating-ui.com/docs/size
|
|
1088
1631
|
*/
|
|
1089
1632
|
const size$2 = function (options) {
|
|
1090
|
-
if (options ===
|
|
1633
|
+
if (options === void 0) {
|
|
1091
1634
|
options = {};
|
|
1092
1635
|
}
|
|
1093
1636
|
return {
|
|
@@ -1117,7 +1660,7 @@ const size$2 = function (options) {
|
|
|
1117
1660
|
let widthSide;
|
|
1118
1661
|
if (side === 'top' || side === 'bottom') {
|
|
1119
1662
|
heightSide = side;
|
|
1120
|
-
widthSide = alignment === ((await (platform.isRTL == null ?
|
|
1663
|
+
widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
|
|
1121
1664
|
} else {
|
|
1122
1665
|
widthSide = side;
|
|
1123
1666
|
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
@@ -1165,7 +1708,7 @@ const size$2 = function (options) {
|
|
|
1165
1708
|
};
|
|
1166
1709
|
|
|
1167
1710
|
function getCssDimensions(element) {
|
|
1168
|
-
const css = getComputedStyle(element);
|
|
1711
|
+
const css = getComputedStyle$1(element);
|
|
1169
1712
|
// In testing environments, the `width` and `height` properties are empty
|
|
1170
1713
|
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
1171
1714
|
let width = parseFloat(css.width) || 0;
|
|
@@ -1229,7 +1772,7 @@ function getVisualOffsets(element) {
|
|
|
1229
1772
|
};
|
|
1230
1773
|
}
|
|
1231
1774
|
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
1232
|
-
if (isFixed ===
|
|
1775
|
+
if (isFixed === void 0) {
|
|
1233
1776
|
isFixed = false;
|
|
1234
1777
|
}
|
|
1235
1778
|
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
@@ -1239,10 +1782,10 @@ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
|
1239
1782
|
}
|
|
1240
1783
|
|
|
1241
1784
|
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
1242
|
-
if (includeScale ===
|
|
1785
|
+
if (includeScale === void 0) {
|
|
1243
1786
|
includeScale = false;
|
|
1244
1787
|
}
|
|
1245
|
-
if (isFixedStrategy ===
|
|
1788
|
+
if (isFixedStrategy === void 0) {
|
|
1246
1789
|
isFixedStrategy = false;
|
|
1247
1790
|
}
|
|
1248
1791
|
const clientRect = element.getBoundingClientRect();
|
|
@@ -1270,7 +1813,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1270
1813
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
1271
1814
|
const iframeScale = getScale(currentIFrame);
|
|
1272
1815
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1273
|
-
const css = getComputedStyle(currentIFrame);
|
|
1816
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
1274
1817
|
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1275
1818
|
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1276
1819
|
x *= iframeScale.x;
|
|
@@ -1302,7 +1845,7 @@ function getWindowScrollBarX(element, rect) {
|
|
|
1302
1845
|
}
|
|
1303
1846
|
|
|
1304
1847
|
function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
|
|
1305
|
-
if (ignoreScrollbarX ===
|
|
1848
|
+
if (ignoreScrollbarX === void 0) {
|
|
1306
1849
|
ignoreScrollbarX = false;
|
|
1307
1850
|
}
|
|
1308
1851
|
const htmlRect = documentElement.getBoundingClientRect();
|
|
@@ -1370,7 +1913,7 @@ function getDocumentRect(element) {
|
|
|
1370
1913
|
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1371
1914
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1372
1915
|
const y = -scroll.scrollTop;
|
|
1373
|
-
if (getComputedStyle(body).direction === 'rtl') {
|
|
1916
|
+
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
1374
1917
|
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1375
1918
|
}
|
|
1376
1919
|
return {
|
|
@@ -1447,7 +1990,7 @@ function hasFixedPositionAncestor(element, stopNode) {
|
|
|
1447
1990
|
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1448
1991
|
return false;
|
|
1449
1992
|
}
|
|
1450
|
-
return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1993
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1451
1994
|
}
|
|
1452
1995
|
|
|
1453
1996
|
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
@@ -1460,12 +2003,12 @@ function getClippingElementAncestors(element, cache) {
|
|
|
1460
2003
|
}
|
|
1461
2004
|
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1462
2005
|
let currentContainingBlockComputedStyle = null;
|
|
1463
|
-
const elementIsFixed = getComputedStyle(element).position === 'fixed';
|
|
2006
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
1464
2007
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1465
2008
|
|
|
1466
2009
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1467
2010
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1468
|
-
const computedStyle = getComputedStyle(currentNode);
|
|
2011
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
1469
2012
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1470
2013
|
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
1471
2014
|
currentContainingBlockComputedStyle = null;
|
|
@@ -1559,11 +2102,11 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1559
2102
|
}
|
|
1560
2103
|
|
|
1561
2104
|
function isStaticPositioned(element) {
|
|
1562
|
-
return getComputedStyle(element).position === 'static';
|
|
2105
|
+
return getComputedStyle$1(element).position === 'static';
|
|
1563
2106
|
}
|
|
1564
2107
|
|
|
1565
2108
|
function getTrueOffsetParent(element, polyfill) {
|
|
1566
|
-
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
2109
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
1567
2110
|
return null;
|
|
1568
2111
|
}
|
|
1569
2112
|
if (polyfill) {
|
|
@@ -1624,7 +2167,7 @@ const getElementRects = async function (data) {
|
|
|
1624
2167
|
};
|
|
1625
2168
|
|
|
1626
2169
|
function isRTL(element) {
|
|
1627
|
-
return getComputedStyle(element).direction === 'rtl';
|
|
2170
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
1628
2171
|
}
|
|
1629
2172
|
|
|
1630
2173
|
const platform = {
|
|
@@ -1656,10 +2199,10 @@ function observeMove(element, onMove) {
|
|
|
1656
2199
|
io = null;
|
|
1657
2200
|
}
|
|
1658
2201
|
function refresh(skip, threshold) {
|
|
1659
|
-
if (skip ===
|
|
2202
|
+
if (skip === void 0) {
|
|
1660
2203
|
skip = false;
|
|
1661
2204
|
}
|
|
1662
|
-
if (threshold ===
|
|
2205
|
+
if (threshold === void 0) {
|
|
1663
2206
|
threshold = 1;
|
|
1664
2207
|
}
|
|
1665
2208
|
cleanup();
|
|
@@ -1741,7 +2284,7 @@ function observeMove(element, onMove) {
|
|
|
1741
2284
|
* @see https://floating-ui.com/docs/autoUpdate
|
|
1742
2285
|
*/
|
|
1743
2286
|
function autoUpdate(reference, floating, update, options) {
|
|
1744
|
-
if (options ===
|
|
2287
|
+
if (options === void 0) {
|
|
1745
2288
|
options = {};
|
|
1746
2289
|
}
|
|
1747
2290
|
const {
|
|
@@ -1956,7 +2499,7 @@ function useLatestRef$1(value) {
|
|
|
1956
2499
|
* @see https://floating-ui.com/docs/useFloating
|
|
1957
2500
|
*/
|
|
1958
2501
|
function useFloating$1(options) {
|
|
1959
|
-
if (options ===
|
|
2502
|
+
if (options === void 0) {
|
|
1960
2503
|
options = {};
|
|
1961
2504
|
}
|
|
1962
2505
|
const {
|
|
@@ -2250,7 +2793,7 @@ function useEffectEvent(callback) {
|
|
|
2250
2793
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2251
2794
|
args[_key] = arguments[_key];
|
|
2252
2795
|
}
|
|
2253
|
-
return ref.current == null ?
|
|
2796
|
+
return ref.current == null ? void 0 : ref.current(...args);
|
|
2254
2797
|
}, []);
|
|
2255
2798
|
}
|
|
2256
2799
|
|
|
@@ -2282,7 +2825,7 @@ function findNonDisabledIndex(listRef, _temp) {
|
|
|
2282
2825
|
decrement = false,
|
|
2283
2826
|
disabledIndices,
|
|
2284
2827
|
amount = 1
|
|
2285
|
-
} = _temp ===
|
|
2828
|
+
} = _temp === void 0 ? {} : _temp;
|
|
2286
2829
|
const list = listRef.current;
|
|
2287
2830
|
let index = startingIndex;
|
|
2288
2831
|
do {
|
|
@@ -2573,7 +3116,7 @@ function FloatingList(props) {
|
|
|
2573
3116
|
* @see https://floating-ui.com/docs/FloatingList#uselistitem
|
|
2574
3117
|
*/
|
|
2575
3118
|
function useListItem(props) {
|
|
2576
|
-
if (props ===
|
|
3119
|
+
if (props === void 0) {
|
|
2577
3120
|
props = {};
|
|
2578
3121
|
}
|
|
2579
3122
|
const {
|
|
@@ -2595,7 +3138,7 @@ function useListItem(props) {
|
|
|
2595
3138
|
if (labelsRef) {
|
|
2596
3139
|
var _node$textContent;
|
|
2597
3140
|
const isLabelDefined = label !== undefined;
|
|
2598
|
-
labelsRef.current[index$1] = isLabelDefined ? label : (_node$textContent = node == null ?
|
|
3141
|
+
labelsRef.current[index$1] = isLabelDefined ? label : (_node$textContent = node == null ? void 0 : node.textContent) != null ? _node$textContent : null;
|
|
2599
3142
|
}
|
|
2600
3143
|
}
|
|
2601
3144
|
}, [index$1, elementsRef, labelsRef, label]);
|
|
@@ -2732,7 +3275,7 @@ const FloatingArrow = /*#__PURE__*/React.forwardRef(function FloatingArrow(props
|
|
|
2732
3275
|
// https://github.com/floating-ui/floating-ui/issues/2932
|
|
2733
3276
|
index(() => {
|
|
2734
3277
|
if (!floating) return;
|
|
2735
|
-
const isRTL = getComputedStyle(floating).direction === 'rtl';
|
|
3278
|
+
const isRTL = getComputedStyle$1(floating).direction === 'rtl';
|
|
2736
3279
|
if (isRTL) {
|
|
2737
3280
|
setIsRTL(true);
|
|
2738
3281
|
}
|
|
@@ -2759,8 +3302,8 @@ const FloatingArrow = /*#__PURE__*/React.forwardRef(function FloatingArrow(props
|
|
|
2759
3302
|
if (computedStaticOffset && isRTL) {
|
|
2760
3303
|
xOffsetProp = alignment === 'end' ? 'left' : 'right';
|
|
2761
3304
|
}
|
|
2762
|
-
const arrowX = (arrow == null ?
|
|
2763
|
-
const arrowY = (arrow == null ?
|
|
3305
|
+
const arrowX = (arrow == null ? void 0 : arrow.x) != null ? computedStaticOffset || arrow.x : '';
|
|
3306
|
+
const arrowY = (arrow == null ? void 0 : arrow.y) != null ? computedStaticOffset || arrow.y : '';
|
|
2764
3307
|
const dValue = d || 'M0,0' + (" H" + width) + (" L" + (width - svgX) + "," + (height - svgY)) + (" Q" + width / 2 + "," + height + " " + svgX + "," + (height - svgY)) + ' Z';
|
|
2765
3308
|
const rotation = {
|
|
2766
3309
|
top: isCustomShape ? 'rotate(180deg)' : '',
|
|
@@ -2816,7 +3359,7 @@ function createPubSub() {
|
|
|
2816
3359
|
},
|
|
2817
3360
|
off(event, listener) {
|
|
2818
3361
|
var _map$get2;
|
|
2819
|
-
map.set(event, ((_map$get2 = map.get(event)) == null ?
|
|
3362
|
+
map.set(event, ((_map$get2 = map.get(event)) == null ? void 0 : _map$get2.filter(l => l !== listener)) || []);
|
|
2820
3363
|
}
|
|
2821
3364
|
};
|
|
2822
3365
|
}
|
|
@@ -2830,7 +3373,7 @@ const FloatingTreeContext = /*#__PURE__*/React.createContext(null);
|
|
|
2830
3373
|
*/
|
|
2831
3374
|
const useFloatingParentNodeId = () => {
|
|
2832
3375
|
var _React$useContext;
|
|
2833
|
-
return ((_React$useContext = React.useContext(FloatingNodeContext)) == null ?
|
|
3376
|
+
return ((_React$useContext = React.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;
|
|
2834
3377
|
};
|
|
2835
3378
|
|
|
2836
3379
|
/**
|
|
@@ -2928,7 +3471,7 @@ function getDelay(value, prop, pointerType) {
|
|
|
2928
3471
|
if (typeof value === 'number') {
|
|
2929
3472
|
return value;
|
|
2930
3473
|
}
|
|
2931
|
-
return value == null ?
|
|
3474
|
+
return value == null ? void 0 : value[prop];
|
|
2932
3475
|
}
|
|
2933
3476
|
/**
|
|
2934
3477
|
* Opens the floating element while hovering over the reference element, like
|
|
@@ -2936,7 +3479,7 @@ function getDelay(value, prop, pointerType) {
|
|
|
2936
3479
|
* @see https://floating-ui.com/docs/useHover
|
|
2937
3480
|
*/
|
|
2938
3481
|
function useHover(context, props) {
|
|
2939
|
-
if (props ===
|
|
3482
|
+
if (props === void 0) {
|
|
2940
3483
|
props = {};
|
|
2941
3484
|
}
|
|
2942
3485
|
const {
|
|
@@ -2969,8 +3512,8 @@ function useHover(context, props) {
|
|
|
2969
3512
|
const restTimeoutPendingRef = React.useRef(false);
|
|
2970
3513
|
const isHoverOpen = React.useCallback(() => {
|
|
2971
3514
|
var _dataRef$current$open;
|
|
2972
|
-
const type = (_dataRef$current$open = dataRef.current.openEvent) == null ?
|
|
2973
|
-
return (type == null ?
|
|
3515
|
+
const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type;
|
|
3516
|
+
return (type == null ? void 0 : type.includes('mouse')) && type !== 'mousedown';
|
|
2974
3517
|
}, [dataRef]);
|
|
2975
3518
|
|
|
2976
3519
|
// When closing before opening, clear the delay timeouts to cancel it
|
|
@@ -3009,10 +3552,10 @@ function useHover(context, props) {
|
|
|
3009
3552
|
};
|
|
3010
3553
|
}, [elements.floating, open, onOpenChange, enabled, handleCloseRef, isHoverOpen]);
|
|
3011
3554
|
const closeWithDelay = React.useCallback(function (event, runElseBranch, reason) {
|
|
3012
|
-
if (runElseBranch ===
|
|
3555
|
+
if (runElseBranch === void 0) {
|
|
3013
3556
|
runElseBranch = true;
|
|
3014
3557
|
}
|
|
3015
|
-
if (reason ===
|
|
3558
|
+
if (reason === void 0) {
|
|
3016
3559
|
reason = 'hover';
|
|
3017
3560
|
}
|
|
3018
3561
|
const closeDelay = getDelay(delayRef.current, 'close', pointerTypeRef.current);
|
|
@@ -3159,7 +3702,7 @@ function useHover(context, props) {
|
|
|
3159
3702
|
const body = getDocument(elements.floating).body;
|
|
3160
3703
|
body.setAttribute(safePolygonIdentifier, '');
|
|
3161
3704
|
const ref = elements.domReference;
|
|
3162
|
-
const parentFloating = tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null ?
|
|
3705
|
+
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;
|
|
3163
3706
|
if (parentFloating) {
|
|
3164
3707
|
parentFloating.style.pointerEvents = '';
|
|
3165
3708
|
}
|
|
@@ -3265,7 +3808,7 @@ const useDelayGroupContext = () => React.useContext(FloatingDelayGroupContext);
|
|
|
3265
3808
|
* @see https://floating-ui.com/docs/FloatingDelayGroup
|
|
3266
3809
|
*/
|
|
3267
3810
|
function useDelayGroup(context, options) {
|
|
3268
|
-
if (options ===
|
|
3811
|
+
if (options === void 0) {
|
|
3269
3812
|
options = {};
|
|
3270
3813
|
}
|
|
3271
3814
|
const {
|
|
@@ -3329,7 +3872,7 @@ function useDelayGroup(context, options) {
|
|
|
3329
3872
|
|
|
3330
3873
|
let rafId = 0;
|
|
3331
3874
|
function enqueueFocus(el, options) {
|
|
3332
|
-
if (options ===
|
|
3875
|
+
if (options === void 0) {
|
|
3333
3876
|
options = {};
|
|
3334
3877
|
}
|
|
3335
3878
|
const {
|
|
@@ -3338,7 +3881,7 @@ function enqueueFocus(el, options) {
|
|
|
3338
3881
|
sync = false
|
|
3339
3882
|
} = options;
|
|
3340
3883
|
cancelPrevious && cancelAnimationFrame(rafId);
|
|
3341
|
-
const exec = () => el == null ?
|
|
3884
|
+
const exec = () => el == null ? void 0 : el.focus({
|
|
3342
3885
|
preventScroll
|
|
3343
3886
|
});
|
|
3344
3887
|
if (sync) {
|
|
@@ -3351,10 +3894,10 @@ function enqueueFocus(el, options) {
|
|
|
3351
3894
|
function getAncestors(nodes, id) {
|
|
3352
3895
|
var _nodes$find;
|
|
3353
3896
|
let allAncestors = [];
|
|
3354
|
-
let currentParentId = (_nodes$find = nodes.find(node => node.id === id)) == null ?
|
|
3897
|
+
let currentParentId = (_nodes$find = nodes.find(node => node.id === id)) == null ? void 0 : _nodes$find.parentId;
|
|
3355
3898
|
while (currentParentId) {
|
|
3356
3899
|
const currentNode = nodes.find(node => node.id === currentParentId);
|
|
3357
|
-
currentParentId = currentNode == null ?
|
|
3900
|
+
currentParentId = currentNode == null ? void 0 : currentNode.parentId;
|
|
3358
3901
|
if (currentNode) {
|
|
3359
3902
|
allAncestors = allAncestors.concat(currentNode);
|
|
3360
3903
|
}
|
|
@@ -3365,15 +3908,15 @@ function getAncestors(nodes, id) {
|
|
|
3365
3908
|
function getChildren(nodes, id) {
|
|
3366
3909
|
let allChildren = nodes.filter(node => {
|
|
3367
3910
|
var _node$context;
|
|
3368
|
-
return node.parentId === id && ((_node$context = node.context) == null ?
|
|
3911
|
+
return node.parentId === id && ((_node$context = node.context) == null ? void 0 : _node$context.open);
|
|
3369
3912
|
});
|
|
3370
3913
|
let currentChildren = allChildren;
|
|
3371
3914
|
while (currentChildren.length) {
|
|
3372
3915
|
currentChildren = nodes.filter(node => {
|
|
3373
3916
|
var _currentChildren;
|
|
3374
|
-
return (_currentChildren = currentChildren) == null ?
|
|
3917
|
+
return (_currentChildren = currentChildren) == null ? void 0 : _currentChildren.some(n => {
|
|
3375
3918
|
var _node$context2;
|
|
3376
|
-
return node.parentId === n.id && ((_node$context2 = node.context) == null ?
|
|
3919
|
+
return node.parentId === n.id && ((_node$context2 = node.context) == null ? void 0 : _node$context2.open);
|
|
3377
3920
|
});
|
|
3378
3921
|
});
|
|
3379
3922
|
allChildren = allChildren.concat(currentChildren);
|
|
@@ -3491,10 +4034,10 @@ function applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, iner
|
|
|
3491
4034
|
};
|
|
3492
4035
|
}
|
|
3493
4036
|
function markOthers(avoidElements, ariaHidden, inert) {
|
|
3494
|
-
if (ariaHidden ===
|
|
4037
|
+
if (ariaHidden === void 0) {
|
|
3495
4038
|
ariaHidden = false;
|
|
3496
4039
|
}
|
|
3497
|
-
if (inert ===
|
|
4040
|
+
if (inert === void 0) {
|
|
3498
4041
|
inert = false;
|
|
3499
4042
|
}
|
|
3500
4043
|
const body = getDocument(avoidElements[0]).body;
|
|
@@ -3606,7 +4149,7 @@ const attr = /*#__PURE__*/createAttribute('portal');
|
|
|
3606
4149
|
* @see https://floating-ui.com/docs/FloatingPortal#usefloatingportalnode
|
|
3607
4150
|
*/
|
|
3608
4151
|
function useFloatingPortalNode(props) {
|
|
3609
|
-
if (props ===
|
|
4152
|
+
if (props === void 0) {
|
|
3610
4153
|
props = {};
|
|
3611
4154
|
}
|
|
3612
4155
|
const {
|
|
@@ -3649,7 +4192,7 @@ function useFloatingPortalNode(props) {
|
|
|
3649
4192
|
if (root === null) return;
|
|
3650
4193
|
if (!uniqueId) return;
|
|
3651
4194
|
if (portalNodeRef.current) return;
|
|
3652
|
-
let container = root || (portalContext == null ?
|
|
4195
|
+
let container = root || (portalContext == null ? void 0 : portalContext.portalNode);
|
|
3653
4196
|
if (container && !isElement(container)) container = container.current;
|
|
3654
4197
|
container = container || document.body;
|
|
3655
4198
|
let idWrapper = null;
|
|
@@ -3692,8 +4235,8 @@ function FloatingPortal(props) {
|
|
|
3692
4235
|
const afterOutsideRef = React.useRef(null);
|
|
3693
4236
|
const beforeInsideRef = React.useRef(null);
|
|
3694
4237
|
const afterInsideRef = React.useRef(null);
|
|
3695
|
-
const modal = focusManagerState == null ?
|
|
3696
|
-
const open = focusManagerState == null ?
|
|
4238
|
+
const modal = focusManagerState == null ? void 0 : focusManagerState.modal;
|
|
4239
|
+
const open = focusManagerState == null ? void 0 : focusManagerState.open;
|
|
3697
4240
|
const shouldRenderGuards =
|
|
3698
4241
|
// The FocusManager and therefore floating element are currently open/
|
|
3699
4242
|
// rendered.
|
|
@@ -3751,7 +4294,7 @@ function FloatingPortal(props) {
|
|
|
3751
4294
|
var _beforeInsideRef$curr;
|
|
3752
4295
|
(_beforeInsideRef$curr = beforeInsideRef.current) == null || _beforeInsideRef$curr.focus();
|
|
3753
4296
|
} else {
|
|
3754
|
-
const prevTabbable = getPreviousTabbable() || (focusManagerState == null ?
|
|
4297
|
+
const prevTabbable = getPreviousTabbable() || (focusManagerState == null ? void 0 : focusManagerState.refs.domReference.current);
|
|
3755
4298
|
prevTabbable == null || prevTabbable.focus();
|
|
3756
4299
|
}
|
|
3757
4300
|
}
|
|
@@ -3766,9 +4309,9 @@ function FloatingPortal(props) {
|
|
|
3766
4309
|
var _afterInsideRef$curre;
|
|
3767
4310
|
(_afterInsideRef$curre = afterInsideRef.current) == null || _afterInsideRef$curre.focus();
|
|
3768
4311
|
} else {
|
|
3769
|
-
const nextTabbable = getNextTabbable() || (focusManagerState == null ?
|
|
4312
|
+
const nextTabbable = getNextTabbable() || (focusManagerState == null ? void 0 : focusManagerState.refs.domReference.current);
|
|
3770
4313
|
nextTabbable == null || nextTabbable.focus();
|
|
3771
|
-
(focusManagerState == null ?
|
|
4314
|
+
(focusManagerState == null ? void 0 : focusManagerState.closeOnFocusOut) && (focusManagerState == null ? void 0 : focusManagerState.onOpenChange(false, event.nativeEvent, 'focus-out'));
|
|
3772
4315
|
}
|
|
3773
4316
|
}
|
|
3774
4317
|
}));
|
|
@@ -3869,7 +4412,7 @@ function FloatingFocusManager(props) {
|
|
|
3869
4412
|
const isInsidePortal = portalContext != null;
|
|
3870
4413
|
const floatingFocusElement = getFloatingFocusElement(floating);
|
|
3871
4414
|
const getTabbableContent = useEffectEvent(function (container) {
|
|
3872
|
-
if (container ===
|
|
4415
|
+
if (container === void 0) {
|
|
3873
4416
|
container = floatingFocusElement;
|
|
3874
4417
|
}
|
|
3875
4418
|
return container ? tabbable(container, getTabbableOptions()) : [];
|
|
@@ -3947,12 +4490,12 @@ function FloatingFocusManager(props) {
|
|
|
3947
4490
|
function handleFocusOutside(event) {
|
|
3948
4491
|
const relatedTarget = event.relatedTarget;
|
|
3949
4492
|
queueMicrotask(() => {
|
|
3950
|
-
const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext == null ?
|
|
4493
|
+
const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext == null ? void 0 : portalContext.portalNode, relatedTarget) || relatedTarget != null && relatedTarget.hasAttribute(createAttribute('focus-guard')) || tree && (getChildren(tree.nodesRef.current, nodeId).find(node => {
|
|
3951
4494
|
var _node$context, _node$context2;
|
|
3952
|
-
return contains((_node$context = node.context) == null ?
|
|
4495
|
+
return contains((_node$context = node.context) == null ? void 0 : _node$context.elements.floating, relatedTarget) || contains((_node$context2 = node.context) == null ? void 0 : _node$context2.elements.domReference, relatedTarget);
|
|
3953
4496
|
}) || getAncestors(tree.nodesRef.current, nodeId).find(node => {
|
|
3954
4497
|
var _node$context3, _node$context4;
|
|
3955
|
-
return ((_node$context3 = node.context) == null ?
|
|
4498
|
+
return ((_node$context3 = node.context) == null ? void 0 : _node$context3.elements.floating) === relatedTarget || ((_node$context4 = node.context) == null ? void 0 : _node$context4.elements.domReference) === relatedTarget;
|
|
3956
4499
|
})));
|
|
3957
4500
|
|
|
3958
4501
|
// Restore focus to the previous tabbable element index to prevent
|
|
@@ -3997,7 +4540,7 @@ function FloatingFocusManager(props) {
|
|
|
3997
4540
|
if (disabled) return;
|
|
3998
4541
|
|
|
3999
4542
|
// Don't hide portals nested within the parent portal.
|
|
4000
|
-
const portalNodes = Array.from((portalContext == null || (_portalContext$portal = portalContext.portalNode) == null ?
|
|
4543
|
+
const portalNodes = Array.from((portalContext == null || (_portalContext$portal = portalContext.portalNode) == null ? void 0 : _portalContext$portal.querySelectorAll("[" + createAttribute('portal') + "]")) || []);
|
|
4001
4544
|
if (floating) {
|
|
4002
4545
|
const insideElements = [floating, ...portalNodes, startDismissButtonRef.current, endDismissButtonRef.current, orderRef.current.includes('reference') || isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);
|
|
4003
4546
|
const cleanup = modal || isUntrappedTypeableCombobox ? markOthers(insideElements, guards, !guards) : markOthers(insideElements);
|
|
@@ -4078,7 +4621,7 @@ function FloatingFocusManager(props) {
|
|
|
4078
4621
|
const activeEl = activeElement(doc);
|
|
4079
4622
|
const isFocusInsideFloatingTree = contains(floating, activeEl) || tree && getChildren(tree.nodesRef.current, nodeId).some(node => {
|
|
4080
4623
|
var _node$context5;
|
|
4081
|
-
return contains((_node$context5 = node.context) == null ?
|
|
4624
|
+
return contains((_node$context5 = node.context) == null ? void 0 : _node$context5.elements.floating, activeEl);
|
|
4082
4625
|
});
|
|
4083
4626
|
const shouldFocusReference = isFocusInsideFloatingTree || openEvent && ['click', 'mousedown'].includes(openEvent.type);
|
|
4084
4627
|
if (shouldFocusReference && refs.domReference.current) {
|
|
@@ -4169,7 +4712,7 @@ function FloatingFocusManager(props) {
|
|
|
4169
4712
|
const shouldRenderGuards = !disabled && guards && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);
|
|
4170
4713
|
return /*#__PURE__*/React.createElement(React.Fragment, null, shouldRenderGuards && /*#__PURE__*/React.createElement(FocusGuard, {
|
|
4171
4714
|
"data-type": "inside",
|
|
4172
|
-
ref: portalContext == null ?
|
|
4715
|
+
ref: portalContext == null ? void 0 : portalContext.beforeInsideRef,
|
|
4173
4716
|
onFocus: event => {
|
|
4174
4717
|
if (modal) {
|
|
4175
4718
|
const els = getTabbableElements();
|
|
@@ -4187,7 +4730,7 @@ function FloatingFocusManager(props) {
|
|
|
4187
4730
|
}
|
|
4188
4731
|
}), !isUntrappedTypeableCombobox && renderDismissButton('start'), children, renderDismissButton('end'), shouldRenderGuards && /*#__PURE__*/React.createElement(FocusGuard, {
|
|
4189
4732
|
"data-type": "inside",
|
|
4190
|
-
ref: portalContext == null ?
|
|
4733
|
+
ref: portalContext == null ? void 0 : portalContext.afterInsideRef,
|
|
4191
4734
|
onFocus: event => {
|
|
4192
4735
|
if (modal) {
|
|
4193
4736
|
enqueueFocus(getTabbableElements()[0]);
|
|
@@ -4218,7 +4761,7 @@ function isSpaceIgnored(element) {
|
|
|
4218
4761
|
* @see https://floating-ui.com/docs/useClick
|
|
4219
4762
|
*/
|
|
4220
4763
|
function useClick(context, props) {
|
|
4221
|
-
if (props ===
|
|
4764
|
+
if (props === void 0) {
|
|
4222
4765
|
props = {};
|
|
4223
4766
|
}
|
|
4224
4767
|
const {
|
|
@@ -4322,8 +4865,8 @@ const captureHandlerKeys = {
|
|
|
4322
4865
|
const normalizeProp = normalizable => {
|
|
4323
4866
|
var _normalizable$escapeK, _normalizable$outside;
|
|
4324
4867
|
return {
|
|
4325
|
-
escapeKey: typeof normalizable === 'boolean' ? normalizable : (_normalizable$escapeK = normalizable == null ?
|
|
4326
|
-
outsidePress: typeof normalizable === 'boolean' ? normalizable : (_normalizable$outside = normalizable == null ?
|
|
4868
|
+
escapeKey: typeof normalizable === 'boolean' ? normalizable : (_normalizable$escapeK = normalizable == null ? void 0 : normalizable.escapeKey) != null ? _normalizable$escapeK : false,
|
|
4869
|
+
outsidePress: typeof normalizable === 'boolean' ? normalizable : (_normalizable$outside = normalizable == null ? void 0 : normalizable.outsidePress) != null ? _normalizable$outside : true
|
|
4327
4870
|
};
|
|
4328
4871
|
};
|
|
4329
4872
|
/**
|
|
@@ -4332,7 +4875,7 @@ const normalizeProp = normalizable => {
|
|
|
4332
4875
|
* @see https://floating-ui.com/docs/useDismiss
|
|
4333
4876
|
*/
|
|
4334
4877
|
function useDismiss(context, props) {
|
|
4335
|
-
if (props ===
|
|
4878
|
+
if (props === void 0) {
|
|
4336
4879
|
props = {};
|
|
4337
4880
|
}
|
|
4338
4881
|
const {
|
|
@@ -4377,7 +4920,7 @@ function useDismiss(context, props) {
|
|
|
4377
4920
|
if (isComposingRef.current) {
|
|
4378
4921
|
return;
|
|
4379
4922
|
}
|
|
4380
|
-
const nodeId = (_dataRef$current$floa = dataRef.current.floatingContext) == null ?
|
|
4923
|
+
const nodeId = (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId;
|
|
4381
4924
|
const children = tree ? getChildren(tree.nodesRef.current, nodeId) : [];
|
|
4382
4925
|
if (!escapeKeyBubbles) {
|
|
4383
4926
|
event.stopPropagation();
|
|
@@ -4464,7 +5007,7 @@ function useDismiss(context, props) {
|
|
|
4464
5007
|
// check for. Plus, for modal dialogs with backdrops, it is more
|
|
4465
5008
|
// important that the backdrop is checked but not so much the window.
|
|
4466
5009
|
if (canScrollY) {
|
|
4467
|
-
const isRTL = getComputedStyle(target).direction === 'rtl';
|
|
5010
|
+
const isRTL = getComputedStyle$1(target).direction === 'rtl';
|
|
4468
5011
|
if (isRTL) {
|
|
4469
5012
|
xCond = event.offsetX <= target.offsetWidth - target.clientWidth;
|
|
4470
5013
|
}
|
|
@@ -4473,10 +5016,10 @@ function useDismiss(context, props) {
|
|
|
4473
5016
|
return;
|
|
4474
5017
|
}
|
|
4475
5018
|
}
|
|
4476
|
-
const nodeId = (_dataRef$current$floa2 = dataRef.current.floatingContext) == null ?
|
|
5019
|
+
const nodeId = (_dataRef$current$floa2 = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa2.nodeId;
|
|
4477
5020
|
const targetIsInsideChildren = tree && getChildren(tree.nodesRef.current, nodeId).some(node => {
|
|
4478
5021
|
var _node$context;
|
|
4479
|
-
return isEventTargetWithin(event, (_node$context = node.context) == null ?
|
|
5022
|
+
return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.elements.floating);
|
|
4480
5023
|
});
|
|
4481
5024
|
if (isEventTargetWithin(event, elements.floating) || isEventTargetWithin(event, elements.domReference) || targetIsInsideChildren) {
|
|
4482
5025
|
return;
|
|
@@ -4554,7 +5097,7 @@ function useDismiss(context, props) {
|
|
|
4554
5097
|
// Ignore the visual viewport for scrolling dismissal (allow pinch-zoom)
|
|
4555
5098
|
ancestors = ancestors.filter(ancestor => {
|
|
4556
5099
|
var _doc$defaultView;
|
|
4557
|
-
return ancestor !== ((_doc$defaultView = doc.defaultView) == null ?
|
|
5100
|
+
return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);
|
|
4558
5101
|
});
|
|
4559
5102
|
ancestors.forEach(ancestor => {
|
|
4560
5103
|
ancestor.addEventListener('scroll', onScroll, {
|
|
@@ -4654,7 +5197,7 @@ function useFloatingRootContext(options) {
|
|
|
4654
5197
|
* @see https://floating-ui.com/docs/useFloating
|
|
4655
5198
|
*/
|
|
4656
5199
|
function useFloating(options) {
|
|
4657
|
-
if (options ===
|
|
5200
|
+
if (options === void 0) {
|
|
4658
5201
|
options = {};
|
|
4659
5202
|
}
|
|
4660
5203
|
const {
|
|
@@ -4672,7 +5215,7 @@ function useFloating(options) {
|
|
|
4672
5215
|
const computedElements = rootContext.elements;
|
|
4673
5216
|
const [_domReference, setDomReference] = React.useState(null);
|
|
4674
5217
|
const [positionReference, _setPositionReference] = React.useState(null);
|
|
4675
|
-
const optionDomReference = computedElements == null ?
|
|
5218
|
+
const optionDomReference = computedElements == null ? void 0 : computedElements.domReference;
|
|
4676
5219
|
const domReference = optionDomReference || _domReference;
|
|
4677
5220
|
const domReferenceRef = React.useRef(null);
|
|
4678
5221
|
const tree = useFloatingTree();
|
|
@@ -4735,7 +5278,7 @@ function useFloating(options) {
|
|
|
4735
5278
|
}), [position, refs, elements, nodeId, rootContext]);
|
|
4736
5279
|
index(() => {
|
|
4737
5280
|
rootContext.dataRef.current.floatingContext = context;
|
|
4738
|
-
const node = tree == null ?
|
|
5281
|
+
const node = tree == null ? void 0 : tree.nodesRef.current.find(node => node.id === nodeId);
|
|
4739
5282
|
if (node) {
|
|
4740
5283
|
node.context = context;
|
|
4741
5284
|
}
|
|
@@ -4754,7 +5297,7 @@ function useFloating(options) {
|
|
|
4754
5297
|
* @see https://floating-ui.com/docs/useFocus
|
|
4755
5298
|
*/
|
|
4756
5299
|
function useFocus(context, props) {
|
|
4757
|
-
if (props ===
|
|
5300
|
+
if (props === void 0) {
|
|
4758
5301
|
props = {};
|
|
4759
5302
|
}
|
|
4760
5303
|
const {
|
|
@@ -4864,7 +5407,7 @@ function useFocus(context, props) {
|
|
|
4864
5407
|
// as it will only point to the shadow host of the newly focused element
|
|
4865
5408
|
// and not the element that actually has received focus if it is located
|
|
4866
5409
|
// inside a shadow root.
|
|
4867
|
-
if (contains((_dataRef$current$floa = dataRef.current.floatingContext) == null ?
|
|
5410
|
+
if (contains((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains(elements.domReference, activeEl) || movedToFocusGuard) {
|
|
4868
5411
|
return;
|
|
4869
5412
|
}
|
|
4870
5413
|
onOpenChange(false, nativeEvent, 'focus');
|
|
@@ -4923,7 +5466,7 @@ function mergeProps(userProps, propsList, elementKey) {
|
|
|
4923
5466
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4924
5467
|
args[_key] = arguments[_key];
|
|
4925
5468
|
}
|
|
4926
|
-
return (_map$get2 = map.get(key)) == null ?
|
|
5469
|
+
return (_map$get2 = map.get(key)) == null ? void 0 : _map$get2.map(fn => fn(...args)).find(val => val !== undefined);
|
|
4927
5470
|
};
|
|
4928
5471
|
}
|
|
4929
5472
|
} else {
|
|
@@ -4941,12 +5484,12 @@ function mergeProps(userProps, propsList, elementKey) {
|
|
|
4941
5484
|
* @see https://floating-ui.com/docs/useInteractions
|
|
4942
5485
|
*/
|
|
4943
5486
|
function useInteractions(propsList) {
|
|
4944
|
-
if (propsList ===
|
|
5487
|
+
if (propsList === void 0) {
|
|
4945
5488
|
propsList = [];
|
|
4946
5489
|
}
|
|
4947
|
-
const referenceDeps = propsList.map(key => key == null ?
|
|
4948
|
-
const floatingDeps = propsList.map(key => key == null ?
|
|
4949
|
-
const itemDeps = propsList.map(key => key == null ?
|
|
5490
|
+
const referenceDeps = propsList.map(key => key == null ? void 0 : key.reference);
|
|
5491
|
+
const floatingDeps = propsList.map(key => key == null ? void 0 : key.floating);
|
|
5492
|
+
const itemDeps = propsList.map(key => key == null ? void 0 : key.item);
|
|
4950
5493
|
const getReferenceProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'reference'),
|
|
4951
5494
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4952
5495
|
referenceDeps);
|
|
@@ -5062,7 +5605,7 @@ function useListNavigation(context, props) {
|
|
|
5062
5605
|
const [activeId, setActiveId] = React.useState();
|
|
5063
5606
|
const [virtualId, setVirtualId] = React.useState();
|
|
5064
5607
|
const focusItem = useEffectEvent(function (listRef, indexRef, forceScrollIntoView) {
|
|
5065
|
-
if (forceScrollIntoView ===
|
|
5608
|
+
if (forceScrollIntoView === void 0) {
|
|
5066
5609
|
forceScrollIntoView = false;
|
|
5067
5610
|
}
|
|
5068
5611
|
function runFocus(item) {
|
|
@@ -5193,7 +5736,7 @@ function useListNavigation(context, props) {
|
|
|
5193
5736
|
return;
|
|
5194
5737
|
}
|
|
5195
5738
|
const nodes = tree.nodesRef.current;
|
|
5196
|
-
const parent = (_nodes$find = nodes.find(node => node.id === parentId)) == null || (_nodes$find = _nodes$find.context) == null ?
|
|
5739
|
+
const parent = (_nodes$find = nodes.find(node => node.id === parentId)) == null || (_nodes$find = _nodes$find.context) == null ? void 0 : _nodes$find.elements.floating;
|
|
5197
5740
|
const activeEl = activeElement(getDocument(elements.floating));
|
|
5198
5741
|
const treeContainsActiveEl = nodes.some(node => node.context && contains(node.context.elements.floating, activeEl));
|
|
5199
5742
|
if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {
|
|
@@ -5453,7 +5996,7 @@ function useListNavigation(context, props) {
|
|
|
5453
5996
|
const isMainKey = isMainOrientationKey(event.key, orientation);
|
|
5454
5997
|
const isNavigationKey = (nested ? isCrossOpenKey : isMainKey) || event.key === 'Enter' || event.key.trim() === '';
|
|
5455
5998
|
if (virtual && open) {
|
|
5456
|
-
const rootNode = tree == null ?
|
|
5999
|
+
const rootNode = tree == null ? void 0 : tree.nodesRef.current.find(node => node.parentId == null);
|
|
5457
6000
|
const deepestNode = tree && rootNode ? getDeepestNode(tree.nodesRef.current, rootNode.id) : null;
|
|
5458
6001
|
if (isMoveKey && deepestNode && virtualItemRef) {
|
|
5459
6002
|
const eventObject = new KeyboardEvent('keydown', {
|
|
@@ -5462,8 +6005,8 @@ function useListNavigation(context, props) {
|
|
|
5462
6005
|
});
|
|
5463
6006
|
if (isCrossOpenKey || isCrossCloseKey) {
|
|
5464
6007
|
var _deepestNode$context, _deepestNode$context2;
|
|
5465
|
-
const isCurrentTarget = ((_deepestNode$context = deepestNode.context) == null ?
|
|
5466
|
-
const dispatchItem = isCrossCloseKey && !isCurrentTarget ? (_deepestNode$context2 = deepestNode.context) == null ?
|
|
6008
|
+
const isCurrentTarget = ((_deepestNode$context = deepestNode.context) == null ? void 0 : _deepestNode$context.elements.domReference) === event.currentTarget;
|
|
6009
|
+
const dispatchItem = isCrossCloseKey && !isCurrentTarget ? (_deepestNode$context2 = deepestNode.context) == null ? void 0 : _deepestNode$context2.elements.domReference : isCrossOpenKey ? listRef.current.find(item => (item == null ? void 0 : item.id) === activeId) : null;
|
|
5467
6010
|
if (dispatchItem) {
|
|
5468
6011
|
stopEvent(event);
|
|
5469
6012
|
dispatchItem.dispatchEvent(eventObject);
|
|
@@ -5543,7 +6086,7 @@ const componentRoleToAriaRoleMap = /*#__PURE__*/new Map([['select', 'listbox'],
|
|
|
5543
6086
|
*/
|
|
5544
6087
|
function useRole(context, props) {
|
|
5545
6088
|
var _componentRoleToAriaR;
|
|
5546
|
-
if (props ===
|
|
6089
|
+
if (props === void 0) {
|
|
5547
6090
|
props = {};
|
|
5548
6091
|
}
|
|
5549
6092
|
const {
|
|
@@ -5701,7 +6244,7 @@ function useTypeahead(context, props) {
|
|
|
5701
6244
|
});
|
|
5702
6245
|
const onKeyDown = useEffectEvent(event => {
|
|
5703
6246
|
function getMatchingIndex(list, orderedList, string) {
|
|
5704
|
-
const str = findMatchRef.current ? findMatchRef.current(orderedList, string) : orderedList.find(text => (text == null ?
|
|
6247
|
+
const str = findMatchRef.current ? findMatchRef.current(orderedList, string) : orderedList.find(text => (text == null ? void 0 : text.toLocaleLowerCase().indexOf(string.toLocaleLowerCase())) === 0);
|
|
5705
6248
|
return str ? list.indexOf(str) : -1;
|
|
5706
6249
|
}
|
|
5707
6250
|
const listContent = listRef.current;
|
|
@@ -5728,7 +6271,7 @@ function useTypeahead(context, props) {
|
|
|
5728
6271
|
// allow it in this case, too.
|
|
5729
6272
|
const allowRapidSuccessionOfFirstLetter = listContent.every(text => {
|
|
5730
6273
|
var _text$, _text$2;
|
|
5731
|
-
return text ? ((_text$ = text[0]) == null ?
|
|
6274
|
+
return text ? ((_text$ = text[0]) == null ? void 0 : _text$.toLocaleLowerCase()) !== ((_text$2 = text[1]) == null ? void 0 : _text$2.toLocaleLowerCase()) : true;
|
|
5732
6275
|
});
|
|
5733
6276
|
|
|
5734
6277
|
// Allows the user to cycle through items that start with the same letter
|
|
@@ -5796,7 +6339,7 @@ function isInside(point, rect) {
|
|
|
5796
6339
|
* @see https://floating-ui.com/docs/useHover#safepolygon
|
|
5797
6340
|
*/
|
|
5798
6341
|
function safePolygon(options) {
|
|
5799
|
-
if (options ===
|
|
6342
|
+
if (options === void 0) {
|
|
5800
6343
|
options = {};
|
|
5801
6344
|
}
|
|
5802
6345
|
const {
|
|
@@ -5893,7 +6436,7 @@ function safePolygon(options) {
|
|
|
5893
6436
|
let {
|
|
5894
6437
|
context
|
|
5895
6438
|
} = _ref2;
|
|
5896
|
-
return context == null ?
|
|
6439
|
+
return context == null ? void 0 : context.open;
|
|
5897
6440
|
})) {
|
|
5898
6441
|
return;
|
|
5899
6442
|
}
|
|
@@ -5985,5 +6528,5 @@ function safePolygon(options) {
|
|
|
5985
6528
|
return fn;
|
|
5986
6529
|
}
|
|
5987
6530
|
|
|
5988
|
-
export {
|
|
5989
|
-
//# sourceMappingURL=floating-ui.react-
|
|
6531
|
+
export { useListNavigation as A, useTypeahead as B, FloatingNode as C, FloatingList as D, FloatingTree as E, FloatingPortal as F, FloatingFocusManager as a, FloatingArrow as b, useFloating as c, shift as d, arrow as e, flip as f, useClick as g, useHover as h, safePolygon as i, useDismiss as j, useRole as k, limitShift as l, useInteractions as m, autoUpdate as n, offset as o, computePosition as p, useDelayGroup as q, useDelayGroupContext as r, size as s, tabbable as t, useMergeRefs as u, useFocus as v, useListItem as w, useFloatingTree as x, useFloatingNodeId as y, useFloatingParentNodeId as z };
|
|
6532
|
+
//# sourceMappingURL=floating-ui.react-Domgunz0.js.map
|