@dropi/ui-components 1.0.12 → 1.0.13

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 (255) hide show
  1. package/README.md +55 -36
  2. package/dist/README.md +58 -38
  3. package/dist/components-source/accordion/accordion-item/accordion-item.component.d.ts +31 -0
  4. package/dist/components-source/accordion/accordion.component.d.ts +26 -0
  5. package/dist/components-source/alert/alert.component.d.ts +32 -0
  6. package/dist/components-source/alert-modal/alert-modal.component.d.ts +78 -0
  7. package/dist/components-source/alert-validation/alert-validation.component.d.ts +21 -0
  8. package/dist/components-source/badge/badge.component.d.ts +12 -0
  9. package/dist/components-source/beta-tag/beta-tag.component.d.ts +5 -0
  10. package/dist/components-source/breadcrumb/breadcrumb.component.d.ts +11 -0
  11. package/dist/components-source/card-product/card-product.component.d.ts +204 -0
  12. package/dist/components-source/card-section/card-section.component.d.ts +31 -0
  13. package/dist/components-source/checkbox-selection-list/checkbox-selection-list.component.d.ts +26 -0
  14. package/dist/components-source/city-selector/city-selector.component.d.ts +17 -0
  15. package/dist/components-source/color-picker/color-picker.component.d.ts +73 -0
  16. package/dist/components-source/confirm-dialog/confirm-dialog.component.d.ts +10 -0
  17. package/dist/components-source/country-flags/country-flags.component.d.ts +12 -0
  18. package/dist/components-source/date-picker/date-picker.component.d.ts +27 -0
  19. package/dist/components-source/date-picker-range/date-picker-range.component.d.ts +26 -0
  20. package/dist/components-source/dropi-avatars/dropi-avatars.component.d.ts +11 -0
  21. package/dist/components-source/dropi-badge/dropi-badge.component.d.ts +29 -0
  22. package/dist/components-source/dropi-banner-external/dropi-banner-external.component.d.ts +19 -0
  23. package/dist/components-source/dropi-breadcrumb/dropi-breadcrumb.component.d.ts +22 -0
  24. package/dist/components-source/dropi-card-checkbox/dropi-card-checkbox.component.d.ts +20 -0
  25. package/dist/components-source/dropi-carousel/dropi-carousel.component.d.ts +52 -0
  26. package/dist/components-source/dropi-checkbox/dropi-checkbox.component.d.ts +11 -0
  27. package/dist/components-source/dropi-chips/dropi-chips.component.d.ts +17 -0
  28. package/dist/components-source/dropi-country-selector/countries.data.d.ts +6 -0
  29. package/dist/components-source/dropi-country-selector/dropi-country-selector.component.d.ts +90 -0
  30. package/dist/components-source/dropi-drawer/dropi-drawer.component.d.ts +20 -0
  31. package/dist/components-source/dropi-dropdown/dropi-dropdown.component.d.ts +20 -0
  32. package/dist/components-source/dropi-favorite-button/dropi-favorite-button.component.d.ts +12 -0
  33. package/dist/components-source/dropi-file-upload/card-view/card-view.component.d.ts +19 -0
  34. package/dist/components-source/dropi-file-upload/drop-zone/drop-zone.component.d.ts +38 -0
  35. package/dist/components-source/dropi-file-upload/dropi-file-upload.component.d.ts +18 -0
  36. package/dist/components-source/dropi-file-upload/file-list/file-list.component.d.ts +39 -0
  37. package/dist/components-source/dropi-file-upload/grid-view/grid-view.component.d.ts +15 -0
  38. package/dist/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.d.ts +20 -0
  39. package/dist/components-source/dropi-image-overlay/dropi-image-overlay.component.d.ts +8 -0
  40. package/dist/components-source/dropi-languages-selector/dropi-languages-selector.component.d.ts +18 -0
  41. package/dist/components-source/dropi-logo/dropi-logo.component.d.ts +12 -0
  42. package/dist/components-source/dropi-modal/dropi-modal.component.d.ts +34 -0
  43. package/dist/components-source/dropi-modal/p-template.directive.d.ts +9 -0
  44. package/dist/components-source/dropi-navbar/dropi-navbar.component.d.ts +20 -0
  45. package/dist/components-source/dropi-paginator/dropi-paginator.component.d.ts +21 -0
  46. package/dist/components-source/dropi-phone-input/dropi-phone-input.component.d.ts +55 -0
  47. package/dist/components-source/dropi-radio-button/dropi-radio-button.component.d.ts +17 -0
  48. package/dist/components-source/dropi-search/dropi-search.component.d.ts +40 -0
  49. package/dist/components-source/dropi-select/dropi-select.component.d.ts +34 -0
  50. package/dist/components-source/dropi-skeleton/dropi-skeleton.component.d.ts +14 -0
  51. package/dist/components-source/dropi-steps/dropi-steps.component.d.ts +64 -0
  52. package/dist/components-source/dropi-switch/dropi-switch.component.d.ts +11 -0
  53. package/dist/components-source/dropi-table/dropi-table.component.d.ts +82 -0
  54. package/dist/components-source/dropi-tag/dropi-tag.component.d.ts +15 -0
  55. package/dist/components-source/dropi-text-area/dropi-text-area.component.d.ts +14 -0
  56. package/dist/components-source/dropi-tooltip/dropi-tooltip.component.d.ts +28 -0
  57. package/dist/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.component.d.ts +16 -0
  58. package/dist/components-source/empty/empty.component.d.ts +9 -0
  59. package/dist/components-source/empty-state/empty-state.component.d.ts +17 -0
  60. package/dist/components-source/file-upload-progress-bar/file-upload-progress-bar.component.d.ts +30 -0
  61. package/dist/components-source/index.d.ts +85 -0
  62. package/dist/components-source/input/input.component.d.ts +33 -0
  63. package/dist/components-source/lottie-loader/lottie-loader.component.d.ts +9 -0
  64. package/dist/components-source/otp-send-code/otp-send-code.component.d.ts +83 -0
  65. package/dist/components-source/radio-selection-list/radio-selection-list.component.d.ts +30 -0
  66. package/dist/components-source/read-more/read-more.component.d.ts +60 -0
  67. package/dist/components-source/sidebar/sidebar.component.d.ts +27 -0
  68. package/dist/components-source/simple-stepper/simple-stepper.component.d.ts +21 -0
  69. package/dist/components-source/spinner/spinner.component.d.ts +9 -0
  70. package/dist/components-source/tabs/tabs.component.d.ts +27 -0
  71. package/dist/components-source/tag-type-product/tag-type-product.component.d.ts +5 -0
  72. package/dist/components-source/toast/toast.component.d.ts +21 -0
  73. package/dist/components-source/toggle/input-toggle.component.d.ts +11 -0
  74. package/dist/components-source/tooltip/tooltip.component.d.ts +15 -0
  75. package/dist/components-source/vertical-steps/vertical-steps.component.d.ts +27 -0
  76. package/dist/esm2022/components-source/accordion/accordion-item/accordion-item.component.mjs +51 -0
  77. package/dist/esm2022/components-source/accordion/accordion.component.mjs +46 -0
  78. package/dist/esm2022/components-source/alert/alert.component.mjs +114 -0
  79. package/dist/esm2022/components-source/alert-modal/alert-modal.component.mjs +247 -0
  80. package/dist/esm2022/components-source/alert-validation/alert-validation.component.mjs +53 -0
  81. package/dist/esm2022/components-source/badge/badge.component.mjs +23 -0
  82. package/dist/esm2022/components-source/beta-tag/beta-tag.component.mjs +11 -0
  83. package/dist/esm2022/components-source/breadcrumb/breadcrumb.component.mjs +26 -0
  84. package/dist/esm2022/components-source/card-product/card-product.component.mjs +534 -0
  85. package/dist/esm2022/components-source/card-section/card-section.component.mjs +91 -0
  86. package/dist/esm2022/components-source/checkbox-selection-list/checkbox-selection-list.component.mjs +79 -0
  87. package/dist/esm2022/components-source/city-selector/city-selector.component.mjs +53 -0
  88. package/dist/esm2022/components-source/color-picker/color-picker.component.mjs +320 -0
  89. package/dist/esm2022/components-source/confirm-dialog/confirm-dialog.component.mjs +27 -0
  90. package/dist/esm2022/components-source/country-flags/country-flags.component.mjs +27 -0
  91. package/dist/esm2022/components-source/date-picker/date-picker.component.mjs +73 -0
  92. package/dist/esm2022/components-source/date-picker-range/date-picker-range.component.mjs +67 -0
  93. package/dist/esm2022/components-source/dropi-avatars/dropi-avatars.component.mjs +31 -0
  94. package/dist/esm2022/components-source/dropi-badge/dropi-badge.component.mjs +45 -0
  95. package/dist/esm2022/components-source/dropi-banner-external/dropi-banner-external.component.mjs +39 -0
  96. package/dist/esm2022/components-source/dropi-breadcrumb/dropi-breadcrumb.component.mjs +45 -0
  97. package/dist/esm2022/components-source/dropi-card-checkbox/dropi-card-checkbox.component.mjs +53 -0
  98. package/dist/esm2022/components-source/dropi-carousel/dropi-carousel.component.mjs +243 -0
  99. package/dist/esm2022/components-source/dropi-checkbox/dropi-checkbox.component.mjs +31 -0
  100. package/dist/esm2022/components-source/dropi-chips/dropi-chips.component.mjs +38 -0
  101. package/dist/esm2022/components-source/dropi-country-selector/countries.data.mjs +254 -0
  102. package/dist/esm2022/components-source/dropi-country-selector/dropi-country-selector.component.mjs +183 -0
  103. package/dist/esm2022/components-source/dropi-drawer/dropi-drawer.component.mjs +69 -0
  104. package/dist/esm2022/components-source/dropi-dropdown/dropi-dropdown.component.mjs +59 -0
  105. package/dist/esm2022/components-source/dropi-favorite-button/dropi-favorite-button.component.mjs +33 -0
  106. package/dist/esm2022/components-source/dropi-file-upload/card-view/card-view.component.mjs +47 -0
  107. package/dist/esm2022/components-source/dropi-file-upload/drop-zone/drop-zone.component.mjs +115 -0
  108. package/dist/esm2022/components-source/dropi-file-upload/dropi-file-upload.component.mjs +66 -0
  109. package/dist/esm2022/components-source/dropi-file-upload/file-list/file-list.component.mjs +95 -0
  110. package/dist/esm2022/components-source/dropi-file-upload/grid-view/grid-view.component.mjs +37 -0
  111. package/dist/esm2022/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.mjs +59 -0
  112. package/dist/esm2022/components-source/dropi-image-overlay/dropi-image-overlay.component.mjs +31 -0
  113. package/dist/esm2022/components-source/dropi-languages-selector/dropi-languages-selector.component.mjs +38 -0
  114. package/dist/esm2022/components-source/dropi-logo/dropi-logo.component.mjs +27 -0
  115. package/dist/esm2022/components-source/dropi-modal/dropi-modal.component.mjs +92 -0
  116. package/dist/esm2022/components-source/dropi-modal/p-template.directive.mjs +22 -0
  117. package/dist/esm2022/components-source/dropi-navbar/dropi-navbar.component.mjs +51 -0
  118. package/dist/esm2022/components-source/dropi-paginator/dropi-paginator.component.mjs +89 -0
  119. package/dist/esm2022/components-source/dropi-phone-input/dropi-phone-input.component.mjs +155 -0
  120. package/dist/esm2022/components-source/dropi-radio-button/dropi-radio-button.component.mjs +48 -0
  121. package/dist/esm2022/components-source/dropi-search/dropi-search.component.mjs +104 -0
  122. package/dist/esm2022/components-source/dropi-select/dropi-select.component.mjs +96 -0
  123. package/dist/esm2022/components-source/dropi-skeleton/dropi-skeleton.component.mjs +39 -0
  124. package/dist/esm2022/components-source/dropi-steps/dropi-steps.component.mjs +97 -0
  125. package/dist/esm2022/components-source/dropi-switch/dropi-switch.component.mjs +22 -0
  126. package/dist/esm2022/components-source/dropi-table/dropi-table.component.mjs +333 -0
  127. package/dist/esm2022/components-source/dropi-tag/dropi-tag.component.mjs +36 -0
  128. package/dist/esm2022/components-source/dropi-text-area/dropi-text-area.component.mjs +53 -0
  129. package/dist/esm2022/components-source/dropi-tooltip/dropi-tooltip.component.mjs +78 -0
  130. package/dist/esm2022/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.component.mjs +46 -0
  131. package/dist/esm2022/components-source/empty/empty.component.mjs +18 -0
  132. package/dist/esm2022/components-source/empty-state/empty-state.component.mjs +62 -0
  133. package/dist/esm2022/components-source/file-upload-progress-bar/file-upload-progress-bar.component.mjs +91 -0
  134. package/dist/esm2022/components-source/index.mjs +107 -0
  135. package/dist/esm2022/components-source/input/input.component.mjs +104 -0
  136. package/dist/esm2022/components-source/lottie-loader/lottie-loader.component.mjs +25 -0
  137. package/dist/esm2022/components-source/otp-send-code/otp-send-code.component.mjs +201 -0
  138. package/dist/esm2022/components-source/radio-selection-list/radio-selection-list.component.mjs +89 -0
  139. package/dist/esm2022/components-source/read-more/read-more.component.mjs +91 -0
  140. package/dist/esm2022/components-source/sidebar/sidebar.component.mjs +88 -0
  141. package/dist/esm2022/components-source/simple-stepper/simple-stepper.component.mjs +60 -0
  142. package/dist/esm2022/components-source/spinner/spinner.component.mjs +19 -0
  143. package/dist/esm2022/components-source/tabs/tabs.component.mjs +83 -0
  144. package/dist/esm2022/components-source/tag-type-product/tag-type-product.component.mjs +11 -0
  145. package/dist/esm2022/components-source/toast/toast.component.mjs +47 -0
  146. package/dist/esm2022/components-source/toggle/input-toggle.component.mjs +36 -0
  147. package/dist/esm2022/components-source/tooltip/tooltip.component.mjs +34 -0
  148. package/dist/esm2022/components-source/vertical-steps/vertical-steps.component.mjs +75 -0
  149. package/dist/esm2022/lib/elements-registry.mjs +343 -2
  150. package/dist/esm2022/utilities/interfaces/ui/dropi-table.interface.mjs +2 -0
  151. package/dist/esm2022/utilities/interfaces/ui/input-interface.mjs +2 -0
  152. package/dist/esm2022/utilities/interfaces/ui/select-interface.mjs +2 -0
  153. package/dist/esm2022/utilities/interfaces/ui/selection-list-interface.mjs +2 -0
  154. package/dist/esm2022/utilities/interfaces/ui/upload.model.mjs +5 -0
  155. package/dist/fesm2022/dropi-ui-components.mjs +5913 -2
  156. package/dist/fesm2022/dropi-ui-components.mjs.map +1 -1
  157. package/dist/utilities/interfaces/ui/dropi-table.interface.d.ts +45 -0
  158. package/dist/utilities/interfaces/ui/input-interface.d.ts +33 -0
  159. package/dist/utilities/interfaces/ui/select-interface.d.ts +8 -0
  160. package/dist/utilities/interfaces/ui/selection-list-interface.d.ts +24 -0
  161. package/dist/utilities/interfaces/ui/upload.model.d.ts +30 -0
  162. package/package.json +18 -6
  163. package/src/components-source/alert/alert.component.ts +12 -129
  164. package/src/components-source/alert-modal/alert-modal.component.ts +84 -114
  165. package/src/components-source/alert-validation/alert-validation.component.html +8 -0
  166. package/src/components-source/alert-validation/alert-validation.component.scss +225 -0
  167. package/src/components-source/alert-validation/alert-validation.component.ts +43 -0
  168. package/src/components-source/beta-tag/beta-tag.component.html +1 -0
  169. package/src/components-source/beta-tag/beta-tag.component.scss +26 -0
  170. package/src/components-source/beta-tag/beta-tag.component.ts +11 -0
  171. package/src/components-source/breadcrumb/breadcrumb.component.html +13 -5
  172. package/src/components-source/breadcrumb/breadcrumb.component.scss +8 -1
  173. package/src/components-source/breadcrumb/breadcrumb.component.spec.ts +26 -26
  174. package/src/components-source/breadcrumb/breadcrumb.component.ts +10 -12
  175. package/src/components-source/card-product/card-product.component.spec.ts +9 -9
  176. package/src/components-source/card-product/card-product.component.stories.ts +2 -2
  177. package/src/components-source/card-product/card-product.component.ts +294 -818
  178. package/src/components-source/card-section/card-section.component.html +7 -7
  179. package/src/components-source/card-section/card-section.component.ts +41 -15
  180. package/src/components-source/checkbox-selection-list/checkbox-selection-list.component.ts +42 -179
  181. package/src/components-source/city-selector/city-selector.component.ts +37 -137
  182. package/src/components-source/confirm-dialog/confirm-dialog.component.html +26 -0
  183. package/src/components-source/confirm-dialog/confirm-dialog.component.scss +55 -0
  184. package/src/components-source/confirm-dialog/confirm-dialog.component.ts +22 -0
  185. package/src/components-source/country-flags/country-flags.component.ts +20 -12
  186. package/src/components-source/date-picker/date-picker.component.ts +32 -292
  187. package/src/components-source/date-picker-range/date-picker-range.component.html +15 -7
  188. package/src/components-source/date-picker-range/date-picker-range.component.ts +42 -235
  189. package/src/components-source/dropi-banner-external/dropi-banner-external.component.ts +24 -185
  190. package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.html +21 -21
  191. package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.spec.ts +9 -9
  192. package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.ts +41 -23
  193. package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.stories.ts +12 -12
  194. package/src/components-source/dropi-chips/dropi-chips.component.ts +22 -87
  195. package/src/components-source/dropi-country-selector/countries.data.ts +256 -236
  196. package/src/components-source/dropi-country-selector/dropi-country-selector.component.ts +37 -25
  197. package/src/components-source/dropi-drawer/dropi-drawer.component.ts +91 -78
  198. package/src/components-source/dropi-dropdown/dropi-dropdown.component.ts +44 -47
  199. package/src/components-source/dropi-file-upload/card-view/card-view.component.ts +33 -53
  200. package/src/components-source/dropi-file-upload/drop-zone/drop-zone.component.ts +52 -123
  201. package/src/components-source/dropi-file-upload/dropi-file-upload.component.ts +38 -294
  202. package/src/components-source/dropi-file-upload/file-list/file-list.component.ts +62 -43
  203. package/src/components-source/dropi-file-upload/grid-view/grid-view.component.ts +23 -22
  204. package/src/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.scss +6 -2
  205. package/src/components-source/dropi-image-overlay/dropi-image-overlay.component.ts +16 -71
  206. package/src/components-source/dropi-modal/dropi-modal.component.ts +56 -372
  207. package/src/components-source/dropi-navbar/dropi-navbar.component.ts +17 -17
  208. package/src/components-source/dropi-paginator/dropi-paginator.component.html +18 -7
  209. package/src/components-source/dropi-paginator/dropi-paginator.component.ts +40 -32
  210. package/src/components-source/dropi-phone-input/dropi-phone-input.component.html +78 -79
  211. package/src/components-source/dropi-phone-input/dropi-phone-input.component.ts +29 -85
  212. package/src/components-source/dropi-search/dropi-search.component.ts +59 -222
  213. package/src/components-source/dropi-select/dropi-select.component.html +82 -131
  214. package/src/components-source/dropi-select/dropi-select.component.ts +60 -423
  215. package/src/components-source/dropi-table/dropi-table.component.html +40 -23
  216. package/src/components-source/dropi-table/dropi-table.component.ts +130 -374
  217. package/src/components-source/dropi-tag/dropi-tag.component.ts +20 -90
  218. package/src/components-source/dropi-text-area/dropi-text-area.component.ts +22 -48
  219. package/src/components-source/dropi-tooltip/dropi-tooltip.component.ts +40 -129
  220. package/src/components-source/empty/empty.component.html +3 -0
  221. package/src/components-source/empty/empty.component.scss +0 -0
  222. package/src/components-source/empty/empty.component.ts +16 -0
  223. package/src/components-source/empty-state/empty-state.component.ts +47 -19
  224. package/src/components-source/index.ts +82 -37
  225. package/src/components-source/input/input.component.html +79 -63
  226. package/src/components-source/input/input.component.ts +51 -97
  227. package/src/components-source/lottie-loader/lottie-loader.component.ts +13 -16
  228. package/src/components-source/otp-send-code/otp-send-code.component.ts +60 -528
  229. package/src/components-source/radio-selection-list/radio-selection-list.component.ts +36 -97
  230. package/src/components-source/sidebar/sidebar.component.spec.ts +11 -11
  231. package/src/components-source/sidebar/sidebar.component.stories.ts +3 -3
  232. package/src/components-source/sidebar/sidebar.component.ts +51 -47
  233. package/src/components-source/simple-stepper/simple-stepper.component.ts +20 -35
  234. package/src/components-source/spinner/spinner.component.html +6 -0
  235. package/src/components-source/spinner/spinner.component.scss +15 -0
  236. package/src/components-source/spinner/spinner.component.ts +17 -0
  237. package/src/components-source/tabs/tabs.component.spec.ts +8 -8
  238. package/src/components-source/tabs/tabs.component.stories.ts +5 -5
  239. package/src/components-source/tabs/tabs.component.ts +41 -83
  240. package/src/components-source/toast/toast.component.ts +40 -46
  241. package/src/components-source/toggle/input-toggle.component.html +34 -0
  242. package/src/components-source/toggle/input-toggle.component.scss +0 -0
  243. package/src/components-source/toggle/input-toggle.component.ts +27 -0
  244. package/src/components-source/toggle/inputToggleConfig.ts +11 -0
  245. package/src/components-source/tooltip/tooltip.component.html +22 -11
  246. package/src/components-source/tooltip/tooltip.component.ts +28 -13
  247. package/src/components-source/vertical-steps/vertical-steps.component.ts +16 -78
  248. package/src/lib/elements-registry.ts +413 -1
  249. package/src/lib/router-stub.ts +7 -0
  250. package/src/libreria work space.code-workspace +11 -8
  251. package/src/utilities/interfaces/ui/dropi-table.interface.ts +60 -0
  252. package/src/utilities/interfaces/ui/input-interface.ts +34 -0
  253. package/src/utilities/interfaces/ui/select-interface.ts +8 -0
  254. package/src/utilities/interfaces/ui/selection-list-interface.ts +15 -0
  255. package/src/utilities/interfaces/ui/upload.model.ts +41 -0
@@ -1,254 +1,61 @@
1
1
  import {
2
2
  Component,
3
- OnInit,
4
- forwardRef,
5
3
  Input,
6
4
  Output,
7
5
  EventEmitter,
8
- OnChanges,
9
- SimpleChanges,
10
- Renderer2,
11
- } from '@angular/core';
12
- import { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
13
- import { ButtonModule } from 'primeng/button';
14
- import { SharedModule } from 'primeng/api';
15
- import { CalendarModule } from 'primeng/calendar';
16
- import { NgIf, NgClass, NgFor } from '@angular/common';
17
- import { TranslateModule } from '@ngx-translate/core';
6
+ OnInit,
7
+ CUSTOM_ELEMENTS_SCHEMA,
8
+ } from "@angular/core";
9
+ import { CommonModule } from "@angular/common";
10
+ import { FormsModule, ReactiveFormsModule } from "@angular/forms";
11
+ import { TranslateModule } from "@ngx-translate/core";
18
12
 
19
13
  @Component({
20
- selector: 'app-date-picker-range',
21
- templateUrl: './date-picker-range.component.html',
22
- styleUrls: ['./date-picker-range.component.scss'],
23
- providers: [
24
- {
25
- provide: NG_VALUE_ACCESSOR,
26
- useExisting: forwardRef(() => DatePickerRangeComponent),
27
- multi: true,
28
- },
29
- ],
14
+ selector: "app-date-picker-range",
30
15
  standalone: true,
31
- imports: [
32
- NgIf,
33
- NgClass,
34
- CalendarModule,
35
- FormsModule,
36
- SharedModule,
37
- NgFor,
38
- ButtonModule,
39
- TranslateModule,
40
- ],
16
+ imports: [CommonModule, FormsModule, ReactiveFormsModule, TranslateModule],
17
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
18
+ templateUrl: "./date-picker-range.component.html",
19
+ styleUrls: ["./date-picker-range.component.scss"],
41
20
  })
42
- export class DatePickerRangeComponent implements OnInit, OnChanges, ControlValueAccessor {
43
- @Input() startDate: string;
44
- @Input() showLabel: boolean = true;
45
- @Input() placeholder: string = '';
46
- @Input() endDate: string;
47
- @Input() limit: number = 0;
48
- @Input() minDateLimit: string;
49
- @Input() maxDateLimit: string;
50
- @Input() loading: boolean = false;
51
- @Input() setRight: boolean = false;
52
- @Input() maxDaysRange: number = 0;
53
- @Input() appendTo: string = '';
54
-
55
- @Output() startDateChange = new EventEmitter<Date>();
56
- @Output() endDateChange = new EventEmitter<Date>();
57
-
58
- viewRangeWarning: boolean = false;
59
-
60
- CalendarTypeView: 'date' | 'month' | 'year' | null = null;
61
- isDateView = true;
62
- dateRange: Date[] | undefined;
63
- ranges: any[];
64
- locale: any;
65
- activeRangeIndex: number | null = null;
66
- maxDate: Date;
67
- minDate: Date;
68
-
69
- onChange: any = () => {};
70
- onTouch: any = () => {};
71
-
72
- constructor(private renderer: Renderer2) {
73
- this.ranges = [
74
- { label: 'today range', value: [new Date(), new Date()] },
75
- {
76
- label: 'last 7 days',
77
- value: [new Date(new Date().setDate(new Date().getDate() - 6)), new Date()],
78
- },
79
- {
80
- label: 'last 30 days',
81
- value: [new Date(new Date().setDate(new Date().getDate() - 29)), new Date()],
82
- },
83
- {
84
- label: 'last 90 days',
85
- value: [new Date(new Date().setDate(new Date().getDate() - 89)), new Date()],
86
- },
87
- ];
88
-
89
- this.locale = {
90
- firstDayOfWeek: 1,
91
- dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
92
- dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'],
93
- dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'],
94
- monthNames: [
95
- 'Enero',
96
- 'Febrero',
97
- 'Marzo',
98
- 'Abril',
99
- 'Mayo',
100
- 'Junio',
101
- 'Julio',
102
- 'Agosto',
103
- 'Septiembre',
104
- 'Octubre',
105
- 'Noviembre',
106
- 'Diciembre',
107
- ],
108
- monthNamesShort: [
109
- 'Ene',
110
- 'Feb',
111
- 'Mar',
112
- 'Abr',
113
- 'May',
114
- 'Jun',
115
- 'Jul',
116
- 'Ago',
117
- 'Sep',
118
- 'Oct',
119
- 'Nov',
120
- 'Dic',
121
- ],
122
- today: 'Hoy',
123
- clear: 'Borrar',
124
- };
125
- }
126
-
127
- ngOnInit() {
128
- this.updateDateRange();
129
- this.updateDateLimits();
130
- }
131
-
132
- ngOnChanges(changes: SimpleChanges) {
133
- if (changes['startDate'] || changes['endDate']) {
134
- if (this.maxDaysRange !== 0 && this.dateRange!) {
135
- if (this.dateRange.length === 2) {
136
- const [startDate, endDate] = this.dateRange;
137
- if (startDate! && endDate!) {
138
- const timeDifference = Math.abs(endDate.getTime() - startDate.getTime());
139
- const dayDifference = timeDifference / (1000 * 3600 * 24);
140
- if (dayDifference > this.maxDaysRange) {
141
- this.viewRangeWarning = true;
142
- } else {
143
- this.viewRangeWarning = false;
144
- }
145
- }
146
- }
147
- }
148
- this.updateDateRange();
149
- }
150
- if (changes['limit'] || changes['minDateLimit'] || changes['maxDateLimit']) {
151
- this.updateDateLimits();
152
- }
153
- }
154
-
155
- updateDateRange() {
156
- if (this.startDate && this.endDate) {
157
- this.dateRange = [new Date(this.startDate), new Date(this.endDate)];
158
- this.checkActiveRange();
159
- }
160
- }
161
-
162
- updateDateLimits() {
163
- const today = new Date();
164
- today.setHours(0, 0, 0, 0);
165
-
166
- if (this.limit === 0) {
167
- this.maxDate = today;
168
- } else {
169
- this.maxDate = new Date(today.setDate(today.getDate() + this.limit));
170
- }
171
-
172
- if (this.minDateLimit) {
173
- this.minDate = new Date(this.minDateLimit);
174
- }
175
-
176
- if (this.maxDateLimit) {
177
- const maxDateFromLimit = new Date(this.maxDateLimit);
178
- if (maxDateFromLimit < this.maxDate) {
179
- this.maxDate = maxDateFromLimit;
180
- }
181
- }
182
- }
183
-
184
- writeValue(value: any): void {
185
- if (value) {
186
- this.dateRange = value;
187
- this.checkActiveRange();
188
- }
189
- }
190
-
191
- registerOnChange(fn: any): void {
192
- this.onChange = fn;
193
- }
194
-
195
- registerOnTouched(fn: any): void {
196
- this.onTouch = fn;
197
- }
198
-
199
- onSelect(event: any) {
21
+ export class DatePickerRangeComponent implements OnInit {
22
+ @Input() public setRight: boolean = false;
23
+ @Input() public loading: boolean = false;
24
+ @Input() public showLabel: boolean = true;
25
+ @Input() public placeholder: string = "";
26
+ @Input() public appendTo: string = "body";
27
+ @Input() public maxDate: any;
28
+ @Input() public minDate: any;
29
+
30
+ public dateRange: any[] = [];
31
+ public CalendarTypeView: string | null = null;
32
+ public ranges: any[] = [
33
+ { label: "today", value: [new Date(), new Date()] },
34
+ { label: "last 7 days", value: [new Date(), new Date()] },
35
+ ];
36
+ public activeRangeIndex: number | null = null;
37
+ public viewRangeWarning: boolean = false;
38
+ public calendar: any; // Para el template variable
39
+
40
+ @Output() public startDateChange = new EventEmitter<any>();
41
+ @Output() public endDateChange = new EventEmitter<any>();
42
+
43
+ constructor() {}
44
+
45
+ ngOnInit(): void {}
46
+
47
+ public onSelect(event: any): void {
200
48
  if (this.dateRange && this.dateRange.length === 2) {
201
49
  this.startDateChange.emit(this.dateRange[0]);
202
50
  this.endDateChange.emit(this.dateRange[1]);
203
51
  }
204
- this.onChange(this.dateRange);
205
- this.onTouch();
206
- this.checkActiveRange();
207
52
  }
208
53
 
209
- selectRange(range: any, index: number) {
54
+ public checkCalendarView(calendar: any): void {}
55
+
56
+ public selectRange(range: any, index: number): void {
210
57
  this.dateRange = range.value;
211
- this.startDateChange.emit(this.dateRange[0]);
212
- this.endDateChange.emit(this.dateRange[1]);
213
- this.onChange(this.dateRange);
214
- this.onTouch();
215
58
  this.activeRangeIndex = index;
216
- }
217
-
218
- checkActiveRange() {
219
- if (
220
- !this.dateRange ||
221
- this.dateRange.length !== 2 ||
222
- !this.dateRange[0] ||
223
- !this.dateRange[1]
224
- ) {
225
- this.activeRangeIndex = null;
226
- return;
227
- }
228
-
229
- const start = this.dateRange[0] instanceof Date ? this.dateRange[0].setHours(0, 0, 0, 0) : null;
230
- const end = this.dateRange[1] instanceof Date ? this.dateRange[1].setHours(0, 0, 0, 0) : null;
231
-
232
- this.activeRangeIndex = this.ranges.findIndex((range) => {
233
- const rangeStart = range.value[0].setHours(0, 0, 0, 0);
234
- const rangeEnd = range.value[1].setHours(0, 0, 0, 0);
235
- return start === rangeStart && end === rangeEnd;
236
- });
237
- }
238
-
239
- checkCalendarView(calendar: any) {
240
- alert(this.isDateView);
241
- // Verifica si el componente está en la vista de selección de día, mes o año
242
- const isMonthOrYearView =
243
- calendar.overlay?.querySelector('.p-datepicker-monthpicker') ||
244
- calendar.overlay?.querySelector('.p-datepicker-yearpicker');
245
- this.isDateView = !isMonthOrYearView;
246
-
247
- console.log(this.CalendarTypeView);
248
- }
249
-
250
- showCalendar() {
251
- const input = this.renderer.selectRootElement('#date-range', true);
252
- input.click();
59
+ this.onSelect(null);
253
60
  }
254
61
  }
@@ -2,203 +2,42 @@ import {
2
2
  Component,
3
3
  Input,
4
4
  OnInit,
5
- Output,
6
- EventEmitter,
7
- OnChanges,
8
- SimpleChanges,
9
- } from '@angular/core';
10
- import { CommonModule } from '@angular/common';
11
- import { forkJoin, of } from 'rxjs';
12
-
13
- import { WordpressDropiService } from 'src/app/services/wordpress-dropi.service';
14
- import { IconComponent } from '../icon/icon.component';
15
- import { BettaTesterService } from '@app/services/betta-tester.service';
5
+ Inject,
6
+ CUSTOM_ELEMENTS_SCHEMA,
7
+ } from "@angular/core";
8
+ import { CommonModule } from "@angular/common";
16
9
 
17
10
  @Component({
18
- selector: 'app-dropi-banner-external',
11
+ selector: "app-dropi-banner-external",
19
12
  standalone: true,
20
- imports: [CommonModule, IconComponent],
21
- templateUrl: './dropi-banner-external.component.html',
22
- styleUrls: ['./dropi-banner-external.component.scss'],
13
+ imports: [CommonModule],
14
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
15
+ templateUrl: "./dropi-banner-external.component.html",
16
+ styleUrls: ["./dropi-banner-external.component.scss"],
23
17
  })
24
- export class DropiBannerExternalComponent implements OnInit, OnChanges {
25
- banners: any[] = [];
26
- @Input() slugName!: string; // slug requerido
27
- @Output() bannerClick = new EventEmitter<any>();
28
- @Output() isVisible = new EventEmitter<boolean>();
29
- /**
30
- * Si es true: se muestra para TODAS las marcas (Dropi y white label).
31
- * Si es false: SOLO se muestra para la marca Dropi.
32
- */
33
- @Input() viewOnWhiteBrand: boolean = false;
34
- /**
35
- * Lista de países (nombre) donde se permite mostrar el banner.
36
- * Si está vacío o undefined => se muestra en TODOS los países.
37
- * Si tiene valores => se muestra solo si el país actual está en la lista (usando viewOnlyCountry()).
38
- */
39
- @Input() viewOnlyCountries: string[] = [];
40
-
41
- banner: any | null = null; // banner seleccionado
42
- hasLink = false;
43
- loading = false;
44
- error: string | null = null;
45
- imageUrls: { large?: string; medium?: string; tablet?: string; mobile?: string } = {};
46
- backgroundColor = 'transparent';
18
+ export class DropiBannerExternalComponent implements OnInit {
19
+ public imageUrls: any = { large: "", medium: "", tablet: "", mobile: "" };
20
+ public banner: any = { title: { rendered: "" }, acf: { slug: "" } };
21
+ public loading: boolean = false;
22
+ public backgroundColor: string = "transparent";
23
+ public hasLink: boolean = false;
47
24
 
48
25
  constructor(
49
- private wordpressService: WordpressDropiService,
50
- private bettaTesterService: BettaTesterService,
26
+ @Inject("WordpressService") private wordpressService: any,
27
+ @Inject("BettaTesterService") private bettaTesterService: any,
51
28
  ) {}
52
29
 
53
- ngOnInit(): void {
54
- if (this.slugName) {
55
- this.loadBanners();
56
- }
57
- }
58
-
59
- ngOnChanges(changes: SimpleChanges): void {
60
- if (changes['slugName'] && !changes['slugName'].firstChange) {
61
- this.loadBanners();
62
- }
63
- }
64
-
65
- private setInvisible(reason?: string) {
66
- if (reason) {
67
- console.debug('[DropiBannerExternal] No visible:', reason);
68
- }
69
- this.banner = null;
70
- this.hasLink = false;
71
- this.isVisible.emit(false);
72
- }
30
+ ngOnInit(): void {}
73
31
 
74
- /**
75
- * Reglas solicitadas:
76
- * - viewOnWhiteBrand = false => solo Dropi
77
- * - viewOnWhiteBrand = true => todas las marcas
78
- * Se asegura invocar isDropiBrand() antes de cualquier otra validación.
79
- */
80
- private canShowForCurrentBrand(isDropi: boolean): boolean {
81
- if (this.viewOnWhiteBrand) return true; // mostrar a todos
82
- return isDropi; // restringido a Dropi
32
+ public getImageFallback(): string {
33
+ return "";
83
34
  }
84
35
 
85
- /**
86
- * Validación por país:
87
- * - Si viewOnlyCountries está vacío => permitir todos.
88
- * - Si tiene elementos => usar bettaTesterService.viewOnlyCountry(viewOnlyCountries)
89
- */
90
- private canShowForCurrentCountry(): boolean {
91
- if (!this.viewOnlyCountries || this.viewOnlyCountries.length === 0) return true;
92
- try {
93
- return this.bettaTesterService.viewOnlyCountry(this.viewOnlyCountries);
94
- } catch (e) {
95
- console.warn('[DropiBannerExternal] Error al validar país', e);
96
- return false;
97
- }
36
+ public getActionLink(): string {
37
+ return "#";
98
38
  }
99
39
 
100
- loadBanners(): void {
101
- this.loading = true;
102
- this.error = null;
103
- this.setInvisible(); // reset inicial
40
+ public onClickBanner(event: any): void {}
104
41
 
105
- // Aseguramos llamada temprana (puede tener efectos secundarios internos)
106
- const isDropi = this.bettaTesterService.isDropiBrand();
107
-
108
- // Validar marca
109
- if (!this.canShowForCurrentBrand(isDropi)) {
110
- this.setInvisible('Solo visible para marca Dropi');
111
- this.loading = false;
112
- return;
113
- }
114
-
115
- // Validar país
116
- if (!this.canShowForCurrentCountry()) {
117
- this.setInvisible('País no permitido para este banner');
118
- this.loading = false;
119
- return;
120
- }
121
-
122
- this.wordpressService.getBanners(this.slugName).subscribe(
123
- (data) => {
124
- this.banners = Array.isArray(data) ? data : [];
125
- const banner = this.banners.find((b: any) => b?.acf && b.acf.slug === this.slugName);
126
-
127
- if (!banner) {
128
- this.setInvisible('No se encontró banner con ese slug');
129
- this.loading = false;
130
- return;
131
- }
132
- if (!banner.acf?.estado) {
133
- this.setInvisible('Banner con estado=false');
134
- this.loading = false;
135
- return;
136
- }
137
-
138
- this.banner = banner;
139
- this.hasLink = !!this.extractLink();
140
- this.backgroundColor = this.banner.acf?.background || 'transparent';
141
- this.resolveImages();
142
- this.isVisible.emit(true);
143
- this.loading = false;
144
- },
145
- (error) => {
146
- console.error('Error al cargar los banners:', error);
147
- this.error = 'Error al cargar los banners';
148
- this.setInvisible('Error de carga');
149
- this.loading = false;
150
- },
151
- );
152
- }
153
-
154
- private resolveImages() {
155
- if (!this.banner?.acf) return;
156
- const sizes: Array<keyof typeof this.imageUrls> = ['large', 'medium', 'tablet', 'mobile'];
157
- const calls: { [k: string]: any } = {};
158
- sizes.forEach((size) => {
159
- const val = this.banner.acf[size];
160
- if (!val) return;
161
- if (typeof val === 'number') {
162
- calls[size] = this.wordpressService.getImageUrl(val);
163
- } else if (typeof val === 'string') {
164
- calls[size] = of(val);
165
- }
166
- });
167
- if (Object.keys(calls).length === 0) return;
168
- forkJoin(calls).subscribe((res: any) => {
169
- this.imageUrls = res;
170
- });
171
- }
172
-
173
- private extractLink(): string | null {
174
- const link = this.banner?.acf?.link_de_la_accion;
175
- if (!link) return null;
176
- if (typeof link === 'string') return link;
177
- if (typeof link === 'object') return link.url || null;
178
- return null;
179
- }
180
-
181
- getActionLink(): string | null {
182
- return this.extractLink();
183
- }
184
-
185
- onClickBanner(event: Event): void {
186
- if (!this.banner) return;
187
- if (!this.hasLink) {
188
- event.preventDefault();
189
- this.bannerClick.emit(this.banner);
190
- }
191
- }
192
-
193
- getImageFallback(): string {
194
- if (!this.banner?.acf) return '';
195
- const { mobile, tablet, medium, large } = this.imageUrls;
196
- return mobile || tablet || medium || large || '';
197
- }
198
-
199
- closeBanner() {
200
- this.setInvisible('Cerrado por usuario');
201
- this.isVisible.emit(false);
202
- this.loading = false;
203
- }
42
+ public closeBanner(): void {}
204
43
  }
@@ -2,8 +2,17 @@
2
2
  <div class="crumb-list">
3
3
  <!-- HOME: solo ícono -->
4
4
  <div class="crumb-home">
5
- <a [routerLink]="homeRoute" class="home-link" aria-label="Inicio">
6
- <app-icon [name]="homeIconName" width="16px" color="Gray-Gray-500"></app-icon>
5
+ <a
6
+ (click)="navigate(null, true)"
7
+ class="home-link"
8
+ aria-label="Inicio"
9
+ style="cursor: pointer"
10
+ >
11
+ <app-icon
12
+ [name]="homeIconName"
13
+ width="16px"
14
+ color="Gray-Gray-500"
15
+ ></app-icon>
7
16
  </a>
8
17
 
9
18
  <app-icon
@@ -18,39 +27,30 @@
18
27
  <div *ngFor="let it of items; let last = last" class="crumb">
19
28
  <!-- Si NO es el último (o sí, pero queremos que sea clicable) -->
20
29
  <ng-container *ngIf="!last || lastItemClickable; else current">
21
- <!-- Interno con RouterLink -->
30
+ <!-- Interno con Navegación -->
22
31
  <a
23
- *ngIf="it.routerLink; else maybeExternal"
24
- [routerLink]="it.routerLink"
25
- [queryParams]="it.queryParams || null"
26
- [fragment]="it.fragment || null"
32
+ *ngIf="it.command || it.url; else plain"
33
+ (click)="navigate(it)"
27
34
  [class.disabled]="it.disabled"
28
35
  class="crumb-link Body-S-Regular"
36
+ style="cursor: pointer"
29
37
  >
30
38
  {{ it.label | translate }}
31
39
  </a>
32
40
 
33
- <!-- Enlace externo (opcional) -->
34
- <ng-template #maybeExternal>
35
- <a
36
- class="crumb-link Body-S-Regular"
37
- *ngIf="it.url; else plain"
38
- [href]="it.url"
39
- [class.disabled]="it.disabled"
40
- >
41
- {{ it.label | translate }}
42
- </a>
43
- </ng-template>
44
-
45
41
  <!-- Sin destino / deshabilitado -->
46
42
  <ng-template #plain>
47
- <span class="disabled Body-S-Regular">{{ it.label | translate }}</span>
43
+ <span class="disabled Body-S-Regular">{{
44
+ it.label | translate
45
+ }}</span>
48
46
  </ng-template>
49
47
  </ng-container>
50
48
 
51
49
  <!-- Último como “actual” por defecto -->
52
50
  <ng-template #current>
53
- <span class="current Body-S-Regular" aria-current="page">{{ it.label | translate }}</span>
51
+ <span class="current Body-S-Regular" aria-current="page">{{
52
+ it.label | translate
53
+ }}</span>
54
54
  </ng-template>
55
55
 
56
56
  <app-icon
@@ -1,5 +1,5 @@
1
1
  import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { RouterTestingModule } from '@angular/router/testing';
2
+ import { anyTestingModule } from ' /testing';
3
3
  import { DropiBreadcrumbComponent, BreadcrumbItem } from './dropi-breadcrumb.component';
4
4
  import { IconComponent } from '../icon/icon.component';
5
5
  import { TranslateModule } from '@ngx-translate/core';
@@ -15,7 +15,7 @@ describe('DropiBreadcrumbComponent', () => {
15
15
  imports: [
16
16
  DropiBreadcrumbComponent,
17
17
  IconComponent,
18
- RouterTestingModule,
18
+ anyTestingModule,
19
19
  TranslateModule.forRoot(),
20
20
  ],
21
21
  providers: [{ provide: DomSanitizer, useValue: mockDomSanitizer }],
@@ -53,18 +53,18 @@ describe('DropiBreadcrumbComponent', () => {
53
53
  expect(component.items[0].label).toBe('Home');
54
54
  });
55
55
 
56
- it('should accept items with routerLink', () => {
56
+ it('should accept items with (click)', () => {
57
57
  const items: BreadcrumbItem[] = [
58
- { label: 'Home', routerLink: '/home' },
59
- { label: 'Products', routerLink: '/products' },
58
+ { label: 'Home', (click): '/home' },
59
+ { label: 'Products', (click): '/products' },
60
60
  ];
61
61
  component.items = items;
62
- expect(component.items[0].routerLink).toBe('/home');
62
+ expect(component.items[0]. (click)).toBe('/home');
63
63
  });
64
64
 
65
65
  it('should accept items with disabled property', () => {
66
66
  const items: BreadcrumbItem[] = [
67
- { label: 'Home', routerLink: '/home' },
67
+ { label: 'Home', (click): '/home' },
68
68
  { label: 'Current Page', disabled: true },
69
69
  ];
70
70
  component.items = items;
@@ -73,14 +73,14 @@ describe('DropiBreadcrumbComponent', () => {
73
73
 
74
74
  it('should accept items with queryParams', () => {
75
75
  const items: BreadcrumbItem[] = [
76
- { label: 'Products', routerLink: '/products', queryParams: { category: 'electronics' } },
76
+ { label: 'Products', (click): '/products', queryParams: { category: 'electronics' } },
77
77
  ];
78
78
  component.items = items;
79
79
  expect(component.items[0].queryParams).toEqual({ category: 'electronics' });
80
80
  });
81
81
 
82
82
  it('should accept items with fragment', () => {
83
- const items: BreadcrumbItem[] = [{ label: 'Section', routerLink: '/page', fragment: 'section1' }];
83
+ const items: BreadcrumbItem[] = [{ label: 'Section', (click): '/page', fragment: 'section1' }];
84
84
  component.items = items;
85
85
  expect(component.items[0].fragment).toBe('section1');
86
86
  });