@pnx-mixtape/mxds 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -23
- package/dist/build/accordion.css +1 -98
- package/dist/build/accordion.entry.js +1 -83
- package/dist/build/base.css +1 -996
- package/dist/build/breadcrumb.css +1 -51
- package/dist/build/button.css +1 -132
- package/dist/build/callout.css +1 -11
- package/dist/build/card.css +1 -149
- package/dist/build/carousel.css +1 -0
- package/dist/build/chunks/Accordion-RtUfbsTy.js +1 -0
- package/dist/build/chunks/disclosure-widget-CPdkUWkq.js +1 -0
- package/dist/build/chunks/drop-menu.entry-BqBzLfVC.js +1 -0
- package/dist/build/chunks/keyboard-Cs0cduxq.js +1 -0
- package/dist/build/chunks/polyfills-5KNOJw2W.js +1 -0
- package/dist/build/chunks/popover-CiVl-0jk.js +1 -0
- package/dist/build/chunks/utilities-CE6xwgqF.js +2 -0
- package/dist/build/constants.css +1 -120
- package/dist/build/container-grid.css +1 -208
- package/dist/build/content-block.css +1 -36
- package/dist/build/dialog.css +1 -98
- package/dist/build/dialog.entry.js +1 -113
- package/dist/build/drop-menu.css +1 -78
- package/dist/build/drop-menu.entry.js +1 -2
- package/dist/build/drupal.css +1 -74
- package/dist/build/filters.css +1 -105
- package/dist/build/filters.entry.js +1 -137
- package/dist/build/footer.css +1 -151
- package/dist/build/form.css +1 -517
- package/dist/build/global-alert.css +1 -60
- package/dist/build/global-alert.entry.js +1 -68
- package/dist/build/grid.css +1 -200
- package/dist/build/header.css +1 -153
- package/dist/build/header.entry.js +1 -103
- package/dist/build/hero-banner.css +1 -62
- package/dist/build/icon.css +1 -399
- package/dist/build/in-page-alert.css +1 -94
- package/dist/build/in-page-navigation.css +1 -17
- package/dist/build/in-page-navigation.entry.js +1 -99
- package/dist/build/link-list.css +1 -45
- package/dist/build/list-item.css +1 -114
- package/dist/build/masthead.css +1 -53
- package/dist/build/navigation.css +1 -396
- package/dist/build/navigation.entry.js +1 -124
- package/dist/build/page.css +1 -80
- package/dist/build/pagination.css +1 -130
- package/dist/build/results-bar.css +1 -0
- package/dist/build/section.css +1 -163
- package/dist/build/side-navigation.css +1 -88
- package/dist/build/sidebar.css +1 -59
- package/dist/build/social-links.css +1 -20
- package/dist/build/steps.css +1 -118
- package/dist/build/sticky.css +1 -47
- package/dist/build/sticky.entry.js +1 -60
- package/dist/build/tabs.css +1 -109
- package/dist/build/tabs.entry.js +1 -202
- package/dist/build/tag.css +1 -71
- package/dist/build/utilities.css +1 -178
- package/package.json +56 -64
- package/src/Atom/Background/Backgrounds.stories.ts +13 -1
- package/src/Atom/Background/__snapshots__/Backgrounds.stories.ts.snap +157 -81
- package/src/Atom/Background/_background.css +16 -10
- package/src/Atom/Base.mdx +25 -17
- package/src/Atom/Button/Button.stories.ts +1 -4
- package/src/Atom/Button/Button.stories.tsx +1 -1
- package/src/Atom/Button/__snapshots__/Button.stories.ts.snap +47 -37
- package/src/Atom/Button/_buttons-styles.css +7 -7
- package/src/Atom/Button/_buttons.css +1 -6
- package/src/Atom/DefinitionList/DefinitionList.stories.ts +32 -0
- package/src/Atom/DefinitionList/DefinitionList.stories.tsx +1 -1
- package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.ts.snap +32 -0
- package/src/Atom/DefinitionList/definition-list.twig +9 -0
- package/src/Atom/Heading/Heading.stories.ts +1 -1
- package/src/Atom/Heading/Heading.stories.tsx +1 -1
- package/src/Atom/Heading/__snapshots__/Heading.stories.ts.snap +5 -3
- package/src/Atom/Heading/_headings.css +24 -24
- package/src/Atom/Icon/Icon.mdx +1 -1
- package/src/Atom/Icon/Icon.stories.ts +1 -1
- package/src/Atom/Icon/Icon.stories.tsx +1 -1
- package/src/Atom/Icon/Icon.tsx +2 -2
- package/src/Atom/Icon/__snapshots__/Icon.stories.ts.snap +14 -8
- package/src/Atom/Icon/_icon.css +4 -4
- package/src/Atom/Image/Image.stories.ts +1 -1
- package/src/Atom/Image/__snapshots__/Image.stories.ts.snap +7 -5
- package/src/Atom/Image/_image.css +2 -7
- package/src/Atom/Link/Link.stories.ts +1 -1
- package/src/Atom/Link/Link.stories.tsx +1 -1
- package/src/Atom/Link/__snapshots__/Link.stories.ts.snap +50 -37
- package/src/Atom/Link/_links.css +2 -22
- package/src/Atom/Link/link.twig +1 -0
- package/src/Atom/Media/Media.stories.ts +2 -1
- package/src/Atom/Media/Media.stories.tsx +1 -1
- package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +11 -24
- package/src/Atom/Media/_media.css +8 -8
- package/src/Atom/Spacing/Spacing.stories.ts +1 -1
- package/src/Atom/Spacing/__snapshots__/Spacing.stories.ts.snap +5 -3
- package/src/Atom/Table/Table.stories.ts +1 -1
- package/src/Atom/Table/TableResponsive.stories.ts +1 -1
- package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +256 -248
- package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +65 -63
- package/src/Atom/Text/Text.stories.tsx +1 -1
- package/src/Atom/Text/TextSizes.stories.ts +1 -1
- package/src/Atom/Text/__snapshots__/TextSizes.stories.ts.snap +59 -55
- package/src/Atom/Text/_text-sizes.css +17 -17
- package/src/Atom/Text/rich-text.twig +9 -0
- package/src/Atom/Video/Video.stories.ts +1 -1
- package/src/Atom/Video/__snapshots__/Video.stories.ts.snap +9 -7
- package/src/Atom/_animated.css +0 -14
- package/src/Atom/_generic.css +57 -15
- package/src/Atom/base.css +1 -1
- package/src/Component/Accordion/Accordion.stories.ts +1 -4
- package/src/Component/Accordion/Accordion.stories.tsx +1 -2
- package/src/Component/Accordion/__snapshots__/Accordion.stories.ts.snap +60 -56
- package/src/Component/Accordion/__snapshots__/Accordion.stories.tsx.snap +0 -1
- package/src/Component/Accordion/accordion.css +16 -4
- package/src/Component/Breadcrumb/Breadcrumb.stories.ts +1 -1
- package/src/Component/Breadcrumb/Breadcrumb.stories.tsx +1 -1
- package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.ts.snap +31 -29
- package/src/Component/Breadcrumb/breadcrumb.css +4 -0
- package/src/Component/Callout/Callout.stories.ts +1 -9
- package/src/Component/Callout/__snapshots__/Callout.stories.ts.snap +9 -7
- package/src/Component/Card/Card.stories.ts +11 -18
- package/src/Component/Card/Card.stories.tsx +1 -1
- package/src/Component/Card/Card.tsx +9 -5
- package/src/Component/Card/__snapshots__/Card.stories.ts.snap +257 -229
- package/src/Component/Card/card.css +36 -33
- package/src/Component/Card/card.twig +6 -6
- package/src/Component/Carousel/Carousel.stories.ts +201 -0
- package/src/Component/Carousel/Elements/Carousel.ts +241 -0
- package/src/Component/Carousel/__snapshots__/Carousel.stories.ts.snap +912 -0
- package/src/Component/Carousel/carousel.css +119 -0
- package/src/Component/Carousel/carousel.twig +27 -0
- package/src/Component/ContentBlock/ContentBlock.stories.ts +27 -19
- package/src/Component/ContentBlock/ContentBlock.stories.tsx +1 -1
- package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.ts.snap +153 -93
- package/src/Component/Dialog/Dialog.stories.ts +75 -7
- package/src/Component/Dialog/Dialog.stories.tsx +1 -1
- package/src/Component/Dialog/Elements/Dialog.ts +14 -34
- package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +102 -66
- package/src/Component/Dialog/dialog.css +32 -20
- package/src/Component/Dialog/dialog.twig +14 -15
- package/src/Component/DropMenu/Components/DropMenuContext.tsx +7 -9
- package/src/Component/DropMenu/Components/DropMenuItem.tsx +1 -1
- package/src/Component/DropMenu/DropMenu.stories.ts +1 -1
- package/src/Component/DropMenu/DropMenu.stories.tsx +1 -1
- package/src/Component/DropMenu/Elements/DropMenu.ts +1 -1
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +28 -26
- package/src/Component/DropMenu/drop-menu.css +11 -3
- package/src/Component/Filters/Filters.stories.ts +1 -4
- package/src/Component/Filters/__snapshots__/Filters.stories.ts.snap +397 -389
- package/src/Component/Filters/filters.css +14 -5
- package/src/Component/GlobalAlert/GlobalAlert.stories.ts +1 -1
- package/src/Component/GlobalAlert/GlobalAlert.stories.tsx +1 -1
- package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.ts.snap +33 -29
- package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.tsx.snap +2 -2
- package/src/Component/GlobalAlert/global-alert.css +2 -2
- package/src/Component/HeroBanner/HeroBanner.stories.ts +1 -4
- package/src/Component/HeroBanner/HeroBanner.stories.tsx +1 -1
- package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +68 -64
- package/src/Component/HeroBanner/hero-banner.css +6 -1
- package/src/Component/HeroBanner/hero-banner.twig +3 -4
- package/src/Component/InPageAlert/InPageAlert.stories.ts +1 -1
- package/src/Component/InPageAlert/InPageAlert.stories.tsx +1 -1
- package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.ts.snap +10 -8
- package/src/Component/InPageAlert/in-page-alert.css +8 -8
- package/src/Component/InPageNavigation/Elements/InPageNavigation.ts +1 -1
- package/src/Component/InPageNavigation/InPageNavigation.stories.ts +1 -4
- package/src/Component/InPageNavigation/InPageNavigation.stories.tsx +1 -1
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +64 -62
- package/src/Component/LinkList/LinkList.stories.ts +1 -1
- package/src/Component/LinkList/LinkList.stories.tsx +1 -1
- package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +31 -29
- package/src/Component/ListItem/ListItem.stories.ts +2 -4
- package/src/Component/ListItem/ListItem.stories.tsx +1 -1
- package/src/Component/ListItem/__snapshots__/ListItem.stories.ts.snap +162 -148
- package/src/Component/ListItem/list-item.css +7 -88
- package/src/Component/ListItem/list-item.twig +8 -8
- package/src/Component/Navigation/Dropdown.stories.tsx +1 -1
- package/src/Component/Navigation/Navigation.stories.ts +1 -1
- package/src/Component/Navigation/Navigation.stories.tsx +1 -1
- package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +291 -283
- package/src/Component/Navigation/_navigation-collapsible.css +11 -14
- package/src/Component/Navigation/_navigation-dropdown.css +11 -17
- package/src/Component/Pagination/Components/PaginationContext.tsx +4 -8
- package/src/Component/Pagination/Pagination.stories.ts +1 -1
- package/src/Component/Pagination/Pagination.stories.tsx +1 -1
- package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +59 -57
- package/src/Component/Pagination/pagination.css +2 -8
- package/src/Component/ResultsBar/Components/ResultsBarInfo.tsx +28 -0
- package/src/Component/ResultsBar/Components/ResultsBarSort.tsx +17 -0
- package/src/Component/ResultsBar/ResultsBar.stories.ts +37 -0
- package/src/Component/ResultsBar/ResultsBar.stories.tsx +50 -0
- package/src/Component/ResultsBar/ResultsBar.tsx +7 -0
- package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.ts.snap +54 -0
- package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.tsx.snap +53 -0
- package/src/Component/ResultsBar/results-bar.css +19 -0
- package/src/Component/ResultsBar/results-bar.twig +24 -0
- package/src/Component/SideNavigation/SideNavigation.stories.ts +1 -1
- package/src/Component/SideNavigation/__snapshots__/SideNavigation.stories.ts.snap +82 -80
- package/src/Component/SideNavigation/side-navigation.css +2 -8
- package/src/Component/SocialLinks/SocialLinks.stories.ts +1 -1
- package/src/Component/SocialLinks/__snapshots__/SocialLinks.stories.ts.snap +30 -28
- package/src/Component/Steps/Steps.stories.ts +1 -1
- package/src/Component/Steps/__snapshots__/Steps.stories.ts.snap +86 -78
- package/src/Component/Steps/steps.css +1 -1
- package/src/Component/Sticky/Sticky.stories.ts +1 -1
- package/src/Component/Sticky/Sticky.stories.tsx +1 -1
- package/src/Component/Sticky/__snapshots__/Sticky.stories.ts.snap +9 -7
- package/src/Component/Tabs/Tabs.stories.ts +1 -1
- package/src/Component/Tabs/Tabs.stories.tsx +1 -1
- package/src/Component/Tabs/Tabs.tsx +4 -4
- package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +73 -71
- package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +0 -2
- package/src/Component/Tabs/tabs.css +14 -21
- package/src/Component/Tag/Tag.stories.ts +1 -1
- package/src/Component/Tag/Tag.stories.tsx +1 -1
- package/src/Component/Tag/__snapshots__/Tag.stories.ts.snap +59 -53
- package/src/Component/Tag/tag.css +6 -6
- package/src/Component/Tile/Tile.stories.ts +38 -12
- package/src/Component/Tile/Tile.stories.tsx +2 -2
- package/src/Component/Tile/Tile.tsx +30 -17
- package/src/Component/Tile/__snapshots__/Tile.stories.ts.snap +49 -75
- package/src/Component/Tile/__snapshots__/Tile.stories.tsx.snap +6 -16
- package/src/Form/Checkbox/Checkbox.stories.ts +1 -1
- package/src/Form/Checkbox/FormCheckbox.stories.tsx +1 -1
- package/src/Form/Checkbox/FormCheckbox.tsx +5 -7
- package/src/Form/Checkbox/__snapshots__/Checkbox.stories.ts.snap +23 -19
- package/src/Form/Description/Description.stories.ts +1 -1
- package/src/Form/Description/FormDescription.stories.tsx +1 -1
- package/src/Form/Description/FormStatus.stories.ts +1 -1
- package/src/Form/Description/__snapshots__/Description.stories.ts.snap +7 -5
- package/src/Form/Description/__snapshots__/FormStatus.stories.ts.snap +14 -10
- package/src/Form/Form/Form.stories.tsx +1 -1
- package/src/Form/Form/FormTitle.stories.tsx +1 -1
- package/src/Form/FormItem/FormItem.stories.ts +1 -4
- package/src/Form/FormItem/FormItem.stories.tsx +1 -1
- package/src/Form/FormItem/__snapshots__/FormItem.stories.ts.snap +119 -109
- package/src/Form/FormItem/__snapshots__/FormItem.stories.tsx.snap +4 -4
- package/src/Form/Label/FormLabel.stories.tsx +1 -1
- package/src/Form/Label/FormLabel.tsx +1 -1
- package/src/Form/Label/Label.stories.ts +1 -1
- package/src/Form/Label/__snapshots__/Label.stories.ts.snap +21 -15
- package/src/Form/Radio/FormRadio.stories.tsx +1 -1
- package/src/Form/Radio/FormRadio.tsx +4 -4
- package/src/Form/Radio/Radio.stories.ts +1 -1
- package/src/Form/Radio/__snapshots__/Radio.stories.ts.snap +55 -51
- package/src/Form/Search/Search.stories.ts +1 -4
- package/src/Form/Search/__snapshots__/Search.stories.ts.snap +23 -21
- package/src/Form/Select/FormSelect.stories.tsx +1 -1
- package/src/Form/Select/FormSelect.tsx +1 -1
- package/src/Form/Select/Select.stories.ts +1 -1
- package/src/Form/Select/__snapshots__/Select.stories.ts.snap +18 -16
- package/src/Form/TextInput/FormText.stories.tsx +1 -1
- package/src/Form/TextInput/InputDivider.stories.ts +1 -1
- package/src/Form/TextInput/TextInput.stories.ts +1 -1
- package/src/Form/TextInput/__snapshots__/FormText.stories.tsx.snap +1 -1
- package/src/Form/TextInput/__snapshots__/InputDivider.stories.ts.snap +24 -22
- package/src/Form/TextInput/__snapshots__/TextInput.stories.ts.snap +18 -14
- package/src/Form/Textarea/FormTextarea.stories.tsx +1 -1
- package/src/Form/Textarea/Textarea.stories.ts +1 -1
- package/src/Form/Textarea/__snapshots__/FormTextarea.stories.tsx.snap +1 -1
- package/src/Form/Textarea/__snapshots__/Textarea.stories.ts.snap +9 -7
- package/src/Form/form.css +24 -34
- package/src/Introduction.mdx +40 -0
- package/src/Layout/Footer/Footer.stories.ts +1 -6
- package/src/Layout/Footer/Footer.stories.tsx +1 -1
- package/src/Layout/Footer/__snapshots__/Footer.stories.ts.snap +10 -10
- package/src/Layout/Footer/footer.css +2 -6
- package/src/Layout/Footer/footer.twig +0 -1
- package/src/Layout/Grid/Grid.stories.ts +8 -8
- package/src/Layout/Grid/Grid.stories.tsx +2 -2
- package/src/Layout/Grid/__snapshots__/Grid.stories.ts.snap +38 -32
- package/src/Layout/Grid/container-grid.css +10 -10
- package/src/Layout/Grid/grid-item.twig +3 -1
- package/src/Layout/Grid/grid.css +3 -3
- package/src/Layout/Header/Header.stories.ts +1 -6
- package/src/Layout/Header/Header.stories.tsx +1 -1
- package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +11 -11
- package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +3 -3
- package/src/Layout/Header/_header.css +18 -16
- package/src/Layout/Header/header.twig +1 -2
- package/src/Layout/Masthead/Masthead.stories.ts +1 -3
- package/src/Layout/Masthead/__snapshots__/Masthead.stories.ts.snap +6 -6
- package/src/Layout/Masthead/masthead.twig +0 -2
- package/src/Layout/Page/Page.stories.tsx +1 -1
- package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +3 -3
- package/src/Layout/Page/page.css +16 -40
- package/src/Layout/Page/page.twig +6 -1
- package/src/Layout/Section/Background.stories.ts +60 -8
- package/src/Layout/Section/Breakouts.stories.ts +1 -3
- package/src/Layout/Section/Flow.stories.ts +1 -3
- package/src/Layout/Section/Section.stories.ts +1 -6
- package/src/Layout/Section/Section.stories.tsx +1 -1
- package/src/Layout/Section/SectionGrid.stories.tsx +1 -1
- package/src/Layout/Section/__snapshots__/Background.stories.ts.snap +36 -24
- package/src/Layout/Section/__snapshots__/Breakouts.stories.ts.snap +54 -52
- package/src/Layout/Section/__snapshots__/Flow.stories.ts.snap +18 -18
- package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +2 -2
- package/src/Layout/Section/section.css +15 -18
- package/src/Layout/Section/section.twig +0 -1
- package/src/Layout/Section/twig/section-background.twig +29 -10
- package/src/Layout/Section/twig/sections-breakout.twig +28 -33
- package/src/Layout/Section/twig/sections-flow.twig +17 -17
- package/src/Layout/Section/twig/sections-stacked.twig +4 -4
- package/src/Layout/Sidebar/Sidebar.stories.ts +1 -3
- package/src/Layout/Sidebar/Sidebar.stories.tsx +1 -1
- package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.ts.snap +5 -5
- package/src/Layout/Sidebar/sidebar.css +2 -18
- package/src/Utility/Context/ImageComponent.tsx +3 -6
- package/src/Utility/Context/LinkComponent.tsx +3 -6
- package/src/Utility/Drupal/drupal.css +1 -5
- package/src/Utility/Elements/breakpoint-loader.ts +0 -1
- package/src/Utility/Elements/cookie-compliance.ts +0 -1
- package/src/Utility/Elements/io-loader.ts +0 -1
- package/src/Utility/Hooks/useLocalStorage.ts +0 -1
- package/src/Utility/Hooks/useMediaQuery.ts +0 -1
- package/src/Utility/Hooks/useToggle.ts +0 -1
- package/src/Utility/global.d.ts +0 -1
- package/src/Utility/utilities.ts +0 -1
- package/src/constants.css +53 -24
- package/src/enums.ts +1 -2
- package/src/react.ts +3 -0
- package/src/tokens.js +19 -19
- package/dist/build/accordion.entry.js.map +0 -1
- package/dist/build/chunks/Accordion-DSze7pxN.js +0 -61
- package/dist/build/chunks/Accordion-DSze7pxN.js.map +0 -1
- package/dist/build/chunks/disclosure-widget-CQLPJ8Ta.js +0 -124
- package/dist/build/chunks/disclosure-widget-CQLPJ8Ta.js.map +0 -1
- package/dist/build/chunks/drop-menu.entry-BC6x9vst.js +0 -132
- package/dist/build/chunks/drop-menu.entry-BC6x9vst.js.map +0 -1
- package/dist/build/chunks/keyboard-C73DHu0c.js +0 -101
- package/dist/build/chunks/keyboard-C73DHu0c.js.map +0 -1
- package/dist/build/chunks/polyfills-CJ5uTmUJ.js +0 -749
- package/dist/build/chunks/polyfills-CJ5uTmUJ.js.map +0 -1
- package/dist/build/chunks/popover-wbPSyFRj.js +0 -654
- package/dist/build/chunks/popover-wbPSyFRj.js.map +0 -1
- package/dist/build/chunks/utilities-B4YZb689.js +0 -243
- package/dist/build/chunks/utilities-B4YZb689.js.map +0 -1
- package/dist/build/dialog.entry.js.map +0 -1
- package/dist/build/drop-menu.entry.js.map +0 -1
- package/dist/build/filters.entry.js.map +0 -1
- package/dist/build/global-alert.entry.js.map +0 -1
- package/dist/build/header.entry.js.map +0 -1
- package/dist/build/in-page-navigation.entry.js.map +0 -1
- package/dist/build/navigation.entry.js.map +0 -1
- package/dist/build/sticky.entry.js.map +0 -1
- package/dist/build/tabs.entry.js.map +0 -1
- package/dist/build/tiles.css +0 -61
- package/src/Component/Tile/tile.twig +0 -10
- package/src/Component/Tile/tiles.css +0 -58
- package/src/Component/Tile/twig/tiles.twig +0 -18
|
@@ -1,749 +0,0 @@
|
|
|
1
|
-
const min = Math.min;
|
|
2
|
-
const max = Math.max;
|
|
3
|
-
const round = Math.round;
|
|
4
|
-
const createCoords = (v) => ({
|
|
5
|
-
x: v,
|
|
6
|
-
y: v
|
|
7
|
-
});
|
|
8
|
-
function getSide(placement) {
|
|
9
|
-
return placement.split("-")[0];
|
|
10
|
-
}
|
|
11
|
-
function getAlignment(placement) {
|
|
12
|
-
return placement.split("-")[1];
|
|
13
|
-
}
|
|
14
|
-
function getOppositeAxis(axis) {
|
|
15
|
-
return axis === "x" ? "y" : "x";
|
|
16
|
-
}
|
|
17
|
-
function getAxisLength(axis) {
|
|
18
|
-
return axis === "y" ? "height" : "width";
|
|
19
|
-
}
|
|
20
|
-
function getSideAxis(placement) {
|
|
21
|
-
return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
|
|
22
|
-
}
|
|
23
|
-
function getAlignmentAxis(placement) {
|
|
24
|
-
return getOppositeAxis(getSideAxis(placement));
|
|
25
|
-
}
|
|
26
|
-
function rectToClientRect(rect) {
|
|
27
|
-
const {
|
|
28
|
-
x,
|
|
29
|
-
y,
|
|
30
|
-
width,
|
|
31
|
-
height
|
|
32
|
-
} = rect;
|
|
33
|
-
return {
|
|
34
|
-
width,
|
|
35
|
-
height,
|
|
36
|
-
top: y,
|
|
37
|
-
left: x,
|
|
38
|
-
right: x + width,
|
|
39
|
-
bottom: y + height,
|
|
40
|
-
x,
|
|
41
|
-
y
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
45
|
-
let {
|
|
46
|
-
reference,
|
|
47
|
-
floating
|
|
48
|
-
} = _ref;
|
|
49
|
-
const sideAxis = getSideAxis(placement);
|
|
50
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
51
|
-
const alignLength = getAxisLength(alignmentAxis);
|
|
52
|
-
const side = getSide(placement);
|
|
53
|
-
const isVertical = sideAxis === "y";
|
|
54
|
-
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
55
|
-
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
56
|
-
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
57
|
-
let coords;
|
|
58
|
-
switch (side) {
|
|
59
|
-
case "top":
|
|
60
|
-
coords = {
|
|
61
|
-
x: commonX,
|
|
62
|
-
y: reference.y - floating.height
|
|
63
|
-
};
|
|
64
|
-
break;
|
|
65
|
-
case "bottom":
|
|
66
|
-
coords = {
|
|
67
|
-
x: commonX,
|
|
68
|
-
y: reference.y + reference.height
|
|
69
|
-
};
|
|
70
|
-
break;
|
|
71
|
-
case "right":
|
|
72
|
-
coords = {
|
|
73
|
-
x: reference.x + reference.width,
|
|
74
|
-
y: commonY
|
|
75
|
-
};
|
|
76
|
-
break;
|
|
77
|
-
case "left":
|
|
78
|
-
coords = {
|
|
79
|
-
x: reference.x - floating.width,
|
|
80
|
-
y: commonY
|
|
81
|
-
};
|
|
82
|
-
break;
|
|
83
|
-
default:
|
|
84
|
-
coords = {
|
|
85
|
-
x: reference.x,
|
|
86
|
-
y: reference.y
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
switch (getAlignment(placement)) {
|
|
90
|
-
case "start":
|
|
91
|
-
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
92
|
-
break;
|
|
93
|
-
case "end":
|
|
94
|
-
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
return coords;
|
|
98
|
-
}
|
|
99
|
-
const computePosition$1 = async (reference, floating, config) => {
|
|
100
|
-
const {
|
|
101
|
-
placement = "bottom",
|
|
102
|
-
strategy = "absolute",
|
|
103
|
-
middleware = [],
|
|
104
|
-
platform: platform2
|
|
105
|
-
} = config;
|
|
106
|
-
const validMiddleware = middleware.filter(Boolean);
|
|
107
|
-
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
108
|
-
let rects = await platform2.getElementRects({
|
|
109
|
-
reference,
|
|
110
|
-
floating,
|
|
111
|
-
strategy
|
|
112
|
-
});
|
|
113
|
-
let {
|
|
114
|
-
x,
|
|
115
|
-
y
|
|
116
|
-
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
117
|
-
let statefulPlacement = placement;
|
|
118
|
-
let middlewareData = {};
|
|
119
|
-
let resetCount = 0;
|
|
120
|
-
for (let i = 0; i < validMiddleware.length; i++) {
|
|
121
|
-
const {
|
|
122
|
-
name,
|
|
123
|
-
fn
|
|
124
|
-
} = validMiddleware[i];
|
|
125
|
-
const {
|
|
126
|
-
x: nextX,
|
|
127
|
-
y: nextY,
|
|
128
|
-
data,
|
|
129
|
-
reset
|
|
130
|
-
} = await fn({
|
|
131
|
-
x,
|
|
132
|
-
y,
|
|
133
|
-
initialPlacement: placement,
|
|
134
|
-
placement: statefulPlacement,
|
|
135
|
-
strategy,
|
|
136
|
-
middlewareData,
|
|
137
|
-
rects,
|
|
138
|
-
platform: platform2,
|
|
139
|
-
elements: {
|
|
140
|
-
reference,
|
|
141
|
-
floating
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
x = nextX != null ? nextX : x;
|
|
145
|
-
y = nextY != null ? nextY : y;
|
|
146
|
-
middlewareData = {
|
|
147
|
-
...middlewareData,
|
|
148
|
-
[name]: {
|
|
149
|
-
...middlewareData[name],
|
|
150
|
-
...data
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
if (reset && resetCount <= 50) {
|
|
154
|
-
resetCount++;
|
|
155
|
-
if (typeof reset === "object") {
|
|
156
|
-
if (reset.placement) {
|
|
157
|
-
statefulPlacement = reset.placement;
|
|
158
|
-
}
|
|
159
|
-
if (reset.rects) {
|
|
160
|
-
rects = reset.rects === true ? await platform2.getElementRects({
|
|
161
|
-
reference,
|
|
162
|
-
floating,
|
|
163
|
-
strategy
|
|
164
|
-
}) : reset.rects;
|
|
165
|
-
}
|
|
166
|
-
({
|
|
167
|
-
x,
|
|
168
|
-
y
|
|
169
|
-
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
170
|
-
}
|
|
171
|
-
i = -1;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return {
|
|
175
|
-
x,
|
|
176
|
-
y,
|
|
177
|
-
placement: statefulPlacement,
|
|
178
|
-
strategy,
|
|
179
|
-
middlewareData
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
function getNodeName(node) {
|
|
183
|
-
if (isNode(node)) {
|
|
184
|
-
return (node.nodeName || "").toLowerCase();
|
|
185
|
-
}
|
|
186
|
-
return "#document";
|
|
187
|
-
}
|
|
188
|
-
function getWindow(node) {
|
|
189
|
-
var _node$ownerDocument;
|
|
190
|
-
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
191
|
-
}
|
|
192
|
-
function getDocumentElement(node) {
|
|
193
|
-
var _ref;
|
|
194
|
-
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
195
|
-
}
|
|
196
|
-
function isNode(value) {
|
|
197
|
-
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
198
|
-
}
|
|
199
|
-
function isElement(value) {
|
|
200
|
-
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
201
|
-
}
|
|
202
|
-
function isHTMLElement(value) {
|
|
203
|
-
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
204
|
-
}
|
|
205
|
-
function isShadowRoot(value) {
|
|
206
|
-
if (typeof ShadowRoot === "undefined") {
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
210
|
-
}
|
|
211
|
-
function isOverflowElement(element) {
|
|
212
|
-
const {
|
|
213
|
-
overflow,
|
|
214
|
-
overflowX,
|
|
215
|
-
overflowY,
|
|
216
|
-
display
|
|
217
|
-
} = getComputedStyle(element);
|
|
218
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
|
|
219
|
-
}
|
|
220
|
-
function isTableElement(element) {
|
|
221
|
-
return ["table", "td", "th"].includes(getNodeName(element));
|
|
222
|
-
}
|
|
223
|
-
function isTopLayer(element) {
|
|
224
|
-
return [":popover-open", ":modal"].some((selector) => {
|
|
225
|
-
try {
|
|
226
|
-
return element.matches(selector);
|
|
227
|
-
} catch (e) {
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
function isContainingBlock(elementOrCss) {
|
|
233
|
-
const webkit = isWebKit();
|
|
234
|
-
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
235
|
-
return css.transform !== "none" || css.perspective !== "none" || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value));
|
|
236
|
-
}
|
|
237
|
-
function getContainingBlock(element) {
|
|
238
|
-
let currentNode = getParentNode(element);
|
|
239
|
-
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
240
|
-
if (isContainingBlock(currentNode)) {
|
|
241
|
-
return currentNode;
|
|
242
|
-
} else if (isTopLayer(currentNode)) {
|
|
243
|
-
return null;
|
|
244
|
-
}
|
|
245
|
-
currentNode = getParentNode(currentNode);
|
|
246
|
-
}
|
|
247
|
-
return null;
|
|
248
|
-
}
|
|
249
|
-
function isWebKit() {
|
|
250
|
-
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
|
251
|
-
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
252
|
-
}
|
|
253
|
-
function isLastTraversableNode(node) {
|
|
254
|
-
return ["html", "body", "#document"].includes(getNodeName(node));
|
|
255
|
-
}
|
|
256
|
-
function getComputedStyle(element) {
|
|
257
|
-
return getWindow(element).getComputedStyle(element);
|
|
258
|
-
}
|
|
259
|
-
function getNodeScroll(element) {
|
|
260
|
-
if (isElement(element)) {
|
|
261
|
-
return {
|
|
262
|
-
scrollLeft: element.scrollLeft,
|
|
263
|
-
scrollTop: element.scrollTop
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
return {
|
|
267
|
-
scrollLeft: element.scrollX,
|
|
268
|
-
scrollTop: element.scrollY
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
function getParentNode(node) {
|
|
272
|
-
if (getNodeName(node) === "html") {
|
|
273
|
-
return node;
|
|
274
|
-
}
|
|
275
|
-
const result = (
|
|
276
|
-
// Step into the shadow DOM of the parent of a slotted node.
|
|
277
|
-
node.assignedSlot || // DOM Element detected.
|
|
278
|
-
node.parentNode || // ShadowRoot detected.
|
|
279
|
-
isShadowRoot(node) && node.host || // Fallback.
|
|
280
|
-
getDocumentElement(node)
|
|
281
|
-
);
|
|
282
|
-
return isShadowRoot(result) ? result.host : result;
|
|
283
|
-
}
|
|
284
|
-
function getNearestOverflowAncestor(node) {
|
|
285
|
-
const parentNode = getParentNode(node);
|
|
286
|
-
if (isLastTraversableNode(parentNode)) {
|
|
287
|
-
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
288
|
-
}
|
|
289
|
-
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
290
|
-
return parentNode;
|
|
291
|
-
}
|
|
292
|
-
return getNearestOverflowAncestor(parentNode);
|
|
293
|
-
}
|
|
294
|
-
function getOverflowAncestors(node, list, traverseIframes) {
|
|
295
|
-
var _node$ownerDocument2;
|
|
296
|
-
if (list === void 0) {
|
|
297
|
-
list = [];
|
|
298
|
-
}
|
|
299
|
-
if (traverseIframes === void 0) {
|
|
300
|
-
traverseIframes = true;
|
|
301
|
-
}
|
|
302
|
-
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
303
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
304
|
-
const win = getWindow(scrollableAncestor);
|
|
305
|
-
if (isBody) {
|
|
306
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
307
|
-
}
|
|
308
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
309
|
-
}
|
|
310
|
-
function getCssDimensions(element) {
|
|
311
|
-
const css = getComputedStyle(element);
|
|
312
|
-
let width = parseFloat(css.width) || 0;
|
|
313
|
-
let height = parseFloat(css.height) || 0;
|
|
314
|
-
const hasOffset = isHTMLElement(element);
|
|
315
|
-
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
316
|
-
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
317
|
-
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
318
|
-
if (shouldFallback) {
|
|
319
|
-
width = offsetWidth;
|
|
320
|
-
height = offsetHeight;
|
|
321
|
-
}
|
|
322
|
-
return {
|
|
323
|
-
width,
|
|
324
|
-
height,
|
|
325
|
-
$: shouldFallback
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
function unwrapElement(element) {
|
|
329
|
-
return !isElement(element) ? element.contextElement : element;
|
|
330
|
-
}
|
|
331
|
-
function getScale(element) {
|
|
332
|
-
const domElement = unwrapElement(element);
|
|
333
|
-
if (!isHTMLElement(domElement)) {
|
|
334
|
-
return createCoords(1);
|
|
335
|
-
}
|
|
336
|
-
const rect = domElement.getBoundingClientRect();
|
|
337
|
-
const {
|
|
338
|
-
width,
|
|
339
|
-
height,
|
|
340
|
-
$
|
|
341
|
-
} = getCssDimensions(domElement);
|
|
342
|
-
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
343
|
-
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
344
|
-
if (!x || !Number.isFinite(x)) {
|
|
345
|
-
x = 1;
|
|
346
|
-
}
|
|
347
|
-
if (!y || !Number.isFinite(y)) {
|
|
348
|
-
y = 1;
|
|
349
|
-
}
|
|
350
|
-
return {
|
|
351
|
-
x,
|
|
352
|
-
y
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
const noOffsets = /* @__PURE__ */ createCoords(0);
|
|
356
|
-
function getVisualOffsets(element) {
|
|
357
|
-
const win = getWindow(element);
|
|
358
|
-
if (!isWebKit() || !win.visualViewport) {
|
|
359
|
-
return noOffsets;
|
|
360
|
-
}
|
|
361
|
-
return {
|
|
362
|
-
x: win.visualViewport.offsetLeft,
|
|
363
|
-
y: win.visualViewport.offsetTop
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
367
|
-
if (isFixed === void 0) {
|
|
368
|
-
isFixed = false;
|
|
369
|
-
}
|
|
370
|
-
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
371
|
-
return false;
|
|
372
|
-
}
|
|
373
|
-
return isFixed;
|
|
374
|
-
}
|
|
375
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
376
|
-
if (includeScale === void 0) {
|
|
377
|
-
includeScale = false;
|
|
378
|
-
}
|
|
379
|
-
if (isFixedStrategy === void 0) {
|
|
380
|
-
isFixedStrategy = false;
|
|
381
|
-
}
|
|
382
|
-
const clientRect = element.getBoundingClientRect();
|
|
383
|
-
const domElement = unwrapElement(element);
|
|
384
|
-
let scale = createCoords(1);
|
|
385
|
-
if (includeScale) {
|
|
386
|
-
if (offsetParent) {
|
|
387
|
-
if (isElement(offsetParent)) {
|
|
388
|
-
scale = getScale(offsetParent);
|
|
389
|
-
}
|
|
390
|
-
} else {
|
|
391
|
-
scale = getScale(element);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
395
|
-
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
396
|
-
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
397
|
-
let width = clientRect.width / scale.x;
|
|
398
|
-
let height = clientRect.height / scale.y;
|
|
399
|
-
if (domElement) {
|
|
400
|
-
const win = getWindow(domElement);
|
|
401
|
-
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
402
|
-
let currentWin = win;
|
|
403
|
-
let currentIFrame = currentWin.frameElement;
|
|
404
|
-
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
405
|
-
const iframeScale = getScale(currentIFrame);
|
|
406
|
-
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
407
|
-
const css = getComputedStyle(currentIFrame);
|
|
408
|
-
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
409
|
-
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
410
|
-
x *= iframeScale.x;
|
|
411
|
-
y *= iframeScale.y;
|
|
412
|
-
width *= iframeScale.x;
|
|
413
|
-
height *= iframeScale.y;
|
|
414
|
-
x += left;
|
|
415
|
-
y += top;
|
|
416
|
-
currentWin = getWindow(currentIFrame);
|
|
417
|
-
currentIFrame = currentWin.frameElement;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
return rectToClientRect({
|
|
421
|
-
width,
|
|
422
|
-
height,
|
|
423
|
-
x,
|
|
424
|
-
y
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
428
|
-
let {
|
|
429
|
-
elements,
|
|
430
|
-
rect,
|
|
431
|
-
offsetParent,
|
|
432
|
-
strategy
|
|
433
|
-
} = _ref;
|
|
434
|
-
const isFixed = strategy === "fixed";
|
|
435
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
436
|
-
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
437
|
-
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
438
|
-
return rect;
|
|
439
|
-
}
|
|
440
|
-
let scroll = {
|
|
441
|
-
scrollLeft: 0,
|
|
442
|
-
scrollTop: 0
|
|
443
|
-
};
|
|
444
|
-
let scale = createCoords(1);
|
|
445
|
-
const offsets = createCoords(0);
|
|
446
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
447
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
448
|
-
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
449
|
-
scroll = getNodeScroll(offsetParent);
|
|
450
|
-
}
|
|
451
|
-
if (isHTMLElement(offsetParent)) {
|
|
452
|
-
const offsetRect = getBoundingClientRect(offsetParent);
|
|
453
|
-
scale = getScale(offsetParent);
|
|
454
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
455
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
return {
|
|
459
|
-
width: rect.width * scale.x,
|
|
460
|
-
height: rect.height * scale.y,
|
|
461
|
-
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
462
|
-
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
function getClientRects(element) {
|
|
466
|
-
return Array.from(element.getClientRects());
|
|
467
|
-
}
|
|
468
|
-
function getWindowScrollBarX(element) {
|
|
469
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
470
|
-
}
|
|
471
|
-
function getDocumentRect(element) {
|
|
472
|
-
const html = getDocumentElement(element);
|
|
473
|
-
const scroll = getNodeScroll(element);
|
|
474
|
-
const body = element.ownerDocument.body;
|
|
475
|
-
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
476
|
-
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
477
|
-
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
478
|
-
const y = -scroll.scrollTop;
|
|
479
|
-
if (getComputedStyle(body).direction === "rtl") {
|
|
480
|
-
x += max(html.clientWidth, body.clientWidth) - width;
|
|
481
|
-
}
|
|
482
|
-
return {
|
|
483
|
-
width,
|
|
484
|
-
height,
|
|
485
|
-
x,
|
|
486
|
-
y
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
function getViewportRect(element, strategy) {
|
|
490
|
-
const win = getWindow(element);
|
|
491
|
-
const html = getDocumentElement(element);
|
|
492
|
-
const visualViewport = win.visualViewport;
|
|
493
|
-
let width = html.clientWidth;
|
|
494
|
-
let height = html.clientHeight;
|
|
495
|
-
let x = 0;
|
|
496
|
-
let y = 0;
|
|
497
|
-
if (visualViewport) {
|
|
498
|
-
width = visualViewport.width;
|
|
499
|
-
height = visualViewport.height;
|
|
500
|
-
const visualViewportBased = isWebKit();
|
|
501
|
-
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
|
502
|
-
x = visualViewport.offsetLeft;
|
|
503
|
-
y = visualViewport.offsetTop;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
return {
|
|
507
|
-
width,
|
|
508
|
-
height,
|
|
509
|
-
x,
|
|
510
|
-
y
|
|
511
|
-
};
|
|
512
|
-
}
|
|
513
|
-
function getInnerBoundingClientRect(element, strategy) {
|
|
514
|
-
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
515
|
-
const top = clientRect.top + element.clientTop;
|
|
516
|
-
const left = clientRect.left + element.clientLeft;
|
|
517
|
-
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
518
|
-
const width = element.clientWidth * scale.x;
|
|
519
|
-
const height = element.clientHeight * scale.y;
|
|
520
|
-
const x = left * scale.x;
|
|
521
|
-
const y = top * scale.y;
|
|
522
|
-
return {
|
|
523
|
-
width,
|
|
524
|
-
height,
|
|
525
|
-
x,
|
|
526
|
-
y
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
530
|
-
let rect;
|
|
531
|
-
if (clippingAncestor === "viewport") {
|
|
532
|
-
rect = getViewportRect(element, strategy);
|
|
533
|
-
} else if (clippingAncestor === "document") {
|
|
534
|
-
rect = getDocumentRect(getDocumentElement(element));
|
|
535
|
-
} else if (isElement(clippingAncestor)) {
|
|
536
|
-
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
537
|
-
} else {
|
|
538
|
-
const visualOffsets = getVisualOffsets(element);
|
|
539
|
-
rect = {
|
|
540
|
-
...clippingAncestor,
|
|
541
|
-
x: clippingAncestor.x - visualOffsets.x,
|
|
542
|
-
y: clippingAncestor.y - visualOffsets.y
|
|
543
|
-
};
|
|
544
|
-
}
|
|
545
|
-
return rectToClientRect(rect);
|
|
546
|
-
}
|
|
547
|
-
function hasFixedPositionAncestor(element, stopNode) {
|
|
548
|
-
const parentNode = getParentNode(element);
|
|
549
|
-
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
550
|
-
return false;
|
|
551
|
-
}
|
|
552
|
-
return getComputedStyle(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
|
553
|
-
}
|
|
554
|
-
function getClippingElementAncestors(element, cache) {
|
|
555
|
-
const cachedResult = cache.get(element);
|
|
556
|
-
if (cachedResult) {
|
|
557
|
-
return cachedResult;
|
|
558
|
-
}
|
|
559
|
-
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
560
|
-
let currentContainingBlockComputedStyle = null;
|
|
561
|
-
const elementIsFixed = getComputedStyle(element).position === "fixed";
|
|
562
|
-
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
563
|
-
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
564
|
-
const computedStyle = getComputedStyle(currentNode);
|
|
565
|
-
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
566
|
-
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
|
567
|
-
currentContainingBlockComputedStyle = null;
|
|
568
|
-
}
|
|
569
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
570
|
-
if (shouldDropCurrentNode) {
|
|
571
|
-
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
572
|
-
} else {
|
|
573
|
-
currentContainingBlockComputedStyle = computedStyle;
|
|
574
|
-
}
|
|
575
|
-
currentNode = getParentNode(currentNode);
|
|
576
|
-
}
|
|
577
|
-
cache.set(element, result);
|
|
578
|
-
return result;
|
|
579
|
-
}
|
|
580
|
-
function getClippingRect(_ref) {
|
|
581
|
-
let {
|
|
582
|
-
element,
|
|
583
|
-
boundary,
|
|
584
|
-
rootBoundary,
|
|
585
|
-
strategy
|
|
586
|
-
} = _ref;
|
|
587
|
-
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
588
|
-
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
589
|
-
const firstClippingAncestor = clippingAncestors[0];
|
|
590
|
-
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
591
|
-
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
592
|
-
accRect.top = max(rect.top, accRect.top);
|
|
593
|
-
accRect.right = min(rect.right, accRect.right);
|
|
594
|
-
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
595
|
-
accRect.left = max(rect.left, accRect.left);
|
|
596
|
-
return accRect;
|
|
597
|
-
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
598
|
-
return {
|
|
599
|
-
width: clippingRect.right - clippingRect.left,
|
|
600
|
-
height: clippingRect.bottom - clippingRect.top,
|
|
601
|
-
x: clippingRect.left,
|
|
602
|
-
y: clippingRect.top
|
|
603
|
-
};
|
|
604
|
-
}
|
|
605
|
-
function getDimensions(element) {
|
|
606
|
-
const {
|
|
607
|
-
width,
|
|
608
|
-
height
|
|
609
|
-
} = getCssDimensions(element);
|
|
610
|
-
return {
|
|
611
|
-
width,
|
|
612
|
-
height
|
|
613
|
-
};
|
|
614
|
-
}
|
|
615
|
-
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
616
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
617
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
618
|
-
const isFixed = strategy === "fixed";
|
|
619
|
-
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
620
|
-
let scroll = {
|
|
621
|
-
scrollLeft: 0,
|
|
622
|
-
scrollTop: 0
|
|
623
|
-
};
|
|
624
|
-
const offsets = createCoords(0);
|
|
625
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
626
|
-
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
627
|
-
scroll = getNodeScroll(offsetParent);
|
|
628
|
-
}
|
|
629
|
-
if (isOffsetParentAnElement) {
|
|
630
|
-
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
631
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
632
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
633
|
-
} else if (documentElement) {
|
|
634
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
const x = rect.left + scroll.scrollLeft - offsets.x;
|
|
638
|
-
const y = rect.top + scroll.scrollTop - offsets.y;
|
|
639
|
-
return {
|
|
640
|
-
x,
|
|
641
|
-
y,
|
|
642
|
-
width: rect.width,
|
|
643
|
-
height: rect.height
|
|
644
|
-
};
|
|
645
|
-
}
|
|
646
|
-
function isStaticPositioned(element) {
|
|
647
|
-
return getComputedStyle(element).position === "static";
|
|
648
|
-
}
|
|
649
|
-
function getTrueOffsetParent(element, polyfill) {
|
|
650
|
-
if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
|
|
651
|
-
return null;
|
|
652
|
-
}
|
|
653
|
-
if (polyfill) {
|
|
654
|
-
return polyfill(element);
|
|
655
|
-
}
|
|
656
|
-
return element.offsetParent;
|
|
657
|
-
}
|
|
658
|
-
function getOffsetParent(element, polyfill) {
|
|
659
|
-
const win = getWindow(element);
|
|
660
|
-
if (isTopLayer(element)) {
|
|
661
|
-
return win;
|
|
662
|
-
}
|
|
663
|
-
if (!isHTMLElement(element)) {
|
|
664
|
-
let svgOffsetParent = getParentNode(element);
|
|
665
|
-
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
666
|
-
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
667
|
-
return svgOffsetParent;
|
|
668
|
-
}
|
|
669
|
-
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
670
|
-
}
|
|
671
|
-
return win;
|
|
672
|
-
}
|
|
673
|
-
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
674
|
-
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
675
|
-
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
676
|
-
}
|
|
677
|
-
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
678
|
-
return win;
|
|
679
|
-
}
|
|
680
|
-
return offsetParent || getContainingBlock(element) || win;
|
|
681
|
-
}
|
|
682
|
-
const getElementRects = async function(data) {
|
|
683
|
-
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
684
|
-
const getDimensionsFn = this.getDimensions;
|
|
685
|
-
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
686
|
-
return {
|
|
687
|
-
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
688
|
-
floating: {
|
|
689
|
-
x: 0,
|
|
690
|
-
y: 0,
|
|
691
|
-
width: floatingDimensions.width,
|
|
692
|
-
height: floatingDimensions.height
|
|
693
|
-
}
|
|
694
|
-
};
|
|
695
|
-
};
|
|
696
|
-
function isRTL(element) {
|
|
697
|
-
return getComputedStyle(element).direction === "rtl";
|
|
698
|
-
}
|
|
699
|
-
const platform = {
|
|
700
|
-
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
701
|
-
getDocumentElement,
|
|
702
|
-
getClippingRect,
|
|
703
|
-
getOffsetParent,
|
|
704
|
-
getElementRects,
|
|
705
|
-
getClientRects,
|
|
706
|
-
getDimensions,
|
|
707
|
-
getScale,
|
|
708
|
-
isElement,
|
|
709
|
-
isRTL
|
|
710
|
-
};
|
|
711
|
-
const computePosition = (reference, floating, options) => {
|
|
712
|
-
const cache = /* @__PURE__ */ new Map();
|
|
713
|
-
const mergedOptions = {
|
|
714
|
-
platform,
|
|
715
|
-
...options
|
|
716
|
-
};
|
|
717
|
-
const platformWithCache = {
|
|
718
|
-
...mergedOptions.platform,
|
|
719
|
-
_c: cache
|
|
720
|
-
};
|
|
721
|
-
return computePosition$1(reference, floating, {
|
|
722
|
-
...mergedOptions,
|
|
723
|
-
platform: platformWithCache
|
|
724
|
-
});
|
|
725
|
-
};
|
|
726
|
-
class Polyfills {
|
|
727
|
-
constructor(popover) {
|
|
728
|
-
this.popover = popover;
|
|
729
|
-
this.trigger = document.querySelector(
|
|
730
|
-
`[popovertarget="${popover.getAttribute("id")}"`
|
|
731
|
-
);
|
|
732
|
-
this.positionPopover = this.positionPopover.bind(this);
|
|
733
|
-
this.popover.addEventListener("toggle", this.positionPopover);
|
|
734
|
-
}
|
|
735
|
-
positionPopover = ({ newState }) => {
|
|
736
|
-
if (newState === "open") {
|
|
737
|
-
computePosition(this.trigger, this.popover, {
|
|
738
|
-
placement: "bottom-start"
|
|
739
|
-
}).then(({ x, y }) => {
|
|
740
|
-
this.popover.style.insetInlineStart = `${x}px`;
|
|
741
|
-
this.popover.style.insetBlockStart = `${y}px`;
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
};
|
|
745
|
-
}
|
|
746
|
-
export {
|
|
747
|
-
Polyfills as default
|
|
748
|
-
};
|
|
749
|
-
//# sourceMappingURL=polyfills-CJ5uTmUJ.js.map
|