@carbon/web-components 2.58.0-rc.0 → 2.58.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.
Files changed (123) hide show
  1. package/es/components/accordion/accordion.scss.js +1 -1
  2. package/es/components/accordion/accordion.scss.js.map +1 -1
  3. package/es/components/ai-label/ai-label.scss.js +1 -1
  4. package/es/components/breadcrumb/breadcrumb.scss.js +1 -1
  5. package/es/components/button/button-set.d.ts +4 -0
  6. package/es/components/button/button-set.d.ts.map +1 -1
  7. package/es/components/button/button-set.js +4 -4
  8. package/es/components/button/button-set.js.map +1 -1
  9. package/es/components/button/button.scss.js +1 -1
  10. package/es/components/code-snippet/code-snippet.scss.js +1 -1
  11. package/es/components/combo-button/combo-button.scss.js +1 -1
  12. package/es/components/contained-list/contained-list.scss.js +1 -1
  13. package/es/components/content-switcher/content-switcher.scss.js +1 -1
  14. package/es/components/copy-button/copy-button.scss.js +1 -1
  15. package/es/components/data-table/data-table.scss.js +1 -1
  16. package/es/components/data-table/table-batch-actions.d.ts +8 -0
  17. package/es/components/data-table/table-batch-actions.d.ts.map +1 -1
  18. package/es/components/data-table/table-batch-actions.js +9 -8
  19. package/es/components/data-table/table-batch-actions.js.map +1 -1
  20. package/es/components/dialog/dialog.scss.js +1 -1
  21. package/es/components/file-uploader/file-uploader.scss.js +1 -1
  22. package/es/components/fluid-password-input/fluid-password-input.d.ts +1 -0
  23. package/es/components/fluid-password-input/fluid-password-input.d.ts.map +1 -1
  24. package/es/components/fluid-password-input/fluid-password-input.js +3 -2
  25. package/es/components/fluid-password-input/fluid-password-input.js.map +1 -1
  26. package/es/components/fluid-text-input/fluid-text-input.d.ts +1 -0
  27. package/es/components/fluid-text-input/fluid-text-input.d.ts.map +1 -1
  28. package/es/components/fluid-text-input/fluid-text-input.js +3 -2
  29. package/es/components/fluid-text-input/fluid-text-input.js.map +1 -1
  30. package/es/components/menu-button/menu-button.scss.js +1 -1
  31. package/es/components/modal/modal.scss.js +1 -1
  32. package/es/components/notification/actionable-notification.scss.js +1 -1
  33. package/es/components/notification/inline-notification.scss.js +1 -1
  34. package/es/components/notification/toast-notification.scss.js +1 -1
  35. package/es/components/overflow-menu/overflow-menu.d.ts +8 -0
  36. package/es/components/overflow-menu/overflow-menu.d.ts.map +1 -1
  37. package/es/components/overflow-menu/overflow-menu.js +10 -9
  38. package/es/components/overflow-menu/overflow-menu.js.map +1 -1
  39. package/es/components/overflow-menu/overflow-menu.scss.js +1 -1
  40. package/es/components/pagination/pagination.scss.js +1 -1
  41. package/es/components/pagination-nav/pagination-nav.scss.js +1 -1
  42. package/es/components/popover/popover.scss.js +1 -1
  43. package/es/components/progress-bar/progress-bar.d.ts +1 -0
  44. package/es/components/progress-bar/progress-bar.d.ts.map +1 -1
  45. package/es/components/progress-bar/progress-bar.js +4 -4
  46. package/es/components/progress-bar/progress-bar.js.map +1 -1
  47. package/es/components/progress-indicator/progress-indicator.scss.js +1 -1
  48. package/es/components/skip-to-content/skip-to-content.scss.js +1 -1
  49. package/es/components/slug/slug.scss.js +1 -1
  50. package/es/components/tabs/tabs.scss.js +1 -1
  51. package/es/components/tag/tag.scss.js +1 -1
  52. package/es/components/toggle-tip/toggletip.scss.js +1 -1
  53. package/es/components/tooltip/tooltip.scss.js +1 -1
  54. package/es/components/ui-shell/header.scss.js +1 -1
  55. package/es-custom/components/accordion/accordion.scss.js +1 -1
  56. package/es-custom/components/accordion/accordion.scss.js.map +1 -1
  57. package/es-custom/components/ai-label/ai-label.scss.js +1 -1
  58. package/es-custom/components/breadcrumb/breadcrumb.scss.js +1 -1
  59. package/es-custom/components/button/button-set.d.ts +4 -0
  60. package/es-custom/components/button/button-set.d.ts.map +1 -1
  61. package/es-custom/components/button/button-set.js +4 -4
  62. package/es-custom/components/button/button-set.js.map +1 -1
  63. package/es-custom/components/button/button.scss.js +1 -1
  64. package/es-custom/components/code-snippet/code-snippet.scss.js +1 -1
  65. package/es-custom/components/combo-button/combo-button.scss.js +1 -1
  66. package/es-custom/components/contained-list/contained-list.scss.js +1 -1
  67. package/es-custom/components/content-switcher/content-switcher.scss.js +1 -1
  68. package/es-custom/components/copy-button/copy-button.scss.js +1 -1
  69. package/es-custom/components/data-table/data-table.scss.js +1 -1
  70. package/es-custom/components/data-table/table-batch-actions.d.ts +8 -0
  71. package/es-custom/components/data-table/table-batch-actions.d.ts.map +1 -1
  72. package/es-custom/components/data-table/table-batch-actions.js +9 -8
  73. package/es-custom/components/data-table/table-batch-actions.js.map +1 -1
  74. package/es-custom/components/dialog/dialog.scss.js +1 -1
  75. package/es-custom/components/file-uploader/file-uploader.scss.js +1 -1
  76. package/es-custom/components/fluid-password-input/fluid-password-input.d.ts +1 -0
  77. package/es-custom/components/fluid-password-input/fluid-password-input.d.ts.map +1 -1
  78. package/es-custom/components/fluid-password-input/fluid-password-input.js +3 -2
  79. package/es-custom/components/fluid-password-input/fluid-password-input.js.map +1 -1
  80. package/es-custom/components/fluid-text-input/fluid-text-input.d.ts +1 -0
  81. package/es-custom/components/fluid-text-input/fluid-text-input.d.ts.map +1 -1
  82. package/es-custom/components/fluid-text-input/fluid-text-input.js +3 -2
  83. package/es-custom/components/fluid-text-input/fluid-text-input.js.map +1 -1
  84. package/es-custom/components/menu-button/menu-button.scss.js +1 -1
  85. package/es-custom/components/modal/modal.scss.js +1 -1
  86. package/es-custom/components/notification/actionable-notification.scss.js +1 -1
  87. package/es-custom/components/notification/inline-notification.scss.js +1 -1
  88. package/es-custom/components/notification/toast-notification.scss.js +1 -1
  89. package/es-custom/components/overflow-menu/overflow-menu.d.ts +8 -0
  90. package/es-custom/components/overflow-menu/overflow-menu.d.ts.map +1 -1
  91. package/es-custom/components/overflow-menu/overflow-menu.js +10 -9
  92. package/es-custom/components/overflow-menu/overflow-menu.js.map +1 -1
  93. package/es-custom/components/overflow-menu/overflow-menu.scss.js +1 -1
  94. package/es-custom/components/pagination/pagination.scss.js +1 -1
  95. package/es-custom/components/pagination-nav/pagination-nav.scss.js +1 -1
  96. package/es-custom/components/popover/popover.scss.js +1 -1
  97. package/es-custom/components/progress-bar/progress-bar.d.ts +1 -0
  98. package/es-custom/components/progress-bar/progress-bar.d.ts.map +1 -1
  99. package/es-custom/components/progress-bar/progress-bar.js +4 -4
  100. package/es-custom/components/progress-bar/progress-bar.js.map +1 -1
  101. package/es-custom/components/progress-indicator/progress-indicator.scss.js +1 -1
  102. package/es-custom/components/skip-to-content/skip-to-content.scss.js +1 -1
  103. package/es-custom/components/slug/slug.scss.js +1 -1
  104. package/es-custom/components/tabs/tabs.scss.js +1 -1
  105. package/es-custom/components/tag/tag.scss.js +1 -1
  106. package/es-custom/components/toggle-tip/toggletip.scss.js +1 -1
  107. package/es-custom/components/tooltip/tooltip.scss.js +1 -1
  108. package/es-custom/components/ui-shell/header.scss.js +1 -1
  109. package/lib/components/button/button-set.d.ts +4 -0
  110. package/lib/components/button/button-set.d.ts.map +1 -1
  111. package/lib/components/data-table/table-batch-actions.d.ts +8 -0
  112. package/lib/components/data-table/table-batch-actions.d.ts.map +1 -1
  113. package/lib/components/fluid-password-input/fluid-password-input.d.ts +1 -0
  114. package/lib/components/fluid-password-input/fluid-password-input.d.ts.map +1 -1
  115. package/lib/components/fluid-text-input/fluid-text-input.d.ts +1 -0
  116. package/lib/components/fluid-text-input/fluid-text-input.d.ts.map +1 -1
  117. package/lib/components/overflow-menu/overflow-menu.d.ts +8 -0
  118. package/lib/components/overflow-menu/overflow-menu.d.ts.map +1 -1
  119. package/lib/components/progress-bar/progress-bar.d.ts +1 -0
  120. package/lib/components/progress-bar/progress-bar.d.ts.map +1 -1
  121. package/package.json +6 -6
  122. package/scss/components/accordion/accordion.scss +32 -28
  123. package/scss/components/grid/grid-story.scss +1 -0
@@ -21,7 +21,7 @@ import icon_button_default from "../icon-button/icon-button.scss.js";
21
21
  import overflow_menu_default$1 from "./overflow-menu.scss.js";
22
22
  import icon_button_default$1 from "../icon-button/icon-button.js";
23
23
  import { adoptStyles, html } from "lit";
24
- import { property } from "lit/decorators.js";
24
+ import { property, query } from "lit/decorators.js";
25
25
  //#region src/components/overflow-menu/overflow-menu.ts
26
26
  /**
27
27
  * Copyright IBM Corp. 2019, 2026
@@ -151,7 +151,7 @@ let CDSOverflowMenu = class CDSOverflowMenu extends HostListenerMixin(FocusMixin
151
151
  updated(changedProperties) {
152
152
  super.updated(changedProperties);
153
153
  const menuCompositionEnabled = this._isMenuCompositionEnabled();
154
- const button = this.shadowRoot?.querySelector(`cds-tooltip`)?.querySelector("button");
154
+ const button = this._tooltip?.querySelector("button");
155
155
  button?.classList.add(`cds--btn--icon-only`, `cds--overflow-menu`);
156
156
  if (changedProperties.has("open")) {
157
157
  if (!menuCompositionEnabled) {
@@ -172,15 +172,15 @@ let CDSOverflowMenu = class CDSOverflowMenu extends HostListenerMixin(FocusMixin
172
172
  this._menuController.hostDisconnected();
173
173
  this._resetMenuChildFloatingStyles({ closeMenu: true });
174
174
  }
175
- if (changedProperties.has("dataTable")) (this.shadowRoot?.querySelector(`cds-tooltip`))?.toggleAttribute("data-table", this.dataTable);
175
+ if (changedProperties.has("dataTable")) this._tooltip?.toggleAttribute("data-table", this.dataTable);
176
176
  if (changedProperties.has("size")) {
177
177
  button?.classList.forEach((item) => {
178
178
  if (item.startsWith(`cds--overflow-menu--`)) button?.classList.remove(item);
179
179
  });
180
180
  button?.classList.add(`cds--overflow-menu--${this.size}`);
181
- (this.shadowRoot?.querySelector(`cds-tooltip`))?.setAttribute("size", this.size);
181
+ this._tooltip?.setAttribute("size", this.size);
182
182
  }
183
- if (changedProperties.has("toolbarAction") && this.toolbarAction) this.shadowRoot?.querySelector(`cds-tooltip`)?.setAttribute("toolbar-action", "");
183
+ if (changedProperties.has("toolbarAction") && this.toolbarAction) this._tooltip?.setAttribute("toolbar-action", "");
184
184
  const labelText = this._getLabelText();
185
185
  const popupId = menuCompositionEnabled ? this._getMenuChild()?.id ?? this._menuId : this._menuBody?.id;
186
186
  button?.setAttribute("aria-haspopup", "menu");
@@ -199,7 +199,7 @@ let CDSOverflowMenu = class CDSOverflowMenu extends HostListenerMixin(FocusMixin
199
199
  return this.querySelector("[slot=tooltip-content]")?.textContent?.trim() || "Options";
200
200
  }
201
201
  _getTriggerButton() {
202
- return this.shadowRoot?.querySelector(`cds-tooltip`)?.querySelector("button");
202
+ return this._tooltip?.querySelector("button");
203
203
  }
204
204
  _isTriggerEvent(event) {
205
205
  const triggerButton = this._getTriggerButton();
@@ -327,14 +327,15 @@ let CDSOverflowMenu = class CDSOverflowMenu extends HostListenerMixin(FocusMixin
327
327
  * Suppresses trigger tooltip interactions while the menu is open.
328
328
  */
329
329
  _syncTriggerTooltipState() {
330
- const tooltip = this.shadowRoot?.querySelector(`cds-tooltip`);
331
- const tooltipContent = this.shadowRoot?.querySelector(`cds-tooltip-content`);
330
+ const tooltip = this._tooltip;
332
331
  if (!tooltip) return;
333
332
  tooltip.keyboardOnly = this.open;
334
- tooltipContent?.toggleAttribute("hidden", this.disabled || this.open);
333
+ this._tooltipContent?.toggleAttribute("hidden", this.disabled || this.open);
335
334
  if (this.open) tooltip.open = false;
336
335
  }
337
336
  };
337
+ __decorate([query(`cds-tooltip`)], CDSOverflowMenu.prototype, "_tooltip", void 0);
338
+ __decorate([query(`cds-tooltip-content`)], CDSOverflowMenu.prototype, "_tooltipContent", void 0);
338
339
  __decorate([property({
339
340
  type: Boolean,
340
341
  reflect: true,
@@ -1 +1 @@
1
- {"version":3,"file":"overflow-menu.js","names":["CDSIconButton","FloatingUIController","iconButtonStyles","styles","CDSMenu","customElement"],"sources":["../../../src/components/overflow-menu/overflow-menu.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { adoptStyles, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport { find } from '../../globals/internal/collection-helpers';\nimport CDSFloatingMenuTrigger from '../floating-menu/floating-menu-trigger';\nimport { OVERFLOW_MENU_SIZE } from './defs';\nimport CDSOverflowMenuBody from './overflow-menu-body';\nimport '../menu/index';\nimport CDSMenu from '../menu/menu';\nimport { MENU_SIZE } from '../menu/defs';\nimport { isFeatureFlagEnabled } from '../feature-flags/index';\nimport FloatingUIController from '../../globals/controllers/floating-controller';\n\nimport iconButtonStyles from '../icon-button/icon-button.scss?lit';\nimport styles from './overflow-menu.scss?lit';\nimport CDSIconButton from '../icon-button/icon-button';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { OVERFLOW_MENU_SIZE };\n\nconst menuItemTagPrefix = `${prefix}-menu-item`.toUpperCase();\n\n// Migration support for existing child structure.\nconst deprecatedOverflowMenuTagNames = new Set([\n `${prefix}-overflow-menu-body`.toUpperCase(),\n `${prefix}-overflow-menu-item`.toUpperCase(),\n]);\n\nconst bottomFirstFallbackPlacements = [\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n] as const;\n\nconst topFirstFallbackPlacements = [\n 'top-start',\n 'top-end',\n 'bottom-start',\n 'bottom-end',\n] as const;\n\nconst warnInDev = (message: string) => {\n if (process.env.NODE_ENV === 'development') {\n globalThis.console?.warn(message);\n }\n};\n\n/**\n * Overflow menu.\n *\n * @element cds-overflow-menu\n * @slot icon - The icon for the trigger button.\n */\n@customElement(`${prefix}-overflow-menu`)\nclass CDSOverflowMenu\n extends HostListenerMixin(FocusMixin(CDSIconButton))\n implements CDSFloatingMenuTrigger\n{\n private _menuController = new FloatingUIController(this);\n\n /**\n * The menu body.\n */\n private _menuBody: CDSOverflowMenuBody | null = null;\n\n /**\n * The identifier used by the popup surface.\n */\n private _menuId = `${prefix}-overflow-menu-${Math.random()\n .toString(16)\n .slice(2)}`;\n\n /**\n * Ensures the deprecated-child warning only fires once.\n */\n private _didWarnDeprecatedChildren = false;\n\n /**\n * Ensures the invalid menu composition warning only fires once.\n */\n private _didWarnInvalidComposition = false;\n\n /**\n * Monotonic token used to ignore stale async menu sync callbacks.\n */\n private _menuSyncToken = 0;\n\n /**\n * Handles user-initiated toggling of the menu.\n */\n private async _handleUserInitiatedToggle() {\n if (this.disabled) {\n return;\n }\n\n this.open = !this.open;\n const { index, open, updateComplete } = this;\n if (open) {\n await updateComplete;\n\n if (this._isMenuCompositionEnabled()) {\n await this._focusManagedMenuItem(index);\n return;\n }\n\n const { _menuBody: menuBody } = this;\n const menuItem = menuBody?.querySelector(\n `${prefix}-overflow-menu-item:nth-of-type(${index})`\n ) as HTMLElement;\n menuItem?.focus();\n }\n }\n\n /**\n * Handles `click` event on the trigger button.\n */\n private _handleClickTrigger = async (event: MouseEvent) => {\n if (this._isTriggerEvent(event)) {\n this._handleUserInitiatedToggle();\n return;\n }\n\n if (\n !this._isMenuCompositionEnabled() &&\n this._isDeprecatedOverflowMenuItemEvent(event)\n ) {\n this.open = false;\n }\n };\n\n /**\n * Handles `keydown` event on the trigger button.\n */\n private _handleKeydownTrigger = async (event: KeyboardEvent) => {\n if (!this._isTriggerEvent(event)) {\n return;\n }\n\n if (event.key === ' ' || event.key === 'Enter') {\n this._handleUserInitiatedToggle();\n event.preventDefault();\n }\n };\n\n /**\n * Prevents the trigger click from immediately re-opening the menu after blur.\n */\n private _handleMousedownTrigger = (event: MouseEvent) => {\n if (this._isMenuCompositionEnabled() && this._isTriggerEvent(event)) {\n event.preventDefault();\n }\n };\n\n /**\n * Handles close requests emitted by the managed menu.\n */\n private _handleManagedMenuClose = (\n event: CustomEvent<{ triggerEventType?: string }>\n ) => {\n const menu = this._getMenuChild();\n if (\n !this._isMenuCompositionEnabled() ||\n !menu ||\n event.composedPath()[0] !== menu\n ) {\n return;\n }\n\n this.open = false;\n\n if (event.detail?.triggerEventType !== 'focusout') {\n requestAnimationFrame(() => {\n this._getTriggerButton()?.focus();\n });\n }\n };\n\n /**\n * `true` if this tooltip is in a data table row\n */\n @property({ type: Boolean, reflect: true, attribute: 'data-table' })\n dataTable = false;\n\n /**\n * `true` if this overflow menu should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Enables the menu-composition OverflowMenu implementation leveraging `cds-menu`.\n */\n @property({\n type: Boolean,\n reflect: true,\n attribute: 'enable-v12-overflowmenu',\n })\n enableV12Overflowmenu = false;\n\n /**\n * `true` if this overflow menu body should be flipped.\n */\n @property({ type: Boolean, reflect: true })\n flipped = false;\n\n /**\n * Experimental property. Enables automatic menu placement flipping to avoid clipping.\n */\n @property({ type: Boolean, reflect: true })\n autoalign = false;\n\n /**\n * `true` if the dropdown should be open.\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Index (starting at 1) of overflow menu item to focus on open.\n */\n @property()\n index = 1;\n\n /**\n * A label describing the menu options. Used for the trigger tooltip and the menu's accessible label.\n */\n @property({ type: String })\n label = '';\n\n /**\n * Specify how the menu should align with the trigger button.\n * Valid values: 'bottom-start', 'bottom-end', 'top-start', 'top-end'\n */\n @property({ type: String, attribute: 'menu-alignment' })\n menuAlignment: string = 'bottom-start';\n\n /**\n * Overflow menu size.\n */\n @property({ reflect: true })\n size = OVERFLOW_MENU_SIZE.MEDIUM;\n\n /**\n * `true` if this menu is a toolbar action\n */\n @property({ type: Boolean, attribute: 'toolbar-action', reflect: true })\n toolbarAction = false;\n\n /**\n * `true` if this overflow menu use inside breadcrumb.\n */\n @property({ type: Boolean, reflect: true })\n breadcrumb = false;\n\n /**\n * @returns The position of the trigger button in the viewport.\n */\n get triggerPosition() {\n return this.getBoundingClientRect();\n }\n\n connectedCallback() {\n if (!this.hasAttribute('aria-haspopup')) {\n this.setAttribute('aria-haspopup', 'true');\n }\n if (!this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n super.connectedCallback();\n\n adoptStyles(this.renderRoot as ShadowRoot, [iconButtonStyles, styles]);\n\n this.addEventListener(\n CDSMenu.eventOnClose,\n this._handleManagedMenuClose as EventListener\n );\n this.addEventListener('click', this._handleClickTrigger);\n this.addEventListener('keydown', this._handleKeydownTrigger);\n this.addEventListener('mousedown', this._handleMousedownTrigger);\n }\n\n disconnectedCallback() {\n this.removeEventListener(\n CDSMenu.eventOnClose,\n this._handleManagedMenuClose as EventListener\n );\n this.removeEventListener('click', this._handleClickTrigger);\n this.removeEventListener('keydown', this._handleKeydownTrigger);\n this.removeEventListener('mousedown', this._handleMousedownTrigger);\n super.disconnectedCallback();\n }\n\n protected _renderTooltipContent() {\n const tooltipLabel = this._getLabelText();\n\n if (this.label || !this.querySelector('[slot=tooltip-content]')) {\n return html`\n <cds-tooltip-content ?hidden=${this.disabled || this.open}>\n ${tooltipLabel}\n </cds-tooltip-content>\n `;\n }\n\n return super._renderTooltipContent();\n }\n\n updated(changedProperties) {\n super.updated(changedProperties);\n const menuCompositionEnabled = this._isMenuCompositionEnabled();\n\n const button = this.shadowRoot\n ?.querySelector(`${prefix}-tooltip`)\n ?.querySelector('button');\n button?.classList.add(\n `${prefix}--btn--icon-only`,\n `${prefix}--overflow-menu`\n );\n\n if (changedProperties.has('open')) {\n if (!menuCompositionEnabled) {\n this._menuController.hostDisconnected();\n this._resetMenuChildFloatingStyles();\n const { open } = this;\n if (open && !this._menuBody) {\n this._menuBody = find(\n this.childNodes,\n (elem) =>\n (elem.constructor as typeof CDSOverflowMenuBody).FLOATING_MENU\n );\n }\n const { _menuBody: menuBody, size } = this;\n if (menuBody) {\n menuBody.id ||= this._menuId;\n menuBody.setAttribute('breadcrumb', String(this.breadcrumb));\n menuBody.open = open;\n menuBody.size = size;\n }\n }\n }\n\n if (\n changedProperties.has('enableV12Overflowmenu') &&\n !menuCompositionEnabled\n ) {\n this._menuController.hostDisconnected();\n this._resetMenuChildFloatingStyles({ closeMenu: true });\n }\n\n if (changedProperties.has('dataTable')) {\n const tooltip = this.shadowRoot?.querySelector(`${prefix}-tooltip`);\n tooltip?.toggleAttribute('data-table', this.dataTable);\n }\n\n if (changedProperties.has('size')) {\n button?.classList.forEach((item) => {\n if (item.startsWith(`${prefix}--overflow-menu--`)) {\n button?.classList.remove(item);\n }\n });\n button?.classList.add(`${prefix}--overflow-menu--${this.size}`);\n\n const tooltip = this.shadowRoot?.querySelector(`${prefix}-tooltip`);\n tooltip?.setAttribute('size', this.size);\n }\n\n if (changedProperties.has('toolbarAction') && this.toolbarAction) {\n this.shadowRoot\n ?.querySelector(`${prefix}-tooltip`)\n ?.setAttribute('toolbar-action', '');\n }\n\n const labelText = this._getLabelText();\n const popupId = menuCompositionEnabled\n ? (this._getMenuChild()?.id ?? this._menuId)\n : this._menuBody?.id;\n\n button?.setAttribute('aria-haspopup', 'menu');\n button?.setAttribute('aria-expanded', String(this.open));\n button?.setAttribute('aria-label', labelText);\n\n if (this.open && popupId) {\n button?.setAttribute('aria-controls', popupId);\n } else {\n button?.removeAttribute('aria-controls');\n }\n\n const shouldSyncMenuChild =\n menuCompositionEnabled &&\n (changedProperties.has('open') ||\n changedProperties.has('label') ||\n changedProperties.has('autoalign') ||\n changedProperties.has('menuAlignment') ||\n changedProperties.has('size') ||\n changedProperties.has('enableV12Overflowmenu'));\n\n if (shouldSyncMenuChild) {\n this._syncMenuChild();\n }\n\n if (changedProperties.has('open') || changedProperties.has('disabled')) {\n this._syncTriggerTooltipState();\n }\n }\n\n render() {\n return html`${super.render()} `;\n }\n\n private _getLabelText() {\n if (this.label) return this.label;\n\n const tooltipContent = this.querySelector(\n '[slot=tooltip-content]'\n )?.textContent?.trim();\n\n return tooltipContent || 'Options';\n }\n\n private _getTriggerButton() {\n return this.shadowRoot\n ?.querySelector(`${prefix}-tooltip`)\n ?.querySelector('button') as HTMLButtonElement | null;\n }\n\n private _isTriggerEvent(event: Event) {\n const triggerButton = this._getTriggerButton();\n\n return !!triggerButton && event.composedPath().includes(triggerButton);\n }\n\n private _isDeprecatedOverflowMenuItemEvent(event: Event) {\n return event\n .composedPath()\n .some(\n (entry) =>\n entry instanceof HTMLElement &&\n deprecatedOverflowMenuTagNames.has(entry.tagName)\n );\n }\n\n /**\n * Checks whether the menu-composition path is enabled.\n */\n private _isMenuCompositionEnabled() {\n return (\n this.enableV12Overflowmenu ||\n isFeatureFlagEnabled('enable-v12-overflowmenu', this)\n );\n }\n\n /**\n * Checks whether floating styles should be driven by Floating UI.\n */\n private _usesDynamicFloatingStyles() {\n return (\n this.autoalign ||\n isFeatureFlagEnabled('enable-v12-dynamic-floating-styles', this)\n );\n }\n\n private _getMenuChild() {\n return (Array.from(this.children).find((child) => {\n return child.tagName === `${prefix}-menu`.toUpperCase();\n }) ?? null) as CDSMenu | null;\n }\n\n private _warnDeprecatedChildren() {\n if (this._didWarnDeprecatedChildren) {\n return;\n }\n\n // Migration guard for flagged usage of deprecated overflow-menu children.\n const hasDeprecatedChildren = Array.from(this.children).some((child) => {\n return deprecatedOverflowMenuTagNames.has(child.tagName);\n });\n\n if (hasDeprecatedChildren) {\n warnInDev(\n '`cds-overflow-menu` with `enable-v12-overflowmenu` expects a direct `cds-menu` child instead of the deprecated `cds-overflow-menu-body` structure.'\n );\n this._didWarnDeprecatedChildren = true;\n }\n }\n\n private _warnInvalidMenuComposition() {\n if (this._didWarnInvalidComposition) {\n return;\n }\n\n const hasDirectMenuItems = Array.from(this.children).some((child) =>\n child.tagName.startsWith(menuItemTagPrefix)\n );\n const hasMenuChild = !!this._getMenuChild();\n\n if (!hasMenuChild || hasDirectMenuItems) {\n warnInDev(\n '`cds-overflow-menu` with `enable-v12-overflowmenu` expects a direct `cds-menu` child. Place `cds-menu-item*` descendants inside that `cds-menu`.'\n );\n this._didWarnInvalidComposition = true;\n }\n }\n\n private _syncMenuChild() {\n const menuSyncToken = ++this._menuSyncToken;\n\n this._warnDeprecatedChildren();\n this._warnInvalidMenuComposition();\n\n const menu = this._getMenuChild();\n if (!menu) {\n return;\n }\n\n const menuAlignment = this.menuAlignment;\n\n menu.id ||= this._menuId;\n menu.label = this._getLabelText();\n menu.menuAlignment = menuAlignment;\n this._syncMenuChildPosition(menu);\n menu.open = this.open;\n menu.size = this._toMenuSize(this.size);\n\n const shouldUseFloatingStyles = this._usesDynamicFloatingStyles();\n\n if (!this.open || !shouldUseFloatingStyles) {\n this._menuController.hostDisconnected();\n this._resetMenuFloatingStyles(menu);\n return;\n }\n\n this.updateComplete.then(async () => {\n if (\n menuSyncToken !== this._menuSyncToken ||\n !this.open ||\n !this._isMenuCompositionEnabled() ||\n this._getMenuChild() !== menu\n ) {\n return;\n }\n\n await menu.updateComplete;\n if (\n menuSyncToken !== this._menuSyncToken ||\n !this.open ||\n !this._isMenuCompositionEnabled() ||\n this._getMenuChild() !== menu\n ) {\n return;\n }\n\n const trigger = this._getTriggerButton();\n if (!trigger) {\n return;\n }\n\n const styleElement = menu.shadowRoot?.querySelector(\n `.${prefix}--menu`\n ) as HTMLElement | undefined;\n\n const fallbackPlacements = menuAlignment.includes('bottom')\n ? [...bottomFirstFallbackPlacements]\n : [...topFirstFallbackPlacements];\n\n const flipArguments = this.autoalign\n ? {\n fallbackPlacements,\n }\n : {\n mainAxis: false,\n crossAxis: false,\n };\n\n this._menuController.setPlacement({\n trigger,\n target: menu,\n alignment: menuAlignment,\n styleElement,\n flipArguments,\n mainAxisOffset: 0,\n open: this.open,\n });\n });\n }\n\n private _syncMenuChildPosition(menu: CDSMenu) {\n const trigger = this._getTriggerButton();\n if (!trigger) {\n return;\n }\n\n const { left, right, top, bottom } = trigger.getBoundingClientRect();\n menu.x = [left, right];\n menu.y = [top, bottom];\n }\n\n private _toMenuSize(size: OVERFLOW_MENU_SIZE | string): CDSMenu['size'] {\n switch (size) {\n case OVERFLOW_MENU_SIZE.EXTRA_SMALL:\n return MENU_SIZE.EXTRA_SMALL;\n case OVERFLOW_MENU_SIZE.SMALL:\n return MENU_SIZE.SMALL;\n case OVERFLOW_MENU_SIZE.MEDIUM:\n return MENU_SIZE.MEDIUM;\n case OVERFLOW_MENU_SIZE.LARGE:\n return MENU_SIZE.LARGE;\n default:\n return MENU_SIZE.MEDIUM;\n }\n }\n\n private async _focusManagedMenuItem(index: number) {\n const menu = this._getMenuChild();\n if (!menu) {\n return;\n }\n\n await menu.updateComplete;\n\n if (!this.open || this._getMenuChild() !== menu) {\n return;\n }\n\n const enabledItems = menu.activeitems\n .map(({ item }) => item)\n .filter(\n (item) => item instanceof HTMLElement && !item.hasAttribute('disabled')\n );\n const focusTarget = enabledItems[index - 1] ?? enabledItems[0];\n\n focusTarget?.focus();\n }\n\n private _resetMenuChildFloatingStyles({\n closeMenu = false,\n }: { closeMenu?: boolean } = {}) {\n const menu = this._getMenuChild();\n if (!menu) {\n return;\n }\n\n this._resetMenuFloatingStyles(menu);\n\n if (closeMenu) {\n menu.open = false;\n }\n }\n\n private _resetMenuFloatingStyles(menu: CDSMenu) {\n const menuSurface = menu.shadowRoot?.querySelector(`.${prefix}--menu`) as\n | HTMLElement\n | undefined;\n\n if (!menuSurface) {\n return;\n }\n\n menuSurface.style.removeProperty('left');\n menuSurface.style.removeProperty('top');\n menuSurface.style.removeProperty('position');\n menuSurface.style.removeProperty('visibility');\n menuSurface.removeAttribute('align');\n }\n\n /**\n * Suppresses trigger tooltip interactions while the menu is open.\n */\n private _syncTriggerTooltipState() {\n const tooltip = this.shadowRoot?.querySelector(`${prefix}-tooltip`) as\n | (HTMLElement & { open?: boolean; keyboardOnly?: boolean })\n | null;\n const tooltipContent = this.shadowRoot?.querySelector(\n `${prefix}-tooltip-content`\n ) as HTMLElement | null;\n\n if (!tooltip) {\n return;\n }\n\n tooltip.keyboardOnly = this.open;\n tooltipContent?.toggleAttribute('hidden', this.disabled || this.open);\n\n if (this.open) {\n tooltip.open = false;\n }\n }\n}\n\nexport default CDSOverflowMenu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,oBAAoB,gBAAsB,YAAY;AAG5D,MAAM,iCAAiC,IAAI,IAAI,CAC7C,yBAA+B,YAAY,GAC3C,yBAA+B,YAAY,CAC7C,CAAC;AAED,MAAM,gCAAgC;CACpC;CACA;CACA;CACA;AACF;AAEA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AAA,CAAA;YAMtD,SAAS,EAAE,SAAS,KAAK,CAAC,CAAA,GAAA,gBAAA,WAAA,QAAA,KAAA,CAAA;YAM1B,SAAS;CAAE,MAAM;CAAS,WAAW;CAAkB,SAAS;AAAK,CAAC,CAAA,GAAA,gBAAA,WAAA,iBAAA,KAAA,CAAA;YAMtE,SAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,gBAAA,WAAA,cAAA,KAAA,CAAA;8BAtM3CC,cAAc,mBAAyB,CAAA,GAAA,eAAA;AA0nBxC,IAAA,wBAAe"}
1
+ {"version":3,"file":"overflow-menu.js","names":["CDSIconButton","FloatingUIController","iconButtonStyles","styles","CDSMenu","customElement"],"sources":["../../../src/components/overflow-menu/overflow-menu.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { adoptStyles, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport { find } from '../../globals/internal/collection-helpers';\nimport CDSFloatingMenuTrigger from '../floating-menu/floating-menu-trigger';\nimport { OVERFLOW_MENU_SIZE } from './defs';\nimport CDSOverflowMenuBody from './overflow-menu-body';\nimport '../menu/index';\nimport CDSMenu from '../menu/menu';\nimport { MENU_SIZE } from '../menu/defs';\nimport { isFeatureFlagEnabled } from '../feature-flags/index';\nimport FloatingUIController from '../../globals/controllers/floating-controller';\n\nimport iconButtonStyles from '../icon-button/icon-button.scss?lit';\nimport styles from './overflow-menu.scss?lit';\nimport CDSIconButton from '../icon-button/icon-button';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { OVERFLOW_MENU_SIZE };\n\nconst menuItemTagPrefix = `${prefix}-menu-item`.toUpperCase();\n\n// Migration support for existing child structure.\nconst deprecatedOverflowMenuTagNames = new Set([\n `${prefix}-overflow-menu-body`.toUpperCase(),\n `${prefix}-overflow-menu-item`.toUpperCase(),\n]);\n\nconst bottomFirstFallbackPlacements = [\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n] as const;\n\nconst topFirstFallbackPlacements = [\n 'top-start',\n 'top-end',\n 'bottom-start',\n 'bottom-end',\n] as const;\n\nconst warnInDev = (message: string) => {\n if (process.env.NODE_ENV === 'development') {\n globalThis.console?.warn(message);\n }\n};\n\n/**\n * Overflow menu.\n *\n * @element cds-overflow-menu\n * @slot icon - The icon for the trigger button.\n */\n@customElement(`${prefix}-overflow-menu`)\nclass CDSOverflowMenu\n extends HostListenerMixin(FocusMixin(CDSIconButton))\n implements CDSFloatingMenuTrigger\n{\n private _menuController = new FloatingUIController(this);\n\n /**\n * The tooltip element in the shadow DOM.\n */\n @query(`${prefix}-tooltip`)\n private _tooltip?: HTMLElement;\n\n /**\n * The tooltip content element in the shadow DOM.\n */\n @query(`${prefix}-tooltip-content`)\n private _tooltipContent?: HTMLElement;\n\n /**\n * The menu body.\n */\n private _menuBody: CDSOverflowMenuBody | null = null;\n\n /**\n * The identifier used by the popup surface.\n */\n private _menuId = `${prefix}-overflow-menu-${Math.random()\n .toString(16)\n .slice(2)}`;\n\n /**\n * Ensures the deprecated-child warning only fires once.\n */\n private _didWarnDeprecatedChildren = false;\n\n /**\n * Ensures the invalid menu composition warning only fires once.\n */\n private _didWarnInvalidComposition = false;\n\n /**\n * Monotonic token used to ignore stale async menu sync callbacks.\n */\n private _menuSyncToken = 0;\n\n /**\n * Handles user-initiated toggling of the menu.\n */\n private async _handleUserInitiatedToggle() {\n if (this.disabled) {\n return;\n }\n\n this.open = !this.open;\n const { index, open, updateComplete } = this;\n if (open) {\n await updateComplete;\n\n if (this._isMenuCompositionEnabled()) {\n await this._focusManagedMenuItem(index);\n return;\n }\n\n const { _menuBody: menuBody } = this;\n const menuItem = menuBody?.querySelector(\n `${prefix}-overflow-menu-item:nth-of-type(${index})`\n ) as HTMLElement;\n menuItem?.focus();\n }\n }\n\n /**\n * Handles `click` event on the trigger button.\n */\n private _handleClickTrigger = async (event: MouseEvent) => {\n if (this._isTriggerEvent(event)) {\n this._handleUserInitiatedToggle();\n return;\n }\n\n if (\n !this._isMenuCompositionEnabled() &&\n this._isDeprecatedOverflowMenuItemEvent(event)\n ) {\n this.open = false;\n }\n };\n\n /**\n * Handles `keydown` event on the trigger button.\n */\n private _handleKeydownTrigger = async (event: KeyboardEvent) => {\n if (!this._isTriggerEvent(event)) {\n return;\n }\n\n if (event.key === ' ' || event.key === 'Enter') {\n this._handleUserInitiatedToggle();\n event.preventDefault();\n }\n };\n\n /**\n * Prevents the trigger click from immediately re-opening the menu after blur.\n */\n private _handleMousedownTrigger = (event: MouseEvent) => {\n if (this._isMenuCompositionEnabled() && this._isTriggerEvent(event)) {\n event.preventDefault();\n }\n };\n\n /**\n * Handles close requests emitted by the managed menu.\n */\n private _handleManagedMenuClose = (\n event: CustomEvent<{ triggerEventType?: string }>\n ) => {\n const menu = this._getMenuChild();\n if (\n !this._isMenuCompositionEnabled() ||\n !menu ||\n event.composedPath()[0] !== menu\n ) {\n return;\n }\n\n this.open = false;\n\n if (event.detail?.triggerEventType !== 'focusout') {\n requestAnimationFrame(() => {\n this._getTriggerButton()?.focus();\n });\n }\n };\n\n /**\n * `true` if this tooltip is in a data table row\n */\n @property({ type: Boolean, reflect: true, attribute: 'data-table' })\n dataTable = false;\n\n /**\n * `true` if this overflow menu should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Enables the menu-composition OverflowMenu implementation leveraging `cds-menu`.\n */\n @property({\n type: Boolean,\n reflect: true,\n attribute: 'enable-v12-overflowmenu',\n })\n enableV12Overflowmenu = false;\n\n /**\n * `true` if this overflow menu body should be flipped.\n */\n @property({ type: Boolean, reflect: true })\n flipped = false;\n\n /**\n * Experimental property. Enables automatic menu placement flipping to avoid clipping.\n */\n @property({ type: Boolean, reflect: true })\n autoalign = false;\n\n /**\n * `true` if the dropdown should be open.\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Index (starting at 1) of overflow menu item to focus on open.\n */\n @property()\n index = 1;\n\n /**\n * A label describing the menu options. Used for the trigger tooltip and the menu's accessible label.\n */\n @property({ type: String })\n label = '';\n\n /**\n * Specify how the menu should align with the trigger button.\n * Valid values: 'bottom-start', 'bottom-end', 'top-start', 'top-end'\n */\n @property({ type: String, attribute: 'menu-alignment' })\n menuAlignment: string = 'bottom-start';\n\n /**\n * Overflow menu size.\n */\n @property({ reflect: true })\n size = OVERFLOW_MENU_SIZE.MEDIUM;\n\n /**\n * `true` if this menu is a toolbar action\n */\n @property({ type: Boolean, attribute: 'toolbar-action', reflect: true })\n toolbarAction = false;\n\n /**\n * `true` if this overflow menu use inside breadcrumb.\n */\n @property({ type: Boolean, reflect: true })\n breadcrumb = false;\n\n /**\n * @returns The position of the trigger button in the viewport.\n */\n get triggerPosition() {\n return this.getBoundingClientRect();\n }\n\n connectedCallback() {\n if (!this.hasAttribute('aria-haspopup')) {\n this.setAttribute('aria-haspopup', 'true');\n }\n if (!this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n super.connectedCallback();\n\n adoptStyles(this.renderRoot as ShadowRoot, [iconButtonStyles, styles]);\n\n this.addEventListener(\n CDSMenu.eventOnClose,\n this._handleManagedMenuClose as EventListener\n );\n this.addEventListener('click', this._handleClickTrigger);\n this.addEventListener('keydown', this._handleKeydownTrigger);\n this.addEventListener('mousedown', this._handleMousedownTrigger);\n }\n\n disconnectedCallback() {\n this.removeEventListener(\n CDSMenu.eventOnClose,\n this._handleManagedMenuClose as EventListener\n );\n this.removeEventListener('click', this._handleClickTrigger);\n this.removeEventListener('keydown', this._handleKeydownTrigger);\n this.removeEventListener('mousedown', this._handleMousedownTrigger);\n super.disconnectedCallback();\n }\n\n protected _renderTooltipContent() {\n const tooltipLabel = this._getLabelText();\n\n if (this.label || !this.querySelector('[slot=tooltip-content]')) {\n return html`\n <cds-tooltip-content ?hidden=${this.disabled || this.open}>\n ${tooltipLabel}\n </cds-tooltip-content>\n `;\n }\n\n return super._renderTooltipContent();\n }\n\n updated(changedProperties) {\n super.updated(changedProperties);\n const menuCompositionEnabled = this._isMenuCompositionEnabled();\n\n const button = this._tooltip?.querySelector('button');\n button?.classList.add(\n `${prefix}--btn--icon-only`,\n `${prefix}--overflow-menu`\n );\n\n if (changedProperties.has('open')) {\n if (!menuCompositionEnabled) {\n this._menuController.hostDisconnected();\n this._resetMenuChildFloatingStyles();\n const { open } = this;\n if (open && !this._menuBody) {\n this._menuBody = find(\n this.childNodes,\n (elem) =>\n (elem.constructor as typeof CDSOverflowMenuBody).FLOATING_MENU\n );\n }\n const { _menuBody: menuBody, size } = this;\n if (menuBody) {\n menuBody.id ||= this._menuId;\n menuBody.setAttribute('breadcrumb', String(this.breadcrumb));\n menuBody.open = open;\n menuBody.size = size;\n }\n }\n }\n\n if (\n changedProperties.has('enableV12Overflowmenu') &&\n !menuCompositionEnabled\n ) {\n this._menuController.hostDisconnected();\n this._resetMenuChildFloatingStyles({ closeMenu: true });\n }\n\n if (changedProperties.has('dataTable')) {\n this._tooltip?.toggleAttribute('data-table', this.dataTable);\n }\n\n if (changedProperties.has('size')) {\n button?.classList.forEach((item) => {\n if (item.startsWith(`${prefix}--overflow-menu--`)) {\n button?.classList.remove(item);\n }\n });\n button?.classList.add(`${prefix}--overflow-menu--${this.size}`);\n\n this._tooltip?.setAttribute('size', this.size);\n }\n\n if (changedProperties.has('toolbarAction') && this.toolbarAction) {\n this._tooltip?.setAttribute('toolbar-action', '');\n }\n\n const labelText = this._getLabelText();\n const popupId = menuCompositionEnabled\n ? (this._getMenuChild()?.id ?? this._menuId)\n : this._menuBody?.id;\n\n button?.setAttribute('aria-haspopup', 'menu');\n button?.setAttribute('aria-expanded', String(this.open));\n button?.setAttribute('aria-label', labelText);\n\n if (this.open && popupId) {\n button?.setAttribute('aria-controls', popupId);\n } else {\n button?.removeAttribute('aria-controls');\n }\n\n const shouldSyncMenuChild =\n menuCompositionEnabled &&\n (changedProperties.has('open') ||\n changedProperties.has('label') ||\n changedProperties.has('autoalign') ||\n changedProperties.has('menuAlignment') ||\n changedProperties.has('size') ||\n changedProperties.has('enableV12Overflowmenu'));\n\n if (shouldSyncMenuChild) {\n this._syncMenuChild();\n }\n\n if (changedProperties.has('open') || changedProperties.has('disabled')) {\n this._syncTriggerTooltipState();\n }\n }\n\n render() {\n return html`${super.render()} `;\n }\n\n private _getLabelText() {\n if (this.label) return this.label;\n\n const tooltipContent = this.querySelector(\n '[slot=tooltip-content]'\n )?.textContent?.trim();\n\n return tooltipContent || 'Options';\n }\n\n private _getTriggerButton() {\n return this._tooltip?.querySelector('button') as HTMLButtonElement | null;\n }\n\n private _isTriggerEvent(event: Event) {\n const triggerButton = this._getTriggerButton();\n\n return !!triggerButton && event.composedPath().includes(triggerButton);\n }\n\n private _isDeprecatedOverflowMenuItemEvent(event: Event) {\n return event\n .composedPath()\n .some(\n (entry) =>\n entry instanceof HTMLElement &&\n deprecatedOverflowMenuTagNames.has(entry.tagName)\n );\n }\n\n /**\n * Checks whether the menu-composition path is enabled.\n */\n private _isMenuCompositionEnabled() {\n return (\n this.enableV12Overflowmenu ||\n isFeatureFlagEnabled('enable-v12-overflowmenu', this)\n );\n }\n\n /**\n * Checks whether floating styles should be driven by Floating UI.\n */\n private _usesDynamicFloatingStyles() {\n return (\n this.autoalign ||\n isFeatureFlagEnabled('enable-v12-dynamic-floating-styles', this)\n );\n }\n\n private _getMenuChild() {\n return (Array.from(this.children).find((child) => {\n return child.tagName === `${prefix}-menu`.toUpperCase();\n }) ?? null) as CDSMenu | null;\n }\n\n private _warnDeprecatedChildren() {\n if (this._didWarnDeprecatedChildren) {\n return;\n }\n\n // Migration guard for flagged usage of deprecated overflow-menu children.\n const hasDeprecatedChildren = Array.from(this.children).some((child) => {\n return deprecatedOverflowMenuTagNames.has(child.tagName);\n });\n\n if (hasDeprecatedChildren) {\n warnInDev(\n '`cds-overflow-menu` with `enable-v12-overflowmenu` expects a direct `cds-menu` child instead of the deprecated `cds-overflow-menu-body` structure.'\n );\n this._didWarnDeprecatedChildren = true;\n }\n }\n\n private _warnInvalidMenuComposition() {\n if (this._didWarnInvalidComposition) {\n return;\n }\n\n const hasDirectMenuItems = Array.from(this.children).some((child) =>\n child.tagName.startsWith(menuItemTagPrefix)\n );\n const hasMenuChild = !!this._getMenuChild();\n\n if (!hasMenuChild || hasDirectMenuItems) {\n warnInDev(\n '`cds-overflow-menu` with `enable-v12-overflowmenu` expects a direct `cds-menu` child. Place `cds-menu-item*` descendants inside that `cds-menu`.'\n );\n this._didWarnInvalidComposition = true;\n }\n }\n\n private _syncMenuChild() {\n const menuSyncToken = ++this._menuSyncToken;\n\n this._warnDeprecatedChildren();\n this._warnInvalidMenuComposition();\n\n const menu = this._getMenuChild();\n if (!menu) {\n return;\n }\n\n const menuAlignment = this.menuAlignment;\n\n menu.id ||= this._menuId;\n menu.label = this._getLabelText();\n menu.menuAlignment = menuAlignment;\n this._syncMenuChildPosition(menu);\n menu.open = this.open;\n menu.size = this._toMenuSize(this.size);\n\n const shouldUseFloatingStyles = this._usesDynamicFloatingStyles();\n\n if (!this.open || !shouldUseFloatingStyles) {\n this._menuController.hostDisconnected();\n this._resetMenuFloatingStyles(menu);\n return;\n }\n\n this.updateComplete.then(async () => {\n if (\n menuSyncToken !== this._menuSyncToken ||\n !this.open ||\n !this._isMenuCompositionEnabled() ||\n this._getMenuChild() !== menu\n ) {\n return;\n }\n\n await menu.updateComplete;\n if (\n menuSyncToken !== this._menuSyncToken ||\n !this.open ||\n !this._isMenuCompositionEnabled() ||\n this._getMenuChild() !== menu\n ) {\n return;\n }\n\n const trigger = this._getTriggerButton();\n if (!trigger) {\n return;\n }\n\n const styleElement = menu.shadowRoot?.querySelector(\n `.${prefix}--menu`\n ) as HTMLElement | undefined;\n\n const fallbackPlacements = menuAlignment.includes('bottom')\n ? [...bottomFirstFallbackPlacements]\n : [...topFirstFallbackPlacements];\n\n const flipArguments = this.autoalign\n ? {\n fallbackPlacements,\n }\n : {\n mainAxis: false,\n crossAxis: false,\n };\n\n this._menuController.setPlacement({\n trigger,\n target: menu,\n alignment: menuAlignment,\n styleElement,\n flipArguments,\n mainAxisOffset: 0,\n open: this.open,\n });\n });\n }\n\n private _syncMenuChildPosition(menu: CDSMenu) {\n const trigger = this._getTriggerButton();\n if (!trigger) {\n return;\n }\n\n const { left, right, top, bottom } = trigger.getBoundingClientRect();\n menu.x = [left, right];\n menu.y = [top, bottom];\n }\n\n private _toMenuSize(size: OVERFLOW_MENU_SIZE | string): CDSMenu['size'] {\n switch (size) {\n case OVERFLOW_MENU_SIZE.EXTRA_SMALL:\n return MENU_SIZE.EXTRA_SMALL;\n case OVERFLOW_MENU_SIZE.SMALL:\n return MENU_SIZE.SMALL;\n case OVERFLOW_MENU_SIZE.MEDIUM:\n return MENU_SIZE.MEDIUM;\n case OVERFLOW_MENU_SIZE.LARGE:\n return MENU_SIZE.LARGE;\n default:\n return MENU_SIZE.MEDIUM;\n }\n }\n\n private async _focusManagedMenuItem(index: number) {\n const menu = this._getMenuChild();\n if (!menu) {\n return;\n }\n\n await menu.updateComplete;\n\n if (!this.open || this._getMenuChild() !== menu) {\n return;\n }\n\n const enabledItems = menu.activeitems\n .map(({ item }) => item)\n .filter(\n (item) => item instanceof HTMLElement && !item.hasAttribute('disabled')\n );\n const focusTarget = enabledItems[index - 1] ?? enabledItems[0];\n\n focusTarget?.focus();\n }\n\n private _resetMenuChildFloatingStyles({\n closeMenu = false,\n }: { closeMenu?: boolean } = {}) {\n const menu = this._getMenuChild();\n if (!menu) {\n return;\n }\n\n this._resetMenuFloatingStyles(menu);\n\n if (closeMenu) {\n menu.open = false;\n }\n }\n\n private _resetMenuFloatingStyles(menu: CDSMenu) {\n const menuSurface = menu.shadowRoot?.querySelector(`.${prefix}--menu`) as\n | HTMLElement\n | undefined;\n\n if (!menuSurface) {\n return;\n }\n\n menuSurface.style.removeProperty('left');\n menuSurface.style.removeProperty('top');\n menuSurface.style.removeProperty('position');\n menuSurface.style.removeProperty('visibility');\n menuSurface.removeAttribute('align');\n }\n\n /**\n * Suppresses trigger tooltip interactions while the menu is open.\n */\n private _syncTriggerTooltipState() {\n const tooltip = this._tooltip as\n | (HTMLElement & { open?: boolean; keyboardOnly?: boolean })\n | undefined;\n\n if (!tooltip) {\n return;\n }\n\n tooltip.keyboardOnly = this.open;\n this._tooltipContent?.toggleAttribute('hidden', this.disabled || this.open);\n\n if (this.open) {\n tooltip.open = false;\n }\n }\n}\n\nexport default CDSOverflowMenu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,oBAAoB,gBAAsB,YAAY;AAG5D,MAAM,iCAAiC,IAAI,IAAI,CAC7C,yBAA+B,YAAY,GAC3C,yBAA+B,YAAY,CAC7C,CAAC;AAED,MAAM,gCAAgC;CACpC;CACA;CACA;CACA;AACF;AAEA,MAAM,6BAA6B;CACjC;CACA;CACA;CACA;AACF;AAEA,MAAM,aAAa,YAAoB;CAEnC,WAAW,SAAS,KAAK,OAAO;AAEpC;;;;;;;AAQA,IAAA,kBAAA,MACM,wBACI,kBAAkB,WAAWA,qBAAa,CAAC,CAAC,CAEtD;;;yBAC4B,IAAIC,mBAAqB,IAAI;mBAiBP;iBAK9B,qBAA2B,KAAK,OAAO,CAAC,CACvD,SAAS,EAAE,CAAC,CACZ,MAAM,CAAC;oCAK2B;oCAKA;wBAKZ;6BA+BK,OAAO,UAAsB;GACzD,IAAI,KAAK,gBAAgB,KAAK,GAAG;IAC/B,KAAK,2BAA2B;IAChC;GACF;GAEA,IACE,CAAC,KAAK,0BAA0B,KAChC,KAAK,mCAAmC,KAAK,GAE7C,KAAK,OAAO;EAEhB;+BAKgC,OAAO,UAAyB;GAC9D,IAAI,CAAC,KAAK,gBAAgB,KAAK,GAC7B;GAGF,IAAI,MAAM,QAAQ,OAAO,MAAM,QAAQ,SAAS;I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