ng-primitives 0.42.0 → 0.43.1

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 (103) hide show
  1. package/dialog/dialog-trigger/dialog-trigger.d.ts +0 -4
  2. package/fesm2022/ng-primitives-a11y.mjs +3 -3
  3. package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
  4. package/fesm2022/ng-primitives-accordion.mjs +12 -12
  5. package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
  6. package/fesm2022/ng-primitives-autofill.mjs +3 -3
  7. package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
  8. package/fesm2022/ng-primitives-avatar.mjs +9 -9
  9. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  10. package/fesm2022/ng-primitives-button.mjs +3 -3
  11. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  12. package/fesm2022/ng-primitives-checkbox.mjs +3 -3
  13. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  14. package/fesm2022/ng-primitives-common.mjs +3 -3
  15. package/fesm2022/ng-primitives-common.mjs.map +1 -1
  16. package/fesm2022/ng-primitives-date-picker.mjs +27 -27
  17. package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
  18. package/fesm2022/ng-primitives-dialog.mjs +19 -23
  19. package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
  20. package/fesm2022/ng-primitives-file-upload.mjs +6 -6
  21. package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
  22. package/fesm2022/ng-primitives-focus-trap.mjs +3 -3
  23. package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
  24. package/fesm2022/ng-primitives-form-field.mjs +15 -15
  25. package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
  26. package/fesm2022/ng-primitives-input.mjs +3 -3
  27. package/fesm2022/ng-primitives-input.mjs.map +1 -1
  28. package/fesm2022/ng-primitives-interactions.mjs +15 -15
  29. package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
  30. package/fesm2022/ng-primitives-internal.mjs +12 -12
  31. package/fesm2022/ng-primitives-internal.mjs.map +1 -1
  32. package/fesm2022/ng-primitives-listbox.mjs +12 -12
  33. package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
  34. package/fesm2022/ng-primitives-menu.mjs +12 -12
  35. package/fesm2022/ng-primitives-menu.mjs.map +1 -1
  36. package/fesm2022/ng-primitives-meter.mjs +15 -15
  37. package/fesm2022/ng-primitives-meter.mjs.map +1 -1
  38. package/fesm2022/ng-primitives-pagination.mjs +18 -18
  39. package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
  40. package/fesm2022/ng-primitives-popover.mjs +6 -6
  41. package/fesm2022/ng-primitives-popover.mjs.map +1 -1
  42. package/fesm2022/ng-primitives-progress.mjs +15 -15
  43. package/fesm2022/ng-primitives-progress.mjs.map +1 -1
  44. package/fesm2022/ng-primitives-radio.mjs +9 -9
  45. package/fesm2022/ng-primitives-radio.mjs.map +1 -1
  46. package/fesm2022/ng-primitives-resize.mjs +10 -3
  47. package/fesm2022/ng-primitives-resize.mjs.map +1 -1
  48. package/fesm2022/ng-primitives-roving-focus.mjs +6 -6
  49. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  50. package/fesm2022/ng-primitives-search.mjs +6 -6
  51. package/fesm2022/ng-primitives-search.mjs.map +1 -1
  52. package/fesm2022/ng-primitives-select.mjs +3 -3
  53. package/fesm2022/ng-primitives-select.mjs.map +1 -1
  54. package/fesm2022/ng-primitives-separator.mjs +3 -3
  55. package/fesm2022/ng-primitives-separator.mjs.map +1 -1
  56. package/fesm2022/ng-primitives-slider.mjs +12 -12
  57. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  58. package/fesm2022/ng-primitives-switch.mjs +6 -6
  59. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  60. package/fesm2022/ng-primitives-tabs.mjs +20 -14
  61. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  62. package/fesm2022/ng-primitives-textarea.mjs +3 -3
  63. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  64. package/fesm2022/ng-primitives-toast.mjs +3 -3
  65. package/fesm2022/ng-primitives-toast.mjs.map +1 -1
  66. package/fesm2022/ng-primitives-toggle-group.mjs +6 -6
  67. package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
  68. package/fesm2022/ng-primitives-toggle.mjs +3 -3
  69. package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
  70. package/fesm2022/ng-primitives-toolbar.mjs +3 -3
  71. package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
  72. package/fesm2022/ng-primitives-tooltip.mjs +6 -6
  73. package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
  74. package/focus-trap/focus-trap/focus-trap-state.d.ts +2 -2
  75. package/listbox/listbox/listbox-state.d.ts +2 -2
  76. package/meter/meter/meter-state.d.ts +3 -3
  77. package/meter/meter-indicator/meter-indicator.d.ts +3 -3
  78. package/meter/meter-label/meter-label.d.ts +3 -3
  79. package/package.json +13 -13
  80. package/pagination/pagination/pagination-state.d.ts +2 -2
  81. package/pagination/pagination-first/pagination-first.d.ts +2 -2
  82. package/pagination/pagination-next/pagination-next.d.ts +2 -2
  83. package/pagination/pagination-previous/pagination-previous.d.ts +2 -2
  84. package/progress/progress/progress-state.d.ts +3 -3
  85. package/progress/progress-indicator/progress-indicator.d.ts +3 -3
  86. package/progress/progress-label/progress-label.d.ts +3 -3
  87. package/progress/progress-track/progress-track.d.ts +3 -3
  88. package/progress/progress-value/progress-value.d.ts +3 -3
  89. package/roving-focus/roving-focus-group/roving-focus-group-state.d.ts +6 -6
  90. package/schematics/ng-generate/schema.d.ts +2 -1
  91. package/schematics/ng-generate/schema.json +1 -0
  92. package/schematics/ng-generate/templates/popover/popover-trigger.__fileSuffix@dasherize__.ts.template +39 -0
  93. package/schematics/ng-generate/templates/popover/popover.__fileSuffix@dasherize__.ts.template +59 -0
  94. package/slider/slider/slider-state.d.ts +4 -4
  95. package/slider/slider-range/slider-range.d.ts +4 -4
  96. package/slider/slider-thumb/slider-thumb.d.ts +4 -4
  97. package/slider/slider-track/slider-track.d.ts +4 -4
  98. package/tabs/tab-button/tab-button.d.ts +14 -13
  99. package/tabs/tab-list/tab-list.d.ts +6 -6
  100. package/tabs/tab-panel/tab-panel.d.ts +6 -6
  101. package/tabs/tabset/tabset-state.d.ts +6 -6
  102. package/toggle-group/toggle-group/toggle-group-state.d.ts +6 -6
  103. package/toolbar/toolbar/toolbar-state.d.ts +6 -6
@@ -301,10 +301,10 @@ class NgpTooltipTrigger {
301
301
  viewRef.detach();
302
302
  this.dispose?.();
303
303
  }
304
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTooltipTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
305
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: NgpTooltipTrigger, isStandalone: true, selector: "[ngpTooltipTrigger]", inputs: { tooltip: { classPropertyName: "tooltip", publicName: "ngpTooltipTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpTooltipTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpTooltipTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpTooltipTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "ngpTooltipTriggerShowDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "ngpTooltipTriggerHideDelay", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpTooltipTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpTooltipTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpTooltipTriggerContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "show()", "mouseleave": "hide()", "focus": "show()", "blur": "hide()" }, properties: { "attr.data-open": "open() ? \"\" : null", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideTooltipTriggerState(), provideExitAnimationManager()], exportAs: ["ngpTooltipTrigger"], ngImport: i0 }); }
304
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltipTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
305
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpTooltipTrigger, isStandalone: true, selector: "[ngpTooltipTrigger]", inputs: { tooltip: { classPropertyName: "tooltip", publicName: "ngpTooltipTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpTooltipTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpTooltipTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpTooltipTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "ngpTooltipTriggerShowDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "ngpTooltipTriggerHideDelay", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpTooltipTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpTooltipTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpTooltipTriggerContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "show()", "mouseleave": "hide()", "focus": "show()", "blur": "hide()" }, properties: { "attr.data-open": "open() ? \"\" : null", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideTooltipTriggerState(), provideExitAnimationManager()], exportAs: ["ngpTooltipTrigger"], ngImport: i0 }); }
306
306
  }
307
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTooltipTrigger, decorators: [{
307
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltipTrigger, decorators: [{
308
308
  type: Directive,
309
309
  args: [{
310
310
  selector: '[ngpTooltipTrigger]',
@@ -360,10 +360,10 @@ class NgpTooltip {
360
360
  }
361
361
  }
362
362
  }
363
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
364
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: NgpTooltip, isStandalone: true, selector: "[ngpTooltip]", host: { attributes: { "role": "tooltip" }, properties: { "style.left.px": "x()", "style.top.px": "y()", "style.--ngp-tooltip-trigger-width.px": "trigger().width()", "style.--ngp-tooltip-transform-origin": "transformOrigin()" } }, exportAs: ["ngpTooltip"], hostDirectives: [{ directive: i1.NgpExitAnimation }], ngImport: i0 }); }
363
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
364
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpTooltip, isStandalone: true, selector: "[ngpTooltip]", host: { attributes: { "role": "tooltip" }, properties: { "style.left.px": "x()", "style.top.px": "y()", "style.--ngp-tooltip-trigger-width.px": "trigger().width()", "style.--ngp-tooltip-transform-origin": "transformOrigin()" } }, exportAs: ["ngpTooltip"], hostDirectives: [{ directive: i1.NgpExitAnimation }], ngImport: i0 }); }
365
365
  }
366
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: NgpTooltip, decorators: [{
366
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltip, decorators: [{
367
367
  type: Directive,
368
368
  args: [{
369
369
  selector: '[ngpTooltip]',
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-tooltip.mjs","sources":["../../../../packages/ng-primitives/tooltip/src/config/tooltip-config.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip-token.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip.ts","../../../../packages/ng-primitives/tooltip/src/ng-primitives-tooltip.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\n\nexport interface NgpTooltipConfig {\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container in to which the tooltip should be attached.\n * @default document.body\n */\n container: HTMLElement | null;\n}\n\nexport const defaultTooltipConfig: NgpTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 0,\n flip: true,\n container: null,\n};\n\nexport const NgpTooltipConfigToken = new InjectionToken<NgpTooltipConfig>('NgpTooltipConfigToken');\n\n/**\n * Provide the default Tooltip configuration\n * @param config The Tooltip configuration\n * @returns The provider\n */\nexport function provideTooltipConfig(config: Partial<NgpTooltipConfig>): Provider[] {\n return [\n {\n provide: NgpTooltipConfigToken,\n useValue: { ...defaultTooltipConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tooltip configuration\n * @returns The global Tooltip configuration\n */\nexport function injectTooltipConfig(): NgpTooltipConfig {\n return inject(NgpTooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;\n}\n","import { inject, InjectionToken, ValueProvider } from '@angular/core';\n\nexport const NgpTooltipContextToken = new InjectionToken<unknown>('NgpTooltipContextToken');\n\n/**\n * Inject the Tooltip context\n */\nexport function injectTooltipContext<T>(): T {\n return inject(NgpTooltipContextToken) as T;\n}\n\n/**\n * Provide the Tooltip directive instance\n */\nexport function provideTooltipContext<T>(context: T): ValueProvider {\n return { provide: NgpTooltipContextToken, useValue: context };\n}\n","import { Signal } from '@angular/core';\nimport {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n State,\n} from 'ng-primitives/state';\nimport type { NgpTooltipTrigger } from './tooltip-trigger';\n\n/**\n * The state token for the TooltipTrigger primitive.\n */\nexport const NgpTooltipTriggerStateToken =\n createStateToken<NgpTooltipTrigger<unknown>>('TooltipTrigger');\n\n/**\n * Provides the TooltipTrigger state.\n */\nexport const provideTooltipTriggerState = createStateProvider(NgpTooltipTriggerStateToken);\n\n/**\n * Injects the TooltipTrigger state.\n */\nexport const injectTooltipTriggerState = createStateInjector(NgpTooltipTriggerStateToken) as <\n T,\n>() => Signal<State<NgpTooltipTrigger<T>>>;\n\n/**\n * The TooltipTrigger state registration function.\n */\nexport const tooltipTriggerState = createState(NgpTooltipTriggerStateToken);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { DOCUMENT } from '@angular/common';\nimport {\n Directive,\n ElementRef,\n Injector,\n OnDestroy,\n TemplateRef,\n Type,\n ViewContainerRef,\n booleanAttribute,\n computed,\n inject,\n input,\n numberAttribute,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n Middleware,\n Placement,\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from '@floating-ui/dom';\nimport { injectExitAnimationManager, provideExitAnimationManager } from 'ng-primitives/internal';\nimport { NgpPortal, createPortal } from 'ng-primitives/portal';\nimport { fromResizeEvent } from 'ng-primitives/resize';\nimport { injectDisposables } from 'ng-primitives/utils';\nimport { injectTooltipConfig } from '../config/tooltip-config';\nimport { provideTooltipContext } from '../tooltip/tooltip-token';\nimport { provideTooltipTriggerState, tooltipTriggerState } from './tooltip-trigger-state';\n\n/**\n * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.\n */\n@Directive({\n selector: '[ngpTooltipTrigger]',\n exportAs: 'ngpTooltipTrigger',\n providers: [provideTooltipTriggerState(), provideExitAnimationManager()],\n host: {\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '(mouseenter)': 'show()',\n '(mouseleave)': 'hide()',\n '(focus)': 'show()',\n '(blur)': 'hide()',\n },\n})\nexport class NgpTooltipTrigger<T = null> implements OnDestroy {\n /**\n * Access the exit animation manager.\n */\n private readonly exitAnimationManager = injectExitAnimationManager();\n\n /**\n * Access the trigger element\n */\n private readonly trigger = inject(ElementRef<HTMLElement>);\n\n /**\n * Access the view container ref.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the global tooltip configuration.\n */\n private readonly config = injectTooltipConfig();\n\n /**\n * Access the disposable utilities\n */\n private readonly disposables = injectDisposables();\n\n /**\n * Access the tooltip template ref.\n */\n readonly tooltip = input<NgpTooltipContent<T> | null>(null, {\n alias: 'ngpTooltipTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTooltipTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpTooltipTriggerPlacement',\n });\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpTooltipTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 0\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpTooltipTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpTooltipTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpTooltipTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the tooltip should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | null>(this.config.container, {\n alias: 'ngpTooltipTriggerContainer',\n });\n\n /**\n * Provide context to the tooltip.\n * @default null\n */\n readonly context = input<T | null>(null, {\n alias: 'ngpTooltipTriggerContext',\n });\n\n /**\n * Store the tooltip view ref.\n */\n protected viewRef = signal<NgpPortal | null>(null);\n\n /**\n * Derive the tooltip middleware from the provided configuration.\n */\n private readonly middleware = computed(() => {\n const middleware: Middleware[] = [offset(this.state.offset()), shift()];\n\n if (this.state.flip()) {\n middleware.push(flip());\n }\n\n return middleware;\n });\n\n /**\n * Store the computed position of the tooltip.\n * @internal\n */\n readonly position = signal<{ x: number; y: number }>({\n x: 0,\n y: 0,\n });\n\n /**\n * The dispose function to stop computing the position of the tooltip.\n */\n private dispose?: () => void;\n\n /**\n * @internal\n * Store the trigger width.\n */\n readonly width = signal<number | null>(null);\n\n /**\n * @internal\n * The timeout to open the tooltip.\n */\n private openTimeout?: () => void;\n\n /**\n * @internal\n * The timeout to close the tooltip.\n */\n private closeTimeout?: () => void;\n\n /**\n * @internal\n * Whether the tooltip is open or not.\n */\n readonly open = computed(() => this.viewRef() !== null);\n\n /**\n * Store the state of the tooltip.\n * @internal\n */\n readonly state = tooltipTriggerState<NgpTooltipTrigger<T>>(this);\n\n constructor() {\n // update the width of the trigger when it resizes\n fromResizeEvent(this.trigger.nativeElement)\n .pipe(takeUntilDestroyed())\n .subscribe(() => this.width.set(this.trigger.nativeElement.offsetWidth));\n }\n\n ngOnDestroy(): void {\n this.destroyTooltip();\n }\n\n /**\n * Show the tooltip.\n */\n show(): void {\n // if closing is in progress then clear the timeout to stop the popover from closing\n if (this.closeTimeout) {\n this.closeTimeout();\n this.closeTimeout = undefined;\n }\n\n // if the trigger is disabled or the tooltip is already open then do not show the tooltip\n if (this.state.disabled() || this.openTimeout) {\n return;\n }\n\n // if the tooltip exists in the DOM then do not create it again\n if (this.viewRef()) {\n return;\n }\n\n this.openTimeout = this.disposables.setTimeout(\n () => this.createTooltip(),\n this.state.showDelay(),\n );\n }\n\n /**\n * Hide the tooltip.\n */\n hide(): void {\n // if closing is in progress then clear the timeout to stop the popover from opening\n if (this.openTimeout) {\n this.openTimeout();\n this.openTimeout = undefined;\n }\n\n // if the trigger is disabled or the tooltip is already closed then do not hide the tooltip\n if (this.state.disabled() || this.closeTimeout) {\n return;\n }\n\n this.closeTimeout = this.disposables.setTimeout(\n () => this.destroyTooltip(),\n this.state.hideDelay(),\n );\n }\n\n private createTooltip(): void {\n this.openTimeout = undefined;\n const tooltip = this.state.tooltip();\n\n if (!tooltip) {\n throw new Error('Tooltip must be either a TemplateRef or a ComponentType');\n }\n\n // Create a new inject with the tooltip context\n const injector = Injector.create({\n parent: this.injector,\n providers: [provideTooltipContext(this.state.context())],\n });\n\n const portal = createPortal(tooltip, this.viewContainerRef, injector, {\n $implicit: this.state.context(),\n } as NgpTooltipTemplateContext<T>);\n const viewRef = portal.attach(this.state.container() ?? this.document.body);\n\n this.viewRef.set(viewRef);\n viewRef.detectChanges();\n\n const outletElement = viewRef.getElements()[0] as HTMLElement | null;\n\n if (!outletElement) {\n throw new Error('Outlet element is not available.');\n }\n\n if (viewRef.getElements().length > 1) {\n throw new Error('Popover must have only one root element.');\n }\n\n // we want to determine the strategy to use. If the tooltip has position: fixed then we want to use\n // fixed positioning. Otherwise we want to use absolute positioning.\n const strategy = getComputedStyle(outletElement).position === 'fixed' ? 'fixed' : 'absolute';\n\n this.dispose = autoUpdate(this.trigger.nativeElement, outletElement, async () => {\n const position = await computePosition(this.trigger.nativeElement, outletElement, {\n placement: this.state.placement(),\n middleware: this.middleware(),\n strategy,\n });\n\n this.position.set({ x: position.x, y: position.y });\n });\n }\n\n private async destroyTooltip(): Promise<void> {\n this.closeTimeout = undefined;\n const viewRef = this.viewRef();\n\n if (!viewRef) {\n return;\n }\n\n // we remove this to prevent the popover from being destroyed twice\n // because ngOnDestroy will be called on the viewRef\n // when the popover is destroyed triggering this method again\n this.viewRef.set(null);\n\n // destroy the view ref\n viewRef.detach();\n\n this.dispose?.();\n }\n}\n\ntype NgpTooltipTemplateContext<T> = {\n $implicit: T;\n};\ntype NgpTooltipContent<T> = TemplateRef<NgpTooltipTemplateContext<T>> | Type<unknown>;\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Directive,\n ElementRef,\n OnInit,\n PLATFORM_ID,\n computed,\n inject,\n isDevMode,\n} from '@angular/core';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { getTransformOrigin } from 'ng-primitives/popover';\nimport { injectTooltipTriggerState } from '../tooltip-trigger/tooltip-trigger-state';\n\n/**\n * Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpTooltip]',\n exportAs: 'ngpTooltip',\n hostDirectives: [NgpExitAnimation],\n host: {\n role: 'tooltip',\n '[style.left.px]': 'x()',\n '[style.top.px]': 'y()',\n '[style.--ngp-tooltip-trigger-width.px]': 'trigger().width()',\n '[style.--ngp-tooltip-transform-origin]': 'transformOrigin()',\n },\n})\nexport class NgpTooltip implements OnInit {\n /**\n * Access the tooltip element.\n */\n private readonly tooltip = inject(ElementRef<HTMLElement>);\n\n /**\n * Access the platform.\n */\n private readonly platform = inject(PLATFORM_ID);\n\n /**\n * Access the trigger instance.\n */\n private readonly trigger = injectTooltipTriggerState();\n\n /**\n * Compute the x position of the tooltip.\n */\n protected readonly x = computed(() => this.trigger().position().x);\n\n /**\n * Compute the y position of the tooltip.\n */\n protected readonly y = computed(() => this.trigger().position().y);\n\n /**\n * Derive the transform origin of the popover.\n */\n protected readonly transformOrigin = computed(() =>\n getTransformOrigin(this.trigger().placement()),\n );\n\n ngOnInit(): void {\n // if the element does not have a fixed position then throw a warning in dev mode\n if (isDevMode() && isPlatformBrowser(this.platform)) {\n const { position } = getComputedStyle(this.tooltip.nativeElement);\n\n if (position !== 'absolute' && position !== 'fixed') {\n console.warn(\n `The tooltip element must have an absolute or fixed position. The current position is ${position}.`,\n );\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAyCO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,IAAI;CAChB;AAEM,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAAmB,uBAAuB,CAAC;AAElG;;;;AAIG;AACG,SAAU,oBAAoB,CAAC,MAAiC,EAAA;IACpE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE,EAAE,GAAG,oBAAoB,EAAE,GAAG,MAAM,EAAE;AACjD,SAAA;KACF;AACH;AAEA;;;AAGG;SAC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AA,KAAA,EAAA,sCAAA,EAAA,mBAAA,EAAA,sCAAA,EAAA,mBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAZtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,cAAc,EAAE,CAAC,gBAAgB,CAAC;AAClC,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,iBAAiB,EAAE,KAAK;AACxB,wBAAA,gBAAgB,EAAE,KAAK;AACvB,wBAAA,wCAAwC,EAAE,mBAAmB;AAC7D,wBAAA,wCAAwC,EAAE,mBAAmB;AAC9D,qBAAA;AACF,iBAAA;;;AC5BD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-tooltip.mjs","sources":["../../../../packages/ng-primitives/tooltip/src/config/tooltip-config.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip-token.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip.ts","../../../../packages/ng-primitives/tooltip/src/ng-primitives-tooltip.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\n\nexport interface NgpTooltipConfig {\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container in to which the tooltip should be attached.\n * @default document.body\n */\n container: HTMLElement | null;\n}\n\nexport const defaultTooltipConfig: NgpTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 0,\n flip: true,\n container: null,\n};\n\nexport const NgpTooltipConfigToken = new InjectionToken<NgpTooltipConfig>('NgpTooltipConfigToken');\n\n/**\n * Provide the default Tooltip configuration\n * @param config The Tooltip configuration\n * @returns The provider\n */\nexport function provideTooltipConfig(config: Partial<NgpTooltipConfig>): Provider[] {\n return [\n {\n provide: NgpTooltipConfigToken,\n useValue: { ...defaultTooltipConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tooltip configuration\n * @returns The global Tooltip configuration\n */\nexport function injectTooltipConfig(): NgpTooltipConfig {\n return inject(NgpTooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;\n}\n","import { inject, InjectionToken, ValueProvider } from '@angular/core';\n\nexport const NgpTooltipContextToken = new InjectionToken<unknown>('NgpTooltipContextToken');\n\n/**\n * Inject the Tooltip context\n */\nexport function injectTooltipContext<T>(): T {\n return inject(NgpTooltipContextToken) as T;\n}\n\n/**\n * Provide the Tooltip directive instance\n */\nexport function provideTooltipContext<T>(context: T): ValueProvider {\n return { provide: NgpTooltipContextToken, useValue: context };\n}\n","import { Signal } from '@angular/core';\nimport {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n State,\n} from 'ng-primitives/state';\nimport type { NgpTooltipTrigger } from './tooltip-trigger';\n\n/**\n * The state token for the TooltipTrigger primitive.\n */\nexport const NgpTooltipTriggerStateToken =\n createStateToken<NgpTooltipTrigger<unknown>>('TooltipTrigger');\n\n/**\n * Provides the TooltipTrigger state.\n */\nexport const provideTooltipTriggerState = createStateProvider(NgpTooltipTriggerStateToken);\n\n/**\n * Injects the TooltipTrigger state.\n */\nexport const injectTooltipTriggerState = createStateInjector(NgpTooltipTriggerStateToken) as <\n T,\n>() => Signal<State<NgpTooltipTrigger<T>>>;\n\n/**\n * The TooltipTrigger state registration function.\n */\nexport const tooltipTriggerState = createState(NgpTooltipTriggerStateToken);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { DOCUMENT } from '@angular/common';\nimport {\n Directive,\n ElementRef,\n Injector,\n OnDestroy,\n TemplateRef,\n Type,\n ViewContainerRef,\n booleanAttribute,\n computed,\n inject,\n input,\n numberAttribute,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n Middleware,\n Placement,\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from '@floating-ui/dom';\nimport { injectExitAnimationManager, provideExitAnimationManager } from 'ng-primitives/internal';\nimport { NgpPortal, createPortal } from 'ng-primitives/portal';\nimport { fromResizeEvent } from 'ng-primitives/resize';\nimport { injectDisposables } from 'ng-primitives/utils';\nimport { injectTooltipConfig } from '../config/tooltip-config';\nimport { provideTooltipContext } from '../tooltip/tooltip-token';\nimport { provideTooltipTriggerState, tooltipTriggerState } from './tooltip-trigger-state';\n\n/**\n * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.\n */\n@Directive({\n selector: '[ngpTooltipTrigger]',\n exportAs: 'ngpTooltipTrigger',\n providers: [provideTooltipTriggerState(), provideExitAnimationManager()],\n host: {\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '(mouseenter)': 'show()',\n '(mouseleave)': 'hide()',\n '(focus)': 'show()',\n '(blur)': 'hide()',\n },\n})\nexport class NgpTooltipTrigger<T = null> implements OnDestroy {\n /**\n * Access the exit animation manager.\n */\n private readonly exitAnimationManager = injectExitAnimationManager();\n\n /**\n * Access the trigger element\n */\n private readonly trigger = inject(ElementRef<HTMLElement>);\n\n /**\n * Access the view container ref.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the global tooltip configuration.\n */\n private readonly config = injectTooltipConfig();\n\n /**\n * Access the disposable utilities\n */\n private readonly disposables = injectDisposables();\n\n /**\n * Access the tooltip template ref.\n */\n readonly tooltip = input<NgpTooltipContent<T> | null>(null, {\n alias: 'ngpTooltipTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTooltipTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpTooltipTriggerPlacement',\n });\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpTooltipTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 0\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpTooltipTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpTooltipTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpTooltipTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the tooltip should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | null>(this.config.container, {\n alias: 'ngpTooltipTriggerContainer',\n });\n\n /**\n * Provide context to the tooltip.\n * @default null\n */\n readonly context = input<T | null>(null, {\n alias: 'ngpTooltipTriggerContext',\n });\n\n /**\n * Store the tooltip view ref.\n */\n protected viewRef = signal<NgpPortal | null>(null);\n\n /**\n * Derive the tooltip middleware from the provided configuration.\n */\n private readonly middleware = computed(() => {\n const middleware: Middleware[] = [offset(this.state.offset()), shift()];\n\n if (this.state.flip()) {\n middleware.push(flip());\n }\n\n return middleware;\n });\n\n /**\n * Store the computed position of the tooltip.\n * @internal\n */\n readonly position = signal<{ x: number; y: number }>({\n x: 0,\n y: 0,\n });\n\n /**\n * The dispose function to stop computing the position of the tooltip.\n */\n private dispose?: () => void;\n\n /**\n * @internal\n * Store the trigger width.\n */\n readonly width = signal<number | null>(null);\n\n /**\n * @internal\n * The timeout to open the tooltip.\n */\n private openTimeout?: () => void;\n\n /**\n * @internal\n * The timeout to close the tooltip.\n */\n private closeTimeout?: () => void;\n\n /**\n * @internal\n * Whether the tooltip is open or not.\n */\n readonly open = computed(() => this.viewRef() !== null);\n\n /**\n * Store the state of the tooltip.\n * @internal\n */\n readonly state = tooltipTriggerState<NgpTooltipTrigger<T>>(this);\n\n constructor() {\n // update the width of the trigger when it resizes\n fromResizeEvent(this.trigger.nativeElement)\n .pipe(takeUntilDestroyed())\n .subscribe(() => this.width.set(this.trigger.nativeElement.offsetWidth));\n }\n\n ngOnDestroy(): void {\n this.destroyTooltip();\n }\n\n /**\n * Show the tooltip.\n */\n show(): void {\n // if closing is in progress then clear the timeout to stop the popover from closing\n if (this.closeTimeout) {\n this.closeTimeout();\n this.closeTimeout = undefined;\n }\n\n // if the trigger is disabled or the tooltip is already open then do not show the tooltip\n if (this.state.disabled() || this.openTimeout) {\n return;\n }\n\n // if the tooltip exists in the DOM then do not create it again\n if (this.viewRef()) {\n return;\n }\n\n this.openTimeout = this.disposables.setTimeout(\n () => this.createTooltip(),\n this.state.showDelay(),\n );\n }\n\n /**\n * Hide the tooltip.\n */\n hide(): void {\n // if closing is in progress then clear the timeout to stop the popover from opening\n if (this.openTimeout) {\n this.openTimeout();\n this.openTimeout = undefined;\n }\n\n // if the trigger is disabled or the tooltip is already closed then do not hide the tooltip\n if (this.state.disabled() || this.closeTimeout) {\n return;\n }\n\n this.closeTimeout = this.disposables.setTimeout(\n () => this.destroyTooltip(),\n this.state.hideDelay(),\n );\n }\n\n private createTooltip(): void {\n this.openTimeout = undefined;\n const tooltip = this.state.tooltip();\n\n if (!tooltip) {\n throw new Error('Tooltip must be either a TemplateRef or a ComponentType');\n }\n\n // Create a new inject with the tooltip context\n const injector = Injector.create({\n parent: this.injector,\n providers: [provideTooltipContext(this.state.context())],\n });\n\n const portal = createPortal(tooltip, this.viewContainerRef, injector, {\n $implicit: this.state.context(),\n } as NgpTooltipTemplateContext<T>);\n const viewRef = portal.attach(this.state.container() ?? this.document.body);\n\n this.viewRef.set(viewRef);\n viewRef.detectChanges();\n\n const outletElement = viewRef.getElements()[0] as HTMLElement | null;\n\n if (!outletElement) {\n throw new Error('Outlet element is not available.');\n }\n\n if (viewRef.getElements().length > 1) {\n throw new Error('Popover must have only one root element.');\n }\n\n // we want to determine the strategy to use. If the tooltip has position: fixed then we want to use\n // fixed positioning. Otherwise we want to use absolute positioning.\n const strategy = getComputedStyle(outletElement).position === 'fixed' ? 'fixed' : 'absolute';\n\n this.dispose = autoUpdate(this.trigger.nativeElement, outletElement, async () => {\n const position = await computePosition(this.trigger.nativeElement, outletElement, {\n placement: this.state.placement(),\n middleware: this.middleware(),\n strategy,\n });\n\n this.position.set({ x: position.x, y: position.y });\n });\n }\n\n private async destroyTooltip(): Promise<void> {\n this.closeTimeout = undefined;\n const viewRef = this.viewRef();\n\n if (!viewRef) {\n return;\n }\n\n // we remove this to prevent the popover from being destroyed twice\n // because ngOnDestroy will be called on the viewRef\n // when the popover is destroyed triggering this method again\n this.viewRef.set(null);\n\n // destroy the view ref\n viewRef.detach();\n\n this.dispose?.();\n }\n}\n\ntype NgpTooltipTemplateContext<T> = {\n $implicit: T;\n};\ntype NgpTooltipContent<T> = TemplateRef<NgpTooltipTemplateContext<T>> | Type<unknown>;\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Directive,\n ElementRef,\n OnInit,\n PLATFORM_ID,\n computed,\n inject,\n isDevMode,\n} from '@angular/core';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { getTransformOrigin } from 'ng-primitives/popover';\nimport { injectTooltipTriggerState } from '../tooltip-trigger/tooltip-trigger-state';\n\n/**\n * Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpTooltip]',\n exportAs: 'ngpTooltip',\n hostDirectives: [NgpExitAnimation],\n host: {\n role: 'tooltip',\n '[style.left.px]': 'x()',\n '[style.top.px]': 'y()',\n '[style.--ngp-tooltip-trigger-width.px]': 'trigger().width()',\n '[style.--ngp-tooltip-transform-origin]': 'transformOrigin()',\n },\n})\nexport class NgpTooltip implements OnInit {\n /**\n * Access the tooltip element.\n */\n private readonly tooltip = inject(ElementRef<HTMLElement>);\n\n /**\n * Access the platform.\n */\n private readonly platform = inject(PLATFORM_ID);\n\n /**\n * Access the trigger instance.\n */\n private readonly trigger = injectTooltipTriggerState();\n\n /**\n * Compute the x position of the tooltip.\n */\n protected readonly x = computed(() => this.trigger().position().x);\n\n /**\n * Compute the y position of the tooltip.\n */\n protected readonly y = computed(() => this.trigger().position().y);\n\n /**\n * Derive the transform origin of the popover.\n */\n protected readonly transformOrigin = computed(() =>\n getTransformOrigin(this.trigger().placement()),\n );\n\n ngOnInit(): void {\n // if the element does not have a fixed position then throw a warning in dev mode\n if (isDevMode() && isPlatformBrowser(this.platform)) {\n const { position } = getComputedStyle(this.tooltip.nativeElement);\n\n if (position !== 'absolute' && position !== 'fixed') {\n console.warn(\n `The tooltip element must have an absolute or fixed position. The current position is ${position}.`,\n );\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAyCO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,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AK,UAAU,IAAI,QAAQ,KAAK,OAAO,EAAE;AACnD,gBAAA,OAAO,CAAC,IAAI,CACV,wFAAwF,QAAQ,CAAA,CAAA,CAAG,CACpG;;;;+GAzCI,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,SAAA,EAAA,EAAA,UAAA,EAAA,EAAA,eAAA,EAAA,KAAA,EAAA,cAAA,EAAA,KAAA,EAAA,sCAAA,EAAA,mBAAA,EAAA,sCAAA,EAAA,mBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAZtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,cAAc,EAAE,CAAC,gBAAgB,CAAC;AAClC,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,iBAAiB,EAAE,KAAK;AACxB,wBAAA,gBAAgB,EAAE,KAAK;AACvB,wBAAA,wCAAwC,EAAE,mBAAmB;AAC7D,wBAAA,wCAAwC,EAAE,mBAAmB;AAC9D,qBAAA;AACF,iBAAA;;;AC5BD;;AAEG;;;;"}
@@ -17,8 +17,8 @@ export declare const injectFocusTrapState: <U = {
17
17
  deactivate(): void;
18
18
  };
19
19
  readonly injector: import("@angular/core").Injector;
20
- readonly focusMonitor: import("@angular/cdk/a11y").FocusMonitor;
21
- readonly interactivityChecker: import("@angular/cdk/a11y").InteractivityChecker;
20
+ readonly focusMonitor: import("@angular/cdk/focus-monitor.d-CvvJeQRc").e;
21
+ readonly interactivityChecker: import("@angular/cdk/a11y-module.d-DBHGyKoh").I;
22
22
  readonly elementRef: import("@angular/core").ElementRef<HTMLElement>;
23
23
  readonly ngZone: import("@angular/core").NgZone;
24
24
  mutationObserver: MutationObserver | null;
@@ -22,14 +22,14 @@ export declare const injectListboxState: <U = {
22
22
  readonly compareWith: import("@angular/core").InputSignal<(a: unknown, b: unknown) => boolean>;
23
23
  readonly tabindex: import("@angular/core").Signal<-1 | 0>;
24
24
  readonly options: import("@angular/core").WritableSignal<import("ng-primitives/listbox").NgpListboxOption<unknown>[]>;
25
- readonly keyManager: import("@angular/cdk/a11y").ActiveDescendantKeyManager<import("ng-primitives/listbox").NgpListboxOption<unknown>>;
25
+ readonly keyManager: import("@angular/cdk/activedescendant-key-manager.d-Bjic5obv").A<import("ng-primitives/listbox").NgpListboxOption<unknown>>;
26
26
  readonly activeDescendant: import("@angular/core").WritableSignal<string | undefined>;
27
27
  readonly isFocused: import("@angular/core").WritableSignal<boolean>;
28
28
  readonly state: import("ng-primitives/state").CreatedState<NgpListbox<unknown>>;
29
29
  ngAfterContentInit: () => void;
30
30
  updateActiveItem: () => void;
31
31
  onKeydown: (event: KeyboardEvent) => void;
32
- selectOption: (value: unknown, origin: import("@angular/cdk/a11y").FocusOrigin) => void;
32
+ selectOption: (value: unknown, origin: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
33
33
  isSelected: (value: unknown) => boolean;
34
34
  activateOption: (value: unknown) => void;
35
35
  addOption: (option: import("ng-primitives/listbox").NgpListboxOption<unknown>) => void;
@@ -11,9 +11,9 @@ export declare const provideMeterState: (options?: import("ng-primitives/state")
11
11
  * Injects the Meter state.
12
12
  */
13
13
  export declare const injectMeterState: <U = {
14
- readonly value: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
15
- readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
16
- readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
14
+ readonly value: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
15
+ readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
16
+ readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
17
17
  readonly valueLabel: import("@angular/core").InputSignal<import("./meter").NgpMeterValueTextFn>;
18
18
  readonly label: import("@angular/core").WritableSignal<import("ng-primitives/meter").NgpMeterLabel | null>;
19
19
  readonly percentage: import("@angular/core").Signal<number>;
@@ -2,9 +2,9 @@ import * as i0 from "@angular/core";
2
2
  export declare class NgpMeterIndicator {
3
3
  /** Access the meter */
4
4
  protected readonly meter: import("@angular/core").Signal<import("ng-primitives/state").State<{
5
- readonly value: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
6
- readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
7
- readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
5
+ readonly value: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
6
+ readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
7
+ readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
8
8
  readonly valueLabel: import("@angular/core").InputSignal<import("../meter/meter").NgpMeterValueTextFn>;
9
9
  readonly label: import("@angular/core").WritableSignal<import("ng-primitives/meter").NgpMeterLabel | null>;
10
10
  readonly percentage: import("@angular/core").Signal<number>;
@@ -2,9 +2,9 @@ import * as i0 from "@angular/core";
2
2
  export declare class NgpMeterLabel {
3
3
  /** Access the meter */
4
4
  protected readonly meter: import("@angular/core").Signal<import("ng-primitives/state").State<{
5
- readonly value: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
6
- readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
7
- readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
5
+ readonly value: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
6
+ readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
7
+ readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
8
8
  readonly valueLabel: import("@angular/core").InputSignal<import("../meter/meter").NgpMeterValueTextFn>;
9
9
  readonly label: import("@angular/core").WritableSignal<NgpMeterLabel | null>;
10
10
  readonly percentage: import("@angular/core").Signal<number>;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ng-primitives",
3
3
  "description": "Angular Primitives is a low-level headless UI component library with a focus on accessibility, customization, and developer experience. ",
4
4
  "license": "Apache-2.0",
5
- "version": "0.42.0",
5
+ "version": "0.43.1",
6
6
  "keywords": [
7
7
  "angular",
8
8
  "primitives",
@@ -67,10 +67,6 @@
67
67
  "types": "./a11y/index.d.ts",
68
68
  "default": "./fesm2022/ng-primitives-a11y.mjs"
69
69
  },
70
- "./accordion": {
71
- "types": "./accordion/index.d.ts",
72
- "default": "./fesm2022/ng-primitives-accordion.mjs"
73
- },
74
70
  "./autofill": {
75
71
  "types": "./autofill/index.d.ts",
76
72
  "default": "./fesm2022/ng-primitives-autofill.mjs"
@@ -83,6 +79,10 @@
83
79
  "types": "./button/index.d.ts",
84
80
  "default": "./fesm2022/ng-primitives-button.mjs"
85
81
  },
82
+ "./accordion": {
83
+ "types": "./accordion/index.d.ts",
84
+ "default": "./fesm2022/ng-primitives-accordion.mjs"
85
+ },
86
86
  "./checkbox": {
87
87
  "types": "./checkbox/index.d.ts",
88
88
  "default": "./fesm2022/ng-primitives-checkbox.mjs"
@@ -135,14 +135,14 @@
135
135
  "types": "./listbox/index.d.ts",
136
136
  "default": "./fesm2022/ng-primitives-listbox.mjs"
137
137
  },
138
- "./menu": {
139
- "types": "./menu/index.d.ts",
140
- "default": "./fesm2022/ng-primitives-menu.mjs"
141
- },
142
138
  "./meter": {
143
139
  "types": "./meter/index.d.ts",
144
140
  "default": "./fesm2022/ng-primitives-meter.mjs"
145
141
  },
142
+ "./menu": {
143
+ "types": "./menu/index.d.ts",
144
+ "default": "./fesm2022/ng-primitives-menu.mjs"
145
+ },
146
146
  "./pagination": {
147
147
  "types": "./pagination/index.d.ts",
148
148
  "default": "./fesm2022/ng-primitives-pagination.mjs"
@@ -191,14 +191,14 @@
191
191
  "types": "./state/index.d.ts",
192
192
  "default": "./fesm2022/ng-primitives-state.mjs"
193
193
  },
194
- "./switch": {
195
- "types": "./switch/index.d.ts",
196
- "default": "./fesm2022/ng-primitives-switch.mjs"
197
- },
198
194
  "./tabs": {
199
195
  "types": "./tabs/index.d.ts",
200
196
  "default": "./fesm2022/ng-primitives-tabs.mjs"
201
197
  },
198
+ "./switch": {
199
+ "types": "./switch/index.d.ts",
200
+ "default": "./fesm2022/ng-primitives-switch.mjs"
201
+ },
202
202
  "./textarea": {
203
203
  "types": "./textarea/index.d.ts",
204
204
  "default": "./fesm2022/ng-primitives-textarea.mjs"
@@ -11,9 +11,9 @@ export declare const providePaginationState: (options?: import("ng-primitives/st
11
11
  * Injects the Pagination state.
12
12
  */
13
13
  export declare const injectPaginationState: <U = {
14
- readonly page: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
14
+ readonly page: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
15
15
  readonly pageChange: import("@angular/core").OutputEmitterRef<number>;
16
- readonly pageCount: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
16
+ readonly pageCount: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
17
17
  readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
18
18
  readonly firstPage: import("@angular/core").Signal<boolean>;
19
19
  readonly lastPage: import("@angular/core").Signal<boolean>;
@@ -9,9 +9,9 @@ export declare class NgpPaginationFirst {
9
9
  * Access the pagination state.
10
10
  */
11
11
  protected readonly paginationState: import("@angular/core").Signal<import("ng-primitives/state").State<{
12
- readonly page: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
12
+ readonly page: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
13
13
  readonly pageChange: import("@angular/core").OutputEmitterRef<number>;
14
- readonly pageCount: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
14
+ readonly pageCount: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
15
15
  readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
16
16
  readonly firstPage: import("@angular/core").Signal<boolean>;
17
17
  readonly lastPage: import("@angular/core").Signal<boolean>;
@@ -9,9 +9,9 @@ export declare class NgpPaginationNext {
9
9
  * Access the pagination state.
10
10
  */
11
11
  protected readonly paginationState: import("@angular/core").Signal<import("ng-primitives/state").State<{
12
- readonly page: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
12
+ readonly page: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
13
13
  readonly pageChange: import("@angular/core").OutputEmitterRef<number>;
14
- readonly pageCount: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
14
+ readonly pageCount: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
15
15
  readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
16
16
  readonly firstPage: import("@angular/core").Signal<boolean>;
17
17
  readonly lastPage: import("@angular/core").Signal<boolean>;
@@ -9,9 +9,9 @@ export declare class NgpPaginationPrevious {
9
9
  * Access the pagination state.
10
10
  */
11
11
  protected readonly paginationState: import("@angular/core").Signal<import("ng-primitives/state").State<{
12
- readonly page: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
12
+ readonly page: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
13
13
  readonly pageChange: import("@angular/core").OutputEmitterRef<number>;
14
- readonly pageCount: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
14
+ readonly pageCount: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
15
15
  readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
16
16
  readonly firstPage: import("@angular/core").Signal<boolean>;
17
17
  readonly lastPage: import("@angular/core").Signal<boolean>;
@@ -11,9 +11,9 @@ export declare const provideProgressState: (options?: import("ng-primitives/stat
11
11
  * Injects the Progress state.
12
12
  */
13
13
  export declare const injectProgressState: <U = {
14
- readonly value: import("@angular/core").InputSignalWithTransform<number | null, import("@angular/cdk/coercion").NumberInput>;
15
- readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
16
- readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
14
+ readonly value: import("@angular/core").InputSignalWithTransform<number | null, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
15
+ readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
16
+ readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
17
17
  readonly valueLabel: import("@angular/core").InputSignal<import("./progress").NgpProgressValueTextFn>;
18
18
  readonly indeterminate: import("@angular/core").Signal<boolean>;
19
19
  readonly progressing: import("@angular/core").Signal<boolean>;
@@ -8,9 +8,9 @@ export declare class NgpProgressIndicator {
8
8
  * Access the progress state.
9
9
  */
10
10
  protected readonly state: import("@angular/core").Signal<import("ng-primitives/state").State<{
11
- readonly value: import("@angular/core").InputSignalWithTransform<number | null, import("@angular/cdk/coercion").NumberInput>;
12
- readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
13
- readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
11
+ readonly value: import("@angular/core").InputSignalWithTransform<number | null, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
12
+ readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
13
+ readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
14
14
  readonly valueLabel: import("@angular/core").InputSignal<import("ng-primitives/progress").NgpProgressValueTextFn>;
15
15
  readonly indeterminate: import("@angular/core").Signal<boolean>;
16
16
  readonly progressing: import("@angular/core").Signal<boolean>;
@@ -4,9 +4,9 @@ export declare class NgpProgressLabel {
4
4
  * Access the progress state.
5
5
  */
6
6
  protected readonly state: import("@angular/core").Signal<import("ng-primitives/state").State<{
7
- readonly value: import("@angular/core").InputSignalWithTransform<number | null, import("@angular/cdk/coercion").NumberInput>;
8
- readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
9
- readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
7
+ readonly value: import("@angular/core").InputSignalWithTransform<number | null, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
8
+ readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
9
+ readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
10
10
  readonly valueLabel: import("@angular/core").InputSignal<import("ng-primitives/progress").NgpProgressValueTextFn>;
11
11
  readonly indeterminate: import("@angular/core").Signal<boolean>;
12
12
  readonly progressing: import("@angular/core").Signal<boolean>;
@@ -4,9 +4,9 @@ export declare class NgpProgressTrack {
4
4
  * Access the progress state.
5
5
  */
6
6
  protected readonly state: import("@angular/core").Signal<import("ng-primitives/state").State<{
7
- readonly value: import("@angular/core").InputSignalWithTransform<number | null, import("@angular/cdk/coercion").NumberInput>;
8
- readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
9
- readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
7
+ readonly value: import("@angular/core").InputSignalWithTransform<number | null, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
8
+ readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
9
+ readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
10
10
  readonly valueLabel: import("@angular/core").InputSignal<import("ng-primitives/progress").NgpProgressValueTextFn>;
11
11
  readonly indeterminate: import("@angular/core").Signal<boolean>;
12
12
  readonly progressing: import("@angular/core").Signal<boolean>;
@@ -4,9 +4,9 @@ export declare class NgpProgressValue {
4
4
  * Access the progress state.
5
5
  */
6
6
  protected readonly state: import("@angular/core").Signal<import("ng-primitives/state").State<{
7
- readonly value: import("@angular/core").InputSignalWithTransform<number | null, import("@angular/cdk/coercion").NumberInput>;
8
- readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
9
- readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
7
+ readonly value: import("@angular/core").InputSignalWithTransform<number | null, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
8
+ readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
9
+ readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
10
10
  readonly valueLabel: import("@angular/core").InputSignal<import("ng-primitives/progress").NgpProgressValueTextFn>;
11
11
  readonly indeterminate: import("@angular/core").Signal<boolean>;
12
12
  readonly progressing: import("@angular/core").Signal<boolean>;
@@ -11,7 +11,7 @@ export declare const provideRovingFocusGroupState: (options?: import("ng-primiti
11
11
  * Injects the RovingFocusGroup state.
12
12
  */
13
13
  export declare const injectRovingFocusGroupState: <U = {
14
- readonly directionality: import("@angular/cdk/bidi").Directionality;
14
+ readonly directionality: import("@angular/cdk/bidi-module.d-D-fEBKdS").D;
15
15
  readonly orientation: import("@angular/core").InputSignal<import("ng-primitives/common").NgpOrientation>;
16
16
  readonly wrap: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
17
17
  readonly homeEnd: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
@@ -22,11 +22,11 @@ export declare const injectRovingFocusGroupState: <U = {
22
22
  readonly state: import("ng-primitives/state").CreatedState<NgpRovingFocusGroup>;
23
23
  register: (item: import("ng-primitives/roving-focus").NgpRovingFocusItem) => void;
24
24
  unregister: (item: import("ng-primitives/roving-focus").NgpRovingFocusItem) => void;
25
- setActiveItem: (item: import("ng-primitives/roving-focus").NgpRovingFocusItem | null, origin?: import("@angular/cdk/a11y").FocusOrigin) => void;
26
- activateFirstItem: (origin: import("@angular/cdk/a11y").FocusOrigin) => void;
27
- activateLastItem: (origin: import("@angular/cdk/a11y").FocusOrigin) => void;
28
- activateNextItem: (origin: import("@angular/cdk/a11y").FocusOrigin) => void;
29
- activatePreviousItem: (origin: import("@angular/cdk/a11y").FocusOrigin) => void;
25
+ setActiveItem: (item: import("ng-primitives/roving-focus").NgpRovingFocusItem | null, origin?: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
26
+ activateFirstItem: (origin: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
27
+ activateLastItem: (origin: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
28
+ activateNextItem: (origin: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
29
+ activatePreviousItem: (origin: import("@angular/cdk/focus-monitor.d-CvvJeQRc").F) => void;
30
30
  onKeydown: (event: KeyboardEvent) => void;
31
31
  }>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
32
32
  /**
@@ -25,7 +25,8 @@ export interface AngularPrimitivesComponentSchema {
25
25
  | 'toast'
26
26
  | 'toolbar'
27
27
  | 'tooltip'
28
- | 'meter';
28
+ | 'meter'
29
+ | 'popover';
29
30
 
30
31
  /**
31
32
  * The path where the component files should be created, relative to the current workspace.
@@ -22,6 +22,7 @@
22
22
  "listbox",
23
23
  "meter",
24
24
  "pagination",
25
+ "popover",
25
26
  "progress",
26
27
  "radio",
27
28
  "search",
@@ -0,0 +1,39 @@
1
+ import { Directive, input } from '@angular/core';
2
+ import { injectPopoverTriggerState } from 'ng-primitives/popover';
3
+ import { NgpPopoverTrigger } from 'ng-primitives/popover';
4
+ import { Popover } from './popover';
5
+
6
+ @Directive({
7
+ selector: '[appPopoverTrigger]',
8
+ hostDirectives: [
9
+ {
10
+ directive: NgpPopoverTrigger,
11
+ inputs: [
12
+ 'ngpPopoverTriggerDisabled:appPopoverTriggerDisabled',
13
+ 'ngpPopoverTriggerPlacement:appPopoverTriggerPlacement',
14
+ 'ngpPopoverTriggerOffset:appPopoverTriggerOffset',
15
+ 'ngpPopoverTriggerShowDelay:appPopoverTriggerShowDelay',
16
+ 'ngpPopoverTriggerHideDelay:appPopoverTriggerHideDelay',
17
+ 'ngpPopoverTriggerFlip:appPopoverTriggerFlip',
18
+ 'ngpPopoverTriggerContainer:appPopoverTriggerContainer',
19
+ 'ngpPopoverTriggerCloseOnOutsideClick:appPopoverTriggerCloseOnOutsideClick',
20
+ 'ngpPopoverTriggerCloseOnEscape:appPopoverTriggerCloseOnEscape',
21
+ 'ngpPopoverTriggerScrollBehavior:appPopoverTriggerScrollBehavior',
22
+ 'ngpPopoverTriggerContext:appPopoverTrigger',
23
+ ],
24
+ },
25
+ ],
26
+ })
27
+ export class PopoverTrigger {
28
+ /** Access the popover trigger */
29
+ private readonly popoverTrigger = injectPopoverTriggerState();
30
+
31
+ /** Define the content of the popover */
32
+ readonly content = input.required<string>({
33
+ alias: 'appPopoverTrigger',
34
+ });
35
+
36
+ constructor() {
37
+ this.popoverTrigger().popover.set(Popover);
38
+ }
39
+ }
@@ -0,0 +1,59 @@
1
+ import { Component } from '@angular/core';
2
+ import { injectPopoverContext, NgpPopover } from 'ng-primitives/popover';
3
+
4
+ @Component({
5
+ selector: '<%= prefix %>-popover',
6
+ hostDirectives: [NgpPopover],
7
+ template: `
8
+ {{ content }}
9
+ `,
10
+ styles: `
11
+ /* These styles rely on CSS variables that can be imported from ng-primitives/example-theme/index.css in your global styles */
12
+
13
+ :host {
14
+ position: absolute;
15
+ max-width: 16rem;
16
+ border-radius: 0.5rem;
17
+ background-color: var(--ngp-background-inverse);
18
+ padding: 0.5rem 0.75rem;
19
+ border: none;
20
+ font-size: 0.75rem;
21
+ font-weight: 500;
22
+ color: var(--ngp-text-inverse);
23
+ transform-origin: var(--ngp-popover-transform-origin);
24
+ }
25
+
26
+ :host[data-enter] {
27
+ animation: popover-show 200ms ease-in-out;
28
+ }
29
+
30
+ :host[data-exit] {
31
+ animation: popover-hide 200ms ease-in-out;
32
+ }
33
+
34
+ @keyframes popover-show {
35
+ 0% {
36
+ opacity: 0;
37
+ transform: scale(0.5);
38
+ }
39
+ 100% {
40
+ opacity: 1;
41
+ transform: scale(1);
42
+ }
43
+ }
44
+
45
+ @keyframes popover-hide {
46
+ 0% {
47
+ opacity: 1;
48
+ transform: scale(1);
49
+ }
50
+ 100% {
51
+ opacity: 0;
52
+ transform: scale(0.5);
53
+ }
54
+ }
55
+ `,
56
+ })
57
+ export class Popover<%= componentSuffix %> {
58
+ readonly content = injectPopoverContext();
59
+ }
@@ -11,11 +11,11 @@ export declare const provideSliderState: (options?: import("ng-primitives/state"
11
11
  * Injects the Slider state.
12
12
  */
13
13
  export declare const injectSliderState: <U = {
14
- readonly value: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
14
+ readonly value: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
15
15
  readonly valueChange: import("@angular/core").OutputEmitterRef<number>;
16
- readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
17
- readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
18
- readonly step: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/coercion").NumberInput>;
16
+ readonly min: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
17
+ readonly max: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
18
+ readonly step: import("@angular/core").InputSignalWithTransform<number, import("@angular/cdk/number-property.d-CJVxXUcb").N>;
19
19
  readonly orientation: import("@angular/core").InputSignal<import("ng-primitives/common").NgpOrientation>;
20
20
  readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
21
21
  readonly track: import("@angular/core").WritableSignal<import("ng-primitives/slider").NgpSliderTrack | undefined>;