@spartan-ng/brain 0.0.1-alpha.537 → 0.0.1-alpha.538
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/{hover-card/lib/createHoverObservable.d.ts → core/helpers/create-hover-observable.d.ts} +4 -1
- package/core/helpers/wait-for-element-animations.d.ts +5 -0
- package/core/index.d.ts +3 -0
- package/fesm2022/spartan-ng-brain-core.mjs +96 -15
- package/fesm2022/spartan-ng-brain-core.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-hover-card.mjs +7 -24
- package/fesm2022/spartan-ng-brain-hover-card.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-navigation-menu.mjs +681 -0
- package/fesm2022/spartan-ng-brain-navigation-menu.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-radio-group.mjs +2 -2
- package/fesm2022/spartan-ng-brain-radio-group.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-tooltip.mjs +2 -47
- package/fesm2022/spartan-ng-brain-tooltip.mjs.map +1 -1
- package/hover-card/index.d.ts +0 -1
- package/navigation-menu/README.md +3 -0
- package/navigation-menu/index.d.ts +13 -0
- package/navigation-menu/lib/brn-navigation-menu-content.d.ts +22 -0
- package/navigation-menu/lib/brn-navigation-menu-content.service.d.ts +44 -0
- package/navigation-menu/lib/brn-navigation-menu-item-focusable.token.d.ts +4 -0
- package/navigation-menu/lib/brn-navigation-menu-item.d.ts +23 -0
- package/navigation-menu/lib/brn-navigation-menu-item.token.d.ts +5 -0
- package/navigation-menu/lib/brn-navigation-menu-link.d.ts +22 -0
- package/navigation-menu/lib/brn-navigation-menu-list.d.ts +7 -0
- package/navigation-menu/lib/brn-navigation-menu-trigger.d.ts +44 -0
- package/navigation-menu/lib/brn-navigation-menu.d.ts +61 -0
- package/navigation-menu/lib/brn-navigation-menu.token.d.ts +5 -0
- package/navigation-menu/lib/brn-parent-nav-menu.token.d.ts +8 -0
- package/package.json +5 -1
- package/radio-group/index.d.ts +1 -0
- package/radio-group/lib/brn-radio-group.d.ts +1 -1
- /package/{tooltip/lib → core/helpers}/computed-previous.d.ts +0 -0
package/{hover-card/lib/createHoverObservable.d.ts → core/helpers/create-hover-observable.d.ts}
RENAMED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { NgZone } from '@angular/core';
|
|
2
2
|
import { type Observable, type Subject } from 'rxjs';
|
|
3
3
|
export declare function isElement(node?: Element | EventTarget | Node | null): node is Element;
|
|
4
|
-
export declare const createHoverObservable: (nativeElement: HTMLElement, zone: NgZone, destroyed$: Subject<void>) => Observable<
|
|
4
|
+
export declare const createHoverObservable: (nativeElement: HTMLElement, zone: NgZone, destroyed$: Subject<void>) => Observable<{
|
|
5
|
+
hover: boolean;
|
|
6
|
+
relatedTarget?: EventTarget | null;
|
|
7
|
+
}>;
|
package/core/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
export * from './helpers/computed-previous';
|
|
2
|
+
export * from './helpers/create-hover-observable';
|
|
1
3
|
export * from './helpers/custom-element-class-settable';
|
|
2
4
|
export * from './helpers/dev-mode';
|
|
3
5
|
export * from './helpers/exposes-side';
|
|
4
6
|
export * from './helpers/exposes-state';
|
|
5
7
|
export * from './helpers/table-classes-settable';
|
|
8
|
+
export * from './helpers/wait-for-element-animations';
|
|
6
9
|
export * from './helpers/zone-free';
|
|
@@ -1,5 +1,77 @@
|
|
|
1
|
-
import { InjectionToken, forwardRef, inject } from '@angular/core';
|
|
2
|
-
import { Observable, pipe } from 'rxjs';
|
|
1
|
+
import { untracked, computed, InjectionToken, forwardRef, inject } from '@angular/core';
|
|
2
|
+
import { Observable, pipe, merge, fromEvent } from 'rxjs';
|
|
3
|
+
import { map, filter, distinctUntilChanged, takeUntil } from 'rxjs/operators';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns a signal that emits the previous value of the given signal.
|
|
7
|
+
* The first time the signal is emitted, the previous value will be the same as the current value.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const value = signal(0);
|
|
12
|
+
* const previous = computedPrevious(value);
|
|
13
|
+
*
|
|
14
|
+
* effect(() => {
|
|
15
|
+
* console.log('Current value:', value());
|
|
16
|
+
* console.log('Previous value:', previous());
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* Logs:
|
|
20
|
+
* // Current value: 0
|
|
21
|
+
* // Previous value: 0
|
|
22
|
+
*
|
|
23
|
+
* value.set(1);
|
|
24
|
+
*
|
|
25
|
+
* Logs:
|
|
26
|
+
* // Current value: 1
|
|
27
|
+
* // Previous value: 0
|
|
28
|
+
*
|
|
29
|
+
* value.set(2);
|
|
30
|
+
*
|
|
31
|
+
* Logs:
|
|
32
|
+
* // Current value: 2
|
|
33
|
+
* // Previous value: 1
|
|
34
|
+
*```
|
|
35
|
+
*
|
|
36
|
+
* @param computation Signal to compute previous value for
|
|
37
|
+
* @returns Signal that emits previous value of `s`
|
|
38
|
+
*/
|
|
39
|
+
function computedPrevious(computation) {
|
|
40
|
+
let current = null;
|
|
41
|
+
let previous = untracked(() => computation()); // initial value is the current value
|
|
42
|
+
return computed(() => {
|
|
43
|
+
current = computation();
|
|
44
|
+
const result = previous;
|
|
45
|
+
previous = current;
|
|
46
|
+
return result;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function brnZoneFull(zone) {
|
|
51
|
+
return (source) => new Observable((subscriber) => source.subscribe({
|
|
52
|
+
next: (value) => zone.run(() => subscriber.next(value)),
|
|
53
|
+
error: (error) => zone.run(() => subscriber.error(error)),
|
|
54
|
+
complete: () => zone.run(() => subscriber.complete()),
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
function brnZoneFree(zone) {
|
|
58
|
+
return (source) => new Observable((subscriber) => zone.runOutsideAngular(() => source.subscribe(subscriber)));
|
|
59
|
+
}
|
|
60
|
+
function brnZoneOptimized(zone) {
|
|
61
|
+
return pipe(brnZoneFree(zone), brnZoneFull(zone));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function movedOut({ currentTarget, relatedTarget }) {
|
|
65
|
+
return !isElement(relatedTarget) || !isElement(currentTarget) || !currentTarget.contains(relatedTarget);
|
|
66
|
+
}
|
|
67
|
+
function isElement(node) {
|
|
68
|
+
return !!node && 'nodeType' in node && node.nodeType === Node.ELEMENT_NODE;
|
|
69
|
+
}
|
|
70
|
+
const createHoverObservable = (nativeElement, zone, destroyed$) => {
|
|
71
|
+
return merge(fromEvent(nativeElement, 'mouseenter').pipe(map(() => ({ hover: true }))), fromEvent(nativeElement, 'mouseleave').pipe(map((e) => ({ hover: false, relatedTarget: e.relatedTarget }))),
|
|
72
|
+
// Hello, Safari
|
|
73
|
+
fromEvent(nativeElement, 'mouseout').pipe(filter(movedOut), map((e) => ({ hover: false, relatedTarget: e.relatedTarget })))).pipe(distinctUntilChanged(), brnZoneOptimized(zone), takeUntil(destroyed$));
|
|
74
|
+
};
|
|
3
75
|
|
|
4
76
|
function createInjectionToken(description) {
|
|
5
77
|
const token = new InjectionToken(description);
|
|
@@ -29,23 +101,32 @@ const [injectExposesStateProvider, provideExposesStateProvider, provideExposesSt
|
|
|
29
101
|
|
|
30
102
|
const [injectTableClassesSettable, provideTableClassesSettable, provideTableClassesSettableExisting, SET_TABLE_CLASSES_TOKEN,] = createInjectionToken('@spartan-ng SET_TABLE_CLASSES_TOKEN');
|
|
31
103
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Waits for all animations (including subtree) within the given element to finish.
|
|
106
|
+
* Ignores animations canceled with an AbortError.
|
|
107
|
+
*/
|
|
108
|
+
async function waitForElementAnimations(el) {
|
|
109
|
+
// Wait a tick to allow newly triggered animations to start
|
|
110
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
111
|
+
const animationFillMode = el.style.animationFillMode;
|
|
112
|
+
const animations = el.getAnimations({ subtree: true });
|
|
113
|
+
el.style.animationFillMode = 'forwards';
|
|
114
|
+
await Promise.all(animations.map((animation) => animation.finished.catch((err) => {
|
|
115
|
+
// Ignore AbortError from canceled animations (treated as "finished")
|
|
116
|
+
if (!(err instanceof Error && err.name === 'AbortError')) {
|
|
117
|
+
throw err;
|
|
118
|
+
}
|
|
119
|
+
return animation;
|
|
120
|
+
})));
|
|
121
|
+
setTimeout(() => {
|
|
122
|
+
if (el.style.animationFillMode === 'forwards')
|
|
123
|
+
el.style.animationFillMode = animationFillMode;
|
|
124
|
+
});
|
|
44
125
|
}
|
|
45
126
|
|
|
46
127
|
/**
|
|
47
128
|
* Generated bundle index. Do not edit.
|
|
48
129
|
*/
|
|
49
130
|
|
|
50
|
-
export { EXPOSES_SIDE_TOKEN, EXPOSES_STATE_TOKEN, SET_CLASS_TO_CUSTOM_ELEMENT_TOKEN, SET_TABLE_CLASSES_TOKEN, brnDevMode, brnZoneFree, brnZoneFull, brnZoneOptimized, injectCustomClassSettable, injectExposedSideProvider, injectExposesStateProvider, injectTableClassesSettable, provideCustomClassSettable, provideCustomClassSettableExisting, provideExposedSideProvider, provideExposedSideProviderExisting, provideExposesStateProvider, provideExposesStateProviderExisting, provideTableClassesSettable, provideTableClassesSettableExisting };
|
|
131
|
+
export { EXPOSES_SIDE_TOKEN, EXPOSES_STATE_TOKEN, SET_CLASS_TO_CUSTOM_ELEMENT_TOKEN, SET_TABLE_CLASSES_TOKEN, brnDevMode, brnZoneFree, brnZoneFull, brnZoneOptimized, computedPrevious, createHoverObservable, injectCustomClassSettable, injectExposedSideProvider, injectExposesStateProvider, injectTableClassesSettable, isElement, provideCustomClassSettable, provideCustomClassSettableExisting, provideExposedSideProvider, provideExposedSideProviderExisting, provideExposesStateProvider, provideExposesStateProviderExisting, provideTableClassesSettable, provideTableClassesSettableExisting, waitForElementAnimations };
|
|
51
132
|
//# sourceMappingURL=spartan-ng-brain-core.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spartan-ng-brain-core.mjs","sources":["../../../../libs/brain/core/src/helpers/create-injection-token.ts","../../../../libs/brain/core/src/helpers/custom-element-class-settable.ts","../../../../libs/brain/core/src/helpers/dev-mode.ts","../../../../libs/brain/core/src/helpers/exposes-side.ts","../../../../libs/brain/core/src/helpers/exposes-state.ts","../../../../libs/brain/core/src/helpers/table-classes-settable.ts","../../../../libs/brain/core/src/helpers/zone-free.ts","../../../../libs/brain/core/src/spartan-ng-brain-core.ts"],"sourcesContent":["import { type InjectOptions, InjectionToken, type Provider, type Type, forwardRef, inject } from '@angular/core';\n\ntype InjectFn<TTokenValue> = {\n\t(): TTokenValue;\n\t(injectOptions: InjectOptions & { optional?: false }): TTokenValue;\n\t(injectOptions: InjectOptions & { optional: true }): TTokenValue | null;\n};\n\ntype ProvideFn<TTokenValue> = (value: TTokenValue) => Provider;\n\ntype ProvideExistingFn<TTokenValue> = (valueFactory: () => Type<TTokenValue>) => Provider;\n\nexport type CreateInjectionTokenReturn<TTokenValue> = [\n\tInjectFn<TTokenValue>,\n\tProvideFn<TTokenValue>,\n\tProvideExistingFn<TTokenValue>,\n\tInjectionToken<TTokenValue>,\n];\n\nexport function createInjectionToken<TTokenValue>(description: string): CreateInjectionTokenReturn<TTokenValue> {\n\tconst token = new InjectionToken<TTokenValue>(description);\n\n\tconst provideFn = (value: TTokenValue) => {\n\t\treturn { provide: token, useValue: value };\n\t};\n\n\tconst provideExistingFn = (value: () => TTokenValue) => {\n\t\treturn { provide: token, useExisting: forwardRef(value) };\n\t};\n\n\tconst injectFn = (options: InjectOptions = {}) => {\n\t\treturn inject(token, options);\n\t};\n\n\treturn [injectFn, provideFn, provideExistingFn, token] as CreateInjectionTokenReturn<TTokenValue>;\n}\n","import { createInjectionToken } from './create-injection-token';\n\nexport interface CustomElementClassSettable {\n\tsetClassToCustomElement: (newClass: string) => void;\n}\n\nexport const [\n\tinjectCustomClassSettable,\n\tprovideCustomClassSettable,\n\tprovideCustomClassSettableExisting,\n\tSET_CLASS_TO_CUSTOM_ELEMENT_TOKEN,\n] = createInjectionToken<CustomElementClassSettable>('@spartan-ng SET_CLASS_TO_CUSTOM_ELEMENT_TOKEN');\n","declare const ngDevMode: boolean;\n/**\n * Set by Angular to true when in development mode.\n * Allows for tree-shaking code that is only used in development.\n */\nexport const brnDevMode = ngDevMode;\n","import type { Signal } from '@angular/core';\nimport { createInjectionToken } from './create-injection-token';\n\nexport interface ExposesSide {\n\tside: Signal<'top' | 'bottom' | 'left' | 'right'>;\n}\n\nexport const [\n\tinjectExposedSideProvider,\n\tprovideExposedSideProvider,\n\tprovideExposedSideProviderExisting,\n\tEXPOSES_SIDE_TOKEN,\n] = createInjectionToken<ExposesSide>('@spartan-ng EXPOSES_SIDE_TOKEN');\n","import type { Signal } from '@angular/core';\nimport { createInjectionToken } from './create-injection-token';\n\nexport interface ExposesState {\n\tstate: Signal<'open' | 'closed'>;\n}\n\nexport const [\n\tinjectExposesStateProvider,\n\tprovideExposesStateProvider,\n\tprovideExposesStateProviderExisting,\n\tEXPOSES_STATE_TOKEN,\n] = createInjectionToken<ExposesState>('@spartan-ng EXPOSES_STATE_TOKEN');\n","import { createInjectionToken } from './create-injection-token';\n\nexport interface TableClassesSettable {\n\tsetTableClasses: (classes: Partial<{ table: string; headerRow: string; bodyRow: string }>) => void;\n}\n\nexport const [\n\tinjectTableClassesSettable,\n\tprovideTableClassesSettable,\n\tprovideTableClassesSettableExisting,\n\tSET_TABLE_CLASSES_TOKEN,\n] = createInjectionToken<TableClassesSettable>('@spartan-ng SET_TABLE_CLASSES_TOKEN');\n","/**\n * We are building on shoulders of giants here and use the implementation provided by the incredible TaigaUI\n * team: https://github.com/taiga-family/taiga-ui/blob/main/projects/cdk/observables/zone-free.ts#L22\n * Check them out! Give them a try! Leave a star! Their work is incredible!\n */\nimport type { NgZone } from '@angular/core';\nimport { type MonoTypeOperatorFunction, Observable, pipe } from 'rxjs';\n\nexport function brnZoneFull<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn (source) =>\n\t\tnew Observable((subscriber) =>\n\t\t\tsource.subscribe({\n\t\t\t\tnext: (value) => zone.run(() => subscriber.next(value)),\n\t\t\t\terror: (error: unknown) => zone.run(() => subscriber.error(error)),\n\t\t\t\tcomplete: () => zone.run(() => subscriber.complete()),\n\t\t\t}),\n\t\t);\n}\n\nexport function brnZoneFree<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn (source) => new Observable((subscriber) => zone.runOutsideAngular(() => source.subscribe(subscriber)));\n}\n\nexport function brnZoneOptimized<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn pipe(brnZoneFree(zone), brnZoneFull(zone));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAmBM,SAAU,oBAAoB,CAAc,WAAmB,EAAA;AACpE,IAAA,MAAM,KAAK,GAAG,IAAI,cAAc,CAAc,WAAW,CAAC;AAE1D,IAAA,MAAM,SAAS,GAAG,CAAC,KAAkB,KAAI;QACxC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;AAC3C,KAAC;AAED,IAAA,MAAM,iBAAiB,GAAG,CAAC,KAAwB,KAAI;AACtD,QAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE;AAC1D,KAAC;AAED,IAAA,MAAM,QAAQ,GAAG,CAAC,OAAA,GAAyB,EAAE,KAAI;AAChD,QAAA,OAAO,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC;AAC9B,KAAC;IAED,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,CAA4C;AAClG;;AC7BO,MAAM,CACZ,yBAAyB,EACzB,0BAA0B,EAC1B,kCAAkC,EAClC,iCAAiC,E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EG;;;;"}
|
|
1
|
+
{"version":3,"file":"spartan-ng-brain-core.mjs","sources":["../../../../libs/brain/core/src/helpers/computed-previous.ts","../../../../libs/brain/core/src/helpers/zone-free.ts","../../../../libs/brain/core/src/helpers/create-hover-observable.ts","../../../../libs/brain/core/src/helpers/create-injection-token.ts","../../../../libs/brain/core/src/helpers/custom-element-class-settable.ts","../../../../libs/brain/core/src/helpers/dev-mode.ts","../../../../libs/brain/core/src/helpers/exposes-side.ts","../../../../libs/brain/core/src/helpers/exposes-state.ts","../../../../libs/brain/core/src/helpers/table-classes-settable.ts","../../../../libs/brain/core/src/helpers/wait-for-element-animations.ts","../../../../libs/brain/core/src/spartan-ng-brain-core.ts"],"sourcesContent":["import { computed, type Signal, untracked } from '@angular/core';\n\n/**\n * Returns a signal that emits the previous value of the given signal.\n * The first time the signal is emitted, the previous value will be the same as the current value.\n *\n * @example\n * ```ts\n * const value = signal(0);\n * const previous = computedPrevious(value);\n *\n * effect(() => {\n * console.log('Current value:', value());\n * console.log('Previous value:', previous());\n * });\n *\n * Logs:\n * // Current value: 0\n * // Previous value: 0\n *\n * value.set(1);\n *\n * Logs:\n * // Current value: 1\n * // Previous value: 0\n *\n * value.set(2);\n *\n * Logs:\n * // Current value: 2\n * // Previous value: 1\n *```\n *\n * @param computation Signal to compute previous value for\n * @returns Signal that emits previous value of `s`\n */\nexport function computedPrevious<T>(computation: Signal<T>): Signal<T> {\n\tlet current = null as T;\n\tlet previous = untracked(() => computation()); // initial value is the current value\n\n\treturn computed(() => {\n\t\tcurrent = computation();\n\t\tconst result = previous;\n\t\tprevious = current;\n\t\treturn result;\n\t});\n}\n","/**\n * We are building on shoulders of giants here and use the implementation provided by the incredible TaigaUI\n * team: https://github.com/taiga-family/taiga-ui/blob/main/projects/cdk/observables/zone-free.ts#L22\n * Check them out! Give them a try! Leave a star! Their work is incredible!\n */\nimport type { NgZone } from '@angular/core';\nimport { type MonoTypeOperatorFunction, Observable, pipe } from 'rxjs';\n\nexport function brnZoneFull<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn (source) =>\n\t\tnew Observable((subscriber) =>\n\t\t\tsource.subscribe({\n\t\t\t\tnext: (value) => zone.run(() => subscriber.next(value)),\n\t\t\t\terror: (error: unknown) => zone.run(() => subscriber.error(error)),\n\t\t\t\tcomplete: () => zone.run(() => subscriber.complete()),\n\t\t\t}),\n\t\t);\n}\n\nexport function brnZoneFree<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn (source) => new Observable((subscriber) => zone.runOutsideAngular(() => source.subscribe(subscriber)));\n}\n\nexport function brnZoneOptimized<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn pipe(brnZoneFree(zone), brnZoneFull(zone));\n}\n","import type { NgZone } from '@angular/core';\nimport { type Observable, type Subject, fromEvent, merge } from 'rxjs';\nimport { distinctUntilChanged, filter, map, takeUntil } from 'rxjs/operators';\nimport { brnZoneOptimized } from './zone-free';\n\nfunction movedOut({ currentTarget, relatedTarget }: MouseEvent): boolean {\n\treturn !isElement(relatedTarget) || !isElement(currentTarget) || !currentTarget.contains(relatedTarget);\n}\n\nexport function isElement(node?: Element | EventTarget | Node | null): node is Element {\n\treturn !!node && 'nodeType' in node && node.nodeType === Node.ELEMENT_NODE;\n}\n\nexport const createHoverObservable = (\n\tnativeElement: HTMLElement,\n\tzone: NgZone,\n\tdestroyed$: Subject<void>,\n): Observable<{ hover: boolean; relatedTarget?: EventTarget | null }> => {\n\treturn merge(\n\t\tfromEvent(nativeElement, 'mouseenter').pipe(map(() => ({ hover: true }))),\n\t\tfromEvent<MouseEvent>(nativeElement, 'mouseleave').pipe(\n\t\t\tmap((e) => ({ hover: false, relatedTarget: e.relatedTarget })),\n\t\t),\n\t\t// Hello, Safari\n\t\tfromEvent<MouseEvent>(nativeElement, 'mouseout').pipe(\n\t\t\tfilter(movedOut),\n\t\t\tmap((e) => ({ hover: false, relatedTarget: e.relatedTarget })),\n\t\t),\n\t).pipe(distinctUntilChanged(), brnZoneOptimized(zone), takeUntil(destroyed$));\n};\n","import { type InjectOptions, InjectionToken, type Provider, type Type, forwardRef, inject } from '@angular/core';\n\ntype InjectFn<TTokenValue> = {\n\t(): TTokenValue;\n\t(injectOptions: InjectOptions & { optional?: false }): TTokenValue;\n\t(injectOptions: InjectOptions & { optional: true }): TTokenValue | null;\n};\n\ntype ProvideFn<TTokenValue> = (value: TTokenValue) => Provider;\n\ntype ProvideExistingFn<TTokenValue> = (valueFactory: () => Type<TTokenValue>) => Provider;\n\nexport type CreateInjectionTokenReturn<TTokenValue> = [\n\tInjectFn<TTokenValue>,\n\tProvideFn<TTokenValue>,\n\tProvideExistingFn<TTokenValue>,\n\tInjectionToken<TTokenValue>,\n];\n\nexport function createInjectionToken<TTokenValue>(description: string): CreateInjectionTokenReturn<TTokenValue> {\n\tconst token = new InjectionToken<TTokenValue>(description);\n\n\tconst provideFn = (value: TTokenValue) => {\n\t\treturn { provide: token, useValue: value };\n\t};\n\n\tconst provideExistingFn = (value: () => TTokenValue) => {\n\t\treturn { provide: token, useExisting: forwardRef(value) };\n\t};\n\n\tconst injectFn = (options: InjectOptions = {}) => {\n\t\treturn inject(token, options);\n\t};\n\n\treturn [injectFn, provideFn, provideExistingFn, token] as CreateInjectionTokenReturn<TTokenValue>;\n}\n","import { createInjectionToken } from './create-injection-token';\n\nexport interface CustomElementClassSettable {\n\tsetClassToCustomElement: (newClass: string) => void;\n}\n\nexport const [\n\tinjectCustomClassSettable,\n\tprovideCustomClassSettable,\n\tprovideCustomClassSettableExisting,\n\tSET_CLASS_TO_CUSTOM_ELEMENT_TOKEN,\n] = createInjectionToken<CustomElementClassSettable>('@spartan-ng SET_CLASS_TO_CUSTOM_ELEMENT_TOKEN');\n","declare const ngDevMode: boolean;\n/**\n * Set by Angular to true when in development mode.\n * Allows for tree-shaking code that is only used in development.\n */\nexport const brnDevMode = ngDevMode;\n","import type { Signal } from '@angular/core';\nimport { createInjectionToken } from './create-injection-token';\n\nexport interface ExposesSide {\n\tside: Signal<'top' | 'bottom' | 'left' | 'right'>;\n}\n\nexport const [\n\tinjectExposedSideProvider,\n\tprovideExposedSideProvider,\n\tprovideExposedSideProviderExisting,\n\tEXPOSES_SIDE_TOKEN,\n] = createInjectionToken<ExposesSide>('@spartan-ng EXPOSES_SIDE_TOKEN');\n","import type { Signal } from '@angular/core';\nimport { createInjectionToken } from './create-injection-token';\n\nexport interface ExposesState {\n\tstate: Signal<'open' | 'closed'>;\n}\n\nexport const [\n\tinjectExposesStateProvider,\n\tprovideExposesStateProvider,\n\tprovideExposesStateProviderExisting,\n\tEXPOSES_STATE_TOKEN,\n] = createInjectionToken<ExposesState>('@spartan-ng EXPOSES_STATE_TOKEN');\n","import { createInjectionToken } from './create-injection-token';\n\nexport interface TableClassesSettable {\n\tsetTableClasses: (classes: Partial<{ table: string; headerRow: string; bodyRow: string }>) => void;\n}\n\nexport const [\n\tinjectTableClassesSettable,\n\tprovideTableClassesSettable,\n\tprovideTableClassesSettableExisting,\n\tSET_TABLE_CLASSES_TOKEN,\n] = createInjectionToken<TableClassesSettable>('@spartan-ng SET_TABLE_CLASSES_TOKEN');\n","/**\n * Waits for all animations (including subtree) within the given element to finish.\n * Ignores animations canceled with an AbortError.\n */\nexport async function waitForElementAnimations(el: HTMLElement): Promise<void> {\n\t// Wait a tick to allow newly triggered animations to start\n\tawait new Promise<void>((resolve) => setTimeout(resolve, 0));\n\n\tconst animationFillMode = el.style.animationFillMode;\n\tconst animations = el.getAnimations({ subtree: true });\n\tel.style.animationFillMode = 'forwards';\n\n\tawait Promise.all(\n\t\tanimations.map((animation) =>\n\t\t\tanimation.finished.catch((err) => {\n\t\t\t\t// Ignore AbortError from canceled animations (treated as \"finished\")\n\t\t\t\tif (!(err instanceof Error && err.name === 'AbortError')) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\n\t\t\t\treturn animation;\n\t\t\t}),\n\t\t),\n\t);\n\n\tsetTimeout(() => {\n\t\tif (el.style.animationFillMode === 'forwards') el.style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E,IAAI,EAAE,CAAC;AACtD,IAAA,EAAE,CAAC,KAAK,CAAC,iBAAiB,GAAG,UAAU;IAEvC,MAAM,OAAO,CAAC,GAAG,CAChB,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,KACxB,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,KAAI;;AAEhC,QAAA,IAAI,EAAE,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,CAAC,EAAE;AACzD,YAAA,MAAM,GAAG;;AAGV,QAAA,OAAO,SAAS;KAChB,CAAC,CACF,CACD;IAED,UAAU,CAAC,MAAK;AACf,QAAA,IAAI,EAAE,CAAC,KAAK,CAAC,iBAAiB,KAAK,UAAU;AAAE,YAAA,EAAE,CAAC,KAAK,CAAC,iBAAiB,GAAG,iBAAiB;AAC9F,KAAC,CAAC;AACH;;AC5BA;;AAEG;;;;"}
|
|
@@ -4,26 +4,9 @@ import { FocusMonitor } from '@angular/cdk/a11y';
|
|
|
4
4
|
import { Overlay, OverlayPositionBuilder } from '@angular/cdk/overlay';
|
|
5
5
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
6
6
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
function movedOut({ currentTarget, relatedTarget }) {
|
|
12
|
-
return !isElement(relatedTarget) || !isElement(currentTarget) || !currentTarget.contains(relatedTarget);
|
|
13
|
-
}
|
|
14
|
-
function isElement(node) {
|
|
15
|
-
return !!node && 'nodeType' in node && node.nodeType === Node.ELEMENT_NODE;
|
|
16
|
-
}
|
|
17
|
-
const createHoverObservable = (nativeElement, zone, destroyed$) => {
|
|
18
|
-
return merge(fromEvent(nativeElement, 'mouseenter').pipe(map(() => true)), fromEvent(nativeElement, 'mouseleave').pipe(map(() => false)),
|
|
19
|
-
// Hello, Safari
|
|
20
|
-
fromEvent(nativeElement, 'mouseout').pipe(filter(movedOut), map(() => false)),
|
|
21
|
-
/**
|
|
22
|
-
* NOTE: onmouseout events don't trigger when objects move under mouse in Safari
|
|
23
|
-
* https://bugs.webkit.org/show_bug.cgi?id=4117
|
|
24
|
-
*/
|
|
25
|
-
fromEvent(nativeElement, 'transitionend').pipe(map(() => nativeElement.matches(':hover')))).pipe(distinctUntilChanged(), brnZoneOptimized(zone), takeUntil(destroyed$));
|
|
26
|
-
};
|
|
7
|
+
import { provideExposedSideProviderExisting, provideExposesStateProviderExisting, createHoverObservable } from '@spartan-ng/brain/core';
|
|
8
|
+
import { Subject, BehaviorSubject, of, merge, fromEvent } from 'rxjs';
|
|
9
|
+
import { switchMap, filter, map, distinctUntilChanged, tap, delay, share, takeUntil } from 'rxjs/operators';
|
|
27
10
|
|
|
28
11
|
class BrnHoverCardContent {
|
|
29
12
|
_contentService = inject(BrnHoverCardContentService);
|
|
@@ -102,7 +85,7 @@ class BrnHoverCardContentService {
|
|
|
102
85
|
if (config.attachTo) {
|
|
103
86
|
this._positionStrategy = this._psBuilder
|
|
104
87
|
.flexibleConnectedTo(config.attachTo)
|
|
105
|
-
.withPositions(
|
|
88
|
+
.withPositions(config.attachPositions ?? (config.align === 'top' ? topFirstPositions : bottomFirstPositions))
|
|
106
89
|
.withDefaultOffsetY(config.sideOffset ?? 0);
|
|
107
90
|
this._config = {
|
|
108
91
|
...this._config,
|
|
@@ -129,7 +112,7 @@ class BrnHoverCardContentService {
|
|
|
129
112
|
this._overlayRef?.detach();
|
|
130
113
|
this._overlayRef?.attach(content);
|
|
131
114
|
this._destroyed$ = new Subject();
|
|
132
|
-
this._overlayHoveredObservables$.next(createHoverObservable(this._overlayRef.hostElement, this._zone, this._destroyed$));
|
|
115
|
+
this._overlayHoveredObservables$.next(createHoverObservable(this._overlayRef.hostElement, this._zone, this._destroyed$).pipe(map((e) => e.hover)));
|
|
133
116
|
}
|
|
134
117
|
hide() {
|
|
135
118
|
this._overlayRef?.detach();
|
|
@@ -151,7 +134,7 @@ class BrnHoverCardTrigger {
|
|
|
151
134
|
_contentService = inject(BrnHoverCardContentService);
|
|
152
135
|
_focusMonitor = inject(FocusMonitor);
|
|
153
136
|
focused$ = this._focusMonitor.monitor(this._el).pipe(map((e) => e !== null));
|
|
154
|
-
hovered$ = merge(fromEvent(this._el.nativeElement, 'click').pipe(map(() => false)), createHoverObservable(this._el.nativeElement, this._zone, this._destroy$), this._contentService.hovered$, this.focused$).pipe(distinctUntilChanged());
|
|
137
|
+
hovered$ = merge(fromEvent(this._el.nativeElement, 'click').pipe(map(() => false)), createHoverObservable(this._el.nativeElement, this._zone, this._destroy$).pipe(map((e) => e.hover)), this._contentService.hovered$, this.focused$).pipe(distinctUntilChanged());
|
|
155
138
|
showing$ = this.hovered$.pipe(
|
|
156
139
|
// we set the state to open here because we are about to open show the content
|
|
157
140
|
tap((visible) => visible && this._contentService.setState('open')), switchMap((visible) => {
|
|
@@ -241,5 +224,5 @@ const BrnHoverCardImports = [BrnHoverCard, BrnHoverCardContent, BrnHoverCardTrig
|
|
|
241
224
|
* Generated bundle index. Do not edit.
|
|
242
225
|
*/
|
|
243
226
|
|
|
244
|
-
export { BrnHoverCard, BrnHoverCardContent, BrnHoverCardContentService, BrnHoverCardImports, BrnHoverCardTrigger
|
|
227
|
+
export { BrnHoverCard, BrnHoverCardContent, BrnHoverCardContentService, BrnHoverCardImports, BrnHoverCardTrigger };
|
|
245
228
|
//# sourceMappingURL=spartan-ng-brain-hover-card.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spartan-ng-brain-hover-card.mjs","sources":["../../../../libs/brain/hover-card/src/lib/createHoverObservable.ts","../../../../libs/brain/hover-card/src/lib/brn-hover-card-content.service.ts","../../../../libs/brain/hover-card/src/lib/brn-hover-card.ts","../../../../libs/brain/hover-card/src/index.ts","../../../../libs/brain/hover-card/src/spartan-ng-brain-hover-card.ts"],"sourcesContent":["import type { NgZone } from '@angular/core';\nimport { brnZoneOptimized } from '@spartan-ng/brain/core';\nimport { type Observable, type Subject, fromEvent, merge } from 'rxjs';\nimport { distinctUntilChanged, filter, map, takeUntil } from 'rxjs/operators';\n\nfunction movedOut({ currentTarget, relatedTarget }: MouseEvent): boolean {\n\treturn !isElement(relatedTarget) || !isElement(currentTarget) || !currentTarget.contains(relatedTarget);\n}\n\nexport function isElement(node?: Element | EventTarget | Node | null): node is Element {\n\treturn !!node && 'nodeType' in node && node.nodeType === Node.ELEMENT_NODE;\n}\n\nexport const createHoverObservable = (\n\tnativeElement: HTMLElement,\n\tzone: NgZone,\n\tdestroyed$: Subject<void>,\n): Observable<boolean> => {\n\treturn merge(\n\t\tfromEvent(nativeElement, 'mouseenter').pipe(map(() => true)),\n\t\tfromEvent(nativeElement, 'mouseleave').pipe(map(() => false)),\n\t\t// Hello, Safari\n\t\tfromEvent<MouseEvent>(nativeElement, 'mouseout').pipe(\n\t\t\tfilter(movedOut),\n\t\t\tmap(() => false),\n\t\t),\n\t\t/**\n\t\t * NOTE: onmouseout events don't trigger when objects move under mouse in Safari\n\t\t * https://bugs.webkit.org/show_bug.cgi?id=4117\n\t\t */\n\t\tfromEvent(nativeElement, 'transitionend').pipe(map(() => nativeElement.matches(':hover'))),\n\t).pipe(distinctUntilChanged(), brnZoneOptimized(zone), takeUntil(destroyed$));\n};\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport {\n\ttype ConnectedOverlayPositionChange,\n\ttype ConnectedPosition,\n\ttype FlexibleConnectedPositionStrategy,\n\tOverlay,\n\ttype OverlayConfig,\n\tOverlayPositionBuilder,\n\ttype OverlayRef,\n} from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n\tcomputed,\n\tDirective,\n\teffect,\n\tElementRef,\n\tinject,\n\tInjectable,\n\tinput,\n\tNgZone,\n\ttype OnDestroy,\n\ttype OnInit,\n\ttype Signal,\n\tsignal,\n\tTemplateRef,\n\tuntracked,\n\tViewContainerRef,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport {\n\ttype ExposesSide,\n\ttype ExposesState,\n\tprovideExposedSideProviderExisting,\n\tprovideExposesStateProviderExisting,\n} from '@spartan-ng/brain/core';\nimport { BehaviorSubject, fromEvent, merge, type Observable, of, Subject } from 'rxjs';\nimport { delay, distinctUntilChanged, filter, map, share, switchMap, takeUntil, tap } from 'rxjs/operators';\nimport { createHoverObservable } from './createHoverObservable';\n\n@Directive({\n\tselector: '[brnHoverCardContent]',\n\texportAs: 'brnHoverCardContent',\n\tproviders: [\n\t\tprovideExposedSideProviderExisting(() => BrnHoverCardContent),\n\t\tprovideExposesStateProviderExisting(() => BrnHoverCardContent),\n\t],\n})\nexport class BrnHoverCardContent implements ExposesState, ExposesSide {\n\tprivate readonly _contentService = inject(BrnHoverCardContentService);\n\tpublic readonly state = this._contentService.state;\n\tpublic readonly side = this._contentService.side;\n\tpublic readonly template = inject(TemplateRef);\n}\n\n/**\n * We are building on shoulders of giants here and use the implementation provided by the incredible TaigaUI\n * team: https://github.com/taiga-family/taiga-ui/blob/main/projects/core/directives/dropdown/dropdown-hover.directive.ts\n * Check them out! Give them a try! Leave a star! Their work is incredible!\n */\n\nexport type BrnHoverCardOptions = Partial<\n\t{\n\t\tattachTo: ElementRef;\n\t\tattachPositions: ConnectedPosition[];\n\t\talign: 'top' | 'bottom';\n\t\tsideOffset: number;\n\t} & OverlayConfig\n>;\n\nconst topFirstPositions: ConnectedPosition[] = [\n\t{\n\t\toriginX: 'center',\n\t\toriginY: 'top',\n\t\toverlayX: 'center',\n\t\toverlayY: 'bottom',\n\t},\n\t{\n\t\toriginX: 'center',\n\t\toriginY: 'bottom',\n\t\toverlayX: 'center',\n\t\toverlayY: 'top',\n\t},\n];\nconst bottomFirstPositions: ConnectedPosition[] = [\n\t{\n\t\toriginX: 'center',\n\t\toriginY: 'bottom',\n\t\toverlayX: 'center',\n\t\toverlayY: 'top',\n\t},\n\t{\n\t\toriginX: 'center',\n\t\toriginY: 'top',\n\t\toverlayX: 'center',\n\t\toverlayY: 'bottom',\n\t},\n];\n\n@Injectable()\nexport class BrnHoverCardContentService {\n\tprivate readonly _overlay = inject(Overlay);\n\tprivate readonly _zone = inject(NgZone);\n\tprivate readonly _psBuilder = inject(OverlayPositionBuilder);\n\n\tprivate readonly _content = signal<TemplatePortal<unknown> | null>(null);\n\tprivate readonly _state = signal<'open' | 'closed'>('closed');\n\n\tprivate _config: BrnHoverCardOptions = {};\n\tprivate _overlayRef?: OverlayRef;\n\tprivate _positionStrategy?: FlexibleConnectedPositionStrategy;\n\tprivate _destroyed$ = new Subject<void>();\n\n\tprivate readonly _positionChangesObservables$ = new BehaviorSubject<\n\t\tObservable<ConnectedOverlayPositionChange> | undefined\n\t>(undefined);\n\tprivate readonly _overlayHoveredObservables$ = new BehaviorSubject<Observable<boolean> | undefined>(undefined);\n\n\tpublic readonly positionChanges$: Observable<ConnectedOverlayPositionChange> = this._positionChangesObservables$.pipe(\n\t\tswitchMap((positionChangeObservable) => (positionChangeObservable ? positionChangeObservable : of(undefined))),\n\t\tfilter((change): change is NonNullable<ConnectedOverlayPositionChange> => change !== undefined && change !== null),\n\t);\n\tpublic readonly hovered$: Observable<boolean> = this._overlayHoveredObservables$.pipe(\n\t\tswitchMap((overlayHoveredObservable) => (overlayHoveredObservable ? overlayHoveredObservable : of(false))),\n\t);\n\n\tpublic readonly state = this._state.asReadonly();\n\tpublic readonly side: Signal<'top' | 'bottom' | 'left' | 'right'> = toSignal(\n\t\tthis.positionChanges$.pipe(\n\t\t\tmap<ConnectedOverlayPositionChange, 'top' | 'bottom' | 'left' | 'right'>((change) =>\n\t\t\t\t// todo: better translation or adjusting hlm to take that into account\n\t\t\t\tchange.connectionPair.originY === 'center'\n\t\t\t\t\t? change.connectionPair.originX === 'start'\n\t\t\t\t\t\t? 'left'\n\t\t\t\t\t\t: 'right'\n\t\t\t\t\t: change.connectionPair.originY,\n\t\t\t),\n\t\t),\n\t\t{ initialValue: 'bottom' },\n\t);\n\n\tpublic setConfig(config: BrnHoverCardOptions) {\n\t\tthis._config = config;\n\t\tif (config.attachTo) {\n\t\t\tthis._positionStrategy = this._psBuilder\n\t\t\t\t.flexibleConnectedTo(config.attachTo)\n\t\t\t\t.withPositions((config.attachPositions ?? config.align === 'top') ? topFirstPositions : bottomFirstPositions)\n\t\t\t\t.withDefaultOffsetY(config.sideOffset ?? 0);\n\t\t\tthis._config = {\n\t\t\t\t...this._config,\n\t\t\t\tpositionStrategy: this._positionStrategy,\n\t\t\t\tscrollStrategy: this._overlay.scrollStrategies.reposition(),\n\t\t\t};\n\t\t\tthis._positionChangesObservables$.next(this._positionStrategy.positionChanges);\n\t\t}\n\t\tthis._overlayRef = this._overlay.create(this._config);\n\t}\n\n\tpublic setContent(value: TemplateRef<unknown> | BrnHoverCardContent, vcr: ViewContainerRef) {\n\t\tthis._content.set(new TemplatePortal<unknown>(value instanceof TemplateRef ? value : value.template, vcr));\n\n\t\tif (!this._overlayRef) {\n\t\t\tthis._overlayRef = this._overlay.create(this._config);\n\t\t}\n\t}\n\n\tpublic setState(newState: 'open' | 'closed') {\n\t\tthis._state.set(newState);\n\t}\n\n\tpublic show() {\n\t\tconst content = this._content();\n\t\tif (!content || !this._overlayRef) return;\n\n\t\tthis._overlayRef?.detach();\n\t\tthis._overlayRef?.attach(content);\n\n\t\tthis._destroyed$ = new Subject<void>();\n\n\t\tthis._overlayHoveredObservables$.next(\n\t\t\tcreateHoverObservable(this._overlayRef.hostElement, this._zone, this._destroyed$),\n\t\t);\n\t}\n\n\tpublic hide() {\n\t\tthis._overlayRef?.detach();\n\t\tthis._destroyed$.next();\n\t\tthis._destroyed$.complete();\n\t\tthis._destroyed$ = new Subject<void>();\n\t}\n}\n\n@Directive({\n\tselector: '[brnHoverCardTrigger]:not(ng-container),[brnHoverCardTriggerFor]:not(ng-container)',\n\texportAs: 'brnHoverCardTrigger',\n})\nexport class BrnHoverCardTrigger implements OnInit, OnDestroy {\n\tprivate readonly _destroy$ = new Subject<void>();\n\tprivate readonly _vcr = inject(ViewContainerRef);\n\tprivate readonly _zone = inject(NgZone);\n\tprivate readonly _el = inject(ElementRef);\n\tprivate readonly _contentService = inject(BrnHoverCardContentService);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\n\tpublic readonly focused$: Observable<boolean> = this._focusMonitor.monitor(this._el).pipe(map((e) => e !== null));\n\n\tpublic readonly hovered$: Observable<boolean> = merge(\n\t\tfromEvent(this._el.nativeElement, 'click').pipe(map(() => false)),\n\t\tcreateHoverObservable(this._el.nativeElement, this._zone, this._destroy$),\n\t\tthis._contentService.hovered$,\n\t\tthis.focused$,\n\t).pipe(distinctUntilChanged());\n\tpublic readonly showing$: Observable<boolean> = this.hovered$.pipe(\n\t\t// we set the state to open here because we are about to open show the content\n\t\ttap((visible) => visible && this._contentService.setState('open')),\n\t\tswitchMap((visible) => {\n\t\t\t// we are delaying based on the configure-able input\n\t\t\treturn of(visible).pipe(delay(visible ? this.showDelay() : this.hideDelay()));\n\t\t}),\n\t\tswitchMap((visible) => {\n\t\t\t// don't do anything when we are in the process of showing the content\n\t\t\tif (visible) return of(visible);\n\t\t\t// we set the state to closed here to trigger any animations for the element leaving\n\t\t\tthis._contentService.setState('closed');\n\t\t\t// then delay to wait for the leaving animation to finish\n\t\t\treturn of(visible).pipe(delay(this.animationDelay()));\n\t\t}),\n\t\tdistinctUntilChanged(),\n\t\tshare(),\n\t\ttakeUntil(this._destroy$),\n\t);\n\n\tpublic readonly showDelay = input(300);\n\tpublic readonly hideDelay = input(500);\n\tpublic readonly animationDelay = input(100);\n\tpublic readonly sideOffset = input(5);\n\tpublic readonly align = input<'top' | 'bottom'>('bottom');\n\n\tpublic readonly brnHoverCardTriggerFor = input<TemplateRef<unknown> | BrnHoverCardContent | undefined>(undefined);\n\tpublic readonly mutableBrnHoverCardTriggerFor = computed(() => signal(this.brnHoverCardTriggerFor()));\n\tprivate readonly _brnHoverCardTriggerForState = computed(() => this.mutableBrnHoverCardTriggerFor()());\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst value = this._brnHoverCardTriggerForState();\n\t\t\tuntracked(() => {\n\t\t\t\tif (value) {\n\t\t\t\t\tthis._contentService.setContent(value, this._vcr);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic ngOnInit() {\n\t\tthis._contentService.setConfig({ attachTo: this._el, align: this.align(), sideOffset: this.sideOffset() });\n\t\tthis.showing$.subscribe((isHovered) => {\n\t\t\tif (isHovered) {\n\t\t\t\tthis._contentService.show();\n\t\t\t} else {\n\t\t\t\tthis._contentService.hide();\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic ngOnDestroy() {\n\t\tthis._destroy$.next();\n\t\tthis._destroy$.complete();\n\t}\n}\n","import { type AfterContentInit, ChangeDetectionStrategy, Component, contentChild } from '@angular/core';\nimport { BrnHoverCardContent, BrnHoverCardContentService, BrnHoverCardTrigger } from './brn-hover-card-content.service';\n\n@Component({\n\tselector: 'brn-hover-card',\n\tproviders: [BrnHoverCardContentService],\n\ttemplate: `\n\t\t<ng-content />\n\t`,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BrnHoverCard implements AfterContentInit {\n\tprivate readonly _trigger = contentChild(BrnHoverCardTrigger);\n\tprivate readonly _content = contentChild(BrnHoverCardContent);\n\n\tpublic ngAfterContentInit() {\n\t\tif (!this._trigger() || !this._content()) return;\n\t\tthis._trigger()?.mutableBrnHoverCardTriggerFor().set(this._content());\n\t}\n}\n","import { BrnHoverCard } from './lib/brn-hover-card';\nimport { BrnHoverCardContent, BrnHoverCardTrigger } from './lib/brn-hover-card-content.service';\n\nexport * from './lib/brn-hover-card';\nexport * from './lib/brn-hover-card-content.service';\nexport * from './lib/createHoverObservable';\n\nexport const BrnHoverCardImports = [BrnHoverCard, BrnHoverCardContent, BrnHoverCardTrigger] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAKA,SAAS,QAAQ,CAAC,EAAE,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AA;;2FAGW,YAAY,EAAA,UAAA,EAAA,CAAA;kBARxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,gBAAgB;oBAC1B,SAAS,EAAE,CAAC,0BAA0B,CAAC;AACvC,oBAAA,QAAQ,EAAE;;AAET,CAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,iBAAA;;;ACHM,MAAM,mBAAmB,GAAG,CAAC,YAAY,EAAE,mBAAmB,EAAE,mBAAmB;;ACP1F;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"spartan-ng-brain-hover-card.mjs","sources":["../../../../libs/brain/hover-card/src/lib/brn-hover-card-content.service.ts","../../../../libs/brain/hover-card/src/lib/brn-hover-card.ts","../../../../libs/brain/hover-card/src/index.ts","../../../../libs/brain/hover-card/src/spartan-ng-brain-hover-card.ts"],"sourcesContent":["import { FocusMonitor } from '@angular/cdk/a11y';\nimport {\n\ttype ConnectedOverlayPositionChange,\n\ttype ConnectedPosition,\n\ttype FlexibleConnectedPositionStrategy,\n\tOverlay,\n\ttype OverlayConfig,\n\tOverlayPositionBuilder,\n\ttype OverlayRef,\n} from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n\tcomputed,\n\tDirective,\n\teffect,\n\tElementRef,\n\tinject,\n\tInjectable,\n\tinput,\n\tNgZone,\n\ttype OnDestroy,\n\ttype OnInit,\n\ttype Signal,\n\tsignal,\n\tTemplateRef,\n\tuntracked,\n\tViewContainerRef,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport {\n\tcreateHoverObservable,\n\ttype ExposesSide,\n\ttype ExposesState,\n\tprovideExposedSideProviderExisting,\n\tprovideExposesStateProviderExisting,\n} from '@spartan-ng/brain/core';\nimport { BehaviorSubject, fromEvent, merge, type Observable, of, Subject } from 'rxjs';\nimport { delay, distinctUntilChanged, filter, map, share, switchMap, takeUntil, tap } from 'rxjs/operators';\n\n@Directive({\n\tselector: '[brnHoverCardContent]',\n\texportAs: 'brnHoverCardContent',\n\tproviders: [\n\t\tprovideExposedSideProviderExisting(() => BrnHoverCardContent),\n\t\tprovideExposesStateProviderExisting(() => BrnHoverCardContent),\n\t],\n})\nexport class BrnHoverCardContent implements ExposesState, ExposesSide {\n\tprivate readonly _contentService = inject(BrnHoverCardContentService);\n\tpublic readonly state = this._contentService.state;\n\tpublic readonly side = this._contentService.side;\n\tpublic readonly template = inject(TemplateRef);\n}\n\n/**\n * We are building on shoulders of giants here and use the implementation provided by the incredible TaigaUI\n * team: https://github.com/taiga-family/taiga-ui/blob/main/projects/core/directives/dropdown/dropdown-hover.directive.ts\n * Check them out! Give them a try! Leave a star! Their work is incredible!\n */\n\nexport type BrnHoverCardOptions = Partial<\n\t{\n\t\tattachTo: ElementRef;\n\t\tattachPositions: ConnectedPosition[];\n\t\talign: 'top' | 'bottom';\n\t\tsideOffset: number;\n\t} & OverlayConfig\n>;\n\nconst topFirstPositions: ConnectedPosition[] = [\n\t{\n\t\toriginX: 'center',\n\t\toriginY: 'top',\n\t\toverlayX: 'center',\n\t\toverlayY: 'bottom',\n\t},\n\t{\n\t\toriginX: 'center',\n\t\toriginY: 'bottom',\n\t\toverlayX: 'center',\n\t\toverlayY: 'top',\n\t},\n];\nconst bottomFirstPositions: ConnectedPosition[] = [\n\t{\n\t\toriginX: 'center',\n\t\toriginY: 'bottom',\n\t\toverlayX: 'center',\n\t\toverlayY: 'top',\n\t},\n\t{\n\t\toriginX: 'center',\n\t\toriginY: 'top',\n\t\toverlayX: 'center',\n\t\toverlayY: 'bottom',\n\t},\n];\n\n@Injectable()\nexport class BrnHoverCardContentService {\n\tprivate readonly _overlay = inject(Overlay);\n\tprivate readonly _zone = inject(NgZone);\n\tprivate readonly _psBuilder = inject(OverlayPositionBuilder);\n\n\tprivate readonly _content = signal<TemplatePortal<unknown> | null>(null);\n\tprivate readonly _state = signal<'open' | 'closed'>('closed');\n\n\tprivate _config: BrnHoverCardOptions = {};\n\tprivate _overlayRef?: OverlayRef;\n\tprivate _positionStrategy?: FlexibleConnectedPositionStrategy;\n\tprivate _destroyed$ = new Subject<void>();\n\n\tprivate readonly _positionChangesObservables$ = new BehaviorSubject<\n\t\tObservable<ConnectedOverlayPositionChange> | undefined\n\t>(undefined);\n\tprivate readonly _overlayHoveredObservables$ = new BehaviorSubject<Observable<boolean> | undefined>(undefined);\n\n\tpublic readonly positionChanges$: Observable<ConnectedOverlayPositionChange> = this._positionChangesObservables$.pipe(\n\t\tswitchMap((positionChangeObservable) => (positionChangeObservable ? positionChangeObservable : of(undefined))),\n\t\tfilter((change): change is NonNullable<ConnectedOverlayPositionChange> => change !== undefined && change !== null),\n\t);\n\tpublic readonly hovered$: Observable<boolean> = this._overlayHoveredObservables$.pipe(\n\t\tswitchMap((overlayHoveredObservable) => (overlayHoveredObservable ? overlayHoveredObservable : of(false))),\n\t);\n\n\tpublic readonly state = this._state.asReadonly();\n\tpublic readonly side: Signal<'top' | 'bottom' | 'left' | 'right'> = toSignal(\n\t\tthis.positionChanges$.pipe(\n\t\t\tmap<ConnectedOverlayPositionChange, 'top' | 'bottom' | 'left' | 'right'>((change) =>\n\t\t\t\t// todo: better translation or adjusting hlm to take that into account\n\t\t\t\tchange.connectionPair.originY === 'center'\n\t\t\t\t\t? change.connectionPair.originX === 'start'\n\t\t\t\t\t\t? 'left'\n\t\t\t\t\t\t: 'right'\n\t\t\t\t\t: change.connectionPair.originY,\n\t\t\t),\n\t\t),\n\t\t{ initialValue: 'bottom' },\n\t);\n\n\tpublic setConfig(config: BrnHoverCardOptions) {\n\t\tthis._config = config;\n\t\tif (config.attachTo) {\n\t\t\tthis._positionStrategy = this._psBuilder\n\t\t\t\t.flexibleConnectedTo(config.attachTo)\n\t\t\t\t.withPositions(config.attachPositions ?? (config.align === 'top' ? topFirstPositions : bottomFirstPositions))\n\t\t\t\t.withDefaultOffsetY(config.sideOffset ?? 0);\n\t\t\tthis._config = {\n\t\t\t\t...this._config,\n\t\t\t\tpositionStrategy: this._positionStrategy,\n\t\t\t\tscrollStrategy: this._overlay.scrollStrategies.reposition(),\n\t\t\t};\n\t\t\tthis._positionChangesObservables$.next(this._positionStrategy.positionChanges);\n\t\t}\n\t\tthis._overlayRef = this._overlay.create(this._config);\n\t}\n\n\tpublic setContent(value: TemplateRef<unknown> | BrnHoverCardContent, vcr: ViewContainerRef) {\n\t\tthis._content.set(new TemplatePortal<unknown>(value instanceof TemplateRef ? value : value.template, vcr));\n\n\t\tif (!this._overlayRef) {\n\t\t\tthis._overlayRef = this._overlay.create(this._config);\n\t\t}\n\t}\n\n\tpublic setState(newState: 'open' | 'closed') {\n\t\tthis._state.set(newState);\n\t}\n\n\tpublic show() {\n\t\tconst content = this._content();\n\t\tif (!content || !this._overlayRef) return;\n\n\t\tthis._overlayRef?.detach();\n\t\tthis._overlayRef?.attach(content);\n\n\t\tthis._destroyed$ = new Subject<void>();\n\n\t\tthis._overlayHoveredObservables$.next(\n\t\t\tcreateHoverObservable(this._overlayRef.hostElement, this._zone, this._destroyed$).pipe(map((e) => e.hover)),\n\t\t);\n\t}\n\n\tpublic hide() {\n\t\tthis._overlayRef?.detach();\n\t\tthis._destroyed$.next();\n\t\tthis._destroyed$.complete();\n\t\tthis._destroyed$ = new Subject<void>();\n\t}\n}\n\n@Directive({\n\tselector: '[brnHoverCardTrigger]:not(ng-container),[brnHoverCardTriggerFor]:not(ng-container)',\n\texportAs: 'brnHoverCardTrigger',\n})\nexport class BrnHoverCardTrigger implements OnInit, OnDestroy {\n\tprivate readonly _destroy$ = new Subject<void>();\n\tprivate readonly _vcr = inject(ViewContainerRef);\n\tprivate readonly _zone = inject(NgZone);\n\tprivate readonly _el = inject(ElementRef);\n\tprivate readonly _contentService = inject(BrnHoverCardContentService);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\n\tpublic readonly focused$: Observable<boolean> = this._focusMonitor.monitor(this._el).pipe(map((e) => e !== null));\n\n\tpublic readonly hovered$: Observable<boolean> = merge(\n\t\tfromEvent(this._el.nativeElement, 'click').pipe(map(() => false)),\n\t\tcreateHoverObservable(this._el.nativeElement, this._zone, this._destroy$).pipe(map((e) => e.hover)),\n\t\tthis._contentService.hovered$,\n\t\tthis.focused$,\n\t).pipe(distinctUntilChanged());\n\tpublic readonly showing$: Observable<boolean> = this.hovered$.pipe(\n\t\t// we set the state to open here because we are about to open show the content\n\t\ttap((visible) => visible && this._contentService.setState('open')),\n\t\tswitchMap((visible) => {\n\t\t\t// we are delaying based on the configure-able input\n\t\t\treturn of(visible).pipe(delay(visible ? this.showDelay() : this.hideDelay()));\n\t\t}),\n\t\tswitchMap((visible) => {\n\t\t\t// don't do anything when we are in the process of showing the content\n\t\t\tif (visible) return of(visible);\n\t\t\t// we set the state to closed here to trigger any animations for the element leaving\n\t\t\tthis._contentService.setState('closed');\n\t\t\t// then delay to wait for the leaving animation to finish\n\t\t\treturn of(visible).pipe(delay(this.animationDelay()));\n\t\t}),\n\t\tdistinctUntilChanged(),\n\t\tshare(),\n\t\ttakeUntil(this._destroy$),\n\t);\n\n\tpublic readonly showDelay = input(300);\n\tpublic readonly hideDelay = input(500);\n\tpublic readonly animationDelay = input(100);\n\tpublic readonly sideOffset = input(5);\n\tpublic readonly align = input<'top' | 'bottom'>('bottom');\n\n\tpublic readonly brnHoverCardTriggerFor = input<TemplateRef<unknown> | BrnHoverCardContent | undefined>(undefined);\n\tpublic readonly mutableBrnHoverCardTriggerFor = computed(() => signal(this.brnHoverCardTriggerFor()));\n\tprivate readonly _brnHoverCardTriggerForState = computed(() => this.mutableBrnHoverCardTriggerFor()());\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst value = this._brnHoverCardTriggerForState();\n\t\t\tuntracked(() => {\n\t\t\t\tif (value) {\n\t\t\t\t\tthis._contentService.setContent(value, this._vcr);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic ngOnInit() {\n\t\tthis._contentService.setConfig({ attachTo: this._el, align: this.align(), sideOffset: this.sideOffset() });\n\t\tthis.showing$.subscribe((isHovered) => {\n\t\t\tif (isHovered) {\n\t\t\t\tthis._contentService.show();\n\t\t\t} else {\n\t\t\t\tthis._contentService.hide();\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic ngOnDestroy() {\n\t\tthis._destroy$.next();\n\t\tthis._destroy$.complete();\n\t}\n}\n","import { type AfterContentInit, ChangeDetectionStrategy, Component, contentChild } from '@angular/core';\nimport { BrnHoverCardContent, BrnHoverCardContentService, BrnHoverCardTrigger } from './brn-hover-card-content.service';\n\n@Component({\n\tselector: 'brn-hover-card',\n\tproviders: [BrnHoverCardContentService],\n\ttemplate: `\n\t\t<ng-content />\n\t`,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BrnHoverCard implements AfterContentInit {\n\tprivate readonly _trigger = contentChild(BrnHoverCardTrigger);\n\tprivate readonly _content = contentChild(BrnHoverCardContent);\n\n\tpublic ngAfterContentInit() {\n\t\tif (!this._trigger() || !this._content()) return;\n\t\tthis._trigger()?.mutableBrnHoverCardTriggerFor().set(this._content());\n\t}\n}\n","import { BrnHoverCard } from './lib/brn-hover-card';\nimport { BrnHoverCardContent, BrnHoverCardTrigger } from './lib/brn-hover-card-content.service';\n\nexport * from './lib/brn-hover-card';\nexport * from './lib/brn-hover-card-content.service';\n\nexport const BrnHoverCardImports = [BrnHoverCard, BrnHoverCardContent, BrnHoverCardTrigger] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MA+Ca,mBAAmB,CAAA;AACd,IAAA,eAAe,GAAG,MAAM,CAAC,0BAA0B,CAAC;AACrD,IAAA,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK;AAClC,IAAA,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI;AAChC,IAAA,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC;0HAJlC,mBAAmB,EAAA,IAAA,EAAA,EAAA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