design-angular-kit 1.1.4 → 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 (546) 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/README.md +0 -461
  279. package/esm2022/design-angular-kit.mjs +0 -5
  280. package/esm2022/lib/abstracts/abstract-form.component.mjs +0 -186
  281. package/esm2022/lib/abstracts/abstract.component.mjs +0 -46
  282. package/esm2022/lib/components/core/accordion/accordion.component.mjs +0 -39
  283. package/esm2022/lib/components/core/alert/alert.component.mjs +0 -71
  284. package/esm2022/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.mjs +0 -43
  285. package/esm2022/lib/components/core/avatar/avatar-group/avatar-group.component.mjs +0 -40
  286. package/esm2022/lib/components/core/avatar/avatar.directive.mjs +0 -78
  287. package/esm2022/lib/components/core/avatar/avatar.module.mjs +0 -33
  288. package/esm2022/lib/components/core/badge/badge.directive.mjs +0 -39
  289. package/esm2022/lib/components/core/button/button.directive.mjs +0 -80
  290. package/esm2022/lib/components/core/callout/callout.component.mjs +0 -64
  291. package/esm2022/lib/components/core/card/card.component.mjs +0 -59
  292. package/esm2022/lib/components/core/carousel/carousel/carousel.component.mjs +0 -84
  293. package/esm2022/lib/components/core/carousel/carousel-item/carousel-item.component.mjs +0 -19
  294. package/esm2022/lib/components/core/carousel/carousel.module.mjs +0 -18
  295. package/esm2022/lib/components/core/chip/chip.component.mjs +0 -136
  296. package/esm2022/lib/components/core/collapse/collapse.component.mjs +0 -116
  297. package/esm2022/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.mjs +0 -27
  298. package/esm2022/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.mjs +0 -11
  299. package/esm2022/lib/components/core/dimmer/dimmer.component.mjs +0 -55
  300. package/esm2022/lib/components/core/dimmer/dimmer.module.mjs +0 -19
  301. package/esm2022/lib/components/core/dropdown/dropdown/dropdown.component.mjs +0 -144
  302. package/esm2022/lib/components/core/dropdown/dropdown-item/dropdown-item.component.mjs +0 -61
  303. package/esm2022/lib/components/core/dropdown/dropdown.module.mjs +0 -18
  304. package/esm2022/lib/components/core/forward/forward.directive.mjs +0 -57
  305. package/esm2022/lib/components/core/link/link.component.mjs +0 -42
  306. package/esm2022/lib/components/core/list/list/list.component.mjs +0 -22
  307. package/esm2022/lib/components/core/list/list-item/list-item.component.mjs +0 -56
  308. package/esm2022/lib/components/core/list/list.module.mjs +0 -18
  309. package/esm2022/lib/components/core/modal/modal.component.mjs +0 -194
  310. package/esm2022/lib/components/core/notifications/notifications.component.mjs +0 -111
  311. package/esm2022/lib/components/core/pagination/pagination.component.mjs +0 -130
  312. package/esm2022/lib/components/core/popover/popover.directive.mjs +0 -176
  313. package/esm2022/lib/components/core/progress-bar/progress-bar.component.mjs +0 -34
  314. package/esm2022/lib/components/core/progress-button/progress-button.component.mjs +0 -25
  315. package/esm2022/lib/components/core/spinner/spinner.component.mjs +0 -30
  316. package/esm2022/lib/components/core/steppers/steppers-container/steppers-container.component.mjs +0 -116
  317. package/esm2022/lib/components/core/steppers/steppers-item/steppers-item.component.mjs +0 -20
  318. package/esm2022/lib/components/core/steppers/steppers.module.mjs +0 -18
  319. package/esm2022/lib/components/core/tab/tab-container/tab-container.component.mjs +0 -72
  320. package/esm2022/lib/components/core/tab/tab-item/tab-item.component.mjs +0 -39
  321. package/esm2022/lib/components/core/tab/tab.module.mjs +0 -18
  322. package/esm2022/lib/components/core/table/sort/sort-header/sort-header.component.mjs +0 -134
  323. package/esm2022/lib/components/core/table/sort/sort.directive.mjs +0 -123
  324. package/esm2022/lib/components/core/table/table.component.mjs +0 -45
  325. package/esm2022/lib/components/core/table/table.module.mjs +0 -19
  326. package/esm2022/lib/components/core/timeline/timeline-item/timeline-item.component.mjs +0 -90
  327. package/esm2022/lib/components/core/timeline/timeline.component.mjs +0 -36
  328. package/esm2022/lib/components/core/timeline/timeline.module.mjs +0 -18
  329. package/esm2022/lib/components/core/tooltip/tooltip.directive.mjs +0 -143
  330. package/esm2022/lib/components/form/autocomplete/autocomplete.component.mjs +0 -112
  331. package/esm2022/lib/components/form/checkbox/checkbox.component.mjs +0 -48
  332. package/esm2022/lib/components/form/form.module.mjs +0 -63
  333. package/esm2022/lib/components/form/input/input.component.mjs +0 -190
  334. package/esm2022/lib/components/form/password-input/password-input.component.mjs +0 -149
  335. package/esm2022/lib/components/form/radio-button/radio-button.component.mjs +0 -60
  336. package/esm2022/lib/components/form/range/range.component.mjs +0 -64
  337. package/esm2022/lib/components/form/rating/rating.component.mjs +0 -50
  338. package/esm2022/lib/components/form/select/select.component.mjs +0 -70
  339. package/esm2022/lib/components/form/textarea/textarea.component.mjs +0 -55
  340. package/esm2022/lib/components/form/transfer/store/transfer.reducers.mjs +0 -191
  341. package/esm2022/lib/components/form/transfer/store/transfer.state.mjs +0 -2
  342. package/esm2022/lib/components/form/transfer/store/transfer.store.mjs +0 -70
  343. package/esm2022/lib/components/form/transfer/transfer-list/transfer-list.component.mjs +0 -72
  344. package/esm2022/lib/components/form/transfer/transfer.component.mjs +0 -149
  345. package/esm2022/lib/components/form/transfer/transfer.model.mjs +0 -6
  346. package/esm2022/lib/components/form/upload-drag-drop/upload-drag-drop.component.mjs +0 -142
  347. package/esm2022/lib/components/form/upload-file-list/upload-file-list.component.mjs +0 -107
  348. package/esm2022/lib/components/navigation/back-button/back-button.component.mjs +0 -67
  349. package/esm2022/lib/components/navigation/back-to-top/back-to-top.component.mjs +0 -68
  350. package/esm2022/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.mjs +0 -51
  351. package/esm2022/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.mjs +0 -21
  352. package/esm2022/lib/components/navigation/breadcrumbs/breadcrumbs.module.mjs +0 -18
  353. package/esm2022/lib/components/navigation/header/header.component.mjs +0 -97
  354. package/esm2022/lib/components/navigation/megamenu/megamenu.component.mjs +0 -27
  355. package/esm2022/lib/components/navigation/navbar/navbar/navbar.component.mjs +0 -40
  356. package/esm2022/lib/components/navigation/navbar/navbar-item/navbar-item.component.mjs +0 -11
  357. package/esm2022/lib/components/navigation/navbar/navbar.module.mjs +0 -18
  358. package/esm2022/lib/components/navigation/navscroll/navscroll-list-item.component.mjs +0 -98
  359. package/esm2022/lib/components/navigation/navscroll/navscroll-list-items.component.mjs +0 -44
  360. package/esm2022/lib/components/navigation/navscroll/navscroll.component.mjs +0 -116
  361. package/esm2022/lib/components/navigation/navscroll/navscroll.model.mjs +0 -2
  362. package/esm2022/lib/components/navigation/navscroll/navscroll.store.mjs +0 -65
  363. package/esm2022/lib/components/navigation/navscroll/navscroll.utils.mjs +0 -23
  364. package/esm2022/lib/components/navigation/sidebar/sidebar.component.mjs +0 -50
  365. package/esm2022/lib/components/navigation/skiplink/skiplink/skiplink.component.mjs +0 -27
  366. package/esm2022/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.mjs +0 -26
  367. package/esm2022/lib/components/navigation/skiplink/skiplink.module.mjs +0 -18
  368. package/esm2022/lib/components/utils/error-page/error-page.component.mjs +0 -74
  369. package/esm2022/lib/components/utils/icon/icon.component.mjs +0 -58
  370. package/esm2022/lib/components/utils/language-switcher/language-switcher.component.mjs +0 -50
  371. package/esm2022/lib/design-angular-kit.module.mjs +0 -233
  372. package/esm2022/lib/enums/colors.enums.mjs +0 -12
  373. package/esm2022/lib/enums/sizes.enum.mjs +0 -9
  374. package/esm2022/lib/interfaces/core.mjs +0 -16
  375. package/esm2022/lib/interfaces/design-angular-kit-config.mjs +0 -7
  376. package/esm2022/lib/interfaces/form.mjs +0 -2
  377. package/esm2022/lib/interfaces/icon.mjs +0 -168
  378. package/esm2022/lib/interfaces/sortable-table.mjs +0 -6
  379. package/esm2022/lib/interfaces/utils.mjs +0 -2
  380. package/esm2022/lib/pipes/date-ago.pipe.mjs +0 -56
  381. package/esm2022/lib/pipes/duration.pipe.mjs +0 -115
  382. package/esm2022/lib/pipes/mark-matching-text.pipe.mjs +0 -48
  383. package/esm2022/lib/provide-design-angular-kit.mjs +0 -64
  384. package/esm2022/lib/services/notification/notification.service.mjs +0 -120
  385. package/esm2022/lib/utils/coercion.mjs +0 -18
  386. package/esm2022/lib/utils/date-utils.mjs +0 -162
  387. package/esm2022/lib/utils/file-utils.mjs +0 -73
  388. package/esm2022/lib/utils/regex.mjs +0 -35
  389. package/esm2022/lib/validators/it-validators.mjs +0 -156
  390. package/esm2022/public_api.mjs +0 -110
  391. package/fesm2022/design-angular-kit.mjs +0 -6669
  392. package/fesm2022/design-angular-kit.mjs.map +0 -1
  393. package/index.d.ts +0 -5
  394. package/lib/abstracts/abstract-form.component.d.ts +0 -87
  395. package/lib/abstracts/abstract.component.d.ts +0 -30
  396. package/lib/components/core/accordion/accordion.component.d.ts +0 -18
  397. package/lib/components/core/alert/alert.component.d.ts +0 -44
  398. package/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.d.ts +0 -29
  399. package/lib/components/core/avatar/avatar-group/avatar-group.component.d.ts +0 -15
  400. package/lib/components/core/avatar/avatar.directive.d.ts +0 -33
  401. package/lib/components/core/avatar/avatar.module.d.ts +0 -9
  402. package/lib/components/core/badge/badge.directive.d.ts +0 -23
  403. package/lib/components/core/button/button.directive.d.ts +0 -48
  404. package/lib/components/core/callout/callout.component.d.ts +0 -50
  405. package/lib/components/core/card/card.component.d.ts +0 -69
  406. package/lib/components/core/carousel/carousel/carousel.component.d.ts +0 -65
  407. package/lib/components/core/carousel/carousel-item/carousel-item.component.d.ts +0 -15
  408. package/lib/components/core/carousel/carousel.module.d.ts +0 -8
  409. package/lib/components/core/chip/chip.component.d.ts +0 -76
  410. package/lib/components/core/collapse/collapse.component.d.ts +0 -67
  411. package/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.d.ts +0 -12
  412. package/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.d.ts +0 -5
  413. package/lib/components/core/dimmer/dimmer.component.d.ts +0 -24
  414. package/lib/components/core/dimmer/dimmer.module.d.ts +0 -9
  415. package/lib/components/core/dropdown/dropdown/dropdown.component.d.ts +0 -94
  416. package/lib/components/core/dropdown/dropdown-item/dropdown-item.component.d.ts +0 -42
  417. package/lib/components/core/dropdown/dropdown.module.d.ts +0 -8
  418. package/lib/components/core/forward/forward.directive.d.ts +0 -14
  419. package/lib/components/core/link/link.component.d.ts +0 -35
  420. package/lib/components/core/list/list/list.component.d.ts +0 -24
  421. package/lib/components/core/list/list-item/list-item.component.d.ts +0 -41
  422. package/lib/components/core/list/list.module.d.ts +0 -8
  423. package/lib/components/core/modal/modal.component.d.ts +0 -135
  424. package/lib/components/core/notifications/notifications.component.d.ts +0 -45
  425. package/lib/components/core/pagination/pagination.component.d.ts +0 -92
  426. package/lib/components/core/popover/popover.directive.d.ts +0 -99
  427. package/lib/components/core/progress-bar/progress-bar.component.d.ts +0 -31
  428. package/lib/components/core/progress-button/progress-button.component.d.ts +0 -21
  429. package/lib/components/core/spinner/spinner.component.d.ts +0 -24
  430. package/lib/components/core/steppers/steppers-container/steppers-container.component.d.ts +0 -130
  431. package/lib/components/core/steppers/steppers-item/steppers-item.component.d.ts +0 -20
  432. package/lib/components/core/steppers/steppers.module.d.ts +0 -8
  433. package/lib/components/core/tab/tab-container/tab-container.component.d.ts +0 -36
  434. package/lib/components/core/tab/tab-item/tab-item.component.d.ts +0 -38
  435. package/lib/components/core/tab/tab.module.d.ts +0 -8
  436. package/lib/components/core/table/sort/sort-header/sort-header.component.d.ts +0 -72
  437. package/lib/components/core/table/sort/sort.directive.d.ts +0 -53
  438. package/lib/components/core/table/table.component.d.ts +0 -60
  439. package/lib/components/core/table/table.module.d.ts +0 -9
  440. package/lib/components/core/timeline/timeline-item/timeline-item.component.d.ts +0 -79
  441. package/lib/components/core/timeline/timeline.component.d.ts +0 -21
  442. package/lib/components/core/timeline/timeline.module.d.ts +0 -8
  443. package/lib/components/core/tooltip/tooltip.directive.d.ts +0 -82
  444. package/lib/components/form/autocomplete/autocomplete.component.d.ts +0 -59
  445. package/lib/components/form/checkbox/checkbox.component.d.ts +0 -41
  446. package/lib/components/form/form.module.d.ts +0 -18
  447. package/lib/components/form/input/input.component.d.ts +0 -95
  448. package/lib/components/form/password-input/password-input.component.d.ts +0 -80
  449. package/lib/components/form/radio-button/radio-button.component.d.ts +0 -38
  450. package/lib/components/form/range/range.component.d.ts +0 -42
  451. package/lib/components/form/rating/rating.component.d.ts +0 -24
  452. package/lib/components/form/select/select.component.d.ts +0 -36
  453. package/lib/components/form/textarea/textarea.component.d.ts +0 -34
  454. package/lib/components/form/transfer/store/transfer.reducers.d.ts +0 -103
  455. package/lib/components/form/transfer/store/transfer.state.d.ts +0 -18
  456. package/lib/components/form/transfer/store/transfer.store.d.ts +0 -23
  457. package/lib/components/form/transfer/transfer-list/transfer-list.component.d.ts +0 -48
  458. package/lib/components/form/transfer/transfer.component.d.ts +0 -75
  459. package/lib/components/form/upload-drag-drop/upload-drag-drop.component.d.ts +0 -60
  460. package/lib/components/form/upload-file-list/upload-file-list.component.d.ts +0 -62
  461. package/lib/components/navigation/back-button/back-button.component.d.ts +0 -47
  462. package/lib/components/navigation/back-to-top/back-to-top.component.d.ts +0 -50
  463. package/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.d.ts +0 -28
  464. package/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +0 -23
  465. package/lib/components/navigation/breadcrumbs/breadcrumbs.module.d.ts +0 -8
  466. package/lib/components/navigation/header/header.component.d.ts +0 -36
  467. package/lib/components/navigation/megamenu/megamenu.component.d.ts +0 -22
  468. package/lib/components/navigation/navbar/navbar/navbar.component.d.ts +0 -16
  469. package/lib/components/navigation/navbar/navbar-item/navbar-item.component.d.ts +0 -5
  470. package/lib/components/navigation/navbar/navbar.module.d.ts +0 -8
  471. package/lib/components/navigation/navscroll/navscroll-list-item.component.d.ts +0 -16
  472. package/lib/components/navigation/navscroll/navscroll-list-items.component.d.ts +0 -7
  473. package/lib/components/navigation/navscroll/navscroll.component.d.ts +0 -47
  474. package/lib/components/navigation/navscroll/navscroll.store.d.ts +0 -16
  475. package/lib/components/navigation/navscroll/navscroll.utils.d.ts +0 -6
  476. package/lib/components/navigation/sidebar/sidebar.component.d.ts +0 -26
  477. package/lib/components/navigation/skiplink/skiplink/skiplink.component.d.ts +0 -17
  478. package/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.d.ts +0 -24
  479. package/lib/components/navigation/skiplink/skiplink.module.d.ts +0 -8
  480. package/lib/components/utils/error-page/error-page.component.d.ts +0 -44
  481. package/lib/components/utils/icon/icon.component.d.ts +0 -48
  482. package/lib/components/utils/language-switcher/language-switcher.component.d.ts +0 -27
  483. package/lib/design-angular-kit.module.d.ts +0 -53
  484. package/lib/enums/colors.enums.d.ts +0 -10
  485. package/lib/enums/sizes.enum.d.ts +0 -7
  486. package/lib/interfaces/design-angular-kit-config.d.ts +0 -30
  487. package/lib/interfaces/form.d.ts +0 -67
  488. package/lib/interfaces/icon.d.ts +0 -4
  489. package/lib/interfaces/sortable-table.d.ts +0 -33
  490. package/lib/interfaces/utils.d.ts +0 -10
  491. package/lib/pipes/date-ago.pipe.d.ts +0 -17
  492. package/lib/pipes/duration.pipe.d.ts +0 -35
  493. package/lib/pipes/mark-matching-text.pipe.d.ts +0 -18
  494. package/lib/provide-design-angular-kit.d.ts +0 -7
  495. package/lib/services/notification/notification.service.d.ts +0 -63
  496. package/lib/utils/date-utils.d.ts +0 -79
  497. package/lib/utils/file-utils.d.ts +0 -32
  498. package/lib/utils/regex.d.ts +0 -34
  499. package/lib/validators/it-validators.d.ts +0 -69
  500. package/schematics/ng-add/index.d.ts +0 -3
  501. package/schematics/ng-add/index.js +0 -29
  502. package/schematics/ng-add/index.js.map +0 -1
  503. package/schematics/ng-add/index.spec.d.ts +0 -1
  504. package/schematics/ng-add/index.spec.js +0 -43
  505. package/schematics/ng-add/index.spec.js.map +0 -1
  506. package/schematics/ng-add/rules/setup-project/add-animations.d.ts +0 -2
  507. package/schematics/ng-add/rules/setup-project/add-animations.js +0 -11
  508. package/schematics/ng-add/rules/setup-project/add-animations.js.map +0 -1
  509. package/schematics/ng-add/rules/setup-project/add-assets.d.ts +0 -3
  510. package/schematics/ng-add/rules/setup-project/add-assets.js +0 -50
  511. package/schematics/ng-add/rules/setup-project/add-assets.js.map +0 -1
  512. package/schematics/ng-add/rules/setup-project/add-design-angular-kit.d.ts +0 -3
  513. package/schematics/ng-add/rules/setup-project/add-design-angular-kit.js +0 -43
  514. package/schematics/ng-add/rules/setup-project/add-design-angular-kit.js.map +0 -1
  515. package/schematics/ng-add/rules/setup-project/add-http-client.d.ts +0 -2
  516. package/schematics/ng-add/rules/setup-project/add-http-client.js +0 -11
  517. package/schematics/ng-add/rules/setup-project/add-http-client.js.map +0 -1
  518. package/schematics/ng-add/rules/setup-project/add-import-to-style-file.d.ts +0 -11
  519. package/schematics/ng-add/rules/setup-project/add-import-to-style-file.js +0 -112
  520. package/schematics/ng-add/rules/setup-project/add-import-to-style-file.js.map +0 -1
  521. package/schematics/ng-add/rules/setup-project/add-localisation.d.ts +0 -3
  522. package/schematics/ng-add/rules/setup-project/add-localisation.js +0 -50
  523. package/schematics/ng-add/rules/setup-project/add-localisation.js.map +0 -1
  524. package/schematics/ng-add/rules/setup-project/angular-json-helper.d.ts +0 -2
  525. package/schematics/ng-add/rules/setup-project/angular-json-helper.js +0 -13
  526. package/schematics/ng-add/rules/setup-project/angular-json-helper.js.map +0 -1
  527. package/schematics/ng-add/rules/setup-project/exceptions.d.ts +0 -7
  528. package/schematics/ng-add/rules/setup-project/exceptions.js +0 -17
  529. package/schematics/ng-add/rules/setup-project/exceptions.js.map +0 -1
  530. package/schematics/ng-add/rules/setup-project/index.js +0 -23
  531. package/schematics/ng-add/rules/setup-project/index.js.map +0 -1
  532. package/schematics/ng-add/schema.js +0 -3
  533. package/schematics/ng-add/schema.js.map +0 -1
  534. package/schematics/ng-add/setup-project.d.ts +0 -3
  535. package/schematics/ng-add/setup-project.js +0 -37
  536. package/schematics/ng-add/setup-project.js.map +0 -1
  537. package/schematics/ng-add/setup-project.spec.d.ts +0 -1
  538. package/schematics/ng-add/setup-project.spec.js +0 -139
  539. package/schematics/ng-add/setup-project.spec.js.map +0 -1
  540. package/schematics/ng-add/utils.d.ts +0 -14
  541. package/schematics/ng-add/utils.js +0 -49
  542. package/schematics/ng-add/utils.js.map +0 -1
  543. package/schematics/ng-add/versions-helper.d.ts +0 -3
  544. package/schematics/ng-add/versions-helper.js +0 -40
  545. package/schematics/ng-add/versions-helper.js.map +0 -1
  546. /package/schematics/ng-add/rules/setup-project/{index.d.ts → index.ts} +0 -0
@@ -0,0 +1,166 @@
1
+ import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
2
+ import * as path from 'path';
3
+ import { Schema } from './schema';
4
+
5
+ const createApp = async (
6
+ runner: SchematicTestRunner,
7
+ options: Schema,
8
+ { standalone, style }: { standalone: boolean; style: 'scss' | 'css' | 'sass' }
9
+ ) => {
10
+ let tree = await runner.runExternalSchematic('@schematics/angular', 'workspace', {
11
+ name: 'workspace',
12
+ version: '18.0.0',
13
+ newProjectRoot: 'projects',
14
+ });
15
+
16
+ tree = await runner.runExternalSchematic(
17
+ '@schematics/angular',
18
+ 'application',
19
+ {
20
+ name: options.project,
21
+ standalone,
22
+ style,
23
+ },
24
+ tree
25
+ );
26
+
27
+ return { tree };
28
+ };
29
+
30
+ describe(`ng add design-angular-kit | setup-project - library providing`, () => {
31
+ const collectionPath = path.join(__dirname, '../collection.json');
32
+ const runner = new SchematicTestRunner('schematics', collectionPath);
33
+
34
+ const defaultOptions: Schema = {
35
+ project: 'test-project', // Set your default project name
36
+ };
37
+
38
+ it('should add DesignAngularKitModule to the root module - NgModule app', async () => {
39
+ const { tree: appTree } = await createApp(runner, defaultOptions, { standalone: false, style: 'scss' });
40
+ const tree = await runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
41
+
42
+ // Check if the app.module.ts file exists
43
+ const modulePath = '/projects/test-project/src/app/app.module.ts';
44
+ expect(tree.files).toContain(modulePath);
45
+
46
+ // Check if the correct import statement was added
47
+ const content = tree.readContent(modulePath);
48
+ expect(content).toContain(`import { DesignAngularKitModule } from 'design-angular-kit';`);
49
+ expect(content).toContain(`DesignAngularKitModule.forRoot()`);
50
+ });
51
+
52
+ it('should add provideDesignAngularKit() to the app config - Standalone app', async () => {
53
+ const { tree: appTree } = await createApp(runner, defaultOptions, { standalone: true, style: 'scss' });
54
+ const tree = await runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
55
+
56
+ // Check if the app.module.ts file exists
57
+ const appConfigPath = '/projects/test-project/src/app/app.config.ts';
58
+ expect(tree.files).toContain(appConfigPath);
59
+
60
+ // Check if the correct import statement was added
61
+ const content = tree.readContent(appConfigPath);
62
+ expect(content).toContain(`import { provideDesignAngularKit } from 'design-angular-kit';`);
63
+ expect(content).toContain(`provideDesignAngularKit()`);
64
+ });
65
+ });
66
+
67
+ for (const standalone of [true, false]) {
68
+ describe(`ng add design-angular-kit | setup-project for ${standalone ? 'standalone' : 'NgModule'} app - styles`, () => {
69
+ const collectionPath = path.join(__dirname, '../collection.json');
70
+ const runner = new SchematicTestRunner('schematics', collectionPath);
71
+
72
+ const defaultOptions: Schema = {
73
+ project: 'test-project', // Set your default project name
74
+ };
75
+
76
+ it('should add .scss import to project style file', async () => {
77
+ const { tree: appTree } = await createApp(runner, defaultOptions, { standalone, style: 'scss' });
78
+ const tree = await runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
79
+
80
+ // Check if the styles.scss file exists
81
+ const styleFilePath = '/projects/test-project/src/styles.scss';
82
+ expect(tree.files).toContain(styleFilePath);
83
+ // Check if the correct import statement was added
84
+ const content = tree.readContent(styleFilePath);
85
+ expect(content).toContain(`@import '../node_modules/bootstrap-italia/src/scss/bootstrap-italia.scss';`);
86
+ });
87
+
88
+ it('should add .sass import to project style file', async () => {
89
+ const { tree: appTree } = await createApp(runner, defaultOptions, { standalone, style: 'sass' });
90
+ const tree = await runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
91
+
92
+ // Check if the styles.sass file exists
93
+ const styleFilePath = '/projects/test-project/src/styles.sass';
94
+ expect(tree.files).toContain(styleFilePath);
95
+ // Check if the correct import statement was added
96
+ const content = tree.readContent(styleFilePath);
97
+ expect(content).toContain(`@import 'bootstrap-italia/scss/bootstrap-italia'`);
98
+ });
99
+
100
+ it('should add .css import to angular.json', async () => {
101
+ const { tree: appTree } = await createApp(runner, defaultOptions, { standalone, style: 'css' });
102
+ const tree = await runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
103
+
104
+ // Check if the angular.json file exists
105
+ const angularJsonPath = '/angular.json';
106
+ expect(tree.files).toContain(angularJsonPath);
107
+ // Check if the correct import statement was added
108
+ const content = tree.readContent(angularJsonPath);
109
+ expect(content).toContain(`node_modules/bootstrap-italia/dist/css/bootstrap-italia.min.css`);
110
+ });
111
+ });
112
+
113
+ describe(`ng add design-angular-kit | setup-project for ${standalone ? 'standalone' : 'NgModule'} app - assets`, () => {
114
+ const collectionPath = path.join(__dirname, '../collection.json');
115
+ const runner = new SchematicTestRunner('schematics', collectionPath);
116
+
117
+ const defaultOptions: Schema = {
118
+ project: 'test-project', // Set your default project name
119
+ };
120
+
121
+ it('should add bootstrap italia assets to angular.json', async () => {
122
+ const { tree: appTree } = await createApp(runner, defaultOptions, { standalone, style: 'css' });
123
+ const tree = await runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
124
+
125
+ // Check if the angular.json file exists
126
+ const angularJsonPath = '/angular.json';
127
+ expect(tree.files).toContain(angularJsonPath);
128
+ // Check if the correct import statement was added
129
+ const content = tree.readContent(angularJsonPath);
130
+ //"./node_modules/bootstrap-italia/"
131
+ expect(content).toContain(`./node_modules/bootstrap-italia/`);
132
+ const angularJson = JSON.parse(content);
133
+ const assetsConfig = angularJson.projects[defaultOptions.project]?.architect?.build?.options?.assets?.find(
134
+ (item: { input: string }) => item.input === `./node_modules/bootstrap-italia/`
135
+ );
136
+ expect(assetsConfig).toBeDefined(assetsConfig);
137
+ });
138
+ });
139
+
140
+ describe(`ng add design-angular-kit | setup-project for ${standalone ? 'standalone' : 'NgModule'} app - localisation`, () => {
141
+ const collectionPath = path.join(__dirname, '../collection.json');
142
+ const runner = new SchematicTestRunner('schematics', collectionPath);
143
+
144
+ const defaultOptions: Schema = {
145
+ project: 'test-project', // Set your default project name
146
+ };
147
+
148
+ it('should add bootstrap italia localisation to angular.json', async () => {
149
+ const { tree: appTree } = await createApp(runner, defaultOptions, { standalone, style: 'css' });
150
+ const tree = await runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
151
+
152
+ // Check if the angular.json file exists
153
+ const angularJsonPath = '/angular.json';
154
+ expect(tree.files).toContain(angularJsonPath);
155
+ // Check if the correct import statement was added
156
+ const content = tree.readContent(angularJsonPath);
157
+ //"./node_modules/bootstrap-italia/"
158
+ expect(content).toContain(`/node_modules/design-angular-kit/assets/i18n`);
159
+ const angularJson = JSON.parse(content);
160
+ const assetsConfig = angularJson.projects[defaultOptions.project]?.architect?.build?.options?.assets?.find(
161
+ (item: { input: string }) => item.input === `./node_modules/design-angular-kit/assets/i18n`
162
+ );
163
+ expect(assetsConfig).toBeDefined(assetsConfig);
164
+ });
165
+ });
166
+ }
@@ -0,0 +1,31 @@
1
+ import { chain, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
2
+
3
+ import { getProjectFromWorkspace } from '@angular/cdk/schematics';
4
+ import { getWorkspace } from '@schematics/angular/utility/workspace';
5
+ import { addAnimations, addAssets, addDesignAngularKit, addHttpClient, addImportToStyleFile, addLocalisation } from './rules/setup-project';
6
+ import { Schema } from './schema';
7
+
8
+ import { ProjectType } from '@schematics/angular/utility/workspace-models';
9
+
10
+ export default function (options: Schema): Rule {
11
+ return async (host: Tree, context: SchematicContext) => {
12
+ const workspace = await getWorkspace(host);
13
+ const project = getProjectFromWorkspace(workspace, options.project);
14
+ const isAProject = project.extensions['projectType'] === ProjectType.Application;
15
+
16
+ if (isAProject) {
17
+ return chain([
18
+ addAnimations(),
19
+ addHttpClient(),
20
+ addDesignAngularKit(options),
21
+ addImportToStyleFile(options),
22
+ addAssets(options),
23
+ addLocalisation(options),
24
+ ]);
25
+ }
26
+ context.logger.warn(
27
+ `Design Angular Kit has been set in your workspace. No additional setup required.\nIf you intend to run the schematics on a specific project, please use -- project option `
28
+ );
29
+ return;
30
+ };
31
+ }
@@ -0,0 +1,71 @@
1
+ import { Tree } from '@angular-devkit/schematics';
2
+
3
+ interface PackageJson {
4
+ dependencies: Record<string, string>;
5
+ }
6
+
7
+ interface SemVerObject {
8
+ semVer?: string;
9
+ major?: string;
10
+ minor?: string;
11
+ patch?: string;
12
+ prerelease?: string;
13
+ buildmetadata?: string;
14
+ }
15
+
16
+ const SEMVER_WITH_PREFIX_REGEX =
17
+ /^[\^~]?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
18
+
19
+ function sortObjectByKeys(obj: Record<string, string>) {
20
+ return Object.keys(obj)
21
+ .sort()
22
+ .reduce(
23
+ (result, key) => {
24
+ result[key] = obj[key];
25
+ return result;
26
+ },
27
+ {} as Record<string, string>
28
+ );
29
+ }
30
+
31
+ /** Get a SemVerObject given a semver string */
32
+ export function toSemVerObject(versionString: string) {
33
+ const [semVer, major, minor, patch, prerelease, buildmetadata] = versionString.match(SEMVER_WITH_PREFIX_REGEX) ?? [];
34
+ return { semVer, major, minor, patch, prerelease, buildmetadata } satisfies SemVerObject;
35
+ }
36
+
37
+ /** Adds a package to the package.json in the given host tree. */
38
+ export function addPackageToPackageJson(host: Tree, pkg: string, version: string): Tree {
39
+ if (host.exists('package.json')) {
40
+ const sourceText = host.read('package.json')!.toString('utf-8');
41
+ const json = JSON.parse(sourceText) as PackageJson;
42
+
43
+ if (!json.dependencies) {
44
+ json.dependencies = {};
45
+ }
46
+
47
+ if (!json.dependencies[pkg]) {
48
+ json.dependencies[pkg] = version;
49
+ json.dependencies = sortObjectByKeys(json.dependencies);
50
+ }
51
+
52
+ host.overwrite('package.json', JSON.stringify(json, null, 2));
53
+ }
54
+
55
+ return host;
56
+ }
57
+
58
+ /** Gets the version of the specified package by looking at the package.json in the given tree. */
59
+ export function getPackageVersionFromPackageJson(tree: Tree, name: string): string | null {
60
+ if (!tree.exists('package.json')) {
61
+ return null;
62
+ }
63
+
64
+ const packageJson = JSON.parse(tree.read('package.json')!.toString('utf8')) as PackageJson;
65
+
66
+ if (packageJson.dependencies && packageJson.dependencies[name]) {
67
+ return packageJson.dependencies[name];
68
+ }
69
+
70
+ return null;
71
+ }
@@ -0,0 +1,41 @@
1
+ const ANGULAR_VERSIONS = {
2
+ v17: '17',
3
+ v18: '18',
4
+ };
5
+
6
+ const KIT_VERSION_1_0_0 = '1.0.0';
7
+ const KIT_VERSION_1_1_0 = '1.1.0';
8
+ const DEFAULT = 'DEFAULT';
9
+ const LATEST = 'LATEST';
10
+
11
+ const versionsMap: Record<string, string> = {
12
+ [DEFAULT]: KIT_VERSION_1_0_0,
13
+ [ANGULAR_VERSIONS.v17]: KIT_VERSION_1_0_0,
14
+ [ANGULAR_VERSIONS.v18]: KIT_VERSION_1_1_0,
15
+ [LATEST]: KIT_VERSION_1_1_0,
16
+ };
17
+
18
+ // Get Design Angular Kit package version given Angular major version
19
+ export function getPackageVersion({ angularMajorVersion }: { angularMajorVersion: string }) {
20
+ if (isNaN(+angularMajorVersion)) {
21
+ throw new Error('Major version is not a number');
22
+ }
23
+
24
+ let version = versionsMap[DEFAULT];
25
+
26
+ switch (angularMajorVersion) {
27
+ case ANGULAR_VERSIONS.v17:
28
+ version = versionsMap[ANGULAR_VERSIONS.v17];
29
+ break;
30
+ case ANGULAR_VERSIONS.v18:
31
+ version = versionsMap[ANGULAR_VERSIONS.v18];
32
+ break;
33
+ default: {
34
+ if (Number(angularMajorVersion) > Number(ANGULAR_VERSIONS.v18)) {
35
+ version = versionsMap[LATEST];
36
+ }
37
+ }
38
+ }
39
+
40
+ return version;
41
+ }
@@ -0,0 +1,200 @@
1
+ import { ControlValueAccessor, FormControl, NgControl, ValidatorFn } from '@angular/forms';
2
+ import { Component, DoCheck, Input, OnInit, Optional, Self } from '@angular/core';
3
+ import { ItAbstractComponent } from './abstract.component';
4
+ import { Observable } from 'rxjs';
5
+ import { TranslateService } from '@ngx-translate/core';
6
+ import { inputToBoolean } from '../utils/coercion';
7
+
8
+ @Component({ template: '' })
9
+ export abstract class ItAbstractFormComponent<T = any> extends ItAbstractComponent implements OnInit, ControlValueAccessor, DoCheck {
10
+ /**
11
+ * The label of form control
12
+ */
13
+ @Input() label?: string;
14
+
15
+ /**
16
+ * Validation color display mode (validation triggered if field is touched or not pristine)
17
+ * - <b>true</b>: Always show the validation color
18
+ * - <b>false</b>: Never show validation color
19
+ * - <b>only-valid</b>: Show only valid validation color
20
+ * - <b>only-invalid</b>: Show only invalid validation color
21
+ * @default <b>true</b>: Always show the validation color
22
+ */
23
+ @Input() validationMode: boolean | 'only-valid' | 'only-invalid' = true;
24
+
25
+ /**
26
+ * Set the disabled state
27
+ */
28
+ @Input({ transform: inputToBoolean }) set disabled(isDisabled: boolean) {
29
+ this.setDisabledState(isDisabled);
30
+ }
31
+
32
+ /**
33
+ * Internal form control
34
+ */
35
+ protected control: FormControl<T>;
36
+
37
+ constructor(
38
+ protected readonly _translateService: TranslateService,
39
+ @Self() @Optional() protected readonly _ngControl: NgControl
40
+ ) {
41
+ super();
42
+ this.control = new FormControl();
43
+ this._ngControl && (this._ngControl.valueAccessor = this);
44
+ }
45
+
46
+ /**
47
+ * Check if field is invalid (Validation failed)
48
+ */
49
+ get isInvalid(): boolean | undefined {
50
+ if (this.validationMode === 'only-valid' || (this.validationMode !== 'only-invalid' && !this.validationMode)) {
51
+ return undefined;
52
+ }
53
+
54
+ if (this._ngControl) {
55
+ return this._ngControl.invalid === true && (!this._ngControl.pristine || this._ngControl.touched === true);
56
+ }
57
+ return this.control.invalid && (!this.control.pristine || this.control.touched);
58
+ }
59
+
60
+ /**
61
+ * Check if field is valid (Validation successful)
62
+ */
63
+ get isValid(): boolean | undefined {
64
+ if (this.validationMode === 'only-invalid' || (this.validationMode !== 'only-valid' && !this.validationMode)) {
65
+ return undefined;
66
+ }
67
+
68
+ if (this._ngControl) {
69
+ return this._ngControl.valid === true && (!this._ngControl.pristine || this._ngControl.touched === true);
70
+ }
71
+ return this.control.valid && (!this.control.pristine || this.control.touched);
72
+ }
73
+
74
+ /**
75
+ * Return the invalid message string from TranslateService
76
+ */
77
+ get invalidMessage(): Observable<string> {
78
+ if (this.hasError('required')) {
79
+ return this._translateService.get('it.errors.required-field');
80
+ }
81
+
82
+ return this._translateService.get('it.errors.invalid-field');
83
+ }
84
+
85
+ ngOnInit(): void {
86
+ if (this._ngControl?.control) {
87
+ this.control.setValidators((this._ngControl.control as FormControl).validator);
88
+ }
89
+ }
90
+
91
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
92
+ onChange = (_: T) => {};
93
+
94
+ onTouched = () => {};
95
+
96
+ registerOnChange(fn: any): void {
97
+ this.control.valueChanges.subscribe(fn);
98
+ this.onChange = fn;
99
+ }
100
+
101
+ registerOnTouched(fn: any): void {
102
+ this.onTouched = fn;
103
+ }
104
+
105
+ setDisabledState(isDisabled: boolean): void {
106
+ if (isDisabled) {
107
+ return this.control.disable();
108
+ }
109
+ this.control.enable();
110
+ }
111
+
112
+ writeValue(value: T): void {
113
+ this.control.setValue(value, { emitEvent: false });
114
+ this._changeDetectorRef.detectChanges();
115
+ }
116
+
117
+ /**
118
+ * Mark the control as touched
119
+ */
120
+ markAsTouched(): void {
121
+ if (!this.control.touched) {
122
+ this.onTouched();
123
+ }
124
+ }
125
+
126
+ /**
127
+ * Fired to check if form control is touched
128
+ */
129
+ ngDoCheck() {
130
+ if (this._ngControl?.control) {
131
+ const ngControl = this._ngControl.control;
132
+ if (this.control.touched !== ngControl.touched) {
133
+ if (ngControl.touched) {
134
+ this.control.markAsTouched();
135
+ } else {
136
+ this.control.markAsUntouched();
137
+ }
138
+ }
139
+ if (this.control.pristine !== ngControl.pristine) {
140
+ if (ngControl.pristine) {
141
+ this.control.markAsPristine();
142
+ } else {
143
+ this.control.markAsDirty();
144
+ }
145
+ }
146
+ }
147
+ this._changeDetectorRef.detectChanges();
148
+ }
149
+
150
+ /**
151
+ * Add the validators in control and parent control
152
+ * @param validators the validators
153
+ * @protected
154
+ */
155
+ protected addValidators(validators: ValidatorFn | ValidatorFn[]): void {
156
+ if (!Array.isArray(validators)) {
157
+ validators = [validators];
158
+ }
159
+
160
+ validators.forEach(validator => {
161
+ if (!this.control.hasValidator(validator)) {
162
+ this.control.addValidators(validator);
163
+ }
164
+
165
+ if (this._ngControl?.control && !this._ngControl.control.hasValidator(validator)) {
166
+ this._ngControl.control.addValidators(validator);
167
+ }
168
+ });
169
+ }
170
+
171
+ /**
172
+ * Reports whether the control with the given path has the error specified. <br/>
173
+ * If the control is not present, false is returned.
174
+ * @param errorCode The code of the error to check
175
+ * @param path A list of control names that designates how to move from the current control
176
+ * to the control that should be queried for errors.
177
+ * @returns whether the given error is present in the control at the given path.
178
+ */
179
+ public hasError(errorCode: string, path?: Array<string | number> | string): boolean {
180
+ if (this._ngControl) {
181
+ return this._ngControl.hasError(errorCode, path);
182
+ }
183
+ return this.control.hasError(errorCode, path);
184
+ }
185
+
186
+ /**
187
+ * Reports error data for the control with the given path.
188
+ * @param errorCode The code of the error to check
189
+ * @param path A list of control names that designates how to move from the current control
190
+ * to the control that should be queried for errors.
191
+ * @returns error data for that particular error. If the control or error is not present,
192
+ * null is returned.
193
+ */
194
+ public getError(errorCode: string, path?: Array<string | number> | string): any {
195
+ if (this._ngControl) {
196
+ return this._ngControl.getError(errorCode, path);
197
+ }
198
+ return this.control.getError(errorCode, path);
199
+ }
200
+ }
@@ -0,0 +1,63 @@
1
+ import {
2
+ AfterViewInit,
3
+ ChangeDetectorRef,
4
+ Component,
5
+ ElementRef,
6
+ EventEmitter,
7
+ inject,
8
+ Input,
9
+ OnChanges,
10
+ Output,
11
+ Renderer2,
12
+ SimpleChanges,
13
+ } from '@angular/core';
14
+
15
+ @Component({ template: '' })
16
+ export abstract class ItAbstractComponent implements AfterViewInit, OnChanges {
17
+ /**
18
+ * The element ID
19
+ */
20
+ @Input() id: string = this.getDefaultId();
21
+
22
+ /**
23
+ * Fired when component input attributes was changed
24
+ */
25
+ @Output() public valueChanges: EventEmitter<void>;
26
+
27
+ /**
28
+ * Counter of active instances
29
+ * @private
30
+ */
31
+ private static instances = 0;
32
+
33
+ protected readonly _renderer: Renderer2; // Injected
34
+ protected readonly _elementRef: ElementRef; // Injected
35
+ protected readonly _changeDetectorRef: ChangeDetectorRef; // Injected
36
+
37
+ constructor() {
38
+ this._renderer = inject(Renderer2);
39
+ this._elementRef = inject(ElementRef);
40
+ this._changeDetectorRef = inject(ChangeDetectorRef);
41
+
42
+ this.valueChanges = new EventEmitter<void>();
43
+ }
44
+
45
+ ngAfterViewInit(): void {
46
+ this._renderer.removeAttribute(this._elementRef.nativeElement, 'id');
47
+ }
48
+
49
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
50
+ ngOnChanges(changes: SimpleChanges): void {
51
+ this.valueChanges.next(); // The inputs were changed
52
+ }
53
+
54
+ /**
55
+ * Generate unique id for components
56
+ * @private
57
+ */
58
+ private getDefaultId(): string {
59
+ const name = this.constructor.name.replace('Component', '');
60
+ const kebabName = name.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase());
61
+ return `${kebabName}-${ItAbstractComponent.instances++}`;
62
+ }
63
+ }
@@ -0,0 +1,27 @@
1
+ <div class="accordion">
2
+ <div class="accordion-item">
3
+ <h2 class="accordion-header" id="collapse-{{ id }}-heading">
4
+ <button
5
+ class="accordion-button"
6
+ type="button"
7
+ data-bs-toggle="collapse"
8
+ [class.collapsed]="isCollapsed"
9
+ [attr.data-bs-target]="'#collapse-' + id"
10
+ [attr.aria-controls]="'collapse-' + id"
11
+ [attr.aria-expanded]="opened ? 'true' : 'false'">
12
+ {{ title }}
13
+ </button>
14
+ </h2>
15
+
16
+ <div
17
+ #collapse
18
+ id="collapse-{{ id }}"
19
+ role="region"
20
+ class="accordion-collapse collapse {{ class }}"
21
+ [attr.aria-labelledby]="'collapse-' + id + '-heading'">
22
+ <div class="accordion-body">
23
+ <ng-content></ng-content>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </div>
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ItAccordionComponent } from './accordion.component';
4
+ import { tb_base } from '../../../../test';
5
+
6
+ describe('ItAccordionComponent', () => {
7
+ let component: ItAccordionComponent;
8
+ let fixture: ComponentFixture<ItAccordionComponent>;
9
+
10
+ beforeEach(async () => {
11
+ await TestBed.configureTestingModule(tb_base).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(ItAccordionComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,40 @@
1
+ import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, ViewChild } from '@angular/core';
2
+ import { ItCollapseComponent } from '../collapse/collapse.component';
3
+
4
+ /**
5
+ * Accordion
6
+ * @description Build vertically collapsible accordions based on Collapse.
7
+ */
8
+ @Component({
9
+ standalone: true,
10
+ selector: 'it-accordion',
11
+ templateUrl: './accordion.component.html',
12
+ exportAs: 'itAccordion',
13
+ changeDetection: ChangeDetectionStrategy.OnPush,
14
+ imports: [],
15
+ })
16
+ export class ItAccordionComponent extends ItCollapseComponent implements AfterViewInit {
17
+ /**
18
+ * Accordion Title
19
+ */
20
+ @Input({ required: true }) title!: string;
21
+
22
+ @ViewChild('collapse') protected override collapseDiv?: ElementRef<HTMLDivElement>;
23
+
24
+ protected isCollapsed: boolean = true;
25
+
26
+ override ngAfterViewInit(): void {
27
+ super.ngAfterViewInit();
28
+ this._renderer.removeAttribute(this._elementRef.nativeElement, 'title');
29
+
30
+ this.isCollapsed = !this.opened;
31
+ this.hideEvent.subscribe(() => {
32
+ this.isCollapsed = true;
33
+ this._changeDetectorRef.detectChanges();
34
+ });
35
+ this.showEvent.subscribe(() => {
36
+ this.isCollapsed = false;
37
+ this._changeDetectorRef.detectChanges();
38
+ });
39
+ }
40
+ }
@@ -0,0 +1,19 @@
1
+ <div
2
+ #alertElement
3
+ class="alert alert-{{ color }}"
4
+ [class.alert-dismissible]="dismissible"
5
+ [class.fade]="dismissible"
6
+ [class.show]="dismissible"
7
+ role="alert">
8
+ <h4 class="alert-heading">
9
+ <ng-content select="[heading]"></ng-content>
10
+ </h4>
11
+
12
+ <ng-content></ng-content>
13
+
14
+ @if (dismissible) {
15
+ <button type="button" class="btn-close" data-bs-dismiss="alert" [attr.aria-label]="'it.core.close-alert' | translate">
16
+ <it-icon name="close"></it-icon>
17
+ </button>
18
+ }
19
+ </div>
@@ -0,0 +1,3 @@
1
+ .alert-heading:empty {
2
+ display: none;
3
+ }