ng-primitives 0.77.0 → 0.78.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/combobox/combobox/combobox.d.ts +3 -1
- package/fesm2022/ng-primitives-accordion.mjs +1 -1
- package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/ng-primitives-combobox.mjs +45 -19
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-dialog.mjs +1 -1
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +2 -1
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/package.json +13 -13
|
@@ -33,6 +33,8 @@ export declare class NgpCombobox {
|
|
|
33
33
|
readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
|
34
34
|
/** Whether the combobox is disabled. */
|
|
35
35
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
|
36
|
+
/** Whether the combobox allows deselection in single selection mode. */
|
|
37
|
+
readonly allowDeselect: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
|
36
38
|
/** Emit when the dropdown open state changes. */
|
|
37
39
|
readonly openChange: import("@angular/core").OutputEmitterRef<boolean>;
|
|
38
40
|
/** The comparator function used to compare options. */
|
|
@@ -182,7 +184,7 @@ export declare class NgpCombobox {
|
|
|
182
184
|
*/
|
|
183
185
|
unregisterOption(option: NgpComboboxOption): void;
|
|
184
186
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpCombobox, never>;
|
|
185
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpCombobox, "[ngpCombobox]", ["ngpCombobox"], { "value": { "alias": "ngpComboboxValue"; "required": false; "isSignal": true; }; "multiple": { "alias": "ngpComboboxMultiple"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpComboboxDisabled"; "required": false; "isSignal": true; }; "compareWith": { "alias": "ngpComboboxCompareWith"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpComboboxDropdownPlacement"; "required": false; "isSignal": true; }; "container": { "alias": "ngpComboboxDropdownContainer"; "required": false; "isSignal": true; }; }, { "valueChange": "ngpComboboxValueChange"; "openChange": "ngpComboboxOpenChange"; }, never, never, true, never>;
|
|
187
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpCombobox, "[ngpCombobox]", ["ngpCombobox"], { "value": { "alias": "ngpComboboxValue"; "required": false; "isSignal": true; }; "multiple": { "alias": "ngpComboboxMultiple"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpComboboxDisabled"; "required": false; "isSignal": true; }; "allowDeselect": { "alias": "ngpComboboxAllowDeselect"; "required": false; "isSignal": true; }; "compareWith": { "alias": "ngpComboboxCompareWith"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpComboboxDropdownPlacement"; "required": false; "isSignal": true; }; "container": { "alias": "ngpComboboxDropdownContainer"; "required": false; "isSignal": true; }; }, { "valueChange": "ngpComboboxValueChange"; "openChange": "ngpComboboxOpenChange"; }, never, never, true, never>;
|
|
186
188
|
}
|
|
187
189
|
export type NgpComboboxPlacement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
|
|
188
190
|
export {};
|
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, computed, afterRenderEffect, Directive, booleanAttribute, signal, inject, HOST_TAG_NAME, HostListener, InjectionToken, output } from '@angular/core';
|
|
3
3
|
import { injectElementRef, injectDimensions, fromMutationObserver } from 'ng-primitives/internal';
|
|
4
4
|
import { uniqueId, safeTakeUntilDestroyed } from 'ng-primitives/utils';
|
|
5
|
-
import { debounceTime } from 'rxjs';
|
|
5
|
+
import { debounceTime } from 'rxjs/operators';
|
|
6
6
|
import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-accordion.mjs","sources":["../../../../packages/ng-primitives/accordion/src/accordion-item/accordion-item-state.ts","../../../../packages/ng-primitives/accordion/src/accordion/accordion-state.ts","../../../../packages/ng-primitives/accordion/src/accordion-content/accordion-content.ts","../../../../packages/ng-primitives/accordion/src/accordion-item/accordion-item.ts","../../../../packages/ng-primitives/accordion/src/accordion-trigger/accordion-trigger.ts","../../../../packages/ng-primitives/accordion/src/config/accordion-config.ts","../../../../packages/ng-primitives/accordion/src/accordion/accordion.ts","../../../../packages/ng-primitives/accordion/src/ng-primitives-accordion.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpAccordionItem } from './accordion-item';\n\n/**\n * The state token for the AccordionItem primitive.\n */\nexport const NgpAccordionItemStateToken =\n createStateToken<NgpAccordionItem<unknown>>('AccordionItem');\n\n/**\n * Provides the AccordionItem state.\n */\nexport const provideAccordionItemState = createStateProvider(NgpAccordionItemStateToken);\n\n/**\n * Injects the AccordionItem state.\n */\nexport const injectAccordionItemState = createStateInjector<NgpAccordionItem<unknown>>(\n NgpAccordionItemStateToken,\n);\n\n/**\n * The AccordionItem state registration function.\n */\nexport const accordionItemState = createState(NgpAccordionItemStateToken);\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpAccordion } from './accordion';\n\n/**\n * The state token for the Accordion primitive.\n */\nexport const NgpAccordionStateToken = createStateToken<NgpAccordion<unknown>>('Accordion');\n\n/**\n * Provides the Accordion state.\n */\nexport const provideAccordionState = createStateProvider(NgpAccordionStateToken);\n\n/**\n * Injects the Accordion state.\n */\nexport const injectAccordionState =\n createStateInjector<NgpAccordion<unknown>>(NgpAccordionStateToken);\n\n/**\n * The Accordion state registration function.\n */\nexport const accordionState = createState(NgpAccordionStateToken);\n","import { afterRenderEffect, computed, Directive, input } from '@angular/core';\nimport { fromMutationObserver, injectDimensions, injectElementRef } from 'ng-primitives/internal';\nimport { safeTakeUntilDestroyed, uniqueId } from 'ng-primitives/utils';\nimport { debounceTime } from 'rxjs';\nimport { injectAccordionItemState } from '../accordion-item/accordion-item-state';\nimport type { NgpAccordion } from '../accordion/accordion';\nimport { injectAccordionState } from '../accordion/accordion-state';\n\n/**\n * Apply the `ngpAccordionContent` directive to an element that represents the content of an accordion item.\n */\n@Directive({\n selector: '[ngpAccordionContent]',\n exportAs: 'ngpAccordionContent',\n host: {\n role: 'region',\n '[id]': 'id()',\n '[attr.data-orientation]': 'accordion().orientation()',\n '[attr.data-open]': 'accordionItem().open() ? \"\" : null',\n '[attr.data-closed]': 'accordionItem().open() ? null : \"\"',\n '[attr.aria-labelledby]': 'accordionItem().triggerId()',\n '(beforematch)': 'onBeforeMatch()',\n '[attr.hidden]': 'hidden()',\n },\n})\nexport class NgpAccordionContent<T> {\n /**\n * Access the accordion content element reference\n */\n private readonly elementRef = injectElementRef();\n\n /**\n * Access the accordion\n */\n protected readonly accordion = injectAccordionState<NgpAccordion<T>>();\n\n /**\n * Access the accordion item\n */\n protected readonly accordionItem = injectAccordionItemState();\n\n /**\n * The id of the content region\n */\n readonly id = input<string>(uniqueId('ngp-accordion-content'));\n\n /**\n * The dimensions of the content\n */\n private dimensions = injectDimensions();\n\n /**\n * The hidden until-found state of the content\n */\n protected readonly hidden = computed(() =>\n !this.accordionItem().open() && this.dimensions().height === 0 ? 'until-found' : null,\n );\n\n constructor() {\n this.accordionItem().content.set(this);\n\n // any time the open state of the accordion item changes, update the dimensions\n afterRenderEffect(() => this.updateDimensions());\n\n // update dimensions when the content changes\n fromMutationObserver(this.elementRef.nativeElement, {\n childList: true,\n subtree: true,\n disabled: computed(() => !this.accordionItem().open()),\n })\n .pipe(debounceTime(0), safeTakeUntilDestroyed())\n .subscribe(() => this.updateDimensions());\n }\n\n /**\n * Handle the beforematch event to automatically open the accordion item\n * when the browser's find-in-page functionality tries to reveal hidden content.\n */\n protected onBeforeMatch(): void {\n const isDisabled = this.accordion().disabled() || this.accordionItem().disabled();\n if (isDisabled) return;\n this.accordion().toggle(this.accordionItem().value() as T);\n }\n\n private updateDimensions(): void {\n if (this.accordionItem().open()) {\n // remove the inline styles to reset them\n this.elementRef.nativeElement.style.removeProperty('--ngp-accordion-content-width');\n this.elementRef.nativeElement.style.removeProperty('--ngp-accordion-content-height');\n // set the dimensions based on the content\n this.elementRef.nativeElement.style.setProperty(\n '--ngp-accordion-content-width',\n `${this.elementRef.nativeElement.scrollWidth}px`,\n );\n this.elementRef.nativeElement.style.setProperty(\n '--ngp-accordion-content-height',\n `${this.elementRef.nativeElement.scrollHeight}px`,\n );\n }\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, computed, input, signal } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { NgpAccordionContent } from '../accordion-content/accordion-content';\nimport { NgpAccordionTrigger } from '../accordion-trigger/accordion-trigger';\nimport { NgpAccordion } from '../accordion/accordion';\nimport { injectAccordionState } from '../accordion/accordion-state';\nimport { accordionItemState, provideAccordionItemState } from './accordion-item-state';\n\n/**\n * Apply the `ngpAccordionItem` directive to an element that represents an accordion item.\n */\n@Directive({\n selector: '[ngpAccordionItem]',\n exportAs: 'ngpAccordionItem',\n providers: [provideAccordionItemState()],\n host: {\n '[attr.data-orientation]': 'accordion().orientation()',\n '[attr.data-open]': 'state.open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() || accordion().disabled() ? \"\" : null',\n },\n})\nexport class NgpAccordionItem<T> {\n /**\n * Access the accordion.\n */\n protected readonly accordion = injectAccordionState<NgpAccordion<T>>();\n\n /**\n * The value of the accordion item.\n */\n readonly value = input<T>(uniqueId('ngp-accordion-item') as T, {\n alias: 'ngpAccordionItemValue',\n });\n\n /**\n * Whether the accordion item is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpAccordionItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Access the accordion trigger\n * @internal\n */\n readonly trigger = signal<NgpAccordionTrigger<T> | undefined>(undefined);\n\n /**\n * Access the accordion content\n * @internal\n */\n readonly content = signal<NgpAccordionContent<T> | undefined>(undefined);\n\n /**\n * Whether the accordion item is expanded.\n */\n readonly open = computed<boolean>(() => this.accordion().isOpen(this.state.value()!));\n\n /**\n * The trigger id.\n */\n readonly triggerId = computed(() => this.trigger()?.id());\n\n /**\n * The content id.\n */\n readonly contentId = computed(() => this.content()?.id());\n\n /**\n * The accordion item state.\n */\n private readonly state = accordionItemState<NgpAccordionItem<T>>(this);\n}\n","import { Directive, HOST_TAG_NAME, HostListener, inject, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { NgpAccordionItem } from '../accordion-item/accordion-item';\nimport { injectAccordionItemState } from '../accordion-item/accordion-item-state';\nimport { NgpAccordion } from '../accordion/accordion';\nimport { injectAccordionState } from '../accordion/accordion-state';\n\n/**\n * Apply the `ngpAccordionTrigger` directive to an element that represents the trigger for an accordion item, such as a button.\n */\n@Directive({\n selector: '[ngpAccordionTrigger]',\n exportAs: 'ngpAccordionTrigger',\n host: {\n '[id]': 'id()',\n '[attr.type]': 'tagName === \"button\" ? \"button\" : null',\n '[attr.data-orientation]': 'accordion().orientation()',\n '[attr.data-open]': 'accordionItem().open() ? \"\" : null',\n '[attr.data-disabled]': 'accordionItem().disabled() || accordion().disabled() ? \"\" : null',\n '[attr.aria-controls]': 'accordionItem().contentId()',\n '[attr.aria-expanded]': 'accordionItem().open()',\n },\n})\nexport class NgpAccordionTrigger<T> {\n /**\n * The tag name of the element.\n */\n protected readonly tagName = inject(HOST_TAG_NAME);\n\n /**\n * Access the parent accordion.\n */\n protected readonly accordion = injectAccordionState<NgpAccordion<T>>();\n\n /**\n * The item instance.\n */\n protected readonly accordionItem = injectAccordionItemState<NgpAccordionItem<T>>();\n\n /**\n * The id of the trigger.\n */\n readonly id = input<string>(uniqueId('ngp-accordion-trigger'));\n\n constructor() {\n this.accordionItem().trigger.set(this);\n }\n\n /**\n * Toggle the accordion item.\n */\n @HostListener('click')\n toggle(): void {\n if (this.accordionItem().disabled() || this.accordion().disabled()) {\n return;\n }\n\n this.accordion().toggle(this.accordionItem().value()!);\n }\n}\n","import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpAccordionType } from '../accordion/accordion';\n\nexport interface NgpAccordionConfig {\n /**\n * The default type of the accordion\n * @default 'single'\n */\n type: NgpAccordionType;\n /**\n * Whether the accordion is collapsible\n * @default false\n */\n collapsible: boolean;\n /**\n * The default orientation of the accordion\n * @default 'vertical'\n */\n orientation: 'vertical' | 'horizontal';\n}\n\nexport const defaultAccordionConfig: NgpAccordionConfig = {\n type: 'single',\n collapsible: false,\n orientation: 'vertical',\n};\n\nexport const NgpAccordionConfigToken = new InjectionToken<NgpAccordionConfig>(\n 'NgpAccordionConfigToken',\n);\n\n/**\n * Provide the default Accordion configuration\n * @param config The Accordion configuration\n * @returns The provider\n */\nexport function provideAccordionConfig(config: Partial<NgpAccordionConfig>): Provider[] {\n return [\n {\n provide: NgpAccordionConfigToken,\n useValue: { ...defaultAccordionConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Accordion configuration\n * @returns The global Accordion configuration\n */\nexport function injectAccordionConfig(): NgpAccordionConfig {\n return inject(NgpAccordionConfigToken, { optional: true }) ?? defaultAccordionConfig;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { injectAccordionConfig } from '../config/accordion-config';\nimport { accordionState, provideAccordionState } from './accordion-state';\n\n/**\n * Apply the `ngpAccordion` directive to an element that represents the group of accordion items.\n */\n@Directive({\n selector: '[ngpAccordion]',\n exportAs: 'ngpAccordion',\n providers: [provideAccordionState()],\n host: {\n '[attr.data-orientation]': 'state.orientation()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpAccordion<T> {\n /**\n * Access the global accordion configuration.\n */\n private readonly config = injectAccordionConfig();\n\n /**\n * The type of the accordion.\n */\n readonly type = input<NgpAccordionType>(this.config.type, {\n alias: 'ngpAccordionType',\n });\n\n /**\n * Whether the accordion is collapsible.\n */\n readonly collapsible = input<boolean, BooleanInput>(this.config.collapsible, {\n alias: 'ngpAccordionCollapsible',\n transform: booleanAttribute,\n });\n\n /**\n * The value of the accordion.\n */\n readonly value = input<T | T[] | null>(null, {\n alias: 'ngpAccordionValue',\n });\n\n /**\n * Event emitted when the accordion value changes.\n */\n readonly valueChange = output<T | T[] | null>({\n alias: 'ngpAccordionValueChange',\n });\n\n /**\n * Whether the accordion is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpAccordionDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The accordion orientation.\n */\n readonly orientation = input<NgpOrientation>(this.config.orientation, {\n alias: 'ngpAccordionOrientation',\n });\n\n /**\n * The accordion state.\n */\n private readonly state = accordionState<NgpAccordion<T>>(this);\n\n /**\n * @param value The value to check.\n * @returns Whether the value is open.\n * @internal\n */\n isOpen(value: T): boolean {\n if (this.state.type() === 'multiple') {\n return (this.state.value() as T[] | null)?.includes(value) ?? false;\n }\n\n return this.state.value() === value;\n }\n\n toggle(value: T): void {\n const isOpen = this.isOpen(value);\n\n // if we are in single mode and the value is already open and the accordion is not collapsible, do nothing\n if (this.state.type() === 'single' && isOpen && !this.state.collapsible()) {\n return;\n }\n\n // if we are in single mode then toggle the value\n if (this.state.type() === 'single') {\n const newValue = isOpen ? null : value;\n this.state.value.set(newValue);\n this.valueChange.emit(newValue);\n return;\n }\n\n // if we are in multiple mode then toggle the value\n let values = (this.state.value() as T[]) ?? [];\n\n if (isOpen) {\n values = values.filter(v => v !== value);\n } else {\n values = [...values, value];\n }\n this.state.value.set(values);\n this.valueChange.emit(values);\n }\n}\n\nexport type NgpAccordionType = 'single' | 'multiple';\n","/**\n * Generated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ACjBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-accordion.mjs","sources":["../../../../packages/ng-primitives/accordion/src/accordion-item/accordion-item-state.ts","../../../../packages/ng-primitives/accordion/src/accordion/accordion-state.ts","../../../../packages/ng-primitives/accordion/src/accordion-content/accordion-content.ts","../../../../packages/ng-primitives/accordion/src/accordion-item/accordion-item.ts","../../../../packages/ng-primitives/accordion/src/accordion-trigger/accordion-trigger.ts","../../../../packages/ng-primitives/accordion/src/config/accordion-config.ts","../../../../packages/ng-primitives/accordion/src/accordion/accordion.ts","../../../../packages/ng-primitives/accordion/src/ng-primitives-accordion.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpAccordionItem } from './accordion-item';\n\n/**\n * The state token for the AccordionItem primitive.\n */\nexport const NgpAccordionItemStateToken =\n createStateToken<NgpAccordionItem<unknown>>('AccordionItem');\n\n/**\n * Provides the AccordionItem state.\n */\nexport const provideAccordionItemState = createStateProvider(NgpAccordionItemStateToken);\n\n/**\n * Injects the AccordionItem state.\n */\nexport const injectAccordionItemState = createStateInjector<NgpAccordionItem<unknown>>(\n NgpAccordionItemStateToken,\n);\n\n/**\n * The AccordionItem state registration function.\n */\nexport const accordionItemState = createState(NgpAccordionItemStateToken);\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpAccordion } from './accordion';\n\n/**\n * The state token for the Accordion primitive.\n */\nexport const NgpAccordionStateToken = createStateToken<NgpAccordion<unknown>>('Accordion');\n\n/**\n * Provides the Accordion state.\n */\nexport const provideAccordionState = createStateProvider(NgpAccordionStateToken);\n\n/**\n * Injects the Accordion state.\n */\nexport const injectAccordionState =\n createStateInjector<NgpAccordion<unknown>>(NgpAccordionStateToken);\n\n/**\n * The Accordion state registration function.\n */\nexport const accordionState = createState(NgpAccordionStateToken);\n","import { afterRenderEffect, computed, Directive, input } from '@angular/core';\nimport { fromMutationObserver, injectDimensions, injectElementRef } from 'ng-primitives/internal';\nimport { safeTakeUntilDestroyed, uniqueId } from 'ng-primitives/utils';\nimport { debounceTime } from 'rxjs/operators';\nimport { injectAccordionItemState } from '../accordion-item/accordion-item-state';\nimport type { NgpAccordion } from '../accordion/accordion';\nimport { injectAccordionState } from '../accordion/accordion-state';\n\n/**\n * Apply the `ngpAccordionContent` directive to an element that represents the content of an accordion item.\n */\n@Directive({\n selector: '[ngpAccordionContent]',\n exportAs: 'ngpAccordionContent',\n host: {\n role: 'region',\n '[id]': 'id()',\n '[attr.data-orientation]': 'accordion().orientation()',\n '[attr.data-open]': 'accordionItem().open() ? \"\" : null',\n '[attr.data-closed]': 'accordionItem().open() ? null : \"\"',\n '[attr.aria-labelledby]': 'accordionItem().triggerId()',\n '(beforematch)': 'onBeforeMatch()',\n '[attr.hidden]': 'hidden()',\n },\n})\nexport class NgpAccordionContent<T> {\n /**\n * Access the accordion content element reference\n */\n private readonly elementRef = injectElementRef();\n\n /**\n * Access the accordion\n */\n protected readonly accordion = injectAccordionState<NgpAccordion<T>>();\n\n /**\n * Access the accordion item\n */\n protected readonly accordionItem = injectAccordionItemState();\n\n /**\n * The id of the content region\n */\n readonly id = input<string>(uniqueId('ngp-accordion-content'));\n\n /**\n * The dimensions of the content\n */\n private dimensions = injectDimensions();\n\n /**\n * The hidden until-found state of the content\n */\n protected readonly hidden = computed(() =>\n !this.accordionItem().open() && this.dimensions().height === 0 ? 'until-found' : null,\n );\n\n constructor() {\n this.accordionItem().content.set(this);\n\n // any time the open state of the accordion item changes, update the dimensions\n afterRenderEffect(() => this.updateDimensions());\n\n // update dimensions when the content changes\n fromMutationObserver(this.elementRef.nativeElement, {\n childList: true,\n subtree: true,\n disabled: computed(() => !this.accordionItem().open()),\n })\n .pipe(debounceTime(0), safeTakeUntilDestroyed())\n .subscribe(() => this.updateDimensions());\n }\n\n /**\n * Handle the beforematch event to automatically open the accordion item\n * when the browser's find-in-page functionality tries to reveal hidden content.\n */\n protected onBeforeMatch(): void {\n const isDisabled = this.accordion().disabled() || this.accordionItem().disabled();\n if (isDisabled) return;\n this.accordion().toggle(this.accordionItem().value() as T);\n }\n\n private updateDimensions(): void {\n if (this.accordionItem().open()) {\n // remove the inline styles to reset them\n this.elementRef.nativeElement.style.removeProperty('--ngp-accordion-content-width');\n this.elementRef.nativeElement.style.removeProperty('--ngp-accordion-content-height');\n // set the dimensions based on the content\n this.elementRef.nativeElement.style.setProperty(\n '--ngp-accordion-content-width',\n `${this.elementRef.nativeElement.scrollWidth}px`,\n );\n this.elementRef.nativeElement.style.setProperty(\n '--ngp-accordion-content-height',\n `${this.elementRef.nativeElement.scrollHeight}px`,\n );\n }\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, computed, input, signal } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { NgpAccordionContent } from '../accordion-content/accordion-content';\nimport { NgpAccordionTrigger } from '../accordion-trigger/accordion-trigger';\nimport { NgpAccordion } from '../accordion/accordion';\nimport { injectAccordionState } from '../accordion/accordion-state';\nimport { accordionItemState, provideAccordionItemState } from './accordion-item-state';\n\n/**\n * Apply the `ngpAccordionItem` directive to an element that represents an accordion item.\n */\n@Directive({\n selector: '[ngpAccordionItem]',\n exportAs: 'ngpAccordionItem',\n providers: [provideAccordionItemState()],\n host: {\n '[attr.data-orientation]': 'accordion().orientation()',\n '[attr.data-open]': 'state.open() ? \"\" : null',\n '[attr.data-disabled]': 'state.disabled() || accordion().disabled() ? \"\" : null',\n },\n})\nexport class NgpAccordionItem<T> {\n /**\n * Access the accordion.\n */\n protected readonly accordion = injectAccordionState<NgpAccordion<T>>();\n\n /**\n * The value of the accordion item.\n */\n readonly value = input<T>(uniqueId('ngp-accordion-item') as T, {\n alias: 'ngpAccordionItemValue',\n });\n\n /**\n * Whether the accordion item is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpAccordionItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Access the accordion trigger\n * @internal\n */\n readonly trigger = signal<NgpAccordionTrigger<T> | undefined>(undefined);\n\n /**\n * Access the accordion content\n * @internal\n */\n readonly content = signal<NgpAccordionContent<T> | undefined>(undefined);\n\n /**\n * Whether the accordion item is expanded.\n */\n readonly open = computed<boolean>(() => this.accordion().isOpen(this.state.value()!));\n\n /**\n * The trigger id.\n */\n readonly triggerId = computed(() => this.trigger()?.id());\n\n /**\n * The content id.\n */\n readonly contentId = computed(() => this.content()?.id());\n\n /**\n * The accordion item state.\n */\n private readonly state = accordionItemState<NgpAccordionItem<T>>(this);\n}\n","import { Directive, HOST_TAG_NAME, HostListener, inject, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { NgpAccordionItem } from '../accordion-item/accordion-item';\nimport { injectAccordionItemState } from '../accordion-item/accordion-item-state';\nimport { NgpAccordion } from '../accordion/accordion';\nimport { injectAccordionState } from '../accordion/accordion-state';\n\n/**\n * Apply the `ngpAccordionTrigger` directive to an element that represents the trigger for an accordion item, such as a button.\n */\n@Directive({\n selector: '[ngpAccordionTrigger]',\n exportAs: 'ngpAccordionTrigger',\n host: {\n '[id]': 'id()',\n '[attr.type]': 'tagName === \"button\" ? \"button\" : null',\n '[attr.data-orientation]': 'accordion().orientation()',\n '[attr.data-open]': 'accordionItem().open() ? \"\" : null',\n '[attr.data-disabled]': 'accordionItem().disabled() || accordion().disabled() ? \"\" : null',\n '[attr.aria-controls]': 'accordionItem().contentId()',\n '[attr.aria-expanded]': 'accordionItem().open()',\n },\n})\nexport class NgpAccordionTrigger<T> {\n /**\n * The tag name of the element.\n */\n protected readonly tagName = inject(HOST_TAG_NAME);\n\n /**\n * Access the parent accordion.\n */\n protected readonly accordion = injectAccordionState<NgpAccordion<T>>();\n\n /**\n * The item instance.\n */\n protected readonly accordionItem = injectAccordionItemState<NgpAccordionItem<T>>();\n\n /**\n * The id of the trigger.\n */\n readonly id = input<string>(uniqueId('ngp-accordion-trigger'));\n\n constructor() {\n this.accordionItem().trigger.set(this);\n }\n\n /**\n * Toggle the accordion item.\n */\n @HostListener('click')\n toggle(): void {\n if (this.accordionItem().disabled() || this.accordion().disabled()) {\n return;\n }\n\n this.accordion().toggle(this.accordionItem().value()!);\n }\n}\n","import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpAccordionType } from '../accordion/accordion';\n\nexport interface NgpAccordionConfig {\n /**\n * The default type of the accordion\n * @default 'single'\n */\n type: NgpAccordionType;\n /**\n * Whether the accordion is collapsible\n * @default false\n */\n collapsible: boolean;\n /**\n * The default orientation of the accordion\n * @default 'vertical'\n */\n orientation: 'vertical' | 'horizontal';\n}\n\nexport const defaultAccordionConfig: NgpAccordionConfig = {\n type: 'single',\n collapsible: false,\n orientation: 'vertical',\n};\n\nexport const NgpAccordionConfigToken = new InjectionToken<NgpAccordionConfig>(\n 'NgpAccordionConfigToken',\n);\n\n/**\n * Provide the default Accordion configuration\n * @param config The Accordion configuration\n * @returns The provider\n */\nexport function provideAccordionConfig(config: Partial<NgpAccordionConfig>): Provider[] {\n return [\n {\n provide: NgpAccordionConfigToken,\n useValue: { ...defaultAccordionConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Accordion configuration\n * @returns The global Accordion configuration\n */\nexport function injectAccordionConfig(): NgpAccordionConfig {\n return inject(NgpAccordionConfigToken, { optional: true }) ?? defaultAccordionConfig;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { injectAccordionConfig } from '../config/accordion-config';\nimport { accordionState, provideAccordionState } from './accordion-state';\n\n/**\n * Apply the `ngpAccordion` directive to an element that represents the group of accordion items.\n */\n@Directive({\n selector: '[ngpAccordion]',\n exportAs: 'ngpAccordion',\n providers: [provideAccordionState()],\n host: {\n '[attr.data-orientation]': 'state.orientation()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpAccordion<T> {\n /**\n * Access the global accordion configuration.\n */\n private readonly config = injectAccordionConfig();\n\n /**\n * The type of the accordion.\n */\n readonly type = input<NgpAccordionType>(this.config.type, {\n alias: 'ngpAccordionType',\n });\n\n /**\n * Whether the accordion is collapsible.\n */\n readonly collapsible = input<boolean, BooleanInput>(this.config.collapsible, {\n alias: 'ngpAccordionCollapsible',\n transform: booleanAttribute,\n });\n\n /**\n * The value of the accordion.\n */\n readonly value = input<T | T[] | null>(null, {\n alias: 'ngpAccordionValue',\n });\n\n /**\n * Event emitted when the accordion value changes.\n */\n readonly valueChange = output<T | T[] | null>({\n alias: 'ngpAccordionValueChange',\n });\n\n /**\n * Whether the accordion is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpAccordionDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The accordion orientation.\n */\n readonly orientation = input<NgpOrientation>(this.config.orientation, {\n alias: 'ngpAccordionOrientation',\n });\n\n /**\n * The accordion state.\n */\n private readonly state = accordionState<NgpAccordion<T>>(this);\n\n /**\n * @param value The value to check.\n * @returns Whether the value is open.\n * @internal\n */\n isOpen(value: T): boolean {\n if (this.state.type() === 'multiple') {\n return (this.state.value() as T[] | null)?.includes(value) ?? false;\n }\n\n return this.state.value() === value;\n }\n\n toggle(value: T): void {\n const isOpen = this.isOpen(value);\n\n // if we are in single mode and the value is already open and the accordion is not collapsible, do nothing\n if (this.state.type() === 'single' && isOpen && !this.state.collapsible()) {\n return;\n }\n\n // if we are in single mode then toggle the value\n if (this.state.type() === 'single') {\n const newValue = isOpen ? null : value;\n this.state.value.set(newValue);\n this.valueChange.emit(newValue);\n return;\n }\n\n // if we are in multiple mode then toggle the value\n let values = (this.state.value() as T[]) ?? [];\n\n if (isOpen) {\n values = values.filter(v => v !== value);\n } else {\n values = [...values, value];\n }\n this.state.value.set(values);\n this.valueChange.emit(values);\n }\n}\n\nexport type NgpAccordionType = 'single' | 'multiple';\n","/**\n * Generated bundle index. Do not ed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EG;;;;"}
|
|
@@ -181,7 +181,10 @@ class NgpComboboxInput {
|
|
|
181
181
|
break;
|
|
182
182
|
case 'Enter':
|
|
183
183
|
if (this.state().open()) {
|
|
184
|
-
this.state().
|
|
184
|
+
const activeItem = this.state().activeDescendantManager.activeItem();
|
|
185
|
+
if (activeItem) {
|
|
186
|
+
this.state().toggleOption(activeItem);
|
|
187
|
+
}
|
|
185
188
|
}
|
|
186
189
|
event.preventDefault();
|
|
187
190
|
break;
|
|
@@ -508,6 +511,11 @@ class NgpCombobox {
|
|
|
508
511
|
alias: 'ngpComboboxDisabled',
|
|
509
512
|
transform: booleanAttribute,
|
|
510
513
|
});
|
|
514
|
+
/** Whether the combobox allows deselection in single selection mode. */
|
|
515
|
+
this.allowDeselect = input(false, {
|
|
516
|
+
alias: 'ngpComboboxAllowDeselect',
|
|
517
|
+
transform: booleanAttribute,
|
|
518
|
+
});
|
|
511
519
|
/** Emit when the dropdown open state changes. */
|
|
512
520
|
this.openChange = output({
|
|
513
521
|
alias: 'ngpComboboxOpenChange',
|
|
@@ -677,15 +685,25 @@ class NgpCombobox {
|
|
|
677
685
|
*/
|
|
678
686
|
deselectOption(option) {
|
|
679
687
|
// if the combobox is disabled or the option is not selected, do nothing
|
|
680
|
-
|
|
681
|
-
if (this.state.disabled() || !this.isOptionSelected(option) || !this.state.multiple()) {
|
|
688
|
+
if (this.state.disabled() || !this.isOptionSelected(option)) {
|
|
682
689
|
return;
|
|
683
690
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
this.
|
|
691
|
+
// in single selection mode, only allow deselecting if allowDeselect is true
|
|
692
|
+
if (!this.state.multiple() && !this.state.allowDeselect()) {
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
if (this.state.multiple()) {
|
|
696
|
+
const values = this.state.value() ?? [];
|
|
697
|
+
const newValue = values.filter(v => !this.state.compareWith()(v, option.value()));
|
|
698
|
+
// remove the option from the value
|
|
699
|
+
this.state.value.set(newValue);
|
|
700
|
+
this.valueChange.emit(newValue);
|
|
701
|
+
}
|
|
702
|
+
else {
|
|
703
|
+
// in single selection mode with allowDeselect enabled, set value to undefined
|
|
704
|
+
this.state.value.set(undefined);
|
|
705
|
+
this.valueChange.emit(undefined);
|
|
706
|
+
}
|
|
689
707
|
}
|
|
690
708
|
/**
|
|
691
709
|
* Toggle the selection of an option.
|
|
@@ -696,18 +714,26 @@ class NgpCombobox {
|
|
|
696
714
|
if (this.state.disabled()) {
|
|
697
715
|
return;
|
|
698
716
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
this.deselectOption(option);
|
|
717
|
+
if (this.state.multiple()) {
|
|
718
|
+
// In multiple selection mode, always allow toggling
|
|
719
|
+
if (this.isOptionSelected(option)) {
|
|
720
|
+
this.deselectOption(option);
|
|
721
|
+
}
|
|
722
|
+
else {
|
|
723
|
+
this.selectOption(option);
|
|
724
|
+
}
|
|
708
725
|
}
|
|
709
726
|
else {
|
|
710
|
-
|
|
727
|
+
// In single selection mode, check if deselection is allowed
|
|
728
|
+
if (this.isOptionSelected(option) && this.state.allowDeselect()) {
|
|
729
|
+
// Deselect the option by setting value to undefined
|
|
730
|
+
this.state.value.set(undefined);
|
|
731
|
+
this.valueChange.emit(undefined);
|
|
732
|
+
}
|
|
733
|
+
else {
|
|
734
|
+
// Select the option (works even if already selected to update the input)
|
|
735
|
+
this.selectOption(option);
|
|
736
|
+
}
|
|
711
737
|
}
|
|
712
738
|
}
|
|
713
739
|
/**
|
|
@@ -826,7 +852,7 @@ class NgpCombobox {
|
|
|
826
852
|
this.options.update(options => options.filter(o => o !== option));
|
|
827
853
|
}
|
|
828
854
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpCombobox, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
829
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpCombobox, isStandalone: true, selector: "[ngpCombobox]", inputs: { value: { classPropertyName: "value", publicName: "ngpComboboxValue", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "ngpComboboxMultiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpComboboxDisabled", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "ngpComboboxCompareWith", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpComboboxDropdownPlacement", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpComboboxDropdownContainer", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpComboboxValueChange", openChange: "ngpComboboxOpenChange" }, host: { properties: { "attr.data-open": "state.open() ? \"\" : undefined", "attr.data-disabled": "state.disabled() ? \"\" : undefined", "attr.data-multiple": "state.multiple() ? \"\" : undefined", "attr.data-invalid": "controlStatus()?.invalid ? \"\" : undefined", "attr.data-valid": "controlStatus()?.valid ? \"\" : undefined", "attr.data-touched": "controlStatus()?.touched ? \"\" : undefined", "attr.data-pristine": "controlStatus()?.pristine ? \"\" : undefined", "attr.data-dirty": "controlStatus()?.dirty ? \"\" : undefined", "attr.data-pending": "controlStatus()?.pending ? \"\" : undefined" } }, providers: [provideComboboxState()], exportAs: ["ngpCombobox"], ngImport: i0 }); }
|
|
855
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpCombobox, isStandalone: true, selector: "[ngpCombobox]", inputs: { value: { classPropertyName: "value", publicName: "ngpComboboxValue", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "ngpComboboxMultiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpComboboxDisabled", isSignal: true, isRequired: false, transformFunction: null }, allowDeselect: { classPropertyName: "allowDeselect", publicName: "ngpComboboxAllowDeselect", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "ngpComboboxCompareWith", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpComboboxDropdownPlacement", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpComboboxDropdownContainer", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpComboboxValueChange", openChange: "ngpComboboxOpenChange" }, host: { properties: { "attr.data-open": "state.open() ? \"\" : undefined", "attr.data-disabled": "state.disabled() ? \"\" : undefined", "attr.data-multiple": "state.multiple() ? \"\" : undefined", "attr.data-invalid": "controlStatus()?.invalid ? \"\" : undefined", "attr.data-valid": "controlStatus()?.valid ? \"\" : undefined", "attr.data-touched": "controlStatus()?.touched ? \"\" : undefined", "attr.data-pristine": "controlStatus()?.pristine ? \"\" : undefined", "attr.data-dirty": "controlStatus()?.dirty ? \"\" : undefined", "attr.data-pending": "controlStatus()?.pending ? \"\" : undefined" } }, providers: [provideComboboxState()], exportAs: ["ngpCombobox"], ngImport: i0 }); }
|
|
830
856
|
}
|
|
831
857
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpCombobox, decorators: [{
|
|
832
858
|
type: Directive,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-combobox.mjs","sources":["../../../../packages/ng-primitives/combobox/src/combobox/combobox-state.ts","../../../../packages/ng-primitives/combobox/src/combobox-button/combobox-button.ts","../../../../packages/ng-primitives/combobox/src/combobox-dropdown/combobox-dropdown.ts","../../../../packages/ng-primitives/combobox/src/combobox-input/combobox-input.ts","../../../../packages/ng-primitives/combobox/src/combobox-option/combobox-option.ts","../../../../packages/ng-primitives/combobox/src/combobox-portal/combobox-portal.ts","../../../../packages/ng-primitives/combobox/src/config/combobox-config.ts","../../../../packages/ng-primitives/combobox/src/combobox/combobox.ts","../../../../packages/ng-primitives/combobox/src/ng-primitives-combobox.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpCombobox } from './combobox';\n\n/**\n * The state token for the Combobox primitive.\n */\nexport const NgpComboboxStateToken = createStateToken<NgpCombobox>('Combobox');\n\n/**\n * Provides the Combobox state.\n */\nexport const provideComboboxState = createStateProvider(NgpComboboxStateToken);\n\n/**\n * Injects the Combobox state.\n */\nexport const injectComboboxState = createStateInjector<NgpCombobox>(NgpComboboxStateToken);\n\n/**\n * The Combobox state registration function.\n */\nexport const comboboxState = createState(NgpComboboxStateToken);\n","import { computed, Directive, HostListener, input } from '@angular/core';\nimport { setupInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxButton]',\n exportAs: 'ngpComboboxButton',\n host: {\n type: 'button',\n tabindex: '-1',\n 'aria-haspopup': 'listbox',\n '[id]': 'id()',\n '[attr.aria-controls]': 'dropdownId()',\n '[attr.aria-expanded]': 'state().open()',\n '[attr.data-open]': 'state().open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state().disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state().multiple() ? \"\" : undefined',\n '[disabled]': 'state().disabled()',\n },\n})\nexport class NgpComboboxButton {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef<HTMLButtonElement>();\n\n /** The id of the button. */\n readonly id = input<string>(uniqueId('ngp-combobox-button'));\n\n /** The id of the dropdown. */\n readonly dropdownId = computed(() => this.state().dropdown()?.id());\n\n constructor() {\n setupInteractions({\n hover: true,\n press: true,\n disabled: this.state().disabled,\n });\n\n this.state().registerButton(this);\n }\n\n @HostListener('click')\n protected async toggleDropdown(): Promise<void> {\n await this.state().toggleDropdown();\n this.state().input()?.focus();\n }\n}\n","import { Directive, input } from '@angular/core';\nimport { injectElementRef, observeResize } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxDropdown]',\n exportAs: 'ngpComboboxDropdown',\n host: {\n role: 'listbox',\n '[id]': 'id()',\n '[style.left.px]': 'state().overlay()?.position()?.x',\n '[style.top.px]': 'state().overlay()?.position()?.y',\n '[style.--ngp-combobox-transform-origin]': 'state().overlay()?.transformOrigin()',\n '[style.--ngp-combobox-width.px]': 'comboboxDimensions().width',\n '[style.--ngp-combobox-input-width.px]': 'inputDimensions().width',\n '[style.--ngp-combobox-button-width.px]': 'buttonDimensions().width',\n },\n})\nexport class NgpComboboxDropdown {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /** The dimensions of the combobox. */\n protected readonly comboboxDimensions = observeResize(\n () => this.state().elementRef.nativeElement,\n );\n\n /** The dimensions of the combobox. */\n protected readonly inputDimensions = observeResize(\n () => this.state().input()?.elementRef.nativeElement,\n );\n\n /** Store the combobox button dimensions. */\n protected readonly buttonDimensions = observeResize(\n () => this.state().button()?.elementRef.nativeElement,\n );\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef();\n\n /** The id of the dropdown. */\n readonly id = input<string>(uniqueId('ngp-combobox-dropdown'));\n\n constructor() {\n this.state().registerDropdown(this);\n }\n}\n","import { computed, Directive, HostListener, input } 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 { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: 'input[ngpComboboxInput]',\n exportAs: 'ngpComboboxInput',\n host: {\n role: 'combobox',\n type: 'text',\n autocomplete: 'off',\n autocorrect: 'off',\n spellcheck: 'false',\n 'aria-haspopup': 'listbox',\n 'aria-autocomplete': 'list',\n '[id]': 'id()',\n '[attr.aria-controls]': 'state().open() ? dropdownId() : undefined',\n '[attr.aria-expanded]': 'state().open()',\n '[attr.data-open]': 'state().open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state().disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state().multiple() ? \"\" : undefined',\n '[attr.aria-activedescendant]': 'activeDescendant()',\n '[disabled]': 'state().disabled()',\n },\n})\nexport class NgpComboboxInput {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef<HTMLInputElement>();\n\n /** The id of the input. */\n readonly id = input<string>(uniqueId('ngp-combobox-input'));\n\n /** The id of the dropdown. */\n readonly dropdownId = computed(() => this.state().dropdown()?.id());\n\n /** The id of the active descendant. */\n protected readonly activeDescendant = computed(() =>\n this.state().activeDescendantManager.activeDescendant(),\n );\n\n /** Determine if the pointer was used to focus the input. */\n protected pointerFocused = false;\n\n /**\n * The control status - this is required as we apply them to the combobox element as well as the input element.\n * @internal\n */\n readonly controlStatus = setupFormControl({ id: this.id, disabled: this.state().disabled });\n\n constructor() {\n setupInteractions({\n focus: true,\n hover: true,\n press: true,\n disabled: this.state().disabled,\n });\n\n this.state().registerInput(this);\n }\n\n /** Handle keydown events for accessibility. */\n @HostListener('keydown', ['$event'])\n protected handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowDown':\n if (this.state().open()) {\n this.state().activateNextOption();\n } else {\n this.state().openDropdown();\n }\n event.preventDefault();\n break;\n case 'ArrowUp':\n if (this.state().open()) {\n this.state().activatePreviousOption();\n } else {\n this.state().openDropdown();\n this.state().activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Home':\n if (this.state().open()) {\n this.state().activeDescendantManager.first();\n }\n event.preventDefault();\n break;\n case 'End':\n if (this.state().open()) {\n this.state().activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Enter':\n if (this.state().open()) {\n this.state().selectOption(this.state().activeDescendantManager.activeItem());\n }\n event.preventDefault();\n break;\n case 'Escape':\n this.state().closeDropdown();\n event.preventDefault();\n break;\n case 'Backspace':\n // if the input is not empty then open the dropdown\n if (this.elementRef.nativeElement.value.length > 0) {\n this.state().openDropdown();\n }\n break;\n default:\n // Ignore keys with length > 1 (e.g., 'Shift', 'ArrowLeft', 'Enter', etc.)\n // Filter out control/meta key combos (e.g., Ctrl+C)\n if (event.key.length > 1 || event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n\n // if this was a character key, we want to open the dropdown\n this.state().openDropdown();\n }\n }\n\n @HostListener('blur', ['$event'])\n protected closeDropdown(event: FocusEvent): void {\n const relatedTarget = event.relatedTarget as HTMLElement;\n\n // if the blur was caused by focus moving to the dropdown, don't close\n if (\n relatedTarget &&\n this.state().dropdown()?.elementRef.nativeElement.contains(relatedTarget)\n ) {\n return;\n }\n\n // if the blur was caused by focus moving to the button, don't close\n if (relatedTarget && this.state().button()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n this.state().closeDropdown();\n event.preventDefault();\n }\n\n /**\n * Focus the input field\n * @internal\n */\n focus(): void {\n this.elementRef.nativeElement.focus();\n }\n\n @HostListener('focus', ['$event'])\n protected highlightText(): void {\n if (this.pointerFocused) {\n this.pointerFocused = false;\n return;\n }\n\n // highlight the text in the input\n this.elementRef.nativeElement.setSelectionRange(0, this.elementRef.nativeElement.value.length);\n }\n\n @HostListener('pointerdown', ['$event'])\n protected handlePointerDown(): void {\n this.pointerFocused = true;\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n input,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport { NgpActivatable } from 'ng-primitives/a11y';\nimport { setupInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxOption]',\n exportAs: 'ngpComboboxOption',\n host: {\n role: 'option',\n '[id]': 'id()',\n '[attr.tabindex]': '-1',\n '[attr.aria-selected]': 'selected() ? \"true\" : undefined',\n '[attr.data-selected]': 'selected() ? \"\" : undefined',\n '[attr.data-active]': 'active() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '(click)': 'select()',\n },\n})\nexport class NgpComboboxOption implements OnInit, OnDestroy, NgpActivatable {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /**\n * The element reference of the option.\n * @internal\n */\n readonly elementRef = injectElementRef();\n\n /** The id of the option. */\n readonly id = input<string>(uniqueId('ngp-combobox-option'));\n\n /** @required The value of the option. */\n readonly value = input<any>(undefined, {\n alias: 'ngpComboboxOptionValue',\n });\n\n /** The disabled state of the option. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxOptionDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether this option is the active descendant.\n * @internal\n */\n protected readonly active = computed(\n () => this.state().activeDescendantManager.activeDescendant() === this.id(),\n );\n\n /** Whether this option is selected. */\n protected readonly selected = computed(() => {\n const value = this.value();\n\n if (!value) {\n return false;\n }\n\n if (this.state().multiple()) {\n return (\n Array.isArray(value) && value.some(v => this.state().compareWith()(v, this.state().value()))\n );\n }\n\n return this.state().compareWith()(value, this.state().value());\n });\n\n constructor() {\n this.state().registerOption(this);\n\n setupInteractions({\n hover: true,\n press: true,\n disabled: this.disabled,\n });\n }\n\n ngOnInit(): void {\n if (this.value() === undefined) {\n throw new Error(\n 'ngpComboboxOption: The value input is required. Please provide a value for the option.',\n );\n }\n }\n\n ngOnDestroy(): void {\n this.state().unregisterOption(this);\n }\n\n /**\n * Select the option.\n * @internal\n */\n select(): void {\n if (this.disabled()) {\n return;\n }\n\n this.state().toggleOption(this);\n }\n\n /**\n * Scroll the option into view.\n * @internal\n */\n scrollIntoView(): void {\n this.elementRef.nativeElement.scrollIntoView({ block: 'nearest' });\n }\n\n /**\n * Whenever the pointer enters the option, activate it.\n * @internal\n */\n @HostListener('pointerenter')\n protected onPointerEnter(): void {\n this.state().activeDescendantManager.activate(this);\n }\n\n /**\n * Whenever the pointer leaves the option, deactivate it.\n * @internal\n */\n @HostListener('pointerleave')\n protected onPointerLeave(): void {\n this.state().activeDescendantManager.activate(undefined);\n }\n}\n","import {\n Directive,\n inject,\n Injector,\n OnDestroy,\n signal,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { createOverlay, NgpOverlay, NgpOverlayConfig } from 'ng-primitives/portal';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxPortal]',\n exportAs: 'ngpComboboxPortal',\n})\nexport class NgpComboboxPortal implements OnDestroy {\n /** Access the combobox state. */\n private readonly state = injectComboboxState();\n /** Access the view container reference. */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /** Access the template reference. */\n private readonly templateRef = inject(TemplateRef);\n\n /** Access the injector. */\n private readonly injector = inject(Injector);\n\n /**\n * The overlay that manages the popover\n * @internal\n */\n readonly overlay = signal<NgpOverlay<void> | null>(null);\n\n constructor() {\n this.state().registerPortal(this);\n }\n\n /** Cleanup the portal. */\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Attach the portal.\n * @internal\n */\n show(): Promise<void> {\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n return this.overlay()!.show();\n }\n\n /**\n * Detach the portal.\n * @internal\n */\n async detach(): Promise<void> {\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the dropdown\n */\n private createOverlay(): void {\n // Create config for the overlay\n const config: NgpOverlayConfig<void> = {\n content: this.templateRef,\n viewContainerRef: this.viewContainerRef,\n triggerElement: this.state().elementRef.nativeElement,\n injector: this.injector,\n placement: this.state().placement(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: false,\n scrollBehaviour: 'reposition',\n container: this.state().container(),\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n","import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type NgpComboboxPlacement } from '../combobox/combobox';\n\nexport interface NgpComboboxConfig {\n /**\n * The default placement for the combobox dropdown.\n * @default 'bottom'\n */\n placement: NgpComboboxPlacement;\n\n /**\n * The container element or selector for the combobox dropdown.\n * This can be used to control where the dropdown is rendered in the DOM.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n}\n\nexport const defaultComboboxConfig: NgpComboboxConfig = {\n placement: 'bottom',\n container: 'body',\n};\n\nexport const NgpComboboxConfigToken = new InjectionToken<NgpComboboxConfig>(\n 'NgpComboboxConfigToken',\n);\n\n/**\n * Provide the default Combobox configuration\n * @param config The Combobox configuration\n * @returns The provider\n */\nexport function provideComboboxConfig(config: Partial<NgpComboboxConfig>): Provider[] {\n return [\n {\n provide: NgpComboboxConfigToken,\n useValue: { ...defaultComboboxConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Combobox configuration\n * @returns The global Combobox configuration\n */\nexport function injectComboboxConfig(): NgpComboboxConfig {\n return inject(NgpComboboxConfigToken, { optional: true }) ?? defaultComboboxConfig;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n inject,\n Injector,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { activeDescendantManager } from 'ng-primitives/a11y';\nimport { setupInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport type { NgpComboboxButton } from '../combobox-button/combobox-button';\nimport type { NgpComboboxDropdown } from '../combobox-dropdown/combobox-dropdown';\nimport type { NgpComboboxInput } from '../combobox-input/combobox-input';\nimport { NgpComboboxOption } from '../combobox-option/combobox-option';\nimport type { NgpComboboxPortal } from '../combobox-portal/combobox-portal';\nimport { injectComboboxConfig } from '../config/combobox-config';\nimport { comboboxState, provideComboboxState } from './combobox-state';\n\n/**\n * Ideally we would use a generic type here, unfortunately, unlike in React,\n * we cannot infer the type based on another input. For example, if multiple\n * is true, we cannot infer that the value is an array of T. Using a union\n * type is not ideal either because it requires the user to handle multiple cases.\n * Using a generic also isn't ideal because we need to use T as both an array and\n * a single value.\n *\n * Any seems to be used by Angular Material, ng-select, and other libraries\n * so we will use it here as well.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype T = any;\n\n@Directive({\n selector: '[ngpCombobox]',\n exportAs: 'ngpCombobox',\n providers: [provideComboboxState()],\n host: {\n '[attr.data-open]': 'state.open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state.multiple() ? \"\" : undefined',\n '[attr.data-invalid]': 'controlStatus()?.invalid ? \"\" : undefined',\n '[attr.data-valid]': 'controlStatus()?.valid ? \"\" : undefined',\n '[attr.data-touched]': 'controlStatus()?.touched ? \"\" : undefined',\n '[attr.data-pristine]': 'controlStatus()?.pristine ? \"\" : undefined',\n '[attr.data-dirty]': 'controlStatus()?.dirty ? \"\" : undefined',\n '[attr.data-pending]': 'controlStatus()?.pending ? \"\" : undefined',\n },\n})\nexport class NgpCombobox {\n /** Access the combobox configuration. */\n protected readonly config = injectComboboxConfig();\n\n /** @internal Access the combobox element. */\n readonly elementRef = injectElementRef();\n\n /** Access the injector. */\n protected readonly injector = inject(Injector);\n\n /** The value of the combobox. */\n readonly value = input<T>(undefined, {\n alias: 'ngpComboboxValue',\n });\n\n /** Event emitted when the value changes. */\n readonly valueChange = output<T>({\n alias: 'ngpComboboxValueChange',\n });\n\n /** Whether the combobox is multiple selection. */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxMultiple',\n transform: booleanAttribute,\n });\n\n /** Whether the combobox is disabled. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxDisabled',\n transform: booleanAttribute,\n });\n\n /** Emit when the dropdown open state changes. */\n readonly openChange = output<boolean>({\n alias: 'ngpComboboxOpenChange',\n });\n\n /** The comparator function used to compare options. */\n readonly compareWith = input<(a: T | undefined, b: T | undefined) => boolean>(Object.is, {\n alias: 'ngpComboboxCompareWith',\n });\n\n /** The position of the dropdown. */\n readonly placement = input<NgpComboboxPlacement>(this.config.placement, {\n alias: 'ngpComboboxDropdownPlacement',\n });\n\n /** The container for the dropdown. */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpComboboxDropdownContainer',\n });\n\n /**\n * Store the combobox input\n * @internal\n */\n readonly input = signal<NgpComboboxInput | undefined>(undefined);\n\n /**\n * Store the combobox button.\n * @internal\n */\n readonly button = signal<NgpComboboxButton | undefined>(undefined);\n\n /**\n * Store the combobox portal.\n * @internal\n */\n readonly portal = signal<NgpComboboxPortal | undefined>(undefined);\n\n /**\n * Store the combobox dropdown.\n * @internal\n */\n readonly dropdown = signal<NgpComboboxDropdown | undefined>(undefined);\n\n /**\n * Store the combobox options.\n * @internal\n */\n readonly options = signal<NgpComboboxOption[]>([]);\n\n /**\n * Access the overlay\n * @internal\n */\n readonly overlay = computed(() => this.portal()?.overlay());\n\n /**\n * The open state of the combobox.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * The active key descendant manager.\n * @internal\n */\n readonly activeDescendantManager = activeDescendantManager({\n // we must wrap the signal in a computed to ensure it is not used before it is defined\n disabled: computed(() => this.state.disabled()),\n items: this.options,\n });\n\n /** The control status */\n protected readonly controlStatus = computed(() => this.input()?.controlStatus());\n\n /** The state of the combobox. */\n protected readonly state = comboboxState<NgpCombobox>(this);\n\n constructor() {\n setupInteractions({\n focus: true,\n focusWithin: true,\n hover: true,\n press: true,\n disabled: this.state.disabled,\n });\n\n // any time the active descendant changes, ensure we scroll it into view\n // perform after next render to ensure the DOM is updated\n // e.g. the dropdown is open before the option is scrolled into view\n afterRenderEffect({\n write: () => {\n const isPositioned = this.portal()?.overlay()?.isPositioned() ?? false;\n const activeItem = this.activeDescendantManager.activeItem();\n\n if (!isPositioned || !activeItem) {\n return;\n }\n\n this.activeDescendantManager.activeItem()?.scrollIntoView?.();\n },\n });\n }\n\n /**\n * Open the dropdown.\n * @internal\n */\n async openDropdown(): Promise<void> {\n if (this.state.disabled() || this.open()) {\n return;\n }\n\n this.openChange.emit(true);\n await this.portal()?.show();\n\n // if there is a selected option(s), set the active descendant to the first selected option\n const selectedOption = this.options().find(option => this.isOptionSelected(option));\n\n // if there is no selected option, set the active descendant to the first option\n const targetOption = selectedOption ?? this.options()[0];\n\n // if there is no target option, do nothing\n if (!targetOption) {\n return;\n }\n\n // activate the selected option or the first option\n this.activeDescendantManager.activate(targetOption);\n }\n\n /**\n * Close the dropdown.\n * @internal\n */\n closeDropdown(): void {\n if (!this.open()) {\n return;\n }\n\n this.openChange.emit(false);\n this.portal()?.detach();\n\n // clear the active descendant\n this.activeDescendantManager.reset();\n }\n\n /**\n * Toggle the dropdown.\n * @internal\n */\n async toggleDropdown(): Promise<void> {\n if (this.open()) {\n this.closeDropdown();\n } else {\n await this.openDropdown();\n }\n }\n\n /**\n * Select an option.\n * @param option The option to select.\n * @internal\n */\n selectOption(option: NgpComboboxOption | undefined): void {\n if (this.state.disabled()) {\n return;\n }\n\n if (!option) {\n this.state.value.set(undefined);\n this.closeDropdown();\n return;\n }\n\n if (this.state.multiple()) {\n // if the option is already selected, do nothing\n if (this.isOptionSelected(option)) {\n return;\n }\n\n const value = [...(this.state.value() as T[]), option.value() as T];\n\n // add the option to the value\n this.state.value.set(value as T);\n this.valueChange.emit(value as T);\n } else {\n this.state.value.set(option.value() as T);\n this.valueChange.emit(option.value() as T);\n\n // close the dropdown on single selection\n this.closeDropdown();\n }\n }\n\n /**\n * Deselect an option.\n * @param option The option to deselect.\n * @internal\n */\n deselectOption(option: NgpComboboxOption): void {\n // if the combobox is disabled or the option is not selected, do nothing\n // if the combobox is single selection, we don't allow deselecting\n if (this.state.disabled() || !this.isOptionSelected(option) || !this.state.multiple()) {\n return;\n }\n\n const values = (this.state.value() as T[]) ?? [];\n\n const newValue = values.filter(v => !this.state.compareWith()(v, option.value() as T));\n\n // remove the option from the value\n this.state.value.set(newValue as T);\n this.valueChange.emit(newValue as T);\n }\n\n /**\n * Toggle the selection of an option.\n * @param option The option to toggle.\n * @internal\n */\n toggleOption(option: NgpComboboxOption): void {\n if (this.state.disabled()) {\n return;\n }\n\n // if the state is single selection, we don't allow toggling\n if (!this.state.multiple()) {\n // always select the option in single selection mode even if it is already selected so that we update the input\n this.selectOption(option);\n return;\n }\n\n // otherwise toggle the option\n if (this.isOptionSelected(option)) {\n this.deselectOption(option);\n } else {\n this.selectOption(option);\n }\n }\n\n /**\n * Determine if an option is selected.\n * @param option The option to check.\n * @internal\n */\n isOptionSelected(option: NgpComboboxOption): boolean {\n if (this.state.disabled()) {\n return false;\n }\n\n const value = this.state.value();\n\n if (!value) {\n return false;\n }\n\n if (this.state.multiple()) {\n return value && (value as T[]).some(v => this.state.compareWith()(option.value(), v));\n }\n\n return this.state.compareWith()(option.value(), value);\n }\n\n /**\n * Activate the next option in the list if there is one.\n * If there is no option currently active, activate the selected option or the first option.\n * @internal\n */\n activateNextOption(): void {\n if (this.state.disabled()) {\n return;\n }\n\n const options = this.options();\n\n // if there are no options, do nothing\n if (options.length === 0) {\n return;\n }\n\n // if there is no active option, activate the first option\n if (!this.activeDescendantManager.activeItem()) {\n const selectedOption = options.find(option => this.isOptionSelected(option));\n\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption ?? options[0];\n\n this.activeDescendantManager.activate(targetOption);\n return;\n }\n\n // otherwise activate the next option\n this.activeDescendantManager.next();\n }\n\n /**\n * Activate the previous option in the list if there is one.\n * @internal\n */\n activatePreviousOption(): void {\n if (this.state.disabled()) {\n return;\n }\n const options = this.options();\n // if there are no options, do nothing\n if (options.length === 0) {\n return;\n }\n // if there is no active option, activate the last option\n if (!this.activeDescendantManager.activeItem()) {\n const selectedOption = options.find(option => this.isOptionSelected(option));\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption ?? options[options.length - 1];\n this.activeDescendantManager.activate(targetOption);\n return;\n }\n // otherwise activate the previous option\n this.activeDescendantManager.previous();\n }\n\n /**\n * Register the dropdown portal with the combobox.\n * @param portal The dropdown portal.\n * @internal\n */\n registerPortal(portal: NgpComboboxPortal): void {\n this.portal.set(portal);\n }\n\n /**\n * Register the combobox input with the combobox.\n * @param input The combobox input.\n * @internal\n */\n registerInput(input: NgpComboboxInput): void {\n this.input.set(input);\n }\n\n /**\n * Register the combobox button with the combobox.\n * @param button The combobox button.\n * @internal\n */\n registerButton(button: NgpComboboxButton): void {\n this.button.set(button);\n }\n\n /**\n * Register the dropdown with the combobox.\n * @param dropdown The dropdown to register.\n * @internal\n */\n registerDropdown(dropdown: NgpComboboxDropdown): void {\n this.dropdown.set(dropdown);\n }\n\n /**\n * Register an option with the combobox.\n * @param option The option to register.\n * @internal\n */\n registerOption(option: NgpComboboxOption): void {\n this.options.update(options => [...options, option]);\n }\n\n /**\n * Unregister an option from the combobox.\n * @param option The option to unregister.\n * @internal\n */\n unregisterOption(option: NgpComboboxOption): void {\n this.options.update(options => options.filter(o => o !== option));\n }\n}\n\nexport type NgpComboboxPlacement =\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":";;;;;;;;;;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;A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AAA,EAAA,EAAA,SAAA,EAbX,CAAC,oBAAoB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAaxB,WAAW,EAAA,UAAA,EAAA,CAAA;kBAhBvB,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,kBAAkB,EAAE,+BAA+B;AACnD,wBAAA,sBAAsB,EAAE,mCAAmC;AAC3D,wBAAA,sBAAsB,EAAE,mCAAmC;AAC3D,wBAAA,qBAAqB,EAAE,2CAA2C;AAClE,wBAAA,mBAAmB,EAAE,yCAAyC;AAC9D,wBAAA,qBAAqB,EAAE,2CAA2C;AAClE,wBAAA,sBAAsB,EAAE,4CAA4C;AACpE,wBAAA,mBAAmB,EAAE,yCAAyC;AAC9D,wBAAA,qBAAqB,EAAE,2CAA2C;AACnE,qBAAA;AACF,iBAAA;;;ACpDD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-combobox.mjs","sources":["../../../../packages/ng-primitives/combobox/src/combobox/combobox-state.ts","../../../../packages/ng-primitives/combobox/src/combobox-button/combobox-button.ts","../../../../packages/ng-primitives/combobox/src/combobox-dropdown/combobox-dropdown.ts","../../../../packages/ng-primitives/combobox/src/combobox-input/combobox-input.ts","../../../../packages/ng-primitives/combobox/src/combobox-option/combobox-option.ts","../../../../packages/ng-primitives/combobox/src/combobox-portal/combobox-portal.ts","../../../../packages/ng-primitives/combobox/src/config/combobox-config.ts","../../../../packages/ng-primitives/combobox/src/combobox/combobox.ts","../../../../packages/ng-primitives/combobox/src/ng-primitives-combobox.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpCombobox } from './combobox';\n\n/**\n * The state token for the Combobox primitive.\n */\nexport const NgpComboboxStateToken = createStateToken<NgpCombobox>('Combobox');\n\n/**\n * Provides the Combobox state.\n */\nexport const provideComboboxState = createStateProvider(NgpComboboxStateToken);\n\n/**\n * Injects the Combobox state.\n */\nexport const injectComboboxState = createStateInjector<NgpCombobox>(NgpComboboxStateToken);\n\n/**\n * The Combobox state registration function.\n */\nexport const comboboxState = createState(NgpComboboxStateToken);\n","import { computed, Directive, HostListener, input } from '@angular/core';\nimport { setupInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxButton]',\n exportAs: 'ngpComboboxButton',\n host: {\n type: 'button',\n tabindex: '-1',\n 'aria-haspopup': 'listbox',\n '[id]': 'id()',\n '[attr.aria-controls]': 'dropdownId()',\n '[attr.aria-expanded]': 'state().open()',\n '[attr.data-open]': 'state().open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state().disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state().multiple() ? \"\" : undefined',\n '[disabled]': 'state().disabled()',\n },\n})\nexport class NgpComboboxButton {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef<HTMLButtonElement>();\n\n /** The id of the button. */\n readonly id = input<string>(uniqueId('ngp-combobox-button'));\n\n /** The id of the dropdown. */\n readonly dropdownId = computed(() => this.state().dropdown()?.id());\n\n constructor() {\n setupInteractions({\n hover: true,\n press: true,\n disabled: this.state().disabled,\n });\n\n this.state().registerButton(this);\n }\n\n @HostListener('click')\n protected async toggleDropdown(): Promise<void> {\n await this.state().toggleDropdown();\n this.state().input()?.focus();\n }\n}\n","import { Directive, input } from '@angular/core';\nimport { injectElementRef, observeResize } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxDropdown]',\n exportAs: 'ngpComboboxDropdown',\n host: {\n role: 'listbox',\n '[id]': 'id()',\n '[style.left.px]': 'state().overlay()?.position()?.x',\n '[style.top.px]': 'state().overlay()?.position()?.y',\n '[style.--ngp-combobox-transform-origin]': 'state().overlay()?.transformOrigin()',\n '[style.--ngp-combobox-width.px]': 'comboboxDimensions().width',\n '[style.--ngp-combobox-input-width.px]': 'inputDimensions().width',\n '[style.--ngp-combobox-button-width.px]': 'buttonDimensions().width',\n },\n})\nexport class NgpComboboxDropdown {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /** The dimensions of the combobox. */\n protected readonly comboboxDimensions = observeResize(\n () => this.state().elementRef.nativeElement,\n );\n\n /** The dimensions of the combobox. */\n protected readonly inputDimensions = observeResize(\n () => this.state().input()?.elementRef.nativeElement,\n );\n\n /** Store the combobox button dimensions. */\n protected readonly buttonDimensions = observeResize(\n () => this.state().button()?.elementRef.nativeElement,\n );\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef();\n\n /** The id of the dropdown. */\n readonly id = input<string>(uniqueId('ngp-combobox-dropdown'));\n\n constructor() {\n this.state().registerDropdown(this);\n }\n}\n","import { computed, Directive, HostListener, input } 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 { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: 'input[ngpComboboxInput]',\n exportAs: 'ngpComboboxInput',\n host: {\n role: 'combobox',\n type: 'text',\n autocomplete: 'off',\n autocorrect: 'off',\n spellcheck: 'false',\n 'aria-haspopup': 'listbox',\n 'aria-autocomplete': 'list',\n '[id]': 'id()',\n '[attr.aria-controls]': 'state().open() ? dropdownId() : undefined',\n '[attr.aria-expanded]': 'state().open()',\n '[attr.data-open]': 'state().open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state().disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state().multiple() ? \"\" : undefined',\n '[attr.aria-activedescendant]': 'activeDescendant()',\n '[disabled]': 'state().disabled()',\n },\n})\nexport class NgpComboboxInput {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef<HTMLInputElement>();\n\n /** The id of the input. */\n readonly id = input<string>(uniqueId('ngp-combobox-input'));\n\n /** The id of the dropdown. */\n readonly dropdownId = computed(() => this.state().dropdown()?.id());\n\n /** The id of the active descendant. */\n protected readonly activeDescendant = computed(() =>\n this.state().activeDescendantManager.activeDescendant(),\n );\n\n /** Determine if the pointer was used to focus the input. */\n protected pointerFocused = false;\n\n /**\n * The control status - this is required as we apply them to the combobox element as well as the input element.\n * @internal\n */\n readonly controlStatus = setupFormControl({ id: this.id, disabled: this.state().disabled });\n\n constructor() {\n setupInteractions({\n focus: true,\n hover: true,\n press: true,\n disabled: this.state().disabled,\n });\n\n this.state().registerInput(this);\n }\n\n /** Handle keydown events for accessibility. */\n @HostListener('keydown', ['$event'])\n protected handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowDown':\n if (this.state().open()) {\n this.state().activateNextOption();\n } else {\n this.state().openDropdown();\n }\n event.preventDefault();\n break;\n case 'ArrowUp':\n if (this.state().open()) {\n this.state().activatePreviousOption();\n } else {\n this.state().openDropdown();\n this.state().activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Home':\n if (this.state().open()) {\n this.state().activeDescendantManager.first();\n }\n event.preventDefault();\n break;\n case 'End':\n if (this.state().open()) {\n this.state().activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Enter':\n if (this.state().open()) {\n const activeItem = this.state().activeDescendantManager.activeItem();\n if (activeItem) {\n this.state().toggleOption(activeItem);\n }\n }\n event.preventDefault();\n break;\n case 'Escape':\n this.state().closeDropdown();\n event.preventDefault();\n break;\n case 'Backspace':\n // if the input is not empty then open the dropdown\n if (this.elementRef.nativeElement.value.length > 0) {\n this.state().openDropdown();\n }\n break;\n default:\n // Ignore keys with length > 1 (e.g., 'Shift', 'ArrowLeft', 'Enter', etc.)\n // Filter out control/meta key combos (e.g., Ctrl+C)\n if (event.key.length > 1 || event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n\n // if this was a character key, we want to open the dropdown\n this.state().openDropdown();\n }\n }\n\n @HostListener('blur', ['$event'])\n protected closeDropdown(event: FocusEvent): void {\n const relatedTarget = event.relatedTarget as HTMLElement;\n\n // if the blur was caused by focus moving to the dropdown, don't close\n if (\n relatedTarget &&\n this.state().dropdown()?.elementRef.nativeElement.contains(relatedTarget)\n ) {\n return;\n }\n\n // if the blur was caused by focus moving to the button, don't close\n if (relatedTarget && this.state().button()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n this.state().closeDropdown();\n event.preventDefault();\n }\n\n /**\n * Focus the input field\n * @internal\n */\n focus(): void {\n this.elementRef.nativeElement.focus();\n }\n\n @HostListener('focus', ['$event'])\n protected highlightText(): void {\n if (this.pointerFocused) {\n this.pointerFocused = false;\n return;\n }\n\n // highlight the text in the input\n this.elementRef.nativeElement.setSelectionRange(0, this.elementRef.nativeElement.value.length);\n }\n\n @HostListener('pointerdown', ['$event'])\n protected handlePointerDown(): void {\n this.pointerFocused = true;\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n input,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport { NgpActivatable } from 'ng-primitives/a11y';\nimport { setupInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxOption]',\n exportAs: 'ngpComboboxOption',\n host: {\n role: 'option',\n '[id]': 'id()',\n '[attr.tabindex]': '-1',\n '[attr.aria-selected]': 'selected() ? \"true\" : undefined',\n '[attr.data-selected]': 'selected() ? \"\" : undefined',\n '[attr.data-active]': 'active() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '(click)': 'select()',\n },\n})\nexport class NgpComboboxOption implements OnInit, OnDestroy, NgpActivatable {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /**\n * The element reference of the option.\n * @internal\n */\n readonly elementRef = injectElementRef();\n\n /** The id of the option. */\n readonly id = input<string>(uniqueId('ngp-combobox-option'));\n\n /** @required The value of the option. */\n readonly value = input<any>(undefined, {\n alias: 'ngpComboboxOptionValue',\n });\n\n /** The disabled state of the option. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxOptionDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether this option is the active descendant.\n * @internal\n */\n protected readonly active = computed(\n () => this.state().activeDescendantManager.activeDescendant() === this.id(),\n );\n\n /** Whether this option is selected. */\n protected readonly selected = computed(() => {\n const value = this.value();\n\n if (!value) {\n return false;\n }\n\n if (this.state().multiple()) {\n return (\n Array.isArray(value) && value.some(v => this.state().compareWith()(v, this.state().value()))\n );\n }\n\n return this.state().compareWith()(value, this.state().value());\n });\n\n constructor() {\n this.state().registerOption(this);\n\n setupInteractions({\n hover: true,\n press: true,\n disabled: this.disabled,\n });\n }\n\n ngOnInit(): void {\n if (this.value() === undefined) {\n throw new Error(\n 'ngpComboboxOption: The value input is required. Please provide a value for the option.',\n );\n }\n }\n\n ngOnDestroy(): void {\n this.state().unregisterOption(this);\n }\n\n /**\n * Select the option.\n * @internal\n */\n select(): void {\n if (this.disabled()) {\n return;\n }\n\n this.state().toggleOption(this);\n }\n\n /**\n * Scroll the option into view.\n * @internal\n */\n scrollIntoView(): void {\n this.elementRef.nativeElement.scrollIntoView({ block: 'nearest' });\n }\n\n /**\n * Whenever the pointer enters the option, activate it.\n * @internal\n */\n @HostListener('pointerenter')\n protected onPointerEnter(): void {\n this.state().activeDescendantManager.activate(this);\n }\n\n /**\n * Whenever the pointer leaves the option, deactivate it.\n * @internal\n */\n @HostListener('pointerleave')\n protected onPointerLeave(): void {\n this.state().activeDescendantManager.activate(undefined);\n }\n}\n","import {\n Directive,\n inject,\n Injector,\n OnDestroy,\n signal,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { createOverlay, NgpOverlay, NgpOverlayConfig } from 'ng-primitives/portal';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxPortal]',\n exportAs: 'ngpComboboxPortal',\n})\nexport class NgpComboboxPortal implements OnDestroy {\n /** Access the combobox state. */\n private readonly state = injectComboboxState();\n /** Access the view container reference. */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /** Access the template reference. */\n private readonly templateRef = inject(TemplateRef);\n\n /** Access the injector. */\n private readonly injector = inject(Injector);\n\n /**\n * The overlay that manages the popover\n * @internal\n */\n readonly overlay = signal<NgpOverlay<void> | null>(null);\n\n constructor() {\n this.state().registerPortal(this);\n }\n\n /** Cleanup the portal. */\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Attach the portal.\n * @internal\n */\n show(): Promise<void> {\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n return this.overlay()!.show();\n }\n\n /**\n * Detach the portal.\n * @internal\n */\n async detach(): Promise<void> {\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the dropdown\n */\n private createOverlay(): void {\n // Create config for the overlay\n const config: NgpOverlayConfig<void> = {\n content: this.templateRef,\n viewContainerRef: this.viewContainerRef,\n triggerElement: this.state().elementRef.nativeElement,\n injector: this.injector,\n placement: this.state().placement(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: false,\n scrollBehaviour: 'reposition',\n container: this.state().container(),\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n","import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type NgpComboboxPlacement } from '../combobox/combobox';\n\nexport interface NgpComboboxConfig {\n /**\n * The default placement for the combobox dropdown.\n * @default 'bottom'\n */\n placement: NgpComboboxPlacement;\n\n /**\n * The container element or selector for the combobox dropdown.\n * This can be used to control where the dropdown is rendered in the DOM.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n}\n\nexport const defaultComboboxConfig: NgpComboboxConfig = {\n placement: 'bottom',\n container: 'body',\n};\n\nexport const NgpComboboxConfigToken = new InjectionToken<NgpComboboxConfig>(\n 'NgpComboboxConfigToken',\n);\n\n/**\n * Provide the default Combobox configuration\n * @param config The Combobox configuration\n * @returns The provider\n */\nexport function provideComboboxConfig(config: Partial<NgpComboboxConfig>): Provider[] {\n return [\n {\n provide: NgpComboboxConfigToken,\n useValue: { ...defaultComboboxConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Combobox configuration\n * @returns The global Combobox configuration\n */\nexport function injectComboboxConfig(): NgpComboboxConfig {\n return inject(NgpComboboxConfigToken, { optional: true }) ?? defaultComboboxConfig;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n inject,\n Injector,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { activeDescendantManager } from 'ng-primitives/a11y';\nimport { setupInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport type { NgpComboboxButton } from '../combobox-button/combobox-button';\nimport type { NgpComboboxDropdown } from '../combobox-dropdown/combobox-dropdown';\nimport type { NgpComboboxInput } from '../combobox-input/combobox-input';\nimport { NgpComboboxOption } from '../combobox-option/combobox-option';\nimport type { NgpComboboxPortal } from '../combobox-portal/combobox-portal';\nimport { injectComboboxConfig } from '../config/combobox-config';\nimport { comboboxState, provideComboboxState } from './combobox-state';\n\n/**\n * Ideally we would use a generic type here, unfortunately, unlike in React,\n * we cannot infer the type based on another input. For example, if multiple\n * is true, we cannot infer that the value is an array of T. Using a union\n * type is not ideal either because it requires the user to handle multiple cases.\n * Using a generic also isn't ideal because we need to use T as both an array and\n * a single value.\n *\n * Any seems to be used by Angular Material, ng-select, and other libraries\n * so we will use it here as well.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype T = any;\n\n@Directive({\n selector: '[ngpCombobox]',\n exportAs: 'ngpCombobox',\n providers: [provideComboboxState()],\n host: {\n '[attr.data-open]': 'state.open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state.multiple() ? \"\" : undefined',\n '[attr.data-invalid]': 'controlStatus()?.invalid ? \"\" : undefined',\n '[attr.data-valid]': 'controlStatus()?.valid ? \"\" : undefined',\n '[attr.data-touched]': 'controlStatus()?.touched ? \"\" : undefined',\n '[attr.data-pristine]': 'controlStatus()?.pristine ? \"\" : undefined',\n '[attr.data-dirty]': 'controlStatus()?.dirty ? \"\" : undefined',\n '[attr.data-pending]': 'controlStatus()?.pending ? \"\" : undefined',\n },\n})\nexport class NgpCombobox {\n /** Access the combobox configuration. */\n protected readonly config = injectComboboxConfig();\n\n /** @internal Access the combobox element. */\n readonly elementRef = injectElementRef();\n\n /** Access the injector. */\n protected readonly injector = inject(Injector);\n\n /** The value of the combobox. */\n readonly value = input<T>(undefined, {\n alias: 'ngpComboboxValue',\n });\n\n /** Event emitted when the value changes. */\n readonly valueChange = output<T>({\n alias: 'ngpComboboxValueChange',\n });\n\n /** Whether the combobox is multiple selection. */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxMultiple',\n transform: booleanAttribute,\n });\n\n /** Whether the combobox is disabled. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxDisabled',\n transform: booleanAttribute,\n });\n\n /** Whether the combobox allows deselection in single selection mode. */\n readonly allowDeselect = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxAllowDeselect',\n transform: booleanAttribute,\n });\n\n /** Emit when the dropdown open state changes. */\n readonly openChange = output<boolean>({\n alias: 'ngpComboboxOpenChange',\n });\n\n /** The comparator function used to compare options. */\n readonly compareWith = input<(a: T | undefined, b: T | undefined) => boolean>(Object.is, {\n alias: 'ngpComboboxCompareWith',\n });\n\n /** The position of the dropdown. */\n readonly placement = input<NgpComboboxPlacement>(this.config.placement, {\n alias: 'ngpComboboxDropdownPlacement',\n });\n\n /** The container for the dropdown. */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpComboboxDropdownContainer',\n });\n\n /**\n * Store the combobox input\n * @internal\n */\n readonly input = signal<NgpComboboxInput | undefined>(undefined);\n\n /**\n * Store the combobox button.\n * @internal\n */\n readonly button = signal<NgpComboboxButton | undefined>(undefined);\n\n /**\n * Store the combobox portal.\n * @internal\n */\n readonly portal = signal<NgpComboboxPortal | undefined>(undefined);\n\n /**\n * Store the combobox dropdown.\n * @internal\n */\n readonly dropdown = signal<NgpComboboxDropdown | undefined>(undefined);\n\n /**\n * Store the combobox options.\n * @internal\n */\n readonly options = signal<NgpComboboxOption[]>([]);\n\n /**\n * Access the overlay\n * @internal\n */\n readonly overlay = computed(() => this.portal()?.overlay());\n\n /**\n * The open state of the combobox.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * The active key descendant manager.\n * @internal\n */\n readonly activeDescendantManager = activeDescendantManager({\n // we must wrap the signal in a computed to ensure it is not used before it is defined\n disabled: computed(() => this.state.disabled()),\n items: this.options,\n });\n\n /** The control status */\n protected readonly controlStatus = computed(() => this.input()?.controlStatus());\n\n /** The state of the combobox. */\n protected readonly state = comboboxState<NgpCombobox>(this);\n\n constructor() {\n setupInteractions({\n focus: true,\n focusWithin: true,\n hover: true,\n press: true,\n disabled: this.state.disabled,\n });\n\n // any time the active descendant changes, ensure we scroll it into view\n // perform after next render to ensure the DOM is updated\n // e.g. the dropdown is open before the option is scrolled into view\n afterRenderEffect({\n write: () => {\n const isPositioned = this.portal()?.overlay()?.isPositioned() ?? false;\n const activeItem = this.activeDescendantManager.activeItem();\n\n if (!isPositioned || !activeItem) {\n return;\n }\n\n this.activeDescendantManager.activeItem()?.scrollIntoView?.();\n },\n });\n }\n\n /**\n * Open the dropdown.\n * @internal\n */\n async openDropdown(): Promise<void> {\n if (this.state.disabled() || this.open()) {\n return;\n }\n\n this.openChange.emit(true);\n await this.portal()?.show();\n\n // if there is a selected option(s), set the active descendant to the first selected option\n const selectedOption = this.options().find(option => this.isOptionSelected(option));\n\n // if there is no selected option, set the active descendant to the first option\n const targetOption = selectedOption ?? this.options()[0];\n\n // if there is no target option, do nothing\n if (!targetOption) {\n return;\n }\n\n // activate the selected option or the first option\n this.activeDescendantManager.activate(targetOption);\n }\n\n /**\n * Close the dropdown.\n * @internal\n */\n closeDropdown(): void {\n if (!this.open()) {\n return;\n }\n\n this.openChange.emit(false);\n this.portal()?.detach();\n\n // clear the active descendant\n this.activeDescendantManager.reset();\n }\n\n /**\n * Toggle the dropdown.\n * @internal\n */\n async toggleDropdown(): Promise<void> {\n if (this.open()) {\n this.closeDropdown();\n } else {\n await this.openDropdown();\n }\n }\n\n /**\n * Select an option.\n * @param option The option to select.\n * @internal\n */\n selectOption(option: NgpComboboxOption | undefined): void {\n if (this.state.disabled()) {\n return;\n }\n\n if (!option) {\n this.state.value.set(undefined);\n this.closeDropdown();\n return;\n }\n\n if (this.state.multiple()) {\n // if the option is already selected, do nothing\n if (this.isOptionSelected(option)) {\n return;\n }\n\n const value = [...(this.state.value() as T[]), option.value() as T];\n\n // add the option to the value\n this.state.value.set(value as T);\n this.valueChange.emit(value as T);\n } else {\n this.state.value.set(option.value() as T);\n this.valueChange.emit(option.value() as T);\n\n // close the dropdown on single selection\n this.closeDropdown();\n }\n }\n\n /**\n * Deselect an option.\n * @param option The option to deselect.\n * @internal\n */\n deselectOption(option: NgpComboboxOption): void {\n // if the combobox is disabled or the option is not selected, do nothing\n if (this.state.disabled() || !this.isOptionSelected(option)) {\n return;\n }\n\n // in single selection mode, only allow deselecting if allowDeselect is true\n if (!this.state.multiple() && !this.state.allowDeselect()) {\n return;\n }\n\n if (this.state.multiple()) {\n const values = (this.state.value() as T[]) ?? [];\n const newValue = values.filter(v => !this.state.compareWith()(v, option.value() as T));\n\n // remove the option from the value\n this.state.value.set(newValue as T);\n this.valueChange.emit(newValue as T);\n } else {\n // in single selection mode with allowDeselect enabled, set value to undefined\n this.state.value.set(undefined);\n this.valueChange.emit(undefined);\n }\n }\n\n /**\n * Toggle the selection of an option.\n * @param option The option to toggle.\n * @internal\n */\n toggleOption(option: NgpComboboxOption): void {\n if (this.state.disabled()) {\n return;\n }\n\n if (this.state.multiple()) {\n // In multiple selection mode, always allow toggling\n if (this.isOptionSelected(option)) {\n this.deselectOption(option);\n } else {\n this.selectOption(option);\n }\n } else {\n // In single selection mode, check if deselection is allowed\n if (this.isOptionSelected(option) && this.state.allowDeselect()) {\n // Deselect the option by setting value to undefined\n this.state.value.set(undefined);\n this.valueChange.emit(undefined);\n } else {\n // Select the option (works even if already selected to update the input)\n this.selectOption(option);\n }\n }\n }\n\n /**\n * Determine if an option is selected.\n * @param option The option to check.\n * @internal\n */\n isOptionSelected(option: NgpComboboxOption): boolean {\n if (this.state.disabled()) {\n return false;\n }\n\n const value = this.state.value();\n\n if (!value) {\n return false;\n }\n\n if (this.state.multiple()) {\n return value && (value as T[]).some(v => this.state.compareWith()(option.value(), v));\n }\n\n return this.state.compareWith()(option.value(), value);\n }\n\n /**\n * Activate the next option in the list if there is one.\n * If there is no option currently active, activate the selected option or the first option.\n * @internal\n */\n activateNextOption(): void {\n if (this.state.disabled()) {\n return;\n }\n\n const options = this.options();\n\n // if there are no options, do nothing\n if (options.length === 0) {\n return;\n }\n\n // if there is no active option, activate the first option\n if (!this.activeDescendantManager.activeItem()) {\n const selectedOption = options.find(option => this.isOptionSelected(option));\n\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption ?? options[0];\n\n this.activeDescendantManager.activate(targetOption);\n return;\n }\n\n // otherwise activate the next option\n this.activeDescendantManager.next();\n }\n\n /**\n * Activate the previous option in the list if there is one.\n * @internal\n */\n activatePreviousOption(): void {\n if (this.state.disabled()) {\n return;\n }\n const options = this.options();\n // if there are no options, do nothing\n if (options.length === 0) {\n return;\n }\n // if there is no active option, activate the last option\n if (!this.activeDescendantManager.activeItem()) {\n const selectedOption = options.find(option => this.isOptionSelected(option));\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption ?? options[options.length - 1];\n this.activeDescendantManager.activate(targetOption);\n return;\n }\n // otherwise activate the previous option\n this.activeDescendantManager.previous();\n }\n\n /**\n * Register the dropdown portal with the combobox.\n * @param portal The dropdown portal.\n * @internal\n */\n registerPortal(portal: NgpComboboxPortal): void {\n this.portal.set(portal);\n }\n\n /**\n * Register the combobox input with the combobox.\n * @param input The combobox input.\n * @internal\n */\n registerInput(input: NgpComboboxInput): void {\n this.input.set(input);\n }\n\n /**\n * Register the combobox button with the combobox.\n * @param button The combobox button.\n * @internal\n */\n registerButton(button: NgpComboboxButton): void {\n this.button.set(button);\n }\n\n /**\n * Register the dropdown with the combobox.\n * @param dropdown The dropdown to register.\n * @internal\n */\n registerDropdown(dropdown: NgpComboboxDropdown): void {\n this.dropdown.set(dropdown);\n }\n\n /**\n * Register an option with the combobox.\n * @param option The option to register.\n * @internal\n */\n registerOption(option: NgpComboboxOption): void {\n this.options.update(options => [...options, option]);\n }\n\n /**\n * Unregister an option from the combobox.\n * @param option The option to unregister.\n * @internal\n */\n unregisterOption(option: NgpComboboxOption): void {\n this.options.update(options => options.filter(o => o !== option));\n }\n}\n\nexport type NgpComboboxPlacement =\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":";;;;;;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B,WAAW,EAAA,UAAA,EAAA,CAAA;kBAhBvB,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,kBAAkB,EAAE,+BAA+B;AACnD,wBAAA,sBAAsB,EAAE,mCAAmC;AAC3D,wBAAA,sBAAsB,EAAE,mCAAmC;AAC3D,wBAAA,qBAAqB,EAAE,2CAA2C;AAClE,wBAAA,mBAAmB,EAAE,yCAAyC;AAC9D,wBAAA,qBAAqB,EAAE,2CAA2C;AAClE,wBAAA,sBAAsB,EAAE,4CAA4C;AACpE,wBAAA,mBAAmB,EAAE,yCAAyC;AAC9D,wBAAA,qBAAqB,EAAE,2CAA2C;AACnE,qBAAA;AACF,iBAAA;;;ACpDD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-dialog.mjs","sources":["../../../../packages/ng-primitives/dialog/src/config/dialog-config.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog-state.ts","../../../../packages/ng-primitives/dialog/src/dialog-description/dialog-description.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog-ref.ts","../../../../packages/ng-primitives/dialog/src/dialog-overlay/dialog-overlay.ts","../../../../packages/ng-primitives/dialog/src/dialog-title/dialog-title.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog.service.ts","../../../../packages/ng-primitives/dialog/src/dialog-trigger/dialog-trigger.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog.ts","../../../../packages/ng-primitives/dialog/src/ng-primitives-dialog.ts"],"sourcesContent":["import { ScrollStrategy } from '@angular/cdk/overlay';\nimport { InjectionToken, Injector, Provider, ViewContainerRef, inject } from '@angular/core';\n\n/** Valid ARIA roles for a dialog. */\nexport type NgpDialogRole = 'dialog' | 'alertdialog';\n\nexport interface NgpDialogConfig<T = any> {\n /** The view container to attach the dialog to. */\n viewContainerRef?: ViewContainerRef;\n\n /** The injector to use for the dialog. Defaults to the view container's injector.*/\n injector?: Injector;\n\n /** ID for the dialog. If omitted, a unique one will be generated. */\n id?: string;\n\n /** The role of the dialog. */\n role?: NgpDialogRole;\n\n /** Whether this is a modal dialog. Used to set the `aria-modal` attribute. */\n modal?: boolean;\n\n /** Scroll strategy to be used for the dialog. This determines how the dialog responds to scrolling underneath the panel element. */\n scrollStrategy?: ScrollStrategy;\n\n /**\n * Whether the dialog should close when the user navigates backwards or forwards through browser\n * history.\n */\n closeOnNavigation?: boolean;\n\n /** Whether the dialog should close when the user presses the escape key. */\n closeOnEscape?: boolean;\n\n /** Whether the dialog should close when the user click the overlay. */\n closeOnClick?: boolean;\n\n data?: T;\n}\n\nexport const defaultDialogConfig: NgpDialogConfig = {\n role: 'dialog',\n modal: true,\n closeOnNavigation: true,\n closeOnEscape: true,\n closeOnClick: true,\n};\n\nexport const NgpDialogConfigToken = new InjectionToken<NgpDialogConfig>('NgpDialogConfigToken');\n\n/**\n * Provide the default Dialog configuration\n * @param config The Dialog configuration\n * @returns The provider\n */\nexport function provideDialogConfig(config: Partial<NgpDialogConfig>): Provider[] {\n return [\n {\n provide: NgpDialogConfigToken,\n useValue: { ...defaultDialogConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Dialog configuration\n * @returns The global Dialog configuration\n */\nexport function injectDialogConfig(): NgpDialogConfig {\n return inject(NgpDialogConfigToken, { optional: true }) ?? defaultDialogConfig;\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpDialog } from './dialog';\n\n/**\n * The state token for the Dialog primitive.\n */\nexport const NgpDialogStateToken = createStateToken<NgpDialog<any, any>>('Dialog');\n\n/**\n * Provides the Dialog state.\n */\nexport const provideDialogState = createStateProvider(NgpDialogStateToken);\n\n/**\n * Injects the Dialog state.\n */\nexport const injectDialogState = createStateInjector<NgpDialog>(NgpDialogStateToken);\n\n/**\n * The Dialog state registration function.\n */\nexport const dialogState = createState(NgpDialogStateToken);\n","import { Directive, input, OnDestroy } from '@angular/core';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectDialogState } from '../dialog/dialog-state';\n\n@Directive({\n selector: '[ngpDialogDescription]',\n exportAs: 'ngpDialogDescription',\n host: {\n '[id]': 'id()',\n },\n})\nexport class NgpDialogDescription implements OnDestroy {\n /** Access the dialog */\n private readonly dialog = injectDialogState();\n\n /** The id of the descriptions. */\n readonly id = input<string>(uniqueId('ngp-dialog-description'));\n\n constructor() {\n onChange(this.id, (id, prevId) => {\n if (prevId) {\n this.dialog().removeDescribedBy(prevId);\n }\n\n if (id) {\n this.dialog().setDescribedBy(id);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.dialog().removeDescribedBy(this.id());\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { hasModifierKey } from '@angular/cdk/keycodes';\nimport { OverlayRef } from '@angular/cdk/overlay';\nimport { inject, Injector } from '@angular/core';\nimport { NgpExitAnimationManager } from 'ng-primitives/internal';\nimport { Observable, Subject, Subscription } from 'rxjs';\nimport { NgpDialogConfig } from '../config/dialog-config';\n\n/**\n * Reference to a dialog opened via the Dialog service.\n */\nexport class NgpDialogRef<T = unknown, R = unknown> {\n /** Whether the user is allowed to close the dialog. */\n disableClose: boolean | undefined;\n\n /** Whether the escape key is allowed to close the dialog. */\n closeOnEscape: boolean | undefined;\n\n /** Emits when the dialog has been closed. */\n readonly closed = new Subject<{ focusOrigin?: FocusOrigin; result?: R }>();\n\n /** Emits when on keyboard events within the dialog. */\n readonly keydownEvents: Observable<KeyboardEvent>;\n\n /** Emits on pointer events that happen outside of the dialog. */\n readonly outsidePointerEvents: Observable<MouseEvent>;\n\n /** Data passed from the dialog opener. */\n readonly data?: T;\n\n /** Unique ID for the dialog. */\n readonly id: string;\n\n /** Subscription to external detachments of the dialog. */\n private detachSubscription: Subscription;\n\n /** @internal Store the injector */\n injector: Injector | undefined;\n\n /** Whether the dialog is closing. */\n private closing = false;\n\n constructor(\n readonly overlayRef: OverlayRef,\n readonly config: NgpDialogConfig<T>,\n ) {\n this.data = config.data;\n this.keydownEvents = overlayRef.keydownEvents();\n this.outsidePointerEvents = overlayRef.outsidePointerEvents();\n this.id = config.id!; // By the time the dialog is created we are guaranteed to have an ID.\n this.closeOnEscape = config.closeOnEscape ?? true;\n\n this.keydownEvents.subscribe(event => {\n if (\n event.key === 'Escape' &&\n !this.disableClose &&\n this.closeOnEscape !== false &&\n !hasModifierKey(event)\n ) {\n event.preventDefault();\n this.close(undefined, 'keyboard');\n }\n });\n\n this.detachSubscription = overlayRef.detachments().subscribe(() => this.close());\n }\n\n /**\n * Close the dialog.\n * @param result Optional result to return to the dialog opener.\n * @param options Additional options to customize the closing behavior.\n */\n async close(result?: R, focusOrigin?: FocusOrigin): Promise<void> {\n // If the dialog is already closed, do nothing.\n if (this.closing) {\n return;\n }\n\n this.closing = true;\n\n const exitAnimationManager = this.injector?.get(NgpExitAnimationManager, undefined, {\n optional: true,\n });\n if (exitAnimationManager) {\n await exitAnimationManager.exit();\n }\n\n this.overlayRef.dispose();\n this.detachSubscription.unsubscribe();\n this.closed.next({ focusOrigin, result });\n this.closed.complete();\n }\n\n /** Updates the position of the dialog based on the current position strategy. */\n updatePosition(): this {\n this.overlayRef.updatePosition();\n return this;\n }\n}\n\nexport function injectDialogRef<T = unknown, R = unknown>(): NgpDialogRef<T, R> {\n return inject<NgpDialogRef<T, R>>(NgpDialogRef);\n}\n","import { booleanAttribute, Directive, HostListener, input } from '@angular/core';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { injectDialogRef } from '../dialog/dialog-ref';\n\n@Directive({\n selector: '[ngpDialogOverlay]',\n exportAs: 'ngpDialogOverlay',\n hostDirectives: [NgpExitAnimation],\n})\nexport class NgpDialogOverlay {\n /** Access the global configuration */\n private readonly config = injectDialogConfig();\n\n /** Access the dialog ref. */\n private readonly dialogRef = injectDialogRef();\n\n /**\n * Whether the dialog should close on backdrop click.\n * @default `true`\n */\n readonly closeOnClick = input(this.config.closeOnClick, {\n alias: 'ngpDialogOverlayCloseOnClick',\n transform: booleanAttribute,\n });\n\n @HostListener('click')\n protected close(): void {\n if (this.closeOnClick()) {\n this.dialogRef.close(undefined, 'mouse');\n }\n }\n}\n","import { Directive, input, OnDestroy } from '@angular/core';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectDialogState } from '../dialog/dialog-state';\n\n@Directive({\n selector: '[ngpDialogTitle]',\n exportAs: 'ngpDialogTitle',\n host: {\n '[id]': 'id()',\n },\n})\nexport class NgpDialogTitle implements OnDestroy {\n /** Access the dialog. */\n private readonly dialog = injectDialogState();\n\n /** The id of the title. */\n readonly id = input<string>(uniqueId('ngp-dialog-title'));\n\n constructor() {\n onChange(this.id, (id, prevId) => {\n if (prevId) {\n this.dialog().removeLabelledBy(prevId);\n }\n\n if (id) {\n this.dialog().setLabelledBy(id);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.dialog().removeLabelledBy(this.id());\n }\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { Overlay, OverlayConfig, OverlayContainer, ScrollStrategy } from '@angular/cdk/overlay';\nimport { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n Injectable,\n Injector,\n OnDestroy,\n StaticProvider,\n TemplateRef,\n Type,\n ViewContainerRef,\n inject,\n isDevMode,\n} from '@angular/core';\nimport { NgpExitAnimationManager } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { Observable, Subject, defer } from 'rxjs';\nimport { startWith } from 'rxjs/operators';\nimport { NgpDialogConfig, injectDialogConfig } from '../config/dialog-config';\nimport { NgpDialogRef } from './dialog-ref';\n\n/**\n * This is based on the Angular CDK Dialog service.\n * https://github.com/angular/components/blob/main/src/cdk/dialog/dialog.ts\n */\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgpDialogManager implements OnDestroy {\n private readonly applicationRef = inject(ApplicationRef);\n private readonly document = inject<Document>(DOCUMENT);\n private readonly overlay = inject(Overlay);\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly defaultOptions = injectDialogConfig();\n private readonly parentDialogManager = inject(NgpDialogManager, {\n optional: true,\n skipSelf: true,\n });\n private readonly overlayContainer = inject(OverlayContainer);\n private readonly scrollStrategy: ScrollStrategy =\n this.defaultOptions.scrollStrategy ?? this.overlay.scrollStrategies.block();\n\n private openDialogsAtThisLevel: NgpDialogRef[] = [];\n private readonly afterAllClosedAtThisLevel = new Subject<void>();\n private readonly afterOpenedAtThisLevel = new Subject<NgpDialogRef>();\n private ariaHiddenElements = new Map<Element, string | null>();\n\n /** Keeps track of the currently-open dialogs. */\n get openDialogs(): readonly NgpDialogRef[] {\n return this.parentDialogManager\n ? this.parentDialogManager.openDialogs\n : this.openDialogsAtThisLevel;\n }\n\n /** Stream that emits when a dialog has been opened. */\n get afterOpened(): Subject<NgpDialogRef> {\n return this.parentDialogManager\n ? this.parentDialogManager.afterOpened\n : this.afterOpenedAtThisLevel;\n }\n\n /**\n * Stream that emits when all open dialog have finished closing.\n * Will emit on subscribe if there are no open dialogs to begin with.\n */\n readonly afterAllClosed: Observable<void> = defer(() =>\n this.openDialogs.length\n ? this.getAfterAllClosed()\n : this.getAfterAllClosed().pipe(startWith(undefined)),\n );\n\n /**\n * Opens a modal dialog containing the given template.\n */\n open<T, R>(\n templateRefOrComponentType: TemplateRef<NgpDialogContext<T, R>> | Type<unknown>,\n config?: NgpDialogConfig<T>,\n ): NgpDialogRef<T, R> {\n // store the current active element so we can focus it after the dialog is closed\n const activeElement = this.document.activeElement;\n\n // this is not ideal, but there is a case where a dialog trigger is within an overlay (e.g. menu),\n // which may be removed before the dialog is closed. This is not desired, so we need to access a view container ref\n // that is not within the overlay. To solve this we use the view container ref of the root component.\n // Could this have any unintended side effects? For example, the dialog would not be closed during route changes?\n const viewContainerRef =\n this.applicationRef.components[0]?.injector.get(ViewContainerRef) ??\n config?.viewContainerRef ??\n config?.injector?.get(ViewContainerRef);\n\n const defaults = this.defaultOptions;\n config = { ...defaults, viewContainerRef, ...config };\n config.id = config.id ?? uniqueId('ngp-dialog');\n\n if (config.id && this.getDialogById(config.id) && isDevMode()) {\n throw Error(`Dialog with id \"${config.id}\" exists already. The dialog id must be unique.`);\n }\n\n const overlayConfig = this.getOverlayConfig(config);\n const overlayRef = this.overlay.create(overlayConfig);\n const dialogRef = new NgpDialogRef<T, R>(overlayRef, config);\n const injector = this.createInjector(config, dialogRef, undefined);\n\n // store the injector in the dialog ref - this is so we can access the exit animation manager\n dialogRef.injector = injector;\n\n const context: NgpDialogContext<T, R> = {\n $implicit: dialogRef,\n close: dialogRef.close.bind(dialogRef),\n };\n\n if (templateRefOrComponentType instanceof TemplateRef) {\n overlayRef.attach(\n new TemplatePortal(templateRefOrComponentType, config.viewContainerRef!, context, injector),\n );\n } else {\n overlayRef.attach(\n new ComponentPortal(templateRefOrComponentType, config.viewContainerRef!, injector),\n );\n }\n\n // If this is the first dialog that we're opening, hide all the non-overlay content.\n if (!this.openDialogs.length) {\n this.hideNonDialogContentFromAssistiveTechnology();\n }\n\n (this.openDialogs as NgpDialogRef[]).push(dialogRef as NgpDialogRef<any, any>);\n this.afterOpened.next(dialogRef as NgpDialogRef<any, any>);\n\n dialogRef.closed.subscribe(closeResult => {\n this.removeOpenDialog(dialogRef as NgpDialogRef<any, any>, true);\n // Focus the trigger element after the dialog closes.\n if (activeElement instanceof HTMLElement && this.document.body.contains(activeElement)) {\n // Its not great that we are relying on an internal API here, but we need to in order to\n // try and best determine the focus origin when it is programmatically closed by the user.\n this.focusMonitor.focusVia(\n activeElement,\n closeResult.focusOrigin ?? (this.focusMonitor as any)._lastFocusOrigin,\n );\n }\n });\n\n return dialogRef;\n }\n\n /**\n * Closes all of the currently-open dialogs.\n */\n closeAll(): void {\n reverseForEach(this.openDialogs, dialog => dialog.close());\n }\n\n /**\n * Finds an open dialog by its id.\n * @param id ID to use when looking up the dialog.\n */\n getDialogById(id: string): NgpDialogRef | undefined {\n return this.openDialogs.find(dialog => dialog.id === id);\n }\n\n ngOnDestroy(): void {\n // Make one pass over all the dialogs that need to be untracked, but should not be closed. We\n // want to stop tracking the open dialog even if it hasn't been closed, because the tracking\n // determines when `aria-hidden` is removed from elements outside the dialog.\n reverseForEach(this.openDialogsAtThisLevel, dialog => {\n // Check for `false` specifically since we want `undefined` to be interpreted as `true`.\n this.removeOpenDialog(dialog, false);\n });\n\n // Make a second pass and close the remaining dialogs. We do this second pass in order to\n // correctly dispatch the `afterAllClosed` event in case we have a mixed array of dialogs\n // that should be closed and dialogs that should not.\n reverseForEach(this.openDialogsAtThisLevel, dialog => dialog.close());\n\n this.afterAllClosedAtThisLevel.complete();\n this.afterOpenedAtThisLevel.complete();\n this.openDialogsAtThisLevel = [];\n }\n\n /**\n * Creates an overlay config from a dialog config.\n */\n private getOverlayConfig(config: NgpDialogConfig): OverlayConfig {\n const state = new OverlayConfig({\n positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically(),\n scrollStrategy: config.scrollStrategy || this.scrollStrategy,\n hasBackdrop: false,\n disposeOnNavigation: config.closeOnNavigation,\n });\n\n return state;\n }\n\n /**\n * Creates a custom injector to be used inside the dialog. This allows a component loaded inside\n * of a dialog to close itself and, optionally, to return a value.\n */\n private createInjector<T, R>(\n config: NgpDialogConfig<T>,\n dialogRef: NgpDialogRef<T, R>,\n fallbackInjector: Injector | undefined,\n ): Injector {\n const userInjector = config.injector || config.viewContainerRef?.injector;\n const providers: StaticProvider[] = [\n { provide: NgpDialogRef, useValue: dialogRef },\n { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager },\n ];\n\n return Injector.create({ parent: userInjector || fallbackInjector, providers });\n }\n\n /**\n * Removes a dialog from the array of open dialogs.\n */\n private removeOpenDialog(dialogRef: NgpDialogRef, emitEvent: boolean) {\n const index = this.openDialogs.indexOf(dialogRef);\n\n if (index > -1) {\n (this.openDialogs as NgpDialogRef[]).splice(index, 1);\n\n // If all the dialogs were closed, remove/restore the `aria-hidden`\n // to a the siblings and emit to the `afterAllClosed` stream.\n if (!this.openDialogs.length) {\n this.ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue) {\n element.setAttribute('aria-hidden', previousValue);\n } else {\n element.removeAttribute('aria-hidden');\n }\n });\n\n this.ariaHiddenElements.clear();\n\n if (emitEvent) {\n this.getAfterAllClosed().next();\n }\n }\n }\n }\n\n /** Hides all of the content that isn't an overlay from assistive technology. */\n private hideNonDialogContentFromAssistiveTechnology() {\n const overlayContainer = this.overlayContainer.getContainerElement();\n\n // Ensure that the overlay container is attached to the DOM.\n if (overlayContainer.parentElement) {\n const siblings = overlayContainer.parentElement.children;\n\n for (let i = siblings.length - 1; i > -1; i--) {\n const sibling = siblings[i];\n\n if (\n sibling !== overlayContainer &&\n sibling.nodeName !== 'SCRIPT' &&\n sibling.nodeName !== 'STYLE' &&\n !sibling.hasAttribute('aria-live')\n ) {\n this.ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));\n sibling.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }\n\n private getAfterAllClosed(): Subject<void> {\n const parent = this.parentDialogManager;\n return parent ? parent.getAfterAllClosed() : this.afterAllClosedAtThisLevel;\n }\n}\n\n/**\n * Executes a callback against all elements in an array while iterating in reverse.\n * Useful if the array is being modified as it is being iterated.\n */\nfunction reverseForEach<T>(items: T[] | readonly T[], callback: (current: T) => void) {\n let i = items.length;\n\n while (i--) {\n callback(items[i]);\n }\n}\n\nexport interface NgpDialogContext<T = unknown, R = unknown> {\n $implicit: NgpDialogRef<T, R>;\n close: (result?: R) => void;\n}\n\nexport function injectDialogManager(): NgpDialogManager {\n return inject(NgpDialogManager);\n}\n","import { Directive, HostListener, inject, input, output, TemplateRef } from '@angular/core';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { NgpDialogRef } from '../dialog/dialog-ref';\nimport { NgpDialogContext, NgpDialogManager } from '../dialog/dialog.service';\n\n@Directive({\n selector: '[ngpDialogTrigger]',\n exportAs: 'ngpDialogTrigger',\n})\nexport class NgpDialogTrigger<T = unknown> {\n /** Access the global configuration */\n private readonly config = injectDialogConfig();\n\n /** Access the dialog manager. */\n private readonly dialogManager = inject(NgpDialogManager);\n\n /** The template to launch. */\n readonly template = input.required<TemplateRef<NgpDialogContext>>({\n alias: 'ngpDialogTrigger',\n });\n\n /** Emits whenever the dialog is closed with the given result. */\n readonly closed = output<T>({ alias: 'ngpDialogTriggerClosed' });\n\n /**\n * Whether the dialog should close on escape.\n * @default `true`\n */\n readonly closeOnEscape = input(this.config.closeOnEscape, {\n alias: 'ngpDialogTriggerCloseOnEscape',\n });\n\n /**\n * Store the dialog ref.\n * @internal\n */\n private dialogRef: NgpDialogRef | null = null;\n\n @HostListener('click')\n protected launch(): void {\n this.dialogRef = this.dialogManager.open(this.template(), {\n closeOnEscape: this.closeOnEscape(),\n });\n this.dialogRef.closed.subscribe(({ result }) => {\n this.closed.emit(result as T);\n return (this.dialogRef = null);\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, input, OnDestroy, signal } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { injectDialogRef } from './dialog-ref';\nimport { dialogState, provideDialogState } from './dialog-state';\n\n@Directive({\n selector: '[ngpDialog]',\n exportAs: 'ngpDialog',\n providers: [provideDialogState()],\n hostDirectives: [NgpFocusTrap, NgpExitAnimation],\n host: {\n tabindex: '-1',\n '[id]': 'state.id()',\n '[attr.role]': 'state.role()',\n '[attr.aria-modal]': 'state.modal()',\n '[attr.aria-labelledby]': 'labelledBy().join(\" \")',\n '[attr.aria-describedby]': 'describedBy().join(\" \")',\n },\n})\nexport class NgpDialog<T = unknown, R = unknown> implements OnDestroy {\n private readonly config = injectDialogConfig();\n\n /** Access the dialog ref */\n private readonly dialogRef = injectDialogRef<T, R>();\n\n /** The id of the dialog */\n readonly id = input<string>(uniqueId('ngp-dialog'));\n\n /** The dialog role. */\n readonly role = input(this.config.role, {\n alias: 'ngpDialogRole',\n });\n\n /** Whether the dialog is a modal. */\n readonly modal = input<boolean, BooleanInput>(this.config.modal ?? false, {\n alias: 'ngpDialogModal',\n transform: booleanAttribute,\n });\n\n /** The labelledby ids */\n protected readonly labelledBy = signal<string[]>([]);\n\n /** The describedby ids */\n protected readonly describedBy = signal<string[]>([]);\n\n /** The dialog state */\n protected readonly state = dialogState<NgpDialog<T, R>>(this);\n\n ngOnDestroy(): void {\n this.close();\n }\n\n /** Close the dialog. */\n close(result?: R): void {\n this.dialogRef.close(result);\n }\n\n /** Stop click events from propagating to the overlay */\n @HostListener('click', ['$event'])\n protected onClick(event: Event): void {\n event.stopPropagation();\n }\n\n /** @internal register a labelledby id */\n setLabelledBy(id: string): void {\n this.labelledBy.update(ids => [...ids, id]);\n }\n\n /** @internal register a describedby id */\n setDescribedBy(id: string): void {\n this.describedBy.update(ids => [...ids, id]);\n }\n\n /** @internal remove a labelledby id */\n removeLabelledBy(id: string): void {\n this.labelledBy.update(ids => ids.filter(i => i !== id));\n }\n\n /** @internal remove a describedby id */\n removeDescribedBy(id: string): void {\n this.describedBy.update(ids => ids.filter(i => i !== id));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;AAwCO,MAAM,mBAAmB,GAAoB;AAClD,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,YAAY,EAAE,IAAI;CACnB;AAEM,MA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EAAA,EAAA,EAAA,SAAA,EAAAC,EAAA,CAAA,gBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAWtB,SAAS,EAAA,UAAA,EAAA,CAAA;kBAdrB,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,cAAc,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;AAChD,oBAAA,IAAI,EAAE;AACJ,wBAAA,QAAQ,EAAE,IAAI;AACd,wBAAA,MAAM,EAAE,YAAY;AACpB,wBAAA,aAAa,EAAE,cAAc;AAC7B,wBAAA,mBAAmB,EAAE,eAAe;AACpC,wBAAA,wBAAwB,EAAE,wBAAwB;AAClD,wBAAA,yBAAyB,EAAE,yBAAyB;AACrD,qBAAA;AACF,iBAAA;8BAyCW,OAAO,EAAA,CAAA;sBADhB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AC9DnC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-dialog.mjs","sources":["../../../../packages/ng-primitives/dialog/src/config/dialog-config.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog-state.ts","../../../../packages/ng-primitives/dialog/src/dialog-description/dialog-description.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog-ref.ts","../../../../packages/ng-primitives/dialog/src/dialog-overlay/dialog-overlay.ts","../../../../packages/ng-primitives/dialog/src/dialog-title/dialog-title.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog.service.ts","../../../../packages/ng-primitives/dialog/src/dialog-trigger/dialog-trigger.ts","../../../../packages/ng-primitives/dialog/src/dialog/dialog.ts","../../../../packages/ng-primitives/dialog/src/ng-primitives-dialog.ts"],"sourcesContent":["import { ScrollStrategy } from '@angular/cdk/overlay';\nimport { InjectionToken, Injector, Provider, ViewContainerRef, inject } from '@angular/core';\n\n/** Valid ARIA roles for a dialog. */\nexport type NgpDialogRole = 'dialog' | 'alertdialog';\n\nexport interface NgpDialogConfig<T = any> {\n /** The view container to attach the dialog to. */\n viewContainerRef?: ViewContainerRef;\n\n /** The injector to use for the dialog. Defaults to the view container's injector.*/\n injector?: Injector;\n\n /** ID for the dialog. If omitted, a unique one will be generated. */\n id?: string;\n\n /** The role of the dialog. */\n role?: NgpDialogRole;\n\n /** Whether this is a modal dialog. Used to set the `aria-modal` attribute. */\n modal?: boolean;\n\n /** Scroll strategy to be used for the dialog. This determines how the dialog responds to scrolling underneath the panel element. */\n scrollStrategy?: ScrollStrategy;\n\n /**\n * Whether the dialog should close when the user navigates backwards or forwards through browser\n * history.\n */\n closeOnNavigation?: boolean;\n\n /** Whether the dialog should close when the user presses the escape key. */\n closeOnEscape?: boolean;\n\n /** Whether the dialog should close when the user click the overlay. */\n closeOnClick?: boolean;\n\n data?: T;\n}\n\nexport const defaultDialogConfig: NgpDialogConfig = {\n role: 'dialog',\n modal: true,\n closeOnNavigation: true,\n closeOnEscape: true,\n closeOnClick: true,\n};\n\nexport const NgpDialogConfigToken = new InjectionToken<NgpDialogConfig>('NgpDialogConfigToken');\n\n/**\n * Provide the default Dialog configuration\n * @param config The Dialog configuration\n * @returns The provider\n */\nexport function provideDialogConfig(config: Partial<NgpDialogConfig>): Provider[] {\n return [\n {\n provide: NgpDialogConfigToken,\n useValue: { ...defaultDialogConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Dialog configuration\n * @returns The global Dialog configuration\n */\nexport function injectDialogConfig(): NgpDialogConfig {\n return inject(NgpDialogConfigToken, { optional: true }) ?? defaultDialogConfig;\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpDialog } from './dialog';\n\n/**\n * The state token for the Dialog primitive.\n */\nexport const NgpDialogStateToken = createStateToken<NgpDialog<any, any>>('Dialog');\n\n/**\n * Provides the Dialog state.\n */\nexport const provideDialogState = createStateProvider(NgpDialogStateToken);\n\n/**\n * Injects the Dialog state.\n */\nexport const injectDialogState = createStateInjector<NgpDialog>(NgpDialogStateToken);\n\n/**\n * The Dialog state registration function.\n */\nexport const dialogState = createState(NgpDialogStateToken);\n","import { Directive, input, OnDestroy } from '@angular/core';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectDialogState } from '../dialog/dialog-state';\n\n@Directive({\n selector: '[ngpDialogDescription]',\n exportAs: 'ngpDialogDescription',\n host: {\n '[id]': 'id()',\n },\n})\nexport class NgpDialogDescription implements OnDestroy {\n /** Access the dialog */\n private readonly dialog = injectDialogState();\n\n /** The id of the descriptions. */\n readonly id = input<string>(uniqueId('ngp-dialog-description'));\n\n constructor() {\n onChange(this.id, (id, prevId) => {\n if (prevId) {\n this.dialog().removeDescribedBy(prevId);\n }\n\n if (id) {\n this.dialog().setDescribedBy(id);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.dialog().removeDescribedBy(this.id());\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { hasModifierKey } from '@angular/cdk/keycodes';\nimport { OverlayRef } from '@angular/cdk/overlay';\nimport { inject, Injector } from '@angular/core';\nimport { NgpExitAnimationManager } from 'ng-primitives/internal';\nimport { Observable, Subject, Subscription } from 'rxjs';\nimport { NgpDialogConfig } from '../config/dialog-config';\n\n/**\n * Reference to a dialog opened via the Dialog service.\n */\nexport class NgpDialogRef<T = unknown, R = unknown> {\n /** Whether the user is allowed to close the dialog. */\n disableClose: boolean | undefined;\n\n /** Whether the escape key is allowed to close the dialog. */\n closeOnEscape: boolean | undefined;\n\n /** Emits when the dialog has been closed. */\n readonly closed = new Subject<{ focusOrigin?: FocusOrigin; result?: R }>();\n\n /** Emits when on keyboard events within the dialog. */\n readonly keydownEvents: Observable<KeyboardEvent>;\n\n /** Emits on pointer events that happen outside of the dialog. */\n readonly outsidePointerEvents: Observable<MouseEvent>;\n\n /** Data passed from the dialog opener. */\n readonly data?: T;\n\n /** Unique ID for the dialog. */\n readonly id: string;\n\n /** Subscription to external detachments of the dialog. */\n private detachSubscription: Subscription;\n\n /** @internal Store the injector */\n injector: Injector | undefined;\n\n /** Whether the dialog is closing. */\n private closing = false;\n\n constructor(\n readonly overlayRef: OverlayRef,\n readonly config: NgpDialogConfig<T>,\n ) {\n this.data = config.data;\n this.keydownEvents = overlayRef.keydownEvents();\n this.outsidePointerEvents = overlayRef.outsidePointerEvents();\n this.id = config.id!; // By the time the dialog is created we are guaranteed to have an ID.\n this.closeOnEscape = config.closeOnEscape ?? true;\n\n this.keydownEvents.subscribe(event => {\n if (\n event.key === 'Escape' &&\n !this.disableClose &&\n this.closeOnEscape !== false &&\n !hasModifierKey(event)\n ) {\n event.preventDefault();\n this.close(undefined, 'keyboard');\n }\n });\n\n this.detachSubscription = overlayRef.detachments().subscribe(() => this.close());\n }\n\n /**\n * Close the dialog.\n * @param result Optional result to return to the dialog opener.\n * @param options Additional options to customize the closing behavior.\n */\n async close(result?: R, focusOrigin?: FocusOrigin): Promise<void> {\n // If the dialog is already closed, do nothing.\n if (this.closing) {\n return;\n }\n\n this.closing = true;\n\n const exitAnimationManager = this.injector?.get(NgpExitAnimationManager, undefined, {\n optional: true,\n });\n if (exitAnimationManager) {\n await exitAnimationManager.exit();\n }\n\n this.overlayRef.dispose();\n this.detachSubscription.unsubscribe();\n this.closed.next({ focusOrigin, result });\n this.closed.complete();\n }\n\n /** Updates the position of the dialog based on the current position strategy. */\n updatePosition(): this {\n this.overlayRef.updatePosition();\n return this;\n }\n}\n\nexport function injectDialogRef<T = unknown, R = unknown>(): NgpDialogRef<T, R> {\n return inject<NgpDialogRef<T, R>>(NgpDialogRef);\n}\n","import { booleanAttribute, Directive, HostListener, input } from '@angular/core';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { injectDialogRef } from '../dialog/dialog-ref';\n\n@Directive({\n selector: '[ngpDialogOverlay]',\n exportAs: 'ngpDialogOverlay',\n hostDirectives: [NgpExitAnimation],\n})\nexport class NgpDialogOverlay {\n /** Access the global configuration */\n private readonly config = injectDialogConfig();\n\n /** Access the dialog ref. */\n private readonly dialogRef = injectDialogRef();\n\n /**\n * Whether the dialog should close on backdrop click.\n * @default `true`\n */\n readonly closeOnClick = input(this.config.closeOnClick, {\n alias: 'ngpDialogOverlayCloseOnClick',\n transform: booleanAttribute,\n });\n\n @HostListener('click')\n protected close(): void {\n if (this.closeOnClick() && !this.dialogRef.disableClose) {\n this.dialogRef.close(undefined, 'mouse');\n }\n }\n}\n","import { Directive, input, OnDestroy } from '@angular/core';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectDialogState } from '../dialog/dialog-state';\n\n@Directive({\n selector: '[ngpDialogTitle]',\n exportAs: 'ngpDialogTitle',\n host: {\n '[id]': 'id()',\n },\n})\nexport class NgpDialogTitle implements OnDestroy {\n /** Access the dialog. */\n private readonly dialog = injectDialogState();\n\n /** The id of the title. */\n readonly id = input<string>(uniqueId('ngp-dialog-title'));\n\n constructor() {\n onChange(this.id, (id, prevId) => {\n if (prevId) {\n this.dialog().removeLabelledBy(prevId);\n }\n\n if (id) {\n this.dialog().setLabelledBy(id);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.dialog().removeLabelledBy(this.id());\n }\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { Overlay, OverlayConfig, OverlayContainer, ScrollStrategy } from '@angular/cdk/overlay';\nimport { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n Injectable,\n Injector,\n OnDestroy,\n StaticProvider,\n TemplateRef,\n Type,\n ViewContainerRef,\n inject,\n isDevMode,\n} from '@angular/core';\nimport { NgpExitAnimationManager } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { Observable, Subject, defer } from 'rxjs';\nimport { startWith } from 'rxjs/operators';\nimport { NgpDialogConfig, injectDialogConfig } from '../config/dialog-config';\nimport { NgpDialogRef } from './dialog-ref';\n\n/**\n * This is based on the Angular CDK Dialog service.\n * https://github.com/angular/components/blob/main/src/cdk/dialog/dialog.ts\n */\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgpDialogManager implements OnDestroy {\n private readonly applicationRef = inject(ApplicationRef);\n private readonly document = inject<Document>(DOCUMENT);\n private readonly overlay = inject(Overlay);\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly defaultOptions = injectDialogConfig();\n private readonly parentDialogManager = inject(NgpDialogManager, {\n optional: true,\n skipSelf: true,\n });\n private readonly overlayContainer = inject(OverlayContainer);\n private readonly scrollStrategy: ScrollStrategy =\n this.defaultOptions.scrollStrategy ?? this.overlay.scrollStrategies.block();\n\n private openDialogsAtThisLevel: NgpDialogRef[] = [];\n private readonly afterAllClosedAtThisLevel = new Subject<void>();\n private readonly afterOpenedAtThisLevel = new Subject<NgpDialogRef>();\n private ariaHiddenElements = new Map<Element, string | null>();\n\n /** Keeps track of the currently-open dialogs. */\n get openDialogs(): readonly NgpDialogRef[] {\n return this.parentDialogManager\n ? this.parentDialogManager.openDialogs\n : this.openDialogsAtThisLevel;\n }\n\n /** Stream that emits when a dialog has been opened. */\n get afterOpened(): Subject<NgpDialogRef> {\n return this.parentDialogManager\n ? this.parentDialogManager.afterOpened\n : this.afterOpenedAtThisLevel;\n }\n\n /**\n * Stream that emits when all open dialog have finished closing.\n * Will emit on subscribe if there are no open dialogs to begin with.\n */\n readonly afterAllClosed: Observable<void> = defer(() =>\n this.openDialogs.length\n ? this.getAfterAllClosed()\n : this.getAfterAllClosed().pipe(startWith(undefined)),\n );\n\n /**\n * Opens a modal dialog containing the given template.\n */\n open<T, R>(\n templateRefOrComponentType: TemplateRef<NgpDialogContext<T, R>> | Type<unknown>,\n config?: NgpDialogConfig<T>,\n ): NgpDialogRef<T, R> {\n // store the current active element so we can focus it after the dialog is closed\n const activeElement = this.document.activeElement;\n\n // this is not ideal, but there is a case where a dialog trigger is within an overlay (e.g. menu),\n // which may be removed before the dialog is closed. This is not desired, so we need to access a view container ref\n // that is not within the overlay. To solve this we use the view container ref of the root component.\n // Could this have any unintended side effects? For example, the dialog would not be closed during route changes?\n const viewContainerRef =\n this.applicationRef.components[0]?.injector.get(ViewContainerRef) ??\n config?.viewContainerRef ??\n config?.injector?.get(ViewContainerRef);\n\n const defaults = this.defaultOptions;\n config = { ...defaults, viewContainerRef, ...config };\n config.id = config.id ?? uniqueId('ngp-dialog');\n\n if (config.id && this.getDialogById(config.id) && isDevMode()) {\n throw Error(`Dialog with id \"${config.id}\" exists already. The dialog id must be unique.`);\n }\n\n const overlayConfig = this.getOverlayConfig(config);\n const overlayRef = this.overlay.create(overlayConfig);\n const dialogRef = new NgpDialogRef<T, R>(overlayRef, config);\n const injector = this.createInjector(config, dialogRef, undefined);\n\n // store the injector in the dialog ref - this is so we can access the exit animation manager\n dialogRef.injector = injector;\n\n const context: NgpDialogContext<T, R> = {\n $implicit: dialogRef,\n close: dialogRef.close.bind(dialogRef),\n };\n\n if (templateRefOrComponentType instanceof TemplateRef) {\n overlayRef.attach(\n new TemplatePortal(templateRefOrComponentType, config.viewContainerRef!, context, injector),\n );\n } else {\n overlayRef.attach(\n new ComponentPortal(templateRefOrComponentType, config.viewContainerRef!, injector),\n );\n }\n\n // If this is the first dialog that we're opening, hide all the non-overlay content.\n if (!this.openDialogs.length) {\n this.hideNonDialogContentFromAssistiveTechnology();\n }\n\n (this.openDialogs as NgpDialogRef[]).push(dialogRef as NgpDialogRef<any, any>);\n this.afterOpened.next(dialogRef as NgpDialogRef<any, any>);\n\n dialogRef.closed.subscribe(closeResult => {\n this.removeOpenDialog(dialogRef as NgpDialogRef<any, any>, true);\n // Focus the trigger element after the dialog closes.\n if (activeElement instanceof HTMLElement && this.document.body.contains(activeElement)) {\n // Its not great that we are relying on an internal API here, but we need to in order to\n // try and best determine the focus origin when it is programmatically closed by the user.\n this.focusMonitor.focusVia(\n activeElement,\n closeResult.focusOrigin ?? (this.focusMonitor as any)._lastFocusOrigin,\n );\n }\n });\n\n return dialogRef;\n }\n\n /**\n * Closes all of the currently-open dialogs.\n */\n closeAll(): void {\n reverseForEach(this.openDialogs, dialog => dialog.close());\n }\n\n /**\n * Finds an open dialog by its id.\n * @param id ID to use when looking up the dialog.\n */\n getDialogById(id: string): NgpDialogRef | undefined {\n return this.openDialogs.find(dialog => dialog.id === id);\n }\n\n ngOnDestroy(): void {\n // Make one pass over all the dialogs that need to be untracked, but should not be closed. We\n // want to stop tracking the open dialog even if it hasn't been closed, because the tracking\n // determines when `aria-hidden` is removed from elements outside the dialog.\n reverseForEach(this.openDialogsAtThisLevel, dialog => {\n // Check for `false` specifically since we want `undefined` to be interpreted as `true`.\n this.removeOpenDialog(dialog, false);\n });\n\n // Make a second pass and close the remaining dialogs. We do this second pass in order to\n // correctly dispatch the `afterAllClosed` event in case we have a mixed array of dialogs\n // that should be closed and dialogs that should not.\n reverseForEach(this.openDialogsAtThisLevel, dialog => dialog.close());\n\n this.afterAllClosedAtThisLevel.complete();\n this.afterOpenedAtThisLevel.complete();\n this.openDialogsAtThisLevel = [];\n }\n\n /**\n * Creates an overlay config from a dialog config.\n */\n private getOverlayConfig(config: NgpDialogConfig): OverlayConfig {\n const state = new OverlayConfig({\n positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically(),\n scrollStrategy: config.scrollStrategy || this.scrollStrategy,\n hasBackdrop: false,\n disposeOnNavigation: config.closeOnNavigation,\n });\n\n return state;\n }\n\n /**\n * Creates a custom injector to be used inside the dialog. This allows a component loaded inside\n * of a dialog to close itself and, optionally, to return a value.\n */\n private createInjector<T, R>(\n config: NgpDialogConfig<T>,\n dialogRef: NgpDialogRef<T, R>,\n fallbackInjector: Injector | undefined,\n ): Injector {\n const userInjector = config.injector || config.viewContainerRef?.injector;\n const providers: StaticProvider[] = [\n { provide: NgpDialogRef, useValue: dialogRef },\n { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager },\n ];\n\n return Injector.create({ parent: userInjector || fallbackInjector, providers });\n }\n\n /**\n * Removes a dialog from the array of open dialogs.\n */\n private removeOpenDialog(dialogRef: NgpDialogRef, emitEvent: boolean) {\n const index = this.openDialogs.indexOf(dialogRef);\n\n if (index > -1) {\n (this.openDialogs as NgpDialogRef[]).splice(index, 1);\n\n // If all the dialogs were closed, remove/restore the `aria-hidden`\n // to a the siblings and emit to the `afterAllClosed` stream.\n if (!this.openDialogs.length) {\n this.ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue) {\n element.setAttribute('aria-hidden', previousValue);\n } else {\n element.removeAttribute('aria-hidden');\n }\n });\n\n this.ariaHiddenElements.clear();\n\n if (emitEvent) {\n this.getAfterAllClosed().next();\n }\n }\n }\n }\n\n /** Hides all of the content that isn't an overlay from assistive technology. */\n private hideNonDialogContentFromAssistiveTechnology() {\n const overlayContainer = this.overlayContainer.getContainerElement();\n\n // Ensure that the overlay container is attached to the DOM.\n if (overlayContainer.parentElement) {\n const siblings = overlayContainer.parentElement.children;\n\n for (let i = siblings.length - 1; i > -1; i--) {\n const sibling = siblings[i];\n\n if (\n sibling !== overlayContainer &&\n sibling.nodeName !== 'SCRIPT' &&\n sibling.nodeName !== 'STYLE' &&\n !sibling.hasAttribute('aria-live')\n ) {\n this.ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));\n sibling.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }\n\n private getAfterAllClosed(): Subject<void> {\n const parent = this.parentDialogManager;\n return parent ? parent.getAfterAllClosed() : this.afterAllClosedAtThisLevel;\n }\n}\n\n/**\n * Executes a callback against all elements in an array while iterating in reverse.\n * Useful if the array is being modified as it is being iterated.\n */\nfunction reverseForEach<T>(items: T[] | readonly T[], callback: (current: T) => void) {\n let i = items.length;\n\n while (i--) {\n callback(items[i]);\n }\n}\n\nexport interface NgpDialogContext<T = unknown, R = unknown> {\n $implicit: NgpDialogRef<T, R>;\n close: (result?: R) => void;\n}\n\nexport function injectDialogManager(): NgpDialogManager {\n return inject(NgpDialogManager);\n}\n","import { Directive, HostListener, inject, input, output, TemplateRef } from '@angular/core';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { NgpDialogRef } from '../dialog/dialog-ref';\nimport { NgpDialogContext, NgpDialogManager } from '../dialog/dialog.service';\n\n@Directive({\n selector: '[ngpDialogTrigger]',\n exportAs: 'ngpDialogTrigger',\n})\nexport class NgpDialogTrigger<T = unknown> {\n /** Access the global configuration */\n private readonly config = injectDialogConfig();\n\n /** Access the dialog manager. */\n private readonly dialogManager = inject(NgpDialogManager);\n\n /** The template to launch. */\n readonly template = input.required<TemplateRef<NgpDialogContext>>({\n alias: 'ngpDialogTrigger',\n });\n\n /** Emits whenever the dialog is closed with the given result. */\n readonly closed = output<T>({ alias: 'ngpDialogTriggerClosed' });\n\n /**\n * Whether the dialog should close on escape.\n * @default `true`\n */\n readonly closeOnEscape = input(this.config.closeOnEscape, {\n alias: 'ngpDialogTriggerCloseOnEscape',\n });\n\n /**\n * Store the dialog ref.\n * @internal\n */\n private dialogRef: NgpDialogRef | null = null;\n\n @HostListener('click')\n protected launch(): void {\n this.dialogRef = this.dialogManager.open(this.template(), {\n closeOnEscape: this.closeOnEscape(),\n });\n this.dialogRef.closed.subscribe(({ result }) => {\n this.closed.emit(result as T);\n return (this.dialogRef = null);\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, input, OnDestroy, signal } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { NgpExitAnimation } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectDialogConfig } from '../config/dialog-config';\nimport { injectDialogRef } from './dialog-ref';\nimport { dialogState, provideDialogState } from './dialog-state';\n\n@Directive({\n selector: '[ngpDialog]',\n exportAs: 'ngpDialog',\n providers: [provideDialogState()],\n hostDirectives: [NgpFocusTrap, NgpExitAnimation],\n host: {\n tabindex: '-1',\n '[id]': 'state.id()',\n '[attr.role]': 'state.role()',\n '[attr.aria-modal]': 'state.modal()',\n '[attr.aria-labelledby]': 'labelledBy().join(\" \")',\n '[attr.aria-describedby]': 'describedBy().join(\" \")',\n },\n})\nexport class NgpDialog<T = unknown, R = unknown> implements OnDestroy {\n private readonly config = injectDialogConfig();\n\n /** Access the dialog ref */\n private readonly dialogRef = injectDialogRef<T, R>();\n\n /** The id of the dialog */\n readonly id = input<string>(uniqueId('ngp-dialog'));\n\n /** The dialog role. */\n readonly role = input(this.config.role, {\n alias: 'ngpDialogRole',\n });\n\n /** Whether the dialog is a modal. */\n readonly modal = input<boolean, BooleanInput>(this.config.modal ?? false, {\n alias: 'ngpDialogModal',\n transform: booleanAttribute,\n });\n\n /** The labelledby ids */\n protected readonly labelledBy = signal<string[]>([]);\n\n /** The describedby ids */\n protected readonly describedBy = signal<string[]>([]);\n\n /** The dialog state */\n protected readonly state = dialogState<NgpDialog<T, R>>(this);\n\n ngOnDestroy(): void {\n this.close();\n }\n\n /** Close the dialog. */\n close(result?: R): void {\n this.dialogRef.close(result);\n }\n\n /** Stop click events from propagating to the overlay */\n @HostListener('click', ['$event'])\n protected onClick(event: Event): void {\n event.stopPropagation();\n }\n\n /** @internal register a labelledby id */\n setLabelledBy(id: string): void {\n this.labelledBy.update(ids => [...ids, id]);\n }\n\n /** @internal register a describedby id */\n setDescribedBy(id: string): void {\n this.describedBy.update(ids => [...ids, id]);\n }\n\n /** @internal remove a labelledby id */\n removeLabelledBy(id: string): void {\n this.labelledBy.update(ids => ids.filter(i => i !== id));\n }\n\n /** @internal remove a describedby id */\n removeDescribedBy(id: string): void {\n this.describedBy.update(ids => ids.filter(i => i !== id));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;AAwCO,MAAM,mBAAmB,GAAoB;AAClD,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,KAAK,EAA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A,EAAA,EAAA,EAAA,SAAA,EAXT,CAAC,kBAAkB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAAA,IAAA,CAAA,YAAA,EAAA,EAAA,EAAA,SAAA,EAAAC,EAAA,CAAA,gBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAWtB,SAAS,EAAA,UAAA,EAAA,CAAA;kBAdrB,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,cAAc,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;AAChD,oBAAA,IAAI,EAAE;AACJ,wBAAA,QAAQ,EAAE,IAAI;AACd,wBAAA,MAAM,EAAE,YAAY;AACpB,wBAAA,aAAa,EAAE,cAAc;AAC7B,wBAAA,mBAAmB,EAAE,eAAe;AACpC,wBAAA,wBAAwB,EAAE,wBAAwB;AAClD,wBAAA,yBAAyB,EAAE,yBAAyB;AACrD,qBAAA;AACF,iBAAA;8BAyCW,OAAO,EAAA,CAAA;sBADhB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AC9DnC;;AAEG;;;;"}
|
|
@@ -3,7 +3,8 @@ import { inject, ElementRef, Injectable, Directive, Renderer2, signal, effect, u
|
|
|
3
3
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
4
4
|
import { safeTakeUntilDestroyed, onBooleanChange, isUndefined, injectDisposables } from 'ng-primitives/utils';
|
|
5
5
|
import { isPlatformServer, DOCUMENT, isPlatformBrowser } from '@angular/common';
|
|
6
|
-
import { Observable,
|
|
6
|
+
import { Observable, merge } from 'rxjs';
|
|
7
|
+
import { map } from 'rxjs/operators';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* A simple utility function to inject an element reference with less boilerplate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-internal.mjs","sources":["../../../../packages/ng-primitives/internal/src/utilities/element-ref.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation-manager.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation.ts","../../../../packages/ng-primitives/internal/src/interactions/focus.ts","../../../../packages/ng-primitives/internal/src/interactions/focus-visible.ts","../../../../packages/ng-primitives/internal/src/signals/explicit-effect.ts","../../../../packages/ng-primitives/internal/src/utilities/resize.ts","../../../../packages/ng-primitives/internal/src/utilities/dom-removal.ts","../../../../packages/ng-primitives/internal/src/interactions/hover.ts","../../../../packages/ng-primitives/internal/src/interactions/press.ts","../../../../packages/ng-primitives/internal/src/style-injector/style-injector.ts","../../../../packages/ng-primitives/internal/src/utilities/mutation-observer.ts","../../../../packages/ng-primitives/internal/src/utilities/overflow.ts","../../../../packages/ng-primitives/internal/src/utilities/scrolling.ts","../../../../packages/ng-primitives/internal/src/ng-primitives-internal.ts"],"sourcesContent":["import { ElementRef, inject } from '@angular/core';\n\n/**\n * A simple utility function to inject an element reference with less boilerplate.\n * @returns The element reference.\n */\nexport function injectElementRef<T extends HTMLElement>(): ElementRef<T> {\n return inject(ElementRef);\n}\n","import { ClassProvider, inject, Injectable } from '@angular/core';\nimport type { NgpExitAnimation } from './exit-animation';\n\n@Injectable()\nexport class NgpExitAnimationManager {\n /** Store the instances of the exit animation directive. */\n private readonly instances: NgpExitAnimation[] = [];\n\n /** Add an instance to the manager. */\n add(instance: NgpExitAnimation): void {\n this.instances.push(instance);\n }\n\n /** Remove an instance from the manager. */\n remove(instance: NgpExitAnimation): void {\n const index = this.instances.indexOf(instance);\n if (index !== -1) {\n this.instances.splice(index, 1);\n }\n }\n\n /** Exit all instances. */\n async exit(): Promise<void> {\n await Promise.all(this.instances.map(instance => instance.exit()));\n }\n}\n\nexport function provideExitAnimationManager(): ClassProvider {\n return { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager };\n}\n\nexport function injectExitAnimationManager(): NgpExitAnimationManager {\n return inject(NgpExitAnimationManager);\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { injectElementRef } from '../utilities/element-ref';\nimport { injectExitAnimationManager } from './exit-animation-manager';\n\n@Directive({\n selector: '[ngpExitAnimation]',\n exportAs: 'ngpExitAnimation',\n})\nexport class NgpExitAnimation implements OnDestroy {\n /** The animation manager. */\n private readonly animationManager = injectExitAnimationManager();\n /** Access the element reference. */\n protected readonly elementRef = injectElementRef();\n\n /** Exist animation reference. */\n protected readonly ref = setupExitAnimation({ element: this.elementRef.nativeElement });\n\n constructor() {\n this.animationManager.add(this);\n }\n\n ngOnDestroy(): void {\n this.animationManager.remove(this);\n }\n\n /** Mark the element as exiting. */\n async exit(): Promise<void> {\n await this.ref.exit();\n }\n}\n\ninterface NgpExitAnimationOptions {\n /** The element to animate. */\n element: HTMLElement;\n}\n\nexport interface NgpExitAnimationRef {\n /** Mark the element as exiting and wait for the animation to finish. */\n exit: () => Promise<void>;\n}\n\nexport function setupExitAnimation({ element }: NgpExitAnimationOptions): NgpExitAnimationRef {\n let state: 'enter' | 'exit' = 'enter';\n\n function setState(newState: 'enter' | 'exit') {\n state = newState;\n\n // remove all current animation state attributes\n element.removeAttribute('data-enter');\n element.removeAttribute('data-exit');\n\n // add the new animation state attribute\n if (state === 'enter') {\n element.setAttribute('data-enter', '');\n } else if (state === 'exit') {\n element.setAttribute('data-exit', '');\n }\n }\n\n // Set the initial state to 'enter'\n requestAnimationFrame(() => setState('enter'));\n\n return {\n exit: () => {\n return new Promise((resolve, reject) => {\n setState('exit');\n\n const animations = element.getAnimations();\n\n // Wait for the exit animations to finish\n if (animations.length > 0) {\n Promise.all(animations.map(anim => anim.finished))\n .then(() => resolve())\n .catch(err => {\n if (err instanceof Error && err.name !== 'AbortError') {\n return reject(err);\n }\n // Ignore abort errors as they are expected when the animation is interrupted\n // by the removal of the element - e.g. when the user navigates away to another page\n resolve();\n });\n } else {\n resolve();\n }\n });\n },\n };\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { ElementRef, Renderer2, Signal, inject, signal } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\n\nexport interface NgpFocusOptions {\n disabled?: Signal<boolean>;\n focusWithin?: boolean;\n focus?: () => void;\n blur?: () => void;\n}\n\nexport interface NgpFocusState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocus({\n focus,\n blur,\n focusWithin = false,\n disabled = signal(false),\n}: NgpFocusOptions): NgpFocusState {\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the focus monitor.\n */\n const focusMonitor = inject(FocusMonitor);\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Whether the element is currently focused.\n */\n const isFocused = signal<boolean>(false);\n\n focusMonitor\n .monitor(elementRef, focusWithin)\n .pipe(safeTakeUntilDestroyed())\n .subscribe(focusOrigin => {\n if (disabled()) {\n return;\n }\n\n isFocused.set(focusOrigin !== null);\n if (focusOrigin !== null) {\n if (focus) {\n focus();\n }\n renderer.setAttribute(elementRef.nativeElement, 'data-focus', '');\n } else {\n if (blur) {\n blur();\n }\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus');\n }\n });\n\n return { isFocused };\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { ElementRef, inject, Renderer2, Signal, signal } from '@angular/core';\nimport { onBooleanChange, safeTakeUntilDestroyed } from 'ng-primitives/utils';\n\nexport interface NgpFocusVisibleOptions {\n disabled?: Signal<boolean>;\n focusChange?: (value: boolean) => void;\n}\n\nexport interface NgpFocusVisibleState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocusVisible({\n focusChange,\n disabled = signal(false),\n}: NgpFocusVisibleOptions): NgpFocusVisibleState {\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n const renderer = inject(Renderer2);\n const focusMonitor = inject(FocusMonitor);\n\n // Whether the element is currently focused.\n const isFocused = signal<boolean>(false);\n\n // handle focus state\n focusMonitor\n .monitor(elementRef.nativeElement)\n .pipe(safeTakeUntilDestroyed())\n .subscribe(origin =>\n // null indicates the element was blurred\n origin === null ? onBlur() : onFocus(origin),\n );\n\n // if the component becomes disabled and it is focused, hide the focus\n onBooleanChange(disabled, () => focus(false));\n\n function onFocus(origin: FocusOrigin): void {\n if (disabled() || isFocused()) {\n return;\n }\n\n // for some elements the focus visible state should always appear on focus\n if (alwaysShowFocus()) {\n focus(true);\n return;\n }\n\n // if the focus origin is keyboard or program(focused programmatically), then the focus is visible\n if (origin === 'keyboard') {\n focus(true);\n return;\n }\n }\n\n function onBlur(): void {\n if (disabled() || !isFocused()) {\n return;\n }\n\n focus(false);\n }\n\n /**\n * Trigger the focus signal along with the focusChange event.\n */\n function focus(value: boolean) {\n if (isFocused() === value) {\n return;\n }\n\n isFocused.set(value);\n focusChange?.(value);\n\n if (value) {\n renderer.setAttribute(elementRef.nativeElement, 'data-focus-visible', '');\n } else {\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus-visible');\n }\n }\n\n function alwaysShowFocus(): boolean {\n const nonTextInputTypes = [\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset',\n ];\n\n // if this is an input element and it is a text input\n if (\n elementRef.nativeElement instanceof HTMLInputElement &&\n !nonTextInputTypes.includes(elementRef.nativeElement.type)\n ) {\n return true;\n }\n\n // if this is a textarea\n if (elementRef.nativeElement instanceof HTMLTextAreaElement) {\n return true;\n }\n\n // if this is an element with contenteditable\n if (\n elementRef.nativeElement.isContentEditable ||\n elementRef.nativeElement.hasAttribute('contenteditable')\n ) {\n return true;\n }\n\n return false;\n }\n\n return {\n isFocused,\n };\n}\n","/**\n * This implementation is heavily inspired by the great work on ngextension!\n * https://github.com/ngxtension/ngxtension-platform/blob/main/libs/ngxtension/explicit-effect/src/explicit-effect.ts\n */\nimport {\n CreateEffectOptions,\n EffectCleanupRegisterFn,\n EffectRef,\n effect,\n untracked,\n} from '@angular/core';\n\n/**\n * We want to have the Tuple in order to use the types in the function signature\n */\ntype ExplicitEffectValues<T> = {\n [K in keyof T]: () => T[K];\n};\n\n/**\n * This explicit effect function will take the dependencies and the function to run when the dependencies change.\n * @param deps - The dependencies that the effect will run on\n * @param fn - The function to run when the dependencies change\n * @param options - The options for the effect with the addition of defer (it allows the computation to run on first change, not immediately)\n */\nexport function explicitEffect<Input extends readonly unknown[], Params = Input>(\n deps: readonly [...ExplicitEffectValues<Input>],\n fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void,\n options?: CreateEffectOptions,\n): EffectRef {\n return effect(onCleanup => {\n const depValues = deps.map(s => s());\n untracked(() => fn(depValues as Params, onCleanup));\n }, options);\n}\n","import { DestroyRef, effect, inject, Injector, signal, Signal, untracked } from '@angular/core';\nimport { isUndefined, safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { map, Observable, Subscription } from 'rxjs';\nimport { explicitEffect } from '../signals/explicit-effect';\nimport { injectElementRef } from './element-ref';\n\ninterface NgpResizeObserverOptions {\n /**\n * Whether to listen for events.\n */\n disabled?: Signal<boolean>;\n\n /**\n * The injector to use when called from outside of the injector context.\n */\n injector?: Injector;\n}\n\n/**\n * A simple helper function to create a resize observer as an RxJS Observable.\n * @param element The element to observe for resize events.\n * @returns The resize event as an Observable.\n */\nexport function fromResizeEvent(\n element: HTMLElement,\n { disabled = signal(false), injector }: NgpResizeObserverOptions = {},\n): Observable<Dimensions> {\n return new Observable(observable => {\n // ResizeObserver may not be available in all environments, so check for its existence\n if (isUndefined(window?.ResizeObserver)) {\n // ResizeObserver is not available (SSR or unsupported browser)\n // Complete the observable without emitting any values\n observable.complete();\n return;\n }\n\n let observer: ResizeObserver | null = null;\n\n function setupOrTeardownObserver() {\n if (disabled()) {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n return;\n }\n\n if (!observer) {\n observer = new ResizeObserver(entries => {\n // if there are no entries, ignore the event\n if (!entries.length) {\n return;\n }\n\n // otherwise, take the first entry and emit the dimensions\n const entry = entries[0];\n\n if ('borderBoxSize' in entry) {\n const borderSizeEntry = entry['borderBoxSize'];\n // this may be different across browsers so normalize it\n const borderSize = Array.isArray(borderSizeEntry)\n ? borderSizeEntry[0]\n : borderSizeEntry;\n\n observable.next({ width: borderSize['inlineSize'], height: borderSize['blockSize'] });\n } else {\n // fallback for browsers that don't support borderBoxSize\n observable.next({ width: element.offsetWidth, height: element.offsetHeight });\n }\n });\n\n observer.observe(element);\n }\n }\n\n setupOrTeardownObserver();\n\n explicitEffect([disabled], () => setupOrTeardownObserver(), { injector });\n\n return () => observer?.disconnect();\n });\n}\n\n/**\n * A utility function to observe any element for resize events and return the dimensions as a signal.\n */\nexport function observeResize(elementFn: () => HTMLElement | undefined): Signal<Dimensions> {\n const dimensions = signal<Dimensions>({ width: 0, height: 0 });\n const injector = inject(Injector);\n const destroyRef = inject(DestroyRef);\n\n // store the subscription to the resize event\n let subscription: Subscription | null = null;\n\n effect(() => {\n const targetElement = elementFn();\n\n untracked(() => {\n if (!targetElement) {\n return;\n }\n\n // if we already have a subscription, unsubscribe from it\n subscription?.unsubscribe();\n\n // create a new subscription to the resize event\n subscription = fromResizeEvent(targetElement, { injector })\n .pipe(safeTakeUntilDestroyed(destroyRef))\n .subscribe(event => dimensions.set({ width: event.width, height: event.height }));\n });\n });\n\n return dimensions;\n}\n\nexport interface Dimensions {\n width: number;\n height: number;\n}\n\n/**\n * A simple utility to get the dimensions of an element as a signal.\n */\nexport function injectDimensions(): Signal<Dimensions> {\n const elementRef = injectElementRef<HTMLElement>();\n const destroyRef = inject(DestroyRef);\n const dimensions = signal<Dimensions>({ width: 0, height: 0 });\n\n fromResizeEvent(elementRef.nativeElement)\n .pipe(\n safeTakeUntilDestroyed(destroyRef),\n map(({ width, height }) => ({ width, height })),\n )\n .subscribe(event => dimensions.set(event));\n\n return dimensions;\n}\n","import { isPlatformServer } from '@angular/common';\nimport { inject, PLATFORM_ID } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { fromResizeEvent } from './resize';\n\n/**\n * Whenever an element is removed from the DOM, we call the callback.\n * @param element The element to watch for removal.\n * @param callback The callback to call when the element is removed.\n */\nexport function onDomRemoval(element: HTMLElement, callback: () => void): void {\n const platform = inject(PLATFORM_ID);\n\n // Dont run this on the server\n if (isPlatformServer(platform)) {\n return;\n }\n\n // This is a bit of a hack, but it works. If the element dimensions become zero,\n // it's likely that the element has been removed from the DOM.\n fromResizeEvent(element)\n .pipe(safeTakeUntilDestroyed())\n .subscribe(dimensions => {\n // we check the dimensions first to short-circuit the check as it's faster\n if (dimensions.width === 0 && dimensions.height === 0 && !document.body.contains(element)) {\n callback();\n }\n });\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { effect, ElementRef, inject, Injectable, PLATFORM_ID, Signal, signal } from '@angular/core';\nimport { injectDisposables, onBooleanChange } from 'ng-primitives/utils';\nimport { onDomRemoval } from '../utilities/dom-removal';\n\n/**\n * We use a service here as this value is a singleton\n * and allows us to register the dom events once.\n */\n@Injectable({\n providedIn: 'root',\n})\nclass GlobalPointerEvents {\n /**\n * Whether global mouse events should be ignored.\n */\n ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Determine the platform id.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n constructor() {\n // we only want to setup events on the client\n if (isPlatformBrowser(this.platformId)) {\n this.setupGlobalTouchEvents();\n }\n }\n\n private setupGlobalTouchEvents(): void {\n this.document.addEventListener('pointerup', this.handleGlobalPointerEvent.bind(this));\n this.document.addEventListener('touchend', this.setGlobalIgnoreEmulatedMouseEvents.bind(this));\n }\n\n private setGlobalIgnoreEmulatedMouseEvents(): void {\n this.ignoreEmulatedMouseEvents = true;\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => (this.ignoreEmulatedMouseEvents = false), 50);\n }\n\n private handleGlobalPointerEvent(event: PointerEvent): void {\n if (event.pointerType === 'touch') {\n this.setGlobalIgnoreEmulatedMouseEvents();\n }\n }\n}\n\ninterface NgpHoverOptions {\n disabled?: Signal<boolean>;\n hoverStart?: () => void;\n hoverEnd?: () => void;\n}\n\nexport interface NgpHoverState {\n hovered: Signal<boolean>;\n}\n\n/**\n * Programatically add the hover functionality to an element.\n * This is useful in cases where we can't necessarily use a HostDirective,\n * because there is a chance the directive has already been used.\n */\nexport function setupHover({\n hoverStart,\n hoverEnd,\n disabled = signal(false),\n}: NgpHoverOptions): NgpHoverState {\n /**\n * Access the element.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the global pointer events handler.\n */\n const globalPointerEvents = inject(GlobalPointerEvents);\n\n /**\n * Access the disposable helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Store the current hover state.\n */\n const hovered = signal<boolean>(false);\n\n /**\n * Whether this element should ignore emulated mouse events.\n */\n let ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Setup event listeners.\n */\n disposables.addEventListener(elementRef.nativeElement, 'pointerenter', onPointerEnter);\n disposables.addEventListener(elementRef.nativeElement, 'pointerleave', onPointerLeave);\n disposables.addEventListener(elementRef.nativeElement, 'touchstart', onTouchStart);\n disposables.addEventListener(elementRef.nativeElement, 'mouseenter', onMouseEnter);\n disposables.addEventListener(elementRef.nativeElement, 'mouseleave', onMouseLeave);\n\n // anytime the disabled state changes to true, we must reset the hover state\n if (disabled) {\n onBooleanChange(disabled, reset);\n }\n\n // if the element is removed from the dom, we want to reset the hover state\n onDomRemoval(elementRef.nativeElement, reset);\n\n // anytime the hover state changes we want to update the attribute\n effect(() =>\n hovered()\n ? elementRef.nativeElement.setAttribute('data-hover', '')\n : elementRef.nativeElement.removeAttribute('data-hover'),\n );\n\n /**\n * Reset the hover state.\n */\n function reset(): void {\n onHoverEnd('mouse');\n }\n\n /**\n * Trigger the hover start events.\n * @param event\n * @param pointerType\n */\n function onHoverStart(event: Event, pointerType: string): void {\n if (\n disabled() ||\n pointerType === 'touch' ||\n hovered() ||\n !(event.currentTarget as Element)?.contains(event.target as Element)\n ) {\n return;\n }\n\n hovered.set(true);\n hoverStart?.();\n }\n\n /**\n * Trigger the hover end events.\n * @param pointerType\n */\n function onHoverEnd(pointerType: string): void {\n if (pointerType === 'touch' || !hovered()) {\n return;\n }\n\n hovered.set(false);\n hoverEnd?.();\n }\n\n function onPointerEnter(event: PointerEvent): void {\n if (globalPointerEvents.ignoreEmulatedMouseEvents && event.pointerType === 'mouse') {\n return;\n }\n\n onHoverStart(event, event.pointerType);\n }\n\n function onPointerLeave(event: PointerEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd(event.pointerType);\n }\n }\n\n function onTouchStart(): void {\n ignoreEmulatedMouseEvents = true;\n }\n\n function onMouseEnter(event: MouseEvent): void {\n if (!ignoreEmulatedMouseEvents && !globalPointerEvents.ignoreEmulatedMouseEvents) {\n onHoverStart(event, 'mouse');\n }\n\n ignoreEmulatedMouseEvents = false;\n }\n\n function onMouseLeave(event: MouseEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd('mouse');\n }\n }\n\n return { hovered };\n}\n","import { ElementRef, Signal, effect, inject, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\ninterface NgpPressState {\n pressed: Signal<boolean>;\n}\n\ninterface NgpPressOptions {\n disabled?: Signal<boolean>;\n pressStart?: () => void;\n pressEnd?: () => void;\n}\n\nexport function setupPress({\n pressStart,\n pressEnd,\n disabled = signal(false),\n}: NgpPressOptions): NgpPressState {\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n const disposables = injectDisposables();\n\n /**\n * Whether the element is currently pressed.\n */\n const pressed = signal<boolean>(false);\n\n // setup event listeners\n disposables.addEventListener(elementRef.nativeElement, 'pointerdown', onPointerDown);\n\n // anytime the press state changes we want to update the attribute\n effect(() =>\n pressed() && !disabled()\n ? elementRef.nativeElement.setAttribute('data-press', '')\n : elementRef.nativeElement.removeAttribute('data-press'),\n );\n\n /**\n * Reset the press state.\n */\n function reset(): void {\n // if we are not pressing, then do nothing\n if (!pressed()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n pressed.set(false);\n pressEnd?.();\n }\n\n /**\n * Store the list of disposables.\n */\n let disposableListeners: (() => void)[] = [];\n\n function onPointerDown(): void {\n if (disabled()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n\n // update the press state\n pressed.set(true);\n pressStart?.();\n\n // setup global event listeners to catch events on elements outside the directive\n const ownerDocument = elementRef.nativeElement.ownerDocument ?? document;\n\n // if the pointer up event happens on any elements, then we are no longer pressing on this element\n const pointerUp = disposables.addEventListener(\n ownerDocument,\n 'pointerup',\n () => reset(),\n false,\n );\n\n // Instead of relying on the `pointerleave` event, which is not consistently called on iOS Safari,\n // we use the `pointermove` event to determine if we are still \"pressing\".\n // By checking if the target is still within the element, we can determine if the press is ongoing.\n const pointerMove = disposables.addEventListener(\n ownerDocument,\n 'pointermove',\n () => onPointerMove as EventListener,\n false,\n );\n\n // if the pointer is cancelled, then we are no longer pressing on this element\n const pointerCancel = disposables.addEventListener(\n ownerDocument,\n 'pointercancel',\n () => reset(),\n false,\n );\n\n disposableListeners = [pointerUp, pointerMove, pointerCancel];\n }\n\n function onPointerMove(event: PointerEvent): void {\n if (\n elementRef.nativeElement !== event.target &&\n !elementRef.nativeElement.contains(event.target as Node)\n ) {\n reset();\n }\n }\n\n return { pressed };\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { CSP_NONCE, inject, Injectable, PLATFORM_ID } from '@angular/core';\n\n/**\n * A utility service for injecting styles into the document.\n * Angular doesn't allow directives to specify styles, only components.\n * As we ship directives, occasionally we need to associate styles with them.\n * This service allows us to programmatically inject styles into the document.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class StyleInjector {\n /**\n * Access the CSP nonce\n */\n private readonly cspNonce = inject(CSP_NONCE, { optional: true });\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Detect the platform.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n /**\n * Store the map of style elements with their unique identifiers.\n */\n private readonly styleElements = new Map<string, HTMLStyleElement>();\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n this.collectServerStyles();\n }\n }\n\n /**\n * Inject a style into the document.\n * @param id The unique identifier for the style.\n * @param style The style to inject.\n */\n add(id: string, style: string): void {\n if (this.styleElements.has(id)) {\n return;\n }\n\n const styleElement = this.document.createElement('style');\n styleElement.setAttribute('data-ngp-style', id);\n styleElement.textContent = style;\n\n // If a CSP nonce is provided, set it on the style element\n if (this.cspNonce) {\n styleElement.setAttribute('nonce', this.cspNonce);\n }\n\n this.document.head.appendChild(styleElement);\n this.styleElements.set(id, styleElement);\n }\n\n /**\n * Remove a style from the document.\n * @param id The unique identifier for the style.\n */\n remove(id: string): void {\n const styleElement = this.styleElements.get(id);\n\n if (styleElement) {\n this.document.head.removeChild(styleElement);\n this.styleElements.delete(id);\n }\n }\n\n /**\n * Collect any styles that were rendered by the server.\n */\n private collectServerStyles(): void {\n const styleElements = this.document.querySelectorAll<HTMLStyleElement>('style[data-ngp-style]');\n\n styleElements.forEach(styleElement => {\n const id = styleElement.getAttribute('data-ngp-style');\n\n if (id) {\n this.styleElements.set(id, styleElement);\n }\n });\n }\n}\n\nexport function injectStyleInjector(): StyleInjector {\n return inject(StyleInjector);\n}\n","import { Injector, Signal, signal } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { explicitEffect } from '../signals/explicit-effect';\n\ninterface NgpMutationObserverOptions {\n /**\n * Whether to listen for events.\n */\n disabled?: Signal<boolean>;\n /**\n * The injector to use when called from outside of the injector context.\n */\n injector?: Injector;\n /**\n * Whether the childList should be observed.\n */\n childList?: boolean;\n /**\n * Whether the subtree should be observed.\n */\n subtree?: boolean;\n /**\n * Whether the attributes should be observed.\n */\n attributes?: boolean;\n /**\n * Whether the characterData should be observed.\n */\n characterData?: boolean;\n /**\n * Whether the attributeFilter should be observed.\n */\n attributeFilter?: string[];\n}\n\n/**\n * This function sets up a mutation observer to listen for changes in the DOM.\n * It will stop listening when the `disabled` signal is true, and re-enable when it is false.\n * @param options - Options for the mutation observer\n */\nexport function fromMutationObserver(\n element: HTMLElement,\n {\n childList,\n subtree,\n attributes,\n characterData,\n disabled = signal(false),\n injector,\n }: NgpMutationObserverOptions = {},\n): Observable<MutationRecord[]> {\n return new Observable<MutationRecord[]>(observable => {\n let observer: MutationObserver | null = null;\n\n function setupOrTeardownObserver() {\n if (disabled()) {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n return;\n }\n\n observer = new MutationObserver(mutations => observable.next(mutations));\n observer.observe(element, { childList, subtree, attributes, characterData });\n }\n\n setupOrTeardownObserver();\n\n // any time the disabled state changes, we need to re-evaluate the observer\n explicitEffect([disabled], () => setupOrTeardownObserver(), { injector });\n\n return () => observer?.disconnect();\n });\n}\n","import { DestroyRef, inject, Injector, Signal, signal } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { merge } from 'rxjs';\nimport { fromMutationObserver } from './mutation-observer';\nimport { fromResizeEvent } from './resize';\n\ninterface NgpOverflowListenerOptions {\n /**\n * Whether to listen for overflow changes.\n */\n disabled?: Signal<boolean>;\n /**\n * The injector to use when called from outside of the injector context.\n */\n injector?: Injector;\n}\n\nexport function setupOverflowListener(\n element: HTMLElement,\n { disabled = signal(false), injector }: NgpOverflowListenerOptions,\n): Signal<boolean> {\n const hasOverflow = signal<boolean>(false);\n const destroyRef = injector?.get(DestroyRef) ?? inject(DestroyRef);\n\n // Merge both observables and update hasOverflow on any event\n\n merge(\n fromResizeEvent(element, { disabled, injector }),\n fromMutationObserver(element, { disabled, injector, characterData: true }),\n )\n .pipe(safeTakeUntilDestroyed(destroyRef))\n .subscribe(() =>\n hasOverflow.set(\n element.scrollWidth > element.clientWidth || element.scrollHeight > element.clientHeight,\n ),\n );\n\n return hasOverflow;\n}\n","function getScrollableAncestor(element: HTMLElement): HTMLElement | null {\n let parent = element.parentElement;\n while (parent) {\n const style = window.getComputedStyle(parent);\n if (/(auto|scroll)/.test(style.overflowY) || /(auto|scroll)/.test(style.overflowX)) {\n return parent;\n }\n parent = parent.parentElement;\n }\n return null;\n}\n\nexport function scrollIntoViewIfNeeded(element: HTMLElement): void {\n const scrollableAncestor = getScrollableAncestor(element);\n if (!scrollableAncestor) return;\n\n const parentRect = scrollableAncestor.getBoundingClientRect();\n const elementRect = element.getBoundingClientRect();\n\n if (elementRect.top < parentRect.top) {\n scrollableAncestor.scrollTop -= parentRect.top - elementRect.top;\n } else if (elementRect.bottom > parentRect.bottom) {\n scrollableAncestor.scrollTop += elementRect.bottom - parentRect.bottom;\n }\n\n if (elementRect.left < parentRect.left) {\n scrollableAncestor.scrollLeft -= parentRect.left - elementRect.left;\n } else if (elementRect.right > parentRect.right) {\n scrollableAncestor.scrollLeft += elementRect.right - parentRect.right;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B;;MCJa,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;;QAGmB,IAAA,CAAA,SAAS,GAAuB,EAAE;AAmBpD,IAAA;;AAhBC,IAAA,GAAG,CAAC,QAA0B,EAAA;AAC5B,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC/B;;AAGA,IA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I,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;IAClE;SAAO,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE;QACjD,kBAAkB,CAAC,SAAS,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM;IACxE;IAEA,IAAI,WAAW,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE;QACtC,kBAAkB,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;IACrE;SAAO,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE;QAC/C,kBAAkB,CAAC,UAAU,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK;IACvE;AACF;;AC9BA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-internal.mjs","sources":["../../../../packages/ng-primitives/internal/src/utilities/element-ref.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation-manager.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation.ts","../../../../packages/ng-primitives/internal/src/interactions/focus.ts","../../../../packages/ng-primitives/internal/src/interactions/focus-visible.ts","../../../../packages/ng-primitives/internal/src/signals/explicit-effect.ts","../../../../packages/ng-primitives/internal/src/utilities/resize.ts","../../../../packages/ng-primitives/internal/src/utilities/dom-removal.ts","../../../../packages/ng-primitives/internal/src/interactions/hover.ts","../../../../packages/ng-primitives/internal/src/interactions/press.ts","../../../../packages/ng-primitives/internal/src/style-injector/style-injector.ts","../../../../packages/ng-primitives/internal/src/utilities/mutation-observer.ts","../../../../packages/ng-primitives/internal/src/utilities/overflow.ts","../../../../packages/ng-primitives/internal/src/utilities/scrolling.ts","../../../../packages/ng-primitives/internal/src/ng-primitives-internal.ts"],"sourcesContent":["import { ElementRef, inject } from '@angular/core';\n\n/**\n * A simple utility function to inject an element reference with less boilerplate.\n * @returns The element reference.\n */\nexport function injectElementRef<T extends HTMLElement>(): ElementRef<T> {\n return inject(ElementRef);\n}\n","import { ClassProvider, inject, Injectable } from '@angular/core';\nimport type { NgpExitAnimation } from './exit-animation';\n\n@Injectable()\nexport class NgpExitAnimationManager {\n /** Store the instances of the exit animation directive. */\n private readonly instances: NgpExitAnimation[] = [];\n\n /** Add an instance to the manager. */\n add(instance: NgpExitAnimation): void {\n this.instances.push(instance);\n }\n\n /** Remove an instance from the manager. */\n remove(instance: NgpExitAnimation): void {\n const index = this.instances.indexOf(instance);\n if (index !== -1) {\n this.instances.splice(index, 1);\n }\n }\n\n /** Exit all instances. */\n async exit(): Promise<void> {\n await Promise.all(this.instances.map(instance => instance.exit()));\n }\n}\n\nexport function provideExitAnimationManager(): ClassProvider {\n return { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager };\n}\n\nexport function injectExitAnimationManager(): NgpExitAnimationManager {\n return inject(NgpExitAnimationManager);\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { injectElementRef } from '../utilities/element-ref';\nimport { injectExitAnimationManager } from './exit-animation-manager';\n\n@Directive({\n selector: '[ngpExitAnimation]',\n exportAs: 'ngpExitAnimation',\n})\nexport class NgpExitAnimation implements OnDestroy {\n /** The animation manager. */\n private readonly animationManager = injectExitAnimationManager();\n /** Access the element reference. */\n protected readonly elementRef = injectElementRef();\n\n /** Exist animation reference. */\n protected readonly ref = setupExitAnimation({ element: this.elementRef.nativeElement });\n\n constructor() {\n this.animationManager.add(this);\n }\n\n ngOnDestroy(): void {\n this.animationManager.remove(this);\n }\n\n /** Mark the element as exiting. */\n async exit(): Promise<void> {\n await this.ref.exit();\n }\n}\n\ninterface NgpExitAnimationOptions {\n /** The element to animate. */\n element: HTMLElement;\n}\n\nexport interface NgpExitAnimationRef {\n /** Mark the element as exiting and wait for the animation to finish. */\n exit: () => Promise<void>;\n}\n\nexport function setupExitAnimation({ element }: NgpExitAnimationOptions): NgpExitAnimationRef {\n let state: 'enter' | 'exit' = 'enter';\n\n function setState(newState: 'enter' | 'exit') {\n state = newState;\n\n // remove all current animation state attributes\n element.removeAttribute('data-enter');\n element.removeAttribute('data-exit');\n\n // add the new animation state attribute\n if (state === 'enter') {\n element.setAttribute('data-enter', '');\n } else if (state === 'exit') {\n element.setAttribute('data-exit', '');\n }\n }\n\n // Set the initial state to 'enter'\n requestAnimationFrame(() => setState('enter'));\n\n return {\n exit: () => {\n return new Promise((resolve, reject) => {\n setState('exit');\n\n const animations = element.getAnimations();\n\n // Wait for the exit animations to finish\n if (animations.length > 0) {\n Promise.all(animations.map(anim => anim.finished))\n .then(() => resolve())\n .catch(err => {\n if (err instanceof Error && err.name !== 'AbortError') {\n return reject(err);\n }\n // Ignore abort errors as they are expected when the animation is interrupted\n // by the removal of the element - e.g. when the user navigates away to another page\n resolve();\n });\n } else {\n resolve();\n }\n });\n },\n };\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport { ElementRef, Renderer2, Signal, inject, signal } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\n\nexport interface NgpFocusOptions {\n disabled?: Signal<boolean>;\n focusWithin?: boolean;\n focus?: () => void;\n blur?: () => void;\n}\n\nexport interface NgpFocusState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocus({\n focus,\n blur,\n focusWithin = false,\n disabled = signal(false),\n}: NgpFocusOptions): NgpFocusState {\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the focus monitor.\n */\n const focusMonitor = inject(FocusMonitor);\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Whether the element is currently focused.\n */\n const isFocused = signal<boolean>(false);\n\n focusMonitor\n .monitor(elementRef, focusWithin)\n .pipe(safeTakeUntilDestroyed())\n .subscribe(focusOrigin => {\n if (disabled()) {\n return;\n }\n\n isFocused.set(focusOrigin !== null);\n if (focusOrigin !== null) {\n if (focus) {\n focus();\n }\n renderer.setAttribute(elementRef.nativeElement, 'data-focus', '');\n } else {\n if (blur) {\n blur();\n }\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus');\n }\n });\n\n return { isFocused };\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { ElementRef, inject, Renderer2, Signal, signal } from '@angular/core';\nimport { onBooleanChange, safeTakeUntilDestroyed } from 'ng-primitives/utils';\n\nexport interface NgpFocusVisibleOptions {\n disabled?: Signal<boolean>;\n focusChange?: (value: boolean) => void;\n}\n\nexport interface NgpFocusVisibleState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocusVisible({\n focusChange,\n disabled = signal(false),\n}: NgpFocusVisibleOptions): NgpFocusVisibleState {\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n const renderer = inject(Renderer2);\n const focusMonitor = inject(FocusMonitor);\n\n // Whether the element is currently focused.\n const isFocused = signal<boolean>(false);\n\n // handle focus state\n focusMonitor\n .monitor(elementRef.nativeElement)\n .pipe(safeTakeUntilDestroyed())\n .subscribe(origin =>\n // null indicates the element was blurred\n origin === null ? onBlur() : onFocus(origin),\n );\n\n // if the component becomes disabled and it is focused, hide the focus\n onBooleanChange(disabled, () => focus(false));\n\n function onFocus(origin: FocusOrigin): void {\n if (disabled() || isFocused()) {\n return;\n }\n\n // for some elements the focus visible state should always appear on focus\n if (alwaysShowFocus()) {\n focus(true);\n return;\n }\n\n // if the focus origin is keyboard or program(focused programmatically), then the focus is visible\n if (origin === 'keyboard') {\n focus(true);\n return;\n }\n }\n\n function onBlur(): void {\n if (disabled() || !isFocused()) {\n return;\n }\n\n focus(false);\n }\n\n /**\n * Trigger the focus signal along with the focusChange event.\n */\n function focus(value: boolean) {\n if (isFocused() === value) {\n return;\n }\n\n isFocused.set(value);\n focusChange?.(value);\n\n if (value) {\n renderer.setAttribute(elementRef.nativeElement, 'data-focus-visible', '');\n } else {\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus-visible');\n }\n }\n\n function alwaysShowFocus(): boolean {\n const nonTextInputTypes = [\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset',\n ];\n\n // if this is an input element and it is a text input\n if (\n elementRef.nativeElement instanceof HTMLInputElement &&\n !nonTextInputTypes.includes(elementRef.nativeElement.type)\n ) {\n return true;\n }\n\n // if this is a textarea\n if (elementRef.nativeElement instanceof HTMLTextAreaElement) {\n return true;\n }\n\n // if this is an element with contenteditable\n if (\n elementRef.nativeElement.isContentEditable ||\n elementRef.nativeElement.hasAttribute('contenteditable')\n ) {\n return true;\n }\n\n return false;\n }\n\n return {\n isFocused,\n };\n}\n","/**\n * This implementation is heavily inspired by the great work on ngextension!\n * https://github.com/ngxtension/ngxtension-platform/blob/main/libs/ngxtension/explicit-effect/src/explicit-effect.ts\n */\nimport {\n CreateEffectOptions,\n EffectCleanupRegisterFn,\n EffectRef,\n effect,\n untracked,\n} from '@angular/core';\n\n/**\n * We want to have the Tuple in order to use the types in the function signature\n */\ntype ExplicitEffectValues<T> = {\n [K in keyof T]: () => T[K];\n};\n\n/**\n * This explicit effect function will take the dependencies and the function to run when the dependencies change.\n * @param deps - The dependencies that the effect will run on\n * @param fn - The function to run when the dependencies change\n * @param options - The options for the effect with the addition of defer (it allows the computation to run on first change, not immediately)\n */\nexport function explicitEffect<Input extends readonly unknown[], Params = Input>(\n deps: readonly [...ExplicitEffectValues<Input>],\n fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void,\n options?: CreateEffectOptions,\n): EffectRef {\n return effect(onCleanup => {\n const depValues = deps.map(s => s());\n untracked(() => fn(depValues as Params, onCleanup));\n }, options);\n}\n","import { DestroyRef, effect, inject, Injector, signal, Signal, untracked } from '@angular/core';\nimport { isUndefined, safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { Observable, Subscription } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { explicitEffect } from '../signals/explicit-effect';\nimport { injectElementRef } from './element-ref';\n\ninterface NgpResizeObserverOptions {\n /**\n * Whether to listen for events.\n */\n disabled?: Signal<boolean>;\n\n /**\n * The injector to use when called from outside of the injector context.\n */\n injector?: Injector;\n}\n\n/**\n * A simple helper function to create a resize observer as an RxJS Observable.\n * @param element The element to observe for resize events.\n * @returns The resize event as an Observable.\n */\nexport function fromResizeEvent(\n element: HTMLElement,\n { disabled = signal(false), injector }: NgpResizeObserverOptions = {},\n): Observable<Dimensions> {\n return new Observable(observable => {\n // ResizeObserver may not be available in all environments, so check for its existence\n if (isUndefined(window?.ResizeObserver)) {\n // ResizeObserver is not available (SSR or unsupported browser)\n // Complete the observable without emitting any values\n observable.complete();\n return;\n }\n\n let observer: ResizeObserver | null = null;\n\n function setupOrTeardownObserver() {\n if (disabled()) {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n return;\n }\n\n if (!observer) {\n observer = new ResizeObserver(entries => {\n // if there are no entries, ignore the event\n if (!entries.length) {\n return;\n }\n\n // otherwise, take the first entry and emit the dimensions\n const entry = entries[0];\n\n if ('borderBoxSize' in entry) {\n const borderSizeEntry = entry['borderBoxSize'];\n // this may be different across browsers so normalize it\n const borderSize = Array.isArray(borderSizeEntry)\n ? borderSizeEntry[0]\n : borderSizeEntry;\n\n observable.next({ width: borderSize['inlineSize'], height: borderSize['blockSize'] });\n } else {\n // fallback for browsers that don't support borderBoxSize\n observable.next({ width: element.offsetWidth, height: element.offsetHeight });\n }\n });\n\n observer.observe(element);\n }\n }\n\n setupOrTeardownObserver();\n\n explicitEffect([disabled], () => setupOrTeardownObserver(), { injector });\n\n return () => observer?.disconnect();\n });\n}\n\n/**\n * A utility function to observe any element for resize events and return the dimensions as a signal.\n */\nexport function observeResize(elementFn: () => HTMLElement | undefined): Signal<Dimensions> {\n const dimensions = signal<Dimensions>({ width: 0, height: 0 });\n const injector = inject(Injector);\n const destroyRef = inject(DestroyRef);\n\n // store the subscription to the resize event\n let subscription: Subscription | null = null;\n\n effect(() => {\n const targetElement = elementFn();\n\n untracked(() => {\n if (!targetElement) {\n return;\n }\n\n // if we already have a subscription, unsubscribe from it\n subscription?.unsubscribe();\n\n // create a new subscription to the resize event\n subscription = fromResizeEvent(targetElement, { injector })\n .pipe(safeTakeUntilDestroyed(destroyRef))\n .subscribe(event => dimensions.set({ width: event.width, height: event.height }));\n });\n });\n\n return dimensions;\n}\n\nexport interface Dimensions {\n width: number;\n height: number;\n}\n\n/**\n * A simple utility to get the dimensions of an element as a signal.\n */\nexport function injectDimensions(): Signal<Dimensions> {\n const elementRef = injectElementRef<HTMLElement>();\n const destroyRef = inject(DestroyRef);\n const dimensions = signal<Dimensions>({ width: 0, height: 0 });\n\n fromResizeEvent(elementRef.nativeElement)\n .pipe(\n safeTakeUntilDestroyed(destroyRef),\n map(({ width, height }) => ({ width, height })),\n )\n .subscribe(event => dimensions.set(event));\n\n return dimensions;\n}\n","import { isPlatformServer } from '@angular/common';\nimport { inject, PLATFORM_ID } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { fromResizeEvent } from './resize';\n\n/**\n * Whenever an element is removed from the DOM, we call the callback.\n * @param element The element to watch for removal.\n * @param callback The callback to call when the element is removed.\n */\nexport function onDomRemoval(element: HTMLElement, callback: () => void): void {\n const platform = inject(PLATFORM_ID);\n\n // Dont run this on the server\n if (isPlatformServer(platform)) {\n return;\n }\n\n // This is a bit of a hack, but it works. If the element dimensions become zero,\n // it's likely that the element has been removed from the DOM.\n fromResizeEvent(element)\n .pipe(safeTakeUntilDestroyed())\n .subscribe(dimensions => {\n // we check the dimensions first to short-circuit the check as it's faster\n if (dimensions.width === 0 && dimensions.height === 0 && !document.body.contains(element)) {\n callback();\n }\n });\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { effect, ElementRef, inject, Injectable, PLATFORM_ID, Signal, signal } from '@angular/core';\nimport { injectDisposables, onBooleanChange } from 'ng-primitives/utils';\nimport { onDomRemoval } from '../utilities/dom-removal';\n\n/**\n * We use a service here as this value is a singleton\n * and allows us to register the dom events once.\n */\n@Injectable({\n providedIn: 'root',\n})\nclass GlobalPointerEvents {\n /**\n * Whether global mouse events should be ignored.\n */\n ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Determine the platform id.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n constructor() {\n // we only want to setup events on the client\n if (isPlatformBrowser(this.platformId)) {\n this.setupGlobalTouchEvents();\n }\n }\n\n private setupGlobalTouchEvents(): void {\n this.document.addEventListener('pointerup', this.handleGlobalPointerEvent.bind(this));\n this.document.addEventListener('touchend', this.setGlobalIgnoreEmulatedMouseEvents.bind(this));\n }\n\n private setGlobalIgnoreEmulatedMouseEvents(): void {\n this.ignoreEmulatedMouseEvents = true;\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => (this.ignoreEmulatedMouseEvents = false), 50);\n }\n\n private handleGlobalPointerEvent(event: PointerEvent): void {\n if (event.pointerType === 'touch') {\n this.setGlobalIgnoreEmulatedMouseEvents();\n }\n }\n}\n\ninterface NgpHoverOptions {\n disabled?: Signal<boolean>;\n hoverStart?: () => void;\n hoverEnd?: () => void;\n}\n\nexport interface NgpHoverState {\n hovered: Signal<boolean>;\n}\n\n/**\n * Programatically add the hover functionality to an element.\n * This is useful in cases where we can't necessarily use a HostDirective,\n * because there is a chance the directive has already been used.\n */\nexport function setupHover({\n hoverStart,\n hoverEnd,\n disabled = signal(false),\n}: NgpHoverOptions): NgpHoverState {\n /**\n * Access the element.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the global pointer events handler.\n */\n const globalPointerEvents = inject(GlobalPointerEvents);\n\n /**\n * Access the disposable helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Store the current hover state.\n */\n const hovered = signal<boolean>(false);\n\n /**\n * Whether this element should ignore emulated mouse events.\n */\n let ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Setup event listeners.\n */\n disposables.addEventListener(elementRef.nativeElement, 'pointerenter', onPointerEnter);\n disposables.addEventListener(elementRef.nativeElement, 'pointerleave', onPointerLeave);\n disposables.addEventListener(elementRef.nativeElement, 'touchstart', onTouchStart);\n disposables.addEventListener(elementRef.nativeElement, 'mouseenter', onMouseEnter);\n disposables.addEventListener(elementRef.nativeElement, 'mouseleave', onMouseLeave);\n\n // anytime the disabled state changes to true, we must reset the hover state\n if (disabled) {\n onBooleanChange(disabled, reset);\n }\n\n // if the element is removed from the dom, we want to reset the hover state\n onDomRemoval(elementRef.nativeElement, reset);\n\n // anytime the hover state changes we want to update the attribute\n effect(() =>\n hovered()\n ? elementRef.nativeElement.setAttribute('data-hover', '')\n : elementRef.nativeElement.removeAttribute('data-hover'),\n );\n\n /**\n * Reset the hover state.\n */\n function reset(): void {\n onHoverEnd('mouse');\n }\n\n /**\n * Trigger the hover start events.\n * @param event\n * @param pointerType\n */\n function onHoverStart(event: Event, pointerType: string): void {\n if (\n disabled() ||\n pointerType === 'touch' ||\n hovered() ||\n !(event.currentTarget as Element)?.contains(event.target as Element)\n ) {\n return;\n }\n\n hovered.set(true);\n hoverStart?.();\n }\n\n /**\n * Trigger the hover end events.\n * @param pointerType\n */\n function onHoverEnd(pointerType: string): void {\n if (pointerType === 'touch' || !hovered()) {\n return;\n }\n\n hovered.set(false);\n hoverEnd?.();\n }\n\n function onPointerEnter(event: PointerEvent): void {\n if (globalPointerEvents.ignoreEmulatedMouseEvents && event.pointerType === 'mouse') {\n return;\n }\n\n onHoverStart(event, event.pointerType);\n }\n\n function onPointerLeave(event: PointerEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd(event.pointerType);\n }\n }\n\n function onTouchStart(): void {\n ignoreEmulatedMouseEvents = true;\n }\n\n function onMouseEnter(event: MouseEvent): void {\n if (!ignoreEmulatedMouseEvents && !globalPointerEvents.ignoreEmulatedMouseEvents) {\n onHoverStart(event, 'mouse');\n }\n\n ignoreEmulatedMouseEvents = false;\n }\n\n function onMouseLeave(event: MouseEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd('mouse');\n }\n }\n\n return { hovered };\n}\n","import { ElementRef, Signal, effect, inject, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\ninterface NgpPressState {\n pressed: Signal<boolean>;\n}\n\ninterface NgpPressOptions {\n disabled?: Signal<boolean>;\n pressStart?: () => void;\n pressEnd?: () => void;\n}\n\nexport function setupPress({\n pressStart,\n pressEnd,\n disabled = signal(false),\n}: NgpPressOptions): NgpPressState {\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n const disposables = injectDisposables();\n\n /**\n * Whether the element is currently pressed.\n */\n const pressed = signal<boolean>(false);\n\n // setup event listeners\n disposables.addEventListener(elementRef.nativeElement, 'pointerdown', onPointerDown);\n\n // anytime the press state changes we want to update the attribute\n effect(() =>\n pressed() && !disabled()\n ? elementRef.nativeElement.setAttribute('data-press', '')\n : elementRef.nativeElement.removeAttribute('data-press'),\n );\n\n /**\n * Reset the press state.\n */\n function reset(): void {\n // if we are not pressing, then do nothing\n if (!pressed()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n pressed.set(false);\n pressEnd?.();\n }\n\n /**\n * Store the list of disposables.\n */\n let disposableListeners: (() => void)[] = [];\n\n function onPointerDown(): void {\n if (disabled()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n\n // update the press state\n pressed.set(true);\n pressStart?.();\n\n // setup global event listeners to catch events on elements outside the directive\n const ownerDocument = elementRef.nativeElement.ownerDocument ?? document;\n\n // if the pointer up event happens on any elements, then we are no longer pressing on this element\n const pointerUp = disposables.addEventListener(\n ownerDocument,\n 'pointerup',\n () => reset(),\n false,\n );\n\n // Instead of relying on the `pointerleave` event, which is not consistently called on iOS Safari,\n // we use the `pointermove` event to determine if we are still \"pressing\".\n // By checking if the target is still within the element, we can determine if the press is ongoing.\n const pointerMove = disposables.addEventListener(\n ownerDocument,\n 'pointermove',\n () => onPointerMove as EventListener,\n false,\n );\n\n // if the pointer is cancelled, then we are no longer pressing on this element\n const pointerCancel = disposables.addEventListener(\n ownerDocument,\n 'pointercancel',\n () => reset(),\n false,\n );\n\n disposableListeners = [pointerUp, pointerMove, pointerCancel];\n }\n\n function onPointerMove(event: PointerEvent): void {\n if (\n elementRef.nativeElement !== event.target &&\n !elementRef.nativeElement.contains(event.target as Node)\n ) {\n reset();\n }\n }\n\n return { pressed };\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { CSP_NONCE, inject, Injectable, PLATFORM_ID } from '@angular/core';\n\n/**\n * A utility service for injecting styles into the document.\n * Angular doesn't allow directives to specify styles, only components.\n * As we ship directives, occasionally we need to associate styles with them.\n * This service allows us to programmatically inject styles into the document.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class StyleInjector {\n /**\n * Access the CSP nonce\n */\n private readonly cspNonce = inject(CSP_NONCE, { optional: true });\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Detect the platform.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n /**\n * Store the map of style elements with their unique identifiers.\n */\n private readonly styleElements = new Map<string, HTMLStyleElement>();\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n this.collectServerStyles();\n }\n }\n\n /**\n * Inject a style into the document.\n * @param id The unique identifier for the style.\n * @param style The style to inject.\n */\n add(id: string, style: string): void {\n if (this.styleElements.has(id)) {\n return;\n }\n\n const styleElement = this.document.createElement('style');\n styleElement.setAttribute('data-ngp-style', id);\n styleElement.textContent = style;\n\n // If a CSP nonce is provided, set it on the style element\n if (this.cspNonce) {\n styleElement.setAttribute('nonce', this.cspNonce);\n }\n\n this.document.head.appendChild(styleElement);\n this.styleElements.set(id, styleElement);\n }\n\n /**\n * Remove a style from the document.\n * @param id The unique identifier for the style.\n */\n remove(id: string): void {\n const styleElement = this.styleElements.get(id);\n\n if (styleElement) {\n this.document.head.removeChild(styleElement);\n this.styleElements.delete(id);\n }\n }\n\n /**\n * Collect any styles that were rendered by the server.\n */\n private collectServerStyles(): void {\n const styleElements = this.document.querySelectorAll<HTMLStyleElement>('style[data-ngp-style]');\n\n styleElements.forEach(styleElement => {\n const id = styleElement.getAttribute('data-ngp-style');\n\n if (id) {\n this.styleElements.set(id, styleElement);\n }\n });\n }\n}\n\nexport function injectStyleInjector(): StyleInjector {\n return inject(StyleInjector);\n}\n","import { Injector, Signal, signal } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { explicitEffect } from '../signals/explicit-effect';\n\ninterface NgpMutationObserverOptions {\n /**\n * Whether to listen for events.\n */\n disabled?: Signal<boolean>;\n /**\n * The injector to use when called from outside of the injector context.\n */\n injector?: Injector;\n /**\n * Whether the childList should be observed.\n */\n childList?: boolean;\n /**\n * Whether the subtree should be observed.\n */\n subtree?: boolean;\n /**\n * Whether the attributes should be observed.\n */\n attributes?: boolean;\n /**\n * Whether the characterData should be observed.\n */\n characterData?: boolean;\n /**\n * Whether the attributeFilter should be observed.\n */\n attributeFilter?: string[];\n}\n\n/**\n * This function sets up a mutation observer to listen for changes in the DOM.\n * It will stop listening when the `disabled` signal is true, and re-enable when it is false.\n * @param options - Options for the mutation observer\n */\nexport function fromMutationObserver(\n element: HTMLElement,\n {\n childList,\n subtree,\n attributes,\n characterData,\n disabled = signal(false),\n injector,\n }: NgpMutationObserverOptions = {},\n): Observable<MutationRecord[]> {\n return new Observable<MutationRecord[]>(observable => {\n let observer: MutationObserver | null = null;\n\n function setupOrTeardownObserver() {\n if (disabled()) {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n return;\n }\n\n observer = new MutationObserver(mutations => observable.next(mutations));\n observer.observe(element, { childList, subtree, attributes, characterData });\n }\n\n setupOrTeardownObserver();\n\n // any time the disabled state changes, we need to re-evaluate the observer\n explicitEffect([disabled], () => setupOrTeardownObserver(), { injector });\n\n return () => observer?.disconnect();\n });\n}\n","import { DestroyRef, inject, Injector, Signal, signal } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { merge } from 'rxjs';\nimport { fromMutationObserver } from './mutation-observer';\nimport { fromResizeEvent } from './resize';\n\ninterface NgpOverflowListenerOptions {\n /**\n * Whether to listen for overflow changes.\n */\n disabled?: Signal<boolean>;\n /**\n * The injector to use when called from outside of the injector context.\n */\n injector?: Injector;\n}\n\nexport function setupOverflowListener(\n element: HTMLElement,\n { disabled = signal(false), injector }: NgpOverflowListenerOptions,\n): Signal<boolean> {\n const hasOverflow = signal<boolean>(false);\n const destroyRef = injector?.get(DestroyRef) ?? inject(DestroyRef);\n\n // Merge both observables and update hasOverflow on any event\n\n merge(\n fromResizeEvent(element, { disabled, injector }),\n fromMutationObserver(element, { disabled, injector, characterData: true }),\n )\n .pipe(safeTakeUntilDestroyed(destroyRef))\n .subscribe(() =>\n hasOverflow.set(\n element.scrollWidth > element.clientWidth || element.scrollHeight > element.clientHeight,\n ),\n );\n\n return hasOverflow;\n}\n","function getScrollableAncestor(element: HTMLElement): HTMLElement | null {\n let parent = element.parentElement;\n while (parent) {\n const style = window.getComputedStyle(parent);\n if (/(auto|scroll)/.test(style.overflowY) || /(auto|scroll)/.test(style.overflowX)) {\n return parent;\n }\n parent = parent.parentElement;\n }\n return null;\n}\n\nexport function scrollIntoViewIfNeeded(element: HTMLElement): void {\n const scrollableAncestor = getScrollableAncestor(element);\n if (!scrollableAncestor) return;\n\n const parentRect = scrollableAncestor.getBoundingClientRect();\n const elementRect = element.getBoundingClientRect();\n\n if (elementRect.top < parentRect.top) {\n scrollableAncestor.scrollTop -= parentRect.top - elementRect.top;\n } else if (elementRect.bottom > parentRect.bottom) {\n scrollableAncestor.scrollTop += elementRect.bottom - parentRect.bottom;\n }\n\n if (elementRect.left < parentRect.left) {\n scrollableAncestor.scrollLeft -= parentRect.left - elementRect.left;\n } else if (elementRect.right > parentRect.right) {\n scrollableAncestor.scrollLeft += elementRect.right - parentRect.right;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B;;MCJa,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;;QAGmB,IAAA,CAAA,SAAS,GAAuB,EAAE;AAmBpD,IAAA;;AAhBC,IAAA,GAAG,CAAC,QAA0B,EAAA;AAC5B,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC/B;;AAGA,IAAA,MAAM,CAAC,QAA0B,EAAA;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC9C,QAAA,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YAChB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QACjC;IACF;;AAGA,IAAA,MAAM,IAAI,GAAA;QACR,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACpE;+GApBW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAAvB,uBAAuB,EAAA,CAAA,CAAA;;4FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC;;SAwBe,2BAA2B,GAAA;IACzC,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,uBAAuB,EAAE;AAChF;SAEgB,0BAA0B,GAAA;AACxC,IAAA,OAAO,MAAM,CAAC,uBAAuB,CAAC;AACxC;;MCzBa,gBAA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AS,CAAC,EAAE;AAClF,YAAA,OAAO,MAAM;QACf;AACA,QAAA,MAAM,GAAG,MAAM,CAAC,aAAa;IAC/B;AACA,IAAA,OAAO,IAAI;AACb;AAEM,SAAU,sBAAsB,CAAC,OAAoB,EAAA;AACzD,IAAA,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,CAAC;AACzD,IAAA,IAAI,CAAC,kBAAkB;QAAE;AAEzB,IAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC,qBAAqB,EAAE;AAC7D,IAAA,MAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,EAAE;IAEnD,IAAI,WAAW,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,EAAE;QACpC,kBAAkB,CAAC,SAAS,IAAI,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;IAClE;SAAO,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE;QACjD,kBAAkB,CAAC,SAAS,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM;IACxE;IAEA,IAAI,WAAW,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE;QACtC,kBAAkB,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;IACrE;SAAO,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE;QAC/C,kBAAkB,CAAC,UAAU,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK;IACvE;AACF;;AC9BA;;AAEG;;;;"}
|
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.78.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"angular",
|
|
8
8
|
"primitives",
|
|
@@ -83,6 +83,10 @@
|
|
|
83
83
|
"types": "./button/index.d.ts",
|
|
84
84
|
"default": "./fesm2022/ng-primitives-button.mjs"
|
|
85
85
|
},
|
|
86
|
+
"./checkbox": {
|
|
87
|
+
"types": "./checkbox/index.d.ts",
|
|
88
|
+
"default": "./fesm2022/ng-primitives-checkbox.mjs"
|
|
89
|
+
},
|
|
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"
|
|
@@ -195,10 +195,6 @@
|
|
|
195
195
|
"types": "./state/index.d.ts",
|
|
196
196
|
"default": "./fesm2022/ng-primitives-state.mjs"
|
|
197
197
|
},
|
|
198
|
-
"./textarea": {
|
|
199
|
-
"types": "./textarea/index.d.ts",
|
|
200
|
-
"default": "./fesm2022/ng-primitives-textarea.mjs"
|
|
201
|
-
},
|
|
202
198
|
"./switch": {
|
|
203
199
|
"types": "./switch/index.d.ts",
|
|
204
200
|
"default": "./fesm2022/ng-primitives-switch.mjs"
|
|
@@ -207,6 +203,10 @@
|
|
|
207
203
|
"types": "./tabs/index.d.ts",
|
|
208
204
|
"default": "./fesm2022/ng-primitives-tabs.mjs"
|
|
209
205
|
},
|
|
206
|
+
"./textarea": {
|
|
207
|
+
"types": "./textarea/index.d.ts",
|
|
208
|
+
"default": "./fesm2022/ng-primitives-textarea.mjs"
|
|
209
|
+
},
|
|
210
210
|
"./toast": {
|
|
211
211
|
"types": "./toast/index.d.ts",
|
|
212
212
|
"default": "./fesm2022/ng-primitives-toast.mjs"
|
|
@@ -219,14 +219,14 @@
|
|
|
219
219
|
"types": "./toggle-group/index.d.ts",
|
|
220
220
|
"default": "./fesm2022/ng-primitives-toggle-group.mjs"
|
|
221
221
|
},
|
|
222
|
-
"./tooltip": {
|
|
223
|
-
"types": "./tooltip/index.d.ts",
|
|
224
|
-
"default": "./fesm2022/ng-primitives-tooltip.mjs"
|
|
225
|
-
},
|
|
226
222
|
"./toolbar": {
|
|
227
223
|
"types": "./toolbar/index.d.ts",
|
|
228
224
|
"default": "./fesm2022/ng-primitives-toolbar.mjs"
|
|
229
225
|
},
|
|
226
|
+
"./tooltip": {
|
|
227
|
+
"types": "./tooltip/index.d.ts",
|
|
228
|
+
"default": "./fesm2022/ng-primitives-tooltip.mjs"
|
|
229
|
+
},
|
|
230
230
|
"./utils": {
|
|
231
231
|
"types": "./utils/index.d.ts",
|
|
232
232
|
"default": "./fesm2022/ng-primitives-utils.mjs"
|