@ngstarter-ui/components 22.3.5 → 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-8OmuepvH.mjs +0 -35
  438. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-8OmuepvH.mjs.map +0 -1
  439. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Dp5tISk3.mjs +0 -26
  440. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Dp5tISk3.mjs.map +0 -1
  441. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-BbBs-R_y.mjs +0 -220
  442. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-BbBs-R_y.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-DGCCeU-Y.mjs +0 -375
  448. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DGCCeU-Y.mjs.map +0 -1
  449. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-BJfRgtaA.mjs +0 -80
  450. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-BJfRgtaA.mjs.map +0 -1
  451. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-C_L7hF2G.mjs +0 -65
  452. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-C_L7hF2G.mjs.map +0 -1
  453. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-durrPUhm.mjs +0 -137
  454. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-durrPUhm.mjs.map +0 -1
  455. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-BoL1jZpT.mjs +0 -113
  456. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-BoL1jZpT.mjs.map +0 -1
  457. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-ChZpgXO5.mjs +0 -235
  458. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-ChZpgXO5.mjs.map +0 -1
  459. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DwyNFnII.mjs +0 -117
  460. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DwyNFnII.mjs.map +0 -1
  461. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-BWpJv6CO.mjs +0 -4464
  462. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-BWpJv6CO.mjs.map +0 -1
  463. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-BvNvkqTO.mjs +0 -132
  464. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-BvNvkqTO.mjs.map +0 -1
  465. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-tgNKltfK.mjs +0 -171
  466. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-tgNKltfK.mjs.map +0 -1
  467. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-BcAlqmh8.mjs +0 -1653
  468. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-BcAlqmh8.mjs.map +0 -1
  469. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-S474I51r.mjs +0 -20
  470. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-S474I51r.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-Dj82fxTI.mjs +0 -134
  474. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-Dj82fxTI.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,649 +1,1098 @@
1
- import * as i0 from '@angular/core';
2
- import { model, input, output, viewChild, signal, inject, PLATFORM_ID, DOCUMENT, afterNextRender, effect, ChangeDetectionStrategy, Component, ElementRef, Renderer2, computed, RendererStyleFlags2 } from '@angular/core';
3
- import { isPlatformBrowser, DOCUMENT as DOCUMENT$1 } from '@angular/common';
4
- import { Subject, merge, fromEvent } from 'rxjs';
5
- import { tap, filter, map, switchMap, takeUntil } from 'rxjs/operators';
6
- import { ColorSwitcher } from '@ngstarter-ui/components/color-switcher';
7
- import { Icon } from '@ngstarter-ui/components/icon';
8
- import { Button } from '@ngstarter-ui/components/button';
9
- import { Menu, MenuItem, MenuTrigger } from '@ngstarter-ui/components/menu';
10
-
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DOCUMENT, ElementRef, PLATFORM_ID, Renderer2, RendererStyleFlags2, afterNextRender, computed, effect, inject, input, model, output, signal, viewChild } from "@angular/core";
3
+ import { Icon } from "@ngstarter-ui/components/icon";
4
+ import { Button } from "@ngstarter-ui/components/button";
5
+ import { DOCUMENT as DOCUMENT$1, isPlatformBrowser } from "@angular/common";
6
+ import { Subject, fromEvent, merge } from "rxjs";
7
+ import { filter as filter$1, map as map$1, switchMap as switchMap$1, takeUntil as takeUntil$1, tap as tap$1 } from "rxjs/operators";
8
+ import { Menu, MenuItem, MenuTrigger } from "@ngstarter-ui/components/menu";
9
+ import { ColorSwitcher } from "@ngstarter-ui/components/color-switcher";
11
10
  function ease(x) {
12
- return 1 - Math.sqrt(1 - Math.pow(x, 2));
13
- }
14
- class LazyPoint {
15
- x;
16
- y;
17
- constructor(x, y) {
18
- this.x = x;
19
- this.y = y;
20
- }
21
- update(point) {
22
- this.x = point.x;
23
- this.y = point.y;
24
- return this;
25
- }
26
- moveByAngle(angle, distance, friction) {
27
- const angleRotated = angle + Math.PI / 2;
28
- if (friction) {
29
- this.x = this.x + Math.sin(angleRotated) * distance * ease(1 - friction);
30
- this.y = this.y - Math.cos(angleRotated) * distance * ease(1 - friction);
31
- }
32
- else {
33
- this.x = this.x + Math.sin(angleRotated) * distance;
34
- this.y = this.y - Math.cos(angleRotated) * distance;
35
- }
36
- return this;
37
- }
38
- equalsTo(point) {
39
- return this.x === point.x && this.y === point.y;
40
- }
41
- getDifferenceTo(point) {
42
- return new LazyPoint(this.x - point.x, this.y - point.y);
43
- }
44
- getDistanceTo(point) {
45
- const diff = this.getDifferenceTo(point);
46
- return Math.sqrt(Math.pow(diff.x, 2) + Math.pow(diff.y, 2));
47
- }
48
- getAngleTo(point) {
49
- const diff = this.getDifferenceTo(point);
50
- return Math.atan2(diff.y, diff.x);
51
- }
52
- toObject() {
53
- return {
54
- x: this.x,
55
- y: this.y
56
- };
57
- }
11
+ return 1 - Math.sqrt(1 - Math.pow(x, 2));
58
12
  }
59
-
13
+ var LazyPoint = class LazyPoint {
14
+ x;
15
+ y;
16
+ constructor(x, y) {
17
+ this.x = x;
18
+ this.y = y;
19
+ }
20
+ update(point) {
21
+ this.x = point.x;
22
+ this.y = point.y;
23
+ return this;
24
+ }
25
+ moveByAngle(angle, distance, friction) {
26
+ const angleRotated = angle + Math.PI / 2;
27
+ if (friction) {
28
+ this.x = this.x + Math.sin(angleRotated) * distance * ease(1 - friction);
29
+ this.y = this.y - Math.cos(angleRotated) * distance * ease(1 - friction);
30
+ } else {
31
+ this.x = this.x + Math.sin(angleRotated) * distance;
32
+ this.y = this.y - Math.cos(angleRotated) * distance;
33
+ }
34
+ return this;
35
+ }
36
+ equalsTo(point) {
37
+ return this.x === point.x && this.y === point.y;
38
+ }
39
+ getDifferenceTo(point) {
40
+ return new LazyPoint(this.x - point.x, this.y - point.y);
41
+ }
42
+ getDistanceTo(point) {
43
+ const diff = this.getDifferenceTo(point);
44
+ return Math.sqrt(Math.pow(diff.x, 2) + Math.pow(diff.y, 2));
45
+ }
46
+ getAngleTo(point) {
47
+ const diff = this.getDifferenceTo(point);
48
+ return Math.atan2(diff.y, diff.x);
49
+ }
50
+ toObject() {
51
+ return {
52
+ x: this.x,
53
+ y: this.y
54
+ };
55
+ }
56
+ };
60
57
  const RADIUS_DEFAULT = 30;
61
- class LazyBrush {
62
- _isEnabled;
63
- _hasMoved;
64
- radius;
65
- pointer;
66
- brush;
67
- angle;
68
- distance;
69
- friction;
70
- constructor(options = {}) {
71
- const initialPoint = options.initialPoint || { x: 0, y: 0 };
72
- this.radius = options.radius || RADIUS_DEFAULT;
73
- this._isEnabled = options.enabled === false ? false : true;
74
- this.friction = options.friction || 0;
75
- this.pointer = new LazyPoint(initialPoint.x, initialPoint.y);
76
- this.brush = new LazyPoint(initialPoint.x, initialPoint.y);
77
- this.angle = 0;
78
- this.distance = 0;
79
- this._hasMoved = false;
80
- }
81
- enable() { this._isEnabled = true; }
82
- disable() { this._isEnabled = false; }
83
- isEnabled() { return this._isEnabled; }
84
- setRadius(radius) { this.radius = radius; }
85
- getRadius() { return this.radius; }
86
- setFriction(friction) { this.friction = Math.max(0, Math.min(1, friction)); }
87
- getFriction() { return this.friction; }
88
- getBrushCoordinates() { return this.brush.toObject(); }
89
- getPointerCoordinates() { return this.pointer.toObject(); }
90
- getBrush() { return this.brush; }
91
- getPointer() { return this.pointer; }
92
- getAngle() { return this.angle; }
93
- getDistance() { return this.distance; }
94
- brushHasMoved() { return this._hasMoved; }
95
- update(newPointerPoint, options = {}) {
96
- this._hasMoved = false;
97
- const currentFriction = options.friction !== undefined ? options.friction : this.friction;
98
- if (this.pointer.equalsTo(newPointerPoint) &&
99
- !options.both &&
100
- currentFriction === this.friction) {
101
- return false;
102
- }
103
- this.pointer.update(newPointerPoint);
104
- if (options.both) {
105
- this._hasMoved = true;
106
- this.brush.update(newPointerPoint);
107
- return true;
108
- }
109
- if (this._isEnabled) {
110
- this.distance = this.pointer.getDistanceTo(this.brush);
111
- this.angle = this.pointer.getAngleTo(this.brush);
112
- const isOutside = this.distance > this.radius;
113
- if (isOutside) {
114
- this.brush.moveByAngle(this.angle, this.distance - this.radius, currentFriction);
115
- this._hasMoved = true;
116
- }
117
- }
118
- else {
119
- this.distance = 0;
120
- this.angle = 0;
121
- this.brush.update(newPointerPoint);
122
- this._hasMoved = true;
123
- }
124
- return true;
125
- }
126
- }
127
-
128
- class SignaturePad {
129
- fixedCanvasHeight = 250;
130
- penColor = model('#000', /* @ts-ignore */
131
- ...(ngDevMode ? [{ debugName: "penColor" }] : /* istanbul ignore next */ []));
132
- lineWidth = input(4, /* @ts-ignore */
133
- ...(ngDevMode ? [{ debugName: "lineWidth" }] : /* istanbul ignore next */ []));
134
- backgroundColor = input('transparent', /* @ts-ignore */
135
- ...(ngDevMode ? [{ debugName: "backgroundColor" }] : /* istanbul ignore next */ []));
136
- lazyRadius = input(3, /* @ts-ignore */
137
- ...(ngDevMode ? [{ debugName: "lazyRadius" }] : /* istanbul ignore next */ []));
138
- lazyFriction = input(0.1, /* @ts-ignore */
139
- ...(ngDevMode ? [{ debugName: "lazyFriction" }] : /* istanbul ignore next */ []));
140
- lazyEnabled = input(true, /* @ts-ignore */
141
- ...(ngDevMode ? [{ debugName: "lazyEnabled" }] : /* istanbul ignore next */ []));
142
- colors = input(['#000', '#0059ff', '#ff0000'], /* @ts-ignore */
143
- ...(ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []));
144
- signatureSaved = output();
145
- signatureCleared = output();
146
- mainCanvasRef = viewChild.required('signatureCanvas', /* @ts-ignore */
147
- ...(ngDevMode ? [{ debugName: "mainCanvasRef" }] : /* istanbul ignore next */ []));
148
- canvasWidth = signal(400, /* @ts-ignore */
149
- ...(ngDevMode ? [{ debugName: "canvasWidth" }] : /* istanbul ignore next */ []));
150
- canvasHeight = signal(this.fixedCanvasHeight, /* @ts-ignore */
151
- ...(ngDevMode ? [{ debugName: "canvasHeight" }] : /* istanbul ignore next */ []));
152
- mainContext = signal(null, /* @ts-ignore */
153
- ...(ngDevMode ? [{ debugName: "mainContext" }] : /* istanbul ignore next */ []));
154
- memoryCanvasElement = null;
155
- memoryContext = signal(null, /* @ts-ignore */
156
- ...(ngDevMode ? [{ debugName: "memoryContext" }] : /* istanbul ignore next */ []));
157
- lazyBrushInstance;
158
- isDrawing = signal(false, /* @ts-ignore */
159
- ...(ngDevMode ? [{ debugName: "isDrawing" }] : /* istanbul ignore next */ []));
160
- currentStrokePoints = signal([], /* @ts-ignore */
161
- ...(ngDevMode ? [{ debugName: "currentStrokePoints" }] : /* istanbul ignore next */ []));
162
- resizeObserver;
163
- platformId = inject(PLATFORM_ID);
164
- document = inject(DOCUMENT);
165
- subscriptions = [];
166
- pointerDown$ = new Subject();
167
- constructor() {
168
- if (isPlatformBrowser(this.platformId)) {
169
- afterNextRender(() => {
170
- this.initializeLazyBrush();
171
- this.initializeCanvasesAndContexts();
172
- this.setupResizeObserver();
173
- this.setupPointerEvents();
174
- });
175
- }
176
- effect(() => {
177
- const currentWidth = this.canvasWidth();
178
- const currentHeight = this.canvasHeight();
179
- this.backgroundColor();
180
- if (this.mainContext() && this.memoryContext() && this.mainCanvasRef() && this.memoryCanvasElement && this.lazyBrushInstance) {
181
- const mainCanvasEl = this.mainCanvasRef().nativeElement;
182
- mainCanvasEl.width = currentWidth;
183
- mainCanvasEl.height = currentHeight;
184
- this.memoryCanvasElement.width = currentWidth;
185
- this.memoryCanvasElement.height = currentHeight;
186
- this.configureContextStyling(this.mainContext());
187
- this.configureContextStyling(this.memoryContext());
188
- this.mainContext().fillStyle = this.backgroundColor();
189
- this.mainContext().fillRect(0, 0, currentWidth, currentHeight);
190
- this.memoryContext().clearRect(0, 0, currentWidth, currentHeight);
191
- this.currentStrokePoints.set([]);
192
- this.lazyBrushInstance.pointer.update({ x: 0, y: 0 });
193
- this.lazyBrushInstance.brush.update({ x: 0, y: 0 });
194
- }
195
- });
196
- effect(() => {
197
- this.penColor();
198
- this.lineWidth();
199
- if (this.mainContext()) {
200
- this.mainContext().strokeStyle = this.penColor();
201
- this.mainContext().lineWidth = this.lineWidth();
202
- this.mainContext().fillStyle = this.penColor();
203
- }
204
- if (this.memoryContext()) {
205
- this.memoryContext().strokeStyle = this.penColor();
206
- this.memoryContext().lineWidth = this.lineWidth();
207
- this.memoryContext().fillStyle = this.penColor();
208
- }
209
- });
210
- effect(() => {
211
- if (this.lazyBrushInstance) {
212
- this.lazyBrushInstance.setRadius(this.lazyRadius());
213
- this.lazyBrushInstance.setFriction(this.lazyFriction());
214
- this.lazyEnabled() ? this.lazyBrushInstance.enable() : this.lazyBrushInstance.disable();
215
- }
216
- });
217
- }
218
- ngOnDestroy() {
219
- this.subscriptions.forEach(sub => sub.unsubscribe());
220
- if (this.resizeObserver && this.mainCanvasRef()) {
221
- this.resizeObserver.unobserve(this.mainCanvasRef().nativeElement);
222
- }
223
- }
224
- setupPointerEvents() {
225
- const canvasEl = this.mainCanvasRef().nativeElement;
226
- const pointerDownEvents$ = merge(fromEvent(canvasEl, 'mousedown'), fromEvent(canvasEl, 'touchstart').pipe(tap(event => { if (event.cancelable)
227
- event.preventDefault(); }))).pipe(filter(() => !!this.mainContext() && !!this.lazyBrushInstance), map(event => this.getCoordinates(event)), filter((coords) => coords !== null));
228
- const pointerMoveEvents$ = merge(fromEvent(this.document, 'mousemove'), fromEvent(this.document, 'touchmove').pipe(tap(event => { if (event.cancelable)
229
- event.preventDefault(); }))).pipe(map(event => this.getCoordinates(event)), filter((coords) => coords !== null));
230
- const pointerUpEvents$ = merge(fromEvent(this.document, 'mouseup'), fromEvent(this.document, 'touchend'), fromEvent(this.document, 'touchcancel'));
231
- const drawingStream$ = pointerDownEvents$.pipe(tap(coords => this.handlePointerDownLogic(coords)), switchMap(() => pointerMoveEvents$.pipe(takeUntil(pointerUpEvents$.pipe(tap(event => this.handlePointerUpLogic(event)))))));
232
- this.subscriptions.push(drawingStream$.subscribe(coords => {
233
- this.handlePointerMoveLogic(coords);
234
- }));
235
- }
236
- setupResizeObserver() {
237
- const canvasEl = this.mainCanvasRef().nativeElement;
238
- this.resizeObserver = new ResizeObserver(entries => {
239
- for (const entry of entries) {
240
- const contentBoxSize = Array.isArray(entry.contentBoxSize) ? entry.contentBoxSize[0] : entry.contentBoxSize;
241
- const newWidth = contentBoxSize ? contentBoxSize.inlineSize : entry.contentRect.width;
242
- const newHeight = this.fixedCanvasHeight;
243
- if (newWidth > 0 && newHeight > 0 && (this.canvasWidth() !== newWidth || this.canvasHeight() !== newHeight)) {
244
- this.canvasWidth.set(newWidth);
245
- this.canvasHeight.set(newHeight);
246
- }
247
- }
248
- });
249
- this.resizeObserver.observe(canvasEl);
250
- }
251
- initializeLazyBrush() {
252
- const options = {
253
- radius: this.lazyRadius(),
254
- enabled: this.lazyEnabled(),
255
- initialPoint: { x: 0, y: 0 },
256
- friction: this.lazyFriction()
257
- };
258
- this.lazyBrushInstance = new LazyBrush(options);
259
- }
260
- initializeCanvasesAndContexts() {
261
- const mainCanvasEl = this.mainCanvasRef().nativeElement;
262
- const mainCtx = mainCanvasEl.getContext('2d');
263
- if (!mainCtx) {
264
- console.error('Failed to get 2D context for main canvas');
265
- return;
266
- }
267
- this.mainContext.set(mainCtx);
268
- this.memoryCanvasElement = document.createElement('canvas');
269
- const memCtx = this.memoryCanvasElement.getContext('2d');
270
- if (!memCtx) {
271
- console.error('Failed to get 2D context for memory canvas');
272
- return;
273
- }
274
- this.memoryContext.set(memCtx);
275
- }
276
- configureContextStyling(ctx) {
277
- ctx.strokeStyle = this.penColor();
278
- ctx.lineWidth = this.lineWidth();
279
- ctx.lineCap = 'round';
280
- ctx.lineJoin = 'round';
281
- ctx.fillStyle = this.penColor();
282
- }
283
- handlePointerDownLogic(coords) {
284
- this.isDrawing.set(true);
285
- this.lazyBrushInstance.update(coords, { both: true });
286
- this.currentStrokePoints.set([this.lazyBrushInstance.getBrushCoordinates()]);
287
- }
288
- handlePointerMoveLogic(coords) {
289
- const mainCtx = this.mainContext();
290
- const memCanvas = this.memoryCanvasElement;
291
- if (!mainCtx || !memCanvas || !this.lazyBrushInstance)
292
- return;
293
- this.lazyBrushInstance.update(coords);
294
- if (this.lazyBrushInstance.brushHasMoved()) {
295
- this.currentStrokePoints.update(points => [...points, this.lazyBrushInstance.getBrushCoordinates()]);
296
- mainCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
297
- mainCtx.drawImage(memCanvas, 0, 0);
298
- this.drawSmoothStroke(mainCtx, this.currentStrokePoints());
299
- }
300
- }
301
- handlePointerUpLogic(event) {
302
- if (!this.isDrawing())
303
- return;
304
- const mainCtx = this.mainContext();
305
- const memCtx = this.memoryContext();
306
- const mainCanvasEl = this.mainCanvasRef().nativeElement;
307
- if (!mainCtx || !memCtx || !this.memoryCanvasElement || !this.lazyBrushInstance) {
308
- this.isDrawing.set(false);
309
- this.currentStrokePoints.set([]);
310
- return;
311
- }
312
- const coords = event ? this.getCoordinates(event) : this.lazyBrushInstance.getPointerCoordinates();
313
- if (coords) {
314
- this.lazyBrushInstance.update(coords);
315
- if (this.lazyBrushInstance.brushHasMoved()) {
316
- this.currentStrokePoints.update(points => [...points, this.lazyBrushInstance.getBrushCoordinates()]);
317
- }
318
- }
319
- if (this.currentStrokePoints().length > 0) {
320
- mainCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
321
- mainCtx.drawImage(this.memoryCanvasElement, 0, 0);
322
- this.drawSmoothStroke(mainCtx, this.currentStrokePoints());
323
- }
324
- memCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
325
- memCtx.drawImage(mainCanvasEl, 0, 0);
326
- this.isDrawing.set(false);
327
- this.currentStrokePoints.set([]);
328
- this.save();
329
- }
330
- drawSmoothStroke(ctx, points) {
331
- if (points.length === 0)
332
- return;
333
- ctx.strokeStyle = this.penColor();
334
- ctx.lineWidth = this.lineWidth();
335
- ctx.fillStyle = this.penColor();
336
- ctx.lineCap = 'round';
337
- ctx.lineJoin = 'round';
338
- if (points.length < 3) {
339
- const p1 = points[0];
340
- ctx.beginPath();
341
- if (points.length === 1) {
342
- const radius = this.lineWidth() / 2;
343
- ctx.arc(p1.x, p1.y, Math.max(0.5, radius), 0, Math.PI * 2, true);
344
- ctx.fill();
345
- }
346
- else {
347
- const p2 = points[1];
348
- ctx.moveTo(p1.x, p1.y);
349
- ctx.lineTo(p2.x, p2.y);
350
- ctx.stroke();
351
- }
352
- ctx.closePath();
353
- return;
354
- }
355
- ctx.beginPath();
356
- ctx.moveTo(points[0].x, points[0].y);
357
- let i;
358
- for (i = 1; i < points.length - 2; i++) {
359
- const c = (points[i].x + points[i + 1].x) / 2;
360
- const d = (points[i].y + points[i + 1].y) / 2;
361
- ctx.quadraticCurveTo(points[i].x, points[i].y, c, d);
362
- }
363
- ctx.quadraticCurveTo(points[i].x, points[i].y, points[i + 1].x, points[i + 1].y);
364
- ctx.stroke();
365
- ctx.closePath();
366
- }
367
- getCoordinates(event) {
368
- const canvas = this.mainCanvasRef()?.nativeElement;
369
- if (!canvas)
370
- return null;
371
- const rect = canvas.getBoundingClientRect();
372
- let clientX, clientY;
373
- if (event instanceof MouseEvent) {
374
- clientX = event.clientX;
375
- clientY = event.clientY;
376
- }
377
- else if (event instanceof TouchEvent) {
378
- const touch = event.touches.length > 0 ? event.touches[0] :
379
- (event.changedTouches.length > 0 ? event.changedTouches[0] : null);
380
- if (touch) {
381
- clientX = touch.clientX;
382
- clientY = touch.clientY;
383
- }
384
- else {
385
- return null;
386
- }
387
- }
388
- else {
389
- return null;
390
- }
391
- const scaleX = canvas.width / rect.width;
392
- const scaleY = canvas.height / rect.height;
393
- return {
394
- x: (clientX - rect.left) * scaleX,
395
- y: (clientY - rect.top) * scaleY,
396
- };
397
- }
398
- clear() {
399
- const mainCtx = this.mainContext();
400
- const memCtx = this.memoryContext();
401
- if (mainCtx) {
402
- mainCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
403
- mainCtx.fillStyle = this.backgroundColor();
404
- mainCtx.fillRect(0, 0, this.canvasWidth(), this.canvasHeight());
405
- }
406
- if (memCtx) {
407
- memCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
408
- }
409
- this.currentStrokePoints.set([]);
410
- if (this.lazyBrushInstance) {
411
- const currentPointer = this.lazyBrushInstance.getPointerCoordinates();
412
- this.lazyBrushInstance.update(currentPointer, { both: true });
413
- }
414
- this.signatureCleared.emit();
415
- }
416
- save() {
417
- const memCanvas = this.memoryCanvasElement;
418
- if (!memCanvas) {
419
- console.warn('Memory canvas not available for saving.');
420
- return;
421
- }
422
- if (this.isCanvasEffectivelyBlank(memCanvas)) {
423
- console.warn('Canvas is effectively empty or contains only background. Nothing to save.');
424
- return;
425
- }
426
- const dataUrl = memCanvas.toDataURL('image/png');
427
- this.signatureSaved.emit(dataUrl);
428
- }
429
- onColorChange(color) {
430
- this.penColor.set(color);
431
- }
432
- isCanvasEffectivelyBlank(canvas) {
433
- if (!canvas)
434
- return true;
435
- const tempCanvas = document.createElement('canvas');
436
- tempCanvas.width = canvas.width;
437
- tempCanvas.height = canvas.height;
438
- const tempCtx = tempCanvas.getContext('2d');
439
- if (!tempCtx)
440
- return true;
441
- tempCtx.fillStyle = this.backgroundColor();
442
- tempCtx.fillRect(0, 0, tempCanvas.width, tempCanvas.height);
443
- return canvas.toDataURL() === tempCanvas.toDataURL();
444
- }
445
- handleEscapeKey(event) {
446
- this.clear();
447
- }
448
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SignaturePad, deps: [], target: i0.ɵɵFactoryTarget.Component });
449
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: SignaturePad, isStandalone: true, selector: "ngs-signature-pad", inputs: { penColor: { classPropertyName: "penColor", publicName: "penColor", isSignal: true, isRequired: false, transformFunction: null }, lineWidth: { classPropertyName: "lineWidth", publicName: "lineWidth", isSignal: true, isRequired: false, transformFunction: null }, backgroundColor: { classPropertyName: "backgroundColor", publicName: "backgroundColor", isSignal: true, isRequired: false, transformFunction: null }, lazyRadius: { classPropertyName: "lazyRadius", publicName: "lazyRadius", isSignal: true, isRequired: false, transformFunction: null }, lazyFriction: { classPropertyName: "lazyFriction", publicName: "lazyFriction", isSignal: true, isRequired: false, transformFunction: null }, lazyEnabled: { classPropertyName: "lazyEnabled", publicName: "lazyEnabled", isSignal: true, isRequired: false, transformFunction: null }, colors: { classPropertyName: "colors", publicName: "colors", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { penColor: "penColorChange", signatureSaved: "signatureSaved", signatureCleared: "signatureCleared" }, host: { listeners: { "document:keydown.escape": "handleEscapeKey($event)" }, classAttribute: "ngs-signature-pad" }, viewQueries: [{ propertyName: "mainCanvasRef", first: true, predicate: ["signatureCanvas"], descendants: true, isSignal: true }], exportAs: ["ngsSignaturePad"], ngImport: i0, template: "<canvas #signatureCanvas\n class=\"signature-canvas\"\n width=\"500\"\n height=\"250\">\n Your browser does not support the HTML canvas tag.\n</canvas>\n<div class=\"line\"></div>\n<ngs-color-switcher\n [selectedColor]=\"penColor()\"\n [colors]=\"colors()\"\n (colorChange)=\"onColorChange($event)\"/>\n<div class=\"clear-button\">\n <button type=\"button\" ngsIconButton (click)=\"clear()\">\n <ngs-icon name=\"fluent:dismiss-24-regular\"/>\n </button>\n</div>\n", styles: [":host{display:block;position:relative;width:100%;max-width:100%;background:var(--ngs-color-surface-container-lowest)}:host canvas{display:block;width:100%;height:250px;z-index:1;position:relative}:host .ngs-brand-colors{--ngs-brand-colors-color-size: calc(var(--spacing, .25rem) * 5);--ngs-brand-colors-gap: calc(var(--spacing, .25rem) * 2);position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:2}:host .clear-button{position:absolute;top:var(--spacing, .25rem);left:var(--spacing, .25rem);z-index:2}:host .line{position:absolute;height:1px;z-index:0;background:var(--ngs-color-surface-container-highest);left:40px;right:40px;bottom:50px}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: ColorSwitcher, selector: "ngs-color-switcher", inputs: ["colors", "selectedColor", "disabled"], outputs: ["colorChange"], exportAs: ["ngsColorSwitcher"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
450
- }
451
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SignaturePad, decorators: [{
452
- type: Component,
453
- args: [{ selector: 'ngs-signature-pad', exportAs: 'ngsSignaturePad', standalone: true, imports: [
454
- ColorSwitcher,
455
- Icon,
456
- Button
457
- ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
458
- 'class': 'ngs-signature-pad',
459
- '(document:keydown.escape)': 'handleEscapeKey($event)',
460
- }, template: "<canvas #signatureCanvas\n class=\"signature-canvas\"\n width=\"500\"\n height=\"250\">\n Your browser does not support the HTML canvas tag.\n</canvas>\n<div class=\"line\"></div>\n<ngs-color-switcher\n [selectedColor]=\"penColor()\"\n [colors]=\"colors()\"\n (colorChange)=\"onColorChange($event)\"/>\n<div class=\"clear-button\">\n <button type=\"button\" ngsIconButton (click)=\"clear()\">\n <ngs-icon name=\"fluent:dismiss-24-regular\"/>\n </button>\n</div>\n", styles: [":host{display:block;position:relative;width:100%;max-width:100%;background:var(--ngs-color-surface-container-lowest)}:host canvas{display:block;width:100%;height:250px;z-index:1;position:relative}:host .ngs-brand-colors{--ngs-brand-colors-color-size: calc(var(--spacing, .25rem) * 5);--ngs-brand-colors-gap: calc(var(--spacing, .25rem) * 2);position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:2}:host .clear-button{position:absolute;top:var(--spacing, .25rem);left:var(--spacing, .25rem);z-index:2}:host .line{position:absolute;height:1px;z-index:0;background:var(--ngs-color-surface-container-highest);left:40px;right:40px;bottom:50px}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
461
- }], ctorParameters: () => [], propDecorators: { penColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "penColor", required: false }] }, { type: i0.Output, args: ["penColorChange"] }], lineWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "lineWidth", required: false }] }], backgroundColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "backgroundColor", required: false }] }], lazyRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyRadius", required: false }] }], lazyFriction: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyFriction", required: false }] }], lazyEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyEnabled", required: false }] }], colors: [{ type: i0.Input, args: [{ isSignal: true, alias: "colors", required: false }] }], signatureSaved: [{ type: i0.Output, args: ["signatureSaved"] }], signatureCleared: [{ type: i0.Output, args: ["signatureCleared"] }], mainCanvasRef: [{ type: i0.ViewChild, args: ['signatureCanvas', { isSignal: true }] }] } });
462
-
58
+ var LazyBrush = class {
59
+ _isEnabled;
60
+ _hasMoved;
61
+ radius;
62
+ pointer;
63
+ brush;
64
+ angle;
65
+ distance;
66
+ friction;
67
+ constructor(options = {}) {
68
+ const initialPoint = options.initialPoint || {
69
+ x: 0,
70
+ y: 0
71
+ };
72
+ this.radius = options.radius || RADIUS_DEFAULT;
73
+ this._isEnabled = options.enabled === false ? false : true;
74
+ this.friction = options.friction || 0;
75
+ this.pointer = new LazyPoint(initialPoint.x, initialPoint.y);
76
+ this.brush = new LazyPoint(initialPoint.x, initialPoint.y);
77
+ this.angle = 0;
78
+ this.distance = 0;
79
+ this._hasMoved = false;
80
+ }
81
+ enable() {
82
+ this._isEnabled = true;
83
+ }
84
+ disable() {
85
+ this._isEnabled = false;
86
+ }
87
+ isEnabled() {
88
+ return this._isEnabled;
89
+ }
90
+ setRadius(radius) {
91
+ this.radius = radius;
92
+ }
93
+ getRadius() {
94
+ return this.radius;
95
+ }
96
+ setFriction(friction) {
97
+ this.friction = Math.max(0, Math.min(1, friction));
98
+ }
99
+ getFriction() {
100
+ return this.friction;
101
+ }
102
+ getBrushCoordinates() {
103
+ return this.brush.toObject();
104
+ }
105
+ getPointerCoordinates() {
106
+ return this.pointer.toObject();
107
+ }
108
+ getBrush() {
109
+ return this.brush;
110
+ }
111
+ getPointer() {
112
+ return this.pointer;
113
+ }
114
+ getAngle() {
115
+ return this.angle;
116
+ }
117
+ getDistance() {
118
+ return this.distance;
119
+ }
120
+ brushHasMoved() {
121
+ return this._hasMoved;
122
+ }
123
+ update(newPointerPoint, options = {}) {
124
+ this._hasMoved = false;
125
+ const currentFriction = options.friction !== void 0 ? options.friction : this.friction;
126
+ if (this.pointer.equalsTo(newPointerPoint) && !options.both && currentFriction === this.friction) return false;
127
+ this.pointer.update(newPointerPoint);
128
+ if (options.both) {
129
+ this._hasMoved = true;
130
+ this.brush.update(newPointerPoint);
131
+ return true;
132
+ }
133
+ if (this._isEnabled) {
134
+ this.distance = this.pointer.getDistanceTo(this.brush);
135
+ this.angle = this.pointer.getAngleTo(this.brush);
136
+ if (this.distance > this.radius) {
137
+ this.brush.moveByAngle(this.angle, this.distance - this.radius, currentFriction);
138
+ this._hasMoved = true;
139
+ }
140
+ } else {
141
+ this.distance = 0;
142
+ this.angle = 0;
143
+ this.brush.update(newPointerPoint);
144
+ this._hasMoved = true;
145
+ }
146
+ return true;
147
+ }
148
+ };
149
+ var SignaturePad = class SignaturePad {
150
+ fixedCanvasHeight = 250;
151
+ penColor = model("#000", ...ngDevMode ? [{ debugName: "penColor" }] : /* istanbul ignore next */ []);
152
+ lineWidth = input(4, ...ngDevMode ? [{ debugName: "lineWidth" }] : /* istanbul ignore next */ []);
153
+ backgroundColor = input("transparent", ...ngDevMode ? [{ debugName: "backgroundColor" }] : /* istanbul ignore next */ []);
154
+ lazyRadius = input(3, ...ngDevMode ? [{ debugName: "lazyRadius" }] : /* istanbul ignore next */ []);
155
+ lazyFriction = input(.1, ...ngDevMode ? [{ debugName: "lazyFriction" }] : /* istanbul ignore next */ []);
156
+ lazyEnabled = input(true, ...ngDevMode ? [{ debugName: "lazyEnabled" }] : /* istanbul ignore next */ []);
157
+ colors = input([
158
+ "#000",
159
+ "#0059ff",
160
+ "#ff0000"
161
+ ], ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
162
+ signatureSaved = output();
163
+ signatureCleared = output();
164
+ mainCanvasRef = viewChild.required("signatureCanvas", ...ngDevMode ? [{ debugName: "mainCanvasRef" }] : /* istanbul ignore next */ []);
165
+ canvasWidth = signal(400, ...ngDevMode ? [{ debugName: "canvasWidth" }] : /* istanbul ignore next */ []);
166
+ canvasHeight = signal(this.fixedCanvasHeight, ...ngDevMode ? [{ debugName: "canvasHeight" }] : /* istanbul ignore next */ []);
167
+ mainContext = signal(null, ...ngDevMode ? [{ debugName: "mainContext" }] : /* istanbul ignore next */ []);
168
+ memoryCanvasElement = null;
169
+ memoryContext = signal(null, ...ngDevMode ? [{ debugName: "memoryContext" }] : /* istanbul ignore next */ []);
170
+ lazyBrushInstance;
171
+ isDrawing = signal(false, ...ngDevMode ? [{ debugName: "isDrawing" }] : /* istanbul ignore next */ []);
172
+ currentStrokePoints = signal([], ...ngDevMode ? [{ debugName: "currentStrokePoints" }] : /* istanbul ignore next */ []);
173
+ resizeObserver;
174
+ platformId = inject(PLATFORM_ID);
175
+ document = inject(DOCUMENT);
176
+ subscriptions = [];
177
+ pointerDown$ = new Subject();
178
+ constructor() {
179
+ if (isPlatformBrowser(this.platformId)) afterNextRender(() => {
180
+ this.initializeLazyBrush();
181
+ this.initializeCanvasesAndContexts();
182
+ this.setupResizeObserver();
183
+ this.setupPointerEvents();
184
+ });
185
+ effect(() => {
186
+ const currentWidth = this.canvasWidth();
187
+ const currentHeight = this.canvasHeight();
188
+ this.backgroundColor();
189
+ if (this.mainContext() && this.memoryContext() && this.mainCanvasRef() && this.memoryCanvasElement && this.lazyBrushInstance) {
190
+ const mainCanvasEl = this.mainCanvasRef().nativeElement;
191
+ mainCanvasEl.width = currentWidth;
192
+ mainCanvasEl.height = currentHeight;
193
+ this.memoryCanvasElement.width = currentWidth;
194
+ this.memoryCanvasElement.height = currentHeight;
195
+ this.configureContextStyling(this.mainContext());
196
+ this.configureContextStyling(this.memoryContext());
197
+ this.mainContext().fillStyle = this.backgroundColor();
198
+ this.mainContext().fillRect(0, 0, currentWidth, currentHeight);
199
+ this.memoryContext().clearRect(0, 0, currentWidth, currentHeight);
200
+ this.currentStrokePoints.set([]);
201
+ this.lazyBrushInstance.pointer.update({
202
+ x: 0,
203
+ y: 0
204
+ });
205
+ this.lazyBrushInstance.brush.update({
206
+ x: 0,
207
+ y: 0
208
+ });
209
+ }
210
+ });
211
+ effect(() => {
212
+ this.penColor();
213
+ this.lineWidth();
214
+ if (this.mainContext()) {
215
+ this.mainContext().strokeStyle = this.penColor();
216
+ this.mainContext().lineWidth = this.lineWidth();
217
+ this.mainContext().fillStyle = this.penColor();
218
+ }
219
+ if (this.memoryContext()) {
220
+ this.memoryContext().strokeStyle = this.penColor();
221
+ this.memoryContext().lineWidth = this.lineWidth();
222
+ this.memoryContext().fillStyle = this.penColor();
223
+ }
224
+ });
225
+ effect(() => {
226
+ if (this.lazyBrushInstance) {
227
+ this.lazyBrushInstance.setRadius(this.lazyRadius());
228
+ this.lazyBrushInstance.setFriction(this.lazyFriction());
229
+ this.lazyEnabled() ? this.lazyBrushInstance.enable() : this.lazyBrushInstance.disable();
230
+ }
231
+ });
232
+ }
233
+ ngOnDestroy() {
234
+ this.subscriptions.forEach((sub) => sub.unsubscribe());
235
+ if (this.resizeObserver && this.mainCanvasRef()) this.resizeObserver.unobserve(this.mainCanvasRef().nativeElement);
236
+ }
237
+ setupPointerEvents() {
238
+ const canvasEl = this.mainCanvasRef().nativeElement;
239
+ const pointerDownEvents$ = merge(fromEvent(canvasEl, "mousedown"), fromEvent(canvasEl, "touchstart").pipe(tap$1((event) => {
240
+ if (event.cancelable) event.preventDefault();
241
+ }))).pipe(filter$1(() => !!this.mainContext() && !!this.lazyBrushInstance), map$1((event) => this.getCoordinates(event)), filter$1((coords) => coords !== null));
242
+ const pointerMoveEvents$ = merge(fromEvent(this.document, "mousemove"), fromEvent(this.document, "touchmove").pipe(tap$1((event) => {
243
+ if (event.cancelable) event.preventDefault();
244
+ }))).pipe(map$1((event) => this.getCoordinates(event)), filter$1((coords) => coords !== null));
245
+ const pointerUpEvents$ = merge(fromEvent(this.document, "mouseup"), fromEvent(this.document, "touchend"), fromEvent(this.document, "touchcancel"));
246
+ const drawingStream$ = pointerDownEvents$.pipe(tap$1((coords) => this.handlePointerDownLogic(coords)), switchMap$1(() => pointerMoveEvents$.pipe(takeUntil$1(pointerUpEvents$.pipe(tap$1((event) => this.handlePointerUpLogic(event)))))));
247
+ this.subscriptions.push(drawingStream$.subscribe((coords) => {
248
+ this.handlePointerMoveLogic(coords);
249
+ }));
250
+ }
251
+ setupResizeObserver() {
252
+ const canvasEl = this.mainCanvasRef().nativeElement;
253
+ this.resizeObserver = new ResizeObserver((entries) => {
254
+ for (const entry of entries) {
255
+ const contentBoxSize = Array.isArray(entry.contentBoxSize) ? entry.contentBoxSize[0] : entry.contentBoxSize;
256
+ const newWidth = contentBoxSize ? contentBoxSize.inlineSize : entry.contentRect.width;
257
+ const newHeight = this.fixedCanvasHeight;
258
+ if (newWidth > 0 && newHeight > 0 && (this.canvasWidth() !== newWidth || this.canvasHeight() !== newHeight)) {
259
+ this.canvasWidth.set(newWidth);
260
+ this.canvasHeight.set(newHeight);
261
+ }
262
+ }
263
+ });
264
+ this.resizeObserver.observe(canvasEl);
265
+ }
266
+ initializeLazyBrush() {
267
+ const options = {
268
+ radius: this.lazyRadius(),
269
+ enabled: this.lazyEnabled(),
270
+ initialPoint: {
271
+ x: 0,
272
+ y: 0
273
+ },
274
+ friction: this.lazyFriction()
275
+ };
276
+ this.lazyBrushInstance = new LazyBrush(options);
277
+ }
278
+ initializeCanvasesAndContexts() {
279
+ const mainCtx = this.mainCanvasRef().nativeElement.getContext("2d");
280
+ if (!mainCtx) {
281
+ console.error("Failed to get 2D context for main canvas");
282
+ return;
283
+ }
284
+ this.mainContext.set(mainCtx);
285
+ this.memoryCanvasElement = document.createElement("canvas");
286
+ const memCtx = this.memoryCanvasElement.getContext("2d");
287
+ if (!memCtx) {
288
+ console.error("Failed to get 2D context for memory canvas");
289
+ return;
290
+ }
291
+ this.memoryContext.set(memCtx);
292
+ }
293
+ configureContextStyling(ctx) {
294
+ ctx.strokeStyle = this.penColor();
295
+ ctx.lineWidth = this.lineWidth();
296
+ ctx.lineCap = "round";
297
+ ctx.lineJoin = "round";
298
+ ctx.fillStyle = this.penColor();
299
+ }
300
+ handlePointerDownLogic(coords) {
301
+ this.isDrawing.set(true);
302
+ this.lazyBrushInstance.update(coords, { both: true });
303
+ this.currentStrokePoints.set([this.lazyBrushInstance.getBrushCoordinates()]);
304
+ }
305
+ handlePointerMoveLogic(coords) {
306
+ const mainCtx = this.mainContext();
307
+ const memCanvas = this.memoryCanvasElement;
308
+ if (!mainCtx || !memCanvas || !this.lazyBrushInstance) return;
309
+ this.lazyBrushInstance.update(coords);
310
+ if (this.lazyBrushInstance.brushHasMoved()) {
311
+ this.currentStrokePoints.update((points) => [...points, this.lazyBrushInstance.getBrushCoordinates()]);
312
+ mainCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
313
+ mainCtx.drawImage(memCanvas, 0, 0);
314
+ this.drawSmoothStroke(mainCtx, this.currentStrokePoints());
315
+ }
316
+ }
317
+ handlePointerUpLogic(event) {
318
+ if (!this.isDrawing()) return;
319
+ const mainCtx = this.mainContext();
320
+ const memCtx = this.memoryContext();
321
+ const mainCanvasEl = this.mainCanvasRef().nativeElement;
322
+ if (!mainCtx || !memCtx || !this.memoryCanvasElement || !this.lazyBrushInstance) {
323
+ this.isDrawing.set(false);
324
+ this.currentStrokePoints.set([]);
325
+ return;
326
+ }
327
+ const coords = event ? this.getCoordinates(event) : this.lazyBrushInstance.getPointerCoordinates();
328
+ if (coords) {
329
+ this.lazyBrushInstance.update(coords);
330
+ if (this.lazyBrushInstance.brushHasMoved()) this.currentStrokePoints.update((points) => [...points, this.lazyBrushInstance.getBrushCoordinates()]);
331
+ }
332
+ if (this.currentStrokePoints().length > 0) {
333
+ mainCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
334
+ mainCtx.drawImage(this.memoryCanvasElement, 0, 0);
335
+ this.drawSmoothStroke(mainCtx, this.currentStrokePoints());
336
+ }
337
+ memCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
338
+ memCtx.drawImage(mainCanvasEl, 0, 0);
339
+ this.isDrawing.set(false);
340
+ this.currentStrokePoints.set([]);
341
+ this.save();
342
+ }
343
+ drawSmoothStroke(ctx, points) {
344
+ if (points.length === 0) return;
345
+ ctx.strokeStyle = this.penColor();
346
+ ctx.lineWidth = this.lineWidth();
347
+ ctx.fillStyle = this.penColor();
348
+ ctx.lineCap = "round";
349
+ ctx.lineJoin = "round";
350
+ if (points.length < 3) {
351
+ const p1 = points[0];
352
+ ctx.beginPath();
353
+ if (points.length === 1) {
354
+ const radius = this.lineWidth() / 2;
355
+ ctx.arc(p1.x, p1.y, Math.max(.5, radius), 0, Math.PI * 2, true);
356
+ ctx.fill();
357
+ } else {
358
+ const p2 = points[1];
359
+ ctx.moveTo(p1.x, p1.y);
360
+ ctx.lineTo(p2.x, p2.y);
361
+ ctx.stroke();
362
+ }
363
+ ctx.closePath();
364
+ return;
365
+ }
366
+ ctx.beginPath();
367
+ ctx.moveTo(points[0].x, points[0].y);
368
+ let i = 1;
369
+ for (; i < points.length - 2; i++) {
370
+ const c = (points[i].x + points[i + 1].x) / 2;
371
+ const d = (points[i].y + points[i + 1].y) / 2;
372
+ ctx.quadraticCurveTo(points[i].x, points[i].y, c, d);
373
+ }
374
+ ctx.quadraticCurveTo(points[i].x, points[i].y, points[i + 1].x, points[i + 1].y);
375
+ ctx.stroke();
376
+ ctx.closePath();
377
+ }
378
+ getCoordinates(event) {
379
+ const canvas = this.mainCanvasRef()?.nativeElement;
380
+ if (!canvas) return null;
381
+ const rect = canvas.getBoundingClientRect();
382
+ let clientX, clientY;
383
+ if (event instanceof MouseEvent) {
384
+ clientX = event.clientX;
385
+ clientY = event.clientY;
386
+ } else if (event instanceof TouchEvent) {
387
+ const touch = event.touches.length > 0 ? event.touches[0] : event.changedTouches.length > 0 ? event.changedTouches[0] : null;
388
+ if (touch) {
389
+ clientX = touch.clientX;
390
+ clientY = touch.clientY;
391
+ } else return null;
392
+ } else return null;
393
+ const scaleX = canvas.width / rect.width;
394
+ const scaleY = canvas.height / rect.height;
395
+ return {
396
+ x: (clientX - rect.left) * scaleX,
397
+ y: (clientY - rect.top) * scaleY
398
+ };
399
+ }
400
+ clear() {
401
+ const mainCtx = this.mainContext();
402
+ const memCtx = this.memoryContext();
403
+ if (mainCtx) {
404
+ mainCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
405
+ mainCtx.fillStyle = this.backgroundColor();
406
+ mainCtx.fillRect(0, 0, this.canvasWidth(), this.canvasHeight());
407
+ }
408
+ if (memCtx) memCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
409
+ this.currentStrokePoints.set([]);
410
+ if (this.lazyBrushInstance) {
411
+ const currentPointer = this.lazyBrushInstance.getPointerCoordinates();
412
+ this.lazyBrushInstance.update(currentPointer, { both: true });
413
+ }
414
+ this.signatureCleared.emit();
415
+ }
416
+ save() {
417
+ const memCanvas = this.memoryCanvasElement;
418
+ if (!memCanvas) {
419
+ console.warn("Memory canvas not available for saving.");
420
+ return;
421
+ }
422
+ if (this.isCanvasEffectivelyBlank(memCanvas)) {
423
+ console.warn("Canvas is effectively empty or contains only background. Nothing to save.");
424
+ return;
425
+ }
426
+ const dataUrl = memCanvas.toDataURL("image/png");
427
+ this.signatureSaved.emit(dataUrl);
428
+ }
429
+ onColorChange(color) {
430
+ this.penColor.set(color);
431
+ }
432
+ isCanvasEffectivelyBlank(canvas) {
433
+ if (!canvas) return true;
434
+ const tempCanvas = document.createElement("canvas");
435
+ tempCanvas.width = canvas.width;
436
+ tempCanvas.height = canvas.height;
437
+ const tempCtx = tempCanvas.getContext("2d");
438
+ if (!tempCtx) return true;
439
+ tempCtx.fillStyle = this.backgroundColor();
440
+ tempCtx.fillRect(0, 0, tempCanvas.width, tempCanvas.height);
441
+ return canvas.toDataURL() === tempCanvas.toDataURL();
442
+ }
443
+ handleEscapeKey(event) {
444
+ this.clear();
445
+ }
446
+ static ɵfac = i0.ɵɵngDeclareFactory({
447
+ minVersion: "12.0.0",
448
+ version: "22.3.0",
449
+ ngImport: i0,
450
+ type: SignaturePad,
451
+ deps: [],
452
+ target: i0.ɵɵFactoryTarget.Component
453
+ });
454
+ static ɵcmp = i0.ɵɵngDeclareComponent({
455
+ minVersion: "17.2.0",
456
+ version: "22.3.0",
457
+ type: SignaturePad,
458
+ isStandalone: true,
459
+ selector: "ngs-signature-pad",
460
+ inputs: {
461
+ penColor: {
462
+ classPropertyName: "penColor",
463
+ publicName: "penColor",
464
+ isSignal: true,
465
+ isRequired: false,
466
+ transformFunction: null
467
+ },
468
+ lineWidth: {
469
+ classPropertyName: "lineWidth",
470
+ publicName: "lineWidth",
471
+ isSignal: true,
472
+ isRequired: false,
473
+ transformFunction: null
474
+ },
475
+ backgroundColor: {
476
+ classPropertyName: "backgroundColor",
477
+ publicName: "backgroundColor",
478
+ isSignal: true,
479
+ isRequired: false,
480
+ transformFunction: null
481
+ },
482
+ lazyRadius: {
483
+ classPropertyName: "lazyRadius",
484
+ publicName: "lazyRadius",
485
+ isSignal: true,
486
+ isRequired: false,
487
+ transformFunction: null
488
+ },
489
+ lazyFriction: {
490
+ classPropertyName: "lazyFriction",
491
+ publicName: "lazyFriction",
492
+ isSignal: true,
493
+ isRequired: false,
494
+ transformFunction: null
495
+ },
496
+ lazyEnabled: {
497
+ classPropertyName: "lazyEnabled",
498
+ publicName: "lazyEnabled",
499
+ isSignal: true,
500
+ isRequired: false,
501
+ transformFunction: null
502
+ },
503
+ colors: {
504
+ classPropertyName: "colors",
505
+ publicName: "colors",
506
+ isSignal: true,
507
+ isRequired: false,
508
+ transformFunction: null
509
+ }
510
+ },
511
+ outputs: {
512
+ penColor: "penColorChange",
513
+ signatureSaved: "signatureSaved",
514
+ signatureCleared: "signatureCleared"
515
+ },
516
+ host: {
517
+ listeners: { "document:keydown.escape": "handleEscapeKey($event)" },
518
+ classAttribute: "ngs-signature-pad"
519
+ },
520
+ viewQueries: [{
521
+ propertyName: "mainCanvasRef",
522
+ first: true,
523
+ predicate: ["signatureCanvas"],
524
+ descendants: true,
525
+ isSignal: true
526
+ }],
527
+ exportAs: ["ngsSignaturePad"],
528
+ ngImport: i0,
529
+ template: "<canvas #signatureCanvas\n class=\"signature-canvas\"\n width=\"500\"\n height=\"250\">\n Your browser does not support the HTML canvas tag.\n</canvas>\n<div class=\"line\"></div>\n<ngs-color-switcher\n [selectedColor]=\"penColor()\"\n [colors]=\"colors()\"\n (colorChange)=\"onColorChange($event)\"/>\n<div class=\"clear-button\">\n <button type=\"button\" ngsIconButton (click)=\"clear()\">\n <ngs-icon name=\"fluent:dismiss-24-regular\"/>\n </button>\n</div>\n",
530
+ styles: [":host{display:block;position:relative;width:100%;max-width:100%;background:var(--ngs-color-surface-container-lowest)}:host canvas{display:block;width:100%;height:250px;z-index:1;position:relative}:host .ngs-brand-colors{--ngs-brand-colors-color-size: calc(var(--spacing, .25rem) * 5);--ngs-brand-colors-gap: calc(var(--spacing, .25rem) * 2);position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:2}:host .clear-button{position:absolute;top:var(--spacing, .25rem);left:var(--spacing, .25rem);z-index:2}:host .line{position:absolute;height:1px;z-index:0;background:var(--ngs-color-surface-container-highest);left:40px;right:40px;bottom:50px}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
531
+ dependencies: [
532
+ {
533
+ kind: "component",
534
+ type: ColorSwitcher,
535
+ selector: "ngs-color-switcher",
536
+ inputs: [
537
+ "readonly",
538
+ "value",
539
+ "colors",
540
+ "selectedColor",
541
+ "disabled"
542
+ ],
543
+ outputs: [
544
+ "touch",
545
+ "valueChange",
546
+ "colorChange"
547
+ ],
548
+ exportAs: ["ngsColorSwitcher"]
549
+ },
550
+ {
551
+ kind: "component",
552
+ type: Icon,
553
+ selector: "ngs-icon",
554
+ inputs: ["name"],
555
+ exportAs: ["ngsIcon"]
556
+ },
557
+ {
558
+ kind: "component",
559
+ type: Button,
560
+ selector: "\n button[ngsButton], button[ngsIconButton],\n a[ngsButton], a[ngsIconButton]\n ",
561
+ inputs: [
562
+ "ngsButton",
563
+ "ngsIconButton",
564
+ "loading",
565
+ "disabled",
566
+ "disabledInteractive",
567
+ "disableRipple",
568
+ "reverse",
569
+ "fullWidth",
570
+ "hideTextOnMobile"
571
+ ],
572
+ exportAs: ["ngsButton"]
573
+ }
574
+ ],
575
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
576
+ });
577
+ };
578
+ i0.ɵɵngDeclareClassMetadata({
579
+ minVersion: "12.0.0",
580
+ version: "22.3.0",
581
+ ngImport: i0,
582
+ type: SignaturePad,
583
+ decorators: [{
584
+ type: Component,
585
+ args: [{
586
+ selector: "ngs-signature-pad",
587
+ exportAs: "ngsSignaturePad",
588
+ standalone: true,
589
+ imports: [
590
+ ColorSwitcher,
591
+ Icon,
592
+ Button
593
+ ],
594
+ changeDetection: ChangeDetectionStrategy.OnPush,
595
+ host: {
596
+ "class": "ngs-signature-pad",
597
+ "(document:keydown.escape)": "handleEscapeKey($event)"
598
+ },
599
+ template: "<canvas #signatureCanvas\n class=\"signature-canvas\"\n width=\"500\"\n height=\"250\">\n Your browser does not support the HTML canvas tag.\n</canvas>\n<div class=\"line\"></div>\n<ngs-color-switcher\n [selectedColor]=\"penColor()\"\n [colors]=\"colors()\"\n (colorChange)=\"onColorChange($event)\"/>\n<div class=\"clear-button\">\n <button type=\"button\" ngsIconButton (click)=\"clear()\">\n <ngs-icon name=\"fluent:dismiss-24-regular\"/>\n </button>\n</div>\n",
600
+ styles: [":host{display:block;position:relative;width:100%;max-width:100%;background:var(--ngs-color-surface-container-lowest)}:host canvas{display:block;width:100%;height:250px;z-index:1;position:relative}:host .ngs-brand-colors{--ngs-brand-colors-color-size: calc(var(--spacing, .25rem) * 5);--ngs-brand-colors-gap: calc(var(--spacing, .25rem) * 2);position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:2}:host .clear-button{position:absolute;top:var(--spacing, .25rem);left:var(--spacing, .25rem);z-index:2}:host .line{position:absolute;height:1px;z-index:0;background:var(--ngs-color-surface-container-highest);left:40px;right:40px;bottom:50px}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
601
+ }]
602
+ }],
603
+ ctorParameters: () => [],
604
+ propDecorators: {
605
+ penColor: [{
606
+ type: i0.Input,
607
+ args: [{
608
+ isSignal: true,
609
+ alias: "penColor",
610
+ required: false
611
+ }]
612
+ }, {
613
+ type: i0.Output,
614
+ args: ["penColorChange"]
615
+ }],
616
+ lineWidth: [{
617
+ type: i0.Input,
618
+ args: [{
619
+ isSignal: true,
620
+ alias: "lineWidth",
621
+ required: false
622
+ }]
623
+ }],
624
+ backgroundColor: [{
625
+ type: i0.Input,
626
+ args: [{
627
+ isSignal: true,
628
+ alias: "backgroundColor",
629
+ required: false
630
+ }]
631
+ }],
632
+ lazyRadius: [{
633
+ type: i0.Input,
634
+ args: [{
635
+ isSignal: true,
636
+ alias: "lazyRadius",
637
+ required: false
638
+ }]
639
+ }],
640
+ lazyFriction: [{
641
+ type: i0.Input,
642
+ args: [{
643
+ isSignal: true,
644
+ alias: "lazyFriction",
645
+ required: false
646
+ }]
647
+ }],
648
+ lazyEnabled: [{
649
+ type: i0.Input,
650
+ args: [{
651
+ isSignal: true,
652
+ alias: "lazyEnabled",
653
+ required: false
654
+ }]
655
+ }],
656
+ colors: [{
657
+ type: i0.Input,
658
+ args: [{
659
+ isSignal: true,
660
+ alias: "colors",
661
+ required: false
662
+ }]
663
+ }],
664
+ signatureSaved: [{
665
+ type: i0.Output,
666
+ args: ["signatureSaved"]
667
+ }],
668
+ signatureCleared: [{
669
+ type: i0.Output,
670
+ args: ["signatureCleared"]
671
+ }],
672
+ mainCanvasRef: [{
673
+ type: i0.ViewChild,
674
+ args: ["signatureCanvas", { isSignal: true }]
675
+ }]
676
+ }
677
+ });
463
678
  const TYPED_SIGNATURE_DEFAULT_FONTS = [
464
- {
465
- label: 'Signature',
466
- family: 'Brush Script MT, Segoe Script, cursive',
467
- },
468
- {
469
- label: 'Handwritten',
470
- family: 'Snell Roundhand, Apple Chancery, cursive',
471
- },
472
- {
473
- label: 'Script',
474
- family: 'Segoe Script, Lucida Handwriting, cursive',
475
- },
476
- {
477
- label: 'Classic',
478
- family: 'Georgia, serif',
479
- },
679
+ {
680
+ label: "Signature",
681
+ family: "Brush Script MT, Segoe Script, cursive"
682
+ },
683
+ {
684
+ label: "Handwritten",
685
+ family: "Snell Roundhand, Apple Chancery, cursive"
686
+ },
687
+ {
688
+ label: "Script",
689
+ family: "Segoe Script, Lucida Handwriting, cursive"
690
+ },
691
+ {
692
+ label: "Classic",
693
+ family: "Georgia, serif"
694
+ }
480
695
  ];
481
- class TypedSignaturePad {
482
- document = inject(DOCUMENT$1);
483
- elementRef = inject(ElementRef);
484
- renderer = inject(Renderer2);
485
- inputRef = viewChild('signatureInput', /* @ts-ignore */
486
- ...(ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []));
487
- value = model('', /* @ts-ignore */
488
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
489
- fontFamily = model('Brush Script MT, Segoe Script, cursive', /* @ts-ignore */
490
- ...(ngDevMode ? [{ debugName: "fontFamily" }] : /* istanbul ignore next */ []));
491
- penColor = model('#000', /* @ts-ignore */
492
- ...(ngDevMode ? [{ debugName: "penColor" }] : /* istanbul ignore next */ []));
493
- placeholder = input('Type signature', /* @ts-ignore */
494
- ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
495
- colors = input(['#000', '#0059ff', '#ff0000'], /* @ts-ignore */
496
- ...(ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []));
497
- fonts = input(TYPED_SIGNATURE_DEFAULT_FONTS, /* @ts-ignore */
498
- ...(ngDevMode ? [{ debugName: "fonts" }] : /* istanbul ignore next */ []));
499
- signatureSaved = output();
500
- signatureTyped = output();
501
- signatureCleared = output();
502
- selectedFont = computed(() => this.fonts().find(font => font.family === this.fontFamily()) ??
503
- this.fonts()[0] ??
504
- TYPED_SIGNATURE_DEFAULT_FONTS[0], /* @ts-ignore */
505
- ...(ngDevMode ? [{ debugName: "selectedFont" }] : /* istanbul ignore next */ []));
506
- hasValue = computed(() => this.value().trim().length > 0, /* @ts-ignore */
507
- ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
508
- lastEmittedDataUrl = signal('', /* @ts-ignore */
509
- ...(ngDevMode ? [{ debugName: "lastEmittedDataUrl" }] : /* istanbul ignore next */ []));
510
- constructor() {
511
- effect(() => {
512
- this.setCssVar('--ngs-typed-signature-font', this.fontFamily());
513
- this.setCssVar('--ngs-typed-signature-color', this.penColor());
514
- });
515
- effect(() => {
516
- const typedValue = this.value().trim();
517
- this.fontFamily();
518
- this.penColor();
519
- if (!typedValue) {
520
- this.lastEmittedDataUrl.set('');
521
- return;
522
- }
523
- this.emitSignature();
524
- });
525
- }
526
- updateValue(value) {
527
- this.value.set(value);
528
- }
529
- selectFont(font) {
530
- this.fontFamily.set(font.family);
531
- this.focusInput();
532
- }
533
- onColorChange(color) {
534
- this.penColor.set(color);
535
- this.focusInput();
536
- }
537
- clear() {
538
- this.value.set('');
539
- this.lastEmittedDataUrl.set('');
540
- this.signatureCleared.emit();
541
- this.focusInput();
542
- }
543
- save() {
544
- if (!this.value().trim()) {
545
- return;
546
- }
547
- this.emitSignature(true);
548
- }
549
- handleEscapeKey(event) {
550
- event.preventDefault();
551
- this.clear();
552
- }
553
- emitSignature(force = false) {
554
- const dataUrl = this.createSignatureDataUrl();
555
- if (!force && dataUrl === this.lastEmittedDataUrl()) {
556
- return;
557
- }
558
- const signature = {
559
- value: this.value().trim(),
560
- fontFamily: this.fontFamily(),
561
- color: this.penColor(),
562
- dataUrl,
563
- };
564
- this.lastEmittedDataUrl.set(dataUrl);
565
- this.signatureSaved.emit(dataUrl);
566
- this.signatureTyped.emit(signature);
567
- }
568
- createSignatureDataUrl() {
569
- const rawValue = this.value().trim();
570
- const value = this.escapeXml(rawValue);
571
- const fontFamily = this.escapeXml(this.fontFamily());
572
- const color = this.escapeXml(this.penColor());
573
- const fontSize = 96;
574
- const paddingX = 8;
575
- const paddingY = 4;
576
- const textMetrics = this.measureSignatureText(rawValue, fontSize);
577
- const width = Math.ceil(textMetrics.width + paddingX * 2);
578
- const height = Math.ceil(textMetrics.ascent + textMetrics.descent + paddingY * 2);
579
- const textX = width / 2;
580
- const textY = paddingY + textMetrics.ascent;
581
- const centerY = height / 2;
582
- const svg = [
583
- `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}">`,
584
- `<rect width="${width}" height="${height}" fill="transparent"/>`,
585
- `<g transform="translate(${textX} ${centerY}) scale(0.9) translate(${-textX} ${-centerY})">`,
586
- `<text x="${textX}" y="${textY}" text-anchor="middle" fill="${color}" font-family="${fontFamily}" font-size="${fontSize}" font-weight="500">${value}</text>`,
587
- '</g>',
588
- '</svg>',
589
- ].join('');
590
- return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
591
- }
592
- measureSignatureText(value, fontSize) {
593
- const fallbackWidth = Math.max(fontSize * 0.5, value.length * fontSize * 0.55);
594
- const fallbackAscent = fontSize * 0.75;
595
- const fallbackDescent = fontSize * 0.15;
596
- const context = this.document.createElement('canvas').getContext('2d');
597
- if (!context) {
598
- return {
599
- width: fallbackWidth,
600
- ascent: fallbackAscent,
601
- descent: fallbackDescent,
602
- };
603
- }
604
- context.font = `500 ${fontSize}px ${this.fontFamily()}`;
605
- const metrics = context.measureText(value);
606
- return {
607
- width: Math.max(metrics.width, metrics.actualBoundingBoxLeft + metrics.actualBoundingBoxRight, fallbackWidth),
608
- ascent: Math.max(metrics.actualBoundingBoxAscent, fallbackAscent),
609
- descent: Math.max(metrics.actualBoundingBoxDescent, fallbackDescent),
610
- };
611
- }
612
- escapeXml(value) {
613
- return value
614
- .replace(/&/g, '&amp;')
615
- .replace(/</g, '&lt;')
616
- .replace(/>/g, '&gt;')
617
- .replace(/"/g, '&quot;')
618
- .replace(/'/g, '&apos;');
619
- }
620
- setCssVar(name, value) {
621
- this.renderer.setStyle(this.elementRef.nativeElement, name, value, RendererStyleFlags2.DashCase);
622
- }
623
- focusInput() {
624
- this.document.defaultView?.setTimeout(() => this.inputRef()?.nativeElement.focus(), 0);
625
- }
626
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TypedSignaturePad, deps: [], target: i0.ɵɵFactoryTarget.Component });
627
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: TypedSignaturePad, isStandalone: true, selector: "ngs-typed-signature-pad", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, fontFamily: { classPropertyName: "fontFamily", publicName: "fontFamily", isSignal: true, isRequired: false, transformFunction: null }, penColor: { classPropertyName: "penColor", publicName: "penColor", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, colors: { classPropertyName: "colors", publicName: "colors", isSignal: true, isRequired: false, transformFunction: null }, fonts: { classPropertyName: "fonts", publicName: "fonts", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", fontFamily: "fontFamilyChange", penColor: "penColorChange", signatureSaved: "signatureSaved", signatureTyped: "signatureTyped", signatureCleared: "signatureCleared" }, host: { listeners: { "document:keydown.escape": "handleEscapeKey($event)" }, classAttribute: "ngs-typed-signature-pad" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["signatureInput"], descendants: true, isSignal: true }], exportAs: ["ngsTypedSignaturePad"], ngImport: i0, template: "<div class=\"font-button\">\n <button\n class=\"typed-signature-clear\"\n ngsIconButton\n type=\"button\"\n aria-label=\"Clear typed signature\"\n (click)=\"clear()\"\n >\n <ngs-icon name=\"fluent:dismiss-24-regular\" />\n </button>\n\n <button\n class=\"typed-signature-font-trigger\"\n ngsButton=\"text\"\n reverse\n type=\"button\"\n [ngsMenuTriggerFor]=\"fontMenu\"\n >\n <span>{{ selectedFont().label }}</span>\n <ngs-icon name=\"fluent:chevron-down-24-filled\" />\n </button>\n</div>\n\n<input\n #signatureInput\n class=\"signature-canvas typed-signature-input\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-label=\"Typed signature\"\n [attr.placeholder]=\"placeholder()\"\n [value]=\"value()\"\n (input)=\"updateValue($any($event.target).value)\"\n/>\n\n<div class=\"line\" aria-hidden=\"true\"></div>\n\n<ngs-color-switcher\n [selectedColor]=\"penColor()\"\n [colors]=\"colors()\"\n (colorChange)=\"onColorChange($event)\"\n/>\n\n<ngs-menu #fontMenu=\"ngsMenu\">\n @for (font of fonts(); track font.family) {\n <button\n ngs-menu-item\n type=\"button\"\n [selected]=\"font.family === fontFamily()\"\n (click)=\"selectFont(font)\"\n >\n <span class=\"typed-signature-font-sample\">{{ font.label }}</span>\n </button>\n }\n</ngs-menu>\n", styles: [":host{--ngs-typed-signature-font: \"Brush Script MT\", \"Segoe Script\", cursive;--ngs-typed-signature-color: #000;display:block;position:relative;width:100%;max-width:100%;min-height:calc(var(--spacing, .25rem) * 62.5);overflow:hidden;background:var(--ngs-color-surface-container-lowest)}:host .signature-canvas{position:relative;z-index:1;display:block;width:100%;height:250px}:host .font-button{position:absolute;top:calc(var(--spacing, .25rem) * 3);left:calc(var(--spacing, .25rem) * 3);z-index:2;display:inline-flex;align-items:center;gap:var(--spacing, .25rem)}:host .font-button .typed-signature-font-trigger{--ngs-button-text-color: var(--ngs-color-on-surface);--ngs-button-hover-bg: transparent;--ngs-button-height: calc(var(--spacing, .25rem) * 8);--ngs-button-padding: calc(var(--spacing, .25rem) * 2);--ngs-button-content-gap: calc(var(--spacing, .25rem) * 1.5);min-width:0;font-size:var(--ngs-font-size-sm);font-weight:400}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-font-trigger{--ngs-button-text-color: color-mix(in srgb, var(--ngs-color-on-surface), transparent 38%)}}:host .font-button .typed-signature-font-trigger ngs-icon{--ngs-icon-size: calc(var(--spacing, .25rem) * 4);color:var(--ngs-color-on-surface)}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-font-trigger ngs-icon{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 54%)}}:host .font-button .typed-signature-font-trigger .icon{left:auto}:host .ngs-brand-colors{--ngs-brand-colors-color-size: calc(var(--spacing, .25rem) * 5);--ngs-brand-colors-gap: calc(var(--spacing, .25rem) * 2);position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:2}:host .typed-signature-input{box-sizing:border-box;padding:calc(var(--spacing, .25rem) * 18) calc(var(--spacing, .25rem) * 10) calc(var(--spacing, .25rem) * 14);border:0;background:transparent;color:var(--ngs-typed-signature-color);font-family:var(--ngs-typed-signature-font);font-size:80px;font-weight:500;line-height:1;outline:0;text-align:center}:host .typed-signature-input::placeholder{color:var(--ngs-color-on-surface);font-family:var(--ngs-font-family, inherit);font-size:var(--ngs-font-size-lg);font-weight:400}@supports (color: color-mix(in lab,red,red)){:host .typed-signature-input::placeholder{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 68%)}}:host .line{position:absolute;z-index:0;right:calc(var(--spacing, .25rem) * 10);bottom:calc(var(--spacing, .25rem) * 16.5);left:calc(var(--spacing, .25rem) * 10);height:1px;background:var(--ngs-color-surface-container-highest)}:host .font-button .typed-signature-clear{--ngs-icon-button-size: calc(var(--spacing, .25rem) * 8);--ngs-button-hover-bg: var(--ngs-color-surface-container-low);color:var(--ngs-color-on-surface)}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-clear{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 38%)}}:host .typed-signature-font-sample{font-family:var(--ngs-typed-signature-font)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: ColorSwitcher, selector: "ngs-color-switcher", inputs: ["colors", "selectedColor", "disabled"], outputs: ["colorChange"], exportAs: ["ngsColorSwitcher"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "component", type: Menu, selector: "ngs-menu", inputs: ["themeSource", "role", "classList", "xPosition", "yPosition", "pushIntoViewport"], outputs: ["closed"], exportAs: ["ngsMenu"] }, { kind: "component", type: MenuItem, selector: "ngs-menu-item, [ngs-menu-item]", inputs: ["disabled", "role", "selected"], outputs: ["_triggered"], exportAs: ["ngsMenuItem"] }, { kind: "directive", type: MenuTrigger, selector: "[ngsMenuTriggerFor]", inputs: ["ngsMenuTriggerFor", "ngsMenuTriggerData", "ngsMenuDisabled", "xPosition", "yPosition", "ngsMenuTriggerRestoreFocus"], outputs: ["menuOpened", "menuClosed"], exportAs: ["ngsMenuTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
628
- }
629
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TypedSignaturePad, decorators: [{
630
- type: Component,
631
- args: [{ selector: 'ngs-typed-signature-pad', exportAs: 'ngsTypedSignaturePad', standalone: true, imports: [
632
- Button,
633
- ColorSwitcher,
634
- Icon,
635
- Menu,
636
- MenuItem,
637
- MenuTrigger,
638
- ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
639
- class: 'ngs-typed-signature-pad',
640
- '(document:keydown.escape)': 'handleEscapeKey($event)',
641
- }, template: "<div class=\"font-button\">\n <button\n class=\"typed-signature-clear\"\n ngsIconButton\n type=\"button\"\n aria-label=\"Clear typed signature\"\n (click)=\"clear()\"\n >\n <ngs-icon name=\"fluent:dismiss-24-regular\" />\n </button>\n\n <button\n class=\"typed-signature-font-trigger\"\n ngsButton=\"text\"\n reverse\n type=\"button\"\n [ngsMenuTriggerFor]=\"fontMenu\"\n >\n <span>{{ selectedFont().label }}</span>\n <ngs-icon name=\"fluent:chevron-down-24-filled\" />\n </button>\n</div>\n\n<input\n #signatureInput\n class=\"signature-canvas typed-signature-input\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-label=\"Typed signature\"\n [attr.placeholder]=\"placeholder()\"\n [value]=\"value()\"\n (input)=\"updateValue($any($event.target).value)\"\n/>\n\n<div class=\"line\" aria-hidden=\"true\"></div>\n\n<ngs-color-switcher\n [selectedColor]=\"penColor()\"\n [colors]=\"colors()\"\n (colorChange)=\"onColorChange($event)\"\n/>\n\n<ngs-menu #fontMenu=\"ngsMenu\">\n @for (font of fonts(); track font.family) {\n <button\n ngs-menu-item\n type=\"button\"\n [selected]=\"font.family === fontFamily()\"\n (click)=\"selectFont(font)\"\n >\n <span class=\"typed-signature-font-sample\">{{ font.label }}</span>\n </button>\n }\n</ngs-menu>\n", styles: [":host{--ngs-typed-signature-font: \"Brush Script MT\", \"Segoe Script\", cursive;--ngs-typed-signature-color: #000;display:block;position:relative;width:100%;max-width:100%;min-height:calc(var(--spacing, .25rem) * 62.5);overflow:hidden;background:var(--ngs-color-surface-container-lowest)}:host .signature-canvas{position:relative;z-index:1;display:block;width:100%;height:250px}:host .font-button{position:absolute;top:calc(var(--spacing, .25rem) * 3);left:calc(var(--spacing, .25rem) * 3);z-index:2;display:inline-flex;align-items:center;gap:var(--spacing, .25rem)}:host .font-button .typed-signature-font-trigger{--ngs-button-text-color: var(--ngs-color-on-surface);--ngs-button-hover-bg: transparent;--ngs-button-height: calc(var(--spacing, .25rem) * 8);--ngs-button-padding: calc(var(--spacing, .25rem) * 2);--ngs-button-content-gap: calc(var(--spacing, .25rem) * 1.5);min-width:0;font-size:var(--ngs-font-size-sm);font-weight:400}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-font-trigger{--ngs-button-text-color: color-mix(in srgb, var(--ngs-color-on-surface), transparent 38%)}}:host .font-button .typed-signature-font-trigger ngs-icon{--ngs-icon-size: calc(var(--spacing, .25rem) * 4);color:var(--ngs-color-on-surface)}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-font-trigger ngs-icon{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 54%)}}:host .font-button .typed-signature-font-trigger .icon{left:auto}:host .ngs-brand-colors{--ngs-brand-colors-color-size: calc(var(--spacing, .25rem) * 5);--ngs-brand-colors-gap: calc(var(--spacing, .25rem) * 2);position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:2}:host .typed-signature-input{box-sizing:border-box;padding:calc(var(--spacing, .25rem) * 18) calc(var(--spacing, .25rem) * 10) calc(var(--spacing, .25rem) * 14);border:0;background:transparent;color:var(--ngs-typed-signature-color);font-family:var(--ngs-typed-signature-font);font-size:80px;font-weight:500;line-height:1;outline:0;text-align:center}:host .typed-signature-input::placeholder{color:var(--ngs-color-on-surface);font-family:var(--ngs-font-family, inherit);font-size:var(--ngs-font-size-lg);font-weight:400}@supports (color: color-mix(in lab,red,red)){:host .typed-signature-input::placeholder{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 68%)}}:host .line{position:absolute;z-index:0;right:calc(var(--spacing, .25rem) * 10);bottom:calc(var(--spacing, .25rem) * 16.5);left:calc(var(--spacing, .25rem) * 10);height:1px;background:var(--ngs-color-surface-container-highest)}:host .font-button .typed-signature-clear{--ngs-icon-button-size: calc(var(--spacing, .25rem) * 8);--ngs-button-hover-bg: var(--ngs-color-surface-container-low);color:var(--ngs-color-on-surface)}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-clear{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 38%)}}:host .typed-signature-font-sample{font-family:var(--ngs-typed-signature-font)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
642
- }], ctorParameters: () => [], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['signatureInput', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], fontFamily: [{ type: i0.Input, args: [{ isSignal: true, alias: "fontFamily", required: false }] }, { type: i0.Output, args: ["fontFamilyChange"] }], penColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "penColor", required: false }] }, { type: i0.Output, args: ["penColorChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], colors: [{ type: i0.Input, args: [{ isSignal: true, alias: "colors", required: false }] }], fonts: [{ type: i0.Input, args: [{ isSignal: true, alias: "fonts", required: false }] }], signatureSaved: [{ type: i0.Output, args: ["signatureSaved"] }], signatureTyped: [{ type: i0.Output, args: ["signatureTyped"] }], signatureCleared: [{ type: i0.Output, args: ["signatureCleared"] }] } });
643
-
644
- /**
645
- * Generated bundle index. Do not edit.
646
- */
647
-
696
+ var TypedSignaturePad = class TypedSignaturePad {
697
+ document = inject(DOCUMENT$1);
698
+ elementRef = inject(ElementRef);
699
+ renderer = inject(Renderer2);
700
+ inputRef = viewChild("signatureInput", ...ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []);
701
+ value = model("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
702
+ fontFamily = model("Brush Script MT, Segoe Script, cursive", ...ngDevMode ? [{ debugName: "fontFamily" }] : /* istanbul ignore next */ []);
703
+ penColor = model("#000", ...ngDevMode ? [{ debugName: "penColor" }] : /* istanbul ignore next */ []);
704
+ placeholder = input("Type signature", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
705
+ colors = input([
706
+ "#000",
707
+ "#0059ff",
708
+ "#ff0000"
709
+ ], ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
710
+ fonts = input(TYPED_SIGNATURE_DEFAULT_FONTS, ...ngDevMode ? [{ debugName: "fonts" }] : /* istanbul ignore next */ []);
711
+ signatureSaved = output();
712
+ signatureTyped = output();
713
+ signatureCleared = output();
714
+ selectedFont = computed(() => this.fonts().find((font) => font.family === this.fontFamily()) ?? this.fonts()[0] ?? TYPED_SIGNATURE_DEFAULT_FONTS[0], ...ngDevMode ? [{ debugName: "selectedFont" }] : /* istanbul ignore next */ []);
715
+ hasValue = computed(() => this.value().trim().length > 0, ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
716
+ lastEmittedDataUrl = signal("", ...ngDevMode ? [{ debugName: "lastEmittedDataUrl" }] : /* istanbul ignore next */ []);
717
+ constructor() {
718
+ effect(() => {
719
+ this.setCssVar("--ngs-typed-signature-font", this.fontFamily());
720
+ this.setCssVar("--ngs-typed-signature-color", this.penColor());
721
+ });
722
+ effect(() => {
723
+ const typedValue = this.value().trim();
724
+ this.fontFamily();
725
+ this.penColor();
726
+ if (!typedValue) {
727
+ this.lastEmittedDataUrl.set("");
728
+ return;
729
+ }
730
+ this.emitSignature();
731
+ });
732
+ }
733
+ updateValue(value) {
734
+ this.value.set(value);
735
+ }
736
+ selectFont(font) {
737
+ this.fontFamily.set(font.family);
738
+ this.focusInput();
739
+ }
740
+ onColorChange(color) {
741
+ this.penColor.set(color);
742
+ this.focusInput();
743
+ }
744
+ clear() {
745
+ this.value.set("");
746
+ this.lastEmittedDataUrl.set("");
747
+ this.signatureCleared.emit();
748
+ this.focusInput();
749
+ }
750
+ save() {
751
+ if (!this.value().trim()) return;
752
+ this.emitSignature(true);
753
+ }
754
+ handleEscapeKey(event) {
755
+ event.preventDefault();
756
+ this.clear();
757
+ }
758
+ emitSignature(force = false) {
759
+ const dataUrl = this.createSignatureDataUrl();
760
+ if (!force && dataUrl === this.lastEmittedDataUrl()) return;
761
+ const signature = {
762
+ value: this.value().trim(),
763
+ fontFamily: this.fontFamily(),
764
+ color: this.penColor(),
765
+ dataUrl
766
+ };
767
+ this.lastEmittedDataUrl.set(dataUrl);
768
+ this.signatureSaved.emit(dataUrl);
769
+ this.signatureTyped.emit(signature);
770
+ }
771
+ createSignatureDataUrl() {
772
+ const rawValue = this.value().trim();
773
+ const value = this.escapeXml(rawValue);
774
+ const fontFamily = this.escapeXml(this.fontFamily());
775
+ const color = this.escapeXml(this.penColor());
776
+ const fontSize = 96;
777
+ const paddingY = 4;
778
+ const textMetrics = this.measureSignatureText(rawValue, fontSize);
779
+ const width = Math.ceil(textMetrics.width + 16);
780
+ const height = Math.ceil(textMetrics.ascent + textMetrics.descent + 8);
781
+ const textX = width / 2;
782
+ const textY = paddingY + textMetrics.ascent;
783
+ const centerY = height / 2;
784
+ const svg = [
785
+ `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}">`,
786
+ `<rect width="${width}" height="${height}" fill="transparent"/>`,
787
+ `<g transform="translate(${textX} ${centerY}) scale(0.9) translate(${-textX} ${-centerY})">`,
788
+ `<text x="${textX}" y="${textY}" text-anchor="middle" fill="${color}" font-family="${fontFamily}" font-size="${fontSize}" font-weight="500">${value}</text>`,
789
+ "</g>",
790
+ "</svg>"
791
+ ].join("");
792
+ return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
793
+ }
794
+ measureSignatureText(value, fontSize) {
795
+ const fallbackWidth = Math.max(fontSize * .5, value.length * fontSize * .55);
796
+ const fallbackAscent = fontSize * .75;
797
+ const fallbackDescent = fontSize * .15;
798
+ const context = this.document.createElement("canvas").getContext("2d");
799
+ if (!context) return {
800
+ width: fallbackWidth,
801
+ ascent: fallbackAscent,
802
+ descent: fallbackDescent
803
+ };
804
+ context.font = `500 ${fontSize}px ${this.fontFamily()}`;
805
+ const metrics = context.measureText(value);
806
+ return {
807
+ width: Math.max(metrics.width, metrics.actualBoundingBoxLeft + metrics.actualBoundingBoxRight, fallbackWidth),
808
+ ascent: Math.max(metrics.actualBoundingBoxAscent, fallbackAscent),
809
+ descent: Math.max(metrics.actualBoundingBoxDescent, fallbackDescent)
810
+ };
811
+ }
812
+ escapeXml(value) {
813
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
814
+ }
815
+ setCssVar(name, value) {
816
+ this.renderer.setStyle(this.elementRef.nativeElement, name, value, RendererStyleFlags2.DashCase);
817
+ }
818
+ focusInput() {
819
+ this.document.defaultView?.setTimeout(() => this.inputRef()?.nativeElement.focus(), 0);
820
+ }
821
+ static ɵfac = i0.ɵɵngDeclareFactory({
822
+ minVersion: "12.0.0",
823
+ version: "22.3.0",
824
+ ngImport: i0,
825
+ type: TypedSignaturePad,
826
+ deps: [],
827
+ target: i0.ɵɵFactoryTarget.Component
828
+ });
829
+ static ɵcmp = i0.ɵɵngDeclareComponent({
830
+ minVersion: "17.0.0",
831
+ version: "22.3.0",
832
+ type: TypedSignaturePad,
833
+ isStandalone: true,
834
+ selector: "ngs-typed-signature-pad",
835
+ inputs: {
836
+ value: {
837
+ classPropertyName: "value",
838
+ publicName: "value",
839
+ isSignal: true,
840
+ isRequired: false,
841
+ transformFunction: null
842
+ },
843
+ fontFamily: {
844
+ classPropertyName: "fontFamily",
845
+ publicName: "fontFamily",
846
+ isSignal: true,
847
+ isRequired: false,
848
+ transformFunction: null
849
+ },
850
+ penColor: {
851
+ classPropertyName: "penColor",
852
+ publicName: "penColor",
853
+ isSignal: true,
854
+ isRequired: false,
855
+ transformFunction: null
856
+ },
857
+ placeholder: {
858
+ classPropertyName: "placeholder",
859
+ publicName: "placeholder",
860
+ isSignal: true,
861
+ isRequired: false,
862
+ transformFunction: null
863
+ },
864
+ colors: {
865
+ classPropertyName: "colors",
866
+ publicName: "colors",
867
+ isSignal: true,
868
+ isRequired: false,
869
+ transformFunction: null
870
+ },
871
+ fonts: {
872
+ classPropertyName: "fonts",
873
+ publicName: "fonts",
874
+ isSignal: true,
875
+ isRequired: false,
876
+ transformFunction: null
877
+ }
878
+ },
879
+ outputs: {
880
+ value: "valueChange",
881
+ fontFamily: "fontFamilyChange",
882
+ penColor: "penColorChange",
883
+ signatureSaved: "signatureSaved",
884
+ signatureTyped: "signatureTyped",
885
+ signatureCleared: "signatureCleared"
886
+ },
887
+ host: {
888
+ listeners: { "document:keydown.escape": "handleEscapeKey($event)" },
889
+ classAttribute: "ngs-typed-signature-pad"
890
+ },
891
+ viewQueries: [{
892
+ propertyName: "inputRef",
893
+ first: true,
894
+ predicate: ["signatureInput"],
895
+ descendants: true,
896
+ isSignal: true
897
+ }],
898
+ exportAs: ["ngsTypedSignaturePad"],
899
+ ngImport: i0,
900
+ template: "<div class=\"font-button\">\n <button\n class=\"typed-signature-clear\"\n ngsIconButton\n type=\"button\"\n aria-label=\"Clear typed signature\"\n (click)=\"clear()\"\n >\n <ngs-icon name=\"fluent:dismiss-24-regular\" />\n </button>\n\n <button\n class=\"typed-signature-font-trigger\"\n ngsButton=\"text\"\n reverse\n type=\"button\"\n [ngsMenuTriggerFor]=\"fontMenu\"\n >\n <span>{{ selectedFont().label }}</span>\n <ngs-icon name=\"fluent:chevron-down-24-filled\" />\n </button>\n</div>\n\n<input\n #signatureInput\n class=\"signature-canvas typed-signature-input\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-label=\"Typed signature\"\n [attr.placeholder]=\"placeholder()\"\n [value]=\"value()\"\n (input)=\"updateValue($any($event.target).value)\"\n/>\n\n<div class=\"line\" aria-hidden=\"true\"></div>\n\n<ngs-color-switcher\n [selectedColor]=\"penColor()\"\n [colors]=\"colors()\"\n (colorChange)=\"onColorChange($event)\"\n/>\n\n<ngs-menu #fontMenu=\"ngsMenu\">\n @for (font of fonts(); track font.family) {\n <button\n ngs-menu-item\n type=\"button\"\n [selected]=\"font.family === fontFamily()\"\n (click)=\"selectFont(font)\"\n >\n <span class=\"typed-signature-font-sample\">{{ font.label }}</span>\n </button>\n }\n</ngs-menu>\n",
901
+ styles: [":host{--ngs-typed-signature-font: \"Brush Script MT\", \"Segoe Script\", cursive;--ngs-typed-signature-color: #000;display:block;position:relative;width:100%;max-width:100%;min-height:calc(var(--spacing, .25rem) * 62.5);overflow:hidden;background:var(--ngs-color-surface-container-lowest)}:host .signature-canvas{position:relative;z-index:1;display:block;width:100%;height:250px}:host .font-button{position:absolute;top:calc(var(--spacing, .25rem) * 3);left:calc(var(--spacing, .25rem) * 3);z-index:2;display:inline-flex;align-items:center;gap:var(--spacing, .25rem)}:host .font-button .typed-signature-font-trigger{--ngs-button-text-color: var(--ngs-color-on-surface);--ngs-button-hover-bg: transparent;--ngs-button-height: calc(var(--spacing, .25rem) * 8);--ngs-button-padding: calc(var(--spacing, .25rem) * 2);--ngs-button-content-gap: calc(var(--spacing, .25rem) * 1.5);min-width:0;font-size:var(--ngs-font-size-sm);font-weight:400}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-font-trigger{--ngs-button-text-color: color-mix(in srgb, var(--ngs-color-on-surface), transparent 38%)}}:host .font-button .typed-signature-font-trigger ngs-icon{--ngs-icon-size: calc(var(--spacing, .25rem) * 4);color:var(--ngs-color-on-surface)}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-font-trigger ngs-icon{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 54%)}}:host .font-button .typed-signature-font-trigger .icon{left:auto}:host .ngs-brand-colors{--ngs-brand-colors-color-size: calc(var(--spacing, .25rem) * 5);--ngs-brand-colors-gap: calc(var(--spacing, .25rem) * 2);position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:2}:host .typed-signature-input{box-sizing:border-box;padding:calc(var(--spacing, .25rem) * 18) calc(var(--spacing, .25rem) * 10) calc(var(--spacing, .25rem) * 14);border:0;background:transparent;color:var(--ngs-typed-signature-color);font-family:var(--ngs-typed-signature-font);font-size:80px;font-weight:500;line-height:1;outline:0;text-align:center}:host .typed-signature-input::placeholder{color:var(--ngs-color-on-surface);font-family:var(--ngs-font-family, inherit);font-size:var(--ngs-font-size-lg);font-weight:400}@supports (color: color-mix(in lab,red,red)){:host .typed-signature-input::placeholder{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 68%)}}:host .line{position:absolute;z-index:0;right:calc(var(--spacing, .25rem) * 10);bottom:calc(var(--spacing, .25rem) * 16.5);left:calc(var(--spacing, .25rem) * 10);height:1px;background:var(--ngs-color-surface-container-highest)}:host .font-button .typed-signature-clear{--ngs-icon-button-size: calc(var(--spacing, .25rem) * 8);--ngs-button-hover-bg: var(--ngs-color-surface-container-low);color:var(--ngs-color-on-surface)}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-clear{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 38%)}}:host .typed-signature-font-sample{font-family:var(--ngs-typed-signature-font)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
902
+ dependencies: [
903
+ {
904
+ kind: "component",
905
+ type: Button,
906
+ selector: "\n button[ngsButton], button[ngsIconButton],\n a[ngsButton], a[ngsIconButton]\n ",
907
+ inputs: [
908
+ "ngsButton",
909
+ "ngsIconButton",
910
+ "loading",
911
+ "disabled",
912
+ "disabledInteractive",
913
+ "disableRipple",
914
+ "reverse",
915
+ "fullWidth",
916
+ "hideTextOnMobile"
917
+ ],
918
+ exportAs: ["ngsButton"]
919
+ },
920
+ {
921
+ kind: "component",
922
+ type: ColorSwitcher,
923
+ selector: "ngs-color-switcher",
924
+ inputs: [
925
+ "readonly",
926
+ "value",
927
+ "colors",
928
+ "selectedColor",
929
+ "disabled"
930
+ ],
931
+ outputs: [
932
+ "touch",
933
+ "valueChange",
934
+ "colorChange"
935
+ ],
936
+ exportAs: ["ngsColorSwitcher"]
937
+ },
938
+ {
939
+ kind: "component",
940
+ type: Icon,
941
+ selector: "ngs-icon",
942
+ inputs: ["name"],
943
+ exportAs: ["ngsIcon"]
944
+ },
945
+ {
946
+ kind: "component",
947
+ type: Menu,
948
+ selector: "ngs-menu",
949
+ inputs: [
950
+ "themeSource",
951
+ "role",
952
+ "classList",
953
+ "xPosition",
954
+ "yPosition",
955
+ "pushIntoViewport"
956
+ ],
957
+ outputs: ["closed"],
958
+ exportAs: ["ngsMenu"]
959
+ },
960
+ {
961
+ kind: "component",
962
+ type: MenuItem,
963
+ selector: "ngs-menu-item, [ngs-menu-item]",
964
+ inputs: [
965
+ "disabled",
966
+ "role",
967
+ "selected"
968
+ ],
969
+ outputs: ["_triggered"],
970
+ exportAs: ["ngsMenuItem"]
971
+ },
972
+ {
973
+ kind: "directive",
974
+ type: MenuTrigger,
975
+ selector: "[ngsMenuTriggerFor]",
976
+ inputs: [
977
+ "ngsMenuTriggerFor",
978
+ "ngsMenuTriggerData",
979
+ "ngsMenuDisabled",
980
+ "xPosition",
981
+ "yPosition",
982
+ "ngsMenuTriggerRestoreFocus"
983
+ ],
984
+ outputs: ["menuOpened", "menuClosed"],
985
+ exportAs: ["ngsMenuTrigger"]
986
+ }
987
+ ],
988
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
989
+ });
990
+ };
991
+ i0.ɵɵngDeclareClassMetadata({
992
+ minVersion: "12.0.0",
993
+ version: "22.3.0",
994
+ ngImport: i0,
995
+ type: TypedSignaturePad,
996
+ decorators: [{
997
+ type: Component,
998
+ args: [{
999
+ selector: "ngs-typed-signature-pad",
1000
+ exportAs: "ngsTypedSignaturePad",
1001
+ standalone: true,
1002
+ imports: [
1003
+ Button,
1004
+ ColorSwitcher,
1005
+ Icon,
1006
+ Menu,
1007
+ MenuItem,
1008
+ MenuTrigger
1009
+ ],
1010
+ changeDetection: ChangeDetectionStrategy.OnPush,
1011
+ host: {
1012
+ class: "ngs-typed-signature-pad",
1013
+ "(document:keydown.escape)": "handleEscapeKey($event)"
1014
+ },
1015
+ template: "<div class=\"font-button\">\n <button\n class=\"typed-signature-clear\"\n ngsIconButton\n type=\"button\"\n aria-label=\"Clear typed signature\"\n (click)=\"clear()\"\n >\n <ngs-icon name=\"fluent:dismiss-24-regular\" />\n </button>\n\n <button\n class=\"typed-signature-font-trigger\"\n ngsButton=\"text\"\n reverse\n type=\"button\"\n [ngsMenuTriggerFor]=\"fontMenu\"\n >\n <span>{{ selectedFont().label }}</span>\n <ngs-icon name=\"fluent:chevron-down-24-filled\" />\n </button>\n</div>\n\n<input\n #signatureInput\n class=\"signature-canvas typed-signature-input\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-label=\"Typed signature\"\n [attr.placeholder]=\"placeholder()\"\n [value]=\"value()\"\n (input)=\"updateValue($any($event.target).value)\"\n/>\n\n<div class=\"line\" aria-hidden=\"true\"></div>\n\n<ngs-color-switcher\n [selectedColor]=\"penColor()\"\n [colors]=\"colors()\"\n (colorChange)=\"onColorChange($event)\"\n/>\n\n<ngs-menu #fontMenu=\"ngsMenu\">\n @for (font of fonts(); track font.family) {\n <button\n ngs-menu-item\n type=\"button\"\n [selected]=\"font.family === fontFamily()\"\n (click)=\"selectFont(font)\"\n >\n <span class=\"typed-signature-font-sample\">{{ font.label }}</span>\n </button>\n }\n</ngs-menu>\n",
1016
+ styles: [":host{--ngs-typed-signature-font: \"Brush Script MT\", \"Segoe Script\", cursive;--ngs-typed-signature-color: #000;display:block;position:relative;width:100%;max-width:100%;min-height:calc(var(--spacing, .25rem) * 62.5);overflow:hidden;background:var(--ngs-color-surface-container-lowest)}:host .signature-canvas{position:relative;z-index:1;display:block;width:100%;height:250px}:host .font-button{position:absolute;top:calc(var(--spacing, .25rem) * 3);left:calc(var(--spacing, .25rem) * 3);z-index:2;display:inline-flex;align-items:center;gap:var(--spacing, .25rem)}:host .font-button .typed-signature-font-trigger{--ngs-button-text-color: var(--ngs-color-on-surface);--ngs-button-hover-bg: transparent;--ngs-button-height: calc(var(--spacing, .25rem) * 8);--ngs-button-padding: calc(var(--spacing, .25rem) * 2);--ngs-button-content-gap: calc(var(--spacing, .25rem) * 1.5);min-width:0;font-size:var(--ngs-font-size-sm);font-weight:400}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-font-trigger{--ngs-button-text-color: color-mix(in srgb, var(--ngs-color-on-surface), transparent 38%)}}:host .font-button .typed-signature-font-trigger ngs-icon{--ngs-icon-size: calc(var(--spacing, .25rem) * 4);color:var(--ngs-color-on-surface)}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-font-trigger ngs-icon{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 54%)}}:host .font-button .typed-signature-font-trigger .icon{left:auto}:host .ngs-brand-colors{--ngs-brand-colors-color-size: calc(var(--spacing, .25rem) * 5);--ngs-brand-colors-gap: calc(var(--spacing, .25rem) * 2);position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:2}:host .typed-signature-input{box-sizing:border-box;padding:calc(var(--spacing, .25rem) * 18) calc(var(--spacing, .25rem) * 10) calc(var(--spacing, .25rem) * 14);border:0;background:transparent;color:var(--ngs-typed-signature-color);font-family:var(--ngs-typed-signature-font);font-size:80px;font-weight:500;line-height:1;outline:0;text-align:center}:host .typed-signature-input::placeholder{color:var(--ngs-color-on-surface);font-family:var(--ngs-font-family, inherit);font-size:var(--ngs-font-size-lg);font-weight:400}@supports (color: color-mix(in lab,red,red)){:host .typed-signature-input::placeholder{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 68%)}}:host .line{position:absolute;z-index:0;right:calc(var(--spacing, .25rem) * 10);bottom:calc(var(--spacing, .25rem) * 16.5);left:calc(var(--spacing, .25rem) * 10);height:1px;background:var(--ngs-color-surface-container-highest)}:host .font-button .typed-signature-clear{--ngs-icon-button-size: calc(var(--spacing, .25rem) * 8);--ngs-button-hover-bg: var(--ngs-color-surface-container-low);color:var(--ngs-color-on-surface)}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-clear{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 38%)}}:host .typed-signature-font-sample{font-family:var(--ngs-typed-signature-font)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
1017
+ }]
1018
+ }],
1019
+ ctorParameters: () => [],
1020
+ propDecorators: {
1021
+ inputRef: [{
1022
+ type: i0.ViewChild,
1023
+ args: ["signatureInput", { isSignal: true }]
1024
+ }],
1025
+ value: [{
1026
+ type: i0.Input,
1027
+ args: [{
1028
+ isSignal: true,
1029
+ alias: "value",
1030
+ required: false
1031
+ }]
1032
+ }, {
1033
+ type: i0.Output,
1034
+ args: ["valueChange"]
1035
+ }],
1036
+ fontFamily: [{
1037
+ type: i0.Input,
1038
+ args: [{
1039
+ isSignal: true,
1040
+ alias: "fontFamily",
1041
+ required: false
1042
+ }]
1043
+ }, {
1044
+ type: i0.Output,
1045
+ args: ["fontFamilyChange"]
1046
+ }],
1047
+ penColor: [{
1048
+ type: i0.Input,
1049
+ args: [{
1050
+ isSignal: true,
1051
+ alias: "penColor",
1052
+ required: false
1053
+ }]
1054
+ }, {
1055
+ type: i0.Output,
1056
+ args: ["penColorChange"]
1057
+ }],
1058
+ placeholder: [{
1059
+ type: i0.Input,
1060
+ args: [{
1061
+ isSignal: true,
1062
+ alias: "placeholder",
1063
+ required: false
1064
+ }]
1065
+ }],
1066
+ colors: [{
1067
+ type: i0.Input,
1068
+ args: [{
1069
+ isSignal: true,
1070
+ alias: "colors",
1071
+ required: false
1072
+ }]
1073
+ }],
1074
+ fonts: [{
1075
+ type: i0.Input,
1076
+ args: [{
1077
+ isSignal: true,
1078
+ alias: "fonts",
1079
+ required: false
1080
+ }]
1081
+ }],
1082
+ signatureSaved: [{
1083
+ type: i0.Output,
1084
+ args: ["signatureSaved"]
1085
+ }],
1086
+ signatureTyped: [{
1087
+ type: i0.Output,
1088
+ args: ["signatureTyped"]
1089
+ }],
1090
+ signatureCleared: [{
1091
+ type: i0.Output,
1092
+ args: ["signatureCleared"]
1093
+ }]
1094
+ }
1095
+ });
648
1096
  export { SignaturePad, TypedSignaturePad };
649
- //# sourceMappingURL=ngstarter-ui-components-signature-pad.mjs.map
1097
+
1098
+ //# sourceMappingURL=ngstarter-ui-components-signature-pad.mjs.map