@ng-doc/ui-kit 22.0.0-beta.1 → 22.0.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/README.md +20 -29
- package/fesm2022/ng-doc-ui-kit-cdk-combobox-host.mjs +43 -22
- package/fesm2022/ng-doc-ui-kit-cdk-combobox-host.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-classes-base-input.mjs +24 -13
- package/fesm2022/ng-doc-ui-kit-classes-base-input.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-classes-overlay-ref.mjs +62 -22
- package/fesm2022/ng-doc-ui-kit-classes-overlay-ref.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-blockquote.mjs +39 -14
- package/fesm2022/ng-doc-ui-kit-components-blockquote.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-button-icon.mjs +30 -18
- package/fesm2022/ng-doc-ui-kit-components-button-icon.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-button-toggle.mjs +12 -9
- package/fesm2022/ng-doc-ui-kit-components-button-toggle.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-button.mjs +15 -24
- package/fesm2022/ng-doc-ui-kit-components-button.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-checkbox.mjs +13 -13
- package/fesm2022/ng-doc-ui-kit-components-checkbox.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-clear-control.mjs +14 -9
- package/fesm2022/ng-doc-ui-kit-components-clear-control.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-combobox.mjs +30 -26
- package/fesm2022/ng-doc-ui-kit-components-combobox.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-data-list-group.mjs +37 -38
- package/fesm2022/ng-doc-ui-kit-components-data-list-group.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-data-list.mjs +32 -39
- package/fesm2022/ng-doc-ui-kit-components-data-list.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-dialog-outlet.mjs +23 -20
- package/fesm2022/ng-doc-ui-kit-components-dialog-outlet.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-dot.mjs +20 -16
- package/fesm2022/ng-doc-ui-kit-components-dot.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-dropdown.mjs +120 -125
- package/fesm2022/ng-doc-ui-kit-components-dropdown.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-expander.mjs +17 -17
- package/fesm2022/ng-doc-ui-kit-components-expander.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-floated-border.mjs +4 -4
- package/fesm2022/ng-doc-ui-kit-components-floated-border.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-floated-content.mjs +16 -17
- package/fesm2022/ng-doc-ui-kit-components-floated-content.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-focus-control.mjs +20 -12
- package/fesm2022/ng-doc-ui-kit-components-focus-control.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-icon.mjs +175 -54
- package/fesm2022/ng-doc-ui-kit-components-icon.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-input-wrapper.mjs +43 -46
- package/fesm2022/ng-doc-ui-kit-components-input-wrapper.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-label.mjs +14 -16
- package/fesm2022/ng-doc-ui-kit-components-label.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-line.mjs +7 -4
- package/fesm2022/ng-doc-ui-kit-components-line.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-list.mjs +24 -8
- package/fesm2022/ng-doc-ui-kit-components-list.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-magnifier-controller.mjs +9 -4
- package/fesm2022/ng-doc-ui-kit-components-magnifier-controller.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-magnifier.mjs +39 -18
- package/fesm2022/ng-doc-ui-kit-components-magnifier.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-option-group.mjs +22 -27
- package/fesm2022/ng-doc-ui-kit-components-option-group.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-option.mjs +28 -22
- package/fesm2022/ng-doc-ui-kit-components-option.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-overlay-container.mjs +56 -52
- package/fesm2022/ng-doc-ui-kit-components-overlay-container.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-overlay-pointer.mjs +19 -21
- package/fesm2022/ng-doc-ui-kit-components-overlay-pointer.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-pane.mjs +91 -69
- package/fesm2022/ng-doc-ui-kit-components-pane.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-selection.mjs +173 -76
- package/fesm2022/ng-doc-ui-kit-components-selection.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-sidenav.mjs +23 -22
- package/fesm2022/ng-doc-ui-kit-components-sidenav.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-spinner.mjs +14 -12
- package/fesm2022/ng-doc-ui-kit-components-spinner.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-tab-group.mjs +86 -61
- package/fesm2022/ng-doc-ui-kit-components-tab-group.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-tab-routes-group.mjs +16 -13
- package/fesm2022/ng-doc-ui-kit-components-tab-routes-group.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-tag.mjs +23 -24
- package/fesm2022/ng-doc-ui-kit-components-tag.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-text.mjs +37 -52
- package/fesm2022/ng-doc-ui-kit-components-text.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-toggle.mjs +82 -57
- package/fesm2022/ng-doc-ui-kit-components-toggle.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-wrapper.mjs +7 -4
- package/fesm2022/ng-doc-ui-kit-components-wrapper.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-autofocus.mjs +13 -10
- package/fesm2022/ng-doc-ui-kit-directives-autofocus.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-checked-change.mjs +30 -26
- package/fesm2022/ng-doc-ui-kit-directives-checked-change.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-data.mjs +8 -5
- package/fesm2022/ng-doc-ui-kit-directives-data.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-dropdown-handler.mjs +19 -18
- package/fesm2022/ng-doc-ui-kit-directives-dropdown-handler.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-dropdown-origin.mjs +7 -9
- package/fesm2022/ng-doc-ui-kit-directives-dropdown-origin.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-event-switcher.mjs +22 -19
- package/fesm2022/ng-doc-ui-kit-directives-event-switcher.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-focus-catcher.mjs +30 -25
- package/fesm2022/ng-doc-ui-kit-directives-focus-catcher.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-focusable.mjs +13 -16
- package/fesm2022/ng-doc-ui-kit-directives-focusable.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-fullscreen.mjs +90 -0
- package/fesm2022/ng-doc-ui-kit-directives-fullscreen.mjs.map +1 -0
- package/fesm2022/ng-doc-ui-kit-directives-hotkey.mjs +34 -28
- package/fesm2022/ng-doc-ui-kit-directives-hotkey.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-input-number.mjs +10 -12
- package/fesm2022/ng-doc-ui-kit-directives-input-number.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-input-string.mjs +9 -12
- package/fesm2022/ng-doc-ui-kit-directives-input-string.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-radio-group.mjs +7 -4
- package/fesm2022/ng-doc-ui-kit-directives-radio-group.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-rotator.mjs +16 -22
- package/fesm2022/ng-doc-ui-kit-directives-rotator.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-tooltip.mjs +105 -101
- package/fesm2022/ng-doc-ui-kit-directives-tooltip.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives.mjs +1 -1
- package/fesm2022/ng-doc-ui-kit-interceptors.mjs +24 -21
- package/fesm2022/ng-doc-ui-kit-interceptors.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-observables.mjs +2 -58
- package/fesm2022/ng-doc-ui-kit-observables.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-pipes-as-array.mjs +3 -4
- package/fesm2022/ng-doc-ui-kit-pipes-as-array.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-pipes-bind.mjs +3 -4
- package/fesm2022/ng-doc-ui-kit-pipes-bind.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-pipes-execute.mjs +3 -4
- package/fesm2022/ng-doc-ui-kit-pipes-execute.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-pipes-highlighter.mjs +3 -4
- package/fesm2022/ng-doc-ui-kit-pipes-highlighter.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-services-dialog.mjs +14 -8
- package/fesm2022/ng-doc-ui-kit-services-dialog.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-services-notify.mjs +13 -8
- package/fesm2022/ng-doc-ui-kit-services-notify.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-services-overlay-strategy.mjs +15 -11
- package/fesm2022/ng-doc-ui-kit-services-overlay-strategy.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-services-overlay.mjs +20 -9
- package/fesm2022/ng-doc-ui-kit-services-overlay.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-services-scroll.mjs +11 -13
- package/fesm2022/ng-doc-ui-kit-services-scroll.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-tokens.mjs +29 -3
- package/fesm2022/ng-doc-ui-kit-tokens.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-types.mjs +0 -1
- package/fesm2022/ng-doc-ui-kit-types.mjs.map +1 -1
- package/package.json +31 -33
- package/styles/main.css +275 -38
- package/types/ng-doc-ui-kit-cdk-combobox-host.d.ts +16 -8
- package/types/ng-doc-ui-kit-classes-base-input.d.ts +12 -1
- package/types/ng-doc-ui-kit-classes-overlay-ref.d.ts +27 -4
- package/types/ng-doc-ui-kit-components-blockquote.d.ts +22 -5
- package/types/ng-doc-ui-kit-components-button-icon.d.ts +23 -5
- package/types/ng-doc-ui-kit-components-button-toggle.d.ts +5 -1
- package/types/ng-doc-ui-kit-components-button.d.ts +6 -6
- package/types/ng-doc-ui-kit-components-checkbox.d.ts +5 -3
- package/types/ng-doc-ui-kit-components-clear-control.d.ts +7 -0
- package/types/ng-doc-ui-kit-components-combobox.d.ts +19 -9
- package/types/ng-doc-ui-kit-components-data-list-group.d.ts +16 -11
- package/types/ng-doc-ui-kit-components-data-list.d.ts +21 -11
- package/types/ng-doc-ui-kit-components-dialog-outlet.d.ts +11 -6
- package/types/ng-doc-ui-kit-components-dot.d.ts +10 -5
- package/types/ng-doc-ui-kit-components-dropdown.d.ts +39 -27
- package/types/ng-doc-ui-kit-components-expander.d.ts +9 -7
- package/types/ng-doc-ui-kit-components-floated-content.d.ts +8 -6
- package/types/ng-doc-ui-kit-components-focus-control.d.ts +10 -4
- package/types/ng-doc-ui-kit-components-icon.d.ts +49 -14
- package/types/ng-doc-ui-kit-components-input-wrapper.d.ts +31 -17
- package/types/ng-doc-ui-kit-components-label.d.ts +8 -5
- package/types/ng-doc-ui-kit-components-line.d.ts +3 -0
- package/types/ng-doc-ui-kit-components-list.d.ts +14 -3
- package/types/ng-doc-ui-kit-components-magnifier-controller.d.ts +5 -1
- package/types/ng-doc-ui-kit-components-magnifier.d.ts +19 -4
- package/types/ng-doc-ui-kit-components-option-group.d.ts +12 -8
- package/types/ng-doc-ui-kit-components-option.d.ts +9 -2
- package/types/ng-doc-ui-kit-components-overlay-container.d.ts +18 -15
- package/types/ng-doc-ui-kit-components-overlay-pointer.d.ts +10 -6
- package/types/ng-doc-ui-kit-components-pane.d.ts +25 -9
- package/types/ng-doc-ui-kit-components-selection.d.ts +59 -21
- package/types/ng-doc-ui-kit-components-sidenav.d.ts +17 -8
- package/types/ng-doc-ui-kit-components-spinner.d.ts +7 -3
- package/types/ng-doc-ui-kit-components-tab-group.d.ts +43 -22
- package/types/ng-doc-ui-kit-components-tab-routes-group.d.ts +4 -2
- package/types/ng-doc-ui-kit-components-tag.d.ts +13 -6
- package/types/ng-doc-ui-kit-components-text.d.ts +21 -19
- package/types/ng-doc-ui-kit-components-toggle.d.ts +13 -7
- package/types/ng-doc-ui-kit-components-wrapper.d.ts +3 -0
- package/types/ng-doc-ui-kit-directives-autofocus.d.ts +7 -5
- package/types/ng-doc-ui-kit-directives-checked-change.d.ts +15 -11
- package/types/ng-doc-ui-kit-directives-data.d.ts +6 -4
- package/types/ng-doc-ui-kit-directives-dropdown-handler.d.ts +5 -3
- package/types/ng-doc-ui-kit-directives-dropdown-origin.d.ts +0 -2
- package/types/ng-doc-ui-kit-directives-event-switcher.d.ts +11 -6
- package/types/ng-doc-ui-kit-directives-focus-catcher.d.ts +11 -8
- package/types/ng-doc-ui-kit-directives-focusable.d.ts +6 -3
- package/types/ng-doc-ui-kit-directives-fullscreen.d.ts +39 -0
- package/types/ng-doc-ui-kit-directives-hotkey.d.ts +14 -7
- package/types/ng-doc-ui-kit-directives-input-number.d.ts +3 -2
- package/types/ng-doc-ui-kit-directives-input-string.d.ts +2 -2
- package/types/ng-doc-ui-kit-directives-radio-group.d.ts +4 -0
- package/types/ng-doc-ui-kit-directives-rotator.d.ts +8 -8
- package/types/ng-doc-ui-kit-directives-tooltip.d.ts +35 -23
- package/types/ng-doc-ui-kit-directives.d.ts +1 -1
- package/types/ng-doc-ui-kit-interceptors.d.ts +18 -2
- package/types/ng-doc-ui-kit-interfaces.d.ts +20 -4
- package/types/ng-doc-ui-kit-observables.d.ts +2 -19
- package/types/ng-doc-ui-kit-services-dialog.d.ts +10 -1
- package/types/ng-doc-ui-kit-services-notify.d.ts +9 -1
- package/types/ng-doc-ui-kit-services-overlay-strategy.d.ts +5 -3
- package/types/ng-doc-ui-kit-services-overlay.d.ts +14 -3
- package/types/ng-doc-ui-kit-services-scroll.d.ts +4 -5
- package/types/ng-doc-ui-kit-types.d.ts +2 -2
- package/fesm2022/ng-doc-ui-kit-decorators.mjs +0 -53
- package/fesm2022/ng-doc-ui-kit-decorators.mjs.map +0 -1
- package/fesm2022/ng-doc-ui-kit-directives-let.mjs +0 -43
- package/fesm2022/ng-doc-ui-kit-directives-let.mjs.map +0 -1
- package/types/ng-doc-ui-kit-decorators.d.ts +0 -12
- package/types/ng-doc-ui-kit-directives-let.d.ts +0 -22
|
@@ -1,39 +1,47 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, inject, DOCUMENT, ElementRef,
|
|
2
|
+
import { signal, computed, inject, DOCUMENT, ElementRef, DestroyRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { fromEvent } from 'rxjs';
|
|
5
5
|
import { switchMap, filter, takeUntil, tap } from 'rxjs/operators';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @param event
|
|
8
|
+
* Narrows an event to a mouse event.
|
|
9
|
+
* @param event - The event to check.
|
|
10
10
|
*/
|
|
11
11
|
function isMouseEvent(event) {
|
|
12
12
|
return event instanceof MouseEvent;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @param event
|
|
15
|
+
* Narrows an event to a wheel event.
|
|
16
|
+
* @param event - The event to check.
|
|
17
17
|
*/
|
|
18
18
|
function isWheelEvent(event) {
|
|
19
19
|
return event instanceof WheelEvent;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Lets the user pan its content by dragging and zoom it with the mouse wheel. Use
|
|
23
|
+
* `ng-doc-magnifier-controller` for buttons that do the same.
|
|
24
|
+
*/
|
|
21
25
|
class NgDocMagnifierComponent {
|
|
22
26
|
constructor() {
|
|
23
|
-
this.x = signal(0,
|
|
24
|
-
|
|
25
|
-
this.
|
|
26
|
-
|
|
27
|
-
this.
|
|
28
|
-
|
|
29
|
-
this.ngZone = inject(NgZone);
|
|
30
|
-
this.destroyRef = inject(DestroyRef);
|
|
27
|
+
this.x = signal(0, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "x" }] : /* istanbul ignore next */ []));
|
|
29
|
+
this.y = signal(0, /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "y" }] : /* istanbul ignore next */ []));
|
|
31
|
+
this.scale = signal(1, /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []));
|
|
31
33
|
this.transform = computed(() => {
|
|
32
34
|
const scale = this.scale();
|
|
33
35
|
const x = this.x();
|
|
34
36
|
const y = this.y();
|
|
35
37
|
return `matrix(${scale}, 0, 0, ${scale}, ${x * scale}, ${y * scale})`;
|
|
36
|
-
},
|
|
38
|
+
}, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "transform" }] : /* istanbul ignore next */ []));
|
|
40
|
+
this.drag = signal(false, /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "drag" }] : /* istanbul ignore next */ []));
|
|
42
|
+
this.document = inject(DOCUMENT);
|
|
43
|
+
this.element = inject(ElementRef).nativeElement;
|
|
44
|
+
this.destroyRef = inject(DestroyRef);
|
|
37
45
|
}
|
|
38
46
|
ngOnInit() {
|
|
39
47
|
fromEvent(this.element, 'mousedown')
|
|
@@ -53,29 +61,42 @@ class NgDocMagnifierComponent {
|
|
|
53
61
|
this.scale.update((scale) => Math.max(scale * (1 + event.deltaY / 1000), 1));
|
|
54
62
|
});
|
|
55
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Moves the content horizontally.
|
|
66
|
+
* @param x - Distance in screen pixels.
|
|
67
|
+
*/
|
|
56
68
|
incrementX(x) {
|
|
57
69
|
this.x.update((current) => current + x / this.scale());
|
|
58
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Moves the content vertically.
|
|
73
|
+
* @param y - Distance in screen pixels.
|
|
74
|
+
*/
|
|
59
75
|
incrementY(y) {
|
|
60
76
|
this.y.update((current) => current + y / this.scale());
|
|
61
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Zooms in (positive `diff`) or out (negative `diff`); the scale never goes below 1.
|
|
80
|
+
* @param diff - Zoom step, where 1000 doubles the scale.
|
|
81
|
+
*/
|
|
62
82
|
zoom(diff) {
|
|
63
83
|
this.scale.update((scale) => Math.max(scale * (1 + diff / 1000), 1));
|
|
64
84
|
}
|
|
85
|
+
/** Resets the position and the scale. */
|
|
65
86
|
reset() {
|
|
66
87
|
this.x.set(0);
|
|
67
88
|
this.y.set(0);
|
|
68
89
|
this.scale.set(1);
|
|
69
90
|
}
|
|
70
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
71
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
91
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocMagnifierComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
92
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.2.1", type: NgDocMagnifierComponent, isStandalone: true, selector: "ng-doc-magnifier", host: { properties: { "attr.data-drag": "drag()" } }, ngImport: i0, template: "<div class=\"ng-doc-magnifier-container\" [style.transform]=\"transform()\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:block;overflow:hidden;cursor:default}:host[data-drag=true]{cursor:move}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
72
93
|
}
|
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocMagnifierComponent, decorators: [{
|
|
74
95
|
type: Component,
|
|
75
96
|
args: [{ selector: 'ng-doc-magnifier', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
76
97
|
'[attr.data-drag]': 'drag()',
|
|
77
98
|
}, template: "<div class=\"ng-doc-magnifier-container\" [style.transform]=\"transform()\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:block;overflow:hidden;cursor:default}:host[data-drag=true]{cursor:move}\n"] }]
|
|
78
|
-
}]
|
|
99
|
+
}] });
|
|
79
100
|
|
|
80
101
|
/**
|
|
81
102
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit-components-magnifier.mjs","sources":["../../../../libs/ui-kit/components/magnifier/magnifier.component.ts","../../../../libs/ui-kit/components/magnifier/magnifier.component.html","../../../../libs/ui-kit/components/magnifier/ng-doc-ui-kit-components-magnifier.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n DOCUMENT,\n ElementRef,\n inject,\n
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit-components-magnifier.mjs","sources":["../../../../libs/ui-kit/components/magnifier/magnifier.component.ts","../../../../libs/ui-kit/components/magnifier/magnifier.component.html","../../../../libs/ui-kit/components/magnifier/ng-doc-ui-kit-components-magnifier.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n DOCUMENT,\n ElementRef,\n inject,\n OnInit,\n Signal,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent } from 'rxjs';\nimport { filter, switchMap, takeUntil, tap } from 'rxjs/operators';\n\n/**\n * Narrows an event to a mouse event.\n * @param event - The event to check.\n */\nfunction isMouseEvent(event: Event): event is MouseEvent {\n return event instanceof MouseEvent;\n}\n\n/**\n * Narrows an event to a wheel event.\n * @param event - The event to check.\n */\nfunction isWheelEvent(event: Event): event is WheelEvent {\n return event instanceof WheelEvent;\n}\n\n/**\n * Lets the user pan its content by dragging and zoom it with the mouse wheel. Use\n * `ng-doc-magnifier-controller` for buttons that do the same.\n */\n@Component({\n selector: 'ng-doc-magnifier',\n imports: [],\n templateUrl: './magnifier.component.html',\n styleUrl: './magnifier.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-drag]': 'drag()',\n },\n})\nexport class NgDocMagnifierComponent implements OnInit {\n protected readonly x = signal<number>(0);\n protected readonly y = signal<number>(0);\n protected readonly scale = signal<number>(1);\n protected readonly transform: Signal<string> = computed(() => {\n const scale = this.scale();\n const x = this.x();\n const y = this.y();\n return `matrix(${scale}, 0, 0, ${scale}, ${x * scale}, ${y * scale})`;\n });\n protected readonly drag = signal<boolean>(false);\n\n protected readonly document = inject(DOCUMENT);\n protected readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n protected readonly destroyRef = inject(DestroyRef);\n\n ngOnInit(): void {\n fromEvent(this.element, 'mousedown')\n .pipe(\n switchMap((event: Event) => {\n event.preventDefault();\n this.drag.set(true);\n\n return fromEvent(this.document, 'mousemove').pipe(\n filter(isMouseEvent),\n takeUntil(fromEvent(this.document, 'mouseup')),\n tap({ complete: () => this.drag.set(false) }),\n );\n }),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe((event: MouseEvent) => {\n this.x.update((x) => x + event.movementX / this.scale());\n this.y.update((y) => y + event.movementY / this.scale());\n });\n\n fromEvent(this.element, 'wheel')\n .pipe(filter(isWheelEvent), takeUntilDestroyed(this.destroyRef))\n .subscribe((event: WheelEvent) => {\n event.preventDefault();\n\n this.scale.update((scale) => Math.max(scale * (1 + event.deltaY / 1000), 1));\n });\n }\n\n /**\n * Moves the content horizontally.\n * @param x - Distance in screen pixels.\n */\n incrementX(x: number): void {\n this.x.update((current) => current + x / this.scale());\n }\n\n /**\n * Moves the content vertically.\n * @param y - Distance in screen pixels.\n */\n incrementY(y: number): void {\n this.y.update((current) => current + y / this.scale());\n }\n\n /**\n * Zooms in (positive `diff`) or out (negative `diff`); the scale never goes below 1.\n * @param diff - Zoom step, where 1000 doubles the scale.\n */\n zoom(diff: number): void {\n this.scale.update((scale) => Math.max(scale * (1 + diff / 1000), 1));\n }\n\n /** Resets the position and the scale. */\n reset(): void {\n this.x.set(0);\n this.y.set(0);\n this.scale.set(1);\n }\n}\n","<div class=\"ng-doc-magnifier-container\" [style.transform]=\"transform()\">\n <ng-content></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
|
@@ -1,46 +1,41 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive,
|
|
3
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
2
|
+
import { Directive, contentChildren, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
3
|
import { NgDocOptionComponent } from '@ng-doc/ui-kit/components/option';
|
|
5
4
|
import { NgDocTextComponent } from '@ng-doc/ui-kit/components/text';
|
|
6
|
-
import { startWith } from 'rxjs/operators';
|
|
7
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Marks the header content of an option group.
|
|
8
|
+
*/
|
|
8
9
|
class NgDocOptionGroupHeaderDirective {
|
|
9
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
10
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
10
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocOptionGroupHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
11
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.1", type: NgDocOptionGroupHeaderDirective, isStandalone: true, selector: "[ngDocOptionGroupHeader]", ngImport: i0 }); }
|
|
11
12
|
}
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocOptionGroupHeaderDirective, decorators: [{
|
|
13
14
|
type: Directive,
|
|
14
15
|
args: [{
|
|
15
16
|
selector: '[ngDocOptionGroupHeader]',
|
|
16
|
-
standalone: true,
|
|
17
17
|
}]
|
|
18
18
|
}] });
|
|
19
|
+
/**
|
|
20
|
+
* Group of options with a header. The header is hidden while the group has no options.
|
|
21
|
+
*/
|
|
19
22
|
class NgDocOptionGroupComponent {
|
|
20
23
|
constructor() {
|
|
21
|
-
|
|
22
|
-
this.options =
|
|
23
|
-
|
|
24
|
-
this.
|
|
25
|
-
|
|
26
|
-
ngAfterContentInit() {
|
|
27
|
-
this.options.changes
|
|
28
|
-
.pipe(startWith(this.options), takeUntilDestroyed(this.destroyRef))
|
|
29
|
-
.subscribe((options) => {
|
|
30
|
-
this.hasHeader = !!options.length;
|
|
31
|
-
this.changeDetectorRef.markForCheck();
|
|
32
|
-
});
|
|
24
|
+
/** Options of the group. */
|
|
25
|
+
this.options = contentChildren(NgDocOptionComponent, { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), descendants: true });
|
|
26
|
+
/** Whether the header is shown. */
|
|
27
|
+
this.hasHeader = computed(() => this.options().length > 0, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "hasHeader" }] : /* istanbul ignore next */ []));
|
|
33
29
|
}
|
|
34
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
35
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
30
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocOptionGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
31
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocOptionGroupComponent, isStandalone: true, selector: "ng-doc-option-group", queries: [{ propertyName: "options", predicate: NgDocOptionComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ng-doc-option-group-wrapper\">\n @if (hasHeader()) {\n <div class=\"ng-doc-option-group-header\" ng-doc-text>\n <ng-content select=\"[ngDocOptionGroupHeader]\"></ng-content>\n </div>\n }\n <div class=\"ng-doc-option-group\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{display:block}.ng-doc-option-group-header{position:sticky;top:0;display:flex;background-color:var(--ng-doc-base-1);padding:var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 2);z-index:1;--ng-doc-font-size: 13px;--ng-doc-font-weight: 700;--ng-doc-font-line-height: 18px;--ng-doc-text: var(--ng-doc-base-9)}.ng-doc-option-group ::ng-deep ng-doc-option .ng-doc-option-wrapper{padding-left:calc(var(--ng-doc-base-gutter) * 2)}\n"], dependencies: [{ kind: "component", type: NgDocTextComponent, selector: "[ng-doc-text]", inputs: ["size", "color", "align", "absoluteContent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
36
32
|
}
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocOptionGroupComponent, decorators: [{
|
|
38
34
|
type: Component,
|
|
39
|
-
args: [{ selector: 'ng-doc-option-group', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocTextComponent], template: "<div class=\"ng-doc-option-group-wrapper\">\n @if (hasHeader) {\n <div class=\"ng-doc-option-group-header\" ng-doc-text>\n <ng-content select=\"[ngDocOptionGroupHeader]\"></ng-content>\n </div>\n }\n <div class=\"ng-doc-option-group\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{display:block}.ng-doc-option-group-header{position:sticky;top:0;display:flex;background-color:var(--ng-doc-base-1);padding:var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 2);z-index:1;--ng-doc-font-size: 13px;--ng-doc-font-weight: 700;--ng-doc-font-line-height: 18px;--ng-doc-text: var(--ng-doc-base-9)}.ng-doc-option-group ::ng-deep ng-doc-option .ng-doc-option-wrapper{padding-left:calc(var(--ng-doc-base-gutter) * 2)}\n"] }]
|
|
40
|
-
}],
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}] } });
|
|
35
|
+
args: [{ selector: 'ng-doc-option-group', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocTextComponent], template: "<div class=\"ng-doc-option-group-wrapper\">\n @if (hasHeader()) {\n <div class=\"ng-doc-option-group-header\" ng-doc-text>\n <ng-content select=\"[ngDocOptionGroupHeader]\"></ng-content>\n </div>\n }\n <div class=\"ng-doc-option-group\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{display:block}.ng-doc-option-group-header{position:sticky;top:0;display:flex;background-color:var(--ng-doc-base-1);padding:var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 2);z-index:1;--ng-doc-font-size: 13px;--ng-doc-font-weight: 700;--ng-doc-font-line-height: 18px;--ng-doc-text: var(--ng-doc-base-9)}.ng-doc-option-group ::ng-deep ng-doc-option .ng-doc-option-wrapper{padding-left:calc(var(--ng-doc-base-gutter) * 2)}\n"] }]
|
|
36
|
+
}], propDecorators: { options: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => NgDocOptionComponent), { ...{
|
|
37
|
+
descendants: true,
|
|
38
|
+
}, isSignal: true }] }] } });
|
|
44
39
|
|
|
45
40
|
/**
|
|
46
41
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit-components-option-group.mjs","sources":["../../../../libs/ui-kit/components/option-group/option-group.component.ts","../../../../libs/ui-kit/components/option-group/option-group.component.html","../../../../libs/ui-kit/components/option-group/ng-doc-ui-kit-components-option-group.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit-components-option-group.mjs","sources":["../../../../libs/ui-kit/components/option-group/option-group.component.ts","../../../../libs/ui-kit/components/option-group/option-group.component.html","../../../../libs/ui-kit/components/option-group/ng-doc-ui-kit-components-option-group.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n Directive,\n Signal,\n} from '@angular/core';\nimport { NgDocOptionComponent } from '@ng-doc/ui-kit/components/option';\nimport { NgDocTextComponent } from '@ng-doc/ui-kit/components/text';\n\n/**\n * Marks the header content of an option group.\n */\n@Directive({\n selector: '[ngDocOptionGroupHeader]',\n})\nexport class NgDocOptionGroupHeaderDirective {}\n\n/**\n * Group of options with a header. The header is hidden while the group has no options.\n */\n@Component({\n selector: 'ng-doc-option-group',\n templateUrl: './option-group.component.html',\n styleUrls: ['./option-group.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgDocTextComponent],\n})\nexport class NgDocOptionGroupComponent<T> {\n /** Options of the group. */\n readonly options = contentChildren<NgDocOptionComponent<T>>(NgDocOptionComponent, {\n descendants: true,\n });\n\n /** Whether the header is shown. */\n readonly hasHeader: Signal<boolean> = computed(() => this.options().length > 0);\n}\n","<div class=\"ng-doc-option-group-wrapper\">\n @if (hasHeader()) {\n <div class=\"ng-doc-option-group-header\" ng-doc-text>\n <ng-content select=\"[ngDocOptionGroupHeader]\"></ng-content>\n </div>\n }\n <div class=\"ng-doc-option-group\">\n <ng-content></ng-content>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAWA;;AAEG;MAIU,+BAA+B,CAAA;8GAA/B,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA/B,+BAA+B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,0BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA/B,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAH3C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,0BAA0B;AACrC,iBAAA;;AAGD;;AAEG;MAQU,yBAAyB,CAAA;AAPtC,IAAA,WAAA,GAAA;;QASW,IAAA,CAAA,OAAO,GAAG,eAAe,CAA0B,oBAAoB,+EAC9E,WAAW,EAAE,IAAI,EAAA,CACjB;;AAGO,QAAA,IAAA,CAAA,SAAS,GAAoB,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,GAAG,CAAC;sFAAC;AAChF,IAAA;8GARY,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAzB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,CAAA,EAAA,YAAA,EAAA,SAAA,EAAA,SAAA,EAEwB,oBAAoB,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC/BlF,gTAUA,ifDiBY,kBAAkB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,OAAA,EAAA,iBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEjB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAPrC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,mBAGd,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,kBAAkB,CAAC,EAAA,QAAA,EAAA,gTAAA,EAAA,MAAA,EAAA,CAAA,ybAAA,CAAA,EAAA;AAI+B,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,oBAAoB,CAAA,EAAA,EAAA,GAAE;AAChF,4BAAA,WAAW,EAAE,IAAI;AAClB,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEjCH;;AAEG;;;;"}
|
|
@@ -1,63 +1,69 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef,
|
|
2
|
+
import { inject, ElementRef, signal, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { NgDocListItem } from '@ng-doc/ui-kit/classes/list-item';
|
|
4
4
|
import { NgDocListComponent } from '@ng-doc/ui-kit/components/list';
|
|
5
5
|
import { DIStateControl, DICompareHost, injectHostControl } from 'di-controls';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Option of a list. Clicking it, or pressing Enter while it is active, checks it in its host
|
|
9
|
+
* control; an option that contains a link follows the link instead.
|
|
10
|
+
*/
|
|
7
11
|
class NgDocOptionComponent extends DIStateControl {
|
|
8
12
|
constructor() {
|
|
9
13
|
super({
|
|
10
14
|
host: injectHostControl({ optional: true }),
|
|
11
15
|
compareHost: inject(DICompareHost, { optional: true }),
|
|
12
16
|
});
|
|
13
|
-
this.hovered = false;
|
|
14
17
|
this.elementRef = inject(ElementRef);
|
|
18
|
+
/** Whether the option is the active item of the list's keyboard navigation. */
|
|
19
|
+
this.hovered = signal(false, /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "hovered" }] : /* istanbul ignore next */ []));
|
|
15
21
|
this.list = inject(NgDocListComponent, {
|
|
16
22
|
optional: true,
|
|
17
23
|
});
|
|
18
24
|
this.list?.registerItem(this);
|
|
19
25
|
}
|
|
20
|
-
|
|
21
|
-
this.check();
|
|
22
|
-
}
|
|
26
|
+
/** Selects the option as if the user did: follows its link, or checks it. */
|
|
23
27
|
selectByUser() {
|
|
24
28
|
const anchor = this.elementRef.nativeElement.querySelector('a');
|
|
25
|
-
|
|
29
|
+
if (anchor) {
|
|
30
|
+
anchor.click();
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this.check();
|
|
34
|
+
}
|
|
26
35
|
}
|
|
36
|
+
/** Marks the option as the active item. */
|
|
27
37
|
setActiveStyles() {
|
|
28
|
-
this.hovered
|
|
29
|
-
this.changeDetectorRef.markForCheck();
|
|
38
|
+
this.hovered.set(true);
|
|
30
39
|
}
|
|
40
|
+
/** Clears the active-item mark. */
|
|
31
41
|
setInactiveStyles() {
|
|
32
|
-
this.hovered
|
|
33
|
-
this.changeDetectorRef.markForCheck();
|
|
42
|
+
this.hovered.set(false);
|
|
34
43
|
}
|
|
35
44
|
ngOnDestroy() {
|
|
36
45
|
this.list?.unregisterItem(this);
|
|
37
46
|
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
39
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
47
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
48
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.2.1", type: NgDocOptionComponent, isStandalone: true, selector: "ng-doc-option", host: { listeners: { "click": "check()" }, properties: { "attr.data-ng-doc-hover": "hovered()" } }, providers: [
|
|
40
49
|
{
|
|
41
50
|
provide: NgDocListItem,
|
|
42
51
|
useExisting: NgDocOptionComponent,
|
|
43
52
|
},
|
|
44
|
-
], usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{font-family:var(--ng-doc-font-family);font-variant:no-contextual;color:var(--ng-doc-text);line-height:var(--ng-doc-line-height);font-size:var(--ng-doc-font-size);font-weight:var(--ng-doc-font-weight);display:block;padding:var(--ng-doc-option-padding, var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 2))}:host:hover:not([data-disabled=true]),:host[data-ng-doc-hover=true]:not([data-disabled=true]){background:var(--ng-doc-hover-background);cursor:pointer}:host[data-checked=true]{background-color:
|
|
53
|
+
], usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{font-family:var(--ng-doc-font-family);font-variant:no-contextual;color:var(--ng-doc-text);line-height:var(--ng-doc-line-height);font-size:var(--ng-doc-font-size);font-weight:var(--ng-doc-font-weight);display:block;padding:var(--ng-doc-option-padding, var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 2))}:host:hover:not([data-disabled=true]),:host[data-ng-doc-hover=true]:not([data-disabled=true]){background:var(--ng-doc-hover-background);cursor:pointer}:host[data-checked=true]{background-color:color-mix(in srgb,var(--ng-doc-primary) 20%,transparent)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
45
54
|
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocOptionComponent, decorators: [{
|
|
47
56
|
type: Component,
|
|
48
57
|
args: [{ selector: 'ng-doc-option', template: '<ng-content></ng-content>', providers: [
|
|
49
58
|
{
|
|
50
59
|
provide: NgDocListItem,
|
|
51
60
|
useExisting: NgDocOptionComponent,
|
|
52
61
|
},
|
|
53
|
-
], changeDetection: ChangeDetectionStrategy.OnPush,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
type: HostListener,
|
|
59
|
-
args: ['click']
|
|
60
|
-
}] } });
|
|
62
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
63
|
+
'[attr.data-ng-doc-hover]': 'hovered()',
|
|
64
|
+
'(click)': 'check()',
|
|
65
|
+
}, styles: [":host{font-family:var(--ng-doc-font-family);font-variant:no-contextual;color:var(--ng-doc-text);line-height:var(--ng-doc-line-height);font-size:var(--ng-doc-font-size);font-weight:var(--ng-doc-font-weight);display:block;padding:var(--ng-doc-option-padding, var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 2))}:host:hover:not([data-disabled=true]),:host[data-ng-doc-hover=true]:not([data-disabled=true]){background:var(--ng-doc-hover-background);cursor:pointer}:host[data-checked=true]{background-color:color-mix(in srgb,var(--ng-doc-primary) 20%,transparent)}\n"] }]
|
|
66
|
+
}], ctorParameters: () => [] });
|
|
61
67
|
|
|
62
68
|
/**
|
|
63
69
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit-components-option.mjs","sources":["../../../../libs/ui-kit/components/option/option.component.ts","../../../../libs/ui-kit/components/option/ng-doc-ui-kit-components-option.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit-components-option.mjs","sources":["../../../../libs/ui-kit/components/option/option.component.ts","../../../../libs/ui-kit/components/option/ng-doc-ui-kit-components-option.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n inject,\n OnDestroy,\n signal,\n} from '@angular/core';\nimport { NgDocListItem } from '@ng-doc/ui-kit/classes/list-item';\nimport { NgDocListComponent } from '@ng-doc/ui-kit/components/list';\nimport { DICompareHost, DIStateControl, injectHostControl } from 'di-controls';\n\n/**\n * Option of a list. Clicking it, or pressing Enter while it is active, checks it in its host\n * control; an option that contains a link follows the link instead.\n */\n@Component({\n selector: 'ng-doc-option',\n template: '<ng-content></ng-content>',\n styleUrls: ['./option.component.scss'],\n providers: [\n {\n provide: NgDocListItem,\n useExisting: NgDocOptionComponent,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-ng-doc-hover]': 'hovered()',\n '(click)': 'check()',\n },\n})\nexport class NgDocOptionComponent<T> extends DIStateControl<T> implements NgDocListItem, OnDestroy {\n override readonly elementRef: ElementRef<HTMLElement> = inject(ElementRef);\n\n /** Whether the option is the active item of the list's keyboard navigation. */\n protected readonly hovered = signal(false);\n protected readonly list: NgDocListComponent | null = inject(NgDocListComponent, {\n optional: true,\n });\n\n constructor() {\n super({\n host: injectHostControl({ optional: true }),\n compareHost: inject(DICompareHost, { optional: true }),\n });\n\n this.list?.registerItem(this);\n }\n\n /** Selects the option as if the user did: follows its link, or checks it. */\n selectByUser(): void {\n const anchor: HTMLAnchorElement | null = this.elementRef.nativeElement.querySelector('a');\n\n if (anchor) {\n anchor.click();\n } else {\n this.check();\n }\n }\n\n /** Marks the option as the active item. */\n setActiveStyles(): void {\n this.hovered.set(true);\n }\n\n /** Clears the active-item mark. */\n setInactiveStyles(): void {\n this.hovered.set(false);\n }\n\n ngOnDestroy(): void {\n this.list?.unregisterItem(this);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAYA;;;AAGG;AAiBG,MAAO,oBAAwB,SAAQ,cAAiB,CAAA;AAS5D,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,CAAC;YACJ,IAAI,EAAE,iBAAiB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YAC3C,WAAW,EAAE,MAAM,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACvD,SAAA,CAAC;AAZc,QAAA,IAAA,CAAA,UAAU,GAA4B,MAAM,CAAC,UAAU,CAAC;;QAGvD,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,KAAK;oFAAC;AACvB,QAAA,IAAA,CAAA,IAAI,GAA8B,MAAM,CAAC,kBAAkB,EAAE;AAC9E,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA,CAAC;AAQA,QAAA,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC;IAC/B;;IAGA,YAAY,GAAA;AACV,QAAA,MAAM,MAAM,GAA6B,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC;QAEzF,IAAI,MAAM,EAAE;YACV,MAAM,CAAC,KAAK,EAAE;QAChB;aAAO;YACL,IAAI,CAAC,KAAK,EAAE;QACd;IACF;;IAGA,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;IACxB;;IAGA,iBAAiB,GAAA;AACf,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;IACzB;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC;IACjC;8GAzCW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,UAAA,EAAA,EAAA,wBAAA,EAAA,WAAA,EAAA,EAAA,EAAA,SAAA,EAZpB;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,aAAa;AACtB,gBAAA,WAAW,EAAE,oBAAoB;AAClC,aAAA;AACF,SAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAPS,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,8jBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAc1B,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAhBhC,SAAS;+BACE,eAAe,EAAA,QAAA,EACf,2BAA2B,EAAA,SAAA,EAE1B;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,aAAa;AACtB,4BAAA,WAAW,EAAA,oBAAsB;AAClC,yBAAA;qBACF,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,0BAA0B,EAAE,WAAW;AACvC,wBAAA,SAAS,EAAE,SAAS;AACrB,qBAAA,EAAA,MAAA,EAAA,CAAA,8jBAAA,CAAA,EAAA;;;AC9BH;;AAEG;;;;"}
|
|
@@ -1,70 +1,89 @@
|
|
|
1
1
|
import { FlexibleConnectedPositionStrategy } from '@angular/cdk/overlay';
|
|
2
2
|
import { isPlatformBrowser } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, ElementRef, DOCUMENT, ChangeDetectorRef,
|
|
4
|
+
import { inject, ElementRef, DOCUMENT, ChangeDetectorRef, PLATFORM_ID, DestroyRef, input, viewChild, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
6
|
import { NgDocFocusControlComponent } from '@ng-doc/ui-kit/components/focus-control';
|
|
6
7
|
import { NgDocOverlayPointerComponent } from '@ng-doc/ui-kit/components/overlay-pointer';
|
|
7
8
|
import { NgDocEventSwitcherDirective } from '@ng-doc/ui-kit/directives/event-switcher';
|
|
8
9
|
import { NgDocFocusCatcherDirective } from '@ng-doc/ui-kit/directives/focus-catcher';
|
|
9
10
|
import { toElement } from '@ng-doc/ui-kit/helpers';
|
|
10
|
-
import { ngDocZoneOptimize } from '@ng-doc/ui-kit/observables';
|
|
11
11
|
import { NgDocOverlayUtils, NgDocFocusUtils } from '@ng-doc/ui-kit/utils';
|
|
12
12
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
13
13
|
import { Subject } from 'rxjs';
|
|
14
14
|
import { distinctUntilChanged } from 'rxjs/operators';
|
|
15
15
|
|
|
16
|
+
/** The default overlay container: renders the content with the pointer and the open animation. */
|
|
16
17
|
class NgDocOverlayContainerComponent {
|
|
17
18
|
constructor() {
|
|
18
19
|
this.elementRef = inject(ElementRef);
|
|
19
20
|
this.documentRef = inject(DOCUMENT);
|
|
20
21
|
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
21
|
-
this.ngZone = inject(NgZone);
|
|
22
22
|
this.platformId = inject(PLATFORM_ID);
|
|
23
|
-
this.
|
|
24
|
-
|
|
23
|
+
this.destroyRef = inject(DestroyRef);
|
|
24
|
+
/** What the overlay renders: a string, a template or a component. */
|
|
25
|
+
this.content = input('', /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
27
|
+
/** The configuration the overlay was opened with. */
|
|
28
|
+
this.config = input(/* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [undefined, { debugName: "config" }] : /* istanbul ignore next */ []));
|
|
30
|
+
this.contentContainer = viewChild('contentContainer', { ...(ngDevMode ? { debugName: "contentContainer" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
31
|
+
this.focusCatcher = viewChild(NgDocFocusCatcherDirective, /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "focusCatcher" }] : /* istanbul ignore next */ []));
|
|
33
|
+
this.outlet = viewChild(PolymorpheusOutlet, /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "outlet" }] : /* istanbul ignore next */ []));
|
|
35
|
+
this.currentPosition = signal(null, /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "currentPosition" }] : /* istanbul ignore next */ []));
|
|
37
|
+
/** The side of the origin the overlay is on, once the position strategy has placed it. */
|
|
38
|
+
this.relativePosition = computed(() => {
|
|
39
|
+
const position = this.currentPosition();
|
|
40
|
+
return position ? NgDocOverlayUtils.getRelativePosition(position) : null;
|
|
41
|
+
}, /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "relativePosition" }] : /* istanbul ignore next */ []));
|
|
43
|
+
this.overlayAlign = computed(() => {
|
|
44
|
+
const position = this.currentPosition();
|
|
45
|
+
return position
|
|
46
|
+
? NgDocOverlayUtils.getPositionAlign(NgDocOverlayUtils.toConnectedPosition(position))
|
|
47
|
+
: null;
|
|
48
|
+
}, /* @ts-ignore */
|
|
49
|
+
...(ngDevMode ? [{ debugName: "overlayAlign" }] : /* istanbul ignore next */ []));
|
|
50
|
+
this.contactBorder = computed(() => !!this.config()?.contactBorder, /* @ts-ignore */
|
|
51
|
+
...(ngDevMode ? [{ debugName: "contactBorder" }] : /* istanbul ignore next */ []));
|
|
25
52
|
this.animationEvent$ = new Subject();
|
|
26
53
|
this.isOpened = true;
|
|
27
54
|
}
|
|
28
55
|
ngOnInit() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
this.
|
|
36
|
-
});
|
|
56
|
+
const positionStrategy = this.config()?.positionStrategy;
|
|
57
|
+
if (positionStrategy instanceof FlexibleConnectedPositionStrategy) {
|
|
58
|
+
// The strategy may report a position outside the Angular zone; writing a signal schedules
|
|
59
|
+
// change detection with and without zone.js.
|
|
60
|
+
positionStrategy.positionChanges
|
|
61
|
+
.pipe(distinctUntilChanged((a, b) => a.connectionPair === b.connectionPair), takeUntilDestroyed(this.destroyRef))
|
|
62
|
+
.subscribe((change) => this.currentPosition.set(NgDocOverlayUtils.getOverlayPosition(change.connectionPair)));
|
|
37
63
|
}
|
|
38
64
|
}
|
|
39
65
|
ngAfterViewInit() {
|
|
40
|
-
const [keyframes, options] = this.config?.openAnimation || [];
|
|
66
|
+
const [keyframes, options] = this.config()?.openAnimation || [];
|
|
41
67
|
this.runAnimation(keyframes ?? [], options);
|
|
42
68
|
}
|
|
43
|
-
get contactBorder() {
|
|
44
|
-
return !!this.config?.contactBorder;
|
|
45
|
-
}
|
|
46
69
|
get isFocused() {
|
|
47
|
-
return !!this.focusCatcher?.focused;
|
|
70
|
+
return !!this.focusCatcher()?.focused;
|
|
48
71
|
}
|
|
49
72
|
get animationEvent() {
|
|
50
73
|
return this.animationEvent$.asObservable();
|
|
51
74
|
}
|
|
52
|
-
get overlayAlign() {
|
|
53
|
-
return this.currentPosition
|
|
54
|
-
? NgDocOverlayUtils.getPositionAlign(NgDocOverlayUtils.toConnectedPosition(this.currentPosition))
|
|
55
|
-
: null;
|
|
56
|
-
}
|
|
57
75
|
close() {
|
|
58
76
|
if (this.isOpened) {
|
|
59
|
-
const [keyframes, options] = this.config?.closeAnimation || [];
|
|
77
|
+
const [keyframes, options] = this.config()?.closeAnimation || [];
|
|
60
78
|
this.runAnimation(keyframes ?? [], options, true);
|
|
61
79
|
this.isOpened = false;
|
|
62
80
|
this.changeDetectorRef.markForCheck();
|
|
63
81
|
}
|
|
64
82
|
}
|
|
65
83
|
focus() {
|
|
66
|
-
|
|
67
|
-
|
|
84
|
+
const contentContainer = this.contentContainer();
|
|
85
|
+
if (contentContainer) {
|
|
86
|
+
NgDocFocusUtils.focusClosestElement(toElement(contentContainer), toElement(contentContainer));
|
|
68
87
|
}
|
|
69
88
|
}
|
|
70
89
|
markForCheck() {
|
|
@@ -81,14 +100,15 @@ class NgDocOverlayContainerComponent {
|
|
|
81
100
|
.finished.then(() => this.animationEvent$.next(close ? 'afterClose' : 'afterOpen'));
|
|
82
101
|
}
|
|
83
102
|
ngOnDestroy() {
|
|
84
|
-
|
|
85
|
-
|
|
103
|
+
const config = this.config();
|
|
104
|
+
if (this.isFocused && config && config.viewContainerRef) {
|
|
105
|
+
NgDocFocusUtils.focusClosestElement(config.viewContainerRef.element.nativeElement, this.documentRef.body, false);
|
|
86
106
|
}
|
|
87
107
|
}
|
|
88
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
89
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
108
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocOverlayContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
109
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.1", type: NgDocOverlayContainerComponent, isStandalone: true, selector: "ng-doc-overlay-container", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-ng-doc-overlay-position": "relativePosition()", "attr.data-ng-doc-overlay-with-contact-border": "contactBorder()" } }, viewQueries: [{ propertyName: "contentContainer", first: true, predicate: ["contentContainer"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "focusCatcher", first: true, predicate: NgDocFocusCatcherDirective, descendants: true, isSignal: true }, { propertyName: "outlet", first: true, predicate: PolymorpheusOutlet, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-doc-overlay-pointer\n [overlayPosition]=\"relativePosition()\"\n [overlayAlign]=\"overlayAlign()\"\n [withPointer]=\"!!config()?.withPointer\"\n [ngDocEventSwitcher]=\"config()?.viewContainerRef?.element?.nativeElement ?? null\"\n [events]=\"['focusin', 'focusout', 'keydown', 'scroll']\">\n <ng-doc-focus-control\n [focusHost]=\"config()?.viewContainerRef?.element?.nativeElement ?? null\"\n ngDocFocusCatcher>\n <div class=\"ng-doc-overlay-content\" [tabIndex]=\"-1\" #contentContainer>\n <ng-container *polymorpheusOutlet=\"content() as text\">{{ text }}</ng-container>\n </div>\n </ng-doc-focus-control>\n</ng-doc-overlay-pointer>\n", styles: [":host{display:block;height:auto;width:100%}.ng-doc-overlay-content{width:100%;height:100%;background-color:var(--ng-doc-overlay-background);border:1px solid var(--ng-doc-overlay-border);border-radius:var(--ng-doc-overlay-border-radius);box-shadow:var(--ng-doc-overlay-shadow);overflow:auto}:host[data-ng-doc-overlay-position=top]{transform-origin:bottom}:host[data-ng-doc-overlay-position=top][data-ng-doc-overlay-with-contact-border=false] .ng-doc-overlay-content{border-bottom:none}:host[data-ng-doc-overlay-position=bottom]{transform-origin:top}:host[data-ng-doc-overlay-position=bottom][data-ng-doc-overlay-with-contact-border=false] .ng-doc-overlay-content{border-top:none}:host[data-ng-doc-overlay-position=left]{transform-origin:right}:host[data-ng-doc-overlay-position=left][data-ng-doc-overlay-with-contact-border=false] .ng-doc-overlay-content{border-right:none}:host[data-ng-doc-overlay-position=right]{transform-origin:left}:host[data-ng-doc-overlay-position=right][data-ng-doc-overlay-with-contact-border=false] .ng-doc-overlay-content{border-left:none}\n"], dependencies: [{ kind: "component", type: NgDocOverlayPointerComponent, selector: "ng-doc-overlay-pointer", inputs: ["overlayPosition", "overlayAlign", "withPointer"] }, { kind: "directive", type: NgDocEventSwitcherDirective, selector: "[ngDocEventSwitcher]", inputs: ["ngDocEventSwitcher", "events"] }, { kind: "component", type: NgDocFocusControlComponent, selector: "ng-doc-focus-control", inputs: ["focusHost"] }, { kind: "directive", type: NgDocFocusCatcherDirective, selector: "[ngDocFocusCatcher]", outputs: ["focusEvent", "blurEvent"], exportAs: ["ngDocFocusCatcher"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
90
110
|
}
|
|
91
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocOverlayContainerComponent, decorators: [{
|
|
92
112
|
type: Component,
|
|
93
113
|
args: [{ selector: 'ng-doc-overlay-container', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
94
114
|
NgDocOverlayPointerComponent,
|
|
@@ -96,27 +116,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
96
116
|
NgDocFocusControlComponent,
|
|
97
117
|
NgDocFocusCatcherDirective,
|
|
98
118
|
PolymorpheusOutlet,
|
|
99
|
-
],
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}], contentContainer: [{
|
|
105
|
-
type: ViewChild,
|
|
106
|
-
args: ['contentContainer', { read: ElementRef, static: true }]
|
|
107
|
-
}], focusCatcher: [{
|
|
108
|
-
type: ViewChild,
|
|
109
|
-
args: [NgDocFocusCatcherDirective]
|
|
110
|
-
}], outlet: [{
|
|
111
|
-
type: ViewChild,
|
|
112
|
-
args: [PolymorpheusOutlet, { static: true }]
|
|
113
|
-
}], relativePosition: [{
|
|
114
|
-
type: HostBinding,
|
|
115
|
-
args: ['attr.data-ng-doc-overlay-position']
|
|
116
|
-
}], contactBorder: [{
|
|
117
|
-
type: HostBinding,
|
|
118
|
-
args: ['attr.data-ng-doc-overlay-with-contact-border']
|
|
119
|
-
}] } });
|
|
119
|
+
], host: {
|
|
120
|
+
'[attr.data-ng-doc-overlay-position]': 'relativePosition()',
|
|
121
|
+
'[attr.data-ng-doc-overlay-with-contact-border]': 'contactBorder()',
|
|
122
|
+
}, template: "<ng-doc-overlay-pointer\n [overlayPosition]=\"relativePosition()\"\n [overlayAlign]=\"overlayAlign()\"\n [withPointer]=\"!!config()?.withPointer\"\n [ngDocEventSwitcher]=\"config()?.viewContainerRef?.element?.nativeElement ?? null\"\n [events]=\"['focusin', 'focusout', 'keydown', 'scroll']\">\n <ng-doc-focus-control\n [focusHost]=\"config()?.viewContainerRef?.element?.nativeElement ?? null\"\n ngDocFocusCatcher>\n <div class=\"ng-doc-overlay-content\" [tabIndex]=\"-1\" #contentContainer>\n <ng-container *polymorpheusOutlet=\"content() as text\">{{ text }}</ng-container>\n </div>\n </ng-doc-focus-control>\n</ng-doc-overlay-pointer>\n", styles: [":host{display:block;height:auto;width:100%}.ng-doc-overlay-content{width:100%;height:100%;background-color:var(--ng-doc-overlay-background);border:1px solid var(--ng-doc-overlay-border);border-radius:var(--ng-doc-overlay-border-radius);box-shadow:var(--ng-doc-overlay-shadow);overflow:auto}:host[data-ng-doc-overlay-position=top]{transform-origin:bottom}:host[data-ng-doc-overlay-position=top][data-ng-doc-overlay-with-contact-border=false] .ng-doc-overlay-content{border-bottom:none}:host[data-ng-doc-overlay-position=bottom]{transform-origin:top}:host[data-ng-doc-overlay-position=bottom][data-ng-doc-overlay-with-contact-border=false] .ng-doc-overlay-content{border-top:none}:host[data-ng-doc-overlay-position=left]{transform-origin:right}:host[data-ng-doc-overlay-position=left][data-ng-doc-overlay-with-contact-border=false] .ng-doc-overlay-content{border-right:none}:host[data-ng-doc-overlay-position=right]{transform-origin:left}:host[data-ng-doc-overlay-position=right][data-ng-doc-overlay-with-contact-border=false] .ng-doc-overlay-content{border-left:none}\n"] }]
|
|
123
|
+
}], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], contentContainer: [{ type: i0.ViewChild, args: ['contentContainer', { ...{ read: ElementRef }, isSignal: true }] }], focusCatcher: [{ type: i0.ViewChild, args: [i0.forwardRef(() => NgDocFocusCatcherDirective), { isSignal: true }] }], outlet: [{ type: i0.ViewChild, args: [i0.forwardRef(() => PolymorpheusOutlet), { isSignal: true }] }] } });
|
|
120
124
|
|
|
121
125
|
/**
|
|
122
126
|
* Generated bundle index. Do not edit.
|