@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,203 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
ViewEncapsulation,
|
|
4
|
+
Input,
|
|
5
|
+
OnInit,
|
|
6
|
+
Output,
|
|
7
|
+
EventEmitter,
|
|
8
|
+
ElementRef,
|
|
9
|
+
HostListener,
|
|
10
|
+
} from '@angular/core';
|
|
11
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
12
|
+
import { UserService } from 'src/app/pages/service/auth/user.service';
|
|
13
|
+
import { Api } from 'src/app/services/api.service';
|
|
14
|
+
import { SettingsService } from 'src/app/services/setting.service';
|
|
15
|
+
import { COUNTRIES } from 'src/app/constants/constants';
|
|
16
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
17
|
+
import { NumericInputDirective } from './numeric-input.directive';
|
|
18
|
+
import { NgClass, NgFor, CommonModule } from '@angular/common';
|
|
19
|
+
import { FormsModule, FormControl } from '@angular/forms';
|
|
20
|
+
import { NgSelectModule } from '@ng-select/ng-select';
|
|
21
|
+
import { IconComponent } from '../icon/icon.component';
|
|
22
|
+
|
|
23
|
+
interface Country {
|
|
24
|
+
code: string;
|
|
25
|
+
name: string;
|
|
26
|
+
flag: string;
|
|
27
|
+
maxLength: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface SelectProperties {
|
|
31
|
+
label: string;
|
|
32
|
+
placeholder: string;
|
|
33
|
+
options: Country[];
|
|
34
|
+
showObligatory?: boolean;
|
|
35
|
+
textHelper?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@Component({
|
|
39
|
+
selector: 'app-dropi-phone-input',
|
|
40
|
+
templateUrl: './dropi-phone-input.component.html',
|
|
41
|
+
styleUrls: ['./dropi-phone-input.component.scss'],
|
|
42
|
+
encapsulation: ViewEncapsulation.None,
|
|
43
|
+
standalone: true,
|
|
44
|
+
imports: [
|
|
45
|
+
CommonModule,
|
|
46
|
+
NgSelectModule,
|
|
47
|
+
FormsModule,
|
|
48
|
+
NgClass,
|
|
49
|
+
NgFor,
|
|
50
|
+
NumericInputDirective,
|
|
51
|
+
TranslateModule,
|
|
52
|
+
IconComponent,
|
|
53
|
+
],
|
|
54
|
+
})
|
|
55
|
+
export class DropiPhoneInputComponent implements OnInit {
|
|
56
|
+
private _CodArea!: string;
|
|
57
|
+
@Input() set CodArea(value: any) {
|
|
58
|
+
this._CodArea = value;
|
|
59
|
+
|
|
60
|
+
// Si ya tienes la lista de países cargada:
|
|
61
|
+
if (this.countries && Array.isArray(this.countries)) {
|
|
62
|
+
const match = this.countries.find((c) => c.code === value);
|
|
63
|
+
if (match) {
|
|
64
|
+
this.selectedOption = match;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
get CodArea(): string {
|
|
69
|
+
return this._CodArea;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@Input() ngModelPhone = '';
|
|
73
|
+
@Input() phoneNumberPlaceholder: string = null;
|
|
74
|
+
@Input() isValidPhone = undefined;
|
|
75
|
+
@Input() public selectedOption: Country;
|
|
76
|
+
@Input() public selectProperties: SelectProperties;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Establece si el campo del teléfono debe ser verificado al inicializar el componente.
|
|
80
|
+
* @default true
|
|
81
|
+
*/
|
|
82
|
+
@Input() validateOnInit = true;
|
|
83
|
+
@Input() disabledInput = false;
|
|
84
|
+
/**
|
|
85
|
+
* FormControl opcional para validación y mostrar errores
|
|
86
|
+
*/
|
|
87
|
+
@Input() public formControl: FormControl;
|
|
88
|
+
|
|
89
|
+
@Output() ngModelChangeCod = new EventEmitter();
|
|
90
|
+
@Output() ngModelChangePhone = new EventEmitter();
|
|
91
|
+
@Output() verifiedField = new EventEmitter();
|
|
92
|
+
@Output() onChangeSelect: EventEmitter<Country> = new EventEmitter();
|
|
93
|
+
|
|
94
|
+
maxLengthPhone = 10;
|
|
95
|
+
countries: Country[] = COUNTRIES;
|
|
96
|
+
disabled: any;
|
|
97
|
+
isExpanded: boolean;
|
|
98
|
+
|
|
99
|
+
constructor(
|
|
100
|
+
private elementRef: ElementRef,
|
|
101
|
+
public userService: UserService,
|
|
102
|
+
public settingsService: SettingsService,
|
|
103
|
+
public apiService: Api,
|
|
104
|
+
private readonly translateService: TranslateService,
|
|
105
|
+
) {}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Verifica si el formControl tiene errores y está dirty/touched
|
|
109
|
+
*/
|
|
110
|
+
get hasError(): boolean {
|
|
111
|
+
return (
|
|
112
|
+
this.formControl &&
|
|
113
|
+
this.formControl.invalid &&
|
|
114
|
+
(this.formControl.dirty || this.formControl.touched)
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
ngOnInit(): void {
|
|
119
|
+
if (this.validateOnInit) this.validtaeLengthPhone();
|
|
120
|
+
|
|
121
|
+
if (!this.phoneNumberPlaceholder)
|
|
122
|
+
this.phoneNumberPlaceholder = this.translateService.instant('Enter phone number');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
cambioCod(option): void {
|
|
126
|
+
this.isExpanded = false;
|
|
127
|
+
this.selectedOption = option;
|
|
128
|
+
this.ngModelPhone = '';
|
|
129
|
+
this.ngModelChangeCod.emit(option.code);
|
|
130
|
+
this.validtaeLengthPhone();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
cambioPhone(event?: KeyboardEvent): void {
|
|
134
|
+
if (this.ngModelPhone?.length === 0 && event?.key === 'Backspace') return;
|
|
135
|
+
if (this.ngModelPhone === '' && event) this.ngModelPhone = event?.key;
|
|
136
|
+
|
|
137
|
+
this.ngModelChangePhone.emit(this.ngModelPhone);
|
|
138
|
+
this.validtaeLengthPhone();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
validtaeLengthPhone(): void {
|
|
142
|
+
const country = this.countries.find((c) => c.code === this.CodArea);
|
|
143
|
+
if (country) {
|
|
144
|
+
this.maxLengthPhone = country.maxLength;
|
|
145
|
+
|
|
146
|
+
// Nueva logica para Ecuador: acepta tanto 9 como 10 dígitos
|
|
147
|
+
if (this.CodArea === '593') {
|
|
148
|
+
const phoneLength = this.ngModelPhone?.length || 0;
|
|
149
|
+
if (phoneLength === 9 || phoneLength === 10) {
|
|
150
|
+
this.isValidPhone = true;
|
|
151
|
+
this.verifiedField.emit(true);
|
|
152
|
+
} else {
|
|
153
|
+
this.isValidPhone = false;
|
|
154
|
+
this.verifiedField.emit(false);
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
if (this.ngModelPhone?.length === this.maxLengthPhone) {
|
|
158
|
+
this.isValidPhone = true;
|
|
159
|
+
this.verifiedField.emit(true);
|
|
160
|
+
} else {
|
|
161
|
+
this.isValidPhone = false;
|
|
162
|
+
this.verifiedField.emit(false);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
} else {
|
|
166
|
+
this.isValidPhone = false;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
handlePaste(event: ClipboardEvent): void {
|
|
171
|
+
event.preventDefault();
|
|
172
|
+
const pastedText = event.clipboardData?.getData('text') || '';
|
|
173
|
+
const sanitizedText = pastedText.replace(/\D+/g, '');
|
|
174
|
+
this.ngModelPhone = sanitizedText;
|
|
175
|
+
this.cambioPhone();
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@HostListener('document:click', ['$event'])
|
|
179
|
+
closeDropdown(event?: MouseEvent): void {
|
|
180
|
+
if (event && !this.elementRef.nativeElement.contains(event.target)) {
|
|
181
|
+
this.isExpanded = false;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
showOptions() {
|
|
186
|
+
if (this.disabled) return;
|
|
187
|
+
this.isExpanded = !this.isExpanded;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
setPropertyById(code: string) {
|
|
191
|
+
this.selectedOption = this.selectProperties.options.find(
|
|
192
|
+
(propertie) => propertie.code === code,
|
|
193
|
+
);
|
|
194
|
+
this.onChangeSelect.emit(this.selectedOption);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
setPropertyByLabel(name: string) {
|
|
198
|
+
this.selectedOption = this.selectProperties.options.find(
|
|
199
|
+
(propertie) => propertie.name === name,
|
|
200
|
+
);
|
|
201
|
+
this.onChangeSelect.emit(this.selectedOption);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Directive, ElementRef, HostListener } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[appNumericInput]',
|
|
5
|
+
standalone: true
|
|
6
|
+
})
|
|
7
|
+
export class NumericInputDirective {
|
|
8
|
+
constructor(private el: ElementRef) {}
|
|
9
|
+
|
|
10
|
+
@HostListener('input', ['$event']) onInputChange(event) {
|
|
11
|
+
const initialValue = this.el.nativeElement.value;
|
|
12
|
+
this.el.nativeElement.value = initialValue.replace(/[^0-9]/g, '').slice(0, 20);
|
|
13
|
+
if (initialValue !== this.el.nativeElement.value) {
|
|
14
|
+
event.stopPropagation();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
input[type='radio'] {
|
|
2
|
+
appearance: none;
|
|
3
|
+
width: 20px;
|
|
4
|
+
height: 20px;
|
|
5
|
+
border: 2px solid var(--Primary-Primary-500); /* 🔲 Borde blanco */
|
|
6
|
+
border-radius: 50%;
|
|
7
|
+
background-color: transparent;
|
|
8
|
+
position: relative;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
outline: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
input[type='radio']::before {
|
|
14
|
+
content: '';
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 3px;
|
|
17
|
+
left: 3px;
|
|
18
|
+
width: 10px;
|
|
19
|
+
height: 10px;
|
|
20
|
+
background-color: #f4ae6b; /* 🟠 Centro color durazno */
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
input[type='radio']:checked::before {
|
|
26
|
+
display: block;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
input {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
align-items: center;
|
|
33
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { By } from '@angular/platform-browser';
|
|
3
|
+
import { DebugElement } from '@angular/core';
|
|
4
|
+
import { DropiRadioButtonComponent } from './dropi-radio-button.component';
|
|
5
|
+
|
|
6
|
+
describe('DropiRadioButtonComponent', () => {
|
|
7
|
+
let component: DropiRadioButtonComponent;
|
|
8
|
+
let fixture: ComponentFixture<DropiRadioButtonComponent>;
|
|
9
|
+
let debugElement: DebugElement;
|
|
10
|
+
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
await TestBed.configureTestingModule({
|
|
13
|
+
imports: [DropiRadioButtonComponent],
|
|
14
|
+
}).compileComponents();
|
|
15
|
+
|
|
16
|
+
fixture = TestBed.createComponent(DropiRadioButtonComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
debugElement = fixture.debugElement;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe('Inicialización del componente', () => {
|
|
23
|
+
it('should create', () => {
|
|
24
|
+
expect(component).toBeTruthy();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should initialize with default values', () => {
|
|
28
|
+
expect(component.label).toBe('');
|
|
29
|
+
expect(component.name).toBe('name');
|
|
30
|
+
expect(component.id).toBe('radioButton');
|
|
31
|
+
expect(component.checked).toBe(false);
|
|
32
|
+
expect(component.resetTrigger).toBe(false);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('Propiedades de entrada', () => {
|
|
37
|
+
it('should accept custom label', () => {
|
|
38
|
+
component.label = 'Option 1';
|
|
39
|
+
fixture.detectChanges();
|
|
40
|
+
expect(component.label).toBe('Option 1');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should accept custom name', () => {
|
|
44
|
+
component.name = 'customGroup';
|
|
45
|
+
fixture.detectChanges();
|
|
46
|
+
expect(component.name).toBe('customGroup');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should accept custom id', () => {
|
|
50
|
+
component.id = 'customRadio1';
|
|
51
|
+
fixture.detectChanges();
|
|
52
|
+
expect(component.id).toBe('customRadio1');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('should accept checked state', () => {
|
|
56
|
+
component.checked = true;
|
|
57
|
+
fixture.detectChanges();
|
|
58
|
+
expect(component.checked).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should accept resetTrigger', () => {
|
|
62
|
+
component.resetTrigger = true;
|
|
63
|
+
fixture.detectChanges();
|
|
64
|
+
expect(component.resetTrigger).toBe(true);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
describe('Eventos de salida', () => {
|
|
69
|
+
it('should emit onChange event when clicked', () => {
|
|
70
|
+
const emitSpy = jest.spyOn(component.onChange, 'emit');
|
|
71
|
+
const mockEvent = { target: { checked: true } };
|
|
72
|
+
|
|
73
|
+
component.sendClick(mockEvent);
|
|
74
|
+
|
|
75
|
+
expect(emitSpy).toHaveBeenCalledWith(mockEvent);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('should emit event with correct data', () => {
|
|
79
|
+
const emitSpy = jest.spyOn(component.onChange, 'emit');
|
|
80
|
+
const mockEvent = {
|
|
81
|
+
target: {
|
|
82
|
+
id: 'radio1',
|
|
83
|
+
value: 'option1',
|
|
84
|
+
checked: true,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
component.sendClick(mockEvent);
|
|
89
|
+
|
|
90
|
+
expect(emitSpy).toHaveBeenCalledWith(mockEvent);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe('Funcionalidad de reset', () => {
|
|
95
|
+
it('should reset checked state when resetTrigger changes to true', () => {
|
|
96
|
+
component.checked = true;
|
|
97
|
+
fixture.detectChanges();
|
|
98
|
+
|
|
99
|
+
component.resetTrigger = true;
|
|
100
|
+
component.ngOnChanges({
|
|
101
|
+
resetTrigger: {
|
|
102
|
+
currentValue: true,
|
|
103
|
+
previousValue: false,
|
|
104
|
+
firstChange: false,
|
|
105
|
+
isFirstChange: () => false,
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
expect(component.checked).toBe(false);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('should not reset when resetTrigger is false', () => {
|
|
113
|
+
component.checked = true;
|
|
114
|
+
fixture.detectChanges();
|
|
115
|
+
|
|
116
|
+
component.resetTrigger = false;
|
|
117
|
+
component.ngOnChanges({
|
|
118
|
+
resetTrigger: {
|
|
119
|
+
currentValue: false,
|
|
120
|
+
previousValue: false,
|
|
121
|
+
firstChange: false,
|
|
122
|
+
isFirstChange: () => false,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
expect(component.checked).toBe(true);
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
describe('Comportamiento de radio group', () => {
|
|
131
|
+
it('should work with same name for radio group', () => {
|
|
132
|
+
const radioGroup = 'testGroup';
|
|
133
|
+
component.name = radioGroup;
|
|
134
|
+
fixture.detectChanges();
|
|
135
|
+
|
|
136
|
+
expect(component.name).toBe(radioGroup);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('should maintain unique id for each radio button', () => {
|
|
140
|
+
component.id = 'uniqueRadio1';
|
|
141
|
+
fixture.detectChanges();
|
|
142
|
+
|
|
143
|
+
expect(component.id).toBe('uniqueRadio1');
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
describe('ngOnChanges', () => {
|
|
148
|
+
it('should call ngOnChanges successfully', () => {
|
|
149
|
+
expect(() => component.ngOnChanges({})).not.toThrow();
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('should handle changes in checked property', () => {
|
|
153
|
+
component.checked = false;
|
|
154
|
+
|
|
155
|
+
component.ngOnChanges({
|
|
156
|
+
checked: {
|
|
157
|
+
currentValue: true,
|
|
158
|
+
previousValue: false,
|
|
159
|
+
firstChange: false,
|
|
160
|
+
isFirstChange: () => false,
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
fixture.detectChanges();
|
|
165
|
+
expect(component).toBeTruthy();
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
describe('Integración completa', () => {
|
|
170
|
+
it('should work with all properties set', () => {
|
|
171
|
+
component.label = 'Payment Method A';
|
|
172
|
+
component.name = 'paymentMethod';
|
|
173
|
+
component.id = 'payment_a';
|
|
174
|
+
component.checked = true;
|
|
175
|
+
|
|
176
|
+
fixture.detectChanges();
|
|
177
|
+
|
|
178
|
+
expect(component.label).toBe('Payment Method A');
|
|
179
|
+
expect(component.name).toBe('paymentMethod');
|
|
180
|
+
expect(component.id).toBe('payment_a');
|
|
181
|
+
expect(component.checked).toBe(true);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it('should handle complete user interaction workflow', () => {
|
|
185
|
+
const emitSpy = jest.spyOn(component.onChange, 'emit');
|
|
186
|
+
|
|
187
|
+
// Setup
|
|
188
|
+
component.label = 'Option 1';
|
|
189
|
+
component.name = 'options';
|
|
190
|
+
component.id = 'opt1';
|
|
191
|
+
component.checked = false;
|
|
192
|
+
fixture.detectChanges();
|
|
193
|
+
|
|
194
|
+
// User clicks
|
|
195
|
+
const mockEvent = { target: { checked: true, id: 'opt1' } };
|
|
196
|
+
component.sendClick(mockEvent);
|
|
197
|
+
|
|
198
|
+
expect(emitSpy).toHaveBeenCalledWith(mockEvent);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it('should handle reset and reselection workflow', () => {
|
|
202
|
+
// Initial selection
|
|
203
|
+
component.checked = true;
|
|
204
|
+
fixture.detectChanges();
|
|
205
|
+
|
|
206
|
+
// Reset
|
|
207
|
+
component.resetTrigger = true;
|
|
208
|
+
component.ngOnChanges({
|
|
209
|
+
resetTrigger: {
|
|
210
|
+
currentValue: true,
|
|
211
|
+
previousValue: false,
|
|
212
|
+
firstChange: false,
|
|
213
|
+
isFirstChange: () => false,
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
expect(component.checked).toBe(false);
|
|
218
|
+
|
|
219
|
+
// Reselect
|
|
220
|
+
component.checked = true;
|
|
221
|
+
fixture.detectChanges();
|
|
222
|
+
expect(component.checked).toBe(true);
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import {
|
|
3
|
+
Component,
|
|
4
|
+
ElementRef,
|
|
5
|
+
EventEmitter,
|
|
6
|
+
Input,
|
|
7
|
+
OnChanges,
|
|
8
|
+
OnInit,
|
|
9
|
+
Output,
|
|
10
|
+
SimpleChanges,
|
|
11
|
+
ViewChild,
|
|
12
|
+
} from '@angular/core';
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'app-dropi-radio-button',
|
|
16
|
+
templateUrl: './dropi-radio-button.component.html',
|
|
17
|
+
styleUrls: ['./dropi-radio-button.component.scss'],
|
|
18
|
+
imports: [CommonModule],
|
|
19
|
+
standalone: true,
|
|
20
|
+
})
|
|
21
|
+
export class DropiRadioButtonComponent implements OnInit, OnChanges {
|
|
22
|
+
@Input() label = '';
|
|
23
|
+
@Input() name = 'name';
|
|
24
|
+
@Input() id = 'radioButton';
|
|
25
|
+
@Input() checked = false;
|
|
26
|
+
@Input() resetTrigger: boolean = false; // Nuevo input para reiniciar
|
|
27
|
+
|
|
28
|
+
@Output() onChange = new EventEmitter<{}>();
|
|
29
|
+
@ViewChild('radioInput') radioInput!: ElementRef<HTMLInputElement>;
|
|
30
|
+
|
|
31
|
+
constructor() {}
|
|
32
|
+
|
|
33
|
+
ngOnInit() {}
|
|
34
|
+
|
|
35
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
36
|
+
if (changes['resetTrigger'] && this.resetTrigger) {
|
|
37
|
+
this.checked = false; // Reiniciar el estado
|
|
38
|
+
if (this.radioInput) {
|
|
39
|
+
this.radioInput.nativeElement.checked = false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// ... existing code ...
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
sendClick(e) {
|
|
46
|
+
this.onChange.emit(e);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<div [style.--color-back]="backgroundInput" #containerRef class="container-search">
|
|
2
|
+
<input
|
|
3
|
+
(focus)="onFocus()"
|
|
4
|
+
(input)="changeText($event)"
|
|
5
|
+
(change)="onChangHandler($event)"
|
|
6
|
+
(keyup.enter)="onEnter($event)"
|
|
7
|
+
[(ngModel)]="textInput"
|
|
8
|
+
[ngClass]="{
|
|
9
|
+
'Body-M-Regular': true,
|
|
10
|
+
'custom-input': true,
|
|
11
|
+
'input-drop-class': type === 'dropdown-button'
|
|
12
|
+
}"
|
|
13
|
+
[type]="typeInput"
|
|
14
|
+
[maxlength]="maxLength"
|
|
15
|
+
[placeholder]="placeholder | translate"
|
|
16
|
+
/>
|
|
17
|
+
<svg
|
|
18
|
+
[style.color]="colorSearch"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
width="20px"
|
|
21
|
+
height="20px"
|
|
22
|
+
viewBox="0 0 18 18"
|
|
23
|
+
fill="none"
|
|
24
|
+
>
|
|
25
|
+
<g clip-path="url(#clip0_3021_2)">
|
|
26
|
+
<path
|
|
27
|
+
d="M17.1297 16.1484L12.9846 12.0032C14.1142 10.6217 14.6695 8.85886 14.5358 7.07932C14.4021 5.29979 13.5896 3.63972 12.2662 2.44249C10.9429 1.24526 9.20997 0.602467 7.42598 0.647073C5.64199 0.691678 3.94338 1.42027 2.68152 2.68213C1.41965 3.944 0.69106 5.64261 0.646455 7.4266C0.601849 9.21059 1.24464 10.9435 2.44187 12.2668C3.6391 13.5902 5.29917 14.4028 7.0787 14.5365C8.85824 14.6702 10.6211 14.1148 12.0026 12.9852L16.1478 17.1303C16.2787 17.2568 16.4542 17.3268 16.6362 17.3252C16.8183 17.3237 16.9925 17.2506 17.1212 17.1219C17.25 16.9931 17.323 16.8189 17.3246 16.6368C17.3262 16.4548 17.2562 16.2794 17.1297 16.1484ZM7.61095 13.1671C6.51217 13.1671 5.43806 12.8413 4.52445 12.2308C3.61084 11.6204 2.89877 10.7527 2.47829 9.73759C2.0578 8.72244 1.94778 7.60541 2.16214 6.52773C2.37651 5.45006 2.90562 4.46016 3.68258 3.6832C4.45954 2.90624 5.44944 2.37713 6.52712 2.16276C7.60479 1.9484 8.72183 2.05842 9.73697 2.47891C10.7521 2.89939 11.6198 3.61146 12.2302 4.52507C12.8407 5.43868 13.1665 6.51278 13.1665 7.61157C13.1649 9.08449 12.579 10.4966 11.5375 11.5381C10.496 12.5796 9.08387 13.1655 7.61095 13.1671Z"
|
|
28
|
+
fill="currentColor"
|
|
29
|
+
/>
|
|
30
|
+
</g>
|
|
31
|
+
<defs>
|
|
32
|
+
<clipPath id="clip0_3021_2">
|
|
33
|
+
<rect
|
|
34
|
+
width="16.6667"
|
|
35
|
+
height="16.6667"
|
|
36
|
+
fill="white"
|
|
37
|
+
transform="translate(0.666664 0.666626)"
|
|
38
|
+
/>
|
|
39
|
+
</clipPath>
|
|
40
|
+
</defs>
|
|
41
|
+
</svg>
|
|
42
|
+
|
|
43
|
+
<div class="container-close-drop">
|
|
44
|
+
<app-icon
|
|
45
|
+
*ngIf="textInput?.length > 0 && showIcon"
|
|
46
|
+
(click)="clearText()"
|
|
47
|
+
[class]="label ? 'icon-close-input-label' : 'icon-close-input'"
|
|
48
|
+
name="Close-small"
|
|
49
|
+
width="20px"
|
|
50
|
+
height="20px"
|
|
51
|
+
color="Gray-Gray-600"
|
|
52
|
+
></app-icon>
|
|
53
|
+
|
|
54
|
+
<div class="label-custom" *ngIf="label && isFocus && type == 'dropdown'">
|
|
55
|
+
<span class="label-custom-icon Body-M-Regular">
|
|
56
|
+
{{ label || 'Label' }}
|
|
57
|
+
</span>
|
|
58
|
+
<app-icon name="Dropdown-down" width="24px" height="24px" color="Gray-Gray-500"></app-icon>
|
|
59
|
+
</div>
|
|
60
|
+
<dropi-button
|
|
61
|
+
*ngIf="type == 'dropdown-button'"
|
|
62
|
+
[type]="'dropdown'"
|
|
63
|
+
[severity]="'tertiary'"
|
|
64
|
+
[state]="'default'"
|
|
65
|
+
[text]="textDropButton"
|
|
66
|
+
(onClick)="handleClickDropButton($event)"
|
|
67
|
+
></dropi-button>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<div
|
|
71
|
+
#overlay
|
|
72
|
+
(click)="$event.stopPropagation()"
|
|
73
|
+
[class]="'overlay-search-input ' + overlaySelected"
|
|
74
|
+
*ngIf="(isFocus && type == 'dropdown') || (isClickedDropButton && type == 'dropdown-button')"
|
|
75
|
+
[ngStyle]="getOverlayStyles()"
|
|
76
|
+
@fade
|
|
77
|
+
>
|
|
78
|
+
<div
|
|
79
|
+
class="container-content"
|
|
80
|
+
*ngIf="
|
|
81
|
+
(isVisibleContent && type == 'dropdown') ||
|
|
82
|
+
(isClickedDropButton && type == 'dropdown-button')
|
|
83
|
+
"
|
|
84
|
+
@fade
|
|
85
|
+
>
|
|
86
|
+
<div class="content-no-found" *ngIf="dataToSearchCache?.length == 0">
|
|
87
|
+
<svg
|
|
88
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
89
|
+
width="21"
|
|
90
|
+
height="20"
|
|
91
|
+
viewBox="0 0 21 20"
|
|
92
|
+
fill="none"
|
|
93
|
+
>
|
|
94
|
+
<path
|
|
95
|
+
d="M10.5 1.66663C8.85185 1.66663 7.24068 2.15537 5.87027 3.07105C4.49986 3.98672 3.43176 5.28821 2.80103 6.81093C2.1703 8.33365 2.00527 10.0092 2.32681 11.6257C2.64836 13.2422 3.44203 14.7271 4.60747 15.8925C5.77291 17.058 7.25776 17.8516 8.87427 18.1732C10.4908 18.4947 12.1663 18.3297 13.6891 17.699C15.2118 17.0682 16.5133 16.0001 17.4289 14.6297C18.3446 13.2593 18.8334 11.6481 18.8334 9.99996C18.831 7.79056 17.9522 5.67233 16.3899 4.11004C14.8277 2.54776 12.7094 1.66902 10.5 1.66663ZM10.5 16.9444C9.12654 16.9444 7.78391 16.5371 6.6419 15.7741C5.49989 15.011 4.6098 13.9264 4.08419 12.6575C3.55859 11.3886 3.42106 9.99226 3.68902 8.64517C3.95697 7.29808 4.61836 6.06069 5.58956 5.0895C6.56076 4.1183 7.79814 3.4569 9.14523 3.18895C10.4923 2.921 11.8886 3.05852 13.1575 3.58413C14.4265 4.10974 15.5111 4.99983 16.2741 6.14183C17.0372 7.28384 17.4445 8.62648 17.4445 9.99996C17.4424 11.8411 16.7102 13.6063 15.4083 14.9082C14.1064 16.2101 12.3412 16.9424 10.5 16.9444Z"
|
|
96
|
+
fill="var(--Gray-Gray-600)"
|
|
97
|
+
/>
|
|
98
|
+
<path
|
|
99
|
+
d="M10.5 5.13895C10.3158 5.13895 10.1392 5.21212 10.009 5.34235C9.87875 5.47259 9.80558 5.64922 9.80558 5.8334V11.389C9.80558 11.5731 9.87875 11.7498 10.009 11.88C10.1392 12.0102 10.3158 12.0834 10.5 12.0834C10.6842 12.0834 10.8608 12.0102 10.9911 11.88C11.1213 11.7498 11.1945 11.5731 11.1945 11.389V5.8334C11.1945 5.64922 11.1213 5.47259 10.9911 5.34235C10.8608 5.21212 10.6842 5.13895 10.5 5.13895Z"
|
|
100
|
+
fill="#475066"
|
|
101
|
+
/>
|
|
102
|
+
<path
|
|
103
|
+
d="M11.1945 14.1667C11.1945 13.7832 10.8836 13.4723 10.5 13.4723C10.1165 13.4723 9.80558 13.7832 9.80558 14.1667C9.80558 14.5503 10.1165 14.8612 10.5 14.8612C10.8836 14.8612 11.1945 14.5503 11.1945 14.1667Z"
|
|
104
|
+
fill="#475066"
|
|
105
|
+
/>
|
|
106
|
+
</svg>
|
|
107
|
+
|
|
108
|
+
<div class="Body-S-Regular text-no-found">
|
|
109
|
+
No encontramos resultados, por favor intenta con otra búsqueda.
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<div *ngIf="dataToSearchCache?.length > 0">
|
|
114
|
+
<div class="container-array" *ngFor="let data of dataToSearchCache; let i = index">
|
|
115
|
+
<app-dropi-checkbox
|
|
116
|
+
[checked]="data.isChecked"
|
|
117
|
+
(onChange)="checkingList($event, data)"
|
|
118
|
+
></app-dropi-checkbox>
|
|
119
|
+
{{ data[dataName] }}
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|