@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,359 +1,565 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, InjectionToken, inject, ElementRef, DOCUMENT, DestroyRef, Renderer2, computed, ChangeDetectionStrategy, Component, Injector, Directive, TemplateRef, contentChild, input } from '@angular/core';
3
- import { Overlay } from '@angular/cdk/overlay';
4
- import { ComponentPortal } from '@angular/cdk/portal';
5
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
- import { Icon } from '@ngstarter-ui/components/icon';
7
- import { ProgressSpinner } from '@ngstarter-ui/components/spinner';
8
- import { NgTemplateOutlet } from '@angular/common';
9
- import { fromEvent } from 'rxjs';
10
-
11
- class PictureRef {
12
- closed = new EventEmitter();
13
- close() {
14
- this.closed.emit();
15
- }
16
- }
17
-
18
- const IMAGE_VIEWER = new InjectionToken('IMAGE_VIEWER');
19
- const IMAGE_VIEWER_PICTURE_REF = new InjectionToken('IMAGE_VIEWER_PICTURE_REF');
20
- const IMAGE_VIEWER_PICTURE_DATA = new InjectionToken('IMAGE_VIEWER_PICTURE_DATA');
21
-
22
- class ImageViewer {
23
- elementRef = inject(ElementRef);
24
- _document = inject(DOCUMENT);
25
- _destroyRef = inject(DestroyRef);
26
- _renderer = inject(Renderer2);
27
- _startClientY = 0;
28
- _startClientX = 0;
29
- _offsetY = 0;
30
- _offsetX = 0;
31
- _tmpOffsetY = 0;
32
- _tmpOffsetX = 0;
33
- _dragging = false;
34
- pictureRef = inject(IMAGE_VIEWER_PICTURE_REF);
35
- data = inject(IMAGE_VIEWER_PICTURE_DATA);
36
- loading = true;
37
- scale = 1;
38
- image;
39
- alreadyDragged = false;
40
- scaleMin = 1;
41
- scaleMax = 1;
42
- padding = 30;
43
- scaled = computed(() => {
44
- return this.scale !== 1;
45
- }, /* @ts-ignore */
46
- ...(ngDevMode ? [{ debugName: "scaled" }] : /* istanbul ignore next */ []));
47
- hasTitle = computed(() => {
48
- return !!(this.data.title || this.data.titleTplRef);
49
- }, /* @ts-ignore */
50
- ...(ngDevMode ? [{ debugName: "hasTitle" }] : /* istanbul ignore next */ []));
51
- hasAside = computed(() => {
52
- return !!(this.data.caption || this.data.description || this.data.captionTplRef || this.data.descriptionTplRef);
53
- }, /* @ts-ignore */
54
- ...(ngDevMode ? [{ debugName: "hasAside" }] : /* istanbul ignore next */ []));
55
- onLoad(event) {
56
- this.loading = false;
57
- this.image = event.target;
58
- if (this.image.width > this.image.height) {
59
- this.scaleMax = this.image.naturalWidth / this.image.width;
60
- }
61
- else {
62
- this.scaleMax = this.image.naturalHeight / this.image.height;
63
- }
64
- const image = this.image;
65
- fromEvent(image, 'mousedown')
66
- .pipe(takeUntilDestroyed(this._destroyRef))
67
- .subscribe((event) => {
68
- if (this.scale === this.scaleMin || event.button === 2) {
69
- return;
70
- }
71
- this._dragging = true;
72
- this._startClientY = event.clientY;
73
- this._startClientX = event.clientX;
74
- });
75
- fromEvent(this._document, 'mousemove')
76
- .pipe(takeUntilDestroyed(this._destroyRef))
77
- .subscribe((event) => {
78
- if (this._dragging) {
79
- const scaleFactor = (1 / this.scale);
80
- let offsetY = (event.clientY - this._startClientY) * scaleFactor;
81
- let offsetX = (event.clientX - this._startClientX) * scaleFactor;
82
- this._transform(offsetY, offsetX);
83
- }
84
- });
85
- fromEvent(this._document, 'mouseup')
86
- .pipe(takeUntilDestroyed(this._destroyRef))
87
- .subscribe((event) => {
88
- if (this._dragging) {
89
- const element = this.elementRef.nativeElement;
90
- const elementRect = element.getBoundingClientRect();
91
- this._renderer.removeClass(element, 'dragging');
92
- this._dragging = false;
93
- let imageWidth = Math.floor(image.getBoundingClientRect().width);
94
- let imageHeight = Math.floor(image.getBoundingClientRect().height);
95
- let imageViewportWidth = this.hasAside() ? elementRect.width - 420 : elementRect.width;
96
- let imageViewportHeight = elementRect.height;
97
- if (imageWidth <= imageViewportWidth && imageHeight <= imageViewportHeight) {
98
- this._tmpOffsetY = 0;
99
- this._tmpOffsetX = 0;
100
- this._offsetY = 0;
101
- this._offsetX = 0;
102
- this._renderer.setStyle(image, 'transform', `translate(0px,0px)`);
103
- }
104
- else {
105
- const imageRect = image.getBoundingClientRect();
106
- const widthDiff = imageViewportWidth - imageWidth;
107
- const heightDiff = imageViewportHeight - imageHeight;
108
- const xPositionDiff = widthDiff / this.scale / 2;
109
- const yPositionDiff = heightDiff / this.scale / 2;
110
- if (imageRect.x > 0 && imageRect.y > 0) {
111
- this._tmpOffsetY = yPositionDiff * -1 + this.padding;
112
- this._tmpOffsetX = xPositionDiff * -1 + this.padding;
113
- }
114
- else if (imageRect.x < widthDiff && imageRect.y > 0) {
115
- this._tmpOffsetY = yPositionDiff * -1 + this.padding;
116
- this._tmpOffsetX = xPositionDiff - this.padding;
117
- }
118
- else if (imageRect.x < widthDiff && imageRect.y < heightDiff) {
119
- this._tmpOffsetY = yPositionDiff - this.padding;
120
- this._tmpOffsetX = xPositionDiff - this.padding;
121
- }
122
- else if (imageRect.x > 0 && imageRect.y < heightDiff) {
123
- this._tmpOffsetY = yPositionDiff - this.padding;
124
- this._tmpOffsetX = xPositionDiff * -1 + this.padding;
125
- }
126
- if (imageWidth < imageViewportWidth) {
127
- this._tmpOffsetX = 0;
128
- }
129
- if (imageHeight < imageViewportHeight) {
130
- this._tmpOffsetY = 0;
131
- }
132
- this._offsetY = this._tmpOffsetY;
133
- this._offsetX = this._tmpOffsetX;
134
- this._renderer.setStyle(image, 'transform', `translate(${this._tmpOffsetX}px,${this._tmpOffsetY}px)`);
135
- }
136
- }
137
- });
138
- }
139
- onBackdropClick() {
140
- this.pictureRef.close();
141
- }
142
- onPreventClick(event) {
143
- event.preventDefault();
144
- event.stopPropagation();
145
- }
146
- toggleZoom() {
147
- if (this.scale === this.scaleMin) {
148
- this.scale = this.scaleMax;
149
- }
150
- else {
151
- this.scale = this.scaleMin;
152
- this._renderer.setStyle(this.image, 'transform', `translate(0px,0px)`);
153
- this._offsetX = 0;
154
- this._offsetY = 0;
155
- this._tmpOffsetY = 0;
156
- this._tmpOffsetX = 0;
157
- }
158
- const element = this.elementRef.nativeElement;
159
- element.style.setProperty('--ngs-image-viewer-picture-scale', this.scale.toString());
160
- }
161
- onDragStart(event) {
162
- event.stopPropagation();
163
- event.preventDefault();
164
- this.alreadyDragged = true;
165
- }
166
- _transform(offsetY, offsetX) {
167
- const image = this.image;
168
- const scaleFactor = (1 / this.scale);
169
- let translateX = this._offsetX + offsetX;
170
- // let offsetStartX = ((image.width / 2) - translateX) / scaleFactor;
171
- // let offsetEndX = ((image.width / 2) + translateX) / scaleFactor;
172
- let translateY = this._offsetY + offsetY;
173
- // let offsetStartY = ((image.height / 2) - translateY) / scaleFactor;
174
- // let offsetEndY = ((image.height / 2) + translateY) / scaleFactor;
175
- // let thumbHalfWidth = 150;
176
- //
177
- // if (offsetStartX <= thumbHalfWidth && translateX > 0) {
178
- // translateX = (image.width / 2) - (thumbHalfWidth * scaleFactor);
179
- // } else if (offsetEndX <= thumbHalfWidth && translateX < 0) {
180
- // translateX = -((image.width / 2) - (thumbHalfWidth * scaleFactor));
181
- // }
182
- //
183
- // if (offsetStartY <= thumbHalfWidth && translateY > 0) {
184
- // translateY = (image.height / 2) - (thumbHalfWidth * scaleFactor);
185
- // } else if (offsetEndY <= thumbHalfWidth && translateY < 0) {
186
- // translateY = -((image.height / 2) - (thumbHalfWidth * scaleFactor));
187
- // }
188
- this._tmpOffsetY = translateY;
189
- this._tmpOffsetX = translateX;
190
- this._renderer.setStyle(image, 'transform', `translate(${translateX}px,${translateY}px)`);
191
- }
192
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageViewer, deps: [], target: i0.ɵɵFactoryTarget.Component });
193
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: ImageViewer, isStandalone: true, selector: "ngs-image-viewer", host: { properties: { "class.loading": "loading", "class.dragging": "_dragging", "class.scaled": "scale !== 1" }, classAttribute: "ngs-image-viewer" }, exportAs: ["ngsImageViewer"], ngImport: i0, template: "<div class=\"title-container\">\n @if (hasTitle()) {\n <div class=\"title\">\n @if (data.titleTplRef) {\n <ng-container [ngTemplateOutlet]=\"data.titleTplRef\" />\n } @else if (data.caption) {\n {{ data.title }}\n }\n </div>\n }\n</div>\n<div class=\"controls\" (click)=\"onPreventClick($event)\">\n <div class=\"w-max\">\n <button (click)=\"pictureRef.close()\" class=\"close\">\n <ngs-icon name=\"fluent:dismiss-24-regular\"/>\n </button>\n </div>\n <div class=\"w-max\">\n <button class=\"zoom\" (click)=\"toggleZoom()\" [disabled]=\"scaleMax === 1 || null\">\n @if (scale === this.scaleMin) {\n <ngs-icon name=\"fluent:zoom-in-24-regular\"/>\n } @else {\n <ngs-icon name=\"fluent:zoom-out-24-regular\"/>\n }\n </button>\n </div>\n</div>\n<div class=\"content\" (click)=\"onBackdropClick()\">\n <div class=\"image\" (dragstart)=\"onDragStart($event)\">\n @if (loading) {\n <div class=\"spinner\">\n <ngs-progress-spinner/>\n </div>\n }\n <img [src]=\"data.sourceUrl\" alt=\"\" (load)=\"onLoad($event)\" (click)=\"onPreventClick($event)\" class=\"img\">\n </div>\n @if (hasAside()) {\n <aside class=\"aside\" (click)=\"onPreventClick($event)\">\n <div class=\"aside-header\">\n @if (data.captionTplRef) {\n <ng-container [ngTemplateOutlet]=\"data.captionTplRef\" />\n } @else if (data.caption) {\n {{ data.caption }}\n }\n </div>\n <div class=\"aside-body\">\n <div class=\"aside-body-scroll\">\n @if (data.descriptionTplRef) {\n <ng-container [ngTemplateOutlet]=\"data.descriptionTplRef\" />\n } @else if (data.description) {\n {{ data.description }}\n }\n </div>\n </div>\n </aside>\n }\n</div>\n", styles: [":host{width:100vw;height:100vh;display:flex;flex-direction:column}:host .title-container{position:absolute;inset-inline-start:calc(var(--spacing, .25rem) * 4);top:calc(var(--spacing, .25rem) * 4);z-index:3}:host .controls{position:absolute;inset-inline-end:calc(var(--spacing, .25rem) * 4);top:calc(var(--spacing, .25rem) * 4);z-index:3;display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 4)}:host .header{position:absolute;top:0;inset-inline-start:0;inset-inline-end:0;height:calc(var(--spacing, .25rem) * 20);flex:none;padding-left:calc(var(--spacing, .25rem) * 4);padding-right:calc(var(--spacing, .25rem) * 4);z-index:3;display:flex;align-items:center;justify-content:space-between}:host .content{box-shadow:var(--ngs-shadow-sm);z-index:2;display:flex;align-items:center;justify-content:center;gap:calc(var(--spacing, .25rem) * 8);width:100vw;height:100vh}:host.scaled img{cursor:grab}:host.dragging img{cursor:grabbing}:host:has(.aside) .content{padding-inline-end:420px}:host .img{-webkit-user-select:none;user-select:none;scale:var(--ngs-image-viewer-picture-scale, 1);transition:scale .15s linear}:host:not(.dragging) img{transition:transform .15s linear,scale .15s linear}:host .title{font-weight:500;height:calc(var(--spacing, .25rem) * 10);border-radius:calc(infinity * 1px);padding-left:calc(var(--spacing, .25rem) * 4);padding-right:calc(var(--spacing, .25rem) * 4);font-size:var(--text-tiny);display:flex;align-items:center;background:var(--ngs-color-neutral-700);color:var(--ngs-color-neutral-300)}:host .close,:host .zoom{width:calc(var(--spacing, .25rem) * 10);height:calc(var(--spacing, .25rem) * 10);border-radius:calc(infinity * 1px);cursor:pointer;display:flex;flex:none;align-items:center;justify-content:center;background:var(--ngs-color-neutral-700);color:var(--ngs-color-neutral-300)}:host .close:hover,:host .zoom:hover{background:var(--ngs-color-neutral-800);color:var(--ngs-color-neutral-200)}:host .close:active,:host .zoom:active{background:var(--ngs-color-neutral-950);color:var(--ngs-color-neutral-100)}:host .aside{width:420px;position:absolute;inset-inline-end:0;top:0;bottom:0;flex:none;background:var(--ngs-color-neutral-50);display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 5);height:100%;padding-inline-end:calc(var(--spacing, .25rem) * 10)}:host .aside-header{font-weight:700;padding-left:calc(var(--spacing, .25rem) * 8);padding-right:calc(var(--spacing, .25rem) * 8);padding-top:calc(var(--spacing, .25rem) * 8)}:host .aside-body{position:relative;flex-grow:1;font-size:var(--ngs-font-size-sm);color:var(--ngs-color-neutral-600);line-height:var(--leading-relaxed)}:host .aside-body-scroll{position:absolute;inset:0;overflow-y:auto;padding-left:calc(var(--spacing, .25rem) * 8);padding-right:calc(var(--spacing, .25rem) * 8);padding-bottom:calc(var(--spacing, .25rem) * 8)}:host .image{position:relative;display:flex;align-items:center;justify-content:flex-end;height:100%;max-width:90%;max-height:90%}:host .image img{max-height:100%;max-width:100%}:host .spinner{visibility:hidden;width:max-content;position:absolute;top:50%;left:50%;z-index:-1;--tw-translate-y: -50%;--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host.loading .spinner{visibility:visible;z-index:1}:host.loading img{visibility:hidden;position:relative;z-index:-50}:host-context(html.dark) .title{background:var(--ngs-color-neutral-100);color:var(--ngs-color-neutral-600)}:host-context(html.dark) .close{background:var(--ngs-color-neutral-100);color:var(--ngs-color-neutral-600)}:host-context(html.dark) .close:hover{background:var(--ngs-color-neutral-200);color:var(--ngs-color-neutral-700)}:host-context(html.dark) .close:active{background:var(--ngs-color-neutral-300);color:var(--ngs-color-neutral-900)}:host-context(html.dark) .aside{background:var(--ngs-color-neutral-900)}:host-context(html.dark) .aside-body{color:var(--ngs-color-neutral-400)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "component", type: ProgressSpinner, selector: "ngs-progress-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["ngsProgressSpinner"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
194
- }
195
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageViewer, decorators: [{
196
- type: Component,
197
- args: [{ selector: 'ngs-image-viewer', exportAs: 'ngsImageViewer', imports: [
198
- Icon,
199
- ProgressSpinner,
200
- NgTemplateOutlet
201
- ], changeDetection: ChangeDetectionStrategy.Eager, host: {
202
- 'class': 'ngs-image-viewer',
203
- '[class.loading]': 'loading',
204
- '[class.dragging]': '_dragging',
205
- '[class.scaled]': 'scale !== 1'
206
- }, template: "<div class=\"title-container\">\n @if (hasTitle()) {\n <div class=\"title\">\n @if (data.titleTplRef) {\n <ng-container [ngTemplateOutlet]=\"data.titleTplRef\" />\n } @else if (data.caption) {\n {{ data.title }}\n }\n </div>\n }\n</div>\n<div class=\"controls\" (click)=\"onPreventClick($event)\">\n <div class=\"w-max\">\n <button (click)=\"pictureRef.close()\" class=\"close\">\n <ngs-icon name=\"fluent:dismiss-24-regular\"/>\n </button>\n </div>\n <div class=\"w-max\">\n <button class=\"zoom\" (click)=\"toggleZoom()\" [disabled]=\"scaleMax === 1 || null\">\n @if (scale === this.scaleMin) {\n <ngs-icon name=\"fluent:zoom-in-24-regular\"/>\n } @else {\n <ngs-icon name=\"fluent:zoom-out-24-regular\"/>\n }\n </button>\n </div>\n</div>\n<div class=\"content\" (click)=\"onBackdropClick()\">\n <div class=\"image\" (dragstart)=\"onDragStart($event)\">\n @if (loading) {\n <div class=\"spinner\">\n <ngs-progress-spinner/>\n </div>\n }\n <img [src]=\"data.sourceUrl\" alt=\"\" (load)=\"onLoad($event)\" (click)=\"onPreventClick($event)\" class=\"img\">\n </div>\n @if (hasAside()) {\n <aside class=\"aside\" (click)=\"onPreventClick($event)\">\n <div class=\"aside-header\">\n @if (data.captionTplRef) {\n <ng-container [ngTemplateOutlet]=\"data.captionTplRef\" />\n } @else if (data.caption) {\n {{ data.caption }}\n }\n </div>\n <div class=\"aside-body\">\n <div class=\"aside-body-scroll\">\n @if (data.descriptionTplRef) {\n <ng-container [ngTemplateOutlet]=\"data.descriptionTplRef\" />\n } @else if (data.description) {\n {{ data.description }}\n }\n </div>\n </div>\n </aside>\n }\n</div>\n", styles: [":host{width:100vw;height:100vh;display:flex;flex-direction:column}:host .title-container{position:absolute;inset-inline-start:calc(var(--spacing, .25rem) * 4);top:calc(var(--spacing, .25rem) * 4);z-index:3}:host .controls{position:absolute;inset-inline-end:calc(var(--spacing, .25rem) * 4);top:calc(var(--spacing, .25rem) * 4);z-index:3;display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 4)}:host .header{position:absolute;top:0;inset-inline-start:0;inset-inline-end:0;height:calc(var(--spacing, .25rem) * 20);flex:none;padding-left:calc(var(--spacing, .25rem) * 4);padding-right:calc(var(--spacing, .25rem) * 4);z-index:3;display:flex;align-items:center;justify-content:space-between}:host .content{box-shadow:var(--ngs-shadow-sm);z-index:2;display:flex;align-items:center;justify-content:center;gap:calc(var(--spacing, .25rem) * 8);width:100vw;height:100vh}:host.scaled img{cursor:grab}:host.dragging img{cursor:grabbing}:host:has(.aside) .content{padding-inline-end:420px}:host .img{-webkit-user-select:none;user-select:none;scale:var(--ngs-image-viewer-picture-scale, 1);transition:scale .15s linear}:host:not(.dragging) img{transition:transform .15s linear,scale .15s linear}:host .title{font-weight:500;height:calc(var(--spacing, .25rem) * 10);border-radius:calc(infinity * 1px);padding-left:calc(var(--spacing, .25rem) * 4);padding-right:calc(var(--spacing, .25rem) * 4);font-size:var(--text-tiny);display:flex;align-items:center;background:var(--ngs-color-neutral-700);color:var(--ngs-color-neutral-300)}:host .close,:host .zoom{width:calc(var(--spacing, .25rem) * 10);height:calc(var(--spacing, .25rem) * 10);border-radius:calc(infinity * 1px);cursor:pointer;display:flex;flex:none;align-items:center;justify-content:center;background:var(--ngs-color-neutral-700);color:var(--ngs-color-neutral-300)}:host .close:hover,:host .zoom:hover{background:var(--ngs-color-neutral-800);color:var(--ngs-color-neutral-200)}:host .close:active,:host .zoom:active{background:var(--ngs-color-neutral-950);color:var(--ngs-color-neutral-100)}:host .aside{width:420px;position:absolute;inset-inline-end:0;top:0;bottom:0;flex:none;background:var(--ngs-color-neutral-50);display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 5);height:100%;padding-inline-end:calc(var(--spacing, .25rem) * 10)}:host .aside-header{font-weight:700;padding-left:calc(var(--spacing, .25rem) * 8);padding-right:calc(var(--spacing, .25rem) * 8);padding-top:calc(var(--spacing, .25rem) * 8)}:host .aside-body{position:relative;flex-grow:1;font-size:var(--ngs-font-size-sm);color:var(--ngs-color-neutral-600);line-height:var(--leading-relaxed)}:host .aside-body-scroll{position:absolute;inset:0;overflow-y:auto;padding-left:calc(var(--spacing, .25rem) * 8);padding-right:calc(var(--spacing, .25rem) * 8);padding-bottom:calc(var(--spacing, .25rem) * 8)}:host .image{position:relative;display:flex;align-items:center;justify-content:flex-end;height:100%;max-width:90%;max-height:90%}:host .image img{max-height:100%;max-width:100%}:host .spinner{visibility:hidden;width:max-content;position:absolute;top:50%;left:50%;z-index:-1;--tw-translate-y: -50%;--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host.loading .spinner{visibility:visible;z-index:1}:host.loading img{visibility:hidden;position:relative;z-index:-50}:host-context(html.dark) .title{background:var(--ngs-color-neutral-100);color:var(--ngs-color-neutral-600)}:host-context(html.dark) .close{background:var(--ngs-color-neutral-100);color:var(--ngs-color-neutral-600)}:host-context(html.dark) .close:hover{background:var(--ngs-color-neutral-200);color:var(--ngs-color-neutral-700)}:host-context(html.dark) .close:active{background:var(--ngs-color-neutral-300);color:var(--ngs-color-neutral-900)}:host-context(html.dark) .aside{background:var(--ngs-color-neutral-900)}:host-context(html.dark) .aside-body{color:var(--ngs-color-neutral-400)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
207
- }] });
208
-
209
- class ImageViewerDirective {
210
- _overlay = inject(Overlay);
211
- _injector = inject(Injector);
212
- _destroyRef = inject(DestroyRef);
213
- get api() {
214
- return {
215
- open: (options) => this._open(options)
216
- };
217
- }
218
- _open(options) {
219
- const pictureRef = new PictureRef();
220
- const overlayRef = this._overlay.create({
221
- positionStrategy: this._overlay.position().global(),
222
- hasBackdrop: true
223
- });
224
- const injector = Injector.create({
225
- providers: [
226
- {
227
- provide: IMAGE_VIEWER_PICTURE_REF,
228
- useValue: pictureRef
229
- },
230
- {
231
- provide: IMAGE_VIEWER_PICTURE_DATA,
232
- useValue: options
233
- }
234
- ],
235
- parent: this._injector
236
- });
237
- const portal = new ComponentPortal(ImageViewer, null, injector);
238
- overlayRef.attach(portal);
239
- pictureRef.closed.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
240
- overlayRef.detach();
241
- });
242
- return pictureRef;
243
- }
244
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageViewerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
245
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: ImageViewerDirective, isStandalone: true, selector: "[ngsImageViewer]", host: { classAttribute: "ngs-image-viewer" }, exportAs: ["ngsImageViewer"], ngImport: i0 });
246
- }
247
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageViewerDirective, decorators: [{
248
- type: Directive,
249
- args: [{
250
- selector: '[ngsImageViewer]',
251
- exportAs: 'ngsImageViewer',
252
- standalone: true,
253
- host: {
254
- 'class': 'ngs-image-viewer',
255
- }
256
- }]
257
- }] });
258
-
259
- class ImageViewerPictureCaptionDirective {
260
- templateRef = inject(TemplateRef);
261
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageViewerPictureCaptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
262
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: ImageViewerPictureCaptionDirective, isStandalone: true, selector: "[ngsImageViewerPictureCaption]", ngImport: i0 });
263
- }
264
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageViewerPictureCaptionDirective, decorators: [{
265
- type: Directive,
266
- args: [{
267
- selector: '[ngsImageViewerPictureCaption]',
268
- standalone: true
269
- }]
270
- }] });
271
-
272
- class ImageViewerPictureDescriptionDirective {
273
- templateRef = inject(TemplateRef);
274
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageViewerPictureDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
275
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: ImageViewerPictureDescriptionDirective, isStandalone: true, selector: "[ngsImageViewerPictureDescription]", ngImport: i0 });
276
- }
277
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageViewerPictureDescriptionDirective, decorators: [{
278
- type: Directive,
279
- args: [{
280
- selector: '[ngsImageViewerPictureDescription]',
281
- standalone: true
282
- }]
283
- }] });
284
-
285
- class ImageViewerPictureTitleDirective {
286
- templateRef = inject(TemplateRef);
287
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageViewerPictureTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
288
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: ImageViewerPictureTitleDirective, isStandalone: true, selector: "[ngsImageViewerPictureTitle]", ngImport: i0 });
289
- }
290
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageViewerPictureTitleDirective, decorators: [{
291
- type: Directive,
292
- args: [{
293
- selector: '[ngsImageViewerPictureTitle]',
294
- standalone: true
295
- }]
296
- }] });
297
-
298
- class ImageViewerPictureDirective {
299
- _imageViewer = inject(ImageViewerDirective);
300
- _titleTplRef = contentChild(ImageViewerPictureTitleDirective, /* @ts-ignore */
301
- ...(ngDevMode ? [{ debugName: "_titleTplRef" }] : /* istanbul ignore next */ []));
302
- _captionTplRef = contentChild(ImageViewerPictureCaptionDirective, /* @ts-ignore */
303
- ...(ngDevMode ? [{ debugName: "_captionTplRef" }] : /* istanbul ignore next */ []));
304
- _descriptionTplRef = contentChild(ImageViewerPictureDescriptionDirective, /* @ts-ignore */
305
- ...(ngDevMode ? [{ debugName: "_descriptionTplRef" }] : /* istanbul ignore next */ []));
306
- sourceUrl = input.required(/* @ts-ignore */
307
- ...(ngDevMode ? [{ debugName: "sourceUrl" }] : /* istanbul ignore next */ []));
308
- caption = input(/* @ts-ignore */
309
- ...(ngDevMode ? [undefined, { debugName: "caption" }] : /* istanbul ignore next */ []));
310
- title = input(/* @ts-ignore */
311
- ...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
312
- description = input(/* @ts-ignore */
313
- ...(ngDevMode ? [undefined, { debugName: "description" }] : /* istanbul ignore next */ []));
314
- onClick(event) {
315
- event.preventDefault();
316
- event.stopPropagation();
317
- this._imageViewer.api.open({
318
- sourceUrl: this.sourceUrl(),
319
- title: this.title(),
320
- caption: this.caption(),
321
- description: this.description(),
322
- titleTplRef: this._titleTplRef()?.templateRef,
323
- captionTplRef: this._captionTplRef()?.templateRef,
324
- descriptionTplRef: this._descriptionTplRef()?.templateRef
325
- });
326
- }
327
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageViewerPictureDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
328
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.1.7", type: ImageViewerPictureDirective, isStandalone: true, selector: "[ngsImageViewerPicture]", inputs: { sourceUrl: { classPropertyName: "sourceUrl", publicName: "sourceUrl", isSignal: true, isRequired: true, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick($event)" }, classAttribute: "ngs-image-viewer-picture" }, providers: [
329
- {
330
- provide: IMAGE_VIEWER,
331
- useExisting: ImageViewerPictureDirective
332
- }
333
- ], queries: [{ propertyName: "_titleTplRef", first: true, predicate: ImageViewerPictureTitleDirective, descendants: true, isSignal: true }, { propertyName: "_captionTplRef", first: true, predicate: ImageViewerPictureCaptionDirective, descendants: true, isSignal: true }, { propertyName: "_descriptionTplRef", first: true, predicate: ImageViewerPictureDescriptionDirective, descendants: true, isSignal: true }], exportAs: ["ngsImageViewerPicture"], ngImport: i0 });
334
- }
335
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ImageViewerPictureDirective, decorators: [{
336
- type: Directive,
337
- args: [{
338
- selector: '[ngsImageViewerPicture]',
339
- exportAs: 'ngsImageViewerPicture',
340
- standalone: true,
341
- providers: [
342
- {
343
- provide: IMAGE_VIEWER,
344
- useExisting: ImageViewerPictureDirective
345
- }
346
- ],
347
- host: {
348
- 'class': 'ngs-image-viewer-picture',
349
- '(click)': 'onClick($event)'
350
- }
351
- }]
352
- }], propDecorators: { _titleTplRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ImageViewerPictureTitleDirective), { isSignal: true }] }], _captionTplRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ImageViewerPictureCaptionDirective), { isSignal: true }] }], _descriptionTplRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ImageViewerPictureDescriptionDirective), { isSignal: true }] }], sourceUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "sourceUrl", required: true }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }] } });
353
-
354
- /**
355
- * Generated bundle index. Do not edit.
356
- */
357
-
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, Directive, ElementRef, EventEmitter, InjectionToken, Injector, Renderer2, TemplateRef, computed, contentChild, inject, input } from "@angular/core";
3
+ import { Icon } from "@ngstarter-ui/components/icon";
4
+ import { NgTemplateOutlet } from "@angular/common";
5
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
6
+ import { Overlay } from "@angular/cdk/overlay";
7
+ import { ComponentPortal } from "@angular/cdk/portal";
8
+ import { fromEvent } from "rxjs";
9
+ import { ProgressSpinner } from "@ngstarter-ui/components/spinner";
10
+ var PictureRef = class {
11
+ closed = new EventEmitter();
12
+ close() {
13
+ this.closed.emit();
14
+ }
15
+ };
16
+ const IMAGE_VIEWER = new InjectionToken("IMAGE_VIEWER");
17
+ const IMAGE_VIEWER_PICTURE_REF = new InjectionToken("IMAGE_VIEWER_PICTURE_REF");
18
+ const IMAGE_VIEWER_PICTURE_DATA = new InjectionToken("IMAGE_VIEWER_PICTURE_DATA");
19
+ var ImageViewer = class ImageViewer {
20
+ elementRef = inject(ElementRef);
21
+ _document = inject(DOCUMENT);
22
+ _destroyRef = inject(DestroyRef);
23
+ _renderer = inject(Renderer2);
24
+ _startClientY = 0;
25
+ _startClientX = 0;
26
+ _offsetY = 0;
27
+ _offsetX = 0;
28
+ _tmpOffsetY = 0;
29
+ _tmpOffsetX = 0;
30
+ _dragging = false;
31
+ pictureRef = inject(IMAGE_VIEWER_PICTURE_REF);
32
+ data = inject(IMAGE_VIEWER_PICTURE_DATA);
33
+ loading = true;
34
+ scale = 1;
35
+ image;
36
+ alreadyDragged = false;
37
+ scaleMin = 1;
38
+ scaleMax = 1;
39
+ padding = 30;
40
+ scaled = computed(() => {
41
+ return this.scale !== 1;
42
+ }, ...ngDevMode ? [{ debugName: "scaled" }] : /* istanbul ignore next */ []);
43
+ hasTitle = computed(() => {
44
+ return !!(this.data.title || this.data.titleTplRef);
45
+ }, ...ngDevMode ? [{ debugName: "hasTitle" }] : /* istanbul ignore next */ []);
46
+ hasAside = computed(() => {
47
+ return !!(this.data.caption || this.data.description || this.data.captionTplRef || this.data.descriptionTplRef);
48
+ }, ...ngDevMode ? [{ debugName: "hasAside" }] : /* istanbul ignore next */ []);
49
+ onLoad(event) {
50
+ this.loading = false;
51
+ this.image = event.target;
52
+ if (this.image.width > this.image.height) this.scaleMax = this.image.naturalWidth / this.image.width;
53
+ else this.scaleMax = this.image.naturalHeight / this.image.height;
54
+ const image = this.image;
55
+ fromEvent(image, "mousedown").pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
56
+ if (this.scale === this.scaleMin || event.button === 2) return;
57
+ this._dragging = true;
58
+ this._startClientY = event.clientY;
59
+ this._startClientX = event.clientX;
60
+ });
61
+ fromEvent(this._document, "mousemove").pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
62
+ if (this._dragging) {
63
+ const scaleFactor = 1 / this.scale;
64
+ let offsetY = (event.clientY - this._startClientY) * scaleFactor;
65
+ let offsetX = (event.clientX - this._startClientX) * scaleFactor;
66
+ this._transform(offsetY, offsetX);
67
+ }
68
+ });
69
+ fromEvent(this._document, "mouseup").pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => {
70
+ if (this._dragging) {
71
+ const element = this.elementRef.nativeElement;
72
+ const elementRect = element.getBoundingClientRect();
73
+ this._renderer.removeClass(element, "dragging");
74
+ this._dragging = false;
75
+ let imageWidth = Math.floor(image.getBoundingClientRect().width);
76
+ let imageHeight = Math.floor(image.getBoundingClientRect().height);
77
+ let imageViewportWidth = this.hasAside() ? elementRect.width - 420 : elementRect.width;
78
+ let imageViewportHeight = elementRect.height;
79
+ if (imageWidth <= imageViewportWidth && imageHeight <= imageViewportHeight) {
80
+ this._tmpOffsetY = 0;
81
+ this._tmpOffsetX = 0;
82
+ this._offsetY = 0;
83
+ this._offsetX = 0;
84
+ this._renderer.setStyle(image, "transform", `translate(0px,0px)`);
85
+ } else {
86
+ const imageRect = image.getBoundingClientRect();
87
+ const widthDiff = imageViewportWidth - imageWidth;
88
+ const heightDiff = imageViewportHeight - imageHeight;
89
+ const xPositionDiff = widthDiff / this.scale / 2;
90
+ const yPositionDiff = heightDiff / this.scale / 2;
91
+ if (imageRect.x > 0 && imageRect.y > 0) {
92
+ this._tmpOffsetY = yPositionDiff * -1 + this.padding;
93
+ this._tmpOffsetX = xPositionDiff * -1 + this.padding;
94
+ } else if (imageRect.x < widthDiff && imageRect.y > 0) {
95
+ this._tmpOffsetY = yPositionDiff * -1 + this.padding;
96
+ this._tmpOffsetX = xPositionDiff - this.padding;
97
+ } else if (imageRect.x < widthDiff && imageRect.y < heightDiff) {
98
+ this._tmpOffsetY = yPositionDiff - this.padding;
99
+ this._tmpOffsetX = xPositionDiff - this.padding;
100
+ } else if (imageRect.x > 0 && imageRect.y < heightDiff) {
101
+ this._tmpOffsetY = yPositionDiff - this.padding;
102
+ this._tmpOffsetX = xPositionDiff * -1 + this.padding;
103
+ }
104
+ if (imageWidth < imageViewportWidth) this._tmpOffsetX = 0;
105
+ if (imageHeight < imageViewportHeight) this._tmpOffsetY = 0;
106
+ this._offsetY = this._tmpOffsetY;
107
+ this._offsetX = this._tmpOffsetX;
108
+ this._renderer.setStyle(image, "transform", `translate(${this._tmpOffsetX}px,${this._tmpOffsetY}px)`);
109
+ }
110
+ }
111
+ });
112
+ }
113
+ onBackdropClick() {
114
+ this.pictureRef.close();
115
+ }
116
+ onPreventClick(event) {
117
+ event.preventDefault();
118
+ event.stopPropagation();
119
+ }
120
+ toggleZoom() {
121
+ if (this.scale === this.scaleMin) this.scale = this.scaleMax;
122
+ else {
123
+ this.scale = this.scaleMin;
124
+ this._renderer.setStyle(this.image, "transform", `translate(0px,0px)`);
125
+ this._offsetX = 0;
126
+ this._offsetY = 0;
127
+ this._tmpOffsetY = 0;
128
+ this._tmpOffsetX = 0;
129
+ }
130
+ this.elementRef.nativeElement.style.setProperty("--ngs-image-viewer-picture-scale", this.scale.toString());
131
+ }
132
+ onDragStart(event) {
133
+ event.stopPropagation();
134
+ event.preventDefault();
135
+ this.alreadyDragged = true;
136
+ }
137
+ _transform(offsetY, offsetX) {
138
+ const image = this.image;
139
+ 1 / this.scale;
140
+ let translateX = this._offsetX + offsetX;
141
+ let translateY = this._offsetY + offsetY;
142
+ this._tmpOffsetY = translateY;
143
+ this._tmpOffsetX = translateX;
144
+ this._renderer.setStyle(image, "transform", `translate(${translateX}px,${translateY}px)`);
145
+ }
146
+ static ɵfac = i0.ɵɵngDeclareFactory({
147
+ minVersion: "12.0.0",
148
+ version: "22.3.0",
149
+ ngImport: i0,
150
+ type: ImageViewer,
151
+ deps: [],
152
+ target: i0.ɵɵFactoryTarget.Component
153
+ });
154
+ static ɵcmp = i0.ɵɵngDeclareComponent({
155
+ minVersion: "17.0.0",
156
+ version: "22.3.0",
157
+ type: ImageViewer,
158
+ isStandalone: true,
159
+ selector: "ngs-image-viewer",
160
+ host: {
161
+ properties: {
162
+ "class.loading": "loading",
163
+ "class.dragging": "_dragging",
164
+ "class.scaled": "scale !== 1"
165
+ },
166
+ classAttribute: "ngs-image-viewer"
167
+ },
168
+ exportAs: ["ngsImageViewer"],
169
+ ngImport: i0,
170
+ template: "<div class=\"title-container\">\n @if (hasTitle()) {\n <div class=\"title\">\n @if (data.titleTplRef) {\n <ng-container [ngTemplateOutlet]=\"data.titleTplRef\" />\n } @else if (data.caption) {\n {{ data.title }}\n }\n </div>\n }\n</div>\n<div class=\"controls\" (click)=\"onPreventClick($event)\">\n <div class=\"w-max\">\n <button (click)=\"pictureRef.close()\" class=\"close\">\n <ngs-icon name=\"fluent:dismiss-24-regular\"/>\n </button>\n </div>\n <div class=\"w-max\">\n <button class=\"zoom\" (click)=\"toggleZoom()\" [disabled]=\"scaleMax === 1 || null\">\n @if (scale === this.scaleMin) {\n <ngs-icon name=\"fluent:zoom-in-24-regular\"/>\n } @else {\n <ngs-icon name=\"fluent:zoom-out-24-regular\"/>\n }\n </button>\n </div>\n</div>\n<div class=\"content\" (click)=\"onBackdropClick()\">\n <div class=\"image\" (dragstart)=\"onDragStart($event)\">\n @if (loading) {\n <div class=\"spinner\">\n <ngs-progress-spinner/>\n </div>\n }\n <img [src]=\"data.sourceUrl\" alt=\"\" (load)=\"onLoad($event)\" (click)=\"onPreventClick($event)\" class=\"img\">\n </div>\n @if (hasAside()) {\n <aside class=\"aside\" (click)=\"onPreventClick($event)\">\n <div class=\"aside-header\">\n @if (data.captionTplRef) {\n <ng-container [ngTemplateOutlet]=\"data.captionTplRef\" />\n } @else if (data.caption) {\n {{ data.caption }}\n }\n </div>\n <div class=\"aside-body\">\n <div class=\"aside-body-scroll\">\n @if (data.descriptionTplRef) {\n <ng-container [ngTemplateOutlet]=\"data.descriptionTplRef\" />\n } @else if (data.description) {\n {{ data.description }}\n }\n </div>\n </div>\n </aside>\n }\n</div>\n",
171
+ styles: [":host{width:100vw;height:100vh;display:flex;flex-direction:column}:host .title-container{position:absolute;inset-inline-start:calc(var(--spacing, .25rem) * 4);top:calc(var(--spacing, .25rem) * 4);z-index:3}:host .controls{position:absolute;inset-inline-end:calc(var(--spacing, .25rem) * 4);top:calc(var(--spacing, .25rem) * 4);z-index:3;display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 4)}:host .header{position:absolute;top:0;inset-inline-start:0;inset-inline-end:0;height:calc(var(--spacing, .25rem) * 20);flex:none;padding-left:calc(var(--spacing, .25rem) * 4);padding-right:calc(var(--spacing, .25rem) * 4);z-index:3;display:flex;align-items:center;justify-content:space-between}:host .content{box-shadow:var(--ngs-shadow-sm);z-index:2;display:flex;align-items:center;justify-content:center;gap:calc(var(--spacing, .25rem) * 8);width:100vw;height:100vh}:host.scaled img{cursor:grab}:host.dragging img{cursor:grabbing}:host:has(.aside) .content{padding-inline-end:420px}:host .img{-webkit-user-select:none;user-select:none;scale:var(--ngs-image-viewer-picture-scale, 1);transition:scale .15s linear}:host:not(.dragging) img{transition:transform .15s linear,scale .15s linear}:host .title{font-weight:500;height:calc(var(--spacing, .25rem) * 10);border-radius:calc(infinity * 1px);padding-left:calc(var(--spacing, .25rem) * 4);padding-right:calc(var(--spacing, .25rem) * 4);font-size:var(--text-tiny);display:flex;align-items:center;background:var(--ngs-color-neutral-700);color:var(--ngs-color-neutral-300)}:host .close,:host .zoom{width:calc(var(--spacing, .25rem) * 10);height:calc(var(--spacing, .25rem) * 10);border-radius:calc(infinity * 1px);cursor:pointer;display:flex;flex:none;align-items:center;justify-content:center;background:var(--ngs-color-neutral-700);color:var(--ngs-color-neutral-300)}:host .close:hover,:host .zoom:hover{background:var(--ngs-color-neutral-800);color:var(--ngs-color-neutral-200)}:host .close:active,:host .zoom:active{background:var(--ngs-color-neutral-950);color:var(--ngs-color-neutral-100)}:host .aside{width:420px;position:absolute;inset-inline-end:0;top:0;bottom:0;flex:none;background:var(--ngs-color-neutral-50);display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 5);height:100%;padding-inline-end:calc(var(--spacing, .25rem) * 10)}:host .aside-header{font-weight:700;padding-left:calc(var(--spacing, .25rem) * 8);padding-right:calc(var(--spacing, .25rem) * 8);padding-top:calc(var(--spacing, .25rem) * 8)}:host .aside-body{position:relative;flex-grow:1;font-size:var(--ngs-font-size-sm);color:var(--ngs-color-neutral-600);line-height:var(--leading-relaxed)}:host .aside-body-scroll{position:absolute;inset:0;overflow-y:auto;padding-left:calc(var(--spacing, .25rem) * 8);padding-right:calc(var(--spacing, .25rem) * 8);padding-bottom:calc(var(--spacing, .25rem) * 8)}:host .image{position:relative;display:flex;align-items:center;justify-content:flex-end;height:100%;max-width:90%;max-height:90%}:host .image img{max-height:100%;max-width:100%}:host .spinner{visibility:hidden;width:max-content;position:absolute;top:50%;left:50%;z-index:-1;--tw-translate-y: -50%;--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host.loading .spinner{visibility:visible;z-index:1}:host.loading img{visibility:hidden;position:relative;z-index:-50}:host-context(html.dark) .title{background:var(--ngs-color-neutral-100);color:var(--ngs-color-neutral-600)}:host-context(html.dark) .close{background:var(--ngs-color-neutral-100);color:var(--ngs-color-neutral-600)}:host-context(html.dark) .close:hover{background:var(--ngs-color-neutral-200);color:var(--ngs-color-neutral-700)}:host-context(html.dark) .close:active{background:var(--ngs-color-neutral-300);color:var(--ngs-color-neutral-900)}:host-context(html.dark) .aside{background:var(--ngs-color-neutral-900)}:host-context(html.dark) .aside-body{color:var(--ngs-color-neutral-400)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
172
+ dependencies: [
173
+ {
174
+ kind: "component",
175
+ type: Icon,
176
+ selector: "ngs-icon",
177
+ inputs: ["name"],
178
+ exportAs: ["ngsIcon"]
179
+ },
180
+ {
181
+ kind: "component",
182
+ type: ProgressSpinner,
183
+ selector: "ngs-progress-spinner",
184
+ inputs: [
185
+ "color",
186
+ "mode",
187
+ "value",
188
+ "diameter",
189
+ "strokeWidth"
190
+ ],
191
+ exportAs: ["ngsProgressSpinner"]
192
+ },
193
+ {
194
+ kind: "directive",
195
+ type: NgTemplateOutlet,
196
+ selector: "[ngTemplateOutlet]",
197
+ inputs: [
198
+ "ngTemplateOutletContext",
199
+ "ngTemplateOutlet",
200
+ "ngTemplateOutletInjector"
201
+ ]
202
+ }
203
+ ],
204
+ changeDetection: i0.ChangeDetectionStrategy.Eager
205
+ });
206
+ };
207
+ i0.ɵɵngDeclareClassMetadata({
208
+ minVersion: "12.0.0",
209
+ version: "22.3.0",
210
+ ngImport: i0,
211
+ type: ImageViewer,
212
+ decorators: [{
213
+ type: Component,
214
+ args: [{
215
+ selector: "ngs-image-viewer",
216
+ exportAs: "ngsImageViewer",
217
+ imports: [
218
+ Icon,
219
+ ProgressSpinner,
220
+ NgTemplateOutlet
221
+ ],
222
+ changeDetection: ChangeDetectionStrategy.Eager,
223
+ host: {
224
+ "class": "ngs-image-viewer",
225
+ "[class.loading]": "loading",
226
+ "[class.dragging]": "_dragging",
227
+ "[class.scaled]": "scale !== 1"
228
+ },
229
+ template: "<div class=\"title-container\">\n @if (hasTitle()) {\n <div class=\"title\">\n @if (data.titleTplRef) {\n <ng-container [ngTemplateOutlet]=\"data.titleTplRef\" />\n } @else if (data.caption) {\n {{ data.title }}\n }\n </div>\n }\n</div>\n<div class=\"controls\" (click)=\"onPreventClick($event)\">\n <div class=\"w-max\">\n <button (click)=\"pictureRef.close()\" class=\"close\">\n <ngs-icon name=\"fluent:dismiss-24-regular\"/>\n </button>\n </div>\n <div class=\"w-max\">\n <button class=\"zoom\" (click)=\"toggleZoom()\" [disabled]=\"scaleMax === 1 || null\">\n @if (scale === this.scaleMin) {\n <ngs-icon name=\"fluent:zoom-in-24-regular\"/>\n } @else {\n <ngs-icon name=\"fluent:zoom-out-24-regular\"/>\n }\n </button>\n </div>\n</div>\n<div class=\"content\" (click)=\"onBackdropClick()\">\n <div class=\"image\" (dragstart)=\"onDragStart($event)\">\n @if (loading) {\n <div class=\"spinner\">\n <ngs-progress-spinner/>\n </div>\n }\n <img [src]=\"data.sourceUrl\" alt=\"\" (load)=\"onLoad($event)\" (click)=\"onPreventClick($event)\" class=\"img\">\n </div>\n @if (hasAside()) {\n <aside class=\"aside\" (click)=\"onPreventClick($event)\">\n <div class=\"aside-header\">\n @if (data.captionTplRef) {\n <ng-container [ngTemplateOutlet]=\"data.captionTplRef\" />\n } @else if (data.caption) {\n {{ data.caption }}\n }\n </div>\n <div class=\"aside-body\">\n <div class=\"aside-body-scroll\">\n @if (data.descriptionTplRef) {\n <ng-container [ngTemplateOutlet]=\"data.descriptionTplRef\" />\n } @else if (data.description) {\n {{ data.description }}\n }\n </div>\n </div>\n </aside>\n }\n</div>\n",
230
+ styles: [":host{width:100vw;height:100vh;display:flex;flex-direction:column}:host .title-container{position:absolute;inset-inline-start:calc(var(--spacing, .25rem) * 4);top:calc(var(--spacing, .25rem) * 4);z-index:3}:host .controls{position:absolute;inset-inline-end:calc(var(--spacing, .25rem) * 4);top:calc(var(--spacing, .25rem) * 4);z-index:3;display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 4)}:host .header{position:absolute;top:0;inset-inline-start:0;inset-inline-end:0;height:calc(var(--spacing, .25rem) * 20);flex:none;padding-left:calc(var(--spacing, .25rem) * 4);padding-right:calc(var(--spacing, .25rem) * 4);z-index:3;display:flex;align-items:center;justify-content:space-between}:host .content{box-shadow:var(--ngs-shadow-sm);z-index:2;display:flex;align-items:center;justify-content:center;gap:calc(var(--spacing, .25rem) * 8);width:100vw;height:100vh}:host.scaled img{cursor:grab}:host.dragging img{cursor:grabbing}:host:has(.aside) .content{padding-inline-end:420px}:host .img{-webkit-user-select:none;user-select:none;scale:var(--ngs-image-viewer-picture-scale, 1);transition:scale .15s linear}:host:not(.dragging) img{transition:transform .15s linear,scale .15s linear}:host .title{font-weight:500;height:calc(var(--spacing, .25rem) * 10);border-radius:calc(infinity * 1px);padding-left:calc(var(--spacing, .25rem) * 4);padding-right:calc(var(--spacing, .25rem) * 4);font-size:var(--text-tiny);display:flex;align-items:center;background:var(--ngs-color-neutral-700);color:var(--ngs-color-neutral-300)}:host .close,:host .zoom{width:calc(var(--spacing, .25rem) * 10);height:calc(var(--spacing, .25rem) * 10);border-radius:calc(infinity * 1px);cursor:pointer;display:flex;flex:none;align-items:center;justify-content:center;background:var(--ngs-color-neutral-700);color:var(--ngs-color-neutral-300)}:host .close:hover,:host .zoom:hover{background:var(--ngs-color-neutral-800);color:var(--ngs-color-neutral-200)}:host .close:active,:host .zoom:active{background:var(--ngs-color-neutral-950);color:var(--ngs-color-neutral-100)}:host .aside{width:420px;position:absolute;inset-inline-end:0;top:0;bottom:0;flex:none;background:var(--ngs-color-neutral-50);display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 5);height:100%;padding-inline-end:calc(var(--spacing, .25rem) * 10)}:host .aside-header{font-weight:700;padding-left:calc(var(--spacing, .25rem) * 8);padding-right:calc(var(--spacing, .25rem) * 8);padding-top:calc(var(--spacing, .25rem) * 8)}:host .aside-body{position:relative;flex-grow:1;font-size:var(--ngs-font-size-sm);color:var(--ngs-color-neutral-600);line-height:var(--leading-relaxed)}:host .aside-body-scroll{position:absolute;inset:0;overflow-y:auto;padding-left:calc(var(--spacing, .25rem) * 8);padding-right:calc(var(--spacing, .25rem) * 8);padding-bottom:calc(var(--spacing, .25rem) * 8)}:host .image{position:relative;display:flex;align-items:center;justify-content:flex-end;height:100%;max-width:90%;max-height:90%}:host .image img{max-height:100%;max-width:100%}:host .spinner{visibility:hidden;width:max-content;position:absolute;top:50%;left:50%;z-index:-1;--tw-translate-y: -50%;--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host.loading .spinner{visibility:visible;z-index:1}:host.loading img{visibility:hidden;position:relative;z-index:-50}:host-context(html.dark) .title{background:var(--ngs-color-neutral-100);color:var(--ngs-color-neutral-600)}:host-context(html.dark) .close{background:var(--ngs-color-neutral-100);color:var(--ngs-color-neutral-600)}:host-context(html.dark) .close:hover{background:var(--ngs-color-neutral-200);color:var(--ngs-color-neutral-700)}:host-context(html.dark) .close:active{background:var(--ngs-color-neutral-300);color:var(--ngs-color-neutral-900)}:host-context(html.dark) .aside{background:var(--ngs-color-neutral-900)}:host-context(html.dark) .aside-body{color:var(--ngs-color-neutral-400)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
231
+ }]
232
+ }]
233
+ });
234
+ var ImageViewerDirective = class ImageViewerDirective {
235
+ _overlay = inject(Overlay);
236
+ _injector = inject(Injector);
237
+ _destroyRef = inject(DestroyRef);
238
+ get api() {
239
+ return { open: (options) => this._open(options) };
240
+ }
241
+ _open(options) {
242
+ const pictureRef = new PictureRef();
243
+ const overlayRef = this._overlay.create({
244
+ positionStrategy: this._overlay.position().global(),
245
+ hasBackdrop: true
246
+ });
247
+ const injector = Injector.create({
248
+ providers: [{
249
+ provide: IMAGE_VIEWER_PICTURE_REF,
250
+ useValue: pictureRef
251
+ }, {
252
+ provide: IMAGE_VIEWER_PICTURE_DATA,
253
+ useValue: options
254
+ }],
255
+ parent: this._injector
256
+ });
257
+ const portal = new ComponentPortal(ImageViewer, null, injector);
258
+ overlayRef.attach(portal);
259
+ pictureRef.closed.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
260
+ overlayRef.detach();
261
+ });
262
+ return pictureRef;
263
+ }
264
+ static ɵfac = i0.ɵɵngDeclareFactory({
265
+ minVersion: "12.0.0",
266
+ version: "22.3.0",
267
+ ngImport: i0,
268
+ type: ImageViewerDirective,
269
+ deps: [],
270
+ target: i0.ɵɵFactoryTarget.Directive
271
+ });
272
+ static ɵdir = i0.ɵɵngDeclareDirective({
273
+ minVersion: "14.0.0",
274
+ version: "22.3.0",
275
+ type: ImageViewerDirective,
276
+ isStandalone: true,
277
+ selector: "[ngsImageViewer]",
278
+ host: { classAttribute: "ngs-image-viewer" },
279
+ exportAs: ["ngsImageViewer"],
280
+ ngImport: i0
281
+ });
282
+ };
283
+ i0.ɵɵngDeclareClassMetadata({
284
+ minVersion: "12.0.0",
285
+ version: "22.3.0",
286
+ ngImport: i0,
287
+ type: ImageViewerDirective,
288
+ decorators: [{
289
+ type: Directive,
290
+ args: [{
291
+ selector: "[ngsImageViewer]",
292
+ exportAs: "ngsImageViewer",
293
+ standalone: true,
294
+ host: { "class": "ngs-image-viewer" }
295
+ }]
296
+ }]
297
+ });
298
+ var ImageViewerPictureCaptionDirective = class ImageViewerPictureCaptionDirective {
299
+ templateRef = inject(TemplateRef);
300
+ static ɵfac = i0.ɵɵngDeclareFactory({
301
+ minVersion: "12.0.0",
302
+ version: "22.3.0",
303
+ ngImport: i0,
304
+ type: ImageViewerPictureCaptionDirective,
305
+ deps: [],
306
+ target: i0.ɵɵFactoryTarget.Directive
307
+ });
308
+ static ɵdir = i0.ɵɵngDeclareDirective({
309
+ minVersion: "14.0.0",
310
+ version: "22.3.0",
311
+ type: ImageViewerPictureCaptionDirective,
312
+ isStandalone: true,
313
+ selector: "[ngsImageViewerPictureCaption]",
314
+ ngImport: i0
315
+ });
316
+ };
317
+ i0.ɵɵngDeclareClassMetadata({
318
+ minVersion: "12.0.0",
319
+ version: "22.3.0",
320
+ ngImport: i0,
321
+ type: ImageViewerPictureCaptionDirective,
322
+ decorators: [{
323
+ type: Directive,
324
+ args: [{
325
+ selector: "[ngsImageViewerPictureCaption]",
326
+ standalone: true
327
+ }]
328
+ }]
329
+ });
330
+ var ImageViewerPictureDescriptionDirective = class ImageViewerPictureDescriptionDirective {
331
+ templateRef = inject(TemplateRef);
332
+ static ɵfac = i0.ɵɵngDeclareFactory({
333
+ minVersion: "12.0.0",
334
+ version: "22.3.0",
335
+ ngImport: i0,
336
+ type: ImageViewerPictureDescriptionDirective,
337
+ deps: [],
338
+ target: i0.ɵɵFactoryTarget.Directive
339
+ });
340
+ static ɵdir = i0.ɵɵngDeclareDirective({
341
+ minVersion: "14.0.0",
342
+ version: "22.3.0",
343
+ type: ImageViewerPictureDescriptionDirective,
344
+ isStandalone: true,
345
+ selector: "[ngsImageViewerPictureDescription]",
346
+ ngImport: i0
347
+ });
348
+ };
349
+ i0.ɵɵngDeclareClassMetadata({
350
+ minVersion: "12.0.0",
351
+ version: "22.3.0",
352
+ ngImport: i0,
353
+ type: ImageViewerPictureDescriptionDirective,
354
+ decorators: [{
355
+ type: Directive,
356
+ args: [{
357
+ selector: "[ngsImageViewerPictureDescription]",
358
+ standalone: true
359
+ }]
360
+ }]
361
+ });
362
+ var ImageViewerPictureTitleDirective = class ImageViewerPictureTitleDirective {
363
+ templateRef = inject(TemplateRef);
364
+ static ɵfac = i0.ɵɵngDeclareFactory({
365
+ minVersion: "12.0.0",
366
+ version: "22.3.0",
367
+ ngImport: i0,
368
+ type: ImageViewerPictureTitleDirective,
369
+ deps: [],
370
+ target: i0.ɵɵFactoryTarget.Directive
371
+ });
372
+ static ɵdir = i0.ɵɵngDeclareDirective({
373
+ minVersion: "14.0.0",
374
+ version: "22.3.0",
375
+ type: ImageViewerPictureTitleDirective,
376
+ isStandalone: true,
377
+ selector: "[ngsImageViewerPictureTitle]",
378
+ ngImport: i0
379
+ });
380
+ };
381
+ i0.ɵɵngDeclareClassMetadata({
382
+ minVersion: "12.0.0",
383
+ version: "22.3.0",
384
+ ngImport: i0,
385
+ type: ImageViewerPictureTitleDirective,
386
+ decorators: [{
387
+ type: Directive,
388
+ args: [{
389
+ selector: "[ngsImageViewerPictureTitle]",
390
+ standalone: true
391
+ }]
392
+ }]
393
+ });
394
+ var ImageViewerPictureDirective = class ImageViewerPictureDirective {
395
+ _imageViewer = inject(ImageViewerDirective);
396
+ _titleTplRef = contentChild(ImageViewerPictureTitleDirective, ...ngDevMode ? [{ debugName: "_titleTplRef" }] : /* istanbul ignore next */ []);
397
+ _captionTplRef = contentChild(ImageViewerPictureCaptionDirective, ...ngDevMode ? [{ debugName: "_captionTplRef" }] : /* istanbul ignore next */ []);
398
+ _descriptionTplRef = contentChild(ImageViewerPictureDescriptionDirective, ...ngDevMode ? [{ debugName: "_descriptionTplRef" }] : /* istanbul ignore next */ []);
399
+ sourceUrl = input.required(...ngDevMode ? [{ debugName: "sourceUrl" }] : /* istanbul ignore next */ []);
400
+ caption = input(...ngDevMode ? [void 0, { debugName: "caption" }] : /* istanbul ignore next */ []);
401
+ title = input(...ngDevMode ? [void 0, { debugName: "title" }] : /* istanbul ignore next */ []);
402
+ description = input(...ngDevMode ? [void 0, { debugName: "description" }] : /* istanbul ignore next */ []);
403
+ onClick(event) {
404
+ event.preventDefault();
405
+ event.stopPropagation();
406
+ this._imageViewer.api.open({
407
+ sourceUrl: this.sourceUrl(),
408
+ title: this.title(),
409
+ caption: this.caption(),
410
+ description: this.description(),
411
+ titleTplRef: this._titleTplRef()?.templateRef,
412
+ captionTplRef: this._captionTplRef()?.templateRef,
413
+ descriptionTplRef: this._descriptionTplRef()?.templateRef
414
+ });
415
+ }
416
+ static ɵfac = i0.ɵɵngDeclareFactory({
417
+ minVersion: "12.0.0",
418
+ version: "22.3.0",
419
+ ngImport: i0,
420
+ type: ImageViewerPictureDirective,
421
+ deps: [],
422
+ target: i0.ɵɵFactoryTarget.Directive
423
+ });
424
+ static ɵdir = i0.ɵɵngDeclareDirective({
425
+ minVersion: "17.2.0",
426
+ version: "22.3.0",
427
+ type: ImageViewerPictureDirective,
428
+ isStandalone: true,
429
+ selector: "[ngsImageViewerPicture]",
430
+ inputs: {
431
+ sourceUrl: {
432
+ classPropertyName: "sourceUrl",
433
+ publicName: "sourceUrl",
434
+ isSignal: true,
435
+ isRequired: true,
436
+ transformFunction: null
437
+ },
438
+ caption: {
439
+ classPropertyName: "caption",
440
+ publicName: "caption",
441
+ isSignal: true,
442
+ isRequired: false,
443
+ transformFunction: null
444
+ },
445
+ title: {
446
+ classPropertyName: "title",
447
+ publicName: "title",
448
+ isSignal: true,
449
+ isRequired: false,
450
+ transformFunction: null
451
+ },
452
+ description: {
453
+ classPropertyName: "description",
454
+ publicName: "description",
455
+ isSignal: true,
456
+ isRequired: false,
457
+ transformFunction: null
458
+ }
459
+ },
460
+ host: {
461
+ listeners: { "click": "onClick($event)" },
462
+ classAttribute: "ngs-image-viewer-picture"
463
+ },
464
+ providers: [{
465
+ provide: IMAGE_VIEWER,
466
+ useExisting: ImageViewerPictureDirective
467
+ }],
468
+ queries: [
469
+ {
470
+ propertyName: "_titleTplRef",
471
+ first: true,
472
+ predicate: ImageViewerPictureTitleDirective,
473
+ descendants: true,
474
+ isSignal: true
475
+ },
476
+ {
477
+ propertyName: "_captionTplRef",
478
+ first: true,
479
+ predicate: ImageViewerPictureCaptionDirective,
480
+ descendants: true,
481
+ isSignal: true
482
+ },
483
+ {
484
+ propertyName: "_descriptionTplRef",
485
+ first: true,
486
+ predicate: ImageViewerPictureDescriptionDirective,
487
+ descendants: true,
488
+ isSignal: true
489
+ }
490
+ ],
491
+ exportAs: ["ngsImageViewerPicture"],
492
+ ngImport: i0
493
+ });
494
+ };
495
+ i0.ɵɵngDeclareClassMetadata({
496
+ minVersion: "12.0.0",
497
+ version: "22.3.0",
498
+ ngImport: i0,
499
+ type: ImageViewerPictureDirective,
500
+ decorators: [{
501
+ type: Directive,
502
+ args: [{
503
+ selector: "[ngsImageViewerPicture]",
504
+ exportAs: "ngsImageViewerPicture",
505
+ standalone: true,
506
+ providers: [{
507
+ provide: IMAGE_VIEWER,
508
+ useExisting: ImageViewerPictureDirective
509
+ }],
510
+ host: {
511
+ "class": "ngs-image-viewer-picture",
512
+ "(click)": "onClick($event)"
513
+ }
514
+ }]
515
+ }],
516
+ propDecorators: {
517
+ _titleTplRef: [{
518
+ type: i0.ContentChild,
519
+ args: [i0.forwardRef(() => ImageViewerPictureTitleDirective), { isSignal: true }]
520
+ }],
521
+ _captionTplRef: [{
522
+ type: i0.ContentChild,
523
+ args: [i0.forwardRef(() => ImageViewerPictureCaptionDirective), { isSignal: true }]
524
+ }],
525
+ _descriptionTplRef: [{
526
+ type: i0.ContentChild,
527
+ args: [i0.forwardRef(() => ImageViewerPictureDescriptionDirective), { isSignal: true }]
528
+ }],
529
+ sourceUrl: [{
530
+ type: i0.Input,
531
+ args: [{
532
+ isSignal: true,
533
+ alias: "sourceUrl",
534
+ required: true
535
+ }]
536
+ }],
537
+ caption: [{
538
+ type: i0.Input,
539
+ args: [{
540
+ isSignal: true,
541
+ alias: "caption",
542
+ required: false
543
+ }]
544
+ }],
545
+ title: [{
546
+ type: i0.Input,
547
+ args: [{
548
+ isSignal: true,
549
+ alias: "title",
550
+ required: false
551
+ }]
552
+ }],
553
+ description: [{
554
+ type: i0.Input,
555
+ args: [{
556
+ isSignal: true,
557
+ alias: "description",
558
+ required: false
559
+ }]
560
+ }]
561
+ }
562
+ });
358
563
  export { ImageViewerDirective, ImageViewerPictureCaptionDirective, ImageViewerPictureDescriptionDirective, ImageViewerPictureDirective, ImageViewerPictureTitleDirective };
359
- //# sourceMappingURL=ngstarter-ui-components-image-viewer.mjs.map
564
+
565
+ //# sourceMappingURL=ngstarter-ui-components-image-viewer.mjs.map