@ngstarter-ui/components 22.3.6 → 22.4.1

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 (476) hide show
  1. package/README.md +27 -0
  2. package/ai/component-registry.json +186 -101
  3. package/fesm2022/attachment-block-BK9QxVjq.mjs +163 -0
  4. package/fesm2022/attachment-block-BK9QxVjq.mjs.map +1 -0
  5. package/fesm2022/callout-block-Bl4GZYz8.mjs +196 -0
  6. package/fesm2022/callout-block-Bl4GZYz8.mjs.map +1 -0
  7. package/fesm2022/code-block.component-DCRD-9iP.mjs +393 -0
  8. package/fesm2022/code-block.component-DCRD-9iP.mjs.map +1 -0
  9. package/fesm2022/content-builder.store-D622mHxt.mjs +328 -0
  10. package/fesm2022/content-builder.store-D622mHxt.mjs.map +1 -0
  11. package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs +1110 -0
  12. package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs.map +1 -0
  13. package/fesm2022/cursor-controller-DKfBII1n.mjs +55 -0
  14. package/fesm2022/cursor-controller-DKfBII1n.mjs.map +1 -0
  15. package/fesm2022/default-converters-9oSKDsXP.mjs +140 -0
  16. package/fesm2022/default-converters-9oSKDsXP.mjs.map +1 -0
  17. package/fesm2022/divider-block.component-Dvgeq_D0.mjs +148 -0
  18. package/fesm2022/divider-block.component-Dvgeq_D0.mjs.map +1 -0
  19. package/fesm2022/embed-block-CYkOv4Wt.mjs +565 -0
  20. package/fesm2022/embed-block-CYkOv4Wt.mjs.map +1 -0
  21. package/fesm2022/extra-block-defs-Cn_hfM3c.mjs +122 -0
  22. package/fesm2022/extra-block-defs-Cn_hfM3c.mjs.map +1 -0
  23. package/fesm2022/gallery-block-DT3uIURY.mjs +365 -0
  24. package/fesm2022/gallery-block-DT3uIURY.mjs.map +1 -0
  25. package/fesm2022/grid-block-ZVDT3m8-.mjs +504 -0
  26. package/fesm2022/grid-block-ZVDT3m8-.mjs.map +1 -0
  27. package/fesm2022/heading-block.component-iCpJGTMh.mjs +274 -0
  28. package/fesm2022/heading-block.component-iCpJGTMh.mjs.map +1 -0
  29. package/fesm2022/html-utils-DywL8gGa.mjs +24 -0
  30. package/fesm2022/html-utils-DywL8gGa.mjs.map +1 -0
  31. package/fesm2022/image-block.component-DJ7-HCR8.mjs +285 -0
  32. package/fesm2022/image-block.component-DJ7-HCR8.mjs.map +1 -0
  33. package/fesm2022/list-block.component-qFIebEBO.mjs +312 -0
  34. package/fesm2022/list-block.component-qFIebEBO.mjs.map +1 -0
  35. package/fesm2022/nested-blocks-CXhgXJ1H.mjs +345 -0
  36. package/fesm2022/nested-blocks-CXhgXJ1H.mjs.map +1 -0
  37. package/fesm2022/ngstarter-ui-components-action-required.mjs +150 -45
  38. package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -1
  39. package/fesm2022/ngstarter-ui-components-alert.mjs +318 -133
  40. package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -1
  41. package/fesm2022/ngstarter-ui-components-announcement.mjs +280 -88
  42. package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -1
  43. package/fesm2022/ngstarter-ui-components-autocomplete.mjs +647 -386
  44. package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
  45. package/fesm2022/ngstarter-ui-components-avatar.mjs +715 -482
  46. package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -1
  47. package/fesm2022/ngstarter-ui-components-badge.mjs +308 -97
  48. package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -1
  49. package/fesm2022/ngstarter-ui-components-block-loader.mjs +164 -47
  50. package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -1
  51. package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs +278 -315
  52. package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs.map +1 -1
  53. package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +707 -205
  54. package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -1
  55. package/fesm2022/ngstarter-ui-components-button-toggle.mjs +518 -175
  56. package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -1
  57. package/fesm2022/ngstarter-ui-components-button.mjs +294 -68
  58. package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
  59. package/fesm2022/ngstarter-ui-components-calendar.mjs +442 -250
  60. package/fesm2022/ngstarter-ui-components-calendar.mjs.map +1 -1
  61. package/fesm2022/ngstarter-ui-components-card-overlay.mjs +159 -47
  62. package/fesm2022/ngstarter-ui-components-card-overlay.mjs.map +1 -1
  63. package/fesm2022/ngstarter-ui-components-card.mjs +619 -194
  64. package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -1
  65. package/fesm2022/ngstarter-ui-components-carousel.mjs +1012 -634
  66. package/fesm2022/ngstarter-ui-components-carousel.mjs.map +1 -1
  67. package/fesm2022/ngstarter-ui-components-checkbox.mjs +715 -308
  68. package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -1
  69. package/fesm2022/ngstarter-ui-components-chips.mjs +1397 -667
  70. package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -1
  71. package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +519 -357
  72. package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -1
  73. package/fesm2022/ngstarter-ui-components-color-picker.mjs +1218 -604
  74. package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -1
  75. package/fesm2022/ngstarter-ui-components-color-scheme.mjs +265 -134
  76. package/fesm2022/ngstarter-ui-components-color-scheme.mjs.map +1 -1
  77. package/fesm2022/ngstarter-ui-components-color-switcher.mjs +190 -71
  78. package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -1
  79. package/fesm2022/ngstarter-ui-components-command-bar.mjs +197 -58
  80. package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -1
  81. package/fesm2022/ngstarter-ui-components-comment-editor.mjs +2212 -1128
  82. package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -1
  83. package/fesm2022/ngstarter-ui-components-comparison-slider.mjs +269 -183
  84. package/fesm2022/ngstarter-ui-components-comparison-slider.mjs.map +1 -1
  85. package/fesm2022/ngstarter-ui-components-confirm.mjs +164 -86
  86. package/fesm2022/ngstarter-ui-components-confirm.mjs.map +1 -1
  87. package/fesm2022/ngstarter-ui-components-content-editor.mjs +6240 -2
  88. package/fesm2022/ngstarter-ui-components-content-editor.mjs.map +1 -1
  89. package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +244 -108
  90. package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -1
  91. package/fesm2022/ngstarter-ui-components-core.mjs +2110 -1592
  92. package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
  93. package/fesm2022/ngstarter-ui-components-country-select.mjs +1970 -588
  94. package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
  95. package/fesm2022/ngstarter-ui-components-crop.mjs +249 -191
  96. package/fesm2022/ngstarter-ui-components-crop.mjs.map +1 -1
  97. package/fesm2022/ngstarter-ui-components-currency-select.mjs +1658 -452
  98. package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
  99. package/fesm2022/ngstarter-ui-components-data-view.mjs +4538 -2497
  100. package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
  101. package/fesm2022/ngstarter-ui-components-date-format-select.mjs +357 -157
  102. package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -1
  103. package/fesm2022/ngstarter-ui-components-datepicker.mjs +2587 -1264
  104. package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
  105. package/fesm2022/ngstarter-ui-components-dialog.mjs +681 -385
  106. package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -1
  107. package/fesm2022/ngstarter-ui-components-digit-roller.mjs +1000 -750
  108. package/fesm2022/ngstarter-ui-components-digit-roller.mjs.map +1 -1
  109. package/fesm2022/ngstarter-ui-components-divider.mjs +164 -41
  110. package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -1
  111. package/fesm2022/ngstarter-ui-components-drawer.mjs +218 -143
  112. package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -1
  113. package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +345 -247
  114. package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -1
  115. package/fesm2022/ngstarter-ui-components-empty-state.mjs +244 -74
  116. package/fesm2022/ngstarter-ui-components-empty-state.mjs.map +1 -1
  117. package/fesm2022/ngstarter-ui-components-events.mjs +467 -126
  118. package/fesm2022/ngstarter-ui-components-events.mjs.map +1 -1
  119. package/fesm2022/ngstarter-ui-components-expand.mjs +191 -59
  120. package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -1
  121. package/fesm2022/ngstarter-ui-components-expansion.mjs +529 -193
  122. package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -1
  123. package/fesm2022/ngstarter-ui-components-file-type.mjs +270 -171
  124. package/fesm2022/ngstarter-ui-components-file-type.mjs.map +1 -1
  125. package/fesm2022/ngstarter-ui-components-filter-builder.mjs +741 -352
  126. package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
  127. package/fesm2022/ngstarter-ui-components-form-builder.mjs +9032 -6964
  128. package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
  129. package/fesm2022/ngstarter-ui-components-form-field.mjs +741 -276
  130. package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -1
  131. package/fesm2022/ngstarter-ui-components-gauge.mjs +155 -43
  132. package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -1
  133. package/fesm2022/ngstarter-ui-components-grid.mjs +197 -81
  134. package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -1
  135. package/fesm2022/ngstarter-ui-components-guided-tour.mjs +881 -740
  136. package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -1
  137. package/fesm2022/ngstarter-ui-components-headless-editor.mjs +3573 -3656
  138. package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
  139. package/fesm2022/ngstarter-ui-components-headless-stepper.mjs +277 -204
  140. package/fesm2022/ngstarter-ui-components-headless-stepper.mjs.map +1 -1
  141. package/fesm2022/ngstarter-ui-components-icon.mjs +209 -182
  142. package/fesm2022/ngstarter-ui-components-icon.mjs.map +1 -1
  143. package/fesm2022/ngstarter-ui-components-image-designer.mjs +5096 -4066
  144. package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
  145. package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +45 -19
  146. package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -1
  147. package/fesm2022/ngstarter-ui-components-image-resizer.mjs +333 -154
  148. package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -1
  149. package/fesm2022/ngstarter-ui-components-image-viewer.mjs +564 -358
  150. package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -1
  151. package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +246 -167
  152. package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -1
  153. package/fesm2022/ngstarter-ui-components-incidents.mjs +732 -258
  154. package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -1
  155. package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +244 -182
  156. package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -1
  157. package/fesm2022/ngstarter-ui-components-input-mask.mjs +314 -174
  158. package/fesm2022/ngstarter-ui-components-input-mask.mjs.map +1 -1
  159. package/fesm2022/ngstarter-ui-components-input-validator.mjs +45 -69
  160. package/fesm2022/ngstarter-ui-components-input-validator.mjs.map +1 -1
  161. package/fesm2022/ngstarter-ui-components-input.mjs +303 -161
  162. package/fesm2022/ngstarter-ui-components-input.mjs.map +1 -1
  163. package/fesm2022/ngstarter-ui-components-kanban-board.mjs +504 -159
  164. package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
  165. package/fesm2022/ngstarter-ui-components-kbd.mjs +86 -30
  166. package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -1
  167. package/fesm2022/ngstarter-ui-components-layout.mjs +681 -220
  168. package/fesm2022/ngstarter-ui-components-layout.mjs.map +1 -1
  169. package/fesm2022/ngstarter-ui-components-list.mjs +968 -281
  170. package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -1
  171. package/fesm2022/ngstarter-ui-components-logo.mjs +181 -51
  172. package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -1
  173. package/fesm2022/ngstarter-ui-components-marquee.mjs +226 -147
  174. package/fesm2022/ngstarter-ui-components-marquee.mjs.map +1 -1
  175. package/fesm2022/ngstarter-ui-components-menu.mjs +1686 -1091
  176. package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
  177. package/fesm2022/ngstarter-ui-components-micro-chart.mjs +1541 -943
  178. package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -1
  179. package/fesm2022/ngstarter-ui-components-navigation.mjs +1035 -455
  180. package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -1
  181. package/fesm2022/ngstarter-ui-components-notifications.mjs +678 -230
  182. package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -1
  183. package/fesm2022/ngstarter-ui-components-number-input.mjs +616 -316
  184. package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -1
  185. package/fesm2022/ngstarter-ui-components-option.mjs +405 -163
  186. package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
  187. package/fesm2022/ngstarter-ui-components-overlay.mjs +107 -111
  188. package/fesm2022/ngstarter-ui-components-overlay.mjs.map +1 -1
  189. package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs +131 -76
  190. package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs.map +1 -1
  191. package/fesm2022/ngstarter-ui-components-paginator.mjs +543 -295
  192. package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -1
  193. package/fesm2022/ngstarter-ui-components-password-strength.mjs +785 -340
  194. package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -1
  195. package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +3705 -2695
  196. package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
  197. package/fesm2022/ngstarter-ui-components-pdf-signer.mjs +1179 -851
  198. package/fesm2022/ngstarter-ui-components-pdf-signer.mjs.map +1 -1
  199. package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +2973 -2070
  200. package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
  201. package/fesm2022/ngstarter-ui-components-phone-input.mjs +2081 -770
  202. package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
  203. package/fesm2022/ngstarter-ui-components-pin-input.mjs +366 -198
  204. package/fesm2022/ngstarter-ui-components-pin-input.mjs.map +1 -1
  205. package/fesm2022/ngstarter-ui-components-popover.mjs +558 -308
  206. package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -1
  207. package/fesm2022/ngstarter-ui-components-progress-bar.mjs +178 -73
  208. package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -1
  209. package/fesm2022/ngstarter-ui-components-radio-card.mjs +301 -105
  210. package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -1
  211. package/fesm2022/ngstarter-ui-components-radio.mjs +417 -157
  212. package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -1
  213. package/fesm2022/ngstarter-ui-components-rail-nav.mjs +208 -88
  214. package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -1
  215. package/fesm2022/ngstarter-ui-components-resizable-container.mjs +123 -74
  216. package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -1
  217. package/fesm2022/ngstarter-ui-components-screen-loader.mjs +197 -95
  218. package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -1
  219. package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +383 -245
  220. package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -1
  221. package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +705 -581
  222. package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -1
  223. package/fesm2022/ngstarter-ui-components-segmented.mjs +422 -220
  224. package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -1
  225. package/fesm2022/ngstarter-ui-components-select.mjs +1862 -1159
  226. package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
  227. package/fesm2022/ngstarter-ui-components-side-panel.mjs +313 -118
  228. package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -1
  229. package/fesm2022/ngstarter-ui-components-sidebar.mjs +1239 -470
  230. package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -1
  231. package/fesm2022/ngstarter-ui-components-sidenav.mjs +664 -354
  232. package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -1
  233. package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1092 -643
  234. package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
  235. package/fesm2022/ngstarter-ui-components-skeleton.mjs +153 -43
  236. package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -1
  237. package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +425 -108
  238. package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -1
  239. package/fesm2022/ngstarter-ui-components-slider.mjs +645 -487
  240. package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -1
  241. package/fesm2022/ngstarter-ui-components-snack-bar.mjs +372 -354
  242. package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -1
  243. package/fesm2022/ngstarter-ui-components-sort.mjs +378 -147
  244. package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
  245. package/fesm2022/ngstarter-ui-components-spinner.mjs +242 -76
  246. package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -1
  247. package/fesm2022/ngstarter-ui-components-splash-screen.mjs +142 -91
  248. package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -1
  249. package/fesm2022/ngstarter-ui-components-split.mjs +1067 -929
  250. package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -1
  251. package/fesm2022/ngstarter-ui-components-step-tracker.mjs +617 -331
  252. package/fesm2022/ngstarter-ui-components-step-tracker.mjs.map +1 -1
  253. package/fesm2022/ngstarter-ui-components-stepper.mjs +357 -126
  254. package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -1
  255. package/fesm2022/ngstarter-ui-components-suggestions.mjs +259 -72
  256. package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -1
  257. package/fesm2022/ngstarter-ui-components-tab-panel.mjs +674 -267
  258. package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -1
  259. package/fesm2022/ngstarter-ui-components-table.mjs +1144 -662
  260. package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
  261. package/fesm2022/ngstarter-ui-components-tabs.mjs +1236 -615
  262. package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -1
  263. package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +414 -216
  264. package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -1
  265. package/fesm2022/ngstarter-ui-components-tiles.mjs +939 -647
  266. package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -1
  267. package/fesm2022/ngstarter-ui-components-timeline.mjs +418 -122
  268. package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -1
  269. package/fesm2022/ngstarter-ui-components-timepicker.mjs +870 -508
  270. package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
  271. package/fesm2022/ngstarter-ui-components-timezone-select.mjs +651 -371
  272. package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -1
  273. package/fesm2022/ngstarter-ui-components-toolbar.mjs +727 -320
  274. package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -1
  275. package/fesm2022/ngstarter-ui-components-tooltip.mjs +601 -521
  276. package/fesm2022/ngstarter-ui-components-tooltip.mjs.map +1 -1
  277. package/fesm2022/ngstarter-ui-components-tree-select.mjs +1197 -434
  278. package/fesm2022/ngstarter-ui-components-tree-select.mjs.map +1 -1
  279. package/fesm2022/ngstarter-ui-components-tree.mjs +1821 -1262
  280. package/fesm2022/ngstarter-ui-components-tree.mjs.map +1 -1
  281. package/fesm2022/ngstarter-ui-components-upload.mjs +1059 -345
  282. package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
  283. package/fesm2022/ngstarter-ui-components-video-player.mjs +763 -533
  284. package/fesm2022/ngstarter-ui-components-video-player.mjs.map +1 -1
  285. package/fesm2022/ngstarter-ui-components-video-viewer.mjs +630 -229
  286. package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -1
  287. package/fesm2022/ngstarter-ui-components-visual-builder.mjs +40 -17
  288. package/fesm2022/ngstarter-ui-components-visual-builder.mjs.map +1 -1
  289. package/fesm2022/ngstarter-ui-components-whiteboard.mjs +3039 -1803
  290. package/fesm2022/ngstarter-ui-components-whiteboard.mjs.map +1 -1
  291. package/fesm2022/ngstarter-ui-components.mjs +3 -5
  292. package/fesm2022/ngstarter-ui-components.mjs.map +1 -1
  293. package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs +264 -0
  294. package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs.map +1 -0
  295. package/fesm2022/plain-text-settings-BnxCxLhA.mjs +354 -0
  296. package/fesm2022/plain-text-settings-BnxCxLhA.mjs.map +1 -0
  297. package/fesm2022/quote-block.component-tRmrU97F.mjs +309 -0
  298. package/fesm2022/quote-block.component-tRmrU97F.mjs.map +1 -0
  299. package/fesm2022/table-block.component-BuzRRggv.mjs +1859 -0
  300. package/fesm2022/table-block.component-BuzRRggv.mjs.map +1 -0
  301. package/fesm2022/toggle-block-C5Jo2YDf.mjs +150 -0
  302. package/fesm2022/toggle-block-C5Jo2YDf.mjs.map +1 -0
  303. package/fesm2022/upload-status-tZ0x0BUB.mjs +107 -0
  304. package/fesm2022/upload-status-tZ0x0BUB.mjs.map +1 -0
  305. package/fesm2022/video-block.component-CpAXibm6.mjs +312 -0
  306. package/fesm2022/video-block.component-CpAXibm6.mjs.map +1 -0
  307. package/package.json +11 -10
  308. package/styles/_tokens.scss +1 -0
  309. package/types/ngstarter-ui-components-action-required.d.ts +34 -14
  310. package/types/ngstarter-ui-components-alert.d.ts +53 -44
  311. package/types/ngstarter-ui-components-announcement.d.ts +74 -53
  312. package/types/ngstarter-ui-components-autocomplete.d.ts +141 -84
  313. package/types/ngstarter-ui-components-avatar.d.ts +113 -66
  314. package/types/ngstarter-ui-components-badge.d.ts +73 -37
  315. package/types/ngstarter-ui-components-block-loader.d.ts +32 -20
  316. package/types/ngstarter-ui-components-bottom-sheet.d.ts +125 -132
  317. package/types/ngstarter-ui-components-breadcrumbs.d.ts +93 -88
  318. package/types/ngstarter-ui-components-button-toggle.d.ts +124 -54
  319. package/types/ngstarter-ui-components-button.d.ts +69 -27
  320. package/types/ngstarter-ui-components-calendar.d.ts +123 -71
  321. package/types/ngstarter-ui-components-card-overlay.d.ts +31 -19
  322. package/types/ngstarter-ui-components-card.d.ts +75 -71
  323. package/types/ngstarter-ui-components-carousel.d.ts +115 -69
  324. package/types/ngstarter-ui-components-checkbox.d.ts +183 -86
  325. package/types/ngstarter-ui-components-chips.d.ts +288 -195
  326. package/types/ngstarter-ui-components-code-highlighter.d.ts +71 -28
  327. package/types/ngstarter-ui-components-color-picker.d.ts +140 -89
  328. package/types/ngstarter-ui-components-color-scheme.d.ts +43 -52
  329. package/types/ngstarter-ui-components-color-switcher.d.ts +46 -26
  330. package/types/ngstarter-ui-components-command-bar.d.ts +40 -26
  331. package/types/ngstarter-ui-components-comment-editor.d.ts +311 -235
  332. package/types/ngstarter-ui-components-comparison-slider.d.ts +41 -40
  333. package/types/ngstarter-ui-components-confirm.d.ts +24 -29
  334. package/types/ngstarter-ui-components-content-editor.d.ts +1482 -998
  335. package/types/ngstarter-ui-components-cookie-popup.d.ts +43 -38
  336. package/types/ngstarter-ui-components-core.d.ts +513 -467
  337. package/types/ngstarter-ui-components-country-select.d.ts +170 -97
  338. package/types/ngstarter-ui-components-crop.d.ts +67 -52
  339. package/types/ngstarter-ui-components-currency-select.d.ts +127 -90
  340. package/types/ngstarter-ui-components-data-view.d.ts +811 -567
  341. package/types/ngstarter-ui-components-date-format-select.d.ts +90 -58
  342. package/types/ngstarter-ui-components-datepicker.d.ts +589 -373
  343. package/types/ngstarter-ui-components-dialog.d.ts +138 -116
  344. package/types/ngstarter-ui-components-digit-roller.d.ts +228 -131
  345. package/types/ngstarter-ui-components-divider.d.ts +29 -17
  346. package/types/ngstarter-ui-components-drawer.d.ts +39 -30
  347. package/types/ngstarter-ui-components-emoji-picker.d.ts +69 -47
  348. package/types/ngstarter-ui-components-empty-state.d.ts +20 -28
  349. package/types/ngstarter-ui-components-events.d.ts +73 -57
  350. package/types/ngstarter-ui-components-expand.d.ts +55 -25
  351. package/types/ngstarter-ui-components-expansion.d.ts +93 -64
  352. package/types/ngstarter-ui-components-file-type.d.ts +53 -27
  353. package/types/ngstarter-ui-components-filter-builder.d.ts +131 -100
  354. package/types/ngstarter-ui-components-form-builder.d.ts +1094 -881
  355. package/types/ngstarter-ui-components-form-field.d.ts +116 -105
  356. package/types/ngstarter-ui-components-gauge.d.ts +32 -20
  357. package/types/ngstarter-ui-components-grid.d.ts +66 -50
  358. package/types/ngstarter-ui-components-guided-tour.d.ts +250 -222
  359. package/types/ngstarter-ui-components-headless-editor.d.ts +708 -658
  360. package/types/ngstarter-ui-components-headless-stepper.d.ts +84 -64
  361. package/types/ngstarter-ui-components-icon.d.ts +39 -38
  362. package/types/ngstarter-ui-components-image-designer.d.ts +422 -341
  363. package/types/ngstarter-ui-components-image-placeholder.d.ts +5 -8
  364. package/types/ngstarter-ui-components-image-resizer.d.ts +40 -33
  365. package/types/ngstarter-ui-components-image-viewer.d.ts +67 -54
  366. package/types/ngstarter-ui-components-image-zoom-viewer.d.ts +29 -33
  367. package/types/ngstarter-ui-components-incidents.d.ts +97 -104
  368. package/types/ngstarter-ui-components-inline-text-edit.d.ts +54 -39
  369. package/types/ngstarter-ui-components-input-mask.d.ts +54 -34
  370. package/types/ngstarter-ui-components-input-validator.d.ts +7 -11
  371. package/types/ngstarter-ui-components-input.d.ts +82 -54
  372. package/types/ngstarter-ui-components-kanban-board.d.ts +76 -63
  373. package/types/ngstarter-ui-components-kbd.d.ts +8 -12
  374. package/types/ngstarter-ui-components-layout.d.ts +131 -87
  375. package/types/ngstarter-ui-components-list.d.ts +123 -88
  376. package/types/ngstarter-ui-components-logo.d.ts +21 -21
  377. package/types/ngstarter-ui-components-marquee.d.ts +41 -34
  378. package/types/ngstarter-ui-components-menu.d.ts +329 -221
  379. package/types/ngstarter-ui-components-micro-chart.d.ts +385 -186
  380. package/types/ngstarter-ui-components-navigation.d.ts +186 -125
  381. package/types/ngstarter-ui-components-notifications.d.ts +104 -89
  382. package/types/ngstarter-ui-components-number-input.d.ts +138 -96
  383. package/types/ngstarter-ui-components-option.d.ts +102 -68
  384. package/types/ngstarter-ui-components-overlay.d.ts +7 -12
  385. package/types/ngstarter-ui-components-page-loading-bar.d.ts +23 -20
  386. package/types/ngstarter-ui-components-paginator.d.ts +171 -129
  387. package/types/ngstarter-ui-components-password-strength.d.ts +217 -102
  388. package/types/ngstarter-ui-components-pdf-builder.d.ts +717 -649
  389. package/types/ngstarter-ui-components-pdf-signer.d.ts +202 -142
  390. package/types/ngstarter-ui-components-pdf-viewer.d.ts +544 -385
  391. package/types/ngstarter-ui-components-phone-input.d.ts +175 -115
  392. package/types/ngstarter-ui-components-pin-input.d.ts +83 -45
  393. package/types/ngstarter-ui-components-popover.d.ts +128 -89
  394. package/types/ngstarter-ui-components-progress-bar.d.ts +49 -30
  395. package/types/ngstarter-ui-components-radio-card.d.ts +50 -34
  396. package/types/ngstarter-ui-components-radio.d.ts +100 -47
  397. package/types/ngstarter-ui-components-rail-nav.d.ts +36 -29
  398. package/types/ngstarter-ui-components-resizable-container.d.ts +30 -25
  399. package/types/ngstarter-ui-components-screen-loader.d.ts +38 -32
  400. package/types/ngstarter-ui-components-scroll-spy.d.ts +56 -60
  401. package/types/ngstarter-ui-components-scrollbar-area.d.ts +116 -86
  402. package/types/ngstarter-ui-components-segmented.d.ts +93 -61
  403. package/types/ngstarter-ui-components-select.d.ts +366 -266
  404. package/types/ngstarter-ui-components-side-panel.d.ts +59 -40
  405. package/types/ngstarter-ui-components-sidebar.d.ts +208 -154
  406. package/types/ngstarter-ui-components-sidenav.d.ts +136 -78
  407. package/types/ngstarter-ui-components-signature-pad.d.ts +165 -92
  408. package/types/ngstarter-ui-components-skeleton.d.ts +18 -17
  409. package/types/ngstarter-ui-components-slide-toggle.d.ts +113 -44
  410. package/types/ngstarter-ui-components-slider.d.ts +123 -82
  411. package/types/ngstarter-ui-components-snack-bar.d.ts +126 -134
  412. package/types/ngstarter-ui-components-sort.d.ts +99 -63
  413. package/types/ngstarter-ui-components-spinner.d.ts +49 -27
  414. package/types/ngstarter-ui-components-splash-screen.d.ts +34 -29
  415. package/types/ngstarter-ui-components-split.d.ts +276 -195
  416. package/types/ngstarter-ui-components-step-tracker.d.ts +102 -83
  417. package/types/ngstarter-ui-components-stepper.d.ts +57 -43
  418. package/types/ngstarter-ui-components-suggestions.d.ts +41 -28
  419. package/types/ngstarter-ui-components-tab-panel.d.ts +110 -83
  420. package/types/ngstarter-ui-components-table.d.ts +256 -228
  421. package/types/ngstarter-ui-components-tabs.d.ts +231 -138
  422. package/types/ngstarter-ui-components-thumbnail-maker.d.ts +40 -34
  423. package/types/ngstarter-ui-components-tiles.d.ts +166 -104
  424. package/types/ngstarter-ui-components-timeline.d.ts +45 -57
  425. package/types/ngstarter-ui-components-timepicker.d.ts +166 -111
  426. package/types/ngstarter-ui-components-timezone-select.d.ts +110 -70
  427. package/types/ngstarter-ui-components-toolbar.d.ts +89 -72
  428. package/types/ngstarter-ui-components-tooltip.d.ts +89 -52
  429. package/types/ngstarter-ui-components-tree-select.d.ts +182 -105
  430. package/types/ngstarter-ui-components-tree.d.ts +355 -229
  431. package/types/ngstarter-ui-components-upload.d.ts +216 -131
  432. package/types/ngstarter-ui-components-video-player.d.ts +130 -67
  433. package/types/ngstarter-ui-components-video-viewer.d.ts +140 -91
  434. package/types/ngstarter-ui-components-visual-builder.d.ts +5 -8
  435. package/types/ngstarter-ui-components-whiteboard.d.ts +412 -339
  436. package/types/ngstarter-ui-components.d.ts +2 -2
  437. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-BgKuFsDy.mjs +0 -35
  438. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-BgKuFsDy.mjs.map +0 -1
  439. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-CGTJefVK.mjs +0 -26
  440. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-CGTJefVK.mjs.map +0 -1
  441. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-B441NasU.mjs +0 -220
  442. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-B441NasU.mjs.map +0 -1
  443. package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs +0 -99
  444. package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs.map +0 -1
  445. package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs +0 -40
  446. package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map +0 -1
  447. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-Bo3irEeG.mjs +0 -375
  448. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-Bo3irEeG.mjs.map +0 -1
  449. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-Cbh0nblW.mjs +0 -80
  450. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-Cbh0nblW.mjs.map +0 -1
  451. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-BVQTRzaX.mjs +0 -65
  452. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-BVQTRzaX.mjs.map +0 -1
  453. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnbRqEWF.mjs +0 -137
  454. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnbRqEWF.mjs.map +0 -1
  455. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-Cv9-02mR.mjs +0 -113
  456. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-Cv9-02mR.mjs.map +0 -1
  457. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-yvSNKY0B.mjs +0 -188
  458. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-yvSNKY0B.mjs.map +0 -1
  459. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Clz9SzCR.mjs +0 -117
  460. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Clz9SzCR.mjs.map +0 -1
  461. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs +0 -4464
  462. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs.map +0 -1
  463. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CxDRklAS.mjs +0 -132
  464. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CxDRklAS.mjs.map +0 -1
  465. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BNgtiV7U.mjs +0 -171
  466. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BNgtiV7U.mjs.map +0 -1
  467. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs +0 -1653
  468. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs.map +0 -1
  469. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-Ch1kWIaX.mjs +0 -20
  470. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-Ch1kWIaX.mjs.map +0 -1
  471. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs +0 -19
  472. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs.map +0 -1
  473. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-laP7DTyq.mjs +0 -134
  474. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-laP7DTyq.mjs.map +0 -1
  475. package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs +0 -159
  476. package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs.map +0 -1
@@ -1,1649 +1,2167 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, PLATFORM_ID, ElementRef, input, Directive, booleanAttribute, output, DestroyRef, afterNextRender, numberAttribute, forwardRef, NgZone, model, effect, Pipe, Injectable, DOCUMENT, isDevMode, EventEmitter, signal, untracked } from '@angular/core';
3
- import { isPlatformBrowser, isPlatformServer } from '@angular/common';
4
- import { FocusMonitor, isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader, ActiveDescendantKeyManager, FocusKeyManager } from '@angular/cdk/a11y';
5
- import { fromEvent, filter, merge, debounceTime, Observable, Subscription } from 'rxjs';
6
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
8
- import { normalizePassiveListenerOptions, _getEventTarget, Platform } from '@angular/cdk/platform';
9
- import { coerceElement } from '@angular/cdk/coercion';
10
- import { DomSanitizer, Title, Meta } from '@angular/platform-browser';
11
- import { Router, NavigationEnd, TitleStrategy } from '@angular/router';
12
- import { signalStore, withState, withMethods, patchState } from '@ngrx/signals';
13
-
14
- const AUTOFOCUSABLE = new InjectionToken('AUTOFOCUSABLE');
15
-
16
- class AutoFocusDirective {
17
- platformId = inject(PLATFORM_ID);
18
- elementRef = inject(ElementRef);
19
- autofocusable = inject(AUTOFOCUSABLE, { optional: true });
20
- enabled = input(true, { ...(ngDevMode ? { debugName: "enabled" } : /* istanbul ignore next */ {}), alias: 'ngsAutoFocus' });
21
- ngOnChanges(changes) {
22
- if (changes['enabled'] && !changes['enabled'].firstChange) {
23
- this._focus();
24
- }
25
- }
26
- ngAfterViewInit() {
27
- this._focus();
28
- }
29
- _focus() {
30
- if (this.enabled() === false || this.enabled() === 'false') {
31
- return;
32
- }
33
- if (this.autofocusable) {
34
- this.autofocusable.focus();
35
- }
36
- else {
37
- this.elementRef.nativeElement.focus();
38
- }
39
- this._moveCursorToEnd(this.elementRef.nativeElement);
40
- }
41
- _moveCursorToEnd(el) {
42
- if (!isPlatformBrowser(this.platformId)) {
43
- return;
44
- }
45
- const range = document.createRange();
46
- const sel = window.getSelection();
47
- range.selectNodeContents(el);
48
- range.collapse(false);
49
- sel?.removeAllRanges();
50
- sel?.addRange(range);
51
- }
52
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: AutoFocusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
53
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: AutoFocusDirective, isStandalone: true, selector: "[ngsAutoFocus]", inputs: { enabled: { classPropertyName: "enabled", publicName: "ngsAutoFocus", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ngsAutoFocus"], usesOnChanges: true, ngImport: i0 });
54
- }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: AutoFocusDirective, decorators: [{
56
- type: Directive,
57
- args: [{
58
- selector: '[ngsAutoFocus]',
59
- exportAs: 'ngsAutoFocus',
60
- }]
61
- }], propDecorators: { enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngsAutoFocus", required: false }] }] } });
62
-
63
- class FocusElementDirective {
64
- _elementRef = inject(ElementRef);
65
- _focusMonitor = inject(FocusMonitor);
66
- checkChildren = input(true, { ...(ngDevMode ? { debugName: "checkChildren" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
67
- elementFocused = output();
68
- elementBlurred = output();
69
- ngAfterViewInit() {
70
- this._focusMonitor
71
- .monitor(this._elementRef.nativeElement, this.checkChildren())
72
- .subscribe(origin => {
73
- this._emitFocusEvent(origin);
74
- });
75
- }
76
- ngOnDestroy() {
77
- this._focusMonitor.stopMonitoring(this._elementRef.nativeElement);
78
- }
79
- _emitFocusEvent(origin) {
80
- if (origin) {
81
- this.elementFocused.emit();
82
- }
83
- else {
84
- this.elementBlurred.emit();
85
- }
86
- }
87
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: FocusElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
88
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: FocusElementDirective, isStandalone: true, selector: "[ngsFocusElement]", inputs: { checkChildren: { classPropertyName: "checkChildren", publicName: "checkChildren", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { elementFocused: "elementFocused", elementBlurred: "elementBlurred" }, exportAs: ["ngsFocusElement"], ngImport: i0 });
89
- }
90
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: FocusElementDirective, decorators: [{
91
- type: Directive,
92
- args: [{
93
- selector: '[ngsFocusElement]',
94
- exportAs: 'ngsFocusElement',
95
- }]
96
- }], propDecorators: { checkChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkChildren", required: false }] }], elementFocused: [{ type: i0.Output, args: ["elementFocused"] }], elementBlurred: [{ type: i0.Output, args: ["elementBlurred"] }] } });
97
-
98
- class SoundEffectDirective {
99
- soundSrc = input('assets/sound-effects/mouse-click.ogg', /* @ts-ignore */
100
- ...(ngDevMode ? [{ debugName: "soundSrc" }] : /* istanbul ignore next */ []));
101
- _elementRef = inject(ElementRef);
102
- _destroyRef = inject(DestroyRef);
103
- constructor() {
104
- afterNextRender(() => {
105
- this._init();
106
- });
107
- }
108
- _init() {
109
- const audio = new Audio(this.soundSrc());
110
- audio.volume = 0.15;
111
- fromEvent(this._elementRef.nativeElement, 'click')
112
- .pipe(takeUntilDestroyed(this._destroyRef))
113
- .subscribe(async (e) => {
114
- await audio.play();
115
- });
116
- }
117
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SoundEffectDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
118
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: SoundEffectDirective, isStandalone: true, selector: "[ngsSoundEffect]", inputs: { soundSrc: { classPropertyName: "soundSrc", publicName: "soundSrc", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
119
- }
120
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SoundEffectDirective, decorators: [{
121
- type: Directive,
122
- args: [{
123
- selector: '[ngsSoundEffect]',
124
- }]
125
- }], ctorParameters: () => [], propDecorators: { soundSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "soundSrc", required: false }] }] } });
126
-
127
- class DebounceTimeDirective {
128
- elementRef;
129
- renderer;
130
- debounceTimer;
131
- debounceTime = input(300, { ...(ngDevMode ? { debugName: "debounceTime" } : /* istanbul ignore next */ {}), transform: numberAttribute });
132
- onChange = () => { };
133
- onTouched = () => { };
134
- constructor(elementRef, renderer) {
135
- this.elementRef = elementRef;
136
- this.renderer = renderer;
137
- }
138
- writeValue(value) {
139
- this.renderer.setProperty(this.elementRef.nativeElement, 'value', value ?? '');
140
- }
141
- registerOnChange(fn) {
142
- this.onChange = fn;
143
- }
144
- registerOnTouched(fn) {
145
- this.onTouched = fn;
146
- }
147
- setDisabledState(isDisabled) {
148
- this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', isDisabled);
149
- }
150
- handleInput(event) {
151
- clearTimeout(this.debounceTimer);
152
- const target = event.target;
153
- const value = target?.value ?? '';
154
- if (!this.debounceTime()) {
155
- this.onChange(value);
156
- }
157
- else {
158
- this.debounceTimer = setTimeout(() => {
159
- this.onChange(value);
160
- }, this.debounceTime());
161
- }
162
- }
163
- handleBlur() {
164
- this.onTouched();
165
- }
166
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DebounceTimeDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
167
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: DebounceTimeDirective, isStandalone: true, selector: "[ngsDebounceTime][ngModel]", inputs: { debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "handleInput($event)", "blur": "handleBlur()" } }, providers: [
168
- {
169
- provide: NG_VALUE_ACCESSOR,
170
- useExisting: forwardRef(() => DebounceTimeDirective),
171
- multi: true,
172
- },
173
- ], ngImport: i0 });
1
+ import * as i0 from "@angular/core";
2
+ import { DOCUMENT, DestroyRef, Directive, ElementRef, EventEmitter, Injectable, InjectionToken, NgZone, PLATFORM_ID, Pipe, afterNextRender, booleanAttribute, effect, inject, input, isDevMode, model, numberAttribute, output, signal, untracked } from "@angular/core";
3
+ import { isPlatformBrowser, isPlatformServer } from "@angular/common";
4
+ import { patchState, signalStore, withMethods, withState } from "@ngrx/signals";
5
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
6
+ import { Observable, Subscription, debounceTime, filter, fromEvent, merge } from "rxjs";
7
+ import { NavigationEnd, Router, TitleStrategy } from "@angular/router";
8
+ import { NgControl } from "@angular/forms";
9
+ import { ActiveDescendantKeyManager, FocusKeyManager, FocusMonitor, isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader } from "@angular/cdk/a11y";
10
+ import { DomSanitizer, Meta, Title } from "@angular/platform-browser";
11
+ import { Platform, _getEventTarget, normalizePassiveListenerOptions } from "@angular/cdk/platform";
12
+ import { coerceElement } from "@angular/cdk/coercion";
13
+ const AUTOFOCUSABLE = new InjectionToken("AUTOFOCUSABLE");
14
+ var AutoFocusDirective = class AutoFocusDirective {
15
+ platformId = inject(PLATFORM_ID);
16
+ elementRef = inject(ElementRef);
17
+ autofocusable = inject(AUTOFOCUSABLE, { optional: true });
18
+ enabled = input(true, {
19
+ ...ngDevMode ? { debugName: "enabled" } : /* istanbul ignore next */ {},
20
+ alias: "ngsAutoFocus"
21
+ });
22
+ ngOnChanges(changes) {
23
+ if (changes["enabled"] && !changes["enabled"].firstChange) this._focus();
24
+ }
25
+ ngAfterViewInit() {
26
+ this._focus();
27
+ }
28
+ _focus() {
29
+ if (this.enabled() === false || this.enabled() === "false") return;
30
+ if (this.autofocusable) this.autofocusable.focus();
31
+ else this.elementRef.nativeElement.focus();
32
+ this._moveCursorToEnd(this.elementRef.nativeElement);
33
+ }
34
+ _moveCursorToEnd(el) {
35
+ if (!isPlatformBrowser(this.platformId)) return;
36
+ const range = document.createRange();
37
+ const sel = window.getSelection();
38
+ range.selectNodeContents(el);
39
+ range.collapse(false);
40
+ sel?.removeAllRanges();
41
+ sel?.addRange(range);
42
+ }
43
+ static ɵfac = i0.ɵɵngDeclareFactory({
44
+ minVersion: "12.0.0",
45
+ version: "22.3.0",
46
+ ngImport: i0,
47
+ type: AutoFocusDirective,
48
+ deps: [],
49
+ target: i0.ɵɵFactoryTarget.Directive
50
+ });
51
+ static ɵdir = i0.ɵɵngDeclareDirective({
52
+ minVersion: "17.1.0",
53
+ version: "22.3.0",
54
+ type: AutoFocusDirective,
55
+ isStandalone: true,
56
+ selector: "[ngsAutoFocus]",
57
+ inputs: { enabled: {
58
+ classPropertyName: "enabled",
59
+ publicName: "ngsAutoFocus",
60
+ isSignal: true,
61
+ isRequired: false,
62
+ transformFunction: null
63
+ } },
64
+ exportAs: ["ngsAutoFocus"],
65
+ usesOnChanges: true,
66
+ ngImport: i0
67
+ });
68
+ };
69
+ i0.ɵɵngDeclareClassMetadata({
70
+ minVersion: "12.0.0",
71
+ version: "22.3.0",
72
+ ngImport: i0,
73
+ type: AutoFocusDirective,
74
+ decorators: [{
75
+ type: Directive,
76
+ args: [{
77
+ selector: "[ngsAutoFocus]",
78
+ exportAs: "ngsAutoFocus"
79
+ }]
80
+ }],
81
+ propDecorators: { enabled: [{
82
+ type: i0.Input,
83
+ args: [{
84
+ isSignal: true,
85
+ alias: "ngsAutoFocus",
86
+ required: false
87
+ }]
88
+ }] }
89
+ });
90
+ var FocusElementDirective = class FocusElementDirective {
91
+ _elementRef = inject(ElementRef);
92
+ _focusMonitor = inject(FocusMonitor);
93
+ checkChildren = input(true, {
94
+ ...ngDevMode ? { debugName: "checkChildren" } : /* istanbul ignore next */ {},
95
+ transform: booleanAttribute
96
+ });
97
+ elementFocused = output();
98
+ elementBlurred = output();
99
+ ngAfterViewInit() {
100
+ this._focusMonitor.monitor(this._elementRef.nativeElement, this.checkChildren()).subscribe((origin) => {
101
+ this._emitFocusEvent(origin);
102
+ });
103
+ }
104
+ ngOnDestroy() {
105
+ this._focusMonitor.stopMonitoring(this._elementRef.nativeElement);
106
+ }
107
+ _emitFocusEvent(origin) {
108
+ if (origin) this.elementFocused.emit();
109
+ else this.elementBlurred.emit();
110
+ }
111
+ static ɵfac = i0.ɵɵngDeclareFactory({
112
+ minVersion: "12.0.0",
113
+ version: "22.3.0",
114
+ ngImport: i0,
115
+ type: FocusElementDirective,
116
+ deps: [],
117
+ target: i0.ɵɵFactoryTarget.Directive
118
+ });
119
+ static ɵdir = i0.ɵɵngDeclareDirective({
120
+ minVersion: "17.1.0",
121
+ version: "22.3.0",
122
+ type: FocusElementDirective,
123
+ isStandalone: true,
124
+ selector: "[ngsFocusElement]",
125
+ inputs: { checkChildren: {
126
+ classPropertyName: "checkChildren",
127
+ publicName: "checkChildren",
128
+ isSignal: true,
129
+ isRequired: false,
130
+ transformFunction: null
131
+ } },
132
+ outputs: {
133
+ elementFocused: "elementFocused",
134
+ elementBlurred: "elementBlurred"
135
+ },
136
+ exportAs: ["ngsFocusElement"],
137
+ ngImport: i0
138
+ });
139
+ };
140
+ i0.ɵɵngDeclareClassMetadata({
141
+ minVersion: "12.0.0",
142
+ version: "22.3.0",
143
+ ngImport: i0,
144
+ type: FocusElementDirective,
145
+ decorators: [{
146
+ type: Directive,
147
+ args: [{
148
+ selector: "[ngsFocusElement]",
149
+ exportAs: "ngsFocusElement"
150
+ }]
151
+ }],
152
+ propDecorators: {
153
+ checkChildren: [{
154
+ type: i0.Input,
155
+ args: [{
156
+ isSignal: true,
157
+ alias: "checkChildren",
158
+ required: false
159
+ }]
160
+ }],
161
+ elementFocused: [{
162
+ type: i0.Output,
163
+ args: ["elementFocused"]
164
+ }],
165
+ elementBlurred: [{
166
+ type: i0.Output,
167
+ args: ["elementBlurred"]
168
+ }]
169
+ }
170
+ });
171
+ var SoundEffectDirective = class SoundEffectDirective {
172
+ soundSrc = input("assets/sound-effects/mouse-click.ogg", ...ngDevMode ? [{ debugName: "soundSrc" }] : /* istanbul ignore next */ []);
173
+ _elementRef = inject(ElementRef);
174
+ _destroyRef = inject(DestroyRef);
175
+ constructor() {
176
+ afterNextRender(() => {
177
+ this._init();
178
+ });
179
+ }
180
+ _init() {
181
+ const audio = new Audio(this.soundSrc());
182
+ audio.volume = .15;
183
+ fromEvent(this._elementRef.nativeElement, "click").pipe(takeUntilDestroyed(this._destroyRef)).subscribe(async (e) => {
184
+ await audio.play();
185
+ });
186
+ }
187
+ static ɵfac = i0.ɵɵngDeclareFactory({
188
+ minVersion: "12.0.0",
189
+ version: "22.3.0",
190
+ ngImport: i0,
191
+ type: SoundEffectDirective,
192
+ deps: [],
193
+ target: i0.ɵɵFactoryTarget.Directive
194
+ });
195
+ static ɵdir = i0.ɵɵngDeclareDirective({
196
+ minVersion: "17.1.0",
197
+ version: "22.3.0",
198
+ type: SoundEffectDirective,
199
+ isStandalone: true,
200
+ selector: "[ngsSoundEffect]",
201
+ inputs: { soundSrc: {
202
+ classPropertyName: "soundSrc",
203
+ publicName: "soundSrc",
204
+ isSignal: true,
205
+ isRequired: false,
206
+ transformFunction: null
207
+ } },
208
+ ngImport: i0
209
+ });
210
+ };
211
+ i0.ɵɵngDeclareClassMetadata({
212
+ minVersion: "12.0.0",
213
+ version: "22.3.0",
214
+ ngImport: i0,
215
+ type: SoundEffectDirective,
216
+ decorators: [{
217
+ type: Directive,
218
+ args: [{ selector: "[ngsSoundEffect]" }]
219
+ }],
220
+ ctorParameters: () => [],
221
+ propDecorators: { soundSrc: [{
222
+ type: i0.Input,
223
+ args: [{
224
+ isSignal: true,
225
+ alias: "soundSrc",
226
+ required: false
227
+ }]
228
+ }] }
229
+ });
230
+ function connectLegacyNativeFormControl(value, touch, writeValue, setDisabledState) {
231
+ const control = inject(NgControl, {
232
+ self: true,
233
+ optional: true
234
+ });
235
+ if (!(control instanceof NgControl)) return;
236
+ let writing = false;
237
+ let change = () => {};
238
+ let touched = () => {};
239
+ value.subscribe((next) => {
240
+ if (!writing) change(next);
241
+ });
242
+ touch.subscribe(() => touched());
243
+ control.valueAccessor = {
244
+ writeValue(next) {
245
+ writing = true;
246
+ try {
247
+ writeValue(next);
248
+ } finally {
249
+ writing = false;
250
+ }
251
+ },
252
+ registerOnChange(fn) {
253
+ change = fn;
254
+ },
255
+ registerOnTouched(fn) {
256
+ touched = fn;
257
+ },
258
+ setDisabledState
259
+ };
174
260
  }
175
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DebounceTimeDirective, decorators: [{
176
- type: Directive,
177
- args: [{
178
- selector: '[ngsDebounceTime][ngModel]',
179
- providers: [
180
- {
181
- provide: NG_VALUE_ACCESSOR,
182
- useExisting: forwardRef(() => DebounceTimeDirective),
183
- multi: true,
184
- },
185
- ],
186
- host: {
187
- '(input)': 'handleInput($event)',
188
- '(blur)': 'handleBlur()'
189
- }
190
- }]
191
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { debounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceTime", required: false }] }] } });
192
-
193
- /** Possible states for a ripple element. */
261
+ var DebounceTimeDirective = class DebounceTimeDirective {
262
+ element = inject(ElementRef).nativeElement;
263
+ debounceTimer;
264
+ debounceTime = input(300, {
265
+ ...ngDevMode ? { debugName: "debounceTime" } : /* istanbul ignore next */ {},
266
+ transform: numberAttribute
267
+ });
268
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
269
+ touch = output();
270
+ constructor() {
271
+ connectLegacyNativeFormControl(this.value, this.touch, (value) => {
272
+ clearTimeout(this.debounceTimer);
273
+ this.element.value = value ?? "";
274
+ this.value.set(value);
275
+ }, (disabled) => {
276
+ this.element.disabled = disabled;
277
+ if (disabled) clearTimeout(this.debounceTimer);
278
+ });
279
+ inject(DestroyRef).onDestroy(() => clearTimeout(this.debounceTimer));
280
+ }
281
+ handleInput() {
282
+ clearTimeout(this.debounceTimer);
283
+ const value = this.element.value;
284
+ const delay = this.debounceTime();
285
+ if (delay) this.debounceTimer = setTimeout(() => this.value.set(value), delay);
286
+ else this.value.set(value);
287
+ }
288
+ static ɵfac = i0.ɵɵngDeclareFactory({
289
+ minVersion: "12.0.0",
290
+ version: "22.3.0",
291
+ ngImport: i0,
292
+ type: DebounceTimeDirective,
293
+ deps: [],
294
+ target: i0.ɵɵFactoryTarget.Directive
295
+ });
296
+ static ɵdir = i0.ɵɵngDeclareDirective({
297
+ minVersion: "17.1.0",
298
+ version: "22.3.0",
299
+ type: DebounceTimeDirective,
300
+ isStandalone: true,
301
+ selector: "input[ngsDebounceTime][ngModel], textarea[ngsDebounceTime][ngModel]",
302
+ inputs: {
303
+ debounceTime: {
304
+ classPropertyName: "debounceTime",
305
+ publicName: "debounceTime",
306
+ isSignal: true,
307
+ isRequired: false,
308
+ transformFunction: null
309
+ },
310
+ value: {
311
+ classPropertyName: "value",
312
+ publicName: "value",
313
+ isSignal: true,
314
+ isRequired: false,
315
+ transformFunction: null
316
+ }
317
+ },
318
+ outputs: {
319
+ value: "valueChange",
320
+ touch: "touch"
321
+ },
322
+ host: { listeners: {
323
+ "input": "handleInput()",
324
+ "blur": "touch.emit()"
325
+ } },
326
+ ngImport: i0
327
+ });
328
+ };
329
+ i0.ɵɵngDeclareClassMetadata({
330
+ minVersion: "12.0.0",
331
+ version: "22.3.0",
332
+ ngImport: i0,
333
+ type: DebounceTimeDirective,
334
+ decorators: [{
335
+ type: Directive,
336
+ args: [{
337
+ selector: "input[ngsDebounceTime][ngModel], textarea[ngsDebounceTime][ngModel]",
338
+ host: {
339
+ "(input)": "handleInput()",
340
+ "(blur)": "touch.emit()"
341
+ }
342
+ }]
343
+ }],
344
+ ctorParameters: () => [],
345
+ propDecorators: {
346
+ debounceTime: [{
347
+ type: i0.Input,
348
+ args: [{
349
+ isSignal: true,
350
+ alias: "debounceTime",
351
+ required: false
352
+ }]
353
+ }],
354
+ value: [{
355
+ type: i0.Input,
356
+ args: [{
357
+ isSignal: true,
358
+ alias: "value",
359
+ required: false
360
+ }]
361
+ }, {
362
+ type: i0.Output,
363
+ args: ["valueChange"]
364
+ }],
365
+ touch: [{
366
+ type: i0.Output,
367
+ args: ["touch"]
368
+ }]
369
+ }
370
+ });
194
371
  var RippleState;
195
- (function (RippleState) {
196
- RippleState[RippleState["FADING_IN"] = 0] = "FADING_IN";
197
- RippleState[RippleState["VISIBLE"] = 1] = "VISIBLE";
198
- RippleState[RippleState["FADING_OUT"] = 2] = "FADING_OUT";
199
- RippleState[RippleState["HIDDEN"] = 3] = "HIDDEN";
372
+ (function(RippleState) {
373
+ RippleState[RippleState["FADING_IN"] = 0] = "FADING_IN";
374
+ RippleState[RippleState["VISIBLE"] = 1] = "VISIBLE";
375
+ RippleState[RippleState["FADING_OUT"] = 2] = "FADING_OUT";
376
+ RippleState[RippleState["HIDDEN"] = 3] = "HIDDEN";
200
377
  })(RippleState || (RippleState = {}));
201
- /**
202
- * Reference to a previously launched ripple element.
203
- */
204
- class RippleRef {
205
- _renderer;
206
- element;
207
- config;
208
- _animationForciblyDisabledThroughCss;
209
- /** Current state of the ripple. */
210
- state = RippleState.HIDDEN;
211
- constructor(_renderer,
212
- /** Reference to the ripple HTML element. */
213
- element,
214
- /** Ripple configuration used for the ripple. */
215
- config,
216
- /* Whether animations are forcibly disabled for ripples through CSS. */
217
- _animationForciblyDisabledThroughCss = false) {
218
- this._renderer = _renderer;
219
- this.element = element;
220
- this.config = config;
221
- this._animationForciblyDisabledThroughCss = _animationForciblyDisabledThroughCss;
222
- }
223
- /** Fades out the ripple element. */
224
- fadeOut() {
225
- this._renderer.fadeOutRipple(this);
226
- }
227
- }
228
- /** Options used to bind a passive capturing event. */
378
+ var RippleRef = class {
379
+ _renderer;
380
+ element;
381
+ config;
382
+ _animationForciblyDisabledThroughCss;
383
+ state = RippleState.HIDDEN;
384
+ constructor(_renderer, element, config, _animationForciblyDisabledThroughCss = false) {
385
+ this._renderer = _renderer;
386
+ this.element = element;
387
+ this.config = config;
388
+ this._animationForciblyDisabledThroughCss = _animationForciblyDisabledThroughCss;
389
+ }
390
+ fadeOut() {
391
+ this._renderer.fadeOutRipple(this);
392
+ }
393
+ };
229
394
  const passiveCapturingEventOptions = normalizePassiveListenerOptions({
230
- passive: true,
231
- capture: true,
395
+ passive: true,
396
+ capture: true
232
397
  });
233
- /** Manages events through delegation so that as few event handlers as possible are bound. */
234
- class RippleEventManager {
235
- _events = new Map();
236
- /** Adds an event handler. */
237
- addHandler(ngZone, name, element, handler) {
238
- const handlersForEvent = this._events.get(name);
239
- if (handlersForEvent) {
240
- const handlersForElement = handlersForEvent.get(element);
241
- if (handlersForElement) {
242
- handlersForElement.add(handler);
243
- }
244
- else {
245
- handlersForEvent.set(element, new Set([handler]));
246
- }
247
- }
248
- else {
249
- this._events.set(name, new Map([[element, new Set([handler])]]));
250
- ngZone.runOutsideAngular(() => {
251
- document.addEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions);
252
- });
253
- }
254
- }
255
- /** Removes an event handler. */
256
- removeHandler(name, element, handler) {
257
- const handlersForEvent = this._events.get(name);
258
- if (!handlersForEvent) {
259
- return;
260
- }
261
- const handlersForElement = handlersForEvent.get(element);
262
- if (!handlersForElement) {
263
- return;
264
- }
265
- handlersForElement.delete(handler);
266
- if (handlersForElement.size === 0) {
267
- handlersForEvent.delete(element);
268
- }
269
- if (handlersForEvent.size === 0) {
270
- this._events.delete(name);
271
- document.removeEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions);
272
- }
273
- }
274
- /** Event handler that is bound and which dispatches the events to the different targets. */
275
- _delegateEventHandler = (event) => {
276
- const target = _getEventTarget(event);
277
- if (target) {
278
- this._events.get(event.type)?.forEach((handlers, element) => {
279
- if (element === target || element.contains(target)) {
280
- handlers.forEach(handler => handler.handleEvent(event));
281
- }
282
- });
283
- }
284
- };
285
- }
286
- /**
287
- * Default ripple animation configuration for ripples without an explicit
288
- * animation config specified.
289
- */
398
+ var RippleEventManager = class {
399
+ _events = /* @__PURE__ */ new Map();
400
+ addHandler(ngZone, name, element, handler) {
401
+ const handlersForEvent = this._events.get(name);
402
+ if (handlersForEvent) {
403
+ const handlersForElement = handlersForEvent.get(element);
404
+ if (handlersForElement) handlersForElement.add(handler);
405
+ else handlersForEvent.set(element, /* @__PURE__ */ new Set([handler]));
406
+ } else {
407
+ this._events.set(name, /* @__PURE__ */ new Map([[element, /* @__PURE__ */ new Set([handler])]]));
408
+ ngZone.runOutsideAngular(() => {
409
+ document.addEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions);
410
+ });
411
+ }
412
+ }
413
+ removeHandler(name, element, handler) {
414
+ const handlersForEvent = this._events.get(name);
415
+ if (!handlersForEvent) return;
416
+ const handlersForElement = handlersForEvent.get(element);
417
+ if (!handlersForElement) return;
418
+ handlersForElement.delete(handler);
419
+ if (handlersForElement.size === 0) handlersForEvent.delete(element);
420
+ if (handlersForEvent.size === 0) {
421
+ this._events.delete(name);
422
+ document.removeEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions);
423
+ }
424
+ }
425
+ _delegateEventHandler = (event) => {
426
+ const target = _getEventTarget(event);
427
+ if (target) this._events.get(event.type)?.forEach((handlers, element) => {
428
+ if (element === target || element.contains(target)) handlers.forEach((handler) => handler.handleEvent(event));
429
+ });
430
+ };
431
+ };
290
432
  const defaultRippleAnimationConfig = {
291
- enterDuration: 225,
292
- exitDuration: 150,
433
+ enterDuration: 225,
434
+ exitDuration: 150
293
435
  };
294
- /**
295
- * Timeout for ignoring mouse events. Mouse events will be temporary ignored after touch
296
- * events to avoid synthetic mouse events.
297
- */
298
436
  const ignoreMouseEventsTimeout = 800;
299
- /** Events that signal that the pointer is down. */
300
- const pointerDownEvents = ['mousedown', 'touchstart'];
301
- /** Events that signal that the pointer is up. */
302
- const pointerUpEvents = ['mouseup', 'mouseleave', 'touchend', 'touchcancel'];
303
- /**
304
- * Helper service that performs DOM manipulations. Not intended to be used outside this module.
305
- */
306
- class RippleRenderer {
307
- _target;
308
- _ngZone;
309
- _platform;
310
- /** Element where the ripples are being added to. */
311
- _containerElement;
312
- /** Element which triggers the ripple elements on mouse events. */
313
- _triggerElement = null;
314
- /** Whether the pointer is currently down or not. */
315
- _isPointerDown = false;
316
- /** Map of currently active ripple references. */
317
- _activeRipples = new Map();
318
- /** Latest non-persistent ripple that was triggered. */
319
- _mostRecentTransientRipple = null;
320
- /** Time in milliseconds when the last touchstart event happened. */
321
- _lastTouchStartEvent = null;
322
- /** Whether pointer-up event listeners have been registered. */
323
- _pointerUpEventsRegistered = false;
324
- /** Cached dimensions of the ripple container. */
325
- _containerRect = null;
326
- static _eventManager = new RippleEventManager();
327
- constructor(_target, _ngZone, elementOrElementRef, _platform) {
328
- this._target = _target;
329
- this._ngZone = _ngZone;
330
- this._platform = _platform;
331
- // Only do anything if we're on the browser.
332
- if (_platform.isBrowser) {
333
- this._containerElement = coerceElement(elementOrElementRef);
334
- }
335
- }
336
- /** Fades in a ripple at the given coordinates. */
337
- fadeInRipple(x, y, config = {}) {
338
- const containerRect = (this._containerRect =
339
- this._containerRect || this._containerElement.getBoundingClientRect());
340
- const animationConfig = { ...defaultRippleAnimationConfig, ...config.animation };
341
- if (config.centered) {
342
- x = containerRect.left + containerRect.width / 2;
343
- y = containerRect.top + containerRect.height / 2;
344
- }
345
- const radius = config.radius || distanceToFurthestCorner(x, y, containerRect);
346
- const offsetX = x - containerRect.left;
347
- const offsetY = y - containerRect.top;
348
- const enterDuration = animationConfig.enterDuration;
349
- const ripple = document.createElement('div');
350
- ripple.classList.add('ngs-ripple-element');
351
- ripple.style.left = `${offsetX - radius}px`;
352
- ripple.style.top = `${offsetY - radius}px`;
353
- ripple.style.height = `${radius * 2}px`;
354
- ripple.style.width = `${radius * 2}px`;
355
- if (config.color != null) {
356
- ripple.style.backgroundColor = config.color;
357
- }
358
- ripple.style.transitionDuration = `${enterDuration}ms`;
359
- this._containerElement.appendChild(ripple);
360
- const computedStyles = window.getComputedStyle(ripple);
361
- const userTransitionProperty = computedStyles.transitionProperty;
362
- const userTransitionDuration = computedStyles.transitionDuration;
363
- const animationForciblyDisabledThroughCss = userTransitionProperty === 'none' ||
364
- userTransitionDuration === '0s' ||
365
- userTransitionDuration === '0s, 0s' ||
366
- (containerRect.width === 0 && containerRect.height === 0);
367
- const rippleRef = new RippleRef(this, ripple, config, animationForciblyDisabledThroughCss);
368
- ripple.style.transform = 'scale3d(1, 1, 1)';
369
- rippleRef.state = RippleState.FADING_IN;
370
- if (!config.persistent) {
371
- this._mostRecentTransientRipple = rippleRef;
372
- }
373
- let eventListeners = null;
374
- if (!animationForciblyDisabledThroughCss && (enterDuration || animationConfig.exitDuration)) {
375
- this._ngZone.runOutsideAngular(() => {
376
- const onTransitionEnd = () => {
377
- if (eventListeners) {
378
- eventListeners.fallbackTimer = null;
379
- }
380
- clearTimeout(fallbackTimer);
381
- this._finishRippleTransition(rippleRef);
382
- };
383
- const onTransitionCancel = () => this._destroyRipple(rippleRef);
384
- const fallbackTimer = setTimeout(onTransitionCancel, (enterDuration || 0) + 100);
385
- ripple.addEventListener('transitionend', onTransitionEnd);
386
- ripple.addEventListener('transitioncancel', onTransitionCancel);
387
- eventListeners = { onTransitionEnd, onTransitionCancel, fallbackTimer };
388
- });
389
- }
390
- this._activeRipples.set(rippleRef, eventListeners);
391
- if (animationForciblyDisabledThroughCss || !enterDuration) {
392
- this._finishRippleTransition(rippleRef);
393
- }
394
- return rippleRef;
395
- }
396
- /** Fades out a ripple reference. */
397
- fadeOutRipple(rippleRef) {
398
- if (rippleRef.state === RippleState.FADING_OUT || rippleRef.state === RippleState.HIDDEN) {
399
- return;
400
- }
401
- const rippleEl = rippleRef.element;
402
- const animationConfig = { ...defaultRippleAnimationConfig, ...rippleRef.config.animation };
403
- rippleEl.style.transitionDuration = `${animationConfig.exitDuration}ms`;
404
- rippleEl.style.opacity = '0';
405
- rippleRef.state = RippleState.FADING_OUT;
406
- if (rippleRef._animationForciblyDisabledThroughCss || !animationConfig.exitDuration) {
407
- this._finishRippleTransition(rippleRef);
408
- }
409
- }
410
- /** Fades out all currently active ripples. */
411
- fadeOutAll() {
412
- this._getActiveRipples().forEach(ripple => ripple.fadeOut());
413
- }
414
- /** Fades out all currently showing non-persistent ripples. */
415
- fadeOutAllNonPersistent() {
416
- this._getActiveRipples().forEach(ripple => {
417
- if (!ripple.config.persistent) {
418
- ripple.fadeOut();
419
- }
420
- });
421
- }
422
- /** Sets up the trigger event listeners */
423
- setupTriggerEvents(elementOrElementRef) {
424
- const element = coerceElement(elementOrElementRef);
425
- if (!this._platform.isBrowser || !element || element === this._triggerElement) {
426
- return;
427
- }
428
- this._removeTriggerEvents();
429
- this._triggerElement = element;
430
- pointerDownEvents.forEach(type => {
431
- RippleRenderer._eventManager.addHandler(this._ngZone, type, element, this);
432
- });
433
- }
434
- /** Handles all registered events. */
435
- handleEvent(event) {
436
- if (event.type === 'mousedown') {
437
- this._onMousedown(event);
438
- }
439
- else if (event.type === 'touchstart') {
440
- this._onTouchStart(event);
441
- }
442
- else {
443
- this._onPointerUp();
444
- }
445
- if (!this._pointerUpEventsRegistered && this._triggerElement) {
446
- this._ngZone.runOutsideAngular(() => {
447
- pointerUpEvents.forEach(type => {
448
- this._triggerElement.addEventListener(type, this, passiveCapturingEventOptions);
449
- });
450
- });
451
- this._pointerUpEventsRegistered = true;
452
- }
453
- }
454
- /** Method that will be called if the fade-in or fade-in transition completed. */
455
- _finishRippleTransition(rippleRef) {
456
- if (rippleRef.state === RippleState.FADING_IN) {
457
- this._startFadeOutTransition(rippleRef);
458
- }
459
- else if (rippleRef.state === RippleState.FADING_OUT) {
460
- this._destroyRipple(rippleRef);
461
- }
462
- }
463
- /** Starts the fade-out transition of the given ripple. */
464
- _startFadeOutTransition(rippleRef) {
465
- const isMostRecentTransientRipple = rippleRef === this._mostRecentTransientRipple;
466
- const { persistent } = rippleRef.config;
467
- rippleRef.state = RippleState.VISIBLE;
468
- if (!persistent && (!isMostRecentTransientRipple || !this._isPointerDown)) {
469
- rippleRef.fadeOut();
470
- }
471
- }
472
- /** Destroys the given ripple. */
473
- _destroyRipple(rippleRef) {
474
- const eventListeners = this._activeRipples.get(rippleRef) ?? null;
475
- this._activeRipples.delete(rippleRef);
476
- if (!this._activeRipples.size) {
477
- this._containerRect = null;
478
- }
479
- if (rippleRef === this._mostRecentTransientRipple) {
480
- this._mostRecentTransientRipple = null;
481
- }
482
- rippleRef.state = RippleState.HIDDEN;
483
- if (eventListeners !== null) {
484
- rippleRef.element.removeEventListener('transitionend', eventListeners.onTransitionEnd);
485
- rippleRef.element.removeEventListener('transitioncancel', eventListeners.onTransitionCancel);
486
- if (eventListeners.fallbackTimer !== null) {
487
- clearTimeout(eventListeners.fallbackTimer);
488
- }
489
- }
490
- rippleRef.element.remove();
491
- }
492
- /** Function being called whenever the trigger is being pressed using mouse. */
493
- _onMousedown(event) {
494
- const isFakeMousedown = isFakeMousedownFromScreenReader(event);
495
- const isSyntheticEvent = this._lastTouchStartEvent && Date.now() < this._lastTouchStartEvent + ignoreMouseEventsTimeout;
496
- if (!this._target.rippleDisabled && !isFakeMousedown && !isSyntheticEvent) {
497
- this._isPointerDown = true;
498
- this.fadeInRipple(event.clientX, event.clientY, this._target.rippleConfig);
499
- }
500
- }
501
- /** Function being called whenever the trigger is being pressed using touch. */
502
- _onTouchStart(event) {
503
- if (!this._target.rippleDisabled && !isFakeTouchstartFromScreenReader(event)) {
504
- this._lastTouchStartEvent = Date.now();
505
- this._isPointerDown = true;
506
- const touches = event.changedTouches;
507
- if (touches) {
508
- for (let i = 0; i < touches.length; i++) {
509
- this.fadeInRipple(touches[i].clientX, touches[i].clientY, this._target.rippleConfig);
510
- }
511
- }
512
- }
513
- }
514
- /** Function being called whenever the trigger is being released. */
515
- _onPointerUp() {
516
- if (!this._isPointerDown) {
517
- return;
518
- }
519
- this._isPointerDown = false;
520
- this._getActiveRipples().forEach(ripple => {
521
- const isVisible = ripple.state === RippleState.VISIBLE ||
522
- (ripple.config.terminateOnPointerUp && ripple.state === RippleState.FADING_IN);
523
- if (!ripple.config.persistent && isVisible) {
524
- ripple.fadeOut();
525
- }
526
- });
527
- }
528
- _getActiveRipples() {
529
- return Array.from(this._activeRipples.keys());
530
- }
531
- /** Removes previously registered event listeners from the trigger element. */
532
- _removeTriggerEvents() {
533
- const trigger = this._triggerElement;
534
- if (trigger) {
535
- pointerDownEvents.forEach(type => RippleRenderer._eventManager.removeHandler(type, trigger, this));
536
- if (this._pointerUpEventsRegistered) {
537
- pointerUpEvents.forEach(type => trigger.removeEventListener(type, this, passiveCapturingEventOptions));
538
- this._pointerUpEventsRegistered = false;
539
- }
540
- }
541
- }
542
- }
543
- /** Returns the distance from the point (x, y) to the furthest corner of a rectangle. */
437
+ const pointerDownEvents = ["mousedown", "touchstart"];
438
+ const pointerUpEvents = [
439
+ "mouseup",
440
+ "mouseleave",
441
+ "touchend",
442
+ "touchcancel"
443
+ ];
444
+ var RippleRenderer = class RippleRenderer {
445
+ _target;
446
+ _ngZone;
447
+ _platform;
448
+ _containerElement;
449
+ _triggerElement = null;
450
+ _isPointerDown = false;
451
+ _activeRipples = /* @__PURE__ */ new Map();
452
+ _mostRecentTransientRipple = null;
453
+ _lastTouchStartEvent = null;
454
+ _pointerUpEventsRegistered = false;
455
+ _containerRect = null;
456
+ static _eventManager = new RippleEventManager();
457
+ constructor(_target, _ngZone, elementOrElementRef, _platform) {
458
+ this._target = _target;
459
+ this._ngZone = _ngZone;
460
+ this._platform = _platform;
461
+ if (_platform.isBrowser) this._containerElement = coerceElement(elementOrElementRef);
462
+ }
463
+ fadeInRipple(x, y, config = {}) {
464
+ const containerRect = this._containerRect = this._containerRect || this._containerElement.getBoundingClientRect();
465
+ const animationConfig = {
466
+ ...defaultRippleAnimationConfig,
467
+ ...config.animation
468
+ };
469
+ if (config.centered) {
470
+ x = containerRect.left + containerRect.width / 2;
471
+ y = containerRect.top + containerRect.height / 2;
472
+ }
473
+ const radius = config.radius || distanceToFurthestCorner(x, y, containerRect);
474
+ const offsetX = x - containerRect.left;
475
+ const offsetY = y - containerRect.top;
476
+ const enterDuration = animationConfig.enterDuration;
477
+ const ripple = document.createElement("div");
478
+ ripple.classList.add("ngs-ripple-element");
479
+ ripple.style.left = `${offsetX - radius}px`;
480
+ ripple.style.top = `${offsetY - radius}px`;
481
+ ripple.style.height = `${radius * 2}px`;
482
+ ripple.style.width = `${radius * 2}px`;
483
+ if (config.color != null) ripple.style.backgroundColor = config.color;
484
+ ripple.style.transitionDuration = `${enterDuration}ms`;
485
+ this._containerElement.appendChild(ripple);
486
+ const computedStyles = window.getComputedStyle(ripple);
487
+ const userTransitionProperty = computedStyles.transitionProperty;
488
+ const userTransitionDuration = computedStyles.transitionDuration;
489
+ const animationForciblyDisabledThroughCss = userTransitionProperty === "none" || userTransitionDuration === "0s" || userTransitionDuration === "0s, 0s" || containerRect.width === 0 && containerRect.height === 0;
490
+ const rippleRef = new RippleRef(this, ripple, config, animationForciblyDisabledThroughCss);
491
+ ripple.style.transform = "scale3d(1, 1, 1)";
492
+ rippleRef.state = RippleState.FADING_IN;
493
+ if (!config.persistent) this._mostRecentTransientRipple = rippleRef;
494
+ let eventListeners = null;
495
+ if (!animationForciblyDisabledThroughCss && (enterDuration || animationConfig.exitDuration)) this._ngZone.runOutsideAngular(() => {
496
+ const onTransitionEnd = () => {
497
+ if (eventListeners) eventListeners.fallbackTimer = null;
498
+ clearTimeout(fallbackTimer);
499
+ this._finishRippleTransition(rippleRef);
500
+ };
501
+ const onTransitionCancel = () => this._destroyRipple(rippleRef);
502
+ const fallbackTimer = setTimeout(onTransitionCancel, (enterDuration || 0) + 100);
503
+ ripple.addEventListener("transitionend", onTransitionEnd);
504
+ ripple.addEventListener("transitioncancel", onTransitionCancel);
505
+ eventListeners = {
506
+ onTransitionEnd,
507
+ onTransitionCancel,
508
+ fallbackTimer
509
+ };
510
+ });
511
+ this._activeRipples.set(rippleRef, eventListeners);
512
+ if (animationForciblyDisabledThroughCss || !enterDuration) this._finishRippleTransition(rippleRef);
513
+ return rippleRef;
514
+ }
515
+ fadeOutRipple(rippleRef) {
516
+ if (rippleRef.state === RippleState.FADING_OUT || rippleRef.state === RippleState.HIDDEN) return;
517
+ const rippleEl = rippleRef.element;
518
+ const animationConfig = {
519
+ ...defaultRippleAnimationConfig,
520
+ ...rippleRef.config.animation
521
+ };
522
+ rippleEl.style.transitionDuration = `${animationConfig.exitDuration}ms`;
523
+ rippleEl.style.opacity = "0";
524
+ rippleRef.state = RippleState.FADING_OUT;
525
+ if (rippleRef._animationForciblyDisabledThroughCss || !animationConfig.exitDuration) this._finishRippleTransition(rippleRef);
526
+ }
527
+ fadeOutAll() {
528
+ this._getActiveRipples().forEach((ripple) => ripple.fadeOut());
529
+ }
530
+ fadeOutAllNonPersistent() {
531
+ this._getActiveRipples().forEach((ripple) => {
532
+ if (!ripple.config.persistent) ripple.fadeOut();
533
+ });
534
+ }
535
+ setupTriggerEvents(elementOrElementRef) {
536
+ const element = coerceElement(elementOrElementRef);
537
+ if (!this._platform.isBrowser || !element || element === this._triggerElement) return;
538
+ this._removeTriggerEvents();
539
+ this._triggerElement = element;
540
+ pointerDownEvents.forEach((type) => {
541
+ RippleRenderer._eventManager.addHandler(this._ngZone, type, element, this);
542
+ });
543
+ }
544
+ handleEvent(event) {
545
+ if (event.type === "mousedown") this._onMousedown(event);
546
+ else if (event.type === "touchstart") this._onTouchStart(event);
547
+ else this._onPointerUp();
548
+ if (!this._pointerUpEventsRegistered && this._triggerElement) {
549
+ this._ngZone.runOutsideAngular(() => {
550
+ pointerUpEvents.forEach((type) => {
551
+ this._triggerElement.addEventListener(type, this, passiveCapturingEventOptions);
552
+ });
553
+ });
554
+ this._pointerUpEventsRegistered = true;
555
+ }
556
+ }
557
+ _finishRippleTransition(rippleRef) {
558
+ if (rippleRef.state === RippleState.FADING_IN) this._startFadeOutTransition(rippleRef);
559
+ else if (rippleRef.state === RippleState.FADING_OUT) this._destroyRipple(rippleRef);
560
+ }
561
+ _startFadeOutTransition(rippleRef) {
562
+ const isMostRecentTransientRipple = rippleRef === this._mostRecentTransientRipple;
563
+ const { persistent } = rippleRef.config;
564
+ rippleRef.state = RippleState.VISIBLE;
565
+ if (!persistent && (!isMostRecentTransientRipple || !this._isPointerDown)) rippleRef.fadeOut();
566
+ }
567
+ _destroyRipple(rippleRef) {
568
+ const eventListeners = this._activeRipples.get(rippleRef) ?? null;
569
+ this._activeRipples.delete(rippleRef);
570
+ if (!this._activeRipples.size) this._containerRect = null;
571
+ if (rippleRef === this._mostRecentTransientRipple) this._mostRecentTransientRipple = null;
572
+ rippleRef.state = RippleState.HIDDEN;
573
+ if (eventListeners !== null) {
574
+ rippleRef.element.removeEventListener("transitionend", eventListeners.onTransitionEnd);
575
+ rippleRef.element.removeEventListener("transitioncancel", eventListeners.onTransitionCancel);
576
+ if (eventListeners.fallbackTimer !== null) clearTimeout(eventListeners.fallbackTimer);
577
+ }
578
+ rippleRef.element.remove();
579
+ }
580
+ _onMousedown(event) {
581
+ const isFakeMousedown = isFakeMousedownFromScreenReader(event);
582
+ const isSyntheticEvent = this._lastTouchStartEvent && Date.now() < this._lastTouchStartEvent + ignoreMouseEventsTimeout;
583
+ if (!this._target.rippleDisabled && !isFakeMousedown && !isSyntheticEvent) {
584
+ this._isPointerDown = true;
585
+ this.fadeInRipple(event.clientX, event.clientY, this._target.rippleConfig);
586
+ }
587
+ }
588
+ _onTouchStart(event) {
589
+ if (!this._target.rippleDisabled && !isFakeTouchstartFromScreenReader(event)) {
590
+ this._lastTouchStartEvent = Date.now();
591
+ this._isPointerDown = true;
592
+ const touches = event.changedTouches;
593
+ if (touches) for (let i = 0; i < touches.length; i++) this.fadeInRipple(touches[i].clientX, touches[i].clientY, this._target.rippleConfig);
594
+ }
595
+ }
596
+ _onPointerUp() {
597
+ if (!this._isPointerDown) return;
598
+ this._isPointerDown = false;
599
+ this._getActiveRipples().forEach((ripple) => {
600
+ const isVisible = ripple.state === RippleState.VISIBLE || ripple.config.terminateOnPointerUp && ripple.state === RippleState.FADING_IN;
601
+ if (!ripple.config.persistent && isVisible) ripple.fadeOut();
602
+ });
603
+ }
604
+ _getActiveRipples() {
605
+ return Array.from(this._activeRipples.keys());
606
+ }
607
+ _removeTriggerEvents() {
608
+ const trigger = this._triggerElement;
609
+ if (trigger) {
610
+ pointerDownEvents.forEach((type) => RippleRenderer._eventManager.removeHandler(type, trigger, this));
611
+ if (this._pointerUpEventsRegistered) {
612
+ pointerUpEvents.forEach((type) => trigger.removeEventListener(type, this, passiveCapturingEventOptions));
613
+ this._pointerUpEventsRegistered = false;
614
+ }
615
+ }
616
+ }
617
+ };
544
618
  function distanceToFurthestCorner(x, y, rect) {
545
- const distX = Math.max(Math.abs(x - rect.left), Math.abs(x - rect.right));
546
- const distY = Math.max(Math.abs(y - rect.top), Math.abs(y - rect.bottom));
547
- return Math.sqrt(distX * distX + distY * distY);
619
+ const distX = Math.max(Math.abs(x - rect.left), Math.abs(x - rect.right));
620
+ const distY = Math.max(Math.abs(y - rect.top), Math.abs(y - rect.bottom));
621
+ return Math.sqrt(distX * distX + distY * distY);
548
622
  }
549
- const RIPPLE_GLOBAL_OPTIONS = new InjectionToken('ngs-ripple-global-options');
550
- class Ripple {
551
- _elementRef = inject(ElementRef);
552
- _ngZone = inject(NgZone);
553
- _platform = inject(Platform);
554
- _globalOptions = inject(RIPPLE_GLOBAL_OPTIONS, { optional: true }) || {};
555
- color = input(undefined, { ...(ngDevMode ? { debugName: "color" } : /* istanbul ignore next */ {}), alias: 'ngsRippleColor' });
556
- unbounded = input(false, { ...(ngDevMode ? { debugName: "unbounded" } : /* istanbul ignore next */ {}), alias: 'ngsRippleUnbounded', transform: booleanAttribute });
557
- centered = model(false, { ...(ngDevMode ? { debugName: "centered" } : /* istanbul ignore next */ {}), alias: 'ngsRippleCentered' });
558
- radius = input(0, { ...(ngDevMode ? { debugName: "radius" } : /* istanbul ignore next */ {}), alias: 'ngsRippleRadius', transform: numberAttribute });
559
- animation = input(undefined, { ...(ngDevMode ? { debugName: "animation" } : /* istanbul ignore next */ {}), alias: 'ngsRippleAnimation' });
560
- disabled = model(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), alias: 'ngsRippleDisabled' });
561
- trigger = model(undefined, { ...(ngDevMode ? { debugName: "trigger" } : /* istanbul ignore next */ {}), alias: 'ngsRippleTrigger' });
562
- _rippleRenderer;
563
- _isInitialized = false;
564
- constructor() {
565
- this._rippleRenderer = new RippleRenderer(this, this._ngZone, this._elementRef, this._platform);
566
- effect(() => {
567
- if (this.disabled()) {
568
- this.fadeOutAllNonPersistent();
569
- }
570
- this._setupTriggerEventsIfEnabled();
571
- });
572
- effect(() => {
573
- this.trigger();
574
- this._setupTriggerEventsIfEnabled();
575
- });
576
- }
577
- ngOnInit() {
578
- this._isInitialized = true;
579
- this._setupTriggerEventsIfEnabled();
580
- }
581
- ngOnDestroy() {
582
- this._rippleRenderer._removeTriggerEvents();
583
- }
584
- /** Fades out all currently showing ripple elements. */
585
- fadeOutAll() {
586
- this._rippleRenderer.fadeOutAll();
587
- }
588
- /** Fades out all currently showing non-persistent ripple elements. */
589
- fadeOutAllNonPersistent() {
590
- this._rippleRenderer.fadeOutAllNonPersistent();
591
- }
592
- get rippleConfig() {
593
- return {
594
- centered: this.centered(),
595
- radius: this.radius(),
596
- color: this.color(),
597
- animation: {
598
- ...this._globalOptions.animation,
599
- ...this.animation(),
600
- },
601
- terminateOnPointerUp: this._globalOptions.terminateOnPointerUp,
602
- };
603
- }
604
- get rippleDisabled() {
605
- return this.disabled() || !!this._globalOptions.disabled;
606
- }
607
- _setupTriggerEventsIfEnabled() {
608
- if (!this.disabled() && this._isInitialized) {
609
- this._rippleRenderer.setupTriggerEvents(this.trigger() || this._elementRef.nativeElement);
610
- }
611
- }
612
- /** Launches a manual ripple at the specified coordinates or just by the ripple config. */
613
- launch(configOrX, y = 0, config) {
614
- if (typeof configOrX === 'number') {
615
- return this._rippleRenderer.fadeInRipple(configOrX, y, { ...this.rippleConfig, ...config });
616
- }
617
- else {
618
- return this._rippleRenderer.fadeInRipple(0, 0, { ...this.rippleConfig, ...configOrX });
619
- }
620
- }
621
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Ripple, deps: [], target: i0.ɵɵFactoryTarget.Directive });
622
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: Ripple, isStandalone: true, selector: "[ngsRipple]", inputs: { color: { classPropertyName: "color", publicName: "ngsRippleColor", isSignal: true, isRequired: false, transformFunction: null }, unbounded: { classPropertyName: "unbounded", publicName: "ngsRippleUnbounded", isSignal: true, isRequired: false, transformFunction: null }, centered: { classPropertyName: "centered", publicName: "ngsRippleCentered", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "ngsRippleRadius", isSignal: true, isRequired: false, transformFunction: null }, animation: { classPropertyName: "animation", publicName: "ngsRippleAnimation", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngsRippleDisabled", isSignal: true, isRequired: false, transformFunction: null }, trigger: { classPropertyName: "trigger", publicName: "ngsRippleTrigger", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { centered: "ngsRippleCenteredChange", disabled: "ngsRippleDisabledChange", trigger: "ngsRippleTriggerChange" }, host: { properties: { "class.ngs-ripple-unbounded": "unbounded()" }, classAttribute: "ngs-ripple" }, exportAs: ["ngsRipple"], ngImport: i0 });
623
- }
624
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Ripple, decorators: [{
625
- type: Directive,
626
- args: [{
627
- selector: '[ngsRipple]',
628
- exportAs: 'ngsRipple',
629
- host: {
630
- 'class': 'ngs-ripple',
631
- '[class.ngs-ripple-unbounded]': 'unbounded()',
632
- },
633
- }]
634
- }], ctorParameters: () => [], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngsRippleColor", required: false }] }], unbounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngsRippleUnbounded", required: false }] }], centered: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngsRippleCentered", required: false }] }, { type: i0.Output, args: ["ngsRippleCenteredChange"] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngsRippleRadius", required: false }] }], animation: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngsRippleAnimation", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngsRippleDisabled", required: false }] }, { type: i0.Output, args: ["ngsRippleDisabledChange"] }], trigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngsRippleTrigger", required: false }] }, { type: i0.Output, args: ["ngsRippleTriggerChange"] }] } });
635
-
623
+ const RIPPLE_GLOBAL_OPTIONS = new InjectionToken("ngs-ripple-global-options");
624
+ var Ripple = class Ripple {
625
+ _elementRef = inject(ElementRef);
626
+ _ngZone = inject(NgZone);
627
+ _platform = inject(Platform);
628
+ _globalOptions = inject(RIPPLE_GLOBAL_OPTIONS, { optional: true }) || {};
629
+ color = input(void 0, {
630
+ ...ngDevMode ? { debugName: "color" } : /* istanbul ignore next */ {},
631
+ alias: "ngsRippleColor"
632
+ });
633
+ unbounded = input(false, {
634
+ ...ngDevMode ? { debugName: "unbounded" } : /* istanbul ignore next */ {},
635
+ alias: "ngsRippleUnbounded",
636
+ transform: booleanAttribute
637
+ });
638
+ centered = model(false, {
639
+ ...ngDevMode ? { debugName: "centered" } : /* istanbul ignore next */ {},
640
+ alias: "ngsRippleCentered"
641
+ });
642
+ radius = input(0, {
643
+ ...ngDevMode ? { debugName: "radius" } : /* istanbul ignore next */ {},
644
+ alias: "ngsRippleRadius",
645
+ transform: numberAttribute
646
+ });
647
+ animation = input(void 0, {
648
+ ...ngDevMode ? { debugName: "animation" } : /* istanbul ignore next */ {},
649
+ alias: "ngsRippleAnimation"
650
+ });
651
+ disabled = model(false, {
652
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
653
+ alias: "ngsRippleDisabled"
654
+ });
655
+ trigger = model(void 0, {
656
+ ...ngDevMode ? { debugName: "trigger" } : /* istanbul ignore next */ {},
657
+ alias: "ngsRippleTrigger"
658
+ });
659
+ _rippleRenderer;
660
+ _isInitialized = false;
661
+ constructor() {
662
+ this._rippleRenderer = new RippleRenderer(this, this._ngZone, this._elementRef, this._platform);
663
+ effect(() => {
664
+ if (this.disabled()) this.fadeOutAllNonPersistent();
665
+ this._setupTriggerEventsIfEnabled();
666
+ });
667
+ effect(() => {
668
+ this.trigger();
669
+ this._setupTriggerEventsIfEnabled();
670
+ });
671
+ }
672
+ ngOnInit() {
673
+ this._isInitialized = true;
674
+ this._setupTriggerEventsIfEnabled();
675
+ }
676
+ ngOnDestroy() {
677
+ this._rippleRenderer._removeTriggerEvents();
678
+ }
679
+ fadeOutAll() {
680
+ this._rippleRenderer.fadeOutAll();
681
+ }
682
+ fadeOutAllNonPersistent() {
683
+ this._rippleRenderer.fadeOutAllNonPersistent();
684
+ }
685
+ get rippleConfig() {
686
+ return {
687
+ centered: this.centered(),
688
+ radius: this.radius(),
689
+ color: this.color(),
690
+ animation: {
691
+ ...this._globalOptions.animation,
692
+ ...this.animation()
693
+ },
694
+ terminateOnPointerUp: this._globalOptions.terminateOnPointerUp
695
+ };
696
+ }
697
+ get rippleDisabled() {
698
+ return this.disabled() || !!this._globalOptions.disabled;
699
+ }
700
+ _setupTriggerEventsIfEnabled() {
701
+ if (!this.disabled() && this._isInitialized) this._rippleRenderer.setupTriggerEvents(this.trigger() || this._elementRef.nativeElement);
702
+ }
703
+ launch(configOrX, y = 0, config) {
704
+ if (typeof configOrX === "number") return this._rippleRenderer.fadeInRipple(configOrX, y, {
705
+ ...this.rippleConfig,
706
+ ...config
707
+ });
708
+ else return this._rippleRenderer.fadeInRipple(0, 0, {
709
+ ...this.rippleConfig,
710
+ ...configOrX
711
+ });
712
+ }
713
+ static ɵfac = i0.ɵɵngDeclareFactory({
714
+ minVersion: "12.0.0",
715
+ version: "22.3.0",
716
+ ngImport: i0,
717
+ type: Ripple,
718
+ deps: [],
719
+ target: i0.ɵɵFactoryTarget.Directive
720
+ });
721
+ static ɵdir = i0.ɵɵngDeclareDirective({
722
+ minVersion: "17.1.0",
723
+ version: "22.3.0",
724
+ type: Ripple,
725
+ isStandalone: true,
726
+ selector: "[ngsRipple]",
727
+ inputs: {
728
+ color: {
729
+ classPropertyName: "color",
730
+ publicName: "ngsRippleColor",
731
+ isSignal: true,
732
+ isRequired: false,
733
+ transformFunction: null
734
+ },
735
+ unbounded: {
736
+ classPropertyName: "unbounded",
737
+ publicName: "ngsRippleUnbounded",
738
+ isSignal: true,
739
+ isRequired: false,
740
+ transformFunction: null
741
+ },
742
+ centered: {
743
+ classPropertyName: "centered",
744
+ publicName: "ngsRippleCentered",
745
+ isSignal: true,
746
+ isRequired: false,
747
+ transformFunction: null
748
+ },
749
+ radius: {
750
+ classPropertyName: "radius",
751
+ publicName: "ngsRippleRadius",
752
+ isSignal: true,
753
+ isRequired: false,
754
+ transformFunction: null
755
+ },
756
+ animation: {
757
+ classPropertyName: "animation",
758
+ publicName: "ngsRippleAnimation",
759
+ isSignal: true,
760
+ isRequired: false,
761
+ transformFunction: null
762
+ },
763
+ disabled: {
764
+ classPropertyName: "disabled",
765
+ publicName: "ngsRippleDisabled",
766
+ isSignal: true,
767
+ isRequired: false,
768
+ transformFunction: null
769
+ },
770
+ trigger: {
771
+ classPropertyName: "trigger",
772
+ publicName: "ngsRippleTrigger",
773
+ isSignal: true,
774
+ isRequired: false,
775
+ transformFunction: null
776
+ }
777
+ },
778
+ outputs: {
779
+ centered: "ngsRippleCenteredChange",
780
+ disabled: "ngsRippleDisabledChange",
781
+ trigger: "ngsRippleTriggerChange"
782
+ },
783
+ host: {
784
+ properties: { "class.ngs-ripple-unbounded": "unbounded()" },
785
+ classAttribute: "ngs-ripple"
786
+ },
787
+ exportAs: ["ngsRipple"],
788
+ ngImport: i0
789
+ });
790
+ };
791
+ i0.ɵɵngDeclareClassMetadata({
792
+ minVersion: "12.0.0",
793
+ version: "22.3.0",
794
+ ngImport: i0,
795
+ type: Ripple,
796
+ decorators: [{
797
+ type: Directive,
798
+ args: [{
799
+ selector: "[ngsRipple]",
800
+ exportAs: "ngsRipple",
801
+ host: {
802
+ "class": "ngs-ripple",
803
+ "[class.ngs-ripple-unbounded]": "unbounded()"
804
+ }
805
+ }]
806
+ }],
807
+ ctorParameters: () => [],
808
+ propDecorators: {
809
+ color: [{
810
+ type: i0.Input,
811
+ args: [{
812
+ isSignal: true,
813
+ alias: "ngsRippleColor",
814
+ required: false
815
+ }]
816
+ }],
817
+ unbounded: [{
818
+ type: i0.Input,
819
+ args: [{
820
+ isSignal: true,
821
+ alias: "ngsRippleUnbounded",
822
+ required: false
823
+ }]
824
+ }],
825
+ centered: [{
826
+ type: i0.Input,
827
+ args: [{
828
+ isSignal: true,
829
+ alias: "ngsRippleCentered",
830
+ required: false
831
+ }]
832
+ }, {
833
+ type: i0.Output,
834
+ args: ["ngsRippleCenteredChange"]
835
+ }],
836
+ radius: [{
837
+ type: i0.Input,
838
+ args: [{
839
+ isSignal: true,
840
+ alias: "ngsRippleRadius",
841
+ required: false
842
+ }]
843
+ }],
844
+ animation: [{
845
+ type: i0.Input,
846
+ args: [{
847
+ isSignal: true,
848
+ alias: "ngsRippleAnimation",
849
+ required: false
850
+ }]
851
+ }],
852
+ disabled: [{
853
+ type: i0.Input,
854
+ args: [{
855
+ isSignal: true,
856
+ alias: "ngsRippleDisabled",
857
+ required: false
858
+ }]
859
+ }, {
860
+ type: i0.Output,
861
+ args: ["ngsRippleDisabledChange"]
862
+ }],
863
+ trigger: [{
864
+ type: i0.Input,
865
+ args: [{
866
+ isSignal: true,
867
+ alias: "ngsRippleTrigger",
868
+ required: false
869
+ }]
870
+ }, {
871
+ type: i0.Output,
872
+ args: ["ngsRippleTriggerChange"]
873
+ }]
874
+ }
875
+ });
636
876
  function injectElement() {
637
- return inject(ElementRef).nativeElement;
877
+ return inject(ElementRef).nativeElement;
638
878
  }
639
879
  function isElement(node) {
640
- return !!node && 'nodeType' in node && node.nodeType === Node.ELEMENT_NODE;
880
+ return !!node && "nodeType" in node && node.nodeType === Node.ELEMENT_NODE;
641
881
  }
642
882
  function getActualTarget(event) {
643
- return (event.target ?? event.currentTarget);
883
+ return event.target ?? event.currentTarget;
644
884
  }
645
-
646
- class TextareaAutoSize {
647
- _textarea = injectElement();
648
- _ngZone = inject(NgZone);
649
- _platform = inject(Platform);
650
- minRows = input(1, { ...(ngDevMode ? { debugName: "minRows" } : /* istanbul ignore next */ {}), transform: numberAttribute });
651
- maxRows = input(Number.MAX_SAFE_INTEGER, { ...(ngDevMode ? { debugName: "maxRows" } : /* istanbul ignore next */ {}), transform: numberAttribute });
652
- _resizeObserver;
653
- ngAfterViewInit() {
654
- if (this._platform.isBrowser) {
655
- this.resize();
656
- this._ngZone.runOutsideAngular(() => {
657
- this._resizeObserver = new ResizeObserver(() => this.resize());
658
- this._resizeObserver.observe(this._textarea);
659
- });
660
- }
661
- }
662
- ngOnDestroy() {
663
- this._resizeObserver?.disconnect();
664
- }
665
- resize() {
666
- this._textarea.style.height = 'auto';
667
- const style = window.getComputedStyle(this._textarea);
668
- let lineHeight = parseFloat(style.lineHeight);
669
- if (isNaN(lineHeight)) {
670
- lineHeight = parseFloat(style.fontSize) * 1.2;
671
- }
672
- const paddingTop = parseFloat(style.paddingTop) || 0;
673
- const paddingBottom = parseFloat(style.paddingBottom) || 0;
674
- const borderTop = parseFloat(style.borderTopWidth) || 0;
675
- const borderBottom = parseFloat(style.borderBottomWidth) || 0;
676
- const minHeight = this.minRows() * lineHeight + paddingTop + paddingBottom + borderTop + borderBottom;
677
- const maxHeight = this.maxRows() * lineHeight + paddingTop + paddingBottom + borderTop + borderBottom;
678
- this._textarea.style.height = 'auto';
679
- const currentScrollHeight = this._textarea.scrollHeight;
680
- let height = Math.max(minHeight, currentScrollHeight);
681
- height = Math.min(maxHeight, height);
682
- this._textarea.style.height = `${height}px`;
683
- if (currentScrollHeight > maxHeight) {
684
- this._textarea.style.overflowY = 'auto';
685
- }
686
- else {
687
- this._textarea.style.overflowY = 'hidden';
688
- }
689
- }
690
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TextareaAutoSize, deps: [], target: i0.ɵɵFactoryTarget.Directive });
691
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: TextareaAutoSize, isStandalone: true, selector: "textarea[ngsTextareaAutoSize]", inputs: { minRows: { classPropertyName: "minRows", publicName: "minRows", isSignal: true, isRequired: false, transformFunction: null }, maxRows: { classPropertyName: "maxRows", publicName: "maxRows", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "rows": "1" }, listeners: { "input": "resize()" }, styleAttribute: "display: block; overflow: hidden; resize: none; box-sizing: border-box;", classAttribute: "ngs-textarea-autosize" }, exportAs: ["ngsTextareaAutoSize"], ngImport: i0 });
692
- }
693
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TextareaAutoSize, decorators: [{
694
- type: Directive,
695
- args: [{
696
- selector: 'textarea[ngsTextareaAutoSize]',
697
- exportAs: 'ngsTextareaAutoSize',
698
- host: {
699
- 'class': 'ngs-textarea-autosize',
700
- 'rows': '1',
701
- '(input)': 'resize()',
702
- 'style': 'display: block; overflow: hidden; resize: none; box-sizing: border-box;',
703
- },
704
- }]
705
- }], propDecorators: { minRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "minRows", required: false }] }], maxRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxRows", required: false }] }] } });
706
-
707
- class InitialsPipe {
708
- transform(value) {
709
- if (!value) {
710
- return '';
711
- }
712
- const initials = [...value.toString().matchAll(/(\p{L}{1})\p{L}+/gu)];
713
- const result = ((initials.shift()?.[1] || '') + (initials.pop()?.[1] || '')).toUpperCase();
714
- return result ? result : value[0];
715
- }
716
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: InitialsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
717
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.7", ngImport: i0, type: InitialsPipe, isStandalone: true, name: "initials" });
718
- }
719
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: InitialsPipe, decorators: [{
720
- type: Pipe,
721
- args: [{
722
- name: 'initials',
723
- }]
724
- }] });
725
-
726
- class FormatFileSizePipe {
727
- transform(bytes, decimalPoint = 2) {
728
- if (bytes == 0) {
729
- return '0 Bytes';
730
- }
731
- const k = 1000;
732
- const dm = decimalPoint || 2;
733
- const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
734
- const index = Math.floor(Math.log(bytes) / Math.log(k));
735
- return parseFloat((bytes / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
736
- }
737
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: FormatFileSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
738
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.7", ngImport: i0, type: FormatFileSizePipe, isStandalone: true, name: "formatFileSize" });
739
- }
740
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: FormatFileSizePipe, decorators: [{
741
- type: Pipe,
742
- args: [{
743
- name: 'formatFileSize',
744
- }]
745
- }] });
746
-
747
- class OrderByPipe {
748
- transform(value, property, direction = 'asc') {
749
- if (!Array.isArray(value)) {
750
- throw new Error('Order By value should be an array');
751
- }
752
- const sorted = value.sort((a, b) => {
753
- if (a[property] < b[property]) {
754
- return -1;
755
- }
756
- else if (a[property] > b[property]) {
757
- return 1;
758
- }
759
- else {
760
- return 0;
761
- }
762
- });
763
- if (direction === 'asc') {
764
- return sorted;
765
- }
766
- else if (direction === 'desc') {
767
- return sorted.reverse();
768
- }
769
- }
770
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: OrderByPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
771
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.7", ngImport: i0, type: OrderByPipe, isStandalone: true, name: "orderBy" });
772
- }
773
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: OrderByPipe, decorators: [{
774
- type: Pipe,
775
- args: [{
776
- name: 'orderBy',
777
- }]
778
- }] });
779
-
780
- class SafeHtmlPipe {
781
- _domSanitizer = inject(DomSanitizer);
782
- transform(value) {
783
- return this._domSanitizer.bypassSecurityTrustHtml(value);
784
- }
785
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SafeHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
786
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.7", ngImport: i0, type: SafeHtmlPipe, isStandalone: true, name: "safeHtml" });
787
- }
788
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SafeHtmlPipe, decorators: [{
789
- type: Pipe,
790
- args: [{
791
- name: 'safeHtml',
792
- }]
793
- }] });
794
-
795
- class SafeResourceUrlPipe {
796
- _domSanitizer = inject(DomSanitizer);
797
- transform(value) {
798
- return this._domSanitizer.bypassSecurityTrustResourceUrl(value);
799
- }
800
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SafeResourceUrlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
801
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.7", ngImport: i0, type: SafeResourceUrlPipe, isStandalone: true, name: "safeResourceUrl" });
802
- }
803
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SafeResourceUrlPipe, decorators: [{
804
- type: Pipe,
805
- args: [{
806
- name: 'safeResourceUrl',
807
- }]
808
- }] });
809
-
810
- class FilterByPropertyPipe {
811
- getNestedValue(obj, path) {
812
- return path.split('.').reduce((acc, part) => acc && acc[part], obj);
813
- }
814
- transform(items, propPath, value, strict = false) {
815
- if (!items) {
816
- return [];
817
- }
818
- if (value === undefined || typeof value === 'undefined') {
819
- return items;
820
- }
821
- if (!strict && (value === null || value === '')) {
822
- return items;
823
- }
824
- return items.filter(item => {
825
- const propertyValue = this.getNestedValue(item, propPath);
826
- return propertyValue === value;
827
- });
828
- }
829
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: FilterByPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
830
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.7", ngImport: i0, type: FilterByPropertyPipe, isStandalone: true, name: "filterByProperty" });
831
- }
832
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: FilterByPropertyPipe, decorators: [{
833
- type: Pipe,
834
- args: [{
835
- name: 'filterByProperty',
836
- }]
837
- }] });
838
-
839
- class SearchByPropertyPipe {
840
- getNestedValue(obj, path) {
841
- return path.split('.').reduce((acc, part) => acc && acc[part], obj);
842
- }
843
- transform(items, propPath, searchValue) {
844
- if (!items) {
845
- return [];
846
- }
847
- if (!searchValue) {
848
- return items;
849
- }
850
- const lowercasedSearchValue = searchValue.toLowerCase();
851
- return items.filter(item => {
852
- const propertyValue = this.getNestedValue(item, propPath);
853
- if (typeof propertyValue === 'string') {
854
- return propertyValue.toLowerCase().includes(lowercasedSearchValue);
855
- }
856
- return false;
857
- });
858
- }
859
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SearchByPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
860
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.7", ngImport: i0, type: SearchByPropertyPipe, isStandalone: true, name: "searchByProperty" });
861
- }
862
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SearchByPropertyPipe, decorators: [{
863
- type: Pipe,
864
- args: [{
865
- name: 'searchByProperty',
866
- }]
867
- }] });
868
-
869
- const ENVIRONMENT = new InjectionToken('ENVIRONMENT');
870
- class EnvironmentService {
871
- _environment = inject(ENVIRONMENT, {
872
- optional: true
873
- }) || {};
874
- getValue(key, defaultValue) {
875
- return this._environment[key] || defaultValue;
876
- }
877
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: EnvironmentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
878
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: EnvironmentService, providedIn: 'root' });
879
- }
880
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: EnvironmentService, decorators: [{
881
- type: Injectable,
882
- args: [{
883
- providedIn: 'root'
884
- }]
885
- }] });
886
-
887
- class AnalyticsService {
888
- _platformId = inject(PLATFORM_ID);
889
- _router = inject(Router);
890
- _document = inject(DOCUMENT);
891
- _environmentService = inject(EnvironmentService);
892
- trackPageViews() {
893
- const googleAnalyticsId = this._environmentService.getValue('googleAnalyticsId');
894
- if (isDevMode() || !googleAnalyticsId) {
895
- return;
896
- }
897
- try {
898
- const url = 'https://www.googletagmanager.com/gtag/js?id=';
899
- const gTagScript = this._document.createElement('script');
900
- gTagScript.async = true;
901
- gTagScript.src = `${url}${googleAnalyticsId}`;
902
- this._document.head.appendChild(gTagScript);
903
- const dataLayerScript = this._document.createElement('script');
904
- dataLayerScript.innerHTML = `
885
+ var TextareaAutoSize = class TextareaAutoSize {
886
+ _textarea = injectElement();
887
+ _ngZone = inject(NgZone);
888
+ _platform = inject(Platform);
889
+ minRows = input(1, {
890
+ ...ngDevMode ? { debugName: "minRows" } : /* istanbul ignore next */ {},
891
+ transform: numberAttribute
892
+ });
893
+ maxRows = input(Number.MAX_SAFE_INTEGER, {
894
+ ...ngDevMode ? { debugName: "maxRows" } : /* istanbul ignore next */ {},
895
+ transform: numberAttribute
896
+ });
897
+ _resizeObserver;
898
+ ngAfterViewInit() {
899
+ if (this._platform.isBrowser) {
900
+ this.resize();
901
+ this._ngZone.runOutsideAngular(() => {
902
+ this._resizeObserver = new ResizeObserver(() => this.resize());
903
+ this._resizeObserver.observe(this._textarea);
904
+ });
905
+ }
906
+ }
907
+ ngOnDestroy() {
908
+ this._resizeObserver?.disconnect();
909
+ }
910
+ resize() {
911
+ this._textarea.style.height = "auto";
912
+ const style = window.getComputedStyle(this._textarea);
913
+ let lineHeight = parseFloat(style.lineHeight);
914
+ if (isNaN(lineHeight)) lineHeight = parseFloat(style.fontSize) * 1.2;
915
+ const paddingTop = parseFloat(style.paddingTop) || 0;
916
+ const paddingBottom = parseFloat(style.paddingBottom) || 0;
917
+ const borderTop = parseFloat(style.borderTopWidth) || 0;
918
+ const borderBottom = parseFloat(style.borderBottomWidth) || 0;
919
+ const minHeight = this.minRows() * lineHeight + paddingTop + paddingBottom + borderTop + borderBottom;
920
+ const maxHeight = this.maxRows() * lineHeight + paddingTop + paddingBottom + borderTop + borderBottom;
921
+ this._textarea.style.height = "auto";
922
+ const currentScrollHeight = this._textarea.scrollHeight;
923
+ let height = Math.max(minHeight, currentScrollHeight);
924
+ height = Math.min(maxHeight, height);
925
+ this._textarea.style.height = `${height}px`;
926
+ if (currentScrollHeight > maxHeight) this._textarea.style.overflowY = "auto";
927
+ else this._textarea.style.overflowY = "hidden";
928
+ }
929
+ static ɵfac = i0.ɵɵngDeclareFactory({
930
+ minVersion: "12.0.0",
931
+ version: "22.3.0",
932
+ ngImport: i0,
933
+ type: TextareaAutoSize,
934
+ deps: [],
935
+ target: i0.ɵɵFactoryTarget.Directive
936
+ });
937
+ static ɵdir = i0.ɵɵngDeclareDirective({
938
+ minVersion: "17.1.0",
939
+ version: "22.3.0",
940
+ type: TextareaAutoSize,
941
+ isStandalone: true,
942
+ selector: "textarea[ngsTextareaAutoSize]",
943
+ inputs: {
944
+ minRows: {
945
+ classPropertyName: "minRows",
946
+ publicName: "minRows",
947
+ isSignal: true,
948
+ isRequired: false,
949
+ transformFunction: null
950
+ },
951
+ maxRows: {
952
+ classPropertyName: "maxRows",
953
+ publicName: "maxRows",
954
+ isSignal: true,
955
+ isRequired: false,
956
+ transformFunction: null
957
+ }
958
+ },
959
+ host: {
960
+ attributes: { "rows": "1" },
961
+ listeners: { "input": "resize()" },
962
+ styleAttribute: "display: block; overflow: hidden; resize: none; box-sizing: border-box;",
963
+ classAttribute: "ngs-textarea-autosize"
964
+ },
965
+ exportAs: ["ngsTextareaAutoSize"],
966
+ ngImport: i0
967
+ });
968
+ };
969
+ i0.ɵɵngDeclareClassMetadata({
970
+ minVersion: "12.0.0",
971
+ version: "22.3.0",
972
+ ngImport: i0,
973
+ type: TextareaAutoSize,
974
+ decorators: [{
975
+ type: Directive,
976
+ args: [{
977
+ selector: "textarea[ngsTextareaAutoSize]",
978
+ exportAs: "ngsTextareaAutoSize",
979
+ host: {
980
+ "class": "ngs-textarea-autosize",
981
+ "rows": "1",
982
+ "(input)": "resize()",
983
+ "style": "display: block; overflow: hidden; resize: none; box-sizing: border-box;"
984
+ }
985
+ }]
986
+ }],
987
+ propDecorators: {
988
+ minRows: [{
989
+ type: i0.Input,
990
+ args: [{
991
+ isSignal: true,
992
+ alias: "minRows",
993
+ required: false
994
+ }]
995
+ }],
996
+ maxRows: [{
997
+ type: i0.Input,
998
+ args: [{
999
+ isSignal: true,
1000
+ alias: "maxRows",
1001
+ required: false
1002
+ }]
1003
+ }]
1004
+ }
1005
+ });
1006
+ var InitialsPipe = class InitialsPipe {
1007
+ transform(value) {
1008
+ if (!value) return "";
1009
+ const initials = [...value.toString().matchAll(/(\p{L}{1})\p{L}+/gu)];
1010
+ const result = ((initials.shift()?.[1] || "") + (initials.pop()?.[1] || "")).toUpperCase();
1011
+ return result ? result : value[0];
1012
+ }
1013
+ static ɵfac = i0.ɵɵngDeclareFactory({
1014
+ minVersion: "12.0.0",
1015
+ version: "22.3.0",
1016
+ ngImport: i0,
1017
+ type: InitialsPipe,
1018
+ deps: [],
1019
+ target: i0.ɵɵFactoryTarget.Pipe
1020
+ });
1021
+ static ɵpipe = i0.ɵɵngDeclarePipe({
1022
+ minVersion: "14.0.0",
1023
+ version: "22.3.0",
1024
+ ngImport: i0,
1025
+ type: InitialsPipe,
1026
+ isStandalone: true,
1027
+ name: "initials"
1028
+ });
1029
+ };
1030
+ i0.ɵɵngDeclareClassMetadata({
1031
+ minVersion: "12.0.0",
1032
+ version: "22.3.0",
1033
+ ngImport: i0,
1034
+ type: InitialsPipe,
1035
+ decorators: [{
1036
+ type: Pipe,
1037
+ args: [{ name: "initials" }]
1038
+ }]
1039
+ });
1040
+ var FormatFileSizePipe = class FormatFileSizePipe {
1041
+ transform(bytes, decimalPoint = 2) {
1042
+ if (bytes == 0) return "0 Bytes";
1043
+ const k = 1e3;
1044
+ const dm = decimalPoint || 2;
1045
+ const sizes = [
1046
+ "Bytes",
1047
+ "KB",
1048
+ "MB",
1049
+ "GB",
1050
+ "TB",
1051
+ "PB",
1052
+ "EB",
1053
+ "ZB",
1054
+ "YB"
1055
+ ];
1056
+ const index = Math.floor(Math.log(bytes) / Math.log(k));
1057
+ return parseFloat((bytes / Math.pow(k, index)).toFixed(dm)) + " " + sizes[index];
1058
+ }
1059
+ static ɵfac = i0.ɵɵngDeclareFactory({
1060
+ minVersion: "12.0.0",
1061
+ version: "22.3.0",
1062
+ ngImport: i0,
1063
+ type: FormatFileSizePipe,
1064
+ deps: [],
1065
+ target: i0.ɵɵFactoryTarget.Pipe
1066
+ });
1067
+ static ɵpipe = i0.ɵɵngDeclarePipe({
1068
+ minVersion: "14.0.0",
1069
+ version: "22.3.0",
1070
+ ngImport: i0,
1071
+ type: FormatFileSizePipe,
1072
+ isStandalone: true,
1073
+ name: "formatFileSize"
1074
+ });
1075
+ };
1076
+ i0.ɵɵngDeclareClassMetadata({
1077
+ minVersion: "12.0.0",
1078
+ version: "22.3.0",
1079
+ ngImport: i0,
1080
+ type: FormatFileSizePipe,
1081
+ decorators: [{
1082
+ type: Pipe,
1083
+ args: [{ name: "formatFileSize" }]
1084
+ }]
1085
+ });
1086
+ var OrderByPipe = class OrderByPipe {
1087
+ transform(value, property, direction = "asc") {
1088
+ if (!Array.isArray(value)) throw new Error("Order By value should be an array");
1089
+ const sorted = value.sort((a, b) => {
1090
+ if (a[property] < b[property]) return -1;
1091
+ else if (a[property] > b[property]) return 1;
1092
+ else return 0;
1093
+ });
1094
+ if (direction === "asc") return sorted;
1095
+ else if (direction === "desc") return sorted.reverse();
1096
+ }
1097
+ static ɵfac = i0.ɵɵngDeclareFactory({
1098
+ minVersion: "12.0.0",
1099
+ version: "22.3.0",
1100
+ ngImport: i0,
1101
+ type: OrderByPipe,
1102
+ deps: [],
1103
+ target: i0.ɵɵFactoryTarget.Pipe
1104
+ });
1105
+ static ɵpipe = i0.ɵɵngDeclarePipe({
1106
+ minVersion: "14.0.0",
1107
+ version: "22.3.0",
1108
+ ngImport: i0,
1109
+ type: OrderByPipe,
1110
+ isStandalone: true,
1111
+ name: "orderBy"
1112
+ });
1113
+ };
1114
+ i0.ɵɵngDeclareClassMetadata({
1115
+ minVersion: "12.0.0",
1116
+ version: "22.3.0",
1117
+ ngImport: i0,
1118
+ type: OrderByPipe,
1119
+ decorators: [{
1120
+ type: Pipe,
1121
+ args: [{ name: "orderBy" }]
1122
+ }]
1123
+ });
1124
+ var SafeHtmlPipe = class SafeHtmlPipe {
1125
+ _domSanitizer = inject(DomSanitizer);
1126
+ transform(value) {
1127
+ return this._domSanitizer.bypassSecurityTrustHtml(value);
1128
+ }
1129
+ static ɵfac = i0.ɵɵngDeclareFactory({
1130
+ minVersion: "12.0.0",
1131
+ version: "22.3.0",
1132
+ ngImport: i0,
1133
+ type: SafeHtmlPipe,
1134
+ deps: [],
1135
+ target: i0.ɵɵFactoryTarget.Pipe
1136
+ });
1137
+ static ɵpipe = i0.ɵɵngDeclarePipe({
1138
+ minVersion: "14.0.0",
1139
+ version: "22.3.0",
1140
+ ngImport: i0,
1141
+ type: SafeHtmlPipe,
1142
+ isStandalone: true,
1143
+ name: "safeHtml"
1144
+ });
1145
+ };
1146
+ i0.ɵɵngDeclareClassMetadata({
1147
+ minVersion: "12.0.0",
1148
+ version: "22.3.0",
1149
+ ngImport: i0,
1150
+ type: SafeHtmlPipe,
1151
+ decorators: [{
1152
+ type: Pipe,
1153
+ args: [{ name: "safeHtml" }]
1154
+ }]
1155
+ });
1156
+ var SafeResourceUrlPipe = class SafeResourceUrlPipe {
1157
+ _domSanitizer = inject(DomSanitizer);
1158
+ transform(value) {
1159
+ return this._domSanitizer.bypassSecurityTrustResourceUrl(value);
1160
+ }
1161
+ static ɵfac = i0.ɵɵngDeclareFactory({
1162
+ minVersion: "12.0.0",
1163
+ version: "22.3.0",
1164
+ ngImport: i0,
1165
+ type: SafeResourceUrlPipe,
1166
+ deps: [],
1167
+ target: i0.ɵɵFactoryTarget.Pipe
1168
+ });
1169
+ static ɵpipe = i0.ɵɵngDeclarePipe({
1170
+ minVersion: "14.0.0",
1171
+ version: "22.3.0",
1172
+ ngImport: i0,
1173
+ type: SafeResourceUrlPipe,
1174
+ isStandalone: true,
1175
+ name: "safeResourceUrl"
1176
+ });
1177
+ };
1178
+ i0.ɵɵngDeclareClassMetadata({
1179
+ minVersion: "12.0.0",
1180
+ version: "22.3.0",
1181
+ ngImport: i0,
1182
+ type: SafeResourceUrlPipe,
1183
+ decorators: [{
1184
+ type: Pipe,
1185
+ args: [{ name: "safeResourceUrl" }]
1186
+ }]
1187
+ });
1188
+ var FilterByPropertyPipe = class FilterByPropertyPipe {
1189
+ getNestedValue(obj, path) {
1190
+ return path.split(".").reduce((acc, part) => acc && acc[part], obj);
1191
+ }
1192
+ transform(items, propPath, value, strict = false) {
1193
+ if (!items) return [];
1194
+ if (value === void 0 || typeof value === "undefined") return items;
1195
+ if (!strict && (value === null || value === "")) return items;
1196
+ return items.filter((item) => {
1197
+ return this.getNestedValue(item, propPath) === value;
1198
+ });
1199
+ }
1200
+ static ɵfac = i0.ɵɵngDeclareFactory({
1201
+ minVersion: "12.0.0",
1202
+ version: "22.3.0",
1203
+ ngImport: i0,
1204
+ type: FilterByPropertyPipe,
1205
+ deps: [],
1206
+ target: i0.ɵɵFactoryTarget.Pipe
1207
+ });
1208
+ static ɵpipe = i0.ɵɵngDeclarePipe({
1209
+ minVersion: "14.0.0",
1210
+ version: "22.3.0",
1211
+ ngImport: i0,
1212
+ type: FilterByPropertyPipe,
1213
+ isStandalone: true,
1214
+ name: "filterByProperty"
1215
+ });
1216
+ };
1217
+ i0.ɵɵngDeclareClassMetadata({
1218
+ minVersion: "12.0.0",
1219
+ version: "22.3.0",
1220
+ ngImport: i0,
1221
+ type: FilterByPropertyPipe,
1222
+ decorators: [{
1223
+ type: Pipe,
1224
+ args: [{ name: "filterByProperty" }]
1225
+ }]
1226
+ });
1227
+ var SearchByPropertyPipe = class SearchByPropertyPipe {
1228
+ getNestedValue(obj, path) {
1229
+ return path.split(".").reduce((acc, part) => acc && acc[part], obj);
1230
+ }
1231
+ transform(items, propPath, searchValue) {
1232
+ if (!items) return [];
1233
+ if (!searchValue) return items;
1234
+ const lowercasedSearchValue = searchValue.toLowerCase();
1235
+ return items.filter((item) => {
1236
+ const propertyValue = this.getNestedValue(item, propPath);
1237
+ if (typeof propertyValue === "string") return propertyValue.toLowerCase().includes(lowercasedSearchValue);
1238
+ return false;
1239
+ });
1240
+ }
1241
+ static ɵfac = i0.ɵɵngDeclareFactory({
1242
+ minVersion: "12.0.0",
1243
+ version: "22.3.0",
1244
+ ngImport: i0,
1245
+ type: SearchByPropertyPipe,
1246
+ deps: [],
1247
+ target: i0.ɵɵFactoryTarget.Pipe
1248
+ });
1249
+ static ɵpipe = i0.ɵɵngDeclarePipe({
1250
+ minVersion: "14.0.0",
1251
+ version: "22.3.0",
1252
+ ngImport: i0,
1253
+ type: SearchByPropertyPipe,
1254
+ isStandalone: true,
1255
+ name: "searchByProperty"
1256
+ });
1257
+ };
1258
+ i0.ɵɵngDeclareClassMetadata({
1259
+ minVersion: "12.0.0",
1260
+ version: "22.3.0",
1261
+ ngImport: i0,
1262
+ type: SearchByPropertyPipe,
1263
+ decorators: [{
1264
+ type: Pipe,
1265
+ args: [{ name: "searchByProperty" }]
1266
+ }]
1267
+ });
1268
+ const ENVIRONMENT = new InjectionToken("ENVIRONMENT");
1269
+ var EnvironmentService = class EnvironmentService {
1270
+ _environment = inject(ENVIRONMENT, { optional: true }) || {};
1271
+ getValue(key, defaultValue) {
1272
+ return this._environment[key] || defaultValue;
1273
+ }
1274
+ static ɵfac = i0.ɵɵngDeclareFactory({
1275
+ minVersion: "12.0.0",
1276
+ version: "22.3.0",
1277
+ ngImport: i0,
1278
+ type: EnvironmentService,
1279
+ deps: [],
1280
+ target: i0.ɵɵFactoryTarget.Injectable
1281
+ });
1282
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1283
+ minVersion: "12.0.0",
1284
+ version: "22.3.0",
1285
+ ngImport: i0,
1286
+ type: EnvironmentService,
1287
+ providedIn: "root"
1288
+ });
1289
+ };
1290
+ i0.ɵɵngDeclareClassMetadata({
1291
+ minVersion: "12.0.0",
1292
+ version: "22.3.0",
1293
+ ngImport: i0,
1294
+ type: EnvironmentService,
1295
+ decorators: [{
1296
+ type: Injectable,
1297
+ args: [{ providedIn: "root" }]
1298
+ }]
1299
+ });
1300
+ var AnalyticsService = class AnalyticsService {
1301
+ _platformId = inject(PLATFORM_ID);
1302
+ _router = inject(Router);
1303
+ _document = inject(DOCUMENT);
1304
+ _environmentService = inject(EnvironmentService);
1305
+ trackPageViews() {
1306
+ const googleAnalyticsId = this._environmentService.getValue("googleAnalyticsId");
1307
+ if (isDevMode() || !googleAnalyticsId) return;
1308
+ try {
1309
+ const url = "https://www.googletagmanager.com/gtag/js?id=";
1310
+ const gTagScript = this._document.createElement("script");
1311
+ gTagScript.async = true;
1312
+ gTagScript.src = `${url}${googleAnalyticsId}`;
1313
+ this._document.head.appendChild(gTagScript);
1314
+ const dataLayerScript = this._document.createElement("script");
1315
+ dataLayerScript.innerHTML = `
905
1316
  window.dataLayer = window.dataLayer || [];
906
1317
  function gtag(){dataLayer.push(arguments);}
907
1318
  gtag('js', new Date());
908
1319
  gtag('config', '${googleAnalyticsId}');`;
909
- this._document.head.appendChild(dataLayerScript);
910
- if (isPlatformServer(this._platformId)) {
911
- return;
912
- }
913
- this._router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe((event) => {
914
- gtag('event', 'page_view', {
915
- page_title: this._document.head.title,
916
- page_path: event.urlAfterRedirects,
917
- page_location: this._document.location.href
918
- });
919
- });
920
- }
921
- catch (e) {
922
- }
923
- }
924
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: AnalyticsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
925
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: AnalyticsService, providedIn: 'root' });
926
- }
927
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: AnalyticsService, decorators: [{
928
- type: Injectable,
929
- args: [{
930
- providedIn: 'root'
931
- }]
932
- }] });
933
-
934
- class InactivityTrackerService {
935
- _destroyRef = inject(DestroyRef);
936
- _document = inject(DOCUMENT);
937
- _interval = 10000 * 60; // 5 minutes
938
- _timeout;
939
- _interactionEvents$ = merge(fromEvent(this._document, 'click'), fromEvent(this._document, 'keydown'), fromEvent(this._document, 'mousemove'), fromEvent(this._document, 'scroll')).pipe(debounceTime(250));
940
- _noInteraction = new EventEmitter();
941
- setupInactivityTimer(interval) {
942
- if (interval) {
943
- this._interval = interval;
944
- }
945
- this._setupTimer();
946
- this._interactionEvents$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
947
- this._setupTimer();
948
- });
949
- return this._noInteraction.pipe(takeUntilDestroyed(this._destroyRef));
950
- }
951
- reset() {
952
- this._setupTimer();
953
- }
954
- _setupTimer() {
955
- clearTimeout(this._timeout);
956
- this._timeout = setTimeout(() => {
957
- this._noInteraction.emit();
958
- }, this._interval);
959
- }
960
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: InactivityTrackerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
961
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: InactivityTrackerService, providedIn: 'root' });
962
- }
963
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: InactivityTrackerService, decorators: [{
964
- type: Injectable,
965
- args: [{
966
- providedIn: 'root'
967
- }]
968
- }] });
969
-
970
- const initialGlobalState = {
971
- screenLoading: true,
972
- sidebarHidden: false,
973
- pageTitle: ''
1320
+ this._document.head.appendChild(dataLayerScript);
1321
+ if (isPlatformServer(this._platformId)) return;
1322
+ this._router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe((event) => {
1323
+ gtag("event", "page_view", {
1324
+ page_title: this._document.head.title,
1325
+ page_path: event.urlAfterRedirects,
1326
+ page_location: this._document.location.href
1327
+ });
1328
+ });
1329
+ } catch (e) {}
1330
+ }
1331
+ static ɵfac = i0.ɵɵngDeclareFactory({
1332
+ minVersion: "12.0.0",
1333
+ version: "22.3.0",
1334
+ ngImport: i0,
1335
+ type: AnalyticsService,
1336
+ deps: [],
1337
+ target: i0.ɵɵFactoryTarget.Injectable
1338
+ });
1339
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1340
+ minVersion: "12.0.0",
1341
+ version: "22.3.0",
1342
+ ngImport: i0,
1343
+ type: AnalyticsService,
1344
+ providedIn: "root"
1345
+ });
974
1346
  };
975
- const GlobalStore = signalStore({ providedIn: 'root' }, withState(initialGlobalState), withMethods((store) => ({
976
- setScreenLoading(isLoading) {
977
- patchState(store, {
978
- screenLoading: isLoading
979
- });
980
- },
981
- setPageTitle(pageTitle) {
982
- patchState(store, {
983
- pageTitle
984
- });
985
- }
1347
+ i0.ɵɵngDeclareClassMetadata({
1348
+ minVersion: "12.0.0",
1349
+ version: "22.3.0",
1350
+ ngImport: i0,
1351
+ type: AnalyticsService,
1352
+ decorators: [{
1353
+ type: Injectable,
1354
+ args: [{ providedIn: "root" }]
1355
+ }]
1356
+ });
1357
+ var InactivityTrackerService = class InactivityTrackerService {
1358
+ _destroyRef = inject(DestroyRef);
1359
+ _document = inject(DOCUMENT);
1360
+ _interval = 6e5;
1361
+ _timeout;
1362
+ _interactionEvents$ = merge(fromEvent(this._document, "click"), fromEvent(this._document, "keydown"), fromEvent(this._document, "mousemove"), fromEvent(this._document, "scroll")).pipe(debounceTime(250));
1363
+ _noInteraction = new EventEmitter();
1364
+ setupInactivityTimer(interval) {
1365
+ if (interval) this._interval = interval;
1366
+ this._setupTimer();
1367
+ this._interactionEvents$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
1368
+ this._setupTimer();
1369
+ });
1370
+ return this._noInteraction.pipe(takeUntilDestroyed(this._destroyRef));
1371
+ }
1372
+ reset() {
1373
+ this._setupTimer();
1374
+ }
1375
+ _setupTimer() {
1376
+ clearTimeout(this._timeout);
1377
+ this._timeout = setTimeout(() => {
1378
+ this._noInteraction.emit();
1379
+ }, this._interval);
1380
+ }
1381
+ static ɵfac = i0.ɵɵngDeclareFactory({
1382
+ minVersion: "12.0.0",
1383
+ version: "22.3.0",
1384
+ ngImport: i0,
1385
+ type: InactivityTrackerService,
1386
+ deps: [],
1387
+ target: i0.ɵɵFactoryTarget.Injectable
1388
+ });
1389
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1390
+ minVersion: "12.0.0",
1391
+ version: "22.3.0",
1392
+ ngImport: i0,
1393
+ type: InactivityTrackerService,
1394
+ providedIn: "root"
1395
+ });
1396
+ };
1397
+ i0.ɵɵngDeclareClassMetadata({
1398
+ minVersion: "12.0.0",
1399
+ version: "22.3.0",
1400
+ ngImport: i0,
1401
+ type: InactivityTrackerService,
1402
+ decorators: [{
1403
+ type: Injectable,
1404
+ args: [{ providedIn: "root" }]
1405
+ }]
1406
+ });
1407
+ const GlobalStore = signalStore({ providedIn: "root" }, withState({
1408
+ screenLoading: true,
1409
+ sidebarHidden: false,
1410
+ pageTitle: ""
1411
+ }), withMethods((store) => ({
1412
+ setScreenLoading(isLoading) {
1413
+ patchState(store, { screenLoading: isLoading });
1414
+ },
1415
+ setPageTitle(pageTitle) {
1416
+ patchState(store, { pageTitle });
1417
+ }
986
1418
  })));
987
-
988
- class PageTitleStrategyService extends TitleStrategy {
989
- _title = inject(Title);
990
- _globalStore = inject(GlobalStore);
991
- _environmentService = inject(EnvironmentService);
992
- updateTitle(routerState) {
993
- const title = this.cleanTitle(this.buildTitle(routerState));
994
- const pageTitle = this.cleanTitle(this._globalStore.pageTitle())
995
- || this.cleanTitle(this._environmentService.getValue('pageTitle'));
996
- const currentTitle = this.cleanTitle(this._title.getTitle());
997
- const nextTitle = title && pageTitle ? `${title} | ${pageTitle}` : title || pageTitle || currentTitle;
998
- if (nextTitle) {
999
- this._title.setTitle(nextTitle);
1000
- }
1001
- }
1002
- cleanTitle(title) {
1003
- if (!title) {
1004
- return null;
1005
- }
1006
- const clean = title
1007
- .split('/')
1008
- .map((part) => part.trim())
1009
- .filter((part) => part && part.toLowerCase() !== 'undefined')
1010
- .join(' - ')
1011
- .trim();
1012
- return clean || null;
1013
- }
1014
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PageTitleStrategyService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1015
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PageTitleStrategyService, providedIn: 'root' });
1016
- }
1017
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PageTitleStrategyService, decorators: [{
1018
- type: Injectable,
1019
- args: [{
1020
- providedIn: 'root'
1021
- }]
1022
- }] });
1023
-
1024
- class ScreenLoaderService {
1025
- _globalStore = inject(GlobalStore);
1026
- show() {
1027
- this._globalStore.setScreenLoading(true);
1028
- }
1029
- hide() {
1030
- this._globalStore.setScreenLoading(false);
1031
- }
1032
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ScreenLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1033
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ScreenLoaderService, providedIn: 'root' });
1034
- }
1035
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ScreenLoaderService, decorators: [{
1036
- type: Injectable,
1037
- args: [{
1038
- providedIn: 'root'
1039
- }]
1040
- }] });
1041
-
1042
- class SeoService {
1043
- _router = inject(Router);
1044
- _destroyRef = inject(DestroyRef);
1045
- _document = inject(DOCUMENT);
1046
- _platformId = inject(PLATFORM_ID);
1047
- _linkCanonical;
1048
- _title = inject(Title);
1049
- _meta = inject(Meta);
1050
- _globalStore = inject(GlobalStore);
1051
- get meta() {
1052
- return this._meta;
1053
- }
1054
- updateDescription(content) {
1055
- if (!content) {
1056
- return;
1057
- }
1058
- this.meta.updateTag({
1059
- name: 'description',
1060
- content
1061
- });
1062
- this.meta.updateTag({
1063
- name: 'og:description',
1064
- content
1065
- });
1066
- }
1067
- updateOgUrl(content) {
1068
- if (!content) {
1069
- return;
1070
- }
1071
- this.meta.updateTag({
1072
- name: 'og:url',
1073
- content
1074
- });
1075
- }
1076
- updateOgImage(content) {
1077
- if (!content) {
1078
- return;
1079
- }
1080
- this.meta.updateTag({
1081
- name: 'og:image',
1082
- content
1083
- });
1084
- }
1085
- trackCanonicalChanges(siteUrl) {
1086
- this._createCanonicalTag(siteUrl);
1087
- if (isPlatformServer(this._platformId)) {
1088
- return;
1089
- }
1090
- this._router.events
1091
- .pipe(filter((event) => event instanceof NavigationEnd), takeUntilDestroyed(this._destroyRef))
1092
- .subscribe(() => {
1093
- const href = this.getCanonicalUrl(siteUrl);
1094
- this._linkCanonical?.setAttribute('href', href);
1095
- this.updateOgUrl(href);
1096
- });
1097
- }
1098
- updateTitle(title) {
1099
- this._title.setTitle(`${title} | ${this._globalStore.pageTitle()}`);
1100
- this.meta.updateTag({
1101
- name: 'og:title',
1102
- content: title
1103
- });
1104
- }
1105
- getCanonicalUrl(siteUrl) {
1106
- if (this._document.URL.startsWith('http')) {
1107
- return this._document.URL;
1108
- }
1109
- return siteUrl + this._document.URL;
1110
- }
1111
- _createCanonicalTag(siteUrl) {
1112
- this._linkCanonical = this._document.querySelector('link[rel="canonical"]');
1113
- if (!this._linkCanonical) {
1114
- this._linkCanonical = this._document.createElement('link');
1115
- this._linkCanonical.setAttribute('rel', 'canonical');
1116
- this._document.head.appendChild(this._linkCanonical);
1117
- }
1118
- this._linkCanonical.setAttribute('href', this.getCanonicalUrl(siteUrl));
1119
- }
1120
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SeoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1121
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SeoService, providedIn: 'root' });
1122
- }
1123
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SeoService, decorators: [{
1124
- type: Injectable,
1125
- args: [{
1126
- providedIn: 'root'
1127
- }]
1128
- }] });
1129
-
1130
- const NGS_THEME_OPTIONS = new InjectionToken('NGS_THEME_OPTIONS', {
1131
- factory: () => ({
1132
- theme: 'default',
1133
- colorScheme: 'auto',
1134
- colorPreset: 'default',
1135
- persist: true,
1136
- storageKey: 'ngs-admin',
1137
- }),
1419
+ var PageTitleStrategyService = class PageTitleStrategyService extends TitleStrategy {
1420
+ _title = inject(Title);
1421
+ _globalStore = inject(GlobalStore);
1422
+ _environmentService = inject(EnvironmentService);
1423
+ updateTitle(routerState) {
1424
+ const title = this.cleanTitle(this.buildTitle(routerState));
1425
+ const pageTitle = this.cleanTitle(this._globalStore.pageTitle()) || this.cleanTitle(this._environmentService.getValue("pageTitle"));
1426
+ const currentTitle = this.cleanTitle(this._title.getTitle());
1427
+ const nextTitle = title && pageTitle ? `${title} | ${pageTitle}` : title || pageTitle || currentTitle;
1428
+ if (nextTitle) this._title.setTitle(nextTitle);
1429
+ }
1430
+ cleanTitle(title) {
1431
+ if (!title) return null;
1432
+ return title.split("/").map((part) => part.trim()).filter((part) => part && part.toLowerCase() !== "undefined").join(" - ").trim() || null;
1433
+ }
1434
+ static ɵfac = i0.ɵɵngDeclareFactory({
1435
+ minVersion: "12.0.0",
1436
+ version: "22.3.0",
1437
+ ngImport: i0,
1438
+ type: PageTitleStrategyService,
1439
+ deps: null,
1440
+ target: i0.ɵɵFactoryTarget.Injectable
1441
+ });
1442
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1443
+ minVersion: "12.0.0",
1444
+ version: "22.3.0",
1445
+ ngImport: i0,
1446
+ type: PageTitleStrategyService,
1447
+ providedIn: "root"
1448
+ });
1449
+ };
1450
+ i0.ɵɵngDeclareClassMetadata({
1451
+ minVersion: "12.0.0",
1452
+ version: "22.3.0",
1453
+ ngImport: i0,
1454
+ type: PageTitleStrategyService,
1455
+ decorators: [{
1456
+ type: Injectable,
1457
+ args: [{ providedIn: "root" }]
1458
+ }]
1459
+ });
1460
+ var ScreenLoaderService = class ScreenLoaderService {
1461
+ _globalStore = inject(GlobalStore);
1462
+ show() {
1463
+ this._globalStore.setScreenLoading(true);
1464
+ }
1465
+ hide() {
1466
+ this._globalStore.setScreenLoading(false);
1467
+ }
1468
+ static ɵfac = i0.ɵɵngDeclareFactory({
1469
+ minVersion: "12.0.0",
1470
+ version: "22.3.0",
1471
+ ngImport: i0,
1472
+ type: ScreenLoaderService,
1473
+ deps: [],
1474
+ target: i0.ɵɵFactoryTarget.Injectable
1475
+ });
1476
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1477
+ minVersion: "12.0.0",
1478
+ version: "22.3.0",
1479
+ ngImport: i0,
1480
+ type: ScreenLoaderService,
1481
+ providedIn: "root"
1482
+ });
1483
+ };
1484
+ i0.ɵɵngDeclareClassMetadata({
1485
+ minVersion: "12.0.0",
1486
+ version: "22.3.0",
1487
+ ngImport: i0,
1488
+ type: ScreenLoaderService,
1489
+ decorators: [{
1490
+ type: Injectable,
1491
+ args: [{ providedIn: "root" }]
1492
+ }]
1493
+ });
1494
+ var SeoService = class SeoService {
1495
+ _router = inject(Router);
1496
+ _destroyRef = inject(DestroyRef);
1497
+ _document = inject(DOCUMENT);
1498
+ _platformId = inject(PLATFORM_ID);
1499
+ _linkCanonical;
1500
+ _title = inject(Title);
1501
+ _meta = inject(Meta);
1502
+ _globalStore = inject(GlobalStore);
1503
+ get meta() {
1504
+ return this._meta;
1505
+ }
1506
+ updateDescription(content) {
1507
+ if (!content) return;
1508
+ this.meta.updateTag({
1509
+ name: "description",
1510
+ content
1511
+ });
1512
+ this.meta.updateTag({
1513
+ name: "og:description",
1514
+ content
1515
+ });
1516
+ }
1517
+ updateOgUrl(content) {
1518
+ if (!content) return;
1519
+ this.meta.updateTag({
1520
+ name: "og:url",
1521
+ content
1522
+ });
1523
+ }
1524
+ updateOgImage(content) {
1525
+ if (!content) return;
1526
+ this.meta.updateTag({
1527
+ name: "og:image",
1528
+ content
1529
+ });
1530
+ }
1531
+ trackCanonicalChanges(siteUrl) {
1532
+ this._createCanonicalTag(siteUrl);
1533
+ if (isPlatformServer(this._platformId)) return;
1534
+ this._router.events.pipe(filter((event) => event instanceof NavigationEnd), takeUntilDestroyed(this._destroyRef)).subscribe(() => {
1535
+ const href = this.getCanonicalUrl(siteUrl);
1536
+ this._linkCanonical?.setAttribute("href", href);
1537
+ this.updateOgUrl(href);
1538
+ });
1539
+ }
1540
+ updateTitle(title) {
1541
+ this._title.setTitle(`${title} | ${this._globalStore.pageTitle()}`);
1542
+ this.meta.updateTag({
1543
+ name: "og:title",
1544
+ content: title
1545
+ });
1546
+ }
1547
+ getCanonicalUrl(siteUrl) {
1548
+ if (this._document.URL.startsWith("http")) return this._document.URL;
1549
+ return siteUrl + this._document.URL;
1550
+ }
1551
+ _createCanonicalTag(siteUrl) {
1552
+ this._linkCanonical = this._document.querySelector("link[rel=\"canonical\"]");
1553
+ if (!this._linkCanonical) {
1554
+ this._linkCanonical = this._document.createElement("link");
1555
+ this._linkCanonical.setAttribute("rel", "canonical");
1556
+ this._document.head.appendChild(this._linkCanonical);
1557
+ }
1558
+ this._linkCanonical.setAttribute("href", this.getCanonicalUrl(siteUrl));
1559
+ }
1560
+ static ɵfac = i0.ɵɵngDeclareFactory({
1561
+ minVersion: "12.0.0",
1562
+ version: "22.3.0",
1563
+ ngImport: i0,
1564
+ type: SeoService,
1565
+ deps: [],
1566
+ target: i0.ɵɵFactoryTarget.Injectable
1567
+ });
1568
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1569
+ minVersion: "12.0.0",
1570
+ version: "22.3.0",
1571
+ ngImport: i0,
1572
+ type: SeoService,
1573
+ providedIn: "root"
1574
+ });
1575
+ };
1576
+ i0.ɵɵngDeclareClassMetadata({
1577
+ minVersion: "12.0.0",
1578
+ version: "22.3.0",
1579
+ ngImport: i0,
1580
+ type: SeoService,
1581
+ decorators: [{
1582
+ type: Injectable,
1583
+ args: [{ providedIn: "root" }]
1584
+ }]
1138
1585
  });
1586
+ const NGS_THEME_OPTIONS = new InjectionToken("NGS_THEME_OPTIONS", { factory: () => ({
1587
+ theme: "default",
1588
+ colorScheme: "auto",
1589
+ colorPreset: "default",
1590
+ persist: true,
1591
+ storageKey: "ngs-admin"
1592
+ }) });
1139
1593
  function provideNgsTheme(options = {}) {
1140
- return {
1141
- provide: NGS_THEME_OPTIONS,
1142
- useValue: {
1143
- theme: 'default',
1144
- colorScheme: 'auto',
1145
- colorPreset: 'default',
1146
- persist: true,
1147
- storageKey: 'ngs-admin',
1148
- ...options,
1149
- },
1150
- };
1151
- }
1152
-
1153
- class ThemeManagerService {
1154
- _document = inject(DOCUMENT);
1155
- _window = this._document.defaultView;
1156
- _options = inject(NGS_THEME_OPTIONS);
1157
- _theme = signal('default', /* @ts-ignore */
1158
- ...(ngDevMode ? [{ debugName: "_theme" }] : /* istanbul ignore next */ []));
1159
- _selectedColorScheme = signal('auto', /* @ts-ignore */
1160
- ...(ngDevMode ? [{ debugName: "_selectedColorScheme" }] : /* istanbul ignore next */ []));
1161
- _colorScheme = signal('light', /* @ts-ignore */
1162
- ...(ngDevMode ? [{ debugName: "_colorScheme" }] : /* istanbul ignore next */ []));
1163
- _colorPreset = signal('default', /* @ts-ignore */
1164
- ...(ngDevMode ? [{ debugName: "_colorPreset" }] : /* istanbul ignore next */ []));
1165
- theme = this._theme.asReadonly();
1166
- selectedColorScheme = this._selectedColorScheme.asReadonly();
1167
- colorScheme = this._colorScheme.asReadonly();
1168
- colorPreset = this._colorPreset.asReadonly();
1169
- constructor() {
1170
- this.applyTheme(this._getInitialState());
1171
- effect(() => {
1172
- this._syncDocumentAttributes();
1173
- });
1174
- afterNextRender(() => {
1175
- if (this._window !== null && this._window.matchMedia) {
1176
- this._window
1177
- .matchMedia('(prefers-color-scheme: dark)')
1178
- .addEventListener('change', () => {
1179
- if (this._selectedColorScheme() === 'auto') {
1180
- this.setColorScheme('auto', false);
1181
- }
1182
- });
1183
- }
1184
- });
1185
- }
1186
- getColorScheme() {
1187
- return this._colorScheme();
1188
- }
1189
- toggleColorScheme() {
1190
- if (this._colorScheme() === 'dark') {
1191
- this.changeColorScheme('light');
1192
- }
1193
- else {
1194
- this.changeColorScheme('dark');
1195
- }
1196
- }
1197
- changeColorScheme(colorScheme) {
1198
- this.setColorScheme(colorScheme);
1199
- }
1200
- setTheme(theme = 'default', persist = true) {
1201
- this._theme.set(theme);
1202
- this._persist({ theme }, persist);
1203
- }
1204
- setColorPreset(_colorPreset = 'default', persist = true) {
1205
- this._colorPreset.set('default');
1206
- this._persist({ colorPreset: 'default' }, persist);
1207
- }
1208
- applyTheme(options, persist = false) {
1209
- const theme = this._isThemeName(options.theme) ? options.theme : 'default';
1210
- this._theme.set(theme);
1211
- this._colorPreset.set('default');
1212
- this.setColorScheme(options.colorScheme || 'auto', persist);
1213
- this._persist({ ...options, theme, colorPreset: 'default' }, persist);
1214
- }
1215
- _getStoredColorScheme() {
1216
- return this._getStoredState().colorScheme;
1217
- }
1218
- ;
1219
- _getStoredState() {
1220
- const storage = this._getStorage();
1221
- if (!this._options.persist || storage === null) {
1222
- return {};
1223
- }
1224
- try {
1225
- const rawValue = storage.getItem(this._storageKey);
1226
- if (!rawValue) {
1227
- return {};
1228
- }
1229
- return JSON.parse(rawValue);
1230
- }
1231
- catch {
1232
- return {};
1233
- }
1234
- }
1235
- ;
1236
- _persist(state, persist = true) {
1237
- const storage = this._getStorage();
1238
- if (!persist || !this._options.persist || storage === null) {
1239
- return;
1240
- }
1241
- const meta = this._getStoredState();
1242
- try {
1243
- storage.setItem(this._storageKey, JSON.stringify({ ...meta, ...state }));
1244
- }
1245
- catch {
1246
- // Keep the active theme in memory when browser storage is unavailable.
1247
- }
1248
- }
1249
- ;
1250
- _setStoredColorScheme(colorScheme) {
1251
- this._persist({ colorScheme: colorScheme });
1252
- }
1253
- ;
1254
- getPreferredColorScheme() {
1255
- const storedTheme = this._getStoredColorScheme();
1256
- if (storedTheme === 'light' || storedTheme === 'dark') {
1257
- return storedTheme;
1258
- }
1259
- if (this._window !== null && this._window.matchMedia) {
1260
- return this._window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
1261
- }
1262
- return 'light';
1263
- }
1264
- ;
1265
- setColorScheme(colorScheme, persist = true) {
1266
- this._selectedColorScheme.set(colorScheme);
1267
- if (colorScheme === 'auto') {
1268
- this._colorScheme.set(this._getSystemColorScheme());
1269
- }
1270
- else {
1271
- this._colorScheme.set(colorScheme);
1272
- }
1273
- if (persist) {
1274
- this._setStoredColorScheme(colorScheme);
1275
- }
1276
- }
1277
- ;
1278
- _getInitialState() {
1279
- return {
1280
- ...this._options,
1281
- ...this._getStoredState(),
1282
- colorPreset: 'default',
1283
- };
1284
- }
1285
- _syncDocumentAttributes() {
1286
- const root = this._document.documentElement;
1287
- const colorPreset = this._colorPreset();
1288
- const colorScheme = this._colorScheme();
1289
- if (!root) {
1290
- return;
1291
- }
1292
- root.classList?.toggle('dark', this._colorScheme() === 'dark');
1293
- root.setAttribute('data-ngs-theme', this._theme());
1294
- root.setAttribute('data-ngs-color-scheme', colorScheme);
1295
- root.setAttribute('data-ngs-resolved-color-scheme', colorScheme);
1296
- root.setAttribute('data-ngs-color-preset', colorPreset);
1297
- }
1298
- _isThemeName(theme) {
1299
- return theme === 'default' || theme === 'chalk' || theme === 'mono';
1300
- }
1301
- get _storageKey() {
1302
- return this._options.storageKey || 'ngs-admin';
1303
- }
1304
- _getStorage() {
1305
- try {
1306
- return this._window?.localStorage ?? null;
1307
- }
1308
- catch {
1309
- return null;
1310
- }
1311
- }
1312
- _getSystemColorScheme() {
1313
- if (this._window !== null && this._window.matchMedia) {
1314
- return this._window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
1315
- }
1316
- return 'light';
1317
- }
1318
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ThemeManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1319
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ThemeManagerService, providedIn: 'root' });
1320
- }
1321
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ThemeManagerService, decorators: [{
1322
- type: Injectable,
1323
- args: [{
1324
- providedIn: 'root'
1325
- }]
1326
- }], ctorParameters: () => [] });
1327
-
1328
- class ResizeObserverService {
1329
- ngZone;
1330
- constructor(ngZone) {
1331
- this.ngZone = ngZone;
1332
- }
1333
- observe(element) {
1334
- return new Observable(observer => {
1335
- const resizeObserver = new ResizeObserver(entries => {
1336
- this.ngZone.run(() => {
1337
- observer.next(entries);
1338
- });
1339
- });
1340
- resizeObserver.observe(element);
1341
- return () => {
1342
- resizeObserver.disconnect();
1343
- };
1344
- });
1345
- }
1346
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ResizeObserverService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
1347
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ResizeObserverService, providedIn: 'root' });
1348
- }
1349
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ResizeObserverService, decorators: [{
1350
- type: Injectable,
1351
- args: [{
1352
- providedIn: 'root',
1353
- }]
1354
- }], ctorParameters: () => [{ type: i0.NgZone }] });
1355
-
1356
- class MutationObserverService {
1357
- ngZone;
1358
- constructor(ngZone) {
1359
- this.ngZone = ngZone;
1360
- }
1361
- observe(element, options) {
1362
- return new Observable(observer => {
1363
- const mutationObserver = new MutationObserver(mutations => {
1364
- this.ngZone.run(() => {
1365
- observer.next(mutations);
1366
- });
1367
- });
1368
- mutationObserver.observe(element, options);
1369
- return () => {
1370
- mutationObserver.disconnect();
1371
- };
1372
- });
1373
- }
1374
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MutationObserverService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
1375
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MutationObserverService, providedIn: 'root' });
1594
+ return {
1595
+ provide: NGS_THEME_OPTIONS,
1596
+ useValue: {
1597
+ theme: "default",
1598
+ colorScheme: "auto",
1599
+ colorPreset: "default",
1600
+ persist: true,
1601
+ storageKey: "ngs-admin",
1602
+ ...options
1603
+ }
1604
+ };
1376
1605
  }
1377
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MutationObserverService, decorators: [{
1378
- type: Injectable,
1379
- args: [{
1380
- providedIn: 'root',
1381
- }]
1382
- }], ctorParameters: () => [{ type: i0.NgZone }] });
1383
-
1606
+ var ThemeManagerService = class ThemeManagerService {
1607
+ _document = inject(DOCUMENT);
1608
+ _window = this._document.defaultView;
1609
+ _options = inject(NGS_THEME_OPTIONS);
1610
+ _theme = signal("default", ...ngDevMode ? [{ debugName: "_theme" }] : /* istanbul ignore next */ []);
1611
+ _selectedColorScheme = signal("auto", ...ngDevMode ? [{ debugName: "_selectedColorScheme" }] : /* istanbul ignore next */ []);
1612
+ _colorScheme = signal("light", ...ngDevMode ? [{ debugName: "_colorScheme" }] : /* istanbul ignore next */ []);
1613
+ _colorPreset = signal("default", ...ngDevMode ? [{ debugName: "_colorPreset" }] : /* istanbul ignore next */ []);
1614
+ theme = this._theme.asReadonly();
1615
+ selectedColorScheme = this._selectedColorScheme.asReadonly();
1616
+ colorScheme = this._colorScheme.asReadonly();
1617
+ colorPreset = this._colorPreset.asReadonly();
1618
+ constructor() {
1619
+ this.applyTheme(this._getInitialState());
1620
+ effect(() => {
1621
+ this._syncDocumentAttributes();
1622
+ });
1623
+ afterNextRender(() => {
1624
+ if (this._window !== null && this._window.matchMedia) this._window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
1625
+ if (this._selectedColorScheme() === "auto") this.setColorScheme("auto", false);
1626
+ });
1627
+ });
1628
+ }
1629
+ getColorScheme() {
1630
+ return this._colorScheme();
1631
+ }
1632
+ toggleColorScheme() {
1633
+ if (this._colorScheme() === "dark") this.changeColorScheme("light");
1634
+ else this.changeColorScheme("dark");
1635
+ }
1636
+ changeColorScheme(colorScheme) {
1637
+ this.setColorScheme(colorScheme);
1638
+ }
1639
+ setTheme(theme = "default", persist = true) {
1640
+ this._theme.set(theme);
1641
+ this._persist({ theme }, persist);
1642
+ }
1643
+ setColorPreset(_colorPreset = "default", persist = true) {
1644
+ this._colorPreset.set("default");
1645
+ this._persist({ colorPreset: "default" }, persist);
1646
+ }
1647
+ applyTheme(options, persist = false) {
1648
+ const theme = this._isThemeName(options.theme) ? options.theme : "default";
1649
+ this._theme.set(theme);
1650
+ this._colorPreset.set("default");
1651
+ this.setColorScheme(options.colorScheme || "auto", persist);
1652
+ this._persist({
1653
+ ...options,
1654
+ theme,
1655
+ colorPreset: "default"
1656
+ }, persist);
1657
+ }
1658
+ _getStoredColorScheme() {
1659
+ return this._getStoredState().colorScheme;
1660
+ }
1661
+ _getStoredState() {
1662
+ const storage = this._getStorage();
1663
+ if (!this._options.persist || storage === null) return {};
1664
+ try {
1665
+ const rawValue = storage.getItem(this._storageKey);
1666
+ if (!rawValue) return {};
1667
+ return JSON.parse(rawValue);
1668
+ } catch {
1669
+ return {};
1670
+ }
1671
+ }
1672
+ _persist(state, persist = true) {
1673
+ const storage = this._getStorage();
1674
+ if (!persist || !this._options.persist || storage === null) return;
1675
+ const meta = this._getStoredState();
1676
+ try {
1677
+ storage.setItem(this._storageKey, JSON.stringify({
1678
+ ...meta,
1679
+ ...state
1680
+ }));
1681
+ } catch {}
1682
+ }
1683
+ _setStoredColorScheme(colorScheme) {
1684
+ this._persist({ colorScheme });
1685
+ }
1686
+ getPreferredColorScheme() {
1687
+ const storedTheme = this._getStoredColorScheme();
1688
+ if (storedTheme === "light" || storedTheme === "dark") return storedTheme;
1689
+ if (this._window !== null && this._window.matchMedia) return this._window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
1690
+ return "light";
1691
+ }
1692
+ setColorScheme(colorScheme, persist = true) {
1693
+ this._selectedColorScheme.set(colorScheme);
1694
+ if (colorScheme === "auto") this._colorScheme.set(this._getSystemColorScheme());
1695
+ else this._colorScheme.set(colorScheme);
1696
+ if (persist) this._setStoredColorScheme(colorScheme);
1697
+ }
1698
+ _getInitialState() {
1699
+ return {
1700
+ ...this._options,
1701
+ ...this._getStoredState(),
1702
+ colorPreset: "default"
1703
+ };
1704
+ }
1705
+ _syncDocumentAttributes() {
1706
+ const root = this._document.documentElement;
1707
+ const colorPreset = this._colorPreset();
1708
+ const colorScheme = this._colorScheme();
1709
+ if (!root) return;
1710
+ root.classList?.toggle("dark", this._colorScheme() === "dark");
1711
+ root.setAttribute("data-ngs-theme", this._theme());
1712
+ root.setAttribute("data-ngs-color-scheme", colorScheme);
1713
+ root.setAttribute("data-ngs-resolved-color-scheme", colorScheme);
1714
+ root.setAttribute("data-ngs-color-preset", colorPreset);
1715
+ }
1716
+ _isThemeName(theme) {
1717
+ return theme === "default" || theme === "chalk" || theme === "mono";
1718
+ }
1719
+ get _storageKey() {
1720
+ return this._options.storageKey || "ngs-admin";
1721
+ }
1722
+ _getStorage() {
1723
+ try {
1724
+ return this._window?.localStorage ?? null;
1725
+ } catch {
1726
+ return null;
1727
+ }
1728
+ }
1729
+ _getSystemColorScheme() {
1730
+ if (this._window !== null && this._window.matchMedia) return this._window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
1731
+ return "light";
1732
+ }
1733
+ static ɵfac = i0.ɵɵngDeclareFactory({
1734
+ minVersion: "12.0.0",
1735
+ version: "22.3.0",
1736
+ ngImport: i0,
1737
+ type: ThemeManagerService,
1738
+ deps: [],
1739
+ target: i0.ɵɵFactoryTarget.Injectable
1740
+ });
1741
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1742
+ minVersion: "12.0.0",
1743
+ version: "22.3.0",
1744
+ ngImport: i0,
1745
+ type: ThemeManagerService,
1746
+ providedIn: "root"
1747
+ });
1748
+ };
1749
+ i0.ɵɵngDeclareClassMetadata({
1750
+ minVersion: "12.0.0",
1751
+ version: "22.3.0",
1752
+ ngImport: i0,
1753
+ type: ThemeManagerService,
1754
+ decorators: [{
1755
+ type: Injectable,
1756
+ args: [{ providedIn: "root" }]
1757
+ }],
1758
+ ctorParameters: () => []
1759
+ });
1760
+ var ResizeObserverService = class ResizeObserverService {
1761
+ ngZone;
1762
+ constructor(ngZone) {
1763
+ this.ngZone = ngZone;
1764
+ }
1765
+ observe(element) {
1766
+ return new Observable((observer) => {
1767
+ const resizeObserver = new ResizeObserver((entries) => {
1768
+ this.ngZone.run(() => {
1769
+ observer.next(entries);
1770
+ });
1771
+ });
1772
+ resizeObserver.observe(element);
1773
+ return () => {
1774
+ resizeObserver.disconnect();
1775
+ };
1776
+ });
1777
+ }
1778
+ static ɵfac = i0.ɵɵngDeclareFactory({
1779
+ minVersion: "12.0.0",
1780
+ version: "22.3.0",
1781
+ ngImport: i0,
1782
+ type: ResizeObserverService,
1783
+ deps: [{ token: i0.NgZone }],
1784
+ target: i0.ɵɵFactoryTarget.Injectable
1785
+ });
1786
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1787
+ minVersion: "12.0.0",
1788
+ version: "22.3.0",
1789
+ ngImport: i0,
1790
+ type: ResizeObserverService,
1791
+ providedIn: "root"
1792
+ });
1793
+ };
1794
+ i0.ɵɵngDeclareClassMetadata({
1795
+ minVersion: "12.0.0",
1796
+ version: "22.3.0",
1797
+ ngImport: i0,
1798
+ type: ResizeObserverService,
1799
+ decorators: [{
1800
+ type: Injectable,
1801
+ args: [{ providedIn: "root" }]
1802
+ }],
1803
+ ctorParameters: () => [{ type: i0.NgZone }]
1804
+ });
1805
+ var MutationObserverService = class MutationObserverService {
1806
+ ngZone;
1807
+ constructor(ngZone) {
1808
+ this.ngZone = ngZone;
1809
+ }
1810
+ observe(element, options) {
1811
+ return new Observable((observer) => {
1812
+ const mutationObserver = new MutationObserver((mutations) => {
1813
+ this.ngZone.run(() => {
1814
+ observer.next(mutations);
1815
+ });
1816
+ });
1817
+ mutationObserver.observe(element, options);
1818
+ return () => {
1819
+ mutationObserver.disconnect();
1820
+ };
1821
+ });
1822
+ }
1823
+ static ɵfac = i0.ɵɵngDeclareFactory({
1824
+ minVersion: "12.0.0",
1825
+ version: "22.3.0",
1826
+ ngImport: i0,
1827
+ type: MutationObserverService,
1828
+ deps: [{ token: i0.NgZone }],
1829
+ target: i0.ɵɵFactoryTarget.Injectable
1830
+ });
1831
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1832
+ minVersion: "12.0.0",
1833
+ version: "22.3.0",
1834
+ ngImport: i0,
1835
+ type: MutationObserverService,
1836
+ providedIn: "root"
1837
+ });
1838
+ };
1839
+ i0.ɵɵngDeclareClassMetadata({
1840
+ minVersion: "12.0.0",
1841
+ version: "22.3.0",
1842
+ ngImport: i0,
1843
+ type: MutationObserverService,
1844
+ decorators: [{
1845
+ type: Injectable,
1846
+ args: [{ providedIn: "root" }]
1847
+ }],
1848
+ ctorParameters: () => [{ type: i0.NgZone }]
1849
+ });
1384
1850
  function presetProperties(scheme) {
1385
- return {
1386
- '--ngs-color-primary-seed': scheme.primary,
1387
- '--ngs-color-primary': scheme.primary,
1388
- '--ngs-color-on-primary': scheme.onPrimary,
1389
- '--ngs-color-primary-container': scheme.primaryContainer,
1390
- '--ngs-color-on-primary-container': scheme.onPrimaryContainer,
1391
- '--ngs-color-secondary': scheme.secondary,
1392
- '--ngs-color-on-secondary': scheme.onSecondary,
1393
- '--ngs-color-secondary-container': scheme.secondaryContainer,
1394
- '--ngs-color-on-secondary-container': scheme.onSecondaryContainer,
1395
- '--ngs-color-tertiary': scheme.tertiary,
1396
- '--ngs-color-on-tertiary': scheme.onTertiary,
1397
- '--ngs-color-tertiary-container': scheme.tertiaryContainer,
1398
- '--ngs-color-on-tertiary-container': scheme.onTertiaryContainer,
1399
- '--ngs-color-info': scheme.info,
1400
- '--ngs-color-on-info': scheme.onInfo,
1401
- '--ngs-color-info-container': scheme.infoContainer,
1402
- '--ngs-color-on-info-container': scheme.onInfoContainer,
1403
- '--ngs-state-selected-bg': 'var(--ngs-color-surface-container-highest)',
1404
- '--ngs-state-selected-color': 'var(--ngs-color-on-surface)',
1405
- '--ngs-state-focus-ring': scheme.focusRing,
1406
- '--ngs-color-primary-100': scheme.primaryScale[0],
1407
- '--ngs-color-primary-200': scheme.primaryScale[1],
1408
- '--ngs-color-primary-300': scheme.primaryScale[2],
1409
- '--ngs-color-primary-400': scheme.primaryScale[3],
1410
- '--ngs-color-primary-500': scheme.primaryScale[4],
1411
- '--ngs-color-primary-600': scheme.primaryScale[5],
1412
- '--ngs-color-secondary-100': scheme.secondaryScale[0],
1413
- '--ngs-color-secondary-200': scheme.secondaryScale[1],
1414
- '--ngs-color-secondary-300': scheme.secondaryScale[2],
1415
- '--ngs-color-secondary-400': scheme.secondaryScale[3],
1416
- '--ngs-color-secondary-fixed': scheme.secondaryContainer,
1417
- '--ngs-color-on-secondary-fixed': scheme.onSecondaryContainer,
1418
- '--ngs-color-tertiary-100': scheme.tertiaryScale[0],
1419
- '--ngs-color-tertiary-200': scheme.tertiaryScale[1],
1420
- '--ngs-color-tertiary-300': scheme.tertiaryScale[2],
1421
- '--ngs-color-tertiary-700': scheme.tertiaryScale[3],
1422
- '--ngs-color-tertiary-800': scheme.tertiaryScale[4],
1423
- '--ngs-button-tonal-bg': scheme.secondaryContainer,
1424
- '--ngs-button-tonal-color': scheme.onSecondaryContainer,
1425
- '--ngs-button-outlined-border': scheme.outlinedButtonBorder,
1426
- '--ngs-field-border-focus-color': scheme.primary,
1427
- '--ngs-dropdown-item-selected-bg': 'var(--ngs-color-surface-container-highest)',
1428
- '--ngs-dropdown-item-selected-color': 'var(--ngs-color-on-surface)',
1429
- '--ngs-nav-item-active-color': 'var(--ngs-color-on-surface)',
1430
- '--ngs-nav-item-active-bg': 'var(--ngs-color-surface-container-highest)',
1431
- '--ngs-nav-item-active-icon-color': scheme.primary,
1432
- };
1851
+ return {
1852
+ "--ngs-color-primary-seed": scheme.primary,
1853
+ "--ngs-color-primary": scheme.primary,
1854
+ "--ngs-color-on-primary": scheme.onPrimary,
1855
+ "--ngs-color-primary-container": scheme.primaryContainer,
1856
+ "--ngs-color-on-primary-container": scheme.onPrimaryContainer,
1857
+ "--ngs-color-secondary": scheme.secondary,
1858
+ "--ngs-color-on-secondary": scheme.onSecondary,
1859
+ "--ngs-color-secondary-container": scheme.secondaryContainer,
1860
+ "--ngs-color-on-secondary-container": scheme.onSecondaryContainer,
1861
+ "--ngs-color-tertiary": scheme.tertiary,
1862
+ "--ngs-color-on-tertiary": scheme.onTertiary,
1863
+ "--ngs-color-tertiary-container": scheme.tertiaryContainer,
1864
+ "--ngs-color-on-tertiary-container": scheme.onTertiaryContainer,
1865
+ "--ngs-color-info": scheme.info,
1866
+ "--ngs-color-on-info": scheme.onInfo,
1867
+ "--ngs-color-info-container": scheme.infoContainer,
1868
+ "--ngs-color-on-info-container": scheme.onInfoContainer,
1869
+ "--ngs-state-selected-bg": "var(--ngs-color-surface-container-highest)",
1870
+ "--ngs-state-selected-color": "var(--ngs-color-on-surface)",
1871
+ "--ngs-state-focus-ring": scheme.focusRing,
1872
+ "--ngs-color-primary-100": scheme.primaryScale[0],
1873
+ "--ngs-color-primary-200": scheme.primaryScale[1],
1874
+ "--ngs-color-primary-300": scheme.primaryScale[2],
1875
+ "--ngs-color-primary-400": scheme.primaryScale[3],
1876
+ "--ngs-color-primary-500": scheme.primaryScale[4],
1877
+ "--ngs-color-primary-600": scheme.primaryScale[5],
1878
+ "--ngs-color-secondary-100": scheme.secondaryScale[0],
1879
+ "--ngs-color-secondary-200": scheme.secondaryScale[1],
1880
+ "--ngs-color-secondary-300": scheme.secondaryScale[2],
1881
+ "--ngs-color-secondary-400": scheme.secondaryScale[3],
1882
+ "--ngs-color-secondary-fixed": scheme.secondaryContainer,
1883
+ "--ngs-color-on-secondary-fixed": scheme.onSecondaryContainer,
1884
+ "--ngs-color-tertiary-100": scheme.tertiaryScale[0],
1885
+ "--ngs-color-tertiary-200": scheme.tertiaryScale[1],
1886
+ "--ngs-color-tertiary-300": scheme.tertiaryScale[2],
1887
+ "--ngs-color-tertiary-700": scheme.tertiaryScale[3],
1888
+ "--ngs-color-tertiary-800": scheme.tertiaryScale[4],
1889
+ "--ngs-button-tonal-bg": scheme.secondaryContainer,
1890
+ "--ngs-button-tonal-color": scheme.onSecondaryContainer,
1891
+ "--ngs-button-outlined-border": scheme.outlinedButtonBorder,
1892
+ "--ngs-field-border-focus-color": scheme.primary,
1893
+ "--ngs-dropdown-item-selected-bg": "var(--ngs-color-surface-container-highest)",
1894
+ "--ngs-dropdown-item-selected-color": "var(--ngs-color-on-surface)",
1895
+ "--ngs-nav-item-active-color": "var(--ngs-color-on-surface)",
1896
+ "--ngs-nav-item-active-bg": "var(--ngs-color-surface-container-highest)",
1897
+ "--ngs-nav-item-active-icon-color": scheme.primary
1898
+ };
1433
1899
  }
1434
1900
  const defaultPreset = {
1435
- id: 'default',
1436
- label: 'Default',
1437
- swatch: '#245bff',
1438
- light: presetProperties({
1439
- primary: '#245bff', onPrimary: '#ffffff', primaryContainer: '#e9efff', onPrimaryContainer: '#173a9f',
1440
- secondary: '#60718e', onSecondary: '#ffffff', secondaryContainer: '#f0f3f7', onSecondaryContainer: '#29364e',
1441
- tertiary: '#29364e', onTertiary: '#ffffff', tertiaryContainer: '#edf2ff', onTertiaryContainer: '#173a9f',
1442
- info: '#245bff', onInfo: '#ffffff', infoContainer: '#e9efff', onInfoContainer: '#173a9f', focusRing: '#8caaff',
1443
- outlinedButtonBorder: '#60718e',
1444
- primaryScale: ['#f2f5ff', '#e9efff', '#dce6ff', '#bfd0ff', '#8caaff', '#245bff'],
1445
- secondaryScale: ['#fbfcfe', '#f7f9fc', '#f0f3f7', '#dce2eb'],
1446
- tertiaryScale: ['#f7f9fc', '#f3f5f7', '#edf2ff', '#29364e', '#1a2942'],
1447
- }),
1448
- dark: presetProperties({
1449
- primary: '#8caaff', onPrimary: '#08142c', primaryContainer: '#173a9f', onPrimaryContainer: '#e9efff',
1450
- secondary: '#b9c4d3', onSecondary: '#0b1427', secondaryContainer: '#29364e', onSecondaryContainer: '#f0f3f7',
1451
- tertiary: '#aab7c9', onTertiary: '#0b1427', tertiaryContainer: '#29364e', onTertiaryContainer: '#f7f9fc',
1452
- info: '#8caaff', onInfo: '#08142c', infoContainer: '#173a9f', onInfoContainer: '#e9efff', focusRing: '#8caaff',
1453
- outlinedButtonBorder: '#aab7c9',
1454
- primaryScale: ['#111d35', '#17284f', '#173a9f', '#245bff', '#5680ff', '#8caaff'],
1455
- secondaryScale: ['#172033', '#202b40', '#29364e', '#455571'],
1456
- tertiaryScale: ['#172033', '#202b40', '#29364e', '#b9c4d3', '#dce2eb'],
1457
- }),
1901
+ id: "default",
1902
+ label: "Default",
1903
+ swatch: "#245bff",
1904
+ light: presetProperties({
1905
+ primary: "#245bff",
1906
+ onPrimary: "#ffffff",
1907
+ primaryContainer: "#e9efff",
1908
+ onPrimaryContainer: "#173a9f",
1909
+ secondary: "#60718e",
1910
+ onSecondary: "#ffffff",
1911
+ secondaryContainer: "#f0f3f7",
1912
+ onSecondaryContainer: "#29364e",
1913
+ tertiary: "#29364e",
1914
+ onTertiary: "#ffffff",
1915
+ tertiaryContainer: "#edf2ff",
1916
+ onTertiaryContainer: "#173a9f",
1917
+ info: "#245bff",
1918
+ onInfo: "#ffffff",
1919
+ infoContainer: "#e9efff",
1920
+ onInfoContainer: "#173a9f",
1921
+ focusRing: "#8caaff",
1922
+ outlinedButtonBorder: "#60718e",
1923
+ primaryScale: [
1924
+ "#f2f5ff",
1925
+ "#e9efff",
1926
+ "#dce6ff",
1927
+ "#bfd0ff",
1928
+ "#8caaff",
1929
+ "#245bff"
1930
+ ],
1931
+ secondaryScale: [
1932
+ "#fbfcfe",
1933
+ "#f7f9fc",
1934
+ "#f0f3f7",
1935
+ "#dce2eb"
1936
+ ],
1937
+ tertiaryScale: [
1938
+ "#f7f9fc",
1939
+ "#f3f5f7",
1940
+ "#edf2ff",
1941
+ "#29364e",
1942
+ "#1a2942"
1943
+ ]
1944
+ }),
1945
+ dark: presetProperties({
1946
+ primary: "#8caaff",
1947
+ onPrimary: "#08142c",
1948
+ primaryContainer: "#173a9f",
1949
+ onPrimaryContainer: "#e9efff",
1950
+ secondary: "#b9c4d3",
1951
+ onSecondary: "#0b1427",
1952
+ secondaryContainer: "#29364e",
1953
+ onSecondaryContainer: "#f0f3f7",
1954
+ tertiary: "#aab7c9",
1955
+ onTertiary: "#0b1427",
1956
+ tertiaryContainer: "#29364e",
1957
+ onTertiaryContainer: "#f7f9fc",
1958
+ info: "#8caaff",
1959
+ onInfo: "#08142c",
1960
+ infoContainer: "#173a9f",
1961
+ onInfoContainer: "#e9efff",
1962
+ focusRing: "#8caaff",
1963
+ outlinedButtonBorder: "#aab7c9",
1964
+ primaryScale: [
1965
+ "#111d35",
1966
+ "#17284f",
1967
+ "#173a9f",
1968
+ "#245bff",
1969
+ "#5680ff",
1970
+ "#8caaff"
1971
+ ],
1972
+ secondaryScale: [
1973
+ "#172033",
1974
+ "#202b40",
1975
+ "#29364e",
1976
+ "#455571"
1977
+ ],
1978
+ tertiaryScale: [
1979
+ "#172033",
1980
+ "#202b40",
1981
+ "#29364e",
1982
+ "#b9c4d3",
1983
+ "#dce2eb"
1984
+ ]
1985
+ })
1458
1986
  };
1459
1987
  const NGS_THEME_COLOR_PRESETS = [defaultPreset];
1460
- const NGS_THEME_COLOR_PRESET_IDS = ['default'];
1988
+ const NGS_THEME_COLOR_PRESET_IDS = ["default"];
1461
1989
  const NGS_THEME_PRESET_PROPERTY_NAMES = Object.keys(defaultPreset.light);
1462
- function getNgsThemePreset(_preset = 'default') {
1463
- return defaultPreset;
1990
+ function getNgsThemePreset(_preset = "default") {
1991
+ return defaultPreset;
1464
1992
  }
1465
- function getNgsThemePresetProperties(preset = 'default', colorScheme = 'light') {
1466
- return { ...getNgsThemePreset(preset)[colorScheme] };
1993
+ function getNgsThemePresetProperties(preset = "default", colorScheme = "light") {
1994
+ return { ...getNgsThemePreset(preset)[colorScheme] };
1467
1995
  }
1468
- function getNgsThemePresetCssText(preset = 'default', colorScheme = 'light') {
1469
- return Object.entries(getNgsThemePresetProperties(preset, colorScheme))
1470
- .map(([name, value]) => `${name}: ${value};`)
1471
- .join('\n');
1996
+ function getNgsThemePresetCssText(preset = "default", colorScheme = "light") {
1997
+ return Object.entries(getNgsThemePresetProperties(preset, colorScheme)).map(([name, value]) => `${name}: ${value};`).join("\n");
1472
1998
  }
1473
-
1474
- /** Mirrors NgStarter tokens into a detached overlay and follows ancestor theme changes. */
1475
1999
  function bindNgsOverlayTheme(source, target) {
1476
- const view = source.ownerDocument.defaultView;
1477
- if (!view || target.contains(source))
1478
- return () => { };
1479
- const previous = new Map();
1480
- const apply = () => {
1481
- const styles = view.getComputedStyle(source);
1482
- const current = new Set();
1483
- for (let index = 0; index < styles.length; index++) {
1484
- const name = styles.item(index);
1485
- if (!name.startsWith('--ngs-'))
1486
- continue;
1487
- current.add(name);
1488
- if (!previous.has(name))
1489
- previous.set(name, target.style.getPropertyValue(name));
1490
- target.style.setProperty(name, styles.getPropertyValue(name));
1491
- }
1492
- for (const [name, value] of previous)
1493
- if (!current.has(name)) {
1494
- if (value)
1495
- target.style.setProperty(name, value);
1496
- else
1497
- target.style.removeProperty(name);
1498
- }
1499
- };
1500
- apply();
1501
- const observer = new MutationObserver(apply);
1502
- for (let ancestor = source; ancestor; ancestor = ancestor.parentElement) {
1503
- observer.observe(ancestor, { attributes: true, attributeFilter: ['style', 'class', 'data-ngs-theme', 'data-ngs-color-scheme', 'data-ngs-density', 'data-ngs-radius'] });
1504
- }
1505
- const media = view.matchMedia('(prefers-color-scheme: dark)');
1506
- media.addEventListener('change', apply);
1507
- return () => {
1508
- observer.disconnect();
1509
- media.removeEventListener('change', apply);
1510
- for (const [name, value] of previous) {
1511
- if (value)
1512
- target.style.setProperty(name, value);
1513
- else
1514
- target.style.removeProperty(name);
1515
- }
1516
- };
1517
- }
1518
-
1519
- /** Provider for managing the error state of a form control. */
1520
- class ErrorStateMatcher {
1521
- /**
1522
- * Whether a control should be in an error state.
1523
- * @param control The form control to check.
1524
- * @param form The parent form that contains the control.
1525
- * @returns Whether the control should be in an error state.
1526
- */
1527
- isErrorState(control, form) {
1528
- return !!(control && control.invalid && (control.touched || (form && form.submitted)));
1529
- }
1530
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ErrorStateMatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1531
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ErrorStateMatcher, providedIn: 'root' });
1532
- }
1533
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ErrorStateMatcher, decorators: [{
1534
- type: Injectable,
1535
- args: [{ providedIn: 'root' }]
1536
- }] });
1537
- /** Error state matcher that displays an error when a control is dirty and invalid. */
1538
- class ShowOnDirtyErrorStateMatcher {
1539
- isErrorState(control, form) {
1540
- return !!(control && control.invalid && (control.dirty || (form && form.submitted)));
1541
- }
1542
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ShowOnDirtyErrorStateMatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1543
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ShowOnDirtyErrorStateMatcher });
2000
+ const view = source.ownerDocument.defaultView;
2001
+ if (!view || target.contains(source)) return () => {};
2002
+ const previous = /* @__PURE__ */ new Map();
2003
+ const apply = () => {
2004
+ const styles = view.getComputedStyle(source);
2005
+ const current = /* @__PURE__ */ new Set();
2006
+ for (let index = 0; index < styles.length; index++) {
2007
+ const name = styles.item(index);
2008
+ if (!name.startsWith("--ngs-")) continue;
2009
+ current.add(name);
2010
+ if (!previous.has(name)) previous.set(name, target.style.getPropertyValue(name));
2011
+ target.style.setProperty(name, styles.getPropertyValue(name));
2012
+ }
2013
+ for (const [name, value] of previous) if (!current.has(name)) {
2014
+ if (value) target.style.setProperty(name, value);
2015
+ else target.style.removeProperty(name);
2016
+ }
2017
+ };
2018
+ apply();
2019
+ const observer = new MutationObserver(apply);
2020
+ for (let ancestor = source; ancestor; ancestor = ancestor.parentElement) observer.observe(ancestor, {
2021
+ attributes: true,
2022
+ attributeFilter: [
2023
+ "style",
2024
+ "class",
2025
+ "data-ngs-theme",
2026
+ "data-ngs-color-scheme",
2027
+ "data-ngs-density",
2028
+ "data-ngs-radius"
2029
+ ]
2030
+ });
2031
+ const media = view.matchMedia("(prefers-color-scheme: dark)");
2032
+ media.addEventListener("change", apply);
2033
+ return () => {
2034
+ observer.disconnect();
2035
+ media.removeEventListener("change", apply);
2036
+ for (const [name, value] of previous) if (value) target.style.setProperty(name, value);
2037
+ else target.style.removeProperty(name);
2038
+ };
1544
2039
  }
1545
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ShowOnDirtyErrorStateMatcher, decorators: [{
1546
- type: Injectable
1547
- }] });
1548
-
2040
+ var ErrorStateMatcher = class ErrorStateMatcher {
2041
+ isErrorState(control, form) {
2042
+ return !!(control && control.invalid && (control.touched || form && form.submitted));
2043
+ }
2044
+ static ɵfac = i0.ɵɵngDeclareFactory({
2045
+ minVersion: "12.0.0",
2046
+ version: "22.3.0",
2047
+ ngImport: i0,
2048
+ type: ErrorStateMatcher,
2049
+ deps: [],
2050
+ target: i0.ɵɵFactoryTarget.Injectable
2051
+ });
2052
+ static ɵprov = i0.ɵɵngDeclareInjectable({
2053
+ minVersion: "12.0.0",
2054
+ version: "22.3.0",
2055
+ ngImport: i0,
2056
+ type: ErrorStateMatcher,
2057
+ providedIn: "root"
2058
+ });
2059
+ };
2060
+ i0.ɵɵngDeclareClassMetadata({
2061
+ minVersion: "12.0.0",
2062
+ version: "22.3.0",
2063
+ ngImport: i0,
2064
+ type: ErrorStateMatcher,
2065
+ decorators: [{
2066
+ type: Injectable,
2067
+ args: [{ providedIn: "root" }]
2068
+ }]
2069
+ });
2070
+ var ShowOnDirtyErrorStateMatcher = class ShowOnDirtyErrorStateMatcher {
2071
+ isErrorState(control, form) {
2072
+ return !!(control && control.invalid && (control.dirty || form && form.submitted));
2073
+ }
2074
+ static ɵfac = i0.ɵɵngDeclareFactory({
2075
+ minVersion: "12.0.0",
2076
+ version: "22.3.0",
2077
+ ngImport: i0,
2078
+ type: ShowOnDirtyErrorStateMatcher,
2079
+ deps: [],
2080
+ target: i0.ɵɵFactoryTarget.Injectable
2081
+ });
2082
+ static ɵprov = i0.ɵɵngDeclareInjectable({
2083
+ minVersion: "12.0.0",
2084
+ version: "22.3.0",
2085
+ ngImport: i0,
2086
+ type: ShowOnDirtyErrorStateMatcher
2087
+ });
2088
+ };
2089
+ i0.ɵɵngDeclareClassMetadata({
2090
+ minVersion: "12.0.0",
2091
+ version: "22.3.0",
2092
+ ngImport: i0,
2093
+ type: ShowOnDirtyErrorStateMatcher,
2094
+ decorators: [{ type: Injectable }]
2095
+ });
1549
2096
  function px(value) {
1550
- return `${value}px`;
2097
+ return `${value}px`;
1551
2098
  }
1552
2099
  function arrayShallowEquals(a, b) {
1553
- return a.length === b.length && a.every((item, index) => item === b[index]);
2100
+ return a.length === b.length && a.every((item, index) => item === b[index]);
1554
2101
  }
1555
-
1556
2102
  function zonefreeScheduler() {
1557
- const zone = inject(NgZone);
1558
- return {
1559
- now: () => Date.now(),
1560
- schedule: (work, delay, state) => {
1561
- return zone.runOutsideAngular(() => {
1562
- const id = setTimeout(() => work(state), delay);
1563
- return new Subscription(() => clearTimeout(id));
1564
- });
1565
- },
1566
- };
2103
+ const zone = inject(NgZone);
2104
+ return {
2105
+ now: () => Date.now(),
2106
+ schedule: (work, delay, state) => {
2107
+ return zone.runOutsideAngular(() => {
2108
+ const id = setTimeout(() => work(state), delay);
2109
+ return new Subscription(() => clearTimeout(id));
2110
+ });
2111
+ }
2112
+ };
1567
2113
  }
1568
-
1569
2114
  function typedFromEvent(target, event, options) {
1570
- return fromEvent(target, event, options);
2115
+ return fromEvent(target, event, options);
1571
2116
  }
1572
-
1573
2117
  function configure(manager, items, injector, config) {
1574
- const skip = config.skip ?? (item => !!item.disabled);
1575
- manager.withWrap(config.wrap ?? true).withHomeAndEnd(config.homeAndEnd ?? true)
1576
- .skipPredicate(skip);
1577
- if (config.typeahead !== false) {
1578
- manager.withTypeAhead();
1579
- }
1580
- // CDK preserves an item's index after reordering, but doesn't clear removed items.
1581
- const reconciliation = effect(() => {
1582
- const currentItems = items();
1583
- const active = manager.activeItem;
1584
- const unavailable = active && (!currentItems.includes(active) || skip(active));
1585
- if (unavailable) {
1586
- untracked(() => manager.setActiveItem(-1));
1587
- }
1588
- }, { ...(ngDevMode ? { debugName: "reconciliation" } : /* istanbul ignore next */ {}), injector });
1589
- const destroy = manager.destroy.bind(manager);
1590
- manager.destroy = () => {
1591
- reconciliation.destroy();
1592
- destroy();
1593
- };
1594
- return manager;
2118
+ const skip = config.skip ?? ((item) => !!item.disabled);
2119
+ manager.withWrap(config.wrap ?? true).withHomeAndEnd(config.homeAndEnd ?? true).skipPredicate(skip);
2120
+ if (config.typeahead !== false) manager.withTypeAhead();
2121
+ const reconciliation = effect(() => {
2122
+ const currentItems = items();
2123
+ const active = manager.activeItem;
2124
+ if (active && (!currentItems.includes(active) || skip(active))) untracked(() => manager.setActiveItem(-1));
2125
+ }, {
2126
+ ...ngDevMode ? { debugName: "reconciliation" } : /* istanbul ignore next */ {},
2127
+ injector
2128
+ });
2129
+ const destroy = manager.destroy.bind(manager);
2130
+ manager.destroy = () => {
2131
+ reconciliation.destroy();
2132
+ destroy();
2133
+ };
2134
+ return manager;
1595
2135
  }
1596
- /** Navigation for listbox popups whose DOM focus stays on the combobox. */
1597
2136
  function createDropdownActiveDescendantKeyManager(items, injector, config = {}) {
1598
- return configure(new ActiveDescendantKeyManager(items, injector), items, injector, config);
2137
+ return configure(new ActiveDescendantKeyManager(items, injector), items, injector, config);
1599
2138
  }
1600
- /** Navigation for action menus whose DOM focus moves between items. */
1601
2139
  function createDropdownFocusKeyManager(items, injector, config = {}) {
1602
- return configure(new FocusKeyManager(items, injector), items, injector, config);
2140
+ return configure(new FocusKeyManager(items, injector), items, injector, config);
1603
2141
  }
1604
- /** Hidden fallback options may preserve a value, but must never become active. */
1605
2142
  function isDropdownItemHidden(element) {
1606
- for (let current = element; current; current = current.parentElement) {
1607
- const style = getComputedStyle(current);
1608
- if (current.hidden || current.getAttribute('aria-hidden') === 'true' ||
1609
- style.display === 'none' || style.visibility === 'hidden') {
1610
- return true;
1611
- }
1612
- }
1613
- return false;
2143
+ for (let current = element; current; current = current.parentElement) {
2144
+ const style = getComputedStyle(current);
2145
+ if (current.hidden || current.getAttribute("aria-hidden") === "true" || style.display === "none" || style.visibility === "hidden") return true;
2146
+ }
2147
+ return false;
1614
2148
  }
1615
- /** Scroll only the popup's nearest scroll region, leaving the document in place. */
1616
2149
  function scrollDropdownItemIntoView(element, panel) {
1617
- let container = element.parentElement;
1618
- while (container && container !== panel && (container.scrollHeight <= container.clientHeight ||
1619
- !['auto', 'scroll'].includes(getComputedStyle(container).overflowY))) {
1620
- container = container.parentElement;
1621
- }
1622
- container ??= panel;
1623
- const itemBounds = element.getBoundingClientRect();
1624
- const bounds = container.getBoundingClientRect();
1625
- // Popup opening animations scale visual bounds, but scrollTop/clientHeight stay in layout pixels.
1626
- const scaleY = container.offsetHeight > 0 ? bounds.height / container.offsetHeight : 1;
1627
- if (scaleY <= 0) {
1628
- return;
1629
- }
1630
- const top = bounds.top + container.clientTop * scaleY;
1631
- const bottom = top + container.clientHeight * scaleY;
1632
- if (itemBounds.top < top) {
1633
- container.scrollTop += (itemBounds.top - top) / scaleY;
1634
- }
1635
- else if (itemBounds.bottom > bottom) {
1636
- container.scrollTop += (itemBounds.bottom - bottom) / scaleY;
1637
- }
2150
+ let container = element.parentElement;
2151
+ while (container && container !== panel && (container.scrollHeight <= container.clientHeight || !["auto", "scroll"].includes(getComputedStyle(container).overflowY))) container = container.parentElement;
2152
+ container ??= panel;
2153
+ const itemBounds = element.getBoundingClientRect();
2154
+ const bounds = container.getBoundingClientRect();
2155
+ const scaleY = container.offsetHeight > 0 ? bounds.height / container.offsetHeight : 1;
2156
+ if (scaleY <= 0) return;
2157
+ const top = bounds.top + container.clientTop * scaleY;
2158
+ const bottom = top + container.clientHeight * scaleY;
2159
+ if (itemBounds.top < top) container.scrollTop += (itemBounds.top - top) / scaleY;
2160
+ else if (itemBounds.bottom > bottom) container.scrollTop += (itemBounds.bottom - bottom) / scaleY;
1638
2161
  }
1639
2162
  function isDropdownTextInput(target) {
1640
- return target instanceof HTMLElement && (target.matches('input:not([type=checkbox]):not([type=radio]):not([type=button]), textarea') ||
1641
- target.isContentEditable);
2163
+ return target instanceof HTMLElement && (target.matches("input:not([type=checkbox]):not([type=radio]):not([type=button]), textarea") || target.isContentEditable);
1642
2164
  }
2165
+ export { AUTOFOCUSABLE, AnalyticsService, AutoFocusDirective, DebounceTimeDirective, ENVIRONMENT, EnvironmentService, ErrorStateMatcher, FilterByPropertyPipe, FocusElementDirective, FormatFileSizePipe, GlobalStore, InactivityTrackerService, InitialsPipe, MutationObserverService, NGS_THEME_COLOR_PRESETS, NGS_THEME_COLOR_PRESET_IDS, NGS_THEME_OPTIONS, NGS_THEME_PRESET_PROPERTY_NAMES, OrderByPipe, PageTitleStrategyService, RIPPLE_GLOBAL_OPTIONS, ResizeObserverService, Ripple, RippleRef, RippleRenderer, RippleState, SafeHtmlPipe, SafeResourceUrlPipe, ScreenLoaderService, SearchByPropertyPipe, SeoService, ShowOnDirtyErrorStateMatcher, SoundEffectDirective, TextareaAutoSize, ThemeManagerService, arrayShallowEquals, bindNgsOverlayTheme, connectLegacyNativeFormControl, createDropdownActiveDescendantKeyManager, createDropdownFocusKeyManager, defaultRippleAnimationConfig, getActualTarget, getNgsThemePreset, getNgsThemePresetCssText, getNgsThemePresetProperties, injectElement, isDropdownItemHidden, isDropdownTextInput, isElement, provideNgsTheme, px, scrollDropdownItemIntoView, typedFromEvent, zonefreeScheduler };
1643
2166
 
1644
- /**
1645
- * Generated bundle index. Do not edit.
1646
- */
1647
-
1648
- export { AUTOFOCUSABLE, AnalyticsService, AutoFocusDirective, DebounceTimeDirective, ENVIRONMENT, EnvironmentService, ErrorStateMatcher, FilterByPropertyPipe, FocusElementDirective, FormatFileSizePipe, GlobalStore, InactivityTrackerService, InitialsPipe, MutationObserverService, NGS_THEME_COLOR_PRESETS, NGS_THEME_COLOR_PRESET_IDS, NGS_THEME_OPTIONS, NGS_THEME_PRESET_PROPERTY_NAMES, OrderByPipe, PageTitleStrategyService, RIPPLE_GLOBAL_OPTIONS, ResizeObserverService, Ripple, RippleRef, RippleRenderer, RippleState, SafeHtmlPipe, SafeResourceUrlPipe, ScreenLoaderService, SearchByPropertyPipe, SeoService, ShowOnDirtyErrorStateMatcher, SoundEffectDirective, TextareaAutoSize, ThemeManagerService, arrayShallowEquals, bindNgsOverlayTheme, createDropdownActiveDescendantKeyManager, createDropdownFocusKeyManager, defaultRippleAnimationConfig, getActualTarget, getNgsThemePreset, getNgsThemePresetCssText, getNgsThemePresetProperties, injectElement, isDropdownItemHidden, isDropdownTextInput, isElement, provideNgsTheme, px, scrollDropdownItemIntoView, typedFromEvent, zonefreeScheduler };
1649
- //# sourceMappingURL=ngstarter-ui-components-core.mjs.map
2167
+ //# sourceMappingURL=ngstarter-ui-components-core.mjs.map