@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,48 @@
|
|
|
1
|
-
import { CommonModule } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { CommonModule } from "@angular/common";
|
|
2
|
+
import {
|
|
3
|
+
Component,
|
|
4
|
+
EventEmitter,
|
|
5
|
+
Input,
|
|
6
|
+
OnDestroy,
|
|
7
|
+
OnInit,
|
|
8
|
+
Output,
|
|
9
|
+
Inject,
|
|
10
|
+
} from "@angular/core";
|
|
11
|
+
import { Subscription } from "rxjs";
|
|
12
|
+
import { TranslateModule } from "@ngx-translate/core";
|
|
13
|
+
import { DropiBadgeComponent } from "../dropi-badge/dropi-badge.component";
|
|
14
|
+
|
|
15
|
+
export interface TabProperties {
|
|
16
|
+
id: number;
|
|
17
|
+
label: string;
|
|
18
|
+
route: string;
|
|
19
|
+
completed?: boolean;
|
|
20
|
+
counter?: number;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}
|
|
9
23
|
|
|
10
24
|
@Component({
|
|
11
|
-
selector:
|
|
12
|
-
templateUrl:
|
|
13
|
-
styleUrls: [
|
|
25
|
+
selector: "app-tabs",
|
|
26
|
+
templateUrl: "./tabs.component.html",
|
|
27
|
+
styleUrls: ["./tabs.component.scss"],
|
|
14
28
|
standalone: true,
|
|
15
|
-
imports: [CommonModule,
|
|
29
|
+
imports: [CommonModule, TranslateModule, DropiBadgeComponent],
|
|
16
30
|
})
|
|
17
31
|
export class TabsComponent implements OnInit, OnDestroy {
|
|
18
|
-
/**
|
|
19
|
-
* Define las propiedades y la cantidad de tabs a renderizar.
|
|
20
|
-
*
|
|
21
|
-
* Cada opción dentro del arreglo debe contener las siguientes propiedades:
|
|
22
|
-
* - `id`: Identificador único del tab.
|
|
23
|
-
* - `label`: Texto a mostrar en la pestaña.
|
|
24
|
-
* - `route`: Ruta a la que se redirige al hacer clic.
|
|
25
|
-
* - `completed`: Indica si se debe mostrar el icono de completado.
|
|
26
|
-
* - `counter`: Muestra un contador al lado de la pestaña (Opcional).
|
|
27
|
-
*
|
|
28
|
-
* @type {TabProperties[]}
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
32
|
@Input() public configuration: TabProperties[] = [];
|
|
32
|
-
/**
|
|
33
|
-
* Indica si se debe mostrar el icono de completado en la pestaña.
|
|
34
|
-
*
|
|
35
|
-
* Valor por defecto: `false`.
|
|
36
|
-
*
|
|
37
|
-
* @type {boolean}
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
33
|
@Input() public showIcon: boolean = false;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
* Evento emitido cuando se selecciona una opción.
|
|
44
|
-
*
|
|
45
|
-
* Al emitirse, se envían las propiedades de la pestaña seleccionada.
|
|
46
|
-
*
|
|
47
|
-
* @type {EventEmitter<TabProperties>}
|
|
48
|
-
*/
|
|
49
|
-
@Output() public onIndexChanged: EventEmitter<TabProperties> = new EventEmitter<TabProperties>();
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Indica el valor de la pestaña activa actualmente.
|
|
53
|
-
*
|
|
54
|
-
* Representa el identificador de la pestaña seleccionada y activa.
|
|
55
|
-
*
|
|
56
|
-
* @type {number}
|
|
57
|
-
*/
|
|
34
|
+
@Output() public onIndexChanged: EventEmitter<TabProperties> =
|
|
35
|
+
new EventEmitter<TabProperties>();
|
|
58
36
|
@Input() public activeTab: number = 0;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Bloquea el cambio de ruta y activa restricciones
|
|
62
|
-
*
|
|
63
|
-
* Cuando es `true`, evita la navegación entre pestañas y permite incorporar:
|
|
64
|
-
* - Alertas de confirmación antes de cambiar de ruta
|
|
65
|
-
* - Bloqueo de acciones hasta que se cumplan condiciones específicas
|
|
66
|
-
* - Validaciones adicionales antes de permitir el cambio de pestaña
|
|
67
|
-
*
|
|
68
|
-
* Útil para flujos críticos donde se requiere confirmación del usuario
|
|
69
|
-
* o validación de datos antes de permitir la navegación.
|
|
70
|
-
*
|
|
71
|
-
* @default false
|
|
72
|
-
* @type {boolean}
|
|
73
|
-
*/
|
|
74
37
|
@Input() public stopAction: boolean = false;
|
|
75
38
|
|
|
76
|
-
/**
|
|
77
|
-
* Subscripciones activas durante el flujo
|
|
78
|
-
*
|
|
79
|
-
* Almacena las subscripciones activas para despues eliminarlas en el ciclo de vida
|
|
80
|
-
*
|
|
81
|
-
* @type {Subscription}
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
39
|
private readonly subscriptions: Subscription = new Subscription();
|
|
85
40
|
|
|
86
|
-
constructor(private readonly router:
|
|
41
|
+
constructor(@Inject("Router") private readonly router: any) {}
|
|
87
42
|
|
|
88
43
|
ngOnInit(): void {
|
|
89
44
|
if (this.configuration.find((tab) => tab.route)) {
|
|
90
|
-
this.setActiveTabByRoute(this.router
|
|
45
|
+
this.setActiveTabByRoute(this.router?.url || "");
|
|
91
46
|
this.validateUrlChange();
|
|
92
47
|
}
|
|
93
48
|
}
|
|
@@ -97,9 +52,10 @@ export class TabsComponent implements OnInit, OnDestroy {
|
|
|
97
52
|
}
|
|
98
53
|
|
|
99
54
|
validateUrlChange() {
|
|
55
|
+
if (!this.router?.events) return;
|
|
100
56
|
this.subscriptions.add(
|
|
101
|
-
this.router.events.subscribe((event) => {
|
|
102
|
-
if (event
|
|
57
|
+
this.router.events.subscribe((event: any) => {
|
|
58
|
+
if (event && event.constructor.name === "NavigationEnd") {
|
|
103
59
|
this.setActiveTabByRoute(event.url);
|
|
104
60
|
}
|
|
105
61
|
}),
|
|
@@ -107,18 +63,20 @@ export class TabsComponent implements OnInit, OnDestroy {
|
|
|
107
63
|
}
|
|
108
64
|
|
|
109
65
|
setActiveTabByRoute(route: string) {
|
|
110
|
-
|
|
111
|
-
|
|
66
|
+
if (!route) return;
|
|
67
|
+
const activeTabArr = (this.configuration as any[]).find(
|
|
68
|
+
(tab) => tab.route && route.includes(tab.route),
|
|
69
|
+
);
|
|
70
|
+
this.activeTab = activeTabArr ? activeTabArr.id : 0;
|
|
112
71
|
}
|
|
113
72
|
|
|
114
|
-
///dashboard/settings/personal-data?section=invoice
|
|
115
73
|
onTabClick(tabClicked: TabProperties) {
|
|
74
|
+
if (tabClicked.disabled) return;
|
|
116
75
|
this.onIndexChanged.emit(tabClicked);
|
|
117
76
|
|
|
118
|
-
if (!this.stopAction) {
|
|
77
|
+
if (!this.stopAction && this.router) {
|
|
119
78
|
if (tabClicked.route) {
|
|
120
|
-
|
|
121
|
-
let [path, query] = tabClicked.route.split('?');
|
|
79
|
+
let [path, query] = tabClicked.route.split("?");
|
|
122
80
|
const queryParams = new URLSearchParams(query);
|
|
123
81
|
|
|
124
82
|
const paramsObj: any = {};
|
|
@@ -1,59 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
Input,
|
|
4
|
+
Inject,
|
|
5
|
+
CUSTOM_ELEMENTS_SCHEMA,
|
|
6
|
+
OnInit,
|
|
7
|
+
} from "@angular/core";
|
|
8
|
+
import { CommonModule } from "@angular/common";
|
|
9
|
+
import { TranslateModule } from "@ngx-translate/core";
|
|
10
|
+
|
|
11
|
+
export interface ToastProps {
|
|
12
|
+
message?: string;
|
|
13
|
+
type?: "success" | "error" | "info" | "warning";
|
|
14
|
+
show?: boolean;
|
|
15
|
+
severity?: string; // Añadido
|
|
16
|
+
}
|
|
10
17
|
|
|
11
18
|
@Component({
|
|
12
|
-
selector:
|
|
13
|
-
templateUrl: './toast.component.html',
|
|
14
|
-
styleUrls: ['./toast.component.scss'],
|
|
19
|
+
selector: "app-toast",
|
|
15
20
|
standalone: true,
|
|
16
|
-
imports: [CommonModule,
|
|
21
|
+
imports: [CommonModule, TranslateModule],
|
|
17
22
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
23
|
+
templateUrl: "./toast.component.html",
|
|
24
|
+
styleUrls: ["./toast.component.scss"],
|
|
18
25
|
})
|
|
19
26
|
export class ToastComponent implements OnInit {
|
|
20
|
-
@Input()
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
brandIsDropi: boolean;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
error: '/assets/lottie-files/failure.json',
|
|
27
|
+
@Input() public toastProperties: ToastProps;
|
|
28
|
+
|
|
29
|
+
// Restaurando propiedades requeridas por el template
|
|
30
|
+
public brandIsDropi: boolean = true;
|
|
31
|
+
public animations: any = {
|
|
32
|
+
success: "",
|
|
33
|
+
error: "",
|
|
34
|
+
info: "",
|
|
35
|
+
warning: "",
|
|
30
36
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
public icons: any = {
|
|
38
|
+
success: "",
|
|
39
|
+
error: "",
|
|
40
|
+
info: "",
|
|
41
|
+
warning: "",
|
|
42
|
+
};
|
|
43
|
+
public message: any = {
|
|
44
|
+
severity: "success",
|
|
37
45
|
};
|
|
38
46
|
|
|
39
47
|
constructor(
|
|
40
|
-
private readonly
|
|
41
|
-
|
|
42
|
-
private readonly settingsService: SettingsService,
|
|
48
|
+
@Inject("ToastService") private readonly toastService: any,
|
|
49
|
+
@Inject("SettingsService") public settingsService: any,
|
|
43
50
|
) {}
|
|
44
51
|
|
|
45
|
-
ngOnInit() {
|
|
46
|
-
this.brandName = this.settingsService.getBrand()?.name?.toLowerCase();
|
|
47
|
-
this.brandIsDropi = this.forceBrandIsDropi || this.brandName === 'dropi';
|
|
48
|
-
|
|
49
|
-
this.suscriptions.add(
|
|
50
|
-
this.toastService.toastOpen$.subscribe((props: ToastProps) => {
|
|
51
|
-
this.messageService.add(props);
|
|
52
|
-
}),
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
ngOnDestroy() {
|
|
57
|
-
this.suscriptions.unsubscribe();
|
|
58
|
-
}
|
|
52
|
+
ngOnInit(): void {}
|
|
59
53
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<ng-container *ngIf="config.param === 'toggle'">
|
|
2
|
+
<div class="form-check form-switch form-switch-md mb-3" dir="ltr">
|
|
3
|
+
<input
|
|
4
|
+
[attr.id]="elemnto"
|
|
5
|
+
(click)="emitValue()"
|
|
6
|
+
id="elemnto"
|
|
7
|
+
*ngIf="data"
|
|
8
|
+
class="form-check-input"
|
|
9
|
+
[attr.type]="config.type"
|
|
10
|
+
[(ngModel)]="data"
|
|
11
|
+
[formControl]="config.formControl"
|
|
12
|
+
[attr.active]="data"
|
|
13
|
+
[attr.formControlName]="config.name"
|
|
14
|
+
checked
|
|
15
|
+
/>
|
|
16
|
+
|
|
17
|
+
<input
|
|
18
|
+
(click)="emitValue()"
|
|
19
|
+
*ngIf="!data"
|
|
20
|
+
[attr.id]="elemnto"
|
|
21
|
+
id="elemnto"
|
|
22
|
+
class="form-check-input"
|
|
23
|
+
[attr.type]="config.type"
|
|
24
|
+
[(ngModel)]="data"
|
|
25
|
+
[formControl]="config.formControl"
|
|
26
|
+
[attr.active]="data"
|
|
27
|
+
[attr.formControlName]="config.name"
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
<label class="form-check-label" for="elemnto" (click)="emitValue()">
|
|
31
|
+
{{ config.labelText | translate }}</label
|
|
32
|
+
>
|
|
33
|
+
</div>
|
|
34
|
+
</ng-container>
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output, Inject } from "@angular/core";
|
|
2
|
+
import { CommonModule } from "@angular/common";
|
|
3
|
+
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
|
|
4
|
+
import { TranslateModule } from "@ngx-translate/core";
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: "app-input-toggle",
|
|
8
|
+
standalone: true,
|
|
9
|
+
imports: [CommonModule, FormsModule, ReactiveFormsModule, TranslateModule],
|
|
10
|
+
templateUrl: "./input-toggle.component.html",
|
|
11
|
+
styleUrls: ["./input-toggle.component.scss"],
|
|
12
|
+
})
|
|
13
|
+
export class InputToggleComponent {
|
|
14
|
+
@Input() data: boolean = false;
|
|
15
|
+
@Input() config: any = {
|
|
16
|
+
labelText: "",
|
|
17
|
+
formControl: null,
|
|
18
|
+
};
|
|
19
|
+
@Input() elemnto: string =
|
|
20
|
+
"toggle-" + Math.random().toString(36).substring(7);
|
|
21
|
+
@Output() dataChange = new EventEmitter<boolean>();
|
|
22
|
+
|
|
23
|
+
emitValue() {
|
|
24
|
+
this.data = !this.data;
|
|
25
|
+
this.dataChange.emit(this.data);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UntypedFormControl } from '@angular/forms';
|
|
2
|
+
|
|
3
|
+
export interface InputToggleConfig {
|
|
4
|
+
name: string;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
param: string;
|
|
7
|
+
type: string;
|
|
8
|
+
labelText: string;
|
|
9
|
+
formControl: UntypedFormControl;
|
|
10
|
+
formValidationMessages: Array<{ type: string; message: string }>;
|
|
11
|
+
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
<span
|
|
2
|
-
(click)="
|
|
3
|
-
(mouseenter)="
|
|
4
|
-
(mouseleave)="
|
|
2
|
+
(click)="isVisible = !isVisible"
|
|
3
|
+
(mouseenter)="isVisible = true"
|
|
4
|
+
(mouseleave)="isVisible = false"
|
|
5
5
|
class="icon-tooltip"
|
|
6
6
|
>
|
|
7
7
|
<ng-container *ngIf="!outlined; else tooltipOutlined">
|
|
8
|
-
<svg
|
|
8
|
+
<svg
|
|
9
|
+
width="14"
|
|
10
|
+
height="14"
|
|
11
|
+
viewBox="0 0 14 14"
|
|
12
|
+
fill="none"
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
>
|
|
9
15
|
<path
|
|
10
16
|
d="M6.99972 0.144531C5.64351 0.144531 4.31775 0.546696 3.1901 1.30017C2.06245 2.05364 1.18355 3.12458 0.66455 4.37756C0.145549 5.63054 0.00975496 7.00928 0.274339 8.33943C0.538924 9.66959 1.192 10.8914 2.15099 11.8504C3.10998 12.8094 4.33181 13.4625 5.66196 13.7271C6.99212 13.9916 8.37086 13.8558 9.62384 13.3368C10.8768 12.8178 11.9478 11.9389 12.7012 10.8113C13.4547 9.68364 13.8569 8.35789 13.8569 7.00167C13.8549 5.18365 13.1318 3.44065 11.8463 2.15511C10.5607 0.869576 8.81775 0.146498 6.99972 0.144531ZM6.99972 11.5731C6.8867 11.5731 6.77622 11.5396 6.68225 11.4768C6.58828 11.414 6.51504 11.3248 6.47179 11.2203C6.42854 11.1159 6.41722 11.001 6.43927 10.8902C6.46132 10.7793 6.51575 10.6775 6.59566 10.5976C6.67558 10.5177 6.7774 10.4633 6.88824 10.4412C6.99909 10.4192 7.11398 10.4305 7.2184 10.4737C7.32281 10.517 7.41206 10.5902 7.47485 10.6842C7.53764 10.7782 7.57115 10.8887 7.57115 11.0017C7.57115 11.1532 7.51095 11.2986 7.40378 11.4057C7.29662 11.5129 7.15127 11.5731 6.99972 11.5731ZM8.10258 7.29081C7.93395 7.39625 7.79605 7.54423 7.70276 7.71988C7.60947 7.89552 7.56408 8.09263 7.57115 8.29139V8.71596C7.57115 8.86751 7.51095 9.01285 7.40378 9.12002C7.29662 9.22718 7.15127 9.28739 6.99972 9.28739C6.84817 9.28739 6.70283 9.22718 6.59566 9.12002C6.4885 9.01285 6.42829 8.86751 6.42829 8.71596V8.29139C6.41985 7.8882 6.51947 7.4901 6.71682 7.13841C6.91417 6.78672 7.20205 6.49426 7.55058 6.29139C7.76171 6.1751 7.93066 5.99504 8.0333 5.77695C8.13593 5.55886 8.16698 5.3139 8.12201 5.0771C8.07748 4.8515 7.96672 4.6443 7.80386 4.48195C7.64101 4.31961 7.43346 4.20949 7.20772 4.16567C7.04299 4.13518 6.87357 4.14128 6.71146 4.18354C6.54935 4.22579 6.39851 4.30317 6.26962 4.4102C6.14073 4.51722 6.03695 4.65127 5.96562 4.80286C5.8943 4.95444 5.85717 5.11986 5.85686 5.28739C5.85686 5.43894 5.79666 5.58428 5.6895 5.69145C5.58233 5.79861 5.43699 5.85882 5.28544 5.85882C5.13388 5.85882 4.98854 5.79861 4.88138 5.69145C4.77421 5.58428 4.71401 5.43894 4.71401 5.28739C4.71415 4.88425 4.82091 4.48832 5.02347 4.13976C5.22602 3.7912 5.51716 3.50241 5.86735 3.30269C6.21754 3.10297 6.61432 2.99942 7.01745 3.00255C7.42058 3.00568 7.81571 3.11537 8.16276 3.3205C8.5098 3.52562 8.79643 3.81889 8.99355 4.17055C9.19067 4.52221 9.29128 4.91975 9.28517 5.32284C9.27906 5.72593 9.16645 6.12024 8.95876 6.46576C8.75107 6.81128 8.45569 7.0963 8.10258 7.29081Z"
|
|
11
17
|
fill="#7B8190"
|
|
@@ -15,21 +21,26 @@
|
|
|
15
21
|
</span>
|
|
16
22
|
|
|
17
23
|
<div
|
|
18
|
-
(
|
|
19
|
-
(
|
|
20
|
-
(mouseleave)="question.hide($event)"
|
|
24
|
+
(mouseenter)="isVisible = true"
|
|
25
|
+
(mouseleave)="isVisible = false"
|
|
21
26
|
class="icon-tooltip"
|
|
22
27
|
style="width: 100%"
|
|
23
28
|
></div>
|
|
24
29
|
|
|
25
|
-
<div class="questiontooltip">
|
|
26
|
-
<
|
|
30
|
+
<div class="questiontooltip" *ngIf="isVisible">
|
|
31
|
+
<div class="tooltip-bubble">
|
|
27
32
|
<div class="inner-container" [innerHTML]="text"></div>
|
|
28
|
-
</
|
|
33
|
+
</div>
|
|
29
34
|
</div>
|
|
30
35
|
|
|
31
36
|
<ng-template #tooltipOutlined>
|
|
32
|
-
<svg
|
|
37
|
+
<svg
|
|
38
|
+
width="14"
|
|
39
|
+
height="14"
|
|
40
|
+
viewBox="0 0 14 14"
|
|
41
|
+
fill="none"
|
|
42
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
43
|
+
>
|
|
33
44
|
<path
|
|
34
45
|
d="M6 1.5C5.0111 1.5 4.0444 1.79324 3.22215 2.34265C2.39991 2.89206 1.75904 3.67295 1.3806 4.58658C1.00217 5.50021 0.90315 6.50555 1.09608 7.47545C1.289 8.44536 1.76521 9.33627 2.46447 10.0355C3.16373 10.7348 4.05465 11.211 5.02455 11.4039C5.99446 11.5969 6.99979 11.4978 7.91342 11.1194C8.82705 10.741 9.60794 10.1001 10.1573 9.27785C10.7068 8.45561 11 7.48891 11 6.5C10.9986 5.17436 10.4713 3.90342 9.53395 2.96605C8.59658 2.02868 7.32564 1.50143 6 1.5ZM6 10.6667C5.17591 10.6667 4.37033 10.4223 3.68513 9.96446C2.99992 9.50662 2.46587 8.85587 2.1505 8.09451C1.83514 7.33316 1.75263 6.49538 1.9134 5.68712C2.07417 4.87887 2.47101 4.13644 3.05372 3.55372C3.63644 2.971 4.37887 2.57417 5.18713 2.41339C5.99538 2.25262 6.83316 2.33514 7.59452 2.6505C8.35588 2.96587 9.00662 3.49992 9.46446 4.18512C9.9223 4.87033 10.1667 5.67591 10.1667 6.5C10.1655 7.6047 9.72608 8.6638 8.94494 9.44494C8.1638 10.2261 7.1047 10.6655 6 10.6667Z"
|
|
35
46
|
fill="#A3ABBF"
|
|
@@ -1,24 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
Input,
|
|
4
|
+
OnInit,
|
|
5
|
+
CUSTOM_ELEMENTS_SCHEMA,
|
|
6
|
+
} from "@angular/core";
|
|
7
|
+
import { CommonModule } from "@angular/common";
|
|
4
8
|
|
|
5
9
|
@Component({
|
|
6
|
-
selector:
|
|
7
|
-
templateUrl: './tooltip.component.html',
|
|
8
|
-
styleUrls: ['./tooltip.component.scss'],
|
|
9
|
-
encapsulation: ViewEncapsulation.None,
|
|
10
|
+
selector: "dropi-tooltip",
|
|
10
11
|
standalone: true,
|
|
11
|
-
imports: [CommonModule
|
|
12
|
-
schemas: [
|
|
12
|
+
imports: [CommonModule],
|
|
13
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
14
|
+
templateUrl: "./tooltip.component.html",
|
|
15
|
+
styleUrls: ["./tooltip.component.scss"],
|
|
13
16
|
})
|
|
14
17
|
export class TooltipComponent implements OnInit {
|
|
15
|
-
@Input() text: string | undefined;
|
|
16
|
-
@Input() outlined: boolean = false;
|
|
18
|
+
@Input() public text: string | undefined;
|
|
19
|
+
@Input() public outlined: boolean = false;
|
|
20
|
+
@Input() public questionTooltip: string = "body";
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
questionTooltip: string = 'body'; // Puedes establecer el valor según tus necesidades
|
|
22
|
+
public isVisible: boolean = false;
|
|
20
23
|
|
|
21
24
|
constructor() {}
|
|
22
25
|
|
|
23
26
|
ngOnInit(): void {}
|
|
27
|
+
|
|
28
|
+
public toggle(): void {
|
|
29
|
+
this.isVisible = !this.isVisible;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public show(event?: any): void {
|
|
33
|
+
this.isVisible = true;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public hide(event?: any): void {
|
|
37
|
+
this.isVisible = false;
|
|
38
|
+
}
|
|
24
39
|
}
|
|
@@ -6,110 +6,62 @@ import {
|
|
|
6
6
|
OnInit,
|
|
7
7
|
Output,
|
|
8
8
|
SimpleChanges,
|
|
9
|
-
} from
|
|
10
|
-
import { CommonModule } from
|
|
11
|
-
import { TranslateModule } from
|
|
12
|
-
import { IconComponent } from
|
|
9
|
+
} from "@angular/core";
|
|
10
|
+
import { CommonModule } from "@angular/common";
|
|
11
|
+
import { TranslateModule } from "@ngx-translate/core";
|
|
12
|
+
import { IconComponent } from "../icon/icon.component";
|
|
13
13
|
|
|
14
|
-
export type VerticalStepState =
|
|
14
|
+
export type VerticalStepState = "pending" | "current" | "completed";
|
|
15
15
|
|
|
16
16
|
export interface VerticalStep {
|
|
17
|
-
/** Etiqueta del paso */
|
|
18
17
|
label?: string;
|
|
19
|
-
/** Clave de traducción para la etiqueta (alternativa a label) */
|
|
20
18
|
labelKey?: string;
|
|
21
|
-
/** Estado del paso */
|
|
22
19
|
state?: VerticalStepState;
|
|
23
20
|
}
|
|
24
21
|
|
|
25
|
-
/**
|
|
26
|
-
* Componente de pasos verticales de Dropi
|
|
27
|
-
* Muestra una lista vertical de pasos con indicadores de estado
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* <vertical-steps
|
|
31
|
-
* [steps]="[
|
|
32
|
-
* { labelKey: 'STEP_1', state: 'completed' },
|
|
33
|
-
* { labelKey: 'STEP_2', state: 'current' },
|
|
34
|
-
* { labelKey: 'STEP_3', state: 'pending' }
|
|
35
|
-
* ]"
|
|
36
|
-
* [currentStep]="2"
|
|
37
|
-
* [clickable]="true"
|
|
38
|
-
* (stepClick)="onStepClick($event)"
|
|
39
|
-
* />
|
|
40
|
-
*/
|
|
41
22
|
@Component({
|
|
42
|
-
selector:
|
|
23
|
+
selector: "vertical-steps",
|
|
43
24
|
standalone: true,
|
|
44
25
|
imports: [CommonModule, TranslateModule, IconComponent],
|
|
45
|
-
templateUrl:
|
|
46
|
-
styleUrls: [
|
|
26
|
+
templateUrl: "./vertical-steps.component.html",
|
|
27
|
+
styleUrls: ["./vertical-steps.component.scss"],
|
|
47
28
|
})
|
|
48
29
|
export class VerticalStepsComponent implements OnInit, OnChanges {
|
|
49
|
-
/**
|
|
50
|
-
* Lista de pasos a mostrar
|
|
51
|
-
* @type {VerticalStep[]}
|
|
52
|
-
*/
|
|
53
30
|
@Input() steps: VerticalStep[] = [];
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Paso actual (1-indexed). Si se proporciona, sobrescribe el estado de los pasos.
|
|
57
|
-
* Los pasos anteriores serán 'completed', el actual 'current', y los siguientes 'pending'.
|
|
58
|
-
* @type {number}
|
|
59
|
-
*/
|
|
60
31
|
@Input() currentStep: number = 1;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Permite hacer clic en los pasos completados y el actual
|
|
64
|
-
* @default false
|
|
65
|
-
* @type {boolean}
|
|
66
|
-
*/
|
|
67
32
|
@Input() clickable: boolean = false;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Mostrar el ícono de check en pasos completados
|
|
71
|
-
* @default true
|
|
72
|
-
* @type {boolean}
|
|
73
|
-
*/
|
|
74
33
|
@Input() showCheckIcon: boolean = true;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Evento emitido cuando se hace clic en un paso
|
|
78
|
-
* @type {EventEmitter<number>}
|
|
79
|
-
*/
|
|
80
34
|
@Output() stepClick = new EventEmitter<number>();
|
|
81
35
|
|
|
82
|
-
|
|
83
|
-
|
|
36
|
+
processedSteps: (VerticalStep & {
|
|
37
|
+
number: number;
|
|
38
|
+
calculatedState: VerticalStepState;
|
|
39
|
+
})[] = [];
|
|
84
40
|
|
|
85
41
|
ngOnInit(): void {
|
|
86
42
|
this.processSteps();
|
|
87
43
|
}
|
|
88
44
|
|
|
89
45
|
ngOnChanges(changes: SimpleChanges): void {
|
|
90
|
-
if (changes[
|
|
46
|
+
if (changes["steps"] || changes["currentStep"]) {
|
|
91
47
|
this.processSteps();
|
|
92
48
|
}
|
|
93
49
|
}
|
|
94
50
|
|
|
95
|
-
/**
|
|
96
|
-
* Procesa los pasos y calcula el estado de cada uno
|
|
97
|
-
*/
|
|
98
51
|
private processSteps(): void {
|
|
99
52
|
this.processedSteps = this.steps.map((step, index) => {
|
|
100
53
|
const stepNumber = index + 1;
|
|
101
54
|
let calculatedState: VerticalStepState;
|
|
102
55
|
|
|
103
|
-
// Si el paso tiene un estado definido, usarlo; si no, calcularlo basado en currentStep
|
|
104
56
|
if (step.state) {
|
|
105
57
|
calculatedState = step.state;
|
|
106
58
|
} else {
|
|
107
59
|
if (stepNumber < this.currentStep) {
|
|
108
|
-
calculatedState =
|
|
60
|
+
calculatedState = "completed";
|
|
109
61
|
} else if (stepNumber === this.currentStep) {
|
|
110
|
-
calculatedState =
|
|
62
|
+
calculatedState = "current";
|
|
111
63
|
} else {
|
|
112
|
-
calculatedState =
|
|
64
|
+
calculatedState = "pending";
|
|
113
65
|
}
|
|
114
66
|
}
|
|
115
67
|
|
|
@@ -121,30 +73,16 @@ export class VerticalStepsComponent implements OnInit, OnChanges {
|
|
|
121
73
|
});
|
|
122
74
|
}
|
|
123
75
|
|
|
124
|
-
/**
|
|
125
|
-
* Determina si un paso es clickeable
|
|
126
|
-
* @param stepNumber Número del paso (1-indexed)
|
|
127
|
-
* @returns true si el paso es clickeable
|
|
128
|
-
*/
|
|
129
76
|
isStepClickable(stepNumber: number): boolean {
|
|
130
77
|
return this.clickable && stepNumber <= this.currentStep;
|
|
131
78
|
}
|
|
132
79
|
|
|
133
|
-
/**
|
|
134
|
-
* Maneja el clic en un paso
|
|
135
|
-
* @param stepNumber Número del paso (1-indexed)
|
|
136
|
-
*/
|
|
137
80
|
onStepClick(stepNumber: number): void {
|
|
138
81
|
if (this.isStepClickable(stepNumber)) {
|
|
139
82
|
this.stepClick.emit(stepNumber);
|
|
140
83
|
}
|
|
141
84
|
}
|
|
142
85
|
|
|
143
|
-
/**
|
|
144
|
-
* Determina si es el último paso
|
|
145
|
-
* @param index Índice del paso (0-indexed)
|
|
146
|
-
* @returns true si es el último paso
|
|
147
|
-
*/
|
|
148
86
|
isLastStep(index: number): boolean {
|
|
149
87
|
return index === this.processedSteps.length - 1;
|
|
150
88
|
}
|