@ngbase/adk 0.1.16 → 0.1.18

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 (203) hide show
  1. package/fesm2022/ngbase-adk-a11y.mjs +42 -42
  2. package/fesm2022/ngbase-adk-a11y.mjs.map +1 -1
  3. package/fesm2022/ngbase-adk-accordion.mjs +20 -26
  4. package/fesm2022/ngbase-adk-accordion.mjs.map +1 -1
  5. package/fesm2022/ngbase-adk-autocomplete.mjs +11 -11
  6. package/fesm2022/ngbase-adk-autocomplete.mjs.map +1 -1
  7. package/fesm2022/ngbase-adk-avatar.mjs +13 -13
  8. package/fesm2022/ngbase-adk-avatar.mjs.map +1 -1
  9. package/fesm2022/ngbase-adk-bidi.mjs +3 -3
  10. package/fesm2022/ngbase-adk-bidi.mjs.map +1 -1
  11. package/fesm2022/ngbase-adk-breadcrumb.mjs +14 -14
  12. package/fesm2022/ngbase-adk-breadcrumb.mjs.map +1 -1
  13. package/fesm2022/ngbase-adk-cache.mjs +3 -3
  14. package/fesm2022/ngbase-adk-cache.mjs.map +1 -1
  15. package/fesm2022/ngbase-adk-carousel.mjs +18 -18
  16. package/fesm2022/ngbase-adk-carousel.mjs.map +1 -1
  17. package/fesm2022/ngbase-adk-checkbox.mjs +15 -21
  18. package/fesm2022/ngbase-adk-checkbox.mjs.map +1 -1
  19. package/fesm2022/ngbase-adk-chip.mjs +12 -12
  20. package/fesm2022/ngbase-adk-chip.mjs.map +1 -1
  21. package/fesm2022/ngbase-adk-clipboard.mjs +7 -5
  22. package/fesm2022/ngbase-adk-clipboard.mjs.map +1 -1
  23. package/fesm2022/ngbase-adk-collections.mjs.map +1 -1
  24. package/fesm2022/ngbase-adk-color-picker.mjs +44 -53
  25. package/fesm2022/ngbase-adk-color-picker.mjs.map +1 -1
  26. package/fesm2022/ngbase-adk-cookies.mjs +3 -3
  27. package/fesm2022/ngbase-adk-cookies.mjs.map +1 -1
  28. package/fesm2022/ngbase-adk-datepicker.mjs +70 -89
  29. package/fesm2022/ngbase-adk-datepicker.mjs.map +1 -1
  30. package/fesm2022/ngbase-adk-dialog.mjs +17 -39
  31. package/fesm2022/ngbase-adk-dialog.mjs.map +1 -1
  32. package/fesm2022/ngbase-adk-drag.mjs +20 -20
  33. package/fesm2022/ngbase-adk-drag.mjs.map +1 -1
  34. package/fesm2022/ngbase-adk-form-field.mjs +65 -118
  35. package/fesm2022/ngbase-adk-form-field.mjs.map +1 -1
  36. package/fesm2022/ngbase-adk-hover-card.mjs +5 -5
  37. package/fesm2022/ngbase-adk-hover-card.mjs.map +1 -1
  38. package/fesm2022/ngbase-adk-icon.mjs +9 -11
  39. package/fesm2022/ngbase-adk-icon.mjs.map +1 -1
  40. package/fesm2022/ngbase-adk-inline-edit.mjs +27 -35
  41. package/fesm2022/ngbase-adk-inline-edit.mjs.map +1 -1
  42. package/fesm2022/ngbase-adk-jwt.mjs +319 -41
  43. package/fesm2022/ngbase-adk-jwt.mjs.map +1 -1
  44. package/fesm2022/ngbase-adk-keys.mjs +6 -6
  45. package/fesm2022/ngbase-adk-keys.mjs.map +1 -1
  46. package/fesm2022/ngbase-adk-layout.mjs.map +1 -1
  47. package/fesm2022/ngbase-adk-list.mjs +10 -10
  48. package/fesm2022/ngbase-adk-list.mjs.map +1 -1
  49. package/fesm2022/ngbase-adk-mask.mjs +8 -8
  50. package/fesm2022/ngbase-adk-mask.mjs.map +1 -1
  51. package/fesm2022/ngbase-adk-menu.mjs +69 -79
  52. package/fesm2022/ngbase-adk-menu.mjs.map +1 -1
  53. package/fesm2022/ngbase-adk-network.mjs +3 -3
  54. package/fesm2022/ngbase-adk-network.mjs.map +1 -1
  55. package/fesm2022/ngbase-adk-otp.mjs +24 -45
  56. package/fesm2022/ngbase-adk-otp.mjs.map +1 -1
  57. package/fesm2022/ngbase-adk-pagination.mjs +9 -9
  58. package/fesm2022/ngbase-adk-pagination.mjs.map +1 -1
  59. package/fesm2022/ngbase-adk-popover.mjs +120 -89
  60. package/fesm2022/ngbase-adk-popover.mjs.map +1 -1
  61. package/fesm2022/ngbase-adk-portal.mjs +134 -47
  62. package/fesm2022/ngbase-adk-portal.mjs.map +1 -1
  63. package/fesm2022/ngbase-adk-progress.mjs +7 -7
  64. package/fesm2022/ngbase-adk-progress.mjs.map +1 -1
  65. package/fesm2022/ngbase-adk-radio.mjs +20 -27
  66. package/fesm2022/ngbase-adk-radio.mjs.map +1 -1
  67. package/fesm2022/ngbase-adk-resizable.mjs +138 -48
  68. package/fesm2022/ngbase-adk-resizable.mjs.map +1 -1
  69. package/fesm2022/ngbase-adk-scroll-area.mjs +28 -20
  70. package/fesm2022/ngbase-adk-scroll-area.mjs.map +1 -1
  71. package/fesm2022/ngbase-adk-select.mjs +58 -80
  72. package/fesm2022/ngbase-adk-select.mjs.map +1 -1
  73. package/fesm2022/ngbase-adk-selectable.mjs +19 -30
  74. package/fesm2022/ngbase-adk-selectable.mjs.map +1 -1
  75. package/fesm2022/ngbase-adk-sheet.mjs +6 -20
  76. package/fesm2022/ngbase-adk-sheet.mjs.map +1 -1
  77. package/fesm2022/ngbase-adk-sidenav.mjs +65 -46
  78. package/fesm2022/ngbase-adk-sidenav.mjs.map +1 -1
  79. package/fesm2022/ngbase-adk-slider.mjs +40 -53
  80. package/fesm2022/ngbase-adk-slider.mjs.map +1 -1
  81. package/fesm2022/ngbase-adk-sonner.mjs +12 -19
  82. package/fesm2022/ngbase-adk-sonner.mjs.map +1 -1
  83. package/fesm2022/ngbase-adk-stepper.mjs +17 -25
  84. package/fesm2022/ngbase-adk-stepper.mjs.map +1 -1
  85. package/fesm2022/ngbase-adk-switch.mjs +25 -32
  86. package/fesm2022/ngbase-adk-switch.mjs.map +1 -1
  87. package/fesm2022/ngbase-adk-table.mjs +581 -83
  88. package/fesm2022/ngbase-adk-table.mjs.map +1 -1
  89. package/fesm2022/ngbase-adk-tabs.mjs +37 -35
  90. package/fesm2022/ngbase-adk-tabs.mjs.map +1 -1
  91. package/fesm2022/ngbase-adk-test.mjs.map +1 -1
  92. package/fesm2022/ngbase-adk-toggle-group.mjs +20 -34
  93. package/fesm2022/ngbase-adk-toggle-group.mjs.map +1 -1
  94. package/fesm2022/ngbase-adk-toggle.mjs +14 -19
  95. package/fesm2022/ngbase-adk-toggle.mjs.map +1 -1
  96. package/fesm2022/ngbase-adk-tooltip.mjs +12 -19
  97. package/fesm2022/ngbase-adk-tooltip.mjs.map +1 -1
  98. package/fesm2022/ngbase-adk-tour.mjs +52 -52
  99. package/fesm2022/ngbase-adk-tour.mjs.map +1 -1
  100. package/fesm2022/ngbase-adk-translate.mjs +8 -10
  101. package/fesm2022/ngbase-adk-translate.mjs.map +1 -1
  102. package/fesm2022/ngbase-adk-tree.mjs +20 -20
  103. package/fesm2022/ngbase-adk-tree.mjs.map +1 -1
  104. package/fesm2022/ngbase-adk-utils.mjs +30 -43
  105. package/fesm2022/ngbase-adk-utils.mjs.map +1 -1
  106. package/fesm2022/ngbase-adk-virtualizer.mjs +9 -9
  107. package/fesm2022/ngbase-adk-virtualizer.mjs.map +1 -1
  108. package/package.json +91 -91
  109. package/schematics/components/files/accordion/accordion.ts.template +9 -6
  110. package/schematics/components/files/audio/AudioPlayer.ts.template +245 -0
  111. package/schematics/components/files/audio/AudioRecorder.ts.template +377 -0
  112. package/schematics/components/files/audio/AudioVisualizer.ts.template +175 -0
  113. package/schematics/components/files/audio/index.ts.template +3 -0
  114. package/schematics/components/files/button/button-llm.md.template +3 -2
  115. package/schematics/components/files/charts/area-chart.component.ts.template +278 -0
  116. package/schematics/components/files/charts/bar-chart.component.ts.template +262 -0
  117. package/schematics/components/files/charts/chart-tooltip.component.ts.template +168 -0
  118. package/schematics/components/files/charts/index.ts.template +4 -0
  119. package/schematics/components/files/charts/line-chart.component.ts.template +238 -0
  120. package/schematics/components/files/charts/pie-chart.component.ts.template +283 -0
  121. package/schematics/components/files/checkbox/checkbox.ts.template +2 -2
  122. package/schematics/components/files/color-picker/color-picker.ts.template +2 -2
  123. package/schematics/components/files/dialog/dialog.ts.template +18 -14
  124. package/schematics/components/files/drawer/drawer.ts.template +30 -27
  125. package/schematics/components/files/form-field/form-field.ts.template +51 -23
  126. package/schematics/components/files/pagination/pagination.ts.template +4 -4
  127. package/schematics/components/files/picasa/picasa-base.component.ts.template +15 -30
  128. package/schematics/components/files/popover/popover.ts.template +15 -4
  129. package/schematics/components/files/select/list-selection.ts.template +0 -2
  130. package/schematics/components/files/select/option.ts.template +1 -1
  131. package/schematics/components/files/selectable/selectable.ts.template +2 -2
  132. package/schematics/components/files/sheet/sheet.ts.template +26 -14
  133. package/schematics/components/files/sidenav/sidenav.ts.template +7 -5
  134. package/schematics/components/files/sonner/sonner.ts.template +1 -2
  135. package/schematics/components/files/stepper/stepper.ts.template +2 -4
  136. package/schematics/components/files/switch/switch.ts.template +2 -2
  137. package/schematics/components/files/table/table.ts.template +43 -3
  138. package/schematics/components/files/tabs/tab.ts.template +3 -3
  139. package/schematics/components/files/theme/theme.service.ts.template +3 -3
  140. package/schematics/components/files/toggle/toggle.ts.template +1 -1
  141. package/schematics/components/files/toggle-group/toggle-group.ts.template +1 -1
  142. package/schematics/components/files/tooltip/tooltip.ts.template +2 -3
  143. package/schematics/components/schema.json +2 -0
  144. package/{accordion/index.d.ts → types/ngbase-adk-accordion.d.ts} +1 -3
  145. package/{autocomplete/index.d.ts → types/ngbase-adk-autocomplete.d.ts} +2 -7
  146. package/{checkbox/index.d.ts → types/ngbase-adk-checkbox.d.ts} +8 -14
  147. package/types/ngbase-adk-clipboard.d.ts +12 -0
  148. package/{color-picker/index.d.ts → types/ngbase-adk-color-picker.d.ts} +14 -26
  149. package/{datepicker/index.d.ts → types/ngbase-adk-datepicker.d.ts} +9 -18
  150. package/{dialog/index.d.ts → types/ngbase-adk-dialog.d.ts} +3 -8
  151. package/types/ngbase-adk-form-field.d.ts +88 -0
  152. package/{inline-edit/index.d.ts → types/ngbase-adk-inline-edit.d.ts} +8 -16
  153. package/types/ngbase-adk-jwt.d.ts +64 -0
  154. package/{menu/index.d.ts → types/ngbase-adk-menu.d.ts} +6 -5
  155. package/{otp/index.d.ts → types/ngbase-adk-otp.d.ts} +8 -16
  156. package/{popover/index.d.ts → types/ngbase-adk-popover.d.ts} +14 -2
  157. package/{portal/index.d.ts → types/ngbase-adk-portal.d.ts} +29 -8
  158. package/{radio/index.d.ts → types/ngbase-adk-radio.d.ts} +9 -12
  159. package/{resizable/index.d.ts → types/ngbase-adk-resizable.d.ts} +4 -4
  160. package/{scroll-area/index.d.ts → types/ngbase-adk-scroll-area.d.ts} +2 -1
  161. package/{select/index.d.ts → types/ngbase-adk-select.d.ts} +8 -22
  162. package/{selectable/index.d.ts → types/ngbase-adk-selectable.d.ts} +6 -10
  163. package/{sheet/index.d.ts → types/ngbase-adk-sheet.d.ts} +4 -3
  164. package/{sidenav/index.d.ts → types/ngbase-adk-sidenav.d.ts} +6 -6
  165. package/{slider/index.d.ts → types/ngbase-adk-slider.d.ts} +8 -17
  166. package/{sonner/index.d.ts → types/ngbase-adk-sonner.d.ts} +1 -3
  167. package/{stepper/index.d.ts → types/ngbase-adk-stepper.d.ts} +1 -4
  168. package/{switch/index.d.ts → types/ngbase-adk-switch.d.ts} +7 -14
  169. package/{table/index.d.ts → types/ngbase-adk-table.d.ts} +126 -3
  170. package/{test/index.d.ts → types/ngbase-adk-test.d.ts} +1 -1
  171. package/{toggle-group/index.d.ts → types/ngbase-adk-toggle-group.d.ts} +5 -10
  172. package/types/ngbase-adk-toggle.d.ts +14 -0
  173. package/{tooltip/index.d.ts → types/ngbase-adk-tooltip.d.ts} +9 -11
  174. package/{tour/index.d.ts → types/ngbase-adk-tour.d.ts} +4 -6
  175. package/{utils/index.d.ts → types/ngbase-adk-utils.d.ts} +15 -11
  176. package/clipboard/index.d.ts +0 -11
  177. package/form-field/index.d.ts +0 -97
  178. package/jwt/index.d.ts +0 -20
  179. package/toggle/index.d.ts +0 -16
  180. /package/{a11y/index.d.ts → types/ngbase-adk-a11y.d.ts} +0 -0
  181. /package/{avatar/index.d.ts → types/ngbase-adk-avatar.d.ts} +0 -0
  182. /package/{bidi/index.d.ts → types/ngbase-adk-bidi.d.ts} +0 -0
  183. /package/{breadcrumb/index.d.ts → types/ngbase-adk-breadcrumb.d.ts} +0 -0
  184. /package/{cache/index.d.ts → types/ngbase-adk-cache.d.ts} +0 -0
  185. /package/{carousel/index.d.ts → types/ngbase-adk-carousel.d.ts} +0 -0
  186. /package/{chip/index.d.ts → types/ngbase-adk-chip.d.ts} +0 -0
  187. /package/{collections/index.d.ts → types/ngbase-adk-collections.d.ts} +0 -0
  188. /package/{cookies/index.d.ts → types/ngbase-adk-cookies.d.ts} +0 -0
  189. /package/{drag/index.d.ts → types/ngbase-adk-drag.d.ts} +0 -0
  190. /package/{hover-card/index.d.ts → types/ngbase-adk-hover-card.d.ts} +0 -0
  191. /package/{icon/index.d.ts → types/ngbase-adk-icon.d.ts} +0 -0
  192. /package/{keys/index.d.ts → types/ngbase-adk-keys.d.ts} +0 -0
  193. /package/{layout/index.d.ts → types/ngbase-adk-layout.d.ts} +0 -0
  194. /package/{list/index.d.ts → types/ngbase-adk-list.d.ts} +0 -0
  195. /package/{mask/index.d.ts → types/ngbase-adk-mask.d.ts} +0 -0
  196. /package/{network/index.d.ts → types/ngbase-adk-network.d.ts} +0 -0
  197. /package/{pagination/index.d.ts → types/ngbase-adk-pagination.d.ts} +0 -0
  198. /package/{progress/index.d.ts → types/ngbase-adk-progress.d.ts} +0 -0
  199. /package/{tabs/index.d.ts → types/ngbase-adk-tabs.d.ts} +0 -0
  200. /package/{translate/index.d.ts → types/ngbase-adk-translate.d.ts} +0 -0
  201. /package/{tree/index.d.ts → types/ngbase-adk-tree.d.ts} +0 -0
  202. /package/{virtualizer/index.d.ts → types/ngbase-adk-virtualizer.d.ts} +0 -0
  203. /package/{index.d.ts → types/ngbase-adk.d.ts} +0 -0
@@ -1,10 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, computed, Injectable, inject, ElementRef, input, Directive, contentChildren, viewChild, ViewContainerRef, effect, Component, ChangeDetectionStrategy } from '@angular/core';
2
+ import { signal, computed, Injectable, inject, ElementRef, input, Directive, contentChildren, viewChild, ViewContainerRef, effect, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { ngbPopoverPortal, tooltipPosition } from '@ngbase/adk/popover';
4
4
  import { BaseDialog } from '@ngbase/adk/portal';
5
5
  import { fromEvent, startWith, debounceTime, take } from 'rxjs';
6
- import { trigger, state, style, transition, animate } from '@angular/animations';
7
- import { createHostAnimation, fadeAnimation } from '@ngbase/adk/utils';
8
6
 
9
7
  class NgbTourService {
10
8
  constructor() {
@@ -119,10 +117,10 @@ class NgbTourService {
119
117
  this.diaRef?.diaRef.close();
120
118
  this.diaRef = undefined;
121
119
  }
122
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTourService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
123
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTourService, providedIn: 'root' }); }
120
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTourService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
121
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTourService, providedIn: 'root' }); }
124
122
  }
125
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTourService, decorators: [{
123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTourService, decorators: [{
126
124
  type: Injectable,
127
125
  args: [{ providedIn: 'root' }]
128
126
  }] });
@@ -135,48 +133,37 @@ class NgbTourStep {
135
133
  this.ngbTourStep = input.required(...(ngDevMode ? [{ debugName: "ngbTourStep" }] : []));
136
134
  this.tourService.addStep(this);
137
135
  }
138
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTourStep, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
139
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0", type: NgbTourStep, isStandalone: true, selector: "[ngbTourStep]", inputs: { ngbTourStep: { classPropertyName: "ngbTourStep", publicName: "ngbTourStep", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
136
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTourStep, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
137
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.0", type: NgbTourStep, isStandalone: true, selector: "[ngbTourStep]", inputs: { ngbTourStep: { classPropertyName: "ngbTourStep", publicName: "ngbTourStep", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
140
138
  }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTourStep, decorators: [{
139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTourStep, decorators: [{
142
140
  type: Directive,
143
141
  args: [{
144
142
  selector: '[ngbTourStep]',
145
143
  }]
146
- }], ctorParameters: () => [] });
144
+ }], ctorParameters: () => [], propDecorators: { ngbTourStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngbTourStep", required: true }] }] } });
147
145
 
148
146
  class NgbTour {
149
147
  constructor() {
150
148
  this.tourService = inject(NgbTourService);
151
- this.steps = contentChildren(NgbTourStep, ...(ngDevMode ? [{ debugName: "steps", descendants: true }] : [{ descendants: true }]));
149
+ this.steps = contentChildren(NgbTourStep, { ...(ngDevMode ? { debugName: "steps" } : {}), descendants: true });
152
150
  }
153
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTour, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
154
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.2.0", type: NgbTour, isStandalone: true, selector: "[ngbTour]", queries: [{ propertyName: "steps", predicate: NgbTourStep, descendants: true, isSignal: true }], ngImport: i0 }); }
151
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTour, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
152
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.0", type: NgbTour, isStandalone: true, selector: "[ngbTour]", queries: [{ propertyName: "steps", predicate: NgbTourStep, descendants: true, isSignal: true }], ngImport: i0 }); }
155
153
  }
156
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTour, decorators: [{
154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTour, decorators: [{
157
155
  type: Directive,
158
156
  args: [{
159
157
  selector: '[ngbTour]',
160
158
  }]
161
- }] });
162
-
163
- const slideInOutAnimation = trigger('slideInOutAnimation', [
164
- state('1', style({ transform: 'none', opacity: 1 })),
165
- state('void', style({ transform: 'translateY(-20px)', opacity: 0 })),
166
- state('0', style({ transform: 'translateY(-20px)', opacity: 0 })),
167
- transition('* => *', animate('100ms ease-out')),
168
- ]);
169
- const tourAnimation = [
170
- createHostAnimation(['@slideInOutAnimation', '@fadeAnimation']),
171
- slideInOutAnimation,
172
- fadeAnimation('200ms'),
173
- ];
159
+ }], propDecorators: { steps: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => NgbTourStep), { ...{ descendants: true }, isSignal: true }] }] } });
174
160
 
175
161
  class NgbBaseTour extends BaseDialog {
176
162
  constructor() {
177
163
  super();
164
+ this.hasAnimations = true;
165
+ this.contentContainer = viewChild('contentContainer', { ...(ngDevMode ? { debugName: "contentContainer" } : {}), read: ViewContainerRef });
178
166
  this.tourService = inject(NgbTourService);
179
- this.myDialog = viewChild('myDialog', ...(ngDevMode ? [{ debugName: "myDialog", read: ViewContainerRef }] : [{ read: ViewContainerRef }]));
180
167
  this.container = viewChild('container', ...(ngDevMode ? [{ debugName: "container" }] : []));
181
168
  this.lastPosition = 'top';
182
169
  this.scrolled = signal(0, ...(ngDevMode ? [{ debugName: "scrolled" }] : []));
@@ -222,13 +209,8 @@ class NgbBaseTour extends BaseDialog {
222
209
  });
223
210
  };
224
211
  setTimeout(() => {
225
- this._afterViewSource.next(this.myDialog());
226
212
  this.container().nativeElement.classList.add('transition-all');
227
213
  }, 5000);
228
- // (() => {
229
- // // setTimeout(() => {
230
- // // }, 1000);
231
- // });
232
214
  effect(() => {
233
215
  const target = this.target() || this.tooltipOptions.target;
234
216
  this.tooltipOptions.target = target;
@@ -265,23 +247,37 @@ class NgbBaseTour extends BaseDialog {
265
247
  setOptions(options) {
266
248
  this.options = options;
267
249
  }
250
+ onAnimationEnd(event) {
251
+ if (event.target === event.currentTarget) {
252
+ this.animationDone();
253
+ }
254
+ }
268
255
  ngOnDestroy() {
269
256
  window.removeEventListener('wheel', this.updateDimension);
270
257
  this.document.body.style.overflow = '';
271
258
  }
272
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbBaseTour, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
273
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.0", type: NgbBaseTour, isStandalone: true, selector: "[ngbTour]", host: { listeners: { "@parentAnimation.done": "animationDone()" }, properties: { "@parentAnimation": "" } }, viewQueries: [{ propertyName: "myDialog", first: true, predicate: ["myDialog"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "container", first: true, predicate: ["container"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
259
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbBaseTour, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
260
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.0", type: NgbBaseTour, isStandalone: true, selector: "[ngbTour]", viewQueries: [{ propertyName: "contentContainer", first: true, predicate: ["contentContainer"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "container", first: true, predicate: ["container"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
274
261
  <div
275
262
  #container
276
- class="pointer-events-auto fixed z-10 overflow-auto rounded-md border bg-background p-1 shadow-md"
277
- [@slideInOutAnimation]
263
+ (animationend)="onAnimationEnd($event)"
264
+ class="{{
265
+ 'pointer-events-auto fixed z-10 overflow-auto rounded-md border bg-background p-1 shadow-md' +
266
+ (closing() ? ' tour-content-leave' : ' tour-content')
267
+ }}"
278
268
  >
279
- <ng-container #myDialog />
269
+ <ng-container #contentContainer />
280
270
  </div>
281
- <div class="pointer-events-auto fixed top-0 h-full w-full bg-black/20" [@fadeAnimation]></div>
282
- `, isInline: true, animations: [tourAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
271
+ <div
272
+ (animationend)="onAnimationEnd($event)"
273
+ class="{{
274
+ 'pointer-events-auto fixed top-0 h-full w-full bg-black/20' +
275
+ (closing() ? ' tour-backdrop-leave' : ' tour-backdrop')
276
+ }}"
277
+ ></div>
278
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
283
279
  }
284
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbBaseTour, decorators: [{
280
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbBaseTour, decorators: [{
285
281
  type: Component,
286
282
  args: [{
287
283
  selector: '[ngbTour]',
@@ -289,24 +285,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImpor
289
285
  template: `
290
286
  <div
291
287
  #container
292
- class="pointer-events-auto fixed z-10 overflow-auto rounded-md border bg-background p-1 shadow-md"
293
- [@slideInOutAnimation]
288
+ (animationend)="onAnimationEnd($event)"
289
+ class="{{
290
+ 'pointer-events-auto fixed z-10 overflow-auto rounded-md border bg-background p-1 shadow-md' +
291
+ (closing() ? ' tour-content-leave' : ' tour-content')
292
+ }}"
294
293
  >
295
- <ng-container #myDialog />
294
+ <ng-container #contentContainer />
296
295
  </div>
297
- <div class="pointer-events-auto fixed top-0 h-full w-full bg-black/20" [@fadeAnimation]></div>
296
+ <div
297
+ (animationend)="onAnimationEnd($event)"
298
+ class="{{
299
+ 'pointer-events-auto fixed top-0 h-full w-full bg-black/20' +
300
+ (closing() ? ' tour-backdrop-leave' : ' tour-backdrop')
301
+ }}"
302
+ ></div>
298
303
  `,
299
- host: {
300
- '[@parentAnimation]': '',
301
- '(@parentAnimation.done)': 'animationDone()',
302
- },
303
- animations: [tourAnimation],
304
304
  }]
305
- }], ctorParameters: () => [] });
305
+ }], ctorParameters: () => [], propDecorators: { contentContainer: [{ type: i0.ViewChild, args: ['contentContainer', { ...{ read: ViewContainerRef }, isSignal: true }] }], container: [{ type: i0.ViewChild, args: ['container', { isSignal: true }] }] } });
306
306
 
307
307
  /**
308
308
  * Generated bundle index. Do not edit.
309
309
  */
310
310
 
311
- export { NgbBaseTour, NgbTour, NgbTourService, NgbTourStep, slideInOutAnimation, tourAnimation };
311
+ export { NgbBaseTour, NgbTour, NgbTourService, NgbTourStep };
312
312
  //# sourceMappingURL=ngbase-adk-tour.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngbase-adk-tour.mjs","sources":["../../../projects/adk/tour/tour.service.ts","../../../projects/adk/tour/tour-step.ts","../../../projects/adk/tour/tour.ts","../../../projects/adk/tour/animation.ts","../../../projects/adk/tour/tour-base.ts","../../../projects/adk/tour/ngbase-adk-tour.ts"],"sourcesContent":["import { Injectable, computed, signal } from '@angular/core';\nimport { DialogInput } from '@ngbase/adk/portal';\nimport { PopoverOpen, ngbPopoverPortal } from '@ngbase/adk/popover';\nimport { NgbTourStep } from './tour-step';\n\n@Injectable({ providedIn: 'root' })\nexport class NgbTourService {\n private readonly popover = ngbPopoverPortal();\n readonly steps = signal<NgbTourStep[]>([]);\n readonly step = signal(-1);\n private readonly ids = signal<string[]>([]);\n readonly currentStep = computed(() => {\n const id = this.ids()[this.step()];\n const steps = this.steps();\n return steps.find(x => x.ngbTourStep() === id);\n });\n private diaRef?: PopoverOpen<any>;\n private id = 0;\n private template!: DialogInput<any>;\n readonly showPrev = computed(() => this.step() > 0);\n readonly showNext = computed(() => this.step() < this.ids().length - 1);\n readonly isLast = computed(() => this.step() === this.ids().length - 1);\n readonly totalSteps = computed(() => this.ids().length);\n scrolled = signal(0);\n private readonly clipPath = computed(() => {\n const _ = this.scrolled();\n const currentStep = this.currentStep();\n if (!currentStep) {\n return '';\n }\n const { width, height, top, left } = currentStep.el.nativeElement.getBoundingClientRect();\n return `polygon(\n 0 0,\n 100% 0,\n 100% ${top}px,\n ${left}px ${top}px,\n ${left}px ${top + height}px,\n ${left + width}px ${top + height}px,\n ${left + width}px ${top}px,\n 100% ${top}px,\n 100% 100%,\n 0 100%,\n 0 0\n )`;\n });\n\n addStep(step: NgbTourStep) {\n this.steps.update(x => [...x, step]);\n }\n\n start<T>(comp: DialogInput<T>, ids: string[]) {\n this.template = comp;\n this.ids.set(ids);\n this.step.set(-1);\n this.next();\n }\n\n prev() {\n const steps = this.ids();\n const prevStep = this.step();\n if (steps.length) {\n const step = (prevStep - 1 + steps.length) % steps.length;\n this.go(step);\n }\n }\n\n next() {\n const steps = this.ids();\n const prevStep = this.step();\n if (steps.length) {\n const step = (prevStep + 1) % steps.length;\n if (prevStep > step) {\n this.stop();\n return;\n }\n this.go(step);\n }\n }\n\n go(id: number) {\n const steps = this.steps();\n const ids = this.ids();\n if (steps.length) {\n // validate the step number is within the range\n if (id < 0 || id >= ids.length) {\n return;\n }\n this.step.set(id);\n const step = steps.find(x => x.ngbTourStep() === ids[id]);\n if (!step) {\n return;\n }\n if (this.diaRef) {\n this.diaRef.parent.target.set(step.el.nativeElement);\n } else {\n this.showOverlay(step.el.nativeElement);\n }\n }\n }\n\n stop() {\n this.hideOverlay();\n clearInterval(this.id);\n }\n\n private showOverlay(el: HTMLElement) {\n this.diaRef?.diaRef.close();\n\n this.diaRef = this.popover.open(this.template, {\n target: el,\n position: 'right',\n className: 'transition-all',\n backdropClassName: 'bg-black/20',\n clipPath: this.clipPath,\n smoothScroll: true,\n anchor: true,\n backdropColor: true,\n width: '400px',\n disableClose: true,\n });\n this.scrolled = this.diaRef.parent.scrolled;\n }\n\n private hideOverlay() {\n this.diaRef?.diaRef.close();\n this.diaRef = undefined;\n }\n}\n","import { Directive, ElementRef, inject, input } from '@angular/core';\nimport { NgbTourService } from './tour.service';\n\n@Directive({\n selector: '[ngbTourStep]',\n})\nexport class NgbTourStep {\n readonly el = inject<ElementRef>(ElementRef);\n readonly tourService = inject(NgbTourService);\n\n // Inputs\n readonly ngbTourStep = input.required<string>();\n\n constructor() {\n this.tourService.addStep(this);\n }\n}\n","import { inject, contentChildren, Directive } from '@angular/core';\nimport { NgbTourService } from './tour.service';\nimport { NgbTourStep } from './tour-step';\n\n@Directive({\n selector: '[ngbTour]',\n})\nexport class NgbTour {\n readonly tourService = inject(NgbTourService);\n readonly steps = contentChildren(NgbTourStep, { descendants: true });\n}\n","import { trigger, state, style, transition, animate } from '@angular/animations';\nimport { createHostAnimation, fadeAnimation } from '@ngbase/adk/utils';\n\nexport const slideInOutAnimation = trigger('slideInOutAnimation', [\n state('1', style({ transform: 'none', opacity: 1 })),\n state('void', style({ transform: 'translateY(-20px)', opacity: 0 })),\n state('0', style({ transform: 'translateY(-20px)', opacity: 0 })),\n transition('* => *', animate('100ms ease-out')),\n]);\n\nexport const tourAnimation = [\n createHostAnimation(['@slideInOutAnimation', '@fadeAnimation']),\n slideInOutAnimation,\n fadeAnimation('200ms'),\n];\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n OnDestroy,\n signal,\n viewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { PopoverOptions, PopoverPosition, tooltipPosition } from '@ngbase/adk/popover';\nimport { BaseDialog, DialogOptions } from '@ngbase/adk/portal';\nimport { debounceTime, fromEvent, startWith, take } from 'rxjs';\nimport { NgbTourService } from './tour.service';\nimport { tourAnimation } from './animation';\n\n@Component({\n selector: '[ngbTour]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div\n #container\n class=\"pointer-events-auto fixed z-10 overflow-auto rounded-md border bg-background p-1 shadow-md\"\n [@slideInOutAnimation]\n >\n <ng-container #myDialog />\n </div>\n <div class=\"pointer-events-auto fixed top-0 h-full w-full bg-black/20\" [@fadeAnimation]></div>\n `,\n host: {\n '[@parentAnimation]': '',\n '(@parentAnimation.done)': 'animationDone()',\n },\n animations: [tourAnimation],\n})\nexport class NgbBaseTour extends BaseDialog implements OnDestroy {\n readonly tourService = inject(NgbTourService);\n readonly myDialog = viewChild('myDialog', { read: ViewContainerRef });\n readonly container = viewChild<ElementRef<HTMLElement>>('container');\n\n options!: DialogOptions;\n tooltipOptions!: PopoverOptions;\n private lastPosition: PopoverPosition = 'top';\n readonly scrolled = signal(0);\n\n readonly clipPath = computed(() => {\n const _ = this.scrolled();\n const currentStep = this.tourService.currentStep()!;\n const { width, height, top, left } = currentStep.el.nativeElement.getBoundingClientRect();\n return `polygon(\n 0 0,\n 100% 0,\n 100% ${top}px,\n ${left}px ${top}px,\n ${left}px ${top + height}px,\n ${left + width}px ${top + height}px,\n ${left + width}px ${top}px,\n 100% ${top}px,\n 100% 100%,\n 0 100%,\n 0 0\n )`;\n });\n\n constructor() {\n super();\n setTimeout(() => {\n this._afterViewSource.next(this.myDialog()!);\n this.container()!.nativeElement.classList.add('transition-all');\n }, 5000);\n // (() => {\n\n // // setTimeout(() => {\n // // }, 1000);\n // });\n\n effect(() => {\n const target = this.target() || this.tooltipOptions.target;\n this.tooltipOptions.target = target;\n target.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n\n fromEvent(window, 'scroll')\n .pipe(startWith(1), debounceTime(50), take(1))\n .subscribe(() => {\n this.lastPosition = this.tooltipOptions.position || 'bottom';\n const el = this.container()!.nativeElement;\n if (this.options.backdrop) {\n this.document.body.style.overflow = 'hidden';\n }\n if (this.options.width === 'target') {\n // update the width of the container to be the same as the target\n el.style.width = `${this.tooltipOptions.target.offsetWidth}px`;\n } else if (this.options.width) {\n el.style.width = this.options.width;\n }\n if (this.options.height) {\n el.style.height = this.options.height;\n }\n if (this.options.maxHeight) {\n el.style.maxHeight = this.options.maxHeight;\n }\n this.scrolled.update(x => x + 1);\n this.updateDimension();\n });\n // if (!this.options.backdrop) {\n // // window.addEventListener('wheel', this.updateDimension);\n // }\n });\n }\n\n private updateDimension = () => {\n requestAnimationFrame(() => {\n const el = this.container()!.nativeElement;\n const { top, left, bottom, position } = tooltipPosition({\n target: this.tooltipOptions.target,\n el,\n position: this.lastPosition,\n client: this.tooltipOptions.client,\n offset: this.tooltipOptions.offset,\n });\n this.lastPosition = position;\n // we need to update the values directly instead of signal to avoid too many CD checks\n if (bottom) {\n el.style.bottom = `${bottom}px`;\n el.style.top = '';\n } else if (top) {\n el.style.top = `${top}px`;\n el.style.bottom = '';\n }\n el.style.left = `${left}px`;\n });\n };\n\n override setOptions(options: DialogOptions): void {\n this.options = options;\n }\n\n ngOnDestroy(): void {\n window.removeEventListener('wheel', this.updateDimension);\n this.document.body.style.overflow = '';\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAMa,cAAc,CAAA;AAD3B,IAAA,WAAA,GAAA;QA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AA,EAAA,EAAA,UAAA,EAAA,EAAA,kBAAA,EAAA,EAAA,EAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,UAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,IAAA,EAE4B,gBAAgB,EAlBxD,QAAA,EAAA,IAAA,EAAA,EAAA,EAAA,YAAA,EAAA,WAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,WAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;;;GAST,EAKW,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAC,aAAa,CAAC,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEhB,WAAW,EAAA,UAAA,EAAA,CAAA;kBAnBvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;oBACrB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;AAST,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,oBAAoB,EAAE,EAAE;AACxB,wBAAA,yBAAyB,EAAE,iBAAiB;AAC7C,qBAAA;oBACD,UAAU,EAAE,CAAC,aAAa,CAAC;AAC5B,iBAAA;;;ACpCD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngbase-adk-tour.mjs","sources":["../../../projects/adk/tour/tour.service.ts","../../../projects/adk/tour/tour-step.ts","../../../projects/adk/tour/tour.ts","../../../projects/adk/tour/tour-base.ts","../../../projects/adk/tour/ngbase-adk-tour.ts"],"sourcesContent":["import { Injectable, computed, signal } from '@angular/core';\nimport { DialogInput } from '@ngbase/adk/portal';\nimport { PopoverOpen, ngbPopoverPortal } from '@ngbase/adk/popover';\nimport { NgbTourStep } from './tour-step';\n\n@Injectable({ providedIn: 'root' })\nexport class NgbTourService {\n private readonly popover = ngbPopoverPortal();\n readonly steps = signal<NgbTourStep[]>([]);\n readonly step = signal(-1);\n private readonly ids = signal<string[]>([]);\n readonly currentStep = computed(() => {\n const id = this.ids()[this.step()];\n const steps = this.steps();\n return steps.find(x => x.ngbTourStep() === id);\n });\n private diaRef?: PopoverOpen<any>;\n private id = 0;\n private template!: DialogInput<any>;\n readonly showPrev = computed(() => this.step() > 0);\n readonly showNext = computed(() => this.step() < this.ids().length - 1);\n readonly isLast = computed(() => this.step() === this.ids().length - 1);\n readonly totalSteps = computed(() => this.ids().length);\n scrolled = signal(0);\n private readonly clipPath = computed(() => {\n const _ = this.scrolled();\n const currentStep = this.currentStep();\n if (!currentStep) {\n return '';\n }\n const { width, height, top, left } = currentStep.el.nativeElement.getBoundingClientRect();\n return `polygon(\n 0 0,\n 100% 0,\n 100% ${top}px,\n ${left}px ${top}px,\n ${left}px ${top + height}px,\n ${left + width}px ${top + height}px,\n ${left + width}px ${top}px,\n 100% ${top}px,\n 100% 100%,\n 0 100%,\n 0 0\n )`;\n });\n\n addStep(step: NgbTourStep) {\n this.steps.update(x => [...x, step]);\n }\n\n start<T>(comp: DialogInput<T>, ids: string[]) {\n this.template = comp;\n this.ids.set(ids);\n this.step.set(-1);\n this.next();\n }\n\n prev() {\n const steps = this.ids();\n const prevStep = this.step();\n if (steps.length) {\n const step = (prevStep - 1 + steps.length) % steps.length;\n this.go(step);\n }\n }\n\n next() {\n const steps = this.ids();\n const prevStep = this.step();\n if (steps.length) {\n const step = (prevStep + 1) % steps.length;\n if (prevStep > step) {\n this.stop();\n return;\n }\n this.go(step);\n }\n }\n\n go(id: number) {\n const steps = this.steps();\n const ids = this.ids();\n if (steps.length) {\n // validate the step number is within the range\n if (id < 0 || id >= ids.length) {\n return;\n }\n this.step.set(id);\n const step = steps.find(x => x.ngbTourStep() === ids[id]);\n if (!step) {\n return;\n }\n if (this.diaRef) {\n this.diaRef.parent.target.set(step.el.nativeElement);\n } else {\n this.showOverlay(step.el.nativeElement);\n }\n }\n }\n\n stop() {\n this.hideOverlay();\n clearInterval(this.id);\n }\n\n private showOverlay(el: HTMLElement) {\n this.diaRef?.diaRef.close();\n\n this.diaRef = this.popover.open(this.template, {\n target: el,\n position: 'right',\n className: 'transition-all',\n backdropClassName: 'bg-black/20',\n clipPath: this.clipPath,\n smoothScroll: true,\n anchor: true,\n backdropColor: true,\n width: '400px',\n disableClose: true,\n });\n this.scrolled = this.diaRef.parent.scrolled;\n }\n\n private hideOverlay() {\n this.diaRef?.diaRef.close();\n this.diaRef = undefined;\n }\n}\n","import { Directive, ElementRef, inject, input } from '@angular/core';\nimport { NgbTourService } from './tour.service';\n\n@Directive({\n selector: '[ngbTourStep]',\n})\nexport class NgbTourStep {\n readonly el = inject<ElementRef>(ElementRef);\n readonly tourService = inject(NgbTourService);\n\n // Inputs\n readonly ngbTourStep = input.required<string>();\n\n constructor() {\n this.tourService.addStep(this);\n }\n}\n","import { inject, contentChildren, Directive } from '@angular/core';\nimport { NgbTourService } from './tour.service';\nimport { NgbTourStep } from './tour-step';\n\n@Directive({\n selector: '[ngbTour]',\n})\nexport class NgbTour {\n readonly tourService = inject(NgbTourService);\n readonly steps = contentChildren(NgbTourStep, { descendants: true });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n OnDestroy,\n signal,\n viewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { PopoverOptions, PopoverPosition, tooltipPosition } from '@ngbase/adk/popover';\nimport { BaseDialog, DialogOptions } from '@ngbase/adk/portal';\nimport { debounceTime, fromEvent, startWith, take } from 'rxjs';\nimport { NgbTourService } from './tour.service';\n\n@Component({\n selector: '[ngbTour]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div\n #container\n (animationend)=\"onAnimationEnd($event)\"\n class=\"{{\n 'pointer-events-auto fixed z-10 overflow-auto rounded-md border bg-background p-1 shadow-md' +\n (closing() ? ' tour-content-leave' : ' tour-content')\n }}\"\n >\n <ng-container #contentContainer />\n </div>\n <div\n (animationend)=\"onAnimationEnd($event)\"\n class=\"{{\n 'pointer-events-auto fixed top-0 h-full w-full bg-black/20' +\n (closing() ? ' tour-backdrop-leave' : ' tour-backdrop')\n }}\"\n ></div>\n `,\n})\nexport class NgbBaseTour extends BaseDialog implements OnDestroy {\n protected override readonly hasAnimations = true;\n readonly contentContainer = viewChild('contentContainer', { read: ViewContainerRef });\n readonly tourService = inject(NgbTourService);\n readonly container = viewChild<ElementRef<HTMLElement>>('container');\n\n options!: DialogOptions;\n tooltipOptions!: PopoverOptions;\n private lastPosition: PopoverPosition = 'top';\n readonly scrolled = signal(0);\n\n readonly clipPath = computed(() => {\n const _ = this.scrolled();\n const currentStep = this.tourService.currentStep()!;\n const { width, height, top, left } = currentStep.el.nativeElement.getBoundingClientRect();\n return `polygon(\n 0 0,\n 100% 0,\n 100% ${top}px,\n ${left}px ${top}px,\n ${left}px ${top + height}px,\n ${left + width}px ${top + height}px,\n ${left + width}px ${top}px,\n 100% ${top}px,\n 100% 100%,\n 0 100%,\n 0 0\n )`;\n });\n\n constructor() {\n super();\n setTimeout(() => {\n this.container()!.nativeElement.classList.add('transition-all');\n }, 5000);\n\n effect(() => {\n const target = this.target() || this.tooltipOptions.target;\n this.tooltipOptions.target = target;\n target.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n\n fromEvent(window, 'scroll')\n .pipe(startWith(1), debounceTime(50), take(1))\n .subscribe(() => {\n this.lastPosition = this.tooltipOptions.position || 'bottom';\n const el = this.container()!.nativeElement;\n if (this.options.backdrop) {\n this.document.body.style.overflow = 'hidden';\n }\n if (this.options.width === 'target') {\n // update the width of the container to be the same as the target\n el.style.width = `${this.tooltipOptions.target.offsetWidth}px`;\n } else if (this.options.width) {\n el.style.width = this.options.width;\n }\n if (this.options.height) {\n el.style.height = this.options.height;\n }\n if (this.options.maxHeight) {\n el.style.maxHeight = this.options.maxHeight;\n }\n this.scrolled.update(x => x + 1);\n this.updateDimension();\n });\n // if (!this.options.backdrop) {\n // // window.addEventListener('wheel', this.updateDimension);\n // }\n });\n }\n\n private updateDimension = () => {\n requestAnimationFrame(() => {\n const el = this.container()!.nativeElement;\n const { top, left, bottom, position } = tooltipPosition({\n target: this.tooltipOptions.target,\n el,\n position: this.lastPosition,\n client: this.tooltipOptions.client,\n offset: this.tooltipOptions.offset,\n });\n this.lastPosition = position;\n // we need to update the values directly instead of signal to avoid too many CD checks\n if (bottom) {\n el.style.bottom = `${bottom}px`;\n el.style.top = '';\n } else if (top) {\n el.style.top = `${top}px`;\n el.style.bottom = '';\n }\n el.style.left = `${left}px`;\n });\n };\n\n override setOptions(options: DialogOptions): void {\n this.options = options;\n }\n\n onAnimationEnd(event: AnimationEvent) {\n if (event.target === event.currentTarget) {\n this.animationDone();\n }\n }\n\n ngOnDestroy(): void {\n window.removeEventListener('wheel', this.updateDimension);\n this.document.body.style.overflow = '';\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAMa,cAAc,CAAA;AAD3B,IAAA,WAAA,GAAA;QAEmB,IAAA,CAAA,OAAO,GAAG,gBAAgB,EAAE;AACpC,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAgB,EAAE,iDAAC;AACjC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,gDAAC;AACT,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAW,EAAE,+CAAC;AAClC,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;AACnC,YAAA,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AAClC,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAA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,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;AAkBT,EAAA,CAAA;AACF,iBAAA;AAGuC,SAAA,CAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,EAAA,gBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,kBAAkB,OAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,iEAE5B,WAAW,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC5CrE;;AAEG;;;;"}
@@ -97,10 +97,10 @@ class TranslateService {
97
97
  this.status.set('done');
98
98
  }));
99
99
  }
100
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TranslateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
101
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TranslateService }); }
100
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TranslateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
101
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TranslateService }); }
102
102
  }
103
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TranslateService, decorators: [{
103
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TranslateService, decorators: [{
104
104
  type: Injectable
105
105
  }] });
106
106
  // function memoize(fn: (...args: any[]) => any) {
@@ -123,12 +123,10 @@ class Translate {
123
123
  constructor() {
124
124
  this.translate = injectTranslate();
125
125
  this.value = signal([''], ...(ngDevMode ? [{ debugName: "value" }] : []));
126
- this.linkedValue = linkedSignal({
127
- source: () => ({ value: this.value(), data: this.translate.translations() }),
126
+ this.linkedValue = linkedSignal({ ...(ngDevMode ? { debugName: "linkedValue" } : {}), source: () => ({ value: this.value(), data: this.translate.translations() }),
128
127
  computation: ({ value }) => {
129
128
  return this.translate.translate(value[0], value[1]);
130
- },
131
- });
129
+ } });
132
130
  }
133
131
  transform(value, ...args) {
134
132
  // untracked to avoid error: cannot set signal inside computation
@@ -137,10 +135,10 @@ class Translate {
137
135
  });
138
136
  return this.linkedValue;
139
137
  }
140
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: Translate, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
141
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.0", ngImport: i0, type: Translate, isStandalone: true, name: "t" }); }
138
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: Translate, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
139
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: Translate, isStandalone: true, name: "t" }); }
142
140
  }
143
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: Translate, decorators: [{
141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: Translate, decorators: [{
144
142
  type: Pipe,
145
143
  args: [{
146
144
  name: 't',
@@ -1 +1 @@
1
- {"version":3,"file":"ngbase-adk-translate.mjs","sources":["../../../projects/adk/translate/config.ts","../../../projects/adk/translate/translate.service.ts","../../../projects/adk/translate/translate.ts","../../../projects/adk/translate/ngbase-adk-translate.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { inject, InjectionToken, provideAppInitializer } from '@angular/core';\nimport { catchError, Observable } from 'rxjs';\nimport { TranslateService } from './translate.service';\n\nexport type Translation<T = any> = Record<string, T>;\n\nexport interface TranslateConfig {\n defaultLang: string;\n preloadedLanguages?: Record<string, Translation>;\n path?: string;\n loader?: (lang: string, fallbackLang: string, config: TranslateConfig) => Observable<Translation>;\n}\n\nexport const TRANSLATE_CONFIG = new InjectionToken<TranslateConfig>('TRANSLATE_CONFIG');\n\nexport function provideTranslate(config: TranslateConfig) {\n config.loader ??= defaultLoader;\n\n return [\n { provide: TRANSLATE_CONFIG, useValue: config },\n TranslateService,\n provideAppInitializer(() => {\n const translate = inject(TranslateService);\n return translate.init();\n }),\n ];\n}\n\nexport function interpolate(translation: string, params: Record<string, any>) {\n return translation?.replace(/{{([^}]+)}}/g, (match, p1) => {\n return params[p1] || params[p1.trim()] || match;\n });\n}\n\nfunction defaultLoader(lang: string, fallbackLang: string, config: TranslateConfig) {\n const http = inject(HttpClient);\n const path = config.path ?? '/i18n/';\n return http\n .get<Record<string, any>>(`${path}${lang}.json`)\n .pipe(catchError(() => http.get<Record<string, any>>(`${path}${fallbackLang}.json`)));\n // return of([]).pipe(\n // delay(1),\n // switchMap(() =>\n // http\n // .get<Record<string, any>>(`/i18n/${lang}.json`)\n // .pipe(catchError(() => http.get<Record<string, any>>(`/i18n/${fallbackLang}.json`))),\n // ),\n // );\n}\n","import {\n computed,\n EnvironmentInjector,\n inject,\n Injectable,\n runInInjectionContext,\n signal,\n} from '@angular/core';\nimport { of, tap } from 'rxjs';\nimport { interpolate, TRANSLATE_CONFIG, TranslateConfig, Translation } from './config';\n\n@Injectable()\nexport class TranslateService {\n private config = inject<TranslateConfig>(TRANSLATE_CONFIG);\n private readonly _defaultLang = signal(this.config.defaultLang);\n private readonly _currentLang = signal<string>(this._defaultLang());\n readonly defaultLang = this._defaultLang.asReadonly();\n readonly currentLang = this._currentLang.asReadonly();\n private lastLang = this.currentLang();\n private readonly cachedTranslations = signal<\n Record<string, { data: Translation; cache: Map<string, string> }>\n >({});\n private readonly _translationData = computed(\n () =>\n this.cachedTranslations()[this.currentLang()] ||\n this.cachedTranslations()[this.lastLang] ||\n this.cachedTranslations()[this.defaultLang()] ||\n {},\n );\n readonly translations = computed(() => this._translationData().data || {});\n readonly envInjector = inject(EnvironmentInjector);\n readonly status = signal<'loading' | 'done' | 'error'>('loading');\n\n init() {\n return this.loadTranslations(this.currentLang(), this.defaultLang());\n }\n\n setDefaultLang(lang: string) {\n this._defaultLang.set(lang);\n }\n\n use(lang: string) {\n this.lastLang = this.currentLang();\n this._currentLang.set(lang);\n if (this.cachedTranslations()[lang]) return;\n runInInjectionContext(this.envInjector, () => {\n this.loadTranslations(lang, this.defaultLang()).subscribe();\n });\n }\n\n private loadTranslations(lang: string, fallbackLang: string) {\n this.status.set('loading');\n const data = this.config.preloadedLanguages?.[lang];\n const api = data ? of(data) : this.config.loader!(lang, fallbackLang, this.config);\n return api.pipe(\n tap(res => {\n this.cachedTranslations.update(cache => ({\n ...cache,\n [lang]: { data: res, cache: new Map() },\n }));\n this.status.set('done');\n }),\n );\n }\n\n /**\n * @key - The key to translate.\n * @data - The data to pass to the translation.\n * @returns The translated value.\n * The key can be a string or a nested key.\n * The data is used to interpolate the translation.\n */\n translate = (\n key: string,\n params: Record<string, any> = {},\n translationData: Translation = this.translations(),\n ) => {\n // we need to split the key by '.' and then interpolate the data\n const keys = key.split('.');\n let translation = keys.reduce((acc, k) => {\n return acc[k];\n }, translationData) as unknown as string;\n\n // translate the key with the params\n translation = interpolate(translation, params);\n\n return translation;\n };\n}\n\n// function memoize(fn: (...args: any[]) => any) {\n// const cache = new Map();\n// return (...args: any[]) => {\n// const key = JSON.stringify(args);\n// if (cache.has(key)) {\n// console.log('CACHE HIT', key);\n// return cache.get(key);\n// }\n// console.log('CACHE MISS', key);\n// const result = fn(...args);\n// cache.set(key, result);\n// return result;\n// };\n// }\n\nexport const injectTranslate = () => inject(TranslateService);\n","import {\n inject,\n Injector,\n linkedSignal,\n Pipe,\n PipeTransform,\n signal,\n untracked,\n} from '@angular/core';\nimport { injectTranslate } from './translate.service';\n\n@Pipe({\n name: 't',\n})\nexport class Translate implements PipeTransform {\n private translate = injectTranslate();\n private value = signal<[string, ...any[]]>(['']);\n private linkedValue = linkedSignal({\n source: () => ({ value: this.value(), data: this.translate.translations() }),\n computation: ({ value }) => {\n return this.translate.translate(value[0], value[1]);\n },\n });\n\n transform(value: string, ...args: any[]) {\n // untracked to avoid error: cannot set signal inside computation\n untracked(() => {\n this.value.set([value, ...args]);\n });\n return this.linkedValue;\n }\n}\n\nexport function translate() {\n const ts = injectTranslate();\n const injector = inject(Injector);\n return (value: string, ...args: any[]) => {\n return ts.translate(value, args[0], args[1]);\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAcO,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAAkB,kBAAkB,CAAC;AAEjF,SAAU,gBAAgB,CAAC,MAAuB,EAAA;AACtD,IAAA,MAAM,CAAC,MAAM,KAAK,aAAa;IAE/B,OAAO;AACL,QAAA,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE;QAC/C,gBAAgB;QAChB,qBAAqB,CAAC,MAAK;AACzB,YAAA,MAAM,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC1C,YAAA,OAAO,SAAS,CAAC,IAAI,EAAE;AACzB,SAAC,CAAC;KACH;AACH;AAEgB,SAAA,WAAW,CAAC,WAAmB,EAAE,MAA2B,EAAA;IAC1E,OAAO,WAAW,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE,KAAI;AACxD,QAAA,OAAO,MAAM,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,KAAK;AACjD,KAAC,CAAC;AACJ;AAEA,SAAS,aAAa,CAAC,IAAY,EAAE,YAAoB,EAAE,MAAuB,EAAA;AAChF,IAAA,MAAM,IAAI,GAAG,MAAM,CAA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base-adk-translate.mjs","sources":["../../../projects/adk/translate/config.ts","../../../projects/adk/translate/translate.service.ts","../../../projects/adk/translate/translate.ts","../../../projects/adk/translate/ngbase-adk-translate.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { inject, InjectionToken, provideAppInitializer } from '@angular/core';\nimport { catchError, Observable } from 'rxjs';\nimport { TranslateService } from './translate.service';\n\nexport type Translation<T = any> = Record<string, T>;\n\nexport interface TranslateConfig {\n defaultLang: string;\n preloadedLanguages?: Record<string, Translation>;\n path?: string;\n loader?: (lang: string, fallbackLang: string, config: TranslateConfig) => Observable<Translation>;\n}\n\nexport const TRANSLATE_CONFIG = new InjectionToken<TranslateConfig>('TRANSLATE_CONFIG');\n\nexport function provideTranslate(config: TranslateConfig) {\n config.loader ??= defaultLoader;\n\n return [\n { provide: TRANSLATE_CONFIG, useValue: config },\n TranslateService,\n provideAppInitializer(() => {\n const translate = inject(TranslateService);\n return translate.init();\n }),\n ];\n}\n\nexport function interpolate(translation: string, params: Record<string, any>) {\n return translation?.replace(/{{([^}]+)}}/g, (match, p1) => {\n return params[p1] || params[p1.trim()] || match;\n });\n}\n\nfunction defaultLoader(lang: string, fallbackLang: string, config: TranslateConfig) {\n const http = inject(HttpClient);\n const path = config.path ?? '/i18n/';\n return http\n .get<Record<string, any>>(`${path}${lang}.json`)\n .pipe(catchError(() => http.get<Record<string, any>>(`${path}${fallbackLang}.json`)));\n // return of([]).pipe(\n // delay(1),\n // switchMap(() =>\n // http\n // .get<Record<string, any>>(`/i18n/${lang}.json`)\n // .pipe(catchError(() => http.get<Record<string, any>>(`/i18n/${fallbackLang}.json`))),\n // ),\n // );\n}\n","import {\n computed,\n EnvironmentInjector,\n inject,\n Injectable,\n runInInjectionContext,\n signal,\n} from '@angular/core';\nimport { of, tap } from 'rxjs';\nimport { interpolate, TRANSLATE_CONFIG, TranslateConfig, Translation } from './config';\n\n@Injectable()\nexport class TranslateService {\n private config = inject<TranslateConfig>(TRANSLATE_CONFIG);\n private readonly _defaultLang = signal(this.config.defaultLang);\n private readonly _currentLang = signal<string>(this._defaultLang());\n readonly defaultLang = this._defaultLang.asReadonly();\n readonly currentLang = this._currentLang.asReadonly();\n private lastLang = this.currentLang();\n private readonly cachedTranslations = signal<\n Record<string, { data: Translation; cache: Map<string, string> }>\n >({});\n private readonly _translationData = computed(\n () =>\n this.cachedTranslations()[this.currentLang()] ||\n this.cachedTranslations()[this.lastLang] ||\n this.cachedTranslations()[this.defaultLang()] ||\n {},\n );\n readonly translations = computed(() => this._translationData().data || {});\n readonly envInjector = inject(EnvironmentInjector);\n readonly status = signal<'loading' | 'done' | 'error'>('loading');\n\n init() {\n return this.loadTranslations(this.currentLang(), this.defaultLang());\n }\n\n setDefaultLang(lang: string) {\n this._defaultLang.set(lang);\n }\n\n use(lang: string) {\n this.lastLang = this.currentLang();\n this._currentLang.set(lang);\n if (this.cachedTranslations()[lang]) return;\n runInInjectionContext(this.envInjector, () => {\n this.loadTranslations(lang, this.defaultLang()).subscribe();\n });\n }\n\n private loadTranslations(lang: string, fallbackLang: string) {\n this.status.set('loading');\n const data = this.config.preloadedLanguages?.[lang];\n const api = data ? of(data) : this.config.loader!(lang, fallbackLang, this.config);\n return api.pipe(\n tap(res => {\n this.cachedTranslations.update(cache => ({\n ...cache,\n [lang]: { data: res, cache: new Map() },\n }));\n this.status.set('done');\n }),\n );\n }\n\n /**\n * @key - The key to translate.\n * @data - The data to pass to the translation.\n * @returns The translated value.\n * The key can be a string or a nested key.\n * The data is used to interpolate the translation.\n */\n translate = (\n key: string,\n params: Record<string, any> = {},\n translationData: Translation = this.translations(),\n ) => {\n // we need to split the key by '.' and then interpolate the data\n const keys = key.split('.');\n let translation = keys.reduce((acc, k) => {\n return acc[k];\n }, translationData) as unknown as string;\n\n // translate the key with the params\n translation = interpolate(translation, params);\n\n return translation;\n };\n}\n\n// function memoize(fn: (...args: any[]) => any) {\n// const cache = new Map();\n// return (...args: any[]) => {\n// const key = JSON.stringify(args);\n// if (cache.has(key)) {\n// console.log('CACHE HIT', key);\n// return cache.get(key);\n// }\n// console.log('CACHE MISS', key);\n// const result = fn(...args);\n// cache.set(key, result);\n// return result;\n// };\n// }\n\nexport const injectTranslate = () => inject(TranslateService);\n","import {\n inject,\n Injector,\n linkedSignal,\n Pipe,\n PipeTransform,\n signal,\n untracked,\n} from '@angular/core';\nimport { injectTranslate } from './translate.service';\n\n@Pipe({\n name: 't',\n})\nexport class Translate implements PipeTransform {\n private translate = injectTranslate();\n private value = signal<[string, ...any[]]>(['']);\n private linkedValue = linkedSignal({\n source: () => ({ value: this.value(), data: this.translate.translations() }),\n computation: ({ value }) => {\n return this.translate.translate(value[0], value[1]);\n },\n });\n\n transform(value: string, ...args: any[]) {\n // untracked to avoid error: cannot set signal inside computation\n untracked(() => {\n this.value.set([value, ...args]);\n });\n return this.linkedValue;\n }\n}\n\nexport function translate() {\n const ts = injectTranslate();\n const injector = inject(Injector);\n return (value: string, ...args: any[]) => {\n return ts.translate(value, args[0], args[1]);\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAcO,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAAkB,kBAAkB,CAAC;AAEjF,SAAU,gBAAgB,CAAC,MAAuB,EAAA;AACtD,IAAA,MAAM,CAAC,MAAM,KAAK,aAAa;IAE/B,OAAO;AACL,QAAA,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE;QAC/C,gBAAgB;QAChB,qBAAqB,CAAC,MAAK;AACzB,YAAA,MAAM,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC1C,YAAA,OAAO,SAAS,CAAC,IAAI,EAAE;AACzB,QAAA,CAAC,CAAC;KACH;AACH;AAEM,SAAU,WAAW,CAAC,WAAmB,EAAE,MAA2B,EAAA;IAC1E,OAAO,WAAW,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE,KAAI;A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AE,GAAG;AACV,iBAAA;;SAoBe,SAAS,GAAA;AACvB,IAAA,MAAM,EAAE,GAAG,eAAe,EAAE;AAC5B,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACjC,IAAA,OAAO,CAAC,KAAa,EAAE,GAAG,IAAW,KAAI;AACvC,QAAA,OAAO,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAC9C,IAAA,CAAC;AACH;;ACvCA;;AAEG;;;;"}
@@ -10,7 +10,7 @@ class NgbTreeNode {
10
10
  this.treeNodeDef = inject(NgbTreeNodeDef);
11
11
  this.tree = inject(NgbTree);
12
12
  this.data = inject(TREE_NODE_DATA);
13
- this.container = viewChild('container', ...(ngDevMode ? [{ debugName: "container", read: ViewContainerRef }] : [{ read: ViewContainerRef }]));
13
+ this.container = viewChild('container', { ...(ngDevMode ? { debugName: "container" } : {}), read: ViewContainerRef });
14
14
  this.isOpen = computed(() => this.tree.opened().has(this.data.details.id), ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
15
15
  this.parent = computed(() => this.tree.getNode(this.data.details.parentId), ...(ngDevMode ? [{ debugName: "parent" }] : []));
16
16
  this.children = computed(() => {
@@ -28,8 +28,8 @@ class NgbTreeNode {
28
28
  const a11yItem = inject(AccessibleItem);
29
29
  a11yItem._ayId.set(this.tree.ayId);
30
30
  a11yItem.level.set(this.data.level);
31
- a11yItem._expandable = linkedSignal(this.hasChildren);
32
- a11yItem._expanded = linkedSignal(this.isOpen);
31
+ a11yItem._expandable = linkedSignal(this.hasChildren, ...(ngDevMode ? [{ debugName: "_expandable" }] : []));
32
+ a11yItem._expanded = linkedSignal(this.isOpen, ...(ngDevMode ? [{ debugName: "_expanded" }] : []));
33
33
  a11yItem.selectedChange.subscribe(() => {
34
34
  this.toggle();
35
35
  });
@@ -39,10 +39,10 @@ class NgbTreeNode {
39
39
  this.tree.toggle(this.data.details);
40
40
  }
41
41
  }
42
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTreeNode, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
43
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.2.0", type: NgbTreeNode, isStandalone: true, selector: "[ngbTreeNode]", host: { attributes: { "role": "treeitem" }, properties: { "style": "padding()", "attr.aria-expanded": "isOpen()" } }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], exportAs: ["ngbTreeNode"], hostDirectives: [{ directive: i1.AccessibleItem }], ngImport: i0 }); }
42
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTreeNode, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
43
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.0", type: NgbTreeNode, isStandalone: true, selector: "[ngbTreeNode]", host: { attributes: { "role": "treeitem" }, properties: { "style": "padding()", "attr.aria-expanded": "isOpen()" } }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], exportAs: ["ngbTreeNode"], hostDirectives: [{ directive: i1.AccessibleItem }], ngImport: i0 }); }
44
44
  }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTreeNode, decorators: [{
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTreeNode, decorators: [{
46
46
  type: Directive,
47
47
  args: [{
48
48
  selector: '[ngbTreeNode]',
@@ -54,7 +54,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImpor
54
54
  '[attr.aria-expanded]': 'isOpen()',
55
55
  },
56
56
  }]
57
- }], ctorParameters: () => [] });
57
+ }], ctorParameters: () => [], propDecorators: { container: [{ type: i0.ViewChild, args: ['container', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
58
58
  function aliasTreeNode(treeNode) {
59
59
  return { provide: NgbTreeNode, useExisting: treeNode };
60
60
  }
@@ -68,10 +68,10 @@ class NgbTreeNodeToggle {
68
68
  this.treeNode.toggle();
69
69
  }
70
70
  }
71
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTreeNodeToggle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
72
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0", type: NgbTreeNodeToggle, isStandalone: true, selector: "[ngbTreeNodeToggle]", host: { attributes: { "tabIndex": "-1" }, listeners: { "click": "toggle()" }, properties: { "attr.aria-hidden": "!treeNode.hasChildren()" } }, ngImport: i0 }); }
71
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTreeNodeToggle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
72
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: NgbTreeNodeToggle, isStandalone: true, selector: "[ngbTreeNodeToggle]", host: { attributes: { "tabIndex": "-1" }, listeners: { "click": "toggle()" }, properties: { "attr.aria-hidden": "!treeNode.hasChildren()" } }, ngImport: i0 }); }
73
73
  }
74
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTreeNodeToggle, decorators: [{
74
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTreeNodeToggle, decorators: [{
75
75
  type: Directive,
76
76
  args: [{
77
77
  selector: '[ngbTreeNodeToggle]',
@@ -83,20 +83,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImpor
83
83
  }]
84
84
  }] });
85
85
  class NgbTreeNodeDef {
86
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTreeNodeDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
87
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0", type: NgbTreeNodeDef, isStandalone: true, selector: "[ngbTreeNodeDef]", ngImport: i0 }); }
86
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTreeNodeDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
87
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: NgbTreeNodeDef, isStandalone: true, selector: "[ngbTreeNodeDef]", ngImport: i0 }); }
88
88
  }
89
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTreeNodeDef, decorators: [{
89
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTreeNodeDef, decorators: [{
90
90
  type: Directive,
91
91
  args: [{
92
92
  selector: '[ngbTreeNodeDef]',
93
93
  }]
94
94
  }] });
95
95
  class NgbTreeNodeContent {
96
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTreeNodeContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
97
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0", type: NgbTreeNodeContent, isStandalone: true, selector: "[ngbTreeNodeContent]", ngImport: i0 }); }
96
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTreeNodeContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
97
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: NgbTreeNodeContent, isStandalone: true, selector: "[ngbTreeNodeContent]", ngImport: i0 }); }
98
98
  }
99
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTreeNodeContent, decorators: [{
99
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTreeNodeContent, decorators: [{
100
100
  type: Directive,
101
101
  args: [{
102
102
  selector: '[ngbTreeNodeContent]',
@@ -243,10 +243,10 @@ class NgbTree {
243
243
  this.expanded = true;
244
244
  this.opened.set(new Set());
245
245
  }
246
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTree, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
247
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.2.0", type: NgbTree, isStandalone: true, selector: "[ngbTree]", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: true, transformFunction: null }, children: { classPropertyName: "children", publicName: "children", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "tree" } }, queries: [{ propertyName: "treeNodeDef", first: true, predicate: NgbTreeNodeDef, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], exportAs: ["ngbTree"], hostDirectives: [{ directive: i1.AccessibleGroup }], ngImport: i0 }); }
246
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTree, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
247
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.0", type: NgbTree, isStandalone: true, selector: "[ngbTree]", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: true, transformFunction: null }, children: { classPropertyName: "children", publicName: "children", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "tree" } }, queries: [{ propertyName: "treeNodeDef", first: true, predicate: NgbTreeNodeDef, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], exportAs: ["ngbTree"], hostDirectives: [{ directive: i1.AccessibleGroup }], ngImport: i0 }); }
248
248
  }
249
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NgbTree, decorators: [{
249
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgbTree, decorators: [{
250
250
  type: Directive,
251
251
  args: [{
252
252
  selector: '[ngbTree]',
@@ -256,7 +256,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImpor
256
256
  role: 'tree',
257
257
  },
258
258
  }]
259
- }], ctorParameters: () => [] });
259
+ }], ctorParameters: () => [], propDecorators: { treeNodeDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NgbTreeNodeDef), { ...{ read: TemplateRef }, isSignal: true }] }], container: [{ type: i0.ViewChild, args: ['container', { ...{ read: ViewContainerRef }, isSignal: true }] }], dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: true }] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: true }] }], children: [{ type: i0.Input, args: [{ isSignal: true, alias: "children", required: true }] }] } });
260
260
  function aliasTree(tree) {
261
261
  return { provide: NgbTree, useExisting: tree };
262
262
  }