@dropi/ui-components 1.0.12 → 1.0.13
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/README.md +55 -36
- package/dist/README.md +58 -38
- package/dist/components-source/accordion/accordion-item/accordion-item.component.d.ts +31 -0
- package/dist/components-source/accordion/accordion.component.d.ts +26 -0
- package/dist/components-source/alert/alert.component.d.ts +32 -0
- package/dist/components-source/alert-modal/alert-modal.component.d.ts +78 -0
- package/dist/components-source/alert-validation/alert-validation.component.d.ts +21 -0
- package/dist/components-source/badge/badge.component.d.ts +12 -0
- package/dist/components-source/beta-tag/beta-tag.component.d.ts +5 -0
- package/dist/components-source/breadcrumb/breadcrumb.component.d.ts +11 -0
- package/dist/components-source/card-product/card-product.component.d.ts +204 -0
- package/dist/components-source/card-section/card-section.component.d.ts +31 -0
- package/dist/components-source/checkbox-selection-list/checkbox-selection-list.component.d.ts +26 -0
- package/dist/components-source/city-selector/city-selector.component.d.ts +17 -0
- package/dist/components-source/color-picker/color-picker.component.d.ts +73 -0
- package/dist/components-source/confirm-dialog/confirm-dialog.component.d.ts +10 -0
- package/dist/components-source/country-flags/country-flags.component.d.ts +12 -0
- package/dist/components-source/date-picker/date-picker.component.d.ts +27 -0
- package/dist/components-source/date-picker-range/date-picker-range.component.d.ts +26 -0
- package/dist/components-source/dropi-avatars/dropi-avatars.component.d.ts +11 -0
- package/dist/components-source/dropi-badge/dropi-badge.component.d.ts +29 -0
- package/dist/components-source/dropi-banner-external/dropi-banner-external.component.d.ts +19 -0
- package/dist/components-source/dropi-breadcrumb/dropi-breadcrumb.component.d.ts +22 -0
- package/dist/components-source/dropi-card-checkbox/dropi-card-checkbox.component.d.ts +20 -0
- package/dist/components-source/dropi-carousel/dropi-carousel.component.d.ts +52 -0
- package/dist/components-source/dropi-checkbox/dropi-checkbox.component.d.ts +11 -0
- package/dist/components-source/dropi-chips/dropi-chips.component.d.ts +17 -0
- package/dist/components-source/dropi-country-selector/countries.data.d.ts +6 -0
- package/dist/components-source/dropi-country-selector/dropi-country-selector.component.d.ts +90 -0
- package/dist/components-source/dropi-drawer/dropi-drawer.component.d.ts +20 -0
- package/dist/components-source/dropi-dropdown/dropi-dropdown.component.d.ts +20 -0
- package/dist/components-source/dropi-favorite-button/dropi-favorite-button.component.d.ts +12 -0
- package/dist/components-source/dropi-file-upload/card-view/card-view.component.d.ts +19 -0
- package/dist/components-source/dropi-file-upload/drop-zone/drop-zone.component.d.ts +38 -0
- package/dist/components-source/dropi-file-upload/dropi-file-upload.component.d.ts +18 -0
- package/dist/components-source/dropi-file-upload/file-list/file-list.component.d.ts +39 -0
- package/dist/components-source/dropi-file-upload/grid-view/grid-view.component.d.ts +15 -0
- package/dist/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.d.ts +20 -0
- package/dist/components-source/dropi-image-overlay/dropi-image-overlay.component.d.ts +8 -0
- package/dist/components-source/dropi-languages-selector/dropi-languages-selector.component.d.ts +18 -0
- package/dist/components-source/dropi-logo/dropi-logo.component.d.ts +12 -0
- package/dist/components-source/dropi-modal/dropi-modal.component.d.ts +34 -0
- package/dist/components-source/dropi-modal/p-template.directive.d.ts +9 -0
- package/dist/components-source/dropi-navbar/dropi-navbar.component.d.ts +20 -0
- package/dist/components-source/dropi-paginator/dropi-paginator.component.d.ts +21 -0
- package/dist/components-source/dropi-phone-input/dropi-phone-input.component.d.ts +55 -0
- package/dist/components-source/dropi-radio-button/dropi-radio-button.component.d.ts +17 -0
- package/dist/components-source/dropi-search/dropi-search.component.d.ts +40 -0
- package/dist/components-source/dropi-select/dropi-select.component.d.ts +34 -0
- package/dist/components-source/dropi-skeleton/dropi-skeleton.component.d.ts +14 -0
- package/dist/components-source/dropi-steps/dropi-steps.component.d.ts +64 -0
- package/dist/components-source/dropi-switch/dropi-switch.component.d.ts +11 -0
- package/dist/components-source/dropi-table/dropi-table.component.d.ts +82 -0
- package/dist/components-source/dropi-tag/dropi-tag.component.d.ts +15 -0
- package/dist/components-source/dropi-text-area/dropi-text-area.component.d.ts +14 -0
- package/dist/components-source/dropi-tooltip/dropi-tooltip.component.d.ts +28 -0
- package/dist/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.component.d.ts +16 -0
- package/dist/components-source/empty/empty.component.d.ts +9 -0
- package/dist/components-source/empty-state/empty-state.component.d.ts +17 -0
- package/dist/components-source/file-upload-progress-bar/file-upload-progress-bar.component.d.ts +30 -0
- package/dist/components-source/index.d.ts +85 -0
- package/dist/components-source/input/input.component.d.ts +33 -0
- package/dist/components-source/lottie-loader/lottie-loader.component.d.ts +9 -0
- package/dist/components-source/otp-send-code/otp-send-code.component.d.ts +83 -0
- package/dist/components-source/radio-selection-list/radio-selection-list.component.d.ts +30 -0
- package/dist/components-source/read-more/read-more.component.d.ts +60 -0
- package/dist/components-source/sidebar/sidebar.component.d.ts +27 -0
- package/dist/components-source/simple-stepper/simple-stepper.component.d.ts +21 -0
- package/dist/components-source/spinner/spinner.component.d.ts +9 -0
- package/dist/components-source/tabs/tabs.component.d.ts +27 -0
- package/dist/components-source/tag-type-product/tag-type-product.component.d.ts +5 -0
- package/dist/components-source/toast/toast.component.d.ts +21 -0
- package/dist/components-source/toggle/input-toggle.component.d.ts +11 -0
- package/dist/components-source/tooltip/tooltip.component.d.ts +15 -0
- package/dist/components-source/vertical-steps/vertical-steps.component.d.ts +27 -0
- package/dist/esm2022/components-source/accordion/accordion-item/accordion-item.component.mjs +51 -0
- package/dist/esm2022/components-source/accordion/accordion.component.mjs +46 -0
- package/dist/esm2022/components-source/alert/alert.component.mjs +114 -0
- package/dist/esm2022/components-source/alert-modal/alert-modal.component.mjs +247 -0
- package/dist/esm2022/components-source/alert-validation/alert-validation.component.mjs +53 -0
- package/dist/esm2022/components-source/badge/badge.component.mjs +23 -0
- package/dist/esm2022/components-source/beta-tag/beta-tag.component.mjs +11 -0
- package/dist/esm2022/components-source/breadcrumb/breadcrumb.component.mjs +26 -0
- package/dist/esm2022/components-source/card-product/card-product.component.mjs +534 -0
- package/dist/esm2022/components-source/card-section/card-section.component.mjs +91 -0
- package/dist/esm2022/components-source/checkbox-selection-list/checkbox-selection-list.component.mjs +79 -0
- package/dist/esm2022/components-source/city-selector/city-selector.component.mjs +53 -0
- package/dist/esm2022/components-source/color-picker/color-picker.component.mjs +320 -0
- package/dist/esm2022/components-source/confirm-dialog/confirm-dialog.component.mjs +27 -0
- package/dist/esm2022/components-source/country-flags/country-flags.component.mjs +27 -0
- package/dist/esm2022/components-source/date-picker/date-picker.component.mjs +73 -0
- package/dist/esm2022/components-source/date-picker-range/date-picker-range.component.mjs +67 -0
- package/dist/esm2022/components-source/dropi-avatars/dropi-avatars.component.mjs +31 -0
- package/dist/esm2022/components-source/dropi-badge/dropi-badge.component.mjs +45 -0
- package/dist/esm2022/components-source/dropi-banner-external/dropi-banner-external.component.mjs +39 -0
- package/dist/esm2022/components-source/dropi-breadcrumb/dropi-breadcrumb.component.mjs +45 -0
- package/dist/esm2022/components-source/dropi-card-checkbox/dropi-card-checkbox.component.mjs +53 -0
- package/dist/esm2022/components-source/dropi-carousel/dropi-carousel.component.mjs +243 -0
- package/dist/esm2022/components-source/dropi-checkbox/dropi-checkbox.component.mjs +31 -0
- package/dist/esm2022/components-source/dropi-chips/dropi-chips.component.mjs +38 -0
- package/dist/esm2022/components-source/dropi-country-selector/countries.data.mjs +254 -0
- package/dist/esm2022/components-source/dropi-country-selector/dropi-country-selector.component.mjs +183 -0
- package/dist/esm2022/components-source/dropi-drawer/dropi-drawer.component.mjs +69 -0
- package/dist/esm2022/components-source/dropi-dropdown/dropi-dropdown.component.mjs +59 -0
- package/dist/esm2022/components-source/dropi-favorite-button/dropi-favorite-button.component.mjs +33 -0
- package/dist/esm2022/components-source/dropi-file-upload/card-view/card-view.component.mjs +47 -0
- package/dist/esm2022/components-source/dropi-file-upload/drop-zone/drop-zone.component.mjs +115 -0
- package/dist/esm2022/components-source/dropi-file-upload/dropi-file-upload.component.mjs +66 -0
- package/dist/esm2022/components-source/dropi-file-upload/file-list/file-list.component.mjs +95 -0
- package/dist/esm2022/components-source/dropi-file-upload/grid-view/grid-view.component.mjs +37 -0
- package/dist/esm2022/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.mjs +59 -0
- package/dist/esm2022/components-source/dropi-image-overlay/dropi-image-overlay.component.mjs +31 -0
- package/dist/esm2022/components-source/dropi-languages-selector/dropi-languages-selector.component.mjs +38 -0
- package/dist/esm2022/components-source/dropi-logo/dropi-logo.component.mjs +27 -0
- package/dist/esm2022/components-source/dropi-modal/dropi-modal.component.mjs +92 -0
- package/dist/esm2022/components-source/dropi-modal/p-template.directive.mjs +22 -0
- package/dist/esm2022/components-source/dropi-navbar/dropi-navbar.component.mjs +51 -0
- package/dist/esm2022/components-source/dropi-paginator/dropi-paginator.component.mjs +89 -0
- package/dist/esm2022/components-source/dropi-phone-input/dropi-phone-input.component.mjs +155 -0
- package/dist/esm2022/components-source/dropi-radio-button/dropi-radio-button.component.mjs +48 -0
- package/dist/esm2022/components-source/dropi-search/dropi-search.component.mjs +104 -0
- package/dist/esm2022/components-source/dropi-select/dropi-select.component.mjs +96 -0
- package/dist/esm2022/components-source/dropi-skeleton/dropi-skeleton.component.mjs +39 -0
- package/dist/esm2022/components-source/dropi-steps/dropi-steps.component.mjs +97 -0
- package/dist/esm2022/components-source/dropi-switch/dropi-switch.component.mjs +22 -0
- package/dist/esm2022/components-source/dropi-table/dropi-table.component.mjs +333 -0
- package/dist/esm2022/components-source/dropi-tag/dropi-tag.component.mjs +36 -0
- package/dist/esm2022/components-source/dropi-text-area/dropi-text-area.component.mjs +53 -0
- package/dist/esm2022/components-source/dropi-tooltip/dropi-tooltip.component.mjs +78 -0
- package/dist/esm2022/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.component.mjs +46 -0
- package/dist/esm2022/components-source/empty/empty.component.mjs +18 -0
- package/dist/esm2022/components-source/empty-state/empty-state.component.mjs +62 -0
- package/dist/esm2022/components-source/file-upload-progress-bar/file-upload-progress-bar.component.mjs +91 -0
- package/dist/esm2022/components-source/index.mjs +107 -0
- package/dist/esm2022/components-source/input/input.component.mjs +104 -0
- package/dist/esm2022/components-source/lottie-loader/lottie-loader.component.mjs +25 -0
- package/dist/esm2022/components-source/otp-send-code/otp-send-code.component.mjs +201 -0
- package/dist/esm2022/components-source/radio-selection-list/radio-selection-list.component.mjs +89 -0
- package/dist/esm2022/components-source/read-more/read-more.component.mjs +91 -0
- package/dist/esm2022/components-source/sidebar/sidebar.component.mjs +88 -0
- package/dist/esm2022/components-source/simple-stepper/simple-stepper.component.mjs +60 -0
- package/dist/esm2022/components-source/spinner/spinner.component.mjs +19 -0
- package/dist/esm2022/components-source/tabs/tabs.component.mjs +83 -0
- package/dist/esm2022/components-source/tag-type-product/tag-type-product.component.mjs +11 -0
- package/dist/esm2022/components-source/toast/toast.component.mjs +47 -0
- package/dist/esm2022/components-source/toggle/input-toggle.component.mjs +36 -0
- package/dist/esm2022/components-source/tooltip/tooltip.component.mjs +34 -0
- package/dist/esm2022/components-source/vertical-steps/vertical-steps.component.mjs +75 -0
- package/dist/esm2022/lib/elements-registry.mjs +343 -2
- package/dist/esm2022/utilities/interfaces/ui/dropi-table.interface.mjs +2 -0
- package/dist/esm2022/utilities/interfaces/ui/input-interface.mjs +2 -0
- package/dist/esm2022/utilities/interfaces/ui/select-interface.mjs +2 -0
- package/dist/esm2022/utilities/interfaces/ui/selection-list-interface.mjs +2 -0
- package/dist/esm2022/utilities/interfaces/ui/upload.model.mjs +5 -0
- package/dist/fesm2022/dropi-ui-components.mjs +5913 -2
- package/dist/fesm2022/dropi-ui-components.mjs.map +1 -1
- package/dist/utilities/interfaces/ui/dropi-table.interface.d.ts +45 -0
- package/dist/utilities/interfaces/ui/input-interface.d.ts +33 -0
- package/dist/utilities/interfaces/ui/select-interface.d.ts +8 -0
- package/dist/utilities/interfaces/ui/selection-list-interface.d.ts +24 -0
- package/dist/utilities/interfaces/ui/upload.model.d.ts +30 -0
- package/package.json +18 -6
- package/src/components-source/alert/alert.component.ts +12 -129
- package/src/components-source/alert-modal/alert-modal.component.ts +84 -114
- package/src/components-source/alert-validation/alert-validation.component.html +8 -0
- package/src/components-source/alert-validation/alert-validation.component.scss +225 -0
- package/src/components-source/alert-validation/alert-validation.component.ts +43 -0
- package/src/components-source/beta-tag/beta-tag.component.html +1 -0
- package/src/components-source/beta-tag/beta-tag.component.scss +26 -0
- package/src/components-source/beta-tag/beta-tag.component.ts +11 -0
- package/src/components-source/breadcrumb/breadcrumb.component.html +13 -5
- package/src/components-source/breadcrumb/breadcrumb.component.scss +8 -1
- package/src/components-source/breadcrumb/breadcrumb.component.spec.ts +26 -26
- package/src/components-source/breadcrumb/breadcrumb.component.ts +10 -12
- package/src/components-source/card-product/card-product.component.spec.ts +9 -9
- package/src/components-source/card-product/card-product.component.stories.ts +2 -2
- package/src/components-source/card-product/card-product.component.ts +294 -818
- package/src/components-source/card-section/card-section.component.html +7 -7
- package/src/components-source/card-section/card-section.component.ts +41 -15
- package/src/components-source/checkbox-selection-list/checkbox-selection-list.component.ts +42 -179
- package/src/components-source/city-selector/city-selector.component.ts +37 -137
- package/src/components-source/confirm-dialog/confirm-dialog.component.html +26 -0
- package/src/components-source/confirm-dialog/confirm-dialog.component.scss +55 -0
- package/src/components-source/confirm-dialog/confirm-dialog.component.ts +22 -0
- package/src/components-source/country-flags/country-flags.component.ts +20 -12
- package/src/components-source/date-picker/date-picker.component.ts +32 -292
- package/src/components-source/date-picker-range/date-picker-range.component.html +15 -7
- package/src/components-source/date-picker-range/date-picker-range.component.ts +42 -235
- package/src/components-source/dropi-banner-external/dropi-banner-external.component.ts +24 -185
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.html +21 -21
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.spec.ts +9 -9
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.ts +41 -23
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.stories.ts +12 -12
- package/src/components-source/dropi-chips/dropi-chips.component.ts +22 -87
- package/src/components-source/dropi-country-selector/countries.data.ts +256 -236
- package/src/components-source/dropi-country-selector/dropi-country-selector.component.ts +37 -25
- package/src/components-source/dropi-drawer/dropi-drawer.component.ts +91 -78
- package/src/components-source/dropi-dropdown/dropi-dropdown.component.ts +44 -47
- package/src/components-source/dropi-file-upload/card-view/card-view.component.ts +33 -53
- package/src/components-source/dropi-file-upload/drop-zone/drop-zone.component.ts +52 -123
- package/src/components-source/dropi-file-upload/dropi-file-upload.component.ts +38 -294
- package/src/components-source/dropi-file-upload/file-list/file-list.component.ts +62 -43
- package/src/components-source/dropi-file-upload/grid-view/grid-view.component.ts +23 -22
- package/src/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.scss +6 -2
- package/src/components-source/dropi-image-overlay/dropi-image-overlay.component.ts +16 -71
- package/src/components-source/dropi-modal/dropi-modal.component.ts +56 -372
- package/src/components-source/dropi-navbar/dropi-navbar.component.ts +17 -17
- package/src/components-source/dropi-paginator/dropi-paginator.component.html +18 -7
- package/src/components-source/dropi-paginator/dropi-paginator.component.ts +40 -32
- package/src/components-source/dropi-phone-input/dropi-phone-input.component.html +78 -79
- package/src/components-source/dropi-phone-input/dropi-phone-input.component.ts +29 -85
- package/src/components-source/dropi-search/dropi-search.component.ts +59 -222
- package/src/components-source/dropi-select/dropi-select.component.html +82 -131
- package/src/components-source/dropi-select/dropi-select.component.ts +60 -423
- package/src/components-source/dropi-table/dropi-table.component.html +40 -23
- package/src/components-source/dropi-table/dropi-table.component.ts +130 -374
- package/src/components-source/dropi-tag/dropi-tag.component.ts +20 -90
- package/src/components-source/dropi-text-area/dropi-text-area.component.ts +22 -48
- package/src/components-source/dropi-tooltip/dropi-tooltip.component.ts +40 -129
- package/src/components-source/empty/empty.component.html +3 -0
- package/src/components-source/empty/empty.component.scss +0 -0
- package/src/components-source/empty/empty.component.ts +16 -0
- package/src/components-source/empty-state/empty-state.component.ts +47 -19
- package/src/components-source/index.ts +82 -37
- package/src/components-source/input/input.component.html +79 -63
- package/src/components-source/input/input.component.ts +51 -97
- package/src/components-source/lottie-loader/lottie-loader.component.ts +13 -16
- package/src/components-source/otp-send-code/otp-send-code.component.ts +60 -528
- package/src/components-source/radio-selection-list/radio-selection-list.component.ts +36 -97
- package/src/components-source/sidebar/sidebar.component.spec.ts +11 -11
- package/src/components-source/sidebar/sidebar.component.stories.ts +3 -3
- package/src/components-source/sidebar/sidebar.component.ts +51 -47
- package/src/components-source/simple-stepper/simple-stepper.component.ts +20 -35
- package/src/components-source/spinner/spinner.component.html +6 -0
- package/src/components-source/spinner/spinner.component.scss +15 -0
- package/src/components-source/spinner/spinner.component.ts +17 -0
- package/src/components-source/tabs/tabs.component.spec.ts +8 -8
- package/src/components-source/tabs/tabs.component.stories.ts +5 -5
- package/src/components-source/tabs/tabs.component.ts +41 -83
- package/src/components-source/toast/toast.component.ts +40 -46
- package/src/components-source/toggle/input-toggle.component.html +34 -0
- package/src/components-source/toggle/input-toggle.component.scss +0 -0
- package/src/components-source/toggle/input-toggle.component.ts +27 -0
- package/src/components-source/toggle/inputToggleConfig.ts +11 -0
- package/src/components-source/tooltip/tooltip.component.html +22 -11
- package/src/components-source/tooltip/tooltip.component.ts +28 -13
- package/src/components-source/vertical-steps/vertical-steps.component.ts +16 -78
- package/src/lib/elements-registry.ts +413 -1
- package/src/lib/router-stub.ts +7 -0
- package/src/libreria work space.code-workspace +11 -8
- package/src/utilities/interfaces/ui/dropi-table.interface.ts +60 -0
- package/src/utilities/interfaces/ui/input-interface.ts +34 -0
- package/src/utilities/interfaces/ui/select-interface.ts +8 -0
- package/src/utilities/interfaces/ui/selection-list-interface.ts +15 -0
- package/src/utilities/interfaces/ui/upload.model.ts +41 -0
|
@@ -1,93 +1,92 @@
|
|
|
1
|
-
<div class="
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
bindLabel="country"
|
|
12
|
-
[searchable]="true"
|
|
13
|
-
[multiple]="false"
|
|
14
|
-
class="ng-selected selectcountry"
|
|
15
|
-
[ngClass]="{
|
|
16
|
-
'is-invalid-country': isValidPhone === false
|
|
17
|
-
}"
|
|
1
|
+
<div class="dropi-input-phone" [ngClass]="{ disabled: disabled }">
|
|
2
|
+
<label
|
|
3
|
+
class="dropi-input-phone__label Label-S-SemiBold"
|
|
4
|
+
*ngIf="selectProperties?.label"
|
|
5
|
+
>
|
|
6
|
+
{{ selectProperties.label | translate }}
|
|
7
|
+
<span
|
|
8
|
+
*ngIf="selectProperties.showObligatory"
|
|
9
|
+
class="dropi-input-phone__obligatory"
|
|
10
|
+
>*</span
|
|
18
11
|
>
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
</label>
|
|
13
|
+
|
|
14
|
+
<div class="dropi-input-phone__container-select">
|
|
15
|
+
<!-- Selector de país -->
|
|
16
|
+
<div
|
|
17
|
+
class="dropi-input-phone__select"
|
|
18
|
+
[ngClass]="{ 'is-expanded': isExpanded, disabled: disabled }"
|
|
19
|
+
(click)="showOptions()"
|
|
20
|
+
>
|
|
21
|
+
<div class="dropi-input-phone__selected">
|
|
22
|
+
<div class="dropi-input-phone__flag-container" *ngIf="selectedOption">
|
|
21
23
|
<img
|
|
22
|
-
[src]="
|
|
23
|
-
[alt]="
|
|
24
|
+
[src]="selectedOption.flag"
|
|
25
|
+
[alt]="selectedOption.name"
|
|
26
|
+
class="dropi-input-phone__flag"
|
|
24
27
|
/>
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<i class="fa fa-chevron-down"></i>
|
|
29
|
-
</div>
|
|
30
|
-
</ng-template>
|
|
28
|
+
<span class="dropi-input-phone__code Body-M-Medium"
|
|
29
|
+
>+{{ selectedOption.code }}</span
|
|
30
|
+
>
|
|
31
31
|
</div>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
<div class="dropi-input-phone__placeholder" *ngIf="!selectedOption">
|
|
33
|
+
{{ selectProperties?.placeholder || "Seleccionar" | translate }}
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
35
36
|
|
|
36
|
-
<div class="custom-select">
|
|
37
|
-
<button
|
|
38
|
-
type="button"
|
|
39
|
-
class="select-button"
|
|
40
|
-
[disabled]="disabled || disabledInput"
|
|
41
|
-
[ngClass]="{
|
|
42
|
-
'select-completed': !!selectedOption,
|
|
43
|
-
'select-invalid': hasError
|
|
44
|
-
}"
|
|
45
|
-
(click)="showOptions()"
|
|
46
|
-
>
|
|
47
|
-
<span *ngIf="selectedOption" style="display: flex; gap: 0.5rem">
|
|
48
|
-
<img [src]="'https://flagsapi.com/' + selectedOption.flag + '/flat/24.png'" alt="flag" />
|
|
49
|
-
{{ selectedOption.code }}
|
|
50
|
-
</span>
|
|
51
37
|
<app-icon
|
|
52
38
|
[name]="isExpanded ? 'Dropdown-up' : 'Dropdown-down'"
|
|
53
|
-
width="
|
|
54
|
-
height="
|
|
39
|
+
width="24px"
|
|
40
|
+
height="24px"
|
|
55
41
|
color="Gray-Gray-500"
|
|
56
42
|
></app-icon>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
class="
|
|
63
|
-
|
|
64
|
-
|
|
43
|
+
|
|
44
|
+
<!-- Lista de opciones desplegable -->
|
|
45
|
+
<div class="dropi-input-phone__options" *ngIf="isExpanded">
|
|
46
|
+
<div
|
|
47
|
+
*ngFor="let option of countries"
|
|
48
|
+
class="dropi-input-phone__option"
|
|
49
|
+
[ngClass]="{ selected: selectedOption?.code === option.code }"
|
|
50
|
+
(click)="cambioCod(option); $event.stopPropagation()"
|
|
65
51
|
>
|
|
66
|
-
<img
|
|
52
|
+
<img
|
|
53
|
+
[src]="option.flag"
|
|
54
|
+
[alt]="option.name"
|
|
55
|
+
class="dropi-input-phone__flag"
|
|
56
|
+
/>
|
|
57
|
+
<span class="dropi-input-phone__option-name Body-M-Regular">{{
|
|
58
|
+
option.name
|
|
59
|
+
}}</span>
|
|
60
|
+
<span class="dropi-input-phone__option-code Body-M-Regular"
|
|
61
|
+
>(+{{ option.code }})</span
|
|
62
|
+
>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
<!-- Input de número de teléfono -->
|
|
68
|
+
<div class="dropi-input-phone__input-container">
|
|
69
|
+
<input
|
|
70
|
+
type="text"
|
|
71
|
+
class="dropi-input-phone__input Body-M-Regular"
|
|
72
|
+
[ngClass]="{
|
|
73
|
+
'is-invalid': isValidPhone === false || hasError,
|
|
74
|
+
}"
|
|
75
|
+
[(ngModel)]="ngModelPhone"
|
|
76
|
+
(input)="cambioPhone()"
|
|
77
|
+
(keyup)="cambioPhone($event)"
|
|
78
|
+
(change)="cambioPhone()"
|
|
79
|
+
[placeholder]="phoneNumberPlaceholder"
|
|
80
|
+
(paste)="handlePaste($event)"
|
|
81
|
+
[maxlength]="maxLengthPhone"
|
|
82
|
+
[disabled]="disabledInput"
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
72
85
|
</div>
|
|
73
86
|
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
appNumericInput
|
|
80
|
-
[ngClass]="{
|
|
81
|
-
'is-invalid': isValidPhone === false || hasError
|
|
82
|
-
}"
|
|
83
|
-
[(ngModel)]="ngModelPhone"
|
|
84
|
-
(input)="cambioPhone()"
|
|
85
|
-
(keyup)="cambioPhone($event)"
|
|
86
|
-
(change)="cambioPhone()"
|
|
87
|
-
[placeholder]="phoneNumberPlaceholder"
|
|
88
|
-
(paste)="handlePaste($event)"
|
|
89
|
-
[maxlength]="maxLengthPhone"
|
|
90
|
-
data-cy="phone-input"
|
|
91
|
-
[disabled]="disabledInput"
|
|
92
|
-
/>
|
|
87
|
+
<span
|
|
88
|
+
class="dropi-input-phone__helper Label-S-Regular"
|
|
89
|
+
*ngIf="selectProperties?.textHelper"
|
|
90
|
+
>{{ selectProperties.textHelper | translate }}</span
|
|
91
|
+
>
|
|
93
92
|
</div>
|
|
@@ -7,18 +7,12 @@ import {
|
|
|
7
7
|
EventEmitter,
|
|
8
8
|
ElementRef,
|
|
9
9
|
HostListener,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
17
|
-
import { NumericInputDirective } from './numeric-input.directive';
|
|
18
|
-
import { NgClass, NgFor, CommonModule } from '@angular/common';
|
|
19
|
-
import { FormsModule, FormControl } from '@angular/forms';
|
|
20
|
-
import { NgSelectModule } from '@ng-select/ng-select';
|
|
21
|
-
import { IconComponent } from '../icon/icon.component';
|
|
10
|
+
Inject,
|
|
11
|
+
CUSTOM_ELEMENTS_SCHEMA,
|
|
12
|
+
} from "@angular/core";
|
|
13
|
+
import { CommonModule } from "@angular/common";
|
|
14
|
+
import { FormsModule, FormControl } from "@angular/forms";
|
|
15
|
+
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
|
22
16
|
|
|
23
17
|
interface Country {
|
|
24
18
|
code: string;
|
|
@@ -36,28 +30,18 @@ interface SelectProperties {
|
|
|
36
30
|
}
|
|
37
31
|
|
|
38
32
|
@Component({
|
|
39
|
-
selector:
|
|
40
|
-
templateUrl:
|
|
41
|
-
styleUrls: [
|
|
33
|
+
selector: "app-dropi-phone-input",
|
|
34
|
+
templateUrl: "./dropi-phone-input.component.html",
|
|
35
|
+
styleUrls: ["./dropi-phone-input.component.scss"],
|
|
42
36
|
encapsulation: ViewEncapsulation.None,
|
|
43
37
|
standalone: true,
|
|
44
|
-
imports: [
|
|
45
|
-
|
|
46
|
-
NgSelectModule,
|
|
47
|
-
FormsModule,
|
|
48
|
-
NgClass,
|
|
49
|
-
NgFor,
|
|
50
|
-
NumericInputDirective,
|
|
51
|
-
TranslateModule,
|
|
52
|
-
IconComponent,
|
|
53
|
-
],
|
|
38
|
+
imports: [CommonModule, FormsModule, TranslateModule],
|
|
39
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
54
40
|
})
|
|
55
41
|
export class DropiPhoneInputComponent implements OnInit {
|
|
56
42
|
private _CodArea!: string;
|
|
57
43
|
@Input() set CodArea(value: any) {
|
|
58
44
|
this._CodArea = value;
|
|
59
|
-
|
|
60
|
-
// Si ya tienes la lista de países cargada:
|
|
61
45
|
if (this.countries && Array.isArray(this.countries)) {
|
|
62
46
|
const match = this.countries.find((c) => c.code === value);
|
|
63
47
|
if (match) {
|
|
@@ -69,21 +53,13 @@ export class DropiPhoneInputComponent implements OnInit {
|
|
|
69
53
|
return this._CodArea;
|
|
70
54
|
}
|
|
71
55
|
|
|
72
|
-
@Input() ngModelPhone =
|
|
56
|
+
@Input() ngModelPhone = "";
|
|
73
57
|
@Input() phoneNumberPlaceholder: string = null;
|
|
74
58
|
@Input() isValidPhone = undefined;
|
|
75
59
|
@Input() public selectedOption: Country;
|
|
76
60
|
@Input() public selectProperties: SelectProperties;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Establece si el campo del teléfono debe ser verificado al inicializar el componente.
|
|
80
|
-
* @default true
|
|
81
|
-
*/
|
|
82
61
|
@Input() validateOnInit = true;
|
|
83
62
|
@Input() disabledInput = false;
|
|
84
|
-
/**
|
|
85
|
-
* FormControl opcional para validación y mostrar errores
|
|
86
|
-
*/
|
|
87
63
|
@Input() public formControl: FormControl;
|
|
88
64
|
|
|
89
65
|
@Output() ngModelChangeCod = new EventEmitter();
|
|
@@ -92,21 +68,18 @@ export class DropiPhoneInputComponent implements OnInit {
|
|
|
92
68
|
@Output() onChangeSelect: EventEmitter<Country> = new EventEmitter();
|
|
93
69
|
|
|
94
70
|
maxLengthPhone = 10;
|
|
95
|
-
countries: Country[] =
|
|
71
|
+
countries: Country[] = [];
|
|
96
72
|
disabled: any;
|
|
97
|
-
isExpanded: boolean;
|
|
73
|
+
isExpanded: boolean = false;
|
|
98
74
|
|
|
99
75
|
constructor(
|
|
100
76
|
private elementRef: ElementRef,
|
|
101
|
-
public userService:
|
|
102
|
-
public settingsService:
|
|
103
|
-
public apiService:
|
|
77
|
+
@Inject("UserService") public userService: any,
|
|
78
|
+
@Inject("SettingsService") public settingsService: any,
|
|
79
|
+
@Inject("ApiService") public apiService: any,
|
|
104
80
|
private readonly translateService: TranslateService,
|
|
105
81
|
) {}
|
|
106
82
|
|
|
107
|
-
/**
|
|
108
|
-
* Verifica si el formControl tiene errores y está dirty/touched
|
|
109
|
-
*/
|
|
110
83
|
get hasError(): boolean {
|
|
111
84
|
return (
|
|
112
85
|
this.formControl &&
|
|
@@ -117,23 +90,21 @@ export class DropiPhoneInputComponent implements OnInit {
|
|
|
117
90
|
|
|
118
91
|
ngOnInit(): void {
|
|
119
92
|
if (this.validateOnInit) this.validtaeLengthPhone();
|
|
120
|
-
|
|
121
93
|
if (!this.phoneNumberPlaceholder)
|
|
122
|
-
this.phoneNumberPlaceholder =
|
|
94
|
+
this.phoneNumberPlaceholder =
|
|
95
|
+
this.translateService.instant("Enter phone number");
|
|
123
96
|
}
|
|
124
97
|
|
|
125
98
|
cambioCod(option): void {
|
|
126
99
|
this.isExpanded = false;
|
|
127
100
|
this.selectedOption = option;
|
|
128
|
-
this.ngModelPhone =
|
|
101
|
+
this.ngModelPhone = "";
|
|
129
102
|
this.ngModelChangeCod.emit(option.code);
|
|
130
103
|
this.validtaeLengthPhone();
|
|
131
104
|
}
|
|
132
105
|
|
|
133
106
|
cambioPhone(event?: KeyboardEvent): void {
|
|
134
|
-
if (this.ngModelPhone?.length === 0 && event?.key ===
|
|
135
|
-
if (this.ngModelPhone === '' && event) this.ngModelPhone = event?.key;
|
|
136
|
-
|
|
107
|
+
if (this.ngModelPhone?.length === 0 && event?.key === "Backspace") return;
|
|
137
108
|
this.ngModelChangePhone.emit(this.ngModelPhone);
|
|
138
109
|
this.validtaeLengthPhone();
|
|
139
110
|
}
|
|
@@ -142,25 +113,12 @@ export class DropiPhoneInputComponent implements OnInit {
|
|
|
142
113
|
const country = this.countries.find((c) => c.code === this.CodArea);
|
|
143
114
|
if (country) {
|
|
144
115
|
this.maxLengthPhone = country.maxLength;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const phoneLength = this.ngModelPhone?.length || 0;
|
|
149
|
-
if (phoneLength === 9 || phoneLength === 10) {
|
|
150
|
-
this.isValidPhone = true;
|
|
151
|
-
this.verifiedField.emit(true);
|
|
152
|
-
} else {
|
|
153
|
-
this.isValidPhone = false;
|
|
154
|
-
this.verifiedField.emit(false);
|
|
155
|
-
}
|
|
116
|
+
if (this.ngModelPhone?.length === this.maxLengthPhone) {
|
|
117
|
+
this.isValidPhone = true;
|
|
118
|
+
this.verifiedField.emit(true);
|
|
156
119
|
} else {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
this.verifiedField.emit(true);
|
|
160
|
-
} else {
|
|
161
|
-
this.isValidPhone = false;
|
|
162
|
-
this.verifiedField.emit(false);
|
|
163
|
-
}
|
|
120
|
+
this.isValidPhone = false;
|
|
121
|
+
this.verifiedField.emit(false);
|
|
164
122
|
}
|
|
165
123
|
} else {
|
|
166
124
|
this.isValidPhone = false;
|
|
@@ -169,13 +127,13 @@ export class DropiPhoneInputComponent implements OnInit {
|
|
|
169
127
|
|
|
170
128
|
handlePaste(event: ClipboardEvent): void {
|
|
171
129
|
event.preventDefault();
|
|
172
|
-
const pastedText = event.clipboardData?.getData(
|
|
173
|
-
const sanitizedText = pastedText.replace(/\D+/g,
|
|
130
|
+
const pastedText = event.clipboardData?.getData("text") || "";
|
|
131
|
+
const sanitizedText = pastedText.replace(/\D+/g, "");
|
|
174
132
|
this.ngModelPhone = sanitizedText;
|
|
175
133
|
this.cambioPhone();
|
|
176
134
|
}
|
|
177
135
|
|
|
178
|
-
@HostListener(
|
|
136
|
+
@HostListener("document:click", ["$event"])
|
|
179
137
|
closeDropdown(event?: MouseEvent): void {
|
|
180
138
|
if (event && !this.elementRef.nativeElement.contains(event.target)) {
|
|
181
139
|
this.isExpanded = false;
|
|
@@ -186,18 +144,4 @@ export class DropiPhoneInputComponent implements OnInit {
|
|
|
186
144
|
if (this.disabled) return;
|
|
187
145
|
this.isExpanded = !this.isExpanded;
|
|
188
146
|
}
|
|
189
|
-
|
|
190
|
-
setPropertyById(code: string) {
|
|
191
|
-
this.selectedOption = this.selectProperties.options.find(
|
|
192
|
-
(propertie) => propertie.code === code,
|
|
193
|
-
);
|
|
194
|
-
this.onChangeSelect.emit(this.selectedOption);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
setPropertyByLabel(name: string) {
|
|
198
|
-
this.selectedOption = this.selectProperties.options.find(
|
|
199
|
-
(propertie) => propertie.name === name,
|
|
200
|
-
);
|
|
201
|
-
this.onChangeSelect.emit(this.selectedOption);
|
|
202
|
-
}
|
|
203
147
|
}
|