@ng-doc/ui-kit 22.0.0-beta.2 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/README.md +20 -29
  2. package/fesm2022/ng-doc-ui-kit-cdk-combobox-host.mjs +43 -22
  3. package/fesm2022/ng-doc-ui-kit-cdk-combobox-host.mjs.map +1 -1
  4. package/fesm2022/ng-doc-ui-kit-classes-base-input.mjs +24 -13
  5. package/fesm2022/ng-doc-ui-kit-classes-base-input.mjs.map +1 -1
  6. package/fesm2022/ng-doc-ui-kit-classes-overlay-ref.mjs +62 -22
  7. package/fesm2022/ng-doc-ui-kit-classes-overlay-ref.mjs.map +1 -1
  8. package/fesm2022/ng-doc-ui-kit-components-blockquote.mjs +39 -14
  9. package/fesm2022/ng-doc-ui-kit-components-blockquote.mjs.map +1 -1
  10. package/fesm2022/ng-doc-ui-kit-components-button-icon.mjs +30 -18
  11. package/fesm2022/ng-doc-ui-kit-components-button-icon.mjs.map +1 -1
  12. package/fesm2022/ng-doc-ui-kit-components-button-toggle.mjs +12 -9
  13. package/fesm2022/ng-doc-ui-kit-components-button-toggle.mjs.map +1 -1
  14. package/fesm2022/ng-doc-ui-kit-components-button.mjs +15 -24
  15. package/fesm2022/ng-doc-ui-kit-components-button.mjs.map +1 -1
  16. package/fesm2022/ng-doc-ui-kit-components-checkbox.mjs +13 -13
  17. package/fesm2022/ng-doc-ui-kit-components-checkbox.mjs.map +1 -1
  18. package/fesm2022/ng-doc-ui-kit-components-clear-control.mjs +14 -9
  19. package/fesm2022/ng-doc-ui-kit-components-clear-control.mjs.map +1 -1
  20. package/fesm2022/ng-doc-ui-kit-components-combobox.mjs +30 -26
  21. package/fesm2022/ng-doc-ui-kit-components-combobox.mjs.map +1 -1
  22. package/fesm2022/ng-doc-ui-kit-components-data-list-group.mjs +37 -38
  23. package/fesm2022/ng-doc-ui-kit-components-data-list-group.mjs.map +1 -1
  24. package/fesm2022/ng-doc-ui-kit-components-data-list.mjs +32 -39
  25. package/fesm2022/ng-doc-ui-kit-components-data-list.mjs.map +1 -1
  26. package/fesm2022/ng-doc-ui-kit-components-dialog-outlet.mjs +23 -20
  27. package/fesm2022/ng-doc-ui-kit-components-dialog-outlet.mjs.map +1 -1
  28. package/fesm2022/ng-doc-ui-kit-components-dot.mjs +20 -16
  29. package/fesm2022/ng-doc-ui-kit-components-dot.mjs.map +1 -1
  30. package/fesm2022/ng-doc-ui-kit-components-dropdown.mjs +120 -125
  31. package/fesm2022/ng-doc-ui-kit-components-dropdown.mjs.map +1 -1
  32. package/fesm2022/ng-doc-ui-kit-components-expander.mjs +17 -17
  33. package/fesm2022/ng-doc-ui-kit-components-expander.mjs.map +1 -1
  34. package/fesm2022/ng-doc-ui-kit-components-floated-border.mjs +4 -4
  35. package/fesm2022/ng-doc-ui-kit-components-floated-border.mjs.map +1 -1
  36. package/fesm2022/ng-doc-ui-kit-components-floated-content.mjs +16 -17
  37. package/fesm2022/ng-doc-ui-kit-components-floated-content.mjs.map +1 -1
  38. package/fesm2022/ng-doc-ui-kit-components-focus-control.mjs +20 -12
  39. package/fesm2022/ng-doc-ui-kit-components-focus-control.mjs.map +1 -1
  40. package/fesm2022/ng-doc-ui-kit-components-icon.mjs +175 -54
  41. package/fesm2022/ng-doc-ui-kit-components-icon.mjs.map +1 -1
  42. package/fesm2022/ng-doc-ui-kit-components-input-wrapper.mjs +43 -46
  43. package/fesm2022/ng-doc-ui-kit-components-input-wrapper.mjs.map +1 -1
  44. package/fesm2022/ng-doc-ui-kit-components-label.mjs +14 -16
  45. package/fesm2022/ng-doc-ui-kit-components-label.mjs.map +1 -1
  46. package/fesm2022/ng-doc-ui-kit-components-line.mjs +7 -4
  47. package/fesm2022/ng-doc-ui-kit-components-line.mjs.map +1 -1
  48. package/fesm2022/ng-doc-ui-kit-components-list.mjs +24 -8
  49. package/fesm2022/ng-doc-ui-kit-components-list.mjs.map +1 -1
  50. package/fesm2022/ng-doc-ui-kit-components-magnifier-controller.mjs +7 -3
  51. package/fesm2022/ng-doc-ui-kit-components-magnifier-controller.mjs.map +1 -1
  52. package/fesm2022/ng-doc-ui-kit-components-magnifier.mjs +31 -15
  53. package/fesm2022/ng-doc-ui-kit-components-magnifier.mjs.map +1 -1
  54. package/fesm2022/ng-doc-ui-kit-components-option-group.mjs +22 -27
  55. package/fesm2022/ng-doc-ui-kit-components-option-group.mjs.map +1 -1
  56. package/fesm2022/ng-doc-ui-kit-components-option.mjs +28 -22
  57. package/fesm2022/ng-doc-ui-kit-components-option.mjs.map +1 -1
  58. package/fesm2022/ng-doc-ui-kit-components-overlay-container.mjs +56 -52
  59. package/fesm2022/ng-doc-ui-kit-components-overlay-container.mjs.map +1 -1
  60. package/fesm2022/ng-doc-ui-kit-components-overlay-pointer.mjs +19 -21
  61. package/fesm2022/ng-doc-ui-kit-components-overlay-pointer.mjs.map +1 -1
  62. package/fesm2022/ng-doc-ui-kit-components-pane.mjs +91 -69
  63. package/fesm2022/ng-doc-ui-kit-components-pane.mjs.map +1 -1
  64. package/fesm2022/ng-doc-ui-kit-components-selection.mjs +173 -76
  65. package/fesm2022/ng-doc-ui-kit-components-selection.mjs.map +1 -1
  66. package/fesm2022/ng-doc-ui-kit-components-sidenav.mjs +23 -22
  67. package/fesm2022/ng-doc-ui-kit-components-sidenav.mjs.map +1 -1
  68. package/fesm2022/ng-doc-ui-kit-components-spinner.mjs +14 -12
  69. package/fesm2022/ng-doc-ui-kit-components-spinner.mjs.map +1 -1
  70. package/fesm2022/ng-doc-ui-kit-components-tab-group.mjs +86 -61
  71. package/fesm2022/ng-doc-ui-kit-components-tab-group.mjs.map +1 -1
  72. package/fesm2022/ng-doc-ui-kit-components-tab-routes-group.mjs +16 -13
  73. package/fesm2022/ng-doc-ui-kit-components-tab-routes-group.mjs.map +1 -1
  74. package/fesm2022/ng-doc-ui-kit-components-tag.mjs +23 -24
  75. package/fesm2022/ng-doc-ui-kit-components-tag.mjs.map +1 -1
  76. package/fesm2022/ng-doc-ui-kit-components-text.mjs +37 -52
  77. package/fesm2022/ng-doc-ui-kit-components-text.mjs.map +1 -1
  78. package/fesm2022/ng-doc-ui-kit-components-toggle.mjs +82 -57
  79. package/fesm2022/ng-doc-ui-kit-components-toggle.mjs.map +1 -1
  80. package/fesm2022/ng-doc-ui-kit-components-wrapper.mjs +7 -4
  81. package/fesm2022/ng-doc-ui-kit-components-wrapper.mjs.map +1 -1
  82. package/fesm2022/ng-doc-ui-kit-directives-autofocus.mjs +13 -10
  83. package/fesm2022/ng-doc-ui-kit-directives-autofocus.mjs.map +1 -1
  84. package/fesm2022/ng-doc-ui-kit-directives-checked-change.mjs +30 -26
  85. package/fesm2022/ng-doc-ui-kit-directives-checked-change.mjs.map +1 -1
  86. package/fesm2022/ng-doc-ui-kit-directives-data.mjs +8 -5
  87. package/fesm2022/ng-doc-ui-kit-directives-data.mjs.map +1 -1
  88. package/fesm2022/ng-doc-ui-kit-directives-dropdown-handler.mjs +19 -18
  89. package/fesm2022/ng-doc-ui-kit-directives-dropdown-handler.mjs.map +1 -1
  90. package/fesm2022/ng-doc-ui-kit-directives-dropdown-origin.mjs +3 -4
  91. package/fesm2022/ng-doc-ui-kit-directives-dropdown-origin.mjs.map +1 -1
  92. package/fesm2022/ng-doc-ui-kit-directives-event-switcher.mjs +22 -19
  93. package/fesm2022/ng-doc-ui-kit-directives-event-switcher.mjs.map +1 -1
  94. package/fesm2022/ng-doc-ui-kit-directives-focus-catcher.mjs +30 -25
  95. package/fesm2022/ng-doc-ui-kit-directives-focus-catcher.mjs.map +1 -1
  96. package/fesm2022/ng-doc-ui-kit-directives-focusable.mjs +13 -16
  97. package/fesm2022/ng-doc-ui-kit-directives-focusable.mjs.map +1 -1
  98. package/fesm2022/ng-doc-ui-kit-directives-fullscreen.mjs +90 -0
  99. package/fesm2022/ng-doc-ui-kit-directives-fullscreen.mjs.map +1 -0
  100. package/fesm2022/ng-doc-ui-kit-directives-hotkey.mjs +34 -28
  101. package/fesm2022/ng-doc-ui-kit-directives-hotkey.mjs.map +1 -1
  102. package/fesm2022/ng-doc-ui-kit-directives-input-number.mjs +10 -12
  103. package/fesm2022/ng-doc-ui-kit-directives-input-number.mjs.map +1 -1
  104. package/fesm2022/ng-doc-ui-kit-directives-input-string.mjs +9 -12
  105. package/fesm2022/ng-doc-ui-kit-directives-input-string.mjs.map +1 -1
  106. package/fesm2022/ng-doc-ui-kit-directives-radio-group.mjs +7 -4
  107. package/fesm2022/ng-doc-ui-kit-directives-radio-group.mjs.map +1 -1
  108. package/fesm2022/ng-doc-ui-kit-directives-rotator.mjs +16 -22
  109. package/fesm2022/ng-doc-ui-kit-directives-rotator.mjs.map +1 -1
  110. package/fesm2022/ng-doc-ui-kit-directives-tooltip.mjs +105 -101
  111. package/fesm2022/ng-doc-ui-kit-directives-tooltip.mjs.map +1 -1
  112. package/fesm2022/ng-doc-ui-kit-directives.mjs +1 -1
  113. package/fesm2022/ng-doc-ui-kit-interceptors.mjs +24 -21
  114. package/fesm2022/ng-doc-ui-kit-interceptors.mjs.map +1 -1
  115. package/fesm2022/ng-doc-ui-kit-observables.mjs +2 -58
  116. package/fesm2022/ng-doc-ui-kit-observables.mjs.map +1 -1
  117. package/fesm2022/ng-doc-ui-kit-pipes-as-array.mjs +3 -4
  118. package/fesm2022/ng-doc-ui-kit-pipes-as-array.mjs.map +1 -1
  119. package/fesm2022/ng-doc-ui-kit-pipes-bind.mjs +3 -4
  120. package/fesm2022/ng-doc-ui-kit-pipes-bind.mjs.map +1 -1
  121. package/fesm2022/ng-doc-ui-kit-pipes-execute.mjs +3 -4
  122. package/fesm2022/ng-doc-ui-kit-pipes-execute.mjs.map +1 -1
  123. package/fesm2022/ng-doc-ui-kit-pipes-highlighter.mjs +3 -4
  124. package/fesm2022/ng-doc-ui-kit-pipes-highlighter.mjs.map +1 -1
  125. package/fesm2022/ng-doc-ui-kit-services-dialog.mjs +14 -8
  126. package/fesm2022/ng-doc-ui-kit-services-dialog.mjs.map +1 -1
  127. package/fesm2022/ng-doc-ui-kit-services-notify.mjs +13 -8
  128. package/fesm2022/ng-doc-ui-kit-services-notify.mjs.map +1 -1
  129. package/fesm2022/ng-doc-ui-kit-services-overlay-strategy.mjs +15 -11
  130. package/fesm2022/ng-doc-ui-kit-services-overlay-strategy.mjs.map +1 -1
  131. package/fesm2022/ng-doc-ui-kit-services-overlay.mjs +20 -9
  132. package/fesm2022/ng-doc-ui-kit-services-overlay.mjs.map +1 -1
  133. package/fesm2022/ng-doc-ui-kit-services-scroll.mjs +11 -13
  134. package/fesm2022/ng-doc-ui-kit-services-scroll.mjs.map +1 -1
  135. package/fesm2022/ng-doc-ui-kit-tokens.mjs +29 -3
  136. package/fesm2022/ng-doc-ui-kit-tokens.mjs.map +1 -1
  137. package/package.json +27 -30
  138. package/styles/main.css +271 -34
  139. package/types/ng-doc-ui-kit-cdk-combobox-host.d.ts +16 -8
  140. package/types/ng-doc-ui-kit-classes-base-input.d.ts +12 -1
  141. package/types/ng-doc-ui-kit-classes-overlay-ref.d.ts +27 -4
  142. package/types/ng-doc-ui-kit-components-blockquote.d.ts +22 -5
  143. package/types/ng-doc-ui-kit-components-button-icon.d.ts +23 -5
  144. package/types/ng-doc-ui-kit-components-button-toggle.d.ts +5 -1
  145. package/types/ng-doc-ui-kit-components-button.d.ts +6 -6
  146. package/types/ng-doc-ui-kit-components-checkbox.d.ts +5 -3
  147. package/types/ng-doc-ui-kit-components-clear-control.d.ts +7 -0
  148. package/types/ng-doc-ui-kit-components-combobox.d.ts +19 -9
  149. package/types/ng-doc-ui-kit-components-data-list-group.d.ts +16 -11
  150. package/types/ng-doc-ui-kit-components-data-list.d.ts +21 -11
  151. package/types/ng-doc-ui-kit-components-dialog-outlet.d.ts +11 -6
  152. package/types/ng-doc-ui-kit-components-dot.d.ts +10 -5
  153. package/types/ng-doc-ui-kit-components-dropdown.d.ts +39 -27
  154. package/types/ng-doc-ui-kit-components-expander.d.ts +9 -7
  155. package/types/ng-doc-ui-kit-components-floated-content.d.ts +8 -6
  156. package/types/ng-doc-ui-kit-components-focus-control.d.ts +10 -4
  157. package/types/ng-doc-ui-kit-components-icon.d.ts +49 -14
  158. package/types/ng-doc-ui-kit-components-input-wrapper.d.ts +31 -17
  159. package/types/ng-doc-ui-kit-components-label.d.ts +8 -5
  160. package/types/ng-doc-ui-kit-components-line.d.ts +3 -0
  161. package/types/ng-doc-ui-kit-components-list.d.ts +14 -3
  162. package/types/ng-doc-ui-kit-components-magnifier-controller.d.ts +5 -1
  163. package/types/ng-doc-ui-kit-components-magnifier.d.ts +19 -4
  164. package/types/ng-doc-ui-kit-components-option-group.d.ts +12 -8
  165. package/types/ng-doc-ui-kit-components-option.d.ts +9 -2
  166. package/types/ng-doc-ui-kit-components-overlay-container.d.ts +18 -15
  167. package/types/ng-doc-ui-kit-components-overlay-pointer.d.ts +10 -6
  168. package/types/ng-doc-ui-kit-components-pane.d.ts +25 -9
  169. package/types/ng-doc-ui-kit-components-selection.d.ts +59 -21
  170. package/types/ng-doc-ui-kit-components-sidenav.d.ts +17 -8
  171. package/types/ng-doc-ui-kit-components-spinner.d.ts +7 -3
  172. package/types/ng-doc-ui-kit-components-tab-group.d.ts +43 -22
  173. package/types/ng-doc-ui-kit-components-tab-routes-group.d.ts +4 -2
  174. package/types/ng-doc-ui-kit-components-tag.d.ts +13 -6
  175. package/types/ng-doc-ui-kit-components-text.d.ts +21 -19
  176. package/types/ng-doc-ui-kit-components-toggle.d.ts +13 -7
  177. package/types/ng-doc-ui-kit-components-wrapper.d.ts +3 -0
  178. package/types/ng-doc-ui-kit-directives-autofocus.d.ts +7 -5
  179. package/types/ng-doc-ui-kit-directives-checked-change.d.ts +15 -11
  180. package/types/ng-doc-ui-kit-directives-data.d.ts +6 -4
  181. package/types/ng-doc-ui-kit-directives-dropdown-handler.d.ts +5 -3
  182. package/types/ng-doc-ui-kit-directives-event-switcher.d.ts +11 -6
  183. package/types/ng-doc-ui-kit-directives-focus-catcher.d.ts +11 -8
  184. package/types/ng-doc-ui-kit-directives-focusable.d.ts +6 -3
  185. package/types/ng-doc-ui-kit-directives-fullscreen.d.ts +39 -0
  186. package/types/ng-doc-ui-kit-directives-hotkey.d.ts +14 -7
  187. package/types/ng-doc-ui-kit-directives-input-number.d.ts +3 -2
  188. package/types/ng-doc-ui-kit-directives-input-string.d.ts +2 -2
  189. package/types/ng-doc-ui-kit-directives-radio-group.d.ts +4 -0
  190. package/types/ng-doc-ui-kit-directives-rotator.d.ts +8 -8
  191. package/types/ng-doc-ui-kit-directives-tooltip.d.ts +35 -23
  192. package/types/ng-doc-ui-kit-directives.d.ts +1 -1
  193. package/types/ng-doc-ui-kit-interceptors.d.ts +18 -2
  194. package/types/ng-doc-ui-kit-interfaces.d.ts +20 -4
  195. package/types/ng-doc-ui-kit-observables.d.ts +2 -19
  196. package/types/ng-doc-ui-kit-services-dialog.d.ts +10 -1
  197. package/types/ng-doc-ui-kit-services-notify.d.ts +9 -1
  198. package/types/ng-doc-ui-kit-services-overlay-strategy.d.ts +5 -3
  199. package/types/ng-doc-ui-kit-services-overlay.d.ts +14 -3
  200. package/types/ng-doc-ui-kit-services-scroll.d.ts +4 -5
  201. package/fesm2022/ng-doc-ui-kit-decorators.mjs +0 -53
  202. package/fesm2022/ng-doc-ui-kit-decorators.mjs.map +0 -1
  203. package/fesm2022/ng-doc-ui-kit-directives-let.mjs +0 -43
  204. package/fesm2022/ng-doc-ui-kit-directives-let.mjs.map +0 -1
  205. package/types/ng-doc-ui-kit-decorators.d.ts +0 -12
  206. package/types/ng-doc-ui-kit-directives-let.d.ts +0 -22
@@ -8,15 +8,15 @@ class NgDocDropdownOriginDirective extends CdkOverlayOrigin {
8
8
  super(...arguments);
9
9
  this.origin = this.elementRef;
10
10
  }
11
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocDropdownOriginDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
12
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: NgDocDropdownOriginDirective, isStandalone: true, selector: "[ngDocDropdownOrigin]", providers: [
11
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDropdownOriginDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
12
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.1", type: NgDocDropdownOriginDirective, isStandalone: true, selector: "[ngDocDropdownOrigin]", providers: [
13
13
  {
14
14
  provide: NgDocOverlayHost,
15
15
  useExisting: NgDocDropdownOriginDirective,
16
16
  },
17
17
  ], exportAs: ["ngDocDropdownOrigin"], usesInheritance: true, ngImport: i0 }); }
18
18
  }
19
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocDropdownOriginDirective, decorators: [{
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDropdownOriginDirective, decorators: [{
20
20
  type: Directive,
21
21
  args: [{
22
22
  selector: '[ngDocDropdownOrigin]',
@@ -27,7 +27,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
27
27
  useExisting: NgDocDropdownOriginDirective,
28
28
  },
29
29
  ],
30
- standalone: true,
31
30
  }]
32
31
  }] });
33
32
 
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-ui-kit-directives-dropdown-origin.mjs","sources":["../../../../libs/ui-kit/directives/dropdown-origin/dropdown-origin.directive.ts","../../../../libs/ui-kit/directives/dropdown-origin/ng-doc-ui-kit-directives-dropdown-origin.ts"],"sourcesContent":["import { CdkOverlayOrigin } from '@angular/cdk/overlay';\nimport { Directive, ElementRef } from '@angular/core';\nimport { NgDocOverlayHost } from '@ng-doc/ui-kit/classes/overlay-host';\n\n@Directive({\n selector: '[ngDocDropdownOrigin]',\n exportAs: 'ngDocDropdownOrigin',\n providers: [\n {\n provide: NgDocOverlayHost,\n useExisting: NgDocDropdownOriginDirective,\n },\n ],\n standalone: true,\n})\nexport class NgDocDropdownOriginDirective extends CdkOverlayOrigin implements NgDocOverlayHost {\n origin: ElementRef<HTMLElement> = this.elementRef;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAeM,MAAO,4BAA6B,SAAQ,gBAAgB,CAAA;AAXlE,IAAA,WAAA,GAAA;;AAYE,QAAA,IAAA,CAAA,MAAM,GAA4B,IAAI,CAAC,UAAU;AAClD,IAAA;8GAFY,4BAA4B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA5B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,4BAA4B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,SAAA,EAR5B;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,gBAAgB;AACzB,gBAAA,WAAW,EAAE,4BAA4B;AAC1C,aAAA;AACF,SAAA,EAAA,QAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAGU,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBAXxC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,gBAAgB;AACzB,4BAAA,WAAW,EAAA,4BAA8B;AAC1C,yBAAA;AACF,qBAAA;AACD,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACdD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-ui-kit-directives-dropdown-origin.mjs","sources":["../../../../libs/ui-kit/directives/dropdown-origin/dropdown-origin.directive.ts","../../../../libs/ui-kit/directives/dropdown-origin/ng-doc-ui-kit-directives-dropdown-origin.ts"],"sourcesContent":["import { CdkOverlayOrigin } from '@angular/cdk/overlay';\nimport { Directive, ElementRef } from '@angular/core';\nimport { NgDocOverlayHost } from '@ng-doc/ui-kit/classes/overlay-host';\n\n@Directive({\n selector: '[ngDocDropdownOrigin]',\n exportAs: 'ngDocDropdownOrigin',\n providers: [\n {\n provide: NgDocOverlayHost,\n useExisting: NgDocDropdownOriginDirective,\n },\n ],\n})\nexport class NgDocDropdownOriginDirective extends CdkOverlayOrigin implements NgDocOverlayHost {\n origin: ElementRef<HTMLElement> = this.elementRef;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAcM,MAAO,4BAA6B,SAAQ,gBAAgB,CAAA;AAVlE,IAAA,WAAA,GAAA;;AAWE,QAAA,IAAA,CAAA,MAAM,GAA4B,IAAI,CAAC,UAAU;AAClD,IAAA;8GAFY,4BAA4B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA5B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,4BAA4B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,SAAA,EAP5B;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,gBAAgB;AACzB,gBAAA,WAAW,EAAE,4BAA4B;AAC1C,aAAA;AACF,SAAA,EAAA,QAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAEU,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBAVxC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,gBAAgB;AACzB,4BAAA,WAAW,EAAA,4BAA8B;AAC1C,yBAAA;AACF,qBAAA;AACF,iBAAA;;;ACbD;;AAEG;;;;"}
@@ -1,48 +1,51 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, NgZone, DestroyRef, Input, Directive } from '@angular/core';
2
+ import { inject, ElementRef, NgZone, DestroyRef, input, Directive } from '@angular/core';
3
3
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
4
  import { asArray } from '@ng-doc/core/helpers/as-array';
5
5
  import { toElement } from '@ng-doc/ui-kit/helpers';
6
- import { ngDocZoneDetach } from '@ng-doc/ui-kit/observables';
7
6
  import { merge, fromEvent } from 'rxjs';
8
7
 
8
+ /**
9
+ * Re-dispatches the given events of the host on another element, for example the events of an
10
+ * overlay on its origin.
11
+ */
9
12
  class NgDocEventSwitcherDirective {
10
13
  constructor() {
11
14
  this.elementRef = inject(ElementRef);
12
15
  this.ngZone = inject(NgZone);
13
- this.switchTo = null;
14
- this.events = [];
15
16
  this.destroyRef = inject(DestroyRef);
17
+ /** The element that receives the events. */
18
+ this.switchTo = input(null, { ...(ngDevMode ? { debugName: "switchTo" } : /* istanbul ignore next */ {}), alias: 'ngDocEventSwitcher' });
19
+ /** The names of the events to re-dispatch. They are read once, when the directive starts. */
20
+ this.events = input([], /* @ts-ignore */
21
+ ...(ngDevMode ? [{ debugName: "events" }] : /* istanbul ignore next */ []));
16
22
  }
17
23
  ngOnInit() {
18
- merge(...asArray(this.events).map((eventName) => fromEvent(this.elementRef.nativeElement, eventName)))
19
- .pipe(ngDocZoneDetach(this.ngZone), takeUntilDestroyed(this.destroyRef))
24
+ // The copies are dispatched outside the Angular zone: the listeners of the target decide
25
+ // whether they need change detection, as they would for a native event.
26
+ this.ngZone.runOutsideAngular(() => merge(...asArray(this.events()).map((eventName) => fromEvent(this.elementRef.nativeElement, eventName)))
27
+ .pipe(takeUntilDestroyed(this.destroyRef))
20
28
  .subscribe((event) => {
21
- if (this.switchTo && !event.defaultPrevented && event.bubbles) {
29
+ const switchTo = this.switchTo();
30
+ if (switchTo && !event.defaultPrevented && event.bubbles) {
22
31
  event.stopPropagation();
23
- this.makeEvent(event, toElement(this.switchTo));
32
+ this.makeEvent(event, toElement(switchTo));
24
33
  }
25
- });
34
+ }));
26
35
  }
27
36
  makeEvent(from, target) {
28
37
  const eventConstructor = from.constructor;
29
38
  target.dispatchEvent(new eventConstructor(from.type, from));
30
39
  }
31
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocEventSwitcherDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
32
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: NgDocEventSwitcherDirective, isStandalone: true, selector: "[ngDocEventSwitcher]", inputs: { switchTo: ["ngDocEventSwitcher", "switchTo"], events: "events" }, ngImport: i0 }); }
40
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocEventSwitcherDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
41
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.1", type: NgDocEventSwitcherDirective, isStandalone: true, selector: "[ngDocEventSwitcher]", inputs: { switchTo: { classPropertyName: "switchTo", publicName: "ngDocEventSwitcher", isSignal: true, isRequired: false, transformFunction: null }, events: { classPropertyName: "events", publicName: "events", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
33
42
  }
34
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocEventSwitcherDirective, decorators: [{
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocEventSwitcherDirective, decorators: [{
35
44
  type: Directive,
36
45
  args: [{
37
46
  selector: '[ngDocEventSwitcher]',
38
- standalone: true,
39
47
  }]
40
- }], ctorParameters: () => [], propDecorators: { switchTo: [{
41
- type: Input,
42
- args: ['ngDocEventSwitcher']
43
- }], events: [{
44
- type: Input
45
- }] } });
48
+ }], propDecorators: { switchTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngDocEventSwitcher", required: false }] }], events: [{ type: i0.Input, args: [{ isSignal: true, alias: "events", required: false }] }] } });
46
49
 
47
50
  /**
48
51
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-ui-kit-directives-event-switcher.mjs","sources":["../../../../libs/ui-kit/directives/event-switcher/event-switcher.directive.ts","../../../../libs/ui-kit/directives/event-switcher/ng-doc-ui-kit-directives-event-switcher.ts"],"sourcesContent":["import { DestroyRef, Directive, ElementRef, inject, Input, NgZone, OnInit } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { Constructor } from '@ng-doc/core/types';\nimport { toElement } from '@ng-doc/ui-kit/helpers';\nimport { ngDocZoneDetach } from '@ng-doc/ui-kit/observables';\nimport { BaseElement } from '@ng-doc/ui-kit/types';\nimport { fromEvent, merge } from 'rxjs';\n\n@Directive({\n selector: '[ngDocEventSwitcher]',\n standalone: true,\n})\nexport class NgDocEventSwitcherDirective implements OnInit {\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private ngZone = inject(NgZone);\n\n @Input('ngDocEventSwitcher')\n switchTo: BaseElement<HTMLElement> | null = null;\n\n @Input()\n events: string | string[] = [];\n\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {}\n\n ngOnInit(): void {\n merge(\n ...asArray(this.events).map((eventName: string) =>\n fromEvent(this.elementRef.nativeElement, eventName),\n ),\n )\n .pipe(ngDocZoneDetach(this.ngZone), takeUntilDestroyed(this.destroyRef))\n .subscribe((event: Event) => {\n if (this.switchTo && !event.defaultPrevented && event.bubbles) {\n event.stopPropagation();\n this.makeEvent(event, toElement(this.switchTo));\n }\n });\n }\n\n private makeEvent(from: Event, target: Element): void {\n const eventConstructor: Constructor<Event> = from.constructor as Constructor<Event>;\n target.dispatchEvent(new eventConstructor(from.type, from));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAaa,2BAA2B,CAAA;AAYtC,IAAA,WAAA,GAAA;AAXQ,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAG/B,IAAA,CAAA,QAAQ,GAAoC,IAAI;QAGhD,IAAA,CAAA,MAAM,GAAsB,EAAE;AAEb,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAEjC;IAEf,QAAQ,GAAA;QACN,KAAK,CACH,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,SAAiB,KAC5C,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,SAAS,CAAC,CACpD;AAEA,aAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC;AACtE,aAAA,SAAS,CAAC,CAAC,KAAY,KAAI;AAC1B,YAAA,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,OAAO,EAAE;gBAC7D,KAAK,CAAC,eAAe,EAAE;AACvB,gBAAA,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACjD;AACF,QAAA,CAAC,CAAC;IACN;IAEQ,SAAS,CAAC,IAAW,EAAE,MAAe,EAAA;AAC5C,QAAA,MAAM,gBAAgB,GAAuB,IAAI,CAAC,WAAiC;AACnF,QAAA,MAAM,CAAC,aAAa,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7D;8GAhCW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,CAAA,oBAAA,EAAA,UAAA,CAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAJvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;sBAKE,KAAK;uBAAC,oBAAoB;;sBAG1B;;;ACpBH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-ui-kit-directives-event-switcher.mjs","sources":["../../../../libs/ui-kit/directives/event-switcher/event-switcher.directive.ts","../../../../libs/ui-kit/directives/event-switcher/ng-doc-ui-kit-directives-event-switcher.ts"],"sourcesContent":["import { DestroyRef, Directive, ElementRef, inject, input, NgZone, OnInit } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { Constructor } from '@ng-doc/core/types';\nimport { toElement } from '@ng-doc/ui-kit/helpers';\nimport { BaseElement } from '@ng-doc/ui-kit/types';\nimport { fromEvent, merge } from 'rxjs';\n\n/**\n * Re-dispatches the given events of the host on another element, for example the events of an\n * overlay on its origin.\n */\n@Directive({\n selector: '[ngDocEventSwitcher]',\n})\nexport class NgDocEventSwitcherDirective implements OnInit {\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private ngZone = inject(NgZone);\n private readonly destroyRef = inject(DestroyRef);\n\n /** The element that receives the events. */\n readonly switchTo = input<BaseElement<HTMLElement> | null>(null, {\n alias: 'ngDocEventSwitcher',\n });\n\n /** The names of the events to re-dispatch. They are read once, when the directive starts. */\n readonly events = input<string | string[]>([]);\n\n ngOnInit(): void {\n // The copies are dispatched outside the Angular zone: the listeners of the target decide\n // whether they need change detection, as they would for a native event.\n this.ngZone.runOutsideAngular(() =>\n merge(\n ...asArray(this.events()).map((eventName: string) =>\n fromEvent(this.elementRef.nativeElement, eventName),\n ),\n )\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((event: Event) => {\n const switchTo: BaseElement<HTMLElement> | null = this.switchTo();\n\n if (switchTo && !event.defaultPrevented && event.bubbles) {\n event.stopPropagation();\n this.makeEvent(event, toElement(switchTo));\n }\n }),\n );\n }\n\n private makeEvent(from: Event, target: Element): void {\n const eventConstructor: Constructor<Event> = from.constructor as Constructor<Event>;\n target.dispatchEvent(new eventConstructor(from.type, from));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAQA;;;AAGG;MAIU,2BAA2B,CAAA;AAHxC,IAAA,WAAA,GAAA;AAIU,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACd,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;QAGvC,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAkC,IAAI,gFAC7D,KAAK,EAAE,oBAAoB,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iBAAA,EAAA,IAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAHvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AACjC,iBAAA;;;ACdD;;AAEG;;;;"}
@@ -1,49 +1,54 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, NgZone, ChangeDetectorRef, EventEmitter, HostBinding, Output, Directive } from '@angular/core';
2
+ import { inject, ElementRef, NgZone, output, signal, DestroyRef, Directive } from '@angular/core';
3
3
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
4
  import { FOCUS_EVENT, BLUR_EVENT } from '@ng-doc/ui-kit/constants';
5
5
  import { toElement } from '@ng-doc/ui-kit/helpers';
6
- import { ngDocZoneOptimize } from '@ng-doc/ui-kit/observables';
7
6
  import { merge, fromEvent } from 'rxjs';
8
7
  import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
9
8
 
9
+ /** Tracks whether focus is inside the host element. */
10
10
  class NgDocFocusCatcherDirective {
11
11
  constructor() {
12
12
  this.elementRef = inject(ElementRef);
13
13
  this.ngZone = inject(NgZone);
14
- this.changeDetectorRef = inject(ChangeDetectorRef);
15
- this.focusEvent = new EventEmitter();
16
- this.blurEvent = new EventEmitter();
17
- this.focused = false;
18
- NgDocFocusCatcherDirective.observeFocus(toElement(this.elementRef))
19
- .pipe(ngDocZoneOptimize(this.ngZone), takeUntilDestroyed())
20
- .subscribe((event) => {
21
- this.focused = event.type === FOCUS_EVENT;
22
- this.focused ? this.focusEvent.emit(event) : this.blurEvent.emit(event);
23
- this.changeDetectorRef.markForCheck();
24
- });
14
+ /** Emits when focus moves into the host. */
15
+ this.focusEvent = output();
16
+ /** Emits when focus leaves the host. */
17
+ this.blurEvent = output();
18
+ this.focusedState = signal(false, /* @ts-ignore */
19
+ ...(ngDevMode ? [{ debugName: "focusedState" }] : /* istanbul ignore next */ []));
20
+ const destroyRef = inject(DestroyRef);
21
+ // Focus events are frequent: they are observed outside the Angular zone, and only a change of
22
+ // the focus state re-enters it. The state is a signal, so a zoneless application renders it
23
+ // too.
24
+ this.ngZone.runOutsideAngular(() => NgDocFocusCatcherDirective.observeFocus(toElement(this.elementRef))
25
+ .pipe(takeUntilDestroyed(destroyRef))
26
+ .subscribe((event) => this.ngZone.run(() => {
27
+ const focused = event.type === FOCUS_EVENT;
28
+ this.focusedState.set(focused);
29
+ focused ? this.focusEvent.emit(event) : this.blurEvent.emit(event);
30
+ })));
31
+ }
32
+ /** Whether focus is inside the host. */
33
+ get focused() {
34
+ return this.focusedState();
25
35
  }
26
36
  static observeFocus(element) {
27
37
  return merge(fromEvent(element, FOCUS_EVENT), fromEvent(element, BLUR_EVENT)).pipe(debounceTime(0), distinctUntilChanged((a, b) => a.type === b.type));
28
38
  }
29
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocFocusCatcherDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
30
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: NgDocFocusCatcherDirective, isStandalone: true, selector: "[ngDocFocusCatcher]", outputs: { focusEvent: "focusEvent", blurEvent: "blurEvent" }, host: { properties: { "attr.data-ng-doc-focused": "this.focused" } }, exportAs: ["ngDocFocusCatcher"], ngImport: i0 }); }
39
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocFocusCatcherDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
40
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.1", type: NgDocFocusCatcherDirective, isStandalone: true, selector: "[ngDocFocusCatcher]", outputs: { focusEvent: "focusEvent", blurEvent: "blurEvent" }, host: { properties: { "attr.data-ng-doc-focused": "focusedState()" } }, exportAs: ["ngDocFocusCatcher"], ngImport: i0 }); }
31
41
  }
32
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocFocusCatcherDirective, decorators: [{
42
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocFocusCatcherDirective, decorators: [{
33
43
  type: Directive,
34
44
  args: [{
35
45
  selector: '[ngDocFocusCatcher]',
36
46
  exportAs: 'ngDocFocusCatcher',
37
- standalone: true,
47
+ host: {
48
+ '[attr.data-ng-doc-focused]': 'focusedState()',
49
+ },
38
50
  }]
39
- }], ctorParameters: () => [], propDecorators: { focusEvent: [{
40
- type: Output
41
- }], blurEvent: [{
42
- type: Output
43
- }], focused: [{
44
- type: HostBinding,
45
- args: ['attr.data-ng-doc-focused']
46
- }] } });
51
+ }], ctorParameters: () => [], propDecorators: { focusEvent: [{ type: i0.Output, args: ["focusEvent"] }], blurEvent: [{ type: i0.Output, args: ["blurEvent"] }] } });
47
52
 
48
53
  /**
49
54
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-ui-kit-directives-focus-catcher.mjs","sources":["../../../../libs/ui-kit/directives/focus-catcher/focus-catcher.directive.ts","../../../../libs/ui-kit/directives/focus-catcher/ng-doc-ui-kit-directives-focus-catcher.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Directive,\n ElementRef,\n EventEmitter,\n HostBinding,\n inject,\n NgZone,\n Output,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { BLUR_EVENT, FOCUS_EVENT } from '@ng-doc/ui-kit/constants';\nimport { toElement } from '@ng-doc/ui-kit/helpers';\nimport { ngDocZoneOptimize } from '@ng-doc/ui-kit/observables';\nimport { fromEvent, merge, Observable } from 'rxjs';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\n\n@Directive({\n selector: '[ngDocFocusCatcher]',\n exportAs: 'ngDocFocusCatcher',\n standalone: true,\n})\nexport class NgDocFocusCatcherDirective {\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private ngZone = inject(NgZone);\n private changeDetectorRef = inject(ChangeDetectorRef);\n\n @Output()\n focusEvent: EventEmitter<Event> = new EventEmitter<Event>();\n\n @Output()\n blurEvent: EventEmitter<Event> = new EventEmitter<Event>();\n\n @HostBinding('attr.data-ng-doc-focused')\n focused: boolean = false;\n\n constructor() {\n NgDocFocusCatcherDirective.observeFocus(toElement(this.elementRef))\n .pipe(ngDocZoneOptimize(this.ngZone), takeUntilDestroyed())\n .subscribe((event: FocusEvent) => {\n this.focused = event.type === FOCUS_EVENT;\n this.focused ? this.focusEvent.emit(event) : this.blurEvent.emit(event);\n this.changeDetectorRef.markForCheck();\n });\n }\n\n static observeFocus(element: HTMLElement): Observable<FocusEvent> {\n return merge(\n fromEvent<FocusEvent>(element, FOCUS_EVENT),\n fromEvent<FocusEvent>(element, BLUR_EVENT),\n ).pipe(\n debounceTime(0),\n distinctUntilChanged((a: FocusEvent, b: FocusEvent) => a.type === b.type),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAsBa,0BAA0B,CAAA;AAcrC,IAAA,WAAA,GAAA;AAbQ,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAGrD,QAAA,IAAA,CAAA,UAAU,GAAwB,IAAI,YAAY,EAAS;AAG3D,QAAA,IAAA,CA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,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBALtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;sBAME;;sBAGA;;sBAGA,WAAW;uBAAC,0BAA0B;;;ACjCzC;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-ui-kit-directives-focus-catcher.mjs","sources":["../../../../libs/ui-kit/directives/focus-catcher/focus-catcher.directive.ts","../../../../libs/ui-kit/directives/focus-catcher/ng-doc-ui-kit-directives-focus-catcher.ts"],"sourcesContent":["import { DestroyRef, Directive, ElementRef, inject, NgZone, output, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { BLUR_EVENT, FOCUS_EVENT } from '@ng-doc/ui-kit/constants';\nimport { toElement } from '@ng-doc/ui-kit/helpers';\nimport { fromEvent, merge, Observable } from 'rxjs';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\n\n/** Tracks whether focus is inside the host element. */\n@Directive({\n selector: '[ngDocFocusCatcher]',\n exportAs: 'ngDocFocusCatcher',\n host: {\n '[attr.data-ng-doc-focused]': 'focusedState()',\n },\n})\nexport class NgDocFocusCatcherDirective {\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private ngZone = inject(NgZone);\n\n /** Emits when focus moves into the host. */\n readonly focusEvent = output<Event>();\n\n /** Emits when focus leaves the host. */\n readonly blurEvent = output<Event>();\n\n protected readonly focusedState = signal<boolean>(false);\n\n constructor() {\n const destroyRef: DestroyRef = inject(DestroyRef);\n\n // Focus events are frequent: they are observed outside the Angular zone, and only a change of\n // the focus state re-enters it. The state is a signal, so a zoneless application renders it\n // too.\n this.ngZone.runOutsideAngular(() =>\n NgDocFocusCatcherDirective.observeFocus(toElement(this.elementRef))\n .pipe(takeUntilDestroyed(destroyRef))\n .subscribe((event: FocusEvent) =>\n this.ngZone.run(() => {\n const focused: boolean = event.type === FOCUS_EVENT;\n\n this.focusedState.set(focused);\n focused ? this.focusEvent.emit(event) : this.blurEvent.emit(event);\n }),\n ),\n );\n }\n\n /** Whether focus is inside the host. */\n get focused(): boolean {\n return this.focusedState();\n }\n\n static observeFocus(element: HTMLElement): Observable<FocusEvent> {\n return merge(\n fromEvent<FocusEvent>(element, FOCUS_EVENT),\n fromEvent<FocusEvent>(element, BLUR_EVENT),\n ).pipe(\n debounceTime(0),\n distinctUntilChanged((a: FocusEvent, b: FocusEvent) => a.type === b.type),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAOA;MAQa,0BAA0B,CAAA;AAYrC,IAAA,WAAA,GAAA;AAXQ,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;QAGtB,IAAA,CAAA,UAAU,GAAG,MAAM,EAAS;;QAG5B,IAAA,CAAA,SAAS,GAAG,MAAM,EAAS;QAEjB,IAAA,CAAA,YAAY,GAAG,MAAM,CAAU,KAAK;yFAAC;AAGtD,QAAA,MAAM,UAAU,GAAe,MAAM,CAAC,UAAU,CAAC;;;;AAKjD,QAAA,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAC5B,0BAA0B,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;AAC/D,aAAA,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC;AACnC,aAAA,SAAS,CAAC,CAAC,KAAiB,KAC3B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAK;AACnB,YAAA,MAAM,OAAO,GAAY,KAAK,CAAC,IAAI,KAAK,WAAW;AAEnD,YAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC;YAC9B,OAA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angular/core';
2
- import { HostBinding, Input, Directive } from '@angular/core';
2
+ import { input, Directive } from '@angular/core';
3
3
 
4
+ /**
5
+ * Puts the host into the tab order (`tabindex="0"`) or takes it out (`tabindex="-1"`).
6
+ */
4
7
  class NgDocFocusableDirective {
5
8
  constructor() {
6
- this.focusable = true;
7
- }
8
- get tabIndex() {
9
- return this.focusable ? 0 : -1;
9
+ /** Whether the host can be focused with the keyboard. */
10
+ this.focusable = input(true, { ...(ngDevMode ? { debugName: "focusable" } : /* istanbul ignore next */ {}), alias: 'ngDocFocusable' });
10
11
  }
11
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocFocusableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
12
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: NgDocFocusableDirective, isStandalone: true, selector: "[ngDocFocusable]", inputs: { focusable: ["ngDocFocusable", "focusable"] }, host: { properties: { "attr.tabIndex": "this.tabIndex" } }, exportAs: ["ngDocFocusable"], ngImport: i0 }); }
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocFocusableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
13
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.1", type: NgDocFocusableDirective, isStandalone: true, selector: "[ngDocFocusable]", inputs: { focusable: { classPropertyName: "focusable", publicName: "ngDocFocusable", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.tabIndex": "focusable() ? 0 : -1" } }, exportAs: ["ngDocFocusable"], ngImport: i0 }); }
13
14
  }
14
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocFocusableDirective, decorators: [{
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocFocusableDirective, decorators: [{
15
16
  type: Directive,
16
17
  args: [{
17
18
  selector: '[ngDocFocusable]',
18
19
  exportAs: 'ngDocFocusable',
19
- standalone: true,
20
+ host: {
21
+ '[attr.tabIndex]': 'focusable() ? 0 : -1',
22
+ },
20
23
  }]
21
- }], propDecorators: { focusable: [{
22
- type: Input,
23
- args: ['ngDocFocusable']
24
- }], tabIndex: [{
25
- type: HostBinding,
26
- args: ['attr.tabIndex']
27
- }] } });
24
+ }], propDecorators: { focusable: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngDocFocusable", required: false }] }] } });
28
25
 
29
26
  /**
30
27
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-ui-kit-directives-focusable.mjs","sources":["../../../../libs/ui-kit/directives/focusable/focusable.directive.ts","../../../../libs/ui-kit/directives/focusable/ng-doc-ui-kit-directives-focusable.ts"],"sourcesContent":["import { Directive, HostBinding, Input } from '@angular/core';\n\n@Directive({\n\tselector: '[ngDocFocusable]',\n\texportAs: 'ngDocFocusable',\n\tstandalone: true,\n})\nexport class NgDocFocusableDirective {\n\t@Input('ngDocFocusable')\n\tfocusable: boolean = true;\n\n\t@HostBinding('attr.tabIndex')\n\tget tabIndex(): number {\n\t\treturn this.focusable ? 0 : -1;\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAOa,uBAAuB,CAAA;AALpC,IAAA,WAAA,GAAA;QAOC,IAAA,CAAA,SAAS,GAAY,IAAI;AAMzB,IAAA;AAJA,IAAA,IACI,QAAQ,GAAA;AACX,QAAA,OAAO,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B;8GAPY,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,CAAA,gBAAA,EAAA,WAAA,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,eAAA,EAAA,eAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBALnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AAChB,iBAAA;;sBAEC,KAAK;uBAAC,gBAAgB;;sBAGtB,WAAW;uBAAC,eAAe;;;ACX7B;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-ui-kit-directives-focusable.mjs","sources":["../../../../libs/ui-kit/directives/focusable/focusable.directive.ts","../../../../libs/ui-kit/directives/focusable/ng-doc-ui-kit-directives-focusable.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\n\n/**\n * Puts the host into the tab order (`tabindex=\"0\"`) or takes it out (`tabindex=\"-1\"`).\n */\n@Directive({\n selector: '[ngDocFocusable]',\n exportAs: 'ngDocFocusable',\n host: {\n '[attr.tabIndex]': 'focusable() ? 0 : -1',\n },\n})\nexport class NgDocFocusableDirective {\n /** Whether the host can be focused with the keyboard. */\n readonly focusable = input<boolean>(true, { alias: 'ngDocFocusable' });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;AAEG;MAQU,uBAAuB,CAAA;AAPpC,IAAA,WAAA,GAAA;;QASW,IAAA,CAAA,SAAS,GAAG,KAAK,CAAU,IAAI,iFAAI,KAAK,EAAE,gBAAgB,EAAA,CAAG;AACvE,IAAA;8GAHY,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,eAAA,EAAA,sBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAPnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,IAAI,EAAE;AACJ,wBAAA,iBAAiB,EAAE,sBAAsB;AAC1C,qBAAA;AACF,iBAAA;;;ACXD;;AAEG;;;;"}
@@ -0,0 +1,90 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, DOCUMENT, ElementRef, signal, NgZone, DestroyRef, afterNextRender, Directive } from '@angular/core';
3
+
4
+ /**
5
+ * Shows its host element fullscreen with the browser Fullscreen API.
6
+ *
7
+ * `supported()` stays `false` on the server and in browsers that do not allow fullscreen
8
+ * (`document.fullscreenEnabled`), so a control that uses the directive can hide itself there.
9
+ * `active()` follows the browser's fullscreen state, including an exit with Esc, and the host
10
+ * gets `data-ng-doc-fullscreen="true"` while it is fullscreen.
11
+ * @example
12
+ * <div ngDocFullscreen #stage="ngDocFullscreen">
13
+ * <button (click)="stage.toggle()">{{ stage.active() ? 'Exit fullscreen' : 'Fullscreen' }}</button>
14
+ * </div>
15
+ */
16
+ class NgDocFullscreenDirective {
17
+ constructor() {
18
+ this.document = inject(DOCUMENT);
19
+ this.host = inject(ElementRef).nativeElement;
20
+ this.supportedState = signal(false, /* @ts-ignore */
21
+ ...(ngDevMode ? [{ debugName: "supportedState" }] : /* istanbul ignore next */ []));
22
+ this.activeState = signal(false, /* @ts-ignore */
23
+ ...(ngDevMode ? [{ debugName: "activeState" }] : /* istanbul ignore next */ []));
24
+ /** Whether the browser can show the host fullscreen. Always `false` on the server. */
25
+ this.supported = this.supportedState.asReadonly();
26
+ /** Whether the host is shown fullscreen. */
27
+ this.active = this.activeState.asReadonly();
28
+ const ngZone = inject(NgZone);
29
+ const destroyRef = inject(DestroyRef);
30
+ // The Fullscreen API exists only in the browser, and the first render must match the
31
+ // server-rendered markup, so support is detected after it.
32
+ afterNextRender(() => {
33
+ const sync = () => this.activeState.set(this.document.fullscreenElement === this.host);
34
+ this.supportedState.set(!!this.document.fullscreenEnabled && typeof this.host.requestFullscreen === 'function');
35
+ sync();
36
+ // The signal it writes schedules the render, so the listener needs no zone.
37
+ ngZone.runOutsideAngular(() => this.document.addEventListener('fullscreenchange', sync));
38
+ destroyRef.onDestroy(() => this.document.removeEventListener('fullscreenchange', sync));
39
+ });
40
+ }
41
+ /**
42
+ * Shows the host fullscreen. Does nothing where fullscreen is not supported, and a request the
43
+ * browser refuses leaves the page as it is.
44
+ */
45
+ async enter() {
46
+ if (!this.supported() || this.active())
47
+ return;
48
+ try {
49
+ await this.host.requestFullscreen();
50
+ }
51
+ catch {
52
+ // The browser refused (no user gesture, a permissions policy, or the element left the
53
+ // document); `fullscreenchange` does not fire, so the state is still right.
54
+ }
55
+ }
56
+ /** Leaves fullscreen when the host is the fullscreen element. */
57
+ async exit() {
58
+ if (this.document.fullscreenElement !== this.host)
59
+ return;
60
+ try {
61
+ await this.document.exitFullscreen();
62
+ }
63
+ catch {
64
+ // Fullscreen has already ended (for example with Esc).
65
+ }
66
+ }
67
+ /** Enters fullscreen, or leaves it when the host is already fullscreen. */
68
+ toggle() {
69
+ return this.active() ? this.exit() : this.enter();
70
+ }
71
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocFullscreenDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
72
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.1", type: NgDocFullscreenDirective, isStandalone: true, selector: "[ngDocFullscreen]", host: { properties: { "attr.data-ng-doc-fullscreen": "active()" } }, exportAs: ["ngDocFullscreen"], ngImport: i0 }); }
73
+ }
74
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocFullscreenDirective, decorators: [{
75
+ type: Directive,
76
+ args: [{
77
+ selector: '[ngDocFullscreen]',
78
+ exportAs: 'ngDocFullscreen',
79
+ host: {
80
+ '[attr.data-ng-doc-fullscreen]': 'active()',
81
+ },
82
+ }]
83
+ }], ctorParameters: () => [] });
84
+
85
+ /**
86
+ * Generated bundle index. Do not edit.
87
+ */
88
+
89
+ export { NgDocFullscreenDirective };
90
+ //# sourceMappingURL=ng-doc-ui-kit-directives-fullscreen.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ng-doc-ui-kit-directives-fullscreen.mjs","sources":["../../../../libs/ui-kit/directives/fullscreen/fullscreen.directive.ts","../../../../libs/ui-kit/directives/fullscreen/ng-doc-ui-kit-directives-fullscreen.ts"],"sourcesContent":["import {\n afterNextRender,\n DestroyRef,\n Directive,\n DOCUMENT,\n ElementRef,\n inject,\n NgZone,\n Signal,\n signal,\n} from '@angular/core';\n\n/**\n * Shows its host element fullscreen with the browser Fullscreen API.\n *\n * `supported()` stays `false` on the server and in browsers that do not allow fullscreen\n * (`document.fullscreenEnabled`), so a control that uses the directive can hide itself there.\n * `active()` follows the browser's fullscreen state, including an exit with Esc, and the host\n * gets `data-ng-doc-fullscreen=\"true\"` while it is fullscreen.\n * @example\n * <div ngDocFullscreen #stage=\"ngDocFullscreen\">\n * <button (click)=\"stage.toggle()\">{{ stage.active() ? 'Exit fullscreen' : 'Fullscreen' }}</button>\n * </div>\n */\n@Directive({\n selector: '[ngDocFullscreen]',\n exportAs: 'ngDocFullscreen',\n host: {\n '[attr.data-ng-doc-fullscreen]': 'active()',\n },\n})\nexport class NgDocFullscreenDirective {\n private readonly document = inject(DOCUMENT);\n private readonly host: HTMLElement = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly supportedState = signal<boolean>(false);\n private readonly activeState = signal<boolean>(false);\n\n /** Whether the browser can show the host fullscreen. Always `false` on the server. */\n readonly supported: Signal<boolean> = this.supportedState.asReadonly();\n\n /** Whether the host is shown fullscreen. */\n readonly active: Signal<boolean> = this.activeState.asReadonly();\n\n constructor() {\n const ngZone = inject(NgZone);\n const destroyRef = inject(DestroyRef);\n\n // The Fullscreen API exists only in the browser, and the first render must match the\n // server-rendered markup, so support is detected after it.\n afterNextRender(() => {\n const sync = (): void => this.activeState.set(this.document.fullscreenElement === this.host);\n\n this.supportedState.set(\n !!this.document.fullscreenEnabled && typeof this.host.requestFullscreen === 'function',\n );\n sync();\n // The signal it writes schedules the render, so the listener needs no zone.\n ngZone.runOutsideAngular(() => this.document.addEventListener('fullscreenchange', sync));\n destroyRef.onDestroy(() => this.document.removeEventListener('fullscreenchange', sync));\n });\n }\n\n /**\n * Shows the host fullscreen. Does nothing where fullscreen is not supported, and a request the\n * browser refuses leaves the page as it is.\n */\n async enter(): Promise<void> {\n if (!this.supported() || this.active()) return;\n\n try {\n await this.host.requestFullscreen();\n } catch {\n // The browser refused (no user gesture, a permissions policy, or the element left the\n // document); `fullscreenchange` does not fire, so the state is still right.\n }\n }\n\n /** Leaves fullscreen when the host is the fullscreen element. */\n async exit(): Promise<void> {\n if (this.document.fullscreenElement !== this.host) return;\n\n try {\n await this.document.exitFullscreen();\n } catch {\n // Fullscreen has already ended (for example with Esc).\n }\n }\n\n /** Enters fullscreen, or leaves it when the host is already fullscreen. */\n toggle(): Promise<void> {\n return this.active() ? this.exit() : this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
- import { inject, NgZone, EventEmitter, DestroyRef, afterNextRender, Output, Input, Directive } from '@angular/core';
3
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
- import { isKeyboardEvent } from '@ng-doc/core/helpers/is-keyboard-event';
2
+ import { input, output, inject, DOCUMENT, NgZone, DestroyRef, afterNextRender, untracked, Directive } from '@angular/core';
5
3
  import { objectKeys } from '@ng-doc/core/helpers/object-keys';
6
- import { ngDocZoneOptimize } from '@ng-doc/ui-kit/observables';
7
- import { fromEvent } from 'rxjs';
8
- import { filter } from 'rxjs/operators';
9
4
 
5
+ /** Elements where a key types text instead of running a hotkey. */
6
+ const TEXT_ENTRY = 'input, textarea, select, [contenteditable]:not([contenteditable="false"])';
7
+ /**
8
+ * Emits when a key that matches the given keyboard event properties is released anywhere in the
9
+ * document, except while the reader types in a field.
10
+ * @example
11
+ * <button [ngDocHotkey]="{ key: 'k', ctrlKey: true }" (ngDocHotkey)="open()">Open</button>
12
+ */
10
13
  class NgDocHotkeyDirective {
11
14
  constructor() {
12
- this.ngZone = inject(NgZone);
13
- this.callback = new EventEmitter();
15
+ /** The keyboard event properties to match, for example the key and the modifier keys. */
16
+ this.hotkey = input(undefined, { ...(ngDevMode ? { debugName: "hotkey" } : /* istanbul ignore next */ {}), alias: 'ngDocHotkey' });
17
+ /** Emits when the hotkey is released. */
18
+ this.callback = output({ alias: 'ngDocHotkey' });
19
+ const document = inject(DOCUMENT);
20
+ const ngZone = inject(NgZone);
14
21
  const destroyRef = inject(DestroyRef);
15
22
  afterNextRender(() => {
16
- fromEvent(document, 'keyup')
17
- .pipe(filter(isKeyboardEvent), filter((event) => objectKeys(this.hotkey ?? {}).every((key) => this.hotkey && this.hotkey[key] === event[key])), filter((event) => {
18
- if (event.target instanceof HTMLElement) {
19
- return !['input', 'textarea', 'select'].includes(event.target.tagName.toLowerCase());
23
+ const listener = (event) => {
24
+ if (!this.matches(event)) {
25
+ return;
20
26
  }
21
- return true;
22
- }), ngDocZoneOptimize(this.ngZone), takeUntilDestroyed(destroyRef))
23
- .subscribe((event) => {
24
27
  event.preventDefault();
25
- this.callback.emit();
26
- });
28
+ // The listener runs outside the zone, so zone.js applications get change detection only
29
+ // when the hotkey matches.
30
+ ngZone.run(() => this.callback.emit());
31
+ };
32
+ ngZone.runOutsideAngular(() => document.addEventListener('keyup', listener));
33
+ destroyRef.onDestroy(() => document.removeEventListener('keyup', listener));
27
34
  });
28
35
  }
29
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocHotkeyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
30
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: NgDocHotkeyDirective, isStandalone: true, selector: "[ngDocHotkey]", inputs: { hotkey: ["ngDocHotkey", "hotkey"] }, outputs: { callback: "ngDocHotkey" }, ngImport: i0 }); }
36
+ matches(event) {
37
+ const hotkey = untracked(this.hotkey) ?? {};
38
+ const target = event.composedPath?.()[0] ?? event.target;
39
+ return (objectKeys(hotkey).every((key) => hotkey[key] === event[key]) &&
40
+ !(target instanceof Element && target.closest(TEXT_ENTRY)));
41
+ }
42
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocHotkeyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
43
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.1", type: NgDocHotkeyDirective, isStandalone: true, selector: "[ngDocHotkey]", inputs: { hotkey: { classPropertyName: "hotkey", publicName: "ngDocHotkey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { callback: "ngDocHotkey" }, ngImport: i0 }); }
31
44
  }
32
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocHotkeyDirective, decorators: [{
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocHotkeyDirective, decorators: [{
33
46
  type: Directive,
34
47
  args: [{
35
48
  selector: '[ngDocHotkey]',
36
- standalone: true,
37
49
  }]
38
- }], ctorParameters: () => [], propDecorators: { hotkey: [{
39
- type: Input,
40
- args: ['ngDocHotkey']
41
- }], callback: [{
42
- type: Output,
43
- args: ['ngDocHotkey']
44
- }] } });
50
+ }], ctorParameters: () => [], propDecorators: { hotkey: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngDocHotkey", required: false }] }], callback: [{ type: i0.Output, args: ["ngDocHotkey"] }] } });
45
51
 
46
52
  /**
47
53
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-ui-kit-directives-hotkey.mjs","sources":["../../../../libs/ui-kit/directives/hotkey/hotkey.directive.ts","../../../../libs/ui-kit/directives/hotkey/ng-doc-ui-kit-directives-hotkey.ts"],"sourcesContent":["import {\n afterNextRender,\n DestroyRef,\n Directive,\n EventEmitter,\n inject,\n Input,\n NgZone,\n Output,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { isKeyboardEvent } from '@ng-doc/core/helpers/is-keyboard-event';\nimport { objectKeys } from '@ng-doc/core/helpers/object-keys';\nimport { ngDocZoneOptimize } from '@ng-doc/ui-kit/observables';\nimport { fromEvent } from 'rxjs';\nimport { filter } from 'rxjs/operators';\n\n@Directive({\n selector: '[ngDocHotkey]',\n standalone: true,\n})\nexport class NgDocHotkeyDirective {\n private readonly ngZone = inject(NgZone);\n\n @Input('ngDocHotkey')\n hotkey?: Partial<KeyboardEvent>;\n\n @Output('ngDocHotkey')\n callback: EventEmitter<void> = new EventEmitter<void>();\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n afterNextRender(() => {\n fromEvent(document, 'keyup')\n .pipe(\n filter(isKeyboardEvent),\n filter((event: KeyboardEvent) =>\n objectKeys(this.hotkey ?? {}).every(\n (key: keyof KeyboardEvent) => this.hotkey && this.hotkey[key] === event[key],\n ),\n ),\n filter((event: KeyboardEvent) => {\n if (event.target instanceof HTMLElement) {\n return !['input', 'textarea', 'select'].includes(event.target.tagName.toLowerCase());\n }\n return true;\n }),\n ngDocZoneOptimize(this.ngZone),\n takeUntilDestroyed(destroyRef),\n )\n .subscribe((event: KeyboardEvent) => {\n event.preventDefault();\n this.callback.emit();\n });\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAqBa,oBAAoB,CAAA;AAS/B,IAAA,WAAA,GAAA;AARiB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAMxC,QAAA,IAAA,CAAA,QAAQ,GAAuB,IAAI,YAAY,EAAQ;AAGrD,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAErC,eAAe,CAAC,MAAK;AACnB,YAAA,SAAS,CAAC,QAAQ,EAAE,OAAO;iBACxB,IAAI,CACH,MAAM,CAAC,eAAe,CAAC,EACvB,MAAM,CAAC,CAAC,KAAoB,KAC1B,UAAU,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,KAAK,CACjC,CAAC,GAAwB,KAAK,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,CAC7E,CACF,EACD,MAAM,CAAC,CAAC,KAAoB,KAAI;AAC9B,gBAAA,IAAI,KAAK,CAAC,MAAM,YAAY,WAAW,EAAE;oBACvC,OAAO,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;gBACtF;AACA,gBAAA,OAAO,IAAI;AACb,YAAA,CAAC,CAAC,EACF,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,EAC9B,kBAAkB,CAAC,UAAU,CAAC;AAE/B,iBAAA,SAAS,CAAC,CAAC,KAAoB,KAAI;gBAClC,KAAK,CAAC,cAAc,EAAE;AACtB,gBAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AACtB,YAAA,CAAC,CAAC;AACN,QAAA,CAAC,CAAC;IACJ;8GAnCW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,QAAA,CAAA,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,aAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;sBAIE,KAAK;uBAAC,aAAa;;sBAGnB,MAAM;uBAAC,aAAa;;;AC3BvB;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-ui-kit-directives-hotkey.mjs","sources":["../../../../libs/ui-kit/directives/hotkey/hotkey.directive.ts","../../../../libs/ui-kit/directives/hotkey/ng-doc-ui-kit-directives-hotkey.ts"],"sourcesContent":["import {\n afterNextRender,\n DestroyRef,\n Directive,\n DOCUMENT,\n inject,\n input,\n NgZone,\n output,\n untracked,\n} from '@angular/core';\nimport { objectKeys } from '@ng-doc/core/helpers/object-keys';\n\n/** Elements where a key types text instead of running a hotkey. */\nconst TEXT_ENTRY = 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])';\n\n/**\n * Emits when a key that matches the given keyboard event properties is released anywhere in the\n * document, except while the reader types in a field.\n * @example\n * <button [ngDocHotkey]=\"{ key: 'k', ctrlKey: true }\" (ngDocHotkey)=\"open()\">Open</button>\n */\n@Directive({\n selector: '[ngDocHotkey]',\n})\nexport class NgDocHotkeyDirective {\n /** The keyboard event properties to match, for example the key and the modifier keys. */\n readonly hotkey = input<Partial<KeyboardEvent>>(undefined, { alias: 'ngDocHotkey' });\n\n /** Emits when the hotkey is released. */\n readonly callback = output<void>({ alias: 'ngDocHotkey' });\n\n constructor() {\n const document = inject(DOCUMENT);\n const ngZone = inject(NgZone);\n const destroyRef = inject(DestroyRef);\n\n afterNextRender(() => {\n const listener = (event: KeyboardEvent) => {\n if (!this.matches(event)) {\n return;\n }\n\n event.preventDefault();\n // The listener runs outside the zone, so zone.js applications get change detection only\n // when the hotkey matches.\n ngZone.run(() => this.callback.emit());\n };\n\n ngZone.runOutsideAngular(() => document.addEventListener('keyup', listener));\n destroyRef.onDestroy(() => document.removeEventListener('keyup', listener));\n });\n }\n\n private matches(event: KeyboardEvent): boolean {\n const hotkey = untracked(this.hotkey) ?? {};\n const target = event.composedPath?.()[0] ?? event.target;\n\n return (\n objectKeys(hotkey).every((key: keyof KeyboardEvent) => hotkey[key] === event[key]) &&\n !(target instanceof Element && target.closest(TEXT_ENTRY))\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAaA;AACA,MAAM,UAAU,GAAG,2EAA2E;AAE9F;;;;;AAKG;MAIU,oBAAoB,CAAA;AAO/B,IAAA,WAAA,GAAA;;QALS,IAAA,CAAA,MAAM,GAAG,KAAK,CAAyB,SAAS,8EAAI,KAAK,EAAE,aAAa,EAAA,CAAG;;QAG3E,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAGxD,QAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACjC,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC7B,QAAA,MAAM,UAAU,GAAG,MAAM,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AA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,aAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AAC1B,iBAAA;;;ACxBD;;AAEG;;;;"}
@@ -1,9 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { forwardRef, HostListener, Directive } from '@angular/core';
2
+ import { forwardRef, Directive } from '@angular/core';
3
3
  import { isPresent } from '@ng-doc/core/helpers/is-present';
4
4
  import { NgDocBaseInput } from '@ng-doc/ui-kit/classes/base-input';
5
5
  import { toElement } from '@ng-doc/ui-kit/helpers';
6
6
 
7
+ /** Directive turns a native input into a control whose model is a number */
7
8
  class NgDocInputNumberDirective extends NgDocBaseInput {
8
9
  constructor() {
9
10
  super({
@@ -18,27 +19,24 @@ class NgDocInputNumberDirective extends NgDocBaseInput {
18
19
  inputEvent() {
19
20
  this.updateModel(Number(this.elementRef.nativeElement.value));
20
21
  }
21
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocInputNumberDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
22
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: NgDocInputNumberDirective, isStandalone: true, selector: "input[ngDocInputNumber]", host: { listeners: { "blur": "blurEvent()", "input": "inputEvent()" } }, providers: [
22
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocInputNumberDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
23
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.1", type: NgDocInputNumberDirective, isStandalone: true, selector: "input[ngDocInputNumber]", host: { listeners: { "blur": "blurEvent()", "input": "inputEvent()" } }, providers: [
23
24
  { provide: NgDocBaseInput, useExisting: forwardRef(() => NgDocInputNumberDirective) },
24
25
  ], usesInheritance: true, ngImport: i0 }); }
25
26
  }
26
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocInputNumberDirective, decorators: [{
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocInputNumberDirective, decorators: [{
27
28
  type: Directive,
28
29
  args: [{
29
30
  selector: `input[ngDocInputNumber]`,
30
31
  providers: [
31
32
  { provide: NgDocBaseInput, useExisting: forwardRef(() => NgDocInputNumberDirective) },
32
33
  ],
33
- standalone: true,
34
+ host: {
35
+ '(blur)': 'blurEvent()',
36
+ '(input)': 'inputEvent()',
37
+ },
34
38
  }]
35
- }], ctorParameters: () => [], propDecorators: { blurEvent: [{
36
- type: HostListener,
37
- args: ['blur']
38
- }], inputEvent: [{
39
- type: HostListener,
40
- args: ['input']
41
- }] } });
39
+ }], ctorParameters: () => [] });
42
40
 
43
41
  /**
44
42
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-ui-kit-directives-input-number.mjs","sources":["../../../../libs/ui-kit/directives/input-number/input-number.directive.ts","../../../../libs/ui-kit/directives/input-number/ng-doc-ui-kit-directives-input-number.ts"],"sourcesContent":["import { Directive, forwardRef, HostListener } from '@angular/core';\nimport { isPresent } from '@ng-doc/core/helpers/is-present';\nimport { NgDocBaseInput } from '@ng-doc/ui-kit/classes/base-input';\nimport { toElement } from '@ng-doc/ui-kit/helpers';\n\n@Directive({\n selector: `input[ngDocInputNumber]`,\n providers: [\n { provide: NgDocBaseInput, useExisting: forwardRef(() => NgDocInputNumberDirective) },\n ],\n standalone: true,\n})\nexport class NgDocInputNumberDirective extends NgDocBaseInput<number> {\n constructor() {\n super({\n onIncomingUpdate: (value) => {\n toElement(this.elementRef).value = isPresent(value) ? String(Number(value)) : '';\n },\n });\n }\n\n @HostListener('blur')\n blurEvent(): void {\n this.touch();\n }\n\n @HostListener('input')\n inputEvent(): void {\n this.updateModel(Number(this.elementRef.nativeElement.value));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAYM,MAAO,yBAA0B,SAAQ,cAAsB,CAAA;AACnE,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,CAAC;AACJ,YAAA,gBAAgB,EAAE,CAAC,KAAK,KAAI;gBAC1B,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE;YAClF,CAAC;AACF,SAAA,CAAC;IACJ;IAGA,SAAS,GAAA;QACP,IAAI,CAAC,KAAK,EAAE;IACd;IAGA,UAAU,GAAA;AACR,QAAA,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC/D;8GAjBW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAzB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,MAAA,EAAA,aAAA,EAAA,OAAA,EAAA,cAAA,EAAA,EAAA,EAAA,SAAA,EALzB;AACT,YAAA,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,yBAAyB,CAAC,EAAE;AACtF,SAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAGU,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAPrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,CAAA,uBAAA,CAAyB;AACnC,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,CAAC,MAAK,yBAA0B,CAAC,EAAE;AACtF,qBAAA;AACD,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;sBAUE,YAAY;uBAAC,MAAM;;sBAKnB,YAAY;uBAAC,OAAO;;;AC1BvB;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-ui-kit-directives-input-number.mjs","sources":["../../../../libs/ui-kit/directives/input-number/input-number.directive.ts","../../../../libs/ui-kit/directives/input-number/ng-doc-ui-kit-directives-input-number.ts"],"sourcesContent":["import { Directive, forwardRef } from '@angular/core';\nimport { isPresent } from '@ng-doc/core/helpers/is-present';\nimport { NgDocBaseInput } from '@ng-doc/ui-kit/classes/base-input';\nimport { toElement } from '@ng-doc/ui-kit/helpers';\n\n/** Directive turns a native input into a control whose model is a number */\n@Directive({\n selector: `input[ngDocInputNumber]`,\n providers: [\n { provide: NgDocBaseInput, useExisting: forwardRef(() => NgDocInputNumberDirective) },\n ],\n host: {\n '(blur)': 'blurEvent()',\n '(input)': 'inputEvent()',\n },\n})\nexport class NgDocInputNumberDirective extends NgDocBaseInput<number> {\n constructor() {\n super({\n onIncomingUpdate: (value) => {\n toElement(this.elementRef).value = isPresent(value) ? String(Number(value)) : '';\n },\n });\n }\n\n protected blurEvent(): void {\n this.touch();\n }\n\n protected inputEvent(): void {\n this.updateModel(Number(this.elementRef.nativeElement.value));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names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