@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.
Files changed (210) hide show
  1. package/README.md +20 -29
  2. package/fesm2022/ng-doc-ui-kit-cdk-combobox-host.mjs +43 -22
  3. package/fesm2022/ng-doc-ui-kit-cdk-combobox-host.mjs.map +1 -1
  4. package/fesm2022/ng-doc-ui-kit-classes-base-input.mjs +24 -13
  5. package/fesm2022/ng-doc-ui-kit-classes-base-input.mjs.map +1 -1
  6. package/fesm2022/ng-doc-ui-kit-classes-overlay-ref.mjs +62 -22
  7. package/fesm2022/ng-doc-ui-kit-classes-overlay-ref.mjs.map +1 -1
  8. package/fesm2022/ng-doc-ui-kit-components-blockquote.mjs +39 -14
  9. package/fesm2022/ng-doc-ui-kit-components-blockquote.mjs.map +1 -1
  10. package/fesm2022/ng-doc-ui-kit-components-button-icon.mjs +30 -18
  11. package/fesm2022/ng-doc-ui-kit-components-button-icon.mjs.map +1 -1
  12. package/fesm2022/ng-doc-ui-kit-components-button-toggle.mjs +12 -9
  13. package/fesm2022/ng-doc-ui-kit-components-button-toggle.mjs.map +1 -1
  14. package/fesm2022/ng-doc-ui-kit-components-button.mjs +15 -24
  15. package/fesm2022/ng-doc-ui-kit-components-button.mjs.map +1 -1
  16. package/fesm2022/ng-doc-ui-kit-components-checkbox.mjs +13 -13
  17. package/fesm2022/ng-doc-ui-kit-components-checkbox.mjs.map +1 -1
  18. package/fesm2022/ng-doc-ui-kit-components-clear-control.mjs +14 -9
  19. package/fesm2022/ng-doc-ui-kit-components-clear-control.mjs.map +1 -1
  20. package/fesm2022/ng-doc-ui-kit-components-combobox.mjs +30 -26
  21. package/fesm2022/ng-doc-ui-kit-components-combobox.mjs.map +1 -1
  22. package/fesm2022/ng-doc-ui-kit-components-data-list-group.mjs +37 -38
  23. package/fesm2022/ng-doc-ui-kit-components-data-list-group.mjs.map +1 -1
  24. package/fesm2022/ng-doc-ui-kit-components-data-list.mjs +32 -39
  25. package/fesm2022/ng-doc-ui-kit-components-data-list.mjs.map +1 -1
  26. package/fesm2022/ng-doc-ui-kit-components-dialog-outlet.mjs +23 -20
  27. package/fesm2022/ng-doc-ui-kit-components-dialog-outlet.mjs.map +1 -1
  28. package/fesm2022/ng-doc-ui-kit-components-dot.mjs +20 -16
  29. package/fesm2022/ng-doc-ui-kit-components-dot.mjs.map +1 -1
  30. package/fesm2022/ng-doc-ui-kit-components-dropdown.mjs +120 -125
  31. package/fesm2022/ng-doc-ui-kit-components-dropdown.mjs.map +1 -1
  32. package/fesm2022/ng-doc-ui-kit-components-expander.mjs +17 -17
  33. package/fesm2022/ng-doc-ui-kit-components-expander.mjs.map +1 -1
  34. package/fesm2022/ng-doc-ui-kit-components-floated-border.mjs +4 -4
  35. package/fesm2022/ng-doc-ui-kit-components-floated-border.mjs.map +1 -1
  36. package/fesm2022/ng-doc-ui-kit-components-floated-content.mjs +16 -17
  37. package/fesm2022/ng-doc-ui-kit-components-floated-content.mjs.map +1 -1
  38. package/fesm2022/ng-doc-ui-kit-components-focus-control.mjs +20 -12
  39. package/fesm2022/ng-doc-ui-kit-components-focus-control.mjs.map +1 -1
  40. package/fesm2022/ng-doc-ui-kit-components-icon.mjs +175 -54
  41. package/fesm2022/ng-doc-ui-kit-components-icon.mjs.map +1 -1
  42. package/fesm2022/ng-doc-ui-kit-components-input-wrapper.mjs +43 -46
  43. package/fesm2022/ng-doc-ui-kit-components-input-wrapper.mjs.map +1 -1
  44. package/fesm2022/ng-doc-ui-kit-components-label.mjs +14 -16
  45. package/fesm2022/ng-doc-ui-kit-components-label.mjs.map +1 -1
  46. package/fesm2022/ng-doc-ui-kit-components-line.mjs +7 -4
  47. package/fesm2022/ng-doc-ui-kit-components-line.mjs.map +1 -1
  48. package/fesm2022/ng-doc-ui-kit-components-list.mjs +24 -8
  49. package/fesm2022/ng-doc-ui-kit-components-list.mjs.map +1 -1
  50. package/fesm2022/ng-doc-ui-kit-components-magnifier-controller.mjs +9 -4
  51. package/fesm2022/ng-doc-ui-kit-components-magnifier-controller.mjs.map +1 -1
  52. package/fesm2022/ng-doc-ui-kit-components-magnifier.mjs +39 -18
  53. package/fesm2022/ng-doc-ui-kit-components-magnifier.mjs.map +1 -1
  54. package/fesm2022/ng-doc-ui-kit-components-option-group.mjs +22 -27
  55. package/fesm2022/ng-doc-ui-kit-components-option-group.mjs.map +1 -1
  56. package/fesm2022/ng-doc-ui-kit-components-option.mjs +28 -22
  57. package/fesm2022/ng-doc-ui-kit-components-option.mjs.map +1 -1
  58. package/fesm2022/ng-doc-ui-kit-components-overlay-container.mjs +56 -52
  59. package/fesm2022/ng-doc-ui-kit-components-overlay-container.mjs.map +1 -1
  60. package/fesm2022/ng-doc-ui-kit-components-overlay-pointer.mjs +19 -21
  61. package/fesm2022/ng-doc-ui-kit-components-overlay-pointer.mjs.map +1 -1
  62. package/fesm2022/ng-doc-ui-kit-components-pane.mjs +91 -69
  63. package/fesm2022/ng-doc-ui-kit-components-pane.mjs.map +1 -1
  64. package/fesm2022/ng-doc-ui-kit-components-selection.mjs +173 -76
  65. package/fesm2022/ng-doc-ui-kit-components-selection.mjs.map +1 -1
  66. package/fesm2022/ng-doc-ui-kit-components-sidenav.mjs +23 -22
  67. package/fesm2022/ng-doc-ui-kit-components-sidenav.mjs.map +1 -1
  68. package/fesm2022/ng-doc-ui-kit-components-spinner.mjs +14 -12
  69. package/fesm2022/ng-doc-ui-kit-components-spinner.mjs.map +1 -1
  70. package/fesm2022/ng-doc-ui-kit-components-tab-group.mjs +86 -61
  71. package/fesm2022/ng-doc-ui-kit-components-tab-group.mjs.map +1 -1
  72. package/fesm2022/ng-doc-ui-kit-components-tab-routes-group.mjs +16 -13
  73. package/fesm2022/ng-doc-ui-kit-components-tab-routes-group.mjs.map +1 -1
  74. package/fesm2022/ng-doc-ui-kit-components-tag.mjs +23 -24
  75. package/fesm2022/ng-doc-ui-kit-components-tag.mjs.map +1 -1
  76. package/fesm2022/ng-doc-ui-kit-components-text.mjs +37 -52
  77. package/fesm2022/ng-doc-ui-kit-components-text.mjs.map +1 -1
  78. package/fesm2022/ng-doc-ui-kit-components-toggle.mjs +82 -57
  79. package/fesm2022/ng-doc-ui-kit-components-toggle.mjs.map +1 -1
  80. package/fesm2022/ng-doc-ui-kit-components-wrapper.mjs +7 -4
  81. package/fesm2022/ng-doc-ui-kit-components-wrapper.mjs.map +1 -1
  82. package/fesm2022/ng-doc-ui-kit-directives-autofocus.mjs +13 -10
  83. package/fesm2022/ng-doc-ui-kit-directives-autofocus.mjs.map +1 -1
  84. package/fesm2022/ng-doc-ui-kit-directives-checked-change.mjs +30 -26
  85. package/fesm2022/ng-doc-ui-kit-directives-checked-change.mjs.map +1 -1
  86. package/fesm2022/ng-doc-ui-kit-directives-data.mjs +8 -5
  87. package/fesm2022/ng-doc-ui-kit-directives-data.mjs.map +1 -1
  88. package/fesm2022/ng-doc-ui-kit-directives-dropdown-handler.mjs +19 -18
  89. package/fesm2022/ng-doc-ui-kit-directives-dropdown-handler.mjs.map +1 -1
  90. package/fesm2022/ng-doc-ui-kit-directives-dropdown-origin.mjs +7 -9
  91. package/fesm2022/ng-doc-ui-kit-directives-dropdown-origin.mjs.map +1 -1
  92. package/fesm2022/ng-doc-ui-kit-directives-event-switcher.mjs +22 -19
  93. package/fesm2022/ng-doc-ui-kit-directives-event-switcher.mjs.map +1 -1
  94. package/fesm2022/ng-doc-ui-kit-directives-focus-catcher.mjs +30 -25
  95. package/fesm2022/ng-doc-ui-kit-directives-focus-catcher.mjs.map +1 -1
  96. package/fesm2022/ng-doc-ui-kit-directives-focusable.mjs +13 -16
  97. package/fesm2022/ng-doc-ui-kit-directives-focusable.mjs.map +1 -1
  98. package/fesm2022/ng-doc-ui-kit-directives-fullscreen.mjs +90 -0
  99. package/fesm2022/ng-doc-ui-kit-directives-fullscreen.mjs.map +1 -0
  100. package/fesm2022/ng-doc-ui-kit-directives-hotkey.mjs +34 -28
  101. package/fesm2022/ng-doc-ui-kit-directives-hotkey.mjs.map +1 -1
  102. package/fesm2022/ng-doc-ui-kit-directives-input-number.mjs +10 -12
  103. package/fesm2022/ng-doc-ui-kit-directives-input-number.mjs.map +1 -1
  104. package/fesm2022/ng-doc-ui-kit-directives-input-string.mjs +9 -12
  105. package/fesm2022/ng-doc-ui-kit-directives-input-string.mjs.map +1 -1
  106. package/fesm2022/ng-doc-ui-kit-directives-radio-group.mjs +7 -4
  107. package/fesm2022/ng-doc-ui-kit-directives-radio-group.mjs.map +1 -1
  108. package/fesm2022/ng-doc-ui-kit-directives-rotator.mjs +16 -22
  109. package/fesm2022/ng-doc-ui-kit-directives-rotator.mjs.map +1 -1
  110. package/fesm2022/ng-doc-ui-kit-directives-tooltip.mjs +105 -101
  111. package/fesm2022/ng-doc-ui-kit-directives-tooltip.mjs.map +1 -1
  112. package/fesm2022/ng-doc-ui-kit-directives.mjs +1 -1
  113. package/fesm2022/ng-doc-ui-kit-interceptors.mjs +24 -21
  114. package/fesm2022/ng-doc-ui-kit-interceptors.mjs.map +1 -1
  115. package/fesm2022/ng-doc-ui-kit-observables.mjs +2 -58
  116. package/fesm2022/ng-doc-ui-kit-observables.mjs.map +1 -1
  117. package/fesm2022/ng-doc-ui-kit-pipes-as-array.mjs +3 -4
  118. package/fesm2022/ng-doc-ui-kit-pipes-as-array.mjs.map +1 -1
  119. package/fesm2022/ng-doc-ui-kit-pipes-bind.mjs +3 -4
  120. package/fesm2022/ng-doc-ui-kit-pipes-bind.mjs.map +1 -1
  121. package/fesm2022/ng-doc-ui-kit-pipes-execute.mjs +3 -4
  122. package/fesm2022/ng-doc-ui-kit-pipes-execute.mjs.map +1 -1
  123. package/fesm2022/ng-doc-ui-kit-pipes-highlighter.mjs +3 -4
  124. package/fesm2022/ng-doc-ui-kit-pipes-highlighter.mjs.map +1 -1
  125. package/fesm2022/ng-doc-ui-kit-services-dialog.mjs +14 -8
  126. package/fesm2022/ng-doc-ui-kit-services-dialog.mjs.map +1 -1
  127. package/fesm2022/ng-doc-ui-kit-services-notify.mjs +13 -8
  128. package/fesm2022/ng-doc-ui-kit-services-notify.mjs.map +1 -1
  129. package/fesm2022/ng-doc-ui-kit-services-overlay-strategy.mjs +15 -11
  130. package/fesm2022/ng-doc-ui-kit-services-overlay-strategy.mjs.map +1 -1
  131. package/fesm2022/ng-doc-ui-kit-services-overlay.mjs +20 -9
  132. package/fesm2022/ng-doc-ui-kit-services-overlay.mjs.map +1 -1
  133. package/fesm2022/ng-doc-ui-kit-services-scroll.mjs +11 -13
  134. package/fesm2022/ng-doc-ui-kit-services-scroll.mjs.map +1 -1
  135. package/fesm2022/ng-doc-ui-kit-tokens.mjs +29 -3
  136. package/fesm2022/ng-doc-ui-kit-tokens.mjs.map +1 -1
  137. package/fesm2022/ng-doc-ui-kit-types.mjs +0 -1
  138. package/fesm2022/ng-doc-ui-kit-types.mjs.map +1 -1
  139. package/package.json +31 -33
  140. package/styles/main.css +275 -38
  141. package/types/ng-doc-ui-kit-cdk-combobox-host.d.ts +16 -8
  142. package/types/ng-doc-ui-kit-classes-base-input.d.ts +12 -1
  143. package/types/ng-doc-ui-kit-classes-overlay-ref.d.ts +27 -4
  144. package/types/ng-doc-ui-kit-components-blockquote.d.ts +22 -5
  145. package/types/ng-doc-ui-kit-components-button-icon.d.ts +23 -5
  146. package/types/ng-doc-ui-kit-components-button-toggle.d.ts +5 -1
  147. package/types/ng-doc-ui-kit-components-button.d.ts +6 -6
  148. package/types/ng-doc-ui-kit-components-checkbox.d.ts +5 -3
  149. package/types/ng-doc-ui-kit-components-clear-control.d.ts +7 -0
  150. package/types/ng-doc-ui-kit-components-combobox.d.ts +19 -9
  151. package/types/ng-doc-ui-kit-components-data-list-group.d.ts +16 -11
  152. package/types/ng-doc-ui-kit-components-data-list.d.ts +21 -11
  153. package/types/ng-doc-ui-kit-components-dialog-outlet.d.ts +11 -6
  154. package/types/ng-doc-ui-kit-components-dot.d.ts +10 -5
  155. package/types/ng-doc-ui-kit-components-dropdown.d.ts +39 -27
  156. package/types/ng-doc-ui-kit-components-expander.d.ts +9 -7
  157. package/types/ng-doc-ui-kit-components-floated-content.d.ts +8 -6
  158. package/types/ng-doc-ui-kit-components-focus-control.d.ts +10 -4
  159. package/types/ng-doc-ui-kit-components-icon.d.ts +49 -14
  160. package/types/ng-doc-ui-kit-components-input-wrapper.d.ts +31 -17
  161. package/types/ng-doc-ui-kit-components-label.d.ts +8 -5
  162. package/types/ng-doc-ui-kit-components-line.d.ts +3 -0
  163. package/types/ng-doc-ui-kit-components-list.d.ts +14 -3
  164. package/types/ng-doc-ui-kit-components-magnifier-controller.d.ts +5 -1
  165. package/types/ng-doc-ui-kit-components-magnifier.d.ts +19 -4
  166. package/types/ng-doc-ui-kit-components-option-group.d.ts +12 -8
  167. package/types/ng-doc-ui-kit-components-option.d.ts +9 -2
  168. package/types/ng-doc-ui-kit-components-overlay-container.d.ts +18 -15
  169. package/types/ng-doc-ui-kit-components-overlay-pointer.d.ts +10 -6
  170. package/types/ng-doc-ui-kit-components-pane.d.ts +25 -9
  171. package/types/ng-doc-ui-kit-components-selection.d.ts +59 -21
  172. package/types/ng-doc-ui-kit-components-sidenav.d.ts +17 -8
  173. package/types/ng-doc-ui-kit-components-spinner.d.ts +7 -3
  174. package/types/ng-doc-ui-kit-components-tab-group.d.ts +43 -22
  175. package/types/ng-doc-ui-kit-components-tab-routes-group.d.ts +4 -2
  176. package/types/ng-doc-ui-kit-components-tag.d.ts +13 -6
  177. package/types/ng-doc-ui-kit-components-text.d.ts +21 -19
  178. package/types/ng-doc-ui-kit-components-toggle.d.ts +13 -7
  179. package/types/ng-doc-ui-kit-components-wrapper.d.ts +3 -0
  180. package/types/ng-doc-ui-kit-directives-autofocus.d.ts +7 -5
  181. package/types/ng-doc-ui-kit-directives-checked-change.d.ts +15 -11
  182. package/types/ng-doc-ui-kit-directives-data.d.ts +6 -4
  183. package/types/ng-doc-ui-kit-directives-dropdown-handler.d.ts +5 -3
  184. package/types/ng-doc-ui-kit-directives-dropdown-origin.d.ts +0 -2
  185. package/types/ng-doc-ui-kit-directives-event-switcher.d.ts +11 -6
  186. package/types/ng-doc-ui-kit-directives-focus-catcher.d.ts +11 -8
  187. package/types/ng-doc-ui-kit-directives-focusable.d.ts +6 -3
  188. package/types/ng-doc-ui-kit-directives-fullscreen.d.ts +39 -0
  189. package/types/ng-doc-ui-kit-directives-hotkey.d.ts +14 -7
  190. package/types/ng-doc-ui-kit-directives-input-number.d.ts +3 -2
  191. package/types/ng-doc-ui-kit-directives-input-string.d.ts +2 -2
  192. package/types/ng-doc-ui-kit-directives-radio-group.d.ts +4 -0
  193. package/types/ng-doc-ui-kit-directives-rotator.d.ts +8 -8
  194. package/types/ng-doc-ui-kit-directives-tooltip.d.ts +35 -23
  195. package/types/ng-doc-ui-kit-directives.d.ts +1 -1
  196. package/types/ng-doc-ui-kit-interceptors.d.ts +18 -2
  197. package/types/ng-doc-ui-kit-interfaces.d.ts +20 -4
  198. package/types/ng-doc-ui-kit-observables.d.ts +2 -19
  199. package/types/ng-doc-ui-kit-services-dialog.d.ts +10 -1
  200. package/types/ng-doc-ui-kit-services-notify.d.ts +9 -1
  201. package/types/ng-doc-ui-kit-services-overlay-strategy.d.ts +5 -3
  202. package/types/ng-doc-ui-kit-services-overlay.d.ts +14 -3
  203. package/types/ng-doc-ui-kit-services-scroll.d.ts +4 -5
  204. package/types/ng-doc-ui-kit-types.d.ts +2 -2
  205. package/fesm2022/ng-doc-ui-kit-decorators.mjs +0 -53
  206. package/fesm2022/ng-doc-ui-kit-decorators.mjs.map +0 -1
  207. package/fesm2022/ng-doc-ui-kit-directives-let.mjs +0 -43
  208. package/fesm2022/ng-doc-ui-kit-directives-let.mjs.map +0 -1
  209. package/types/ng-doc-ui-kit-decorators.d.ts +0 -12
  210. 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, NgZone, DestroyRef, computed, ChangeDetectionStrategy, Component } from '@angular/core';
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, ...(ngDevMode ? [{ debugName: "x" }] : []));
24
- this.y = signal(0, ...(ngDevMode ? [{ debugName: "y" }] : []));
25
- this.scale = signal(1, ...(ngDevMode ? [{ debugName: "scale" }] : []));
26
- this.drag = signal(false, ...(ngDevMode ? [{ debugName: "drag" }] : []));
27
- this.document = inject(DOCUMENT);
28
- this.element = inject(ElementRef).nativeElement;
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
- }, ...(ngDevMode ? [{ debugName: "transform" }] : []));
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: "21.0.6", ngImport: i0, type: NgDocMagnifierComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
71
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", 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 }); }
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: "21.0.6", ngImport: i0, type: NgDocMagnifierComponent, decorators: [{
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
- }], ctorParameters: () => [] });
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 NgZone,\n OnInit,\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 *\n * @param event\n */\nfunction isMouseEvent(event: Event): event is MouseEvent {\n return event instanceof MouseEvent;\n}\n\n/**\n *\n * @param event\n */\nfunction isWheelEvent(event: Event): event is WheelEvent {\n return event instanceof WheelEvent;\n}\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;\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 ngZone = inject(NgZone);\n protected readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n this.transform = 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 }\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 incrementX(x: number): void {\n this.x.update((current) => current + x / this.scale());\n }\n\n incrementY(y: number): void {\n this.y.update((current) => current + y / this.scale());\n }\n\n zoom(diff: number): void {\n this.scale.update((scale) => Math.max(scale * (1 + diff / 1000), 1));\n }\n\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":";;;;;;AAgBA;;;AAGG;AACH,SAAS,YAAY,CAAC,KAAY,EAAA;IAChC,OAAO,KAAK,YAAY,UAAU;AACpC;AAEA;;;AAGG;AACH,SAAS,YAAY,CAAC,KAAY,EAAA;IAChC,OAAO,KAAK,YAAY,UAAU;AACpC;MAYa,uBAAuB,CAAA;AAYlC,IAAA,WAAA,GAAA;AAXmB,QAAA,IAAA,CAAA,CAAC,GAAG,MAAM,CAAS,CAAC,6CAAC;AACrB,QAAA,IAAA,CAAA,CAAC,GAAG,MAAM,CAAS,CAAC,6CAAC;AACrB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAS,CAAC,iDAAC;AAEzB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAU,KAAK,gDAAC;AAE7B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC,aAAa;AACnE,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB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C,GAAG,CAAC,CAAC,CAAC;IACnB;8GAlEW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,kIC1CpC,qHAGA,EAAA,MAAA,EAAA,CAAA,yFAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDuCa,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAVnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,WACnB,EAAE,EAAA,eAAA,EAGM,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,kBAAkB,EAAE,QAAQ;AAC7B,qBAAA,EAAA,QAAA,EAAA,qHAAA,EAAA,MAAA,EAAA,CAAA,yFAAA,CAAA,EAAA;;;AExCH;;AAEG;;;;"}
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":";;;;;;AAgBA;;;AAGG;AACH,SAAS,YAAY,CAAC,KAAY,EAAA;IAChC,OAAO,KAAK,YAAY,UAAU;AACpC;AAEA;;;AAGG;AACH,SAAS,YAAY,CAAC,KAAY,EAAA;IAChC,OAAO,KAAK,YAAY,UAAU;AACpC;AAEA;;;AAGG;MAWU,uBAAuB,CAAA;AAVpC,IAAA,WAAA,GAAA;QAWqB,IAAA,CAAA,CAAC,GAAG,MAAM,CAAS,CAAC;8EAAC;QACrB,IAAA,CAAA,CAAC,GAAG,MAAM,CAAS,CAAC;8EAAC;QACrB,IAAA,CAAA,KAAK,GAAG,MAAM,CAAS,CAAC;kFAAC;AACzB,QAAA,IAAA,CAAA,SAAS,GAAmB,QAAQ,CAAC,MAAK;AAC3D,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;AAC1B,YAAA,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE;AAClB,YAAA,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE;AAClB,YAAA,OAAO,CAAA,OAAA,EAAU,KAAK,CAAA,QAAA,EAAW,KAAK,CAAA,EAAA,EAAK,CAAC,GAAG,KAAK,CAAA,EAAA,EAAK,CAAC,GAAG,KAAK,GAAG;QACvE,CAAC;sFAAC;QACiB,IAAA,CAAA,IAAI,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AAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,kIC9CpC,qHAGA,EAAA,MAAA,EAAA,CAAA,yFAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FD2Ca,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAVnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,WACnB,EAAE,EAAA,eAAA,EAGM,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,kBAAkB,EAAE,QAAQ;AAC7B,qBAAA,EAAA,QAAA,EAAA,qHAAA,EAAA,MAAA,EAAA,CAAA,yFAAA,CAAA,EAAA;;;AE5CH;;AAEG;;;;"}
@@ -1,46 +1,41 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, inject, ChangeDetectorRef, QueryList, DestroyRef, ContentChildren, ChangeDetectionStrategy, Component } from '@angular/core';
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: "21.0.6", ngImport: i0, type: NgDocOptionGroupHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
10
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: NgDocOptionGroupHeaderDirective, isStandalone: true, selector: "[ngDocOptionGroupHeader]", ngImport: i0 }); }
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: "21.0.6", ngImport: i0, type: NgDocOptionGroupHeaderDirective, decorators: [{
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
- this.changeDetectorRef = inject(ChangeDetectorRef);
22
- this.options = new QueryList();
23
- this.hasHeader = false;
24
- this.destroyRef = inject(DestroyRef);
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: "21.0.6", ngImport: i0, type: NgDocOptionGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
35
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: NgDocOptionGroupComponent, isStandalone: true, selector: "ng-doc-option-group", queries: [{ propertyName: "options", predicate: NgDocOptionComponent, descendants: 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 }); }
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: "21.0.6", ngImport: i0, type: NgDocOptionGroupComponent, decorators: [{
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
- }], ctorParameters: () => [], propDecorators: { options: [{
41
- type: ContentChildren,
42
- args: [NgDocOptionComponent, { descendants: true }]
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 AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n DestroyRef,\n Directive,\n inject,\n QueryList,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgDocOptionComponent } from '@ng-doc/ui-kit/components/option';\nimport { NgDocTextComponent } from '@ng-doc/ui-kit/components/text';\nimport { startWith } from 'rxjs/operators';\n\n@Directive({\n selector: '[ngDocOptionGroupHeader]',\n standalone: true,\n})\nexport class NgDocOptionGroupHeaderDirective {}\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> implements AfterContentInit {\n private changeDetectorRef = inject(ChangeDetectorRef);\n\n @ContentChildren(NgDocOptionComponent, { descendants: true })\n options: QueryList<NgDocOptionComponent<T>> = new QueryList<NgDocOptionComponent<T>>();\n hasHeader: boolean = false;\n\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {}\n\n ngAfterContentInit(): void {\n this.options.changes\n .pipe(startWith(this.options), takeUntilDestroyed(this.destroyRef))\n .subscribe((options: QueryList<NgDocOptionComponent<T>>) => {\n this.hasHeader = !!options.length;\n this.changeDetectorRef.markForCheck();\n });\n }\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":";;;;;;;MAoBa,+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;kBAJ3C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;MAUY,yBAAyB,CAAA;AASpC,I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A;;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,8SAAA,EAAA,MAAA,EAAA,CAAA,ybAAA,CAAA,EAAA;;sBAK5B,eAAe;AAAC,gBAAA,IAAA,EAAA,CAAA,oBAAoB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;;AEhC9D;;AAEG;;;;"}
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, HostListener, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
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
- clickEvent() {
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
- anchor ? anchor.click() : this.check();
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 = true;
29
- this.changeDetectorRef.markForCheck();
38
+ this.hovered.set(true);
30
39
  }
40
+ /** Clears the active-item mark. */
31
41
  setInactiveStyles() {
32
- this.hovered = false;
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: "21.0.6", ngImport: i0, type: NgDocOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
39
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: NgDocOptionComponent, isStandalone: true, selector: "ng-doc-option", host: { listeners: { "click": "clickEvent()" }, properties: { "attr.data-ng-doc-hover": "this.hovered" } }, providers: [
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:rgba(var(--ng-doc-primary-rgb),.2)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
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: "21.0.6", ngImport: i0, type: NgDocOptionComponent, decorators: [{
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, standalone: 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:rgba(var(--ng-doc-primary-rgb),.2)}\n"] }]
54
- }], ctorParameters: () => [], propDecorators: { hovered: [{
55
- type: HostBinding,
56
- args: ['attr.data-ng-doc-hover']
57
- }], clickEvent: [{
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 HostBinding,\n HostListener,\n inject,\n OnDestroy,\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@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 standalone: true,\n})\nexport class NgDocOptionComponent<T> extends DIStateControl<T> implements NgDocListItem, OnDestroy {\n @HostBinding('attr.data-ng-doc-hover')\n protected hovered: boolean = false;\n\n override readonly elementRef: ElementRef<HTMLElement> = inject(ElementRef);\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 @HostListener('click')\n clickEvent(): void {\n this.check();\n }\n\n selectByUser(): void {\n const anchor: HTMLAnchorElement | null = this.elementRef.nativeElement.querySelector('a');\n\n anchor ? anchor.click() : this.check();\n }\n\n setActiveStyles(): void {\n this.hovered = true;\n this.changeDetectorRef.markForCheck();\n }\n\n setInactiveStyles(): void {\n this.hovered = false;\n this.changeDetectorRef.markForCheck();\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":";;;;;;AA0BM,MAAO,oBAAwB,SAAQ,cAAiB,CAAA;AAS5D,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,CAAC;YACJ,IAAI,EAAE,iBAAiB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YA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A,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,cAAA,EAAA,EAAA,UAAA,EAAA,EAAA,wBAAA,EAAA,cAAA,EAAA,EAAA,EAAA,SAAA,EATpB;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,wiBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAW1B,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAbhC,SAAS;+BACE,eAAe,EAAA,QAAA,EACf,2BAA2B,EAAA,SAAA,EAE1B;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,aAAa;AACtB,4BAAA,WAAW,EAAA,oBAAsB;AAClC,yBAAA;AACF,qBAAA,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,MAAA,EAAA,CAAA,wiBAAA,CAAA,EAAA;;sBAGf,WAAW;uBAAC,wBAAwB;;sBAiBpC,YAAY;uBAAC,OAAO;;;AC5CvB;;AAEG;;;;"}
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,IA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AAA,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, NgZone, PLATFORM_ID, HostBinding, ViewChild, Input, ChangeDetectionStrategy, Component } from '@angular/core';
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.content = '';
24
- this.relativePosition = null;
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
- if (this.config?.positionStrategy instanceof FlexibleConnectedPositionStrategy) {
30
- this.config.positionStrategy.positionChanges
31
- .pipe(distinctUntilChanged((a, b) => a.connectionPair === b.connectionPair), ngDocZoneOptimize(this.ngZone))
32
- .subscribe((change) => {
33
- this.currentPosition = NgDocOverlayUtils.getOverlayPosition(change.connectionPair);
34
- this.relativePosition = NgDocOverlayUtils.getRelativePosition(this.currentPosition);
35
- this.changeDetectorRef.markForCheck();
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
- if (this.contentContainer) {
67
- NgDocFocusUtils.focusClosestElement(toElement(this.contentContainer), toElement(this.contentContainer));
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
- if (this.isFocused && this.config && this.config.viewContainerRef) {
85
- NgDocFocusUtils.focusClosestElement(this.config.viewContainerRef.element.nativeElement, this.documentRef.body, false);
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: "21.0.6", ngImport: i0, type: NgDocOverlayContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
89
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: NgDocOverlayContainerComponent, isStandalone: true, selector: "ng-doc-overlay-container", inputs: { content: "content", config: "config" }, host: { properties: { "attr.data-ng-doc-overlay-position": "this.relativePosition", "attr.data-ng-doc-overlay-with-contact-border": "this.contactBorder" } }, viewQueries: [{ propertyName: "contentContainer", first: true, predicate: ["contentContainer"], descendants: true, read: ElementRef, static: true }, { propertyName: "focusCatcher", first: true, predicate: NgDocFocusCatcherDirective, descendants: true }, { propertyName: "outlet", first: true, predicate: PolymorpheusOutlet, descendants: true, static: true }], ngImport: i0, template: "<ng-doc-overlay-pointer\n\t[overlayPosition]=\"relativePosition\"\n\t[overlayAlign]=\"overlayAlign\"\n\t[withPointer]=\"!!config?.withPointer\"\n\t[ngDocEventSwitcher]=\"config?.viewContainerRef?.element?.nativeElement ?? null\"\n\t[events]=\"['focusin', 'focusout', 'keydown', 'scroll']\">\n\t<ng-doc-focus-control\n\t\t[focusHost]=\"this.config?.viewContainerRef?.element?.nativeElement ?? null\"\n\t\tngDocFocusCatcher>\n\t\t<div class=\"ng-doc-overlay-content\" [tabIndex]=\"-1\" #contentContainer>\n\t\t\t<ng-container *polymorpheusOutlet=\"content as text\">{{ text }}</ng-container>\n\t\t</div>\n\t</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 }); }
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: "21.0.6", ngImport: i0, type: NgDocOverlayContainerComponent, decorators: [{
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
- ], template: "<ng-doc-overlay-pointer\n\t[overlayPosition]=\"relativePosition\"\n\t[overlayAlign]=\"overlayAlign\"\n\t[withPointer]=\"!!config?.withPointer\"\n\t[ngDocEventSwitcher]=\"config?.viewContainerRef?.element?.nativeElement ?? null\"\n\t[events]=\"['focusin', 'focusout', 'keydown', 'scroll']\">\n\t<ng-doc-focus-control\n\t\t[focusHost]=\"this.config?.viewContainerRef?.element?.nativeElement ?? null\"\n\t\tngDocFocusCatcher>\n\t\t<div class=\"ng-doc-overlay-content\" [tabIndex]=\"-1\" #contentContainer>\n\t\t\t<ng-container *polymorpheusOutlet=\"content as text\">{{ text }}</ng-container>\n\t\t</div>\n\t</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"] }]
100
- }], ctorParameters: () => [], propDecorators: { content: [{
101
- type: Input
102
- }], config: [{
103
- type: Input
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.