ng-primitives 0.76.0 → 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.
@@ -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,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;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ACT,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,EAA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,EAAA,QAAA,EAAA,cAAA,EAAA,EAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,eAAA,EAAA,sBAAA,EAAA,cAAA,EAAA,sBAAA,EAAA,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,7 +1,7 @@
1
- import { injectOverlay, injectOverlayContext, createOverlay, setupOverlayArrow } from 'ng-primitives/portal';
1
+ import { setupOverlayArrow, injectOverlay, injectOverlayContext, createOverlay } from 'ng-primitives/portal';
2
2
  export { injectOverlayContext as injectTooltipContext } from 'ng-primitives/portal';
3
3
  import * as i0 from '@angular/core';
4
- import { InjectionToken, inject, input, Directive, Component, ElementRef, Injector, ViewContainerRef, booleanAttribute, numberAttribute, signal, computed } from '@angular/core';
4
+ import { InjectionToken, inject, Directive, input, Component, ElementRef, Injector, ViewContainerRef, booleanAttribute, numberAttribute, signal, computed } from '@angular/core';
5
5
  import { explicitEffect, setupHover, setupOverflowListener } from 'ng-primitives/internal';
6
6
  import { isString } from 'ng-primitives/utils';
7
7
  import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
@@ -38,6 +38,21 @@ function injectTooltipConfig() {
38
38
  return inject(NgpTooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;
39
39
  }
40
40
 
41
+ class NgpTooltipArrow {
42
+ constructor() {
43
+ setupOverlayArrow();
44
+ }
45
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltipArrow, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
46
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpTooltipArrow, isStandalone: true, selector: "[ngpTooltipArrow]", exportAs: ["ngpTooltipArrow"], ngImport: i0 }); }
47
+ }
48
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltipArrow, decorators: [{
49
+ type: Directive,
50
+ args: [{
51
+ selector: '[ngpTooltipArrow]',
52
+ exportAs: 'ngpTooltipArrow',
53
+ }]
54
+ }], ctorParameters: () => [] });
55
+
41
56
  /**
42
57
  * Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.
43
58
  */
@@ -358,21 +373,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
358
373
  }]
359
374
  }], ctorParameters: () => [] });
360
375
 
361
- class NgpTooltipArrow {
362
- constructor() {
363
- setupOverlayArrow();
364
- }
365
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltipArrow, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
366
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpTooltipArrow, isStandalone: true, selector: "[ngpTooltipArrow]", exportAs: ["ngpTooltipArrow"], ngImport: i0 }); }
367
- }
368
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltipArrow, decorators: [{
369
- type: Directive,
370
- args: [{
371
- selector: '[ngpTooltipArrow]',
372
- exportAs: 'ngpTooltipArrow',
373
- }]
374
- }], ctorParameters: () => [] });
375
-
376
376
  /**
377
377
  * Generated bundle index. Do not edit.
378
378
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-tooltip.mjs","sources":["../../../../packages/ng-primitives/tooltip/src/config/tooltip-config.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-text-content/tooltip-text-content.component.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-arrow/tooltip-arrow.ts","../../../../packages/ng-primitives/tooltip/src/ng-primitives-tooltip.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\n\nexport interface NgpTooltipConfig {\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 500\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container element or selector in to which the tooltip should be attached.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n\n /**\n * Whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n showOnOverflow: boolean;\n\n /**\n * Whether to use the text content of the trigger element as the tooltip content.\n * @default true\n */\n useTextContent: boolean;\n}\n\nexport const defaultTooltipConfig: NgpTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 500,\n flip: true,\n container: 'body',\n showOnOverflow: false,\n useTextContent: true,\n};\n\nexport const NgpTooltipConfigToken = new InjectionToken<NgpTooltipConfig>('NgpTooltipConfigToken');\n\n/**\n * Provide the default Tooltip configuration\n * @param config The Tooltip configuration\n * @returns The provider\n */\nexport function provideTooltipConfig(config: Partial<NgpTooltipConfig>): Provider[] {\n return [\n {\n provide: NgpTooltipConfigToken,\n useValue: { ...defaultTooltipConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tooltip configuration\n * @returns The global Tooltip configuration\n */\nexport function injectTooltipConfig(): NgpTooltipConfig {\n return inject(NgpTooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;\n}\n","import { Directive, input } from '@angular/core';\nimport { explicitEffect, setupHover } from 'ng-primitives/internal';\nimport { injectOverlay } from 'ng-primitives/portal';\n\n/**\n * Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpTooltip]',\n exportAs: 'ngpTooltip',\n host: {\n role: 'tooltip',\n '[id]': 'id()',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-tooltip-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-tooltip-transform-origin]': 'overlay.transformOrigin()',\n '[attr.data-placement]': 'overlay.finalPlacement()',\n 'data-overlay': '',\n },\n})\nexport class NgpTooltip {\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 // if the mouse moves over the tooltip, we want to keep it open\n setupHover({\n hoverStart: () => this.overlay.cancelPendingClose(),\n hoverEnd: () => this.overlay.hide(),\n });\n }\n}\n","import { Component } from '@angular/core';\nimport { injectOverlayContext } from 'ng-primitives/portal';\nimport { NgpTooltip } from '../tooltip/tooltip';\n\n/**\n * Internal component for wrapping string content in tooltip portals\n * @internal\n */\n@Component({\n template: '{{ content() }}',\n hostDirectives: [NgpTooltip],\n host: {\n // Used only for styling, since the host directive isn’t added to the DOM.\n // This acts as the styling entry point.\n ngpTooltip: '',\n },\n})\nexport class NgpTooltipTextContentComponent {\n /**\n * The string content to display\n */\n readonly content = injectOverlayContext();\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpTooltipTrigger } from './tooltip-trigger';\n\n/**\n * The state token for the TooltipTrigger primitive.\n */\nexport const NgpTooltipTriggerStateToken =\n createStateToken<NgpTooltipTrigger<unknown>>('TooltipTrigger');\n\n/**\n * Provides the TooltipTrigger state.\n */\nexport const provideTooltipTriggerState = createStateProvider(NgpTooltipTriggerStateToken);\n\n/**\n * Injects the TooltipTrigger state.\n */\nexport const injectTooltipTriggerState = createStateInjector<NgpTooltipTrigger<unknown>>(\n NgpTooltipTriggerStateToken,\n);\n\n/**\n * The TooltipTrigger state registration function.\n */\nexport const tooltipTriggerState = createState(NgpTooltipTriggerStateToken);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n Signal,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\nimport { setupOverflowListener } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { isString } from 'ng-primitives/utils';\nimport { injectTooltipConfig } from '../config/tooltip-config';\nimport { NgpTooltipTextContentComponent } from '../tooltip-text-content/tooltip-text-content.component';\nimport { provideTooltipTriggerState, tooltipTriggerState } from './tooltip-trigger-state';\n\ntype TooltipInput<T> = NgpOverlayContent<T> | string | null | undefined;\n\n/**\n * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.\n */\n@Directive({\n selector: '[ngpTooltipTrigger]',\n exportAs: 'ngpTooltipTrigger',\n providers: [provideTooltipTriggerState()],\n host: {\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.aria-describedby]': 'overlay()?.ariaDescribedBy()',\n '(mouseenter)': 'show()',\n '(mouseleave)': 'hide()',\n '(focus)': 'show()',\n '(blur)': 'hide()',\n },\n})\nexport class NgpTooltipTrigger<T = null> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = inject(ElementRef<HTMLElement>);\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 tooltip configuration.\n */\n private readonly config = injectTooltipConfig();\n\n /**\n * Access the tooltip template ref.\n */\n readonly tooltip = input<NgpOverlayContent<T> | string | null, TooltipInput<T>>(null, {\n alias: 'ngpTooltipTrigger',\n transform: (value: TooltipInput<T>) => (value && !isString(value) ? value : null),\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTooltipTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpTooltipTriggerPlacement',\n });\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpTooltipTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 500\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpTooltipTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpTooltipTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpTooltipTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the tooltip should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpTooltipTriggerContainer',\n });\n\n /**\n * Define whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n readonly showOnOverflow = input<boolean, BooleanInput>(this.config.showOnOverflow, {\n alias: 'ngpTooltipTriggerShowOnOverflow',\n transform: booleanAttribute,\n });\n\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpTooltipTriggerContext',\n });\n\n /**\n * Define whether to use the text content of the trigger element as the tooltip content.\n * When enabled, the tooltip will display the text content of the trigger element.\n * @default true\n */\n readonly useTextContent = input<boolean, BooleanInput>(this.config.useTextContent, {\n alias: 'ngpTooltipTriggerUseTextContent',\n transform: booleanAttribute,\n });\n\n /**\n * The overlay that manages the tooltip\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T | string> | null>(null);\n\n /**\n * The unique id of the tooltip.\n */\n readonly tooltipId = signal<string | undefined>(undefined);\n\n /**\n * The open state of the tooltip.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Determine if the trigger element has overflow.\n */\n private readonly hasOverflow: Signal<boolean>;\n\n /**\n * Store the state of the tooltip.\n * @internal\n */\n readonly state = tooltipTriggerState<NgpTooltipTrigger<T>>(this);\n\n constructor() {\n this.hasOverflow = setupOverflowListener(this.trigger.nativeElement, {\n disabled: computed(() => !this.state.showOnOverflow()),\n });\n }\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Show the tooltip.\n */\n show(): void {\n // If the trigger is disabled, do not show the tooltip\n if (this.state.disabled() || this.open()) {\n // we mark this as show again to stop it dismissing\n this.overlay()?.cancelPendingClose();\n return;\n }\n\n // if we should only show when there is overflow, check if the trigger has overflow\n if (this.state.showOnOverflow() && !this.hasOverflow()) {\n // If the trigger does not have overflow, do not show the tooltip\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n this.overlay()?.show();\n }\n\n /**\n * Hide the tooltip.\n */\n hide(): void {\n // If the trigger is disabled, do nothing\n if (this.state.disabled()) {\n return;\n }\n\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the tooltip\n */\n private createOverlay(): void {\n // Determine the content and context based on useTextContent setting\n const shouldUseTextContent = this.state.useTextContent();\n let content = this.state.tooltip();\n let context: Signal<T | string | undefined> = this.state.context;\n\n if (!content) {\n if (!shouldUseTextContent) {\n if (ngDevMode) {\n throw new Error(\n '[ngpTooltipTrigger]: Tooltip must be a string, TemplateRef, or ComponentType. Alternatively, set useTextContent to true if none is provided.',\n );\n }\n\n return;\n }\n\n const textContent = this.trigger.nativeElement.textContent?.trim() || '';\n if (ngDevMode && !textContent) {\n console.warn(\n '[ngpTooltipTrigger]: useTextContent is enabled but trigger element has no text content',\n );\n return;\n }\n content = NgpTooltipTextContentComponent;\n context = signal(textContent);\n } else if (isString(content)) {\n context = signal(content);\n content = NgpTooltipTextContentComponent;\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T | string> = {\n content,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n 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 closeOnEscape: true,\n closeOnOutsideClick: true,\n viewContainerRef: this.viewContainerRef,\n };\n\n // Create the overlay instance\n this.overlay.set(createOverlay(config));\n }\n\n /**\n * Set the tooltip id.\n */\n setTooltipId(id: string): void {\n this.tooltipId.set(id);\n }\n}\n","import { Directive } from '@angular/core';\nimport { setupOverlayArrow } from 'ng-primitives/portal';\n\n@Directive({\n selector: '[ngpTooltipArrow]',\n exportAs: 'ngpTooltipArrow',\n})\nexport class NgpTooltipArrow {\n constructor() {\n setupOverlayArrow();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAqDO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,cAAc,EAAE,IAAI;CACrB;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;;AClFA;;AAEG;MAeU,UAAU,CAAA;AAWrB,IAAA,WAAA,GAAA;AAVA;;AAEG;QACgB,IAAA,CAAA,OAAO,GAAG,aAAa,EAAE;AAE5C;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;Q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EAAA,CAAA;kBAd7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,SAAS,EAAE,CAAC,0BAA0B,EAAE,CAAC;AACzC,oBAAA,IAAI,EAAE;AACJ,wBAAA,kBAAkB,EAAE,oBAAoB;AACxC,wBAAA,sBAAsB,EAAE,8BAA8B;AACtD,wBAAA,yBAAyB,EAAE,8BAA8B;AACzD,wBAAA,cAAc,EAAE,QAAQ;AACxB,wBAAA,cAAc,EAAE,QAAQ;AACxB,wBAAA,SAAS,EAAE,QAAQ;AACnB,wBAAA,QAAQ,EAAE,QAAQ;AACnB,qBAAA;AACF,iBAAA;;;MCvCY,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,EAAA,UAAA,EAAA,CAAA;kBAJ3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,QAAQ,EAAE,iBAAiB;AAC5B,iBAAA;;;ACND;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-tooltip.mjs","sources":["../../../../packages/ng-primitives/tooltip/src/config/tooltip-config.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-arrow/tooltip-arrow.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-text-content/tooltip-text-content.component.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger.ts","../../../../packages/ng-primitives/tooltip/src/ng-primitives-tooltip.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\n\nexport interface NgpTooltipConfig {\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 500\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container element or selector in to which the tooltip should be attached.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n\n /**\n * Whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n showOnOverflow: boolean;\n\n /**\n * Whether to use the text content of the trigger element as the tooltip content.\n * @default true\n */\n useTextContent: boolean;\n}\n\nexport const defaultTooltipConfig: NgpTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 500,\n flip: true,\n container: 'body',\n showOnOverflow: false,\n useTextContent: true,\n};\n\nexport const NgpTooltipConfigToken = new InjectionToken<NgpTooltipConfig>('NgpTooltipConfigToken');\n\n/**\n * Provide the default Tooltip configuration\n * @param config The Tooltip configuration\n * @returns The provider\n */\nexport function provideTooltipConfig(config: Partial<NgpTooltipConfig>): Provider[] {\n return [\n {\n provide: NgpTooltipConfigToken,\n useValue: { ...defaultTooltipConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tooltip configuration\n * @returns The global Tooltip configuration\n */\nexport function injectTooltipConfig(): NgpTooltipConfig {\n return inject(NgpTooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;\n}\n","import { Directive } from '@angular/core';\nimport { setupOverlayArrow } from 'ng-primitives/portal';\n\n@Directive({\n selector: '[ngpTooltipArrow]',\n exportAs: 'ngpTooltipArrow',\n})\nexport class NgpTooltipArrow {\n constructor() {\n setupOverlayArrow();\n }\n}\n","import { Directive, input } from '@angular/core';\nimport { explicitEffect, setupHover } from 'ng-primitives/internal';\nimport { injectOverlay } from 'ng-primitives/portal';\n\n/**\n * Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpTooltip]',\n exportAs: 'ngpTooltip',\n host: {\n role: 'tooltip',\n '[id]': 'id()',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-tooltip-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-tooltip-transform-origin]': 'overlay.transformOrigin()',\n '[attr.data-placement]': 'overlay.finalPlacement()',\n 'data-overlay': '',\n },\n})\nexport class NgpTooltip {\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 // if the mouse moves over the tooltip, we want to keep it open\n setupHover({\n hoverStart: () => this.overlay.cancelPendingClose(),\n hoverEnd: () => this.overlay.hide(),\n });\n }\n}\n","import { Component } from '@angular/core';\nimport { injectOverlayContext } from 'ng-primitives/portal';\nimport { NgpTooltip } from '../tooltip/tooltip';\n\n/**\n * Internal component for wrapping string content in tooltip portals\n * @internal\n */\n@Component({\n template: '{{ content() }}',\n hostDirectives: [NgpTooltip],\n host: {\n // Used only for styling, since the host directive isn’t added to the DOM.\n // This acts as the styling entry point.\n ngpTooltip: '',\n },\n})\nexport class NgpTooltipTextContentComponent {\n /**\n * The string content to display\n */\n readonly content = injectOverlayContext();\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpTooltipTrigger } from './tooltip-trigger';\n\n/**\n * The state token for the TooltipTrigger primitive.\n */\nexport const NgpTooltipTriggerStateToken =\n createStateToken<NgpTooltipTrigger<unknown>>('TooltipTrigger');\n\n/**\n * Provides the TooltipTrigger state.\n */\nexport const provideTooltipTriggerState = createStateProvider(NgpTooltipTriggerStateToken);\n\n/**\n * Injects the TooltipTrigger state.\n */\nexport const injectTooltipTriggerState = createStateInjector<NgpTooltipTrigger<unknown>>(\n NgpTooltipTriggerStateToken,\n);\n\n/**\n * The TooltipTrigger state registration function.\n */\nexport const tooltipTriggerState = createState(NgpTooltipTriggerStateToken);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n Signal,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { setupOverflowListener } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { isString } from 'ng-primitives/utils';\nimport { injectTooltipConfig } from '../config/tooltip-config';\nimport { NgpTooltipTextContentComponent } from '../tooltip-text-content/tooltip-text-content.component';\nimport { provideTooltipTriggerState, tooltipTriggerState } from './tooltip-trigger-state';\n\ntype TooltipInput<T> = NgpOverlayContent<T> | string | null | undefined;\n\n/**\n * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.\n */\n@Directive({\n selector: '[ngpTooltipTrigger]',\n exportAs: 'ngpTooltipTrigger',\n providers: [provideTooltipTriggerState()],\n host: {\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.aria-describedby]': 'overlay()?.ariaDescribedBy()',\n '(mouseenter)': 'show()',\n '(mouseleave)': 'hide()',\n '(focus)': 'show()',\n '(blur)': 'hide()',\n },\n})\nexport class NgpTooltipTrigger<T = null> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = inject(ElementRef<HTMLElement>);\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 tooltip configuration.\n */\n private readonly config = injectTooltipConfig();\n\n /**\n * Access the tooltip template ref.\n */\n readonly tooltip = input<NgpOverlayContent<T> | string | null, TooltipInput<T>>(null, {\n alias: 'ngpTooltipTrigger',\n transform: (value: TooltipInput<T>) => (value && !isString(value) ? value : null),\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTooltipTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<NgpTooltipPlacement>(this.config.placement, {\n alias: 'ngpTooltipTriggerPlacement',\n });\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpTooltipTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 500\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpTooltipTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpTooltipTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpTooltipTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the tooltip should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpTooltipTriggerContainer',\n });\n\n /**\n * Define whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n readonly showOnOverflow = input<boolean, BooleanInput>(this.config.showOnOverflow, {\n alias: 'ngpTooltipTriggerShowOnOverflow',\n transform: booleanAttribute,\n });\n\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpTooltipTriggerContext',\n });\n\n /**\n * Define whether to use the text content of the trigger element as the tooltip content.\n * When enabled, the tooltip will display the text content of the trigger element.\n * @default true\n */\n readonly useTextContent = input<boolean, BooleanInput>(this.config.useTextContent, {\n alias: 'ngpTooltipTriggerUseTextContent',\n transform: booleanAttribute,\n });\n\n /**\n * The overlay that manages the tooltip\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T | string> | null>(null);\n\n /**\n * The unique id of the tooltip.\n */\n readonly tooltipId = signal<string | undefined>(undefined);\n\n /**\n * The open state of the tooltip.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Determine if the trigger element has overflow.\n */\n private readonly hasOverflow: Signal<boolean>;\n\n /**\n * Store the state of the tooltip.\n * @internal\n */\n readonly state = tooltipTriggerState<NgpTooltipTrigger<T>>(this);\n\n constructor() {\n this.hasOverflow = setupOverflowListener(this.trigger.nativeElement, {\n disabled: computed(() => !this.state.showOnOverflow()),\n });\n }\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Show the tooltip.\n */\n show(): void {\n // If the trigger is disabled, do not show the tooltip\n if (this.state.disabled() || this.open()) {\n // we mark this as show again to stop it dismissing\n this.overlay()?.cancelPendingClose();\n return;\n }\n\n // if we should only show when there is overflow, check if the trigger has overflow\n if (this.state.showOnOverflow() && !this.hasOverflow()) {\n // If the trigger does not have overflow, do not show the tooltip\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n this.overlay()?.show();\n }\n\n /**\n * Hide the tooltip.\n */\n hide(): void {\n // If the trigger is disabled, do nothing\n if (this.state.disabled()) {\n return;\n }\n\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the tooltip\n */\n private createOverlay(): void {\n // Determine the content and context based on useTextContent setting\n const shouldUseTextContent = this.state.useTextContent();\n let content = this.state.tooltip();\n let context: Signal<T | string | undefined> = this.state.context;\n\n if (!content) {\n if (!shouldUseTextContent) {\n if (ngDevMode) {\n throw new Error(\n '[ngpTooltipTrigger]: Tooltip must be a string, TemplateRef, or ComponentType. Alternatively, set useTextContent to true if none is provided.',\n );\n }\n\n return;\n }\n\n const textContent = this.trigger.nativeElement.textContent?.trim() || '';\n if (ngDevMode && !textContent) {\n console.warn(\n '[ngpTooltipTrigger]: useTextContent is enabled but trigger element has no text content',\n );\n return;\n }\n content = NgpTooltipTextContentComponent;\n context = signal(textContent);\n } else if (isString(content)) {\n context = signal(content);\n content = NgpTooltipTextContentComponent;\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T | string> = {\n content,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n 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 closeOnEscape: true,\n closeOnOutsideClick: true,\n viewContainerRef: this.viewContainerRef,\n };\n\n // Create the overlay instance\n this.overlay.set(createOverlay(config));\n }\n\n /**\n * Set the tooltip id.\n */\n setTooltipId(id: string): void {\n this.tooltipId.set(id);\n }\n}\n\nexport type NgpTooltipPlacement =\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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAqDO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,GAAG;AACd,I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kBAd7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,SAAS,EAAE,CAAC,0BAA0B,EAAE,CAAC;AACzC,oBAAA,IAAI,EAAE;AACJ,wBAAA,kBAAkB,EAAE,oBAAoB;AACxC,wBAAA,sBAAsB,EAAE,8BAA8B;AACtD,wBAAA,yBAAyB,EAAE,8BAA8B;AACzD,wBAAA,cAAc,EAAE,QAAQ;AACxB,wBAAA,cAAc,EAAE,QAAQ;AACxB,wBAAA,SAAS,EAAE,QAAQ;AACnB,wBAAA,QAAQ,EAAE,QAAQ;AACnB,qBAAA;AACF,iBAAA;;;AC7CD;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { InjectionToken, Provider } from '@angular/core';
2
- import { Placement } from '@floating-ui/dom';
2
+ import type { NgpMenuPlacement } from '../menu-trigger/menu-trigger';
3
3
  export interface NgpMenuConfig {
4
4
  /**
5
5
  * Define the offset of the menu relative to the trigger.
@@ -10,7 +10,7 @@ export interface NgpMenuConfig {
10
10
  * Define the placement of the menu relative to the trigger.
11
11
  * @default 'bottom-start'
12
12
  */
13
- placement: Placement;
13
+ placement: NgpMenuPlacement;
14
14
  /**
15
15
  * Define whether the menu should flip when there is not enough space for the menu.
16
16
  * @default true
package/menu/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { injectOverlayContext as injectMenuContext } from 'ng-primitives/portal';
2
2
  export { NgpMenuConfig, provideMenuConfig } from './config/menu-config';
3
3
  export { NgpMenuItem } from './menu-item/menu-item';
4
- export { NgpMenuTrigger } from './menu-trigger/menu-trigger';
4
+ export { NgpMenuTrigger, type NgpMenuPlacement } from './menu-trigger/menu-trigger';
5
5
  export { injectMenuTriggerState, provideMenuTriggerState } from './menu-trigger/menu-trigger-state';
6
6
  export { NgpMenu } from './menu/menu';
7
7
  export { injectMenu, NgpMenuToken } from './menu/menu-token';
@@ -1,7 +1,6 @@
1
1
  import { FocusOrigin } from '@angular/cdk/a11y';
2
2
  import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
3
3
  import { OnDestroy } from '@angular/core';
4
- import { Placement } from '@floating-ui/dom';
5
4
  import { NgpOverlay, NgpOverlayContent } from 'ng-primitives/portal';
6
5
  import * as i0 from "@angular/core";
7
6
  /**
@@ -25,7 +24,7 @@ export declare class NgpMenuTrigger<T = unknown> implements OnDestroy {
25
24
  */
26
25
  private readonly config;
27
26
  /**
28
- * Access the menu template ref.
27
+ * Access the menu template ref or ComponentType.
29
28
  */
30
29
  readonly menu: import("@angular/core").InputSignal<NgpOverlayContent<T> | undefined>;
31
30
  /**
@@ -37,7 +36,7 @@ export declare class NgpMenuTrigger<T = unknown> implements OnDestroy {
37
36
  * Define the placement of the menu relative to the trigger.
38
37
  * @default 'bottom-start'
39
38
  */
40
- readonly placement: import("@angular/core").InputSignal<Placement>;
39
+ readonly placement: import("@angular/core").InputSignal<NgpMenuPlacement>;
41
40
  /**
42
41
  * Define the offset of the menu relative to the trigger.
43
42
  * @default 4
@@ -77,7 +76,8 @@ export declare class NgpMenuTrigger<T = unknown> implements OnDestroy {
77
76
  */
78
77
  readonly state: import("ng-primitives/state").CreatedState<NgpMenuTrigger<T>>;
79
78
  ngOnDestroy(): void;
80
- protected toggle(event: MouseEvent): void;
79
+ protected onClick(event: MouseEvent): void;
80
+ toggle(event: MouseEvent): void;
81
81
  /**
82
82
  * Show the menu.
83
83
  */
@@ -94,3 +94,4 @@ export declare class NgpMenuTrigger<T = unknown> implements OnDestroy {
94
94
  static ɵfac: i0.ɵɵFactoryDeclaration<NgpMenuTrigger<any>, never>;
95
95
  static ɵdir: i0.ɵɵDirectiveDeclaration<NgpMenuTrigger<any>, "[ngpMenuTrigger]", ["ngpMenuTrigger"], { "menu": { "alias": "ngpMenuTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpMenuTriggerDisabled"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpMenuTriggerPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpMenuTriggerOffset"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpMenuTriggerFlip"; "required": false; "isSignal": true; }; "container": { "alias": "ngpMenuTriggerContainer"; "required": false; "isSignal": true; }; "scrollBehavior": { "alias": "ngpMenuTriggerScrollBehavior"; "required": false; "isSignal": true; }; "context": { "alias": "ngpMenuTriggerContext"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
96
96
  }
97
+ export type NgpMenuPlacement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
@@ -1,7 +1,7 @@
1
1
  import { FocusOrigin } from '@angular/cdk/a11y';
2
2
  import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
3
- import { Placement } from '@floating-ui/dom';
4
3
  import { NgpOverlay, NgpOverlayContent } from 'ng-primitives/portal';
4
+ import { NgpMenuPlacement } from '../menu-trigger/menu-trigger';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class NgpSubmenuTrigger<T = unknown> {
7
7
  /**
@@ -31,7 +31,7 @@ export declare class NgpSubmenuTrigger<T = unknown> {
31
31
  * Define the placement of the menu relative to the trigger.
32
32
  * @default 'right-start'
33
33
  */
34
- readonly placement: import("@angular/core").InputSignal<Placement>;
34
+ readonly placement: import("@angular/core").InputSignal<NgpMenuPlacement>;
35
35
  /**
36
36
  * Define the offset of the menu relative to the trigger.
37
37
  * @default 0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ng-primitives",
3
3
  "description": "Angular Primitives is a low-level headless UI component library with a focus on accessibility, customization, and developer experience. ",
4
4
  "license": "Apache-2.0",
5
- "version": "0.76.0",
5
+ "version": "0.77.0",
6
6
  "keywords": [
7
7
  "angular",
8
8
  "primitives",
@@ -71,17 +71,13 @@
71
71
  "types": "./accordion/index.d.ts",
72
72
  "default": "./fesm2022/ng-primitives-accordion.mjs"
73
73
  },
74
- "./avatar": {
75
- "types": "./avatar/index.d.ts",
76
- "default": "./fesm2022/ng-primitives-avatar.mjs"
77
- },
78
74
  "./autofill": {
79
75
  "types": "./autofill/index.d.ts",
80
76
  "default": "./fesm2022/ng-primitives-autofill.mjs"
81
77
  },
82
- "./checkbox": {
83
- "types": "./checkbox/index.d.ts",
84
- "default": "./fesm2022/ng-primitives-checkbox.mjs"
78
+ "./avatar": {
79
+ "types": "./avatar/index.d.ts",
80
+ "default": "./fesm2022/ng-primitives-avatar.mjs"
85
81
  },
86
82
  "./button": {
87
83
  "types": "./button/index.d.ts",
@@ -95,6 +91,10 @@
95
91
  "types": "./common/index.d.ts",
96
92
  "default": "./fesm2022/ng-primitives-common.mjs"
97
93
  },
94
+ "./checkbox": {
95
+ "types": "./checkbox/index.d.ts",
96
+ "default": "./fesm2022/ng-primitives-checkbox.mjs"
97
+ },
98
98
  "./date-picker": {
99
99
  "types": "./date-picker/index.d.ts",
100
100
  "default": "./fesm2022/ng-primitives-date-picker.mjs"
@@ -179,6 +179,10 @@
179
179
  "types": "./search/index.d.ts",
180
180
  "default": "./fesm2022/ng-primitives-search.mjs"
181
181
  },
182
+ "./select": {
183
+ "types": "./select/index.d.ts",
184
+ "default": "./fesm2022/ng-primitives-select.mjs"
185
+ },
182
186
  "./separator": {
183
187
  "types": "./separator/index.d.ts",
184
188
  "default": "./fesm2022/ng-primitives-separator.mjs"
@@ -191,6 +195,10 @@
191
195
  "types": "./state/index.d.ts",
192
196
  "default": "./fesm2022/ng-primitives-state.mjs"
193
197
  },
198
+ "./textarea": {
199
+ "types": "./textarea/index.d.ts",
200
+ "default": "./fesm2022/ng-primitives-textarea.mjs"
201
+ },
194
202
  "./switch": {
195
203
  "types": "./switch/index.d.ts",
196
204
  "default": "./fesm2022/ng-primitives-switch.mjs"
@@ -199,10 +207,6 @@
199
207
  "types": "./tabs/index.d.ts",
200
208
  "default": "./fesm2022/ng-primitives-tabs.mjs"
201
209
  },
202
- "./textarea": {
203
- "types": "./textarea/index.d.ts",
204
- "default": "./fesm2022/ng-primitives-textarea.mjs"
205
- },
206
210
  "./toast": {
207
211
  "types": "./toast/index.d.ts",
208
212
  "default": "./fesm2022/ng-primitives-toast.mjs"
@@ -215,6 +219,10 @@
215
219
  "types": "./toggle-group/index.d.ts",
216
220
  "default": "./fesm2022/ng-primitives-toggle-group.mjs"
217
221
  },
222
+ "./tooltip": {
223
+ "types": "./tooltip/index.d.ts",
224
+ "default": "./fesm2022/ng-primitives-tooltip.mjs"
225
+ },
218
226
  "./toolbar": {
219
227
  "types": "./toolbar/index.d.ts",
220
228
  "default": "./fesm2022/ng-primitives-toolbar.mjs"
@@ -222,14 +230,6 @@
222
230
  "./utils": {
223
231
  "types": "./utils/index.d.ts",
224
232
  "default": "./fesm2022/ng-primitives-utils.mjs"
225
- },
226
- "./tooltip": {
227
- "types": "./tooltip/index.d.ts",
228
- "default": "./fesm2022/ng-primitives-tooltip.mjs"
229
- },
230
- "./select": {
231
- "types": "./select/index.d.ts",
232
- "default": "./fesm2022/ng-primitives-select.mjs"
233
233
  }
234
234
  },
235
235
  "module": "fesm2022/ng-primitives.mjs",
@@ -1,6 +1,6 @@
1
1
  export { injectOverlayContext as injectPopoverContext } from 'ng-primitives/portal';
2
2
  export { NgpPopoverConfig, providePopoverConfig } from './config/popover-config';
3
3
  export { NgpPopoverArrow } from './popover-arrow/popover-arrow';
4
- export { NgpPopoverTrigger } from './popover-trigger/popover-trigger';
4
+ export { NgpPopoverTrigger, type NgpPopoverPlacement } from './popover-trigger/popover-trigger';
5
5
  export { injectPopoverTriggerState, providePopoverTriggerState, } from './popover-trigger/popover-trigger-state';
6
6
  export { NgpPopover } from './popover/popover';
@@ -1,7 +1,6 @@
1
1
  import { FocusOrigin } from '@angular/cdk/a11y';
2
2
  import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
3
3
  import { OnDestroy } from '@angular/core';
4
- import { Placement } from '@floating-ui/dom';
5
4
  import { NgpOverlay, NgpOverlayContent } from 'ng-primitives/portal';
6
5
  import * as i0 from "@angular/core";
7
6
  /**
@@ -37,7 +36,7 @@ export declare class NgpPopoverTrigger<T = null> implements OnDestroy {
37
36
  * Define the placement of the popover relative to the trigger.
38
37
  * @default 'top'
39
38
  */
40
- readonly placement: import("@angular/core").InputSignal<Placement>;
39
+ readonly placement: import("@angular/core").InputSignal<NgpPopoverPlacement>;
41
40
  /**
42
41
  * Define the offset of the popover relative to the trigger.
43
42
  * @default 0
@@ -120,3 +119,4 @@ export declare class NgpPopoverTrigger<T = null> implements OnDestroy {
120
119
  static ɵfac: i0.ɵɵFactoryDeclaration<NgpPopoverTrigger<any>, never>;
121
120
  static ɵdir: i0.ɵɵDirectiveDeclaration<NgpPopoverTrigger<any>, "[ngpPopoverTrigger]", ["ngpPopoverTrigger"], { "popover": { "alias": "ngpPopoverTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpPopoverTriggerDisabled"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpPopoverTriggerPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpPopoverTriggerOffset"; "required": false; "isSignal": true; }; "showDelay": { "alias": "ngpPopoverTriggerShowDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "ngpPopoverTriggerHideDelay"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpPopoverTriggerFlip"; "required": false; "isSignal": true; }; "container": { "alias": "ngpPopoverTriggerContainer"; "required": false; "isSignal": true; }; "closeOnOutsideClick": { "alias": "ngpPopoverTriggerCloseOnOutsideClick"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "ngpPopoverTriggerCloseOnEscape"; "required": false; "isSignal": true; }; "scrollBehavior": { "alias": "ngpPopoverTriggerScrollBehavior"; "required": false; "isSignal": true; }; "context": { "alias": "ngpPopoverTriggerContext"; "required": false; "isSignal": true; }; }, { "openChange": "ngpPopoverTriggerOpenChange"; }, never, never, true, never>;
122
121
  }
122
+ export type NgpPopoverPlacement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
@@ -1,6 +1,6 @@
1
1
  export { injectOverlayContext as injectTooltipContext } from 'ng-primitives/portal';
2
2
  export { NgpTooltipConfig, provideTooltipConfig } from './config/tooltip-config';
3
- export { NgpTooltipTrigger } from './tooltip-trigger/tooltip-trigger';
3
+ export { NgpTooltipArrow } from './tooltip-arrow/tooltip-arrow';
4
+ export { NgpTooltipTrigger, type NgpTooltipPlacement } from './tooltip-trigger/tooltip-trigger';
4
5
  export { injectTooltipTriggerState, provideTooltipTriggerState, } from './tooltip-trigger/tooltip-trigger-state';
5
6
  export { NgpTooltip } from './tooltip/tooltip';
6
- export { NgpTooltipArrow } from './tooltip-arrow/tooltip-arrow';
@@ -1,6 +1,5 @@
1
1
  import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
2
2
  import { OnDestroy, Signal } from '@angular/core';
3
- import { Placement } from '@floating-ui/dom';
4
3
  import { NgpOverlay, NgpOverlayContent } from 'ng-primitives/portal';
5
4
  import * as i0 from "@angular/core";
6
5
  type TooltipInput<T> = NgpOverlayContent<T> | string | null | undefined;
@@ -37,7 +36,7 @@ export declare class NgpTooltipTrigger<T = null> implements OnDestroy {
37
36
  * Define the placement of the tooltip relative to the trigger.
38
37
  * @default 'top'
39
38
  */
40
- readonly placement: import("@angular/core").InputSignal<Placement>;
39
+ readonly placement: import("@angular/core").InputSignal<NgpTooltipPlacement>;
41
40
  /**
42
41
  * Define the offset of the tooltip relative to the trigger.
43
42
  * @default 0
@@ -122,4 +121,5 @@ export declare class NgpTooltipTrigger<T = null> implements OnDestroy {
122
121
  static ɵfac: i0.ɵɵFactoryDeclaration<NgpTooltipTrigger<any>, never>;
123
122
  static ɵdir: i0.ɵɵDirectiveDeclaration<NgpTooltipTrigger<any>, "[ngpTooltipTrigger]", ["ngpTooltipTrigger"], { "tooltip": { "alias": "ngpTooltipTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpTooltipTriggerDisabled"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpTooltipTriggerPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpTooltipTriggerOffset"; "required": false; "isSignal": true; }; "showDelay": { "alias": "ngpTooltipTriggerShowDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "ngpTooltipTriggerHideDelay"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpTooltipTriggerFlip"; "required": false; "isSignal": true; }; "container": { "alias": "ngpTooltipTriggerContainer"; "required": false; "isSignal": true; }; "showOnOverflow": { "alias": "ngpTooltipTriggerShowOnOverflow"; "required": false; "isSignal": true; }; "context": { "alias": "ngpTooltipTriggerContext"; "required": false; "isSignal": true; }; "useTextContent": { "alias": "ngpTooltipTriggerUseTextContent"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
124
123
  }
124
+ export type NgpTooltipPlacement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
125
125
  export {};