@ngstarter-ui/components 22.3.6 → 22.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/README.md +27 -0
  2. package/ai/component-registry.json +186 -101
  3. package/fesm2022/attachment-block-BK9QxVjq.mjs +163 -0
  4. package/fesm2022/attachment-block-BK9QxVjq.mjs.map +1 -0
  5. package/fesm2022/callout-block-Bl4GZYz8.mjs +196 -0
  6. package/fesm2022/callout-block-Bl4GZYz8.mjs.map +1 -0
  7. package/fesm2022/code-block.component-DCRD-9iP.mjs +393 -0
  8. package/fesm2022/code-block.component-DCRD-9iP.mjs.map +1 -0
  9. package/fesm2022/content-builder.store-D622mHxt.mjs +328 -0
  10. package/fesm2022/content-builder.store-D622mHxt.mjs.map +1 -0
  11. package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs +1110 -0
  12. package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs.map +1 -0
  13. package/fesm2022/cursor-controller-DKfBII1n.mjs +55 -0
  14. package/fesm2022/cursor-controller-DKfBII1n.mjs.map +1 -0
  15. package/fesm2022/default-converters-9oSKDsXP.mjs +140 -0
  16. package/fesm2022/default-converters-9oSKDsXP.mjs.map +1 -0
  17. package/fesm2022/divider-block.component-Dvgeq_D0.mjs +148 -0
  18. package/fesm2022/divider-block.component-Dvgeq_D0.mjs.map +1 -0
  19. package/fesm2022/embed-block-CYkOv4Wt.mjs +565 -0
  20. package/fesm2022/embed-block-CYkOv4Wt.mjs.map +1 -0
  21. package/fesm2022/extra-block-defs-Cn_hfM3c.mjs +122 -0
  22. package/fesm2022/extra-block-defs-Cn_hfM3c.mjs.map +1 -0
  23. package/fesm2022/gallery-block-DT3uIURY.mjs +365 -0
  24. package/fesm2022/gallery-block-DT3uIURY.mjs.map +1 -0
  25. package/fesm2022/grid-block-ZVDT3m8-.mjs +504 -0
  26. package/fesm2022/grid-block-ZVDT3m8-.mjs.map +1 -0
  27. package/fesm2022/heading-block.component-iCpJGTMh.mjs +274 -0
  28. package/fesm2022/heading-block.component-iCpJGTMh.mjs.map +1 -0
  29. package/fesm2022/html-utils-DywL8gGa.mjs +24 -0
  30. package/fesm2022/html-utils-DywL8gGa.mjs.map +1 -0
  31. package/fesm2022/image-block.component-DJ7-HCR8.mjs +285 -0
  32. package/fesm2022/image-block.component-DJ7-HCR8.mjs.map +1 -0
  33. package/fesm2022/list-block.component-qFIebEBO.mjs +312 -0
  34. package/fesm2022/list-block.component-qFIebEBO.mjs.map +1 -0
  35. package/fesm2022/nested-blocks-CXhgXJ1H.mjs +345 -0
  36. package/fesm2022/nested-blocks-CXhgXJ1H.mjs.map +1 -0
  37. package/fesm2022/ngstarter-ui-components-action-required.mjs +150 -45
  38. package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -1
  39. package/fesm2022/ngstarter-ui-components-alert.mjs +318 -133
  40. package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -1
  41. package/fesm2022/ngstarter-ui-components-announcement.mjs +280 -88
  42. package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -1
  43. package/fesm2022/ngstarter-ui-components-autocomplete.mjs +647 -386
  44. package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
  45. package/fesm2022/ngstarter-ui-components-avatar.mjs +715 -482
  46. package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -1
  47. package/fesm2022/ngstarter-ui-components-badge.mjs +308 -97
  48. package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -1
  49. package/fesm2022/ngstarter-ui-components-block-loader.mjs +164 -47
  50. package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -1
  51. package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs +278 -315
  52. package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs.map +1 -1
  53. package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +707 -205
  54. package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -1
  55. package/fesm2022/ngstarter-ui-components-button-toggle.mjs +518 -175
  56. package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -1
  57. package/fesm2022/ngstarter-ui-components-button.mjs +294 -68
  58. package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
  59. package/fesm2022/ngstarter-ui-components-calendar.mjs +442 -250
  60. package/fesm2022/ngstarter-ui-components-calendar.mjs.map +1 -1
  61. package/fesm2022/ngstarter-ui-components-card-overlay.mjs +159 -47
  62. package/fesm2022/ngstarter-ui-components-card-overlay.mjs.map +1 -1
  63. package/fesm2022/ngstarter-ui-components-card.mjs +619 -194
  64. package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -1
  65. package/fesm2022/ngstarter-ui-components-carousel.mjs +1012 -634
  66. package/fesm2022/ngstarter-ui-components-carousel.mjs.map +1 -1
  67. package/fesm2022/ngstarter-ui-components-checkbox.mjs +715 -308
  68. package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -1
  69. package/fesm2022/ngstarter-ui-components-chips.mjs +1397 -667
  70. package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -1
  71. package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +519 -357
  72. package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -1
  73. package/fesm2022/ngstarter-ui-components-color-picker.mjs +1218 -604
  74. package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -1
  75. package/fesm2022/ngstarter-ui-components-color-scheme.mjs +265 -134
  76. package/fesm2022/ngstarter-ui-components-color-scheme.mjs.map +1 -1
  77. package/fesm2022/ngstarter-ui-components-color-switcher.mjs +190 -71
  78. package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -1
  79. package/fesm2022/ngstarter-ui-components-command-bar.mjs +197 -58
  80. package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -1
  81. package/fesm2022/ngstarter-ui-components-comment-editor.mjs +2212 -1128
  82. package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -1
  83. package/fesm2022/ngstarter-ui-components-comparison-slider.mjs +269 -183
  84. package/fesm2022/ngstarter-ui-components-comparison-slider.mjs.map +1 -1
  85. package/fesm2022/ngstarter-ui-components-confirm.mjs +164 -86
  86. package/fesm2022/ngstarter-ui-components-confirm.mjs.map +1 -1
  87. package/fesm2022/ngstarter-ui-components-content-editor.mjs +6240 -2
  88. package/fesm2022/ngstarter-ui-components-content-editor.mjs.map +1 -1
  89. package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +244 -108
  90. package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -1
  91. package/fesm2022/ngstarter-ui-components-core.mjs +2110 -1592
  92. package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
  93. package/fesm2022/ngstarter-ui-components-country-select.mjs +1970 -588
  94. package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
  95. package/fesm2022/ngstarter-ui-components-crop.mjs +249 -191
  96. package/fesm2022/ngstarter-ui-components-crop.mjs.map +1 -1
  97. package/fesm2022/ngstarter-ui-components-currency-select.mjs +1658 -452
  98. package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
  99. package/fesm2022/ngstarter-ui-components-data-view.mjs +4538 -2497
  100. package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
  101. package/fesm2022/ngstarter-ui-components-date-format-select.mjs +357 -157
  102. package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -1
  103. package/fesm2022/ngstarter-ui-components-datepicker.mjs +2587 -1264
  104. package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
  105. package/fesm2022/ngstarter-ui-components-dialog.mjs +681 -385
  106. package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -1
  107. package/fesm2022/ngstarter-ui-components-digit-roller.mjs +1000 -750
  108. package/fesm2022/ngstarter-ui-components-digit-roller.mjs.map +1 -1
  109. package/fesm2022/ngstarter-ui-components-divider.mjs +164 -41
  110. package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -1
  111. package/fesm2022/ngstarter-ui-components-drawer.mjs +218 -143
  112. package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -1
  113. package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +345 -247
  114. package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -1
  115. package/fesm2022/ngstarter-ui-components-empty-state.mjs +244 -74
  116. package/fesm2022/ngstarter-ui-components-empty-state.mjs.map +1 -1
  117. package/fesm2022/ngstarter-ui-components-events.mjs +467 -126
  118. package/fesm2022/ngstarter-ui-components-events.mjs.map +1 -1
  119. package/fesm2022/ngstarter-ui-components-expand.mjs +191 -59
  120. package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -1
  121. package/fesm2022/ngstarter-ui-components-expansion.mjs +529 -193
  122. package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -1
  123. package/fesm2022/ngstarter-ui-components-file-type.mjs +270 -171
  124. package/fesm2022/ngstarter-ui-components-file-type.mjs.map +1 -1
  125. package/fesm2022/ngstarter-ui-components-filter-builder.mjs +741 -352
  126. package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
  127. package/fesm2022/ngstarter-ui-components-form-builder.mjs +9032 -6964
  128. package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
  129. package/fesm2022/ngstarter-ui-components-form-field.mjs +741 -276
  130. package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -1
  131. package/fesm2022/ngstarter-ui-components-gauge.mjs +155 -43
  132. package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -1
  133. package/fesm2022/ngstarter-ui-components-grid.mjs +197 -81
  134. package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -1
  135. package/fesm2022/ngstarter-ui-components-guided-tour.mjs +881 -740
  136. package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -1
  137. package/fesm2022/ngstarter-ui-components-headless-editor.mjs +3573 -3656
  138. package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
  139. package/fesm2022/ngstarter-ui-components-headless-stepper.mjs +277 -204
  140. package/fesm2022/ngstarter-ui-components-headless-stepper.mjs.map +1 -1
  141. package/fesm2022/ngstarter-ui-components-icon.mjs +209 -182
  142. package/fesm2022/ngstarter-ui-components-icon.mjs.map +1 -1
  143. package/fesm2022/ngstarter-ui-components-image-designer.mjs +5096 -4066
  144. package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
  145. package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +45 -19
  146. package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -1
  147. package/fesm2022/ngstarter-ui-components-image-resizer.mjs +333 -154
  148. package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -1
  149. package/fesm2022/ngstarter-ui-components-image-viewer.mjs +564 -358
  150. package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -1
  151. package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +246 -167
  152. package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -1
  153. package/fesm2022/ngstarter-ui-components-incidents.mjs +732 -258
  154. package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -1
  155. package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +244 -182
  156. package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -1
  157. package/fesm2022/ngstarter-ui-components-input-mask.mjs +314 -174
  158. package/fesm2022/ngstarter-ui-components-input-mask.mjs.map +1 -1
  159. package/fesm2022/ngstarter-ui-components-input-validator.mjs +45 -69
  160. package/fesm2022/ngstarter-ui-components-input-validator.mjs.map +1 -1
  161. package/fesm2022/ngstarter-ui-components-input.mjs +303 -161
  162. package/fesm2022/ngstarter-ui-components-input.mjs.map +1 -1
  163. package/fesm2022/ngstarter-ui-components-kanban-board.mjs +504 -159
  164. package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
  165. package/fesm2022/ngstarter-ui-components-kbd.mjs +86 -30
  166. package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -1
  167. package/fesm2022/ngstarter-ui-components-layout.mjs +681 -220
  168. package/fesm2022/ngstarter-ui-components-layout.mjs.map +1 -1
  169. package/fesm2022/ngstarter-ui-components-list.mjs +968 -281
  170. package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -1
  171. package/fesm2022/ngstarter-ui-components-logo.mjs +181 -51
  172. package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -1
  173. package/fesm2022/ngstarter-ui-components-marquee.mjs +226 -147
  174. package/fesm2022/ngstarter-ui-components-marquee.mjs.map +1 -1
  175. package/fesm2022/ngstarter-ui-components-menu.mjs +1686 -1091
  176. package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
  177. package/fesm2022/ngstarter-ui-components-micro-chart.mjs +1541 -943
  178. package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -1
  179. package/fesm2022/ngstarter-ui-components-navigation.mjs +1035 -455
  180. package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -1
  181. package/fesm2022/ngstarter-ui-components-notifications.mjs +678 -230
  182. package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -1
  183. package/fesm2022/ngstarter-ui-components-number-input.mjs +616 -316
  184. package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -1
  185. package/fesm2022/ngstarter-ui-components-option.mjs +405 -163
  186. package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
  187. package/fesm2022/ngstarter-ui-components-overlay.mjs +107 -111
  188. package/fesm2022/ngstarter-ui-components-overlay.mjs.map +1 -1
  189. package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs +131 -76
  190. package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs.map +1 -1
  191. package/fesm2022/ngstarter-ui-components-paginator.mjs +543 -295
  192. package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -1
  193. package/fesm2022/ngstarter-ui-components-password-strength.mjs +785 -340
  194. package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -1
  195. package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +3705 -2695
  196. package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
  197. package/fesm2022/ngstarter-ui-components-pdf-signer.mjs +1179 -851
  198. package/fesm2022/ngstarter-ui-components-pdf-signer.mjs.map +1 -1
  199. package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +2973 -2070
  200. package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
  201. package/fesm2022/ngstarter-ui-components-phone-input.mjs +2081 -770
  202. package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
  203. package/fesm2022/ngstarter-ui-components-pin-input.mjs +366 -198
  204. package/fesm2022/ngstarter-ui-components-pin-input.mjs.map +1 -1
  205. package/fesm2022/ngstarter-ui-components-popover.mjs +558 -308
  206. package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -1
  207. package/fesm2022/ngstarter-ui-components-progress-bar.mjs +178 -73
  208. package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -1
  209. package/fesm2022/ngstarter-ui-components-radio-card.mjs +301 -105
  210. package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -1
  211. package/fesm2022/ngstarter-ui-components-radio.mjs +417 -157
  212. package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -1
  213. package/fesm2022/ngstarter-ui-components-rail-nav.mjs +208 -88
  214. package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -1
  215. package/fesm2022/ngstarter-ui-components-resizable-container.mjs +123 -74
  216. package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -1
  217. package/fesm2022/ngstarter-ui-components-screen-loader.mjs +197 -95
  218. package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -1
  219. package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +383 -245
  220. package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -1
  221. package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +705 -581
  222. package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -1
  223. package/fesm2022/ngstarter-ui-components-segmented.mjs +422 -220
  224. package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -1
  225. package/fesm2022/ngstarter-ui-components-select.mjs +1862 -1159
  226. package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
  227. package/fesm2022/ngstarter-ui-components-side-panel.mjs +313 -118
  228. package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -1
  229. package/fesm2022/ngstarter-ui-components-sidebar.mjs +1239 -470
  230. package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -1
  231. package/fesm2022/ngstarter-ui-components-sidenav.mjs +664 -354
  232. package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -1
  233. package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1092 -643
  234. package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
  235. package/fesm2022/ngstarter-ui-components-skeleton.mjs +153 -43
  236. package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -1
  237. package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +425 -108
  238. package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -1
  239. package/fesm2022/ngstarter-ui-components-slider.mjs +645 -487
  240. package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -1
  241. package/fesm2022/ngstarter-ui-components-snack-bar.mjs +372 -354
  242. package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -1
  243. package/fesm2022/ngstarter-ui-components-sort.mjs +378 -147
  244. package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
  245. package/fesm2022/ngstarter-ui-components-spinner.mjs +242 -76
  246. package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -1
  247. package/fesm2022/ngstarter-ui-components-splash-screen.mjs +142 -91
  248. package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -1
  249. package/fesm2022/ngstarter-ui-components-split.mjs +1067 -929
  250. package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -1
  251. package/fesm2022/ngstarter-ui-components-step-tracker.mjs +617 -331
  252. package/fesm2022/ngstarter-ui-components-step-tracker.mjs.map +1 -1
  253. package/fesm2022/ngstarter-ui-components-stepper.mjs +357 -126
  254. package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -1
  255. package/fesm2022/ngstarter-ui-components-suggestions.mjs +259 -72
  256. package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -1
  257. package/fesm2022/ngstarter-ui-components-tab-panel.mjs +674 -267
  258. package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -1
  259. package/fesm2022/ngstarter-ui-components-table.mjs +1144 -662
  260. package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
  261. package/fesm2022/ngstarter-ui-components-tabs.mjs +1236 -615
  262. package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -1
  263. package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +414 -216
  264. package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -1
  265. package/fesm2022/ngstarter-ui-components-tiles.mjs +939 -647
  266. package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -1
  267. package/fesm2022/ngstarter-ui-components-timeline.mjs +418 -122
  268. package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -1
  269. package/fesm2022/ngstarter-ui-components-timepicker.mjs +870 -508
  270. package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
  271. package/fesm2022/ngstarter-ui-components-timezone-select.mjs +651 -371
  272. package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -1
  273. package/fesm2022/ngstarter-ui-components-toolbar.mjs +727 -320
  274. package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -1
  275. package/fesm2022/ngstarter-ui-components-tooltip.mjs +601 -521
  276. package/fesm2022/ngstarter-ui-components-tooltip.mjs.map +1 -1
  277. package/fesm2022/ngstarter-ui-components-tree-select.mjs +1197 -434
  278. package/fesm2022/ngstarter-ui-components-tree-select.mjs.map +1 -1
  279. package/fesm2022/ngstarter-ui-components-tree.mjs +1821 -1262
  280. package/fesm2022/ngstarter-ui-components-tree.mjs.map +1 -1
  281. package/fesm2022/ngstarter-ui-components-upload.mjs +1059 -345
  282. package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
  283. package/fesm2022/ngstarter-ui-components-video-player.mjs +763 -533
  284. package/fesm2022/ngstarter-ui-components-video-player.mjs.map +1 -1
  285. package/fesm2022/ngstarter-ui-components-video-viewer.mjs +630 -229
  286. package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -1
  287. package/fesm2022/ngstarter-ui-components-visual-builder.mjs +40 -17
  288. package/fesm2022/ngstarter-ui-components-visual-builder.mjs.map +1 -1
  289. package/fesm2022/ngstarter-ui-components-whiteboard.mjs +3039 -1803
  290. package/fesm2022/ngstarter-ui-components-whiteboard.mjs.map +1 -1
  291. package/fesm2022/ngstarter-ui-components.mjs +3 -5
  292. package/fesm2022/ngstarter-ui-components.mjs.map +1 -1
  293. package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs +264 -0
  294. package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs.map +1 -0
  295. package/fesm2022/plain-text-settings-BnxCxLhA.mjs +354 -0
  296. package/fesm2022/plain-text-settings-BnxCxLhA.mjs.map +1 -0
  297. package/fesm2022/quote-block.component-tRmrU97F.mjs +309 -0
  298. package/fesm2022/quote-block.component-tRmrU97F.mjs.map +1 -0
  299. package/fesm2022/table-block.component-BuzRRggv.mjs +1859 -0
  300. package/fesm2022/table-block.component-BuzRRggv.mjs.map +1 -0
  301. package/fesm2022/toggle-block-C5Jo2YDf.mjs +150 -0
  302. package/fesm2022/toggle-block-C5Jo2YDf.mjs.map +1 -0
  303. package/fesm2022/upload-status-tZ0x0BUB.mjs +107 -0
  304. package/fesm2022/upload-status-tZ0x0BUB.mjs.map +1 -0
  305. package/fesm2022/video-block.component-CpAXibm6.mjs +312 -0
  306. package/fesm2022/video-block.component-CpAXibm6.mjs.map +1 -0
  307. package/package.json +11 -10
  308. package/styles/_tokens.scss +1 -0
  309. package/types/ngstarter-ui-components-action-required.d.ts +34 -14
  310. package/types/ngstarter-ui-components-alert.d.ts +53 -44
  311. package/types/ngstarter-ui-components-announcement.d.ts +74 -53
  312. package/types/ngstarter-ui-components-autocomplete.d.ts +141 -84
  313. package/types/ngstarter-ui-components-avatar.d.ts +113 -66
  314. package/types/ngstarter-ui-components-badge.d.ts +73 -37
  315. package/types/ngstarter-ui-components-block-loader.d.ts +32 -20
  316. package/types/ngstarter-ui-components-bottom-sheet.d.ts +125 -132
  317. package/types/ngstarter-ui-components-breadcrumbs.d.ts +93 -88
  318. package/types/ngstarter-ui-components-button-toggle.d.ts +124 -54
  319. package/types/ngstarter-ui-components-button.d.ts +69 -27
  320. package/types/ngstarter-ui-components-calendar.d.ts +123 -71
  321. package/types/ngstarter-ui-components-card-overlay.d.ts +31 -19
  322. package/types/ngstarter-ui-components-card.d.ts +75 -71
  323. package/types/ngstarter-ui-components-carousel.d.ts +115 -69
  324. package/types/ngstarter-ui-components-checkbox.d.ts +183 -86
  325. package/types/ngstarter-ui-components-chips.d.ts +288 -195
  326. package/types/ngstarter-ui-components-code-highlighter.d.ts +71 -28
  327. package/types/ngstarter-ui-components-color-picker.d.ts +140 -89
  328. package/types/ngstarter-ui-components-color-scheme.d.ts +43 -52
  329. package/types/ngstarter-ui-components-color-switcher.d.ts +46 -26
  330. package/types/ngstarter-ui-components-command-bar.d.ts +40 -26
  331. package/types/ngstarter-ui-components-comment-editor.d.ts +311 -235
  332. package/types/ngstarter-ui-components-comparison-slider.d.ts +41 -40
  333. package/types/ngstarter-ui-components-confirm.d.ts +24 -29
  334. package/types/ngstarter-ui-components-content-editor.d.ts +1482 -998
  335. package/types/ngstarter-ui-components-cookie-popup.d.ts +43 -38
  336. package/types/ngstarter-ui-components-core.d.ts +513 -467
  337. package/types/ngstarter-ui-components-country-select.d.ts +170 -97
  338. package/types/ngstarter-ui-components-crop.d.ts +67 -52
  339. package/types/ngstarter-ui-components-currency-select.d.ts +127 -90
  340. package/types/ngstarter-ui-components-data-view.d.ts +811 -567
  341. package/types/ngstarter-ui-components-date-format-select.d.ts +90 -58
  342. package/types/ngstarter-ui-components-datepicker.d.ts +589 -373
  343. package/types/ngstarter-ui-components-dialog.d.ts +138 -116
  344. package/types/ngstarter-ui-components-digit-roller.d.ts +228 -131
  345. package/types/ngstarter-ui-components-divider.d.ts +29 -17
  346. package/types/ngstarter-ui-components-drawer.d.ts +39 -30
  347. package/types/ngstarter-ui-components-emoji-picker.d.ts +69 -47
  348. package/types/ngstarter-ui-components-empty-state.d.ts +20 -28
  349. package/types/ngstarter-ui-components-events.d.ts +73 -57
  350. package/types/ngstarter-ui-components-expand.d.ts +55 -25
  351. package/types/ngstarter-ui-components-expansion.d.ts +93 -64
  352. package/types/ngstarter-ui-components-file-type.d.ts +53 -27
  353. package/types/ngstarter-ui-components-filter-builder.d.ts +131 -100
  354. package/types/ngstarter-ui-components-form-builder.d.ts +1094 -881
  355. package/types/ngstarter-ui-components-form-field.d.ts +116 -105
  356. package/types/ngstarter-ui-components-gauge.d.ts +32 -20
  357. package/types/ngstarter-ui-components-grid.d.ts +66 -50
  358. package/types/ngstarter-ui-components-guided-tour.d.ts +250 -222
  359. package/types/ngstarter-ui-components-headless-editor.d.ts +708 -658
  360. package/types/ngstarter-ui-components-headless-stepper.d.ts +84 -64
  361. package/types/ngstarter-ui-components-icon.d.ts +39 -38
  362. package/types/ngstarter-ui-components-image-designer.d.ts +422 -341
  363. package/types/ngstarter-ui-components-image-placeholder.d.ts +5 -8
  364. package/types/ngstarter-ui-components-image-resizer.d.ts +40 -33
  365. package/types/ngstarter-ui-components-image-viewer.d.ts +67 -54
  366. package/types/ngstarter-ui-components-image-zoom-viewer.d.ts +29 -33
  367. package/types/ngstarter-ui-components-incidents.d.ts +97 -104
  368. package/types/ngstarter-ui-components-inline-text-edit.d.ts +54 -39
  369. package/types/ngstarter-ui-components-input-mask.d.ts +54 -34
  370. package/types/ngstarter-ui-components-input-validator.d.ts +7 -11
  371. package/types/ngstarter-ui-components-input.d.ts +82 -54
  372. package/types/ngstarter-ui-components-kanban-board.d.ts +76 -63
  373. package/types/ngstarter-ui-components-kbd.d.ts +8 -12
  374. package/types/ngstarter-ui-components-layout.d.ts +131 -87
  375. package/types/ngstarter-ui-components-list.d.ts +123 -88
  376. package/types/ngstarter-ui-components-logo.d.ts +21 -21
  377. package/types/ngstarter-ui-components-marquee.d.ts +41 -34
  378. package/types/ngstarter-ui-components-menu.d.ts +329 -221
  379. package/types/ngstarter-ui-components-micro-chart.d.ts +385 -186
  380. package/types/ngstarter-ui-components-navigation.d.ts +186 -125
  381. package/types/ngstarter-ui-components-notifications.d.ts +104 -89
  382. package/types/ngstarter-ui-components-number-input.d.ts +138 -96
  383. package/types/ngstarter-ui-components-option.d.ts +102 -68
  384. package/types/ngstarter-ui-components-overlay.d.ts +7 -12
  385. package/types/ngstarter-ui-components-page-loading-bar.d.ts +23 -20
  386. package/types/ngstarter-ui-components-paginator.d.ts +171 -129
  387. package/types/ngstarter-ui-components-password-strength.d.ts +217 -102
  388. package/types/ngstarter-ui-components-pdf-builder.d.ts +717 -649
  389. package/types/ngstarter-ui-components-pdf-signer.d.ts +202 -142
  390. package/types/ngstarter-ui-components-pdf-viewer.d.ts +544 -385
  391. package/types/ngstarter-ui-components-phone-input.d.ts +175 -115
  392. package/types/ngstarter-ui-components-pin-input.d.ts +83 -45
  393. package/types/ngstarter-ui-components-popover.d.ts +128 -89
  394. package/types/ngstarter-ui-components-progress-bar.d.ts +49 -30
  395. package/types/ngstarter-ui-components-radio-card.d.ts +50 -34
  396. package/types/ngstarter-ui-components-radio.d.ts +100 -47
  397. package/types/ngstarter-ui-components-rail-nav.d.ts +36 -29
  398. package/types/ngstarter-ui-components-resizable-container.d.ts +30 -25
  399. package/types/ngstarter-ui-components-screen-loader.d.ts +38 -32
  400. package/types/ngstarter-ui-components-scroll-spy.d.ts +56 -60
  401. package/types/ngstarter-ui-components-scrollbar-area.d.ts +116 -86
  402. package/types/ngstarter-ui-components-segmented.d.ts +93 -61
  403. package/types/ngstarter-ui-components-select.d.ts +366 -266
  404. package/types/ngstarter-ui-components-side-panel.d.ts +59 -40
  405. package/types/ngstarter-ui-components-sidebar.d.ts +208 -154
  406. package/types/ngstarter-ui-components-sidenav.d.ts +136 -78
  407. package/types/ngstarter-ui-components-signature-pad.d.ts +165 -92
  408. package/types/ngstarter-ui-components-skeleton.d.ts +18 -17
  409. package/types/ngstarter-ui-components-slide-toggle.d.ts +113 -44
  410. package/types/ngstarter-ui-components-slider.d.ts +123 -82
  411. package/types/ngstarter-ui-components-snack-bar.d.ts +126 -134
  412. package/types/ngstarter-ui-components-sort.d.ts +99 -63
  413. package/types/ngstarter-ui-components-spinner.d.ts +49 -27
  414. package/types/ngstarter-ui-components-splash-screen.d.ts +34 -29
  415. package/types/ngstarter-ui-components-split.d.ts +276 -195
  416. package/types/ngstarter-ui-components-step-tracker.d.ts +102 -83
  417. package/types/ngstarter-ui-components-stepper.d.ts +57 -43
  418. package/types/ngstarter-ui-components-suggestions.d.ts +41 -28
  419. package/types/ngstarter-ui-components-tab-panel.d.ts +110 -83
  420. package/types/ngstarter-ui-components-table.d.ts +256 -228
  421. package/types/ngstarter-ui-components-tabs.d.ts +231 -138
  422. package/types/ngstarter-ui-components-thumbnail-maker.d.ts +40 -34
  423. package/types/ngstarter-ui-components-tiles.d.ts +166 -104
  424. package/types/ngstarter-ui-components-timeline.d.ts +45 -57
  425. package/types/ngstarter-ui-components-timepicker.d.ts +166 -111
  426. package/types/ngstarter-ui-components-timezone-select.d.ts +110 -70
  427. package/types/ngstarter-ui-components-toolbar.d.ts +89 -72
  428. package/types/ngstarter-ui-components-tooltip.d.ts +89 -52
  429. package/types/ngstarter-ui-components-tree-select.d.ts +182 -105
  430. package/types/ngstarter-ui-components-tree.d.ts +355 -229
  431. package/types/ngstarter-ui-components-upload.d.ts +216 -131
  432. package/types/ngstarter-ui-components-video-player.d.ts +130 -67
  433. package/types/ngstarter-ui-components-video-viewer.d.ts +140 -91
  434. package/types/ngstarter-ui-components-visual-builder.d.ts +5 -8
  435. package/types/ngstarter-ui-components-whiteboard.d.ts +412 -339
  436. package/types/ngstarter-ui-components.d.ts +2 -2
  437. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-BgKuFsDy.mjs +0 -35
  438. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-BgKuFsDy.mjs.map +0 -1
  439. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-CGTJefVK.mjs +0 -26
  440. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-CGTJefVK.mjs.map +0 -1
  441. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-B441NasU.mjs +0 -220
  442. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-B441NasU.mjs.map +0 -1
  443. package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs +0 -99
  444. package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs.map +0 -1
  445. package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs +0 -40
  446. package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map +0 -1
  447. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-Bo3irEeG.mjs +0 -375
  448. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-Bo3irEeG.mjs.map +0 -1
  449. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-Cbh0nblW.mjs +0 -80
  450. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-Cbh0nblW.mjs.map +0 -1
  451. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-BVQTRzaX.mjs +0 -65
  452. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-BVQTRzaX.mjs.map +0 -1
  453. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnbRqEWF.mjs +0 -137
  454. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnbRqEWF.mjs.map +0 -1
  455. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-Cv9-02mR.mjs +0 -113
  456. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-Cv9-02mR.mjs.map +0 -1
  457. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-yvSNKY0B.mjs +0 -188
  458. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-yvSNKY0B.mjs.map +0 -1
  459. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Clz9SzCR.mjs +0 -117
  460. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Clz9SzCR.mjs.map +0 -1
  461. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs +0 -4464
  462. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs.map +0 -1
  463. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CxDRklAS.mjs +0 -132
  464. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CxDRklAS.mjs.map +0 -1
  465. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BNgtiV7U.mjs +0 -171
  466. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BNgtiV7U.mjs.map +0 -1
  467. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs +0 -1653
  468. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs.map +0 -1
  469. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-Ch1kWIaX.mjs +0 -20
  470. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-Ch1kWIaX.mjs.map +0 -1
  471. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs +0 -19
  472. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs.map +0 -1
  473. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-laP7DTyq.mjs +0 -134
  474. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-laP7DTyq.mjs.map +0 -1
  475. package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs +0 -159
  476. package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs.map +0 -1
@@ -1,199 +1,367 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, ElementRef, Renderer2, input, output, Directive, viewChildren, numberAttribute, booleanAttribute, computed, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import * as i1 from '@angular/forms';
4
- import { FormBuilder, Validators, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
5
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
6
- import { FormField } from '@ngstarter-ui/components/form-field';
7
- import { Input } from '@ngstarter-ui/components/input';
8
-
9
- class PinInputDirective {
10
- _elementRef = inject(ElementRef);
11
- _renderer = inject(Renderer2);
12
- _placeholder;
13
- index = input(/* @ts-ignore */
14
- ...(ngDevMode ? [undefined, { debugName: "index" }] : /* istanbul ignore next */ []));
15
- acceptOnly = input(/* @ts-ignore */
16
- ...(ngDevMode ? [undefined, { debugName: "acceptOnly" }] : /* istanbul ignore next */ []));
17
- valuePaste = output();
18
- get api() {
19
- return {
20
- focus: () => {
21
- this._elementRef.nativeElement.focus();
22
- },
23
- nativeElement: this._elementRef.nativeElement
24
- };
25
- }
26
- ngOnInit() {
27
- this._placeholder = this._elementRef.nativeElement.getAttribute('placeholder') || '';
28
- }
29
- _handleFocus() {
30
- this._renderer.removeAttribute(this._elementRef.nativeElement, 'placeholder');
31
- }
32
- _handleBlur() {
33
- this._renderer.setAttribute(this._elementRef.nativeElement, 'placeholder', this._placeholder);
34
- }
35
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PinInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
36
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: PinInputDirective, isStandalone: true, selector: "[ngsPinInput]", inputs: { index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, acceptOnly: { classPropertyName: "acceptOnly", publicName: "acceptOnly", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valuePaste: "valuePaste" }, host: { listeners: { "focus": "_handleFocus()", "blur": "_handleBlur()" }, classAttribute: "ngs-pin-input" }, exportAs: ["ngsPinInput"], ngImport: i0 });
37
- }
38
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PinInputDirective, decorators: [{
39
- type: Directive,
40
- args: [{
41
- selector: '[ngsPinInput]',
42
- exportAs: 'ngsPinInput',
43
- host: {
44
- 'class': 'ngs-pin-input',
45
- '(focus)': '_handleFocus()',
46
- '(blur)': '_handleBlur()'
47
- }
48
- }]
49
- }], propDecorators: { index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }], acceptOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptOnly", required: false }] }], valuePaste: [{ type: i0.Output, args: ["valuePaste"] }] } });
50
-
51
- class PinInput {
52
- _fb = inject(FormBuilder);
53
- inputs = viewChildren(PinInputDirective, /* @ts-ignore */
54
- ...(ngDevMode ? [{ debugName: "inputs" }] : /* istanbul ignore next */ []));
55
- length = input(4, { ...(ngDevMode ? { debugName: "length" } : /* istanbul ignore next */ {}), transform: numberAttribute });
56
- placeholder = input('', /* @ts-ignore */
57
- ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
58
- acceptOnly = input(/^[0-9]+$/, /* @ts-ignore */
59
- ...(ngDevMode ? [{ debugName: "acceptOnly" }] : /* istanbul ignore next */ []));
60
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
61
- form;
62
- _disabled = false;
63
- isDisabled = computed(() => {
64
- return this._disabled || this.disabled();
65
- }, /* @ts-ignore */
66
- ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
67
- onChange = () => { };
68
- onTouched = () => { };
69
- get controls() {
70
- return this.form.get('value').controls;
71
- }
72
- ngOnInit() {
73
- const inputs = [];
74
- for (let i = 0; i < this.length(); i++) {
75
- inputs.push(this._fb.control({ value: '', disabled: this.disabled() }, [Validators.required]));
76
- }
77
- this.form = this._fb.group({
78
- value: this._fb.array(inputs)
79
- });
80
- }
81
- registerOnChange(fn) {
82
- this.onChange = fn;
83
- }
84
- registerOnTouched(fn) {
85
- this.onTouched = fn;
86
- }
87
- setDisabledState(isDisabled) {
88
- this._disabled = coerceBooleanProperty(isDisabled);
89
- }
90
- writeValue(value) {
91
- if (!value) {
92
- this.controls.forEach(control => {
93
- control.setValue('');
94
- });
95
- return;
96
- }
97
- value = String(value);
98
- for (let i = 0; i < value.length; i++) {
99
- const control = this.controls[i];
100
- if (control && value[i].match(this.acceptOnly())) {
101
- control.setValue(value[i]);
102
- }
103
- }
104
- }
105
- _valuePaste(event) {
106
- event.preventDefault();
107
- event.stopPropagation();
108
- // const value = event.clipboardData?.getData('text/plain');
109
- }
110
- _handleKeyDown(event) {
111
- if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') {
112
- return;
113
- }
114
- if (event.key === 'Delete' || event.key === 'Backspace' || event.key === 'Tab') {
115
- const element = event.target;
116
- if (event.key === 'Backspace' && !element.value) {
117
- this.inputs().forEach((inputDirective, index) => {
118
- const element = event.target;
119
- if (inputDirective.api.nativeElement === element) {
120
- const prevControl = this.inputs().at(index - 1);
121
- if (prevControl) {
122
- prevControl.api.focus();
123
- }
124
- }
125
- });
126
- }
127
- return;
128
- }
129
- event.preventDefault();
130
- event.stopPropagation();
131
- }
132
- _handleKeyUp(event) {
133
- if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') {
134
- return;
135
- }
136
- if (event.key === 'Shift' || (event.keyCode >= 112 && event.keyCode <= 123)) {
137
- event.preventDefault();
138
- event.stopPropagation();
139
- return;
140
- }
141
- if (event.key === 'Delete' || event.key === 'Backspace' || event.key === 'Tab') {
142
- this.onChange(+this.form.value.value.join(''));
143
- return;
144
- }
145
- if (!event.key.match(this.acceptOnly())) {
146
- event.preventDefault();
147
- event.stopPropagation();
148
- return;
149
- }
150
- this.inputs().forEach((inputDirective, index) => {
151
- const element = event.target;
152
- if (inputDirective.api.nativeElement === element) {
153
- const control = this.controls[index];
154
- control.setValue(event.key);
155
- const nextControl = this.inputs().at(index + 1);
156
- if (nextControl) {
157
- nextControl.api.focus();
158
- }
159
- }
160
- });
161
- this.onChange(+this.form.value.value.join(''));
162
- }
163
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PinInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
164
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: PinInput, isStandalone: true, selector: "ngs-pin-input", inputs: { length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, acceptOnly: { classPropertyName: "acceptOnly", publicName: "acceptOnly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "paste": "_valuePaste($event)", "keydown": "_handleKeyDown($event)", "keyup": "_handleKeyUp($event)" }, properties: { "class.is-disabled": "isDisabled()" }, classAttribute: "ngs-pin-input" }, providers: [
165
- {
166
- provide: NG_VALUE_ACCESSOR,
167
- useExisting: forwardRef(() => PinInput),
168
- multi: true
169
- }
170
- ], viewQueries: [{ propertyName: "inputs", predicate: PinInputDirective, descendants: true, isSignal: true }], exportAs: ["ngsPinInput"], ngImport: i0, template: "<div [formGroup]=\"form\">\n <div formArrayName=\"value\" class=\"inputs\">\n @for (control of controls; track control) {\n <ngs-form-field subscriptHiddenIfEmpty>\n <input type=\"text\"\n ngsInput\n ngsPinInput\n [formControl]=\"control\"\n [acceptOnly]=\"acceptOnly()\"\n [placeholder]=\"placeholder()\"\n [attr.disabled]=\"isDisabled() || null\"\n maxlength=\"1\" >\n </ngs-form-field>\n }\n </div>\n</div>\n", styles: [":host{--ngs-pin-input-width: var(--ngs-field-height, var(--ngs-field-container-height));--ngs-pin-gap: calc(var(--spacing, .25rem) * 4);--ngs-form-field-input-text-align: center;--ngs-form-field-width: var(--ngs-pin-input-width);display:block;width:max-content}:host .inputs{display:flex;align-items:center;gap:var(--ngs-pin-gap)}:host .input{flex:none}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: FormField, selector: "ngs-form-field", inputs: ["labelMode", "subscriptHiddenIfEmpty", "sameHeightAsButton"], exportAs: ["ngsFormField"] }, { kind: "directive", type: Input, selector: "input[ngsInput], textarea[ngsInput]", inputs: ["id", "placeholder", "required", "disabled", "readonly", "errorStateMatcher"], exportAs: ["ngsInput"] }, { kind: "directive", type: PinInputDirective, selector: "[ngsPinInput]", inputs: ["index", "acceptOnly"], outputs: ["valuePaste"], exportAs: ["ngsPinInput"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
171
- }
172
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PinInput, decorators: [{
173
- type: Component,
174
- args: [{ selector: 'ngs-pin-input', exportAs: 'ngsPinInput', imports: [
175
- ReactiveFormsModule,
176
- FormField,
177
- Input,
178
- PinInputDirective
179
- ], providers: [
180
- {
181
- provide: NG_VALUE_ACCESSOR,
182
- useExisting: forwardRef(() => PinInput),
183
- multi: true
184
- }
185
- ], changeDetection: ChangeDetectionStrategy.Eager, host: {
186
- 'class': 'ngs-pin-input',
187
- '[class.is-disabled]': 'isDisabled()',
188
- '(paste)': '_valuePaste($event)',
189
- '(keydown)': '_handleKeyDown($event)',
190
- '(keyup)': '_handleKeyUp($event)',
191
- }, template: "<div [formGroup]=\"form\">\n <div formArrayName=\"value\" class=\"inputs\">\n @for (control of controls; track control) {\n <ngs-form-field subscriptHiddenIfEmpty>\n <input type=\"text\"\n ngsInput\n ngsPinInput\n [formControl]=\"control\"\n [acceptOnly]=\"acceptOnly()\"\n [placeholder]=\"placeholder()\"\n [attr.disabled]=\"isDisabled() || null\"\n maxlength=\"1\" >\n </ngs-form-field>\n }\n </div>\n</div>\n", styles: [":host{--ngs-pin-input-width: var(--ngs-field-height, var(--ngs-field-container-height));--ngs-pin-gap: calc(var(--spacing, .25rem) * 4);--ngs-form-field-input-text-align: center;--ngs-form-field-width: var(--ngs-pin-input-width);display:block;width:max-content}:host .inputs{display:flex;align-items:center;gap:var(--ngs-pin-gap)}:host .input{flex:none}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
192
- }], propDecorators: { inputs: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => PinInputDirective), { isSignal: true }] }], length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], acceptOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptOnly", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
193
-
194
- /**
195
- * Generated bundle index. Do not edit.
196
- */
197
-
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, Directive, ElementRef, Renderer2, booleanAttribute, inject, input, linkedSignal, model, numberAttribute, output, viewChildren } from "@angular/core";
3
+ import { FormField } from "@ngstarter-ui/components/form-field";
4
+ import { Input as Input$1 } from "@ngstarter-ui/components/input";
5
+ var PinInputDirective = class PinInputDirective {
6
+ _elementRef = inject(ElementRef);
7
+ _renderer = inject(Renderer2);
8
+ _placeholder;
9
+ index = input(...ngDevMode ? [void 0, { debugName: "index" }] : /* istanbul ignore next */ []);
10
+ acceptOnly = input(...ngDevMode ? [void 0, { debugName: "acceptOnly" }] : /* istanbul ignore next */ []);
11
+ valuePaste = output();
12
+ get api() {
13
+ return {
14
+ focus: () => {
15
+ this._elementRef.nativeElement.focus();
16
+ },
17
+ nativeElement: this._elementRef.nativeElement
18
+ };
19
+ }
20
+ ngOnInit() {
21
+ this._placeholder = this._elementRef.nativeElement.getAttribute("placeholder") || "";
22
+ }
23
+ _handleFocus() {
24
+ this._renderer.removeAttribute(this._elementRef.nativeElement, "placeholder");
25
+ }
26
+ _handleBlur() {
27
+ this._renderer.setAttribute(this._elementRef.nativeElement, "placeholder", this._placeholder);
28
+ }
29
+ static ɵfac = i0.ɵɵngDeclareFactory({
30
+ minVersion: "12.0.0",
31
+ version: "22.3.0",
32
+ ngImport: i0,
33
+ type: PinInputDirective,
34
+ deps: [],
35
+ target: i0.ɵɵFactoryTarget.Directive
36
+ });
37
+ static ɵdir = i0.ɵɵngDeclareDirective({
38
+ minVersion: "17.1.0",
39
+ version: "22.3.0",
40
+ type: PinInputDirective,
41
+ isStandalone: true,
42
+ selector: "[ngsPinInput]",
43
+ inputs: {
44
+ index: {
45
+ classPropertyName: "index",
46
+ publicName: "index",
47
+ isSignal: true,
48
+ isRequired: false,
49
+ transformFunction: null
50
+ },
51
+ acceptOnly: {
52
+ classPropertyName: "acceptOnly",
53
+ publicName: "acceptOnly",
54
+ isSignal: true,
55
+ isRequired: false,
56
+ transformFunction: null
57
+ }
58
+ },
59
+ outputs: { valuePaste: "valuePaste" },
60
+ host: {
61
+ listeners: {
62
+ "focus": "_handleFocus()",
63
+ "blur": "_handleBlur()"
64
+ },
65
+ classAttribute: "ngs-pin-input"
66
+ },
67
+ exportAs: ["ngsPinInput"],
68
+ ngImport: i0
69
+ });
70
+ };
71
+ i0.ɵɵngDeclareClassMetadata({
72
+ minVersion: "12.0.0",
73
+ version: "22.3.0",
74
+ ngImport: i0,
75
+ type: PinInputDirective,
76
+ decorators: [{
77
+ type: Directive,
78
+ args: [{
79
+ selector: "[ngsPinInput]",
80
+ exportAs: "ngsPinInput",
81
+ host: {
82
+ "class": "ngs-pin-input",
83
+ "(focus)": "_handleFocus()",
84
+ "(blur)": "_handleBlur()"
85
+ }
86
+ }]
87
+ }],
88
+ propDecorators: {
89
+ index: [{
90
+ type: i0.Input,
91
+ args: [{
92
+ isSignal: true,
93
+ alias: "index",
94
+ required: false
95
+ }]
96
+ }],
97
+ acceptOnly: [{
98
+ type: i0.Input,
99
+ args: [{
100
+ isSignal: true,
101
+ alias: "acceptOnly",
102
+ required: false
103
+ }]
104
+ }],
105
+ valuePaste: [{
106
+ type: i0.Output,
107
+ args: ["valuePaste"]
108
+ }]
109
+ }
110
+ });
111
+ var PinInput = class PinInput {
112
+ inputs = viewChildren(PinInputDirective, ...ngDevMode ? [{ debugName: "inputs" }] : /* istanbul ignore next */ []);
113
+ length = input(4, {
114
+ ...ngDevMode ? { debugName: "length" } : /* istanbul ignore next */ {},
115
+ transform: numberAttribute
116
+ });
117
+ placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
118
+ acceptOnly = input(/^[0-9]+$/, ...ngDevMode ? [{ debugName: "acceptOnly" }] : /* istanbul ignore next */ []);
119
+ disabled = input(false, {
120
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
121
+ transform: booleanAttribute
122
+ });
123
+ readonly = input(false, {
124
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
125
+ transform: booleanAttribute
126
+ });
127
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
128
+ touch = output();
129
+ digits = linkedSignal({
130
+ ...ngDevMode ? { debugName: "digits" } : /* istanbul ignore next */ {},
131
+ source: () => ({
132
+ value: this.value(),
133
+ length: this.length()
134
+ }),
135
+ computation: ({ value, length }) => Array.from({ length }, (_, index) => String(value ?? "")[index] ?? "")
136
+ });
137
+ onInput(input, index) {
138
+ if (this.disabled() || this.readonly()) return;
139
+ const character = input.value;
140
+ if (character && !this.acceptOnly().test(character)) {
141
+ input.value = this.digits()[index];
142
+ return;
143
+ }
144
+ this.updateDigits(index, character);
145
+ if (character) this.inputs()[index + 1]?.api.focus();
146
+ }
147
+ onBackspace(input, index) {
148
+ if (!input.value && !this.disabled() && !this.readonly() && index > 0) this.inputs()[index - 1]?.api.focus();
149
+ }
150
+ onFocusOut(event) {
151
+ if (!event.currentTarget.contains(event.relatedTarget)) this.touch.emit();
152
+ }
153
+ focus() {
154
+ this.inputs()[0]?.api.focus();
155
+ }
156
+ updateDigits(index, character) {
157
+ const digits = [...this.digits()];
158
+ digits[index] = character;
159
+ const text = digits.join("");
160
+ this.value.set(text ? Number(text) : null);
161
+ this.digits.set(digits);
162
+ }
163
+ static ɵfac = i0.ɵɵngDeclareFactory({
164
+ minVersion: "12.0.0",
165
+ version: "22.3.0",
166
+ ngImport: i0,
167
+ type: PinInput,
168
+ deps: [],
169
+ target: i0.ɵɵFactoryTarget.Component
170
+ });
171
+ static ɵcmp = i0.ɵɵngDeclareComponent({
172
+ minVersion: "17.0.0",
173
+ version: "22.3.0",
174
+ type: PinInput,
175
+ isStandalone: true,
176
+ selector: "ngs-pin-input",
177
+ inputs: {
178
+ length: {
179
+ classPropertyName: "length",
180
+ publicName: "length",
181
+ isSignal: true,
182
+ isRequired: false,
183
+ transformFunction: null
184
+ },
185
+ placeholder: {
186
+ classPropertyName: "placeholder",
187
+ publicName: "placeholder",
188
+ isSignal: true,
189
+ isRequired: false,
190
+ transformFunction: null
191
+ },
192
+ acceptOnly: {
193
+ classPropertyName: "acceptOnly",
194
+ publicName: "acceptOnly",
195
+ isSignal: true,
196
+ isRequired: false,
197
+ transformFunction: null
198
+ },
199
+ disabled: {
200
+ classPropertyName: "disabled",
201
+ publicName: "disabled",
202
+ isSignal: true,
203
+ isRequired: false,
204
+ transformFunction: null
205
+ },
206
+ readonly: {
207
+ classPropertyName: "readonly",
208
+ publicName: "readonly",
209
+ isSignal: true,
210
+ isRequired: false,
211
+ transformFunction: null
212
+ },
213
+ value: {
214
+ classPropertyName: "value",
215
+ publicName: "value",
216
+ isSignal: true,
217
+ isRequired: false,
218
+ transformFunction: null
219
+ }
220
+ },
221
+ outputs: {
222
+ value: "valueChange",
223
+ touch: "touch"
224
+ },
225
+ host: {
226
+ listeners: { "focusout": "onFocusOut($event)" },
227
+ properties: { "class.is-disabled": "disabled()" },
228
+ classAttribute: "ngs-pin-input"
229
+ },
230
+ viewQueries: [{
231
+ propertyName: "inputs",
232
+ predicate: PinInputDirective,
233
+ descendants: true,
234
+ isSignal: true
235
+ }],
236
+ exportAs: ["ngsPinInput"],
237
+ ngImport: i0,
238
+ template: "<div class=\"inputs\">\n @for (digit of digits(); track $index) {\n <ngs-form-field subscriptHiddenIfEmpty>\n <input #digitInput\n type=\"text\"\n ngsInput\n ngsPinInput\n [value]=\"digit\"\n [acceptOnly]=\"acceptOnly()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"onInput(digitInput, $index)\"\n (keydown.backspace)=\"onBackspace(digitInput, $index)\"\n maxlength=\"1\">\n </ngs-form-field>\n }\n</div>\n",
239
+ styles: [":host{--ngs-pin-input-width: var(--ngs-field-height, var(--ngs-field-container-height));--ngs-pin-gap: calc(var(--spacing, .25rem) * 4);--ngs-form-field-input-text-align: center;--ngs-form-field-width: var(--ngs-pin-input-width);display:block;width:max-content}:host .inputs{display:flex;align-items:center;gap:var(--ngs-pin-gap)}:host .input{flex:none}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
240
+ dependencies: [
241
+ {
242
+ kind: "component",
243
+ type: FormField,
244
+ selector: "ngs-form-field",
245
+ inputs: [
246
+ "labelMode",
247
+ "subscriptHiddenIfEmpty",
248
+ "sameHeightAsButton"
249
+ ],
250
+ exportAs: ["ngsFormField"]
251
+ },
252
+ {
253
+ kind: "directive",
254
+ type: Input$1,
255
+ selector: "input[ngsInput], textarea[ngsInput]",
256
+ inputs: [
257
+ "id",
258
+ "placeholder",
259
+ "required",
260
+ "disabled",
261
+ "readonly",
262
+ "errorStateMatcher"
263
+ ],
264
+ exportAs: ["ngsInput"]
265
+ },
266
+ {
267
+ kind: "directive",
268
+ type: PinInputDirective,
269
+ selector: "[ngsPinInput]",
270
+ inputs: ["index", "acceptOnly"],
271
+ outputs: ["valuePaste"],
272
+ exportAs: ["ngsPinInput"]
273
+ }
274
+ ],
275
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
276
+ });
277
+ };
278
+ i0.ɵɵngDeclareClassMetadata({
279
+ minVersion: "12.0.0",
280
+ version: "22.3.0",
281
+ ngImport: i0,
282
+ type: PinInput,
283
+ decorators: [{
284
+ type: Component,
285
+ args: [{
286
+ selector: "ngs-pin-input",
287
+ exportAs: "ngsPinInput",
288
+ imports: [
289
+ FormField,
290
+ Input$1,
291
+ PinInputDirective
292
+ ],
293
+ changeDetection: ChangeDetectionStrategy.OnPush,
294
+ host: {
295
+ "class": "ngs-pin-input",
296
+ "[class.is-disabled]": "disabled()",
297
+ "(focusout)": "onFocusOut($event)"
298
+ },
299
+ template: "<div class=\"inputs\">\n @for (digit of digits(); track $index) {\n <ngs-form-field subscriptHiddenIfEmpty>\n <input #digitInput\n type=\"text\"\n ngsInput\n ngsPinInput\n [value]=\"digit\"\n [acceptOnly]=\"acceptOnly()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"onInput(digitInput, $index)\"\n (keydown.backspace)=\"onBackspace(digitInput, $index)\"\n maxlength=\"1\">\n </ngs-form-field>\n }\n</div>\n",
300
+ styles: [":host{--ngs-pin-input-width: var(--ngs-field-height, var(--ngs-field-container-height));--ngs-pin-gap: calc(var(--spacing, .25rem) * 4);--ngs-form-field-input-text-align: center;--ngs-form-field-width: var(--ngs-pin-input-width);display:block;width:max-content}:host .inputs{display:flex;align-items:center;gap:var(--ngs-pin-gap)}:host .input{flex:none}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
301
+ }]
302
+ }],
303
+ propDecorators: {
304
+ inputs: [{
305
+ type: i0.ViewChildren,
306
+ args: [i0.forwardRef(() => PinInputDirective), { isSignal: true }]
307
+ }],
308
+ length: [{
309
+ type: i0.Input,
310
+ args: [{
311
+ isSignal: true,
312
+ alias: "length",
313
+ required: false
314
+ }]
315
+ }],
316
+ placeholder: [{
317
+ type: i0.Input,
318
+ args: [{
319
+ isSignal: true,
320
+ alias: "placeholder",
321
+ required: false
322
+ }]
323
+ }],
324
+ acceptOnly: [{
325
+ type: i0.Input,
326
+ args: [{
327
+ isSignal: true,
328
+ alias: "acceptOnly",
329
+ required: false
330
+ }]
331
+ }],
332
+ disabled: [{
333
+ type: i0.Input,
334
+ args: [{
335
+ isSignal: true,
336
+ alias: "disabled",
337
+ required: false
338
+ }]
339
+ }],
340
+ readonly: [{
341
+ type: i0.Input,
342
+ args: [{
343
+ isSignal: true,
344
+ alias: "readonly",
345
+ required: false
346
+ }]
347
+ }],
348
+ value: [{
349
+ type: i0.Input,
350
+ args: [{
351
+ isSignal: true,
352
+ alias: "value",
353
+ required: false
354
+ }]
355
+ }, {
356
+ type: i0.Output,
357
+ args: ["valueChange"]
358
+ }],
359
+ touch: [{
360
+ type: i0.Output,
361
+ args: ["touch"]
362
+ }]
363
+ }
364
+ });
198
365
  export { PinInput };
199
- //# sourceMappingURL=ngstarter-ui-components-pin-input.mjs.map
366
+
367
+ //# sourceMappingURL=ngstarter-ui-components-pin-input.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngstarter-ui-components-pin-input.mjs","sources":["../../../projects/components/pin-input/src/pin-input.directive.ts","../../../projects/components/pin-input/src/pin-input/pin-input.ts","../../../projects/components/pin-input/src/pin-input/pin-input.html","../../../projects/components/pin-input/ngstarter-ui-components-pin-input.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n inject, input,\n OnInit, output,\n Renderer2\n} from '@angular/core';\n\n@Directive({\n selector: '[ngsPinInput]',\n exportAs: 'ngsPinInput',\n host: {\n 'class': 'ngs-pin-input',\n '(focus)': '_handleFocus()',\n '(blur)': '_handleBlur()'\n }\n})\nexport class PinInputDirective implements OnInit {\n private _elementRef = inject(ElementRef);\n private _renderer = inject(Renderer2);\n private _placeholder: string;\n\n index = input<number>();\n acceptOnly = input<RegExp>();\n\n readonly valuePaste = output<string>();\n\n get api() {\n return {\n focus: () => {\n this._elementRef.nativeElement.focus();\n },\n nativeElement: this._elementRef.nativeElement\n }\n }\n\n ngOnInit() {\n this._placeholder = (this._elementRef.nativeElement as HTMLInputElement).getAttribute('placeholder') || '';\n }\n\n protected _handleFocus() {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'placeholder');\n }\n\n protected _handleBlur() {\n this._renderer.setAttribute(this._elementRef.nativeElement, 'placeholder', this._placeholder);\n }\n}\n","import {\n booleanAttribute,\n Component, computed,\n forwardRef,\n inject, input,\n numberAttribute,\n OnInit,\n viewChildren,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormArray,\n FormBuilder,\n FormGroup,\n NG_VALUE_ACCESSOR,\n Validators,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { PinInputDirective } from '../pin-input.directive';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { FormField } from '@ngstarter-ui/components/form-field';\nimport { Input } from '@ngstarter-ui/components/input';\n\n@Component({\n selector: 'ngs-pin-input',\n exportAs: 'ngsPinInput',\n imports: [\n ReactiveFormsModule,\n FormField,\n Input,\n PinInputDirective\n ],\n templateUrl: './pin-input.html',\n styleUrl: './pin-input.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => PinInput),\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.Eager,\n host: {\n 'class': 'ngs-pin-input',\n '[class.is-disabled]': 'isDisabled()',\n '(paste)': '_valuePaste($event)',\n '(keydown)': '_handleKeyDown($event)',\n '(keyup)': '_handleKeyUp($event)',\n }\n})\nexport class PinInput implements ControlValueAccessor, OnInit {\n private _fb = inject(FormBuilder);\n readonly inputs = viewChildren(PinInputDirective);\n\n length = input(4, {\n transform: numberAttribute\n });\n placeholder = input('');\n acceptOnly = input(/^[0-9]+$/);\n disabled = input(false, {\n transform: booleanAttribute\n });\n\n protected form: FormGroup;\n private _disabled = false;\n protected isDisabled = computed(() => {\n return this._disabled || this.disabled();\n })\n\n onChange: any = () => {};\n onTouched: any = () => {};\n\n get controls(): any[] {\n return (this.form.get('value') as FormArray).controls;\n }\n\n ngOnInit() {\n const inputs = [];\n\n for (let i = 0; i < this.length(); i++) {\n inputs.push(\n this._fb.control({ value: '', disabled: this.disabled() }, [Validators.required])\n );\n }\n\n this.form = this._fb.group({\n value: this._fb.array(inputs)\n });\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this._disabled = coerceBooleanProperty(isDisabled);\n }\n\n writeValue(value: any): void {\n if (!value) {\n this.controls.forEach(control => {\n control.setValue('');\n });\n\n return;\n }\n\n value = String(value);\n\n for (let i = 0; i < value.length; i++) {\n const control = this.controls[i];\n\n if (control && value[i].match(this.acceptOnly())) {\n control.setValue(value[i]);\n }\n }\n }\n\n protected _valuePaste(event: ClipboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n // const value = event.clipboardData?.getData('text/plain');\n }\n\n protected _handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') {\n return;\n }\n\n if (event.key === 'Delete' || event.key === 'Backspace' || event.key === 'Tab') {\n const element = event.target as HTMLInputElement;\n\n if (event.key === 'Backspace' && !element.value) {\n this.inputs().forEach((inputDirective, index) => {\n const element = event.target as HTMLInputElement;\n\n if (inputDirective.api.nativeElement === element) {\n const prevControl = this.inputs().at(index - 1);\n\n if (prevControl) {\n prevControl.api.focus();\n }\n }\n });\n }\n\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n }\n\n protected _handleKeyUp(event: KeyboardEvent) {\n if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') {\n return;\n }\n\n if (event.key === 'Shift' || (event.keyCode >= 112 && event.keyCode <= 123)) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n if (event.key === 'Delete' || event.key === 'Backspace' || event.key === 'Tab') {\n this.onChange(+this.form.value.value.join(''));\n return;\n }\n\n if (!event.key.match(this.acceptOnly())) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n this.inputs().forEach((inputDirective, index) => {\n const element = event.target as HTMLInputElement;\n\n if (inputDirective.api.nativeElement === element) {\n const control = this.controls[index];\n control.setValue(event.key);\n const nextControl = this.inputs().at(index + 1);\n\n if (nextControl) {\n nextControl.api.focus();\n }\n }\n });\n this.onChange(+this.form.value.value.join(''));\n }\n}\n","<div [formGroup]=\"form\">\n <div formArrayName=\"value\" class=\"inputs\">\n @for (control of controls; track control) {\n <ngs-form-field subscriptHiddenIfEmpty>\n <input type=\"text\"\n ngsInput\n ngsPinInput\n [formControl]=\"control\"\n [acceptOnly]=\"acceptOnly()\"\n [placeholder]=\"placeholder()\"\n [attr.disabled]=\"isDisabled() || null\"\n maxlength=\"1\" >\n </ngs-form-field>\n }\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAiBa,iBAAiB,CAAA;AACpB,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,IAAA,YAAY;AAEpB,IAAA,KAAK,GAAG,KAAK;yFAAU;AACvB,IAAA,UAAU,GAAG,KAAK;8FAAU;IAEnB,UAAU,GAAG,MAAM,EAAU;AAEtC,IAAA,IAAI,GAAG,GAAA;QACL,OAAO;YACL,KAAK,EAAE,MAAK;AACV,gBAAA,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE;YACxC,CAAC;AACD,YAAA,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC;SACjC;IACH;IAEA,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,YAAY,GAAI,IAAI,CAAC,WAAW,CAAC,aAAkC,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,EAAE;IAC5G;IAEU,YAAY,GAAA;AACpB,QAAA,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,aAAa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CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,YAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AErDlD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngstarter-ui-components-pin-input.mjs","names":["Input"],"sources":["../../../projects/components/pin-input/src/pin-input.directive.ts","../../../projects/components/pin-input/src/pin-input/pin-input.ts","../../../projects/components/pin-input/src/pin-input/pin-input.html"],"sourcesContent":["import {\n Directive,\n ElementRef,\n inject, input,\n OnInit, output,\n Renderer2\n} from '@angular/core';\n\n@Directive({\n selector: '[ngsPinInput]',\n exportAs: 'ngsPinInput',\n host: {\n 'class': 'ngs-pin-input',\n '(focus)': '_handleFocus()',\n '(blur)': '_handleBlur()'\n }\n})\nexport class PinInputDirective implements OnInit {\n private _elementRef = inject(ElementRef);\n private _renderer = inject(Renderer2);\n private _placeholder: string;\n\n index = input<number>();\n acceptOnly = input<RegExp>();\n\n readonly valuePaste = output<string>();\n\n get api() {\n return {\n focus: () => {\n this._elementRef.nativeElement.focus();\n },\n nativeElement: this._elementRef.nativeElement\n }\n }\n\n ngOnInit() {\n this._placeholder = (this._elementRef.nativeElement as HTMLInputElement).getAttribute('placeholder') || '';\n }\n\n protected _handleFocus() {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'placeholder');\n }\n\n protected _handleBlur() {\n this._renderer.setAttribute(this._elementRef.nativeElement, 'placeholder', this._placeholder);\n }\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n input,\n linkedSignal,\n model,\n numberAttribute,\n output,\n viewChildren,\n} from '@angular/core';\nimport { FormValueControl } from '@angular/forms/signals';\nimport { PinInputDirective } from '../pin-input.directive';\nimport { FormField } from '@ngstarter-ui/components/form-field';\nimport { Input } from '@ngstarter-ui/components/input';\n\n@Component({\n selector: 'ngs-pin-input',\n exportAs: 'ngsPinInput',\n imports: [FormField, Input, PinInputDirective],\n templateUrl: './pin-input.html',\n styleUrl: './pin-input.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'class': 'ngs-pin-input',\n '[class.is-disabled]': 'disabled()',\n '(focusout)': 'onFocusOut($event)',\n },\n})\nexport class PinInput implements FormValueControl<number | string | null> {\n readonly inputs = viewChildren(PinInputDirective);\n readonly length = input(4, { transform: numberAttribute });\n readonly placeholder = input('');\n readonly acceptOnly = input(/^[0-9]+$/);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n readonly value = model<number | string | null>(null);\n readonly touch = output<void>();\n\n protected readonly digits = linkedSignal({\n source: () => ({ value: this.value(), length: this.length() }),\n computation: ({ value, length }) =>\n Array.from({ length }, (_, index) => String(value ?? '')[index] ?? ''),\n });\n\n protected onInput(input: HTMLInputElement, index: number): void {\n if (this.disabled() || this.readonly()) return;\n const character = input.value;\n if (character && !this.acceptOnly().test(character)) {\n input.value = this.digits()[index];\n return;\n }\n this.updateDigits(index, character);\n if (character) this.inputs()[index + 1]?.api.focus();\n }\n\n protected onBackspace(input: HTMLInputElement, index: number): void {\n if (!input.value && !this.disabled() && !this.readonly() && index > 0) {\n this.inputs()[index - 1]?.api.focus();\n }\n }\n\n protected onFocusOut(event: FocusEvent): void {\n if (!(event.currentTarget as HTMLElement).contains(event.relatedTarget as Node | null)) {\n this.touch.emit();\n }\n }\n\n focus(): void {\n this.inputs()[0]?.api.focus();\n }\n\n private updateDigits(index: number, character: string): void {\n const digits = [...this.digits()];\n digits[index] = character;\n const text = digits.join('');\n this.value.set(text ? Number(text) : null);\n this.digits.set(digits);\n }\n}\n","<div class=\"inputs\">\n @for (digit of digits(); track $index) {\n <ngs-form-field subscriptHiddenIfEmpty>\n <input #digitInput\n type=\"text\"\n ngsInput\n ngsPinInput\n [value]=\"digit\"\n [acceptOnly]=\"acceptOnly()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"onInput(digitInput, $index)\"\n (keydown.backspace)=\"onBackspace(digitInput, $index)\"\n maxlength=\"1\">\n </ngs-form-field>\n }\n</div>\n"],"mappings":";;;;AAiBA,IAAa,oBAAb,MAAa,kBAAiB;CACpB,cAAc,OAAO,UAAU;CAC/B,YAAY,OAAO,SAAS;CAC5B;CAER,QAAQ,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACvB,aAAa,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAEnB,aAAa,OAAM;CAE5B,IAAI,MAAG;EACL,OAAO;GACL,aAAY;IACV,KAAK,YAAY,cAAc,MAAK;GACtC;GACA,eAAe,KAAK,YAAY;EACjC;CACH;CAEA,WAAQ;EACN,KAAK,eAAgB,KAAK,YAAY,cAAmC,aAAa,aAAa,KAAK;CAC1G;CAEU,eAAY;EACpB,KAAK,UAAU,gBAAgB,KAAK,YAAY,eAAe,aAAa;CAC9E;CAEU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