ng-primitives 0.57.0 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/button/button/button-state.d.ts +1 -11
  2. package/button/button/button.d.ts +0 -8
  3. package/button/index.d.ts +1 -1
  4. package/date-picker/date-picker-date-button/date-picker-date-button.d.ts +1 -2
  5. package/date-picker/date-picker-next-month/date-picker-next-month.d.ts +1 -2
  6. package/date-picker/date-picker-previous-month/date-picker-previous-month.d.ts +1 -2
  7. package/fesm2022/ng-primitives-button.mjs +5 -31
  8. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  9. package/fesm2022/ng-primitives-date-picker.mjs +7 -16
  10. package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
  11. package/fesm2022/ng-primitives-internal.mjs +43 -27
  12. package/fesm2022/ng-primitives-internal.mjs.map +1 -1
  13. package/fesm2022/ng-primitives-pagination.mjs +11 -22
  14. package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
  15. package/fesm2022/ng-primitives-tabs.mjs +2 -2
  16. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  17. package/fesm2022/ng-primitives-toggle-group.mjs +2 -2
  18. package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
  19. package/fesm2022/ng-primitives-toolbar.mjs +2 -2
  20. package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
  21. package/fesm2022/ng-primitives-utils.mjs +10 -1
  22. package/fesm2022/ng-primitives-utils.mjs.map +1 -1
  23. package/internal/index.d.ts +1 -1
  24. package/internal/interactions/button.d.ts +14 -0
  25. package/internal/utilities/interaction.d.ts +6 -0
  26. package/package.json +29 -29
  27. package/pagination/pagination-button/pagination-button.d.ts +1 -2
  28. package/pagination/pagination-first/pagination-first.d.ts +1 -2
  29. package/pagination/pagination-last/pagination-last.d.ts +1 -2
  30. package/pagination/pagination-next/pagination-next.d.ts +1 -2
  31. package/pagination/pagination-previous/pagination-previous.d.ts +1 -2
  32. package/schematics/ng-generate/templates/button/button.__fileSuffix@dasherize__.ts.template +44 -2
  33. package/utils/helpers/attributes.d.ts +2 -0
  34. package/utils/index.d.ts +2 -1
  35. package/internal/signals/sync-state.d.ts +0 -2
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, ElementRef, Injectable, Directive, Renderer2, signal, PLATFORM_ID, effect, untracked, CSP_NONCE } from '@angular/core';
3
+ import { safeTakeUntilDestroyed, onBooleanChange, injectDisposables, booleanAttributeBinding } from 'ng-primitives/utils';
3
4
  import { FocusMonitor } from '@angular/cdk/a11y';
4
- import { safeTakeUntilDestroyed, onBooleanChange, injectDisposables } from 'ng-primitives/utils';
5
5
  import { isPlatformServer, DOCUMENT, isPlatformBrowser } from '@angular/common';
6
6
  import { fromResizeEvent } from 'ng-primitives/resize';
7
7
 
@@ -119,6 +119,20 @@ function setupExitAnimation({ element }) {
119
119
  };
120
120
  }
121
121
 
122
+ /**
123
+ * This function checks to see if a given interaction has already been setup on a given element.
124
+ * If it has, it returns the existing interaction state.
125
+ * If it has not, it sets up the interaction state for future checks.
126
+ */
127
+ function hasInteraction(element, interaction) {
128
+ const hasInteraction = `__ngp-${interaction}` in element;
129
+ // if the interaction has not been setup, we mark it as setup for future checks
130
+ if (!hasInteraction) {
131
+ element[`__ngp-${interaction}`] = true;
132
+ }
133
+ return hasInteraction;
134
+ }
135
+
122
136
  function setupFocus({ focus, blur, focusWithin = false, disabled = signal(false), }) {
123
137
  /**
124
138
  * Access the element reference.
@@ -161,21 +175,10 @@ function setupFocus({ focus, blur, focusWithin = false, disabled = signal(false)
161
175
  }
162
176
 
163
177
  function setupFocusVisible({ focusChange, disabled = signal(false), }) {
164
- /**
165
- * Access the element that the directive is applied to.
166
- */
167
178
  const elementRef = inject(ElementRef);
168
- /**
169
- * Access the renderer.
170
- */
171
179
  const renderer = inject(Renderer2);
172
- /**
173
- * Access the focus monitor.
174
- */
175
180
  const focusMonitor = inject(FocusMonitor);
176
- /**
177
- * Whether the element is currently focused.
178
- */
181
+ // Whether the element is currently focused.
179
182
  const isFocused = signal(false);
180
183
  // handle focus state
181
184
  focusMonitor
@@ -433,13 +436,7 @@ function setupHover({ hoverStart, hoverEnd, disabled = signal(false), }) {
433
436
  }
434
437
 
435
438
  function setupPress({ pressStart, pressEnd, disabled = signal(false), }) {
436
- /**
437
- * Access the element reference.
438
- */
439
439
  const elementRef = inject(ElementRef);
440
- /**
441
- * Access the disposables helper.
442
- */
443
440
  const disposables = injectDisposables();
444
441
  /**
445
442
  * Whether the element is currently pressed.
@@ -502,6 +499,11 @@ function setupPress({ pressStart, pressEnd, disabled = signal(false), }) {
502
499
  * Setup the interactions without relying on HostDirectives.
503
500
  */
504
501
  function setupInteractions({ focus, hover, press, focusWithin, focusVisible, disabled = signal(false), }) {
502
+ const elementRef = injectElementRef();
503
+ // If the interaction has already been setup, we can skip the setup.
504
+ if (hasInteraction(elementRef.nativeElement, 'interactions')) {
505
+ return;
506
+ }
505
507
  if (hover) {
506
508
  setupHover({ disabled });
507
509
  }
@@ -516,6 +518,27 @@ function setupInteractions({ focus, hover, press, focusWithin, focusVisible, dis
516
518
  }
517
519
  }
518
520
 
521
+ /**
522
+ * Setup the button interactions and attributes.
523
+ *
524
+ * @param options - The options for the button.
525
+ */
526
+ function setupButton({ disabled }) {
527
+ const elementRef = injectElementRef();
528
+ // If the button interaction has already been setup, we can skip the setup.
529
+ if (hasInteraction(elementRef.nativeElement, 'button')) {
530
+ return;
531
+ }
532
+ const isButton = elementRef.nativeElement.tagName.toLowerCase() === 'button';
533
+ setupInteractions({ hover: true, press: true, focusVisible: true, disabled });
534
+ // add the the `data-disabled` attribute to the element
535
+ booleanAttributeBinding(elementRef.nativeElement, 'data-disabled', disabled);
536
+ // add the `disabled` attribute to the element if it is a button
537
+ if (isButton) {
538
+ booleanAttributeBinding(elementRef.nativeElement, 'disabled', disabled);
539
+ }
540
+ }
541
+
519
542
  /**
520
543
  * This implementation is heavily inspired by the great work on ngextension!
521
544
  * https://github.com/ngxtension/ngxtension-platform/blob/main/libs/ngxtension/explicit-effect/src/explicit-effect.ts
@@ -533,13 +556,6 @@ function explicitEffect(deps, fn, options) {
533
556
  }, options);
534
557
  }
535
558
 
536
- function syncState(source, target) {
537
- effect(() => {
538
- const sourceValue = source();
539
- untracked(() => target.set(sourceValue));
540
- });
541
- }
542
-
543
559
  /**
544
560
  * A utility service for injecting styles into the document.
545
561
  * Angular doesn't allow directives to specify styles, only components.
@@ -658,5 +674,5 @@ function scrollIntoViewIfNeeded(element) {
658
674
  * Generated bundle index. Do not edit.
659
675
  */
660
676
 
661
- export { NgpExitAnimation, NgpExitAnimationManager, StyleInjector, explicitEffect, injectElementRef, injectExitAnimationManager, injectStyleInjector, onDomRemoval, provideExitAnimationManager, scrollIntoViewIfNeeded, setupExitAnimation, setupFocus, setupFocusVisible, setupHover, setupInteractions, setupPress, syncState };
677
+ export { NgpExitAnimation, NgpExitAnimationManager, StyleInjector, explicitEffect, injectElementRef, injectExitAnimationManager, injectStyleInjector, onDomRemoval, provideExitAnimationManager, scrollIntoViewIfNeeded, setupButton, setupExitAnimation, setupFocus, setupFocusVisible, setupHover, setupInteractions, setupPress };
662
678
  //# sourceMappingURL=ng-primitives-internal.mjs.map
@@ -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/interactions/focus.ts","../../../../packages/ng-primitives/internal/src/interactions/focus-visible.ts","../../../../packages/ng-primitives/internal/src/utilities/dom-removal.ts","../../../../packages/ng-primitives/internal/src/interactions/hover.ts","../../../../packages/ng-primitives/internal/src/interactions/press.ts","../../../../packages/ng-primitives/internal/src/interactions/interactions.ts","../../../../packages/ng-primitives/internal/src/signals/explicit-effect.ts","../../../../packages/ng-primitives/internal/src/signals/sync-state.ts","../../../../packages/ng-primitives/internal/src/style-injector/style-injector.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 element.removeAttribute('inert');\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 // make the element inert to prevent interaction while exiting\n element.setAttribute('inert', '');\n }\n }\n\n // Set the initial state to 'enter'\n 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","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { ElementRef, Renderer2, Signal, inject, signal } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\n\nexport interface NgpFocusOptions {\n disabled?: Signal<boolean>;\n focusWithin?: boolean;\n focus?: () => void;\n blur?: () => void;\n}\n\nexport interface NgpFocusState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocus({\n focus,\n blur,\n focusWithin = false,\n disabled = signal(false),\n}: NgpFocusOptions): NgpFocusState {\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 (focus) {\n focus();\n }\n renderer.setAttribute(elementRef.nativeElement, 'data-focus', '');\n } else {\n if (blur) {\n blur();\n }\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus');\n }\n });\n\n return { isFocused };\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';\n\nexport interface NgpFocusVisibleOptions {\n disabled?: Signal<boolean>;\n focusChange?: (value: boolean) => void;\n}\n\nexport interface NgpFocusVisibleState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocusVisible({\n focusChange,\n disabled = signal(false),\n}: NgpFocusVisibleOptions): NgpFocusVisibleState {\n /**\n * Access the element that the directive is applied to.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Access the focus monitor.\n */\n const focusMonitor = inject(FocusMonitor);\n\n /**\n * Whether the element is currently focused.\n */\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);\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);\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) {\n if (isFocused() === value) {\n return;\n }\n\n isFocused.set(value);\n focusChange?.(value);\n\n if (value) {\n renderer.setAttribute(elementRef.nativeElement, 'data-focus-visible', '');\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 { isPlatformServer } from '@angular/common';\nimport { inject, PLATFORM_ID } from '@angular/core';\nimport { fromResizeEvent } from 'ng-primitives/resize';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\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 { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { effect, ElementRef, inject, Injectable, PLATFORM_ID, Signal, signal } from '@angular/core';\nimport { injectDisposables, onBooleanChange } from 'ng-primitives/utils';\nimport { onDomRemoval } from '../utilities/dom-removal';\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 NgpHoverOptions {\n disabled?: Signal<boolean>;\n hoverStart?: () => void;\n hoverEnd?: () => 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 */\nexport function setupHover({\n hoverStart,\n hoverEnd,\n disabled = signal(false),\n}: NgpHoverOptions): NgpHoverState {\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 * Access the disposable helper.\n */\n const disposables = injectDisposables();\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 disposables.addEventListener(elementRef.nativeElement, 'pointerenter', onPointerEnter);\n disposables.addEventListener(elementRef.nativeElement, 'pointerleave', onPointerLeave);\n disposables.addEventListener(elementRef.nativeElement, 'touchstart', onTouchStart);\n disposables.addEventListener(elementRef.nativeElement, 'mouseenter', onMouseEnter);\n disposables.addEventListener(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 effect(() =>\n hovered()\n ? elementRef.nativeElement.setAttribute('data-hover', '')\n : elementRef.nativeElement.removeAttribute('data-hover'),\n );\n\n /**\n * Reset the hover state.\n */\n function reset(): void {\n onHoverEnd('mouse');\n }\n\n /**\n * Trigger the hover start events.\n * @param event\n * @param pointerType\n */\n function onHoverStart(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 hoverStart?.();\n }\n\n /**\n * Trigger the hover end events.\n * @param pointerType\n */\n function onHoverEnd(pointerType: string): void {\n if (pointerType === 'touch' || !hovered()) {\n return;\n }\n\n hovered.set(false);\n hoverEnd?.();\n }\n\n function onPointerEnter(event: PointerEvent): void {\n if (globalPointerEvents.ignoreEmulatedMouseEvents && event.pointerType === 'mouse') {\n return;\n }\n\n onHoverStart(event, event.pointerType);\n }\n\n function onPointerLeave(event: PointerEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd(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 onHoverStart(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 onHoverEnd('mouse');\n }\n }\n\n return { hovered };\n}\n","import { ElementRef, Signal, effect, inject, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\ninterface NgpPressState {\n pressed: Signal<boolean>;\n}\n\ninterface NgpPressOptions {\n disabled?: Signal<boolean>;\n pressStart?: () => void;\n pressEnd?: () => void;\n}\n\nexport function setupPress({\n pressStart,\n pressEnd,\n disabled = signal(false),\n}: NgpPressOptions): NgpPressState {\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the disposables helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Whether the element is currently pressed.\n */\n const pressed = signal<boolean>(false);\n\n // setup event listeners\n disposables.addEventListener(elementRef.nativeElement, 'pointerdown', onPointerDown);\n\n // anytime the press state changes we want to update the attribute\n effect(() =>\n pressed() && !disabled()\n ? elementRef.nativeElement.setAttribute('data-press', '')\n : elementRef.nativeElement.removeAttribute('data-press'),\n );\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 pressEnd?.();\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 pressStart?.();\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 = disposables.addEventListener(\n ownerDocument,\n 'pointerup',\n () => reset(),\n false,\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 = disposables.addEventListener(\n ownerDocument,\n 'pointermove',\n () => onPointerMove as EventListener,\n false,\n );\n\n // if the pointer is cancelled, then we are no longer pressing on this element\n const pointerCancel = disposables.addEventListener(\n ownerDocument,\n 'pointercancel',\n () => reset(),\n false,\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 { setupFocus } from './focus';\nimport { setupFocusVisible } from './focus-visible';\nimport { setupHover } from './hover';\nimport { setupPress } from './press';\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 */\nexport function setupInteractions({\n focus,\n hover,\n press,\n focusWithin,\n focusVisible,\n disabled = signal(false),\n}: NgpInteractionOptions): void {\n if (hover) {\n setupHover({ disabled });\n }\n if (press) {\n setupPress({ disabled });\n }\n if (focus) {\n setupFocus({ focusWithin, disabled });\n }\n if (focusVisible) {\n setupFocusVisible({ disabled });\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 { effect, Signal, untracked, WritableSignal } from '@angular/core';\n\nexport function syncState<T>(source: Signal<T>, target: WritableSignal<T>) {\n effect(() => {\n const sourceValue = source();\n untracked(() => target.set(sourceValue));\n });\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","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,IAAS,CAAA,SAAA,GAAuB,EAAE;AAmBpD;;AAhBC,IAAA,GAAG,CAAC,QAA0B,EAAA;AAC5B,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;;;AAI/B,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;;;;AAKnC,IAAA,MAAM,IAAI,GAAA;QACR,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;;+GAnBzD,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAAvB,uBAAuB,EAAA,CAAA,CAAA;;4FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC;;SAwBe,2BAA2B,GAAA;IACzC,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,uBAAuB,EAAE;AAChF;SAEgB,0BAA0B,GAAA;AACxC,IAAA,OAAO,MAAM,CAAC,uBAAuB,CAAC;AACxC;;MCzBa,gBAAgB,CAAA;AAS3B,IAAA,WAAA,GAAA;;QAPiB,IAAgB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AAA,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;;SAC3D,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE;QACjD,kBAAkB,CAAC,SAAS,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM;;IAGxE,IAAI,WAAW,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE;QACtC,kBAAkB,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;;SAC9D,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE;QAC/C,kBAAkB,CAAC,UAAU,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK;;AAEzE;;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/utilities/interaction.ts","../../../../packages/ng-primitives/internal/src/interactions/focus.ts","../../../../packages/ng-primitives/internal/src/interactions/focus-visible.ts","../../../../packages/ng-primitives/internal/src/utilities/dom-removal.ts","../../../../packages/ng-primitives/internal/src/interactions/hover.ts","../../../../packages/ng-primitives/internal/src/interactions/press.ts","../../../../packages/ng-primitives/internal/src/interactions/interactions.ts","../../../../packages/ng-primitives/internal/src/interactions/button.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/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 element.removeAttribute('inert');\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 // make the element inert to prevent interaction while exiting\n element.setAttribute('inert', '');\n }\n }\n\n // Set the initial state to 'enter'\n 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 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 { FocusMonitor } from '@angular/cdk/a11y';\nimport { ElementRef, Renderer2, Signal, inject, signal } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\n\nexport interface NgpFocusOptions {\n disabled?: Signal<boolean>;\n focusWithin?: boolean;\n focus?: () => void;\n blur?: () => void;\n}\n\nexport interface NgpFocusState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocus({\n focus,\n blur,\n focusWithin = false,\n disabled = signal(false),\n}: NgpFocusOptions): NgpFocusState {\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 (focus) {\n focus();\n }\n renderer.setAttribute(elementRef.nativeElement, 'data-focus', '');\n } else {\n if (blur) {\n blur();\n }\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus');\n }\n });\n\n return { isFocused };\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';\n\nexport interface NgpFocusVisibleOptions {\n disabled?: Signal<boolean>;\n focusChange?: (value: boolean) => void;\n}\n\nexport interface NgpFocusVisibleState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocusVisible({\n focusChange,\n disabled = signal(false),\n}: NgpFocusVisibleOptions): NgpFocusVisibleState {\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);\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);\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) {\n if (isFocused() === value) {\n return;\n }\n\n isFocused.set(value);\n focusChange?.(value);\n\n if (value) {\n renderer.setAttribute(elementRef.nativeElement, 'data-focus-visible', '');\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 { isPlatformServer } from '@angular/common';\nimport { inject, PLATFORM_ID } from '@angular/core';\nimport { fromResizeEvent } from 'ng-primitives/resize';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\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 { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { effect, ElementRef, inject, Injectable, PLATFORM_ID, Signal, signal } from '@angular/core';\nimport { injectDisposables, onBooleanChange } from 'ng-primitives/utils';\nimport { onDomRemoval } from '../utilities/dom-removal';\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 NgpHoverOptions {\n disabled?: Signal<boolean>;\n hoverStart?: () => void;\n hoverEnd?: () => 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 */\nexport function setupHover({\n hoverStart,\n hoverEnd,\n disabled = signal(false),\n}: NgpHoverOptions): NgpHoverState {\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 * Access the disposable helper.\n */\n const disposables = injectDisposables();\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 disposables.addEventListener(elementRef.nativeElement, 'pointerenter', onPointerEnter);\n disposables.addEventListener(elementRef.nativeElement, 'pointerleave', onPointerLeave);\n disposables.addEventListener(elementRef.nativeElement, 'touchstart', onTouchStart);\n disposables.addEventListener(elementRef.nativeElement, 'mouseenter', onMouseEnter);\n disposables.addEventListener(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 effect(() =>\n hovered()\n ? elementRef.nativeElement.setAttribute('data-hover', '')\n : elementRef.nativeElement.removeAttribute('data-hover'),\n );\n\n /**\n * Reset the hover state.\n */\n function reset(): void {\n onHoverEnd('mouse');\n }\n\n /**\n * Trigger the hover start events.\n * @param event\n * @param pointerType\n */\n function onHoverStart(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 hoverStart?.();\n }\n\n /**\n * Trigger the hover end events.\n * @param pointerType\n */\n function onHoverEnd(pointerType: string): void {\n if (pointerType === 'touch' || !hovered()) {\n return;\n }\n\n hovered.set(false);\n hoverEnd?.();\n }\n\n function onPointerEnter(event: PointerEvent): void {\n if (globalPointerEvents.ignoreEmulatedMouseEvents && event.pointerType === 'mouse') {\n return;\n }\n\n onHoverStart(event, event.pointerType);\n }\n\n function onPointerLeave(event: PointerEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd(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 onHoverStart(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 onHoverEnd('mouse');\n }\n }\n\n return { hovered };\n}\n","import { ElementRef, Signal, effect, inject, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\ninterface NgpPressState {\n pressed: Signal<boolean>;\n}\n\ninterface NgpPressOptions {\n disabled?: Signal<boolean>;\n pressStart?: () => void;\n pressEnd?: () => void;\n}\n\nexport function setupPress({\n pressStart,\n pressEnd,\n disabled = signal(false),\n}: NgpPressOptions): NgpPressState {\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n const disposables = injectDisposables();\n\n /**\n * Whether the element is currently pressed.\n */\n const pressed = signal<boolean>(false);\n\n // setup event listeners\n disposables.addEventListener(elementRef.nativeElement, 'pointerdown', onPointerDown);\n\n // anytime the press state changes we want to update the attribute\n effect(() =>\n pressed() && !disabled()\n ? elementRef.nativeElement.setAttribute('data-press', '')\n : elementRef.nativeElement.removeAttribute('data-press'),\n );\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 pressEnd?.();\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 pressStart?.();\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 = disposables.addEventListener(\n ownerDocument,\n 'pointerup',\n () => reset(),\n false,\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 = disposables.addEventListener(\n ownerDocument,\n 'pointermove',\n () => onPointerMove as EventListener,\n false,\n );\n\n // if the pointer is cancelled, then we are no longer pressing on this element\n const pointerCancel = disposables.addEventListener(\n ownerDocument,\n 'pointercancel',\n () => reset(),\n false,\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 '../utilities/element-ref';\nimport { hasInteraction } from '../utilities/interaction';\nimport { setupFocus } from './focus';\nimport { setupFocusVisible } from './focus-visible';\nimport { setupHover } from './hover';\nimport { setupPress } from './press';\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 */\nexport function setupInteractions({\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 setupHover({ disabled });\n }\n if (press) {\n setupPress({ disabled });\n }\n if (focus) {\n setupFocus({ focusWithin, disabled });\n }\n if (focusVisible) {\n setupFocusVisible({ disabled });\n }\n}\n","import { Signal } from '@angular/core';\nimport { booleanAttributeBinding } from 'ng-primitives/utils';\nimport { injectElementRef } from '../utilities/element-ref';\nimport { hasInteraction } from '../utilities/interaction';\nimport { setupInteractions } from './interactions';\n\nexport interface NgpButtonOptions {\n /**\n * Whether the button is disabled.\n * @default false\n */\n disabled?: Signal<boolean>;\n}\n\n/**\n * Setup the button interactions and attributes.\n *\n * @param options - The options for the button.\n */\nexport function setupButton({ disabled }: NgpButtonOptions): void {\n const elementRef = injectElementRef();\n\n // If the button interaction has already been setup, we can skip the setup.\n if (hasInteraction(elementRef.nativeElement, 'button')) {\n return;\n }\n\n const isButton = elementRef.nativeElement.tagName.toLowerCase() === 'button';\n\n setupInteractions({ hover: true, press: true, focusVisible: true, disabled });\n\n // add the the `data-disabled` attribute to the element\n booleanAttributeBinding(elementRef.nativeElement, 'data-disabled', disabled);\n\n // add the `disabled` attribute to the element if it is a button\n if (isButton) {\n booleanAttributeBinding(elementRef.nativeElement, 'disabled', disabled);\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","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,IAAS,CAAA,SAAA,GAAuB,EAAE;AAmBpD;;AAhBC,IAAA,GAAG,CAAC,QAA0B,EAAA;AAC5B,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;;;AAI/B,IAAA,MAAM,CAAC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QAAA,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;AAClF,YAAA,OAAO,MAAM;;AAEf,QAAA,MAAM,GAAG,MAAM,CAAC,aAAa;;AAE/B,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;;SAC3D,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE;QACjD,kBAAkB,CAAC,SAAS,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM;;IAGxE,IAAI,WAAW,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE;QACtC,kBAAkB,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;;SAC9D,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE;QAC/C,kBAAkB,CAAC,UAAU,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK;;AAEzE;;AC9BA;;AAEG;;;;"}
@@ -1,7 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { input, numberAttribute, booleanAttribute, computed, HostListener, Directive, output } from '@angular/core';
3
- import * as i1 from 'ng-primitives/button';
4
- import { syncButton, NgpButton } from 'ng-primitives/button';
3
+ import { setupButton } from 'ng-primitives/internal';
5
4
  import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
6
5
 
7
6
  /**
@@ -52,7 +51,7 @@ class NgpPaginationButton {
52
51
  * Whether this page is the currently selected page.
53
52
  */
54
53
  this.selected = computed(() => this.page() === this.paginationState().page());
55
- syncButton({ disabled: this.disabled });
54
+ setupButton({ disabled: this.disabled });
56
55
  }
57
56
  /**
58
57
  * Go to the page this button represents.
@@ -73,17 +72,15 @@ class NgpPaginationButton {
73
72
  this.goToPage();
74
73
  }
75
74
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
76
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationButton, isStandalone: true, selector: "[ngpPaginationButton]", inputs: { page: { classPropertyName: "page", publicName: "ngpPaginationButtonPage", isSignal: true, isRequired: true, transformFunction: null }, buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationButtonDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-page": "page()", "attr.data-selected": "selected() ? \"\" : null", "attr.aria-current": "selected()" } }, exportAs: ["ngpPaginationButton"], hostDirectives: [{ directive: i1.NgpButton }], ngImport: i0 }); }
75
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationButton, isStandalone: true, selector: "[ngpPaginationButton]", inputs: { page: { classPropertyName: "page", publicName: "ngpPaginationButtonPage", isSignal: true, isRequired: true, transformFunction: null }, buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationButtonDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-page": "page()", "attr.data-selected": "selected() ? \"\" : null", "attr.aria-current": "selected()" } }, exportAs: ["ngpPaginationButton"], ngImport: i0 }); }
77
76
  }
78
77
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationButton, decorators: [{
79
78
  type: Directive,
80
79
  args: [{
81
80
  selector: '[ngpPaginationButton]',
82
81
  exportAs: 'ngpPaginationButton',
83
- hostDirectives: [NgpButton],
84
82
  host: {
85
83
  '[tabindex]': 'disabled() ? -1 : 0',
86
- '[attr.data-disabled]': 'disabled() ? "" : null',
87
84
  '[attr.data-page]': 'page()',
88
85
  '[attr.data-selected]': 'selected() ? "" : null',
89
86
  '[attr.aria-current]': 'selected()',
@@ -119,7 +116,7 @@ class NgpPaginationFirst {
119
116
  this.disabled = computed(() => this.buttonDisabled() ||
120
117
  this.paginationState().disabled() ||
121
118
  this.paginationState().firstPage());
122
- syncButton({ disabled: this.disabled });
119
+ setupButton({ disabled: this.disabled });
123
120
  }
124
121
  /**
125
122
  * Go to the first page.
@@ -140,17 +137,15 @@ class NgpPaginationFirst {
140
137
  this.goToFirstPage();
141
138
  }
142
139
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationFirst, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
143
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationFirst, isStandalone: true, selector: "[ngpPaginationFirst]", inputs: { buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationFirstDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToFirstPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-first-page": "paginationState().firstPage() ? \"\" : null" } }, exportAs: ["ngpPaginationFirst"], hostDirectives: [{ directive: i1.NgpButton }], ngImport: i0 }); }
140
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationFirst, isStandalone: true, selector: "[ngpPaginationFirst]", inputs: { buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationFirstDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToFirstPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-first-page": "paginationState().firstPage() ? \"\" : null" } }, exportAs: ["ngpPaginationFirst"], ngImport: i0 }); }
144
141
  }
145
142
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationFirst, decorators: [{
146
143
  type: Directive,
147
144
  args: [{
148
145
  selector: '[ngpPaginationFirst]',
149
146
  exportAs: 'ngpPaginationFirst',
150
- hostDirectives: [NgpButton],
151
147
  host: {
152
148
  '[tabindex]': 'disabled() ? -1 : 0',
153
- '[attr.data-disabled]': 'disabled() ? "" : null',
154
149
  '[attr.data-first-page]': 'paginationState().firstPage() ? "" : null',
155
150
  },
156
151
  }]
@@ -184,7 +179,7 @@ class NgpPaginationLast {
184
179
  this.disabled = computed(() => this.buttonDisabled() ||
185
180
  this.paginationState().disabled() ||
186
181
  this.paginationState().lastPage());
187
- syncButton({ disabled: this.disabled });
182
+ setupButton({ disabled: this.disabled });
188
183
  }
189
184
  /**
190
185
  * Go to the last page.
@@ -205,17 +200,15 @@ class NgpPaginationLast {
205
200
  this.goToLastPage();
206
201
  }
207
202
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationLast, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
208
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationLast, isStandalone: true, selector: "[ngpPaginationLast]", inputs: { buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationLastDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToLastPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-last-page": "paginationState().lastPage() ? \"\" : null" } }, exportAs: ["ngpPaginationLast"], hostDirectives: [{ directive: i1.NgpButton }], ngImport: i0 }); }
203
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationLast, isStandalone: true, selector: "[ngpPaginationLast]", inputs: { buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationLastDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToLastPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-last-page": "paginationState().lastPage() ? \"\" : null" } }, exportAs: ["ngpPaginationLast"], ngImport: i0 }); }
209
204
  }
210
205
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationLast, decorators: [{
211
206
  type: Directive,
212
207
  args: [{
213
208
  selector: '[ngpPaginationLast]',
214
209
  exportAs: 'ngpPaginationLast',
215
- hostDirectives: [NgpButton],
216
210
  host: {
217
211
  '[tabindex]': 'disabled() ? -1 : 0',
218
- '[attr.data-disabled]': 'disabled() ? "" : null',
219
212
  '[attr.data-last-page]': 'paginationState().lastPage() ? "" : null',
220
213
  },
221
214
  }]
@@ -252,7 +245,7 @@ class NgpPaginationNext {
252
245
  this.disabled = computed(() => this.buttonDisabled() ||
253
246
  this.paginationState().disabled() ||
254
247
  this.paginationState().lastPage());
255
- syncButton({ disabled: this.disabled });
248
+ setupButton({ disabled: this.disabled });
256
249
  }
257
250
  /**
258
251
  * Go to the next page.
@@ -273,17 +266,15 @@ class NgpPaginationNext {
273
266
  this.goToNextPage();
274
267
  }
275
268
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationNext, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
276
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationNext, isStandalone: true, selector: "[ngpPaginationNext]", inputs: { buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationNextDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToNextPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-last-page": "paginationState().lastPage() ? \"\" : null" } }, exportAs: ["ngpPaginationNext"], hostDirectives: [{ directive: i1.NgpButton }], ngImport: i0 }); }
269
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationNext, isStandalone: true, selector: "[ngpPaginationNext]", inputs: { buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationNextDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToNextPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-last-page": "paginationState().lastPage() ? \"\" : null" } }, exportAs: ["ngpPaginationNext"], ngImport: i0 }); }
277
270
  }
278
271
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationNext, decorators: [{
279
272
  type: Directive,
280
273
  args: [{
281
274
  selector: '[ngpPaginationNext]',
282
275
  exportAs: 'ngpPaginationNext',
283
- hostDirectives: [NgpButton],
284
276
  host: {
285
277
  '[tabindex]': 'disabled() ? -1 : 0',
286
- '[attr.data-disabled]': 'disabled() ? "" : null',
287
278
  '[attr.data-last-page]': 'paginationState().lastPage() ? "" : null',
288
279
  },
289
280
  }]
@@ -320,7 +311,7 @@ class NgpPaginationPrevious {
320
311
  this.disabled = computed(() => this.buttonDisabled() ||
321
312
  this.paginationState().disabled() ||
322
313
  this.paginationState().firstPage());
323
- syncButton({ disabled: this.disabled });
314
+ setupButton({ disabled: this.disabled });
324
315
  }
325
316
  /**
326
317
  * Go to the previous page.
@@ -341,17 +332,15 @@ class NgpPaginationPrevious {
341
332
  this.goToPreviousPage();
342
333
  }
343
334
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationPrevious, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
344
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationPrevious, isStandalone: true, selector: "[ngpPaginationPrevious]", inputs: { buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationPreviousDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToPreviousPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-first-page": "paginationState().firstPage() ? \"\" : null" } }, exportAs: ["ngpPaginationPrevious"], hostDirectives: [{ directive: i1.NgpButton }], ngImport: i0 }); }
335
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPaginationPrevious, isStandalone: true, selector: "[ngpPaginationPrevious]", inputs: { buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "ngpPaginationPreviousDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "goToPreviousPage()", "keydown.enter": "onEnter($event)", "keydown.space": "onEnter($event)" }, properties: { "tabindex": "disabled() ? -1 : 0", "attr.data-first-page": "paginationState().firstPage() ? \"\" : null" } }, exportAs: ["ngpPaginationPrevious"], ngImport: i0 }); }
345
336
  }
346
337
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPaginationPrevious, decorators: [{
347
338
  type: Directive,
348
339
  args: [{
349
340
  selector: '[ngpPaginationPrevious]',
350
341
  exportAs: 'ngpPaginationPrevious',
351
- hostDirectives: [NgpButton],
352
342
  host: {
353
343
  '[tabindex]': 'disabled() ? -1 : 0',
354
- '[attr.data-disabled]': 'disabled() ? "" : null',
355
344
  '[attr.data-first-page]': 'paginationState().firstPage() ? "" : null',
356
345
  },
357
346
  }]