@siemens/ix 1.4.0-beta.0 → 1.4.0-beta.2
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/dist/cjs/{animation-dfe01edc.js → animation-d5cc0bec.js} +1 -1
- package/dist/cjs/{base-button-6ef79cb6.js → base-button-497db257.js} +1 -1
- package/dist/cjs/context-a0900b95.js +75 -0
- package/dist/cjs/{default-tree-item-4597cd84.js → default-tree-item-89cd1f3f.js} +1 -1
- package/dist/cjs/{flip-tile-state-c95639e5.js → flip-tile-state-b5ff5ea0.js} +1 -1
- package/dist/cjs/{alignment-24ae2e63.js → floating-ui.dom.esm-01fe5abe.js} +529 -401
- package/dist/cjs/index-f4b8e6ee.js +20 -0
- package/dist/cjs/index.cjs.js +12 -12
- package/dist/cjs/ix-animated-tab_2.cjs.entry.js +2 -2
- package/dist/cjs/ix-application-header.cjs.entry.js +25 -2
- package/dist/cjs/ix-basic-navigation.cjs.entry.js +16 -2
- package/dist/cjs/ix-breadcrumb_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-burger-menu.cjs.entry.js +22 -0
- package/dist/cjs/ix-button.cjs.entry.js +3 -3
- package/dist/cjs/ix-category-filter.cjs.entry.js +2 -2
- package/dist/cjs/ix-divider.cjs.entry.js +19 -0
- package/dist/cjs/ix-dropdown-button.cjs.entry.js +5 -3
- package/dist/cjs/ix-dropdown-quick-actions.cjs.entry.js +19 -0
- package/dist/cjs/ix-dropdown_2.cjs.entry.js +92 -20
- package/dist/cjs/ix-event-list_2.cjs.entry.js +3 -3
- package/dist/cjs/ix-flip-tile_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-group-context-menu.cjs.entry.js +0 -3
- package/dist/cjs/ix-group_3.cjs.entry.js +1 -1
- package/dist/cjs/ix-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/ix-menu_9.cjs.entry.js +47 -16
- package/dist/cjs/ix-modal-example.cjs.entry.js +1 -1
- package/dist/cjs/ix-modal_2.cjs.entry.js +3 -3
- package/dist/cjs/ix-select_2.cjs.entry.js +6 -4
- package/dist/cjs/ix-split-button_2.cjs.entry.js +2 -2
- package/dist/cjs/ix-tab-item.cjs.entry.js +1 -1
- package/dist/cjs/ix-tabs.cjs.entry.js +11 -4
- package/dist/cjs/ix-toast_2.cjs.entry.js +9 -5
- package/dist/cjs/ix-toggle.cjs.entry.js +1 -1
- package/dist/cjs/ix-tooltip.cjs.entry.js +127 -0
- package/dist/cjs/ix-tree_2.cjs.entry.js +2 -3
- package/dist/cjs/ix-typography.cjs.entry.js +38 -0
- package/dist/cjs/ix-upload.cjs.entry.js +1 -1
- package/dist/cjs/ix-validation-tooltip.cjs.entry.js +19 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{logical-filter-operator-467e2faf.js → logical-filter-operator-0faf70b8.js} +2 -2
- package/dist/cjs/{modal-2d0f9191.js → modal-a93045dd.js} +3 -3
- package/dist/cjs/{modal-utils-9ee0acda.js → modal-utils-b645989b.js} +1 -1
- package/dist/cjs/{mutation-observer-29bedada.js → mutation-observer-eaaa5399.js} +1 -1
- package/dist/cjs/my-component.cjs.entry.js +1 -1
- package/dist/cjs/{rwd.util-2326824e.js → rwd.util-9480f0b5.js} +1 -1
- package/dist/cjs/service-18dc5907.js +73 -0
- package/dist/cjs/siemens-ix.cjs.js +1 -1
- package/dist/cjs/{theme-switcher-f91c8d8d.js → theme-switcher-67669a35.js} +1 -1
- package/dist/cjs/{typed-event-5030cc6a.js → typed-event-f0f051da.js} +1 -1
- package/dist/cjs/{upload-file-state-923b2c65.js → upload-file-state-a79acf2b.js} +1 -1
- package/dist/collection/collection-manifest.json +5 -0
- package/dist/collection/components/animated-tab/animated-tab.css +1 -1
- package/dist/collection/components/animated-tab/animated-tab.js +1 -1
- package/dist/collection/components/animated-tabs/animated-tabs.css +4 -4
- package/dist/collection/components/animated-tabs/animated-tabs.js +1 -1
- package/dist/collection/components/application-header/application-header.css +8 -1
- package/dist/collection/components/application-header/application-header.js +31 -2
- package/dist/collection/components/basic-navigation/basic-navigation.css +6 -1
- package/dist/collection/components/basic-navigation/basic-navigation.js +21 -3
- package/dist/collection/components/blind/blind.css +5 -5
- package/dist/collection/components/blind/blind.js +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.css +4 -4
- package/dist/collection/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/collection/components/breadcrumb-item/breadcrumb-item.css +1 -1
- package/dist/collection/components/breadcrumb-item/breadcrumb-item.js +1 -1
- package/dist/collection/components/button/base-button.js +1 -1
- package/dist/collection/components/button/button.css +7 -2
- package/dist/collection/components/button/button.js +3 -3
- package/dist/collection/components/category-filter/category-filter.css +6 -6
- package/dist/collection/components/category-filter/category-filter.js +2 -2
- package/dist/collection/components/category-filter/filter-state.js +1 -1
- package/dist/collection/components/category-filter/input-state.js +1 -1
- package/dist/collection/components/category-filter/logical-filter-operator.js +1 -1
- package/dist/collection/components/chip/chip.css +4 -4
- package/dist/collection/components/chip/chip.js +1 -1
- package/dist/collection/components/counter-pill/counter-pill.css +7 -7
- package/dist/collection/components/counter-pill/counter-pill.js +1 -1
- package/dist/collection/components/date-picker/date-picker.css +2 -2
- package/dist/collection/components/date-picker/date-picker.js +2 -2
- package/dist/collection/components/date-time-card/date-time-card.css +2 -2
- package/dist/collection/components/date-time-card/date-time-card.js +1 -1
- package/dist/collection/components/datetime-picker/datetime-picker.css +2 -2
- package/dist/collection/components/datetime-picker/datetime-picker.js +1 -1
- package/dist/collection/components/divider/divider.css +16 -0
- package/dist/collection/components/divider/divider.js +29 -0
- package/dist/collection/components/drawer/drawer.css +3 -3
- package/dist/collection/components/drawer/drawer.js +1 -1
- package/dist/collection/components/dropdown/dropdown-trigger-event.js +1 -0
- package/dist/collection/components/dropdown/dropdown.css +9 -6
- package/dist/collection/components/dropdown/dropdown.js +142 -16
- package/dist/collection/components/dropdown-button/dropdown-button.css +15 -7
- package/dist/collection/components/dropdown-button/dropdown-button.js +6 -4
- package/dist/collection/components/dropdown-item/dropdown-item.css +16 -4
- package/dist/collection/components/dropdown-item/dropdown-item.js +3 -1
- package/dist/collection/components/dropdown-quick-actions/dropdown-quick-actions.css +36 -0
- package/dist/collection/components/dropdown-quick-actions/dropdown-quick-actions.js +29 -0
- package/dist/collection/components/event-list/event-list.css +1 -1
- package/dist/collection/components/event-list/event-list.js +1 -1
- package/dist/collection/components/event-list-item/event-list-item.css +21 -24
- package/dist/collection/components/event-list-item/event-list-item.js +1 -1
- package/dist/collection/components/expanding-search/expanding-search.css +4 -4
- package/dist/collection/components/expanding-search/expanding-search.js +1 -1
- package/dist/collection/components/filter-chip/filter-chip.css +4 -4
- package/dist/collection/components/filter-chip/filter-chip.js +1 -1
- package/dist/collection/components/flip-tile/flip-tile-state.js +1 -1
- package/dist/collection/components/flip-tile/flip-tile.css +4 -4
- package/dist/collection/components/flip-tile/flip-tile.js +1 -1
- package/dist/collection/components/flip-tile-content/flip-tile-content.css +1 -1
- package/dist/collection/components/flip-tile-content/flip-tile-content.js +1 -1
- package/dist/collection/components/group/group-context-menu.css +1 -1
- package/dist/collection/components/group/group-context-menu.js +1 -4
- package/dist/collection/components/group/group.css +12 -13
- package/dist/collection/components/group/group.js +1 -1
- package/dist/collection/components/group-dropdown-item/group-dropdown-item.css +1 -1
- package/dist/collection/components/group-dropdown-item/group-dropdown-item.js +1 -1
- package/dist/collection/components/group-item/group-item.css +5 -5
- package/dist/collection/components/group-item/group-item.js +1 -1
- package/dist/collection/components/icon/icon.css +2 -2
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon-button/icon-button.css +1 -1
- package/dist/collection/components/icon-button/icon-button.js +1 -1
- package/dist/collection/components/input-group/input-group.css +1 -1
- package/dist/collection/components/input-group/input-group.js +1 -1
- package/dist/collection/components/kpi/kpi.css +5 -5
- package/dist/collection/components/kpi/kpi.js +1 -1
- package/dist/collection/components/map-navigation/map-navigation.css +4 -4
- package/dist/collection/components/map-navigation/map-navigation.js +1 -1
- package/dist/collection/components/map-navigation-overlay/map-navigation-overlay.css +5 -5
- package/dist/collection/components/map-navigation-overlay/map-navigation-overlay.js +1 -1
- package/dist/collection/components/menu/burger-menu.css +72 -0
- package/dist/collection/components/menu/burger-menu.js +64 -0
- package/dist/collection/components/menu/menu.css +20 -37
- package/dist/collection/components/menu/menu.js +27 -11
- package/dist/collection/components/menu-about/menu-about.css +4 -4
- package/dist/collection/components/menu-about/menu-about.js +1 -1
- package/dist/collection/components/menu-about-item/menu-about-item.css +1 -1
- package/dist/collection/components/menu-about-item/menu-about-item.js +1 -1
- package/dist/collection/components/menu-about-news/menu-about-news.css +3 -3
- package/dist/collection/components/menu-about-news/menu-about-news.js +1 -1
- package/dist/collection/components/menu-avatar/menu-avatar.css +17 -5
- package/dist/collection/components/menu-avatar/menu-avatar.js +52 -3
- package/dist/collection/components/menu-avatar-item/menu-avatar-item.css +1 -1
- package/dist/collection/components/menu-avatar-item/menu-avatar-item.js +1 -1
- package/dist/collection/components/menu-item/menu-item.css +27 -27
- package/dist/collection/components/menu-item/menu-item.js +2 -1
- package/dist/collection/components/menu-settings/menu-settings.css +4 -4
- package/dist/collection/components/menu-settings/menu-settings.js +1 -1
- package/dist/collection/components/menu-settings-item/menu-settings-item.css +1 -1
- package/dist/collection/components/menu-settings-item/menu-settings-item.js +1 -1
- package/dist/collection/components/message-bar/message-bar.css +3 -3
- package/dist/collection/components/message-bar/message-bar.js +1 -1
- package/dist/collection/components/modal/modal-utils.js +1 -1
- package/dist/collection/components/modal/modal.css +2 -2
- package/dist/collection/components/modal/modal.js +1 -1
- package/dist/collection/components/modal-container/modal-container.css +1 -1
- package/dist/collection/components/modal-container/modal-container.js +1 -1
- package/dist/collection/components/my-component/example-modal.js +1 -1
- package/dist/collection/components/my-component/my-component.css +4 -4
- package/dist/collection/components/my-component/my-component.js +1 -1
- package/dist/collection/components/pill/pill.css +4 -4
- package/dist/collection/components/pill/pill.js +1 -1
- package/dist/collection/components/select/select.css +5 -5
- package/dist/collection/components/select/select.js +7 -5
- package/dist/collection/components/select-item/select-item.css +1 -1
- package/dist/collection/components/select-item/select-item.js +1 -1
- package/dist/collection/components/spinner/spinner.css +1 -1
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/split-button/split-button.css +10 -1
- package/dist/collection/components/split-button/split-button.js +2 -2
- package/dist/collection/components/split-button-item/split-button-item.css +1 -1
- package/dist/collection/components/split-button-item/split-button-item.js +1 -1
- package/dist/collection/components/tab-item/tab-item.css +5 -7
- package/dist/collection/components/tab-item/tab-item.js +1 -1
- package/dist/collection/components/tabs/tabs.css +4 -3
- package/dist/collection/components/tabs/tabs.js +13 -4
- package/dist/collection/components/tile/tile.css +3 -3
- package/dist/collection/components/tile/tile.js +1 -1
- package/dist/collection/components/time-picker/time-picker.css +2 -2
- package/dist/collection/components/time-picker/time-picker.js +1 -1
- package/dist/collection/components/toast/toast-container.js +1 -1
- package/dist/collection/components/toast/toast-utils.js +1 -1
- package/dist/collection/components/toast/toast.css +4 -4
- package/dist/collection/components/toast/toast.js +9 -5
- package/dist/collection/components/toggle/toggle.css +5 -4
- package/dist/collection/components/toggle/toggle.js +1 -1
- package/dist/collection/components/tooltip/tooltip.css +43 -0
- package/dist/collection/components/tooltip/tooltip.js +203 -0
- package/dist/collection/components/tree/tree.css +1 -1
- package/dist/collection/components/tree/tree.js +1 -1
- package/dist/collection/components/tree-item/default-tree-item.js +1 -1
- package/dist/collection/components/tree-item/tree-item.css +5 -5
- package/dist/collection/components/tree-item/tree-item.js +2 -3
- package/dist/collection/components/typography/types.js +14 -0
- package/dist/collection/components/typography/typography.css +146 -0
- package/dist/collection/components/typography/typography.js +63 -0
- package/dist/collection/components/upload/upload-file-state.js +1 -1
- package/dist/collection/components/upload/upload.css +3 -3
- package/dist/collection/components/upload/upload.js +1 -1
- package/dist/collection/components/utils/animation.js +1 -1
- package/dist/collection/components/utils/menu-service/menu-service.js +53 -0
- package/dist/collection/components/utils/mutation-observer.js +1 -1
- package/dist/collection/components/utils/rwd.util.js +1 -1
- package/dist/collection/components/utils/screen/context.js +29 -0
- package/dist/collection/components/utils/screen/index.js +9 -0
- package/dist/collection/components/utils/screen/mode.js +36 -0
- package/dist/collection/components/utils/screen/service.js +45 -0
- package/dist/collection/components/utils/typed-event.js +1 -1
- package/dist/collection/components/validation-tooltip/validation-tooltip.css +4 -4
- package/dist/collection/components/validation-tooltip/validation-tooltip.js +1 -1
- package/dist/collection/components/workflow-step/workflow-step.css +2 -2
- package/dist/collection/components/workflow-step/workflow-step.js +1 -1
- package/dist/collection/components/workflow-steps/workflow-steps.css +2 -2
- package/dist/collection/components/workflow-steps/workflow-steps.js +1 -1
- package/dist/collection/env.js +1 -1
- package/dist/collection/exports.js +2 -1
- package/dist/collection/index.js +1 -1
- package/dist/collection/tests/utils/test/index.js +9 -0
- package/dist/collection/tests/utils/test/matchMedia.mock.js +22 -0
- package/dist/collection/tests/utils/test/page.js +29 -0
- package/dist/collection/utils/test/index.js +1 -1
- package/dist/collection/utils/test/matchMedia.mock.js +22 -0
- package/dist/collection/utils/test/page.js +2 -2
- package/dist/components/animation.js +1 -1
- package/dist/components/application-header.js +33 -4
- package/dist/components/base-button.js +1 -1
- package/dist/components/burger-menu.js +35 -0
- package/dist/components/button.js +2 -2
- package/dist/components/dropdown-item.js +3 -1
- package/dist/components/dropdown.js +86 -14
- package/dist/components/{alignment.js → floating-ui.dom.esm.js} +529 -401
- package/dist/components/group-context-menu.js +0 -3
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +7 -2
- package/dist/components/ix-basic-navigation.js +25 -5
- package/dist/components/ix-burger-menu.d.ts +11 -0
- package/dist/components/ix-burger-menu.js +6 -0
- package/dist/components/ix-category-filter.js +3 -3
- package/dist/components/ix-divider.d.ts +11 -0
- package/dist/components/ix-divider.js +33 -0
- package/dist/components/ix-dropdown-button.js +5 -3
- package/dist/components/ix-dropdown-quick-actions.d.ts +11 -0
- package/dist/components/ix-dropdown-quick-actions.js +33 -0
- package/dist/components/ix-event-list-item.js +1 -1
- package/dist/components/ix-flip-tile.js +1 -1
- package/dist/components/ix-group.js +1 -1
- package/dist/components/ix-map-navigation.js +8 -2
- package/dist/components/ix-menu-avatar.js +21 -2
- package/dist/components/ix-menu.js +31 -11
- package/dist/components/ix-modal-example.js +1 -1
- package/dist/components/ix-select.js +6 -4
- package/dist/components/ix-split-button.js +1 -1
- package/dist/components/ix-toggle.js +1 -1
- package/dist/components/ix-tooltip.d.ts +11 -0
- package/dist/components/ix-tooltip.js +152 -0
- package/dist/components/ix-tree.js +1 -1
- package/dist/components/ix-typography.d.ts +11 -0
- package/dist/components/ix-typography.js +6 -0
- package/dist/components/ix-upload.js +1 -1
- package/dist/components/ix-validation-tooltip.js +11 -1
- package/dist/components/menu-item.js +2 -2
- package/dist/components/modal-container.js +1 -1
- package/dist/components/mutation-observer.js +1 -1
- package/dist/components/my-component.js +1 -1
- package/dist/components/rwd.util.js +1 -1
- package/dist/components/service.js +139 -0
- package/dist/components/tab-item.js +1 -1
- package/dist/components/tabs.js +13 -4
- package/dist/components/toast.js +8 -4
- package/dist/components/tree-item.js +1 -2
- package/dist/components/typed-event.js +1 -1
- package/dist/components/typography.js +51 -0
- package/dist/esm/{animation-b667a4c4.js → animation-268dce50.js} +1 -1
- package/dist/esm/{base-button-0b6635df.js → base-button-5bfeb71c.js} +1 -1
- package/dist/esm/context-f6a2b727.js +71 -0
- package/dist/esm/{default-tree-item-638c435a.js → default-tree-item-91ff2c08.js} +1 -1
- package/dist/esm/{flip-tile-state-28a1f8ce.js → flip-tile-state-051bb2fd.js} +1 -1
- package/dist/esm/{alignment-f63c1b89.js → floating-ui.dom.esm-3130eda0.js} +529 -401
- package/dist/esm/index-6b660a23.js +20 -0
- package/dist/esm/index.js +12 -12
- package/dist/esm/ix-animated-tab_2.entry.js +2 -2
- package/dist/esm/ix-application-header.entry.js +25 -2
- package/dist/esm/ix-basic-navigation.entry.js +16 -2
- package/dist/esm/ix-breadcrumb_2.entry.js +1 -1
- package/dist/esm/ix-burger-menu.entry.js +18 -0
- package/dist/esm/ix-button.entry.js +3 -3
- package/dist/esm/ix-category-filter.entry.js +2 -2
- package/dist/esm/ix-divider.entry.js +15 -0
- package/dist/esm/ix-dropdown-button.entry.js +5 -3
- package/dist/esm/ix-dropdown-quick-actions.entry.js +15 -0
- package/dist/esm/ix-dropdown_2.entry.js +87 -15
- package/dist/esm/ix-event-list_2.entry.js +3 -3
- package/dist/esm/ix-flip-tile_2.entry.js +1 -1
- package/dist/esm/ix-group-context-menu.entry.js +0 -3
- package/dist/esm/ix-group_3.entry.js +1 -1
- package/dist/esm/ix-icon-button.entry.js +1 -1
- package/dist/esm/ix-menu_9.entry.js +47 -16
- package/dist/esm/ix-modal-example.entry.js +1 -1
- package/dist/esm/ix-modal_2.entry.js +3 -3
- package/dist/esm/ix-select_2.entry.js +6 -4
- package/dist/esm/ix-split-button_2.entry.js +2 -2
- package/dist/esm/ix-tab-item.entry.js +1 -1
- package/dist/esm/ix-tabs.entry.js +11 -4
- package/dist/esm/ix-toast_2.entry.js +9 -5
- package/dist/esm/ix-toggle.entry.js +1 -1
- package/dist/esm/ix-tooltip.entry.js +123 -0
- package/dist/esm/ix-tree_2.entry.js +2 -3
- package/dist/esm/ix-typography.entry.js +34 -0
- package/dist/esm/ix-upload.entry.js +1 -1
- package/dist/esm/ix-validation-tooltip.entry.js +11 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{logical-filter-operator-1bf83315.js → logical-filter-operator-15696001.js} +2 -2
- package/dist/esm/{modal-3618eb44.js → modal-64e18970.js} +3 -3
- package/dist/esm/{modal-utils-df50b35a.js → modal-utils-aecbcba5.js} +1 -1
- package/dist/esm/{mutation-observer-379959bb.js → mutation-observer-7d01bbea.js} +1 -1
- package/dist/esm/my-component.entry.js +1 -1
- package/dist/esm/{rwd.util-4a61a4b8.js → rwd.util-cfc2ea72.js} +1 -1
- package/dist/esm/service-fc436c5b.js +71 -0
- package/dist/esm/siemens-ix.js +1 -1
- package/dist/esm/{theme-switcher-9ecc9b69.js → theme-switcher-4b9e5cc2.js} +1 -1
- package/dist/esm/{typed-event-ab58c27e.js → typed-event-a230184a.js} +1 -1
- package/dist/esm/{upload-file-state-631bb8a2.js → upload-file-state-532a36d3.js} +1 -1
- package/dist/siemens-ix/index.esm.js +1 -1
- package/dist/siemens-ix/p-06d5ab35.entry.js +1 -0
- package/dist/siemens-ix/{p-3c754d90.entry.js → p-0bf4a256.entry.js} +1 -1
- package/dist/siemens-ix/{p-8c53c142.entry.js → p-122c7f57.entry.js} +1 -1
- package/dist/siemens-ix/p-1572aab3.js +1 -0
- package/dist/siemens-ix/{p-921da56a.entry.js → p-165c6a82.entry.js} +1 -1
- package/dist/siemens-ix/{p-9299617f.entry.js → p-20c88582.entry.js} +1 -1
- package/dist/siemens-ix/p-4b2265fd.entry.js +1 -0
- package/dist/siemens-ix/p-519b13aa.entry.js +1 -0
- package/dist/siemens-ix/p-529d7530.js +1 -0
- package/dist/siemens-ix/{p-783ce87b.entry.js → p-5b47360e.entry.js} +1 -1
- package/dist/siemens-ix/{p-a3a59238.entry.js → p-5ca7b937.entry.js} +1 -1
- package/dist/siemens-ix/p-5feec7a4.entry.js +1 -0
- package/dist/siemens-ix/p-622fb593.entry.js +1 -0
- package/dist/siemens-ix/p-63776469.entry.js +1 -0
- package/dist/siemens-ix/p-68ec0b51.entry.js +1 -0
- package/dist/siemens-ix/p-6b463b40.entry.js +1 -0
- package/dist/siemens-ix/p-6e5543fe.entry.js +1 -0
- package/dist/siemens-ix/p-71c91a11.entry.js +1 -0
- package/dist/siemens-ix/{p-ab35eaee.entry.js → p-72cc8632.entry.js} +1 -1
- package/dist/siemens-ix/{p-8c3bfc2f.js → p-75abd144.js} +1 -1
- package/dist/siemens-ix/p-8d2e0fb5.entry.js +1 -0
- package/dist/siemens-ix/p-94b440bc.entry.js +1 -0
- package/dist/siemens-ix/{p-70bd3dbf.entry.js → p-9eb8347c.entry.js} +1 -1
- package/dist/siemens-ix/p-9fa6a59b.entry.js +1 -0
- package/dist/siemens-ix/p-ac1d6617.entry.js +1 -0
- package/dist/siemens-ix/{p-f6e713f3.js → p-affb60fb.js} +1 -1
- package/dist/siemens-ix/p-b5599b0b.entry.js +1 -0
- package/dist/siemens-ix/{p-60b90da6.entry.js → p-b85458fb.entry.js} +1 -1
- package/dist/siemens-ix/p-c2b50878.entry.js +1 -0
- package/dist/siemens-ix/{p-50ed9d54.entry.js → p-d1a16c62.entry.js} +1 -1
- package/dist/siemens-ix/p-d1a8d791.entry.js +1 -0
- package/dist/siemens-ix/p-e4bda8e7.entry.js +1 -0
- package/dist/siemens-ix/p-e5fd4b34.entry.js +1 -0
- package/dist/siemens-ix/{p-404e81d2.entry.js → p-f0289f67.entry.js} +1 -1
- package/dist/siemens-ix/p-f34a16c6.js +1 -0
- package/dist/siemens-ix/p-feefa8c7.entry.js +1 -0
- package/dist/siemens-ix/siemens-ix.css +50 -48
- package/dist/siemens-ix/siemens-ix.esm.js +1 -1
- package/dist/types/components/application-header/application-header.d.ts +8 -0
- package/dist/types/components/basic-navigation/basic-navigation.d.ts +6 -1
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts +1 -1
- package/dist/types/components/divider/divider.d.ts +6 -0
- package/dist/types/components/dropdown/dropdown-trigger-event.d.ts +4 -0
- package/dist/types/components/dropdown/dropdown.d.ts +18 -1
- package/dist/types/components/dropdown-button/dropdown-button.d.ts +1 -1
- package/dist/types/components/dropdown-quick-actions/dropdown-quick-actions.d.ts +6 -0
- package/dist/types/components/group/group-context-menu.d.ts +0 -2
- package/dist/types/components/menu/burger-menu.d.ts +10 -0
- package/dist/types/components/menu/menu.d.ts +3 -1
- package/dist/types/components/menu-avatar/menu-avatar.d.ts +12 -0
- package/dist/types/components/split-button/split-button.d.ts +1 -1
- package/dist/types/components/tabs/tabs.d.ts +3 -0
- package/dist/types/components/tooltip/tooltip.d.ts +39 -0
- package/dist/types/components/typography/types.d.ts +2 -0
- package/dist/types/components/typography/typography.d.ts +11 -0
- package/dist/types/components/utils/menu-service/menu-service.d.ts +13 -0
- package/dist/types/components/utils/screen/context.d.ts +4 -0
- package/dist/types/components/utils/screen/index.d.ts +1 -0
- package/dist/types/components/utils/screen/mode.d.ts +10 -0
- package/dist/types/components/utils/screen/service.d.ts +10 -0
- package/dist/types/components.d.ts +147 -6
- package/dist/types/exports.d.ts +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/tests/utils/test/index.d.ts +1 -0
- package/dist/types/tests/utils/test/page.d.ts +3 -0
- package/package.json +2 -2
- package/scss/_common-variables.scss +1 -1
- package/scss/_fonts.scss +1 -1
- package/scss/_z-index.scss +1 -1
- package/scss/components/_button-group.scss +1 -1
- package/scss/components/_buttons.scss +1 -1
- package/scss/components/_checkboxes.scss +5 -5
- package/scss/components/_dropdown.scss +5 -1
- package/scss/components/_forms.scss +13 -11
- package/scss/components/_input-group.scss +1 -1
- package/scss/components/_links.scss +1 -1
- package/scss/components/_modal.scss +1 -1
- package/scss/components/_radiobuttons.scss +1 -1
- package/scss/components/_shadows.scss +1 -1
- package/scss/components/_table.scss +1 -1
- package/scss/ix.scss +1 -1
- package/scss/mixins/_animations.scss +1 -1
- package/scss/mixins/_fonts.scss +1 -1
- package/scss/mixins/_hover.scss +1 -1
- package/scss/mixins/_shadows.scss +1 -1
- package/scss/mixins/_text-truncation.scss +1 -1
- package/scss/theme/classic-dark/_borderWidth.scss +1 -1
- package/scss/theme/classic-dark/_boxShadow.scss +1 -1
- package/scss/theme/classic-dark/_color.scss +3 -3
- package/scss/theme/classic-light/_borderWidth.scss +1 -1
- package/scss/theme/classic-light/_boxShadow.scss +1 -1
- package/scss/theme/classic-light/_color.scss +3 -3
- package/dist/siemens-ix/p-10158414.entry.js +0 -1
- package/dist/siemens-ix/p-2c5abec1.js +0 -1
- package/dist/siemens-ix/p-2c8e4dd1.entry.js +0 -1
- package/dist/siemens-ix/p-4ac5d916.entry.js +0 -1
- package/dist/siemens-ix/p-55663fd5.entry.js +0 -1
- package/dist/siemens-ix/p-6637ae65.entry.js +0 -1
- package/dist/siemens-ix/p-6df18451.entry.js +0 -1
- package/dist/siemens-ix/p-72cfbc1c.entry.js +0 -1
- package/dist/siemens-ix/p-b46155b7.entry.js +0 -1
- package/dist/siemens-ix/p-b7b753cc.entry.js +0 -1
- package/dist/siemens-ix/p-b9a66b74.entry.js +0 -1
- package/dist/siemens-ix/p-e51a110f.entry.js +0 -1
- package/dist/siemens-ix/p-e652328d.entry.js +0 -1
- package/dist/siemens-ix/p-e82905f0.entry.js +0 -1
- package/dist/siemens-ix/p-f05b01a4.entry.js +0 -1
- package/dist/siemens-ix/p-f1a1e8ee.entry.js +0 -1
- /package/dist/collection/components/{utils → button}/button-variants.js +0 -0
- /package/dist/siemens-ix/{p-da2cae32.js → p-076c29d1.js} +0 -0
- /package/dist/siemens-ix/{p-1d30454e.js → p-15bebd8a.js} +0 -0
- /package/dist/siemens-ix/{p-c8cc3bb3.js → p-21aa3602.js} +0 -0
- /package/dist/siemens-ix/{p-0a12b3df.js → p-2b33ead4.js} +0 -0
- /package/dist/siemens-ix/{p-bdd294d2.js → p-3b97bb69.js} +0 -0
- /package/dist/siemens-ix/{p-1c82637e.js → p-56ed024b.js} +0 -0
- /package/dist/siemens-ix/{p-b12006c6.js → p-5b39e04e.js} +0 -0
- /package/dist/siemens-ix/{p-4944ad0b.js → p-9ee41861.js} +0 -0
- /package/dist/siemens-ix/{p-96e46f99.js → p-b14308ed.js} +0 -0
- /package/dist/siemens-ix/{p-fbe40498.js → p-c0454c9a.js} +0 -0
- /package/dist/types/components/{utils → button}/button-variants.d.ts +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
function
|
|
2
|
-
return placement.split('-')[
|
|
1
|
+
function getAlignment(placement) {
|
|
2
|
+
return placement.split('-')[1];
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
function
|
|
6
|
-
return
|
|
5
|
+
function getLengthFromAxis(axis) {
|
|
6
|
+
return axis === 'y' ? 'height' : 'width';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function getSide(placement) {
|
|
10
|
+
return placement.split('-')[0];
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
function getMainAxisFromPlacement(placement) {
|
|
14
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
@@ -27,7 +27,6 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
27
27
|
const side = getSide(placement);
|
|
28
28
|
const isVertical = mainAxis === 'x';
|
|
29
29
|
let coords;
|
|
30
|
-
|
|
31
30
|
switch (side) {
|
|
32
31
|
case 'top':
|
|
33
32
|
coords = {
|
|
@@ -35,45 +34,38 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
35
34
|
y: reference.y - floating.height
|
|
36
35
|
};
|
|
37
36
|
break;
|
|
38
|
-
|
|
39
37
|
case 'bottom':
|
|
40
38
|
coords = {
|
|
41
39
|
x: commonX,
|
|
42
40
|
y: reference.y + reference.height
|
|
43
41
|
};
|
|
44
42
|
break;
|
|
45
|
-
|
|
46
43
|
case 'right':
|
|
47
44
|
coords = {
|
|
48
45
|
x: reference.x + reference.width,
|
|
49
46
|
y: commonY
|
|
50
47
|
};
|
|
51
48
|
break;
|
|
52
|
-
|
|
53
49
|
case 'left':
|
|
54
50
|
coords = {
|
|
55
51
|
x: reference.x - floating.width,
|
|
56
52
|
y: commonY
|
|
57
53
|
};
|
|
58
54
|
break;
|
|
59
|
-
|
|
60
55
|
default:
|
|
61
56
|
coords = {
|
|
62
57
|
x: reference.x,
|
|
63
58
|
y: reference.y
|
|
64
59
|
};
|
|
65
60
|
}
|
|
66
|
-
|
|
67
|
-
switch (getAlignment$1(placement)) {
|
|
61
|
+
switch (getAlignment(placement)) {
|
|
68
62
|
case 'start':
|
|
69
63
|
coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
70
64
|
break;
|
|
71
|
-
|
|
72
65
|
case 'end':
|
|
73
66
|
coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
74
67
|
break;
|
|
75
68
|
}
|
|
76
|
-
|
|
77
69
|
return coords;
|
|
78
70
|
}
|
|
79
71
|
|
|
@@ -84,7 +76,6 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
84
76
|
* This export does not have any `platform` interface logic. You will need to
|
|
85
77
|
* write one for the platform you are using Floating UI with.
|
|
86
78
|
*/
|
|
87
|
-
|
|
88
79
|
const computePosition$1 = async (reference, floating, config) => {
|
|
89
80
|
const {
|
|
90
81
|
placement = 'bottom',
|
|
@@ -94,7 +85,6 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
94
85
|
} = config;
|
|
95
86
|
const validMiddleware = middleware.filter(Boolean);
|
|
96
87
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
97
|
-
|
|
98
88
|
let rects = await platform.getElementRects({
|
|
99
89
|
reference,
|
|
100
90
|
floating,
|
|
@@ -107,7 +97,6 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
107
97
|
let statefulPlacement = placement;
|
|
108
98
|
let middlewareData = {};
|
|
109
99
|
let resetCount = 0;
|
|
110
|
-
|
|
111
100
|
for (let i = 0; i < validMiddleware.length; i++) {
|
|
112
101
|
const {
|
|
113
102
|
name,
|
|
@@ -134,20 +123,19 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
134
123
|
});
|
|
135
124
|
x = nextX != null ? nextX : x;
|
|
136
125
|
y = nextY != null ? nextY : y;
|
|
137
|
-
middlewareData = {
|
|
138
|
-
|
|
126
|
+
middlewareData = {
|
|
127
|
+
...middlewareData,
|
|
128
|
+
[name]: {
|
|
129
|
+
...middlewareData[name],
|
|
139
130
|
...data
|
|
140
131
|
}
|
|
141
132
|
};
|
|
142
|
-
|
|
143
133
|
if (reset && resetCount <= 50) {
|
|
144
134
|
resetCount++;
|
|
145
|
-
|
|
146
135
|
if (typeof reset === 'object') {
|
|
147
136
|
if (reset.placement) {
|
|
148
137
|
statefulPlacement = reset.placement;
|
|
149
138
|
}
|
|
150
|
-
|
|
151
139
|
if (reset.rects) {
|
|
152
140
|
rects = reset.rects === true ? await platform.getElementRects({
|
|
153
141
|
reference,
|
|
@@ -155,18 +143,15 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
155
143
|
strategy
|
|
156
144
|
}) : reset.rects;
|
|
157
145
|
}
|
|
158
|
-
|
|
159
146
|
({
|
|
160
147
|
x,
|
|
161
148
|
y
|
|
162
149
|
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
163
150
|
}
|
|
164
|
-
|
|
165
151
|
i = -1;
|
|
166
152
|
continue;
|
|
167
153
|
}
|
|
168
154
|
}
|
|
169
|
-
|
|
170
155
|
return {
|
|
171
156
|
x,
|
|
172
157
|
y,
|
|
@@ -196,7 +181,8 @@ function getSideObjectFromPadding(padding) {
|
|
|
196
181
|
}
|
|
197
182
|
|
|
198
183
|
function rectToClientRect(rect) {
|
|
199
|
-
return {
|
|
184
|
+
return {
|
|
185
|
+
...rect,
|
|
200
186
|
top: rect.y,
|
|
201
187
|
left: rect.x,
|
|
202
188
|
right: rect.x + rect.width,
|
|
@@ -214,11 +200,9 @@ function rectToClientRect(rect) {
|
|
|
214
200
|
*/
|
|
215
201
|
async function detectOverflow(middlewareArguments, options) {
|
|
216
202
|
var _await$platform$isEle;
|
|
217
|
-
|
|
218
203
|
if (options === void 0) {
|
|
219
204
|
options = {};
|
|
220
205
|
}
|
|
221
|
-
|
|
222
206
|
const {
|
|
223
207
|
x,
|
|
224
208
|
y,
|
|
@@ -243,19 +227,29 @@ async function detectOverflow(middlewareArguments, options) {
|
|
|
243
227
|
rootBoundary,
|
|
244
228
|
strategy
|
|
245
229
|
}));
|
|
230
|
+
const rect = elementContext === 'floating' ? {
|
|
231
|
+
...rects.floating,
|
|
232
|
+
x,
|
|
233
|
+
y
|
|
234
|
+
} : rects.reference;
|
|
235
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
236
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
237
|
+
x: 1,
|
|
238
|
+
y: 1
|
|
239
|
+
} : {
|
|
240
|
+
x: 1,
|
|
241
|
+
y: 1
|
|
242
|
+
};
|
|
246
243
|
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
247
|
-
rect
|
|
248
|
-
|
|
249
|
-
y
|
|
250
|
-
} : rects.reference,
|
|
251
|
-
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
|
244
|
+
rect,
|
|
245
|
+
offsetParent,
|
|
252
246
|
strategy
|
|
253
|
-
}) :
|
|
247
|
+
}) : rect);
|
|
254
248
|
return {
|
|
255
|
-
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
256
|
-
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
257
|
-
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
258
|
-
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
249
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
250
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
251
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
252
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
259
253
|
};
|
|
260
254
|
}
|
|
261
255
|
|
|
@@ -274,13 +268,12 @@ function within(min$1$1, value, max$1$1) {
|
|
|
274
268
|
const arrow = options => ({
|
|
275
269
|
name: 'arrow',
|
|
276
270
|
options,
|
|
277
|
-
|
|
278
271
|
async fn(middlewareArguments) {
|
|
279
|
-
// Since `element` is required, we don't Partial<> the type
|
|
272
|
+
// Since `element` is required, we don't Partial<> the type.
|
|
280
273
|
const {
|
|
281
274
|
element,
|
|
282
275
|
padding = 0
|
|
283
|
-
} = options
|
|
276
|
+
} = options || {};
|
|
284
277
|
const {
|
|
285
278
|
x,
|
|
286
279
|
y,
|
|
@@ -288,19 +281,15 @@ const arrow = options => ({
|
|
|
288
281
|
rects,
|
|
289
282
|
platform
|
|
290
283
|
} = middlewareArguments;
|
|
291
|
-
|
|
292
284
|
if (element == null) {
|
|
293
|
-
|
|
294
285
|
return {};
|
|
295
286
|
}
|
|
296
|
-
|
|
297
287
|
const paddingObject = getSideObjectFromPadding(padding);
|
|
298
288
|
const coords = {
|
|
299
289
|
x,
|
|
300
290
|
y
|
|
301
291
|
};
|
|
302
292
|
const axis = getMainAxisFromPlacement(placement);
|
|
303
|
-
const alignment = getAlignment$1(placement);
|
|
304
293
|
const length = getLengthFromAxis(axis);
|
|
305
294
|
const arrowDimensions = await platform.getDimensions(element);
|
|
306
295
|
const minProp = axis === 'y' ? 'top' : 'left';
|
|
@@ -309,21 +298,23 @@ const arrow = options => ({
|
|
|
309
298
|
const startDiff = coords[axis] - rects.reference[axis];
|
|
310
299
|
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
311
300
|
let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
312
|
-
|
|
313
301
|
if (clientSize === 0) {
|
|
314
302
|
clientSize = rects.floating[length];
|
|
315
303
|
}
|
|
304
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
316
305
|
|
|
317
|
-
|
|
318
|
-
// point is outside the floating element's bounds
|
|
319
|
-
|
|
306
|
+
// Make sure the arrow doesn't overflow the floating element if the center
|
|
307
|
+
// point is outside the floating element's bounds.
|
|
320
308
|
const min = paddingObject[minProp];
|
|
321
309
|
const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
|
|
322
310
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
323
|
-
const offset = within(min, center, max);
|
|
311
|
+
const offset = within(min, center, max);
|
|
324
312
|
|
|
325
|
-
|
|
326
|
-
|
|
313
|
+
// If the reference is small enough that the arrow's padding causes it to
|
|
314
|
+
// to point to nothing for an aligned placement, adjust the offset of the
|
|
315
|
+
// floating element itself. This stops `shift()` from taking action, but can
|
|
316
|
+
// be worked around by calling it again after the `arrow()` if desired.
|
|
317
|
+
const shouldAddOffset = getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min ? paddingObject[minProp] : paddingObject[maxProp]) - arrowDimensions[length] / 2 < 0;
|
|
327
318
|
const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;
|
|
328
319
|
return {
|
|
329
320
|
[axis]: coords[axis] - alignmentOffset,
|
|
@@ -333,61 +324,55 @@ const arrow = options => ({
|
|
|
333
324
|
}
|
|
334
325
|
};
|
|
335
326
|
}
|
|
336
|
-
|
|
337
327
|
});
|
|
338
328
|
|
|
339
|
-
const
|
|
329
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
330
|
+
const allPlacements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-start", side + "-end"), []);
|
|
331
|
+
|
|
332
|
+
const oppositeSideMap = {
|
|
340
333
|
left: 'right',
|
|
341
334
|
right: 'left',
|
|
342
335
|
bottom: 'top',
|
|
343
336
|
top: 'bottom'
|
|
344
337
|
};
|
|
345
338
|
function getOppositePlacement(placement) {
|
|
346
|
-
return placement.replace(/left|right|bottom|top/g,
|
|
339
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
347
340
|
}
|
|
348
341
|
|
|
349
342
|
function getAlignmentSides(placement, rects, rtl) {
|
|
350
343
|
if (rtl === void 0) {
|
|
351
344
|
rtl = false;
|
|
352
345
|
}
|
|
353
|
-
|
|
354
|
-
const alignment = getAlignment$1(placement);
|
|
346
|
+
const alignment = getAlignment(placement);
|
|
355
347
|
const mainAxis = getMainAxisFromPlacement(placement);
|
|
356
348
|
const length = getLengthFromAxis(mainAxis);
|
|
357
349
|
let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
358
|
-
|
|
359
350
|
if (rects.reference[length] > rects.floating[length]) {
|
|
360
351
|
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
361
352
|
}
|
|
362
|
-
|
|
363
353
|
return {
|
|
364
354
|
main: mainAlignmentSide,
|
|
365
355
|
cross: getOppositePlacement(mainAlignmentSide)
|
|
366
356
|
};
|
|
367
357
|
}
|
|
368
358
|
|
|
369
|
-
const
|
|
359
|
+
const oppositeAlignmentMap = {
|
|
370
360
|
start: 'end',
|
|
371
361
|
end: 'start'
|
|
372
362
|
};
|
|
373
363
|
function getOppositeAlignmentPlacement(placement) {
|
|
374
|
-
return placement.replace(/start|end/g,
|
|
364
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
375
365
|
}
|
|
376
366
|
|
|
377
|
-
const sides = ['top', 'right', 'bottom', 'left'];
|
|
378
|
-
const allPlacements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-start", side + "-end"), []);
|
|
379
|
-
|
|
380
367
|
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
381
|
-
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment
|
|
368
|
+
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
|
|
382
369
|
return allowedPlacementsSortedByAlignment.filter(placement => {
|
|
383
370
|
if (alignment) {
|
|
384
|
-
return getAlignment
|
|
371
|
+
return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
|
|
385
372
|
}
|
|
386
|
-
|
|
387
373
|
return true;
|
|
388
374
|
});
|
|
389
375
|
}
|
|
390
|
-
|
|
391
376
|
/**
|
|
392
377
|
* Automatically chooses the `placement` which has the most space available.
|
|
393
378
|
* @see https://floating-ui.com/docs/autoPlacement
|
|
@@ -396,17 +381,12 @@ const autoPlacement = function (options) {
|
|
|
396
381
|
if (options === void 0) {
|
|
397
382
|
options = {};
|
|
398
383
|
}
|
|
399
|
-
|
|
400
384
|
return {
|
|
401
385
|
name: 'autoPlacement',
|
|
402
386
|
options,
|
|
403
|
-
|
|
404
387
|
async fn(middlewareArguments) {
|
|
405
|
-
var _middlewareData$autoP, _middlewareData$autoP2,
|
|
406
|
-
|
|
388
|
+
var _middlewareData$autoP, _middlewareData$autoP2, _placementsSortedByLe;
|
|
407
389
|
const {
|
|
408
|
-
x,
|
|
409
|
-
y,
|
|
410
390
|
rects,
|
|
411
391
|
middlewareData,
|
|
412
392
|
placement,
|
|
@@ -414,42 +394,39 @@ const autoPlacement = function (options) {
|
|
|
414
394
|
elements
|
|
415
395
|
} = middlewareArguments;
|
|
416
396
|
const {
|
|
417
|
-
alignment
|
|
397
|
+
alignment,
|
|
418
398
|
allowedPlacements = allPlacements,
|
|
419
399
|
autoAlignment = true,
|
|
420
400
|
...detectOverflowOptions
|
|
421
401
|
} = options;
|
|
422
|
-
const placements = getPlacementList(alignment, autoAlignment, allowedPlacements);
|
|
402
|
+
const placements = alignment !== undefined || allowedPlacements === allPlacements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
423
403
|
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
424
|
-
const currentIndex = (_middlewareData$autoP =
|
|
404
|
+
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
425
405
|
const currentPlacement = placements[currentIndex];
|
|
426
|
-
|
|
427
406
|
if (currentPlacement == null) {
|
|
428
407
|
return {};
|
|
429
408
|
}
|
|
430
|
-
|
|
431
409
|
const {
|
|
432
410
|
main,
|
|
433
411
|
cross
|
|
434
|
-
} = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
412
|
+
} = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
435
413
|
|
|
414
|
+
// Make `computeCoords` start from the right place.
|
|
436
415
|
if (placement !== currentPlacement) {
|
|
437
416
|
return {
|
|
438
|
-
x,
|
|
439
|
-
y,
|
|
440
417
|
reset: {
|
|
441
418
|
placement: placements[0]
|
|
442
419
|
}
|
|
443
420
|
};
|
|
444
421
|
}
|
|
445
|
-
|
|
446
422
|
const currentOverflows = [overflow[getSide(currentPlacement)], overflow[main], overflow[cross]];
|
|
447
|
-
const allOverflows = [...((
|
|
423
|
+
const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
|
|
448
424
|
placement: currentPlacement,
|
|
449
425
|
overflows: currentOverflows
|
|
450
426
|
}];
|
|
451
|
-
const nextPlacement = placements[currentIndex + 1];
|
|
427
|
+
const nextPlacement = placements[currentIndex + 1];
|
|
452
428
|
|
|
429
|
+
// There are more placements to check.
|
|
453
430
|
if (nextPlacement) {
|
|
454
431
|
return {
|
|
455
432
|
data: {
|
|
@@ -461,7 +438,6 @@ const autoPlacement = function (options) {
|
|
|
461
438
|
}
|
|
462
439
|
};
|
|
463
440
|
}
|
|
464
|
-
|
|
465
441
|
const placementsSortedByLeastOverflow = allOverflows.slice().sort((a, b) => a.overflows[0] - b.overflows[0]);
|
|
466
442
|
const placementThatFitsOnAllSides = (_placementsSortedByLe = placementsSortedByLeastOverflow.find(_ref => {
|
|
467
443
|
let {
|
|
@@ -469,8 +445,7 @@ const autoPlacement = function (options) {
|
|
|
469
445
|
} = _ref;
|
|
470
446
|
return overflows.every(overflow => overflow <= 0);
|
|
471
447
|
})) == null ? void 0 : _placementsSortedByLe.placement;
|
|
472
|
-
const resetPlacement = placementThatFitsOnAllSides
|
|
473
|
-
|
|
448
|
+
const resetPlacement = placementThatFitsOnAllSides || placementsSortedByLeastOverflow[0].placement;
|
|
474
449
|
if (resetPlacement !== placement) {
|
|
475
450
|
return {
|
|
476
451
|
data: {
|
|
@@ -482,10 +457,251 @@ const autoPlacement = function (options) {
|
|
|
482
457
|
}
|
|
483
458
|
};
|
|
484
459
|
}
|
|
460
|
+
return {};
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
function getExpandedPlacements(placement) {
|
|
466
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
467
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function getSideList(side, isStart, rtl) {
|
|
471
|
+
const lr = ['left', 'right'];
|
|
472
|
+
const rl = ['right', 'left'];
|
|
473
|
+
const tb = ['top', 'bottom'];
|
|
474
|
+
const bt = ['bottom', 'top'];
|
|
475
|
+
switch (side) {
|
|
476
|
+
case 'top':
|
|
477
|
+
case 'bottom':
|
|
478
|
+
if (rtl) return isStart ? rl : lr;
|
|
479
|
+
return isStart ? lr : rl;
|
|
480
|
+
case 'left':
|
|
481
|
+
case 'right':
|
|
482
|
+
return isStart ? tb : bt;
|
|
483
|
+
default:
|
|
484
|
+
return [];
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
488
|
+
const alignment = getAlignment(placement);
|
|
489
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
490
|
+
if (alignment) {
|
|
491
|
+
list = list.map(side => side + "-" + alignment);
|
|
492
|
+
if (flipAlignment) {
|
|
493
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return list;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Changes the placement of the floating element to one that will fit if the
|
|
501
|
+
* initially specified `placement` does not.
|
|
502
|
+
* @see https://floating-ui.com/docs/flip
|
|
503
|
+
*/
|
|
504
|
+
const flip = function (options) {
|
|
505
|
+
if (options === void 0) {
|
|
506
|
+
options = {};
|
|
507
|
+
}
|
|
508
|
+
return {
|
|
509
|
+
name: 'flip',
|
|
510
|
+
options,
|
|
511
|
+
async fn(middlewareArguments) {
|
|
512
|
+
var _middlewareData$flip;
|
|
513
|
+
const {
|
|
514
|
+
placement,
|
|
515
|
+
middlewareData,
|
|
516
|
+
rects,
|
|
517
|
+
initialPlacement,
|
|
518
|
+
platform,
|
|
519
|
+
elements
|
|
520
|
+
} = middlewareArguments;
|
|
521
|
+
const {
|
|
522
|
+
mainAxis: checkMainAxis = true,
|
|
523
|
+
crossAxis: checkCrossAxis = true,
|
|
524
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
525
|
+
fallbackStrategy = 'bestFit',
|
|
526
|
+
fallbackAxisSideDirection = 'none',
|
|
527
|
+
flipAlignment = true,
|
|
528
|
+
...detectOverflowOptions
|
|
529
|
+
} = options;
|
|
530
|
+
const side = getSide(placement);
|
|
531
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
532
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
533
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
534
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
|
|
535
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
536
|
+
}
|
|
537
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
538
|
+
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
539
|
+
const overflows = [];
|
|
540
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
541
|
+
if (checkMainAxis) {
|
|
542
|
+
overflows.push(overflow[side]);
|
|
543
|
+
}
|
|
544
|
+
if (checkCrossAxis) {
|
|
545
|
+
const {
|
|
546
|
+
main,
|
|
547
|
+
cross
|
|
548
|
+
} = getAlignmentSides(placement, rects, rtl);
|
|
549
|
+
overflows.push(overflow[main], overflow[cross]);
|
|
550
|
+
}
|
|
551
|
+
overflowsData = [...overflowsData, {
|
|
552
|
+
placement,
|
|
553
|
+
overflows
|
|
554
|
+
}];
|
|
485
555
|
|
|
556
|
+
// One or more sides is overflowing.
|
|
557
|
+
if (!overflows.every(side => side <= 0)) {
|
|
558
|
+
var _middlewareData$flip2;
|
|
559
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
560
|
+
const nextPlacement = placements[nextIndex];
|
|
561
|
+
if (nextPlacement) {
|
|
562
|
+
// Try next placement and re-run the lifecycle.
|
|
563
|
+
return {
|
|
564
|
+
data: {
|
|
565
|
+
index: nextIndex,
|
|
566
|
+
overflows: overflowsData
|
|
567
|
+
},
|
|
568
|
+
reset: {
|
|
569
|
+
placement: nextPlacement
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
let resetPlacement = 'bottom';
|
|
574
|
+
switch (fallbackStrategy) {
|
|
575
|
+
case 'bestFit':
|
|
576
|
+
{
|
|
577
|
+
var _overflowsData$map$so;
|
|
578
|
+
const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
|
|
579
|
+
if (placement) {
|
|
580
|
+
resetPlacement = placement;
|
|
581
|
+
}
|
|
582
|
+
break;
|
|
583
|
+
}
|
|
584
|
+
case 'initialPlacement':
|
|
585
|
+
resetPlacement = initialPlacement;
|
|
586
|
+
break;
|
|
587
|
+
}
|
|
588
|
+
if (placement !== resetPlacement) {
|
|
589
|
+
return {
|
|
590
|
+
reset: {
|
|
591
|
+
placement: resetPlacement
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
}
|
|
486
596
|
return {};
|
|
487
597
|
}
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Provides improved positioning for inline reference elements that can span
|
|
603
|
+
* over multiple lines, such as hyperlinks or range selections.
|
|
604
|
+
* @see https://floating-ui.com/docs/inline
|
|
605
|
+
*/
|
|
606
|
+
const inline = function (options) {
|
|
607
|
+
if (options === void 0) {
|
|
608
|
+
options = {};
|
|
609
|
+
}
|
|
610
|
+
return {
|
|
611
|
+
name: 'inline',
|
|
612
|
+
options,
|
|
613
|
+
async fn(middlewareArguments) {
|
|
614
|
+
const {
|
|
615
|
+
placement,
|
|
616
|
+
elements,
|
|
617
|
+
rects,
|
|
618
|
+
platform,
|
|
619
|
+
strategy
|
|
620
|
+
} = middlewareArguments;
|
|
621
|
+
// A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
|
|
622
|
+
// ClientRect's bounds, despite the event listener being triggered. A
|
|
623
|
+
// padding of 2 seems to handle this issue.
|
|
624
|
+
const {
|
|
625
|
+
padding = 2,
|
|
626
|
+
x,
|
|
627
|
+
y
|
|
628
|
+
} = options;
|
|
629
|
+
const fallback = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
630
|
+
rect: rects.reference,
|
|
631
|
+
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
|
632
|
+
strategy
|
|
633
|
+
}) : rects.reference);
|
|
634
|
+
const clientRects = (await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || [];
|
|
635
|
+
const paddingObject = getSideObjectFromPadding(padding);
|
|
636
|
+
function getBoundingClientRect() {
|
|
637
|
+
// There are two rects and they are disjoined.
|
|
638
|
+
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
639
|
+
// Find the first rect in which the point is fully inside.
|
|
640
|
+
return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
|
|
641
|
+
}
|
|
488
642
|
|
|
643
|
+
// There are 2 or more connected rects.
|
|
644
|
+
if (clientRects.length >= 2) {
|
|
645
|
+
if (getMainAxisFromPlacement(placement) === 'x') {
|
|
646
|
+
const firstRect = clientRects[0];
|
|
647
|
+
const lastRect = clientRects[clientRects.length - 1];
|
|
648
|
+
const isTop = getSide(placement) === 'top';
|
|
649
|
+
const top = firstRect.top;
|
|
650
|
+
const bottom = lastRect.bottom;
|
|
651
|
+
const left = isTop ? firstRect.left : lastRect.left;
|
|
652
|
+
const right = isTop ? firstRect.right : lastRect.right;
|
|
653
|
+
const width = right - left;
|
|
654
|
+
const height = bottom - top;
|
|
655
|
+
return {
|
|
656
|
+
top,
|
|
657
|
+
bottom,
|
|
658
|
+
left,
|
|
659
|
+
right,
|
|
660
|
+
width,
|
|
661
|
+
height,
|
|
662
|
+
x: left,
|
|
663
|
+
y: top
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
const isLeftSide = getSide(placement) === 'left';
|
|
667
|
+
const maxRight = max$1(...clientRects.map(rect => rect.right));
|
|
668
|
+
const minLeft = min$1(...clientRects.map(rect => rect.left));
|
|
669
|
+
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
670
|
+
const top = measureRects[0].top;
|
|
671
|
+
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
672
|
+
const left = minLeft;
|
|
673
|
+
const right = maxRight;
|
|
674
|
+
const width = right - left;
|
|
675
|
+
const height = bottom - top;
|
|
676
|
+
return {
|
|
677
|
+
top,
|
|
678
|
+
bottom,
|
|
679
|
+
left,
|
|
680
|
+
right,
|
|
681
|
+
width,
|
|
682
|
+
height,
|
|
683
|
+
x: left,
|
|
684
|
+
y: top
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
return fallback;
|
|
688
|
+
}
|
|
689
|
+
const resetRects = await platform.getElementRects({
|
|
690
|
+
reference: {
|
|
691
|
+
getBoundingClientRect
|
|
692
|
+
},
|
|
693
|
+
floating: elements.floating,
|
|
694
|
+
strategy
|
|
695
|
+
});
|
|
696
|
+
if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
|
|
697
|
+
return {
|
|
698
|
+
reset: {
|
|
699
|
+
rects: resetRects
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
return {};
|
|
704
|
+
}
|
|
489
705
|
};
|
|
490
706
|
};
|
|
491
707
|
|
|
@@ -497,12 +713,13 @@ async function convertValueToCoords(middlewareArguments, value) {
|
|
|
497
713
|
} = middlewareArguments;
|
|
498
714
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
499
715
|
const side = getSide(placement);
|
|
500
|
-
const alignment = getAlignment
|
|
716
|
+
const alignment = getAlignment(placement);
|
|
501
717
|
const isVertical = getMainAxisFromPlacement(placement) === 'x';
|
|
502
718
|
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
503
719
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
504
|
-
const rawValue = typeof value === 'function' ? value(middlewareArguments) : value;
|
|
720
|
+
const rawValue = typeof value === 'function' ? value(middlewareArguments) : value;
|
|
505
721
|
|
|
722
|
+
// eslint-disable-next-line prefer-const
|
|
506
723
|
let {
|
|
507
724
|
mainAxis,
|
|
508
725
|
crossAxis,
|
|
@@ -517,11 +734,9 @@ async function convertValueToCoords(middlewareArguments, value) {
|
|
|
517
734
|
alignmentAxis: null,
|
|
518
735
|
...rawValue
|
|
519
736
|
};
|
|
520
|
-
|
|
521
737
|
if (alignment && typeof alignmentAxis === 'number') {
|
|
522
738
|
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
523
739
|
}
|
|
524
|
-
|
|
525
740
|
return isVertical ? {
|
|
526
741
|
x: crossAxis * crossAxisMulti,
|
|
527
742
|
y: mainAxis * mainAxisMulti
|
|
@@ -530,20 +745,18 @@ async function convertValueToCoords(middlewareArguments, value) {
|
|
|
530
745
|
y: crossAxis * crossAxisMulti
|
|
531
746
|
};
|
|
532
747
|
}
|
|
748
|
+
|
|
533
749
|
/**
|
|
534
750
|
* Displaces the floating element from its reference element.
|
|
535
751
|
* @see https://floating-ui.com/docs/offset
|
|
536
752
|
*/
|
|
537
|
-
|
|
538
753
|
const offset = function (value) {
|
|
539
754
|
if (value === void 0) {
|
|
540
755
|
value = 0;
|
|
541
756
|
}
|
|
542
|
-
|
|
543
757
|
return {
|
|
544
758
|
name: 'offset',
|
|
545
759
|
options: value,
|
|
546
|
-
|
|
547
760
|
async fn(middlewareArguments) {
|
|
548
761
|
const {
|
|
549
762
|
x,
|
|
@@ -556,7 +769,6 @@ const offset = function (value) {
|
|
|
556
769
|
data: diffCoords
|
|
557
770
|
};
|
|
558
771
|
}
|
|
559
|
-
|
|
560
772
|
};
|
|
561
773
|
};
|
|
562
774
|
|
|
@@ -573,11 +785,9 @@ const shift = function (options) {
|
|
|
573
785
|
if (options === void 0) {
|
|
574
786
|
options = {};
|
|
575
787
|
}
|
|
576
|
-
|
|
577
788
|
return {
|
|
578
789
|
name: 'shift',
|
|
579
790
|
options,
|
|
580
|
-
|
|
581
791
|
async fn(middlewareArguments) {
|
|
582
792
|
const {
|
|
583
793
|
x,
|
|
@@ -610,7 +820,6 @@ const shift = function (options) {
|
|
|
610
820
|
const crossAxis = getCrossAxis(mainAxis);
|
|
611
821
|
let mainAxisCoord = coords[mainAxis];
|
|
612
822
|
let crossAxisCoord = coords[crossAxis];
|
|
613
|
-
|
|
614
823
|
if (checkMainAxis) {
|
|
615
824
|
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
616
825
|
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
@@ -618,7 +827,6 @@ const shift = function (options) {
|
|
|
618
827
|
const max = mainAxisCoord - overflow[maxSide];
|
|
619
828
|
mainAxisCoord = within(min, mainAxisCoord, max);
|
|
620
829
|
}
|
|
621
|
-
|
|
622
830
|
if (checkCrossAxis) {
|
|
623
831
|
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
624
832
|
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
@@ -626,173 +834,45 @@ const shift = function (options) {
|
|
|
626
834
|
const max = crossAxisCoord - overflow[maxSide];
|
|
627
835
|
crossAxisCoord = within(min, crossAxisCoord, max);
|
|
628
836
|
}
|
|
629
|
-
|
|
630
|
-
|
|
837
|
+
const limitedCoords = limiter.fn({
|
|
838
|
+
...middlewareArguments,
|
|
631
839
|
[mainAxis]: mainAxisCoord,
|
|
632
840
|
[crossAxis]: crossAxisCoord
|
|
633
841
|
});
|
|
634
|
-
return {
|
|
842
|
+
return {
|
|
843
|
+
...limitedCoords,
|
|
635
844
|
data: {
|
|
636
845
|
x: limitedCoords.x - x,
|
|
637
846
|
y: limitedCoords.y - y
|
|
638
847
|
}
|
|
639
848
|
};
|
|
640
849
|
}
|
|
641
|
-
|
|
642
850
|
};
|
|
643
851
|
};
|
|
644
852
|
|
|
645
|
-
/**
|
|
646
|
-
* Provides improved positioning for inline reference elements that can span
|
|
647
|
-
* over multiple lines, such as hyperlinks or range selections.
|
|
648
|
-
* @see https://floating-ui.com/docs/inline
|
|
649
|
-
*/
|
|
650
|
-
const inline = function (options) {
|
|
651
|
-
if (options === void 0) {
|
|
652
|
-
options = {};
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
return {
|
|
656
|
-
name: 'inline',
|
|
657
|
-
options,
|
|
658
|
-
|
|
659
|
-
async fn(middlewareArguments) {
|
|
660
|
-
var _await$platform$getCl;
|
|
661
|
-
|
|
662
|
-
const {
|
|
663
|
-
placement,
|
|
664
|
-
elements,
|
|
665
|
-
rects,
|
|
666
|
-
platform,
|
|
667
|
-
strategy
|
|
668
|
-
} = middlewareArguments; // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
|
|
669
|
-
// ClientRect's bounds, despite the event listener being triggered. A
|
|
670
|
-
// padding of 2 seems to handle this issue.
|
|
671
|
-
|
|
672
|
-
const {
|
|
673
|
-
padding = 2,
|
|
674
|
-
x,
|
|
675
|
-
y
|
|
676
|
-
} = options;
|
|
677
|
-
const fallback = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
678
|
-
rect: rects.reference,
|
|
679
|
-
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
|
680
|
-
strategy
|
|
681
|
-
}) : rects.reference);
|
|
682
|
-
const clientRects = (_await$platform$getCl = await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) != null ? _await$platform$getCl : [];
|
|
683
|
-
const paddingObject = getSideObjectFromPadding(padding);
|
|
684
|
-
|
|
685
|
-
function getBoundingClientRect() {
|
|
686
|
-
// There are two rects and they are disjoined
|
|
687
|
-
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
688
|
-
var _clientRects$find;
|
|
689
|
-
|
|
690
|
-
// Find the first rect in which the point is fully inside
|
|
691
|
-
return (_clientRects$find = clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom)) != null ? _clientRects$find : fallback;
|
|
692
|
-
} // There are 2 or more connected rects
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
if (clientRects.length >= 2) {
|
|
696
|
-
if (getMainAxisFromPlacement(placement) === 'x') {
|
|
697
|
-
const firstRect = clientRects[0];
|
|
698
|
-
const lastRect = clientRects[clientRects.length - 1];
|
|
699
|
-
const isTop = getSide(placement) === 'top';
|
|
700
|
-
const top = firstRect.top;
|
|
701
|
-
const bottom = lastRect.bottom;
|
|
702
|
-
const left = isTop ? firstRect.left : lastRect.left;
|
|
703
|
-
const right = isTop ? firstRect.right : lastRect.right;
|
|
704
|
-
const width = right - left;
|
|
705
|
-
const height = bottom - top;
|
|
706
|
-
return {
|
|
707
|
-
top,
|
|
708
|
-
bottom,
|
|
709
|
-
left,
|
|
710
|
-
right,
|
|
711
|
-
width,
|
|
712
|
-
height,
|
|
713
|
-
x: left,
|
|
714
|
-
y: top
|
|
715
|
-
};
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
const isLeftSide = getSide(placement) === 'left';
|
|
719
|
-
const maxRight = max$1(...clientRects.map(rect => rect.right));
|
|
720
|
-
const minLeft = min$1(...clientRects.map(rect => rect.left));
|
|
721
|
-
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
722
|
-
const top = measureRects[0].top;
|
|
723
|
-
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
724
|
-
const left = minLeft;
|
|
725
|
-
const right = maxRight;
|
|
726
|
-
const width = right - left;
|
|
727
|
-
const height = bottom - top;
|
|
728
|
-
return {
|
|
729
|
-
top,
|
|
730
|
-
bottom,
|
|
731
|
-
left,
|
|
732
|
-
right,
|
|
733
|
-
width,
|
|
734
|
-
height,
|
|
735
|
-
x: left,
|
|
736
|
-
y: top
|
|
737
|
-
};
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
return fallback;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
const resetRects = await platform.getElementRects({
|
|
744
|
-
reference: {
|
|
745
|
-
getBoundingClientRect
|
|
746
|
-
},
|
|
747
|
-
floating: elements.floating,
|
|
748
|
-
strategy
|
|
749
|
-
});
|
|
750
|
-
|
|
751
|
-
if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
|
|
752
|
-
return {
|
|
753
|
-
reset: {
|
|
754
|
-
rects: resetRects
|
|
755
|
-
}
|
|
756
|
-
};
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
return {};
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
};
|
|
763
|
-
};
|
|
764
|
-
|
|
765
|
-
function isWindow(value) {
|
|
766
|
-
return value && value.document && value.location && value.alert && value.setInterval;
|
|
767
|
-
}
|
|
768
853
|
function getWindow(node) {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
if (!isWindow(node)) {
|
|
774
|
-
const ownerDocument = node.ownerDocument;
|
|
775
|
-
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
return node;
|
|
854
|
+
var _node$ownerDocument;
|
|
855
|
+
return ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
779
856
|
}
|
|
780
857
|
|
|
781
|
-
function getComputedStyle(element) {
|
|
858
|
+
function getComputedStyle$1(element) {
|
|
782
859
|
return getWindow(element).getComputedStyle(element);
|
|
783
860
|
}
|
|
784
861
|
|
|
785
862
|
function getNodeName(node) {
|
|
786
|
-
return
|
|
863
|
+
return isNode(node) ? (node.nodeName || '').toLowerCase() : '';
|
|
787
864
|
}
|
|
788
865
|
|
|
866
|
+
let uaString;
|
|
789
867
|
function getUAString() {
|
|
868
|
+
if (uaString) {
|
|
869
|
+
return uaString;
|
|
870
|
+
}
|
|
790
871
|
const uaData = navigator.userAgentData;
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
return
|
|
872
|
+
if (uaData && Array.isArray(uaData.brands)) {
|
|
873
|
+
uaString = uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
|
|
874
|
+
return uaString;
|
|
794
875
|
}
|
|
795
|
-
|
|
796
876
|
return navigator.userAgent;
|
|
797
877
|
}
|
|
798
878
|
|
|
@@ -810,19 +890,17 @@ function isShadowRoot(node) {
|
|
|
810
890
|
if (typeof ShadowRoot === 'undefined') {
|
|
811
891
|
return false;
|
|
812
892
|
}
|
|
813
|
-
|
|
814
893
|
const OwnElement = getWindow(node).ShadowRoot;
|
|
815
894
|
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
816
895
|
}
|
|
817
896
|
function isOverflowElement(element) {
|
|
818
|
-
// Firefox wants us to check `-x` and `-y` variations as well
|
|
819
897
|
const {
|
|
820
898
|
overflow,
|
|
821
899
|
overflowX,
|
|
822
900
|
overflowY,
|
|
823
901
|
display
|
|
824
|
-
} = getComputedStyle(element);
|
|
825
|
-
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
902
|
+
} = getComputedStyle$1(element);
|
|
903
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
826
904
|
}
|
|
827
905
|
function isTableElement(element) {
|
|
828
906
|
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
@@ -830,12 +908,14 @@ function isTableElement(element) {
|
|
|
830
908
|
function isContainingBlock(element) {
|
|
831
909
|
// TODO: Try and use feature detection here instead
|
|
832
910
|
const isFirefox = /firefox/i.test(getUAString());
|
|
833
|
-
const css = getComputedStyle(element);
|
|
834
|
-
const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter;
|
|
911
|
+
const css = getComputedStyle$1(element);
|
|
912
|
+
const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter;
|
|
913
|
+
|
|
914
|
+
// This is non-exhaustive but covers the most common CSS properties that
|
|
835
915
|
// create a containing block.
|
|
836
916
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
837
|
-
|
|
838
|
-
|
|
917
|
+
return css.transform !== 'none' || css.perspective !== 'none' || (backdropFilter ? backdropFilter !== 'none' : false) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective'].some(value => css.willChange.includes(value)) || ['paint', 'layout', 'strict', 'content'].some(
|
|
918
|
+
// TS 4.1 compat
|
|
839
919
|
value => {
|
|
840
920
|
const contain = css.contain;
|
|
841
921
|
return contain != null ? contain.includes(value) : false;
|
|
@@ -843,12 +923,14 @@ function isContainingBlock(element) {
|
|
|
843
923
|
}
|
|
844
924
|
function isLayoutViewport() {
|
|
845
925
|
// Not Safari
|
|
846
|
-
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
926
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
927
|
+
// Feature detection for this fails in various ways
|
|
847
928
|
// • Always-visible scrollbar or not
|
|
848
929
|
// • Width of <html>, etc.
|
|
849
930
|
// const vV = win.visualViewport;
|
|
850
931
|
// return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
|
|
851
932
|
}
|
|
933
|
+
|
|
852
934
|
function isLastTraversableNode(node) {
|
|
853
935
|
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
854
936
|
}
|
|
@@ -857,32 +939,105 @@ const min = Math.min;
|
|
|
857
939
|
const max = Math.max;
|
|
858
940
|
const round = Math.round;
|
|
859
941
|
|
|
860
|
-
function
|
|
861
|
-
|
|
942
|
+
function getCssDimensions(element) {
|
|
943
|
+
const css = getComputedStyle$1(element);
|
|
944
|
+
let width = parseFloat(css.width);
|
|
945
|
+
let height = parseFloat(css.height);
|
|
946
|
+
const offsetWidth = element.offsetWidth;
|
|
947
|
+
const offsetHeight = element.offsetHeight;
|
|
948
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
949
|
+
if (shouldFallback) {
|
|
950
|
+
width = offsetWidth;
|
|
951
|
+
height = offsetHeight;
|
|
952
|
+
}
|
|
953
|
+
return {
|
|
954
|
+
width,
|
|
955
|
+
height,
|
|
956
|
+
fallback: shouldFallback
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
function unwrapElement(element) {
|
|
961
|
+
return !isElement(element) ? element.contextElement : element;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
const FALLBACK_SCALE = {
|
|
965
|
+
x: 1,
|
|
966
|
+
y: 1
|
|
967
|
+
};
|
|
968
|
+
function getScale(element) {
|
|
969
|
+
const domElement = unwrapElement(element);
|
|
970
|
+
if (!isHTMLElement(domElement)) {
|
|
971
|
+
return FALLBACK_SCALE;
|
|
972
|
+
}
|
|
973
|
+
const rect = domElement.getBoundingClientRect();
|
|
974
|
+
const {
|
|
975
|
+
width,
|
|
976
|
+
height,
|
|
977
|
+
fallback
|
|
978
|
+
} = getCssDimensions(domElement);
|
|
979
|
+
let x = (fallback ? round(rect.width) : rect.width) / width;
|
|
980
|
+
let y = (fallback ? round(rect.height) : rect.height) / height;
|
|
981
|
+
|
|
982
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
862
983
|
|
|
984
|
+
if (!x || !Number.isFinite(x)) {
|
|
985
|
+
x = 1;
|
|
986
|
+
}
|
|
987
|
+
if (!y || !Number.isFinite(y)) {
|
|
988
|
+
y = 1;
|
|
989
|
+
}
|
|
990
|
+
return {
|
|
991
|
+
x,
|
|
992
|
+
y
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
997
|
+
var _win$visualViewport, _win$visualViewport2;
|
|
863
998
|
if (includeScale === void 0) {
|
|
864
999
|
includeScale = false;
|
|
865
1000
|
}
|
|
866
|
-
|
|
867
1001
|
if (isFixedStrategy === void 0) {
|
|
868
1002
|
isFixedStrategy = false;
|
|
869
1003
|
}
|
|
870
|
-
|
|
871
1004
|
const clientRect = element.getBoundingClientRect();
|
|
872
|
-
|
|
873
|
-
let
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
1005
|
+
const domElement = unwrapElement(element);
|
|
1006
|
+
let scale = FALLBACK_SCALE;
|
|
1007
|
+
if (includeScale) {
|
|
1008
|
+
if (offsetParent) {
|
|
1009
|
+
if (isElement(offsetParent)) {
|
|
1010
|
+
scale = getScale(offsetParent);
|
|
1011
|
+
}
|
|
1012
|
+
} else {
|
|
1013
|
+
scale = getScale(element);
|
|
1014
|
+
}
|
|
878
1015
|
}
|
|
879
|
-
|
|
880
|
-
const win = isElement(element) ? getWindow(element) : window;
|
|
1016
|
+
const win = domElement ? getWindow(domElement) : window;
|
|
881
1017
|
const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
1018
|
+
let x = (clientRect.left + (addVisualOffsets ? ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0 : 0)) / scale.x;
|
|
1019
|
+
let y = (clientRect.top + (addVisualOffsets ? ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 : 0)) / scale.y;
|
|
1020
|
+
let width = clientRect.width / scale.x;
|
|
1021
|
+
let height = clientRect.height / scale.y;
|
|
1022
|
+
if (domElement) {
|
|
1023
|
+
const win = getWindow(domElement);
|
|
1024
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1025
|
+
let currentIFrame = win.frameElement;
|
|
1026
|
+
while (currentIFrame && offsetParent && offsetWin !== win) {
|
|
1027
|
+
const iframeScale = getScale(currentIFrame);
|
|
1028
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1029
|
+
const css = getComputedStyle(currentIFrame);
|
|
1030
|
+
iframeRect.x += (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1031
|
+
iframeRect.y += (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1032
|
+
x *= iframeScale.x;
|
|
1033
|
+
y *= iframeScale.y;
|
|
1034
|
+
width *= iframeScale.x;
|
|
1035
|
+
height *= iframeScale.y;
|
|
1036
|
+
x += iframeRect.x;
|
|
1037
|
+
y += iframeRect.y;
|
|
1038
|
+
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
886
1041
|
return {
|
|
887
1042
|
width,
|
|
888
1043
|
height,
|
|
@@ -906,7 +1061,6 @@ function getNodeScroll(element) {
|
|
|
906
1061
|
scrollTop: element.scrollTop
|
|
907
1062
|
};
|
|
908
1063
|
}
|
|
909
|
-
|
|
910
1064
|
return {
|
|
911
1065
|
scrollLeft: element.pageXOffset,
|
|
912
1066
|
scrollTop: element.pageYOffset
|
|
@@ -919,16 +1073,10 @@ function getWindowScrollBarX(element) {
|
|
|
919
1073
|
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
920
1074
|
}
|
|
921
1075
|
|
|
922
|
-
function isScaled(element) {
|
|
923
|
-
const rect = getBoundingClientRect(element);
|
|
924
|
-
return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
1076
|
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
928
1077
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
929
1078
|
const documentElement = getDocumentElement(offsetParent);
|
|
930
|
-
const rect = getBoundingClientRect(element,
|
|
931
|
-
isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
|
|
1079
|
+
const rect = getBoundingClientRect(element, true, strategy === 'fixed', offsetParent);
|
|
932
1080
|
let scroll = {
|
|
933
1081
|
scrollLeft: 0,
|
|
934
1082
|
scrollTop: 0
|
|
@@ -937,12 +1085,10 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
937
1085
|
x: 0,
|
|
938
1086
|
y: 0
|
|
939
1087
|
};
|
|
940
|
-
|
|
941
1088
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
942
1089
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
943
1090
|
scroll = getNodeScroll(offsetParent);
|
|
944
1091
|
}
|
|
945
|
-
|
|
946
1092
|
if (isHTMLElement(offsetParent)) {
|
|
947
1093
|
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
948
1094
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
@@ -951,7 +1097,6 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
951
1097
|
offsets.x = getWindowScrollBarX(documentElement);
|
|
952
1098
|
}
|
|
953
1099
|
}
|
|
954
|
-
|
|
955
1100
|
return {
|
|
956
1101
|
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
957
1102
|
y: rect.top + scroll.scrollTop - offsets.y,
|
|
@@ -964,26 +1109,26 @@ function getParentNode(node) {
|
|
|
964
1109
|
if (getNodeName(node) === 'html') {
|
|
965
1110
|
return node;
|
|
966
1111
|
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
node.assignedSlot ||
|
|
970
|
-
|
|
971
|
-
|
|
1112
|
+
const result =
|
|
1113
|
+
// Step into the shadow DOM of the parent of a slotted node
|
|
1114
|
+
node.assignedSlot ||
|
|
1115
|
+
// DOM Element detected
|
|
1116
|
+
node.parentNode || (
|
|
1117
|
+
// ShadowRoot detected
|
|
1118
|
+
isShadowRoot(node) ? node.host : null) ||
|
|
1119
|
+
// Fallback
|
|
972
1120
|
getDocumentElement(node);
|
|
973
1121
|
return isShadowRoot(result) ? result.host : result;
|
|
974
1122
|
}
|
|
975
1123
|
|
|
976
1124
|
function getTrueOffsetParent(element) {
|
|
977
|
-
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
1125
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
978
1126
|
return null;
|
|
979
1127
|
}
|
|
980
|
-
|
|
981
1128
|
return element.offsetParent;
|
|
982
1129
|
}
|
|
983
|
-
|
|
984
1130
|
function getContainingBlock(element) {
|
|
985
1131
|
let currentNode = getParentNode(element);
|
|
986
|
-
|
|
987
1132
|
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
988
1133
|
if (isContainingBlock(currentNode)) {
|
|
989
1134
|
return currentNode;
|
|
@@ -991,40 +1136,25 @@ function getContainingBlock(element) {
|
|
|
991
1136
|
currentNode = getParentNode(currentNode);
|
|
992
1137
|
}
|
|
993
1138
|
}
|
|
994
|
-
|
|
995
1139
|
return null;
|
|
996
|
-
}
|
|
997
|
-
// such as table ancestors and cross browser bugs.
|
|
998
|
-
|
|
1140
|
+
}
|
|
999
1141
|
|
|
1142
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1143
|
+
// such as table ancestors and cross browser bugs.
|
|
1000
1144
|
function getOffsetParent(element) {
|
|
1001
1145
|
const window = getWindow(element);
|
|
1002
1146
|
let offsetParent = getTrueOffsetParent(element);
|
|
1003
|
-
|
|
1004
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
1147
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
|
1005
1148
|
offsetParent = getTrueOffsetParent(offsetParent);
|
|
1006
1149
|
}
|
|
1007
|
-
|
|
1008
|
-
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
1150
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
1009
1151
|
return window;
|
|
1010
1152
|
}
|
|
1011
|
-
|
|
1012
1153
|
return offsetParent || getContainingBlock(element) || window;
|
|
1013
1154
|
}
|
|
1014
1155
|
|
|
1015
1156
|
function getDimensions(element) {
|
|
1016
|
-
|
|
1017
|
-
return {
|
|
1018
|
-
width: element.offsetWidth,
|
|
1019
|
-
height: element.offsetHeight
|
|
1020
|
-
};
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
const rect = getBoundingClientRect(element);
|
|
1024
|
-
return {
|
|
1025
|
-
width: rect.width,
|
|
1026
|
-
height: rect.height
|
|
1027
|
-
};
|
|
1157
|
+
return getCssDimensions(element);
|
|
1028
1158
|
}
|
|
1029
1159
|
|
|
1030
1160
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
@@ -1035,39 +1165,42 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1035
1165
|
} = _ref;
|
|
1036
1166
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1037
1167
|
const documentElement = getDocumentElement(offsetParent);
|
|
1038
|
-
|
|
1039
1168
|
if (offsetParent === documentElement) {
|
|
1040
1169
|
return rect;
|
|
1041
1170
|
}
|
|
1042
|
-
|
|
1043
1171
|
let scroll = {
|
|
1044
1172
|
scrollLeft: 0,
|
|
1045
1173
|
scrollTop: 0
|
|
1046
1174
|
};
|
|
1175
|
+
let scale = {
|
|
1176
|
+
x: 1,
|
|
1177
|
+
y: 1
|
|
1178
|
+
};
|
|
1047
1179
|
const offsets = {
|
|
1048
1180
|
x: 0,
|
|
1049
1181
|
y: 0
|
|
1050
1182
|
};
|
|
1051
|
-
|
|
1052
1183
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
1053
1184
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1054
1185
|
scroll = getNodeScroll(offsetParent);
|
|
1055
1186
|
}
|
|
1056
|
-
|
|
1057
1187
|
if (isHTMLElement(offsetParent)) {
|
|
1058
|
-
const offsetRect = getBoundingClientRect(offsetParent
|
|
1188
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
1189
|
+
scale = getScale(offsetParent);
|
|
1059
1190
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1060
1191
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1061
|
-
}
|
|
1192
|
+
}
|
|
1193
|
+
// This doesn't appear to need to be negated.
|
|
1062
1194
|
// else if (documentElement) {
|
|
1063
1195
|
// offsets.x = getWindowScrollBarX(documentElement);
|
|
1064
1196
|
// }
|
|
1065
|
-
|
|
1066
1197
|
}
|
|
1067
1198
|
|
|
1068
|
-
return {
|
|
1069
|
-
|
|
1070
|
-
|
|
1199
|
+
return {
|
|
1200
|
+
width: rect.width * scale.x,
|
|
1201
|
+
height: rect.height * scale.y,
|
|
1202
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
1203
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
1071
1204
|
};
|
|
1072
1205
|
}
|
|
1073
1206
|
|
|
@@ -1079,18 +1212,15 @@ function getViewportRect(element, strategy) {
|
|
|
1079
1212
|
let height = html.clientHeight;
|
|
1080
1213
|
let x = 0;
|
|
1081
1214
|
let y = 0;
|
|
1082
|
-
|
|
1083
1215
|
if (visualViewport) {
|
|
1084
1216
|
width = visualViewport.width;
|
|
1085
1217
|
height = visualViewport.height;
|
|
1086
1218
|
const layoutViewport = isLayoutViewport();
|
|
1087
|
-
|
|
1088
1219
|
if (layoutViewport || !layoutViewport && strategy === 'fixed') {
|
|
1089
1220
|
x = visualViewport.offsetLeft;
|
|
1090
1221
|
y = visualViewport.offsetTop;
|
|
1091
1222
|
}
|
|
1092
1223
|
}
|
|
1093
|
-
|
|
1094
1224
|
return {
|
|
1095
1225
|
width,
|
|
1096
1226
|
height,
|
|
@@ -1099,11 +1229,10 @@ function getViewportRect(element, strategy) {
|
|
|
1099
1229
|
};
|
|
1100
1230
|
}
|
|
1101
1231
|
|
|
1232
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
1102
1233
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
|
1103
|
-
|
|
1104
1234
|
function getDocumentRect(element) {
|
|
1105
1235
|
var _element$ownerDocumen;
|
|
1106
|
-
|
|
1107
1236
|
const html = getDocumentElement(element);
|
|
1108
1237
|
const scroll = getNodeScroll(element);
|
|
1109
1238
|
const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
@@ -1111,11 +1240,9 @@ function getDocumentRect(element) {
|
|
|
1111
1240
|
const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
1112
1241
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1113
1242
|
const y = -scroll.scrollTop;
|
|
1114
|
-
|
|
1115
|
-
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
1243
|
+
if (getComputedStyle$1(body || html).direction === 'rtl') {
|
|
1116
1244
|
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
1117
1245
|
}
|
|
1118
|
-
|
|
1119
1246
|
return {
|
|
1120
1247
|
width,
|
|
1121
1248
|
height,
|
|
@@ -1126,90 +1253,97 @@ function getDocumentRect(element) {
|
|
|
1126
1253
|
|
|
1127
1254
|
function getNearestOverflowAncestor(node) {
|
|
1128
1255
|
const parentNode = getParentNode(node);
|
|
1129
|
-
|
|
1130
1256
|
if (isLastTraversableNode(parentNode)) {
|
|
1131
1257
|
// @ts-ignore assume body is always available
|
|
1132
1258
|
return node.ownerDocument.body;
|
|
1133
1259
|
}
|
|
1134
|
-
|
|
1135
1260
|
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
1136
1261
|
return parentNode;
|
|
1137
1262
|
}
|
|
1138
|
-
|
|
1139
1263
|
return getNearestOverflowAncestor(parentNode);
|
|
1140
1264
|
}
|
|
1141
1265
|
|
|
1142
1266
|
function getOverflowAncestors(node, list) {
|
|
1143
1267
|
var _node$ownerDocument;
|
|
1144
|
-
|
|
1145
1268
|
if (list === void 0) {
|
|
1146
1269
|
list = [];
|
|
1147
1270
|
}
|
|
1148
|
-
|
|
1149
1271
|
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1150
1272
|
const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
|
|
1151
1273
|
const win = getWindow(scrollableAncestor);
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1274
|
+
if (isBody) {
|
|
1275
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
|
|
1276
|
+
}
|
|
1277
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
|
|
1156
1278
|
}
|
|
1157
1279
|
|
|
1280
|
+
// Returns the inner client rect, subtracting scrollbars if present
|
|
1158
1281
|
function getInnerBoundingClientRect(element, strategy) {
|
|
1159
|
-
const clientRect = getBoundingClientRect(element,
|
|
1282
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
1160
1283
|
const top = clientRect.top + element.clientTop;
|
|
1161
1284
|
const left = clientRect.left + element.clientLeft;
|
|
1285
|
+
const scale = isHTMLElement(element) ? getScale(element) : {
|
|
1286
|
+
x: 1,
|
|
1287
|
+
y: 1
|
|
1288
|
+
};
|
|
1289
|
+
const width = element.clientWidth * scale.x;
|
|
1290
|
+
const height = element.clientHeight * scale.y;
|
|
1291
|
+
const x = left * scale.x;
|
|
1292
|
+
const y = top * scale.y;
|
|
1162
1293
|
return {
|
|
1163
|
-
top,
|
|
1164
|
-
left,
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
width
|
|
1170
|
-
height
|
|
1294
|
+
top: y,
|
|
1295
|
+
left: x,
|
|
1296
|
+
right: x + width,
|
|
1297
|
+
bottom: y + height,
|
|
1298
|
+
x,
|
|
1299
|
+
y,
|
|
1300
|
+
width,
|
|
1301
|
+
height
|
|
1171
1302
|
};
|
|
1172
1303
|
}
|
|
1173
|
-
|
|
1174
1304
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1175
1305
|
if (clippingAncestor === 'viewport') {
|
|
1176
1306
|
return rectToClientRect(getViewportRect(element, strategy));
|
|
1177
1307
|
}
|
|
1178
|
-
|
|
1179
1308
|
if (isElement(clippingAncestor)) {
|
|
1180
1309
|
return getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1181
1310
|
}
|
|
1182
|
-
|
|
1183
1311
|
return rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
1184
|
-
}
|
|
1185
|
-
// clipping (or hiding) overflowing elements with a position different from
|
|
1186
|
-
// `initial`
|
|
1187
|
-
|
|
1312
|
+
}
|
|
1188
1313
|
|
|
1189
|
-
|
|
1314
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
1315
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
1316
|
+
// of the given element up the tree.
|
|
1317
|
+
function getClippingElementAncestors(element, cache) {
|
|
1318
|
+
const cachedResult = cache.get(element);
|
|
1319
|
+
if (cachedResult) {
|
|
1320
|
+
return cachedResult;
|
|
1321
|
+
}
|
|
1190
1322
|
let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1191
|
-
let
|
|
1192
|
-
|
|
1323
|
+
let currentContainingBlockComputedStyle = null;
|
|
1324
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
1325
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1193
1326
|
|
|
1327
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1194
1328
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1195
|
-
const computedStyle = getComputedStyle(currentNode);
|
|
1196
|
-
|
|
1197
|
-
|
|
1329
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
1330
|
+
const containingBlock = isContainingBlock(currentNode);
|
|
1331
|
+
const shouldDropCurrentNode = elementIsFixed ? !containingBlock && !currentContainingBlockComputedStyle : !containingBlock && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position);
|
|
1332
|
+
if (shouldDropCurrentNode) {
|
|
1198
1333
|
// Drop non-containing blocks
|
|
1199
1334
|
result = result.filter(ancestor => ancestor !== currentNode);
|
|
1200
1335
|
} else {
|
|
1201
1336
|
// Record last containing block for next iteration
|
|
1202
1337
|
currentContainingBlockComputedStyle = computedStyle;
|
|
1203
1338
|
}
|
|
1204
|
-
|
|
1205
1339
|
currentNode = getParentNode(currentNode);
|
|
1206
1340
|
}
|
|
1207
|
-
|
|
1341
|
+
cache.set(element, result);
|
|
1208
1342
|
return result;
|
|
1209
|
-
}
|
|
1210
|
-
// clipping ancestors
|
|
1211
|
-
|
|
1343
|
+
}
|
|
1212
1344
|
|
|
1345
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
1346
|
+
// clipping ancestors
|
|
1213
1347
|
function getClippingRect(_ref) {
|
|
1214
1348
|
let {
|
|
1215
1349
|
element,
|
|
@@ -1217,7 +1351,7 @@ function getClippingRect(_ref) {
|
|
|
1217
1351
|
rootBoundary,
|
|
1218
1352
|
strategy
|
|
1219
1353
|
} = _ref;
|
|
1220
|
-
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element) : [].concat(boundary);
|
|
1354
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1221
1355
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1222
1356
|
const firstClippingAncestor = clippingAncestors[0];
|
|
1223
1357
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
@@ -1243,22 +1377,26 @@ const platform = {
|
|
|
1243
1377
|
getDimensions,
|
|
1244
1378
|
getOffsetParent,
|
|
1245
1379
|
getDocumentElement,
|
|
1246
|
-
|
|
1380
|
+
getScale,
|
|
1381
|
+
async getElementRects(_ref) {
|
|
1247
1382
|
let {
|
|
1248
1383
|
reference,
|
|
1249
1384
|
floating,
|
|
1250
1385
|
strategy
|
|
1251
1386
|
} = _ref;
|
|
1387
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1388
|
+
const getDimensionsFn = this.getDimensions;
|
|
1252
1389
|
return {
|
|
1253
|
-
reference: getRectRelativeToOffsetParent(reference,
|
|
1254
|
-
floating: {
|
|
1390
|
+
reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
|
|
1391
|
+
floating: {
|
|
1255
1392
|
x: 0,
|
|
1256
|
-
y: 0
|
|
1393
|
+
y: 0,
|
|
1394
|
+
...(await getDimensionsFn(floating))
|
|
1257
1395
|
}
|
|
1258
1396
|
};
|
|
1259
1397
|
},
|
|
1260
1398
|
getClientRects: element => Array.from(element.getClientRects()),
|
|
1261
|
-
isRTL: element => getComputedStyle(element).direction === 'rtl'
|
|
1399
|
+
isRTL: element => getComputedStyle$1(element).direction === 'rtl'
|
|
1262
1400
|
};
|
|
1263
1401
|
|
|
1264
1402
|
/**
|
|
@@ -1269,7 +1407,6 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1269
1407
|
if (options === void 0) {
|
|
1270
1408
|
options = {};
|
|
1271
1409
|
}
|
|
1272
|
-
|
|
1273
1410
|
const {
|
|
1274
1411
|
ancestorScroll: _ancestorScroll = true,
|
|
1275
1412
|
ancestorResize = true,
|
|
@@ -1285,54 +1422,42 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1285
1422
|
ancestorResize && ancestor.addEventListener('resize', update);
|
|
1286
1423
|
});
|
|
1287
1424
|
let observer = null;
|
|
1288
|
-
|
|
1289
1425
|
if (elementResize) {
|
|
1290
1426
|
let initialUpdate = true;
|
|
1291
1427
|
observer = new ResizeObserver(() => {
|
|
1292
1428
|
if (!initialUpdate) {
|
|
1293
1429
|
update();
|
|
1294
1430
|
}
|
|
1295
|
-
|
|
1296
1431
|
initialUpdate = false;
|
|
1297
1432
|
});
|
|
1298
1433
|
isElement(reference) && !animationFrame && observer.observe(reference);
|
|
1299
|
-
|
|
1300
1434
|
if (!isElement(reference) && reference.contextElement && !animationFrame) {
|
|
1301
1435
|
observer.observe(reference.contextElement);
|
|
1302
1436
|
}
|
|
1303
|
-
|
|
1304
1437
|
observer.observe(floating);
|
|
1305
1438
|
}
|
|
1306
|
-
|
|
1307
1439
|
let frameId;
|
|
1308
1440
|
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
1309
|
-
|
|
1310
1441
|
if (animationFrame) {
|
|
1311
1442
|
frameLoop();
|
|
1312
1443
|
}
|
|
1313
|
-
|
|
1314
1444
|
function frameLoop() {
|
|
1315
1445
|
const nextRefRect = getBoundingClientRect(reference);
|
|
1316
|
-
|
|
1317
1446
|
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
1318
1447
|
update();
|
|
1319
1448
|
}
|
|
1320
|
-
|
|
1321
1449
|
prevRefRect = nextRefRect;
|
|
1322
1450
|
frameId = requestAnimationFrame(frameLoop);
|
|
1323
1451
|
}
|
|
1324
|
-
|
|
1325
1452
|
update();
|
|
1326
1453
|
return () => {
|
|
1327
1454
|
var _observer;
|
|
1328
|
-
|
|
1329
1455
|
ancestors.forEach(ancestor => {
|
|
1330
1456
|
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
1331
1457
|
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
1332
1458
|
});
|
|
1333
1459
|
(_observer = observer) == null ? void 0 : _observer.disconnect();
|
|
1334
1460
|
observer = null;
|
|
1335
|
-
|
|
1336
1461
|
if (animationFrame) {
|
|
1337
1462
|
cancelAnimationFrame(frameId);
|
|
1338
1463
|
}
|
|
@@ -1344,20 +1469,23 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1344
1469
|
* next to a reference element when it is given a certain CSS positioning
|
|
1345
1470
|
* strategy.
|
|
1346
1471
|
*/
|
|
1472
|
+
const computePosition = (reference, floating, options) => {
|
|
1473
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
1474
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
1475
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
1476
|
+
const cache = new Map();
|
|
1477
|
+
const mergedOptions = {
|
|
1478
|
+
platform,
|
|
1479
|
+
...options
|
|
1480
|
+
};
|
|
1481
|
+
const platformWithCache = {
|
|
1482
|
+
...mergedOptions.platform,
|
|
1483
|
+
_c: cache
|
|
1484
|
+
};
|
|
1485
|
+
return computePosition$1(reference, floating, {
|
|
1486
|
+
...mergedOptions,
|
|
1487
|
+
platform: platformWithCache
|
|
1488
|
+
});
|
|
1489
|
+
};
|
|
1347
1490
|
|
|
1348
|
-
|
|
1349
|
-
platform,
|
|
1350
|
-
...options
|
|
1351
|
-
});
|
|
1352
|
-
|
|
1353
|
-
function getAlignment(placement) {
|
|
1354
|
-
if (placement.includes('-end')) {
|
|
1355
|
-
return 'end';
|
|
1356
|
-
}
|
|
1357
|
-
else if (placement.includes('-start')) {
|
|
1358
|
-
return 'start';
|
|
1359
|
-
}
|
|
1360
|
-
return undefined;
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
export { autoPlacement as a, autoUpdate as b, computePosition as c, arrow as d, getAlignment as g, inline as i, offset as o, shift as s };
|
|
1491
|
+
export { autoUpdate as a, arrow as b, computePosition as c, autoPlacement as d, flip as f, inline as i, offset as o, shift as s };
|