@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,392 +1,76 @@
1
1
  import {
2
- AfterContentInit,
3
- ChangeDetectionStrategy,
4
- ChangeDetectorRef,
5
2
  Component,
6
- ContentChildren,
7
- EventEmitter,
8
- HostListener,
9
3
  Input,
10
- OnChanges,
11
- OnDestroy,
12
4
  Output,
13
- QueryList,
14
- SimpleChanges,
15
- TemplateRef,
16
- ViewChild,
17
- ViewContainerRef,
18
- ViewEncapsulation,
19
- } from '@angular/core';
20
- import { CommonModule } from '@angular/common';
21
- import { Subscription } from 'rxjs';
22
- import { Overlay, OverlayModule, OverlayRef } from '@angular/cdk/overlay';
23
- import { PortalModule, TemplatePortal } from '@angular/cdk/portal';
24
-
25
- import { PTemplateDirective } from './p-template.directive';
26
- import { DropiModalStackService } from './dropi-modal-stack.service';
27
-
28
- type DropiTemplateType = 'header' | 'content' | 'footer';
5
+ EventEmitter,
6
+ OnInit,
7
+ CUSTOM_ELEMENTS_SCHEMA,
8
+ } from "@angular/core";
9
+ import { CommonModule } from "@angular/common";
29
10
 
30
11
  @Component({
31
- selector: 'dropi-modal',
12
+ selector: "dropi-modal",
32
13
  standalone: true,
33
- imports: [CommonModule, OverlayModule, PortalModule],
34
- templateUrl: './dropi-modal.component.html',
35
- styleUrls: ['./dropi-modal.component.scss'],
36
- encapsulation: ViewEncapsulation.None,
37
- changeDetection: ChangeDetectionStrategy.OnPush,
14
+ imports: [CommonModule],
15
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
16
+ templateUrl: "./dropi-modal.component.html",
17
+ styleUrls: ["./dropi-modal.component.scss"],
38
18
  })
39
- export class DropiModalComponent implements OnChanges, AfterContentInit, OnDestroy {
40
- @Input() visible = false;
41
- @Output() visibleChange = new EventEmitter<boolean>();
42
-
43
- /** Similar a PrimeNG */
44
- @Input() modal = true;
45
- @Input() dismissableMask = true;
46
- @Input() dismissible = true;
47
- @Input() closeOnEscape = true;
48
- @Input() showCloseIcon = true;
49
- /** Compat PrimeNG: `closable` controla el icono de cierre */
50
- @Input() closable = true;
51
- /** Compat PrimeNG (no-op) */
52
- @Input() draggable = false;
53
- /** Compat PrimeNG (no-op) */
54
- @Input() resizable = false;
55
- @Input() blockScroll = true;
56
-
57
- /** Se mantiene por compatibilidad con usos actuales */
58
- @Input() autoZIndex = true;
59
- @Input() baseZIndex = 1100;
60
- @Input() transitionOptions = '0.15s';
61
-
62
- /** Posicionamiento del panel (para reemplazar sidebars) */
63
- @Input() position: 'center' | 'right' | 'left' | 'top' | 'bottom' = 'center';
64
-
65
- /** Header */
66
- @Input() showHeader = true;
67
- @Input() header: string | null = null;
68
-
69
- /** Clases adicionales (ej: 'dropi-dialog size-m') */
70
- @Input() styleClass: string | null = null;
71
-
72
- /** Ancho máximo del panel (solo aplica cuando position es 'left' o 'right') */
73
- @Input() maxWidth: string | null = null;
74
-
75
- @Output() onHide = new EventEmitter<void>();
76
- @Output() onShow = new EventEmitter<void>();
77
-
78
- @ContentChildren(PTemplateDirective) private readonly templates!: QueryList<PTemplateDirective>;
79
-
80
- @ViewChild('overlayTpl', { read: TemplateRef })
81
- private readonly overlayTpl!: TemplateRef<unknown>;
82
-
83
- headerTemplate: TemplateRef<unknown> | null = null;
84
- contentTemplate: TemplateRef<unknown> | null = null;
85
- footerTemplate: TemplateRef<unknown> | null = null;
86
-
87
- maskZIndex = 1100;
88
- panelZIndex = 1101;
89
-
90
- isOpen = false;
91
- isClosing = false;
92
-
93
- private readonly id = `dropi-modal-${Math.random().toString(36).slice(2)}`;
94
- private isRegistered = false;
95
- private overlayRef: OverlayRef | null = null;
96
- private portal: TemplatePortal | null = null;
97
- private closeTimeoutId: number | null = null;
98
- private pendingOnHideEmit = false;
99
-
100
- private readonly subscriptions = new Subscription();
101
-
102
- constructor(
103
- private readonly stack: DropiModalStackService,
104
- private readonly cdr: ChangeDetectorRef,
105
- private readonly overlay: Overlay,
106
- private readonly viewContainerRef: ViewContainerRef,
107
- ) {}
108
-
109
- get panelClass(): string {
110
- const base = 'dropi-modal__panel';
111
- const extra = (this.styleClass ?? '').trim();
112
- return extra ? `${base} ${extra}` : base;
113
- }
114
-
115
- get rootPositionClass(): string {
116
- return `dropi-modal-root--${this.position}`;
117
- }
118
-
119
- get rootClasses(): string[] {
120
- const classes = ['dropi-modal-root', this.rootPositionClass];
121
-
122
- if (this.isOpen) {
123
- classes.push('dropi-modal-root--open');
124
- }
125
-
126
- if (this.isClosing) {
127
- classes.push('dropi-modal-root--closing');
128
- }
129
-
130
- return classes;
131
- }
132
-
133
- ngAfterContentInit(): void {
134
- this.resolveTemplates();
135
-
136
- this.subscriptions.add(
137
- this.templates.changes.subscribe(() => {
138
- this.resolveTemplates();
139
- this.cdr.markForCheck();
140
- }),
141
- );
142
-
143
- this.cdr.markForCheck();
144
-
145
- if (this.visible) {
146
- this.show();
147
- }
148
- }
149
-
150
- ngOnChanges(changes: SimpleChanges): void {
151
- if (changes['closable']) {
152
- this.showCloseIcon = this.closable;
153
- }
154
-
155
- if (changes['visible']) {
156
- if (this.visible) {
157
- this.show();
158
- queueMicrotask(() => this.onShow.emit());
159
- } else {
160
- // Cierre con animación: esperar a terminar antes de detach/unregister.
161
- this.pendingOnHideEmit = true;
162
- this.startClose();
163
- }
164
- }
165
-
166
- if (changes['baseZIndex'] && this.visible) {
167
- this.syncZIndex();
168
- }
169
- }
170
-
171
- ngOnDestroy(): void {
172
- this.subscriptions.unsubscribe();
173
- this.clearCloseTimer();
174
- this.detachFromBody(true);
175
- this.unregister();
176
- }
177
-
178
- hide(): void {
19
+ export class DropiModalComponent implements OnInit {
20
+ @Input() public visible: boolean = false;
21
+ @Input() public modal: boolean = true;
22
+ @Input() public dismissableMask: boolean = true;
23
+ @Input() public closeOnEscape: boolean = true;
24
+ @Input() public showCloseIcon: boolean = true;
25
+ @Input() public showHeader: boolean = true;
26
+ @Input() public header: string | null = null;
27
+ @Input() public styleClass: string | null = null;
28
+ @Input() public maxWidth: string | null = null;
29
+ @Input() public position: string = "center";
30
+ @Input() public transitionOptions: string = "0.15s";
31
+
32
+ @Output() public visibleChange = new EventEmitter<boolean>();
33
+ @Output() public onHide = new EventEmitter<void>();
34
+ @Output() public onShow = new EventEmitter<void>();
35
+ @Output() public onClose = new EventEmitter<void>();
36
+
37
+ // Propiedades requeridas por el template
38
+ public rootClasses: string[] = [];
39
+ public maskZIndex: number = 1100;
40
+ public panelZIndex: number = 1101;
41
+ public panelClass: string = "dropi-modal__panel";
42
+ public headerTemplate: any = null;
43
+ public contentTemplate: any = null;
44
+ public footerTemplate: any = null;
45
+
46
+ constructor() {}
47
+
48
+ ngOnInit(): void {
49
+ this.updateClasses();
50
+ }
51
+
52
+ public hide(): void {
179
53
  this.visible = false;
180
54
  this.visibleChange.emit(false);
181
- this.pendingOnHideEmit = true;
182
- this.startClose();
183
- }
184
-
185
- private show(): void {
186
- this.attachToBody();
187
- this.registerAndSyncZIndex();
188
-
189
- // Si attachToBody se difirió (overlayTpl no listo), no continuar aún.
190
- // La microtarea agendada en attachToBody volverá a llamar a show.
191
- if (!this.overlayRef?.hasAttached()) {
192
- return;
193
- }
194
-
195
- this.isClosing = false;
196
- this.isOpen = false;
197
- this.clearCloseTimer();
198
- this.cdr.markForCheck();
199
-
200
- // Usar doble rAF para garantizar que el DOM se haya pintado con el estado inicial
201
- // antes de activar la clase "open" y disparar la animación.
202
- requestAnimationFrame(() => {
203
- requestAnimationFrame(() => {
204
- this.isOpen = true;
205
- this.cdr.markForCheck();
206
- });
207
- });
208
- }
209
-
210
- onMaskClick(event: MouseEvent): void {
211
- event.stopPropagation();
212
-
213
- if (!this.modal) {
214
- return;
215
- }
216
-
217
- if (!this.dismissible || !this.dismissableMask) {
218
- return;
219
- }
220
-
221
- this.hide();
55
+ this.onHide.emit();
56
+ this.onClose.emit();
222
57
  }
223
58
 
224
- @HostListener('document:keydown.escape', ['$event'])
225
- onEscape(event: KeyboardEvent): void {
226
- if (!this.visible) {
227
- return;
228
- }
229
-
230
- if (!this.closeOnEscape || !this.dismissible) {
231
- return;
232
- }
233
-
234
- event.preventDefault();
59
+ public close(): void {
235
60
  this.hide();
236
61
  }
237
62
 
238
- private resolveTemplates(): void {
239
- if (!this.templates) {
240
- return;
241
- }
242
-
243
- const templateByType = new Map<DropiTemplateType, TemplateRef<unknown>>();
244
-
245
- for (const entry of this.templates.toArray()) {
246
- const type = (entry.type ?? '') as DropiTemplateType;
247
- if (type === 'header' || type === 'content' || type === 'footer') {
248
- templateByType.set(type, entry.template);
249
- }
250
- }
251
-
252
- this.headerTemplate = templateByType.get('header') ?? null;
253
- this.contentTemplate = templateByType.get('content') ?? null;
254
- this.footerTemplate = templateByType.get('footer') ?? null;
255
- }
256
-
257
- private registerAndSyncZIndex(): void {
258
- if (!this.autoZIndex) {
259
- this.maskZIndex = this.baseZIndex;
260
- this.panelZIndex = this.baseZIndex + 1;
261
- return;
262
- }
263
-
264
- if (!this.isRegistered) {
265
- this.stack.register({
266
- id: this.id,
267
- baseZIndex: this.baseZIndex,
268
- blockScroll: this.blockScroll,
269
- });
270
- this.isRegistered = true;
271
- }
272
-
273
- this.syncZIndex();
274
- }
275
-
276
- private startClose(): void {
277
- if (!this.overlayRef?.hasAttached()) {
278
- // Nada montado; asegurar cleanup.
279
- this.unregister();
280
- if (this.pendingOnHideEmit) {
281
- this.pendingOnHideEmit = false;
282
- this.onHide.emit();
283
- }
284
- return;
285
- }
286
-
287
- if (this.isClosing) {
288
- return;
289
- }
290
-
291
- this.isClosing = true;
292
- // Mantener "open" para que la animación de salida parta desde visible.
293
- this.isOpen = true;
294
- this.cdr.markForCheck();
295
-
296
- const durationMs = this.parseTransitionToMs(this.transitionOptions);
297
-
298
- this.clearCloseTimer();
299
- this.closeTimeoutId = window.setTimeout(() => {
300
- this.detachFromBody();
301
- this.unregister();
302
- this.isClosing = false;
303
- this.isOpen = false;
304
- this.cdr.markForCheck();
305
-
306
- if (this.pendingOnHideEmit) {
307
- this.pendingOnHideEmit = false;
308
- this.onHide.emit();
309
- }
310
- }, durationMs);
311
- }
312
-
313
- private attachToBody(): void {
314
- if (!this.overlayTpl) {
315
- // Por si el ciclo de vida aún no creó el TemplateRef.
316
- queueMicrotask(() => this.show());
317
- return;
318
- }
319
-
320
- if (!this.overlayRef) {
321
- const positionStrategy = this.overlay.position().global().top('0').left('0');
322
-
323
- this.overlayRef = this.overlay.create({
324
- positionStrategy,
325
- hasBackdrop: false,
326
- scrollStrategy: this.overlay.scrollStrategies.noop(),
327
- disposeOnNavigation: true,
328
- });
329
- }
330
-
331
- if (!this.portal) {
332
- this.portal = new TemplatePortal(this.overlayTpl, this.viewContainerRef);
333
- }
334
-
335
- if (!this.overlayRef.hasAttached()) {
336
- this.overlayRef.attach(this.portal);
337
- }
338
- }
339
-
340
- private detachFromBody(dispose = false): void {
341
- if (this.overlayRef?.hasAttached()) {
342
- this.overlayRef.detach();
343
- }
344
-
345
- if (dispose) {
346
- this.overlayRef?.dispose();
347
- this.overlayRef = null;
348
- this.portal = null;
349
- }
350
- }
351
-
352
- private clearCloseTimer(): void {
353
- if (this.closeTimeoutId === null) {
354
- return;
355
- }
356
-
357
- window.clearTimeout(this.closeTimeoutId);
358
- this.closeTimeoutId = null;
359
- }
360
-
361
- private parseTransitionToMs(value: string | null | undefined): number {
362
- const raw = (value ?? '').trim();
363
- // Acepta '150ms', '0.2s' o strings que contengan tiempos (ej: '0.2s ease').
364
- const match = raw.match(/(\d*\.?\d+)\s*(ms|s)\b/i);
365
- if (!match) {
366
- return 150;
63
+ public onMaskClick(event: any): void {
64
+ if (this.dismissableMask) {
65
+ this.hide();
367
66
  }
368
-
369
- const amount = Number(match[1]);
370
- if (!Number.isFinite(amount)) {
371
- return 150;
372
- }
373
-
374
- const unit = match[2].toLowerCase();
375
- return unit === 's' ? Math.round(amount * 1000) : Math.round(amount);
376
67
  }
377
68
 
378
- private syncZIndex(): void {
379
- const { maskZIndex, panelZIndex } = this.stack.getZIndexes(this.id);
380
- this.maskZIndex = maskZIndex;
381
- this.panelZIndex = panelZIndex;
382
- }
383
-
384
- private unregister(): void {
385
- if (!this.isRegistered) {
386
- return;
387
- }
388
-
389
- this.stack.unregister(this.id);
390
- this.isRegistered = false;
69
+ private updateClasses(): void {
70
+ this.rootClasses = [
71
+ "dropi-modal-root",
72
+ `dropi-modal-root--${this.position}`,
73
+ ];
74
+ if (this.visible) this.rootClasses.push("dropi-modal-root--open");
391
75
  }
392
76
  }
@@ -1,20 +1,21 @@
1
- import { CommonModule } from '@angular/common';
2
- import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
3
- import {
4
- DropiTableRow,
5
- } from '@app/utilities/interfaces/ui/dropi-table.interface';
1
+ import { CommonModule } from "@angular/common";
2
+ import { Component, Input, OnInit, Output, EventEmitter } from "@angular/core";
3
+ // import {
4
+ // DropiTableRow,
5
+ // } from '@app/utilities/interfaces/ui/dropi-table.interface';
6
+ type DropiTableRow = any;
6
7
 
7
8
  @Component({
8
- selector: 'app-dropi-navbar',
9
- templateUrl: './dropi-navbar.component.html',
10
- styleUrls: ['./dropi-navbar.component.scss'],
11
- imports: [ CommonModule ],
12
- standalone: true
9
+ selector: "app-dropi-navbar",
10
+ templateUrl: "./dropi-navbar.component.html",
11
+ styleUrls: ["./dropi-navbar.component.scss"],
12
+ imports: [CommonModule],
13
+ standalone: true,
13
14
  })
14
15
  export class DropiNavBarComponent implements OnInit {
15
- @Input() public data: DropiTableRow[] = [];
16
+ @Input() public data: DropiTableRow[] = [];
16
17
  @Input() public title: string = "";
17
- @Output() clickLoadItem = new EventEmitter<{ item: any; }>();
18
+ @Output() clickLoadItem = new EventEmitter<{ item: any }>();
18
19
  sidebarItems: any[] = [];
19
20
  activeItem: any;
20
21
  isLoading: boolean = true;
@@ -29,9 +30,9 @@ export class DropiNavBarComponent implements OnInit {
29
30
 
30
31
  private updateSidebarItems(): void {
31
32
  if (this.data && this.data.length > 0) {
32
- this.sidebarItems = this.data.map(item => ({
33
+ this.sidebarItems = this.data.map((item) => ({
33
34
  ...item,
34
- expanded: false
35
+ expanded: false,
35
36
  }));
36
37
  } else {
37
38
  }
@@ -39,14 +40,13 @@ export class DropiNavBarComponent implements OnInit {
39
40
  }
40
41
 
41
42
  handleItemClick(item: any): void {
42
-
43
43
  if (item.children && item.children.length > 0) {
44
44
  item.expanded = !item.expanded;
45
45
  }
46
-
46
+
47
47
  this.activeItem = item;
48
48
  if (!item.children) {
49
49
  this.clickLoadItem.emit(item);
50
50
  }
51
51
  }
52
- }
52
+ }
@@ -8,7 +8,11 @@
8
8
  (click)="goToFirstPage()"
9
9
  aria-label="Anterior"
10
10
  >
11
- <app-icon [name]="'Arrow-double-small-left'" [width]="16" [height]="16" />
11
+ <app-icon
12
+ [name]="'Arrow-double-small-left'"
13
+ [width]="'16'"
14
+ [height]="'16'"
15
+ />
12
16
  </button>
13
17
  <button
14
18
  *ngIf="currentPage !== 1"
@@ -18,8 +22,8 @@
18
22
  (click)="prevPage()"
19
23
  aria-label="Anterior"
20
24
  >
21
- <app-icon [name]="'Dropdown-left'" [width]="16" [height]="16" />
22
- {{ 'Previous' | translate }}
25
+ <app-icon [name]="'Dropdown-left'" [width]="'16'" [height]="'16'" />
26
+ {{ "Previous" | translate }}
23
27
  </button>
24
28
 
25
29
  <ng-container *ngIf="!isNotTotalPages">
@@ -41,15 +45,18 @@
41
45
  </ng-container>
42
46
 
43
47
  <button
44
- *ngIf="currentPage !== totalPages || (isNotTotalPages && currentPage < totalPages)"
48
+ *ngIf="
49
+ currentPage !== totalPages ||
50
+ (isNotTotalPages && currentPage < totalPages)
51
+ "
45
52
  class="page-item next"
46
53
  [ngClass]="{ nextCursor: isNotTotalPages }"
47
54
  [disabled]="disabled || currentPage === totalPages"
48
55
  (click)="nextPage()"
49
56
  aria-label="Siguiente"
50
57
  >
51
- {{ 'Next' | translate }}
52
- <app-icon [name]="'Dropdown-Right'" [width]="16" [height]="16" />
58
+ {{ "Next" | translate }}
59
+ <app-icon [name]="'Dropdown-Right'" [width]="'16'" [height]="'16'" />
53
60
  </button>
54
61
 
55
62
  <button
@@ -59,6 +66,10 @@
59
66
  (click)="goToLastPage()"
60
67
  aria-label="Siguiente"
61
68
  >
62
- <app-icon [name]="'Arrow-double-small-right'" [width]="16" [height]="16" />
69
+ <app-icon
70
+ [name]="'Arrow-double-small-right'"
71
+ [width]="'16'"
72
+ [height]="'16'"
73
+ />
63
74
  </button>
64
75
  </div>
@@ -1,38 +1,53 @@
1
- import { Component, Input, Output, EventEmitter, input } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { IconComponent } from '../icon/icon.component';
4
- import { TranslateModule } from '@ngx-translate/core';
1
+ import {
2
+ Component,
3
+ Input,
4
+ Output,
5
+ EventEmitter,
6
+ OnInit,
7
+ OnChanges,
8
+ CUSTOM_ELEMENTS_SCHEMA,
9
+ } from "@angular/core";
10
+ import { CommonModule } from "@angular/common";
11
+ import { TranslateModule } from "@ngx-translate/core";
12
+ import { IconComponent } from "../icon/icon.component";
5
13
 
6
14
  @Component({
7
- selector: 'app-dropi-paginator',
15
+ selector: "app-dropi-paginator",
8
16
  standalone: true,
9
17
  imports: [CommonModule, IconComponent, TranslateModule],
10
- templateUrl: './dropi-paginator.component.html',
11
- styleUrls: ['./dropi-paginator.component.scss'],
18
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
19
+ templateUrl: "./dropi-paginator.component.html",
20
+ styleUrls: ["./dropi-paginator.component.scss"],
12
21
  })
13
- export class DropiPaginatorComponent {
22
+ export class DropiPaginatorComponent implements OnInit, OnChanges {
14
23
  @Input() totalPages: number = 1;
15
24
  @Input() currentPage: number = 1;
16
25
  @Input() disabled: boolean = false;
17
- @Input() maxVisiblePages: number = 8; // Máximo de páginas visibles (ajustable)
18
26
  @Input() isNotTotalPages: boolean = false;
27
+ @Input() maxVisiblePages: number = 8;
19
28
  @Output() pageChange = new EventEmitter<number>();
20
29
 
21
- constructor(translate: TranslateModule) {}
30
+ constructor() {}
31
+
32
+ ngOnInit(): void {}
33
+
34
+ ngOnChanges(): void {}
22
35
 
23
36
  get pages(): (number | string)[] {
24
37
  const pages: (number | string)[] = [];
25
38
  const total = this.totalPages;
26
39
  const current = this.currentPage;
27
40
  const max = this.maxVisiblePages;
41
+
28
42
  if (total <= max) {
29
- // Si hay pocas páginas, mostrar todas
30
43
  for (let i = 1; i <= total; i++) pages.push(i);
31
44
  return pages;
32
45
  }
33
- const visible = max - 2; // Reservar espacio para el primer y último elemento
46
+
47
+ const visible = max - 2;
34
48
  let start = Math.max(2, current - Math.floor(visible / 2));
35
49
  let end = Math.min(total - 1, current + Math.floor(visible / 2));
50
+
36
51
  if (start <= 2) {
37
52
  start = 2;
38
53
  end = start + visible - 1;
@@ -41,45 +56,38 @@ export class DropiPaginatorComponent {
41
56
  end = total - 1;
42
57
  start = end - visible + 1;
43
58
  }
59
+
44
60
  pages.push(1);
45
- if (start > 2) pages.push('...');
61
+ if (start > 2) pages.push("...");
46
62
  for (let i = start; i <= end; i++) pages.push(i);
47
- if (end < total - 1) pages.push('...');
63
+ if (end < total - 1) pages.push("...");
48
64
  pages.push(total);
49
65
  return pages;
50
66
  }
51
67
 
52
- goToPage(page: number) {
53
- if (!this.disabled && page !== this.currentPage) {
68
+ public goToPage(page: any): void {
69
+ if (typeof page === "number") {
54
70
  this.pageChange.emit(page);
55
71
  }
56
72
  }
57
73
 
58
- prevPage() {
59
- if ((!this.disabled && this.currentPage > 1) || (!this.isNotTotalPages && !this.disabled)) {
74
+ public prevPage(): void {
75
+ if (this.currentPage > 1) {
60
76
  this.pageChange.emit(this.currentPage - 1);
61
77
  }
62
78
  }
63
79
 
64
- nextPage() {
65
- if (!this.disabled && (this.currentPage < this.totalPages || this.isNotTotalPages)) {
80
+ public nextPage(): void {
81
+ if (this.currentPage < this.totalPages || this.isNotTotalPages) {
66
82
  this.pageChange.emit(this.currentPage + 1);
67
83
  }
68
84
  }
69
85
 
70
- goToFirstPage() {
71
- if (this.currentPage !== 1) {
72
- this.pageChange.emit(1);
73
- }
86
+ public goToFirstPage(): void {
87
+ this.pageChange.emit(1);
74
88
  }
75
89
 
76
- goToLastPage() {
77
- if (this.currentPage !== this.totalPages) {
78
- this.pageChange.emit(this.totalPages);
79
- }
80
- }
81
- showFirstLastButtons(): boolean {
82
- // si esta en la primera o última página no se muestran los botones
83
- return this.currentPage > 1 && this.currentPage < this.totalPages;
90
+ public goToLastPage(): void {
91
+ this.pageChange.emit(this.totalPages);
84
92
  }
85
93
  }