ng-primitives 0.84.0 → 0.85.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/fesm2022/ng-primitives-popover.mjs +9 -1
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +12 -4
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/package.json +28 -28
- package/popover/popover-trigger/popover-trigger.d.ts +6 -1
- package/portal/overlay.d.ts +2 -0
- package/toast/toast/toast.d.ts +1 -1
|
@@ -183,6 +183,13 @@ class NgpPopoverTrigger {
|
|
|
183
183
|
this.context = input(undefined, {
|
|
184
184
|
alias: 'ngpPopoverTriggerContext',
|
|
185
185
|
});
|
|
186
|
+
/**
|
|
187
|
+
* Define an anchor element for positioning the popover.
|
|
188
|
+
* If provided, the popover will be positioned relative to this element instead of the trigger.
|
|
189
|
+
*/
|
|
190
|
+
this.anchor = input(null, {
|
|
191
|
+
alias: 'ngpPopoverTriggerAnchor',
|
|
192
|
+
});
|
|
186
193
|
/**
|
|
187
194
|
* The overlay that manages the popover
|
|
188
195
|
* @internal
|
|
@@ -267,6 +274,7 @@ class NgpPopoverTrigger {
|
|
|
267
274
|
const config = {
|
|
268
275
|
content: popover,
|
|
269
276
|
triggerElement: this.trigger.nativeElement,
|
|
277
|
+
anchorElement: this.state.anchor(),
|
|
270
278
|
injector: this.injector,
|
|
271
279
|
context: this.state.context,
|
|
272
280
|
container: this.state.container(),
|
|
@@ -284,7 +292,7 @@ class NgpPopoverTrigger {
|
|
|
284
292
|
this.overlay.set(createOverlay(config));
|
|
285
293
|
}
|
|
286
294
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPopoverTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
287
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPopoverTrigger, isStandalone: true, selector: "[ngpPopoverTrigger]", inputs: { popover: { classPropertyName: "popover", publicName: "ngpPopoverTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpPopoverTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpPopoverTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpPopoverTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "ngpPopoverTriggerShowDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "ngpPopoverTriggerHideDelay", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpPopoverTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpPopoverTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, closeOnOutsideClick: { classPropertyName: "closeOnOutsideClick", publicName: "ngpPopoverTriggerCloseOnOutsideClick", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "ngpPopoverTriggerCloseOnEscape", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "ngpPopoverTriggerScrollBehavior", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpPopoverTriggerContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openChange: "ngpPopoverTriggerOpenChange" }, host: { listeners: { "click": "toggle($event)" }, properties: { "attr.aria-expanded": "open() ? \"true\" : \"false\"", "attr.data-open": "open() ? \"\" : null", "attr.data-placement": "state.placement()", "attr.data-disabled": "state.disabled() ? \"\" : null", "attr.aria-describedby": "overlay()?.ariaDescribedBy()" } }, providers: [providePopoverTriggerState({ inherit: false })], exportAs: ["ngpPopoverTrigger"], ngImport: i0 }); }
|
|
295
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPopoverTrigger, isStandalone: true, selector: "[ngpPopoverTrigger]", inputs: { popover: { classPropertyName: "popover", publicName: "ngpPopoverTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpPopoverTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpPopoverTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpPopoverTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "ngpPopoverTriggerShowDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "ngpPopoverTriggerHideDelay", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpPopoverTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpPopoverTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, closeOnOutsideClick: { classPropertyName: "closeOnOutsideClick", publicName: "ngpPopoverTriggerCloseOnOutsideClick", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "ngpPopoverTriggerCloseOnEscape", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "ngpPopoverTriggerScrollBehavior", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpPopoverTriggerContext", isSignal: true, isRequired: false, transformFunction: null }, anchor: { classPropertyName: "anchor", publicName: "ngpPopoverTriggerAnchor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openChange: "ngpPopoverTriggerOpenChange" }, host: { listeners: { "click": "toggle($event)" }, properties: { "attr.aria-expanded": "open() ? \"true\" : \"false\"", "attr.data-open": "open() ? \"\" : null", "attr.data-placement": "state.placement()", "attr.data-disabled": "state.disabled() ? \"\" : null", "attr.aria-describedby": "overlay()?.ariaDescribedBy()" } }, providers: [providePopoverTriggerState({ inherit: false })], exportAs: ["ngpPopoverTrigger"], ngImport: i0 }); }
|
|
288
296
|
}
|
|
289
297
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPopoverTrigger, decorators: [{
|
|
290
298
|
type: Directive,
|
|
@@ -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';\nimport { NgpOffset } from 'ng-primitives/portal';\n\nexport interface NgpPopoverConfig {\n /**\n * Define the offset of the popover relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n * @default 4\n */\n offset: NgpOffset;\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 coerceOffset,\n NgpOffset,\n NgpOffsetInput,\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 * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n * @default 0\n */\n readonly offset = input<NgpOffset, NgpOffsetInput>(this.config.offset, {\n alias: 'ngpPopoverTriggerOffset',\n transform: coerceOffset,\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":";;;;;;;;;AA6DO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,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EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,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
|
+
{"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';\nimport { NgpOffset } from 'ng-primitives/portal';\n\nexport interface NgpPopoverConfig {\n /**\n * Define the offset of the popover relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n * @default 4\n */\n offset: NgpOffset;\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 coerceOffset,\n NgpOffset,\n NgpOffsetInput,\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 * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n * @default 0\n */\n readonly offset = input<NgpOffset, NgpOffsetInput>(this.config.offset, {\n alias: 'ngpPopoverTriggerOffset',\n transform: coerceOffset,\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 * Define an anchor element for positioning the popover.\n * If provided, the popover will be positioned relative to this element instead of the trigger.\n */\n readonly anchor = input<HTMLElement | null>(null, {\n alias: 'ngpPopoverTriggerAnchor',\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 anchorElement: this.state.anchor(),\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":";;;;;;;;;AA6DO,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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AA,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;;;;"}
|
|
@@ -341,7 +341,8 @@ class NgpOverlay {
|
|
|
341
341
|
// this must be done after the config is set
|
|
342
342
|
this.transformOrigin.set(this.getTransformOrigin());
|
|
343
343
|
// Monitor trigger element resize
|
|
344
|
-
|
|
344
|
+
const elementToMonitor = this.config.anchorElement || this.config.triggerElement;
|
|
345
|
+
fromResizeEvent(elementToMonitor)
|
|
345
346
|
.pipe(safeTakeUntilDestroyed(this.destroyRef))
|
|
346
347
|
.subscribe(({ width, height }) => {
|
|
347
348
|
this.triggerWidth.set(width);
|
|
@@ -370,7 +371,10 @@ class NgpOverlay {
|
|
|
370
371
|
const path = event.composedPath();
|
|
371
372
|
const isInsideOverlay = overlay.getElements().some(el => path.includes(el));
|
|
372
373
|
const isInsideTrigger = path.includes(this.config.triggerElement);
|
|
373
|
-
|
|
374
|
+
const isInsideAnchor = this.config.anchorElement
|
|
375
|
+
? path.includes(this.config.anchorElement)
|
|
376
|
+
: false;
|
|
377
|
+
if (!isInsideOverlay && !isInsideTrigger && !isInsideAnchor) {
|
|
374
378
|
this.hide();
|
|
375
379
|
}
|
|
376
380
|
});
|
|
@@ -560,8 +564,10 @@ class NgpOverlay {
|
|
|
560
564
|
const strategy = getComputedStyle(overlayElement).position === 'fixed'
|
|
561
565
|
? 'fixed'
|
|
562
566
|
: this.config.strategy || 'absolute';
|
|
567
|
+
// Use anchor element for positioning if provided, otherwise use trigger element
|
|
568
|
+
const referenceElement = this.config.anchorElement || this.config.triggerElement;
|
|
563
569
|
// Setup auto-update for positioning
|
|
564
|
-
this.disposePositioning = autoUpdate(
|
|
570
|
+
this.disposePositioning = autoUpdate(referenceElement, overlayElement, () => this.computePosition(overlayElement, strategy));
|
|
565
571
|
}
|
|
566
572
|
/**
|
|
567
573
|
* Compute the overlay position using floating-ui
|
|
@@ -583,7 +589,9 @@ class NgpOverlay {
|
|
|
583
589
|
}
|
|
584
590
|
// Compute the position
|
|
585
591
|
const placement = this.config.placement?.() ?? 'top';
|
|
586
|
-
|
|
592
|
+
// Use anchor element for positioning if provided, otherwise use trigger element
|
|
593
|
+
const referenceElement = this.config.anchorElement || this.config.triggerElement;
|
|
594
|
+
const position = await computePosition(referenceElement, overlayElement, {
|
|
587
595
|
placement,
|
|
588
596
|
middleware,
|
|
589
597
|
strategy,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-portal.mjs","sources":["../../../../packages/ng-primitives/portal/src/overlay-token.ts","../../../../packages/ng-primitives/portal/src/portal.ts","../../../../packages/ng-primitives/portal/src/scroll-strategy.ts","../../../../packages/ng-primitives/portal/src/overlay.ts","../../../../packages/ng-primitives/portal/src/overlay-arrow.ts","../../../../packages/ng-primitives/portal/src/offset.ts","../../../../packages/ng-primitives/portal/src/ng-primitives-portal.ts"],"sourcesContent":["import { inject, InjectionToken, Signal, ValueProvider } from '@angular/core';\n\nconst NgpOverlayContextToken = new InjectionToken<unknown>('NgpOverlayContextToken');\n\n/**\n * Injects the context for the overlay.\n * @internal\n */\nexport function injectOverlayContext<T>(): Signal<T> {\n return inject(NgpOverlayContextToken) as Signal<T>;\n}\n\n/**\n * Provides the context for the overlay.\n * @param value The value to provide as the context.\n * @internal\n */\nexport function provideOverlayContext<T>(value: Signal<T | undefined> | undefined): ValueProvider {\n return { provide: NgpOverlayContextToken, useValue: value };\n}\n","import { ComponentPortal, DomPortalOutlet, TemplatePortal } from '@angular/cdk/portal';\nimport {\n ComponentRef,\n EmbeddedViewRef,\n Injector,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport { NgpExitAnimationRef, setupExitAnimation } from 'ng-primitives/internal';\n\nexport abstract class NgpPortal {\n constructor(\n protected readonly viewContainerRef: ViewContainerRef,\n protected readonly injector: Injector,\n ) {}\n\n /**\n * Get the elements of the portal.\n */\n abstract getElements(): HTMLElement[];\n\n /**\n * Detect changes in the portal.\n */\n abstract detectChanges(): void;\n\n /**\n * Whether the portal is attached to a DOM element.\n */\n abstract getAttached(): boolean;\n\n /**\n * Attach the portal to a DOM element.\n * @param container The DOM element to attach the portal to.\n */\n abstract attach(container: HTMLElement): this;\n\n /**\n * Detach the portal from the DOM.\n */\n abstract detach(): Promise<void>;\n}\n\nexport class NgpComponentPortal<T> extends NgpPortal {\n private readonly componentPortal: ComponentPortal<T>;\n private viewRef: ComponentRef<T> | null = null;\n private isDestroying = false;\n private exitAnimationRef: NgpExitAnimationRef | null = null;\n\n constructor(component: Type<T>, viewContainerRef: ViewContainerRef, injector: Injector) {\n super(viewContainerRef, injector);\n this.componentPortal = new ComponentPortal(component, viewContainerRef, injector);\n }\n\n /**\n * Attach the portal to a DOM element.\n * @param container The DOM element to attach the portal to.\n */\n attach(container: HTMLElement): this {\n const domOutlet = new DomPortalOutlet(container, undefined, undefined, this.injector);\n this.viewRef = domOutlet.attach(this.componentPortal);\n\n const element = this.viewRef.location.nativeElement as HTMLElement;\n\n this.exitAnimationRef = setupExitAnimation({ element });\n\n return this;\n }\n\n /**\n * Get the root elements of the portal.\n */\n getElements(): HTMLElement[] {\n return this.viewRef ? [this.viewRef.location.nativeElement] : [];\n }\n\n /**\n * Detect changes in the portal.\n */\n detectChanges(): void {\n this.viewRef?.changeDetectorRef.detectChanges();\n }\n\n /**\n * Whether the portal is attached to a DOM element.\n */\n getAttached(): boolean {\n return !!this.viewRef && (this.viewRef.location.nativeElement as HTMLElement).isConnected;\n }\n\n /**\n * Detach the portal from the DOM.\n */\n async detach(): Promise<void> {\n if (this.isDestroying) {\n return;\n }\n this.isDestroying = true;\n\n // if there is an exit animation manager, wait for it to finish\n await this.exitAnimationRef?.exit();\n\n if (this.viewRef) {\n this.viewRef.destroy();\n this.viewRef = null;\n }\n }\n}\n\nexport class NgpTemplatePortal<T> extends NgpPortal {\n private readonly templatePortal: TemplatePortal<T>;\n private viewRef: EmbeddedViewRef<T> | null = null;\n private exitAnimationRefs: NgpExitAnimationRef[] = [];\n private isDestroying = false;\n\n constructor(\n template: TemplateRef<T>,\n viewContainerRef: ViewContainerRef,\n injector: Injector,\n context?: T,\n ) {\n super(viewContainerRef, injector);\n this.templatePortal = new TemplatePortal(template, viewContainerRef, context, injector);\n }\n\n /**\n * Attach the portal to a DOM element.\n * @param container The DOM element to attach the portal to.\n */\n attach(container: HTMLElement): this {\n const domOutlet = new DomPortalOutlet(container, undefined, undefined, this.injector);\n this.viewRef = domOutlet.attach(this.templatePortal);\n\n for (const rootNode of this.viewRef.rootNodes) {\n if (rootNode instanceof HTMLElement) {\n // Setup exit animation for each root node\n const exitAnimationRef = setupExitAnimation({ element: rootNode });\n this.exitAnimationRefs.push(exitAnimationRef);\n }\n }\n\n return this;\n }\n\n /**\n * Get the root elements of the portal.\n */\n getElements(): HTMLElement[] {\n return this.viewRef ? this.viewRef.rootNodes : [];\n }\n\n /**\n * Detect changes in the portal.\n */\n detectChanges(): void {\n this.viewRef?.detectChanges();\n }\n\n /**\n * Whether the portal is attached to a DOM element.\n */\n getAttached(): boolean {\n return !!this.viewRef && this.viewRef.rootNodes.length > 0;\n }\n\n /**\n * Detach the portal from the DOM.\n */\n async detach(): Promise<void> {\n if (this.isDestroying) {\n return;\n }\n\n this.isDestroying = true;\n\n // if there is an exit animation manager, wait for it to finish\n await Promise.all(this.exitAnimationRefs.map(ref => ref.exit()));\n\n if (this.viewRef) {\n this.viewRef.destroy();\n this.viewRef = null;\n }\n }\n}\n\nexport function createPortal<T>(\n componentOrTemplate: Type<T> | TemplateRef<T>,\n viewContainerRef: ViewContainerRef,\n injector: Injector,\n context?: T,\n): NgpPortal {\n if (componentOrTemplate instanceof TemplateRef) {\n return new NgpTemplatePortal(componentOrTemplate, viewContainerRef, injector, context);\n } else {\n return new NgpComponentPortal(componentOrTemplate, viewContainerRef, injector);\n }\n}\n","/**\n * This code is largely based on the CDK Overlay's scroll strategy implementation, however it\n * has been modified so that it does not rely on the CDK's global overlay styles.\n */\nimport { coerceCssPixelValue } from '@angular/cdk/coercion';\nimport { ViewportRuler } from '@angular/cdk/overlay';\nimport { isFunction, isObject } from 'ng-primitives/utils';\n\nexport interface ScrollStrategy {\n enable(): void;\n disable(): void;\n}\n\n/** Cached result of the check that indicates whether the browser supports scroll behaviors. */\nlet scrollBehaviorSupported: boolean | undefined;\n\nexport function supportsScrollBehavior(): boolean {\n if (scrollBehaviorSupported != null) {\n return scrollBehaviorSupported;\n }\n\n // If we're not in the browser, it can't be supported. Also check for `Element`, because\n // some projects stub out the global `document` during SSR which can throw us off.\n if (!isObject(document) || !document || !isFunction(Element) || !Element) {\n return (scrollBehaviorSupported = false);\n }\n\n // If the element can have a `scrollBehavior` style, we can be sure that it's supported.\n if ('scrollBehavior' in document.documentElement!.style) {\n return (scrollBehaviorSupported = true);\n }\n\n // Check if scrollTo is supported and if it's been polyfilled\n const scrollToFunction = Element.prototype.scrollTo;\n if (!scrollToFunction) {\n return (scrollBehaviorSupported = false);\n }\n\n // We can detect if the function has been polyfilled by calling `toString` on it. Native\n // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get\n // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider\n // polyfilled functions as supporting scroll behavior.\n return (scrollBehaviorSupported = !/\\{\\s*\\[native code\\]\\s*\\}/.test(scrollToFunction.toString()));\n}\n\ninterface HTMLStyles {\n top: string;\n left: string;\n position: string;\n overflowY: string;\n width: string;\n}\n\nexport class BlockScrollStrategy implements ScrollStrategy {\n private readonly previousHTMLStyles: HTMLStyles = {\n top: '',\n left: '',\n position: '',\n overflowY: '',\n width: '',\n };\n private previousScrollPosition = { top: 0, left: 0 };\n private isEnabled = false;\n\n constructor(\n private readonly viewportRuler: ViewportRuler,\n private readonly document: Document,\n ) {}\n\n /** Blocks page-level scroll while the attached overlay is open. */\n enable() {\n if (this.canBeEnabled()) {\n const root = this.document.documentElement!;\n\n this.previousScrollPosition = this.viewportRuler.getViewportScrollPosition();\n\n // Cache the previous inline styles in case the user had set them.\n this.previousHTMLStyles.left = root.style.left || '';\n this.previousHTMLStyles.top = root.style.top || '';\n this.previousHTMLStyles.position = root.style.position || '';\n this.previousHTMLStyles.overflowY = root.style.overflowY || '';\n this.previousHTMLStyles.width = root.style.width || '';\n\n // Set the styles to block scrolling.\n root.style.position = 'fixed';\n\n // Necessary for the content not to lose its width. Note that we're using 100%, instead of\n // 100vw, because 100vw includes the width plus the scrollbar, whereas 100% is the width\n // that the element had before we made it `fixed`.\n root.style.width = '100%';\n\n // Note: this will always add a scrollbar to whatever element it is on, which can\n // potentially result in double scrollbars. It shouldn't be an issue, because we won't\n // block scrolling on a page that doesn't have a scrollbar in the first place.\n root.style.overflowY = 'scroll';\n\n // Note: we're using the `html` node, instead of the `body`, because the `body` may\n // have the user agent margin, whereas the `html` is guaranteed not to have one.\n root.style.left = coerceCssPixelValue(-this.previousScrollPosition.left);\n root.style.top = coerceCssPixelValue(-this.previousScrollPosition.top);\n root.setAttribute('data-scrollblock', '');\n this.isEnabled = true;\n }\n }\n\n /** Unblocks page-level scroll while the attached overlay is open. */\n disable(): void {\n if (this.isEnabled) {\n const html = this.document.documentElement!;\n const body = this.document.body!;\n const htmlStyle = html.style;\n const bodyStyle = body.style;\n const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';\n const previousBodyScrollBehavior = bodyStyle.scrollBehavior || '';\n\n this.isEnabled = false;\n\n htmlStyle.left = this.previousHTMLStyles.left;\n htmlStyle.top = this.previousHTMLStyles.top;\n htmlStyle.position = this.previousHTMLStyles.position;\n htmlStyle.overflowY = this.previousHTMLStyles.overflowY;\n htmlStyle.width = this.previousHTMLStyles.width;\n html.removeAttribute('data-scrollblock');\n\n // Disable user-defined smooth scrolling temporarily while we restore the scroll position.\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior\n // Note that we don't mutate the property if the browser doesn't support `scroll-behavior`,\n // because it can throw off feature detections in `supportsScrollBehavior` which\n // checks for `'scrollBehavior' in documentElement.style`.\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';\n }\n\n window.scroll(this.previousScrollPosition.left, this.previousScrollPosition.top);\n\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = previousHtmlScrollBehavior;\n bodyStyle.scrollBehavior = previousBodyScrollBehavior;\n }\n }\n }\n\n private canBeEnabled(): boolean {\n // Since the scroll strategies can't be singletons, we have to use a global CSS class\n // (`cdk-global-scrollblock`) to make sure that we don't try to disable global\n // scrolling multiple times.\n const html = this.document.documentElement!;\n\n if (html.classList.contains('cdk-global-scrollblock') || this.isEnabled) {\n return false;\n }\n\n const viewport = this.viewportRuler.getViewportSize();\n return html.scrollHeight > viewport.height || html.scrollWidth > viewport.width;\n }\n}\n\nexport class NoopScrollStrategy implements ScrollStrategy {\n enable(): void {\n // No operation for enabling\n }\n\n disable(): void {\n // No operation for disabling\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { ViewportRuler } from '@angular/cdk/overlay';\nimport { DOCUMENT } from '@angular/common';\nimport {\n DestroyRef,\n Injector,\n Provider,\n Signal,\n TemplateRef,\n Type,\n ViewContainerRef,\n computed,\n inject,\n runInInjectionContext,\n signal,\n} from '@angular/core';\nimport {\n Middleware,\n Placement,\n Strategy,\n arrow,\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from '@floating-ui/dom';\nimport { explicitEffect, fromResizeEvent } from 'ng-primitives/internal';\nimport { injectDisposables, safeTakeUntilDestroyed, uniqueId } from 'ng-primitives/utils';\nimport { Subject, fromEvent } from 'rxjs';\nimport { NgpOffset } from './offset';\nimport { provideOverlayContext } from './overlay-token';\nimport { NgpPortal, createPortal } from './portal';\nimport { BlockScrollStrategy, NoopScrollStrategy } from './scroll-strategy';\n\n/**\n * Configuration options for creating an overlay\n * @internal\n */\nexport interface NgpOverlayConfig<T = unknown> {\n /** Content to display in the overlay (component or template) */\n content: NgpOverlayContent<T>;\n\n /** The element that triggers the overlay */\n triggerElement: HTMLElement;\n\n /** The injector to use for creating the portal */\n injector: Injector;\n /** ViewContainerRef to use for creating the portal */\n viewContainerRef: ViewContainerRef;\n\n /** Context data to pass to the overlay content */\n context?: Signal<T | undefined>;\n\n /** Container element or selector to attach the overlay to (defaults to document.body) */\n container?: HTMLElement | string | null;\n\n /** Preferred placement of the overlay relative to the trigger. */\n placement?: Signal<Placement>;\n\n /** Offset distance between the overlay and trigger. Can be a number or an object with axis-specific offsets */\n offset?: NgpOffset;\n\n /** Whether to enable flip behavior when space is limited */\n flip?: boolean;\n\n /** Delay before showing the overlay in milliseconds */\n showDelay?: number;\n\n /** Delay before hiding the overlay in milliseconds */\n hideDelay?: number;\n\n /** Whether the overlay should be positioned with fixed or absolute strategy */\n strategy?: Strategy;\n\n /** The scroll strategy to use for the overlay */\n scrollBehaviour?: 'reposition' | 'block';\n /** Whether to close the overlay when clicking outside */\n closeOnOutsideClick?: boolean;\n /** Whether to close the overlay when pressing escape */\n closeOnEscape?: boolean;\n /** Whether to restore focus to the trigger element when hiding the overlay */\n restoreFocus?: boolean;\n /** Additional middleware for floating UI positioning */\n additionalMiddleware?: Middleware[];\n\n /** Additional providers */\n providers?: Provider[];\n}\n\n/** Type for overlay content which can be either a template or component */\nexport type NgpOverlayContent<T> = TemplateRef<NgpOverlayTemplateContext<T>> | Type<unknown>;\n\n/** Context for template-based overlays */\nexport type NgpOverlayTemplateContext<T> = {\n $implicit: T;\n};\n\n/**\n * NgpOverlay manages the lifecycle and positioning of overlay UI elements.\n * It abstracts the common behavior shared by tooltips, popovers, menus, etc.\n * @internal\n */\nexport class NgpOverlay<T = unknown> {\n private readonly disposables = injectDisposables();\n private readonly document = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n private readonly viewContainerRef: ViewContainerRef;\n private readonly viewportRuler = inject(ViewportRuler);\n private readonly focusMonitor = inject(FocusMonitor);\n /** Access any parent overlays */\n private readonly parentOverlay = inject(NgpOverlay, { optional: true });\n /** Signal tracking the portal instance */\n private readonly portal = signal<NgpPortal | null>(null);\n\n /** Signal tracking the overlay position */\n readonly position = signal<{ x: number | undefined; y: number | undefined }>({\n x: undefined,\n y: undefined,\n });\n\n /**\n * Determine if the overlay has been positioned\n * @internal\n */\n readonly isPositioned = computed(\n () => this.position().x !== undefined && this.position().y !== undefined,\n );\n\n /** Signal tracking the trigger element width */\n readonly triggerWidth = signal<number | null>(null);\n\n /** The transform origin for the overlay */\n readonly transformOrigin = signal<string>('center center');\n\n /** Signal tracking the final placement of the overlay */\n readonly finalPlacement = signal<Placement | undefined>(undefined);\n\n /** Function to dispose the positioning auto-update */\n private disposePositioning?: () => void;\n\n /** Timeout handle for showing the overlay */\n private openTimeout?: () => void;\n\n /** Timeout handle for hiding the overlay */\n private closeTimeout?: () => void;\n\n /** Signal tracking whether the overlay is open */\n readonly isOpen = signal(false);\n\n /** A unique id for the overlay */\n readonly id = signal<string>(uniqueId('ngp-overlay'));\n\n /** The aria-describedby attribute for accessibility */\n readonly ariaDescribedBy = computed(() => (this.isOpen() ? this.id() : undefined));\n\n /** The scroll strategy */\n private scrollStrategy = new NoopScrollStrategy();\n\n /** An observable that emits when the overlay is closing */\n readonly closing = new Subject<void>();\n\n /** Store the arrow element */\n private arrowElement: HTMLElement | null = null;\n\n /** @internal The position of the arrow */\n readonly arrowPosition = signal<{ x: number | undefined; y: number | undefined }>({\n x: undefined,\n y: undefined,\n });\n\n /**\n * Creates a new overlay instance\n * @param config Initial configuration for the overlay\n * @param destroyRef Reference for automatic cleanup\n */\n constructor(private config: NgpOverlayConfig<T>) {\n // we cannot inject the viewContainerRef as this can throw an error during hydration in SSR\n this.viewContainerRef = config.viewContainerRef;\n\n // Listen for placement signal changes to update position\n if (config.placement) {\n explicitEffect([config.placement], () => this.updatePosition());\n }\n\n // this must be done after the config is set\n this.transformOrigin.set(this.getTransformOrigin());\n\n // Monitor trigger element resize\n fromResizeEvent(this.config.triggerElement)\n .pipe(safeTakeUntilDestroyed(this.destroyRef))\n .subscribe(({ width, height }) => {\n this.triggerWidth.set(width);\n\n // if the element has been hidden, hide immediately\n if (width === 0 || height === 0) {\n this.hideImmediate();\n }\n });\n\n // if there is a parent overlay and it is closed, close this overlay\n this.parentOverlay?.closing.pipe(safeTakeUntilDestroyed(this.destroyRef)).subscribe(() => {\n if (this.isOpen()) {\n this.hideImmediate();\n }\n });\n\n // If closeOnOutsideClick is enabled, set up a click listener\n fromEvent<MouseEvent>(this.document, 'mouseup', { capture: true })\n .pipe(safeTakeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (!this.config.closeOnOutsideClick) {\n return;\n }\n\n const overlay = this.portal();\n\n if (!overlay || !this.isOpen()) {\n return;\n }\n\n const path = event.composedPath();\n const isInsideOverlay = overlay.getElements().some(el => path.includes(el));\n const isInsideTrigger = path.includes(this.config.triggerElement);\n\n if (!isInsideOverlay && !isInsideTrigger) {\n this.hide();\n }\n });\n\n // If closeOnEscape is enabled, set up a keydown listener\n fromEvent<KeyboardEvent>(this.document, 'keydown', { capture: true })\n .pipe(safeTakeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (!this.config.closeOnEscape) return;\n if (event.key === 'Escape' && this.isOpen()) {\n this.hide({ origin: 'keyboard', immediate: true });\n }\n });\n\n // Ensure cleanup on destroy\n this.destroyRef.onDestroy(() => this.destroy());\n }\n\n /**\n * Show the overlay with the specified delay\n * @param showDelay Optional delay to override the configured showDelay\n */\n show(): Promise<void> {\n return new Promise<void>(resolve => {\n // If closing is in progress, cancel it\n if (this.closeTimeout) {\n this.closeTimeout();\n this.closeTimeout = undefined;\n }\n\n // Don't proceed if already opening or open\n if (this.openTimeout || this.isOpen()) {\n return;\n }\n\n // Use the provided delay or fall back to config\n const delay = this.config.showDelay ?? 0;\n\n this.openTimeout = this.disposables.setTimeout(() => {\n this.openTimeout = undefined;\n this.createOverlay();\n resolve();\n }, delay);\n });\n }\n\n /**\n * Stop any pending close operation. This is useful for example, if we move the mouse from the tooltip trigger to the tooltip itself.\n * This will prevent the tooltip from closing immediately when the mouse leaves the trigger.\n * @internal\n */\n cancelPendingClose(): void {\n if (this.closeTimeout) {\n this.closeTimeout();\n this.closeTimeout = undefined;\n }\n }\n\n /**\n * Hide the overlay with the specified delay\n * @param options Optional options for hiding the overlay\n */\n hide(options?: OverlayTriggerOptions): void {\n // If opening is in progress, cancel it\n if (this.openTimeout) {\n this.openTimeout();\n this.openTimeout = undefined;\n }\n\n // Don't proceed if already closing or closed unless immediate is true\n if ((this.closeTimeout && !options?.immediate) || !this.isOpen()) {\n return;\n }\n\n this.closing.next();\n\n const dispose = async () => {\n this.closeTimeout = undefined;\n\n if (this.config.restoreFocus) {\n this.focusMonitor.focusVia(this.config.triggerElement, options?.origin ?? 'program', {\n preventScroll: true,\n });\n }\n\n await this.destroyOverlay();\n };\n\n if (options?.immediate) {\n // If immediate, dispose right away\n dispose();\n } else {\n this.closeTimeout = this.disposables.setTimeout(dispose, this.config.hideDelay ?? 0);\n }\n }\n\n /**\n * Update the configuration of this overlay\n * @param config New configuration (partial)\n */\n updateConfig(config: Partial<NgpOverlayConfig<T>>): void {\n this.config = { ...this.config, ...config };\n\n // If the overlay is already open, update its position\n if (this.isOpen()) {\n this.updatePosition();\n }\n }\n\n /**\n * Immediately hide the overlay without any delay\n */\n hideImmediate(): void {\n this.hide({ immediate: true });\n }\n\n /**\n * Toggle the overlay open/closed state\n */\n toggle(): void {\n if (this.isOpen()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n /**\n * Force update the position of the overlay\n */\n updatePosition(): void {\n const portal = this.portal();\n\n if (!portal) {\n return;\n }\n\n const elements = portal.getElements();\n\n if (elements.length === 0) {\n return;\n }\n\n const overlayElement = elements[0] as HTMLElement;\n\n // Compute new position\n this.computePosition(overlayElement);\n }\n\n /**\n * Completely destroy this overlay instance\n */\n destroy(): void {\n this.hideImmediate();\n this.disposePositioning?.();\n this.scrollStrategy.disable();\n }\n\n /**\n * Get the elements of the overlay\n */\n getElements(): HTMLElement[] {\n return this.portal()?.getElements() ?? [];\n }\n\n /**\n * Internal method to create the overlay\n */\n private createOverlay(): void {\n if (!this.config.content) {\n throw new Error('Overlay content must be provided');\n }\n\n // Create a new portal with context\n const portal = createPortal(\n this.config.content,\n this.viewContainerRef,\n Injector.create({\n parent: this.config.injector,\n providers: [\n ...(this.config.providers || []),\n { provide: NgpOverlay, useValue: this },\n provideOverlayContext<T>(this.config.context),\n ],\n }),\n { $implicit: this.config.context } as NgpOverlayTemplateContext<T>,\n );\n\n // Attach portal to container\n const container = this.resolveContainer();\n portal.attach(container);\n\n // Update portal signal\n this.portal.set(portal);\n\n // Ensure view is up to date\n portal.detectChanges();\n\n // find a dedicated outlet element\n // this is the element that has the `data-overlay` attribute\n // if no such element exists, we use the first element in the portal\n const outletElement =\n portal.getElements().find(el => el.hasAttribute('data-overlay')) ?? portal.getElements()[0];\n\n if (!outletElement) {\n throw new Error('Overlay element is not available.');\n }\n\n // Set up positioning\n this.setupPositioning(outletElement);\n\n // Mark as open\n this.isOpen.set(true);\n\n this.scrollStrategy =\n this.config.scrollBehaviour === 'block'\n ? new BlockScrollStrategy(this.viewportRuler, this.document)\n : new NoopScrollStrategy();\n\n this.scrollStrategy.enable();\n }\n\n /**\n * Internal method to setup positioning of the overlay\n */\n private setupPositioning(overlayElement: HTMLElement): void {\n // Determine positioning strategy based on overlay element's CSS\n const strategy =\n getComputedStyle(overlayElement).position === 'fixed'\n ? 'fixed'\n : this.config.strategy || 'absolute';\n\n // Setup auto-update for positioning\n this.disposePositioning = autoUpdate(this.config.triggerElement, overlayElement, () =>\n this.computePosition(overlayElement, strategy),\n );\n }\n\n /**\n * Compute the overlay position using floating-ui\n */\n private async computePosition(\n overlayElement: HTMLElement,\n strategy: Strategy = 'absolute',\n ): Promise<void> {\n // Create middleware array\n const middleware: Middleware[] = [offset(this.config.offset ?? 0), shift()];\n\n // Add flip middleware if requested\n if (this.config.flip !== false) {\n middleware.push(flip());\n }\n\n // Add any additional middleware\n if (this.config.additionalMiddleware) {\n middleware.push(...this.config.additionalMiddleware);\n }\n\n // If the arrow element is registered, add arrow middleware\n if (this.arrowElement) {\n middleware.push(arrow({ element: this.arrowElement }));\n }\n\n // Compute the position\n const placement = this.config.placement?.() ?? 'top';\n\n const position = await computePosition(this.config.triggerElement, overlayElement, {\n placement,\n middleware,\n strategy,\n });\n\n // Update position signal\n this.position.set({ x: position.x, y: position.y });\n\n // Update final placement signal\n this.finalPlacement.set(position.placement);\n\n // Update arrow position if available\n if (this.arrowElement) {\n this.arrowPosition.set({\n x: position.middlewareData.arrow?.x,\n y: position.middlewareData.arrow?.y,\n });\n }\n\n // Ensure view is updated\n this.portal()?.detectChanges();\n }\n\n /**\n * Internal method to destroy the overlay portal\n */\n private async destroyOverlay(): Promise<void> {\n const portal = this.portal();\n\n if (!portal) {\n return;\n }\n\n // Clear portal reference to prevent double destruction\n this.portal.set(null);\n\n // Clean up positioning\n this.disposePositioning?.();\n this.disposePositioning = undefined;\n\n // Detach the portal\n await portal.detach();\n\n // Mark as closed\n this.isOpen.set(false);\n\n // Reset final placement\n this.finalPlacement.set(undefined);\n\n // disable scroll strategy\n this.scrollStrategy.disable();\n this.scrollStrategy = new NoopScrollStrategy();\n }\n\n /**\n * Get the transform origin for the overlay\n */\n private getTransformOrigin(): string {\n const placement = this.config.placement?.() ?? 'top';\n const basePlacement = placement.split('-')[0]; // Extract \"top\", \"bottom\", etc.\n const alignment = placement.split('-')[1]; // Extract \"start\" or \"end\"\n\n const map: Record<string, string> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n };\n\n let x = 'center';\n let y = 'center';\n\n if (basePlacement === 'top' || basePlacement === 'bottom') {\n y = map[basePlacement];\n if (alignment === 'start') x = 'left';\n else if (alignment === 'end') x = 'right';\n } else {\n x = map[basePlacement];\n if (alignment === 'start') y = 'top';\n else if (alignment === 'end') y = 'bottom';\n }\n\n return `${y} ${x}`;\n }\n\n /**\n * Register the arrow element for positioning\n * @internal\n */\n registerArrow(arrowElement: HTMLElement | null): void {\n this.arrowElement = arrowElement;\n }\n\n /**\n * Remove the registered arrow element\n * @internal\n */\n unregisterArrow(): void {\n this.arrowElement = null;\n }\n\n /**\n * Resolve the container element from the configuration\n * @internal\n */\n private resolveContainer(): HTMLElement {\n if (!this.config.container) {\n return this.document.body;\n }\n\n if (typeof this.config.container === 'string') {\n const element = this.document.querySelector(this.config.container);\n if (!element) {\n // Fallback to document.body if the container is not found\n console.warn(\n `NgPrimitives: Container element with selector \"${this.config.container}\" not found. Falling back to document.body.`,\n );\n return this.document.body;\n }\n\n return element as HTMLElement;\n }\n\n return this.config.container;\n }\n}\n\n/**\n * Helper function to create an overlay in a single call\n * @internal\n */\nexport function createOverlay<T>(config: NgpOverlayConfig<T>): NgpOverlay<T> {\n // we run the overlay creation in the injector context to ensure that it can call the inject function\n return runInInjectionContext(config.injector, () => new NgpOverlay<T>(config));\n}\n\n/**\n * Helper function to inject the NgpOverlay instance\n * @internal\n */\nexport function injectOverlay<T>(): NgpOverlay<T> {\n return inject(NgpOverlay);\n}\n\nexport interface OverlayTriggerOptions {\n /**\n * Whether the visibility change should be immediate.\n */\n immediate?: boolean;\n /**\n * The origin of the focus event that triggered the visibility change.\n */\n origin?: FocusOrigin;\n}\n","import { DestroyRef, afterRenderEffect, inject } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectOverlay } from './overlay';\n\nexport function setupOverlayArrow(): void {\n const overlay = injectOverlay();\n const element = injectElementRef();\n const destroyRef = inject(DestroyRef);\n\n // register the arrow element with the overlay\n overlay.registerArrow(element.nativeElement);\n\n // cleanup the arrow element on destroy\n destroyRef.onDestroy(() => overlay.unregisterArrow());\n\n // update the arrow position after the overlay is rendered\n afterRenderEffect(() => {\n const position = overlay.arrowPosition();\n element.nativeElement.style.setProperty('inset-inline-start', `${position.x}px`);\n element.nativeElement.style.setProperty('inset-block-start', `${position.y}px`);\n element.nativeElement.dataset['placement'] = overlay.finalPlacement();\n });\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isObject, isNil } from 'ng-primitives/utils';\n\n/**\n * Options for configuring offset between a floating element and its reference element.\n * Can be a single number for uniform offset or an object for axis-specific control.\n */\nexport interface NgpOffsetOptions {\n /**\n * The offset along the main axis (the axis that runs along the side of the floating element).\n * Represents the distance between the floating element and the reference element.\n * @default 0\n */\n mainAxis?: number;\n\n /**\n * The offset along the cross axis (the axis that runs along the alignment of the floating element).\n * Represents the skidding between the floating element and the reference element.\n * @default 0\n */\n crossAxis?: number;\n\n /**\n * Same axis as crossAxis but applies only to aligned placements and inverts the end alignment.\n * When set to a number, it overrides the crossAxis value.\n * @default null\n */\n alignmentAxis?: number | null;\n}\n\n/**\n * Type representing all valid offset values.\n * Can be a number (applies to mainAxis) or an object with axis-specific offsets.\n */\nexport type NgpOffset = number | NgpOffsetOptions;\n\n/**\n * Input type for offset that also accepts string representations of numbers\n */\nexport type NgpOffsetInput = NgpOffset | string;\n\n/**\n * Transform function to coerce offset input values to the correct type\n * @param value The input value to coerce\n * @returns The coerced offset value\n */\nexport function coerceOffset(value: NgpOffsetInput | null | undefined): NgpOffset {\n if (isNil(value)) {\n return 0;\n }\n\n if (isObject(value)) {\n return value;\n }\n\n // Use CDK's coerceNumberProperty for consistent number coercion\n // This handles strings, numbers, and other input types just like Angular CDK inputs\n return coerceNumberProperty(value, 0);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAEA,MAAM,sBAAsB,GAAG,IAAI,cAAc,CAAU,wBAAwB,CAAC;AAEpF;;;AAGG;SACa,oBAAoB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,sBAAsB,CAAc;AACpD;AAEA;;;;AAIG;AACG,SAAU,qBAAqB,CAAI,KAAwC,EAAA;IAC/E,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE;AAC7D;;MCRsB,SAAS,CAAA;IAC7B,WAAA,CACqB,gBAAkC,EAClC,QAAkB,EAAA;QADlB,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAChB,IAAA,CAAA,QAAQ,GAAR,QAAQ;IAC1B;AA2BJ;AAEK,MAAO,kBAAsB,SAAQ,SAAS,CAAA;AAMlD,IAAA,WAAA,CAAY,SAAkB,EAAE,gBAAkC,EAAE,QAAkB,EAAA;AACpF,QAAA,KAAK,CAAC,gBAAgB,EAAE,QAAQ,CAAC;QAL3B,IAAA,CAAA,OAAO,GAA2B,IAAI;QACtC,IAAA,CAAA,YAAY,GAAG,KAAK;QACpB,IAAA,CAAA,gBAAgB,GAA+B,IAAI;AAIzD,QAAA,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,SAAS,EAAE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GrC,IAAA,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC;;IAG5C,UAAU,CAAC,SAAS,CAAC,MAAM,OAAO,CAAC,eAAe,EAAE,CAAC;;IAGrD,iBAAiB,CAAC,MAAK;AACrB,QAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,aAAa,EAAE;AACxC,QAAA,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,oBAAoB,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAA,EAAA,CAAI,CAAC;AAChF,QAAA,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,mBAAmB,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAA,EAAA,CAAI,CAAC;AAC/E,QAAA,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,cAAc,EAAE;AACvE,IAAA,CAAC,CAAC;AACJ;;ACmBA;;;;AAIG;AACG,SAAU,YAAY,CAAC,KAAwC,EAAA;AACnE,IAAA,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE;AAChB,QAAA,OAAO,CAAC;IACV;AAEA,IAAA,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;AACnB,QAAA,OAAO,KAAK;IACd;;;AAIA,IAAA,OAAO,oBAAoB,CAAC,KAAK,EAAE,CAAC,CAAC;AACvC;;AC1DA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-portal.mjs","sources":["../../../../packages/ng-primitives/portal/src/overlay-token.ts","../../../../packages/ng-primitives/portal/src/portal.ts","../../../../packages/ng-primitives/portal/src/scroll-strategy.ts","../../../../packages/ng-primitives/portal/src/overlay.ts","../../../../packages/ng-primitives/portal/src/overlay-arrow.ts","../../../../packages/ng-primitives/portal/src/offset.ts","../../../../packages/ng-primitives/portal/src/ng-primitives-portal.ts"],"sourcesContent":["import { inject, InjectionToken, Signal, ValueProvider } from '@angular/core';\n\nconst NgpOverlayContextToken = new InjectionToken<unknown>('NgpOverlayContextToken');\n\n/**\n * Injects the context for the overlay.\n * @internal\n */\nexport function injectOverlayContext<T>(): Signal<T> {\n return inject(NgpOverlayContextToken) as Signal<T>;\n}\n\n/**\n * Provides the context for the overlay.\n * @param value The value to provide as the context.\n * @internal\n */\nexport function provideOverlayContext<T>(value: Signal<T | undefined> | undefined): ValueProvider {\n return { provide: NgpOverlayContextToken, useValue: value };\n}\n","import { ComponentPortal, DomPortalOutlet, TemplatePortal } from '@angular/cdk/portal';\nimport {\n ComponentRef,\n EmbeddedViewRef,\n Injector,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport { NgpExitAnimationRef, setupExitAnimation } from 'ng-primitives/internal';\n\nexport abstract class NgpPortal {\n constructor(\n protected readonly viewContainerRef: ViewContainerRef,\n protected readonly injector: Injector,\n ) {}\n\n /**\n * Get the elements of the portal.\n */\n abstract getElements(): HTMLElement[];\n\n /**\n * Detect changes in the portal.\n */\n abstract detectChanges(): void;\n\n /**\n * Whether the portal is attached to a DOM element.\n */\n abstract getAttached(): boolean;\n\n /**\n * Attach the portal to a DOM element.\n * @param container The DOM element to attach the portal to.\n */\n abstract attach(container: HTMLElement): this;\n\n /**\n * Detach the portal from the DOM.\n */\n abstract detach(): Promise<void>;\n}\n\nexport class NgpComponentPortal<T> extends NgpPortal {\n private readonly componentPortal: ComponentPortal<T>;\n private viewRef: ComponentRef<T> | null = null;\n private isDestroying = false;\n private exitAnimationRef: NgpExitAnimationRef | null = null;\n\n constructor(component: Type<T>, viewContainerRef: ViewContainerRef, injector: Injector) {\n super(viewContainerRef, injector);\n this.componentPortal = new ComponentPortal(component, viewContainerRef, injector);\n }\n\n /**\n * Attach the portal to a DOM element.\n * @param container The DOM element to attach the portal to.\n */\n attach(container: HTMLElement): this {\n const domOutlet = new DomPortalOutlet(container, undefined, undefined, this.injector);\n this.viewRef = domOutlet.attach(this.componentPortal);\n\n const element = this.viewRef.location.nativeElement as HTMLElement;\n\n this.exitAnimationRef = setupExitAnimation({ element });\n\n return this;\n }\n\n /**\n * Get the root elements of the portal.\n */\n getElements(): HTMLElement[] {\n return this.viewRef ? [this.viewRef.location.nativeElement] : [];\n }\n\n /**\n * Detect changes in the portal.\n */\n detectChanges(): void {\n this.viewRef?.changeDetectorRef.detectChanges();\n }\n\n /**\n * Whether the portal is attached to a DOM element.\n */\n getAttached(): boolean {\n return !!this.viewRef && (this.viewRef.location.nativeElement as HTMLElement).isConnected;\n }\n\n /**\n * Detach the portal from the DOM.\n */\n async detach(): Promise<void> {\n if (this.isDestroying) {\n return;\n }\n this.isDestroying = true;\n\n // if there is an exit animation manager, wait for it to finish\n await this.exitAnimationRef?.exit();\n\n if (this.viewRef) {\n this.viewRef.destroy();\n this.viewRef = null;\n }\n }\n}\n\nexport class NgpTemplatePortal<T> extends NgpPortal {\n private readonly templatePortal: TemplatePortal<T>;\n private viewRef: EmbeddedViewRef<T> | null = null;\n private exitAnimationRefs: NgpExitAnimationRef[] = [];\n private isDestroying = false;\n\n constructor(\n template: TemplateRef<T>,\n viewContainerRef: ViewContainerRef,\n injector: Injector,\n context?: T,\n ) {\n super(viewContainerRef, injector);\n this.templatePortal = new TemplatePortal(template, viewContainerRef, context, injector);\n }\n\n /**\n * Attach the portal to a DOM element.\n * @param container The DOM element to attach the portal to.\n */\n attach(container: HTMLElement): this {\n const domOutlet = new DomPortalOutlet(container, undefined, undefined, this.injector);\n this.viewRef = domOutlet.attach(this.templatePortal);\n\n for (const rootNode of this.viewRef.rootNodes) {\n if (rootNode instanceof HTMLElement) {\n // Setup exit animation for each root node\n const exitAnimationRef = setupExitAnimation({ element: rootNode });\n this.exitAnimationRefs.push(exitAnimationRef);\n }\n }\n\n return this;\n }\n\n /**\n * Get the root elements of the portal.\n */\n getElements(): HTMLElement[] {\n return this.viewRef ? this.viewRef.rootNodes : [];\n }\n\n /**\n * Detect changes in the portal.\n */\n detectChanges(): void {\n this.viewRef?.detectChanges();\n }\n\n /**\n * Whether the portal is attached to a DOM element.\n */\n getAttached(): boolean {\n return !!this.viewRef && this.viewRef.rootNodes.length > 0;\n }\n\n /**\n * Detach the portal from the DOM.\n */\n async detach(): Promise<void> {\n if (this.isDestroying) {\n return;\n }\n\n this.isDestroying = true;\n\n // if there is an exit animation manager, wait for it to finish\n await Promise.all(this.exitAnimationRefs.map(ref => ref.exit()));\n\n if (this.viewRef) {\n this.viewRef.destroy();\n this.viewRef = null;\n }\n }\n}\n\nexport function createPortal<T>(\n componentOrTemplate: Type<T> | TemplateRef<T>,\n viewContainerRef: ViewContainerRef,\n injector: Injector,\n context?: T,\n): NgpPortal {\n if (componentOrTemplate instanceof TemplateRef) {\n return new NgpTemplatePortal(componentOrTemplate, viewContainerRef, injector, context);\n } else {\n return new NgpComponentPortal(componentOrTemplate, viewContainerRef, injector);\n }\n}\n","/**\n * This code is largely based on the CDK Overlay's scroll strategy implementation, however it\n * has been modified so that it does not rely on the CDK's global overlay styles.\n */\nimport { coerceCssPixelValue } from '@angular/cdk/coercion';\nimport { ViewportRuler } from '@angular/cdk/overlay';\nimport { isFunction, isObject } from 'ng-primitives/utils';\n\nexport interface ScrollStrategy {\n enable(): void;\n disable(): void;\n}\n\n/** Cached result of the check that indicates whether the browser supports scroll behaviors. */\nlet scrollBehaviorSupported: boolean | undefined;\n\nexport function supportsScrollBehavior(): boolean {\n if (scrollBehaviorSupported != null) {\n return scrollBehaviorSupported;\n }\n\n // If we're not in the browser, it can't be supported. Also check for `Element`, because\n // some projects stub out the global `document` during SSR which can throw us off.\n if (!isObject(document) || !document || !isFunction(Element) || !Element) {\n return (scrollBehaviorSupported = false);\n }\n\n // If the element can have a `scrollBehavior` style, we can be sure that it's supported.\n if ('scrollBehavior' in document.documentElement!.style) {\n return (scrollBehaviorSupported = true);\n }\n\n // Check if scrollTo is supported and if it's been polyfilled\n const scrollToFunction = Element.prototype.scrollTo;\n if (!scrollToFunction) {\n return (scrollBehaviorSupported = false);\n }\n\n // We can detect if the function has been polyfilled by calling `toString` on it. Native\n // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get\n // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider\n // polyfilled functions as supporting scroll behavior.\n return (scrollBehaviorSupported = !/\\{\\s*\\[native code\\]\\s*\\}/.test(scrollToFunction.toString()));\n}\n\ninterface HTMLStyles {\n top: string;\n left: string;\n position: string;\n overflowY: string;\n width: string;\n}\n\nexport class BlockScrollStrategy implements ScrollStrategy {\n private readonly previousHTMLStyles: HTMLStyles = {\n top: '',\n left: '',\n position: '',\n overflowY: '',\n width: '',\n };\n private previousScrollPosition = { top: 0, left: 0 };\n private isEnabled = false;\n\n constructor(\n private readonly viewportRuler: ViewportRuler,\n private readonly document: Document,\n ) {}\n\n /** Blocks page-level scroll while the attached overlay is open. */\n enable() {\n if (this.canBeEnabled()) {\n const root = this.document.documentElement!;\n\n this.previousScrollPosition = this.viewportRuler.getViewportScrollPosition();\n\n // Cache the previous inline styles in case the user had set them.\n this.previousHTMLStyles.left = root.style.left || '';\n this.previousHTMLStyles.top = root.style.top || '';\n this.previousHTMLStyles.position = root.style.position || '';\n this.previousHTMLStyles.overflowY = root.style.overflowY || '';\n this.previousHTMLStyles.width = root.style.width || '';\n\n // Set the styles to block scrolling.\n root.style.position = 'fixed';\n\n // Necessary for the content not to lose its width. Note that we're using 100%, instead of\n // 100vw, because 100vw includes the width plus the scrollbar, whereas 100% is the width\n // that the element had before we made it `fixed`.\n root.style.width = '100%';\n\n // Note: this will always add a scrollbar to whatever element it is on, which can\n // potentially result in double scrollbars. It shouldn't be an issue, because we won't\n // block scrolling on a page that doesn't have a scrollbar in the first place.\n root.style.overflowY = 'scroll';\n\n // Note: we're using the `html` node, instead of the `body`, because the `body` may\n // have the user agent margin, whereas the `html` is guaranteed not to have one.\n root.style.left = coerceCssPixelValue(-this.previousScrollPosition.left);\n root.style.top = coerceCssPixelValue(-this.previousScrollPosition.top);\n root.setAttribute('data-scrollblock', '');\n this.isEnabled = true;\n }\n }\n\n /** Unblocks page-level scroll while the attached overlay is open. */\n disable(): void {\n if (this.isEnabled) {\n const html = this.document.documentElement!;\n const body = this.document.body!;\n const htmlStyle = html.style;\n const bodyStyle = body.style;\n const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';\n const previousBodyScrollBehavior = bodyStyle.scrollBehavior || '';\n\n this.isEnabled = false;\n\n htmlStyle.left = this.previousHTMLStyles.left;\n htmlStyle.top = this.previousHTMLStyles.top;\n htmlStyle.position = this.previousHTMLStyles.position;\n htmlStyle.overflowY = this.previousHTMLStyles.overflowY;\n htmlStyle.width = this.previousHTMLStyles.width;\n html.removeAttribute('data-scrollblock');\n\n // Disable user-defined smooth scrolling temporarily while we restore the scroll position.\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior\n // Note that we don't mutate the property if the browser doesn't support `scroll-behavior`,\n // because it can throw off feature detections in `supportsScrollBehavior` which\n // checks for `'scrollBehavior' in documentElement.style`.\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';\n }\n\n window.scroll(this.previousScrollPosition.left, this.previousScrollPosition.top);\n\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = previousHtmlScrollBehavior;\n bodyStyle.scrollBehavior = previousBodyScrollBehavior;\n }\n }\n }\n\n private canBeEnabled(): boolean {\n // Since the scroll strategies can't be singletons, we have to use a global CSS class\n // (`cdk-global-scrollblock`) to make sure that we don't try to disable global\n // scrolling multiple times.\n const html = this.document.documentElement!;\n\n if (html.classList.contains('cdk-global-scrollblock') || this.isEnabled) {\n return false;\n }\n\n const viewport = this.viewportRuler.getViewportSize();\n return html.scrollHeight > viewport.height || html.scrollWidth > viewport.width;\n }\n}\n\nexport class NoopScrollStrategy implements ScrollStrategy {\n enable(): void {\n // No operation for enabling\n }\n\n disable(): void {\n // No operation for disabling\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { ViewportRuler } from '@angular/cdk/overlay';\nimport { DOCUMENT } from '@angular/common';\nimport {\n DestroyRef,\n Injector,\n Provider,\n Signal,\n TemplateRef,\n Type,\n ViewContainerRef,\n computed,\n inject,\n runInInjectionContext,\n signal,\n} from '@angular/core';\nimport {\n Middleware,\n Placement,\n Strategy,\n arrow,\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from '@floating-ui/dom';\nimport { explicitEffect, fromResizeEvent } from 'ng-primitives/internal';\nimport { injectDisposables, safeTakeUntilDestroyed, uniqueId } from 'ng-primitives/utils';\nimport { Subject, fromEvent } from 'rxjs';\nimport { NgpOffset } from './offset';\nimport { provideOverlayContext } from './overlay-token';\nimport { NgpPortal, createPortal } from './portal';\nimport { BlockScrollStrategy, NoopScrollStrategy } from './scroll-strategy';\n\n/**\n * Configuration options for creating an overlay\n * @internal\n */\nexport interface NgpOverlayConfig<T = unknown> {\n /** Content to display in the overlay (component or template) */\n content: NgpOverlayContent<T>;\n\n /** The element that triggers the overlay */\n triggerElement: HTMLElement;\n\n /** The element to use for positioning the overlay (if different from trigger) */\n anchorElement?: HTMLElement | null;\n\n /** The injector to use for creating the portal */\n injector: Injector;\n /** ViewContainerRef to use for creating the portal */\n viewContainerRef: ViewContainerRef;\n\n /** Context data to pass to the overlay content */\n context?: Signal<T | undefined>;\n\n /** Container element or selector to attach the overlay to (defaults to document.body) */\n container?: HTMLElement | string | null;\n\n /** Preferred placement of the overlay relative to the trigger. */\n placement?: Signal<Placement>;\n\n /** Offset distance between the overlay and trigger. Can be a number or an object with axis-specific offsets */\n offset?: NgpOffset;\n\n /** Whether to enable flip behavior when space is limited */\n flip?: boolean;\n\n /** Delay before showing the overlay in milliseconds */\n showDelay?: number;\n\n /** Delay before hiding the overlay in milliseconds */\n hideDelay?: number;\n\n /** Whether the overlay should be positioned with fixed or absolute strategy */\n strategy?: Strategy;\n\n /** The scroll strategy to use for the overlay */\n scrollBehaviour?: 'reposition' | 'block';\n /** Whether to close the overlay when clicking outside */\n closeOnOutsideClick?: boolean;\n /** Whether to close the overlay when pressing escape */\n closeOnEscape?: boolean;\n /** Whether to restore focus to the trigger element when hiding the overlay */\n restoreFocus?: boolean;\n /** Additional middleware for floating UI positioning */\n additionalMiddleware?: Middleware[];\n\n /** Additional providers */\n providers?: Provider[];\n}\n\n/** Type for overlay content which can be either a template or component */\nexport type NgpOverlayContent<T> = TemplateRef<NgpOverlayTemplateContext<T>> | Type<unknown>;\n\n/** Context for template-based overlays */\nexport type NgpOverlayTemplateContext<T> = {\n $implicit: T;\n};\n\n/**\n * NgpOverlay manages the lifecycle and positioning of overlay UI elements.\n * It abstracts the common behavior shared by tooltips, popovers, menus, etc.\n * @internal\n */\nexport class NgpOverlay<T = unknown> {\n private readonly disposables = injectDisposables();\n private readonly document = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n private readonly viewContainerRef: ViewContainerRef;\n private readonly viewportRuler = inject(ViewportRuler);\n private readonly focusMonitor = inject(FocusMonitor);\n /** Access any parent overlays */\n private readonly parentOverlay = inject(NgpOverlay, { optional: true });\n /** Signal tracking the portal instance */\n private readonly portal = signal<NgpPortal | null>(null);\n\n /** Signal tracking the overlay position */\n readonly position = signal<{ x: number | undefined; y: number | undefined }>({\n x: undefined,\n y: undefined,\n });\n\n /**\n * Determine if the overlay has been positioned\n * @internal\n */\n readonly isPositioned = computed(\n () => this.position().x !== undefined && this.position().y !== undefined,\n );\n\n /** Signal tracking the trigger element width */\n readonly triggerWidth = signal<number | null>(null);\n\n /** The transform origin for the overlay */\n readonly transformOrigin = signal<string>('center center');\n\n /** Signal tracking the final placement of the overlay */\n readonly finalPlacement = signal<Placement | undefined>(undefined);\n\n /** Function to dispose the positioning auto-update */\n private disposePositioning?: () => void;\n\n /** Timeout handle for showing the overlay */\n private openTimeout?: () => void;\n\n /** Timeout handle for hiding the overlay */\n private closeTimeout?: () => void;\n\n /** Signal tracking whether the overlay is open */\n readonly isOpen = signal(false);\n\n /** A unique id for the overlay */\n readonly id = signal<string>(uniqueId('ngp-overlay'));\n\n /** The aria-describedby attribute for accessibility */\n readonly ariaDescribedBy = computed(() => (this.isOpen() ? this.id() : undefined));\n\n /** The scroll strategy */\n private scrollStrategy = new NoopScrollStrategy();\n\n /** An observable that emits when the overlay is closing */\n readonly closing = new Subject<void>();\n\n /** Store the arrow element */\n private arrowElement: HTMLElement | null = null;\n\n /** @internal The position of the arrow */\n readonly arrowPosition = signal<{ x: number | undefined; y: number | undefined }>({\n x: undefined,\n y: undefined,\n });\n\n /**\n * Creates a new overlay instance\n * @param config Initial configuration for the overlay\n * @param destroyRef Reference for automatic cleanup\n */\n constructor(private config: NgpOverlayConfig<T>) {\n // we cannot inject the viewContainerRef as this can throw an error during hydration in SSR\n this.viewContainerRef = config.viewContainerRef;\n\n // Listen for placement signal changes to update position\n if (config.placement) {\n explicitEffect([config.placement], () => this.updatePosition());\n }\n\n // this must be done after the config is set\n this.transformOrigin.set(this.getTransformOrigin());\n\n // Monitor trigger element resize\n const elementToMonitor = this.config.anchorElement || this.config.triggerElement;\n fromResizeEvent(elementToMonitor)\n .pipe(safeTakeUntilDestroyed(this.destroyRef))\n .subscribe(({ width, height }) => {\n this.triggerWidth.set(width);\n\n // if the element has been hidden, hide immediately\n if (width === 0 || height === 0) {\n this.hideImmediate();\n }\n });\n\n // if there is a parent overlay and it is closed, close this overlay\n this.parentOverlay?.closing.pipe(safeTakeUntilDestroyed(this.destroyRef)).subscribe(() => {\n if (this.isOpen()) {\n this.hideImmediate();\n }\n });\n\n // If closeOnOutsideClick is enabled, set up a click listener\n fromEvent<MouseEvent>(this.document, 'mouseup', { capture: true })\n .pipe(safeTakeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (!this.config.closeOnOutsideClick) {\n return;\n }\n\n const overlay = this.portal();\n\n if (!overlay || !this.isOpen()) {\n return;\n }\n\n const path = event.composedPath();\n const isInsideOverlay = overlay.getElements().some(el => path.includes(el));\n const isInsideTrigger = path.includes(this.config.triggerElement);\n const isInsideAnchor = this.config.anchorElement\n ? path.includes(this.config.anchorElement)\n : false;\n\n if (!isInsideOverlay && !isInsideTrigger && !isInsideAnchor) {\n this.hide();\n }\n });\n\n // If closeOnEscape is enabled, set up a keydown listener\n fromEvent<KeyboardEvent>(this.document, 'keydown', { capture: true })\n .pipe(safeTakeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (!this.config.closeOnEscape) return;\n if (event.key === 'Escape' && this.isOpen()) {\n this.hide({ origin: 'keyboard', immediate: true });\n }\n });\n\n // Ensure cleanup on destroy\n this.destroyRef.onDestroy(() => this.destroy());\n }\n\n /**\n * Show the overlay with the specified delay\n * @param showDelay Optional delay to override the configured showDelay\n */\n show(): Promise<void> {\n return new Promise<void>(resolve => {\n // If closing is in progress, cancel it\n if (this.closeTimeout) {\n this.closeTimeout();\n this.closeTimeout = undefined;\n }\n\n // Don't proceed if already opening or open\n if (this.openTimeout || this.isOpen()) {\n return;\n }\n\n // Use the provided delay or fall back to config\n const delay = this.config.showDelay ?? 0;\n\n this.openTimeout = this.disposables.setTimeout(() => {\n this.openTimeout = undefined;\n this.createOverlay();\n resolve();\n }, delay);\n });\n }\n\n /**\n * Stop any pending close operation. This is useful for example, if we move the mouse from the tooltip trigger to the tooltip itself.\n * This will prevent the tooltip from closing immediately when the mouse leaves the trigger.\n * @internal\n */\n cancelPendingClose(): void {\n if (this.closeTimeout) {\n this.closeTimeout();\n this.closeTimeout = undefined;\n }\n }\n\n /**\n * Hide the overlay with the specified delay\n * @param options Optional options for hiding the overlay\n */\n hide(options?: OverlayTriggerOptions): void {\n // If opening is in progress, cancel it\n if (this.openTimeout) {\n this.openTimeout();\n this.openTimeout = undefined;\n }\n\n // Don't proceed if already closing or closed unless immediate is true\n if ((this.closeTimeout && !options?.immediate) || !this.isOpen()) {\n return;\n }\n\n this.closing.next();\n\n const dispose = async () => {\n this.closeTimeout = undefined;\n\n if (this.config.restoreFocus) {\n this.focusMonitor.focusVia(this.config.triggerElement, options?.origin ?? 'program', {\n preventScroll: true,\n });\n }\n\n await this.destroyOverlay();\n };\n\n if (options?.immediate) {\n // If immediate, dispose right away\n dispose();\n } else {\n this.closeTimeout = this.disposables.setTimeout(dispose, this.config.hideDelay ?? 0);\n }\n }\n\n /**\n * Update the configuration of this overlay\n * @param config New configuration (partial)\n */\n updateConfig(config: Partial<NgpOverlayConfig<T>>): void {\n this.config = { ...this.config, ...config };\n\n // If the overlay is already open, update its position\n if (this.isOpen()) {\n this.updatePosition();\n }\n }\n\n /**\n * Immediately hide the overlay without any delay\n */\n hideImmediate(): void {\n this.hide({ immediate: true });\n }\n\n /**\n * Toggle the overlay open/closed state\n */\n toggle(): void {\n if (this.isOpen()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n /**\n * Force update the position of the overlay\n */\n updatePosition(): void {\n const portal = this.portal();\n\n if (!portal) {\n return;\n }\n\n const elements = portal.getElements();\n\n if (elements.length === 0) {\n return;\n }\n\n const overlayElement = elements[0] as HTMLElement;\n\n // Compute new position\n this.computePosition(overlayElement);\n }\n\n /**\n * Completely destroy this overlay instance\n */\n destroy(): void {\n this.hideImmediate();\n this.disposePositioning?.();\n this.scrollStrategy.disable();\n }\n\n /**\n * Get the elements of the overlay\n */\n getElements(): HTMLElement[] {\n return this.portal()?.getElements() ?? [];\n }\n\n /**\n * Internal method to create the overlay\n */\n private createOverlay(): void {\n if (!this.config.content) {\n throw new Error('Overlay content must be provided');\n }\n\n // Create a new portal with context\n const portal = createPortal(\n this.config.content,\n this.viewContainerRef,\n Injector.create({\n parent: this.config.injector,\n providers: [\n ...(this.config.providers || []),\n { provide: NgpOverlay, useValue: this },\n provideOverlayContext<T>(this.config.context),\n ],\n }),\n { $implicit: this.config.context } as NgpOverlayTemplateContext<T>,\n );\n\n // Attach portal to container\n const container = this.resolveContainer();\n portal.attach(container);\n\n // Update portal signal\n this.portal.set(portal);\n\n // Ensure view is up to date\n portal.detectChanges();\n\n // find a dedicated outlet element\n // this is the element that has the `data-overlay` attribute\n // if no such element exists, we use the first element in the portal\n const outletElement =\n portal.getElements().find(el => el.hasAttribute('data-overlay')) ?? portal.getElements()[0];\n\n if (!outletElement) {\n throw new Error('Overlay element is not available.');\n }\n\n // Set up positioning\n this.setupPositioning(outletElement);\n\n // Mark as open\n this.isOpen.set(true);\n\n this.scrollStrategy =\n this.config.scrollBehaviour === 'block'\n ? new BlockScrollStrategy(this.viewportRuler, this.document)\n : new NoopScrollStrategy();\n\n this.scrollStrategy.enable();\n }\n\n /**\n * Internal method to setup positioning of the overlay\n */\n private setupPositioning(overlayElement: HTMLElement): void {\n // Determine positioning strategy based on overlay element's CSS\n const strategy =\n getComputedStyle(overlayElement).position === 'fixed'\n ? 'fixed'\n : this.config.strategy || 'absolute';\n\n // Use anchor element for positioning if provided, otherwise use trigger element\n const referenceElement = this.config.anchorElement || this.config.triggerElement;\n\n // Setup auto-update for positioning\n this.disposePositioning = autoUpdate(referenceElement, overlayElement, () =>\n this.computePosition(overlayElement, strategy),\n );\n }\n\n /**\n * Compute the overlay position using floating-ui\n */\n private async computePosition(\n overlayElement: HTMLElement,\n strategy: Strategy = 'absolute',\n ): Promise<void> {\n // Create middleware array\n const middleware: Middleware[] = [offset(this.config.offset ?? 0), shift()];\n\n // Add flip middleware if requested\n if (this.config.flip !== false) {\n middleware.push(flip());\n }\n\n // Add any additional middleware\n if (this.config.additionalMiddleware) {\n middleware.push(...this.config.additionalMiddleware);\n }\n\n // If the arrow element is registered, add arrow middleware\n if (this.arrowElement) {\n middleware.push(arrow({ element: this.arrowElement }));\n }\n\n // Compute the position\n const placement = this.config.placement?.() ?? 'top';\n\n // Use anchor element for positioning if provided, otherwise use trigger element\n const referenceElement = this.config.anchorElement || this.config.triggerElement;\n\n const position = await computePosition(referenceElement, overlayElement, {\n placement,\n middleware,\n strategy,\n });\n\n // Update position signal\n this.position.set({ x: position.x, y: position.y });\n\n // Update final placement signal\n this.finalPlacement.set(position.placement);\n\n // Update arrow position if available\n if (this.arrowElement) {\n this.arrowPosition.set({\n x: position.middlewareData.arrow?.x,\n y: position.middlewareData.arrow?.y,\n });\n }\n\n // Ensure view is updated\n this.portal()?.detectChanges();\n }\n\n /**\n * Internal method to destroy the overlay portal\n */\n private async destroyOverlay(): Promise<void> {\n const portal = this.portal();\n\n if (!portal) {\n return;\n }\n\n // Clear portal reference to prevent double destruction\n this.portal.set(null);\n\n // Clean up positioning\n this.disposePositioning?.();\n this.disposePositioning = undefined;\n\n // Detach the portal\n await portal.detach();\n\n // Mark as closed\n this.isOpen.set(false);\n\n // Reset final placement\n this.finalPlacement.set(undefined);\n\n // disable scroll strategy\n this.scrollStrategy.disable();\n this.scrollStrategy = new NoopScrollStrategy();\n }\n\n /**\n * Get the transform origin for the overlay\n */\n private getTransformOrigin(): string {\n const placement = this.config.placement?.() ?? 'top';\n const basePlacement = placement.split('-')[0]; // Extract \"top\", \"bottom\", etc.\n const alignment = placement.split('-')[1]; // Extract \"start\" or \"end\"\n\n const map: Record<string, string> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n };\n\n let x = 'center';\n let y = 'center';\n\n if (basePlacement === 'top' || basePlacement === 'bottom') {\n y = map[basePlacement];\n if (alignment === 'start') x = 'left';\n else if (alignment === 'end') x = 'right';\n } else {\n x = map[basePlacement];\n if (alignment === 'start') y = 'top';\n else if (alignment === 'end') y = 'bottom';\n }\n\n return `${y} ${x}`;\n }\n\n /**\n * Register the arrow element for positioning\n * @internal\n */\n registerArrow(arrowElement: HTMLElement | null): void {\n this.arrowElement = arrowElement;\n }\n\n /**\n * Remove the registered arrow element\n * @internal\n */\n unregisterArrow(): void {\n this.arrowElement = null;\n }\n\n /**\n * Resolve the container element from the configuration\n * @internal\n */\n private resolveContainer(): HTMLElement {\n if (!this.config.container) {\n return this.document.body;\n }\n\n if (typeof this.config.container === 'string') {\n const element = this.document.querySelector(this.config.container);\n if (!element) {\n // Fallback to document.body if the container is not found\n console.warn(\n `NgPrimitives: Container element with selector \"${this.config.container}\" not found. Falling back to document.body.`,\n );\n return this.document.body;\n }\n\n return element as HTMLElement;\n }\n\n return this.config.container;\n }\n}\n\n/**\n * Helper function to create an overlay in a single call\n * @internal\n */\nexport function createOverlay<T>(config: NgpOverlayConfig<T>): NgpOverlay<T> {\n // we run the overlay creation in the injector context to ensure that it can call the inject function\n return runInInjectionContext(config.injector, () => new NgpOverlay<T>(config));\n}\n\n/**\n * Helper function to inject the NgpOverlay instance\n * @internal\n */\nexport function injectOverlay<T>(): NgpOverlay<T> {\n return inject(NgpOverlay);\n}\n\nexport interface OverlayTriggerOptions {\n /**\n * Whether the visibility change should be immediate.\n */\n immediate?: boolean;\n /**\n * The origin of the focus event that triggered the visibility change.\n */\n origin?: FocusOrigin;\n}\n","import { DestroyRef, afterRenderEffect, inject } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectOverlay } from './overlay';\n\nexport function setupOverlayArrow(): void {\n const overlay = injectOverlay();\n const element = injectElementRef();\n const destroyRef = inject(DestroyRef);\n\n // register the arrow element with the overlay\n overlay.registerArrow(element.nativeElement);\n\n // cleanup the arrow element on destroy\n destroyRef.onDestroy(() => overlay.unregisterArrow());\n\n // update the arrow position after the overlay is rendered\n afterRenderEffect(() => {\n const position = overlay.arrowPosition();\n element.nativeElement.style.setProperty('inset-inline-start', `${position.x}px`);\n element.nativeElement.style.setProperty('inset-block-start', `${position.y}px`);\n element.nativeElement.dataset['placement'] = overlay.finalPlacement();\n });\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isObject, isNil } from 'ng-primitives/utils';\n\n/**\n * Options for configuring offset between a floating element and its reference element.\n * Can be a single number for uniform offset or an object for axis-specific control.\n */\nexport interface NgpOffsetOptions {\n /**\n * The offset along the main axis (the axis that runs along the side of the floating element).\n * Represents the distance between the floating element and the reference element.\n * @default 0\n */\n mainAxis?: number;\n\n /**\n * The offset along the cross axis (the axis that runs along the alignment of the floating element).\n * Represents the skidding between the floating element and the reference element.\n * @default 0\n */\n crossAxis?: number;\n\n /**\n * Same axis as crossAxis but applies only to aligned placements and inverts the end alignment.\n * When set to a number, it overrides the crossAxis value.\n * @default null\n */\n alignmentAxis?: number | null;\n}\n\n/**\n * Type representing all valid offset values.\n * Can be a number (applies to mainAxis) or an object with axis-specific offsets.\n */\nexport type NgpOffset = number | NgpOffsetOptions;\n\n/**\n * Input type for offset that also accepts string representations of numbers\n */\nexport type NgpOffsetInput = NgpOffset | string;\n\n/**\n * Transform function to coerce offset input values to the correct type\n * @param value The input value to coerce\n * @returns The coerced offset value\n */\nexport function coerceOffset(value: NgpOffsetInput | null | undefined): NgpOffset {\n if (isNil(value)) {\n return 0;\n }\n\n if (isObject(value)) {\n return value;\n }\n\n // Use CDK's coerceNumberProperty for consistent number coercion\n // This handles strings, numbers, and other input types just like Angular CDK inputs\n return coerceNumberProperty(value, 0);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAEA,MAAM,sBAAsB,GAAG,IAAI,cAAc,CAAU,wBAAwB,CAAC;AAEpF;;;AAGG;SACa,oBAAoB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,sBAAsB,CAAc;AACpD;AAEA;;;;AAIG;AACG,SAAU,qBAAqB,CAAI,KAAwC,EAAA;IAC/E,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE;AAC7D;;MCRsB,SAAS,CAAA;IAC7B,WAAA,CACqB,gBAAkC,EAClC,QAAkB,EAAA;QADlB,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAChB,IAAA,CAAA,QAAQ,GAAR,QAAQ;IAC1B;AA2BJ;AAEK,MAAO,kBAAsB,SAAQ,SAAS,CAAA;AAMlD,IAAA,WAAA,CAAY,SAAkB,EAAE,gBAAkC,EAAE,QAAkB,EAAA;AACpF,QAAA,KAAK,CAAC,gBAAgB,EAAE,QAAQ,CAAC;QAL3B,IAAA,CAAA,OAAO,GAA2B,IAAI;QACtC,IAAA,CAAA,YAAY,GAAG,KAAK;Q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ACnB,QAAA,OAAO,KAAK;IACd;;;AAIA,IAAA,OAAO,oBAAoB,CAAC,KAAK,EAAE,CAAC,CAAC;AACvC;;AC1DA;;AAEG;;;;"}
|
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.
|
|
5
|
+
"version": "0.85.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"angular",
|
|
8
8
|
"primitives",
|
|
@@ -83,14 +83,14 @@
|
|
|
83
83
|
"types": "./autofill/index.d.ts",
|
|
84
84
|
"default": "./fesm2022/ng-primitives-autofill.mjs"
|
|
85
85
|
},
|
|
86
|
-
"./button": {
|
|
87
|
-
"types": "./button/index.d.ts",
|
|
88
|
-
"default": "./fesm2022/ng-primitives-button.mjs"
|
|
89
|
-
},
|
|
90
86
|
"./checkbox": {
|
|
91
87
|
"types": "./checkbox/index.d.ts",
|
|
92
88
|
"default": "./fesm2022/ng-primitives-checkbox.mjs"
|
|
93
89
|
},
|
|
90
|
+
"./button": {
|
|
91
|
+
"types": "./button/index.d.ts",
|
|
92
|
+
"default": "./fesm2022/ng-primitives-button.mjs"
|
|
93
|
+
},
|
|
94
94
|
"./combobox": {
|
|
95
95
|
"types": "./combobox/index.d.ts",
|
|
96
96
|
"default": "./fesm2022/ng-primitives-combobox.mjs"
|
|
@@ -99,21 +99,21 @@
|
|
|
99
99
|
"types": "./common/index.d.ts",
|
|
100
100
|
"default": "./fesm2022/ng-primitives-common.mjs"
|
|
101
101
|
},
|
|
102
|
+
"./date-time-luxon": {
|
|
103
|
+
"types": "./date-time-luxon/index.d.ts",
|
|
104
|
+
"default": "./fesm2022/ng-primitives-date-time-luxon.mjs"
|
|
105
|
+
},
|
|
102
106
|
"./date-picker": {
|
|
103
107
|
"types": "./date-picker/index.d.ts",
|
|
104
108
|
"default": "./fesm2022/ng-primitives-date-picker.mjs"
|
|
105
109
|
},
|
|
106
|
-
"./date-time": {
|
|
107
|
-
"types": "./date-time/index.d.ts",
|
|
108
|
-
"default": "./fesm2022/ng-primitives-date-time.mjs"
|
|
109
|
-
},
|
|
110
110
|
"./dialog": {
|
|
111
111
|
"types": "./dialog/index.d.ts",
|
|
112
112
|
"default": "./fesm2022/ng-primitives-dialog.mjs"
|
|
113
113
|
},
|
|
114
|
-
"./date-time
|
|
115
|
-
"types": "./date-time
|
|
116
|
-
"default": "./fesm2022/ng-primitives-date-time
|
|
114
|
+
"./date-time": {
|
|
115
|
+
"types": "./date-time/index.d.ts",
|
|
116
|
+
"default": "./fesm2022/ng-primitives-date-time.mjs"
|
|
117
117
|
},
|
|
118
118
|
"./file-upload": {
|
|
119
119
|
"types": "./file-upload/index.d.ts",
|
|
@@ -155,10 +155,6 @@
|
|
|
155
155
|
"types": "./pagination/index.d.ts",
|
|
156
156
|
"default": "./fesm2022/ng-primitives-pagination.mjs"
|
|
157
157
|
},
|
|
158
|
-
"./popover": {
|
|
159
|
-
"types": "./popover/index.d.ts",
|
|
160
|
-
"default": "./fesm2022/ng-primitives-popover.mjs"
|
|
161
|
-
},
|
|
162
158
|
"./portal": {
|
|
163
159
|
"types": "./portal/index.d.ts",
|
|
164
160
|
"default": "./fesm2022/ng-primitives-portal.mjs"
|
|
@@ -167,6 +163,10 @@
|
|
|
167
163
|
"types": "./progress/index.d.ts",
|
|
168
164
|
"default": "./fesm2022/ng-primitives-progress.mjs"
|
|
169
165
|
},
|
|
166
|
+
"./popover": {
|
|
167
|
+
"types": "./popover/index.d.ts",
|
|
168
|
+
"default": "./fesm2022/ng-primitives-popover.mjs"
|
|
169
|
+
},
|
|
170
170
|
"./radio": {
|
|
171
171
|
"types": "./radio/index.d.ts",
|
|
172
172
|
"default": "./fesm2022/ng-primitives-radio.mjs"
|
|
@@ -179,33 +179,33 @@
|
|
|
179
179
|
"types": "./roving-focus/index.d.ts",
|
|
180
180
|
"default": "./fesm2022/ng-primitives-roving-focus.mjs"
|
|
181
181
|
},
|
|
182
|
-
"./
|
|
183
|
-
"types": "./
|
|
184
|
-
"default": "./fesm2022/ng-primitives-
|
|
182
|
+
"./separator": {
|
|
183
|
+
"types": "./separator/index.d.ts",
|
|
184
|
+
"default": "./fesm2022/ng-primitives-separator.mjs"
|
|
185
185
|
},
|
|
186
186
|
"./select": {
|
|
187
187
|
"types": "./select/index.d.ts",
|
|
188
188
|
"default": "./fesm2022/ng-primitives-select.mjs"
|
|
189
189
|
},
|
|
190
|
-
"./
|
|
191
|
-
"types": "./
|
|
192
|
-
"default": "./fesm2022/ng-primitives-
|
|
190
|
+
"./search": {
|
|
191
|
+
"types": "./search/index.d.ts",
|
|
192
|
+
"default": "./fesm2022/ng-primitives-search.mjs"
|
|
193
193
|
},
|
|
194
194
|
"./slider": {
|
|
195
195
|
"types": "./slider/index.d.ts",
|
|
196
196
|
"default": "./fesm2022/ng-primitives-slider.mjs"
|
|
197
197
|
},
|
|
198
|
-
"./
|
|
199
|
-
"types": "./
|
|
200
|
-
"default": "./fesm2022/ng-primitives-
|
|
198
|
+
"./tabs": {
|
|
199
|
+
"types": "./tabs/index.d.ts",
|
|
200
|
+
"default": "./fesm2022/ng-primitives-tabs.mjs"
|
|
201
201
|
},
|
|
202
202
|
"./switch": {
|
|
203
203
|
"types": "./switch/index.d.ts",
|
|
204
204
|
"default": "./fesm2022/ng-primitives-switch.mjs"
|
|
205
205
|
},
|
|
206
|
-
"./
|
|
207
|
-
"types": "./
|
|
208
|
-
"default": "./fesm2022/ng-primitives-
|
|
206
|
+
"./state": {
|
|
207
|
+
"types": "./state/index.d.ts",
|
|
208
|
+
"default": "./fesm2022/ng-primitives-state.mjs"
|
|
209
209
|
},
|
|
210
210
|
"./textarea": {
|
|
211
211
|
"types": "./textarea/index.d.ts",
|
|
@@ -82,6 +82,11 @@ export declare class NgpPopoverTrigger<T = null> implements OnDestroy {
|
|
|
82
82
|
* Provide context to the popover. This can be used to pass data to the popover content.
|
|
83
83
|
*/
|
|
84
84
|
readonly context: import("@angular/core").InputSignal<T | undefined>;
|
|
85
|
+
/**
|
|
86
|
+
* Define an anchor element for positioning the popover.
|
|
87
|
+
* If provided, the popover will be positioned relative to this element instead of the trigger.
|
|
88
|
+
*/
|
|
89
|
+
readonly anchor: import("@angular/core").InputSignal<HTMLElement | null>;
|
|
85
90
|
/**
|
|
86
91
|
* The overlay that manages the popover
|
|
87
92
|
* @internal
|
|
@@ -118,6 +123,6 @@ export declare class NgpPopoverTrigger<T = null> implements OnDestroy {
|
|
|
118
123
|
*/
|
|
119
124
|
private createOverlay;
|
|
120
125
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpPopoverTrigger<any>, never>;
|
|
121
|
-
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>;
|
|
126
|
+
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; }; "anchor": { "alias": "ngpPopoverTriggerAnchor"; "required": false; "isSignal": true; }; }, { "openChange": "ngpPopoverTriggerOpenChange"; }, never, never, true, never>;
|
|
122
127
|
}
|
|
123
128
|
export type NgpPopoverPlacement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
|
package/portal/overlay.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface NgpOverlayConfig<T = unknown> {
|
|
|
12
12
|
content: NgpOverlayContent<T>;
|
|
13
13
|
/** The element that triggers the overlay */
|
|
14
14
|
triggerElement: HTMLElement;
|
|
15
|
+
/** The element to use for positioning the overlay (if different from trigger) */
|
|
16
|
+
anchorElement?: HTMLElement | null;
|
|
15
17
|
/** The injector to use for creating the portal */
|
|
16
18
|
injector: Injector;
|
|
17
19
|
/** ViewContainerRef to use for creating the portal */
|
package/toast/toast/toast.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare class NgpToast {
|
|
|
15
15
|
x: number;
|
|
16
16
|
y: number;
|
|
17
17
|
}>;
|
|
18
|
-
protected readonly swipeOutDirection: import("@angular/core").Signal<"
|
|
18
|
+
protected readonly swipeOutDirection: import("@angular/core").Signal<"top" | "right" | "bottom" | "left" | null>;
|
|
19
19
|
/**
|
|
20
20
|
* Get all toasts that are currently being displayed in the same position.
|
|
21
21
|
*/
|