ng-primitives 0.99.4 → 0.99.6
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-dialog.mjs +2 -1
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs +2 -1
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-interactions.mjs +2 -2
- package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +4 -3
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +2 -1
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/package.json +3 -2
- package/schematics/ng-generate/templates/separator/separator.__fileSuffix@dasherize__.ts.template +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-interactions.mjs","sources":["../../../../packages/ng-primitives/interactions/src/config/interactions-config.ts","../../../../packages/ng-primitives/interactions/src/focus-visible/focus-visible-interaction.ts","../../../../packages/ng-primitives/interactions/src/focus/focus-interaction.ts","../../../../packages/ng-primitives/interactions/src/hover/hover-interaction.ts","../../../../packages/ng-primitives/interactions/src/press/press-interaction.ts","../../../../packages/ng-primitives/interactions/src/interactions/interactions.ts","../../../../packages/ng-primitives/interactions/src/focus-visible/focus-visible.ts","../../../../packages/ng-primitives/interactions/src/focus/focus.ts","../../../../packages/ng-primitives/interactions/src/hover/hover.ts","../../../../packages/ng-primitives/interactions/src/move/move.ts","../../../../packages/ng-primitives/interactions/src/press/press.ts","../../../../packages/ng-primitives/interactions/src/index.ts","../../../../packages/ng-primitives/interactions/src/ng-primitives-interactions.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\n\nexport interface NgpInteractionsConfig {\n /** Whether all interactions are disabled */\n disabled?: boolean;\n /** Whether hover interactions are enabled */\n hover?: boolean;\n /** Whether focus interactions are enabled */\n focus?: boolean;\n /** Whether focus-visible interactions are enabled */\n focusVisible?: boolean;\n /** Whether press interactions are enabled */\n press?: boolean;\n}\n\nexport const defaultInteractionsConfig: NgpInteractionsConfig = {\n disabled: false,\n hover: true,\n focus: true,\n focusVisible: true,\n press: true,\n};\n\nexport const NgpInteractionsConfigToken = new InjectionToken<NgpInteractionsConfig>(\n 'NgpInteractionsConfigToken',\n);\n\n/**\n * Provide the default Interactions configuration\n * @param config The Interactions configuration\n * @returns The provider\n */\nexport function provideInteractionsConfig(config: Partial<NgpInteractionsConfig>): Provider[] {\n return [\n {\n provide: NgpInteractionsConfigToken,\n useValue: { ...defaultInteractionsConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Interactions configuration\n * @returns The global Interactions configuration\n */\nexport function injectInteractionsConfig(): NgpInteractionsConfig {\n return inject(NgpInteractionsConfigToken, { optional: true }) ?? defaultInteractionsConfig;\n}\n\nexport function isHoverEnabled(): boolean {\n const config = injectInteractionsConfig();\n return !config.disabled && !!config.hover;\n}\n\nexport function isFocusEnabled(): boolean {\n const config = injectInteractionsConfig();\n return !config.disabled && !!config.focus;\n}\n\nexport function isFocusVisibleEnabled(): boolean {\n const config = injectInteractionsConfig();\n return !config.disabled && !!config.focusVisible;\n}\n\nexport function isPressEnabled(): boolean {\n const config = injectInteractionsConfig();\n return !config.disabled && !!config.press;\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { ElementRef, inject, Renderer2, Signal, signal } from '@angular/core';\nimport { onBooleanChange, safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { isFocusVisibleEnabled } from '../config/interactions-config';\n\nexport interface NgpFocusVisibleProps {\n disabled?: Signal<boolean>;\n onFocusChange?: (value: boolean) => void;\n}\n\nexport interface NgpFocusVisibleState {\n isFocused: Signal<boolean>;\n}\n\n/**\n * @internal\n */\nexport function ngpFocusVisible({\n onFocusChange,\n disabled = signal(false),\n}: NgpFocusVisibleProps): NgpFocusVisibleState {\n const canFocusVisible = isFocusVisibleEnabled();\n\n if (!canFocusVisible) {\n return { isFocused: signal(false) };\n }\n\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n const renderer = inject(Renderer2);\n const focusMonitor = inject(FocusMonitor);\n\n // Whether the element is currently focused.\n const isFocused = signal<boolean>(false);\n\n // handle focus state\n focusMonitor\n .monitor(elementRef.nativeElement)\n .pipe(safeTakeUntilDestroyed())\n .subscribe(origin =>\n // null indicates the element was blurred\n origin === null ? onBlur() : onFocus(origin),\n );\n\n // if the component becomes disabled and it is focused, hide the focus\n onBooleanChange(disabled, () => focus(false));\n\n function onFocus(origin: FocusOrigin): void {\n if (disabled() || isFocused()) {\n return;\n }\n\n // for some elements the focus visible state should always appear on focus\n if (alwaysShowFocus()) {\n focus(true, origin);\n return;\n }\n\n // if the focus origin is keyboard or program(focused programmatically), then the focus is visible\n if (origin === 'keyboard') {\n focus(true, 'keyboard');\n return;\n }\n }\n\n function onBlur(): void {\n if (disabled() || !isFocused()) {\n return;\n }\n\n focus(false);\n }\n\n /**\n * Trigger the focus signal along with the focusChange event.\n */\n function focus(value: boolean, origin?: FocusOrigin) {\n if (isFocused() === value) {\n return;\n }\n\n isFocused.set(value);\n onFocusChange?.(value);\n\n if (value) {\n renderer.setAttribute(elementRef.nativeElement, 'data-focus-visible', origin ?? '');\n } else {\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus-visible');\n }\n }\n\n function alwaysShowFocus(): boolean {\n const nonTextInputTypes = [\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset',\n ];\n\n // if this is an input element and it is a text input\n if (\n elementRef.nativeElement instanceof HTMLInputElement &&\n !nonTextInputTypes.includes(elementRef.nativeElement.type)\n ) {\n return true;\n }\n\n // if this is a textarea\n if (elementRef.nativeElement instanceof HTMLTextAreaElement) {\n return true;\n }\n\n // if this is an element with contenteditable\n if (\n elementRef.nativeElement.isContentEditable ||\n elementRef.nativeElement.hasAttribute('contenteditable')\n ) {\n return true;\n }\n\n return false;\n }\n\n return {\n isFocused,\n };\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { ElementRef, Renderer2, Signal, inject, signal } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { isFocusEnabled } from '../config/interactions-config';\n\nexport interface NgpFocusProps {\n disabled?: Signal<boolean>;\n focusWithin?: boolean;\n onFocus?: () => void;\n onBlur?: () => void;\n}\n\nexport interface NgpFocusState {\n isFocused: Signal<boolean>;\n}\n\n/**\n * @internal\n */\nexport function ngpFocus({\n onFocus,\n onBlur,\n focusWithin = false,\n disabled = signal(false),\n}: NgpFocusProps): NgpFocusState {\n const canFocus = isFocusEnabled();\n\n if (!canFocus) {\n return { isFocused: signal(false) };\n }\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the focus monitor.\n */\n const focusMonitor = inject(FocusMonitor);\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Whether the element is currently focused.\n */\n const isFocused = signal<boolean>(false);\n\n focusMonitor\n .monitor(elementRef, focusWithin)\n .pipe(safeTakeUntilDestroyed())\n .subscribe(focusOrigin => {\n if (disabled()) {\n return;\n }\n\n isFocused.set(focusOrigin !== null);\n if (focusOrigin !== null) {\n if (onFocus) {\n onFocus();\n }\n renderer.setAttribute(elementRef.nativeElement, 'data-focus', '');\n } else {\n if (onBlur) {\n onBlur();\n }\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus');\n }\n });\n\n return { isFocused };\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n DOCUMENT,\n ElementRef,\n inject,\n Injectable,\n PLATFORM_ID,\n Signal,\n signal,\n} from '@angular/core';\nimport { onDomRemoval } from 'ng-primitives/internal';\nimport { dataBinding, listener } from 'ng-primitives/state';\nimport { onBooleanChange } from 'ng-primitives/utils';\nimport { isHoverEnabled } from '../config/interactions-config';\n\n/**\n * We use a service here as this value is a singleton\n * and allows us to register the dom events once.\n */\n@Injectable({\n providedIn: 'root',\n})\nclass GlobalPointerEvents {\n /**\n * Whether global mouse events should be ignored.\n */\n ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Determine the platform id.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n constructor() {\n // we only want to setup events on the client\n if (isPlatformBrowser(this.platformId)) {\n this.setupGlobalTouchEvents();\n }\n }\n\n private setupGlobalTouchEvents(): void {\n this.document.addEventListener('pointerup', this.handleGlobalPointerEvent.bind(this));\n this.document.addEventListener('touchend', this.setGlobalIgnoreEmulatedMouseEvents.bind(this));\n }\n\n private setGlobalIgnoreEmulatedMouseEvents(): void {\n this.ignoreEmulatedMouseEvents = true;\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => (this.ignoreEmulatedMouseEvents = false), 50);\n }\n\n private handleGlobalPointerEvent(event: PointerEvent): void {\n if (event.pointerType === 'touch') {\n this.setGlobalIgnoreEmulatedMouseEvents();\n }\n }\n}\n\ninterface NgpHoverProps {\n disabled?: Signal<boolean>;\n onHoverStart?: () => void;\n onHoverEnd?: () => void;\n}\n\nexport interface NgpHoverState {\n hovered: Signal<boolean>;\n}\n\n/**\n * Programatically add the hover functionality to an element.\n * This is useful in cases where we can't necessarily use a HostDirective,\n * because there is a chance the directive has already been used.\n * @internal\n */\nexport function ngpHover({\n onHoverStart,\n onHoverEnd,\n disabled = signal(false),\n}: NgpHoverProps): NgpHoverState {\n const canHover = isHoverEnabled();\n\n if (!canHover) {\n return { hovered: signal(false) };\n }\n\n /**\n * Access the element.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the global pointer events handler.\n */\n const globalPointerEvents = inject(GlobalPointerEvents);\n\n /**\n * Store the current hover state.\n */\n const hovered = signal<boolean>(false);\n\n /**\n * Whether this element should ignore emulated mouse events.\n */\n let ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Setup event listeners.\n */\n listener(elementRef.nativeElement, 'pointerenter', onPointerEnter);\n listener(elementRef.nativeElement, 'pointerleave', onPointerLeave);\n listener(elementRef.nativeElement, 'touchstart', onTouchStart, { config: { passive: true } });\n listener(elementRef.nativeElement, 'mouseenter', onMouseEnter);\n listener(elementRef.nativeElement, 'mouseleave', onMouseLeave);\n\n // anytime the disabled state changes to true, we must reset the hover state\n if (disabled) {\n onBooleanChange(disabled, reset);\n }\n\n // if the element is removed from the dom, we want to reset the hover state\n onDomRemoval(elementRef.nativeElement, reset);\n\n // anytime the hover state changes we want to update the attribute\n dataBinding(elementRef, 'data-hover', hovered);\n\n /**\n * Reset the hover state.\n */\n function reset(): void {\n onHoverFinished('mouse');\n }\n\n /**\n * Trigger the hover start events.\n * @param event\n * @param pointerType\n */\n function onHoverBegin(event: Event, pointerType: string): void {\n if (\n disabled() ||\n pointerType === 'touch' ||\n hovered() ||\n !(event.currentTarget as Element)?.contains(event.target as Element)\n ) {\n return;\n }\n\n hovered.set(true);\n onHoverStart?.();\n }\n\n /**\n * Trigger the hover end events.\n * @param pointerType\n */\n function onHoverFinished(pointerType: string): void {\n if (pointerType === 'touch' || !hovered()) {\n return;\n }\n\n hovered.set(false);\n onHoverEnd?.();\n }\n\n function onPointerEnter(event: PointerEvent): void {\n if (globalPointerEvents.ignoreEmulatedMouseEvents && event.pointerType === 'mouse') {\n return;\n }\n\n onHoverBegin(event, event.pointerType);\n }\n\n function onPointerLeave(event: PointerEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverFinished(event.pointerType);\n }\n }\n\n function onTouchStart(): void {\n ignoreEmulatedMouseEvents = true;\n }\n\n function onMouseEnter(event: MouseEvent): void {\n if (!ignoreEmulatedMouseEvents && !globalPointerEvents.ignoreEmulatedMouseEvents) {\n onHoverBegin(event, 'mouse');\n }\n\n ignoreEmulatedMouseEvents = false;\n }\n\n function onMouseLeave(event: MouseEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverFinished('mouse');\n }\n }\n\n return { hovered };\n}\n","import { inject, Injector, Signal, signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { dataBinding, listener } from 'ng-primitives/state';\nimport { isPressEnabled } from '../config/interactions-config';\n\ninterface NgpPressState {\n pressed: Signal<boolean>;\n}\n\ninterface NgpPressProps {\n disabled?: Signal<boolean>;\n onPressStart?: () => void;\n onPressEnd?: () => void;\n}\n\n/**\n * @internal\n */\nexport function ngpPress({\n onPressStart,\n onPressEnd,\n disabled = signal(false),\n}: NgpPressProps): NgpPressState {\n const canPress = isPressEnabled();\n\n if (!canPress) {\n return { pressed: signal(false) };\n }\n\n const elementRef = injectElementRef();\n const injector = inject(Injector);\n\n /**\n * Whether the element is currently pressed.\n */\n const pressed = signal<boolean>(false);\n\n // setup event listeners\n listener(elementRef, 'pointerdown', onPointerDown);\n\n // anytime the press state changes we want to update the attribute\n dataBinding(elementRef, 'data-press', () => pressed() && !disabled());\n\n /**\n * Reset the press state.\n */\n function reset(): void {\n // if we are not pressing, then do nothing\n if (!pressed()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n pressed.set(false);\n onPressEnd?.();\n }\n\n /**\n * Store the list of disposables.\n */\n let disposableListeners: (() => void)[] = [];\n\n function onPointerDown(): void {\n if (disabled()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n\n // update the press state\n pressed.set(true);\n onPressStart?.();\n\n // setup global event listeners to catch events on elements outside the directive\n const ownerDocument = elementRef.nativeElement.ownerDocument ?? document;\n\n // if the pointer up event happens on any elements, then we are no longer pressing on this element\n const pointerUp = listener(ownerDocument, 'pointerup', () => reset(), {\n config: false,\n injector,\n });\n\n // Instead of relying on the `pointerleave` event, which is not consistently called on iOS Safari,\n // we use the `pointermove` event to determine if we are still \"pressing\".\n // By checking if the target is still within the element, we can determine if the press is ongoing.\n const pointerMove = listener(\n ownerDocument,\n 'pointermove',\n () => onPointerMove as EventListener,\n { config: false, injector },\n );\n\n // if the pointer is cancelled, then we are no longer pressing on this element\n const pointerCancel = listener(ownerDocument, 'pointercancel', () => reset(), {\n config: false,\n injector,\n });\n\n disposableListeners = [pointerUp, pointerMove, pointerCancel];\n }\n\n function onPointerMove(event: PointerEvent): void {\n if (\n elementRef.nativeElement !== event.target &&\n !elementRef.nativeElement.contains(event.target as Node)\n ) {\n reset();\n }\n }\n\n return { pressed };\n}\n","import { signal, Signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { ngpFocusVisible } from '../focus-visible/focus-visible-interaction';\nimport { ngpFocus } from '../focus/focus-interaction';\nimport { ngpHover } from '../hover/hover-interaction';\nimport { ngpPress } from '../press/press-interaction';\n\nexport interface NgpInteractionOptions {\n hover?: boolean;\n press?: boolean;\n focus?: boolean;\n focusWithin?: boolean;\n focusVisible?: boolean;\n disabled?: Signal<boolean>;\n}\n\n/**\n * Setup the interactions without relying on HostDirectives.\n * @internal\n */\nexport function ngpInteractions({\n focus,\n hover,\n press,\n focusWithin,\n focusVisible,\n disabled = signal(false),\n}: NgpInteractionOptions): void {\n const elementRef = injectElementRef();\n // If the interaction has already been setup, we can skip the setup.\n if (hasInteraction(elementRef.nativeElement, 'interactions')) {\n return;\n }\n\n if (hover) {\n ngpHover({ disabled });\n }\n if (press) {\n ngpPress({ disabled });\n }\n if (focus) {\n ngpFocus({ focusWithin, disabled });\n }\n if (focusVisible) {\n ngpFocusVisible({ disabled });\n }\n}\n\n/**\n * This function checks to see if a given interaction has already been setup on a given element.\n * If it has, it returns the existing interaction state.\n * If it has not, it sets up the interaction state for future checks.\n */\nexport function hasInteraction(element: HTMLElement, interaction: string): boolean {\n const hasInteraction = `__ngp-${interaction}` in element;\n\n // if the interaction has not been setup, we mark it as setup for future checks\n if (!hasInteraction) {\n (element as unknown as Record<string, unknown>)[`__ngp-${interaction}`] = true;\n }\n\n return hasInteraction;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { ngpFocusVisible } from './focus-visible-interaction';\n\n/**\n * Apply the `ngpFocusVisible` directive to an element that should be visually focused. This is similar to `ngpFocus`\n * but it will only apply the focus visible styles when the element is focused via keyboard navigation.\n */\n@Directive({\n selector: '[ngpFocusVisible]',\n exportAs: 'ngpFocusVisible',\n})\nexport class NgpFocusVisible {\n /**\n * Whether focus events are listened to.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFocusVisibleDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the element is visually focused.\n */\n readonly focusChange = output<boolean>({\n alias: 'ngpFocusVisible',\n });\n\n constructor() {\n // setup the focus visible listener\n ngpFocusVisible({\n disabled: this.disabled,\n onFocusChange: value => this.focusChange.emit(value),\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { ngpFocus } from './focus-interaction';\n\n/**\n * This was inspired by the React Aria useFocus hook.\n * https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useFocus.ts#L20\n */\n@Directive({\n selector: '[ngpFocus]',\n exportAs: 'ngpFocus',\n})\nexport class NgpFocus {\n /**\n * Whether listening for focus events is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFocusDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the focus state changes.\n */\n readonly focus = output<boolean>({ alias: 'ngpFocus' });\n\n constructor() {\n // setup the focus listener\n ngpFocus({\n disabled: this.disabled,\n onFocus: () => this.focus.emit(true),\n onBlur: () => this.focus.emit(false),\n });\n }\n}\n","import type { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { ngpHover } from './hover-interaction';\n\n// This is an Angular port of the useHover hook from react-aria: https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useHover.ts\n\n/**\n * Apply the `ngpHover` directive to an element that you want to listen for hover events. T\n * his is particulaly useful for supporting hover events on touch devices, where hover events are not handled consistently.\n * On iOS relying on the `:hover` pseudo-class can result in the hover state being stuck until the user taps elsewhere on the screen.\n */\n@Directive({\n selector: '[ngpHover]',\n exportAs: 'ngpHover',\n})\nexport class NgpHover {\n /**\n * Whether hoving should be disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpHoverDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit an event when hovering starts.\n */\n readonly hoverStart = output<void>({ alias: 'ngpHoverStart' });\n\n /**\n * Emit an event when hovering ends.\n */\n readonly hoverEnd = output<void>({ alias: 'ngpHoverEnd' });\n\n /**\n * Emit an event when the hover state changes.\n */\n readonly hoverChange = output<boolean>({ alias: 'ngpHover' });\n\n /**\n * Setup the hover state.\n */\n constructor() {\n // setup the hover listener\n ngpHover({\n onHoverStart: () => {\n this.hoverStart.emit();\n this.hoverChange.emit(true);\n },\n onHoverEnd: () => {\n this.hoverEnd.emit();\n this.hoverChange.emit(false);\n },\n disabled: this.disabled,\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, input, output, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\n// Inspired by react-aria useMove hook: https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useMove.ts\n\n/**\n * The `NgpMove` directive is used to enable the pointer and keyboard move interactions on an element.\n */\n@Directive({\n selector: '[ngpMove]',\n exportAs: 'ngpMove',\n host: {\n '[attr.data-move]': 'isMoving() ? \"\" : null',\n },\n})\nexport class NgpMove {\n /**\n * Access the disposable helper.\n */\n private readonly disposables = injectDisposables();\n\n /**\n * Whether movement is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpMoveDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the move event begins.\n */\n readonly start = output<NgpMoveStartEvent>({\n alias: 'ngpMoveStart',\n });\n\n /**\n * Emit when the element is moved.\n */\n readonly move = output<NgpMoveEvent>({\n alias: 'ngpMove',\n });\n\n /**\n * Emit when the move event ends.\n */\n readonly end = output<NgpMoveEndEvent>({\n alias: 'ngpMoveEnd',\n });\n\n /**\n * Whether the element is currently being moved.\n */\n protected isMoving = signal<boolean>(false);\n\n /**\n * Store the last x position of the element.\n */\n private x: number | null = null;\n\n /**\n * Store the last y position of the element.\n */\n private y: number | null = null;\n\n /**\n * Store the id of the last pointer.\n */\n private pointerId: number | null = null;\n\n /**\n * Store the disposable event listeners.\n */\n private disposableListeners: (() => void)[] = [];\n\n /**\n * Handle a move start.\n */\n private onMoveStart(event: PointerEvent | KeyboardEvent, pointerType: PointerType): void {\n this.start.emit({\n pointerType,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n });\n this.isMoving.set(true);\n }\n\n /**\n * Handle a move event.\n */\n private onMove(\n event: PointerEvent | KeyboardEvent,\n pointerType: PointerType,\n deltaX: number,\n deltaY: number,\n ): void {\n if (deltaX === 0 && deltaY === 0) {\n return;\n }\n\n this.move.emit({\n deltaX,\n deltaY,\n pointerType,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n });\n }\n\n /**\n * Handle a move end.\n */\n private onMoveEnd(event: PointerEvent | KeyboardEvent, pointerType: PointerType): void {\n this.end.emit({\n pointerType,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n });\n this.isMoving.set(false);\n }\n\n /**\n * Handle the pointer down event.\n */\n @HostListener('pointerdown', ['$event'])\n protected onPointerDown(event: PointerEvent): void {\n // ignore right-click or additional pointers\n if (event.button !== 0 || this.pointerId !== null || this.disabled()) {\n return;\n }\n\n // prevent the default behavior\n event.preventDefault();\n event.stopPropagation();\n\n this.onMoveStart(event, event.pointerType as PointerType);\n\n // store the pointer id and initial position\n this.pointerId = event.pointerId;\n this.x = event.pageX;\n this.y = event.pageY;\n\n // add global event listeners\n const pointerMove = this.disposables.addEventListener(\n window,\n 'pointermove',\n this.onPointerMove.bind(this) as EventListener,\n false,\n );\n\n const pointerUp = this.disposables.addEventListener(\n window,\n 'pointerup',\n this.onPointerUp.bind(this) as EventListener,\n false,\n );\n\n const pointerCancel = this.disposables.addEventListener(\n window,\n 'pointercancel',\n this.onPointerUp.bind(this) as EventListener,\n false,\n );\n\n // store the disposable event listeners\n this.disposableListeners = [pointerMove, pointerUp, pointerCancel];\n }\n\n /**\n * Handle the pointer up event.\n */\n protected onPointerUp(event: PointerEvent): void {\n if (this.pointerId !== event.pointerId) {\n return;\n }\n\n const pointerType = (event.pointerType ?? 'mouse') as PointerType;\n this.onMoveEnd(event, pointerType);\n this.pointerId = null;\n this.disposableListeners.forEach(dispose => dispose());\n }\n\n /**\n * Handle the pointer move event.\n */\n protected onPointerMove(event: PointerEvent): void {\n if (this.pointerId !== event.pointerId) {\n return;\n }\n\n // Problems with PointerEvent#movementX/movementY:\n // 1. it is always 0 on macOS Safari.\n // 2. On Chrome Android, it's scaled by devicePixelRatio, but not on Chrome macOS\n this.onMove(\n event,\n event.pointerType as PointerType,\n event.pageX - (this.x ?? 0),\n event.pageY - (this.y ?? 0),\n );\n this.x = event.pageX;\n this.y = event.pageY;\n }\n\n private triggerKeyboardMove(event: KeyboardEvent, deltaX: number, deltaY: number): void {\n if (this.disabled()) {\n return;\n }\n\n this.onMoveStart(event, 'keyboard');\n this.onMove(event, 'keyboard', deltaX, deltaY);\n this.onMoveEnd(event, 'keyboard');\n }\n\n @HostListener('keydown.ArrowUp', ['$event'])\n protected onArrowUp(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event as KeyboardEvent, 0, -1);\n }\n\n @HostListener('keydown.ArrowDown', ['$event'])\n protected onArrowDown(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event as KeyboardEvent, 0, 1);\n }\n\n @HostListener('keydown.ArrowLeft', ['$event'])\n protected onArrowLeft(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event as KeyboardEvent, -1, 0);\n }\n\n @HostListener('keydown.ArrowRight', ['$event'])\n protected onArrowRight(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event as KeyboardEvent, 1, 0);\n }\n}\n\ninterface NgpMoveBaseEvent {\n /**\n * Whether the event was triggered by a mouse or keyboard event.\n */\n pointerType: PointerType;\n /**\n * Whether the shift key was pressed during the event.\n */\n shiftKey: boolean;\n /**\n * Whether the control key was pressed during the event.\n */\n ctrlKey: boolean;\n /**\n * Whether the meta key was pressed during the event.\n */\n metaKey: boolean;\n /**\n * Whether the alt key was pressed during the event.\n */\n altKey: boolean;\n}\n\nexport type NgpMoveStartEvent = NgpMoveBaseEvent;\nexport type NgpMoveEndEvent = NgpMoveBaseEvent;\n\nexport interface NgpMoveEvent extends NgpMoveBaseEvent {\n /**\n * The amount of pixels moved in the x-axis.\n */\n deltaX: number;\n /**\n * The amount of pixels moved in the y-axis.\n */\n deltaY: number;\n}\n\nexport type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { ngpPress } from './press-interaction';\n\n// This was inpsired by Headless UI's active-press hook: https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/hooks/use-active-press.tsx\n\n/**\n * The `ngpPress` directive listens for press events on an element. This is particularly useful for supporting press events on touch devices, where press events are not handled consistently.\n */\n@Directive({\n selector: '[ngpPress]',\n exportAs: 'ngpPress',\n})\nexport class NgpPress {\n /**\n * Whether listening for press events is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPressDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the press begins.\n */\n readonly pressStart = output<void>({\n alias: 'ngpPressStart',\n });\n\n /**\n * Emit when the press ends.\n */\n readonly pressEnd = output<void>({\n alias: 'ngpPressEnd',\n });\n\n /**\n * Emit when the press changes.\n */\n readonly pressChange = output<boolean>({\n alias: 'ngpPress',\n });\n\n constructor() {\n // setup the press listener\n ngpPress({\n onPressStart: () => {\n this.pressStart.emit();\n this.pressChange.emit(true);\n },\n onPressEnd: () => {\n this.pressEnd.emit();\n this.pressChange.emit(false);\n },\n disabled: this.disabled,\n });\n }\n}\n","// re-export ngpInteractions as setupInteractions for backwards compatibility\nimport { ngpInteractions } from './interactions/interactions';\n\nexport { NgpInteractionsConfig, provideInteractionsConfig } from './config/interactions-config';\nexport { NgpFocusVisible } from './focus-visible/focus-visible';\nexport { ngpFocusVisible } from './focus-visible/focus-visible-interaction';\nexport { NgpFocus } from './focus/focus';\nexport { ngpFocus } from './focus/focus-interaction';\nexport { NgpHover } from './hover/hover';\nexport { ngpHover } from './hover/hover-interaction';\nexport { ngpInteractions } from './interactions/interactions';\nexport { NgpMove, NgpMoveEvent } from './move/move';\nexport { NgpPress } from './press/press';\nexport { ngpPress } from './press/press-interaction';\n\n/**\n * @deprecated use `ngpInteractions` instead\n */\nexport { ngpInteractions as setupInteractions };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAeO,MAAM,yBAAyB,GAA0B;AAC9D,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,KAAK,EAAE,IAAI;CACZ;AAEM,MAAM,0BAA0B,GAAG,IAAI,cAAc,CAC1D,4BAA4B,CAC7B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ions.mjs","sources":["../../../../packages/ng-primitives/interactions/src/config/interactions-config.ts","../../../../packages/ng-primitives/interactions/src/focus-visible/focus-visible-interaction.ts","../../../../packages/ng-primitives/interactions/src/focus/focus-interaction.ts","../../../../packages/ng-primitives/interactions/src/hover/hover-interaction.ts","../../../../packages/ng-primitives/interactions/src/press/press-interaction.ts","../../../../packages/ng-primitives/interactions/src/interactions/interactions.ts","../../../../packages/ng-primitives/interactions/src/focus-visible/focus-visible.ts","../../../../packages/ng-primitives/interactions/src/focus/focus.ts","../../../../packages/ng-primitives/interactions/src/hover/hover.ts","../../../../packages/ng-primitives/interactions/src/move/move.ts","../../../../packages/ng-primitives/interactions/src/press/press.ts","../../../../packages/ng-primitives/interactions/src/index.ts","../../../../packages/ng-primitives/interactions/src/ng-primitives-interactions.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\n\nexport interface NgpInteractionsConfig {\n /** Whether all interactions are disabled */\n disabled?: boolean;\n /** Whether hover interactions are enabled */\n hover?: boolean;\n /** Whether focus interactions are enabled */\n focus?: boolean;\n /** Whether focus-visible interactions are enabled */\n focusVisible?: boolean;\n /** Whether press interactions are enabled */\n press?: boolean;\n}\n\nexport const defaultInteractionsConfig: NgpInteractionsConfig = {\n disabled: false,\n hover: true,\n focus: true,\n focusVisible: true,\n press: true,\n};\n\nexport const NgpInteractionsConfigToken = new InjectionToken<NgpInteractionsConfig>(\n 'NgpInteractionsConfigToken',\n);\n\n/**\n * Provide the default Interactions configuration\n * @param config The Interactions configuration\n * @returns The provider\n */\nexport function provideInteractionsConfig(config: Partial<NgpInteractionsConfig>): Provider[] {\n return [\n {\n provide: NgpInteractionsConfigToken,\n useValue: { ...defaultInteractionsConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Interactions configuration\n * @returns The global Interactions configuration\n */\nexport function injectInteractionsConfig(): NgpInteractionsConfig {\n return inject(NgpInteractionsConfigToken, { optional: true }) ?? defaultInteractionsConfig;\n}\n\nexport function isHoverEnabled(): boolean {\n const config = injectInteractionsConfig();\n return !config.disabled && !!config.hover;\n}\n\nexport function isFocusEnabled(): boolean {\n const config = injectInteractionsConfig();\n return !config.disabled && !!config.focus;\n}\n\nexport function isFocusVisibleEnabled(): boolean {\n const config = injectInteractionsConfig();\n return !config.disabled && !!config.focusVisible;\n}\n\nexport function isPressEnabled(): boolean {\n const config = injectInteractionsConfig();\n return !config.disabled && !!config.press;\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { ElementRef, inject, Renderer2, Signal, signal } from '@angular/core';\nimport { onBooleanChange, safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { isFocusVisibleEnabled } from '../config/interactions-config';\n\nexport interface NgpFocusVisibleProps {\n disabled?: Signal<boolean>;\n onFocusChange?: (value: boolean) => void;\n}\n\nexport interface NgpFocusVisibleState {\n isFocused: Signal<boolean>;\n}\n\n/**\n * @internal\n */\nexport function ngpFocusVisible({\n onFocusChange,\n disabled = signal(false),\n}: NgpFocusVisibleProps): NgpFocusVisibleState {\n const canFocusVisible = isFocusVisibleEnabled();\n\n if (!canFocusVisible) {\n return { isFocused: signal(false) };\n }\n\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n const renderer = inject(Renderer2);\n const focusMonitor = inject(FocusMonitor);\n\n // Whether the element is currently focused.\n const isFocused = signal<boolean>(false);\n\n // handle focus state\n focusMonitor\n .monitor(elementRef.nativeElement)\n .pipe(safeTakeUntilDestroyed())\n .subscribe(origin =>\n // null indicates the element was blurred\n origin === null ? onBlur() : onFocus(origin),\n );\n\n // if the component becomes disabled and it is focused, hide the focus\n onBooleanChange(disabled, () => focus(false));\n\n function onFocus(origin: FocusOrigin): void {\n if (disabled() || isFocused()) {\n return;\n }\n\n // for some elements the focus visible state should always appear on focus\n if (alwaysShowFocus()) {\n focus(true, origin);\n return;\n }\n\n // if the focus origin is keyboard or program(focused programmatically), then the focus is visible\n if (origin === 'keyboard') {\n focus(true, 'keyboard');\n return;\n }\n }\n\n function onBlur(): void {\n if (disabled() || !isFocused()) {\n return;\n }\n\n focus(false);\n }\n\n /**\n * Trigger the focus signal along with the focusChange event.\n */\n function focus(value: boolean, origin?: FocusOrigin) {\n if (isFocused() === value) {\n return;\n }\n\n isFocused.set(value);\n onFocusChange?.(value);\n\n if (value) {\n renderer.setAttribute(elementRef.nativeElement, 'data-focus-visible', origin ?? '');\n } else {\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus-visible');\n }\n }\n\n function alwaysShowFocus(): boolean {\n const nonTextInputTypes = [\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset',\n ];\n\n // if this is an input element and it is a text input\n if (\n elementRef.nativeElement instanceof HTMLInputElement &&\n !nonTextInputTypes.includes(elementRef.nativeElement.type)\n ) {\n return true;\n }\n\n // if this is a textarea\n if (elementRef.nativeElement instanceof HTMLTextAreaElement) {\n return true;\n }\n\n // if this is an element with contenteditable\n if (\n elementRef.nativeElement.isContentEditable ||\n elementRef.nativeElement.hasAttribute('contenteditable')\n ) {\n return true;\n }\n\n return false;\n }\n\n return {\n isFocused,\n };\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { ElementRef, Renderer2, Signal, inject, signal } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { isFocusEnabled } from '../config/interactions-config';\n\nexport interface NgpFocusProps {\n disabled?: Signal<boolean>;\n focusWithin?: boolean;\n onFocus?: () => void;\n onBlur?: () => void;\n}\n\nexport interface NgpFocusState {\n isFocused: Signal<boolean>;\n}\n\n/**\n * @internal\n */\nexport function ngpFocus({\n onFocus,\n onBlur,\n focusWithin = false,\n disabled = signal(false),\n}: NgpFocusProps): NgpFocusState {\n const canFocus = isFocusEnabled();\n\n if (!canFocus) {\n return { isFocused: signal(false) };\n }\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the focus monitor.\n */\n const focusMonitor = inject(FocusMonitor);\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Whether the element is currently focused.\n */\n const isFocused = signal<boolean>(false);\n\n focusMonitor\n .monitor(elementRef, focusWithin)\n .pipe(safeTakeUntilDestroyed())\n .subscribe(focusOrigin => {\n if (disabled()) {\n return;\n }\n\n isFocused.set(focusOrigin !== null);\n if (focusOrigin !== null) {\n if (onFocus) {\n onFocus();\n }\n renderer.setAttribute(elementRef.nativeElement, 'data-focus', '');\n } else {\n if (onBlur) {\n onBlur();\n }\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus');\n }\n });\n\n return { isFocused };\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport { DOCUMENT } from '@angular/common';\nimport { ElementRef, inject, Injectable, PLATFORM_ID, Signal, signal } from '@angular/core';\nimport { onDomRemoval } from 'ng-primitives/internal';\nimport { dataBinding, listener } from 'ng-primitives/state';\nimport { onBooleanChange } from 'ng-primitives/utils';\nimport { isHoverEnabled } from '../config/interactions-config';\n\n/**\n * We use a service here as this value is a singleton\n * and allows us to register the dom events once.\n */\n@Injectable({\n providedIn: 'root',\n})\nclass GlobalPointerEvents {\n /**\n * Whether global mouse events should be ignored.\n */\n ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Determine the platform id.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n constructor() {\n // we only want to setup events on the client\n if (isPlatformBrowser(this.platformId)) {\n this.setupGlobalTouchEvents();\n }\n }\n\n private setupGlobalTouchEvents(): void {\n this.document.addEventListener('pointerup', this.handleGlobalPointerEvent.bind(this));\n this.document.addEventListener('touchend', this.setGlobalIgnoreEmulatedMouseEvents.bind(this));\n }\n\n private setGlobalIgnoreEmulatedMouseEvents(): void {\n this.ignoreEmulatedMouseEvents = true;\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => (this.ignoreEmulatedMouseEvents = false), 50);\n }\n\n private handleGlobalPointerEvent(event: PointerEvent): void {\n if (event.pointerType === 'touch') {\n this.setGlobalIgnoreEmulatedMouseEvents();\n }\n }\n}\n\ninterface NgpHoverProps {\n disabled?: Signal<boolean>;\n onHoverStart?: () => void;\n onHoverEnd?: () => void;\n}\n\nexport interface NgpHoverState {\n hovered: Signal<boolean>;\n}\n\n/**\n * Programatically add the hover functionality to an element.\n * This is useful in cases where we can't necessarily use a HostDirective,\n * because there is a chance the directive has already been used.\n * @internal\n */\nexport function ngpHover({\n onHoverStart,\n onHoverEnd,\n disabled = signal(false),\n}: NgpHoverProps): NgpHoverState {\n const canHover = isHoverEnabled();\n\n if (!canHover) {\n return { hovered: signal(false) };\n }\n\n /**\n * Access the element.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the global pointer events handler.\n */\n const globalPointerEvents = inject(GlobalPointerEvents);\n\n /**\n * Store the current hover state.\n */\n const hovered = signal<boolean>(false);\n\n /**\n * Whether this element should ignore emulated mouse events.\n */\n let ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Setup event listeners.\n */\n listener(elementRef.nativeElement, 'pointerenter', onPointerEnter);\n listener(elementRef.nativeElement, 'pointerleave', onPointerLeave);\n listener(elementRef.nativeElement, 'touchstart', onTouchStart, { config: { passive: true } });\n listener(elementRef.nativeElement, 'mouseenter', onMouseEnter);\n listener(elementRef.nativeElement, 'mouseleave', onMouseLeave);\n\n // anytime the disabled state changes to true, we must reset the hover state\n if (disabled) {\n onBooleanChange(disabled, reset);\n }\n\n // if the element is removed from the dom, we want to reset the hover state\n onDomRemoval(elementRef.nativeElement, reset);\n\n // anytime the hover state changes we want to update the attribute\n dataBinding(elementRef, 'data-hover', hovered);\n\n /**\n * Reset the hover state.\n */\n function reset(): void {\n onHoverFinished('mouse');\n }\n\n /**\n * Trigger the hover start events.\n * @param event\n * @param pointerType\n */\n function onHoverBegin(event: Event, pointerType: string): void {\n if (\n disabled() ||\n pointerType === 'touch' ||\n hovered() ||\n !(event.currentTarget as Element)?.contains(event.target as Element)\n ) {\n return;\n }\n\n hovered.set(true);\n onHoverStart?.();\n }\n\n /**\n * Trigger the hover end events.\n * @param pointerType\n */\n function onHoverFinished(pointerType: string): void {\n if (pointerType === 'touch' || !hovered()) {\n return;\n }\n\n hovered.set(false);\n onHoverEnd?.();\n }\n\n function onPointerEnter(event: PointerEvent): void {\n if (globalPointerEvents.ignoreEmulatedMouseEvents && event.pointerType === 'mouse') {\n return;\n }\n\n onHoverBegin(event, event.pointerType);\n }\n\n function onPointerLeave(event: PointerEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverFinished(event.pointerType);\n }\n }\n\n function onTouchStart(): void {\n ignoreEmulatedMouseEvents = true;\n }\n\n function onMouseEnter(event: MouseEvent): void {\n if (!ignoreEmulatedMouseEvents && !globalPointerEvents.ignoreEmulatedMouseEvents) {\n onHoverBegin(event, 'mouse');\n }\n\n ignoreEmulatedMouseEvents = false;\n }\n\n function onMouseLeave(event: MouseEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverFinished('mouse');\n }\n }\n\n return { hovered };\n}\n","import { inject, Injector, Signal, signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { dataBinding, listener } from 'ng-primitives/state';\nimport { isPressEnabled } from '../config/interactions-config';\n\ninterface NgpPressState {\n pressed: Signal<boolean>;\n}\n\ninterface NgpPressProps {\n disabled?: Signal<boolean>;\n onPressStart?: () => void;\n onPressEnd?: () => void;\n}\n\n/**\n * @internal\n */\nexport function ngpPress({\n onPressStart,\n onPressEnd,\n disabled = signal(false),\n}: NgpPressProps): NgpPressState {\n const canPress = isPressEnabled();\n\n if (!canPress) {\n return { pressed: signal(false) };\n }\n\n const elementRef = injectElementRef();\n const injector = inject(Injector);\n\n /**\n * Whether the element is currently pressed.\n */\n const pressed = signal<boolean>(false);\n\n // setup event listeners\n listener(elementRef, 'pointerdown', onPointerDown);\n\n // anytime the press state changes we want to update the attribute\n dataBinding(elementRef, 'data-press', () => pressed() && !disabled());\n\n /**\n * Reset the press state.\n */\n function reset(): void {\n // if we are not pressing, then do nothing\n if (!pressed()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n pressed.set(false);\n onPressEnd?.();\n }\n\n /**\n * Store the list of disposables.\n */\n let disposableListeners: (() => void)[] = [];\n\n function onPointerDown(): void {\n if (disabled()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n\n // update the press state\n pressed.set(true);\n onPressStart?.();\n\n // setup global event listeners to catch events on elements outside the directive\n const ownerDocument = elementRef.nativeElement.ownerDocument ?? document;\n\n // if the pointer up event happens on any elements, then we are no longer pressing on this element\n const pointerUp = listener(ownerDocument, 'pointerup', () => reset(), {\n config: false,\n injector,\n });\n\n // Instead of relying on the `pointerleave` event, which is not consistently called on iOS Safari,\n // we use the `pointermove` event to determine if we are still \"pressing\".\n // By checking if the target is still within the element, we can determine if the press is ongoing.\n const pointerMove = listener(\n ownerDocument,\n 'pointermove',\n () => onPointerMove as EventListener,\n { config: false, injector },\n );\n\n // if the pointer is cancelled, then we are no longer pressing on this element\n const pointerCancel = listener(ownerDocument, 'pointercancel', () => reset(), {\n config: false,\n injector,\n });\n\n disposableListeners = [pointerUp, pointerMove, pointerCancel];\n }\n\n function onPointerMove(event: PointerEvent): void {\n if (\n elementRef.nativeElement !== event.target &&\n !elementRef.nativeElement.contains(event.target as Node)\n ) {\n reset();\n }\n }\n\n return { pressed };\n}\n","import { signal, Signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { ngpFocusVisible } from '../focus-visible/focus-visible-interaction';\nimport { ngpFocus } from '../focus/focus-interaction';\nimport { ngpHover } from '../hover/hover-interaction';\nimport { ngpPress } from '../press/press-interaction';\n\nexport interface NgpInteractionOptions {\n hover?: boolean;\n press?: boolean;\n focus?: boolean;\n focusWithin?: boolean;\n focusVisible?: boolean;\n disabled?: Signal<boolean>;\n}\n\n/**\n * Setup the interactions without relying on HostDirectives.\n * @internal\n */\nexport function ngpInteractions({\n focus,\n hover,\n press,\n focusWithin,\n focusVisible,\n disabled = signal(false),\n}: NgpInteractionOptions): void {\n const elementRef = injectElementRef();\n // If the interaction has already been setup, we can skip the setup.\n if (hasInteraction(elementRef.nativeElement, 'interactions')) {\n return;\n }\n\n if (hover) {\n ngpHover({ disabled });\n }\n if (press) {\n ngpPress({ disabled });\n }\n if (focus) {\n ngpFocus({ focusWithin, disabled });\n }\n if (focusVisible) {\n ngpFocusVisible({ disabled });\n }\n}\n\n/**\n * This function checks to see if a given interaction has already been setup on a given element.\n * If it has, it returns the existing interaction state.\n * If it has not, it sets up the interaction state for future checks.\n */\nexport function hasInteraction(element: HTMLElement, interaction: string): boolean {\n const hasInteraction = `__ngp-${interaction}` in element;\n\n // if the interaction has not been setup, we mark it as setup for future checks\n if (!hasInteraction) {\n (element as unknown as Record<string, unknown>)[`__ngp-${interaction}`] = true;\n }\n\n return hasInteraction;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { ngpFocusVisible } from './focus-visible-interaction';\n\n/**\n * Apply the `ngpFocusVisible` directive to an element that should be visually focused. This is similar to `ngpFocus`\n * but it will only apply the focus visible styles when the element is focused via keyboard navigation.\n */\n@Directive({\n selector: '[ngpFocusVisible]',\n exportAs: 'ngpFocusVisible',\n})\nexport class NgpFocusVisible {\n /**\n * Whether focus events are listened to.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFocusVisibleDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the element is visually focused.\n */\n readonly focusChange = output<boolean>({\n alias: 'ngpFocusVisible',\n });\n\n constructor() {\n // setup the focus visible listener\n ngpFocusVisible({\n disabled: this.disabled,\n onFocusChange: value => this.focusChange.emit(value),\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { ngpFocus } from './focus-interaction';\n\n/**\n * This was inspired by the React Aria useFocus hook.\n * https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useFocus.ts#L20\n */\n@Directive({\n selector: '[ngpFocus]',\n exportAs: 'ngpFocus',\n})\nexport class NgpFocus {\n /**\n * Whether listening for focus events is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFocusDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the focus state changes.\n */\n readonly focus = output<boolean>({ alias: 'ngpFocus' });\n\n constructor() {\n // setup the focus listener\n ngpFocus({\n disabled: this.disabled,\n onFocus: () => this.focus.emit(true),\n onBlur: () => this.focus.emit(false),\n });\n }\n}\n","import type { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { ngpHover } from './hover-interaction';\n\n// This is an Angular port of the useHover hook from react-aria: https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useHover.ts\n\n/**\n * Apply the `ngpHover` directive to an element that you want to listen for hover events. T\n * his is particulaly useful for supporting hover events on touch devices, where hover events are not handled consistently.\n * On iOS relying on the `:hover` pseudo-class can result in the hover state being stuck until the user taps elsewhere on the screen.\n */\n@Directive({\n selector: '[ngpHover]',\n exportAs: 'ngpHover',\n})\nexport class NgpHover {\n /**\n * Whether hoving should be disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpHoverDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit an event when hovering starts.\n */\n readonly hoverStart = output<void>({ alias: 'ngpHoverStart' });\n\n /**\n * Emit an event when hovering ends.\n */\n readonly hoverEnd = output<void>({ alias: 'ngpHoverEnd' });\n\n /**\n * Emit an event when the hover state changes.\n */\n readonly hoverChange = output<boolean>({ alias: 'ngpHover' });\n\n /**\n * Setup the hover state.\n */\n constructor() {\n // setup the hover listener\n ngpHover({\n onHoverStart: () => {\n this.hoverStart.emit();\n this.hoverChange.emit(true);\n },\n onHoverEnd: () => {\n this.hoverEnd.emit();\n this.hoverChange.emit(false);\n },\n disabled: this.disabled,\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, input, output, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\n// Inspired by react-aria useMove hook: https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useMove.ts\n\n/**\n * The `NgpMove` directive is used to enable the pointer and keyboard move interactions on an element.\n */\n@Directive({\n selector: '[ngpMove]',\n exportAs: 'ngpMove',\n host: {\n '[attr.data-move]': 'isMoving() ? \"\" : null',\n },\n})\nexport class NgpMove {\n /**\n * Access the disposable helper.\n */\n private readonly disposables = injectDisposables();\n\n /**\n * Whether movement is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpMoveDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the move event begins.\n */\n readonly start = output<NgpMoveStartEvent>({\n alias: 'ngpMoveStart',\n });\n\n /**\n * Emit when the element is moved.\n */\n readonly move = output<NgpMoveEvent>({\n alias: 'ngpMove',\n });\n\n /**\n * Emit when the move event ends.\n */\n readonly end = output<NgpMoveEndEvent>({\n alias: 'ngpMoveEnd',\n });\n\n /**\n * Whether the element is currently being moved.\n */\n protected isMoving = signal<boolean>(false);\n\n /**\n * Store the last x position of the element.\n */\n private x: number | null = null;\n\n /**\n * Store the last y position of the element.\n */\n private y: number | null = null;\n\n /**\n * Store the id of the last pointer.\n */\n private pointerId: number | null = null;\n\n /**\n * Store the disposable event listeners.\n */\n private disposableListeners: (() => void)[] = [];\n\n /**\n * Handle a move start.\n */\n private onMoveStart(event: PointerEvent | KeyboardEvent, pointerType: PointerType): void {\n this.start.emit({\n pointerType,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n });\n this.isMoving.set(true);\n }\n\n /**\n * Handle a move event.\n */\n private onMove(\n event: PointerEvent | KeyboardEvent,\n pointerType: PointerType,\n deltaX: number,\n deltaY: number,\n ): void {\n if (deltaX === 0 && deltaY === 0) {\n return;\n }\n\n this.move.emit({\n deltaX,\n deltaY,\n pointerType,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n });\n }\n\n /**\n * Handle a move end.\n */\n private onMoveEnd(event: PointerEvent | KeyboardEvent, pointerType: PointerType): void {\n this.end.emit({\n pointerType,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n });\n this.isMoving.set(false);\n }\n\n /**\n * Handle the pointer down event.\n */\n @HostListener('pointerdown', ['$event'])\n protected onPointerDown(event: PointerEvent): void {\n // ignore right-click or additional pointers\n if (event.button !== 0 || this.pointerId !== null || this.disabled()) {\n return;\n }\n\n // prevent the default behavior\n event.preventDefault();\n event.stopPropagation();\n\n this.onMoveStart(event, event.pointerType as PointerType);\n\n // store the pointer id and initial position\n this.pointerId = event.pointerId;\n this.x = event.pageX;\n this.y = event.pageY;\n\n // add global event listeners\n const pointerMove = this.disposables.addEventListener(\n window,\n 'pointermove',\n this.onPointerMove.bind(this) as EventListener,\n false,\n );\n\n const pointerUp = this.disposables.addEventListener(\n window,\n 'pointerup',\n this.onPointerUp.bind(this) as EventListener,\n false,\n );\n\n const pointerCancel = this.disposables.addEventListener(\n window,\n 'pointercancel',\n this.onPointerUp.bind(this) as EventListener,\n false,\n );\n\n // store the disposable event listeners\n this.disposableListeners = [pointerMove, pointerUp, pointerCancel];\n }\n\n /**\n * Handle the pointer up event.\n */\n protected onPointerUp(event: PointerEvent): void {\n if (this.pointerId !== event.pointerId) {\n return;\n }\n\n const pointerType = (event.pointerType ?? 'mouse') as PointerType;\n this.onMoveEnd(event, pointerType);\n this.pointerId = null;\n this.disposableListeners.forEach(dispose => dispose());\n }\n\n /**\n * Handle the pointer move event.\n */\n protected onPointerMove(event: PointerEvent): void {\n if (this.pointerId !== event.pointerId) {\n return;\n }\n\n // Problems with PointerEvent#movementX/movementY:\n // 1. it is always 0 on macOS Safari.\n // 2. On Chrome Android, it's scaled by devicePixelRatio, but not on Chrome macOS\n this.onMove(\n event,\n event.pointerType as PointerType,\n event.pageX - (this.x ?? 0),\n event.pageY - (this.y ?? 0),\n );\n this.x = event.pageX;\n this.y = event.pageY;\n }\n\n private triggerKeyboardMove(event: KeyboardEvent, deltaX: number, deltaY: number): void {\n if (this.disabled()) {\n return;\n }\n\n this.onMoveStart(event, 'keyboard');\n this.onMove(event, 'keyboard', deltaX, deltaY);\n this.onMoveEnd(event, 'keyboard');\n }\n\n @HostListener('keydown.ArrowUp', ['$event'])\n protected onArrowUp(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event as KeyboardEvent, 0, -1);\n }\n\n @HostListener('keydown.ArrowDown', ['$event'])\n protected onArrowDown(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event as KeyboardEvent, 0, 1);\n }\n\n @HostListener('keydown.ArrowLeft', ['$event'])\n protected onArrowLeft(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event as KeyboardEvent, -1, 0);\n }\n\n @HostListener('keydown.ArrowRight', ['$event'])\n protected onArrowRight(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event as KeyboardEvent, 1, 0);\n }\n}\n\ninterface NgpMoveBaseEvent {\n /**\n * Whether the event was triggered by a mouse or keyboard event.\n */\n pointerType: PointerType;\n /**\n * Whether the shift key was pressed during the event.\n */\n shiftKey: boolean;\n /**\n * Whether the control key was pressed during the event.\n */\n ctrlKey: boolean;\n /**\n * Whether the meta key was pressed during the event.\n */\n metaKey: boolean;\n /**\n * Whether the alt key was pressed during the event.\n */\n altKey: boolean;\n}\n\nexport type NgpMoveStartEvent = NgpMoveBaseEvent;\nexport type NgpMoveEndEvent = NgpMoveBaseEvent;\n\nexport interface NgpMoveEvent extends NgpMoveBaseEvent {\n /**\n * The amount of pixels moved in the x-axis.\n */\n deltaX: number;\n /**\n * The amount of pixels moved in the y-axis.\n */\n deltaY: number;\n}\n\nexport type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { ngpPress } from './press-interaction';\n\n// This was inpsired by Headless UI's active-press hook: https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/hooks/use-active-press.tsx\n\n/**\n * The `ngpPress` directive listens for press events on an element. This is particularly useful for supporting press events on touch devices, where press events are not handled consistently.\n */\n@Directive({\n selector: '[ngpPress]',\n exportAs: 'ngpPress',\n})\nexport class NgpPress {\n /**\n * Whether listening for press events is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPressDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the press begins.\n */\n readonly pressStart = output<void>({\n alias: 'ngpPressStart',\n });\n\n /**\n * Emit when the press ends.\n */\n readonly pressEnd = output<void>({\n alias: 'ngpPressEnd',\n });\n\n /**\n * Emit when the press changes.\n */\n readonly pressChange = output<boolean>({\n alias: 'ngpPress',\n });\n\n constructor() {\n // setup the press listener\n ngpPress({\n onPressStart: () => {\n this.pressStart.emit();\n this.pressChange.emit(true);\n },\n onPressEnd: () => {\n this.pressEnd.emit();\n this.pressChange.emit(false);\n },\n disabled: this.disabled,\n });\n }\n}\n","// re-export ngpInteractions as setupInteractions for backwards compatibility\nimport { ngpInteractions } from './interactions/interactions';\n\nexport { NgpInteractionsConfig, provideInteractionsConfig } from './config/interactions-config';\nexport { NgpFocusVisible } from './focus-visible/focus-visible';\nexport { ngpFocusVisible } from './focus-visible/focus-visible-interaction';\nexport { NgpFocus } from './focus/focus';\nexport { ngpFocus } from './focus/focus-interaction';\nexport { NgpHover } from './hover/hover';\nexport { ngpHover } from './hover/hover-interaction';\nexport { ngpInteractions } from './interactions/interactions';\nexport { NgpMove, NgpMoveEvent } from './move/move';\nexport { NgpPress } from './press/press';\nexport { ngpPress } from './press/press-interaction';\n\n/**\n * @deprecated use `ngpInteractions` instead\n */\nexport { ngpInteractions as setupInteractions };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAeO,MAAM,yBAAyB,GAA0B;AAC9D,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,KAAK,EAAE,IAAI;CACZ;AAEM,MAAM,0BAA0B,GAAG,IAAI,cAAc,CAC1D,4BAA4B,CAC7B;AAED;;;;AAIG;AACG,SAAU,yBAAyB,CAAC,MAAsC,EAAA;IAC9E,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,0BAA0B;AACnC,YAAA,QAAQ,EAAE,EAAE,GAAG,yBAAyB,EAAE,GAAG,MAAM,EAAE;AACtD,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,wBAAwB,GAAA;AACtC,IAAA,OAAO,MAAM,CAAC,0BAA0B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,yBAAyB;AAC5F;SAEgB,cAAc,GAAA;AAC5B,IAAA,MAAM,MAAM,GAAG,wBAAwB,EAAE;IACzC,OAAO,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK;AAC3C;SAEgB,cAAc,GAAA;AAC5B,IAAA,MAAM,MAAM,GAAG,wBAAwB,EAAE;IACzC,OAAO,CAAC,MAAM,CAAC,QAAQ,IAAI,CAA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;kGAAR,QAAQ,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,eAAA,EAAA,QAAA,EAAA,aAAA,EAAA,WAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAJpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,UAAU;AACrB,iBAAA;;;ACZD;;ACAA;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, Injectable, Directive, effect, untracked, CSP_NONCE,
|
|
3
|
-
import { isPlatformBrowser, isPlatformServer } from '@angular/common';
|
|
2
|
+
import { inject, ElementRef, Injectable, Directive, effect, untracked, CSP_NONCE, PLATFORM_ID, signal, Injector, DestroyRef } from '@angular/core';
|
|
3
|
+
import { DOCUMENT, isPlatformBrowser, isPlatformServer } from '@angular/common';
|
|
4
4
|
import { isUndefined, safeTakeUntilDestroyed } from 'ng-primitives/utils';
|
|
5
5
|
import { Observable, merge } from 'rxjs';
|
|
6
6
|
import { map } from 'rxjs/operators';
|
|
@@ -222,9 +222,10 @@ function injectStyleInjector() {
|
|
|
222
222
|
* @returns The resize event as an Observable.
|
|
223
223
|
*/
|
|
224
224
|
function fromResizeEvent(element, { disabled = signal(false), injector } = {}) {
|
|
225
|
+
const platformId = injector?.get(PLATFORM_ID) ?? inject(PLATFORM_ID);
|
|
225
226
|
return new Observable(observable => {
|
|
226
227
|
// ResizeObserver may not be available in all environments, so check for its existence
|
|
227
|
-
if (isUndefined(window?.ResizeObserver)) {
|
|
228
|
+
if (isPlatformServer(platformId) || isUndefined(window?.ResizeObserver)) {
|
|
228
229
|
// ResizeObserver is not available (SSR or unsupported browser)
|
|
229
230
|
// Complete the observable without emitting any values
|
|
230
231
|
observable.complete();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-internal.mjs","sources":["../../../../packages/ng-primitives/internal/src/utilities/element-ref.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation-manager.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation.ts","../../../../packages/ng-primitives/internal/src/signals/explicit-effect.ts","../../../../packages/ng-primitives/internal/src/style-injector/style-injector.ts","../../../../packages/ng-primitives/internal/src/utilities/resize.ts","../../../../packages/ng-primitives/internal/src/utilities/dom-removal.ts","../../../../packages/ng-primitives/internal/src/utilities/mutation-observer.ts","../../../../packages/ng-primitives/internal/src/utilities/overflow.ts","../../../../packages/ng-primitives/internal/src/utilities/scrolling.ts","../../../../packages/ng-primitives/internal/src/ng-primitives-internal.ts"],"sourcesContent":["import { ElementRef, inject } from '@angular/core';\n\n/**\n * A simple utility function to inject an element reference with less boilerplate.\n * @returns The element reference.\n */\nexport function injectElementRef<T extends HTMLElement>(): ElementRef<T> {\n return inject(ElementRef);\n}\n","import { ClassProvider, inject, Injectable } from '@angular/core';\nimport type { NgpExitAnimation } from './exit-animation';\n\n@Injectable()\nexport class NgpExitAnimationManager {\n /** Store the instances of the exit animation directive. */\n private readonly instances: NgpExitAnimation[] = [];\n\n /** Add an instance to the manager. */\n add(instance: NgpExitAnimation): void {\n this.instances.push(instance);\n }\n\n /** Remove an instance from the manager. */\n remove(instance: NgpExitAnimation): void {\n const index = this.instances.indexOf(instance);\n if (index !== -1) {\n this.instances.splice(index, 1);\n }\n }\n\n /** Exit all instances. */\n async exit(): Promise<void> {\n await Promise.all(this.instances.map(instance => instance.exit()));\n }\n}\n\nexport function provideExitAnimationManager(): ClassProvider {\n return { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager };\n}\n\nexport function injectExitAnimationManager(): NgpExitAnimationManager {\n return inject(NgpExitAnimationManager);\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { injectElementRef } from '../utilities/element-ref';\nimport { injectExitAnimationManager } from './exit-animation-manager';\n\n@Directive({\n selector: '[ngpExitAnimation]',\n exportAs: 'ngpExitAnimation',\n})\nexport class NgpExitAnimation implements OnDestroy {\n /** The animation manager. */\n private readonly animationManager = injectExitAnimationManager();\n /** Access the element reference. */\n protected readonly elementRef = injectElementRef();\n\n /** Exist animation reference. */\n protected readonly ref = setupExitAnimation({ element: this.elementRef.nativeElement });\n\n constructor() {\n this.animationManager.add(this);\n }\n\n ngOnDestroy(): void {\n this.animationManager.remove(this);\n }\n\n /** Mark the element as exiting. */\n async exit(): Promise<void> {\n await this.ref.exit();\n }\n}\n\ninterface NgpExitAnimationOptions {\n /** The element to animate. */\n element: HTMLElement;\n}\n\nexport interface NgpExitAnimationRef {\n /** Mark the element as exiting and wait for the animation to finish. */\n exit: () => Promise<void>;\n}\n\nexport function setupExitAnimation({ element }: NgpExitAnimationOptions): NgpExitAnimationRef {\n let state: 'enter' | 'exit' = 'enter';\n\n function setState(newState: 'enter' | 'exit') {\n state = newState;\n\n // remove all current animation state attributes\n element.removeAttribute('data-enter');\n element.removeAttribute('data-exit');\n\n // add the new animation state attribute\n if (state === 'enter') {\n element.setAttribute('data-enter', '');\n } else if (state === 'exit') {\n element.setAttribute('data-exit', '');\n }\n }\n\n // Set the initial state to 'enter'\n requestAnimationFrame(() => setState('enter'));\n\n return {\n exit: () => {\n return new Promise((resolve, reject) => {\n setState('exit');\n\n const animations = element.getAnimations();\n\n // Wait for the exit animations to finish\n if (animations.length > 0) {\n Promise.all(animations.map(anim => anim.finished))\n .then(() => resolve())\n .catch(err => {\n if (err instanceof Error && err.name !== 'AbortError') {\n return reject(err);\n }\n // Ignore abort errors as they are expected when the animation is interrupted\n // by the removal of the element - e.g. when the user navigates away to another page\n resolve();\n });\n } else {\n resolve();\n }\n });\n },\n };\n}\n","/**\n * This implementation is heavily inspired by the great work on ngextension!\n * https://github.com/ngxtension/ngxtension-platform/blob/main/libs/ngxtension/explicit-effect/src/explicit-effect.ts\n */\nimport {\n CreateEffectOptions,\n EffectCleanupRegisterFn,\n EffectRef,\n effect,\n untracked,\n} from '@angular/core';\n\n/**\n * We want to have the Tuple in order to use the types in the function signature\n */\ntype ExplicitEffectValues<T> = {\n [K in keyof T]: () => T[K];\n};\n\n/**\n * This explicit effect function will take the dependencies and the function to run when the dependencies change.\n * @param deps - The dependencies that the effect will run on\n * @param fn - The function to run when the dependencies change\n * @param options - The options for the effect with the addition of defer (it allows the computation to run on first change, not immediately)\n */\nexport function explicitEffect<Input extends readonly unknown[], Params = Input>(\n deps: readonly [...ExplicitEffectValues<Input>],\n fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void,\n options?: CreateEffectOptions,\n): EffectRef {\n return effect(onCleanup => {\n const depValues = deps.map(s => s());\n untracked(() => fn(depValues as Params, onCleanup));\n }, options);\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport { CSP_NONCE, inject, Injectable, PLATFORM_ID, DOCUMENT } from '@angular/core';\n\n/**\n * A utility service for injecting styles into the document.\n * Angular doesn't allow directives to specify styles, only components.\n * As we ship directives, occasionally we need to associate styles with them.\n * This service allows us to programmatically inject styles into the document.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class StyleInjector {\n /**\n * Access the CSP nonce\n */\n private readonly cspNonce = inject(CSP_NONCE, { optional: true });\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Detect the platform.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n /**\n * Store the map of style elements with their unique identifiers.\n */\n private readonly styleElements = new Map<string, HTMLStyleElement>();\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n this.collectServerStyles();\n }\n }\n\n /**\n * Inject a style into the document.\n * @param id The unique identifier for the style.\n * @param style The style to inject.\n */\n add(id: string, style: string): void {\n if (this.styleElements.has(id)) {\n return;\n }\n\n const styleElement = this.document.createElement('style');\n styleElement.setAttribute('data-ngp-style', id);\n styleElement.textContent = style;\n\n // If a CSP nonce is provided, set it on the style element\n if (this.cspNonce) {\n styleElement.setAttribute('nonce', this.cspNonce);\n }\n\n this.document.head.appendChild(styleElement);\n this.styleElements.set(id, styleElement);\n }\n\n /**\n * Remove a style from the document.\n * @param id The unique identifier for the style.\n */\n remove(id: string): void {\n const styleElement = this.styleElements.get(id);\n\n if (styleElement) {\n this.document.head.removeChild(styleElement);\n this.styleElements.delete(id);\n }\n }\n\n /**\n * Collect any styles that were rendered by the server.\n */\n private collectServerStyles(): void {\n const styleElements = this.document.querySelectorAll<HTMLStyleElement>('style[data-ngp-style]');\n\n styleElements.forEach(styleElement => {\n const id = styleElement.getAttribute('data-ngp-style');\n\n if (id) {\n this.styleElements.set(id, styleElement);\n }\n });\n }\n}\n\nexport function injectStyleInjector(): StyleInjector {\n return inject(StyleInjector);\n}\n","import { DestroyRef, effect, inject, Injector, signal, Signal, untracked } from '@angular/core';\nimport { isUndefined, safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { Observable, Subscription } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { explicitEffect } from '../signals/explicit-effect';\nimport { injectElementRef } from './element-ref';\n\ninterface NgpResizeObserverOptions {\n /**\n * Whether to listen for events.\n */\n disabled?: Signal<boolean>;\n\n /**\n * The injector to use when called from outside of the injector context.\n */\n injector?: Injector;\n}\n\n/**\n * A simple helper function to create a resize observer as an RxJS Observable.\n * @param element The element to observe for resize events.\n * @returns The resize event as an Observable.\n */\nexport function fromResizeEvent(\n element: HTMLElement,\n { disabled = signal(false), injector }: NgpResizeObserverOptions = {},\n): Observable<Dimensions> {\n return new Observable(observable => {\n // ResizeObserver may not be available in all environments, so check for its existence\n if (isUndefined(window?.ResizeObserver)) {\n // ResizeObserver is not available (SSR or unsupported browser)\n // Complete the observable without emitting any values\n observable.complete();\n return;\n }\n\n let observer: ResizeObserver | null = null;\n\n function setupOrTeardownObserver() {\n if (disabled()) {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n return;\n }\n\n if (!observer) {\n observer = new ResizeObserver(entries => {\n // if there are no entries, ignore the event\n if (!entries.length) {\n return;\n }\n\n // otherwise, take the first entry and emit the dimensions\n const entry = entries[0];\n\n let width: number, height: number;\n\n if ('borderBoxSize' in entry) {\n const borderSizeEntry = entry['borderBoxSize'];\n // this may be different across browsers so normalize it\n const borderSize = Array.isArray(borderSizeEntry)\n ? borderSizeEntry[0]\n : borderSizeEntry;\n\n width = borderSize['inlineSize'];\n height = borderSize['blockSize'];\n } else {\n // fallback for browsers that don't support borderBoxSize\n width = element.offsetWidth;\n height = element.offsetHeight;\n }\n\n // For inline elements, ResizeObserver may report 0,0 dimensions\n // Use getBoundingClientRect as fallback for inline elements with zero dimensions\n if ((width === 0 || height === 0) && getComputedStyle(element).display === 'inline') {\n const rect = element.getBoundingClientRect();\n width = rect.width;\n height = rect.height;\n }\n\n observable.next({ width, height });\n });\n\n observer.observe(element);\n }\n }\n\n setupOrTeardownObserver();\n\n explicitEffect([disabled], () => setupOrTeardownObserver(), { injector });\n\n return () => observer?.disconnect();\n });\n}\n\n/**\n * A utility function to observe any element for resize events and return the dimensions as a signal.\n */\nexport function observeResize(elementFn: () => HTMLElement | undefined): Signal<Dimensions> {\n const dimensions = signal<Dimensions>({ width: 0, height: 0 });\n const injector = inject(Injector);\n const destroyRef = inject(DestroyRef);\n\n // store the subscription to the resize event\n let subscription: Subscription | null = null;\n\n effect(() => {\n const targetElement = elementFn();\n\n untracked(() => {\n if (!targetElement) {\n return;\n }\n\n // if we already have a subscription, unsubscribe from it\n subscription?.unsubscribe();\n\n // create a new subscription to the resize event\n subscription = fromResizeEvent(targetElement, { injector })\n .pipe(safeTakeUntilDestroyed(destroyRef))\n .subscribe(event => dimensions.set({ width: event.width, height: event.height }));\n });\n });\n\n return dimensions;\n}\n\nexport interface Dimensions {\n width: number;\n height: number;\n}\n\n/**\n * A simple utility to get the dimensions of an element as a signal.\n */\nexport function injectDimensions(): Signal<Dimensions> {\n const elementRef = injectElementRef<HTMLElement>();\n const destroyRef = inject(DestroyRef);\n const dimensions = signal<Dimensions>({ width: 0, height: 0 });\n\n fromResizeEvent(elementRef.nativeElement)\n .pipe(\n safeTakeUntilDestroyed(destroyRef),\n map(({ width, height }) => ({ width, height })),\n )\n .subscribe(event => dimensions.set(event));\n\n return dimensions;\n}\n","import { isPlatformServer } from '@angular/common';\nimport { inject, PLATFORM_ID } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { fromResizeEvent } from './resize';\n\n/**\n * Whenever an element is removed from the DOM, we call the callback.\n * @param element The element to watch for removal.\n * @param callback The callback to call when the element is removed.\n */\nexport function onDomRemoval(element: HTMLElement, callback: () => void): void {\n const platform = inject(PLATFORM_ID);\n\n // Dont run this on the server\n if (isPlatformServer(platform)) {\n return;\n }\n\n // This is a bit of a hack, but it works. If the element dimensions become zero,\n // it's likely that the element has been removed from the DOM.\n fromResizeEvent(element)\n .pipe(safeTakeUntilDestroyed())\n .subscribe(dimensions => {\n // we check the dimensions first to short-circuit the check as it's faster\n if (dimensions.width === 0 && dimensions.height === 0 && !document.body.contains(element)) {\n callback();\n }\n });\n}\n","import { Injector, Signal, signal } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { explicitEffect } from '../signals/explicit-effect';\n\ninterface NgpMutationObserverOptions {\n /**\n * Whether to listen for events.\n */\n disabled?: Signal<boolean>;\n /**\n * The injector to use when called from outside of the injector context.\n */\n injector?: Injector;\n /**\n * Whether the childList should be observed.\n */\n childList?: boolean;\n /**\n * Whether the subtree should be observed.\n */\n subtree?: boolean;\n /**\n * Whether the attributes should be observed.\n */\n attributes?: boolean;\n /**\n * Whether the characterData should be observed.\n */\n characterData?: boolean;\n /**\n * Whether the attributeFilter should be observed.\n */\n attributeFilter?: string[];\n}\n\n/**\n * This function sets up a mutation observer to listen for changes in the DOM.\n * It will stop listening when the `disabled` signal is true, and re-enable when it is false.\n * @param options - Options for the mutation observer\n */\nexport function fromMutationObserver(\n element: HTMLElement,\n {\n childList,\n subtree,\n attributes,\n characterData,\n disabled = signal(false),\n injector,\n }: NgpMutationObserverOptions = {},\n): Observable<MutationRecord[]> {\n return new Observable<MutationRecord[]>(observable => {\n let observer: MutationObserver | null = null;\n\n function setupOrTeardownObserver() {\n if (disabled()) {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n return;\n }\n\n observer = new MutationObserver(mutations => observable.next(mutations));\n observer.observe(element, { childList, subtree, attributes, characterData });\n }\n\n setupOrTeardownObserver();\n\n // any time the disabled state changes, we need to re-evaluate the observer\n explicitEffect([disabled], () => setupOrTeardownObserver(), { injector });\n\n return () => observer?.disconnect();\n });\n}\n","import { DestroyRef, inject, Injector, Signal, signal } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { merge } from 'rxjs';\nimport { fromMutationObserver } from './mutation-observer';\nimport { fromResizeEvent } from './resize';\n\ninterface NgpOverflowListenerOptions {\n /**\n * Whether to listen for overflow changes.\n */\n disabled?: Signal<boolean>;\n /**\n * The injector to use when called from outside of the injector context.\n */\n injector?: Injector;\n}\n\nexport function setupOverflowListener(\n element: HTMLElement,\n { disabled = signal(false), injector }: NgpOverflowListenerOptions,\n): Signal<boolean> {\n const hasOverflow = signal<boolean>(false);\n const destroyRef = injector?.get(DestroyRef) ?? inject(DestroyRef);\n\n // Merge both observables and update hasOverflow on any event\n\n merge(\n fromResizeEvent(element, { disabled, injector }),\n fromMutationObserver(element, { disabled, injector, characterData: true }),\n )\n .pipe(safeTakeUntilDestroyed(destroyRef))\n .subscribe(() =>\n hasOverflow.set(\n element.scrollWidth > element.clientWidth || element.scrollHeight > element.clientHeight,\n ),\n );\n\n return hasOverflow;\n}\n","function getScrollableAncestor(element: HTMLElement): HTMLElement | null {\n let parent = element.parentElement;\n while (parent) {\n const style = window.getComputedStyle(parent);\n if (/(auto|scroll)/.test(style.overflowY) || /(auto|scroll)/.test(style.overflowX)) {\n return parent;\n }\n parent = parent.parentElement;\n }\n return null;\n}\n\nexport function scrollIntoViewIfNeeded(element: HTMLElement): void {\n const scrollableAncestor = getScrollableAncestor(element);\n if (!scrollableAncestor) return;\n\n const parentRect = scrollableAncestor.getBoundingClientRect();\n const elementRect = element.getBoundingClientRect();\n\n if (elementRect.top < parentRect.top) {\n scrollableAncestor.scrollTop -= parentRect.top - elementRect.top;\n } else if (elementRect.bottom > parentRect.bottom) {\n scrollableAncestor.scrollTop += elementRect.bottom - parentRect.bottom;\n }\n\n if (elementRect.left < parentRect.left) {\n scrollableAncestor.scrollLeft -= parentRect.left - elementRect.left;\n } else if (elementRect.right > parentRect.right) {\n scrollableAncestor.scrollLeft += elementRect.right - parentRect.right;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B;;MCJa,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;;QAGmB,IAAA,CAAA,SAAS,GAAuB,EAAE;AAmBpD,IAAA;;AAhBC,IAAA,GAAG,CAAC,QAA0B,EAAA;AAC5B,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC/B;;AAGA,IAAA,MAAM,CAAC,QAA0B,EAAA;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC9C,QAAA,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YAChB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QACjC;IACF;;AAGA,IA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,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;IAClE;SAAO,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE;QACjD,kBAAkB,CAAC,SAAS,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM;IACxE;IAEA,IAAI,WAAW,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE;QACtC,kBAAkB,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;IACrE;SAAO,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE;QAC/C,kBAAkB,CAAC,UAAU,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK;IACvE;AACF;;AC9BA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-internal.mjs","sources":["../../../../packages/ng-primitives/internal/src/utilities/element-ref.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation-manager.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation.ts","../../../../packages/ng-primitives/internal/src/signals/explicit-effect.ts","../../../../packages/ng-primitives/internal/src/style-injector/style-injector.ts","../../../../packages/ng-primitives/internal/src/utilities/resize.ts","../../../../packages/ng-primitives/internal/src/utilities/dom-removal.ts","../../../../packages/ng-primitives/internal/src/utilities/mutation-observer.ts","../../../../packages/ng-primitives/internal/src/utilities/overflow.ts","../../../../packages/ng-primitives/internal/src/utilities/scrolling.ts","../../../../packages/ng-primitives/internal/src/ng-primitives-internal.ts"],"sourcesContent":["import { ElementRef, inject } from '@angular/core';\n\n/**\n * A simple utility function to inject an element reference with less boilerplate.\n * @returns The element reference.\n */\nexport function injectElementRef<T extends HTMLElement>(): ElementRef<T> {\n return inject(ElementRef);\n}\n","import { ClassProvider, inject, Injectable } from '@angular/core';\nimport type { NgpExitAnimation } from './exit-animation';\n\n@Injectable()\nexport class NgpExitAnimationManager {\n /** Store the instances of the exit animation directive. */\n private readonly instances: NgpExitAnimation[] = [];\n\n /** Add an instance to the manager. */\n add(instance: NgpExitAnimation): void {\n this.instances.push(instance);\n }\n\n /** Remove an instance from the manager. */\n remove(instance: NgpExitAnimation): void {\n const index = this.instances.indexOf(instance);\n if (index !== -1) {\n this.instances.splice(index, 1);\n }\n }\n\n /** Exit all instances. */\n async exit(): Promise<void> {\n await Promise.all(this.instances.map(instance => instance.exit()));\n }\n}\n\nexport function provideExitAnimationManager(): ClassProvider {\n return { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager };\n}\n\nexport function injectExitAnimationManager(): NgpExitAnimationManager {\n return inject(NgpExitAnimationManager);\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { injectElementRef } from '../utilities/element-ref';\nimport { injectExitAnimationManager } from './exit-animation-manager';\n\n@Directive({\n selector: '[ngpExitAnimation]',\n exportAs: 'ngpExitAnimation',\n})\nexport class NgpExitAnimation implements OnDestroy {\n /** The animation manager. */\n private readonly animationManager = injectExitAnimationManager();\n /** Access the element reference. */\n protected readonly elementRef = injectElementRef();\n\n /** Exist animation reference. */\n protected readonly ref = setupExitAnimation({ element: this.elementRef.nativeElement });\n\n constructor() {\n this.animationManager.add(this);\n }\n\n ngOnDestroy(): void {\n this.animationManager.remove(this);\n }\n\n /** Mark the element as exiting. */\n async exit(): Promise<void> {\n await this.ref.exit();\n }\n}\n\ninterface NgpExitAnimationOptions {\n /** The element to animate. */\n element: HTMLElement;\n}\n\nexport interface NgpExitAnimationRef {\n /** Mark the element as exiting and wait for the animation to finish. */\n exit: () => Promise<void>;\n}\n\nexport function setupExitAnimation({ element }: NgpExitAnimationOptions): NgpExitAnimationRef {\n let state: 'enter' | 'exit' = 'enter';\n\n function setState(newState: 'enter' | 'exit') {\n state = newState;\n\n // remove all current animation state attributes\n element.removeAttribute('data-enter');\n element.removeAttribute('data-exit');\n\n // add the new animation state attribute\n if (state === 'enter') {\n element.setAttribute('data-enter', '');\n } else if (state === 'exit') {\n element.setAttribute('data-exit', '');\n }\n }\n\n // Set the initial state to 'enter'\n requestAnimationFrame(() => setState('enter'));\n\n return {\n exit: () => {\n return new Promise((resolve, reject) => {\n setState('exit');\n\n const animations = element.getAnimations();\n\n // Wait for the exit animations to finish\n if (animations.length > 0) {\n Promise.all(animations.map(anim => anim.finished))\n .then(() => resolve())\n .catch(err => {\n if (err instanceof Error && err.name !== 'AbortError') {\n return reject(err);\n }\n // Ignore abort errors as they are expected when the animation is interrupted\n // by the removal of the element - e.g. when the user navigates away to another page\n resolve();\n });\n } else {\n resolve();\n }\n });\n },\n };\n}\n","/**\n * This implementation is heavily inspired by the great work on ngextension!\n * https://github.com/ngxtension/ngxtension-platform/blob/main/libs/ngxtension/explicit-effect/src/explicit-effect.ts\n */\nimport {\n CreateEffectOptions,\n EffectCleanupRegisterFn,\n EffectRef,\n effect,\n untracked,\n} from '@angular/core';\n\n/**\n * We want to have the Tuple in order to use the types in the function signature\n */\ntype ExplicitEffectValues<T> = {\n [K in keyof T]: () => T[K];\n};\n\n/**\n * This explicit effect function will take the dependencies and the function to run when the dependencies change.\n * @param deps - The dependencies that the effect will run on\n * @param fn - The function to run when the dependencies change\n * @param options - The options for the effect with the addition of defer (it allows the computation to run on first change, not immediately)\n */\nexport function explicitEffect<Input extends readonly unknown[], Params = Input>(\n deps: readonly [...ExplicitEffectValues<Input>],\n fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void,\n options?: CreateEffectOptions,\n): EffectRef {\n return effect(onCleanup => {\n const depValues = deps.map(s => s());\n untracked(() => fn(depValues as Params, onCleanup));\n }, options);\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { CSP_NONCE, inject, Injectable, PLATFORM_ID } from '@angular/core';\n\n/**\n * A utility service for injecting styles into the document.\n * Angular doesn't allow directives to specify styles, only components.\n * As we ship directives, occasionally we need to associate styles with them.\n * This service allows us to programmatically inject styles into the document.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class StyleInjector {\n /**\n * Access the CSP nonce\n */\n private readonly cspNonce = inject(CSP_NONCE, { optional: true });\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Detect the platform.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n /**\n * Store the map of style elements with their unique identifiers.\n */\n private readonly styleElements = new Map<string, HTMLStyleElement>();\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n this.collectServerStyles();\n }\n }\n\n /**\n * Inject a style into the document.\n * @param id The unique identifier for the style.\n * @param style The style to inject.\n */\n add(id: string, style: string): void {\n if (this.styleElements.has(id)) {\n return;\n }\n\n const styleElement = this.document.createElement('style');\n styleElement.setAttribute('data-ngp-style', id);\n styleElement.textContent = style;\n\n // If a CSP nonce is provided, set it on the style element\n if (this.cspNonce) {\n styleElement.setAttribute('nonce', this.cspNonce);\n }\n\n this.document.head.appendChild(styleElement);\n this.styleElements.set(id, styleElement);\n }\n\n /**\n * Remove a style from the document.\n * @param id The unique identifier for the style.\n */\n remove(id: string): void {\n const styleElement = this.styleElements.get(id);\n\n if (styleElement) {\n this.document.head.removeChild(styleElement);\n this.styleElements.delete(id);\n }\n }\n\n /**\n * Collect any styles that were rendered by the server.\n */\n private collectServerStyles(): void {\n const styleElements = this.document.querySelectorAll<HTMLStyleElement>('style[data-ngp-style]');\n\n styleElements.forEach(styleElement => {\n const id = styleElement.getAttribute('data-ngp-style');\n\n if (id) {\n this.styleElements.set(id, styleElement);\n }\n });\n }\n}\n\nexport function injectStyleInjector(): StyleInjector {\n return inject(StyleInjector);\n}\n","import { isPlatformServer } from '@angular/common';\nimport {\n DestroyRef,\n effect,\n inject,\n Injector,\n PLATFORM_ID,\n signal,\n Signal,\n untracked,\n} from '@angular/core';\nimport { isUndefined, safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { Observable, Subscription } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { explicitEffect } from '../signals/explicit-effect';\nimport { injectElementRef } from './element-ref';\n\ninterface NgpResizeObserverOptions {\n /**\n * Whether to listen for events.\n */\n disabled?: Signal<boolean>;\n\n /**\n * The injector to use when called from outside of the injector context.\n */\n injector?: Injector;\n}\n\n/**\n * A simple helper function to create a resize observer as an RxJS Observable.\n * @param element The element to observe for resize events.\n * @returns The resize event as an Observable.\n */\nexport function fromResizeEvent(\n element: HTMLElement,\n { disabled = signal(false), injector }: NgpResizeObserverOptions = {},\n): Observable<Dimensions> {\n const platformId = injector?.get(PLATFORM_ID) ?? inject(PLATFORM_ID);\n\n return new Observable(observable => {\n // ResizeObserver may not be available in all environments, so check for its existence\n if (isPlatformServer(platformId) || isUndefined(window?.ResizeObserver)) {\n // ResizeObserver is not available (SSR or unsupported browser)\n // Complete the observable without emitting any values\n observable.complete();\n return;\n }\n\n let observer: ResizeObserver | null = null;\n\n function setupOrTeardownObserver() {\n if (disabled()) {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n return;\n }\n\n if (!observer) {\n observer = new ResizeObserver(entries => {\n // if there are no entries, ignore the event\n if (!entries.length) {\n return;\n }\n\n // otherwise, take the first entry and emit the dimensions\n const entry = entries[0];\n\n let width: number, height: number;\n\n if ('borderBoxSize' in entry) {\n const borderSizeEntry = entry['borderBoxSize'];\n // this may be different across browsers so normalize it\n const borderSize = Array.isArray(borderSizeEntry)\n ? borderSizeEntry[0]\n : borderSizeEntry;\n\n width = borderSize['inlineSize'];\n height = borderSize['blockSize'];\n } else {\n // fallback for browsers that don't support borderBoxSize\n width = element.offsetWidth;\n height = element.offsetHeight;\n }\n\n // For inline elements, ResizeObserver may report 0,0 dimensions\n // Use getBoundingClientRect as fallback for inline elements with zero dimensions\n if ((width === 0 || height === 0) && getComputedStyle(element).display === 'inline') {\n const rect = element.getBoundingClientRect();\n width = rect.width;\n height = rect.height;\n }\n\n observable.next({ width, height });\n });\n\n observer.observe(element);\n }\n }\n\n setupOrTeardownObserver();\n\n explicitEffect([disabled], () => setupOrTeardownObserver(), { injector });\n\n return () => observer?.disconnect();\n });\n}\n\n/**\n * A utility function to observe any element for resize events and return the dimensions as a signal.\n */\nexport function observeResize(elementFn: () => HTMLElement | undefined): Signal<Dimensions> {\n const dimensions = signal<Dimensions>({ width: 0, height: 0 });\n const injector = inject(Injector);\n const destroyRef = inject(DestroyRef);\n\n // store the subscription to the resize event\n let subscription: Subscription | null = null;\n\n effect(() => {\n const targetElement = elementFn();\n\n untracked(() => {\n if (!targetElement) {\n return;\n }\n\n // if we already have a subscription, unsubscribe from it\n subscription?.unsubscribe();\n\n // create a new subscription to the resize event\n subscription = fromResizeEvent(targetElement, { injector })\n .pipe(safeTakeUntilDestroyed(destroyRef))\n .subscribe(event => dimensions.set({ width: event.width, height: event.height }));\n });\n });\n\n return dimensions;\n}\n\nexport interface Dimensions {\n width: number;\n height: number;\n}\n\n/**\n * A simple utility to get the dimensions of an element as a signal.\n */\nexport function injectDimensions(): Signal<Dimensions> {\n const elementRef = injectElementRef<HTMLElement>();\n const destroyRef = inject(DestroyRef);\n const dimensions = signal<Dimensions>({ width: 0, height: 0 });\n\n fromResizeEvent(elementRef.nativeElement)\n .pipe(\n safeTakeUntilDestroyed(destroyRef),\n map(({ width, height }) => ({ width, height })),\n )\n .subscribe(event => dimensions.set(event));\n\n return dimensions;\n}\n","import { isPlatformServer } from '@angular/common';\nimport { inject, PLATFORM_ID } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { fromResizeEvent } from './resize';\n\n/**\n * Whenever an element is removed from the DOM, we call the callback.\n * @param element The element to watch for removal.\n * @param callback The callback to call when the element is removed.\n */\nexport function onDomRemoval(element: HTMLElement, callback: () => void): void {\n const platform = inject(PLATFORM_ID);\n\n // Dont run this on the server\n if (isPlatformServer(platform)) {\n return;\n }\n\n // This is a bit of a hack, but it works. If the element dimensions become zero,\n // it's likely that the element has been removed from the DOM.\n fromResizeEvent(element)\n .pipe(safeTakeUntilDestroyed())\n .subscribe(dimensions => {\n // we check the dimensions first to short-circuit the check as it's faster\n if (dimensions.width === 0 && dimensions.height === 0 && !document.body.contains(element)) {\n callback();\n }\n });\n}\n","import { Injector, Signal, signal } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { explicitEffect } from '../signals/explicit-effect';\n\ninterface NgpMutationObserverOptions {\n /**\n * Whether to listen for events.\n */\n disabled?: Signal<boolean>;\n /**\n * The injector to use when called from outside of the injector context.\n */\n injector?: Injector;\n /**\n * Whether the childList should be observed.\n */\n childList?: boolean;\n /**\n * Whether the subtree should be observed.\n */\n subtree?: boolean;\n /**\n * Whether the attributes should be observed.\n */\n attributes?: boolean;\n /**\n * Whether the characterData should be observed.\n */\n characterData?: boolean;\n /**\n * Whether the attributeFilter should be observed.\n */\n attributeFilter?: string[];\n}\n\n/**\n * This function sets up a mutation observer to listen for changes in the DOM.\n * It will stop listening when the `disabled` signal is true, and re-enable when it is false.\n * @param options - Options for the mutation observer\n */\nexport function fromMutationObserver(\n element: HTMLElement,\n {\n childList,\n subtree,\n attributes,\n characterData,\n disabled = signal(false),\n injector,\n }: NgpMutationObserverOptions = {},\n): Observable<MutationRecord[]> {\n return new Observable<MutationRecord[]>(observable => {\n let observer: MutationObserver | null = null;\n\n function setupOrTeardownObserver() {\n if (disabled()) {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n return;\n }\n\n observer = new MutationObserver(mutations => observable.next(mutations));\n observer.observe(element, { childList, subtree, attributes, characterData });\n }\n\n setupOrTeardownObserver();\n\n // any time the disabled state changes, we need to re-evaluate the observer\n explicitEffect([disabled], () => setupOrTeardownObserver(), { injector });\n\n return () => observer?.disconnect();\n });\n}\n","import { DestroyRef, inject, Injector, Signal, signal } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { merge } from 'rxjs';\nimport { fromMutationObserver } from './mutation-observer';\nimport { fromResizeEvent } from './resize';\n\ninterface NgpOverflowListenerOptions {\n /**\n * Whether to listen for overflow changes.\n */\n disabled?: Signal<boolean>;\n /**\n * The injector to use when called from outside of the injector context.\n */\n injector?: Injector;\n}\n\nexport function setupOverflowListener(\n element: HTMLElement,\n { disabled = signal(false), injector }: NgpOverflowListenerOptions,\n): Signal<boolean> {\n const hasOverflow = signal<boolean>(false);\n const destroyRef = injector?.get(DestroyRef) ?? inject(DestroyRef);\n\n // Merge both observables and update hasOverflow on any event\n\n merge(\n fromResizeEvent(element, { disabled, injector }),\n fromMutationObserver(element, { disabled, injector, characterData: true }),\n )\n .pipe(safeTakeUntilDestroyed(destroyRef))\n .subscribe(() =>\n hasOverflow.set(\n element.scrollWidth > element.clientWidth || element.scrollHeight > element.clientHeight,\n ),\n );\n\n return hasOverflow;\n}\n","function getScrollableAncestor(element: HTMLElement): HTMLElement | null {\n let parent = element.parentElement;\n while (parent) {\n const style = window.getComputedStyle(parent);\n if (/(auto|scroll)/.test(style.overflowY) || /(auto|scroll)/.test(style.overflowX)) {\n return parent;\n }\n parent = parent.parentElement;\n }\n return null;\n}\n\nexport function scrollIntoViewIfNeeded(element: HTMLElement): void {\n const scrollableAncestor = getScrollableAncestor(element);\n if (!scrollableAncestor) return;\n\n const parentRect = scrollableAncestor.getBoundingClientRect();\n const elementRect = element.getBoundingClientRect();\n\n if (elementRect.top < parentRect.top) {\n scrollableAncestor.scrollTop -= parentRect.top - elementRect.top;\n } else if (elementRect.bottom > parentRect.bottom) {\n scrollableAncestor.scrollTop += elementRect.bottom - parentRect.bottom;\n }\n\n if (elementRect.left < parentRect.left) {\n scrollableAncestor.scrollLeft -= parentRect.left - elementRect.left;\n } else if (elementRect.right > parentRect.right) {\n scrollableAncestor.scrollLeft += elementRect.right - parentRect.right;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B;;MCJa,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;;QAGmB,IAAA,CAAA,SAAS,GAAuB,EAAE;AAmBpD,IAAA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I,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;AAClF,YAAA,OAAO,MAAM;QACf;AACA,QAAA,MAAM,GAAG,MAAM,CAAC,aAAa;IAC/B;AACA,IAAA,OAAO,IAAI;AACb;AAEM,SAAU,sBAAsB,CAAC,OAAoB,EAAA;AACzD,IAAA,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,CAAC;AACzD,IAAA,IAAI,CAAC,kBAAkB;QAAE;AAEzB,IAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC,qBAAqB,EAAE;AAC7D,IAAA,MAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,EAAE;IAEnD,IAAI,WAAW,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,EAAE;QACpC,kBAAkB,CAAC,SAAS,IAAI,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;IAClE;SAAO,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE;QACjD,kBAAkB,CAAC,SAAS,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM;IACxE;IAEA,IAAI,WAAW,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE;QACtC,kBAAkB,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;IACrE;SAAO,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE;QAC/C,kBAAkB,CAAC,UAAU,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK;IACvE;AACF;;AC9BA;;AAEG;;;;"}
|
|
@@ -2,7 +2,8 @@ import { coerceNumberProperty, coerceCssPixelValue } from '@angular/cdk/coercion
|
|
|
2
2
|
import { isNil, isObject, isFunction, injectDisposables, uniqueId, safeTakeUntilDestroyed } from 'ng-primitives/utils';
|
|
3
3
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
4
4
|
import { ViewportRuler } from '@angular/cdk/overlay';
|
|
5
|
-
import {
|
|
5
|
+
import { DOCUMENT } from '@angular/common';
|
|
6
|
+
import { InjectionToken, inject, TemplateRef, DestroyRef, signal, computed, Injector, runInInjectionContext, afterRenderEffect } from '@angular/core';
|
|
6
7
|
import { autoUpdate, offset, shift, flip, arrow, computePosition } from '@floating-ui/dom';
|
|
7
8
|
import { setupExitAnimation, explicitEffect, fromResizeEvent, injectElementRef } from 'ng-primitives/internal';
|
|
8
9
|
import { Subject, fromEvent } from 'rxjs';
|