@cauca-911/material 21.0.1-beta.4 → 21.0.1
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/.eslintrc.json +79 -0
- package/README_PACKAGE.md +5 -0
- package/cauca-911-material-21.0.0.tgz +0 -0
- package/karma.conf.js +50 -0
- package/ng-package.json +7 -0
- package/package.json +23 -38
- package/src/assets/i18n/cauca/en-material.json +104 -0
- package/src/assets/i18n/cauca/es-material.json +104 -0
- package/src/assets/i18n/cauca/fr-material.json +106 -0
- package/src/assets/images/loading.gif +0 -0
- package/src/lib/cauca-material.component.html +1 -0
- package/src/lib/cauca-material.component.spec.ts +29 -0
- package/src/lib/cauca-material.component.ts +12 -0
- package/src/lib/cauca-material.service.spec.ts +16 -0
- package/src/lib/cauca-material.service.ts +7 -0
- package/src/lib/components/button/button.component.html +52 -0
- package/src/lib/components/button/button.component.scss +6 -0
- package/src/lib/components/button/button.component.spec.ts +142 -0
- package/src/lib/components/button/button.component.ts +22 -0
- package/src/lib/components/buttons/base-button.ts +35 -0
- package/src/lib/components/buttons/basic-button/basic-button.component.html +5 -0
- package/src/lib/components/buttons/basic-button/basic-button.component.scss +12 -0
- package/src/lib/components/buttons/basic-button/basic-button.component.spec.ts +106 -0
- package/src/lib/components/buttons/basic-button/basic-button.component.ts +17 -0
- package/src/lib/components/buttons/fab-button/fab-button.component.html +3 -0
- package/src/lib/components/buttons/fab-button/fab-button.component.scss +12 -0
- package/src/lib/components/buttons/fab-button/fab-button.component.spec.ts +82 -0
- package/src/lib/components/buttons/fab-button/fab-button.component.ts +16 -0
- package/src/lib/components/buttons/flat-button/flat-button.component.html +5 -0
- package/src/lib/components/buttons/flat-button/flat-button.component.scss +12 -0
- package/src/lib/components/buttons/flat-button/flat-button.component.spec.ts +106 -0
- package/src/lib/components/buttons/flat-button/flat-button.component.ts +17 -0
- package/src/lib/components/buttons/icon-button/icon-button.component.html +3 -0
- package/src/lib/components/buttons/icon-button/icon-button.component.scss +23 -0
- package/src/lib/components/buttons/icon-button/icon-button.component.spec.ts +38 -0
- package/src/lib/components/buttons/icon-button/icon-button.component.ts +15 -0
- package/src/lib/components/buttons/link-button/link-button.component.html +1 -0
- package/src/lib/components/buttons/link-button/link-button.component.scss +3 -0
- package/src/lib/components/buttons/link-button/link-button.component.spec.ts +97 -0
- package/src/lib/components/buttons/link-button/link-button.component.ts +25 -0
- package/src/lib/components/buttons/menu-item/menu-item.component.html +5 -0
- package/src/lib/components/buttons/menu-item/menu-item.component.scss +6 -0
- package/src/lib/components/buttons/menu-item/menu-item.component.spec.ts +66 -0
- package/src/lib/components/buttons/menu-item/menu-item.component.ts +19 -0
- package/src/lib/components/buttons/raised-button/raised-button.component.html +5 -0
- package/src/lib/components/buttons/raised-button/raised-button.component.scss +12 -0
- package/src/lib/components/buttons/raised-button/raised-button.component.spec.ts +108 -0
- package/src/lib/components/buttons/raised-button/raised-button.component.ts +17 -0
- package/src/lib/components/buttons/refresh-button/refresh-button.component.html +1 -0
- package/src/lib/components/buttons/refresh-button/refresh-button.component.scss +0 -0
- package/src/lib/components/buttons/refresh-button/refresh-button.component.spec.ts +81 -0
- package/src/lib/components/buttons/refresh-button/refresh-button.component.ts +19 -0
- package/src/lib/components/buttons/round-button/round-button.component.html +3 -0
- package/src/lib/components/buttons/round-button/round-button.component.scss +34 -0
- package/src/lib/components/buttons/round-button/round-button.component.spec.ts +26 -0
- package/src/lib/components/buttons/round-button/round-button.component.ts +14 -0
- package/src/lib/components/buttons/stroked-button/stroked-button.component.html +5 -0
- package/src/lib/components/buttons/stroked-button/stroked-button.component.scss +23 -0
- package/src/lib/components/buttons/stroked-button/stroked-button.component.spec.ts +114 -0
- package/src/lib/components/buttons/stroked-button/stroked-button.component.ts +17 -0
- package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.html +9 -0
- package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.scss +7 -0
- package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.spec.ts +68 -0
- package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.ts +155 -0
- package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.html +6 -0
- package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.scss +25 -0
- package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.spec.ts +23 -0
- package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.ts +23 -0
- package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.html +77 -0
- package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.scss +124 -0
- package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.spec.ts +96 -0
- package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.ts +228 -0
- package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.html +9 -0
- package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.scss +15 -0
- package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.spec.ts +105 -0
- package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.ts +48 -0
- package/src/lib/components/cauca-date-time-picker/models/dialog-date-time-picker-data.ts +29 -0
- package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.html +14 -0
- package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.scss +3 -0
- package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.ts +87 -0
- package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.html +12 -0
- package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.scss +3 -0
- package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.spec.ts +35 -0
- package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.ts +57 -0
- package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.html +49 -0
- package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.ts +56 -0
- package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.html +11 -0
- package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.scss +4 -0
- package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.spec.ts +39 -0
- package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.ts +20 -0
- package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.html +7 -0
- package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.scss +41 -0
- package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.spec.ts +24 -0
- package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.ts +67 -0
- package/src/lib/components/deprecated-components/shared/models/menu-item.ts +11 -0
- package/src/lib/components/deprecated-components/shared/models/simple-dialog-data.ts +5 -0
- package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.html +10 -0
- package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.scss +14 -0
- package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.spec.ts +90 -0
- package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.ts +41 -0
- package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.html +11 -0
- package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.scss +29 -0
- package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.spec.ts +137 -0
- package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.ts +47 -0
- package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.html +17 -0
- package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.scss +14 -0
- package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.spec.ts +96 -0
- package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.ts +40 -0
- package/src/lib/components/dialogs/delete-dialog/models/delete-dialog-data.spec.ts +7 -0
- package/src/lib/components/dialogs/delete-dialog/models/delete-dialog-data.ts +5 -0
- package/src/lib/components/dialogs/dialog-styles.css +9 -0
- package/src/lib/components/dialogs/dialog-styles.scss +9 -0
- package/src/lib/components/dialogs/error-dialog/error-dialog.component.html +10 -0
- package/src/lib/components/dialogs/error-dialog/error-dialog.component.scss +10 -0
- package/src/lib/components/dialogs/error-dialog/error-dialog.component.spec.ts +91 -0
- package/src/lib/components/dialogs/error-dialog/error-dialog.component.ts +32 -0
- package/src/lib/components/dialogs/services/dialog.service.spec.ts +82 -0
- package/src/lib/components/dialogs/services/dialog.service.ts +107 -0
- package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.html +24 -0
- package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.scss +22 -0
- package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.spec.ts +126 -0
- package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.ts +66 -0
- package/src/lib/components/inputs/color-picker/color-picker.component.html +9 -0
- package/src/lib/components/inputs/color-picker/color-picker.component.scss +0 -0
- package/src/lib/components/inputs/color-picker/color-picker.component.spec.ts +29 -0
- package/src/lib/components/inputs/color-picker/color-picker.component.ts +111 -0
- package/src/lib/components/inputs/date-range-picker/date-range-picker.component.html +13 -0
- package/src/lib/components/inputs/date-range-picker/date-range-picker.component.scss +0 -0
- package/src/lib/components/inputs/date-range-picker/date-range-picker.component.spec.ts +80 -0
- package/src/lib/components/inputs/date-range-picker/date-range-picker.component.ts +46 -0
- package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.html +40 -0
- package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.scss +39 -0
- package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.spec.ts +135 -0
- package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.ts +263 -0
- package/src/lib/components/inputs/password/password-criteria/password-criteria.component.html +6 -0
- package/src/lib/components/inputs/password/password-criteria/password-criteria.component.scss +27 -0
- package/src/lib/components/inputs/password/password-criteria/password-criteria.component.spec.ts +90 -0
- package/src/lib/components/inputs/password/password-criteria/password-criteria.component.ts +17 -0
- package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.html +5 -0
- package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.scss +8 -0
- package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.spec.ts +98 -0
- package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.ts +16 -0
- package/src/lib/components/inputs/password/password-input/password-input.component.html +11 -0
- package/src/lib/components/inputs/password/password-input/password-input.component.scss +12 -0
- package/src/lib/components/inputs/password/password-input/password-input.component.spec.ts +141 -0
- package/src/lib/components/inputs/password/password-input/password-input.component.ts +67 -0
- package/src/lib/components/inputs/password/password-selection/password-selection.component.html +15 -0
- package/src/lib/components/inputs/password/password-selection/password-selection.component.scss +32 -0
- package/src/lib/components/inputs/password/password-selection/password-selection.component.spec.ts +138 -0
- package/src/lib/components/inputs/password/password-selection/password-selection.component.ts +101 -0
- package/src/lib/components/inputs/select-with-search/select-with-search.component.html +19 -0
- package/src/lib/components/inputs/select-with-search/select-with-search.component.scss +0 -0
- package/src/lib/components/inputs/select-with-search/select-with-search.component.spec.ts +215 -0
- package/src/lib/components/inputs/select-with-search/select-with-search.component.ts +108 -0
- package/src/lib/components/layout/expandable-panel/expandable-panel.component.html +14 -0
- package/src/lib/components/layout/expandable-panel/expandable-panel.component.scss +48 -0
- package/src/lib/components/layout/expandable-panel/expandable-panel.component.spec.ts +48 -0
- package/src/lib/components/layout/expandable-panel/expandable-panel.component.ts +19 -0
- package/src/lib/components/layout/group-container/group-container.component.html +6 -0
- package/src/lib/components/layout/group-container/group-container.component.scss +22 -0
- package/src/lib/components/layout/group-container/group-container.component.spec.ts +34 -0
- package/src/lib/components/layout/group-container/group-container.component.ts +14 -0
- package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.html +13 -0
- package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.scss +27 -0
- package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.spec.ts +144 -0
- package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.ts +52 -0
- package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.html +4 -0
- package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.scss +10 -0
- package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.spec.ts +80 -0
- package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.ts +28 -0
- package/src/lib/components/layout/page-title/page-title.component.html +28 -0
- package/src/lib/components/layout/page-title/page-title.component.scss +40 -0
- package/src/lib/components/layout/page-title/page-title.component.spec.ts +162 -0
- package/src/lib/components/layout/page-title/page-title.component.ts +28 -0
- package/src/lib/components/layout/sections/main-section/main-section.component.html +6 -0
- package/src/lib/components/layout/sections/main-section/main-section.component.scss +27 -0
- package/src/lib/components/layout/sections/main-section/main-section.component.spec.ts +42 -0
- package/src/lib/components/layout/sections/main-section/main-section.component.ts +13 -0
- package/src/lib/components/layout/sections/section-column/section-column.component.html +3 -0
- package/src/lib/components/layout/sections/section-column/section-column.component.scss +18 -0
- package/src/lib/components/layout/sections/section-column/section-column.component.spec.ts +35 -0
- package/src/lib/components/layout/sections/section-column/section-column.component.ts +12 -0
- package/src/lib/components/layout/sections/section-field/section-field.component.html +21 -0
- package/src/lib/components/layout/sections/section-field/section-field.component.scss +44 -0
- package/src/lib/components/layout/sections/section-field/section-field.component.spec.ts +74 -0
- package/src/lib/components/layout/sections/section-field/section-field.component.ts +22 -0
- package/src/lib/components/list-paginator/list-paginator.component.html +16 -0
- package/src/lib/components/list-paginator/list-paginator.component.scss +46 -0
- package/src/lib/components/list-paginator/list-paginator.component.spec.ts +248 -0
- package/src/lib/components/list-paginator/list-paginator.component.ts +81 -0
- package/src/lib/components/misc/loading-error/loading-error.component.html +11 -0
- package/src/lib/components/misc/loading-error/loading-error.component.scss +0 -0
- package/src/lib/components/misc/loading-error/loading-error.component.spec.ts +75 -0
- package/src/lib/components/misc/loading-error/loading-error.component.ts +18 -0
- package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.html +3 -0
- package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.scss +0 -0
- package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.spec.ts +43 -0
- package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.ts +16 -0
- package/src/lib/components/misc/snack-bar/snack-bar.component.html +16 -0
- package/src/lib/components/misc/snack-bar/snack-bar.component.scss +84 -0
- package/src/lib/components/misc/snack-bar/snack-bar.component.spec.ts +136 -0
- package/src/lib/components/misc/snack-bar/snack-bar.component.ts +39 -0
- package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.html +11 -0
- package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.scss +0 -0
- package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.spec.ts +67 -0
- package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.ts +15 -0
- package/src/lib/components/notifications/saving-error-box/saving-error-box.component.html +11 -0
- package/src/lib/components/notifications/saving-error-box/saving-error-box.component.scss +0 -0
- package/src/lib/components/notifications/saving-error-box/saving-error-box.component.spec.ts +77 -0
- package/src/lib/components/notifications/saving-error-box/saving-error-box.component.ts +17 -0
- package/src/lib/components/presenters/badge/badge.component.html +6 -0
- package/src/lib/components/presenters/badge/badge.component.scss +10 -0
- package/src/lib/components/presenters/badge/badge.component.spec.ts +41 -0
- package/src/lib/components/presenters/badge/badge.component.ts +18 -0
- package/src/lib/components/presenters/icon/icon.component.scss +9 -0
- package/src/lib/components/presenters/icon/icon.component.spec.ts +38 -0
- package/src/lib/components/presenters/icon/icon.component.ts +37 -0
- package/src/lib/core/breadcrumb.service.spec.ts +35 -0
- package/src/lib/core/breadcrumb.service.ts +24 -0
- package/src/lib/core/directives/auto-trim-and-lower.directive.spec.ts +22 -0
- package/src/lib/core/directives/auto-trim-and-lower.directive.ts +19 -0
- package/src/lib/core/directives/form-error/form-error.module.ts +21 -0
- package/src/lib/core/directives/form-error/has-error-root.directive.ts +31 -0
- package/src/lib/core/directives/form-error/has-error.directive.ts +95 -0
- package/src/lib/core/loading-state.service.spec.ts +57 -0
- package/src/lib/core/loading-state.service.ts +44 -0
- package/src/lib/core/models/breadcrumb-location.ts +6 -0
- package/src/lib/core/models/password-validation.ts +20 -0
- package/src/lib/core/validators/password/password-validator.spec.ts +155 -0
- package/src/lib/core/validators/password/password-validator.ts +30 -0
- package/src/lib/provide-cauca-material.ts +10 -0
- package/src/public-api.ts +70 -0
- package/src/test.ts +17 -0
- package/tsconfig.lib.json +18 -0
- package/tsconfig.lib.prod.json +4 -0
- package/tsconfig.spec.json +17 -0
- package/fesm2022/cauca-911-material.mjs +0 -4323
- package/fesm2022/cauca-911-material.mjs.map +0 -1
- package/types/cauca-911-material.d.ts +0 -755
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
4
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
5
|
+
import { CaucaCoreModule } from '@cauca-911/core';
|
|
6
|
+
import { CaucaInputMultipleLangueComponent } from './cauca-input-multiple-langue.component';
|
|
7
|
+
|
|
8
|
+
describe('CaucaInputMultipleLangueComponent', () => {
|
|
9
|
+
let component: CaucaInputMultipleLangueComponent;
|
|
10
|
+
let fixture: ComponentFixture<CaucaInputMultipleLangueComponent>;
|
|
11
|
+
|
|
12
|
+
beforeEach(waitForAsync(() => {
|
|
13
|
+
TestBed.configureTestingModule({
|
|
14
|
+
imports: [
|
|
15
|
+
CaucaInputMultipleLangueComponent,
|
|
16
|
+
CaucaCoreModule,
|
|
17
|
+
FormsModule,
|
|
18
|
+
ReactiveFormsModule,
|
|
19
|
+
MatFormFieldModule,
|
|
20
|
+
MatTabsModule,
|
|
21
|
+
]
|
|
22
|
+
})
|
|
23
|
+
.compileComponents();
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
beforeEach(() => {
|
|
27
|
+
fixture = TestBed.createComponent(CaucaInputMultipleLangueComponent);
|
|
28
|
+
component = fixture.componentInstance;
|
|
29
|
+
fixture.detectChanges();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should create', () => {
|
|
33
|
+
expect(component).toBeTruthy();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Component, Input, OnInit, inject } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import {ReactiveFormsModule, UntypedFormControl, Validators} from '@angular/forms';
|
|
4
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
5
|
+
import { MatInput } from '@angular/material/input';
|
|
6
|
+
import { MatTab, MatTabGroup } from '@angular/material/tabs';
|
|
7
|
+
import {Configuration, CaucaCoreService, TranslateService} from '@cauca-911/core';
|
|
8
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'cauca-input-multiple-langue',
|
|
12
|
+
templateUrl: './cauca-input-multiple-langue.component.html',
|
|
13
|
+
styleUrls: ['./cauca-input-multiple-langue.component.scss'],
|
|
14
|
+
imports: [MatTabGroup, MatTab, MatInput, MatFormFieldModule, ReactiveFormsModule, TranslateModule]
|
|
15
|
+
})
|
|
16
|
+
export class CaucaInputMultipleLangueComponent implements OnInit {
|
|
17
|
+
|
|
18
|
+
@Input()
|
|
19
|
+
public value: string[] = [];
|
|
20
|
+
public config: Configuration;
|
|
21
|
+
public forms: UntypedFormControl[] = [];
|
|
22
|
+
public labels: string[] = [];
|
|
23
|
+
public selectedIndex = 0;
|
|
24
|
+
|
|
25
|
+
private readonly translate = inject(TranslateService);
|
|
26
|
+
|
|
27
|
+
public constructor() {
|
|
28
|
+
const coreService = inject(CaucaCoreService);
|
|
29
|
+
this.config = coreService.getConfig();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public ngOnInit(): void {
|
|
33
|
+
this.translate.get(this.config.languages).subscribe((labels: any) => {
|
|
34
|
+
for (const i in labels) {
|
|
35
|
+
if (labels[i]) {
|
|
36
|
+
this.labels.push(labels[i]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
this.initializeForms();
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public onTagChanged(tabIndex: number): void {
|
|
44
|
+
console.log('cauca-material, onTabChanged', tabIndex);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public getErrorMessage(index: any): string {
|
|
48
|
+
return this.forms[index].hasError('required') ? 'error.required' : '';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private initializeForms(): void {
|
|
52
|
+
this.labels.forEach((item: any, index: number) => {
|
|
53
|
+
this.forms[index] = new UntypedFormControl('', [Validators.required]);
|
|
54
|
+
this.forms[index].setValue(this.value[index] || '');
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@for (menu of menuItems; track menu) {
|
|
2
|
+
<h4 [class]="menu.activated ? 'selected' : ''">
|
|
3
|
+
<div (click)="goTo(menu.path, $event)" class="menu">
|
|
4
|
+
@if (menu.icon) {
|
|
5
|
+
<div class="menu-icon">
|
|
6
|
+
@if (isIconArray(menu.icon)) {
|
|
7
|
+
<fa-icon [icon]="menu.icon"></fa-icon>
|
|
8
|
+
}
|
|
9
|
+
@if (!isIconArray(menu.icon)) {
|
|
10
|
+
<img [src]="menu.icon" />
|
|
11
|
+
}
|
|
12
|
+
</div>
|
|
13
|
+
}
|
|
14
|
+
@if (menu.label) {
|
|
15
|
+
<div class="menu-caption">
|
|
16
|
+
<span>{{menu.label | translate}}</span>
|
|
17
|
+
</div>
|
|
18
|
+
}
|
|
19
|
+
</div>
|
|
20
|
+
@if (menu.childs.length && menu.activated) {
|
|
21
|
+
<div class="submenu">
|
|
22
|
+
@for (submenu of menu.childs; track submenu) {
|
|
23
|
+
<div
|
|
24
|
+
[class]="submenu.activated ? 'menu selected' : 'menu'"
|
|
25
|
+
(click)="goTo(submenu.path, $event)">
|
|
26
|
+
@if (!submenu.icon) {
|
|
27
|
+
<div class="menu-dot">•</div>
|
|
28
|
+
}
|
|
29
|
+
@if (submenu.icon) {
|
|
30
|
+
<div class="menu-icon">
|
|
31
|
+
@if (isIconArray(submenu.icon)) {
|
|
32
|
+
<fa-icon [icon]="submenu.icon"></fa-icon>
|
|
33
|
+
}
|
|
34
|
+
@if (!isIconArray(submenu.icon)) {
|
|
35
|
+
<img [src]="submenu.icon" />
|
|
36
|
+
}
|
|
37
|
+
</div>
|
|
38
|
+
}
|
|
39
|
+
@if (submenu.label) {
|
|
40
|
+
<div class="menu-caption">
|
|
41
|
+
<span>{{submenu.label | translate}}</span>
|
|
42
|
+
</div>
|
|
43
|
+
}
|
|
44
|
+
</div>
|
|
45
|
+
}
|
|
46
|
+
</div>
|
|
47
|
+
}
|
|
48
|
+
</h4>
|
|
49
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output, inject } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import {NavigationEnd, Router} from '@angular/router';
|
|
4
|
+
import {MenuItem} from '../shared/models/menu-item';
|
|
5
|
+
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
|
|
6
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'cauca-menu-vertical',
|
|
10
|
+
templateUrl: './cauca-menu-vertical.component.html',
|
|
11
|
+
styleUrls: ['./cauca-menu-vertical.component.scss'],
|
|
12
|
+
imports: [
|
|
13
|
+
FaIconComponent,
|
|
14
|
+
TranslateModule
|
|
15
|
+
]
|
|
16
|
+
})
|
|
17
|
+
export class CaucaMenuVerticalComponent {
|
|
18
|
+
|
|
19
|
+
@Output() public itemClick = new EventEmitter();
|
|
20
|
+
@Input() public menuItems: MenuItem[] = [];
|
|
21
|
+
|
|
22
|
+
private readonly router = inject(Router);
|
|
23
|
+
|
|
24
|
+
public constructor() {
|
|
25
|
+
this.router.events.subscribe((route: NavigationEnd) => {
|
|
26
|
+
if (route instanceof NavigationEnd) {
|
|
27
|
+
this.selectActiveRoute(route);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public goTo(path: string, e: any): void {
|
|
33
|
+
this.router.navigate([path]);
|
|
34
|
+
this.itemClick.emit();
|
|
35
|
+
|
|
36
|
+
e.stopPropagation();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public isIconArray(icon: string | string[] | null | undefined): icon is string[] {
|
|
40
|
+
return Array.isArray(icon);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
private selectActiveRoute(route: NavigationEnd): void {
|
|
44
|
+
this.menuItems.forEach((menu: MenuItem) => {
|
|
45
|
+
if (route.url) {
|
|
46
|
+
menu.activated = (route.url === menu.path || (menu.childs.length && route.url.indexOf(menu.path) > -1));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
menu.childs.forEach((subMenu: MenuItem) => {
|
|
50
|
+
if (route.url) {
|
|
51
|
+
subMenu.activated = (route.url === subMenu.path || route.urlAfterRedirects === subMenu.path);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<h1 mat-dialog-title>{{data.title}}</h1>
|
|
2
|
+
<div mat-dialog-content>
|
|
3
|
+
<div [innerHTML]="data.message"></div>
|
|
4
|
+
</div>
|
|
5
|
+
@if (data.buttons) {
|
|
6
|
+
<div mat-dialog-actions>
|
|
7
|
+
@for (label of data.buttons; track label; let i = $index) {
|
|
8
|
+
<button mat-raised-button (click)="onClick(i)">{{label}}</button>
|
|
9
|
+
}
|
|
10
|
+
</div>
|
|
11
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
+
import {
|
|
3
|
+
MAT_DIALOG_DATA,
|
|
4
|
+
MatDialogModule,
|
|
5
|
+
MatDialogRef
|
|
6
|
+
} from '@angular/material/dialog';
|
|
7
|
+
import { CaucaSimpleDialogComponent } from './cauca-simple-dialog.component';
|
|
8
|
+
|
|
9
|
+
describe('CaucaSimpleDialogComponent', () => {
|
|
10
|
+
let component: CaucaSimpleDialogComponent;
|
|
11
|
+
let fixture: ComponentFixture<CaucaSimpleDialogComponent>;
|
|
12
|
+
|
|
13
|
+
beforeEach(waitForAsync(() => {
|
|
14
|
+
TestBed.configureTestingModule({
|
|
15
|
+
imports: [
|
|
16
|
+
CaucaSimpleDialogComponent,
|
|
17
|
+
MatDialogModule,
|
|
18
|
+
],
|
|
19
|
+
providers: [{
|
|
20
|
+
provide: MatDialogRef,
|
|
21
|
+
useValue: {}
|
|
22
|
+
}, {
|
|
23
|
+
provide: MAT_DIALOG_DATA,
|
|
24
|
+
useValue: {}
|
|
25
|
+
}]
|
|
26
|
+
})
|
|
27
|
+
.compileComponents();
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
fixture = TestBed.createComponent(CaucaSimpleDialogComponent);
|
|
32
|
+
component = fixture.componentInstance;
|
|
33
|
+
fixture.detectChanges();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should create', () => {
|
|
37
|
+
expect(component).toBeTruthy();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component, inject } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef, MatDialogTitle } from '@angular/material/dialog';
|
|
4
|
+
import { SimpleDialogData } from '../shared/models/simple-dialog-data';
|
|
5
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'cauca-simple-dialog',
|
|
9
|
+
templateUrl: './cauca-simple-dialog.component.html',
|
|
10
|
+
styleUrls: ['./cauca-simple-dialog.component.scss'],
|
|
11
|
+
imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButtonModule]
|
|
12
|
+
})
|
|
13
|
+
export class CaucaSimpleDialogComponent{
|
|
14
|
+
public readonly data = inject<SimpleDialogData>(MAT_DIALOG_DATA);
|
|
15
|
+
private readonly dialogRef = inject<MatDialogRef<CaucaSimpleDialogComponent>>(MatDialogRef);
|
|
16
|
+
|
|
17
|
+
public onClick(buttonIndex: number): void {
|
|
18
|
+
this.dialogRef.close(buttonIndex);
|
|
19
|
+
}
|
|
20
|
+
}
|
package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.scss
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.slideshow {
|
|
2
|
+
margin: 0 auto;
|
|
3
|
+
position: relative;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.slideshow > div {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
position: absolute;
|
|
11
|
+
transition: transform 500ms ease-in, opacity 500ms ease-in;
|
|
12
|
+
|
|
13
|
+
/* Default state - off-screen to the right, ready to enter */
|
|
14
|
+
transform: translateX(100%);
|
|
15
|
+
opacity: 0;
|
|
16
|
+
|
|
17
|
+
&.active {
|
|
18
|
+
/* Active slide - centered */
|
|
19
|
+
transform: translateX(0%);
|
|
20
|
+
opacity: 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.leaving {
|
|
24
|
+
/* Leaving slide - move off-screen to the left */
|
|
25
|
+
transform: translateX(-100%);
|
|
26
|
+
opacity: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.entering {
|
|
30
|
+
/* Entering slide - animate from right to center */
|
|
31
|
+
transform: translateX(0%);
|
|
32
|
+
opacity: 1;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
img {
|
|
37
|
+
max-height: 100%;
|
|
38
|
+
max-width: 100%;
|
|
39
|
+
margin: 0 auto;
|
|
40
|
+
display: block;
|
|
41
|
+
}
|
package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.spec.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
+
import { CaucaSlideshowComponent } from './cauca-slideshow.component';
|
|
3
|
+
|
|
4
|
+
describe('CaucaSlideshowComponent', () => {
|
|
5
|
+
let component: CaucaSlideshowComponent;
|
|
6
|
+
let fixture: ComponentFixture<CaucaSlideshowComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(waitForAsync(() => {
|
|
9
|
+
TestBed.configureTestingModule({
|
|
10
|
+
imports: [ CaucaSlideshowComponent ]
|
|
11
|
+
})
|
|
12
|
+
.compileComponents();
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(CaucaSlideshowComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Component, OnInit, ElementRef, Input, ViewChild } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'cauca-slideshow',
|
|
6
|
+
templateUrl: './cauca-slideshow.component.html',
|
|
7
|
+
styleUrls: ['./cauca-slideshow.component.scss'],
|
|
8
|
+
imports: [],
|
|
9
|
+
})
|
|
10
|
+
export class CaucaSlideshowComponent implements OnInit {
|
|
11
|
+
@ViewChild('container', { static: true })
|
|
12
|
+
public container: ElementRef;
|
|
13
|
+
@Input()
|
|
14
|
+
public height = '150px';
|
|
15
|
+
@Input()
|
|
16
|
+
public autoPlay = true;
|
|
17
|
+
public states = [];
|
|
18
|
+
public selectedIndex = 0;
|
|
19
|
+
|
|
20
|
+
private timer = null;
|
|
21
|
+
private items = [];
|
|
22
|
+
|
|
23
|
+
@Input()
|
|
24
|
+
public set images(list: string[]) {
|
|
25
|
+
this.items = list;
|
|
26
|
+
this.restart();
|
|
27
|
+
}
|
|
28
|
+
public get images(): string[] {
|
|
29
|
+
return this.items;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public ngOnInit(): void {
|
|
33
|
+
this.container.nativeElement.style.height = this.height;
|
|
34
|
+
this.container.nativeElement.style.width = '100%';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public getState(index: number): string {
|
|
38
|
+
if (this.states[index]) {
|
|
39
|
+
return this.states[index];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (this.selectedIndex === index ? 'in' : 'out');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public restart(): void {
|
|
46
|
+
if (this.timer) {
|
|
47
|
+
window.clearInterval(this.timer);
|
|
48
|
+
}
|
|
49
|
+
if (this.images && this.images.length) {
|
|
50
|
+
this.timer = window.setInterval(() => this.changed('next'), 5000);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public next(): void {
|
|
55
|
+
if (this.selectedIndex < this.items.length - 1) {
|
|
56
|
+
this.selectedIndex++;
|
|
57
|
+
} else {
|
|
58
|
+
this.selectedIndex = 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private changed(action: string): void {
|
|
63
|
+
this.states[this.selectedIndex] = 'out';
|
|
64
|
+
this[action]();
|
|
65
|
+
this.states[this.selectedIndex] = 'in';
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<div mat-dialog-title>
|
|
2
|
+
<div class="h6">{{ title | translate }}</div>
|
|
3
|
+
<cauca-icon-button id="closeButton" (buttonClick)="closeClick()" icon="close" />
|
|
4
|
+
</div>
|
|
5
|
+
<div class="alert-dialog-content" mat-dialog-content>
|
|
6
|
+
<p>{{ message | translate }}</p>
|
|
7
|
+
</div>
|
|
8
|
+
<mat-dialog-actions align="end">
|
|
9
|
+
<cauca-raised-button id="okButton" label="ok" color="primary" (buttonClick)="closeClick()" />
|
|
10
|
+
</mat-dialog-actions>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { AlertDialogComponent } from './alert-dialog.component';
|
|
4
|
+
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|
5
|
+
import { TranslateModule, TranslatePipe } from '@ngx-translate/core';
|
|
6
|
+
import { MockComponents, MockModule, MockPipe, ngMocks } from 'ng-mocks';
|
|
7
|
+
import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout';
|
|
8
|
+
import { of } from 'rxjs';
|
|
9
|
+
import { IconButtonComponent } from '../../buttons/icon-button/icon-button.component';
|
|
10
|
+
import { RaisedButtonComponent } from '../../buttons/raised-button/raised-button.component';
|
|
11
|
+
|
|
12
|
+
describe('AlertDialogComponent', () => {
|
|
13
|
+
let component: AlertDialogComponent;
|
|
14
|
+
let fixture: ComponentFixture<AlertDialogComponent>;
|
|
15
|
+
let mockMatDialog: any;
|
|
16
|
+
let breakpointObserverMock: jasmine.SpyObj<BreakpointObserver>;
|
|
17
|
+
|
|
18
|
+
beforeEach(async () => {
|
|
19
|
+
breakpointObserverMock = jasmine.createSpyObj('BreakpointObserver', ['observe']);
|
|
20
|
+
breakpointObserverMock.observe.and.returnValue(of({ matches: true, breakpoints: {} }));
|
|
21
|
+
|
|
22
|
+
mockMatDialog = jasmine.createSpyObj('MatDialogRef', ['close', 'addPanelClass', 'updateSize']);
|
|
23
|
+
await TestBed.configureTestingModule({
|
|
24
|
+
imports: [
|
|
25
|
+
AlertDialogComponent,
|
|
26
|
+
MockModule(TranslateModule)
|
|
27
|
+
],
|
|
28
|
+
declarations: [
|
|
29
|
+
MockPipe(TranslatePipe, value => value),
|
|
30
|
+
...MockComponents(IconButtonComponent, RaisedButtonComponent)
|
|
31
|
+
],
|
|
32
|
+
providers: [
|
|
33
|
+
{ provide: MatDialogRef, useValue: mockMatDialog },
|
|
34
|
+
{ provide: MAT_DIALOG_DATA, useValue: [] },
|
|
35
|
+
{ provide: BreakpointObserver, useValue: breakpointObserverMock },
|
|
36
|
+
]
|
|
37
|
+
})
|
|
38
|
+
.compileComponents();
|
|
39
|
+
|
|
40
|
+
fixture = TestBed.createComponent(AlertDialogComponent);
|
|
41
|
+
component = fixture.componentInstance;
|
|
42
|
+
fixture.detectChanges();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should create', () => {
|
|
46
|
+
expect(component).toBeTruthy();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should initially add a global style class', () => {
|
|
50
|
+
expect(mockMatDialog.addPanelClass).toHaveBeenCalledWith('dialog-global-style');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('should update dialog size when breakpoint matches', fakeAsync(() => {
|
|
54
|
+
mockMatDialog.updateSize.calls.reset();
|
|
55
|
+
const breakpointState: BreakpointState = { matches: true, breakpoints: {} };
|
|
56
|
+
breakpointObserverMock.observe.and.returnValue(of(breakpointState));
|
|
57
|
+
|
|
58
|
+
TestBed.createComponent(AlertDialogComponent);
|
|
59
|
+
fixture.detectChanges();
|
|
60
|
+
|
|
61
|
+
expect(mockMatDialog.updateSize).toHaveBeenCalledWith('100vw');
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
it('should update dialog size when breakpoint does not match', fakeAsync(() => {
|
|
65
|
+
mockMatDialog.updateSize.calls.reset();
|
|
66
|
+
const breakpointState: BreakpointState = { matches: false, breakpoints: {} };
|
|
67
|
+
breakpointObserverMock.observe.and.returnValue(of(breakpointState));
|
|
68
|
+
|
|
69
|
+
TestBed.createComponent(AlertDialogComponent);
|
|
70
|
+
fixture.detectChanges();
|
|
71
|
+
|
|
72
|
+
expect(mockMatDialog.updateSize).toHaveBeenCalledWith('auto');
|
|
73
|
+
}));
|
|
74
|
+
|
|
75
|
+
it('should close dialog when pressing ok', async () => {
|
|
76
|
+
const closeButton = ngMocks.find<RaisedButtonComponent>('#okButton', null)?.componentInstance;
|
|
77
|
+
|
|
78
|
+
closeButton.buttonClick.emit();
|
|
79
|
+
|
|
80
|
+
expect(mockMatDialog.close).toHaveBeenCalled();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('should close dialog when pressing close', async () => {
|
|
84
|
+
const closeButton = ngMocks.find<IconButtonComponent>('#closeButton', null)?.componentInstance;
|
|
85
|
+
|
|
86
|
+
closeButton.buttonClick.emit();
|
|
87
|
+
|
|
88
|
+
expect(mockMatDialog.close).toHaveBeenCalled();
|
|
89
|
+
});
|
|
90
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Component, Inject } from '@angular/core';
|
|
2
|
+
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import { ConfirmationOptions } from '../services/dialog.service';
|
|
4
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
7
|
+
import { RaisedButtonComponent } from '../../buttons/raised-button/raised-button.component';
|
|
8
|
+
import { IconButtonComponent } from '../../buttons/icon-button/icon-button.component';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'cauca-alert-dialog',
|
|
12
|
+
templateUrl: './alert-dialog.component.html',
|
|
13
|
+
styleUrls: ['./alert-dialog.component.scss'],
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [TranslateModule, RaisedButtonComponent, IconButtonComponent, MatDialogModule]
|
|
16
|
+
})
|
|
17
|
+
export class AlertDialogComponent {
|
|
18
|
+
|
|
19
|
+
public title: string = '';
|
|
20
|
+
public message: string = '';
|
|
21
|
+
|
|
22
|
+
public constructor(
|
|
23
|
+
public dialogRef: MatDialogRef<AlertDialogComponent>,
|
|
24
|
+
@Inject(MAT_DIALOG_DATA) public data: AlertDialogData,
|
|
25
|
+
breakdownObserver: BreakpointObserver) {
|
|
26
|
+
this.title = data.title;
|
|
27
|
+
this.message = data.message;
|
|
28
|
+
dialogRef.addPanelClass("dialog-global-style");
|
|
29
|
+
breakdownObserver.observe('(max-width: 500px)').pipe(takeUntilDestroyed()).subscribe(result => dialogRef.updateSize(result.matches ? '100vw' : 'auto'));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public closeClick(): void {
|
|
33
|
+
this.dialogRef.close();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface AlertDialogData {
|
|
38
|
+
title: string;
|
|
39
|
+
message: string;
|
|
40
|
+
options: ConfirmationOptions;
|
|
41
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<div mat-dialog-title>
|
|
2
|
+
<div class="h6 title">{{ title | translate: options.titleArgs }}</div>
|
|
3
|
+
<cauca-icon-button id="close-button" (buttonClick)="cancelClick()" icon="close" />
|
|
4
|
+
</div>
|
|
5
|
+
<div mat-dialog-content>
|
|
6
|
+
<p class="message">{{ message | translate: options.messageArgs }}</p>
|
|
7
|
+
</div>
|
|
8
|
+
<mat-dialog-actions align="end" class="action-buttons">
|
|
9
|
+
<cauca-stroked-button class="no-button" [label]="options.noText" [color]="options.noColor" (buttonClick)="noClick()" />
|
|
10
|
+
<cauca-raised-button class="yes-button" [label]="options.yesText" [color]="options.yesColor" (buttonClick)="yesClick()" />
|
|
11
|
+
</mat-dialog-actions>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@use "../dialog-styles";
|
|
2
|
+
|
|
3
|
+
:host > div:first-child {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
|
|
7
|
+
div:first-child {
|
|
8
|
+
flex: 1;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.yes-button {
|
|
13
|
+
padding-left: 8px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.message {
|
|
17
|
+
white-space: pre-wrap;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.title {
|
|
21
|
+
padding-top: 8px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.action-buttons {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
gap: 8px;
|
|
29
|
+
}
|