design-angular-kit 1.2.0 → 1.2.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 (545) hide show
  1. package/.eslintrc.json +31 -0
  2. package/karma.conf.js +38 -0
  3. package/ng-package.json +9 -0
  4. package/ng-package.prod.json +8 -0
  5. package/package.json +9 -14
  6. package/schematics/ng-add/index.spec.ts +45 -0
  7. package/schematics/ng-add/index.ts +36 -0
  8. package/schematics/ng-add/rules/setup-project/add-animations.ts +7 -0
  9. package/schematics/ng-add/rules/setup-project/add-assets.ts +45 -0
  10. package/schematics/ng-add/rules/setup-project/add-design-angular-kit.ts +40 -0
  11. package/schematics/ng-add/rules/setup-project/add-http-client.ts +7 -0
  12. package/schematics/ng-add/rules/setup-project/add-import-to-style-file.ts +120 -0
  13. package/schematics/ng-add/rules/setup-project/add-localisation.ts +45 -0
  14. package/schematics/ng-add/rules/setup-project/angular-json-helper.ts +11 -0
  15. package/schematics/ng-add/rules/setup-project/exceptions.ts +13 -0
  16. package/schematics/ng-add/{schema.d.ts → schema.ts} +1 -1
  17. package/schematics/ng-add/setup-project.spec.ts +166 -0
  18. package/schematics/ng-add/setup-project.ts +31 -0
  19. package/schematics/ng-add/utils.ts +71 -0
  20. package/schematics/ng-add/versions-helper.ts +41 -0
  21. package/src/lib/abstracts/abstract-form.component.ts +200 -0
  22. package/src/lib/abstracts/abstract.component.ts +63 -0
  23. package/src/lib/components/core/accordion/accordion.component.html +27 -0
  24. package/src/lib/components/core/accordion/accordion.component.spec.ts +21 -0
  25. package/src/lib/components/core/accordion/accordion.component.ts +40 -0
  26. package/src/lib/components/core/alert/alert.component.html +19 -0
  27. package/src/lib/components/core/alert/alert.component.scss +3 -0
  28. package/src/lib/components/core/alert/alert.component.spec.ts +62 -0
  29. package/src/lib/components/core/alert/alert.component.ts +75 -0
  30. package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.html +23 -0
  31. package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.scss +17 -0
  32. package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.spec.ts +21 -0
  33. package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.ts +50 -0
  34. package/src/lib/components/core/avatar/avatar-group/avatar-group.component.html +7 -0
  35. package/src/lib/components/core/avatar/avatar-group/avatar-group.component.spec.ts +38 -0
  36. package/src/lib/components/core/avatar/avatar-group/avatar-group.component.ts +25 -0
  37. package/src/lib/components/core/avatar/avatar.directive.ts +73 -0
  38. package/src/lib/components/core/avatar/avatar.module.ts +18 -0
  39. package/src/lib/components/core/badge/badge.directive.spec.ts +59 -0
  40. package/src/lib/components/core/badge/badge.directive.ts +39 -0
  41. package/src/lib/components/core/button/button.directive.spec.ts +96 -0
  42. package/src/lib/components/core/button/button.directive.ts +89 -0
  43. package/src/lib/components/core/callout/callout.component.html +25 -0
  44. package/src/lib/components/core/callout/callout.component.spec.ts +138 -0
  45. package/src/lib/components/core/callout/callout.component.ts +92 -0
  46. package/src/lib/components/core/card/card.component.html +35 -0
  47. package/src/lib/components/core/card/card.component.scss +30 -0
  48. package/src/lib/components/core/card/card.component.spec.ts +21 -0
  49. package/src/lib/components/core/card/card.component.ts +78 -0
  50. package/src/lib/components/core/carousel/carousel/carousel.component.html +29 -0
  51. package/src/lib/components/core/carousel/carousel/carousel.component.scss +1 -0
  52. package/src/lib/components/core/carousel/carousel/carousel.component.spec.ts +21 -0
  53. package/src/lib/components/core/carousel/carousel/carousel.component.ts +119 -0
  54. package/src/lib/components/core/carousel/carousel-item/carousel-item.component.html +3 -0
  55. package/src/lib/components/core/carousel/carousel-item/carousel-item.component.spec.ts +22 -0
  56. package/src/lib/components/core/carousel/carousel-item/carousel-item.component.ts +20 -0
  57. package/src/lib/components/core/carousel/carousel.module.ts +11 -0
  58. package/src/lib/components/core/chip/chip.component.html +26 -0
  59. package/src/lib/components/core/chip/chip.component.spec.ts +87 -0
  60. package/src/lib/components/core/chip/chip.component.ts +154 -0
  61. package/src/lib/components/core/collapse/collapse.component.html +3 -0
  62. package/src/lib/components/core/collapse/collapse.component.spec.ts +21 -0
  63. package/src/lib/components/core/collapse/collapse.component.ts +124 -0
  64. package/src/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.html +3 -0
  65. package/src/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.spec.ts +35 -0
  66. package/src/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.ts +23 -0
  67. package/src/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.html +3 -0
  68. package/src/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.spec.ts +22 -0
  69. package/src/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.ts +10 -0
  70. package/src/lib/components/core/dimmer/dimmer.component.html +7 -0
  71. package/src/lib/components/core/dimmer/dimmer.component.spec.ts +49 -0
  72. package/src/lib/components/core/dimmer/dimmer.component.ts +50 -0
  73. package/src/lib/components/core/dimmer/dimmer.module.ts +12 -0
  74. package/src/lib/components/core/dropdown/dropdown/dropdown.component.html +45 -0
  75. package/src/lib/components/core/dropdown/dropdown/dropdown.component.scss +3 -0
  76. package/src/lib/components/core/dropdown/dropdown/dropdown.component.spec.ts +21 -0
  77. package/src/lib/components/core/dropdown/dropdown/dropdown.component.ts +186 -0
  78. package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.html +18 -0
  79. package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.scss +4 -0
  80. package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.spec.ts +21 -0
  81. package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.ts +82 -0
  82. package/src/lib/components/core/dropdown/dropdown.module.ts +11 -0
  83. package/src/lib/components/core/forward/forward.directive.spec.ts +60 -0
  84. package/src/lib/components/core/forward/forward.directive.ts +43 -0
  85. package/src/lib/components/core/link/link.component.html +13 -0
  86. package/src/lib/components/core/link/link.component.spec.ts +21 -0
  87. package/src/lib/components/core/link/link.component.ts +54 -0
  88. package/src/lib/components/core/list/list/list.component.html +13 -0
  89. package/src/lib/components/core/list/list/list.component.spec.ts +21 -0
  90. package/src/lib/components/core/list/list/list.component.ts +30 -0
  91. package/src/lib/components/core/list/list-item/list-item.component.html +42 -0
  92. package/src/lib/components/core/list/list-item/list-item.component.scss +16 -0
  93. package/src/lib/components/core/list/list-item/list-item.component.spec.ts +21 -0
  94. package/src/lib/components/core/list/list-item/list-item.component.ts +75 -0
  95. package/src/lib/components/core/list/list.module.ts +11 -0
  96. package/src/lib/components/core/modal/modal.component.html +36 -0
  97. package/src/lib/components/core/modal/modal.component.scss +3 -0
  98. package/src/lib/components/core/modal/modal.component.spec.ts +21 -0
  99. package/src/lib/components/core/modal/modal.component.ts +218 -0
  100. package/src/lib/components/core/notifications/notifications.component.html +25 -0
  101. package/src/lib/components/core/notifications/notifications.component.scss +3 -0
  102. package/src/lib/components/core/notifications/notifications.component.spec.ts +21 -0
  103. package/src/lib/components/core/notifications/notifications.component.ts +123 -0
  104. package/src/lib/components/core/pagination/pagination.component.html +107 -0
  105. package/src/lib/components/core/pagination/pagination.component.spec.ts +21 -0
  106. package/src/lib/components/core/pagination/pagination.component.ts +157 -0
  107. package/src/lib/components/core/popover/popover.directive.spec.ts +21 -0
  108. package/src/lib/components/core/popover/popover.directive.ts +171 -0
  109. package/src/lib/components/core/progress-bar/progress-bar.component.html +20 -0
  110. package/src/lib/components/core/progress-bar/progress-bar.component.spec.ts +21 -0
  111. package/src/lib/components/core/progress-bar/progress-bar.component.ts +46 -0
  112. package/src/lib/components/core/progress-button/progress-button.component.html +5 -0
  113. package/src/lib/components/core/progress-button/progress-button.component.spec.ts +21 -0
  114. package/src/lib/components/core/progress-button/progress-button.component.ts +39 -0
  115. package/src/lib/components/core/spinner/spinner.component.html +7 -0
  116. package/src/lib/components/core/spinner/spinner.component.spec.ts +80 -0
  117. package/src/lib/components/core/spinner/spinner.component.ts +31 -0
  118. package/src/lib/components/core/steppers/steppers-container/steppers-container.component.html +126 -0
  119. package/src/lib/components/core/steppers/steppers-container/steppers-container.component.spec.ts +21 -0
  120. package/src/lib/components/core/steppers/steppers-container/steppers-container.component.ts +185 -0
  121. package/src/lib/components/core/steppers/steppers-item/steppers-item.component.html +3 -0
  122. package/src/lib/components/core/steppers/steppers-item/steppers-item.component.spec.ts +22 -0
  123. package/src/lib/components/core/steppers/steppers-item/steppers-item.component.ts +33 -0
  124. package/src/lib/components/core/steppers/steppers.module.ts +11 -0
  125. package/src/lib/components/core/tab/tab-container/tab-container.component.html +78 -0
  126. package/src/lib/components/core/tab/tab-container/tab-container.component.spec.ts +21 -0
  127. package/src/lib/components/core/tab/tab-container/tab-container.component.ts +137 -0
  128. package/src/lib/components/core/tab/tab-item/tab-item.component.html +3 -0
  129. package/src/lib/components/core/tab/tab-item/tab-item.component.spec.ts +22 -0
  130. package/src/lib/components/core/tab/tab-item/tab-item.component.ts +50 -0
  131. package/src/lib/components/core/tab/tab.module.ts +11 -0
  132. package/src/lib/components/core/table/sort/sort-header/sort-header.component.html +27 -0
  133. package/src/lib/components/core/table/sort/sort-header/sort-header.component.scss +65 -0
  134. package/src/lib/components/core/table/sort/sort-header/sort-header.component.spec.ts +25 -0
  135. package/src/lib/components/core/table/sort/sort-header/sort-header.component.ts +164 -0
  136. package/src/lib/components/core/table/sort/sort.directive.spec.ts +73 -0
  137. package/src/lib/components/core/table/sort/sort.directive.ts +142 -0
  138. package/src/lib/components/core/table/table.component.html +23 -0
  139. package/src/lib/components/core/table/table.component.scss +7 -0
  140. package/src/lib/components/core/table/table.component.spec.ts +21 -0
  141. package/src/lib/components/core/table/table.component.ts +70 -0
  142. package/src/lib/components/core/table/table.module.ts +12 -0
  143. package/src/lib/components/core/timeline/timeline-item/timeline-item.component.html +47 -0
  144. package/src/lib/components/core/timeline/timeline-item/timeline-item.component.spec.ts +24 -0
  145. package/src/lib/components/core/timeline/timeline-item/timeline-item.component.ts +102 -0
  146. package/src/lib/components/core/timeline/timeline.component.html +21 -0
  147. package/src/lib/components/core/timeline/timeline.component.spec.ts +21 -0
  148. package/src/lib/components/core/timeline/timeline.component.ts +31 -0
  149. package/src/lib/components/core/timeline/timeline.module.ts +11 -0
  150. package/src/lib/components/core/tooltip/tooltip.directive.spec.ts +20 -0
  151. package/src/lib/components/core/tooltip/tooltip.directive.ts +141 -0
  152. package/src/lib/components/form/autocomplete/autocomplete.component.html +58 -0
  153. package/src/lib/components/form/autocomplete/autocomplete.component.spec.ts +21 -0
  154. package/src/lib/components/form/autocomplete/autocomplete.component.ts +130 -0
  155. package/src/lib/components/form/checkbox/checkbox.component.html +67 -0
  156. package/src/lib/components/form/checkbox/checkbox.component.spec.ts +21 -0
  157. package/src/lib/components/form/checkbox/checkbox.component.ts +65 -0
  158. package/src/lib/components/form/form.module.ts +34 -0
  159. package/src/lib/components/form/input/input.component.html +92 -0
  160. package/src/lib/components/form/input/input.component.scss +29 -0
  161. package/src/lib/components/form/input/input.component.spec.ts +21 -0
  162. package/src/lib/components/form/input/input.component.ts +234 -0
  163. package/src/lib/components/form/password-input/password-input.component.html +65 -0
  164. package/src/lib/components/form/password-input/password-input.component.scss +9 -0
  165. package/src/lib/components/form/password-input/password-input.component.spec.ts +21 -0
  166. package/src/lib/components/form/password-input/password-input.component.ts +171 -0
  167. package/src/lib/components/form/radio-button/radio-button.component.html +50 -0
  168. package/src/lib/components/form/radio-button/radio-button.component.scss +14 -0
  169. package/src/lib/components/form/radio-button/radio-button.component.spec.ts +21 -0
  170. package/src/lib/components/form/radio-button/radio-button.component.ts +82 -0
  171. package/src/lib/components/form/range/range.component.html +17 -0
  172. package/src/lib/components/form/range/range.component.scss +17 -0
  173. package/src/lib/components/form/range/range.component.spec.ts +21 -0
  174. package/src/lib/components/form/range/range.component.ts +100 -0
  175. package/src/lib/components/form/rating/rating.component.html +24 -0
  176. package/src/lib/components/form/rating/rating.component.spec.ts +21 -0
  177. package/src/lib/components/form/rating/rating.component.ts +52 -0
  178. package/src/lib/components/form/select/select.component.html +54 -0
  179. package/src/lib/components/form/select/select.component.scss +3 -0
  180. package/src/lib/components/form/select/select.component.spec.ts +22 -0
  181. package/src/lib/components/form/select/select.component.ts +91 -0
  182. package/src/lib/components/form/textarea/textarea.component.html +28 -0
  183. package/src/lib/components/form/textarea/textarea.component.scss +12 -0
  184. package/src/lib/components/form/textarea/textarea.component.spec.ts +21 -0
  185. package/src/lib/components/form/textarea/textarea.component.ts +61 -0
  186. package/src/lib/components/form/transfer/store/transfer.reducers.ts +242 -0
  187. package/src/lib/components/form/transfer/store/transfer.state.ts +20 -0
  188. package/src/lib/components/form/transfer/store/transfer.store.ts +88 -0
  189. package/src/lib/components/form/transfer/transfer-list/transfer-list.component.html +42 -0
  190. package/src/lib/components/form/transfer/transfer-list/transfer-list.component.spec.ts +33 -0
  191. package/src/lib/components/form/transfer/transfer-list/transfer-list.component.ts +93 -0
  192. package/src/lib/components/form/transfer/transfer.component.html +52 -0
  193. package/src/lib/components/form/transfer/transfer.component.spec.ts +27 -0
  194. package/src/lib/components/form/transfer/transfer.component.ts +159 -0
  195. package/{lib/components/form/transfer/transfer.model.d.ts → src/lib/components/form/transfer/transfer.model.ts} +9 -2
  196. package/src/lib/components/form/upload-drag-drop/upload-drag-drop.component.html +36 -0
  197. package/src/lib/components/form/upload-drag-drop/upload-drag-drop.component.spec.ts +21 -0
  198. package/src/lib/components/form/upload-drag-drop/upload-drag-drop.component.ts +170 -0
  199. package/src/lib/components/form/upload-file-list/upload-file-list.component.html +46 -0
  200. package/src/lib/components/form/upload-file-list/upload-file-list.component.spec.ts +22 -0
  201. package/src/lib/components/form/upload-file-list/upload-file-list.component.ts +120 -0
  202. package/src/lib/components/navigation/back-button/back-button.component.html +25 -0
  203. package/src/lib/components/navigation/back-button/back-button.component.spec.ts +91 -0
  204. package/src/lib/components/navigation/back-button/back-button.component.ts +67 -0
  205. package/src/lib/components/navigation/back-to-top/back-to-top.component.html +11 -0
  206. package/src/lib/components/navigation/back-to-top/back-to-top.component.spec.ts +21 -0
  207. package/src/lib/components/navigation/back-to-top/back-to-top.component.ts +80 -0
  208. package/src/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.html +23 -0
  209. package/src/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.spec.ts +21 -0
  210. package/src/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.ts +68 -0
  211. package/src/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.html +3 -0
  212. package/src/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.spec.ts +22 -0
  213. package/src/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.ts +29 -0
  214. package/src/lib/components/navigation/breadcrumbs/breadcrumbs.module.ts +11 -0
  215. package/src/lib/components/navigation/header/header.component.html +102 -0
  216. package/src/lib/components/navigation/header/header.component.scss +3 -0
  217. package/src/lib/components/navigation/header/header.component.spec.ts +21 -0
  218. package/src/lib/components/navigation/header/header.component.ts +107 -0
  219. package/src/lib/components/navigation/megamenu/megamenu.component.html +34 -0
  220. package/src/lib/components/navigation/megamenu/megamenu.component.scss +5 -0
  221. package/src/lib/components/navigation/megamenu/megamenu.component.ts +30 -0
  222. package/src/lib/components/navigation/navbar/navbar/navbar.component.html +28 -0
  223. package/src/lib/components/navigation/navbar/navbar/navbar.component.ts +45 -0
  224. package/src/lib/components/navigation/navbar/navbar-item/navbar-item.component.html +3 -0
  225. package/src/lib/components/navigation/navbar/navbar-item/navbar-item.component.ts +10 -0
  226. package/src/lib/components/navigation/navbar/navbar.module.ts +11 -0
  227. package/src/lib/components/navigation/navscroll/navscroll-list-item.component.ts +95 -0
  228. package/src/lib/components/navigation/navscroll/navscroll-list-items.component.ts +27 -0
  229. package/src/lib/components/navigation/navscroll/navscroll.component.html +101 -0
  230. package/src/lib/components/navigation/navscroll/navscroll.component.scss +9 -0
  231. package/src/lib/components/navigation/navscroll/navscroll.component.ts +143 -0
  232. package/{lib/components/navigation/navscroll/navscroll.model.d.ts → src/lib/components/navigation/navscroll/navscroll.model.ts} +7 -5
  233. package/src/lib/components/navigation/navscroll/navscroll.store.ts +96 -0
  234. package/src/lib/components/navigation/navscroll/navscroll.utils.ts +28 -0
  235. package/src/lib/components/navigation/sidebar/sidebar.component.html +11 -0
  236. package/src/lib/components/navigation/sidebar/sidebar.component.spec.ts +21 -0
  237. package/src/lib/components/navigation/sidebar/sidebar.component.ts +39 -0
  238. package/src/lib/components/navigation/skiplink/skiplink/skiplink.component.html +15 -0
  239. package/src/lib/components/navigation/skiplink/skiplink/skiplink.component.ts +27 -0
  240. package/src/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.html +15 -0
  241. package/src/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.ts +38 -0
  242. package/src/lib/components/navigation/skiplink/skiplink.module.ts +11 -0
  243. package/src/lib/components/utils/error-page/error-page.component.html +33 -0
  244. package/src/lib/components/utils/error-page/error-page.component.spec.ts +21 -0
  245. package/src/lib/components/utils/error-page/error-page.component.ts +79 -0
  246. package/src/lib/components/utils/icon/icon.component.html +6 -0
  247. package/src/lib/components/utils/icon/icon.component.spec.ts +21 -0
  248. package/src/lib/components/utils/icon/icon.component.ts +95 -0
  249. package/src/lib/components/utils/language-switcher/language-switcher.component.html +21 -0
  250. package/src/lib/components/utils/language-switcher/language-switcher.component.spec.ts +21 -0
  251. package/src/lib/components/utils/language-switcher/language-switcher.component.ts +56 -0
  252. package/src/lib/design-angular-kit.module.ts +131 -0
  253. package/src/lib/enums/colors.enums.ts +10 -0
  254. package/src/lib/enums/sizes.enum.ts +7 -0
  255. package/{lib/interfaces/core.d.ts → src/lib/interfaces/core.ts} +95 -53
  256. package/src/lib/interfaces/design-angular-kit-config.ts +34 -0
  257. package/src/lib/interfaces/form.ts +78 -0
  258. package/src/lib/interfaces/icon.ts +176 -0
  259. package/src/lib/interfaces/sortable-table.ts +42 -0
  260. package/src/lib/interfaces/utils.ts +11 -0
  261. package/src/lib/pipes/date-ago.pipe.ts +57 -0
  262. package/src/lib/pipes/duration.pipe.ts +112 -0
  263. package/src/lib/pipes/mark-matching-text.pipe.ts +43 -0
  264. package/src/lib/provide-design-angular-kit.ts +73 -0
  265. package/src/lib/services/notification/notification.service.spec.ts +16 -0
  266. package/src/lib/services/notification/notification.service.ts +119 -0
  267. package/{lib/utils/coercion.d.ts → src/lib/utils/coercion.ts} +7 -1
  268. package/src/lib/utils/date-utils.ts +184 -0
  269. package/src/lib/utils/file-utils.ts +80 -0
  270. package/src/lib/utils/regex.ts +44 -0
  271. package/src/lib/validators/it-validators.ts +193 -0
  272. package/{public_api.d.ts → src/public_api.ts} +43 -0
  273. package/src/test.ts +26 -0
  274. package/tsconfig.lib.json +24 -0
  275. package/tsconfig.lib.prod.json +9 -0
  276. package/tsconfig.schematics.json +25 -0
  277. package/tsconfig.spec.json +9 -0
  278. package/esm2022/design-angular-kit.mjs +0 -5
  279. package/esm2022/lib/abstracts/abstract-form.component.mjs +0 -186
  280. package/esm2022/lib/abstracts/abstract.component.mjs +0 -46
  281. package/esm2022/lib/components/core/accordion/accordion.component.mjs +0 -39
  282. package/esm2022/lib/components/core/alert/alert.component.mjs +0 -71
  283. package/esm2022/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.mjs +0 -43
  284. package/esm2022/lib/components/core/avatar/avatar-group/avatar-group.component.mjs +0 -40
  285. package/esm2022/lib/components/core/avatar/avatar.directive.mjs +0 -78
  286. package/esm2022/lib/components/core/avatar/avatar.module.mjs +0 -33
  287. package/esm2022/lib/components/core/badge/badge.directive.mjs +0 -39
  288. package/esm2022/lib/components/core/button/button.directive.mjs +0 -80
  289. package/esm2022/lib/components/core/callout/callout.component.mjs +0 -64
  290. package/esm2022/lib/components/core/card/card.component.mjs +0 -59
  291. package/esm2022/lib/components/core/carousel/carousel/carousel.component.mjs +0 -84
  292. package/esm2022/lib/components/core/carousel/carousel-item/carousel-item.component.mjs +0 -19
  293. package/esm2022/lib/components/core/carousel/carousel.module.mjs +0 -18
  294. package/esm2022/lib/components/core/chip/chip.component.mjs +0 -136
  295. package/esm2022/lib/components/core/collapse/collapse.component.mjs +0 -116
  296. package/esm2022/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.mjs +0 -27
  297. package/esm2022/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.mjs +0 -11
  298. package/esm2022/lib/components/core/dimmer/dimmer.component.mjs +0 -55
  299. package/esm2022/lib/components/core/dimmer/dimmer.module.mjs +0 -19
  300. package/esm2022/lib/components/core/dropdown/dropdown/dropdown.component.mjs +0 -144
  301. package/esm2022/lib/components/core/dropdown/dropdown-item/dropdown-item.component.mjs +0 -61
  302. package/esm2022/lib/components/core/dropdown/dropdown.module.mjs +0 -18
  303. package/esm2022/lib/components/core/forward/forward.directive.mjs +0 -57
  304. package/esm2022/lib/components/core/link/link.component.mjs +0 -42
  305. package/esm2022/lib/components/core/list/list/list.component.mjs +0 -22
  306. package/esm2022/lib/components/core/list/list-item/list-item.component.mjs +0 -56
  307. package/esm2022/lib/components/core/list/list.module.mjs +0 -18
  308. package/esm2022/lib/components/core/modal/modal.component.mjs +0 -194
  309. package/esm2022/lib/components/core/notifications/notifications.component.mjs +0 -111
  310. package/esm2022/lib/components/core/pagination/pagination.component.mjs +0 -130
  311. package/esm2022/lib/components/core/popover/popover.directive.mjs +0 -176
  312. package/esm2022/lib/components/core/progress-bar/progress-bar.component.mjs +0 -34
  313. package/esm2022/lib/components/core/progress-button/progress-button.component.mjs +0 -25
  314. package/esm2022/lib/components/core/spinner/spinner.component.mjs +0 -30
  315. package/esm2022/lib/components/core/steppers/steppers-container/steppers-container.component.mjs +0 -116
  316. package/esm2022/lib/components/core/steppers/steppers-item/steppers-item.component.mjs +0 -22
  317. package/esm2022/lib/components/core/steppers/steppers.module.mjs +0 -18
  318. package/esm2022/lib/components/core/tab/tab-container/tab-container.component.mjs +0 -97
  319. package/esm2022/lib/components/core/tab/tab-item/tab-item.component.mjs +0 -39
  320. package/esm2022/lib/components/core/tab/tab.module.mjs +0 -18
  321. package/esm2022/lib/components/core/table/sort/sort-header/sort-header.component.mjs +0 -134
  322. package/esm2022/lib/components/core/table/sort/sort.directive.mjs +0 -123
  323. package/esm2022/lib/components/core/table/table.component.mjs +0 -45
  324. package/esm2022/lib/components/core/table/table.module.mjs +0 -19
  325. package/esm2022/lib/components/core/timeline/timeline-item/timeline-item.component.mjs +0 -90
  326. package/esm2022/lib/components/core/timeline/timeline.component.mjs +0 -36
  327. package/esm2022/lib/components/core/timeline/timeline.module.mjs +0 -18
  328. package/esm2022/lib/components/core/tooltip/tooltip.directive.mjs +0 -143
  329. package/esm2022/lib/components/form/autocomplete/autocomplete.component.mjs +0 -112
  330. package/esm2022/lib/components/form/checkbox/checkbox.component.mjs +0 -48
  331. package/esm2022/lib/components/form/form.module.mjs +0 -63
  332. package/esm2022/lib/components/form/input/input.component.mjs +0 -190
  333. package/esm2022/lib/components/form/password-input/password-input.component.mjs +0 -149
  334. package/esm2022/lib/components/form/radio-button/radio-button.component.mjs +0 -60
  335. package/esm2022/lib/components/form/range/range.component.mjs +0 -64
  336. package/esm2022/lib/components/form/rating/rating.component.mjs +0 -50
  337. package/esm2022/lib/components/form/select/select.component.mjs +0 -70
  338. package/esm2022/lib/components/form/textarea/textarea.component.mjs +0 -55
  339. package/esm2022/lib/components/form/transfer/store/transfer.reducers.mjs +0 -191
  340. package/esm2022/lib/components/form/transfer/store/transfer.state.mjs +0 -2
  341. package/esm2022/lib/components/form/transfer/store/transfer.store.mjs +0 -70
  342. package/esm2022/lib/components/form/transfer/transfer-list/transfer-list.component.mjs +0 -72
  343. package/esm2022/lib/components/form/transfer/transfer.component.mjs +0 -149
  344. package/esm2022/lib/components/form/transfer/transfer.model.mjs +0 -6
  345. package/esm2022/lib/components/form/upload-drag-drop/upload-drag-drop.component.mjs +0 -142
  346. package/esm2022/lib/components/form/upload-file-list/upload-file-list.component.mjs +0 -107
  347. package/esm2022/lib/components/navigation/back-button/back-button.component.mjs +0 -67
  348. package/esm2022/lib/components/navigation/back-to-top/back-to-top.component.mjs +0 -68
  349. package/esm2022/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.mjs +0 -51
  350. package/esm2022/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.mjs +0 -21
  351. package/esm2022/lib/components/navigation/breadcrumbs/breadcrumbs.module.mjs +0 -18
  352. package/esm2022/lib/components/navigation/header/header.component.mjs +0 -97
  353. package/esm2022/lib/components/navigation/megamenu/megamenu.component.mjs +0 -27
  354. package/esm2022/lib/components/navigation/navbar/navbar/navbar.component.mjs +0 -40
  355. package/esm2022/lib/components/navigation/navbar/navbar-item/navbar-item.component.mjs +0 -11
  356. package/esm2022/lib/components/navigation/navbar/navbar.module.mjs +0 -18
  357. package/esm2022/lib/components/navigation/navscroll/navscroll-list-item.component.mjs +0 -98
  358. package/esm2022/lib/components/navigation/navscroll/navscroll-list-items.component.mjs +0 -44
  359. package/esm2022/lib/components/navigation/navscroll/navscroll.component.mjs +0 -116
  360. package/esm2022/lib/components/navigation/navscroll/navscroll.model.mjs +0 -2
  361. package/esm2022/lib/components/navigation/navscroll/navscroll.store.mjs +0 -68
  362. package/esm2022/lib/components/navigation/navscroll/navscroll.utils.mjs +0 -23
  363. package/esm2022/lib/components/navigation/sidebar/sidebar.component.mjs +0 -50
  364. package/esm2022/lib/components/navigation/skiplink/skiplink/skiplink.component.mjs +0 -27
  365. package/esm2022/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.mjs +0 -26
  366. package/esm2022/lib/components/navigation/skiplink/skiplink.module.mjs +0 -18
  367. package/esm2022/lib/components/utils/error-page/error-page.component.mjs +0 -74
  368. package/esm2022/lib/components/utils/icon/icon.component.mjs +0 -63
  369. package/esm2022/lib/components/utils/language-switcher/language-switcher.component.mjs +0 -50
  370. package/esm2022/lib/design-angular-kit.module.mjs +0 -233
  371. package/esm2022/lib/enums/colors.enums.mjs +0 -12
  372. package/esm2022/lib/enums/sizes.enum.mjs +0 -9
  373. package/esm2022/lib/interfaces/core.mjs +0 -16
  374. package/esm2022/lib/interfaces/design-angular-kit-config.mjs +0 -7
  375. package/esm2022/lib/interfaces/form.mjs +0 -2
  376. package/esm2022/lib/interfaces/icon.mjs +0 -168
  377. package/esm2022/lib/interfaces/sortable-table.mjs +0 -6
  378. package/esm2022/lib/interfaces/utils.mjs +0 -2
  379. package/esm2022/lib/pipes/date-ago.pipe.mjs +0 -56
  380. package/esm2022/lib/pipes/duration.pipe.mjs +0 -115
  381. package/esm2022/lib/pipes/mark-matching-text.pipe.mjs +0 -48
  382. package/esm2022/lib/provide-design-angular-kit.mjs +0 -64
  383. package/esm2022/lib/services/notification/notification.service.mjs +0 -120
  384. package/esm2022/lib/utils/coercion.mjs +0 -18
  385. package/esm2022/lib/utils/date-utils.mjs +0 -162
  386. package/esm2022/lib/utils/file-utils.mjs +0 -73
  387. package/esm2022/lib/utils/regex.mjs +0 -35
  388. package/esm2022/lib/validators/it-validators.mjs +0 -156
  389. package/esm2022/public_api.mjs +0 -110
  390. package/fesm2022/design-angular-kit.mjs +0 -6704
  391. package/fesm2022/design-angular-kit.mjs.map +0 -1
  392. package/index.d.ts +0 -5
  393. package/lib/abstracts/abstract-form.component.d.ts +0 -87
  394. package/lib/abstracts/abstract.component.d.ts +0 -30
  395. package/lib/components/core/accordion/accordion.component.d.ts +0 -18
  396. package/lib/components/core/alert/alert.component.d.ts +0 -44
  397. package/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.d.ts +0 -29
  398. package/lib/components/core/avatar/avatar-group/avatar-group.component.d.ts +0 -15
  399. package/lib/components/core/avatar/avatar.directive.d.ts +0 -33
  400. package/lib/components/core/avatar/avatar.module.d.ts +0 -9
  401. package/lib/components/core/badge/badge.directive.d.ts +0 -23
  402. package/lib/components/core/button/button.directive.d.ts +0 -48
  403. package/lib/components/core/callout/callout.component.d.ts +0 -50
  404. package/lib/components/core/card/card.component.d.ts +0 -69
  405. package/lib/components/core/carousel/carousel/carousel.component.d.ts +0 -65
  406. package/lib/components/core/carousel/carousel-item/carousel-item.component.d.ts +0 -15
  407. package/lib/components/core/carousel/carousel.module.d.ts +0 -8
  408. package/lib/components/core/chip/chip.component.d.ts +0 -76
  409. package/lib/components/core/collapse/collapse.component.d.ts +0 -67
  410. package/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.d.ts +0 -12
  411. package/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.d.ts +0 -5
  412. package/lib/components/core/dimmer/dimmer.component.d.ts +0 -24
  413. package/lib/components/core/dimmer/dimmer.module.d.ts +0 -9
  414. package/lib/components/core/dropdown/dropdown/dropdown.component.d.ts +0 -94
  415. package/lib/components/core/dropdown/dropdown-item/dropdown-item.component.d.ts +0 -42
  416. package/lib/components/core/dropdown/dropdown.module.d.ts +0 -8
  417. package/lib/components/core/forward/forward.directive.d.ts +0 -14
  418. package/lib/components/core/link/link.component.d.ts +0 -35
  419. package/lib/components/core/list/list/list.component.d.ts +0 -24
  420. package/lib/components/core/list/list-item/list-item.component.d.ts +0 -41
  421. package/lib/components/core/list/list.module.d.ts +0 -8
  422. package/lib/components/core/modal/modal.component.d.ts +0 -135
  423. package/lib/components/core/notifications/notifications.component.d.ts +0 -45
  424. package/lib/components/core/pagination/pagination.component.d.ts +0 -92
  425. package/lib/components/core/popover/popover.directive.d.ts +0 -99
  426. package/lib/components/core/progress-bar/progress-bar.component.d.ts +0 -31
  427. package/lib/components/core/progress-button/progress-button.component.d.ts +0 -21
  428. package/lib/components/core/spinner/spinner.component.d.ts +0 -24
  429. package/lib/components/core/steppers/steppers-container/steppers-container.component.d.ts +0 -130
  430. package/lib/components/core/steppers/steppers-item/steppers-item.component.d.ts +0 -24
  431. package/lib/components/core/steppers/steppers.module.d.ts +0 -8
  432. package/lib/components/core/tab/tab-container/tab-container.component.d.ts +0 -60
  433. package/lib/components/core/tab/tab-item/tab-item.component.d.ts +0 -38
  434. package/lib/components/core/tab/tab.module.d.ts +0 -8
  435. package/lib/components/core/table/sort/sort-header/sort-header.component.d.ts +0 -72
  436. package/lib/components/core/table/sort/sort.directive.d.ts +0 -53
  437. package/lib/components/core/table/table.component.d.ts +0 -60
  438. package/lib/components/core/table/table.module.d.ts +0 -9
  439. package/lib/components/core/timeline/timeline-item/timeline-item.component.d.ts +0 -79
  440. package/lib/components/core/timeline/timeline.component.d.ts +0 -21
  441. package/lib/components/core/timeline/timeline.module.d.ts +0 -8
  442. package/lib/components/core/tooltip/tooltip.directive.d.ts +0 -82
  443. package/lib/components/form/autocomplete/autocomplete.component.d.ts +0 -59
  444. package/lib/components/form/checkbox/checkbox.component.d.ts +0 -41
  445. package/lib/components/form/form.module.d.ts +0 -18
  446. package/lib/components/form/input/input.component.d.ts +0 -95
  447. package/lib/components/form/password-input/password-input.component.d.ts +0 -80
  448. package/lib/components/form/radio-button/radio-button.component.d.ts +0 -38
  449. package/lib/components/form/range/range.component.d.ts +0 -42
  450. package/lib/components/form/rating/rating.component.d.ts +0 -24
  451. package/lib/components/form/select/select.component.d.ts +0 -36
  452. package/lib/components/form/textarea/textarea.component.d.ts +0 -34
  453. package/lib/components/form/transfer/store/transfer.reducers.d.ts +0 -103
  454. package/lib/components/form/transfer/store/transfer.state.d.ts +0 -18
  455. package/lib/components/form/transfer/store/transfer.store.d.ts +0 -23
  456. package/lib/components/form/transfer/transfer-list/transfer-list.component.d.ts +0 -48
  457. package/lib/components/form/transfer/transfer.component.d.ts +0 -75
  458. package/lib/components/form/upload-drag-drop/upload-drag-drop.component.d.ts +0 -60
  459. package/lib/components/form/upload-file-list/upload-file-list.component.d.ts +0 -62
  460. package/lib/components/navigation/back-button/back-button.component.d.ts +0 -47
  461. package/lib/components/navigation/back-to-top/back-to-top.component.d.ts +0 -50
  462. package/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.d.ts +0 -28
  463. package/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +0 -23
  464. package/lib/components/navigation/breadcrumbs/breadcrumbs.module.d.ts +0 -8
  465. package/lib/components/navigation/header/header.component.d.ts +0 -36
  466. package/lib/components/navigation/megamenu/megamenu.component.d.ts +0 -22
  467. package/lib/components/navigation/navbar/navbar/navbar.component.d.ts +0 -16
  468. package/lib/components/navigation/navbar/navbar-item/navbar-item.component.d.ts +0 -5
  469. package/lib/components/navigation/navbar/navbar.module.d.ts +0 -8
  470. package/lib/components/navigation/navscroll/navscroll-list-item.component.d.ts +0 -16
  471. package/lib/components/navigation/navscroll/navscroll-list-items.component.d.ts +0 -7
  472. package/lib/components/navigation/navscroll/navscroll.component.d.ts +0 -47
  473. package/lib/components/navigation/navscroll/navscroll.store.d.ts +0 -16
  474. package/lib/components/navigation/navscroll/navscroll.utils.d.ts +0 -6
  475. package/lib/components/navigation/sidebar/sidebar.component.d.ts +0 -26
  476. package/lib/components/navigation/skiplink/skiplink/skiplink.component.d.ts +0 -17
  477. package/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.d.ts +0 -24
  478. package/lib/components/navigation/skiplink/skiplink.module.d.ts +0 -8
  479. package/lib/components/utils/error-page/error-page.component.d.ts +0 -44
  480. package/lib/components/utils/icon/icon.component.d.ts +0 -53
  481. package/lib/components/utils/language-switcher/language-switcher.component.d.ts +0 -27
  482. package/lib/design-angular-kit.module.d.ts +0 -53
  483. package/lib/enums/colors.enums.d.ts +0 -10
  484. package/lib/enums/sizes.enum.d.ts +0 -7
  485. package/lib/interfaces/design-angular-kit-config.d.ts +0 -30
  486. package/lib/interfaces/form.d.ts +0 -67
  487. package/lib/interfaces/icon.d.ts +0 -4
  488. package/lib/interfaces/sortable-table.d.ts +0 -33
  489. package/lib/interfaces/utils.d.ts +0 -10
  490. package/lib/pipes/date-ago.pipe.d.ts +0 -17
  491. package/lib/pipes/duration.pipe.d.ts +0 -35
  492. package/lib/pipes/mark-matching-text.pipe.d.ts +0 -18
  493. package/lib/provide-design-angular-kit.d.ts +0 -7
  494. package/lib/services/notification/notification.service.d.ts +0 -63
  495. package/lib/utils/date-utils.d.ts +0 -79
  496. package/lib/utils/file-utils.d.ts +0 -32
  497. package/lib/utils/regex.d.ts +0 -34
  498. package/lib/validators/it-validators.d.ts +0 -69
  499. package/schematics/ng-add/index.d.ts +0 -3
  500. package/schematics/ng-add/index.js +0 -29
  501. package/schematics/ng-add/index.js.map +0 -1
  502. package/schematics/ng-add/index.spec.d.ts +0 -1
  503. package/schematics/ng-add/index.spec.js +0 -43
  504. package/schematics/ng-add/index.spec.js.map +0 -1
  505. package/schematics/ng-add/rules/setup-project/add-animations.d.ts +0 -2
  506. package/schematics/ng-add/rules/setup-project/add-animations.js +0 -11
  507. package/schematics/ng-add/rules/setup-project/add-animations.js.map +0 -1
  508. package/schematics/ng-add/rules/setup-project/add-assets.d.ts +0 -3
  509. package/schematics/ng-add/rules/setup-project/add-assets.js +0 -50
  510. package/schematics/ng-add/rules/setup-project/add-assets.js.map +0 -1
  511. package/schematics/ng-add/rules/setup-project/add-design-angular-kit.d.ts +0 -3
  512. package/schematics/ng-add/rules/setup-project/add-design-angular-kit.js +0 -43
  513. package/schematics/ng-add/rules/setup-project/add-design-angular-kit.js.map +0 -1
  514. package/schematics/ng-add/rules/setup-project/add-http-client.d.ts +0 -2
  515. package/schematics/ng-add/rules/setup-project/add-http-client.js +0 -11
  516. package/schematics/ng-add/rules/setup-project/add-http-client.js.map +0 -1
  517. package/schematics/ng-add/rules/setup-project/add-import-to-style-file.d.ts +0 -11
  518. package/schematics/ng-add/rules/setup-project/add-import-to-style-file.js +0 -112
  519. package/schematics/ng-add/rules/setup-project/add-import-to-style-file.js.map +0 -1
  520. package/schematics/ng-add/rules/setup-project/add-localisation.d.ts +0 -3
  521. package/schematics/ng-add/rules/setup-project/add-localisation.js +0 -50
  522. package/schematics/ng-add/rules/setup-project/add-localisation.js.map +0 -1
  523. package/schematics/ng-add/rules/setup-project/angular-json-helper.d.ts +0 -2
  524. package/schematics/ng-add/rules/setup-project/angular-json-helper.js +0 -13
  525. package/schematics/ng-add/rules/setup-project/angular-json-helper.js.map +0 -1
  526. package/schematics/ng-add/rules/setup-project/exceptions.d.ts +0 -7
  527. package/schematics/ng-add/rules/setup-project/exceptions.js +0 -17
  528. package/schematics/ng-add/rules/setup-project/exceptions.js.map +0 -1
  529. package/schematics/ng-add/rules/setup-project/index.js +0 -23
  530. package/schematics/ng-add/rules/setup-project/index.js.map +0 -1
  531. package/schematics/ng-add/schema.js +0 -3
  532. package/schematics/ng-add/schema.js.map +0 -1
  533. package/schematics/ng-add/setup-project.d.ts +0 -3
  534. package/schematics/ng-add/setup-project.js +0 -37
  535. package/schematics/ng-add/setup-project.js.map +0 -1
  536. package/schematics/ng-add/setup-project.spec.d.ts +0 -1
  537. package/schematics/ng-add/setup-project.spec.js +0 -139
  538. package/schematics/ng-add/setup-project.spec.js.map +0 -1
  539. package/schematics/ng-add/utils.d.ts +0 -14
  540. package/schematics/ng-add/utils.js +0 -49
  541. package/schematics/ng-add/utils.js.map +0 -1
  542. package/schematics/ng-add/versions-helper.d.ts +0 -3
  543. package/schematics/ng-add/versions-helper.js +0 -40
  544. package/schematics/ng-add/versions-helper.js.map +0 -1
  545. /package/schematics/ng-add/rules/setup-project/{index.d.ts → index.ts} +0 -0
@@ -0,0 +1,234 @@
1
+ import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
2
+ import { ItAbstractFormComponent } from '../../../abstracts/abstract-form.component';
3
+ import { InputControlType } from '../../../interfaces/form';
4
+ import { AbstractControl, ReactiveFormsModule, ValidatorFn, Validators } from '@angular/forms';
5
+ import { ItValidators } from '../../../validators/it-validators';
6
+ import { Observable } from 'rxjs';
7
+ import { AsyncPipe } from '@angular/common';
8
+ import { TranslateModule } from '@ngx-translate/core';
9
+ import { inputToBoolean } from '../../../utils/coercion';
10
+
11
+ @Component({
12
+ standalone: true,
13
+ selector: 'it-input',
14
+ templateUrl: './input.component.html',
15
+ styleUrls: ['./input.component.scss'],
16
+ changeDetection: ChangeDetectionStrategy.OnPush,
17
+ imports: [ReactiveFormsModule, TranslateModule, AsyncPipe],
18
+ })
19
+ export class ItInputComponent extends ItAbstractFormComponent<string | number | null | undefined> implements OnInit {
20
+ /**
21
+ * The input type
22
+ * @default text
23
+ */
24
+ @Input() type: InputControlType = 'text';
25
+
26
+ /**
27
+ * The input placeholder
28
+ */
29
+ @Input() placeholder = '';
30
+
31
+ /**
32
+ * The input description
33
+ */
34
+ @Input() description: string | undefined;
35
+
36
+ /**
37
+ * To prevent modification of the contained value.
38
+ * - <b>plaintext</b>: Readonly field in the form stylized as plain text
39
+ * @default undefined
40
+ */
41
+ @Input() readonly: boolean | 'plaintext' | undefined;
42
+
43
+ /**
44
+ * The max date value [Used only in type = 'date']
45
+ * @default '9999-12-31'
46
+ * @example 'yyyy-mm-dd'
47
+ */
48
+ @Input() maxDate?: string = '9999-12-31';
49
+
50
+ /**
51
+ * The min date value [Used only in type = 'date']
52
+ * @example 'yyyy-mm-dd'
53
+ */
54
+ @Input() minDate: string | undefined;
55
+
56
+ /**
57
+ * The max value [Used only in type = 'number']
58
+ */
59
+ @Input() max: number | undefined;
60
+
61
+ /**
62
+ * The min value [Used only in type = 'number']
63
+ */
64
+ @Input() min: number | undefined;
65
+
66
+ /**
67
+ * The step value [Used only in type = 'number']
68
+ */
69
+ @Input() step: number | 'any' | undefined;
70
+
71
+ /**
72
+ * If is a currency number [Used only in type = 'number']
73
+ * @default false
74
+ */
75
+ @Input({ transform: inputToBoolean }) currency?: boolean;
76
+
77
+ /**
78
+ * If is a percentage number [Used only in type = 'number']
79
+ * @default false
80
+ */
81
+ @Input({ transform: inputToBoolean }) percentage?: boolean;
82
+
83
+ /**
84
+ * The currency or percentage symbol [Used only if percentage or currency]
85
+ * @example '$'
86
+ */
87
+ @Input() symbol: string | undefined;
88
+
89
+ /**
90
+ * To make the numeric field automatically resize according to the value contained in it. [Used only in type = 'number']
91
+ * @default false
92
+ */
93
+ @Input({ transform: inputToBoolean }) adaptive?: boolean;
94
+
95
+ /**
96
+ * Input autocomplete attribute (Browser autocomplete)
97
+ * @default undefined
98
+ */
99
+ @Input() autocomplete: string | undefined;
100
+
101
+ get isActiveLabel(): boolean {
102
+ const value = this.control.value;
103
+ if ((!!value && value !== 0) || value === 0 || !!this.placeholder) {
104
+ return true;
105
+ }
106
+
107
+ // if (this.type === 'number' && (!!this.currency || !!this.percentage)) {
108
+ // return true;
109
+ // }
110
+
111
+ return this.type === 'date' || this.type === 'time' || this.type === 'color';
112
+ }
113
+
114
+ /**
115
+ * Check is readonly field
116
+ */
117
+ protected get isReadonly(): boolean {
118
+ return this.readonly === 'plaintext' || !!this.readonly;
119
+ }
120
+
121
+ /**
122
+ * Return the invalid message string from TranslateService
123
+ */
124
+ override get invalidMessage(): Observable<string> {
125
+ if (this.hasError('min') && this.min) {
126
+ return this._translateService.get('it.errors.min-invalid', {
127
+ min: this.min,
128
+ });
129
+ }
130
+ if (this.hasError('max') && this.max) {
131
+ return this._translateService.get('it.errors.max-invalid', {
132
+ max: this.max,
133
+ });
134
+ }
135
+ if (this.hasError('minlength')) {
136
+ const error = this.getError('minlength');
137
+ return this._translateService.get('it.errors.min-length-invalid', {
138
+ min: error.requiredLength,
139
+ });
140
+ }
141
+ if (this.hasError('maxlength')) {
142
+ const error = this.getError('maxlength');
143
+ return this._translateService.get('it.errors.max-length-invalid', {
144
+ max: error.requiredLength,
145
+ });
146
+ }
147
+ if (this.hasError('email') || this.hasError('invalidEmail')) {
148
+ return this._translateService.get('it.errors.email-invalid');
149
+ }
150
+ if (this.hasError('invalidTel')) {
151
+ return this._translateService.get('it.errors.tel-invalid');
152
+ }
153
+ if (this.hasError('invalidUrl')) {
154
+ return this._translateService.get('it.errors.url-invalid');
155
+ }
156
+ if (this.hasError('invalidTaxCode')) {
157
+ return this._translateService.get('it.errors.tax-code-invalid');
158
+ }
159
+ if (this.hasError('invalidVatNumber')) {
160
+ return this._translateService.get('it.errors.vat-number-invalid');
161
+ }
162
+ if (this.hasError('invalidCap')) {
163
+ return this._translateService.get('it.errors.cap-invalid');
164
+ }
165
+ if (this.hasError('invalidIban')) {
166
+ return this._translateService.get('it.errors.iban-invalid');
167
+ }
168
+ if (this.hasError('invalidPlate')) {
169
+ return this._translateService.get('it.errors.plate-invalid');
170
+ }
171
+ if (this.hasError('invalidRegex')) {
172
+ return this._translateService.get('it.errors.regex-invalid');
173
+ }
174
+ if (this.hasError('pattern')) {
175
+ const error = this.getError('pattern');
176
+ return this._translateService.get('it.errors.pattern-invalid', {
177
+ pattern: error.requiredPattern,
178
+ });
179
+ }
180
+
181
+ return super.invalidMessage;
182
+ }
183
+
184
+ override ngOnInit() {
185
+ super.ngOnInit();
186
+
187
+ const validators: Array<ValidatorFn> = [];
188
+ switch (this.type) {
189
+ case 'number':
190
+ if (this.percentage) {
191
+ this.min = this.min || 0;
192
+ this.max = this.max || 100;
193
+ }
194
+
195
+ // Dynamic min/max validators
196
+ validators.push((control: AbstractControl) => (this.min ? Validators.min(this.min)(control) : null));
197
+ validators.push((control: AbstractControl) => (this.max ? Validators.max(this.max)(control) : null));
198
+ break;
199
+ case 'email':
200
+ validators.push(ItValidators.email);
201
+ break;
202
+ case 'tel':
203
+ validators.push(ItValidators.tel);
204
+ break;
205
+ case 'url':
206
+ validators.push(ItValidators.url);
207
+ break;
208
+ }
209
+
210
+ this.addValidators(validators);
211
+ }
212
+
213
+ /**
214
+ * Increment or decrease the input number value of step
215
+ * @param decrease true to decrease value
216
+ */
217
+ protected incrementNumber(decrease = false): void {
218
+ if (this.type !== 'number') {
219
+ return;
220
+ }
221
+ const step = this.step === 'any' ? 1 : this.step ?? 1;
222
+ let value = Number(this.control.value);
223
+ value = (isNaN(value) ? 0 : value) + (decrease ? -step : step);
224
+ value = Math.round(value * 1e12) / 1e12; // prevent js decimal error
225
+
226
+ if (this.min !== undefined && value < this.min) {
227
+ value = this.min;
228
+ } else if (this.max !== undefined && value > this.max) {
229
+ value = this.max;
230
+ }
231
+
232
+ this.control.setValue(value);
233
+ }
234
+ }
@@ -0,0 +1,65 @@
1
+ <div class="form-group">
2
+ @if (label) {
3
+ <label [for]="id" [class.active]="!!control.value || !!placeholder">{{ label }}</label>
4
+ }
5
+ <input
6
+ #input
7
+ [id]="id"
8
+ type="password"
9
+ class="form-control input-password"
10
+ [class.is-invalid]="isInvalid"
11
+ [class.is-valid]="isValid"
12
+ [formControl]="control"
13
+ [placeholder]="placeholder"
14
+ [attr.aria-describedby]="id + '-description'"
15
+ [autocomplete]="confirmPasswordField ? 'off' : autocomplete" />
16
+
17
+ <span class="password-icon" aria-hidden="true">
18
+ <it-icon name="password-visible" size="sm" class="password-icon-visible"></it-icon>
19
+ <it-icon name="password-invisible" size="sm" class="password-icon-invisible d-none"></it-icon>
20
+ </span>
21
+
22
+ @if (isInvalid) {
23
+ <div [id]="id + '-error'" class="form-feedback just-validate-error-label">
24
+ <div #customError>
25
+ <ng-content select="[error]"></ng-content>
26
+ </div>
27
+ @if (!customError.hasChildNodes()) {
28
+ {{ invalidMessage | async }}
29
+ }
30
+ </div>
31
+ }
32
+
33
+ @if (description !== undefined && !isStrengthMeter) {
34
+ <small [id]="id + '-description'" class="form-text">
35
+ {{ description !== true ? description : (strengthMeterDescription | async) }}
36
+ </small>
37
+ }
38
+
39
+ <small class="password-caps form-text text-warning position-absolute bg-white w-100">
40
+ {{ 'it.form.caps-inserted' | translate }}
41
+ </small>
42
+
43
+ @if (isStrengthMeter) {
44
+ <div class="password-strength-meter">
45
+ <small
46
+ [id]="id + '-description'"
47
+ class="form-text text-muted"
48
+ [attr.data-bs-short-pass]="'it.form.password-strength-meter.password-short' | translate"
49
+ [attr.data-bs-bad-pas]="'it.form.password-strength-meter.password-bad' | translate"
50
+ [attr.data-bs-good-pass]="'it.form.password-strength-meter.password-good' | translate"
51
+ [attr.data-bs-strong-pass]="'it.form.password-strength-meter.password-strong' | translate">
52
+ {{ description !== undefined && description !== true ? description : (strengthMeterDescription | async) }}
53
+ </small>
54
+ <div class="password-meter progress rounded-0 position-absolute">
55
+ <div class="row position-absolute w-100 m-0">
56
+ <div class="col-3 border-start border-end border-white"></div>
57
+ <div class="col-3 border-start border-end border-white"></div>
58
+ <div class="col-3 border-start border-end border-white"></div>
59
+ <div class="col-3 border-start border-end border-white"></div>
60
+ </div>
61
+ <div class="progress-bar bg-muted" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
62
+ </div>
63
+ </div>
64
+ }
65
+ </div>
@@ -0,0 +1,9 @@
1
+ .form-group {
2
+ input:focus:not(.focus--mouse) {
3
+ box-shadow: inherit !important;
4
+ border-color: inherit !important;
5
+ }
6
+ label:not(.active):has(+ input:-webkit-autofill) {
7
+ transform: translateY(-75%);
8
+ }
9
+ }
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ItPasswordInputComponent } from './password-input.component';
4
+ import { tb_base } from '../../../../test';
5
+
6
+ describe('ItPasswordInputComponent', () => {
7
+ let component: ItPasswordInputComponent;
8
+ let fixture: ComponentFixture<ItPasswordInputComponent>;
9
+
10
+ beforeEach(async () => {
11
+ await TestBed.configureTestingModule(tb_base).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(ItPasswordInputComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,171 @@
1
+ import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
2
+ import { ItAbstractFormComponent } from '../../../abstracts/abstract-form.component';
3
+ import { ItValidators } from '../../../validators/it-validators';
4
+ import { map, Observable } from 'rxjs';
5
+ import { InputPassword } from 'bootstrap-italia';
6
+ import { ReactiveFormsModule, Validators } from '@angular/forms';
7
+ import { AsyncPipe } from '@angular/common';
8
+ import { ItIconComponent } from '../../utils/icon/icon.component';
9
+ import { TranslateModule } from '@ngx-translate/core';
10
+ import { inputToBoolean } from '../../../utils/coercion';
11
+
12
+ @Component({
13
+ standalone: true,
14
+ selector: 'it-password-input',
15
+ templateUrl: './password-input.component.html',
16
+ styleUrls: ['./password-input.component.scss'],
17
+ changeDetection: ChangeDetectionStrategy.OnPush,
18
+ imports: [ReactiveFormsModule, ItIconComponent, AsyncPipe, TranslateModule],
19
+ })
20
+ export class ItPasswordInputComponent extends ItAbstractFormComponent<string | null | undefined> implements OnInit, AfterViewInit {
21
+ /**
22
+ * The field is required
23
+ * @default true
24
+ */
25
+ @Input() required: boolean = true;
26
+
27
+ /**
28
+ * The password minimum length
29
+ * @default 10
30
+ */
31
+ @Input() minLength: number = 10;
32
+
33
+ /**
34
+ * The password must contain at least one number
35
+ * @default true
36
+ */
37
+ @Input() useNumber: boolean = true;
38
+
39
+ /**
40
+ * The password must contain at least one uppercase character
41
+ * @default true
42
+ */
43
+ @Input() useCapitalCase: boolean = true;
44
+
45
+ /**
46
+ * The password must contain at least one lowercase character
47
+ * @default true
48
+ */
49
+ @Input() useSmallCase: boolean = true;
50
+
51
+ /**
52
+ * The password must contain at least one special character
53
+ * @default true
54
+ */
55
+ @Input() useSpecialCharacters: boolean = true;
56
+
57
+ /**
58
+ * The input placeholder
59
+ */
60
+ @Input() placeholder: string = '';
61
+
62
+ /**
63
+ * The input description
64
+ * - <b>true</b>: show the StrengthMeter description message
65
+ * - <b>string</b>: show custom description
66
+ * @default true for StrengthMeter mode else is undefined
67
+ */
68
+ @Input() description: string | true | undefined;
69
+
70
+ /**
71
+ * Enable to show the strength meter
72
+ * @default false
73
+ */
74
+ @Input({ transform: inputToBoolean }) showStrengthMeter?: boolean;
75
+
76
+ /**
77
+ * Is the confirmation password field
78
+ * @default false
79
+ */
80
+ @Input({ transform: inputToBoolean }) confirmPasswordField?: boolean;
81
+
82
+ /**
83
+ * Input autocomplete attribute (Browser autocomplete)
84
+ * @default undefined
85
+ */
86
+ @Input() autocomplete: string | undefined;
87
+
88
+ private inputPasswordBs?: InputPassword;
89
+
90
+ @ViewChild('input') private inputElement?: ElementRef<HTMLInputElement>;
91
+
92
+ override ngOnInit() {
93
+ super.ngOnInit();
94
+
95
+ if (!this.confirmPasswordField) {
96
+ this.addValidators(
97
+ ItValidators.password(
98
+ this.minLength,
99
+ this.useNumber,
100
+ this.useCapitalCase,
101
+ this.useSmallCase,
102
+ this.useSpecialCharacters,
103
+ this.required
104
+ )
105
+ );
106
+ } else if (this.required) {
107
+ this.addValidators(Validators.required);
108
+ }
109
+ }
110
+
111
+ override ngAfterViewInit() {
112
+ super.ngAfterViewInit();
113
+
114
+ if (this.inputElement) {
115
+ this.inputPasswordBs = InputPassword.getOrCreateInstance(this.inputElement.nativeElement, {
116
+ showText: this.isStrengthMeter,
117
+ minimumLength: this.minLength,
118
+ });
119
+ }
120
+ }
121
+
122
+ protected get isStrengthMeter(): boolean {
123
+ return !this.confirmPasswordField && !!this.showStrengthMeter;
124
+ }
125
+
126
+ /**
127
+ * Return the invalid message string from TranslateService
128
+ */
129
+ override get invalidMessage(): Observable<string> {
130
+ if (this.hasError('noPasswordMatch')) {
131
+ return this._translateService.get('it.errors.password-no-match');
132
+ }
133
+ if (this.hasError('minlength')) {
134
+ return this._translateService.get('it.errors.password-min-length', {
135
+ minLength: this.minLength,
136
+ });
137
+ }
138
+ if (this.hasError('hasNumber')) {
139
+ return this._translateService.get('it.errors.password-number');
140
+ }
141
+ if (this.hasError('hasCapitalCase')) {
142
+ return this._translateService.get('it.errors.password-capital-case');
143
+ }
144
+ if (this.hasError('hasSmallCase')) {
145
+ return this._translateService.get('it.errors.password-capital-case');
146
+ }
147
+ if (this.hasError('hasSpecialCharacters')) {
148
+ return this._translateService.get('it.errors.password-special-character');
149
+ }
150
+
151
+ return super.invalidMessage;
152
+ }
153
+
154
+ /**
155
+ * Retrieve the default StrengthMeter description message from TranslateService
156
+ */
157
+ protected get strengthMeterDescription(): Observable<string> {
158
+ const keys = ['it.form.password-strength-meter.description.default'];
159
+ if (this.useNumber) {
160
+ keys.push('it.form.password-strength-meter.description.number');
161
+ }
162
+ if (this.useCapitalCase) {
163
+ keys.push('it.form.password-strength-meter.description.capital-case');
164
+ }
165
+ if (this.useSpecialCharacters) {
166
+ keys.push('it.form.password-strength-meter.description.special-character');
167
+ }
168
+
169
+ return this._translateService.get(keys, { minLength: this.minLength }).pipe(map(labels => Object.values(labels).join(', ')));
170
+ }
171
+ }
@@ -0,0 +1,50 @@
1
+ <ng-container>
2
+ <div class="form-check" [class.form-check-group]="group" [class.form-check-inline]="inline">
3
+ <input
4
+ [id]="id"
5
+ type="radio"
6
+ [value]="value"
7
+ [name]="name"
8
+ [class.is-invalid]="isInvalid"
9
+ [class.is-valid]="isValid"
10
+ [formControl]="control"
11
+ [attr.aria-describedby]="id + '-help'" />
12
+
13
+ <label class="form-check-label" [for]="id">
14
+ <div #customLabel>
15
+ <ng-content select="[label]"></ng-content>
16
+ </div>
17
+ @if (!customLabel.hasChildNodes()) {
18
+ {{ label }}
19
+ }
20
+ </label>
21
+
22
+ @if (group) {
23
+ <small [id]="id + '-help'" class="form-text">
24
+ <ng-content></ng-content>
25
+ </small>
26
+ }
27
+
28
+ @if (isInvalid && group) {
29
+ <div class="form-feedback just-validate-error-label" [id]="id + '-error'">
30
+ <div #customError>
31
+ <ng-content select="[error]"></ng-content>
32
+ </div>
33
+ @if (!customError.hasChildNodes()) {
34
+ {{ invalidMessage | async }}
35
+ }
36
+ </div>
37
+ }
38
+ </div>
39
+
40
+ @if (isInvalid && !group) {
41
+ <div class="form-feedback just-validate-error-label" [id]="id + '-error'">
42
+ <div #customError>
43
+ <ng-content select="[error]"></ng-content>
44
+ </div>
45
+ @if (!customError.hasChildNodes()) {
46
+ {{ invalidMessage | async }}
47
+ }
48
+ </div>
49
+ }
50
+ </ng-container>
@@ -0,0 +1,14 @@
1
+ //@import 'bootstrap-italia/src/scss/functions';
2
+ //@import 'bootstrap-italia/src/scss/utilities/colors_vars';
3
+ //
4
+ //.form-check {
5
+ //
6
+ // [type=radio].is-invalid:not(:checked) + label::after,
7
+ // [type=radio].is-invalid:not(:checked) + label::before {
8
+ // border-color: $danger;
9
+ // }
10
+ //
11
+ // [type=radio].is-invalid:not(:checked) + label {
12
+ // color: $danger;
13
+ // }
14
+ //}
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ItRadioButtonComponent } from './radio-button.component';
4
+ import { tb_base } from '../../../../test';
5
+
6
+ describe('ItRadioButtonComponent', () => {
7
+ let component: ItRadioButtonComponent;
8
+ let fixture: ComponentFixture<ItRadioButtonComponent>;
9
+
10
+ beforeEach(async () => {
11
+ await TestBed.configureTestingModule(tb_base).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(ItRadioButtonComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,82 @@
1
+ import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
2
+ import { ItAbstractFormComponent } from '../../../abstracts/abstract-form.component';
3
+ import { ReactiveFormsModule } from '@angular/forms';
4
+ import { AsyncPipe } from '@angular/common';
5
+ import { inputToBoolean } from '../../../utils/coercion';
6
+
7
+ @Component({
8
+ standalone: true,
9
+ selector: 'it-radio-button',
10
+ templateUrl: './radio-button.component.html',
11
+ styleUrls: ['./radio-button.component.scss'],
12
+ changeDetection: ChangeDetectionStrategy.OnPush,
13
+ imports: [ReactiveFormsModule, AsyncPipe],
14
+ })
15
+ export class ItRadioButtonComponent extends ItAbstractFormComponent<string | number | null | undefined> implements OnInit {
16
+ /**
17
+ * The radio value
18
+ */
19
+ @Input({ required: true }) value: string | number | undefined | null;
20
+
21
+ /**
22
+ * If show radio inline
23
+ * @default false
24
+ */
25
+ @Input({ transform: inputToBoolean }) inline?: boolean;
26
+
27
+ /**
28
+ * If is radio group
29
+ * @default false
30
+ */
31
+ @Input({ transform: inputToBoolean }) group?: boolean;
32
+
33
+ /**
34
+ * If is radio is checked
35
+ * @default false
36
+ */
37
+ @Input({ transform: inputToBoolean }) checked?: boolean;
38
+
39
+ /**
40
+ * Set the radio name manually.
41
+ * For example when the radio button name is duplicated inside page
42
+ * @default by default the radio name is calculated from form field name
43
+ */
44
+ @Input() forceRadioName?: string;
45
+
46
+ get name(): string {
47
+ if (this.forceRadioName) {
48
+ return this.forceRadioName;
49
+ }
50
+
51
+ let name = '';
52
+ if (this._ngControl) {
53
+ name = this._ngControl.name?.toString() || '';
54
+
55
+ // Retrieve parent name, prevent duplicate name inside FormArray or nested FormGroup
56
+ let control = this._ngControl.control?.parent;
57
+ while (control?.parent) {
58
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
+ const controls: { [key: string]: any } = control?.parent?.controls || {};
60
+ const parentName = Object.keys(controls).find(name => control === controls[name]) || null;
61
+ if (!parentName) {
62
+ break;
63
+ }
64
+ name = `${parentName}.${name}`; // parent.0.radioName
65
+ control = control.parent;
66
+ }
67
+ }
68
+
69
+ return name;
70
+ }
71
+
72
+ override ngOnInit() {
73
+ super.ngOnInit();
74
+
75
+ if (this.control.value || !this.value || !this.checked) {
76
+ return;
77
+ }
78
+
79
+ this.writeValue(this.value);
80
+ return this.onChange(this.value);
81
+ }
82
+ }
@@ -0,0 +1,17 @@
1
+ <div class="d-flex justify-content-between align-items-center">
2
+ @if (label) {
3
+ <label [for]="id" class="form-label">{{ label }}</label>
4
+ }
5
+ <ng-content></ng-content>
6
+ </div>
7
+
8
+ <input
9
+ #slider
10
+ [id]="id"
11
+ type="range"
12
+ [min]="min"
13
+ [max]="max"
14
+ [step]="step"
15
+ class="form-range"
16
+ [class.double-color]="!!leftColor && !!rightColor"
17
+ [formControl]="control" />