@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,267 @@
|
|
|
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 { DropiSearchComponent } from './dropi-search.component';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* # Search Component
|
|
9
|
+
*
|
|
10
|
+
* A versatile search input component with autocomplete and filtering capabilities.
|
|
11
|
+
* Supports both simple text search and multi-select with checkboxes.
|
|
12
|
+
*
|
|
13
|
+
* ## Features
|
|
14
|
+
* - **Autocomplete**: Shows filtered results as user types
|
|
15
|
+
* - **Multi-select mode**: Optional checkbox selection for multiple items
|
|
16
|
+
* - **Customizable data**: Works with any data structure
|
|
17
|
+
* - **Position control**: Dropdown can appear above or below
|
|
18
|
+
* - **Event rich**: Multiple events for different interactions
|
|
19
|
+
*
|
|
20
|
+
* ## Usage
|
|
21
|
+
* ```html
|
|
22
|
+
* <app-dropi-search
|
|
23
|
+
* placeholder="Search products..."
|
|
24
|
+
* [dataToSearch]="products"
|
|
25
|
+
* dataName="name"
|
|
26
|
+
* (onInput)="handleSearch($event)"
|
|
27
|
+
* (onChange)="handleSelect($event)">
|
|
28
|
+
* </app-dropi-search>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
const meta: Meta<DropiSearchComponent> = {
|
|
32
|
+
title: 'UI Dropi/Search',
|
|
33
|
+
component: DropiSearchComponent,
|
|
34
|
+
tags: ['autodocs'],
|
|
35
|
+
parameters: {
|
|
36
|
+
layout: 'centered',
|
|
37
|
+
docs: {
|
|
38
|
+
description: {
|
|
39
|
+
component: `
|
|
40
|
+
A versatile search input component with autocomplete and filtering capabilities.
|
|
41
|
+
Supports both simple text search and multi-select with checkboxes.
|
|
42
|
+
|
|
43
|
+
### Key Features
|
|
44
|
+
- **Autocomplete**: Shows filtered results as user types
|
|
45
|
+
- **Multi-select mode**: Optional checkbox selection for multiple items
|
|
46
|
+
- **Customizable data**: Works with any data structure
|
|
47
|
+
- **Position control**: Dropdown can appear above or below
|
|
48
|
+
- **Event rich**: Multiple events for different interactions
|
|
49
|
+
`,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
decorators: [
|
|
54
|
+
moduleMetadata({
|
|
55
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
56
|
+
}),
|
|
57
|
+
],
|
|
58
|
+
argTypes: {
|
|
59
|
+
placeholder: {
|
|
60
|
+
control: 'text',
|
|
61
|
+
description: 'Hint text displayed when the input is empty',
|
|
62
|
+
table: {
|
|
63
|
+
type: { summary: 'string' },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
textInput: {
|
|
67
|
+
control: 'text',
|
|
68
|
+
description: 'Current text value in the input field',
|
|
69
|
+
table: {
|
|
70
|
+
type: { summary: 'string' },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
showIcon: {
|
|
74
|
+
control: 'boolean',
|
|
75
|
+
description: 'Whether to show the search icon',
|
|
76
|
+
table: {
|
|
77
|
+
type: { summary: 'boolean' },
|
|
78
|
+
defaultValue: { summary: 'true' },
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
dataToSearch: {
|
|
82
|
+
control: 'object',
|
|
83
|
+
description: 'Array of data objects used for filtering and displaying results',
|
|
84
|
+
table: {
|
|
85
|
+
type: { summary: 'array' },
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
dataName: {
|
|
89
|
+
control: 'text',
|
|
90
|
+
description: 'Property name in data objects to display as result text',
|
|
91
|
+
table: {
|
|
92
|
+
type: { summary: 'string' },
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
position: {
|
|
96
|
+
control: 'text',
|
|
97
|
+
description: 'Position of the results overlay ("top" or "bottom")',
|
|
98
|
+
table: {
|
|
99
|
+
type: { summary: 'string' },
|
|
100
|
+
defaultValue: { summary: 'bottom' },
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
heightOverlay: {
|
|
104
|
+
control: 'number',
|
|
105
|
+
description: 'Height in pixels for the results overlay',
|
|
106
|
+
table: {
|
|
107
|
+
type: { summary: 'number' },
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
model: {
|
|
111
|
+
control: 'object',
|
|
112
|
+
description: 'Model binding for selected objects (checkbox mode only)',
|
|
113
|
+
table: {
|
|
114
|
+
type: { summary: 'array' },
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
onInput: {
|
|
118
|
+
action: 'onInput',
|
|
119
|
+
description: 'Event emitted on each keystroke for real-time search',
|
|
120
|
+
},
|
|
121
|
+
onKeyEnter: {
|
|
122
|
+
action: 'onKeyEnter',
|
|
123
|
+
description: 'Event emitted when Enter key is pressed',
|
|
124
|
+
},
|
|
125
|
+
onChange: {
|
|
126
|
+
action: 'onChange',
|
|
127
|
+
description: 'Event emitted when the input value changes',
|
|
128
|
+
},
|
|
129
|
+
onBlur: {
|
|
130
|
+
action: 'onBlur',
|
|
131
|
+
description: 'Event emitted when focus leaves the input (useful for checkbox mode)',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
const comerciosSelected = [];
|
|
136
|
+
|
|
137
|
+
const comercios = [
|
|
138
|
+
{ id: 1, name: 'Dropi' },
|
|
139
|
+
{ id: 2, name: 'Walmart' },
|
|
140
|
+
{ id: 3, name: 'Starbucks' },
|
|
141
|
+
{ id: 4, name: 'Target' },
|
|
142
|
+
{ id: 5, name: 'Best Buy' },
|
|
143
|
+
{ id: 6, name: 'Apple Store' },
|
|
144
|
+
{ id: 7, name: 'Nike' },
|
|
145
|
+
{ id: 8, name: 'Adidas' },
|
|
146
|
+
{ id: 9, name: 'Zara' },
|
|
147
|
+
{ id: 10, name: 'H&M' },
|
|
148
|
+
{ id: 11, name: 'Costco' },
|
|
149
|
+
{ id: 12, name: 'IKEA' },
|
|
150
|
+
{ id: 13, name: 'Uber Eats' },
|
|
151
|
+
{ id: 14, name: "Domino's Pizza" },
|
|
152
|
+
{ id: 15, name: 'Netflix' },
|
|
153
|
+
{ id: 16, name: 'Spotify' },
|
|
154
|
+
{ id: 17, name: 'Mercado Libre' },
|
|
155
|
+
{ id: 18, name: 'Shein' },
|
|
156
|
+
{ id: 19, name: 'Rappi' },
|
|
157
|
+
{ id: 20, name: 'AliExpress' },
|
|
158
|
+
];
|
|
159
|
+
|
|
160
|
+
export default meta;
|
|
161
|
+
type Story = StoryObj<DropiSearchComponent>;
|
|
162
|
+
|
|
163
|
+
export const Default: Story = {
|
|
164
|
+
args: {
|
|
165
|
+
placeholder: 'placeholder',
|
|
166
|
+
textInput: '',
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
parameters: {
|
|
170
|
+
design: {
|
|
171
|
+
type: 'figma',
|
|
172
|
+
url: 'https://www.figma.com/design/ONiVQJJ2qrJ6tmJnpNrrKE/-WEB--components?node-id=150-75&m=dev',
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const withCloseIcon: Story = {
|
|
178
|
+
args: {
|
|
179
|
+
placeholder: 'placeholder',
|
|
180
|
+
textInput: 'Hello world',
|
|
181
|
+
showIcon: true,
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
parameters: {
|
|
185
|
+
design: {
|
|
186
|
+
type: 'figma',
|
|
187
|
+
url: 'https://www.figma.com/design/ONiVQJJ2qrJ6tmJnpNrrKE/-WEB--components?node-id=150-74&m=dev',
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export const WithDropdown: Story = {
|
|
193
|
+
args: {
|
|
194
|
+
placeholder: 'placeholder',
|
|
195
|
+
textInput: 'Hello world',
|
|
196
|
+
showIcon: true,
|
|
197
|
+
type: 'dropdown',
|
|
198
|
+
dataToSearch: comercios,
|
|
199
|
+
model: comerciosSelected,
|
|
200
|
+
dataName: 'name',
|
|
201
|
+
},
|
|
202
|
+
parameters: {
|
|
203
|
+
docs: {
|
|
204
|
+
source: {
|
|
205
|
+
code: `
|
|
206
|
+
<app-dropi-search
|
|
207
|
+
[(model)]="comerciosSelected"
|
|
208
|
+
[placeholder]="'placeholder'"
|
|
209
|
+
[textInput]="'Hello world'"
|
|
210
|
+
[showIcon]="true"
|
|
211
|
+
[type]="'dropdown'"
|
|
212
|
+
[dataToSearch]="comercios"
|
|
213
|
+
[dataName]="'name'"
|
|
214
|
+
></app-dropi-search>
|
|
215
|
+
`.trim(),
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
design: {
|
|
219
|
+
type: 'figma',
|
|
220
|
+
url: 'https://www.figma.com/design/ONiVQJJ2qrJ6tmJnpNrrKE/-WEB--components?node-id=150-3916&m=dev',
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export const topDropdown: Story = {
|
|
226
|
+
args: {
|
|
227
|
+
placeholder: 'placeholder',
|
|
228
|
+
textInput: 'Hello world',
|
|
229
|
+
showIcon: true,
|
|
230
|
+
type: 'dropdown',
|
|
231
|
+
dataToSearch: comercios,
|
|
232
|
+
model: comerciosSelected,
|
|
233
|
+
position: 'top',
|
|
234
|
+
},
|
|
235
|
+
render: (args) => ({
|
|
236
|
+
props: {
|
|
237
|
+
...args,
|
|
238
|
+
},
|
|
239
|
+
template: `
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
<div class="container-search-dropi" style="display: flex; justify-content: center; align-items: end; padding-bottom: 100px; height: 100vh; ">
|
|
243
|
+
<app-dropi-search
|
|
244
|
+
[placeholder]="placeholder"
|
|
245
|
+
[textInput]="textInput"
|
|
246
|
+
[showIcon]="showIcon"
|
|
247
|
+
[dataToSearch]="dataToSearch"
|
|
248
|
+
[position]="position"
|
|
249
|
+
[model]="model"
|
|
250
|
+
[type]="type"
|
|
251
|
+
></app-dropi-search>
|
|
252
|
+
</div>
|
|
253
|
+
`,
|
|
254
|
+
}),
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export const CustomHeight: Story = {
|
|
258
|
+
args: {
|
|
259
|
+
placeholder: 'placeholder',
|
|
260
|
+
textInput: 'Hello world',
|
|
261
|
+
showIcon: true,
|
|
262
|
+
type: 'dropdown',
|
|
263
|
+
dataToSearch: comercios,
|
|
264
|
+
model: comerciosSelected,
|
|
265
|
+
heightOverlay: 400,
|
|
266
|
+
},
|
|
267
|
+
};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectorRef,
|
|
4
|
+
Component,
|
|
5
|
+
ElementRef,
|
|
6
|
+
EventEmitter,
|
|
7
|
+
HostListener,
|
|
8
|
+
Input,
|
|
9
|
+
OnChanges,
|
|
10
|
+
OnInit,
|
|
11
|
+
Output,
|
|
12
|
+
SimpleChanges,
|
|
13
|
+
ViewChild,
|
|
14
|
+
} from '@angular/core';
|
|
15
|
+
import { IconComponent } from '../icon/icon.component';
|
|
16
|
+
import { FormsModule } from '@angular/forms';
|
|
17
|
+
import { trigger, transition, style, animate } from '@angular/animations';
|
|
18
|
+
import { DropiCheckboxComponent } from '../dropi-checkbox/dropi-checkbox.component';
|
|
19
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
20
|
+
import { ButtonComponent } from '../dropi-button/dropi-button.component';
|
|
21
|
+
|
|
22
|
+
@Component({
|
|
23
|
+
selector: 'app-dropi-search',
|
|
24
|
+
templateUrl: './dropi-search.component.html',
|
|
25
|
+
styleUrls: ['./dropi-search.component.scss'],
|
|
26
|
+
standalone: true,
|
|
27
|
+
imports: [
|
|
28
|
+
CommonModule,
|
|
29
|
+
IconComponent,
|
|
30
|
+
FormsModule,
|
|
31
|
+
DropiCheckboxComponent,
|
|
32
|
+
TranslateModule,
|
|
33
|
+
ButtonComponent,
|
|
34
|
+
],
|
|
35
|
+
animations: [
|
|
36
|
+
trigger('fade', [
|
|
37
|
+
transition(':enter', [
|
|
38
|
+
style({ opacity: 0 }),
|
|
39
|
+
animate('150ms ease-out', style({ opacity: 1 })),
|
|
40
|
+
]),
|
|
41
|
+
transition(':leave', [animate('150ms ease-in', style({ opacity: 0 }))]),
|
|
42
|
+
]),
|
|
43
|
+
trigger('slideToggle', [
|
|
44
|
+
transition(':enter', [
|
|
45
|
+
style({ height: '0', opacity: 0 }),
|
|
46
|
+
animate('150ms ease-out', style({ height: '*', opacity: 1 })),
|
|
47
|
+
]),
|
|
48
|
+
transition(':leave', [animate('150ms ease-in', style({ height: '0', opacity: 0 }))]),
|
|
49
|
+
]),
|
|
50
|
+
trigger('slideToggleReverse', [
|
|
51
|
+
transition(':enter', [
|
|
52
|
+
style({ transform: 'translateY(100%)', opacity: 0 }),
|
|
53
|
+
animate('150ms ease-out', style({ transform: 'translateY(0)', opacity: 1 })),
|
|
54
|
+
]),
|
|
55
|
+
transition(':leave', [
|
|
56
|
+
animate('150ms ease-in', style({ transform: 'translateY(100%)', opacity: 0 })),
|
|
57
|
+
]),
|
|
58
|
+
]),
|
|
59
|
+
],
|
|
60
|
+
})
|
|
61
|
+
export class DropiSearchComponent implements OnInit, OnChanges {
|
|
62
|
+
@Input() type: 'default' | 'dropdown' | 'dropdown-button' | 'default-light' = 'default';
|
|
63
|
+
@Input() placeholder: string = '';
|
|
64
|
+
@Input() textInput: string = '';
|
|
65
|
+
@Input() typeInput: 'text' | 'number' = 'text';
|
|
66
|
+
@Input() maxLength: number = null;
|
|
67
|
+
@Input() showIcon: boolean = true;
|
|
68
|
+
@Input() dataToSearch: {}[] = [];
|
|
69
|
+
@Input() dataName: string = 'name';
|
|
70
|
+
@Input() position: 'down' | 'top' = 'down';
|
|
71
|
+
@Input() heightOverlay: number = 230;
|
|
72
|
+
@Input() model: {}[] = [];
|
|
73
|
+
@Input() label: string = '';
|
|
74
|
+
@Output() modelChange = new EventEmitter<any>();
|
|
75
|
+
@Output() onBlur = new EventEmitter<any>();
|
|
76
|
+
@Output() onInput = new EventEmitter();
|
|
77
|
+
@Output() onKeyEnter = new EventEmitter();
|
|
78
|
+
@Output() onChange = new EventEmitter();
|
|
79
|
+
@Output() onClear = new EventEmitter();
|
|
80
|
+
@ViewChild('containerRef') containerRef!: ElementRef;
|
|
81
|
+
@ViewChild('overlay') overlay!: ElementRef;
|
|
82
|
+
isFocus = false;
|
|
83
|
+
isClickedDropButton = false;
|
|
84
|
+
isVisibleContent = false;
|
|
85
|
+
overlaySelected = 'content-no-found';
|
|
86
|
+
colorSearch = 'var(--Gray-Gray-500)';
|
|
87
|
+
dataModel = [];
|
|
88
|
+
dataToSearchCache = [];
|
|
89
|
+
initialOverlaySize = 0;
|
|
90
|
+
backgroundInput = '';
|
|
91
|
+
textDropButton = '';
|
|
92
|
+
|
|
93
|
+
constructor(private cdr: ChangeDetectorRef) {}
|
|
94
|
+
|
|
95
|
+
ngOnInit() {
|
|
96
|
+
this.selectInitialDropButton();
|
|
97
|
+
this.backgroundInput =
|
|
98
|
+
this.type !== 'default-light' ? 'var(--Gray-Gray-50)' : '--Neutral-White';
|
|
99
|
+
this.checkListModel(this.model);
|
|
100
|
+
this.initialOverlaySize = this.heightOverlay;
|
|
101
|
+
this.dataToSearchCache = this.dataToSearch;
|
|
102
|
+
this.selectStyle();
|
|
103
|
+
this.cdr.detectChanges();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
107
|
+
if (changes['dataToSearch'] && changes['dataToSearch'].currentValue) {
|
|
108
|
+
this.dataToSearchCache = [...changes['dataToSearch'].currentValue];
|
|
109
|
+
this.selectStyle(); // <-- para que el overlay se actualice también
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (changes['model'] && changes['model'].currentValue) {
|
|
113
|
+
setTimeout(() => {
|
|
114
|
+
this.checkListModel(this.model);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@HostListener('document:click', ['$event'])
|
|
120
|
+
handleClickOutside(event: MouseEvent): void {
|
|
121
|
+
setTimeout(() => {
|
|
122
|
+
if (this.containerRef && !this.containerRef.nativeElement.contains(event.target)) {
|
|
123
|
+
this.isVisibleContent = false;
|
|
124
|
+
this.isFocus = false;
|
|
125
|
+
this.isClickedDropButton = false;
|
|
126
|
+
|
|
127
|
+
this.onBlur.emit();
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
changeText(e) {
|
|
132
|
+
this.colorSearch = e.target.value.length > 0 ? 'var(--Gray-Gray-600)' : 'var(--Gray-Gray-500)';
|
|
133
|
+
if (this.type !== 'dropdown-button') {
|
|
134
|
+
this.searchText(e.target.value);
|
|
135
|
+
}
|
|
136
|
+
this.onInput.emit(e.target.value);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
onEnter(e): void {
|
|
140
|
+
console.log('jkdjfkjdfjdfk');
|
|
141
|
+
console.log('e.target.value', e.target.value);
|
|
142
|
+
|
|
143
|
+
this.onKeyEnter.emit(e.target.value);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
onChangHandler(e) {
|
|
147
|
+
this.onChange.emit(e.target.value);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
clearText() {
|
|
151
|
+
this.textInput = '';
|
|
152
|
+
this.dataToSearchCache = this.dataToSearch;
|
|
153
|
+
this.onClear.emit();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
onFocus() {
|
|
157
|
+
this.isFocus = true;
|
|
158
|
+
if (this.isFocus) {
|
|
159
|
+
// Espera a que se haga la animación (300ms) y luego muestra contenido
|
|
160
|
+
setTimeout(() => {
|
|
161
|
+
this.isVisibleContent = true;
|
|
162
|
+
}, 300);
|
|
163
|
+
} else {
|
|
164
|
+
this.isVisibleContent = false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
selectStyle() {
|
|
169
|
+
this.overlaySelected = this.dataToSearch?.length > 0 ? 'content-found' : 'content-no-found';
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
getOverlayStyles() {
|
|
173
|
+
if (this.position == 'top') {
|
|
174
|
+
return {
|
|
175
|
+
'max-height': this.heightOverlay + 'px',
|
|
176
|
+
position: 'absolute',
|
|
177
|
+
bottom: 'calc(12px + 100%)' /* Se posiciona justo encima del input */,
|
|
178
|
+
left: 0,
|
|
179
|
+
width: '100%',
|
|
180
|
+
};
|
|
181
|
+
} else {
|
|
182
|
+
return {
|
|
183
|
+
'max-height': this.heightOverlay + 'px',
|
|
184
|
+
position: 'absolute',
|
|
185
|
+
top: 'calc(12px + 100%)' /* Se posiciona justo encima del input */,
|
|
186
|
+
left: 0,
|
|
187
|
+
width: '100%',
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
checkListModel(data: any[]) {
|
|
192
|
+
this.dataToSearchCache = this.dataToSearchCache.map((cache) => {
|
|
193
|
+
const isSelected = this.model.some((mod: any) => mod.id === cache.id);
|
|
194
|
+
return { ...cache, isChecked: isSelected };
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
checkingList(e, data) {
|
|
199
|
+
data.isChecked = e;
|
|
200
|
+
|
|
201
|
+
const existsData = this.model.some((datModel: any) => datModel.id === data.id);
|
|
202
|
+
|
|
203
|
+
if (e === true && !existsData) {
|
|
204
|
+
this.model = [...this.model, data]; // crea una nueva referencia
|
|
205
|
+
} else if (e === false && existsData) {
|
|
206
|
+
this.model = this.model.filter((datModel: any) => datModel.id !== data.id); //también crea nueva referencia
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
this.modelChange.emit(this.model);
|
|
210
|
+
|
|
211
|
+
this.checkListModel(this.model); // <--- esto asegura el reflejo visual
|
|
212
|
+
}
|
|
213
|
+
searchText(text) {
|
|
214
|
+
this.dataToSearchCache = this.dataToSearch.filter((data: any) => {
|
|
215
|
+
return data[this.dataName].toLowerCase().includes(text.toLowerCase());
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
this.checkListModel(this.model);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
handleClickDropButton(event) {
|
|
222
|
+
this.isClickedDropButton = true;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
selectInitialDropButton() {
|
|
226
|
+
if (this.type == 'dropdown-button' && this.dataToSearchCache.length > 0) {
|
|
227
|
+
this.textDropButton = this.dataToSearchCache[0][this.dataName];
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<div class="custom-select">
|
|
2
|
+
<label
|
|
3
|
+
*ngIf="!selectProperties?.dropdownType"
|
|
4
|
+
[ngClass]="{ 'disabled-label': disabled, 'Body-S-Regular': isGrouped }"
|
|
5
|
+
>{{ selectProperties.label | translate }}
|
|
6
|
+
<span *ngIf="selectProperties.showObligatory && !disabled">*</span></label
|
|
7
|
+
>
|
|
8
|
+
<div class="dropdown-container">
|
|
9
|
+
<!-- Label a la izquierda solo si hay dropdownType == true-->
|
|
10
|
+
<div *ngIf="selectProperties?.dropdownType" class="left-label Body-M-Regular">
|
|
11
|
+
{{ selectProperties.label | translate }}
|
|
12
|
+
</div>
|
|
13
|
+
<button
|
|
14
|
+
*ngIf="!multiSelect"
|
|
15
|
+
#buttonSelect
|
|
16
|
+
type="button"
|
|
17
|
+
class="select-button"
|
|
18
|
+
[disabled]="disabled"
|
|
19
|
+
[ngClass]="{
|
|
20
|
+
'select-completed': !!selectedOption,
|
|
21
|
+
'select-button-error':
|
|
22
|
+
selectProperties?.hasError ||
|
|
23
|
+
(selectProperties?.formControl?.invalid &&
|
|
24
|
+
(selectProperties?.formControl?.touched || selectProperties?.formControl?.dirty)),
|
|
25
|
+
'no-border': selectProperties?.dropdownType,
|
|
26
|
+
'Label-L': selectProperties?.dropdownType,
|
|
27
|
+
'with-flag': showCountryFlags && getSelectedCountryCode()
|
|
28
|
+
}"
|
|
29
|
+
(click)="showOptions()"
|
|
30
|
+
>
|
|
31
|
+
<div class="button-content">
|
|
32
|
+
<app-country-flags
|
|
33
|
+
*ngIf="showCountryFlags && getSelectedCountryCode()"
|
|
34
|
+
[country]="getSelectedCountryCode()"
|
|
35
|
+
[style]="'rectangle'"
|
|
36
|
+
></app-country-flags>
|
|
37
|
+
<div class="elipsis">
|
|
38
|
+
{{
|
|
39
|
+
(selectedOption
|
|
40
|
+
? showCountryFlags && selectedOption.shortLabel
|
|
41
|
+
? selectedOption.shortLabel
|
|
42
|
+
: selectedOption.label
|
|
43
|
+
: selectProperties.placeholder
|
|
44
|
+
) | translate
|
|
45
|
+
}}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<app-icon
|
|
49
|
+
[name]="isExpanded ? 'Dropdown-up' : 'Dropdown-down'"
|
|
50
|
+
width="20px"
|
|
51
|
+
height="20px"
|
|
52
|
+
color="Gray-Gray-400"
|
|
53
|
+
></app-icon>
|
|
54
|
+
</button>
|
|
55
|
+
|
|
56
|
+
<button
|
|
57
|
+
*ngIf="multiSelect"
|
|
58
|
+
#buttonSelect
|
|
59
|
+
type="button"
|
|
60
|
+
class="select-button"
|
|
61
|
+
[disabled]="disabled"
|
|
62
|
+
[ngClass]="{
|
|
63
|
+
'select-completed': !!selectedOption
|
|
64
|
+
}"
|
|
65
|
+
(click)="showOptions()"
|
|
66
|
+
>
|
|
67
|
+
<div class="elipsis">
|
|
68
|
+
{{ (labelDrop ? labelDrop : selectProperties.placeholder) | translate }}
|
|
69
|
+
</div>
|
|
70
|
+
<app-icon
|
|
71
|
+
[name]="isExpanded ? 'Dropdown-up' : 'Dropdown-down'"
|
|
72
|
+
[width]="selectProperties?.dropdownType ? '24px' : '20px'"
|
|
73
|
+
[height]="selectProperties?.dropdownType ? '24px' : '20px'"
|
|
74
|
+
[color]="
|
|
75
|
+
disabled
|
|
76
|
+
? 'Gray-Gray-300'
|
|
77
|
+
: selectProperties?.dropdownType
|
|
78
|
+
? 'Gray-Gray-600'
|
|
79
|
+
: 'Gray-Gray-500'
|
|
80
|
+
"
|
|
81
|
+
></app-icon>
|
|
82
|
+
</button>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div *ngIf="selectProperties.textHelper" class="select-helper">
|
|
86
|
+
<span>{{ selectProperties.textHelper | translate }}</span>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div *ngIf="selectProperties.hasError" class="select-helper-error">
|
|
90
|
+
<app-icon name="Warning-circle" width="12px" height="12px" color="Error-Error-500"></app-icon>
|
|
91
|
+
<span>{{ selectProperties.errorText | translate }}</span>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<!-- Template para el dropdown que se renderizará en el overlay -->
|
|
96
|
+
<ng-template #dropdownTemplate>
|
|
97
|
+
<ul @selectAnimation class="select-dropdown-overlay" (scroll)="onScroll($event)">
|
|
98
|
+
<ng-container *ngIf="searchEnabled">
|
|
99
|
+
<li class="sticky-search">
|
|
100
|
+
<app-dropi-search
|
|
101
|
+
[placeholder]="selectProperties.placeHolderSearch || 'Buscar'"
|
|
102
|
+
[(textInput)]="searchTerm"
|
|
103
|
+
(onInput)="filterOptions($event)"
|
|
104
|
+
(onKeyEnter)="onKeyPress($event)"
|
|
105
|
+
(onClear)="onClearHanddle()"
|
|
106
|
+
></app-dropi-search>
|
|
107
|
+
</li>
|
|
108
|
+
</ng-container>
|
|
109
|
+
|
|
110
|
+
<ng-container *ngIf="multiSelect">
|
|
111
|
+
<li>
|
|
112
|
+
<app-dropi-dropdown
|
|
113
|
+
[options]="multiSelecOptions"
|
|
114
|
+
[parameters]="parametersDrop"
|
|
115
|
+
[isInSelect]="true"
|
|
116
|
+
[valueModel]="'label'"
|
|
117
|
+
(modelChange)="getValueDrop($event)"
|
|
118
|
+
></app-dropi-dropdown>
|
|
119
|
+
</li>
|
|
120
|
+
</ng-container>
|
|
121
|
+
|
|
122
|
+
<ng-container *ngIf="isGrouped">
|
|
123
|
+
<ng-container *ngFor="let group of filteredOptions">
|
|
124
|
+
<li class="option-group-title Body-M-Medium">{{ group.category | translate }}</li>
|
|
125
|
+
|
|
126
|
+
<li *ngFor="let option of group.options">
|
|
127
|
+
<button
|
|
128
|
+
class="option option-group Body-M-Regular"
|
|
129
|
+
(click)="selectOption(option)"
|
|
130
|
+
[disabled]="option.disabled"
|
|
131
|
+
>
|
|
132
|
+
{{ option.label | translate }}
|
|
133
|
+
</button>
|
|
134
|
+
</li>
|
|
135
|
+
</ng-container>
|
|
136
|
+
</ng-container>
|
|
137
|
+
|
|
138
|
+
<ng-container *ngIf="!isGrouped && !multiSelect">
|
|
139
|
+
<li *ngFor="let option of filteredOptions">
|
|
140
|
+
<button
|
|
141
|
+
class="option"
|
|
142
|
+
[ngClass]="{ 'option-with-flag': showCountryFlags && option.countryCode }"
|
|
143
|
+
(click)="selectOption(option)"
|
|
144
|
+
[disabled]="option.disabled"
|
|
145
|
+
>
|
|
146
|
+
<app-country-flags
|
|
147
|
+
*ngIf="showCountryFlags && option.countryCode"
|
|
148
|
+
[country]="option.countryCode"
|
|
149
|
+
[style]="'rectangle'"
|
|
150
|
+
></app-country-flags>
|
|
151
|
+
<span>{{
|
|
152
|
+
(showCountryFlags && option.shortLabel ? option.shortLabel : option.label) | translate
|
|
153
|
+
}}</span>
|
|
154
|
+
</button>
|
|
155
|
+
</li>
|
|
156
|
+
</ng-container>
|
|
157
|
+
</ul>
|
|
158
|
+
</ng-template>
|