ng-primitives 0.74.0 → 0.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/visually-hidden/visually-hidden.d.ts +1 -0
- package/{internal/interactions/button.d.ts → button/button/setup-button.d.ts} +2 -1
- package/button/index.d.ts +1 -0
- package/combobox/combobox/combobox.d.ts +1 -1
- package/combobox/config/combobox-config.d.ts +3 -3
- package/dialog/config/dialog-config.d.ts +2 -0
- package/dialog/dialog/dialog-ref.d.ts +2 -2
- package/dialog/dialog-overlay/dialog-overlay.d.ts +3 -2
- package/fesm2022/ng-primitives-a11y.mjs +3 -1
- package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
- package/fesm2022/ng-primitives-button.mjs +21 -2
- package/fesm2022/ng-primitives-button.mjs.map +1 -1
- package/fesm2022/ng-primitives-checkbox.mjs +1 -1
- package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-combobox.mjs +3 -2
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-date-picker.mjs +2 -1
- package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
- package/fesm2022/ng-primitives-dialog.mjs +6 -8
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs +2 -1
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-input.mjs +2 -1
- package/fesm2022/ng-primitives-input.mjs.map +1 -1
- package/fesm2022/ng-primitives-interactions.mjs +39 -2
- package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +2 -56
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-listbox.mjs +2 -1
- package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +3 -2
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-pagination.mjs +1 -1
- package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +1 -1
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +20 -1
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +4 -3
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-slider.mjs +430 -2
- package/fesm2022/ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/ng-primitives-switch.mjs +2 -1
- package/fesm2022/ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/ng-primitives-tabs.mjs +2 -1
- package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/ng-primitives-textarea.mjs +1 -1
- package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/interactions/index.d.ts +1 -0
- package/internal/index.d.ts +0 -1
- package/internal/interactions/index.d.ts +0 -1
- package/menu/config/menu-config.d.ts +3 -3
- package/menu/menu-trigger/menu-trigger.d.ts +1 -1
- package/package.json +23 -23
- package/popover/config/popover-config.d.ts +3 -3
- package/popover/popover-trigger/popover-trigger.d.ts +1 -1
- package/portal/overlay.d.ts +7 -2
- package/schematics/ng-generate/templates/range-slider/range-slider.__fileSuffix@dasherize__.ts.template +136 -0
- package/select/config/select-config.d.ts +3 -3
- package/select/index.d.ts +1 -0
- package/select/select/select.d.ts +1 -1
- package/slider/index.d.ts +5 -0
- package/slider/range-slider/range-slider/range-slider-state.d.ts +17 -0
- package/slider/range-slider/range-slider/range-slider.d.ts +115 -0
- package/slider/range-slider/range-slider-range/range-slider-range.d.ts +12 -0
- package/slider/range-slider/range-slider-thumb/range-slider-thumb.d.ts +44 -0
- package/slider/range-slider/range-slider-track/range-slider-track.d.ts +22 -0
- package/tooltip/config/tooltip-config.d.ts +3 -3
- package/tooltip/tooltip-trigger/tooltip-trigger.d.ts +1 -1
- /package/{internal/utilities → interactions/setup-interactions}/interaction.d.ts +0 -0
- /package/{internal/interactions/interactions.d.ts → interactions/setup-interactions/setup-interactions.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-switch.mjs","sources":["../../../../packages/ng-primitives/switch/src/switch/switch-state.ts","../../../../packages/ng-primitives/switch/src/switch-thumb/switch-thumb.ts","../../../../packages/ng-primitives/switch/src/switch/switch.ts","../../../../packages/ng-primitives/switch/src/ng-primitives-switch.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpSwitch } from './switch';\n\n/**\n * The state token for the Switch primitive.\n */\nexport const NgpSwitchStateToken = createStateToken<NgpSwitch>('Switch');\n\n/**\n * Provides the Switch state.\n */\nexport const provideSwitchState = createStateProvider(NgpSwitchStateToken);\n\n/**\n * Injects the Switch state.\n */\nexport const injectSwitchState = createStateInjector<NgpSwitch>(NgpSwitchStateToken);\n\n/**\n * The Switch state registration function.\n */\nexport const switchState = createState(NgpSwitchStateToken);\n","import { Directive } from '@angular/core';\nimport { setupInteractions } from 'ng-primitives/
|
|
1
|
+
{"version":3,"file":"ng-primitives-switch.mjs","sources":["../../../../packages/ng-primitives/switch/src/switch/switch-state.ts","../../../../packages/ng-primitives/switch/src/switch-thumb/switch-thumb.ts","../../../../packages/ng-primitives/switch/src/switch/switch.ts","../../../../packages/ng-primitives/switch/src/ng-primitives-switch.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpSwitch } from './switch';\n\n/**\n * The state token for the Switch primitive.\n */\nexport const NgpSwitchStateToken = createStateToken<NgpSwitch>('Switch');\n\n/**\n * Provides the Switch state.\n */\nexport const provideSwitchState = createStateProvider(NgpSwitchStateToken);\n\n/**\n * Injects the Switch state.\n */\nexport const injectSwitchState = createStateInjector<NgpSwitch>(NgpSwitchStateToken);\n\n/**\n * The Switch state registration function.\n */\nexport const switchState = createState(NgpSwitchStateToken);\n","import { Directive } from '@angular/core';\nimport { setupInteractions } from 'ng-primitives/interactions';\nimport { injectSwitchState } from '../switch/switch-state';\n\n/**\n * Apply the `ngpSwitchThumb` directive to an element within a switch to represent the thumb.\n */\n@Directive({\n selector: '[ngpSwitchThumb]',\n host: {\n '[attr.data-checked]': 'state().checked() ? \"\" : null',\n '[attr.data-disabled]': 'state().disabled() ? \"\" : null',\n },\n})\nexport class NgpSwitchThumb {\n /**\n * Access the switch state.\n */\n protected readonly state = injectSwitchState();\n\n constructor() {\n setupInteractions({\n hover: true,\n focusVisible: true,\n press: true,\n disabled: this.state().disabled,\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, input, output } from '@angular/core';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { setupInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { provideSwitchState, switchState } from './switch-state';\n\n/**\n * Apply the `ngpSwitch` directive to an element to manage the checked state.\n */\n@Directive({\n selector: '[ngpSwitch]',\n exportAs: 'ngpSwitch',\n providers: [provideSwitchState()],\n host: {\n role: 'switch',\n '[id]': 'id()',\n '[attr.type]': 'isButton ? \"button\" : null',\n '[attr.aria-checked]': 'state.checked()',\n '[attr.data-checked]': 'state.checked() ? \"\" : null',\n '[attr.disabled]': 'isButton && state.disabled() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.aria-disabled]': 'state.disabled()',\n '[attr.tabindex]': 'state.disabled() ? -1 : 0',\n },\n})\nexport class NgpSwitch {\n /**\n * Access the element ref.\n */\n private readonly elementRef = injectElementRef();\n\n /**\n * Determine if the switch is a button\n */\n protected isButton = this.elementRef.nativeElement.tagName === 'BUTTON';\n\n /**\n * The id of the switch. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-switch'));\n\n /**\n * Determine if the switch is checked.\n * @default false\n */\n readonly checked = input<boolean, BooleanInput>(false, {\n alias: 'ngpSwitchChecked',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the checked state changes.\n */\n readonly checkedChange = output<boolean>({\n alias: 'ngpSwitchCheckedChange',\n });\n\n /**\n * Determine if the switch is disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSwitchDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The switch state.\n * @internal\n */\n readonly state = switchState<NgpSwitch>(this);\n\n constructor() {\n setupInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled: this.state.disabled,\n });\n setupFormControl({ id: this.state.id, disabled: this.state.disabled });\n }\n\n /**\n * Toggle the checked state.\n */\n @HostListener('click')\n toggle(): void {\n if (this.state.disabled()) {\n return;\n }\n\n const checked = !this.state.checked();\n this.state.checked.set(checked);\n this.checkedChange.emit(checked);\n }\n\n /**\n * Handle the keydown event.\n */\n @HostListener('keydown.space', ['$event'])\n protected onKeyDown(event: KeyboardEvent): void {\n // Prevent the default action of the space key, which is to scroll the page.\n event.preventDefault();\n\n // If the switch is not a button then the space key will not toggle the checked state automatically,\n // so we need to do it manually.\n if (!this.isButton) {\n this.toggle();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAQA;;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;;ACtB3D;;AAEG;MAQU,cAAc,CAAA;AAM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,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAatB,SAAS,EAAA,UAAA,EAAA,CAAA;kBAhBrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,SAAS,EAAE,CAAC,kBAAkB,EAAE,CAAC;AACjC,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,MAAM,EAAE,MAAM;AACd,wBAAA,aAAa,EAAE,4BAA4B;AAC3C,wBAAA,qBAAqB,EAAE,iBAAiB;AACxC,wBAAA,qBAAqB,EAAE,6BAA6B;AACpD,wBAAA,iBAAiB,EAAE,0CAA0C;AAC7D,wBAAA,sBAAsB,EAAE,8BAA8B;AACtD,wBAAA,sBAAsB,EAAE,kBAAkB;AAC1C,wBAAA,iBAAiB,EAAE,2BAA2B;AAC/C,qBAAA;AACF,iBAAA;wDA8DC,MAAM,EAAA,CAAA;sBADL,YAAY;uBAAC,OAAO;gBAeX,SAAS,EAAA,CAAA;sBADlB,YAAY;uBAAC,eAAe,EAAE,CAAC,QAAQ,CAAC;;;ACrG3C;;AAEG;;;;"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, HOST_TAG_NAME, input, booleanAttribute, computed, HostListener, Directive, output, signal } from '@angular/core';
|
|
3
|
-
import { setupInteractions
|
|
3
|
+
import { setupInteractions } from 'ng-primitives/interactions';
|
|
4
4
|
import * as i1 from 'ng-primitives/roving-focus';
|
|
5
5
|
import { NgpRovingFocusItem, injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';
|
|
6
6
|
import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
|
|
7
|
+
import { explicitEffect } from 'ng-primitives/internal';
|
|
7
8
|
import { uniqueId } from 'ng-primitives/utils';
|
|
8
9
|
|
|
9
10
|
const defaultTabsConfig = {
|
|
@@ -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/internal';\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;;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,KA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AAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,WAAA,EAAA,sBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,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
|
+
{"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,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,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/
|
|
4
|
+
import { setupInteractions } 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
|
|
|
@@ -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/
|
|
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,G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,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,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 +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.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/tooltip-arrow/tooltip-arrow.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 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 in to which the tooltip should be attached.\n * @default document.body\n */\n container: HTMLElement | 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: null,\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, 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 { Placement } from '@floating-ui/dom';\nimport { setupOverflowListener } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\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<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 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 | 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","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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAqDO,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,IAAI;AACf,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,cAAc,EAAE,IAAI;CACrB;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,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,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,QAAQ,EAAE,iBAAiB;AAC5B,iBAAA;;;ACND;;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.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/tooltip-arrow/tooltip-arrow.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 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, 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 { Placement } from '@floating-ui/dom';\nimport { setupOverflowListener } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\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<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 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","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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAqDO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,cAAc,EAAE,IAAI;CACrB;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;SACa,mBAAmB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,oBAAoB;AAClF;;AClFA;;AAEG;MAeU,UAAU,CAAA;AAWrB,IAAA,WAAA,GAAA;AAVA;;AAEG;QACgB,IAAA,CAAA,OAAO,GAAG,aAAa,EAAE;AAE5C;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;QAGpC,cAAc,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;;AAG5D,QAAA,UAAU,CAAC;YACT,UAAU,EAAE,MAAM,I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AE;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;;;MCvCY,eAAe,CAAA;AAC1B,IAAA,WAAA,GAAA;AACE,QAAA,iBAAiB,EAAE;IACrB;+GAHW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,QAAQ,EAAE,iBAAiB;AAC5B,iBAAA;;;ACND;;AAEG;;;;"}
|
package/interactions/index.d.ts
CHANGED
package/internal/index.d.ts
CHANGED
|
@@ -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 { NgpButtonOptions, setupButton } from './interactions/button';
|
|
4
3
|
export * from './interactions/index';
|
|
5
4
|
export * from './signals/explicit-effect';
|
|
6
5
|
export * from './style-injector/style-injector';
|
|
@@ -17,10 +17,10 @@ export interface NgpMenuConfig {
|
|
|
17
17
|
*/
|
|
18
18
|
flip: boolean;
|
|
19
19
|
/**
|
|
20
|
-
* Define the container in to which the menu should be attached.
|
|
21
|
-
* @default
|
|
20
|
+
* Define the container element or selector in to which the menu should be attached.
|
|
21
|
+
* @default 'body'
|
|
22
22
|
*/
|
|
23
|
-
container: HTMLElement | null;
|
|
23
|
+
container: HTMLElement | string | null;
|
|
24
24
|
/**
|
|
25
25
|
* Defines how the menu behaves when the window is scrolled.
|
|
26
26
|
* @default scroll
|
|
@@ -52,7 +52,7 @@ export declare class NgpMenuTrigger<T = unknown> implements OnDestroy {
|
|
|
52
52
|
* Define the container in which the menu should be attached.
|
|
53
53
|
* @default document.body
|
|
54
54
|
*/
|
|
55
|
-
readonly container: import("@angular/core").InputSignal<HTMLElement | null>;
|
|
55
|
+
readonly container: import("@angular/core").InputSignal<string | HTMLElement | null>;
|
|
56
56
|
/**
|
|
57
57
|
* Defines how the menu behaves when the window is scrolled.
|
|
58
58
|
* @default 'block'
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "ng-primitives",
|
|
3
3
|
"description": "Angular Primitives is a low-level headless UI component library with a focus on accessibility, customization, and developer experience. ",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.76.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"angular",
|
|
8
8
|
"primitives",
|
|
@@ -67,22 +67,26 @@
|
|
|
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
|
+
"./avatar": {
|
|
75
|
+
"types": "./avatar/index.d.ts",
|
|
76
|
+
"default": "./fesm2022/ng-primitives-avatar.mjs"
|
|
77
|
+
},
|
|
70
78
|
"./autofill": {
|
|
71
79
|
"types": "./autofill/index.d.ts",
|
|
72
80
|
"default": "./fesm2022/ng-primitives-autofill.mjs"
|
|
73
81
|
},
|
|
74
|
-
"./
|
|
75
|
-
"types": "./
|
|
76
|
-
"default": "./fesm2022/ng-primitives-
|
|
82
|
+
"./checkbox": {
|
|
83
|
+
"types": "./checkbox/index.d.ts",
|
|
84
|
+
"default": "./fesm2022/ng-primitives-checkbox.mjs"
|
|
77
85
|
},
|
|
78
86
|
"./button": {
|
|
79
87
|
"types": "./button/index.d.ts",
|
|
80
88
|
"default": "./fesm2022/ng-primitives-button.mjs"
|
|
81
89
|
},
|
|
82
|
-
"./avatar": {
|
|
83
|
-
"types": "./avatar/index.d.ts",
|
|
84
|
-
"default": "./fesm2022/ng-primitives-avatar.mjs"
|
|
85
|
-
},
|
|
86
90
|
"./combobox": {
|
|
87
91
|
"types": "./combobox/index.d.ts",
|
|
88
92
|
"default": "./fesm2022/ng-primitives-combobox.mjs"
|
|
@@ -91,10 +95,6 @@
|
|
|
91
95
|
"types": "./common/index.d.ts",
|
|
92
96
|
"default": "./fesm2022/ng-primitives-common.mjs"
|
|
93
97
|
},
|
|
94
|
-
"./checkbox": {
|
|
95
|
-
"types": "./checkbox/index.d.ts",
|
|
96
|
-
"default": "./fesm2022/ng-primitives-checkbox.mjs"
|
|
97
|
-
},
|
|
98
98
|
"./date-picker": {
|
|
99
99
|
"types": "./date-picker/index.d.ts",
|
|
100
100
|
"default": "./fesm2022/ng-primitives-date-picker.mjs"
|
|
@@ -103,14 +103,14 @@
|
|
|
103
103
|
"types": "./date-time/index.d.ts",
|
|
104
104
|
"default": "./fesm2022/ng-primitives-date-time.mjs"
|
|
105
105
|
},
|
|
106
|
-
"./dialog": {
|
|
107
|
-
"types": "./dialog/index.d.ts",
|
|
108
|
-
"default": "./fesm2022/ng-primitives-dialog.mjs"
|
|
109
|
-
},
|
|
110
106
|
"./date-time-luxon": {
|
|
111
107
|
"types": "./date-time-luxon/index.d.ts",
|
|
112
108
|
"default": "./fesm2022/ng-primitives-date-time-luxon.mjs"
|
|
113
109
|
},
|
|
110
|
+
"./dialog": {
|
|
111
|
+
"types": "./dialog/index.d.ts",
|
|
112
|
+
"default": "./fesm2022/ng-primitives-dialog.mjs"
|
|
113
|
+
},
|
|
114
114
|
"./file-upload": {
|
|
115
115
|
"types": "./file-upload/index.d.ts",
|
|
116
116
|
"default": "./fesm2022/ng-primitives-file-upload.mjs"
|
|
@@ -179,10 +179,6 @@
|
|
|
179
179
|
"types": "./search/index.d.ts",
|
|
180
180
|
"default": "./fesm2022/ng-primitives-search.mjs"
|
|
181
181
|
},
|
|
182
|
-
"./select": {
|
|
183
|
-
"types": "./select/index.d.ts",
|
|
184
|
-
"default": "./fesm2022/ng-primitives-select.mjs"
|
|
185
|
-
},
|
|
186
182
|
"./separator": {
|
|
187
183
|
"types": "./separator/index.d.ts",
|
|
188
184
|
"default": "./fesm2022/ng-primitives-separator.mjs"
|
|
@@ -223,13 +219,17 @@
|
|
|
223
219
|
"types": "./toolbar/index.d.ts",
|
|
224
220
|
"default": "./fesm2022/ng-primitives-toolbar.mjs"
|
|
225
221
|
},
|
|
222
|
+
"./utils": {
|
|
223
|
+
"types": "./utils/index.d.ts",
|
|
224
|
+
"default": "./fesm2022/ng-primitives-utils.mjs"
|
|
225
|
+
},
|
|
226
226
|
"./tooltip": {
|
|
227
227
|
"types": "./tooltip/index.d.ts",
|
|
228
228
|
"default": "./fesm2022/ng-primitives-tooltip.mjs"
|
|
229
229
|
},
|
|
230
|
-
"./
|
|
231
|
-
"types": "./
|
|
232
|
-
"default": "./fesm2022/ng-primitives-
|
|
230
|
+
"./select": {
|
|
231
|
+
"types": "./select/index.d.ts",
|
|
232
|
+
"default": "./fesm2022/ng-primitives-select.mjs"
|
|
233
233
|
}
|
|
234
234
|
},
|
|
235
235
|
"module": "fesm2022/ng-primitives.mjs",
|
|
@@ -27,10 +27,10 @@ export interface NgpPopoverConfig {
|
|
|
27
27
|
*/
|
|
28
28
|
flip: boolean;
|
|
29
29
|
/**
|
|
30
|
-
* Define the container in to which the popover should be attached.
|
|
31
|
-
* @default
|
|
30
|
+
* Define the container element or selector in to which the popover should be attached.
|
|
31
|
+
* @default 'body'
|
|
32
32
|
*/
|
|
33
|
-
container: HTMLElement | null;
|
|
33
|
+
container: HTMLElement | string | null;
|
|
34
34
|
/**
|
|
35
35
|
* Define whether the popover should close when clicking outside of it.
|
|
36
36
|
* @default true
|
|
@@ -62,7 +62,7 @@ export declare class NgpPopoverTrigger<T = null> implements OnDestroy {
|
|
|
62
62
|
* Define the container in which the popover should be attached.
|
|
63
63
|
* @default document.body
|
|
64
64
|
*/
|
|
65
|
-
readonly container: import("@angular/core").InputSignal<HTMLElement | null>;
|
|
65
|
+
readonly container: import("@angular/core").InputSignal<string | HTMLElement | null>;
|
|
66
66
|
/**
|
|
67
67
|
* Define whether the popover should close when clicking outside of it.
|
|
68
68
|
* @default true
|
package/portal/overlay.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ export interface NgpOverlayConfig<T = unknown> {
|
|
|
17
17
|
viewContainerRef: ViewContainerRef;
|
|
18
18
|
/** Context data to pass to the overlay content */
|
|
19
19
|
context?: Signal<T | undefined>;
|
|
20
|
-
/** Container element to attach the overlay to (defaults to document.body) */
|
|
21
|
-
container?: HTMLElement | null;
|
|
20
|
+
/** Container element or selector to attach the overlay to (defaults to document.body) */
|
|
21
|
+
container?: HTMLElement | string | null;
|
|
22
22
|
/** Preferred placement of the overlay relative to the trigger */
|
|
23
23
|
placement?: Placement;
|
|
24
24
|
/** Offset distance between the overlay and trigger in pixels */
|
|
@@ -183,6 +183,11 @@ export declare class NgpOverlay<T = unknown> {
|
|
|
183
183
|
* @internal
|
|
184
184
|
*/
|
|
185
185
|
unregisterArrow(): void;
|
|
186
|
+
/**
|
|
187
|
+
* Resolve the container element from the configuration
|
|
188
|
+
* @internal
|
|
189
|
+
*/
|
|
190
|
+
private resolveContainer;
|
|
186
191
|
}
|
|
187
192
|
/**
|
|
188
193
|
* Helper function to create an overlay in a single call
|