@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,465 +1,102 @@
1
1
  import {
2
2
  Component,
3
- HostListener,
4
3
  Input,
5
- ElementRef,
6
4
  Output,
7
5
  EventEmitter,
8
6
  OnInit,
9
- OnChanges,
10
- SimpleChanges,
11
- ViewChild,
12
- ViewContainerRef,
13
- TemplateRef,
14
- OnDestroy,
15
- } from '@angular/core';
16
- import { CommonModule } from '@angular/common';
17
- import { TranslateModule } from '@ngx-translate/core';
18
- import { Overlay, OverlayModule, OverlayRef, ConnectedPosition } from '@angular/cdk/overlay';
19
- import { TemplatePortal } from '@angular/cdk/portal';
20
- import {
21
- OptionsSelect,
22
- SelectProperties,
23
- GroupedOptions,
24
- } from '@app/utilities/interfaces/ui/select.interface';
25
- import { IconComponent } from '../icon/icon.component';
26
- import { DropiSearchComponent } from '../dropi-search/dropi-search.component';
27
- import { DropiDropdownComponent } from '../dropi-dropdown/dropi-dropdown.component';
28
- import { CountryFlagsComponent } from '../country-flags/country-flags.component';
29
- import { animate, style, transition, trigger } from '@angular/animations';
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";
12
+ import { IconComponent } from "../icon/icon.component";
13
+ import { DropiSearchComponent } from "../dropi-search/dropi-search.component";
14
+ import { DropiDropdownComponent } from "../dropi-dropdown/dropi-dropdown.component";
15
+ import { CountryFlagsComponent } from "../country-flags/country-flags.component";
16
+ import { SelectProperties } from "../../utilities/interfaces/ui/select-interface";
30
17
 
31
18
  @Component({
32
- selector: 'app-dropi-select',
19
+ selector: "app-dropi-select",
33
20
  standalone: true,
34
21
  imports: [
35
22
  CommonModule,
23
+ FormsModule,
24
+ ReactiveFormsModule,
36
25
  TranslateModule,
37
26
  IconComponent,
38
27
  DropiSearchComponent,
39
28
  DropiDropdownComponent,
40
- OverlayModule,
41
29
  CountryFlagsComponent,
42
30
  ],
43
- templateUrl: './dropi-select.component.html',
44
- styleUrls: ['./dropi-select.component.scss'],
45
- animations: [
46
- trigger('selectAnimation', [
47
- transition(':enter', [
48
- style({ opacity: 0, transform: 'scaleY(0.95)' }),
49
- animate(
50
- '120ms ease-out',
51
- style({ opacity: 1, transform: 'scaleY(1)' })
52
- ),
53
- ]),
54
- transition(':leave', [
55
- animate(
56
- '80ms ease-in',
57
- style({ opacity: 0, transform: 'scaleY(0.95)' })
58
- ),
59
- ]),
60
- ]),
61
- ],
31
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
32
+ templateUrl: "./dropi-select.component.html",
33
+ styleUrls: ["./dropi-select.component.scss"],
62
34
  })
63
- export class DropiSelectComponent implements OnInit, OnChanges, OnDestroy {
64
- /**
65
- * Define las propiedades necesarias para un campo de entrada (`input`).
66
- *
67
- * Cada campo debe contener las siguientes propiedades:
68
- * - `label`: Texto descriptivo que se mostrará como etiqueta.
69
- * - `placeholder`: Texto de ejemplo dentro del campo.
70
- * - `dropdownType`: tipo de selector con borde o sin borde
71
- * - `options`: opciones que se mostraran en el menu desplegable que tienen los tipos:
72
- * - `id`: Indicativo con el cual se identifica la opcion
73
- * - `label`: Texto descriptivo de la opción
74
- * - `disabled`: Indicador de opción deshabilitada
75
- *
76
- * Propiedades opcionales:
77
- * - `textHelper`: Texto de ayuda que se mostrará debajo del campo.
78
- * - `hasError`: Indicador de error en el campo.
79
- * - `errorText`: Texto a mostrar cuando hay error en el campo.
80
- * - `showObligatory`: Indicador para mostrar si el campo es obligatorio.
81
- *
82
- * @type {SelectProperties}
83
- */
84
- @Input() public selectProperties: SelectProperties;
85
- /**
86
- * Indica si se debe mostrar deshabilitiado el select.
87
- *
88
- * Valor por defecto: `false`.
89
- *
90
- * @type {boolean}
91
- */
35
+ export class DropiSelectComponent implements OnInit {
36
+ @Input() public label: string = "";
37
+ @Input() public options: any[] = [];
38
+ @Input() public selectProperties: SelectProperties = {};
39
+ @Input() public labelDrop: string = "";
92
40
  @Input() public disabled: boolean = false;
93
41
 
94
- /**
95
- * Habilita la visualización de banderas de países en las opciones del select.
96
- * Requiere que cada opción tenga la propiedad `countryCode` definida.
97
- *
98
- * Valor por defecto: `false`.
99
- *
100
- * @type {boolean}
101
- */
102
- @Input() public showCountryFlags: boolean = false;
103
-
104
- /**
105
- * ID de la opción que debe estar seleccionada por defecto al inicializar el componente.
106
- *
107
- * @type {string | number}
108
- */
109
- @Input() public defaultSelectedId: string | number;
110
-
111
- @Output() private onClear: EventEmitter<any> = new EventEmitter();
112
-
113
- /**
114
- * Evento que emite el valor del select cuando se selecciona
115
- *
116
- * @type {OptionsSelect}
117
- */
118
- @Output() private onChangeSelect: EventEmitter<OptionsSelect> = new EventEmitter();
119
- /**
120
- * Indica si el select esta desplegado
121
- *
122
- * Valor por defecto: `false`.
123
- *
124
- * @type {boolean}
125
- */
42
+ public isOpen: boolean = false;
126
43
  public isExpanded: boolean = false;
127
- /**
128
- * Almacena la opción actual seleccionada
129
- *
130
- * @type {OptionsSelect}
131
- */
132
- @Input() public selectedOption: OptionsSelect | null = null;
133
- public multiSelecOptions: OptionsSelect[] = [];
134
-
135
- // Evento que se dispara cuando se llega al final del scroll
136
- @Output() scrolledToEnd = new EventEmitter<void>();
137
- @Output() onKeyEnter = new EventEmitter<any>();
138
-
139
- public parametersDrop: { type: string; icon: string } = {
140
- type: 'checkbox',
141
- icon: '',
142
- };
143
-
144
- public searchEnabled: boolean = false;
145
- public multiSelect: boolean = false;
146
- public labelDrop: string = '';
147
- private scrollDebounceTimeout: any;
148
- private hasEmittedScrolledToEnd: boolean = false;
44
+ public selectedOption: any = null;
45
+ public searchValue: string = "";
149
46
  public isGrouped: boolean = false;
150
- public searchTerm: string = '';
151
- private lastScrollTop: number = 0;
152
- private dynamicThreshold: number = 5;
153
- private dataOptions: OptionsSelect[] | GroupedOptions[] = [];
154
- public filteredOptions: OptionsSelect[] | GroupedOptions[] = [];
155
-
156
- @ViewChild('dropdownTemplate') dropdownTemplate: TemplateRef<any>;
157
- @ViewChild(DropiDropdownComponent) private dropdownComp: DropiDropdownComponent;
158
- @ViewChild('buttonSelect') buttonSelect: ElementRef;
159
-
160
- private overlayRef: OverlayRef | null = null;
161
- private allMultiSelectOptions: OptionsSelect[] = [];
162
-
163
- constructor(
164
- private elementRef: ElementRef,
165
- private overlay: Overlay,
166
- private viewContainerRef: ViewContainerRef,
167
- ) {}
47
+ public multiSelect: boolean = false;
48
+ public showCountryFlags: boolean = false;
49
+ public searchEnabled: boolean = false;
50
+ public searchTerm: string = "";
51
+ public filteredOptions: any[] = [];
52
+ public multiSelecOptions: any[] = [];
53
+ public parametersDrop: any = {};
168
54
 
169
- ngOnInit() {
170
- this.initializeSelectedProperties();
171
- this.getAllOptions();
55
+ ngOnInit(): void {
56
+ this.filteredOptions = this.options;
172
57
  }
173
58
 
174
- ngOnChanges(changes: SimpleChanges) {
175
- if (changes['selectProperties'] && !changes['selectProperties'].firstChange) {
176
- this.initializeSelectedProperties();
177
- this.getAllOptions();
178
- }
59
+ public showOptions(): void {
60
+ this.toggleDropdown();
179
61
  }
180
62
 
181
- ngOnDestroy() {
182
- if (this.scrollDebounceTimeout) {
183
- clearTimeout(this.scrollDebounceTimeout);
184
- }
185
- this.closeOverlay();
63
+ public toggleDropdown(): void {
64
+ if (this.disabled) return;
65
+ this.isOpen = !this.isOpen;
66
+ this.isExpanded = this.isOpen;
186
67
  }
187
68
 
188
- initializeSelectedProperties() {
189
- this.searchEnabled = this.selectProperties.searchEnabled ?? false;
190
- this.multiSelect = this.selectProperties.multiSelect ?? false;
191
-
192
- this.setOptions(this.selectProperties.options);
193
-
194
- // Establecer opción seleccionada por defecto si se proporciona defaultSelectedId
195
- if (this.defaultSelectedId !== undefined && !this.selectedOption) {
196
- const defaultOption = (this.selectProperties.options as OptionsSelect[]).find(
197
- (opt) => opt.id === this.defaultSelectedId || opt.id.toString() === this.defaultSelectedId.toString()
198
- );
199
- if (defaultOption) {
200
- this.selectedOption = defaultOption;
201
- }
202
- }
69
+ public selectOption(option: any): void {
70
+ if (option.disabled) return;
71
+ this.selectedOption = option;
72
+ this.isOpen = false;
73
+ this.isExpanded = false;
203
74
  }
204
75
 
205
- setOptions(input: OptionsSelect[] | GroupedOptions[]) {
206
- this.isGrouped =
207
- input.length > 0 && 'category' in input[0] && 'options' in input[0] ? true : false;
208
- this.dataOptions = input;
209
- this.filteredOptions = input;
76
+ public getSelectedCountryCode(): string {
77
+ return this.selectedOption?.countryCode || "";
210
78
  }
211
79
 
212
- filterOptions(value: string) {
213
- const term = value.toLowerCase().trim();
214
- // Caso MULTISELECT
215
- if (this.multiSelect) {
216
- if (!term) {
217
- // Si el campo está vacío, restauramos todas
218
- this.multiSelecOptions = [...this.allMultiSelectOptions];
219
- return;
220
- }
221
-
222
- this.multiSelecOptions = this.allMultiSelectOptions.filter((opt) =>
223
- opt.label.toLowerCase().includes(term),
224
- );
80
+ public filterOptions(term: any): void {
81
+ const val = typeof term === "string" ? term : term?.target?.value || "";
82
+ if (!val.trim()) {
83
+ this.filteredOptions = this.options;
225
84
  return;
226
85
  }
227
- // Caso SINGLESELECT
228
-
229
- if (!this.isGrouped) {
230
- this.filteredOptions = (this.dataOptions as OptionsSelect[]).filter((opt) =>
231
- opt.label.toLowerCase().includes(term),
232
- );
233
- } else {
234
- const result: GroupedOptions[] = [];
235
-
236
- for (const group of this.dataOptions as GroupedOptions[]) {
237
- const filteredItems = group.options.filter((item) =>
238
- item.label.toLowerCase().includes(term),
239
- );
240
-
241
- if (filteredItems.length > 0) {
242
- result.push({
243
- category: group.category,
244
- options: filteredItems,
245
- });
246
- }
247
- }
248
-
249
- this.filteredOptions = result;
250
- }
251
- }
252
-
253
- @HostListener('document:click', ['$event'])
254
- closeDropdown(event?: MouseEvent): void {
255
- if (event && !this.elementRef.nativeElement.contains(event.target)) {
256
- // Solo cerramos si no es parte del overlay (clicks fuera del componente)
257
- const overlayContainer = document.querySelector('.dropi-select-overlay-panel');
258
- const clickedInsideOverlay =
259
- overlayContainer && overlayContainer.contains(event.target as Node);
260
-
261
- if (!clickedInsideOverlay) {
262
- this.isExpanded = false;
263
- this.closeOverlay();
264
- }
265
- }
266
- }
267
-
268
- selectOption(option: OptionsSelect) {
269
- // En modo multiSelect, no cerramos el overlay para permitir múltiples selecciones
270
- if (!this.multiSelect) {
271
- this.isExpanded = false;
272
- this.closeOverlay();
273
- }
274
-
275
- this.selectedOption = option;
276
- this.onChangeSelect.emit(option);
277
- }
278
-
279
- showOptions() {
280
- if (this.disabled) return;
281
- this.isExpanded = !this.isExpanded;
282
-
283
- if (this.isExpanded) {
284
- this.openOverlay();
285
- } else {
286
- this.closeOverlay();
287
- }
288
- }
289
-
290
- /**
291
- * Establece la opción seleccionada por su identificador.
292
- *
293
- * Busca en las opciones del select la que coincida con el identificador proporcionado
294
- * y la establece como la opción seleccionada.
295
- * Preferiblemente usar con ViewChild desde el componente padre.
296
- *
297
- * @param {number | string} id - El identificador de la opción a seleccionar.
298
- */
299
- setPropertyById(id: number | string) {
300
- this.selectedOption = this.selectProperties.options.find((propertie) => propertie.id === id);
301
- this.onChangeSelect.emit(this.selectedOption);
302
- }
303
-
304
- /**
305
- * Establece la opción seleccionada por su etiqueta.
306
- *
307
- * Busca en las opciones del select la que coincida con la etiqueta proporcionada
308
- * y la establece como la opción seleccionada.
309
- * Preferiblemente usar con ViewChild desde el componente padre.
310
- *
311
- * @param {string} label - La etiqueta de la opción a seleccionar.
312
- */
313
- setPropertyByLabel(label: string) {
314
- this.selectedOption = this.selectProperties.options.find(
315
- (propertie) => propertie.label === label,
86
+ this.filteredOptions = this.options.filter(
87
+ (o) =>
88
+ o.label?.toLowerCase().includes(val.toLowerCase()) ||
89
+ o.name?.toLowerCase().includes(val.toLowerCase()),
316
90
  );
317
- this.onChangeSelect.emit(this.selectedOption);
318
- }
319
-
320
- //virtual scroll
321
-
322
- onScroll(event: any) {
323
- clearTimeout(this.scrollDebounceTimeout);
324
- this.scrollDebounceTimeout = setTimeout(() => {
325
- const target = event.target;
326
- const distanceFromBottom = target.scrollHeight - target.scrollTop - target.clientHeight;
327
-
328
- // Ajusta el umbral dinámicamente basado en el tamaño de la lista
329
- this.dynamicThreshold = Math.min(50, target.clientHeight / 2);
330
-
331
- // Check if the user has scrolled up
332
- if (target.scrollTop < this.lastScrollTop) {
333
- this.hasEmittedScrolledToEnd = false;
334
- }
335
-
336
- this.lastScrollTop = target.scrollTop;
337
-
338
- if (distanceFromBottom <= this.dynamicThreshold && !this.hasEmittedScrolledToEnd) {
339
- this.scrolledToEnd.emit();
340
- this.hasEmittedScrolledToEnd = true;
341
-
342
- // Reset hasEmittedScrolledToEnd after a delay
343
- setTimeout(() => {
344
- this.hasEmittedScrolledToEnd = false;
345
- }, 1000); // Adjust the delay as needed
346
- }
347
- }, 100); // tiempo de debounce
348
- }
349
-
350
- onKeyPress(event: KeyboardEvent) {
351
- this.onKeyEnter.emit(event);
352
91
  }
353
92
 
354
- clearSelection() {
93
+ public onKeyPress(event: any): void {}
94
+ public onClearHanddle(): void {
355
95
  this.selectedOption = null;
96
+ this.searchTerm = "";
97
+ this.filteredOptions = this.options;
356
98
  }
357
99
 
358
- onClearHanddle() {
359
- this.searchTerm = '';
360
-
361
- if (this.multiSelect) {
362
- this.multiSelecOptions = [...this.allMultiSelectOptions];
363
- } else {
364
- this.filteredOptions = this.dataOptions;
365
- }
366
- this.onClear.emit();
367
- }
368
-
369
- getAllOptions() {
370
- this.multiSelecOptions = this.selectProperties.options;
371
- this.allMultiSelectOptions = [...this.multiSelecOptions];
372
- }
373
-
374
- getValueDrop(e) {
375
- this.selectedOption = e;
376
- this.getLabelDrop(e);
377
- this.onChangeSelect.emit(this.selectedOption);
378
- }
379
-
380
- getLabelDrop(e) {
381
- let label = '';
382
- e.map((option) => {
383
- label = label.length == 0 ? option.label : label + ', ' + option.label;
384
- });
385
-
386
- this.labelDrop = label;
387
- }
388
-
389
- resetMultiSelect(label: string) {
390
- this.selectedOption = null;
391
- this.labelDrop = label;
392
- this.multiSelecOptions = this.multiSelecOptions.map((opt) => ({ ...opt, checked: false }));
393
-
394
- // Si el dropdown aún no existe, salimos sin error
395
- if (!this.dropdownComp) return;
396
-
397
- this.dropdownComp.resetChecks();
398
- }
399
-
400
- private openOverlay() {
401
- if (this.overlayRef) {
402
- return;
403
- }
404
-
405
- const positionStrategy = this.overlay
406
- .position()
407
- .flexibleConnectedTo(this.buttonSelect.nativeElement)
408
- .withPositions(this.getPositions())
409
- .withPush(false);
410
-
411
- this.overlayRef = this.overlay.create({
412
- positionStrategy,
413
- scrollStrategy: this.overlay.scrollStrategies.reposition(),
414
- hasBackdrop: false,
415
- width: this.elementRef.nativeElement.offsetWidth,
416
- panelClass: 'dropi-select-overlay-panel', // Clase personalizada para estilos específicos
417
- });
418
-
419
- const portal = new TemplatePortal(this.dropdownTemplate, this.viewContainerRef);
420
- this.overlayRef.attach(portal);
421
-
422
- this.overlayRef.backdropClick().subscribe(() => this.closeOverlay());
423
- }
424
-
425
- private closeOverlay() {
426
- if (this.overlayRef) {
427
- this.overlayRef.dispose();
428
- this.overlayRef = null;
429
- }
430
- // 🔹 Restaurar el listado si no hay término de búsqueda
431
- if (this.multiSelect && !this.searchTerm.trim()) {
432
- this.multiSelecOptions = [...this.allMultiSelectOptions];
433
- }
434
-
435
- // 🔹 Si sí había término, lo borramos visualmente también
436
- this.searchTerm = '';
437
- }
438
-
439
- private getPositions(): ConnectedPosition[] {
440
- return [
441
- {
442
- originX: 'start',
443
- originY: 'bottom',
444
- overlayX: 'start',
445
- overlayY: 'top',
446
- offsetY: 4,
447
- },
448
- {
449
- originX: 'start',
450
- originY: 'top',
451
- overlayX: 'start',
452
- overlayY: 'bottom',
453
- offsetY: -4,
454
- },
455
- ];
456
- }
457
-
458
- /**
459
- * Obtiene el código de país de la opción actualmente seleccionada
460
- * @returns El código ISO de 2 letras del país o undefined si no hay selección
461
- */
462
- getSelectedCountryCode(): string | undefined {
463
- return this.selectedOption?.countryCode;
464
- }
100
+ public getValueDrop(event: any): void {}
101
+ public onScroll(event: any): void {}
465
102
  }
@@ -1,7 +1,9 @@
1
1
  <ng-container *ngIf="dropiTableConfiguration">
2
2
  <div class="table-container" *ngIf="!loading">
3
3
  <div class="search-container" *ngIf="dropiTableConfiguration?.showSearch">
4
- <h3 class="table-title">{{ dropiTableConfiguration?.title | translate }}</h3>
4
+ <h3 class="table-title">
5
+ {{ dropiTableConfiguration?.title | translate }}
6
+ </h3>
5
7
  <app-input
6
8
  [inputProperties]="{
7
9
  label: 'Search',
@@ -11,7 +13,10 @@
11
13
  ></app-input>
12
14
  </div>
13
15
 
14
- <div class="table-wrapper" [ngClass]="hasActions ? 'width-actions' : 'width-no-actions'">
16
+ <div
17
+ class="table-wrapper"
18
+ [ngClass]="hasActions ? 'width-actions' : 'width-no-actions'"
19
+ >
15
20
  <table
16
21
  class="custom-table"
17
22
  [ngClass]="{
@@ -20,8 +25,13 @@
20
25
  >
21
26
  <thead>
22
27
  <tr>
23
- <th class="checkbox-header" *ngIf="dropiTableConfiguration?.showCheckbox">
24
- <app-dropi-checkbox (onChange)="onSelectAll($event)"></app-dropi-checkbox>
28
+ <th
29
+ class="checkbox-header"
30
+ *ngIf="dropiTableConfiguration?.showCheckbox"
31
+ >
32
+ <app-dropi-checkbox
33
+ (onChange)="onSelectAll($event)"
34
+ ></app-dropi-checkbox>
25
35
  </th>
26
36
  <th
27
37
  *ngFor="let header of headers"
@@ -60,7 +70,7 @@
60
70
  </div>
61
71
  </th>
62
72
  <th class="actions-header actions" *ngIf="hasActions">
63
- {{ 'Actions' | translate }}
73
+ {{ "Actions" | translate }}
64
74
  </th>
65
75
  </tr>
66
76
  </thead>
@@ -82,7 +92,7 @@
82
92
  <div class="message-container">
83
93
  <img src="\assets\utils\icon-not-found.png" alt="empty" />
84
94
  <div class="message">
85
- {{ dropiTableConfiguration.emptyMessage ?? 'no data' | translate }}
95
+ {{ dropiTableConfiguration.emptyMessage ?? "no data" | translate }}
86
96
  </div>
87
97
  </div>
88
98
  </div>
@@ -90,11 +100,13 @@
90
100
 
91
101
  <div
92
102
  class="pagination"
93
- *ngIf="dropiTableConfiguration?.showPaginator && !hidePaginator && !loading"
103
+ *ngIf="
104
+ dropiTableConfiguration?.showPaginator && !hidePaginator && !loading
105
+ "
94
106
  >
95
107
  <div class="page-size-selector">
96
- <label>{{ 'Show' | translate }}</label>
97
- <select (change)="onChangePageSize($event.target.value)">
108
+ <label>{{ "Show" | translate }}</label>
109
+ <select (change)="onChangePageSize($event)">
98
110
  <option
99
111
  *ngFor="let size of dropiTableConfiguration?.pageSizeConfiguration"
100
112
  [selected]="pageSize === size"
@@ -126,6 +138,7 @@
126
138
  <td *ngIf="dropiTableConfiguration?.showCheckbox">
127
139
  <app-dropi-checkbox
128
140
  [disabled]="rowData?.disableCheckbox"
141
+ [checked]="rowData?.selected"
129
142
  (onChange)="onSelectRow($event, rowData)"
130
143
  ></app-dropi-checkbox>
131
144
  </td>
@@ -150,7 +163,8 @@
150
163
  [ngClass]="{
151
164
  'short-actions': dropiTableConfiguration?.showActionsPerRow
152
165
  ? rowData.actionsPerRow && rowData.actionsPerRow.length <= 3
153
- : dropiTableConfiguration?.rowActions && dropiTableConfiguration.rowActions.length <= 3,
166
+ : dropiTableConfiguration?.rowActions &&
167
+ dropiTableConfiguration.rowActions.length <= 3,
154
168
  }"
155
169
  *ngIf="hasActions"
156
170
  >
@@ -166,14 +180,7 @@
166
180
  >
167
181
  <app-icon
168
182
  class="action-icon"
169
- (click)="
170
- toggleActions(
171
- level === 0 ? parentIndex : parentIndex,
172
- actionsMenu,
173
- level > 0,
174
- childIndex
175
- )
176
- "
183
+ (click)="toggleActions(level === 0 ? parentIndex : parentIndex)"
177
184
  name="Menu-dots-vertical"
178
185
  width="24px"
179
186
  height="24px"
@@ -277,8 +284,8 @@
277
284
 
278
285
  <ng-container *ngSwitchCase="'date'">
279
286
  <div class="date-label">
280
- <span>{{ item.value | date: 'dd-MM-yyyy' }} </span>
281
- <span>{{ item.value | date: 'hh:mm a' }} </span>
287
+ <span>{{ item.value | date: "dd-MM-yyyy" }} </span>
288
+ <span>{{ item.value | date: "hh:mm a" }} </span>
282
289
  </div>
283
290
  </ng-container>
284
291
 
@@ -320,7 +327,10 @@
320
327
  </ng-container>
321
328
 
322
329
  <ng-container *ngSwitchCase="'textIcon'">
323
- <div class="text-icon-label" [ngClass]="{ 'justify-center': !item?.value }">
330
+ <div
331
+ class="text-icon-label"
332
+ [ngClass]="{ 'justify-center': !item?.value }"
333
+ >
324
334
  <app-icon
325
335
  [name]="item.icon"
326
336
  width="24px"
@@ -334,10 +344,17 @@
334
344
  <ng-container *ngSwitchCase="'status'">
335
345
  <div class="status-label">
336
346
  <div class="status-dot">
337
- <div [ngClass]="'dot dot-' + item.status.toLowerCase()"></div>
347
+ <div
348
+ [ngClass]="
349
+ 'dot dot-' +
350
+ (item.status ? item.status.toLowerCase() : 'unknown')
351
+ "
352
+ ></div>
338
353
  <span class="status-text">{{ item.status | translate }}</span>
339
354
  </div>
340
- <span *ngIf="item?.value" class="status-description">{{ item.value }}</span>
355
+ <span *ngIf="item?.value" class="status-description">{{
356
+ item.value
357
+ }}</span>
341
358
  </div>
342
359
  </ng-container>
343
360