@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,88 @@
|
|
|
1
|
+
:host ::ng-deep {
|
|
2
|
+
.dropi-drawer {
|
|
3
|
+
|
|
4
|
+
h3 {
|
|
5
|
+
color: var(--Gray-700, #32394D);
|
|
6
|
+
font-family: Inter, sans-serif;
|
|
7
|
+
font-size: 24px;
|
|
8
|
+
font-style: normal;
|
|
9
|
+
font-weight: 700;
|
|
10
|
+
line-height: 110%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.p-sidebar-content > * {
|
|
14
|
+
display: flex;
|
|
15
|
+
height: 100%;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.p-sidebar {
|
|
20
|
+
max-width: 100%;
|
|
21
|
+
min-width: auto;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.size-m {
|
|
25
|
+
.p-sidebar {
|
|
26
|
+
width: 550px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.size-l {
|
|
31
|
+
.p-sidebar {
|
|
32
|
+
width: 1137px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.size-xl {
|
|
37
|
+
.p-sidebar {
|
|
38
|
+
width: 1280px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.size-xxl {
|
|
43
|
+
.p-sidebar {
|
|
44
|
+
width: 1330px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// .p-sidebar-right {
|
|
49
|
+
// width: 100%;
|
|
50
|
+
// max-width: 550px;
|
|
51
|
+
// }
|
|
52
|
+
|
|
53
|
+
.p-sidebar-header {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
align-items: center;
|
|
58
|
+
|
|
59
|
+
.p-sidebar-icon {
|
|
60
|
+
width: var(--Size-6, 32px);
|
|
61
|
+
height: var(--Size-6, 32px);
|
|
62
|
+
color: var(--Gray-400, #858EA6);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.p-sidebar .p-sidebar-header .p-sidebar-close, .p-sidebar .p-sidebar-header .p-sidebar-icon {
|
|
67
|
+
width: var(--Size-6, 32px);
|
|
68
|
+
height: var(--Size-6, 32px);
|
|
69
|
+
color: var(--Gray-400, #858EA6);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.p-sidebar-footer {
|
|
73
|
+
display: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&.headless {
|
|
77
|
+
.p-sidebar-header {
|
|
78
|
+
display: none;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.actions {
|
|
83
|
+
.btn.normal {
|
|
84
|
+
padding: var(--Size-2);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { DropiDrawerComponent } from './dropi-drawer.component';
|
|
3
|
+
import { DrawerService } from '@app/services/drawer.service';
|
|
4
|
+
import { BehaviorSubject, of } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
// Mock DrawerService
|
|
7
|
+
const mockDrawerService = {
|
|
8
|
+
defaultDrawerConfig: {
|
|
9
|
+
position: 'right',
|
|
10
|
+
width: '400px',
|
|
11
|
+
showHeader: true,
|
|
12
|
+
},
|
|
13
|
+
drawerContent$: new BehaviorSubject(null),
|
|
14
|
+
drawerHeader$: new BehaviorSubject(''),
|
|
15
|
+
drawerIsOpen$: new BehaviorSubject(false),
|
|
16
|
+
closeDrawer: jest.fn(),
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
describe('DropiDrawerComponent', () => {
|
|
20
|
+
let component: DropiDrawerComponent;
|
|
21
|
+
let fixture: ComponentFixture<DropiDrawerComponent>;
|
|
22
|
+
let drawerService: typeof mockDrawerService;
|
|
23
|
+
|
|
24
|
+
beforeEach(async () => {
|
|
25
|
+
await TestBed.configureTestingModule({
|
|
26
|
+
imports: [DropiDrawerComponent],
|
|
27
|
+
providers: [{ provide: DrawerService, useValue: mockDrawerService }],
|
|
28
|
+
}).compileComponents();
|
|
29
|
+
|
|
30
|
+
fixture = TestBed.createComponent(DropiDrawerComponent);
|
|
31
|
+
component = fixture.componentInstance;
|
|
32
|
+
drawerService = TestBed.inject(DrawerService) as unknown as typeof mockDrawerService;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
describe('Inicialización del componente', () => {
|
|
36
|
+
it('should create', () => {
|
|
37
|
+
expect(component).toBeTruthy();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should initialize with default drawer config', () => {
|
|
41
|
+
expect(component.drawerConfig).toEqual(mockDrawerService.defaultDrawerConfig);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('should initialize drawerTitle as null', () => {
|
|
45
|
+
expect(component.drawerTitle).toBeNull();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should initialize drawerIsOpen as false', () => {
|
|
49
|
+
expect(component.drawerIsOpen).toBe(false);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('should initialize componentRef as undefined', () => {
|
|
53
|
+
expect(component.componentRef).toBeUndefined();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('Método close', () => {
|
|
58
|
+
it('should call drawerService.closeDrawer', () => {
|
|
59
|
+
component.close();
|
|
60
|
+
expect(drawerService.closeDrawer).toHaveBeenCalled();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
describe('Subscripciones', () => {
|
|
65
|
+
it('should handle drawerHeader$ subscription without render', () => {
|
|
66
|
+
// Test subscription behavior without triggering template render
|
|
67
|
+
mockDrawerService.drawerHeader$.next('Test Header');
|
|
68
|
+
expect(mockDrawerService.drawerHeader$.getValue()).toBe('Test Header');
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('should handle drawerIsOpen$ subscription without render', () => {
|
|
72
|
+
mockDrawerService.drawerIsOpen$.next(true);
|
|
73
|
+
expect(mockDrawerService.drawerIsOpen$.getValue()).toBe(true);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
describe('Lifecycle hooks', () => {
|
|
78
|
+
it('should clean up subscriptions on ngOnDestroy', () => {
|
|
79
|
+
// No error should be thrown
|
|
80
|
+
component.ngOnDestroy();
|
|
81
|
+
expect(true).toBe(true);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { AfterViewInit, Component, ComponentRef, EventEmitter, Input, NO_ERRORS_SCHEMA, OnDestroy, ViewChild, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { Subscription } from 'rxjs';
|
|
4
|
+
|
|
5
|
+
import { NgPrimeModule } from '@app/ngprime.module';
|
|
6
|
+
import { DrawerService } from '@app/services/drawer.service';
|
|
7
|
+
import { DrawerConfig } from '@app/utilities/interfaces/ui/drawer.interface';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'dropi-drawer',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [
|
|
13
|
+
CommonModule,
|
|
14
|
+
NgPrimeModule
|
|
15
|
+
],
|
|
16
|
+
templateUrl: './dropi-drawer.component.html',
|
|
17
|
+
styleUrls: ['./dropi-drawer.component.scss'],
|
|
18
|
+
schemas: [NO_ERRORS_SCHEMA]
|
|
19
|
+
})
|
|
20
|
+
export class DropiDrawerComponent implements OnDestroy, AfterViewInit {
|
|
21
|
+
@ViewChild('container', { read: ViewContainerRef }) container!: ViewContainerRef;
|
|
22
|
+
|
|
23
|
+
drawerConfig: DrawerConfig;
|
|
24
|
+
drawerTitle: string = null;
|
|
25
|
+
drawerIsOpen: boolean = false;
|
|
26
|
+
componentRef: ComponentRef<any> | null;
|
|
27
|
+
private readonly subscriptions = new Subscription();
|
|
28
|
+
|
|
29
|
+
constructor(private readonly drawerService: DrawerService) {
|
|
30
|
+
this.drawerConfig = this.drawerService.defaultDrawerConfig;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
ngAfterViewInit() {
|
|
34
|
+
this.subscriptions.add(
|
|
35
|
+
this.drawerService.drawerContent$.subscribe((content) => {
|
|
36
|
+
if (content && this.container) {
|
|
37
|
+
this.container.clear();
|
|
38
|
+
if (this.componentRef) this.componentRef.destroy();
|
|
39
|
+
|
|
40
|
+
this.componentRef = this.container.createComponent(content.component);
|
|
41
|
+
|
|
42
|
+
if (content.inputs) {
|
|
43
|
+
Object.keys(content.inputs).forEach((key) => {
|
|
44
|
+
this.componentRef.instance[key] = content.inputs[key];
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (content.outputs) {
|
|
49
|
+
Object.keys(content.outputs).forEach((key) => {
|
|
50
|
+
if (this.componentRef.instance[key] instanceof EventEmitter) {
|
|
51
|
+
this.subscriptions.add(
|
|
52
|
+
this.componentRef.instance[key].subscribe((...args: any[]) => {
|
|
53
|
+
content.outputs[key](...args);
|
|
54
|
+
})
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
this.drawerConfig = content.config;
|
|
60
|
+
this.componentRef.changeDetectorRef.detectChanges();
|
|
61
|
+
}
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
this.subscriptions.add(
|
|
66
|
+
this.drawerService.drawerHeader$.subscribe(
|
|
67
|
+
(header) => (this.drawerTitle = header),
|
|
68
|
+
),
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
this.subscriptions.add(
|
|
72
|
+
this.drawerService.drawerIsOpen$.subscribe(
|
|
73
|
+
(isOpen) => (this.drawerIsOpen = isOpen),
|
|
74
|
+
),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
close() {
|
|
79
|
+
this.drawerService.closeDrawer();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
get sizeClass(): string {
|
|
83
|
+
return (this.drawerConfig?.size ?? '').toLowerCase();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
ngOnDestroy() {
|
|
88
|
+
this.subscriptions.unsubscribe();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<div
|
|
2
|
+
[ngClass]="isInSelect ? 'container-dropi-dropdown-select' : 'container-dropi-dropdown'"
|
|
3
|
+
[style.--custom-height]="height || '388px'"
|
|
4
|
+
>
|
|
5
|
+
<div class="content-dropdown" *ngFor="let optionlItem of options; let i = index">
|
|
6
|
+
<div
|
|
7
|
+
class="container-check-dropdown"
|
|
8
|
+
[ngClass]="{ 'active-option': optionlItem?.checked }"
|
|
9
|
+
*ngIf="parameters.type === 'checkbox'"
|
|
10
|
+
>
|
|
11
|
+
<app-dropi-checkbox
|
|
12
|
+
[checked]="optionlItem?.checked || false"
|
|
13
|
+
(onChange)="toggleValue($event, optionlItem, i)"
|
|
14
|
+
></app-dropi-checkbox>
|
|
15
|
+
<!-- si vamos a activar el avatar para transportadora -->
|
|
16
|
+
<dropi-avatars
|
|
17
|
+
*ngIf="parameters.iconCurrier"
|
|
18
|
+
[image]="optionlItem[valueModel] | carrierImageUrl"
|
|
19
|
+
[type]="'transport'"
|
|
20
|
+
></dropi-avatars>
|
|
21
|
+
|
|
22
|
+
<dropi-avatars
|
|
23
|
+
*ngIf="parameters.icon"
|
|
24
|
+
[image]="optionlItem.image"
|
|
25
|
+
[type]="'transport'"
|
|
26
|
+
></dropi-avatars>
|
|
27
|
+
<span class="Body-M-Regular">{{ optionlItem[valueModel] }}</span>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.container-dropi-dropdown {
|
|
2
|
+
border-bottom-left-radius: var(--Size-2);
|
|
3
|
+
border-bottom-right-radius: var(--Size-2);
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
background-color: white;
|
|
7
|
+
height: var(--custom-height);
|
|
8
|
+
overflow-y: auto;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.container-dropi-dropdown-select {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
overflow-y: hidden;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.content-dropdown {
|
|
18
|
+
display: flex;
|
|
19
|
+
border-radius: var(--Size-1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.active-option {
|
|
23
|
+
background-color: var(--Primary-Primary-50);
|
|
24
|
+
.Body-M-Regular {
|
|
25
|
+
color: var(--Primary-Primary-500);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.container-check-dropdown {
|
|
30
|
+
display: flex;
|
|
31
|
+
width: 100%;
|
|
32
|
+
gap: var(--Size-2);
|
|
33
|
+
padding: var(--Size-3) var(--Size-4);
|
|
34
|
+
align-items: center;
|
|
35
|
+
min-width: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.container-check-dropdown:not(.active-option):hover {
|
|
39
|
+
background-color: var(--Gray-Gray-50);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
::ng-deep .container-check-dropdown {
|
|
43
|
+
dropi-avatars {
|
|
44
|
+
.dropi-avatars {
|
|
45
|
+
.dropi-avatar.transport {
|
|
46
|
+
width: 20px;
|
|
47
|
+
height: 20px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.container-check-dropdown .Body-M-Regular {
|
|
54
|
+
flex: 1;
|
|
55
|
+
white-space: normal;
|
|
56
|
+
overflow-wrap: break-word;
|
|
57
|
+
word-break: break-word;
|
|
58
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { DropiDropdownComponent } from './dropi-dropdown.component';
|
|
3
|
+
import { DropiCheckboxComponent } from '../dropi-checkbox/dropi-checkbox.component';
|
|
4
|
+
import { DropiAvatarsComponent } from '../dropi-avatars/dropi-avatars.component';
|
|
5
|
+
import { CarrierImageUrl } from '@app/utilities/pipes/carrier-image-url.pipe';
|
|
6
|
+
|
|
7
|
+
describe('DropiDropdownComponent', () => {
|
|
8
|
+
let component: DropiDropdownComponent;
|
|
9
|
+
let fixture: ComponentFixture<DropiDropdownComponent>;
|
|
10
|
+
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
await TestBed.configureTestingModule({
|
|
13
|
+
imports: [
|
|
14
|
+
DropiDropdownComponent,
|
|
15
|
+
DropiCheckboxComponent,
|
|
16
|
+
DropiAvatarsComponent,
|
|
17
|
+
CarrierImageUrl,
|
|
18
|
+
],
|
|
19
|
+
}).compileComponents();
|
|
20
|
+
|
|
21
|
+
fixture = TestBed.createComponent(DropiDropdownComponent);
|
|
22
|
+
component = fixture.componentInstance;
|
|
23
|
+
fixture.detectChanges();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe('Inicialización del componente', () => {
|
|
27
|
+
it('should create', () => {
|
|
28
|
+
expect(component).toBeTruthy();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should initialize with default values', () => {
|
|
32
|
+
expect(component.height).toBe('');
|
|
33
|
+
expect(component.options).toEqual([]);
|
|
34
|
+
expect(component.valueModel).toBe('name');
|
|
35
|
+
expect(component.isInSelect).toBe(false);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should initialize parameters with default values', () => {
|
|
39
|
+
expect(component.parameters).toBeDefined();
|
|
40
|
+
expect(component.parameters.type).toBe('checkbox');
|
|
41
|
+
expect(component.parameters.icon).toBe('');
|
|
42
|
+
expect(component.parameters.iconCurrier).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe('Propiedades de entrada', () => {
|
|
47
|
+
it('should accept custom height', () => {
|
|
48
|
+
component.height = '200px';
|
|
49
|
+
expect(component.height).toBe('200px');
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('should accept options array', () => {
|
|
53
|
+
const mockOptions = [
|
|
54
|
+
{ id: 1, name: 'Option 1', checked: false },
|
|
55
|
+
{ id: 2, name: 'Option 2', checked: false },
|
|
56
|
+
];
|
|
57
|
+
component.options = mockOptions;
|
|
58
|
+
expect(component.options).toEqual(mockOptions);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should accept custom valueModel', () => {
|
|
62
|
+
component.valueModel = 'label';
|
|
63
|
+
expect(component.valueModel).toBe('label');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('should accept isInSelect flag', () => {
|
|
67
|
+
component.isInSelect = true;
|
|
68
|
+
expect(component.isInSelect).toBe(true);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('should accept custom parameters', () => {
|
|
72
|
+
const customParams = {
|
|
73
|
+
type: 'checkbox' as const,
|
|
74
|
+
icon: 'home',
|
|
75
|
+
iconCurrier: true,
|
|
76
|
+
};
|
|
77
|
+
component.parameters = customParams;
|
|
78
|
+
expect(component.parameters).toEqual(customParams);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
describe('Funcionalidad de toggle', () => {
|
|
83
|
+
beforeEach(() => {
|
|
84
|
+
component.options = [
|
|
85
|
+
{ id: 1, name: 'Option 1', checked: false },
|
|
86
|
+
{ id: 2, name: 'Option 2', checked: false },
|
|
87
|
+
{ id: 3, name: 'Option 3', checked: false },
|
|
88
|
+
];
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('should toggle value to checked', () => {
|
|
92
|
+
const emitSpy = jest.spyOn(component.modelChange, 'emit');
|
|
93
|
+
|
|
94
|
+
component.toggleValue(true, component.options[0], 0);
|
|
95
|
+
|
|
96
|
+
expect(component.options[0].checked).toBe(true);
|
|
97
|
+
expect(emitSpy).toHaveBeenCalled();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('should toggle value to unchecked', () => {
|
|
101
|
+
component.options[0].checked = true;
|
|
102
|
+
const emitSpy = jest.spyOn(component.modelChange, 'emit');
|
|
103
|
+
|
|
104
|
+
component.toggleValue(false, component.options[0], 0);
|
|
105
|
+
|
|
106
|
+
expect(component.options[0].checked).toBe(false);
|
|
107
|
+
expect(emitSpy).toHaveBeenCalled();
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('should emit only checked values', () => {
|
|
111
|
+
const emitSpy = jest.spyOn(component.modelChange, 'emit');
|
|
112
|
+
|
|
113
|
+
component.toggleValue(true, component.options[0], 0);
|
|
114
|
+
component.toggleValue(true, component.options[2], 2);
|
|
115
|
+
|
|
116
|
+
const expectedValues = [
|
|
117
|
+
{ id: 1, name: 'Option 1', checked: true },
|
|
118
|
+
{ id: 3, name: 'Option 3', checked: true },
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
expect(emitSpy).toHaveBeenCalledWith(expectedValues);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('should handle multiple toggles correctly', () => {
|
|
125
|
+
const emitSpy = jest.spyOn(component.modelChange, 'emit');
|
|
126
|
+
|
|
127
|
+
component.toggleValue(true, component.options[0], 0);
|
|
128
|
+
component.toggleValue(true, component.options[1], 1);
|
|
129
|
+
component.toggleValue(false, component.options[0], 0);
|
|
130
|
+
|
|
131
|
+
const lastEmit = emitSpy.mock.calls[emitSpy.mock.calls.length - 1][0];
|
|
132
|
+
expect(lastEmit.length).toBe(1);
|
|
133
|
+
expect(lastEmit[0].id).toBe(2);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
describe('Funcionalidad de reset', () => {
|
|
138
|
+
beforeEach(() => {
|
|
139
|
+
component.options = [
|
|
140
|
+
{ id: 1, name: 'Option 1', checked: true },
|
|
141
|
+
{ id: 2, name: 'Option 2', checked: true },
|
|
142
|
+
{ id: 3, name: 'Option 3', checked: false },
|
|
143
|
+
];
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('should reset all checks to false', () => {
|
|
147
|
+
component.resetChecks();
|
|
148
|
+
|
|
149
|
+
component.options.forEach((option) => {
|
|
150
|
+
expect(option.checked).toBe(false);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('should emit empty array when reset', () => {
|
|
155
|
+
const emitSpy = jest.spyOn(component.modelChange, 'emit');
|
|
156
|
+
|
|
157
|
+
component.resetChecks();
|
|
158
|
+
|
|
159
|
+
expect(emitSpy).toHaveBeenCalledWith([]);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it('should handle reset on empty options', () => {
|
|
163
|
+
component.options = [];
|
|
164
|
+
|
|
165
|
+
expect(() => component.resetChecks()).not.toThrow();
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
describe('Escenarios de integración', () => {
|
|
170
|
+
it('should work with all features enabled', () => {
|
|
171
|
+
component.height = '300px';
|
|
172
|
+
component.options = [
|
|
173
|
+
{ id: 1, name: 'Option 1', checked: false },
|
|
174
|
+
{ id: 2, name: 'Option 2', checked: false },
|
|
175
|
+
];
|
|
176
|
+
component.valueModel = 'name';
|
|
177
|
+
component.isInSelect = true;
|
|
178
|
+
component.parameters = {
|
|
179
|
+
type: 'checkbox',
|
|
180
|
+
icon: 'home',
|
|
181
|
+
iconCurrier: true,
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
fixture.detectChanges();
|
|
185
|
+
|
|
186
|
+
expect(component.height).toBe('300px');
|
|
187
|
+
expect(component.options.length).toBe(2);
|
|
188
|
+
expect(component.isInSelect).toBe(true);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it('should handle complex selection workflow', () => {
|
|
192
|
+
component.options = [
|
|
193
|
+
{ id: 1, name: 'A', checked: false },
|
|
194
|
+
{ id: 2, name: 'B', checked: false },
|
|
195
|
+
{ id: 3, name: 'C', checked: false },
|
|
196
|
+
];
|
|
197
|
+
|
|
198
|
+
const emitSpy = jest.spyOn(component.modelChange, 'emit');
|
|
199
|
+
|
|
200
|
+
// Select all
|
|
201
|
+
component.toggleValue(true, component.options[0], 0);
|
|
202
|
+
component.toggleValue(true, component.options[1], 1);
|
|
203
|
+
component.toggleValue(true, component.options[2], 2);
|
|
204
|
+
|
|
205
|
+
expect(component.options.filter((o) => o.checked).length).toBe(3);
|
|
206
|
+
|
|
207
|
+
// Reset
|
|
208
|
+
component.resetChecks();
|
|
209
|
+
expect(component.options.filter((o) => o.checked).length).toBe(0);
|
|
210
|
+
expect(emitSpy).toHaveBeenLastCalledWith([]);
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
});
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { moduleMetadata, type Meta, type StoryObj } from '@storybook/angular';
|
|
2
|
+
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
3
|
+
import '@dotlottie/player-component';
|
|
4
|
+
import { action } from '@storybook/addon-actions';
|
|
5
|
+
import { DropiDropdownComponent } from './dropi-dropdown.component';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* # Dropdown Component
|
|
9
|
+
*
|
|
10
|
+
* A versatile dropdown component for displaying selectable options in an overlay panel.
|
|
11
|
+
* Supports both single selection and multi-selection with checkboxes.
|
|
12
|
+
*
|
|
13
|
+
* ## Features
|
|
14
|
+
* - **Multi-select**: Support for checkbox-based multi-selection
|
|
15
|
+
* - **Custom options**: Display options with text, icons, or carrier images
|
|
16
|
+
* - **Height control**: Configurable maximum height
|
|
17
|
+
* - **Two-way binding**: Model binding for selected values
|
|
18
|
+
*
|
|
19
|
+
* ## Usage
|
|
20
|
+
* ```html
|
|
21
|
+
* <app-dropi-dropdown
|
|
22
|
+
* [options]="carriers"
|
|
23
|
+
* [valueModel]="'name'"
|
|
24
|
+
* [parameters]="{ type: 'checkbox', iconCurrier: true }"
|
|
25
|
+
* (modelChange)="onSelectionChange($event)">
|
|
26
|
+
* </app-dropi-dropdown>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
const meta: Meta<DropiDropdownComponent> = {
|
|
30
|
+
title: 'UI Dropi/Dropdown',
|
|
31
|
+
component: DropiDropdownComponent,
|
|
32
|
+
tags: ['autodocs'],
|
|
33
|
+
decorators: [
|
|
34
|
+
moduleMetadata({
|
|
35
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
36
|
+
}),
|
|
37
|
+
],
|
|
38
|
+
parameters: {
|
|
39
|
+
layout: 'centered',
|
|
40
|
+
docs: {
|
|
41
|
+
description: {
|
|
42
|
+
component: `
|
|
43
|
+
A versatile dropdown component for displaying selectable options in an overlay panel.
|
|
44
|
+
Supports both single selection and multi-selection with checkboxes.
|
|
45
|
+
|
|
46
|
+
### Key Features
|
|
47
|
+
- **Multi-select**: Support for checkbox-based multi-selection
|
|
48
|
+
- **Custom options**: Display options with text, icons, or carrier images
|
|
49
|
+
- **Height control**: Configurable maximum height
|
|
50
|
+
- **Two-way binding**: Model binding for selected values
|
|
51
|
+
`,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
argTypes: {
|
|
56
|
+
height: {
|
|
57
|
+
control: 'text',
|
|
58
|
+
description: 'Maximum height of the dropdown panel',
|
|
59
|
+
table: {
|
|
60
|
+
type: { summary: 'string' },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
options: {
|
|
64
|
+
control: 'object',
|
|
65
|
+
description: 'Array of options to display in the dropdown',
|
|
66
|
+
table: {
|
|
67
|
+
type: { summary: 'array' },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
valueModel: {
|
|
71
|
+
control: 'text',
|
|
72
|
+
description: 'Property name to use as the display value for each option',
|
|
73
|
+
table: {
|
|
74
|
+
type: { summary: 'string' },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
parameters: {
|
|
78
|
+
control: 'object',
|
|
79
|
+
description: 'Configuration object for dropdown behavior (type, icon, iconCurrier)',
|
|
80
|
+
table: {
|
|
81
|
+
type: { summary: 'object' },
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
modelChange: {
|
|
85
|
+
action: 'modelChange',
|
|
86
|
+
description: 'Event emitted when the selection changes',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const transportadoras: { id: string; name: string }[] = [
|
|
92
|
+
{ id: '01', name: 'Servientrega' },
|
|
93
|
+
{ id: '02', name: 'Inter Rapidísimo' },
|
|
94
|
+
{ id: '03', name: 'Coordinadora' },
|
|
95
|
+
{ id: '04', name: 'Deprisa' },
|
|
96
|
+
{ id: '05', name: 'Envía' },
|
|
97
|
+
{ id: '06', name: 'TCC' },
|
|
98
|
+
{ id: '07', name: 'FedEx' },
|
|
99
|
+
{ id: '08', name: 'UPS' },
|
|
100
|
+
{ id: '09', name: 'DHL' },
|
|
101
|
+
{ id: '10', name: 'Mensajeros Urbanos' },
|
|
102
|
+
{ id: '11', name: 'Logyca' },
|
|
103
|
+
{ id: '12', name: 'Picap Express' },
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
export default meta;
|
|
107
|
+
type Story = StoryObj<DropiDropdownComponent>;
|
|
108
|
+
|
|
109
|
+
export const Checkbox: Story = {
|
|
110
|
+
args: {
|
|
111
|
+
options: transportadoras,
|
|
112
|
+
valueModel: 'name',
|
|
113
|
+
parameters: {
|
|
114
|
+
type: 'checkbox',
|
|
115
|
+
icon: '',
|
|
116
|
+
iconCurrier: false,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const CheckboxwithIcon: Story = {
|
|
122
|
+
args: {
|
|
123
|
+
options: transportadoras,
|
|
124
|
+
valueModel: 'name',
|
|
125
|
+
parameters: {
|
|
126
|
+
type: 'checkbox',
|
|
127
|
+
icon: 'assets/images/delivery/envia.png',
|
|
128
|
+
iconCurrier: false,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export const CheckboxwithCarrierIcon: Story = {
|
|
134
|
+
args: {
|
|
135
|
+
options: transportadoras,
|
|
136
|
+
valueModel: 'name',
|
|
137
|
+
parameters: {
|
|
138
|
+
type: 'checkbox',
|
|
139
|
+
icon: '',
|
|
140
|
+
iconCurrier: true,
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
};
|