ng-primitives 0.120.5 → 0.121.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/fesm2022/ng-primitives-a11y.mjs +5 -5
- package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
- package/fesm2022/ng-primitives-accordion.mjs +30 -47
- package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/ng-primitives-ai.mjs +39 -52
- package/fesm2022/ng-primitives-ai.mjs.map +1 -1
- package/fesm2022/ng-primitives-autofill.mjs +4 -4
- package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
- package/fesm2022/ng-primitives-avatar.mjs +14 -17
- package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/ng-primitives-breadcrumbs.mjs +21 -21
- package/fesm2022/ng-primitives-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ng-primitives-button.mjs +7 -9
- package/fesm2022/ng-primitives-button.mjs.map +1 -1
- package/fesm2022/ng-primitives-checkbox.mjs +15 -30
- package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-combobox.mjs +60 -92
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-common.mjs +4 -4
- package/fesm2022/ng-primitives-common.mjs.map +1 -1
- package/fesm2022/ng-primitives-context-menu.mjs +66 -119
- package/fesm2022/ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-date-picker.mjs +70 -108
- package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
- package/fesm2022/ng-primitives-dialog.mjs +33 -49
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs +26 -53
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-focus-trap.mjs +5 -8
- package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
- package/fesm2022/ng-primitives-form-field.mjs +39 -44
- package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
- package/fesm2022/ng-primitives-input-otp.mjs +30 -43
- package/fesm2022/ng-primitives-input-otp.mjs.map +1 -1
- package/fesm2022/ng-primitives-input.mjs +6 -8
- package/fesm2022/ng-primitives-input.mjs.map +1 -1
- package/fesm2022/ng-primitives-interactions.mjs +31 -48
- package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +12 -12
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-listbox.mjs +34 -48
- package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +83 -149
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-meter.mjs +25 -36
- package/fesm2022/ng-primitives-meter.mjs.map +1 -1
- package/fesm2022/ng-primitives-navigation-menu.mjs +60 -108
- package/fesm2022/ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-number-field.mjs +35 -59
- package/fesm2022/ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/ng-primitives-pagination.mjs +270 -297
- package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +42 -87
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +81 -57
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-progress.mjs +30 -41
- package/fesm2022/ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/ng-primitives-radio.mjs +20 -30
- package/fesm2022/ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/ng-primitives-resize.mjs +3 -3
- package/fesm2022/ng-primitives-resize.mjs.map +1 -1
- package/fesm2022/ng-primitives-roving-focus.mjs +20 -34
- package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/ng-primitives-search.mjs +9 -9
- package/fesm2022/ng-primitives-search.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +50 -81
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-separator.mjs +4 -6
- package/fesm2022/ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/ng-primitives-slider.mjs +63 -100
- package/fesm2022/ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/ng-primitives-state.mjs +3 -3
- package/fesm2022/ng-primitives-state.mjs.map +1 -1
- package/fesm2022/ng-primitives-switch.mjs +15 -21
- package/fesm2022/ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/ng-primitives-tabs.mjs +31 -41
- package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/ng-primitives-textarea.mjs +5 -7
- package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
- package/fesm2022/ng-primitives-toast.mjs +19 -19
- package/fesm2022/ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle-group.mjs +20 -36
- package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle.mjs +10 -19
- package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/ng-primitives-toolbar.mjs +4 -6
- package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +401 -402
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/ng-primitives-utils.mjs +5 -4
- package/fesm2022/ng-primitives-utils.mjs.map +1 -1
- package/package.json +56 -55
- package/{a11y/index.d.ts → types/ng-primitives-a11y.d.ts} +15 -14
- package/{accordion/index.d.ts → types/ng-primitives-accordion.d.ts} +78 -77
- package/{button/index.d.ts → types/ng-primitives-button.d.ts} +21 -20
- package/{checkbox/index.d.ts → types/ng-primitives-checkbox.d.ts} +67 -66
- package/{combobox/index.d.ts → types/ng-primitives-combobox.d.ts} +35 -35
- package/{date-picker/index.d.ts → types/ng-primitives-date-picker.d.ts} +2 -2
- package/{number-field/index.d.ts → types/ng-primitives-number-field.d.ts} +72 -71
- package/types/ng-primitives-pagination.d.ts +502 -0
- package/{popover/index.d.ts → types/ng-primitives-popover.d.ts} +3 -2
- package/{portal/index.d.ts → types/ng-primitives-portal.d.ts} +19 -3
- package/{roving-focus/index.d.ts → types/ng-primitives-roving-focus.d.ts} +61 -60
- package/{select/index.d.ts → types/ng-primitives-select.d.ts} +39 -38
- package/{slider/index.d.ts → types/ng-primitives-slider.d.ts} +59 -58
- package/{switch/index.d.ts → types/ng-primitives-switch.d.ts} +45 -44
- package/{toast/index.d.ts → types/ng-primitives-toast.d.ts} +2 -1
- package/{toggle-group/index.d.ts → types/ng-primitives-toggle-group.d.ts} +69 -68
- package/{toggle/index.d.ts → types/ng-primitives-toggle.d.ts} +48 -47
- package/types/ng-primitives-tooltip.d.ts +691 -0
- package/pagination/index.d.ts +0 -211
- package/tooltip/index.d.ts +0 -376
- /package/{ai/index.d.ts → types/ng-primitives-ai.d.ts} +0 -0
- /package/{autofill/index.d.ts → types/ng-primitives-autofill.d.ts} +0 -0
- /package/{avatar/index.d.ts → types/ng-primitives-avatar.d.ts} +0 -0
- /package/{breadcrumbs/index.d.ts → types/ng-primitives-breadcrumbs.d.ts} +0 -0
- /package/{common/index.d.ts → types/ng-primitives-common.d.ts} +0 -0
- /package/{context-menu/index.d.ts → types/ng-primitives-context-menu.d.ts} +0 -0
- /package/{date-time-luxon/index.d.ts → types/ng-primitives-date-time-luxon.d.ts} +0 -0
- /package/{date-time/index.d.ts → types/ng-primitives-date-time.d.ts} +0 -0
- /package/{dialog/index.d.ts → types/ng-primitives-dialog.d.ts} +0 -0
- /package/{file-upload/index.d.ts → types/ng-primitives-file-upload.d.ts} +0 -0
- /package/{focus-trap/index.d.ts → types/ng-primitives-focus-trap.d.ts} +0 -0
- /package/{form-field/index.d.ts → types/ng-primitives-form-field.d.ts} +0 -0
- /package/{input-otp/index.d.ts → types/ng-primitives-input-otp.d.ts} +0 -0
- /package/{input/index.d.ts → types/ng-primitives-input.d.ts} +0 -0
- /package/{interactions/index.d.ts → types/ng-primitives-interactions.d.ts} +0 -0
- /package/{internal/index.d.ts → types/ng-primitives-internal.d.ts} +0 -0
- /package/{listbox/index.d.ts → types/ng-primitives-listbox.d.ts} +0 -0
- /package/{menu/index.d.ts → types/ng-primitives-menu.d.ts} +0 -0
- /package/{meter/index.d.ts → types/ng-primitives-meter.d.ts} +0 -0
- /package/{navigation-menu/index.d.ts → types/ng-primitives-navigation-menu.d.ts} +0 -0
- /package/{progress/index.d.ts → types/ng-primitives-progress.d.ts} +0 -0
- /package/{radio/index.d.ts → types/ng-primitives-radio.d.ts} +0 -0
- /package/{resize/index.d.ts → types/ng-primitives-resize.d.ts} +0 -0
- /package/{search/index.d.ts → types/ng-primitives-search.d.ts} +0 -0
- /package/{separator/index.d.ts → types/ng-primitives-separator.d.ts} +0 -0
- /package/{state/index.d.ts → types/ng-primitives-state.d.ts} +0 -0
- /package/{tabs/index.d.ts → types/ng-primitives-tabs.d.ts} +0 -0
- /package/{textarea/index.d.ts → types/ng-primitives-textarea.d.ts} +0 -0
- /package/{toolbar/index.d.ts → types/ng-primitives-toolbar.d.ts} +0 -0
- /package/{utils/index.d.ts → types/ng-primitives-utils.d.ts} +0 -0
- /package/{index.d.ts → types/ng-primitives.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-tabs.mjs","sources":["../../../../packages/ng-primitives/tabs/src/config/tabs-config.ts","../../../../packages/ng-primitives/tabs/src/tabset/tabset-state.ts","../../../../packages/ng-primitives/tabs/src/tab-button/tab-button-state.ts","../../../../packages/ng-primitives/tabs/src/tab-button/tab-button.ts","../../../../packages/ng-primitives/tabs/src/tab-list/tab-list-state.ts","../../../../packages/ng-primitives/tabs/src/tab-list/tab-list.ts","../../../../packages/ng-primitives/tabs/src/tab-panel/tab-panel-state.ts","../../../../packages/ng-primitives/tabs/src/tab-panel/tab-panel.ts","../../../../packages/ng-primitives/tabs/src/tabset/tabset.ts","../../../../packages/ng-primitives/tabs/src/ng-primitives-tabs.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\n\nexport interface NgpTabsConfig {\n /**\n * The orientation of the tabset\n * @default 'horizontal'\n */\n orientation: NgpOrientation;\n\n /**\n * Whether tabs should activate on focus\n * @default true\n */\n activateOnFocus: boolean;\n\n /**\n * Whether focus should wrap within the tab list when using the keyboard.\n * @default true\n */\n wrap: boolean;\n}\n\nexport const defaultTabsConfig: NgpTabsConfig = {\n orientation: 'horizontal',\n activateOnFocus: true,\n wrap: true,\n};\n\nexport const NgpTabsConfigToken = new InjectionToken<NgpTabsConfig>('NgpTabsConfigToken');\n\n/**\n * Provide the default Tabs configuration\n * @param config The Tabs configuration\n * @returns The provider\n */\nexport function provideTabsConfig(config: Partial<NgpTabsConfig>): Provider[] {\n return [\n {\n provide: NgpTabsConfigToken,\n useValue: { ...defaultTabsConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tabs configuration\n * @returns The global Tabs configuration\n */\nexport function injectTabsConfig(): NgpTabsConfig {\n return inject(NgpTabsConfigToken, { optional: true }) ?? defaultTabsConfig;\n}\n","import { computed, signal, Signal, WritableSignal } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n attrBinding,\n controlled,\n createPrimitive,\n dataBinding,\n deprecatedSetter,\n} from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\n\n/**\n * The state for the NgpTabset directive.\n */\nexport interface NgpTabsetState {\n /**\n * The unique id for the tabset.\n */\n readonly id: Signal<string>;\n\n /**\n * The orientation of the tabset.\n */\n readonly orientation: WritableSignal<NgpOrientation>;\n\n /**\n * Whether tabs should activate on focus.\n */\n readonly activateOnFocus: WritableSignal<boolean>;\n\n /**\n * The selected tab value.\n */\n readonly value: WritableSignal<string | undefined>;\n\n /**\n * The selected tab computed value.\n */\n readonly selectedTab: Signal<string | undefined>;\n\n /**\n * Select a tab by its value.\n */\n select(value: string): void;\n\n /**\n * Set orientation of the tabset.\n */\n setOrientation(orientation: NgpOrientation): void;\n\n /**\n * Set the activateOnFocus.\n */\n setActivateOnFocus(activateOnFocus: boolean): void;\n\n /**\n * @internal Register a tab with the tabset.\n */\n registerTab(tab: NgpTab): void;\n\n /**\n * @internal Unregister a tab with the tabset.\n */\n unregisterTab(value: string): void;\n}\n\n/**\n * The props for the NgpTabset state.\n */\nexport interface NgpTabsetProps {\n /**\n * The unique id for the tabset.\n */\n readonly id?: Signal<string>;\n\n /**\n * The selected tab value.\n */\n readonly value?: Signal<string | undefined>;\n\n /**\n * The orientation of the tabset.\n */\n readonly orientation?: Signal<NgpOrientation>;\n\n /**\n * Whether tabs should activate on focus.\n */\n readonly activateOnFocus?: Signal<boolean>;\n\n /**\n * Callback when the selected tab changes.\n */\n readonly onValueChange?: (value: string | undefined) => void;\n}\n\nexport const [NgpTabsetStateToken, ngpTabset, injectTabsetState, provideTabsetState] =\n createPrimitive(\n 'NgpTabset',\n ({\n id = signal(uniqueId('ngp-tabset')),\n value: _value = signal(undefined),\n orientation: _orientation = signal('horizontal'),\n activateOnFocus: _activateOnFocus = signal(false),\n onValueChange,\n }: NgpTabsetProps) => {\n const element = injectElementRef();\n const tabs = signal<NgpTab[]>([]);\n\n // Controlled properties\n const value = controlled(_value);\n const orientation = controlled(_orientation);\n const activateOnFocus = controlled(_activateOnFocus);\n\n // Host bindings\n attrBinding(element, 'id', id);\n dataBinding(element, 'data-orientation', orientation);\n\n // Computed selected tab\n const selectedTab = computed(() => {\n const tabList = tabs();\n const currentValue = value();\n\n // if there are no tabs then return the selected value\n if (tabList.length === 0) {\n return currentValue;\n }\n\n // if there is a value set and a tab with that value exists, return the value\n if (currentValue && tabList.some(tab => tab.value() === currentValue)) {\n return currentValue;\n }\n\n // otherwise return the first non-disabled tab's value\n return tabList.find(tab => !tab.disabled())?.value();\n });\n\n function select(newValue: string): void {\n // if the value is already selected, do nothing\n if (value() === newValue) {\n return;\n }\n\n value.set(newValue);\n onValueChange?.(newValue);\n }\n\n function setOrientation(newOrientation: NgpOrientation): void {\n orientation.set(newOrientation);\n }\n\n function setActivateOnFocus(newActivateOnFocus: boolean): void {\n activateOnFocus.set(newActivateOnFocus);\n }\n\n function registerTab(tab: NgpTab): void {\n tabs.update(currentTabs => [...currentTabs, tab]);\n }\n\n function unregisterTab(tabValue: string): void {\n tabs.update(currentTabs => currentTabs.filter(tab => tab.value() !== tabValue));\n }\n\n return {\n id,\n orientation: deprecatedSetter(orientation, 'setOrientation'),\n activateOnFocus: deprecatedSetter(activateOnFocus, 'setActivateOnFocus'),\n value: deprecatedSetter(value, 'select'),\n selectedTab,\n select,\n setOrientation,\n registerTab,\n unregisterTab,\n setActivateOnFocus,\n } satisfies NgpTabsetState;\n },\n );\n\nexport interface NgpTab {\n /**\n * The unique value for the tab.\n */\n readonly value: Signal<string>;\n\n /**\n * Whether the tab is disabled.\n */\n readonly disabled: Signal<boolean>;\n}\n","import { HOST_TAG_NAME, Signal, computed, inject, signal } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n attrBinding,\n createPrimitive,\n dataBinding,\n listener,\n onDestroy,\n onMount,\n} from 'ng-primitives/state';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * The state for the NgpTabButton directive.\n */\nexport interface NgpTabButtonState {\n /**\n * The unique id for the tab button.\n */\n readonly id: Signal<string>;\n\n /**\n * Whether the tab is active.\n */\n readonly active: Signal<boolean>;\n\n /**\n * Select the tab this trigger controls.\n */\n select(): void;\n}\n\n/**\n * The props for the NgpTabButton state.\n */\nexport interface NgpTabButtonProps {\n /**\n * The value of the tab this trigger controls.\n */\n readonly value: Signal<string>;\n\n /**\n * Whether the tab is disabled.\n */\n readonly disabled?: Signal<boolean>;\n\n /**\n * The id of the tab button.\n */\n readonly id?: Signal<string | undefined>;\n}\n\nexport const [NgpTabButtonStateToken, ngpTabButton, injectTabButtonState, provideTabButtonState] =\n createPrimitive('NgpTabButton', ({ value, disabled = signal(false), id }: NgpTabButtonProps) => {\n const element = injectElementRef();\n const tagName = inject(HOST_TAG_NAME);\n const tabset = injectTabsetState();\n\n // Computed properties\n const buttonId = computed(() => id?.() ?? `${tabset().id()}-button-${value()}`);\n const ariaControls = computed(() => `${tabset().id()}-panel-${value()}`);\n const active = computed(() => tabset().selectedTab() === value());\n\n // Host bindings\n attrBinding(element, 'role', 'tab');\n attrBinding(element, 'id', buttonId);\n attrBinding(element, 'aria-controls', ariaControls);\n attrBinding(element, 'aria-selected', active);\n dataBinding(element, 'data-active', active);\n dataBinding(element, 'data-disabled', disabled);\n attrBinding(element, 'disabled', () => (tagName === 'button' && disabled() ? '' : null));\n dataBinding(element, 'data-orientation', () => tabset().orientation());\n\n // Event listeners\n listener(element, 'click', select);\n listener(element, 'focus', activateOnFocus);\n\n // Setup interactions\n ngpInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled,\n });\n\n function select(): void {\n if (disabled?.() === false) {\n tabset().select(value());\n }\n }\n\n function activateOnFocus(): void {\n if (tabset().activateOnFocus()) {\n select();\n }\n }\n\n onMount(() => {\n // we can't use a required input for value as it is used in a computed property before the input is set\n if (value() === undefined) {\n throw new Error('ngpTabButton: value is required');\n }\n\n // Register with tabset now that inputs are available\n tabset().registerTab({ value, disabled });\n });\n\n // Unregister on destroy\n onDestroy(() => {\n tabset().unregisterTab(value());\n });\n\n return {\n id: buttonId,\n active,\n select,\n } satisfies NgpTabButtonState;\n });\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, Signal } from '@angular/core';\nimport { ngpRovingFocusItem, provideRovingFocusItemState } from 'ng-primitives/roving-focus';\nimport { ngpTabButton, provideTabButtonState } from './tab-button-state';\n\n/**\n * Apply the `ngpTabButton` directive to an element within a tab list to represent a tab button. This directive should be applied to a button element.\n */\n@Directive({\n selector: '[ngpTabButton]',\n exportAs: 'ngpTabButton',\n providers: [provideTabButtonState(), provideRovingFocusItemState()],\n})\nexport class NgpTabButton {\n /**\n * The value of the tab this trigger controls\n * @required\n */\n readonly value = input<string>(undefined, { alias: 'ngpTabButtonValue' });\n\n /**\n * Whether the tab is disabled\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTabButtonDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Determine the id of the tab button\n * @internal\n */\n readonly id = input<string>();\n\n private readonly state = ngpTabButton({\n value: this.value as Signal<string>,\n disabled: this.disabled,\n id: this.id,\n });\n\n /**\n * Whether the tab is active\n */\n readonly active = this.state.active;\n\n constructor() {\n ngpRovingFocusItem({ disabled: this.disabled });\n }\n\n /**\n * Select the tab this trigger controls\n */\n select(): void {\n this.state.select();\n }\n}\n","import { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding } from 'ng-primitives/state';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * The state for the NgpTabList directive.\n */\nexport interface NgpTabListState {\n // No public methods exposed for tab list\n}\n\n/**\n * The props for the NgpTabList state.\n */\nexport interface NgpTabListProps {\n // No props for tab list\n}\n\nexport const [NgpTabListStateToken, ngpTabList, injectTabListState, provideTabListState] =\n createPrimitive('NgpTabList', ({}: NgpTabListProps) => {\n const element = injectElementRef();\n const tabsetState = injectTabsetState();\n\n // Host bindings\n attrBinding(element, 'role', 'tablist');\n attrBinding(element, 'aria-orientation', () => tabsetState().orientation());\n dataBinding(element, 'data-orientation', () => tabsetState().orientation());\n\n return {} satisfies NgpTabListState;\n });\n","import { Directive } from '@angular/core';\nimport { ngpTabList, provideTabListState } from './tab-list-state';\n\n/**\n * Apply the `ngpTabList` directive to an element that represents the list of tab buttons.\n */\n@Directive({\n selector: '[ngpTabList]',\n exportAs: 'ngpTabList',\n providers: [provideTabListState()],\n})\nexport class NgpTabList {\n constructor() {\n ngpTabList({});\n }\n}\n","import { Signal, computed } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, onMount } from 'ng-primitives/state';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * The state for the NgpTabPanel directive.\n */\nexport interface NgpTabPanelState {\n /**\n * The unique id for the tab panel.\n */\n readonly panelId: Signal<string>;\n\n /**\n * The aria-labelledby attribute for the tab panel.\n */\n readonly labelledBy: Signal<string>;\n\n /**\n * Whether the tab panel is active.\n */\n readonly active: Signal<boolean>;\n}\n\n/**\n * The props for the NgpTabPanel state.\n */\nexport interface NgpTabPanelProps {\n /**\n * The value of the tab this panel represents.\n */\n readonly value: Signal<string | undefined>;\n\n /**\n * The id of the tab panel.\n */\n readonly id?: Signal<string | undefined>;\n}\n\nexport const [NgpTabPanelStateToken, ngpTabPanel, injectTabPanelState, provideTabPanelState] =\n createPrimitive('NgpTabPanel', ({ value, id }: NgpTabPanelProps) => {\n const element = injectElementRef();\n const tabset = injectTabsetState();\n\n // Computed properties\n const panelId = computed(() => id?.() ?? `${tabset().id()}-panel-${value?.()}`);\n const labelledBy = computed(() => `${tabset().id()}-button-${value?.()}`);\n const active = computed(() => tabset().selectedTab() === value?.());\n\n // Host bindings\n attrBinding(element, 'role', 'tabpanel');\n attrBinding(element, 'tabindex', () => (active() ? '0' : null));\n attrBinding(element, 'aria-hidden', () => (active() ? null : 'true'));\n attrBinding(element, 'id', panelId);\n attrBinding(element, 'aria-labelledby', labelledBy);\n dataBinding(element, 'data-active', active);\n dataBinding(element, 'data-orientation', () => tabset().orientation());\n\n // Ensure value is provided\n onMount(() => {\n if (value() === undefined) {\n throw new Error('ngpTabPanel: value is required');\n }\n });\n\n return {\n panelId,\n labelledBy,\n active,\n } satisfies NgpTabPanelState;\n });\n","import { Directive, input } from '@angular/core';\nimport { ngpTabPanel, provideTabPanelState } from './tab-panel-state';\n\n/**\n * Apply the `ngpTabPanel` directive to an element that represents the content of a tab.\n */\n@Directive({\n selector: '[ngpTabPanel]',\n exportAs: 'ngpTabPanel',\n providers: [provideTabPanelState()],\n})\nexport class NgpTabPanel {\n /**\n * The value of the tab\n * @required\n */\n readonly value = input<string>(undefined, { alias: 'ngpTabPanelValue' });\n\n /**\n * Determine the id of the tab panel\n * @internal\n */\n readonly id = input<string>();\n\n private readonly state = ngpTabPanel({\n value: this.value,\n id: this.id,\n });\n\n /**\n * Whether the tab is active\n */\n readonly active = this.state.active;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output, signal } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { ngpRovingFocusGroup, provideRovingFocusGroupState } from 'ng-primitives/roving-focus';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectTabsConfig } from '../config/tabs-config';\nimport { ngpTabset, provideTabsetState } from './tabset-state';\n\n/**\n * Apply the `ngpTabset` directive to an element to manage the tabs.\n */\n@Directive({\n selector: '[ngpTabset]',\n exportAs: 'ngpTabset',\n providers: [\n provideTabsetState({ inherit: false }),\n provideRovingFocusGroupState({ inherit: false }),\n ],\n})\nexport class NgpTabset {\n /**\n * Access the global tabset configuration\n */\n private readonly config = injectTabsConfig();\n\n /**\n * Define the id for the tabset\n */\n readonly id = input<string>(uniqueId('ngp-tabset'));\n\n /**\n * Define the active tab\n */\n readonly value = input<string>(undefined, {\n alias: 'ngpTabsetValue',\n });\n\n /**\n * Emit the value of the selected tab when it changes\n */\n readonly valueChange = output<string | undefined>({\n alias: 'ngpTabsetValueChange',\n });\n\n /**\n * The orientation of the tabset\n * @default 'horizontal'\n */\n readonly orientation = input<NgpOrientation>(this.config.orientation, {\n alias: 'ngpTabsetOrientation',\n });\n\n /**\n * Whether tabs should activate on focus\n */\n readonly activateOnFocus = input<boolean, BooleanInput>(this.config.activateOnFocus, {\n alias: 'ngpTabsetActivateOnFocus',\n transform: booleanAttribute,\n });\n\n private readonly state = ngpTabset({\n id: this.id,\n value: this.value,\n orientation: this.orientation,\n activateOnFocus: this.activateOnFocus,\n onValueChange: value => this.valueChange.emit(value),\n });\n\n /**\n * @internal\n * Get the id of the selected tab\n */\n readonly selectedTab = this.state.selectedTab;\n\n constructor() {\n ngpRovingFocusGroup({\n orientation: this.orientation,\n disabled: signal(false),\n wrap: signal(false),\n homeEnd: signal(true),\n });\n }\n\n /**\n * Select a tab by its value\n * @param value The value of the tab to select\n */\n select(value: string): void {\n this.state.select(value);\n }\n\n /**\n * Set orientation of the tabset.\n */\n setOrientation(orientation: NgpOrientation): void {\n this.state.setOrientation(orientation);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAuBO,MAAM,iBAAiB,GAAkB;AAC9C,IAAA,WAAW,EAAE,YAAY;AACzB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,IAAI,EAAE,IAAI;CACX;AAEM,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,CAAC;AAEzF;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,MAA8B,EAAA;IAC9D,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,kBAAkB;AAC3B,YAAA,QAAQ,EAAE,EAAE,GAAG,iBAAiB,EAAE,GAAG,MAAM,EAAE;AAC9C,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,iBAAiB;AAC5E;;AC8CO,MAAM,CAAC,mBAAmB,EAAE,SAAS,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,GAClF,eAAe,CACb,WAAW,EACX,CAAC,EACC,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EACnC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,EACjC,WAAW,EAAE,YAAY,GAAG,MAAM,CA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AE,OAAO,EAAE,KAAK,EAAE,CAAC;AACtC,wBAAA,4BAA4B,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACjD,qBAAA;AACF,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-tabs.mjs","sources":["../../../../packages/ng-primitives/tabs/src/config/tabs-config.ts","../../../../packages/ng-primitives/tabs/src/tabset/tabset-state.ts","../../../../packages/ng-primitives/tabs/src/tab-button/tab-button-state.ts","../../../../packages/ng-primitives/tabs/src/tab-button/tab-button.ts","../../../../packages/ng-primitives/tabs/src/tab-list/tab-list-state.ts","../../../../packages/ng-primitives/tabs/src/tab-list/tab-list.ts","../../../../packages/ng-primitives/tabs/src/tab-panel/tab-panel-state.ts","../../../../packages/ng-primitives/tabs/src/tab-panel/tab-panel.ts","../../../../packages/ng-primitives/tabs/src/tabset/tabset.ts","../../../../packages/ng-primitives/tabs/src/ng-primitives-tabs.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\n\nexport interface NgpTabsConfig {\n /**\n * The orientation of the tabset\n * @default 'horizontal'\n */\n orientation: NgpOrientation;\n\n /**\n * Whether tabs should activate on focus\n * @default true\n */\n activateOnFocus: boolean;\n\n /**\n * Whether focus should wrap within the tab list when using the keyboard.\n * @default true\n */\n wrap: boolean;\n}\n\nexport const defaultTabsConfig: NgpTabsConfig = {\n orientation: 'horizontal',\n activateOnFocus: true,\n wrap: true,\n};\n\nexport const NgpTabsConfigToken = new InjectionToken<NgpTabsConfig>('NgpTabsConfigToken');\n\n/**\n * Provide the default Tabs configuration\n * @param config The Tabs configuration\n * @returns The provider\n */\nexport function provideTabsConfig(config: Partial<NgpTabsConfig>): Provider[] {\n return [\n {\n provide: NgpTabsConfigToken,\n useValue: { ...defaultTabsConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Tabs configuration\n * @returns The global Tabs configuration\n */\nexport function injectTabsConfig(): NgpTabsConfig {\n return inject(NgpTabsConfigToken, { optional: true }) ?? defaultTabsConfig;\n}\n","import { computed, signal, Signal, WritableSignal } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n attrBinding,\n controlled,\n createPrimitive,\n dataBinding,\n deprecatedSetter,\n} from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\n\n/**\n * The state for the NgpTabset directive.\n */\nexport interface NgpTabsetState {\n /**\n * The unique id for the tabset.\n */\n readonly id: Signal<string>;\n\n /**\n * The orientation of the tabset.\n */\n readonly orientation: WritableSignal<NgpOrientation>;\n\n /**\n * Whether tabs should activate on focus.\n */\n readonly activateOnFocus: WritableSignal<boolean>;\n\n /**\n * The selected tab value.\n */\n readonly value: WritableSignal<string | undefined>;\n\n /**\n * The selected tab computed value.\n */\n readonly selectedTab: Signal<string | undefined>;\n\n /**\n * Select a tab by its value.\n */\n select(value: string): void;\n\n /**\n * Set orientation of the tabset.\n */\n setOrientation(orientation: NgpOrientation): void;\n\n /**\n * Set the activateOnFocus.\n */\n setActivateOnFocus(activateOnFocus: boolean): void;\n\n /**\n * @internal Register a tab with the tabset.\n */\n registerTab(tab: NgpTab): void;\n\n /**\n * @internal Unregister a tab with the tabset.\n */\n unregisterTab(value: string): void;\n}\n\n/**\n * The props for the NgpTabset state.\n */\nexport interface NgpTabsetProps {\n /**\n * The unique id for the tabset.\n */\n readonly id?: Signal<string>;\n\n /**\n * The selected tab value.\n */\n readonly value?: Signal<string | undefined>;\n\n /**\n * The orientation of the tabset.\n */\n readonly orientation?: Signal<NgpOrientation>;\n\n /**\n * Whether tabs should activate on focus.\n */\n readonly activateOnFocus?: Signal<boolean>;\n\n /**\n * Callback when the selected tab changes.\n */\n readonly onValueChange?: (value: string | undefined) => void;\n}\n\nexport const [NgpTabsetStateToken, ngpTabset, injectTabsetState, provideTabsetState] =\n createPrimitive(\n 'NgpTabset',\n ({\n id = signal(uniqueId('ngp-tabset')),\n value: _value = signal(undefined),\n orientation: _orientation = signal('horizontal'),\n activateOnFocus: _activateOnFocus = signal(false),\n onValueChange,\n }: NgpTabsetProps) => {\n const element = injectElementRef();\n const tabs = signal<NgpTab[]>([]);\n\n // Controlled properties\n const value = controlled(_value);\n const orientation = controlled(_orientation);\n const activateOnFocus = controlled(_activateOnFocus);\n\n // Host bindings\n attrBinding(element, 'id', id);\n dataBinding(element, 'data-orientation', orientation);\n\n // Computed selected tab\n const selectedTab = computed(() => {\n const tabList = tabs();\n const currentValue = value();\n\n // if there are no tabs then return the selected value\n if (tabList.length === 0) {\n return currentValue;\n }\n\n // if there is a value set and a tab with that value exists, return the value\n if (currentValue && tabList.some(tab => tab.value() === currentValue)) {\n return currentValue;\n }\n\n // otherwise return the first non-disabled tab's value\n return tabList.find(tab => !tab.disabled())?.value();\n });\n\n function select(newValue: string): void {\n // if the value is already selected, do nothing\n if (value() === newValue) {\n return;\n }\n\n value.set(newValue);\n onValueChange?.(newValue);\n }\n\n function setOrientation(newOrientation: NgpOrientation): void {\n orientation.set(newOrientation);\n }\n\n function setActivateOnFocus(newActivateOnFocus: boolean): void {\n activateOnFocus.set(newActivateOnFocus);\n }\n\n function registerTab(tab: NgpTab): void {\n tabs.update(currentTabs => [...currentTabs, tab]);\n }\n\n function unregisterTab(tabValue: string): void {\n tabs.update(currentTabs => currentTabs.filter(tab => tab.value() !== tabValue));\n }\n\n return {\n id,\n orientation: deprecatedSetter(orientation, 'setOrientation'),\n activateOnFocus: deprecatedSetter(activateOnFocus, 'setActivateOnFocus'),\n value: deprecatedSetter(value, 'select'),\n selectedTab,\n select,\n setOrientation,\n registerTab,\n unregisterTab,\n setActivateOnFocus,\n } satisfies NgpTabsetState;\n },\n );\n\nexport interface NgpTab {\n /**\n * The unique value for the tab.\n */\n readonly value: Signal<string>;\n\n /**\n * Whether the tab is disabled.\n */\n readonly disabled: Signal<boolean>;\n}\n","import { HOST_TAG_NAME, Signal, computed, inject, signal } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n attrBinding,\n createPrimitive,\n dataBinding,\n listener,\n onDestroy,\n onMount,\n} from 'ng-primitives/state';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * The state for the NgpTabButton directive.\n */\nexport interface NgpTabButtonState {\n /**\n * The unique id for the tab button.\n */\n readonly id: Signal<string>;\n\n /**\n * Whether the tab is active.\n */\n readonly active: Signal<boolean>;\n\n /**\n * Select the tab this trigger controls.\n */\n select(): void;\n}\n\n/**\n * The props for the NgpTabButton state.\n */\nexport interface NgpTabButtonProps {\n /**\n * The value of the tab this trigger controls.\n */\n readonly value: Signal<string>;\n\n /**\n * Whether the tab is disabled.\n */\n readonly disabled?: Signal<boolean>;\n\n /**\n * The id of the tab button.\n */\n readonly id?: Signal<string | undefined>;\n}\n\nexport const [NgpTabButtonStateToken, ngpTabButton, injectTabButtonState, provideTabButtonState] =\n createPrimitive('NgpTabButton', ({ value, disabled = signal(false), id }: NgpTabButtonProps) => {\n const element = injectElementRef();\n const tagName = inject(HOST_TAG_NAME);\n const tabset = injectTabsetState();\n\n // Computed properties\n const buttonId = computed(() => id?.() ?? `${tabset().id()}-button-${value()}`);\n const ariaControls = computed(() => `${tabset().id()}-panel-${value()}`);\n const active = computed(() => tabset().selectedTab() === value());\n\n // Host bindings\n attrBinding(element, 'role', 'tab');\n attrBinding(element, 'id', buttonId);\n attrBinding(element, 'aria-controls', ariaControls);\n attrBinding(element, 'aria-selected', active);\n dataBinding(element, 'data-active', active);\n dataBinding(element, 'data-disabled', disabled);\n attrBinding(element, 'disabled', () => (tagName === 'button' && disabled() ? '' : null));\n dataBinding(element, 'data-orientation', () => tabset().orientation());\n\n // Event listeners\n listener(element, 'click', select);\n listener(element, 'focus', activateOnFocus);\n\n // Setup interactions\n ngpInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled,\n });\n\n function select(): void {\n if (disabled?.() === false) {\n tabset().select(value());\n }\n }\n\n function activateOnFocus(): void {\n if (tabset().activateOnFocus()) {\n select();\n }\n }\n\n onMount(() => {\n // we can't use a required input for value as it is used in a computed property before the input is set\n if (value() === undefined) {\n throw new Error('ngpTabButton: value is required');\n }\n\n // Register with tabset now that inputs are available\n tabset().registerTab({ value, disabled });\n });\n\n // Unregister on destroy\n onDestroy(() => {\n tabset().unregisterTab(value());\n });\n\n return {\n id: buttonId,\n active,\n select,\n } satisfies NgpTabButtonState;\n });\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, Signal } from '@angular/core';\nimport { ngpRovingFocusItem, provideRovingFocusItemState } from 'ng-primitives/roving-focus';\nimport { ngpTabButton, provideTabButtonState } from './tab-button-state';\n\n/**\n * Apply the `ngpTabButton` directive to an element within a tab list to represent a tab button. This directive should be applied to a button element.\n */\n@Directive({\n selector: '[ngpTabButton]',\n exportAs: 'ngpTabButton',\n providers: [provideTabButtonState(), provideRovingFocusItemState()],\n})\nexport class NgpTabButton {\n /**\n * The value of the tab this trigger controls\n * @required\n */\n readonly value = input<string>(undefined, { alias: 'ngpTabButtonValue' });\n\n /**\n * Whether the tab is disabled\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpTabButtonDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Determine the id of the tab button\n * @internal\n */\n readonly id = input<string>();\n\n private readonly state = ngpTabButton({\n value: this.value as Signal<string>,\n disabled: this.disabled,\n id: this.id,\n });\n\n /**\n * Whether the tab is active\n */\n readonly active = this.state.active;\n\n constructor() {\n ngpRovingFocusItem({ disabled: this.disabled });\n }\n\n /**\n * Select the tab this trigger controls\n */\n select(): void {\n this.state.select();\n }\n}\n","import { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding } from 'ng-primitives/state';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * The state for the NgpTabList directive.\n */\nexport interface NgpTabListState {\n // No public methods exposed for tab list\n}\n\n/**\n * The props for the NgpTabList state.\n */\nexport interface NgpTabListProps {\n // No props for tab list\n}\n\nexport const [NgpTabListStateToken, ngpTabList, injectTabListState, provideTabListState] =\n createPrimitive('NgpTabList', ({}: NgpTabListProps) => {\n const element = injectElementRef();\n const tabsetState = injectTabsetState();\n\n // Host bindings\n attrBinding(element, 'role', 'tablist');\n attrBinding(element, 'aria-orientation', () => tabsetState().orientation());\n dataBinding(element, 'data-orientation', () => tabsetState().orientation());\n\n return {} satisfies NgpTabListState;\n });\n","import { Directive } from '@angular/core';\nimport { ngpTabList, provideTabListState } from './tab-list-state';\n\n/**\n * Apply the `ngpTabList` directive to an element that represents the list of tab buttons.\n */\n@Directive({\n selector: '[ngpTabList]',\n exportAs: 'ngpTabList',\n providers: [provideTabListState()],\n})\nexport class NgpTabList {\n constructor() {\n ngpTabList({});\n }\n}\n","import { Signal, computed } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, onMount } from 'ng-primitives/state';\nimport { injectTabsetState } from '../tabset/tabset-state';\n\n/**\n * The state for the NgpTabPanel directive.\n */\nexport interface NgpTabPanelState {\n /**\n * The unique id for the tab panel.\n */\n readonly panelId: Signal<string>;\n\n /**\n * The aria-labelledby attribute for the tab panel.\n */\n readonly labelledBy: Signal<string>;\n\n /**\n * Whether the tab panel is active.\n */\n readonly active: Signal<boolean>;\n}\n\n/**\n * The props for the NgpTabPanel state.\n */\nexport interface NgpTabPanelProps {\n /**\n * The value of the tab this panel represents.\n */\n readonly value: Signal<string | undefined>;\n\n /**\n * The id of the tab panel.\n */\n readonly id?: Signal<string | undefined>;\n}\n\nexport const [NgpTabPanelStateToken, ngpTabPanel, injectTabPanelState, provideTabPanelState] =\n createPrimitive('NgpTabPanel', ({ value, id }: NgpTabPanelProps) => {\n const element = injectElementRef();\n const tabset = injectTabsetState();\n\n // Computed properties\n const panelId = computed(() => id?.() ?? `${tabset().id()}-panel-${value?.()}`);\n const labelledBy = computed(() => `${tabset().id()}-button-${value?.()}`);\n const active = computed(() => tabset().selectedTab() === value?.());\n\n // Host bindings\n attrBinding(element, 'role', 'tabpanel');\n attrBinding(element, 'tabindex', () => (active() ? '0' : null));\n attrBinding(element, 'aria-hidden', () => (active() ? null : 'true'));\n attrBinding(element, 'id', panelId);\n attrBinding(element, 'aria-labelledby', labelledBy);\n dataBinding(element, 'data-active', active);\n dataBinding(element, 'data-orientation', () => tabset().orientation());\n\n // Ensure value is provided\n onMount(() => {\n if (value() === undefined) {\n throw new Error('ngpTabPanel: value is required');\n }\n });\n\n return {\n panelId,\n labelledBy,\n active,\n } satisfies NgpTabPanelState;\n });\n","import { Directive, input } from '@angular/core';\nimport { ngpTabPanel, provideTabPanelState } from './tab-panel-state';\n\n/**\n * Apply the `ngpTabPanel` directive to an element that represents the content of a tab.\n */\n@Directive({\n selector: '[ngpTabPanel]',\n exportAs: 'ngpTabPanel',\n providers: [provideTabPanelState()],\n})\nexport class NgpTabPanel {\n /**\n * The value of the tab\n * @required\n */\n readonly value = input<string>(undefined, { alias: 'ngpTabPanelValue' });\n\n /**\n * Determine the id of the tab panel\n * @internal\n */\n readonly id = input<string>();\n\n private readonly state = ngpTabPanel({\n value: this.value,\n id: this.id,\n });\n\n /**\n * Whether the tab is active\n */\n readonly active = this.state.active;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output, signal } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { ngpRovingFocusGroup, provideRovingFocusGroupState } from 'ng-primitives/roving-focus';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectTabsConfig } from '../config/tabs-config';\nimport { ngpTabset, provideTabsetState } from './tabset-state';\n\n/**\n * Apply the `ngpTabset` directive to an element to manage the tabs.\n */\n@Directive({\n selector: '[ngpTabset]',\n exportAs: 'ngpTabset',\n providers: [\n provideTabsetState({ inherit: false }),\n provideRovingFocusGroupState({ inherit: false }),\n ],\n})\nexport class NgpTabset {\n /**\n * Access the global tabset configuration\n */\n private readonly config = injectTabsConfig();\n\n /**\n * Define the id for the tabset\n */\n readonly id = input<string>(uniqueId('ngp-tabset'));\n\n /**\n * Define the active tab\n */\n readonly value = input<string>(undefined, {\n alias: 'ngpTabsetValue',\n });\n\n /**\n * Emit the value of the selected tab when it changes\n */\n readonly valueChange = output<string | undefined>({\n alias: 'ngpTabsetValueChange',\n });\n\n /**\n * The orientation of the tabset\n * @default 'horizontal'\n */\n readonly orientation = input<NgpOrientation>(this.config.orientation, {\n alias: 'ngpTabsetOrientation',\n });\n\n /**\n * Whether tabs should activate on focus\n */\n readonly activateOnFocus = input<boolean, BooleanInput>(this.config.activateOnFocus, {\n alias: 'ngpTabsetActivateOnFocus',\n transform: booleanAttribute,\n });\n\n private readonly state = ngpTabset({\n id: this.id,\n value: this.value,\n orientation: this.orientation,\n activateOnFocus: this.activateOnFocus,\n onValueChange: value => this.valueChange.emit(value),\n });\n\n /**\n * @internal\n * Get the id of the selected tab\n */\n readonly selectedTab = this.state.selectedTab;\n\n constructor() {\n ngpRovingFocusGroup({\n orientation: this.orientation,\n disabled: signal(false),\n wrap: signal(false),\n homeEnd: signal(true),\n });\n }\n\n /**\n * Select a tab by its value\n * @param value The value of the tab to select\n */\n select(value: string): void {\n this.state.select(value);\n }\n\n /**\n * Set orientation of the tabset.\n */\n setOrientation(orientation: NgpOrientation): void {\n this.state.setOrientation(orientation);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAuBO,MAAM,iBAAiB,GAAkB;AAC9C,IAAA,WAAW,EAAE,YAAY;AACzB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,IAAI,EAAE,IAAI;CACX;AAEM,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,CAAC;AAEzF;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,MAA8B,EAAA;IAC9D,OAAO;AACL,QAAA;AACE,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AQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,SAAS,EAAE;AACT,wBAAA,kBAAkB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACtC,wBAAA,4BAA4B,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACjD,qBAAA;AACF,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
@@ -27,13 +27,11 @@ class NgpTextarea {
|
|
|
27
27
|
/**
|
|
28
28
|
* The id of the textarea. If not provided, a unique id will be generated.
|
|
29
29
|
*/
|
|
30
|
-
this.id = input(uniqueId('ngp-textarea'), ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
30
|
+
this.id = input(uniqueId('ngp-textarea'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
31
31
|
/**
|
|
32
32
|
* Whether the element is disabled.
|
|
33
33
|
*/
|
|
34
|
-
this.disabled = input(false, ...(ngDevMode ?
|
|
35
|
-
transform: booleanAttribute,
|
|
36
|
-
}]));
|
|
34
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
37
35
|
/**
|
|
38
36
|
* The state of the textarea.
|
|
39
37
|
*/
|
|
@@ -49,10 +47,10 @@ class NgpTextarea {
|
|
|
49
47
|
setDisabled(value) {
|
|
50
48
|
this.state.setDisabled(value);
|
|
51
49
|
}
|
|
52
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
53
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
50
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpTextarea, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
51
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpTextarea, isStandalone: true, selector: "[ngpTextarea]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideTextareaState({ inherit: false })], exportAs: ["ngpTextarea"], ngImport: i0 }); }
|
|
54
52
|
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpTextarea, decorators: [{
|
|
56
54
|
type: Directive,
|
|
57
55
|
args: [{
|
|
58
56
|
selector: '[ngpTextarea]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-textarea.mjs","sources":["../../../../packages/ng-primitives/textarea/src/textarea/textarea-state.ts","../../../../packages/ng-primitives/textarea/src/textarea/textarea.ts","../../../../packages/ng-primitives/textarea/src/ng-primitives-textarea.ts"],"sourcesContent":["import { Signal, signal, WritableSignal } from '@angular/core';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, controlled, createPrimitive, dataBinding } from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\n\n/**\n * Public state surface for the Textarea primitive.\n */\nexport interface NgpTextareaState {\n /**\n * The id of the textarea.\n */\n readonly id: Signal<string>;\n /**\n * Whether the textarea is disabled.\n */\n readonly disabled: WritableSignal<boolean>;\n\n /**\n * Set the disabled state of the textarea.\n */\n setDisabled(disabled: boolean): void;\n}\n\n/**\n * Inputs for configuring the Textarea primitive.\n */\nexport interface NgpTextareaProps {\n /**\n * The id of the textarea.\n */\n readonly id?: Signal<string>;\n /**\n * Whether the textarea is disabled.\n */\n readonly disabled?: Signal<boolean>;\n}\n\nexport const [NgpTextareaStateToken, ngpTextarea, injectTextareaState, provideTextareaState] =\n createPrimitive(\n 'NgpTextarea',\n ({\n id = signal(uniqueId('ngp-textarea')),\n disabled: _disabled = signal(false),\n }: NgpTextareaProps) => {\n const element = injectElementRef();\n const disabled = controlled(_disabled);\n\n // Setup interactions and form control bindings\n ngpInteractions({ hover: true, press: true, focus: true, disabled });\n ngpFormControl({ id, disabled });\n\n // Host bindings\n attrBinding(element, 'id', id);\n attrBinding(element, 'disabled', () => (disabled() ? '' : null));\n dataBinding(element, 'data-disabled', disabled);\n\n function setDisabled(value: boolean) {\n disabled.set(value);\n }\n\n return { id, disabled, setDisabled } satisfies NgpTextareaState;\n },\n );\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpTextarea, provideTextareaState } from './textarea-state';\n\n@Directive({\n selector: '[ngpTextarea]',\n exportAs: 'ngpTextarea',\n providers: [provideTextareaState({ inherit: false })],\n})\nexport class NgpTextarea {\n /**\n * The id of the textarea. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-textarea'));\n\n /**\n * Whether the element is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute,\n });\n\n /**\n * The state of the textarea.\n */\n protected readonly state = ngpTextarea({\n id: this.id,\n disabled: this.disabled,\n });\n\n /**\n * Set the disabled state of the textarea.\n * @param value The disabled state.\n */\n setDisabled(value: boolean): void {\n this.state.setDisabled(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAwCO,MAAM,CAAC,qBAAqB,EAAE,WAAW,EAAE,mBAAmB,EAAE,oBAAoB,CAAC,GAC1F,eAAe,CACb,aAAa,EACb,CAAC,EACC,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,EACrC,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,GAClB,KAAI;AACrB,IAAA,MAAM,OAAO,GAAG,gBAAgB,EAAE;AAClC,IAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC;;AAGtC,IAAA,eAAe,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AACpE,IAAA,cAAc,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;;AAGhC,IAAA,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;IAC9B,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;AAChE,IAAA,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,CAAC;IAE/C,SAAS,WAAW,CAAC,KAAc,EAAA;AACjC,QAAA,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;IACrB;AAEA,IAAA,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAW,EAA6B;AACjE,CAAC;;MCtDQ,WAAW,CAAA;AALxB,IAAA,WAAA,GAAA;AAME;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,QAAQ,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"ng-primitives-textarea.mjs","sources":["../../../../packages/ng-primitives/textarea/src/textarea/textarea-state.ts","../../../../packages/ng-primitives/textarea/src/textarea/textarea.ts","../../../../packages/ng-primitives/textarea/src/ng-primitives-textarea.ts"],"sourcesContent":["import { Signal, signal, WritableSignal } from '@angular/core';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, controlled, createPrimitive, dataBinding } from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\n\n/**\n * Public state surface for the Textarea primitive.\n */\nexport interface NgpTextareaState {\n /**\n * The id of the textarea.\n */\n readonly id: Signal<string>;\n /**\n * Whether the textarea is disabled.\n */\n readonly disabled: WritableSignal<boolean>;\n\n /**\n * Set the disabled state of the textarea.\n */\n setDisabled(disabled: boolean): void;\n}\n\n/**\n * Inputs for configuring the Textarea primitive.\n */\nexport interface NgpTextareaProps {\n /**\n * The id of the textarea.\n */\n readonly id?: Signal<string>;\n /**\n * Whether the textarea is disabled.\n */\n readonly disabled?: Signal<boolean>;\n}\n\nexport const [NgpTextareaStateToken, ngpTextarea, injectTextareaState, provideTextareaState] =\n createPrimitive(\n 'NgpTextarea',\n ({\n id = signal(uniqueId('ngp-textarea')),\n disabled: _disabled = signal(false),\n }: NgpTextareaProps) => {\n const element = injectElementRef();\n const disabled = controlled(_disabled);\n\n // Setup interactions and form control bindings\n ngpInteractions({ hover: true, press: true, focus: true, disabled });\n ngpFormControl({ id, disabled });\n\n // Host bindings\n attrBinding(element, 'id', id);\n attrBinding(element, 'disabled', () => (disabled() ? '' : null));\n dataBinding(element, 'data-disabled', disabled);\n\n function setDisabled(value: boolean) {\n disabled.set(value);\n }\n\n return { id, disabled, setDisabled } satisfies NgpTextareaState;\n },\n );\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpTextarea, provideTextareaState } from './textarea-state';\n\n@Directive({\n selector: '[ngpTextarea]',\n exportAs: 'ngpTextarea',\n providers: [provideTextareaState({ inherit: false })],\n})\nexport class NgpTextarea {\n /**\n * The id of the textarea. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-textarea'));\n\n /**\n * Whether the element is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute,\n });\n\n /**\n * The state of the textarea.\n */\n protected readonly state = ngpTextarea({\n id: this.id,\n disabled: this.disabled,\n });\n\n /**\n * Set the disabled state of the textarea.\n * @param value The disabled state.\n */\n setDisabled(value: boolean): void {\n this.state.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
this.injector = inject(Injector);
|
|
69
69
|
// Map to store containers by placement
|
|
70
70
|
this.containers = new Map();
|
|
71
|
-
this.toasts = signal([], ...(ngDevMode ? [{ debugName: "toasts" }] : []));
|
|
71
|
+
this.toasts = signal([], ...(ngDevMode ? [{ debugName: "toasts" }] : /* istanbul ignore next */ []));
|
|
72
72
|
/** Signal that tracks which placements are expanded */
|
|
73
|
-
this.expanded = signal([], ...(ngDevMode ? [{ debugName: "expanded" }] : []));
|
|
73
|
+
this.expanded = signal([], ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
74
74
|
}
|
|
75
75
|
/** Show a toast notification */
|
|
76
76
|
show(toast, options = {}) {
|
|
@@ -191,10 +191,10 @@ class NgpToastManager {
|
|
|
191
191
|
this.renderer.appendChild(document.body, container);
|
|
192
192
|
return container;
|
|
193
193
|
}
|
|
194
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
195
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
194
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpToastManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
195
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpToastManager, providedIn: 'root' }); }
|
|
196
196
|
}
|
|
197
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpToastManager, decorators: [{
|
|
198
198
|
type: Injectable,
|
|
199
199
|
args: [{
|
|
200
200
|
providedIn: 'root',
|
|
@@ -253,12 +253,12 @@ class NgpToast {
|
|
|
253
253
|
/** @internal */
|
|
254
254
|
this.options = injectToastOptions();
|
|
255
255
|
this.interactivityChecker = inject(InteractivityChecker);
|
|
256
|
-
this.isInteracting = signal(false, ...(ngDevMode ? [{ debugName: "isInteracting" }] : []));
|
|
256
|
+
this.isInteracting = signal(false, ...(ngDevMode ? [{ debugName: "isInteracting" }] : /* istanbul ignore next */ []));
|
|
257
257
|
this.pointerStartRef = null;
|
|
258
258
|
this.dragStartTime = null;
|
|
259
|
-
this.swiping = signal(false, ...(ngDevMode ? [{ debugName: "swiping" }] : []));
|
|
260
|
-
this.swipeDirection = signal(null, ...(ngDevMode ? [{ debugName: "swipeDirection" }] : []));
|
|
261
|
-
this.swipeAmount = signal({ x: 0, y: 0 }, ...(ngDevMode ? [{ debugName: "swipeAmount" }] : []));
|
|
259
|
+
this.swiping = signal(false, ...(ngDevMode ? [{ debugName: "swiping" }] : /* istanbul ignore next */ []));
|
|
260
|
+
this.swipeDirection = signal(null, ...(ngDevMode ? [{ debugName: "swipeDirection" }] : /* istanbul ignore next */ []));
|
|
261
|
+
this.swipeAmount = signal({ x: 0, y: 0 }, ...(ngDevMode ? [{ debugName: "swipeAmount" }] : /* istanbul ignore next */ []));
|
|
262
262
|
this.swipeOutDirection = computed(() => {
|
|
263
263
|
const direction = this.swipeDirection();
|
|
264
264
|
if (direction === 'x') {
|
|
@@ -268,19 +268,19 @@ class NgpToast {
|
|
|
268
268
|
return this.swipeAmount().y > 0 ? 'bottom' : 'top';
|
|
269
269
|
}
|
|
270
270
|
return null;
|
|
271
|
-
}, ...(ngDevMode ? [{ debugName: "swipeOutDirection" }] : []));
|
|
271
|
+
}, ...(ngDevMode ? [{ debugName: "swipeOutDirection" }] : /* istanbul ignore next */ []));
|
|
272
272
|
/**
|
|
273
273
|
* Get all toasts that are currently being displayed in the same position.
|
|
274
274
|
*/
|
|
275
275
|
this.toasts = computed(() => this.manager
|
|
276
276
|
.toasts()
|
|
277
|
-
.filter(toast => toast.instance.options.placement === this.options.placement), ...(ngDevMode ? [{ debugName: "toasts" }] : []));
|
|
277
|
+
.filter(toast => toast.instance.options.placement === this.options.placement), ...(ngDevMode ? [{ debugName: "toasts" }] : /* istanbul ignore next */ []));
|
|
278
278
|
/**
|
|
279
279
|
* The number of toasts that are currently being displayed before this toast.
|
|
280
280
|
*/
|
|
281
281
|
this.index = computed(() => {
|
|
282
282
|
return this.toasts().findIndex(toast => toast.instance === this);
|
|
283
|
-
}, ...(ngDevMode ? [{ debugName: "index" }] : []));
|
|
283
|
+
}, ...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
284
284
|
/**
|
|
285
285
|
* Determine the position of the toast in the list of toasts.
|
|
286
286
|
* This is the combination of the heights of all the toasts before this one, plus the gap between them.
|
|
@@ -290,7 +290,7 @@ class NgpToast {
|
|
|
290
290
|
return this.toasts()
|
|
291
291
|
.slice(0, this.index())
|
|
292
292
|
.reduce((acc, toast) => acc + toast.instance.dimensions().height + gap, 0);
|
|
293
|
-
}, ...(ngDevMode ? [{ debugName: "offset" }] : []));
|
|
293
|
+
}, ...(ngDevMode ? [{ debugName: "offset" }] : /* istanbul ignore next */ []));
|
|
294
294
|
/**
|
|
295
295
|
* Determine if this toast is visible.
|
|
296
296
|
* Visible considers the maximum number of toasts that can be displayed at once, and the last x toasts that are currently being displayed.
|
|
@@ -299,7 +299,7 @@ class NgpToast {
|
|
|
299
299
|
const maxToasts = this.config.maxToasts;
|
|
300
300
|
// determine if this toast is within the maximum number of toasts that can be displayed
|
|
301
301
|
return this.index() < maxToasts || this.toasts().length <= maxToasts;
|
|
302
|
-
}, ...(ngDevMode ? [{ debugName: "visible" }] : []));
|
|
302
|
+
}, ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
303
303
|
/**
|
|
304
304
|
* Determine the height of the front toast.
|
|
305
305
|
* This is used to determine the height of the toast when it is not expanded.
|
|
@@ -309,13 +309,13 @@ class NgpToast {
|
|
|
309
309
|
return (this.toasts()
|
|
310
310
|
.find(toast => toast.instance.dimensions().height)
|
|
311
311
|
?.instance.dimensions().height || 0);
|
|
312
|
-
}, ...(ngDevMode ? [{ debugName: "frontToastHeight" }] : []));
|
|
312
|
+
}, ...(ngDevMode ? [{ debugName: "frontToastHeight" }] : /* istanbul ignore next */ []));
|
|
313
313
|
/**
|
|
314
314
|
* Determine the z-index of the toast. This is the inverse of the index.
|
|
315
315
|
* The first toast will have the highest z-index, and the last toast will have the lowest z-index.
|
|
316
316
|
* This is used to ensure that the first toast is always on top of the others.
|
|
317
317
|
*/
|
|
318
|
-
this.zIndex = computed(() => this.toasts().length - this.index(), ...(ngDevMode ? [{ debugName: "zIndex" }] : []));
|
|
318
|
+
this.zIndex = computed(() => this.toasts().length - this.index(), ...(ngDevMode ? [{ debugName: "zIndex" }] : /* istanbul ignore next */ []));
|
|
319
319
|
/**
|
|
320
320
|
* The height of the toast in pixels.
|
|
321
321
|
*/
|
|
@@ -447,10 +447,10 @@ class NgpToast {
|
|
|
447
447
|
this.swipeDirection.set(null);
|
|
448
448
|
this.swiping.set(false);
|
|
449
449
|
}
|
|
450
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
451
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
450
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpToast, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
451
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.14", type: NgpToast, isStandalone: true, selector: "[ngpToast]", host: { listeners: { "pointerdown": "onPointerDown($event)", "pointermove": "onPointerMove($event)", "pointerup": "onPointerUp()" }, properties: { "attr.data-position-x": "x", "attr.data-position-y": "y", "attr.data-visible": "visible()", "attr.data-front": "index() === 0", "attr.data-swiping": "swiping()", "attr.data-swipe-direction": "swipeOutDirection()", "attr.data-expanded": "options.expanded()", "style.--ngp-toast-gap.px": "config.gap", "style.--ngp-toast-z-index": "zIndex()", "style.--ngp-toasts-before": "index()", "style.--ngp-toast-index": "index() + 1", "style.--ngp-toast-height.px": "dimensions().height", "style.--ngp-toast-offset.px": "offset()", "style.--ngp-toast-front-height.px": "frontToastHeight()", "style.--ngp-toast-swipe-amount-x.px": "swipeAmount().x", "style.--ngp-toast-swipe-amount-y.px": "swipeAmount().y", "style.--ngp-toast-swipe-x": "swipeAmount().x", "style.--ngp-toast-swipe-y": "swipeAmount().y" } }, exportAs: ["ngpToast"], ngImport: i0 }); }
|
|
452
452
|
}
|
|
453
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
453
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpToast, decorators: [{
|
|
454
454
|
type: Directive,
|
|
455
455
|
args: [{
|
|
456
456
|
selector: '[ngpToast]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-toast.mjs","sources":["../../../../packages/ng-primitives/toast/src/config/toast-config.ts","../../../../packages/ng-primitives/toast/src/toast/toast-context.ts","../../../../packages/ng-primitives/toast/src/toast/toast-options.ts","../../../../packages/ng-primitives/toast/src/toast/toast-manager.ts","../../../../packages/ng-primitives/toast/src/toast/toast-timer.ts","../../../../packages/ng-primitives/toast/src/toast/toast.ts","../../../../packages/ng-primitives/toast/src/ng-primitives-toast.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpToastPlacement, NgpToastSwipeDirection } from '../toast/toast';\n\nexport interface NgpToastConfig {\n /**\n * The position of the toast.\n */\n placement: NgpToastPlacement;\n\n /**\n * The duration of each toast.\n */\n duration: number;\n\n /**\n * The offset from the top of the viewport in pixels.\n */\n offsetTop: number;\n\n /**\n * The offset from the bottom of the viewport in pixels.\n */\n offsetBottom: number;\n\n /**\n * The offset from the left of the viewport in pixels.\n */\n offsetLeft: number;\n\n /**\n * The offset from the right of the viewport in pixels.\n */\n offsetRight: number;\n\n /**\n * Whether a toast can be dismissed by swiping.\n */\n dismissible: boolean;\n\n /**\n * The amount a toast must be swiped before it is considered dismissed.\n */\n swipeThreshold: number;\n\n /**\n * The default swipe directions supported by the toast.\n */\n swipeDirections: NgpToastSwipeDirection[];\n\n /**\n * The maximum number of toasts that can be displayed at once.\n */\n maxToasts: number;\n\n /**\n * The aria live setting.\n */\n ariaLive: string;\n\n /**\n * The gap between each toast.\n */\n gap: number;\n\n /**\n * The z-index of the toast container.\n * This is used to ensure that the toast container is always on top of other elements.\n */\n zIndex: number;\n\n /**\n * When true, only the front toast's timer will run.\n * When a toast is dismissed, the timer will start on the next toast.\n */\n sequential: boolean;\n\n /**\n * When true, toasts will not auto-dismiss and must be dismissed explicitly.\n */\n persistent: boolean;\n}\n\nexport const defaultToastConfig: NgpToastConfig = {\n gap: 14,\n duration: 3000,\n placement: 'top-end',\n offsetTop: 24,\n offsetBottom: 24,\n offsetLeft: 24,\n offsetRight: 24,\n swipeThreshold: 45,\n swipeDirections: ['left', 'right', 'top', 'bottom'],\n dismissible: true,\n maxToasts: 3,\n zIndex: 9999999,\n ariaLive: 'polite',\n sequential: false,\n persistent: false,\n};\n\nexport const NgpToastConfigToken = new InjectionToken<NgpToastConfig>('NgpToastConfigToken');\n\n/**\n * Provide the default Toast configuration\n * @param config The Toast configuration\n * @returns The provider\n */\nexport function provideToastConfig(config: Partial<NgpToastConfig>): Provider[] {\n return [\n {\n provide: NgpToastConfigToken,\n useValue: { ...defaultToastConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Toast configuration\n * @returns The global Toast configuration\n */\nexport function injectToastConfig(): NgpToastConfig {\n return inject(NgpToastConfigToken, { optional: true }) ?? defaultToastConfig;\n}\n","import { inject, InjectionToken, ValueProvider } from '@angular/core';\n\nconst NgpToastContext = new InjectionToken<unknown>('NgpToastContext');\n\nexport function provideToastContext<T>(context: T): ValueProvider {\n return { provide: NgpToastContext, useValue: context };\n}\n\nexport function injectToastContext<T>(): T {\n return inject(NgpToastContext) as T;\n}\n","import { inject, InjectionToken, Signal, ValueProvider } from '@angular/core';\nimport type { NgpToast, NgpToastSwipeDirection, NgpToastPlacement } from './toast';\n\nconst NgpToastOptions = new InjectionToken<NgpToastOptions>('NgpToastOptions');\n\nexport function provideToastOptions(context: NgpToastOptions): ValueProvider {\n return { provide: NgpToastOptions, useValue: context };\n}\n\nexport function injectToastOptions(): NgpToastOptions {\n return inject(NgpToastOptions);\n}\n\nexport interface NgpToastOptions {\n /**\n * The position of the toast.\n */\n placement: NgpToastPlacement;\n\n /**\n * The duration of the toast in milliseconds.\n */\n duration: number;\n\n /**\n * A function to register the toast instance with the manager.\n * @internal\n */\n register: (toast: NgpToast) => void;\n\n /**\n * Whether the toast region is expanded.\n * @internal\n */\n expanded: Signal<boolean>;\n\n /**\n * Whether the toast supports swipe dismiss.\n * @internal\n */\n dismissible: boolean;\n\n /**\n * The swipe directions supported by the toast.\n * @internal\n */\n swipeDirections: NgpToastSwipeDirection[];\n\n /**\n * When true, only the front toast's timer will run.\n * @internal\n */\n sequential: boolean;\n\n /**\n * When true, the toast will not auto-dismiss and must be dismissed explicitly.\n * @internal\n */\n persistent: boolean;\n}\n","import {\n ApplicationRef,\n computed,\n inject,\n Injectable,\n Injector,\n RendererFactory2,\n signal,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport { createPortal, NgpPortal } from 'ng-primitives/portal';\nimport { injectToastConfig } from '../config/toast-config';\nimport { NgpToast, NgpToastPlacement, NgpToastSwipeDirection } from './toast';\nimport { provideToastContext } from './toast-context';\nimport { provideToastOptions } from './toast-options';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgpToastManager {\n private readonly config = injectToastConfig();\n private readonly applicationRef = inject(ApplicationRef);\n private readonly rendererFactory = inject(RendererFactory2);\n private readonly renderer = this.rendererFactory.createRenderer(null, null);\n private readonly injector = inject(Injector);\n // Map to store containers by placement\n private readonly containers = new Map<string, HTMLElement>();\n\n readonly toasts = signal<NgpToastRecord[]>([]);\n\n /** Signal that tracks which placements are expanded */\n private readonly expanded = signal<NgpToastPlacement[]>([]);\n\n /** Show a toast notification */\n show(toast: TemplateRef<void> | Type<unknown>, options: NgpToastOptions = {}): NgpToastRef {\n // services can't access the view container directly, so this is a workaround\n const rootComponent = this.applicationRef.components[0];\n const viewContainerRef = rootComponent?.injector.get(ViewContainerRef) ?? null;\n\n let instance: NgpToast | null = null;\n const placement = options.placement ?? this.config.placement;\n const duration = options.duration ?? this.config.duration;\n const container = this.getOrCreateContainer(placement);\n\n const portal = createPortal(\n toast,\n viewContainerRef,\n Injector.create({\n parent: this.injector,\n providers: [\n provideToastContext(options.context),\n provideToastOptions({\n placement,\n duration,\n register: (toast: NgpToast) => (instance = toast),\n expanded: computed(() => this.expanded().includes(placement)),\n dismissible: options.dismissible ?? this.config.dismissible,\n swipeDirections: options.swipeDirections ?? this.config.swipeDirections,\n sequential: options.sequential ?? this.config.sequential,\n persistent: options.persistent ?? this.config.persistent,\n }),\n ],\n }),\n {\n // Hide the toast when the dismiss method is called\n dismiss: () => this.dismiss(instance!),\n context: options.context,\n },\n );\n\n portal.attach(container);\n\n // Add the toast to the list of toasts\n if (!instance) {\n throw new Error('A toast must have the NgpToast directive applied.');\n }\n\n this.toasts.update(toasts => [{ instance: instance!, portal }, ...toasts]);\n\n return {\n dismiss: () => this.dismiss(instance!),\n };\n }\n\n /** Hide a toast notification */\n async dismiss(toast: NgpToast): Promise<void> {\n const ref = this.toasts().find(t => t.instance === toast);\n\n if (ref) {\n // Detach the portal from the container\n await ref.portal.detach();\n\n // Remove the toast from the list of toasts\n this.toasts.update(toasts => toasts.filter(t => t !== ref));\n\n // if there are no more toasts, ensure the container is no longer considered expanded\n if (this.toasts().length === 0) {\n this.expanded.update(expanded => expanded.filter(p => p !== toast.options.placement));\n }\n }\n }\n\n /**\n * Lazily create or get a container for a given placement.\n */\n private getOrCreateContainer(placement: string): HTMLElement {\n if (this.containers.has(placement)) {\n return this.containers.get(placement)!;\n }\n const container = this.createContainer(placement);\n this.containers.set(placement, container);\n return container;\n }\n\n /**\n * Create a section in which toasts will be rendered for a specific placement.\n */\n private createContainer(placement: string): HTMLElement {\n const container = this.renderer.createElement('section') as HTMLElement;\n this.renderer.setAttribute(container, 'aria-live', this.config.ariaLive);\n this.renderer.setAttribute(container, 'aria-atomic', 'false');\n this.renderer.setAttribute(container, 'tabindex', '-1');\n this.renderer.setAttribute(container, 'data-ngp-toast-container', placement);\n container.style.setProperty('position', 'fixed');\n container.style.setProperty('z-index', `${this.config.zIndex}`);\n container.style.setProperty('--ngp-toast-offset-top', `${this.config.offsetTop}px`);\n container.style.setProperty('--ngp-toast-offset-bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('--ngp-toast-offset-left', `${this.config.offsetLeft}px`);\n container.style.setProperty('--ngp-toast-offset-right', `${this.config.offsetRight}px`);\n container.style.setProperty('--ngp-toast-gap', `${this.config.gap}px`);\n\n // mark the container as expanded\n this.renderer.listen(container, 'mouseenter', () =>\n this.expanded.update(expanded => [...expanded, placement as NgpToastPlacement]),\n );\n\n this.renderer.listen(container, 'mouseleave', () => {\n this.expanded.update(expanded =>\n expanded.filter(p => p !== (placement as NgpToastPlacement)),\n );\n });\n\n // Set placement styles\n switch (placement) {\n case 'top-start':\n container.style.setProperty('top', `${this.config.offsetTop}px`);\n container.style.setProperty('left', `${this.config.offsetLeft}px`);\n break;\n case 'top-center':\n container.style.setProperty('top', `${this.config.offsetTop}px`);\n container.style.setProperty('left', '50%');\n container.style.setProperty('transform', 'translateX(-50%)');\n break;\n case 'top-end':\n container.style.setProperty('top', `${this.config.offsetTop}px`);\n container.style.setProperty('right', `${this.config.offsetRight}px`);\n break;\n case 'bottom-start':\n container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('left', `${this.config.offsetLeft}px`);\n break;\n case 'bottom-center':\n container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('left', '50%');\n container.style.setProperty('transform', 'translateX(-50%)');\n break;\n case 'bottom-end':\n container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('right', `${this.config.offsetRight}px`);\n break;\n default:\n throw new Error(`Unknown toast placement: ${placement}`);\n }\n\n this.renderer.appendChild(document.body, container);\n return container;\n }\n}\n\nexport interface NgpToastOptions<T = unknown> {\n /** The position of the toast */\n placement?: NgpToastPlacement;\n\n /** The duration of the toast in milliseconds */\n duration?: number;\n\n /** Whether the toast is dismissible */\n dismissible?: boolean;\n\n /** The swipe directions supported by the toast */\n swipeDirections?: NgpToastSwipeDirection[];\n\n /** The context to make available to the toast */\n context?: T;\n\n /** When enabled, only the front toast's timer will run */\n sequential?: boolean;\n\n /** When true, the toast will not auto-dismiss and must be dismissed explicitly */\n persistent?: boolean;\n}\n\ninterface NgpToastRecord {\n instance: NgpToast;\n portal: NgpPortal;\n}\n\nexport interface NgpToastRef {\n dismiss(): Promise<void>;\n}\n","class NgpToastTimer {\n private startTime: number | null = null;\n private remaining: number;\n private timeoutId: ReturnType<typeof setTimeout> | null = null;\n private isRunning = false;\n\n constructor(\n private duration: number,\n private callback: () => void,\n private readonly persistent = false,\n ) {\n this.remaining = duration;\n }\n\n start(): void {\n if (this.persistent) return;\n if (this.isRunning) return;\n\n this.isRunning = true;\n this.startTime = Date.now();\n\n this.timeoutId = setTimeout(() => {\n this.isRunning = false;\n this.callback();\n }, this.remaining);\n }\n\n pause(): void {\n if (!this.isRunning || this.startTime === null) return;\n\n this.isRunning = false;\n clearTimeout(this.timeoutId!);\n\n const elapsed = Date.now() - this.startTime;\n this.remaining -= elapsed;\n this.startTime = null;\n this.timeoutId = null;\n }\n\n stop(): void {\n this.isRunning = false;\n clearTimeout(this.timeoutId!);\n this.timeoutId = null;\n this.startTime = null;\n this.remaining = this.duration;\n }\n}\n\nexport interface NgpToastTimerOptions {\n /**\n * When true, the timer never fires. `start()`, `pause()`, and `stop()` are safe\n * to call but have no effect on the callback.\n */\n persistent?: boolean;\n}\n\nexport function toastTimer(\n duration: number,\n callback: () => void,\n options: NgpToastTimerOptions = {},\n): NgpToastTimer {\n return new NgpToastTimer(duration, callback, options.persistent);\n}\n","import { InteractivityChecker } from '@angular/cdk/a11y';\nimport {\n afterNextRender,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n signal,\n} from '@angular/core';\nimport { explicitEffect, injectDimensions } from 'ng-primitives/internal';\nimport { injectToastConfig } from '../config/toast-config';\nimport { NgpToastManager } from './toast-manager';\nimport { injectToastOptions } from './toast-options';\nimport { toastTimer } from './toast-timer';\n\n@Directive({\n selector: '[ngpToast]',\n exportAs: 'ngpToast',\n host: {\n '[attr.data-position-x]': 'x',\n '[attr.data-position-y]': 'y',\n '[attr.data-visible]': 'visible()',\n '[attr.data-front]': 'index() === 0',\n '[attr.data-swiping]': 'swiping()',\n '[attr.data-swipe-direction]': 'swipeOutDirection()',\n '[attr.data-expanded]': 'options.expanded()',\n '[style.--ngp-toast-gap.px]': 'config.gap',\n '[style.--ngp-toast-z-index]': 'zIndex()',\n '[style.--ngp-toasts-before]': 'index()',\n '[style.--ngp-toast-index]': 'index() + 1',\n '[style.--ngp-toast-height.px]': 'dimensions().height',\n '[style.--ngp-toast-offset.px]': 'offset()',\n '[style.--ngp-toast-front-height.px]': 'frontToastHeight()',\n '[style.--ngp-toast-swipe-amount-x.px]': 'swipeAmount().x',\n '[style.--ngp-toast-swipe-amount-y.px]': 'swipeAmount().y',\n '[style.--ngp-toast-swipe-x]': 'swipeAmount().x',\n '[style.--ngp-toast-swipe-y]': 'swipeAmount().y',\n },\n})\nexport class NgpToast {\n private readonly manager = inject(NgpToastManager);\n private readonly injector = inject(Injector);\n protected readonly config = injectToastConfig();\n /** @internal */\n readonly options = injectToastOptions();\n private readonly interactivityChecker = inject(InteractivityChecker);\n private readonly isInteracting = signal(false);\n\n private pointerStartRef: { x: number; y: number } | null = null;\n private dragStartTime: Date | null = null;\n protected readonly swiping = signal(false);\n protected readonly swipeDirection = signal<'x' | 'y' | null>(null);\n protected readonly swipeAmount = signal({ x: 0, y: 0 });\n\n protected readonly swipeOutDirection = computed(() => {\n const direction = this.swipeDirection();\n if (direction === 'x') {\n return this.swipeAmount().x > 0 ? 'right' : 'left';\n } else if (direction === 'y') {\n return this.swipeAmount().y > 0 ? 'bottom' : 'top';\n }\n return null;\n });\n\n /**\n * Get all toasts that are currently being displayed in the same position.\n */\n private readonly toasts = computed(() =>\n this.manager\n .toasts()\n .filter(toast => toast.instance.options.placement === this.options.placement),\n );\n\n /**\n * The number of toasts that are currently being displayed before this toast.\n */\n protected readonly index = computed(() => {\n return this.toasts().findIndex(toast => toast.instance === this);\n });\n\n /**\n * Determine the position of the toast in the list of toasts.\n * This is the combination of the heights of all the toasts before this one, plus the gap between them.\n */\n protected readonly offset = computed(() => {\n const gap = this.config.gap;\n\n return this.toasts()\n .slice(0, this.index())\n .reduce((acc, toast) => acc + toast.instance.dimensions().height + gap, 0);\n });\n\n /**\n * Determine if this toast is visible.\n * Visible considers the maximum number of toasts that can be displayed at once, and the last x toasts that are currently being displayed.\n */\n protected readonly visible = computed(() => {\n const maxToasts = this.config.maxToasts;\n // determine if this toast is within the maximum number of toasts that can be displayed\n return this.index() < maxToasts || this.toasts().length <= maxToasts;\n });\n\n /**\n * Determine the height of the front toast.\n * This is used to determine the height of the toast when it is not expanded.\n */\n protected readonly frontToastHeight = computed(() => {\n // get the first toast in the list with height - as when a new toast is added, it may not initially have dimensions\n return (\n this.toasts()\n .find(toast => toast.instance.dimensions().height)\n ?.instance.dimensions().height || 0\n );\n });\n\n /**\n * Determine the z-index of the toast. This is the inverse of the index.\n * The first toast will have the highest z-index, and the last toast will have the lowest z-index.\n * This is used to ensure that the first toast is always on top of the others.\n */\n protected readonly zIndex = computed(() => this.toasts().length - this.index());\n\n /**\n * The height of the toast in pixels.\n */\n protected readonly dimensions = injectDimensions();\n\n /**\n * The x position of the toast.\n */\n readonly x = this.options.placement.split('-')[1] || 'end';\n\n /**\n * The y position of the toast.\n */\n readonly y = this.options.placement.split('-')[0] || 'top';\n\n /**\n * The toast timer instance.\n */\n private readonly timer = toastTimer(this.options.duration, () => this.manager.dismiss(this), {\n persistent: this.options.persistent,\n });\n\n constructor() {\n this.options.register(this);\n\n // Start the timer when the toast is created\n this.timer.start();\n\n // Pause the timer when the toast is expanded or when the user is interacting with it\n // Also pause when in sequential mode and this toast is not at the front\n explicitEffect(\n [this.options.expanded, this.isInteracting, this.index, () => this.options.sequential],\n ([expanded, interacting, index, sequential]) => {\n // If the toast is expanded, or if the user is interacting with it, pause the timer\n // In sequential mode, also pause if this toast is not at the front\n if (expanded || interacting || (sequential && index > 0)) {\n this.timer.pause();\n } else {\n this.timer.start();\n }\n },\n );\n }\n\n @HostListener('pointerdown', ['$event'])\n protected onPointerDown(event: PointerEvent): void {\n // right click should not trigger swipe and we check if the toast is dismissible\n if (event.button === 2 || !this.options.dismissible) {\n return;\n }\n\n this.isInteracting.set(true);\n\n // we need to check if the pointer is on an interactive element, if so, we should not start swiping\n if (this.interactivityChecker.isFocusable(event.target as HTMLElement)) {\n return;\n }\n\n this.dragStartTime = new Date();\n // Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n this.swiping.set(true);\n this.pointerStartRef = { x: event.clientX, y: event.clientY };\n }\n\n @HostListener('pointermove', ['$event'])\n protected onPointerMove(event: PointerEvent): void {\n if (!this.pointerStartRef || !this.options.dismissible) {\n return;\n }\n\n const isHighlighted = window.getSelection()?.toString().length ?? 0 > 0;\n\n if (isHighlighted) {\n return;\n }\n\n const yDelta = event.clientY - this.pointerStartRef.y;\n const xDelta = event.clientX - this.pointerStartRef.x;\n\n const swipeDirections = this.options.swipeDirections;\n\n // Determine swipe direction if not already locked\n if (!this.swipeDirection() && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {\n this.swipeDirection.set(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y');\n }\n\n const swipeAmount = { x: 0, y: 0 };\n\n const getDampening = (delta: number) => {\n const factor = Math.abs(delta) / 20;\n\n return 1 / (1.5 + factor);\n };\n\n // Only apply swipe in the locked direction\n if (this.swipeDirection() === 'y') {\n // Handle vertical swipes\n if (swipeDirections.includes('top') || swipeDirections.includes('bottom')) {\n if (\n (swipeDirections.includes('top') && yDelta < 0) ||\n (swipeDirections.includes('bottom') && yDelta > 0)\n ) {\n swipeAmount.y = yDelta;\n } else {\n // Smoothly transition to dampened movement\n const dampenedDelta = yDelta * getDampening(yDelta);\n // Ensure we don't jump when transitioning to dampened movement\n swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;\n }\n }\n } else if (this.swipeDirection() === 'x') {\n // Handle horizontal swipes\n if (swipeDirections.includes('left') || swipeDirections.includes('right')) {\n if (\n (swipeDirections.includes('left') && xDelta < 0) ||\n (swipeDirections.includes('right') && xDelta > 0)\n ) {\n swipeAmount.x = xDelta;\n } else {\n // Smoothly transition to dampened movement\n const dampenedDelta = xDelta * getDampening(xDelta);\n // Ensure we don't jump when transitioning to dampened movement\n swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;\n }\n }\n }\n\n this.swipeAmount.set({ x: swipeAmount.x, y: swipeAmount.y });\n\n if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {\n this.swiping.set(true);\n }\n }\n\n @HostListener('pointerup')\n protected onPointerUp(): void {\n this.isInteracting.set(false);\n\n if (\n !this.config.dismissible ||\n !this.pointerStartRef ||\n !this.swiping() ||\n !this.dragStartTime\n ) {\n return;\n }\n\n this.pointerStartRef = null;\n\n const swipeAmountX = this.swipeAmount().x;\n const swipeAmountY = this.swipeAmount().y;\n const timeTaken = new Date().getTime() - this.dragStartTime.getTime();\n\n const swipeAmount = this.swipeDirection() === 'x' ? swipeAmountX : swipeAmountY;\n const velocity = Math.abs(swipeAmount) / timeTaken;\n\n if (Math.abs(swipeAmount) >= this.config.swipeThreshold || velocity > 0.11) {\n afterNextRender({ write: () => this.manager.dismiss(this) }, { injector: this.injector });\n return;\n } else {\n this.swipeAmount.set({ x: 0, y: 0 });\n }\n\n // Reset swipe state\n this.swipeDirection.set(null);\n this.swiping.set(false);\n }\n}\n\nexport type NgpToastSwipeDirection = 'top' | 'right' | 'bottom' | 'left';\n\nexport type NgpToastPlacement =\n | 'top-start'\n | 'top-end'\n | 'top-center'\n | 'bottom-start'\n | 'bottom-end'\n | 'bottom-center';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAkFO,MAAM,kBAAkB,GAAmB;AAChD,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,cAAc,EAAE,EAAE;IAClB,eAAe,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC;AACnD,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,MAAM,EAAE,OAAO;AACf,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,UAAU,EAAE,KAAK;CAClB;AAEM,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAAiB,qBAAqB,CAAC;AAE5F;;;;AAIG;AACG,SAAU,kBAAkB,CAAC,MAA+B,EAAA;IAChE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,mBAAmB;AAC5B,YAAA,QAAQ,EAAE,EAAE,GAAG,kBAAkB,EAAE,GAAG,MAAM,EAAE;AAC/C,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,iBAAiB,GAAA;AAC/B,IAAA,OAAO,MAAM,CAAC,mBAAmB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,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAxBpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,IAAI,EAAE;AACJ,wBAAA,wBAAwB,EAAE,GAAG;AAC7B,wBAAA,wBAAwB,EAAE,GAAG;AAC7B,wBAAA,qBAAqB,EAAE,WAAW;AAClC,wBAAA,mBAAmB,EAAE,eAAe;AACpC,wBAAA,qBAAqB,EAAE,WAAW;AAClC,wBAAA,6BAA6B,EAAE,qBAAqB;AACpD,wBAAA,sBAAsB,EAAE,oBAAoB;AAC5C,wBAAA,4BAA4B,EAAE,YAAY;AAC1C,wBAAA,6BAA6B,EAAE,UAAU;AACzC,wBAAA,6BAA6B,EAAE,SAAS;AACxC,wBAAA,2BAA2B,EAAE,aAAa;AAC1C,wBAAA,+BAA+B,EAAE,qBAAqB;AACtD,wBAAA,+BAA+B,EAAE,UAAU;AAC3C,wBAAA,qCAAqC,EAAE,oBAAoB;AAC3D,wBAAA,uCAAuC,EAAE,iBAAiB;AAC1D,wBAAA,uCAAuC,EAAE,iBAAiB;AAC1D,wBAAA,6BAA6B,EAAE,iBAAiB;AAChD,wBAAA,6BAA6B,EAAE,iBAAiB;AACjD,qBAAA;AACF,iBAAA;;sBAgIE,YAAY;uBAAC,aAAa,EAAE,CAAC,QAAQ,CAAC;;sBAqBtC,YAAY;uBAAC,aAAa,EAAE,CAAC,QAAQ,CAAC;;sBAsEtC,YAAY;uBAAC,WAAW;;;AClQ3B;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-toast.mjs","sources":["../../../../packages/ng-primitives/toast/src/config/toast-config.ts","../../../../packages/ng-primitives/toast/src/toast/toast-context.ts","../../../../packages/ng-primitives/toast/src/toast/toast-options.ts","../../../../packages/ng-primitives/toast/src/toast/toast-manager.ts","../../../../packages/ng-primitives/toast/src/toast/toast-timer.ts","../../../../packages/ng-primitives/toast/src/toast/toast.ts","../../../../packages/ng-primitives/toast/src/ng-primitives-toast.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpToastPlacement, NgpToastSwipeDirection } from '../toast/toast';\n\nexport interface NgpToastConfig {\n /**\n * The position of the toast.\n */\n placement: NgpToastPlacement;\n\n /**\n * The duration of each toast.\n */\n duration: number;\n\n /**\n * The offset from the top of the viewport in pixels.\n */\n offsetTop: number;\n\n /**\n * The offset from the bottom of the viewport in pixels.\n */\n offsetBottom: number;\n\n /**\n * The offset from the left of the viewport in pixels.\n */\n offsetLeft: number;\n\n /**\n * The offset from the right of the viewport in pixels.\n */\n offsetRight: number;\n\n /**\n * Whether a toast can be dismissed by swiping.\n */\n dismissible: boolean;\n\n /**\n * The amount a toast must be swiped before it is considered dismissed.\n */\n swipeThreshold: number;\n\n /**\n * The default swipe directions supported by the toast.\n */\n swipeDirections: NgpToastSwipeDirection[];\n\n /**\n * The maximum number of toasts that can be displayed at once.\n */\n maxToasts: number;\n\n /**\n * The aria live setting.\n */\n ariaLive: string;\n\n /**\n * The gap between each toast.\n */\n gap: number;\n\n /**\n * The z-index of the toast container.\n * This is used to ensure that the toast container is always on top of other elements.\n */\n zIndex: number;\n\n /**\n * When true, only the front toast's timer will run.\n * When a toast is dismissed, the timer will start on the next toast.\n */\n sequential: boolean;\n\n /**\n * When true, toasts will not auto-dismiss and must be dismissed explicitly.\n */\n persistent: boolean;\n}\n\nexport const defaultToastConfig: NgpToastConfig = {\n gap: 14,\n duration: 3000,\n placement: 'top-end',\n offsetTop: 24,\n offsetBottom: 24,\n offsetLeft: 24,\n offsetRight: 24,\n swipeThreshold: 45,\n swipeDirections: ['left', 'right', 'top', 'bottom'],\n dismissible: true,\n maxToasts: 3,\n zIndex: 9999999,\n ariaLive: 'polite',\n sequential: false,\n persistent: false,\n};\n\nexport const NgpToastConfigToken = new InjectionToken<NgpToastConfig>('NgpToastConfigToken');\n\n/**\n * Provide the default Toast configuration\n * @param config The Toast configuration\n * @returns The provider\n */\nexport function provideToastConfig(config: Partial<NgpToastConfig>): Provider[] {\n return [\n {\n provide: NgpToastConfigToken,\n useValue: { ...defaultToastConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Toast configuration\n * @returns The global Toast configuration\n */\nexport function injectToastConfig(): NgpToastConfig {\n return inject(NgpToastConfigToken, { optional: true }) ?? defaultToastConfig;\n}\n","import { inject, InjectionToken, ValueProvider } from '@angular/core';\n\nconst NgpToastContext = new InjectionToken<unknown>('NgpToastContext');\n\nexport function provideToastContext<T>(context: T): ValueProvider {\n return { provide: NgpToastContext, useValue: context };\n}\n\nexport function injectToastContext<T>(): T {\n return inject(NgpToastContext) as T;\n}\n","import { inject, InjectionToken, Signal, ValueProvider } from '@angular/core';\nimport type { NgpToast, NgpToastSwipeDirection, NgpToastPlacement } from './toast';\n\nconst NgpToastOptions = new InjectionToken<NgpToastOptions>('NgpToastOptions');\n\nexport function provideToastOptions(context: NgpToastOptions): ValueProvider {\n return { provide: NgpToastOptions, useValue: context };\n}\n\nexport function injectToastOptions(): NgpToastOptions {\n return inject(NgpToastOptions);\n}\n\nexport interface NgpToastOptions {\n /**\n * The position of the toast.\n */\n placement: NgpToastPlacement;\n\n /**\n * The duration of the toast in milliseconds.\n */\n duration: number;\n\n /**\n * A function to register the toast instance with the manager.\n * @internal\n */\n register: (toast: NgpToast) => void;\n\n /**\n * Whether the toast region is expanded.\n * @internal\n */\n expanded: Signal<boolean>;\n\n /**\n * Whether the toast supports swipe dismiss.\n * @internal\n */\n dismissible: boolean;\n\n /**\n * The swipe directions supported by the toast.\n * @internal\n */\n swipeDirections: NgpToastSwipeDirection[];\n\n /**\n * When true, only the front toast's timer will run.\n * @internal\n */\n sequential: boolean;\n\n /**\n * When true, the toast will not auto-dismiss and must be dismissed explicitly.\n * @internal\n */\n persistent: boolean;\n}\n","import {\n ApplicationRef,\n computed,\n inject,\n Injectable,\n Injector,\n RendererFactory2,\n signal,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport { createPortal, NgpPortal } from 'ng-primitives/portal';\nimport { injectToastConfig } from '../config/toast-config';\nimport { NgpToast, NgpToastPlacement, NgpToastSwipeDirection } from './toast';\nimport { provideToastContext } from './toast-context';\nimport { provideToastOptions } from './toast-options';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgpToastManager {\n private readonly config = injectToastConfig();\n private readonly applicationRef = inject(ApplicationRef);\n private readonly rendererFactory = inject(RendererFactory2);\n private readonly renderer = this.rendererFactory.createRenderer(null, null);\n private readonly injector = inject(Injector);\n // Map to store containers by placement\n private readonly containers = new Map<string, HTMLElement>();\n\n readonly toasts = signal<NgpToastRecord[]>([]);\n\n /** Signal that tracks which placements are expanded */\n private readonly expanded = signal<NgpToastPlacement[]>([]);\n\n /** Show a toast notification */\n show(toast: TemplateRef<void> | Type<unknown>, options: NgpToastOptions = {}): NgpToastRef {\n // services can't access the view container directly, so this is a workaround\n const rootComponent = this.applicationRef.components[0];\n const viewContainerRef = rootComponent?.injector.get(ViewContainerRef) ?? null;\n\n let instance: NgpToast | null = null;\n const placement = options.placement ?? this.config.placement;\n const duration = options.duration ?? this.config.duration;\n const container = this.getOrCreateContainer(placement);\n\n const portal = createPortal(\n toast,\n viewContainerRef,\n Injector.create({\n parent: this.injector,\n providers: [\n provideToastContext(options.context),\n provideToastOptions({\n placement,\n duration,\n register: (toast: NgpToast) => (instance = toast),\n expanded: computed(() => this.expanded().includes(placement)),\n dismissible: options.dismissible ?? this.config.dismissible,\n swipeDirections: options.swipeDirections ?? this.config.swipeDirections,\n sequential: options.sequential ?? this.config.sequential,\n persistent: options.persistent ?? this.config.persistent,\n }),\n ],\n }),\n {\n // Hide the toast when the dismiss method is called\n dismiss: () => this.dismiss(instance!),\n context: options.context,\n },\n );\n\n portal.attach(container);\n\n // Add the toast to the list of toasts\n if (!instance) {\n throw new Error('A toast must have the NgpToast directive applied.');\n }\n\n this.toasts.update(toasts => [{ instance: instance!, portal }, ...toasts]);\n\n return {\n dismiss: () => this.dismiss(instance!),\n };\n }\n\n /** Hide a toast notification */\n async dismiss(toast: NgpToast): Promise<void> {\n const ref = this.toasts().find(t => t.instance === toast);\n\n if (ref) {\n // Detach the portal from the container\n await ref.portal.detach();\n\n // Remove the toast from the list of toasts\n this.toasts.update(toasts => toasts.filter(t => t !== ref));\n\n // if there are no more toasts, ensure the container is no longer considered expanded\n if (this.toasts().length === 0) {\n this.expanded.update(expanded => expanded.filter(p => p !== toast.options.placement));\n }\n }\n }\n\n /**\n * Lazily create or get a container for a given placement.\n */\n private getOrCreateContainer(placement: string): HTMLElement {\n if (this.containers.has(placement)) {\n return this.containers.get(placement)!;\n }\n const container = this.createContainer(placement);\n this.containers.set(placement, container);\n return container;\n }\n\n /**\n * Create a section in which toasts will be rendered for a specific placement.\n */\n private createContainer(placement: string): HTMLElement {\n const container = this.renderer.createElement('section') as HTMLElement;\n this.renderer.setAttribute(container, 'aria-live', this.config.ariaLive);\n this.renderer.setAttribute(container, 'aria-atomic', 'false');\n this.renderer.setAttribute(container, 'tabindex', '-1');\n this.renderer.setAttribute(container, 'data-ngp-toast-container', placement);\n container.style.setProperty('position', 'fixed');\n container.style.setProperty('z-index', `${this.config.zIndex}`);\n container.style.setProperty('--ngp-toast-offset-top', `${this.config.offsetTop}px`);\n container.style.setProperty('--ngp-toast-offset-bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('--ngp-toast-offset-left', `${this.config.offsetLeft}px`);\n container.style.setProperty('--ngp-toast-offset-right', `${this.config.offsetRight}px`);\n container.style.setProperty('--ngp-toast-gap', `${this.config.gap}px`);\n\n // mark the container as expanded\n this.renderer.listen(container, 'mouseenter', () =>\n this.expanded.update(expanded => [...expanded, placement as NgpToastPlacement]),\n );\n\n this.renderer.listen(container, 'mouseleave', () => {\n this.expanded.update(expanded =>\n expanded.filter(p => p !== (placement as NgpToastPlacement)),\n );\n });\n\n // Set placement styles\n switch (placement) {\n case 'top-start':\n container.style.setProperty('top', `${this.config.offsetTop}px`);\n container.style.setProperty('left', `${this.config.offsetLeft}px`);\n break;\n case 'top-center':\n container.style.setProperty('top', `${this.config.offsetTop}px`);\n container.style.setProperty('left', '50%');\n container.style.setProperty('transform', 'translateX(-50%)');\n break;\n case 'top-end':\n container.style.setProperty('top', `${this.config.offsetTop}px`);\n container.style.setProperty('right', `${this.config.offsetRight}px`);\n break;\n case 'bottom-start':\n container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('left', `${this.config.offsetLeft}px`);\n break;\n case 'bottom-center':\n container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('left', '50%');\n container.style.setProperty('transform', 'translateX(-50%)');\n break;\n case 'bottom-end':\n container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n container.style.setProperty('right', `${this.config.offsetRight}px`);\n break;\n default:\n throw new Error(`Unknown toast placement: ${placement}`);\n }\n\n this.renderer.appendChild(document.body, container);\n return container;\n }\n}\n\nexport interface NgpToastOptions<T = unknown> {\n /** The position of the toast */\n placement?: NgpToastPlacement;\n\n /** The duration of the toast in milliseconds */\n duration?: number;\n\n /** Whether the toast is dismissible */\n dismissible?: boolean;\n\n /** The swipe directions supported by the toast */\n swipeDirections?: NgpToastSwipeDirection[];\n\n /** The context to make available to the toast */\n context?: T;\n\n /** When enabled, only the front toast's timer will run */\n sequential?: boolean;\n\n /** When true, the toast will not auto-dismiss and must be dismissed explicitly */\n persistent?: boolean;\n}\n\ninterface NgpToastRecord {\n instance: NgpToast;\n portal: NgpPortal;\n}\n\nexport interface NgpToastRef {\n dismiss(): Promise<void>;\n}\n","class NgpToastTimer {\n private startTime: number | null = null;\n private remaining: number;\n private timeoutId: ReturnType<typeof setTimeout> | null = null;\n private isRunning = false;\n\n constructor(\n private duration: number,\n private callback: () => void,\n private readonly persistent = false,\n ) {\n this.remaining = duration;\n }\n\n start(): void {\n if (this.persistent) return;\n if (this.isRunning) return;\n\n this.isRunning = true;\n this.startTime = Date.now();\n\n this.timeoutId = setTimeout(() => {\n this.isRunning = false;\n this.callback();\n }, this.remaining);\n }\n\n pause(): void {\n if (!this.isRunning || this.startTime === null) return;\n\n this.isRunning = false;\n clearTimeout(this.timeoutId!);\n\n const elapsed = Date.now() - this.startTime;\n this.remaining -= elapsed;\n this.startTime = null;\n this.timeoutId = null;\n }\n\n stop(): void {\n this.isRunning = false;\n clearTimeout(this.timeoutId!);\n this.timeoutId = null;\n this.startTime = null;\n this.remaining = this.duration;\n }\n}\n\nexport interface NgpToastTimerOptions {\n /**\n * When true, the timer never fires. `start()`, `pause()`, and `stop()` are safe\n * to call but have no effect on the callback.\n */\n persistent?: boolean;\n}\n\nexport function toastTimer(\n duration: number,\n callback: () => void,\n options: NgpToastTimerOptions = {},\n): NgpToastTimer {\n return new NgpToastTimer(duration, callback, options.persistent);\n}\n","import { InteractivityChecker } from '@angular/cdk/a11y';\nimport {\n afterNextRender,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n signal,\n} from '@angular/core';\nimport { explicitEffect, injectDimensions } from 'ng-primitives/internal';\nimport { injectToastConfig } from '../config/toast-config';\nimport { NgpToastManager } from './toast-manager';\nimport { injectToastOptions } from './toast-options';\nimport { toastTimer } from './toast-timer';\n\n@Directive({\n selector: '[ngpToast]',\n exportAs: 'ngpToast',\n host: {\n '[attr.data-position-x]': 'x',\n '[attr.data-position-y]': 'y',\n '[attr.data-visible]': 'visible()',\n '[attr.data-front]': 'index() === 0',\n '[attr.data-swiping]': 'swiping()',\n '[attr.data-swipe-direction]': 'swipeOutDirection()',\n '[attr.data-expanded]': 'options.expanded()',\n '[style.--ngp-toast-gap.px]': 'config.gap',\n '[style.--ngp-toast-z-index]': 'zIndex()',\n '[style.--ngp-toasts-before]': 'index()',\n '[style.--ngp-toast-index]': 'index() + 1',\n '[style.--ngp-toast-height.px]': 'dimensions().height',\n '[style.--ngp-toast-offset.px]': 'offset()',\n '[style.--ngp-toast-front-height.px]': 'frontToastHeight()',\n '[style.--ngp-toast-swipe-amount-x.px]': 'swipeAmount().x',\n '[style.--ngp-toast-swipe-amount-y.px]': 'swipeAmount().y',\n '[style.--ngp-toast-swipe-x]': 'swipeAmount().x',\n '[style.--ngp-toast-swipe-y]': 'swipeAmount().y',\n },\n})\nexport class NgpToast {\n private readonly manager = inject(NgpToastManager);\n private readonly injector = inject(Injector);\n protected readonly config = injectToastConfig();\n /** @internal */\n readonly options = injectToastOptions();\n private readonly interactivityChecker = inject(InteractivityChecker);\n private readonly isInteracting = signal(false);\n\n private pointerStartRef: { x: number; y: number } | null = null;\n private dragStartTime: Date | null = null;\n protected readonly swiping = signal(false);\n protected readonly swipeDirection = signal<'x' | 'y' | null>(null);\n protected readonly swipeAmount = signal({ x: 0, y: 0 });\n\n protected readonly swipeOutDirection = computed(() => {\n const direction = this.swipeDirection();\n if (direction === 'x') {\n return this.swipeAmount().x > 0 ? 'right' : 'left';\n } else if (direction === 'y') {\n return this.swipeAmount().y > 0 ? 'bottom' : 'top';\n }\n return null;\n });\n\n /**\n * Get all toasts that are currently being displayed in the same position.\n */\n private readonly toasts = computed(() =>\n this.manager\n .toasts()\n .filter(toast => toast.instance.options.placement === this.options.placement),\n );\n\n /**\n * The number of toasts that are currently being displayed before this toast.\n */\n protected readonly index = computed(() => {\n return this.toasts().findIndex(toast => toast.instance === this);\n });\n\n /**\n * Determine the position of the toast in the list of toasts.\n * This is the combination of the heights of all the toasts before this one, plus the gap between them.\n */\n protected readonly offset = computed(() => {\n const gap = this.config.gap;\n\n return this.toasts()\n .slice(0, this.index())\n .reduce((acc, toast) => acc + toast.instance.dimensions().height + gap, 0);\n });\n\n /**\n * Determine if this toast is visible.\n * Visible considers the maximum number of toasts that can be displayed at once, and the last x toasts that are currently being displayed.\n */\n protected readonly visible = computed(() => {\n const maxToasts = this.config.maxToasts;\n // determine if this toast is within the maximum number of toasts that can be displayed\n return this.index() < maxToasts || this.toasts().length <= maxToasts;\n });\n\n /**\n * Determine the height of the front toast.\n * This is used to determine the height of the toast when it is not expanded.\n */\n protected readonly frontToastHeight = computed(() => {\n // get the first toast in the list with height - as when a new toast is added, it may not initially have dimensions\n return (\n this.toasts()\n .find(toast => toast.instance.dimensions().height)\n ?.instance.dimensions().height || 0\n );\n });\n\n /**\n * Determine the z-index of the toast. This is the inverse of the index.\n * The first toast will have the highest z-index, and the last toast will have the lowest z-index.\n * This is used to ensure that the first toast is always on top of the others.\n */\n protected readonly zIndex = computed(() => this.toasts().length - this.index());\n\n /**\n * The height of the toast in pixels.\n */\n protected readonly dimensions = injectDimensions();\n\n /**\n * The x position of the toast.\n */\n readonly x = this.options.placement.split('-')[1] || 'end';\n\n /**\n * The y position of the toast.\n */\n readonly y = this.options.placement.split('-')[0] || 'top';\n\n /**\n * The toast timer instance.\n */\n private readonly timer = toastTimer(this.options.duration, () => this.manager.dismiss(this), {\n persistent: this.options.persistent,\n });\n\n constructor() {\n this.options.register(this);\n\n // Start the timer when the toast is created\n this.timer.start();\n\n // Pause the timer when the toast is expanded or when the user is interacting with it\n // Also pause when in sequential mode and this toast is not at the front\n explicitEffect(\n [this.options.expanded, this.isInteracting, this.index, () => this.options.sequential],\n ([expanded, interacting, index, sequential]) => {\n // If the toast is expanded, or if the user is interacting with it, pause the timer\n // In sequential mode, also pause if this toast is not at the front\n if (expanded || interacting || (sequential && index > 0)) {\n this.timer.pause();\n } else {\n this.timer.start();\n }\n },\n );\n }\n\n @HostListener('pointerdown', ['$event'])\n protected onPointerDown(event: PointerEvent): void {\n // right click should not trigger swipe and we check if the toast is dismissible\n if (event.button === 2 || !this.options.dismissible) {\n return;\n }\n\n this.isInteracting.set(true);\n\n // we need to check if the pointer is on an interactive element, if so, we should not start swiping\n if (this.interactivityChecker.isFocusable(event.target as HTMLElement)) {\n return;\n }\n\n this.dragStartTime = new Date();\n // Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n this.swiping.set(true);\n this.pointerStartRef = { x: event.clientX, y: event.clientY };\n }\n\n @HostListener('pointermove', ['$event'])\n protected onPointerMove(event: PointerEvent): void {\n if (!this.pointerStartRef || !this.options.dismissible) {\n return;\n }\n\n const isHighlighted = window.getSelection()?.toString().length ?? 0 > 0;\n\n if (isHighlighted) {\n return;\n }\n\n const yDelta = event.clientY - this.pointerStartRef.y;\n const xDelta = event.clientX - this.pointerStartRef.x;\n\n const swipeDirections = this.options.swipeDirections;\n\n // Determine swipe direction if not already locked\n if (!this.swipeDirection() && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {\n this.swipeDirection.set(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y');\n }\n\n const swipeAmount = { x: 0, y: 0 };\n\n const getDampening = (delta: number) => {\n const factor = Math.abs(delta) / 20;\n\n return 1 / (1.5 + factor);\n };\n\n // Only apply swipe in the locked direction\n if (this.swipeDirection() === 'y') {\n // Handle vertical swipes\n if (swipeDirections.includes('top') || swipeDirections.includes('bottom')) {\n if (\n (swipeDirections.includes('top') && yDelta < 0) ||\n (swipeDirections.includes('bottom') && yDelta > 0)\n ) {\n swipeAmount.y = yDelta;\n } else {\n // Smoothly transition to dampened movement\n const dampenedDelta = yDelta * getDampening(yDelta);\n // Ensure we don't jump when transitioning to dampened movement\n swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;\n }\n }\n } else if (this.swipeDirection() === 'x') {\n // Handle horizontal swipes\n if (swipeDirections.includes('left') || swipeDirections.includes('right')) {\n if (\n (swipeDirections.includes('left') && xDelta < 0) ||\n (swipeDirections.includes('right') && xDelta > 0)\n ) {\n swipeAmount.x = xDelta;\n } else {\n // Smoothly transition to dampened movement\n const dampenedDelta = xDelta * getDampening(xDelta);\n // Ensure we don't jump when transitioning to dampened movement\n swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;\n }\n }\n }\n\n this.swipeAmount.set({ x: swipeAmount.x, y: swipeAmount.y });\n\n if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {\n this.swiping.set(true);\n }\n }\n\n @HostListener('pointerup')\n protected onPointerUp(): void {\n this.isInteracting.set(false);\n\n if (\n !this.config.dismissible ||\n !this.pointerStartRef ||\n !this.swiping() ||\n !this.dragStartTime\n ) {\n return;\n }\n\n this.pointerStartRef = null;\n\n const swipeAmountX = this.swipeAmount().x;\n const swipeAmountY = this.swipeAmount().y;\n const timeTaken = new Date().getTime() - this.dragStartTime.getTime();\n\n const swipeAmount = this.swipeDirection() === 'x' ? swipeAmountX : swipeAmountY;\n const velocity = Math.abs(swipeAmount) / timeTaken;\n\n if (Math.abs(swipeAmount) >= this.config.swipeThreshold || velocity > 0.11) {\n afterNextRender({ write: () => this.manager.dismiss(this) }, { injector: this.injector });\n return;\n } else {\n this.swipeAmount.set({ x: 0, y: 0 });\n }\n\n // Reset swipe state\n this.swipeDirection.set(null);\n this.swiping.set(false);\n }\n}\n\nexport type NgpToastSwipeDirection = 'top' | 'right' | 'bottom' | 'left';\n\nexport type NgpToastPlacement =\n | 'top-start'\n | 'top-end'\n | 'top-center'\n | 'bottom-start'\n | 'bottom-end'\n | 'bottom-center';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAkFO,MAAM,kBAAkB,GAAmB;AAChD,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,cAAc,EAAE,EAAE;IAClB,eAAe,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC;AACnD,IAAA,W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