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,57 @@
1
+ import { Pipe, PipeTransform } from '@angular/core';
2
+ import { TranslatePipe } from '@ngx-translate/core';
3
+
4
+ type DateAgoPipeInterval = 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second';
5
+
6
+ /**
7
+ * Indicates in a textual way how much time has passed since the indicated date
8
+ * @example 2 hours ago
9
+ */
10
+ @Pipe({
11
+ name: 'itDateAgo',
12
+ pure: false,
13
+ standalone: true,
14
+ })
15
+ export class ItDateAgoPipe extends TranslatePipe implements PipeTransform {
16
+ /**
17
+ * Indicates in a textual way how much time has passed since the indicated date
18
+ * @example 2 hours ago
19
+ * @param value the Date or date string
20
+ */
21
+ override transform(value: string | Date): string {
22
+ if (!value) {
23
+ return '';
24
+ }
25
+
26
+ const seconds = Math.floor((+new Date() - +new Date(value)) / 1000);
27
+ if (isNaN(seconds)) {
28
+ return '';
29
+ }
30
+
31
+ // less than 30 seconds ago will show as 'Just now'
32
+ if (seconds < 29) {
33
+ return super.transform('it.date-ago-pipe.just-now');
34
+ }
35
+
36
+ const intervals = new Map<DateAgoPipeInterval, number>([
37
+ ['year', 31536000],
38
+ ['month', 2592000],
39
+ ['week', 604800],
40
+ ['day', 86400],
41
+ ['hour', 3600],
42
+ ['minute', 60],
43
+ ['second', 1],
44
+ ]);
45
+
46
+ for (const interval of intervals) {
47
+ const counter = Math.floor(seconds / interval[1]);
48
+ if (counter > 0) {
49
+ return super.transform(`it.date-ago-pipe.${counter === 1 ? 'singular-' : ''}${interval[0]}-ago`, {
50
+ count: counter,
51
+ });
52
+ }
53
+ }
54
+
55
+ return '';
56
+ }
57
+ }
@@ -0,0 +1,112 @@
1
+ import { Pipe, PipeTransform } from '@angular/core';
2
+ import { TranslatePipe } from '@ngx-translate/core';
3
+
4
+ export type ItDurationPipeType = 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second';
5
+
6
+ /**
7
+ * Transform a number into a duration.
8
+ * Is necessary indicate the value expressed by the number, for example 'day'.
9
+ * @example
10
+ * - 1, 'day' -> 1 day
11
+ * - 5, 'day' -> 5 days
12
+ * - 7, 'day' -> 1 week
13
+ * - 365, 'day' -> 1 year
14
+ * - 2, 'week' -> 2 weeks
15
+ * ...
16
+ */
17
+ @Pipe({
18
+ name: 'itDuration',
19
+ standalone: true,
20
+ })
21
+ export class ItDurationPipe extends TranslatePipe implements PipeTransform {
22
+ /**
23
+ * Transform a number into a duration.
24
+ * Is necessary indicate the value expressed by the number, for example 'day'.
25
+ * @example
26
+ * - 1, 'day' -> 1 day
27
+ * - 5, 'day' -> 5 days
28
+ * - 7, 'day' -> 1 week
29
+ * - 8, 'day' -> 1 week
30
+ * - 365, 'day' -> 1 year
31
+ * - 2, 'week' -> 2 weeks
32
+ * - 24, 'month' -> 1 year
33
+ * ...
34
+ * @param value the number
35
+ * @param type the number expressed type
36
+ */
37
+ override transform(value: string | number | undefined, type: ItDurationPipeType): string {
38
+ let valueAdjust = Number(value);
39
+ if (isNaN(valueAdjust)) {
40
+ return '';
41
+ }
42
+
43
+ switch (type) {
44
+ // eslint-disable-next-line no-fallthrough,@typescript-eslint/ban-ts-comment
45
+ // @ts-ignore
46
+ case 'second':
47
+ if (valueAdjust < 60) {
48
+ return super.transform(`it.duration.${type}${valueAdjust === 1 ? '' : 's'}`, {
49
+ count: valueAdjust,
50
+ });
51
+ }
52
+ valueAdjust = Math.round(valueAdjust / 60);
53
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
54
+ // @ts-ignore
55
+ // eslint-disable-next-line no-fallthrough
56
+ case 'minute':
57
+ if (valueAdjust < 60) {
58
+ return super.transform(`it.duration.${type}${valueAdjust === 1 ? '' : 's'}`, {
59
+ count: valueAdjust,
60
+ });
61
+ }
62
+ valueAdjust = Math.round(valueAdjust / 60);
63
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
64
+ // @ts-ignore
65
+ // eslint-disable-next-line no-fallthrough
66
+ case 'hour':
67
+ if (valueAdjust < 24) {
68
+ return super.transform(`it.duration.${type}${valueAdjust === 1 ? '' : 's'}`, {
69
+ count: valueAdjust,
70
+ });
71
+ }
72
+ valueAdjust = Math.round(valueAdjust / 24);
73
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
74
+ // @ts-ignore
75
+ // eslint-disable-next-line no-fallthrough
76
+ case 'day':
77
+ if (valueAdjust < 7) {
78
+ return super.transform(`it.duration.${type}${valueAdjust === 1 ? '' : 's'}`, {
79
+ count: valueAdjust,
80
+ });
81
+ }
82
+ valueAdjust = Math.round(valueAdjust / 7);
83
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
84
+ // @ts-ignore
85
+ // eslint-disable-next-line no-fallthrough
86
+ case 'week':
87
+ if (valueAdjust < 5) {
88
+ return super.transform(`it.duration.${type}${valueAdjust === 1 ? '' : 's'}`, {
89
+ count: valueAdjust,
90
+ });
91
+ }
92
+ valueAdjust = Math.round(valueAdjust / 5);
93
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
94
+ // @ts-ignore
95
+ // eslint-disable-next-line no-fallthrough
96
+ case 'month':
97
+ if (valueAdjust < 24) {
98
+ return super.transform(`it.duration.${type}${valueAdjust === 1 ? '' : 's'}`, {
99
+ count: valueAdjust,
100
+ });
101
+ }
102
+ valueAdjust = Math.round(valueAdjust / 24);
103
+ // eslint-disable-next-line no-fallthrough
104
+ case 'year':
105
+ return super.transform(`it.duration.${type}${valueAdjust === 1 ? '' : 's'}`, {
106
+ count: valueAdjust,
107
+ });
108
+ default:
109
+ return '';
110
+ }
111
+ }
112
+ }
@@ -0,0 +1,43 @@
1
+ import { Pipe, PipeTransform } from '@angular/core';
2
+ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
3
+
4
+ /**
5
+ * Allows you to highlight text with the <mark> tag
6
+ */
7
+ @Pipe({
8
+ standalone: true,
9
+ name: 'itMarkMatchingText',
10
+ })
11
+ export class ItMarkMatchingTextPipe implements PipeTransform {
12
+ constructor(private readonly domSanitizer: DomSanitizer) {}
13
+
14
+ /**
15
+ * Allows you to highlight text with the <mark> tag
16
+ * @param allString the full text to search from
17
+ * @param searchString the string to search
18
+ */
19
+ transform(allString: string | undefined, searchString: string | number | null | undefined): SafeHtml | string | undefined {
20
+ if (!searchString) {
21
+ return allString;
22
+ } else if (!allString) {
23
+ return '';
24
+ }
25
+
26
+ if (typeof searchString === 'number') {
27
+ searchString = searchString.toString();
28
+ }
29
+
30
+ // Check if search string is a substring of pivot string (no case-sensitive)
31
+ const idxOfMatchString = allString.toLowerCase().indexOf(searchString.toLowerCase());
32
+ if (idxOfMatchString !== -1) {
33
+ // retrieve the exactly substring
34
+ const matchingString = allString.substring(idxOfMatchString, idxOfMatchString + searchString.length);
35
+ // Replace original string marking as <strong> (bold) the matchinng substring
36
+ const regEx = new RegExp('(' + matchingString + ')', 'gi');
37
+ const res = allString.replace(regEx, '<mark>$1</mark>');
38
+ return this.domSanitizer.bypassSecurityTrustHtml(res);
39
+ }
40
+
41
+ return allString;
42
+ }
43
+ }
@@ -0,0 +1,73 @@
1
+ import { HttpClient, provideHttpClient } from '@angular/common/http';
2
+ import { APP_INITIALIZER, EnvironmentProviders, importProvidersFrom, makeEnvironmentProviders, Provider } from '@angular/core';
3
+ import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
4
+ import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
5
+ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
6
+ import { loadFonts } from 'bootstrap-italia';
7
+ import { DesignAngularKitConfig, IT_ASSET_BASE_PATH } from './interfaces/design-angular-kit-config';
8
+
9
+ /**
10
+ * Configures DesignAngularKit library
11
+ * @param config the DesignAngularKit config
12
+ */
13
+ export function provideDesignAngularKit(config?: DesignAngularKitConfig): EnvironmentProviders {
14
+ let assetBasePath = './bootstrap-italia';
15
+ if (config?.assetBasePath) {
16
+ assetBasePath = config.assetBasePath.endsWith('/')
17
+ ? config.assetBasePath.substring(0, config.assetBasePath.lastIndexOf('/'))
18
+ : config.assetBasePath;
19
+ }
20
+
21
+ const providers: Array<EnvironmentProviders | Provider> = [
22
+ {
23
+ provide: IT_ASSET_BASE_PATH,
24
+ useValue: assetBasePath,
25
+ },
26
+ provideAnimationsAsync(),
27
+ provideHttpClient(),
28
+ ];
29
+
30
+ if (config?.loadFont !== false) {
31
+ // Add provider to initialize the bootstrap-italia font
32
+ providers.push({
33
+ provide: APP_INITIALIZER,
34
+ useFactory: () => {
35
+ return () => {
36
+ loadFonts(`${assetBasePath}/dist/fonts`);
37
+ };
38
+ },
39
+ multi: true,
40
+ });
41
+ }
42
+
43
+ // Add provider to initialize the TranslateModule
44
+ const langPrefix = `${assetBasePath}/i18n/`;
45
+ const langSuffix = `.json`; // TODO: add ?v${version} to prevent cache loading on version change
46
+ providers.push(
47
+ importProvidersFrom(
48
+ TranslateModule.forRoot({
49
+ loader: config?.translateLoader?.(langPrefix, langSuffix) ?? {
50
+ provide: TranslateLoader,
51
+ useFactory: (http: HttpClient) => new TranslateHttpLoader(http, langPrefix, langSuffix),
52
+ deps: [HttpClient],
53
+ },
54
+ defaultLanguage: 'it',
55
+ useDefaultLang: true,
56
+ })
57
+ )
58
+ );
59
+
60
+ // Add provider to initialize library default languages
61
+ providers.push({
62
+ provide: APP_INITIALIZER,
63
+ useFactory: (translateService: TranslateService) => {
64
+ return () => {
65
+ translateService.addLangs(['it', 'en']); // Adds 'it' and 'en' as available languages.
66
+ };
67
+ },
68
+ multi: true,
69
+ deps: [TranslateService],
70
+ });
71
+
72
+ return makeEnvironmentProviders(providers);
73
+ }
@@ -0,0 +1,16 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { ItNotificationService } from './notification.service';
4
+
5
+ describe('ItNotificationService', () => {
6
+ let service: ItNotificationService;
7
+
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({});
10
+ service = TestBed.inject(ItNotificationService);
11
+ });
12
+
13
+ it('should be created', () => {
14
+ expect(service).toBeTruthy();
15
+ });
16
+ });
@@ -0,0 +1,119 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { filter, Observable, Subject } from 'rxjs';
3
+ import { Notification, NotificationPosition, NotificationType } from '../../interfaces/core';
4
+
5
+ @Injectable({ providedIn: 'root' })
6
+ export class ItNotificationService {
7
+ private subject = new Subject<Notification>();
8
+
9
+ /**
10
+ * Listen on notification arrived
11
+ * @param filterType filter type of notification
12
+ */
13
+ public onNotification(filterType?: NotificationType): Observable<Notification> {
14
+ return this.subject.asObservable().pipe(filter(n => n && (!filterType || n.type === filterType)));
15
+ }
16
+
17
+ /**
18
+ * Show new notification
19
+ * @param notification notification
20
+ */
21
+ public addNotification(notification: Notification): void {
22
+ this.subject.next(notification);
23
+ }
24
+
25
+ /**
26
+ * Create new Standard notification
27
+ * @param title notification title
28
+ * @param message notification message
29
+ * @param dismissible notification dismissible
30
+ * @param duration notification duration (milliseconds)
31
+ * @param position notification position
32
+ */
33
+ public standard(title: string, message?: string, dismissible?: boolean, duration?: number, position?: NotificationPosition): void {
34
+ this.addNotification({
35
+ type: NotificationType.Standard,
36
+ message,
37
+ title,
38
+ duration,
39
+ dismissible,
40
+ position,
41
+ });
42
+ }
43
+
44
+ /**
45
+ * Create new Success notification
46
+ * @param title notification title
47
+ * @param message notification message
48
+ * @param dismissible notification dismissible
49
+ * @param duration notification duration (milliseconds)
50
+ * @param position notification position
51
+ */
52
+ public success(title: string, message?: string, dismissible?: boolean, duration?: number, position?: NotificationPosition): void {
53
+ this.addNotification({
54
+ type: NotificationType.Success,
55
+ message,
56
+ title,
57
+ duration,
58
+ dismissible,
59
+ position,
60
+ });
61
+ }
62
+
63
+ /**
64
+ * Create new Error notification
65
+ * @param title notification title
66
+ * @param message notification message
67
+ * @param dismissible notification dismissible
68
+ * @param duration notification duration (milliseconds)
69
+ * @param position notification position
70
+ */
71
+ public error(title: string, message?: string, dismissible?: boolean, duration?: number, position?: NotificationPosition): void {
72
+ this.addNotification({
73
+ type: NotificationType.Error,
74
+ message,
75
+ title,
76
+ duration,
77
+ dismissible,
78
+ position,
79
+ });
80
+ }
81
+
82
+ /**
83
+ * Create new Warning notification
84
+ * @param title notification title
85
+ * @param message notification message
86
+ * @param dismissible notification dismissible
87
+ * @param duration notification duration (milliseconds)
88
+ * @param position notification position
89
+ */
90
+ public warning(title: string, message?: string, dismissible?: boolean, duration?: number, position?: NotificationPosition): void {
91
+ this.addNotification({
92
+ type: NotificationType.Warning,
93
+ message,
94
+ title,
95
+ duration,
96
+ dismissible,
97
+ position,
98
+ });
99
+ }
100
+
101
+ /**
102
+ * Create new Info notification
103
+ * @param title notification title
104
+ * @param message notification message
105
+ * @param dismissible notification dismissible
106
+ * @param duration notification duration (milliseconds)
107
+ * @param position notification position
108
+ */
109
+ public info(title: string, message?: string, dismissible?: boolean, duration?: number, position?: NotificationPosition): void {
110
+ this.addNotification({
111
+ type: NotificationType.Info,
112
+ message,
113
+ title,
114
+ duration,
115
+ dismissible,
116
+ position,
117
+ });
118
+ }
119
+ }
@@ -1,4 +1,7 @@
1
+ import { booleanAttribute } from '@angular/core';
2
+
1
3
  export type BooleanInput = 'false' | 'true' | boolean | undefined;
4
+
2
5
  /**
3
6
  * Transforms a value (typically a string) to a boolean.
4
7
  * Intended to be used as a transform function of an input.
@@ -11,4 +14,7 @@ export type BooleanInput = 'false' | 'true' | boolean | undefined;
11
14
  *
12
15
  * @publicApi
13
16
  */
14
- export declare function inputToBoolean(value: BooleanInput): boolean;
17
+ export function inputToBoolean(value: BooleanInput): boolean {
18
+ // Wrap `@angular/core` function to force value type, for ide hits
19
+ return booleanAttribute(value);
20
+ }
@@ -0,0 +1,184 @@
1
+ import { Observable, shareReplay, takeWhile, timer } from 'rxjs';
2
+ import { map } from 'rxjs/operators';
3
+
4
+ export class ItDateUtils {
5
+ /**
6
+ * Add seconds to date
7
+ * @param date the date
8
+ * @param seconds seconds to add
9
+ */
10
+ public static addSeconds(date: Date, seconds: number): Date {
11
+ const newDate = new Date(date.valueOf());
12
+ newDate.setSeconds(date.getSeconds() + seconds);
13
+ return newDate;
14
+ }
15
+
16
+ /**
17
+ * Add minutes to date
18
+ * @param date the date
19
+ * @param minutes minutes to add
20
+ */
21
+ public static addMinutes(date: Date, minutes: number): Date {
22
+ const newDate = new Date(date.valueOf());
23
+ newDate.setMinutes(date.getMinutes() + minutes);
24
+ return newDate;
25
+ }
26
+
27
+ /**
28
+ * Add hours to date
29
+ * @param date the date
30
+ * @param hours hours to add
31
+ */
32
+ public static addHours(date: Date, hours: number): Date {
33
+ const newDate = new Date(date.valueOf());
34
+ newDate.setHours(date.getHours() + hours);
35
+ return newDate;
36
+ }
37
+
38
+ /**
39
+ * Add days to date
40
+ * @param date the date
41
+ * @param days days to add
42
+ */
43
+ public static addDays(date: Date, days: number): Date {
44
+ const newDate = new Date(date.valueOf());
45
+ newDate.setDate(date.getDate() + days);
46
+ return newDate;
47
+ }
48
+
49
+ /**
50
+ * Add years to date
51
+ * @param date the date
52
+ * @param months months to add
53
+ */
54
+ public static addMonths(date: Date, months: number): Date {
55
+ const newDate = new Date(date.valueOf());
56
+ newDate.setMonth(date.getMonth() + months);
57
+ return newDate;
58
+ }
59
+
60
+ /**
61
+ * Add years to date
62
+ * @param date the date
63
+ * @param years years to add
64
+ */
65
+ public static addYears(date: Date, years: number): Date {
66
+ const newDate = new Date(date.valueOf());
67
+ newDate.setFullYear(date.getFullYear() + years);
68
+ return newDate;
69
+ }
70
+
71
+ /**
72
+ * Calculate number of days between two date
73
+ * @param startDate
74
+ * @param endDate
75
+ * @param absolute return unsigned result
76
+ */
77
+ public static countDays(startDate: Date, endDate: Date, absolute: boolean = false): number {
78
+ const differenceInTime = endDate.getTime() - startDate.getTime();
79
+ const diff = absolute ? Math.abs(differenceInTime) : differenceInTime;
80
+ return Math.ceil(diff / (1000 * 3600 * 24));
81
+ }
82
+
83
+ /**
84
+ * Check if string is a date with iso format
85
+ * @param value the string
86
+ */
87
+ public static isIsoString(value: string | null): boolean {
88
+ if (!value || !/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(value)) {
89
+ return false;
90
+ }
91
+ const d = new Date(value);
92
+ return !!d && !isNaN(d.getTime()) && d.toISOString() === value;
93
+ }
94
+
95
+ /**
96
+ * Convert iso string to Date
97
+ * @param isoString the iso string
98
+ */
99
+ public static isoStringToDate(isoString: string | null): Date | null {
100
+ return isoString ? new Date(Date.parse(isoString)) : null;
101
+ }
102
+
103
+ /**
104
+ * Remove time from an iso date string
105
+ * @param isoString the iso string
106
+ */
107
+ public static isoStringRemoveTime(isoString: string): string {
108
+ let date = ItDateUtils.isoStringToDate(isoString);
109
+ if (!date) {
110
+ return isoString;
111
+ }
112
+ const offset = date.getTimezoneOffset();
113
+ date = new Date(date.getTime() - offset * 60 * 1000);
114
+ return date.toISOString().substring(0, isoString.indexOf('T'));
115
+ }
116
+
117
+ /**
118
+ * Set iso string hours to 0 and format correctly the date (consider timezone offset)
119
+ * @example '2024-03-04T23:00:00.000Z' -> '2024-03-05T00:00:00.000Z'
120
+ * @param isoString the iso string
121
+ */
122
+ public static isoStringSetZeroTime(isoString: string): string {
123
+ let date = ItDateUtils.isoStringToDate(isoString);
124
+ if (!date) {
125
+ return isoString;
126
+ }
127
+ const offset = date.getTimezoneOffset();
128
+ date = new Date(date.getTime() - offset * 60 * 1000);
129
+ date.setUTCHours(0, 0, 0, 0);
130
+ return date.toISOString();
131
+ }
132
+
133
+ /**
134
+ * Calculate the date time left and return the string format [d h m s]
135
+ * @param endDate
136
+ */
137
+ public static timeLeftString(endDate: Date): Observable<string> {
138
+ const endTime = endDate.getTime();
139
+ return timer(0, 1000).pipe(
140
+ map(() => Math.floor((endTime - new Date().getTime()) / 1000)),
141
+ takeWhile(delta => delta >= 0),
142
+ map(delta => {
143
+ const arrayResult: Array<string> = [];
144
+ const days = Math.floor(delta / 60 / 60 / 24);
145
+ if (days > 0) {
146
+ arrayResult.push(days + 'd');
147
+ }
148
+ delta -= days * 60 * 60 * 24;
149
+ const hours = Math.floor(delta / 60 / 60) % 24;
150
+ if (hours > 0) {
151
+ arrayResult.push(hours + 'h');
152
+ }
153
+
154
+ delta -= hours * 60 * 60;
155
+ const minutes = Math.floor(delta / 60) % 60;
156
+ arrayResult.push(minutes + 'm');
157
+
158
+ delta -= minutes * 60;
159
+ const seconds = delta % 60;
160
+ arrayResult.push(seconds + 's');
161
+
162
+ return arrayResult.join(' ');
163
+ }),
164
+ shareReplay(1)
165
+ );
166
+ }
167
+
168
+ /**
169
+ * Calculate the next day of week
170
+ * @param dayOfWeek Day of week 0=Sunday, 1=Monday...4=Thursday...
171
+ * @param hour the specif hour
172
+ * @param minute the specific minute
173
+ */
174
+ public static nextWeekDayAndTime(dayOfWeek: number, hour = 0, minute = 0): Date {
175
+ const now = new Date();
176
+ const result = new Date(now.getFullYear(), now.getMonth(), now.getDate() + ((7 + dayOfWeek - now.getDay()) % 7), hour, minute, 0, 0);
177
+
178
+ if (result < now) {
179
+ result.setDate(result.getDate() + 7);
180
+ }
181
+
182
+ return result;
183
+ }
184
+ }