@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,49 @@
|
|
|
1
|
+
<div class="tag-state" [ngClass]="state">
|
|
2
|
+
<svg
|
|
3
|
+
*ngIf="state === 'active'"
|
|
4
|
+
width="17"
|
|
5
|
+
height="17"
|
|
6
|
+
viewBox="0 0 17 17"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
>
|
|
10
|
+
<path
|
|
11
|
+
d="M11.5444 5.87067L12.5389 6.88004L8.43554 10.9225C8.16142 11.1966 7.80087 11.3333 7.43892 11.3333C7.07696 11.3333 6.71287 11.1952 6.43592 10.919L4.46533 9.00929L5.45204 7.99142L7.43042 9.90887L11.5444 5.87067ZM17 8.5C17 13.187 13.187 17 8.5 17C3.81296 17 0 13.187 0 8.5C0 3.81296 3.81296 0 8.5 0C13.187 0 17 3.81296 17 8.5ZM15.5833 8.5C15.5833 4.59425 12.4057 1.41667 8.5 1.41667C4.59425 1.41667 1.41667 4.59425 1.41667 8.5C1.41667 12.4057 4.59425 15.5833 8.5 15.5833C12.4057 15.5833 15.5833 12.4057 15.5833 8.5Z"
|
|
12
|
+
fill="#1F2937"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
|
|
16
|
+
<svg
|
|
17
|
+
*ngIf="state === 'pending'"
|
|
18
|
+
width="17"
|
|
19
|
+
height="17"
|
|
20
|
+
viewBox="0 0 17 17"
|
|
21
|
+
fill="none"
|
|
22
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
23
|
+
>
|
|
24
|
+
<path
|
|
25
|
+
d="M8.5 17C3.81296 17 0 13.187 0 8.5C0 3.81296 3.81296 0 8.5 0C13.187 0 17 3.81296 17 8.5C17 13.187 13.187 17 8.5 17ZM8.5 1.41667C4.59425 1.41667 1.41667 4.59425 1.41667 8.5C1.41667 12.4057 4.59425 15.5833 8.5 15.5833C12.4057 15.5833 15.5833 12.4057 15.5833 8.5C15.5833 4.59425 12.4057 1.41667 8.5 1.41667ZM9.20833 8.5V4.25C9.20833 3.859 8.891 3.54167 8.5 3.54167C8.109 3.54167 7.79167 3.859 7.79167 4.25V7.79167H5.66667C5.27567 7.79167 4.95833 8.109 4.95833 8.5C4.95833 8.891 5.27567 9.20833 5.66667 9.20833H8.5C8.891 9.20833 9.20833 8.891 9.20833 8.5Z"
|
|
26
|
+
fill="#1F2937"
|
|
27
|
+
/>
|
|
28
|
+
</svg>
|
|
29
|
+
|
|
30
|
+
<svg
|
|
31
|
+
*ngIf="state === 'canceled'"
|
|
32
|
+
width="12"
|
|
33
|
+
height="14"
|
|
34
|
+
viewBox="0 0 14 16"
|
|
35
|
+
fill="none"
|
|
36
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
+
>
|
|
38
|
+
<path
|
|
39
|
+
fill-rule="evenodd"
|
|
40
|
+
clip-rule="evenodd"
|
|
41
|
+
d="M11.5497 4.86859V5.76046C12.1075 6.00391 12.5823 6.40464 12.916 6.91364C13.2497 7.42264 13.4279 8.01785 13.4287 8.62648V12.3844C13.4277 13.2146 13.0974 14.0106 12.5103 14.5976C11.9233 15.1847 11.1273 15.515 10.2971 15.516H4.03392C3.20368 15.515 2.40773 15.1847 1.82066 14.5976C1.23359 14.0106 0.903338 13.2146 0.902344 12.3844V8.62648C0.903144 8.01785 1.08129 7.42264 1.41498 6.91364C1.74868 6.40464 2.22347 6.00391 2.78129 5.76046V4.86859C2.78129 3.70582 3.2432 2.59068 4.0654 1.76848C4.8876 0.946282 6.00274 0.484375 7.1655 0.484375C8.32827 0.484375 9.44341 0.946282 10.2656 1.76848C11.0878 2.59068 11.5497 3.70582 11.5497 4.86859ZM4.95114 2.65422C4.36386 3.24151 4.03392 4.03804 4.03392 4.86859V5.4949H10.2971V4.86859C10.2971 4.03804 9.96715 3.24151 9.37986 2.65422C8.79258 2.06694 7.99605 1.73701 7.1655 1.73701C6.33496 1.73701 5.53843 2.06694 4.95114 2.65422ZM11.6257 13.713C11.9781 13.3606 12.176 12.8827 12.176 12.3844V8.62648C12.176 8.12815 11.9781 7.65023 11.6257 7.29786C11.2733 6.94549 10.7954 6.74753 10.2971 6.74753H4.03392C3.53559 6.74753 3.05768 6.94549 2.70531 7.29786C2.35294 7.65023 2.15498 8.12815 2.15498 8.62648V12.3844C2.15498 12.8827 2.35294 13.3606 2.70531 13.713C3.05768 14.0654 3.53559 14.2633 4.03392 14.2633H10.2971C10.7954 14.2633 11.2733 14.0654 11.6257 13.713ZM6.72263 9.43615C6.84009 9.31869 6.99939 9.25271 7.1655 9.25271C7.33161 9.25271 7.49092 9.31869 7.60837 9.43615C7.72583 9.55361 7.79182 9.71291 7.79182 9.87902V11.1317C7.79182 11.2978 7.72583 11.4571 7.60837 11.5745C7.49092 11.692 7.33161 11.758 7.1655 11.758C6.99939 11.758 6.84009 11.692 6.72263 11.5745C6.60517 11.4571 6.53919 11.2978 6.53919 11.1317V9.87902C6.53919 9.71291 6.60517 9.55361 6.72263 9.43615Z"
|
|
42
|
+
fill="#585C65"
|
|
43
|
+
/>
|
|
44
|
+
</svg>
|
|
45
|
+
|
|
46
|
+
<p>
|
|
47
|
+
{{ stateText[state] }}
|
|
48
|
+
</p>
|
|
49
|
+
</div>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
.tag-state {
|
|
2
|
+
border-radius: 12px;
|
|
3
|
+
padding: 2px 10px;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 4px;
|
|
7
|
+
|
|
8
|
+
svg {
|
|
9
|
+
width: 13px;
|
|
10
|
+
}
|
|
11
|
+
p {
|
|
12
|
+
font-size: 13px;
|
|
13
|
+
font-weight: 500;
|
|
14
|
+
line-height: 20px;
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
}
|
|
18
|
+
&.active {
|
|
19
|
+
background: var(--Success-success-50, #e7f8f3);
|
|
20
|
+
color: var(--Success-success-500, #0abb87);
|
|
21
|
+
svg {
|
|
22
|
+
path {
|
|
23
|
+
fill: var(--Success-success-500, #0abb87);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
&.pending {
|
|
28
|
+
color: var(--Orange-orange-500, #f49a3d);
|
|
29
|
+
background: var(--Orange-orange-50, #fef5ec);
|
|
30
|
+
|
|
31
|
+
svg {
|
|
32
|
+
path {
|
|
33
|
+
fill: var(--Orange-orange-500, #f49a3d);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
&.canceled {
|
|
38
|
+
color: var(--Gray-gray-500, #6c757d);
|
|
39
|
+
background: var(--Gray-gray-50, #f8f9fa);
|
|
40
|
+
|
|
41
|
+
svg {
|
|
42
|
+
path {
|
|
43
|
+
fill: var(--Gray-gray-500, #6c757d);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
&.frozen {
|
|
48
|
+
color: var(--Gray-gray-500, #6c757d);
|
|
49
|
+
background: var(--Gray-gray-50, #f8f9fa);
|
|
50
|
+
|
|
51
|
+
svg {
|
|
52
|
+
path {
|
|
53
|
+
fill: var(--Gray-gray-500, #6c757d);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { By } from '@angular/platform-browser';
|
|
3
|
+
import { DebugElement } from '@angular/core';
|
|
4
|
+
import { BadgeComponent } from './badge.component';
|
|
5
|
+
|
|
6
|
+
describe('BadgeComponent', () => {
|
|
7
|
+
let component: BadgeComponent;
|
|
8
|
+
let fixture: ComponentFixture<BadgeComponent>;
|
|
9
|
+
let debugElement: DebugElement;
|
|
10
|
+
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
await TestBed.configureTestingModule({
|
|
13
|
+
imports: [BadgeComponent],
|
|
14
|
+
}).compileComponents();
|
|
15
|
+
|
|
16
|
+
fixture = TestBed.createComponent(BadgeComponent);
|
|
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 have correct state text mapping', () => {
|
|
28
|
+
expect(component.stateText.pending).toBe('Pendiente');
|
|
29
|
+
expect(component.stateText.active).toBe('Activo');
|
|
30
|
+
expect(component.stateText.canceled).toBe('Cancelado');
|
|
31
|
+
expect(component.stateText.frozen).toBe('Congelado');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('should accept state input', () => {
|
|
35
|
+
component.state = 'active';
|
|
36
|
+
expect(component.state).toBe('active');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe('Estados del badge', () => {
|
|
41
|
+
it('should handle pending state', () => {
|
|
42
|
+
component.state = 'pending';
|
|
43
|
+
fixture.detectChanges();
|
|
44
|
+
|
|
45
|
+
expect(component.state).toBe('pending');
|
|
46
|
+
expect(component.stateText[component.state]).toBe('Pendiente');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should handle active state', () => {
|
|
50
|
+
component.state = 'active';
|
|
51
|
+
fixture.detectChanges();
|
|
52
|
+
|
|
53
|
+
expect(component.state).toBe('active');
|
|
54
|
+
expect(component.stateText[component.state]).toBe('Activo');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('should handle canceled state', () => {
|
|
58
|
+
component.state = 'canceled';
|
|
59
|
+
fixture.detectChanges();
|
|
60
|
+
|
|
61
|
+
expect(component.state).toBe('canceled');
|
|
62
|
+
expect(component.stateText[component.state]).toBe('Cancelado');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('should handle frozen state', () => {
|
|
66
|
+
component.state = 'frozen';
|
|
67
|
+
fixture.detectChanges();
|
|
68
|
+
|
|
69
|
+
expect(component.state).toBe('frozen');
|
|
70
|
+
expect(component.stateText[component.state]).toBe('Congelado');
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe('Renderizado del template', () => {
|
|
75
|
+
it('should apply correct CSS class for pending state', () => {
|
|
76
|
+
component.state = 'pending';
|
|
77
|
+
fixture.detectChanges();
|
|
78
|
+
|
|
79
|
+
const badgeElement = debugElement.query(By.css('.tag-state'));
|
|
80
|
+
expect(badgeElement.nativeElement.classList.contains('pending')).toBeTruthy();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('should apply correct CSS class for active state', () => {
|
|
84
|
+
component.state = 'active';
|
|
85
|
+
fixture.detectChanges();
|
|
86
|
+
|
|
87
|
+
const badgeElement = debugElement.query(By.css('.tag-state'));
|
|
88
|
+
expect(badgeElement.nativeElement.classList.contains('active')).toBeTruthy();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('should apply correct CSS class for canceled state', () => {
|
|
92
|
+
component.state = 'canceled';
|
|
93
|
+
fixture.detectChanges();
|
|
94
|
+
|
|
95
|
+
const badgeElement = debugElement.query(By.css('.tag-state'));
|
|
96
|
+
expect(badgeElement.nativeElement.classList.contains('canceled')).toBeTruthy();
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('should apply correct CSS class for frozen state', () => {
|
|
100
|
+
component.state = 'frozen';
|
|
101
|
+
fixture.detectChanges();
|
|
102
|
+
|
|
103
|
+
const badgeElement = debugElement.query(By.css('.tag-state'));
|
|
104
|
+
expect(badgeElement.nativeElement.classList.contains('frozen')).toBeTruthy();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('should display correct text for each state', () => {
|
|
108
|
+
const states = ['pending', 'active', 'canceled', 'frozen'];
|
|
109
|
+
|
|
110
|
+
states.forEach((state) => {
|
|
111
|
+
component.state = state;
|
|
112
|
+
fixture.detectChanges();
|
|
113
|
+
|
|
114
|
+
const badgeElement = debugElement.query(By.css('.tag-state'));
|
|
115
|
+
expect(badgeElement.nativeElement.textContent.trim()).toBe(component.stateText[state]);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
describe('Casos edge', () => {
|
|
121
|
+
it('should handle undefined state', () => {
|
|
122
|
+
component.state = undefined;
|
|
123
|
+
fixture.detectChanges();
|
|
124
|
+
|
|
125
|
+
expect(component.state).toBeUndefined();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('should handle invalid state', () => {
|
|
129
|
+
component.state = 'invalid-state';
|
|
130
|
+
fixture.detectChanges();
|
|
131
|
+
|
|
132
|
+
expect(component.state).toBe('invalid-state');
|
|
133
|
+
expect(component.stateText[component.state]).toBeUndefined();
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('should handle empty string state', () => {
|
|
137
|
+
component.state = '';
|
|
138
|
+
fixture.detectChanges();
|
|
139
|
+
|
|
140
|
+
expect(component.state).toBe('');
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it('should handle null state', () => {
|
|
144
|
+
component.state = null;
|
|
145
|
+
fixture.detectChanges();
|
|
146
|
+
|
|
147
|
+
expect(component.state).toBeNull();
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
describe('Cambios dinámicos', () => {
|
|
152
|
+
it('should update display when state changes', () => {
|
|
153
|
+
component.state = 'pending';
|
|
154
|
+
fixture.detectChanges();
|
|
155
|
+
|
|
156
|
+
let badgeElement = debugElement.query(By.css('.tag-state'));
|
|
157
|
+
expect(badgeElement.nativeElement.textContent.trim()).toBe('Pendiente');
|
|
158
|
+
|
|
159
|
+
component.state = 'active';
|
|
160
|
+
fixture.detectChanges();
|
|
161
|
+
|
|
162
|
+
badgeElement = debugElement.query(By.css('.tag-state'));
|
|
163
|
+
expect(badgeElement.nativeElement.textContent.trim()).toBe('Activo');
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it('should update CSS classes when state changes', () => {
|
|
167
|
+
component.state = 'pending';
|
|
168
|
+
fixture.detectChanges();
|
|
169
|
+
|
|
170
|
+
let badgeElement = debugElement.query(By.css('.tag-state'));
|
|
171
|
+
expect(badgeElement.nativeElement.classList.contains('pending')).toBeTruthy();
|
|
172
|
+
|
|
173
|
+
component.state = 'frozen';
|
|
174
|
+
fixture.detectChanges();
|
|
175
|
+
|
|
176
|
+
badgeElement = debugElement.query(By.css('.tag-state'));
|
|
177
|
+
expect(badgeElement.nativeElement.classList.contains('frozen')).toBeTruthy();
|
|
178
|
+
expect(badgeElement.nativeElement.classList.contains('badge--pending')).toBeFalsy();
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'dropi-badge',
|
|
6
|
+
standalone: true,
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
templateUrl: './badge.component.html',
|
|
9
|
+
styleUrls: ['./badge.component.scss'],
|
|
10
|
+
})
|
|
11
|
+
export class BadgeComponent {
|
|
12
|
+
@Input() state: string;
|
|
13
|
+
// pending | active | blocked | frozen
|
|
14
|
+
|
|
15
|
+
stateText = {
|
|
16
|
+
pending: 'Pendiente',
|
|
17
|
+
active: 'Activo',
|
|
18
|
+
canceled: 'Cancelado',
|
|
19
|
+
frozen: 'Congelado',
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
:host ::ng-deep .breadcumb-list .p-breadcrumb {
|
|
2
|
+
background: transparent;
|
|
3
|
+
border: none;
|
|
4
|
+
padding: 0px;
|
|
5
|
+
border-radius: 0px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:host ::ng-deep .breadcumb-list .p-breadcrumb ol {
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
min-width: max-content;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host ::ng-deep .breadcumb-list .p-breadcrumb li {
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
& .pi:before {
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host ::ng-deep .breadcumb-list .p-breadcrumb span.p-menuitem-text {
|
|
22
|
+
color: #6b6f88;
|
|
23
|
+
font-weight: 400;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host ::ng-deep .breadcumb-list .p-breadcrumb svg {
|
|
27
|
+
color: #a3a5b491;
|
|
28
|
+
width: 12px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host ::ng-deep .card-icon {
|
|
32
|
+
background-image: url('../../../assets/img/icons/card.svg');
|
|
33
|
+
width: 20px;
|
|
34
|
+
height: 20px;
|
|
35
|
+
background-repeat: no-repeat;
|
|
36
|
+
background-position: center;
|
|
37
|
+
background-size: contain;
|
|
38
|
+
svg {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// color #A3A6B8 breadcrum disable color
|
|
44
|
+
:host ::ng-deep .breadcumb-list .p-breadcrumb li.p-disabled span.p-menuitem-text {
|
|
45
|
+
color: #a3a6b8;
|
|
46
|
+
}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { RouterTestingModule } from '@angular/router/testing';
|
|
3
|
+
import { Component } from '@angular/core';
|
|
4
|
+
import { MenuItem } from 'primeng/api';
|
|
5
|
+
import { BreadcrumbComponent } from './breadcrumb.component';
|
|
6
|
+
import { IconComponent } from '../icon/icon.component';
|
|
7
|
+
|
|
8
|
+
// Componente dummy para las rutas de prueba
|
|
9
|
+
@Component({
|
|
10
|
+
template: '<div>Test Component</div>',
|
|
11
|
+
})
|
|
12
|
+
class TestComponent {}
|
|
13
|
+
|
|
14
|
+
describe('BreadcrumbComponent', () => {
|
|
15
|
+
let component: BreadcrumbComponent;
|
|
16
|
+
let fixture: ComponentFixture<BreadcrumbComponent>;
|
|
17
|
+
|
|
18
|
+
beforeEach(async () => {
|
|
19
|
+
await TestBed.configureTestingModule({
|
|
20
|
+
imports: [
|
|
21
|
+
BreadcrumbComponent,
|
|
22
|
+
IconComponent,
|
|
23
|
+
RouterTestingModule.withRoutes([
|
|
24
|
+
{ path: 'test', component: TestComponent },
|
|
25
|
+
{ path: 'home', component: TestComponent },
|
|
26
|
+
{ path: '', component: TestComponent },
|
|
27
|
+
]),
|
|
28
|
+
],
|
|
29
|
+
declarations: [TestComponent],
|
|
30
|
+
}).compileComponents();
|
|
31
|
+
|
|
32
|
+
fixture = TestBed.createComponent(BreadcrumbComponent);
|
|
33
|
+
component = fixture.componentInstance;
|
|
34
|
+
fixture.detectChanges();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('Inicialización del componente', () => {
|
|
38
|
+
it('should create', () => {
|
|
39
|
+
expect(component).toBeTruthy();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should initialize with default values', () => {
|
|
43
|
+
expect(component.items).toBeUndefined(); // No tiene valor por defecto
|
|
44
|
+
expect(component.imageIcon).toBe('pi pi-home');
|
|
45
|
+
expect(component.homeRoute).toBe('/');
|
|
46
|
+
expect(component.home).toBeDefined(); // Se define en ngOnInit (ejecutado automáticamente)
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should set home item correctly on ngOnInit', () => {
|
|
50
|
+
component.ngOnInit();
|
|
51
|
+
|
|
52
|
+
expect(component.home.icon).toBe('pi pi-home');
|
|
53
|
+
expect(component.home.routerLink).toBe('/');
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('should accept custom imageIcon', () => {
|
|
57
|
+
component.imageIcon = 'dashboard';
|
|
58
|
+
component.ngOnInit();
|
|
59
|
+
|
|
60
|
+
expect(component.home.icon).toBe('dashboard');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('should accept custom homeRoute', () => {
|
|
64
|
+
component.homeRoute = '/dashboard';
|
|
65
|
+
component.ngOnInit();
|
|
66
|
+
|
|
67
|
+
expect(component.home.routerLink).toBe('/dashboard');
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
describe('Manejo de items', () => {
|
|
72
|
+
it('should handle empty items array', () => {
|
|
73
|
+
component.items = [];
|
|
74
|
+
fixture.detectChanges();
|
|
75
|
+
|
|
76
|
+
expect(component.items.length).toBe(0);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('should handle single item', () => {
|
|
80
|
+
const testItems: MenuItem[] = [{ label: 'Products', routerLink: '/products' }];
|
|
81
|
+
|
|
82
|
+
component.items = testItems;
|
|
83
|
+
fixture.detectChanges();
|
|
84
|
+
|
|
85
|
+
expect(component.items.length).toBe(1);
|
|
86
|
+
expect(component.items[0].label).toBe('Products');
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('should handle multiple items', () => {
|
|
90
|
+
const testItems: MenuItem[] = [
|
|
91
|
+
{ label: 'Products', routerLink: '/products' },
|
|
92
|
+
{ label: 'Electronics', routerLink: '/products/electronics' },
|
|
93
|
+
{ label: 'Phones', routerLink: '/products/electronics/phones' },
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
component.items = testItems;
|
|
97
|
+
fixture.detectChanges();
|
|
98
|
+
|
|
99
|
+
expect(component.items.length).toBe(3);
|
|
100
|
+
expect(component.items[2].label).toBe('Phones');
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('should handle items with icons', () => {
|
|
104
|
+
const testItems: MenuItem[] = [
|
|
105
|
+
{ label: 'Products', routerLink: '/products', icon: 'pi-box' },
|
|
106
|
+
{ label: 'Settings', routerLink: '/settings', icon: 'pi-cog' },
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
component.items = testItems;
|
|
110
|
+
fixture.detectChanges();
|
|
111
|
+
|
|
112
|
+
expect(component.items[0].icon).toBe('pi-box');
|
|
113
|
+
expect(component.items[1].icon).toBe('pi-cog');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('should handle items without routerLink', () => {
|
|
117
|
+
const testItems: MenuItem[] = [
|
|
118
|
+
{ label: 'Current Page' }, // Sin routerLink
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
component.items = testItems;
|
|
122
|
+
fixture.detectChanges();
|
|
123
|
+
|
|
124
|
+
expect(component.items[0].routerLink).toBeUndefined();
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
describe('Configuración del home item', () => {
|
|
129
|
+
it('should create home item with default icon and route', () => {
|
|
130
|
+
component.ngOnInit();
|
|
131
|
+
|
|
132
|
+
expect(component.home.icon).toBe('pi pi-home');
|
|
133
|
+
expect(component.home.routerLink).toBe('/');
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('should create home item with custom icon', () => {
|
|
137
|
+
component.imageIcon = 'house';
|
|
138
|
+
component.ngOnInit();
|
|
139
|
+
|
|
140
|
+
expect(component.home.icon).toBe('house');
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it('should create home item with custom route', () => {
|
|
144
|
+
component.homeRoute = '/main';
|
|
145
|
+
component.ngOnInit();
|
|
146
|
+
|
|
147
|
+
expect(component.home.routerLink).toBe('/main');
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it('should create home item with both custom icon and route', () => {
|
|
151
|
+
component.imageIcon = 'dashboard';
|
|
152
|
+
component.homeRoute = '/admin';
|
|
153
|
+
component.ngOnInit();
|
|
154
|
+
|
|
155
|
+
expect(component.home.icon).toBe('dashboard');
|
|
156
|
+
expect(component.home.routerLink).toBe('/admin');
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
describe('Casos edge', () => {
|
|
161
|
+
it('should handle undefined items', () => {
|
|
162
|
+
component.items = undefined as any;
|
|
163
|
+
fixture.detectChanges();
|
|
164
|
+
|
|
165
|
+
expect(component.items).toBeUndefined();
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('should handle null items', () => {
|
|
169
|
+
component.items = null as any;
|
|
170
|
+
fixture.detectChanges();
|
|
171
|
+
|
|
172
|
+
expect(component.items).toBeNull();
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
it('should handle empty string for imageIcon', () => {
|
|
176
|
+
component.imageIcon = '';
|
|
177
|
+
component.ngOnInit();
|
|
178
|
+
|
|
179
|
+
expect(component.home.icon).toBe('');
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it('should handle empty string for homeRoute', () => {
|
|
183
|
+
component.homeRoute = '';
|
|
184
|
+
component.ngOnInit();
|
|
185
|
+
|
|
186
|
+
expect(component.home.routerLink).toBe('');
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it('should handle null imageIcon', () => {
|
|
190
|
+
component.imageIcon = null as any;
|
|
191
|
+
component.ngOnInit();
|
|
192
|
+
|
|
193
|
+
expect(component.home.icon).toBeNull();
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it('should handle null homeRoute', () => {
|
|
197
|
+
component.homeRoute = null as any;
|
|
198
|
+
component.ngOnInit();
|
|
199
|
+
|
|
200
|
+
expect(component.home.routerLink).toBeNull();
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
describe('Cambios dinámicos', () => {
|
|
205
|
+
it('should update home item when imageIcon changes and ngOnInit is called', () => {
|
|
206
|
+
component.imageIcon = 'original';
|
|
207
|
+
component.ngOnInit();
|
|
208
|
+
expect(component.home.icon).toBe('original');
|
|
209
|
+
|
|
210
|
+
component.imageIcon = 'changed';
|
|
211
|
+
component.ngOnInit();
|
|
212
|
+
expect(component.home.icon).toBe('changed');
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it('should update home item when homeRoute changes and ngOnInit is called', () => {
|
|
216
|
+
component.homeRoute = '/original';
|
|
217
|
+
component.ngOnInit();
|
|
218
|
+
expect(component.home.routerLink).toBe('/original');
|
|
219
|
+
|
|
220
|
+
component.homeRoute = '/changed';
|
|
221
|
+
component.ngOnInit();
|
|
222
|
+
expect(component.home.routerLink).toBe('/changed');
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it('should handle multiple calls to ngOnInit', () => {
|
|
226
|
+
component.ngOnInit();
|
|
227
|
+
const firstHomeItem = component.home;
|
|
228
|
+
|
|
229
|
+
component.ngOnInit();
|
|
230
|
+
const secondHomeItem = component.home;
|
|
231
|
+
|
|
232
|
+
expect(firstHomeItem.icon).toBe(secondHomeItem.icon);
|
|
233
|
+
expect(firstHomeItem.routerLink).toBe(secondHomeItem.routerLink);
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
describe('Integración completa', () => {
|
|
238
|
+
it('should work with complete breadcrumb setup', () => {
|
|
239
|
+
const testItems: MenuItem[] = [
|
|
240
|
+
{ label: 'Dashboard', routerLink: '/dashboard', icon: 'dashboard' },
|
|
241
|
+
{ label: 'Users', routerLink: '/users', icon: 'people' },
|
|
242
|
+
{ label: 'Profile', routerLink: '/users/profile' },
|
|
243
|
+
];
|
|
244
|
+
|
|
245
|
+
component.imageIcon = 'home';
|
|
246
|
+
component.homeRoute = '/';
|
|
247
|
+
component.items = testItems;
|
|
248
|
+
component.ngOnInit();
|
|
249
|
+
fixture.detectChanges();
|
|
250
|
+
|
|
251
|
+
expect(component.home.icon).toBe('home');
|
|
252
|
+
expect(component.home.routerLink).toBe('/');
|
|
253
|
+
expect(component.items.length).toBe(3);
|
|
254
|
+
expect(component.items[0].icon).toBe('dashboard');
|
|
255
|
+
expect(component.items[2].label).toBe('Profile');
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it('should handle complex menu items with commands', () => {
|
|
259
|
+
const testItems: MenuItem[] = [
|
|
260
|
+
{
|
|
261
|
+
label: 'Actions',
|
|
262
|
+
command: () => console.log('Action clicked'),
|
|
263
|
+
icon: 'settings',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
label: 'Reports',
|
|
267
|
+
routerLink: '/reports',
|
|
268
|
+
queryParams: { type: 'monthly' },
|
|
269
|
+
},
|
|
270
|
+
];
|
|
271
|
+
|
|
272
|
+
component.items = testItems;
|
|
273
|
+
fixture.detectChanges();
|
|
274
|
+
|
|
275
|
+
expect(component.items[0].command).toBeDefined();
|
|
276
|
+
expect(component.items[1].queryParams).toEqual({ type: 'monthly' });
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Component, OnInit, Input, NO_ERRORS_SCHEMA } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { BreadcrumbModule } from 'primeng/breadcrumb';
|
|
4
|
+
import { MenuItem } from 'primeng/api';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-breadcrumb',
|
|
8
|
+
standalone: true,
|
|
9
|
+
imports: [CommonModule, BreadcrumbModule],
|
|
10
|
+
templateUrl: './breadcrumb.component.html',
|
|
11
|
+
styleUrls: ['./breadcrumb.component.scss'],
|
|
12
|
+
schemas: [NO_ERRORS_SCHEMA],
|
|
13
|
+
})
|
|
14
|
+
export class BreadcrumbComponent implements OnInit {
|
|
15
|
+
@Input() items: MenuItem[];
|
|
16
|
+
@Input() imageIcon: string = 'pi pi-home';
|
|
17
|
+
@Input() homeRoute: string = '/';
|
|
18
|
+
|
|
19
|
+
home: MenuItem | undefined;
|
|
20
|
+
|
|
21
|
+
ngOnInit() {
|
|
22
|
+
this.home = { icon: this.imageIcon, routerLink: this.homeRoute };
|
|
23
|
+
}
|
|
24
|
+
}
|