@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,5 +1,5 @@
|
|
|
1
1
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import {
|
|
2
|
+
import { anyTestingModule } from ' /testing';
|
|
3
3
|
import { Component } from '@angular/core';
|
|
4
4
|
import { MenuItem } from 'primeng/api';
|
|
5
5
|
import { BreadcrumbComponent } from './breadcrumb.component';
|
|
@@ -20,7 +20,7 @@ describe('BreadcrumbComponent', () => {
|
|
|
20
20
|
imports: [
|
|
21
21
|
BreadcrumbComponent,
|
|
22
22
|
IconComponent,
|
|
23
|
-
|
|
23
|
+
anyTestingModule.withRoutes([
|
|
24
24
|
{ path: 'test', component: TestComponent },
|
|
25
25
|
{ path: 'home', component: TestComponent },
|
|
26
26
|
{ path: '', component: TestComponent },
|
|
@@ -50,7 +50,7 @@ describe('BreadcrumbComponent', () => {
|
|
|
50
50
|
component.ngOnInit();
|
|
51
51
|
|
|
52
52
|
expect(component.home.icon).toBe('pi pi-home');
|
|
53
|
-
expect(component.home.
|
|
53
|
+
expect(component.home. (click)).toBe('/');
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
it('should accept custom imageIcon', () => {
|
|
@@ -64,7 +64,7 @@ describe('BreadcrumbComponent', () => {
|
|
|
64
64
|
component.homeRoute = '/dashboard';
|
|
65
65
|
component.ngOnInit();
|
|
66
66
|
|
|
67
|
-
expect(component.home.
|
|
67
|
+
expect(component.home. (click)).toBe('/dashboard');
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
70
|
|
|
@@ -77,7 +77,7 @@ describe('BreadcrumbComponent', () => {
|
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
it('should handle single item', () => {
|
|
80
|
-
const testItems: MenuItem[] = [{ label: 'Products',
|
|
80
|
+
const testItems: MenuItem[] = [{ label: 'Products', (click): '/products' }];
|
|
81
81
|
|
|
82
82
|
component.items = testItems;
|
|
83
83
|
fixture.detectChanges();
|
|
@@ -88,9 +88,9 @@ describe('BreadcrumbComponent', () => {
|
|
|
88
88
|
|
|
89
89
|
it('should handle multiple items', () => {
|
|
90
90
|
const testItems: MenuItem[] = [
|
|
91
|
-
{ label: 'Products',
|
|
92
|
-
{ label: 'Electronics',
|
|
93
|
-
{ label: 'Phones',
|
|
91
|
+
{ label: 'Products', (click): '/products' },
|
|
92
|
+
{ label: 'Electronics', (click): '/products/electronics' },
|
|
93
|
+
{ label: 'Phones', (click): '/products/electronics/phones' },
|
|
94
94
|
];
|
|
95
95
|
|
|
96
96
|
component.items = testItems;
|
|
@@ -102,8 +102,8 @@ describe('BreadcrumbComponent', () => {
|
|
|
102
102
|
|
|
103
103
|
it('should handle items with icons', () => {
|
|
104
104
|
const testItems: MenuItem[] = [
|
|
105
|
-
{ label: 'Products',
|
|
106
|
-
{ label: 'Settings',
|
|
105
|
+
{ label: 'Products', (click): '/products', icon: 'pi-box' },
|
|
106
|
+
{ label: 'Settings', (click): '/settings', icon: 'pi-cog' },
|
|
107
107
|
];
|
|
108
108
|
|
|
109
109
|
component.items = testItems;
|
|
@@ -113,15 +113,15 @@ describe('BreadcrumbComponent', () => {
|
|
|
113
113
|
expect(component.items[1].icon).toBe('pi-cog');
|
|
114
114
|
});
|
|
115
115
|
|
|
116
|
-
it('should handle items without
|
|
116
|
+
it('should handle items without (click)', () => {
|
|
117
117
|
const testItems: MenuItem[] = [
|
|
118
|
-
{ label: 'Current Page' }, // Sin
|
|
118
|
+
{ label: 'Current Page' }, // Sin (click)
|
|
119
119
|
];
|
|
120
120
|
|
|
121
121
|
component.items = testItems;
|
|
122
122
|
fixture.detectChanges();
|
|
123
123
|
|
|
124
|
-
expect(component.items[0].
|
|
124
|
+
expect(component.items[0]. (click)).toBeUndefined();
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
127
|
|
|
@@ -130,7 +130,7 @@ describe('BreadcrumbComponent', () => {
|
|
|
130
130
|
component.ngOnInit();
|
|
131
131
|
|
|
132
132
|
expect(component.home.icon).toBe('pi pi-home');
|
|
133
|
-
expect(component.home.
|
|
133
|
+
expect(component.home. (click)).toBe('/');
|
|
134
134
|
});
|
|
135
135
|
|
|
136
136
|
it('should create home item with custom icon', () => {
|
|
@@ -144,7 +144,7 @@ describe('BreadcrumbComponent', () => {
|
|
|
144
144
|
component.homeRoute = '/main';
|
|
145
145
|
component.ngOnInit();
|
|
146
146
|
|
|
147
|
-
expect(component.home.
|
|
147
|
+
expect(component.home. (click)).toBe('/main');
|
|
148
148
|
});
|
|
149
149
|
|
|
150
150
|
it('should create home item with both custom icon and route', () => {
|
|
@@ -153,7 +153,7 @@ describe('BreadcrumbComponent', () => {
|
|
|
153
153
|
component.ngOnInit();
|
|
154
154
|
|
|
155
155
|
expect(component.home.icon).toBe('dashboard');
|
|
156
|
-
expect(component.home.
|
|
156
|
+
expect(component.home. (click)).toBe('/admin');
|
|
157
157
|
});
|
|
158
158
|
});
|
|
159
159
|
|
|
@@ -183,7 +183,7 @@ describe('BreadcrumbComponent', () => {
|
|
|
183
183
|
component.homeRoute = '';
|
|
184
184
|
component.ngOnInit();
|
|
185
185
|
|
|
186
|
-
expect(component.home.
|
|
186
|
+
expect(component.home. (click)).toBe('');
|
|
187
187
|
});
|
|
188
188
|
|
|
189
189
|
it('should handle null imageIcon', () => {
|
|
@@ -197,7 +197,7 @@ describe('BreadcrumbComponent', () => {
|
|
|
197
197
|
component.homeRoute = null as any;
|
|
198
198
|
component.ngOnInit();
|
|
199
199
|
|
|
200
|
-
expect(component.home.
|
|
200
|
+
expect(component.home. (click)).toBeNull();
|
|
201
201
|
});
|
|
202
202
|
});
|
|
203
203
|
|
|
@@ -215,11 +215,11 @@ describe('BreadcrumbComponent', () => {
|
|
|
215
215
|
it('should update home item when homeRoute changes and ngOnInit is called', () => {
|
|
216
216
|
component.homeRoute = '/original';
|
|
217
217
|
component.ngOnInit();
|
|
218
|
-
expect(component.home.
|
|
218
|
+
expect(component.home. (click)).toBe('/original');
|
|
219
219
|
|
|
220
220
|
component.homeRoute = '/changed';
|
|
221
221
|
component.ngOnInit();
|
|
222
|
-
expect(component.home.
|
|
222
|
+
expect(component.home. (click)).toBe('/changed');
|
|
223
223
|
});
|
|
224
224
|
|
|
225
225
|
it('should handle multiple calls to ngOnInit', () => {
|
|
@@ -230,16 +230,16 @@ describe('BreadcrumbComponent', () => {
|
|
|
230
230
|
const secondHomeItem = component.home;
|
|
231
231
|
|
|
232
232
|
expect(firstHomeItem.icon).toBe(secondHomeItem.icon);
|
|
233
|
-
expect(firstHomeItem.
|
|
233
|
+
expect(firstHomeItem. (click)).toBe(secondHomeItem. (click));
|
|
234
234
|
});
|
|
235
235
|
});
|
|
236
236
|
|
|
237
237
|
describe('Integración completa', () => {
|
|
238
238
|
it('should work with complete breadcrumb setup', () => {
|
|
239
239
|
const testItems: MenuItem[] = [
|
|
240
|
-
{ label: 'Dashboard',
|
|
241
|
-
{ label: 'Users',
|
|
242
|
-
{ label: 'Profile',
|
|
240
|
+
{ label: 'Dashboard', (click): '/dashboard', icon: 'dashboard' },
|
|
241
|
+
{ label: 'Users', (click): '/users', icon: 'people' },
|
|
242
|
+
{ label: 'Profile', (click): '/users/profile' },
|
|
243
243
|
];
|
|
244
244
|
|
|
245
245
|
component.imageIcon = 'home';
|
|
@@ -249,7 +249,7 @@ describe('BreadcrumbComponent', () => {
|
|
|
249
249
|
fixture.detectChanges();
|
|
250
250
|
|
|
251
251
|
expect(component.home.icon).toBe('home');
|
|
252
|
-
expect(component.home.
|
|
252
|
+
expect(component.home. (click)).toBe('/');
|
|
253
253
|
expect(component.items.length).toBe(3);
|
|
254
254
|
expect(component.items[0].icon).toBe('dashboard');
|
|
255
255
|
expect(component.items[2].label).toBe('Profile');
|
|
@@ -264,7 +264,7 @@ describe('BreadcrumbComponent', () => {
|
|
|
264
264
|
},
|
|
265
265
|
{
|
|
266
266
|
label: 'Reports',
|
|
267
|
-
|
|
267
|
+
(click): '/reports',
|
|
268
268
|
queryParams: { type: 'monthly' },
|
|
269
269
|
},
|
|
270
270
|
];
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { Component, OnInit, Input, NO_ERRORS_SCHEMA } from
|
|
2
|
-
import { CommonModule } from
|
|
3
|
-
import { BreadcrumbModule } from 'primeng/breadcrumb';
|
|
4
|
-
import { MenuItem } from 'primeng/api';
|
|
1
|
+
import { Component, OnInit, Input, NO_ERRORS_SCHEMA } from "@angular/core";
|
|
2
|
+
import { CommonModule } from "@angular/common";
|
|
5
3
|
|
|
6
4
|
@Component({
|
|
7
|
-
selector:
|
|
5
|
+
selector: "app-breadcrumb",
|
|
8
6
|
standalone: true,
|
|
9
|
-
imports: [CommonModule
|
|
10
|
-
templateUrl:
|
|
11
|
-
styleUrls: [
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
templateUrl: "./breadcrumb.component.html",
|
|
9
|
+
styleUrls: ["./breadcrumb.component.scss"],
|
|
12
10
|
schemas: [NO_ERRORS_SCHEMA],
|
|
13
11
|
})
|
|
14
12
|
export class BreadcrumbComponent implements OnInit {
|
|
15
|
-
@Input() items:
|
|
16
|
-
@Input() imageIcon: string =
|
|
17
|
-
@Input() homeRoute: string =
|
|
13
|
+
@Input() items: any[] = [];
|
|
14
|
+
@Input() imageIcon: string = "pi pi-home";
|
|
15
|
+
@Input() homeRoute: string = "/";
|
|
18
16
|
|
|
19
|
-
home:
|
|
17
|
+
public home: any;
|
|
20
18
|
|
|
21
19
|
ngOnInit() {
|
|
22
20
|
this.home = { icon: this.imageIcon, routerLink: this.homeRoute };
|
|
@@ -4,7 +4,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
|
|
4
4
|
import { SettingsService } from '@app/services/setting.service';
|
|
5
5
|
import { ProductstService } from '@app/pages/service/products/products.service';
|
|
6
6
|
import { OrderManualService } from '@app/services/order-manual.service';
|
|
7
|
-
import {
|
|
7
|
+
import { any } from ' ';
|
|
8
8
|
import { of, throwError } from 'rxjs';
|
|
9
9
|
import { SimpleChange } from '@angular/core';
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ describe('CardProductComponent', () => {
|
|
|
14
14
|
let mockSettingsService: any;
|
|
15
15
|
let mockProductsService: any;
|
|
16
16
|
let mockOrderManualService: any;
|
|
17
|
-
let
|
|
17
|
+
let mockany: any;
|
|
18
18
|
|
|
19
19
|
const mockProduct: ProductData = {
|
|
20
20
|
id: '123',
|
|
@@ -54,7 +54,7 @@ describe('CardProductComponent', () => {
|
|
|
54
54
|
setProductsIds: jest.fn(),
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
mockany = {
|
|
58
58
|
navigate: jest.fn(),
|
|
59
59
|
url: '/dashboard/search',
|
|
60
60
|
};
|
|
@@ -64,7 +64,7 @@ describe('CardProductComponent', () => {
|
|
|
64
64
|
mockSettingsService,
|
|
65
65
|
mockProductsService,
|
|
66
66
|
mockOrderManualService,
|
|
67
|
-
|
|
67
|
+
mockany as any,
|
|
68
68
|
);
|
|
69
69
|
component.product = mockProduct;
|
|
70
70
|
|
|
@@ -392,7 +392,7 @@ describe('CardProductComponent', () => {
|
|
|
392
392
|
|
|
393
393
|
describe('Navegación a proveedor', () => {
|
|
394
394
|
it('should open provider in new window from search', () => {
|
|
395
|
-
|
|
395
|
+
mockany.url = '/dashboard/search';
|
|
396
396
|
const openSpy = jest.spyOn(window, 'open').mockImplementation();
|
|
397
397
|
|
|
398
398
|
component.getProvidersDetails();
|
|
@@ -404,11 +404,11 @@ describe('CardProductComponent', () => {
|
|
|
404
404
|
});
|
|
405
405
|
|
|
406
406
|
it('should navigate to provider from other routes', () => {
|
|
407
|
-
|
|
407
|
+
mockany.url = '/dashboard/home';
|
|
408
408
|
|
|
409
409
|
component.getProvidersDetails();
|
|
410
410
|
|
|
411
|
-
expect(
|
|
411
|
+
expect(mockany.navigate).toHaveBeenCalledWith([
|
|
412
412
|
'/dashboard/provider',
|
|
413
413
|
1,
|
|
414
414
|
expect.any(String),
|
|
@@ -417,11 +417,11 @@ describe('CardProductComponent', () => {
|
|
|
417
417
|
|
|
418
418
|
it('should clean supplier name for URL', () => {
|
|
419
419
|
component.product.supplier.name = 'Test Supplier ÁÉÍ!@#';
|
|
420
|
-
|
|
420
|
+
mockany.url = '/dashboard/home';
|
|
421
421
|
|
|
422
422
|
component.getProvidersDetails();
|
|
423
423
|
|
|
424
|
-
expect(
|
|
424
|
+
expect(mockany.navigate).toHaveBeenCalledWith([
|
|
425
425
|
'/dashboard/provider',
|
|
426
426
|
1,
|
|
427
427
|
expect.stringContaining('test-supplier'),
|
|
@@ -8,7 +8,7 @@ import { CardProductComponent, ProductData } from './card-product.component';
|
|
|
8
8
|
import { SettingsService } from '../../services/setting.service';
|
|
9
9
|
import { ProductstService } from '@app/pages/service/products/products.service';
|
|
10
10
|
import { OrderManualService } from '@app/services/order-manual.service';
|
|
11
|
-
import {
|
|
11
|
+
import { any } from ' ';
|
|
12
12
|
import { of } from 'rxjs';
|
|
13
13
|
|
|
14
14
|
const meta: Meta<CardProductComponent> = {
|
|
@@ -47,7 +47,7 @@ const meta: Meta<CardProductComponent> = {
|
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
-
provide:
|
|
50
|
+
provide:
|
|
51
51
|
useValue: {
|
|
52
52
|
url: '/storybook',
|
|
53
53
|
navigate: (commands: any[]) => Promise.resolve(true),
|