@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
|
@@ -6,138 +6,77 @@ import {
|
|
|
6
6
|
Output,
|
|
7
7
|
SimpleChanges,
|
|
8
8
|
TemplateRef,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
import { Subscription } from
|
|
14
|
-
import { debounceTime } from
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
RadioSelectionFilteredOptions,
|
|
18
|
-
} from '@app/utilities/interfaces/ui/radio-selection-list.interface';
|
|
19
|
-
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
9
|
+
Inject,
|
|
10
|
+
} from "@angular/core";
|
|
11
|
+
import { CommonModule } from "@angular/common";
|
|
12
|
+
import { FormControl, ReactiveFormsModule } from "@angular/forms";
|
|
13
|
+
import { Subscription } from "rxjs";
|
|
14
|
+
import { debounceTime } from "rxjs/operators";
|
|
15
|
+
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
|
16
|
+
import { Option } from "../../utilities/interfaces/ui/selection-list-interface";
|
|
20
17
|
|
|
21
18
|
@Component({
|
|
22
|
-
selector:
|
|
19
|
+
selector: "app-radio-selection-list",
|
|
23
20
|
standalone: true,
|
|
24
21
|
imports: [CommonModule, TranslateModule, ReactiveFormsModule],
|
|
25
|
-
templateUrl:
|
|
26
|
-
styleUrls: [
|
|
22
|
+
templateUrl: "./radio-selection-list.component.html",
|
|
23
|
+
styleUrls: ["./radio-selection-list.component.scss"],
|
|
27
24
|
})
|
|
28
|
-
/**
|
|
29
|
-
* Componente para mostrar una lista de opciones que se pueden seleccionar.
|
|
30
|
-
* Los botones de cada opción se renderizan con una imagen y un texto.
|
|
31
|
-
* Luego de seleccionar una opción, se emite un evento {@link valueChange} con el id de la opción seleccionada.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* <app-radio-selection-list
|
|
35
|
-
* [options]="options"
|
|
36
|
-
* (valueChange)="onValueChange($event)"
|
|
37
|
-
* [alwaysShowDescription]="true"
|
|
38
|
-
* [selectedOption]="'option-1'"
|
|
39
|
-
* ></app-radio-selection-list>
|
|
40
|
-
*
|
|
41
|
-
* @export
|
|
42
|
-
* @class RadioSelectionListComponent
|
|
43
|
-
*/
|
|
44
25
|
export class RadioSelectionListComponent implements OnInit {
|
|
45
26
|
@Input() extraContent: TemplateRef<any> | null = null;
|
|
46
27
|
@Input() withExtraContentId: string | null = null;
|
|
47
|
-
/**
|
|
48
|
-
* Opciones a mostrar en la lista.
|
|
49
|
-
* Cada opción debe tener un id, un nombre y opcionalmente una descripción y una lista de iconos.
|
|
50
|
-
* @type {Option[]}
|
|
51
|
-
*/
|
|
52
28
|
@Input() options: Option[] = [];
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Layout de la lista de opciones.
|
|
56
|
-
* Por defecto es 'default', acá se define si se muestra con las imagenes a la derecha o con una imagen a la izquierda.
|
|
57
|
-
* @type {'description'|'default'}
|
|
58
|
-
*/
|
|
59
|
-
@Input() typeLayout: 'description' | 'default' = 'default';
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Si se muestra la descripción de la opción aunque no está seleccionada.
|
|
63
|
-
* Por defecto es verdadero.
|
|
64
|
-
* @type {boolean}
|
|
65
|
-
*/
|
|
29
|
+
@Input() typeLayout: "description" | "default" | string = "default";
|
|
66
30
|
@Input() alwaysShowDescription: boolean = true;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Id de la opción seleccionada.
|
|
70
|
-
* Por defecto es nulo.
|
|
71
|
-
* @type {string}
|
|
72
|
-
*/
|
|
73
31
|
@Input() selectedOption?: string = null;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Permite mostrar u ocultar el campo de búsqueda
|
|
77
|
-
* @default true
|
|
78
|
-
*/
|
|
79
32
|
@Input() showFilter: boolean = false;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Placeholder para el campo de búsqueda
|
|
83
|
-
*/
|
|
84
|
-
@Input() filterPlaceholder: string = 'Search';
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Tiempo de demora en milisegundos para realizar la búsqueda
|
|
88
|
-
*/
|
|
33
|
+
@Input() filterPlaceholder: string = "Search";
|
|
89
34
|
@Input() searchDelay: number = 100;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Evento emitido cuando se selecciona una opción.
|
|
93
|
-
* El valor emitido es el id de la opción seleccionada.
|
|
94
|
-
* @type {EventEmitter<string>}
|
|
95
|
-
*/
|
|
96
35
|
@Output() valueChange: EventEmitter<string> = new EventEmitter<string>();
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Evento que se dispara al realizar una búsqueda (Se emite cuando se cambia el valor del input de búsqueda basado en @SearchDelay)
|
|
100
|
-
*/
|
|
101
|
-
@Output() onSearch = new EventEmitter<RadioSelectionFilteredOptions>();
|
|
36
|
+
@Output() onSearch = new EventEmitter<any>();
|
|
102
37
|
|
|
103
38
|
private readonly subscriptions: Subscription = new Subscription();
|
|
104
|
-
searchControl = new FormControl(
|
|
39
|
+
searchControl = new FormControl("");
|
|
105
40
|
filteredOptions: Option[] = [];
|
|
106
41
|
|
|
107
|
-
constructor(
|
|
42
|
+
constructor(
|
|
43
|
+
@Inject(TranslateService)
|
|
44
|
+
private readonly translateService: TranslateService,
|
|
45
|
+
) {}
|
|
108
46
|
|
|
109
47
|
ngOnInit() {
|
|
110
48
|
this.subscriptions.add(
|
|
111
|
-
this.searchControl.valueChanges
|
|
112
|
-
this.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
});
|
|
117
|
-
}),
|
|
49
|
+
this.searchControl.valueChanges
|
|
50
|
+
.pipe(debounceTime(this.searchDelay))
|
|
51
|
+
.subscribe((value) => {
|
|
52
|
+
this.filterOption(value);
|
|
53
|
+
}),
|
|
118
54
|
);
|
|
119
55
|
|
|
120
56
|
this.filteredOptions = this.options;
|
|
121
57
|
}
|
|
122
58
|
|
|
123
59
|
ngOnChanges(changes: SimpleChanges) {
|
|
124
|
-
if (changes[
|
|
60
|
+
if (changes["options"]) this.filteredOptions = this.options;
|
|
125
61
|
}
|
|
126
62
|
|
|
127
|
-
filterOption(optionName:
|
|
128
|
-
|
|
63
|
+
filterOption(optionName: any) {
|
|
64
|
+
const val = typeof optionName === "string" ? optionName : "";
|
|
65
|
+
if (!val.trim()) {
|
|
66
|
+
this.filteredOptions = this.options;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
129
69
|
this.filteredOptions = this.options.filter((o) =>
|
|
130
|
-
o.name.toLowerCase().includes(
|
|
70
|
+
o.name.toLowerCase().includes(val.toLowerCase()),
|
|
131
71
|
);
|
|
132
72
|
}
|
|
133
73
|
|
|
134
|
-
/**
|
|
135
|
-
* Función que se ejecuta al seleccionar una opción.
|
|
136
|
-
* @param optionId Id de la opción seleccionada.
|
|
137
|
-
* @type {void}
|
|
138
|
-
*/
|
|
139
74
|
selectOption(optionId: string): void {
|
|
140
75
|
this.selectedOption = optionId;
|
|
141
76
|
this.valueChange.emit(this.selectedOption);
|
|
142
77
|
}
|
|
78
|
+
|
|
79
|
+
clearSearchInput() {
|
|
80
|
+
this.searchControl.setValue("");
|
|
81
|
+
}
|
|
143
82
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
2
|
import { By } from '@angular/platform-browser';
|
|
3
3
|
import { DebugElement, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { NavigationEnd } from ' ';
|
|
5
5
|
import { TranslateModule } from '@ngx-translate/core';
|
|
6
6
|
import { Subject } from 'rxjs';
|
|
7
7
|
import { SidebarComponent } from './sidebar.component';
|
|
@@ -11,7 +11,7 @@ describe('SidebarComponent', () => {
|
|
|
11
11
|
let component: SidebarComponent;
|
|
12
12
|
let fixture: ComponentFixture<SidebarComponent>;
|
|
13
13
|
let debugElement: DebugElement;
|
|
14
|
-
let
|
|
14
|
+
let mockany: any;
|
|
15
15
|
let routerEventsSubject: Subject<any>;
|
|
16
16
|
|
|
17
17
|
const mockSidebarData: SidebarProperties[] = [
|
|
@@ -59,14 +59,14 @@ describe('SidebarComponent', () => {
|
|
|
59
59
|
|
|
60
60
|
beforeEach(async () => {
|
|
61
61
|
routerEventsSubject = new Subject();
|
|
62
|
-
|
|
62
|
+
mockany = {
|
|
63
63
|
url: '/dashboard',
|
|
64
64
|
navigate: jest.fn().mockResolvedValue(true),
|
|
65
65
|
events: routerEventsSubject.asObservable(),
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
// Instanciación directa del componente standalone
|
|
69
|
-
component = new SidebarComponent(
|
|
69
|
+
component = new SidebarComponent(mockany);
|
|
70
70
|
|
|
71
71
|
// Mock del fixture para compatibilidad
|
|
72
72
|
fixture = {
|
|
@@ -237,7 +237,7 @@ describe('SidebarComponent', () => {
|
|
|
237
237
|
it('should navigate to route when item without subItems is clicked', () => {
|
|
238
238
|
component.onItemClick(component.sideBarProperties[0]);
|
|
239
239
|
|
|
240
|
-
expect(
|
|
240
|
+
expect(mockany.navigate).toHaveBeenCalledWith(['/dashboard']);
|
|
241
241
|
});
|
|
242
242
|
|
|
243
243
|
it('should toggle expansion when item with subItems is clicked', () => {
|
|
@@ -246,7 +246,7 @@ describe('SidebarComponent', () => {
|
|
|
246
246
|
component.onItemClick(component.sideBarProperties[1]);
|
|
247
247
|
|
|
248
248
|
expect(setExpandedSpy).toHaveBeenCalledWith(2);
|
|
249
|
-
expect(
|
|
249
|
+
expect(mockany.navigate).not.toHaveBeenCalled();
|
|
250
250
|
});
|
|
251
251
|
|
|
252
252
|
it('should emit onIndexChanged when sub-item is clicked', () => {
|
|
@@ -263,7 +263,7 @@ describe('SidebarComponent', () => {
|
|
|
263
263
|
|
|
264
264
|
component.onSubItemClick(subItem);
|
|
265
265
|
|
|
266
|
-
expect(
|
|
266
|
+
expect(mockany.navigate).toHaveBeenCalledWith(['/products/list']);
|
|
267
267
|
});
|
|
268
268
|
|
|
269
269
|
it('should handle item without route', () => {
|
|
@@ -273,7 +273,7 @@ describe('SidebarComponent', () => {
|
|
|
273
273
|
component.onItemClick(itemWithoutRoute);
|
|
274
274
|
}).not.toThrow();
|
|
275
275
|
|
|
276
|
-
expect(
|
|
276
|
+
expect(mockany.navigate).not.toHaveBeenCalled();
|
|
277
277
|
});
|
|
278
278
|
});
|
|
279
279
|
|
|
@@ -322,12 +322,12 @@ describe('SidebarComponent', () => {
|
|
|
322
322
|
});
|
|
323
323
|
|
|
324
324
|
it('should handle router navigation errors', () => {
|
|
325
|
-
|
|
325
|
+
mockany.navigate.mockRejectedValue(new Error('Navigation failed'));
|
|
326
326
|
|
|
327
327
|
// Use a valid item with proper structure
|
|
328
328
|
const validItem = component.sideBarProperties[0];
|
|
329
329
|
component.onItemClick(validItem);
|
|
330
|
-
expect(
|
|
330
|
+
expect(mockany.navigate).toHaveBeenCalledWith(['/dashboard']);
|
|
331
331
|
});
|
|
332
332
|
});
|
|
333
333
|
|
|
@@ -341,7 +341,7 @@ describe('SidebarComponent', () => {
|
|
|
341
341
|
|
|
342
342
|
// Navigate to settings
|
|
343
343
|
component.onItemClick(component.sideBarProperties[2]);
|
|
344
|
-
expect(
|
|
344
|
+
expect(mockany.navigate).toHaveBeenCalledWith(['/settings']);
|
|
345
345
|
|
|
346
346
|
// Products should still be expanded
|
|
347
347
|
expect(component.sideBarProperties[1].expandedMenu).toBe(true);
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* @description A collapsible sidebar navigation menu with icon and text support
|
|
4
4
|
*/
|
|
5
5
|
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
|
|
6
|
-
import { Routes } from '
|
|
7
|
-
import {
|
|
6
|
+
import { Routes } from ' ';
|
|
7
|
+
import { anyTestingModule } from ' /testing';
|
|
8
8
|
import { SidebarComponent } from './sidebar.component';
|
|
9
9
|
import { Component } from '@angular/core';
|
|
10
10
|
|
|
@@ -39,7 +39,7 @@ const meta: Meta<SidebarComponent> = {
|
|
|
39
39
|
component: SidebarComponent,
|
|
40
40
|
decorators: [
|
|
41
41
|
moduleMetadata({
|
|
42
|
-
imports: [
|
|
42
|
+
imports: [anyTestingModule.withRoutes(routes)],
|
|
43
43
|
declarations: [DummyComponent],
|
|
44
44
|
}),
|
|
45
45
|
],
|
|
@@ -1,51 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
EventEmitter,
|
|
4
|
+
Input,
|
|
5
|
+
OnInit,
|
|
6
|
+
Output,
|
|
7
|
+
Inject,
|
|
8
|
+
OnDestroy,
|
|
9
|
+
} from "@angular/core";
|
|
10
|
+
import { CommonModule } from "@angular/common";
|
|
11
|
+
import { IconComponent } from "../icon/icon.component";
|
|
12
|
+
import { NavigationEnd } from "@angular/router";
|
|
13
|
+
import { Subscription } from "rxjs";
|
|
14
|
+
import { TranslateModule } from "@ngx-translate/core";
|
|
15
|
+
|
|
16
|
+
export interface SidebarProperties {
|
|
17
|
+
id: number;
|
|
18
|
+
icon: string;
|
|
19
|
+
text: string;
|
|
20
|
+
route: string;
|
|
21
|
+
expandedMenu?: boolean;
|
|
22
|
+
active?: boolean;
|
|
23
|
+
subItems?: SidebarProperties[];
|
|
24
|
+
}
|
|
8
25
|
|
|
9
26
|
@Component({
|
|
10
|
-
selector:
|
|
27
|
+
selector: "app-sidebar",
|
|
11
28
|
standalone: true,
|
|
12
29
|
imports: [CommonModule, IconComponent, TranslateModule],
|
|
13
|
-
templateUrl:
|
|
14
|
-
styleUrls: [
|
|
30
|
+
templateUrl: "./sidebar.component.html",
|
|
31
|
+
styleUrls: ["./sidebar.component.scss"],
|
|
15
32
|
})
|
|
16
|
-
export class SidebarComponent implements OnInit {
|
|
17
|
-
/**
|
|
18
|
-
* Define las propiedades y la cantidad de elementos a renderizar.
|
|
19
|
-
*
|
|
20
|
-
* Cada opción dentro del arreglo debe contener las siguientes propiedades:
|
|
21
|
-
* - `id`: Identificador único del elemento.
|
|
22
|
-
* - `icon`: Icono a mostrar en el elemento.
|
|
23
|
-
* - `text`: Texto a mostrar en el elemento.
|
|
24
|
-
* - `route`: Ruta a la que se redirige al hacer clic.
|
|
25
|
-
* - `expandedMenu`: Indica si el menú está expandido (opcional).
|
|
26
|
-
* - `active`: Indica si el elemento está activo (opcional).
|
|
27
|
-
* - `subItems`: Lista de subelementos en el menu, cada uno con las mismas propiedades antes descritas.
|
|
28
|
-
*
|
|
29
|
-
* @type {SidebarProperties[]}
|
|
30
|
-
*/
|
|
31
|
-
|
|
33
|
+
export class SidebarComponent implements OnInit, OnDestroy {
|
|
32
34
|
@Input() public sideBarProperties: SidebarProperties[] = [];
|
|
33
|
-
/**
|
|
34
|
-
* Evento emitido cuando se selecciona una opción.
|
|
35
|
-
*
|
|
36
|
-
* Al emitirse, se envían las propiedades del elemento seleccionado.
|
|
37
|
-
*
|
|
38
|
-
* @type {EventEmitter<SidebarProperties>}
|
|
39
|
-
*/
|
|
40
35
|
@Output() public onIndexChanged: EventEmitter<SidebarProperties> =
|
|
41
36
|
new EventEmitter<SidebarProperties>();
|
|
42
37
|
|
|
43
38
|
private subscriptions: Subscription = new Subscription();
|
|
44
39
|
|
|
45
|
-
constructor(private router:
|
|
40
|
+
constructor(@Inject("Router") private router: any) {}
|
|
46
41
|
|
|
47
42
|
ngOnInit(): void {
|
|
48
|
-
|
|
43
|
+
if (this.router?.url) {
|
|
44
|
+
this.setActiveIndex(this.router.url);
|
|
45
|
+
}
|
|
49
46
|
this.handleUrlChange();
|
|
50
47
|
}
|
|
51
48
|
|
|
@@ -54,16 +51,19 @@ export class SidebarComponent implements OnInit {
|
|
|
54
51
|
}
|
|
55
52
|
|
|
56
53
|
handleUrlChange() {
|
|
57
|
-
this.
|
|
58
|
-
this.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
if (this.router?.events) {
|
|
55
|
+
this.subscriptions.add(
|
|
56
|
+
this.router.events.subscribe((event: any) => {
|
|
57
|
+
if (event instanceof NavigationEnd) {
|
|
58
|
+
this.setActiveIndex(event.url);
|
|
59
|
+
}
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
}
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
setActiveIndex(route: string) {
|
|
66
|
+
if (!this.sideBarProperties) return;
|
|
67
67
|
this.sideBarProperties.forEach((propertie) => {
|
|
68
68
|
if (propertie.subItems && propertie.subItems.length > 0) {
|
|
69
69
|
propertie.subItems = propertie.subItems.map((subItem) => {
|
|
@@ -79,9 +79,13 @@ export class SidebarComponent implements OnInit {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
setExpandedPropertie(id: number) {
|
|
82
|
-
const propertieClicked = this.sideBarProperties.findIndex(
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
const propertieClicked = (this.sideBarProperties as any[]).findIndex(
|
|
83
|
+
(item) => item.id === id,
|
|
84
|
+
);
|
|
85
|
+
if (propertieClicked !== -1) {
|
|
86
|
+
this.sideBarProperties[propertieClicked].expandedMenu =
|
|
87
|
+
!this.sideBarProperties[propertieClicked].expandedMenu;
|
|
88
|
+
}
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
onItemClick(itemClicked: SidebarProperties) {
|
|
@@ -92,14 +96,14 @@ export class SidebarComponent implements OnInit {
|
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
if (itemClicked.route) {
|
|
95
|
-
this.router
|
|
99
|
+
this.router?.navigate?.([itemClicked.route]);
|
|
96
100
|
}
|
|
97
101
|
}
|
|
98
102
|
|
|
99
103
|
onSubItemClick(itemClicked: SidebarProperties) {
|
|
100
104
|
this.onIndexChanged.emit(itemClicked);
|
|
101
105
|
if (itemClicked.route) {
|
|
102
|
-
this.router
|
|
106
|
+
this.router?.navigate?.([itemClicked.route]);
|
|
103
107
|
}
|
|
104
108
|
}
|
|
105
109
|
}
|
|
@@ -1,43 +1,26 @@
|
|
|
1
|
-
import { Component, Input, OnInit } from
|
|
2
|
-
import { CommonModule } from
|
|
3
|
-
|
|
1
|
+
import { Component, Input, OnInit } from "@angular/core";
|
|
2
|
+
import { CommonModule } from "@angular/common";
|
|
3
|
+
|
|
4
|
+
// Stub del enum FlowMode para desacoplamiento
|
|
5
|
+
export enum FlowMode {
|
|
6
|
+
Simultaneous = "simultaneous",
|
|
7
|
+
Sequential = "sequential",
|
|
8
|
+
}
|
|
4
9
|
|
|
5
|
-
/**
|
|
6
|
-
* Componente que representa un stepper simple.
|
|
7
|
-
* Permite avanzar en modo secuencial o simultáneo y muestra visualmente los pasos activos.
|
|
8
|
-
*/
|
|
9
10
|
@Component({
|
|
10
|
-
selector:
|
|
11
|
+
selector: "app-simple-stepper",
|
|
11
12
|
standalone: true,
|
|
12
13
|
imports: [CommonModule],
|
|
13
|
-
templateUrl:
|
|
14
|
-
styleUrls: [
|
|
14
|
+
templateUrl: "./simple-stepper.component.html",
|
|
15
|
+
styleUrls: ["./simple-stepper.component.scss"],
|
|
15
16
|
})
|
|
16
17
|
export class SimpleStepperComponent implements OnInit {
|
|
17
|
-
/**
|
|
18
|
-
* Número total de pasos del stepper.
|
|
19
|
-
* @default 3
|
|
20
|
-
*/
|
|
21
18
|
@Input() stepsCount: number = 3;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Paso actual del stepper (comienza en 0).
|
|
25
|
-
*/
|
|
26
|
-
@Input() typeStep: string = 'point'; // 'number' | 'point'
|
|
19
|
+
@Input() typeStep: string = "point";
|
|
27
20
|
@Input() currentStep: number = 0;
|
|
28
21
|
@Input() labelStepper: Array<string> = [];
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Modo de avance del stepper: simultáneo o secuencial.
|
|
32
|
-
* @default FlowMode.simultaneous
|
|
33
|
-
*/
|
|
34
22
|
@Input() flowMode: FlowMode = FlowMode.Simultaneous;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* white_brand: modificará el color del stepper en caso de se envie un valor en white_brand distinto a dropi
|
|
38
|
-
* @default "dropi"
|
|
39
|
-
*/
|
|
40
|
-
@Input() white_brand: string = 'dropi';
|
|
23
|
+
@Input() white_brand: string = "dropi";
|
|
41
24
|
|
|
42
25
|
steps: number[] = [];
|
|
43
26
|
|
|
@@ -45,8 +28,10 @@ export class SimpleStepperComponent implements OnInit {
|
|
|
45
28
|
this.steps = Array(this.stepsCount - 1).fill(0);
|
|
46
29
|
|
|
47
30
|
const color =
|
|
48
|
-
this.white_brand?.toLowerCase() ===
|
|
49
|
-
|
|
31
|
+
this.white_brand?.toLowerCase() === "dropi"
|
|
32
|
+
? "#f49a3d"
|
|
33
|
+
: "var(--Secondary-Secondary-500)";
|
|
34
|
+
document.documentElement.style.setProperty("--stepper-color", color);
|
|
50
35
|
}
|
|
51
36
|
|
|
52
37
|
isLineActive(index: number): boolean {
|
|
@@ -62,8 +47,8 @@ export class SimpleStepperComponent implements OnInit {
|
|
|
62
47
|
}
|
|
63
48
|
|
|
64
49
|
get secondaryColor(): string {
|
|
65
|
-
return this.white_brand?.toLowerCase() ===
|
|
66
|
-
?
|
|
67
|
-
:
|
|
50
|
+
return this.white_brand?.toLowerCase() === "dropi"
|
|
51
|
+
? "#f49a3d"
|
|
52
|
+
: "var(--Secondary-Secondary-500, #008DBF)";
|
|
68
53
|
}
|
|
69
54
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.loader-text {
|
|
2
|
+
background: #fff;
|
|
3
|
+
max-width: fit-content;
|
|
4
|
+
border-radius: 30px;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
padding: 0px 10px;
|
|
8
|
+
margin: 0 auto 20px;
|
|
9
|
+
a {
|
|
10
|
+
color: #74788d !important;
|
|
11
|
+
}
|
|
12
|
+
i {
|
|
13
|
+
color: #74788d !important;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component, Input, OnInit } from '@angular/core';
|
|
2
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
3
|
+
import { NgIf } from '@angular/common';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'app-spinner',
|
|
7
|
+
templateUrl: './spinner.component.html',
|
|
8
|
+
styleUrls: ['./spinner.component.scss'],
|
|
9
|
+
standalone: true,
|
|
10
|
+
imports: [NgIf, TranslateModule]
|
|
11
|
+
})
|
|
12
|
+
export class SpinnerComponent implements OnInit {
|
|
13
|
+
@Input() loading: boolean = true;
|
|
14
|
+
constructor() {}
|
|
15
|
+
|
|
16
|
+
ngOnInit(): void {}
|
|
17
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationEnd } from ' ';
|
|
3
3
|
import { TabsComponent } from './tabs.component';
|
|
4
4
|
import { IconComponent } from '../icon/icon.component';
|
|
5
5
|
import { TabProperties } from '@app/utilities/interfaces/ui/tabs.interface';
|
|
@@ -9,20 +9,20 @@ import { TranslateModule } from '@ngx-translate/core';
|
|
|
9
9
|
describe('TabsComponent', () => {
|
|
10
10
|
let component: TabsComponent;
|
|
11
11
|
let fixture: ComponentFixture<TabsComponent>;
|
|
12
|
-
let
|
|
12
|
+
let mockany: any;
|
|
13
13
|
let routerEventsSubject: Subject<any>;
|
|
14
14
|
|
|
15
15
|
beforeEach(async () => {
|
|
16
16
|
routerEventsSubject = new Subject();
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
mockany = {
|
|
19
19
|
url: '/test-route',
|
|
20
20
|
events: routerEventsSubject.asObservable(),
|
|
21
21
|
navigate: jest.fn().mockResolvedValue(true),
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
// Crear el componente directamente sin TestBed para evitar problemas de dependencias
|
|
25
|
-
component = new TabsComponent(
|
|
25
|
+
component = new TabsComponent(mockany);
|
|
26
26
|
|
|
27
27
|
// Mock fixture básico
|
|
28
28
|
fixture = {
|
|
@@ -49,7 +49,7 @@ describe('TabsComponent', () => {
|
|
|
49
49
|
{ id: 1, label: 'Tab 2', route: '/other-route' },
|
|
50
50
|
];
|
|
51
51
|
component.configuration = mockConfig;
|
|
52
|
-
|
|
52
|
+
mockany.url = '/test-route';
|
|
53
53
|
|
|
54
54
|
component.ngOnInit();
|
|
55
55
|
|
|
@@ -111,7 +111,7 @@ describe('TabsComponent', () => {
|
|
|
111
111
|
|
|
112
112
|
component.onTabClick(mockTab);
|
|
113
113
|
|
|
114
|
-
expect(
|
|
114
|
+
expect(mockany.navigate).toHaveBeenCalledWith(['/test-route'], { queryParams: {} });
|
|
115
115
|
});
|
|
116
116
|
|
|
117
117
|
it('should handle route with query params', () => {
|
|
@@ -123,7 +123,7 @@ describe('TabsComponent', () => {
|
|
|
123
123
|
|
|
124
124
|
component.onTabClick(mockTab);
|
|
125
125
|
|
|
126
|
-
expect(
|
|
126
|
+
expect(mockany.navigate).toHaveBeenCalledWith(['/test-route'], {
|
|
127
127
|
queryParams: { section: 'invoice' },
|
|
128
128
|
});
|
|
129
129
|
});
|
|
@@ -206,7 +206,7 @@ describe('TabsComponent', () => {
|
|
|
206
206
|
component.onTabClick(mockConfig[1]);
|
|
207
207
|
|
|
208
208
|
expect(emitSpy).toHaveBeenCalledWith(mockConfig[1]);
|
|
209
|
-
expect(
|
|
209
|
+
expect(mockany.navigate).toHaveBeenCalled();
|
|
210
210
|
});
|
|
211
211
|
});
|
|
212
212
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
|
|
2
|
-
import { Routes } from '
|
|
3
|
-
import {
|
|
2
|
+
import { Routes } from ' ';
|
|
3
|
+
import { anyTestingModule } from ' /testing';
|
|
4
4
|
import { TabsComponent } from './tabs.component';
|
|
5
5
|
import { Component } from '@angular/core';
|
|
6
6
|
|
|
@@ -23,7 +23,7 @@ const routes: Routes = [
|
|
|
23
23
|
* Tabs allow users to switch between different views within the same context.
|
|
24
24
|
*
|
|
25
25
|
* ## Features
|
|
26
|
-
* - **Route integration**: Works with Angular
|
|
26
|
+
* - **Route integration**: Works with Angular any for navigation
|
|
27
27
|
* - **Completion indicators**: Optional icons showing completion status
|
|
28
28
|
* - **Flexible configuration**: Customizable labels and routes
|
|
29
29
|
* - **Accessible**: Keyboard navigable with ARIA support
|
|
@@ -44,7 +44,7 @@ const meta: Meta<TabsComponent> = {
|
|
|
44
44
|
component: TabsComponent,
|
|
45
45
|
decorators: [
|
|
46
46
|
moduleMetadata({
|
|
47
|
-
imports: [
|
|
47
|
+
imports: [anyTestingModule.withRoutes(routes)],
|
|
48
48
|
declarations: [DummyComponent],
|
|
49
49
|
}),
|
|
50
50
|
],
|
|
@@ -58,7 +58,7 @@ A navigation component for organizing content into multiple tabbed sections.
|
|
|
58
58
|
Tabs allow users to switch between different views within the same context.
|
|
59
59
|
|
|
60
60
|
### Key Features
|
|
61
|
-
- **Route integration**: Works with Angular
|
|
61
|
+
- **Route integration**: Works with Angular any for navigation
|
|
62
62
|
- **Completion indicators**: Optional icons showing completion status
|
|
63
63
|
- **Flexible configuration**: Customizable labels and routes
|
|
64
64
|
- **Accessible**: Keyboard navigable with ARIA support
|