@ng-doc/app 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 (205) hide show
  1. package/README.md +20 -29
  2. package/fesm2022/ng-doc-app-classes-content-anchor-controller.mjs +363 -0
  3. package/fesm2022/ng-doc-app-classes-content-anchor-controller.mjs.map +1 -0
  4. package/fesm2022/ng-doc-app-classes-content-controller.mjs +299 -0
  5. package/fesm2022/ng-doc-app-classes-content-controller.mjs.map +1 -0
  6. package/fesm2022/ng-doc-app-classes-default-search-engine.mjs +51 -35
  7. package/fesm2022/ng-doc-app-classes-default-search-engine.mjs.map +1 -1
  8. package/fesm2022/ng-doc-app-classes-root-page.mjs.map +1 -1
  9. package/fesm2022/ng-doc-app-classes-search-engine.mjs.map +1 -1
  10. package/fesm2022/ng-doc-app-classes.mjs +2 -0
  11. package/fesm2022/ng-doc-app-classes.mjs.map +1 -1
  12. package/fesm2022/ng-doc-app-components-api-list.mjs +178 -68
  13. package/fesm2022/ng-doc-app-components-api-list.mjs.map +1 -1
  14. package/fesm2022/ng-doc-app-components-breadcrumb.mjs +13 -10
  15. package/fesm2022/ng-doc-app-components-breadcrumb.mjs.map +1 -1
  16. package/fesm2022/ng-doc-app-components-code.mjs +152 -25
  17. package/fesm2022/ng-doc-app-components-code.mjs.map +1 -1
  18. package/fesm2022/ng-doc-app-components-command-palette.mjs +498 -0
  19. package/fesm2022/ng-doc-app-components-command-palette.mjs.map +1 -0
  20. package/fesm2022/ng-doc-app-components-copy-button.mjs +38 -21
  21. package/fesm2022/ng-doc-app-components-copy-button.mjs.map +1 -1
  22. package/fesm2022/ng-doc-app-components-demo-displayer.mjs +36 -29
  23. package/fesm2022/ng-doc-app-components-demo-displayer.mjs.map +1 -1
  24. package/fesm2022/ng-doc-app-components-demo-pane.mjs +39 -36
  25. package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
  26. package/fesm2022/ng-doc-app-components-demo.mjs +129 -44
  27. package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
  28. package/fesm2022/ng-doc-app-components-fullscreen-button.mjs +12 -9
  29. package/fesm2022/ng-doc-app-components-fullscreen-button.mjs.map +1 -1
  30. package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs +79 -0
  31. package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs.map +1 -0
  32. package/fesm2022/ng-doc-app-components-heading-anchor.mjs +54 -21
  33. package/fesm2022/ng-doc-app-components-heading-anchor.mjs.map +1 -1
  34. package/fesm2022/ng-doc-app-components-image-viewer.mjs +187 -91
  35. package/fesm2022/ng-doc-app-components-image-viewer.mjs.map +1 -1
  36. package/fesm2022/ng-doc-app-components-kind-icon.mjs +42 -25
  37. package/fesm2022/ng-doc-app-components-kind-icon.mjs.map +1 -1
  38. package/fesm2022/ng-doc-app-components-link.mjs +12 -9
  39. package/fesm2022/ng-doc-app-components-link.mjs.map +1 -1
  40. package/fesm2022/ng-doc-app-components-members.mjs +30 -0
  41. package/fesm2022/ng-doc-app-components-members.mjs.map +1 -0
  42. package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs +69 -24
  43. package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs.map +1 -1
  44. package/fesm2022/ng-doc-app-components-navbar.mjs +39 -49
  45. package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
  46. package/fesm2022/ng-doc-app-components-page-header.mjs +73 -10
  47. package/fesm2022/ng-doc-app-components-page-header.mjs.map +1 -1
  48. package/fesm2022/ng-doc-app-components-page-link.mjs +123 -31
  49. package/fesm2022/ng-doc-app-components-page-link.mjs.map +1 -1
  50. package/fesm2022/ng-doc-app-components-page-navigation.mjs +17 -19
  51. package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -1
  52. package/fesm2022/ng-doc-app-components-page-wrapper.mjs +56 -35
  53. package/fesm2022/ng-doc-app-components-page-wrapper.mjs.map +1 -1
  54. package/fesm2022/ng-doc-app-components-page.mjs +168 -24
  55. package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
  56. package/fesm2022/ng-doc-app-components-playground.mjs +392 -263
  57. package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
  58. package/fesm2022/ng-doc-app-components-root.mjs +48 -31
  59. package/fesm2022/ng-doc-app-components-root.mjs.map +1 -1
  60. package/fesm2022/ng-doc-app-components-search-result.mjs +22 -21
  61. package/fesm2022/ng-doc-app-components-search-result.mjs.map +1 -1
  62. package/fesm2022/ng-doc-app-components-search.mjs +64 -33
  63. package/fesm2022/ng-doc-app-components-search.mjs.map +1 -1
  64. package/fesm2022/ng-doc-app-components-sidebar.mjs +90 -63
  65. package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
  66. package/fesm2022/ng-doc-app-components-tabs.mjs +18 -12
  67. package/fesm2022/ng-doc-app-components-tabs.mjs.map +1 -1
  68. package/fesm2022/ng-doc-app-components-theme-toggle.mjs +33 -21
  69. package/fesm2022/ng-doc-app-components-theme-toggle.mjs.map +1 -1
  70. package/fesm2022/ng-doc-app-components-toc.mjs +268 -90
  71. package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
  72. package/fesm2022/ng-doc-app-components.mjs +3 -1
  73. package/fesm2022/ng-doc-app-components.mjs.map +1 -1
  74. package/fesm2022/ng-doc-app-defaults-default-processors.mjs +2 -1
  75. package/fesm2022/ng-doc-app-defaults-default-processors.mjs.map +1 -1
  76. package/fesm2022/ng-doc-app-directives-code-highlighter.mjs +14 -7
  77. package/fesm2022/ng-doc-app-directives-code-highlighter.mjs.map +1 -1
  78. package/fesm2022/ng-doc-app-directives-members-filter.mjs +276 -0
  79. package/fesm2022/ng-doc-app-directives-members-filter.mjs.map +1 -0
  80. package/fesm2022/ng-doc-app-directives-route-active.mjs +34 -30
  81. package/fesm2022/ng-doc-app-directives-route-active.mjs.map +1 -1
  82. package/fesm2022/ng-doc-app-directives.mjs +1 -0
  83. package/fesm2022/ng-doc-app-directives.mjs.map +1 -1
  84. package/fesm2022/ng-doc-app-helpers.mjs +285 -1
  85. package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
  86. package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs +6 -4
  87. package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs.map +1 -1
  88. package/fesm2022/ng-doc-app-pipes-extract-value.mjs +6 -4
  89. package/fesm2022/ng-doc-app-pipes-extract-value.mjs.map +1 -1
  90. package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs +7 -4
  91. package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs.map +1 -1
  92. package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs +8 -5
  93. package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs.map +1 -1
  94. package/fesm2022/ng-doc-app-processors-page-processor.mjs +86 -23
  95. package/fesm2022/ng-doc-app-processors-page-processor.mjs.map +1 -1
  96. package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs +26 -25
  97. package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs.map +1 -1
  98. package/fesm2022/ng-doc-app-processors-processors.mjs +12 -1
  99. package/fesm2022/ng-doc-app-processors-processors.mjs.map +1 -1
  100. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs +31 -2
  101. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
  102. package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs +122 -0
  103. package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs.map +1 -0
  104. package/fesm2022/ng-doc-app-services-content-state.mjs +57 -0
  105. package/fesm2022/ng-doc-app-services-content-state.mjs.map +1 -0
  106. package/fesm2022/ng-doc-app-services-fullscreen-route.mjs +74 -0
  107. package/fesm2022/ng-doc-app-services-fullscreen-route.mjs.map +1 -0
  108. package/fesm2022/ng-doc-app-services-highlighter.mjs +83 -14
  109. package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
  110. package/fesm2022/ng-doc-app-services-route-preloader.mjs +360 -0
  111. package/fesm2022/ng-doc-app-services-route-preloader.mjs.map +1 -0
  112. package/fesm2022/ng-doc-app-services-shortcuts.mjs +214 -0
  113. package/fesm2022/ng-doc-app-services-shortcuts.mjs.map +1 -0
  114. package/fesm2022/ng-doc-app-services-sidebar.mjs +59 -25
  115. package/fesm2022/ng-doc-app-services-sidebar.mjs.map +1 -1
  116. package/fesm2022/ng-doc-app-services-store.mjs +8 -8
  117. package/fesm2022/ng-doc-app-services-store.mjs.map +1 -1
  118. package/fesm2022/ng-doc-app-services-theme.mjs +32 -12
  119. package/fesm2022/ng-doc-app-services-theme.mjs.map +1 -1
  120. package/fesm2022/ng-doc-app-services.mjs +143 -0
  121. package/fesm2022/ng-doc-app-services.mjs.map +1 -1
  122. package/fesm2022/ng-doc-app-tokens.mjs +7 -28
  123. package/fesm2022/ng-doc-app-tokens.mjs.map +1 -1
  124. package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs +18 -9
  125. package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs.map +1 -1
  126. package/fesm2022/ng-doc-app-type-controls-number-control.mjs +12 -9
  127. package/fesm2022/ng-doc-app-type-controls-number-control.mjs.map +1 -1
  128. package/fesm2022/ng-doc-app-type-controls-string-control.mjs +12 -9
  129. package/fesm2022/ng-doc-app-type-controls-string-control.mjs.map +1 -1
  130. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +22 -16
  131. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
  132. package/package.json +74 -32
  133. package/styles/global.css +1129 -205
  134. package/styles/main.css +1129 -205
  135. package/styles/themes/dark.css +78 -56
  136. package/types/ng-doc-app-classes-content-anchor-controller.d.ts +54 -0
  137. package/types/ng-doc-app-classes-content-controller.d.ts +94 -0
  138. package/types/ng-doc-app-classes-default-search-engine.d.ts +9 -1
  139. package/types/ng-doc-app-classes-root-page.d.ts +6 -1
  140. package/types/ng-doc-app-classes-search-engine.d.ts +5 -0
  141. package/types/ng-doc-app-classes.d.ts +2 -0
  142. package/types/ng-doc-app-components-api-list.d.ts +69 -20
  143. package/types/ng-doc-app-components-breadcrumb.d.ts +8 -3
  144. package/types/ng-doc-app-components-code.d.ts +46 -12
  145. package/types/ng-doc-app-components-command-palette.d.ts +147 -0
  146. package/types/ng-doc-app-components-copy-button.d.ts +18 -6
  147. package/types/ng-doc-app-components-demo-displayer.d.ts +23 -10
  148. package/types/ng-doc-app-components-demo-pane.d.ts +19 -15
  149. package/types/ng-doc-app-components-demo.d.ts +62 -15
  150. package/types/ng-doc-app-components-fullscreen-button.d.ts +4 -2
  151. package/types/ng-doc-app-components-fullscreen-toggle.d.ts +24 -0
  152. package/types/ng-doc-app-components-heading-anchor.d.ts +26 -7
  153. package/types/ng-doc-app-components-image-viewer.d.ts +71 -7
  154. package/types/ng-doc-app-components-kind-icon.d.ts +28 -7
  155. package/types/ng-doc-app-components-link.d.ts +6 -2
  156. package/types/ng-doc-app-components-members.d.ts +13 -0
  157. package/types/ng-doc-app-components-mermaid-viewer.d.ts +21 -6
  158. package/types/ng-doc-app-components-navbar.d.ts +25 -15
  159. package/types/ng-doc-app-components-page-header.d.ts +28 -4
  160. package/types/ng-doc-app-components-page-link.d.ts +34 -15
  161. package/types/ng-doc-app-components-page-navigation.d.ts +10 -5
  162. package/types/ng-doc-app-components-page-wrapper.d.ts +35 -11
  163. package/types/ng-doc-app-components-page.d.ts +57 -6
  164. package/types/ng-doc-app-components-playground.d.ts +146 -78
  165. package/types/ng-doc-app-components-root.d.ts +28 -7
  166. package/types/ng-doc-app-components-search-result.d.ts +14 -6
  167. package/types/ng-doc-app-components-search.d.ts +19 -7
  168. package/types/ng-doc-app-components-tabs.d.ts +13 -4
  169. package/types/ng-doc-app-components-theme-toggle.d.ts +18 -5
  170. package/types/ng-doc-app-components-toc.d.ts +76 -29
  171. package/types/ng-doc-app-components.d.ts +3 -1
  172. package/types/ng-doc-app-directives-code-highlighter.d.ts +8 -4
  173. package/types/ng-doc-app-directives-members-filter.d.ts +61 -0
  174. package/types/ng-doc-app-directives-route-active.d.ts +21 -7
  175. package/types/ng-doc-app-directives.d.ts +1 -0
  176. package/types/ng-doc-app-helpers.d.ts +124 -3
  177. package/types/ng-doc-app-interfaces.d.ts +48 -28
  178. package/types/ng-doc-app-pipes-decode-uri-component.d.ts +3 -0
  179. package/types/ng-doc-app-pipes-extract-value.d.ts +3 -0
  180. package/types/ng-doc-app-pipes-filter-by-text.d.ts +4 -0
  181. package/types/ng-doc-app-pipes-sanitize-html.d.ts +4 -2
  182. package/types/ng-doc-app-processors-page-processor.d.ts +39 -10
  183. package/types/ng-doc-app-processors-processors-tooltip.d.ts +11 -10
  184. package/types/ng-doc-app-processors-processors.d.ts +5 -1
  185. package/types/ng-doc-app-providers-ng-doc-app.d.ts +17 -0
  186. package/types/ng-doc-app-providers-playground-demo.d.ts +1 -1
  187. package/types/ng-doc-app-providers-type-control.d.ts +2 -2
  188. package/types/ng-doc-app-services-content-scroll-intent.d.ts +52 -0
  189. package/types/ng-doc-app-services-content-state.d.ts +40 -0
  190. package/types/ng-doc-app-services-fullscreen-route.d.ts +35 -0
  191. package/types/ng-doc-app-services-highlighter.d.ts +40 -5
  192. package/types/ng-doc-app-services-route-preloader.d.ts +109 -0
  193. package/types/ng-doc-app-services-shortcuts.d.ts +96 -0
  194. package/types/ng-doc-app-services-sidebar.d.ts +24 -4
  195. package/types/ng-doc-app-services-store.d.ts +24 -1
  196. package/types/ng-doc-app-services-theme.d.ts +19 -3
  197. package/types/ng-doc-app-services.d.ts +77 -0
  198. package/types/ng-doc-app-tokens.d.ts +10 -30
  199. package/types/ng-doc-app-type-controls-boolean-control.d.ts +11 -6
  200. package/types/ng-doc-app-type-controls-number-control.d.ts +5 -3
  201. package/types/ng-doc-app-type-controls-string-control.d.ts +5 -3
  202. package/types/ng-doc-app-type-controls-type-alias-control.d.ts +13 -6
  203. package/fesm2022/ng-doc-app-components-search-dialog.mjs +0 -78
  204. package/fesm2022/ng-doc-app-components-search-dialog.mjs.map +0 -1
  205. package/types/ng-doc-app-components-search-dialog.d.ts +0 -28
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-components-sidebar.mjs","sources":["../../../../libs/app/components/sidebar/sidebar-category/sidebar-category.component.ts","../../../../libs/app/components/sidebar/sidebar-category/sidebar-category.component.html","../../../../libs/app/components/sidebar/sidebar-item/sidebar-item.component.ts","../../../../libs/app/components/sidebar/sidebar-item/sidebar-item.component.html","../../../../libs/app/components/sidebar/sidebar.component.ts","../../../../libs/app/components/sidebar/sidebar.component.html","../../../../libs/app/components/sidebar/ng-doc-app-components-sidebar.ts"],"sourcesContent":["import { Location } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n HostBinding,\n inject,\n Input,\n} from '@angular/core';\nimport { NgDocRouteActiveDirective } from '@ng-doc/app/directives/route-active';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport {\n NgDocContent,\n NgDocDotComponent,\n NgDocExpanderComponent,\n NgDocIconComponent,\n NgDocRotatorDirective,\n NgDocTextComponent,\n NgDocTextLeftDirective,\n} from '@ng-doc/ui-kit';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\n\n@Component({\n selector: 'ng-doc-sidebar-category',\n templateUrl: './sidebar-category.component.html',\n styleUrls: ['./sidebar-category.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgDocRouteActiveDirective,\n NgDocDotComponent,\n NgDocTextComponent,\n NgDocIconComponent,\n NgDocTextLeftDirective,\n NgDocRotatorDirective,\n NgDocExpanderComponent,\n PolymorpheusOutlet,\n ],\n})\nexport class NgDocSidebarCategoryComponent {\n @Input({ required: true })\n category!: NgDocNavigation;\n\n @Input()\n @HostBinding('attr.data-ng-doc-is-root')\n isRoot: boolean = false;\n\n @Input()\n content: NgDocContent = '';\n\n @Input()\n @HostBinding('attr.data-ng-doc-expandable')\n expandable: boolean = true;\n\n @Input()\n expanded: boolean = true;\n\n protected readonly location = inject(Location);\n protected readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n constructor() {\n this.location.onUrlChange(() => {\n if (this.location.path().includes(this.category.route ?? '', 0)) {\n this.expand();\n }\n });\n }\n\n toggle(): void {\n this.expanded ? this.collapse() : this.expand();\n }\n\n expand(): void {\n if (this.category?.expandable) {\n this.expanded = true;\n this.changeDetectorRef.markForCheck();\n }\n }\n\n collapse(): void {\n if (this.category?.expandable) {\n this.expanded = false;\n this.changeDetectorRef.markForCheck();\n }\n }\n}\n","<div class=\"ng-doc-sidebar-category-wrapper\">\n <button class=\"ng-doc-sidebar-category-button\" (click)=\"toggle()\">\n <div class=\"ng-doc-sidebar-category\" [ngDocRouteActive]=\"category.route\" activeClass=\"active\">\n @if (!expandable) {\n <ng-doc-dot></ng-doc-dot>\n }\n <span ng-doc-text>\n @if (category.expandable) {\n <ng-doc-icon icon=\"chevron-right\" [ngDocRotator]=\"expanded\" ngDocTextLeft> </ng-doc-icon>\n }\n {{ category.title }}\n </span>\n </div>\n <!--\t\t<div ng-doc-text color=\"muted\" size=\"small\">Some description</div>-->\n </button>\n <ng-doc-expander [expanded]=\"expanded\" [content]=\"contentTemplate\" collapseMod=\"hide\" />\n <ng-template #contentTemplate>\n <div class=\"ng-doc-sidebar-category-children\">\n <!--We wrap content via ng-template to save state of the child components -->\n <ng-content></ng-content>\n <ng-container *polymorpheusOutlet=\"content as text\">{{ text }}</ng-container>\n </div>\n </ng-template>\n</div>\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport {\n NgDocColor,\n NgDocDotComponent,\n NgDocTagComponent,\n NgDocTextComponent,\n} from '@ng-doc/ui-kit';\n\n@Component({\n selector: 'ng-doc-sidebar-item',\n templateUrl: './sidebar-item.component.html',\n styleUrls: ['./sidebar-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [RouterLinkActive, RouterLink, NgDocDotComponent, NgDocTextComponent, NgDocTagComponent],\n})\nexport class NgDocSidebarItemComponent {\n item = input.required<NgDocNavigation>();\n statuses = computed(() => {\n const statuses = this.item().metadata?.tags['status'] ?? [];\n\n return statuses.map((status) => {\n const [type, text] = status.split(/\\s+(.+)/);\n\n return { type: type.replace(/^:/, '') as NgDocColor, text };\n });\n });\n}\n","<a class=\"ng-doc-sidebar-link\" [routerLink]=\"[item().route]\" routerLinkActive=\"active\">\n <ng-doc-dot></ng-doc-dot>\n <span ng-doc-text [absoluteContent]=\"true\">\n {{ item().title }}\n @for (status of statuses(); track status) {\n <ng-doc-tag size=\"small\" [color]=\"status.type || 'success'\" mod=\"light\">{{\n status.text\n }}</ng-doc-tag>\n }\n </span>\n</a>\n","import { Location, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport { NG_DOC_CONTEXT } from '@ng-doc/app/tokens';\nimport { NgDocBindPipe, NgDocExecutePipe } from '@ng-doc/ui-kit';\n\nimport { NgDocSidebarCategoryComponent } from './sidebar-category/sidebar-category.component';\nimport { NgDocSidebarItemComponent } from './sidebar-item/sidebar-item.component';\n\n@Component({\n selector: 'ng-doc-sidebar',\n templateUrl: './sidebar.component.html',\n styleUrls: ['./sidebar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgTemplateOutlet,\n NgDocSidebarCategoryComponent,\n NgDocSidebarItemComponent,\n NgDocExecutePipe,\n NgDocBindPipe,\n ],\n})\nexport class NgDocSidebarComponent {\n protected readonly location = inject(Location);\n protected readonly context = inject(NG_DOC_CONTEXT);\n\n getNavigation(nav?: NgDocNavigation): NgDocNavigation[] {\n return nav ? nav.children ?? [] : this.context.navigation;\n }\n\n matchRoute(route: string): boolean {\n return this.location.path().includes(route ?? '', 0);\n }\n}\n","<div class=\"ng-doc-side-bar-wrapper\">\n @for (item of getNavigation | bind: this | execute; track item) {\n <ng-container\n *ngTemplateOutlet=\"sidebarTemplate; context: { item: item, root: true }\"></ng-container>\n }\n\n <ng-template let-item=\"item\" let-root=\"root\" #sidebarTemplate>\n @if (item.children?.length) {\n @if (!item.hidden) {\n <ng-doc-sidebar-category\n [category]=\"item\"\n [expandable]=\"!!item?.expandable\"\n [expanded]=\"\n !!item?.expanded || !item?.expandable || (matchRoute | bind: this | execute: item.route)\n \"\n [isRoot]=\"!!root\"\n [content]=\"categoryContent\">\n </ng-doc-sidebar-category>\n }\n <ng-template #categoryContent>\n @for (child of getNavigation | bind: this | execute: item; track child) {\n <ng-container\n *ngTemplateOutlet=\"\n sidebarTemplate;\n context: { item: child, root: false }\n \"></ng-container>\n }\n </ng-template>\n } @else {\n @if (!item.hidden) {\n <ng-doc-sidebar-item [item]=\"item\"></ng-doc-sidebar-item>\n }\n }\n </ng-template>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAsCa,6BAA6B,CAAA;AAqBxC,IAAA,WAAA,GAAA;QAfA,IAAA,CAAA,MAAM,GAAY,KAAK;QAGvB,IAAA,CAAA,OAAO,GAAiB,EAAE;QAI1B,IAAA,CAAA,UAAU,GAAY,IAAI;QAG1B,IAAA,CAAA,QAAQ,GAAY,IAAI;AAEL,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAG9D,QAAA,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAK;YAC7B,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE;gBAC/D,IAAI,CAAC,MAAM,EAAE;YACf;AACF,QAAA,CAAC,CAAC;IACJ;IAEA,MAAM,GAAA;AACJ,QAAA,IAAI,CAAC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AA,EACtC;wBACP,gBAAgB;wBAChB,6BAA6B;wBAC7B,yBAAyB;wBACzB,gBAAgB;wBAChB,aAAa;AACd,qBAAA,EAAA,QAAA,EAAA,wsCAAA,EAAA,MAAA,EAAA,CAAA,icAAA,CAAA,EAAA;;;AEpBH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-components-sidebar.mjs","sources":["../../../../libs/app/components/sidebar/sidebar-category/sidebar-category.component.ts","../../../../libs/app/components/sidebar/sidebar-category/sidebar-category.component.html","../../../../libs/app/components/sidebar/sidebar-item/sidebar-item.component.ts","../../../../libs/app/components/sidebar/sidebar-item/sidebar-item.component.html","../../../../libs/app/components/sidebar/sidebar.component.ts","../../../../libs/app/components/sidebar/sidebar.component.html","../../../../libs/app/components/sidebar/ng-doc-app-components-sidebar.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n inject,\n input,\n linkedSignal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport { NgDocContent, NgDocExpanderComponent } from '@ng-doc/ui-kit';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\nimport { filter } from 'rxjs/operators';\n\nlet nextId = 0;\n\n/**\n * A category of the sidebar: a header row that expands and collapses the pages below it.\n *\n * An expandable category opens by itself when the reader navigates to one of its pages.\n */\n@Component({\n selector: 'ng-doc-sidebar-category',\n templateUrl: './sidebar-category.component.html',\n styleUrls: ['./sidebar-category.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgDocExpanderComponent, PolymorpheusOutlet],\n host: {\n '[attr.data-ng-doc-is-root]': 'isRoot()',\n '[attr.data-ng-doc-expandable]': 'expandable()',\n '[attr.data-ng-doc-expanded]': 'isExpanded()',\n },\n})\nexport class NgDocSidebarCategoryComponent {\n /** The category. */\n readonly category = input.required<NgDocNavigation>();\n\n /** Whether the category sits at the top level of the sidebar. */\n readonly isRoot = input<boolean, unknown>(false, { transform: booleanAttribute });\n\n /** The pages and categories inside the category. */\n readonly content = input<NgDocContent>('');\n\n /** Whether the reader can collapse the category. A category that cannot is always open. */\n readonly expandable = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n /** Whether the category starts open. */\n readonly expanded = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n /** Whether the category is open: it starts from `expanded` and follows the reader. */\n readonly isExpanded = linkedSignal(() => this.expanded() || !this.expandable());\n\n /** Id of the element that holds the pages, for the header's `aria-controls`. */\n protected readonly childrenId = `ng-doc-sidebar-category-${nextId++}`;\n\n constructor() {\n const router = inject(Router);\n\n router.events\n .pipe(\n filter((event) => event instanceof NavigationEnd),\n takeUntilDestroyed(),\n )\n .subscribe(() => {\n const route: string = this.category().route ?? '';\n\n if (router.url.includes(route)) {\n this.expand();\n }\n });\n }\n\n /** Opens the category if it is open, or closes it otherwise. */\n toggle(): void {\n this.isExpanded() ? this.collapse() : this.expand();\n }\n\n /** Opens the category. */\n expand(): void {\n if (this.expandable()) {\n this.isExpanded.set(true);\n }\n }\n\n /** Closes the category, unless it cannot be collapsed. */\n collapse(): void {\n if (this.expandable()) {\n this.isExpanded.set(false);\n }\n }\n}\n","@if (expandable()) {\n <button\n type=\"button\"\n class=\"ng-doc-sidebar-category-button\"\n [attr.aria-expanded]=\"isExpanded()\"\n [attr.aria-controls]=\"childrenId\"\n (click)=\"toggle()\">\n <span class=\"ng-doc-sidebar-category-title\">{{ category().title }}</span>\n <svg\n class=\"ng-doc-sidebar-category-chevron\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n} @else {\n <div class=\"ng-doc-sidebar-category-button\">\n <span class=\"ng-doc-sidebar-category-title\">{{ category().title }}</span>\n </div>\n}\n<ng-doc-expander [expanded]=\"isExpanded()\" [content]=\"contentTemplate\" collapseMod=\"hide\" />\n<ng-template #contentTemplate>\n <!-- The content comes through a template, so the child components keep their state. -->\n <div class=\"ng-doc-sidebar-category-children\" [id]=\"childrenId\">\n <ng-content></ng-content>\n <ng-container *polymorpheusOutlet=\"content() as text\">{{ text }}</ng-container>\n </div>\n</ng-template>\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport { NgDocColor } from '@ng-doc/ui-kit';\n\n/** A status badge of a sidebar item, from the page's JSDoc status tag. */\nexport interface NgDocSidebarItemStatus {\n /** Colour of the badge. */\n type: NgDocColor;\n /** Text of the badge, in sentence case. */\n text: string;\n}\n\n/**\n * A page link in the sidebar, with the status badges of the page.\n */\n@Component({\n selector: 'ng-doc-sidebar-item',\n templateUrl: './sidebar-item.component.html',\n styleUrls: ['./sidebar-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [RouterLinkActive, RouterLink],\n host: {\n '[attr.data-ng-doc-is-root]': 'isRoot()',\n },\n})\nexport class NgDocSidebarItemComponent {\n /** The page. */\n readonly item = input.required<NgDocNavigation>();\n\n /** Whether the page sits at the top level of the sidebar, beside the categories. */\n readonly isRoot = input<boolean, unknown>(false, { transform: booleanAttribute });\n\n /**\n * The badges of the page: one per JSDoc status tag, in the tag's colour (green without one)\n * and with its text in sentence case.\n */\n readonly statuses = computed<NgDocSidebarItemStatus[]>(() => {\n const statuses: string[] = this.item().metadata?.tags['status'] ?? [];\n\n return statuses.map((status: string) => {\n // The tag reads `:<colour> <text>`; a tag without the colour is all text.\n const [type, text = ''] = status.startsWith(':')\n ? status.slice(1).split(/\\s+(.+)/)\n : ['', status];\n\n return { type: (type || 'success') as NgDocColor, text: sentenceCase(text) };\n });\n });\n}\n\n/**\n * Writes a badge text in sentence case (\"NEW STYLES\" becomes \"New styles\").\n * @param text - The text of the status tag.\n * @returns The text in sentence case.\n */\nfunction sentenceCase(text: string): string {\n const lower: string = text.trim().toLowerCase();\n\n return lower.charAt(0).toUpperCase() + lower.slice(1);\n}\n","<a\n class=\"ng-doc-sidebar-link\"\n [routerLink]=\"[item().route]\"\n routerLinkActive=\"active\"\n ariaCurrentWhenActive=\"page\">\n <span class=\"ng-doc-sidebar-link-title\">{{ item().title }}</span>\n @for (status of statuses(); track $index) {\n <span class=\"ng-doc-sidebar-status\" [attr.data-ng-doc-color]=\"status.type\">{{\n status.text\n }}</span>\n }\n</a>\n","import { Location, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport { NG_DOC_CONTEXT } from '@ng-doc/app/tokens';\nimport { NgDocBindPipe, NgDocExecutePipe } from '@ng-doc/ui-kit';\n\nimport { NgDocSidebarCategoryComponent } from './sidebar-category/sidebar-category.component';\nimport { NgDocSidebarItemComponent } from './sidebar-item/sidebar-item.component';\n\n@Component({\n selector: 'ng-doc-sidebar',\n templateUrl: './sidebar.component.html',\n styleUrls: ['./sidebar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgTemplateOutlet,\n NgDocSidebarCategoryComponent,\n NgDocSidebarItemComponent,\n NgDocExecutePipe,\n NgDocBindPipe,\n ],\n})\nexport class NgDocSidebarComponent {\n protected readonly location = inject(Location);\n protected readonly context = inject(NG_DOC_CONTEXT);\n\n getNavigation(nav?: NgDocNavigation): NgDocNavigation[] {\n return nav ? nav.children ?? [] : this.context.navigation;\n }\n\n matchRoute(route: string): boolean {\n return this.location.path().includes(route ?? '', 0);\n }\n}\n","<nav class=\"ng-doc-side-bar-wrapper\" aria-label=\"Documentation\">\n @for (item of getNavigation | bind: this | execute; track item) {\n <ng-container\n *ngTemplateOutlet=\"sidebarTemplate; context: { item: item, root: true }\"></ng-container>\n }\n\n <ng-template let-item=\"item\" let-root=\"root\" #sidebarTemplate>\n @if (item.children?.length) {\n @if (!item.hidden) {\n <ng-doc-sidebar-category\n [category]=\"item\"\n [expandable]=\"!!item?.expandable\"\n [expanded]=\"\n !!item?.expanded || !item?.expandable || (matchRoute | bind: this | execute: item.route)\n \"\n [isRoot]=\"!!root\"\n [content]=\"categoryContent\">\n </ng-doc-sidebar-category>\n }\n <ng-template #categoryContent>\n @for (child of getNavigation | bind: this | execute: item; track child) {\n <ng-container\n *ngTemplateOutlet=\"\n sidebarTemplate;\n context: { item: child, root: false }\n \"></ng-container>\n }\n </ng-template>\n } @else {\n @if (!item.hidden) {\n <ng-doc-sidebar-item [item]=\"item\" [isRoot]=\"!!root\"></ng-doc-sidebar-item>\n }\n }\n </ng-template>\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAeA,IAAI,MAAM,GAAG,CAAC;AAEd;;;;AAIG;MAaU,6BAA6B,CAAA;AAsBxC,IAAA,WAAA,GAAA;;QApBS,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ;qFAAmB;;QAG5C,IAAA,CAAA,MAAM,GAAG,KAAK,CAAmB,KAAK,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAGxE,IAAA,CAAA,OAAO,GAAG,KAAK,CAAe,EAAE;oFAAC;;QAGjC,IAAA,CAAA,UAAU,GAAG,KAAK,CAAmB,IAAI,kFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAG3E,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAmB,IAAI,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAGzE,QAAA,IAAA,CAAA,UAAU,GAAG,YAAY,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;uFAAC;;AAG5D,QAAA,IAAA,CAAA,UAA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A,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAChB,6BAA6B,EAAA,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,SAAA,EAAA,YAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAC7B,yBAAyB,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EACzB,gBAAgB,EAAA,IAAA,EAAA,SAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAChB,aAAa,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAGJ,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAbjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,eAAA,EAGT,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,gBAAgB;wBAChB,6BAA6B;wBAC7B,yBAAyB;wBACzB,gBAAgB;wBAChB,aAAa;AACd,qBAAA,EAAA,QAAA,EAAA,yvCAAA,EAAA,MAAA,EAAA,CAAA,m+BAAA,CAAA,EAAA;;;AEpBH;;AAEG;;;;"}
@@ -1,26 +1,32 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { NgDocTabGroupComponent, NgDocTabComponent, NgDocIconComponent, NgDocExecutePipe } from '@ng-doc/ui-kit';
4
4
 
5
+ /** Grouped code blocks of a page, shown as tabs. */
5
6
  class NgDocTabsComponent {
6
7
  constructor() {
7
- this.tabs = [];
8
- }
9
- getActiveIndex(tabs) {
10
- return Math.max(tabs.findIndex((tab) => tab.active), 0);
8
+ /** The tabs; their content is moved into the open panel. */
9
+ this.tabs = input([], /* @ts-ignore */
10
+ ...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
11
+ /** Index of the tab that opens first: the one marked active, or the first. */
12
+ this.activeIndex = computed(() => Math.max(this.tabs().findIndex((tab) => tab.active), 0), /* @ts-ignore */
13
+ ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
11
14
  }
15
+ /**
16
+ * Moves a tab's content into its panel.
17
+ * @param element - Content of the tab.
18
+ * @param parent - The panel element.
19
+ */
12
20
  appendElement(element, parent) {
13
21
  parent.appendChild(element);
14
22
  }
15
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgDocTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
16
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: NgDocTabsComponent, isStandalone: true, selector: "ng-doc-tabs", inputs: { tabs: "tabs" }, ngImport: i0, template: "<ng-doc-tab-group [openedTab]=\"getActiveIndex | execute: tabs\">\n @for (tab of tabs; track tab; let i = $index) {\n <ng-doc-tab [label]=\"label\" [content]=\"content\" [id]=\"i\">\n <ng-template #label>\n @if (tab.icon) {\n <ng-doc-icon [customIcon]=\"tab.icon\"></ng-doc-icon>\n }\n {{ tab.title }}\n </ng-template>\n <ng-template #content>\n <div #element>\n {{ appendElement | execute: tab.content : element }}\n </div>\n </ng-template>\n </ng-doc-tab>\n }\n</ng-doc-tab-group>\n", styles: [":host{display:block;border-radius:var(--ng-doc-tabs-border-radius);border:var(--ng-doc-tabs-border);margin:var(--ng-doc-tabs-margin);overflow:hidden;--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none;--ng-doc-tab-group-header-background: var(--ng-doc-base-2)}:host ng-doc-icon{margin-right:calc(var(--ng-doc-base-gutter) / 2)}\n"], dependencies: [{ kind: "component", type: NgDocTabGroupComponent, selector: "ng-doc-tab-group", inputs: ["openedTab"] }, { kind: "component", type: NgDocTabComponent, selector: "ng-doc-tab, a[ng-doc-tab]", inputs: ["label", "id", "content"] }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }, { kind: "pipe", type: NgDocExecutePipe, name: "execute" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
23
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
24
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocTabsComponent, isStandalone: true, selector: "ng-doc-tabs", inputs: { tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-doc-tab-group [openedTab]=\"activeIndex()\">\n @for (tab of tabs(); track tab; let i = $index) {\n <ng-doc-tab [label]=\"label\" [content]=\"content\" [id]=\"i\">\n <ng-template #label>\n @if (tab.icon) {\n <ng-doc-icon [customIcon]=\"tab.icon\"></ng-doc-icon>\n }\n {{ tab.title }}\n </ng-template>\n <ng-template #content>\n <div #element>\n {{ appendElement | execute: tab.content : element }}\n </div>\n </ng-template>\n </ng-doc-tab>\n }\n</ng-doc-tab-group>\n", styles: [":host{display:block;border-radius:var(--ng-doc-tabs-border-radius);border:var(--ng-doc-tabs-border, 1px solid var(--ng-doc-border-color));margin:var(--ng-doc-tabs-margin);overflow:hidden;--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none;--ng-doc-tab-group-background: var(--ng-doc-code-background);--ng-doc-tab-group-header-background: var(--ng-doc-code-background);--ng-doc-tab-group-tabs-background: var(--ng-doc-code-header-background, transparent)}\n"], dependencies: [{ kind: "component", type: NgDocTabGroupComponent, selector: "ng-doc-tab-group", inputs: ["openedTab"] }, { kind: "component", type: NgDocTabComponent, selector: "ng-doc-tab, a[ng-doc-tab]", inputs: ["label", "id", "content"] }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }, { kind: "pipe", type: NgDocExecutePipe, name: "execute" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
17
25
  }
18
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgDocTabsComponent, decorators: [{
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocTabsComponent, decorators: [{
19
27
  type: Component,
20
- args: [{ selector: 'ng-doc-tabs', imports: [NgDocTabGroupComponent, NgDocTabComponent, NgDocExecutePipe, NgDocIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-doc-tab-group [openedTab]=\"getActiveIndex | execute: tabs\">\n @for (tab of tabs; track tab; let i = $index) {\n <ng-doc-tab [label]=\"label\" [content]=\"content\" [id]=\"i\">\n <ng-template #label>\n @if (tab.icon) {\n <ng-doc-icon [customIcon]=\"tab.icon\"></ng-doc-icon>\n }\n {{ tab.title }}\n </ng-template>\n <ng-template #content>\n <div #element>\n {{ appendElement | execute: tab.content : element }}\n </div>\n </ng-template>\n </ng-doc-tab>\n }\n</ng-doc-tab-group>\n", styles: [":host{display:block;border-radius:var(--ng-doc-tabs-border-radius);border:var(--ng-doc-tabs-border);margin:var(--ng-doc-tabs-margin);overflow:hidden;--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none;--ng-doc-tab-group-header-background: var(--ng-doc-base-2)}:host ng-doc-icon{margin-right:calc(var(--ng-doc-base-gutter) / 2)}\n"] }]
21
- }], propDecorators: { tabs: [{
22
- type: Input
23
- }] } });
28
+ args: [{ selector: 'ng-doc-tabs', imports: [NgDocTabGroupComponent, NgDocTabComponent, NgDocExecutePipe, NgDocIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-doc-tab-group [openedTab]=\"activeIndex()\">\n @for (tab of tabs(); track tab; let i = $index) {\n <ng-doc-tab [label]=\"label\" [content]=\"content\" [id]=\"i\">\n <ng-template #label>\n @if (tab.icon) {\n <ng-doc-icon [customIcon]=\"tab.icon\"></ng-doc-icon>\n }\n {{ tab.title }}\n </ng-template>\n <ng-template #content>\n <div #element>\n {{ appendElement | execute: tab.content : element }}\n </div>\n </ng-template>\n </ng-doc-tab>\n }\n</ng-doc-tab-group>\n", styles: [":host{display:block;border-radius:var(--ng-doc-tabs-border-radius);border:var(--ng-doc-tabs-border, 1px solid var(--ng-doc-border-color));margin:var(--ng-doc-tabs-margin);overflow:hidden;--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none;--ng-doc-tab-group-background: var(--ng-doc-code-background);--ng-doc-tab-group-header-background: var(--ng-doc-code-background);--ng-doc-tab-group-tabs-background: var(--ng-doc-code-header-background, transparent)}\n"] }]
29
+ }], propDecorators: { tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: false }] }] } });
24
30
 
25
31
  /**
26
32
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-components-tabs.mjs","sources":["../../../../libs/app/components/tabs/tabs.component.ts","../../../../libs/app/components/tabs/tabs.component.html","../../../../libs/app/components/tabs/ng-doc-app-components-tabs.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { NgDocTab } from '@ng-doc/app/interfaces';\nimport {\n NgDocExecutePipe,\n NgDocIconComponent,\n NgDocTabComponent,\n NgDocTabGroupComponent,\n} from '@ng-doc/ui-kit';\n\n@Component({\n selector: 'ng-doc-tabs',\n imports: [NgDocTabGroupComponent, NgDocTabComponent, NgDocExecutePipe, NgDocIconComponent],\n templateUrl: './tabs.component.html',\n styleUrls: ['./tabs.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocTabsComponent {\n @Input()\n tabs: NgDocTab[] = [];\n\n getActiveIndex(tabs: NgDocTab[]): number {\n return Math.max(\n tabs.findIndex((tab: NgDocTab) => tab.active),\n 0,\n );\n }\n\n appendElement(element: Element, parent: Element): void {\n parent.appendChild(element);\n }\n}\n","<ng-doc-tab-group [openedTab]=\"getActiveIndex | execute: tabs\">\n @for (tab of tabs; track tab; let i = $index) {\n <ng-doc-tab [label]=\"label\" [content]=\"content\" [id]=\"i\">\n <ng-template #label>\n @if (tab.icon) {\n <ng-doc-icon [customIcon]=\"tab.icon\"></ng-doc-icon>\n }\n {{ tab.title }}\n </ng-template>\n <ng-template #content>\n <div #element>\n {{ appendElement | execute: tab.content : element }}\n </div>\n </ng-template>\n </ng-doc-tab>\n }\n</ng-doc-tab-group>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAgBa,kBAAkB,CAAA;AAP/B,IAAA,WAAA,GAAA;QASE,IAAA,CAAA,IAAI,GAAe,EAAE;AAYtB,IAAA;AAVC,IAAA,cAAc,CAAC,IAAgB,EAAA;QAC7B,OAAO,IAAI,CAAC,GAAG,CACb,IAAI,CAAC,SAAS,CAAC,CAAC,GAAa,KAAK,GAAG,CAAC,MAAM,CAAC,EAC7C,CAAC,CACF;IACH;IAEA,aAAa,CAAC,OAAgB,EAAE,MAAe,EAAA;AAC7C,QAAA,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC;IAC7B;8GAbW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EChB/B,ujBAiBA,EAAA,MAAA,EAAA,CAAA,yWAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDNY,sBAAsB,oFAAE,iBAAiB,EAAA,QAAA,EAAA,2BAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,IAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAoB,kBAAkB,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,YAAA,EAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAApC,gBAAgB,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAK1D,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAP9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,OAAA,EACd,CAAC,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,EAAA,eAAA,EAGzE,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,ujBAAA,EAAA,MAAA,EAAA,CAAA,yWAAA,CAAA,EAAA;;sBAG9C;;;AEjBH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-components-tabs.mjs","sources":["../../../../libs/app/components/tabs/tabs.component.ts","../../../../libs/app/components/tabs/tabs.component.html","../../../../libs/app/components/tabs/ng-doc-app-components-tabs.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, Signal } from '@angular/core';\nimport { NgDocTab } from '@ng-doc/app/interfaces';\nimport {\n NgDocExecutePipe,\n NgDocIconComponent,\n NgDocTabComponent,\n NgDocTabGroupComponent,\n} from '@ng-doc/ui-kit';\n\n/** Grouped code blocks of a page, shown as tabs. */\n@Component({\n selector: 'ng-doc-tabs',\n imports: [NgDocTabGroupComponent, NgDocTabComponent, NgDocExecutePipe, NgDocIconComponent],\n templateUrl: './tabs.component.html',\n styleUrls: ['./tabs.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocTabsComponent {\n /** The tabs; their content is moved into the open panel. */\n readonly tabs = input<NgDocTab[]>([]);\n\n /** Index of the tab that opens first: the one marked active, or the first. */\n protected readonly activeIndex: Signal<number> = computed(() =>\n Math.max(\n this.tabs().findIndex((tab: NgDocTab) => tab.active),\n 0,\n ),\n );\n\n /**\n * Moves a tab's content into its panel.\n * @param element - Content of the tab.\n * @param parent - The panel element.\n */\n appendElement(element: Element, parent: Element): void {\n parent.appendChild(element);\n }\n}\n","<ng-doc-tab-group [openedTab]=\"activeIndex()\">\n @for (tab of tabs(); track tab; let i = $index) {\n <ng-doc-tab [label]=\"label\" [content]=\"content\" [id]=\"i\">\n <ng-template #label>\n @if (tab.icon) {\n <ng-doc-icon [customIcon]=\"tab.icon\"></ng-doc-icon>\n }\n {{ tab.title }}\n </ng-template>\n <ng-template #content>\n <div #element>\n {{ appendElement | execute: tab.content : element }}\n </div>\n </ng-template>\n </ng-doc-tab>\n }\n</ng-doc-tab-group>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AASA;MAQa,kBAAkB,CAAA;AAP/B,IAAA,WAAA,GAAA;;QASW,IAAA,CAAA,IAAI,GAAG,KAAK,CAAa,EAAE;iFAAC;;AAGlB,QAAA,IAAA,CAAA,WAAW,GAAmB,QAAQ,CAAC,MACxD,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,GAAa,KAAK,GAAG,CAAC,MAAM,CAAC,EACpD,CAAC,CACF;wFACF;AAUF,IAAA;AARC;;;;AAIG;IACH,aAAa,CAAC,OAAgB,EAAE,MAAe,EAAA;AAC7C,QAAA,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC;IAC7B;8GAnBW,kB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}
@@ -1,36 +1,48 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, DOCUMENT, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { NgDocThemeService } from '@ng-doc/app/services/theme';
4
- import { NgDocButtonIconComponent, NgDocTooltipDirective, NgDocIconComponent } from '@ng-doc/ui-kit';
4
+ import { NgDocButtonIconComponent, NgDocTooltipDirective } from '@ng-doc/ui-kit';
5
5
 
6
+ const THEMES = [
7
+ { name: 'Auto', theme: 'auto' },
8
+ { name: 'Light', theme: null },
9
+ { name: 'Dark', theme: 'dark' },
10
+ ];
11
+ /**
12
+ * Button that switches the theme in turn: Auto (follows the system), Light and Dark.
13
+ *
14
+ * It shows the current theme and follows theme changes made elsewhere through the theme service.
15
+ */
6
16
  class NgDocThemeToggleComponent {
7
17
  constructor() {
8
- this.themes = [
9
- { name: 'Auto', theme: 'auto' },
10
- { name: 'Light', theme: null },
11
- { name: 'Dark', theme: 'dark' },
12
- ];
13
- this.documentElement = inject(DOCUMENT).documentElement;
14
18
  this.themeService = inject(NgDocThemeService);
19
+ /**
20
+ * The current theme. A custom theme id counts as Auto, because the toggle does not offer it.
21
+ */
22
+ this.currentTheme = computed(() => {
23
+ const theme = this.themeService.theme();
24
+ return THEMES.find(({ theme: t }) => t === theme) ?? THEMES[0];
25
+ }, /* @ts-ignore */
26
+ ...(ngDevMode ? [{ debugName: "currentTheme" }] : /* istanbul ignore next */ []));
27
+ /**
28
+ * The theme the next press switches to.
29
+ */
30
+ this.nextTheme = computed(() => THEMES[(THEMES.indexOf(this.currentTheme()) + 1) % THEMES.length], /* @ts-ignore */
31
+ ...(ngDevMode ? [{ debugName: "nextTheme" }] : /* istanbul ignore next */ []));
15
32
  }
16
- get currentTheme() {
17
- const theme = this.documentElement.getAttribute('data-theme');
18
- return this.themes.find(({ theme: t }) => t === theme) ?? this.themes[0];
19
- }
20
- get nextTheme() {
21
- const index = this.themes.findIndex(({ theme }) => theme === this.currentTheme.theme);
22
- return this.themes[(index + 1) % this.themes.length];
23
- }
33
+ /**
34
+ * Switches to the next theme.
35
+ */
24
36
  toggleTheme() {
25
- const { theme } = this.nextTheme;
37
+ const { theme } = this.nextTheme();
26
38
  this.themeService.set(theme ?? undefined);
27
39
  }
28
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgDocThemeToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
29
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: NgDocThemeToggleComponent, isStandalone: true, selector: "ng-doc-theme-toggle", ngImport: i0, template: "<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" [ngDocTooltip]=\"tooltipContent\">\n <ng-template #tooltipContent> \"{{ currentTheme.name }}\" theme </ng-template>\n\n @if (currentTheme === themes[0]) {\n <div class=\"letter\">A</div>\n } @else if (currentTheme === themes[1]) {\n <ng-doc-icon icon=\"sun\" size=\"24\"></ng-doc-icon>\n } @else {\n <ng-doc-icon icon=\"moon\" size=\"24\"></ng-doc-icon>\n }\n</button>\n", styles: [":host{display:inline-block;height:40px;width:40px}:host .letter{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);--ng-doc-font-size: 26px;--ng-doc-font-weight: 600}\n"], dependencies: [{ kind: "component", type: NgDocButtonIconComponent, selector: "button[ng-doc-button-icon], a[ng-doc-button-icon], button[ng-doc-button-icon-raised], a[ng-doc-button-icon-raised], button[ng-doc-button-icon-transparent], a[ng-doc-button-icon-transparent]", inputs: ["size", "rounded"] }, { kind: "directive", type: NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
40
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocThemeToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
41
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocThemeToggleComponent, isStandalone: true, selector: "ng-doc-theme-toggle", ngImport: i0, template: "<button\n type=\"button\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n [attr.aria-label]=\"currentTheme().name + ' theme. Switch to ' + nextTheme().name.toLowerCase()\"\n [ngDocTooltip]=\"currentTheme().name + ' theme'\"\n (click)=\"toggleTheme()\">\n @switch (currentTheme().name) {\n @case ('Light') {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path\n d=\"M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\" />\n </svg>\n }\n @case ('Dark') {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <path d=\"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z\" />\n </svg>\n }\n @default {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 3a9 9 0 0 0 0 18z\" fill=\"currentColor\" />\n </svg>\n }\n }\n</button>\n", styles: [":host{display:inline-flex;flex:none}\n"], dependencies: [{ kind: "component", type: NgDocButtonIconComponent, selector: "button[ng-doc-button-icon], a[ng-doc-button-icon], button[ng-doc-button-icon-raised], a[ng-doc-button-icon-raised], button[ng-doc-button-icon-transparent], a[ng-doc-button-icon-transparent]", inputs: ["size", "rounded"] }, { kind: "directive", type: NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
30
42
  }
31
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgDocThemeToggleComponent, decorators: [{
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocThemeToggleComponent, decorators: [{
32
44
  type: Component,
33
- args: [{ selector: 'ng-doc-theme-toggle', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocButtonIconComponent, NgDocTooltipDirective, NgDocIconComponent], template: "<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" [ngDocTooltip]=\"tooltipContent\">\n <ng-template #tooltipContent> \"{{ currentTheme.name }}\" theme </ng-template>\n\n @if (currentTheme === themes[0]) {\n <div class=\"letter\">A</div>\n } @else if (currentTheme === themes[1]) {\n <ng-doc-icon icon=\"sun\" size=\"24\"></ng-doc-icon>\n } @else {\n <ng-doc-icon icon=\"moon\" size=\"24\"></ng-doc-icon>\n }\n</button>\n", styles: [":host{display:inline-block;height:40px;width:40px}:host .letter{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);--ng-doc-font-size: 26px;--ng-doc-font-weight: 600}\n"] }]
45
+ args: [{ selector: 'ng-doc-theme-toggle', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocButtonIconComponent, NgDocTooltipDirective], template: "<button\n type=\"button\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n [attr.aria-label]=\"currentTheme().name + ' theme. Switch to ' + nextTheme().name.toLowerCase()\"\n [ngDocTooltip]=\"currentTheme().name + ' theme'\"\n (click)=\"toggleTheme()\">\n @switch (currentTheme().name) {\n @case ('Light') {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path\n d=\"M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\" />\n </svg>\n }\n @case ('Dark') {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <path d=\"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z\" />\n </svg>\n }\n @default {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 3a9 9 0 0 0 0 18z\" fill=\"currentColor\" />\n </svg>\n }\n }\n</button>\n", styles: [":host{display:inline-flex;flex:none}\n"] }]
34
46
  }] });
35
47
 
36
48
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-components-theme-toggle.mjs","sources":["../../../../libs/app/components/theme-toggle/theme-toggle.component.ts","../../../../libs/app/components/theme-toggle/theme-toggle.component.html","../../../../libs/app/components/theme-toggle/ng-doc-app-components-theme-toggle.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, DOCUMENT, inject } from '@angular/core';\nimport { NgDocThemeService } from '@ng-doc/app/services/theme';\nimport {\n NgDocButtonIconComponent,\n NgDocIconComponent,\n NgDocTooltipDirective,\n} from '@ng-doc/ui-kit';\n\ninterface ToggleTheme {\n name: string;\n theme: string | null;\n}\n\n@Component({\n selector: 'ng-doc-theme-toggle',\n templateUrl: './theme-toggle.component.html',\n styleUrls: ['./theme-toggle.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgDocButtonIconComponent, NgDocTooltipDirective, NgDocIconComponent],\n})\nexport class NgDocThemeToggleComponent {\n protected readonly themes: ToggleTheme[] = [\n { name: 'Auto', theme: 'auto' },\n { name: 'Light', theme: null },\n { name: 'Dark', theme: 'dark' },\n ];\n protected readonly documentElement = inject(DOCUMENT).documentElement;\n protected readonly themeService = inject(NgDocThemeService);\n\n get currentTheme(): ToggleTheme {\n const theme = this.documentElement.getAttribute('data-theme');\n\n return this.themes.find(({ theme: t }) => t === theme) ?? this.themes[0];\n }\n\n get nextTheme(): ToggleTheme {\n const index = this.themes.findIndex(({ theme }) => theme === this.currentTheme.theme);\n\n return this.themes[(index + 1) % this.themes.length];\n }\n\n toggleTheme(): void {\n const { theme } = this.nextTheme;\n\n this.themeService.set(theme ?? undefined);\n }\n}\n","<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" [ngDocTooltip]=\"tooltipContent\">\n <ng-template #tooltipContent> \"{{ currentTheme.name }}\" theme </ng-template>\n\n @if (currentTheme === themes[0]) {\n <div class=\"letter\">A</div>\n } @else if (currentTheme === themes[1]) {\n <ng-doc-icon icon=\"sun\" size=\"24\"></ng-doc-icon>\n } @else {\n <ng-doc-icon icon=\"moon\" size=\"24\"></ng-doc-icon>\n }\n</button>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAoBa,yBAAyB,CAAA;AAPtC,IAAA,WAAA,GAAA;AAQqB,QAAA,IAAA,CAAA,MAAM,GAAkB;AACzC,YAAA,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;AAC/B,YAAA,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE;AAC9B,YAAA,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;SAChC;AACkB,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,eAAe;AAClD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAmB5D,IAAA;AAjBC,IAAA,IAAI,YAAY,GAAA;QACd,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,YAAY,CAAC;QAE7D,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1E;AAEA,IAAA,IAAI,SAAS,GAAA;QACX,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,KAAK,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;AAErF,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK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/theme-toggle/theme-toggle.component.ts","../../../../libs/app/components/theme-toggle/theme-toggle.component.html","../../../../libs/app/components/theme-toggle/ng-doc-app-components-theme-toggle.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, Signal } from '@angular/core';\nimport { NgDocThemeService } from '@ng-doc/app/services/theme';\nimport { NgDocButtonIconComponent, NgDocTooltipDirective } from '@ng-doc/ui-kit';\n\ninterface ToggleTheme {\n name: string;\n theme: string | null;\n}\n\nconst THEMES: readonly ToggleTheme[] = [\n { name: 'Auto', theme: 'auto' },\n { name: 'Light', theme: null },\n { name: 'Dark', theme: 'dark' },\n];\n\n/**\n * Button that switches the theme in turn: Auto (follows the system), Light and Dark.\n *\n * It shows the current theme and follows theme changes made elsewhere through the theme service.\n */\n@Component({\n selector: 'ng-doc-theme-toggle',\n templateUrl: './theme-toggle.component.html',\n styleUrls: ['./theme-toggle.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgDocButtonIconComponent, NgDocTooltipDirective],\n})\nexport class NgDocThemeToggleComponent {\n protected readonly themeService = inject(NgDocThemeService);\n\n /**\n * The current theme. A custom theme id counts as Auto, because the toggle does not offer it.\n */\n protected readonly currentTheme: Signal<ToggleTheme> = computed(() => {\n const theme: string | null = this.themeService.theme();\n\n return THEMES.find(({ theme: t }) => t === theme) ?? THEMES[0];\n });\n\n /**\n * The theme the next press switches to.\n */\n protected readonly nextTheme: Signal<ToggleTheme> = computed(\n () => THEMES[(THEMES.indexOf(this.currentTheme()) + 1) % THEMES.length],\n );\n\n /**\n * Switches to the next theme.\n */\n toggleTheme(): void {\n const { theme } = this.nextTheme();\n\n this.themeService.set(theme ?? undefined);\n }\n}\n","<button\n type=\"button\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n [attr.aria-label]=\"currentTheme().name + ' theme. Switch to ' + nextTheme().name.toLowerCase()\"\n [ngDocTooltip]=\"currentTheme().name + ' theme'\"\n (click)=\"toggleTheme()\">\n @switch (currentTheme().name) {\n @case ('Light') {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path\n d=\"M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\" />\n </svg>\n }\n @case ('Dark') {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <path d=\"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z\" />\n </svg>\n }\n @default {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 3a9 9 0 0 0 0 18z\" fill=\"currentColor\" />\n </svg>\n }\n }\n</button>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AASA,MAAM,MAAM,GAA2B;AACrC,IAAA,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;AAC/B,IAAA,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE;AAC9B,IAAA,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;CAChC;AAED;;;;AAIG;MAQU,yBAAyB,CAAA;AAPtC,IAAA,WAAA,GAAA;AAQqB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CA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