@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,72 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FileItem } from '../../../utilities/interfaces/ui/upload.model';
|
|
4
|
+
import { ButtonComponent } from '@app/ui/dropi-button/dropi-button.component';
|
|
5
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
6
|
+
import { IconComponent } from '@app/ui/icon/icon.component';
|
|
7
|
+
import { Subscription } from 'rxjs';
|
|
8
|
+
import { ImageOverlayService } from '@app/services/ui/image-overlay.service';
|
|
9
|
+
import { environment } from '@env/environment';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'app-card-view',
|
|
13
|
+
standalone: true,
|
|
14
|
+
imports: [CommonModule, ButtonComponent, TranslateModule, IconComponent],
|
|
15
|
+
templateUrl: './card-view.component.html',
|
|
16
|
+
styleUrls: ['./card-view.component.scss'],
|
|
17
|
+
})
|
|
18
|
+
export class CardViewComponent {
|
|
19
|
+
@Input() fileItem: FileItem = {
|
|
20
|
+
file: undefined,
|
|
21
|
+
progress: 0,
|
|
22
|
+
state: 'complete',
|
|
23
|
+
id: '',
|
|
24
|
+
};
|
|
25
|
+
@Input() onlyView: boolean;
|
|
26
|
+
|
|
27
|
+
@Output() action = new EventEmitter<{
|
|
28
|
+
file: FileItem;
|
|
29
|
+
type: 'delete' | 'confirm-delete' | 'cancel-delete';
|
|
30
|
+
}>();
|
|
31
|
+
|
|
32
|
+
constructor(private readonly imageOverlayService: ImageOverlayService) {}
|
|
33
|
+
|
|
34
|
+
getFileTypeClass(file: File): string {
|
|
35
|
+
const type = file?.type || '';
|
|
36
|
+
if (type.includes('pdf')) return 'pdf';
|
|
37
|
+
if (type.includes('word') || type.includes('document')) return 'word';
|
|
38
|
+
if (type.startsWith('image/')) return 'image';
|
|
39
|
+
return 'generic';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
onSendClick(type: 'delete' | 'confirm-delete' | 'cancel-delete'): void {
|
|
43
|
+
this.action.emit({ file: this.fileItem, type: type });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
openPreviewImage() {
|
|
47
|
+
if (this.fileItem.fileType !== 'image'){
|
|
48
|
+
// abre en nueva pestaña
|
|
49
|
+
console.log('item', this.fileItem?.uploadedUrl);
|
|
50
|
+
window.open(`${environment.AWS3WL.cloudfront_server}/${this.fileItem?.uploadedUrl}`, '_blank');
|
|
51
|
+
} else {
|
|
52
|
+
this.imageOverlayService.showOverlay([this.fileItem?.previewUrl]);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
downloadFile() {
|
|
57
|
+
const link = document.createElement('a');
|
|
58
|
+
link.href = this.fileItem?.previewUrl!;
|
|
59
|
+
link.download = this.fileItem?.file?.name!;
|
|
60
|
+
link.click();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
viewType(type: string): boolean {
|
|
64
|
+
let fileType = '';
|
|
65
|
+
if (this.fileItem?.file!) {
|
|
66
|
+
fileType = this.fileItem.file.type === 'application/pdf' ? 'pdf' : 'default';
|
|
67
|
+
} else {
|
|
68
|
+
fileType = this.fileItem?.previewUrl?.includes('pdf') ? 'pdf' : 'default';
|
|
69
|
+
}
|
|
70
|
+
return fileType === type;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
|
|
2
|
+
|
|
3
|
+
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
4
|
+
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
import { concat, interval, of, Subject } from 'rxjs';
|
|
7
|
+
import { UploadFileService } from '@app/services/ui/upload-file.service';
|
|
8
|
+
import { delay, map, take } from 'rxjs/operators';
|
|
9
|
+
import { DropZoneComponent } from './drop-zone.component';
|
|
10
|
+
|
|
11
|
+
const meta: Meta<DropZoneComponent> & { argTypes: Record<string, any> } = {
|
|
12
|
+
title: 'UI Dropi/Drop Zone',
|
|
13
|
+
component: DropZoneComponent,
|
|
14
|
+
decorators: [
|
|
15
|
+
moduleMetadata({
|
|
16
|
+
imports: [
|
|
17
|
+
CommonModule,
|
|
18
|
+
|
|
19
|
+
TranslateModule.forRoot({
|
|
20
|
+
loader: { provide: TranslateLoader, useValue: TranslateLoader },
|
|
21
|
+
}),
|
|
22
|
+
DropZoneComponent,
|
|
23
|
+
],
|
|
24
|
+
providers: [
|
|
25
|
+
{
|
|
26
|
+
provide: TranslateService,
|
|
27
|
+
useClass: TranslateService,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
provide: UploadFileService,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
}),
|
|
34
|
+
],
|
|
35
|
+
parameters: {
|
|
36
|
+
layout: 'centered',
|
|
37
|
+
design: {
|
|
38
|
+
type: 'figma',
|
|
39
|
+
url: 'https://www.figma.com/design/ONiVQJJ2qrJ6tmJnpNrrKE/-WEB--components?node-id=191-2299&m=dev', // Reemplazar con URL real
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
tags: ['autodocs'],
|
|
43
|
+
// ---- aquí overrideamos el tipo de argTypes para aceptar cualquiera ----
|
|
44
|
+
|
|
45
|
+
argTypes: {
|
|
46
|
+
multiple: {
|
|
47
|
+
description: 'Allows uploading multiple files',
|
|
48
|
+
control: { type: 'boolean' },
|
|
49
|
+
table: {
|
|
50
|
+
type: { summary: 'boolean' },
|
|
51
|
+
defaultValue: { summary: 'false' },
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
maxFiles: {
|
|
55
|
+
description: 'Maximum number of files that can be uploaded',
|
|
56
|
+
control: { type: 'number' },
|
|
57
|
+
table: {
|
|
58
|
+
type: { summary: 'number' },
|
|
59
|
+
defaultValue: { summary: '1' },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
maxFileSizeMB: {
|
|
63
|
+
description: 'Maximum file size in megabytes (MB)',
|
|
64
|
+
control: { type: 'number' },
|
|
65
|
+
table: {
|
|
66
|
+
type: { summary: 'number' },
|
|
67
|
+
defaultValue: { summary: '5' },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
textButton: {
|
|
71
|
+
description: 'Custom text for the upload button',
|
|
72
|
+
control: { type: 'text' },
|
|
73
|
+
table: {
|
|
74
|
+
type: { summary: 'string' },
|
|
75
|
+
defaultValue: { summary: 'Upload file' },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
textFileUpload: {
|
|
79
|
+
description: 'Custom text for the file upload area',
|
|
80
|
+
control: { type: 'text' },
|
|
81
|
+
table: {
|
|
82
|
+
type: { summary: 'string' },
|
|
83
|
+
defaultValue: {
|
|
84
|
+
summary: 'Drag and drop files here or click to select',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
isNotStore: {
|
|
89
|
+
description: 'If true, shows only the button without the drop zone area',
|
|
90
|
+
control: { type: 'boolean' },
|
|
91
|
+
table: {
|
|
92
|
+
type: { summary: 'boolean' },
|
|
93
|
+
defaultValue: { summary: 'false' },
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
size: {
|
|
97
|
+
description: 'Size variant of the component',
|
|
98
|
+
control: { type: 'select' },
|
|
99
|
+
options: ['small', 'medium', 'large'],
|
|
100
|
+
table: {
|
|
101
|
+
type: { summary: 'string' },
|
|
102
|
+
defaultValue: { summary: 'medium' },
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
params: {
|
|
106
|
+
description: 'Configuration options for file upload',
|
|
107
|
+
control: { type: 'object' },
|
|
108
|
+
},
|
|
109
|
+
uploadedUrlsChange: {
|
|
110
|
+
action: 'uploadedUrlsChange',
|
|
111
|
+
description: 'Emitted when upload is completed and URLs are returned',
|
|
112
|
+
table: {
|
|
113
|
+
category: 'Events',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export default meta;
|
|
120
|
+
type Story = StoryObj<DropZoneComponent>;
|
|
121
|
+
export const Default: Story = {
|
|
122
|
+
render: (args) => ({
|
|
123
|
+
props: args,
|
|
124
|
+
}),
|
|
125
|
+
args: {
|
|
126
|
+
multiple: false,
|
|
127
|
+
maxFiles: 1,
|
|
128
|
+
maxFileSizeMB: 5,
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const CustomTexButton: Story = {
|
|
133
|
+
render: (args) => ({
|
|
134
|
+
props: args,
|
|
135
|
+
}),
|
|
136
|
+
args: {
|
|
137
|
+
multiple: false,
|
|
138
|
+
maxFiles: 1,
|
|
139
|
+
maxFileSizeMB: 5,
|
|
140
|
+
textButton: 'Subir archivo personalizado',
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const CustomTextTitle: Story = {
|
|
145
|
+
render: (args) => ({
|
|
146
|
+
props: args,
|
|
147
|
+
}),
|
|
148
|
+
args: {
|
|
149
|
+
multiple: false,
|
|
150
|
+
maxFiles: 1,
|
|
151
|
+
maxFileSizeMB: 5,
|
|
152
|
+
textFileUpload: 'Subir archivo personalizado',
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export const small: Story = {
|
|
157
|
+
render: (args) => ({
|
|
158
|
+
props: args,
|
|
159
|
+
}),
|
|
160
|
+
args: {
|
|
161
|
+
multiple: false,
|
|
162
|
+
maxFiles: 1,
|
|
163
|
+
maxFileSizeMB: 5,
|
|
164
|
+
isNotStore: false,
|
|
165
|
+
size: 'small',
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const Button: Story = {
|
|
170
|
+
render: (args) => ({
|
|
171
|
+
props: args,
|
|
172
|
+
}),
|
|
173
|
+
args: {
|
|
174
|
+
multiple: false,
|
|
175
|
+
maxFiles: 1,
|
|
176
|
+
maxFileSizeMB: 5,
|
|
177
|
+
isNotStore: true,
|
|
178
|
+
},
|
|
179
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<div
|
|
2
|
+
class="file-upload"
|
|
3
|
+
(drop)="onDrop($event)"
|
|
4
|
+
(dragover)="onDragOver($event)"
|
|
5
|
+
(dragleave)="onDragLeave($event)"
|
|
6
|
+
>
|
|
7
|
+
<div *ngIf="!isNotStore" class="file-upload__zone" [class.drag-over]="dragOver">
|
|
8
|
+
<svg
|
|
9
|
+
*ngIf="size === 'default'"
|
|
10
|
+
width="40"
|
|
11
|
+
height="40"
|
|
12
|
+
viewBox="0 0 40 40"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
>
|
|
16
|
+
<path
|
|
17
|
+
d="M0 20C0 8.95431 8.95431 0 20 0C31.0457 0 40 8.95431 40 20C40 31.0457 31.0457 40 20 40C8.95431 40 0 31.0457 0 20Z"
|
|
18
|
+
fill="#FEF8F1"
|
|
19
|
+
/>
|
|
20
|
+
<g clip-path="url(#clip0_183_10598)">
|
|
21
|
+
<path
|
|
22
|
+
d="M19.3379 13.7187L19.3332 24.0107C19.3332 24.1875 19.4035 24.357 19.5285 24.4821C19.6535 24.6071 19.8231 24.6773 19.9999 24.6773C20.1767 24.6773 20.3463 24.6071 20.4713 24.4821C20.5963 24.357 20.6666 24.1875 20.6666 24.0107L20.6712 13.73L22.6126 15.672C22.7376 15.797 22.9071 15.8672 23.0839 15.8672C23.2607 15.8672 23.4302 15.797 23.5552 15.672C23.6802 15.547 23.7504 15.3774 23.7504 15.2007C23.7504 15.0239 23.6802 14.8543 23.5552 14.7293L21.4145 12.586C21.2288 12.4001 21.0083 12.2527 20.7655 12.1521C20.5228 12.0515 20.2626 11.9998 19.9999 11.9998C19.7371 11.9998 19.477 12.0515 19.2342 12.1521C18.9915 12.2527 18.771 12.4001 18.5852 12.586L16.4445 14.7273C16.3196 14.8523 16.2494 15.0219 16.2494 15.1987C16.2494 15.3754 16.3196 15.545 16.4445 15.67C16.5696 15.795 16.7391 15.8652 16.9159 15.8652C17.0927 15.8652 17.2622 15.795 17.3872 15.67L19.3379 13.7187Z"
|
|
23
|
+
fill="#F49A3D"
|
|
24
|
+
/>
|
|
25
|
+
<path
|
|
26
|
+
d="M26.6667 23.3329V25.9996C26.6667 26.1764 26.5964 26.346 26.4714 26.471C26.3464 26.596 26.1768 26.6663 26 26.6663H14C13.8232 26.6663 13.6536 26.596 13.5286 26.471C13.4036 26.346 13.3333 26.1764 13.3333 25.9996V23.3329C13.3333 23.1561 13.2631 22.9865 13.1381 22.8615C13.013 22.7365 12.8435 22.6663 12.6667 22.6663C12.4899 22.6663 12.3203 22.7365 12.1953 22.8615C12.0702 22.9865 12 23.1561 12 23.3329V25.9996C12 26.53 12.2107 27.0387 12.5858 27.4138C12.9609 27.7889 13.4696 27.9996 14 27.9996H26C26.5304 27.9996 27.0391 27.7889 27.4142 27.4138C27.7893 27.0387 28 26.53 28 25.9996V23.3329C28 23.1561 27.9298 22.9865 27.8047 22.8615C27.6797 22.7365 27.5101 22.6663 27.3333 22.6663C27.1565 22.6663 26.987 22.7365 26.8619 22.8615C26.7369 22.9865 26.6667 23.1561 26.6667 23.3329Z"
|
|
27
|
+
fill="#F49A3D"
|
|
28
|
+
/>
|
|
29
|
+
</g>
|
|
30
|
+
<defs>
|
|
31
|
+
<clipPath id="clip0_183_10598">
|
|
32
|
+
<rect width="16" height="16" fill="white" transform="translate(12 12)" />
|
|
33
|
+
</clipPath>
|
|
34
|
+
</defs>
|
|
35
|
+
</svg>
|
|
36
|
+
<div class="info">
|
|
37
|
+
<div [ngClass]="{ 'size-small-upload': size === 'small' }">
|
|
38
|
+
<div class="title">{{ textFileUpload | translate }}</div>
|
|
39
|
+
<dropi-button
|
|
40
|
+
*ngIf="size !== 'default'"
|
|
41
|
+
(onClick)="fileInput.click()"
|
|
42
|
+
[text]="textButton"
|
|
43
|
+
size="small"
|
|
44
|
+
></dropi-button>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div *ngIf="size === 'default'">
|
|
48
|
+
<div class="description">
|
|
49
|
+
{{ ('Supported formats' | translate) + ': ' }} {{ accept.join(', ') }}
|
|
50
|
+
</div>
|
|
51
|
+
<div class="description">
|
|
52
|
+
{{ ('Maximum size' | translate) + ': ' }} {{ maxFileSizeMB }}MB
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div *ngIf="size !== 'default'">
|
|
57
|
+
<div class="description">
|
|
58
|
+
{{ ('Supported formats' | translate) + ': ' }} {{ accept.join(', ') }}.
|
|
59
|
+
{{ ('Maximum size' | translate) + ': ' }} {{ maxFileSizeMB }}MB
|
|
60
|
+
</div>
|
|
61
|
+
<div class="description"></div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<dropi-button
|
|
66
|
+
*ngIf="size == 'default'"
|
|
67
|
+
(onClick)="fileInput.click()"
|
|
68
|
+
[text]="textButton"
|
|
69
|
+
size="small"
|
|
70
|
+
></dropi-button>
|
|
71
|
+
<input
|
|
72
|
+
#fileInput
|
|
73
|
+
type="file"
|
|
74
|
+
[attr.multiple]="multiple ? '' : null"
|
|
75
|
+
[attr.accept]="acceptedMimeTypes?.join(',')"
|
|
76
|
+
(change)="onFileChange($event)"
|
|
77
|
+
hidden
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div class="container-buttons-file" *ngIf="isNotStore">
|
|
82
|
+
<dropi-button
|
|
83
|
+
*ngIf="uploadStatus == 'idle' || uploadStatus == 'error' || uploadStatus == 'loading'"
|
|
84
|
+
[state]="disabled ? 'disabled' : stateButton"
|
|
85
|
+
preIcon="File-upload"
|
|
86
|
+
(onClick)="fileInput.click()"
|
|
87
|
+
[text]="textButton | translate"
|
|
88
|
+
></dropi-button>
|
|
89
|
+
<div *ngIf="uploadStatus == 'success'" class="button-mock">
|
|
90
|
+
{{ fileCharged }}
|
|
91
|
+
<div class="">
|
|
92
|
+
<app-icon
|
|
93
|
+
(click)="clearFile()"
|
|
94
|
+
class="colse-circle-mock"
|
|
95
|
+
name="Close-small"
|
|
96
|
+
width="12px"
|
|
97
|
+
height="12px"
|
|
98
|
+
color="Primary-Primary-500"
|
|
99
|
+
></app-icon>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
<input
|
|
103
|
+
#fileInput
|
|
104
|
+
type="file"
|
|
105
|
+
[attr.multiple]="multiple ? '' : null"
|
|
106
|
+
[attr.accept]="acceptedMimeTypes?.join(',')"
|
|
107
|
+
(change)="onFileChange($event)"
|
|
108
|
+
hidden
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
.file-upload {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: var(--Size-3, 12px);
|
|
8
|
+
background: var(--White, #fff);
|
|
9
|
+
|
|
10
|
+
&__zone {
|
|
11
|
+
display: flex;
|
|
12
|
+
padding: var(--Size-5);
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: var(--Size-6);
|
|
17
|
+
align-self: stretch;
|
|
18
|
+
border-radius: var(--Border-2, 8px);
|
|
19
|
+
border: 1px dashed var(--Gray-Gray-200);
|
|
20
|
+
background: var(--White);
|
|
21
|
+
text-align: center;
|
|
22
|
+
transition: border-color 0.3s ease;
|
|
23
|
+
&.drag-over {
|
|
24
|
+
border: 1px dashed var(--Primary-Primary-500, #f49a3d);
|
|
25
|
+
background: var(--Primary-Primary-50, #fef8f1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.info {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: var(--Size-2);
|
|
33
|
+
align-self: stretch;
|
|
34
|
+
|
|
35
|
+
.title {
|
|
36
|
+
color: var(--Gray-Gray-700);
|
|
37
|
+
text-align: center;
|
|
38
|
+
text-overflow: ellipsis;
|
|
39
|
+
font-size: var(--font-size-m);
|
|
40
|
+
font-weight: 500;
|
|
41
|
+
line-height: 150%;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.description {
|
|
45
|
+
color: var(--GrayGray-600, #475066);
|
|
46
|
+
text-align: center;
|
|
47
|
+
font-size: var(--font-size-s);
|
|
48
|
+
font-style: normal;
|
|
49
|
+
font-weight: 400;
|
|
50
|
+
line-height: 150%;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.size-small-upload {
|
|
55
|
+
gap: var(--Size-3);
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: row !important;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
.container-buttons-file {
|
|
61
|
+
position: relative;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
span {
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: 50px;
|
|
67
|
+
}
|
|
68
|
+
.button-mock {
|
|
69
|
+
padding: 10px;
|
|
70
|
+
border: 1px solid var(--Primary-Primary-500);
|
|
71
|
+
border-radius: 8px;
|
|
72
|
+
color: var(--Primary-Primary-500);
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
font-size: 14px;
|
|
76
|
+
gap: 0.5rem;
|
|
77
|
+
|
|
78
|
+
.colse-circle-mock {
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
border: 1px solid var(--Primary-Primary-500);
|
|
81
|
+
display: flex;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
align-items: center;
|
|
84
|
+
border-radius: 50%;
|
|
85
|
+
width: 14px;
|
|
86
|
+
height: 14px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
ElementRef,
|
|
4
|
+
EventEmitter,
|
|
5
|
+
Input,
|
|
6
|
+
OnChanges,
|
|
7
|
+
OnDestroy,
|
|
8
|
+
OnInit,
|
|
9
|
+
Output,
|
|
10
|
+
SimpleChanges,
|
|
11
|
+
ViewChild,
|
|
12
|
+
} from '@angular/core';
|
|
13
|
+
import { CommonModule } from '@angular/common';
|
|
14
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
15
|
+
import { ButtonComponent } from '@app/ui/dropi-button/dropi-button.component';
|
|
16
|
+
import { FILE_TYPE_MAP } from '../../../utilities/interfaces/ui/upload.model';
|
|
17
|
+
import { UploadFileService } from '@app/services/ui/upload-file.service';
|
|
18
|
+
import { CompressImagesService } from '@app/services/configuration-white-labels/compress-images.service';
|
|
19
|
+
import { Subscription } from 'rxjs';
|
|
20
|
+
import { IconComponent } from '@app/ui/icon/icon.component';
|
|
21
|
+
|
|
22
|
+
type UploadFileState = 'uploading' | 'complete' | 'confirm-delete';
|
|
23
|
+
interface FileItem {
|
|
24
|
+
file: File;
|
|
25
|
+
progress: number; // 0–100
|
|
26
|
+
state: UploadFileState;
|
|
27
|
+
previewUrl?: string;
|
|
28
|
+
}
|
|
29
|
+
@Component({
|
|
30
|
+
selector: 'app-drop-zone',
|
|
31
|
+
standalone: true,
|
|
32
|
+
imports: [CommonModule, TranslateModule, ButtonComponent, IconComponent],
|
|
33
|
+
templateUrl: './drop-zone.component.html',
|
|
34
|
+
styleUrls: ['./drop-zone.component.scss'],
|
|
35
|
+
})
|
|
36
|
+
export class DropZoneComponent implements OnInit, OnDestroy {
|
|
37
|
+
@Input() multiple = false;
|
|
38
|
+
@Input() maxFiles = 5;
|
|
39
|
+
@Input() maxFileSizeMB = 5;
|
|
40
|
+
@Input() accept: string[] = [];
|
|
41
|
+
@Input() compress: boolean = false;
|
|
42
|
+
@Input() maxHeight: number = 0;
|
|
43
|
+
@Input() maxWidth: number = 0;
|
|
44
|
+
@Input() isNotStore: boolean = false;
|
|
45
|
+
@Input() textButton: string = !this.isNotStore ? 'Seleccionar Imagen' : 'Select file';
|
|
46
|
+
@Input() textFileUpload: string = 'Drop or upload an image here';
|
|
47
|
+
//estados que se muestra el boton cuando no lleva el dropzone
|
|
48
|
+
@Input() uploadStatus: 'success' | 'error' | 'loading' | 'idle' = 'idle';
|
|
49
|
+
@Input() disabled: boolean = false;
|
|
50
|
+
@Input() size: 'small' | 'default' = 'default';
|
|
51
|
+
|
|
52
|
+
@Output() addFiles = new EventEmitter<File[]>();
|
|
53
|
+
@Output() fileCleared = new EventEmitter<string>();
|
|
54
|
+
|
|
55
|
+
dragOver = false;
|
|
56
|
+
selectedFiles: FileItem[] = [];
|
|
57
|
+
validFiles;
|
|
58
|
+
fileCharged = '';
|
|
59
|
+
|
|
60
|
+
private _isChargeFile = false;
|
|
61
|
+
|
|
62
|
+
get isChargeFile(): boolean {
|
|
63
|
+
return this._isChargeFile;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set isChargeFile(value: boolean) {
|
|
67
|
+
this._isChargeFile = value;
|
|
68
|
+
this.getStatebutton();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@ViewChild('fileInput') fileInput!: ElementRef<HTMLInputElement>;
|
|
72
|
+
private readonly subscriptions = new Subscription();
|
|
73
|
+
stateButton: string = '';
|
|
74
|
+
|
|
75
|
+
//tipos de archivos
|
|
76
|
+
|
|
77
|
+
constructor(
|
|
78
|
+
private sharedUpload: UploadFileService,
|
|
79
|
+
private compressImagesService: CompressImagesService,
|
|
80
|
+
) {}
|
|
81
|
+
|
|
82
|
+
ngOnInit() {
|
|
83
|
+
this.subscriptions.add(
|
|
84
|
+
this.sharedUpload.triggerInput$.subscribe(() => {
|
|
85
|
+
this.fileInput.nativeElement.value = '';
|
|
86
|
+
this.fileInput.nativeElement.click();
|
|
87
|
+
}),
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
getStatebutton() {
|
|
92
|
+
this.stateButton = this.isChargeFile ? 'loading' : '';
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
onDragOver(event: DragEvent): void {
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
this.dragOver = true;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
onDragLeave(event: DragEvent): void {
|
|
101
|
+
this.dragOver = false;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
onDrop(event: DragEvent): void {
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
this.dragOver = false;
|
|
107
|
+
const files: File[] = Array.from(event.dataTransfer.files) || [];
|
|
108
|
+
|
|
109
|
+
this.compressAndEmitFiles(files);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
onFileChange(event: Event): void {
|
|
113
|
+
this.isChargeFile = true;
|
|
114
|
+
const input = event.target as HTMLInputElement;
|
|
115
|
+
const files: File[] = Array.from(input.files) || [];
|
|
116
|
+
input.value = null;
|
|
117
|
+
|
|
118
|
+
this.compressAndEmitFiles(files);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
compressAndEmitFiles(files: File[]) {
|
|
122
|
+
let images = [];
|
|
123
|
+
let otherFiles = [];
|
|
124
|
+
|
|
125
|
+
files.forEach((file) => {
|
|
126
|
+
if (file.type.startsWith('image/')) {
|
|
127
|
+
images.push(file);
|
|
128
|
+
this.isChargeFile = false;
|
|
129
|
+
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
otherFiles.push(file);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
if (this.compress) {
|
|
136
|
+
this.compressImagesService
|
|
137
|
+
.compressFiles(images, this.maxWidth, this.maxHeight)
|
|
138
|
+
.subscribe((compressed) => {
|
|
139
|
+
this.sendFiles([...compressed, ...otherFiles]);
|
|
140
|
+
});
|
|
141
|
+
this.isChargeFile = false;
|
|
142
|
+
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
this.sendFiles(files);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
get acceptedMimeTypes(): string[] {
|
|
150
|
+
if (!this.accept.length) return ['*'];
|
|
151
|
+
return this.accept
|
|
152
|
+
.map((type) => FILE_TYPE_MAP[type.toUpperCase()] || [])
|
|
153
|
+
.reduce((acc, val) => acc.concat(val), []);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
sendFiles(files: File[]): void {
|
|
157
|
+
this.addFiles.emit(files);
|
|
158
|
+
this.isChargeFile = false;
|
|
159
|
+
this.fileCharged = files[0].name;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
clearFile() {
|
|
163
|
+
this.fileCharged = '';
|
|
164
|
+
this.selectedFiles = [];
|
|
165
|
+
this.uploadStatus = 'idle';
|
|
166
|
+
this.fileCleared.emit(this.uploadStatus);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
ngOnDestroy() {
|
|
170
|
+
this.subscriptions.unsubscribe();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<div class="upload-container">
|
|
2
|
+
<!--Encabezado -->
|
|
3
|
+
<div class="upload-header">
|
|
4
|
+
<div class="title text">{{ params.title | translate }}</div>
|
|
5
|
+
<div class="label text">{{ params.label | translate }}</div>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<app-alert
|
|
9
|
+
*ngIf="error"
|
|
10
|
+
[message]="errorMessage | translate"
|
|
11
|
+
type="default"
|
|
12
|
+
state="error"
|
|
13
|
+
[dismissable]="true"
|
|
14
|
+
[showButton]="false"
|
|
15
|
+
(onClose)="error = false"
|
|
16
|
+
></app-alert>
|
|
17
|
+
<!--Zona de arrastre -->
|
|
18
|
+
<app-drop-zone
|
|
19
|
+
*ngIf="selectedFiles.length < params.maxFiles"
|
|
20
|
+
[hidden]="params.previewType === 'grid' && (!params.viewDragAndDrop || selectedFiles.length > 0)"
|
|
21
|
+
[accept]="params.accept"
|
|
22
|
+
[multiple]="params.multiple"
|
|
23
|
+
[compress]="params.compress"
|
|
24
|
+
[maxHeight]="params.maxHeight"
|
|
25
|
+
[maxWidth]="params.maxWidth"
|
|
26
|
+
[maxFileSizeMB]="params.maxFileSizeMB"
|
|
27
|
+
[textButton]="params.textButton || 'Seleccionar Imagen'"
|
|
28
|
+
[textFileUpload]="params.textDropZone || 'Drop or upload an image here'"
|
|
29
|
+
(addFiles)="onFilesAdded($event)"
|
|
30
|
+
></app-drop-zone>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<!--Listado de archivos -->
|
|
34
|
+
<app-file-list
|
|
35
|
+
[onlyView]="params.onlyView"
|
|
36
|
+
[maxFiles]="params.maxFiles"
|
|
37
|
+
[files]="selectedFiles"
|
|
38
|
+
(action)="onFileAction($event)"
|
|
39
|
+
[previewType]="params.previewType"
|
|
40
|
+
[addButton]="!params.viewDragAndDrop"
|
|
41
|
+
></app-file-list>
|
|
42
|
+
</div>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//imagenes
|
|
2
|
+
|
|
3
|
+
.upload-container {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: var(--Size-3, 12px);
|
|
7
|
+
width: 100%;
|
|
8
|
+
margin: var(--Size-3, 12px);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.upload-header {
|
|
12
|
+
gap: var(--Size-1);
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: flex-start;
|
|
16
|
+
align-self: stretch;
|
|
17
|
+
|
|
18
|
+
.text {
|
|
19
|
+
color: var(--Gray-Gray-600, #475066);
|
|
20
|
+
font-size: var(--font-size-xs);
|
|
21
|
+
font-style: normal;
|
|
22
|
+
line-height: 150%;
|
|
23
|
+
}
|
|
24
|
+
.title {
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.label {
|
|
29
|
+
font-weight: 400;
|
|
30
|
+
}
|
|
31
|
+
}
|