@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,275 @@
|
|
|
1
|
+
.custom-select {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
|
|
5
|
+
label {
|
|
6
|
+
font-size: var(--font-size-xs);
|
|
7
|
+
font-weight: var(--font-weight-regular);
|
|
8
|
+
color: var(--Gray-Gray-600);
|
|
9
|
+
|
|
10
|
+
span {
|
|
11
|
+
color: var(--Error-Error-500);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.disabled-label {
|
|
16
|
+
color: var(--Gray-Gray-500);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.select-button {
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 40px;
|
|
23
|
+
padding: 0.47rem 0.75rem;
|
|
24
|
+
padding-right: 7px;
|
|
25
|
+
border: 1px solid var(--Gray-Gray-200);
|
|
26
|
+
border-radius: var(--Border-2);
|
|
27
|
+
background: var(--Neutral-White);
|
|
28
|
+
color: var(--Gray-Gray-500);
|
|
29
|
+
font-size: var(--font-size-s);
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
align-items: center;
|
|
33
|
+
text-align: left;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.select-dropdown {
|
|
38
|
+
position: absolute;
|
|
39
|
+
width: 100%;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
list-style: none;
|
|
42
|
+
padding: 0;
|
|
43
|
+
margin: 4px 0 0 0;
|
|
44
|
+
border: 1px solid transparent;
|
|
45
|
+
border-radius: var(--Border-2);
|
|
46
|
+
overflow-y: scroll;
|
|
47
|
+
z-index: 1300;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Estilos para el dropdown cuando se renderiza en el overlay CDK
|
|
51
|
+
.select-dropdown-overlay {
|
|
52
|
+
width: 100%;
|
|
53
|
+
max-height: 250px;
|
|
54
|
+
overflow-y: auto;
|
|
55
|
+
list-style: none;
|
|
56
|
+
padding: var(--Size-4);
|
|
57
|
+
padding-bottom: var(--Size-3);
|
|
58
|
+
margin: 0;
|
|
59
|
+
border: 1px solid transparent;
|
|
60
|
+
border-radius: var(--Border-2);
|
|
61
|
+
background: var(--Neutral-White);
|
|
62
|
+
box-shadow: var(--Shadow-medium);
|
|
63
|
+
z-index: 9999;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.select-dropdown-overlay.padding-dropdown {
|
|
67
|
+
padding: var(--Size-4);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.padding-dropdown {
|
|
71
|
+
padding: var(--Size-4);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.option {
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 45px;
|
|
77
|
+
border-radius: var(--Border-2);
|
|
78
|
+
padding-top: var(--Size-3);
|
|
79
|
+
padding-right: var(--Size-4);
|
|
80
|
+
padding-bottom: var(--Size-3);
|
|
81
|
+
padding-left: var(--Size-4);
|
|
82
|
+
border: none;
|
|
83
|
+
background: transparent;
|
|
84
|
+
text-align: left;
|
|
85
|
+
color: var(--Gray-Gray-600);
|
|
86
|
+
font-size: var(--font-size-s);
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.option:hover {
|
|
91
|
+
background: var(--Gray-Gray-50);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.expanded-select {
|
|
95
|
+
max-height: 250px;
|
|
96
|
+
background: var(--Neutral-White);
|
|
97
|
+
box-shadow: var(--Shadow-medium);
|
|
98
|
+
transition: max-height 0.2s ease-in;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.collapsed-select {
|
|
102
|
+
max-height: 0;
|
|
103
|
+
background: transparent;
|
|
104
|
+
box-shadow: none;
|
|
105
|
+
padding: 0;
|
|
106
|
+
transition:
|
|
107
|
+
max-height 0.2s ease-out,
|
|
108
|
+
background 0.3s ease-out,
|
|
109
|
+
box-shadow 0.3s ease-out,
|
|
110
|
+
padding 0.3s;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.select-button:focus {
|
|
114
|
+
border-color: var(--Info-Info-500);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.select-button-error {
|
|
118
|
+
border-color: var(--Error-Error-500) !important;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.select-button:disabled,
|
|
122
|
+
.option:disabled {
|
|
123
|
+
border-color: var(--Gray-Gray-200);
|
|
124
|
+
color: var(--Gray-Gray-400);
|
|
125
|
+
background-color: var(--Gray-Gray-50);
|
|
126
|
+
cursor: unset;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.select-completed {
|
|
130
|
+
border-color: var(--Gray-Gray-400);
|
|
131
|
+
color: var(--Gray-Gray-600);
|
|
132
|
+
background: var(--Neutral-White);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.select-helper {
|
|
136
|
+
display: flex;
|
|
137
|
+
gap: var(--Size-1);
|
|
138
|
+
align-items: baseline;
|
|
139
|
+
span {
|
|
140
|
+
display: block;
|
|
141
|
+
margin-top: var(--Size-2);
|
|
142
|
+
color: var(--Gray-Gray-600);
|
|
143
|
+
font-size: var(--font-size-xs);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.select-helper-error {
|
|
148
|
+
display: flex;
|
|
149
|
+
gap: var(--Size-1);
|
|
150
|
+
align-items: baseline;
|
|
151
|
+
span {
|
|
152
|
+
display: block;
|
|
153
|
+
margin-top: var(--Size-2);
|
|
154
|
+
color: var(--Error-Error-500);
|
|
155
|
+
font-size: var(--font-size-xs);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.invalid-color {
|
|
160
|
+
color: var(--Error-Error-500) !important;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.elipsis {
|
|
164
|
+
flex: 1 1 auto; /* ✅ que crezca y se reduzca */
|
|
165
|
+
min-width: 0; /* ✅ permite que se corte el texto */
|
|
166
|
+
overflow: hidden;
|
|
167
|
+
text-overflow: ellipsis;
|
|
168
|
+
white-space: nowrap;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.option-group-title {
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: 45px;
|
|
174
|
+
border-radius: var(--Border-2);
|
|
175
|
+
padding-top: var(--Size-3);
|
|
176
|
+
padding-right: var(--Size-4);
|
|
177
|
+
padding-bottom: var(--Size-3);
|
|
178
|
+
padding-left: var(--Size-4);
|
|
179
|
+
border: none;
|
|
180
|
+
background: transparent;
|
|
181
|
+
text-align: left;
|
|
182
|
+
color: var(--Gray-Gray-600);
|
|
183
|
+
font-size: var(--font-size-s);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.option-group {
|
|
187
|
+
padding-left: var(--Size-6);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.sticky-search {
|
|
191
|
+
position: sticky;
|
|
192
|
+
top: 0;
|
|
193
|
+
background: var(--Neutral-White);
|
|
194
|
+
z-index: 10;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
::ng-deep .custom-select .select-dropdown .sticky-search .container-search {
|
|
198
|
+
background-color: var(--Neutral-White) !important;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.no-border {
|
|
202
|
+
border: none !important;
|
|
203
|
+
color: var(--Gray-Gray-600, #475066);
|
|
204
|
+
padding: var(--Size-4, 16px);
|
|
205
|
+
gap: var(--Size-2, 8px);
|
|
206
|
+
background-color: transparent !important; // vista dropdown
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.no-border:disabled {
|
|
210
|
+
background-color: transparent !important;
|
|
211
|
+
// background-color: var(--Gray-Gray-50) !important;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.select-button:disabled {
|
|
215
|
+
color: var(--Gray-Gray-400);
|
|
216
|
+
background-color: var(--Gray-Gray-50);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.dropdown-container {
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
gap: 4px;
|
|
223
|
+
|
|
224
|
+
.left-label {
|
|
225
|
+
color: var(--Gray-600, #475066);
|
|
226
|
+
white-space: nowrap;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Estilos para banderas de países
|
|
231
|
+
.button-content {
|
|
232
|
+
display: flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
gap: 8px;
|
|
235
|
+
overflow: hidden;
|
|
236
|
+
flex: 1;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.select-button.with-flag {
|
|
240
|
+
.button-content {
|
|
241
|
+
app-country-flags {
|
|
242
|
+
flex-shrink: 0;
|
|
243
|
+
::ng-deep {
|
|
244
|
+
.rectangle {
|
|
245
|
+
max-width: 24px !important;
|
|
246
|
+
max-height: 17px !important;
|
|
247
|
+
border-radius: var(--Border-1);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.option-with-flag {
|
|
255
|
+
display: flex;
|
|
256
|
+
align-items: center;
|
|
257
|
+
gap: 8px;
|
|
258
|
+
|
|
259
|
+
app-country-flags {
|
|
260
|
+
flex-shrink: 0;
|
|
261
|
+
::ng-deep {
|
|
262
|
+
.rectangle {
|
|
263
|
+
max-width: 24px !important;
|
|
264
|
+
max-height: 17px !important;
|
|
265
|
+
border-radius: var(--Border-1);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
span {
|
|
271
|
+
overflow: hidden;
|
|
272
|
+
text-overflow: ellipsis;
|
|
273
|
+
white-space: nowrap;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { By } from '@angular/platform-browser';
|
|
3
|
+
import { DebugElement, Component, Input, Output, EventEmitter } from '@angular/core';
|
|
4
|
+
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
5
|
+
import { DropiSelectComponent } from './dropi-select.component';
|
|
6
|
+
import {
|
|
7
|
+
OptionsSelect,
|
|
8
|
+
SelectProperties,
|
|
9
|
+
GroupedOptions,
|
|
10
|
+
} from '@app/utilities/interfaces/ui/select.interface';
|
|
11
|
+
|
|
12
|
+
// Mock components
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'app-icon',
|
|
15
|
+
standalone: true,
|
|
16
|
+
template: '<span>icon</span>',
|
|
17
|
+
})
|
|
18
|
+
class MockIconComponent {
|
|
19
|
+
@Input() icon: string;
|
|
20
|
+
@Input() size: string;
|
|
21
|
+
@Input() color: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'app-dropi-search',
|
|
26
|
+
standalone: true,
|
|
27
|
+
template: '<input type="text">',
|
|
28
|
+
})
|
|
29
|
+
class MockDropiSearchComponent {
|
|
30
|
+
@Input() searchTerm: string;
|
|
31
|
+
@Output() termSearched = new EventEmitter<string>();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@Component({
|
|
35
|
+
selector: 'app-dropi-dropdown',
|
|
36
|
+
standalone: true,
|
|
37
|
+
template: '<div><ng-content></ng-content></div>',
|
|
38
|
+
})
|
|
39
|
+
class MockDropiDropdownComponent {
|
|
40
|
+
@Input() isExpanded: boolean;
|
|
41
|
+
@Input() parametersDrop: any;
|
|
42
|
+
@Input() label: string;
|
|
43
|
+
@Input() filteredOptions: any[];
|
|
44
|
+
@Input() multiSelect: boolean;
|
|
45
|
+
@Input() multiSelecOptions: any[];
|
|
46
|
+
@Output() scrolledToEnd = new EventEmitter<void>();
|
|
47
|
+
@Output() optionSelected = new EventEmitter<any>();
|
|
48
|
+
@Output() onKeyEnter = new EventEmitter<any>();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
describe('DropiSelectComponent', () => {
|
|
52
|
+
let component: DropiSelectComponent;
|
|
53
|
+
let fixture: ComponentFixture<DropiSelectComponent>;
|
|
54
|
+
let debugElement: DebugElement;
|
|
55
|
+
|
|
56
|
+
const mockSelectProperties: SelectProperties = {
|
|
57
|
+
label: 'Test Select',
|
|
58
|
+
placeholder: 'Choose an option',
|
|
59
|
+
options: [
|
|
60
|
+
{ id: 1, label: 'Option 1', disabled: false },
|
|
61
|
+
{ id: 2, label: 'Option 2', disabled: false },
|
|
62
|
+
{ id: 3, label: 'Option 3', disabled: true },
|
|
63
|
+
],
|
|
64
|
+
textHelper: 'Helper text',
|
|
65
|
+
showObligatory: true,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const mockGroupedOptions: GroupedOptions[] = [
|
|
69
|
+
{
|
|
70
|
+
category: 'Category 1',
|
|
71
|
+
options: [
|
|
72
|
+
{ id: 1, label: 'Option 1', disabled: false },
|
|
73
|
+
{ id: 2, label: 'Option 2', disabled: false },
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
category: 'Category 2',
|
|
78
|
+
options: [
|
|
79
|
+
{ id: 3, label: 'Option 3', disabled: false },
|
|
80
|
+
{ id: 4, label: 'Option 4', disabled: false },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
beforeEach(async () => {
|
|
86
|
+
// Mock ElementRef
|
|
87
|
+
const mockElementRef = {
|
|
88
|
+
nativeElement: {
|
|
89
|
+
addEventListener: jest.fn(),
|
|
90
|
+
removeEventListener: jest.fn(),
|
|
91
|
+
querySelector: jest.fn(),
|
|
92
|
+
contains: jest.fn().mockReturnValue(false), // Add contains method
|
|
93
|
+
getBoundingClientRect: jest.fn().mockReturnValue({
|
|
94
|
+
top: 0,
|
|
95
|
+
left: 0,
|
|
96
|
+
bottom: 100,
|
|
97
|
+
right: 100,
|
|
98
|
+
width: 100,
|
|
99
|
+
height: 100,
|
|
100
|
+
}),
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// Mock Overlay
|
|
105
|
+
const mockOverlayRef = {
|
|
106
|
+
attach: jest.fn(),
|
|
107
|
+
detach: jest.fn(),
|
|
108
|
+
dispose: jest.fn(),
|
|
109
|
+
hasAttached: jest.fn().mockReturnValue(false),
|
|
110
|
+
backdropClick: jest.fn().mockReturnValue({
|
|
111
|
+
subscribe: jest.fn(),
|
|
112
|
+
}),
|
|
113
|
+
};
|
|
114
|
+
const mockOverlay = {
|
|
115
|
+
create: jest.fn().mockReturnValue(mockOverlayRef),
|
|
116
|
+
position: jest.fn().mockReturnValue({
|
|
117
|
+
flexibleConnectedTo: jest.fn().mockReturnValue({
|
|
118
|
+
withPositions: jest.fn().mockReturnValue({
|
|
119
|
+
withPush: jest.fn().mockReturnValue({
|
|
120
|
+
withDefaultOffsetY: jest.fn().mockReturnValue({}),
|
|
121
|
+
}),
|
|
122
|
+
}),
|
|
123
|
+
}),
|
|
124
|
+
}),
|
|
125
|
+
scrollStrategies: {
|
|
126
|
+
reposition: jest.fn().mockReturnValue({}),
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// Mock ViewContainerRef
|
|
131
|
+
const mockViewContainerRef = {
|
|
132
|
+
createEmbeddedView: jest.fn(),
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// Create component directly
|
|
136
|
+
component = new DropiSelectComponent(mockElementRef as any, mockOverlay as any, mockViewContainerRef as any);
|
|
137
|
+
component.selectProperties = mockSelectProperties;
|
|
138
|
+
|
|
139
|
+
// Mock ViewChild elements
|
|
140
|
+
(component as any).buttonSelect = {
|
|
141
|
+
nativeElement: document.createElement('button')
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// Mock fixture for tests that need it
|
|
145
|
+
fixture = {
|
|
146
|
+
componentInstance: component,
|
|
147
|
+
debugElement: {
|
|
148
|
+
query: jest.fn(),
|
|
149
|
+
queryAll: jest.fn(),
|
|
150
|
+
nativeElement: mockElementRef.nativeElement,
|
|
151
|
+
},
|
|
152
|
+
detectChanges: jest.fn(),
|
|
153
|
+
} as any;
|
|
154
|
+
|
|
155
|
+
debugElement = fixture.debugElement;
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
describe('Inicialización del componente', () => {
|
|
159
|
+
it('should create', () => {
|
|
160
|
+
// Verifica que el componente se crea correctamente
|
|
161
|
+
expect(component).toBeTruthy();
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it('should initialize with default values', () => {
|
|
165
|
+
// Verifica los valores por defecto
|
|
166
|
+
expect(component.disabled).toBe(false);
|
|
167
|
+
expect(component.isExpanded).toBe(false);
|
|
168
|
+
expect(component.searchEnabled).toBe(false);
|
|
169
|
+
expect(component.isGrouped).toBe(false);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it('should initialize properties from selectProperties', () => {
|
|
173
|
+
// Verifica que inicializa correctamente las propiedades del select
|
|
174
|
+
component.ngOnInit();
|
|
175
|
+
expect(component.filteredOptions).toEqual(mockSelectProperties.options);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
describe('Opciones agrupadas', () => {
|
|
180
|
+
it('should detect grouped options correctly', () => {
|
|
181
|
+
// Verifica que detecta correctamente las opciones agrupadas
|
|
182
|
+
component.selectProperties = {
|
|
183
|
+
...mockSelectProperties,
|
|
184
|
+
options: mockGroupedOptions as any,
|
|
185
|
+
};
|
|
186
|
+
component.ngOnInit();
|
|
187
|
+
|
|
188
|
+
expect(component.isGrouped).toBe(true);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it('should detect non-grouped options correctly', () => {
|
|
192
|
+
// Verifica que detecta correctamente las opciones no agrupadas
|
|
193
|
+
component.ngOnInit();
|
|
194
|
+
expect(component.isGrouped).toBe(false);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
describe('Funcionalidad de búsqueda', () => {
|
|
199
|
+
beforeEach(() => {
|
|
200
|
+
component.selectProperties = {
|
|
201
|
+
...mockSelectProperties,
|
|
202
|
+
searchEnabled: true,
|
|
203
|
+
};
|
|
204
|
+
component.ngOnInit();
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it('should enable search when searchEnabled is true', () => {
|
|
208
|
+
// Verifica que habilita la búsqueda cuando searchEnabled es true
|
|
209
|
+
expect(component.searchEnabled).toBe(true);
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
it('should filter non-grouped options correctly', () => {
|
|
213
|
+
// Verifica que filtra correctamente las opciones no agrupadas
|
|
214
|
+
component.filterOptions('Option 1');
|
|
215
|
+
|
|
216
|
+
expect(component.filteredOptions).toEqual([{ id: 1, label: 'Option 1', disabled: false }]);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it('should filter grouped options correctly', () => {
|
|
220
|
+
// Verifica que filtra correctamente las opciones agrupadas
|
|
221
|
+
component.selectProperties.options = mockGroupedOptions as any;
|
|
222
|
+
component.ngOnInit();
|
|
223
|
+
|
|
224
|
+
component.filterOptions('Option 1');
|
|
225
|
+
|
|
226
|
+
const expectedResult = [
|
|
227
|
+
{
|
|
228
|
+
category: 'Category 1',
|
|
229
|
+
options: [{ id: 1, label: 'Option 1', disabled: false }],
|
|
230
|
+
},
|
|
231
|
+
];
|
|
232
|
+
|
|
233
|
+
expect(component.filteredOptions).toEqual(expectedResult);
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it('should return empty array when no matches found in grouped options', () => {
|
|
237
|
+
// Verifica que devuelve array vacío cuando no encuentra coincidencias en opciones agrupadas
|
|
238
|
+
component.selectProperties.options = mockGroupedOptions as any;
|
|
239
|
+
component.ngOnInit();
|
|
240
|
+
|
|
241
|
+
component.filterOptions('Nonexistent');
|
|
242
|
+
|
|
243
|
+
expect(component.filteredOptions).toEqual([]);
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
describe('Selección de opciones', () => {
|
|
248
|
+
it('should select option correctly', () => {
|
|
249
|
+
// Verifica que selecciona la opción correctamente
|
|
250
|
+
const optionToSelect = mockSelectProperties.options[0];
|
|
251
|
+
|
|
252
|
+
component.selectOption(optionToSelect);
|
|
253
|
+
|
|
254
|
+
expect(component.selectedOption).toEqual(optionToSelect);
|
|
255
|
+
expect(component.isExpanded).toBe(false);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it('should set property by id correctly', () => {
|
|
259
|
+
// Verifica que establece la propiedad por ID correctamente
|
|
260
|
+
component.setPropertyById(2);
|
|
261
|
+
|
|
262
|
+
expect(component.selectedOption).toEqual(mockSelectProperties.options[1]);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
it('should set property by label correctly', () => {
|
|
266
|
+
// Verifica que establece la propiedad por etiqueta correctamente
|
|
267
|
+
component.setPropertyByLabel('Option 2');
|
|
268
|
+
|
|
269
|
+
expect(component.selectedOption).toEqual(mockSelectProperties.options[1]);
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
describe('Mostrar/ocultar opciones', () => {
|
|
274
|
+
it('should toggle expanded state when not disabled', () => {
|
|
275
|
+
// Verifica que alterna el estado expandido cuando no está deshabilitado
|
|
276
|
+
component.disabled = false;
|
|
277
|
+
component.isExpanded = false;
|
|
278
|
+
|
|
279
|
+
component.showOptions();
|
|
280
|
+
|
|
281
|
+
expect(component.isExpanded).toBe(true);
|
|
282
|
+
|
|
283
|
+
component.showOptions();
|
|
284
|
+
|
|
285
|
+
expect(component.isExpanded).toBe(false);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
it('should not toggle expanded state when disabled', () => {
|
|
289
|
+
// Verifica que no alterna el estado cuando está deshabilitado
|
|
290
|
+
component.disabled = true;
|
|
291
|
+
component.isExpanded = false;
|
|
292
|
+
|
|
293
|
+
component.showOptions();
|
|
294
|
+
|
|
295
|
+
expect(component.isExpanded).toBe(false);
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
describe('Cerrar dropdown', () => {
|
|
300
|
+
it('should close dropdown when clicking outside', () => {
|
|
301
|
+
// Verifica que cierra el dropdown al hacer clic fuera
|
|
302
|
+
component.isExpanded = true;
|
|
303
|
+
const mockEvent = {
|
|
304
|
+
target: document.createElement('div'),
|
|
305
|
+
} as any;
|
|
306
|
+
|
|
307
|
+
component.closeDropdown(mockEvent);
|
|
308
|
+
|
|
309
|
+
expect(component.isExpanded).toBe(false);
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
it('should not close dropdown when clicking inside', () => {
|
|
313
|
+
// Verifica que no cierra el dropdown al hacer clic dentro
|
|
314
|
+
component.isExpanded = true;
|
|
315
|
+
|
|
316
|
+
// Simular clic dentro del elemento
|
|
317
|
+
jest.spyOn(component['elementRef'].nativeElement, 'contains').mockReturnValue(true);
|
|
318
|
+
|
|
319
|
+
const mockEvent = {
|
|
320
|
+
target: document.createElement('div'),
|
|
321
|
+
} as any;
|
|
322
|
+
|
|
323
|
+
component.closeDropdown(mockEvent);
|
|
324
|
+
|
|
325
|
+
expect(component.isExpanded).toBe(true);
|
|
326
|
+
});
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
describe('Cambios en propiedades', () => {
|
|
330
|
+
it('should reinitialize when selectProperties changes', () => {
|
|
331
|
+
// Verifica que reinicializa cuando cambian las selectProperties
|
|
332
|
+
jest.spyOn(component, 'initializeSelectedProperties');
|
|
333
|
+
|
|
334
|
+
const newProperties = {
|
|
335
|
+
...mockSelectProperties,
|
|
336
|
+
options: [{ id: 5, label: 'New Option', disabled: false }],
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
component.selectProperties = newProperties;
|
|
340
|
+
component.ngOnChanges({
|
|
341
|
+
selectProperties: {
|
|
342
|
+
currentValue: newProperties,
|
|
343
|
+
previousValue: mockSelectProperties,
|
|
344
|
+
firstChange: false,
|
|
345
|
+
isFirstChange: () => false,
|
|
346
|
+
},
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
expect(component.initializeSelectedProperties).toHaveBeenCalled();
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it('should not reinitialize on first change', () => {
|
|
353
|
+
// Verifica que no reinicializa en el primer cambio
|
|
354
|
+
jest.spyOn(component, 'initializeSelectedProperties');
|
|
355
|
+
|
|
356
|
+
component.ngOnChanges({
|
|
357
|
+
selectProperties: {
|
|
358
|
+
currentValue: mockSelectProperties,
|
|
359
|
+
previousValue: undefined,
|
|
360
|
+
firstChange: true,
|
|
361
|
+
isFirstChange: () => true,
|
|
362
|
+
},
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
expect(component.initializeSelectedProperties).not.toHaveBeenCalled();
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
describe('Estado deshabilitado', () => {
|
|
370
|
+
it('should accept disabled input', () => {
|
|
371
|
+
// Verifica que acepta el input disabled
|
|
372
|
+
component.disabled = true;
|
|
373
|
+
expect(component.disabled).toBe(true);
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
it('should prevent interactions when disabled', () => {
|
|
377
|
+
// Verifica que previene interacciones cuando está deshabilitado
|
|
378
|
+
component.disabled = true;
|
|
379
|
+
component.isExpanded = false;
|
|
380
|
+
|
|
381
|
+
component.showOptions();
|
|
382
|
+
|
|
383
|
+
expect(component.isExpanded).toBe(false);
|
|
384
|
+
});
|
|
385
|
+
});
|
|
386
|
+
});
|