@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,80 +1,56 @@
1
1
  const onlyDigits = (value) => {
2
- return String(value ?? '').replace(/\D/g, '');
2
+ return String(value ?? "").replace(/\D/g, "");
3
3
  };
4
4
  const isValidLuhn = (value) => {
5
- let sum = 0;
6
- let shouldDouble = false;
7
- for (let i = value.length - 1; i >= 0; i--) {
8
- let digit = Number(value[i]);
9
- if (shouldDouble) {
10
- digit *= 2;
11
- if (digit > 9) {
12
- digit -= 9;
13
- }
14
- }
15
- sum += digit;
16
- shouldDouble = !shouldDouble;
17
- }
18
- return sum % 10 === 0;
5
+ let sum = 0;
6
+ let shouldDouble = false;
7
+ for (let i = value.length - 1; i >= 0; i--) {
8
+ let digit = Number(value[i]);
9
+ if (shouldDouble) {
10
+ digit *= 2;
11
+ if (digit > 9) digit -= 9;
12
+ }
13
+ sum += digit;
14
+ shouldDouble = !shouldDouble;
15
+ }
16
+ return sum % 10 === 0;
19
17
  };
20
18
  function creditCardNumberValidator() {
21
- return (control) => {
22
- const value = onlyDigits(control.value);
23
- if (!value) {
24
- return null;
25
- }
26
- if (value.length < 12 || value.length > 19 || !isValidLuhn(value)) {
27
- return { creditCardNumberInvalid: true };
28
- }
29
- return null;
30
- };
19
+ return (control) => {
20
+ const value = onlyDigits(control.value);
21
+ if (!value) return null;
22
+ if (value.length < 12 || value.length > 19 || !isValidLuhn(value)) return { creditCardNumberInvalid: true };
23
+ return null;
24
+ };
31
25
  }
32
26
  function expiryDateValidator() {
33
- return (control) => {
34
- const value = onlyDigits(control.value);
35
- if (!value) {
36
- return null;
37
- }
38
- if (value.length !== 4) {
39
- return { expiryDateInvalid: true };
40
- }
41
- const month = parseInt(value.substring(0, 2), 10);
42
- const year = parseInt(value.substring(2, 4), 10);
43
- if (month < 1 || month > 12) {
44
- return { expiryDateInvalid: true };
45
- }
46
- const currentDate = new Date();
47
- const currentMonth = currentDate.getMonth() + 1;
48
- const currentYear = parseInt(currentDate.getFullYear().toString().substring(2, 4));
49
- if (year < currentYear || (year === currentYear && month < currentMonth)) {
50
- return { expiryDateInPast: true };
51
- }
52
- return null;
53
- };
27
+ return (control) => {
28
+ const value = onlyDigits(control.value);
29
+ if (!value) return null;
30
+ if (value.length !== 4) return { expiryDateInvalid: true };
31
+ const month = parseInt(value.substring(0, 2), 10);
32
+ const year = parseInt(value.substring(2, 4), 10);
33
+ if (month < 1 || month > 12) return { expiryDateInvalid: true };
34
+ const currentDate = /* @__PURE__ */ new Date();
35
+ const currentMonth = currentDate.getMonth() + 1;
36
+ const currentYear = parseInt(currentDate.getFullYear().toString().substring(2, 4));
37
+ if (year < currentYear || year === currentYear && month < currentMonth) return { expiryDateInPast: true };
38
+ return null;
39
+ };
54
40
  }
55
41
  function creditCardCvvValidator(options = {}) {
56
- const minLength = options.minLength ?? 3;
57
- const maxLength = options.maxLength ?? 4;
58
- return (control) => {
59
- const value = onlyDigits(control.value);
60
- if (!value) {
61
- return null;
62
- }
63
- if (value.length < minLength || value.length > maxLength) {
64
- return {
65
- creditCardCvvInvalid: {
66
- minLength,
67
- maxLength,
68
- },
69
- };
70
- }
71
- return null;
72
- };
42
+ const minLength = options.minLength ?? 3;
43
+ const maxLength = options.maxLength ?? 4;
44
+ return (control) => {
45
+ const value = onlyDigits(control.value);
46
+ if (!value) return null;
47
+ if (value.length < minLength || value.length > maxLength) return { creditCardCvvInvalid: {
48
+ minLength,
49
+ maxLength
50
+ } };
51
+ return null;
52
+ };
73
53
  }
74
-
75
- /**
76
- * Generated bundle index. Do not edit.
77
- */
78
-
79
54
  export { creditCardCvvValidator, creditCardNumberValidator, expiryDateValidator };
80
- //# sourceMappingURL=ngstarter-ui-components-input-validator.mjs.map
55
+
56
+ //# sourceMappingURL=ngstarter-ui-components-input-validator.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngstarter-ui-components-input-validator.mjs","sources":["../../../projects/components/input-validator/src/expiry-date-validator.ts","../../../projects/components/input-validator/ngstarter-ui-components-input-validator.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nconst onlyDigits = (value: unknown): string => {\n return String(value ?? '').replace(/\\D/g, '');\n};\n\nconst isValidLuhn = (value: string): boolean => {\n let sum = 0;\n let shouldDouble = false;\n\n for (let i = value.length - 1; i >= 0; i--) {\n let digit = Number(value[i]);\n\n if (shouldDouble) {\n digit *= 2;\n if (digit > 9) {\n digit -= 9;\n }\n }\n\n sum += digit;\n shouldDouble = !shouldDouble;\n }\n\n return sum % 10 === 0;\n};\n\nexport function creditCardNumberValidator(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const value = onlyDigits(control.value);\n\n if (!value) {\n return null;\n }\n\n if (value.length < 12 || value.length > 19 || !isValidLuhn(value)) {\n return { creditCardNumberInvalid: true };\n }\n\n return null;\n };\n}\n\nexport function expiryDateValidator(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const value = onlyDigits(control.value);\n\n if (!value) {\n return null;\n }\n\n if (value.length !== 4) {\n return { expiryDateInvalid: true };\n }\n\n const month = parseInt(value.substring(0, 2), 10);\n const year = parseInt(value.substring(2, 4), 10);\n\n if (month < 1 || month > 12) {\n return { expiryDateInvalid: true };\n }\n\n const currentDate = new Date();\n const currentMonth = currentDate.getMonth() + 1;\n const currentYear = parseInt(currentDate.getFullYear().toString().substring(2, 4));\n\n if (year < currentYear || (year === currentYear && month < currentMonth)) {\n return { expiryDateInPast: true };\n }\n\n return null;\n };\n}\n\nexport interface CreditCardCvvValidatorOptions {\n minLength?: number;\n maxLength?: number;\n}\n\nexport function creditCardCvvValidator(options: CreditCardCvvValidatorOptions = {}): ValidatorFn {\n const minLength = options.minLength ?? 3;\n const maxLength = options.maxLength ?? 4;\n\n return (control: AbstractControl): ValidationErrors | null => {\n const value = onlyDigits(control.value);\n\n if (!value) {\n return null;\n }\n\n if (value.length < minLength || value.length > maxLength) {\n return {\n creditCardCvvInvalid: {\n minLength,\n maxLength,\n },\n };\n }\n\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG,CAAC,KAAc,KAAY;AAC5C,IAAA,OAAO,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;AAC/C,CAAC;AAED,MAAM,WAAW,GAAG,CAAC,KAAa,KAAa;IAC7C,IAAI,GAAG,GAAG,CAAC;IACX,IAAI,YAAY,GAAG,KAAK;AAExB,IAAA,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAI,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAE5B,IAAI,YAAY,EAAE;YAChB,KAAK,IAAI,CAAC;AACV,YAAA,IAAI,KAAK,GAAG,CAAC,EAAE;gBACb,KAAK,IAAI,CAAC;YACZ;QACF;QAEA,GAAG,IAAI,KAAK;QACZ,YAAY,GAAG,CAAC,YAAY;IAC9B;AAEA,IAAA,OAAO,GAAG,GAAG,EAAE,KAAK,CAAC;AACvB,CAAC;SAEe,yBAAyB,GAAA;IACvC,OAAO,CAAC,OAAwB,KAA6B;QAC3D,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;QAEvC,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,OAAO,IAAI;QACb;AAEA,QAAA,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE;AACjE,YAAA,OAAO,EAAE,uBAAuB,EAAE,IAAI,EAAE;QAC1C;AAEA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;SAEgB,mBAAmB,GAAA;IACjC,OAAO,CAAC,OAAwB,KAA6B;QAC3D,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;QAEvC,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,OAAO,IAAI;QACb;AAEA,QAAA,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AACtB,YAAA,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE;QACpC;AAEA,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;AACjD,QAAA,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QAEhD,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,EAAE,EAAE;AAC3B,YAAA,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE;QACpC;AAEA,QAAA,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE;QAC9B,MAAM,YAAY,GAAG,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC;AAC/C,QAAA,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAElF,QAAA,IAAI,IAAI,GAAG,WAAW,KAAK,IAAI,KAAK,WAAW,IAAI,KAAK,GAAG,YAAY,CAAC,EAAE;AACxE,YAAA,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE;QACnC;AAEA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;AAOM,SAAU,sBAAsB,CAAC,OAAA,GAAyC,EAAE,EAAA;AAChF,IAAA,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC;AACxC,IAAA,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC;IAExC,OAAO,CAAC,OAAwB,KAA6B;QAC3D,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;QAEvC,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,OAAO,IAAI;QACb;AAEA,QAAA,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,EAAE;YACxD,OAAO;AACL,gBAAA,oBAAoB,EAAE;oBACpB,SAAS;oBACT,SAAS;AACV,iBAAA;aACF;QACH;AAEA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACrGA;;AAEG;;;;"}
1
+ {"version":3,"file":"ngstarter-ui-components-input-validator.mjs","names":[],"sources":["../../../projects/components/input-validator/src/expiry-date-validator.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nconst onlyDigits = (value: unknown): string => {\n return String(value ?? '').replace(/\\D/g, '');\n};\n\nconst isValidLuhn = (value: string): boolean => {\n let sum = 0;\n let shouldDouble = false;\n\n for (let i = value.length - 1; i >= 0; i--) {\n let digit = Number(value[i]);\n\n if (shouldDouble) {\n digit *= 2;\n if (digit > 9) {\n digit -= 9;\n }\n }\n\n sum += digit;\n shouldDouble = !shouldDouble;\n }\n\n return sum % 10 === 0;\n};\n\nexport function creditCardNumberValidator(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const value = onlyDigits(control.value);\n\n if (!value) {\n return null;\n }\n\n if (value.length < 12 || value.length > 19 || !isValidLuhn(value)) {\n return { creditCardNumberInvalid: true };\n }\n\n return null;\n };\n}\n\nexport function expiryDateValidator(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const value = onlyDigits(control.value);\n\n if (!value) {\n return null;\n }\n\n if (value.length !== 4) {\n return { expiryDateInvalid: true };\n }\n\n const month = parseInt(value.substring(0, 2), 10);\n const year = parseInt(value.substring(2, 4), 10);\n\n if (month < 1 || month > 12) {\n return { expiryDateInvalid: true };\n }\n\n const currentDate = new Date();\n const currentMonth = currentDate.getMonth() + 1;\n const currentYear = parseInt(currentDate.getFullYear().toString().substring(2, 4));\n\n if (year < currentYear || (year === currentYear && month < currentMonth)) {\n return { expiryDateInPast: true };\n }\n\n return null;\n };\n}\n\nexport interface CreditCardCvvValidatorOptions {\n minLength?: number;\n maxLength?: number;\n}\n\nexport function creditCardCvvValidator(options: CreditCardCvvValidatorOptions = {}): ValidatorFn {\n const minLength = options.minLength ?? 3;\n const maxLength = options.maxLength ?? 4;\n\n return (control: AbstractControl): ValidationErrors | null => {\n const value = onlyDigits(control.value);\n\n if (!value) {\n return null;\n }\n\n if (value.length < minLength || value.length > maxLength) {\n return {\n creditCardCvvInvalid: {\n minLength,\n maxLength,\n },\n };\n }\n\n return null;\n };\n}\n"],"mappings":"AAEA,MAAM,cAAc,UAA0B;CAC5C,OAAO,OAAO,SAAS,EAAE,CAAC,CAAC,QAAQ,OAAO,EAAE;AAC9C;AAEA,MAAM,eAAe,UAA0B;CAC7C,IAAI,MAAM;CACV,IAAI,eAAe;CAEnB,KAAK,IAAI,IAAI,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK;EAC1C,IAAI,QAAQ,OAAO,MAAM,EAAE;EAE3B,IAAI,cAAc;GAChB,SAAS;GACT,IAAI,QAAQ,GACV,SAAS;EAEb;EAEA,OAAO;EACP,eAAe,CAAC;CAClB;CAEA,OAAO,MAAM,OAAO;AACtB;AAEA,SAAgB,4BAAyB;CACvC,QAAQ,YAAqD;EAC3D,MAAM,QAAQ,WAAW,QAAQ,KAAK;EAEtC,IAAI,CAAC,OACH,OAAO;EAGT,IAAI,MAAM,SAAS,MAAM,MAAM,SAAS,MAAM,CAAC,YAAY,KAAK,GAC9D,OAAO,EAAE,yBAAyB,KAAI;EAGxC,OAAO;CACT;AACF;AAEA,SAAgB,sBAAmB;CACjC,QAAQ,YAAqD;EAC3D,MAAM,QAAQ,WAAW,QAAQ,KAAK;EAEtC,IAAI,CAAC,OACH,OAAO;EAGT,IAAI,MAAM,WAAW,GACnB,OAAO,EAAE,mBAAmB,KAAI;EAGlC,MAAM,QAAQ,SAAS,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE;EAChD,MAAM,OAAO,SAAS,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE;EAE/C,IAAI,QAAQ,KAAK,QAAQ,IACvB,OAAO,EAAE,mBAAmB,KAAI;EAGlC,MAAM,8BAAc,IAAI,KAAI;EAC5B,MAAM,eAAe,YAAY,SAAQ,IAAK;EAC9C,MAAM,cAAc,SAAS,YAAY,YAAW,CAAE,CAAC,SAAQ,CAAE,CAAC,UAAU,GAAG,CAAC,CAAC;EAEjF,IAAI,OAAO,eAAgB,SAAS,eAAe,QAAQ,cACzD,OAAO,EAAE,kBAAkB,KAAI;EAGjC,OAAO;CACT;AACF;AAOA,SAAgB,uBAAuB,UAAyC,CAAA,GAAE;CAChF,MAAM,YAAY,QAAQ,aAAa;CACvC,MAAM,YAAY,QAAQ,aAAa;CAEvC,QAAQ,YAAqD;EAC3D,MAAM,QAAQ,WAAW,QAAQ,KAAK;EAEtC,IAAI,CAAC,OACH,OAAO;EAGT,IAAI,MAAM,SAAS,aAAa,MAAM,SAAS,WAC7C,OAAO,EACL,sBAAsB;GACpB;GACA;EACD,EACF;EAGH,OAAO;CACT;AACF"}
@@ -1,163 +1,305 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, ElementRef, signal, DestroyRef, input, booleanAttribute, computed, effect, forwardRef, Directive } from '@angular/core';
3
- import { NgControl, NgForm, FormGroupDirective } from '@angular/forms';
4
- import { FormFieldControl } from '@ngstarter-ui/components/form-field';
5
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
- import { ErrorStateMatcher, AUTOFOCUSABLE } from '@ngstarter-ui/components/core';
7
-
8
- class Input {
9
- elementRef = inject(ElementRef);
10
- ngControl = inject(NgControl, { optional: true, self: true });
11
- stateChanges = signal(undefined, /* @ts-ignore */
12
- ...(ngDevMode ? [{ debugName: "stateChanges" }] : /* istanbul ignore next */ []));
13
- _destroyRef = inject(DestroyRef);
14
- _defaultErrorStateMatcher = inject(ErrorStateMatcher);
15
- _parentForm = inject(NgForm, { optional: true });
16
- _parentFormGroup = inject(FormGroupDirective, { optional: true });
17
- _id = input(`ngs-input-${nextUniqueId++}`, { ...(ngDevMode ? { debugName: "_id" } : /* istanbul ignore next */ {}), alias: 'id' });
18
- get id() { return this._id(); }
19
- _placeholder = input('', { ...(ngDevMode ? { debugName: "_placeholder" } : /* istanbul ignore next */ {}), alias: 'placeholder' });
20
- get placeholder() { return this._placeholder(); }
21
- _required = input(false, { ...(ngDevMode ? { debugName: "_required" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'required' });
22
- get required() { return this._required(); }
23
- _disabled = input(false, { ...(ngDevMode ? { debugName: "_disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'disabled' });
24
- get disabled() { return this._disabled(); }
25
- readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
26
- errorStateMatcher = input(/* @ts-ignore */
27
- ...(ngDevMode ? [undefined, { debugName: "errorStateMatcher" }] : /* istanbul ignore next */ []));
28
- _value = signal('', /* @ts-ignore */
29
- ...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
30
- get value() {
31
- return this._value();
32
- }
33
- set value(value) {
34
- this._value.set(value);
35
- this.elementRef.nativeElement.value = value;
36
- }
37
- focusedValue = false;
38
- _focused = signal(false, /* @ts-ignore */
39
- ...(ngDevMode ? [{ debugName: "_focused" }] : /* istanbul ignore next */ []));
40
- get focused() { return this._focused(); }
41
- errorStateValue = false;
42
- _errorState = signal(false, /* @ts-ignore */
43
- ...(ngDevMode ? [{ debugName: "_errorState" }] : /* istanbul ignore next */ []));
44
- get errorState() { return this._errorState(); }
45
- get multiline() {
46
- return this.elementRef.nativeElement.tagName?.toLowerCase() === 'textarea';
47
- }
48
- isRequired = computed(() => {
49
- if (this._required()) {
50
- return true;
51
- }
52
- const control = this.ngControl?.control;
53
- if (control && control.validator) {
54
- const validator = control.validator({});
55
- if (validator && validator['required']) {
56
- return true;
57
- }
58
- }
59
- return false;
60
- }, /* @ts-ignore */
61
- ...(ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []));
62
- emptyValue = true;
63
- _empty = computed(() => !this._value(), /* @ts-ignore */
64
- ...(ngDevMode ? [{ debugName: "_empty" }] : /* istanbul ignore next */ []));
65
- get empty() { return this._empty(); }
66
- shouldLabelFloatValue = false;
67
- _shouldLabelFloat = computed(() => {
68
- return !!this._value() || this._focused();
69
- }, /* @ts-ignore */
70
- ...(ngDevMode ? [{ debugName: "_shouldLabelFloat" }] : /* istanbul ignore next */ []));
71
- get shouldLabelFloat() { return this._shouldLabelFloat(); }
72
- constructor() {
73
- effect(() => {
74
- this.focusedValue = this._focused();
75
- this.errorStateValue = this._errorState();
76
- this.emptyValue = this._empty();
77
- this.shouldLabelFloatValue = this._shouldLabelFloat();
78
- });
79
- }
80
- ngOnInit() {
81
- this._value.set(this.elementRef.nativeElement.value);
82
- this.ngControl?.statusChanges?.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
83
- this.updateErrorState();
84
- });
85
- }
86
- ngDoCheck() {
87
- if (this._value() !== this.elementRef.nativeElement.value) {
88
- this._value.set(this.elementRef.nativeElement.value);
89
- }
90
- this.updateErrorState();
91
- }
92
- updateErrorState() {
93
- const oldState = this._errorState();
94
- const parent = this._parentFormGroup || this._parentForm;
95
- const matcher = this.errorStateMatcher() || this._defaultErrorStateMatcher;
96
- const control = this.ngControl ? this.ngControl.control : null;
97
- const newState = matcher.isErrorState(control, parent);
98
- if (newState !== oldState) {
99
- this._errorState.set(newState);
100
- }
101
- }
102
- onFocus() {
103
- this._focused.set(true);
104
- }
105
- onBlur() {
106
- this._focused.set(false);
107
- this.updateErrorState();
108
- }
109
- onInput(event) {
110
- this._value.set(event.target.value);
111
- }
112
- focus() {
113
- this.elementRef.nativeElement.focus();
114
- }
115
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Input, deps: [], target: i0.ɵɵFactoryTarget.Directive });
116
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: Input, isStandalone: true, selector: "input[ngsInput], textarea[ngsInput]", inputs: { _id: { classPropertyName: "_id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, _placeholder: { classPropertyName: "_placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, _required: { classPropertyName: "_required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, _disabled: { classPropertyName: "_disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focus": "onFocus()", "blur": "onBlur()", "input": "onInput($event)" }, properties: { "attr.id": "id", "attr.placeholder": "placeholder", "disabled": "disabled", "required": "required", "attr.readonly": "readonly() || null", "class.ngs-input-floating": "shouldLabelFloat" }, classAttribute: "ngs-input" }, providers: [
117
- {
118
- provide: FormFieldControl,
119
- useExisting: forwardRef(() => Input)
120
- },
121
- {
122
- provide: AUTOFOCUSABLE,
123
- useExisting: forwardRef(() => Input)
124
- }
125
- ], exportAs: ["ngsInput"], ngImport: i0 });
126
- }
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Input, decorators: [{
128
- type: Directive,
129
- args: [{
130
- selector: 'input[ngsInput], textarea[ngsInput]',
131
- exportAs: 'ngsInput',
132
- host: {
133
- 'class': 'ngs-input',
134
- '[attr.id]': 'id',
135
- '[attr.placeholder]': 'placeholder',
136
- '[disabled]': 'disabled',
137
- '[required]': 'required',
138
- '[attr.readonly]': 'readonly() || null',
139
- '[class.ngs-input-floating]': 'shouldLabelFloat',
140
- '(focus)': 'onFocus()',
141
- '(blur)': 'onBlur()',
142
- '(input)': 'onInput($event)',
143
- },
144
- providers: [
145
- {
146
- provide: FormFieldControl,
147
- useExisting: forwardRef(() => Input)
148
- },
149
- {
150
- provide: AUTOFOCUSABLE,
151
- useExisting: forwardRef(() => Input)
152
- }
153
- ]
154
- }]
155
- }], ctorParameters: () => [], propDecorators: { _id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], _placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], _required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], _disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], errorStateMatcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorStateMatcher", required: false }] }] } });
1
+ import * as i0 from "@angular/core";
2
+ import { DestroyRef, Directive, ElementRef, booleanAttribute, computed, effect, forwardRef, inject, input, signal } from "@angular/core";
3
+ import { AUTOFOCUSABLE, ErrorStateMatcher } from "@ngstarter-ui/components/core";
4
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
5
+ import { FormFieldControl } from "@ngstarter-ui/components/form-field";
6
+ import { FormGroupDirective, NgControl, NgForm } from "@angular/forms";
7
+ var Input = class Input {
8
+ elementRef = inject(ElementRef);
9
+ ngControl = inject(NgControl, {
10
+ optional: true,
11
+ self: true
12
+ });
13
+ stateChanges = signal(void 0, ...ngDevMode ? [{ debugName: "stateChanges" }] : /* istanbul ignore next */ []);
14
+ _destroyRef = inject(DestroyRef);
15
+ _defaultErrorStateMatcher = inject(ErrorStateMatcher);
16
+ _parentForm = inject(NgForm, { optional: true });
17
+ _parentFormGroup = inject(FormGroupDirective, { optional: true });
18
+ _id = input(`ngs-input-${nextUniqueId++}`, {
19
+ ...ngDevMode ? { debugName: "_id" } : /* istanbul ignore next */ {},
20
+ alias: "id"
21
+ });
22
+ get id() {
23
+ return this._id();
24
+ }
25
+ _placeholder = input("", {
26
+ ...ngDevMode ? { debugName: "_placeholder" } : /* istanbul ignore next */ {},
27
+ alias: "placeholder"
28
+ });
29
+ get placeholder() {
30
+ return this._placeholder();
31
+ }
32
+ _required = input(false, {
33
+ ...ngDevMode ? { debugName: "_required" } : /* istanbul ignore next */ {},
34
+ transform: booleanAttribute,
35
+ alias: "required"
36
+ });
37
+ get required() {
38
+ return this._required();
39
+ }
40
+ _disabled = input(false, {
41
+ ...ngDevMode ? { debugName: "_disabled" } : /* istanbul ignore next */ {},
42
+ transform: booleanAttribute,
43
+ alias: "disabled"
44
+ });
45
+ get disabled() {
46
+ return this._disabled();
47
+ }
48
+ readonly = input(false, {
49
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
50
+ transform: booleanAttribute
51
+ });
52
+ errorStateMatcher = input(...ngDevMode ? [void 0, { debugName: "errorStateMatcher" }] : /* istanbul ignore next */ []);
53
+ _value = signal("", ...ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []);
54
+ get value() {
55
+ return this._value();
56
+ }
57
+ set value(value) {
58
+ this._value.set(value);
59
+ this.elementRef.nativeElement.value = value;
60
+ }
61
+ focusedValue = false;
62
+ _focused = signal(false, ...ngDevMode ? [{ debugName: "_focused" }] : /* istanbul ignore next */ []);
63
+ get focused() {
64
+ return this._focused();
65
+ }
66
+ errorStateValue = false;
67
+ _errorState = signal(false, ...ngDevMode ? [{ debugName: "_errorState" }] : /* istanbul ignore next */ []);
68
+ get errorState() {
69
+ return this._errorState();
70
+ }
71
+ get multiline() {
72
+ return this.elementRef.nativeElement.tagName?.toLowerCase() === "textarea";
73
+ }
74
+ isRequired = computed(() => {
75
+ if (this._required()) return true;
76
+ const control = this.ngControl?.control;
77
+ if (control && control.validator) {
78
+ const validator = control.validator({});
79
+ if (validator && validator["required"]) return true;
80
+ }
81
+ return false;
82
+ }, ...ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []);
83
+ emptyValue = true;
84
+ _empty = computed(() => !this._value(), ...ngDevMode ? [{ debugName: "_empty" }] : /* istanbul ignore next */ []);
85
+ get empty() {
86
+ return this._empty();
87
+ }
88
+ shouldLabelFloatValue = false;
89
+ _shouldLabelFloat = computed(() => {
90
+ return !!this._value() || this._focused();
91
+ }, ...ngDevMode ? [{ debugName: "_shouldLabelFloat" }] : /* istanbul ignore next */ []);
92
+ get shouldLabelFloat() {
93
+ return this._shouldLabelFloat();
94
+ }
95
+ constructor() {
96
+ effect(() => {
97
+ this.focusedValue = this._focused();
98
+ this.errorStateValue = this._errorState();
99
+ this.emptyValue = this._empty();
100
+ this.shouldLabelFloatValue = this._shouldLabelFloat();
101
+ });
102
+ }
103
+ ngOnInit() {
104
+ this._value.set(this.elementRef.nativeElement.value);
105
+ this.ngControl?.statusChanges?.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
106
+ this.updateErrorState();
107
+ });
108
+ }
109
+ ngDoCheck() {
110
+ if (this._value() !== this.elementRef.nativeElement.value) this._value.set(this.elementRef.nativeElement.value);
111
+ this.updateErrorState();
112
+ }
113
+ updateErrorState() {
114
+ const oldState = this._errorState();
115
+ const parent = this._parentFormGroup || this._parentForm;
116
+ const matcher = this.errorStateMatcher() || this._defaultErrorStateMatcher;
117
+ const control = this.ngControl ? this.ngControl.control : null;
118
+ const newState = matcher.isErrorState(control, parent);
119
+ if (newState !== oldState) this._errorState.set(newState);
120
+ }
121
+ onFocus() {
122
+ this._focused.set(true);
123
+ }
124
+ onBlur() {
125
+ this._focused.set(false);
126
+ this.updateErrorState();
127
+ }
128
+ onInput(event) {
129
+ this._value.set(event.target.value);
130
+ }
131
+ focus() {
132
+ this.elementRef.nativeElement.focus();
133
+ }
134
+ static ɵfac = i0.ɵɵngDeclareFactory({
135
+ minVersion: "12.0.0",
136
+ version: "22.3.0",
137
+ ngImport: i0,
138
+ type: Input,
139
+ deps: [],
140
+ target: i0.ɵɵFactoryTarget.Directive
141
+ });
142
+ static ɵdir = i0.ɵɵngDeclareDirective({
143
+ minVersion: "17.1.0",
144
+ version: "22.3.0",
145
+ type: Input,
146
+ isStandalone: true,
147
+ selector: "input[ngsInput], textarea[ngsInput]",
148
+ inputs: {
149
+ _id: {
150
+ classPropertyName: "_id",
151
+ publicName: "id",
152
+ isSignal: true,
153
+ isRequired: false,
154
+ transformFunction: null
155
+ },
156
+ _placeholder: {
157
+ classPropertyName: "_placeholder",
158
+ publicName: "placeholder",
159
+ isSignal: true,
160
+ isRequired: false,
161
+ transformFunction: null
162
+ },
163
+ _required: {
164
+ classPropertyName: "_required",
165
+ publicName: "required",
166
+ isSignal: true,
167
+ isRequired: false,
168
+ transformFunction: null
169
+ },
170
+ _disabled: {
171
+ classPropertyName: "_disabled",
172
+ publicName: "disabled",
173
+ isSignal: true,
174
+ isRequired: false,
175
+ transformFunction: null
176
+ },
177
+ readonly: {
178
+ classPropertyName: "readonly",
179
+ publicName: "readonly",
180
+ isSignal: true,
181
+ isRequired: false,
182
+ transformFunction: null
183
+ },
184
+ errorStateMatcher: {
185
+ classPropertyName: "errorStateMatcher",
186
+ publicName: "errorStateMatcher",
187
+ isSignal: true,
188
+ isRequired: false,
189
+ transformFunction: null
190
+ }
191
+ },
192
+ host: {
193
+ listeners: {
194
+ "focus": "onFocus()",
195
+ "blur": "onBlur()",
196
+ "input": "onInput($event)"
197
+ },
198
+ properties: {
199
+ "attr.id": "id",
200
+ "attr.placeholder": "placeholder",
201
+ "disabled": "disabled",
202
+ "required": "required",
203
+ "attr.readonly": "readonly() || null",
204
+ "class.ngs-input-floating": "shouldLabelFloat"
205
+ },
206
+ classAttribute: "ngs-input"
207
+ },
208
+ providers: [{
209
+ provide: FormFieldControl,
210
+ useExisting: forwardRef(() => Input)
211
+ }, {
212
+ provide: AUTOFOCUSABLE,
213
+ useExisting: forwardRef(() => Input)
214
+ }],
215
+ exportAs: ["ngsInput"],
216
+ ngImport: i0
217
+ });
218
+ };
219
+ i0.ɵɵngDeclareClassMetadata({
220
+ minVersion: "12.0.0",
221
+ version: "22.3.0",
222
+ ngImport: i0,
223
+ type: Input,
224
+ decorators: [{
225
+ type: Directive,
226
+ args: [{
227
+ selector: "input[ngsInput], textarea[ngsInput]",
228
+ exportAs: "ngsInput",
229
+ host: {
230
+ "class": "ngs-input",
231
+ "[attr.id]": "id",
232
+ "[attr.placeholder]": "placeholder",
233
+ "[disabled]": "disabled",
234
+ "[required]": "required",
235
+ "[attr.readonly]": "readonly() || null",
236
+ "[class.ngs-input-floating]": "shouldLabelFloat",
237
+ "(focus)": "onFocus()",
238
+ "(blur)": "onBlur()",
239
+ "(input)": "onInput($event)"
240
+ },
241
+ providers: [{
242
+ provide: FormFieldControl,
243
+ useExisting: forwardRef(() => Input)
244
+ }, {
245
+ provide: AUTOFOCUSABLE,
246
+ useExisting: forwardRef(() => Input)
247
+ }]
248
+ }]
249
+ }],
250
+ ctorParameters: () => [],
251
+ propDecorators: {
252
+ _id: [{
253
+ type: i0.Input,
254
+ args: [{
255
+ isSignal: true,
256
+ alias: "id",
257
+ required: false
258
+ }]
259
+ }],
260
+ _placeholder: [{
261
+ type: i0.Input,
262
+ args: [{
263
+ isSignal: true,
264
+ alias: "placeholder",
265
+ required: false
266
+ }]
267
+ }],
268
+ _required: [{
269
+ type: i0.Input,
270
+ args: [{
271
+ isSignal: true,
272
+ alias: "required",
273
+ required: false
274
+ }]
275
+ }],
276
+ _disabled: [{
277
+ type: i0.Input,
278
+ args: [{
279
+ isSignal: true,
280
+ alias: "disabled",
281
+ required: false
282
+ }]
283
+ }],
284
+ readonly: [{
285
+ type: i0.Input,
286
+ args: [{
287
+ isSignal: true,
288
+ alias: "readonly",
289
+ required: false
290
+ }]
291
+ }],
292
+ errorStateMatcher: [{
293
+ type: i0.Input,
294
+ args: [{
295
+ isSignal: true,
296
+ alias: "errorStateMatcher",
297
+ required: false
298
+ }]
299
+ }]
300
+ }
301
+ });
156
302
  let nextUniqueId = 0;
157
-
158
- /**
159
- * Generated bundle index. Do not edit.
160
- */
161
-
162
303
  export { Input };
163
- //# sourceMappingURL=ngstarter-ui-components-input.mjs.map
304
+
305
+ //# sourceMappingURL=ngstarter-ui-components-input.mjs.map