@dropi/ui-components 1.0.0
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.
- package/.gitignore +13 -0
- package/CONTRIBUTING.md +188 -0
- package/MIGRATION_STEPS.md +39 -0
- package/PUBLISH_CHECKLIST.md +97 -0
- package/QUICK_START.md +108 -0
- package/README.md +146 -0
- package/jest.config.ts +21 -0
- package/ng-package.json +8 -0
- package/package.json +66 -0
- package/project.json +48 -0
- package/publish.sh +113 -0
- package/src/components-source/accordion/accordion-item/accordion-item.component.html +12 -0
- package/src/components-source/accordion/accordion-item/accordion-item.component.scss +47 -0
- package/src/components-source/accordion/accordion-item/accordion-item.component.spec.ts +122 -0
- package/src/components-source/accordion/accordion-item/accordion-item.component.ts +42 -0
- package/src/components-source/accordion/accordion.component.html +3 -0
- package/src/components-source/accordion/accordion.component.scss +5 -0
- package/src/components-source/accordion/accordion.component.spec.ts +243 -0
- package/src/components-source/accordion/accordion.component.stories.ts +111 -0
- package/src/components-source/accordion/accordion.component.ts +43 -0
- package/src/components-source/alert/alert.component.html +28 -0
- package/src/components-source/alert/alert.component.scss +154 -0
- package/src/components-source/alert/alert.component.spec.ts +185 -0
- package/src/components-source/alert/alert.component.stories.ts +310 -0
- package/src/components-source/alert/alert.component.ts +203 -0
- package/src/components-source/alert-legacy/alert.component.html +21 -0
- package/src/components-source/alert-legacy/alert.component.scss +42 -0
- package/src/components-source/alert-legacy/alert.component.spec.ts +159 -0
- package/src/components-source/alert-legacy/alert.component.ts +33 -0
- package/src/components-source/alert-modal/alert-modal.component.html +124 -0
- package/src/components-source/alert-modal/alert-modal.component.scss +203 -0
- package/src/components-source/alert-modal/alert-modal.component.spec.ts +557 -0
- package/src/components-source/alert-modal/alert-modal.component.stories.ts +295 -0
- package/src/components-source/alert-modal/alert-modal.component.ts +294 -0
- package/src/components-source/alert-modal/services/template-alert-modal.service.ts +75 -0
- package/src/components-source/badge/badge.component.html +49 -0
- package/src/components-source/badge/badge.component.scss +57 -0
- package/src/components-source/badge/badge.component.spec.ts +181 -0
- package/src/components-source/badge/badge.component.ts +21 -0
- package/src/components-source/breadcrumb/breadcrumb.component.html +5 -0
- package/src/components-source/breadcrumb/breadcrumb.component.scss +46 -0
- package/src/components-source/breadcrumb/breadcrumb.component.spec.ts +279 -0
- package/src/components-source/breadcrumb/breadcrumb.component.ts +24 -0
- package/src/components-source/card-product/card-product.component.html +173 -0
- package/src/components-source/card-product/card-product.component.spec.ts +601 -0
- package/src/components-source/card-product/card-product.component.stories.ts +322 -0
- package/src/components-source/card-product/card-product.component.ts +1101 -0
- package/src/components-source/card-section/card-section.component.html +22 -0
- package/src/components-source/card-section/card-section.component.scss +14 -0
- package/src/components-source/card-section/card-section.component.spec.ts +333 -0
- package/src/components-source/card-section/card-section.component.stories.ts +141 -0
- package/src/components-source/card-section/card-section.component.ts +35 -0
- package/src/components-source/checkbox-selection-list/checkbox-selection-list.component.html +38 -0
- package/src/components-source/checkbox-selection-list/checkbox-selection-list.component.scss +147 -0
- package/src/components-source/checkbox-selection-list/checkbox-selection-list.component.spec.ts +555 -0
- package/src/components-source/checkbox-selection-list/checkbox-selection-list.component.stories.ts +157 -0
- package/src/components-source/checkbox-selection-list/checkbox-selection-list.component.ts +219 -0
- package/src/components-source/city-selector/city-selector.component.html +22 -0
- package/src/components-source/city-selector/city-selector.component.scss +1 -0
- package/src/components-source/city-selector/city-selector.component.spec.ts +278 -0
- package/src/components-source/city-selector/city-selector.component.stories.ts +200 -0
- package/src/components-source/city-selector/city-selector.component.ts +151 -0
- package/src/components-source/color-picker/color-picker.component.html +54 -0
- package/src/components-source/color-picker/color-picker.component.scss +203 -0
- package/src/components-source/color-picker/color-picker.component.spec.ts +148 -0
- package/src/components-source/color-picker/color-picker.component.stories.ts +70 -0
- package/src/components-source/color-picker/color-picker.component.ts +353 -0
- package/src/components-source/country-flags/country-flags.component.html +10 -0
- package/src/components-source/country-flags/country-flags.component.scss +34 -0
- package/src/components-source/country-flags/country-flags.component.spec.ts +78 -0
- package/src/components-source/country-flags/country-flags.component.ts +18 -0
- package/src/components-source/date-picker/date-picker.component.html +35 -0
- package/src/components-source/date-picker/date-picker.component.scss +388 -0
- package/src/components-source/date-picker/date-picker.component.spec.ts +510 -0
- package/src/components-source/date-picker/date-picker.component.stories.ts +444 -0
- package/src/components-source/date-picker/date-picker.component.ts +313 -0
- package/src/components-source/date-picker/date-picker.stories.spec.ts +150 -0
- package/src/components-source/date-picker-range/date-picker-range.component.html +45 -0
- package/src/components-source/date-picker-range/date-picker-range.component.scss +229 -0
- package/src/components-source/date-picker-range/date-picker-range.component.spec.ts +555 -0
- package/src/components-source/date-picker-range/date-picker-range.component.ts +254 -0
- package/src/components-source/dropi-avatars/dropi-avatars.component.html +17 -0
- package/src/components-source/dropi-avatars/dropi-avatars.component.scss +58 -0
- package/src/components-source/dropi-avatars/dropi-avatars.component.spec.ts +403 -0
- package/src/components-source/dropi-avatars/dropi-avatars.component.ts +24 -0
- package/src/components-source/dropi-badge/dropi-badge.component.html +12 -0
- package/src/components-source/dropi-badge/dropi-badge.component.scss +50 -0
- package/src/components-source/dropi-badge/dropi-badge.component.spec.ts +108 -0
- package/src/components-source/dropi-badge/dropi-badge.component.stories.ts +140 -0
- package/src/components-source/dropi-badge/dropi-badge.component.ts +39 -0
- package/src/components-source/dropi-banner-external/dropi-banner-external.component.html +67 -0
- package/src/components-source/dropi-banner-external/dropi-banner-external.component.scss +46 -0
- package/src/components-source/dropi-banner-external/dropi-banner-external.component.spec.ts +170 -0
- package/src/components-source/dropi-banner-external/dropi-banner-external.component.stories.ts +203 -0
- package/src/components-source/dropi-banner-external/dropi-banner-external.component.ts +204 -0
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.html +65 -0
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.scss +65 -0
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.spec.ts +125 -0
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.ts +38 -0
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.stories.ts +133 -0
- package/src/components-source/dropi-button/dropi-button.component.html +37 -0
- package/src/components-source/dropi-button/dropi-button.component.scss +266 -0
- package/src/components-source/dropi-button/dropi-button.component.spec.ts +264 -0
- package/src/components-source/dropi-button/dropi-button.component.stories.ts +221 -0
- package/src/components-source/dropi-button/dropi-button.component.ts +82 -0
- package/src/components-source/dropi-card-checkbox/dropi-card-checkbox.component.html +24 -0
- package/src/components-source/dropi-card-checkbox/dropi-card-checkbox.component.scss +85 -0
- package/src/components-source/dropi-card-checkbox/dropi-card-checkbox.component.spec.ts +157 -0
- package/src/components-source/dropi-card-checkbox/dropi-card-checkbox.component.stories.ts +209 -0
- package/src/components-source/dropi-card-checkbox/dropi-card-checkbox.component.ts +41 -0
- package/src/components-source/dropi-carousel/dropi-carousel.component.html +57 -0
- package/src/components-source/dropi-carousel/dropi-carousel.component.scss +156 -0
- package/src/components-source/dropi-carousel/dropi-carousel.component.spec.ts +224 -0
- package/src/components-source/dropi-carousel/dropi-carousel.component.ts +266 -0
- package/src/components-source/dropi-carousel/dropi-carousel.stories.ts +365 -0
- package/src/components-source/dropi-checkbox/dropi-checkbox.component.css +39 -0
- package/src/components-source/dropi-checkbox/dropi-checkbox.component.html +18 -0
- package/src/components-source/dropi-checkbox/dropi-checkbox.component.spec.ts +155 -0
- package/src/components-source/dropi-checkbox/dropi-checkbox.component.stories.ts +101 -0
- package/src/components-source/dropi-checkbox/dropi-checkbox.component.ts +25 -0
- package/src/components-source/dropi-chips/dropi-chips.component.html +10 -0
- package/src/components-source/dropi-chips/dropi-chips.component.scss +54 -0
- package/src/components-source/dropi-chips/dropi-chips.component.spec.ts +356 -0
- package/src/components-source/dropi-chips/dropi-chips.component.stories.ts +275 -0
- package/src/components-source/dropi-chips/dropi-chips.component.ts +100 -0
- package/src/components-source/dropi-country-selector/countries.data.ts +239 -0
- package/src/components-source/dropi-country-selector/dropi-country-selector.component.html +59 -0
- package/src/components-source/dropi-country-selector/dropi-country-selector.component.scss +126 -0
- package/src/components-source/dropi-country-selector/dropi-country-selector.component.spec.ts +244 -0
- package/src/components-source/dropi-country-selector/dropi-country-selector.component.stories.ts +117 -0
- package/src/components-source/dropi-country-selector/dropi-country-selector.component.ts +179 -0
- package/src/components-source/dropi-drawer/dropi-drawer.component.html +23 -0
- package/src/components-source/dropi-drawer/dropi-drawer.component.scss +88 -0
- package/src/components-source/dropi-drawer/dropi-drawer.component.spec.ts +84 -0
- package/src/components-source/dropi-drawer/dropi-drawer.component.ts +90 -0
- package/src/components-source/dropi-dropdown/dropi-dropdown.component.html +30 -0
- package/src/components-source/dropi-dropdown/dropi-dropdown.component.scss +58 -0
- package/src/components-source/dropi-dropdown/dropi-dropdown.component.spec.ts +213 -0
- package/src/components-source/dropi-dropdown/dropi-dropdown.component.stories.ts +143 -0
- package/src/components-source/dropi-dropdown/dropi-dropdown.component.ts +53 -0
- package/src/components-source/dropi-favorite-button/dropi-favorite-button.component.html +23 -0
- package/src/components-source/dropi-favorite-button/dropi-favorite-button.component.scss +21 -0
- package/src/components-source/dropi-favorite-button/dropi-favorite-button.component.spec.ts +240 -0
- package/src/components-source/dropi-favorite-button/dropi-favorite-button.component.ts +31 -0
- package/src/components-source/dropi-file-upload/card-view/card-view.component.html +154 -0
- package/src/components-source/dropi-file-upload/card-view/card-view.component.scss +118 -0
- package/src/components-source/dropi-file-upload/card-view/card-view.component.ts +72 -0
- package/src/components-source/dropi-file-upload/drop-zone/drop-zone.coment.stories.ts +179 -0
- package/src/components-source/dropi-file-upload/drop-zone/drop-zone.component.html +111 -0
- package/src/components-source/dropi-file-upload/drop-zone/drop-zone.component.scss +90 -0
- package/src/components-source/dropi-file-upload/drop-zone/drop-zone.component.ts +172 -0
- package/src/components-source/dropi-file-upload/dropi-file-upload.component.html +42 -0
- package/src/components-source/dropi-file-upload/dropi-file-upload.component.scss +31 -0
- package/src/components-source/dropi-file-upload/dropi-file-upload.component.spec.ts +398 -0
- package/src/components-source/dropi-file-upload/dropi-file-upload.component.stories.ts +139 -0
- package/src/components-source/dropi-file-upload/dropi-file-upload.component.ts +329 -0
- package/src/components-source/dropi-file-upload/file-list/file-list.component.html +51 -0
- package/src/components-source/dropi-file-upload/file-list/file-list.component.scss +60 -0
- package/src/components-source/dropi-file-upload/file-list/file-list.component.ts +84 -0
- package/src/components-source/dropi-file-upload/grid-view/grid-view.component.html +77 -0
- package/src/components-source/dropi-file-upload/grid-view/grid-view.component.scss +85 -0
- package/src/components-source/dropi-file-upload/grid-view/grid-view.component.ts +35 -0
- package/src/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.html +38 -0
- package/src/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.scss +59 -0
- package/src/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.spec.ts +214 -0
- package/src/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.ts +65 -0
- package/src/components-source/dropi-image-overlay/dropi-image-overlay.component.html +54 -0
- package/src/components-source/dropi-image-overlay/dropi-image-overlay.component.scss +210 -0
- package/src/components-source/dropi-image-overlay/dropi-image-overlay.component.spec.ts +145 -0
- package/src/components-source/dropi-image-overlay/dropi-image-overlay.component.ts +76 -0
- package/src/components-source/dropi-image-overlay/dropi-image-overlay.stories.ts +267 -0
- package/src/components-source/dropi-languages-selector/dropi-languages-selector.component.html +17 -0
- package/src/components-source/dropi-languages-selector/dropi-languages-selector.component.scss +82 -0
- package/src/components-source/dropi-languages-selector/dropi-languages-selector.component.spec.ts +152 -0
- package/src/components-source/dropi-languages-selector/dropi-languages-selector.component.ts +41 -0
- package/src/components-source/dropi-logo/dropi-logo.component.html +3 -0
- package/src/components-source/dropi-logo/dropi-logo.component.scss +20 -0
- package/src/components-source/dropi-logo/dropi-logo.component.spec.ts +274 -0
- package/src/components-source/dropi-logo/dropi-logo.component.ts +24 -0
- package/src/components-source/dropi-modal/dropi-modal-stack.service.ts +75 -0
- package/src/components-source/dropi-modal/dropi-modal.component.html +55 -0
- package/src/components-source/dropi-modal/dropi-modal.component.scss +274 -0
- package/src/components-source/dropi-modal/dropi-modal.component.spec.ts +46 -0
- package/src/components-source/dropi-modal/dropi-modal.component.stories.ts +392 -0
- package/src/components-source/dropi-modal/dropi-modal.component.ts +392 -0
- package/src/components-source/dropi-modal/p-template.directive.ts +11 -0
- package/src/components-source/dropi-navbar/dropi-navbar.component.html +41 -0
- package/src/components-source/dropi-navbar/dropi-navbar.component.scss +227 -0
- package/src/components-source/dropi-navbar/dropi-navbar.component.spec.ts +110 -0
- package/src/components-source/dropi-navbar/dropi-navbar.component.ts +52 -0
- package/src/components-source/dropi-paginator/dropi-paginator.component.html +64 -0
- package/src/components-source/dropi-paginator/dropi-paginator.component.scss +43 -0
- package/src/components-source/dropi-paginator/dropi-paginator.component.spec.ts +285 -0
- package/src/components-source/dropi-paginator/dropi-paginator.component.stories.ts +345 -0
- package/src/components-source/dropi-paginator/dropi-paginator.component.ts +85 -0
- package/src/components-source/dropi-phone-input/dropi-phone-input.component.html +93 -0
- package/src/components-source/dropi-phone-input/dropi-phone-input.component.scss +224 -0
- package/src/components-source/dropi-phone-input/dropi-phone-input.component.spec.ts +376 -0
- package/src/components-source/dropi-phone-input/dropi-phone-input.component.ts +203 -0
- package/src/components-source/dropi-phone-input/numeric-input.directive.ts +17 -0
- package/src/components-source/dropi-radio-button/dropi-radio-button.component.html +8 -0
- package/src/components-source/dropi-radio-button/dropi-radio-button.component.scss +33 -0
- package/src/components-source/dropi-radio-button/dropi-radio-button.component.spec.ts +225 -0
- package/src/components-source/dropi-radio-button/dropi-radio-button.component.ts +48 -0
- package/src/components-source/dropi-search/dropi-search.component.html +124 -0
- package/src/components-source/dropi-search/dropi-search.component.scss +116 -0
- package/src/components-source/dropi-search/dropi-search.component.spec.ts +483 -0
- package/src/components-source/dropi-search/dropi-search.component.stories.ts +267 -0
- package/src/components-source/dropi-search/dropi-search.component.ts +230 -0
- package/src/components-source/dropi-select/dropi-select.component.html +158 -0
- package/src/components-source/dropi-select/dropi-select.component.scss +275 -0
- package/src/components-source/dropi-select/dropi-select.component.spec.ts +386 -0
- package/src/components-source/dropi-select/dropi-select.component.stories.ts +686 -0
- package/src/components-source/dropi-select/dropi-select.component.ts +465 -0
- package/src/components-source/dropi-skeleton/dropi-skeleton.component.html +10 -0
- package/src/components-source/dropi-skeleton/dropi-skeleton.component.scss +28 -0
- package/src/components-source/dropi-skeleton/dropi-skeleton.component.spec.ts +273 -0
- package/src/components-source/dropi-skeleton/dropi-skeleton.component.stories.ts +145 -0
- package/src/components-source/dropi-skeleton/dropi-skeleton.component.ts +30 -0
- package/src/components-source/dropi-steps/dropi-steps.component.html +29 -0
- package/src/components-source/dropi-steps/dropi-steps.component.scss +110 -0
- package/src/components-source/dropi-steps/dropi-steps.component.spec.ts +228 -0
- package/src/components-source/dropi-steps/dropi-steps.component.stories.ts +231 -0
- package/src/components-source/dropi-steps/dropi-steps.component.ts +98 -0
- package/src/components-source/dropi-switch/dropi-switch.component.html +4 -0
- package/src/components-source/dropi-switch/dropi-switch.component.scss +50 -0
- package/src/components-source/dropi-switch/dropi-switch.component.spec.ts +105 -0
- package/src/components-source/dropi-switch/dropi-switch.component.stories.ts +106 -0
- package/src/components-source/dropi-switch/dropi-switch.component.ts +22 -0
- package/src/components-source/dropi-table/dropi-table.component.html +395 -0
- package/src/components-source/dropi-table/dropi-table.component.scss +506 -0
- package/src/components-source/dropi-table/dropi-table.component.spec.ts +578 -0
- package/src/components-source/dropi-table/dropi-table.component.stories.ts +313 -0
- package/src/components-source/dropi-table/dropi-table.component.ts +580 -0
- package/src/components-source/dropi-tag/dropi-tag.component.html +17 -0
- package/src/components-source/dropi-tag/dropi-tag.component.scss +50 -0
- package/src/components-source/dropi-tag/dropi-tag.component.spec.ts +267 -0
- package/src/components-source/dropi-tag/dropi-tag.component.stories.ts +290 -0
- package/src/components-source/dropi-tag/dropi-tag.component.ts +92 -0
- package/src/components-source/dropi-text-area/droip-text-area.component.stories.ts +138 -0
- package/src/components-source/dropi-text-area/dropi-text-area.component.html +63 -0
- package/src/components-source/dropi-text-area/dropi-text-area.component.scss +106 -0
- package/src/components-source/dropi-text-area/dropi-text-area.component.spec.ts +507 -0
- package/src/components-source/dropi-text-area/dropi-text-area.component.ts +80 -0
- package/src/components-source/dropi-tooltip/dropi-tooltip.component.html +70 -0
- package/src/components-source/dropi-tooltip/dropi-tooltip.component.scss +250 -0
- package/src/components-source/dropi-tooltip/dropi-tooltip.component.spec.ts +423 -0
- package/src/components-source/dropi-tooltip/dropi-tooltip.component.ts +153 -0
- package/src/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.component.html +20 -0
- package/src/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.component.scss +63 -0
- package/src/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.component.spec.ts +121 -0
- package/src/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.component.ts +43 -0
- package/src/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.stories.ts +125 -0
- package/src/components-source/empty-state/empty-state.component.html +30 -0
- package/src/components-source/empty-state/empty-state.component.scss +76 -0
- package/src/components-source/empty-state/empty-state.component.spec.ts +244 -0
- package/src/components-source/empty-state/empty-state.component.stories.ts +198 -0
- package/src/components-source/empty-state/empty-state.component.ts +34 -0
- package/src/components-source/file-upload-progress-bar/file-upload-progress-bar.component.html +81 -0
- package/src/components-source/file-upload-progress-bar/file-upload-progress-bar.component.scss +86 -0
- package/src/components-source/file-upload-progress-bar/file-upload-progress-bar.component.spec.ts +27 -0
- package/src/components-source/file-upload-progress-bar/file-upload-progress-bar.component.stories.ts +149 -0
- package/src/components-source/file-upload-progress-bar/file-upload-progress-bar.component.ts +89 -0
- package/src/components-source/foundations/dropi-border-radius-demo/dropi-border-radius-demo.component.scss +32 -0
- package/src/components-source/foundations/dropi-border-radius-demo/dropi-border-radius-demo.component.ts +17 -0
- package/src/components-source/foundations/foundations.component.html +183 -0
- package/src/components-source/foundations/foundations.component.scss +31 -0
- package/src/components-source/foundations/foundations.component.ts +26 -0
- package/src/components-source/icon/icon-names.const.ts +270 -0
- package/src/components-source/icon/icon.component.html +3 -0
- package/src/components-source/icon/icon.component.scss +4 -0
- package/src/components-source/icon/icon.component.spec.ts +304 -0
- package/src/components-source/icon/icon.component.ts +53 -0
- package/src/components-source/index.ts +89 -0
- package/src/components-source/input/input.component.html +97 -0
- package/src/components-source/input/input.component.scss +149 -0
- package/src/components-source/input/input.component.spec.ts +243 -0
- package/src/components-source/input/input.component.stories.ts +269 -0
- package/src/components-source/input/input.component.ts +119 -0
- package/src/components-source/lottie-loader/lottie-loader.component.html +16 -0
- package/src/components-source/lottie-loader/lottie-loader.component.scss +32 -0
- package/src/components-source/lottie-loader/lottie-loader.component.spec.ts +103 -0
- package/src/components-source/lottie-loader/lottie-loader.component.ts +20 -0
- package/src/components-source/otp-send-code/mock-otp-services.ts +214 -0
- package/src/components-source/otp-send-code/otp-send-code.component.html +151 -0
- package/src/components-source/otp-send-code/otp-send-code.component.scss +156 -0
- package/src/components-source/otp-send-code/otp-send-code.component.spec.ts +419 -0
- package/src/components-source/otp-send-code/otp-send-code.component.stories.ts +190 -0
- package/src/components-source/otp-send-code/otp-send-code.component.ts +659 -0
- package/src/components-source/radio-selection-list/radio-selection-list.component.html +107 -0
- package/src/components-source/radio-selection-list/radio-selection-list.component.scss +280 -0
- package/src/components-source/radio-selection-list/radio-selection-list.component.spec.ts +243 -0
- package/src/components-source/radio-selection-list/radio-selection-list.component.stories.ts +313 -0
- package/src/components-source/radio-selection-list/radio-selection-list.component.ts +143 -0
- package/src/components-source/read-more/read-more.component.html +14 -0
- package/src/components-source/read-more/read-more.component.scss +16 -0
- package/src/components-source/read-more/read-more.component.spec.ts +272 -0
- package/src/components-source/read-more/read-more.component.stories.ts +131 -0
- package/src/components-source/read-more/read-more.component.ts +88 -0
- package/src/components-source/sidebar/sidebar.component.html +42 -0
- package/src/components-source/sidebar/sidebar.component.scss +70 -0
- package/src/components-source/sidebar/sidebar.component.spec.ts +354 -0
- package/src/components-source/sidebar/sidebar.component.stories.ts +145 -0
- package/src/components-source/sidebar/sidebar.component.ts +105 -0
- package/src/components-source/simple-stepper/simple-stepper.component.html +17 -0
- package/src/components-source/simple-stepper/simple-stepper.component.scss +117 -0
- package/src/components-source/simple-stepper/simple-stepper.component.spec.ts +348 -0
- package/src/components-source/simple-stepper/simple-stepper.component.stories.ts +104 -0
- package/src/components-source/simple-stepper/simple-stepper.component.ts +69 -0
- package/src/components-source/storybook-doc-components/avatars-storybook/avatars-storybook.component.html +192 -0
- package/src/components-source/storybook-doc-components/avatars-storybook/avatars-storybook.component.scss +15 -0
- package/src/components-source/storybook-doc-components/avatars-storybook/avatars-storybook.component.ts +17 -0
- package/src/components-source/storybook-doc-components/border-radius-storybook/border-radius-storybook.component.html +22 -0
- package/src/components-source/storybook-doc-components/border-radius-storybook/border-radius-storybook.component.scss +0 -0
- package/src/components-source/storybook-doc-components/border-radius-storybook/border-radius-storybook.component.ts +54 -0
- package/src/components-source/storybook-doc-components/breakpoints-and-grids-storybook/breakpoints-and-grids-storybook.component.css +81 -0
- package/src/components-source/storybook-doc-components/breakpoints-and-grids-storybook/breakpoints-and-grids-storybook.component.html +143 -0
- package/src/components-source/storybook-doc-components/breakpoints-and-grids-storybook/breakpoints-and-grids-storybook.component.ts +97 -0
- package/src/components-source/storybook-doc-components/colors-storybook/colors-storybook.component.css +10 -0
- package/src/components-source/storybook-doc-components/colors-storybook/colors-storybook.component.html +63 -0
- package/src/components-source/storybook-doc-components/colors-storybook/colors-storybook.component.ts +542 -0
- package/src/components-source/storybook-doc-components/dropi-modal/dropi-modal.component.html +132 -0
- package/src/components-source/storybook-doc-components/dropi-modal/dropi-modal.component.scss +15 -0
- package/src/components-source/storybook-doc-components/dropi-modal/dropi-modal.component.ts +67 -0
- package/src/components-source/storybook-doc-components/dropi-toast/dropi-toast.component.html +156 -0
- package/src/components-source/storybook-doc-components/dropi-toast/dropi-toast.component.scss +13 -0
- package/src/components-source/storybook-doc-components/dropi-toast/dropi-toast.component.ts +55 -0
- package/src/components-source/storybook-doc-components/flags-storybook/flags-storybook.component.css +0 -0
- package/src/components-source/storybook-doc-components/flags-storybook/flags-storybook.component.html +99 -0
- package/src/components-source/storybook-doc-components/flags-storybook/flags-storybook.component.ts +19 -0
- package/src/components-source/storybook-doc-components/icons-storybook/icons-storybook.component.css +82 -0
- package/src/components-source/storybook-doc-components/icons-storybook/icons-storybook.component.html +111 -0
- package/src/components-source/storybook-doc-components/icons-storybook/icons-storybook.component.ts +196 -0
- package/src/components-source/storybook-doc-components/logo-storybook/logo-foundations.component.ts +19 -0
- package/src/components-source/storybook-doc-components/logo-storybook/logo-storybook.component.css +0 -0
- package/src/components-source/storybook-doc-components/logo-storybook/logo-storybook.component.html +104 -0
- package/src/components-source/storybook-doc-components/lustration-storybook/lustration-storybook.component.css +0 -0
- package/src/components-source/storybook-doc-components/lustration-storybook/lustration-storybook.component.html +218 -0
- package/src/components-source/storybook-doc-components/lustration-storybook/lustration-storybook.component.ts +20 -0
- package/src/components-source/storybook-doc-components/shadow-storybook/shadow-storybook.component.html +21 -0
- package/src/components-source/storybook-doc-components/shadow-storybook/shadow-storybook.component.scss +0 -0
- package/src/components-source/storybook-doc-components/shadow-storybook/shadow-storybook.component.ts +66 -0
- package/src/components-source/storybook-doc-components/spacing-storybook/spacing-storybook.component.html +33 -0
- package/src/components-source/storybook-doc-components/spacing-storybook/spacing-storybook.component.scss +0 -0
- package/src/components-source/storybook-doc-components/spacing-storybook/spacing-storybook.component.ts +37 -0
- package/src/components-source/storybook-doc-components/story-page/story-page.component.html +74 -0
- package/src/components-source/storybook-doc-components/story-page/story-page.component.scss +103 -0
- package/src/components-source/storybook-doc-components/story-page/story-page.component.ts +424 -0
- package/src/components-source/storybook-doc-components/template-breakpoint-storybook/template-breakpoint-storybook.component.html +35 -0
- package/src/components-source/storybook-doc-components/template-breakpoint-storybook/template-breakpoint-storybook.component.scss +64 -0
- package/src/components-source/storybook-doc-components/template-breakpoint-storybook/template-breakpoint-storybook.component.ts +71 -0
- package/src/components-source/storybook-doc-components/tillte-table-documentation/tillte-table-documentation.component.html +44 -0
- package/src/components-source/storybook-doc-components/tillte-table-documentation/tillte-table-documentation.component.scss +270 -0
- package/src/components-source/storybook-doc-components/tillte-table-documentation/tillte-table-documentation.component.ts +153 -0
- package/src/components-source/tabs/tabs.component.html +26 -0
- package/src/components-source/tabs/tabs.component.scss +62 -0
- package/src/components-source/tabs/tabs.component.spec.ts +212 -0
- package/src/components-source/tabs/tabs.component.stories.ts +203 -0
- package/src/components-source/tabs/tabs.component.ts +138 -0
- package/src/components-source/tag-type-product/tag-type-product.component.html +1 -0
- package/src/components-source/tag-type-product/tag-type-product.component.scss +10 -0
- package/src/components-source/tag-type-product/tag-type-product.component.spec.ts +38 -0
- package/src/components-source/tag-type-product/tag-type-product.component.ts +9 -0
- package/src/components-source/toast/toast.component.html +37 -0
- package/src/components-source/toast/toast.component.scss +142 -0
- package/src/components-source/toast/toast.component.spec.ts +368 -0
- package/src/components-source/toast/toast.component.ts +59 -0
- package/src/components-source/toast/toast.stories.ts +69 -0
- package/src/components-source/tooltip/tooltip.component.html +46 -0
- package/src/components-source/tooltip/tooltip.component.scss +44 -0
- package/src/components-source/tooltip/tooltip.component.spec.ts +327 -0
- package/src/components-source/tooltip/tooltip.component.ts +24 -0
- package/src/components-source/ui-dropi.module.ts +125 -0
- package/src/components-source/ui-inventory.json +1138 -0
- package/src/components-source/vertical-steps/vertical-steps.component.html +35 -0
- package/src/components-source/vertical-steps/vertical-steps.component.scss +143 -0
- package/src/components-source/vertical-steps/vertical-steps.component.spec.ts +121 -0
- package/src/components-source/vertical-steps/vertical-steps.component.stories.ts +216 -0
- package/src/components-source/vertical-steps/vertical-steps.component.ts +151 -0
- package/src/index.ts +31 -0
- package/src/lib/bootstrap.ts +28 -0
- package/src/lib/dropi-ui-elements/dropi-ui-elements.component.html +1 -0
- package/src/lib/dropi-ui-elements/dropi-ui-elements.component.scss +0 -0
- package/src/lib/dropi-ui-elements/dropi-ui-elements.component.spec.ts +21 -0
- package/src/lib/dropi-ui-elements/dropi-ui-elements.component.ts +9 -0
- package/src/lib/elements-registry.ts +66 -0
- package/src/lib/elements.module.ts +22 -0
- package/src/styles.scss +152 -0
- package/src/test-setup.ts +6 -0
- package/tsconfig.json +28 -0
- package/tsconfig.lib.json +18 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +12 -0
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
Input,
|
|
4
|
+
Output,
|
|
5
|
+
EventEmitter,
|
|
6
|
+
OnInit,
|
|
7
|
+
HostListener,
|
|
8
|
+
ElementRef,
|
|
9
|
+
ViewChildren,
|
|
10
|
+
QueryList,
|
|
11
|
+
SimpleChanges,
|
|
12
|
+
} from '@angular/core';
|
|
13
|
+
import { CommonModule, DatePipe } from '@angular/common';
|
|
14
|
+
import { FormControl } from '@angular/forms';
|
|
15
|
+
import { DropiPaginatorComponent } from '../dropi-paginator/dropi-paginator.component';
|
|
16
|
+
import {
|
|
17
|
+
DropiTableAction,
|
|
18
|
+
DropiTableBackendParams,
|
|
19
|
+
DropiTableColumn,
|
|
20
|
+
DropiTableConfiguration,
|
|
21
|
+
DropiTableRow,
|
|
22
|
+
SortParams,
|
|
23
|
+
TypedField,
|
|
24
|
+
} from '@app/utilities/interfaces/ui/dropi-table.interface';
|
|
25
|
+
import { IconComponent } from '../icon/icon.component';
|
|
26
|
+
import { DropiCheckboxComponent } from '../dropi-checkbox/dropi-checkbox.component';
|
|
27
|
+
import { CurrencyComponent } from '@app/components/currency/currency.component';
|
|
28
|
+
import { DropiTagComponent } from '../dropi-tag/dropi-tag.component';
|
|
29
|
+
import { CarrierImageUrl } from '@app/utilities/pipes/carrier-image-url.pipe';
|
|
30
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
31
|
+
import { Subject, Subscription } from 'rxjs';
|
|
32
|
+
import { debounceTime } from 'rxjs/operators';
|
|
33
|
+
import { InputComponent } from '../input/input.component';
|
|
34
|
+
import { SpinnerComponent } from '@app/components/spinner/spinner.component';
|
|
35
|
+
import { TooltipModule } from 'primeng/tooltip';
|
|
36
|
+
import { CountryFlagsComponent } from '../country-flags/country-flags.component';
|
|
37
|
+
import { DropiAvatarsComponent } from '../dropi-avatars/dropi-avatars.component';
|
|
38
|
+
|
|
39
|
+
@Component({
|
|
40
|
+
selector: 'app-dropi-table',
|
|
41
|
+
standalone: true,
|
|
42
|
+
imports: [
|
|
43
|
+
CommonModule,
|
|
44
|
+
DropiPaginatorComponent,
|
|
45
|
+
IconComponent,
|
|
46
|
+
DropiCheckboxComponent,
|
|
47
|
+
CurrencyComponent,
|
|
48
|
+
DatePipe,
|
|
49
|
+
DropiTagComponent,
|
|
50
|
+
CarrierImageUrl,
|
|
51
|
+
TranslateModule,
|
|
52
|
+
InputComponent,
|
|
53
|
+
SpinnerComponent,
|
|
54
|
+
TooltipModule,
|
|
55
|
+
CountryFlagsComponent,
|
|
56
|
+
DropiAvatarsComponent,
|
|
57
|
+
],
|
|
58
|
+
templateUrl: './dropi-table.component.html',
|
|
59
|
+
styleUrls: ['./dropi-table.component.scss'],
|
|
60
|
+
})
|
|
61
|
+
export class DropiTableComponent implements OnInit {
|
|
62
|
+
/**
|
|
63
|
+
* Encabezados de la tabla Dropi.
|
|
64
|
+
*
|
|
65
|
+
* Este arreglo define las columnas que se mostrarán en la tabla,
|
|
66
|
+
* donde cada elemento es un objeto de tipo `DropiTableColumn` que
|
|
67
|
+
* especifica las propiedades y configuración de cada columna.
|
|
68
|
+
*
|
|
69
|
+
* key: Identificador de la columna
|
|
70
|
+
* label: Texto a mostrar en la columna
|
|
71
|
+
* sortable: Boleano que indica si la columna se puede ordenar
|
|
72
|
+
*
|
|
73
|
+
* @type {DropiTableColumn[]}
|
|
74
|
+
* @see DropiTableColumn
|
|
75
|
+
*/
|
|
76
|
+
@Input() public headers: DropiTableColumn[] = [];
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Datos que se mostrarán en la tabla.
|
|
80
|
+
*
|
|
81
|
+
* Es importante que cada key del objeto dentro del arreglo coincida con el key del header
|
|
82
|
+
* Si en la configuracion de la tabla el parametro `showActionsPerRow` esta en `true` se deben
|
|
83
|
+
* incluir las acciones ( DropiTableAction ) por cada una de las filas, esto para los casos en que
|
|
84
|
+
* las acciones de las filas varien entre si.
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* data = [
|
|
88
|
+
* {
|
|
89
|
+
"id": {
|
|
90
|
+
"type": "text",
|
|
91
|
+
"value": 0
|
|
92
|
+
},
|
|
93
|
+
"name": {
|
|
94
|
+
"type": "text",
|
|
95
|
+
"value": "Laptop"
|
|
96
|
+
},
|
|
97
|
+
"price": {
|
|
98
|
+
"type": "currency",
|
|
99
|
+
"value": 1500
|
|
100
|
+
},
|
|
101
|
+
"createdAt": {
|
|
102
|
+
"type": "date",
|
|
103
|
+
"value": "2025-06-02T14:23:45"
|
|
104
|
+
},
|
|
105
|
+
"statusTag": {
|
|
106
|
+
"type": "tag",
|
|
107
|
+
"value": "some text: 0",
|
|
108
|
+
"typeTag": "success"
|
|
109
|
+
},
|
|
110
|
+
"carrier": {
|
|
111
|
+
"type": "carrier",
|
|
112
|
+
"value": "Envía"
|
|
113
|
+
},
|
|
114
|
+
"textIcon": {
|
|
115
|
+
"type": "textIcon",
|
|
116
|
+
"value": "Icono texto",
|
|
117
|
+
"icon": "Location-market"
|
|
118
|
+
},
|
|
119
|
+
"statusDot": {
|
|
120
|
+
"type": "status",
|
|
121
|
+
"status": "low",
|
|
122
|
+
"value": "text low"
|
|
123
|
+
},
|
|
124
|
+
"textLink": {
|
|
125
|
+
"type": "textLink",
|
|
126
|
+
"url": "https://www.google.com/",
|
|
127
|
+
"urlText": "google",
|
|
128
|
+
"value": "0 Some text"
|
|
129
|
+
},
|
|
130
|
+
"disableCheckbox": true
|
|
131
|
+
}];
|
|
132
|
+
* ```
|
|
133
|
+
* @type {DropiTableRow[]}
|
|
134
|
+
* @see DropiTableRow
|
|
135
|
+
*/
|
|
136
|
+
@Input() public data: DropiTableRow[] = [];
|
|
137
|
+
|
|
138
|
+
@Input() public childData: DropiTableRow[] = [];
|
|
139
|
+
|
|
140
|
+
@Input() public visibleRowsChildrens: DropiTableRow[] = [];
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Configuración personalizada para la tabla Dropi.
|
|
144
|
+
*\ * Este input permite definir las opciones y parámetros que controlan el comportamiento,
|
|
145
|
+
* la apariencia y las funcionalidades de la tabla Dropi. Debe recibir un objeto de tipo
|
|
146
|
+
* `DropiTableConfiguration` que contenga las propiedades necesarias para la configuración
|
|
147
|
+
* deseada.
|
|
148
|
+
*
|
|
149
|
+
* rowActions: Acciones a mostrar en la columna final, si son mas de tres se mostrarán en un menu desplegable
|
|
150
|
+
* pageSizeConfiguration: Array de numeros para la configuracion de items a mostrar
|
|
151
|
+
* showCheckbox: Boleano para mostrar checkbox de seleccion de fila
|
|
152
|
+
* showSearch: Boleano para mostrar buscador general
|
|
153
|
+
* showPaginator: Boleano para mostrar la configuracion de paginacion ( Items por pagina y paginador )
|
|
154
|
+
* showActionsPerRow: Booleano que determina si se va a tomar la confiugracion de acciones independente por cada fila
|
|
155
|
+
* si es `true` se deben configurar las acciones por cada una de las filas
|
|
156
|
+
* emptyMessage: Muestra mensaje personalizado pata la tabla vacia, si no esta configurado
|
|
157
|
+
* su mensaje por defecto es `no data`.
|
|
158
|
+
*
|
|
159
|
+
* @type {DropiTableConfiguration}
|
|
160
|
+
* @see DropiTableConfiguration
|
|
161
|
+
*/
|
|
162
|
+
@Input() public dropiTableConfiguration: DropiTableConfiguration;
|
|
163
|
+
/**
|
|
164
|
+
* Configuración necesaria para la paginación por medio de un backend
|
|
165
|
+
*
|
|
166
|
+
* Este input permite definir los parámetros que controlan el comportamiento,
|
|
167
|
+
* la apariencia y las funcionalidades de la paginación de la tabla Dropi cuando
|
|
168
|
+
* se utiliza paginación en el backend. Debe recibir un objeto de tipo
|
|
169
|
+
* `DropiTableBackendParams` que contenga las propiedades necesarias para la configuración
|
|
170
|
+
* deseada.
|
|
171
|
+
*
|
|
172
|
+
* currentPage: Página actual que se está mostrando
|
|
173
|
+
* pageSize: Cantidad de elementos por página
|
|
174
|
+
* nextPage: Siguiente página disponible
|
|
175
|
+
* totalCount: Total de elementos disponibles
|
|
176
|
+
* totalPages: Total de páginas calculadas
|
|
177
|
+
* backendPagination: Booleano que indica si se debe paginar por backend.
|
|
178
|
+
*
|
|
179
|
+
* @type {DropiTableBackendParams}
|
|
180
|
+
* @see DropiTableBackendParams
|
|
181
|
+
*/
|
|
182
|
+
|
|
183
|
+
@Input() public dropiTableBackendParams: DropiTableBackendParams;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Indica si la tabla se encuentra en estado de carga.
|
|
187
|
+
*
|
|
188
|
+
* Cuando este valor es `true`, se puede mostrar un spinner o indicador visual
|
|
189
|
+
* para informar al usuario que los datos están siendo cargados o procesados.
|
|
190
|
+
* Necesario para las peticiones a un backend.
|
|
191
|
+
*
|
|
192
|
+
* @type {boolean}
|
|
193
|
+
* @default false
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
@Input() public loading: boolean = false;
|
|
197
|
+
|
|
198
|
+
//para paginaciones que no tiene un total de paginas
|
|
199
|
+
|
|
200
|
+
@Input() isCursorPagination: boolean = false;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Evento emitido cuando se seleccionan filas en la tabla.
|
|
204
|
+
*
|
|
205
|
+
* @event
|
|
206
|
+
* @type {EventEmitter<DropiTableRow[]>}
|
|
207
|
+
* @description Emite un arreglo de objetos `DropiTableRow` que representan las filas seleccionadas por el usuario.
|
|
208
|
+
*/
|
|
209
|
+
@Output() rowsSelected = new EventEmitter<DropiTableRow[]>();
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Evento emitido cuando se hace clic en una acción de una fila de la tabla.
|
|
213
|
+
*
|
|
214
|
+
* @event
|
|
215
|
+
* @type {{ row: DropiTableRow; action: DropiTableAction }} - Objeto que contiene la fila seleccionada y la acción ejecutada.
|
|
216
|
+
*/
|
|
217
|
+
@Output() actionClicked = new EventEmitter<{ row: DropiTableRow; action: DropiTableAction }>();
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Evento emitido cuando se cambia de pagina
|
|
221
|
+
* Usar solo cuando se pagina por backend
|
|
222
|
+
* @event
|
|
223
|
+
* @type {number} - Se emite el numero de pagina seleccionada
|
|
224
|
+
*/
|
|
225
|
+
|
|
226
|
+
@Output() onPageChange = new EventEmitter<number>();
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Evento emitido cuando se cambia la cantidad de items por pagina
|
|
230
|
+
* Usar solo cuando se pagina por backend
|
|
231
|
+
* @event
|
|
232
|
+
* @type {number} - Se emite el numero de la cantidad de items a mostrar
|
|
233
|
+
*/
|
|
234
|
+
@Output() onSizeChange = new EventEmitter<number>();
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Evento emitido cuando se cambia la columna de ordenación
|
|
238
|
+
* Usar solo cuando se pagina por backend
|
|
239
|
+
* @event
|
|
240
|
+
* @type {SortParams} - Se emite el nombre de la columna y si es ascendente o descendente
|
|
241
|
+
*/
|
|
242
|
+
@Output() onSortChange = new EventEmitter<SortParams>();
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Evento emitido cuando se realiza una búsqueda con paginación de backend
|
|
246
|
+
* @event
|
|
247
|
+
* @type {string} - Se emite el término de búsqueda
|
|
248
|
+
*/
|
|
249
|
+
@Output() onSearchChange = new EventEmitter<string>();
|
|
250
|
+
|
|
251
|
+
@Output() expandChildren = new EventEmitter<{ row: DropiTableRow }>();
|
|
252
|
+
@ViewChildren(DropiCheckboxComponent) checkboxes!: QueryList<DropiCheckboxComponent>;
|
|
253
|
+
|
|
254
|
+
public currentPage: number = 1;
|
|
255
|
+
public totalPages: number;
|
|
256
|
+
public dataToShow: DropiTableRow[] = [];
|
|
257
|
+
private sortColumn: string;
|
|
258
|
+
public sortAsc: boolean = true;
|
|
259
|
+
public hidePaginator: boolean = false;
|
|
260
|
+
private pageSize: number;
|
|
261
|
+
private actionsMenuRef: ElementRef | null;
|
|
262
|
+
private selectedRows: DropiTableRow[] = [];
|
|
263
|
+
private subscriptions: Subscription = new Subscription();
|
|
264
|
+
private filterEvent: Subject<string> = new Subject();
|
|
265
|
+
public searchTerm: FormControl = new FormControl();
|
|
266
|
+
public hasActions: boolean = false;
|
|
267
|
+
public hasShortActions: boolean = false;
|
|
268
|
+
|
|
269
|
+
ngOnInit(): void {
|
|
270
|
+
this.hasActions =
|
|
271
|
+
(this.dropiTableConfiguration?.rowActions &&
|
|
272
|
+
this.dropiTableConfiguration.rowActions.length > 0) ||
|
|
273
|
+
this.dropiTableConfiguration?.showActionsPerRow;
|
|
274
|
+
|
|
275
|
+
if (!this.dropiTableConfiguration.backendPagination) {
|
|
276
|
+
this.updateData();
|
|
277
|
+
if (this.dropiTableConfiguration.showSearch) {
|
|
278
|
+
this.filterEventSusbscribe();
|
|
279
|
+
this.subscribeToSearch();
|
|
280
|
+
}
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
this.setBackendParams();
|
|
284
|
+
// Subscribe to search for backend pagination
|
|
285
|
+
if (this.dropiTableConfiguration.showSearch && this.dropiTableConfiguration.backendPagination) {
|
|
286
|
+
this.subscribeToSearchBackend();
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
setBackendParams() {
|
|
291
|
+
this.totalPages = this.dropiTableBackendParams?.totalPages;
|
|
292
|
+
this.currentPage = this.dropiTableBackendParams?.currentPage;
|
|
293
|
+
this.pageSize = this.dropiTableBackendParams?.pageSize;
|
|
294
|
+
this.dataToShow = this.data;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
298
|
+
if (changes['data']) {
|
|
299
|
+
if (!this.dropiTableConfiguration.backendPagination) {
|
|
300
|
+
this.updateData();
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
this.setBackendParams();
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
ngOnDestroy() {
|
|
308
|
+
this.subscriptions.unsubscribe();
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
updateData() {
|
|
312
|
+
this.setPagination();
|
|
313
|
+
this.pageData();
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
@HostListener('document:click', ['$event'])
|
|
317
|
+
handleClickOutside(event: MouseEvent) {
|
|
318
|
+
if (!this.hasActions) return;
|
|
319
|
+
|
|
320
|
+
const clickedInside = this.actionsMenuRef
|
|
321
|
+
? this.actionsMenuRef.nativeElement.contains(event.target)
|
|
322
|
+
: false;
|
|
323
|
+
if (!clickedInside && this.actionsMenuRef) {
|
|
324
|
+
this.hideMenu();
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
setPagination() {
|
|
329
|
+
if (!this.dropiTableConfiguration.showPaginator) return;
|
|
330
|
+
if (!this.dropiTableConfiguration?.pageSizeConfiguration) {
|
|
331
|
+
this.dropiTableConfiguration.pageSizeConfiguration = [5, 10, 20];
|
|
332
|
+
}
|
|
333
|
+
this.pageSize = this.dropiTableConfiguration.pageSizeConfiguration[0];
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
subscribeToSearch() {
|
|
337
|
+
this.subscriptions.add(
|
|
338
|
+
this.searchTerm.valueChanges.subscribe((inputValue) => {
|
|
339
|
+
this.currentPage = 1;
|
|
340
|
+
this.filterEvent.next(inputValue);
|
|
341
|
+
}),
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
subscribeToSearchBackend() {
|
|
346
|
+
this.subscriptions.add(
|
|
347
|
+
this.searchTerm.valueChanges.pipe(debounceTime(500)).subscribe((inputValue: string) => {
|
|
348
|
+
this.onSearchChange.emit(inputValue || '');
|
|
349
|
+
}),
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
filterEventSusbscribe() {
|
|
354
|
+
this.subscriptions.add(
|
|
355
|
+
this.filterEvent.pipe(debounceTime(500)).subscribe((inputValue: string) => {
|
|
356
|
+
this.filteredData(inputValue);
|
|
357
|
+
}),
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
getTotalPages() {
|
|
362
|
+
this.totalPages = Math.ceil(this.data.length / this.pageSize);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
onSort(column: DropiTableColumn) {
|
|
366
|
+
if (!column?.sortable) return;
|
|
367
|
+
this.sortAsc = this.sortColumn === column.key ? !this.sortAsc : false;
|
|
368
|
+
this.sortColumn = column.key;
|
|
369
|
+
if (!this.dropiTableConfiguration.backendPagination) {
|
|
370
|
+
this.sortData();
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
this.onSortChange.emit({ column: this.sortColumn, asc: this.sortAsc });
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
pageData() {
|
|
377
|
+
if (!this.dropiTableConfiguration?.showPaginator) {
|
|
378
|
+
this.dataToShow = this.data;
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
const start = (this.currentPage - 1) * this.pageSize;
|
|
382
|
+
this.dataToShow = this.data.slice(start, start + this.pageSize);
|
|
383
|
+
this.hidePaginator = false;
|
|
384
|
+
this.getTotalPages();
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
sortData() {
|
|
388
|
+
this.hideMenu();
|
|
389
|
+
if (!this.sortColumn) return this.dataToShow;
|
|
390
|
+
this.data.sort((a, b) => {
|
|
391
|
+
return (
|
|
392
|
+
(a[this.sortColumn]['value'] > b[this.sortColumn]['value'] ? 1 : -1) *
|
|
393
|
+
(this.sortAsc ? 1 : -1)
|
|
394
|
+
);
|
|
395
|
+
});
|
|
396
|
+
this.pageData();
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
onSelectRow(checkValue: boolean, row: DropiTableRow) {
|
|
400
|
+
checkValue
|
|
401
|
+
? this.selectedRows.push(row)
|
|
402
|
+
: (this.selectedRows = this.selectedRows.filter((rowToDelete) => {
|
|
403
|
+
return row.id.value !== rowToDelete.id.value;
|
|
404
|
+
}));
|
|
405
|
+
|
|
406
|
+
this.rowsSelected.emit(this.selectedRows);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
goToPage(page: number) {
|
|
410
|
+
if (!this.dropiTableConfiguration.backendPagination) {
|
|
411
|
+
this.currentPage = Number(page);
|
|
412
|
+
this.pageData();
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
this.onPageChange.emit(page);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
filteredData(inputValue: string) {
|
|
419
|
+
if (!inputValue) {
|
|
420
|
+
this.pageData();
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
this.hidePaginator = true;
|
|
425
|
+
this.dataToShow = this.data.filter((row) => {
|
|
426
|
+
return Object.values(row).some((val: TypedField) =>
|
|
427
|
+
String(val.value).toLowerCase().includes(inputValue.toLowerCase()),
|
|
428
|
+
);
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
onChangePageSize(pageSize: string) {
|
|
433
|
+
if (!this.dropiTableConfiguration.backendPagination) {
|
|
434
|
+
this.pageSize = Number(pageSize);
|
|
435
|
+
this.currentPage = 1;
|
|
436
|
+
this.pageData();
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
this.onSizeChange.emit(Number(pageSize));
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
toggleActions(
|
|
443
|
+
indexToShow: number,
|
|
444
|
+
ref: ElementRef,
|
|
445
|
+
childActions: boolean = false,
|
|
446
|
+
indexChild: number,
|
|
447
|
+
) {
|
|
448
|
+
if (!childActions) {
|
|
449
|
+
if (!this.dataToShow[indexToShow].showActions) {
|
|
450
|
+
this.hideMenu();
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
this.dataToShow[indexToShow].showActions = !this.dataToShow[indexToShow].showActions;
|
|
454
|
+
this.actionsMenuRef = { nativeElement: ref } as ElementRef;
|
|
455
|
+
} else {
|
|
456
|
+
if (!this.childData[indexChild].showActions) {
|
|
457
|
+
this.hideMenu();
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
this.childData[indexChild].showActions = !this.childData[indexChild].showActions;
|
|
461
|
+
this.actionsMenuRef = { nativeElement: ref } as ElementRef;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
onActionClicked(row: DropiTableRow, action: DropiTableAction, event?: MouseEvent) {
|
|
466
|
+
// Detener la propagación del evento para evitar que el HostListener lo capture
|
|
467
|
+
if (event) {
|
|
468
|
+
event.stopPropagation();
|
|
469
|
+
event.preventDefault();
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if (action) {
|
|
473
|
+
this.actionClicked.emit({ row, action });
|
|
474
|
+
this.hideMenu();
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
hideMenu() {
|
|
479
|
+
if (!this.hasActions) return;
|
|
480
|
+
|
|
481
|
+
// Modificar directamente las propiedades sin reemplazar los objetos del array
|
|
482
|
+
// para evitar disparar change detection innecesario
|
|
483
|
+
this.dataToShow.forEach((item) => {
|
|
484
|
+
item.showActions = false;
|
|
485
|
+
});
|
|
486
|
+
if (this.childData) {
|
|
487
|
+
this.childData.forEach((childRowItem) => {
|
|
488
|
+
childRowItem.showActions = false;
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
this.actionsMenuRef = null;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
onSelectAll(allSelected: boolean) {
|
|
495
|
+
let selectedRows: DropiTableRow[] = [];
|
|
496
|
+
this.checkboxes.forEach((cb, index) => {
|
|
497
|
+
if (index === 0) return;
|
|
498
|
+
cb.checked = !cb.disabled && allSelected;
|
|
499
|
+
if (cb.checked) {
|
|
500
|
+
selectedRows.push(this.dataToShow[index - 1]);
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
this.selectedRows = selectedRows;
|
|
505
|
+
this.rowsSelected.emit(this.selectedRows);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
resetSelectedRows() {
|
|
509
|
+
this.selectedRows = [];
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// Nuevo método mejorado para manejar recursividad
|
|
513
|
+
toggleTableRow(row: any, isChild: boolean = false) {
|
|
514
|
+
console.log('toggleTableRow called:', {
|
|
515
|
+
row: row,
|
|
516
|
+
isChild: isChild,
|
|
517
|
+
expanded: row.expanded,
|
|
518
|
+
tot_child: row.tot_child,
|
|
519
|
+
children: row.children,
|
|
520
|
+
childrenLength: row.children?.length,
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
// Si no es un hijo, colapsar todas las otras filas principales
|
|
524
|
+
if (!isChild) {
|
|
525
|
+
this.dataToShow.forEach((mainRow) => {
|
|
526
|
+
if (mainRow !== row) {
|
|
527
|
+
this.collapseRowRecursively(mainRow);
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// Toggle del estado expandido
|
|
533
|
+
row.expanded = !row.expanded;
|
|
534
|
+
|
|
535
|
+
// Si se está expandiendo y no tiene hijos cargados, emitir evento para cargarlos
|
|
536
|
+
if (row.expanded && row.tot_child?.value > 0 && (!row.children || row.children.length === 0)) {
|
|
537
|
+
console.log('Emitiendo expandChildren event para:', row);
|
|
538
|
+
this.expandChildren.emit(row);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// Si se está colapsando, colapsar también todos los hijos recursivamente
|
|
542
|
+
if (!row.expanded && row.children) {
|
|
543
|
+
this.collapseRowRecursively(row);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// Método auxiliar para colapsar recursivamente
|
|
548
|
+
private collapseRowRecursively(row: any) {
|
|
549
|
+
row.expanded = false;
|
|
550
|
+
if (row.children) {
|
|
551
|
+
row.children.forEach((child) => this.collapseRowRecursively(child));
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Método público para asignar hijos a una fila específica
|
|
557
|
+
* Se usa después de que el componente padre obtiene los datos del API
|
|
558
|
+
*/
|
|
559
|
+
public setRowChildren(parentRow: any, children: DropiTableRow[]) {
|
|
560
|
+
console.log('setRowChildren called:', { parentRow, children });
|
|
561
|
+
parentRow.children = children;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Método para encontrar una fila por ID de manera recursiva
|
|
566
|
+
* Útil para actualizar filas anidadas después de llamadas al API
|
|
567
|
+
*/
|
|
568
|
+
public findRowById(id: any, rows: DropiTableRow[] = this.dataToShow): DropiTableRow | null {
|
|
569
|
+
for (const row of rows) {
|
|
570
|
+
if (row.id.value === id) {
|
|
571
|
+
return row;
|
|
572
|
+
}
|
|
573
|
+
if (row.children && row.children.length > 0) {
|
|
574
|
+
const found = this.findRowById(id, row.children);
|
|
575
|
+
if (found) return found;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
return null;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<div class="container-chips">
|
|
2
|
+
<div
|
|
3
|
+
class="tags Body-S-Medium text-style"
|
|
4
|
+
[ngStyle]="setState()"
|
|
5
|
+
[class.icon-only]="showIcon && !hasContent"
|
|
6
|
+
>
|
|
7
|
+
<app-icon
|
|
8
|
+
class="file-icon"
|
|
9
|
+
*ngIf="showIcon && icon"
|
|
10
|
+
[name]="icon"
|
|
11
|
+
width="16px"
|
|
12
|
+
height="16px"
|
|
13
|
+
[color]="this.fontColor"
|
|
14
|
+
></app-icon>
|
|
15
|
+
<span *ngIf="hasContent">{{ text }}</span>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.tags {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
padding: 4px 8px;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 4px;
|
|
7
|
+
border-radius: var(--Border-5, 32px);
|
|
8
|
+
background: var(--Primary-Primary-500, #f49a3d);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Cuando solo hay icono, ajustar el padding y eliminar el gap
|
|
12
|
+
.tags.icon-only {
|
|
13
|
+
// padding: 6px;
|
|
14
|
+
gap: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tags.icon-only .file-icon {
|
|
18
|
+
margin-right: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.text-style {
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
text-align: center;
|
|
24
|
+
text-overflow: ellipsis;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.container-chips {
|
|
28
|
+
display: inline-block;
|
|
29
|
+
app-icon {
|
|
30
|
+
display: flex;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.file-icon {
|
|
35
|
+
margin-right: 4px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.close-icon {
|
|
39
|
+
margin-left: 4px;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.tags > p {
|
|
44
|
+
margin: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.img-chips {
|
|
48
|
+
margin-right: 4px;
|
|
49
|
+
max-width: 20px;
|
|
50
|
+
}
|