@carbon/web-components 2.40.1 → 2.41.0
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/custom-elements.json +130 -0
- package/dist/ai-label.min.js +8 -8
- package/dist/breadcrumb.min.js +4 -4
- package/dist/button-CmUJmoio.js +93 -0
- package/dist/{button-skeleton-DKiPqzwa.js → button-skeleton-Ba4xDn6y.js} +1 -1
- package/dist/button.min.js +1 -1
- package/dist/chat-button.min.js +3 -3
- package/dist/code-snippet.min.js +29 -29
- package/dist/combo-button.min.js +7 -7
- package/dist/content-switcher-item-Cz7OvIj8.js +54 -0
- package/dist/content-switcher.min.js +1 -1
- package/dist/copy-button.min.js +8 -8
- package/dist/data-table.min.js +41 -41
- package/dist/feature-flags.min.js +1 -1
- package/dist/file-uploader.min.js +29 -29
- package/dist/floating-controller-CxZPAslz.js +28 -0
- package/dist/icon-button.min.js +7 -7
- package/dist/icon-indicator.min.js +1 -1
- package/dist/menu-button.min.js +5 -5
- package/dist/modal.min.js +6 -6
- package/dist/notification.min.js +36 -38
- package/dist/overflow-menu.min.js +6 -6
- package/dist/pagination.min.js +25 -25
- package/dist/password-input.min.js +7 -7
- package/dist/popover.min.js +9 -9
- package/dist/progress-indicator.min.js +12 -12
- package/dist/radio-button.min.js +3 -3
- package/dist/side-panel.min.js +6 -6
- package/dist/skip-to-content.min.js +4 -4
- package/dist/slug.min.js +8 -8
- package/dist/tabs.min.js +24 -24
- package/dist/tag.min.js +49 -49
- package/dist/tearsheet.min.js +1 -1
- package/dist/tile.min.js +1 -1
- package/dist/toggle-tip.min.js +14 -14
- package/dist/tooltip-content-Tyg0Hg0i.js +30 -0
- package/dist/tooltip.min.js +1 -1
- package/dist/tree-view.min.js +5 -2
- package/dist/ui-shell.min.js +53 -53
- package/es/components/accordion/accordion-item.d.ts +27 -11
- package/es/components/ai-label/ai-label.scss.js +1 -1
- package/es/components/breadcrumb/breadcrumb.scss.js +1 -1
- package/es/components/button/button.d.ts +56 -22
- package/es/components/button/button.scss.js +1 -1
- package/es/components/chat-button/chat-button.scss.js +1 -1
- package/es/components/checkbox/checkbox-group.d.ts +2 -0
- package/es/components/checkbox/checkbox.d.ts +56 -22
- package/es/components/code-snippet/code-snippet.d.ts +29 -11
- package/es/components/code-snippet/code-snippet.scss.js +1 -1
- package/es/components/combo-button/combo-button.d.ts +27 -11
- package/es/components/combo-button/combo-button.scss.js +1 -1
- package/es/components/content-switcher/content-switcher-item.d.ts +29 -11
- package/es/components/content-switcher/content-switcher.scss.js +1 -1
- package/es/components/copy-button/copy-button.d.ts +27 -11
- package/es/components/copy-button/copy-button.scss.js +1 -1
- package/es/components/data-table/data-table.scss.js +1 -1
- package/es/components/data-table/table-expanded-row.d.ts +27 -11
- package/es/components/data-table/table-header-cell.d.ts +29 -11
- package/es/components/data-table/table-row.d.ts +54 -22
- package/es/components/data-table/table-toolbar-search.d.ts +29 -11
- package/es/components/data-table/table.d.ts +27 -11
- package/es/components/data-table/table.js +12 -4
- package/es/components/data-table/table.js.map +1 -1
- package/es/components/date-picker/date-picker-input.d.ts +29 -11
- package/es/components/date-picker/date-picker.d.ts +54 -22
- package/es/components/dropdown/dropdown.d.ts +110 -44
- package/es/components/feature-flags/index.js +1 -0
- package/es/components/feature-flags/index.js.map +1 -1
- package/es/components/file-uploader/file-uploader-button.d.ts +27 -11
- package/es/components/file-uploader/file-uploader-drop-container.d.ts +27 -11
- package/es/components/file-uploader/file-uploader.scss.js +1 -1
- package/es/components/floating-menu/floating-menu.d.ts +56 -22
- package/es/components/icon-button/icon-button.scss.js +1 -1
- package/es/components/link/link.d.ts +29 -11
- package/es/components/menu/menu-item-selectable.d.ts +2 -0
- package/es/components/menu/menu-item.d.ts +54 -22
- package/es/components/menu/menu.d.ts +27 -11
- package/es/components/menu-button/menu-button.d.ts +27 -11
- package/es/components/menu-button/menu-button.scss.js +1 -1
- package/es/components/modal/modal-close-button.d.ts +29 -11
- package/es/components/modal/modal.d.ts +27 -11
- package/es/components/modal/modal.scss.js +1 -1
- package/es/components/notification/actionable-notification.d.ts +27 -11
- package/es/components/notification/actionable-notification.scss.js +1 -1
- package/es/components/notification/inline-notification.d.ts +27 -11
- package/es/components/notification/inline-notification.scss.js +1 -1
- package/es/components/notification/toast-notification.d.ts +1 -1
- package/es/components/notification/toast-notification.js +13 -15
- package/es/components/notification/toast-notification.js.map +1 -1
- package/es/components/notification/toast-notification.scss.js +1 -1
- package/es/components/number-input/number-input.d.ts +2 -0
- package/es/components/overflow-menu/overflow-menu-item.d.ts +29 -11
- package/es/components/overflow-menu/overflow-menu.d.ts +54 -22
- package/es/components/overflow-menu/overflow-menu.scss.js +1 -1
- package/es/components/pagination/pagination.d.ts +56 -22
- package/es/components/pagination/pagination.js +12 -7
- package/es/components/pagination/pagination.js.map +1 -1
- package/es/components/pagination/pagination.scss.js +1 -1
- package/es/components/password-input/password-input.d.ts +2 -0
- package/es/components/popover/defs.d.ts +13 -0
- package/es/components/popover/defs.js +15 -1
- package/es/components/popover/defs.js.map +1 -1
- package/es/components/popover/popover-content.d.ts +13 -0
- package/es/components/popover/popover-content.js +22 -0
- package/es/components/popover/popover-content.js.map +1 -1
- package/es/components/popover/popover.d.ts +37 -12
- package/es/components/popover/popover.js +31 -3
- package/es/components/popover/popover.js.map +1 -1
- package/es/components/popover/popover.scss.js +1 -1
- package/es/components/progress-indicator/progress-indicator.scss.js +1 -1
- package/es/components/progress-indicator/progress-step.d.ts +29 -11
- package/es/components/radio-button/radio-button-group.d.ts +54 -22
- package/es/components/radio-button/radio-button.d.ts +56 -22
- package/es/components/search/search.d.ts +83 -33
- package/es/components/select/select.d.ts +29 -11
- package/es/components/side-panel/side-panel.d.ts +27 -11
- package/es/components/skip-to-content/skip-to-content.d.ts +29 -11
- package/es/components/skip-to-content/skip-to-content.scss.js +1 -1
- package/es/components/slider/slider-input.d.ts +29 -11
- package/es/components/slider/slider.d.ts +83 -33
- package/es/components/slug/slug.scss.js +1 -1
- package/es/components/structured-list/structured-list-row.d.ts +27 -11
- package/es/components/structured-list/structured-list.d.ts +29 -11
- package/es/components/tabs/tabs.d.ts +27 -11
- package/es/components/tabs/tabs.scss.js +1 -1
- package/es/components/tag/dismissible-tag.d.ts +54 -22
- package/es/components/tag/operational-tag.d.ts +54 -22
- package/es/components/tag/selectable-tag.d.ts +54 -22
- package/es/components/tag/tag.d.ts +54 -22
- package/es/components/tag/tag.scss.js +1 -1
- package/es/components/tearsheet/tearsheet.d.ts +27 -11
- package/es/components/text-input/text-input.d.ts +56 -22
- package/es/components/textarea/textarea.d.ts +2 -0
- package/es/components/tile/expandable-tile.d.ts +54 -22
- package/es/components/tile/selectable-tile.d.ts +56 -22
- package/es/components/tile/tile-group.d.ts +27 -11
- package/es/components/tile/tile.scss.js +1 -1
- package/es/components/time-picker/time-picker-select.d.ts +29 -11
- package/es/components/time-picker/time-picker.d.ts +56 -22
- package/es/components/toggle/toggle.d.ts +27 -11
- package/es/components/toggle-tip/toggletip.d.ts +56 -22
- package/es/components/toggle-tip/toggletip.scss.js +1 -1
- package/es/components/tooltip/tooltip.d.ts +27 -11
- package/es/components/tooltip/tooltip.js +3 -0
- package/es/components/tooltip/tooltip.js.map +1 -1
- package/es/components/tooltip/tooltip.scss.js +1 -1
- package/es/components/tree-view/tree-node.js +4 -4
- package/es/components/tree-view/tree-node.js.map +1 -1
- package/es/components/tree-view/tree-view.d.ts +27 -11
- package/es/components/ui-shell/header-global-action.d.ts +2 -0
- package/es/components/ui-shell/header-menu-button.d.ts +29 -11
- package/es/components/ui-shell/header-menu.d.ts +56 -22
- package/es/components/ui-shell/header-name.d.ts +29 -11
- package/es/components/ui-shell/header-nav-item.d.ts +29 -11
- package/es/components/ui-shell/header-panel.d.ts +2 -0
- package/es/components/ui-shell/header.scss.js +1 -1
- package/es/components/ui-shell/side-nav-link.d.ts +29 -11
- package/es/components/ui-shell/side-nav-menu-item.d.ts +29 -11
- package/es/components/ui-shell/side-nav-menu.d.ts +29 -11
- package/es/components/ui-shell/side-nav.d.ts +27 -11
- package/es/components/ui-shell/switcher-item.d.ts +29 -11
- package/es/components/ui-shell/switcher.d.ts +2 -0
- package/es/feature-flags/es/index.js +30 -2
- package/es/feature-flags/es/index.js.map +1 -1
- package/es/globals/mixins/focus.d.ts +27 -11
- package/es/globals/mixins/form.d.ts +27 -11
- package/es/globals/mixins/host-listener.d.ts +27 -11
- package/es/globals/mixins/validity.d.ts +27 -11
- package/es-custom/components/accordion/accordion-item.d.ts +27 -11
- package/es-custom/components/ai-label/ai-label.scss.js +1 -1
- package/es-custom/components/breadcrumb/breadcrumb.scss.js +1 -1
- package/es-custom/components/button/button.d.ts +56 -22
- package/es-custom/components/button/button.scss.js +1 -1
- package/es-custom/components/chat-button/chat-button.scss.js +1 -1
- package/es-custom/components/checkbox/checkbox-group.d.ts +2 -0
- package/es-custom/components/checkbox/checkbox.d.ts +56 -22
- package/es-custom/components/code-snippet/code-snippet.d.ts +29 -11
- package/es-custom/components/code-snippet/code-snippet.scss.js +1 -1
- package/es-custom/components/combo-button/combo-button.d.ts +27 -11
- package/es-custom/components/combo-button/combo-button.scss.js +1 -1
- package/es-custom/components/content-switcher/content-switcher-item.d.ts +29 -11
- package/es-custom/components/content-switcher/content-switcher.scss.js +1 -1
- package/es-custom/components/copy-button/copy-button.d.ts +27 -11
- package/es-custom/components/copy-button/copy-button.scss.js +1 -1
- package/es-custom/components/data-table/data-table.scss.js +1 -1
- package/es-custom/components/data-table/table-expanded-row.d.ts +27 -11
- package/es-custom/components/data-table/table-header-cell.d.ts +29 -11
- package/es-custom/components/data-table/table-row.d.ts +54 -22
- package/es-custom/components/data-table/table-toolbar-search.d.ts +29 -11
- package/es-custom/components/data-table/table.d.ts +27 -11
- package/es-custom/components/data-table/table.js +12 -4
- package/es-custom/components/data-table/table.js.map +1 -1
- package/es-custom/components/date-picker/date-picker-input.d.ts +29 -11
- package/es-custom/components/date-picker/date-picker.d.ts +54 -22
- package/es-custom/components/dropdown/dropdown.d.ts +110 -44
- package/es-custom/components/feature-flags/index.js +1 -0
- package/es-custom/components/feature-flags/index.js.map +1 -1
- package/es-custom/components/file-uploader/file-uploader-button.d.ts +27 -11
- package/es-custom/components/file-uploader/file-uploader-drop-container.d.ts +27 -11
- package/es-custom/components/file-uploader/file-uploader.scss.js +1 -1
- package/es-custom/components/floating-menu/floating-menu.d.ts +56 -22
- package/es-custom/components/icon-button/icon-button.scss.js +1 -1
- package/es-custom/components/link/link.d.ts +29 -11
- package/es-custom/components/menu/menu-item-selectable.d.ts +2 -0
- package/es-custom/components/menu/menu-item.d.ts +54 -22
- package/es-custom/components/menu/menu.d.ts +27 -11
- package/es-custom/components/menu-button/menu-button.d.ts +27 -11
- package/es-custom/components/menu-button/menu-button.scss.js +1 -1
- package/es-custom/components/modal/modal-close-button.d.ts +29 -11
- package/es-custom/components/modal/modal.d.ts +27 -11
- package/es-custom/components/modal/modal.scss.js +1 -1
- package/es-custom/components/notification/actionable-notification.d.ts +27 -11
- package/es-custom/components/notification/actionable-notification.scss.js +1 -1
- package/es-custom/components/notification/inline-notification.d.ts +27 -11
- package/es-custom/components/notification/inline-notification.scss.js +1 -1
- package/es-custom/components/notification/toast-notification.d.ts +1 -1
- package/es-custom/components/notification/toast-notification.js +13 -15
- package/es-custom/components/notification/toast-notification.js.map +1 -1
- package/es-custom/components/notification/toast-notification.scss.js +1 -1
- package/es-custom/components/number-input/number-input.d.ts +2 -0
- package/es-custom/components/overflow-menu/overflow-menu-item.d.ts +29 -11
- package/es-custom/components/overflow-menu/overflow-menu.d.ts +54 -22
- package/es-custom/components/overflow-menu/overflow-menu.scss.js +1 -1
- package/es-custom/components/pagination/pagination.d.ts +56 -22
- package/es-custom/components/pagination/pagination.js +12 -7
- package/es-custom/components/pagination/pagination.js.map +1 -1
- package/es-custom/components/pagination/pagination.scss.js +1 -1
- package/es-custom/components/password-input/password-input.d.ts +2 -0
- package/es-custom/components/popover/defs.d.ts +13 -0
- package/es-custom/components/popover/defs.js +15 -1
- package/es-custom/components/popover/defs.js.map +1 -1
- package/es-custom/components/popover/popover-content.d.ts +13 -0
- package/es-custom/components/popover/popover-content.js +22 -0
- package/es-custom/components/popover/popover-content.js.map +1 -1
- package/es-custom/components/popover/popover.d.ts +37 -12
- package/es-custom/components/popover/popover.js +31 -3
- package/es-custom/components/popover/popover.js.map +1 -1
- package/es-custom/components/popover/popover.scss.js +1 -1
- package/es-custom/components/progress-indicator/progress-indicator.scss.js +1 -1
- package/es-custom/components/progress-indicator/progress-step.d.ts +29 -11
- package/es-custom/components/radio-button/radio-button-group.d.ts +54 -22
- package/es-custom/components/radio-button/radio-button.d.ts +56 -22
- package/es-custom/components/search/search.d.ts +83 -33
- package/es-custom/components/select/select.d.ts +29 -11
- package/es-custom/components/side-panel/side-panel.d.ts +27 -11
- package/es-custom/components/skip-to-content/skip-to-content.d.ts +29 -11
- package/es-custom/components/skip-to-content/skip-to-content.scss.js +1 -1
- package/es-custom/components/slider/slider-input.d.ts +29 -11
- package/es-custom/components/slider/slider.d.ts +83 -33
- package/es-custom/components/slug/slug.scss.js +1 -1
- package/es-custom/components/structured-list/structured-list-row.d.ts +27 -11
- package/es-custom/components/structured-list/structured-list.d.ts +29 -11
- package/es-custom/components/tabs/tabs.d.ts +27 -11
- package/es-custom/components/tabs/tabs.scss.js +1 -1
- package/es-custom/components/tag/dismissible-tag.d.ts +54 -22
- package/es-custom/components/tag/operational-tag.d.ts +54 -22
- package/es-custom/components/tag/selectable-tag.d.ts +54 -22
- package/es-custom/components/tag/tag.d.ts +54 -22
- package/es-custom/components/tag/tag.scss.js +1 -1
- package/es-custom/components/tearsheet/tearsheet.d.ts +27 -11
- package/es-custom/components/text-input/text-input.d.ts +56 -22
- package/es-custom/components/textarea/textarea.d.ts +2 -0
- package/es-custom/components/tile/expandable-tile.d.ts +54 -22
- package/es-custom/components/tile/selectable-tile.d.ts +56 -22
- package/es-custom/components/tile/tile-group.d.ts +27 -11
- package/es-custom/components/tile/tile.scss.js +1 -1
- package/es-custom/components/time-picker/time-picker-select.d.ts +29 -11
- package/es-custom/components/time-picker/time-picker.d.ts +56 -22
- package/es-custom/components/toggle/toggle.d.ts +27 -11
- package/es-custom/components/toggle-tip/toggletip.d.ts +56 -22
- package/es-custom/components/toggle-tip/toggletip.scss.js +1 -1
- package/es-custom/components/tooltip/tooltip.d.ts +27 -11
- package/es-custom/components/tooltip/tooltip.js +3 -0
- package/es-custom/components/tooltip/tooltip.js.map +1 -1
- package/es-custom/components/tooltip/tooltip.scss.js +1 -1
- package/es-custom/components/tree-view/tree-node.js +4 -4
- package/es-custom/components/tree-view/tree-node.js.map +1 -1
- package/es-custom/components/tree-view/tree-view.d.ts +27 -11
- package/es-custom/components/ui-shell/header-global-action.d.ts +2 -0
- package/es-custom/components/ui-shell/header-menu-button.d.ts +29 -11
- package/es-custom/components/ui-shell/header-menu.d.ts +56 -22
- package/es-custom/components/ui-shell/header-name.d.ts +29 -11
- package/es-custom/components/ui-shell/header-nav-item.d.ts +29 -11
- package/es-custom/components/ui-shell/header-panel.d.ts +2 -0
- package/es-custom/components/ui-shell/header.scss.js +1 -1
- package/es-custom/components/ui-shell/side-nav-link.d.ts +29 -11
- package/es-custom/components/ui-shell/side-nav-menu-item.d.ts +29 -11
- package/es-custom/components/ui-shell/side-nav-menu.d.ts +29 -11
- package/es-custom/components/ui-shell/side-nav.d.ts +27 -11
- package/es-custom/components/ui-shell/switcher-item.d.ts +29 -11
- package/es-custom/components/ui-shell/switcher.d.ts +2 -0
- package/es-custom/feature-flags/es/index.js +30 -2
- package/es-custom/feature-flags/es/index.js.map +1 -1
- package/es-custom/globals/mixins/focus.d.ts +27 -11
- package/es-custom/globals/mixins/form.d.ts +27 -11
- package/es-custom/globals/mixins/host-listener.d.ts +27 -11
- package/es-custom/globals/mixins/validity.d.ts +27 -11
- package/lib/components/accordion/accordion-item.d.ts +27 -11
- package/lib/components/button/button.d.ts +56 -22
- package/lib/components/checkbox/checkbox-group.d.ts +2 -0
- package/lib/components/checkbox/checkbox.d.ts +56 -22
- package/lib/components/code-snippet/code-snippet.d.ts +29 -11
- package/lib/components/combo-button/combo-button.d.ts +27 -11
- package/lib/components/content-switcher/content-switcher-item.d.ts +29 -11
- package/lib/components/copy-button/copy-button.d.ts +27 -11
- package/lib/components/data-table/table-expanded-row.d.ts +27 -11
- package/lib/components/data-table/table-header-cell.d.ts +29 -11
- package/lib/components/data-table/table-row.d.ts +54 -22
- package/lib/components/data-table/table-toolbar-search.d.ts +29 -11
- package/lib/components/data-table/table.d.ts +27 -11
- package/lib/components/date-picker/date-picker-input.d.ts +29 -11
- package/lib/components/date-picker/date-picker.d.ts +54 -22
- package/lib/components/dropdown/dropdown.d.ts +110 -44
- package/lib/components/file-uploader/file-uploader-button.d.ts +27 -11
- package/lib/components/file-uploader/file-uploader-drop-container.d.ts +27 -11
- package/lib/components/floating-menu/floating-menu.d.ts +56 -22
- package/lib/components/link/link.d.ts +29 -11
- package/lib/components/menu/menu-item-selectable.d.ts +2 -0
- package/lib/components/menu/menu-item.d.ts +54 -22
- package/lib/components/menu/menu.d.ts +27 -11
- package/lib/components/menu-button/menu-button.d.ts +27 -11
- package/lib/components/modal/modal-close-button.d.ts +29 -11
- package/lib/components/modal/modal.d.ts +27 -11
- package/lib/components/notification/actionable-notification.d.ts +27 -11
- package/lib/components/notification/inline-notification.d.ts +27 -11
- package/lib/components/notification/toast-notification.d.ts +1 -1
- package/lib/components/number-input/number-input.d.ts +2 -0
- package/lib/components/overflow-menu/overflow-menu-item.d.ts +29 -11
- package/lib/components/overflow-menu/overflow-menu.d.ts +54 -22
- package/lib/components/pagination/pagination.d.ts +56 -22
- package/lib/components/password-input/password-input.d.ts +2 -0
- package/lib/components/popover/defs.d.ts +13 -0
- package/lib/components/popover/defs.js +14 -0
- package/lib/components/popover/defs.js.map +1 -1
- package/lib/components/popover/popover-content.d.ts +13 -0
- package/lib/components/popover/popover.d.ts +37 -12
- package/lib/components/progress-indicator/progress-step.d.ts +29 -11
- package/lib/components/radio-button/radio-button-group.d.ts +54 -22
- package/lib/components/radio-button/radio-button.d.ts +56 -22
- package/lib/components/search/search.d.ts +83 -33
- package/lib/components/select/select.d.ts +29 -11
- package/lib/components/side-panel/side-panel.d.ts +27 -11
- package/lib/components/skip-to-content/skip-to-content.d.ts +29 -11
- package/lib/components/slider/slider-input.d.ts +29 -11
- package/lib/components/slider/slider.d.ts +83 -33
- package/lib/components/structured-list/structured-list-row.d.ts +27 -11
- package/lib/components/structured-list/structured-list.d.ts +29 -11
- package/lib/components/tabs/tabs.d.ts +27 -11
- package/lib/components/tag/dismissible-tag.d.ts +54 -22
- package/lib/components/tag/operational-tag.d.ts +54 -22
- package/lib/components/tag/selectable-tag.d.ts +54 -22
- package/lib/components/tag/tag.d.ts +54 -22
- package/lib/components/tearsheet/tearsheet.d.ts +27 -11
- package/lib/components/text-input/text-input.d.ts +56 -22
- package/lib/components/textarea/textarea.d.ts +2 -0
- package/lib/components/tile/expandable-tile.d.ts +54 -22
- package/lib/components/tile/selectable-tile.d.ts +56 -22
- package/lib/components/tile/tile-group.d.ts +27 -11
- package/lib/components/time-picker/time-picker-select.d.ts +29 -11
- package/lib/components/time-picker/time-picker.d.ts +56 -22
- package/lib/components/toggle/toggle.d.ts +27 -11
- package/lib/components/toggle-tip/toggletip.d.ts +56 -22
- package/lib/components/tooltip/tooltip.d.ts +27 -11
- package/lib/components/tree-view/tree-view.d.ts +27 -11
- package/lib/components/ui-shell/header-global-action.d.ts +2 -0
- package/lib/components/ui-shell/header-menu-button.d.ts +29 -11
- package/lib/components/ui-shell/header-menu.d.ts +56 -22
- package/lib/components/ui-shell/header-name.d.ts +29 -11
- package/lib/components/ui-shell/header-nav-item.d.ts +29 -11
- package/lib/components/ui-shell/header-panel.d.ts +2 -0
- package/lib/components/ui-shell/side-nav-link.d.ts +29 -11
- package/lib/components/ui-shell/side-nav-menu-item.d.ts +29 -11
- package/lib/components/ui-shell/side-nav-menu.d.ts +29 -11
- package/lib/components/ui-shell/side-nav.d.ts +27 -11
- package/lib/components/ui-shell/switcher-item.d.ts +29 -11
- package/lib/components/ui-shell/switcher.d.ts +2 -0
- package/lib/globals/mixins/focus.d.ts +27 -11
- package/lib/globals/mixins/form.d.ts +27 -11
- package/lib/globals/mixins/host-listener.d.ts +27 -11
- package/lib/globals/mixins/validity.d.ts +27 -11
- package/package.json +5 -5
- package/scss/components/modal/modal.scss +6 -0
- package/scss/components/popover/popover.scss +210 -9
- package/scss/components/tile/tile.scss +7 -7
- package/telemetry.yml +5 -1
- package/dist/button-Co3aPX0Y.js +0 -93
- package/dist/content-switcher-item-BDJMJLCb.js +0 -54
- package/dist/defs-CBJRLDfw.js +0 -28
- package/dist/floating-controller-CnuSelc_.js +0 -28
- package/dist/tooltip-content-BZBP-szv.js +0 -30
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2019, 2020
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
*
|
|
10
|
+
* This bundle contains the following third-party dependencies:
|
|
11
|
+
*
|
|
12
|
+
* Also refer to the following links for the license of other third-party dependencies:
|
|
13
|
+
*
|
|
14
|
+
* https://www.npmjs.com/package/tslib
|
|
15
|
+
* https://www.npmjs.com/package/lit
|
|
16
|
+
* https://www.npmjs.com/package/@lit/context
|
|
17
|
+
* https://www.npmjs.com/package/lodash-es
|
|
18
|
+
* https://www.npmjs.com/package/@floating-ui/dom
|
|
19
|
+
* https://www.npmjs.com/package/flatpickr
|
|
20
|
+
* https://www.npmjs.com/package/@carbon/icon-helpers
|
|
21
|
+
* https://www.npmjs.com/package/lit-html
|
|
22
|
+
* https://www.npmjs.com/package/lit-element
|
|
23
|
+
* https://www.npmjs.com/package/@lit/reactive-element
|
|
24
|
+
* https://www.npmjs.com/package/@floating-ui/utils
|
|
25
|
+
* https://www.npmjs.com/package/@floating-ui/core
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
var t,e;!function(t){t.TOP="top",t.TOP_LEFT="top-left",t.TOP_RIGHT="top-right",t.TOP_START="top-start",t.TOP_END="top-end",t.BOTTOM="bottom",t.BOTTOM_LEFT="bottom-left",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_START="bottom-start",t.BOTTOM_END="bottom-end",t.LEFT="left",t.LEFT_BOTTOM="left-bottom",t.LEFT_TOP="left-top",t.LEFT_START="left-start",t.LEFT_END="left-end",t.RIGHT="right",t.RIGHT_BOTTOM="right-bottom",t.RIGHT_TOP="right-top",t.RIGHT_START="right-start",t.RIGHT_END="right-end"}(t||(t={})),function(t){t.LAYER="layer",t.BACKGROUND="background"}(e||(e={}));const n=Math.min,o=Math.max,i=Math.round,r=Math.floor,l=t=>({x:t,y:t}),s={left:"right",right:"left",bottom:"top",top:"bottom"},a={start:"end",end:"start"};function c(t,e,i){return o(t,n(e,i))}function f(t,e){return"function"==typeof t?t(e):t}function u(t){return t.split("-")[0]}function d(t){return t.split("-")[1]}function h(t){return"y"===t?"height":"width"}function p(t){return["top","bottom"].includes(u(t))?"y":"x"}function m(t){return"x"===p(t)?"y":"x"}function g(t){return t.replace(/start|end/g,(t=>a[t]))}function y(t){return t.replace(/left|right|bottom|top/g,(t=>s[t]))}function w(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function x(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function b(t,e,n){let{reference:o,floating:i}=t;const r=p(e),l=m(e),s=h(l),a=u(e),c="y"===r,f=o.x+o.width/2-i.width/2,g=o.y+o.height/2-i.height/2,y=o[s]/2-i[s]/2;let w;switch(a){case"top":w={x:f,y:o.y-i.height};break;case"bottom":w={x:f,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y:g};break;case"left":w={x:o.x-i.width,y:g};break;default:w={x:o.x,y:o.y}}switch(d(e)){case"start":w[l]-=y*(n&&c?-1:1);break;case"end":w[l]+=y*(n&&c?-1:1)}return w}async function v(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:l,elements:s,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=f(e,t),m=w(p),g=s[h?"floating"===d?"reference":"floating":d],y=x(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:a})),b="floating"===d?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,v=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),T=await(null==r.isElement?void 0:r.isElement(v))&&await(null==r.getScale?void 0:r.getScale(v))||{x:1,y:1},R=x(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:v,strategy:a}):b);return{top:(y.top-R.top+m.top)/T.y,bottom:(R.bottom-y.bottom+m.bottom)/T.y,left:(y.left-R.left+m.left)/T.x,right:(R.right-y.right+m.right)/T.x}}function T(){return"undefined"!=typeof window}function R(t){return E(t)?(t.nodeName||"").toLowerCase():"#document"}function L(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function O(t){var e;return null==(e=(E(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function E(t){return!!T()&&(t instanceof Node||t instanceof L(t).Node)}function A(t){return!!T()&&(t instanceof Element||t instanceof L(t).Element)}function D(t){return!!T()&&(t instanceof HTMLElement||t instanceof L(t).HTMLElement)}function P(t){return!(!T()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof L(t).ShadowRoot)}function S(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=_(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function F(t){return["table","td","th"].includes(R(t))}function k(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function C(t){const e=B(),n=A(t)?_(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function B(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function H(t){return["html","body","#document"].includes(R(t))}function _(t){return L(t).getComputedStyle(t)}function M(t){return A(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function W(t){if("html"===R(t))return t;const e=t.assignedSlot||t.parentNode||P(t)&&t.host||O(t);return P(e)?e.host:e}function N(t){const e=W(t);return H(e)?t.ownerDocument?t.ownerDocument.body:t.body:D(e)&&S(e)?e:N(e)}function I(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=N(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=L(i);if(r){const t=G(l);return e.concat(l,l.visualViewport||[],S(i)?i:[],t&&n?I(t):[])}return e.concat(i,I(i,[],n))}function G(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function V(t){const e=_(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=D(t),l=r?t.offsetWidth:n,s=r?t.offsetHeight:o,a=i(n)!==l||i(o)!==s;return a&&(n=l,o=s),{width:n,height:o,$:a}}function $(t){return A(t)?t:t.contextElement}function z(t){const e=$(t);if(!D(e))return l(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:s}=V(e);let a=(s?i(n.width):n.width)/o,c=(s?i(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),c&&Number.isFinite(c)||(c=1),{x:a,y:c}}const U=l(0);function Y(t){const e=L(t);return B()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:U}function j(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=$(t);let s=l(1);e&&(o?A(o)&&(s=z(o)):s=z(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==L(t))&&e}(r,n,o)?Y(r):l(0);let c=(i.left+a.x)/s.x,f=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(r){const t=L(r),e=o&&A(o)?L(o):o;let n=t,i=G(n);for(;i&&o&&e!==n;){const t=z(i),e=i.getBoundingClientRect(),o=_(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;c*=t.x,f*=t.y,u*=t.x,d*=t.y,c+=r,f+=l,n=L(i),i=G(n)}}return x({width:u,height:d,x:c,y:f})}function q(t,e){const n=M(t).scrollLeft;return e?e.left+n:j(O(t)).left+n}function X(t,e,n){void 0===n&&(n=!1);const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-(n?0:q(t,o)),y:o.top+e.scrollTop}}function K(t,e,n){let i;if("viewport"===e)i=function(t,e){const n=L(t),o=O(t),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,a=0;if(i){r=i.width,l=i.height;const t=B();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,a=i.offsetTop)}return{width:r,height:l,x:s,y:a}}(t,n);else if("document"===e)i=function(t){const e=O(t),n=M(t),i=t.ownerDocument.body,r=o(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),l=o(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+q(t);const a=-n.scrollTop;return"rtl"===_(i).direction&&(s+=o(e.clientWidth,i.clientWidth)-r),{width:r,height:l,x:s,y:a}}(O(t));else if(A(e))i=function(t,e){const n=j(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=D(t)?z(t):l(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=Y(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return x(i)}function J(t,e){const n=W(t);return!(n===e||!A(n)||H(n))&&("fixed"===_(n).position||J(n,e))}function Q(t,e,n){const o=D(e),i=O(e),r="fixed"===n,s=j(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const c=l(0);if(o||!o&&!r)if(("body"!==R(e)||S(i))&&(a=M(e)),o){const t=j(e,!0,r,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else i&&(c.x=q(i));const f=!i||o||r?l(0):X(i,a);return{x:s.left+a.scrollLeft-c.x-f.x,y:s.top+a.scrollTop-c.y-f.y,width:s.width,height:s.height}}function Z(t){return"static"===_(t).position}function tt(t,e){if(!D(t)||"fixed"===_(t).position)return null;if(e)return e(t);let n=t.offsetParent;return O(t)===n&&(n=n.ownerDocument.body),n}function et(t,e){const n=L(t);if(k(t))return n;if(!D(t)){let e=W(t);for(;e&&!H(e);){if(A(e)&&!Z(e))return e;e=W(e)}return n}let o=tt(t,e);for(;o&&F(o)&&Z(o);)o=tt(o,e);return o&&H(o)&&Z(o)&&!C(o)?n:o||function(t){let e=W(t);for(;D(e)&&!H(e);){if(C(e))return e;if(k(e))return null;e=W(e)}return null}(t)||n}const nt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=O(o),a=!!e&&k(e.floating);if(o===s||a&&r)return n;let c={scrollLeft:0,scrollTop:0},f=l(1);const u=l(0),d=D(o);if((d||!d&&!r)&&(("body"!==R(o)||S(s))&&(c=M(o)),D(o))){const t=j(o);f=z(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const h=!s||d||r?l(0):X(s,c,!0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-c.scrollTop*f.y+u.y+h.y}},getDocumentElement:O,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:r,strategy:l}=t;const s=[..."clippingAncestors"===i?k(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=I(t,[],!1).filter((t=>A(t)&&"body"!==R(t))),i=null;const r="fixed"===_(t).position;let l=r?W(t):t;for(;A(l)&&!H(l);){const e=_(l),n=C(l);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||S(l)&&!n&&J(t,l))?o=o.filter((t=>t!==l)):i=e,l=W(l)}return e.set(t,o),o}(e,this._c):[].concat(i),r],a=s[0],c=s.reduce(((t,i)=>{const r=K(e,i,l);return t.top=o(r.top,t.top),t.right=n(r.right,t.right),t.bottom=n(r.bottom,t.bottom),t.left=o(r.left,t.left),t}),K(e,a,l));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:et,getElementRects:async function(t){const e=this.getOffsetParent||et,n=this.getDimensions,o=await n(t.floating);return{reference:Q(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=V(t);return{width:e,height:n}},getScale:z,isElement:A,isRTL:function(t){return"rtl"===_(t).direction}};function ot(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function it(t,e,i,l){void 0===l&&(l={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:f="function"==typeof IntersectionObserver,animationFrame:u=!1}=l,d=$(t),h=s||a?[...d?I(d):[],...I(e)]:[];h.forEach((t=>{s&&t.addEventListener("scroll",i,{passive:!0}),a&&t.addEventListener("resize",i)}));const p=d&&f?function(t,e){let i,l=null;const s=O(t);function a(){var t;clearTimeout(i),null==(t=l)||t.disconnect(),l=null}return function c(f,u){void 0===f&&(f=!1),void 0===u&&(u=1),a();const d=t.getBoundingClientRect(),{left:h,top:p,width:m,height:g}=d;if(f||e(),!m||!g)return;const y={rootMargin:-r(p)+"px "+-r(s.clientWidth-(h+m))+"px "+-r(s.clientHeight-(p+g))+"px "+-r(h)+"px",threshold:o(0,n(1,u))||1};let w=!0;function x(e){const n=e[0].intersectionRatio;if(n!==u){if(!w)return c();n?c(!1,n):i=setTimeout((()=>{c(!1,1e-7)}),1e3)}1!==n||ot(d,t.getBoundingClientRect())||c(),w=!1}try{l=new IntersectionObserver(x,{...y,root:s.ownerDocument})}catch(t){l=new IntersectionObserver(x,y)}l.observe(t)}(!0),a}(d,i):null;let m,g=-1,y=null;c&&(y=new ResizeObserver((t=>{let[n]=t;n&&n.target===d&&y&&(y.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(e)}))),i()})),d&&!u&&y.observe(d),y.observe(e));let w=u?j(t):null;return u&&function e(){const n=j(t);w&&!ot(w,n)&&i();w=n,m=requestAnimationFrame(e)}(),i(),()=>{var t;h.forEach((t=>{s&&t.removeEventListener("scroll",i),a&&t.removeEventListener("resize",i)})),null==p||p(),null==(t=y)||t.disconnect(),y=null,u&&cancelAnimationFrame(m)}}const rt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=e,a=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=u(n),s=d(n),a="y"===p(n),c=["left","top"].includes(l)?-1:1,h=r&&a?-1:1,m=f(e,t);let{mainAxis:g,crossAxis:y,alignmentAxis:w}="number"==typeof m?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return s&&"number"==typeof w&&(y="end"===s?-1*w:w),a?{x:y*h,y:g*c}:{x:g*c,y:y*h}}(e,t);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:l}}}}},lt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:s,platform:a,elements:c}=e,{mainAxis:w=!0,crossAxis:x=!0,fallbackPlacements:b,fallbackStrategy:T="bestFit",fallbackAxisSideDirection:R="none",flipAlignment:L=!0,...O}=f(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const E=u(i),A=p(s),D=u(s)===s,P=await(null==a.isRTL?void 0:a.isRTL(c.floating)),S=b||(D||!L?[y(s)]:function(t){const e=y(t);return[g(t),e,g(e)]}(s)),F="none"!==R;!b&&F&&S.push(...function(t,e,n,o){const i=d(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:l;default:return[]}}(u(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(g)))),r}(s,L,R,P));const k=[s,...S],C=await v(e,O),B=[];let H=(null==(o=r.flip)?void 0:o.overflows)||[];if(w&&B.push(C[E]),x){const t=function(t,e,n){void 0===n&&(n=!1);const o=d(t),i=m(t),r=h(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=y(l)),[l,y(l)]}(i,l,P);B.push(C[t[0]],C[t[1]])}if(H=[...H,{placement:i,overflows:B}],!B.every((t=>t<=0))){var _,M;const t=((null==(_=r.flip)?void 0:_.index)||0)+1,e=k[t];if(e)return{data:{index:t,overflows:H},reset:{placement:e}};let n=null==(M=H.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:M.placement;if(!n)switch(T){case"bestFit":{var W;const t=null==(W=H.filter((t=>{if(F){const e=p(t.placement);return e===A||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:W[0];t&&(n=t);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}},st=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:i,rects:r,platform:l,elements:s}=e,{apply:a=()=>{},...c}=f(t,e),h=await v(e,c),m=u(i),g=d(i),y="y"===p(i),{width:w,height:x}=r.floating;let b,T;"top"===m||"bottom"===m?(b=m,T=g===(await(null==l.isRTL?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(T=m,b="end"===g?"top":"bottom");const R=x-h.top-h.bottom,L=w-h.left-h.right,O=n(x-h[b],R),E=n(w-h[T],L),A=!e.middlewareData.shift;let D=O,P=E;if(y?P=g||A?n(E,L):L:D=g||A?n(O,R):R,A&&!g){const t=o(h.left,0),e=o(h.right,0),n=o(h.top,0),i=o(h.bottom,0);y?P=w-2*(0!==t||0!==e?t+e:o(h.left,h.right)):D=x-2*(0!==n||0!==i?n+i:o(h.top,h.bottom))}await a({...e,availableWidth:P,availableHeight:D});const S=await l.getDimensions(s.floating);return w!==S.width||x!==S.height?{reset:{rects:!0}}:{}}}},at=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:i,placement:r,rects:l,platform:s,elements:a,middlewareData:u}=e,{element:p,padding:g=0}=f(t,e)||{};if(null==p)return{};const y=w(g),x={x:o,y:i},b=m(r),v=h(b),T=await s.getDimensions(p),R="y"===b,L=R?"top":"left",O=R?"bottom":"right",E=R?"clientHeight":"clientWidth",A=l.reference[v]+l.reference[b]-x[b]-l.floating[v],D=x[b]-l.reference[b],P=await(null==s.getOffsetParent?void 0:s.getOffsetParent(p));let S=P?P[E]:0;S&&await(null==s.isElement?void 0:s.isElement(P))||(S=a.floating[E]||l.floating[v]);const F=A/2-D/2,k=S/2-T[v]/2-1,C=n(y[L],k),B=n(y[O],k),H=C,_=S-T[v]-B,M=S/2-T[v]/2+F,W=c(H,M,_),N=!u.arrow&&null!=d(r)&&M!==W&&l.reference[v]/2-(M<H?C:B)-T[v]/2<0,I=N?M<H?M-H:M-_:0;return{[b]:x[b]+I,data:{[b]:W,centerOffset:M-W-I,...N&&{alignmentOffset:I}},reset:N}}}),ct=(t,e,n)=>{const o=new Map,i={platform:nt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),a=await(null==l.isRTL?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=b(c,o,a),d=o,h={},p=0;for(let n=0;n<s.length;n++){const{name:r,fn:m}=s[n],{x:g,y:y,data:w,reset:x}=await m({x:f,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:h,rects:c,platform:l,elements:{reference:t,floating:e}});f=null!=g?g:f,u=null!=y?y:u,h={...h,[r]:{...h[r],...w}},x&&p<=50&&(p++,"object"==typeof x&&(x.placement&&(d=x.placement),x.rects&&(c=!0===x.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):x.rects),({x:f,y:u}=b(c,d,a))),n=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:h}})(t,e,{...i,platform:r})};class ft{constructor(t){this.updatePlacement=()=>{this.computePlacement()},this.host=t,t.addController(this)}async setPlacement(t=this.options){this.options=t;const{trigger:e,target:n}=t;this.cleanup=it(e,n,this.updatePlacement)}async computePlacement(){var t;const{arrowElement:e,alignment:n,caret:o,trigger:i,target:r,styleElement:l,matchWidth:s,open:a,flipArguments:c,alignmentAxisOffset:f}=this.options,u=null!=l?l:r;if(!u)return;let d;switch(n){case"top-left":d="top-start";break;case"top-right":d="top-end";break;case"bottom-left":d="bottom-start";break;case"bottom-right":d="bottom-end";break;case"left-bottom":d="left-end";break;case"left-top":d="left-start";break;case"right-bottom":d="right-end";break;case"right-top":d="right-start";break;default:d=n}const h=[lt(c),rt((null!=f?f:0)+(o?10:0)),...o&&e?[at({element:e,padding:15})]:[],...!s||"bottom"!==d&&"top"!==d?[st({apply({elements:t}){t.floating.style.removeProperty("width")}})]:[st({apply({rects:t,elements:e}){e.floating.style.width=`${t.reference.width}px`}})]];if(a){const{x:n,y:o,placement:r,middlewareData:l,strategy:s}=await ct(i,u,{strategy:"fixed",middleware:h,placement:d});if(u.style.left=`${n}px`,u.style.top=`${o}px`,u.style.position=`${s}`,e){const{x:t,y:n}=l.arrow,o={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]];e.style.left=null!=t?`${t}px`:"",e.style.top=null!=n?`${n}px`:"",e.style.right="",e.style.bottom="",e.style[o]=-e.offsetWidth/2+"px"}"CDS-AI-LABEL"!==this.host.tagName&&"CDS-SLUG"!==this.host.tagName||null===(t=this.host)||void 0===t||t.setAttribute("alignment",r)}}hostUpdated(){var t;this.host.hasAttribute("open")||(null===(t=this.cleanup)||void 0===t||t.call(this),this.cleanup=void 0)}hostDisconnected(){var t;null===(t=this.cleanup)||void 0===t||t.call(this),this.cleanup=void 0}}export{ft as F,t as P,e as a};
|