@siemens/ix 1.3.0 → 1.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/alignment-51e20690.js +13 -0
- 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-9a5d67b2.js} +393 -402
- package/dist/cjs/{index-17eb8998.js → index-f4b8e6ee.js} +74 -1
- package/dist/cjs/index.cjs.js +13 -13
- package/dist/cjs/ix-animated-tab_2.cjs.entry.js +3 -3
- package/dist/cjs/ix-application-header.cjs.entry.js +26 -3
- package/dist/cjs/ix-basic-navigation.cjs.entry.js +17 -3
- package/dist/cjs/ix-blind.cjs.entry.js +2 -2
- package/dist/cjs/ix-breadcrumb_2.cjs.entry.js +2 -2
- package/dist/cjs/ix-burger-menu.cjs.entry.js +22 -0
- package/dist/cjs/ix-button.cjs.entry.js +4 -4
- package/dist/cjs/ix-category-filter.cjs.entry.js +86 -117
- package/dist/cjs/ix-chip.cjs.entry.js +1 -1
- package/dist/cjs/ix-counter-pill.cjs.entry.js +1 -1
- package/dist/cjs/ix-date-picker_2.cjs.entry.js +4 -4
- package/dist/cjs/ix-date-time-card.cjs.entry.js +1 -1
- package/dist/cjs/ix-datetime-picker.cjs.entry.js +1 -1
- package/dist/cjs/ix-divider.cjs.entry.js +19 -0
- package/dist/cjs/ix-drawer.cjs.entry.js +1 -1
- package/dist/cjs/ix-dropdown-button.cjs.entry.js +6 -4
- package/dist/cjs/ix-dropdown-quick-actions.cjs.entry.js +19 -0
- package/dist/cjs/ix-dropdown_2.cjs.entry.js +78 -17
- package/dist/cjs/ix-event-list_2.cjs.entry.js +4 -4
- package/dist/cjs/ix-expanding-search.cjs.entry.js +1 -1
- package/dist/cjs/ix-filter-chip.cjs.entry.js +1 -1
- package/dist/cjs/ix-flip-tile_2.cjs.entry.js +2 -2
- package/dist/cjs/ix-group-context-menu.cjs.entry.js +1 -4
- package/dist/cjs/ix-group_3.cjs.entry.js +1 -1
- package/dist/cjs/ix-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/ix-icon.cjs.entry.js +1 -1
- package/dist/cjs/ix-input-group.cjs.entry.js +1 -1
- package/dist/cjs/ix-kpi.cjs.entry.js +1 -1
- package/dist/cjs/ix-map-navigation_2.cjs.entry.js +2 -2
- package/dist/cjs/ix-menu_9.cjs.entry.js +50 -19
- package/dist/cjs/ix-message-bar.cjs.entry.js +1 -1
- package/dist/cjs/ix-modal-example.cjs.entry.js +2 -2
- package/dist/cjs/ix-modal_2.cjs.entry.js +4 -4
- package/dist/cjs/ix-pill.cjs.entry.js +1 -1
- package/dist/cjs/ix-select_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-spinner.cjs.entry.js +1 -1
- package/dist/cjs/ix-split-button_2.cjs.entry.js +7 -5
- package/dist/cjs/ix-tab-item.cjs.entry.js +2 -2
- package/dist/cjs/ix-tabs.cjs.entry.js +12 -5
- package/dist/cjs/ix-tile.cjs.entry.js +1 -1
- package/dist/cjs/ix-toast_2.cjs.entry.js +10 -6
- package/dist/cjs/ix-toggle.cjs.entry.js +2 -2
- package/dist/cjs/ix-tooltip.cjs.entry.js +127 -0
- package/dist/cjs/ix-tree_2.cjs.entry.js +3 -4
- package/dist/cjs/ix-typography.cjs.entry.js +38 -0
- package/dist/cjs/ix-upload.cjs.entry.js +2 -2
- package/dist/cjs/ix-validation-tooltip.cjs.entry.js +10 -9
- package/dist/cjs/ix-workflow-step_2.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{logical-filter-operator-467e2faf.js → logical-filter-operator-0faf70b8.js} +2 -2
- package/dist/cjs/{modal-dda2f6be.js → modal-a93045dd.js} +4 -4
- 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 +2 -2
- 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 +2 -2
- 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 +11 -2
- 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 -6
- 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/{utils → button}/button-variants.js +0 -0
- 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 +37 -50
- package/dist/collection/components/category-filter/category-filter.js +86 -132
- 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 +4 -4
- 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 +6 -6
- package/dist/collection/components/dropdown/dropdown.js +96 -10
- 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 +13 -4
- package/dist/collection/components/dropdown-item/dropdown-item.js +1 -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 +8 -4
- 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 +5 -5
- 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 +6 -5
- 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 +85 -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 +13 -17
- package/dist/collection/components/menu-about-news/menu-about-news.js +2 -2
- 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 +3 -3
- 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 +1 -1
- 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 +20 -2
- package/dist/collection/components/split-button/split-button.js +6 -4
- 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/{scss/theme/_define-theme-variable.scss → dist/collection/components/utils/screen/index.js} +2 -5
- 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/alignment.js +1 -1353
- 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/date-picker.js +3 -3
- package/dist/components/dropdown-item.js +1 -1
- package/dist/components/dropdown.js +71 -9
- package/dist/components/floating-ui.dom.esm.js +1355 -0
- 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-blind.js +1 -1
- 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 +96 -125
- 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-map-navigation.js +9 -3
- package/dist/components/ix-menu-about-news.js +2 -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-split-button.js +5 -3
- 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 +2 -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/alignment-6490c552.js +11 -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-e13c649f.js} +394 -402
- package/dist/esm/{index-6f4f3582.js → index-6b660a23.js} +74 -1
- package/dist/esm/index.js +13 -13
- package/dist/esm/ix-animated-tab_2.entry.js +3 -3
- package/dist/esm/ix-application-header.entry.js +26 -3
- package/dist/esm/ix-basic-navigation.entry.js +17 -3
- package/dist/esm/ix-blind.entry.js +2 -2
- package/dist/esm/ix-breadcrumb_2.entry.js +2 -2
- package/dist/esm/ix-burger-menu.entry.js +18 -0
- package/dist/esm/ix-button.entry.js +4 -4
- package/dist/esm/ix-category-filter.entry.js +86 -117
- package/dist/esm/ix-chip.entry.js +1 -1
- package/dist/esm/ix-counter-pill.entry.js +1 -1
- package/dist/esm/ix-date-picker_2.entry.js +4 -4
- package/dist/esm/ix-date-time-card.entry.js +1 -1
- package/dist/esm/ix-datetime-picker.entry.js +1 -1
- package/dist/esm/ix-divider.entry.js +15 -0
- package/dist/esm/ix-drawer.entry.js +1 -1
- package/dist/esm/ix-dropdown-button.entry.js +6 -4
- package/dist/esm/ix-dropdown-quick-actions.entry.js +15 -0
- package/dist/esm/ix-dropdown_2.entry.js +72 -11
- package/dist/esm/ix-event-list_2.entry.js +4 -4
- package/dist/esm/ix-expanding-search.entry.js +1 -1
- package/dist/esm/ix-filter-chip.entry.js +1 -1
- package/dist/esm/ix-flip-tile_2.entry.js +2 -2
- package/dist/esm/ix-group-context-menu.entry.js +1 -4
- package/dist/esm/ix-group_3.entry.js +1 -1
- package/dist/esm/ix-icon-button.entry.js +2 -2
- package/dist/esm/ix-icon.entry.js +1 -1
- package/dist/esm/ix-input-group.entry.js +1 -1
- package/dist/esm/ix-kpi.entry.js +1 -1
- package/dist/esm/ix-map-navigation_2.entry.js +2 -2
- package/dist/esm/ix-menu_9.entry.js +50 -19
- package/dist/esm/ix-message-bar.entry.js +1 -1
- package/dist/esm/ix-modal-example.entry.js +2 -2
- package/dist/esm/ix-modal_2.entry.js +4 -4
- package/dist/esm/ix-pill.entry.js +1 -1
- package/dist/esm/ix-select_2.entry.js +1 -1
- package/dist/esm/ix-spinner.entry.js +1 -1
- package/dist/esm/ix-split-button_2.entry.js +7 -5
- package/dist/esm/ix-tab-item.entry.js +2 -2
- package/dist/esm/ix-tabs.entry.js +12 -5
- package/dist/esm/ix-tile.entry.js +1 -1
- package/dist/esm/ix-toast_2.entry.js +10 -6
- package/dist/esm/ix-toggle.entry.js +2 -2
- package/dist/esm/ix-tooltip.entry.js +123 -0
- package/dist/esm/ix-tree_2.entry.js +3 -4
- package/dist/esm/ix-typography.entry.js +34 -0
- package/dist/esm/ix-upload.entry.js +2 -2
- package/dist/esm/ix-validation-tooltip.entry.js +3 -2
- package/dist/esm/ix-workflow-step_2.entry.js +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{logical-filter-operator-1bf83315.js → logical-filter-operator-15696001.js} +2 -2
- package/dist/esm/{modal-df0a62f2.js → modal-64e18970.js} +4 -4
- 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 +2 -2
- 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 +2 -2
- 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-da2cae32.js → p-076c29d1.js} +0 -0
- package/dist/siemens-ix/{p-4b170382.entry.js → p-082bbe13.entry.js} +1 -1
- package/dist/siemens-ix/{p-418e2d14.entry.js → p-098e22c3.entry.js} +1 -1
- package/dist/siemens-ix/{p-43616759.entry.js → p-0bc4408b.entry.js} +1 -1
- package/dist/siemens-ix/p-0bd6554e.entry.js +1 -0
- package/dist/siemens-ix/{p-218de283.entry.js → p-0bf4a256.entry.js} +1 -1
- package/dist/siemens-ix/{p-7f842cdc.entry.js → p-0d619f3e.entry.js} +1 -1
- package/dist/siemens-ix/{p-3663f989.entry.js → p-122cf38d.entry.js} +1 -1
- package/dist/siemens-ix/p-1572aab3.js +1 -0
- package/dist/siemens-ix/{p-1d30454e.js → p-15bebd8a.js} +0 -0
- package/dist/siemens-ix/{p-8a7141a6.entry.js → p-165c6a82.entry.js} +1 -1
- package/dist/siemens-ix/{p-e7621b0a.entry.js → p-1d48ce36.entry.js} +1 -1
- package/dist/siemens-ix/{p-cc0f6f6b.entry.js → p-20c88582.entry.js} +1 -1
- 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-d0bb8225.entry.js → p-2e55e255.entry.js} +1 -1
- package/dist/siemens-ix/{p-e2925222.entry.js → p-3624a41c.entry.js} +1 -1
- package/dist/siemens-ix/{p-bdd294d2.js → p-3b97bb69.js} +0 -0
- package/dist/siemens-ix/{p-ea333007.entry.js → p-3cc4df65.entry.js} +1 -1
- package/dist/siemens-ix/{p-4fcb5f2b.entry.js → p-404e81d2.entry.js} +1 -1
- package/dist/siemens-ix/p-4251a6dd.entry.js +1 -0
- package/dist/siemens-ix/p-4b2265fd.entry.js +1 -0
- package/dist/siemens-ix/p-529d7530.js +1 -0
- package/dist/siemens-ix/{p-eb150313.entry.js → p-560cfce8.entry.js} +1 -1
- package/dist/siemens-ix/{p-1c82637e.js → p-56ed024b.js} +0 -0
- package/dist/siemens-ix/{p-18d02e6f.entry.js → p-5890faf9.entry.js} +1 -1
- package/dist/siemens-ix/{p-b12006c6.js → p-5b39e04e.js} +0 -0
- package/dist/siemens-ix/p-5b47360e.entry.js +1 -0
- package/dist/siemens-ix/{p-a88618e3.entry.js → p-5ca7b937.entry.js} +1 -1
- package/dist/siemens-ix/p-5feec7a4.entry.js +1 -0
- package/dist/siemens-ix/p-63776469.entry.js +1 -0
- package/dist/siemens-ix/p-66074788.js +2 -0
- package/dist/siemens-ix/{p-a5fa7ae5.entry.js → p-6637ae65.entry.js} +1 -1
- package/dist/siemens-ix/{p-33283dbf.entry.js → p-67cf5cd4.entry.js} +1 -1
- package/dist/siemens-ix/{p-c3e90c06.entry.js → p-6be65050.entry.js} +1 -1
- package/dist/siemens-ix/p-6e5543fe.entry.js +1 -0
- package/dist/siemens-ix/p-70be8cb8.entry.js +1 -0
- package/dist/siemens-ix/p-71c91a11.entry.js +1 -0
- package/dist/siemens-ix/{p-b3d00feb.entry.js → p-72cc8632.entry.js} +1 -1
- package/dist/siemens-ix/{p-dec6114f.js → p-75abd144.js} +1 -1
- package/dist/siemens-ix/p-9269d0e8.entry.js +1 -0
- package/dist/siemens-ix/p-94b440bc.entry.js +1 -0
- package/dist/siemens-ix/{p-592f1ed3.entry.js → p-9c8c835c.entry.js} +1 -1
- package/dist/siemens-ix/{p-8b4e4718.entry.js → p-9eb8347c.entry.js} +1 -1
- package/dist/siemens-ix/{p-4944ad0b.js → p-9ee41861.js} +0 -0
- 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-6fe3bb9c.entry.js → p-ae35c07f.entry.js} +1 -1
- package/dist/siemens-ix/{p-f6e713f3.js → p-affb60fb.js} +1 -1
- package/dist/siemens-ix/{p-96e46f99.js → p-b14308ed.js} +0 -0
- package/dist/siemens-ix/p-b5599b0b.entry.js +1 -0
- package/dist/siemens-ix/{p-eed28e55.entry.js → p-b85458fb.entry.js} +1 -1
- package/dist/siemens-ix/{p-fbe40498.js → p-c0454c9a.js} +0 -0
- package/dist/siemens-ix/p-c2b50878.entry.js +1 -0
- package/dist/siemens-ix/{p-9b5290d4.entry.js → p-c4568016.entry.js} +1 -1
- package/dist/siemens-ix/p-cb4269bf.js +1 -0
- package/dist/siemens-ix/{p-f7be9635.entry.js → p-d1a16c62.entry.js} +1 -1
- package/dist/siemens-ix/p-d7618223.entry.js +1 -0
- package/dist/siemens-ix/p-e48e659d.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-72f851ae.entry.js → p-f3cde62f.entry.js} +1 -1
- package/dist/siemens-ix/p-f7b5b66f.js +1 -0
- package/dist/siemens-ix/{p-150d7a02.entry.js → p-fa262af7.entry.js} +1 -1
- package/dist/siemens-ix/p-feefa8c7.entry.js +1 -0
- package/dist/siemens-ix/siemens-ix.css +2080 -1824
- 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/{utils → button}/button-variants.d.ts +0 -0
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/category-filter/category-filter.d.ts +10 -15
- 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 +11 -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 +144 -7
- 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 +2 -2
- package/scss/components/_checkboxes.scss +7 -7
- package/scss/components/_dropdown.scss +1 -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 +3 -3
- package/scss/components/_shadows.scss +13 -25
- package/scss/components/_table.scss +1 -1
- package/scss/ix.scss +2 -3
- 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/_border.scss +35 -0
- package/scss/theme/classic-dark/_borderRadius.scss +24 -0
- package/scss/theme/classic-dark/_borderWidth.scss +18 -0
- package/scss/theme/classic-dark/_boxShadow.scss +19 -0
- package/scss/theme/classic-dark/_color.scss +860 -0
- package/scss/theme/classic-dark/_fontFamilies.scss +8 -0
- package/scss/theme/classic-dark/_fontSizes.scss +13 -0
- package/scss/theme/classic-dark/_fontWeights.scss +9 -0
- package/scss/theme/classic-dark/_index.scss +16 -0
- package/scss/theme/classic-dark/_lineHeights.scss +18 -0
- package/scss/theme/classic-dark/_other.scss +16 -0
- package/scss/theme/classic-dark/_sizing.scss +16 -0
- package/scss/theme/classic-dark/_spacing.scss +9 -0
- package/scss/theme/classic-dark/_typography.scss +23 -0
- package/scss/theme/classic-light/_border.scss +35 -0
- package/scss/theme/classic-light/_borderRadius.scss +24 -0
- package/scss/theme/classic-light/_borderWidth.scss +18 -0
- package/scss/theme/classic-light/_boxShadow.scss +19 -0
- package/scss/theme/classic-light/_color.scss +860 -0
- package/scss/theme/classic-light/_fontFamilies.scss +8 -0
- package/scss/theme/classic-light/_fontSizes.scss +13 -0
- package/scss/theme/classic-light/_fontWeights.scss +9 -0
- package/scss/theme/classic-light/_index.scss +16 -0
- package/scss/theme/classic-light/_lineHeights.scss +18 -0
- package/scss/theme/classic-light/_other.scss +16 -0
- package/scss/theme/classic-light/_sizing.scss +16 -0
- package/scss/theme/classic-light/_spacing.scss +9 -0
- package/scss/theme/classic-light/_typography.scss +23 -0
- package/dist/siemens-ix/p-03d38416.entry.js +0 -1
- package/dist/siemens-ix/p-05c16b94.js +0 -2
- package/dist/siemens-ix/p-0e357d27.entry.js +0 -1
- package/dist/siemens-ix/p-23d79e3d.entry.js +0 -1
- package/dist/siemens-ix/p-2bc72119.entry.js +0 -1
- package/dist/siemens-ix/p-2bd88760.entry.js +0 -1
- package/dist/siemens-ix/p-2c5abec1.js +0 -1
- package/dist/siemens-ix/p-2e24ae23.entry.js +0 -1
- package/dist/siemens-ix/p-5631ae88.entry.js +0 -1
- package/dist/siemens-ix/p-5bbe9943.entry.js +0 -1
- package/dist/siemens-ix/p-65e61684.entry.js +0 -1
- package/dist/siemens-ix/p-67eb9d59.entry.js +0 -1
- package/dist/siemens-ix/p-a6f4cfc6.entry.js +0 -1
- package/dist/siemens-ix/p-ab7949ff.entry.js +0 -1
- package/dist/siemens-ix/p-b242bd39.entry.js +0 -1
- package/dist/siemens-ix/p-c993560f.entry.js +0 -1
- package/dist/siemens-ix/p-d20119c1.entry.js +0 -1
- package/dist/siemens-ix/p-fecf0ade.entry.js +0 -1
- package/scss/theme/_define-theme-colors.scss +0 -22
- package/scss/theme/_define-theme.scss +0 -36
- package/scss/theme/_static-colors.scss +0 -19
- package/scss/theme/classic-dark/_sizes.scss +0 -66
- package/scss/theme/classic-dark/_variables.scss +0 -827
- package/scss/theme/classic-dark/index.scss +0 -15
- package/scss/theme/classic-light/_sizes.scss +0 -66
- package/scss/theme/classic-light/_variables.scss +0 -829
- package/scss/theme/classic-light/index.scss +0 -15
|
@@ -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,115 @@ const autoPlacement = function (options) {
|
|
|
482
457
|
}
|
|
483
458
|
};
|
|
484
459
|
}
|
|
485
|
-
|
|
486
460
|
return {};
|
|
487
461
|
}
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Provides improved positioning for inline reference elements that can span
|
|
467
|
+
* over multiple lines, such as hyperlinks or range selections.
|
|
468
|
+
* @see https://floating-ui.com/docs/inline
|
|
469
|
+
*/
|
|
470
|
+
const inline = function (options) {
|
|
471
|
+
if (options === void 0) {
|
|
472
|
+
options = {};
|
|
473
|
+
}
|
|
474
|
+
return {
|
|
475
|
+
name: 'inline',
|
|
476
|
+
options,
|
|
477
|
+
async fn(middlewareArguments) {
|
|
478
|
+
const {
|
|
479
|
+
placement,
|
|
480
|
+
elements,
|
|
481
|
+
rects,
|
|
482
|
+
platform,
|
|
483
|
+
strategy
|
|
484
|
+
} = middlewareArguments;
|
|
485
|
+
// A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
|
|
486
|
+
// ClientRect's bounds, despite the event listener being triggered. A
|
|
487
|
+
// padding of 2 seems to handle this issue.
|
|
488
|
+
const {
|
|
489
|
+
padding = 2,
|
|
490
|
+
x,
|
|
491
|
+
y
|
|
492
|
+
} = options;
|
|
493
|
+
const fallback = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
494
|
+
rect: rects.reference,
|
|
495
|
+
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
|
496
|
+
strategy
|
|
497
|
+
}) : rects.reference);
|
|
498
|
+
const clientRects = (await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || [];
|
|
499
|
+
const paddingObject = getSideObjectFromPadding(padding);
|
|
500
|
+
function getBoundingClientRect() {
|
|
501
|
+
// There are two rects and they are disjoined.
|
|
502
|
+
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
503
|
+
// Find the first rect in which the point is fully inside.
|
|
504
|
+
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;
|
|
505
|
+
}
|
|
488
506
|
|
|
507
|
+
// There are 2 or more connected rects.
|
|
508
|
+
if (clientRects.length >= 2) {
|
|
509
|
+
if (getMainAxisFromPlacement(placement) === 'x') {
|
|
510
|
+
const firstRect = clientRects[0];
|
|
511
|
+
const lastRect = clientRects[clientRects.length - 1];
|
|
512
|
+
const isTop = getSide(placement) === 'top';
|
|
513
|
+
const top = firstRect.top;
|
|
514
|
+
const bottom = lastRect.bottom;
|
|
515
|
+
const left = isTop ? firstRect.left : lastRect.left;
|
|
516
|
+
const right = isTop ? firstRect.right : lastRect.right;
|
|
517
|
+
const width = right - left;
|
|
518
|
+
const height = bottom - top;
|
|
519
|
+
return {
|
|
520
|
+
top,
|
|
521
|
+
bottom,
|
|
522
|
+
left,
|
|
523
|
+
right,
|
|
524
|
+
width,
|
|
525
|
+
height,
|
|
526
|
+
x: left,
|
|
527
|
+
y: top
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
const isLeftSide = getSide(placement) === 'left';
|
|
531
|
+
const maxRight = max$1(...clientRects.map(rect => rect.right));
|
|
532
|
+
const minLeft = min$1(...clientRects.map(rect => rect.left));
|
|
533
|
+
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
534
|
+
const top = measureRects[0].top;
|
|
535
|
+
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
536
|
+
const left = minLeft;
|
|
537
|
+
const right = maxRight;
|
|
538
|
+
const width = right - left;
|
|
539
|
+
const height = bottom - top;
|
|
540
|
+
return {
|
|
541
|
+
top,
|
|
542
|
+
bottom,
|
|
543
|
+
left,
|
|
544
|
+
right,
|
|
545
|
+
width,
|
|
546
|
+
height,
|
|
547
|
+
x: left,
|
|
548
|
+
y: top
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
return fallback;
|
|
552
|
+
}
|
|
553
|
+
const resetRects = await platform.getElementRects({
|
|
554
|
+
reference: {
|
|
555
|
+
getBoundingClientRect
|
|
556
|
+
},
|
|
557
|
+
floating: elements.floating,
|
|
558
|
+
strategy
|
|
559
|
+
});
|
|
560
|
+
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) {
|
|
561
|
+
return {
|
|
562
|
+
reset: {
|
|
563
|
+
rects: resetRects
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
return {};
|
|
568
|
+
}
|
|
489
569
|
};
|
|
490
570
|
};
|
|
491
571
|
|
|
@@ -497,12 +577,13 @@ async function convertValueToCoords(middlewareArguments, value) {
|
|
|
497
577
|
} = middlewareArguments;
|
|
498
578
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
499
579
|
const side = getSide(placement);
|
|
500
|
-
const alignment = getAlignment
|
|
580
|
+
const alignment = getAlignment(placement);
|
|
501
581
|
const isVertical = getMainAxisFromPlacement(placement) === 'x';
|
|
502
582
|
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
503
583
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
504
|
-
const rawValue = typeof value === 'function' ? value(middlewareArguments) : value;
|
|
584
|
+
const rawValue = typeof value === 'function' ? value(middlewareArguments) : value;
|
|
505
585
|
|
|
586
|
+
// eslint-disable-next-line prefer-const
|
|
506
587
|
let {
|
|
507
588
|
mainAxis,
|
|
508
589
|
crossAxis,
|
|
@@ -517,11 +598,9 @@ async function convertValueToCoords(middlewareArguments, value) {
|
|
|
517
598
|
alignmentAxis: null,
|
|
518
599
|
...rawValue
|
|
519
600
|
};
|
|
520
|
-
|
|
521
601
|
if (alignment && typeof alignmentAxis === 'number') {
|
|
522
602
|
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
523
603
|
}
|
|
524
|
-
|
|
525
604
|
return isVertical ? {
|
|
526
605
|
x: crossAxis * crossAxisMulti,
|
|
527
606
|
y: mainAxis * mainAxisMulti
|
|
@@ -530,20 +609,18 @@ async function convertValueToCoords(middlewareArguments, value) {
|
|
|
530
609
|
y: crossAxis * crossAxisMulti
|
|
531
610
|
};
|
|
532
611
|
}
|
|
612
|
+
|
|
533
613
|
/**
|
|
534
614
|
* Displaces the floating element from its reference element.
|
|
535
615
|
* @see https://floating-ui.com/docs/offset
|
|
536
616
|
*/
|
|
537
|
-
|
|
538
617
|
const offset = function (value) {
|
|
539
618
|
if (value === void 0) {
|
|
540
619
|
value = 0;
|
|
541
620
|
}
|
|
542
|
-
|
|
543
621
|
return {
|
|
544
622
|
name: 'offset',
|
|
545
623
|
options: value,
|
|
546
|
-
|
|
547
624
|
async fn(middlewareArguments) {
|
|
548
625
|
const {
|
|
549
626
|
x,
|
|
@@ -556,7 +633,6 @@ const offset = function (value) {
|
|
|
556
633
|
data: diffCoords
|
|
557
634
|
};
|
|
558
635
|
}
|
|
559
|
-
|
|
560
636
|
};
|
|
561
637
|
};
|
|
562
638
|
|
|
@@ -573,11 +649,9 @@ const shift = function (options) {
|
|
|
573
649
|
if (options === void 0) {
|
|
574
650
|
options = {};
|
|
575
651
|
}
|
|
576
|
-
|
|
577
652
|
return {
|
|
578
653
|
name: 'shift',
|
|
579
654
|
options,
|
|
580
|
-
|
|
581
655
|
async fn(middlewareArguments) {
|
|
582
656
|
const {
|
|
583
657
|
x,
|
|
@@ -610,7 +684,6 @@ const shift = function (options) {
|
|
|
610
684
|
const crossAxis = getCrossAxis(mainAxis);
|
|
611
685
|
let mainAxisCoord = coords[mainAxis];
|
|
612
686
|
let crossAxisCoord = coords[crossAxis];
|
|
613
|
-
|
|
614
687
|
if (checkMainAxis) {
|
|
615
688
|
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
616
689
|
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
@@ -618,7 +691,6 @@ const shift = function (options) {
|
|
|
618
691
|
const max = mainAxisCoord - overflow[maxSide];
|
|
619
692
|
mainAxisCoord = within(min, mainAxisCoord, max);
|
|
620
693
|
}
|
|
621
|
-
|
|
622
694
|
if (checkCrossAxis) {
|
|
623
695
|
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
624
696
|
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
@@ -626,173 +698,45 @@ const shift = function (options) {
|
|
|
626
698
|
const max = crossAxisCoord - overflow[maxSide];
|
|
627
699
|
crossAxisCoord = within(min, crossAxisCoord, max);
|
|
628
700
|
}
|
|
629
|
-
|
|
630
|
-
|
|
701
|
+
const limitedCoords = limiter.fn({
|
|
702
|
+
...middlewareArguments,
|
|
631
703
|
[mainAxis]: mainAxisCoord,
|
|
632
704
|
[crossAxis]: crossAxisCoord
|
|
633
705
|
});
|
|
634
|
-
return {
|
|
706
|
+
return {
|
|
707
|
+
...limitedCoords,
|
|
635
708
|
data: {
|
|
636
709
|
x: limitedCoords.x - x,
|
|
637
710
|
y: limitedCoords.y - y
|
|
638
711
|
}
|
|
639
712
|
};
|
|
640
713
|
}
|
|
641
|
-
|
|
642
|
-
};
|
|
643
|
-
};
|
|
644
|
-
|
|
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
714
|
};
|
|
763
715
|
};
|
|
764
716
|
|
|
765
|
-
function isWindow(value) {
|
|
766
|
-
return value && value.document && value.location && value.alert && value.setInterval;
|
|
767
|
-
}
|
|
768
717
|
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;
|
|
718
|
+
var _node$ownerDocument;
|
|
719
|
+
return ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
779
720
|
}
|
|
780
721
|
|
|
781
|
-
function getComputedStyle(element) {
|
|
722
|
+
function getComputedStyle$1(element) {
|
|
782
723
|
return getWindow(element).getComputedStyle(element);
|
|
783
724
|
}
|
|
784
725
|
|
|
785
726
|
function getNodeName(node) {
|
|
786
|
-
return
|
|
727
|
+
return isNode(node) ? (node.nodeName || '').toLowerCase() : '';
|
|
787
728
|
}
|
|
788
729
|
|
|
730
|
+
let uaString;
|
|
789
731
|
function getUAString() {
|
|
732
|
+
if (uaString) {
|
|
733
|
+
return uaString;
|
|
734
|
+
}
|
|
790
735
|
const uaData = navigator.userAgentData;
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
return
|
|
736
|
+
if (uaData && Array.isArray(uaData.brands)) {
|
|
737
|
+
uaString = uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
|
|
738
|
+
return uaString;
|
|
794
739
|
}
|
|
795
|
-
|
|
796
740
|
return navigator.userAgent;
|
|
797
741
|
}
|
|
798
742
|
|
|
@@ -810,19 +754,17 @@ function isShadowRoot(node) {
|
|
|
810
754
|
if (typeof ShadowRoot === 'undefined') {
|
|
811
755
|
return false;
|
|
812
756
|
}
|
|
813
|
-
|
|
814
757
|
const OwnElement = getWindow(node).ShadowRoot;
|
|
815
758
|
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
816
759
|
}
|
|
817
760
|
function isOverflowElement(element) {
|
|
818
|
-
// Firefox wants us to check `-x` and `-y` variations as well
|
|
819
761
|
const {
|
|
820
762
|
overflow,
|
|
821
763
|
overflowX,
|
|
822
764
|
overflowY,
|
|
823
765
|
display
|
|
824
|
-
} = getComputedStyle(element);
|
|
825
|
-
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
766
|
+
} = getComputedStyle$1(element);
|
|
767
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
826
768
|
}
|
|
827
769
|
function isTableElement(element) {
|
|
828
770
|
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
@@ -830,12 +772,14 @@ function isTableElement(element) {
|
|
|
830
772
|
function isContainingBlock(element) {
|
|
831
773
|
// TODO: Try and use feature detection here instead
|
|
832
774
|
const isFirefox = /firefox/i.test(getUAString());
|
|
833
|
-
const css = getComputedStyle(element);
|
|
834
|
-
const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter;
|
|
775
|
+
const css = getComputedStyle$1(element);
|
|
776
|
+
const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter;
|
|
777
|
+
|
|
778
|
+
// This is non-exhaustive but covers the most common CSS properties that
|
|
835
779
|
// create a containing block.
|
|
836
780
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
837
|
-
|
|
838
|
-
|
|
781
|
+
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(
|
|
782
|
+
// TS 4.1 compat
|
|
839
783
|
value => {
|
|
840
784
|
const contain = css.contain;
|
|
841
785
|
return contain != null ? contain.includes(value) : false;
|
|
@@ -843,12 +787,14 @@ function isContainingBlock(element) {
|
|
|
843
787
|
}
|
|
844
788
|
function isLayoutViewport() {
|
|
845
789
|
// Not Safari
|
|
846
|
-
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
790
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
791
|
+
// Feature detection for this fails in various ways
|
|
847
792
|
// • Always-visible scrollbar or not
|
|
848
793
|
// • Width of <html>, etc.
|
|
849
794
|
// const vV = win.visualViewport;
|
|
850
795
|
// return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
|
|
851
796
|
}
|
|
797
|
+
|
|
852
798
|
function isLastTraversableNode(node) {
|
|
853
799
|
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
854
800
|
}
|
|
@@ -857,32 +803,105 @@ const min = Math.min;
|
|
|
857
803
|
const max = Math.max;
|
|
858
804
|
const round = Math.round;
|
|
859
805
|
|
|
860
|
-
function
|
|
861
|
-
|
|
806
|
+
function getCssDimensions(element) {
|
|
807
|
+
const css = getComputedStyle$1(element);
|
|
808
|
+
let width = parseFloat(css.width);
|
|
809
|
+
let height = parseFloat(css.height);
|
|
810
|
+
const offsetWidth = element.offsetWidth;
|
|
811
|
+
const offsetHeight = element.offsetHeight;
|
|
812
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
813
|
+
if (shouldFallback) {
|
|
814
|
+
width = offsetWidth;
|
|
815
|
+
height = offsetHeight;
|
|
816
|
+
}
|
|
817
|
+
return {
|
|
818
|
+
width,
|
|
819
|
+
height,
|
|
820
|
+
fallback: shouldFallback
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
function unwrapElement(element) {
|
|
825
|
+
return !isElement(element) ? element.contextElement : element;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
const FALLBACK_SCALE = {
|
|
829
|
+
x: 1,
|
|
830
|
+
y: 1
|
|
831
|
+
};
|
|
832
|
+
function getScale(element) {
|
|
833
|
+
const domElement = unwrapElement(element);
|
|
834
|
+
if (!isHTMLElement(domElement)) {
|
|
835
|
+
return FALLBACK_SCALE;
|
|
836
|
+
}
|
|
837
|
+
const rect = domElement.getBoundingClientRect();
|
|
838
|
+
const {
|
|
839
|
+
width,
|
|
840
|
+
height,
|
|
841
|
+
fallback
|
|
842
|
+
} = getCssDimensions(domElement);
|
|
843
|
+
let x = (fallback ? round(rect.width) : rect.width) / width;
|
|
844
|
+
let y = (fallback ? round(rect.height) : rect.height) / height;
|
|
845
|
+
|
|
846
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
847
|
+
|
|
848
|
+
if (!x || !Number.isFinite(x)) {
|
|
849
|
+
x = 1;
|
|
850
|
+
}
|
|
851
|
+
if (!y || !Number.isFinite(y)) {
|
|
852
|
+
y = 1;
|
|
853
|
+
}
|
|
854
|
+
return {
|
|
855
|
+
x,
|
|
856
|
+
y
|
|
857
|
+
};
|
|
858
|
+
}
|
|
862
859
|
|
|
860
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
861
|
+
var _win$visualViewport, _win$visualViewport2;
|
|
863
862
|
if (includeScale === void 0) {
|
|
864
863
|
includeScale = false;
|
|
865
864
|
}
|
|
866
|
-
|
|
867
865
|
if (isFixedStrategy === void 0) {
|
|
868
866
|
isFixedStrategy = false;
|
|
869
867
|
}
|
|
870
|
-
|
|
871
868
|
const clientRect = element.getBoundingClientRect();
|
|
872
|
-
|
|
873
|
-
let
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
869
|
+
const domElement = unwrapElement(element);
|
|
870
|
+
let scale = FALLBACK_SCALE;
|
|
871
|
+
if (includeScale) {
|
|
872
|
+
if (offsetParent) {
|
|
873
|
+
if (isElement(offsetParent)) {
|
|
874
|
+
scale = getScale(offsetParent);
|
|
875
|
+
}
|
|
876
|
+
} else {
|
|
877
|
+
scale = getScale(element);
|
|
878
|
+
}
|
|
878
879
|
}
|
|
879
|
-
|
|
880
|
-
const win = isElement(element) ? getWindow(element) : window;
|
|
880
|
+
const win = domElement ? getWindow(domElement) : window;
|
|
881
881
|
const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
882
|
+
let x = (clientRect.left + (addVisualOffsets ? ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0 : 0)) / scale.x;
|
|
883
|
+
let y = (clientRect.top + (addVisualOffsets ? ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 : 0)) / scale.y;
|
|
884
|
+
let width = clientRect.width / scale.x;
|
|
885
|
+
let height = clientRect.height / scale.y;
|
|
886
|
+
if (domElement) {
|
|
887
|
+
const win = getWindow(domElement);
|
|
888
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
889
|
+
let currentIFrame = win.frameElement;
|
|
890
|
+
while (currentIFrame && offsetParent && offsetWin !== win) {
|
|
891
|
+
const iframeScale = getScale(currentIFrame);
|
|
892
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
893
|
+
const css = getComputedStyle(currentIFrame);
|
|
894
|
+
iframeRect.x += (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
895
|
+
iframeRect.y += (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
896
|
+
x *= iframeScale.x;
|
|
897
|
+
y *= iframeScale.y;
|
|
898
|
+
width *= iframeScale.x;
|
|
899
|
+
height *= iframeScale.y;
|
|
900
|
+
x += iframeRect.x;
|
|
901
|
+
y += iframeRect.y;
|
|
902
|
+
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
886
905
|
return {
|
|
887
906
|
width,
|
|
888
907
|
height,
|
|
@@ -906,7 +925,6 @@ function getNodeScroll(element) {
|
|
|
906
925
|
scrollTop: element.scrollTop
|
|
907
926
|
};
|
|
908
927
|
}
|
|
909
|
-
|
|
910
928
|
return {
|
|
911
929
|
scrollLeft: element.pageXOffset,
|
|
912
930
|
scrollTop: element.pageYOffset
|
|
@@ -919,16 +937,10 @@ function getWindowScrollBarX(element) {
|
|
|
919
937
|
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
920
938
|
}
|
|
921
939
|
|
|
922
|
-
function isScaled(element) {
|
|
923
|
-
const rect = getBoundingClientRect(element);
|
|
924
|
-
return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
940
|
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
928
941
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
929
942
|
const documentElement = getDocumentElement(offsetParent);
|
|
930
|
-
const rect = getBoundingClientRect(element,
|
|
931
|
-
isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
|
|
943
|
+
const rect = getBoundingClientRect(element, true, strategy === 'fixed', offsetParent);
|
|
932
944
|
let scroll = {
|
|
933
945
|
scrollLeft: 0,
|
|
934
946
|
scrollTop: 0
|
|
@@ -937,12 +949,10 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
937
949
|
x: 0,
|
|
938
950
|
y: 0
|
|
939
951
|
};
|
|
940
|
-
|
|
941
952
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
942
953
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
943
954
|
scroll = getNodeScroll(offsetParent);
|
|
944
955
|
}
|
|
945
|
-
|
|
946
956
|
if (isHTMLElement(offsetParent)) {
|
|
947
957
|
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
948
958
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
@@ -951,7 +961,6 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
951
961
|
offsets.x = getWindowScrollBarX(documentElement);
|
|
952
962
|
}
|
|
953
963
|
}
|
|
954
|
-
|
|
955
964
|
return {
|
|
956
965
|
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
957
966
|
y: rect.top + scroll.scrollTop - offsets.y,
|
|
@@ -964,26 +973,26 @@ function getParentNode(node) {
|
|
|
964
973
|
if (getNodeName(node) === 'html') {
|
|
965
974
|
return node;
|
|
966
975
|
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
node.assignedSlot ||
|
|
970
|
-
|
|
971
|
-
|
|
976
|
+
const result =
|
|
977
|
+
// Step into the shadow DOM of the parent of a slotted node
|
|
978
|
+
node.assignedSlot ||
|
|
979
|
+
// DOM Element detected
|
|
980
|
+
node.parentNode || (
|
|
981
|
+
// ShadowRoot detected
|
|
982
|
+
isShadowRoot(node) ? node.host : null) ||
|
|
983
|
+
// Fallback
|
|
972
984
|
getDocumentElement(node);
|
|
973
985
|
return isShadowRoot(result) ? result.host : result;
|
|
974
986
|
}
|
|
975
987
|
|
|
976
988
|
function getTrueOffsetParent(element) {
|
|
977
|
-
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
989
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
978
990
|
return null;
|
|
979
991
|
}
|
|
980
|
-
|
|
981
992
|
return element.offsetParent;
|
|
982
993
|
}
|
|
983
|
-
|
|
984
994
|
function getContainingBlock(element) {
|
|
985
995
|
let currentNode = getParentNode(element);
|
|
986
|
-
|
|
987
996
|
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
988
997
|
if (isContainingBlock(currentNode)) {
|
|
989
998
|
return currentNode;
|
|
@@ -991,40 +1000,25 @@ function getContainingBlock(element) {
|
|
|
991
1000
|
currentNode = getParentNode(currentNode);
|
|
992
1001
|
}
|
|
993
1002
|
}
|
|
994
|
-
|
|
995
1003
|
return null;
|
|
996
|
-
}
|
|
997
|
-
// such as table ancestors and cross browser bugs.
|
|
998
|
-
|
|
1004
|
+
}
|
|
999
1005
|
|
|
1006
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1007
|
+
// such as table ancestors and cross browser bugs.
|
|
1000
1008
|
function getOffsetParent(element) {
|
|
1001
1009
|
const window = getWindow(element);
|
|
1002
1010
|
let offsetParent = getTrueOffsetParent(element);
|
|
1003
|
-
|
|
1004
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
1011
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
|
1005
1012
|
offsetParent = getTrueOffsetParent(offsetParent);
|
|
1006
1013
|
}
|
|
1007
|
-
|
|
1008
|
-
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
1014
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
1009
1015
|
return window;
|
|
1010
1016
|
}
|
|
1011
|
-
|
|
1012
1017
|
return offsetParent || getContainingBlock(element) || window;
|
|
1013
1018
|
}
|
|
1014
1019
|
|
|
1015
1020
|
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
|
-
};
|
|
1021
|
+
return getCssDimensions(element);
|
|
1028
1022
|
}
|
|
1029
1023
|
|
|
1030
1024
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
@@ -1035,39 +1029,42 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1035
1029
|
} = _ref;
|
|
1036
1030
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1037
1031
|
const documentElement = getDocumentElement(offsetParent);
|
|
1038
|
-
|
|
1039
1032
|
if (offsetParent === documentElement) {
|
|
1040
1033
|
return rect;
|
|
1041
1034
|
}
|
|
1042
|
-
|
|
1043
1035
|
let scroll = {
|
|
1044
1036
|
scrollLeft: 0,
|
|
1045
1037
|
scrollTop: 0
|
|
1046
1038
|
};
|
|
1039
|
+
let scale = {
|
|
1040
|
+
x: 1,
|
|
1041
|
+
y: 1
|
|
1042
|
+
};
|
|
1047
1043
|
const offsets = {
|
|
1048
1044
|
x: 0,
|
|
1049
1045
|
y: 0
|
|
1050
1046
|
};
|
|
1051
|
-
|
|
1052
1047
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
1053
1048
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1054
1049
|
scroll = getNodeScroll(offsetParent);
|
|
1055
1050
|
}
|
|
1056
|
-
|
|
1057
1051
|
if (isHTMLElement(offsetParent)) {
|
|
1058
|
-
const offsetRect = getBoundingClientRect(offsetParent
|
|
1052
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
1053
|
+
scale = getScale(offsetParent);
|
|
1059
1054
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1060
1055
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1061
|
-
}
|
|
1056
|
+
}
|
|
1057
|
+
// This doesn't appear to need to be negated.
|
|
1062
1058
|
// else if (documentElement) {
|
|
1063
1059
|
// offsets.x = getWindowScrollBarX(documentElement);
|
|
1064
1060
|
// }
|
|
1065
|
-
|
|
1066
1061
|
}
|
|
1067
1062
|
|
|
1068
|
-
return {
|
|
1069
|
-
|
|
1070
|
-
|
|
1063
|
+
return {
|
|
1064
|
+
width: rect.width * scale.x,
|
|
1065
|
+
height: rect.height * scale.y,
|
|
1066
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
1067
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
1071
1068
|
};
|
|
1072
1069
|
}
|
|
1073
1070
|
|
|
@@ -1079,18 +1076,15 @@ function getViewportRect(element, strategy) {
|
|
|
1079
1076
|
let height = html.clientHeight;
|
|
1080
1077
|
let x = 0;
|
|
1081
1078
|
let y = 0;
|
|
1082
|
-
|
|
1083
1079
|
if (visualViewport) {
|
|
1084
1080
|
width = visualViewport.width;
|
|
1085
1081
|
height = visualViewport.height;
|
|
1086
1082
|
const layoutViewport = isLayoutViewport();
|
|
1087
|
-
|
|
1088
1083
|
if (layoutViewport || !layoutViewport && strategy === 'fixed') {
|
|
1089
1084
|
x = visualViewport.offsetLeft;
|
|
1090
1085
|
y = visualViewport.offsetTop;
|
|
1091
1086
|
}
|
|
1092
1087
|
}
|
|
1093
|
-
|
|
1094
1088
|
return {
|
|
1095
1089
|
width,
|
|
1096
1090
|
height,
|
|
@@ -1099,11 +1093,10 @@ function getViewportRect(element, strategy) {
|
|
|
1099
1093
|
};
|
|
1100
1094
|
}
|
|
1101
1095
|
|
|
1096
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
1102
1097
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
|
1103
|
-
|
|
1104
1098
|
function getDocumentRect(element) {
|
|
1105
1099
|
var _element$ownerDocumen;
|
|
1106
|
-
|
|
1107
1100
|
const html = getDocumentElement(element);
|
|
1108
1101
|
const scroll = getNodeScroll(element);
|
|
1109
1102
|
const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
@@ -1111,11 +1104,9 @@ function getDocumentRect(element) {
|
|
|
1111
1104
|
const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
1112
1105
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1113
1106
|
const y = -scroll.scrollTop;
|
|
1114
|
-
|
|
1115
|
-
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
1107
|
+
if (getComputedStyle$1(body || html).direction === 'rtl') {
|
|
1116
1108
|
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
1117
1109
|
}
|
|
1118
|
-
|
|
1119
1110
|
return {
|
|
1120
1111
|
width,
|
|
1121
1112
|
height,
|
|
@@ -1126,90 +1117,97 @@ function getDocumentRect(element) {
|
|
|
1126
1117
|
|
|
1127
1118
|
function getNearestOverflowAncestor(node) {
|
|
1128
1119
|
const parentNode = getParentNode(node);
|
|
1129
|
-
|
|
1130
1120
|
if (isLastTraversableNode(parentNode)) {
|
|
1131
1121
|
// @ts-ignore assume body is always available
|
|
1132
1122
|
return node.ownerDocument.body;
|
|
1133
1123
|
}
|
|
1134
|
-
|
|
1135
1124
|
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
1136
1125
|
return parentNode;
|
|
1137
1126
|
}
|
|
1138
|
-
|
|
1139
1127
|
return getNearestOverflowAncestor(parentNode);
|
|
1140
1128
|
}
|
|
1141
1129
|
|
|
1142
1130
|
function getOverflowAncestors(node, list) {
|
|
1143
1131
|
var _node$ownerDocument;
|
|
1144
|
-
|
|
1145
1132
|
if (list === void 0) {
|
|
1146
1133
|
list = [];
|
|
1147
1134
|
}
|
|
1148
|
-
|
|
1149
1135
|
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1150
1136
|
const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
|
|
1151
1137
|
const win = getWindow(scrollableAncestor);
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1138
|
+
if (isBody) {
|
|
1139
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
|
|
1140
|
+
}
|
|
1141
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
|
|
1156
1142
|
}
|
|
1157
1143
|
|
|
1144
|
+
// Returns the inner client rect, subtracting scrollbars if present
|
|
1158
1145
|
function getInnerBoundingClientRect(element, strategy) {
|
|
1159
|
-
const clientRect = getBoundingClientRect(element,
|
|
1146
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
1160
1147
|
const top = clientRect.top + element.clientTop;
|
|
1161
1148
|
const left = clientRect.left + element.clientLeft;
|
|
1149
|
+
const scale = isHTMLElement(element) ? getScale(element) : {
|
|
1150
|
+
x: 1,
|
|
1151
|
+
y: 1
|
|
1152
|
+
};
|
|
1153
|
+
const width = element.clientWidth * scale.x;
|
|
1154
|
+
const height = element.clientHeight * scale.y;
|
|
1155
|
+
const x = left * scale.x;
|
|
1156
|
+
const y = top * scale.y;
|
|
1162
1157
|
return {
|
|
1163
|
-
top,
|
|
1164
|
-
left,
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
width
|
|
1170
|
-
height
|
|
1158
|
+
top: y,
|
|
1159
|
+
left: x,
|
|
1160
|
+
right: x + width,
|
|
1161
|
+
bottom: y + height,
|
|
1162
|
+
x,
|
|
1163
|
+
y,
|
|
1164
|
+
width,
|
|
1165
|
+
height
|
|
1171
1166
|
};
|
|
1172
1167
|
}
|
|
1173
|
-
|
|
1174
1168
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1175
1169
|
if (clippingAncestor === 'viewport') {
|
|
1176
1170
|
return rectToClientRect(getViewportRect(element, strategy));
|
|
1177
1171
|
}
|
|
1178
|
-
|
|
1179
1172
|
if (isElement(clippingAncestor)) {
|
|
1180
1173
|
return getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1181
1174
|
}
|
|
1182
|
-
|
|
1183
1175
|
return rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
1184
|
-
}
|
|
1185
|
-
// clipping (or hiding) overflowing elements with a position different from
|
|
1186
|
-
// `initial`
|
|
1187
|
-
|
|
1176
|
+
}
|
|
1188
1177
|
|
|
1189
|
-
|
|
1178
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
1179
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
1180
|
+
// of the given element up the tree.
|
|
1181
|
+
function getClippingElementAncestors(element, cache) {
|
|
1182
|
+
const cachedResult = cache.get(element);
|
|
1183
|
+
if (cachedResult) {
|
|
1184
|
+
return cachedResult;
|
|
1185
|
+
}
|
|
1190
1186
|
let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1191
|
-
let
|
|
1192
|
-
|
|
1187
|
+
let currentContainingBlockComputedStyle = null;
|
|
1188
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
1189
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1193
1190
|
|
|
1191
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1194
1192
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1195
|
-
const computedStyle = getComputedStyle(currentNode);
|
|
1196
|
-
|
|
1197
|
-
|
|
1193
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
1194
|
+
const containingBlock = isContainingBlock(currentNode);
|
|
1195
|
+
const shouldDropCurrentNode = elementIsFixed ? !containingBlock && !currentContainingBlockComputedStyle : !containingBlock && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position);
|
|
1196
|
+
if (shouldDropCurrentNode) {
|
|
1198
1197
|
// Drop non-containing blocks
|
|
1199
1198
|
result = result.filter(ancestor => ancestor !== currentNode);
|
|
1200
1199
|
} else {
|
|
1201
1200
|
// Record last containing block for next iteration
|
|
1202
1201
|
currentContainingBlockComputedStyle = computedStyle;
|
|
1203
1202
|
}
|
|
1204
|
-
|
|
1205
1203
|
currentNode = getParentNode(currentNode);
|
|
1206
1204
|
}
|
|
1207
|
-
|
|
1205
|
+
cache.set(element, result);
|
|
1208
1206
|
return result;
|
|
1209
|
-
}
|
|
1210
|
-
// clipping ancestors
|
|
1211
|
-
|
|
1207
|
+
}
|
|
1212
1208
|
|
|
1209
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
1210
|
+
// clipping ancestors
|
|
1213
1211
|
function getClippingRect(_ref) {
|
|
1214
1212
|
let {
|
|
1215
1213
|
element,
|
|
@@ -1217,7 +1215,7 @@ function getClippingRect(_ref) {
|
|
|
1217
1215
|
rootBoundary,
|
|
1218
1216
|
strategy
|
|
1219
1217
|
} = _ref;
|
|
1220
|
-
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element) : [].concat(boundary);
|
|
1218
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1221
1219
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1222
1220
|
const firstClippingAncestor = clippingAncestors[0];
|
|
1223
1221
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
@@ -1243,22 +1241,26 @@ const platform = {
|
|
|
1243
1241
|
getDimensions,
|
|
1244
1242
|
getOffsetParent,
|
|
1245
1243
|
getDocumentElement,
|
|
1246
|
-
|
|
1244
|
+
getScale,
|
|
1245
|
+
async getElementRects(_ref) {
|
|
1247
1246
|
let {
|
|
1248
1247
|
reference,
|
|
1249
1248
|
floating,
|
|
1250
1249
|
strategy
|
|
1251
1250
|
} = _ref;
|
|
1251
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1252
|
+
const getDimensionsFn = this.getDimensions;
|
|
1252
1253
|
return {
|
|
1253
|
-
reference: getRectRelativeToOffsetParent(reference,
|
|
1254
|
-
floating: {
|
|
1254
|
+
reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
|
|
1255
|
+
floating: {
|
|
1255
1256
|
x: 0,
|
|
1256
|
-
y: 0
|
|
1257
|
+
y: 0,
|
|
1258
|
+
...(await getDimensionsFn(floating))
|
|
1257
1259
|
}
|
|
1258
1260
|
};
|
|
1259
1261
|
},
|
|
1260
1262
|
getClientRects: element => Array.from(element.getClientRects()),
|
|
1261
|
-
isRTL: element => getComputedStyle(element).direction === 'rtl'
|
|
1263
|
+
isRTL: element => getComputedStyle$1(element).direction === 'rtl'
|
|
1262
1264
|
};
|
|
1263
1265
|
|
|
1264
1266
|
/**
|
|
@@ -1269,7 +1271,6 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1269
1271
|
if (options === void 0) {
|
|
1270
1272
|
options = {};
|
|
1271
1273
|
}
|
|
1272
|
-
|
|
1273
1274
|
const {
|
|
1274
1275
|
ancestorScroll: _ancestorScroll = true,
|
|
1275
1276
|
ancestorResize = true,
|
|
@@ -1285,54 +1286,42 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1285
1286
|
ancestorResize && ancestor.addEventListener('resize', update);
|
|
1286
1287
|
});
|
|
1287
1288
|
let observer = null;
|
|
1288
|
-
|
|
1289
1289
|
if (elementResize) {
|
|
1290
1290
|
let initialUpdate = true;
|
|
1291
1291
|
observer = new ResizeObserver(() => {
|
|
1292
1292
|
if (!initialUpdate) {
|
|
1293
1293
|
update();
|
|
1294
1294
|
}
|
|
1295
|
-
|
|
1296
1295
|
initialUpdate = false;
|
|
1297
1296
|
});
|
|
1298
1297
|
isElement(reference) && !animationFrame && observer.observe(reference);
|
|
1299
|
-
|
|
1300
1298
|
if (!isElement(reference) && reference.contextElement && !animationFrame) {
|
|
1301
1299
|
observer.observe(reference.contextElement);
|
|
1302
1300
|
}
|
|
1303
|
-
|
|
1304
1301
|
observer.observe(floating);
|
|
1305
1302
|
}
|
|
1306
|
-
|
|
1307
1303
|
let frameId;
|
|
1308
1304
|
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
1309
|
-
|
|
1310
1305
|
if (animationFrame) {
|
|
1311
1306
|
frameLoop();
|
|
1312
1307
|
}
|
|
1313
|
-
|
|
1314
1308
|
function frameLoop() {
|
|
1315
1309
|
const nextRefRect = getBoundingClientRect(reference);
|
|
1316
|
-
|
|
1317
1310
|
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
1318
1311
|
update();
|
|
1319
1312
|
}
|
|
1320
|
-
|
|
1321
1313
|
prevRefRect = nextRefRect;
|
|
1322
1314
|
frameId = requestAnimationFrame(frameLoop);
|
|
1323
1315
|
}
|
|
1324
|
-
|
|
1325
1316
|
update();
|
|
1326
1317
|
return () => {
|
|
1327
1318
|
var _observer;
|
|
1328
|
-
|
|
1329
1319
|
ancestors.forEach(ancestor => {
|
|
1330
1320
|
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
1331
1321
|
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
1332
1322
|
});
|
|
1333
1323
|
(_observer = observer) == null ? void 0 : _observer.disconnect();
|
|
1334
1324
|
observer = null;
|
|
1335
|
-
|
|
1336
1325
|
if (animationFrame) {
|
|
1337
1326
|
cancelAnimationFrame(frameId);
|
|
1338
1327
|
}
|
|
@@ -1344,20 +1333,23 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1344
1333
|
* next to a reference element when it is given a certain CSS positioning
|
|
1345
1334
|
* strategy.
|
|
1346
1335
|
*/
|
|
1336
|
+
const computePosition = (reference, floating, options) => {
|
|
1337
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
1338
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
1339
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
1340
|
+
const cache = new Map();
|
|
1341
|
+
const mergedOptions = {
|
|
1342
|
+
platform,
|
|
1343
|
+
...options
|
|
1344
|
+
};
|
|
1345
|
+
const platformWithCache = {
|
|
1346
|
+
...mergedOptions.platform,
|
|
1347
|
+
_c: cache
|
|
1348
|
+
};
|
|
1349
|
+
return computePosition$1(reference, floating, {
|
|
1350
|
+
...mergedOptions,
|
|
1351
|
+
platform: platformWithCache
|
|
1352
|
+
});
|
|
1353
|
+
};
|
|
1347
1354
|
|
|
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 };
|
|
1355
|
+
export { autoPlacement as a, autoUpdate as b, computePosition as c, arrow as d, inline as i, offset as o, shift as s };
|