ng-primitives 0.82.0 → 0.83.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 (43) hide show
  1. package/avatar/avatar/avatar.d.ts +1 -2
  2. package/fesm2022/ng-primitives-avatar.mjs +3 -6
  3. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  4. package/fesm2022/ng-primitives-button.mjs +2 -2
  5. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  6. package/fesm2022/ng-primitives-checkbox.mjs +2 -2
  7. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  8. package/fesm2022/ng-primitives-combobox.mjs +5 -5
  9. package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
  10. package/fesm2022/ng-primitives-file-upload.mjs +3 -4
  11. package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
  12. package/fesm2022/ng-primitives-input.mjs +2 -2
  13. package/fesm2022/ng-primitives-input.mjs.map +1 -1
  14. package/fesm2022/ng-primitives-interactions.mjs +458 -44
  15. package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
  16. package/fesm2022/ng-primitives-internal.mjs +87 -427
  17. package/fesm2022/ng-primitives-internal.mjs.map +1 -1
  18. package/fesm2022/ng-primitives-listbox.mjs +4 -4
  19. package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
  20. package/fesm2022/ng-primitives-select.mjs +4 -4
  21. package/fesm2022/ng-primitives-select.mjs.map +1 -1
  22. package/fesm2022/ng-primitives-slider.mjs +3 -3
  23. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  24. package/fesm2022/ng-primitives-switch.mjs +3 -3
  25. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  26. package/fesm2022/ng-primitives-tabs.mjs +2 -2
  27. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  28. package/fesm2022/ng-primitives-textarea.mjs +2 -2
  29. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  30. package/fesm2022/ng-primitives-tooltip.mjs +3 -2
  31. package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
  32. package/interactions/config/interactions-config.d.ts +30 -0
  33. package/{internal/interactions/focus.d.ts → interactions/focus/focus-interaction.d.ts} +4 -1
  34. package/{internal/interactions/focus-visible.d.ts → interactions/focus-visible/focus-visible-interaction.d.ts} +4 -1
  35. package/{internal/interactions/hover.d.ts → interactions/hover/hover-interaction.d.ts} +2 -1
  36. package/interactions/index.d.ts +11 -1
  37. package/interactions/interactions/interactions.d.ts +20 -0
  38. package/{internal/interactions/press.d.ts → interactions/press/press-interaction.d.ts} +4 -1
  39. package/internal/index.d.ts +0 -1
  40. package/package.json +48 -48
  41. package/interactions/setup-interactions/interaction.d.ts +0 -6
  42. package/interactions/setup-interactions/setup-interactions.d.ts +0 -13
  43. package/internal/interactions/index.d.ts +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-tabs.mjs","sources":["../../../../packages/ng-primitives/tabs/src/config/tabs-config.ts","../../../../packages/ng-primitives/tabs/src/tabset/tabset-state.ts","../../../../packages/ng-primitives/tabs/src/tab-button/tab-button.ts","../../../../packages/ng-primitives/tabs/src/tab-list/tab-list.ts","../../../../packages/ng-primitives/tabs/src/tab-panel/tab-panel-token.ts","../../../../packages/ng-primitives/tabs/src/tab-panel/tab-panel.ts","../../../../packages/ng-primitives/tabs/src/tabset/tabset.ts","../../../../packages/ng-primitives/tabs/src/ng-primitives-tabs.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\n\nexport interface NgpTabsConfig {\n /**\n * The orientation of the tabset\n * @default 'horizontal'\n */\n orientation: NgpOrientation;\n\n /**\n * Whether tabs should activate on focus\n * @default true\n */\n activateOnFocus: boolean;\n\n /**\n * Whether focus should wrap within the tab list when using the keyboard.\n * @default true\n */\n wrap: boolean;\n}\n\nexport const defaultTabsConfig: NgpTabsConfig = {\n orientation: 'horizontal',\n activateOnFocus: true,\n wrap: true,\n};\n\nexport const NgpTabsConfigToken = new InjectionToken<NgpTabsConfig>('NgpTabsConfigToken');\n\n/**\n * Provide the default Tabs configuration\n * @param config The Tabs configuration\n * @returns The provider\n */\nexport function provideTabsConfig(config: Partial<NgpTabsConfig>): Provider[] {\n return [\n {\n provide: NgpTabsConfigToken,\n useValue: { ...defaultTabsConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tabs configuration\n * @returns The global Tabs configuration\n */\nexport function injectTabsConfig(): NgpTabsConfig {\n return inject(NgpTabsConfigToken, { optional: true }) ?? defaultTabsConfig;\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpTabset } from './tabset';\n\n/**\n * The state token for the Tabset primitive.\n */\nexport const NgpTabsetStateToken = createStateToken<NgpTabset>('Tabset');\n\n/**\n * Provides the Tabset state.\n */\nexport const provideTabsetState = createStateProvider(NgpTabsetStateToken);\n\n/**\n * Injects the Tabset state.\n */\nexport const injectTabsetState = createStateInjector<NgpTabset>(NgpTabsetStateToken);\n\n/**\n * The Tabset state registration function.\n */\nexport const tabsetState = createState(NgpTabsetStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n Directive,\n HOST_TAG_NAME,\n HostListener,\n OnDestroy,\n OnInit,\n booleanAttribute,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { setupInteractions } from 'ng-primitives/interactions';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * Apply the `ngpTabButton` directive to an element within a tab list to represent a tab button. This directive should be applied to a button element.\n */\n@Directive({\n selector: '[ngpTabButton]',\n exportAs: 'ngpTabButton',\n host: {\n role: 'tab',\n '[attr.id]': 'buttonId()',\n '[attr.aria-controls]': 'ariaControls()',\n '[attr.data-active]': 'active() ? \"\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.disabled]': 'tagName === \"button\" && disabled() ? \"\" : null',\n '[attr.data-orientation]': 'state().orientation()',\n },\n hostDirectives: [\n {\n directive: NgpRovingFocusItem,\n inputs: ['ngpRovingFocusItemDisabled: ngpTabButtonDisabled'],\n },\n ],\n})\nexport class NgpTabButton implements OnInit, OnDestroy {\n /**\n * Access the tag host name\n */\n protected readonly tagName = inject(HOST_TAG_NAME);\n\n /**\n * Access the tabset state\n */\n protected readonly state = injectTabsetState();\n\n /**\n * The value of the tab this trigger controls\n * @required\n */\n readonly value = input<string>(undefined, { alias: 'ngpTabButtonValue' });\n\n /**\n * Whether the tab is disabled\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTabButtonDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Determine the id of the tab button\n * @internal\n */\n readonly id = input<string>();\n\n /**\n * Determine a unique id for the tab button if not provided\n * @internal\n */\n readonly buttonId = computed(() => this.id() ?? `${this.state().id()}-button-${this.value()}`);\n\n /**\n * Determine the aria-controls of the tab button\n * @internal\n */\n readonly ariaControls = computed(() => `${this.state().id()}-panel-${this.value()}`);\n\n /**\n * Whether the tab is active\n */\n readonly active = computed(() => this.state().selectedTab() === this.value());\n\n constructor() {\n this.state().registerTab(this);\n\n setupInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled: this.disabled,\n });\n }\n\n ngOnInit(): void {\n if (this.value() === undefined) {\n throw new Error('ngpTabButton: value is required');\n }\n }\n\n ngOnDestroy(): void {\n this.state().unregisterTab(this);\n }\n\n /**\n * Select the tab this trigger controls\n */\n @HostListener('click')\n select(): void {\n if (this.disabled() === false) {\n this.state().select(this.value()!);\n }\n }\n\n /**\n * On focus select the tab this trigger controls if activateOnFocus is true\n */\n @HostListener('focus')\n protected activateOnFocus(): void {\n if (this.state().activateOnFocus()) {\n this.select();\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * Apply the `ngpTabList` directive to an element that represents the list of tab buttons.\n */\n@Directive({\n selector: '[ngpTabList]',\n exportAs: 'ngpTabList',\n host: {\n role: 'tablist',\n '[attr.aria-orientation]': 'state().orientation()',\n '[attr.data-orientation]': 'state().orientation()',\n },\n})\nexport class NgpTabList {\n /**\n * Access the tabset state\n */\n protected readonly state = injectTabsetState();\n}\n","import { InjectionToken, inject } from '@angular/core';\nimport type { NgpTabPanel } from './tab-panel';\n\nexport const NgpTabPanelToken = new InjectionToken<NgpTabPanel>('NgpTabPanelToken');\n\n/**\n * Inject the TabPanel directive instance\n * @returns The TabPanel directive instance\n */\nexport function injectTabPanel(): NgpTabPanel {\n return inject(NgpTabPanelToken);\n}\n","import { Directive, OnInit, computed, input } from '@angular/core';\nimport { injectTabsetState } from '../tabset/tabset-state';\nimport { NgpTabPanelToken } from './tab-panel-token';\n\n/**\n * Apply the `ngpTabPanel` directive to an element that represents the content of a tab.\n */\n@Directive({\n selector: '[ngpTabPanel]',\n exportAs: 'ngpTabPanel',\n providers: [{ provide: NgpTabPanelToken, useExisting: NgpTabPanel }],\n host: {\n role: 'tabpanel',\n tabIndex: '0',\n '[id]': 'panelId()',\n '[attr.aria-labelledby]': 'labelledBy()',\n '[attr.data-active]': 'active() ? \"\" : null',\n '[attr.data-orientation]': 'state().orientation()',\n },\n})\nexport class NgpTabPanel implements OnInit {\n /**\n * Access the tabset\n */\n protected readonly state = injectTabsetState();\n\n /**\n * The value of the tab\n * @required\n */\n readonly value = input<string>(undefined, { alias: 'ngpTabPanelValue' });\n\n /**\n * Determine the id of the tab panel\n * @internal\n */\n readonly id = input<string>();\n\n /**\n * Determine a unique id for the tab panel if not provided\n * @internal\n */\n protected readonly panelId = computed(\n () => this.id() ?? `${this.state().id()}-panel-${this.value()}`,\n );\n\n /**\n * Determine the aria-labelledby of the tab panel\n * @internal\n */\n protected readonly labelledBy = computed(() => `${this.state().id()}-button-${this.value()}`);\n\n /**\n * Whether the tab is active\n */\n protected readonly active = computed(() => this.state().selectedTab() === this.value());\n\n ngOnInit(): void {\n if (this.value() === undefined) {\n throw new Error('ngpTabPanel: value is required');\n }\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, output, signal } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { explicitEffect } from 'ng-primitives/internal';\nimport { injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectTabsConfig } from '../config/tabs-config';\nimport type { NgpTabButton } from '../tab-button/tab-button';\nimport { provideTabsetState, tabsetState } from './tabset-state';\n\n/**\n * Apply the `ngpTabset` directive to an element to manage the tabs.\n */\n@Directive({\n selector: '[ngpTabset]',\n exportAs: 'ngpTabset',\n providers: [provideTabsetState()],\n hostDirectives: [NgpRovingFocusGroup],\n host: {\n '[attr.id]': 'state.id()',\n '[attr.data-orientation]': 'state.orientation()',\n },\n})\nexport class NgpTabset {\n /**\n * Access the global tabset configuration\n */\n private readonly config = injectTabsConfig();\n\n /**\n * Access the roving focus group state\n */\n private readonly rovingFocusGroupState = injectRovingFocusGroupState();\n\n /**\n * Define the id for the tabset\n */\n readonly id = input<string>(uniqueId('ngp-tabset'));\n\n /**\n * Define the active tab\n */\n readonly value = input<string>(undefined, {\n alias: 'ngpTabsetValue',\n });\n\n /**\n * Emit the value of the selected tab when it changes\n */\n readonly valueChange = output<string | undefined>({\n alias: 'ngpTabsetValueChange',\n });\n\n /**\n * The orientation of the tabset\n * @default 'horizontal'\n */\n readonly orientation = input<NgpOrientation>(this.config.orientation, {\n alias: 'ngpTabsetOrientation',\n });\n\n /**\n * Whether tabs should activate on focus\n */\n readonly activateOnFocus = input<boolean, BooleanInput>(this.config.activateOnFocus, {\n alias: 'ngpTabsetActivateOnFocus',\n transform: booleanAttribute,\n });\n\n /**\n * Access the tabs within the tabset\n * @internal\n */\n readonly buttons = signal<NgpTabButton[]>([]);\n\n /**\n * @internal\n * Get the id of the selected tab\n */\n readonly selectedTab = computed(() => {\n const buttons = this.buttons();\n\n // if there are no tabs then return the selected value\n // if there is a value set and a tab with that value exists, return the value\n if (buttons.length === 0 || buttons.some(button => button.value() === this.state.value())) {\n return this.state.value();\n }\n\n // otherwise return the first non-disabled tab's value\n return buttons.find(button => !button.disabled())?.value();\n });\n\n /**\n * The state of the tabset\n */\n protected readonly state = tabsetState<NgpTabset>(this);\n\n constructor() {\n explicitEffect([this.state.orientation], ([orientation]) =>\n this.rovingFocusGroupState().orientation.set(orientation),\n );\n }\n\n /**\n * Select a tab by its value\n * @param value The value of the tab to select\n */\n select(value: string): void {\n // if the value is already selected, do nothing\n if (this.state.value() === value) {\n return;\n }\n\n this.state.value.set(value);\n this.valueChange.emit(value);\n }\n\n /**\n * @internal\n * Register a tab with the tabset\n */\n registerTab(tab: NgpTabButton): void {\n this.buttons.update(buttons => [...buttons, tab]);\n }\n\n /**\n * @internal\n * Unregister a tab with the tabset\n */\n unregisterTab(tab: NgpTabButton): void {\n this.buttons.update(buttons => buttons.filter(button => button !== tab));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAuBO,MAAM,iBAAiB,GAAkB;AAC9C,IAAA,WAAW,EAAE,YAAY;AACzB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,IAAI,EAAE,IAAI;CACX;AAEM,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,CAAC;AAEzF;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,MAA8B,EAAA;IAC9D,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,kBAAkB;AAC3B,YAAA,QAAQ,EAAE,EAAE,GAAG,iBAAiB,EAAE,GAAG,MAAM,EAAE;AAC9C,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,iBAAiB;AAC5E;;AC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primitives-tabs.mjs","sources":["../../../../packages/ng-primitives/tabs/src/config/tabs-config.ts","../../../../packages/ng-primitives/tabs/src/tabset/tabset-state.ts","../../../../packages/ng-primitives/tabs/src/tab-button/tab-button.ts","../../../../packages/ng-primitives/tabs/src/tab-list/tab-list.ts","../../../../packages/ng-primitives/tabs/src/tab-panel/tab-panel-token.ts","../../../../packages/ng-primitives/tabs/src/tab-panel/tab-panel.ts","../../../../packages/ng-primitives/tabs/src/tabset/tabset.ts","../../../../packages/ng-primitives/tabs/src/ng-primitives-tabs.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\n\nexport interface NgpTabsConfig {\n /**\n * The orientation of the tabset\n * @default 'horizontal'\n */\n orientation: NgpOrientation;\n\n /**\n * Whether tabs should activate on focus\n * @default true\n */\n activateOnFocus: boolean;\n\n /**\n * Whether focus should wrap within the tab list when using the keyboard.\n * @default true\n */\n wrap: boolean;\n}\n\nexport const defaultTabsConfig: NgpTabsConfig = {\n orientation: 'horizontal',\n activateOnFocus: true,\n wrap: true,\n};\n\nexport const NgpTabsConfigToken = new InjectionToken<NgpTabsConfig>('NgpTabsConfigToken');\n\n/**\n * Provide the default Tabs configuration\n * @param config The Tabs configuration\n * @returns The provider\n */\nexport function provideTabsConfig(config: Partial<NgpTabsConfig>): Provider[] {\n return [\n {\n provide: NgpTabsConfigToken,\n useValue: { ...defaultTabsConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tabs configuration\n * @returns The global Tabs configuration\n */\nexport function injectTabsConfig(): NgpTabsConfig {\n return inject(NgpTabsConfigToken, { optional: true }) ?? defaultTabsConfig;\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpTabset } from './tabset';\n\n/**\n * The state token for the Tabset primitive.\n */\nexport const NgpTabsetStateToken = createStateToken<NgpTabset>('Tabset');\n\n/**\n * Provides the Tabset state.\n */\nexport const provideTabsetState = createStateProvider(NgpTabsetStateToken);\n\n/**\n * Injects the Tabset state.\n */\nexport const injectTabsetState = createStateInjector<NgpTabset>(NgpTabsetStateToken);\n\n/**\n * The Tabset state registration function.\n */\nexport const tabsetState = createState(NgpTabsetStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n Directive,\n HOST_TAG_NAME,\n HostListener,\n OnDestroy,\n OnInit,\n booleanAttribute,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * Apply the `ngpTabButton` directive to an element within a tab list to represent a tab button. This directive should be applied to a button element.\n */\n@Directive({\n selector: '[ngpTabButton]',\n exportAs: 'ngpTabButton',\n host: {\n role: 'tab',\n '[attr.id]': 'buttonId()',\n '[attr.aria-controls]': 'ariaControls()',\n '[attr.data-active]': 'active() ? \"\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.disabled]': 'tagName === \"button\" && disabled() ? \"\" : null',\n '[attr.data-orientation]': 'state().orientation()',\n },\n hostDirectives: [\n {\n directive: NgpRovingFocusItem,\n inputs: ['ngpRovingFocusItemDisabled: ngpTabButtonDisabled'],\n },\n ],\n})\nexport class NgpTabButton implements OnInit, OnDestroy {\n /**\n * Access the tag host name\n */\n protected readonly tagName = inject(HOST_TAG_NAME);\n\n /**\n * Access the tabset state\n */\n protected readonly state = injectTabsetState();\n\n /**\n * The value of the tab this trigger controls\n * @required\n */\n readonly value = input<string>(undefined, { alias: 'ngpTabButtonValue' });\n\n /**\n * Whether the tab is disabled\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTabButtonDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Determine the id of the tab button\n * @internal\n */\n readonly id = input<string>();\n\n /**\n * Determine a unique id for the tab button if not provided\n * @internal\n */\n readonly buttonId = computed(() => this.id() ?? `${this.state().id()}-button-${this.value()}`);\n\n /**\n * Determine the aria-controls of the tab button\n * @internal\n */\n readonly ariaControls = computed(() => `${this.state().id()}-panel-${this.value()}`);\n\n /**\n * Whether the tab is active\n */\n readonly active = computed(() => this.state().selectedTab() === this.value());\n\n constructor() {\n this.state().registerTab(this);\n\n ngpInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled: this.disabled,\n });\n }\n\n ngOnInit(): void {\n if (this.value() === undefined) {\n throw new Error('ngpTabButton: value is required');\n }\n }\n\n ngOnDestroy(): void {\n this.state().unregisterTab(this);\n }\n\n /**\n * Select the tab this trigger controls\n */\n @HostListener('click')\n select(): void {\n if (this.disabled() === false) {\n this.state().select(this.value()!);\n }\n }\n\n /**\n * On focus select the tab this trigger controls if activateOnFocus is true\n */\n @HostListener('focus')\n protected activateOnFocus(): void {\n if (this.state().activateOnFocus()) {\n this.select();\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * Apply the `ngpTabList` directive to an element that represents the list of tab buttons.\n */\n@Directive({\n selector: '[ngpTabList]',\n exportAs: 'ngpTabList',\n host: {\n role: 'tablist',\n '[attr.aria-orientation]': 'state().orientation()',\n '[attr.data-orientation]': 'state().orientation()',\n },\n})\nexport class NgpTabList {\n /**\n * Access the tabset state\n */\n protected readonly state = injectTabsetState();\n}\n","import { InjectionToken, inject } from '@angular/core';\nimport type { NgpTabPanel } from './tab-panel';\n\nexport const NgpTabPanelToken = new InjectionToken<NgpTabPanel>('NgpTabPanelToken');\n\n/**\n * Inject the TabPanel directive instance\n * @returns The TabPanel directive instance\n */\nexport function injectTabPanel(): NgpTabPanel {\n return inject(NgpTabPanelToken);\n}\n","import { Directive, OnInit, computed, input } from '@angular/core';\nimport { injectTabsetState } from '../tabset/tabset-state';\nimport { NgpTabPanelToken } from './tab-panel-token';\n\n/**\n * Apply the `ngpTabPanel` directive to an element that represents the content of a tab.\n */\n@Directive({\n selector: '[ngpTabPanel]',\n exportAs: 'ngpTabPanel',\n providers: [{ provide: NgpTabPanelToken, useExisting: NgpTabPanel }],\n host: {\n role: 'tabpanel',\n tabIndex: '0',\n '[id]': 'panelId()',\n '[attr.aria-labelledby]': 'labelledBy()',\n '[attr.data-active]': 'active() ? \"\" : null',\n '[attr.data-orientation]': 'state().orientation()',\n },\n})\nexport class NgpTabPanel implements OnInit {\n /**\n * Access the tabset\n */\n protected readonly state = injectTabsetState();\n\n /**\n * The value of the tab\n * @required\n */\n readonly value = input<string>(undefined, { alias: 'ngpTabPanelValue' });\n\n /**\n * Determine the id of the tab panel\n * @internal\n */\n readonly id = input<string>();\n\n /**\n * Determine a unique id for the tab panel if not provided\n * @internal\n */\n protected readonly panelId = computed(\n () => this.id() ?? `${this.state().id()}-panel-${this.value()}`,\n );\n\n /**\n * Determine the aria-labelledby of the tab panel\n * @internal\n */\n protected readonly labelledBy = computed(() => `${this.state().id()}-button-${this.value()}`);\n\n /**\n * Whether the tab is active\n */\n protected readonly active = computed(() => this.state().selectedTab() === this.value());\n\n ngOnInit(): void {\n if (this.value() === undefined) {\n throw new Error('ngpTabPanel: value is required');\n }\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, output, signal } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { explicitEffect } from 'ng-primitives/internal';\nimport { injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectTabsConfig } from '../config/tabs-config';\nimport type { NgpTabButton } from '../tab-button/tab-button';\nimport { provideTabsetState, tabsetState } from './tabset-state';\n\n/**\n * Apply the `ngpTabset` directive to an element to manage the tabs.\n */\n@Directive({\n selector: '[ngpTabset]',\n exportAs: 'ngpTabset',\n providers: [provideTabsetState()],\n hostDirectives: [NgpRovingFocusGroup],\n host: {\n '[attr.id]': 'state.id()',\n '[attr.data-orientation]': 'state.orientation()',\n },\n})\nexport class NgpTabset {\n /**\n * Access the global tabset configuration\n */\n private readonly config = injectTabsConfig();\n\n /**\n * Access the roving focus group state\n */\n private readonly rovingFocusGroupState = injectRovingFocusGroupState();\n\n /**\n * Define the id for the tabset\n */\n readonly id = input<string>(uniqueId('ngp-tabset'));\n\n /**\n * Define the active tab\n */\n readonly value = input<string>(undefined, {\n alias: 'ngpTabsetValue',\n });\n\n /**\n * Emit the value of the selected tab when it changes\n */\n readonly valueChange = output<string | undefined>({\n alias: 'ngpTabsetValueChange',\n });\n\n /**\n * The orientation of the tabset\n * @default 'horizontal'\n */\n readonly orientation = input<NgpOrientation>(this.config.orientation, {\n alias: 'ngpTabsetOrientation',\n });\n\n /**\n * Whether tabs should activate on focus\n */\n readonly activateOnFocus = input<boolean, BooleanInput>(this.config.activateOnFocus, {\n alias: 'ngpTabsetActivateOnFocus',\n transform: booleanAttribute,\n });\n\n /**\n * Access the tabs within the tabset\n * @internal\n */\n readonly buttons = signal<NgpTabButton[]>([]);\n\n /**\n * @internal\n * Get the id of the selected tab\n */\n readonly selectedTab = computed(() => {\n const buttons = this.buttons();\n\n // if there are no tabs then return the selected value\n // if there is a value set and a tab with that value exists, return the value\n if (buttons.length === 0 || buttons.some(button => button.value() === this.state.value())) {\n return this.state.value();\n }\n\n // otherwise return the first non-disabled tab's value\n return buttons.find(button => !button.disabled())?.value();\n });\n\n /**\n * The state of the tabset\n */\n protected readonly state = tabsetState<NgpTabset>(this);\n\n constructor() {\n explicitEffect([this.state.orientation], ([orientation]) =>\n this.rovingFocusGroupState().orientation.set(orientation),\n );\n }\n\n /**\n * Select a tab by its value\n * @param value The value of the tab to select\n */\n select(value: string): void {\n // if the value is already selected, do nothing\n if (this.state.value() === value) {\n return;\n }\n\n this.state.value.set(value);\n this.valueChange.emit(value);\n }\n\n /**\n * @internal\n * Register a tab with the tabset\n */\n registerTab(tab: NgpTabButton): void {\n this.buttons.update(buttons => [...buttons, tab]);\n }\n\n /**\n * @internal\n * Unregister a tab with the tabset\n */\n unregisterTab(tab: NgpTabButton): void {\n this.buttons.update(buttons => buttons.filter(button => button !== tab));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAuBO,MAAM,iBAAiB,GAAkB;AAC9C,IAAA,WAAW,EAAE,YAAY;AACzB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,IAAI,EAAE,IAAI;CACX;AAEM,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,CAAC;AAEzF;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,MAA8B,EAAA;IAC9D,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,kBAAkB;AAC3B,YAAA,QAAQ,EAAE,EAAE,GAAG,iBAAiB,EAAE,GAAG,MAAM,EAAE;AAC9C,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,iBAAiB;AAC5E;;AC3CA;;AAEG;AACI,MAAM,mBAAmB,GAAG,gBAAgB,CAAY,QAAQ,CAAC;AAExE;;AAEG;MACU,kBAAkB,GAAG,mBAAmB,CAAC,mBAAmB;AAEzE;;AAEG;MACU,iBAAiB,GAAG,mBAAmB,CAAY,mBAAmB;AAEnF;;AAEG;AACI,MAAM,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC;;ACV3D;;AAEG;MAoBU,YAAY,CAAA;AAiDvB,IAAA,WAAA,GAAA;AAhDA;;AAEG;AACgB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,aAAa,CAAC;AAElD;;AAEG;QACgB,IAAA,CAAA,KAAK,GAAG,iBAAiB,EAAE;AAE9C;;;AAGG;QACM,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,SAAS,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;AAEzE;;;AAGG;A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AA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,uBAAA,EAAA,qBAAA,EAAA,EAAA,EAAA,SAAA,EAPT,CAAC,kBAAkB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAOtB,SAAS,EAAA,UAAA,EAAA,CAAA;kBAVrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,SAAS,EAAE,CAAC,kBAAkB,EAAE,CAAC;oBACjC,cAAc,EAAE,CAAC,mBAAmB,CAAC;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,WAAW,EAAE,YAAY;AACzB,wBAAA,yBAAyB,EAAE,qBAAqB;AACjD,qBAAA;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { input, booleanAttribute, Directive } from '@angular/core';
3
3
  import { setupFormControl } from 'ng-primitives/form-field';
4
- import { setupInteractions } from 'ng-primitives/interactions';
4
+ import { ngpInteractions } from 'ng-primitives/interactions';
5
5
  import { uniqueId } from 'ng-primitives/utils';
6
6
  import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
7
7
 
@@ -38,7 +38,7 @@ class NgpTextarea {
38
38
  * The state of the textarea.
39
39
  */
40
40
  this.state = textareaState(this);
41
- setupInteractions({
41
+ ngpInteractions({
42
42
  hover: true,
43
43
  press: true,
44
44
  focus: true,
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-textarea.mjs","sources":["../../../../packages/ng-primitives/textarea/src/textarea/textarea-state.ts","../../../../packages/ng-primitives/textarea/src/textarea/textarea.ts","../../../../packages/ng-primitives/textarea/src/ng-primitives-textarea.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpTextarea } from './textarea';\n\n/**\n * The state token for the Textarea primitive.\n */\nexport const NgpTextareaStateToken = createStateToken<NgpTextarea>('Textarea');\n\n/**\n * Provides the Textarea state.\n */\nexport const provideTextareaState = createStateProvider(NgpTextareaStateToken);\n\n/**\n * Injects the Textarea state.\n */\nexport const injectTextareaState = createStateInjector<NgpTextarea>(NgpTextareaStateToken);\n\n/**\n * The Textarea state registration function.\n */\nexport const textareaState = createState(NgpTextareaStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { setupInteractions } from 'ng-primitives/interactions';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { provideTextareaState, textareaState } from './textarea-state';\n\n@Directive({\n selector: '[ngpTextarea]',\n exportAs: 'ngpTextarea',\n providers: [provideTextareaState()],\n host: {\n '[id]': 'id()',\n '[attr.disabled]': 'disabled() ? \"\" : null',\n },\n})\nexport class NgpTextarea {\n /**\n * The id of the textarea. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-textarea'));\n\n /**\n * Whether the element is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute,\n });\n\n /**\n * The state of the textarea.\n */\n protected readonly state = textareaState<NgpTextarea>(this);\n\n constructor() {\n setupInteractions({\n hover: true,\n press: true,\n focus: true,\n disabled: this.state.disabled,\n });\n setupFormControl({ id: this.state.id, disabled: this.state.disabled });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,GAAG,gBAAgB,CAAc,UAAU,CAAC;AAE9E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAC,qBAAqB;AAE7E;;AAEG;MACU,mBAAmB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A,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,eAAA,EAAA,0BAAA,EAAA,EAAA,EAAA,SAAA,EANX,CAAC,oBAAoB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAMxB,WAAW,EAAA,UAAA,EAAA,CAAA;kBATvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,SAAS,EAAE,CAAC,oBAAoB,EAAE,CAAC;AACnC,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE,MAAM;AACd,wBAAA,iBAAiB,EAAE,wBAAwB;AAC5C,qBAAA;AACF,iBAAA;;;ACfD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-textarea.mjs","sources":["../../../../packages/ng-primitives/textarea/src/textarea/textarea-state.ts","../../../../packages/ng-primitives/textarea/src/textarea/textarea.ts","../../../../packages/ng-primitives/textarea/src/ng-primitives-textarea.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpTextarea } from './textarea';\n\n/**\n * The state token for the Textarea primitive.\n */\nexport const NgpTextareaStateToken = createStateToken<NgpTextarea>('Textarea');\n\n/**\n * Provides the Textarea state.\n */\nexport const provideTextareaState = createStateProvider(NgpTextareaStateToken);\n\n/**\n * Injects the Textarea state.\n */\nexport const injectTextareaState = createStateInjector<NgpTextarea>(NgpTextareaStateToken);\n\n/**\n * The Textarea state registration function.\n */\nexport const textareaState = createState(NgpTextareaStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { provideTextareaState, textareaState } from './textarea-state';\n\n@Directive({\n selector: '[ngpTextarea]',\n exportAs: 'ngpTextarea',\n providers: [provideTextareaState()],\n host: {\n '[id]': 'id()',\n '[attr.disabled]': 'disabled() ? \"\" : null',\n },\n})\nexport class NgpTextarea {\n /**\n * The id of the textarea. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-textarea'));\n\n /**\n * Whether the element is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute,\n });\n\n /**\n * The state of the textarea.\n */\n protected readonly state = textareaState<NgpTextarea>(this);\n\n constructor() {\n ngpInteractions({\n hover: true,\n press: true,\n focus: true,\n disabled: this.state.disabled,\n });\n setupFormControl({ id: this.state.id, disabled: this.state.disabled });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,GAAG,gBAAgB,CAAc,UAAU,CAAC;AAE9E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAC,qBAAqB;AAE7E;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAc,qBAAqB;AAEzF;;AAEG;AACI,MAAM,aAAa,GAAG,WAAW,CAAC,qBAAqB,CAAC;;MCVlD,WAAW,CAAA;AAkBtB,IAAA,WAAA,GAAA;AAjBA;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,QAAQ,CAAC,cAAc,CAAC,CAAC;AAErD;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC;AAEF;;AAEG;AACgB,QAAA,IAAA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A,CAAA;kBATvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,SAAS,EAAE,CAAC,oBAAoB,EAAE,CAAC;AACnC,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE,MAAM;AACd,wBAAA,iBAAiB,EAAE,wBAAwB;AAC5C,qBAAA;AACF,iBAAA;;;ACfD;;AAEG;;;;"}
@@ -2,8 +2,9 @@ import { setupOverlayArrow, injectOverlay, injectOverlayContext, coerceOffset, c
2
2
  export { injectOverlayContext as injectTooltipContext } from 'ng-primitives/portal';
3
3
  import * as i0 from '@angular/core';
4
4
  import { InjectionToken, inject, Directive, input, Component, ElementRef, Injector, ViewContainerRef, booleanAttribute, numberAttribute, signal, computed } from '@angular/core';
5
- import { explicitEffect, setupHover, setupOverflowListener } from 'ng-primitives/internal';
5
+ import { explicitEffect, setupOverflowListener } from 'ng-primitives/internal';
6
6
  import { isString } from 'ng-primitives/utils';
7
+ import { ngpHoverInteraction } from 'ng-primitives/interactions';
7
8
  import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
8
9
 
9
10
  const defaultTooltipConfig = {
@@ -68,7 +69,7 @@ class NgpTooltip {
68
69
  this.id = input(this.overlay.id());
69
70
  explicitEffect([this.id], ([id]) => this.overlay.id.set(id));
70
71
  // if the mouse moves over the tooltip, we want to keep it open
71
- setupHover({
72
+ ngpHoverInteraction({
72
73
  hoverStart: () => this.overlay.cancelPendingClose(),
73
74
  hoverEnd: () => this.overlay.hide(),
74
75
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-tooltip.mjs","sources":["../../../../packages/ng-primitives/tooltip/src/config/tooltip-config.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-arrow/tooltip-arrow.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-text-content/tooltip-text-content.component.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger.ts","../../../../packages/ng-primitives/tooltip/src/ng-primitives-tooltip.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\nimport { NgpOffset } from 'ng-primitives/portal';\n\nexport interface NgpTooltipConfig {\n /**\n * Define the offset of the tooltip relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n * @default 4\n */\n offset: NgpOffset;\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 500\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container element or selector in to which the tooltip should be attached.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n\n /**\n * Whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n showOnOverflow: boolean;\n\n /**\n * Whether to use the text content of the trigger element as the tooltip content.\n * @default true\n */\n useTextContent: boolean;\n}\n\nexport const defaultTooltipConfig: NgpTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 500,\n flip: true,\n container: 'body',\n showOnOverflow: false,\n useTextContent: true,\n};\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 { Directive } from '@angular/core';\nimport { setupOverlayArrow } from 'ng-primitives/portal';\n\n@Directive({\n selector: '[ngpTooltipArrow]',\n exportAs: 'ngpTooltipArrow',\n})\nexport class NgpTooltipArrow {\n constructor() {\n setupOverlayArrow();\n }\n}\n","import { Directive, input } from '@angular/core';\nimport { explicitEffect, setupHover } from 'ng-primitives/internal';\nimport { injectOverlay } from 'ng-primitives/portal';\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 host: {\n role: 'tooltip',\n '[id]': 'id()',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-tooltip-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-tooltip-transform-origin]': 'overlay.transformOrigin()',\n '[attr.data-placement]': 'overlay.finalPlacement()',\n 'data-overlay': '',\n },\n})\nexport class NgpTooltip {\n /**\n * Access the overlay.\n */\n protected readonly overlay = injectOverlay();\n\n /**\n * The unique id of the tooltip.\n */\n readonly id = input(this.overlay.id());\n\n constructor() {\n explicitEffect([this.id], ([id]) => this.overlay.id.set(id));\n\n // if the mouse moves over the tooltip, we want to keep it open\n setupHover({\n hoverStart: () => this.overlay.cancelPendingClose(),\n hoverEnd: () => this.overlay.hide(),\n });\n }\n}\n","import { Component } from '@angular/core';\nimport { injectOverlayContext } from 'ng-primitives/portal';\nimport { NgpTooltip } from '../tooltip/tooltip';\n\n/**\n * Internal component for wrapping string content in tooltip portals\n * @internal\n */\n@Component({\n template: '{{ content() }}',\n hostDirectives: [NgpTooltip],\n host: {\n // Used only for styling, since the host directive isn’t added to the DOM.\n // This acts as the styling entry point.\n ngpTooltip: '',\n },\n})\nexport class NgpTooltipTextContentComponent {\n /**\n * The string content to display\n */\n readonly content = injectOverlayContext();\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\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<NgpTooltipTrigger<unknown>>(\n NgpTooltipTriggerStateToken,\n);\n\n/**\n * The TooltipTrigger state registration function.\n */\nexport const tooltipTriggerState = createState(NgpTooltipTriggerStateToken);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n Signal,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { setupOverflowListener } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n coerceOffset,\n NgpOffset,\n NgpOffsetInput,\n} from 'ng-primitives/portal';\nimport { isString } from 'ng-primitives/utils';\nimport { injectTooltipConfig } from '../config/tooltip-config';\nimport { NgpTooltipTextContentComponent } from '../tooltip-text-content/tooltip-text-content.component';\nimport { provideTooltipTriggerState, tooltipTriggerState } from './tooltip-trigger-state';\n\ntype TooltipInput<T> = NgpOverlayContent<T> | string | null | undefined;\n\n/**\n * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.\n */\n@Directive({\n selector: '[ngpTooltipTrigger]',\n exportAs: 'ngpTooltipTrigger',\n providers: [provideTooltipTriggerState()],\n host: {\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.aria-describedby]': 'overlay()?.ariaDescribedBy()',\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 trigger element\n */\n private readonly trigger = inject(ElementRef<HTMLElement>);\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global tooltip configuration.\n */\n private readonly config = injectTooltipConfig();\n\n /**\n * Access the tooltip template ref.\n */\n readonly tooltip = input<NgpOverlayContent<T> | string | null, TooltipInput<T>>(null, {\n alias: 'ngpTooltipTrigger',\n transform: (value: TooltipInput<T>) => (value && !isString(value) ? value : null),\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTooltipTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<NgpTooltipPlacement>(this.config.placement, {\n alias: 'ngpTooltipTriggerPlacement',\n });\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n * @default 0\n */\n readonly offset = input<NgpOffset, NgpOffsetInput>(this.config.offset, {\n alias: 'ngpTooltipTriggerOffset',\n transform: coerceOffset,\n });\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 500\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpTooltipTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpTooltipTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @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 | string | null>(this.config.container, {\n alias: 'ngpTooltipTriggerContainer',\n });\n\n /**\n * Define whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n readonly showOnOverflow = input<boolean, BooleanInput>(this.config.showOnOverflow, {\n alias: 'ngpTooltipTriggerShowOnOverflow',\n transform: booleanAttribute,\n });\n\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpTooltipTriggerContext',\n });\n\n /**\n * Define whether to use the text content of the trigger element as the tooltip content.\n * When enabled, the tooltip will display the text content of the trigger element.\n * @default true\n */\n readonly useTextContent = input<boolean, BooleanInput>(this.config.useTextContent, {\n alias: 'ngpTooltipTriggerUseTextContent',\n transform: booleanAttribute,\n });\n\n /**\n * The overlay that manages the tooltip\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T | string> | null>(null);\n\n /**\n * The unique id of the tooltip.\n */\n readonly tooltipId = signal<string | undefined>(undefined);\n\n /**\n * The open state of the tooltip.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Determine if the trigger element has overflow.\n */\n private readonly hasOverflow: Signal<boolean>;\n\n /**\n * Store the state of the tooltip.\n * @internal\n */\n readonly state = tooltipTriggerState<NgpTooltipTrigger<T>>(this);\n\n constructor() {\n this.hasOverflow = setupOverflowListener(this.trigger.nativeElement, {\n disabled: computed(() => !this.state.showOnOverflow()),\n });\n }\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Show the tooltip.\n */\n show(): void {\n // If the trigger is disabled, do not show the tooltip\n if (this.state.disabled() || this.open()) {\n // we mark this as show again to stop it dismissing\n this.overlay()?.cancelPendingClose();\n return;\n }\n\n // if we should only show when there is overflow, check if the trigger has overflow\n if (this.state.showOnOverflow() && !this.hasOverflow()) {\n // If the trigger does not have overflow, do not show the tooltip\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n this.overlay()?.show();\n }\n\n /**\n * Hide the tooltip.\n */\n hide(): void {\n // If the trigger is disabled, do nothing\n if (this.state.disabled()) {\n return;\n }\n\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the tooltip\n */\n private createOverlay(): void {\n // Determine the content and context based on useTextContent setting\n const shouldUseTextContent = this.state.useTextContent();\n let content = this.state.tooltip();\n let context: Signal<T | string | undefined> = this.state.context;\n\n if (!content) {\n if (!shouldUseTextContent) {\n if (ngDevMode) {\n throw new Error(\n '[ngpTooltipTrigger]: Tooltip must be a string, TemplateRef, or ComponentType. Alternatively, set useTextContent to true if none is provided.',\n );\n }\n\n return;\n }\n\n const textContent = this.trigger.nativeElement.textContent?.trim() || '';\n if (ngDevMode && !textContent) {\n console.warn(\n '[ngpTooltipTrigger]: useTextContent is enabled but trigger element has no text content',\n );\n return;\n }\n content = NgpTooltipTextContentComponent;\n context = signal(textContent);\n } else if (isString(content)) {\n context = signal(content);\n content = NgpTooltipTextContentComponent;\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T | string> = {\n content,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n context,\n container: this.state.container(),\n placement: this.state.placement,\n offset: this.state.offset(),\n flip: this.state.flip(),\n showDelay: this.state.showDelay(),\n hideDelay: this.state.hideDelay(),\n closeOnEscape: true,\n closeOnOutsideClick: true,\n viewContainerRef: this.viewContainerRef,\n };\n\n // Create the overlay instance\n this.overlay.set(createOverlay(config));\n }\n\n /**\n * Set the tooltip id.\n */\n setTooltipId(id: string): void {\n this.tooltipId.set(id);\n }\n}\n\nexport type NgpTooltipPlacement =\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'top-start'\n | 'top-end'\n | 'right-start'\n | 'right-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end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AAA,gCAAA,EAAA,uBAAA,EAAA,8BAAA,EAAA,EAAA,EAAA,SAAA,EAXjB,CAAC,0BAA0B,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAW9B,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAd7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,SAAS,EAAE,CAAC,0BAA0B,EAAE,CAAC;AACzC,oBAAA,IAAI,EAAE;AACJ,wBAAA,kBAAkB,EAAE,oBAAoB;AACxC,wBAAA,sBAAsB,EAAE,8BAA8B;AACtD,wBAAA,yBAAyB,EAAE,8BAA8B;AACzD,wBAAA,cAAc,EAAE,QAAQ;AACxB,wBAAA,cAAc,EAAE,QAAQ;AACxB,wBAAA,SAAS,EAAE,QAAQ;AACnB,wBAAA,QAAQ,EAAE,QAAQ;AACnB,qBAAA;AACF,iBAAA;;;AChDD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-tooltip.mjs","sources":["../../../../packages/ng-primitives/tooltip/src/config/tooltip-config.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-arrow/tooltip-arrow.ts","../../../../packages/ng-primitives/tooltip/src/tooltip/tooltip.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-text-content/tooltip-text-content.component.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger-state.ts","../../../../packages/ng-primitives/tooltip/src/tooltip-trigger/tooltip-trigger.ts","../../../../packages/ng-primitives/tooltip/src/ng-primitives-tooltip.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\nimport { NgpOffset } from 'ng-primitives/portal';\n\nexport interface NgpTooltipConfig {\n /**\n * Define the offset of the tooltip relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n * @default 4\n */\n offset: NgpOffset;\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n placement: Placement;\n\n /**\n * Define the delay before the tooltip is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 500\n */\n hideDelay: number;\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container element or selector in to which the tooltip should be attached.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n\n /**\n * Whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n showOnOverflow: boolean;\n\n /**\n * Whether to use the text content of the trigger element as the tooltip content.\n * @default true\n */\n useTextContent: boolean;\n}\n\nexport const defaultTooltipConfig: NgpTooltipConfig = {\n offset: 4,\n placement: 'top',\n showDelay: 0,\n hideDelay: 500,\n flip: true,\n container: 'body',\n showOnOverflow: false,\n useTextContent: true,\n};\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 { Directive } from '@angular/core';\nimport { setupOverlayArrow } from 'ng-primitives/portal';\n\n@Directive({\n selector: '[ngpTooltipArrow]',\n exportAs: 'ngpTooltipArrow',\n})\nexport class NgpTooltipArrow {\n constructor() {\n setupOverlayArrow();\n }\n}\n","import { Directive, input } from '@angular/core';\nimport { ngpHoverInteraction } from 'ng-primitives/interactions';\nimport { explicitEffect } from 'ng-primitives/internal';\nimport { injectOverlay } from 'ng-primitives/portal';\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 host: {\n role: 'tooltip',\n '[id]': 'id()',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-tooltip-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-tooltip-transform-origin]': 'overlay.transformOrigin()',\n '[attr.data-placement]': 'overlay.finalPlacement()',\n 'data-overlay': '',\n },\n})\nexport class NgpTooltip {\n /**\n * Access the overlay.\n */\n protected readonly overlay = injectOverlay();\n\n /**\n * The unique id of the tooltip.\n */\n readonly id = input(this.overlay.id());\n\n constructor() {\n explicitEffect([this.id], ([id]) => this.overlay.id.set(id));\n\n // if the mouse moves over the tooltip, we want to keep it open\n ngpHoverInteraction({\n hoverStart: () => this.overlay.cancelPendingClose(),\n hoverEnd: () => this.overlay.hide(),\n });\n }\n}\n","import { Component } from '@angular/core';\nimport { injectOverlayContext } from 'ng-primitives/portal';\nimport { NgpTooltip } from '../tooltip/tooltip';\n\n/**\n * Internal component for wrapping string content in tooltip portals\n * @internal\n */\n@Component({\n template: '{{ content() }}',\n hostDirectives: [NgpTooltip],\n host: {\n // Used only for styling, since the host directive isn’t added to the DOM.\n // This acts as the styling entry point.\n ngpTooltip: '',\n },\n})\nexport class NgpTooltipTextContentComponent {\n /**\n * The string content to display\n */\n readonly content = injectOverlayContext();\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\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<NgpTooltipTrigger<unknown>>(\n NgpTooltipTriggerStateToken,\n);\n\n/**\n * The TooltipTrigger state registration function.\n */\nexport const tooltipTriggerState = createState(NgpTooltipTriggerStateToken);\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n Signal,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { setupOverflowListener } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n coerceOffset,\n NgpOffset,\n NgpOffsetInput,\n} from 'ng-primitives/portal';\nimport { isString } from 'ng-primitives/utils';\nimport { injectTooltipConfig } from '../config/tooltip-config';\nimport { NgpTooltipTextContentComponent } from '../tooltip-text-content/tooltip-text-content.component';\nimport { provideTooltipTriggerState, tooltipTriggerState } from './tooltip-trigger-state';\n\ntype TooltipInput<T> = NgpOverlayContent<T> | string | null | undefined;\n\n/**\n * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.\n */\n@Directive({\n selector: '[ngpTooltipTrigger]',\n exportAs: 'ngpTooltipTrigger',\n providers: [provideTooltipTriggerState()],\n host: {\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.aria-describedby]': 'overlay()?.ariaDescribedBy()',\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 trigger element\n */\n private readonly trigger = inject(ElementRef<HTMLElement>);\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global tooltip configuration.\n */\n private readonly config = injectTooltipConfig();\n\n /**\n * Access the tooltip template ref.\n */\n readonly tooltip = input<NgpOverlayContent<T> | string | null, TooltipInput<T>>(null, {\n alias: 'ngpTooltipTrigger',\n transform: (value: TooltipInput<T>) => (value && !isString(value) ? value : null),\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTooltipTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the tooltip relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<NgpTooltipPlacement>(this.config.placement, {\n alias: 'ngpTooltipTriggerPlacement',\n });\n\n /**\n * Define the offset of the tooltip relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n * @default 0\n */\n readonly offset = input<NgpOffset, NgpOffsetInput>(this.config.offset, {\n alias: 'ngpTooltipTriggerOffset',\n transform: coerceOffset,\n });\n\n /**\n * Define the delay before the tooltip is displayed.\n * @default 500\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpTooltipTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the tooltip is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpTooltipTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the tooltip should flip when there is not enough space for the tooltip.\n * @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 | string | null>(this.config.container, {\n alias: 'ngpTooltipTriggerContainer',\n });\n\n /**\n * Define whether the tooltip should only show when the trigger element overflows.\n * @default false\n */\n readonly showOnOverflow = input<boolean, BooleanInput>(this.config.showOnOverflow, {\n alias: 'ngpTooltipTriggerShowOnOverflow',\n transform: booleanAttribute,\n });\n\n /**\n * Provide context to the tooltip. This can be used to pass data to the tooltip content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpTooltipTriggerContext',\n });\n\n /**\n * Define whether to use the text content of the trigger element as the tooltip content.\n * When enabled, the tooltip will display the text content of the trigger element.\n * @default true\n */\n readonly useTextContent = input<boolean, BooleanInput>(this.config.useTextContent, {\n alias: 'ngpTooltipTriggerUseTextContent',\n transform: booleanAttribute,\n });\n\n /**\n * The overlay that manages the tooltip\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T | string> | null>(null);\n\n /**\n * The unique id of the tooltip.\n */\n readonly tooltipId = signal<string | undefined>(undefined);\n\n /**\n * The open state of the tooltip.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Determine if the trigger element has overflow.\n */\n private readonly hasOverflow: Signal<boolean>;\n\n /**\n * Store the state of the tooltip.\n * @internal\n */\n readonly state = tooltipTriggerState<NgpTooltipTrigger<T>>(this);\n\n constructor() {\n this.hasOverflow = setupOverflowListener(this.trigger.nativeElement, {\n disabled: computed(() => !this.state.showOnOverflow()),\n });\n }\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Show the tooltip.\n */\n show(): void {\n // If the trigger is disabled, do not show the tooltip\n if (this.state.disabled() || this.open()) {\n // we mark this as show again to stop it dismissing\n this.overlay()?.cancelPendingClose();\n return;\n }\n\n // if we should only show when there is overflow, check if the trigger has overflow\n if (this.state.showOnOverflow() && !this.hasOverflow()) {\n // If the trigger does not have overflow, do not show the tooltip\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n this.overlay()?.show();\n }\n\n /**\n * Hide the tooltip.\n */\n hide(): void {\n // If the trigger is disabled, do nothing\n if (this.state.disabled()) {\n return;\n }\n\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the tooltip\n */\n private createOverlay(): void {\n // Determine the content and context based on useTextContent setting\n const shouldUseTextContent = this.state.useTextContent();\n let content = this.state.tooltip();\n let context: Signal<T | string | undefined> = this.state.context;\n\n if (!content) {\n if (!shouldUseTextContent) {\n if (ngDevMode) {\n throw new Error(\n '[ngpTooltipTrigger]: Tooltip must be a string, TemplateRef, or ComponentType. Alternatively, set useTextContent to true if none is provided.',\n );\n }\n\n return;\n }\n\n const textContent = this.trigger.nativeElement.textContent?.trim() || '';\n if (ngDevMode && !textContent) {\n console.warn(\n '[ngpTooltipTrigger]: useTextContent is enabled but trigger element has no text content',\n );\n return;\n }\n content = NgpTooltipTextContentComponent;\n context = signal(textContent);\n } else if (isString(content)) {\n context = signal(content);\n content = NgpTooltipTextContentComponent;\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T | string> = {\n content,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n context,\n container: this.state.container(),\n placement: this.state.placement,\n offset: this.state.offset(),\n flip: this.state.flip(),\n showDelay: this.state.showDelay(),\n hideDelay: this.state.hideDelay(),\n closeOnEscape: true,\n closeOnOutsideClick: true,\n viewContainerRef: this.viewContainerRef,\n };\n\n // Create the overlay instance\n this.overlay.set(createOverlay(config));\n }\n\n /**\n * Set the tooltip id.\n */\n setTooltipId(id: string): void {\n this.tooltipId.set(id);\n }\n}\n\nexport type NgpTooltipPlacement =\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'top-start'\n | 'top-end'\n | 'right-start'\n | 'right-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAuDO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,MAAM;AACjB,IAA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EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,SAAS,EAAE,CAAC,0BAA0B,EAAE,CAAC;AACzC,oBAAA,IAAI,EAAE;AACJ,wBAAA,kBAAkB,EAAE,oBAAoB;AACxC,wBAAA,sBAAsB,EAAE,8BAA8B;AACtD,wBAAA,yBAAyB,EAAE,8BAA8B;AACzD,wBAAA,cAAc,EAAE,QAAQ;AACxB,wBAAA,cAAc,EAAE,QAAQ;AACxB,wBAAA,SAAS,EAAE,QAAQ;AACnB,wBAAA,QAAQ,EAAE,QAAQ;AACnB,qBAAA;AACF,iBAAA;;;AChDD;;AAEG;;;;"}
@@ -0,0 +1,30 @@
1
+ import { InjectionToken, Provider } from '@angular/core';
2
+ export interface NgpInteractionsConfig {
3
+ /** Whether all interactions are disabled */
4
+ disabled?: boolean;
5
+ /** Whether hover interactions are enabled */
6
+ hover?: boolean;
7
+ /** Whether focus interactions are enabled */
8
+ focus?: boolean;
9
+ /** Whether focus-visible interactions are enabled */
10
+ focusVisible?: boolean;
11
+ /** Whether press interactions are enabled */
12
+ press?: boolean;
13
+ }
14
+ export declare const defaultInteractionsConfig: NgpInteractionsConfig;
15
+ export declare const NgpInteractionsConfigToken: InjectionToken<NgpInteractionsConfig>;
16
+ /**
17
+ * Provide the default Interactions configuration
18
+ * @param config The Interactions configuration
19
+ * @returns The provider
20
+ */
21
+ export declare function provideInteractionsConfig(config: Partial<NgpInteractionsConfig>): Provider[];
22
+ /**
23
+ * Inject the Interactions configuration
24
+ * @returns The global Interactions configuration
25
+ */
26
+ export declare function injectInteractionsConfig(): NgpInteractionsConfig;
27
+ export declare function isHoverEnabled(): boolean;
28
+ export declare function isFocusEnabled(): boolean;
29
+ export declare function isFocusVisibleEnabled(): boolean;
30
+ export declare function isPressEnabled(): boolean;
@@ -8,4 +8,7 @@ export interface NgpFocusOptions {
8
8
  export interface NgpFocusState {
9
9
  isFocused: Signal<boolean>;
10
10
  }
11
- export declare function setupFocus({ focus, blur, focusWithin, disabled, }: NgpFocusOptions): NgpFocusState;
11
+ /**
12
+ * @internal
13
+ */
14
+ export declare function ngpFocusInteraction({ focus, blur, focusWithin, disabled, }: NgpFocusOptions): NgpFocusState;
@@ -6,4 +6,7 @@ export interface NgpFocusVisibleOptions {
6
6
  export interface NgpFocusVisibleState {
7
7
  isFocused: Signal<boolean>;
8
8
  }
9
- export declare function setupFocusVisible({ focusChange, disabled, }: NgpFocusVisibleOptions): NgpFocusVisibleState;
9
+ /**
10
+ * @internal
11
+ */
12
+ export declare function ngpFocusVisibleInteraction({ focusChange, disabled, }: NgpFocusVisibleOptions): NgpFocusVisibleState;
@@ -11,6 +11,7 @@ export interface NgpHoverState {
11
11
  * Programatically add the hover functionality to an element.
12
12
  * This is useful in cases where we can't necessarily use a HostDirective,
13
13
  * because there is a chance the directive has already been used.
14
+ * @internal
14
15
  */
15
- export declare function setupHover({ hoverStart, hoverEnd, disabled, }: NgpHoverOptions): NgpHoverState;
16
+ export declare function ngpHoverInteraction({ hoverStart, hoverEnd, disabled, }: NgpHoverOptions): NgpHoverState;
16
17
  export {};
@@ -1,6 +1,16 @@
1
+ import { ngpInteractions } from './interactions/interactions';
2
+ export { NgpInteractionsConfig, provideInteractionsConfig } from './config/interactions-config';
1
3
  export { NgpFocusVisible } from './focus-visible/focus-visible';
4
+ export { ngpFocusVisibleInteraction } from './focus-visible/focus-visible-interaction';
2
5
  export { NgpFocus } from './focus/focus';
6
+ export { ngpFocusInteraction } from './focus/focus-interaction';
3
7
  export { NgpHover } from './hover/hover';
8
+ export { ngpHoverInteraction } from './hover/hover-interaction';
9
+ export { ngpInteractions } from './interactions/interactions';
4
10
  export { NgpMove, NgpMoveEvent } from './move/move';
5
11
  export { NgpPress } from './press/press';
6
- export { setupInteractions } from './setup-interactions/setup-interactions';
12
+ export { ngpPressInteraction } from './press/press-interaction';
13
+ /**
14
+ * @deprecated use `ngpInteractions` instead
15
+ */
16
+ export { ngpInteractions as setupInteractions };
@@ -0,0 +1,20 @@
1
+ import { Signal } from '@angular/core';
2
+ export interface NgpInteractionOptions {
3
+ hover?: boolean;
4
+ press?: boolean;
5
+ focus?: boolean;
6
+ focusWithin?: boolean;
7
+ focusVisible?: boolean;
8
+ disabled?: Signal<boolean>;
9
+ }
10
+ /**
11
+ * Setup the interactions without relying on HostDirectives.
12
+ * @internal
13
+ */
14
+ export declare function ngpInteractions({ focus, hover, press, focusWithin, focusVisible, disabled, }: NgpInteractionOptions): void;
15
+ /**
16
+ * This function checks to see if a given interaction has already been setup on a given element.
17
+ * If it has, it returns the existing interaction state.
18
+ * If it has not, it sets up the interaction state for future checks.
19
+ */
20
+ export declare function hasInteraction(element: HTMLElement, interaction: string): boolean;
@@ -7,5 +7,8 @@ interface NgpPressOptions {
7
7
  pressStart?: () => void;
8
8
  pressEnd?: () => void;
9
9
  }
10
- export declare function setupPress({ pressStart, pressEnd, disabled, }: NgpPressOptions): NgpPressState;
10
+ /**
11
+ * @internal
12
+ */
13
+ export declare function ngpPressInteraction({ pressStart, pressEnd, disabled, }: NgpPressOptions): NgpPressState;
11
14
  export {};
@@ -1,6 +1,5 @@
1
1
  export { NgpExitAnimation, NgpExitAnimationRef, setupExitAnimation, } from './exit-animation/exit-animation';
2
2
  export { injectExitAnimationManager, NgpExitAnimationManager, provideExitAnimationManager, } from './exit-animation/exit-animation-manager';
3
- export * from './interactions/index';
4
3
  export * from './signals/explicit-effect';
5
4
  export * from './style-injector/style-injector';
6
5
  export * from './utilities/dom-removal';
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.82.0",
5
+ "version": "0.83.0",
6
6
  "keywords": [
7
7
  "angular",
8
8
  "primitives",
@@ -67,42 +67,38 @@
67
67
  "types": "./a11y/index.d.ts",
68
68
  "default": "./fesm2022/ng-primitives-a11y.mjs"
69
69
  },
70
- "./autofill": {
71
- "types": "./autofill/index.d.ts",
72
- "default": "./fesm2022/ng-primitives-autofill.mjs"
70
+ "./accordion": {
71
+ "types": "./accordion/index.d.ts",
72
+ "default": "./fesm2022/ng-primitives-accordion.mjs"
73
73
  },
74
74
  "./ai": {
75
75
  "types": "./ai/index.d.ts",
76
76
  "default": "./fesm2022/ng-primitives-ai.mjs"
77
77
  },
78
- "./button": {
79
- "types": "./button/index.d.ts",
80
- "default": "./fesm2022/ng-primitives-button.mjs"
81
- },
82
78
  "./avatar": {
83
79
  "types": "./avatar/index.d.ts",
84
80
  "default": "./fesm2022/ng-primitives-avatar.mjs"
85
81
  },
86
- "./accordion": {
87
- "types": "./accordion/index.d.ts",
88
- "default": "./fesm2022/ng-primitives-accordion.mjs"
82
+ "./checkbox": {
83
+ "types": "./checkbox/index.d.ts",
84
+ "default": "./fesm2022/ng-primitives-checkbox.mjs"
85
+ },
86
+ "./button": {
87
+ "types": "./button/index.d.ts",
88
+ "default": "./fesm2022/ng-primitives-button.mjs"
89
+ },
90
+ "./autofill": {
91
+ "types": "./autofill/index.d.ts",
92
+ "default": "./fesm2022/ng-primitives-autofill.mjs"
89
93
  },
90
94
  "./combobox": {
91
95
  "types": "./combobox/index.d.ts",
92
96
  "default": "./fesm2022/ng-primitives-combobox.mjs"
93
97
  },
94
- "./checkbox": {
95
- "types": "./checkbox/index.d.ts",
96
- "default": "./fesm2022/ng-primitives-checkbox.mjs"
97
- },
98
98
  "./common": {
99
99
  "types": "./common/index.d.ts",
100
100
  "default": "./fesm2022/ng-primitives-common.mjs"
101
101
  },
102
- "./date-time": {
103
- "types": "./date-time/index.d.ts",
104
- "default": "./fesm2022/ng-primitives-date-time.mjs"
105
- },
106
102
  "./date-picker": {
107
103
  "types": "./date-picker/index.d.ts",
108
104
  "default": "./fesm2022/ng-primitives-date-picker.mjs"
@@ -111,6 +107,10 @@
111
107
  "types": "./date-time-luxon/index.d.ts",
112
108
  "default": "./fesm2022/ng-primitives-date-time-luxon.mjs"
113
109
  },
110
+ "./date-time": {
111
+ "types": "./date-time/index.d.ts",
112
+ "default": "./fesm2022/ng-primitives-date-time.mjs"
113
+ },
114
114
  "./dialog": {
115
115
  "types": "./dialog/index.d.ts",
116
116
  "default": "./fesm2022/ng-primitives-dialog.mjs"
@@ -123,6 +123,14 @@
123
123
  "types": "./form-field/index.d.ts",
124
124
  "default": "./fesm2022/ng-primitives-form-field.mjs"
125
125
  },
126
+ "./focus-trap": {
127
+ "types": "./focus-trap/index.d.ts",
128
+ "default": "./fesm2022/ng-primitives-focus-trap.mjs"
129
+ },
130
+ "./input": {
131
+ "types": "./input/index.d.ts",
132
+ "default": "./fesm2022/ng-primitives-input.mjs"
133
+ },
126
134
  "./interactions": {
127
135
  "types": "./interactions/index.d.ts",
128
136
  "default": "./fesm2022/ng-primitives-interactions.mjs"
@@ -131,18 +139,10 @@
131
139
  "types": "./internal/index.d.ts",
132
140
  "default": "./fesm2022/ng-primitives-internal.mjs"
133
141
  },
134
- "./input": {
135
- "types": "./input/index.d.ts",
136
- "default": "./fesm2022/ng-primitives-input.mjs"
137
- },
138
142
  "./listbox": {
139
143
  "types": "./listbox/index.d.ts",
140
144
  "default": "./fesm2022/ng-primitives-listbox.mjs"
141
145
  },
142
- "./focus-trap": {
143
- "types": "./focus-trap/index.d.ts",
144
- "default": "./fesm2022/ng-primitives-focus-trap.mjs"
145
- },
146
146
  "./menu": {
147
147
  "types": "./menu/index.d.ts",
148
148
  "default": "./fesm2022/ng-primitives-menu.mjs"
@@ -155,17 +155,21 @@
155
155
  "types": "./pagination/index.d.ts",
156
156
  "default": "./fesm2022/ng-primitives-pagination.mjs"
157
157
  },
158
- "./portal": {
159
- "types": "./portal/index.d.ts",
160
- "default": "./fesm2022/ng-primitives-portal.mjs"
158
+ "./progress": {
159
+ "types": "./progress/index.d.ts",
160
+ "default": "./fesm2022/ng-primitives-progress.mjs"
161
161
  },
162
162
  "./popover": {
163
163
  "types": "./popover/index.d.ts",
164
164
  "default": "./fesm2022/ng-primitives-popover.mjs"
165
165
  },
166
- "./progress": {
167
- "types": "./progress/index.d.ts",
168
- "default": "./fesm2022/ng-primitives-progress.mjs"
166
+ "./portal": {
167
+ "types": "./portal/index.d.ts",
168
+ "default": "./fesm2022/ng-primitives-portal.mjs"
169
+ },
170
+ "./resize": {
171
+ "types": "./resize/index.d.ts",
172
+ "default": "./fesm2022/ng-primitives-resize.mjs"
169
173
  },
170
174
  "./radio": {
171
175
  "types": "./radio/index.d.ts",
@@ -175,26 +179,22 @@
175
179
  "types": "./roving-focus/index.d.ts",
176
180
  "default": "./fesm2022/ng-primitives-roving-focus.mjs"
177
181
  },
178
- "./select": {
179
- "types": "./select/index.d.ts",
180
- "default": "./fesm2022/ng-primitives-select.mjs"
181
- },
182
182
  "./search": {
183
183
  "types": "./search/index.d.ts",
184
184
  "default": "./fesm2022/ng-primitives-search.mjs"
185
185
  },
186
- "./slider": {
187
- "types": "./slider/index.d.ts",
188
- "default": "./fesm2022/ng-primitives-slider.mjs"
189
- },
190
- "./resize": {
191
- "types": "./resize/index.d.ts",
192
- "default": "./fesm2022/ng-primitives-resize.mjs"
186
+ "./select": {
187
+ "types": "./select/index.d.ts",
188
+ "default": "./fesm2022/ng-primitives-select.mjs"
193
189
  },
194
190
  "./separator": {
195
191
  "types": "./separator/index.d.ts",
196
192
  "default": "./fesm2022/ng-primitives-separator.mjs"
197
193
  },
194
+ "./slider": {
195
+ "types": "./slider/index.d.ts",
196
+ "default": "./fesm2022/ng-primitives-slider.mjs"
197
+ },
198
198
  "./state": {
199
199
  "types": "./state/index.d.ts",
200
200
  "default": "./fesm2022/ng-primitives-state.mjs"
@@ -207,14 +207,14 @@
207
207
  "types": "./tabs/index.d.ts",
208
208
  "default": "./fesm2022/ng-primitives-tabs.mjs"
209
209
  },
210
- "./textarea": {
211
- "types": "./textarea/index.d.ts",
212
- "default": "./fesm2022/ng-primitives-textarea.mjs"
213
- },
214
210
  "./toast": {
215
211
  "types": "./toast/index.d.ts",
216
212
  "default": "./fesm2022/ng-primitives-toast.mjs"
217
213
  },
214
+ "./textarea": {
215
+ "types": "./textarea/index.d.ts",
216
+ "default": "./fesm2022/ng-primitives-textarea.mjs"
217
+ },
218
218
  "./toggle": {
219
219
  "types": "./toggle/index.d.ts",
220
220
  "default": "./fesm2022/ng-primitives-toggle.mjs"