ng-primitives 0.96.0 → 0.98.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/index.d.ts +6 -2
- package/avatar/index.d.ts +1 -1
- package/fesm2022/ng-primitives-a11y.mjs +22 -21
- package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
- package/fesm2022/ng-primitives-avatar.mjs +2 -2
- package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/ng-primitives-combobox.mjs +8 -14
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-dialog.mjs +4 -0
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-interactions.mjs +1 -1
- package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +15 -3
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +15 -3
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +49 -11
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +8 -14
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-state.mjs +39 -33
- package/fesm2022/ng-primitives-state.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +15 -3
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/ng-primitives-utils.mjs +29 -10
- package/fesm2022/ng-primitives-utils.mjs.map +1 -1
- package/menu/index.d.ts +20 -2
- package/package.json +1 -1
- package/popover/index.d.ts +14 -2
- package/portal/index.d.ts +46 -2
- package/schematics/ng-generate/templates/toast/toast.__fileSuffix@dasherize__.ts.template +72 -8
- package/toast/index.d.ts +1 -1
- package/tooltip/index.d.ts +14 -2
- package/utils/index.d.ts +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, Directive, computed, HostListener, inject, ViewContainerRef, TemplateRef, Injector, signal, InjectionToken, output
|
|
2
|
+
import { input, booleanAttribute, Directive, computed, HostListener, inject, ViewContainerRef, TemplateRef, Injector, signal, InjectionToken, output } from '@angular/core';
|
|
3
3
|
import { ngpFormControl } from 'ng-primitives/form-field';
|
|
4
4
|
import { ngpInteractions } from 'ng-primitives/interactions';
|
|
5
5
|
import { uniqueId } from 'ng-primitives/utils';
|
|
@@ -407,6 +407,13 @@ class NgpSelect {
|
|
|
407
407
|
// we must wrap the signal in a computed to ensure it is not used before it is defined
|
|
408
408
|
disabled: computed(() => this.state.disabled()),
|
|
409
409
|
items: this.options,
|
|
410
|
+
onActiveDescendantChange: activeItem => {
|
|
411
|
+
const isPositioned = this.portal()?.overlay()?.isPositioned() ?? false;
|
|
412
|
+
if (!isPositioned || !activeItem) {
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
this.activeDescendantManager.activeItem()?.scrollIntoView?.();
|
|
416
|
+
},
|
|
410
417
|
});
|
|
411
418
|
/** The state of the select. */
|
|
412
419
|
this.state = selectState(this);
|
|
@@ -418,19 +425,6 @@ class NgpSelect {
|
|
|
418
425
|
disabled: this.state.disabled,
|
|
419
426
|
});
|
|
420
427
|
ngpFormControl({ id: this.state.id, disabled: this.state.disabled });
|
|
421
|
-
// any time the active descendant changes, ensure we scroll it into view
|
|
422
|
-
// perform after next render to ensure the DOM is updated
|
|
423
|
-
// e.g. the dropdown is open before the option is scrolled into view
|
|
424
|
-
afterRenderEffect({
|
|
425
|
-
write: () => {
|
|
426
|
-
const isPositioned = this.portal()?.overlay()?.isPositioned() ?? false;
|
|
427
|
-
const activeItem = this.activeDescendantManager.activeItem();
|
|
428
|
-
if (!isPositioned || !activeItem) {
|
|
429
|
-
return;
|
|
430
|
-
}
|
|
431
|
-
this.activeDescendantManager.activeItem()?.scrollIntoView?.();
|
|
432
|
-
},
|
|
433
|
-
});
|
|
434
428
|
}
|
|
435
429
|
/**
|
|
436
430
|
* Open the dropdown.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-select.mjs","sources":["../../../../packages/ng-primitives/select/src/native-select/native-select-state.ts","../../../../packages/ng-primitives/select/src/native-select/native-select.ts","../../../../packages/ng-primitives/select/src/select/select-state.ts","../../../../packages/ng-primitives/select/src/select-dropdown/select-dropdown.ts","../../../../packages/ng-primitives/select/src/select-option/select-option.ts","../../../../packages/ng-primitives/select/src/select-portal/select-portal.ts","../../../../packages/ng-primitives/select/src/config/select-config.ts","../../../../packages/ng-primitives/select/src/select/select.ts","../../../../packages/ng-primitives/select/src/ng-primitives-select.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpNativeSelect } from './native-select';\n\n/**\n * The state token for the Select primitive.\n */\nexport const NgpNativeSelectStateToken = createStateToken<NgpNativeSelect>('Select');\n\n/**\n * Provides the Select state.\n */\nexport const provideNativeSelectState = createStateProvider(NgpNativeSelectStateToken);\n\n/**\n * Injects the Select state.\n */\nexport const injectNativeSelectState =\n createStateInjector<NgpNativeSelect>(NgpNativeSelectStateToken);\n\n/**\n * The Select state registration function.\n */\nexport const selectNativeSelectState = createState(NgpNativeSelectStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { provideNativeSelectState, selectNativeSelectState } from './native-select-state';\n\n/**\n * Apply the `ngpNativeSelect` directive to a select element that you want to enhance.\n */\n@Directive({\n selector: 'select[ngpNativeSelect]',\n exportAs: 'ngpNativeSelect',\n providers: [provideNativeSelectState()],\n host: {\n '[attr.disabled]': 'state.disabled() || null',\n },\n})\nexport class NgpNativeSelect {\n /**\n * The id of the select. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-native-select'));\n\n /**\n * Whether the select is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpNativeSelectDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The select state.\n */\n protected readonly state = selectNativeSelectState<NgpNativeSelect>(this);\n\n constructor() {\n ngpInteractions({\n hover: true,\n press: true,\n focus: true,\n focusVisible: true,\n disabled: this.state.disabled,\n });\n ngpFormControl({ id: this.state.id, disabled: this.state.disabled });\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpSelect } from './select';\n\n/**\n * The state token for the Select primitive.\n */\nexport const NgpSelectStateToken = createStateToken<NgpSelect>('Select');\n\n/**\n * Provides the Select state.\n */\nexport const provideSelectState = createStateProvider(NgpSelectStateToken);\n\n/**\n * Injects the Select state.\n */\nexport const injectSelectState = createStateInjector<NgpSelect>(NgpSelectStateToken);\n\n/**\n * The Select state registration function.\n */\nexport const selectState = createState(NgpSelectStateToken);\n","import { Directive, input } from '@angular/core';\nimport { injectElementRef, observeResize } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectState } from '../select/select-state';\n\n@Directive({\n selector: '[ngpSelectDropdown]',\n exportAs: 'ngpSelectDropdown',\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-select-transform-origin]': 'state().overlay()?.transformOrigin()',\n '[style.--ngp-select-width.px]': 'selectDimensions().width',\n },\n})\nexport class NgpSelectDropdown {\n /** Access the select state. */\n protected readonly state = injectSelectState();\n\n /** The dimensions of the select. */\n protected readonly selectDimensions = observeResize(() => this.state().elementRef.nativeElement);\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-select-dropdown'));\n\n constructor() {\n this.state().registerDropdown(this);\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 { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectState } from '../select/select-state';\n\n@Directive({\n selector: '[ngpSelectOption]',\n exportAs: 'ngpSelectOption',\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 NgpSelectOption implements OnInit, OnDestroy, NgpActivatable {\n /** Access the select state. */\n protected readonly state = injectSelectState();\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-select-option'));\n\n /** @required The value of the option. */\n readonly value = input<any>(undefined, {\n alias: 'ngpSelectOptionValue',\n });\n\n /** The disabled state of the option. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectOptionDisabled',\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 const selectValue = this.state().value();\n return (\n Array.isArray(selectValue) && selectValue.some(v => this.state().compareWith()(value, v))\n );\n }\n\n return this.state().compareWith()(value, this.state().value());\n });\n\n constructor() {\n this.state().registerOption(this);\n\n ngpInteractions({\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 'ngpSelectOption: 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 { injectSelectState } from '../select/select-state';\n\n@Directive({\n selector: '[ngpSelectPortal]',\n exportAs: 'ngpSelectPortal',\n})\nexport class NgpSelectPortal implements OnDestroy {\n /** Access the select state. */\n private readonly state = injectSelectState();\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 { Placement } from '@floating-ui/dom';\n\nexport interface NgpSelectConfig {\n /**\n * The default placement for the select dropdown.\n * @default 'bottom'\n */\n placement: Placement;\n\n /**\n * The container element or selector for the select 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 defaultSelectConfig: NgpSelectConfig = {\n placement: 'bottom',\n container: 'body',\n};\n\nexport const NgpSelectConfigToken = new InjectionToken<NgpSelectConfig>('NgpSelectConfigToken');\n\n/**\n * Provide the default Select configuration\n * @param config The Select configuration\n * @returns The provider\n */\nexport function provideSelectConfig(config: Partial<NgpSelectConfig>): Provider[] {\n return [\n {\n provide: NgpSelectConfigToken,\n useValue: { ...defaultSelectConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Select configuration\n * @returns The global Select configuration\n */\nexport function injectSelectConfig(): NgpSelectConfig {\n return inject(NgpSelectConfigToken, { optional: true }) ?? defaultSelectConfig;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n input,\n output,\n signal,\n} from '@angular/core';\nimport type { Placement } from '@floating-ui/dom';\nimport { activeDescendantManager } from 'ng-primitives/a11y';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectConfig } from '../config/select-config';\nimport type { NgpSelectDropdown } from '../select-dropdown/select-dropdown';\nimport { NgpSelectOption } from '../select-option/select-option';\nimport type { NgpSelectPortal } from '../select-portal/select-portal';\nimport { provideSelectState, selectState } from './select-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: '[ngpSelect]',\n exportAs: 'ngpSelect',\n providers: [provideSelectState()],\n host: {\n role: 'combobox',\n '[id]': 'state.id()',\n '[attr.aria-expanded]': 'open()',\n '[attr.aria-controls]': 'open() ? dropdown()?.id() : undefined',\n '[attr.aria-activedescendant]':\n 'open() ? activeDescendantManager.activeDescendant() : undefined',\n '[attr.tabindex]': 'state.disabled() ? -1 : 0',\n '[attr.data-open]': 'open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state.multiple() ? \"\" : undefined',\n },\n})\nexport class NgpSelect {\n /** Access the select configuration. */\n protected readonly config = injectSelectConfig();\n\n /** @internal Access the select element. */\n readonly elementRef = injectElementRef();\n\n /** Access the injector. */\n protected readonly injector = inject(Injector);\n\n /** The unique id of the select. */\n readonly id = input(uniqueId('ngp-select'));\n\n /** The value of the select. */\n readonly value = input<T>(undefined, {\n alias: 'ngpSelectValue',\n });\n\n /** Event emitted when the value changes. */\n readonly valueChange = output<T>({\n alias: 'ngpSelectValueChange',\n });\n\n /** Whether the select is multiple selection. */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectMultiple',\n transform: booleanAttribute,\n });\n\n /** Whether the select is disabled. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectDisabled',\n transform: booleanAttribute,\n });\n\n /** Emit when the dropdown open state changes. */\n readonly openChange = output<boolean>({\n alias: 'ngpSelectOpenChange',\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: 'ngpSelectCompareWith',\n });\n\n /** The position of the dropdown. */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpSelectDropdownPlacement',\n });\n\n /** The container for the dropdown. */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpSelectDropdownContainer',\n });\n\n /**\n * Store the select portal.\n * @internal\n */\n readonly portal = signal<NgpSelectPortal | undefined>(undefined);\n\n /**\n * Store the select dropdown.\n * @internal\n */\n readonly dropdown = signal<NgpSelectDropdown | undefined>(undefined);\n\n /**\n * Store the select options.\n * @internal\n */\n readonly options = signal<NgpSelectOption[]>([]);\n\n /**\n * Access the overlay\n * @internal\n */\n readonly overlay = computed(() => this.portal()?.overlay());\n\n /**\n * The open state of the select.\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 state of the select. */\n protected readonly state = selectState<NgpSelect>(this);\n\n constructor() {\n ngpInteractions({\n focus: true,\n focusWithin: true,\n hover: true,\n press: true,\n disabled: this.state.disabled,\n });\n\n ngpFormControl({ id: this.state.id, disabled: this.state.disabled });\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 @HostListener('click')\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: NgpSelectOption | 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: NgpSelectOption): void {\n // if the select is disabled or the option is not selected, do nothing\n // if the select 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: NgpSelectOption): 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: NgpSelectOption): 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 select.\n * @param portal The dropdown portal.\n * @internal\n */\n registerPortal(portal: NgpSelectPortal): void {\n this.portal.set(portal);\n }\n\n /**\n * Register the dropdown with the select.\n * @param dropdown The dropdown to register.\n * @internal\n */\n registerDropdown(dropdown: NgpSelectDropdown): void {\n this.dropdown.set(dropdown);\n }\n\n /**\n * Register an option with the select.\n * @param option The option to register.\n * @internal\n */\n registerOption(option: NgpSelectOption): void {\n this.options.update(options => [...options, option]);\n }\n\n /**\n * Unregister an option from the select.\n * @param option The option to unregister.\n * @internal\n */\n unregisterOption(option: NgpSelectOption): void {\n this.options.update(options => options.filter(o => o !== option));\n }\n\n /**\n * Focus the select.\n * @internal\n */\n focus(): void {\n this.elementRef.nativeElement.focus();\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.open()) {\n this.activateNextOption();\n } else {\n this.openDropdown();\n }\n event.preventDefault();\n break;\n case 'ArrowUp':\n if (this.open()) {\n this.activatePreviousOption();\n } else {\n this.openDropdown();\n this.activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Home':\n if (this.open()) {\n this.activeDescendantManager.first();\n }\n event.preventDefault();\n break;\n case 'End':\n if (this.open()) {\n this.activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Enter':\n if (this.open()) {\n this.selectOption(this.activeDescendantManager.activeItem());\n } else {\n this.openDropdown();\n }\n event.preventDefault();\n break;\n case ' ':\n this.toggleDropdown();\n event.preventDefault();\n break;\n }\n }\n\n @HostListener('blur', ['$event'])\n protected onBlur(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 (relatedTarget && this.dropdown()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n this.closeDropdown();\n event.preventDefault();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAQA;;AAEG;AACI,MAAM,yBAAyB,GAAG,gBAAgB,CAAkB,QAAQ,CAAC;AAEpF;;AAEG;MACU,wBAAwB,GAAG,mBAAmB,CAAC,yBAAyB;AAErF;;AAEG;MACU,uBAAuB,GAClC,mBAAmB,CAAkB,yBAAyB;AAEhE;;AAEG;AACI,MAAM,uBAAuB,GAAG,WAAW,CAAC,yBAAyB,CAAC;;ACpB7E;;AAEG;MASU,eAAe,CAAA;AAmB1B,IAAA,WAAA,GAAA;AAlBA;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,QAAQ,CAAC,mBAAmB,CAAC,8CAAC;AAE1D;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,UAAA,EACpD,KAAK,EAAE,yBAAyB;gBAChC,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAF2B;AACtD,gBAAA,KAAK,EAAE,yBAAyB;AAChC,gBAAA,SAAS,EAAE,gBAAgB;AAC5B,aAAA,CAAA,CAAA,CAAC;AAEF;;AAEG;AACgB,QAAA,IAAA,CAAA,KAAK,GAAG,uBAAuB,CAAkB,IAAI,CAAC;AAGvE,QAAA,eAAe,CAAC;AACd,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ;AAC9B,SAAA,CAAC;AACF,QAAA,cAAc,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,KAA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D,qBAAA;AACF,iBAAA;;sBA8KE,YAAY;uBAAC,OAAO;;sBAwNpB,YAAY;uBAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;;sBA+ClC,YAAY;uBAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;;;AC5elC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-select.mjs","sources":["../../../../packages/ng-primitives/select/src/native-select/native-select-state.ts","../../../../packages/ng-primitives/select/src/native-select/native-select.ts","../../../../packages/ng-primitives/select/src/select/select-state.ts","../../../../packages/ng-primitives/select/src/select-dropdown/select-dropdown.ts","../../../../packages/ng-primitives/select/src/select-option/select-option.ts","../../../../packages/ng-primitives/select/src/select-portal/select-portal.ts","../../../../packages/ng-primitives/select/src/config/select-config.ts","../../../../packages/ng-primitives/select/src/select/select.ts","../../../../packages/ng-primitives/select/src/ng-primitives-select.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpNativeSelect } from './native-select';\n\n/**\n * The state token for the Select primitive.\n */\nexport const NgpNativeSelectStateToken = createStateToken<NgpNativeSelect>('Select');\n\n/**\n * Provides the Select state.\n */\nexport const provideNativeSelectState = createStateProvider(NgpNativeSelectStateToken);\n\n/**\n * Injects the Select state.\n */\nexport const injectNativeSelectState =\n createStateInjector<NgpNativeSelect>(NgpNativeSelectStateToken);\n\n/**\n * The Select state registration function.\n */\nexport const selectNativeSelectState = createState(NgpNativeSelectStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { provideNativeSelectState, selectNativeSelectState } from './native-select-state';\n\n/**\n * Apply the `ngpNativeSelect` directive to a select element that you want to enhance.\n */\n@Directive({\n selector: 'select[ngpNativeSelect]',\n exportAs: 'ngpNativeSelect',\n providers: [provideNativeSelectState()],\n host: {\n '[attr.disabled]': 'state.disabled() || null',\n },\n})\nexport class NgpNativeSelect {\n /**\n * The id of the select. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-native-select'));\n\n /**\n * Whether the select is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpNativeSelectDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The select state.\n */\n protected readonly state = selectNativeSelectState<NgpNativeSelect>(this);\n\n constructor() {\n ngpInteractions({\n hover: true,\n press: true,\n focus: true,\n focusVisible: true,\n disabled: this.state.disabled,\n });\n ngpFormControl({ id: this.state.id, disabled: this.state.disabled });\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpSelect } from './select';\n\n/**\n * The state token for the Select primitive.\n */\nexport const NgpSelectStateToken = createStateToken<NgpSelect>('Select');\n\n/**\n * Provides the Select state.\n */\nexport const provideSelectState = createStateProvider(NgpSelectStateToken);\n\n/**\n * Injects the Select state.\n */\nexport const injectSelectState = createStateInjector<NgpSelect>(NgpSelectStateToken);\n\n/**\n * The Select state registration function.\n */\nexport const selectState = createState(NgpSelectStateToken);\n","import { Directive, input } from '@angular/core';\nimport { injectElementRef, observeResize } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectState } from '../select/select-state';\n\n@Directive({\n selector: '[ngpSelectDropdown]',\n exportAs: 'ngpSelectDropdown',\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-select-transform-origin]': 'state().overlay()?.transformOrigin()',\n '[style.--ngp-select-width.px]': 'selectDimensions().width',\n },\n})\nexport class NgpSelectDropdown {\n /** Access the select state. */\n protected readonly state = injectSelectState();\n\n /** The dimensions of the select. */\n protected readonly selectDimensions = observeResize(() => this.state().elementRef.nativeElement);\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-select-dropdown'));\n\n constructor() {\n this.state().registerDropdown(this);\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 { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectState } from '../select/select-state';\n\n@Directive({\n selector: '[ngpSelectOption]',\n exportAs: 'ngpSelectOption',\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 NgpSelectOption implements OnInit, OnDestroy, NgpActivatable {\n /** Access the select state. */\n protected readonly state = injectSelectState();\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-select-option'));\n\n /** @required The value of the option. */\n readonly value = input<any>(undefined, {\n alias: 'ngpSelectOptionValue',\n });\n\n /** The disabled state of the option. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectOptionDisabled',\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 const selectValue = this.state().value();\n return (\n Array.isArray(selectValue) && selectValue.some(v => this.state().compareWith()(value, v))\n );\n }\n\n return this.state().compareWith()(value, this.state().value());\n });\n\n constructor() {\n this.state().registerOption(this);\n\n ngpInteractions({\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 'ngpSelectOption: 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 { injectSelectState } from '../select/select-state';\n\n@Directive({\n selector: '[ngpSelectPortal]',\n exportAs: 'ngpSelectPortal',\n})\nexport class NgpSelectPortal implements OnDestroy {\n /** Access the select state. */\n private readonly state = injectSelectState();\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 { Placement } from '@floating-ui/dom';\n\nexport interface NgpSelectConfig {\n /**\n * The default placement for the select dropdown.\n * @default 'bottom'\n */\n placement: Placement;\n\n /**\n * The container element or selector for the select 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 defaultSelectConfig: NgpSelectConfig = {\n placement: 'bottom',\n container: 'body',\n};\n\nexport const NgpSelectConfigToken = new InjectionToken<NgpSelectConfig>('NgpSelectConfigToken');\n\n/**\n * Provide the default Select configuration\n * @param config The Select configuration\n * @returns The provider\n */\nexport function provideSelectConfig(config: Partial<NgpSelectConfig>): Provider[] {\n return [\n {\n provide: NgpSelectConfigToken,\n useValue: { ...defaultSelectConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Select configuration\n * @returns The global Select configuration\n */\nexport function injectSelectConfig(): NgpSelectConfig {\n return inject(NgpSelectConfigToken, { optional: true }) ?? defaultSelectConfig;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n input,\n output,\n signal,\n} from '@angular/core';\nimport type { Placement } from '@floating-ui/dom';\nimport { activeDescendantManager } from 'ng-primitives/a11y';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectConfig } from '../config/select-config';\nimport type { NgpSelectDropdown } from '../select-dropdown/select-dropdown';\nimport { NgpSelectOption } from '../select-option/select-option';\nimport type { NgpSelectPortal } from '../select-portal/select-portal';\nimport { provideSelectState, selectState } from './select-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: '[ngpSelect]',\n exportAs: 'ngpSelect',\n providers: [provideSelectState()],\n host: {\n role: 'combobox',\n '[id]': 'state.id()',\n '[attr.aria-expanded]': 'open()',\n '[attr.aria-controls]': 'open() ? dropdown()?.id() : undefined',\n '[attr.aria-activedescendant]':\n 'open() ? activeDescendantManager.activeDescendant() : undefined',\n '[attr.tabindex]': 'state.disabled() ? -1 : 0',\n '[attr.data-open]': 'open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state.multiple() ? \"\" : undefined',\n },\n})\nexport class NgpSelect {\n /** Access the select configuration. */\n protected readonly config = injectSelectConfig();\n\n /** @internal Access the select element. */\n readonly elementRef = injectElementRef();\n\n /** Access the injector. */\n protected readonly injector = inject(Injector);\n\n /** The unique id of the select. */\n readonly id = input(uniqueId('ngp-select'));\n\n /** The value of the select. */\n readonly value = input<T>(undefined, {\n alias: 'ngpSelectValue',\n });\n\n /** Event emitted when the value changes. */\n readonly valueChange = output<T>({\n alias: 'ngpSelectValueChange',\n });\n\n /** Whether the select is multiple selection. */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectMultiple',\n transform: booleanAttribute,\n });\n\n /** Whether the select is disabled. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectDisabled',\n transform: booleanAttribute,\n });\n\n /** Emit when the dropdown open state changes. */\n readonly openChange = output<boolean>({\n alias: 'ngpSelectOpenChange',\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: 'ngpSelectCompareWith',\n });\n\n /** The position of the dropdown. */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpSelectDropdownPlacement',\n });\n\n /** The container for the dropdown. */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpSelectDropdownContainer',\n });\n\n /**\n * Store the select portal.\n * @internal\n */\n readonly portal = signal<NgpSelectPortal | undefined>(undefined);\n\n /**\n * Store the select dropdown.\n * @internal\n */\n readonly dropdown = signal<NgpSelectDropdown | undefined>(undefined);\n\n /**\n * Store the select options.\n * @internal\n */\n readonly options = signal<NgpSelectOption[]>([]);\n\n /**\n * Access the overlay\n * @internal\n */\n readonly overlay = computed(() => this.portal()?.overlay());\n\n /**\n * The open state of the select.\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 onActiveDescendantChange: activeItem => {\n const isPositioned = this.portal()?.overlay()?.isPositioned() ?? false;\n\n if (!isPositioned || !activeItem) {\n return;\n }\n\n this.activeDescendantManager.activeItem()?.scrollIntoView?.();\n },\n });\n\n /** The state of the select. */\n protected readonly state = selectState<NgpSelect>(this);\n\n constructor() {\n ngpInteractions({\n focus: true,\n focusWithin: true,\n hover: true,\n press: true,\n disabled: this.state.disabled,\n });\n\n ngpFormControl({ id: this.state.id, disabled: this.state.disabled });\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 @HostListener('click')\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: NgpSelectOption | 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: NgpSelectOption): void {\n // if the select is disabled or the option is not selected, do nothing\n // if the select 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: NgpSelectOption): 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: NgpSelectOption): 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 select.\n * @param portal The dropdown portal.\n * @internal\n */\n registerPortal(portal: NgpSelectPortal): void {\n this.portal.set(portal);\n }\n\n /**\n * Register the dropdown with the select.\n * @param dropdown The dropdown to register.\n * @internal\n */\n registerDropdown(dropdown: NgpSelectDropdown): void {\n this.dropdown.set(dropdown);\n }\n\n /**\n * Register an option with the select.\n * @param option The option to register.\n * @internal\n */\n registerOption(option: NgpSelectOption): void {\n this.options.update(options => [...options, option]);\n }\n\n /**\n * Unregister an option from the select.\n * @param option The option to unregister.\n * @internal\n */\n unregisterOption(option: NgpSelectOption): void {\n this.options.update(options => options.filter(o => o !== option));\n }\n\n /**\n * Focus the select.\n * @internal\n */\n focus(): void {\n this.elementRef.nativeElement.focus();\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.open()) {\n this.activateNextOption();\n } else {\n this.openDropdown();\n }\n event.preventDefault();\n break;\n case 'ArrowUp':\n if (this.open()) {\n this.activatePreviousOption();\n } else {\n this.openDropdown();\n this.activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Home':\n if (this.open()) {\n this.activeDescendantManager.first();\n }\n event.preventDefault();\n break;\n case 'End':\n if (this.open()) {\n this.activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Enter':\n if (this.open()) {\n this.selectOption(this.activeDescendantManager.activeItem());\n } else {\n this.openDropdown();\n }\n event.preventDefault();\n break;\n case ' ':\n this.toggleDropdown();\n event.preventDefault();\n break;\n }\n }\n\n @HostListener('blur', ['$event'])\n protected onBlur(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 (relatedTarget && this.dropdown()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n this.closeDropdown();\n event.preventDefault();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAQA;;AAEG;AACI,MAAM,yBAAyB,GAAG,gBAAgB,CAAkB,QAAQ,CAAC;AAEpF;;AAEG;MACU,wBAAwB,GAAG,mBAAmB,CAAC,yBAAyB;AAErF;;AAEG;MACU,uBAAuB,GAClC,mBAAmB,CAAkB,yBAAyB;AAEhE;;AAEG;AACI,MAAM,uBAAuB,GAAG,WAAW,CAAC,yBAAyB,CAAC;;ACpB7E;;AAEG;MASU,eAAe,CAAA;AAmB1B,IAAA,WAAA,GAAA;AAlBA;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,QAAQ,CAAC,mBAAmB,CAAC,8CAAC;AAE1D;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,UAAA,EACpD,KAAK,EAAE,yBAAyB;gBAChC,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAF2B;AACtD,gBAAA,KAAK,EAAE,yBAAyB;AAChC,gBAAA,SAAS,EAAE,gBAAgB;AAC5B,aAAA,CAAA,CAAA,CAAC;AAEF;;AAEG;AACgB,QAAA,IAAA,CAAA,KAAK,GAAG,uBAAuB,CAAkB,IAAI,CAAC;AAGvE,QAAA,eAAe,CAAC;AACd,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ;AAC9B,SAAA,CAAC;AACF,QAAA,cAAc,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,EAAE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EAAE,CAAC,QAAQ,CAAC;;;ACpelC;;AAEG;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { coerceElement } from '@angular/cdk/coercion';
|
|
2
|
-
import {
|
|
2
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
3
|
+
import { InjectionToken, signal, inject, computed, linkedSignal, isSignal, Injector, ElementRef, runInInjectionContext, NgZone, DestroyRef, afterRenderEffect, forwardRef, ChangeDetectorRef, PLATFORM_ID, effect } from '@angular/core';
|
|
3
4
|
import { Subject } from 'rxjs';
|
|
4
5
|
|
|
5
6
|
/* eslint-disable @angular-eslint/no-uncalled-signals */
|
|
@@ -192,11 +193,9 @@ function setAttribute(element, attr, value) {
|
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
function attrBinding(element, attr, value) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
setAttribute(element, attr, valueResult?.toString() ?? null);
|
|
199
|
-
},
|
|
196
|
+
isomorphicEffect(() => {
|
|
197
|
+
const valueResult = typeof value === 'function' ? value() : value;
|
|
198
|
+
setAttribute(element, attr, valueResult?.toString() ?? null);
|
|
200
199
|
});
|
|
201
200
|
}
|
|
202
201
|
function getStyleUnit(style) {
|
|
@@ -227,39 +226,35 @@ function getStyleUnit(style) {
|
|
|
227
226
|
return '';
|
|
228
227
|
}
|
|
229
228
|
function styleBinding(element, style, value) {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
},
|
|
229
|
+
isomorphicEffect(() => {
|
|
230
|
+
const styleValue = typeof value === 'function' ? value() : value;
|
|
231
|
+
// we should look for units in the style name, just like Angular does e.g. width.px
|
|
232
|
+
const styleUnit = getStyleUnit(style);
|
|
233
|
+
const styleName = styleUnit ? style.replace(`.${styleUnit}`, '') : style;
|
|
234
|
+
if (styleValue !== null) {
|
|
235
|
+
element.nativeElement.style.setProperty(styleName, styleValue + styleUnit);
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
element.nativeElement.style.removeProperty(styleName);
|
|
239
|
+
}
|
|
243
240
|
});
|
|
244
241
|
}
|
|
245
242
|
function dataBinding(element, attr, value) {
|
|
246
243
|
if (!attr.startsWith('data-')) {
|
|
247
244
|
throw new Error(`dataBinding: attribute "${attr}" must start with "data-"`);
|
|
248
245
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
setAttribute(element, attr, valueResult);
|
|
262
|
-
},
|
|
246
|
+
isomorphicEffect(() => {
|
|
247
|
+
let valueResult = typeof value === 'function' ? value() : value;
|
|
248
|
+
if (valueResult === false) {
|
|
249
|
+
valueResult = null;
|
|
250
|
+
}
|
|
251
|
+
else if (valueResult === true) {
|
|
252
|
+
valueResult = '';
|
|
253
|
+
}
|
|
254
|
+
else if (valueResult !== null && typeof valueResult !== 'string') {
|
|
255
|
+
valueResult = String(valueResult);
|
|
256
|
+
}
|
|
257
|
+
setAttribute(element, attr, valueResult);
|
|
263
258
|
});
|
|
264
259
|
}
|
|
265
260
|
function listener(element, event, handler, options) {
|
|
@@ -329,6 +324,17 @@ function emitter({ injector = inject(Injector), } = {}) {
|
|
|
329
324
|
};
|
|
330
325
|
});
|
|
331
326
|
}
|
|
327
|
+
function isomorphicEffect(callback) {
|
|
328
|
+
const injector = inject(Injector);
|
|
329
|
+
const platformId = injector.get(PLATFORM_ID);
|
|
330
|
+
if (isPlatformBrowser(platformId)) {
|
|
331
|
+
afterRenderEffect(() => callback());
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
// On the server, we just run the effect immediately
|
|
335
|
+
effect(() => callback());
|
|
336
|
+
}
|
|
337
|
+
}
|
|
332
338
|
|
|
333
339
|
/**
|
|
334
340
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-state.mjs","sources":["../../../../packages/ng-primitives/state/src/index.ts","../../../../packages/ng-primitives/state/src/ng-primitives-state.ts"],"sourcesContent":["/* eslint-disable @angular-eslint/no-uncalled-signals */\nimport { coerceElement } from '@angular/cdk/coercion';\nimport {\n afterRenderEffect,\n ChangeDetectorRef,\n computed,\n DestroyRef,\n ElementRef,\n FactoryProvider,\n forwardRef,\n inject,\n InjectionToken,\n InjectOptions,\n Injector,\n InputSignal,\n InputSignalWithTransform,\n isSignal,\n linkedSignal,\n NgZone,\n ProviderToken,\n runInInjectionContext,\n signal,\n Signal,\n WritableSignal,\n} from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\n/**\n * This converts the state object to a writable state object.\n * This means that inputs become signals which are writable.\n */\nexport type State<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof T]: T[K] extends InputSignalWithTransform<infer U, any>\n ? WritableSignal<U>\n : T[K] extends InputSignal<infer R>\n ? WritableSignal<R>\n : T[K];\n};\n\n/**\n * This is similar to the state object, but we don't expose properties that are not\n * inputs.\n */\nexport type CreatedState<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof T]: T[K] extends InputSignalWithTransform<infer U, any>\n ? WritableSignal<U>\n : T[K] extends InputSignal<infer R>\n ? WritableSignal<R>\n : never;\n};\n\nexport type InjectedState<T> = Signal<State<T>>;\n\n/**\n * Create a new injection token for the state.\n * @param description The description of the token\n */\nexport function createStateToken<T>(description: string): InjectionToken<T> {\n return new InjectionToken<Signal<State<T>>>(`Ngp${description}StateToken`);\n}\n\nexport interface CreateStateProviderOptions {\n /**\n * Whether we should check for the state in the parent injector.\n */\n inherit?: boolean;\n}\n\n/**\n * Create a new provider for the state. It first tries to inject the state from the parent injector,\n * as this allows for the state to be hoisted to a higher level in the component tree. This can\n * be useful to avoid issues where the injector can't be shared in some cases when ng-content is used.\n * @param token The token for the state\n */\nexport function createStateProvider<T>(\n token: ProviderToken<T>,\n): (options?: CreateStateProviderOptions) => FactoryProvider {\n return ({ inherit }: CreateStateProviderOptions = {}) => ({\n provide: token,\n useFactory: () => {\n if (inherit === false) {\n // if we are not checking the parent, we want to create a new state\n return signal({});\n }\n // if we are checking the parent, we want to check if the state is already defined\n return inject(token, { optional: true, skipSelf: true }) ?? signal({});\n },\n });\n}\n\ntype CreateStateInjectorOptions = {\n /**\n * Whether the state may not be immediately available. This can happen when the child is instantiated before the parent.\n */\n deferred?: boolean;\n};\n\n/**\n * Create a new state injector for the state.\n * @param token The token for the state\n */\nexport function createStateInjector<T>(\n token: ProviderToken<State<T>>,\n options: { deferred: true },\n): <U = T>(injectOptions?: InjectOptions) => Signal<State<U> | undefined>;\nexport function createStateInjector<T>(\n token: ProviderToken<State<T>>,\n options?: CreateStateInjectorOptions,\n): <U = T>(injectOptions?: InjectOptions) => Signal<State<U>>;\nexport function createStateInjector<T>(\n token: ProviderToken<State<T>>,\n options: CreateStateInjectorOptions = {},\n): <U = T>(injectOptions?: InjectOptions) => Signal<State<U> | undefined> {\n return <U = T>(injectOptions: InjectOptions = {}) => {\n const value = inject(token, injectOptions) as Signal<State<U> | undefined> | null;\n\n if (options.deferred) {\n return computed(() =>\n value && Object.keys(value() ?? {}).length === 0 ? undefined : value?.(),\n ) as Signal<State<U> | undefined>;\n }\n\n return (value as Signal<State<U>>) ?? signal(undefined);\n };\n}\n\n/**\n * Convert the original state object into a writable state object.\n * @param token The token for the state\n */\nexport function createState(token: ProviderToken<WritableSignal<State<unknown>>>) {\n return <U>(state: U): CreatedState<U> => {\n const internalState = inject(token);\n\n internalState.update(obj => {\n // Iterating over properties\n for (const key in state) {\n const value = state[key as keyof U];\n\n // We want to make this a controlled input if it is an InputSignal or InputSignalWithTransform\n if (isSignalInput(value)) {\n // @ts-ignore\n obj[key] = createControlledInput(value);\n } else {\n // @ts-ignore\n obj[key] = value;\n }\n }\n\n // Iterating over prototype methods\n const prototype = Object.getPrototypeOf(state);\n\n for (const key of Object.getOwnPropertyNames(prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(prototype, key);\n\n // if this is a getter or setter, we need to define it on the object\n if (descriptor?.get || descriptor?.set) {\n Object.defineProperty(obj, key, descriptor);\n } else if (typeof prototype[key as keyof U] === 'function') {\n (obj as Record<string, unknown>)[key] = prototype[key as keyof U].bind(state);\n } else {\n // @ts-ignore\n obj[key] = prototype[key as keyof U];\n }\n }\n\n return { ...obj };\n });\n\n return internalState() as unknown as CreatedState<U>;\n };\n}\n\n// this is a bit hacky, but we need to do it to track whether this is controlled\nfunction createControlledInput(\n property: InputSignal<unknown> | InputSignalWithTransform<unknown, unknown>,\n): WritableSignal<unknown> {\n const value = signal(property());\n let isControlled = false;\n\n const symbol = Object.getOwnPropertySymbols(property).find(s => s.description === 'SIGNAL');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const inputDefinition = symbol ? (property as any)[symbol] : undefined;\n\n if (\n !symbol ||\n !inputDefinition ||\n typeof inputDefinition.applyValueToInputSignal !== 'function'\n ) {\n console.warn(\n 'Angular has changed its internal Input implementation, report this issue to ng-primitives.',\n );\n // fallback to a linked signal which is partially controlled\n return linkedSignal(() => property());\n }\n\n const originalApply = inputDefinition.applyValueToInputSignal.bind(inputDefinition);\n const originalSet = value.set.bind(value);\n const originalUpdate = value.update.bind(value);\n\n inputDefinition.applyValueToInputSignal = (inputSignalNode: unknown, newValue: unknown) => {\n isControlled = true;\n originalSet(newValue);\n originalApply(inputSignalNode, newValue);\n };\n\n value.set = (newValue: unknown) => {\n if (!isControlled) {\n originalSet(newValue);\n }\n };\n\n value.update = (updateFn: (value: unknown) => unknown) => {\n if (!isControlled) {\n originalUpdate(updateFn);\n }\n };\n\n return value;\n}\n\nfunction isSignalInput(\n property: unknown,\n): property is InputSignal<unknown> | InputSignalWithTransform<unknown, unknown> {\n if (!isSignal(property)) {\n return false;\n }\n\n const symbol = Object.getOwnPropertySymbols(property).find(s => s.description === 'SIGNAL');\n\n if (!symbol) {\n return false;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const inputDefinition = symbol ? (property as any)[symbol] : undefined;\n\n if (!inputDefinition) {\n return false;\n }\n\n return 'transformFn' in inputDefinition || 'applyValueToInputSignal' in inputDefinition;\n}\n\nexport interface CreatePrimitiveOptions {\n injector?: Injector;\n elementRef?: ElementRef<HTMLElement>;\n}\n\ntype PrimitiveState<TFactory extends (...args: any[]) => unknown> = TFactory extends (\n props: unknown,\n) => infer R\n ? R\n : TFactory extends (...args: any[]) => infer R\n ? R\n : never;\n\ntype BasePrimitiveInjectionFn<TState> = {\n (): Signal<TState>;\n (options: { hoisted: true; optional?: boolean; skipSelf?: boolean }): Signal<TState | null>;\n (options?: {\n hoisted?: boolean;\n optional?: boolean;\n skipSelf?: boolean;\n }): Signal<TState | null> | Signal<TState>;\n};\n\ntype PrimitiveInjectionFn<TFactory extends (...args: any[]) => unknown> = TFactory extends (\n props: unknown,\n) => infer R\n ? {\n (): Signal<R>;\n (options: { hoisted: true; optional?: boolean; skipSelf?: boolean }): Signal<R | null>;\n (options?: {\n hoisted?: boolean;\n optional?: boolean;\n skipSelf?: boolean;\n }): Signal<R | null> | Signal<R>;\n }\n : BasePrimitiveInjectionFn<PrimitiveState<TFactory>>;\n\nexport function createPrimitive<TFactory extends (...args: any[]) => unknown>(\n name: string,\n fn: TFactory,\n options?: CreatePrimitiveOptions,\n): [\n InjectionToken<WritableSignal<PrimitiveState<TFactory>>>,\n TFactory,\n PrimitiveInjectionFn<TFactory>,\n (opts?: { inherit?: boolean }) => FactoryProvider,\n];\nexport function createPrimitive<TFactory extends (...args: any[]) => unknown>(\n name: string,\n fn: TFactory,\n options: CreatePrimitiveOptions = {},\n): [\n InjectionToken<WritableSignal<PrimitiveState<TFactory>>>,\n TFactory,\n PrimitiveInjectionFn<TFactory>,\n (opts?: { inherit?: boolean }) => FactoryProvider,\n] {\n // Create a unique injection token for the primitive's state signal\n const token = new InjectionToken<WritableSignal<PrimitiveState<TFactory>>>(`Primitive: ${name}`);\n\n // Create the state signal within the appropriate injection context\n const factory = ((props: Parameters<TFactory>[0]) => {\n // determine the injector to use\n let injector = options.injector ?? inject(Injector);\n\n // If an ElementRef is provided in options, create a child injector\n if (options.elementRef) {\n injector = Injector.create({\n providers: [{ provide: ElementRef, useValue: options.elementRef }],\n parent: injector,\n });\n }\n\n return runInInjectionContext(injector, () => {\n const state = inject(token, { optional: true });\n const instance = fn(props);\n state?.set(instance as PrimitiveState<TFactory>);\n return instance;\n });\n }) as TFactory;\n\n // create an injection function that provides the state signal\n function injectFn<T = PrimitiveState<TFactory>>(): Signal<T>;\n function injectFn<T = PrimitiveState<TFactory>>(\n options: { hoisted: true } & InjectOptions,\n ): Signal<T | null>;\n function injectFn<T = PrimitiveState<TFactory>>(options?: {\n hoisted?: boolean;\n optional?: boolean;\n skipSelf?: boolean;\n }): Signal<T | null> | Signal<T> {\n const hoisted = options?.hoisted ?? false;\n const optional = options?.optional ?? false;\n const skipSelf = options?.skipSelf ?? false;\n\n if (hoisted || optional) {\n return (inject(token, { optional: true, skipSelf }) ??\n signal(null)) as unknown as Signal<T | null>;\n }\n\n return inject(token, { optional, skipSelf }) as unknown as Signal<T>;\n }\n\n // create a function to provide the state\n const provideFn = (opts?: { inherit?: boolean }): FactoryProvider => {\n const inherit = opts?.inherit ?? true;\n return {\n provide: token,\n useFactory: () => {\n if (inherit === false) {\n return signal(null);\n }\n\n return inject(token, { optional: true, skipSelf: true }) ?? signal(null);\n },\n };\n };\n\n return [token, factory as TFactory, injectFn as PrimitiveInjectionFn<TFactory>, provideFn];\n}\n\nexport function controlled<T>(value: Signal<T>): WritableSignal<T> {\n return linkedSignal(() => value());\n}\n\nfunction setAttribute(\n element: ElementRef<HTMLElement>,\n attr: string,\n value: string | null | undefined,\n): void {\n // if the attribute is \"disabled\" and the value is 'false', we need to remove the attribute\n if (attr === 'disabled' && value === 'false') {\n element.nativeElement.removeAttribute(attr);\n return;\n }\n\n if (value !== null && value !== undefined) {\n element.nativeElement.setAttribute(attr, value);\n } else {\n element.nativeElement.removeAttribute(attr);\n }\n}\n\nexport function attrBinding(\n element: ElementRef<HTMLElement>,\n attr: string,\n value:\n | (() => string | number | boolean | null | undefined)\n | string\n | number\n | boolean\n | null\n | undefined,\n): void {\n afterRenderEffect({\n write: () => {\n const valueResult = typeof value === 'function' ? value() : value;\n\n setAttribute(element, attr, valueResult?.toString() ?? null);\n },\n });\n}\n\nfunction getStyleUnit(style: string): string {\n const parts = style.split('.');\n\n if (parts.length > 1) {\n const unit = parts[parts.length - 1];\n\n switch (unit) {\n case 'px':\n case 'em':\n case 'rem':\n case '%':\n case 'vh':\n case 'vw':\n case 'vmin':\n case 'vmax':\n case 'cm':\n case 'mm':\n case 'in':\n case 'pt':\n case 'pc':\n case 'ex':\n case 'ch':\n return unit;\n default:\n return '';\n }\n }\n\n return '';\n}\n\nexport function styleBinding(\n element: ElementRef<HTMLElement>,\n style: string,\n value: (() => string | number | null) | string | number | null,\n): void {\n afterRenderEffect({\n write: () => {\n const styleValue = typeof value === 'function' ? value() : value;\n // we should look for units in the style name, just like Angular does e.g. width.px\n const styleUnit = getStyleUnit(style);\n const styleName = styleUnit ? style.replace(`.${styleUnit}`, '') : style;\n\n if (styleValue !== null) {\n element.nativeElement.style.setProperty(styleName, styleValue + styleUnit);\n } else {\n element.nativeElement.style.removeProperty(styleName);\n }\n },\n });\n}\n\nexport function dataBinding(\n element: ElementRef<HTMLElement>,\n attr: string,\n value: (() => string | boolean | null) | string | boolean | null,\n): void {\n if (!attr.startsWith('data-')) {\n throw new Error(`dataBinding: attribute \"${attr}\" must start with \"data-\"`);\n }\n\n afterRenderEffect({\n write: () => {\n let valueResult = typeof value === 'function' ? value() : value;\n\n if (valueResult === false) {\n valueResult = null;\n } else if (valueResult === true) {\n valueResult = '';\n } else if (valueResult !== null && typeof valueResult !== 'string') {\n valueResult = String(valueResult);\n }\n\n setAttribute(element, attr, valueResult);\n },\n });\n}\nexport function listener<K extends keyof HTMLElementEventMap>(\n element: HTMLElement | ElementRef<HTMLElement> | Document,\n event: K,\n handler: (event: HTMLElementEventMap[K]) => void,\n options?: { injector?: Injector; config?: AddEventListenerOptions | boolean },\n): () => void;\nexport function listener(\n element: HTMLElement | ElementRef<HTMLElement> | Document,\n event: string,\n handler: (event: Event) => void,\n options?: { injector?: Injector; config?: AddEventListenerOptions | boolean },\n): () => void;\nexport function listener<K extends keyof HTMLElementEventMap>(\n element: HTMLElement | ElementRef<HTMLElement> | Document,\n event: K | string,\n handler: (event: HTMLElementEventMap[K] | Event) => void,\n options?: { injector?: Injector; config?: AddEventListenerOptions | boolean },\n): () => void {\n return runInInjectionContext(options?.injector ?? inject(Injector), () => {\n const ngZone = inject(NgZone);\n const destroyRef = inject(DestroyRef);\n const nativeElement = coerceElement(element);\n\n const removeListener = () =>\n nativeElement.removeEventListener(event, handler as EventListener, options?.config);\n destroyRef.onDestroy(removeListener);\n ngZone.runOutsideAngular(() =>\n nativeElement.addEventListener(event, handler as EventListener, options?.config),\n );\n\n return removeListener;\n });\n}\n\nexport function onMount(callback: () => void): void {\n const injector = inject(Injector);\n afterRenderEffect(() => runInInjectionContext(injector, callback), { injector });\n}\n\nexport function onDestroy(callback: () => void): void {\n const destroyRef = inject(DestroyRef);\n destroyRef.onDestroy(callback);\n}\n\n/**\n * Previously, with our state approach, we allowed signals to be written directly using their setters.\n * However, with our new approach, we want people to use the appropriate set method instead. This function takes in a writable\n * signal and returns a proxy that warns the user when set is called directly.\n */\nexport function deprecatedSetter<T>(\n signal: WritableSignal<T>,\n methodName: string,\n): WritableSignal<T> {\n return new Proxy(signal, {\n get(target, prop) {\n if (prop === 'set') {\n return (value: T) => {\n console.warn(\n `Deprecation warning: Use ${methodName}() instead of setting the value directly.`,\n );\n target.set(value);\n };\n }\n return target[prop as keyof WritableSignal<T>];\n },\n });\n}\n\n/**\n * A utility function to inject an inherited state from a parent injector. This is useful for cases\n * where a primitive needs to inherit state from a parent primitive, such as in roving focus groups.\n * We could use inject with a forwardRef, but forwardRef returns an any - no thanks...\n */\nexport function injectInheritedState<T>(\n token: () => InjectionToken<T>,\n injectOptions: InjectOptions = {},\n): T | null {\n return (\n inject<T>(\n forwardRef(() => token()),\n { optional: true, skipSelf: true, ...injectOptions },\n ) ?? null\n );\n}\n\nexport interface Emitter<T> {\n emit(value: T): void;\n asObservable(): Observable<T>;\n}\n\n/**\n * An emitter is a simple wrapper around a Subject that ensures\n * that change detection is run when an event is emitted and that\n * the subject is automatically completed when the component is destroyed.\n */\nexport function emitter<T>({\n injector = inject(Injector),\n}: { injector?: Injector } = {}): Emitter<T> {\n return runInInjectionContext(injector, () => {\n const eventEmitter = new Subject<T>();\n const changeDetector = inject(ChangeDetectorRef);\n\n // Complete the subject on destroy\n onDestroy(() => eventEmitter.complete());\n\n return {\n emit(value: T): void {\n eventEmitter.next(value);\n changeDetector.markForCheck();\n },\n asObservable(): Observable<T> {\n return eventEmitter.asObservable();\n },\n };\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AAuDA;;;AAGG;AACG,SAAU,gBAAgB,CAAI,WAAmB,EAAA;AACrD,IAAA,OAAO,IAAI,cAAc,CAAmB,MAAM,WAAW,CAAA,UAAA,CAAY,CAAC;AAC5E;AASA;;;;;AAKG;AACG,SAAU,mBAAmB,CACjC,KAAuB,EAAA;IAEvB,OAAO,CAAC,EAAE,OAAO,EAAA,GAAiC,EAAE,MAAM;AACxD,QAAA,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,MAAK;AACf,YAAA,IAAI,OAAO,KAAK,KAAK,EAAE;;AAErB,gBAAA,OAAO,MAAM,CAAC,EAAE,CAAC;YACnB;;AAEA,YAAA,OAAO,MAAM,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE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AAC,MAAM,KAAK,EAAE,CAAC,EACzB,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,aAAa,EAAE,CACrD,IAAI,IAAI;AAEb;AAOA;;;;AAIG;AACG,SAAU,OAAO,CAAI,EACzB,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAA,GACA,EAAE,EAAA;AAC7B,IAAA,OAAO,qBAAqB,CAAC,QAAQ,EAAE,MAAK;AAC1C,QAAA,MAAM,YAAY,GAAG,IAAI,OAAO,EAAK;AACrC,QAAA,MAAM,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;;QAGhD,SAAS,CAAC,MAAM,YAAY,CAAC,QAAQ,EAAE,CAAC;QAExC,OAAO;AACL,YAAA,IAAI,CAAC,KAAQ,EAAA;AACX,gBAAA,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;gBACxB,cAAc,CAAC,YAAY,EAAE;YAC/B,CAAC;YACD,YAAY,GAAA;AACV,gBAAA,OAAO,YAAY,CAAC,YAAY,EAAE;YACpC,CAAC;SACF;AACH,IAAA,CAAC,CAAC;AACJ;;ACzlBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-state.mjs","sources":["../../../../packages/ng-primitives/state/src/index.ts","../../../../packages/ng-primitives/state/src/ng-primitives-state.ts"],"sourcesContent":["/* eslint-disable @angular-eslint/no-uncalled-signals */\nimport { coerceElement } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n afterRenderEffect,\n ChangeDetectorRef,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n FactoryProvider,\n forwardRef,\n inject,\n InjectionToken,\n InjectOptions,\n Injector,\n InputSignal,\n InputSignalWithTransform,\n isSignal,\n linkedSignal,\n NgZone,\n PLATFORM_ID,\n ProviderToken,\n runInInjectionContext,\n signal,\n Signal,\n WritableSignal,\n} from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\n/**\n * This converts the state object to a writable state object.\n * This means that inputs become signals which are writable.\n */\nexport type State<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof T]: T[K] extends InputSignalWithTransform<infer U, any>\n ? WritableSignal<U>\n : T[K] extends InputSignal<infer R>\n ? WritableSignal<R>\n : T[K];\n};\n\n/**\n * This is similar to the state object, but we don't expose properties that are not\n * inputs.\n */\nexport type CreatedState<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof T]: T[K] extends InputSignalWithTransform<infer U, any>\n ? WritableSignal<U>\n : T[K] extends InputSignal<infer R>\n ? WritableSignal<R>\n : never;\n};\n\nexport type InjectedState<T> = Signal<State<T>>;\n\n/**\n * Create a new injection token for the state.\n * @param description The description of the token\n */\nexport function createStateToken<T>(description: string): InjectionToken<T> {\n return new InjectionToken<Signal<State<T>>>(`Ngp${description}StateToken`);\n}\n\nexport interface CreateStateProviderOptions {\n /**\n * Whether we should check for the state in the parent injector.\n */\n inherit?: boolean;\n}\n\n/**\n * Create a new provider for the state. It first tries to inject the state from the parent injector,\n * as this allows for the state to be hoisted to a higher level in the component tree. This can\n * be useful to avoid issues where the injector can't be shared in some cases when ng-content is used.\n * @param token The token for the state\n */\nexport function createStateProvider<T>(\n token: ProviderToken<T>,\n): (options?: CreateStateProviderOptions) => FactoryProvider {\n return ({ inherit }: CreateStateProviderOptions = {}) => ({\n provide: token,\n useFactory: () => {\n if (inherit === false) {\n // if we are not checking the parent, we want to create a new state\n return signal({});\n }\n // if we are checking the parent, we want to check if the state is already defined\n return inject(token, { optional: true, skipSelf: true }) ?? signal({});\n },\n });\n}\n\ntype CreateStateInjectorOptions = {\n /**\n * Whether the state may not be immediately available. This can happen when the child is instantiated before the parent.\n */\n deferred?: boolean;\n};\n\n/**\n * Create a new state injector for the state.\n * @param token The token for the state\n */\nexport function createStateInjector<T>(\n token: ProviderToken<State<T>>,\n options: { deferred: true },\n): <U = T>(injectOptions?: InjectOptions) => Signal<State<U> | undefined>;\nexport function createStateInjector<T>(\n token: ProviderToken<State<T>>,\n options?: CreateStateInjectorOptions,\n): <U = T>(injectOptions?: InjectOptions) => Signal<State<U>>;\nexport function createStateInjector<T>(\n token: ProviderToken<State<T>>,\n options: CreateStateInjectorOptions = {},\n): <U = T>(injectOptions?: InjectOptions) => Signal<State<U> | undefined> {\n return <U = T>(injectOptions: InjectOptions = {}) => {\n const value = inject(token, injectOptions) as Signal<State<U> | undefined> | null;\n\n if (options.deferred) {\n return computed(() =>\n value && Object.keys(value() ?? {}).length === 0 ? undefined : value?.(),\n ) as Signal<State<U> | undefined>;\n }\n\n return (value as Signal<State<U>>) ?? signal(undefined);\n };\n}\n\n/**\n * Convert the original state object into a writable state object.\n * @param token The token for the state\n */\nexport function createState(token: ProviderToken<WritableSignal<State<unknown>>>) {\n return <U>(state: U): CreatedState<U> => {\n const internalState = inject(token);\n\n internalState.update(obj => {\n // Iterating over properties\n for (const key in state) {\n const value = state[key as keyof U];\n\n // We want to make this a controlled input if it is an InputSignal or InputSignalWithTransform\n if (isSignalInput(value)) {\n // @ts-ignore\n obj[key] = createControlledInput(value);\n } else {\n // @ts-ignore\n obj[key] = value;\n }\n }\n\n // Iterating over prototype methods\n const prototype = Object.getPrototypeOf(state);\n\n for (const key of Object.getOwnPropertyNames(prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(prototype, key);\n\n // if this is a getter or setter, we need to define it on the object\n if (descriptor?.get || descriptor?.set) {\n Object.defineProperty(obj, key, descriptor);\n } else if (typeof prototype[key as keyof U] === 'function') {\n (obj as Record<string, unknown>)[key] = prototype[key as keyof U].bind(state);\n } else {\n // @ts-ignore\n obj[key] = prototype[key as keyof U];\n }\n }\n\n return { ...obj };\n });\n\n return internalState() as unknown as CreatedState<U>;\n };\n}\n\n// this is a bit hacky, but we need to do it to track whether this is controlled\nfunction createControlledInput(\n property: InputSignal<unknown> | InputSignalWithTransform<unknown, unknown>,\n): WritableSignal<unknown> {\n const value = signal(property());\n let isControlled = false;\n\n const symbol = Object.getOwnPropertySymbols(property).find(s => s.description === 'SIGNAL');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const inputDefinition = symbol ? (property as any)[symbol] : undefined;\n\n if (\n !symbol ||\n !inputDefinition ||\n typeof inputDefinition.applyValueToInputSignal !== 'function'\n ) {\n console.warn(\n 'Angular has changed its internal Input implementation, report this issue to ng-primitives.',\n );\n // fallback to a linked signal which is partially controlled\n return linkedSignal(() => property());\n }\n\n const originalApply = inputDefinition.applyValueToInputSignal.bind(inputDefinition);\n const originalSet = value.set.bind(value);\n const originalUpdate = value.update.bind(value);\n\n inputDefinition.applyValueToInputSignal = (inputSignalNode: unknown, newValue: unknown) => {\n isControlled = true;\n originalSet(newValue);\n originalApply(inputSignalNode, newValue);\n };\n\n value.set = (newValue: unknown) => {\n if (!isControlled) {\n originalSet(newValue);\n }\n };\n\n value.update = (updateFn: (value: unknown) => unknown) => {\n if (!isControlled) {\n originalUpdate(updateFn);\n }\n };\n\n return value;\n}\n\nfunction isSignalInput(\n property: unknown,\n): property is InputSignal<unknown> | InputSignalWithTransform<unknown, unknown> {\n if (!isSignal(property)) {\n return false;\n }\n\n const symbol = Object.getOwnPropertySymbols(property).find(s => s.description === 'SIGNAL');\n\n if (!symbol) {\n return false;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const inputDefinition = symbol ? (property as any)[symbol] : undefined;\n\n if (!inputDefinition) {\n return false;\n }\n\n return 'transformFn' in inputDefinition || 'applyValueToInputSignal' in inputDefinition;\n}\n\nexport interface CreatePrimitiveOptions {\n injector?: Injector;\n elementRef?: ElementRef<HTMLElement>;\n}\n\ntype PrimitiveState<TFactory extends (...args: any[]) => unknown> = TFactory extends (\n props: unknown,\n) => infer R\n ? R\n : TFactory extends (...args: any[]) => infer R\n ? R\n : never;\n\ntype BasePrimitiveInjectionFn<TState> = {\n (): Signal<TState>;\n (options: { hoisted: true; optional?: boolean; skipSelf?: boolean }): Signal<TState | null>;\n (options?: {\n hoisted?: boolean;\n optional?: boolean;\n skipSelf?: boolean;\n }): Signal<TState | null> | Signal<TState>;\n};\n\ntype PrimitiveInjectionFn<TFactory extends (...args: any[]) => unknown> = TFactory extends (\n props: unknown,\n) => infer R\n ? {\n (): Signal<R>;\n (options: { hoisted: true; optional?: boolean; skipSelf?: boolean }): Signal<R | null>;\n (options?: {\n hoisted?: boolean;\n optional?: boolean;\n skipSelf?: boolean;\n }): Signal<R | null> | Signal<R>;\n }\n : BasePrimitiveInjectionFn<PrimitiveState<TFactory>>;\n\nexport function createPrimitive<TFactory extends (...args: any[]) => unknown>(\n name: string,\n fn: TFactory,\n options?: CreatePrimitiveOptions,\n): [\n InjectionToken<WritableSignal<PrimitiveState<TFactory>>>,\n TFactory,\n PrimitiveInjectionFn<TFactory>,\n (opts?: { inherit?: boolean }) => FactoryProvider,\n];\nexport function createPrimitive<TFactory extends (...args: any[]) => unknown>(\n name: string,\n fn: TFactory,\n options: CreatePrimitiveOptions = {},\n): [\n InjectionToken<WritableSignal<PrimitiveState<TFactory>>>,\n TFactory,\n PrimitiveInjectionFn<TFactory>,\n (opts?: { inherit?: boolean }) => FactoryProvider,\n] {\n // Create a unique injection token for the primitive's state signal\n const token = new InjectionToken<WritableSignal<PrimitiveState<TFactory>>>(`Primitive: ${name}`);\n\n // Create the state signal within the appropriate injection context\n const factory = ((props: Parameters<TFactory>[0]) => {\n // determine the injector to use\n let injector = options.injector ?? inject(Injector);\n\n // If an ElementRef is provided in options, create a child injector\n if (options.elementRef) {\n injector = Injector.create({\n providers: [{ provide: ElementRef, useValue: options.elementRef }],\n parent: injector,\n });\n }\n\n return runInInjectionContext(injector, () => {\n const state = inject(token, { optional: true });\n const instance = fn(props);\n state?.set(instance as PrimitiveState<TFactory>);\n return instance;\n });\n }) as TFactory;\n\n // create an injection function that provides the state signal\n function injectFn<T = PrimitiveState<TFactory>>(): Signal<T>;\n function injectFn<T = PrimitiveState<TFactory>>(\n options: { hoisted: true } & InjectOptions,\n ): Signal<T | null>;\n function injectFn<T = PrimitiveState<TFactory>>(options?: {\n hoisted?: boolean;\n optional?: boolean;\n skipSelf?: boolean;\n }): Signal<T | null> | Signal<T> {\n const hoisted = options?.hoisted ?? false;\n const optional = options?.optional ?? false;\n const skipSelf = options?.skipSelf ?? false;\n\n if (hoisted || optional) {\n return (inject(token, { optional: true, skipSelf }) ??\n signal(null)) as unknown as Signal<T | null>;\n }\n\n return inject(token, { optional, skipSelf }) as unknown as Signal<T>;\n }\n\n // create a function to provide the state\n const provideFn = (opts?: { inherit?: boolean }): FactoryProvider => {\n const inherit = opts?.inherit ?? true;\n return {\n provide: token,\n useFactory: () => {\n if (inherit === false) {\n return signal(null);\n }\n\n return inject(token, { optional: true, skipSelf: true }) ?? signal(null);\n },\n };\n };\n\n return [token, factory as TFactory, injectFn as PrimitiveInjectionFn<TFactory>, provideFn];\n}\n\nexport function controlled<T>(value: Signal<T>): WritableSignal<T> {\n return linkedSignal(() => value());\n}\n\nfunction setAttribute(\n element: ElementRef<HTMLElement>,\n attr: string,\n value: string | null | undefined,\n): void {\n // if the attribute is \"disabled\" and the value is 'false', we need to remove the attribute\n if (attr === 'disabled' && value === 'false') {\n element.nativeElement.removeAttribute(attr);\n return;\n }\n\n if (value !== null && value !== undefined) {\n element.nativeElement.setAttribute(attr, value);\n } else {\n element.nativeElement.removeAttribute(attr);\n }\n}\n\nexport function attrBinding(\n element: ElementRef<HTMLElement>,\n attr: string,\n value:\n | (() => string | number | boolean | null | undefined)\n | string\n | number\n | boolean\n | null\n | undefined,\n): void {\n isomorphicEffect(() => {\n const valueResult = typeof value === 'function' ? value() : value;\n setAttribute(element, attr, valueResult?.toString() ?? null);\n });\n}\n\nfunction getStyleUnit(style: string): string {\n const parts = style.split('.');\n\n if (parts.length > 1) {\n const unit = parts[parts.length - 1];\n\n switch (unit) {\n case 'px':\n case 'em':\n case 'rem':\n case '%':\n case 'vh':\n case 'vw':\n case 'vmin':\n case 'vmax':\n case 'cm':\n case 'mm':\n case 'in':\n case 'pt':\n case 'pc':\n case 'ex':\n case 'ch':\n return unit;\n default:\n return '';\n }\n }\n\n return '';\n}\n\nexport function styleBinding(\n element: ElementRef<HTMLElement>,\n style: string,\n value: (() => string | number | null) | string | number | null,\n): void {\n isomorphicEffect(() => {\n const styleValue = typeof value === 'function' ? value() : value;\n // we should look for units in the style name, just like Angular does e.g. width.px\n const styleUnit = getStyleUnit(style);\n const styleName = styleUnit ? style.replace(`.${styleUnit}`, '') : style;\n\n if (styleValue !== null) {\n element.nativeElement.style.setProperty(styleName, styleValue + styleUnit);\n } else {\n element.nativeElement.style.removeProperty(styleName);\n }\n });\n}\n\nexport function dataBinding(\n element: ElementRef<HTMLElement>,\n attr: string,\n value: (() => string | boolean | null) | string | boolean | null,\n): void {\n if (!attr.startsWith('data-')) {\n throw new Error(`dataBinding: attribute \"${attr}\" must start with \"data-\"`);\n }\n\n isomorphicEffect(() => {\n let valueResult = typeof value === 'function' ? value() : value;\n\n if (valueResult === false) {\n valueResult = null;\n } else if (valueResult === true) {\n valueResult = '';\n } else if (valueResult !== null && typeof valueResult !== 'string') {\n valueResult = String(valueResult);\n }\n\n setAttribute(element, attr, valueResult);\n });\n}\n\nexport function listener<K extends keyof HTMLElementEventMap>(\n element: HTMLElement | ElementRef<HTMLElement> | Document,\n event: K,\n handler: (event: HTMLElementEventMap[K]) => void,\n options?: { injector?: Injector; config?: AddEventListenerOptions | boolean },\n): () => void;\nexport function listener(\n element: HTMLElement | ElementRef<HTMLElement> | Document,\n event: string,\n handler: (event: Event) => void,\n options?: { injector?: Injector; config?: AddEventListenerOptions | boolean },\n): () => void;\nexport function listener<K extends keyof HTMLElementEventMap>(\n element: HTMLElement | ElementRef<HTMLElement> | Document,\n event: K | string,\n handler: (event: HTMLElementEventMap[K] | Event) => void,\n options?: { injector?: Injector; config?: AddEventListenerOptions | boolean },\n): () => void {\n return runInInjectionContext(options?.injector ?? inject(Injector), () => {\n const ngZone = inject(NgZone);\n const destroyRef = inject(DestroyRef);\n const nativeElement = coerceElement(element);\n\n const removeListener = () =>\n nativeElement.removeEventListener(event, handler as EventListener, options?.config);\n destroyRef.onDestroy(removeListener);\n ngZone.runOutsideAngular(() =>\n nativeElement.addEventListener(event, handler as EventListener, options?.config),\n );\n\n return removeListener;\n });\n}\n\nexport function onMount(callback: () => void): void {\n const injector = inject(Injector);\n afterRenderEffect(() => runInInjectionContext(injector, callback), { injector });\n}\n\nexport function onDestroy(callback: () => void): void {\n const destroyRef = inject(DestroyRef);\n destroyRef.onDestroy(callback);\n}\n\n/**\n * Previously, with our state approach, we allowed signals to be written directly using their setters.\n * However, with our new approach, we want people to use the appropriate set method instead. This function takes in a writable\n * signal and returns a proxy that warns the user when set is called directly.\n */\nexport function deprecatedSetter<T>(\n signal: WritableSignal<T>,\n methodName: string,\n): WritableSignal<T> {\n return new Proxy(signal, {\n get(target, prop) {\n if (prop === 'set') {\n return (value: T) => {\n console.warn(\n `Deprecation warning: Use ${methodName}() instead of setting the value directly.`,\n );\n target.set(value);\n };\n }\n return target[prop as keyof WritableSignal<T>];\n },\n });\n}\n\n/**\n * A utility function to inject an inherited state from a parent injector. This is useful for cases\n * where a primitive needs to inherit state from a parent primitive, such as in roving focus groups.\n * We could use inject with a forwardRef, but forwardRef returns an any - no thanks...\n */\nexport function injectInheritedState<T>(\n token: () => InjectionToken<T>,\n injectOptions: InjectOptions = {},\n): T | null {\n return (\n inject<T>(\n forwardRef(() => token()),\n { optional: true, skipSelf: true, ...injectOptions },\n ) ?? null\n );\n}\n\nexport interface Emitter<T> {\n emit(value: T): void;\n asObservable(): Observable<T>;\n}\n\n/**\n * An emitter is a simple wrapper around a Subject that ensures\n * that change detection is run when an event is emitted and that\n * the subject is automatically completed when the component is destroyed.\n */\nexport function emitter<T>({\n injector = inject(Injector),\n}: { injector?: Injector } = {}): Emitter<T> {\n return runInInjectionContext(injector, () => {\n const eventEmitter = new Subject<T>();\n const changeDetector = inject(ChangeDetectorRef);\n\n // Complete the subject on destroy\n onDestroy(() => eventEmitter.complete());\n\n return {\n emit(value: T): void {\n eventEmitter.next(value);\n changeDetector.markForCheck();\n },\n asObservable(): Observable<T> {\n return eventEmitter.asObservable();\n },\n };\n });\n}\n\nfunction isomorphicEffect(callback: () => void): void {\n const injector = inject(Injector);\n const platformId = injector.get(PLATFORM_ID);\n\n if (isPlatformBrowser(platformId)) {\n afterRenderEffect(() => callback());\n } else {\n // On the server, we just run the effect immediately\n effect(() => callback());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;AA0DA;;;AAGG;AACG,SAAU,gBAAgB,CAAI,WAAmB,EAAA;AACrD,IAAA,OAAO,IAAI,cAAc,CAAmB,MAAM,WAAW,CAAA,UAAA,CAAY,CAAC;AAC5E;AASA;;;;;AAKG;AACG,SAAU,mBAAmB,CACjC,KAAuB,EAAA;IAEvB,OAAO,CAAC,EAAE,OAAO,EAAA,GAAiC,EAAE,MAAM;AACxD,QAAA,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,MAAK;AACf,YAAA,IAAI,OAAO,KAAK,KAAK,EAAE;;AAErB,gBAAA,OAAO,MAAM,CAAC,EAAE,CAAC;YACnB;;AAEA,YAAA,OAAO,MAAM,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC;QACxE,CAAC;AACF,KAAA,CAAC;AACJ;SAqBgB,mBAAmB,CACjC,KAA8B,EAC9B,UAAsC,EAAE,EAAA;AAExC,IAAA,OAAO,CAAQ,aAAA,GAA+B,EAAE,KAAI;QAClD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,aAAa,CAAwC;AAEjF,QAAA,IAAI,OAAO,CAAC,QAAQ,EAAE;AACpB,YAAA,OAAO,QAAQ,CAAC,MACd,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,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AAA;AACX,gBAAA,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;gBACxB,cAAc,CAAC,YAAY,EAAE;YAC/B,CAAC;YACD,YAAY,GAAA;AACV,gBAAA,OAAO,YAAY,CAAC,YAAY,EAAE;YACpC,CAAC;SACF;AACH,IAAA,CAAC,CAAC;AACJ;AAEA,SAAS,gBAAgB,CAAC,QAAoB,EAAA;AAC5C,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACjC,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC;AAE5C,IAAA,IAAI,iBAAiB,CAAC,UAAU,CAAC,EAAE;AACjC,QAAA,iBAAiB,CAAC,MAAM,QAAQ,EAAE,CAAC;IACrC;SAAO;;AAEL,QAAA,MAAM,CAAC,MAAM,QAAQ,EAAE,CAAC;IAC1B;AACF;;AClmBA;;AAEG;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { setupOverlayArrow, injectOverlay, injectOverlayContext, coerceOffset, createOverlay } from 'ng-primitives/portal';
|
|
1
|
+
import { setupOverlayArrow, injectOverlay, injectOverlayContext, coerceOffset, coerceShift, createOverlay } from 'ng-primitives/portal';
|
|
2
2
|
export { injectOverlayContext as injectTooltipContext } from 'ng-primitives/portal';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { InjectionToken, inject, Directive, input, Component, ElementRef, Injector, ViewContainerRef, booleanAttribute, numberAttribute, signal, computed } from '@angular/core';
|
|
@@ -16,6 +16,7 @@ const defaultTooltipConfig = {
|
|
|
16
16
|
container: 'body',
|
|
17
17
|
showOnOverflow: false,
|
|
18
18
|
useTextContent: true,
|
|
19
|
+
shift: undefined,
|
|
19
20
|
};
|
|
20
21
|
const NgpTooltipConfigToken = new InjectionToken('NgpTooltipConfigToken');
|
|
21
22
|
/**
|
|
@@ -221,6 +222,16 @@ class NgpTooltipTrigger {
|
|
|
221
222
|
alias: 'ngpTooltipTriggerFlip',
|
|
222
223
|
transform: booleanAttribute,
|
|
223
224
|
}]));
|
|
225
|
+
/**
|
|
226
|
+
* Configure shift behavior to keep the tooltip in view.
|
|
227
|
+
* Can be a boolean to enable/disable, or an object with padding and limiter options.
|
|
228
|
+
* @default undefined (enabled by default in overlay)
|
|
229
|
+
*/
|
|
230
|
+
this.shift = input(this.config.shift, ...(ngDevMode ? [{ debugName: "shift", alias: 'ngpTooltipTriggerShift',
|
|
231
|
+
transform: coerceShift }] : [{
|
|
232
|
+
alias: 'ngpTooltipTriggerShift',
|
|
233
|
+
transform: coerceShift,
|
|
234
|
+
}]));
|
|
224
235
|
/**
|
|
225
236
|
* Define the container in which the tooltip should be attached.
|
|
226
237
|
* @default document.body
|
|
@@ -347,6 +358,7 @@ class NgpTooltipTrigger {
|
|
|
347
358
|
placement: this.state.placement,
|
|
348
359
|
offset: this.state.offset(),
|
|
349
360
|
flip: this.state.flip(),
|
|
361
|
+
shift: this.state.shift(),
|
|
350
362
|
showDelay: this.state.showDelay(),
|
|
351
363
|
hideDelay: this.state.hideDelay(),
|
|
352
364
|
closeOnEscape: true,
|
|
@@ -363,7 +375,7 @@ class NgpTooltipTrigger {
|
|
|
363
375
|
this.tooltipId.set(id);
|
|
364
376
|
}
|
|
365
377
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpTooltipTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
366
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpTooltipTrigger, isStandalone: true, selector: "[ngpTooltipTrigger]", inputs: { tooltip: { classPropertyName: "tooltip", publicName: "ngpTooltipTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpTooltipTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpTooltipTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpTooltipTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "ngpTooltipTriggerShowDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "ngpTooltipTriggerHideDelay", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpTooltipTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpTooltipTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, showOnOverflow: { classPropertyName: "showOnOverflow", publicName: "ngpTooltipTriggerShowOnOverflow", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpTooltipTriggerContext", isSignal: true, isRequired: false, transformFunction: null }, useTextContent: { classPropertyName: "useTextContent", publicName: "ngpTooltipTriggerUseTextContent", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "show()", "mouseleave": "hide()", "focus": "show()", "blur": "hide()" }, properties: { "attr.data-open": "open() ? \"\" : null", "attr.data-disabled": "state.disabled() ? \"\" : null", "attr.aria-describedby": "overlay()?.ariaDescribedBy()" } }, providers: [provideTooltipTriggerState()], exportAs: ["ngpTooltipTrigger"], ngImport: i0 }); }
|
|
378
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpTooltipTrigger, isStandalone: true, selector: "[ngpTooltipTrigger]", inputs: { tooltip: { classPropertyName: "tooltip", publicName: "ngpTooltipTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpTooltipTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpTooltipTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpTooltipTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "ngpTooltipTriggerShowDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "ngpTooltipTriggerHideDelay", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpTooltipTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, shift: { classPropertyName: "shift", publicName: "ngpTooltipTriggerShift", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpTooltipTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, showOnOverflow: { classPropertyName: "showOnOverflow", publicName: "ngpTooltipTriggerShowOnOverflow", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpTooltipTriggerContext", isSignal: true, isRequired: false, transformFunction: null }, useTextContent: { classPropertyName: "useTextContent", publicName: "ngpTooltipTriggerUseTextContent", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "show()", "mouseleave": "hide()", "focus": "show()", "blur": "hide()" }, properties: { "attr.data-open": "open() ? \"\" : null", "attr.data-disabled": "state.disabled() ? \"\" : null", "attr.aria-describedby": "overlay()?.ariaDescribedBy()" } }, providers: [provideTooltipTriggerState()], exportAs: ["ngpTooltipTrigger"], ngImport: i0 }); }
|
|
367
379
|
}
|
|
368
380
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpTooltipTrigger, decorators: [{
|
|
369
381
|
type: Directive,
|
|
@@ -381,7 +393,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
|
|
|
381
393
|
'(blur)': 'hide()',
|
|
382
394
|
},
|
|
383
395
|
}]
|
|
384
|
-
}], ctorParameters: () => [], propDecorators: { tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTrigger", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerDisabled", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerPlacement", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerOffset", required: false }] }], showDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerShowDelay", required: false }] }], hideDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerHideDelay", required: false }] }], flip: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerFlip", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerContainer", required: false }] }], showOnOverflow: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerShowOnOverflow", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerContext", required: false }] }], useTextContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerUseTextContent", required: false }] }] } });
|
|
396
|
+
}], ctorParameters: () => [], propDecorators: { tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTrigger", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerDisabled", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerPlacement", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerOffset", required: false }] }], showDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerShowDelay", required: false }] }], hideDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerHideDelay", required: false }] }], flip: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerFlip", required: false }] }], shift: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerShift", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerContainer", required: false }] }], showOnOverflow: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerShowOnOverflow", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerContext", required: false }] }], useTextContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpTooltipTriggerUseTextContent", required: false }] }] } });
|
|
385
397
|
|
|
386
398
|
/**
|
|
387
399
|
* Generated bundle index. Do not edit.
|