@scion/components 22.3.0 → 22.4.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/_index.scss +37 -18
- package/design/icons/_scion-icon-font.scss +2 -2
- package/fesm2022/scion-components-icon.mjs +3 -56
- package/fesm2022/scion-components-icon.mjs.map +1 -1
- package/fesm2022/scion-components-menu.mjs +10 -4
- package/fesm2022/scion-components-menu.mjs.map +1 -1
- package/fesm2022/scion-components-table.mjs +272 -200
- package/fesm2022/scion-components-table.mjs.map +1 -1
- package/package.json +2 -2
- package/types/scion-components-icon.d.ts +3 -56
- package/types/scion-components-table.d.ts +115 -97
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scion-components-menu.mjs","sources":["../../../../projects/scion/components/menu/src/menu-translate.util.ts","../../../../projects/scion/components/menu/src/menu-environment/menu-environment-providers.ts","../../../../projects/scion/components/menu/src/menu-accelerators.ts","../../../../projects/scion/components/menu/src/toolbar/ɵtoolbar.factory.ts","../../../../projects/scion/components/menu/src/menu/ɵmenu.factory.ts","../../../../projects/scion/components/menu/src/menu-item-sorter.ts","../../../../projects/scion/components/menu/src/menu-contribution-instant.provider.ts","../../../../projects/scion/components/menu/src/menu/accelerator-format.pipe.ts","../../../../projects/scion/components/menu/src/menu/menu-group.component.ts","../../../../projects/scion/components/menu/src/menu/menu-filter.component.ts","../../../../projects/scion/components/menu/src/menu/menu-filter.component.html","../../../../projects/scion/components/menu/src/menu/menu-filter.service.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar-control.component.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar-split-button.component.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar-icon.component.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar-label.component.ts","../../../../projects/scion/components/menu/src/menu/popover-ref.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar-group.component.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar-group.component.html","../../../../projects/scion/components/menu/src/menu/menu-group-label.component.ts","../../../../projects/scion/components/menu/src/menu/menu-item-label.component.ts","../../../../projects/scion/components/menu/src/menu/menu-item-icon.component.ts","../../../../projects/scion/components/menu/src/menu/menu.component.ts","../../../../projects/scion/components/menu/src/menu/menu.component.html","../../../../projects/scion/components/menu/src/menu-opener.service.ts","../../../../projects/scion/components/menu/src/menubar/ɵmenubar.factory.ts","../../../../projects/scion/components/menu/src/ɵmenu.registry.ts","../../../../projects/scion/components/menu/src/menu.registry.ts","../../../../projects/scion/components/menu/src/menu-adapter.model.ts","../../../../projects/scion/components/menu/src/ɵmenu.service.ts","../../../../projects/scion/components/menu/src/menu.service.ts","../../../../projects/scion/components/menu/src/menu-contribution.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar.component.ts","../../../../projects/scion/components/menu/src/toolbar/public_api.ts","../../../../projects/scion/components/menu/src/menubar/menubar.component.ts","../../../../projects/scion/components/menu/src/menubar/menubar.component.html","../../../../projects/scion/components/menu/src/menubar/public_api.ts","../../../../projects/scion/components/menu/src/menu/public_api.ts","../../../../projects/scion/components/menu/src/menu-service.provider.ts","../../../../projects/scion/components/menu/src/menu-environment/menu-environment.provider.ts","../../../../projects/scion/components/menu/src/menu-environment/public_api.ts","../../../../projects/scion/components/menu/src/public_api.ts","../../../../projects/scion/components/menu/src/scion-components-menu.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Signal, untracked} from '@angular/core';\nimport {MaybeSignal} from '@scion/components/common';\nimport {text, Translatable} from '@scion/components/text';\n\n/**\n * Translates the given {@link Translatable}.\n */\nexport function translate(translatable: MaybeSignal<Translatable> | undefined): Signal<Translatable> | undefined {\n return translatable !== undefined ? untracked(() => text(translatable)) : undefined;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {computed, inject, InjectionToken, Injector, Provider, Signal} from '@angular/core';\nimport {coerceSignal} from '@scion/components/common';\nimport {Arrays, Objects} from '@scion/toolkit/util';\nimport {SciMenuAcceleratorTargetProviderFn, SciMenuContextProviderFn, SciMenuInjectionContextProviderFn} from './menu-environment.provider';\nimport {coerceElement} from '@angular/cdk/coercion';\n\n/**\n * Injects the context for menu locations and contributions based on the current injection context.\n *\n * Must be called within an injection context, or an explicit {@link Injector} passed.\n *\n * @see provideMenuContextProvider\n * @docs-private Not public API. For internal use only.\n */\nexport function injectMenuContext(options?: {injector?: Injector}): Signal<Map<string, unknown>> {\n const injector = options?.injector ?? inject(Injector);\n const providers = injector.get(SCI_MENU_CONTEXT_PROVIDERS, [], {optional: true});\n\n // Get contexts available in the current injection context.\n const contexts = providers.map(providerFn => coerceSignal(providerFn(injector)));\n\n // Merge contexts.\n return computed(() => new Map(contexts.flatMap(context => [...context?.() ?? new Map()])), {equal: Objects.isEqual});\n}\n\n/**\n * Injects dependency injection providers of the given menu context based on the current injection context.\n *\n * Must be called within an injection context, or an explicit {@link Injector} passed.\n *\n * @see provideMenuInjectionContextProvider\n * @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this function.\n */\nexport function injectMenuInjectionContextProviders(menuContext: Map<string, unknown>, options?: {injector?: Injector}): Provider[] {\n const injector = options?.injector ?? inject(Injector);\n const providers = injector.get(SCI_MENU_INJECTION_CONTEXT_PROVIDERS, [], {optional: true});\n\n return providers.flatMap(providerFn => providerFn(menuContext));\n}\n\n/**\n * Injects accelerator targets for menu locations based on the current injection context.\n *\n * Must be called within an injection context, or an explicit {@link Injector} passed.\n *\n * @see provideMenuAcceleratorTargetProvider\n * @docs-private Not public API. For internal use only.\n */\nexport function injectMenuAcceleratorTargets(options?: {injector?: Injector}): Signal<Element[]> {\n const injector = options?.injector ?? inject(Injector);\n const providers = injector.get(SCI_MENU_ACCELERATOR_TARGET_PROVIDERS, [], {optional: true});\n\n // Get accelerator targets available in the current injection context.\n const acceleratorTargets = providers.map(providerFn => coerceSignal(providerFn(injector)));\n\n // Concat accelerator targets.\n return computed(() => acceleratorTargets.flatMap(acceleratorTarget => Arrays.coerce(acceleratorTarget?.())).map(coerceElement), {equal: Objects.isEqual});\n}\n\n/**\n * Multi-DI token for registering a {@link SciMenuContextProviderFn} in a specific environment.\n *\n * @see provideMenuContextProvider\n */\nexport const SCI_MENU_CONTEXT_PROVIDER = new InjectionToken<SciMenuContextProviderFn[]>('SCI_MENU_CONTEXT_PROVIDER');\n\n/**\n * DI token to inject {@link SciMenuContextProviderFn} functions provided in the current and parent injectors.\n *\n * @see injectMenuContext\n */\nexport const SCI_MENU_CONTEXT_PROVIDERS = new InjectionToken<SciMenuContextProviderFn[]>('SCI_MENU_CONTEXT_PROVIDERS');\n\n/**\n * Multi-DI token for registering a {@link SciMenuInjectionContextProviderFn} in a specific environment.\n *\n * @see provideMenuInjectionContextProvider\n */\nexport const SCI_MENU_INJECTION_CONTEXT_PROVIDER = new InjectionToken<SciMenuInjectionContextProviderFn[]>('SCI_MENU_INJECTION_CONTEXT_PROVIDER');\n\n/**\n * DI token to inject {@link SciMenuInjectionContextProviderFn} functions provided in the current and parent injectors.\n *\n * @see injectMenuInjectionContextProviders\n */\nexport const SCI_MENU_INJECTION_CONTEXT_PROVIDERS = new InjectionToken<SciMenuInjectionContextProviderFn[]>('SCI_MENU_INJECTION_CONTEXT_PROVIDERS');\n\n/**\n * Multi-DI token for registering a {@link SciMenuAcceleratorTargetProviderFn} in a specific environment.\n *\n * @see provideMenuAcceleratorTargetProvider\n */\nexport const SCI_MENU_ACCELERATOR_TARGET_PROVIDER = new InjectionToken<SciMenuAcceleratorTargetProviderFn[]>('SCI_MENU_ACCELERATOR_TARGET_PROVIDER');\n\n/**\n * DI token to inject {@link SciMenuAcceleratorTargetProviderFn} functions provided in the current and parent injectors.\n *\n *\n * @see injectMenuAcceleratorTargets\n */\nexport const SCI_MENU_ACCELERATOR_TARGET_PROVIDERS = new InjectionToken<SciMenuAcceleratorTargetProviderFn[]>('SCI_MENU_ACCELERATOR_TARGET_PROVIDERS');\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {assertNotInReactiveContext, computed, DestroyRef, DOCUMENT, effect, ElementRef, inject, Injector, NgZone, runInInjectionContext, untracked} from '@angular/core';\nimport {SciMenuItem, SciMenuItemLike} from './menu.model';\nimport {Disposable, MaybeArray} from '@scion/toolkit/types';\nimport {fromEvent, merge, noop} from 'rxjs';\nimport {subscribeIn} from '@scion/toolkit/operators';\nimport {Arrays} from '@scion/toolkit/util';\nimport {ɵSciMenuService} from './ɵmenu.service';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {createDestroyableInjector} from '@scion/components/common';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {injectMenuAcceleratorTargets, injectMenuContext} from './menu-environment/menu-environment-providers';\n\n/**\n * Installs accelerators for menu items contributed to the given location matching the specified context.\n *\n * An accelerator maps a physical key combination (key combined with modifiers such as `Ctrl`, `Shift`, or `Alt`) to an application action,\n * enabling users to trigger an action without using a pointer device.\n *\n * Context and accelerator targets are inherited from the current injector hierarchy, but can be overridden via {@link SciMenuAcceleratorOptions.context} and {@link SciMenuAcceleratorOptions.target} options.\n *\n * This function must be called within an injection context, or an explicit {@link Injector} passed. Destroying the injection context uninstalls the accelerators.\n *\n * @param location - Specifies the menu, toolbar, or menubar for which to install accelerators.\n * @param options - Controls the installation of accelerators.\n * @returns Handle to uninstall the accelerators.\n *\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\n */\nexport function installMenuAccelerators(location: `menu:${string}` | `toolbar:${string}` | `menubar:${string}`, options?: SciMenuAcceleratorOptions): Disposable {\n const injector = createDestroyableInjector({parent: options?.injector ?? inject(Injector)});\n\n return runInInjectionContext(injector, () => {\n const environmentContext = injectMenuContext();\n const environmentTargets = injectMenuAcceleratorTargets();\n const context = computed(() => new Map([...environmentContext(), ...options?.context ?? new Map()]));\n const menuItems = inject(ɵSciMenuService).menuItems(location, context, {metadata: options?.metadata});\n\n effect(onCleanup => {\n const tracked = {\n menuItems: menuItems(),\n environmentTargets: environmentTargets(),\n };\n\n untracked(() => {\n const accelerators = ɵinstallMenuAccelerators(tracked.menuItems, {\n targets: options?.target,\n environmentTargets: tracked.environmentTargets,\n injector,\n });\n onCleanup(() => accelerators.dispose());\n });\n });\n\n return {\n dispose: () => injector.destroy(),\n };\n });\n}\n\n/**\n * Installs accelerators for given menu items, recursively for menu items in submenus and groups.\n */\nexport function ɵinstallMenuAccelerators(menuItems: SciMenuItemLike[], options?: ɵSciMenuAcceleratorOptions): Disposable {\n assertNotInReactiveContext(installMenuAccelerators, 'Call installMenuAccelerators() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n const menuItemsWithAccelerator = collectMenuItemsWithAccelerator(menuItems);\n if (!menuItemsWithAccelerator.length) {\n return {dispose: noop};\n }\n\n const injector = createDestroyableInjector({parent: options?.injector ?? inject(Injector)});\n const zone = injector.get(NgZone);\n const targets = coerceElements(options?.targets) ?? coerceElements(options?.environmentTargets) ?? [injector.get(DOCUMENT)];\n const onSelectFn = options?.onSelect ?? (menuItem => menuItem.onSelect?.());\n\n merge(...targets.map(target => fromEvent<KeyboardEvent>(target, 'keydown')))\n .pipe(\n subscribeIn(fn => zone.runOutsideAngular(fn)),\n takeUntilDestroyed(injector.get(DestroyRef)),\n )\n .subscribe(event => {\n // Skip if only pressing a modifier key.\n switch (event.key) {\n case 'Control':\n case 'Shift':\n case 'Alt':\n case 'AltGraph':\n return;\n // UNDOCUMENTED: `event.key` can be `undefined`, for example, when selecting an option from an input element's datalist.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n case undefined:\n return;\n }\n\n // Skip if not pressing a modifier key. Accelerators must have a modifier key.\n if (!event.ctrlKey && !event.altKey && !event.shiftKey && !event.metaKey && !allowedSingleKeys.has(event.key.toLowerCase())) {\n return;\n }\n\n const matchingMenuItems = menuItemsWithAccelerator.filter(menuItem => !menuItem.disabled?.() && matchesAccelerator(event, menuItem.accelerator!));\n if (!matchingMenuItems.length) {\n return;\n }\n\n // Invoke menu item handler.\n event.preventDefault();\n event.stopPropagation();\n zone.run(() => matchingMenuItems.forEach(menuItem => onSelectFn(menuItem)));\n });\n\n return {\n dispose: () => injector.destroy(),\n };\n}\n\n/**\n * Returns given native elements, or `undefined` if empty.\n */\nfunction coerceElements(targets: MaybeArray<Element | ElementRef<Element>> | undefined): Element[] | undefined {\n const elements = Arrays.coerce(targets).map(coerceElement);\n return elements.length ? elements : undefined;\n}\n\n/**\n * Returns a flat list of all menu items that have an accelerator.\n */\nexport function collectMenuItemsWithAccelerator(menuItemLikes: SciMenuItemLike[]): SciMenuItem[] {\n return menuItemLikes.reduce((menuItems, menuItemLike) => {\n switch (menuItemLike.type) {\n case 'menu-item': {\n return menuItems\n .concat(menuItemLike.accelerator ? menuItemLike : [])\n .concat(collectMenuItemsWithAccelerator(menuItemLike.actions ?? []))\n .concat(collectMenuItemsWithAccelerator(menuItemLike.menu?.children ?? []));\n }\n case 'group': {\n return menuItems\n .concat(collectMenuItemsWithAccelerator(menuItemLike.children))\n .concat(collectMenuItemsWithAccelerator(menuItemLike.actions ?? []));\n }\n }\n }, new Array<SciMenuItem>());\n}\n\n/**\n * Validates the passed menu accelerator to have a modifier, unless a function key, 'Delete', or 'Escape'.\n */\nexport function validateMenuAccelerator(accelerator: SciKeyboardAccelerator | undefined): SciKeyboardAccelerator | undefined {\n if (!accelerator) {\n return undefined;\n }\n\n if (!accelerator.ctrl && !accelerator.alt && !accelerator.shift && !allowedSingleKeys.has(accelerator.key.toLowerCase())) {\n console.warn(`[MenuDefinitionError] Illegal menu accelerator. The key '${accelerator.key}' requires a modifier such as 'Ctrl', 'Shift', or 'Alt'. Only function keys F1-F12 and 'Delete' are allowed without a modifier. Examples: ['ctrl', 's'], ['F5'].`);\n return undefined;\n }\n return accelerator;\n}\n\n/**\n * Tests if the given keyboard event matches the specified accelerator.\n */\nfunction matchesAccelerator(event: KeyboardEvent, accelerator: SciKeyboardAccelerator): boolean {\n // Fallback to code if key does not match to support diacritics like umlauts and accents.\n const keyMatches = accelerator.key.toLowerCase() === event.key.toLowerCase() || `Key${accelerator.key.toUpperCase()}` === event.code;\n if (!keyMatches) {\n return false;\n }\n // Handle Meta key as the Control key as on Apple devices the Command (⌘) key is used instead of the Control (Ctrl) key.\n if ((accelerator.ctrl ?? false) !== (event.ctrlKey || event.metaKey)) {\n return false;\n }\n if ((accelerator.shift ?? false) !== event.shiftKey) {\n return false;\n }\n if ((accelerator.alt ?? false) !== event.altKey) {\n return false;\n }\n if (accelerator.location === 'left' && event.location !== 1) {\n return false;\n }\n if (accelerator.location === 'right' && event.location !== 2) {\n return false;\n }\n if (accelerator.location === 'numpad' && event.location !== 3) {\n return false;\n }\n return true;\n}\n\n/**\n * Controls the installation of accelerators.\n */\nexport interface SciMenuAcceleratorOptions {\n /**\n * Specifies DOM elements on which to install menu accelerators. Defaults to {@link Document}.\n *\n * Alternatively, accelerator targets can be provided at the injector level using {@link provideMenuAcceleratorTargetProvider}, for example, at the component, route, or application level,\n * and are available to accelerators installed in the scope of this injector. Inherited targets can be overridden.\n */\n target?: MaybeArray<Element | ElementRef<Element>>;\n /**\n * Controls in which context to install menu accelerators.\n *\n * Menu contributions may declare a required context. Only accelerators of contributions matching the context are installed.\n *\n * A context can also be provided at the injector level using {@link provideMenuContextProvider}, for example, at the component, route, or application level,\n * and is available to accelerators installed in the scope of this injector. The inherited context can be overridden or extended. Setting a context entry to `undefined` clears it.\n */\n context?: Map<string, unknown>;\n /**\n * Specifies the injector used to install accelerators. Defaults to the current injection context.\n *\n * Accelerators are uninstalled when the injector is destroyed.\n */\n injector?: Injector;\n /**\n * Specifies metadata available to the operation.\n *\n * @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this property.\n */\n metadata?: {[key: string]: unknown};\n}\n\n/**\n * Controls the installation of accelerators.\n *\n * Accelerators are installed on the specified {@link targets}. If not set or empty, falls back to {@link environmentTargets}, defaulting to the {@link Document} if both are empty.\n */\nexport interface ɵSciMenuAcceleratorOptions {\n /**\n * Specifies DOM elements on which to install the accelerators. Defaults to {@link environmentTargets}.\n */\n targets?: MaybeArray<Element | ElementRef<Element>>;\n /**\n * Specifies default accelerator targets based on the current injection context. Defaults to {@link Document}.\n */\n environmentTargets?: MaybeArray<Element | ElementRef<Element>>;\n /**\n * Specifies the handler invoked when an accelerator is triggered. Defaults to invoking {@link SciMenuItem.onSelect}.\n */\n onSelect?: (menuItem: SciMenuItem) => void;\n /**\n * Specifies the injector used to install accelerators. Defaults to the current injection context.\n *\n * Accelerators are uninstalled when the passed injector is destroyed.\n */\n injector?: Injector;\n}\n\n/**\n * Represents a keyboard accelerator to match specific keystrokes or key combinations.\n *\n * An accelerator maps a physical key combination (key combined with modifiers such as `Ctrl`, `Shift`, or `Alt`) to an application action,\n * enabling users to trigger an action without using a pointer device.\n */\nexport interface SciKeyboardAccelerator {\n /**\n * Specifies the key of the accelerator.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values\n */\n key: string;\n /**\n * Indicates whether the `Ctrl` key (or `Cmd` key on macOS) must be pressed.\n */\n ctrl?: boolean;\n /**\n * Indicates whether the `Shift` key must be pressed.\n */\n shift?: boolean;\n /**\n * Indicates whether the `Alt` key (or `Opt` key on macOS) must be pressed.\n */\n alt?: boolean;\n /**\n * Specifies the physical location of the key on the keyboard.\n *\n * - `numpad`: Keys on the numeric keypad.\n * - `left`: Left-side modifier keys.\n * - `right`: Right-side modifier keys.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/location\n */\n location?: 'numpad' | 'left' | 'right';\n}\n\n/**\n * Keys that can be used without a modifier (ctrl, alt, shift).\n */\nconst allowedSingleKeys = new Set<string>([\n ...Array.from(Array(20).keys()).map(i => `f${i + 1}`), // F1 - F20\n 'delete',\n]);\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {SciMenuDescriptor, SciMenuFactory} from '../menu/menu.factory';\nimport {isSignal} from '@angular/core';\nimport {Arrays, prune} from '@scion/toolkit/util';\nimport {SciToolbarButtonDescriptor, SciToolbarControlDescriptor, SciToolbarFactory, SciToolbarGroupDescriptor, SciToolbarMenuDescriptor} from './toolbar.factory';\nimport {SciMenuItemLike} from '../menu.model';\nimport {constructMenu} from '../menu/ɵmenu.factory';\nimport {translate} from '../menu-translate.util';\nimport {validateMenuAccelerator} from '../menu-accelerators';\nimport {coerceSignal, MaybeSignal, SciComponentDescriptor} from '@scion/components/common';\nimport {Translatable} from '@scion/components/text';\nimport {ComponentType} from '@angular/cdk/portal';\n\n/**\n * Translation note: Texts are translated when added (not lazily when rendered) to simplify filtering.\n *\n * @inheritDoc\n */\nexport class ɵSciToolbarFactory implements SciToolbarFactory {\n\n public readonly menuItems = [] as SciMenuItemLike[];\n\n /** @inheritDoc */\n public addToolbarButton(descriptor: SciToolbarButtonDescriptor): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n labelText: translate(getLabelIfText(descriptor.label)),\n labelComponent: getLabelIfComponent(descriptor.label),\n iconLigature: coerceSignal(getIconIfLigature(descriptor.icon)),\n iconComponent: getIconIfComponent(descriptor.icon),\n checked: coerceSignal(descriptor.checked),\n tooltip: translate(descriptor.tooltip),\n accelerator: validateMenuAccelerator(descriptor.accelerator),\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n onSelect: async () => await descriptor.onSelect() as boolean | undefined ?? descriptor.checked === undefined, // Returning `true` will close the popover. Non-checkable items close by default.\n }));\n\n return this;\n }\n\n /** @inheritDoc */\n public addToolbarSplitButton(descriptor: SciToolbarButtonDescriptor & {menu?: SciMenuDescriptor['menu']}, menuFactoryFn?: (menu: SciMenuFactory) => void): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n labelText: translate(getLabelIfText(descriptor.label)),\n labelComponent: getLabelIfComponent(descriptor.label),\n iconLigature: coerceSignal(getIconIfLigature(descriptor.icon)),\n iconComponent: getIconIfComponent(descriptor.icon),\n checked: coerceSignal(descriptor.checked),\n tooltip: translate(descriptor.tooltip),\n accelerator: validateMenuAccelerator(descriptor.accelerator),\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n menu: constructMenu(menuFactoryFn, descriptor.menu),\n onSelect: async () => await descriptor.onSelect() as boolean | undefined ?? descriptor.checked === undefined, // Returning `true` will close the popover. Non-checkable items close by default.\n }));\n\n return this;\n }\n\n /** @inheritDoc */\n public addToolbarMenu(descriptor: SciToolbarMenuDescriptor, menuFactoryFn?: (menu: SciMenuFactory) => void): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n labelText: translate(getLabelIfText(descriptor.label)),\n labelComponent: getLabelIfComponent(descriptor.label),\n iconLigature: coerceSignal(getIconIfLigature(descriptor.icon)),\n iconComponent: getIconIfComponent(descriptor.icon),\n tooltip: translate(descriptor.tooltip),\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n visualMenuIndicator: descriptor.visualMenuIndicator,\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n menu: constructMenu(menuFactoryFn, descriptor.menu),\n }));\n\n return this;\n }\n\n /** @inheritDoc */\n public addToolbarControl(descriptor: SciToolbarControlDescriptor): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n control: prune({\n component: descriptor.component,\n bindings: descriptor.bindings,\n injector: descriptor.injector,\n providers: descriptor.providers,\n }),\n tooltip: translate(descriptor.tooltip),\n visible: coerceSignal(descriptor.visible),\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n }));\n\n return this;\n }\n\n /** @inheritDoc */\n public addToolbarSplitControl(descriptor: SciToolbarControlDescriptor & {menu?: SciMenuDescriptor['menu']}, menuFactoryFn?: (menu: SciMenuFactory) => void): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n control: prune({\n component: descriptor.component,\n bindings: descriptor.bindings,\n injector: descriptor.injector,\n providers: descriptor.providers,\n }),\n tooltip: translate(descriptor.tooltip),\n visible: coerceSignal(descriptor.visible),\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n menu: constructMenu(menuFactoryFn, descriptor.menu),\n }));\n\n return this;\n }\n\n /** @inheritDoc */\n public addGroup(groupFactoryFn: (group: SciToolbarFactory) => void): this;\n public addGroup(descriptor: SciToolbarGroupDescriptor, groupFactoryFn?: (group: SciToolbarFactory) => void): this;\n public addGroup(factoryOrDescriptor: ((group: SciToolbarFactory) => void) | SciToolbarGroupDescriptor, factoryIfDescriptor?: (group: SciToolbarFactory) => void): this {\n const [descriptor, groupFactoryFn] = typeof factoryOrDescriptor === 'function' ? [{}, factoryOrDescriptor] : [factoryOrDescriptor, factoryIfDescriptor];\n\n // Construct group.\n const groupFactory = new ɵSciToolbarFactory();\n groupFactoryFn?.(groupFactory);\n\n // Add group.\n this.menuItems.push(prune({\n type: 'group',\n name: descriptor.name,\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n children: groupFactory.menuItems,\n cssClass: Arrays.coerce(descriptor.cssClass),\n }));\n\n return this;\n }\n}\n\nfunction getLabelIfText(label: MaybeSignal<Translatable> | ComponentType<unknown> | SciComponentDescriptor | undefined): MaybeSignal<Translatable> | undefined {\n if (typeof label === 'string' || isSignal(label)) {\n return label;\n }\n return undefined;\n}\n\nfunction getLabelIfComponent(label: MaybeSignal<Translatable> | ComponentType<unknown> | SciComponentDescriptor | undefined): SciComponentDescriptor | undefined {\n if (typeof label === 'function' && !isSignal(label)) {\n return {component: label};\n }\n else if (typeof label === 'object') {\n return label;\n }\n return undefined;\n}\n\nfunction getIconIfLigature(icon: MaybeSignal<string> | ComponentType<unknown> | SciComponentDescriptor | undefined): MaybeSignal<string> | undefined {\n if (typeof icon === 'string' || isSignal(icon)) {\n return icon;\n }\n return undefined;\n}\n\nfunction getIconIfComponent(icon: MaybeSignal<Translatable> | ComponentType<unknown> | SciComponentDescriptor | undefined): SciComponentDescriptor | undefined {\n if (typeof icon === 'function' && !isSignal(icon)) {\n return {component: icon};\n }\n else if (typeof icon === 'object') {\n return icon;\n }\n return undefined;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {SciMenuDescriptor, SciMenuFactory, SciMenuFilterConfig, SciMenuGroupDescriptor, SciMenuItemDescriptor} from './menu.factory';\nimport {isSignal, Signal} from '@angular/core';\nimport {Arrays, prune} from '@scion/toolkit/util';\nimport {SciMenuItem, SciMenuItemLike} from '../menu.model';\nimport {ɵSciToolbarFactory} from '../toolbar/ɵtoolbar.factory';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {coerceSignal, MaybeSignal, SciComponentDescriptor} from '@scion/components/common';\nimport {Translatable} from '@scion/components/text';\nimport {translate} from '../menu-translate.util';\nimport {validateMenuAccelerator} from '../menu-accelerators';\n\n/**\n * Translation note: Texts are translated when added (not lazily when rendered) to simplify filtering.\n */\nexport class ɵSciMenuFactory implements SciMenuFactory {\n\n public readonly menuItems = [] as SciMenuItemLike[];\n\n /** @inheritDoc */\n public addMenuItem(descriptor: SciMenuItemDescriptor): this {\n // Construct action toolbar.\n const actionsFactory = new ɵSciToolbarFactory();\n descriptor.actions?.(actionsFactory);\n\n // Add menu item.\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n labelText: translate(getLabelIfText(descriptor.label)),\n labelComponent: getLabelIfComponent(descriptor.label),\n iconLigature: coerceSignal(getIconIfLigature(descriptor.icon)),\n iconComponent: getIconIfComponent(descriptor.icon),\n checked: coerceSignal(descriptor.checked),\n active: coerceSignal(descriptor.active),\n tooltip: translate(descriptor.tooltip),\n accelerator: validateMenuAccelerator(descriptor.accelerator),\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n actions: actionsFactory.menuItems,\n matchesFilter: descriptor.onFilter,\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n onSelect: async () => await descriptor.onSelect() as boolean | undefined ?? descriptor.checked === undefined, // Returning `true` will close the popover. Non-checkable items close by default.\n }));\n\n if (descriptor.checked && descriptor.icon) {\n throw Error('[MenuDefinitionError] Cannot use `checked` and `icon` together.');\n }\n\n return this;\n }\n\n /** @inheritDoc */\n public addMenu(descriptor: SciMenuDescriptor, menuFactoryFn?: (menu: SciMenuFactory) => void): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n labelText: translate(getLabelIfText(descriptor.label)),\n labelComponent: getLabelIfComponent(descriptor.label),\n iconLigature: coerceSignal(getIconIfLigature(descriptor.icon)),\n iconComponent: getIconIfComponent(descriptor.icon),\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n menu: constructMenu(menuFactoryFn, descriptor.menu),\n }));\n\n return this;\n }\n\n /** @inheritDoc */\n public addGroup(groupFactoryFn: (group: SciMenuFactory) => void): this;\n public addGroup(descriptor: SciMenuGroupDescriptor, groupFactoryFn?: (group: SciMenuFactory) => void): this;\n public addGroup(factoryOrDescriptor: ((group: SciMenuFactory) => void) | SciMenuGroupDescriptor, factoryIfDescriptor?: (group: SciMenuFactory) => void): this {\n const [descriptor, groupFactoryFn] = typeof factoryOrDescriptor === 'function' ? [{}, factoryOrDescriptor] : [factoryOrDescriptor, factoryIfDescriptor];\n\n // Construct group.\n const groupFactory = new ɵSciMenuFactory();\n groupFactoryFn?.(groupFactory);\n\n // Construct action toolbar.\n const actionsFactory = new ɵSciToolbarFactory();\n descriptor.actions?.(actionsFactory);\n\n // Add group.\n this.menuItems.push(prune({\n type: 'group',\n name: descriptor.name,\n label: translate(descriptor.label),\n collapsible: coerceCollapsibleGroupConfig(descriptor),\n glyphArea: descriptor.glyphArea,\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n actions: actionsFactory.menuItems,\n children: groupFactory.menuItems,\n cssClass: Arrays.coerce(descriptor.cssClass),\n }));\n\n return this;\n }\n}\n\nfunction getLabelIfText(label: MaybeSignal<Translatable> | ComponentType<unknown> | SciComponentDescriptor): MaybeSignal<Translatable> | undefined {\n if (typeof label === 'string' || isSignal(label)) {\n return label;\n }\n return undefined;\n}\n\nfunction getLabelIfComponent(label: MaybeSignal<Translatable> | ComponentType<unknown> | SciComponentDescriptor): SciComponentDescriptor | undefined {\n if (typeof label === 'function' && !isSignal(label)) {\n return {component: label};\n }\n else if (typeof label === 'object') {\n return label;\n }\n return undefined;\n}\n\nfunction getIconIfLigature(icon: MaybeSignal<string> | ComponentType<unknown> | SciComponentDescriptor | undefined): MaybeSignal<string> | undefined {\n if (typeof icon === 'string' || isSignal(icon)) {\n return icon;\n }\n return undefined;\n}\n\nfunction getIconIfComponent(icon: MaybeSignal<string> | ComponentType<unknown> | SciComponentDescriptor | undefined): SciComponentDescriptor | undefined {\n if (typeof icon === 'function' && !isSignal(icon)) {\n return {component: icon};\n }\n else if (typeof icon === 'object') {\n return icon;\n }\n return undefined;\n}\n\nfunction coerceCollapsibleGroupConfig(groupDescriptor: SciMenuGroupDescriptor): {collapsed: boolean} | undefined {\n const collapsible = groupDescriptor.collapsible;\n\n if (typeof collapsible === 'object') {\n return collapsible;\n }\n\n return collapsible === true ? {collapsed: false} : undefined;\n}\n\nexport function constructMenu(menuFactoryFn: ((menu: SciMenuFactory) => void) | undefined, menuDescriptor?: SciMenuDescriptor['menu']): SciMenuItem['menu'] {\n const menuFactory = new ɵSciMenuFactory();\n menuFactoryFn?.(menuFactory);\n\n return prune({\n name: menuDescriptor?.name,\n children: menuFactory.menuItems,\n width: menuDescriptor?.width,\n minWidth: menuDescriptor?.minWidth,\n maxWidth: menuDescriptor?.maxWidth,\n maxHeight: menuDescriptor?.maxHeight,\n filter: coerceFilterConfig(menuDescriptor),\n });\n\n function coerceFilterConfig(menuDescriptor?: SciMenuDescriptor['menu']): SciMenuFilterConfig<Signal<Translatable>> | undefined {\n const filter = menuDescriptor?.filter;\n\n if (typeof filter === 'object') {\n return prune({\n placeholder: coerceSignal(filter.placeholder),\n notFoundMessage: coerceSignal(filter.notFoundMessage),\n focus: filter.focus,\n }, {pruneIfEmpty: true});\n }\n return filter === true ? {} : undefined;\n }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {SciMenuItemLike} from './menu.model';\n\n/**\n * Sorts passed menu items based on its preferred {@link SciMenuItemLike.position}.\n *\n * This function is not recursive, not sorting menu items in submenus or groups.\n */\nexport function sortMenuItems(menuItems: SciMenuItemLike[]): SciMenuItemLike[] {\n // Note: The standard JavaScript sorting algorithms cannot be used as it requires strict weak element ordering (transitivity), not given for elements positioned relative to each other.\n const sorted = [] as SciMenuItemLike[];\n const queue = new Set(menuItems);\n\n // Add contributions which do not declare an insertion point or a non-existent insertion point.\n queue.forEach(menuItem => {\n // Add contribution if not declaring an insertion point.\n if (!menuItem.position) {\n sorted.push(menuItem);\n queue.delete(menuItem);\n }\n // Add contribution if declaring a non-existent \"before\" insertion point.\n else if (menuItem.position.before && !menuItems.some(it => it.name === menuItem.position!.before)) {\n sorted.push(menuItem);\n queue.delete(menuItem);\n }\n // Add contribution if declaring a non-existent \"after\" insertion point.\n else if (menuItem.position.after && !menuItems.some(it => it.name === menuItem.position!.after)) {\n sorted.push(menuItem);\n queue.delete(menuItem);\n }\n });\n\n // Add contributions at the start or end.\n queue.forEach(menuItem => {\n if (menuItem.position?.position === 'start') {\n sorted.unshift(menuItem);\n queue.delete(menuItem);\n }\n else if (menuItem.position?.position === 'end') {\n sorted.push(menuItem);\n queue.delete(menuItem);\n }\n });\n\n // Add contributions declaring an insertion point. Multiple iterations may be required.\n while (queue.size) {\n const queueSize = queue.size;\n\n for (const menuItem of queue) {\n // Add contributions declaring a \"before\" insertion point.\n if (menuItem.position?.before) {\n const index = sorted.findIndex(candidate => candidate.name === menuItem.position!.before);\n if (index !== -1) {\n sorted.splice(index, 0, menuItem);\n queue.delete(menuItem);\n }\n }\n // Add contributions declaring an \"after\" insertion point.\n else if (menuItem.position?.after) {\n const index = sorted.findIndex(candidate => candidate.name === menuItem.position!.after);\n if (index !== -1) {\n sorted.splice(index + 1, 0, menuItem);\n queue.delete(menuItem);\n }\n }\n }\n\n if (queue.size === queueSize) {\n // TODO [menu] Better message, Algo error\n console.warn('[@scion/components] Menu contributions reference non-existent menu items.', queue);\n sorted.push(...queue);\n queue.clear();\n }\n }\n\n return sorted;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\n\n/**\n * Provides registration instants for contributions.\n *\n * Two consecutive calls always have different instants, in ascending order.\n */\n@Injectable({providedIn: 'root'})\nexport class SciMenuContributionInstantProvider {\n\n private _instant = 0;\n\n /**\n * Provides the next instant.\n */\n public next(): number {\n return ++this._instant;\n }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\nimport {SciKeyboardAccelerator} from '../menu-accelerators';\n\n/**\n * Formats a keyboard accelerator for display.\n *\n * If `tooltip` is specified, appends the accelerator in parentheses.\n */\n@Pipe({name: 'sciFormatAccelerator'})\nexport class SciFormatAcceleratorPipe implements PipeTransform {\n\n public transform(accelerator: SciKeyboardAccelerator | undefined, tooltip?: string): string | undefined {\n if (!accelerator) {\n return tooltip;\n }\n\n const modifiers = [];\n if (accelerator.ctrl) {\n modifiers.push(ctrlKeySymbol);\n }\n if (accelerator.shift) {\n modifiers.push('Shift');\n }\n if (accelerator.alt) {\n modifiers.push('Alt');\n }\n\n const key = formatKey(accelerator);\n const formattedAccelerator = `${accelerator.location === 'numpad' ? `NumPad ` : ''}${modifiers.concat(key).join('+')}`;\n return tooltip ? `${tooltip} (${formattedAccelerator})` : formattedAccelerator;\n }\n}\n\nfunction formatKey(accelerator: SciKeyboardAccelerator): string {\n switch (accelerator.key.toLowerCase()) {\n case ' ':\n return 'Space';\n case 'arrowdown':\n return 'Down';\n case 'arrowup':\n return 'Up';\n case 'arrowleft':\n return 'Left';\n case 'arrowright':\n return 'Right';\n default:\n return accelerator.key[0]!.toUpperCase() + accelerator.key.substring(1);\n }\n}\n\n/**\n * Platform-specific name for the Control modifier key.\n *\n * Resolves to `⌘` on macOS and `Ctrl` on other operating systems.\n */\nconst ctrlKeySymbol = navigator.platform.startsWith('Mac') ? '⌘' : 'Ctrl';\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {ApplicationRef, Component, computed, createComponent, DestroyRef, ElementRef, EnvironmentInjector, inject, Injector, input, inputBinding} from '@angular/core';\r\nimport {provideMenuComponentRole, SciMenuComponent, SciMenuGroupConfig} from './menu.component';\r\nimport {SciMenuGroup} from '../menu.model';\r\n\r\n/**\r\n * Alias for {@link SciMenuComponent} with `sci-menu-group` as tag name.\r\n */\r\n@Component({\r\n selector: 'sci-menu-group',\r\n template: '', // Template provided by `SciMenuComponent`.\r\n})\r\nexport class SciMenuGroupComponent {\r\n\r\n public readonly group = input.required<SciMenuGroup>();\r\n public readonly glyphArea = input.required<boolean>();\r\n public readonly disabled = input<boolean>();\r\n public readonly cssClass = input<string[]>();\r\n\r\n constructor() {\r\n const menuComponent = createComponent(SciMenuComponent, {\r\n elementInjector: inject(Injector),\r\n environmentInjector: inject(EnvironmentInjector),\r\n hostElement: inject(ElementRef).nativeElement as HTMLElement,\r\n bindings: [\r\n inputBinding('menuItems', computed(() => this.group().children)),\r\n inputBinding('disabled', this.disabled),\r\n inputBinding('cssClass', this.cssClass),\r\n inputBinding('glyphArea', this.glyphArea),\r\n inputBinding('group', computed((): SciMenuGroupConfig => ({\r\n label: this.group().label?.(),\r\n collapsible: !!this.group().collapsible,\r\n collapsed: this.group().collapsible?.collapsed ?? false,\r\n hideGlyphArea: this.group().glyphArea === false,\r\n actions: this.group().actions ?? [],\r\n }))),\r\n ],\r\n directives: [\r\n provideMenuComponentRole('group'),\r\n ],\r\n });\r\n\r\n // Attach component to Angular component tree for change detection.\r\n inject(ApplicationRef).attachView(menuComponent.hostView);\r\n\r\n // Destroy component when host is destroyed.\r\n inject(DestroyRef).onDestroy(() => menuComponent.destroy());\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component, ElementRef, input, model, viewChild} from '@angular/core';\r\nimport {FormsModule} from '@angular/forms';\r\nimport {SciTextPipe} from '@scion/components/text';\r\nimport {SciIconComponent} from '@scion/components/icon';\r\n\r\n@Component({\r\n selector: 'sci-menu-filter',\r\n templateUrl: './menu-filter.component.html',\r\n styleUrl: './menu-filter.component.scss',\r\n imports: [\r\n FormsModule,\r\n SciTextPipe,\r\n SciIconComponent,\r\n ],\r\n host: {\r\n '[attr.tabindex]': '-1', // enable delegation of programmatic focus requests\r\n '(focus)': 'focus()',\r\n },\r\n})\r\nexport class SciMenuFilterComponent {\r\n\r\n public readonly placeholder = input.required<string>();\r\n public readonly text = model<string>('');\r\n\r\n private readonly _inputField = viewChild.required<ElementRef<HTMLInputElement>>('input');\r\n\r\n public focus(): void {\r\n this._inputField().nativeElement.focus();\r\n }\r\n\r\n protected onClear(): void {\r\n this.text.set('');\r\n this.focus();\r\n }\r\n}\r\n","<input type=\"text\" autocomplete=\"off\" class=\"e2e-menu-filter-input\" [attr.placeholder]=\"placeholder()\" [(ngModel)]=\"text\" #input>\r\n<button class=\"clear\" (click)=\"onClear()\" [title]=\"('%scion.components.clear.tooltip' | sciText)()\" tabindex=\"-1\">\r\n <sci-icon>scion.clear</sci-icon>\r\n</button>\r\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {computed, Signal, signal} from '@angular/core';\nimport {SciMenuItem} from '../menu.model';\n\n/**\n * Filters menu items based on the passed filter text.\n *\n * Filtering is hierarchical; submenus and groups inherit the filter of their parent menus.\n * A menu item matches only if matching its menu filter and all parent menu filters.\n *\n * Can be injected into {@link SciMenuComponent}.\n */\nexport class MenuFilter {\n\n private readonly _filterText = signal<string | null>(null);\n\n /**\n * Indicates whether filtering is active.\n */\n public readonly active = computed((): boolean => {\n return !!this._filterText() || !!this._parentMenuFilter?.active();\n });\n\n constructor(private _parentMenuFilter: MenuFilter | null) {\n }\n\n /**\n * Sets the filter for filtering menu items.\n */\n public setFilterText(filterText: string | null): void {\n this._filterText.set(filterText || null); // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing\n }\n\n /**\n * Tests whether the given menu item matches the filter.\n */\n public matches(menuItem: SciMenuItem): Signal<boolean> {\n return computed(() => {\n const filterText = this._filterText();\n\n // Test if the menu item matches the filter using its filter function, if any.\n if (filterText && menuItem.matchesFilter && !menuItem.matchesFilter(filterText)) {\n return false;\n }\n\n // Test if the display text of the menu item matches the filter.\n if (filterText && !menuItem.matchesFilter && menuItem.labelText && !menuItem.labelText().toLowerCase().includes(filterText.toLowerCase())) {\n return false;\n }\n\n // Test if the menu item matches the parent filter, if any.\n if (this._parentMenuFilter && !this._parentMenuFilter.matches(menuItem)()) {\n return false;\n }\n\n return true;\n });\n }\n}\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for a toolbar control provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-toolbar-control',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciToolbarControlComponent {\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component, ElementRef, inject} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for a toolbar split button provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-toolbar-split-button',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciToolbarSplitButtonComponent {\r\n\r\n public readonly host = inject(ElementRef).nativeElement as HTMLElement;\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for the icon of a toolbar item provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-toolbar-icon',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciToolbarIconComponent {\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for the label of a toolbar item provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-toolbar-label',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciToolbarLabelComponent {\r\n}\r\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {DestroyRef, ElementRef, inject, InjectionToken, signal, WritableSignal} from '@angular/core';\n\n/**\n * Provides a reference to the menu's popover element and child popover, if any.\n *\n * A child popover can be a submenu or a menu opened from a menu item's action toolbar.\n *\n * Can be injected into {@link SciMenuComponent}.\n */\nexport class PopoverRef {\n\n private readonly _element = inject(ElementRef).nativeElement as HTMLElement;\n private readonly _parentPopover = inject(PopoverRef, {skipSelf: true, optional: true});\n\n /**\n * Reference to the child popover, if any. Can be a submenu or a menu opened from a menu item's action toolbar.\n */\n public readonly childPopover = signal<PopoverRef | undefined>(undefined);\n\n /**\n * Indicates if this is a submenu popover, i.e., not a top-level menu nor a menu opened from a menu item's action toolbar.\n */\n public readonly isSubmenu: boolean;\n\n constructor(options: {isSubmenu: boolean}) {\n this.isSubmenu = options.isSubmenu;\n this.registerPopover();\n this.registerPopoverInParentPopover();\n }\n\n /**\n * Registers this popover in {@link POPOVER_REFS}.\n */\n private registerPopover(): void {\n const popovers = inject(POPOVER_REFS);\n\n // Register this popover.\n popovers.update(popovers => new Set(popovers).add(this));\n\n // Unregister popover when destroyed.\n inject(DestroyRef).onDestroy(() => popovers.update(popovers => {\n const copy = new Set(popovers);\n copy.delete(this);\n return copy;\n }));\n }\n\n /**\n * Registers this popover as child popover in the parent {@link PopoverRef}, if any.\n */\n private registerPopoverInParentPopover(): void {\n const parentPopover = this._parentPopover;\n if (!parentPopover) {\n return;\n }\n\n parentPopover.childPopover.set(this);\n\n // Unregister popover when destroyed.\n inject(DestroyRef).onDestroy(() => parentPopover.childPopover.update(childPopover => childPopover == this ? undefined : childPopover));\n }\n\n /**\n * Closes this popover, and parent popovers if specified.\n *\n * Defaults to not closing parent popovers.\n */\n public close(options?: {closeParents?: boolean}): void {\n this._element.hidePopover();\n\n if (options?.closeParents) {\n this._parentPopover?.close(options);\n }\n }\n}\n\n/**\n * DI token to inject currently open menu popovers.\n */\nexport const POPOVER_REFS = new InjectionToken<WritableSignal<Set<PopoverRef>>>('POPOVER_REFS', {\n providedIn: 'root',\n factory: () => signal(new Set()),\n});\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component, effect, inject, input, linkedSignal, signal, Signal, untracked, viewChildren, ViewContainerRef} from '@angular/core';\r\nimport {SciMenuGroup, SciMenuItem, SciMenuItemLike} from '../menu.model';\r\nimport {ɵSciMenuService} from '../ɵmenu.service';\r\nimport {SciFormatAcceleratorPipe} from '../menu/accelerator-format.pipe';\r\nimport {SciAttributesDirective, SciComponentOutletDirective} from '@scion/components/common';\r\nimport {SciIconComponent} from '@scion/components/icon';\r\nimport {RequireOne} from '@scion/toolkit/types';\r\nimport {NgTemplateOutlet} from '@angular/common';\r\nimport {SciToolbarControlComponent} from './toolbar-control.component';\r\nimport {SciToolbarSplitButtonComponent} from './toolbar-split-button.component';\r\nimport {SciToolbarIconComponent} from './toolbar-icon.component';\r\nimport {SciToolbarLabelComponent} from './toolbar-label.component';\r\nimport {PopoverRef} from '../menu/popover-ref';\r\nimport {SciMenuFilterConfig} from '../menu/menu.factory';\r\n\r\n/**\r\n * Represents a visually separated group of related items within a toolbar.\r\n */\r\n@Component({\r\n selector: 'sci-toolbar-group',\r\n templateUrl: './toolbar-group.component.html',\r\n styleUrl: './toolbar-group.component.scss',\r\n imports: [\r\n SciComponentOutletDirective,\r\n SciAttributesDirective,\r\n SciIconComponent,\r\n SciFormatAcceleratorPipe,\r\n SciToolbarSplitButtonComponent,\r\n SciToolbarControlComponent,\r\n SciToolbarIconComponent,\r\n SciToolbarLabelComponent,\r\n NgTemplateOutlet,\r\n ],\r\n host: {\r\n '[attr.data-orientation]': 'orientation()',\r\n },\r\n})\r\nexport class SciToolbarGroupComponent {\r\n\r\n /**\r\n * Specifies the toolbar items to display in this group.\r\n */\r\n public readonly menuItems = input.required<Array<SciMenuItem | SciMenuGroup>>();\r\n\r\n /**\r\n * Specifies the orientation of the items in this group.\r\n */\r\n public readonly orientation = input.required<'horizontal' | 'vertical'>();\r\n\r\n /**\r\n * Controls whether to disable the items in this group.\r\n */\r\n public readonly disabled = input<boolean>();\r\n\r\n /**\r\n * Controls where to attach popovers in the DOM.\r\n */\r\n public readonly popoverViewContainerRef = input.required<ViewContainerRef>();\r\n\r\n /**\r\n * Indicates whether any menu within this toolbar group is currently open.\r\n */\r\n public readonly menuOpen = this.computeMenuOpen();\r\n\r\n private readonly _childToolbarGroups = viewChildren(SciToolbarGroupComponent);\r\n\r\n /** Reference to the popover. Only set if displayed in a menu (menu item action toolbar). */\r\n private readonly _popoverRef = inject(PopoverRef, {optional: true});\r\n\r\n protected readonly activeMenuItem = linkedSignal<SciMenuItemLike[], {menuItem: SciMenuItem; element: HTMLElement; closing?: true | 'prevented'} | null>({\r\n source: this.menuItems, // Unset when menu items change.\r\n computation: () => null,\r\n });\r\n\r\n constructor() {\r\n this.installMenuOpener();\r\n }\r\n\r\n /**\r\n * Method invoked when clicking on a toolbar button.\r\n */\r\n protected async onSelect(menuItem: SciMenuItem): Promise<void> {\r\n if (await menuItem.onSelect!()) {\r\n this._popoverRef?.close();\r\n }\r\n }\r\n\r\n /**\r\n * Method invoked when clicking on a menu button.\r\n */\r\n protected onToolbarMenuButtonClick(menuItem: SciMenuItem, element: HTMLElement): void {\r\n this.activeMenuItem.update(activeMenuItem => activeMenuItem?.menuItem === menuItem ? null : {menuItem, element});\r\n }\r\n\r\n /**\r\n * Method invoked before clicking on a menu button.\r\n *\r\n * When clicking on the active menu button, mark it as closing to prevent immediate re-opening race condition on subsequent click event.\r\n */\r\n protected onToolbarMenuButtonMouseDown(menuItem: SciMenuItem): void {\r\n const activeMenuItem = this.activeMenuItem();\r\n\r\n if (activeMenuItem?.menuItem === menuItem) {\r\n activeMenuItem.closing = true;\r\n }\r\n }\r\n\r\n /**\r\n * Method invoked when moving the pointer out of a menu button.\r\n *\r\n * Clean up closing state set by {@link onToolbarMenuButtonMouseDown}, if any.\r\n */\r\n protected onToolbarMenuButtonMouseLeave(menuItem: SciMenuItem): void {\r\n const activeMenuItem = this.activeMenuItem();\r\n if (activeMenuItem?.menuItem !== menuItem) {\r\n return;\r\n }\r\n\r\n if (activeMenuItem.closing === 'prevented') {\r\n this.activeMenuItem.set(null); // unset active menu\r\n }\r\n else if (activeMenuItem.closing) {\r\n delete activeMenuItem.closing; // unset closing state\r\n }\r\n }\r\n\r\n /**\r\n * Opens a menu based on {@link activeMenuItem}.\r\n */\r\n private installMenuOpener(): void {\r\n const menuService = inject(ɵSciMenuService);\r\n\r\n effect(onCleanup => {\r\n if (!this.activeMenuItem()) {\r\n return;\r\n }\r\n\r\n const {menuItem, element} = this.activeMenuItem()!;\r\n const menu = menuItem.menu!;\r\n const align = this.orientation() === 'horizontal' ? 'vertical' : 'horizontal';\r\n\r\n untracked(() => {\r\n const menuRef = menuService.open(menu.children, {\r\n anchor: element,\r\n viewContainerRef: this.popoverViewContainerRef(),\r\n filter: menu.filter as RequireOne<SciMenuFilterConfig> | undefined,\r\n width: menu.width,\r\n minWidth: menu.minWidth,\r\n maxWidth: menu.maxWidth,\r\n maxHeight: menu.maxHeight,\r\n cssClass: menuItem.cssClass,\r\n attributes: menuItem.attributes,\r\n offset: {\r\n x: align === 'horizontal' ? 1 : 0,\r\n y: align === 'vertical' ? 1 : 0,\r\n },\r\n align,\r\n });\r\n\r\n // Close when opening another menu.\r\n onCleanup(() => menuRef.close());\r\n\r\n // Unset when closing menu.\r\n menuRef.onClose(() => {\r\n const activeMenuItem = this.activeMenuItem();\r\n\r\n // Do not unset if another menu was opened in the meantime.\r\n if (activeMenuItem?.menuItem !== menuItem) {\r\n return;\r\n }\r\n\r\n // Prevent immediate re-opening race condition when toolbar button is clicked to close.\r\n if (activeMenuItem.closing) {\r\n activeMenuItem.closing = 'prevented';\r\n return;\r\n }\r\n\r\n this.activeMenuItem.set(null);\r\n });\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Computes whether any menu within this toolbar group is currently open.\r\n */\r\n private computeMenuOpen(): Signal<boolean> {\r\n // Do not return `computed` signal to prevent illegal access to required component inputs until Angular has completed the initialization of this component,\r\n // happening when reading the signal from the parent component's template, e.g., via reference variable.\r\n const menuOpen = signal(false);\r\n effect(() => {\r\n menuOpen.set(!!this.activeMenuItem() || this._childToolbarGroups().some(childGroup => childGroup.menuOpen()));\r\n });\r\n return menuOpen;\r\n }\r\n}\r\n","@for (menuItem of menuItems(); track $index) {\r\n @let disabled = this.disabled() || menuItem.disabled?.() || false;\r\n @switch (menuItem.type) {\r\n <!-- Toolbar Item -->\r\n @case ('menu-item') {\r\n @let isSplitButton = (menuItem.onSelect || menuItem.control) && menuItem.menu?.children?.length;\r\n\r\n @if (isSplitButton) {\r\n <sci-toolbar-split-button [class]=\"menuItem.cssClass\" #split_button_element>\r\n <ng-container *ngTemplateOutlet=\"menu_item_template; context: {anchor: split_button_element.host}\"/>\r\n </sci-toolbar-split-button>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"menu_item_template\"/>\r\n }\r\n\r\n <!-- Template for rendering the content of a toolbar item. -->\r\n <ng-template #menu_item_template let-anchor=\"anchor\">\r\n <!-- Render push or toggle button. -->\r\n @if (menuItem.onSelect) {\r\n <button [attr.disabled]=\"disabled || null\"\r\n [attr.title]=\"menuItem.accelerator | sciFormatAccelerator:menuItem.tooltip?.()\"\r\n [class.checked]=\"menuItem.checked?.()\"\r\n [class]=\"menuItem.cssClass\" class=\"menu-item toolbar-button e2e-menu-item\"\r\n [sciAttributes]=\"menuItem.attributes\"\r\n (click)=\"onSelect(menuItem)\">\r\n <!-- Render icon, if any. -->\r\n <ng-container *ngTemplateOutlet=\"icon_template; context: {$implicit: menuItem}\"/>\r\n <!-- Render label, if any. -->\r\n <ng-container *ngTemplateOutlet=\"label_template; context: {$implicit: menuItem}\"/>\r\n </button>\r\n } @else if (menuItem.control) {\r\n <!-- Render custom control. -->\r\n <sci-toolbar-control [attr.title]=\"menuItem.accelerator | sciFormatAccelerator:menuItem.tooltip?.()\"\r\n [class]=\"menuItem.cssClass\" class=\"e2e-menu-item\"\r\n [sciAttributes]=\"menuItem.attributes\">\r\n <ng-container *sciComponentOutlet=\"menuItem.control\"/>\r\n </sci-toolbar-control>\r\n }\r\n\r\n <!-- Render menu button. -->\r\n @if (menuItem.menu?.children?.length) {\r\n @let hasLabel = menuItem.labelText || menuItem.labelComponent;\r\n @let hasIcon = menuItem.iconLigature || menuItem.iconComponent;\r\n @let hasVisualMenuIndicator = menuItem.visualMenuIndicator ?? true;\r\n @let hasIconChevron = hasVisualMenuIndicator && !isSplitButton && hasIcon && !hasLabel;\r\n @let hasChevron = hasVisualMenuIndicator && (isSplitButton || !hasIconChevron);\r\n\r\n <button [attr.disabled]=\"disabled || null\"\r\n [attr.title]=\"menuItem.tooltip?.()\"\r\n [class.menu-open]=\"activeMenuItem()?.menuItem === menuItem\"\r\n [class.menu-indicator]=\"hasIconChevron\"\r\n [class]=\"menuItem.cssClass\" class=\"menu-item e2e-menu-item\"\r\n [sciAttributes]=\"menuItem.attributes\"\r\n (click)=\"onToolbarMenuButtonClick(menuItem, anchor ?? menu_button)\"\r\n (mousedown)=\"onToolbarMenuButtonMouseDown(menuItem)\"\r\n (mouseleave)=\"onToolbarMenuButtonMouseLeave(menuItem)\"\r\n #menu_button>\r\n @if (!isSplitButton) {\r\n <!-- Render icon, if any. -->\r\n <ng-container *ngTemplateOutlet=\"icon_template; context: {$implicit: menuItem}\"/>\r\n <!-- Render label, if any. -->\r\n <ng-container *ngTemplateOutlet=\"label_template; context: {$implicit: menuItem}\"/>\r\n }\r\n <!-- Render chevron to indicate dropdown. -->\r\n @if (hasChevron) {\r\n <sci-icon class=\"chevron\">scion.chevron_down</sci-icon>\r\n }\r\n </button>\r\n }\r\n </ng-template>\r\n }\r\n <!-- Toolbar Group -->\r\n @case ('group') {\r\n <sci-toolbar-group [menuItems]=\"menuItem.children\"\r\n [orientation]=\"orientation()\"\r\n [disabled]=\"disabled\"\r\n [popoverViewContainerRef]=\"popoverViewContainerRef()\"\r\n [class]=\"menuItem.cssClass\"/>\r\n }\r\n }\r\n}\r\n\r\n<!-- Renders the icon of a menu item, if any. -->\r\n<ng-template #icon_template let-menuItem>\r\n @if (menuItem.iconLigature) {\r\n <sci-icon>\r\n {{menuItem.iconLigature()}}\r\n </sci-icon>\r\n } @else if (menuItem.iconComponent) {\r\n <sci-toolbar-icon>\r\n <ng-container *sciComponentOutlet=\"menuItem.iconComponent\"/>\r\n </sci-toolbar-icon>\r\n }\r\n</ng-template>\r\n\r\n<!-- Renders the label of a menu item, if any. -->\r\n<ng-template #label_template let-menuItem>\r\n @if (menuItem.labelText) {\r\n <sci-toolbar-label>\r\n {{menuItem.labelText()}}\r\n </sci-toolbar-label>\r\n } @else if (menuItem.labelComponent) {\r\n <sci-toolbar-label>\r\n <ng-container *sciComponentOutlet=\"menuItem.labelComponent\"/>\r\n </sci-toolbar-label>\r\n }\r\n</ng-template>\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for the label of a menu group provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-menu-group-label',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciMenuGroupLabelComponent {\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for the label of a menu item provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-menu-item-label',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciMenuItemLabelComponent {\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for the icon of a menu item provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-menu-item-icon',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciMenuItemIconComponent {\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {afterRenderEffect, Component, computed, Directive, effect, ElementRef, inject, InjectionToken, Injector, input, linkedSignal, NgZone, Provider, Signal, Type, untracked, viewChild, ViewContainerRef, WritableSignal} from '@angular/core';\r\nimport {SciFormatAcceleratorPipe} from './accelerator-format.pipe';\r\nimport {SciMenuGroupComponent} from './menu-group.component';\r\nimport {SciMenuFilterComponent} from './menu-filter.component';\r\nimport {MenuFilter} from './menu-filter.service';\r\nimport {NgTemplateOutlet} from '@angular/common';\r\nimport {SciMenuGroup, SciMenuItem, SciMenuItemLike} from '../menu.model';\r\nimport {ɵSciMenuService} from '../ɵmenu.service';\r\nimport {SciToolbarGroupComponent} from '../toolbar/toolbar-group.component';\r\nimport {SciViewportComponent} from '@scion/components/viewport';\r\nimport {SciTextPipe, Translatable} from '@scion/components/text';\r\nimport {SciAttributesDirective, SciComponentOutletDirective} from '@scion/components/common';\r\nimport {SciIconComponent} from '@scion/components/icon';\r\nimport {RequireOne} from '@scion/toolkit/types';\r\nimport {SciMenuGroupLabelComponent} from './menu-group-label.component';\r\nimport {SciMenuItemLabelComponent} from './menu-item-label.component';\r\nimport {SciMenuItemIconComponent} from './menu-item-icon.component';\r\nimport {PopoverRef} from './popover-ref';\r\nimport {takeUntilDestroyed, toObservable} from '@angular/core/rxjs-interop';\r\nimport {filter, observeOn, raceWith, switchMap, take} from 'rxjs/operators';\r\nimport {animationFrameScheduler, EMPTY, fromEvent} from 'rxjs';\r\nimport {observeIn, subscribeIn} from '@scion/toolkit/operators';\r\nimport {ɵinstallMenuAccelerators} from '../menu-accelerators';\r\nimport {SciMenuFilterConfig} from './menu.factory';\r\n\r\n/**\r\n * Represents a menu or a group of menu items.\r\n */\r\n@Component({\r\n selector: 'sci-menu',\r\n templateUrl: './menu.component.html',\r\n styleUrl: './menu.component.scss',\r\n imports: [\r\n SciMenuGroupComponent,\r\n SciMenuFilterComponent,\r\n SciToolbarGroupComponent,\r\n SciViewportComponent,\r\n SciTextPipe,\r\n SciComponentOutletDirective,\r\n SciAttributesDirective,\r\n SciIconComponent,\r\n SciMenuGroupLabelComponent,\r\n SciMenuItemLabelComponent,\r\n SciMenuItemIconComponent,\r\n SciFormatAcceleratorPipe,\r\n NgTemplateOutlet,\r\n ],\r\n providers: [\r\n providePopoverRef(),\r\n provideMenuFilter(),\r\n ],\r\n host: {\r\n '[style.--ɵsci-menu-width]': 'menuSize().width',\r\n '[style.--ɵsci-menu-min-width]': 'menuSize().minWidth',\r\n '[style.--ɵsci-menu-max-width]': 'menuSize().maxWidth',\r\n '[style.--ɵsci-menu-max-height]': 'menuSize().maxHeight',\r\n '[style.--ɵsci-menu-scrolling]': 'scrolling() ? `true` : null',\r\n '[attr.data-glyph-area]': 'hasGlyphArea() ? null : `none`',\r\n // Hide popover until computed the initial width to prevent flickering caused by dynamic anchor positioning based on `--ɵsci-menu-width`. See `menu-opener.service.ts` for more details.\r\n '[style.visibility]': 'popoverHidden() ? `hidden` : null',\r\n '[attr.tabindex]': 'role === `menu` ? `-1` : null', // enable programmatic focus of popover\r\n '[class]': 'cssClass()',\r\n },\r\n hostDirectives: [\r\n {directive: SciAttributesDirective, inputs: ['sciAttributes: attributes']},\r\n ],\r\n})\r\nexport class SciMenuComponent {\r\n\r\n /**\r\n * Specifies the menu items to display in this menu or group.\r\n */\r\n public readonly menuItems = input.required<Array<SciMenuItem | SciMenuGroup>>();\r\n\r\n /**\r\n * Controls whether to disable menu items in this menu or group.\r\n */\r\n public readonly disabled = input<boolean>();\r\n\r\n /**\r\n * Enables and configures filtering of this menu.\r\n *\r\n * Has no effect if a menu group.\r\n */\r\n public readonly filter = input<SciMenuFilterConfig<Signal<Translatable>>>();\r\n\r\n /**\r\n * Configures features of this group.\r\n *\r\n * Has no effect if a menu or submenu\r\n */\r\n public readonly group = input<SciMenuGroupConfig>();\r\n\r\n /**\r\n * Specifies the preferred menu width.\r\n *\r\n * Has no effect if a menu group.\r\n */\r\n public readonly width = input<string>();\r\n\r\n /**\r\n * Specifies the preferred minimum menu width.\r\n *\r\n * Defaults to the `--sci-menu-min-width` or `--sci-menu-submenu-min-width` CSS variables.\r\n *\r\n * If {@link anchorWidth} is specified (e.g., for toolbar menus), the effective minimum width evaluates to `max(anchorWidth, minWidth)`.\r\n *\r\n * Has no effect if a menu group.\r\n */\r\n public readonly minWidth = input<string>();\r\n\r\n /**\r\n * Specifies the maximum menu width.\r\n *\r\n * Has no effect if a menu group.\r\n */\r\n public readonly maxWidth = input<string>();\r\n\r\n /**\r\n * Specifies the maximum menu height.\r\n *\r\n * Has no effect if a menu group.\r\n */\r\n public readonly maxHeight = input<string>();\r\n\r\n /**\r\n * Controls whether to display the glyph area.\r\n *\r\n * The glyph area is the leftmost column for displaying icons and checkmarks.\r\n */\r\n public readonly glyphArea = input<boolean>();\r\n\r\n /**\r\n * Specifies the width of the popover anchor.\r\n *\r\n * Used to compute the minimum width of the menu.\r\n */\r\n public readonly anchorWidth = input(undefined, {transform: (width: number | undefined): string | undefined => width ? `${width}px` : undefined});\r\n\r\n /**\r\n * Specifies CSS classes to associate with the menu, submenu, or group.\r\n */\r\n public readonly cssClass = input<string[]>();\r\n\r\n private readonly _menuService = inject(ɵSciMenuService);\r\n private readonly _menuFilter = inject(MenuFilter);\r\n private readonly _popoverRef = inject(PopoverRef);\r\n private readonly _filterField = viewChild(SciMenuFilterComponent);\r\n private readonly _viewport = viewChild(SciViewportComponent);\r\n\r\n protected readonly hasGlyphArea = computed(() => this.glyphArea() ?? requiresGlyphArea(this.menuItems()));\r\n protected readonly menuItemsFiltered = computed(() => this.menuItems().filter(menuItem => this.matchesFilter(menuItem)()));\r\n protected readonly popoverViewContainerRef = viewChild.required('popover_view_container_ref', {read: ViewContainerRef});\r\n protected readonly scrolling = computed(() => this._viewport()?.scrolling());\r\n protected readonly activeSubmenuItem = linkedSignal<SciMenuItemLike[], {menuItem: SciMenuItem; element: HTMLElement} | null>({\r\n source: this.menuItemsFiltered, // Unset when filtered menu items change. Otherwise, popopver may lose anchor and render left-top of the page viewport.\r\n computation: () => null,\r\n equal: (a, b) => a?.menuItem === b?.menuItem, // required to ignore clicking an already opened menu item\r\n });\r\n\r\n protected readonly role = inject(SCI_MENU_COMPONENT_ROLE);\r\n protected readonly isGroupExpanded = this.computeGroupExpanded();\r\n protected readonly popoverHidden = this.computePopoverHidden();\r\n protected readonly menuSize = this.computeMenuSize();\r\n\r\n constructor() {\r\n this.installSubmenuOpener();\r\n this.installAccelerators();\r\n this.lockInitialMenuWidth();\r\n this.closeChildPopoverOnComponentReuse();\r\n this.requestInitialFocus();\r\n this.focusFilterFieldOnKeyDown();\r\n this.stopKeyDownEventPropagation();\r\n }\r\n\r\n /**\r\n * Method invoked when clicking on a menu item.\r\n */\r\n protected async onSelect(menuItem: SciMenuItem): Promise<void> {\r\n if (await menuItem.onSelect!()) {\r\n this._popoverRef.close({closeParents: true});\r\n }\r\n }\r\n\r\n /**\r\n * Method invoked when clicking on the group header of a collapsible group.\r\n */\r\n protected onGroupHeaderButtonClick(): void {\r\n this.isGroupExpanded.update(expanded => !expanded);\r\n }\r\n\r\n /**\r\n * Method invoked when moving the pointer over a menu item.\r\n */\r\n protected onMenuItemMouseEnter(menuItem: SciMenuItem | null): void {\r\n const disabled = this.disabled() || menuItem?.disabled?.(); // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n this.activeSubmenuItem.set(null);\r\n\r\n // Close submenu of other groups.\r\n if (this._popoverRef.childPopover()?.isSubmenu) {\r\n this._popoverRef.childPopover()!.close();\r\n }\r\n }\r\n\r\n /**\r\n * Method invoked when moving the pointer over a submenu item.\r\n */\r\n protected onSubmenuItemMouseEnter(menuItem: {menuItem: SciMenuItem; element: HTMLElement}): void {\r\n this.onSubmenuItemClick(menuItem);\r\n }\r\n\r\n /**\r\n * Method invoked when clicking on a submenu item.\r\n */\r\n protected onSubmenuItemClick(menuItem: {menuItem: SciMenuItem; element: HTMLElement}): void {\r\n const disabled = this.disabled() || menuItem.menuItem.disabled?.(); // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n this.activeSubmenuItem.set(menuItem);\r\n }\r\n\r\n /**\r\n * Method invoked when setting a menu filter.\r\n */\r\n protected onFilterChange(filter: string): void {\r\n this._menuFilter.setFilterText(filter);\r\n }\r\n\r\n /**\r\n * Opens a submenu based on {@link activeSubmenuItem}.\r\n */\r\n private installSubmenuOpener(): void {\r\n effect(onCleanup => {\r\n if (!this.activeSubmenuItem()) {\r\n return;\r\n }\r\n\r\n const {menuItem, element} = this.activeSubmenuItem()!;\r\n const menu = menuItem.menu!;\r\n\r\n untracked(() => {\r\n const menuRef = this._menuService.open(menu.children, {\r\n anchor: element,\r\n viewContainerRef: this.popoverViewContainerRef(),\r\n filter: menu.filter as RequireOne<SciMenuFilterConfig> | undefined,\r\n width: menu.width,\r\n minWidth: menu.minWidth,\r\n maxWidth: menu.maxWidth,\r\n maxHeight: menu.maxHeight,\r\n cssClass: menuItem.cssClass,\r\n attributes: menuItem.attributes,\r\n submenu: true,\r\n align: 'horizontal',\r\n offset: {x: 1},\r\n });\r\n\r\n // Close when opening another submenu.\r\n onCleanup(() => menuRef.close());\r\n\r\n // Unset when closing submenu.\r\n menuRef.onClose(() => {\r\n const activeSubmenuItem = this.activeSubmenuItem();\r\n\r\n // Do not unset if another submenu was opened in the meantime.\r\n if (activeSubmenuItem?.menuItem !== menuItem) {\r\n return;\r\n }\r\n\r\n this.activeSubmenuItem.set(null);\r\n });\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Installs accelerators of menu items in this menu, recursively for menu items in submenus and groups.\r\n *\r\n * Has no effect if a submenu or menu group.\r\n */\r\n private installAccelerators(): void {\r\n if (this.role !== 'menu') {\r\n return;\r\n }\r\n\r\n const host = inject(ElementRef).nativeElement as HTMLElement;\r\n const injector = inject(Injector);\r\n\r\n effect(onCleanup => {\r\n const menuItems = this.menuItems();\r\n\r\n untracked(() => {\r\n const accelerators = ɵinstallMenuAccelerators(menuItems, {\r\n targets: host,\r\n onSelect: menuItem => void this.onSelect(menuItem),\r\n injector,\r\n });\r\n onCleanup(() => accelerators.dispose());\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Locks the initial menu width to maintain a stable width when expanding/collapsing groups or hovering menu items with a toolbar.\r\n *\r\n * Has no effect if a menu group.\r\n */\r\n private lockInitialMenuWidth(): void {\r\n if (this.role === 'group') {\r\n return;\r\n }\r\n\r\n const host = inject(ElementRef).nativeElement as HTMLElement;\r\n\r\n // Wait until menu items are available, maximal until idle; may initially be empty due to asynchronous menu contributions.\r\n toObservable(this.menuItems)\r\n .pipe(\r\n filter(menuItems => !!menuItems.length),\r\n observeOn(animationFrameScheduler), // Wait until next render cycle to capture menu width.\r\n raceWith(new Promise(resolve => void requestIdleCallback(resolve, {timeout: 250}))), // fallback if no menu items are contributed\r\n take(1),\r\n takeUntilDestroyed(),\r\n )\r\n .subscribe(() => {\r\n this.menuSize.update(size => ({...size, width: `${host.getBoundingClientRect().width}px`}));\r\n });\r\n }\r\n\r\n /**\r\n * Closes a child popover (submenu or action menu) when this component is reused.\r\n */\r\n private closeChildPopoverOnComponentReuse(): void {\r\n effect(() => {\r\n // Track menu items.\r\n this.menuItems();\r\n\r\n // Close child popover, if any.\r\n untracked(() => this._popoverRef.childPopover()?.close());\r\n });\r\n }\r\n\r\n /**\r\n * Focuses the popover or filter field based on {@link filter.focus} option.\r\n *\r\n * The popover must receive focus to enable light dismiss (closing via Escape or clicking outside it) when opened from microfrontends.\r\n */\r\n private requestInitialFocus(): void {\r\n const host = inject(ElementRef).nativeElement as HTMLElement;\r\n\r\n const effectRef = afterRenderEffect(() => {\r\n if (this.popoverHidden()) {\r\n return; // cannot be focused until visible\r\n }\r\n\r\n untracked(() => {\r\n if (this.filter()?.focus) {\r\n this._filterField()?.focus();\r\n }\r\n else if (this.role === 'menu') {\r\n host.focus();\r\n }\r\n\r\n effectRef.destroy();\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Focuses the filter field when the user starts typing.\r\n *\r\n * Has no effect if filtering is not supported.\r\n */\r\n private focusFilterFieldOnKeyDown(): void {\r\n const host = inject(ElementRef).nativeElement as HTMLElement;\r\n const zone = inject(NgZone);\r\n\r\n toObservable(this._filterField)\r\n .pipe(\r\n switchMap(filterField => filterField ? fromEvent<KeyboardEvent>(host, 'keydown') : EMPTY),\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\r\n filter(event => !event.ctrlKey && !event.altKey && !event.metaKey && event.key?.trim().length === 1), // UNDOCUMENTED: `event.key` can be `undefined`, for example, when selecting an option from an input element's datalist.\r\n subscribeIn(fn => zone.runOutsideAngular(fn)),\r\n observeIn(fn => zone.run(fn)),\r\n takeUntilDestroyed(),\r\n )\r\n .subscribe(event => {\r\n this._filterField()!.focus();\r\n event.stopPropagation(); // prevent parent filter field from receiving focus.\r\n });\r\n }\r\n\r\n /**\r\n * Stops keydown event propagation to prevent side effects, such as closing an overlay on `Escape` or other keystrokes from triggering.\r\n *\r\n * Has no effect if a submenu or menu group.\r\n */\r\n private stopKeyDownEventPropagation(): void {\r\n if (this.role !== 'menu') {\r\n return;\r\n }\r\n\r\n const host = inject(ElementRef).nativeElement as HTMLElement;\r\n const zone = inject(NgZone);\r\n\r\n fromEvent<KeyboardEvent>(host, 'keydown')\r\n .pipe(\r\n subscribeIn(fn => zone.runOutsideAngular(fn)),\r\n takeUntilDestroyed(),\r\n )\r\n .subscribe(event => {\r\n event.stopPropagation();\r\n });\r\n }\r\n\r\n /**\r\n * Computes whether the popover is hidden.\r\n *\r\n * The popover must be hidden until the initial width is computed. Otherwise, dynamic anchor positioning based on `--ɵsci-menu-width` causes flickering.\r\n * See `menu-opener.service.ts` for more details.\r\n */\r\n private computePopoverHidden(): Signal<boolean> {\r\n return computed(() => this.role === 'menu' && !this.menuSize().width);\r\n }\r\n\r\n /**\r\n * Computes whether menu items are visible.\r\n */\r\n private computeGroupExpanded(): WritableSignal<boolean> {\r\n return linkedSignal(() => {\r\n const group = this.group();\r\n return !group || !group.collapsible || !group.collapsed || this._menuFilter.active();\r\n });\r\n }\r\n\r\n /**\r\n * Computes the menu size based on configured size constraints.\r\n */\r\n private computeMenuSize(): WritableSignal<MenuSize> {\r\n return linkedSignal((): MenuSize => {\r\n if (this.role === 'group') {\r\n return {};\r\n }\r\n\r\n // Compute only once; otherwise, the popover would hide since the initial width is only computed initially.\r\n return untracked(() => {\r\n const defaultMinWidth = this.role === 'submenu' ? 'var(--sci-menu-submenu-min-width)' : 'var(--sci-menu-min-width)';\r\n const preferredMinWidth = this.minWidth() ?? defaultMinWidth;\r\n return {\r\n width: this.width(),\r\n minWidth: this.anchorWidth() ? `max(${preferredMinWidth}, ${this.anchorWidth()})` : preferredMinWidth,\r\n maxWidth: this.maxWidth() ?? this.width(),\r\n maxHeight: this.maxHeight(),\r\n };\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Evaluates whether the given menu item (or any of its child menu items) match the active filter.\r\n */\r\n private matchesFilter(menuItem: SciMenuItem | SciMenuGroup): Signal<boolean> {\r\n return computed(() => {\r\n if (!this._menuFilter.active()) {\r\n return true;\r\n }\r\n switch (menuItem.type) {\r\n case 'menu-item':\r\n return menuItem.menu ? menuItem.menu.children.some(menuItem => this.matchesFilter(menuItem)()) : this._menuFilter.matches(menuItem)();\r\n case 'group':\r\n return menuItem.children.some(menuItem => this.matchesFilter(menuItem)());\r\n }\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Evaluates whether the given menu items (or any child groups) require a glyph area for displaying icons and checkmarks.\r\n */\r\nfunction requiresGlyphArea(menuItems: SciMenuItemLike[]): boolean {\r\n return menuItems.some(menuItem => {\r\n switch (menuItem.type) {\r\n case 'menu-item':\r\n return !!menuItem.iconLigature || !!menuItem.iconComponent || !!menuItem.checked;\r\n case 'group':\r\n return !!menuItem.collapsible || requiresGlyphArea(menuItem.children);\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Provides {@link SCI_MENU_COMPONENT_ROLE} for injection.\r\n *\r\n * Returns a host directive instead of a static provider to support component creation via {@link ViewContainerRef.createComponent}.\r\n */\r\nexport function provideMenuComponentRole(role: 'menu' | 'submenu' | 'group'): Type<unknown> {\r\n @Directive({providers: [{provide: SCI_MENU_COMPONENT_ROLE, useValue: role}]})\r\n class RoleProvider {\r\n }\r\n\r\n return RoleProvider;\r\n}\r\n\r\n/**\r\n * Provides {@link PopoverRef} for injection.\r\n */\r\nfunction providePopoverRef(): Provider {\r\n return {\r\n provide: PopoverRef,\r\n useFactory: () => {\r\n switch (inject(SCI_MENU_COMPONENT_ROLE)) {\r\n case 'menu':\r\n return new PopoverRef({isSubmenu: false}); // top-level menu or menu in action toolbar\r\n case 'submenu':\r\n return new PopoverRef({isSubmenu: true});\r\n case 'group':\r\n return inject(PopoverRef, {skipSelf: true});\r\n }\r\n },\r\n };\r\n}\r\n\r\n/**\r\n * Provides {@link MenuFilter} for injection.\r\n */\r\nfunction provideMenuFilter(): Provider {\r\n return {\r\n provide: MenuFilter,\r\n useFactory: () => {\r\n switch (inject(SCI_MENU_COMPONENT_ROLE)) {\r\n case 'menu':\r\n return new MenuFilter(null); // top-level menu or menu in action toolbar\r\n case 'submenu':\r\n return new MenuFilter(inject(MenuFilter, {skipSelf: true}));\r\n case 'group':\r\n return inject(MenuFilter, {skipSelf: true});\r\n }\r\n },\r\n };\r\n}\r\n\r\n/**\r\n * Indicates whether {@link SciMenuComponent} is acting as a menu, submenu, or group.\r\n */\r\nconst SCI_MENU_COMPONENT_ROLE = new InjectionToken<'menu' | 'submenu' | 'group'>('SCI_MENU_COMPONENT_ROLE');\r\n\r\n/**\r\n * Represents the preferred menu size.\r\n */\r\ninterface MenuSize {\r\n width?: string;\r\n minWidth?: string;\r\n maxWidth?: string;\r\n maxHeight?: string;\r\n}\r\n\r\n/**\r\n * Specifies the features of the group.\r\n */\r\nexport interface SciMenuGroupConfig {\r\n label?: string;\r\n collapsible: boolean;\r\n collapsed: boolean;\r\n hideGlyphArea: boolean;\r\n actions: SciMenuItemLike[];\r\n}\r\n","<!-- Filter Field -->\r\n@let filter = this.filter();\r\n@if (filter) {\r\n <div class=\"filter e2e-filter\">\r\n <sci-icon>scion.search</sci-icon>\r\n @let message = filter.placeholder?.() ?? '%scion.components.type_to_filter.action';\r\n <sci-menu-filter (textChange)=\"onFilterChange($event)\" [placeholder]=\"(message | sciText)()\"/>\r\n </div>\r\n <hr>\r\n}\r\n\r\n<!-- Group Header -->\r\n@if (group(); as group) {\r\n @if (group.collapsible) {\r\n <button class=\"group-header e2e-group-header\" (click)=\"onGroupHeaderButtonClick()\" (mouseenter)=\"onMenuItemMouseEnter(null)\">\r\n <sci-icon>{{isGroupExpanded() ? 'scion.chevron_down' : 'scion.chevron_right'}}</sci-icon>\r\n\r\n <div class=\"content\">\r\n <ng-container *ngTemplateOutlet=\"group_header_template\"/>\r\n </div>\r\n </button>\r\n } @else if (group.label) {\r\n <header class=\"group-header e2e-group-header\">\r\n <ng-container *ngTemplateOutlet=\"group_header_template\"/>\r\n </header>\r\n }\r\n\r\n <!-- Template for rendering group header. -->\r\n <ng-template #group_header_template>\r\n <sci-menu-group-label>{{group.label}}</sci-menu-group-label>\r\n\r\n @if (group.actions.length && !this.disabled()) {\r\n <sci-toolbar-group [menuItems]=\"group.actions\"\r\n [orientation]=\"'horizontal'\"\r\n [popoverViewContainerRef]=\"popoverViewContainerRef()\"\r\n (click)=\"$event.stopPropagation()\"\r\n class=\"actions e2e-actions\"/>\r\n }\r\n </ng-template>\r\n}\r\n\r\n<!-- Menu Items -->\r\n@if (isGroupExpanded()) {\r\n @if (maxHeight()) {\r\n <sci-viewport>\r\n <ng-container *ngTemplateOutlet=\"menu_items_template\"/>\r\n </sci-viewport>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"menu_items_template\"/>\r\n }\r\n\r\n <!-- Renders menu items. -->\r\n <ng-template #menu_items_template>\r\n @for (menuItem of menuItemsFiltered(); track $index) {\r\n @let disabled = this.disabled() || menuItem.disabled?.() || false;\r\n\r\n @switch (menuItem.type) {\r\n @case ('menu-item') {\r\n <!-- Menu Item -->\r\n @if (!menuItem.menu) {\r\n @let hasActionToolbar = !disabled && menuItem.actions?.length;\r\n @let showAcceleratorInTooltip = menuItem.accelerator && hasActionToolbar;\r\n\r\n <button [attr.disabled]=\"disabled || null\"\r\n [attr.title]=\"showAcceleratorInTooltip ? (menuItem.accelerator | sciFormatAccelerator:menuItem.tooltip?.()) : menuItem.tooltip?.()\"\r\n [class.checked]=\"menuItem.checked?.()\"\r\n [class.active]=\"menuItem.active?.()\"\r\n [class]=\"menuItem.cssClass\" class=\"menu-item e2e-menu-item\"\r\n [sciAttributes]=\"menuItem.attributes\"\r\n (mouseenter)=\"onMenuItemMouseEnter(menuItem)\"\r\n (click)=\"onSelect(menuItem)\">\r\n <!-- Render icon if glyph area. -->\r\n @if (hasGlyphArea() && !group()?.hideGlyphArea) {\r\n <ng-container *ngTemplateOutlet=\"icon_template; context: {$implicit: menuItem}\"/>\r\n }\r\n\r\n <!-- Render label, accelerator and action toolbar. -->\r\n <div class=\"content\">\r\n <ng-container *ngTemplateOutlet=\"label_template; context: {$implicit: menuItem}\"/>\r\n\r\n @if (menuItem.accelerator) {\r\n <span class=\"accelerator\">{{menuItem.accelerator | sciFormatAccelerator}}</span>\r\n }\r\n\r\n @if (hasActionToolbar) {\r\n <sci-toolbar-group [menuItems]=\"menuItem.actions!\"\r\n [orientation]=\"'horizontal'\"\r\n [popoverViewContainerRef]=\"popoverViewContainerRef()\"\r\n [class.menu-open]=\"actions_toolbar.menuOpen()\"\r\n class=\"actions e2e-actions\"\r\n (click)=\"$event.stopPropagation()\"\r\n #actions_toolbar/>\r\n }\r\n </div>\r\n </button>\r\n }\r\n\r\n <!-- Submenu Item -->\r\n @if (menuItem.menu) {\r\n <button [attr.disabled]=\"disabled || null\"\r\n [attr.title]=\"menuItem.tooltip?.()\"\r\n [class.open]=\"activeSubmenuItem()?.menuItem === menuItem\"\r\n [class]=\"menuItem.cssClass\" class=\"menu e2e-menu-item\"\r\n [sciAttributes]=\"menuItem.attributes\"\r\n (mouseenter)=\"onSubmenuItemMouseEnter({menuItem, element})\"\r\n (click)=\"onSubmenuItemClick({menuItem, element})\"\r\n #element>\r\n @if (hasGlyphArea() && !group()?.hideGlyphArea) {\r\n <!-- Render icon if glyph area. -->\r\n <ng-container *ngTemplateOutlet=\"icon_template; context: {$implicit: menuItem}\"/>\r\n }\r\n\r\n <!-- Render label. -->\r\n <div class=\"content\">\r\n <ng-container *ngTemplateOutlet=\"label_template; context: {$implicit: menuItem}\"/>\r\n <sci-icon class=\"chevron\">scion.chevron_right</sci-icon>\r\n </div>\r\n </button>\r\n }\r\n }\r\n @case ('group') {\r\n <sci-menu-group [group]=\"menuItem\"\r\n [glyphArea]=\"hasGlyphArea()\"\r\n [disabled]=\"disabled\"\r\n [cssClass]=\"menuItem.cssClass ?? []\"/>\r\n }\r\n }\r\n } @empty {\r\n <!-- TODO [Angular 23] Replace with optional chaining operator once the Angular compiler no longer logs the NG8107 false-positive warning. -->\r\n <!-- @let message = filter?.notFoundMessage?.() ?? '%scion.components.no_items.message'; -->\r\n @let message = (filter && filter.notFoundMessage?.()) ?? '%scion.components.no_items.message';\r\n <div class=\"message no-items e2e-no-items\">{{(message | sciText)()}}</div>\r\n }\r\n </ng-template>\r\n}\r\n\r\n<!-- Location where to insert the menu popover. Must not be a child of the menu item button to prevent hovering the menu item when hovering menu items in the popover. -->\r\n<ng-container #popover_view_container_ref/>\r\n\r\n<!-- Renders the icon of the passed menu item. -->\r\n<ng-template #icon_template let-menuItem>\r\n @if (menuItem.checked !== undefined) {\r\n <sci-icon>{{menuItem.checked() ? 'scion.checkmark' : undefined}}</sci-icon>\r\n } @else if (menuItem.iconLigature) {\r\n <sci-icon>{{menuItem.iconLigature()}}</sci-icon>\r\n } @else if (menuItem.iconComponent) {\r\n <sci-menu-item-icon>\r\n <ng-container *sciComponentOutlet=\"menuItem.iconComponent\"/>\r\n </sci-menu-item-icon>\r\n } @else {\r\n <sci-menu-item-icon/>\r\n }\r\n</ng-template>\r\n\r\n<!-- Renders the label of the passed menu item. -->\r\n<ng-template #label_template let-menuItem>\r\n @if (menuItem.labelText) {\r\n <sci-menu-item-label>\r\n {{menuItem.labelText()}}\r\n </sci-menu-item-label>\r\n } @else if (menuItem.labelComponent) {\r\n <sci-menu-item-label>\r\n <ng-container *sciComponentOutlet=\"menuItem.labelComponent\"/>\r\n </sci-menu-item-label>\r\n }\r\n</ng-template>\r\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ApplicationRef, Binding, ComponentRef, createComponent, DestroyRef, DOCUMENT, ElementRef, EnvironmentInjector, inject, Injectable, Injector, inputBinding, runInInjectionContext, signal, Signal, ViewContainerRef} from '@angular/core';\nimport {SciMenuItemLike} from './menu.model';\nimport {SciMenuOptions, SciMenuOrigin, SciMenuRef} from './menu.service';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {provideMenuComponentRole, SciMenuComponent} from './menu/menu.component';\nimport {dimension} from '@scion/components/dimension';\nimport {UUID} from '@scion/toolkit/uuid';\nimport {coerceSignal, createDestroyableInjector} from '@scion/components/common';\nimport {ɵSciMenuService} from './ɵmenu.service';\nimport {Arrays} from '@scion/toolkit/util';\nimport {Translatable} from '@scion/components/text';\nimport {SciMenuFilterConfig} from './menu/menu.factory';\n\n@Injectable({providedIn: 'root'})\nexport class SciMenuOpener {\n\n private readonly _injector = inject(Injector);\n\n /**\n * Opens the specified menu at the specified position.\n */\n public openMenu(menu: `menu:${string}` | SciMenuItemLike[], options: SciMenuOptions): SciMenuRef {\n const injector = createDestroyableInjector({parent: this._injector});\n const menuItems = Array.isArray(menu) ? signal(menu) : this.menuService.menuItems(menu, options.context ?? new Map(), {injector, metadata: options.metadata});\n\n return runInInjectionContext(injector, () => {\n // Get or create anchor at specified origin.\n const anchorElement = options.anchor instanceof ElementRef || options.anchor instanceof HTMLElement ? coerceElement(options.anchor) : this.createVirtualAnchor(options.anchor, {viewContainerRef: options.viewContainerRef});\n\n // Create menu popover.\n const componentRef = this.createMenuPopover(menuItems, anchorElement, options);\n componentRef.onDestroy(() => injector.destroy());\n\n return {\n close: () => componentRef.destroy(),\n onClose: onClose => componentRef.hostView.destroyed ? onClose() : componentRef.onDestroy(onClose), // Call callback immediately if already destroyed.\n };\n });\n }\n\n /**\n * Creates a menu popover displaying the specified menu items.\n */\n private createMenuPopover(menuItems: Signal<SciMenuItemLike[]>, anchorElement: HTMLElement, options: SciMenuOptions): ComponentRef<SciMenuComponent> {\n const anchorSize = dimension(anchorElement);\n const align = options.align ?? 'vertical';\n\n const bindings: Binding[] = [\n inputBinding('menuItems', menuItems),\n inputBinding('filter', () => coerceFilterConfig(options.filter)),\n inputBinding('width', () => options.width),\n inputBinding('minWidth', () => options.minWidth),\n inputBinding('maxWidth', () => options.maxWidth),\n inputBinding('maxHeight', () => options.maxHeight),\n inputBinding('anchorWidth', () => align === 'vertical' ? anchorSize().offsetWidth : undefined),\n inputBinding('cssClass', () => Arrays.coerce(options.cssClass)),\n inputBinding('attributes', () => options.attributes),\n ];\n\n // Create menu component and attach it to the DOM.\n const componentRef = (() => {\n const role = options.submenu ? 'submenu' : 'menu';\n\n if (options.viewContainerRef) {\n return options.viewContainerRef.createComponent(SciMenuComponent, {\n directives: [provideMenuComponentRole(role)],\n bindings,\n });\n }\n else {\n const componentRef = createComponent(SciMenuComponent, {\n environmentInjector: inject(EnvironmentInjector),\n directives: [provideMenuComponentRole(role)],\n bindings,\n });\n\n // Insert popover after the anchor node.\n anchorElement.after(componentRef.location.nativeElement as Element);\n\n // Attach component to Angular component tree for change detection.\n inject(ApplicationRef).attachView(componentRef.hostView);\n\n return componentRef;\n }\n })();\n\n // Bind popover to anchor.\n const popoverElement = componentRef.location.nativeElement as HTMLElement;\n this.bindPopoverToAnchor({popoverElement, anchorElement, align, offset: options.offset});\n\n // Destroy component when closing the popover.\n popoverElement.addEventListener('toggle', (event: ToggleEvent): void => {\n if (event.newState === 'closed') {\n componentRef.destroy();\n }\n });\n\n // Run change detection.\n componentRef.changeDetectorRef.detectChanges();\n\n // Show popover.\n popoverElement.showPopover();\n\n return componentRef;\n }\n\n /**\n * Positions the popover relative to the anchor element.\n */\n private bindPopoverToAnchor(binding: {popoverElement: HTMLElement; anchorElement: HTMLElement; align: 'vertical' | 'horizontal'; offset?: {x?: number; y?: number}}): void {\n const {popoverElement, anchorElement, align} = binding;\n const popoverId = `scimenu-${UUID.randomUUID().substring(0, 8)}`;\n\n // Connect anchor to popover.\n setAttributes(anchorElement, {\n 'popovertarget': popoverId,\n 'popovertargetaction': 'show',\n });\n setStyles(anchorElement, {\n 'anchor-name': `--${popoverId}`,\n });\n\n // Connect popover to anchor.\n setAttributes(popoverElement, {\n 'id': popoverId,\n 'popover': 'auto',\n });\n\n // Position popover relative to anchor.\n if (align === 'horizontal') {\n setStyles(popoverElement, {\n 'position-anchor': `--${popoverId}`,\n 'position-try-fallbacks': 'flip-inline, flip-block, flip-inline flip-block',\n 'top': `calc(anchor(top) - var(--ɵsci-menu-padding-block) + ${binding.offset?.y ?? 0}px)`,\n 'left': `calc(anchor(right) + ${binding.offset?.x ?? 0}px)`,\n });\n }\n else {\n setStyles(popoverElement, {\n 'position-anchor': `--${popoverId}`,\n 'position-try-fallbacks': 'flip-block',\n 'top': `calc(anchor(bottom) + ${binding.offset?.y ?? 0}px)`,\n 'left': `min(calc(anchor(left) + ${binding.offset?.x ?? 0}px), calc(100% - var(--ɵsci-menu-width)))`, // `calc(100% - var(--ɵsci-menu-width))` prevents pushing the popover out of the page viewport on the right\n });\n }\n\n // Mark the anchor as open to support opening the menu from a toolbar button, not a toolbar menu button, e.g., to support opening a menu via accelerator.\n if (anchorElement.classList.contains('toolbar-button')) {\n anchorElement.classList.add('menu-open');\n }\n\n // Remove attributes and styles from the anchor element when the popover is closed, but only if not displaying another popover in the meantime.\n // No cleanup is required for the popover element because it is destroyed when closed.\n inject(DestroyRef).onDestroy(() => {\n if (anchorElement.getAttribute('popovertarget') !== popoverId) {\n return;\n }\n\n setAttributes(anchorElement, {\n 'popovertarget': null,\n 'popovertargetaction': null,\n });\n setStyles(anchorElement, {\n 'anchor-name': null,\n });\n if (anchorElement.classList.contains('toolbar-button')) {\n anchorElement.classList.remove('menu-open');\n }\n });\n }\n\n /**\n * Creates a DOM element at the given pointer position or coordinate, optionally with a given dimension.\n */\n private createVirtualAnchor(anchor: MouseEvent | SciMenuOrigin, options: {viewContainerRef?: ViewContainerRef}): HTMLElement {\n // Coerce coordinates.\n const {x, y, width, height} = anchor instanceof MouseEvent ? ({x: anchor.x, y: anchor.y}) : anchor;\n\n // Create virtual anchor element at anchor bounds.\n const virtualAnchorElement = inject(DOCUMENT).createElement('div');\n inject(DestroyRef).onDestroy(() => virtualAnchorElement.remove());\n\n // Position the anchor element.\n setStyles(virtualAnchorElement, {\n 'position': 'fixed',\n 'left': `${x}px`,\n 'top': `${y}px`,\n 'width': width ? `${width}px` : '0',\n 'height': height ? `${height}px` : '0',\n 'pointer-events': 'none',\n });\n\n // Attach the anchor element to the DOM.\n if (options.viewContainerRef) {\n (options.viewContainerRef.element.nativeElement as Element).after(virtualAnchorElement);\n }\n else {\n inject(DOCUMENT).body.appendChild(virtualAnchorElement);\n }\n\n return virtualAnchorElement;\n }\n\n /**\n * Provides a reference to {@link ɵSciMenuService}.\n *\n * Note:\n * - {@link ɵSciMenuService} cannot be injected during construction as this would lead to an injection cycle.\n * - Do not use {@link SciMenuRegistry} directly to proxy calls through the adapter chain.\n */\n private get menuService(): ɵSciMenuService {\n return this._injector.get(ɵSciMenuService);\n }\n}\n\n/**\n * Sets the specified attributes on the given element. Passing `null` for an attribute removes it.\n */\nfunction setAttributes(element: HTMLElement, attributes: {[name: string]: string | null}): void {\n Object.entries(attributes).forEach(([name, value]) => {\n if (value === null) {\n element.removeAttribute(name);\n }\n else {\n element.setAttribute(name, value);\n }\n });\n}\n\n/**\n * Sets the specified styles on the given element. Passing `null` for a style removes it.\n */\nfunction setStyles(element: HTMLElement, styles: {[style: string]: string | null}): void {\n Object.entries(styles).forEach(([name, value]) => {\n if (value === null) {\n element.style.removeProperty(name);\n }\n else {\n element.style.setProperty(name, value);\n }\n });\n}\n\n/**\n * Coerces passed filter into a {@link SciMenuFilterConfig}, or `undefined` if a menu without filtering.\n */\nfunction coerceFilterConfig(filter: SciMenuOptions['filter'] | undefined): SciMenuFilterConfig<Signal<Translatable>> | undefined {\n if (typeof filter === 'object') {\n return {\n placeholder: coerceSignal(filter.placeholder),\n notFoundMessage: coerceSignal(filter.notFoundMessage),\n focus: filter.focus,\n };\n }\n return filter === true ? {} : undefined;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Arrays, prune} from '@scion/toolkit/util';\nimport {constructMenu} from '../menu/ɵmenu.factory';\nimport {translate} from '../menu-translate.util';\nimport {SciMenubarFactory, SciMenubarMenuDescriptor} from './menubar.factory';\nimport {SciMenuFactory} from '../menu/menu.factory';\nimport {SciMenuItem} from '../menu.model';\nimport {coerceSignal} from '@scion/components/common';\n\n/**\n * Translation note: Texts are translated when added (not lazily when rendered) to simplify filtering.\n */\nexport class ɵSciMenubarFactory implements SciMenubarFactory {\n\n public readonly menuItems = [] as SciMenuItem[];\n\n /** @inheritDoc */\n public addMenu(descriptor: SciMenubarMenuDescriptor, menuFactoryFn: (menu: SciMenuFactory) => void): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n labelText: translate(descriptor.label),\n visible: coerceSignal(descriptor.visible),\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n menu: constructMenu(menuFactoryFn, descriptor.menu),\n }));\n\n return this;\n }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ApplicationRef, assertNotInReactiveContext, computed, DestroyableInjector, DestroyRef, inject, Injectable, Injector, Provider, runInInjectionContext, signal, Signal, untracked, WritableSignal} from '@angular/core';\nimport {SciMenuRegistry} from './menu.registry';\nimport {Disposable} from '@scion/toolkit/types';\nimport {SciMenuGroup, SciMenuItem, SciMenuItemLike} from './menu.model';\nimport {SciMenuOptions, SciMenuRef} from './menu.service';\nimport {Arrays, Maps, Objects, prune} from '@scion/toolkit/util';\nimport {ɵSciMenuFactory} from './menu/ɵmenu.factory';\nimport {ɵSciToolbarFactory} from './toolbar/ɵtoolbar.factory';\nimport {sortMenuItems} from './menu-item-sorter';\nimport {SciMenubarFactoryFn, SciMenuContribution, SciMenuContributionLocationLike, SciMenuContributionOptions, SciMenuContributionPositionLike, SciMenuFactoryFn, SciMenuFactoryFnLike, SciToolbarFactoryFn} from './menu-contribution.model';\nimport {assertInInjectionContext, createDestroyableInjector} from '@scion/components/common';\nimport {SciMenuAdapter} from './menu-adapter.model';\nimport {SciMenuContributionInstantProvider} from './menu-contribution-instant.provider';\nimport {ɵSciMenuService} from './ɵmenu.service';\nimport {SciMenuOpener} from './menu-opener.service';\nimport {ɵSciMenubarFactory} from './menubar/ɵmenubar.factory';\nimport {collectMenuItemsWithAccelerator, SciKeyboardAccelerator} from './menu-accelerators';\nimport {POPOVER_REFS} from './menu/popover-ref';\nimport {injectMenuInjectionContextProviders} from './menu-environment/menu-environment-providers';\n\n@Injectable({providedIn: 'root'})\nexport class ɵSciMenuRegistry implements SciMenuRegistry, SciMenuAdapter {\n\n private readonly _contributions = new Map<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`, WritableSignal<SciMenuContribution[]>>();\n private readonly _menuItemsCache = new MenuItemsCache();\n private readonly _contributionInstantProvider = inject(SciMenuContributionInstantProvider);\n private readonly _menuOpener = inject(SciMenuOpener);\n private readonly _menuPopovers = inject(POPOVER_REFS);\n private readonly _injector = inject(Injector);\n\n /** @inheritDoc */\n public contributeMenu(locationLike: SciMenuContributionLocationLike, factoryFn: SciMenuFactoryFnLike, options: SciMenuContributionOptions): Disposable {\n const {location, before, after, position} = locationLike;\n\n const contribution: SciMenuContribution = {\n type: parseMenuLocationType(location),\n factoryFn: factoryFn,\n position: prune({before, after, position} as SciMenuContributionPositionLike, {pruneIfEmpty: true}),\n requiredContext: prune(options.requiredContext) ?? new Map<string, unknown>(), // prune cleared context values\n contributionInstant: options.contributionInstant ?? this._contributionInstantProvider.next(),\n metadata: options.metadata ?? {},\n };\n\n if (this._contributions.has(location)) {\n this._contributions.get(location)!.update(contributions => contributions.concat(contribution));\n }\n else {\n this._contributions.set(location, signal([contribution]));\n }\n\n return {\n dispose: () => {\n // Retain the signal in the contribution map even if empty. Consumers may hold a reference and expect updates\n // when a new contribution is registered for this location.\n this._contributions.get(location)!.update(contributions => contributions.filter(it => it !== contribution));\n this._menuItemsCache.remove(contribution);\n },\n };\n }\n\n /** @inheritDoc */\n public menuContributions(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuContribution[]> {\n assertNotInReactiveContext(this.menuContributions, 'Call menuContributions() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n return computed(() => {\n // Ensure signal is registered in the contribution map to get notified when a contribution is added to this location.\n if (!this._contributions.has(location())) {\n this._contributions.set(location(), signal([]));\n }\n const contributions = this._contributions.get(location())!();\n const callingContext = prune(context()); // prune cleared context values\n\n return untracked(() => contributions\n // Filter contributions not matching the calling context.\n .filter(contribution => {\n const requiredContext = contribution.requiredContext;\n for (const [requiredContextName, requiredContextValue] of requiredContext.entries()) {\n // Do not match contribution if required entry is missing.\n if (requiredContextValue === '*' && !callingContext.has(requiredContextName)) {\n return false;\n }\n\n // Do not match contribution if required value is different.\n if (requiredContextValue !== '*' && !Objects.isEqual(callingContext.get(requiredContextName), requiredContextValue, {ignoreArrayOrder: true})) {\n return false;\n }\n }\n return true;\n })\n // Sort by contribution instant to maintain a stable order when contributions are replaced.\n .sort((a, b) => a.contributionInstant - b.contributionInstant),\n );\n }, {equal: (a, b) => Objects.isEqual(a, b)});\n }\n\n /** @inheritDoc */\n public menuItems(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuItemLike[]> {\n assertNotInReactiveContext(this.menuItems, 'Call menuItems() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n if (!options.injector) {\n assertInInjectionContext(this.menuItems, 'Call menuItems() in an injection context. It may allocate resources that are not released until the injection context is destroyed.');\n }\n\n const callingContextInjector = options.injector ?? inject(Injector);\n const menuService = this.menuService;\n const menuItemsCache = this._menuItemsCache;\n\n // Get contributions matching the location.\n const menuContributions = menuService.menuContributions(location, context, options); // Do not invoke method directly to go through the adapter chain.\n\n // Get menu items of contributions.\n return computed(() => {\n if (!menuContributions().length) {\n return [];\n }\n const callingContext = prune(context()); // prune cleared context values\n const menuItems = menuContributions()\n // Instantiate contribution, recursively (submenus and menus in action toolbars).\n .flatMap(menuContribution => untracked(() => computeMenuItems(menuContribution, callingContext))())\n // Remove invisible menu items, recursively.\n .flatMap(filterInvisibleMenuItems)\n // Federate menu items, recursively.\n .map(menuItem => federateMenuItems(menuItem, callingContext, {metadata: options.metadata}))\n // Remove empty groups and submenus, recursively. Filtering must be after federation to not remove named placeholder groups or submenus.\n .flatMap(filterEmptyMenuItems);\n\n return sortMenuItems(menuItems);\n });\n\n /**\n * Gets the menu items of the given contribution used in the given context.\n */\n function computeMenuItems(menuContribution: SciMenuContribution, context: Map<string, unknown>): Signal<SciMenuItemLike[]> {\n assertNotInReactiveContext(computeMenuItems, 'Call computeMenuItems() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n // Instantiate the contribution if absent, recursively (submenus and menus in action toolbars).\n return menuItemsCache.computeIfAbsent(menuContribution, context, () => {\n // Note: Function invoked in root injection context, which is destroyed when the last consumer (location) is disposed.\n\n // Inject dependency injection providers for the given menu context.\n const menuEnvironmentInjectionContextProviders = injectMenuInjectionContextProviders(context, {injector: callingContextInjector});\n const menuEnvironmentInjectionContext = createDestroyableInjector({parent: inject(Injector), providers: menuEnvironmentInjectionContextProviders});\n\n return computed(() => {\n const menuItems = (() => {\n switch (menuContribution.type) {\n case 'menu': {\n const menuFactory = new ɵSciMenuFactory();\n const menuFactoryFn = menuContribution.factoryFn as SciMenuFactoryFn;\n runInInjectionContext(menuEnvironmentInjectionContext, () => menuFactoryFn(menuFactory, context));\n return menuFactory.menuItems;\n }\n case 'toolbar': {\n const toolbarFactory = new ɵSciToolbarFactory();\n const toolbarFactoryFn = menuContribution.factoryFn as SciToolbarFactoryFn;\n runInInjectionContext(menuEnvironmentInjectionContext, () => toolbarFactoryFn(toolbarFactory, context));\n return toolbarFactory.menuItems;\n }\n case 'menubar': {\n const menubarFactory = new ɵSciMenubarFactory();\n const menubarFactoryFn = menuContribution.factoryFn as SciMenubarFactoryFn;\n runInInjectionContext(menuEnvironmentInjectionContext, () => menubarFactoryFn(menubarFactory, context));\n return menubarFactory.menuItems;\n }\n }\n })();\n return menuItems\n // Add contribution's position to top-level menu items.\n .map(menuItem => ({...menuItem, position: menuContribution.position}))\n // Add providers to components (label, icon, control), recursively.\n .map(menuItem => provideProviders(menuItem, menuEnvironmentInjectionContextProviders));\n });\n }, {injector: callingContextInjector});\n }\n\n /**\n * Federates passed menu or group with contributions based on its name. Federation is recursive.\n */\n function federateMenuItems(menuItem: SciMenuItemLike, context: Map<string, unknown>, options?: {metadata?: {[key: string]: unknown}}): SciMenuItemLike {\n const federatedItem = {...menuItem};\n\n // Federate actions.\n if (federatedItem.actions?.length) {\n federatedItem.actions = sortMenuItems(federatedItem.actions.map(action => federateMenuItems(action, context, options)));\n }\n\n // Federate group.\n if (federatedItem.type === 'group') {\n const contributions = federatedItem.name ? untracked(() => menuService.menuItems(federatedItem.name!, context, {injector: callingContextInjector, metadata: options?.metadata}))() : [];\n\n federatedItem.children = sortMenuItems([\n ...federatedItem.children.map(child => federateMenuItems(child, context, options)),\n ...contributions,\n ]);\n }\n\n // Federate submenu.\n if (federatedItem.type === 'menu-item' && federatedItem.menu) {\n const contributions = federatedItem.menu.name ? untracked(() => menuService.menuItems(federatedItem.menu!.name!, context, {injector: callingContextInjector, metadata: options?.metadata}))() : [];\n\n federatedItem.menu = {\n ...federatedItem.menu,\n children: sortMenuItems([\n ...federatedItem.menu.children.map(child => federateMenuItems(child, context, options)),\n ...contributions,\n ]),\n };\n }\n\n return federatedItem;\n }\n\n /**\n * Registers given providers in components (label, icon, control) of the menu item, recursively.\n */\n function provideProviders(menuItem: SciMenuItemLike, providers: Provider[]): SciMenuItemLike {\n switch (menuItem.type) {\n case 'menu-item': {\n return {\n ...menuItem,\n iconComponent: menuItem.iconComponent && {\n ...menuItem.iconComponent,\n providers: providers.concat(menuItem.iconComponent.providers ?? []),\n },\n labelComponent: menuItem.labelComponent && {\n ...menuItem.labelComponent,\n providers: providers.concat(menuItem.labelComponent.providers ?? []),\n },\n control: menuItem.control && {\n ...menuItem.control,\n providers: providers.concat(menuItem.control.providers ?? []),\n },\n actions: menuItem.actions?.map(menuItem => provideProviders(menuItem, providers)),\n menu: menuItem.menu && {\n ...menuItem.menu,\n children: menuItem.menu.children.map(menuItem => provideProviders(menuItem, providers)),\n },\n } satisfies SciMenuItem;\n }\n case 'group': {\n return {\n ...menuItem,\n children: menuItem.children.map(menuItem => provideProviders(menuItem, providers)),\n actions: menuItem.actions?.map(menuItem => provideProviders(menuItem, providers)),\n } satisfies SciMenuGroup;\n }\n }\n }\n }\n\n /** @inheritDoc */\n public openMenu(menu: `menu:${string}` | SciMenuItemLike[], options: SciMenuOptions): SciMenuRef {\n return this._menuOpener.openMenu(menu, options);\n }\n\n /** @inheritDoc */\n public closeMenus(): void {\n this._menuPopovers().forEach(popover => popover.close());\n }\n\n /** @inheritDoc */\n public accelerators(context: Signal<Map<string, unknown>>): Signal<SciKeyboardAccelerator[]> {\n return this._menuItemsCache.accelerators(context);\n }\n\n /**\n * Reference to the menu service.\n *\n * Use to call methods like {@link ɵSciMenuService.menuContributions} or {@link ɵSciMenuService.menuItems} through the adapter chain.\n */\n private get menuService(): ɵSciMenuService {\n return this._injector.get(ɵSciMenuService);\n }\n}\n\n/**\n * Recursively removes groups and submenus that contain no menu items.\n *\n * Returns a single-entry array containing the filtered menu item, or an empty array if it has no children, enabling usage in `flatMap`.\n */\nfunction filterEmptyMenuItems(menuItem: SciMenuItemLike): [SciMenuItemLike] | [] {\n switch (menuItem.type) {\n case 'menu-item': {\n const children = menuItem.menu?.children.flatMap(filterEmptyMenuItems) ?? [];\n const actions = menuItem.actions?.flatMap(filterEmptyMenuItems);\n return children.length || menuItem.onSelect || menuItem.control ? [{...menuItem, actions, menu: menuItem.menu && {...menuItem.menu, children}}] : [];\n }\n case 'group': {\n const children = menuItem.children.flatMap(filterEmptyMenuItems);\n const actions = menuItem.actions?.flatMap(filterEmptyMenuItems);\n return children.length ? [{...menuItem, actions, children}] : [];\n }\n }\n}\n\n/**\n * Recursively removes invisible groups and submenus.\n *\n * Returns a single-entry array containing the filtered menu item, or an empty array if not visible, enabling usage in `flatMap`.\n */\nfunction filterInvisibleMenuItems(menuItem: SciMenuItemLike): [SciMenuItemLike] | [] {\n if (!(menuItem.visible?.() ?? true)) {\n return [];\n }\n\n switch (menuItem.type) {\n case 'menu-item': {\n const children = menuItem.menu?.children.flatMap(filterInvisibleMenuItems) ?? [];\n const actions = menuItem.actions?.flatMap(filterInvisibleMenuItems);\n return [{...menuItem, actions, menu: menuItem.menu && {...menuItem.menu, children}}];\n }\n case 'group': {\n const actions = menuItem.actions?.flatMap(filterInvisibleMenuItems);\n const children = menuItem.children.flatMap(filterInvisibleMenuItems);\n return [{...menuItem, actions, children}];\n }\n }\n}\n\n/**\n * Parses the type of given location. One of `menu`, `toolbar`,`menubar`.\n */\nfunction parseMenuLocationType(location: `menu:${string}` | `toolbar:${string}` | `menubar:${string}`): 'menu' | 'toolbar' | 'menubar' {\n return /^(?<type>(menu|toolbar|menubar)):(?<name>.+)$/.exec(location)!.groups!['type'] as 'menu' | 'toolbar' | 'menubar';\n}\n\n/**\n * Cache for instantiated contributions in a specific context.\n */\nclass MenuItemsCache {\n\n private readonly _cache = signal(new Set<CacheEntry>());\n private readonly _cacheByContribution = computed(() => {\n return Array.from(this._cache()).reduce((map, cacheEntry) => Maps.addListValue(map, cacheEntry.contribution, cacheEntry), new Map<SciMenuContribution, CacheEntry[]>());\n });\n\n /**\n * Gets the menu items of the given contribution used in the given context. Menu items are constructed via the passed factory function if absent (on cache miss).\n *\n * Menu items are cached. Cached menu items are evicted when no longer used, tracked via a reference count based on the provided injector;\n * once all tracked injectors for a cache entry are destroyed, the cache entry is evicted.\n *\n * The factory function is invoked in the root injection context. The injection context is destroyed when the last consumer (location) is disposed.\n */\n public computeIfAbsent(contribution: SciMenuContribution, context: Map<string, unknown>, computeFn: () => Signal<SciMenuItemLike[]>, options: {injector: Injector}): Signal<SciMenuItemLike[]> {\n assertNotInReactiveContext(this.computeIfAbsent, 'Call computeIfAbsent() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n const cacheEntry = this._cacheByContribution().get(contribution)?.find(cacheEntry => Objects.isEqual(cacheEntry.context, context)) ?? (() => {\n const rootInjector = options.injector.get(ApplicationRef).injector;\n const cacheEntryInjector = createDestroyableInjector({parent: rootInjector});\n const cacheEntry: CacheEntry = {\n injector: cacheEntryInjector,\n contribution,\n menuItems: runInInjectionContext(cacheEntryInjector, computeFn),\n context,\n refCount: 0,\n dispose: () => cacheEntryInjector.destroy(),\n };\n this._cache.update(cache => new Set(cache).add(cacheEntry));\n return cacheEntry;\n })();\n\n cacheEntry.refCount++;\n\n // Decrement reference count when tracked injector is destroyed.\n options.injector.get(DestroyRef).onDestroy(() => {\n if (--cacheEntry.refCount === 0) {\n // Dispose when no longer used.\n cacheEntry.dispose();\n this._cache.update(cache => {\n const cacheCopy = new Set(cache);\n cacheCopy.delete(cacheEntry);\n return cacheCopy;\n });\n }\n });\n\n return cacheEntry.menuItems;\n }\n\n /**\n * Removes menu items of the given contribution from the cache.\n */\n public remove(contribution: SciMenuContribution): void {\n assertNotInReactiveContext(this.remove, 'Call remove() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n const cacheEntriesToRemove = this._cacheByContribution().get(contribution) ?? [];\n this._cache.update(cache => {\n const cacheCopy = new Set(cache);\n\n cacheEntriesToRemove.forEach(cacheEntry => {\n cacheEntry.dispose();\n cacheCopy.delete(cacheEntry);\n });\n\n return cacheCopy;\n });\n }\n\n /**\n * Gets installed keyboard accelerators for menu items that match the given context.\n *\n * A match does not require an identical context. All common context keys must have identical context values.\n */\n public accelerators(context: Signal<Map<string, unknown>>): Signal<SciKeyboardAccelerator[]> {\n return computed(() => {\n const accelerators = Array.from(this._cache().values())\n .filter(cacheEntry => {\n for (const [name, value] of prune(context().entries())) { // prune cleared context values\n // Do not match contribution if required entry is missing.\n if (value === '*' && !cacheEntry.context.has(name)) {\n return false;\n }\n\n // Do not match if context key maps to a different value.\n if (value !== '*' && cacheEntry.context.has(name) && !Objects.isEqual(cacheEntry.context.get(name), value, {ignoreArrayOrder: true})) {\n return false;\n }\n }\n return true;\n })\n .flatMap(cacheEntry => collectMenuItemsWithAccelerator(cacheEntry.menuItems()))\n .filter(menuItem => !menuItem.disabled?.() && (menuItem.visible?.() ?? true))\n .map(menuItem => menuItem.accelerator!);\n\n // Remove duplicate accelerators.\n return Arrays.distinct(accelerators, accelerator => `${accelerator.shift}/${accelerator.ctrl}/${accelerator.alt}/${accelerator.key.toLowerCase()}/${accelerator.location}`);\n }, {equal: (a, b) => Objects.isEqual(a, b, {ignoreArrayOrder: true})});\n }\n}\n\n/**\n * Cache entry for the menu items of a contribution currently used in the application.\n */\nexport interface CacheEntry {\n /**\n * Reference to the contribution.\n */\n contribution: SciMenuContribution;\n /**\n * Context in which the contribution is used.\n */\n context: Map<string, unknown>;\n /**\n * Injector that was used to instantiate the contribution; destroyed when the cache entry is evicted.\n */\n injector: DestroyableInjector;\n /**\n * Menu items of the contribution.\n */\n menuItems: Signal<SciMenuItemLike[]>;\n /**\n * Reference count of consumers using this cache entry.\n */\n refCount: number;\n /**\n * Disposes this entry, destroying the {@link injector} to release allocated resources.\n */\n dispose: () => void;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Disposable} from '@scion/toolkit/types';\nimport {SciMenuContribution, SciMenuContributionLocationLike, SciMenuContributionOptions, SciMenuFactoryFnLike} from './menu-contribution.model';\nimport {SciMenuItemLike} from './menu.model';\nimport {SciMenuOptions, SciMenuRef} from './menu.service';\nimport {ɵSciMenuRegistry} from './ɵmenu.registry';\nimport {Injectable, Injector, Signal} from '@angular/core';\nimport {SciKeyboardAccelerator} from './menu-accelerators';\n\n// TODO [menu] documentation\n@Injectable({providedIn: 'root', useExisting: ɵSciMenuRegistry})\nexport abstract class SciMenuRegistry {\n\n public abstract contributeMenu(locationLike: SciMenuContributionLocationLike, factoryFn: SciMenuFactoryFnLike, options: SciMenuContributionOptions): Disposable;\n\n public abstract menuContributions(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuContribution[]>;\n\n public abstract menuItems(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuItemLike[]>;\n\n public abstract openMenu(menu: `menu:${string}` | SciMenuItemLike[], options: SciMenuOptions): SciMenuRef;\n\n public abstract closeMenus(): void;\n\n /**\n * Gets installed keyboard accelerators for menu items that match the given context.\n *\n * A match does not require an identical context. All common context keys must have identical context values.\n */\n public abstract accelerators(context: Signal<Map<string, unknown>>): Signal<SciKeyboardAccelerator[]>;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable, Injector, Signal} from '@angular/core';\nimport {SciMenuOptions, SciMenuRef} from './menu.service';\nimport {Disposable} from '@scion/toolkit/types';\nimport {SciMenuItemLike} from './menu.model';\nimport {SciMenuContribution, SciMenuContributionLocationLike, SciMenuContributionOptions, SciMenuFactoryFnLike} from './menu-contribution.model';\nimport {SciKeyboardAccelerator} from './menu-accelerators';\n\n/**\n * Enables integrators to intercept the registration and retrieval of menu contributions and to control where menu popovers open.\n *\n * Adapters can handle or augment calls. Multiple adapters form a chain and are called one by one in registration order.\n *\n * Calling 'next' passes the call to the next adapter, or to the registry if it is the last adapter in the chain.\n *\n * TODO [menu] documentation\n *\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\n */\n@Injectable()\nexport abstract class SciMenuAdapter {\n\n public abstract contributeMenu?(location: SciMenuContributionLocationLike, factoryFn: SciMenuFactoryFnLike, options: SciMenuContributionOptions, next: SciMenuAdapterChain): Disposable;\n\n public abstract menuContributions?(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}, next: SciMenuAdapterChain): Signal<SciMenuContribution[]>;\n\n public abstract menuItems?(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}, next: SciMenuAdapterChain): Signal<SciMenuItemLike[]>;\n\n public abstract openMenu?(menu: `menu:${string}` | SciMenuItemLike[], options: SciMenuOptions, next: SciMenuAdapterChain): SciMenuRef;\n\n public abstract closeMenus?(next: SciMenuAdapterChain): void;\n\n public abstract accelerators?(context: Signal<Map<string, unknown>>, next: SciMenuAdapterChain): Signal<SciKeyboardAccelerator[]>;\n}\n\n/**\n * Represents the next adapter in the adapter chain.\n */\nexport interface SciMenuAdapterChain {\n\n contributeMenu(location: SciMenuContributionLocationLike, factoryFn: SciMenuFactoryFnLike, options: SciMenuContributionOptions): Disposable;\n\n menuContributions(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuContribution[]>;\n\n menuItems(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuItemLike[]>;\n\n openMenu(menu: `menu:${string}` | SciMenuItemLike[], options: SciMenuOptions): SciMenuRef;\n\n closeMenus(): void;\n\n accelerators(context: Signal<Map<string, unknown>>): Signal<SciKeyboardAccelerator[]>;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {SciMenuOptions, SciMenuRef, SciMenuService} from './menu.service';\nimport {computed, inject, Injectable, Injector, Signal} from '@angular/core';\nimport {SciMenuItemLike} from './menu.model';\nimport {Disposable} from '@scion/toolkit/types';\nimport {SciMenuContribution, SciMenuContributionLocationLike, SciMenuContributionOptions, SciMenuFactoryFnLike} from './menu-contribution.model';\nimport {coerceSignal, MaybeSignal} from '@scion/components/common';\nimport {SciMenuRegistry} from './menu.registry';\nimport {SciMenuAdapter, SciMenuAdapterChain} from './menu-adapter.model';\nimport {SciKeyboardAccelerator} from './menu-accelerators';\nimport {injectMenuContext} from './menu-environment/menu-environment-providers';\n\n/**\n * // TODO [menu] documentation\n *\n * @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this service.\n */\n@Injectable({providedIn: 'root'})\nexport class ɵSciMenuService implements SciMenuService {\n\n private readonly _menuRegistry = interceptMenuRegistry(inject(SciMenuRegistry));\n private readonly _environmentContext = injectMenuContext();\n\n /** @inheritDoc */\n public open(menu: `menu:${string}` | SciMenuItemLike[], options: SciMenuOptions): SciMenuRef {\n const context = new Map([...this._environmentContext(), ...options.context ?? new Map()]);\n\n // Prevent user agent defaults when opening context menu.\n if (options.anchor instanceof MouseEvent && options.anchor.type === 'contextmenu') {\n options.anchor.preventDefault();\n options.anchor.stopPropagation();\n }\n\n return this._menuRegistry.openMenu(menu, {...options, context});\n }\n\n /** @inheritDoc */\n public closeAll(): void {\n this._menuRegistry.closeMenus();\n }\n\n /**\n * The function:\n * - Must be called within an injection context, or an explicit {@link Injector} passed.\n * - Must be called in a non-reactive (non-tracking) context.\n *\n * @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this method.\n */\n public menuItems(location: MaybeSignal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: MaybeSignal<Map<string, unknown>>, options?: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuItemLike[]> {\n return this._menuRegistry.menuItems(coerceSignal(location), coerceSignal(context), options ?? {});\n }\n\n /** @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this method. */\n public menuContributions(location: MaybeSignal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: MaybeSignal<Map<string, unknown>>, options?: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuContribution[]> {\n return this._menuRegistry.menuContributions(coerceSignal(location), coerceSignal(context), options ?? {});\n }\n\n /** @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this method. */\n public contributeMenu(location: SciMenuContributionLocationLike, factoryFn: SciMenuFactoryFnLike, options?: SciMenuContributionOptions): Disposable {\n return this._menuRegistry.contributeMenu(location, factoryFn, options ?? {});\n }\n\n /**\n * Gets installed keyboard accelerators for menu items that match the given context.\n *\n * A match does not require an identical context. All common context keys must have identical context values.\n *\n * Inherits the context from the current injector hierarchy, but can be overridden via `context` options. See {@link provideMenuContextProvider}.\n *\n * @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this method.\n */\n public accelerators(options?: {context?: MaybeSignal<Map<string, unknown>>}): Signal<SciKeyboardAccelerator[]> {\n const context = computed(() => new Map([...this._environmentContext(), ...coerceSignal(options?.context)?.() ?? new Map()]));\n\n return this._menuRegistry.accelerators(context);\n }\n}\n\n/**\n * Intercepts calls to the menu registry by chaining registered menu adapters.\n *\n * Each adapter can handle the call, modify it, or pass it to the next.\n */\nfunction interceptMenuRegistry(menuRegistry: SciMenuRegistry): SciMenuRegistry {\n // TODO [Angular 22] Remove cast when Angular supports type safety for multi-injection with abstract class DI tokens. See https://github.com/angular/angular/issues/55555\n const menuAdapters = inject(SciMenuAdapter, {optional: true}) as SciMenuAdapter[] | null ?? [];\n\n return menuAdapters.reduceRight((next: SciMenuAdapterChain, adapter: SciMenuAdapter) => ({\n contributeMenu: (location, factoryFn, options) => adapter.contributeMenu ? adapter.contributeMenu(location, factoryFn, options, next) : next.contributeMenu(location, factoryFn, options),\n menuContributions: (location, context, options) => adapter.menuContributions ? adapter.menuContributions(location, context, options, next) : next.menuContributions(location, context, options),\n menuItems: (location, context, options) => adapter.menuItems ? adapter.menuItems(location, context, options, next) : next.menuItems(location, context, options),\n openMenu: (menu, options) => adapter.openMenu ? adapter.openMenu(menu, options, next) : next.openMenu(menu, options),\n closeMenus: () => adapter.closeMenus ? adapter.closeMenus(next) : next.closeMenus(),\n accelerators: context => adapter.accelerators ? adapter.accelerators(context, next) : next.accelerators(context),\n }), menuRegistry);\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ElementRef, Injectable, ViewContainerRef} from '@angular/core';\nimport {ɵSciMenuService} from './ɵmenu.service';\nimport {RequireOne} from '@scion/toolkit/types';\nimport {SciMenuFilterConfig} from './menu/menu.factory';\n\n/**\n * Opens a menu with items contributed via {@link contributeMenu}.\n *\n * A menu displays a list of related items in a popover, organized into groups and submenus.\n * It closes when a menu item is selected or on an outside click. Menu items can define a keyboard accelerator for quick access.\n *\n * ## Menu Item Size\n * The menu item size is based on the `--sci-menu-item-size` CSS variable and defaults to `16px`. It determines the icon size and is used to compute the font size and padding.\n *\n * A custom size can be defined globally using the `:root` selector:\n *\n * ```css\n * sci-menu {\n * --sci-menu-item-size: 18px;\n * }\n * ```\n *\n * Instead of computing the font size based on `--sci-menu-item-size`, an explicit font size can be defined using the `--sci-menu-font-size` CSS variable:\n *\n * ```css\n * sci-menu {\n * --sci-menu-item-size: 14px;\n * }\n * ```\n *\n * ## Custom Styling\n * The appearance of the menu can be customized using the following CSS variables:\n *\n * - `--sci-menu-font-size`: Font size of menu items.\n * - `--sci-menu-border-radius`: Border radius of a menu popover.\n * - `--sci-menu-min-width`: Minimum width of a menu popover.\n * - `--sci-menu-submenu-min-width`: Minimum width of a submenu popover.\n * - `--sci-menu-item-size`: Size of menu items; used as the menu item icon size and to compute font size and padding.\n * - `--sci-menu-item-cursor`: Cursor style when hovering over a menu item.\n * - `--sci-menu-item-text-color`: Text and icon color of menu items.\n * - `--sci-menu-item-text-color-disabled`: Text and icon color of disabled menu items.\n * - `--sci-menu-item-background-color-hover`: Background color of a menu item when hovered.\n * - `--sci-menu-item-background-color-active`: Background color of a menu item when pressed.\n * - `--sci-menu-item-border-radius`: Border radius of menu items.\n * - `--sci-menu-item-outline-width`: Outline width of menu items when focused.\n * - `--sci-menu-item-accelerator-text-color`: Text color of menu item accelerators.\n * - `--sci-menu-item-active-indicator-size`: Size of the visual indicator for active menu items.\n * - `--sci-menu-item-active-indicator-background-color`: Background color of the visual indicator for active menu items.\n * - `--sci-menu-item-active-indicator-border-radius`: Border radius of the visual indicator for active menu items.\n * - `--sci-menu-group-header-font-family`: Font family for group headers.\n * - `--sci-menu-group-header-font-size`: Font size for group headers.\n * - `--sci-menu-group-header-font-weight`: Font weight for group headers.\n * - `--sci-menu-group-header-text-color`: Text color for group headers.\n * - `--sci-menu-filter-outline-width`: Outline width of the filter field.\n * - `--sci-menu-filter-outline-radius`: Outline radius of the filter field.\n *\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\n */\n@Injectable({providedIn: 'root', useExisting: ɵSciMenuService})\nexport abstract class SciMenuService {\n\n /**\n * Opens a menu with items contributed to the specified menu.\n *\n * The menu is positioned relative to the specified anchor, vertically or horizontally. The anchor can be a coordinate, a mouse event, or a DOM element.\n *\n * ```ts\n * import {inject} from '@angular/core';\n * import {SciMenuService} from '@scion/components/menu';\n *\n * inject(SciMenuService).open('menu:contextmenu', { // <--- Sets the name of the menu\n * anchor: {x: 500, y: 600}, // <--- Sets the anchor position\n * });\n * ```\n *\n * Use the {@link contributeMenu} function to contribute to the menu by passing the menu name and a factory function.\n * The menu calls the factory function with a {@link SciMenuFactoryFn}, providing methods for populating the menu.\n *\n * ```ts\n * import {contributeMenu} from '@scion/components/menu';\n *\n * contributeMenu('menu:contextmenu', menu => menu\n * .addMenuItem({icon: 'content_copy', label: 'Copy', onSelect: () => console.log('Copy')})\n * .addMenuItem({icon: 'content_paste', label: 'Paste', onSelect: () => console.log('Paste')}),\n * );\n * ```\n *\n * Multiple contributions to the same menu can populate it from different places in the application. Passing a {@link SciMenuContributionLocation}\n * gives exact control over contribution placement within the menu. By default, menu items are added in contribution order.\n *\n * Groups and submenus can be named to allow extension from other contributions.\n *\n * ## Location in the DOM\n * By default, the menu popover is inserted after the anchor element in the DOM, or appended to the HTML body if using a coordinate anchor.\n *\n * A different location can be set via the {@link SciMenuOptions.viewContainerRef} option:\n *\n * ```ts\n * import {inject, ViewContainerRef} from '@angular/core';\n * import {SciMenuService} from '@scion/components/menu';\n *\n * inject(SciMenuService).open('menu:contextmenu', {\n * anchor: {x: 500, y: 600},\n * viewContainerRef: inject(ViewContainerRef), // <--- Sets the location in the DOM\n * });\n * ```\n *\n * ## Filterable Menu\n * Setting the {@link SciMenuOptions.filter} option displays a filter field, enabling filtering of menu items.\n *\n * ```ts\n * import {inject} from '@angular/core';\n * import {SciMenuService} from '@scion/components/menu';\n *\n * inject(SciMenuService).open('menu:contextmenu', {\n * anchor: {x: 500, y: 600},\n * filter: true, // <--- Instructs the menu to display a filter field\n * });\n * ```\n *\n * ## Menu Size\n * The menu size can be controlled via menu options. By default, a menu uses the minimum width defined by the `--sci-menu-min-width` or `--sci-menu-submenu-min-width` CSS variables.\n *\n * ```ts\n * import {inject} from '@angular/core';\n * import {SciMenuService} from '@scion/components/menu';\n *\n * inject(SciMenuService).open('menu:contextmenu', {\n * anchor: {x: 500, y: 600},\n * width: '500px', // <--- Sets a fixed menu width\n * maxHeight: '800px', // <--- Sets a maximum menu height\n * });\n * ```\n *\n * ## Context\n * A menu can have a context, a key/value map that describes its environment. Contributions can declare a minimal required context and read the menu context.\n *\n * A context can be set via the {@link SciMenuOptions.context} option:\n *\n * ```ts\n * import {SciMenuService} from '@scion/components/menu';\n * import {inject} from '@angular/core';\n *\n * inject(SciMenuService).open('menu:contextmenu', {\n * anchor: {x: 500, y: 600},\n * context: new Map().set('key', 'value'), // <--- Sets the menu context\n * });\n * ```\n *\n * ## Accelerators\n * Menu items can have an accelerator for quick access using a keyboard shortcut.\n *\n * Menu accelerators must be installed using the {@link installMenuAccelerators} function, passing the name (and context, if any) of the menu.\n *\n * ```ts\n * import {installMenuAccelerators} from '@scion/components/menu';\n *\n * installMenuAccelerators('menu:contextmenu', {\n * context: new Map().set('key', 'value'), // <--- Sets the menu context\n * });\n * ```\n *\n * By default, accelerators are installed on the {@link Document}. A different accelerator target can be defined via the {@link SciMenuAcceleratorOptions.target} option.\n *\n * ```ts\n * import {installMenuAccelerators} from '@scion/components/menu';\n * import {ElementRef, inject} from '@angular/core';\n *\n * installMenuAccelerators('menu:contextmenu', {\n * target: inject(ElementRef), // <--- Sets a different accelerator target\n * });\n * ```\n *\n * Alternatively, accelerator targets can be provided at the injector level using {@link provideMenuAcceleratorTargetProvider}, for example, at the component, route, or application level,\n * and are available to accelerators installed in the scope of this injector. Inherited targets can be overridden via {@link SciMenuAcceleratorOptions.target} option.\n *\n * @param name - Specifies the name of the menu. Used to look up menu items contributed via the {@link contributeMenu} function.\n * @param options - Controls the appearance and placement of the menu. At minimum, the menu anchor must be configured to determine where to open the menu.\n * @returns A reference to the menu, allowing to close the menu or get notified when it is closed.\n */\n public abstract open(name: `menu:${string}`, options: SciMenuOptions): SciMenuRef;\n\n /**\n * Closes currently opened menus.\n */\n public abstract closeAll(): void;\n}\n\n/**\n * Controls the appearance and placement of a menu.\n */\nexport interface SciMenuOptions {\n /**\n * Controls where to open the menu.\n *\n * Can be an HTML element or a coordinate relative to the page viewport.\n */\n anchor: HTMLElement | ElementRef<HTMLElement> | SciMenuOrigin | MouseEvent;\n /**\n * Specifies a context to describe the environment of the menu.\n *\n * Menu contributions may declare a required context. Only contributions matching this context are used.\n *\n * A context can also be provided at the injector level using {@link provideMenuContextProvider}, for example, at the component, route, or application level,\n * and is available to menus opened in the scope of this injector. The inherited context can be overridden or extended. Setting a context entry to `undefined` clears it.\n *\n * ```ts\n * import {provideMenuContextProvider} from '@scion/components/menu';\n *\n * providers: [\n * provideMenuContextProvider(() => new Map().set('key', 'value')),\n * ];\n * ```\n *\n * @see provideMenuContextProvider\n */\n context?: Map<string, unknown>;\n /**\n * Controls whether to open the menu below or to the side of the anchor.\n */\n align?: 'vertical' | 'horizontal';\n /**\n * Sets the distance (in pixels) between the menu and its anchor element along the X and Y axes.\n *\n * By default, the menu is aligned flush with the anchor.\n */\n offset?: {x?: number; y?: number};\n /**\n * Controls where to insert the menu popover into the DOM.\n *\n * By default, the menu popover is inserted after the anchor element, or appended to the HTML body if using a coordinate anchor.\n */\n viewContainerRef?: ViewContainerRef;\n /**\n * Indicates whether the menu is opened as a submenu.\n *\n * @internal\n */\n submenu?: true;\n /**\n * Specifies the preferred menu width.\n */\n width?: string;\n /**\n * Specifies the preferred minimum menu width.\n *\n * Defaults to the `--sci-menu-min-width` or `--sci-menu-submenu-min-width` CSS variables.\n *\n * If the anchor is an {@link HTMLElement}, the effective minimum width evaluates to `max(anchorWidth, minWidth)`.\n */\n minWidth?: string;\n /**\n * Specifies the maximum menu width.\n */\n maxWidth?: string;\n /**\n * Specifies the maximum menu height.\n */\n maxHeight?: string;\n /**\n * Enables users to filter menu items.\n *\n * Setting a descriptor allows customizing the filter field, such as defining a custom placeholder text or controlling whether the filter field is focused on open.\n */\n filter?: boolean | RequireOne<SciMenuFilterConfig>;\n /**\n * Specifies CSS classes to associate with the menu.\n */\n cssClass?: string | string[];\n /**\n * Specifies HTML attributes to associate with the menu.\n *\n * Data attributes should start with the `data-` prefix.\n */\n attributes?: {[name: string]: string};\n /**\n * Allows associating arbitrary metadata with the operation.\n *\n * @internal Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this property.\n */\n metadata?: {[key: string]: unknown};\n}\n\n/**\n * Coordinate relative to the top/left corner of the page viewport.\n */\nexport interface SciMenuOrigin {\n x: number;\n y: number;\n width?: number;\n height?: number;\n}\n\n/**\n * Represents a reference to a menu.\n *\n * Use to close the menu or get notified when the menu is closed.\n */\nexport interface SciMenuRef {\n /**\n * Closes the menu. Has no effect if the menu is already closed.\n */\n close(): void;\n\n /**\n * Registers a callback to be notified when the menu is closed.\n *\n * If the menu is already closed, the callback is executed immediately.\n */\n onClose: (fn: () => void) => void;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {assertNotInReactiveContext, computed, effect, inject, Injector, untracked} from '@angular/core';\nimport {Disposable} from '@scion/toolkit/types';\nimport {ɵSciMenuService} from './ɵmenu.service';\nimport {SciMenubarContributionLocation, SciMenubarFactoryFn, SciMenuContributionLocation, SciMenuContributionLocationLike, SciMenuContributionOptions, SciMenuFactoryFn, SciMenuFactoryFnLike, SciToolbarContributionLocation, SciToolbarFactoryFn} from './menu-contribution.model';\nimport {assertInInjectionContext, createDestroyableInjector} from '@scion/components/common';\nimport {SciMenuContributionInstantProvider} from './menu-contribution-instant.provider';\nimport {injectMenuContext} from './menu-environment/menu-environment-providers';\n\n/**\n * Contributes tools to a {@link SciToolbarComponent} with the given name.\n *\n * A toolbar is a horizontal or vertical container that provides quick access to context-related tools. It can contain buttons, toggles, menus, and other controls,\n * with related items grouped together.\n *\n * The toolbar calls the passed factory function with a {@link SciToolbarFactory}. The factory provides methods for populating the toolbar.\n * The factory function runs in a reactive context, running again when tracked signals change. It can call `inject` to get required dependencies.\n *\n * ```ts\n * contributeMenu('toolbar:main', (toolbar, context) => toolbar\n * .addToolbarButton({icon: 'undo', accelerator: {ctrl: true, key: 'Z'}, tooltip: 'Undo', onSelect: () => console.log('Undo')})\n * .addToolbarButton({icon: 'redo', accelerator: {ctrl: true, key: 'Y'}, tooltip: 'Redo', onSelect: () => console.log('Redo')})\n * .addGroup(group => group\n * .addToolbarButton({icon: 'content_copy', accelerator: {ctrl: true, key: 'C'}, tooltip: 'Copy', onSelect: () => console.log('Copy')})\n * .addToolbarButton({icon: 'content_paste', accelerator: {ctrl: true, key: 'V'}, tooltip: 'Paste', onSelect: () => console.log('Paste')}),\n * )\n * .addToolbarMenu({icon: 'folder', tooltip: 'File'}, menu => menu\n * .addMenuItem({icon: 'save', label: 'Save', accelerator: {ctrl: true, key: 'S'}, onSelect: () => console.log('Save')})\n * .addMenuItem({icon: 'print', label: 'Print', accelerator: {ctrl: true, key: 'P'}, onSelect: () => console.log('Print')})\n * .addMenu({icon: 'file_download', label: 'Export As...'}, menu => menu\n * .addMenuItem({icon: 'picture_as_pdf', label: 'PDF Document', onSelect: () => console.log('PDF Document')})\n * .addMenuItem({icon: 'table_view', label: 'Excel Spreadsheet', onSelect: () => console.log('Excel Spreadsheet')}),\n * ),\n * ),\n * );\n * ```\n *\n * A toolbar can have a context, a key/value map that describes its environment. The contribution can declare a minimal required context via {@link SciMenuContributionOptions.requiredContext}.\n * The toolbar context is passed as the second argument to the factory function.\n *\n * Multiple contributions to the same toolbar can populate it from different places in the application. Passing a {@link SciToolbarContributionLocation}\n * gives exact control over contribution placement within the toolbar. By default, toolbar items are added in contribution order.\n *\n * Menus and groups can be named to allow extension from other contributions.\n *\n * This function must be called within an injection context, or an explicit {@link Injector} passed. The contribution is disposed when the injection context or the passed injector is destroyed.\n *\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\n *\n * @param location - Identifies the toolbar to contribute to. Passing a {@link SciToolbarContributionLocation} gives exact control over placement.\n * @param toolbarFactoryFn - Specifies the function to contribute tools to the toolbar. The function is called in a reactive context and can call `inject` to get required dependencies.\n * @param options - Controls contribution to the toolbar, for example, the minimal required context.\n * @returns A handle that can be used to manually dispose the contribution. The contribution is disposed automatically when the calling (or passed) injection context is destroyed.\n */\nexport function contributeMenu(location: `toolbar:${string}` | SciToolbarContributionLocation, toolbarFactoryFn: SciToolbarFactoryFn, options?: SciMenuContributionOptions): Disposable;\n\n/**\n * Contributes menus to a {@link SciMenubarComponent} with the given name.\n *\n * A menubar displays a horizontal row of menus, typically placed at the top of the application.\n *\n * The menubar calls the passed factory function with a {@link SciMenubarFactory}. The factory provides methods for populating the menubar.\n * The factory function runs in a reactive context, running again when tracked signals change. It can call `inject` to get required dependencies.\n *\n * TODO [menu] Add example\n *\n * A menubar can have a context, a key/value map that describes its environment. The contribution can declare a minimal required context via {@link SciMenuContributionOptions.requiredContext}.\n * The menubar context is passed as the second argument to the factory function.\n *\n * Multiple contributions to the same menubar can populate it from different places in the application. Passing a {@link SciMenubarContributionLocation}\n * gives exact control over contribution placement within the menubar. By default, menus are added in contribution order.\n *\n * Menus and groups can be named to allow extension from other contributions.\n *\n * This function must be called within an injection context, or an explicit {@link Injector} passed. The contribution is disposed when the injection context or the passed injector is destroyed.\n *\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\n *\n * @param location - Identifies the menubar to contribute to. Passing a {@link SciMenubarContributionLocation} gives exact control over placement.\n * @param menubarFactoryFn - Specifies the function to contribute menus to the menubar. The function is called in a reactive context and can call `inject` to get required dependencies.\n * @param options - Controls contribution to the menubar, for example, the minimal required context.\n * @returns A handle that can be used to manually dispose the contribution. The contribution is disposed automatically when the calling (or passed) injection context is destroyed.\n */\nexport function contributeMenu(location: `menubar:${string}` | SciMenubarContributionLocation, menubarFactoryFn: SciMenubarFactoryFn, options?: SciMenuContributionOptions): Disposable;\n\n/**\n * Contributes menu items to a menu with the given name.\n *\n * A menu displays a list of related items in a popover, organized into groups and submenus.\n * It closes when a menu item is selected or on an outside click. Menu items can define a keyboard accelerator for quick access.\n *\n * The menu calls the passed factory function with a {@link SciMenuFactory}. The factory provides methods for populating the menu.\n * The factory function runs in a reactive context, running again when tracked signals change. It can call `inject` to get required dependencies.\n *\n * TODO [menu] Add example\n *\n * A menu can have a context, a key/value map that describes its environment. The contribution can declare a minimal required context via {@link SciMenuContributionOptions.requiredContext}.\n * The menu context is passed as the second argument to the factory function.\n *\n * Multiple contributions to the same menu can populate it from different places in the application. Passing a {@link SciMenuContributionLocation}\n * gives exact control over contribution placement within the menu. By default, menu items are added in contribution order.\n *\n * Menus and groups can be named to allow extension from other contributions.\n *\n * This function must be called within an injection context, or an explicit {@link Injector} passed. The contribution is disposed when the injection context or the passed injector is destroyed.\n *\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\n *\n * @param location - Identifies the menu to contribute to. Passing a {@link SciMenuContributionLocation} gives exact control over placement.\n * @param menuFactoryFn - Specifies the function to contribute menu items to the menu. The function is called in a reactive context and can call `inject` to get required dependencies.\n * @param options - Controls contribution to the menu, for example, the minimal required context.\n * @returns A handle that can be used to manually dispose the contribution. The contribution is disposed automatically when the calling (or passed) injection context is destroyed.\n */\nexport function contributeMenu(location: `menu:${string}` | SciMenuContributionLocation, menuFactoryFn: SciMenuFactoryFn, options?: SciMenuContributionOptions): Disposable;\n\n/** @internal */\nexport function contributeMenu(locationLike: string | SciMenuContributionLocationLike, factoryFn: SciMenuFactoryFnLike, options?: SciMenuContributionOptions): Disposable {\n assertNotInReactiveContext(contributeMenu, 'Call contributeMenu in a non-reactive (non-tracking) context, such as within the untracked() function.');\n if (!options?.injector) {\n assertInInjectionContext(contributeMenu, 'Must be called within an injection context, or an explicit `Injector` passed via options. Disposes the contribution when the injection context is destroyed.');\n }\n\n const injector = createDestroyableInjector({parent: options?.injector ?? inject(Injector)});\n const location = typeof locationLike === 'string' ? {location: locationLike} as SciMenuContributionLocationLike : locationLike;\n const menuService = injector.get(ɵSciMenuService);\n\n const environmentContext = injectMenuContext({injector});\n const contributionContext = computed(() => new Map([...environmentContext(), ...options?.requiredContext ?? new Map()]));\n\n // Each contribution is assigned an instant to maintain a stable order when the contribution context changes.\n const contributionInstant = options?.contributionInstant ?? injector.get(SciMenuContributionInstantProvider).next();\n\n effect(onCleanup => {\n const requiredContext = contributionContext();\n\n untracked(() => {\n const contributionRef = menuService.contributeMenu(location, factoryFn, {...options, requiredContext, contributionInstant});\n onCleanup(() => contributionRef.dispose());\n });\n }, {injector});\n\n return {\n dispose: () => injector.destroy(),\n };\n}\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {ApplicationRef, Component, computed, createComponent, DestroyRef, effect, ElementRef, EnvironmentInjector, inject, Injector, input, inputBinding, untracked, ViewContainerRef} from '@angular/core';\r\nimport {SciToolbarGroupComponent} from './toolbar-group.component';\r\nimport {ɵinstallMenuAccelerators, ɵSciMenuAcceleratorOptions} from '../menu-accelerators';\r\nimport {ɵSciMenuService} from '../ɵmenu.service';\r\nimport {MaybeArray} from '@scion/toolkit/types';\r\nimport {injectMenuAcceleratorTargets, injectMenuContext} from '../menu-environment/menu-environment-providers';\r\n\r\n/**\r\n * Displays items contributed via the {@link contributeMenu} function matching the toolbar's name.\r\n *\r\n * A toolbar is a horizontal or vertical container providing quick access to context-related tools.\r\n * It contains buttons, toggles, menus, and other controls, with related items grouped together.\r\n *\r\n * The toolbar must be assigned a name, used as the location when contributing to the toolbar.\r\n * The name must start with the `toolbar:` prefix.\r\n *\r\n * ```html\r\n * <sci-toolbar name=\"toolbar:main\"/>\r\n * ```\r\n *\r\n * Use the {@link contributeMenu} function to contribute to the toolbar by passing the toolbar name and a factory function.\r\n * The toolbar calls the factory function with a {@link SciToolbarFactory}, providing methods for populating the toolbar.\r\n *\r\n * ```ts\r\n * import {contributeMenu} from '@scion/components/menu';\r\n *\r\n * contributeMenu('toolbar:main', toolbar => toolbar\r\n * .addToolbarButton({icon: 'undo', accelerator: {ctrl: true, key: 'Z'}, tooltip: 'Undo', onSelect: () => console.log('Undo')})\r\n * .addToolbarButton({icon: 'redo', accelerator: {ctrl: true, key: 'Y'}, tooltip: 'Redo', onSelect: () => console.log('Redo')})\r\n * .addGroup(group => group\r\n * .addToolbarButton({icon: 'content_copy', accelerator: {ctrl: true, key: 'C'}, tooltip: 'Copy', onSelect: () => console.log('Copy')})\r\n * .addToolbarButton({icon: 'content_paste', accelerator: {ctrl: true, key: 'V'}, tooltip: 'Paste', onSelect: () => console.log('Paste')}),\r\n * )\r\n * .addToolbarMenu({icon: 'folder', tooltip: 'File'}, menu => menu\r\n * .addMenuItem({icon: 'save', label: 'Save', accelerator: {ctrl: true, key: 'S'}, onSelect: () => console.log('Save')})\r\n * .addMenuItem({icon: 'print', label: 'Print', accelerator: {ctrl: true, key: 'P'}, onSelect: () => console.log('Print')})\r\n * .addMenu({icon: 'file_download', label: 'Export As...'}, menu => menu\r\n * .addMenuItem({icon: 'picture_as_pdf', label: 'PDF Document', onSelect: () => console.log('PDF Document')})\r\n * .addMenuItem({icon: 'table_view', label: 'Excel Spreadsheet', onSelect: () => console.log('Excel Spreadsheet')}),\r\n * ),\r\n * ),\r\n * );\r\n * ```\r\n *\r\n * Multiple contributions to the same toolbar can populate it from different places in the application. Passing a {@link SciToolbarContributionLocation}\r\n * gives exact control over contribution placement within the toolbar. By default, toolbar items are added in contribution order.\r\n *\r\n * Menus and groups can be named to allow extension from other contributions.\r\n *\r\n * ## Context\r\n * A toolbar can have a context, a key/value map that describes its environment. Contributions can declare a minimal required context and read the toolbar context.\r\n *\r\n * A context can be set on the toolbar with the `context` input:\r\n *\r\n * ```html\r\n * <sci-toolbar name=\"toolbar:main\" [context]=\"...\"/>\r\n * ```\r\n *\r\n * ## Accelerator Target\r\n * Tools can have an accelerator for quick access using a keyboard shortcut. By default, the toolbar uses the {@link Document} as the accelerator target.\r\n *\r\n * The accelerator target can be changed via the `acceleratorTarget` input:\r\n *\r\n * ```html\r\n * <sci-toolbar name=\"toolbar:main\" [acceleratorTarget]=\"...\"/>\r\n * ```\r\n *\r\n * ## Toolbar Size\r\n * The toolbar size is based on the `--sci-toolbar-item-size` CSS variable and defaults to 16px. It determines the icon size and is used to compute the font size and padding.\r\n *\r\n * A custom size can be defined globally using the `:root` selector or scoped to a specific toolbar.\r\n *\r\n * ```css\r\n * sci-toolbar {\r\n * --sci-toolbar-item-size: 18px;\r\n * }\r\n * ```\r\n *\r\n * Instead of computing the font size based on `--sci-toolbar-item-size`, an explicit font size can be defined using the `--sci-toolbar-font-size` CSS variable, either globally or at the toolbar level.\r\n *\r\n * ```css\r\n * sci-toolbar {\r\n * --sci-toolbar-font-size: 14px;\r\n * }\r\n * ```\r\n *\r\n * ## Hiding an Empty Toolbar\r\n * If the toolbar has no tools, it can be hidden using the CSS `:empty` pseudo-class:\r\n *\r\n * ```css\r\n * sci-toolbar:empty {\r\n * display: none;\r\n * }\r\n * ```\r\n *\r\n * ## Custom Styling\r\n * The appearance of the toolbar can be customized using the following CSS variables, either globally in the `:root` or on the toolbar level.\r\n *\r\n * - `--sci-toolbar-font-size`: Font size of toolbar items.\r\n * - `--sci-toolbar-item-size`: Size of toolbar items; used as the toolbar item icon size and to compute font size and padding.\r\n * - `--sci-toolbar-item-cursor`: Cursor style when hovering over a toolbar item.\r\n * - `--sci-toolbar-item-text-color`: Text and icon color of toolbar items.\r\n * - `--sci-toolbar-item-text-color-disabled`: Text and icon color of disabled toolbar items.\r\n * - `--sci-toolbar-item-background-color`: Background color of toolbar items.\r\n * - `--sci-toolbar-item-background-color-hover`: Background color of a toolbar item when hovered.\r\n * - `--sci-toolbar-item-background-color-active`: Background color of a toolbar item when pressed.\r\n * - `--sci-toolbar-item-background-color-checked`: Background color of toggled toolbar items.\r\n * - `--sci-toolbar-item-border-radius`: Border radius of toolbar items.\r\n * - `--sci-toolbar-item-border-color-hover`: Border color of toolbar items when hovered.\r\n * - `--sci-toolbar-item-border-color-checked`: Border color of toggled toolbar items.\r\n * - `--sci-toolbar-item-outline-width`: Outline width of toolbar items when focused.\r\n * - `--sci-toolbar-item-menu-indicator-color`: Color of the menu indicator for toolbar items without a label.\r\n * - `--sci-toolbar-item-menu-indicator-color-disabled`: Color of the menu indicator if disabled.\r\n * - `--sci-toolbar-item-menu-indicator-size`: Size of the menu indicator.\r\n *\r\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\r\n */\r\n@Component({\r\n selector: 'sci-toolbar',\r\n template: '', // Template provided by `SciToolbarGroupComponent`; see `attachVirtualToolbarGroup()`.\r\n host: {\r\n '[attr.name]': 'name()', // Public API: Enables selecting the toolbar by name in CSS (also if the toolbar has a dynamic name input binding)\r\n },\r\n})\r\nexport class SciToolbarComponent {\r\n\r\n /**\r\n * Defines the name of the toolbar. The name must start with the `toolbar:` prefix.\r\n *\r\n * Use this name to contribute tools to the toolbar using the {@link contributeMenu} function.\r\n */\r\n public readonly name = input.required<`toolbar:${string}`>();\r\n\r\n /**\r\n * Specifies the orientation of the toolbar. Defaults to `horizontal`.\r\n */\r\n public readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\r\n\r\n /**\r\n * Specifies a context to describe the environment of the toolbar.\r\n *\r\n * Toolbar contributions may declare a required context. Only contributions matching this context are used.\r\n *\r\n * A context can also be provided at the injector level using {@link provideMenuContextProvider}, for example, at the component, route, or application level,\r\n * and is available to toolbars used in the scope of this injector. The inherited context can be overridden or extended. Setting a context entry to `undefined` clears it.\r\n *\r\n * ```ts\r\n * import {provideMenuContextProvider} from '@scion/components/menu';\r\n *\r\n * providers: [\r\n * provideMenuContextProvider(() => new Map().set('key', 'value')),\r\n * ];\r\n * ```\r\n *\r\n * @see provideMenuContextProvider\r\n */\r\n public readonly context = input<Map<string, unknown>>();\r\n\r\n /**\r\n * Specifies the accelerator targets for the toolbar. Defaults to {@link Document}.\r\n *\r\n * Alternatively, accelerator targets can be provided at the injector level using {@link provideMenuAcceleratorTargetProvider}, for example, at the component, route, or application level,\r\n * and are available to toolbars used in the scope of this injector. Inherited targets can be overridden.\r\n *\r\n * ```ts\r\n * import {provideMenuAcceleratorTargetProvider} from '@scion/components/menu';\r\n * import {ElementRef, inject} from '@angular/core';\r\n *\r\n * providers: [\r\n * provideMenuAcceleratorTargetProvider(() => inject(ElementRef)),\r\n * ];\r\n * ```\r\n */\r\n public readonly acceleratorTarget = input<MaybeArray<Element | ElementRef<Element>>>();\r\n\r\n /**\r\n * Controls where to attach menu popovers in the DOM. By default, popovers are added as a direct sibling of the toolbar.\r\n */\r\n public readonly popoverViewContainerRef = input<ViewContainerRef>(inject(ViewContainerRef));\r\n\r\n /**\r\n * Indicates whether any menu within the toolbar is currently open.\r\n *\r\n * TODO [dwi][API] How to name that metod? Cannot be internal because used by table.\r\n */\r\n public readonly menuOpen = computed(() => this._virtualToolbarGroupComponent.menuOpen());\r\n\r\n private readonly _environmentContext = injectMenuContext();\r\n private readonly _context = computed(() => new Map([...this._environmentContext(), ...this.context() ?? new Map()]));\r\n private readonly _virtualToolbarGroupComponent: SciToolbarGroupComponent;\r\n\r\n protected readonly menuItems = inject(ɵSciMenuService).menuItems(this.name, this._context);\r\n\r\n constructor() {\r\n this._virtualToolbarGroupComponent = this.attachVirtualToolbarGroup();\r\n this.installAccelerators();\r\n }\r\n\r\n /**\r\n * Creates and attaches a {@link SciToolbarGroupComponent} using this component as host,\r\n * rendering top-level toolbar items and groups as direct children inside `<sci-toolbar/>`.\r\n */\r\n private attachVirtualToolbarGroup(): SciToolbarGroupComponent {\r\n const componentRef = createComponent(SciToolbarGroupComponent, {\r\n elementInjector: inject(Injector),\r\n environmentInjector: inject(EnvironmentInjector),\r\n hostElement: inject(ElementRef).nativeElement as HTMLElement,\r\n bindings: [\r\n inputBinding('menuItems', this.menuItems),\r\n inputBinding('orientation', this.orientation),\r\n inputBinding('popoverViewContainerRef', this.popoverViewContainerRef),\r\n ],\r\n });\r\n\r\n // Attach component to Angular component tree for change detection.\r\n inject(ApplicationRef).attachView(componentRef.hostView);\r\n\r\n // Destroy component when host is destroyed.\r\n inject(DestroyRef).onDestroy(() => componentRef.destroy());\r\n\r\n return componentRef.instance;\r\n }\r\n\r\n /**\r\n * Installs accelerators of menu items in this toolbar, recursively for menu items in submenus and groups.\r\n */\r\n private installAccelerators(): void {\r\n const injector = inject(Injector);\r\n const environmentTargets = injectMenuAcceleratorTargets();\r\n\r\n effect(onCleanup => {\r\n const menuItems = this.menuItems();\r\n const options: ɵSciMenuAcceleratorOptions = {\r\n targets: this.acceleratorTarget(),\r\n environmentTargets: environmentTargets(),\r\n injector,\r\n };\r\n\r\n untracked(() => {\r\n const accelerators = ɵinstallMenuAccelerators(menuItems, options);\r\n onCleanup(() => accelerators.dispose());\r\n });\r\n });\r\n }\r\n}\r\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {type SciToolbarFactory, type SciToolbarButtonDescriptor, type SciToolbarControlDescriptor, type SciToolbarMenuDescriptor, type SciToolbarGroupDescriptor} from './toolbar.factory';\nexport {SciToolbarComponent} from './toolbar.component';\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component, computed, effect, ElementRef, inject, Injector, input, linkedSignal, Signal, untracked, ViewContainerRef} from '@angular/core';\r\nimport {ɵinstallMenuAccelerators, ɵSciMenuAcceleratorOptions} from '../menu-accelerators';\r\nimport {ɵSciMenuService} from '../ɵmenu.service';\r\nimport {SciAttributesDirective} from '@scion/components/common';\r\nimport {MaybeArray, RequireOne} from '@scion/toolkit/types';\r\nimport {SciMenuItem} from '../menu.model';\r\nimport {SciMenuFilterConfig} from '../menu/menu.factory';\r\nimport {injectMenuAcceleratorTargets, injectMenuContext} from '../menu-environment/menu-environment-providers';\r\n\r\n/**\r\n * TODO [menu]: Explain how to size the menubar. (height can be set)\r\n *\r\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\r\n */\r\n@Component({\r\n selector: 'sci-menubar',\r\n templateUrl: './menubar.component.html',\r\n styleUrl: './menubar.component.scss',\r\n imports: [\r\n SciAttributesDirective,\r\n ],\r\n host: {\r\n '[attr.name]': 'name()', // Public API: Enables selecting the menubar by name in CSS (also if the menubar has a dynamic name input binding)\r\n },\r\n})\r\nexport class SciMenubarComponent {\r\n\r\n public readonly name = input.required<`menubar:${string}`>();\r\n public readonly context = input<Map<string, unknown>>();\r\n public readonly acceleratorTarget = input<MaybeArray<Element | ElementRef<Element>>>();\r\n public readonly viewContainerRef = input<ViewContainerRef>(inject(ViewContainerRef));\r\n\r\n private readonly _environmentContext = injectMenuContext();\r\n private readonly _context = computed(() => new Map([...this._environmentContext(), ...this.context() ?? new Map()]));\r\n\r\n protected readonly menuItems = inject(ɵSciMenuService).menuItems(this.name, this._context) as Signal<SciMenuItem[]>;\r\n\r\n protected readonly activeMenuItem = linkedSignal<SciMenuItem[], {menuItem: SciMenuItem; element: HTMLElement; closing?: true | 'prevented'} | null>({\r\n source: this.menuItems, // Unset when menu items change.\r\n computation: () => null,\r\n equal: (a, b) => a?.menuItem === b?.menuItem, // required to ignore clicking an already opened menu item\r\n });\r\n\r\n constructor() {\r\n this.installMenuOpener();\r\n this.installAccelerators();\r\n }\r\n\r\n /**\r\n * Method invoked when clicking on a menu item.\r\n */\r\n protected onMenuItemClick(menuItem: SciMenuItem, element: HTMLElement): void {\r\n this.activeMenuItem.update(activeMenuItem => activeMenuItem?.menuItem === menuItem ? null : {menuItem, element});\r\n }\r\n\r\n /**\r\n * Method invoked before clicking on a menu item.\r\n *\r\n * When clicking on the active menu item, mark it as closing to prevent immediate re-opening race condition on subsequent click event.\r\n */\r\n protected onMenuItemMouseDown(menuItem: SciMenuItem): void {\r\n const activeMenuItem = this.activeMenuItem();\r\n\r\n if (activeMenuItem?.menuItem === menuItem) {\r\n activeMenuItem.closing = true;\r\n }\r\n }\r\n\r\n /**\r\n * Method invoked when moving the pointer over a menu item.\r\n */\r\n protected onMenuItemMouseEnter(menuItem: SciMenuItem, element: HTMLElement): void {\r\n this.activeMenuItem.update(activeMenuItem => activeMenuItem ? {menuItem, element} : null);\r\n }\r\n\r\n /**\r\n * Method invoked when moving the pointer out of a menu item.\r\n */\r\n protected onMenuItemMouseLeave(menuItem: SciMenuItem): void {\r\n const activeMenuItem = this.activeMenuItem();\r\n if (activeMenuItem?.menuItem !== menuItem) {\r\n return;\r\n }\r\n\r\n if (activeMenuItem.closing === 'prevented') {\r\n this.activeMenuItem.set(null); // unset active menu\r\n }\r\n else if (activeMenuItem.closing) {\r\n delete activeMenuItem.closing; // unset closing state\r\n }\r\n }\r\n\r\n /**\r\n * Opens a menu based on {@link activeMenuItem}.\r\n */\r\n private installMenuOpener(): void {\r\n const menuService = inject(ɵSciMenuService);\r\n\r\n effect(onCleanup => {\r\n if (!this.activeMenuItem()) {\r\n return;\r\n }\r\n\r\n const {menuItem, element} = this.activeMenuItem()!;\r\n const menu = menuItem.menu!;\r\n\r\n untracked(() => {\r\n const menuRef = menuService.open(menu.children, {\r\n anchor: element,\r\n viewContainerRef: this.viewContainerRef(),\r\n filter: menu.filter as RequireOne<SciMenuFilterConfig> | undefined,\r\n width: menu.width,\r\n minWidth: menu.minWidth,\r\n maxWidth: menu.maxWidth,\r\n maxHeight: menu.maxHeight,\r\n cssClass: menuItem.cssClass,\r\n attributes: menuItem.attributes,\r\n align: 'vertical',\r\n offset: {y: 1},\r\n });\r\n\r\n // Close when opening another menu.\r\n onCleanup(() => menuRef.close());\r\n\r\n // Unset when closing menu.\r\n menuRef.onClose(() => {\r\n const activeMenuItem = this.activeMenuItem();\r\n\r\n // Do not unset if another menu was opened in the meantime.\r\n if (activeMenuItem?.menuItem !== menuItem) {\r\n return;\r\n }\r\n\r\n // Prevent immediate re-opening race condition when toolbar button is clicked to close.\r\n if (activeMenuItem.closing) {\r\n activeMenuItem.closing = 'prevented';\r\n return;\r\n }\r\n\r\n this.activeMenuItem.set(null);\r\n });\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Installs accelerators of menu items in this menubar, recursively for menu items in submenus and groups.\r\n */\r\n private installAccelerators(): void {\r\n const injector = inject(Injector);\r\n const environmentTargets = injectMenuAcceleratorTargets();\r\n\r\n effect(onCleanup => {\r\n const menuItems = this.menuItems();\r\n const options: ɵSciMenuAcceleratorOptions = {\r\n targets: this.acceleratorTarget(),\r\n environmentTargets: environmentTargets(),\r\n injector,\r\n };\r\n\r\n untracked(() => {\r\n const accelerators = ɵinstallMenuAccelerators(menuItems, options);\r\n onCleanup(() => accelerators.dispose());\r\n });\r\n });\r\n }\r\n}\r\n","@for (menuItem of menuItems(); track $index) {\r\n <button [class.open]=\"activeMenuItem()?.menuItem === menuItem\"\r\n [class]=\"menuItem.cssClass\" class=\"menu-item e2e-menu-item\"\r\n [sciAttributes]=\"menuItem.attributes\"\r\n (mousedown)=\"onMenuItemMouseDown(menuItem)\"\r\n (click)=\"onMenuItemClick(menuItem, element)\"\r\n (mouseenter)=\"onMenuItemMouseEnter(menuItem, element)\"\r\n (mouseleave)=\"onMenuItemMouseLeave(menuItem)\"\r\n #element>\r\n {{menuItem.labelText!()}}\r\n </button>\r\n}\r\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {type SciMenubarFactory, type SciMenubarMenuDescriptor} from './menubar.factory';\nexport {SciMenubarComponent} from './menubar.component';\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {type SciMenuFactory, type SciMenuItemDescriptor, type SciMenuDescriptor, type SciMenuGroupDescriptor, type SciMenuFilterConfig} from './menu.factory';\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {SciMenuService} from './menu.service';\nimport {Provider} from '@angular/core';\nimport {ɵSciMenuService} from './ɵmenu.service';\n\n/**\n * Provides {@link SciMenuService} for dependency injection.\n */\nexport function provideMenuService(): Provider[] {\n return [\n ɵSciMenuService,\n {provide: SciMenuService, useExisting: ɵSciMenuService},\n ];\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ElementRef, inject, Injector, Provider, runInInjectionContext} from '@angular/core';\nimport {MaybeSignal} from '@scion/components/common';\nimport {SCI_MENU_ACCELERATOR_TARGET_PROVIDER, SCI_MENU_ACCELERATOR_TARGET_PROVIDERS, SCI_MENU_CONTEXT_PROVIDER, SCI_MENU_CONTEXT_PROVIDERS, SCI_MENU_INJECTION_CONTEXT_PROVIDER, SCI_MENU_INJECTION_CONTEXT_PROVIDERS} from './menu-environment-providers';\nimport {MaybeArray} from '@scion/toolkit/types';\nimport {provideMenuService} from '../menu-service.provider';\n\n/**\n * Registers a {@link SciMenuContextProviderFn} to provide context to menu locations and contributions.\n *\n * Provided context is applied to menu locations and contributions in the scope of the injector providing this function.\n * Individual locations and contributions can extend or override the provided context.\n *\n * Multiple providers can be registered. Providers at different injector tree levels form a hierarchy.\n *\n * @see SciMenuContextProviderFn\n */\nexport function provideMenuContextProvider(providerFn: SciMenuContextProviderFn): Provider[] {\n return [\n {\n provide: SCI_MENU_CONTEXT_PROVIDER,\n useValue: providerFn,\n multi: true,\n },\n {\n provide: SCI_MENU_CONTEXT_PROVIDERS,\n useFactory: (): SciMenuContextProviderFn[] => {\n const injector = inject(Injector);\n return [\n // Collect providers registered in parent injectors.\n ...inject(SCI_MENU_CONTEXT_PROVIDERS, {skipSelf: true, optional: true}) ?? [],\n // Collect providers registered in this injector.\n // Wrap function to execute in the injector of this injector, not in the calling context.\n ...inject(SCI_MENU_CONTEXT_PROVIDER).map(fn => (callingInjector: Injector) => runInInjectionContext(injector, () => fn(callingInjector))),\n ];\n },\n },\n // Provide `MenuService` to inherit provided menu context when opening a menu or looking up installed accelerators.\n provideMenuService(),\n ];\n}\n\n/**\n * Registers a {@link SciMenuInjectionContextProviderFn} to provide dependency injection tokens for a given menu context.\n *\n * Provided tokens are available for dependency injection for contributions registered in the scope of the injector providing this function.\n * Tokens can be injected in the factory passed to {@link contributeMenu}.\n *\n * Multiple providers can be registered. Providers at different injector tree levels form a hierarchy.\n *\n * @see SciMenuInjectionContextProviderFn\n */\nexport function provideMenuInjectionContextProvider(providerFn: SciMenuInjectionContextProviderFn): Provider[] {\n return [\n {\n provide: SCI_MENU_INJECTION_CONTEXT_PROVIDER,\n useValue: providerFn,\n multi: true,\n },\n {\n provide: SCI_MENU_INJECTION_CONTEXT_PROVIDERS,\n useFactory: (): SciMenuInjectionContextProviderFn[] => {\n const injector = inject(Injector);\n return [\n // Collect providers registered in parent injectors.\n ...inject(SCI_MENU_INJECTION_CONTEXT_PROVIDERS, {skipSelf: true, optional: true}) ?? [],\n // Collect providers registered in this injector.\n // Wrap function to execute in the injector of this injector, not in the calling context.\n ...inject(SCI_MENU_INJECTION_CONTEXT_PROVIDER).map(fn => (context: Map<string, unknown>) => runInInjectionContext(injector, () => fn(context))),\n ];\n },\n },\n ];\n}\n\n/**\n * Registers a {@link SciMenuAcceleratorTargetProviderFn} to provide accelerator targets to menu locations.\n *\n * Provided accelerator targets are available to menu locations in the scope of the injector providing this function.\n * Individual locations can override the provided targets.\n *\n * Multiple providers can be registered. Providers at different injector tree levels form a hierarchy.\n *\n * @see SciMenuAcceleratorTargetProviderFn\n */\nexport function provideMenuAcceleratorTargetProvider(providerFn: SciMenuAcceleratorTargetProviderFn): Provider[] {\n return [\n {\n provide: SCI_MENU_ACCELERATOR_TARGET_PROVIDER,\n useValue: providerFn,\n multi: true,\n },\n {\n provide: SCI_MENU_ACCELERATOR_TARGET_PROVIDERS,\n useFactory: (): SciMenuAcceleratorTargetProviderFn[] => {\n // Collect providers registered in current and parent injectors.\n // Wrap function to execute in the injector where the function is provided, not in the injector of the consumer.\n const injector = inject(Injector);\n return [\n // Collect providers registered in parent injectors.\n ...inject(SCI_MENU_ACCELERATOR_TARGET_PROVIDERS, {skipSelf: true, optional: true}) ?? [],\n // Collect providers registered in this injector.\n // Wrap function to execute in the injector of this injector, not in the calling context.\n ...inject(SCI_MENU_ACCELERATOR_TARGET_PROVIDER).map(fn => (callingInjector: Injector) => runInInjectionContext(injector, () => fn(callingInjector))),\n ];\n },\n },\n ];\n}\n\n/**\n * Signature of a function to provide context to menu locations and contributions.\n *\n * A menu location is a toolbar, menubar, or menu. A location or contribution can have a context (`Map`)\n * describing its environment. A contribution is eligible for a location only if the location's context fully\n * contains the contribution's context.\n *\n * Register this provider using the {@link provideMenuContextProvider} function.\n *\n * The function can call `inject` to get dependencies from the injector providing this function.\n *\n * @param callingInjector - Use to inject dependencies from the injector calling this function, e.g., the injector of the menu location.\n */\nexport type SciMenuContextProviderFn = (callingInjector: Injector) => MaybeSignal<Map<string, unknown> | undefined>;\n\n/**\n * Signature of a function to provide dependency injection tokens for a given menu context.\n *\n * The passed menu context is the context of a menu location (toolbar, menubar, or menu) describing its environment.\n * Returned tokens are available for dependency injection in the menu factory passed to {@link contributeMenu}.\n *\n * Register this provider using the {@link provideMenuInjectionContextProvider} function.\n *\n * The function can call `inject` to get any required dependencies.\n */\nexport type SciMenuInjectionContextProviderFn = (context: Map<string, unknown>) => Provider[];\n\n/**\n * Signature of a function to provide accelerator targets to menu locations.\n *\n * An accelerator target is a DOM element on which a menu location (toolbar, menubar, or menu) listens\n * for keyboard events for accelerators configured on menu items.\n *\n * Register this provider using the {@link provideMenuAcceleratorTargetProvider} function.\n *\n * The function can call `inject` to get dependencies from the injector providing this function.\n *\n * @param callingInjector - Use to inject dependencies from the injector calling this function, e.g., the injector of the menu location.\n */\nexport type SciMenuAcceleratorTargetProviderFn = (callingInjector: Injector) => MaybeSignal<MaybeArray<Element | ElementRef<Element>> | undefined>;\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {provideMenuContextProvider, type SciMenuContextProviderFn, provideMenuInjectionContextProvider, type SciMenuInjectionContextProviderFn, provideMenuAcceleratorTargetProvider, type SciMenuAcceleratorTargetProviderFn} from './menu-environment.provider';\nexport {injectMenuInjectionContextProviders as ɵinjectMenuInjectionContextProviders} from './menu-environment-providers';\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/menu'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciMenuService, type SciMenuRef, type SciMenuOptions, type SciMenuOrigin} from './menu.service';\nexport {ɵSciMenuService} from './ɵmenu.service';\nexport {SciMenuAdapter, type SciMenuAdapterChain} from './menu-adapter.model';\nexport {contributeMenu} from './menu-contribution';\nexport {type SciMenuContribution, type SciMenuContributionLocation, type SciToolbarContributionLocation, type SciMenubarContributionLocation, type SciMenuContributionLocationLike, type SciMenuContributionPosition, type SciToolbarContributionPosition, type SciMenubarContributionPosition, type SciMenuContributionPositionLike, type SciMenuFactoryFn, type SciToolbarFactoryFn, type SciMenubarFactoryFn, type SciMenuFactoryFnLike, type SciMenuContributionOptions} from './menu-contribution.model';\nexport {type SciMenuItem, type SciMenuGroup, type SciMenuItemLike} from './menu.model';\nexport {installMenuAccelerators, type SciMenuAcceleratorOptions, type SciKeyboardAccelerator} from './menu-accelerators';\n\nexport * from './toolbar/public_api';\nexport * from './menubar/public_api';\nexport * from './menu/public_api';\nexport * from './menu-environment/public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["getLabelIfText","getLabelIfComponent","getIconIfLigature","getIconIfComponent","i1"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;AAQG;AAMH;;AAEG;AACG,SAAU,SAAS,CAAC,YAAmD,EAAA;IAC3E,OAAO,YAAY,KAAK,SAAS,GAAG,SAAS,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,SAAS;AACrF;;ACnBA;;;;;;;;AAQG;AAQH;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAC,OAA+B,EAAA;IAC/D,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC;AACtD,IAAA,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;AAGhF,IAAA,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,UAAU,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;;AAGhF,IAAA,OAAO,QAAQ,CAAC,MAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,GAAG,OAAO,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC,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C,eAAyB,KAAK,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;iBACrJ;YACH,CAAC;AACF,SAAA;KACF;AACH;;ACrHA;;;;;;;;AAQG;;ACRH;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"scion-components-menu.mjs","sources":["../../../../projects/scion/components/menu/src/menu-translate.util.ts","../../../../projects/scion/components/menu/src/menu-environment/menu-environment-providers.ts","../../../../projects/scion/components/menu/src/menu-accelerators.ts","../../../../projects/scion/components/menu/src/toolbar/ɵtoolbar.factory.ts","../../../../projects/scion/components/menu/src/menu/ɵmenu.factory.ts","../../../../projects/scion/components/menu/src/menu-item-sorter.ts","../../../../projects/scion/components/menu/src/menu-contribution-instant.provider.ts","../../../../projects/scion/components/menu/src/menu/accelerator-format.pipe.ts","../../../../projects/scion/components/menu/src/menu/menu-group.component.ts","../../../../projects/scion/components/menu/src/menu/menu-filter.component.ts","../../../../projects/scion/components/menu/src/menu/menu-filter.component.html","../../../../projects/scion/components/menu/src/menu/menu-filter.service.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar-control.component.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar-split-button.component.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar-icon.component.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar-label.component.ts","../../../../projects/scion/components/menu/src/menu/popover-ref.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar-group.component.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar-group.component.html","../../../../projects/scion/components/menu/src/menu/menu-group-label.component.ts","../../../../projects/scion/components/menu/src/menu/menu-item-label.component.ts","../../../../projects/scion/components/menu/src/menu/menu-item-icon.component.ts","../../../../projects/scion/components/menu/src/menu/menu.component.ts","../../../../projects/scion/components/menu/src/menu/menu.component.html","../../../../projects/scion/components/menu/src/menu-opener.service.ts","../../../../projects/scion/components/menu/src/menubar/ɵmenubar.factory.ts","../../../../projects/scion/components/menu/src/ɵmenu.registry.ts","../../../../projects/scion/components/menu/src/menu.registry.ts","../../../../projects/scion/components/menu/src/menu-adapter.model.ts","../../../../projects/scion/components/menu/src/ɵmenu.service.ts","../../../../projects/scion/components/menu/src/menu.service.ts","../../../../projects/scion/components/menu/src/menu-contribution.ts","../../../../projects/scion/components/menu/src/toolbar/toolbar.component.ts","../../../../projects/scion/components/menu/src/toolbar/public_api.ts","../../../../projects/scion/components/menu/src/menubar/menubar.component.ts","../../../../projects/scion/components/menu/src/menubar/menubar.component.html","../../../../projects/scion/components/menu/src/menubar/public_api.ts","../../../../projects/scion/components/menu/src/menu/public_api.ts","../../../../projects/scion/components/menu/src/menu-service.provider.ts","../../../../projects/scion/components/menu/src/menu-environment/menu-environment.provider.ts","../../../../projects/scion/components/menu/src/menu-environment/public_api.ts","../../../../projects/scion/components/menu/src/public_api.ts","../../../../projects/scion/components/menu/src/scion-components-menu.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Signal, untracked} from '@angular/core';\nimport {MaybeSignal} from '@scion/components/common';\nimport {text, Translatable} from '@scion/components/text';\n\n/**\n * Translates the given {@link Translatable}.\n */\nexport function translate(translatable: MaybeSignal<Translatable> | undefined): Signal<Translatable> | undefined {\n return translatable !== undefined ? untracked(() => text(translatable)) : undefined;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {computed, inject, InjectionToken, Injector, Provider, Signal} from '@angular/core';\nimport {coerceSignal} from '@scion/components/common';\nimport {Arrays, Objects} from '@scion/toolkit/util';\nimport {SciMenuAcceleratorTargetProviderFn, SciMenuContextProviderFn, SciMenuInjectionContextProviderFn} from './menu-environment.provider';\nimport {coerceElement} from '@angular/cdk/coercion';\n\n/**\n * Injects the context for menu locations and contributions based on the current injection context.\n *\n * Must be called within an injection context, or an explicit {@link Injector} passed.\n *\n * @see provideMenuContextProvider\n * @docs-private Not public API. For internal use only.\n */\nexport function injectMenuContext(options?: {injector?: Injector}): Signal<Map<string, unknown>> {\n const injector = options?.injector ?? inject(Injector);\n const providers = injector.get(SCI_MENU_CONTEXT_PROVIDERS, [], {optional: true});\n\n // Get contexts available in the current injection context.\n const contexts = providers.map(providerFn => coerceSignal(providerFn(injector)));\n\n // Merge contexts.\n return computed(() => new Map(contexts.flatMap(context => [...context?.() ?? new Map()])), {equal: Objects.isEqual});\n}\n\n/**\n * Injects dependency injection providers of the given menu context based on the current injection context.\n *\n * Must be called within an injection context, or an explicit {@link Injector} passed.\n *\n * @see provideMenuInjectionContextProvider\n * @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this function.\n */\nexport function injectMenuInjectionContextProviders(menuContext: Map<string, unknown>, options?: {injector?: Injector}): Provider[] {\n const injector = options?.injector ?? inject(Injector);\n const providers = injector.get(SCI_MENU_INJECTION_CONTEXT_PROVIDERS, [], {optional: true});\n\n return providers.flatMap(providerFn => providerFn(menuContext));\n}\n\n/**\n * Injects accelerator targets for menu locations based on the current injection context.\n *\n * Must be called within an injection context, or an explicit {@link Injector} passed.\n *\n * @see provideMenuAcceleratorTargetProvider\n * @docs-private Not public API. For internal use only.\n */\nexport function injectMenuAcceleratorTargets(options?: {injector?: Injector}): Signal<Element[]> {\n const injector = options?.injector ?? inject(Injector);\n const providers = injector.get(SCI_MENU_ACCELERATOR_TARGET_PROVIDERS, [], {optional: true});\n\n // Get accelerator targets available in the current injection context.\n const acceleratorTargets = providers.map(providerFn => coerceSignal(providerFn(injector)));\n\n // Concat accelerator targets.\n return computed(() => acceleratorTargets.flatMap(acceleratorTarget => Arrays.coerce(acceleratorTarget?.())).map(coerceElement), {equal: Objects.isEqual});\n}\n\n/**\n * Multi-DI token for registering a {@link SciMenuContextProviderFn} in a specific environment.\n *\n * @see provideMenuContextProvider\n */\nexport const SCI_MENU_CONTEXT_PROVIDER = new InjectionToken<SciMenuContextProviderFn[]>('SCI_MENU_CONTEXT_PROVIDER');\n\n/**\n * DI token to inject {@link SciMenuContextProviderFn} functions provided in the current and parent injectors.\n *\n * @see injectMenuContext\n */\nexport const SCI_MENU_CONTEXT_PROVIDERS = new InjectionToken<SciMenuContextProviderFn[]>('SCI_MENU_CONTEXT_PROVIDERS');\n\n/**\n * Multi-DI token for registering a {@link SciMenuInjectionContextProviderFn} in a specific environment.\n *\n * @see provideMenuInjectionContextProvider\n */\nexport const SCI_MENU_INJECTION_CONTEXT_PROVIDER = new InjectionToken<SciMenuInjectionContextProviderFn[]>('SCI_MENU_INJECTION_CONTEXT_PROVIDER');\n\n/**\n * DI token to inject {@link SciMenuInjectionContextProviderFn} functions provided in the current and parent injectors.\n *\n * @see injectMenuInjectionContextProviders\n */\nexport const SCI_MENU_INJECTION_CONTEXT_PROVIDERS = new InjectionToken<SciMenuInjectionContextProviderFn[]>('SCI_MENU_INJECTION_CONTEXT_PROVIDERS');\n\n/**\n * Multi-DI token for registering a {@link SciMenuAcceleratorTargetProviderFn} in a specific environment.\n *\n * @see provideMenuAcceleratorTargetProvider\n */\nexport const SCI_MENU_ACCELERATOR_TARGET_PROVIDER = new InjectionToken<SciMenuAcceleratorTargetProviderFn[]>('SCI_MENU_ACCELERATOR_TARGET_PROVIDER');\n\n/**\n * DI token to inject {@link SciMenuAcceleratorTargetProviderFn} functions provided in the current and parent injectors.\n *\n *\n * @see injectMenuAcceleratorTargets\n */\nexport const SCI_MENU_ACCELERATOR_TARGET_PROVIDERS = new InjectionToken<SciMenuAcceleratorTargetProviderFn[]>('SCI_MENU_ACCELERATOR_TARGET_PROVIDERS');\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {assertNotInReactiveContext, computed, DestroyRef, DOCUMENT, effect, ElementRef, inject, Injector, NgZone, runInInjectionContext, untracked} from '@angular/core';\nimport {SciMenuItem, SciMenuItemLike} from './menu.model';\nimport {Disposable, MaybeArray} from '@scion/toolkit/types';\nimport {fromEvent, merge, noop} from 'rxjs';\nimport {subscribeIn} from '@scion/toolkit/operators';\nimport {Arrays} from '@scion/toolkit/util';\nimport {ɵSciMenuService} from './ɵmenu.service';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {createDestroyableInjector} from '@scion/components/common';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {injectMenuAcceleratorTargets, injectMenuContext} from './menu-environment/menu-environment-providers';\n\n/**\n * Installs accelerators for menu items contributed to the given location matching the specified context.\n *\n * An accelerator maps a physical key combination (key combined with modifiers such as `Ctrl`, `Shift`, or `Alt`) to an application action,\n * enabling users to trigger an action without using a pointer device.\n *\n * Context and accelerator targets are inherited from the current injector hierarchy, but can be overridden via {@link SciMenuAcceleratorOptions.context} and {@link SciMenuAcceleratorOptions.target} options.\n *\n * This function must be called within an injection context, or an explicit {@link Injector} passed. Destroying the injection context uninstalls the accelerators.\n *\n * @param location - Specifies the menu, toolbar, or menubar for which to install accelerators.\n * @param options - Controls the installation of accelerators.\n * @returns Handle to uninstall the accelerators.\n *\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\n */\nexport function installMenuAccelerators(location: `menu:${string}` | `toolbar:${string}` | `menubar:${string}`, options?: SciMenuAcceleratorOptions): Disposable {\n const injector = createDestroyableInjector({parent: options?.injector ?? inject(Injector)});\n\n return runInInjectionContext(injector, () => {\n const environmentContext = injectMenuContext();\n const environmentTargets = injectMenuAcceleratorTargets();\n const context = computed(() => new Map([...environmentContext(), ...options?.context ?? new Map()]));\n const menuItems = inject(ɵSciMenuService).menuItems(location, context, {metadata: options?.metadata});\n\n effect(onCleanup => {\n const tracked = {\n menuItems: menuItems(),\n environmentTargets: environmentTargets(),\n };\n\n untracked(() => {\n const accelerators = ɵinstallMenuAccelerators(tracked.menuItems, {\n targets: options?.target,\n environmentTargets: tracked.environmentTargets,\n injector,\n });\n onCleanup(() => accelerators.dispose());\n });\n });\n\n return {\n dispose: () => injector.destroy(),\n };\n });\n}\n\n/**\n * Installs accelerators for given menu items, recursively for menu items in submenus and groups.\n */\nexport function ɵinstallMenuAccelerators(menuItems: SciMenuItemLike[], options?: ɵSciMenuAcceleratorOptions): Disposable {\n assertNotInReactiveContext(installMenuAccelerators, 'Call installMenuAccelerators() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n const menuItemsWithAccelerator = collectMenuItemsWithAccelerator(menuItems);\n if (!menuItemsWithAccelerator.length) {\n return {dispose: noop};\n }\n\n const injector = createDestroyableInjector({parent: options?.injector ?? inject(Injector)});\n const zone = injector.get(NgZone);\n const targets = coerceElements(options?.targets) ?? coerceElements(options?.environmentTargets) ?? [injector.get(DOCUMENT)];\n const onSelectFn = options?.onSelect ?? (menuItem => menuItem.onSelect?.());\n\n merge(...targets.map(target => fromEvent<KeyboardEvent>(target, 'keydown')))\n .pipe(\n subscribeIn(fn => zone.runOutsideAngular(fn)),\n takeUntilDestroyed(injector.get(DestroyRef)),\n )\n .subscribe(event => {\n // Skip if only pressing a modifier key.\n switch (event.key) {\n case 'Control':\n case 'Shift':\n case 'Alt':\n case 'AltGraph':\n return;\n // UNDOCUMENTED: `event.key` can be `undefined`, for example, when selecting an option from an input element's datalist.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n case undefined:\n return;\n }\n\n // Skip if not pressing a modifier key. Accelerators must have a modifier key.\n if (!event.ctrlKey && !event.altKey && !event.shiftKey && !event.metaKey && !allowedSingleKeys.has(event.key.toLowerCase())) {\n return;\n }\n\n const matchingMenuItems = menuItemsWithAccelerator.filter(menuItem => !menuItem.disabled?.() && matchesAccelerator(event, menuItem.accelerator!));\n if (!matchingMenuItems.length) {\n return;\n }\n\n // Invoke menu item handler.\n event.preventDefault();\n event.stopPropagation();\n zone.run(() => matchingMenuItems.forEach(menuItem => onSelectFn(menuItem)));\n });\n\n return {\n dispose: () => injector.destroy(),\n };\n}\n\n/**\n * Returns given native elements, or `undefined` if empty.\n */\nfunction coerceElements(targets: MaybeArray<Element | ElementRef<Element>> | undefined): Element[] | undefined {\n const elements = Arrays.coerce(targets).map(coerceElement);\n return elements.length ? elements : undefined;\n}\n\n/**\n * Returns a flat list of all menu items that have an accelerator.\n */\nexport function collectMenuItemsWithAccelerator(menuItemLikes: SciMenuItemLike[]): SciMenuItem[] {\n return menuItemLikes.reduce((menuItems, menuItemLike) => {\n switch (menuItemLike.type) {\n case 'menu-item': {\n return menuItems\n .concat(menuItemLike.accelerator ? menuItemLike : [])\n .concat(collectMenuItemsWithAccelerator(menuItemLike.actions ?? []))\n .concat(collectMenuItemsWithAccelerator(menuItemLike.menu?.children ?? []));\n }\n case 'group': {\n return menuItems\n .concat(collectMenuItemsWithAccelerator(menuItemLike.children))\n .concat(collectMenuItemsWithAccelerator(menuItemLike.actions ?? []));\n }\n }\n }, new Array<SciMenuItem>());\n}\n\n/**\n * Validates the passed menu accelerator to have a modifier, unless a function key, 'Delete', or 'Escape'.\n */\nexport function validateMenuAccelerator(accelerator: SciKeyboardAccelerator | undefined): SciKeyboardAccelerator | undefined {\n if (!accelerator) {\n return undefined;\n }\n\n if (!accelerator.ctrl && !accelerator.alt && !accelerator.shift && !allowedSingleKeys.has(accelerator.key.toLowerCase())) {\n console.warn(`[MenuDefinitionError] Illegal menu accelerator. The key '${accelerator.key}' requires a modifier such as 'Ctrl', 'Shift', or 'Alt'. Only function keys F1-F12 and 'Delete' are allowed without a modifier. Examples: ['ctrl', 's'], ['F5'].`);\n return undefined;\n }\n return accelerator;\n}\n\n/**\n * Tests if the given keyboard event matches the specified accelerator.\n */\nfunction matchesAccelerator(event: KeyboardEvent, accelerator: SciKeyboardAccelerator): boolean {\n // Fallback to code if key does not match to support diacritics like umlauts and accents.\n const keyMatches = accelerator.key.toLowerCase() === event.key.toLowerCase() || `Key${accelerator.key.toUpperCase()}` === event.code;\n if (!keyMatches) {\n return false;\n }\n // Handle Meta key as the Control key as on Apple devices the Command (⌘) key is used instead of the Control (Ctrl) key.\n if ((accelerator.ctrl ?? false) !== (event.ctrlKey || event.metaKey)) {\n return false;\n }\n if ((accelerator.shift ?? false) !== event.shiftKey) {\n return false;\n }\n if ((accelerator.alt ?? false) !== event.altKey) {\n return false;\n }\n if (accelerator.location === 'left' && event.location !== 1) {\n return false;\n }\n if (accelerator.location === 'right' && event.location !== 2) {\n return false;\n }\n if (accelerator.location === 'numpad' && event.location !== 3) {\n return false;\n }\n return true;\n}\n\n/**\n * Controls the installation of accelerators.\n */\nexport interface SciMenuAcceleratorOptions {\n /**\n * Specifies DOM elements on which to install menu accelerators. Defaults to {@link Document}.\n *\n * Alternatively, accelerator targets can be provided at the injector level using {@link provideMenuAcceleratorTargetProvider}, for example, at the component, route, or application level,\n * and are available to accelerators installed in the scope of this injector. Inherited targets can be overridden.\n */\n target?: MaybeArray<Element | ElementRef<Element>>;\n /**\n * Controls in which context to install menu accelerators.\n *\n * Menu contributions may declare a required context. Only accelerators of contributions matching the context are installed.\n *\n * A context can also be provided at the injector level using {@link provideMenuContextProvider}, for example, at the component, route, or application level,\n * and is available to accelerators installed in the scope of this injector. The inherited context can be overridden or extended. Setting a context entry to `undefined` clears it.\n */\n context?: Map<string, unknown>;\n /**\n * Specifies the injector used to install accelerators. Defaults to the current injection context.\n *\n * Accelerators are uninstalled when the injector is destroyed.\n */\n injector?: Injector;\n /**\n * Specifies metadata available to the operation.\n *\n * @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this property.\n */\n metadata?: {[key: string]: unknown};\n}\n\n/**\n * Controls the installation of accelerators.\n *\n * Accelerators are installed on the specified {@link targets}. If not set or empty, falls back to {@link environmentTargets}, defaulting to the {@link Document} if both are empty.\n */\nexport interface ɵSciMenuAcceleratorOptions {\n /**\n * Specifies DOM elements on which to install the accelerators. Defaults to {@link environmentTargets}.\n */\n targets?: MaybeArray<Element | ElementRef<Element>>;\n /**\n * Specifies default accelerator targets based on the current injection context. Defaults to {@link Document}.\n */\n environmentTargets?: MaybeArray<Element | ElementRef<Element>>;\n /**\n * Specifies the handler invoked when an accelerator is triggered. Defaults to invoking {@link SciMenuItem.onSelect}.\n */\n onSelect?: (menuItem: SciMenuItem) => void;\n /**\n * Specifies the injector used to install accelerators. Defaults to the current injection context.\n *\n * Accelerators are uninstalled when the passed injector is destroyed.\n */\n injector?: Injector;\n}\n\n/**\n * Represents a keyboard accelerator to match specific keystrokes or key combinations.\n *\n * An accelerator maps a physical key combination (key combined with modifiers such as `Ctrl`, `Shift`, or `Alt`) to an application action,\n * enabling users to trigger an action without using a pointer device.\n */\nexport interface SciKeyboardAccelerator {\n /**\n * Specifies the key of the accelerator.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values\n */\n key: string;\n /**\n * Indicates whether the `Ctrl` key (or `Cmd` key on macOS) must be pressed.\n */\n ctrl?: boolean;\n /**\n * Indicates whether the `Shift` key must be pressed.\n */\n shift?: boolean;\n /**\n * Indicates whether the `Alt` key (or `Opt` key on macOS) must be pressed.\n */\n alt?: boolean;\n /**\n * Specifies the physical location of the key on the keyboard.\n *\n * - `numpad`: Keys on the numeric keypad.\n * - `left`: Left-side modifier keys.\n * - `right`: Right-side modifier keys.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/location\n */\n location?: 'numpad' | 'left' | 'right';\n}\n\n/**\n * Keys that can be used without a modifier (ctrl, alt, shift).\n */\nconst allowedSingleKeys = new Set<string>([\n ...Array.from(Array(20).keys()).map(i => `f${i + 1}`), // F1 - F20\n 'delete',\n]);\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {SciMenuDescriptor, SciMenuFactory} from '../menu/menu.factory';\nimport {isSignal} from '@angular/core';\nimport {Arrays, prune} from '@scion/toolkit/util';\nimport {SciToolbarButtonDescriptor, SciToolbarControlDescriptor, SciToolbarFactory, SciToolbarGroupDescriptor, SciToolbarMenuDescriptor} from './toolbar.factory';\nimport {SciMenuItemLike} from '../menu.model';\nimport {constructMenu} from '../menu/ɵmenu.factory';\nimport {translate} from '../menu-translate.util';\nimport {validateMenuAccelerator} from '../menu-accelerators';\nimport {coerceSignal, MaybeSignal, SciComponentDescriptor} from '@scion/components/common';\nimport {Translatable} from '@scion/components/text';\nimport {ComponentType} from '@angular/cdk/portal';\n\n/**\n * Translation note: Texts are translated when added (not lazily when rendered) to simplify filtering.\n *\n * @inheritDoc\n */\nexport class ɵSciToolbarFactory implements SciToolbarFactory {\n\n public readonly menuItems = [] as SciMenuItemLike[];\n\n /** @inheritDoc */\n public addToolbarButton(descriptor: SciToolbarButtonDescriptor): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n labelText: translate(getLabelIfText(descriptor.label)),\n labelComponent: getLabelIfComponent(descriptor.label),\n iconLigature: coerceSignal(getIconIfLigature(descriptor.icon)),\n iconComponent: getIconIfComponent(descriptor.icon),\n checked: coerceSignal(descriptor.checked),\n tooltip: translate(descriptor.tooltip),\n accelerator: validateMenuAccelerator(descriptor.accelerator),\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n onSelect: async () => await descriptor.onSelect() as boolean | undefined ?? descriptor.checked === undefined, // Returning `true` will close the popover. Non-checkable items close by default.\n }));\n\n return this;\n }\n\n /** @inheritDoc */\n public addToolbarSplitButton(descriptor: SciToolbarButtonDescriptor & {menu?: SciMenuDescriptor['menu']}, menuFactoryFn?: (menu: SciMenuFactory) => void): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n labelText: translate(getLabelIfText(descriptor.label)),\n labelComponent: getLabelIfComponent(descriptor.label),\n iconLigature: coerceSignal(getIconIfLigature(descriptor.icon)),\n iconComponent: getIconIfComponent(descriptor.icon),\n checked: coerceSignal(descriptor.checked),\n tooltip: translate(descriptor.tooltip),\n accelerator: validateMenuAccelerator(descriptor.accelerator),\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n menu: constructMenu(menuFactoryFn, descriptor.menu),\n onSelect: async () => await descriptor.onSelect() as boolean | undefined ?? descriptor.checked === undefined, // Returning `true` will close the popover. Non-checkable items close by default.\n }));\n\n return this;\n }\n\n /** @inheritDoc */\n public addToolbarMenu(descriptor: SciToolbarMenuDescriptor, menuFactoryFn?: (menu: SciMenuFactory) => void): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n labelText: translate(getLabelIfText(descriptor.label)),\n labelComponent: getLabelIfComponent(descriptor.label),\n iconLigature: coerceSignal(getIconIfLigature(descriptor.icon)),\n iconComponent: getIconIfComponent(descriptor.icon),\n tooltip: translate(descriptor.tooltip),\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n visualMenuIndicator: descriptor.visualMenuIndicator,\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n menu: constructMenu(menuFactoryFn, descriptor.menu),\n }));\n\n return this;\n }\n\n /** @inheritDoc */\n public addToolbarControl(descriptor: SciToolbarControlDescriptor): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n control: prune({\n component: descriptor.component,\n bindings: descriptor.bindings,\n injector: descriptor.injector,\n providers: descriptor.providers,\n }),\n tooltip: translate(descriptor.tooltip),\n visible: coerceSignal(descriptor.visible),\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n }));\n\n return this;\n }\n\n /** @inheritDoc */\n public addToolbarSplitControl(descriptor: SciToolbarControlDescriptor & {menu?: SciMenuDescriptor['menu']}, menuFactoryFn?: (menu: SciMenuFactory) => void): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n control: prune({\n component: descriptor.component,\n bindings: descriptor.bindings,\n injector: descriptor.injector,\n providers: descriptor.providers,\n }),\n tooltip: translate(descriptor.tooltip),\n visible: coerceSignal(descriptor.visible),\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n menu: constructMenu(menuFactoryFn, descriptor.menu),\n }));\n\n return this;\n }\n\n /** @inheritDoc */\n public addGroup(groupFactoryFn: (group: SciToolbarFactory) => void): this;\n public addGroup(descriptor: SciToolbarGroupDescriptor, groupFactoryFn?: (group: SciToolbarFactory) => void): this;\n public addGroup(factoryOrDescriptor: ((group: SciToolbarFactory) => void) | SciToolbarGroupDescriptor, factoryIfDescriptor?: (group: SciToolbarFactory) => void): this {\n const [descriptor, groupFactoryFn] = typeof factoryOrDescriptor === 'function' ? [{}, factoryOrDescriptor] : [factoryOrDescriptor, factoryIfDescriptor];\n\n // Construct group.\n const groupFactory = new ɵSciToolbarFactory();\n groupFactoryFn?.(groupFactory);\n\n // Add group.\n this.menuItems.push(prune({\n type: 'group',\n name: descriptor.name,\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n children: groupFactory.menuItems,\n cssClass: Arrays.coerce(descriptor.cssClass),\n }));\n\n return this;\n }\n}\n\nfunction getLabelIfText(label: MaybeSignal<Translatable> | ComponentType<unknown> | SciComponentDescriptor | undefined): MaybeSignal<Translatable> | undefined {\n if (typeof label === 'string' || isSignal(label)) {\n return label;\n }\n return undefined;\n}\n\nfunction getLabelIfComponent(label: MaybeSignal<Translatable> | ComponentType<unknown> | SciComponentDescriptor | undefined): SciComponentDescriptor | undefined {\n if (typeof label === 'function' && !isSignal(label)) {\n return {component: label};\n }\n else if (typeof label === 'object') {\n return label;\n }\n return undefined;\n}\n\nfunction getIconIfLigature(icon: MaybeSignal<string> | ComponentType<unknown> | SciComponentDescriptor | undefined): MaybeSignal<string> | undefined {\n if (typeof icon === 'string' || isSignal(icon)) {\n return icon;\n }\n return undefined;\n}\n\nfunction getIconIfComponent(icon: MaybeSignal<Translatable> | ComponentType<unknown> | SciComponentDescriptor | undefined): SciComponentDescriptor | undefined {\n if (typeof icon === 'function' && !isSignal(icon)) {\n return {component: icon};\n }\n else if (typeof icon === 'object') {\n return icon;\n }\n return undefined;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {SciMenuDescriptor, SciMenuFactory, SciMenuFilterConfig, SciMenuGroupDescriptor, SciMenuItemDescriptor} from './menu.factory';\nimport {isSignal, Signal} from '@angular/core';\nimport {Arrays, prune} from '@scion/toolkit/util';\nimport {SciMenuItem, SciMenuItemLike} from '../menu.model';\nimport {ɵSciToolbarFactory} from '../toolbar/ɵtoolbar.factory';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {coerceSignal, MaybeSignal, SciComponentDescriptor} from '@scion/components/common';\nimport {Translatable} from '@scion/components/text';\nimport {translate} from '../menu-translate.util';\nimport {validateMenuAccelerator} from '../menu-accelerators';\n\n/**\n * Translation note: Texts are translated when added (not lazily when rendered) to simplify filtering.\n */\nexport class ɵSciMenuFactory implements SciMenuFactory {\n\n public readonly menuItems = [] as SciMenuItemLike[];\n\n /** @inheritDoc */\n public addMenuItem(descriptor: SciMenuItemDescriptor): this {\n // Construct action toolbar.\n const actionsFactory = new ɵSciToolbarFactory();\n descriptor.actions?.(actionsFactory);\n\n // Add menu item.\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n labelText: translate(getLabelIfText(descriptor.label)),\n labelComponent: getLabelIfComponent(descriptor.label),\n iconLigature: coerceSignal(getIconIfLigature(descriptor.icon)),\n iconComponent: getIconIfComponent(descriptor.icon),\n checked: coerceSignal(descriptor.checked),\n active: coerceSignal(descriptor.active),\n tooltip: translate(descriptor.tooltip),\n accelerator: validateMenuAccelerator(descriptor.accelerator),\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n actions: actionsFactory.menuItems,\n matchesFilter: descriptor.onFilter,\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n onSelect: async () => await descriptor.onSelect() as boolean | undefined ?? descriptor.checked === undefined, // Returning `true` will close the popover. Non-checkable items close by default.\n }));\n\n if (descriptor.checked && descriptor.icon) {\n throw Error('[MenuDefinitionError] Cannot use `checked` and `icon` together.');\n }\n\n return this;\n }\n\n /** @inheritDoc */\n public addMenu(descriptor: SciMenuDescriptor, menuFactoryFn?: (menu: SciMenuFactory) => void): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n labelText: translate(getLabelIfText(descriptor.label)),\n labelComponent: getLabelIfComponent(descriptor.label),\n iconLigature: coerceSignal(getIconIfLigature(descriptor.icon)),\n iconComponent: getIconIfComponent(descriptor.icon),\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n menu: constructMenu(menuFactoryFn, descriptor.menu),\n }));\n\n return this;\n }\n\n /** @inheritDoc */\n public addGroup(groupFactoryFn: (group: SciMenuFactory) => void): this;\n public addGroup(descriptor: SciMenuGroupDescriptor, groupFactoryFn?: (group: SciMenuFactory) => void): this;\n public addGroup(factoryOrDescriptor: ((group: SciMenuFactory) => void) | SciMenuGroupDescriptor, factoryIfDescriptor?: (group: SciMenuFactory) => void): this {\n const [descriptor, groupFactoryFn] = typeof factoryOrDescriptor === 'function' ? [{}, factoryOrDescriptor] : [factoryOrDescriptor, factoryIfDescriptor];\n\n // Construct group.\n const groupFactory = new ɵSciMenuFactory();\n groupFactoryFn?.(groupFactory);\n\n // Construct action toolbar.\n const actionsFactory = new ɵSciToolbarFactory();\n descriptor.actions?.(actionsFactory);\n\n // Add group.\n this.menuItems.push(prune({\n type: 'group',\n name: descriptor.name,\n label: translate(descriptor.label),\n collapsible: coerceCollapsibleGroupConfig(descriptor),\n glyphArea: descriptor.glyphArea,\n disabled: coerceSignal(descriptor.disabled),\n visible: coerceSignal(descriptor.visible),\n actions: actionsFactory.menuItems,\n children: groupFactory.menuItems,\n cssClass: Arrays.coerce(descriptor.cssClass),\n }));\n\n return this;\n }\n}\n\nfunction getLabelIfText(label: MaybeSignal<Translatable> | ComponentType<unknown> | SciComponentDescriptor): MaybeSignal<Translatable> | undefined {\n if (typeof label === 'string' || isSignal(label)) {\n return label;\n }\n return undefined;\n}\n\nfunction getLabelIfComponent(label: MaybeSignal<Translatable> | ComponentType<unknown> | SciComponentDescriptor): SciComponentDescriptor | undefined {\n if (typeof label === 'function' && !isSignal(label)) {\n return {component: label};\n }\n else if (typeof label === 'object') {\n return label;\n }\n return undefined;\n}\n\nfunction getIconIfLigature(icon: MaybeSignal<string> | ComponentType<unknown> | SciComponentDescriptor | undefined): MaybeSignal<string> | undefined {\n if (typeof icon === 'string' || isSignal(icon)) {\n return icon;\n }\n return undefined;\n}\n\nfunction getIconIfComponent(icon: MaybeSignal<string> | ComponentType<unknown> | SciComponentDescriptor | undefined): SciComponentDescriptor | undefined {\n if (typeof icon === 'function' && !isSignal(icon)) {\n return {component: icon};\n }\n else if (typeof icon === 'object') {\n return icon;\n }\n return undefined;\n}\n\nfunction coerceCollapsibleGroupConfig(groupDescriptor: SciMenuGroupDescriptor): {collapsed: boolean} | undefined {\n const collapsible = groupDescriptor.collapsible;\n\n if (typeof collapsible === 'object') {\n return collapsible;\n }\n\n return collapsible === true ? {collapsed: false} : undefined;\n}\n\nexport function constructMenu(menuFactoryFn: ((menu: SciMenuFactory) => void) | undefined, menuDescriptor?: SciMenuDescriptor['menu']): SciMenuItem['menu'] {\n const menuFactory = new ɵSciMenuFactory();\n menuFactoryFn?.(menuFactory);\n\n return prune({\n name: menuDescriptor?.name,\n children: menuFactory.menuItems,\n width: menuDescriptor?.width,\n minWidth: menuDescriptor?.minWidth,\n maxWidth: menuDescriptor?.maxWidth,\n maxHeight: menuDescriptor?.maxHeight,\n filter: coerceFilterConfig(menuDescriptor),\n });\n\n function coerceFilterConfig(menuDescriptor?: SciMenuDescriptor['menu']): SciMenuFilterConfig<Signal<Translatable>> | undefined {\n const filter = menuDescriptor?.filter;\n\n if (typeof filter === 'object') {\n return prune({\n placeholder: coerceSignal(filter.placeholder),\n notFoundMessage: coerceSignal(filter.notFoundMessage),\n focus: filter.focus,\n }, {pruneIfEmpty: true});\n }\n return filter === true ? {} : undefined;\n }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {SciMenuItemLike} from './menu.model';\n\n/**\n * Sorts passed menu items based on its preferred {@link SciMenuItemLike.position}.\n *\n * This function is not recursive, not sorting menu items in submenus or groups.\n */\nexport function sortMenuItems(menuItems: SciMenuItemLike[]): SciMenuItemLike[] {\n // Note: The standard JavaScript sorting algorithms cannot be used as it requires strict weak element ordering (transitivity), not given for elements positioned relative to each other.\n const sorted = [] as SciMenuItemLike[];\n const queue = new Set(menuItems);\n\n // Add contributions which do not declare an insertion point or a non-existent insertion point.\n queue.forEach(menuItem => {\n // Add contribution if not declaring an insertion point.\n if (!menuItem.position) {\n sorted.push(menuItem);\n queue.delete(menuItem);\n }\n // Add contribution if declaring a non-existent \"before\" insertion point.\n else if (menuItem.position.before && !menuItems.some(it => it.name === menuItem.position!.before)) {\n sorted.push(menuItem);\n queue.delete(menuItem);\n }\n // Add contribution if declaring a non-existent \"after\" insertion point.\n else if (menuItem.position.after && !menuItems.some(it => it.name === menuItem.position!.after)) {\n sorted.push(menuItem);\n queue.delete(menuItem);\n }\n });\n\n // Add contributions at the start or end.\n queue.forEach(menuItem => {\n if (menuItem.position?.position === 'start') {\n sorted.unshift(menuItem);\n queue.delete(menuItem);\n }\n else if (menuItem.position?.position === 'end') {\n sorted.push(menuItem);\n queue.delete(menuItem);\n }\n });\n\n // Add contributions declaring an insertion point. Multiple iterations may be required.\n while (queue.size) {\n const queueSize = queue.size;\n\n for (const menuItem of queue) {\n // Add contributions declaring a \"before\" insertion point.\n if (menuItem.position?.before) {\n const index = sorted.findIndex(candidate => candidate.name === menuItem.position!.before);\n if (index !== -1) {\n sorted.splice(index, 0, menuItem);\n queue.delete(menuItem);\n }\n }\n // Add contributions declaring an \"after\" insertion point.\n else if (menuItem.position?.after) {\n const index = sorted.findIndex(candidate => candidate.name === menuItem.position!.after);\n if (index !== -1) {\n sorted.splice(index + 1, 0, menuItem);\n queue.delete(menuItem);\n }\n }\n }\n\n if (queue.size === queueSize) {\n // TODO [menu] Better message, Algo error\n console.warn('[@scion/components] Menu contributions reference non-existent menu items.', queue);\n sorted.push(...queue);\n queue.clear();\n }\n }\n\n return sorted;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable} from '@angular/core';\n\n/**\n * Provides registration instants for contributions.\n *\n * Two consecutive calls always have different instants, in ascending order.\n */\n@Injectable({providedIn: 'root'})\nexport class SciMenuContributionInstantProvider {\n\n private _instant = 0;\n\n /**\n * Provides the next instant.\n */\n public next(): number {\n return ++this._instant;\n }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Pipe, PipeTransform} from '@angular/core';\nimport {SciKeyboardAccelerator} from '../menu-accelerators';\n\n/**\n * Formats a keyboard accelerator for display.\n *\n * If `tooltip` is specified, appends the accelerator in parentheses.\n */\n@Pipe({name: 'sciFormatAccelerator'})\nexport class SciFormatAcceleratorPipe implements PipeTransform {\n\n public transform(accelerator: SciKeyboardAccelerator | undefined, tooltip?: string): string | undefined {\n if (!accelerator) {\n return tooltip;\n }\n\n const modifiers = [];\n if (accelerator.ctrl) {\n modifiers.push(ctrlKeySymbol);\n }\n if (accelerator.shift) {\n modifiers.push('Shift');\n }\n if (accelerator.alt) {\n modifiers.push('Alt');\n }\n\n const key = formatKey(accelerator);\n const formattedAccelerator = `${accelerator.location === 'numpad' ? `NumPad ` : ''}${modifiers.concat(key).join('+')}`;\n return tooltip ? `${tooltip} (${formattedAccelerator})` : formattedAccelerator;\n }\n}\n\nfunction formatKey(accelerator: SciKeyboardAccelerator): string {\n switch (accelerator.key.toLowerCase()) {\n case ' ':\n return 'Space';\n case 'arrowdown':\n return 'Down';\n case 'arrowup':\n return 'Up';\n case 'arrowleft':\n return 'Left';\n case 'arrowright':\n return 'Right';\n default:\n return accelerator.key[0]!.toUpperCase() + accelerator.key.substring(1);\n }\n}\n\n/**\n * Platform-specific name for the Control modifier key.\n *\n * Resolves to `⌘` on macOS and `Ctrl` on other operating systems.\n */\nconst ctrlKeySymbol = navigator.platform.startsWith('Mac') ? '⌘' : 'Ctrl';\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {ApplicationRef, Component, computed, createComponent, DestroyRef, ElementRef, EnvironmentInjector, inject, Injector, input, inputBinding} from '@angular/core';\r\nimport {provideMenuComponentRole, SciMenuComponent, SciMenuGroupConfig} from './menu.component';\r\nimport {SciMenuGroup} from '../menu.model';\r\n\r\n/**\r\n * Alias for {@link SciMenuComponent} with `sci-menu-group` as tag name.\r\n */\r\n@Component({\r\n selector: 'sci-menu-group',\r\n template: '', // Template provided by `SciMenuComponent`.\r\n})\r\nexport class SciMenuGroupComponent {\r\n\r\n public readonly group = input.required<SciMenuGroup>();\r\n public readonly glyphArea = input.required<boolean>();\r\n public readonly disabled = input<boolean>();\r\n public readonly cssClass = input<string[]>();\r\n\r\n constructor() {\r\n const menuComponent = createComponent(SciMenuComponent, {\r\n elementInjector: inject(Injector),\r\n environmentInjector: inject(EnvironmentInjector),\r\n hostElement: inject(ElementRef).nativeElement as HTMLElement,\r\n bindings: [\r\n inputBinding('menuItems', computed(() => this.group().children)),\r\n inputBinding('disabled', this.disabled),\r\n inputBinding('cssClass', this.cssClass),\r\n inputBinding('glyphArea', this.glyphArea),\r\n inputBinding('group', computed((): SciMenuGroupConfig => ({\r\n label: this.group().label?.(),\r\n collapsible: !!this.group().collapsible,\r\n collapsed: this.group().collapsible?.collapsed ?? false,\r\n hideGlyphArea: this.group().glyphArea === false,\r\n actions: this.group().actions ?? [],\r\n }))),\r\n ],\r\n directives: [\r\n provideMenuComponentRole('group'),\r\n ],\r\n });\r\n\r\n // Attach component to Angular component tree for change detection.\r\n inject(ApplicationRef).attachView(menuComponent.hostView);\r\n\r\n // Destroy component when host is destroyed.\r\n inject(DestroyRef).onDestroy(() => menuComponent.destroy());\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component, ElementRef, input, model, viewChild} from '@angular/core';\r\nimport {FormsModule} from '@angular/forms';\r\nimport {SciTextPipe} from '@scion/components/text';\r\nimport {SciIconComponent} from '@scion/components/icon';\r\n\r\n@Component({\r\n selector: 'sci-menu-filter',\r\n templateUrl: './menu-filter.component.html',\r\n styleUrl: './menu-filter.component.scss',\r\n imports: [\r\n FormsModule,\r\n SciTextPipe,\r\n SciIconComponent,\r\n ],\r\n host: {\r\n '[attr.tabindex]': '-1', // enable delegation of programmatic focus requests\r\n '(focus)': 'focus()',\r\n },\r\n})\r\nexport class SciMenuFilterComponent {\r\n\r\n public readonly placeholder = input.required<string>();\r\n public readonly text = model<string>('');\r\n\r\n private readonly _inputField = viewChild.required<ElementRef<HTMLInputElement>>('input');\r\n\r\n public focus(): void {\r\n this._inputField().nativeElement.focus();\r\n }\r\n\r\n protected onClear(): void {\r\n this.text.set('');\r\n this.focus();\r\n }\r\n}\r\n","<input type=\"text\" autocomplete=\"off\" class=\"e2e-menu-filter-input\" [attr.placeholder]=\"placeholder()\" [(ngModel)]=\"text\" #input>\r\n<button class=\"clear\" (click)=\"onClear()\" [title]=\"('%scion.components.clear.tooltip' | sciText)()\" tabindex=\"-1\">\r\n <sci-icon>scion.clear</sci-icon>\r\n</button>\r\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {computed, Signal, signal} from '@angular/core';\nimport {SciMenuItem} from '../menu.model';\n\n/**\n * Filters menu items based on the passed filter text.\n *\n * Filtering is hierarchical; submenus and groups inherit the filter of their parent menus.\n * A menu item matches only if matching its menu filter and all parent menu filters.\n *\n * Can be injected into {@link SciMenuComponent}.\n */\nexport class MenuFilter {\n\n private readonly _filterText = signal<string | null>(null);\n\n /**\n * Indicates whether filtering is active.\n */\n public readonly active = computed((): boolean => {\n return !!this._filterText() || !!this._parentMenuFilter?.active();\n });\n\n constructor(private _parentMenuFilter: MenuFilter | null) {\n }\n\n /**\n * Sets the filter for filtering menu items.\n */\n public setFilterText(filterText: string | null): void {\n this._filterText.set(filterText || null); // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing\n }\n\n /**\n * Tests whether the given menu item matches the filter.\n */\n public matches(menuItem: SciMenuItem): Signal<boolean> {\n return computed(() => {\n const filterText = this._filterText();\n\n // Test if the menu item matches the filter using its filter function, if any.\n if (filterText && menuItem.matchesFilter && !menuItem.matchesFilter(filterText)) {\n return false;\n }\n\n // Test if the display text of the menu item matches the filter.\n if (filterText && !menuItem.matchesFilter && menuItem.labelText && !menuItem.labelText().toLowerCase().includes(filterText.toLowerCase())) {\n return false;\n }\n\n // Test if the menu item matches the parent filter, if any.\n if (this._parentMenuFilter && !this._parentMenuFilter.matches(menuItem)()) {\n return false;\n }\n\n return true;\n });\n }\n}\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for a toolbar control provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-toolbar-control',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciToolbarControlComponent {\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component, ElementRef, inject} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for a toolbar split button provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-toolbar-split-button',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciToolbarSplitButtonComponent {\r\n\r\n public readonly host = inject(ElementRef).nativeElement as HTMLElement;\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for the icon of a toolbar item provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-toolbar-icon',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciToolbarIconComponent {\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for the label of a toolbar item provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-toolbar-label',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciToolbarLabelComponent {\r\n}\r\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {DestroyRef, ElementRef, inject, InjectionToken, signal, WritableSignal} from '@angular/core';\n\n/**\n * Provides a reference to the menu's popover element and child popover, if any.\n *\n * A child popover can be a submenu or a menu opened from a menu item's action toolbar.\n *\n * Can be injected into {@link SciMenuComponent}.\n */\nexport class PopoverRef {\n\n private readonly _element = inject(ElementRef).nativeElement as HTMLElement;\n private readonly _parentPopover = inject(PopoverRef, {skipSelf: true, optional: true});\n\n /**\n * Reference to the child popover, if any. Can be a submenu or a menu opened from a menu item's action toolbar.\n */\n public readonly childPopover = signal<PopoverRef | undefined>(undefined);\n\n /**\n * Indicates if this is a submenu popover, i.e., not a top-level menu nor a menu opened from a menu item's action toolbar.\n */\n public readonly isSubmenu: boolean;\n\n constructor(options: {isSubmenu: boolean}) {\n this.isSubmenu = options.isSubmenu;\n this.registerPopover();\n this.registerPopoverInParentPopover();\n }\n\n /**\n * Registers this popover in {@link POPOVER_REFS}.\n */\n private registerPopover(): void {\n const popovers = inject(POPOVER_REFS);\n\n // Register this popover.\n popovers.update(popovers => new Set(popovers).add(this));\n\n // Unregister popover when destroyed.\n inject(DestroyRef).onDestroy(() => popovers.update(popovers => {\n const copy = new Set(popovers);\n copy.delete(this);\n return copy;\n }));\n }\n\n /**\n * Registers this popover as child popover in the parent {@link PopoverRef}, if any.\n */\n private registerPopoverInParentPopover(): void {\n const parentPopover = this._parentPopover;\n if (!parentPopover) {\n return;\n }\n\n parentPopover.childPopover.set(this);\n\n // Unregister popover when destroyed.\n inject(DestroyRef).onDestroy(() => parentPopover.childPopover.update(childPopover => childPopover == this ? undefined : childPopover));\n }\n\n /**\n * Closes this popover, and parent popovers if specified.\n *\n * Defaults to not closing parent popovers.\n */\n public close(options?: {closeParents?: boolean}): void {\n this._element.hidePopover();\n\n if (options?.closeParents) {\n this._parentPopover?.close(options);\n }\n }\n}\n\n/**\n * DI token to inject currently open menu popovers.\n */\nexport const POPOVER_REFS = new InjectionToken<WritableSignal<Set<PopoverRef>>>('POPOVER_REFS', {\n providedIn: 'root',\n factory: () => signal(new Set()),\n});\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component, effect, inject, input, linkedSignal, signal, Signal, untracked, viewChildren, ViewContainerRef} from '@angular/core';\r\nimport {SciMenuGroup, SciMenuItem, SciMenuItemLike} from '../menu.model';\r\nimport {ɵSciMenuService} from '../ɵmenu.service';\r\nimport {SciFormatAcceleratorPipe} from '../menu/accelerator-format.pipe';\r\nimport {SciAttributesDirective, SciComponentOutletDirective} from '@scion/components/common';\r\nimport {SciIconComponent} from '@scion/components/icon';\r\nimport {RequireOne} from '@scion/toolkit/types';\r\nimport {NgTemplateOutlet} from '@angular/common';\r\nimport {SciToolbarControlComponent} from './toolbar-control.component';\r\nimport {SciToolbarSplitButtonComponent} from './toolbar-split-button.component';\r\nimport {SciToolbarIconComponent} from './toolbar-icon.component';\r\nimport {SciToolbarLabelComponent} from './toolbar-label.component';\r\nimport {PopoverRef} from '../menu/popover-ref';\r\nimport {SciMenuFilterConfig} from '../menu/menu.factory';\r\n\r\n/**\r\n * Represents a visually separated group of related items within a toolbar.\r\n */\r\n@Component({\r\n selector: 'sci-toolbar-group',\r\n templateUrl: './toolbar-group.component.html',\r\n styleUrl: './toolbar-group.component.scss',\r\n imports: [\r\n SciComponentOutletDirective,\r\n SciAttributesDirective,\r\n SciIconComponent,\r\n SciFormatAcceleratorPipe,\r\n SciToolbarSplitButtonComponent,\r\n SciToolbarControlComponent,\r\n SciToolbarIconComponent,\r\n SciToolbarLabelComponent,\r\n NgTemplateOutlet,\r\n ],\r\n host: {\r\n '[attr.data-orientation]': 'orientation()',\r\n },\r\n})\r\nexport class SciToolbarGroupComponent {\r\n\r\n /**\r\n * Specifies the toolbar items to display in this group.\r\n */\r\n public readonly menuItems = input.required<Array<SciMenuItem | SciMenuGroup>>();\r\n\r\n /**\r\n * Specifies the orientation of the items in this group.\r\n */\r\n public readonly orientation = input.required<'horizontal' | 'vertical'>();\r\n\r\n /**\r\n * Controls whether to disable the items in this group.\r\n */\r\n public readonly disabled = input<boolean>();\r\n\r\n /**\r\n * Controls where to attach popovers in the DOM.\r\n */\r\n public readonly popoverViewContainerRef = input.required<ViewContainerRef>();\r\n\r\n /**\r\n * Indicates whether any menu within this toolbar group is currently open.\r\n */\r\n public readonly menuOpen = this.computeMenuOpen();\r\n\r\n private readonly _childToolbarGroups = viewChildren(SciToolbarGroupComponent);\r\n\r\n /** Reference to the popover. Only set if displayed in a menu (menu item action toolbar). */\r\n private readonly _popoverRef = inject(PopoverRef, {optional: true});\r\n\r\n protected readonly activeMenuItem = linkedSignal<SciMenuItemLike[], {menuItem: SciMenuItem; element: HTMLElement; closing?: true | 'prevented'} | null>({\r\n source: this.menuItems, // Unset when menu items change.\r\n computation: () => null,\r\n });\r\n\r\n constructor() {\r\n this.installMenuOpener();\r\n }\r\n\r\n /**\r\n * Method invoked when clicking on a toolbar button.\r\n */\r\n protected async onSelect(menuItem: SciMenuItem): Promise<void> {\r\n if (await menuItem.onSelect!()) {\r\n this._popoverRef?.close();\r\n }\r\n }\r\n\r\n /**\r\n * Method invoked when clicking on a menu button.\r\n */\r\n protected onToolbarMenuButtonClick(menuItem: SciMenuItem, element: HTMLElement): void {\r\n this.activeMenuItem.update(activeMenuItem => activeMenuItem?.menuItem === menuItem ? null : {menuItem, element});\r\n }\r\n\r\n /**\r\n * Method invoked before clicking on a menu button.\r\n *\r\n * When clicking on the active menu button, mark it as closing to prevent immediate re-opening race condition on subsequent click event.\r\n */\r\n protected onToolbarMenuButtonMouseDown(menuItem: SciMenuItem): void {\r\n const activeMenuItem = this.activeMenuItem();\r\n\r\n if (activeMenuItem?.menuItem === menuItem) {\r\n activeMenuItem.closing = true;\r\n }\r\n }\r\n\r\n /**\r\n * Method invoked when moving the pointer out of a menu button.\r\n *\r\n * Clean up closing state set by {@link onToolbarMenuButtonMouseDown}, if any.\r\n */\r\n protected onToolbarMenuButtonMouseLeave(menuItem: SciMenuItem): void {\r\n const activeMenuItem = this.activeMenuItem();\r\n if (activeMenuItem?.menuItem !== menuItem) {\r\n return;\r\n }\r\n\r\n if (activeMenuItem.closing === 'prevented') {\r\n this.activeMenuItem.set(null); // unset active menu\r\n }\r\n else if (activeMenuItem.closing) {\r\n delete activeMenuItem.closing; // unset closing state\r\n }\r\n }\r\n\r\n /**\r\n * Opens a menu based on {@link activeMenuItem}.\r\n */\r\n private installMenuOpener(): void {\r\n const menuService = inject(ɵSciMenuService);\r\n\r\n effect(onCleanup => {\r\n if (!this.activeMenuItem()) {\r\n return;\r\n }\r\n\r\n const {menuItem, element} = this.activeMenuItem()!;\r\n const menu = menuItem.menu!;\r\n const align = this.orientation() === 'horizontal' ? 'vertical' : 'horizontal';\r\n\r\n untracked(() => {\r\n const menuRef = menuService.open(menu.children, {\r\n anchor: element,\r\n viewContainerRef: this.popoverViewContainerRef(),\r\n filter: menu.filter as RequireOne<SciMenuFilterConfig> | undefined,\r\n width: menu.width,\r\n minWidth: menu.minWidth,\r\n maxWidth: menu.maxWidth,\r\n maxHeight: menu.maxHeight,\r\n cssClass: menuItem.cssClass,\r\n attributes: menuItem.attributes,\r\n offset: {\r\n x: align === 'horizontal' ? 1 : 0,\r\n y: align === 'vertical' ? 1 : 0,\r\n },\r\n align,\r\n });\r\n\r\n // Close when opening another menu.\r\n onCleanup(() => menuRef.close());\r\n\r\n // Unset when closing menu.\r\n menuRef.onClose(() => {\r\n const activeMenuItem = this.activeMenuItem();\r\n\r\n // Do not unset if another menu was opened in the meantime.\r\n if (activeMenuItem?.menuItem !== menuItem) {\r\n return;\r\n }\r\n\r\n // Prevent immediate re-opening race condition when toolbar button is clicked to close.\r\n if (activeMenuItem.closing) {\r\n activeMenuItem.closing = 'prevented';\r\n return;\r\n }\r\n\r\n this.activeMenuItem.set(null);\r\n });\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Computes whether any menu within this toolbar group is currently open.\r\n */\r\n private computeMenuOpen(): Signal<boolean> {\r\n // Do not return `computed` signal to prevent illegal access to required component inputs until Angular has completed the initialization of this component,\r\n // happening when reading the signal from the parent component's template, e.g., via reference variable.\r\n const menuOpen = signal(false);\r\n effect(() => {\r\n menuOpen.set(!!this.activeMenuItem() || this._childToolbarGroups().some(childGroup => childGroup.menuOpen()));\r\n });\r\n return menuOpen;\r\n }\r\n}\r\n","@for (menuItem of menuItems(); track $index) {\r\n @let disabled = this.disabled() || menuItem.disabled?.() || false;\r\n @switch (menuItem.type) {\r\n <!-- Toolbar Item -->\r\n @case ('menu-item') {\r\n @let isSplitButton = (menuItem.onSelect || menuItem.control) && menuItem.menu?.children?.length;\r\n\r\n @if (isSplitButton) {\r\n <sci-toolbar-split-button [class]=\"menuItem.cssClass\" #split_button_element>\r\n <ng-container *ngTemplateOutlet=\"menu_item_template; context: {anchor: split_button_element.host}\"/>\r\n </sci-toolbar-split-button>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"menu_item_template\"/>\r\n }\r\n\r\n <!-- Template for rendering the content of a toolbar item. -->\r\n <ng-template #menu_item_template let-anchor=\"anchor\">\r\n <!-- Render push or toggle button. -->\r\n @if (menuItem.onSelect) {\r\n <button [attr.disabled]=\"disabled || null\"\r\n [attr.title]=\"menuItem.accelerator | sciFormatAccelerator:menuItem.tooltip?.()\"\r\n [class.checked]=\"menuItem.checked?.()\"\r\n [class]=\"menuItem.cssClass\" class=\"menu-item toolbar-button e2e-menu-item\"\r\n [sciAttributes]=\"menuItem.attributes\"\r\n (click)=\"onSelect(menuItem)\">\r\n <!-- Render icon, if any. -->\r\n <ng-container *ngTemplateOutlet=\"icon_template; context: {$implicit: menuItem}\"/>\r\n <!-- Render label, if any. -->\r\n <ng-container *ngTemplateOutlet=\"label_template; context: {$implicit: menuItem}\"/>\r\n </button>\r\n } @else if (menuItem.control) {\r\n <!-- Render custom control. -->\r\n <sci-toolbar-control [attr.title]=\"menuItem.accelerator | sciFormatAccelerator:menuItem.tooltip?.()\"\r\n [class]=\"menuItem.cssClass\" class=\"e2e-menu-item\"\r\n [sciAttributes]=\"menuItem.attributes\">\r\n <ng-container *sciComponentOutlet=\"menuItem.control\"/>\r\n </sci-toolbar-control>\r\n }\r\n\r\n <!-- Render menu button. -->\r\n @if (menuItem.menu?.children?.length) {\r\n @let hasLabel = menuItem.labelText || menuItem.labelComponent;\r\n @let hasIcon = menuItem.iconLigature || menuItem.iconComponent;\r\n @let hasVisualMenuIndicator = menuItem.visualMenuIndicator ?? true;\r\n @let hasIconChevron = hasVisualMenuIndicator && !isSplitButton && hasIcon && !hasLabel;\r\n @let hasChevron = hasVisualMenuIndicator && (isSplitButton || !hasIconChevron);\r\n\r\n <button [attr.disabled]=\"disabled || null\"\r\n [attr.title]=\"menuItem.tooltip?.()\"\r\n [class.menu-open]=\"activeMenuItem()?.menuItem === menuItem\"\r\n [class.menu-indicator]=\"hasIconChevron\"\r\n [class]=\"menuItem.cssClass\" class=\"menu-item e2e-menu-item\"\r\n [sciAttributes]=\"menuItem.attributes\"\r\n (click)=\"onToolbarMenuButtonClick(menuItem, anchor ?? menu_button)\"\r\n (mousedown)=\"onToolbarMenuButtonMouseDown(menuItem)\"\r\n (mouseleave)=\"onToolbarMenuButtonMouseLeave(menuItem)\"\r\n #menu_button>\r\n @if (!isSplitButton) {\r\n <!-- Render icon, if any. -->\r\n <ng-container *ngTemplateOutlet=\"icon_template; context: {$implicit: menuItem}\"/>\r\n <!-- Render label, if any. -->\r\n <ng-container *ngTemplateOutlet=\"label_template; context: {$implicit: menuItem}\"/>\r\n }\r\n <!-- Render chevron to indicate dropdown. -->\r\n @if (hasChevron) {\r\n <sci-icon class=\"chevron\">scion.chevron_down</sci-icon>\r\n }\r\n </button>\r\n }\r\n </ng-template>\r\n }\r\n <!-- Toolbar Group -->\r\n @case ('group') {\r\n <sci-toolbar-group [menuItems]=\"menuItem.children\"\r\n [orientation]=\"orientation()\"\r\n [disabled]=\"disabled\"\r\n [popoverViewContainerRef]=\"popoverViewContainerRef()\"\r\n [class]=\"menuItem.cssClass\"/>\r\n }\r\n }\r\n}\r\n\r\n<!-- Renders the icon of a menu item, if any. -->\r\n<ng-template #icon_template let-menuItem>\r\n @if (menuItem.iconLigature) {\r\n <sci-icon>\r\n {{menuItem.iconLigature()}}\r\n </sci-icon>\r\n } @else if (menuItem.iconComponent) {\r\n <sci-toolbar-icon>\r\n <ng-container *sciComponentOutlet=\"menuItem.iconComponent\"/>\r\n </sci-toolbar-icon>\r\n }\r\n</ng-template>\r\n\r\n<!-- Renders the label of a menu item, if any. -->\r\n<ng-template #label_template let-menuItem>\r\n @if (menuItem.labelText) {\r\n <sci-toolbar-label>\r\n {{menuItem.labelText()}}\r\n </sci-toolbar-label>\r\n } @else if (menuItem.labelComponent) {\r\n <sci-toolbar-label>\r\n <ng-container *sciComponentOutlet=\"menuItem.labelComponent\"/>\r\n </sci-toolbar-label>\r\n }\r\n</ng-template>\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for the label of a menu group provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-menu-group-label',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciMenuGroupLabelComponent {\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for the label of a menu item provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-menu-item-label',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciMenuItemLabelComponent {\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component} from '@angular/core';\r\n\r\n/**\r\n * Represents a semantic element for the icon of a menu item provided as slotted content.\r\n */\r\n@Component({\r\n selector: 'sci-menu-item-icon',\r\n template: '<ng-content/>',\r\n})\r\nexport class SciMenuItemIconComponent {\r\n}\r\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {afterRenderEffect, Component, computed, Directive, effect, ElementRef, inject, InjectionToken, Injector, input, linkedSignal, NgZone, Provider, Signal, Type, untracked, viewChild, ViewContainerRef, WritableSignal} from '@angular/core';\r\nimport {SciFormatAcceleratorPipe} from './accelerator-format.pipe';\r\nimport {SciMenuGroupComponent} from './menu-group.component';\r\nimport {SciMenuFilterComponent} from './menu-filter.component';\r\nimport {MenuFilter} from './menu-filter.service';\r\nimport {NgTemplateOutlet} from '@angular/common';\r\nimport {SciMenuGroup, SciMenuItem, SciMenuItemLike} from '../menu.model';\r\nimport {ɵSciMenuService} from '../ɵmenu.service';\r\nimport {SciToolbarGroupComponent} from '../toolbar/toolbar-group.component';\r\nimport {SciViewportComponent} from '@scion/components/viewport';\r\nimport {SciTextPipe, Translatable} from '@scion/components/text';\r\nimport {SciAttributesDirective, SciComponentOutletDirective} from '@scion/components/common';\r\nimport {SciIconComponent} from '@scion/components/icon';\r\nimport {RequireOne} from '@scion/toolkit/types';\r\nimport {SciMenuGroupLabelComponent} from './menu-group-label.component';\r\nimport {SciMenuItemLabelComponent} from './menu-item-label.component';\r\nimport {SciMenuItemIconComponent} from './menu-item-icon.component';\r\nimport {PopoverRef} from './popover-ref';\r\nimport {takeUntilDestroyed, toObservable} from '@angular/core/rxjs-interop';\r\nimport {filter, observeOn, raceWith, switchMap, take} from 'rxjs/operators';\r\nimport {animationFrameScheduler, EMPTY, fromEvent} from 'rxjs';\r\nimport {observeIn, subscribeIn} from '@scion/toolkit/operators';\r\nimport {ɵinstallMenuAccelerators} from '../menu-accelerators';\r\nimport {SciMenuFilterConfig} from './menu.factory';\r\n\r\n/**\r\n * Represents a menu or a group of menu items.\r\n */\r\n@Component({\r\n selector: 'sci-menu',\r\n templateUrl: './menu.component.html',\r\n styleUrl: './menu.component.scss',\r\n imports: [\r\n SciMenuGroupComponent,\r\n SciMenuFilterComponent,\r\n SciToolbarGroupComponent,\r\n SciViewportComponent,\r\n SciTextPipe,\r\n SciComponentOutletDirective,\r\n SciAttributesDirective,\r\n SciIconComponent,\r\n SciMenuGroupLabelComponent,\r\n SciMenuItemLabelComponent,\r\n SciMenuItemIconComponent,\r\n SciFormatAcceleratorPipe,\r\n NgTemplateOutlet,\r\n ],\r\n providers: [\r\n providePopoverRef(),\r\n provideMenuFilter(),\r\n ],\r\n host: {\r\n '[style.--ɵsci-menu-width]': 'menuSize().width',\r\n '[style.--ɵsci-menu-min-width]': 'menuSize().minWidth',\r\n '[style.--ɵsci-menu-max-width]': 'menuSize().maxWidth',\r\n '[style.--ɵsci-menu-max-height]': 'menuSize().maxHeight',\r\n '[style.--ɵsci-menu-scrolling]': 'scrolling() ? `true` : null',\r\n '[attr.data-glyph-area]': 'hasGlyphArea() ? null : `none`',\r\n // Hide popover until computed the initial width to prevent flickering caused by dynamic anchor positioning based on `--ɵsci-menu-width`. See `menu-opener.service.ts` for more details.\r\n '[style.visibility]': 'popoverHidden() ? `hidden` : null',\r\n '[attr.tabindex]': 'role === `menu` ? `-1` : null', // enable programmatic focus of popover\r\n '[class]': 'cssClass()',\r\n },\r\n hostDirectives: [\r\n {directive: SciAttributesDirective, inputs: ['sciAttributes: attributes']},\r\n ],\r\n})\r\nexport class SciMenuComponent {\r\n\r\n /**\r\n * Specifies the menu items to display in this menu or group.\r\n */\r\n public readonly menuItems = input.required<Array<SciMenuItem | SciMenuGroup>>();\r\n\r\n /**\r\n * Controls whether to disable menu items in this menu or group.\r\n */\r\n public readonly disabled = input<boolean>();\r\n\r\n /**\r\n * Enables and configures filtering of this menu.\r\n *\r\n * Has no effect if a menu group.\r\n */\r\n public readonly filter = input<SciMenuFilterConfig<Signal<Translatable>>>();\r\n\r\n /**\r\n * Configures features of this group.\r\n *\r\n * Has no effect if a menu or submenu\r\n */\r\n public readonly group = input<SciMenuGroupConfig>();\r\n\r\n /**\r\n * Specifies the preferred menu width.\r\n *\r\n * Has no effect if a menu group.\r\n */\r\n public readonly width = input<string>();\r\n\r\n /**\r\n * Specifies the preferred minimum menu width.\r\n *\r\n * Defaults to the `--sci-menu-min-width` or `--sci-menu-submenu-min-width` CSS variables.\r\n *\r\n * If {@link anchorWidth} is specified (e.g., for toolbar menus), the effective minimum width evaluates to `max(anchorWidth, minWidth)`.\r\n *\r\n * Has no effect if a menu group.\r\n */\r\n public readonly minWidth = input<string>();\r\n\r\n /**\r\n * Specifies the maximum menu width.\r\n *\r\n * Has no effect if a menu group.\r\n */\r\n public readonly maxWidth = input<string>();\r\n\r\n /**\r\n * Specifies the maximum menu height.\r\n *\r\n * Has no effect if a menu group.\r\n */\r\n public readonly maxHeight = input<string>();\r\n\r\n /**\r\n * Controls whether to display the glyph area.\r\n *\r\n * The glyph area is the leftmost column for displaying icons and checkmarks.\r\n */\r\n public readonly glyphArea = input<boolean>();\r\n\r\n /**\r\n * Specifies the width of the popover anchor.\r\n *\r\n * Used to compute the minimum width of the menu.\r\n */\r\n public readonly anchorWidth = input(undefined, {transform: (width: number | undefined): string | undefined => width ? `${width}px` : undefined});\r\n\r\n /**\r\n * Specifies CSS classes to associate with the menu, submenu, or group.\r\n */\r\n public readonly cssClass = input<string[]>();\r\n\r\n private readonly _menuService = inject(ɵSciMenuService);\r\n private readonly _menuFilter = inject(MenuFilter);\r\n private readonly _popoverRef = inject(PopoverRef);\r\n private readonly _filterField = viewChild(SciMenuFilterComponent);\r\n private readonly _viewport = viewChild(SciViewportComponent);\r\n\r\n protected readonly hasGlyphArea = computed(() => this.glyphArea() ?? requiresGlyphArea(this.menuItems()));\r\n protected readonly menuItemsFiltered = computed(() => this.menuItems().filter(menuItem => this.matchesFilter(menuItem)()));\r\n protected readonly popoverViewContainerRef = viewChild.required('popover_view_container_ref', {read: ViewContainerRef});\r\n protected readonly scrolling = computed(() => this._viewport()?.scrolling());\r\n protected readonly activeSubmenuItem = linkedSignal<SciMenuItemLike[], {menuItem: SciMenuItem; element: HTMLElement} | null>({\r\n source: this.menuItemsFiltered, // Unset when filtered menu items change. Otherwise, popopver may lose anchor and render left-top of the page viewport.\r\n computation: () => null,\r\n equal: (a, b) => a?.menuItem === b?.menuItem, // required to ignore clicking an already opened menu item\r\n });\r\n\r\n protected readonly role = inject(SCI_MENU_COMPONENT_ROLE);\r\n protected readonly isGroupExpanded = this.computeGroupExpanded();\r\n protected readonly popoverHidden = this.computePopoverHidden();\r\n protected readonly menuSize = this.computeMenuSize();\r\n\r\n constructor() {\r\n this.installSubmenuOpener();\r\n this.installAccelerators();\r\n this.lockInitialMenuWidth();\r\n this.closeChildPopoverOnComponentReuse();\r\n this.requestInitialFocus();\r\n this.focusFilterFieldOnKeyDown();\r\n this.stopKeyDownEventPropagation();\r\n }\r\n\r\n /**\r\n * Method invoked when clicking on a menu item.\r\n */\r\n protected async onSelect(menuItem: SciMenuItem): Promise<void> {\r\n if (await menuItem.onSelect!()) {\r\n this._popoverRef.close({closeParents: true});\r\n }\r\n }\r\n\r\n /**\r\n * Method invoked when clicking on the group header of a collapsible group.\r\n */\r\n protected onGroupHeaderButtonClick(): void {\r\n this.isGroupExpanded.update(expanded => !expanded);\r\n }\r\n\r\n /**\r\n * Method invoked when moving the pointer over a menu item.\r\n */\r\n protected onMenuItemMouseEnter(menuItem: SciMenuItem | null): void {\r\n const disabled = this.disabled() || menuItem?.disabled?.(); // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n this.activeSubmenuItem.set(null);\r\n\r\n // Close submenu of other groups.\r\n if (this._popoverRef.childPopover()?.isSubmenu) {\r\n this._popoverRef.childPopover()!.close();\r\n }\r\n }\r\n\r\n /**\r\n * Method invoked when moving the pointer over a submenu item.\r\n */\r\n protected onSubmenuItemMouseEnter(menuItem: {menuItem: SciMenuItem; element: HTMLElement}): void {\r\n this.onSubmenuItemClick(menuItem);\r\n }\r\n\r\n /**\r\n * Method invoked when clicking on a submenu item.\r\n */\r\n protected onSubmenuItemClick(menuItem: {menuItem: SciMenuItem; element: HTMLElement}): void {\r\n const disabled = this.disabled() || menuItem.menuItem.disabled?.(); // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n this.activeSubmenuItem.set(menuItem);\r\n }\r\n\r\n /**\r\n * Method invoked when setting a menu filter.\r\n */\r\n protected onFilterChange(filter: string): void {\r\n this._menuFilter.setFilterText(filter);\r\n }\r\n\r\n /**\r\n * Opens a submenu based on {@link activeSubmenuItem}.\r\n */\r\n private installSubmenuOpener(): void {\r\n effect(onCleanup => {\r\n if (!this.activeSubmenuItem()) {\r\n return;\r\n }\r\n\r\n const {menuItem, element} = this.activeSubmenuItem()!;\r\n const menu = menuItem.menu!;\r\n\r\n untracked(() => {\r\n const menuRef = this._menuService.open(menu.children, {\r\n anchor: element,\r\n viewContainerRef: this.popoverViewContainerRef(),\r\n filter: menu.filter as RequireOne<SciMenuFilterConfig> | undefined,\r\n width: menu.width,\r\n minWidth: menu.minWidth,\r\n maxWidth: menu.maxWidth,\r\n maxHeight: menu.maxHeight,\r\n cssClass: menuItem.cssClass,\r\n attributes: menuItem.attributes,\r\n submenu: true,\r\n align: 'horizontal',\r\n offset: {x: 1},\r\n });\r\n\r\n // Close when opening another submenu.\r\n onCleanup(() => menuRef.close());\r\n\r\n // Unset when closing submenu.\r\n menuRef.onClose(() => {\r\n const activeSubmenuItem = this.activeSubmenuItem();\r\n\r\n // Do not unset if another submenu was opened in the meantime.\r\n if (activeSubmenuItem?.menuItem !== menuItem) {\r\n return;\r\n }\r\n\r\n this.activeSubmenuItem.set(null);\r\n });\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Installs accelerators of menu items in this menu, recursively for menu items in submenus and groups.\r\n *\r\n * Has no effect if a submenu or menu group.\r\n */\r\n private installAccelerators(): void {\r\n if (this.role !== 'menu') {\r\n return;\r\n }\r\n\r\n const host = inject(ElementRef).nativeElement as HTMLElement;\r\n const injector = inject(Injector);\r\n\r\n effect(onCleanup => {\r\n const menuItems = this.menuItems();\r\n\r\n untracked(() => {\r\n const accelerators = ɵinstallMenuAccelerators(menuItems, {\r\n targets: host,\r\n onSelect: menuItem => void this.onSelect(menuItem),\r\n injector,\r\n });\r\n onCleanup(() => accelerators.dispose());\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Locks the initial menu width to maintain a stable width when expanding/collapsing groups or hovering menu items with a toolbar.\r\n *\r\n * Has no effect if a menu group.\r\n */\r\n private lockInitialMenuWidth(): void {\r\n if (this.role === 'group') {\r\n return;\r\n }\r\n\r\n const host = inject(ElementRef).nativeElement as HTMLElement;\r\n\r\n // Wait until menu items are available, maximal until idle; may initially be empty due to asynchronous menu contributions.\r\n toObservable(this.menuItems)\r\n .pipe(\r\n filter(menuItems => !!menuItems.length),\r\n observeOn(animationFrameScheduler), // Wait until next render cycle to capture menu width.\r\n raceWith(new Promise(resolve => { // Fallback if no menu items are contributed.\r\n if (typeof requestIdleCallback === 'function') {\r\n requestIdleCallback(resolve, {timeout: 250});\r\n }\r\n else {\r\n setTimeout(resolve, 250); // Fallback if browser does not support `requestIdleCallback`, e.g., Safari\r\n }\r\n })),\r\n take(1),\r\n takeUntilDestroyed(),\r\n )\r\n .subscribe(() => {\r\n this.menuSize.update(size => ({...size, width: `${host.getBoundingClientRect().width}px`}));\r\n });\r\n }\r\n\r\n /**\r\n * Closes a child popover (submenu or action menu) when this component is reused.\r\n */\r\n private closeChildPopoverOnComponentReuse(): void {\r\n effect(() => {\r\n // Track menu items.\r\n this.menuItems();\r\n\r\n // Close child popover, if any.\r\n untracked(() => this._popoverRef.childPopover()?.close());\r\n });\r\n }\r\n\r\n /**\r\n * Focuses the popover or filter field based on {@link filter.focus} option.\r\n *\r\n * The popover must receive focus to enable light dismiss (closing via Escape or clicking outside it) when opened from microfrontends.\r\n */\r\n private requestInitialFocus(): void {\r\n const host = inject(ElementRef).nativeElement as HTMLElement;\r\n\r\n const effectRef = afterRenderEffect(() => {\r\n if (this.popoverHidden()) {\r\n return; // cannot be focused until visible\r\n }\r\n\r\n untracked(() => {\r\n if (this.filter()?.focus) {\r\n this._filterField()?.focus();\r\n }\r\n else if (this.role === 'menu') {\r\n host.focus();\r\n }\r\n\r\n effectRef.destroy();\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Focuses the filter field when the user starts typing.\r\n *\r\n * Has no effect if filtering is not supported.\r\n */\r\n private focusFilterFieldOnKeyDown(): void {\r\n const host = inject(ElementRef).nativeElement as HTMLElement;\r\n const zone = inject(NgZone);\r\n\r\n toObservable(this._filterField)\r\n .pipe(\r\n switchMap(filterField => filterField ? fromEvent<KeyboardEvent>(host, 'keydown') : EMPTY),\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\r\n filter(event => !event.ctrlKey && !event.altKey && !event.metaKey && event.key?.trim().length === 1), // UNDOCUMENTED: `event.key` can be `undefined`, for example, when selecting an option from an input element's datalist.\r\n subscribeIn(fn => zone.runOutsideAngular(fn)),\r\n observeIn(fn => zone.run(fn)),\r\n takeUntilDestroyed(),\r\n )\r\n .subscribe(event => {\r\n this._filterField()!.focus();\r\n event.stopPropagation(); // prevent parent filter field from receiving focus.\r\n });\r\n }\r\n\r\n /**\r\n * Stops keydown event propagation to prevent side effects, such as closing an overlay on `Escape` or other keystrokes from triggering.\r\n *\r\n * Has no effect if a submenu or menu group.\r\n */\r\n private stopKeyDownEventPropagation(): void {\r\n if (this.role !== 'menu') {\r\n return;\r\n }\r\n\r\n const host = inject(ElementRef).nativeElement as HTMLElement;\r\n const zone = inject(NgZone);\r\n\r\n fromEvent<KeyboardEvent>(host, 'keydown')\r\n .pipe(\r\n subscribeIn(fn => zone.runOutsideAngular(fn)),\r\n takeUntilDestroyed(),\r\n )\r\n .subscribe(event => {\r\n event.stopPropagation();\r\n });\r\n }\r\n\r\n /**\r\n * Computes whether the popover is hidden.\r\n *\r\n * The popover must be hidden until the initial width is computed. Otherwise, dynamic anchor positioning based on `--ɵsci-menu-width` causes flickering.\r\n * See `menu-opener.service.ts` for more details.\r\n */\r\n private computePopoverHidden(): Signal<boolean> {\r\n return computed(() => this.role === 'menu' && !this.menuSize().width);\r\n }\r\n\r\n /**\r\n * Computes whether menu items are visible.\r\n */\r\n private computeGroupExpanded(): WritableSignal<boolean> {\r\n return linkedSignal(() => {\r\n const group = this.group();\r\n return !group || !group.collapsible || !group.collapsed || this._menuFilter.active();\r\n });\r\n }\r\n\r\n /**\r\n * Computes the menu size based on configured size constraints.\r\n */\r\n private computeMenuSize(): WritableSignal<MenuSize> {\r\n return linkedSignal((): MenuSize => {\r\n if (this.role === 'group') {\r\n return {};\r\n }\r\n\r\n // Compute only once; otherwise, the popover would hide since the initial width is only computed initially.\r\n return untracked(() => {\r\n const defaultMinWidth = this.role === 'submenu' ? 'var(--sci-menu-submenu-min-width)' : 'var(--sci-menu-min-width)';\r\n const preferredMinWidth = this.minWidth() ?? defaultMinWidth;\r\n return {\r\n width: this.width(),\r\n minWidth: this.anchorWidth() ? `max(${preferredMinWidth}, ${this.anchorWidth()})` : preferredMinWidth,\r\n maxWidth: this.maxWidth() ?? this.width(),\r\n maxHeight: this.maxHeight(),\r\n };\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Evaluates whether the given menu item (or any of its child menu items) match the active filter.\r\n */\r\n private matchesFilter(menuItem: SciMenuItem | SciMenuGroup): Signal<boolean> {\r\n return computed(() => {\r\n if (!this._menuFilter.active()) {\r\n return true;\r\n }\r\n switch (menuItem.type) {\r\n case 'menu-item':\r\n return menuItem.menu ? menuItem.menu.children.some(menuItem => this.matchesFilter(menuItem)()) : this._menuFilter.matches(menuItem)();\r\n case 'group':\r\n return menuItem.children.some(menuItem => this.matchesFilter(menuItem)());\r\n }\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Evaluates whether the given menu items (or any child groups) require a glyph area for displaying icons and checkmarks.\r\n */\r\nfunction requiresGlyphArea(menuItems: SciMenuItemLike[]): boolean {\r\n return menuItems.some(menuItem => {\r\n switch (menuItem.type) {\r\n case 'menu-item':\r\n return !!menuItem.iconLigature || !!menuItem.iconComponent || !!menuItem.checked;\r\n case 'group':\r\n return !!menuItem.collapsible || requiresGlyphArea(menuItem.children);\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Provides {@link SCI_MENU_COMPONENT_ROLE} for injection.\r\n *\r\n * Returns a host directive instead of a static provider to support component creation via {@link ViewContainerRef.createComponent}.\r\n */\r\nexport function provideMenuComponentRole(role: 'menu' | 'submenu' | 'group'): Type<unknown> {\r\n @Directive({providers: [{provide: SCI_MENU_COMPONENT_ROLE, useValue: role}]})\r\n class RoleProvider {\r\n }\r\n\r\n return RoleProvider;\r\n}\r\n\r\n/**\r\n * Provides {@link PopoverRef} for injection.\r\n */\r\nfunction providePopoverRef(): Provider {\r\n return {\r\n provide: PopoverRef,\r\n useFactory: () => {\r\n switch (inject(SCI_MENU_COMPONENT_ROLE)) {\r\n case 'menu':\r\n return new PopoverRef({isSubmenu: false}); // top-level menu or menu in action toolbar\r\n case 'submenu':\r\n return new PopoverRef({isSubmenu: true});\r\n case 'group':\r\n return inject(PopoverRef, {skipSelf: true});\r\n }\r\n },\r\n };\r\n}\r\n\r\n/**\r\n * Provides {@link MenuFilter} for injection.\r\n */\r\nfunction provideMenuFilter(): Provider {\r\n return {\r\n provide: MenuFilter,\r\n useFactory: () => {\r\n switch (inject(SCI_MENU_COMPONENT_ROLE)) {\r\n case 'menu':\r\n return new MenuFilter(null); // top-level menu or menu in action toolbar\r\n case 'submenu':\r\n return new MenuFilter(inject(MenuFilter, {skipSelf: true}));\r\n case 'group':\r\n return inject(MenuFilter, {skipSelf: true});\r\n }\r\n },\r\n };\r\n}\r\n\r\n/**\r\n * Indicates whether {@link SciMenuComponent} is acting as a menu, submenu, or group.\r\n */\r\nconst SCI_MENU_COMPONENT_ROLE = new InjectionToken<'menu' | 'submenu' | 'group'>('SCI_MENU_COMPONENT_ROLE');\r\n\r\n/**\r\n * Represents the preferred menu size.\r\n */\r\ninterface MenuSize {\r\n width?: string;\r\n minWidth?: string;\r\n maxWidth?: string;\r\n maxHeight?: string;\r\n}\r\n\r\n/**\r\n * Specifies the features of the group.\r\n */\r\nexport interface SciMenuGroupConfig {\r\n label?: string;\r\n collapsible: boolean;\r\n collapsed: boolean;\r\n hideGlyphArea: boolean;\r\n actions: SciMenuItemLike[];\r\n}\r\n","<!-- Filter Field -->\r\n@let filter = this.filter();\r\n@if (filter) {\r\n <div class=\"filter e2e-filter\">\r\n <sci-icon>scion.search</sci-icon>\r\n @let message = filter.placeholder?.() ?? '%scion.components.type_to_filter.action';\r\n <sci-menu-filter (textChange)=\"onFilterChange($event)\" [placeholder]=\"(message | sciText)()\"/>\r\n </div>\r\n <hr>\r\n}\r\n\r\n<!-- Group Header -->\r\n@if (group(); as group) {\r\n @if (group.collapsible) {\r\n <button class=\"group-header e2e-group-header\" (click)=\"onGroupHeaderButtonClick()\" (mouseenter)=\"onMenuItemMouseEnter(null)\">\r\n <sci-icon>{{isGroupExpanded() ? 'scion.chevron_down' : 'scion.chevron_right'}}</sci-icon>\r\n\r\n <div class=\"content\">\r\n <ng-container *ngTemplateOutlet=\"group_header_template\"/>\r\n </div>\r\n </button>\r\n } @else if (group.label) {\r\n <header class=\"group-header e2e-group-header\">\r\n <ng-container *ngTemplateOutlet=\"group_header_template\"/>\r\n </header>\r\n }\r\n\r\n <!-- Template for rendering group header. -->\r\n <ng-template #group_header_template>\r\n <sci-menu-group-label>{{group.label}}</sci-menu-group-label>\r\n\r\n @if (group.actions.length && !this.disabled()) {\r\n <sci-toolbar-group [menuItems]=\"group.actions\"\r\n [orientation]=\"'horizontal'\"\r\n [popoverViewContainerRef]=\"popoverViewContainerRef()\"\r\n (click)=\"$event.stopPropagation()\"\r\n class=\"actions e2e-actions\"/>\r\n }\r\n </ng-template>\r\n}\r\n\r\n<!-- Menu Items -->\r\n@if (isGroupExpanded()) {\r\n @if (maxHeight()) {\r\n <sci-viewport>\r\n <ng-container *ngTemplateOutlet=\"menu_items_template\"/>\r\n </sci-viewport>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"menu_items_template\"/>\r\n }\r\n\r\n <!-- Renders menu items. -->\r\n <ng-template #menu_items_template>\r\n @for (menuItem of menuItemsFiltered(); track $index) {\r\n @let disabled = this.disabled() || menuItem.disabled?.() || false;\r\n\r\n @switch (menuItem.type) {\r\n @case ('menu-item') {\r\n <!-- Menu Item -->\r\n @if (!menuItem.menu) {\r\n @let hasActionToolbar = !disabled && menuItem.actions?.length;\r\n @let showAcceleratorInTooltip = menuItem.accelerator && hasActionToolbar;\r\n\r\n <button [attr.disabled]=\"disabled || null\"\r\n [attr.title]=\"showAcceleratorInTooltip ? (menuItem.accelerator | sciFormatAccelerator:menuItem.tooltip?.()) : menuItem.tooltip?.()\"\r\n [class.checked]=\"menuItem.checked?.()\"\r\n [class.active]=\"menuItem.active?.()\"\r\n [class]=\"menuItem.cssClass\" class=\"menu-item e2e-menu-item\"\r\n [sciAttributes]=\"menuItem.attributes\"\r\n (mouseenter)=\"onMenuItemMouseEnter(menuItem)\"\r\n (click)=\"onSelect(menuItem)\">\r\n <!-- Render icon if glyph area. -->\r\n @if (hasGlyphArea() && !group()?.hideGlyphArea) {\r\n <ng-container *ngTemplateOutlet=\"icon_template; context: {$implicit: menuItem}\"/>\r\n }\r\n\r\n <!-- Render label, accelerator and action toolbar. -->\r\n <div class=\"content\">\r\n <ng-container *ngTemplateOutlet=\"label_template; context: {$implicit: menuItem}\"/>\r\n\r\n @if (menuItem.accelerator) {\r\n <span class=\"accelerator\">{{menuItem.accelerator | sciFormatAccelerator}}</span>\r\n }\r\n\r\n @if (hasActionToolbar) {\r\n <sci-toolbar-group [menuItems]=\"menuItem.actions!\"\r\n [orientation]=\"'horizontal'\"\r\n [popoverViewContainerRef]=\"popoverViewContainerRef()\"\r\n [class.menu-open]=\"actions_toolbar.menuOpen()\"\r\n class=\"actions e2e-actions\"\r\n (click)=\"$event.stopPropagation()\"\r\n #actions_toolbar/>\r\n }\r\n </div>\r\n </button>\r\n }\r\n\r\n <!-- Submenu Item -->\r\n @if (menuItem.menu) {\r\n <button [attr.disabled]=\"disabled || null\"\r\n [attr.title]=\"menuItem.tooltip?.()\"\r\n [class.open]=\"activeSubmenuItem()?.menuItem === menuItem\"\r\n [class]=\"menuItem.cssClass\" class=\"menu e2e-menu-item\"\r\n [sciAttributes]=\"menuItem.attributes\"\r\n (mouseenter)=\"onSubmenuItemMouseEnter({menuItem, element})\"\r\n (click)=\"onSubmenuItemClick({menuItem, element})\"\r\n #element>\r\n @if (hasGlyphArea() && !group()?.hideGlyphArea) {\r\n <!-- Render icon if glyph area. -->\r\n <ng-container *ngTemplateOutlet=\"icon_template; context: {$implicit: menuItem}\"/>\r\n }\r\n\r\n <!-- Render label. -->\r\n <div class=\"content\">\r\n <ng-container *ngTemplateOutlet=\"label_template; context: {$implicit: menuItem}\"/>\r\n <sci-icon class=\"chevron\">scion.chevron_right</sci-icon>\r\n </div>\r\n </button>\r\n }\r\n }\r\n @case ('group') {\r\n <sci-menu-group [group]=\"menuItem\"\r\n [glyphArea]=\"hasGlyphArea()\"\r\n [disabled]=\"disabled\"\r\n [cssClass]=\"menuItem.cssClass ?? []\"/>\r\n }\r\n }\r\n } @empty {\r\n <!-- TODO [Angular 23] Replace with optional chaining operator once the Angular compiler no longer logs the NG8107 false-positive warning. -->\r\n <!-- @let message = filter?.notFoundMessage?.() ?? '%scion.components.no_items.message'; -->\r\n @let message = (filter && filter.notFoundMessage?.()) ?? '%scion.components.no_items.message';\r\n <div class=\"message no-items e2e-no-items\">{{(message | sciText)()}}</div>\r\n }\r\n </ng-template>\r\n}\r\n\r\n<!-- Location where to insert the menu popover. Must not be a child of the menu item button to prevent hovering the menu item when hovering menu items in the popover. -->\r\n<ng-container #popover_view_container_ref/>\r\n\r\n<!-- Renders the icon of the passed menu item. -->\r\n<ng-template #icon_template let-menuItem>\r\n @if (menuItem.checked !== undefined) {\r\n <sci-icon>{{menuItem.checked() ? 'scion.checkmark' : undefined}}</sci-icon>\r\n } @else if (menuItem.iconLigature) {\r\n <sci-icon>{{menuItem.iconLigature()}}</sci-icon>\r\n } @else if (menuItem.iconComponent) {\r\n <sci-menu-item-icon>\r\n <ng-container *sciComponentOutlet=\"menuItem.iconComponent\"/>\r\n </sci-menu-item-icon>\r\n } @else {\r\n <sci-menu-item-icon/>\r\n }\r\n</ng-template>\r\n\r\n<!-- Renders the label of the passed menu item. -->\r\n<ng-template #label_template let-menuItem>\r\n @if (menuItem.labelText) {\r\n <sci-menu-item-label>\r\n {{menuItem.labelText()}}\r\n </sci-menu-item-label>\r\n } @else if (menuItem.labelComponent) {\r\n <sci-menu-item-label>\r\n <ng-container *sciComponentOutlet=\"menuItem.labelComponent\"/>\r\n </sci-menu-item-label>\r\n }\r\n</ng-template>\r\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ApplicationRef, Binding, ComponentRef, createComponent, DestroyRef, DOCUMENT, ElementRef, EnvironmentInjector, inject, Injectable, Injector, inputBinding, runInInjectionContext, signal, Signal, ViewContainerRef} from '@angular/core';\nimport {SciMenuItemLike} from './menu.model';\nimport {SciMenuOptions, SciMenuOrigin, SciMenuRef} from './menu.service';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {provideMenuComponentRole, SciMenuComponent} from './menu/menu.component';\nimport {dimension} from '@scion/components/dimension';\nimport {UUID} from '@scion/toolkit/uuid';\nimport {coerceSignal, createDestroyableInjector} from '@scion/components/common';\nimport {ɵSciMenuService} from './ɵmenu.service';\nimport {Arrays} from '@scion/toolkit/util';\nimport {Translatable} from '@scion/components/text';\nimport {SciMenuFilterConfig} from './menu/menu.factory';\n\n@Injectable({providedIn: 'root'})\nexport class SciMenuOpener {\n\n private readonly _injector = inject(Injector);\n\n /**\n * Opens the specified menu at the specified position.\n */\n public openMenu(menu: `menu:${string}` | SciMenuItemLike[], options: SciMenuOptions): SciMenuRef {\n const injector = createDestroyableInjector({parent: this._injector});\n const menuItems = Array.isArray(menu) ? signal(menu) : this.menuService.menuItems(menu, options.context ?? new Map(), {injector, metadata: options.metadata});\n\n return runInInjectionContext(injector, () => {\n // Get or create anchor at specified origin.\n const anchorElement = options.anchor instanceof ElementRef || options.anchor instanceof HTMLElement ? coerceElement(options.anchor) : this.createVirtualAnchor(options.anchor, {viewContainerRef: options.viewContainerRef});\n\n // Create menu popover.\n const componentRef = this.createMenuPopover(menuItems, anchorElement, options);\n componentRef.onDestroy(() => injector.destroy());\n\n return {\n close: () => componentRef.destroy(),\n onClose: onClose => componentRef.hostView.destroyed ? onClose() : componentRef.onDestroy(onClose), // Call callback immediately if already destroyed.\n };\n });\n }\n\n /**\n * Creates a menu popover displaying the specified menu items.\n */\n private createMenuPopover(menuItems: Signal<SciMenuItemLike[]>, anchorElement: HTMLElement, options: SciMenuOptions): ComponentRef<SciMenuComponent> {\n const anchorSize = dimension(anchorElement);\n const align = options.align ?? 'vertical';\n\n const bindings: Binding[] = [\n inputBinding('menuItems', menuItems),\n inputBinding('filter', () => coerceFilterConfig(options.filter)),\n inputBinding('width', () => options.width),\n inputBinding('minWidth', () => options.minWidth),\n inputBinding('maxWidth', () => options.maxWidth),\n inputBinding('maxHeight', () => options.maxHeight),\n inputBinding('anchorWidth', () => align === 'vertical' ? anchorSize().offsetWidth : undefined),\n inputBinding('cssClass', () => Arrays.coerce(options.cssClass)),\n inputBinding('attributes', () => options.attributes),\n ];\n\n // Create menu component and attach it to the DOM.\n const componentRef = (() => {\n const role = options.submenu ? 'submenu' : 'menu';\n\n if (options.viewContainerRef) {\n return options.viewContainerRef.createComponent(SciMenuComponent, {\n directives: [provideMenuComponentRole(role)],\n bindings,\n });\n }\n else {\n const componentRef = createComponent(SciMenuComponent, {\n environmentInjector: inject(EnvironmentInjector),\n directives: [provideMenuComponentRole(role)],\n bindings,\n });\n\n // Insert popover after the anchor node.\n anchorElement.after(componentRef.location.nativeElement as Element);\n\n // Attach component to Angular component tree for change detection.\n inject(ApplicationRef).attachView(componentRef.hostView);\n\n return componentRef;\n }\n })();\n\n // Bind popover to anchor.\n const popoverElement = componentRef.location.nativeElement as HTMLElement;\n this.bindPopoverToAnchor({popoverElement, anchorElement, align, offset: options.offset});\n\n // Destroy component when closing the popover.\n popoverElement.addEventListener('toggle', (event: ToggleEvent): void => {\n if (event.newState === 'closed') {\n componentRef.destroy();\n }\n });\n\n // Run change detection.\n componentRef.changeDetectorRef.detectChanges();\n\n // Show popover.\n popoverElement.showPopover();\n\n return componentRef;\n }\n\n /**\n * Positions the popover relative to the anchor element.\n */\n private bindPopoverToAnchor(binding: {popoverElement: HTMLElement; anchorElement: HTMLElement; align: 'vertical' | 'horizontal'; offset?: {x?: number; y?: number}}): void {\n const {popoverElement, anchorElement, align} = binding;\n const popoverId = `scimenu-${UUID.randomUUID().substring(0, 8)}`;\n\n // Connect anchor to popover.\n setAttributes(anchorElement, {\n 'popovertarget': popoverId,\n 'popovertargetaction': 'show',\n });\n setStyles(anchorElement, {\n 'anchor-name': `--${popoverId}`,\n });\n\n // Connect popover to anchor.\n setAttributes(popoverElement, {\n 'id': popoverId,\n 'popover': 'auto',\n });\n\n // Position popover relative to anchor.\n if (align === 'horizontal') {\n setStyles(popoverElement, {\n 'position-anchor': `--${popoverId}`,\n 'position-try-fallbacks': 'flip-inline, flip-block, flip-inline flip-block',\n 'top': `calc(anchor(top) - var(--ɵsci-menu-padding-block) + ${binding.offset?.y ?? 0}px)`,\n 'left': `calc(anchor(right) + ${binding.offset?.x ?? 0}px)`,\n });\n }\n else {\n setStyles(popoverElement, {\n 'position-anchor': `--${popoverId}`,\n 'position-try-fallbacks': 'flip-block',\n 'top': `calc(anchor(bottom) + ${binding.offset?.y ?? 0}px)`,\n 'left': `min(calc(anchor(left) + ${binding.offset?.x ?? 0}px), calc(100% - var(--ɵsci-menu-width)))`, // `calc(100% - var(--ɵsci-menu-width))` prevents pushing the popover out of the page viewport on the right\n });\n }\n\n // Mark the anchor as open to support opening the menu from a toolbar button, not a toolbar menu button, e.g., to support opening a menu via accelerator.\n if (anchorElement.classList.contains('toolbar-button')) {\n anchorElement.classList.add('menu-open');\n }\n\n // Remove attributes and styles from the anchor element when the popover is closed, but only if not displaying another popover in the meantime.\n // No cleanup is required for the popover element because it is destroyed when closed.\n inject(DestroyRef).onDestroy(() => {\n if (anchorElement.getAttribute('popovertarget') !== popoverId) {\n return;\n }\n\n setAttributes(anchorElement, {\n 'popovertarget': null,\n 'popovertargetaction': null,\n });\n setStyles(anchorElement, {\n 'anchor-name': null,\n });\n if (anchorElement.classList.contains('toolbar-button')) {\n anchorElement.classList.remove('menu-open');\n }\n });\n }\n\n /**\n * Creates a DOM element at the given pointer position or coordinate, optionally with a given dimension.\n */\n private createVirtualAnchor(anchor: MouseEvent | SciMenuOrigin, options: {viewContainerRef?: ViewContainerRef}): HTMLElement {\n // Coerce coordinates.\n const {x, y, width, height} = anchor instanceof MouseEvent ? ({x: anchor.x, y: anchor.y}) : anchor;\n\n // Create virtual anchor element at anchor bounds.\n const virtualAnchorElement = inject(DOCUMENT).createElement('div');\n inject(DestroyRef).onDestroy(() => virtualAnchorElement.remove());\n\n // Position the anchor element.\n setStyles(virtualAnchorElement, {\n 'position': 'fixed',\n 'left': `${x}px`,\n 'top': `${y}px`,\n 'width': width ? `${width}px` : '0',\n 'height': height ? `${height}px` : '0',\n 'pointer-events': 'none',\n });\n\n // Attach the anchor element to the DOM.\n if (options.viewContainerRef) {\n (options.viewContainerRef.element.nativeElement as Element).after(virtualAnchorElement);\n }\n else {\n inject(DOCUMENT).body.appendChild(virtualAnchorElement);\n }\n\n return virtualAnchorElement;\n }\n\n /**\n * Provides a reference to {@link ɵSciMenuService}.\n *\n * Note:\n * - {@link ɵSciMenuService} cannot be injected during construction as this would lead to an injection cycle.\n * - Do not use {@link SciMenuRegistry} directly to proxy calls through the adapter chain.\n */\n private get menuService(): ɵSciMenuService {\n return this._injector.get(ɵSciMenuService);\n }\n}\n\n/**\n * Sets the specified attributes on the given element. Passing `null` for an attribute removes it.\n */\nfunction setAttributes(element: HTMLElement, attributes: {[name: string]: string | null}): void {\n Object.entries(attributes).forEach(([name, value]) => {\n if (value === null) {\n element.removeAttribute(name);\n }\n else {\n element.setAttribute(name, value);\n }\n });\n}\n\n/**\n * Sets the specified styles on the given element. Passing `null` for a style removes it.\n */\nfunction setStyles(element: HTMLElement, styles: {[style: string]: string | null}): void {\n Object.entries(styles).forEach(([name, value]) => {\n if (value === null) {\n element.style.removeProperty(name);\n }\n else {\n element.style.setProperty(name, value);\n }\n });\n}\n\n/**\n * Coerces passed filter into a {@link SciMenuFilterConfig}, or `undefined` if a menu without filtering.\n */\nfunction coerceFilterConfig(filter: SciMenuOptions['filter'] | undefined): SciMenuFilterConfig<Signal<Translatable>> | undefined {\n if (typeof filter === 'object') {\n return {\n placeholder: coerceSignal(filter.placeholder),\n notFoundMessage: coerceSignal(filter.notFoundMessage),\n focus: filter.focus,\n };\n }\n return filter === true ? {} : undefined;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Arrays, prune} from '@scion/toolkit/util';\nimport {constructMenu} from '../menu/ɵmenu.factory';\nimport {translate} from '../menu-translate.util';\nimport {SciMenubarFactory, SciMenubarMenuDescriptor} from './menubar.factory';\nimport {SciMenuFactory} from '../menu/menu.factory';\nimport {SciMenuItem} from '../menu.model';\nimport {coerceSignal} from '@scion/components/common';\n\n/**\n * Translation note: Texts are translated when added (not lazily when rendered) to simplify filtering.\n */\nexport class ɵSciMenubarFactory implements SciMenubarFactory {\n\n public readonly menuItems = [] as SciMenuItem[];\n\n /** @inheritDoc */\n public addMenu(descriptor: SciMenubarMenuDescriptor, menuFactoryFn: (menu: SciMenuFactory) => void): this {\n this.menuItems.push(prune({\n type: 'menu-item',\n name: descriptor.name,\n labelText: translate(descriptor.label),\n visible: coerceSignal(descriptor.visible),\n cssClass: Arrays.coerce(descriptor.cssClass),\n attributes: descriptor.attributes,\n menu: constructMenu(menuFactoryFn, descriptor.menu),\n }));\n\n return this;\n }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ApplicationRef, assertNotInReactiveContext, computed, DestroyableInjector, DestroyRef, inject, Injectable, Injector, Provider, runInInjectionContext, signal, Signal, untracked, WritableSignal} from '@angular/core';\nimport {SciMenuRegistry} from './menu.registry';\nimport {Disposable} from '@scion/toolkit/types';\nimport {SciMenuGroup, SciMenuItem, SciMenuItemLike} from './menu.model';\nimport {SciMenuOptions, SciMenuRef} from './menu.service';\nimport {Arrays, Maps, Objects, prune} from '@scion/toolkit/util';\nimport {ɵSciMenuFactory} from './menu/ɵmenu.factory';\nimport {ɵSciToolbarFactory} from './toolbar/ɵtoolbar.factory';\nimport {sortMenuItems} from './menu-item-sorter';\nimport {SciMenubarFactoryFn, SciMenuContribution, SciMenuContributionLocationLike, SciMenuContributionOptions, SciMenuContributionPositionLike, SciMenuFactoryFn, SciMenuFactoryFnLike, SciToolbarFactoryFn} from './menu-contribution.model';\nimport {assertInInjectionContext, createDestroyableInjector} from '@scion/components/common';\nimport {SciMenuAdapter} from './menu-adapter.model';\nimport {SciMenuContributionInstantProvider} from './menu-contribution-instant.provider';\nimport {ɵSciMenuService} from './ɵmenu.service';\nimport {SciMenuOpener} from './menu-opener.service';\nimport {ɵSciMenubarFactory} from './menubar/ɵmenubar.factory';\nimport {collectMenuItemsWithAccelerator, SciKeyboardAccelerator} from './menu-accelerators';\nimport {POPOVER_REFS} from './menu/popover-ref';\nimport {injectMenuInjectionContextProviders} from './menu-environment/menu-environment-providers';\n\n@Injectable({providedIn: 'root'})\nexport class ɵSciMenuRegistry implements SciMenuRegistry, SciMenuAdapter {\n\n private readonly _contributions = new Map<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`, WritableSignal<SciMenuContribution[]>>();\n private readonly _menuItemsCache = new MenuItemsCache();\n private readonly _contributionInstantProvider = inject(SciMenuContributionInstantProvider);\n private readonly _menuOpener = inject(SciMenuOpener);\n private readonly _menuPopovers = inject(POPOVER_REFS);\n private readonly _injector = inject(Injector);\n\n /** @inheritDoc */\n public contributeMenu(locationLike: SciMenuContributionLocationLike, factoryFn: SciMenuFactoryFnLike, options: SciMenuContributionOptions): Disposable {\n const {location, before, after, position} = locationLike;\n\n const contribution: SciMenuContribution = {\n type: parseMenuLocationType(location),\n factoryFn: factoryFn,\n position: prune({before, after, position} as SciMenuContributionPositionLike, {pruneIfEmpty: true}),\n requiredContext: prune(options.requiredContext) ?? new Map<string, unknown>(), // prune cleared context values\n contributionInstant: options.contributionInstant ?? this._contributionInstantProvider.next(),\n metadata: options.metadata ?? {},\n };\n\n if (this._contributions.has(location)) {\n this._contributions.get(location)!.update(contributions => contributions.concat(contribution));\n }\n else {\n this._contributions.set(location, signal([contribution]));\n }\n\n return {\n dispose: () => {\n // Retain the signal in the contribution map even if empty. Consumers may hold a reference and expect updates\n // when a new contribution is registered for this location.\n this._contributions.get(location)!.update(contributions => contributions.filter(it => it !== contribution));\n this._menuItemsCache.remove(contribution);\n },\n };\n }\n\n /** @inheritDoc */\n public menuContributions(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuContribution[]> {\n assertNotInReactiveContext(this.menuContributions, 'Call menuContributions() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n return computed(() => {\n // Ensure signal is registered in the contribution map to get notified when a contribution is added to this location.\n if (!this._contributions.has(location())) {\n this._contributions.set(location(), signal([]));\n }\n const contributions = this._contributions.get(location())!();\n const callingContext = prune(context()); // prune cleared context values\n\n return untracked(() => contributions\n // Filter contributions not matching the calling context.\n .filter(contribution => {\n const requiredContext = contribution.requiredContext;\n for (const [requiredContextName, requiredContextValue] of requiredContext.entries()) {\n // Do not match contribution if required entry is missing.\n if (requiredContextValue === '*' && !callingContext.has(requiredContextName)) {\n return false;\n }\n\n // Do not match contribution if required value is different.\n if (requiredContextValue !== '*' && !Objects.isEqual(callingContext.get(requiredContextName), requiredContextValue, {ignoreArrayOrder: true})) {\n return false;\n }\n }\n return true;\n })\n // Sort by contribution instant to maintain a stable order when contributions are replaced.\n .sort((a, b) => a.contributionInstant - b.contributionInstant),\n );\n }, {equal: (a, b) => Objects.isEqual(a, b)});\n }\n\n /** @inheritDoc */\n public menuItems(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuItemLike[]> {\n assertNotInReactiveContext(this.menuItems, 'Call menuItems() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n if (!options.injector) {\n assertInInjectionContext(this.menuItems, 'Call menuItems() in an injection context. It may allocate resources that are not released until the injection context is destroyed.');\n }\n\n const callingContextInjector = options.injector ?? inject(Injector);\n const menuService = this.menuService;\n const menuItemsCache = this._menuItemsCache;\n\n // Get contributions matching the location.\n const menuContributions = menuService.menuContributions(location, context, options); // Do not invoke method directly to go through the adapter chain.\n\n // Get menu items of contributions.\n return computed(() => {\n if (!menuContributions().length) {\n return [];\n }\n const callingContext = prune(context()); // prune cleared context values\n const menuItems = menuContributions()\n // Instantiate contribution, recursively (submenus and menus in action toolbars).\n .flatMap(menuContribution => untracked(() => computeMenuItems(menuContribution, callingContext))())\n // Remove invisible menu items, recursively.\n .flatMap(filterInvisibleMenuItems)\n // Federate menu items, recursively.\n .map(menuItem => federateMenuItems(menuItem, callingContext, {metadata: options.metadata}))\n // Remove empty groups and submenus, recursively. Filtering must be after federation to not remove named placeholder groups or submenus.\n .flatMap(filterEmptyMenuItems);\n\n return sortMenuItems(menuItems);\n });\n\n /**\n * Gets the menu items of the given contribution used in the given context.\n */\n function computeMenuItems(menuContribution: SciMenuContribution, context: Map<string, unknown>): Signal<SciMenuItemLike[]> {\n assertNotInReactiveContext(computeMenuItems, 'Call computeMenuItems() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n // Instantiate the contribution if absent, recursively (submenus and menus in action toolbars).\n return menuItemsCache.computeIfAbsent(menuContribution, context, () => {\n // Note: Function invoked in root injection context, which is destroyed when the last consumer (location) is disposed.\n\n // Inject dependency injection providers for the given menu context.\n const menuEnvironmentInjectionContextProviders = injectMenuInjectionContextProviders(context, {injector: callingContextInjector});\n const menuEnvironmentInjectionContext = createDestroyableInjector({parent: inject(Injector), providers: menuEnvironmentInjectionContextProviders});\n\n return computed(() => {\n const menuItems = (() => {\n switch (menuContribution.type) {\n case 'menu': {\n const menuFactory = new ɵSciMenuFactory();\n const menuFactoryFn = menuContribution.factoryFn as SciMenuFactoryFn;\n runInInjectionContext(menuEnvironmentInjectionContext, () => menuFactoryFn(menuFactory, context));\n return menuFactory.menuItems;\n }\n case 'toolbar': {\n const toolbarFactory = new ɵSciToolbarFactory();\n const toolbarFactoryFn = menuContribution.factoryFn as SciToolbarFactoryFn;\n runInInjectionContext(menuEnvironmentInjectionContext, () => toolbarFactoryFn(toolbarFactory, context));\n return toolbarFactory.menuItems;\n }\n case 'menubar': {\n const menubarFactory = new ɵSciMenubarFactory();\n const menubarFactoryFn = menuContribution.factoryFn as SciMenubarFactoryFn;\n runInInjectionContext(menuEnvironmentInjectionContext, () => menubarFactoryFn(menubarFactory, context));\n return menubarFactory.menuItems;\n }\n }\n })();\n return menuItems\n // Add contribution's position to top-level menu items.\n .map(menuItem => ({...menuItem, position: menuContribution.position}))\n // Add providers to components (label, icon, control), recursively.\n .map(menuItem => provideProviders(menuItem, menuEnvironmentInjectionContextProviders));\n });\n }, {injector: callingContextInjector});\n }\n\n /**\n * Federates passed menu or group with contributions based on its name. Federation is recursive.\n */\n function federateMenuItems(menuItem: SciMenuItemLike, context: Map<string, unknown>, options?: {metadata?: {[key: string]: unknown}}): SciMenuItemLike {\n const federatedItem = {...menuItem};\n\n // Federate actions.\n if (federatedItem.actions?.length) {\n federatedItem.actions = sortMenuItems(federatedItem.actions.map(action => federateMenuItems(action, context, options)));\n }\n\n // Federate group.\n if (federatedItem.type === 'group') {\n const contributions = federatedItem.name ? untracked(() => menuService.menuItems(federatedItem.name!, context, {injector: callingContextInjector, metadata: options?.metadata}))() : [];\n\n federatedItem.children = sortMenuItems([\n ...federatedItem.children.map(child => federateMenuItems(child, context, options)),\n ...contributions,\n ]);\n }\n\n // Federate submenu.\n if (federatedItem.type === 'menu-item' && federatedItem.menu) {\n const contributions = federatedItem.menu.name ? untracked(() => menuService.menuItems(federatedItem.menu!.name!, context, {injector: callingContextInjector, metadata: options?.metadata}))() : [];\n\n federatedItem.menu = {\n ...federatedItem.menu,\n children: sortMenuItems([\n ...federatedItem.menu.children.map(child => federateMenuItems(child, context, options)),\n ...contributions,\n ]),\n };\n }\n\n return federatedItem;\n }\n\n /**\n * Registers given providers in components (label, icon, control) of the menu item, recursively.\n */\n function provideProviders(menuItem: SciMenuItemLike, providers: Provider[]): SciMenuItemLike {\n switch (menuItem.type) {\n case 'menu-item': {\n return {\n ...menuItem,\n iconComponent: menuItem.iconComponent && {\n ...menuItem.iconComponent,\n providers: providers.concat(menuItem.iconComponent.providers ?? []),\n },\n labelComponent: menuItem.labelComponent && {\n ...menuItem.labelComponent,\n providers: providers.concat(menuItem.labelComponent.providers ?? []),\n },\n control: menuItem.control && {\n ...menuItem.control,\n providers: providers.concat(menuItem.control.providers ?? []),\n },\n actions: menuItem.actions?.map(menuItem => provideProviders(menuItem, providers)),\n menu: menuItem.menu && {\n ...menuItem.menu,\n children: menuItem.menu.children.map(menuItem => provideProviders(menuItem, providers)),\n },\n } satisfies SciMenuItem;\n }\n case 'group': {\n return {\n ...menuItem,\n children: menuItem.children.map(menuItem => provideProviders(menuItem, providers)),\n actions: menuItem.actions?.map(menuItem => provideProviders(menuItem, providers)),\n } satisfies SciMenuGroup;\n }\n }\n }\n }\n\n /** @inheritDoc */\n public openMenu(menu: `menu:${string}` | SciMenuItemLike[], options: SciMenuOptions): SciMenuRef {\n return this._menuOpener.openMenu(menu, options);\n }\n\n /** @inheritDoc */\n public closeMenus(): void {\n this._menuPopovers().forEach(popover => popover.close());\n }\n\n /** @inheritDoc */\n public accelerators(context: Signal<Map<string, unknown>>): Signal<SciKeyboardAccelerator[]> {\n return this._menuItemsCache.accelerators(context);\n }\n\n /**\n * Reference to the menu service.\n *\n * Use to call methods like {@link ɵSciMenuService.menuContributions} or {@link ɵSciMenuService.menuItems} through the adapter chain.\n */\n private get menuService(): ɵSciMenuService {\n return this._injector.get(ɵSciMenuService);\n }\n}\n\n/**\n * Recursively removes groups and submenus that contain no menu items.\n *\n * Returns a single-entry array containing the filtered menu item, or an empty array if it has no children, enabling usage in `flatMap`.\n */\nfunction filterEmptyMenuItems(menuItem: SciMenuItemLike): [SciMenuItemLike] | [] {\n switch (menuItem.type) {\n case 'menu-item': {\n const children = menuItem.menu?.children.flatMap(filterEmptyMenuItems) ?? [];\n const actions = menuItem.actions?.flatMap(filterEmptyMenuItems);\n return children.length || menuItem.onSelect || menuItem.control ? [{...menuItem, actions, menu: menuItem.menu && {...menuItem.menu, children}}] : [];\n }\n case 'group': {\n const children = menuItem.children.flatMap(filterEmptyMenuItems);\n const actions = menuItem.actions?.flatMap(filterEmptyMenuItems);\n return children.length ? [{...menuItem, actions, children}] : [];\n }\n }\n}\n\n/**\n * Recursively removes invisible groups and submenus.\n *\n * Returns a single-entry array containing the filtered menu item, or an empty array if not visible, enabling usage in `flatMap`.\n */\nfunction filterInvisibleMenuItems(menuItem: SciMenuItemLike): [SciMenuItemLike] | [] {\n if (!(menuItem.visible?.() ?? true)) {\n return [];\n }\n\n switch (menuItem.type) {\n case 'menu-item': {\n const children = menuItem.menu?.children.flatMap(filterInvisibleMenuItems) ?? [];\n const actions = menuItem.actions?.flatMap(filterInvisibleMenuItems);\n return [{...menuItem, actions, menu: menuItem.menu && {...menuItem.menu, children}}];\n }\n case 'group': {\n const actions = menuItem.actions?.flatMap(filterInvisibleMenuItems);\n const children = menuItem.children.flatMap(filterInvisibleMenuItems);\n return [{...menuItem, actions, children}];\n }\n }\n}\n\n/**\n * Parses the type of given location. One of `menu`, `toolbar`,`menubar`.\n */\nfunction parseMenuLocationType(location: `menu:${string}` | `toolbar:${string}` | `menubar:${string}`): 'menu' | 'toolbar' | 'menubar' {\n return /^(?<type>(menu|toolbar|menubar)):(?<name>.+)$/.exec(location)!.groups!['type'] as 'menu' | 'toolbar' | 'menubar';\n}\n\n/**\n * Cache for instantiated contributions in a specific context.\n */\nclass MenuItemsCache {\n\n private readonly _cache = signal(new Set<CacheEntry>());\n private readonly _cacheByContribution = computed(() => {\n return Array.from(this._cache()).reduce((map, cacheEntry) => Maps.addListValue(map, cacheEntry.contribution, cacheEntry), new Map<SciMenuContribution, CacheEntry[]>());\n });\n\n /**\n * Gets the menu items of the given contribution used in the given context. Menu items are constructed via the passed factory function if absent (on cache miss).\n *\n * Menu items are cached. Cached menu items are evicted when no longer used, tracked via a reference count based on the provided injector;\n * once all tracked injectors for a cache entry are destroyed, the cache entry is evicted.\n *\n * The factory function is invoked in the root injection context. The injection context is destroyed when the last consumer (location) is disposed.\n */\n public computeIfAbsent(contribution: SciMenuContribution, context: Map<string, unknown>, computeFn: () => Signal<SciMenuItemLike[]>, options: {injector: Injector}): Signal<SciMenuItemLike[]> {\n assertNotInReactiveContext(this.computeIfAbsent, 'Call computeIfAbsent() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n const cacheEntry = this._cacheByContribution().get(contribution)?.find(cacheEntry => Objects.isEqual(cacheEntry.context, context)) ?? (() => {\n const rootInjector = options.injector.get(ApplicationRef).injector;\n const cacheEntryInjector = createDestroyableInjector({parent: rootInjector});\n const cacheEntry: CacheEntry = {\n injector: cacheEntryInjector,\n contribution,\n menuItems: runInInjectionContext(cacheEntryInjector, computeFn),\n context,\n refCount: 0,\n dispose: () => cacheEntryInjector.destroy(),\n };\n this._cache.update(cache => new Set(cache).add(cacheEntry));\n return cacheEntry;\n })();\n\n cacheEntry.refCount++;\n\n // Decrement reference count when tracked injector is destroyed.\n options.injector.get(DestroyRef).onDestroy(() => {\n if (--cacheEntry.refCount === 0) {\n // Dispose when no longer used.\n cacheEntry.dispose();\n this._cache.update(cache => {\n const cacheCopy = new Set(cache);\n cacheCopy.delete(cacheEntry);\n return cacheCopy;\n });\n }\n });\n\n return cacheEntry.menuItems;\n }\n\n /**\n * Removes menu items of the given contribution from the cache.\n */\n public remove(contribution: SciMenuContribution): void {\n assertNotInReactiveContext(this.remove, 'Call remove() in a non-reactive (non-tracking) context, such as within the untracked() function.');\n\n const cacheEntriesToRemove = this._cacheByContribution().get(contribution) ?? [];\n this._cache.update(cache => {\n const cacheCopy = new Set(cache);\n\n cacheEntriesToRemove.forEach(cacheEntry => {\n cacheEntry.dispose();\n cacheCopy.delete(cacheEntry);\n });\n\n return cacheCopy;\n });\n }\n\n /**\n * Gets installed keyboard accelerators for menu items that match the given context.\n *\n * A match does not require an identical context. All common context keys must have identical context values.\n */\n public accelerators(context: Signal<Map<string, unknown>>): Signal<SciKeyboardAccelerator[]> {\n return computed(() => {\n const accelerators = Array.from(this._cache().values())\n .filter(cacheEntry => {\n for (const [name, value] of prune(context().entries())) { // prune cleared context values\n // Do not match contribution if required entry is missing.\n if (value === '*' && !cacheEntry.context.has(name)) {\n return false;\n }\n\n // Do not match if context key maps to a different value.\n if (value !== '*' && cacheEntry.context.has(name) && !Objects.isEqual(cacheEntry.context.get(name), value, {ignoreArrayOrder: true})) {\n return false;\n }\n }\n return true;\n })\n .flatMap(cacheEntry => collectMenuItemsWithAccelerator(cacheEntry.menuItems()))\n .filter(menuItem => !menuItem.disabled?.() && (menuItem.visible?.() ?? true))\n .map(menuItem => menuItem.accelerator!);\n\n // Remove duplicate accelerators.\n return Arrays.distinct(accelerators, accelerator => `${accelerator.shift}/${accelerator.ctrl}/${accelerator.alt}/${accelerator.key.toLowerCase()}/${accelerator.location}`);\n }, {equal: (a, b) => Objects.isEqual(a, b, {ignoreArrayOrder: true})});\n }\n}\n\n/**\n * Cache entry for the menu items of a contribution currently used in the application.\n */\nexport interface CacheEntry {\n /**\n * Reference to the contribution.\n */\n contribution: SciMenuContribution;\n /**\n * Context in which the contribution is used.\n */\n context: Map<string, unknown>;\n /**\n * Injector that was used to instantiate the contribution; destroyed when the cache entry is evicted.\n */\n injector: DestroyableInjector;\n /**\n * Menu items of the contribution.\n */\n menuItems: Signal<SciMenuItemLike[]>;\n /**\n * Reference count of consumers using this cache entry.\n */\n refCount: number;\n /**\n * Disposes this entry, destroying the {@link injector} to release allocated resources.\n */\n dispose: () => void;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Disposable} from '@scion/toolkit/types';\nimport {SciMenuContribution, SciMenuContributionLocationLike, SciMenuContributionOptions, SciMenuFactoryFnLike} from './menu-contribution.model';\nimport {SciMenuItemLike} from './menu.model';\nimport {SciMenuOptions, SciMenuRef} from './menu.service';\nimport {ɵSciMenuRegistry} from './ɵmenu.registry';\nimport {Injectable, Injector, Signal} from '@angular/core';\nimport {SciKeyboardAccelerator} from './menu-accelerators';\n\n// TODO [menu] documentation\n@Injectable({providedIn: 'root', useExisting: ɵSciMenuRegistry})\nexport abstract class SciMenuRegistry {\n\n public abstract contributeMenu(locationLike: SciMenuContributionLocationLike, factoryFn: SciMenuFactoryFnLike, options: SciMenuContributionOptions): Disposable;\n\n public abstract menuContributions(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuContribution[]>;\n\n public abstract menuItems(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuItemLike[]>;\n\n public abstract openMenu(menu: `menu:${string}` | SciMenuItemLike[], options: SciMenuOptions): SciMenuRef;\n\n public abstract closeMenus(): void;\n\n /**\n * Gets installed keyboard accelerators for menu items that match the given context.\n *\n * A match does not require an identical context. All common context keys must have identical context values.\n */\n public abstract accelerators(context: Signal<Map<string, unknown>>): Signal<SciKeyboardAccelerator[]>;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Injectable, Injector, Signal} from '@angular/core';\nimport {SciMenuOptions, SciMenuRef} from './menu.service';\nimport {Disposable} from '@scion/toolkit/types';\nimport {SciMenuItemLike} from './menu.model';\nimport {SciMenuContribution, SciMenuContributionLocationLike, SciMenuContributionOptions, SciMenuFactoryFnLike} from './menu-contribution.model';\nimport {SciKeyboardAccelerator} from './menu-accelerators';\n\n/**\n * Enables integrators to intercept the registration and retrieval of menu contributions and to control where menu popovers open.\n *\n * Adapters can handle or augment calls. Multiple adapters form a chain and are called one by one in registration order.\n *\n * Calling 'next' passes the call to the next adapter, or to the registry if it is the last adapter in the chain.\n *\n * TODO [menu] documentation\n *\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\n */\n@Injectable()\nexport abstract class SciMenuAdapter {\n\n public abstract contributeMenu?(location: SciMenuContributionLocationLike, factoryFn: SciMenuFactoryFnLike, options: SciMenuContributionOptions, next: SciMenuAdapterChain): Disposable;\n\n public abstract menuContributions?(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}, next: SciMenuAdapterChain): Signal<SciMenuContribution[]>;\n\n public abstract menuItems?(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}, next: SciMenuAdapterChain): Signal<SciMenuItemLike[]>;\n\n public abstract openMenu?(menu: `menu:${string}` | SciMenuItemLike[], options: SciMenuOptions, next: SciMenuAdapterChain): SciMenuRef;\n\n public abstract closeMenus?(next: SciMenuAdapterChain): void;\n\n public abstract accelerators?(context: Signal<Map<string, unknown>>, next: SciMenuAdapterChain): Signal<SciKeyboardAccelerator[]>;\n}\n\n/**\n * Represents the next adapter in the adapter chain.\n */\nexport interface SciMenuAdapterChain {\n\n contributeMenu(location: SciMenuContributionLocationLike, factoryFn: SciMenuFactoryFnLike, options: SciMenuContributionOptions): Disposable;\n\n menuContributions(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuContribution[]>;\n\n menuItems(location: Signal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: Signal<Map<string, unknown>>, options: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuItemLike[]>;\n\n openMenu(menu: `menu:${string}` | SciMenuItemLike[], options: SciMenuOptions): SciMenuRef;\n\n closeMenus(): void;\n\n accelerators(context: Signal<Map<string, unknown>>): Signal<SciKeyboardAccelerator[]>;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {SciMenuOptions, SciMenuRef, SciMenuService} from './menu.service';\nimport {computed, inject, Injectable, Injector, Signal} from '@angular/core';\nimport {SciMenuItemLike} from './menu.model';\nimport {Disposable} from '@scion/toolkit/types';\nimport {SciMenuContribution, SciMenuContributionLocationLike, SciMenuContributionOptions, SciMenuFactoryFnLike} from './menu-contribution.model';\nimport {coerceSignal, MaybeSignal} from '@scion/components/common';\nimport {SciMenuRegistry} from './menu.registry';\nimport {SciMenuAdapter, SciMenuAdapterChain} from './menu-adapter.model';\nimport {SciKeyboardAccelerator} from './menu-accelerators';\nimport {injectMenuContext} from './menu-environment/menu-environment-providers';\n\n/**\n * // TODO [menu] documentation\n *\n * @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this service.\n */\n@Injectable({providedIn: 'root'})\nexport class ɵSciMenuService implements SciMenuService {\n\n private readonly _menuRegistry = interceptMenuRegistry(inject(SciMenuRegistry));\n private readonly _environmentContext = injectMenuContext();\n\n /** @inheritDoc */\n public open(menu: `menu:${string}` | SciMenuItemLike[], options: SciMenuOptions): SciMenuRef {\n const context = new Map([...this._environmentContext(), ...options.context ?? new Map()]);\n\n // Prevent user agent defaults when opening context menu.\n if (options.anchor instanceof MouseEvent && options.anchor.type === 'contextmenu') {\n options.anchor.preventDefault();\n options.anchor.stopPropagation();\n }\n\n return this._menuRegistry.openMenu(menu, {...options, context});\n }\n\n /** @inheritDoc */\n public closeAll(): void {\n this._menuRegistry.closeMenus();\n }\n\n /**\n * The function:\n * - Must be called within an injection context, or an explicit {@link Injector} passed.\n * - Must be called in a non-reactive (non-tracking) context.\n *\n * @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this method.\n */\n public menuItems(location: MaybeSignal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: MaybeSignal<Map<string, unknown>>, options?: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuItemLike[]> {\n return this._menuRegistry.menuItems(coerceSignal(location), coerceSignal(context), options ?? {});\n }\n\n /** @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this method. */\n public menuContributions(location: MaybeSignal<`menu:${string}` | `toolbar:${string}` | `menubar:${string}`>, context: MaybeSignal<Map<string, unknown>>, options?: {injector?: Injector; metadata?: {[key: string]: unknown}}): Signal<SciMenuContribution[]> {\n return this._menuRegistry.menuContributions(coerceSignal(location), coerceSignal(context), options ?? {});\n }\n\n /** @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this method. */\n public contributeMenu(location: SciMenuContributionLocationLike, factoryFn: SciMenuFactoryFnLike, options?: SciMenuContributionOptions): Disposable {\n return this._menuRegistry.contributeMenu(location, factoryFn, options ?? {});\n }\n\n /**\n * Gets installed keyboard accelerators for menu items that match the given context.\n *\n * A match does not require an identical context. All common context keys must have identical context values.\n *\n * Inherits the context from the current injector hierarchy, but can be overridden via `context` options. See {@link provideMenuContextProvider}.\n *\n * @docs-private Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this method.\n */\n public accelerators(options?: {context?: MaybeSignal<Map<string, unknown>>}): Signal<SciKeyboardAccelerator[]> {\n const context = computed(() => new Map([...this._environmentContext(), ...coerceSignal(options?.context)?.() ?? new Map()]));\n\n return this._menuRegistry.accelerators(context);\n }\n}\n\n/**\n * Intercepts calls to the menu registry by chaining registered menu adapters.\n *\n * Each adapter can handle the call, modify it, or pass it to the next.\n */\nfunction interceptMenuRegistry(menuRegistry: SciMenuRegistry): SciMenuRegistry {\n // TODO [Angular 22] Remove cast when Angular supports type safety for multi-injection with abstract class DI tokens. See https://github.com/angular/angular/issues/55555\n const menuAdapters = inject(SciMenuAdapter, {optional: true}) as SciMenuAdapter[] | null ?? [];\n\n return menuAdapters.reduceRight((next: SciMenuAdapterChain, adapter: SciMenuAdapter) => ({\n contributeMenu: (location, factoryFn, options) => adapter.contributeMenu ? adapter.contributeMenu(location, factoryFn, options, next) : next.contributeMenu(location, factoryFn, options),\n menuContributions: (location, context, options) => adapter.menuContributions ? adapter.menuContributions(location, context, options, next) : next.menuContributions(location, context, options),\n menuItems: (location, context, options) => adapter.menuItems ? adapter.menuItems(location, context, options, next) : next.menuItems(location, context, options),\n openMenu: (menu, options) => adapter.openMenu ? adapter.openMenu(menu, options, next) : next.openMenu(menu, options),\n closeMenus: () => adapter.closeMenus ? adapter.closeMenus(next) : next.closeMenus(),\n accelerators: context => adapter.accelerators ? adapter.accelerators(context, next) : next.accelerators(context),\n }), menuRegistry);\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ElementRef, Injectable, ViewContainerRef} from '@angular/core';\nimport {ɵSciMenuService} from './ɵmenu.service';\nimport {RequireOne} from '@scion/toolkit/types';\nimport {SciMenuFilterConfig} from './menu/menu.factory';\n\n/**\n * Opens a menu with items contributed via {@link contributeMenu}.\n *\n * A menu displays a list of related items in a popover, organized into groups and submenus.\n * It closes when a menu item is selected or on an outside click. Menu items can define a keyboard accelerator for quick access.\n *\n * ## Menu Item Size\n * The menu item size is based on the `--sci-menu-item-size` CSS variable and defaults to `16px`. It determines the icon size and is used to compute the font size and padding.\n *\n * A custom size can be defined globally using the `:root` selector:\n *\n * ```css\n * sci-menu {\n * --sci-menu-item-size: 18px;\n * }\n * ```\n *\n * Instead of computing the font size based on `--sci-menu-item-size`, an explicit font size can be defined using the `--sci-menu-font-size` CSS variable:\n *\n * ```css\n * sci-menu {\n * --sci-menu-item-size: 14px;\n * }\n * ```\n *\n * ## Custom Styling\n * The appearance of the menu can be customized using the following CSS variables:\n *\n * - `--sci-menu-font-size`: Font size of menu items.\n * - `--sci-menu-border-radius`: Border radius of a menu popover.\n * - `--sci-menu-min-width`: Minimum width of a menu popover.\n * - `--sci-menu-submenu-min-width`: Minimum width of a submenu popover.\n * - `--sci-menu-item-size`: Size of menu items; used as the menu item icon size and to compute font size and padding.\n * - `--sci-menu-item-cursor`: Cursor style when hovering over a menu item.\n * - `--sci-menu-item-text-color`: Text and icon color of menu items.\n * - `--sci-menu-item-text-color-disabled`: Text and icon color of disabled menu items.\n * - `--sci-menu-item-background-color-hover`: Background color of a menu item when hovered.\n * - `--sci-menu-item-background-color-active`: Background color of a menu item when pressed.\n * - `--sci-menu-item-border-radius`: Border radius of menu items.\n * - `--sci-menu-item-outline-width`: Outline width of menu items when focused.\n * - `--sci-menu-item-accelerator-text-color`: Text color of menu item accelerators.\n * - `--sci-menu-item-active-indicator-size`: Size of the visual indicator for active menu items.\n * - `--sci-menu-item-active-indicator-background-color`: Background color of the visual indicator for active menu items.\n * - `--sci-menu-item-active-indicator-border-radius`: Border radius of the visual indicator for active menu items.\n * - `--sci-menu-group-header-font-family`: Font family for group headers.\n * - `--sci-menu-group-header-font-size`: Font size for group headers.\n * - `--sci-menu-group-header-font-weight`: Font weight for group headers.\n * - `--sci-menu-group-header-text-color`: Text color for group headers.\n * - `--sci-menu-filter-outline-width`: Outline width of the filter field.\n * - `--sci-menu-filter-outline-radius`: Outline radius of the filter field.\n *\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\n */\n@Injectable({providedIn: 'root', useExisting: ɵSciMenuService})\nexport abstract class SciMenuService {\n\n /**\n * Opens a menu with items contributed to the specified menu.\n *\n * The menu is positioned relative to the specified anchor, vertically or horizontally. The anchor can be a coordinate, a mouse event, or a DOM element.\n *\n * ```ts\n * import {inject} from '@angular/core';\n * import {SciMenuService} from '@scion/components/menu';\n *\n * inject(SciMenuService).open('menu:contextmenu', { // <--- Sets the name of the menu\n * anchor: {x: 500, y: 600}, // <--- Sets the anchor position\n * });\n * ```\n *\n * Use the {@link contributeMenu} function to contribute to the menu by passing the menu name and a factory function.\n * The menu calls the factory function with a {@link SciMenuFactoryFn}, providing methods for populating the menu.\n *\n * ```ts\n * import {contributeMenu} from '@scion/components/menu';\n *\n * contributeMenu('menu:contextmenu', menu => menu\n * .addMenuItem({icon: 'content_copy', label: 'Copy', onSelect: () => console.log('Copy')})\n * .addMenuItem({icon: 'content_paste', label: 'Paste', onSelect: () => console.log('Paste')}),\n * );\n * ```\n *\n * Multiple contributions to the same menu can populate it from different places in the application. Passing a {@link SciMenuContributionLocation}\n * gives exact control over contribution placement within the menu. By default, menu items are added in contribution order.\n *\n * Groups and submenus can be named to allow extension from other contributions.\n *\n * ## Location in the DOM\n * By default, the menu popover is inserted after the anchor element in the DOM, or appended to the HTML body if using a coordinate anchor.\n *\n * A different location can be set via the {@link SciMenuOptions.viewContainerRef} option:\n *\n * ```ts\n * import {inject, ViewContainerRef} from '@angular/core';\n * import {SciMenuService} from '@scion/components/menu';\n *\n * inject(SciMenuService).open('menu:contextmenu', {\n * anchor: {x: 500, y: 600},\n * viewContainerRef: inject(ViewContainerRef), // <--- Sets the location in the DOM\n * });\n * ```\n *\n * ## Filterable Menu\n * Setting the {@link SciMenuOptions.filter} option displays a filter field, enabling filtering of menu items.\n *\n * ```ts\n * import {inject} from '@angular/core';\n * import {SciMenuService} from '@scion/components/menu';\n *\n * inject(SciMenuService).open('menu:contextmenu', {\n * anchor: {x: 500, y: 600},\n * filter: true, // <--- Instructs the menu to display a filter field\n * });\n * ```\n *\n * ## Menu Size\n * The menu size can be controlled via menu options. By default, a menu uses the minimum width defined by the `--sci-menu-min-width` or `--sci-menu-submenu-min-width` CSS variables.\n *\n * ```ts\n * import {inject} from '@angular/core';\n * import {SciMenuService} from '@scion/components/menu';\n *\n * inject(SciMenuService).open('menu:contextmenu', {\n * anchor: {x: 500, y: 600},\n * width: '500px', // <--- Sets a fixed menu width\n * maxHeight: '800px', // <--- Sets a maximum menu height\n * });\n * ```\n *\n * ## Context\n * A menu can have a context, a key/value map that describes its environment. Contributions can declare a minimal required context and read the menu context.\n *\n * A context can be set via the {@link SciMenuOptions.context} option:\n *\n * ```ts\n * import {SciMenuService} from '@scion/components/menu';\n * import {inject} from '@angular/core';\n *\n * inject(SciMenuService).open('menu:contextmenu', {\n * anchor: {x: 500, y: 600},\n * context: new Map().set('key', 'value'), // <--- Sets the menu context\n * });\n * ```\n *\n * ## Accelerators\n * Menu items can have an accelerator for quick access using a keyboard shortcut.\n *\n * Menu accelerators must be installed using the {@link installMenuAccelerators} function, passing the name (and context, if any) of the menu.\n *\n * ```ts\n * import {installMenuAccelerators} from '@scion/components/menu';\n *\n * installMenuAccelerators('menu:contextmenu', {\n * context: new Map().set('key', 'value'), // <--- Sets the menu context\n * });\n * ```\n *\n * By default, accelerators are installed on the {@link Document}. A different accelerator target can be defined via the {@link SciMenuAcceleratorOptions.target} option.\n *\n * ```ts\n * import {installMenuAccelerators} from '@scion/components/menu';\n * import {ElementRef, inject} from '@angular/core';\n *\n * installMenuAccelerators('menu:contextmenu', {\n * target: inject(ElementRef), // <--- Sets a different accelerator target\n * });\n * ```\n *\n * Alternatively, accelerator targets can be provided at the injector level using {@link provideMenuAcceleratorTargetProvider}, for example, at the component, route, or application level,\n * and are available to accelerators installed in the scope of this injector. Inherited targets can be overridden via {@link SciMenuAcceleratorOptions.target} option.\n *\n * @param name - Specifies the name of the menu. Used to look up menu items contributed via the {@link contributeMenu} function.\n * @param options - Controls the appearance and placement of the menu. At minimum, the menu anchor must be configured to determine where to open the menu.\n * @returns A reference to the menu, allowing to close the menu or get notified when it is closed.\n */\n public abstract open(name: `menu:${string}`, options: SciMenuOptions): SciMenuRef;\n\n /**\n * Closes currently opened menus.\n */\n public abstract closeAll(): void;\n}\n\n/**\n * Controls the appearance and placement of a menu.\n */\nexport interface SciMenuOptions {\n /**\n * Controls where to open the menu.\n *\n * Can be an HTML element or a coordinate relative to the page viewport.\n */\n anchor: HTMLElement | ElementRef<HTMLElement> | SciMenuOrigin | MouseEvent;\n /**\n * Specifies a context to describe the environment of the menu.\n *\n * Menu contributions may declare a required context. Only contributions matching this context are used.\n *\n * A context can also be provided at the injector level using {@link provideMenuContextProvider}, for example, at the component, route, or application level,\n * and is available to menus opened in the scope of this injector. The inherited context can be overridden or extended. Setting a context entry to `undefined` clears it.\n *\n * ```ts\n * import {provideMenuContextProvider} from '@scion/components/menu';\n *\n * providers: [\n * provideMenuContextProvider(() => new Map().set('key', 'value')),\n * ];\n * ```\n *\n * @see provideMenuContextProvider\n */\n context?: Map<string, unknown>;\n /**\n * Controls whether to open the menu below or to the side of the anchor.\n */\n align?: 'vertical' | 'horizontal';\n /**\n * Sets the distance (in pixels) between the menu and its anchor element along the X and Y axes.\n *\n * By default, the menu is aligned flush with the anchor.\n */\n offset?: {x?: number; y?: number};\n /**\n * Controls where to insert the menu popover into the DOM.\n *\n * By default, the menu popover is inserted after the anchor element, or appended to the HTML body if using a coordinate anchor.\n */\n viewContainerRef?: ViewContainerRef;\n /**\n * Indicates whether the menu is opened as a submenu.\n *\n * @internal\n */\n submenu?: true;\n /**\n * Specifies the preferred menu width.\n */\n width?: string;\n /**\n * Specifies the preferred minimum menu width.\n *\n * Defaults to the `--sci-menu-min-width` or `--sci-menu-submenu-min-width` CSS variables.\n *\n * If the anchor is an {@link HTMLElement}, the effective minimum width evaluates to `max(anchorWidth, minWidth)`.\n */\n minWidth?: string;\n /**\n * Specifies the maximum menu width.\n */\n maxWidth?: string;\n /**\n * Specifies the maximum menu height.\n */\n maxHeight?: string;\n /**\n * Enables users to filter menu items.\n *\n * Setting a descriptor allows customizing the filter field, such as defining a custom placeholder text or controlling whether the filter field is focused on open.\n */\n filter?: boolean | RequireOne<SciMenuFilterConfig>;\n /**\n * Specifies CSS classes to associate with the menu.\n */\n cssClass?: string | string[];\n /**\n * Specifies HTML attributes to associate with the menu.\n *\n * Data attributes should start with the `data-` prefix.\n */\n attributes?: {[name: string]: string};\n /**\n * Allows associating arbitrary metadata with the operation.\n *\n * @internal Not public API. Used by frameworks integrating the SCION Menu API. Applications should not use this property.\n */\n metadata?: {[key: string]: unknown};\n}\n\n/**\n * Coordinate relative to the top/left corner of the page viewport.\n */\nexport interface SciMenuOrigin {\n x: number;\n y: number;\n width?: number;\n height?: number;\n}\n\n/**\n * Represents a reference to a menu.\n *\n * Use to close the menu or get notified when the menu is closed.\n */\nexport interface SciMenuRef {\n /**\n * Closes the menu. Has no effect if the menu is already closed.\n */\n close(): void;\n\n /**\n * Registers a callback to be notified when the menu is closed.\n *\n * If the menu is already closed, the callback is executed immediately.\n */\n onClose: (fn: () => void) => void;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {assertNotInReactiveContext, computed, effect, inject, Injector, untracked} from '@angular/core';\nimport {Disposable} from '@scion/toolkit/types';\nimport {ɵSciMenuService} from './ɵmenu.service';\nimport {SciMenubarContributionLocation, SciMenubarFactoryFn, SciMenuContributionLocation, SciMenuContributionLocationLike, SciMenuContributionOptions, SciMenuFactoryFn, SciMenuFactoryFnLike, SciToolbarContributionLocation, SciToolbarFactoryFn} from './menu-contribution.model';\nimport {assertInInjectionContext, createDestroyableInjector} from '@scion/components/common';\nimport {SciMenuContributionInstantProvider} from './menu-contribution-instant.provider';\nimport {injectMenuContext} from './menu-environment/menu-environment-providers';\n\n/**\n * Contributes tools to a {@link SciToolbarComponent} with the given name.\n *\n * A toolbar is a horizontal or vertical container that provides quick access to context-related tools. It can contain buttons, toggles, menus, and other controls,\n * with related items grouped together.\n *\n * The toolbar calls the passed factory function with a {@link SciToolbarFactory}. The factory provides methods for populating the toolbar.\n * The factory function runs in a reactive context, running again when tracked signals change. It can call `inject` to get required dependencies.\n *\n * ```ts\n * contributeMenu('toolbar:main', (toolbar, context) => toolbar\n * .addToolbarButton({icon: 'undo', accelerator: {ctrl: true, key: 'Z'}, tooltip: 'Undo', onSelect: () => console.log('Undo')})\n * .addToolbarButton({icon: 'redo', accelerator: {ctrl: true, key: 'Y'}, tooltip: 'Redo', onSelect: () => console.log('Redo')})\n * .addGroup(group => group\n * .addToolbarButton({icon: 'content_copy', accelerator: {ctrl: true, key: 'C'}, tooltip: 'Copy', onSelect: () => console.log('Copy')})\n * .addToolbarButton({icon: 'content_paste', accelerator: {ctrl: true, key: 'V'}, tooltip: 'Paste', onSelect: () => console.log('Paste')}),\n * )\n * .addToolbarMenu({icon: 'folder', tooltip: 'File'}, menu => menu\n * .addMenuItem({icon: 'save', label: 'Save', accelerator: {ctrl: true, key: 'S'}, onSelect: () => console.log('Save')})\n * .addMenuItem({icon: 'print', label: 'Print', accelerator: {ctrl: true, key: 'P'}, onSelect: () => console.log('Print')})\n * .addMenu({icon: 'file_download', label: 'Export As...'}, menu => menu\n * .addMenuItem({icon: 'picture_as_pdf', label: 'PDF Document', onSelect: () => console.log('PDF Document')})\n * .addMenuItem({icon: 'table_view', label: 'Excel Spreadsheet', onSelect: () => console.log('Excel Spreadsheet')}),\n * ),\n * ),\n * );\n * ```\n *\n * A toolbar can have a context, a key/value map that describes its environment. The contribution can declare a minimal required context via {@link SciMenuContributionOptions.requiredContext}.\n * The toolbar context is passed as the second argument to the factory function.\n *\n * Multiple contributions to the same toolbar can populate it from different places in the application. Passing a {@link SciToolbarContributionLocation}\n * gives exact control over contribution placement within the toolbar. By default, toolbar items are added in contribution order.\n *\n * Menus and groups can be named to allow extension from other contributions.\n *\n * This function must be called within an injection context, or an explicit {@link Injector} passed. The contribution is disposed when the injection context or the passed injector is destroyed.\n *\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\n *\n * @param location - Identifies the toolbar to contribute to. Passing a {@link SciToolbarContributionLocation} gives exact control over placement.\n * @param toolbarFactoryFn - Specifies the function to contribute tools to the toolbar. The function is called in a reactive context and can call `inject` to get required dependencies.\n * @param options - Controls contribution to the toolbar, for example, the minimal required context.\n * @returns A handle that can be used to manually dispose the contribution. The contribution is disposed automatically when the calling (or passed) injection context is destroyed.\n */\nexport function contributeMenu(location: `toolbar:${string}` | SciToolbarContributionLocation, toolbarFactoryFn: SciToolbarFactoryFn, options?: SciMenuContributionOptions): Disposable;\n\n/**\n * Contributes menus to a {@link SciMenubarComponent} with the given name.\n *\n * A menubar displays a horizontal row of menus, typically placed at the top of the application.\n *\n * The menubar calls the passed factory function with a {@link SciMenubarFactory}. The factory provides methods for populating the menubar.\n * The factory function runs in a reactive context, running again when tracked signals change. It can call `inject` to get required dependencies.\n *\n * TODO [menu] Add example\n *\n * A menubar can have a context, a key/value map that describes its environment. The contribution can declare a minimal required context via {@link SciMenuContributionOptions.requiredContext}.\n * The menubar context is passed as the second argument to the factory function.\n *\n * Multiple contributions to the same menubar can populate it from different places in the application. Passing a {@link SciMenubarContributionLocation}\n * gives exact control over contribution placement within the menubar. By default, menus are added in contribution order.\n *\n * Menus and groups can be named to allow extension from other contributions.\n *\n * This function must be called within an injection context, or an explicit {@link Injector} passed. The contribution is disposed when the injection context or the passed injector is destroyed.\n *\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\n *\n * @param location - Identifies the menubar to contribute to. Passing a {@link SciMenubarContributionLocation} gives exact control over placement.\n * @param menubarFactoryFn - Specifies the function to contribute menus to the menubar. The function is called in a reactive context and can call `inject` to get required dependencies.\n * @param options - Controls contribution to the menubar, for example, the minimal required context.\n * @returns A handle that can be used to manually dispose the contribution. The contribution is disposed automatically when the calling (or passed) injection context is destroyed.\n */\nexport function contributeMenu(location: `menubar:${string}` | SciMenubarContributionLocation, menubarFactoryFn: SciMenubarFactoryFn, options?: SciMenuContributionOptions): Disposable;\n\n/**\n * Contributes menu items to a menu with the given name.\n *\n * A menu displays a list of related items in a popover, organized into groups and submenus.\n * It closes when a menu item is selected or on an outside click. Menu items can define a keyboard accelerator for quick access.\n *\n * The menu calls the passed factory function with a {@link SciMenuFactory}. The factory provides methods for populating the menu.\n * The factory function runs in a reactive context, running again when tracked signals change. It can call `inject` to get required dependencies.\n *\n * TODO [menu] Add example\n *\n * A menu can have a context, a key/value map that describes its environment. The contribution can declare a minimal required context via {@link SciMenuContributionOptions.requiredContext}.\n * The menu context is passed as the second argument to the factory function.\n *\n * Multiple contributions to the same menu can populate it from different places in the application. Passing a {@link SciMenuContributionLocation}\n * gives exact control over contribution placement within the menu. By default, menu items are added in contribution order.\n *\n * Menus and groups can be named to allow extension from other contributions.\n *\n * This function must be called within an injection context, or an explicit {@link Injector} passed. The contribution is disposed when the injection context or the passed injector is destroyed.\n *\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\n *\n * @param location - Identifies the menu to contribute to. Passing a {@link SciMenuContributionLocation} gives exact control over placement.\n * @param menuFactoryFn - Specifies the function to contribute menu items to the menu. The function is called in a reactive context and can call `inject` to get required dependencies.\n * @param options - Controls contribution to the menu, for example, the minimal required context.\n * @returns A handle that can be used to manually dispose the contribution. The contribution is disposed automatically when the calling (or passed) injection context is destroyed.\n */\nexport function contributeMenu(location: `menu:${string}` | SciMenuContributionLocation, menuFactoryFn: SciMenuFactoryFn, options?: SciMenuContributionOptions): Disposable;\n\n/** @internal */\nexport function contributeMenu(locationLike: string | SciMenuContributionLocationLike, factoryFn: SciMenuFactoryFnLike, options?: SciMenuContributionOptions): Disposable {\n assertNotInReactiveContext(contributeMenu, 'Call contributeMenu in a non-reactive (non-tracking) context, such as within the untracked() function.');\n if (!options?.injector) {\n assertInInjectionContext(contributeMenu, 'Must be called within an injection context, or an explicit `Injector` passed via options. Disposes the contribution when the injection context is destroyed.');\n }\n\n const injector = createDestroyableInjector({parent: options?.injector ?? inject(Injector)});\n const location = typeof locationLike === 'string' ? {location: locationLike} as SciMenuContributionLocationLike : locationLike;\n const menuService = injector.get(ɵSciMenuService);\n\n const environmentContext = injectMenuContext({injector});\n const contributionContext = computed(() => new Map([...environmentContext(), ...options?.requiredContext ?? new Map()]));\n\n // Each contribution is assigned an instant to maintain a stable order when the contribution context changes.\n const contributionInstant = options?.contributionInstant ?? injector.get(SciMenuContributionInstantProvider).next();\n\n effect(onCleanup => {\n const requiredContext = contributionContext();\n\n untracked(() => {\n const contributionRef = menuService.contributeMenu(location, factoryFn, {...options, requiredContext, contributionInstant});\n onCleanup(() => contributionRef.dispose());\n });\n }, {injector});\n\n return {\n dispose: () => injector.destroy(),\n };\n}\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {ApplicationRef, Component, computed, createComponent, DestroyRef, effect, ElementRef, EnvironmentInjector, inject, Injector, input, inputBinding, untracked, ViewContainerRef} from '@angular/core';\r\nimport {SciToolbarGroupComponent} from './toolbar-group.component';\r\nimport {ɵinstallMenuAccelerators, ɵSciMenuAcceleratorOptions} from '../menu-accelerators';\r\nimport {ɵSciMenuService} from '../ɵmenu.service';\r\nimport {MaybeArray} from '@scion/toolkit/types';\r\nimport {injectMenuAcceleratorTargets, injectMenuContext} from '../menu-environment/menu-environment-providers';\r\n\r\n/**\r\n * Displays items contributed via the {@link contributeMenu} function matching the toolbar's name.\r\n *\r\n * A toolbar is a horizontal or vertical container providing quick access to context-related tools.\r\n * It contains buttons, toggles, menus, and other controls, with related items grouped together.\r\n *\r\n * The toolbar must be assigned a name, used as the location when contributing to the toolbar.\r\n * The name must start with the `toolbar:` prefix.\r\n *\r\n * ```html\r\n * <sci-toolbar name=\"toolbar:main\"/>\r\n * ```\r\n *\r\n * Use the {@link contributeMenu} function to contribute to the toolbar by passing the toolbar name and a factory function.\r\n * The toolbar calls the factory function with a {@link SciToolbarFactory}, providing methods for populating the toolbar.\r\n *\r\n * ```ts\r\n * import {contributeMenu} from '@scion/components/menu';\r\n *\r\n * contributeMenu('toolbar:main', toolbar => toolbar\r\n * .addToolbarButton({icon: 'undo', accelerator: {ctrl: true, key: 'Z'}, tooltip: 'Undo', onSelect: () => console.log('Undo')})\r\n * .addToolbarButton({icon: 'redo', accelerator: {ctrl: true, key: 'Y'}, tooltip: 'Redo', onSelect: () => console.log('Redo')})\r\n * .addGroup(group => group\r\n * .addToolbarButton({icon: 'content_copy', accelerator: {ctrl: true, key: 'C'}, tooltip: 'Copy', onSelect: () => console.log('Copy')})\r\n * .addToolbarButton({icon: 'content_paste', accelerator: {ctrl: true, key: 'V'}, tooltip: 'Paste', onSelect: () => console.log('Paste')}),\r\n * )\r\n * .addToolbarMenu({icon: 'folder', tooltip: 'File'}, menu => menu\r\n * .addMenuItem({icon: 'save', label: 'Save', accelerator: {ctrl: true, key: 'S'}, onSelect: () => console.log('Save')})\r\n * .addMenuItem({icon: 'print', label: 'Print', accelerator: {ctrl: true, key: 'P'}, onSelect: () => console.log('Print')})\r\n * .addMenu({icon: 'file_download', label: 'Export As...'}, menu => menu\r\n * .addMenuItem({icon: 'picture_as_pdf', label: 'PDF Document', onSelect: () => console.log('PDF Document')})\r\n * .addMenuItem({icon: 'table_view', label: 'Excel Spreadsheet', onSelect: () => console.log('Excel Spreadsheet')}),\r\n * ),\r\n * ),\r\n * );\r\n * ```\r\n *\r\n * Multiple contributions to the same toolbar can populate it from different places in the application. Passing a {@link SciToolbarContributionLocation}\r\n * gives exact control over contribution placement within the toolbar. By default, toolbar items are added in contribution order.\r\n *\r\n * Menus and groups can be named to allow extension from other contributions.\r\n *\r\n * ## Context\r\n * A toolbar can have a context, a key/value map that describes its environment. Contributions can declare a minimal required context and read the toolbar context.\r\n *\r\n * A context can be set on the toolbar with the `context` input:\r\n *\r\n * ```html\r\n * <sci-toolbar name=\"toolbar:main\" [context]=\"...\"/>\r\n * ```\r\n *\r\n * ## Accelerator Target\r\n * Tools can have an accelerator for quick access using a keyboard shortcut. By default, the toolbar uses the {@link Document} as the accelerator target.\r\n *\r\n * The accelerator target can be changed via the `acceleratorTarget` input:\r\n *\r\n * ```html\r\n * <sci-toolbar name=\"toolbar:main\" [acceleratorTarget]=\"...\"/>\r\n * ```\r\n *\r\n * ## Toolbar Size\r\n * The toolbar size is based on the `--sci-toolbar-item-size` CSS variable and defaults to 16px. It determines the icon size and is used to compute the font size and padding.\r\n *\r\n * A custom size can be defined globally using the `:root` selector or scoped to a specific toolbar.\r\n *\r\n * ```css\r\n * sci-toolbar {\r\n * --sci-toolbar-item-size: 18px;\r\n * }\r\n * ```\r\n *\r\n * Instead of computing the font size based on `--sci-toolbar-item-size`, an explicit font size can be defined using the `--sci-toolbar-font-size` CSS variable, either globally or at the toolbar level.\r\n *\r\n * ```css\r\n * sci-toolbar {\r\n * --sci-toolbar-font-size: 14px;\r\n * }\r\n * ```\r\n *\r\n * ## Hiding an Empty Toolbar\r\n * If the toolbar has no tools, it can be hidden using the CSS `:empty` pseudo-class:\r\n *\r\n * ```css\r\n * sci-toolbar:empty {\r\n * display: none;\r\n * }\r\n * ```\r\n *\r\n * ## Custom Styling\r\n * The appearance of the toolbar can be customized using the following CSS variables, either globally in the `:root` or on the toolbar level.\r\n *\r\n * - `--sci-toolbar-font-size`: Font size of toolbar items.\r\n * - `--sci-toolbar-item-size`: Size of toolbar items; used as the toolbar item icon size and to compute font size and padding.\r\n * - `--sci-toolbar-item-cursor`: Cursor style when hovering over a toolbar item.\r\n * - `--sci-toolbar-item-text-color`: Text and icon color of toolbar items.\r\n * - `--sci-toolbar-item-text-color-disabled`: Text and icon color of disabled toolbar items.\r\n * - `--sci-toolbar-item-background-color`: Background color of toolbar items.\r\n * - `--sci-toolbar-item-background-color-hover`: Background color of a toolbar item when hovered.\r\n * - `--sci-toolbar-item-background-color-active`: Background color of a toolbar item when pressed.\r\n * - `--sci-toolbar-item-background-color-checked`: Background color of toggled toolbar items.\r\n * - `--sci-toolbar-item-border-radius`: Border radius of toolbar items.\r\n * - `--sci-toolbar-item-border-color-hover`: Border color of toolbar items when hovered.\r\n * - `--sci-toolbar-item-border-color-checked`: Border color of toggled toolbar items.\r\n * - `--sci-toolbar-item-outline-width`: Outline width of toolbar items when focused.\r\n * - `--sci-toolbar-item-menu-indicator-color`: Color of the menu indicator for toolbar items without a label.\r\n * - `--sci-toolbar-item-menu-indicator-color-disabled`: Color of the menu indicator if disabled.\r\n * - `--sci-toolbar-item-menu-indicator-size`: Size of the menu indicator.\r\n *\r\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\r\n */\r\n@Component({\r\n selector: 'sci-toolbar',\r\n template: '', // Template provided by `SciToolbarGroupComponent`; see `attachVirtualToolbarGroup()`.\r\n host: {\r\n '[attr.name]': 'name()', // Public API: Enables selecting the toolbar by name in CSS (also if the toolbar has a dynamic name input binding)\r\n },\r\n})\r\nexport class SciToolbarComponent {\r\n\r\n /**\r\n * Defines the name of the toolbar. The name must start with the `toolbar:` prefix.\r\n *\r\n * Use this name to contribute tools to the toolbar using the {@link contributeMenu} function.\r\n */\r\n public readonly name = input.required<`toolbar:${string}`>();\r\n\r\n /**\r\n * Specifies the orientation of the toolbar. Defaults to `horizontal`.\r\n */\r\n public readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\r\n\r\n /**\r\n * Specifies a context to describe the environment of the toolbar.\r\n *\r\n * Toolbar contributions may declare a required context. Only contributions matching this context are used.\r\n *\r\n * A context can also be provided at the injector level using {@link provideMenuContextProvider}, for example, at the component, route, or application level,\r\n * and is available to toolbars used in the scope of this injector. The inherited context can be overridden or extended. Setting a context entry to `undefined` clears it.\r\n *\r\n * ```ts\r\n * import {provideMenuContextProvider} from '@scion/components/menu';\r\n *\r\n * providers: [\r\n * provideMenuContextProvider(() => new Map().set('key', 'value')),\r\n * ];\r\n * ```\r\n *\r\n * @see provideMenuContextProvider\r\n */\r\n public readonly context = input<Map<string, unknown>>();\r\n\r\n /**\r\n * Specifies the accelerator targets for the toolbar. Defaults to {@link Document}.\r\n *\r\n * Alternatively, accelerator targets can be provided at the injector level using {@link provideMenuAcceleratorTargetProvider}, for example, at the component, route, or application level,\r\n * and are available to toolbars used in the scope of this injector. Inherited targets can be overridden.\r\n *\r\n * ```ts\r\n * import {provideMenuAcceleratorTargetProvider} from '@scion/components/menu';\r\n * import {ElementRef, inject} from '@angular/core';\r\n *\r\n * providers: [\r\n * provideMenuAcceleratorTargetProvider(() => inject(ElementRef)),\r\n * ];\r\n * ```\r\n */\r\n public readonly acceleratorTarget = input<MaybeArray<Element | ElementRef<Element>>>();\r\n\r\n /**\r\n * Controls where to attach menu popovers in the DOM. By default, popovers are added as a direct sibling of the toolbar.\r\n */\r\n public readonly popoverViewContainerRef = input<ViewContainerRef>(inject(ViewContainerRef));\r\n\r\n /**\r\n * Indicates whether any menu within the toolbar is currently open.\r\n *\r\n * TODO [dwi][API] How to name that metod? Cannot be internal because used by table.\r\n */\r\n public readonly menuOpen = computed(() => this._virtualToolbarGroupComponent.menuOpen());\r\n\r\n private readonly _environmentContext = injectMenuContext();\r\n private readonly _context = computed(() => new Map([...this._environmentContext(), ...this.context() ?? new Map()]));\r\n private readonly _virtualToolbarGroupComponent: SciToolbarGroupComponent;\r\n\r\n protected readonly menuItems = inject(ɵSciMenuService).menuItems(this.name, this._context);\r\n\r\n constructor() {\r\n this._virtualToolbarGroupComponent = this.attachVirtualToolbarGroup();\r\n this.installAccelerators();\r\n }\r\n\r\n /**\r\n * Creates and attaches a {@link SciToolbarGroupComponent} using this component as host,\r\n * rendering top-level toolbar items and groups as direct children inside `<sci-toolbar/>`.\r\n */\r\n private attachVirtualToolbarGroup(): SciToolbarGroupComponent {\r\n const componentRef = createComponent(SciToolbarGroupComponent, {\r\n elementInjector: inject(Injector),\r\n environmentInjector: inject(EnvironmentInjector),\r\n hostElement: inject(ElementRef).nativeElement as HTMLElement,\r\n bindings: [\r\n inputBinding('menuItems', this.menuItems),\r\n inputBinding('orientation', this.orientation),\r\n inputBinding('popoverViewContainerRef', this.popoverViewContainerRef),\r\n ],\r\n });\r\n\r\n // Attach component to Angular component tree for change detection.\r\n inject(ApplicationRef).attachView(componentRef.hostView);\r\n\r\n // Destroy component when host is destroyed.\r\n inject(DestroyRef).onDestroy(() => componentRef.destroy());\r\n\r\n return componentRef.instance;\r\n }\r\n\r\n /**\r\n * Installs accelerators of menu items in this toolbar, recursively for menu items in submenus and groups.\r\n */\r\n private installAccelerators(): void {\r\n const injector = inject(Injector);\r\n const environmentTargets = injectMenuAcceleratorTargets();\r\n\r\n effect(onCleanup => {\r\n const menuItems = this.menuItems();\r\n const options: ɵSciMenuAcceleratorOptions = {\r\n targets: this.acceleratorTarget(),\r\n environmentTargets: environmentTargets(),\r\n injector,\r\n };\r\n\r\n untracked(() => {\r\n const accelerators = ɵinstallMenuAccelerators(menuItems, options);\r\n onCleanup(() => accelerators.dispose());\r\n });\r\n });\r\n }\r\n}\r\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {type SciToolbarFactory, type SciToolbarButtonDescriptor, type SciToolbarControlDescriptor, type SciToolbarMenuDescriptor, type SciToolbarGroupDescriptor} from './toolbar.factory';\nexport {SciToolbarComponent} from './toolbar.component';\n","/*\r\n * Copyright (c) 2018-2026 Swiss Federal Railways\r\n *\r\n * This program and the accompanying materials are made\r\n * available under the terms of the Eclipse Public License 2.0\r\n * which is available at https://www.eclipse.org/legal/epl-2.0/\r\n *\r\n * SPDX-License-Identifier: EPL-2.0\r\n */\r\n\r\nimport {Component, computed, effect, ElementRef, inject, Injector, input, linkedSignal, Signal, untracked, ViewContainerRef} from '@angular/core';\r\nimport {ɵinstallMenuAccelerators, ɵSciMenuAcceleratorOptions} from '../menu-accelerators';\r\nimport {ɵSciMenuService} from '../ɵmenu.service';\r\nimport {SciAttributesDirective} from '@scion/components/common';\r\nimport {MaybeArray, RequireOne} from '@scion/toolkit/types';\r\nimport {SciMenuItem} from '../menu.model';\r\nimport {SciMenuFilterConfig} from '../menu/menu.factory';\r\nimport {injectMenuAcceleratorTargets, injectMenuContext} from '../menu-environment/menu-environment-providers';\r\n\r\n/**\r\n * TODO [menu]: Explain how to size the menubar. (height can be set)\r\n *\r\n * @experimental since 22.3.0; API and behavior may change in any version without notice.\r\n */\r\n@Component({\r\n selector: 'sci-menubar',\r\n templateUrl: './menubar.component.html',\r\n styleUrl: './menubar.component.scss',\r\n imports: [\r\n SciAttributesDirective,\r\n ],\r\n host: {\r\n '[attr.name]': 'name()', // Public API: Enables selecting the menubar by name in CSS (also if the menubar has a dynamic name input binding)\r\n },\r\n})\r\nexport class SciMenubarComponent {\r\n\r\n public readonly name = input.required<`menubar:${string}`>();\r\n public readonly context = input<Map<string, unknown>>();\r\n public readonly acceleratorTarget = input<MaybeArray<Element | ElementRef<Element>>>();\r\n public readonly viewContainerRef = input<ViewContainerRef>(inject(ViewContainerRef));\r\n\r\n private readonly _environmentContext = injectMenuContext();\r\n private readonly _context = computed(() => new Map([...this._environmentContext(), ...this.context() ?? new Map()]));\r\n\r\n protected readonly menuItems = inject(ɵSciMenuService).menuItems(this.name, this._context) as Signal<SciMenuItem[]>;\r\n\r\n protected readonly activeMenuItem = linkedSignal<SciMenuItem[], {menuItem: SciMenuItem; element: HTMLElement; closing?: true | 'prevented'} | null>({\r\n source: this.menuItems, // Unset when menu items change.\r\n computation: () => null,\r\n equal: (a, b) => a?.menuItem === b?.menuItem, // required to ignore clicking an already opened menu item\r\n });\r\n\r\n constructor() {\r\n this.installMenuOpener();\r\n this.installAccelerators();\r\n }\r\n\r\n /**\r\n * Method invoked when clicking on a menu item.\r\n */\r\n protected onMenuItemClick(menuItem: SciMenuItem, element: HTMLElement): void {\r\n this.activeMenuItem.update(activeMenuItem => activeMenuItem?.menuItem === menuItem ? null : {menuItem, element});\r\n }\r\n\r\n /**\r\n * Method invoked before clicking on a menu item.\r\n *\r\n * When clicking on the active menu item, mark it as closing to prevent immediate re-opening race condition on subsequent click event.\r\n */\r\n protected onMenuItemMouseDown(menuItem: SciMenuItem): void {\r\n const activeMenuItem = this.activeMenuItem();\r\n\r\n if (activeMenuItem?.menuItem === menuItem) {\r\n activeMenuItem.closing = true;\r\n }\r\n }\r\n\r\n /**\r\n * Method invoked when moving the pointer over a menu item.\r\n */\r\n protected onMenuItemMouseEnter(menuItem: SciMenuItem, element: HTMLElement): void {\r\n this.activeMenuItem.update(activeMenuItem => activeMenuItem ? {menuItem, element} : null);\r\n }\r\n\r\n /**\r\n * Method invoked when moving the pointer out of a menu item.\r\n */\r\n protected onMenuItemMouseLeave(menuItem: SciMenuItem): void {\r\n const activeMenuItem = this.activeMenuItem();\r\n if (activeMenuItem?.menuItem !== menuItem) {\r\n return;\r\n }\r\n\r\n if (activeMenuItem.closing === 'prevented') {\r\n this.activeMenuItem.set(null); // unset active menu\r\n }\r\n else if (activeMenuItem.closing) {\r\n delete activeMenuItem.closing; // unset closing state\r\n }\r\n }\r\n\r\n /**\r\n * Opens a menu based on {@link activeMenuItem}.\r\n */\r\n private installMenuOpener(): void {\r\n const menuService = inject(ɵSciMenuService);\r\n\r\n effect(onCleanup => {\r\n if (!this.activeMenuItem()) {\r\n return;\r\n }\r\n\r\n const {menuItem, element} = this.activeMenuItem()!;\r\n const menu = menuItem.menu!;\r\n\r\n untracked(() => {\r\n const menuRef = menuService.open(menu.children, {\r\n anchor: element,\r\n viewContainerRef: this.viewContainerRef(),\r\n filter: menu.filter as RequireOne<SciMenuFilterConfig> | undefined,\r\n width: menu.width,\r\n minWidth: menu.minWidth,\r\n maxWidth: menu.maxWidth,\r\n maxHeight: menu.maxHeight,\r\n cssClass: menuItem.cssClass,\r\n attributes: menuItem.attributes,\r\n align: 'vertical',\r\n offset: {y: 1},\r\n });\r\n\r\n // Close when opening another menu.\r\n onCleanup(() => menuRef.close());\r\n\r\n // Unset when closing menu.\r\n menuRef.onClose(() => {\r\n const activeMenuItem = this.activeMenuItem();\r\n\r\n // Do not unset if another menu was opened in the meantime.\r\n if (activeMenuItem?.menuItem !== menuItem) {\r\n return;\r\n }\r\n\r\n // Prevent immediate re-opening race condition when toolbar button is clicked to close.\r\n if (activeMenuItem.closing) {\r\n activeMenuItem.closing = 'prevented';\r\n return;\r\n }\r\n\r\n this.activeMenuItem.set(null);\r\n });\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Installs accelerators of menu items in this menubar, recursively for menu items in submenus and groups.\r\n */\r\n private installAccelerators(): void {\r\n const injector = inject(Injector);\r\n const environmentTargets = injectMenuAcceleratorTargets();\r\n\r\n effect(onCleanup => {\r\n const menuItems = this.menuItems();\r\n const options: ɵSciMenuAcceleratorOptions = {\r\n targets: this.acceleratorTarget(),\r\n environmentTargets: environmentTargets(),\r\n injector,\r\n };\r\n\r\n untracked(() => {\r\n const accelerators = ɵinstallMenuAccelerators(menuItems, options);\r\n onCleanup(() => accelerators.dispose());\r\n });\r\n });\r\n }\r\n}\r\n","@for (menuItem of menuItems(); track $index) {\r\n <button [class.open]=\"activeMenuItem()?.menuItem === menuItem\"\r\n [class]=\"menuItem.cssClass\" class=\"menu-item e2e-menu-item\"\r\n [sciAttributes]=\"menuItem.attributes\"\r\n (mousedown)=\"onMenuItemMouseDown(menuItem)\"\r\n (click)=\"onMenuItemClick(menuItem, element)\"\r\n (mouseenter)=\"onMenuItemMouseEnter(menuItem, element)\"\r\n (mouseleave)=\"onMenuItemMouseLeave(menuItem)\"\r\n #element>\r\n {{menuItem.labelText!()}}\r\n </button>\r\n}\r\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {type SciMenubarFactory, type SciMenubarMenuDescriptor} from './menubar.factory';\nexport {SciMenubarComponent} from './menubar.component';\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {type SciMenuFactory, type SciMenuItemDescriptor, type SciMenuDescriptor, type SciMenuGroupDescriptor, type SciMenuFilterConfig} from './menu.factory';\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {SciMenuService} from './menu.service';\nimport {Provider} from '@angular/core';\nimport {ɵSciMenuService} from './ɵmenu.service';\n\n/**\n * Provides {@link SciMenuService} for dependency injection.\n */\nexport function provideMenuService(): Provider[] {\n return [\n ɵSciMenuService,\n {provide: SciMenuService, useExisting: ɵSciMenuService},\n ];\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ElementRef, inject, Injector, Provider, runInInjectionContext} from '@angular/core';\nimport {MaybeSignal} from '@scion/components/common';\nimport {SCI_MENU_ACCELERATOR_TARGET_PROVIDER, SCI_MENU_ACCELERATOR_TARGET_PROVIDERS, SCI_MENU_CONTEXT_PROVIDER, SCI_MENU_CONTEXT_PROVIDERS, SCI_MENU_INJECTION_CONTEXT_PROVIDER, SCI_MENU_INJECTION_CONTEXT_PROVIDERS} from './menu-environment-providers';\nimport {MaybeArray} from '@scion/toolkit/types';\nimport {provideMenuService} from '../menu-service.provider';\n\n/**\n * Registers a {@link SciMenuContextProviderFn} to provide context to menu locations and contributions.\n *\n * Provided context is applied to menu locations and contributions in the scope of the injector providing this function.\n * Individual locations and contributions can extend or override the provided context.\n *\n * Multiple providers can be registered. Providers at different injector tree levels form a hierarchy.\n *\n * @see SciMenuContextProviderFn\n */\nexport function provideMenuContextProvider(providerFn: SciMenuContextProviderFn): Provider[] {\n return [\n {\n provide: SCI_MENU_CONTEXT_PROVIDER,\n useValue: providerFn,\n multi: true,\n },\n {\n provide: SCI_MENU_CONTEXT_PROVIDERS,\n useFactory: (): SciMenuContextProviderFn[] => {\n const injector = inject(Injector);\n return [\n // Collect providers registered in parent injectors.\n ...inject(SCI_MENU_CONTEXT_PROVIDERS, {skipSelf: true, optional: true}) ?? [],\n // Collect providers registered in this injector.\n // Wrap function to execute in the injector of this injector, not in the calling context.\n ...inject(SCI_MENU_CONTEXT_PROVIDER).map(fn => (callingInjector: Injector) => runInInjectionContext(injector, () => fn(callingInjector))),\n ];\n },\n },\n // Provide `MenuService` to inherit provided menu context when opening a menu or looking up installed accelerators.\n provideMenuService(),\n ];\n}\n\n/**\n * Registers a {@link SciMenuInjectionContextProviderFn} to provide dependency injection tokens for a given menu context.\n *\n * Provided tokens are available for dependency injection for contributions registered in the scope of the injector providing this function.\n * Tokens can be injected in the factory passed to {@link contributeMenu}.\n *\n * Multiple providers can be registered. Providers at different injector tree levels form a hierarchy.\n *\n * @see SciMenuInjectionContextProviderFn\n */\nexport function provideMenuInjectionContextProvider(providerFn: SciMenuInjectionContextProviderFn): Provider[] {\n return [\n {\n provide: SCI_MENU_INJECTION_CONTEXT_PROVIDER,\n useValue: providerFn,\n multi: true,\n },\n {\n provide: SCI_MENU_INJECTION_CONTEXT_PROVIDERS,\n useFactory: (): SciMenuInjectionContextProviderFn[] => {\n const injector = inject(Injector);\n return [\n // Collect providers registered in parent injectors.\n ...inject(SCI_MENU_INJECTION_CONTEXT_PROVIDERS, {skipSelf: true, optional: true}) ?? [],\n // Collect providers registered in this injector.\n // Wrap function to execute in the injector of this injector, not in the calling context.\n ...inject(SCI_MENU_INJECTION_CONTEXT_PROVIDER).map(fn => (context: Map<string, unknown>) => runInInjectionContext(injector, () => fn(context))),\n ];\n },\n },\n ];\n}\n\n/**\n * Registers a {@link SciMenuAcceleratorTargetProviderFn} to provide accelerator targets to menu locations.\n *\n * Provided accelerator targets are available to menu locations in the scope of the injector providing this function.\n * Individual locations can override the provided targets.\n *\n * Multiple providers can be registered. Providers at different injector tree levels form a hierarchy.\n *\n * @see SciMenuAcceleratorTargetProviderFn\n */\nexport function provideMenuAcceleratorTargetProvider(providerFn: SciMenuAcceleratorTargetProviderFn): Provider[] {\n return [\n {\n provide: SCI_MENU_ACCELERATOR_TARGET_PROVIDER,\n useValue: providerFn,\n multi: true,\n },\n {\n provide: SCI_MENU_ACCELERATOR_TARGET_PROVIDERS,\n useFactory: (): SciMenuAcceleratorTargetProviderFn[] => {\n // Collect providers registered in current and parent injectors.\n // Wrap function to execute in the injector where the function is provided, not in the injector of the consumer.\n const injector = inject(Injector);\n return [\n // Collect providers registered in parent injectors.\n ...inject(SCI_MENU_ACCELERATOR_TARGET_PROVIDERS, {skipSelf: true, optional: true}) ?? [],\n // Collect providers registered in this injector.\n // Wrap function to execute in the injector of this injector, not in the calling context.\n ...inject(SCI_MENU_ACCELERATOR_TARGET_PROVIDER).map(fn => (callingInjector: Injector) => runInInjectionContext(injector, () => fn(callingInjector))),\n ];\n },\n },\n ];\n}\n\n/**\n * Signature of a function to provide context to menu locations and contributions.\n *\n * A menu location is a toolbar, menubar, or menu. A location or contribution can have a context (`Map`)\n * describing its environment. A contribution is eligible for a location only if the location's context fully\n * contains the contribution's context.\n *\n * Register this provider using the {@link provideMenuContextProvider} function.\n *\n * The function can call `inject` to get dependencies from the injector providing this function.\n *\n * @param callingInjector - Use to inject dependencies from the injector calling this function, e.g., the injector of the menu location.\n */\nexport type SciMenuContextProviderFn = (callingInjector: Injector) => MaybeSignal<Map<string, unknown> | undefined>;\n\n/**\n * Signature of a function to provide dependency injection tokens for a given menu context.\n *\n * The passed menu context is the context of a menu location (toolbar, menubar, or menu) describing its environment.\n * Returned tokens are available for dependency injection in the menu factory passed to {@link contributeMenu}.\n *\n * Register this provider using the {@link provideMenuInjectionContextProvider} function.\n *\n * The function can call `inject` to get any required dependencies.\n */\nexport type SciMenuInjectionContextProviderFn = (context: Map<string, unknown>) => Provider[];\n\n/**\n * Signature of a function to provide accelerator targets to menu locations.\n *\n * An accelerator target is a DOM element on which a menu location (toolbar, menubar, or menu) listens\n * for keyboard events for accelerators configured on menu items.\n *\n * Register this provider using the {@link provideMenuAcceleratorTargetProvider} function.\n *\n * The function can call `inject` to get dependencies from the injector providing this function.\n *\n * @param callingInjector - Use to inject dependencies from the injector calling this function, e.g., the injector of the menu location.\n */\nexport type SciMenuAcceleratorTargetProviderFn = (callingInjector: Injector) => MaybeSignal<MaybeArray<Element | ElementRef<Element>> | undefined>;\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nexport {provideMenuContextProvider, type SciMenuContextProviderFn, provideMenuInjectionContextProvider, type SciMenuInjectionContextProviderFn, provideMenuAcceleratorTargetProvider, type SciMenuAcceleratorTargetProviderFn} from './menu-environment.provider';\nexport {injectMenuInjectionContextProviders as ɵinjectMenuInjectionContextProviders} from './menu-environment-providers';\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/menu'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciMenuService, type SciMenuRef, type SciMenuOptions, type SciMenuOrigin} from './menu.service';\nexport {ɵSciMenuService} from './ɵmenu.service';\nexport {SciMenuAdapter, type SciMenuAdapterChain} from './menu-adapter.model';\nexport {contributeMenu} from './menu-contribution';\nexport {type SciMenuContribution, type SciMenuContributionLocation, type SciToolbarContributionLocation, type SciMenubarContributionLocation, type SciMenuContributionLocationLike, type SciMenuContributionPosition, type SciToolbarContributionPosition, type SciMenubarContributionPosition, type SciMenuContributionPositionLike, type SciMenuFactoryFn, type SciToolbarFactoryFn, type SciMenubarFactoryFn, type SciMenuFactoryFnLike, type SciMenuContributionOptions} from './menu-contribution.model';\nexport {type SciMenuItem, type SciMenuGroup, type SciMenuItemLike} from './menu.model';\nexport {installMenuAccelerators, type SciMenuAcceleratorOptions, type SciKeyboardAccelerator} from './menu-accelerators';\n\nexport * from './toolbar/public_api';\nexport * from './menubar/public_api';\nexport * from './menu/public_api';\nexport * from './menu-environment/public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["getLabelIfText","getLabelIfComponent","getIconIfLigature","getIconIfComponent","i1"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;AAQG;AAMH;;AAEG;AACG,SAAU,SAAS,CAAC,YAAmD,EAAA;IAC3E,OAAO,YAAY,KAAK,SAAS,GAAG,SAAS,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,SAAS;AACrF;;ACnBA;;;;;;;;AAQG;AAQH;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAC,OAA+B,EAAA;IAC/D,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC;AACtD,IAAA,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;AAGhF,IAAA,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,UAAU,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;;AAGhF,IAAA,OAAO,QAAQ,CAAC,MAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,GAAG,OAAO,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,EAAC,KAAK,EAAE,OAAO,CAAC,OAAO,EAAC,CAAC;AACtH;AAEA;;;;;;;AAOG;AACG,SAAU,mCAAmC,CAAC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