ng-primitives 0.121.0 → 0.123.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-combobox.mjs +23 -4
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-context-menu.mjs +9 -3
- package/fesm2022/ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-date-picker.mjs +1 -1
- package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +184 -3
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +139 -21
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-navigation-menu.mjs +6 -2
- package/fesm2022/ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +8 -3
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +74 -12
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +17 -3
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-toast.mjs +15 -12
- package/fesm2022/ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +28 -123
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/ng-primitives-utils.mjs +40 -23
- package/fesm2022/ng-primitives-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-generate/templates/toggle-group/toggle-group.__fileSuffix@dasherize__.ts.template +2 -2
- package/types/ng-primitives-combobox.d.ts +11 -1
- package/types/ng-primitives-context-menu.d.ts +16 -3
- package/types/ng-primitives-internal.d.ts +95 -3
- package/types/ng-primitives-menu.d.ts +58 -11
- package/types/ng-primitives-navigation-menu.d.ts +22 -9
- package/types/ng-primitives-popover.d.ts +9 -2
- package/types/ng-primitives-portal.d.ts +31 -1
- package/types/ng-primitives-select.d.ts +9 -2
- package/types/ng-primitives-toast.d.ts +4 -3
- package/types/ng-primitives-tooltip.d.ts +24 -17
- package/types/ng-primitives-utils.d.ts +12 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-tooltip.mjs","sources":["../../../../packages/ng-primitives/tooltip/src/config/tooltip-config.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-arrow/tooltip-arrow-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-arrow/tooltip-arrow.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-text-content/tooltip-text-content-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-text-content/tooltip-text-content.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-hover-bridge.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger.ts","../../../../packages/ng-primitives/tooltip/src/ng-primitives-tooltip.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\nimport { NgpFlip, NgpOffset, NgpShift } from 'ng-primitives/portal';\n\nexport interface NgpTooltipConfig {\n /**\n * Define the offset of the tooltip 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 tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 500\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * 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 into which the tooltip should be attached.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n\n /**\n * Whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n showOnOverflow: boolean;\n\n /**\n * Whether to use the text content of the trigger element as the tooltip content.\n * @default true\n */\n useTextContent: boolean;\n\n /**\n * Configure shift behavior to keep the tooltip 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 * Defines how the tooltip behaves when the window is scrolled.\n * @default 'reposition'\n */\n scrollBehavior: 'reposition' | 'close';\n\n /**\n * Cooldown duration in milliseconds.\n * When moving from one tooltip to another within this duration,\n * the showDelay is skipped for the new tooltip.\n * @default 300\n */\n cooldown: number;\n\n /**\n * Whether hovering the tooltip content keeps it open while moving from the trigger.\n * @default false\n */\n hoverableContent: boolean;\n}\n\nexport const defaultTooltipConfig: NgpTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 500,\n flip: true,\n container: 'body',\n showOnOverflow: false,\n useTextContent: true,\n shift: undefined,\n trackPosition: false,\n scrollBehavior: 'reposition',\n cooldown: 300,\n hoverableContent: false,\n};\n\nexport const NgpTooltipConfigToken = new InjectionToken<NgpTooltipConfig>('NgpTooltipConfigToken');\n\n/**\n * Provide the default Tooltip configuration\n * @param config The Tooltip configuration\n * @returns The provider\n */\nexport function provideTooltipConfig(config: Partial<NgpTooltipConfig>): Provider[] {\n return [\n {\n provide: NgpTooltipConfigToken,\n useValue: { ...defaultTooltipConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tooltip configuration\n * @returns The global Tooltip configuration\n */\nexport function injectTooltipConfig(): NgpTooltipConfig {\n return inject(NgpTooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;\n}\n","import { NgpOverlayArrowProps, NgpOverlayArrowState, ngpOverlayArrow } from 'ng-primitives/portal';\nimport { createPrimitive } from 'ng-primitives/state';\n\n// Re-export types with tooltip-specific aliases\nexport { NgpOverlayArrowProps as NgpTooltipArrowProps };\nexport { NgpOverlayArrowState as NgpTooltipArrowState };\n\nexport const [\n NgpTooltipArrowStateToken,\n ngpTooltipArrow,\n injectTooltipArrowState,\n provideTooltipArrowState,\n] = createPrimitive(\n 'NgpTooltipArrow',\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 { ngpTooltipArrow, provideTooltipArrowState } from './tooltip-arrow-state';\n\n@Directive({\n selector: '[ngpTooltipArrow]',\n exportAs: 'ngpTooltipArrow',\n providers: [provideTooltipArrowState()],\n})\nexport class NgpTooltipArrow {\n /**\n * Padding between the arrow and the edges of the tooltip.\n * This prevents the arrow from overflowing the rounded corners.\n */\n readonly padding = input<number | undefined, NumberInput>(undefined, {\n alias: 'ngpTooltipArrowPadding',\n transform: numberAttribute,\n });\n\n protected readonly state = ngpTooltipArrow({ padding: this.padding });\n\n /**\n * Set the padding between the arrow and the edges of the tooltip.\n * @param value The padding value in pixels\n */\n setPadding(value: number | undefined): void {\n this.state.setPadding(value);\n }\n}\n","import { ElementRef, Signal, signal } from '@angular/core';\nimport { ngpHover } from 'ng-primitives/interactions';\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';\nimport { injectTooltipTriggerState } from '../tooltip-trigger/tooltip-trigger-state';\n\nexport interface NgpTooltipState {\n /** Access the element's reference. */\n readonly elementRef: ElementRef;\n /** The unique id of the tooltip. */\n readonly id: Signal<string>;\n}\n\nexport interface NgpTooltipProps {\n /** The unique id of the tooltip. */\n readonly id?: Signal<string>;\n}\n\nexport const [NgpTooltipStateToken, ngpTooltip, injectTooltipState, provideTooltipState] =\n createPrimitive('NgpTooltip', ({ id: _id = signal<string>('') }: NgpTooltipProps) => {\n const elementRef = injectElementRef();\n const tooltipTriggerState = injectTooltipTriggerState();\n const overlay = injectOverlay();\n\n const id = controlled(_id);\n\n // Seed the id with the overlay's generated unique id so the tooltip has a\n // valid id (and the trigger a valid aria-describedby) when none is provided.\n // `controlled` returns a linkedSignal, so this is only a transient default:\n // if a consumer binds `id`, that source change supersedes this seed.\n id.set(overlay.id());\n\n // Setup interactions\n ngpHover({\n onHoverStart: () => tooltipTriggerState().onTooltipHoverStart(),\n onHoverEnd: () => tooltipTriggerState().onTooltipHoverEnd(),\n });\n\n // Host binding\n attrBinding(elementRef, 'role', 'tooltip');\n attrBinding(elementRef, 'id', () => id());\n dataBinding(elementRef, 'data-overlay', '');\n dataBinding(elementRef, 'data-placement', () => overlay.finalPlacement()?.toString() ?? null);\n styleBinding(elementRef, 'left.px', () => overlay.position().x ?? null);\n styleBinding(elementRef, 'top.px', () => overlay.position().y ?? null);\n styleBinding(elementRef, '--ngp-tooltip-trigger-width.px', () => overlay.triggerWidth());\n styleBinding(elementRef, '--ngp-tooltip-transform-origin', () => overlay.transformOrigin());\n styleBinding(elementRef, '--ngp-tooltip-available-width.px', () => overlay.availableWidth());\n styleBinding(elementRef, '--ngp-tooltip-available-height.px', () => overlay.availableHeight());\n\n // Effects\n explicitEffect([id], ([id]) => overlay.id.set(id));\n\n return {\n elementRef,\n id,\n } satisfies NgpTooltipState;\n });\n","import { Directive, input } from '@angular/core';\nimport { provideControlContainerIsolation } from 'ng-primitives/portal';\nimport { ngpTooltip } from './tooltip-state';\n\n/**\n * Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpTooltip]',\n exportAs: 'ngpTooltip',\n providers: [provideControlContainerIsolation()],\n})\nexport class NgpTooltip {\n /**\n * The unique id of the tooltip.\n */\n readonly id = input('');\n\n protected readonly state = ngpTooltip({\n id: this.id,\n });\n}\n","import { ElementRef, Signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectOverlayContext } from 'ng-primitives/portal';\nimport { attrBinding, createPrimitive } from 'ng-primitives/state';\n\nexport interface NgpTooltipTextContentState {\n /** Access the component's context. */\n readonly elementRef: ElementRef;\n /** The string content to display. */\n readonly content: Signal<unknown>;\n}\n\nexport interface NgpTooltipTextContentProps {}\n\nexport const [\n NgpTooltipTextContentStateToken,\n ngpTooltipTextContent,\n injectTooltipTextContentState,\n provideTooltipTextContentState,\n] = createPrimitive('NgpTooltipTextContent', ({}: NgpTooltipTextContentProps) => {\n const elementRef = injectElementRef();\n const content = injectOverlayContext();\n\n // Host bindings\n attrBinding(elementRef, 'ngpTooltip', '');\n\n return { elementRef, content } satisfies NgpTooltipTextContentState;\n});\n","import { Component } from '@angular/core';\nimport { NgpTooltip } from '../tooltip/tooltip';\nimport { ngpTooltipTextContent } from './tooltip-text-content-state';\n\n/**\n * Internal component for wrapping string content in tooltip portals\n * @internal\n */\n@Component({\n template: '{{ state.content() }}',\n hostDirectives: [NgpTooltip],\n})\nexport class NgpTooltipTextContentComponent {\n protected readonly state = ngpTooltipTextContent({});\n}\n","export interface TooltipHoverBridgePoint {\n x: number;\n y: number;\n}\n\ninterface CreateTooltipHoverBridgePolygonOptions {\n triggerRect: DOMRect | null;\n tooltipRect: DOMRect | null;\n exitPoint: TooltipHoverBridgePoint;\n corridorHalfSize?: number;\n}\n\n/**\n * Builds a pointer grace polygon between the trigger exit point and the tooltip.\n * The polygon is intentionally directional so moving away from the tooltip exits quickly.\n */\nexport function createTooltipHoverBridgePolygon({\n triggerRect,\n tooltipRect,\n exitPoint,\n corridorHalfSize = 8,\n}: CreateTooltipHoverBridgePolygonOptions): TooltipHoverBridgePoint[] | null {\n if (!triggerRect || !tooltipRect) {\n return null;\n }\n\n const triggerCenterX = triggerRect.left + triggerRect.width / 2;\n const triggerCenterY = triggerRect.top + triggerRect.height / 2;\n const tooltipCenterX = tooltipRect.left + tooltipRect.width / 2;\n const tooltipCenterY = tooltipRect.top + tooltipRect.height / 2;\n\n const dx = tooltipCenterX - triggerCenterX;\n const dy = tooltipCenterY - triggerCenterY;\n const horizontalDominant = Math.abs(dx) >= Math.abs(dy);\n\n if (horizontalDominant) {\n const targetX = dx >= 0 ? tooltipRect.left : tooltipRect.right;\n return [\n { x: exitPoint.x, y: exitPoint.y - corridorHalfSize },\n { x: exitPoint.x, y: exitPoint.y + corridorHalfSize },\n { x: targetX, y: tooltipRect.bottom + corridorHalfSize },\n { x: targetX, y: tooltipRect.top - corridorHalfSize },\n ];\n }\n\n const targetY = dy >= 0 ? tooltipRect.top : tooltipRect.bottom;\n return [\n { x: exitPoint.x - corridorHalfSize, y: exitPoint.y },\n { x: exitPoint.x + corridorHalfSize, y: exitPoint.y },\n { x: tooltipRect.right + corridorHalfSize, y: targetY },\n { x: tooltipRect.left - corridorHalfSize, y: targetY },\n ];\n}\n\n/**\n * Returns true when the point lies inside the provided polygon.\n */\nexport function isPointInHoverBridgePolygon(\n point: TooltipHoverBridgePoint,\n polygon: TooltipHoverBridgePoint[],\n): boolean {\n let inside = false;\n\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n\n const intersects =\n yi > point.y !== yj > point.y &&\n point.x < ((xj - xi) * (point.y - yi)) / (yj - yi || Number.EPSILON) + xi;\n if (intersects) {\n inside = !inside;\n }\n }\n\n return inside;\n}\n","import {\n signal,\n Signal,\n WritableSignal,\n Injector,\n inject,\n ViewContainerRef,\n computed,\n ElementRef,\n} from '@angular/core';\nimport { injectElementRef, setupOverflowListener } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpFlip,\n NgpOffset,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n NgpPosition,\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';\nimport { injectDisposables, isString } from 'ng-primitives/utils';\nimport { NgpTooltipTextContentComponent } from '../tooltip-text-content/tooltip-text-content';\nimport {\n createTooltipHoverBridgePolygon,\n isPointInHoverBridgePolygon,\n TooltipHoverBridgePoint,\n} from './tooltip-hover-bridge';\n\nexport interface NgpTooltipTriggerState<T> {\n /** Access the tooltip template ref. */\n readonly tooltip: WritableSignal<NgpOverlayContent<T> | string | null>;\n /**\n * Define if the trigger should be disabled. This will prevent the tooltip from being shown or hidden from interactions.\n * @default false\n */\n readonly disabled: Signal<boolean>;\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement: Signal<NgpTooltipPlacement>;\n /**\n * Define the offset of the tooltip 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 tooltip is displayed.\n * @default 500\n */\n readonly showDelay: Signal<number>;\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay: Signal<number>;\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\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 tooltip 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 tooltip should be attached.\n * @default document.body\n */\n readonly container: Signal<HTMLElement | string | null>;\n /**\n * Define whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n readonly showOnOverflow: Signal<boolean>;\n /**\n * Define an anchor element for positioning the tooltip.\n * If provided, the tooltip will be positioned relative to this element instead of the trigger.\n */\n readonly anchor: Signal<HTMLElement | null>;\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context: Signal<T | undefined>;\n /**\n * Define whether to use the text content of the trigger element as the tooltip content.\n * When enabled, the tooltip will display the text content of the trigger element.\n * @default true\n */\n readonly useTextContent: Signal<boolean>;\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 * Programmatic position for the tooltip. When provided, the tooltip\n * will be positioned at these coordinates instead of the trigger element.\n * Use with trackPosition=\"true\" for smooth cursor following.\n */\n readonly position: Signal<NgpPosition | null>;\n /**\n * Defines how the tooltip behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior: Signal<'reposition' | 'close'>;\n /**\n * Define the cooldown duration in milliseconds.\n * When moving from one tooltip to another within this duration,\n * the showDelay is skipped for the new tooltip.\n * @default 300\n */\n readonly cooldown: Signal<number>;\n /**\n * Whether hovering tooltip content keeps the tooltip open.\n * @default false\n */\n readonly hoverableContent: Signal<boolean>;\n /**\n * The overlay that manages the tooltip\n * @internal\n */\n readonly overlay: WritableSignal<NgpOverlay<T | string> | null>;\n /**\n * The unique id of the tooltip.\n */\n readonly tooltipId: Signal<string | undefined>;\n /**\n * The open state of the tooltip.\n * @internal\n */\n readonly open: Signal<boolean>;\n /**\n * Determine if the trigger element has overflow.\n */\n readonly hasOverflow: Signal<boolean>;\n /**\n * Tracks whether pointer is currently over tooltip content.\n */\n readonly contentHovered: Signal<boolean>;\n /**\n * Current pointer grace polygon used while crossing trigger -> tooltip.\n */\n readonly hoverBridgePolygon: Signal<TooltipHoverBridgePoint[] | null>;\n /**\n * Show the tooltip programmatically (skips cooldown so multiple tooltips can coexist).\n */\n show: () => void;\n /**\n * Hide the tooltip.\n */\n hide: () => void;\n /**\n * Set the tooltip id.\n */\n setTooltipId: (id: string) => void;\n /**\n * Called by tooltip content when pointer enters the tooltip.\n * @internal\n */\n onTooltipHoverStart: () => void;\n /**\n * Called by tooltip content when pointer leaves the tooltip.\n * @internal\n */\n onTooltipHoverEnd: () => void;\n destroy: () => void;\n}\n\nexport interface NgpTooltipTriggerProps<T> {\n /** Access the tooltip template ref. */\n readonly tooltip?: Signal<NgpOverlayContent<T> | string | null>;\n /**\n * Define if the trigger should be disabled. This will prevent the tooltip from being shown or hidden from interactions.\n * @default false\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement?: Signal<NgpTooltipPlacement>;\n /**\n * Define the offset of the tooltip 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 tooltip is displayed.\n * @default 500\n */\n readonly showDelay?: Signal<number>;\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay?: Signal<number>;\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\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 tooltip 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 tooltip should be attached.\n * @default document.body\n */\n readonly container?: Signal<HTMLElement | string | null>;\n /**\n * Define whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n readonly showOnOverflow?: Signal<boolean>;\n /**\n * Define an anchor element for positioning the tooltip.\n * If provided, the tooltip will be positioned relative to this element instead of the trigger.\n */\n readonly anchor?: Signal<HTMLElement | null>;\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context?: Signal<T | undefined>;\n /**\n * Define whether to use the text content of the trigger element as the tooltip content.\n * When enabled, the tooltip will display the text content of the trigger element.\n * @default true\n */\n readonly useTextContent?: Signal<boolean>;\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 * Programmatic position for the tooltip. When provided, the tooltip\n * will be positioned at these coordinates instead of the trigger element.\n * Use with trackPosition=\"true\" for smooth cursor following.\n */\n readonly position?: Signal<NgpPosition | null>;\n /**\n * Defines how the tooltip behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior?: Signal<'reposition' | 'close'>;\n /**\n * Define the cooldown duration in milliseconds.\n * When moving from one tooltip to another within this duration,\n * the showDelay is skipped for the new tooltip.\n * @default 300\n */\n readonly cooldown?: Signal<number>;\n /**\n * Whether hovering tooltip content keeps the tooltip open.\n * @default false\n */\n readonly hoverableContent?: Signal<boolean>;\n}\n\nexport const [\n NgpTooltipTriggerStateToken,\n ngpTooltipTrigger,\n _injectTooltipTriggerState,\n provideTooltipTriggerState,\n] = createPrimitive(\n 'NgpTooltipTrigger',\n <T>({\n tooltip: _tooltip = signal<NgpOverlayContent<T> | string | null>(null),\n disabled = signal<boolean>(false),\n placement = signal<NgpTooltipPlacement>('top'),\n offset = signal<NgpOffset>(0),\n showDelay = signal<number>(500),\n hideDelay = signal<number>(0),\n flip = signal<NgpFlip>(true),\n shift = signal<NgpShift | undefined>(undefined),\n container = signal<HTMLElement | string | null>('body'),\n showOnOverflow = signal<boolean>(false),\n anchor = signal<HTMLElement | null>(null),\n context = signal<T | undefined>(undefined),\n useTextContent = signal<boolean>(true),\n trackPosition = signal<boolean>(false),\n position = signal<NgpPosition | null>(null),\n scrollBehavior = signal<'reposition' | 'close'>('reposition'),\n cooldown = signal<number>(300),\n hoverableContent = signal<boolean>(false),\n }: NgpTooltipTriggerProps<T>) => {\n const HOVER_BRIDGE_TIMEOUT_MS = 150;\n const elementRef = injectElementRef();\n const injector = inject(Injector);\n const viewContainerRef = inject(ViewContainerRef);\n const trigger = inject(ElementRef<HTMLElement>);\n const tooltipTriggerState = injectTooltipTriggerState<T>();\n const disposables = injectDisposables();\n\n const tooltip = controlled(_tooltip);\n\n const tooltipId = signal<string | undefined>(undefined);\n const triggerHovered = signal<boolean>(false);\n const contentHovered = signal<boolean>(false);\n const hoverBridgePolygon = signal<TooltipHoverBridgePoint[] | null>(null);\n const overlay = signal<NgpOverlay<T | string> | null>(null);\n const hasOverflow = setupOverflowListener(trigger.nativeElement, {\n disabled: computed(() => !showOnOverflow()),\n });\n\n let removePointerMoveListener: (() => void) | undefined = undefined;\n let clearHoverBridgeTimeout: (() => void) | undefined = undefined;\n\n const open = computed(() => overlay()?.isOpen() ?? false);\n\n // Host binding\n attrBinding(elementRef, 'aria-describedby', () => overlay()?.ariaDescribedBy());\n dataBinding(elementRef, 'data-open', () => (open() ? '' : null));\n dataBinding(elementRef, 'data-disabled', () => (disabled() ? '' : null));\n\n // Listeners\n listener(elementRef, 'mouseenter', showFromInteraction);\n listener(elementRef, 'focus', showFromInteraction);\n listener(elementRef, 'mouseleave', hideFromInteraction);\n listener(elementRef, 'blur', () => hideFromInteraction());\n\n function destroy(): void {\n clearHoverBridge();\n overlay()?.destroy();\n }\n\n function show(): void {\n performShow(true);\n }\n\n function hide(): void {\n clearHoverBridge();\n overlay()?.hide();\n }\n\n /**\n * Show the tooltip from an interaction (respects disabled state, uses cooldown).\n * @internal\n */\n function showFromInteraction(): void {\n if (tooltipTriggerState().disabled()) {\n return;\n }\n triggerHovered.set(true);\n clearHoverBridge();\n performShow(false);\n }\n\n /**\n * Shared show logic.\n * @param skipCooldown When true, skip cooldown registration so multiple tooltips can coexist.\n */\n function performShow(skipCooldown: boolean): void {\n // If already open, cancel any pending close\n if (open()) {\n overlay()?.cancelPendingClose();\n return;\n }\n\n // if we should only show when there is overflow, check if the trigger has overflow\n if (tooltipTriggerState().showOnOverflow() && !hasOverflow()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!overlay()) {\n createOverlayInstance();\n }\n\n overlay()?.show({ skipCooldown });\n }\n\n function setTooltipId(id: string): void {\n tooltipId.set(id);\n }\n\n /**\n * Hide the tooltip from an interaction (respects disabled state).\n * @internal\n */\n function hideFromInteraction(event?: MouseEvent): void {\n if (tooltipTriggerState().disabled()) {\n return;\n }\n\n triggerHovered.set(false);\n\n // Blur should close regardless of hover bridge or tooltip hover state.\n if (!event) {\n contentHovered.set(false);\n clearHoverBridge();\n hide();\n return;\n }\n\n if (!tooltipTriggerState().hoverableContent()) {\n hide();\n return;\n }\n\n const tooltipElement = overlay()?.getElements()[0];\n if (!tooltipElement) {\n hide();\n return;\n }\n\n const polygon = createTooltipHoverBridgePolygon({\n triggerRect: trigger.nativeElement.getBoundingClientRect(),\n tooltipRect: tooltipElement.getBoundingClientRect(),\n exitPoint: { x: event.clientX, y: event.clientY },\n });\n\n if (!polygon) {\n hide();\n return;\n }\n\n hoverBridgePolygon.set(polygon);\n overlay()?.cancelPendingClose();\n registerPointerMoveListener();\n scheduleHoverBridgeCloseFallback();\n }\n\n /**\n * Called by tooltip content when pointer enters the tooltip.\n * @internal\n */\n function onTooltipHoverStart(): void {\n if (tooltipTriggerState().disabled() || !tooltipTriggerState().hoverableContent()) {\n return;\n }\n\n contentHovered.set(true);\n clearHoverBridge();\n overlay()?.cancelPendingClose();\n }\n\n /**\n * Called by tooltip content when pointer leaves the tooltip.\n * @internal\n */\n function onTooltipHoverEnd(): void {\n if (tooltipTriggerState().disabled() || !tooltipTriggerState().hoverableContent()) {\n return;\n }\n\n contentHovered.set(false);\n\n if (!triggerHovered()) {\n hide();\n }\n }\n\n /**\n * Create the overlay that will contain the tooltip\n */\n function createOverlayInstance(): void {\n // Determine the content and context based on useTextContent setting\n const shouldUseTextContent = tooltipTriggerState().useTextContent();\n let content = tooltip();\n let context: Signal<T | string | undefined> = tooltipTriggerState().context;\n\n if (!content) {\n if (!shouldUseTextContent) {\n if (ngDevMode) {\n console.error(\n '[ngpTooltipTrigger]: Tooltip must be a string, TemplateRef, or ComponentType. Alternatively, set useTextContent to true if none is provided.',\n );\n }\n\n return;\n }\n\n const textContent = trigger.nativeElement.textContent?.trim() || '';\n if (ngDevMode && !textContent) {\n console.warn(\n '[ngpTooltipTrigger]: useTextContent is enabled but trigger element has no text content',\n );\n return;\n }\n content = NgpTooltipTextContentComponent;\n context = signal(textContent);\n } else if (isString(content)) {\n context = signal(content);\n content = NgpTooltipTextContentComponent;\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T | string> = {\n content,\n triggerElement: trigger.nativeElement,\n anchorElement: anchor(),\n injector: injector,\n context,\n container: container(),\n placement: placement,\n offset: offset(),\n flip: flip(),\n shift: shift(),\n showDelay: showDelay(),\n hideDelay: hideDelay(),\n closeOnEscape: true,\n closeOnOutsideClick: true,\n viewContainerRef: viewContainerRef,\n trackPosition: trackPosition(),\n position: position,\n scrollBehaviour: scrollBehavior(),\n overlayType: 'tooltip',\n cooldown: cooldown(),\n };\n\n // Create the overlay instance\n overlay.set(createOverlay(config));\n }\n\n /**\n * Register document-level pointer tracking while crossing trigger -> tooltip.\n * @internal\n */\n function registerPointerMoveListener(): void {\n if (removePointerMoveListener) {\n return;\n }\n\n const cleanup = disposables.addEventListener(\n document,\n 'pointermove' as keyof HTMLElementEventMap,\n ((event: PointerEvent): void => {\n if (triggerHovered() || contentHovered() || !hoverBridgePolygon()) {\n clearHoverBridge();\n return;\n }\n\n const inBridge = isPointInHoverBridgePolygon(\n { x: event.clientX, y: event.clientY },\n hoverBridgePolygon()!,\n );\n\n if (!inBridge) {\n clearHoverBridge();\n hide();\n }\n }) as EventListener,\n true,\n );\n\n removePointerMoveListener = () => {\n cleanup();\n removePointerMoveListener = undefined;\n };\n }\n\n /**\n * Clear hover bridge state and global listeners.\n * @internal\n */\n function clearHoverBridge(): void {\n hoverBridgePolygon.set(null);\n clearHoverBridgeTimeout?.();\n clearHoverBridgeTimeout = undefined;\n removePointerMoveListener?.();\n }\n\n /**\n * Close if pointer leaves trigger and does not move into tooltip soon enough.\n * @internal\n */\n function scheduleHoverBridgeCloseFallback(): void {\n clearHoverBridgeTimeout?.();\n\n clearHoverBridgeTimeout = disposables.setTimeout(() => {\n clearHoverBridgeTimeout = undefined;\n\n if (!triggerHovered() && !contentHovered() && hoverBridgePolygon()) {\n clearHoverBridge();\n hide();\n }\n }, HOVER_BRIDGE_TIMEOUT_MS);\n }\n\n const state = {\n tooltip,\n disabled,\n placement,\n offset,\n showDelay,\n hideDelay,\n flip,\n shift,\n container,\n showOnOverflow,\n anchor,\n context,\n useTextContent,\n trackPosition,\n position,\n scrollBehavior,\n cooldown,\n hoverableContent,\n overlay,\n tooltipId,\n open,\n hasOverflow,\n contentHovered,\n hoverBridgePolygon,\n show,\n hide,\n setTooltipId,\n onTooltipHoverStart,\n onTooltipHoverEnd,\n destroy,\n } satisfies NgpTooltipTriggerState<T>;\n\n return state;\n },\n);\n\nexport function injectTooltipTriggerState<T>(\n options?: StateInjectionOptions,\n): Signal<NgpTooltipTriggerState<T>> {\n return _injectTooltipTriggerState(options) as Signal<NgpTooltipTriggerState<T>>;\n}\n\nexport type NgpTooltipPlacement =\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'top-start'\n | 'top-end'\n | 'right-start'\n | 'right-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end';\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, numberAttribute, OnDestroy } from '@angular/core';\nimport {\n coerceFlip,\n coerceOffset,\n coerceShift,\n NgpFlip,\n NgpFlipInput,\n NgpOffset,\n NgpOffsetInput,\n NgpOverlayContent,\n NgpPosition,\n NgpShift,\n NgpShiftInput,\n} from 'ng-primitives/portal';\nimport { isString } from 'ng-primitives/utils';\nimport { injectTooltipConfig } from '../config/tooltip-config';\nimport {\n NgpTooltipPlacement,\n ngpTooltipTrigger,\n provideTooltipTriggerState,\n} from './tooltip-trigger-state';\n\ntype TooltipInput<T> = NgpOverlayContent<T> | string | null | undefined;\n\n/**\n * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.\n */\n@Directive({\n selector: '[ngpTooltipTrigger]',\n exportAs: 'ngpTooltipTrigger',\n providers: [provideTooltipTriggerState({ inherit: false })],\n})\nexport class NgpTooltipTrigger<T = null> implements OnDestroy {\n /**\n * Access the global tooltip configuration.\n */\n private readonly config = injectTooltipConfig();\n\n /**\n * Access the tooltip template ref.\n */\n readonly tooltip = input<NgpOverlayContent<T> | string | null, TooltipInput<T>>(null, {\n alias: 'ngpTooltipTrigger',\n transform: (value: TooltipInput<T>) => (value && !isString(value) ? value : null),\n });\n\n /**\n * Define if the trigger should be disabled. This will prevent the tooltip from being shown or hidden from interactions.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTooltipTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<NgpTooltipPlacement>(this.config.placement, {\n alias: 'ngpTooltipTriggerPlacement',\n });\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * 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: 'ngpTooltipTriggerOffset',\n transform: coerceOffset,\n });\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 500\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpTooltipTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpTooltipTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * 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: 'ngpTooltipTriggerFlip',\n transform: coerceFlip,\n });\n\n /**\n * Configure shift behavior to keep the tooltip 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: 'ngpTooltipTriggerShift',\n transform: coerceShift,\n });\n\n /**\n * Define the container in which the tooltip should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpTooltipTriggerContainer',\n });\n\n /**\n * Define whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n readonly showOnOverflow = input<boolean, BooleanInput>(this.config.showOnOverflow, {\n alias: 'ngpTooltipTriggerShowOnOverflow',\n transform: booleanAttribute,\n });\n\n /**\n * Define an anchor element for positioning the tooltip.\n * If provided, the tooltip will be positioned relative to this element instead of the trigger.\n */\n readonly anchor = input<HTMLElement | null>(null, { alias: 'ngpTooltipTriggerAnchor' });\n\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpTooltipTriggerContext',\n });\n\n /**\n * Define whether to use the text content of the trigger element as the tooltip content.\n * When enabled, the tooltip will display the text content of the trigger element.\n * @default true\n */\n readonly useTextContent = input<boolean, BooleanInput>(this.config.useTextContent, {\n alias: 'ngpTooltipTriggerUseTextContent',\n transform: booleanAttribute,\n });\n\n /**\n * 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: 'ngpTooltipTriggerTrackPosition',\n transform: booleanAttribute,\n });\n\n /**\n * Programmatic position for the tooltip. When provided, the tooltip\n * will be positioned at these coordinates instead of the trigger element.\n * Use with trackPosition=\"true\" for smooth cursor following.\n */\n readonly position = input<NgpPosition | null>(null, {\n alias: 'ngpTooltipTriggerPosition',\n });\n\n /**\n * Defines how the tooltip behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior = input<'reposition' | 'close'>(this.config.scrollBehavior, {\n alias: 'ngpTooltipTriggerScrollBehavior',\n });\n\n /**\n * Define the cooldown duration in milliseconds.\n * When moving from one tooltip to another within this duration,\n * the showDelay is skipped for the new tooltip.\n * @default 300\n */\n readonly cooldown = input<number, NumberInput>(this.config.cooldown, {\n alias: 'ngpTooltipTriggerCooldown',\n transform: numberAttribute,\n });\n\n /**\n * Whether hovering tooltip content keeps the tooltip open.\n * @default false\n */\n readonly hoverableContent = input<boolean, BooleanInput>(this.config.hoverableContent, {\n alias: 'ngpTooltipTriggerHoverableContent',\n transform: booleanAttribute,\n });\n\n protected readonly state = ngpTooltipTrigger({\n tooltip: this.tooltip,\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 showOnOverflow: this.showOnOverflow,\n anchor: this.anchor,\n context: this.context,\n useTextContent: this.useTextContent,\n trackPosition: this.trackPosition,\n position: this.position,\n scrollBehavior: this.scrollBehavior,\n cooldown: this.cooldown,\n hoverableContent: this.hoverableContent,\n });\n\n ngOnDestroy(): void {\n return this.state.destroy();\n }\n\n /**\n * Show the tooltip programmatically (skips cooldown so multiple tooltips can coexist).\n */\n show(): void {\n return this.state.show();\n }\n\n /**\n * Hide the tooltip.\n */\n hide(): void {\n return this.state.hide();\n }\n\n /**\n * Called by tooltip content when pointer enters the tooltip.\n * @internal\n */\n onTooltipHoverStart(): void {\n return this.state.onTooltipHoverStart();\n }\n\n /**\n * Called by tooltip content when pointer leaves the tooltip.\n * @internal\n */\n onTooltipHoverEnd(): void {\n return this.state.onTooltipHoverEnd();\n }\n\n /**\n * Set the tooltip id.\n */\n setTooltipId(id: string): void {\n return this.state.setTooltipId(id);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA0FO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,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,EAAA,iBAAA,EAAA,kBAAA,EAAA,UAAA,EAAA,mCAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,SAAA,EAFjB,CAAC,0BAA0B,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAEhD,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;oBAC7B,SAAS,EAAE,CAAC,0BAA0B,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AAC5D,iBAAA;;;AChCD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-tooltip.mjs","sources":["../../../../packages/ng-primitives/tooltip/src/config/tooltip-config.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-arrow/tooltip-arrow-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-arrow/tooltip-arrow.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-text-content/tooltip-text-content-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-text-content/tooltip-text-content.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger.ts","../../../../packages/ng-primitives/tooltip/src/ng-primitives-tooltip.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\nimport { NgpFlip, NgpOffset, NgpShift } from 'ng-primitives/portal';\n\nexport interface NgpTooltipConfig {\n /**\n * Define the offset of the tooltip 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 tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 500\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * 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 into which the tooltip should be attached.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n\n /**\n * Whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n showOnOverflow: boolean;\n\n /**\n * Whether to use the text content of the trigger element as the tooltip content.\n * @default true\n */\n useTextContent: boolean;\n\n /**\n * Configure shift behavior to keep the tooltip 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 * Defines how the tooltip behaves when the window is scrolled.\n * @default 'reposition'\n */\n scrollBehavior: 'reposition' | 'close';\n\n /**\n * Cooldown duration in milliseconds.\n * When moving from one tooltip to another within this duration,\n * the showDelay is skipped for the new tooltip.\n * @default 300\n */\n cooldown: number;\n\n /**\n * Whether hovering the tooltip content keeps it open while moving from the trigger.\n * @default false\n */\n hoverableContent: boolean;\n}\n\nexport const defaultTooltipConfig: NgpTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 500,\n flip: true,\n container: 'body',\n showOnOverflow: false,\n useTextContent: true,\n shift: undefined,\n trackPosition: false,\n scrollBehavior: 'reposition',\n cooldown: 300,\n hoverableContent: false,\n};\n\nexport const NgpTooltipConfigToken = new InjectionToken<NgpTooltipConfig>('NgpTooltipConfigToken');\n\n/**\n * Provide the default Tooltip configuration\n * @param config The Tooltip configuration\n * @returns The provider\n */\nexport function provideTooltipConfig(config: Partial<NgpTooltipConfig>): Provider[] {\n return [\n {\n provide: NgpTooltipConfigToken,\n useValue: { ...defaultTooltipConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tooltip configuration\n * @returns The global Tooltip configuration\n */\nexport function injectTooltipConfig(): NgpTooltipConfig {\n return inject(NgpTooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;\n}\n","import { NgpOverlayArrowProps, NgpOverlayArrowState, ngpOverlayArrow } from 'ng-primitives/portal';\nimport { createPrimitive } from 'ng-primitives/state';\n\n// Re-export types with tooltip-specific aliases\nexport { NgpOverlayArrowProps as NgpTooltipArrowProps };\nexport { NgpOverlayArrowState as NgpTooltipArrowState };\n\nexport const [\n NgpTooltipArrowStateToken,\n ngpTooltipArrow,\n injectTooltipArrowState,\n provideTooltipArrowState,\n] = createPrimitive(\n 'NgpTooltipArrow',\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 { ngpTooltipArrow, provideTooltipArrowState } from './tooltip-arrow-state';\n\n@Directive({\n selector: '[ngpTooltipArrow]',\n exportAs: 'ngpTooltipArrow',\n providers: [provideTooltipArrowState()],\n})\nexport class NgpTooltipArrow {\n /**\n * Padding between the arrow and the edges of the tooltip.\n * This prevents the arrow from overflowing the rounded corners.\n */\n readonly padding = input<number | undefined, NumberInput>(undefined, {\n alias: 'ngpTooltipArrowPadding',\n transform: numberAttribute,\n });\n\n protected readonly state = ngpTooltipArrow({ padding: this.padding });\n\n /**\n * Set the padding between the arrow and the edges of the tooltip.\n * @param value The padding value in pixels\n */\n setPadding(value: number | undefined): void {\n this.state.setPadding(value);\n }\n}\n","import { ElementRef, Signal, signal } from '@angular/core';\nimport { ngpHover } from 'ng-primitives/interactions';\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';\nimport { injectTooltipTriggerState } from '../tooltip-trigger/tooltip-trigger-state';\n\nexport interface NgpTooltipState {\n /** Access the element's reference. */\n readonly elementRef: ElementRef;\n /** The unique id of the tooltip. */\n readonly id: Signal<string>;\n}\n\nexport interface NgpTooltipProps {\n /** The unique id of the tooltip. */\n readonly id?: Signal<string>;\n}\n\nexport const [NgpTooltipStateToken, ngpTooltip, injectTooltipState, provideTooltipState] =\n createPrimitive('NgpTooltip', ({ id: _id = signal<string>('') }: NgpTooltipProps) => {\n const elementRef = injectElementRef();\n const tooltipTriggerState = injectTooltipTriggerState();\n const overlay = injectOverlay();\n\n const id = controlled(_id);\n\n // Seed the id with the overlay's generated unique id so the tooltip has a\n // valid id (and the trigger a valid aria-describedby) when none is provided.\n // `controlled` returns a linkedSignal, so this is only a transient default:\n // if a consumer binds `id`, that source change supersedes this seed.\n id.set(overlay.id());\n\n // Setup interactions\n ngpHover({\n onHoverStart: () => tooltipTriggerState().onTooltipHoverStart(),\n onHoverEnd: () => tooltipTriggerState().onTooltipHoverEnd(),\n });\n\n // Host binding\n attrBinding(elementRef, 'role', 'tooltip');\n attrBinding(elementRef, 'id', () => id());\n dataBinding(elementRef, 'data-overlay', '');\n dataBinding(elementRef, 'data-placement', () => overlay.finalPlacement()?.toString() ?? null);\n styleBinding(elementRef, 'left.px', () => overlay.position().x ?? null);\n styleBinding(elementRef, 'top.px', () => overlay.position().y ?? null);\n styleBinding(elementRef, '--ngp-tooltip-trigger-width.px', () => overlay.triggerWidth());\n styleBinding(elementRef, '--ngp-tooltip-transform-origin', () => overlay.transformOrigin());\n styleBinding(elementRef, '--ngp-tooltip-available-width.px', () => overlay.availableWidth());\n styleBinding(elementRef, '--ngp-tooltip-available-height.px', () => overlay.availableHeight());\n\n // Effects\n explicitEffect([id], ([id]) => overlay.id.set(id));\n\n return {\n elementRef,\n id,\n } satisfies NgpTooltipState;\n });\n","import { Directive, input } from '@angular/core';\nimport { provideControlContainerIsolation } from 'ng-primitives/portal';\nimport { ngpTooltip } from './tooltip-state';\n\n/**\n * Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpTooltip]',\n exportAs: 'ngpTooltip',\n providers: [provideControlContainerIsolation()],\n})\nexport class NgpTooltip {\n /**\n * The unique id of the tooltip.\n */\n readonly id = input('');\n\n protected readonly state = ngpTooltip({\n id: this.id,\n });\n}\n","import { ElementRef, Signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectOverlayContext } from 'ng-primitives/portal';\nimport { attrBinding, createPrimitive } from 'ng-primitives/state';\n\nexport interface NgpTooltipTextContentState {\n /** Access the component's context. */\n readonly elementRef: ElementRef;\n /** The string content to display. */\n readonly content: Signal<unknown>;\n}\n\nexport interface NgpTooltipTextContentProps {}\n\nexport const [\n NgpTooltipTextContentStateToken,\n ngpTooltipTextContent,\n injectTooltipTextContentState,\n provideTooltipTextContentState,\n] = createPrimitive('NgpTooltipTextContent', ({}: NgpTooltipTextContentProps) => {\n const elementRef = injectElementRef();\n const content = injectOverlayContext();\n\n // Host bindings\n attrBinding(elementRef, 'ngpTooltip', '');\n\n return { elementRef, content } satisfies NgpTooltipTextContentState;\n});\n","import { Component } from '@angular/core';\nimport { NgpTooltip } from '../tooltip/tooltip';\nimport { ngpTooltipTextContent } from './tooltip-text-content-state';\n\n/**\n * Internal component for wrapping string content in tooltip portals\n * @internal\n */\n@Component({\n template: '{{ state.content() }}',\n hostDirectives: [NgpTooltip],\n})\nexport class NgpTooltipTextContentComponent {\n protected readonly state = ngpTooltipTextContent({});\n}\n","import {\n signal,\n Signal,\n WritableSignal,\n Injector,\n inject,\n ViewContainerRef,\n computed,\n ElementRef,\n} from '@angular/core';\nimport {\n createHoverBridge,\n HoverBridgePoint,\n injectElementRef,\n setupOverflowListener,\n} from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpFlip,\n NgpOffset,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n NgpPosition,\n NgpShift,\n} from 'ng-primitives/portal';\nimport {\n attrBinding,\n controlled,\n createPrimitive,\n dataBinding,\n deprecatedSetter,\n listener,\n StateInjectionOptions,\n} from 'ng-primitives/state';\nimport { isString } from 'ng-primitives/utils';\nimport { NgpTooltipTextContentComponent } from '../tooltip-text-content/tooltip-text-content';\n\nexport interface NgpTooltipTriggerState<T> {\n /** Access the tooltip template ref. */\n readonly tooltip: WritableSignal<NgpOverlayContent<T> | string | null>;\n /**\n * Whether the tooltip is disabled. This allows the tooltip to be enabled or disabled dynamically.\n * @default false\n */\n readonly disabled: Signal<boolean>;\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement: Signal<NgpTooltipPlacement>;\n /**\n * Define the offset of the tooltip 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 tooltip is displayed.\n * @default 500\n */\n readonly showDelay: Signal<number>;\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay: Signal<number>;\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\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 tooltip 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 tooltip should be attached.\n * @default document.body\n */\n readonly container: WritableSignal<HTMLElement | string | null>;\n /**\n * Define whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n readonly showOnOverflow: Signal<boolean>;\n /**\n * Define an anchor element for positioning the tooltip.\n * If provided, the tooltip will be positioned relative to this element instead of the trigger.\n */\n readonly anchor: Signal<HTMLElement | null>;\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context: Signal<T | undefined>;\n /**\n * Define whether to use the text content of the trigger element as the tooltip content.\n * When enabled, the tooltip will display the text content of the trigger element.\n * @default true\n */\n readonly useTextContent: Signal<boolean>;\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 * Programmatic position for the tooltip. When provided, the tooltip\n * will be positioned at these coordinates instead of the trigger element.\n * Use with trackPosition=\"true\" for smooth cursor following.\n */\n readonly position: Signal<NgpPosition | null>;\n /**\n * Defines how the tooltip behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior: Signal<'reposition' | 'close'>;\n /**\n * Define the cooldown duration in milliseconds.\n * When moving from one tooltip to another within this duration,\n * the showDelay is skipped for the new tooltip.\n * @default 300\n */\n readonly cooldown: Signal<number>;\n /**\n * Whether hovering tooltip content keeps the tooltip open.\n * @default false\n */\n readonly hoverableContent: Signal<boolean>;\n /**\n * The overlay that manages the tooltip\n * @internal\n */\n readonly overlay: WritableSignal<NgpOverlay<T | string> | null>;\n /**\n * The unique id of the tooltip.\n */\n readonly tooltipId: Signal<string | undefined>;\n /**\n * The open state of the tooltip.\n * @internal\n */\n readonly open: Signal<boolean>;\n /**\n * Determine if the trigger element has overflow.\n */\n readonly hasOverflow: Signal<boolean>;\n /**\n * Tracks whether pointer is currently over tooltip content.\n */\n readonly contentHovered: Signal<boolean>;\n /**\n * Current pointer grace polygon used while crossing trigger -> tooltip.\n */\n readonly hoverBridgePolygon: Signal<HoverBridgePoint[] | null>;\n /**\n * Show the tooltip programmatically (skips cooldown so multiple tooltips can coexist).\n */\n show: () => void;\n /**\n * Hide the tooltip.\n */\n hide: () => void;\n /**\n * Set the tooltip id.\n */\n setTooltipId: (id: string) => void;\n /**\n * Set the container in which the tooltip should be attached. Takes effect the\n * next time the tooltip is shown; it does not move a tooltip that is already\n * visible.\n * @param container - The new container\n */\n setContainer: (container: HTMLElement | string | null) => void;\n /**\n * Called by tooltip content when pointer enters the tooltip.\n * @internal\n */\n onTooltipHoverStart: () => void;\n /**\n * Called by tooltip content when pointer leaves the tooltip.\n * @internal\n */\n onTooltipHoverEnd: () => void;\n destroy: () => void;\n}\n\nexport interface NgpTooltipTriggerProps<T> {\n /** Access the tooltip template ref. */\n readonly tooltip?: Signal<NgpOverlayContent<T> | string | null>;\n /**\n * Whether the tooltip is disabled. This allows the tooltip to be enabled or disabled dynamically.\n * @default false\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement?: Signal<NgpTooltipPlacement>;\n /**\n * Define the offset of the tooltip 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 tooltip is displayed.\n * @default 500\n */\n readonly showDelay?: Signal<number>;\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay?: Signal<number>;\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\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 tooltip 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 tooltip should be attached.\n * @default document.body\n */\n readonly container?: Signal<HTMLElement | string | null>;\n /**\n * Define whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n readonly showOnOverflow?: Signal<boolean>;\n /**\n * Define an anchor element for positioning the tooltip.\n * If provided, the tooltip will be positioned relative to this element instead of the trigger.\n */\n readonly anchor?: Signal<HTMLElement | null>;\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context?: Signal<T | undefined>;\n /**\n * Define whether to use the text content of the trigger element as the tooltip content.\n * When enabled, the tooltip will display the text content of the trigger element.\n * @default true\n */\n readonly useTextContent?: Signal<boolean>;\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 * Programmatic position for the tooltip. When provided, the tooltip\n * will be positioned at these coordinates instead of the trigger element.\n * Use with trackPosition=\"true\" for smooth cursor following.\n */\n readonly position?: Signal<NgpPosition | null>;\n /**\n * Defines how the tooltip behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior?: Signal<'reposition' | 'close'>;\n /**\n * Define the cooldown duration in milliseconds.\n * When moving from one tooltip to another within this duration,\n * the showDelay is skipped for the new tooltip.\n * @default 300\n */\n readonly cooldown?: Signal<number>;\n /**\n * Whether hovering tooltip content keeps the tooltip open.\n * @default false\n */\n readonly hoverableContent?: Signal<boolean>;\n}\n\nexport const [\n NgpTooltipTriggerStateToken,\n ngpTooltipTrigger,\n _injectTooltipTriggerState,\n provideTooltipTriggerState,\n] = createPrimitive(\n 'NgpTooltipTrigger',\n <T>({\n tooltip: _tooltip = signal<NgpOverlayContent<T> | string | null>(null),\n disabled = signal<boolean>(false),\n placement = signal<NgpTooltipPlacement>('top'),\n offset = signal<NgpOffset>(0),\n showDelay = signal<number>(500),\n hideDelay = signal<number>(0),\n flip = signal<NgpFlip>(true),\n shift = signal<NgpShift | undefined>(undefined),\n container: _container,\n showOnOverflow = signal<boolean>(false),\n anchor = signal<HTMLElement | null>(null),\n context = signal<T | undefined>(undefined),\n useTextContent = signal<boolean>(true),\n trackPosition = signal<boolean>(false),\n position = signal<NgpPosition | null>(null),\n scrollBehavior = signal<'reposition' | 'close'>('reposition'),\n cooldown = signal<number>(300),\n hoverableContent = signal<boolean>(false),\n }: NgpTooltipTriggerProps<T>) => {\n const elementRef = injectElementRef();\n const injector = inject(Injector);\n const viewContainerRef = inject(ViewContainerRef);\n const trigger = inject(ElementRef<HTMLElement>);\n const tooltipTriggerState = injectTooltipTriggerState<T>();\n\n const tooltip = controlled(_tooltip);\n const container = controlled(_container, 'body');\n\n const tooltipId = signal<string | undefined>(undefined);\n const triggerHovered = signal<boolean>(false);\n const contentHovered = signal<boolean>(false);\n const overlay = signal<NgpOverlay<T | string> | null>(null);\n const hasOverflow = setupOverflowListener(trigger.nativeElement, {\n disabled: computed(() => !showOnOverflow()),\n });\n\n const open = computed(() => overlay()?.isOpen() ?? false);\n\n // Safe-polygon hover intent for hoverable tooltip content. Tooltips preserve\n // their original behaviour: no direction gate (requireForwardMovement off)\n // and a fixed crossing grace rather than an idle timer that resets on move.\n const hoverBridge = createHoverBridge({\n isPointerInAnchor: () => triggerHovered() || contentHovered(),\n close: () => hide(),\n resetFallbackOnMove: false,\n });\n\n // Host binding\n attrBinding(elementRef, 'aria-describedby', () => overlay()?.ariaDescribedBy());\n dataBinding(elementRef, 'data-open', () => (open() ? '' : null));\n\n // Listeners\n listener(elementRef, 'mouseenter', showFromInteraction);\n listener(elementRef, 'focus', showFromInteraction);\n listener(elementRef, 'mouseleave', hideFromInteraction);\n listener(elementRef, 'blur', () => hideFromInteraction());\n\n function destroy(): void {\n hoverBridge.clear();\n overlay()?.destroy();\n }\n\n function show(): void {\n performShow(true);\n }\n\n function hide(): void {\n hoverBridge.clear();\n overlay()?.hide();\n }\n\n /**\n * Show the tooltip from an interaction (respects disabled state, uses cooldown).\n * @internal\n */\n function showFromInteraction(): void {\n if (tooltipTriggerState().disabled()) {\n return;\n }\n triggerHovered.set(true);\n hoverBridge.clear();\n performShow(false);\n }\n\n /**\n * Shared show logic.\n * @param skipCooldown When true, skip cooldown registration so multiple tooltips can coexist.\n */\n function performShow(skipCooldown: boolean): void {\n // If already open, cancel any pending close\n if (open()) {\n overlay()?.cancelPendingClose();\n return;\n }\n\n // if we should only show when there is overflow, check if the trigger has overflow\n if (tooltipTriggerState().showOnOverflow() && !hasOverflow()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!overlay()) {\n createOverlayInstance();\n }\n\n overlay()?.show({ skipCooldown });\n }\n\n function setTooltipId(id: string): void {\n tooltipId.set(id);\n }\n\n function setContainer(newContainer: HTMLElement | string | null): void {\n container.set(newContainer);\n }\n\n /**\n * Hide the tooltip from an interaction (respects disabled state).\n * @internal\n */\n function hideFromInteraction(event?: MouseEvent): void {\n if (tooltipTriggerState().disabled()) {\n return;\n }\n\n triggerHovered.set(false);\n\n // Blur should close regardless of hover bridge or tooltip hover state.\n if (!event) {\n contentHovered.set(false);\n hoverBridge.clear();\n hide();\n return;\n }\n\n if (!tooltipTriggerState().hoverableContent()) {\n hide();\n return;\n }\n\n const tooltipElement = overlay()?.getElements()[0];\n if (!tooltipElement) {\n hide();\n return;\n }\n\n const started = hoverBridge.track({\n triggerRect: trigger.nativeElement.getBoundingClientRect(),\n targetRect: tooltipElement.getBoundingClientRect(),\n exitPoint: { x: event.clientX, y: event.clientY },\n });\n\n if (!started) {\n hide();\n return;\n }\n\n overlay()?.cancelPendingClose();\n }\n\n /**\n * Called by tooltip content when pointer enters the tooltip.\n * @internal\n */\n function onTooltipHoverStart(): void {\n if (tooltipTriggerState().disabled() || !tooltipTriggerState().hoverableContent()) {\n return;\n }\n\n contentHovered.set(true);\n hoverBridge.clear();\n overlay()?.cancelPendingClose();\n }\n\n /**\n * Called by tooltip content when pointer leaves the tooltip.\n * @internal\n */\n function onTooltipHoverEnd(): void {\n if (tooltipTriggerState().disabled() || !tooltipTriggerState().hoverableContent()) {\n return;\n }\n\n contentHovered.set(false);\n\n if (!triggerHovered()) {\n hide();\n }\n }\n\n /**\n * Create the overlay that will contain the tooltip\n */\n function createOverlayInstance(): void {\n // Determine the content and context based on useTextContent setting\n const shouldUseTextContent = tooltipTriggerState().useTextContent();\n let content = tooltip();\n let context: Signal<T | string | undefined> = tooltipTriggerState().context;\n\n if (!content) {\n if (!shouldUseTextContent) {\n if (ngDevMode) {\n console.error(\n '[ngpTooltipTrigger]: Tooltip must be a string, TemplateRef, or ComponentType. Alternatively, set useTextContent to true if none is provided.',\n );\n }\n\n return;\n }\n\n const textContent = trigger.nativeElement.textContent?.trim() || '';\n if (ngDevMode && !textContent) {\n console.warn(\n '[ngpTooltipTrigger]: useTextContent is enabled but trigger element has no text content',\n );\n return;\n }\n content = NgpTooltipTextContentComponent;\n context = signal(textContent);\n } else if (isString(content)) {\n context = signal(content);\n content = NgpTooltipTextContentComponent;\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T | string> = {\n content,\n triggerElement: trigger.nativeElement,\n anchorElement: anchor(),\n injector: injector,\n context,\n container: container(),\n placement: placement,\n offset: offset(),\n flip: flip(),\n shift: shift(),\n showDelay: showDelay(),\n hideDelay: hideDelay(),\n closeOnEscape: true,\n closeOnOutsideClick: true,\n viewContainerRef: viewContainerRef,\n trackPosition: trackPosition(),\n position: position,\n scrollBehaviour: scrollBehavior(),\n overlayType: 'tooltip',\n cooldown: cooldown(),\n };\n\n // Create the overlay instance\n overlay.set(createOverlay(config));\n }\n\n const state = {\n tooltip,\n disabled,\n placement,\n offset,\n showDelay,\n hideDelay,\n flip,\n shift,\n container: deprecatedSetter(container, 'setContainer', setContainer),\n showOnOverflow,\n anchor,\n context,\n useTextContent,\n trackPosition,\n position,\n scrollBehavior,\n cooldown,\n hoverableContent,\n overlay,\n tooltipId,\n open,\n hasOverflow,\n contentHovered,\n hoverBridgePolygon: hoverBridge.polygon,\n show,\n hide,\n setTooltipId,\n setContainer,\n onTooltipHoverStart,\n onTooltipHoverEnd,\n destroy,\n } satisfies NgpTooltipTriggerState<T>;\n\n return state;\n },\n);\n\nexport function injectTooltipTriggerState<T>(\n options?: StateInjectionOptions,\n): Signal<NgpTooltipTriggerState<T>> {\n return _injectTooltipTriggerState(options) as Signal<NgpTooltipTriggerState<T>>;\n}\n\nexport type NgpTooltipPlacement =\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'top-start'\n | 'top-end'\n | 'right-start'\n | 'right-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end';\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, numberAttribute, OnDestroy } from '@angular/core';\nimport {\n coerceFlip,\n coerceOffset,\n coerceShift,\n NgpFlip,\n NgpFlipInput,\n NgpOffset,\n NgpOffsetInput,\n NgpOverlayContent,\n NgpPosition,\n NgpShift,\n NgpShiftInput,\n} from 'ng-primitives/portal';\nimport { isString } from 'ng-primitives/utils';\nimport { injectTooltipConfig } from '../config/tooltip-config';\nimport {\n NgpTooltipPlacement,\n ngpTooltipTrigger,\n provideTooltipTriggerState,\n} from './tooltip-trigger-state';\n\ntype TooltipInput<T> = NgpOverlayContent<T> | string | null | undefined;\n\n/**\n * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.\n */\n@Directive({\n selector: '[ngpTooltipTrigger]',\n exportAs: 'ngpTooltipTrigger',\n providers: [provideTooltipTriggerState({ inherit: false })],\n})\nexport class NgpTooltipTrigger<T = null> implements OnDestroy {\n /**\n * Access the global tooltip configuration.\n */\n private readonly config = injectTooltipConfig();\n\n /**\n * Access the tooltip template ref.\n */\n readonly tooltip = input<NgpOverlayContent<T> | string | null, TooltipInput<T>>(null, {\n alias: 'ngpTooltipTrigger',\n transform: (value: TooltipInput<T>) => (value && !isString(value) ? value : null),\n });\n\n /**\n * Whether the tooltip is disabled. This allows the tooltip to be enabled or disabled dynamically.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTooltipTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<NgpTooltipPlacement>(this.config.placement, {\n alias: 'ngpTooltipTriggerPlacement',\n });\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * 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: 'ngpTooltipTriggerOffset',\n transform: coerceOffset,\n });\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 500\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpTooltipTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpTooltipTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * 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: 'ngpTooltipTriggerFlip',\n transform: coerceFlip,\n });\n\n /**\n * Configure shift behavior to keep the tooltip 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: 'ngpTooltipTriggerShift',\n transform: coerceShift,\n });\n\n /**\n * Define the container in which the tooltip should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpTooltipTriggerContainer',\n });\n\n /**\n * Define whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n readonly showOnOverflow = input<boolean, BooleanInput>(this.config.showOnOverflow, {\n alias: 'ngpTooltipTriggerShowOnOverflow',\n transform: booleanAttribute,\n });\n\n /**\n * Define an anchor element for positioning the tooltip.\n * If provided, the tooltip will be positioned relative to this element instead of the trigger.\n */\n readonly anchor = input<HTMLElement | null>(null, { alias: 'ngpTooltipTriggerAnchor' });\n\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpTooltipTriggerContext',\n });\n\n /**\n * Define whether to use the text content of the trigger element as the tooltip content.\n * When enabled, the tooltip will display the text content of the trigger element.\n * @default true\n */\n readonly useTextContent = input<boolean, BooleanInput>(this.config.useTextContent, {\n alias: 'ngpTooltipTriggerUseTextContent',\n transform: booleanAttribute,\n });\n\n /**\n * 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: 'ngpTooltipTriggerTrackPosition',\n transform: booleanAttribute,\n });\n\n /**\n * Programmatic position for the tooltip. When provided, the tooltip\n * will be positioned at these coordinates instead of the trigger element.\n * Use with trackPosition=\"true\" for smooth cursor following.\n */\n readonly position = input<NgpPosition | null>(null, {\n alias: 'ngpTooltipTriggerPosition',\n });\n\n /**\n * Defines how the tooltip behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior = input<'reposition' | 'close'>(this.config.scrollBehavior, {\n alias: 'ngpTooltipTriggerScrollBehavior',\n });\n\n /**\n * Define the cooldown duration in milliseconds.\n * When moving from one tooltip to another within this duration,\n * the showDelay is skipped for the new tooltip.\n * @default 300\n */\n readonly cooldown = input<number, NumberInput>(this.config.cooldown, {\n alias: 'ngpTooltipTriggerCooldown',\n transform: numberAttribute,\n });\n\n /**\n * Whether hovering tooltip content keeps the tooltip open.\n * @default false\n */\n readonly hoverableContent = input<boolean, BooleanInput>(this.config.hoverableContent, {\n alias: 'ngpTooltipTriggerHoverableContent',\n transform: booleanAttribute,\n });\n\n protected readonly state = ngpTooltipTrigger({\n tooltip: this.tooltip,\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 showOnOverflow: this.showOnOverflow,\n anchor: this.anchor,\n context: this.context,\n useTextContent: this.useTextContent,\n trackPosition: this.trackPosition,\n position: this.position,\n scrollBehavior: this.scrollBehavior,\n cooldown: this.cooldown,\n hoverableContent: this.hoverableContent,\n });\n\n ngOnDestroy(): void {\n return this.state.destroy();\n }\n\n /**\n * Show the tooltip programmatically (skips cooldown so multiple tooltips can coexist).\n */\n show(): void {\n return this.state.show();\n }\n\n /**\n * Hide the tooltip.\n */\n hide(): void {\n return this.state.hide();\n }\n\n /**\n * Called by tooltip content when pointer enters the tooltip.\n * @internal\n */\n onTooltipHoverStart(): void {\n return this.state.onTooltipHoverStart();\n }\n\n /**\n * Called by tooltip content when pointer leaves the tooltip.\n * @internal\n */\n onTooltipHoverEnd(): void {\n return this.state.onTooltipHoverEnd();\n }\n\n /**\n * Set the tooltip id.\n */\n setTooltipId(id: string): void {\n return this.state.setTooltipId(id);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA0FO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,cAAc,EAAE,IAAI;AACpB,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,cAAc,EAAE,YAAY;AAC5B,IAAA,QAAQ,EAAE,GAAG;AACb,IAAA,gBAAgB,EAAE,KAAK;CACxB;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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, and event listeners
|
|
139
139
|
* that should be cleared when a component is destroyed.
|
|
140
140
|
*
|
|
141
|
+
* Each disposable releases its DestroyRef registration as soon as the resource
|
|
142
|
+
* is gone (the timer fires or the returned cleanup runs), so repeated calls -
|
|
143
|
+
* e.g. rescheduling a timeout on every pointermove - don't accumulate destroy
|
|
144
|
+
* callbacks for the lifetime of the host.
|
|
145
|
+
*
|
|
141
146
|
* This is heavily inspired by Headless UI disposables:
|
|
142
147
|
* https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/utils/disposables.ts
|
|
143
148
|
*/
|
|
@@ -157,20 +162,23 @@ function injectDisposables() {
|
|
|
157
162
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
158
163
|
return () => { };
|
|
159
164
|
}
|
|
160
|
-
const id = setTimeout(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
const id = setTimeout(() => {
|
|
166
|
+
unregister();
|
|
167
|
+
callback();
|
|
168
|
+
}, delay);
|
|
169
|
+
const unregister = destroyRef.onDestroy(() => clearTimeout(id));
|
|
170
|
+
return () => {
|
|
171
|
+
clearTimeout(id);
|
|
172
|
+
unregister();
|
|
173
|
+
};
|
|
164
174
|
},
|
|
165
175
|
/**
|
|
166
|
-
*
|
|
167
|
-
* @param
|
|
168
|
-
* @param
|
|
169
|
-
* @param
|
|
170
|
-
* @param
|
|
171
|
-
* @
|
|
172
|
-
* @param options
|
|
173
|
-
* @returns A function to clear the interval
|
|
176
|
+
* Add an event listener that will be removed when the component is destroyed.
|
|
177
|
+
* @param target The event target
|
|
178
|
+
* @param type The event type
|
|
179
|
+
* @param listener The event listener
|
|
180
|
+
* @param options The event listener options
|
|
181
|
+
* @returns A function to remove the event listener
|
|
174
182
|
*/
|
|
175
183
|
addEventListener: (target, type,
|
|
176
184
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -180,14 +188,16 @@ function injectDisposables() {
|
|
|
180
188
|
return () => { };
|
|
181
189
|
}
|
|
182
190
|
target.addEventListener(type, listener, options);
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
191
|
+
const unregister = destroyRef.onDestroy(() => target.removeEventListener(type, listener, options));
|
|
192
|
+
return () => {
|
|
193
|
+
target.removeEventListener(type, listener, options);
|
|
194
|
+
unregister();
|
|
195
|
+
};
|
|
186
196
|
},
|
|
187
197
|
/**
|
|
188
198
|
* Set an interval that will be cleared when the component is destroyed.
|
|
189
199
|
* @param callback The callback to execute
|
|
190
|
-
* @param delay The delay
|
|
200
|
+
* @param delay The delay between executions
|
|
191
201
|
* @returns A function to clear the interval
|
|
192
202
|
*/
|
|
193
203
|
setInterval: (callback, delay) => {
|
|
@@ -196,9 +206,11 @@ function injectDisposables() {
|
|
|
196
206
|
return () => { };
|
|
197
207
|
}
|
|
198
208
|
const id = setInterval(callback, delay);
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
|
|
209
|
+
const unregister = destroyRef.onDestroy(() => clearInterval(id));
|
|
210
|
+
return () => {
|
|
211
|
+
clearInterval(id);
|
|
212
|
+
unregister();
|
|
213
|
+
};
|
|
202
214
|
},
|
|
203
215
|
/**
|
|
204
216
|
* Set a requestAnimationFrame that will be cleared when the component is destroyed.
|
|
@@ -210,10 +222,15 @@ function injectDisposables() {
|
|
|
210
222
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
211
223
|
return () => { };
|
|
212
224
|
}
|
|
213
|
-
const id = requestAnimationFrame(
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
225
|
+
const id = requestAnimationFrame(time => {
|
|
226
|
+
unregister();
|
|
227
|
+
callback(time);
|
|
228
|
+
});
|
|
229
|
+
const unregister = destroyRef.onDestroy(() => cancelAnimationFrame(id));
|
|
230
|
+
return () => {
|
|
231
|
+
cancelAnimationFrame(id);
|
|
232
|
+
unregister();
|
|
233
|
+
};
|
|
217
234
|
},
|
|
218
235
|
};
|
|
219
236
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-utils.mjs","sources":["../../../../packages/ng-primitives/utils/src/forms/providers.ts","../../../../packages/ng-primitives/utils/src/observables/take-until-destroyed.ts","../../../../packages/ng-primitives/utils/src/forms/status.ts","../../../../packages/ng-primitives/utils/src/helpers/attributes.ts","../../../../packages/ng-primitives/utils/src/helpers/disposables.ts","../../../../packages/ng-primitives/utils/src/helpers/unique-id.ts","../../../../packages/ng-primitives/utils/src/helpers/validators.ts","../../../../packages/ng-primitives/utils/src/signals/index.ts","../../../../packages/ng-primitives/utils/src/ng-primitives-utils.ts"],"sourcesContent":["import { ExistingProvider, Type } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n/**\n * A simple helper function to provide a value accessor for a given type.\n * @param type The type to provide the value accessor for\n */\nexport function provideValueAccessor<T>(type: Type<T>): ExistingProvider {\n return { provide: NG_VALUE_ACCESSOR, useExisting: type, multi: true };\n}\n","/* eslint-disable @nx/workspace-take-until-destroyed */\nimport { DestroyRef } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { EMPTY, MonoTypeOperatorFunction, NEVER, pipe } from 'rxjs';\nimport { catchError, defaultIfEmpty, takeUntil } from 'rxjs/operators';\n\n/**\n * The built-in `takeUntilDestroyed` operator does not handle the case when the component is destroyed before the source observable emits.\n * This operator ensures that the source observable completes gracefully without throwing an error.\n * https://github.com/angular/angular/issues/54527#issuecomment-2098254508\n *\n * @internal\n */\nexport function safeTakeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n return pipe(\n takeUntil(\n NEVER.pipe(\n takeUntilDestroyed(destroyRef),\n catchError(() => EMPTY),\n defaultIfEmpty(null),\n ),\n ),\n );\n}\n","import {\n DestroyRef,\n Injector,\n Signal,\n WritableSignal,\n effect,\n inject,\n signal,\n untracked,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { onMount } from 'ng-primitives/state';\nimport { safeTakeUntilDestroyed } from '../observables/take-until-destroyed';\n\nexport interface NgpControlStatus {\n valid: boolean | null;\n invalid: boolean | null;\n pristine: boolean | null;\n dirty: boolean | null;\n touched: boolean | null;\n pending: boolean | null;\n disabled: boolean | null;\n}\n\n/**\n * Detects an Angular signal-forms interop control without importing any of the new\n * signal-form types. Interop controls expose a `field()` method which returns the\n * underlying FieldState.\n */\nfunction isInteropControl(control: NgControl | null | undefined): boolean {\n return !!control && typeof (control as any).field === 'function';\n}\n\n/**\n * Reads status from a control and updates the status signal.\n * Wrapped in try-catch to handle signal-forms interop controls where\n * the `field` input may not be available yet (throws NG0950).\n */\nfunction updateStatus(control: NgControl, status: WritableSignal<NgpControlStatus>): void {\n try {\n // For interop controls, read directly from the control (which has signal getters).\n // For classic controls, read from the underlying AbstractControl.\n const source = isInteropControl(control) ? control : ((control as any).control ?? control);\n\n const newStatus: NgpControlStatus = {\n valid: source.valid ?? null,\n invalid: source.invalid ?? null,\n pristine: source.pristine ?? null,\n dirty: source.dirty ?? null,\n touched: source.touched ?? null,\n pending: source.pending ?? null,\n disabled: source.disabled ?? null,\n };\n\n untracked(() => status.set(newStatus));\n } catch {\n // NG0950: Required input not available yet. The effect will re-run\n // when the signal input becomes available.\n }\n}\n\n/**\n * A utility function to get the status of an Angular form control as a reactive signal.\n * This function injects the NgControl and returns a signal that reflects the control's status.\n * It supports both classic reactive forms controls and signal-forms interop controls.\n * @internal\n */\n/**\n * Sets up event subscription for a given NgControl.\n * Only sets up the subscription - does not call updateStatus.\n */\nfunction setupEventSubscription(\n ngControl: NgControl,\n status: WritableSignal<NgpControlStatus>,\n destroyRef: DestroyRef,\n): void {\n // For classic controls, also subscribe to the events observable.\n const underlyingControl = (ngControl as any).control;\n if (underlyingControl?.events) {\n underlyingControl.events\n .pipe(safeTakeUntilDestroyed(destroyRef))\n .subscribe(() => updateStatus(ngControl, status));\n }\n}\n\nexport function controlStatus(): Signal<NgpControlStatus> {\n const injector = inject(Injector);\n const destroyRef = inject(DestroyRef);\n\n const status = signal<NgpControlStatus>({\n valid: null,\n invalid: null,\n pristine: null,\n dirty: null,\n touched: null,\n pending: null,\n disabled: null,\n });\n\n const control = signal<NgControl | null>(null);\n\n onMount(() => {\n // Try to inject NgControl immediately for initial state\n control.set(inject(NgControl, { optional: true }));\n\n // If we have a control immediately, update initial status\n if (control()) {\n updateStatus(control()!, status);\n }\n\n // Get the control (either from initial injection or from mount)\n const mountControl = control() || inject(NgControl, { optional: true });\n\n if (!mountControl) {\n return;\n }\n\n // Update control signal if it wasn't set before\n if (!control()) {\n control.set(mountControl);\n }\n\n // Update status to ensure latest values\n updateStatus(mountControl, status);\n\n // Set up event subscription for reactive updates\n setupEventSubscription(mountControl, status, destroyRef);\n });\n\n // Use an effect to reactively track status changes.\n // For signal-forms interop controls, the status properties are signals.\n // For classic controls, this will read the current values and establish\n // no signal dependencies, but we also subscribe to events below.\n effect(\n () => {\n const c = control();\n if (c) {\n updateStatus(c, status);\n }\n },\n { injector },\n );\n\n return status;\n}\n","import { afterRenderEffect, Signal } from '@angular/core';\n\nexport function booleanAttributeBinding(\n element: HTMLElement,\n attribute: string,\n value: Signal<boolean> | undefined,\n): void {\n // eslint-disable-next-line @angular-eslint/no-uncalled-signals -- checking whether the optional signal was provided, not its value\n if (value === undefined) {\n return;\n }\n\n afterRenderEffect({\n write: () =>\n value() ? element.setAttribute(attribute, '') : element.removeAttribute(attribute),\n });\n}\n","import { DestroyRef, inject } from '@angular/core';\n\n/**\n * Disposable functions are a way to manage timers, intervals, and event listeners\n * that should be cleared when a component is destroyed.\n *\n * This is heavily inspired by Headless UI disposables:\n * https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/utils/disposables.ts\n */\nexport function injectDisposables() {\n const destroyRef = inject(DestroyRef);\n let isDestroyed = false;\n\n destroyRef.onDestroy(() => (isDestroyed = true));\n\n return {\n /**\n * Set a timeout that will be cleared when the component is destroyed.\n * @param callback The callback to execute\n * @param delay The delay before the callback is executed\n * @returns A function to clear the timeout\n */\n setTimeout: (callback: () => void, delay: number) => {\n if (isDestroyed) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n return () => {};\n }\n\n const id = setTimeout(callback, delay);\n const cleanup = () => clearTimeout(id);\n destroyRef.onDestroy(cleanup);\n return cleanup;\n },\n /**\n * Set an interval that will be cleared when the component is destroyed.\n * @param callback The callback to execute\n * @param delay The delay before the callback is executed\n * @param target\n * @param type\n * @param listener\n * @param options\n * @returns A function to clear the interval\n */\n addEventListener: <K extends keyof HTMLElementEventMap>(\n target: EventTarget,\n type: K,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions,\n ) => {\n if (isDestroyed) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n return () => {};\n }\n\n target.addEventListener(type, listener as EventListenerOrEventListenerObject, options);\n const cleanup = () =>\n target.removeEventListener(type, listener as EventListenerOrEventListenerObject, options);\n destroyRef.onDestroy(cleanup);\n return cleanup;\n },\n /**\n * Set an interval that will be cleared when the component is destroyed.\n * @param callback The callback to execute\n * @param delay The delay before the callback is executed\n * @returns A function to clear the interval\n */\n setInterval: (callback: () => void, delay: number) => {\n if (isDestroyed) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n return () => {};\n }\n\n const id = setInterval(callback, delay);\n const cleanup = () => clearInterval(id);\n destroyRef.onDestroy(cleanup);\n return cleanup;\n },\n /**\n * Set a requestAnimationFrame that will be cleared when the component is destroyed.\n * @param callback The callback to execute\n * @returns A function to clear the requestAnimationFrame\n */\n requestAnimationFrame: (callback: FrameRequestCallback) => {\n if (isDestroyed) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n return () => {};\n }\n\n const id = requestAnimationFrame(callback);\n const cleanup = () => cancelAnimationFrame(id);\n destroyRef.onDestroy(cleanup);\n return cleanup;\n },\n };\n}\n","/**\n * Store a map of unique ids for elements so that there are no collisions.\n */\nconst uniqueIdMap = new Map<string, number>();\n\n/**\n * Generate a unique id for an element\n * @param prefix - The prefix to use for the id\n * @returns The generated id\n */\nexport function uniqueId(prefix: string): string {\n const id = uniqueIdMap.get(prefix) ?? 0;\n uniqueIdMap.set(prefix, id + 1);\n return `${prefix}-${id}`;\n}\n","/**\n * Type validation utilities\n */\n\n/**\n * Checks if a value is a string\n * @param value - The value to check\n * @returns true if the value is a string, false otherwise\n */\nexport function isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\n/**\n * Checks if a value is a number\n * @param value - The value to check\n * @returns true if the value is a number, false otherwise\n */\nexport function isNumber(value: unknown): value is number {\n return typeof value === 'number';\n}\n\n/**\n * Checks if a value is a boolean\n * @param value - The value to check\n * @returns true if the value is a boolean, false otherwise\n */\nexport function isBoolean(value: unknown): value is boolean {\n return typeof value === 'boolean';\n}\n\n/**\n * Checks if a value is a function\n * @param value - The value to check\n * @returns true if the value is a function, false otherwise\n */\nexport function isFunction(value: unknown): value is CallableFunction {\n return typeof value === 'function';\n}\n\n/**\n * Checks if a value is a plain object (but not null or array)\n * @param value - The value to check\n * @returns true if the value is a plain object, false otherwise\n */\nexport function isObject(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value);\n}\n\n/**\n * Checks if a value is undefined\n * @param value - The value to check\n * @returns true if the value is undefined, false otherwise\n */\nexport function isUndefined(value: unknown): value is undefined {\n return typeof value === 'undefined';\n}\n\n/**\n * Checks if a value is null or undefined\n * @param value - The value to check\n * @returns true if the value is null or undefined, false otherwise\n */\nexport function isNil(value: unknown): value is null | undefined {\n return isUndefined(value) || value === null;\n}\n\n/**\n * Checks if a value is not null and not undefined\n * @param value - The value to check\n * @returns true if the value is not null and not undefined, false otherwise\n */\nexport function notNil<T>(value: T | null | undefined): value is T {\n return !isNil(value);\n}\n","import { effect, Injector, Signal, signal, untracked } from '@angular/core';\n\n/**\n * Listen for changes to a signal and call a function when the signal changes.\n * @param source\n * @param fn\n * @param options\n * @param options.injector\n * @internal\n */\nexport function onChange<T>(\n source: Signal<T>,\n fn: (value: T, previousValue: T | null | undefined) => void,\n options?: { injector: Injector },\n): void {\n const previousValue = signal(source());\n\n effect(\n () => {\n const value = source();\n if (value !== previousValue()) {\n untracked(() => fn(value, previousValue()));\n previousValue.set(value);\n }\n },\n { injector: options?.injector },\n );\n\n // call the fn with the initial value\n fn(source(), null);\n}\n\n/**\n * Listen for changes to a boolean signal and call one of two functions when the signal changes.\n * @param source\n * @param onTrue\n * @param onFalse\n * @param options\n */\nexport function onBooleanChange(\n source: Signal<boolean>,\n onTrue?: () => void,\n onFalse?: () => void,\n options?: { injector: Injector },\n): void {\n onChange(source, value => (value ? onTrue?.() : onFalse?.()), options);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAGA;;;AAGG;AACG,SAAU,oBAAoB,CAAI,IAAa,EAAA;AACnD,IAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;AACvE;;ACHA;;;;;;AAMG;AACG,SAAU,sBAAsB,CAAI,UAAuB,EAAA;AAC/D,IAAA,OAAO,IAAI,CACT,SAAS,CACP,KAAK,CAAC,IAAI,CACR,kBAAkB,CAAC,UAAU,CAAC,EAC9B,UAAU,CAAC,MAAM,KAAK,CAAC,EACvB,cAAc,CAAC,IAAI,CAAC,CACrB,CACF,CACF;AACH;;ACCA;;;;AAIG;AACH,SAAS,gBAAgB,CAAC,OAAqC,EAAA;IAC7D,OAAO,CAAC,CAAC,OAAO,IAAI,OAAQ,OAAe,CAAC,KAAK,KAAK,UAAU;AAClE;AAEA;;;;AAIG;AACH,SAAS,YAAY,CAAC,OAAkB,EAAE,MAAwC,EAAA;AAChF,IAAA,IAAI;;;QAGF,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,OAAO,IAAK,OAAe,CAAC,OAAO,IAAI,OAAO,CAAC;AAE1F,QAA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A;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-utils.mjs","sources":["../../../../packages/ng-primitives/utils/src/forms/providers.ts","../../../../packages/ng-primitives/utils/src/observables/take-until-destroyed.ts","../../../../packages/ng-primitives/utils/src/forms/status.ts","../../../../packages/ng-primitives/utils/src/helpers/attributes.ts","../../../../packages/ng-primitives/utils/src/helpers/disposables.ts","../../../../packages/ng-primitives/utils/src/helpers/unique-id.ts","../../../../packages/ng-primitives/utils/src/helpers/validators.ts","../../../../packages/ng-primitives/utils/src/signals/index.ts","../../../../packages/ng-primitives/utils/src/ng-primitives-utils.ts"],"sourcesContent":["import { ExistingProvider, Type } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n/**\n * A simple helper function to provide a value accessor for a given type.\n * @param type The type to provide the value accessor for\n */\nexport function provideValueAccessor<T>(type: Type<T>): ExistingProvider {\n return { provide: NG_VALUE_ACCESSOR, useExisting: type, multi: true };\n}\n","/* eslint-disable @nx/workspace-take-until-destroyed */\nimport { DestroyRef } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { EMPTY, MonoTypeOperatorFunction, NEVER, pipe } from 'rxjs';\nimport { catchError, defaultIfEmpty, takeUntil } from 'rxjs/operators';\n\n/**\n * The built-in `takeUntilDestroyed` operator does not handle the case when the component is destroyed before the source observable emits.\n * This operator ensures that the source observable completes gracefully without throwing an error.\n * https://github.com/angular/angular/issues/54527#issuecomment-2098254508\n *\n * @internal\n */\nexport function safeTakeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n return pipe(\n takeUntil(\n NEVER.pipe(\n takeUntilDestroyed(destroyRef),\n catchError(() => EMPTY),\n defaultIfEmpty(null),\n ),\n ),\n );\n}\n","import {\n DestroyRef,\n Injector,\n Signal,\n WritableSignal,\n effect,\n inject,\n signal,\n untracked,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { onMount } from 'ng-primitives/state';\nimport { safeTakeUntilDestroyed } from '../observables/take-until-destroyed';\n\nexport interface NgpControlStatus {\n valid: boolean | null;\n invalid: boolean | null;\n pristine: boolean | null;\n dirty: boolean | null;\n touched: boolean | null;\n pending: boolean | null;\n disabled: boolean | null;\n}\n\n/**\n * Detects an Angular signal-forms interop control without importing any of the new\n * signal-form types. Interop controls expose a `field()` method which returns the\n * underlying FieldState.\n */\nfunction isInteropControl(control: NgControl | null | undefined): boolean {\n return !!control && typeof (control as any).field === 'function';\n}\n\n/**\n * Reads status from a control and updates the status signal.\n * Wrapped in try-catch to handle signal-forms interop controls where\n * the `field` input may not be available yet (throws NG0950).\n */\nfunction updateStatus(control: NgControl, status: WritableSignal<NgpControlStatus>): void {\n try {\n // For interop controls, read directly from the control (which has signal getters).\n // For classic controls, read from the underlying AbstractControl.\n const source = isInteropControl(control) ? control : ((control as any).control ?? control);\n\n const newStatus: NgpControlStatus = {\n valid: source.valid ?? null,\n invalid: source.invalid ?? null,\n pristine: source.pristine ?? null,\n dirty: source.dirty ?? null,\n touched: source.touched ?? null,\n pending: source.pending ?? null,\n disabled: source.disabled ?? null,\n };\n\n untracked(() => status.set(newStatus));\n } catch {\n // NG0950: Required input not available yet. The effect will re-run\n // when the signal input becomes available.\n }\n}\n\n/**\n * A utility function to get the status of an Angular form control as a reactive signal.\n * This function injects the NgControl and returns a signal that reflects the control's status.\n * It supports both classic reactive forms controls and signal-forms interop controls.\n * @internal\n */\n/**\n * Sets up event subscription for a given NgControl.\n * Only sets up the subscription - does not call updateStatus.\n */\nfunction setupEventSubscription(\n ngControl: NgControl,\n status: WritableSignal<NgpControlStatus>,\n destroyRef: DestroyRef,\n): void {\n // For classic controls, also subscribe to the events observable.\n const underlyingControl = (ngControl as any).control;\n if (underlyingControl?.events) {\n underlyingControl.events\n .pipe(safeTakeUntilDestroyed(destroyRef))\n .subscribe(() => updateStatus(ngControl, status));\n }\n}\n\nexport function controlStatus(): Signal<NgpControlStatus> {\n const injector = inject(Injector);\n const destroyRef = inject(DestroyRef);\n\n const status = signal<NgpControlStatus>({\n valid: null,\n invalid: null,\n pristine: null,\n dirty: null,\n touched: null,\n pending: null,\n disabled: null,\n });\n\n const control = signal<NgControl | null>(null);\n\n onMount(() => {\n // Try to inject NgControl immediately for initial state\n control.set(inject(NgControl, { optional: true }));\n\n // If we have a control immediately, update initial status\n if (control()) {\n updateStatus(control()!, status);\n }\n\n // Get the control (either from initial injection or from mount)\n const mountControl = control() || inject(NgControl, { optional: true });\n\n if (!mountControl) {\n return;\n }\n\n // Update control signal if it wasn't set before\n if (!control()) {\n control.set(mountControl);\n }\n\n // Update status to ensure latest values\n updateStatus(mountControl, status);\n\n // Set up event subscription for reactive updates\n setupEventSubscription(mountControl, status, destroyRef);\n });\n\n // Use an effect to reactively track status changes.\n // For signal-forms interop controls, the status properties are signals.\n // For classic controls, this will read the current values and establish\n // no signal dependencies, but we also subscribe to events below.\n effect(\n () => {\n const c = control();\n if (c) {\n updateStatus(c, status);\n }\n },\n { injector },\n );\n\n return status;\n}\n","import { afterRenderEffect, Signal } from '@angular/core';\n\nexport function booleanAttributeBinding(\n element: HTMLElement,\n attribute: string,\n value: Signal<boolean> | undefined,\n): void {\n // eslint-disable-next-line @angular-eslint/no-uncalled-signals -- checking whether the optional signal was provided, not its value\n if (value === undefined) {\n return;\n }\n\n afterRenderEffect({\n write: () =>\n value() ? element.setAttribute(attribute, '') : element.removeAttribute(attribute),\n });\n}\n","import { DestroyRef, inject } from '@angular/core';\n\n/**\n * Disposable functions are a way to manage timers, intervals, and event listeners\n * that should be cleared when a component is destroyed.\n *\n * Each disposable releases its DestroyRef registration as soon as the resource\n * is gone (the timer fires or the returned cleanup runs), so repeated calls -\n * e.g. rescheduling a timeout on every pointermove - don't accumulate destroy\n * callbacks for the lifetime of the host.\n *\n * This is heavily inspired by Headless UI disposables:\n * https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/utils/disposables.ts\n */\nexport function injectDisposables() {\n const destroyRef = inject(DestroyRef);\n let isDestroyed = false;\n\n destroyRef.onDestroy(() => (isDestroyed = true));\n\n return {\n /**\n * Set a timeout that will be cleared when the component is destroyed.\n * @param callback The callback to execute\n * @param delay The delay before the callback is executed\n * @returns A function to clear the timeout\n */\n setTimeout: (callback: () => void, delay: number) => {\n if (isDestroyed) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n return () => {};\n }\n\n const id = setTimeout(() => {\n unregister();\n callback();\n }, delay);\n const unregister = destroyRef.onDestroy(() => clearTimeout(id));\n return () => {\n clearTimeout(id);\n unregister();\n };\n },\n /**\n * Add an event listener that will be removed when the component is destroyed.\n * @param target The event target\n * @param type The event type\n * @param listener The event listener\n * @param options The event listener options\n * @returns A function to remove the event listener\n */\n addEventListener: <K extends keyof HTMLElementEventMap>(\n target: EventTarget,\n type: K,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions,\n ) => {\n if (isDestroyed) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n return () => {};\n }\n\n target.addEventListener(type, listener as EventListenerOrEventListenerObject, options);\n const unregister = destroyRef.onDestroy(() =>\n target.removeEventListener(type, listener as EventListenerOrEventListenerObject, options),\n );\n return () => {\n target.removeEventListener(type, listener as EventListenerOrEventListenerObject, options);\n unregister();\n };\n },\n /**\n * Set an interval that will be cleared when the component is destroyed.\n * @param callback The callback to execute\n * @param delay The delay between executions\n * @returns A function to clear the interval\n */\n setInterval: (callback: () => void, delay: number) => {\n if (isDestroyed) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n return () => {};\n }\n\n const id = setInterval(callback, delay);\n const unregister = destroyRef.onDestroy(() => clearInterval(id));\n return () => {\n clearInterval(id);\n unregister();\n };\n },\n /**\n * Set a requestAnimationFrame that will be cleared when the component is destroyed.\n * @param callback The callback to execute\n * @returns A function to clear the requestAnimationFrame\n */\n requestAnimationFrame: (callback: FrameRequestCallback) => {\n if (isDestroyed) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n return () => {};\n }\n\n const id = requestAnimationFrame(time => {\n unregister();\n callback(time);\n });\n const unregister = destroyRef.onDestroy(() => cancelAnimationFrame(id));\n return () => {\n cancelAnimationFrame(id);\n unregister();\n };\n },\n };\n}\n","/**\n * Store a map of unique ids for elements so that there are no collisions.\n */\nconst uniqueIdMap = new Map<string, number>();\n\n/**\n * Generate a unique id for an element\n * @param prefix - The prefix to use for the id\n * @returns The generated id\n */\nexport function uniqueId(prefix: string): string {\n const id = uniqueIdMap.get(prefix) ?? 0;\n uniqueIdMap.set(prefix, id + 1);\n return `${prefix}-${id}`;\n}\n","/**\n * Type validation utilities\n */\n\n/**\n * Checks if a value is a string\n * @param value - The value to check\n * @returns true if the value is a string, false otherwise\n */\nexport function isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\n/**\n * Checks if a value is a number\n * @param value - The value to check\n * @returns true if the value is a number, false otherwise\n */\nexport function isNumber(value: unknown): value is number {\n return typeof value === 'number';\n}\n\n/**\n * Checks if a value is a boolean\n * @param value - The value to check\n * @returns true if the value is a boolean, false otherwise\n */\nexport function isBoolean(value: unknown): value is boolean {\n return typeof value === 'boolean';\n}\n\n/**\n * Checks if a value is a function\n * @param value - The value to check\n * @returns true if the value is a function, false otherwise\n */\nexport function isFunction(value: unknown): value is CallableFunction {\n return typeof value === 'function';\n}\n\n/**\n * Checks if a value is a plain object (but not null or array)\n * @param value - The value to check\n * @returns true if the value is a plain object, false otherwise\n */\nexport function isObject(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value);\n}\n\n/**\n * Checks if a value is undefined\n * @param value - The value to check\n * @returns true if the value is undefined, false otherwise\n */\nexport function isUndefined(value: unknown): value is undefined {\n return typeof value === 'undefined';\n}\n\n/**\n * Checks if a value is null or undefined\n * @param value - The value to check\n * @returns true if the value is null or undefined, false otherwise\n */\nexport function isNil(value: unknown): value is null | undefined {\n return isUndefined(value) || value === null;\n}\n\n/**\n * Checks if a value is not null and not undefined\n * @param value - The value to check\n * @returns true if the value is not null and not undefined, false otherwise\n */\nexport function notNil<T>(value: T | null | undefined): value is T {\n return !isNil(value);\n}\n","import { effect, Injector, Signal, signal, untracked } from '@angular/core';\n\n/**\n * Listen for changes to a signal and call a function when the signal changes.\n * @param source\n * @param fn\n * @param options\n * @param options.injector\n * @internal\n */\nexport function onChange<T>(\n source: Signal<T>,\n fn: (value: T, previousValue: T | null | undefined) => void,\n options?: { injector: Injector },\n): void {\n const previousValue = signal(source());\n\n effect(\n () => {\n const value = source();\n if (value !== previousValue()) {\n untracked(() => fn(value, previousValue()));\n previousValue.set(value);\n }\n },\n { injector: options?.injector },\n );\n\n // call the fn with the initial value\n fn(source(), null);\n}\n\n/**\n * Listen for changes to a boolean signal and call one of two functions when the signal changes.\n * @param source\n * @param onTrue\n * @param onFalse\n * @param options\n */\nexport function onBooleanChange(\n source: Signal<boolean>,\n onTrue?: () => void,\n onFalse?: () => void,\n options?: { injector: Injector },\n): void {\n onChange(source, value => (value ? onTrue?.() : onFalse?.()), options);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAGA;;;AAGG;AACG,SAAU,oBAAoB,CAAI,IAAa,EAAA;AACnD,IAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;AACvE;;ACHA;;;;;;AAMG;AACG,SAAU,sBAAsB,CAAI,UAAuB,EAAA;AAC/D,IAAA,OAAO,IAAI,CACT,SAAS,CACP,KAAK,CAAC,IAAI,CACR,kBAAkB,CAAC,UAAU,CAAC,EAC9B,UAAU,CAAC,MAAM,KAAK,CAAC,EACvB,cAAc,CAAC,IAAI,CAAC,CACrB,CACF,CACF;AACH;;ACCA;;;;AAIG;AACH,SAAS,gBAAgB,CAAC,OAAqC,EAAA;IAC7D,OAAO,CAAC,CAAC,OAAO,I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A;AAEhC,IAAA,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,oFAAC;IAEtC,MAAM,CACJ,MAAK;AACH,QAAA,MAAM,KAAK,GAAG,MAAM,EAAE;AACtB,QAAA,IAAI,KAAK,KAAK,aAAa,EAAE,EAAE;AAC7B,YAAA,SAAS,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;AAC3C,YAAA,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC;QAC1B;IACF,CAAC,EACD,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAChC;;AAGD,IAAA,EAAE,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC;AACpB;AAEA;;;;;;AAMG;AACG,SAAU,eAAe,CAC7B,MAAuB,EACvB,MAAmB,EACnB,OAAoB,EACpB,OAAgC,EAAA;IAEhC,QAAQ,CAAC,MAAM,EAAE,KAAK,KAAK,KAAK,GAAG,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,EAAE,OAAO,CAAC;AACxE;;AC9CA;;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.123.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"angular",
|
|
8
8
|
"primitives",
|
|
@@ -57,8 +57,8 @@ export class ToggleGroup<%= componentSuffix %> implements ControlValueAccessor {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/** Write a new value to the toggle group. */
|
|
60
|
-
writeValue(value: string[]): void {
|
|
61
|
-
this.toggleGroup().setValue(value, { emit: false });
|
|
60
|
+
writeValue(value: string[] | null): void {
|
|
61
|
+
this.toggleGroup().setValue(value ?? [], { emit: false });
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/** Register a callback function to be called when the value changes. */
|
|
@@ -290,7 +290,17 @@ declare class NgpCombobox {
|
|
|
290
290
|
reset: ({ scroll, origin }?: ng_primitives_a11y.ActivationOptions) => void;
|
|
291
291
|
validate: () => void;
|
|
292
292
|
};
|
|
293
|
-
/**
|
|
293
|
+
/**
|
|
294
|
+
* The form control status of the combobox host element itself. When the combobox is used as a
|
|
295
|
+
* form control (e.g. via a `ControlValueAccessor` wrapper) the `NgControl` lives on an ancestor
|
|
296
|
+
* element, so this resolves it even when there is no `ngpComboboxInput`.
|
|
297
|
+
*/
|
|
298
|
+
private readonly hostControlStatus;
|
|
299
|
+
/**
|
|
300
|
+
* The control status. When an input is present it can resolve the associated `NgControl` (whether
|
|
301
|
+
* the control is on the input itself or an ancestor), so we use its status. Otherwise we fall back
|
|
302
|
+
* to the combobox host's own control status so an input-less combobox still reflects validity.
|
|
303
|
+
*/
|
|
294
304
|
protected readonly controlStatus: _angular_core.Signal<ng_primitives_utils.NgpControlStatus | undefined>;
|
|
295
305
|
/** The state of the combobox. */
|
|
296
306
|
protected readonly state: ng_primitives_state.CreatedState<NgpCombobox>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { Provider, Signal } from '@angular/core';
|
|
2
|
+
import { Provider, Signal, WritableSignal } from '@angular/core';
|
|
3
3
|
import { NgpOffset, NgpFlip, NgpShift, NgpOverlayContent, NgpOffsetInput, NgpFlipInput, NgpShiftInput } from 'ng-primitives/portal';
|
|
4
4
|
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
5
5
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
@@ -222,6 +222,11 @@ interface NgpContextMenuTriggerState {
|
|
|
222
222
|
* The focus origin that was used to open the menu.
|
|
223
223
|
*/
|
|
224
224
|
readonly openOrigin: Signal<FocusOrigin>;
|
|
225
|
+
/**
|
|
226
|
+
* The container in which the menu should be attached.
|
|
227
|
+
* @default document.body
|
|
228
|
+
*/
|
|
229
|
+
readonly container: WritableSignal<HTMLElement | string | null>;
|
|
225
230
|
/**
|
|
226
231
|
* Show the context menu.
|
|
227
232
|
*/
|
|
@@ -230,6 +235,12 @@ interface NgpContextMenuTriggerState {
|
|
|
230
235
|
* Hide the context menu.
|
|
231
236
|
*/
|
|
232
237
|
hide(origin?: FocusOrigin): void;
|
|
238
|
+
/**
|
|
239
|
+
* Set the container in which the menu should be attached. Takes effect the
|
|
240
|
+
* next time the menu is opened; it does not move a menu that is already open.
|
|
241
|
+
* @param container - The new container
|
|
242
|
+
*/
|
|
243
|
+
setContainer(container: HTMLElement | string | null): void;
|
|
233
244
|
/**
|
|
234
245
|
* Set whether the pointer is over the menu content.
|
|
235
246
|
*/
|
|
@@ -269,11 +280,13 @@ interface NgpContextMenuTriggerProps<T = unknown> {
|
|
|
269
280
|
*/
|
|
270
281
|
readonly context?: Signal<T>;
|
|
271
282
|
}
|
|
272
|
-
declare const ngpContextMenuTrigger: <T>({ disabled: _disabled, menu: _menu, offset: _offset, flip: _flip, context: _context, container, scrollBehavior, shift, }: NgpContextMenuTriggerProps<T>) => {
|
|
283
|
+
declare const ngpContextMenuTrigger: <T>({ disabled: _disabled, menu: _menu, offset: _offset, flip: _flip, context: _context, container: _container, scrollBehavior, shift, }: NgpContextMenuTriggerProps<T>) => {
|
|
273
284
|
open: Signal<boolean>;
|
|
274
|
-
openOrigin:
|
|
285
|
+
openOrigin: WritableSignal<FocusOrigin>;
|
|
286
|
+
container: WritableSignal<string | HTMLElement | null>;
|
|
275
287
|
show: (origin?: FocusOrigin) => void;
|
|
276
288
|
hide: (origin?: FocusOrigin) => void;
|
|
289
|
+
setContainer: (newContainer: HTMLElement | string | null) => void;
|
|
277
290
|
setPointerOverContent: (_isOver: boolean) => void;
|
|
278
291
|
};
|
|
279
292
|
declare const provideContextMenuTriggerState: (opts?: {
|