ng-primitives 0.120.5 → 0.121.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-a11y.mjs +5 -5
- package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
- package/fesm2022/ng-primitives-accordion.mjs +30 -47
- package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/ng-primitives-ai.mjs +39 -52
- package/fesm2022/ng-primitives-ai.mjs.map +1 -1
- package/fesm2022/ng-primitives-autofill.mjs +4 -4
- package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
- package/fesm2022/ng-primitives-avatar.mjs +14 -17
- package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/ng-primitives-breadcrumbs.mjs +21 -21
- package/fesm2022/ng-primitives-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ng-primitives-button.mjs +7 -9
- package/fesm2022/ng-primitives-button.mjs.map +1 -1
- package/fesm2022/ng-primitives-checkbox.mjs +15 -30
- package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-combobox.mjs +60 -92
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-common.mjs +4 -4
- package/fesm2022/ng-primitives-common.mjs.map +1 -1
- package/fesm2022/ng-primitives-context-menu.mjs +66 -119
- package/fesm2022/ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-date-picker.mjs +70 -108
- package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
- package/fesm2022/ng-primitives-dialog.mjs +33 -49
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs +26 -53
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-focus-trap.mjs +5 -8
- package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
- package/fesm2022/ng-primitives-form-field.mjs +39 -44
- package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
- package/fesm2022/ng-primitives-input-otp.mjs +30 -43
- package/fesm2022/ng-primitives-input-otp.mjs.map +1 -1
- package/fesm2022/ng-primitives-input.mjs +6 -8
- package/fesm2022/ng-primitives-input.mjs.map +1 -1
- package/fesm2022/ng-primitives-interactions.mjs +31 -48
- package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +12 -12
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-listbox.mjs +34 -48
- package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +83 -149
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-meter.mjs +25 -36
- package/fesm2022/ng-primitives-meter.mjs.map +1 -1
- package/fesm2022/ng-primitives-navigation-menu.mjs +60 -108
- package/fesm2022/ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-number-field.mjs +35 -59
- package/fesm2022/ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/ng-primitives-pagination.mjs +270 -297
- package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +42 -87
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +81 -57
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-progress.mjs +30 -41
- package/fesm2022/ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/ng-primitives-radio.mjs +20 -30
- package/fesm2022/ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/ng-primitives-resize.mjs +3 -3
- package/fesm2022/ng-primitives-resize.mjs.map +1 -1
- package/fesm2022/ng-primitives-roving-focus.mjs +20 -34
- package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/ng-primitives-search.mjs +9 -9
- package/fesm2022/ng-primitives-search.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +50 -81
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-separator.mjs +4 -6
- package/fesm2022/ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/ng-primitives-slider.mjs +63 -100
- package/fesm2022/ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/ng-primitives-state.mjs +3 -3
- package/fesm2022/ng-primitives-state.mjs.map +1 -1
- package/fesm2022/ng-primitives-switch.mjs +15 -21
- package/fesm2022/ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/ng-primitives-tabs.mjs +31 -41
- package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/ng-primitives-textarea.mjs +5 -7
- package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
- package/fesm2022/ng-primitives-toast.mjs +19 -19
- package/fesm2022/ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle-group.mjs +20 -36
- package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle.mjs +10 -19
- package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/ng-primitives-toolbar.mjs +4 -6
- package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +401 -402
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/ng-primitives-utils.mjs +5 -4
- package/fesm2022/ng-primitives-utils.mjs.map +1 -1
- package/package.json +56 -55
- package/{a11y/index.d.ts → types/ng-primitives-a11y.d.ts} +15 -14
- package/{accordion/index.d.ts → types/ng-primitives-accordion.d.ts} +78 -77
- package/{button/index.d.ts → types/ng-primitives-button.d.ts} +21 -20
- package/{checkbox/index.d.ts → types/ng-primitives-checkbox.d.ts} +67 -66
- package/{combobox/index.d.ts → types/ng-primitives-combobox.d.ts} +35 -35
- package/{date-picker/index.d.ts → types/ng-primitives-date-picker.d.ts} +2 -2
- package/{number-field/index.d.ts → types/ng-primitives-number-field.d.ts} +72 -71
- package/types/ng-primitives-pagination.d.ts +502 -0
- package/{popover/index.d.ts → types/ng-primitives-popover.d.ts} +3 -2
- package/{portal/index.d.ts → types/ng-primitives-portal.d.ts} +19 -3
- package/{roving-focus/index.d.ts → types/ng-primitives-roving-focus.d.ts} +61 -60
- package/{select/index.d.ts → types/ng-primitives-select.d.ts} +39 -38
- package/{slider/index.d.ts → types/ng-primitives-slider.d.ts} +59 -58
- package/{switch/index.d.ts → types/ng-primitives-switch.d.ts} +45 -44
- package/{toast/index.d.ts → types/ng-primitives-toast.d.ts} +2 -1
- package/{toggle-group/index.d.ts → types/ng-primitives-toggle-group.d.ts} +69 -68
- package/{toggle/index.d.ts → types/ng-primitives-toggle.d.ts} +48 -47
- package/types/ng-primitives-tooltip.d.ts +691 -0
- package/pagination/index.d.ts +0 -211
- package/tooltip/index.d.ts +0 -376
- /package/{ai/index.d.ts → types/ng-primitives-ai.d.ts} +0 -0
- /package/{autofill/index.d.ts → types/ng-primitives-autofill.d.ts} +0 -0
- /package/{avatar/index.d.ts → types/ng-primitives-avatar.d.ts} +0 -0
- /package/{breadcrumbs/index.d.ts → types/ng-primitives-breadcrumbs.d.ts} +0 -0
- /package/{common/index.d.ts → types/ng-primitives-common.d.ts} +0 -0
- /package/{context-menu/index.d.ts → types/ng-primitives-context-menu.d.ts} +0 -0
- /package/{date-time-luxon/index.d.ts → types/ng-primitives-date-time-luxon.d.ts} +0 -0
- /package/{date-time/index.d.ts → types/ng-primitives-date-time.d.ts} +0 -0
- /package/{dialog/index.d.ts → types/ng-primitives-dialog.d.ts} +0 -0
- /package/{file-upload/index.d.ts → types/ng-primitives-file-upload.d.ts} +0 -0
- /package/{focus-trap/index.d.ts → types/ng-primitives-focus-trap.d.ts} +0 -0
- /package/{form-field/index.d.ts → types/ng-primitives-form-field.d.ts} +0 -0
- /package/{input-otp/index.d.ts → types/ng-primitives-input-otp.d.ts} +0 -0
- /package/{input/index.d.ts → types/ng-primitives-input.d.ts} +0 -0
- /package/{interactions/index.d.ts → types/ng-primitives-interactions.d.ts} +0 -0
- /package/{internal/index.d.ts → types/ng-primitives-internal.d.ts} +0 -0
- /package/{listbox/index.d.ts → types/ng-primitives-listbox.d.ts} +0 -0
- /package/{menu/index.d.ts → types/ng-primitives-menu.d.ts} +0 -0
- /package/{meter/index.d.ts → types/ng-primitives-meter.d.ts} +0 -0
- /package/{navigation-menu/index.d.ts → types/ng-primitives-navigation-menu.d.ts} +0 -0
- /package/{progress/index.d.ts → types/ng-primitives-progress.d.ts} +0 -0
- /package/{radio/index.d.ts → types/ng-primitives-radio.d.ts} +0 -0
- /package/{resize/index.d.ts → types/ng-primitives-resize.d.ts} +0 -0
- /package/{search/index.d.ts → types/ng-primitives-search.d.ts} +0 -0
- /package/{separator/index.d.ts → types/ng-primitives-separator.d.ts} +0 -0
- /package/{state/index.d.ts → types/ng-primitives-state.d.ts} +0 -0
- /package/{tabs/index.d.ts → types/ng-primitives-tabs.d.ts} +0 -0
- /package/{textarea/index.d.ts → types/ng-primitives-textarea.d.ts} +0 -0
- /package/{toolbar/index.d.ts → types/ng-primitives-toolbar.d.ts} +0 -0
- /package/{utils/index.d.ts → types/ng-primitives-utils.d.ts} +0 -0
- /package/{index.d.ts → types/ng-primitives.d.ts} +0 -0
|
@@ -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-state.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-state.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 { NgpDismissGuard, NgpFlip, NgpOffset, NgpShift } 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 * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.\n * @default true\n */\n flip: NgpFlip;\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, or a guard function.\n * @default true\n */\n closeOnOutsideClick: NgpDismissGuard<Element>;\n\n /**\n * Define whether the popover should close when the escape key is pressed, or a guard function.\n * @default true\n */\n closeOnEscape: NgpDismissGuard<KeyboardEvent>;\n\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default scroll\n */\n scrollBehavior: 'reposition' | 'block' | 'close';\n\n /**\n * Configure shift behavior to keep the popover in view.\n * Can be a boolean to enable/disable, or an object with padding and limiter options.\n * @default undefined (enabled by default in overlay)\n */\n shift: NgpShift;\n\n /**\n * Whether to track the trigger element position on every animation frame.\n * Useful for moving elements like slider thumbs.\n * @default false\n */\n trackPosition: boolean;\n\n /**\n * Cooldown duration in milliseconds.\n * When moving from one popover to another within this duration,\n * the showDelay is skipped for the new popover.\n * @default 0\n */\n cooldown: number;\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 shift: undefined,\n trackPosition: false,\n cooldown: 0,\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 { NgpOverlayArrowProps, NgpOverlayArrowState, ngpOverlayArrow } from 'ng-primitives/portal';\nimport { createPrimitive } from 'ng-primitives/state';\n\n// Re-export types with popover-specific aliases\nexport { NgpOverlayArrowProps as NgpPopoverArrowProps };\nexport { NgpOverlayArrowState as NgpPopoverArrowState };\n\nexport const [\n NgpPopoverArrowStateToken,\n ngpPopoverArrow,\n injectPopoverArrowState,\n providePopoverArrowState,\n] = createPrimitive(\n 'NgpPopoverArrow',\n ({ padding }: NgpOverlayArrowProps): NgpOverlayArrowState => {\n return ngpOverlayArrow({ padding });\n },\n);\n","import { NumberInput } from '@angular/cdk/coercion';\nimport { Directive, input, numberAttribute } from '@angular/core';\nimport { ngpPopoverArrow, providePopoverArrowState } from './popover-arrow-state';\n\n@Directive({\n selector: '[ngpPopoverArrow]',\n exportAs: 'ngpPopoverArrow',\n providers: [providePopoverArrowState()],\n})\nexport class NgpPopoverArrow {\n /**\n * Padding between the arrow and the edges of the popover.\n * This prevents the arrow from overflowing the rounded corners.\n */\n readonly padding = input<number | undefined, NumberInput>(undefined, {\n alias: 'ngpPopoverArrowPadding',\n transform: numberAttribute,\n });\n\n private readonly state = ngpPopoverArrow({ padding: this.padding });\n\n /**\n * Set the padding between the arrow and the edges of the popover.\n * @param value The padding value in pixels\n */\n setPadding(value: number | undefined): void {\n this.state.setPadding(value);\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport {\n computed,\n ElementRef,\n inject,\n Injector,\n signal,\n Signal,\n ViewContainerRef,\n WritableSignal,\n} from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpDismissGuard,\n NgpFlip,\n NgpOffset,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n NgpShift,\n} from 'ng-primitives/portal';\nimport {\n attrBinding,\n controlled,\n createPrimitive,\n dataBinding,\n listener,\n StateInjectionOptions,\n} from 'ng-primitives/state';\n\nexport interface NgpPopoverTriggerState<T> {\n /** Access the trigger element. */\n readonly elementRef: ElementRef;\n /** Access the popover template ref. */\n readonly popover: WritableSignal<NgpOverlayContent<T> | undefined>;\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled: Signal<boolean>;\n /**\n * Define the placement of the popover relative to the trigger.\n * @default 'top'\n */\n readonly placement: Signal<NgpPopoverPlacement>;\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: Signal<NgpOffset>;\n /**\n * Define the delay before the popover is displayed.\n * @default 0\n */\n readonly showDelay: Signal<number>;\n /**\n * Define the delay before the popover is hidden.\n * @default 0\n */\n readonly hideDelay: Signal<number>;\n /**\n * Define whether the popover should flip when there is not enough space for the popover.\n * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.\n * @default true\n */\n readonly flip: Signal<NgpFlip>;\n /**\n * Configure shift behavior to keep the popover in view.\n * Can be a boolean to enable/disable, or an object with padding and limiter options.\n * @default undefined (enabled by default in overlay)\n */\n readonly shift: Signal<NgpShift>;\n /**\n * Define the container in which the popover should be attached.\n * @default document.body\n */\n readonly container: Signal<HTMLElement | string | null>;\n /**\n * Define whether the popover should close when clicking outside of it, or a guard function.\n * @default true\n */\n readonly closeOnOutsideClick: Signal<NgpDismissGuard<Element>>;\n /**\n * Define whether the popover should close when the escape key is pressed, or a guard function.\n * @default true\n */\n readonly closeOnEscape: Signal<NgpDismissGuard<KeyboardEvent>>;\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior: Signal<'reposition' | 'block' | 'close'>;\n /**\n * Provide context to the popover. This can be used to pass data to the popover content.\n */\n readonly context: Signal<T | undefined>;\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: Signal<HTMLElement | null>;\n /**\n * Define whether to track the trigger element position on every animation frame.\n * Useful for moving elements like slider thumbs.\n * @default false\n */\n readonly trackPosition: Signal<boolean>;\n /**\n * Define the cooldown duration in milliseconds.\n * When moving from one popover to another within this duration,\n * the showDelay is skipped for the new popover.\n * @default 0\n */\n readonly cooldown: Signal<number>;\n /**\n * The overlay that manages the popover\n * @internal\n */\n readonly overlay: Signal<NgpOverlay<T> | null>;\n /**\n * The open state of the popover.\n * @internal\n */\n readonly open: Signal<boolean>;\n /** @internal onDestroy callback */\n destroy: () => void;\n /**\n * Show the popover.\n * @returns A promise that resolves when the popover has been shown\n */\n show: () => Promise<void>;\n /**\n * @internal\n * Hide the popover.\n * @returns A promise that resolves when the popover has been hidden\n */\n hide: (origin: FocusOrigin) => Promise<void>;\n}\n\nexport interface NgpPopoverTriggerProps<T> {\n /** Access the popover template ref. */\n readonly popover?: Signal<NgpOverlayContent<T> | undefined>;\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Define the placement of the popover relative to the trigger.\n * @default 'top'\n */\n readonly placement?: Signal<NgpPopoverPlacement>;\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?: Signal<NgpOffset>;\n /**\n * Define the delay before the popover is displayed.\n * @default 0\n */\n readonly showDelay?: Signal<number>;\n /**\n * Define the delay before the popover is hidden.\n * @default 0\n */\n readonly hideDelay?: Signal<number>;\n /**\n * Define whether the popover should flip when there is not enough space for the popover.\n * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.\n * @default true\n */\n readonly flip?: Signal<NgpFlip>;\n /**\n * Configure shift behavior to keep the popover in view.\n * Can be a boolean to enable/disable, or an object with padding and limiter options.\n * @default undefined (enabled by default in overlay)\n */\n readonly shift?: Signal<NgpShift>;\n /**\n * Define the container in which the popover should be attached.\n * @default document.body\n */\n readonly container?: Signal<HTMLElement | string | null>;\n /**\n * Define whether the popover should close when clicking outside of it, or a guard function.\n * @default true\n */\n readonly closeOnOutsideClick?: Signal<NgpDismissGuard<Element>>;\n /**\n * Define whether the popover should close when the escape key is pressed, or a guard function.\n * @default true\n */\n readonly closeOnEscape?: Signal<NgpDismissGuard<KeyboardEvent>>;\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior?: Signal<'reposition' | 'block' | 'close'>;\n /**\n * Provide context to the popover. This can be used to pass data to the popover content.\n */\n readonly context?: Signal<T | undefined>;\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?: Signal<HTMLElement | null>;\n /**\n * Define whether to track the trigger element position on every animation frame.\n * Useful for moving elements like slider thumbs.\n * @default false\n */\n readonly trackPosition?: Signal<boolean>;\n /**\n * Define the cooldown duration in milliseconds.\n * When moving from one popover to another within this duration,\n * the showDelay is skipped for the new popover.\n * @default 0\n */\n readonly cooldown?: Signal<number>;\n /** Callback fired when the open state changes. */\n readonly onOpenChange?: (value: boolean) => void;\n}\n\nexport const [\n NgpPopoverTriggerStateToken,\n ngpPopoverTrigger,\n _injectPopoverTriggerState,\n providePopoverTriggerState,\n] = createPrimitive(\n 'NgpPopoverTrigger',\n <T>({\n popover: _popover = signal<NgpOverlayContent<T> | undefined>(undefined),\n disabled = signal<boolean>(false),\n placement = signal<NgpPopoverPlacement>('bottom'),\n offset = signal<NgpOffset>(4),\n showDelay = signal<number>(0),\n hideDelay = signal<number>(0),\n flip = signal<NgpFlip>(true),\n shift = signal<NgpShift>(undefined),\n container = signal<HTMLElement | string | null>('body'),\n closeOnOutsideClick = signal<NgpDismissGuard<Element>>(true),\n closeOnEscape = signal<NgpDismissGuard<KeyboardEvent>>(true),\n scrollBehavior = signal<'reposition' | 'block' | 'close'>('reposition'),\n context = signal<T | undefined>(undefined),\n anchor = signal<HTMLElement | null>(null),\n trackPosition = signal<boolean>(false),\n cooldown = signal<number>(0),\n onOpenChange,\n }: NgpPopoverTriggerProps<T>): NgpPopoverTriggerState<T> => {\n const elementRef = injectElementRef<HTMLElement>();\n const viewContainerRef = inject(ViewContainerRef);\n const injector = inject(Injector);\n\n const popover = controlled(_popover);\n\n const overlay = signal<NgpOverlay<T> | null>(null);\n const open = computed(() => overlay()?.isOpen() ?? false);\n\n // Host binding\n attrBinding(elementRef, 'aria-expanded', () => (open() ? 'true' : 'false'));\n attrBinding(elementRef, 'aria-describedby', () => overlay()?.ariaDescribedBy());\n dataBinding(elementRef, 'data-open', open);\n dataBinding(elementRef, 'data-placement', placement);\n dataBinding(elementRef, 'data-disabled', disabled);\n\n // Event listener\n listener(elementRef, 'click', toggle);\n\n function destroy(): void {\n overlay()?.destroy();\n }\n\n function createOverlayInstance(): void {\n const popoverInstance = popover();\n\n if (!popoverInstance) {\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: popoverInstance,\n triggerElement: elementRef.nativeElement,\n anchorElement: anchor(),\n injector: injector,\n context: context,\n container: container(),\n placement: placement,\n offset: offset(),\n flip: flip(),\n shift: shift(),\n showDelay: showDelay(),\n hideDelay: hideDelay(),\n closeOnOutsideClick: closeOnOutsideClick(),\n closeOnEscape: closeOnEscape(),\n restoreFocus: true,\n scrollBehaviour: scrollBehavior(),\n viewContainerRef: viewContainerRef,\n trackPosition: trackPosition(),\n overlayType: 'popover',\n cooldown: cooldown(),\n onClose: () => onOpenChange?.(false),\n };\n\n overlay.set(createOverlay(config));\n }\n\n function toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the popover\n if (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 (open()) {\n hide(origin);\n } else {\n show();\n }\n }\n\n async function show(): Promise<void> {\n // If the trigger is disabled, don't show the popover\n if (disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!overlay()) {\n createOverlayInstance();\n }\n\n // Show the overlay\n await overlay()?.show();\n\n if (open()) {\n onOpenChange?.(true);\n }\n }\n\n async function hide(origin: FocusOrigin): Promise<void> {\n // If the trigger is disabled or the popover is not open, do nothing\n if (disabled() || !open()) {\n return;\n }\n\n // Hide the overlay\n await overlay()?.hide({ origin });\n }\n\n return {\n elementRef,\n popover,\n disabled,\n placement,\n offset,\n showDelay,\n hideDelay,\n flip,\n shift,\n container,\n closeOnOutsideClick,\n closeOnEscape,\n scrollBehavior,\n context,\n anchor,\n trackPosition,\n cooldown,\n overlay,\n open,\n destroy,\n show,\n hide,\n } satisfies NgpPopoverTriggerState<T>;\n },\n);\n\nexport function injectPopoverTriggerState<T>(\n options?: StateInjectionOptions,\n): Signal<NgpPopoverTriggerState<T>> {\n return _injectPopoverTriggerState(options) as Signal<NgpPopoverTriggerState<T>>;\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 { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n Directive,\n input,\n numberAttribute,\n OnDestroy,\n output,\n} from '@angular/core';\nimport {\n coerceFlip,\n dismissGuardAttribute,\n NgpDismissGuard,\n NgpDismissGuardInput,\n NgpFlip,\n NgpFlipInput,\n NgpOverlayContent,\n coerceOffset,\n NgpOffset,\n NgpOffsetInput,\n coerceShift,\n NgpShift,\n NgpShiftInput,\n} from 'ng-primitives/portal';\nimport { injectPopoverConfig } from '../config/popover-config';\nimport {\n NgpPopoverPlacement,\n ngpPopoverTrigger,\n providePopoverTriggerState,\n} 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})\nexport class NgpPopoverTrigger<T = null> implements OnDestroy {\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 * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.\n * @default true\n */\n readonly flip = input<NgpFlip, NgpFlipInput>(this.config.flip, {\n alias: 'ngpPopoverTriggerFlip',\n transform: coerceFlip,\n });\n\n /**\n * Configure shift behavior to keep the popover in view.\n * Can be a boolean to enable/disable, or an object with padding and limiter options.\n * @default undefined (enabled by default in overlay)\n */\n readonly shift = input<NgpShift, NgpShiftInput>(this.config.shift, {\n alias: 'ngpPopoverTriggerShift',\n transform: coerceShift,\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, or a guard function.\n * @default true\n */\n readonly closeOnOutsideClick = input<NgpDismissGuard<Element>, NgpDismissGuardInput<Element>>(\n this.config.closeOnOutsideClick,\n {\n alias: 'ngpPopoverTriggerCloseOnOutsideClick',\n transform: dismissGuardAttribute,\n },\n );\n\n /**\n * Define whether the popover should close when the escape key is pressed, or a guard function.\n * @default true\n */\n readonly closeOnEscape = input<\n NgpDismissGuard<KeyboardEvent>,\n NgpDismissGuardInput<KeyboardEvent>\n >(this.config.closeOnEscape, {\n alias: 'ngpPopoverTriggerCloseOnEscape',\n transform: dismissGuardAttribute,\n });\n\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior = input<'reposition' | 'block' | 'close'>(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 * Define whether to track the trigger element position on every animation frame.\n * Useful for moving elements like slider thumbs.\n * @default false\n */\n readonly trackPosition = input<boolean, BooleanInput>(this.config.trackPosition, {\n alias: 'ngpPopoverTriggerTrackPosition',\n transform: booleanAttribute,\n });\n\n /**\n * Define the cooldown duration in milliseconds.\n * When moving from one popover to another within this duration,\n * the showDelay is skipped for the new popover.\n * @default 0\n */\n readonly cooldown = input<number, NumberInput>(this.config.cooldown, {\n alias: 'ngpPopoverTriggerCooldown',\n transform: numberAttribute,\n });\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 protected readonly state = ngpPopoverTrigger({\n popover: this.popover,\n disabled: this.disabled,\n placement: this.placement,\n offset: this.offset,\n showDelay: this.showDelay,\n hideDelay: this.hideDelay,\n flip: this.flip,\n shift: this.shift,\n container: this.container,\n closeOnOutsideClick: this.closeOnOutsideClick,\n closeOnEscape: this.closeOnEscape,\n scrollBehavior: this.scrollBehavior,\n context: this.context,\n anchor: this.anchor,\n trackPosition: this.trackPosition,\n cooldown: this.cooldown,\n onOpenChange: (value: boolean) => this.openChange.emit(value),\n });\n\n ngOnDestroy(): void {\n this.state.destroy();\n }\n\n /**\n * Show the popover.\n * @returns A promise that resolves when the popover has been shown\n */\n show(): Promise<void> {\n return this.state.show();\n }\n\n /**\n * @internal\n * Hide the popover.\n * @returns A promise that resolves when the popover has been hidden\n */\n hide(origin: FocusOrigin = 'program'): Promise<void> {\n return this.state.hide(origin);\n }\n}\n","import { signal, Signal } from '@angular/core';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { injectOverlay } from 'ng-primitives/portal';\nimport {\n attrBinding,\n controlled,\n createPrimitive,\n dataBinding,\n styleBinding,\n} from 'ng-primitives/state';\n\nexport interface NgpPopoverState {\n /** The unique id of the tooltip. */\n readonly id: Signal<string>;\n}\n\nexport interface NgpPopoverProps {\n /** The unique id of the tooltip. */\n readonly id?: Signal<string>;\n}\n\nexport const [NgpPopoverStateToken, ngpPopover, injectPopoverState, providePopoverState] =\n createPrimitive('NgpPopover', ({ id: _id = signal<string>('') }: NgpPopoverProps) => {\n const elementRef = injectElementRef<HTMLElement>();\n\n const overlay = injectOverlay();\n const id = controlled(_id);\n\n id.set(overlay.id());\n\n // Host binding\n attrBinding(elementRef, 'role', 'dialog');\n attrBinding(elementRef, 'id', id);\n styleBinding(elementRef, 'left.px', () => overlay.position().x ?? null);\n styleBinding(elementRef, 'top.px', () => overlay.position().y ?? null);\n styleBinding(elementRef, '--ngp-popover-trigger-width.px', () => overlay.triggerWidth());\n styleBinding(elementRef, '--ngp-popover-transform-origin', () => overlay.transformOrigin());\n styleBinding(elementRef, '--ngp-popover-available-width.px', () => overlay.availableWidth());\n styleBinding(elementRef, '--ngp-popover-available-height.px', () => overlay.availableHeight());\n dataBinding(elementRef, 'data-placement', () => overlay.finalPlacement() ?? null);\n dataBinding(elementRef, 'data-overlay', '');\n\n // Effect handle\n explicitEffect([id], ([id]) => overlay.id.set(id));\n\n return {\n id,\n } satisfies NgpPopoverState;\n });\n","import { Directive, input } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { ngpPopover, providePopoverState } from './popover-state';\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 providers: [providePopoverState()],\n})\nexport class NgpPopover {\n /**\n * The unique id of the tooltip.\n */\n readonly id = input('');\n\n protected readonly state = ngpPopover({\n id: this.id,\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAoFO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,QAAQ;AACnB,IAAA,S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,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,cAAc,EAAE,CAAC,YAAY,CAAC;AAC9B,oBAAA,SAAS,EAAE,CAAC,mBAAmB,EAAE,CAAC;AACnC,iBAAA;;;ACZD;;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-state.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-state.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 { NgpDismissGuard, NgpFlip, NgpOffset, NgpShift } 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 * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.\n * @default true\n */\n flip: NgpFlip;\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, or a guard function.\n * @default true\n */\n closeOnOutsideClick: NgpDismissGuard<Element>;\n\n /**\n * Define whether the popover should close when the escape key is pressed, or a guard function.\n * @default true\n */\n closeOnEscape: NgpDismissGuard<KeyboardEvent>;\n\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default scroll\n */\n scrollBehavior: 'reposition' | 'block' | 'close';\n\n /**\n * Configure shift behavior to keep the popover in view.\n * Can be a boolean to enable/disable, or an object with padding and limiter options.\n * @default undefined (enabled by default in overlay)\n */\n shift: NgpShift;\n\n /**\n * Whether to track the trigger element position on every animation frame.\n * Useful for moving elements like slider thumbs.\n * @default false\n */\n trackPosition: boolean;\n\n /**\n * Cooldown duration in milliseconds.\n * When moving from one popover to another within this duration,\n * the showDelay is skipped for the new popover.\n * @default 0\n */\n cooldown: number;\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 shift: undefined,\n trackPosition: false,\n cooldown: 0,\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 { NgpOverlayArrowProps, NgpOverlayArrowState, ngpOverlayArrow } from 'ng-primitives/portal';\nimport { createPrimitive } from 'ng-primitives/state';\n\n// Re-export types with popover-specific aliases\nexport { NgpOverlayArrowProps as NgpPopoverArrowProps };\nexport { NgpOverlayArrowState as NgpPopoverArrowState };\n\nexport const [\n NgpPopoverArrowStateToken,\n ngpPopoverArrow,\n injectPopoverArrowState,\n providePopoverArrowState,\n] = createPrimitive(\n 'NgpPopoverArrow',\n ({ padding }: NgpOverlayArrowProps): NgpOverlayArrowState => {\n return ngpOverlayArrow({ padding });\n },\n);\n","import { NumberInput } from '@angular/cdk/coercion';\nimport { Directive, input, numberAttribute } from '@angular/core';\nimport { ngpPopoverArrow, providePopoverArrowState } from './popover-arrow-state';\n\n@Directive({\n selector: '[ngpPopoverArrow]',\n exportAs: 'ngpPopoverArrow',\n providers: [providePopoverArrowState()],\n})\nexport class NgpPopoverArrow {\n /**\n * Padding between the arrow and the edges of the popover.\n * This prevents the arrow from overflowing the rounded corners.\n */\n readonly padding = input<number | undefined, NumberInput>(undefined, {\n alias: 'ngpPopoverArrowPadding',\n transform: numberAttribute,\n });\n\n private readonly state = ngpPopoverArrow({ padding: this.padding });\n\n /**\n * Set the padding between the arrow and the edges of the popover.\n * @param value The padding value in pixels\n */\n setPadding(value: number | undefined): void {\n this.state.setPadding(value);\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport {\n computed,\n ElementRef,\n inject,\n Injector,\n signal,\n Signal,\n ViewContainerRef,\n WritableSignal,\n} from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpDismissGuard,\n NgpFlip,\n NgpOffset,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n NgpShift,\n} from 'ng-primitives/portal';\nimport {\n attrBinding,\n controlled,\n createPrimitive,\n dataBinding,\n listener,\n StateInjectionOptions,\n} from 'ng-primitives/state';\n\nexport interface NgpPopoverTriggerState<T> {\n /** Access the trigger element. */\n readonly elementRef: ElementRef;\n /** Access the popover template ref. */\n readonly popover: WritableSignal<NgpOverlayContent<T> | undefined>;\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled: Signal<boolean>;\n /**\n * Define the placement of the popover relative to the trigger.\n * @default 'top'\n */\n readonly placement: Signal<NgpPopoverPlacement>;\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: Signal<NgpOffset>;\n /**\n * Define the delay before the popover is displayed.\n * @default 0\n */\n readonly showDelay: Signal<number>;\n /**\n * Define the delay before the popover is hidden.\n * @default 0\n */\n readonly hideDelay: Signal<number>;\n /**\n * Define whether the popover should flip when there is not enough space for the popover.\n * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.\n * @default true\n */\n readonly flip: Signal<NgpFlip>;\n /**\n * Configure shift behavior to keep the popover in view.\n * Can be a boolean to enable/disable, or an object with padding and limiter options.\n * @default undefined (enabled by default in overlay)\n */\n readonly shift: Signal<NgpShift>;\n /**\n * Define the container in which the popover should be attached.\n * @default document.body\n */\n readonly container: Signal<HTMLElement | string | null>;\n /**\n * Define whether the popover should close when clicking outside of it, or a guard function.\n * @default true\n */\n readonly closeOnOutsideClick: Signal<NgpDismissGuard<Element>>;\n /**\n * Define whether the popover should close when the escape key is pressed, or a guard function.\n * @default true\n */\n readonly closeOnEscape: Signal<NgpDismissGuard<KeyboardEvent>>;\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior: Signal<'reposition' | 'block' | 'close'>;\n /**\n * Provide context to the popover. This can be used to pass data to the popover content.\n */\n readonly context: Signal<T | undefined>;\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: Signal<HTMLElement | null>;\n /**\n * Define whether to track the trigger element position on every animation frame.\n * Useful for moving elements like slider thumbs.\n * @default false\n */\n readonly trackPosition: Signal<boolean>;\n /**\n * Define the cooldown duration in milliseconds.\n * When moving from one popover to another within this duration,\n * the showDelay is skipped for the new popover.\n * @default 0\n */\n readonly cooldown: Signal<number>;\n /**\n * The overlay that manages the popover\n * @internal\n */\n readonly overlay: Signal<NgpOverlay<T> | null>;\n /**\n * The open state of the popover.\n * @internal\n */\n readonly open: Signal<boolean>;\n /** @internal onDestroy callback */\n destroy: () => void;\n /**\n * Show the popover.\n * @returns A promise that resolves when the popover has been shown\n */\n show: () => Promise<void>;\n /**\n * @internal\n * Hide the popover.\n * @returns A promise that resolves when the popover has been hidden\n */\n hide: (origin: FocusOrigin) => Promise<void>;\n}\n\nexport interface NgpPopoverTriggerProps<T> {\n /** Access the popover template ref. */\n readonly popover?: Signal<NgpOverlayContent<T> | undefined>;\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Define the placement of the popover relative to the trigger.\n * @default 'top'\n */\n readonly placement?: Signal<NgpPopoverPlacement>;\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?: Signal<NgpOffset>;\n /**\n * Define the delay before the popover is displayed.\n * @default 0\n */\n readonly showDelay?: Signal<number>;\n /**\n * Define the delay before the popover is hidden.\n * @default 0\n */\n readonly hideDelay?: Signal<number>;\n /**\n * Define whether the popover should flip when there is not enough space for the popover.\n * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.\n * @default true\n */\n readonly flip?: Signal<NgpFlip>;\n /**\n * Configure shift behavior to keep the popover in view.\n * Can be a boolean to enable/disable, or an object with padding and limiter options.\n * @default undefined (enabled by default in overlay)\n */\n readonly shift?: Signal<NgpShift>;\n /**\n * Define the container in which the popover should be attached.\n * @default document.body\n */\n readonly container?: Signal<HTMLElement | string | null>;\n /**\n * Define whether the popover should close when clicking outside of it, or a guard function.\n * @default true\n */\n readonly closeOnOutsideClick?: Signal<NgpDismissGuard<Element>>;\n /**\n * Define whether the popover should close when the escape key is pressed, or a guard function.\n * @default true\n */\n readonly closeOnEscape?: Signal<NgpDismissGuard<KeyboardEvent>>;\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior?: Signal<'reposition' | 'block' | 'close'>;\n /**\n * Provide context to the popover. This can be used to pass data to the popover content.\n */\n readonly context?: Signal<T | undefined>;\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?: Signal<HTMLElement | null>;\n /**\n * Define whether to track the trigger element position on every animation frame.\n * Useful for moving elements like slider thumbs.\n * @default false\n */\n readonly trackPosition?: Signal<boolean>;\n /**\n * Define the cooldown duration in milliseconds.\n * When moving from one popover to another within this duration,\n * the showDelay is skipped for the new popover.\n * @default 0\n */\n readonly cooldown?: Signal<number>;\n /** Callback fired when the open state changes. */\n readonly onOpenChange?: (value: boolean) => void;\n}\n\nexport const [\n NgpPopoverTriggerStateToken,\n ngpPopoverTrigger,\n _injectPopoverTriggerState,\n providePopoverTriggerState,\n] = createPrimitive(\n 'NgpPopoverTrigger',\n <T>({\n popover: _popover = signal<NgpOverlayContent<T> | undefined>(undefined),\n disabled = signal<boolean>(false),\n placement = signal<NgpPopoverPlacement>('bottom'),\n offset = signal<NgpOffset>(4),\n showDelay = signal<number>(0),\n hideDelay = signal<number>(0),\n flip = signal<NgpFlip>(true),\n shift = signal<NgpShift>(undefined),\n container = signal<HTMLElement | string | null>('body'),\n closeOnOutsideClick = signal<NgpDismissGuard<Element>>(true),\n closeOnEscape = signal<NgpDismissGuard<KeyboardEvent>>(true),\n scrollBehavior = signal<'reposition' | 'block' | 'close'>('reposition'),\n context = signal<T | undefined>(undefined),\n anchor = signal<HTMLElement | null>(null),\n trackPosition = signal<boolean>(false),\n cooldown = signal<number>(0),\n onOpenChange,\n }: NgpPopoverTriggerProps<T>): NgpPopoverTriggerState<T> => {\n const elementRef = injectElementRef<HTMLElement>();\n const viewContainerRef = inject(ViewContainerRef);\n const injector = inject(Injector);\n\n const popover = controlled(_popover);\n\n const overlay = signal<NgpOverlay<T> | null>(null);\n const open = computed(() => overlay()?.isOpen() ?? false);\n\n // Host binding\n attrBinding(elementRef, 'aria-expanded', () => (open() ? 'true' : 'false'));\n attrBinding(elementRef, 'aria-describedby', () => overlay()?.ariaDescribedBy());\n dataBinding(elementRef, 'data-open', open);\n dataBinding(elementRef, 'data-placement', placement);\n dataBinding(elementRef, 'data-disabled', disabled);\n\n // Event listener\n listener(elementRef, 'click', toggle);\n\n function destroy(): void {\n overlay()?.destroy();\n }\n\n function createOverlayInstance(): void {\n const popoverInstance = popover();\n\n if (!popoverInstance) {\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: popoverInstance,\n triggerElement: elementRef.nativeElement,\n anchorElement: anchor(),\n injector: injector,\n context: context,\n container: container(),\n placement: placement,\n offset: offset(),\n flip: flip(),\n shift: shift(),\n showDelay: showDelay(),\n hideDelay: hideDelay(),\n closeOnOutsideClick: closeOnOutsideClick(),\n closeOnEscape: closeOnEscape(),\n restoreFocus: true,\n scrollBehaviour: scrollBehavior(),\n viewContainerRef: viewContainerRef,\n trackPosition: trackPosition(),\n overlayType: 'popover',\n cooldown: cooldown(),\n onClose: () => onOpenChange?.(false),\n };\n\n overlay.set(createOverlay(config));\n }\n\n function toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the popover\n if (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 (open()) {\n hide(origin);\n } else {\n show();\n }\n }\n\n async function show(): Promise<void> {\n // If the trigger is disabled, don't show the popover\n if (disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!overlay()) {\n createOverlayInstance();\n }\n\n // Show the overlay\n await overlay()?.show();\n\n if (open()) {\n onOpenChange?.(true);\n }\n }\n\n async function hide(origin: FocusOrigin): Promise<void> {\n // If the trigger is disabled or the popover is not open, do nothing\n if (disabled() || !open()) {\n return;\n }\n\n // Hide the overlay\n await overlay()?.hide({ origin });\n }\n\n return {\n elementRef,\n popover,\n disabled,\n placement,\n offset,\n showDelay,\n hideDelay,\n flip,\n shift,\n container,\n closeOnOutsideClick,\n closeOnEscape,\n scrollBehavior,\n context,\n anchor,\n trackPosition,\n cooldown,\n overlay,\n open,\n destroy,\n show,\n hide,\n } satisfies NgpPopoverTriggerState<T>;\n },\n);\n\nexport function injectPopoverTriggerState<T>(\n options?: StateInjectionOptions,\n): Signal<NgpPopoverTriggerState<T>> {\n return _injectPopoverTriggerState(options) as Signal<NgpPopoverTriggerState<T>>;\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 { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n Directive,\n input,\n numberAttribute,\n OnDestroy,\n output,\n} from '@angular/core';\nimport {\n coerceFlip,\n dismissGuardAttribute,\n NgpDismissGuard,\n NgpDismissGuardInput,\n NgpFlip,\n NgpFlipInput,\n NgpOverlayContent,\n coerceOffset,\n NgpOffset,\n NgpOffsetInput,\n coerceShift,\n NgpShift,\n NgpShiftInput,\n} from 'ng-primitives/portal';\nimport { injectPopoverConfig } from '../config/popover-config';\nimport {\n NgpPopoverPlacement,\n ngpPopoverTrigger,\n providePopoverTriggerState,\n} 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})\nexport class NgpPopoverTrigger<T = null> implements OnDestroy {\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 * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.\n * @default true\n */\n readonly flip = input<NgpFlip, NgpFlipInput>(this.config.flip, {\n alias: 'ngpPopoverTriggerFlip',\n transform: coerceFlip,\n });\n\n /**\n * Configure shift behavior to keep the popover in view.\n * Can be a boolean to enable/disable, or an object with padding and limiter options.\n * @default undefined (enabled by default in overlay)\n */\n readonly shift = input<NgpShift, NgpShiftInput>(this.config.shift, {\n alias: 'ngpPopoverTriggerShift',\n transform: coerceShift,\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, or a guard function.\n * @default true\n */\n readonly closeOnOutsideClick = input<NgpDismissGuard<Element>, NgpDismissGuardInput<Element>>(\n this.config.closeOnOutsideClick,\n {\n alias: 'ngpPopoverTriggerCloseOnOutsideClick',\n transform: dismissGuardAttribute,\n },\n );\n\n /**\n * Define whether the popover should close when the escape key is pressed, or a guard function.\n * @default true\n */\n readonly closeOnEscape = input<\n NgpDismissGuard<KeyboardEvent>,\n NgpDismissGuardInput<KeyboardEvent>\n >(this.config.closeOnEscape, {\n alias: 'ngpPopoverTriggerCloseOnEscape',\n transform: dismissGuardAttribute,\n });\n\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior = input<'reposition' | 'block' | 'close'>(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 * Define whether to track the trigger element position on every animation frame.\n * Useful for moving elements like slider thumbs.\n * @default false\n */\n readonly trackPosition = input<boolean, BooleanInput>(this.config.trackPosition, {\n alias: 'ngpPopoverTriggerTrackPosition',\n transform: booleanAttribute,\n });\n\n /**\n * Define the cooldown duration in milliseconds.\n * When moving from one popover to another within this duration,\n * the showDelay is skipped for the new popover.\n * @default 0\n */\n readonly cooldown = input<number, NumberInput>(this.config.cooldown, {\n alias: 'ngpPopoverTriggerCooldown',\n transform: numberAttribute,\n });\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 protected readonly state = ngpPopoverTrigger({\n popover: this.popover,\n disabled: this.disabled,\n placement: this.placement,\n offset: this.offset,\n showDelay: this.showDelay,\n hideDelay: this.hideDelay,\n flip: this.flip,\n shift: this.shift,\n container: this.container,\n closeOnOutsideClick: this.closeOnOutsideClick,\n closeOnEscape: this.closeOnEscape,\n scrollBehavior: this.scrollBehavior,\n context: this.context,\n anchor: this.anchor,\n trackPosition: this.trackPosition,\n cooldown: this.cooldown,\n onOpenChange: (value: boolean) => this.openChange.emit(value),\n });\n\n ngOnDestroy(): void {\n this.state.destroy();\n }\n\n /**\n * Show the popover.\n * @returns A promise that resolves when the popover has been shown\n */\n show(): Promise<void> {\n return this.state.show();\n }\n\n /**\n * @internal\n * Hide the popover.\n * @returns A promise that resolves when the popover has been hidden\n */\n hide(origin: FocusOrigin = 'program'): Promise<void> {\n return this.state.hide(origin);\n }\n}\n","import { signal, Signal } from '@angular/core';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { injectOverlay } from 'ng-primitives/portal';\nimport {\n attrBinding,\n controlled,\n createPrimitive,\n dataBinding,\n styleBinding,\n} from 'ng-primitives/state';\n\nexport interface NgpPopoverState {\n /** The unique id of the tooltip. */\n readonly id: Signal<string>;\n}\n\nexport interface NgpPopoverProps {\n /** The unique id of the tooltip. */\n readonly id?: Signal<string>;\n}\n\nexport const [NgpPopoverStateToken, ngpPopover, injectPopoverState, providePopoverState] =\n createPrimitive('NgpPopover', ({ id: _id = signal<string>('') }: NgpPopoverProps) => {\n const elementRef = injectElementRef<HTMLElement>();\n\n const overlay = injectOverlay();\n const id = controlled(_id);\n\n id.set(overlay.id());\n\n // Host binding\n attrBinding(elementRef, 'role', 'dialog');\n attrBinding(elementRef, 'id', id);\n styleBinding(elementRef, 'left.px', () => overlay.position().x ?? null);\n styleBinding(elementRef, 'top.px', () => overlay.position().y ?? null);\n styleBinding(elementRef, '--ngp-popover-trigger-width.px', () => overlay.triggerWidth());\n styleBinding(elementRef, '--ngp-popover-transform-origin', () => overlay.transformOrigin());\n styleBinding(elementRef, '--ngp-popover-available-width.px', () => overlay.availableWidth());\n styleBinding(elementRef, '--ngp-popover-available-height.px', () => overlay.availableHeight());\n dataBinding(elementRef, 'data-placement', () => overlay.finalPlacement() ?? null);\n dataBinding(elementRef, 'data-overlay', '');\n\n // Effect handle\n explicitEffect([id], ([id]) => overlay.id.set(id));\n\n return {\n id,\n } satisfies NgpPopoverState;\n });\n","import { Directive, input } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { provideControlContainerIsolation } from 'ng-primitives/portal';\nimport { ngpPopover, providePopoverState } from './popover-state';\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 providers: [providePopoverState(), provideControlContainerIsolation()],\n})\nexport class NgpPopover {\n /**\n * The unique id of the tooltip.\n */\n readonly id = input('');\n\n protected readonly state = ngpPopover({\n id: this.id,\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAoFO,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;AAC5B,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,QAAQ,EAAE,CAAC;CACZ;AAEM,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAAmB,uBAAuB,CAAC;AAElG;;;;AAIG;AACG,SAAU,oBAAoB,CAAC,MAAiC,EAAA;IACpE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE,EAAE,GAAG,oBAAoB,EAAE,GAAG,MAAM,EAAE;AACjD,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,mBAAmB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,qBAAqB,EA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AE,EAAE,gCAAgC,EAAE,CAAC,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;;4FAE3D,UAAU,EAAA,UAAA,EAAA,CAAA;kBANtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,cAAc,EAAE,CAAC,YAAY,CAAC;AAC9B,oBAAA,SAAS,EAAE,CAAC,mBAAmB,EAAE,EAAE,gCAAgC,EAAE,CAAC;AACvE,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ControlContainer } from '@angular/forms';
|
|
1
2
|
import { coerceNumberProperty, coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
2
3
|
import { isNil, isObject, isFunction, injectDisposables, uniqueId, safeTakeUntilDestroyed } from 'ng-primitives/utils';
|
|
3
4
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
@@ -5,7 +6,6 @@ import { ViewportRuler } from '@angular/cdk/scrolling';
|
|
|
5
6
|
import { DOCUMENT } from '@angular/common';
|
|
6
7
|
import * as i0 from '@angular/core';
|
|
7
8
|
import { Injectable, inject, NgZone, InjectionToken, ApplicationRef, TemplateRef, Injector, DestroyRef, signal, computed, runInInjectionContext } from '@angular/core';
|
|
8
|
-
import { ControlContainer } from '@angular/forms';
|
|
9
9
|
import { getOverflowAncestors, autoUpdate, offset, flip, shift, size, arrow, computePosition } from '@floating-ui/dom';
|
|
10
10
|
import { setupExitAnimation, explicitEffect, fromResizeEvent, injectElementRef } from 'ng-primitives/internal';
|
|
11
11
|
import { Subject } from 'rxjs';
|
|
@@ -13,6 +13,24 @@ import { VERSION } from '@angular/cdk';
|
|
|
13
13
|
import { ComponentPortal, DomPortalOutlet, TemplatePortal } from '@angular/cdk/portal';
|
|
14
14
|
import { createPrimitive, controlled, onDestroy, styleBinding, dataBinding } from 'ng-primitives/state';
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Provide a null `ControlContainer` at the element level of an overlay-content root directive
|
|
18
|
+
* (e.g. `NgpPopover`, `NgpTooltip`, `NgpMenu`).
|
|
19
|
+
*
|
|
20
|
+
* Overlay content is portaled but its template is often declared inside a form, so its
|
|
21
|
+
* element-injector chain can reach that outer form's `ControlContainer` and leak it into the
|
|
22
|
+
* overlay (ngp#677 / angular#57390). This backstop resolves `ControlContainer` to `null` at the
|
|
23
|
+
* content root: a form declared *inside* the content sits closer in the injector chain and still
|
|
24
|
+
* wins, while a control with no inner form resolves to `null` here instead of escaping to the
|
|
25
|
+
* outer form.
|
|
26
|
+
*
|
|
27
|
+
* Pairs with the `EmbeddedViewInjector` in `overlay.ts`, which returns `notFoundValue` for the
|
|
28
|
+
* `Host`/`SkipSelf` `ControlContainer` lookup so the element-injector walk runs and reaches this.
|
|
29
|
+
*/
|
|
30
|
+
function provideControlContainerIsolation() {
|
|
31
|
+
return { provide: ControlContainer, useValue: null };
|
|
32
|
+
}
|
|
33
|
+
|
|
16
34
|
/**
|
|
17
35
|
* Transform function to coerce flip input values to the correct type
|
|
18
36
|
* @param value The input value to coerce
|
|
@@ -135,10 +153,10 @@ class NgpOverlayCooldownManager {
|
|
|
135
153
|
hasActiveOverlay(overlayType) {
|
|
136
154
|
return this.activeOverlays.has(overlayType);
|
|
137
155
|
}
|
|
138
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
139
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
156
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpOverlayCooldownManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
157
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpOverlayCooldownManager, providedIn: 'root' }); }
|
|
140
158
|
}
|
|
141
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpOverlayCooldownManager, decorators: [{
|
|
142
160
|
type: Injectable,
|
|
143
161
|
args: [{ providedIn: 'root' }]
|
|
144
162
|
}] });
|
|
@@ -532,10 +550,10 @@ class NgpOverlayRegistry {
|
|
|
532
550
|
});
|
|
533
551
|
}
|
|
534
552
|
}
|
|
535
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
536
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
553
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpOverlayRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
554
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpOverlayRegistry, providedIn: 'root' }); }
|
|
537
555
|
}
|
|
538
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
556
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpOverlayRegistry, decorators: [{
|
|
539
557
|
type: Injectable,
|
|
540
558
|
args: [{ providedIn: 'root' }]
|
|
541
559
|
}] });
|
|
@@ -913,51 +931,55 @@ class NoopScrollStrategy {
|
|
|
913
931
|
}
|
|
914
932
|
|
|
915
933
|
/**
|
|
916
|
-
* Bit
|
|
917
|
-
*
|
|
918
|
-
* @see InjectFlags
|
|
934
|
+
* Bit values of the internal inject flags used by Angular's DI system. These are
|
|
935
|
+
* part of Angular's ABI and are stable across versions 19+.
|
|
936
|
+
* @see InjectFlags / InternalInjectFlags
|
|
919
937
|
*/
|
|
938
|
+
const HOST_FLAG = 1;
|
|
920
939
|
const SKIP_SELF_FLAG = 4;
|
|
921
|
-
/**
|
|
922
|
-
|
|
940
|
+
/**
|
|
941
|
+
* Check whether the given inject flags include `Host` or `SkipSelf` - the flags a
|
|
942
|
+
* form directive uses when resolving its parent `ControlContainer`. Angular 20 and
|
|
943
|
+
* earlier tagged `FormControlName`/`FormGroupName` lookups with `SkipSelf`; Angular
|
|
944
|
+
* 21 tags them with `Host` instead (the flag `NgModel` has always used). Either flag
|
|
945
|
+
* means "resolve the ancestor control container", the lookup the overlay intercepts.
|
|
946
|
+
*/
|
|
947
|
+
function hasHostOrSkipSelfFlag(flags) {
|
|
923
948
|
if (typeof flags === 'number') {
|
|
924
|
-
return (flags & SKIP_SELF_FLAG) !== 0;
|
|
949
|
+
return (flags & (HOST_FLAG | SKIP_SELF_FLAG)) !== 0;
|
|
925
950
|
}
|
|
926
|
-
if (flags != null && typeof flags === 'object'
|
|
927
|
-
return !!flags.skipSelf;
|
|
951
|
+
if (flags != null && typeof flags === 'object') {
|
|
952
|
+
return !!flags.host || !!flags.skipSelf;
|
|
928
953
|
}
|
|
929
954
|
return false;
|
|
930
955
|
}
|
|
931
956
|
/**
|
|
932
957
|
* An injector wrapper that intercepts `ControlContainer` lookups carrying the
|
|
933
|
-
* `SkipSelf` flag and short-circuits them to `notFoundValue`.
|
|
958
|
+
* `Host` or `SkipSelf` flag and short-circuits them to `notFoundValue`.
|
|
934
959
|
*
|
|
935
960
|
* ## Why this is needed
|
|
936
961
|
*
|
|
937
|
-
* Angular's `lookupTokenUsingEmbeddedInjector`
|
|
938
|
-
*
|
|
939
|
-
*
|
|
940
|
-
*
|
|
941
|
-
* -
|
|
942
|
-
*
|
|
943
|
-
*
|
|
944
|
-
* `ControlContainer` — leaking the wrong form context into child components.
|
|
962
|
+
* Angular's `lookupTokenUsingEmbeddedInjector` consults the embedded view's injector
|
|
963
|
+
* before the element-injector walk for these lookups. A form directive resolving its
|
|
964
|
+
* parent `ControlContainer` (`FormControlName`, `FormGroupName`, `NgModel`) reaches
|
|
965
|
+
* this injector; if it returns the delegate's `ControlContainer: null` record, that
|
|
966
|
+
* `null` short-circuits the lookup and the element-injector walk never runs, so a
|
|
967
|
+
* `formControlName` declared inside an inner form within the overlay can no longer
|
|
968
|
+
* find that inner form and throws NG01050.
|
|
945
969
|
*
|
|
946
|
-
*
|
|
947
|
-
*
|
|
948
|
-
*
|
|
949
|
-
* components' own `FormGroupDirective` resolution (NG01050).
|
|
970
|
+
* Angular 20 and earlier tagged `FormControlName`/`FormGroupName` lookups with
|
|
971
|
+
* `SkipSelf`; Angular 21 tags them with `Host` (the flag `NgModel` has always used),
|
|
972
|
+
* so the intercept must cover both flags.
|
|
950
973
|
*
|
|
951
974
|
* ## The fix
|
|
952
975
|
*
|
|
953
|
-
* For `ControlContainer` + `SkipSelf`, return `notFoundValue`
|
|
954
|
-
*
|
|
955
|
-
*
|
|
956
|
-
*
|
|
957
|
-
*
|
|
958
|
-
*
|
|
959
|
-
*
|
|
960
|
-
* outer form from leaking.
|
|
976
|
+
* For `ControlContainer` + `Host`/`SkipSelf`, return `notFoundValue` so the
|
|
977
|
+
* element-injector walk runs and finds an inner form's `ControlContainer` when one
|
|
978
|
+
* exists. To stop a control with **no** inner form from escaping to the *outer*
|
|
979
|
+
* form, each overlay-content root directive (`NgpPopover`, `NgpTooltip`, `NgpMenu`,
|
|
980
|
+
* …) applies `provideControlContainerIsolation()` (a `ControlContainer: null` at
|
|
981
|
+
* element level): an inner form sits closer in the injector chain and still wins,
|
|
982
|
+
* while a bare control resolves to `null` there instead of leaking the outer form.
|
|
961
983
|
*
|
|
962
984
|
* @see https://github.com/angular/angular/issues/57390
|
|
963
985
|
* @see https://github.com/ng-primitives/ng-primitives/issues/677
|
|
@@ -970,7 +992,7 @@ class EmbeddedViewInjector extends Injector {
|
|
|
970
992
|
}
|
|
971
993
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
972
994
|
get(token, notFoundValue, flags) {
|
|
973
|
-
if (token === ControlContainer &&
|
|
995
|
+
if (token === ControlContainer && hasHostOrSkipSelfFlag(flags)) {
|
|
974
996
|
return notFoundValue;
|
|
975
997
|
}
|
|
976
998
|
return this.delegate.get(token, notFoundValue, flags);
|
|
@@ -1001,43 +1023,43 @@ class NgpOverlay {
|
|
|
1001
1023
|
/** Track child overlays for outside click detection */
|
|
1002
1024
|
this.childOverlays = new Set();
|
|
1003
1025
|
/** Signal tracking the portal instance */
|
|
1004
|
-
this.portal = signal(null, ...(ngDevMode ? [{ debugName: "portal" }] : []));
|
|
1026
|
+
this.portal = signal(null, ...(ngDevMode ? [{ debugName: "portal" }] : /* istanbul ignore next */ []));
|
|
1005
1027
|
/** The dedicated outlet element registered by the overlay directive (e.g. NgpMenu) */
|
|
1006
1028
|
this.registeredOutletElement = null;
|
|
1007
1029
|
/** Signal tracking the overlay position */
|
|
1008
1030
|
this.position = signal({
|
|
1009
1031
|
x: undefined,
|
|
1010
1032
|
y: undefined,
|
|
1011
|
-
}, ...(ngDevMode ? [{ debugName: "position" }] : []));
|
|
1033
|
+
}, ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
1012
1034
|
/**
|
|
1013
1035
|
* Determine if the overlay has been positioned
|
|
1014
1036
|
* @internal
|
|
1015
1037
|
*/
|
|
1016
|
-
this.isPositioned = computed(() => this.position().x !== undefined && this.position().y !== undefined, ...(ngDevMode ? [{ debugName: "isPositioned" }] : []));
|
|
1038
|
+
this.isPositioned = computed(() => this.position().x !== undefined && this.position().y !== undefined, ...(ngDevMode ? [{ debugName: "isPositioned" }] : /* istanbul ignore next */ []));
|
|
1017
1039
|
/** Signal tracking the trigger element width */
|
|
1018
|
-
this.triggerWidth = signal(null, ...(ngDevMode ? [{ debugName: "triggerWidth" }] : []));
|
|
1040
|
+
this.triggerWidth = signal(null, ...(ngDevMode ? [{ debugName: "triggerWidth" }] : /* istanbul ignore next */ []));
|
|
1019
1041
|
/** The transform origin for the overlay */
|
|
1020
|
-
this.transformOrigin = signal('center center', ...(ngDevMode ? [{ debugName: "transformOrigin" }] : []));
|
|
1042
|
+
this.transformOrigin = signal('center center', ...(ngDevMode ? [{ debugName: "transformOrigin" }] : /* istanbul ignore next */ []));
|
|
1021
1043
|
/** Signal tracking the available width before the overlay overflows the viewport */
|
|
1022
|
-
this.availableWidth = signal(null, ...(ngDevMode ? [{ debugName: "availableWidth" }] : []));
|
|
1044
|
+
this.availableWidth = signal(null, ...(ngDevMode ? [{ debugName: "availableWidth" }] : /* istanbul ignore next */ []));
|
|
1023
1045
|
/** Signal tracking the available height before the overlay overflows the viewport */
|
|
1024
|
-
this.availableHeight = signal(null, ...(ngDevMode ? [{ debugName: "availableHeight" }] : []));
|
|
1046
|
+
this.availableHeight = signal(null, ...(ngDevMode ? [{ debugName: "availableHeight" }] : /* istanbul ignore next */ []));
|
|
1025
1047
|
/** Signal tracking the final placement of the overlay */
|
|
1026
|
-
this.finalPlacement = signal(undefined, ...(ngDevMode ? [{ debugName: "finalPlacement" }] : []));
|
|
1048
|
+
this.finalPlacement = signal(undefined, ...(ngDevMode ? [{ debugName: "finalPlacement" }] : /* istanbul ignore next */ []));
|
|
1027
1049
|
/** Portal currently being destroyed (for cancel support during exit animations) */
|
|
1028
1050
|
this.destroyingPortal = null;
|
|
1029
1051
|
/** Signal tracking whether the overlay is open */
|
|
1030
|
-
this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
1052
|
+
this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
1031
1053
|
/** A unique id for the overlay */
|
|
1032
|
-
this.id = signal(uniqueId('ngp-overlay'), ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
1054
|
+
this.id = signal(uniqueId('ngp-overlay'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
1033
1055
|
/**
|
|
1034
1056
|
* Signal tracking the focus origin used to close the overlay.
|
|
1035
1057
|
* Updated when hide() is called.
|
|
1036
1058
|
* @internal
|
|
1037
1059
|
*/
|
|
1038
|
-
this.closeOrigin = signal('program', ...(ngDevMode ? [{ debugName: "closeOrigin" }] : []));
|
|
1060
|
+
this.closeOrigin = signal('program', ...(ngDevMode ? [{ debugName: "closeOrigin" }] : /* istanbul ignore next */ []));
|
|
1039
1061
|
/** The aria-describedby attribute for accessibility */
|
|
1040
|
-
this.ariaDescribedBy = computed(() => (this.isOpen() ? this.id() : undefined), ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : []));
|
|
1062
|
+
this.ariaDescribedBy = computed(() => (this.isOpen() ? this.id() : undefined), ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []));
|
|
1041
1063
|
/** The scroll strategy */
|
|
1042
1064
|
this.scrollStrategy = new NoopScrollStrategy();
|
|
1043
1065
|
/** An observable that emits when the overlay is closing */
|
|
@@ -1046,7 +1068,7 @@ class NgpOverlay {
|
|
|
1046
1068
|
* Signal tracking whether the current transition is instant due to cooldown.
|
|
1047
1069
|
* When true, CSS can skip animations using the data-instant attribute.
|
|
1048
1070
|
*/
|
|
1049
|
-
this.instantTransition = signal(false, ...(ngDevMode ? [{ debugName: "instantTransition" }] : []));
|
|
1071
|
+
this.instantTransition = signal(false, ...(ngDevMode ? [{ debugName: "instantTransition" }] : /* istanbul ignore next */ []));
|
|
1050
1072
|
/** Store the arrow element */
|
|
1051
1073
|
this.arrowElement = null;
|
|
1052
1074
|
/** Store the arrow padding signal */
|
|
@@ -1055,15 +1077,17 @@ class NgpOverlay {
|
|
|
1055
1077
|
this.arrowPosition = signal({
|
|
1056
1078
|
x: undefined,
|
|
1057
1079
|
y: undefined,
|
|
1058
|
-
}, ...(ngDevMode ? [{ debugName: "arrowPosition" }] : []));
|
|
1080
|
+
}, ...(ngDevMode ? [{ debugName: "arrowPosition" }] : /* istanbul ignore next */ []));
|
|
1059
1081
|
// we cannot inject the viewContainerRef as this can throw an error during hydration in SSR
|
|
1060
1082
|
this.viewContainerRef = config.viewContainerRef;
|
|
1061
1083
|
// Listen for placement signal changes to update position
|
|
1062
|
-
|
|
1084
|
+
// eslint-disable-next-line @angular-eslint/no-uncalled-signals -- checking whether the optional signal was provided, not its value
|
|
1085
|
+
if (config.placement !== undefined) {
|
|
1063
1086
|
explicitEffect([config.placement], () => this.updatePosition());
|
|
1064
1087
|
}
|
|
1065
1088
|
// Listen for position signal changes to update position
|
|
1066
|
-
|
|
1089
|
+
// eslint-disable-next-line @angular-eslint/no-uncalled-signals -- checking whether the optional signal was provided, not its value
|
|
1090
|
+
if (config.position !== undefined) {
|
|
1067
1091
|
explicitEffect([config.position], () => this.updatePosition());
|
|
1068
1092
|
}
|
|
1069
1093
|
// this must be done after the config is set
|
|
@@ -1696,9 +1720,9 @@ const [NgpOverlayArrowStateToken, ngpOverlayArrow, injectOverlayArrowState, prov
|
|
|
1696
1720
|
overlay.registerArrow(element.nativeElement, padding);
|
|
1697
1721
|
// cleanup the arrow element on destroy
|
|
1698
1722
|
onDestroy(() => overlay.unregisterArrow());
|
|
1699
|
-
const x = computed(() => overlay.arrowPosition().x, ...(ngDevMode ? [{ debugName: "x" }] : []));
|
|
1700
|
-
const y = computed(() => overlay.arrowPosition().y, ...(ngDevMode ? [{ debugName: "y" }] : []));
|
|
1701
|
-
const placement = computed(() => overlay.finalPlacement(), ...(ngDevMode ? [{ debugName: "placement" }] : []));
|
|
1723
|
+
const x = computed(() => overlay.arrowPosition().x, ...(ngDevMode ? [{ debugName: "x" }] : /* istanbul ignore next */ []));
|
|
1724
|
+
const y = computed(() => overlay.arrowPosition().y, ...(ngDevMode ? [{ debugName: "y" }] : /* istanbul ignore next */ []));
|
|
1725
|
+
const placement = computed(() => overlay.finalPlacement(), ...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
|
|
1702
1726
|
// bind the arrow position styles
|
|
1703
1727
|
styleBinding(element, 'inset-inline-start.px', () => x() ?? null);
|
|
1704
1728
|
styleBinding(element, 'inset-block-start.px', () => y() ?? null);
|
|
@@ -1750,5 +1774,5 @@ function coerceShift(value) {
|
|
|
1750
1774
|
* Generated bundle index. Do not edit.
|
|
1751
1775
|
*/
|
|
1752
1776
|
|
|
1753
|
-
export { BlockScrollStrategy, CloseScrollStrategy, NgpComponentPortal, NgpOverlay, NgpOverlayArrowStateToken, NgpOverlayCooldownManager, NgpOverlayRegistry, NgpPortal, NgpTemplatePortal, NoopScrollStrategy, coerceFlip, coerceOffset, coerceShift, createOverlay, createPortal, dismissGuardAttribute, injectOverlay, injectOverlayArrowState, injectOverlayContext, ngpOverlayArrow, provideOverlayArrowState, provideOverlayContext };
|
|
1777
|
+
export { BlockScrollStrategy, CloseScrollStrategy, NgpComponentPortal, NgpOverlay, NgpOverlayArrowStateToken, NgpOverlayCooldownManager, NgpOverlayRegistry, NgpPortal, NgpTemplatePortal, NoopScrollStrategy, coerceFlip, coerceOffset, coerceShift, createOverlay, createPortal, dismissGuardAttribute, injectOverlay, injectOverlayArrowState, injectOverlayContext, ngpOverlayArrow, provideControlContainerIsolation, provideOverlayArrowState, provideOverlayContext };
|
|
1754
1778
|
//# sourceMappingURL=ng-primitives-portal.mjs.map
|