@ng-doc/ui-kit 22.0.0-beta.2 → 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 (206) 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 +7 -3
  51. package/fesm2022/ng-doc-ui-kit-components-magnifier-controller.mjs.map +1 -1
  52. package/fesm2022/ng-doc-ui-kit-components-magnifier.mjs +31 -15
  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 +3 -4
  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/package.json +27 -30
  138. package/styles/main.css +271 -34
  139. package/types/ng-doc-ui-kit-cdk-combobox-host.d.ts +16 -8
  140. package/types/ng-doc-ui-kit-classes-base-input.d.ts +12 -1
  141. package/types/ng-doc-ui-kit-classes-overlay-ref.d.ts +27 -4
  142. package/types/ng-doc-ui-kit-components-blockquote.d.ts +22 -5
  143. package/types/ng-doc-ui-kit-components-button-icon.d.ts +23 -5
  144. package/types/ng-doc-ui-kit-components-button-toggle.d.ts +5 -1
  145. package/types/ng-doc-ui-kit-components-button.d.ts +6 -6
  146. package/types/ng-doc-ui-kit-components-checkbox.d.ts +5 -3
  147. package/types/ng-doc-ui-kit-components-clear-control.d.ts +7 -0
  148. package/types/ng-doc-ui-kit-components-combobox.d.ts +19 -9
  149. package/types/ng-doc-ui-kit-components-data-list-group.d.ts +16 -11
  150. package/types/ng-doc-ui-kit-components-data-list.d.ts +21 -11
  151. package/types/ng-doc-ui-kit-components-dialog-outlet.d.ts +11 -6
  152. package/types/ng-doc-ui-kit-components-dot.d.ts +10 -5
  153. package/types/ng-doc-ui-kit-components-dropdown.d.ts +39 -27
  154. package/types/ng-doc-ui-kit-components-expander.d.ts +9 -7
  155. package/types/ng-doc-ui-kit-components-floated-content.d.ts +8 -6
  156. package/types/ng-doc-ui-kit-components-focus-control.d.ts +10 -4
  157. package/types/ng-doc-ui-kit-components-icon.d.ts +49 -14
  158. package/types/ng-doc-ui-kit-components-input-wrapper.d.ts +31 -17
  159. package/types/ng-doc-ui-kit-components-label.d.ts +8 -5
  160. package/types/ng-doc-ui-kit-components-line.d.ts +3 -0
  161. package/types/ng-doc-ui-kit-components-list.d.ts +14 -3
  162. package/types/ng-doc-ui-kit-components-magnifier-controller.d.ts +5 -1
  163. package/types/ng-doc-ui-kit-components-magnifier.d.ts +19 -4
  164. package/types/ng-doc-ui-kit-components-option-group.d.ts +12 -8
  165. package/types/ng-doc-ui-kit-components-option.d.ts +9 -2
  166. package/types/ng-doc-ui-kit-components-overlay-container.d.ts +18 -15
  167. package/types/ng-doc-ui-kit-components-overlay-pointer.d.ts +10 -6
  168. package/types/ng-doc-ui-kit-components-pane.d.ts +25 -9
  169. package/types/ng-doc-ui-kit-components-selection.d.ts +59 -21
  170. package/types/ng-doc-ui-kit-components-sidenav.d.ts +17 -8
  171. package/types/ng-doc-ui-kit-components-spinner.d.ts +7 -3
  172. package/types/ng-doc-ui-kit-components-tab-group.d.ts +43 -22
  173. package/types/ng-doc-ui-kit-components-tab-routes-group.d.ts +4 -2
  174. package/types/ng-doc-ui-kit-components-tag.d.ts +13 -6
  175. package/types/ng-doc-ui-kit-components-text.d.ts +21 -19
  176. package/types/ng-doc-ui-kit-components-toggle.d.ts +13 -7
  177. package/types/ng-doc-ui-kit-components-wrapper.d.ts +3 -0
  178. package/types/ng-doc-ui-kit-directives-autofocus.d.ts +7 -5
  179. package/types/ng-doc-ui-kit-directives-checked-change.d.ts +15 -11
  180. package/types/ng-doc-ui-kit-directives-data.d.ts +6 -4
  181. package/types/ng-doc-ui-kit-directives-dropdown-handler.d.ts +5 -3
  182. package/types/ng-doc-ui-kit-directives-event-switcher.d.ts +11 -6
  183. package/types/ng-doc-ui-kit-directives-focus-catcher.d.ts +11 -8
  184. package/types/ng-doc-ui-kit-directives-focusable.d.ts +6 -3
  185. package/types/ng-doc-ui-kit-directives-fullscreen.d.ts +39 -0
  186. package/types/ng-doc-ui-kit-directives-hotkey.d.ts +14 -7
  187. package/types/ng-doc-ui-kit-directives-input-number.d.ts +3 -2
  188. package/types/ng-doc-ui-kit-directives-input-string.d.ts +2 -2
  189. package/types/ng-doc-ui-kit-directives-radio-group.d.ts +4 -0
  190. package/types/ng-doc-ui-kit-directives-rotator.d.ts +8 -8
  191. package/types/ng-doc-ui-kit-directives-tooltip.d.ts +35 -23
  192. package/types/ng-doc-ui-kit-directives.d.ts +1 -1
  193. package/types/ng-doc-ui-kit-interceptors.d.ts +18 -2
  194. package/types/ng-doc-ui-kit-interfaces.d.ts +20 -4
  195. package/types/ng-doc-ui-kit-observables.d.ts +2 -19
  196. package/types/ng-doc-ui-kit-services-dialog.d.ts +10 -1
  197. package/types/ng-doc-ui-kit-services-notify.d.ts +9 -1
  198. package/types/ng-doc-ui-kit-services-overlay-strategy.d.ts +5 -3
  199. package/types/ng-doc-ui-kit-services-overlay.d.ts +14 -3
  200. package/types/ng-doc-ui-kit-services-scroll.d.ts +4 -5
  201. package/fesm2022/ng-doc-ui-kit-decorators.mjs +0 -53
  202. package/fesm2022/ng-doc-ui-kit-decorators.mjs.map +0 -1
  203. package/fesm2022/ng-doc-ui-kit-directives-let.mjs +0 -43
  204. package/fesm2022/ng-doc-ui-kit-directives-let.mjs.map +0 -1
  205. package/types/ng-doc-ui-kit-decorators.d.ts +0 -12
  206. package/types/ng-doc-ui-kit-directives-let.d.ts +0 -22
@@ -1,118 +1,215 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, inject, ElementRef, DestroyRef, Input, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
- import { distinctUntilChanged, debounceTime } from 'rxjs/operators';
5
- import { ReplaySubject } from 'rxjs';
2
+ import { signal, untracked, Directive, inject, ElementRef, DestroyRef, input, afterRenderEffect, afterNextRender, ChangeDetectionStrategy, Component, effect } from '@angular/core';
6
3
 
4
+ /**
5
+ * Tracks which of its `ngDocSelectionOrigin` elements is selected, so that an
6
+ * `ng-doc-selection` inside it can highlight that element.
7
+ */
7
8
  class NgDocSelectionHostDirective {
8
9
  constructor() {
9
- this.origins = new Set();
10
- this.selectedChange = new ReplaySubject();
11
- }
12
- get selectedChange$() {
13
- return this.selectedChange.pipe(distinctUntilChanged());
14
- }
15
- addOrigin(origin) {
16
- this.origins.add(origin);
17
- }
18
- removeOrigin(origin) {
19
- this.origins.delete(origin);
20
- if (this.selected === origin) {
21
- this.changeSelected(origin, false);
22
- }
10
+ this.selectedElement = signal(undefined, /* @ts-ignore */
11
+ ...(ngDevMode ? [{ debugName: "selectedElement" }] : /* istanbul ignore next */ []));
12
+ /** Element of the selected origin, or `undefined` when none is selected. */
13
+ this.selected = this.selectedElement.asReadonly();
23
14
  }
15
+ /**
16
+ * Updates the selection after an origin changed its state or went away.
17
+ * @param origin - The origin whose state changed.
18
+ * @param selected - Whether the origin is selected now.
19
+ */
24
20
  changeSelected(origin, selected) {
25
- this.selected =
26
- this.selected === origin || selected ? (selected ? origin : undefined) : this.selected;
27
- this.selectedChange.next(this.selected?.elementRef?.nativeElement ?? undefined);
21
+ // Origins call this from their effects: reading the current selection must not subscribe
22
+ // them to it.
23
+ untracked(() => {
24
+ const element = origin.elementRef.nativeElement;
25
+ if (selected) {
26
+ this.selectedElement.set(element);
27
+ }
28
+ else if (this.selectedElement() === element) {
29
+ this.selectedElement.set(undefined);
30
+ }
31
+ });
32
+ }
33
+ /**
34
+ * Selects an element that cannot carry `ngDocSelectionOrigin`, because Angular does not render
35
+ * it: for example a tab in the HTML of a generated page.
36
+ * @param element - The element to highlight, or `undefined` to highlight none.
37
+ */
38
+ select(element) {
39
+ this.selectedElement.set(element);
28
40
  }
29
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocSelectionHostDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
30
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: NgDocSelectionHostDirective, isStandalone: true, selector: "[ngDocSelectionHost]", ngImport: i0 }); }
41
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSelectionHostDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
42
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.1", type: NgDocSelectionHostDirective, isStandalone: true, selector: "[ngDocSelectionHost]", ngImport: i0 }); }
31
43
  }
32
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocSelectionHostDirective, decorators: [{
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSelectionHostDirective, decorators: [{
33
45
  type: Directive,
34
46
  args: [{
35
47
  selector: '[ngDocSelectionHost]',
36
- standalone: true,
37
48
  }]
38
49
  }] });
39
50
 
51
+ /**
52
+ * Highlight that slides to the selected `ngDocSelectionOrigin` of the closest
53
+ * `ngDocSelectionHost`, for example the underline of the active tab or the thumb of a segmented
54
+ * control. It covers the selected element and moves with a transform.
55
+ *
56
+ * The highlight is measured in the browser only. Until it is placed it is hidden and has no
57
+ * `data-ng-doc-placed` attribute, so the selected element can style itself in the server-rendered
58
+ * page, for example with `ng-doc-selection:not([data-ng-doc-placed]) ~ .selected`. The first
59
+ * placement never animates, and nothing animates when the reader prefers reduced motion.
60
+ */
40
61
  class NgDocSelectionComponent {
41
62
  constructor() {
42
63
  this.elementRef = inject(ElementRef);
43
64
  this.selectionHost = inject(NgDocSelectionHostDirective);
44
- this.align = 'bottom';
45
65
  this.destroyRef = inject(DestroyRef);
66
+ // Changes when the selected element or the container resizes, to measure again.
67
+ this.resized = signal(0, /* @ts-ignore */
68
+ ...(ngDevMode ? [{ debugName: "resized" }] : /* istanbul ignore next */ []));
69
+ this.destroyed = false;
70
+ // Counts the first placements, so a transition scheduled for an earlier one is dropped.
71
+ this.placements = 0;
72
+ /**
73
+ * Side of the selected element on which the highlight draws its border, or `null` for no
74
+ * border (a thumb that covers the element, styled by its container).
75
+ */
76
+ this.align = input('bottom', /* @ts-ignore */
77
+ ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
78
+ // Runs after the render in which the selection changed. Every highlight on the page measures
79
+ // in the read phase and moves in the write phase, so the layout is computed once for all of
80
+ // them. Nothing runs during server rendering, where nothing can be measured.
81
+ afterRenderEffect({
82
+ earlyRead: () => {
83
+ this.resized();
84
+ const element = this.selectionHost.selected();
85
+ return {
86
+ element,
87
+ box: element?.offsetWidth
88
+ ? {
89
+ left: element.offsetLeft || 0,
90
+ top: element.offsetTop || 0,
91
+ width: element.offsetWidth,
92
+ height: element.offsetHeight || 0,
93
+ }
94
+ : null,
95
+ };
96
+ },
97
+ write: (measured) => {
98
+ const { element, box } = measured();
99
+ this.observe(element);
100
+ this.place(box);
101
+ },
102
+ });
103
+ // The selected element can change its size without a new selection: when web fonts load,
104
+ // when the container resizes, or when a hidden container (a collapsed pane) is shown.
105
+ afterNextRender(() => {
106
+ const view = this.elementRef.nativeElement.ownerDocument.defaultView;
107
+ if (view?.ResizeObserver) {
108
+ this.resizeObserver = new view.ResizeObserver(() => this.resized.update((value) => value + 1));
109
+ const container = this.elementRef.nativeElement.parentElement;
110
+ if (container) {
111
+ this.resizeObserver.observe(container);
112
+ }
113
+ this.observe(this.selectionHost.selected());
114
+ }
115
+ });
116
+ this.destroyRef.onDestroy(() => {
117
+ this.destroyed = true;
118
+ this.resizeObserver?.disconnect();
119
+ });
46
120
  }
47
- ngAfterViewInit() {
48
- this.selectionHost.selectedChange$
49
- .pipe(debounceTime(0), takeUntilDestroyed(this.destroyRef))
50
- .subscribe((selected) => this.setStyles(selected));
51
- }
52
- setStyles(element) {
53
- this.elementRef.nativeElement.style.visibility = 'hidden';
54
- if (element) {
55
- const position = this.getPosition(element);
56
- if (this.align === 'left' || this.align === 'right') {
57
- this.elementRef.nativeElement.style.top = position.top;
121
+ observe(element) {
122
+ if (this.resizeObserver && element !== this.observed) {
123
+ if (this.observed) {
124
+ this.resizeObserver.unobserve(this.observed);
58
125
  }
59
- else {
60
- this.elementRef.nativeElement.style.left = position.left;
126
+ if (element) {
127
+ this.resizeObserver.observe(element);
61
128
  }
62
- this.elementRef.nativeElement.style.height = position.height;
63
- this.elementRef.nativeElement.style.width = position.width;
64
- this.elementRef.nativeElement.style.visibility = 'visible';
129
+ this.observed = element;
130
+ }
131
+ }
132
+ place(box) {
133
+ const host = this.elementRef.nativeElement;
134
+ const style = host.style;
135
+ // An element without a box (none selected, not rendered yet, or inside a hidden container)
136
+ // cannot be measured. The highlight hides and is placed without animation once the element
137
+ // has a box, instead of sliding in from a stale position.
138
+ if (!box) {
139
+ this.placements++;
140
+ style.visibility = 'hidden';
141
+ host.removeAttribute('data-ng-doc-placed');
142
+ host.removeAttribute('data-ng-doc-animated');
143
+ return;
144
+ }
145
+ // Width and height animate with the transform: scaling instead would distort the rounded
146
+ // corners, the shadow and the border of the highlight. The highlight is absolutely positioned
147
+ // and has no content, so resizing it lays out nothing else.
148
+ style.transform = `translate(${box.left}px, ${box.top}px)`;
149
+ style.width = `${box.width}px`;
150
+ style.height = `${box.height}px`;
151
+ style.visibility = 'visible';
152
+ if (!host.hasAttribute('data-ng-doc-placed')) {
153
+ host.setAttribute('data-ng-doc-placed', '');
154
+ this.enableTransition();
65
155
  }
66
156
  }
67
- getPosition(element) {
68
- return {
69
- top: element ? `${element.offsetTop || 0}px` : '0',
70
- left: element ? `${element.offsetLeft || 0}px` : '0',
71
- width: element ? `${element.offsetWidth || 0}px` : '0',
72
- height: element ? `${element.offsetHeight || 0}px` : '0',
157
+ /**
158
+ * Turns the transition on once the first position has been painted. Turning it on in the same
159
+ * frame would animate the highlight from the corner of its container; reading the style to
160
+ * commit the position instead would force a layout for every highlight on the page.
161
+ */
162
+ enableTransition() {
163
+ const host = this.elementRef.nativeElement;
164
+ const view = host.ownerDocument.defaultView;
165
+ const placement = ++this.placements;
166
+ const enable = () => {
167
+ if (!this.destroyed && placement === this.placements) {
168
+ host.setAttribute('data-ng-doc-animated', '');
169
+ }
73
170
  };
171
+ if (view?.requestAnimationFrame) {
172
+ // The first frame paints the position, the second one may animate from it.
173
+ view.requestAnimationFrame(() => view.requestAnimationFrame(enable));
174
+ }
175
+ else {
176
+ enable();
177
+ }
74
178
  }
75
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
76
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: NgDocSelectionComponent, isStandalone: true, selector: "ng-doc-selection", inputs: { align: "align" }, host: { properties: { "attr.data-ng-doc-align": "this.align" } }, ngImport: i0, template: '', isInline: true, styles: [":host{position:absolute;transition:var(--ng-doc-transition);pointer-events:none;background:var(--ng-doc-selection-background)}:host[data-ng-doc-align=left]{left:0;border-left:var(--ng-doc-selection-border)}:host[data-ng-doc-align=right]{right:0;border-right:var(--ng-doc-selection-border)}:host[data-ng-doc-align=bottom]{bottom:0;border-bottom:var(--ng-doc-selection-border)}:host[data-ng-doc-align=top]{top:0;border-top:var(--ng-doc-selection-border)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
179
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
180
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.1", type: NgDocSelectionComponent, isStandalone: true, selector: "ng-doc-selection", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "attr.data-ng-doc-align": "align()" } }, ngImport: i0, template: '', isInline: true, styles: [":host{position:absolute;top:0;left:0;box-sizing:border-box;visibility:hidden;pointer-events:none;background:var(--ng-doc-selection-background)}:host[data-ng-doc-animated]{transition-property:transform,width,height;transition-duration:var(--ng-doc-transition);transition-timing-function:cubic-bezier(.2,0,0,1)}:host[data-ng-doc-align=left]{border-left:var(--ng-doc-selection-border)}:host[data-ng-doc-align=right]{border-right:var(--ng-doc-selection-border)}:host[data-ng-doc-align=bottom]{border-bottom:var(--ng-doc-selection-border)}:host[data-ng-doc-align=top]{border-top:var(--ng-doc-selection-border)}@media(prefers-reduced-motion:reduce){:host[data-ng-doc-animated]{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
77
181
  }
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocSelectionComponent, decorators: [{
182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSelectionComponent, decorators: [{
79
183
  type: Component,
80
- args: [{ selector: 'ng-doc-selection', template: '', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, styles: [":host{position:absolute;transition:var(--ng-doc-transition);pointer-events:none;background:var(--ng-doc-selection-background)}:host[data-ng-doc-align=left]{left:0;border-left:var(--ng-doc-selection-border)}:host[data-ng-doc-align=right]{right:0;border-right:var(--ng-doc-selection-border)}:host[data-ng-doc-align=bottom]{bottom:0;border-bottom:var(--ng-doc-selection-border)}:host[data-ng-doc-align=top]{top:0;border-top:var(--ng-doc-selection-border)}\n"] }]
81
- }], ctorParameters: () => [], propDecorators: { align: [{
82
- type: Input
83
- }, {
84
- type: HostBinding,
85
- args: ['attr.data-ng-doc-align']
86
- }] } });
184
+ args: [{ selector: 'ng-doc-selection', template: '', changeDetection: ChangeDetectionStrategy.OnPush, host: {
185
+ 'aria-hidden': 'true',
186
+ '[attr.data-ng-doc-align]': 'align()',
187
+ }, styles: [":host{position:absolute;top:0;left:0;box-sizing:border-box;visibility:hidden;pointer-events:none;background:var(--ng-doc-selection-background)}:host[data-ng-doc-animated]{transition-property:transform,width,height;transition-duration:var(--ng-doc-transition);transition-timing-function:cubic-bezier(.2,0,0,1)}:host[data-ng-doc-align=left]{border-left:var(--ng-doc-selection-border)}:host[data-ng-doc-align=right]{border-right:var(--ng-doc-selection-border)}:host[data-ng-doc-align=bottom]{border-bottom:var(--ng-doc-selection-border)}:host[data-ng-doc-align=top]{border-top:var(--ng-doc-selection-border)}@media(prefers-reduced-motion:reduce){:host[data-ng-doc-animated]{transition:none}}\n"] }]
188
+ }], ctorParameters: () => [], propDecorators: { align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }] } });
87
189
 
190
+ /**
191
+ * Element that the `ng-doc-selection` of the closest `ngDocSelectionHost` highlights while
192
+ * `ngDocSelectionOrigin` is `true`.
193
+ */
88
194
  class NgDocSelectionOriginDirective {
89
195
  constructor() {
196
+ /** The host element. */
90
197
  this.elementRef = inject(ElementRef);
91
198
  this.selectionHost = inject(NgDocSelectionHostDirective);
92
- this.selected = false;
93
- this.selectionHost.addOrigin(this);
94
- }
95
- ngOnChanges({ selected }) {
96
- if (selected) {
97
- this.selectionHost.changeSelected(this, this.selected);
98
- }
99
- }
100
- ngOnDestroy() {
101
- this.selectionHost.removeOrigin(this);
199
+ /** Whether the element is selected. */
200
+ this.selected = input(false, { ...(ngDevMode ? { debugName: "selected" } : /* istanbul ignore next */ {}), alias: 'ngDocSelectionOrigin' });
201
+ effect(() => this.selectionHost.changeSelected(this, this.selected()));
202
+ inject(DestroyRef).onDestroy(() => this.selectionHost.changeSelected(this, false));
102
203
  }
103
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocSelectionOriginDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
104
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: NgDocSelectionOriginDirective, isStandalone: true, selector: "[ngDocSelectionOrigin]", inputs: { selected: ["ngDocSelectionOrigin", "selected"] }, usesOnChanges: true, ngImport: i0 }); }
204
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSelectionOriginDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
205
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.1", type: NgDocSelectionOriginDirective, isStandalone: true, selector: "[ngDocSelectionOrigin]", inputs: { selected: { classPropertyName: "selected", publicName: "ngDocSelectionOrigin", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
105
206
  }
106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocSelectionOriginDirective, decorators: [{
207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSelectionOriginDirective, decorators: [{
107
208
  type: Directive,
108
209
  args: [{
109
210
  selector: '[ngDocSelectionOrigin]',
110
- standalone: true,
111
211
  }]
112
- }], ctorParameters: () => [], propDecorators: { selected: [{
113
- type: Input,
114
- args: ['ngDocSelectionOrigin']
115
- }] } });
212
+ }], ctorParameters: () => [], propDecorators: { selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngDocSelectionOrigin", required: false }] }] } });
116
213
 
117
214
  /**
118
215
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-ui-kit-components-selection.mjs","sources":["../../../../libs/ui-kit/components/selection/selection-host.directive.ts","../../../../libs/ui-kit/components/selection/selection.component.ts","../../../../libs/ui-kit/components/selection/selection-origin.directive.ts","../../../../libs/ui-kit/components/selection/ng-doc-ui-kit-components-selection.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\nimport { distinctUntilChanged } from 'rxjs/operators';\n\nimport { NgDocSelectionOriginDirective } from './selection-origin.directive';\n\n@Directive({\n\tselector: '[ngDocSelectionHost]',\n\tstandalone: true,\n})\nexport class NgDocSelectionHostDirective {\n\tprivate origins: Set<NgDocSelectionOriginDirective> = new Set<NgDocSelectionOriginDirective>();\n\tprivate selected?: NgDocSelectionOriginDirective;\n\tprivate selectedChange: ReplaySubject<HTMLElement | undefined> = new ReplaySubject<\n\t\tHTMLElement | undefined\n\t>();\n\n\tget selectedChange$(): Observable<HTMLElement | undefined> {\n\t\treturn this.selectedChange.pipe(distinctUntilChanged());\n\t}\n\n\taddOrigin(origin: NgDocSelectionOriginDirective): void {\n\t\tthis.origins.add(origin);\n\t}\n\n\tremoveOrigin(origin: NgDocSelectionOriginDirective): void {\n\t\tthis.origins.delete(origin);\n\n\t\tif (this.selected === origin) {\n\t\t\tthis.changeSelected(origin, false);\n\t\t}\n\t}\n\n\tchangeSelected(origin: NgDocSelectionOriginDirective, selected: boolean): void {\n\t\tthis.selected =\n\t\t\tthis.selected === origin || selected ? (selected ? origin : undefined) : this.selected;\n\t\tthis.selectedChange.next(this.selected?.elementRef?.nativeElement ?? undefined);\n\t}\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n HostBinding,\n inject,\n Input,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgDocHorizontalAlign, NgDocPosition, NgDocVerticalAlign } from '@ng-doc/ui-kit/types';\nimport { debounceTime } from 'rxjs/operators';\n\nimport { NgDocSelectionHostDirective } from './selection-host.directive';\n\n@Component({\n selector: 'ng-doc-selection',\n template: '',\n styleUrls: ['./selection.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class NgDocSelectionComponent implements AfterViewInit {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly selectionHost = inject(NgDocSelectionHostDirective);\n\n @Input()\n @HostBinding('attr.data-ng-doc-align')\n align: NgDocHorizontalAlign | NgDocVerticalAlign = 'bottom';\n\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {}\n\n ngAfterViewInit(): void {\n this.selectionHost.selectedChange$\n .pipe(debounceTime(0), takeUntilDestroyed(this.destroyRef))\n .subscribe((selected: HTMLElement | undefined) => this.setStyles(selected));\n }\n\n private setStyles(element?: HTMLElement): void {\n this.elementRef.nativeElement.style.visibility = 'hidden';\n if (element) {\n const position: NgDocPosition = this.getPosition(element);\n\n if (this.align === 'left' || this.align === 'right') {\n this.elementRef.nativeElement.style.top = position.top;\n } else {\n this.elementRef.nativeElement.style.left = position.left;\n }\n\n this.elementRef.nativeElement.style.height = position.height;\n this.elementRef.nativeElement.style.width = position.width;\n this.elementRef.nativeElement.style.visibility = 'visible';\n }\n }\n\n private getPosition(element: HTMLElement): NgDocPosition {\n return {\n top: element ? `${element.offsetTop || 0}px` : '0',\n left: element ? `${element.offsetLeft || 0}px` : '0',\n width: element ? `${element.offsetWidth || 0}px` : '0',\n height: element ? `${element.offsetHeight || 0}px` : '0',\n };\n }\n}\n","import {\n Directive,\n ElementRef,\n inject,\n Input,\n OnChanges,\n OnDestroy,\n SimpleChanges,\n} from '@angular/core';\n\nimport { NgDocSelectionHostDirective } from './selection-host.directive';\n\n@Directive({\n selector: '[ngDocSelectionOrigin]',\n standalone: true,\n})\nexport class NgDocSelectionOriginDirective implements OnChanges, OnDestroy {\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly selectionHost = inject(NgDocSelectionHostDirective);\n\n @Input('ngDocSelectionOrigin')\n selected: boolean = false;\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {\n this.selectionHost.addOrigin(this);\n }\n\n ngOnChanges({ selected }: SimpleChanges): void {\n if (selected) {\n this.selectionHost.changeSelected(this, this.selected);\n }\n }\n\n ngOnDestroy(): void {\n this.selectionHost.removeOrigin(this);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAUa,2BAA2B,CAAA;AAJxC,IAAA,WAAA,GAAA;AAKS,QAAA,IAAA,CAAA,OAAO,GAAuC,IAAI,GAAG,EAAiC;AAEtF,QAAA,IAAA,CAAA,cAAc,GAA2C,IAAI,aAAa,EAE/E;AAuBH,IAAA;AArBA,IAAA,IAAI,eAAe,GAAA;QAClB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;IACxD;AAEA,IAAA,SAAS,CAAC,MAAqC,EAAA;AAC9C,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;IACzB;AAEA,IAAA,YAAY,CAAC,MAAqC,EAAA;AACjD,QAAA,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;AAE3B,QAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,MAAM,EAAE;AAC7B,YAAA,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC;QACnC;IACD;IAEA,cAAc,CAAC,MAAqC,EAAE,QAAiB,EAAA;AACtE,QAAA,IAAI,CAAC,QAAQ;YACZ,IAAI,CAAC,QAAQ,KAAK,MAAM,IAAI,QAAQ,IAAI,QAAQ,GAAG,MAAM,GAAG,SAAS,IAAI,IAAI,CAAC,QAAQ;AACvF,QAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,aAAa,IAAI,SAAS,CAAC;IAChF;8GA3BY,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,Q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ui-kit-components-selection.mjs","sources":["../../../../libs/ui-kit/components/selection/selection-host.directive.ts","../../../../libs/ui-kit/components/selection/selection.component.ts","../../../../libs/ui-kit/components/selection/selection-origin.directive.ts","../../../../libs/ui-kit/components/selection/ng-doc-ui-kit-components-selection.ts"],"sourcesContent":["import { Directive, Signal, signal, untracked } from '@angular/core';\n\nimport type { NgDocSelectionOriginDirective } from './selection-origin.directive';\n\n/**\n * Tracks which of its `ngDocSelectionOrigin` elements is selected, so that an\n * `ng-doc-selection` inside it can highlight that element.\n */\n@Directive({\n selector: '[ngDocSelectionHost]',\n})\nexport class NgDocSelectionHostDirective {\n private readonly selectedElement = signal<HTMLElement | undefined>(undefined);\n\n /** Element of the selected origin, or `undefined` when none is selected. */\n readonly selected: Signal<HTMLElement | undefined> = this.selectedElement.asReadonly();\n\n /**\n * Updates the selection after an origin changed its state or went away.\n * @param origin - The origin whose state changed.\n * @param selected - Whether the origin is selected now.\n */\n changeSelected(origin: NgDocSelectionOriginDirective, selected: boolean): void {\n // Origins call this from their effects: reading the current selection must not subscribe\n // them to it.\n untracked(() => {\n const element: HTMLElement = origin.elementRef.nativeElement;\n\n if (selected) {\n this.selectedElement.set(element);\n } else if (this.selectedElement() === element) {\n this.selectedElement.set(undefined);\n }\n });\n }\n\n /**\n * Selects an element that cannot carry `ngDocSelectionOrigin`, because Angular does not render\n * it: for example a tab in the HTML of a generated page.\n * @param element - The element to highlight, or `undefined` to highlight none.\n */\n select(element: HTMLElement | undefined): void {\n this.selectedElement.set(element);\n }\n}\n","import {\n afterNextRender,\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { NgDocHorizontalAlign, NgDocVerticalAlign } from '@ng-doc/ui-kit/types';\n\nimport { NgDocSelectionHostDirective } from './selection-host.directive';\n\n/** The box of the selected element, relative to its offset parent. */\ninterface SelectionBox {\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\n/**\n * Highlight that slides to the selected `ngDocSelectionOrigin` of the closest\n * `ngDocSelectionHost`, for example the underline of the active tab or the thumb of a segmented\n * control. It covers the selected element and moves with a transform.\n *\n * The highlight is measured in the browser only. Until it is placed it is hidden and has no\n * `data-ng-doc-placed` attribute, so the selected element can style itself in the server-rendered\n * page, for example with `ng-doc-selection:not([data-ng-doc-placed]) ~ .selected`. The first\n * placement never animates, and nothing animates when the reader prefers reduced motion.\n */\n@Component({\n selector: 'ng-doc-selection',\n template: '',\n styleUrls: ['./selection.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'aria-hidden': 'true',\n '[attr.data-ng-doc-align]': 'align()',\n },\n})\nexport class NgDocSelectionComponent {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly selectionHost = inject(NgDocSelectionHostDirective);\n private readonly destroyRef = inject(DestroyRef);\n // Changes when the selected element or the container resizes, to measure again.\n private readonly resized = signal(0);\n private resizeObserver?: ResizeObserver;\n private observed?: HTMLElement;\n private destroyed: boolean = false;\n // Counts the first placements, so a transition scheduled for an earlier one is dropped.\n private placements: number = 0;\n\n /**\n * Side of the selected element on which the highlight draws its border, or `null` for no\n * border (a thumb that covers the element, styled by its container).\n */\n readonly align = input<NgDocHorizontalAlign | NgDocVerticalAlign | null>('bottom');\n\n constructor() {\n // Runs after the render in which the selection changed. Every highlight on the page measures\n // in the read phase and moves in the write phase, so the layout is computed once for all of\n // them. Nothing runs during server rendering, where nothing can be measured.\n afterRenderEffect({\n earlyRead: () => {\n this.resized();\n\n const element: HTMLElement | undefined = this.selectionHost.selected();\n\n return {\n element,\n box: element?.offsetWidth\n ? {\n left: element.offsetLeft || 0,\n top: element.offsetTop || 0,\n width: element.offsetWidth,\n height: element.offsetHeight || 0,\n }\n : null,\n };\n },\n write: (measured) => {\n const { element, box } = measured();\n\n this.observe(element);\n this.place(box);\n },\n });\n\n // The selected element can change its size without a new selection: when web fonts load,\n // when the container resizes, or when a hidden container (a collapsed pane) is shown.\n afterNextRender(() => {\n const view: (Window & typeof globalThis) | null =\n this.elementRef.nativeElement.ownerDocument.defaultView;\n\n if (view?.ResizeObserver) {\n this.resizeObserver = new view.ResizeObserver(() =>\n this.resized.update((value: number) => value + 1),\n );\n\n const container: HTMLElement | null = this.elementRef.nativeElement.parentElement;\n\n if (container) {\n this.resizeObserver.observe(container);\n }\n\n this.observe(this.selectionHost.selected());\n }\n });\n\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n this.resizeObserver?.disconnect();\n });\n }\n\n private observe(element?: HTMLElement): void {\n if (this.resizeObserver && element !== this.observed) {\n if (this.observed) {\n this.resizeObserver.unobserve(this.observed);\n }\n\n if (element) {\n this.resizeObserver.observe(element);\n }\n\n this.observed = element;\n }\n }\n\n private place(box: SelectionBox | null): void {\n const host: HTMLElement = this.elementRef.nativeElement;\n const style: CSSStyleDeclaration = host.style;\n\n // An element without a box (none selected, not rendered yet, or inside a hidden container)\n // cannot be measured. The highlight hides and is placed without animation once the element\n // has a box, instead of sliding in from a stale position.\n if (!box) {\n this.placements++;\n style.visibility = 'hidden';\n host.removeAttribute('data-ng-doc-placed');\n host.removeAttribute('data-ng-doc-animated');\n\n return;\n }\n\n // Width and height animate with the transform: scaling instead would distort the rounded\n // corners, the shadow and the border of the highlight. The highlight is absolutely positioned\n // and has no content, so resizing it lays out nothing else.\n style.transform = `translate(${box.left}px, ${box.top}px)`;\n style.width = `${box.width}px`;\n style.height = `${box.height}px`;\n style.visibility = 'visible';\n\n if (!host.hasAttribute('data-ng-doc-placed')) {\n host.setAttribute('data-ng-doc-placed', '');\n this.enableTransition();\n }\n }\n\n /**\n * Turns the transition on once the first position has been painted. Turning it on in the same\n * frame would animate the highlight from the corner of its container; reading the style to\n * commit the position instead would force a layout for every highlight on the page.\n */\n private enableTransition(): void {\n const host: HTMLElement = this.elementRef.nativeElement;\n const view: (Window & typeof globalThis) | null = host.ownerDocument.defaultView;\n const placement: number = ++this.placements;\n const enable = (): void => {\n if (!this.destroyed && placement === this.placements) {\n host.setAttribute('data-ng-doc-animated', '');\n }\n };\n\n if (view?.requestAnimationFrame) {\n // The first frame paints the position, the second one may animate from it.\n view.requestAnimationFrame(() => view.requestAnimationFrame(enable));\n } else {\n enable();\n }\n }\n}\n","import { DestroyRef, Directive, effect, ElementRef, inject, input } from '@angular/core';\n\nimport { NgDocSelectionHostDirective } from './selection-host.directive';\n\n/**\n * Element that the `ng-doc-selection` of the closest `ngDocSelectionHost` highlights while\n * `ngDocSelectionOrigin` is `true`.\n */\n@Directive({\n selector: '[ngDocSelectionOrigin]',\n})\nexport class NgDocSelectionOriginDirective {\n /** The host element. */\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly selectionHost = inject(NgDocSelectionHostDirective);\n\n /** Whether the element is selected. */\n readonly selected = input<boolean>(false, { alias: 'ngDocSelectionOrigin' });\n\n constructor() {\n effect(() => this.selectionHost.changeSelected(this, this.selected()));\n\n inject(DestroyRef).onDestroy(() => this.selectionHost.changeSelected(this, false));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAIA;;;AAGG;MAIU,2BAA2B,CAAA;AAHxC,IAAA,WAAA,GAAA;QAImB,IAAA,CAAA,eAAe,GAAG,MAAM,CAA0B,SAAS;4FAAC;;AAGpE,QAAA,IAAA,CAAA,QAAQ,GAAoC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE;AA6BvF,IAAA;AA3BC;;;;AAIG;IACH,cAAc,CAAC,MAAqC,EAAE,QAAiB,EAAA;;;QAGrE,SAAS,CAAC,MAAK;AACb,YAAA,MAAM,OAAO,GAAgB,MAAM,CAAC,UAAU,CAAC,aAAa;YAE5D,IAAI,QAAQ,EAAE;AACZ,gBAAA,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC;YACnC;AAAO,iBAAA,IAAI,IAAI,CAAC,eAAe,EAAE,KAAK,OAAO,EAAE;AAC7C,gBAAA,IAA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A,CAAA,orBAAA,CAAA,EAAA;;;ACrCH;;;AAGG;MAIU,6BAA6B,CAAA;AAQxC,IAAA,WAAA,GAAA;;AANS,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AAChD,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,2BAA2B,CAAC;;QAG3D,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,gFAAI,KAAK,EAAE,sBAAsB,EAAA,CAAG;AAG1E,QAAA,MAAM,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEtE,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACpF;8GAZW,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA7B,6BAA6B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,sBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAHzC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AACnC,iBAAA;;;ACVD;;AAEG;;;;"}
@@ -1,44 +1,45 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Output, Input, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { input, booleanAttribute, output, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
4
4
 
5
+ /**
6
+ * Layout with a side panel next to the projected content.
7
+ *
8
+ * At 900px and below the side panel becomes an overlay that slides in from the left; `opened`
9
+ * shows it and `closeEvent` asks the owner to hide it. The panel has the id `ng-doc-sidenav`, so a
10
+ * toggle button can point `aria-controls` at it.
11
+ */
5
12
  class NgDocSidenavComponent {
6
13
  constructor() {
7
14
  /**
8
15
  * Content of the sidenav.
9
16
  */
10
- this.sidebar = '';
17
+ this.sidebar = input('', /* @ts-ignore */
18
+ ...(ngDevMode ? [{ debugName: "sidebar" }] : /* istanbul ignore next */ []));
11
19
  /**
12
20
  * Indicates whether the sidenav is opened or not.
13
21
  * This is used to trigger the animation.
14
22
  */
15
- this.opened = true;
23
+ this.opened = input(true, { ...(ngDevMode ? { debugName: "opened" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
16
24
  /**
17
25
  * Indicates whether the sidenav has a backdrop or not.
18
26
  */
19
- this.hasBackdrop = true;
20
- this.closeEvent = new EventEmitter();
27
+ this.hasBackdrop = input(true, { ...(ngDevMode ? { debugName: "hasBackdrop" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
28
+ /**
29
+ * Emits when the backdrop is clicked, so the owner can close the sidenav.
30
+ */
31
+ this.closeEvent = output();
21
32
  }
22
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocSidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
23
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NgDocSidenavComponent, isStandalone: true, selector: "ng-doc-sidenav", inputs: { sidebar: "sidebar", opened: "opened", hasBackdrop: "hasBackdrop" }, outputs: { closeEvent: "closeEvent" }, host: { properties: { "attr.data-ng-doc-sidebar": "!!sidebar", "attr.data-ng-doc-opened": "this.opened" } }, ngImport: i0, template: "<div class=\"ng-doc-sidenav-wrapper\">\n <div class=\"ng-doc-sidenav\">\n <ng-container *polymorpheusOutlet=\"sidebar\"></ng-container>\n </div>\n <div class=\"ng-doc-sidenav-content\">\n @if (opened && hasBackdrop) {\n <div class=\"ng-doc-backdrop\" animate.enter=\"backdrop-enter\" (click)=\"closeEvent.emit()\"></div>\n }\n\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{width:100%}:host[data-ng-doc-sidebar=false] .ng-doc-sidenav-content{margin-left:0;width:100%}:host .ng-doc-sidenav-wrapper{position:relative;display:flex;width:100%}:host .ng-doc-sidenav{position:fixed;top:var(--ng-doc-navbar-height);width:var(--ng-doc-sidenav-width);flex-shrink:0;z-index:10;transition:left var(--ng-doc-transition)}:host .ng-doc-sidenav-content{margin-left:var(--ng-doc-sidenav-width);width:calc(100% - var(--ng-doc-sidenav-width));padding:var(--ng-doc-sidenav-content-padding);transition:margin-left var(--ng-doc-transition)}:host .ng-doc-backdrop:not(nothing){background:color-mix(in srgb,rgba(0,0,0,.2) 60%,transparent);backdrop-filter:blur(20px)}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host .ng-doc-backdrop{background-color:#0003}}:host .ng-doc-backdropnothing{background-color:#0003}:host .ng-doc-backdrop{position:fixed!important;left:0;top:0;width:100%;height:100%;z-index:9}@media(max-width:1024px){:host[data-ng-doc-opened=true] .ng-doc-sidenav{right:0;transition:right var(--ng-doc-transition);--ng-doc-sidebar-shadow: var(--ng-doc-shadow-color) -5px 5px 20px -5px}:host .ng-doc-sidenav{transition:unset;left:unset;right:calc(var(--ng-doc-sidenav-width) * -1);top:var(--ng-doc-navbar-height)}:host .ng-doc-sidenav-content{margin-left:0;width:100%}}:host .backdrop-enter{animation:ng-doc-backdrop-fade-in var(--ng-doc-transition) forwards}@keyframes ng-doc-backdrop-fade-in{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
33
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
34
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocSidenavComponent, isStandalone: true, selector: "ng-doc-sidenav", inputs: { sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: false, transformFunction: null }, opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeEvent: "closeEvent" }, host: { properties: { "attr.data-ng-doc-sidebar": "!!sidebar()", "attr.data-ng-doc-opened": "opened()" } }, ngImport: i0, template: "<div class=\"ng-doc-sidenav-wrapper\">\n <div class=\"ng-doc-sidenav\" id=\"ng-doc-sidenav\">\n <ng-container *polymorpheusOutlet=\"sidebar()\"></ng-container>\n </div>\n <div class=\"ng-doc-sidenav-content\">\n @if (opened() && hasBackdrop()) {\n <div class=\"ng-doc-backdrop\" animate.enter=\"backdrop-enter\" (click)=\"closeEvent.emit()\"></div>\n }\n\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{width:100%}:host[data-ng-doc-sidebar=false] .ng-doc-sidenav-content{margin-left:0;width:100%}:host .ng-doc-sidenav-wrapper{position:relative;display:flex;width:100%}:host .ng-doc-sidenav{position:fixed;top:var(--ng-doc-navbar-height);width:var(--ng-doc-sidenav-width);flex-shrink:0;z-index:10;transition:left var(--ng-doc-transition)}:host .ng-doc-sidenav-content{margin-left:var(--ng-doc-sidenav-width);width:calc(100% - var(--ng-doc-sidenav-width));padding:var(--ng-doc-sidenav-content-padding);transition:margin-left var(--ng-doc-transition)}:host .ng-doc-backdrop:not(nothing){background:color-mix(in srgb,rgba(0,0,0,.2) 60%,transparent);backdrop-filter:blur(20px)}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host .ng-doc-backdrop{background-color:#0003}}:host .ng-doc-backdropnothing{background-color:#0003}:host .ng-doc-backdrop{position:fixed!important;left:0;top:0;width:100%;height:100%;z-index:9}@media(max-width:900px){:host .ng-doc-sidenav{left:calc(var(--ng-doc-sidenav-width) * -1);max-width:100%;visibility:hidden;transition:left var(--ng-doc-transition),visibility var(--ng-doc-transition)}:host[data-ng-doc-opened=true] .ng-doc-sidenav{left:0;visibility:visible;--ng-doc-sidebar-shadow: var(--ng-doc-shadow-lg)}:host .ng-doc-sidenav-content{margin-left:0;width:100%}}@media(prefers-reduced-motion:reduce){:host .ng-doc-sidenav,:host .ng-doc-sidenav-content{transition:none}}:host .backdrop-enter{animation:ng-doc-backdrop-fade-in var(--ng-doc-transition) forwards}@keyframes ng-doc-backdrop-fade-in{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
24
35
  }
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocSidenavComponent, decorators: [{
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSidenavComponent, decorators: [{
26
37
  type: Component,
27
38
  args: [{ selector: 'ng-doc-sidenav', changeDetection: ChangeDetectionStrategy.OnPush, imports: [PolymorpheusOutlet], host: {
28
- '[attr.data-ng-doc-sidebar]': '!!sidebar',
29
- }, template: "<div class=\"ng-doc-sidenav-wrapper\">\n <div class=\"ng-doc-sidenav\">\n <ng-container *polymorpheusOutlet=\"sidebar\"></ng-container>\n </div>\n <div class=\"ng-doc-sidenav-content\">\n @if (opened && hasBackdrop) {\n <div class=\"ng-doc-backdrop\" animate.enter=\"backdrop-enter\" (click)=\"closeEvent.emit()\"></div>\n }\n\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{width:100%}:host[data-ng-doc-sidebar=false] .ng-doc-sidenav-content{margin-left:0;width:100%}:host .ng-doc-sidenav-wrapper{position:relative;display:flex;width:100%}:host .ng-doc-sidenav{position:fixed;top:var(--ng-doc-navbar-height);width:var(--ng-doc-sidenav-width);flex-shrink:0;z-index:10;transition:left var(--ng-doc-transition)}:host .ng-doc-sidenav-content{margin-left:var(--ng-doc-sidenav-width);width:calc(100% - var(--ng-doc-sidenav-width));padding:var(--ng-doc-sidenav-content-padding);transition:margin-left var(--ng-doc-transition)}:host .ng-doc-backdrop:not(nothing){background:color-mix(in srgb,rgba(0,0,0,.2) 60%,transparent);backdrop-filter:blur(20px)}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host .ng-doc-backdrop{background-color:#0003}}:host .ng-doc-backdropnothing{background-color:#0003}:host .ng-doc-backdrop{position:fixed!important;left:0;top:0;width:100%;height:100%;z-index:9}@media(max-width:1024px){:host[data-ng-doc-opened=true] .ng-doc-sidenav{right:0;transition:right var(--ng-doc-transition);--ng-doc-sidebar-shadow: var(--ng-doc-shadow-color) -5px 5px 20px -5px}:host .ng-doc-sidenav{transition:unset;left:unset;right:calc(var(--ng-doc-sidenav-width) * -1);top:var(--ng-doc-navbar-height)}:host .ng-doc-sidenav-content{margin-left:0;width:100%}}:host .backdrop-enter{animation:ng-doc-backdrop-fade-in var(--ng-doc-transition) forwards}@keyframes ng-doc-backdrop-fade-in{0%{opacity:0}to{opacity:1}}\n"] }]
30
- }], propDecorators: { sidebar: [{
31
- type: Input
32
- }], opened: [{
33
- type: Input
34
- }, {
35
- type: HostBinding,
36
- args: ['attr.data-ng-doc-opened']
37
- }], hasBackdrop: [{
38
- type: Input
39
- }], closeEvent: [{
40
- type: Output
41
- }] } });
39
+ '[attr.data-ng-doc-sidebar]': '!!sidebar()',
40
+ '[attr.data-ng-doc-opened]': 'opened()',
41
+ }, template: "<div class=\"ng-doc-sidenav-wrapper\">\n <div class=\"ng-doc-sidenav\" id=\"ng-doc-sidenav\">\n <ng-container *polymorpheusOutlet=\"sidebar()\"></ng-container>\n </div>\n <div class=\"ng-doc-sidenav-content\">\n @if (opened() && hasBackdrop()) {\n <div class=\"ng-doc-backdrop\" animate.enter=\"backdrop-enter\" (click)=\"closeEvent.emit()\"></div>\n }\n\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{width:100%}:host[data-ng-doc-sidebar=false] .ng-doc-sidenav-content{margin-left:0;width:100%}:host .ng-doc-sidenav-wrapper{position:relative;display:flex;width:100%}:host .ng-doc-sidenav{position:fixed;top:var(--ng-doc-navbar-height);width:var(--ng-doc-sidenav-width);flex-shrink:0;z-index:10;transition:left var(--ng-doc-transition)}:host .ng-doc-sidenav-content{margin-left:var(--ng-doc-sidenav-width);width:calc(100% - var(--ng-doc-sidenav-width));padding:var(--ng-doc-sidenav-content-padding);transition:margin-left var(--ng-doc-transition)}:host .ng-doc-backdrop:not(nothing){background:color-mix(in srgb,rgba(0,0,0,.2) 60%,transparent);backdrop-filter:blur(20px)}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host .ng-doc-backdrop{background-color:#0003}}:host .ng-doc-backdropnothing{background-color:#0003}:host .ng-doc-backdrop{position:fixed!important;left:0;top:0;width:100%;height:100%;z-index:9}@media(max-width:900px){:host .ng-doc-sidenav{left:calc(var(--ng-doc-sidenav-width) * -1);max-width:100%;visibility:hidden;transition:left var(--ng-doc-transition),visibility var(--ng-doc-transition)}:host[data-ng-doc-opened=true] .ng-doc-sidenav{left:0;visibility:visible;--ng-doc-sidebar-shadow: var(--ng-doc-shadow-lg)}:host .ng-doc-sidenav-content{margin-left:0;width:100%}}@media(prefers-reduced-motion:reduce){:host .ng-doc-sidenav,:host .ng-doc-sidenav-content{transition:none}}:host .backdrop-enter{animation:ng-doc-backdrop-fade-in var(--ng-doc-transition) forwards}@keyframes ng-doc-backdrop-fade-in{0%{opacity:0}to{opacity:1}}\n"] }]
42
+ }], propDecorators: { sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: false }] }], opened: [{ type: i0.Input, args: [{ isSignal: true, alias: "opened", required: false }] }], hasBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasBackdrop", required: false }] }], closeEvent: [{ type: i0.Output, args: ["closeEvent"] }] } });
42
43
 
43
44
  /**
44
45
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-ui-kit-components-sidenav.mjs","sources":["../../../../libs/ui-kit/components/sidenav/sidenav.component.ts","../../../../libs/ui-kit/components/sidenav/sidenav.component.html","../../../../libs/ui-kit/components/sidenav/ng-doc-ui-kit-components-sidenav.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n Input,\n Output,\n} from '@angular/core';\nimport { NgDocContent } from '@ng-doc/ui-kit/types';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\n\n@Component({\n selector: 'ng-doc-sidenav',\n templateUrl: './sidenav.component.html',\n styleUrls: ['./sidenav.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [PolymorpheusOutlet],\n host: {\n '[attr.data-ng-doc-sidebar]': '!!sidebar',\n },\n})\nexport class NgDocSidenavComponent {\n /**\n * Content of the sidenav.\n */\n @Input()\n sidebar: NgDocContent = '';\n\n /**\n * Indicates whether the sidenav is opened or not.\n * This is used to trigger the animation.\n */\n @Input()\n @HostBinding('attr.data-ng-doc-opened')\n opened: boolean = true;\n\n /**\n * Indicates whether the sidenav has a backdrop or not.\n */\n @Input()\n hasBackdrop: boolean = true;\n\n @Output()\n closeEvent: EventEmitter<void> = new EventEmitter<void>();\n}\n","<div class=\"ng-doc-sidenav-wrapper\">\n <div class=\"ng-doc-sidenav\">\n <ng-container *polymorpheusOutlet=\"sidebar\"></ng-container>\n </div>\n <div class=\"ng-doc-sidenav-content\">\n @if (opened && hasBackdrop) {\n <div class=\"ng-doc-backdrop\" animate.enter=\"backdrop-enter\" (click)=\"closeEvent.emit()\"></div>\n }\n\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":";;;;MAqBa,qBAAqB,CAAA;AAVlC,IAAA,WAAA,GAAA;AAWE;;AAEG;QAEH,IAAA,CAAA,OAAO,GAAiB,EAAE;AAE1B;;;AAGG;QAGH,IAAA,CAAA,MAAM,GAAY,IAAI;AAEtB;;AAEG;QAEH,IAAA,CAAA,WAAW,GAAY,IAAI;AAG3B,QAAA,IAAA,CAAA,UAAU,GAAuB,IAAI,YAAY,EAAQ;AAC1D,IAAA;8GAvBY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,0BAAA,EAAA,WAAA,EAAA,yBAAA,EAAA,aAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECrBlC,4YAYA,EAAA,MAAA,EAAA,CAAA,o8CAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDIY,kBAAkB,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,oBAAA,EAAA,2BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKjB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAVjC,SAAS;+BACE,gBAAgB,EAAA,eAAA,EAGT,uBAAuB,CAAC,MAAM,WACtC,CAAC,kBAAkB,CAAC,EAAA,IAAA,EACvB;AACJ,wBAAA,4BAA4B,EAAE,WAAW;AAC1C,qBAAA,EAAA,QAAA,EAAA,4YAAA,EAAA,MAAA,EAAA,CAAA,o8CAAA,CAAA,EAAA;;sBAMA;;sBAOA;;sBACA,WAAW;uBAAC,yBAAyB;;sBAMrC;;sBAGA;;;AE1CH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-ui-kit-components-sidenav.mjs","sources":["../../../../libs/ui-kit/components/sidenav/sidenav.component.ts","../../../../libs/ui-kit/components/sidenav/sidenav.component.html","../../../../libs/ui-kit/components/sidenav/ng-doc-ui-kit-components-sidenav.ts"],"sourcesContent":["import { booleanAttribute, ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { NgDocContent } from '@ng-doc/ui-kit/types';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\n\n/**\n * Layout with a side panel next to the projected content.\n *\n * At 900px and below the side panel becomes an overlay that slides in from the left; `opened`\n * shows it and `closeEvent` asks the owner to hide it. The panel has the id `ng-doc-sidenav`, so a\n * toggle button can point `aria-controls` at it.\n */\n@Component({\n selector: 'ng-doc-sidenav',\n templateUrl: './sidenav.component.html',\n styleUrls: ['./sidenav.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [PolymorpheusOutlet],\n host: {\n '[attr.data-ng-doc-sidebar]': '!!sidebar()',\n '[attr.data-ng-doc-opened]': 'opened()',\n },\n})\nexport class NgDocSidenavComponent {\n /**\n * Content of the sidenav.\n */\n readonly sidebar = input<NgDocContent>('');\n\n /**\n * Indicates whether the sidenav is opened or not.\n * This is used to trigger the animation.\n */\n readonly opened = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n /**\n * Indicates whether the sidenav has a backdrop or not.\n */\n readonly hasBackdrop = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n /**\n * Emits when the backdrop is clicked, so the owner can close the sidenav.\n */\n readonly closeEvent = output<void>();\n}\n","<div class=\"ng-doc-sidenav-wrapper\">\n <div class=\"ng-doc-sidenav\" id=\"ng-doc-sidenav\">\n <ng-container *polymorpheusOutlet=\"sidebar()\"></ng-container>\n </div>\n <div class=\"ng-doc-sidenav-content\">\n @if (opened() && hasBackdrop()) {\n <div class=\"ng-doc-backdrop\" animate.enter=\"backdrop-enter\" (click)=\"closeEvent.emit()\"></div>\n }\n\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":";;;;AAIA;;;;;;AAMG;MAYU,qBAAqB,CAAA;AAXlC,IAAA,WAAA,GAAA;AAYE;;AAEG;QACM,IAAA,CAAA,OAAO,GAAG,KAAK,CAAe,EAAE;oFAAC;AAE1C;;;AAGG;QACM,IAAA,CAAA,MAAM,GAAG,KAAK,CAAmB,IAAI,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEhF;;AAEG;QACM,IAAA,CAAA,WAAW,GAAG,KAAK,CAAmB,IAAI,mFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAErF;;AAEG;QACM,IAAA,CAAA,UAAU,GAAG,MAAM,EAAQ;AACrC,IAAA;8GArBY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,0BAAA,EAAA,aAAA,EAAA,yBAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECtBlC,waAYA,EAAA,MAAA,EAAA,CAAA,ijDAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDIY,kBAAkB,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,oBAAA,EAAA,2BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAMjB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAXjC,SAAS;+BACE,gBAAgB,EAAA,eAAA,EAGT,uBAAuB,CAAC,MAAM,WACtC,CAAC,kBAAkB,CAAC,EAAA,IAAA,EACvB;AACJ,wBAAA,4BAA4B,EAAE,aAAa;AAC3C,wBAAA,2BAA2B,EAAE,UAAU;AACxC,qBAAA,EAAA,QAAA,EAAA,waAAA,EAAA,MAAA,EAAA,CAAA,ijDAAA,CAAA,EAAA;;;AEpBH;;AAEG;;;;"}
@@ -1,22 +1,24 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Input, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { input, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
 
4
+ /**
5
+ * Circular loading indicator.
6
+ */
4
7
  class NgDocSpinnerComponent {
5
8
  constructor() {
6
- this.size = 'medium';
9
+ /** Spinner size */
10
+ this.size = input('medium', /* @ts-ignore */
11
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
7
12
  }
8
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
9
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: NgDocSpinnerComponent, isStandalone: true, selector: "ng-doc-spinner", inputs: { size: "size" }, host: { properties: { "attr.data-ng-doc-size": "this.size" } }, ngImport: i0, template: "<svg class=\"ng-doc-spinner\" viewBox=\"0 0 50 50\">\n\t<circle class=\"ng-doc-spinner-path\" cx=\"25\" cy=\"25\" r=\"20\" fill=\"none\" stroke-width=\"5\"></circle>\n</svg>\n", styles: [":host{display:inline-block}:host[data-ng-doc-size=small]{width:calc(var(--ng-doc-base-gutter) * 3);height:calc(var(--ng-doc-base-gutter) * 3)}:host[data-ng-doc-size=medium]{width:calc(var(--ng-doc-base-gutter) * 5);height:calc(var(--ng-doc-base-gutter) * 5)}:host[data-ng-doc-size=large]{width:calc(var(--ng-doc-base-gutter) * 8);height:calc(var(--ng-doc-base-gutter) * 8)}:host .ng-doc-spinner{animation:rotate 2s linear infinite}:host .ng-doc-spinner .ng-doc-spinner-path{stroke:var(--ng-doc-spinner-color, var(--ng-doc-primary));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
13
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
14
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.1", type: NgDocSpinnerComponent, isStandalone: true, selector: "ng-doc-spinner", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-ng-doc-size": "size()" } }, ngImport: i0, template: "<svg class=\"ng-doc-spinner\" viewBox=\"0 0 50 50\">\n\t<circle class=\"ng-doc-spinner-path\" cx=\"25\" cy=\"25\" r=\"20\" fill=\"none\" stroke-width=\"5\"></circle>\n</svg>\n", styles: [":host{display:inline-block}:host[data-ng-doc-size=small]{width:calc(var(--ng-doc-base-gutter) * 3);height:calc(var(--ng-doc-base-gutter) * 3)}:host[data-ng-doc-size=medium]{width:calc(var(--ng-doc-base-gutter) * 5);height:calc(var(--ng-doc-base-gutter) * 5)}:host[data-ng-doc-size=large]{width:calc(var(--ng-doc-base-gutter) * 8);height:calc(var(--ng-doc-base-gutter) * 8)}:host .ng-doc-spinner{animation:rotate 2s linear infinite}:host .ng-doc-spinner .ng-doc-spinner-path{stroke:var(--ng-doc-spinner-color, var(--ng-doc-primary));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10
15
  }
11
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocSpinnerComponent, decorators: [{
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSpinnerComponent, decorators: [{
12
17
  type: Component,
13
- args: [{ selector: 'ng-doc-spinner', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<svg class=\"ng-doc-spinner\" viewBox=\"0 0 50 50\">\n\t<circle class=\"ng-doc-spinner-path\" cx=\"25\" cy=\"25\" r=\"20\" fill=\"none\" stroke-width=\"5\"></circle>\n</svg>\n", styles: [":host{display:inline-block}:host[data-ng-doc-size=small]{width:calc(var(--ng-doc-base-gutter) * 3);height:calc(var(--ng-doc-base-gutter) * 3)}:host[data-ng-doc-size=medium]{width:calc(var(--ng-doc-base-gutter) * 5);height:calc(var(--ng-doc-base-gutter) * 5)}:host[data-ng-doc-size=large]{width:calc(var(--ng-doc-base-gutter) * 8);height:calc(var(--ng-doc-base-gutter) * 8)}:host .ng-doc-spinner{animation:rotate 2s linear infinite}:host .ng-doc-spinner .ng-doc-spinner-path{stroke:var(--ng-doc-spinner-color, var(--ng-doc-primary));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}\n"] }]
14
- }], propDecorators: { size: [{
15
- type: Input
16
- }, {
17
- type: HostBinding,
18
- args: ['attr.data-ng-doc-size']
19
- }] } });
18
+ args: [{ selector: 'ng-doc-spinner', changeDetection: ChangeDetectionStrategy.OnPush, host: {
19
+ '[attr.data-ng-doc-size]': 'size()',
20
+ }, template: "<svg class=\"ng-doc-spinner\" viewBox=\"0 0 50 50\">\n\t<circle class=\"ng-doc-spinner-path\" cx=\"25\" cy=\"25\" r=\"20\" fill=\"none\" stroke-width=\"5\"></circle>\n</svg>\n", styles: [":host{display:inline-block}:host[data-ng-doc-size=small]{width:calc(var(--ng-doc-base-gutter) * 3);height:calc(var(--ng-doc-base-gutter) * 3)}:host[data-ng-doc-size=medium]{width:calc(var(--ng-doc-base-gutter) * 5);height:calc(var(--ng-doc-base-gutter) * 5)}:host[data-ng-doc-size=large]{width:calc(var(--ng-doc-base-gutter) * 8);height:calc(var(--ng-doc-base-gutter) * 8)}:host .ng-doc-spinner{animation:rotate 2s linear infinite}:host .ng-doc-spinner .ng-doc-spinner-path{stroke:var(--ng-doc-spinner-color, var(--ng-doc-primary));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}\n"] }]
21
+ }], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
20
22
 
21
23
  /**
22
24
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-ui-kit-components-spinner.mjs","sources":["../../../../libs/ui-kit/components/spinner/spinner.component.ts","../../../../libs/ui-kit/components/spinner/spinner.component.html","../../../../libs/ui-kit/components/spinner/ng-doc-ui-kit-components-spinner.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, HostBinding, Input } from '@angular/core';\nimport { NgDocSize } from '@ng-doc/ui-kit/types';\n\n@Component({\n\tselector: 'ng-doc-spinner',\n\ttemplateUrl: './spinner.component.html',\n\tstyleUrls: ['./spinner.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n})\nexport class NgDocSpinnerComponent {\n\t@Input()\n\t@HostBinding('attr.data-ng-doc-size')\n\tsize: NgDocSize = 'medium';\n}\n","<svg class=\"ng-doc-spinner\" viewBox=\"0 0 50 50\">\n\t<circle class=\"ng-doc-spinner-path\" cx=\"25\" cy=\"25\" r=\"20\" fill=\"none\" stroke-width=\"5\"></circle>\n</svg>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAUa,qBAAqB,CAAA;AAPlC,IAAA,WAAA,GAAA;QAUC,IAAA,CAAA,IAAI,GAAc,QAAQ;AAC1B,IAAA;8GAJY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,oKCVlC,iLAGA,EAAA,MAAA,EAAA,CAAA,wyBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDOa,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,eAAA,EAGT,uBAAuB,CAAC,MAAM,cACnC,IAAI,EAAA,QAAA,EAAA,iLAAA,EAAA,MAAA,EAAA,CAAA,wyBAAA,CAAA,EAAA;;sBAGf;;sBACA,WAAW;uBAAC,uBAAuB;;;AEZrC;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-ui-kit-components-spinner.mjs","sources":["../../../../libs/ui-kit/components/spinner/spinner.component.ts","../../../../libs/ui-kit/components/spinner/spinner.component.html","../../../../libs/ui-kit/components/spinner/ng-doc-ui-kit-components-spinner.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { NgDocSize } from '@ng-doc/ui-kit/types';\n\n/**\n * Circular loading indicator.\n */\n@Component({\n selector: 'ng-doc-spinner',\n templateUrl: './spinner.component.html',\n styleUrls: ['./spinner.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-ng-doc-size]': 'size()',\n },\n})\nexport class NgDocSpinnerComponent {\n /** Spinner size */\n readonly size = input<NgDocSize>('medium');\n}\n","<svg class=\"ng-doc-spinner\" viewBox=\"0 0 50 50\">\n\t<circle class=\"ng-doc-spinner-path\" cx=\"25\" cy=\"25\" r=\"20\" fill=\"none\" stroke-width=\"5\"></circle>\n</svg>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAGA;;AAEG;MAUU,qBAAqB,CAAA;AATlC,IAAA,WAAA,GAAA;;QAWW,IAAA,CAAA,IAAI,GAAG,KAAK,CAAY,QAAQ;iFAAC;AAC3C,IAAA;8GAHY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,wQCflC,iLAGA,EAAA,MAAA,EAAA,CAAA,wyBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDYa,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBATjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,eAAA,EAGT,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,yBAAyB,EAAE,QAAQ;AACpC,qBAAA,EAAA,QAAA,EAAA,iLAAA,EAAA,MAAA,EAAA,CAAA,wyBAAA,CAAA,EAAA;;;AEbH;;AAEG;;;;"}