ng-primitives 0.69.1 → 0.71.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/date-picker/config/date-picker-config.d.ts +22 -0
- package/date-picker/date-picker/date-picker-first-day-of-week.d.ts +29 -0
- package/date-picker/date-picker/date-picker.d.ts +13 -1
- package/date-picker/date-picker-row-render/date-picker-row-render.d.ts +12 -0
- package/date-picker/date-range-picker/date-range-picker.d.ts +13 -1
- package/date-picker/index.d.ts +2 -0
- package/fesm2022/ng-primitives-date-picker.mjs +106 -13
- package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +21 -6
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +2 -2
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-state.mjs +3 -4
- package/fesm2022/ng-primitives-state.mjs.map +1 -1
- package/fesm2022/ng-primitives-toast.mjs +1 -2
- package/fesm2022/ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +109 -51
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/ng-primitives-utils.mjs +54 -36
- package/fesm2022/ng-primitives-utils.mjs.map +1 -1
- package/internal/index.d.ts +1 -1
- package/internal/utilities/resize.d.ts +4 -0
- package/package.json +34 -34
- package/toast/toast/toast.d.ts +2 -6
- package/tooltip/config/tooltip-config.d.ts +5 -0
- package/tooltip/tooltip-text-content/tooltip-text-content.component.d.ts +14 -0
- package/tooltip/tooltip-trigger/tooltip-trigger.d.ts +11 -3
- package/utils/helpers/validators.d.ts +39 -0
- package/utils/index.d.ts +1 -1
- package/utils/ui/dimensions.d.ts +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-state.mjs","sources":["../../../../packages/ng-primitives/state/src/index.ts","../../../../packages/ng-primitives/state/src/ng-primitives-state.ts"],"sourcesContent":["import {\n computed,\n FactoryProvider,\n inject,\n InjectionToken,\n InjectOptions,\n InputSignal,\n InputSignalWithTransform,\n isSignal,\n linkedSignal,\n ProviderToken,\n signal,\n Signal,\n WritableSignal,\n} from '@angular/core';\n\n/**\n * This converts the state object to a writable state object.\n * This means that inputs become signals which are writable.\n */\nexport type State<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof T]: T[K] extends InputSignalWithTransform<infer U, any>\n ? WritableSignal<U>\n : T[K] extends InputSignal<infer R>\n ? WritableSignal<R>\n : T[K];\n};\n\n/**\n * This is similar to the state object, but we don't expose properties that are not\n * inputs.\n */\nexport type CreatedState<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof T]: T[K] extends InputSignalWithTransform<infer U, any>\n ? WritableSignal<U>\n : T[K] extends InputSignal<infer R>\n ? WritableSignal<R>\n : never;\n};\n\nexport type InjectedState<T> = Signal<State<T>>;\n\n/**\n * Create a new injection token for the state.\n * @param description The description of the token\n */\nexport function createStateToken<T>(description: string): InjectionToken<T> {\n return new InjectionToken<Signal<State<T>>>(`Ngp${description}StateToken`);\n}\n\nexport interface CreateStateProviderOptions {\n /**\n * Whether we should check for the state in the parent injector.\n */\n inherit?: boolean;\n}\n\n/**\n * Create a new provider for the state. It first tries to inject the state from the parent injector,\n * as this allows for the state to be hoisted to a higher level in the component tree. This can\n * be useful to avoid issues where the injector can't be shared in some cases when ng-content is used.\n * @param token The token for the state\n */\nexport function createStateProvider<T>(\n token: ProviderToken<T>,\n): (options?: CreateStateProviderOptions) => FactoryProvider {\n return ({ inherit }: CreateStateProviderOptions = {}) => ({\n provide: token,\n useFactory: () => {\n if (inherit === false) {\n // if we are not checking the parent, we want to create a new state\n return signal({});\n }\n // if we are checking the parent, we want to check if the state is already defined\n return inject(token, { optional: true, skipSelf: true }) ?? signal({});\n },\n });\n}\n\ntype CreateStateInjectorOptions = {\n /**\n * Whether the state may not be immediately available. This can happen when the child is instantiated before the parent.\n */\n deferred?: boolean;\n};\n\n/**\n * Create a new state injector for the state.\n * @param token The token for the state\n */\nexport function createStateInjector<T>(\n token: ProviderToken<State<T>>,\n options: { deferred: true },\n): <U = T>(injectOptions?: InjectOptions) => Signal<State<U> | undefined>;\nexport function createStateInjector<T>(\n token: ProviderToken<State<T>>,\n options?: CreateStateInjectorOptions,\n): <U = T>(injectOptions?: InjectOptions) => Signal<State<U>>;\nexport function createStateInjector<T>(\n token: ProviderToken<State<T>>,\n options: CreateStateInjectorOptions = {},\n): <U = T>(injectOptions?: InjectOptions) => Signal<State<U> | undefined> {\n return <U = T>(injectOptions: InjectOptions = {}) => {\n const value = inject(token, injectOptions) as Signal<State<U> | undefined> | null;\n\n if (options.deferred) {\n return computed(() =>\n value && Object.keys(value() ?? {}).length === 0 ? undefined : value?.(),\n ) as Signal<State<U> | undefined>;\n }\n\n return (value as Signal<State<U>>) ?? signal(undefined);\n };\n}\n\n/**\n * Convert the original state object into a writable state object.\n * @param token The token for the state\n */\nexport function createState(token: ProviderToken<WritableSignal<State<unknown>>>) {\n return <U>(state: U): CreatedState<U> => {\n const internalState = inject(token);\n\n internalState.update(obj => {\n // Iterating over properties\n for (const key in state) {\n const value = state[key as keyof U];\n\n // We want to make this a controlled input if it is an InputSignal or InputSignalWithTransform\n if (isSignalInput(value)) {\n // @ts-ignore\n obj[key] = createControlledInput(value);\n } else {\n // @ts-ignore\n obj[key] = value;\n }\n }\n\n // Iterating over prototype methods\n const prototype = Object.getPrototypeOf(state);\n\n for (const key of Object.getOwnPropertyNames(prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(prototype, key);\n\n // if this is a getter or setter, we need to define it on the object\n if (descriptor?.get || descriptor?.set) {\n Object.defineProperty(obj, key, descriptor);\n } else if (typeof prototype[key as keyof U] === 'function') {\n (obj as Record<string, unknown>)[key] = prototype[key as keyof U].bind(state);\n } else {\n // @ts-ignore\n obj[key] = prototype[key as keyof U];\n }\n }\n\n return { ...obj };\n });\n\n return internalState() as unknown as CreatedState<U>;\n };\n}\n\n// this is a bit hacky, but we need to do it to track whether this is controlled\nfunction createControlledInput(\n property: InputSignal<unknown> | InputSignalWithTransform<unknown, unknown>,\n): WritableSignal<unknown> {\n const value = signal(property());\n let isControlled = false;\n\n const symbol = Object.getOwnPropertySymbols(property).find(s => s.description === 'SIGNAL');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const inputDefinition = symbol ? (property as any)[symbol] : undefined;\n\n if (\n !symbol ||\n !inputDefinition ||\n typeof inputDefinition.applyValueToInputSignal !== 'function'\n ) {\n console.warn(\n 'Angular has changed its internal Input implementation, report this issue to ng-primitives.',\n );\n // fallback to a linked signal which is partially controlled\n return linkedSignal(() => property());\n }\n\n const originalApply = inputDefinition.applyValueToInputSignal.bind(inputDefinition);\n const originalSet = value.set.bind(value);\n const originalUpdate = value.update.bind(value);\n\n inputDefinition.applyValueToInputSignal = (inputSignalNode: unknown, newValue: unknown) => {\n isControlled = true;\n originalSet(newValue);\n originalApply(inputSignalNode, newValue);\n };\n\n value.set = (newValue: unknown) => {\n if (!isControlled) {\n originalSet(newValue);\n }\n };\n\n value.update = (updateFn: (value: unknown) => unknown) => {\n if (!isControlled) {\n originalUpdate(updateFn);\n }\n };\n\n return value;\n}\n\nfunction isSignalInput(\n property: unknown,\n): property is InputSignal<unknown> | InputSignalWithTransform<unknown, unknown> {\n if (!isSignal(property)) {\n return false;\n }\n\n const symbol = Object.getOwnPropertySymbols(property).find(s => s.description === 'SIGNAL');\n\n if (!symbol) {\n return false;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const inputDefinition = symbol ? (property as any)[symbol] : undefined;\n\n if (!inputDefinition) {\n return false;\n }\n\n return 'transformFn' in inputDefinition || 'applyValueToInputSignal' in inputDefinition;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AA4CA;;;AAGG;AACG,SAAU,gBAAgB,CAAI,WAAmB,EAAA;AAC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Q,CAAC;IAE3F,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,OAAO,KAAK;IACd;;AAGA,IAAA,MAAM,eAAe,GAAG,MAAM,GAAI,QAAgB,CAAC,MAAM,CAAC,GAAG,SAAS;IAEtE,IAAI,CAAC,eAAe,EAAE;AACpB,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,OAAO,aAAa,IAAI,eAAe,IAAI,yBAAyB,IAAI,eAAe;AACzF;;ACzOA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-state.mjs","sources":["../../../../packages/ng-primitives/state/src/index.ts","../../../../packages/ng-primitives/state/src/ng-primitives-state.ts"],"sourcesContent":["import {\n computed,\n FactoryProvider,\n inject,\n InjectionToken,\n InjectOptions,\n InputSignal,\n InputSignalWithTransform,\n isSignal,\n linkedSignal,\n ProviderToken,\n signal,\n Signal,\n WritableSignal,\n} from '@angular/core';\nimport { isFunction } from 'ng-primitives/utils';\n\n/**\n * This converts the state object to a writable state object.\n * This means that inputs become signals which are writable.\n */\nexport type State<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof T]: T[K] extends InputSignalWithTransform<infer U, any>\n ? WritableSignal<U>\n : T[K] extends InputSignal<infer R>\n ? WritableSignal<R>\n : T[K];\n};\n\n/**\n * This is similar to the state object, but we don't expose properties that are not\n * inputs.\n */\nexport type CreatedState<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof T]: T[K] extends InputSignalWithTransform<infer U, any>\n ? WritableSignal<U>\n : T[K] extends InputSignal<infer R>\n ? WritableSignal<R>\n : never;\n};\n\nexport type InjectedState<T> = Signal<State<T>>;\n\n/**\n * Create a new injection token for the state.\n * @param description The description of the token\n */\nexport function createStateToken<T>(description: string): InjectionToken<T> {\n return new InjectionToken<Signal<State<T>>>(`Ngp${description}StateToken`);\n}\n\nexport interface CreateStateProviderOptions {\n /**\n * Whether we should check for the state in the parent injector.\n */\n inherit?: boolean;\n}\n\n/**\n * Create a new provider for the state. It first tries to inject the state from the parent injector,\n * as this allows for the state to be hoisted to a higher level in the component tree. This can\n * be useful to avoid issues where the injector can't be shared in some cases when ng-content is used.\n * @param token The token for the state\n */\nexport function createStateProvider<T>(\n token: ProviderToken<T>,\n): (options?: CreateStateProviderOptions) => FactoryProvider {\n return ({ inherit }: CreateStateProviderOptions = {}) => ({\n provide: token,\n useFactory: () => {\n if (inherit === false) {\n // if we are not checking the parent, we want to create a new state\n return signal({});\n }\n // if we are checking the parent, we want to check if the state is already defined\n return inject(token, { optional: true, skipSelf: true }) ?? signal({});\n },\n });\n}\n\ntype CreateStateInjectorOptions = {\n /**\n * Whether the state may not be immediately available. This can happen when the child is instantiated before the parent.\n */\n deferred?: boolean;\n};\n\n/**\n * Create a new state injector for the state.\n * @param token The token for the state\n */\nexport function createStateInjector<T>(\n token: ProviderToken<State<T>>,\n options: { deferred: true },\n): <U = T>(injectOptions?: InjectOptions) => Signal<State<U> | undefined>;\nexport function createStateInjector<T>(\n token: ProviderToken<State<T>>,\n options?: CreateStateInjectorOptions,\n): <U = T>(injectOptions?: InjectOptions) => Signal<State<U>>;\nexport function createStateInjector<T>(\n token: ProviderToken<State<T>>,\n options: CreateStateInjectorOptions = {},\n): <U = T>(injectOptions?: InjectOptions) => Signal<State<U> | undefined> {\n return <U = T>(injectOptions: InjectOptions = {}) => {\n const value = inject(token, injectOptions) as Signal<State<U> | undefined> | null;\n\n if (options.deferred) {\n return computed(() =>\n value && Object.keys(value() ?? {}).length === 0 ? undefined : value?.(),\n ) as Signal<State<U> | undefined>;\n }\n\n return (value as Signal<State<U>>) ?? signal(undefined);\n };\n}\n\n/**\n * Convert the original state object into a writable state object.\n * @param token The token for the state\n */\nexport function createState(token: ProviderToken<WritableSignal<State<unknown>>>) {\n return <U>(state: U): CreatedState<U> => {\n const internalState = inject(token);\n\n internalState.update(obj => {\n // Iterating over properties\n for (const key in state) {\n const value = state[key as keyof U];\n\n // We want to make this a controlled input if it is an InputSignal or InputSignalWithTransform\n if (isSignalInput(value)) {\n // @ts-ignore\n obj[key] = createControlledInput(value);\n } else {\n // @ts-ignore\n obj[key] = value;\n }\n }\n\n // Iterating over prototype methods\n const prototype = Object.getPrototypeOf(state);\n\n for (const key of Object.getOwnPropertyNames(prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(prototype, key);\n\n // if this is a getter or setter, we need to define it on the object\n if (descriptor?.get || descriptor?.set) {\n Object.defineProperty(obj, key, descriptor);\n } else if (isFunction(prototype[key as keyof U])) {\n (obj as Record<string, unknown>)[key] = prototype[key as keyof U].bind(state);\n } else {\n // @ts-ignore\n obj[key] = prototype[key as keyof U];\n }\n }\n\n return { ...obj };\n });\n\n return internalState() as unknown as CreatedState<U>;\n };\n}\n\n// this is a bit hacky, but we need to do it to track whether this is controlled\nfunction createControlledInput(\n property: InputSignal<unknown> | InputSignalWithTransform<unknown, unknown>,\n): WritableSignal<unknown> {\n const value = signal(property());\n let isControlled = false;\n\n const symbol = Object.getOwnPropertySymbols(property).find(s => s.description === 'SIGNAL');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const inputDefinition = symbol ? (property as any)[symbol] : undefined;\n\n if (!symbol || !inputDefinition || !isFunction(inputDefinition.applyValueToInputSignal)) {\n console.warn(\n 'Angular has changed its internal Input implementation, report this issue to ng-primitives.',\n );\n // fallback to a linked signal which is partially controlled\n return linkedSignal(() => property());\n }\n\n const originalApply = inputDefinition.applyValueToInputSignal.bind(inputDefinition);\n const originalSet = value.set.bind(value);\n const originalUpdate = value.update.bind(value);\n\n inputDefinition.applyValueToInputSignal = (inputSignalNode: unknown, newValue: unknown) => {\n isControlled = true;\n originalSet(newValue);\n originalApply(inputSignalNode, newValue);\n };\n\n value.set = (newValue: unknown) => {\n if (!isControlled) {\n originalSet(newValue);\n }\n };\n\n value.update = (updateFn: (value: unknown) => unknown) => {\n if (!isControlled) {\n originalUpdate(updateFn);\n }\n };\n\n return value;\n}\n\nfunction isSignalInput(\n property: unknown,\n): property is InputSignal<unknown> | InputSignalWithTransform<unknown, unknown> {\n if (!isSignal(property)) {\n return false;\n }\n\n const symbol = Object.getOwnPropertySymbols(property).find(s => s.description === 'SIGNAL');\n\n if (!symbol) {\n return false;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const inputDefinition = symbol ? (property as any)[symbol] : undefined;\n\n if (!inputDefinition) {\n return false;\n }\n\n return 'transformFn' in inputDefinition || 'applyValueToInputSignal' in inputDefinition;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AA6CA;;;AAGG;AACG,SAAU,gBAAgB,CAAI,WAAmB,EAAA;AACrD,IAAA,OAAO,IAAI,cAAc,CAAmB,MAAM,WAAW,CAAA,UAAA,CAAY,CAAC;AAC5E;AASA;;;;;AAKG;AACG,SAAU,mBAAmB,CACjC,KAAuB,EAAA;IAEvB,OAAO,CAAC,EAAE,OAAO,EAAA,GAAiC,EAAE,MAAM;AACxD,QAAA,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,MAAK;AACf,YAAA,IAAI,OAAO,KAAK,KAAK,EAAE;;AAErB,gBAAA,OAAO,MAAM,CAAC,EAAE,CAAC;YACnB;;AAEA,YAAA,OAAO,MAAM,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC;QACxE,CAAC;AACF,KAAA,CAAC;AACJ;SAqBgB,mBAAmB,CACjC,KAA8B,EAC9B,UAAsC,EAAE,EAAA;AAExC,IAAA,OAAO,CAAQ,aAAA,GAA+B,EAAE,KAAI;QAClD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,aAAa,CAAwC;AAEjF,QAAA,IAAI,OAAO,CAAC,QAAQ,EAAE;AACpB,YAAA,OAAO,QAAQ,CAAC,MACd,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,CAA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AAED,IAAA,KAAK,CAAC,MAAM,GAAG,CAAC,QAAqC,KAAI;QACvD,IAAI,CAAC,YAAY,EAAE;YACjB,cAAc,CAAC,QAAQ,CAAC;QAC1B;AACF,IAAA,CAAC;AAED,IAAA,OAAO,KAAK;AACd;AAEA,SAAS,aAAa,CACpB,QAAiB,EAAA;AAEjB,IAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;AACvB,QAAA,OAAO,KAAK;IACd;IAEA,MAAM,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,KAAK,QAAQ,CAAC;IAE3F,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,OAAO,KAAK;IACd;;AAGA,IAAA,MAAM,eAAe,GAAG,MAAM,GAAI,QAAgB,CAAC,MAAM,CAAC,GAAG,SAAS;IAEtE,IAAI,CAAC,eAAe,EAAE;AACpB,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,OAAO,aAAa,IAAI,eAAe,IAAI,yBAAyB,IAAI,eAAe;AACzF;;ACtOA;;AAEG;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, ApplicationRef, RendererFactory2, Injector, signal, ViewContainerRef, computed, Injectable, afterNextRender, HostListener, Directive } from '@angular/core';
|
|
3
3
|
import { InteractivityChecker } from '@angular/cdk/a11y';
|
|
4
|
-
import { explicitEffect } from 'ng-primitives/internal';
|
|
5
|
-
import { injectDimensions } from 'ng-primitives/utils';
|
|
4
|
+
import { injectDimensions, explicitEffect } from 'ng-primitives/internal';
|
|
6
5
|
import { createPortal } from 'ng-primitives/portal';
|
|
7
6
|
|
|
8
7
|
const defaultToastConfig = {
|
|
@@ -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 width of each toast in pixels.\n */\n width: 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\nexport const defaultToastConfig: NgpToastConfig = {\n gap: 14,\n duration: 3000,\n width: 360,\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};\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","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 viewContainerRef = this.applicationRef.components[0].injector.get(ViewContainerRef);\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 }),\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\n container.style.setProperty('position', 'fixed');\n container.style.setProperty('z-index', `${this.config.zIndex}`);\n container.style.setProperty('width', `${this.config.width}px`);\n\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 container.style.setProperty('--ngp-toast-width', `${this.config.width}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\ninterface NgpToastRecord {\n instance: NgpToast;\n portal: NgpPortal;\n}\n\ninterface 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 ) {\n this.remaining = duration;\n }\n\n start(): void {\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 function toastTimer(duration: number, callback: () => void): NgpToastTimer {\n return new NgpToastTimer(duration, callback);\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 } from 'ng-primitives/internal';\nimport { injectDimensions } from 'ng-primitives/utils';\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-width.px]': 'config.width',\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\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 explicitEffect([this.options.expanded, this.isInteracting], ([expanded, interacting]) => {\n // If the toast is expanded, or if the user is interacting with it, reset the timer\n if (expanded || interacting) {\n this.timer.pause();\n } else {\n this.timer.start();\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":";;;;;;;AA4EO,MAAM,kBAAkB,GAAmB;AAChD,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,KAAK,EAAE,GAAG;AACV,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;CACnB;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,EAAE,EAAE,QAAQ,EAAE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AC7B,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,8BAA8B,EAAE,cAAc;AAC9C,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;wDA0HW,aAAa,EAAA,CAAA;sBADtB,YAAY;uBAAC,aAAa,EAAE,CAAC,QAAQ,CAAC;gBAsB7B,aAAa,EAAA,CAAA;sBADtB,YAAY;uBAAC,aAAa,EAAE,CAAC,QAAQ,CAAC;gBAuE7B,WAAW,EAAA,CAAA;sBADpB,YAAY;uBAAC,WAAW;;;AC7P3B;;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 width of each toast in pixels.\n */\n width: 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\nexport const defaultToastConfig: NgpToastConfig = {\n gap: 14,\n duration: 3000,\n width: 360,\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};\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","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 viewContainerRef = this.applicationRef.components[0].injector.get(ViewContainerRef);\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 }),\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\n container.style.setProperty('position', 'fixed');\n container.style.setProperty('z-index', `${this.config.zIndex}`);\n container.style.setProperty('width', `${this.config.width}px`);\n\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 container.style.setProperty('--ngp-toast-width', `${this.config.width}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\ninterface NgpToastRecord {\n instance: NgpToast;\n portal: NgpPortal;\n}\n\ninterface 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 ) {\n this.remaining = duration;\n }\n\n start(): void {\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 function toastTimer(duration: number, callback: () => void): NgpToastTimer {\n return new NgpToastTimer(duration, callback);\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-width.px]': 'config.width',\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\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 explicitEffect([this.options.expanded, this.isInteracting], ([expanded, interacting]) => {\n // If the toast is expanded, or if the user is interacting with it, reset the timer\n if (expanded || interacting) {\n this.timer.pause();\n } else {\n this.timer.start();\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":";;;;;;AA4EO,MAAM,kBAAkB,GAAmB;AAChD,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,KAAK,EAAE,GAAG;AACV,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;CACnB;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,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,kBAAkB;AAC9E;;ACjHA,MAAM,eAAe,GAAG,IAAI,cAAc,CAAU,iBAAiB,CAAC;AAEhE,SAAU,mBAAmB,CAAI,OAAU,EAAA;IAC/C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE;AACxD;SAEgB,kBAAkB,GAAA;AAChC,IAAA,OAAO,MAAM,CAAC,e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AAE,UAAU;AACzC,wBAAA,6BAA6B,EAAE,SAAS;AACxC,wBAAA,2BAA2B,EAAE,aAAa;AAC1C,wBAAA,8BAA8B,EAAE,cAAc;AAC9C,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;wDA0HW,aAAa,EAAA,CAAA;sBADtB,YAAY;uBAAC,aAAa,EAAE,CAAC,QAAQ,CAAC;gBAsB7B,aAAa,EAAA,CAAA;sBADtB,YAAY;uBAAC,aAAa,EAAE,CAAC,QAAQ,CAAC;gBAuE7B,WAAW,EAAA,CAAA;sBADpB,YAAY;uBAAC,WAAW;;;AC5P3B;;AAEG;;;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { injectOverlay, injectOverlayContext, createOverlay, setupOverlayArrow } from 'ng-primitives/portal';
|
|
2
2
|
export { injectOverlayContext as injectTooltipContext } from 'ng-primitives/portal';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, inject, ElementRef, Injector, ViewContainerRef,
|
|
5
|
-
import {
|
|
4
|
+
import { InjectionToken, inject, input, Directive, Component, ElementRef, Injector, ViewContainerRef, booleanAttribute, numberAttribute, signal, computed } from '@angular/core';
|
|
5
|
+
import { explicitEffect, setupHover, setupOverflowListener } from 'ng-primitives/internal';
|
|
6
|
+
import { isString } from 'ng-primitives/utils';
|
|
6
7
|
import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
|
|
7
8
|
|
|
8
9
|
const defaultTooltipConfig = {
|
|
@@ -13,6 +14,7 @@ const defaultTooltipConfig = {
|
|
|
13
14
|
flip: true,
|
|
14
15
|
container: null,
|
|
15
16
|
showOnOverflow: false,
|
|
17
|
+
useTextContent: true,
|
|
16
18
|
};
|
|
17
19
|
const NgpTooltipConfigToken = new InjectionToken('NgpTooltipConfigToken');
|
|
18
20
|
/**
|
|
@@ -36,6 +38,74 @@ function injectTooltipConfig() {
|
|
|
36
38
|
return inject(NgpTooltipConfigToken, { optional: true }) ?? defaultTooltipConfig;
|
|
37
39
|
}
|
|
38
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.
|
|
43
|
+
*/
|
|
44
|
+
class NgpTooltip {
|
|
45
|
+
constructor() {
|
|
46
|
+
/**
|
|
47
|
+
* Access the overlay.
|
|
48
|
+
*/
|
|
49
|
+
this.overlay = injectOverlay();
|
|
50
|
+
/**
|
|
51
|
+
* The unique id of the tooltip.
|
|
52
|
+
*/
|
|
53
|
+
this.id = input(this.overlay.id());
|
|
54
|
+
explicitEffect([this.id], ([id]) => this.overlay.id.set(id));
|
|
55
|
+
// if the mouse moves over the tooltip, we want to keep it open
|
|
56
|
+
setupHover({
|
|
57
|
+
hoverStart: () => this.overlay.cancelPendingClose(),
|
|
58
|
+
hoverEnd: () => this.overlay.hide(),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
62
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpTooltip, isStandalone: true, selector: "[ngpTooltip]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tooltip", "data-overlay": "" }, properties: { "id": "id()", "style.left.px": "overlay.position().x", "style.top.px": "overlay.position().y", "style.--ngp-tooltip-trigger-width.px": "overlay.triggerWidth()", "style.--ngp-tooltip-transform-origin": "overlay.transformOrigin()", "attr.data-placement": "overlay.finalPlacement()" } }, exportAs: ["ngpTooltip"], ngImport: i0 }); }
|
|
63
|
+
}
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltip, decorators: [{
|
|
65
|
+
type: Directive,
|
|
66
|
+
args: [{
|
|
67
|
+
selector: '[ngpTooltip]',
|
|
68
|
+
exportAs: 'ngpTooltip',
|
|
69
|
+
host: {
|
|
70
|
+
role: 'tooltip',
|
|
71
|
+
'[id]': 'id()',
|
|
72
|
+
'[style.left.px]': 'overlay.position().x',
|
|
73
|
+
'[style.top.px]': 'overlay.position().y',
|
|
74
|
+
'[style.--ngp-tooltip-trigger-width.px]': 'overlay.triggerWidth()',
|
|
75
|
+
'[style.--ngp-tooltip-transform-origin]': 'overlay.transformOrigin()',
|
|
76
|
+
'[attr.data-placement]': 'overlay.finalPlacement()',
|
|
77
|
+
'data-overlay': '',
|
|
78
|
+
},
|
|
79
|
+
}]
|
|
80
|
+
}], ctorParameters: () => [] });
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Internal component for wrapping string content in tooltip portals
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
class NgpTooltipTextContentComponent {
|
|
87
|
+
constructor() {
|
|
88
|
+
/**
|
|
89
|
+
* The string content to display
|
|
90
|
+
*/
|
|
91
|
+
this.content = injectOverlayContext();
|
|
92
|
+
}
|
|
93
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltipTextContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
94
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: NgpTooltipTextContentComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "ngpTooltip": "" } }, hostDirectives: [{ directive: NgpTooltip }], ngImport: i0, template: '{{ content() }}', isInline: true }); }
|
|
95
|
+
}
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltipTextContentComponent, decorators: [{
|
|
97
|
+
type: Component,
|
|
98
|
+
args: [{
|
|
99
|
+
template: '{{ content() }}',
|
|
100
|
+
hostDirectives: [NgpTooltip],
|
|
101
|
+
host: {
|
|
102
|
+
// Used only for styling, since the host directive isn’t added to the DOM.
|
|
103
|
+
// This acts as the styling entry point.
|
|
104
|
+
ngpTooltip: '',
|
|
105
|
+
},
|
|
106
|
+
}]
|
|
107
|
+
}] });
|
|
108
|
+
|
|
39
109
|
/**
|
|
40
110
|
* The state token for the TooltipTrigger primitive.
|
|
41
111
|
*/
|
|
@@ -77,8 +147,9 @@ class NgpTooltipTrigger {
|
|
|
77
147
|
/**
|
|
78
148
|
* Access the tooltip template ref.
|
|
79
149
|
*/
|
|
80
|
-
this.tooltip = input(
|
|
150
|
+
this.tooltip = input(null, {
|
|
81
151
|
alias: 'ngpTooltipTrigger',
|
|
152
|
+
transform: (value) => (value && !isString(value) ? value : null),
|
|
82
153
|
});
|
|
83
154
|
/**
|
|
84
155
|
* Define if the trigger should be disabled.
|
|
@@ -148,6 +219,15 @@ class NgpTooltipTrigger {
|
|
|
148
219
|
this.context = input(undefined, {
|
|
149
220
|
alias: 'ngpTooltipTriggerContext',
|
|
150
221
|
});
|
|
222
|
+
/**
|
|
223
|
+
* Define whether to use the text content of the trigger element as the tooltip content.
|
|
224
|
+
* When enabled, the tooltip will display the text content of the trigger element.
|
|
225
|
+
* @default true
|
|
226
|
+
*/
|
|
227
|
+
this.useTextContent = input(this.config.useTextContent, {
|
|
228
|
+
alias: 'ngpTooltipTriggerUseTextContent',
|
|
229
|
+
transform: booleanAttribute,
|
|
230
|
+
});
|
|
151
231
|
/**
|
|
152
232
|
* The overlay that manages the tooltip
|
|
153
233
|
* @internal
|
|
@@ -209,16 +289,35 @@ class NgpTooltipTrigger {
|
|
|
209
289
|
* Create the overlay that will contain the tooltip
|
|
210
290
|
*/
|
|
211
291
|
createOverlay() {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
292
|
+
// Determine the content and context based on useTextContent setting
|
|
293
|
+
const shouldUseTextContent = this.state.useTextContent();
|
|
294
|
+
let content = this.state.tooltip();
|
|
295
|
+
let context = this.state.context;
|
|
296
|
+
if (!content) {
|
|
297
|
+
if (!shouldUseTextContent) {
|
|
298
|
+
if (ngDevMode) {
|
|
299
|
+
throw new Error('[ngpTooltipTrigger]: Tooltip must be a string, TemplateRef, or ComponentType. Alternatively, set useTextContent to true if none is provided.');
|
|
300
|
+
}
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
const textContent = this.trigger.nativeElement.textContent?.trim() || '';
|
|
304
|
+
if (ngDevMode && !textContent) {
|
|
305
|
+
console.warn('[ngpTooltipTrigger]: useTextContent is enabled but trigger element has no text content');
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
content = NgpTooltipTextContentComponent;
|
|
309
|
+
context = signal(textContent);
|
|
310
|
+
}
|
|
311
|
+
else if (isString(content)) {
|
|
312
|
+
context = signal(content);
|
|
313
|
+
content = NgpTooltipTextContentComponent;
|
|
215
314
|
}
|
|
216
315
|
// Create config for the overlay
|
|
217
316
|
const config = {
|
|
218
|
-
content
|
|
317
|
+
content,
|
|
219
318
|
triggerElement: this.trigger.nativeElement,
|
|
220
319
|
injector: this.injector,
|
|
221
|
-
context
|
|
320
|
+
context,
|
|
222
321
|
container: this.state.container(),
|
|
223
322
|
placement: this.state.placement(),
|
|
224
323
|
offset: this.state.offset(),
|
|
@@ -239,7 +338,7 @@ class NgpTooltipTrigger {
|
|
|
239
338
|
this.tooltipId.set(id);
|
|
240
339
|
}
|
|
241
340
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltipTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
242
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpTooltipTrigger, isStandalone: true, selector: "[ngpTooltipTrigger]", inputs: { tooltip: { classPropertyName: "tooltip", publicName: "ngpTooltipTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpTooltipTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpTooltipTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpTooltipTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "ngpTooltipTriggerShowDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "ngpTooltipTriggerHideDelay", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpTooltipTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpTooltipTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, showOnOverflow: { classPropertyName: "showOnOverflow", publicName: "ngpTooltipTriggerShowOnOverflow", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpTooltipTriggerContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "show()", "mouseleave": "hide()", "focus": "show()", "blur": "hide()" }, properties: { "attr.data-open": "open() ? \"\" : null", "attr.data-disabled": "state.disabled() ? \"\" : null", "attr.aria-describedby": "overlay()?.ariaDescribedBy()" } }, providers: [provideTooltipTriggerState()], exportAs: ["ngpTooltipTrigger"], ngImport: i0 }); }
|
|
341
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpTooltipTrigger, isStandalone: true, selector: "[ngpTooltipTrigger]", inputs: { tooltip: { classPropertyName: "tooltip", publicName: "ngpTooltipTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpTooltipTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpTooltipTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpTooltipTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "ngpTooltipTriggerShowDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "ngpTooltipTriggerHideDelay", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpTooltipTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpTooltipTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, showOnOverflow: { classPropertyName: "showOnOverflow", publicName: "ngpTooltipTriggerShowOnOverflow", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpTooltipTriggerContext", isSignal: true, isRequired: false, transformFunction: null }, useTextContent: { classPropertyName: "useTextContent", publicName: "ngpTooltipTriggerUseTextContent", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "show()", "mouseleave": "hide()", "focus": "show()", "blur": "hide()" }, properties: { "attr.data-open": "open() ? \"\" : null", "attr.data-disabled": "state.disabled() ? \"\" : null", "attr.aria-describedby": "overlay()?.ariaDescribedBy()" } }, providers: [provideTooltipTriggerState()], exportAs: ["ngpTooltipTrigger"], ngImport: i0 }); }
|
|
243
342
|
}
|
|
244
343
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltipTrigger, decorators: [{
|
|
245
344
|
type: Directive,
|
|
@@ -259,47 +358,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
|
259
358
|
}]
|
|
260
359
|
}], ctorParameters: () => [] });
|
|
261
360
|
|
|
262
|
-
/**
|
|
263
|
-
* Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.
|
|
264
|
-
*/
|
|
265
|
-
class NgpTooltip {
|
|
266
|
-
constructor() {
|
|
267
|
-
/**
|
|
268
|
-
* Access the overlay.
|
|
269
|
-
*/
|
|
270
|
-
this.overlay = injectOverlay();
|
|
271
|
-
/**
|
|
272
|
-
* The unique id of the tooltip.
|
|
273
|
-
*/
|
|
274
|
-
this.id = input(this.overlay.id());
|
|
275
|
-
explicitEffect([this.id], ([id]) => this.overlay.id.set(id));
|
|
276
|
-
// if the mouse moves over the tooltip, we want to keep it open
|
|
277
|
-
setupHover({
|
|
278
|
-
hoverStart: () => this.overlay.cancelPendingClose(),
|
|
279
|
-
hoverEnd: () => this.overlay.hide(),
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
283
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpTooltip, isStandalone: true, selector: "[ngpTooltip]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tooltip", "data-overlay": "" }, properties: { "id": "id()", "style.left.px": "overlay.position().x", "style.top.px": "overlay.position().y", "style.--ngp-tooltip-trigger-width.px": "overlay.triggerWidth()", "style.--ngp-tooltip-transform-origin": "overlay.transformOrigin()", "attr.data-placement": "overlay.finalPlacement()" } }, exportAs: ["ngpTooltip"], ngImport: i0 }); }
|
|
284
|
-
}
|
|
285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpTooltip, decorators: [{
|
|
286
|
-
type: Directive,
|
|
287
|
-
args: [{
|
|
288
|
-
selector: '[ngpTooltip]',
|
|
289
|
-
exportAs: 'ngpTooltip',
|
|
290
|
-
host: {
|
|
291
|
-
role: 'tooltip',
|
|
292
|
-
'[id]': 'id()',
|
|
293
|
-
'[style.left.px]': 'overlay.position().x',
|
|
294
|
-
'[style.top.px]': 'overlay.position().y',
|
|
295
|
-
'[style.--ngp-tooltip-trigger-width.px]': 'overlay.triggerWidth()',
|
|
296
|
-
'[style.--ngp-tooltip-transform-origin]': 'overlay.transformOrigin()',
|
|
297
|
-
'[attr.data-placement]': 'overlay.finalPlacement()',
|
|
298
|
-
'data-overlay': '',
|
|
299
|
-
},
|
|
300
|
-
}]
|
|
301
|
-
}], ctorParameters: () => [] });
|
|
302
|
-
|
|
303
361
|
class NgpTooltipArrow {
|
|
304
362
|
constructor() {
|
|
305
363
|
setupOverlayArrow();
|