valtech-components 2.0.26 → 2.0.28

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 (308) hide show
  1. package/ng-package.json +10 -0
  2. package/package.json +12 -14
  3. package/src/lib/components/atoms/avatar/avatar.component.scss +20 -0
  4. package/src/lib/components/atoms/avatar/avatar.component.ts +29 -0
  5. package/src/lib/components/atoms/avatar/types.ts +6 -0
  6. package/src/lib/components/atoms/box/box.component.scss +57 -0
  7. package/src/lib/components/atoms/box/box.component.ts +38 -0
  8. package/src/lib/components/atoms/box/types.ts +8 -0
  9. package/src/lib/components/atoms/button/button.component.scss +5 -0
  10. package/src/lib/components/atoms/button/button.component.ts +53 -0
  11. package/src/lib/components/atoms/button/factory.ts +444 -0
  12. package/src/lib/components/atoms/display/display.component.scss +17 -0
  13. package/src/lib/components/atoms/display/display.component.ts +25 -0
  14. package/src/lib/components/atoms/display/types.ts +7 -0
  15. package/src/lib/components/atoms/divider/divider.component.scss +62 -0
  16. package/src/lib/components/atoms/divider/divider.component.ts +18 -0
  17. package/src/lib/components/atoms/divider/types.ts +5 -0
  18. package/src/lib/components/atoms/href/href.component.scss +25 -0
  19. package/src/lib/components/atoms/href/href.component.ts +43 -0
  20. package/src/lib/components/atoms/href/types.ts +10 -0
  21. package/src/lib/components/atoms/icon/icon.component.scss +33 -0
  22. package/src/lib/components/atoms/icon/icon.component.ts +20 -0
  23. package/src/lib/components/atoms/icon/types.ts +7 -0
  24. package/src/lib/components/atoms/image/image.component.scss +70 -0
  25. package/src/lib/components/atoms/image/image.component.ts +40 -0
  26. package/src/lib/components/atoms/image/types.ts +11 -0
  27. package/src/lib/components/atoms/progress-bar/progress-bar.component.scss +22 -0
  28. package/src/lib/components/atoms/progress-bar/progress-bar.component.ts +29 -0
  29. package/src/lib/components/atoms/progress-bar/types.ts +10 -0
  30. package/src/lib/components/atoms/text/text.component.scss +33 -0
  31. package/src/lib/components/atoms/text/text.component.ts +23 -0
  32. package/src/lib/components/atoms/text/types.ts +8 -0
  33. package/src/lib/components/atoms/title/title.component.scss +17 -0
  34. package/src/lib/components/atoms/title/title.component.ts +27 -0
  35. package/src/lib/components/atoms/title/types.ts +8 -0
  36. package/src/lib/components/molecules/alert-box/alert-box.component.scss +10 -0
  37. package/src/lib/components/molecules/alert-box/alert-box.component.ts +28 -0
  38. package/{lib/components/molecules/alert-box/types.d.ts → src/lib/components/molecules/alert-box/types.ts} +4 -3
  39. package/src/lib/components/molecules/button-group/button-group.component.scss +31 -0
  40. package/src/lib/components/molecules/button-group/button-group.component.ts +44 -0
  41. package/src/lib/components/molecules/button-group/types.ts +7 -0
  42. package/src/lib/components/molecules/card/card.component.scss +46 -0
  43. package/src/lib/components/molecules/card/card.component.ts +218 -0
  44. package/src/lib/components/molecules/card/types.ts +36 -0
  45. package/src/lib/components/molecules/check-input/check-input.component.scss +0 -0
  46. package/src/lib/components/molecules/check-input/check-input.component.ts +16 -0
  47. package/src/lib/components/molecules/comment-input/comment-input.component.scss +0 -0
  48. package/src/lib/components/molecules/comment-input/comment-input.component.ts +22 -0
  49. package/src/lib/components/molecules/content-loader/content-loader.component.scss +42 -0
  50. package/src/lib/components/molecules/content-loader/content-loader.component.ts +27 -0
  51. package/src/lib/components/molecules/content-loader/types.ts +8 -0
  52. package/src/lib/components/molecules/date-input/date-input.component.scss +11 -0
  53. package/src/lib/components/molecules/date-input/date-input.component.ts +47 -0
  54. package/src/lib/components/molecules/email-input/email-input.component.scss +0 -0
  55. package/src/lib/components/molecules/email-input/email-input.component.ts +20 -0
  56. package/src/lib/components/molecules/file-input/file-input.component.scss +11 -0
  57. package/src/lib/components/molecules/file-input/file-input.component.ts +56 -0
  58. package/src/lib/components/molecules/hint/hint.component.scss +5 -0
  59. package/src/lib/components/molecules/hint/hint.component.ts +42 -0
  60. package/src/lib/components/molecules/hour-input/hour-input.component.scss +0 -0
  61. package/src/lib/components/molecules/hour-input/hour-input.component.ts +19 -0
  62. package/src/lib/components/molecules/link/link.component.scss +5 -0
  63. package/src/lib/components/molecules/link/link.component.ts +52 -0
  64. package/src/lib/components/molecules/link/types.ts +10 -0
  65. package/src/lib/components/molecules/links-cake/links-cake.component.scss +9 -0
  66. package/src/lib/components/molecules/links-cake/links-cake.component.ts +30 -0
  67. package/{lib/components/molecules/links-cake/types.d.ts → src/lib/components/molecules/links-cake/types.ts} +4 -3
  68. package/src/lib/components/molecules/notes-box/notes-box.component.scss +5 -0
  69. package/src/lib/components/molecules/notes-box/notes-box.component.ts +28 -0
  70. package/src/lib/components/molecules/notes-box/types.ts +9 -0
  71. package/src/lib/components/molecules/number-input/number-input.component.scss +0 -0
  72. package/src/lib/components/molecules/number-input/number-input.component.ts +19 -0
  73. package/src/lib/components/molecules/password-input/password-input.component.scss +7 -0
  74. package/src/lib/components/molecules/password-input/password-input.component.ts +33 -0
  75. package/src/lib/components/molecules/pin-input/pin-input.component.scss +13 -0
  76. package/src/lib/components/molecules/pin-input/pin-input.component.ts +42 -0
  77. package/src/lib/components/molecules/progress-status/progress-status.component.scss +41 -0
  78. package/src/lib/components/molecules/progress-status/progress-status.component.ts +70 -0
  79. package/src/lib/components/molecules/progress-status/types.ts +11 -0
  80. package/src/lib/components/molecules/prompter/prompter.component.scss +34 -0
  81. package/src/lib/components/molecules/prompter/prompter.component.ts +58 -0
  82. package/{lib/components/molecules/prompter/types.d.ts → src/lib/components/molecules/prompter/types.ts} +7 -6
  83. package/src/lib/components/molecules/radio-input/radio-input.component.scss +0 -0
  84. package/src/lib/components/molecules/radio-input/radio-input.component.ts +27 -0
  85. package/src/lib/components/molecules/searchbar/searchbar.component.scss +9 -0
  86. package/src/lib/components/molecules/searchbar/searchbar.component.ts +47 -0
  87. package/src/lib/components/molecules/text-input/text-input.component.scss +1 -0
  88. package/src/lib/components/molecules/text-input/text-input.component.ts +19 -0
  89. package/src/lib/components/molecules/title-block/title-block.component.scss +36 -0
  90. package/src/lib/components/molecules/title-block/title-block.component.ts +50 -0
  91. package/src/lib/components/molecules/title-block/types.ts +14 -0
  92. package/src/lib/components/organisms/banner/banner.component.scss +45 -0
  93. package/src/lib/components/organisms/banner/banner.component.ts +57 -0
  94. package/src/lib/components/organisms/banner/types.ts +13 -0
  95. package/src/lib/components/organisms/footer/footer.component.scss +3 -0
  96. package/src/lib/components/organisms/footer/footer.component.ts +40 -0
  97. package/{lib/components/organisms/footer/types.d.ts → src/lib/components/organisms/footer/types.ts} +4 -3
  98. package/src/lib/components/organisms/form/factory.ts +11 -0
  99. package/src/lib/components/organisms/form/form-footer/form-footer.component.scss +0 -0
  100. package/src/lib/components/organisms/form/form-footer/form-footer.component.ts +63 -0
  101. package/src/lib/components/organisms/form/form.component.scss +16 -0
  102. package/src/lib/components/organisms/form/form.component.ts +183 -0
  103. package/src/lib/components/organisms/header/header.component.scss +0 -0
  104. package/src/lib/components/organisms/header/header.component.ts +32 -0
  105. package/{lib/components/organisms/header/types.d.ts → src/lib/components/organisms/header/types.ts} +4 -3
  106. package/src/lib/components/organisms/no-content/no-content.component.scss +11 -0
  107. package/src/lib/components/organisms/no-content/no-content.component.ts +32 -0
  108. package/{lib/components/organisms/no-content/types.d.ts → src/lib/components/organisms/no-content/types.ts} +3 -2
  109. package/src/lib/components/organisms/toolbar/toolbar.component.scss +13 -0
  110. package/src/lib/components/organisms/toolbar/toolbar.component.ts +119 -0
  111. package/src/lib/components/organisms/toolbar/types.ts +12 -0
  112. package/src/lib/components/organisms/wizard/types.ts +24 -0
  113. package/src/lib/components/organisms/wizard/wizard-footer/wizard-footer.component.scss +0 -0
  114. package/src/lib/components/organisms/wizard/wizard-footer/wizard-footer.component.ts +90 -0
  115. package/src/lib/components/organisms/wizard/wizard.component.scss +15 -0
  116. package/src/lib/components/organisms/wizard/wizard.component.ts +99 -0
  117. package/src/lib/components/templates/layout/layout.component.scss +22 -0
  118. package/src/lib/components/templates/layout/layout.component.ts +14 -0
  119. package/src/lib/components/templates/simple/simple.component.scss +30 -0
  120. package/src/lib/components/templates/simple/simple.component.ts +60 -0
  121. package/{lib/components/templates/simple/types.d.ts → src/lib/components/templates/simple/types.ts} +6 -5
  122. package/src/lib/components/types.ts +122 -0
  123. package/src/lib/services/download.service.ts +58 -0
  124. package/src/lib/services/in-app-browser.service.ts +19 -0
  125. package/src/lib/services/lang-provider/components/lang-settings.ts +14 -0
  126. package/src/lib/services/lang-provider/components/theme-settings.ts +16 -0
  127. package/src/lib/services/lang-provider/content.ts +14 -0
  128. package/src/lib/services/lang-provider/lang-provider.service.ts +38 -0
  129. package/src/lib/services/lang-provider/types.ts +25 -0
  130. package/src/lib/services/local-storage.service.ts +18 -0
  131. package/src/lib/services/navigation.service.ts +39 -0
  132. package/src/lib/services/theme.service.ts +102 -0
  133. package/{lib/services/types.d.ts → src/lib/services/types.ts} +4 -2
  134. package/src/lib/shared/constants/storage.ts +2 -0
  135. package/src/lib/shared/utils/dom.ts +19 -0
  136. package/{public-api.d.ts → src/public-api.ts} +13 -0
  137. package/tsconfig.lib.json +14 -0
  138. package/tsconfig.lib.prod.json +10 -0
  139. package/tsconfig.spec.json +14 -0
  140. package/esm2022/lib/components/atoms/avatar/avatar.component.mjs +0 -31
  141. package/esm2022/lib/components/atoms/avatar/types.mjs +0 -2
  142. package/esm2022/lib/components/atoms/box/box.component.mjs +0 -47
  143. package/esm2022/lib/components/atoms/box/types.mjs +0 -2
  144. package/esm2022/lib/components/atoms/button/button.component.mjs +0 -69
  145. package/esm2022/lib/components/atoms/button/factory.mjs +0 -217
  146. package/esm2022/lib/components/atoms/display/display.component.mjs +0 -28
  147. package/esm2022/lib/components/atoms/display/types.mjs +0 -2
  148. package/esm2022/lib/components/atoms/divider/divider.component.mjs +0 -17
  149. package/esm2022/lib/components/atoms/divider/types.mjs +0 -2
  150. package/esm2022/lib/components/atoms/href/href.component.mjs +0 -51
  151. package/esm2022/lib/components/atoms/href/types.mjs +0 -2
  152. package/esm2022/lib/components/atoms/icon/icon.component.mjs +0 -18
  153. package/esm2022/lib/components/atoms/icon/types.mjs +0 -2
  154. package/esm2022/lib/components/atoms/image/image.component.mjs +0 -50
  155. package/esm2022/lib/components/atoms/image/types.mjs +0 -2
  156. package/esm2022/lib/components/atoms/progress-bar/progress-bar.component.mjs +0 -36
  157. package/esm2022/lib/components/atoms/progress-bar/types.mjs +0 -2
  158. package/esm2022/lib/components/atoms/text/text.component.mjs +0 -24
  159. package/esm2022/lib/components/atoms/text/types.mjs +0 -2
  160. package/esm2022/lib/components/atoms/title/title.component.mjs +0 -31
  161. package/esm2022/lib/components/atoms/title/types.mjs +0 -2
  162. package/esm2022/lib/components/molecules/alert-box/alert-box.component.mjs +0 -32
  163. package/esm2022/lib/components/molecules/alert-box/types.mjs +0 -2
  164. package/esm2022/lib/components/molecules/button-group/button-group.component.mjs +0 -49
  165. package/esm2022/lib/components/molecules/button-group/types.mjs +0 -2
  166. package/esm2022/lib/components/molecules/card/card.component.mjs +0 -369
  167. package/esm2022/lib/components/molecules/card/types.mjs +0 -16
  168. package/esm2022/lib/components/molecules/check-input/check-input.component.mjs +0 -15
  169. package/esm2022/lib/components/molecules/comment-input/comment-input.component.mjs +0 -23
  170. package/esm2022/lib/components/molecules/content-loader/content-loader.component.mjs +0 -32
  171. package/esm2022/lib/components/molecules/content-loader/types.mjs +0 -2
  172. package/esm2022/lib/components/molecules/date-input/date-input.component.mjs +0 -73
  173. package/esm2022/lib/components/molecules/email-input/email-input.component.mjs +0 -19
  174. package/esm2022/lib/components/molecules/file-input/file-input.component.mjs +0 -69
  175. package/esm2022/lib/components/molecules/hint/hint.component.mjs +0 -52
  176. package/esm2022/lib/components/molecules/hour-input/hour-input.component.mjs +0 -18
  177. package/esm2022/lib/components/molecules/link/link.component.mjs +0 -37
  178. package/esm2022/lib/components/molecules/link/types.mjs +0 -2
  179. package/esm2022/lib/components/molecules/links-cake/links-cake.component.mjs +0 -37
  180. package/esm2022/lib/components/molecules/links-cake/types.mjs +0 -2
  181. package/esm2022/lib/components/molecules/notes-box/notes-box.component.mjs +0 -33
  182. package/esm2022/lib/components/molecules/notes-box/types.mjs +0 -2
  183. package/esm2022/lib/components/molecules/number-input/number-input.component.mjs +0 -18
  184. package/esm2022/lib/components/molecules/password-input/password-input.component.mjs +0 -44
  185. package/esm2022/lib/components/molecules/pin-input/pin-input.component.mjs +0 -45
  186. package/esm2022/lib/components/molecules/progress-status/progress-status.component.mjs +0 -94
  187. package/esm2022/lib/components/molecules/progress-status/types.mjs +0 -2
  188. package/esm2022/lib/components/molecules/prompter/prompter.component.mjs +0 -84
  189. package/esm2022/lib/components/molecules/prompter/types.mjs +0 -2
  190. package/esm2022/lib/components/molecules/radio-input/radio-input.component.mjs +0 -33
  191. package/esm2022/lib/components/molecules/searchbar/searchbar.component.mjs +0 -61
  192. package/esm2022/lib/components/molecules/text-input/text-input.component.mjs +0 -18
  193. package/esm2022/lib/components/molecules/title-block/title-block.component.mjs +0 -77
  194. package/esm2022/lib/components/molecules/title-block/types.mjs +0 -2
  195. package/esm2022/lib/components/organisms/banner/banner.component.mjs +0 -75
  196. package/esm2022/lib/components/organisms/banner/types.mjs +0 -2
  197. package/esm2022/lib/components/organisms/footer/footer.component.mjs +0 -50
  198. package/esm2022/lib/components/organisms/footer/types.mjs +0 -2
  199. package/esm2022/lib/components/organisms/form/factory.mjs +0 -8
  200. package/esm2022/lib/components/organisms/form/form-footer/form-footer.component.mjs +0 -76
  201. package/esm2022/lib/components/organisms/form/form.component.mjs +0 -230
  202. package/esm2022/lib/components/organisms/header/header.component.mjs +0 -33
  203. package/esm2022/lib/components/organisms/header/types.mjs +0 -2
  204. package/esm2022/lib/components/organisms/no-content/no-content.component.mjs +0 -34
  205. package/esm2022/lib/components/organisms/no-content/types.mjs +0 -2
  206. package/esm2022/lib/components/organisms/toolbar/toolbar.component.mjs +0 -168
  207. package/esm2022/lib/components/organisms/toolbar/types.mjs +0 -2
  208. package/esm2022/lib/components/organisms/wizard/types.mjs +0 -7
  209. package/esm2022/lib/components/organisms/wizard/wizard-footer/wizard-footer.component.mjs +0 -107
  210. package/esm2022/lib/components/organisms/wizard/wizard.component.mjs +0 -103
  211. package/esm2022/lib/components/templates/layout/layout.component.mjs +0 -19
  212. package/esm2022/lib/components/templates/simple/simple.component.mjs +0 -72
  213. package/esm2022/lib/components/templates/simple/types.mjs +0 -2
  214. package/esm2022/lib/components/types.mjs +0 -36
  215. package/esm2022/lib/services/download.service.mjs +0 -63
  216. package/esm2022/lib/services/lang-provider/components/lang-settings.mjs +0 -13
  217. package/esm2022/lib/services/lang-provider/components/theme-settings.mjs +0 -15
  218. package/esm2022/lib/services/lang-provider/content.mjs +0 -8
  219. package/esm2022/lib/services/lang-provider/lang-provider.service.mjs +0 -39
  220. package/esm2022/lib/services/lang-provider/types.mjs +0 -14
  221. package/esm2022/lib/services/local-storage.service.mjs +0 -16
  222. package/esm2022/lib/services/theme.service.mjs +0 -97
  223. package/esm2022/lib/services/types.mjs +0 -3
  224. package/esm2022/lib/shared/constants/storage.mjs +0 -3
  225. package/esm2022/lib/shared/utils/dom.mjs +0 -17
  226. package/esm2022/public-api.mjs +0 -88
  227. package/esm2022/valtech-components.mjs +0 -5
  228. package/fesm2022/valtech-components.mjs +0 -2987
  229. package/fesm2022/valtech-components.mjs.map +0 -1
  230. package/index.d.ts +0 -5
  231. package/lib/components/atoms/avatar/avatar.component.d.ts +0 -12
  232. package/lib/components/atoms/avatar/types.d.ts +0 -6
  233. package/lib/components/atoms/box/box.component.d.ts +0 -12
  234. package/lib/components/atoms/box/types.d.ts +0 -7
  235. package/lib/components/atoms/button/button.component.d.ts +0 -20
  236. package/lib/components/atoms/button/factory.d.ts +0 -71
  237. package/lib/components/atoms/display/display.component.d.ts +0 -10
  238. package/lib/components/atoms/display/types.d.ts +0 -6
  239. package/lib/components/atoms/divider/divider.component.d.ts +0 -10
  240. package/lib/components/atoms/divider/types.d.ts +0 -5
  241. package/lib/components/atoms/href/href.component.d.ts +0 -15
  242. package/lib/components/atoms/href/types.d.ts +0 -9
  243. package/lib/components/atoms/icon/icon.component.d.ts +0 -10
  244. package/lib/components/atoms/icon/types.d.ts +0 -6
  245. package/lib/components/atoms/image/image.component.d.ts +0 -12
  246. package/lib/components/atoms/image/types.d.ts +0 -11
  247. package/lib/components/atoms/progress-bar/progress-bar.component.d.ts +0 -10
  248. package/lib/components/atoms/progress-bar/types.d.ts +0 -9
  249. package/lib/components/atoms/text/text.component.d.ts +0 -10
  250. package/lib/components/atoms/text/types.d.ts +0 -7
  251. package/lib/components/atoms/title/title.component.d.ts +0 -10
  252. package/lib/components/atoms/title/types.d.ts +0 -7
  253. package/lib/components/molecules/alert-box/alert-box.component.d.ts +0 -10
  254. package/lib/components/molecules/button-group/button-group.component.d.ts +0 -13
  255. package/lib/components/molecules/button-group/types.d.ts +0 -6
  256. package/lib/components/molecules/card/card.component.d.ts +0 -16
  257. package/lib/components/molecules/card/types.d.ts +0 -32
  258. package/lib/components/molecules/check-input/check-input.component.d.ts +0 -8
  259. package/lib/components/molecules/comment-input/comment-input.component.d.ts +0 -10
  260. package/lib/components/molecules/content-loader/content-loader.component.d.ts +0 -10
  261. package/lib/components/molecules/content-loader/types.d.ts +0 -7
  262. package/lib/components/molecules/date-input/date-input.component.d.ts +0 -10
  263. package/lib/components/molecules/email-input/email-input.component.d.ts +0 -10
  264. package/lib/components/molecules/file-input/file-input.component.d.ts +0 -15
  265. package/lib/components/molecules/hint/hint.component.d.ts +0 -11
  266. package/lib/components/molecules/hour-input/hour-input.component.d.ts +0 -10
  267. package/lib/components/molecules/link/link.component.d.ts +0 -12
  268. package/lib/components/molecules/link/types.d.ts +0 -6
  269. package/lib/components/molecules/links-cake/links-cake.component.d.ts +0 -10
  270. package/lib/components/molecules/notes-box/notes-box.component.d.ts +0 -10
  271. package/lib/components/molecules/notes-box/types.d.ts +0 -8
  272. package/lib/components/molecules/number-input/number-input.component.d.ts +0 -10
  273. package/lib/components/molecules/password-input/password-input.component.d.ts +0 -11
  274. package/lib/components/molecules/pin-input/pin-input.component.d.ts +0 -15
  275. package/lib/components/molecules/progress-status/progress-status.component.d.ts +0 -14
  276. package/lib/components/molecules/progress-status/types.d.ts +0 -10
  277. package/lib/components/molecules/prompter/prompter.component.d.ts +0 -12
  278. package/lib/components/molecules/radio-input/radio-input.component.d.ts +0 -10
  279. package/lib/components/molecules/searchbar/searchbar.component.d.ts +0 -14
  280. package/lib/components/molecules/text-input/text-input.component.d.ts +0 -10
  281. package/lib/components/molecules/title-block/title-block.component.d.ts +0 -10
  282. package/lib/components/molecules/title-block/types.d.ts +0 -12
  283. package/lib/components/organisms/banner/banner.component.d.ts +0 -14
  284. package/lib/components/organisms/banner/types.d.ts +0 -12
  285. package/lib/components/organisms/footer/footer.component.d.ts +0 -12
  286. package/lib/components/organisms/form/factory.d.ts +0 -5
  287. package/lib/components/organisms/form/form-footer/form-footer.component.d.ts +0 -15
  288. package/lib/components/organisms/form/form.component.d.ts +0 -23
  289. package/lib/components/organisms/header/header.component.d.ts +0 -12
  290. package/lib/components/organisms/no-content/no-content.component.d.ts +0 -12
  291. package/lib/components/organisms/toolbar/toolbar.component.d.ts +0 -21
  292. package/lib/components/organisms/toolbar/types.d.ts +0 -11
  293. package/lib/components/organisms/wizard/types.d.ts +0 -20
  294. package/lib/components/organisms/wizard/wizard-footer/wizard-footer.component.d.ts +0 -21
  295. package/lib/components/organisms/wizard/wizard.component.d.ts +0 -22
  296. package/lib/components/templates/layout/layout.component.d.ts +0 -5
  297. package/lib/components/templates/simple/simple.component.d.ts +0 -7
  298. package/lib/components/types.d.ts +0 -113
  299. package/lib/services/download.service.d.ts +0 -8
  300. package/lib/services/lang-provider/components/lang-settings.d.ts +0 -3
  301. package/lib/services/lang-provider/components/theme-settings.d.ts +0 -3
  302. package/lib/services/lang-provider/content.d.ts +0 -6
  303. package/lib/services/lang-provider/lang-provider.service.d.ts +0 -17
  304. package/lib/services/lang-provider/types.d.ts +0 -15
  305. package/lib/services/local-storage.service.d.ts +0 -6
  306. package/lib/services/theme.service.d.ts +0 -27
  307. package/lib/shared/constants/storage.d.ts +0 -2
  308. package/lib/shared/utils/dom.d.ts +0 -3
@@ -0,0 +1,119 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
3
+ import { NavController } from '@ionic/angular';
4
+ import { IonButton, IonButtons, IonIcon, IonText, IonTitle, IonToolbar } from '@ionic/angular/standalone';
5
+ import { AvatarComponent } from '../../atoms/avatar/avatar.component';
6
+ import { ImageComponent } from '../../atoms/image/image.component';
7
+ import { ToolbarAction, ToolbarActionType } from '../../types';
8
+ import { ToolbarMetadata } from './types';
9
+
10
+ @Component({
11
+ selector: 'val-toolbar',
12
+ standalone: true,
13
+ imports: [
14
+ CommonModule,
15
+ IonToolbar,
16
+ IonButtons,
17
+ IonButton,
18
+ IonIcon,
19
+ IonText,
20
+ IonTitle,
21
+ AvatarComponent,
22
+ ImageComponent,
23
+ ],
24
+ template: `
25
+ <ion-toolbar [color]="props.color" [class.background]="props.color === 'background'">
26
+ <ng-container *ngIf="props.withBack">
27
+ <ion-buttons class="left-buttons" slot="start" *ngIf="props.withBack">
28
+ <ion-button fill="clear" (click)="goBack()" [color]="props.textColor">
29
+ <ion-icon name="chevron-back-outline" [slot]="props.backText ? 'start' : 'icon-only'"></ion-icon>
30
+ <ion-text *ngIf="props.backText">{{ props.backText }}</ion-text>
31
+ </ion-button>
32
+ </ion-buttons>
33
+ </ng-container>
34
+ <ng-container *ngIf="props.withActions">
35
+ <ion-buttons slot="end" *ngIf="someInRight()">
36
+ <ng-container *ngFor="let action of rightActions()">
37
+ <ion-button *ngIf="action.type === actionTypes.ICON" (click)="clickHandler(action.token)">
38
+ <ion-icon slot="icon-only" [name]="action.description" color="dark"></ion-icon>
39
+ </ion-button>
40
+ <val-avatar
41
+ *ngIf="action.type === actionTypes.AVATAR"
42
+ [props]="{ size: 'small', image: action.description, default: '' }"
43
+ (onClick)="clickHandler(action.token)"
44
+ ></val-avatar>
45
+ <val-image
46
+ *ngIf="action.type === actionTypes.IMAGE"
47
+ [props]="action.image"
48
+ (click)="clickHandler(action.token)"
49
+ ></val-image>
50
+ <ion-button *ngIf="action.type === actionTypes.BUTTON" (click)="clickHandler(action.token)">{{
51
+ action.description
52
+ }}</ion-button>
53
+ </ng-container>
54
+ </ion-buttons>
55
+ <ion-buttons slot="start" *ngIf="someInLeft()">
56
+ <ng-container *ngFor="let action of leftActions()">
57
+ <ion-button *ngIf="action.type === actionTypes.ICON" (click)="clickHandler(action.token)">
58
+ <ion-icon slot="icon-only" [name]="action.description" color="dark"></ion-icon>
59
+ </ion-button>
60
+ <val-avatar
61
+ *ngIf="action.type === actionTypes.AVATAR"
62
+ [props]="{ size: 'small', image: action.description, default: '' }"
63
+ (onClick)="clickHandler(action.token)"
64
+ ></val-avatar>
65
+ <val-image
66
+ *ngIf="action.type === actionTypes.IMAGE"
67
+ [props]="action.image"
68
+ (click)="clickHandler(action.token)"
69
+ ></val-image>
70
+ <ion-button *ngIf="action.type === actionTypes.BUTTON" (click)="clickHandler(action.token)">{{
71
+ action.description
72
+ }}</ion-button>
73
+ </ng-container>
74
+ </ion-buttons>
75
+ </ng-container>
76
+ <ion-title *ngIf="props.title" [color]="props.textColor">{{ props.title }}</ion-title>
77
+ <!-- experimental -->
78
+ <ng-content select="[toolbar-bottom]"></ng-content>
79
+ </ion-toolbar>
80
+ `,
81
+ styleUrls: ['./toolbar.component.scss'],
82
+ })
83
+ export class ToolbarComponent implements OnInit {
84
+ @Input()
85
+ props: ToolbarMetadata;
86
+
87
+ @Output()
88
+ onClick = new EventEmitter<string>();
89
+
90
+ actionTypes = ToolbarActionType;
91
+
92
+ constructor(private navCtrl: NavController) {}
93
+
94
+ ngOnInit() {}
95
+
96
+ goBack(): void {
97
+ this.navCtrl.back();
98
+ }
99
+
100
+ rightActions(): ToolbarAction[] {
101
+ return this.props.actions.filter(x => x.position === 'right');
102
+ }
103
+
104
+ leftActions(): ToolbarAction[] {
105
+ return this.props.actions.filter(x => x.position === 'left');
106
+ }
107
+
108
+ someInRight(): boolean {
109
+ return !!this.props.actions.find(x => x.position === 'right');
110
+ }
111
+
112
+ someInLeft(): boolean {
113
+ return !!this.props.actions.find(x => x.position === 'left');
114
+ }
115
+
116
+ clickHandler(token?: string) {
117
+ this.onClick.emit(token);
118
+ }
119
+ }
@@ -0,0 +1,12 @@
1
+ import { Color } from '@ionic/core';
2
+ import { ToolbarAction } from '../../types';
3
+
4
+ export type ToolbarMetadata = {
5
+ withBack: boolean;
6
+ backText?: string;
7
+ withActions: boolean;
8
+ color?: Color;
9
+ textColor?: Color;
10
+ title: string;
11
+ actions: ToolbarAction[];
12
+ };
@@ -0,0 +1,24 @@
1
+ import { ButtonMetadata, ComponentState } from '../../types';
2
+ import { NoContentMetadata } from '../no-content/types';
3
+
4
+ export type WizardMetadata = {
5
+ state: ComponentState;
6
+ current: number;
7
+ steps: Steps;
8
+ error: Step;
9
+ };
10
+
11
+ export type Step = {
12
+ titles: NoContentMetadata;
13
+ buttons: ButtonMetadata[];
14
+ };
15
+
16
+ export type Steps = {
17
+ [step: number]: Step;
18
+ };
19
+
20
+ export enum MOTION {
21
+ BACKWARD,
22
+ FORWARD,
23
+ RETRY,
24
+ }
@@ -0,0 +1,90 @@
1
+ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
+ import { ProgressBarComponent } from '../../../atoms/progress-bar/progress-bar.component';
3
+ import { ButtonGroupComponent } from '../../../molecules/button-group/button-group.component';
4
+ import { ButtonMetadata, ComponentStates } from '../../../types';
5
+ import { FooterComponent } from '../../footer/footer.component';
6
+ import { MOTION, Step, WizardMetadata } from '../types';
7
+
8
+ @Component({
9
+ selector: 'val-wizard-footer',
10
+ standalone: true,
11
+ imports: [FooterComponent, ProgressBarComponent, ButtonGroupComponent],
12
+ template: `
13
+ <val-footer
14
+ [props]="{
15
+ bordered: false,
16
+ translucent: false,
17
+ toolbar: {
18
+ title: '',
19
+ actions: [],
20
+ color: 'background',
21
+ withBack: false,
22
+ withActions: false,
23
+ },
24
+ }"
25
+ >
26
+ <val-progress-bar
27
+ extra
28
+ [props]="{ progress: Progress, color: '', type: 'determinate', buffer: 1, size: 'small', rounded: false }"
29
+ ></val-progress-bar>
30
+ <val-button-group
31
+ extra
32
+ [props]="{ buttons: actions, position: 'left', columned: false }"
33
+ position="spaced"
34
+ (onClick)="clickHandler($event)"
35
+ ></val-button-group>
36
+ </val-footer>
37
+ `,
38
+ styleUrls: ['./wizard-footer.component.scss'],
39
+ })
40
+ export class WizardFooterComponent implements OnInit {
41
+ @Input()
42
+ props: WizardMetadata;
43
+
44
+ @Output()
45
+ onClick = new EventEmitter<{ current: number; motion: MOTION }>();
46
+
47
+ wrapperId = 'wizard-wrapper';
48
+
49
+ constructor() {}
50
+
51
+ ngOnInit() {}
52
+
53
+ clickHandler(token?: string) {
54
+ if (!token) {
55
+ return;
56
+ }
57
+ if (token.includes('right')) {
58
+ this.tryToStep(MOTION.FORWARD);
59
+ }
60
+ if (token.includes('left')) {
61
+ this.tryToStep(MOTION.BACKWARD);
62
+ }
63
+ }
64
+
65
+ get Current(): Step {
66
+ return this.props.steps[this.props.current];
67
+ }
68
+
69
+ get Progress(): number {
70
+ if (this.props.steps && this.props.current) {
71
+ return this.props.current / Object.keys(this.props.steps).length;
72
+ }
73
+ return 0;
74
+ }
75
+
76
+ get actions(): ButtonMetadata[] {
77
+ if (this.props.state === ComponentStates.ERROR && this.Current.buttons.length > 1) {
78
+ this.Current.buttons[1].state = ComponentStates.DISABLED;
79
+ }
80
+
81
+ if (this.props.current === 1 && this.Current.buttons.length > 1) {
82
+ return [this.Current.buttons[1]];
83
+ }
84
+ return this.Current.buttons;
85
+ }
86
+
87
+ tryToStep(motion: MOTION): void {
88
+ this.onClick.emit({ current: this.props.current, motion });
89
+ }
90
+ }
@@ -0,0 +1,15 @@
1
+ @import '../../styles/mixins.scss';
2
+
3
+ .wrapper {
4
+ height: auto;
5
+ display: flex;
6
+ flex-direction: column;
7
+ justify-content: space-between;
8
+ position: relative;
9
+ }
10
+
11
+ .step {
12
+ min-height: pxToRem(150);
13
+ margin: 16px 0;
14
+ text-align: center;
15
+ }
@@ -0,0 +1,99 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
3
+ import { goToTop } from '../../../shared/utils/dom';
4
+ import { ContentLoaderComponent } from '../../molecules/content-loader/content-loader.component';
5
+ import { ComponentStates } from '../../types';
6
+ import { NoContentComponent } from '../no-content/no-content.component';
7
+ import { MOTION, Step, WizardMetadata } from './types';
8
+
9
+ @Component({
10
+ selector: 'val-wizard',
11
+ standalone: true,
12
+ imports: [CommonModule, NoContentComponent, ContentLoaderComponent],
13
+ template: `
14
+ <div [id]="wrapperId" class="wrapper">
15
+ <ng-container *ngIf="props.state !== 'ERROR'">
16
+ <val-no-content [props]="Current.titles"></val-no-content>
17
+ <div class="step">
18
+ <div *ngIf="props.state === 'WORKING'">
19
+ <val-content-loader color="dark" size="large" text="Por favor espere..."></val-content-loader>
20
+ </div>
21
+ <ng-content select="[step]"></ng-content>
22
+ </div>
23
+ </ng-container>
24
+ <ng-container *ngIf="props.state === 'ERROR'">
25
+ <val-no-content [props]="props.error.titles" (onClick)="clickHandler($event)"></val-no-content>
26
+ </ng-container>
27
+ </div>
28
+ `,
29
+ styleUrls: ['./wizard.component.scss'],
30
+ })
31
+ export class WizardComponent implements OnInit {
32
+ @Input()
33
+ props: WizardMetadata;
34
+
35
+ @Output()
36
+ onClick = new EventEmitter<{ current: number; motion: MOTION }>();
37
+
38
+ wrapperId = 'wizard-wrapper';
39
+
40
+ constructor() {}
41
+
42
+ ngOnInit() {}
43
+
44
+ working() {
45
+ this.props.state = ComponentStates.WORKING;
46
+ this.Current.buttons.map(x => {
47
+ x.state = ComponentStates.DISABLED;
48
+ });
49
+ }
50
+
51
+ done() {
52
+ if (this.props.state === ComponentStates.ENABLED) {
53
+ return;
54
+ }
55
+
56
+ this.props.state = ComponentStates.ENABLED;
57
+ this.Current.buttons.map(x => {
58
+ x.state = ComponentStates.ENABLED;
59
+ });
60
+ }
61
+
62
+ get Current(): Step {
63
+ return this.props.steps[this.props.current];
64
+ }
65
+
66
+ setCurrent(newStep: number) {
67
+ if (newStep === this.props.current) {
68
+ return;
69
+ }
70
+ this.props.current = newStep;
71
+ goToTop(this.wrapperId);
72
+ }
73
+
74
+ setError(error: string) {
75
+ if (this.props.state === ComponentStates.ERROR) {
76
+ return;
77
+ }
78
+
79
+ this.props.error.titles.content.content.bellowTitle.text = error;
80
+ this.props.state = ComponentStates.ERROR;
81
+ goToTop(this.wrapperId);
82
+ }
83
+
84
+ reset() {
85
+ this.props.error.titles.content.content.bellowTitle.text = '';
86
+ this.done();
87
+ }
88
+
89
+ clickHandler(token?: string) {
90
+ if (!token) {
91
+ return;
92
+ }
93
+ if (token.includes('retry')) {
94
+ this.reset();
95
+ }
96
+
97
+ this.onClick.emit({ current: this.props.current, motion: MOTION.RETRY });
98
+ }
99
+ }
@@ -0,0 +1,22 @@
1
+ @import '../../styles/mixins.scss';
2
+
3
+ .layout-container {
4
+ margin: 0 auto;
5
+ padding: 0 pxToRem(16);
6
+ width: 100%;
7
+ box-sizing: border-box;
8
+ margin-bottom: pxToRem(16);
9
+
10
+ @include max-media-medium {
11
+ max-width: 100%;
12
+ }
13
+
14
+ @include media-medium {
15
+ max-width: pxToRem($container-max-large);
16
+ margin-bottom: pxToRem(24);
17
+ }
18
+
19
+ @include media-xlarge {
20
+ max-width: pxToRem($container-max-xlarge);
21
+ }
22
+ }
@@ -0,0 +1,14 @@
1
+ import { Component } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'val-layout',
5
+ standalone: true,
6
+ imports: [],
7
+ template: `
8
+ <div class="layout-container">
9
+ <ng-content></ng-content>
10
+ </div>
11
+ `,
12
+ styleUrl: './layout.component.scss',
13
+ })
14
+ export class LayoutComponent {}
@@ -0,0 +1,30 @@
1
+ @import '../../styles/mixins.scss';
2
+
3
+ .layout-container {
4
+ margin: 0 auto;
5
+ padding: 0 pxToRem(16);
6
+ width: 100%;
7
+ box-sizing: border-box;
8
+ margin-bottom: pxToRem(16);
9
+
10
+ @include max-media-medium {
11
+ max-width: 100%;
12
+ }
13
+
14
+ @include media-medium {
15
+ max-width: pxToRem($container-max-large);
16
+ margin-bottom: pxToRem(24);
17
+ }
18
+
19
+ @include media-xlarge {
20
+ max-width: pxToRem($container-max-xlarge);
21
+ }
22
+ }
23
+
24
+ .description-container {
25
+ padding-left: pxToRem(8);
26
+ }
27
+
28
+ .description {
29
+ padding-left: pxToRem(16);
30
+ }
@@ -0,0 +1,60 @@
1
+ import { NgIf } from '@angular/common';
2
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
3
+ import { IonContent, IonHeader, IonText, IonTitle, IonToolbar } from '@ionic/angular/standalone';
4
+ import { ButtonComponent } from '../../atoms/button/button.component';
5
+ import { DividerComponent } from '../../atoms/divider/divider.component';
6
+ import { LinkComponent } from '../../molecules/link/link.component';
7
+ import { HeaderComponent } from '../../organisms/header/header.component';
8
+ import { LayoutComponent } from '../layout/layout.component';
9
+ import { SimpleMetadata } from './types';
10
+
11
+ @Component({
12
+ selector: 'val-simple',
13
+ standalone: true,
14
+ imports: [
15
+ NgIf,
16
+ IonHeader,
17
+ IonToolbar,
18
+ IonTitle,
19
+ IonText,
20
+ IonContent,
21
+ ButtonComponent,
22
+ HeaderComponent,
23
+ LayoutComponent,
24
+ DividerComponent,
25
+ LinkComponent,
26
+ ],
27
+ template: `
28
+ <val-header [props]="props.header" />
29
+
30
+ <ion-content [fullscreen]="true">
31
+ <ion-header collapse="condense">
32
+ <ion-toolbar>
33
+ <ion-title size="large">{{ props.pageTitle }}</ion-title>
34
+ </ion-toolbar>
35
+ </ion-header>
36
+ <div class="description-container" *ngIf="props.pageDescription">
37
+ <ion-text>
38
+ <p class="description">{{ props.pageDescription }}</p>
39
+ </ion-text>
40
+ <val-link *ngIf="props.link" [props]="props.link" (onClick)="onClickHandler($event)" )></val-link>
41
+ </div>
42
+ <val-divider *ngIf="props.withDivider" [props]="{ fill: 'solid', size: 'medium', color: 'dark' }" />
43
+ <val-layout>
44
+ <ng-content></ng-content>
45
+ </val-layout>
46
+ </ion-content>
47
+ `,
48
+ styleUrl: './simple.component.scss',
49
+ })
50
+ export class SimpleComponent {
51
+ @Input()
52
+ props: SimpleMetadata;
53
+
54
+ @Output()
55
+ onClick = new EventEmitter<string>();
56
+
57
+ onClickHandler(token?: string) {
58
+ this.onClick.emit(token);
59
+ }
60
+ }
@@ -1,9 +1,10 @@
1
1
  import { LinkMetadata } from '../../molecules/link/types';
2
2
  import { HeaderMetadata } from '../../organisms/header/types';
3
+
3
4
  export interface SimpleMetadata {
4
- header: HeaderMetadata;
5
- pageTitle: string;
6
- pageDescription: string;
7
- withDivider: boolean;
8
- link?: LinkMetadata;
5
+ header: HeaderMetadata;
6
+ pageTitle: string;
7
+ pageDescription: string;
8
+ withDivider: boolean;
9
+ link?: LinkMetadata;
9
10
  }
@@ -0,0 +1,122 @@
1
+ import { FormControl, ValidatorFn } from '@angular/forms';
2
+ import { ImageMetadata } from './atoms/image/types';
3
+ import { Color } from '@ionic/core';
4
+
5
+ export type ComponentState = 'ENABLED' | 'DISABLED' | 'WORKING' | 'ERROR';
6
+ const ENABLED: ComponentState = 'ENABLED';
7
+ const DISABLED: ComponentState = 'DISABLED';
8
+ const WORKING: ComponentState = 'WORKING';
9
+ const ERROR: ComponentState = 'ERROR';
10
+ export const ComponentStates = { ENABLED, DISABLED, WORKING, ERROR };
11
+
12
+ export enum ActionType {
13
+ BROWSER_NEW_TAB,
14
+ BROWSER_DOWNLOAD,
15
+ NATIVE_DOWNLOAD,
16
+ APP_NAVIGATION,
17
+ BROWSER_NAVIGATION,
18
+ }
19
+
20
+ export type Action = {
21
+ description: string;
22
+ type: ActionType;
23
+ source: string;
24
+ };
25
+
26
+ export enum InputType {
27
+ TEXT,
28
+ EMAIL,
29
+ PASSWORD,
30
+ COMMENT,
31
+ NUMBER,
32
+ PIN_CODE,
33
+ DATE,
34
+ HOUR,
35
+ CHECK,
36
+ RADIO,
37
+ SELECT,
38
+ FILE,
39
+ }
40
+
41
+ export type InputOption = {
42
+ id: string;
43
+ name: string;
44
+ selected?: boolean;
45
+ order: number;
46
+ };
47
+
48
+ export type InputMetadata = {
49
+ control: FormControl;
50
+ token: string;
51
+ label: string;
52
+ name: string;
53
+ hint: string;
54
+ placeholder: string;
55
+ type: InputType;
56
+ order: number;
57
+ validators: ValidatorFn[];
58
+ options?: InputOption[];
59
+ range?: {
60
+ min: number;
61
+ max: number;
62
+ };
63
+ errors: {
64
+ [key: string]: string;
65
+ };
66
+ value?: string;
67
+ };
68
+
69
+ export type FormSection = {
70
+ name: string;
71
+ order: number;
72
+ fields: InputMetadata[];
73
+ };
74
+
75
+ export type FormSubmit = {
76
+ fields: { key: string; value: string }[];
77
+ token?: string;
78
+ };
79
+
80
+ export type FormMetadata = {
81
+ name: string;
82
+ sections: FormSection[];
83
+ actions: ButtonMetadata;
84
+ state: ComponentState;
85
+ };
86
+
87
+ export enum ToolbarActionType {
88
+ AVATAR = 'AVATAR',
89
+ ICON = 'ICON',
90
+ IMAGE = 'IMAGE',
91
+ BUTTON = 'BUTTON',
92
+ }
93
+
94
+ export type ToolbarAction = {
95
+ type: 'AVATAR' | 'ICON' | 'IMAGE' | 'BUTTON';
96
+ token?: string;
97
+ position: 'left' | 'right' | 'center';
98
+ description?: string;
99
+ image?: ImageMetadata;
100
+ };
101
+
102
+ export interface IconMetada {
103
+ name: string;
104
+ slot: 'start' | 'end';
105
+ }
106
+
107
+ export interface ButtonMetadata {
108
+ actionType?: ActionType;
109
+ expand?: 'full' | 'block';
110
+ href?: string;
111
+ target?: '_blank' | '_self' | '_parent' | '_top';
112
+ download?: string;
113
+ color: Color;
114
+ state: ComponentState;
115
+ text: string;
116
+ icon?: IconMetada;
117
+ shape?: 'round';
118
+ size?: 'small' | 'default' | 'large';
119
+ fill?: 'clear' | 'outline' | 'solid' | 'default';
120
+ type: 'button' | 'submit' | 'reset';
121
+ token?: string;
122
+ }
@@ -0,0 +1,58 @@
1
+ import { Injectable } from '@angular/core';
2
+
3
+ @Injectable({
4
+ providedIn: 'root',
5
+ })
6
+ export class DownloadService {
7
+ getFileNameFromUrl(url: string): string {
8
+ try {
9
+ const pathSegments = url.split('/');
10
+ const lastSegment = pathSegments[pathSegments.length - 1];
11
+ const fileName = decodeURIComponent(lastSegment);
12
+ return fileName;
13
+ } catch (error) {
14
+ console.error('Error al obtener nombre de archivo: ', JSON.stringify(error));
15
+ return 'filename';
16
+ }
17
+ }
18
+
19
+ openNewTab(url: string): void {
20
+ if (url) {
21
+ const fileName = this.getFileNameFromUrl(url);
22
+ const link = document.createElement('a');
23
+ link.href = url;
24
+ link.download = fileName;
25
+ link.target = '_blank';
26
+ document.body.appendChild(link);
27
+ link.click();
28
+ document.body.removeChild(link);
29
+ } else {
30
+ console.error('La URL no está definida');
31
+ }
32
+ }
33
+
34
+ downloadLinkFromBrowser(url: string): void {
35
+ console.log('trying to download file from url');
36
+ if (url) {
37
+ fetch(url)
38
+ .then(response => response.blob())
39
+ .then(blob => {
40
+ const url = window.URL.createObjectURL(blob);
41
+ const link = document.createElement('a');
42
+ link.href = url;
43
+
44
+ const fileName = this.getFileNameFromUrl(url);
45
+ link.download = `${+new Date()}-${fileName}`;
46
+ link.target = '_self';
47
+ link.click();
48
+
49
+ window.URL.revokeObjectURL(url);
50
+ })
51
+ .catch(error => {
52
+ console.error('Error al descargar el archivo:', JSON.stringify(error));
53
+ });
54
+ } else {
55
+ console.error('La URL no está definida');
56
+ }
57
+ }
58
+ }