ng-primitives 0.76.1 → 0.77.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/a11y/visually-hidden/visually-hidden.d.ts +1 -1
- package/combobox/combobox/combobox.d.ts +2 -2
- package/combobox/config/combobox-config.d.ts +2 -2
- package/combobox/index.d.ts +2 -2
- package/fesm2022/ng-primitives-a11y.mjs +2 -2
- package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
- package/fesm2022/ng-primitives-combobox.mjs +53 -53
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-dialog.mjs +1 -1
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +8 -10
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +17 -17
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/menu/config/menu-config.d.ts +2 -2
- package/menu/index.d.ts +1 -1
- package/menu/menu-trigger/menu-trigger.d.ts +5 -4
- package/menu/submenu-trigger/submenu-trigger.d.ts +2 -2
- package/package.json +25 -25
- package/popover/index.d.ts +1 -1
- package/popover/popover-trigger/popover-trigger.d.ts +2 -2
- package/tooltip/index.d.ts +2 -2
- package/tooltip/tooltip-trigger/tooltip-trigger.d.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-dialog.mjs","sources":["../../../../packages/ng-primitives/dialog/src/config/dialog-config.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog-state.ts","../../../../packages/ng-primitives/dialog/src/dialog-description/dialog-description.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog-ref.ts","../../../../packages/ng-primitives/dialog/src/dialog-overlay/dialog-overlay.ts","../../../../packages/ng-primitives/dialog/src/dialog-title/dialog-title.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog.service.ts","../../../../packages/ng-primitives/dialog/src/dialog-trigger/dialog-trigger.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog.ts","../../../../packages/ng-primitives/dialog/src/ng-primitives-dialog.ts"],"sourcesContent":["import { ScrollStrategy } from '@angular/cdk/overlay';\nimport { InjectionToken, Injector, Provider, ViewContainerRef, inject } from '@angular/core';\n\n/** Valid ARIA roles for a dialog. */\nexport type NgpDialogRole = 'dialog' | 'alertdialog';\n\nexport interface NgpDialogConfig<T = any> {\n /** The view container to attach the dialog to. */\n viewContainerRef?: ViewContainerRef;\n\n /** The injector to use for the dialog. Defaults to the view container's injector.*/\n injector?: Injector;\n\n /** ID for the dialog. If omitted, a unique one will be generated. */\n id?: string;\n\n /** The role of the dialog. */\n role?: NgpDialogRole;\n\n /** Whether this is a modal dialog. Used to set the `aria-modal` attribute. */\n modal?: boolean;\n\n /** Scroll strategy to be used for the dialog. This determines how the dialog responds to scrolling underneath the panel element. */\n scrollStrategy?: ScrollStrategy;\n\n /**\n * Whether the dialog should close when the user navigates backwards or forwards through browser\n * history.\n */\n closeOnNavigation?: boolean;\n\n /** Whether the dialog should close when the user presses the escape key. */\n closeOnEscape?: boolean;\n\n /** Whether the dialog should close when the user click the overlay. */\n closeOnClick?: boolean;\n\n data?: T;\n}\n\nexport const defaultDialogConfig: NgpDialogConfig = {\n role: 'dialog',\n modal: true,\n closeOnNavigation: true,\n closeOnEscape: true,\n closeOnClick: true,\n};\n\nexport const NgpDialogConfigToken = new InjectionToken<NgpDialogConfig>('NgpDialogConfigToken');\n\n/**\n * Provide the default Dialog configuration\n * @param config The Dialog configuration\n * @returns The provider\n */\nexport function provideDialogConfig(config: Partial<NgpDialogConfig>): Provider[] {\n return [\n {\n provide: NgpDialogConfigToken,\n useValue: { ...defaultDialogConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Dialog configuration\n * @returns The global Dialog configuration\n */\nexport function injectDialogConfig(): NgpDialogConfig {\n return inject(NgpDialogConfigToken, { optional: true }) ?? defaultDialogConfig;\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpDialog } from './dialog';\n\n/**\n * The state token for the Dialog primitive.\n */\nexport const NgpDialogStateToken = createStateToken<NgpDialog<any, any>>('Dialog');\n\n/**\n * Provides the Dialog state.\n */\nexport const provideDialogState = createStateProvider(NgpDialogStateToken);\n\n/**\n * Injects the Dialog state.\n */\nexport const injectDialogState = createStateInjector<NgpDialog>(NgpDialogStateToken);\n\n/**\n * The Dialog state registration function.\n */\nexport const dialogState = createState(NgpDialogStateToken);\n","import { Directive, input, OnDestroy } from '@angular/core';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectDialogState } from '../dialog/dialog-state';\n\n@Directive({\n selector: '[ngpDialogDescription]',\n exportAs: 'ngpDialogDescription',\n host: {\n '[id]': 'id()',\n },\n})\nexport class NgpDialogDescription implements OnDestroy {\n /** Access the dialog */\n private readonly dialog = injectDialogState();\n\n /** The id of the descriptions. */\n readonly id = input<string>(uniqueId('ngp-dialog-description'));\n\n constructor() {\n onChange(this.id, (id, prevId) => {\n if (prevId) {\n this.dialog().removeDescribedBy(prevId);\n }\n\n if (id) {\n this.dialog().setDescribedBy(id);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.dialog().removeDescribedBy(this.id());\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { hasModifierKey } from '@angular/cdk/keycodes';\nimport { OverlayRef } from '@angular/cdk/overlay';\nimport { inject, Injector } from '@angular/core';\nimport { NgpExitAnimationManager } from 'ng-primitives/internal';\nimport { Observable, Subject, Subscription } from 'rxjs';\nimport { NgpDialogConfig } from '../config/dialog-config';\n\n/**\n * Reference to a dialog opened via the Dialog service.\n */\nexport class NgpDialogRef<T = unknown, R = unknown> {\n /** Whether the user is allowed to close the dialog. */\n disableClose: boolean | undefined;\n\n /** Whether the escape key is allowed to close the dialog. */\n closeOnEscape: boolean | undefined;\n\n /** Emits when the dialog has been closed. */\n readonly closed = new Subject<{ focusOrigin?: FocusOrigin; result?: R }>();\n\n /** Emits when on keyboard events within the dialog. */\n readonly keydownEvents: Observable<KeyboardEvent>;\n\n /** Emits on pointer events that happen outside of the dialog. */\n readonly outsidePointerEvents: Observable<MouseEvent>;\n\n /** Data passed from the dialog opener. */\n readonly data?: T;\n\n /** Unique ID for the dialog. */\n readonly id: string;\n\n /** Subscription to external detachments of the dialog. */\n private detachSubscription: Subscription;\n\n /** @internal Store the injector */\n injector: Injector | undefined;\n\n /** Whether the dialog is closing. */\n private closing = false;\n\n constructor(\n readonly overlayRef: OverlayRef,\n readonly config: NgpDialogConfig<T>,\n ) {\n this.data = config.data;\n this.keydownEvents = overlayRef.keydownEvents();\n this.outsidePointerEvents = overlayRef.outsidePointerEvents();\n this.id = config.id!; // By the time the dialog is created we are guaranteed to have an ID.\n this.closeOnEscape = config.closeOnEscape ?? true;\n\n this.keydownEvents.subscribe(event => {\n if (\n event.key === 'Escape' &&\n !this.disableClose &&\n this.closeOnEscape !== false &&\n !hasModifierKey(event)\n ) {\n event.preventDefault();\n this.close(undefined, 'keyboard');\n }\n });\n\n this.detachSubscription = overlayRef.detachments().subscribe(() => this.close());\n }\n\n /**\n * Close the dialog.\n * @param result Optional result to return to the dialog opener.\n * @param options Additional options to customize the closing behavior.\n */\n async close(result?: R, focusOrigin?: FocusOrigin): Promise<void> {\n // If the dialog is already closed, do nothing.\n if (this.closing) {\n return;\n }\n\n this.closing = true;\n\n const exitAnimationManager = this.injector?.get(NgpExitAnimationManager, undefined, {\n optional: true,\n });\n if (exitAnimationManager) {\n await exitAnimationManager.exit();\n }\n\n this.overlayRef.dispose();\n this.detachSubscription.unsubscribe();\n this.closed.next({ focusOrigin, result });\n this.closed.complete();\n }\n\n /** Updates the position of the dialog based on the current position strategy. */\n updatePosition(): this {\n this.overlayRef.updatePosition();\n return this;\n }\n}\n\nexport function injectDialogRef<T = unknown, R = unknown>(): NgpDialogRef<T, R> {\n return inject<NgpDialogRef<T, R>>(NgpDialogRef);\n}\n","import { booleanAttribute, Directive, HostListener, input } from '@angular/core';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { injectDialogRef } from '../dialog/dialog-ref';\n\n@Directive({\n selector: '[ngpDialogOverlay]',\n exportAs: 'ngpDialogOverlay',\n hostDirectives: [NgpExitAnimation],\n})\nexport class NgpDialogOverlay {\n /** Access the global configuration */\n private readonly config = injectDialogConfig();\n\n /** Access the dialog ref. */\n private readonly dialogRef = injectDialogRef();\n\n /**\n * Whether the dialog should close on backdrop click.\n * @default `true`\n */\n readonly closeOnClick = input(this.config.closeOnClick, {\n alias: 'ngpDialogOverlayCloseOnClick',\n transform: booleanAttribute,\n });\n\n @HostListener('click')\n protected close(): void {\n if (this.closeOnClick()) {\n this.dialogRef.close();\n }\n }\n}\n","import { Directive, input, OnDestroy } from '@angular/core';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectDialogState } from '../dialog/dialog-state';\n\n@Directive({\n selector: '[ngpDialogTitle]',\n exportAs: 'ngpDialogTitle',\n host: {\n '[id]': 'id()',\n },\n})\nexport class NgpDialogTitle implements OnDestroy {\n /** Access the dialog. */\n private readonly dialog = injectDialogState();\n\n /** The id of the title. */\n readonly id = input<string>(uniqueId('ngp-dialog-title'));\n\n constructor() {\n onChange(this.id, (id, prevId) => {\n if (prevId) {\n this.dialog().removeLabelledBy(prevId);\n }\n\n if (id) {\n this.dialog().setLabelledBy(id);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.dialog().removeLabelledBy(this.id());\n }\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { Overlay, OverlayConfig, OverlayContainer, ScrollStrategy } from '@angular/cdk/overlay';\nimport { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n Injectable,\n Injector,\n OnDestroy,\n StaticProvider,\n TemplateRef,\n Type,\n ViewContainerRef,\n inject,\n isDevMode,\n} from '@angular/core';\nimport { NgpExitAnimationManager } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { Observable, Subject, defer } from 'rxjs';\nimport { startWith } from 'rxjs/operators';\nimport { NgpDialogConfig, injectDialogConfig } from '../config/dialog-config';\nimport { NgpDialogRef } from './dialog-ref';\n\n/**\n * This is based on the Angular CDK Dialog service.\n * https://github.com/angular/components/blob/main/src/cdk/dialog/dialog.ts\n */\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgpDialogManager implements OnDestroy {\n private readonly applicationRef = inject(ApplicationRef);\n private readonly document = inject<Document>(DOCUMENT);\n private readonly overlay = inject(Overlay);\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly defaultOptions = injectDialogConfig();\n private readonly parentDialogManager = inject(NgpDialogManager, {\n optional: true,\n skipSelf: true,\n });\n private readonly overlayContainer = inject(OverlayContainer);\n private readonly scrollStrategy: ScrollStrategy =\n this.defaultOptions.scrollStrategy ?? this.overlay.scrollStrategies.block();\n\n private openDialogsAtThisLevel: NgpDialogRef[] = [];\n private readonly afterAllClosedAtThisLevel = new Subject<void>();\n private readonly afterOpenedAtThisLevel = new Subject<NgpDialogRef>();\n private ariaHiddenElements = new Map<Element, string | null>();\n\n /** Keeps track of the currently-open dialogs. */\n get openDialogs(): readonly NgpDialogRef[] {\n return this.parentDialogManager\n ? this.parentDialogManager.openDialogs\n : this.openDialogsAtThisLevel;\n }\n\n /** Stream that emits when a dialog has been opened. */\n get afterOpened(): Subject<NgpDialogRef> {\n return this.parentDialogManager\n ? this.parentDialogManager.afterOpened\n : this.afterOpenedAtThisLevel;\n }\n\n /**\n * Stream that emits when all open dialog have finished closing.\n * Will emit on subscribe if there are no open dialogs to begin with.\n */\n readonly afterAllClosed: Observable<void> = defer(() =>\n this.openDialogs.length\n ? this.getAfterAllClosed()\n : this.getAfterAllClosed().pipe(startWith(undefined)),\n );\n\n /**\n * Opens a modal dialog containing the given template.\n */\n open<T, R>(\n templateRefOrComponentType: TemplateRef<NgpDialogContext<T, R>> | Type<unknown>,\n config?: NgpDialogConfig<T>,\n ): NgpDialogRef<T, R> {\n // store the current active element so we can focus it after the dialog is closed\n const activeElement = this.document.activeElement;\n\n // this is not ideal, but there is a case where a dialog trigger is within an overlay (e.g. menu),\n // which may be removed before the dialog is closed. This is not desired, so we need to access a view container ref\n // that is not within the overlay. To solve this we use the view container ref of the root component.\n // Could this have any unintended side effects? For example, the dialog would not be closed during route changes?\n const viewContainerRef =\n this.applicationRef.components[0]?.injector.get(ViewContainerRef) ??\n config?.viewContainerRef ??\n config?.injector?.get(ViewContainerRef);\n\n const defaults = this.defaultOptions;\n config = { ...defaults, viewContainerRef, ...config };\n config.id = config.id ?? uniqueId('ngp-dialog');\n\n if (config.id && this.getDialogById(config.id) && isDevMode()) {\n throw Error(`Dialog with id \"${config.id}\" exists already. The dialog id must be unique.`);\n }\n\n const overlayConfig = this.getOverlayConfig(config);\n const overlayRef = this.overlay.create(overlayConfig);\n const dialogRef = new NgpDialogRef<T, R>(overlayRef, config);\n const injector = this.createInjector(config, dialogRef, undefined);\n\n // store the injector in the dialog ref - this is so we can access the exit animation manager\n dialogRef.injector = injector;\n\n const context: NgpDialogContext<T, R> = {\n $implicit: dialogRef,\n close: dialogRef.close.bind(dialogRef),\n };\n\n if (templateRefOrComponentType instanceof TemplateRef) {\n overlayRef.attach(\n new TemplatePortal(templateRefOrComponentType, config.viewContainerRef!, context, injector),\n );\n } else {\n overlayRef.attach(\n new ComponentPortal(templateRefOrComponentType, config.viewContainerRef!, injector),\n );\n }\n\n // If this is the first dialog that we're opening, hide all the non-overlay content.\n if (!this.openDialogs.length) {\n this.hideNonDialogContentFromAssistiveTechnology();\n }\n\n (this.openDialogs as NgpDialogRef[]).push(dialogRef as NgpDialogRef<any, any>);\n this.afterOpened.next(dialogRef as NgpDialogRef<any, any>);\n\n dialogRef.closed.subscribe(closeResult => {\n this.removeOpenDialog(dialogRef as NgpDialogRef<any, any>, true);\n // Focus the trigger element after the dialog closes.\n if (activeElement instanceof HTMLElement && this.document.body.contains(activeElement)) {\n // Its not great that we are relying on an internal API here, but we need to in order to\n // try and best determine the focus origin when it is programmatically closed by the user.\n this.focusMonitor.focusVia(\n activeElement,\n closeResult.focusOrigin ?? (this.focusMonitor as any)._lastFocusOrigin,\n );\n }\n });\n\n return dialogRef;\n }\n\n /**\n * Closes all of the currently-open dialogs.\n */\n closeAll(): void {\n reverseForEach(this.openDialogs, dialog => dialog.close());\n }\n\n /**\n * Finds an open dialog by its id.\n * @param id ID to use when looking up the dialog.\n */\n getDialogById(id: string): NgpDialogRef | undefined {\n return this.openDialogs.find(dialog => dialog.id === id);\n }\n\n ngOnDestroy(): void {\n // Make one pass over all the dialogs that need to be untracked, but should not be closed. We\n // want to stop tracking the open dialog even if it hasn't been closed, because the tracking\n // determines when `aria-hidden` is removed from elements outside the dialog.\n reverseForEach(this.openDialogsAtThisLevel, dialog => {\n // Check for `false` specifically since we want `undefined` to be interpreted as `true`.\n this.removeOpenDialog(dialog, false);\n });\n\n // Make a second pass and close the remaining dialogs. We do this second pass in order to\n // correctly dispatch the `afterAllClosed` event in case we have a mixed array of dialogs\n // that should be closed and dialogs that should not.\n reverseForEach(this.openDialogsAtThisLevel, dialog => dialog.close());\n\n this.afterAllClosedAtThisLevel.complete();\n this.afterOpenedAtThisLevel.complete();\n this.openDialogsAtThisLevel = [];\n }\n\n /**\n * Creates an overlay config from a dialog config.\n */\n private getOverlayConfig(config: NgpDialogConfig): OverlayConfig {\n const state = new OverlayConfig({\n positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically(),\n scrollStrategy: config.scrollStrategy || this.scrollStrategy,\n hasBackdrop: false,\n disposeOnNavigation: config.closeOnNavigation,\n });\n\n return state;\n }\n\n /**\n * Creates a custom injector to be used inside the dialog. This allows a component loaded inside\n * of a dialog to close itself and, optionally, to return a value.\n */\n private createInjector<T, R>(\n config: NgpDialogConfig<T>,\n dialogRef: NgpDialogRef<T, R>,\n fallbackInjector: Injector | undefined,\n ): Injector {\n const userInjector = config.injector || config.viewContainerRef?.injector;\n const providers: StaticProvider[] = [\n { provide: NgpDialogRef, useValue: dialogRef },\n { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager },\n ];\n\n return Injector.create({ parent: userInjector || fallbackInjector, providers });\n }\n\n /**\n * Removes a dialog from the array of open dialogs.\n */\n private removeOpenDialog(dialogRef: NgpDialogRef, emitEvent: boolean) {\n const index = this.openDialogs.indexOf(dialogRef);\n\n if (index > -1) {\n (this.openDialogs as NgpDialogRef[]).splice(index, 1);\n\n // If all the dialogs were closed, remove/restore the `aria-hidden`\n // to a the siblings and emit to the `afterAllClosed` stream.\n if (!this.openDialogs.length) {\n this.ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue) {\n element.setAttribute('aria-hidden', previousValue);\n } else {\n element.removeAttribute('aria-hidden');\n }\n });\n\n this.ariaHiddenElements.clear();\n\n if (emitEvent) {\n this.getAfterAllClosed().next();\n }\n }\n }\n }\n\n /** Hides all of the content that isn't an overlay from assistive technology. */\n private hideNonDialogContentFromAssistiveTechnology() {\n const overlayContainer = this.overlayContainer.getContainerElement();\n\n // Ensure that the overlay container is attached to the DOM.\n if (overlayContainer.parentElement) {\n const siblings = overlayContainer.parentElement.children;\n\n for (let i = siblings.length - 1; i > -1; i--) {\n const sibling = siblings[i];\n\n if (\n sibling !== overlayContainer &&\n sibling.nodeName !== 'SCRIPT' &&\n sibling.nodeName !== 'STYLE' &&\n !sibling.hasAttribute('aria-live')\n ) {\n this.ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));\n sibling.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }\n\n private getAfterAllClosed(): Subject<void> {\n const parent = this.parentDialogManager;\n return parent ? parent.getAfterAllClosed() : this.afterAllClosedAtThisLevel;\n }\n}\n\n/**\n * Executes a callback against all elements in an array while iterating in reverse.\n * Useful if the array is being modified as it is being iterated.\n */\nfunction reverseForEach<T>(items: T[] | readonly T[], callback: (current: T) => void) {\n let i = items.length;\n\n while (i--) {\n callback(items[i]);\n }\n}\n\nexport interface NgpDialogContext<T = unknown, R = unknown> {\n $implicit: NgpDialogRef<T, R>;\n close: (result?: R) => void;\n}\n\nexport function injectDialogManager(): NgpDialogManager {\n return inject(NgpDialogManager);\n}\n","import { Directive, HostListener, inject, input, output, TemplateRef } from '@angular/core';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { NgpDialogRef } from '../dialog/dialog-ref';\nimport { NgpDialogContext, NgpDialogManager } from '../dialog/dialog.service';\n\n@Directive({\n selector: '[ngpDialogTrigger]',\n exportAs: 'ngpDialogTrigger',\n})\nexport class NgpDialogTrigger<T = unknown> {\n /** Access the global configuration */\n private readonly config = injectDialogConfig();\n\n /** Access the dialog manager. */\n private readonly dialogManager = inject(NgpDialogManager);\n\n /** The template to launch. */\n readonly template = input.required<TemplateRef<NgpDialogContext>>({\n alias: 'ngpDialogTrigger',\n });\n\n /** Emits whenever the dialog is closed with the given result. */\n readonly closed = output<T>({ alias: 'ngpDialogTriggerClosed' });\n\n /**\n * Whether the dialog should close on escape.\n * @default `true`\n */\n readonly closeOnEscape = input(this.config.closeOnEscape, {\n alias: 'ngpDialogTriggerCloseOnEscape',\n });\n\n /**\n * Store the dialog ref.\n * @internal\n */\n private dialogRef: NgpDialogRef | null = null;\n\n @HostListener('click')\n protected launch(): void {\n this.dialogRef = this.dialogManager.open(this.template(), {\n closeOnEscape: this.closeOnEscape(),\n });\n this.dialogRef.closed.subscribe(({ result }) => {\n this.closed.emit(result as T);\n return (this.dialogRef = null);\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, input, OnDestroy, signal } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { injectDialogRef } from './dialog-ref';\nimport { dialogState, provideDialogState } from './dialog-state';\n\n@Directive({\n selector: '[ngpDialog]',\n exportAs: 'ngpDialog',\n providers: [provideDialogState()],\n hostDirectives: [NgpFocusTrap, NgpExitAnimation],\n host: {\n tabindex: '-1',\n '[id]': 'state.id()',\n '[attr.role]': 'state.role()',\n '[attr.aria-modal]': 'state.modal()',\n '[attr.aria-labelledby]': 'labelledBy().join(\" \")',\n '[attr.aria-describedby]': 'describedBy().join(\" \")',\n },\n})\nexport class NgpDialog<T = unknown, R = unknown> implements OnDestroy {\n private readonly config = injectDialogConfig();\n\n /** Access the dialog ref */\n private readonly dialogRef = injectDialogRef<T, R>();\n\n /** The id of the dialog */\n readonly id = input<string>(uniqueId('ngp-dialog'));\n\n /** The dialog role. */\n readonly role = input(this.config.role, {\n alias: 'ngpDialogRole',\n });\n\n /** Whether the dialog is a modal. */\n readonly modal = input<boolean, BooleanInput>(this.config.modal ?? false, {\n alias: 'ngpDialogModal',\n transform: booleanAttribute,\n });\n\n /** The labelledby ids */\n protected readonly labelledBy = signal<string[]>([]);\n\n /** The describedby ids */\n protected readonly describedBy = signal<string[]>([]);\n\n /** The dialog state */\n protected readonly state = dialogState<NgpDialog<T, R>>(this);\n\n ngOnDestroy(): void {\n this.close();\n }\n\n /** Close the dialog. */\n close(result?: R): void {\n this.dialogRef.close(result);\n }\n\n /** Stop click events from propagating to the overlay */\n @HostListener('click', ['$event'])\n protected onClick(event: Event): void {\n event.stopPropagation();\n }\n\n /** @internal register a labelledby id */\n setLabelledBy(id: string): void {\n this.labelledBy.update(ids => [...ids, id]);\n }\n\n /** @internal register a describedby id */\n setDescribedBy(id: string): void {\n this.describedBy.update(ids => [...ids, id]);\n }\n\n /** @internal remove a labelledby id */\n removeLabelledBy(id: string): void {\n this.labelledBy.update(ids => ids.filter(i => i !== id));\n }\n\n /** @internal remove a describedby id */\n removeDescribedBy(id: string): void {\n this.describedBy.update(ids => ids.filter(i => i !== id));\n }\n}\n","/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,EAAA,WAAA,EAAA,cAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,sBAAA,EAAA,0BAAA,EAAA,uBAAA,EAAA,2BAAA,EAAA,EAAA,EAAA,SAAA,EAXT,CAAC,kBAAkB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAAA,IAAA,CAAA,YAAA,EAAA,EAAA,EAAA,SAAA,EAAAC,EAAA,CAAA,gBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAWtB,SAAS,EAAA,UAAA,EAAA,CAAA;kBAdrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,SAAS,EAAE,CAAC,kBAAkB,EAAE,CAAC;AACjC,oBAAA,cAAc,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;AAChD,oBAAA,IAAI,EAAE;AACJ,wBAAA,QAAQ,EAAE,IAAI;AACd,wBAAA,MAAM,EAAE,YAAY;AACpB,wBAAA,aAAa,EAAE,cAAc;AAC7B,wBAAA,mBAAmB,EAAE,eAAe;AACpC,wBAAA,wBAAwB,EAAE,wBAAwB;AAClD,wBAAA,yBAAyB,EAAE,yBAAyB;AACrD,qBAAA;AACF,iBAAA;8BAyCW,OAAO,EAAA,CAAA;sBADhB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AC9DnC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-dialog.mjs","sources":["../../../../packages/ng-primitives/dialog/src/config/dialog-config.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog-state.ts","../../../../packages/ng-primitives/dialog/src/dialog-description/dialog-description.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog-ref.ts","../../../../packages/ng-primitives/dialog/src/dialog-overlay/dialog-overlay.ts","../../../../packages/ng-primitives/dialog/src/dialog-title/dialog-title.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog.service.ts","../../../../packages/ng-primitives/dialog/src/dialog-trigger/dialog-trigger.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog.ts","../../../../packages/ng-primitives/dialog/src/ng-primitives-dialog.ts"],"sourcesContent":["import { ScrollStrategy } from '@angular/cdk/overlay';\nimport { InjectionToken, Injector, Provider, ViewContainerRef, inject } from '@angular/core';\n\n/** Valid ARIA roles for a dialog. */\nexport type NgpDialogRole = 'dialog' | 'alertdialog';\n\nexport interface NgpDialogConfig<T = any> {\n /** The view container to attach the dialog to. */\n viewContainerRef?: ViewContainerRef;\n\n /** The injector to use for the dialog. Defaults to the view container's injector.*/\n injector?: Injector;\n\n /** ID for the dialog. If omitted, a unique one will be generated. */\n id?: string;\n\n /** The role of the dialog. */\n role?: NgpDialogRole;\n\n /** Whether this is a modal dialog. Used to set the `aria-modal` attribute. */\n modal?: boolean;\n\n /** Scroll strategy to be used for the dialog. This determines how the dialog responds to scrolling underneath the panel element. */\n scrollStrategy?: ScrollStrategy;\n\n /**\n * Whether the dialog should close when the user navigates backwards or forwards through browser\n * history.\n */\n closeOnNavigation?: boolean;\n\n /** Whether the dialog should close when the user presses the escape key. */\n closeOnEscape?: boolean;\n\n /** Whether the dialog should close when the user click the overlay. */\n closeOnClick?: boolean;\n\n data?: T;\n}\n\nexport const defaultDialogConfig: NgpDialogConfig = {\n role: 'dialog',\n modal: true,\n closeOnNavigation: true,\n closeOnEscape: true,\n closeOnClick: true,\n};\n\nexport const NgpDialogConfigToken = new InjectionToken<NgpDialogConfig>('NgpDialogConfigToken');\n\n/**\n * Provide the default Dialog configuration\n * @param config The Dialog configuration\n * @returns The provider\n */\nexport function provideDialogConfig(config: Partial<NgpDialogConfig>): Provider[] {\n return [\n {\n provide: NgpDialogConfigToken,\n useValue: { ...defaultDialogConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Dialog configuration\n * @returns The global Dialog configuration\n */\nexport function injectDialogConfig(): NgpDialogConfig {\n return inject(NgpDialogConfigToken, { optional: true }) ?? defaultDialogConfig;\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpDialog } from './dialog';\n\n/**\n * The state token for the Dialog primitive.\n */\nexport const NgpDialogStateToken = createStateToken<NgpDialog<any, any>>('Dialog');\n\n/**\n * Provides the Dialog state.\n */\nexport const provideDialogState = createStateProvider(NgpDialogStateToken);\n\n/**\n * Injects the Dialog state.\n */\nexport const injectDialogState = createStateInjector<NgpDialog>(NgpDialogStateToken);\n\n/**\n * The Dialog state registration function.\n */\nexport const dialogState = createState(NgpDialogStateToken);\n","import { Directive, input, OnDestroy } from '@angular/core';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectDialogState } from '../dialog/dialog-state';\n\n@Directive({\n selector: '[ngpDialogDescription]',\n exportAs: 'ngpDialogDescription',\n host: {\n '[id]': 'id()',\n },\n})\nexport class NgpDialogDescription implements OnDestroy {\n /** Access the dialog */\n private readonly dialog = injectDialogState();\n\n /** The id of the descriptions. */\n readonly id = input<string>(uniqueId('ngp-dialog-description'));\n\n constructor() {\n onChange(this.id, (id, prevId) => {\n if (prevId) {\n this.dialog().removeDescribedBy(prevId);\n }\n\n if (id) {\n this.dialog().setDescribedBy(id);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.dialog().removeDescribedBy(this.id());\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { hasModifierKey } from '@angular/cdk/keycodes';\nimport { OverlayRef } from '@angular/cdk/overlay';\nimport { inject, Injector } from '@angular/core';\nimport { NgpExitAnimationManager } from 'ng-primitives/internal';\nimport { Observable, Subject, Subscription } from 'rxjs';\nimport { NgpDialogConfig } from '../config/dialog-config';\n\n/**\n * Reference to a dialog opened via the Dialog service.\n */\nexport class NgpDialogRef<T = unknown, R = unknown> {\n /** Whether the user is allowed to close the dialog. */\n disableClose: boolean | undefined;\n\n /** Whether the escape key is allowed to close the dialog. */\n closeOnEscape: boolean | undefined;\n\n /** Emits when the dialog has been closed. */\n readonly closed = new Subject<{ focusOrigin?: FocusOrigin; result?: R }>();\n\n /** Emits when on keyboard events within the dialog. */\n readonly keydownEvents: Observable<KeyboardEvent>;\n\n /** Emits on pointer events that happen outside of the dialog. */\n readonly outsidePointerEvents: Observable<MouseEvent>;\n\n /** Data passed from the dialog opener. */\n readonly data?: T;\n\n /** Unique ID for the dialog. */\n readonly id: string;\n\n /** Subscription to external detachments of the dialog. */\n private detachSubscription: Subscription;\n\n /** @internal Store the injector */\n injector: Injector | undefined;\n\n /** Whether the dialog is closing. */\n private closing = false;\n\n constructor(\n readonly overlayRef: OverlayRef,\n readonly config: NgpDialogConfig<T>,\n ) {\n this.data = config.data;\n this.keydownEvents = overlayRef.keydownEvents();\n this.outsidePointerEvents = overlayRef.outsidePointerEvents();\n this.id = config.id!; // By the time the dialog is created we are guaranteed to have an ID.\n this.closeOnEscape = config.closeOnEscape ?? true;\n\n this.keydownEvents.subscribe(event => {\n if (\n event.key === 'Escape' &&\n !this.disableClose &&\n this.closeOnEscape !== false &&\n !hasModifierKey(event)\n ) {\n event.preventDefault();\n this.close(undefined, 'keyboard');\n }\n });\n\n this.detachSubscription = overlayRef.detachments().subscribe(() => this.close());\n }\n\n /**\n * Close the dialog.\n * @param result Optional result to return to the dialog opener.\n * @param options Additional options to customize the closing behavior.\n */\n async close(result?: R, focusOrigin?: FocusOrigin): Promise<void> {\n // If the dialog is already closed, do nothing.\n if (this.closing) {\n return;\n }\n\n this.closing = true;\n\n const exitAnimationManager = this.injector?.get(NgpExitAnimationManager, undefined, {\n optional: true,\n });\n if (exitAnimationManager) {\n await exitAnimationManager.exit();\n }\n\n this.overlayRef.dispose();\n this.detachSubscription.unsubscribe();\n this.closed.next({ focusOrigin, result });\n this.closed.complete();\n }\n\n /** Updates the position of the dialog based on the current position strategy. */\n updatePosition(): this {\n this.overlayRef.updatePosition();\n return this;\n }\n}\n\nexport function injectDialogRef<T = unknown, R = unknown>(): NgpDialogRef<T, R> {\n return inject<NgpDialogRef<T, R>>(NgpDialogRef);\n}\n","import { booleanAttribute, Directive, HostListener, input } from '@angular/core';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { injectDialogRef } from '../dialog/dialog-ref';\n\n@Directive({\n selector: '[ngpDialogOverlay]',\n exportAs: 'ngpDialogOverlay',\n hostDirectives: [NgpExitAnimation],\n})\nexport class NgpDialogOverlay {\n /** Access the global configuration */\n private readonly config = injectDialogConfig();\n\n /** Access the dialog ref. */\n private readonly dialogRef = injectDialogRef();\n\n /**\n * Whether the dialog should close on backdrop click.\n * @default `true`\n */\n readonly closeOnClick = input(this.config.closeOnClick, {\n alias: 'ngpDialogOverlayCloseOnClick',\n transform: booleanAttribute,\n });\n\n @HostListener('click')\n protected close(): void {\n if (this.closeOnClick()) {\n this.dialogRef.close(undefined, 'mouse');\n }\n }\n}\n","import { Directive, input, OnDestroy } from '@angular/core';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectDialogState } from '../dialog/dialog-state';\n\n@Directive({\n selector: '[ngpDialogTitle]',\n exportAs: 'ngpDialogTitle',\n host: {\n '[id]': 'id()',\n },\n})\nexport class NgpDialogTitle implements OnDestroy {\n /** Access the dialog. */\n private readonly dialog = injectDialogState();\n\n /** The id of the title. */\n readonly id = input<string>(uniqueId('ngp-dialog-title'));\n\n constructor() {\n onChange(this.id, (id, prevId) => {\n if (prevId) {\n this.dialog().removeLabelledBy(prevId);\n }\n\n if (id) {\n this.dialog().setLabelledBy(id);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.dialog().removeLabelledBy(this.id());\n }\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { Overlay, OverlayConfig, OverlayContainer, ScrollStrategy } from '@angular/cdk/overlay';\nimport { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n Injectable,\n Injector,\n OnDestroy,\n StaticProvider,\n TemplateRef,\n Type,\n ViewContainerRef,\n inject,\n isDevMode,\n} from '@angular/core';\nimport { NgpExitAnimationManager } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { Observable, Subject, defer } from 'rxjs';\nimport { startWith } from 'rxjs/operators';\nimport { NgpDialogConfig, injectDialogConfig } from '../config/dialog-config';\nimport { NgpDialogRef } from './dialog-ref';\n\n/**\n * This is based on the Angular CDK Dialog service.\n * https://github.com/angular/components/blob/main/src/cdk/dialog/dialog.ts\n */\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgpDialogManager implements OnDestroy {\n private readonly applicationRef = inject(ApplicationRef);\n private readonly document = inject<Document>(DOCUMENT);\n private readonly overlay = inject(Overlay);\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly defaultOptions = injectDialogConfig();\n private readonly parentDialogManager = inject(NgpDialogManager, {\n optional: true,\n skipSelf: true,\n });\n private readonly overlayContainer = inject(OverlayContainer);\n private readonly scrollStrategy: ScrollStrategy =\n this.defaultOptions.scrollStrategy ?? this.overlay.scrollStrategies.block();\n\n private openDialogsAtThisLevel: NgpDialogRef[] = [];\n private readonly afterAllClosedAtThisLevel = new Subject<void>();\n private readonly afterOpenedAtThisLevel = new Subject<NgpDialogRef>();\n private ariaHiddenElements = new Map<Element, string | null>();\n\n /** Keeps track of the currently-open dialogs. */\n get openDialogs(): readonly NgpDialogRef[] {\n return this.parentDialogManager\n ? this.parentDialogManager.openDialogs\n : this.openDialogsAtThisLevel;\n }\n\n /** Stream that emits when a dialog has been opened. */\n get afterOpened(): Subject<NgpDialogRef> {\n return this.parentDialogManager\n ? this.parentDialogManager.afterOpened\n : this.afterOpenedAtThisLevel;\n }\n\n /**\n * Stream that emits when all open dialog have finished closing.\n * Will emit on subscribe if there are no open dialogs to begin with.\n */\n readonly afterAllClosed: Observable<void> = defer(() =>\n this.openDialogs.length\n ? this.getAfterAllClosed()\n : this.getAfterAllClosed().pipe(startWith(undefined)),\n );\n\n /**\n * Opens a modal dialog containing the given template.\n */\n open<T, R>(\n templateRefOrComponentType: TemplateRef<NgpDialogContext<T, R>> | Type<unknown>,\n config?: NgpDialogConfig<T>,\n ): NgpDialogRef<T, R> {\n // store the current active element so we can focus it after the dialog is closed\n const activeElement = this.document.activeElement;\n\n // this is not ideal, but there is a case where a dialog trigger is within an overlay (e.g. menu),\n // which may be removed before the dialog is closed. This is not desired, so we need to access a view container ref\n // that is not within the overlay. To solve this we use the view container ref of the root component.\n // Could this have any unintended side effects? For example, the dialog would not be closed during route changes?\n const viewContainerRef =\n this.applicationRef.components[0]?.injector.get(ViewContainerRef) ??\n config?.viewContainerRef ??\n config?.injector?.get(ViewContainerRef);\n\n const defaults = this.defaultOptions;\n config = { ...defaults, viewContainerRef, ...config };\n config.id = config.id ?? uniqueId('ngp-dialog');\n\n if (config.id && this.getDialogById(config.id) && isDevMode()) {\n throw Error(`Dialog with id \"${config.id}\" exists already. The dialog id must be unique.`);\n }\n\n const overlayConfig = this.getOverlayConfig(config);\n const overlayRef = this.overlay.create(overlayConfig);\n const dialogRef = new NgpDialogRef<T, R>(overlayRef, config);\n const injector = this.createInjector(config, dialogRef, undefined);\n\n // store the injector in the dialog ref - this is so we can access the exit animation manager\n dialogRef.injector = injector;\n\n const context: NgpDialogContext<T, R> = {\n $implicit: dialogRef,\n close: dialogRef.close.bind(dialogRef),\n };\n\n if (templateRefOrComponentType instanceof TemplateRef) {\n overlayRef.attach(\n new TemplatePortal(templateRefOrComponentType, config.viewContainerRef!, context, injector),\n );\n } else {\n overlayRef.attach(\n new ComponentPortal(templateRefOrComponentType, config.viewContainerRef!, injector),\n );\n }\n\n // If this is the first dialog that we're opening, hide all the non-overlay content.\n if (!this.openDialogs.length) {\n this.hideNonDialogContentFromAssistiveTechnology();\n }\n\n (this.openDialogs as NgpDialogRef[]).push(dialogRef as NgpDialogRef<any, any>);\n this.afterOpened.next(dialogRef as NgpDialogRef<any, any>);\n\n dialogRef.closed.subscribe(closeResult => {\n this.removeOpenDialog(dialogRef as NgpDialogRef<any, any>, true);\n // Focus the trigger element after the dialog closes.\n if (activeElement instanceof HTMLElement && this.document.body.contains(activeElement)) {\n // Its not great that we are relying on an internal API here, but we need to in order to\n // try and best determine the focus origin when it is programmatically closed by the user.\n this.focusMonitor.focusVia(\n activeElement,\n closeResult.focusOrigin ?? (this.focusMonitor as any)._lastFocusOrigin,\n );\n }\n });\n\n return dialogRef;\n }\n\n /**\n * Closes all of the currently-open dialogs.\n */\n closeAll(): void {\n reverseForEach(this.openDialogs, dialog => dialog.close());\n }\n\n /**\n * Finds an open dialog by its id.\n * @param id ID to use when looking up the dialog.\n */\n getDialogById(id: string): NgpDialogRef | undefined {\n return this.openDialogs.find(dialog => dialog.id === id);\n }\n\n ngOnDestroy(): void {\n // Make one pass over all the dialogs that need to be untracked, but should not be closed. We\n // want to stop tracking the open dialog even if it hasn't been closed, because the tracking\n // determines when `aria-hidden` is removed from elements outside the dialog.\n reverseForEach(this.openDialogsAtThisLevel, dialog => {\n // Check for `false` specifically since we want `undefined` to be interpreted as `true`.\n this.removeOpenDialog(dialog, false);\n });\n\n // Make a second pass and close the remaining dialogs. We do this second pass in order to\n // correctly dispatch the `afterAllClosed` event in case we have a mixed array of dialogs\n // that should be closed and dialogs that should not.\n reverseForEach(this.openDialogsAtThisLevel, dialog => dialog.close());\n\n this.afterAllClosedAtThisLevel.complete();\n this.afterOpenedAtThisLevel.complete();\n this.openDialogsAtThisLevel = [];\n }\n\n /**\n * Creates an overlay config from a dialog config.\n */\n private getOverlayConfig(config: NgpDialogConfig): OverlayConfig {\n const state = new OverlayConfig({\n positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically(),\n scrollStrategy: config.scrollStrategy || this.scrollStrategy,\n hasBackdrop: false,\n disposeOnNavigation: config.closeOnNavigation,\n });\n\n return state;\n }\n\n /**\n * Creates a custom injector to be used inside the dialog. This allows a component loaded inside\n * of a dialog to close itself and, optionally, to return a value.\n */\n private createInjector<T, R>(\n config: NgpDialogConfig<T>,\n dialogRef: NgpDialogRef<T, R>,\n fallbackInjector: Injector | undefined,\n ): Injector {\n const userInjector = config.injector || config.viewContainerRef?.injector;\n const providers: StaticProvider[] = [\n { provide: NgpDialogRef, useValue: dialogRef },\n { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager },\n ];\n\n return Injector.create({ parent: userInjector || fallbackInjector, providers });\n }\n\n /**\n * Removes a dialog from the array of open dialogs.\n */\n private removeOpenDialog(dialogRef: NgpDialogRef, emitEvent: boolean) {\n const index = this.openDialogs.indexOf(dialogRef);\n\n if (index > -1) {\n (this.openDialogs as NgpDialogRef[]).splice(index, 1);\n\n // If all the dialogs were closed, remove/restore the `aria-hidden`\n // to a the siblings and emit to the `afterAllClosed` stream.\n if (!this.openDialogs.length) {\n this.ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue) {\n element.setAttribute('aria-hidden', previousValue);\n } else {\n element.removeAttribute('aria-hidden');\n }\n });\n\n this.ariaHiddenElements.clear();\n\n if (emitEvent) {\n this.getAfterAllClosed().next();\n }\n }\n }\n }\n\n /** Hides all of the content that isn't an overlay from assistive technology. */\n private hideNonDialogContentFromAssistiveTechnology() {\n const overlayContainer = this.overlayContainer.getContainerElement();\n\n // Ensure that the overlay container is attached to the DOM.\n if (overlayContainer.parentElement) {\n const siblings = overlayContainer.parentElement.children;\n\n for (let i = siblings.length - 1; i > -1; i--) {\n const sibling = siblings[i];\n\n if (\n sibling !== overlayContainer &&\n sibling.nodeName !== 'SCRIPT' &&\n sibling.nodeName !== 'STYLE' &&\n !sibling.hasAttribute('aria-live')\n ) {\n this.ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));\n sibling.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }\n\n private getAfterAllClosed(): Subject<void> {\n const parent = this.parentDialogManager;\n return parent ? parent.getAfterAllClosed() : this.afterAllClosedAtThisLevel;\n }\n}\n\n/**\n * Executes a callback against all elements in an array while iterating in reverse.\n * Useful if the array is being modified as it is being iterated.\n */\nfunction reverseForEach<T>(items: T[] | readonly T[], callback: (current: T) => void) {\n let i = items.length;\n\n while (i--) {\n callback(items[i]);\n }\n}\n\nexport interface NgpDialogContext<T = unknown, R = unknown> {\n $implicit: NgpDialogRef<T, R>;\n close: (result?: R) => void;\n}\n\nexport function injectDialogManager(): NgpDialogManager {\n return inject(NgpDialogManager);\n}\n","import { Directive, HostListener, inject, input, output, TemplateRef } from '@angular/core';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { NgpDialogRef } from '../dialog/dialog-ref';\nimport { NgpDialogContext, NgpDialogManager } from '../dialog/dialog.service';\n\n@Directive({\n selector: '[ngpDialogTrigger]',\n exportAs: 'ngpDialogTrigger',\n})\nexport class NgpDialogTrigger<T = unknown> {\n /** Access the global configuration */\n private readonly config = injectDialogConfig();\n\n /** Access the dialog manager. */\n private readonly dialogManager = inject(NgpDialogManager);\n\n /** The template to launch. */\n readonly template = input.required<TemplateRef<NgpDialogContext>>({\n alias: 'ngpDialogTrigger',\n });\n\n /** Emits whenever the dialog is closed with the given result. */\n readonly closed = output<T>({ alias: 'ngpDialogTriggerClosed' });\n\n /**\n * Whether the dialog should close on escape.\n * @default `true`\n */\n readonly closeOnEscape = input(this.config.closeOnEscape, {\n alias: 'ngpDialogTriggerCloseOnEscape',\n });\n\n /**\n * Store the dialog ref.\n * @internal\n */\n private dialogRef: NgpDialogRef | null = null;\n\n @HostListener('click')\n protected launch(): void {\n this.dialogRef = this.dialogManager.open(this.template(), {\n closeOnEscape: this.closeOnEscape(),\n });\n this.dialogRef.closed.subscribe(({ result }) => {\n this.closed.emit(result as T);\n return (this.dialogRef = null);\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, input, OnDestroy, signal } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { injectDialogRef } from './dialog-ref';\nimport { dialogState, provideDialogState } from './dialog-state';\n\n@Directive({\n selector: '[ngpDialog]',\n exportAs: 'ngpDialog',\n providers: [provideDialogState()],\n hostDirectives: [NgpFocusTrap, NgpExitAnimation],\n host: {\n tabindex: '-1',\n '[id]': 'state.id()',\n '[attr.role]': 'state.role()',\n '[attr.aria-modal]': 'state.modal()',\n '[attr.aria-labelledby]': 'labelledBy().join(\" \")',\n '[attr.aria-describedby]': 'describedBy().join(\" \")',\n },\n})\nexport class NgpDialog<T = unknown, R = unknown> implements OnDestroy {\n private readonly config = injectDialogConfig();\n\n /** Access the dialog ref */\n private readonly dialogRef = injectDialogRef<T, R>();\n\n /** The id of the dialog */\n readonly id = input<string>(uniqueId('ngp-dialog'));\n\n /** The dialog role. */\n readonly role = input(this.config.role, {\n alias: 'ngpDialogRole',\n });\n\n /** Whether the dialog is a modal. */\n readonly modal = input<boolean, BooleanInput>(this.config.modal ?? false, {\n alias: 'ngpDialogModal',\n transform: booleanAttribute,\n });\n\n /** The labelledby ids */\n protected readonly labelledBy = signal<string[]>([]);\n\n /** The describedby ids */\n protected readonly describedBy = signal<string[]>([]);\n\n /** The dialog state */\n protected readonly state = dialogState<NgpDialog<T, R>>(this);\n\n ngOnDestroy(): void {\n this.close();\n }\n\n /** Close the dialog. */\n close(result?: R): void {\n this.dialogRef.close(result);\n }\n\n /** Stop click events from propagating to the overlay */\n @HostListener('click', ['$event'])\n protected onClick(event: Event): void {\n event.stopPropagation();\n }\n\n /** @internal register a labelledby id */\n setLabelledBy(id: string): void {\n this.labelledBy.update(ids => [...ids, id]);\n }\n\n /** @internal register a describedby id */\n setDescribedBy(id: string): void {\n this.describedBy.update(ids => [...ids, id]);\n }\n\n /** @internal remove a labelledby id */\n removeLabelledBy(id: string): void {\n this.labelledBy.update(ids => ids.filter(i => i !== id));\n }\n\n /** @internal remove a describedby id */\n removeDescribedBy(id: string): void {\n this.describedBy.update(ids => ids.filter(i => i !== id));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;AAwCO,MAAM,mBAAmB,GAAoB;AAClD,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,YAAY,EAAE,IAAI;CACnB;AAEM,MAAM,oBAAoB,GAAG,IAAI,cAAc,CAAkB,sBAAsB,CAAC;AAE/F;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,MAAgC,EAAA;IAClE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,oBAAoB;AAC7B,YAAA,QAAQ,EAAE,EAAE,GAAG,mBAAmB,EAAE,GAAG,MAAM,EAAE;AAChD,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,kBAAkB,GAAA;AAChC,IAAA,OAAO,MAAM,CAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,mBAAmB;AAChF;;AC9DA;;AAEG;AACI,MAAM,mBAAmB,GAAG,gBAAgB,CAAsB,QAAQ,CAAC;AAElF;;AAEG;MACU,kBAAkB,GAAG,mBAAmB,CAAC,mBAAmB;AAEzE;;AAEG;MACU,iBAAiB,GAAG,mBAAmB,CAAY,mBAAmB;AAEnF;;AAEG;AACI,MAAM,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC;;MCf9C,oBAAoB,CAAA;AAO/B,IAAA,WAAA,GAAA;;QALiB,IAAA,CAAA,MAAM,GAAG,iBAAiB,EAAE;;QAGpC,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,QAAQ,CAAC,wBAAwB,CAAC,CAAC;QAG7D,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,K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,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,iBAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,YAAA,EAAA,WAAA,EAAA,cAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,sBAAA,EAAA,0BAAA,EAAA,uBAAA,EAAA,2BAAA,EAAA,EAAA,EAAA,SAAA,EAXT,CAAC,kBAAkB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAAA,IAAA,CAAA,YAAA,EAAA,EAAA,EAAA,SAAA,EAAAC,EAAA,CAAA,gBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAWtB,SAAS,EAAA,UAAA,EAAA,CAAA;kBAdrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,SAAS,EAAE,CAAC,kBAAkB,EAAE,CAAC;AACjC,oBAAA,cAAc,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;AAChD,oBAAA,IAAI,EAAE;AACJ,wBAAA,QAAQ,EAAE,IAAI;AACd,wBAAA,MAAM,EAAE,YAAY;AACpB,wBAAA,aAAa,EAAE,cAAc;AAC7B,wBAAA,mBAAmB,EAAE,eAAe;AACpC,wBAAA,wBAAwB,EAAE,wBAAwB;AAClD,wBAAA,yBAAyB,EAAE,yBAAyB;AACrD,qBAAA;AACF,iBAAA;8BAyCW,OAAO,EAAA,CAAA;sBADhB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AC9DnC;;AAEG;;;;"}
|
|
@@ -383,7 +383,7 @@ class NgpMenuTrigger {
|
|
|
383
383
|
*/
|
|
384
384
|
this.config = injectMenuConfig();
|
|
385
385
|
/**
|
|
386
|
-
* Access the menu template ref.
|
|
386
|
+
* Access the menu template ref or ComponentType.
|
|
387
387
|
*/
|
|
388
388
|
this.menu = input(undefined, {
|
|
389
389
|
alias: 'ngpMenuTrigger',
|
|
@@ -457,11 +457,13 @@ class NgpMenuTrigger {
|
|
|
457
457
|
ngOnDestroy() {
|
|
458
458
|
this.overlay()?.destroy();
|
|
459
459
|
}
|
|
460
|
-
|
|
461
|
-
// if the trigger is disabled then do not toggle the menu
|
|
460
|
+
onClick(event) {
|
|
462
461
|
if (this.state.disabled()) {
|
|
463
462
|
return;
|
|
464
463
|
}
|
|
464
|
+
this.toggle(event);
|
|
465
|
+
}
|
|
466
|
+
toggle(event) {
|
|
465
467
|
// determine the origin of the event, 0 is keyboard, 1 is mouse
|
|
466
468
|
const origin = event.detail === 0 ? 'keyboard' : 'mouse';
|
|
467
469
|
// if the menu is open then hide it
|
|
@@ -476,10 +478,6 @@ class NgpMenuTrigger {
|
|
|
476
478
|
* Show the menu.
|
|
477
479
|
*/
|
|
478
480
|
show() {
|
|
479
|
-
// If the trigger is disabled, don't show the menu
|
|
480
|
-
if (this.state.disabled()) {
|
|
481
|
-
return;
|
|
482
|
-
}
|
|
483
481
|
// Create the overlay if it doesn't exist yet
|
|
484
482
|
if (!this.overlay()) {
|
|
485
483
|
this.createOverlay();
|
|
@@ -493,7 +491,7 @@ class NgpMenuTrigger {
|
|
|
493
491
|
*/
|
|
494
492
|
hide(origin = 'program') {
|
|
495
493
|
// If the trigger is disabled or the menu is not open, do nothing
|
|
496
|
-
if (
|
|
494
|
+
if (!this.open()) {
|
|
497
495
|
return;
|
|
498
496
|
}
|
|
499
497
|
// Hide the overlay
|
|
@@ -526,7 +524,7 @@ class NgpMenuTrigger {
|
|
|
526
524
|
this.overlay.set(createOverlay(config));
|
|
527
525
|
}
|
|
528
526
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
529
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpMenuTrigger, isStandalone: true, selector: "[ngpMenuTrigger]", inputs: { menu: { classPropertyName: "menu", publicName: "ngpMenuTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpMenuTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpMenuTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpMenuTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpMenuTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpMenuTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "ngpMenuTriggerScrollBehavior", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpMenuTriggerContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "click": "
|
|
527
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpMenuTrigger, isStandalone: true, selector: "[ngpMenuTrigger]", inputs: { menu: { classPropertyName: "menu", publicName: "ngpMenuTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpMenuTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpMenuTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpMenuTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpMenuTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpMenuTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "ngpMenuTriggerScrollBehavior", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpMenuTriggerContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "click": "onClick($event)" }, properties: { "attr.aria-expanded": "open() ? \"true\" : \"false\"", "attr.data-open": "open() ? \"\" : null", "attr.data-placement": "state.placement()" } }, providers: [provideMenuTriggerState({ inherit: false })], exportAs: ["ngpMenuTrigger"], ngImport: i0 }); }
|
|
530
528
|
}
|
|
531
529
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMenuTrigger, decorators: [{
|
|
532
530
|
type: Directive,
|
|
@@ -539,7 +537,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
|
539
537
|
'[attr.aria-expanded]': 'open() ? "true" : "false"',
|
|
540
538
|
'[attr.data-open]': 'open() ? "" : null',
|
|
541
539
|
'[attr.data-placement]': 'state.placement()',
|
|
542
|
-
'(click)': '
|
|
540
|
+
'(click)': 'onClick($event)',
|
|
543
541
|
},
|
|
544
542
|
}]
|
|
545
543
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-menu.mjs","sources":["../../../../packages/ng-primitives/menu/src/config/menu-config.ts","../../../../packages/ng-primitives/menu/src/menu/menu-token.ts","../../../../packages/ng-primitives/menu/src/submenu-trigger/submenu-trigger-state.ts","../../../../packages/ng-primitives/menu/src/submenu-trigger/submenu-trigger.ts","../../../../packages/ng-primitives/menu/src/menu-item/menu-item.ts","../../../../packages/ng-primitives/menu/src/menu-trigger/menu-trigger-state.ts","../../../../packages/ng-primitives/menu/src/menu-trigger/menu-trigger.ts","../../../../packages/ng-primitives/menu/src/menu/menu.ts","../../../../packages/ng-primitives/menu/src/ng-primitives-menu.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\n\nexport interface NgpMenuConfig {\n /**\n * Define the offset of the menu relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the menu relative to the trigger.\n * @default 'bottom-start'\n */\n placement: Placement;\n\n /**\n * Define whether the menu should flip when there is not enough space for the menu.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container element or selector in to which the menu should be attached.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n\n /**\n * Defines how the menu behaves when the window is scrolled.\n * @default scroll\n */\n scrollBehavior: 'reposition' | 'block';\n}\n\nexport const defaultMenuConfig: NgpMenuConfig = {\n offset: 4,\n placement: 'bottom-start',\n flip: true,\n container: 'body',\n scrollBehavior: 'block',\n};\n\nexport const NgpMenuConfigToken = new InjectionToken<NgpMenuConfig>('NgpMenuConfigToken');\n\n/**\n * Provide the default Menu configuration\n * @param config The Menu configuration\n * @returns The provider\n */\nexport function provideMenuConfig(config: Partial<NgpMenuConfig>): Provider[] {\n return [\n {\n provide: NgpMenuConfigToken,\n useValue: { ...defaultMenuConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Menu configuration\n * @returns The global Menu configuration\n */\nexport function injectMenuConfig(): NgpMenuConfig {\n return inject(NgpMenuConfigToken, { optional: true }) ?? defaultMenuConfig;\n}\n","import { ExistingProvider, inject, InjectionToken, Type } from '@angular/core';\nimport type { NgpMenu } from './menu';\n\nexport const NgpMenuToken = new InjectionToken<NgpMenu>('NgpMenuToken');\n\n/**\n * Inject the Menu directive instance\n */\nexport function injectMenu(): NgpMenu {\n return inject(NgpMenuToken);\n}\n\n/**\n * Provide the Menu directive instance\n */\nexport function provideMenu(type: Type<NgpMenu>): ExistingProvider {\n return { provide: NgpMenuToken, useExisting: type };\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpSubmenuTrigger } from './submenu-trigger';\n\n/**\n * The state token for the SubmenuTrigger primitive.\n */\nexport const NgpSubmenuTriggerStateToken = createStateToken<NgpSubmenuTrigger>('SubmenuTrigger');\n\n/**\n * Provides the SubmenuTrigger state.\n */\nexport const provideSubmenuTriggerState = createStateProvider(NgpSubmenuTriggerStateToken);\n\n/**\n * Injects the SubmenuTrigger state.\n */\nexport const injectSubmenuTriggerState = createStateInjector<NgpSubmenuTrigger>(\n NgpSubmenuTriggerStateToken,\n);\n\n/**\n * The SubmenuTrigger state registration function.\n */\nexport const submenuTriggerState = createState(NgpSubmenuTriggerStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n input,\n numberAttribute,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { NgpMenuToken } from '../menu/menu-token';\nimport { provideSubmenuTriggerState, submenuTriggerState } from './submenu-trigger-state';\n\n@Directive({\n selector: '[ngpSubmenuTrigger]',\n exportAs: 'ngpSubmenuTrigger',\n providers: [provideSubmenuTriggerState({ inherit: false })],\n host: {\n 'aria-haspopup': 'true',\n '[attr.aria-expanded]': 'open() ? \"true\" : \"false\"',\n '[attr.data-open]': 'open() ? \"\" : null',\n '(click)': 'toggle($event)',\n },\n})\nexport class NgpSubmenuTrigger<T = unknown> {\n /**\n * Access the menu trigger element.\n */\n private readonly trigger = injectElementRef();\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /** Access the parent menu */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true });\n\n /**\n * Access the submenu template ref.\n */\n readonly menu = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpSubmenuTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSubmenuTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the menu relative to the trigger.\n * @default 'right-start'\n */\n readonly placement = input<Placement>('right-start', {\n alias: 'ngpSubmenuTriggerPlacement',\n });\n\n /**\n * Define the offset of the menu relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(0, {\n alias: 'ngpSubmenuTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the menu should flip when there is not enough space for the menu.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(true, {\n alias: 'ngpSubmenuTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * The overlay that manages the menu\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the menu.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Access the menu trigger state.\n */\n readonly state = submenuTriggerState<NgpSubmenuTrigger<T>>(this);\n\n constructor() {\n this.parentMenu?.closeSubmenus.pipe(safeTakeUntilDestroyed()).subscribe(element => {\n // if the element is not the trigger, we want to close the menu\n if (element === this.trigger.nativeElement) {\n return;\n }\n\n this.hide('mouse');\n });\n }\n\n protected toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the menu\n if (this.state.disabled()) {\n return;\n }\n\n // determine the origin of the event, 0 is keyboard, 1 is mouse\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if the menu is open then hide it\n if (this.open()) {\n this.hide(origin);\n } else {\n this.show();\n }\n }\n\n /**\n * Show the menu.\n */\n show(): void {\n // If the trigger is disabled, don't show the menu\n if (this.state.disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n this.overlay()?.show();\n }\n\n /**\n * @internal\n * Hide the menu.\n */\n hide(origin: FocusOrigin = 'program'): void {\n // If the trigger is disabled or the menu is not open, do nothing\n if (this.state.disabled() || !this.open()) {\n return;\n }\n\n // Hide the overlay\n this.overlay()?.hide({ origin });\n }\n\n /**\n * Create the overlay that will contain the menu\n */\n private createOverlay(): void {\n const menu = this.state.menu();\n\n if (!menu) {\n throw new Error('Menu must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: menu,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: true,\n viewContainerRef: this.viewContainerRef,\n };\n\n this.overlay.set(createOverlay(config));\n }\n\n /**\n * If the user presses the right arrow key, we want to open the submenu\n * and focus the first item in the submenu.\n * This behavior will be inverted if the direction is RTL.\n * @param event\n */\n @HostListener('keydown.ArrowRight', ['$event'])\n @HostListener('keydown.ArrowLeft', ['$event'])\n protected showSubmenuOnArrow(event: KeyboardEvent): void {\n const direction = getComputedStyle(this.trigger.nativeElement).direction;\n\n const isRtl = direction === 'rtl';\n\n const isRightArrow = event.key === 'ArrowRight';\n const isLeftArrow = event.key === 'ArrowLeft';\n\n if ((isRightArrow && !isRtl) || (isLeftArrow && isRtl)) {\n event.preventDefault();\n this.show();\n }\n }\n\n /**\n * If the user hovers over the trigger, we want to open the submenu\n */\n @HostListener('pointerenter', ['$event'])\n protected showSubmenuOnHover(event: PointerEvent): void {\n // if this was triggered by a touch event, we don't want to show the submenu\n // as it will be shown by the click event - this prevents the submenu from being toggled\n if (event.pointerType === 'touch') {\n return;\n }\n\n this.show();\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, inject, Injector, input } from '@angular/core';\nimport { setupButton } from 'ng-primitives/button';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectMenu } from '../menu/menu-token';\nimport { NgpSubmenuTrigger } from '../submenu-trigger/submenu-trigger';\n\n/**\n * The `NgpMenuItem` directive represents a menu item.\n */\n@Directive({\n selector: '[ngpMenuItem]',\n exportAs: 'ngpMenuItem',\n hostDirectives: [\n { directive: NgpRovingFocusItem, inputs: ['ngpRovingFocusItemDisabled: ngpMenuItemDisabled'] },\n ],\n host: {\n role: 'menuitem',\n '(click)': 'onClick($event)',\n '(keydown.ArrowLeft)': 'handleArrowKey($event)',\n '(keydown.ArrowRight)': 'handleArrowKey($event)',\n },\n})\nexport class NgpMenuItem {\n /** Access the injector */\n private readonly injector = inject(Injector);\n /** Access the button element */\n private readonly elementRef = injectElementRef();\n\n /** Access the parent menu */\n private readonly parentMenu = injectMenu();\n\n /** Whether the menu item is disabled */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpMenuItemDisabled',\n transform: booleanAttribute,\n });\n\n constructor() {\n setupButton({ disabled: this.disabled });\n }\n\n /** Close the menu when the item is clicked */\n protected onClick(event: MouseEvent): void {\n // we do this here to avoid circular dependency issues\n const trigger = this.injector.get(NgpSubmenuTrigger, null, { self: true, optional: true });\n\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if this is a submenu trigger, we don't want to close the menu, we want to open the submenu\n if (!trigger) {\n this.parentMenu?.closeAllMenus(origin);\n }\n }\n\n /**\n * If the user presses the left arrow key (in LTR) and there is a parent menu,\n * we want to close the menu and focus the parent menu item.\n */\n protected handleArrowKey(event: KeyboardEvent): void {\n // if there is no parent menu, we don't want to do anything\n const trigger = this.injector.get(NgpSubmenuTrigger, null, { optional: true });\n\n if (!trigger) {\n return;\n }\n\n const direction = getComputedStyle(this.elementRef.nativeElement).direction;\n const isRtl = direction === 'rtl';\n\n const isLeftArrow = event.key === 'ArrowLeft';\n const isRightArrow = event.key === 'ArrowRight';\n\n if ((isLeftArrow && !isRtl) || (isRightArrow && isRtl)) {\n event.preventDefault();\n\n if (trigger) {\n trigger.hide('keyboard');\n }\n }\n }\n\n /**\n * If the user hovers over the trigger, we want to open the submenu\n */\n @HostListener('mouseenter')\n protected showSubmenuOnHover(): void {\n this.parentMenu?.closeSubmenus.next(this.elementRef.nativeElement);\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpMenuTrigger } from './menu-trigger';\n\n/**\n * The state token for the MenuTrigger primitive.\n */\nexport const NgpMenuTriggerStateToken = createStateToken<NgpMenuTrigger>('MenuTrigger');\n\n/**\n * Provides the MenuTrigger state.\n */\nexport const provideMenuTriggerState = createStateProvider(NgpMenuTriggerStateToken);\n\n/**\n * Injects the MenuTrigger state.\n */\nexport const injectMenuTriggerState = createStateInjector<NgpMenuTrigger>(NgpMenuTriggerStateToken);\n\n/**\n * The MenuTrigger state registration function.\n */\nexport const menuTriggerState = createState(NgpMenuTriggerStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { injectMenuConfig } from '../config/menu-config';\nimport { menuTriggerState, provideMenuTriggerState } from './menu-trigger-state';\n\n/**\n * The `NgpMenuTrigger` directive allows you to turn an element into a menu trigger.\n */\n@Directive({\n selector: '[ngpMenuTrigger]',\n exportAs: 'ngpMenuTrigger',\n providers: [provideMenuTriggerState({ inherit: false })],\n host: {\n 'aria-haspopup': 'true',\n '[attr.aria-expanded]': 'open() ? \"true\" : \"false\"',\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-placement]': 'state.placement()',\n '(click)': 'toggle($event)',\n },\n})\nexport class NgpMenuTrigger<T = unknown> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = injectElementRef();\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global menu configuration.\n */\n private readonly config = injectMenuConfig();\n\n /**\n * Access the menu template ref.\n */\n readonly menu = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpMenuTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpMenuTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the menu relative to the trigger.\n * @default 'bottom-start'\n */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpMenuTriggerPlacement',\n });\n\n /**\n * Define the offset of the menu relative to the trigger.\n * @default 4\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpMenuTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the menu should flip when there is not enough space for the menu.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpMenuTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the menu should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpMenuTriggerContainer',\n });\n\n /**\n * Defines how the menu behaves when the window is scrolled.\n * @default 'block'\n */\n readonly scrollBehavior = input<'reposition' | 'block'>(this.config.scrollBehavior, {\n alias: 'ngpMenuTriggerScrollBehavior',\n });\n\n /**\n * Provide context to the menu. This can be used to pass data to the menu content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpMenuTriggerContext',\n });\n\n /**\n * The overlay that manages the menu\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the menu.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * The menu trigger state.\n */\n readonly state = menuTriggerState<NgpMenuTrigger<T>>(this);\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n protected toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the menu\n if (this.state.disabled()) {\n return;\n }\n\n // determine the origin of the event, 0 is keyboard, 1 is mouse\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if the menu is open then hide it\n if (this.open()) {\n this.hide(origin);\n } else {\n this.show();\n }\n }\n\n /**\n * Show the menu.\n */\n show(): void {\n // If the trigger is disabled, don't show the menu\n if (this.state.disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n this.overlay()?.show();\n }\n\n /**\n * @internal\n * Hide the menu.\n */\n hide(origin: FocusOrigin = 'program'): void {\n // If the trigger is disabled or the menu is not open, do nothing\n if (this.state.disabled() || !this.open()) {\n return;\n }\n\n // Hide the overlay\n this.overlay()?.hide({ origin });\n }\n\n /**\n * Create the overlay that will contain the menu\n */\n private createOverlay(): void {\n const menu = this.state.menu();\n\n if (!menu) {\n throw new Error('Menu must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: menu,\n triggerElement: this.trigger.nativeElement,\n viewContainerRef: this.viewContainerRef,\n injector: this.injector,\n context: this.state.context,\n container: this.state.container(),\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: true,\n scrollBehaviour: this.state.scrollBehavior(),\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Directive, inject } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { injectOverlay } from 'ng-primitives/portal';\nimport { NgpRovingFocusGroup, provideRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { Subject } from 'rxjs';\nimport { injectMenuTriggerState } from '../menu-trigger/menu-trigger-state';\nimport { NgpMenuToken, provideMenu } from './menu-token';\n\n/**\n * The `NgpMenu` is a container for menu items.\n */\n@Directive({\n selector: '[ngpMenu]',\n exportAs: 'ngpMenu',\n hostDirectives: [NgpRovingFocusGroup, NgpFocusTrap],\n providers: [\n // ensure we don't inherit the focus group from the parent menu if there is one\n provideRovingFocusGroup(NgpRovingFocusGroup, { inherit: false }),\n provideMenu(NgpMenu),\n ],\n host: {\n role: 'menu',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-menu-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-menu-transform-origin]': 'overlay.transformOrigin()',\n '[attr.data-placement]': 'overlay.finalPlacement()',\n 'data-overlay': '',\n },\n})\nexport class NgpMenu {\n /** Access the overlay. */\n protected readonly overlay = injectOverlay();\n\n /** Access the menu trigger state */\n private readonly menuTrigger = injectMenuTriggerState();\n\n /** Access any parent menus */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true, skipSelf: true });\n\n /** @internal Whether we should close submenus */\n readonly closeSubmenus = new Subject<HTMLElement>();\n\n /** @internal Close the menu and any parent menus */\n closeAllMenus(origin: FocusOrigin): void {\n this.menuTrigger().hide(origin);\n this.parentMenu?.closeAllMenus(origin);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAmCO,MAAM,iBAAiB,GAAkB;AAC9C,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,cAAc;AACzB,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,cAAc,EAAE,OAAO;CACxB;AAEM,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,CA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oBAAA,QAAQ,EAAE,SAAS;AACnB,oBAAA,cAAc,EAAE,CAAC,mBAAmB,EAAE,YAAY,CAAC;AACnD,oBAAA,SAAS,EAAE;;wBAET,uBAAuB,CAAC,mBAAmB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAChE,wBAAA,WAAW,CAAA,OAAA,CAAS;AACrB,qBAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,MAAM;AACZ,wBAAA,iBAAiB,EAAE,sBAAsB;AACzC,wBAAA,gBAAgB,EAAE,sBAAsB;AACxC,wBAAA,qCAAqC,EAAE,wBAAwB;AAC/D,wBAAA,qCAAqC,EAAE,2BAA2B;AAClE,wBAAA,uBAAuB,EAAE,0BAA0B;AACnD,wBAAA,cAAc,EAAE,EAAE;AACnB,qBAAA;AACF,iBAAA;;;AC9BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-menu.mjs","sources":["../../../../packages/ng-primitives/menu/src/config/menu-config.ts","../../../../packages/ng-primitives/menu/src/menu/menu-token.ts","../../../../packages/ng-primitives/menu/src/submenu-trigger/submenu-trigger-state.ts","../../../../packages/ng-primitives/menu/src/submenu-trigger/submenu-trigger.ts","../../../../packages/ng-primitives/menu/src/menu-item/menu-item.ts","../../../../packages/ng-primitives/menu/src/menu-trigger/menu-trigger-state.ts","../../../../packages/ng-primitives/menu/src/menu-trigger/menu-trigger.ts","../../../../packages/ng-primitives/menu/src/menu/menu.ts","../../../../packages/ng-primitives/menu/src/ng-primitives-menu.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport type { NgpMenuPlacement } from '../menu-trigger/menu-trigger';\n\nexport interface NgpMenuConfig {\n /**\n * Define the offset of the menu relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the menu relative to the trigger.\n * @default 'bottom-start'\n */\n placement: NgpMenuPlacement;\n\n /**\n * Define whether the menu should flip when there is not enough space for the menu.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container element or selector in to which the menu should be attached.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n\n /**\n * Defines how the menu behaves when the window is scrolled.\n * @default scroll\n */\n scrollBehavior: 'reposition' | 'block';\n}\n\nexport const defaultMenuConfig: NgpMenuConfig = {\n offset: 4,\n placement: 'bottom-start',\n flip: true,\n container: 'body',\n scrollBehavior: 'block',\n};\n\nexport const NgpMenuConfigToken = new InjectionToken<NgpMenuConfig>('NgpMenuConfigToken');\n\n/**\n * Provide the default Menu configuration\n * @param config The Menu configuration\n * @returns The provider\n */\nexport function provideMenuConfig(config: Partial<NgpMenuConfig>): Provider[] {\n return [\n {\n provide: NgpMenuConfigToken,\n useValue: { ...defaultMenuConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Menu configuration\n * @returns The global Menu configuration\n */\nexport function injectMenuConfig(): NgpMenuConfig {\n return inject(NgpMenuConfigToken, { optional: true }) ?? defaultMenuConfig;\n}\n","import { ExistingProvider, inject, InjectionToken, Type } from '@angular/core';\nimport type { NgpMenu } from './menu';\n\nexport const NgpMenuToken = new InjectionToken<NgpMenu>('NgpMenuToken');\n\n/**\n * Inject the Menu directive instance\n */\nexport function injectMenu(): NgpMenu {\n return inject(NgpMenuToken);\n}\n\n/**\n * Provide the Menu directive instance\n */\nexport function provideMenu(type: Type<NgpMenu>): ExistingProvider {\n return { provide: NgpMenuToken, useExisting: type };\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpSubmenuTrigger } from './submenu-trigger';\n\n/**\n * The state token for the SubmenuTrigger primitive.\n */\nexport const NgpSubmenuTriggerStateToken = createStateToken<NgpSubmenuTrigger>('SubmenuTrigger');\n\n/**\n * Provides the SubmenuTrigger state.\n */\nexport const provideSubmenuTriggerState = createStateProvider(NgpSubmenuTriggerStateToken);\n\n/**\n * Injects the SubmenuTrigger state.\n */\nexport const injectSubmenuTriggerState = createStateInjector<NgpSubmenuTrigger>(\n NgpSubmenuTriggerStateToken,\n);\n\n/**\n * The SubmenuTrigger state registration function.\n */\nexport const submenuTriggerState = createState(NgpSubmenuTriggerStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n input,\n numberAttribute,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { NgpMenuPlacement } from '../menu-trigger/menu-trigger';\nimport { NgpMenuToken } from '../menu/menu-token';\nimport { provideSubmenuTriggerState, submenuTriggerState } from './submenu-trigger-state';\n\n@Directive({\n selector: '[ngpSubmenuTrigger]',\n exportAs: 'ngpSubmenuTrigger',\n providers: [provideSubmenuTriggerState({ inherit: false })],\n host: {\n 'aria-haspopup': 'true',\n '[attr.aria-expanded]': 'open() ? \"true\" : \"false\"',\n '[attr.data-open]': 'open() ? \"\" : null',\n '(click)': 'toggle($event)',\n },\n})\nexport class NgpSubmenuTrigger<T = unknown> {\n /**\n * Access the menu trigger element.\n */\n private readonly trigger = injectElementRef();\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /** Access the parent menu */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true });\n\n /**\n * Access the submenu template ref.\n */\n readonly menu = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpSubmenuTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSubmenuTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the menu relative to the trigger.\n * @default 'right-start'\n */\n readonly placement = input<NgpMenuPlacement>('right-start', {\n alias: 'ngpSubmenuTriggerPlacement',\n });\n\n /**\n * Define the offset of the menu relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(0, {\n alias: 'ngpSubmenuTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the menu should flip when there is not enough space for the menu.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(true, {\n alias: 'ngpSubmenuTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * The overlay that manages the menu\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the menu.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Access the menu trigger state.\n */\n readonly state = submenuTriggerState<NgpSubmenuTrigger<T>>(this);\n\n constructor() {\n this.parentMenu?.closeSubmenus.pipe(safeTakeUntilDestroyed()).subscribe(element => {\n // if the element is not the trigger, we want to close the menu\n if (element === this.trigger.nativeElement) {\n return;\n }\n\n this.hide('mouse');\n });\n }\n\n protected toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the menu\n if (this.state.disabled()) {\n return;\n }\n\n // determine the origin of the event, 0 is keyboard, 1 is mouse\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if the menu is open then hide it\n if (this.open()) {\n this.hide(origin);\n } else {\n this.show();\n }\n }\n\n /**\n * Show the menu.\n */\n show(): void {\n // If the trigger is disabled, don't show the menu\n if (this.state.disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n this.overlay()?.show();\n }\n\n /**\n * @internal\n * Hide the menu.\n */\n hide(origin: FocusOrigin = 'program'): void {\n // If the trigger is disabled or the menu is not open, do nothing\n if (this.state.disabled() || !this.open()) {\n return;\n }\n\n // Hide the overlay\n this.overlay()?.hide({ origin });\n }\n\n /**\n * Create the overlay that will contain the menu\n */\n private createOverlay(): void {\n const menu = this.state.menu();\n\n if (!menu) {\n throw new Error('Menu must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: menu,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: true,\n viewContainerRef: this.viewContainerRef,\n };\n\n this.overlay.set(createOverlay(config));\n }\n\n /**\n * If the user presses the right arrow key, we want to open the submenu\n * and focus the first item in the submenu.\n * This behavior will be inverted if the direction is RTL.\n * @param event\n */\n @HostListener('keydown.ArrowRight', ['$event'])\n @HostListener('keydown.ArrowLeft', ['$event'])\n protected showSubmenuOnArrow(event: KeyboardEvent): void {\n const direction = getComputedStyle(this.trigger.nativeElement).direction;\n\n const isRtl = direction === 'rtl';\n\n const isRightArrow = event.key === 'ArrowRight';\n const isLeftArrow = event.key === 'ArrowLeft';\n\n if ((isRightArrow && !isRtl) || (isLeftArrow && isRtl)) {\n event.preventDefault();\n this.show();\n }\n }\n\n /**\n * If the user hovers over the trigger, we want to open the submenu\n */\n @HostListener('pointerenter', ['$event'])\n protected showSubmenuOnHover(event: PointerEvent): void {\n // if this was triggered by a touch event, we don't want to show the submenu\n // as it will be shown by the click event - this prevents the submenu from being toggled\n if (event.pointerType === 'touch') {\n return;\n }\n\n this.show();\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, inject, Injector, input } from '@angular/core';\nimport { setupButton } from 'ng-primitives/button';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectMenu } from '../menu/menu-token';\nimport { NgpSubmenuTrigger } from '../submenu-trigger/submenu-trigger';\n\n/**\n * The `NgpMenuItem` directive represents a menu item.\n */\n@Directive({\n selector: '[ngpMenuItem]',\n exportAs: 'ngpMenuItem',\n hostDirectives: [\n { directive: NgpRovingFocusItem, inputs: ['ngpRovingFocusItemDisabled: ngpMenuItemDisabled'] },\n ],\n host: {\n role: 'menuitem',\n '(click)': 'onClick($event)',\n '(keydown.ArrowLeft)': 'handleArrowKey($event)',\n '(keydown.ArrowRight)': 'handleArrowKey($event)',\n },\n})\nexport class NgpMenuItem {\n /** Access the injector */\n private readonly injector = inject(Injector);\n /** Access the button element */\n private readonly elementRef = injectElementRef();\n\n /** Access the parent menu */\n private readonly parentMenu = injectMenu();\n\n /** Whether the menu item is disabled */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpMenuItemDisabled',\n transform: booleanAttribute,\n });\n\n constructor() {\n setupButton({ disabled: this.disabled });\n }\n\n /** Close the menu when the item is clicked */\n protected onClick(event: MouseEvent): void {\n // we do this here to avoid circular dependency issues\n const trigger = this.injector.get(NgpSubmenuTrigger, null, { self: true, optional: true });\n\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if this is a submenu trigger, we don't want to close the menu, we want to open the submenu\n if (!trigger) {\n this.parentMenu?.closeAllMenus(origin);\n }\n }\n\n /**\n * If the user presses the left arrow key (in LTR) and there is a parent menu,\n * we want to close the menu and focus the parent menu item.\n */\n protected handleArrowKey(event: KeyboardEvent): void {\n // if there is no parent menu, we don't want to do anything\n const trigger = this.injector.get(NgpSubmenuTrigger, null, { optional: true });\n\n if (!trigger) {\n return;\n }\n\n const direction = getComputedStyle(this.elementRef.nativeElement).direction;\n const isRtl = direction === 'rtl';\n\n const isLeftArrow = event.key === 'ArrowLeft';\n const isRightArrow = event.key === 'ArrowRight';\n\n if ((isLeftArrow && !isRtl) || (isRightArrow && isRtl)) {\n event.preventDefault();\n\n if (trigger) {\n trigger.hide('keyboard');\n }\n }\n }\n\n /**\n * If the user hovers over the trigger, we want to open the submenu\n */\n @HostListener('mouseenter')\n protected showSubmenuOnHover(): void {\n this.parentMenu?.closeSubmenus.next(this.elementRef.nativeElement);\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpMenuTrigger } from './menu-trigger';\n\n/**\n * The state token for the MenuTrigger primitive.\n */\nexport const NgpMenuTriggerStateToken = createStateToken<NgpMenuTrigger>('MenuTrigger');\n\n/**\n * Provides the MenuTrigger state.\n */\nexport const provideMenuTriggerState = createStateProvider(NgpMenuTriggerStateToken);\n\n/**\n * Injects the MenuTrigger state.\n */\nexport const injectMenuTriggerState = createStateInjector<NgpMenuTrigger>(NgpMenuTriggerStateToken);\n\n/**\n * The MenuTrigger state registration function.\n */\nexport const menuTriggerState = createState(NgpMenuTriggerStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { injectMenuConfig } from '../config/menu-config';\nimport { menuTriggerState, provideMenuTriggerState } from './menu-trigger-state';\n\n/**\n * The `NgpMenuTrigger` directive allows you to turn an element into a menu trigger.\n */\n@Directive({\n selector: '[ngpMenuTrigger]',\n exportAs: 'ngpMenuTrigger',\n providers: [provideMenuTriggerState({ inherit: false })],\n host: {\n 'aria-haspopup': 'true',\n '[attr.aria-expanded]': 'open() ? \"true\" : \"false\"',\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-placement]': 'state.placement()',\n '(click)': 'onClick($event)',\n },\n})\nexport class NgpMenuTrigger<T = unknown> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = injectElementRef();\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global menu configuration.\n */\n private readonly config = injectMenuConfig();\n\n /**\n * Access the menu template ref or ComponentType.\n */\n readonly menu = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpMenuTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpMenuTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the menu relative to the trigger.\n * @default 'bottom-start'\n */\n readonly placement = input<NgpMenuPlacement>(this.config.placement, {\n alias: 'ngpMenuTriggerPlacement',\n });\n\n /**\n * Define the offset of the menu relative to the trigger.\n * @default 4\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpMenuTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the menu should flip when there is not enough space for the menu.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpMenuTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the menu should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpMenuTriggerContainer',\n });\n\n /**\n * Defines how the menu behaves when the window is scrolled.\n * @default 'block'\n */\n readonly scrollBehavior = input<'reposition' | 'block'>(this.config.scrollBehavior, {\n alias: 'ngpMenuTriggerScrollBehavior',\n });\n\n /**\n * Provide context to the menu. This can be used to pass data to the menu content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpMenuTriggerContext',\n });\n\n /**\n * The overlay that manages the menu\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the menu.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * The menu trigger state.\n */\n readonly state = menuTriggerState<NgpMenuTrigger<T>>(this);\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n protected onClick(event: MouseEvent): void {\n if (this.state.disabled()) {\n return;\n }\n this.toggle(event);\n }\n\n toggle(event: MouseEvent): void {\n // determine the origin of the event, 0 is keyboard, 1 is mouse\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if the menu is open then hide it\n if (this.open()) {\n this.hide(origin);\n } else {\n this.show();\n }\n }\n\n /**\n * Show the menu.\n */\n show(): void {\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n this.overlay()?.show();\n }\n\n /**\n * @internal\n * Hide the menu.\n */\n hide(origin: FocusOrigin = 'program'): void {\n // If the trigger is disabled or the menu is not open, do nothing\n if (!this.open()) {\n return;\n }\n\n // Hide the overlay\n this.overlay()?.hide({ origin });\n }\n\n /**\n * Create the overlay that will contain the menu\n */\n private createOverlay(): void {\n const menu = this.state.menu();\n\n if (!menu) {\n throw new Error('Menu must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: menu,\n triggerElement: this.trigger.nativeElement,\n viewContainerRef: this.viewContainerRef,\n injector: this.injector,\n context: this.state.context,\n container: this.state.container(),\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: true,\n scrollBehaviour: this.state.scrollBehavior(),\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n\nexport type NgpMenuPlacement =\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'top-start'\n | 'top-end'\n | 'right-start'\n | 'right-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end';\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Directive, inject } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { injectOverlay } from 'ng-primitives/portal';\nimport { NgpRovingFocusGroup, provideRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { Subject } from 'rxjs';\nimport { injectMenuTriggerState } from '../menu-trigger/menu-trigger-state';\nimport { NgpMenuToken, provideMenu } from './menu-token';\n\n/**\n * The `NgpMenu` is a container for menu items.\n */\n@Directive({\n selector: '[ngpMenu]',\n exportAs: 'ngpMenu',\n hostDirectives: [NgpRovingFocusGroup, NgpFocusTrap],\n providers: [\n // ensure we don't inherit the focus group from the parent menu if there is one\n provideRovingFocusGroup(NgpRovingFocusGroup, { inherit: false }),\n provideMenu(NgpMenu),\n ],\n host: {\n role: 'menu',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-menu-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-menu-transform-origin]': 'overlay.transformOrigin()',\n '[attr.data-placement]': 'overlay.finalPlacement()',\n 'data-overlay': '',\n },\n})\nexport class NgpMenu {\n /** Access the overlay. */\n protected readonly overlay = injectOverlay();\n\n /** Access the menu trigger state */\n private readonly menuTrigger = injectMenuTriggerState();\n\n /** Access any parent menus */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true, skipSelf: true });\n\n /** @internal Whether we should close submenus */\n readonly closeSubmenus = new Subject<HTMLElement>();\n\n /** @internal Close the menu and any parent menus */\n closeAllMenus(origin: FocusOrigin): void {\n this.menuTrigger().hide(origin);\n this.parentMenu?.closeAllMenus(origin);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAmCO,MAAM,iBAAiB,GAAkB;AAC9C,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,cAAc;AACzB,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,cAAc,EAAE,OAAO;CACxB;AAEM,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,CAAC;AAEzF;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,MAA8B,EAAA;IAC9D,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,kBA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mB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAChE,wBAAA,WAAW,CAAA,OAAA,CAAS;AACrB,qBAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,MAAM;AACZ,wBAAA,iBAAiB,EAAE,sBAAsB;AACzC,wBAAA,gBAAgB,EAAE,sBAAsB;AACxC,wBAAA,qCAAqC,EAAE,wBAAwB;AAC/D,wBAAA,qCAAqC,EAAE,2BAA2B;AAClE,wBAAA,uBAAuB,EAAE,0BAA0B;AACnD,wBAAA,cAAc,EAAE,EAAE;AACnB,qBAAA;AACF,iBAAA;;;AC9BD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-popover.mjs","sources":["../../../../packages/ng-primitives/popover/src/config/popover-config.ts","../../../../packages/ng-primitives/popover/src/popover-arrow/popover-arrow.ts","../../../../packages/ng-primitives/popover/src/popover-trigger/popover-trigger-state.ts","../../../../packages/ng-primitives/popover/src/popover-trigger/popover-trigger.ts","../../../../packages/ng-primitives/popover/src/popover/popover.ts","../../../../packages/ng-primitives/popover/src/ng-primitives-popover.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\n\nexport interface NgpPopoverConfig {\n /**\n * Define the offset of the popover relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the popover relative to the trigger.\n * @default 'bottom'\n */\n placement: Placement;\n\n /**\n * Define the delay before the popover is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the popover is hidden.\n * @default 0\n */\n hideDelay: number;\n\n /**\n * Define whether the popover should flip when there is not enough space for the popover.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container element or selector in to which the popover should be attached.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n\n /**\n * Define whether the popover should close when clicking outside of it.\n * @default true\n */\n closeOnOutsideClick: boolean;\n\n /**\n * Define whether the popover should close when the escape key is pressed.\n * @default true\n */\n closeOnEscape: boolean;\n\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default scroll\n */\n scrollBehavior: 'reposition' | 'block';\n}\n\nexport const defaultPopoverConfig: NgpPopoverConfig = {\n offset: 4,\n placement: 'bottom',\n showDelay: 0,\n hideDelay: 0,\n flip: true,\n container: 'body',\n closeOnOutsideClick: true,\n closeOnEscape: true,\n scrollBehavior: 'reposition',\n};\n\nexport const NgpPopoverConfigToken = new InjectionToken<NgpPopoverConfig>('NgpPopoverConfigToken');\n\n/**\n * Provide the default Popover configuration\n * @param config The Popover configuration\n * @returns The provider\n */\nexport function providePopoverConfig(config: Partial<NgpPopoverConfig>): Provider[] {\n return [\n {\n provide: NgpPopoverConfigToken,\n useValue: { ...defaultPopoverConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Popover configuration\n * @returns The global Popover configuration\n */\nexport function injectPopoverConfig(): NgpPopoverConfig {\n return inject(NgpPopoverConfigToken, { optional: true }) ?? defaultPopoverConfig;\n}\n","import { Directive } from '@angular/core';\nimport { setupOverlayArrow } from 'ng-primitives/portal';\n\n@Directive({\n selector: '[ngpPopoverArrow]',\n exportAs: 'ngpPopoverArrow',\n})\nexport class NgpPopoverArrow {\n constructor() {\n setupOverlayArrow();\n }\n}\n","import { InjectOptions, Signal } from '@angular/core';\nimport {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n State,\n} from 'ng-primitives/state';\nimport type { NgpPopoverTrigger } from './popover-trigger';\n\n/**\n * The state token for the PopoverTrigger primitive.\n */\nexport const NgpPopoverTriggerStateToken = createStateToken<NgpPopoverTrigger>('PopoverTrigger');\n\n/**\n * Provides the PopoverTrigger state.\n */\nexport const providePopoverTriggerState = createStateProvider(NgpPopoverTriggerStateToken);\n\n/**\n * Injects the PopoverTrigger state.\n */\nexport const injectPopoverTriggerState = createStateInjector<NgpPopoverTrigger>(\n NgpPopoverTriggerStateToken,\n) as <T>(options?: InjectOptions) => Signal<State<NgpPopoverTrigger<T>>>;\n\n/**\n * The PopoverTrigger state registration function.\n */\nexport const popoverTriggerState = createState(NgpPopoverTriggerStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n output,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { injectPopoverConfig } from '../config/popover-config';\nimport { popoverTriggerState, providePopoverTriggerState } from './popover-trigger-state';\n\n/**\n * Apply the `ngpPopoverTrigger` directive to an element that triggers the popover to show.\n */\n@Directive({\n selector: '[ngpPopoverTrigger]',\n exportAs: 'ngpPopoverTrigger',\n providers: [providePopoverTriggerState({ inherit: false })],\n host: {\n '[attr.aria-expanded]': 'open() ? \"true\" : \"false\"',\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-placement]': 'state.placement()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.aria-describedby]': 'overlay()?.ariaDescribedBy()',\n '(click)': 'toggle($event)',\n },\n})\nexport class NgpPopoverTrigger<T = null> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = injectElementRef();\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global popover configuration.\n */\n private readonly config = injectPopoverConfig();\n\n /**\n * Access the popover template ref.\n */\n readonly popover = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpPopoverTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPopoverTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the popover relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpPopoverTriggerPlacement',\n });\n\n /**\n * Define the offset of the popover relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpPopoverTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the popover is displayed.\n * @default 0\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpPopoverTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the popover is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpPopoverTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the popover should flip when there is not enough space for the popover.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpPopoverTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the popover should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpPopoverTriggerContainer',\n });\n\n /**\n * Define whether the popover should close when clicking outside of it.\n * @default true\n */\n readonly closeOnOutsideClick = input<boolean, BooleanInput>(this.config.closeOnOutsideClick, {\n alias: 'ngpPopoverTriggerCloseOnOutsideClick',\n transform: booleanAttribute,\n });\n\n /**\n * Define whether the popover should close when the escape key is pressed.\n * @default true\n */\n readonly closeOnEscape = input<boolean, BooleanInput>(this.config.closeOnEscape, {\n alias: 'ngpPopoverTriggerCloseOnEscape',\n transform: booleanAttribute,\n });\n\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior = input<'reposition' | 'block'>(this.config.scrollBehavior, {\n alias: 'ngpPopoverTriggerScrollBehavior',\n });\n\n /**\n * Provide context to the popover. This can be used to pass data to the popover content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpPopoverTriggerContext',\n });\n\n /**\n * The overlay that manages the popover\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the popover.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Event emitted when the popover open state changes.\n */\n readonly openChange = output<boolean>({\n alias: 'ngpPopoverTriggerOpenChange',\n });\n\n /**\n * The popover trigger state.\n */\n readonly state = popoverTriggerState<NgpPopoverTrigger<T>>(this);\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n protected toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the popover\n if (this.state.disabled()) {\n return;\n }\n\n // determine the origin of the event, 0 is keyboard, 1 is mouse\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if the popover is open then hide it\n if (this.open()) {\n this.hide(origin);\n } else {\n this.show();\n }\n }\n\n /**\n * Show the popover.\n * @returns A promise that resolves when the popover has been shown\n */\n async show(): Promise<void> {\n // If the trigger is disabled, don't show the popover\n if (this.state.disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n await this.overlay()?.show();\n\n if (this.open()) {\n this.openChange.emit(true);\n }\n }\n\n /**\n * @internal\n * Hide the popover.\n * @returns A promise that resolves when the popover has been hidden\n */\n async hide(origin: FocusOrigin = 'program'): Promise<void> {\n // If the trigger is disabled or the popover is not open, do nothing\n if (this.state.disabled() || !this.open()) {\n return;\n }\n\n // Hide the overlay\n await this.overlay()?.hide({ origin });\n\n this.openChange.emit(false);\n }\n\n /**\n * Create the overlay that will contain the popover\n */\n private createOverlay(): void {\n const popover = this.state.popover();\n\n if (!popover) {\n throw new Error('Popover must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: popover,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n context: this.state.context,\n container: this.state.container(),\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n showDelay: this.state.showDelay(),\n hideDelay: this.state.hideDelay(),\n closeOnOutsideClick: this.state.closeOnOutsideClick(),\n closeOnEscape: this.state.closeOnEscape(),\n restoreFocus: true,\n scrollBehaviour: this.state.scrollBehavior(),\n viewContainerRef: this.viewContainerRef,\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n","import { Directive, input } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { explicitEffect } from 'ng-primitives/internal';\nimport { injectOverlay } from 'ng-primitives/portal';\n\n/**\n * Apply the `ngpPopover` directive to an element that represents the popover. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpPopover]',\n exportAs: 'ngpPopover',\n hostDirectives: [NgpFocusTrap],\n host: {\n role: 'dialog',\n '[id]': 'id()',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-popover-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-popover-transform-origin]': 'overlay.transformOrigin()',\n '[attr.data-placement]': 'overlay.finalPlacement()',\n 'data-overlay': '',\n },\n})\nexport class NgpPopover {\n /**\n * Access the overlay.\n */\n protected readonly overlay = injectOverlay();\n\n /**\n * The unique id of the tooltip.\n */\n readonly id = input(this.overlay.id());\n\n constructor() {\n explicitEffect([this.id], ([id]) => this.overlay.id.set(id));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA2DO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,QAAQ;AACnB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,mBAAmB,EAAE,IAAI;AACzB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA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A,sCAAA,EAAA,wBAAA,EAAA,sCAAA,EAAA,2BAAA,EAAA,qBAAA,EAAA,0BAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,YAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAftB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,cAAc,EAAE,CAAC,YAAY,CAAC;AAC9B,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,MAAM,EAAE,MAAM;AACd,wBAAA,iBAAiB,EAAE,sBAAsB;AACzC,wBAAA,gBAAgB,EAAE,sBAAsB;AACxC,wBAAA,wCAAwC,EAAE,wBAAwB;AAClE,wBAAA,wCAAwC,EAAE,2BAA2B;AACrE,wBAAA,uBAAuB,EAAE,0BAA0B;AACnD,wBAAA,cAAc,EAAE,EAAE;AACnB,qBAAA;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-popover.mjs","sources":["../../../../packages/ng-primitives/popover/src/config/popover-config.ts","../../../../packages/ng-primitives/popover/src/popover-arrow/popover-arrow.ts","../../../../packages/ng-primitives/popover/src/popover-trigger/popover-trigger-state.ts","../../../../packages/ng-primitives/popover/src/popover-trigger/popover-trigger.ts","../../../../packages/ng-primitives/popover/src/popover/popover.ts","../../../../packages/ng-primitives/popover/src/ng-primitives-popover.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\n\nexport interface NgpPopoverConfig {\n /**\n * Define the offset of the popover relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the popover relative to the trigger.\n * @default 'bottom'\n */\n placement: Placement;\n\n /**\n * Define the delay before the popover is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the popover is hidden.\n * @default 0\n */\n hideDelay: number;\n\n /**\n * Define whether the popover should flip when there is not enough space for the popover.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container element or selector in to which the popover should be attached.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n\n /**\n * Define whether the popover should close when clicking outside of it.\n * @default true\n */\n closeOnOutsideClick: boolean;\n\n /**\n * Define whether the popover should close when the escape key is pressed.\n * @default true\n */\n closeOnEscape: boolean;\n\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default scroll\n */\n scrollBehavior: 'reposition' | 'block';\n}\n\nexport const defaultPopoverConfig: NgpPopoverConfig = {\n offset: 4,\n placement: 'bottom',\n showDelay: 0,\n hideDelay: 0,\n flip: true,\n container: 'body',\n closeOnOutsideClick: true,\n closeOnEscape: true,\n scrollBehavior: 'reposition',\n};\n\nexport const NgpPopoverConfigToken = new InjectionToken<NgpPopoverConfig>('NgpPopoverConfigToken');\n\n/**\n * Provide the default Popover configuration\n * @param config The Popover configuration\n * @returns The provider\n */\nexport function providePopoverConfig(config: Partial<NgpPopoverConfig>): Provider[] {\n return [\n {\n provide: NgpPopoverConfigToken,\n useValue: { ...defaultPopoverConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Popover configuration\n * @returns The global Popover configuration\n */\nexport function injectPopoverConfig(): NgpPopoverConfig {\n return inject(NgpPopoverConfigToken, { optional: true }) ?? defaultPopoverConfig;\n}\n","import { Directive } from '@angular/core';\nimport { setupOverlayArrow } from 'ng-primitives/portal';\n\n@Directive({\n selector: '[ngpPopoverArrow]',\n exportAs: 'ngpPopoverArrow',\n})\nexport class NgpPopoverArrow {\n constructor() {\n setupOverlayArrow();\n }\n}\n","import { InjectOptions, Signal } from '@angular/core';\nimport {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n State,\n} from 'ng-primitives/state';\nimport type { NgpPopoverTrigger } from './popover-trigger';\n\n/**\n * The state token for the PopoverTrigger primitive.\n */\nexport const NgpPopoverTriggerStateToken = createStateToken<NgpPopoverTrigger>('PopoverTrigger');\n\n/**\n * Provides the PopoverTrigger state.\n */\nexport const providePopoverTriggerState = createStateProvider(NgpPopoverTriggerStateToken);\n\n/**\n * Injects the PopoverTrigger state.\n */\nexport const injectPopoverTriggerState = createStateInjector<NgpPopoverTrigger>(\n NgpPopoverTriggerStateToken,\n) as <T>(options?: InjectOptions) => Signal<State<NgpPopoverTrigger<T>>>;\n\n/**\n * The PopoverTrigger state registration function.\n */\nexport const popoverTriggerState = createState(NgpPopoverTriggerStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n output,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { injectPopoverConfig } from '../config/popover-config';\nimport { popoverTriggerState, providePopoverTriggerState } from './popover-trigger-state';\n\n/**\n * Apply the `ngpPopoverTrigger` directive to an element that triggers the popover to show.\n */\n@Directive({\n selector: '[ngpPopoverTrigger]',\n exportAs: 'ngpPopoverTrigger',\n providers: [providePopoverTriggerState({ inherit: false })],\n host: {\n '[attr.aria-expanded]': 'open() ? \"true\" : \"false\"',\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-placement]': 'state.placement()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.aria-describedby]': 'overlay()?.ariaDescribedBy()',\n '(click)': 'toggle($event)',\n },\n})\nexport class NgpPopoverTrigger<T = null> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = injectElementRef();\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global popover configuration.\n */\n private readonly config = injectPopoverConfig();\n\n /**\n * Access the popover template ref.\n */\n readonly popover = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpPopoverTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPopoverTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the popover relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<NgpPopoverPlacement>(this.config.placement, {\n alias: 'ngpPopoverTriggerPlacement',\n });\n\n /**\n * Define the offset of the popover relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpPopoverTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the popover is displayed.\n * @default 0\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpPopoverTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the popover is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpPopoverTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the popover should flip when there is not enough space for the popover.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpPopoverTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the popover should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpPopoverTriggerContainer',\n });\n\n /**\n * Define whether the popover should close when clicking outside of it.\n * @default true\n */\n readonly closeOnOutsideClick = input<boolean, BooleanInput>(this.config.closeOnOutsideClick, {\n alias: 'ngpPopoverTriggerCloseOnOutsideClick',\n transform: booleanAttribute,\n });\n\n /**\n * Define whether the popover should close when the escape key is pressed.\n * @default true\n */\n readonly closeOnEscape = input<boolean, BooleanInput>(this.config.closeOnEscape, {\n alias: 'ngpPopoverTriggerCloseOnEscape',\n transform: booleanAttribute,\n });\n\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior = input<'reposition' | 'block'>(this.config.scrollBehavior, {\n alias: 'ngpPopoverTriggerScrollBehavior',\n });\n\n /**\n * Provide context to the popover. This can be used to pass data to the popover content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpPopoverTriggerContext',\n });\n\n /**\n * The overlay that manages the popover\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the popover.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Event emitted when the popover open state changes.\n */\n readonly openChange = output<boolean>({\n alias: 'ngpPopoverTriggerOpenChange',\n });\n\n /**\n * The popover trigger state.\n */\n readonly state = popoverTriggerState<NgpPopoverTrigger<T>>(this);\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n protected toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the popover\n if (this.state.disabled()) {\n return;\n }\n\n // determine the origin of the event, 0 is keyboard, 1 is mouse\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if the popover is open then hide it\n if (this.open()) {\n this.hide(origin);\n } else {\n this.show();\n }\n }\n\n /**\n * Show the popover.\n * @returns A promise that resolves when the popover has been shown\n */\n async show(): Promise<void> {\n // If the trigger is disabled, don't show the popover\n if (this.state.disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n await this.overlay()?.show();\n\n if (this.open()) {\n this.openChange.emit(true);\n }\n }\n\n /**\n * @internal\n * Hide the popover.\n * @returns A promise that resolves when the popover has been hidden\n */\n async hide(origin: FocusOrigin = 'program'): Promise<void> {\n // If the trigger is disabled or the popover is not open, do nothing\n if (this.state.disabled() || !this.open()) {\n return;\n }\n\n // Hide the overlay\n await this.overlay()?.hide({ origin });\n\n this.openChange.emit(false);\n }\n\n /**\n * Create the overlay that will contain the popover\n */\n private createOverlay(): void {\n const popover = this.state.popover();\n\n if (!popover) {\n throw new Error('Popover must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: popover,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n context: this.state.context,\n container: this.state.container(),\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n showDelay: this.state.showDelay(),\n hideDelay: this.state.hideDelay(),\n closeOnOutsideClick: this.state.closeOnOutsideClick(),\n closeOnEscape: this.state.closeOnEscape(),\n restoreFocus: true,\n scrollBehaviour: this.state.scrollBehavior(),\n viewContainerRef: this.viewContainerRef,\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n\nexport type NgpPopoverPlacement =\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'top-start'\n | 'top-end'\n | 'right-start'\n | 'right-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end';\n","import { Directive, input } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { explicitEffect } from 'ng-primitives/internal';\nimport { injectOverlay } from 'ng-primitives/portal';\n\n/**\n * Apply the `ngpPopover` directive to an element that represents the popover. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpPopover]',\n exportAs: 'ngpPopover',\n hostDirectives: [NgpFocusTrap],\n host: {\n role: 'dialog',\n '[id]': 'id()',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-popover-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-popover-transform-origin]': 'overlay.transformOrigin()',\n '[attr.data-placement]': 'overlay.finalPlacement()',\n 'data-overlay': '',\n },\n})\nexport class NgpPopover {\n /**\n * Access the overlay.\n */\n protected readonly overlay = injectOverlay();\n\n /**\n * The unique id of the tooltip.\n */\n readonly id = input(this.overlay.id());\n\n constructor() {\n explicitEffect([this.id], ([id]) => this.overlay.id.set(id));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA2DO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,QAAQ;AACnB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,mBAAmB,EAAE,IAAI;AACzB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,cAAc,EAAE,YAAY;CAC7B;AAEM,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAAmB,uBAAuB,CAAC;AAElG;;;;AAIG;AACG,SAAU,oBAAoB,CAAC,MAAiC,EAAA;IACpE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE,EAAE,GAAG,oBAAoB,EAAE,GAAG,MAAM,EAAE;AACjD,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,mBAAmB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,oBAAoB;AAClF;;MCtFa,eAAe,CAAA;AAC1B,IAAA,WAAA,GAAA;AACE,QAAA,iBAAiB,EAAE;IACrB;+GAHW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAf,eAAe,EA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