@cauca-911/material 21.0.1 → 21.0.3
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/LICENSE +21 -0
- package/README.md +5 -24
- package/{src/assets → assets}/i18n/cauca/en-material.json +104 -104
- package/{src/assets → assets}/i18n/cauca/es-material.json +104 -104
- package/{src/assets → assets}/i18n/cauca/fr-material.json +106 -106
- package/fesm2022/cauca-911-material.mjs +4145 -0
- package/fesm2022/cauca-911-material.mjs.map +1 -0
- package/package.json +38 -23
- package/types/cauca-911-material.d.ts +745 -0
- package/.eslintrc.json +0 -79
- package/README_PACKAGE.md +0 -5
- package/cauca-911-material-21.0.0.tgz +0 -0
- package/karma.conf.js +0 -50
- package/ng-package.json +0 -7
- package/src/lib/cauca-material.component.html +0 -1
- package/src/lib/cauca-material.component.spec.ts +0 -29
- package/src/lib/cauca-material.component.ts +0 -12
- package/src/lib/cauca-material.service.spec.ts +0 -16
- package/src/lib/cauca-material.service.ts +0 -7
- package/src/lib/components/button/button.component.html +0 -52
- package/src/lib/components/button/button.component.scss +0 -6
- package/src/lib/components/button/button.component.spec.ts +0 -142
- package/src/lib/components/button/button.component.ts +0 -22
- package/src/lib/components/buttons/base-button.ts +0 -35
- package/src/lib/components/buttons/basic-button/basic-button.component.html +0 -5
- package/src/lib/components/buttons/basic-button/basic-button.component.scss +0 -12
- package/src/lib/components/buttons/basic-button/basic-button.component.spec.ts +0 -106
- package/src/lib/components/buttons/basic-button/basic-button.component.ts +0 -17
- package/src/lib/components/buttons/fab-button/fab-button.component.html +0 -3
- package/src/lib/components/buttons/fab-button/fab-button.component.scss +0 -12
- package/src/lib/components/buttons/fab-button/fab-button.component.spec.ts +0 -82
- package/src/lib/components/buttons/fab-button/fab-button.component.ts +0 -16
- package/src/lib/components/buttons/flat-button/flat-button.component.html +0 -5
- package/src/lib/components/buttons/flat-button/flat-button.component.scss +0 -12
- package/src/lib/components/buttons/flat-button/flat-button.component.spec.ts +0 -106
- package/src/lib/components/buttons/flat-button/flat-button.component.ts +0 -17
- package/src/lib/components/buttons/icon-button/icon-button.component.html +0 -3
- package/src/lib/components/buttons/icon-button/icon-button.component.scss +0 -23
- package/src/lib/components/buttons/icon-button/icon-button.component.spec.ts +0 -38
- package/src/lib/components/buttons/icon-button/icon-button.component.ts +0 -15
- package/src/lib/components/buttons/link-button/link-button.component.html +0 -1
- package/src/lib/components/buttons/link-button/link-button.component.scss +0 -3
- package/src/lib/components/buttons/link-button/link-button.component.spec.ts +0 -97
- package/src/lib/components/buttons/link-button/link-button.component.ts +0 -25
- package/src/lib/components/buttons/menu-item/menu-item.component.html +0 -5
- package/src/lib/components/buttons/menu-item/menu-item.component.scss +0 -6
- package/src/lib/components/buttons/menu-item/menu-item.component.spec.ts +0 -66
- package/src/lib/components/buttons/menu-item/menu-item.component.ts +0 -19
- package/src/lib/components/buttons/raised-button/raised-button.component.html +0 -5
- package/src/lib/components/buttons/raised-button/raised-button.component.scss +0 -12
- package/src/lib/components/buttons/raised-button/raised-button.component.spec.ts +0 -108
- package/src/lib/components/buttons/raised-button/raised-button.component.ts +0 -17
- package/src/lib/components/buttons/refresh-button/refresh-button.component.html +0 -1
- 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 +0 -81
- package/src/lib/components/buttons/refresh-button/refresh-button.component.ts +0 -19
- package/src/lib/components/buttons/round-button/round-button.component.html +0 -3
- package/src/lib/components/buttons/round-button/round-button.component.scss +0 -34
- package/src/lib/components/buttons/round-button/round-button.component.spec.ts +0 -26
- package/src/lib/components/buttons/round-button/round-button.component.ts +0 -14
- package/src/lib/components/buttons/stroked-button/stroked-button.component.html +0 -5
- package/src/lib/components/buttons/stroked-button/stroked-button.component.scss +0 -23
- package/src/lib/components/buttons/stroked-button/stroked-button.component.spec.ts +0 -114
- package/src/lib/components/buttons/stroked-button/stroked-button.component.ts +0 -17
- package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.html +0 -9
- package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.scss +0 -7
- package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.spec.ts +0 -68
- package/src/lib/components/cauca-date-time-picker/cauca-date-time-picker.component.ts +0 -155
- package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.html +0 -6
- package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.scss +0 -25
- package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.spec.ts +0 -23
- package/src/lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.ts +0 -23
- package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.html +0 -77
- package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.scss +0 -124
- package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.spec.ts +0 -96
- package/src/lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.ts +0 -228
- package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.html +0 -9
- package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.scss +0 -15
- package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.spec.ts +0 -105
- package/src/lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.ts +0 -48
- package/src/lib/components/cauca-date-time-picker/models/dialog-date-time-picker-data.ts +0 -29
- package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.html +0 -14
- package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.scss +0 -3
- package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.ts +0 -87
- package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.html +0 -12
- package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.scss +0 -3
- package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.spec.ts +0 -35
- package/src/lib/components/deprecated-components/cauca-input-multiple-langue/cauca-input-multiple-langue.component.ts +0 -57
- package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.html +0 -49
- package/src/lib/components/deprecated-components/cauca-menu-vertical/cauca-menu-vertical.component.ts +0 -56
- package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.html +0 -11
- package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.scss +0 -4
- package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.spec.ts +0 -39
- package/src/lib/components/deprecated-components/cauca-simple-dialog/cauca-simple-dialog.component.ts +0 -20
- package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.html +0 -7
- package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.scss +0 -41
- package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.spec.ts +0 -24
- package/src/lib/components/deprecated-components/cauca-slideshow/cauca-slideshow.component.ts +0 -67
- package/src/lib/components/deprecated-components/shared/models/menu-item.ts +0 -11
- package/src/lib/components/deprecated-components/shared/models/simple-dialog-data.ts +0 -5
- package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.html +0 -10
- package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.scss +0 -14
- package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.spec.ts +0 -90
- package/src/lib/components/dialogs/alert-dialog/alert-dialog.component.ts +0 -41
- package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.html +0 -11
- package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.scss +0 -29
- package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.spec.ts +0 -137
- package/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.ts +0 -47
- package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.html +0 -17
- package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.scss +0 -14
- package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.spec.ts +0 -96
- package/src/lib/components/dialogs/delete-dialog/delete-dialog.component.ts +0 -40
- package/src/lib/components/dialogs/delete-dialog/models/delete-dialog-data.spec.ts +0 -7
- package/src/lib/components/dialogs/delete-dialog/models/delete-dialog-data.ts +0 -5
- package/src/lib/components/dialogs/dialog-styles.css +0 -9
- package/src/lib/components/dialogs/dialog-styles.scss +0 -9
- package/src/lib/components/dialogs/error-dialog/error-dialog.component.html +0 -10
- package/src/lib/components/dialogs/error-dialog/error-dialog.component.scss +0 -10
- package/src/lib/components/dialogs/error-dialog/error-dialog.component.spec.ts +0 -91
- package/src/lib/components/dialogs/error-dialog/error-dialog.component.ts +0 -32
- package/src/lib/components/dialogs/services/dialog.service.spec.ts +0 -82
- package/src/lib/components/dialogs/services/dialog.service.ts +0 -107
- package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.html +0 -24
- package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.scss +0 -22
- package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.spec.ts +0 -126
- package/src/lib/components/dialogs/text-input-dialog/text-input-dialog.component.ts +0 -66
- package/src/lib/components/inputs/color-picker/color-picker.component.html +0 -9
- 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 +0 -29
- package/src/lib/components/inputs/color-picker/color-picker.component.ts +0 -111
- package/src/lib/components/inputs/date-range-picker/date-range-picker.component.html +0 -13
- 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 +0 -80
- package/src/lib/components/inputs/date-range-picker/date-range-picker.component.ts +0 -46
- package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.html +0 -40
- package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.scss +0 -39
- package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.spec.ts +0 -135
- package/src/lib/components/inputs/dropdown-chip-autocomplete/dropdown-chip-autocomplete.component.ts +0 -263
- package/src/lib/components/inputs/password/password-criteria/password-criteria.component.html +0 -6
- package/src/lib/components/inputs/password/password-criteria/password-criteria.component.scss +0 -27
- package/src/lib/components/inputs/password/password-criteria/password-criteria.component.spec.ts +0 -90
- package/src/lib/components/inputs/password/password-criteria/password-criteria.component.ts +0 -17
- package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.html +0 -5
- package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.scss +0 -8
- package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.spec.ts +0 -98
- package/src/lib/components/inputs/password/password-criteria-viewer/password-criteria-viewer.component.ts +0 -16
- package/src/lib/components/inputs/password/password-input/password-input.component.html +0 -11
- package/src/lib/components/inputs/password/password-input/password-input.component.scss +0 -12
- package/src/lib/components/inputs/password/password-input/password-input.component.spec.ts +0 -141
- package/src/lib/components/inputs/password/password-input/password-input.component.ts +0 -67
- package/src/lib/components/inputs/password/password-selection/password-selection.component.html +0 -15
- package/src/lib/components/inputs/password/password-selection/password-selection.component.scss +0 -32
- package/src/lib/components/inputs/password/password-selection/password-selection.component.spec.ts +0 -138
- package/src/lib/components/inputs/password/password-selection/password-selection.component.ts +0 -101
- package/src/lib/components/inputs/select-with-search/select-with-search.component.html +0 -19
- 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 +0 -215
- package/src/lib/components/inputs/select-with-search/select-with-search.component.ts +0 -108
- package/src/lib/components/layout/expandable-panel/expandable-panel.component.html +0 -14
- package/src/lib/components/layout/expandable-panel/expandable-panel.component.scss +0 -48
- package/src/lib/components/layout/expandable-panel/expandable-panel.component.spec.ts +0 -48
- package/src/lib/components/layout/expandable-panel/expandable-panel.component.ts +0 -19
- package/src/lib/components/layout/group-container/group-container.component.html +0 -6
- package/src/lib/components/layout/group-container/group-container.component.scss +0 -22
- package/src/lib/components/layout/group-container/group-container.component.spec.ts +0 -34
- package/src/lib/components/layout/group-container/group-container.component.ts +0 -14
- package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.html +0 -13
- package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.scss +0 -27
- package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.spec.ts +0 -144
- package/src/lib/components/layout/menu-expandable-panel/menu-expandable-panel.component.ts +0 -52
- package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.html +0 -4
- package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.scss +0 -10
- package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.spec.ts +0 -80
- package/src/lib/components/layout/menu-expandable-panel-item/menu-expandable-panel-item.component.ts +0 -28
- package/src/lib/components/layout/page-title/page-title.component.html +0 -28
- package/src/lib/components/layout/page-title/page-title.component.scss +0 -40
- package/src/lib/components/layout/page-title/page-title.component.spec.ts +0 -162
- package/src/lib/components/layout/page-title/page-title.component.ts +0 -28
- package/src/lib/components/layout/sections/main-section/main-section.component.html +0 -6
- package/src/lib/components/layout/sections/main-section/main-section.component.scss +0 -27
- package/src/lib/components/layout/sections/main-section/main-section.component.spec.ts +0 -42
- package/src/lib/components/layout/sections/main-section/main-section.component.ts +0 -13
- package/src/lib/components/layout/sections/section-column/section-column.component.html +0 -3
- package/src/lib/components/layout/sections/section-column/section-column.component.scss +0 -18
- package/src/lib/components/layout/sections/section-column/section-column.component.spec.ts +0 -35
- package/src/lib/components/layout/sections/section-column/section-column.component.ts +0 -12
- package/src/lib/components/layout/sections/section-field/section-field.component.html +0 -21
- package/src/lib/components/layout/sections/section-field/section-field.component.scss +0 -44
- package/src/lib/components/layout/sections/section-field/section-field.component.spec.ts +0 -74
- package/src/lib/components/layout/sections/section-field/section-field.component.ts +0 -22
- package/src/lib/components/list-paginator/list-paginator.component.html +0 -16
- package/src/lib/components/list-paginator/list-paginator.component.scss +0 -46
- package/src/lib/components/list-paginator/list-paginator.component.spec.ts +0 -248
- package/src/lib/components/list-paginator/list-paginator.component.ts +0 -81
- package/src/lib/components/misc/loading-error/loading-error.component.html +0 -11
- 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 +0 -75
- package/src/lib/components/misc/loading-error/loading-error.component.ts +0 -18
- package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.html +0 -3
- 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 +0 -43
- package/src/lib/components/misc/loading-spinner-indicator/loading-spinner-indicator.component.ts +0 -16
- package/src/lib/components/misc/snack-bar/snack-bar.component.html +0 -16
- package/src/lib/components/misc/snack-bar/snack-bar.component.scss +0 -84
- package/src/lib/components/misc/snack-bar/snack-bar.component.spec.ts +0 -136
- package/src/lib/components/misc/snack-bar/snack-bar.component.ts +0 -39
- package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.html +0 -11
- 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 +0 -67
- package/src/lib/components/notifications/saving-confirmed-box/saving-confirmed-box.component.ts +0 -15
- package/src/lib/components/notifications/saving-error-box/saving-error-box.component.html +0 -11
- 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 +0 -77
- package/src/lib/components/notifications/saving-error-box/saving-error-box.component.ts +0 -17
- package/src/lib/components/presenters/badge/badge.component.html +0 -6
- package/src/lib/components/presenters/badge/badge.component.scss +0 -10
- package/src/lib/components/presenters/badge/badge.component.spec.ts +0 -41
- package/src/lib/components/presenters/badge/badge.component.ts +0 -18
- package/src/lib/components/presenters/icon/icon.component.scss +0 -9
- package/src/lib/components/presenters/icon/icon.component.spec.ts +0 -38
- package/src/lib/components/presenters/icon/icon.component.ts +0 -37
- package/src/lib/core/breadcrumb.service.spec.ts +0 -35
- package/src/lib/core/breadcrumb.service.ts +0 -24
- package/src/lib/core/directives/auto-trim-and-lower.directive.spec.ts +0 -22
- package/src/lib/core/directives/auto-trim-and-lower.directive.ts +0 -19
- package/src/lib/core/directives/form-error/form-error.module.ts +0 -21
- package/src/lib/core/directives/form-error/has-error-root.directive.ts +0 -31
- package/src/lib/core/directives/form-error/has-error.directive.ts +0 -95
- package/src/lib/core/loading-state.service.spec.ts +0 -57
- package/src/lib/core/loading-state.service.ts +0 -44
- package/src/lib/core/models/breadcrumb-location.ts +0 -6
- package/src/lib/core/models/password-validation.ts +0 -20
- package/src/lib/core/validators/password/password-validator.spec.ts +0 -155
- package/src/lib/core/validators/password/password-validator.ts +0 -30
- package/src/lib/provide-cauca-material.ts +0 -10
- package/src/public-api.ts +0 -70
- package/src/test.ts +0 -17
- package/tsconfig.lib.json +0 -18
- package/tsconfig.lib.prod.json +0 -4
- package/tsconfig.spec.json +0 -17
- /package/{src/assets → assets}/images/loading.gif +0 -0
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, HostListener, OnInit, signal, WritableSignal, inject } from '@angular/core';
|
|
2
|
-
import { provideNativeDateAdapter } from '@angular/material/core';
|
|
3
|
-
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
4
|
-
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|
5
|
-
import { MatListModule } from '@angular/material/list';
|
|
6
|
-
import { DialogDateTimePickerOptions, DialogDateTimePickerDataDisabled, DialogDateTimePickerDataStep } from '../../models/dialog-date-time-picker-data';
|
|
7
|
-
import { CaucaCoreForChildModule } from '@cauca-911/core';
|
|
8
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
10
|
-
import { CommonModule } from '@angular/common';
|
|
11
|
-
import { MobileTimePickerComponent } from '../mobile-time-picker/mobile-time-picker.component';
|
|
12
|
-
import { DesktopTimePickerComponent } from '../desktop-time-picker/desktop-time-picker.component';
|
|
13
|
-
|
|
14
|
-
@Component({
|
|
15
|
-
selector: 'cauca-dialog-date-time-picker',
|
|
16
|
-
imports: [
|
|
17
|
-
CommonModule,
|
|
18
|
-
CaucaCoreForChildModule,
|
|
19
|
-
MatButtonModule,
|
|
20
|
-
MatDatepickerModule,
|
|
21
|
-
MatIconModule,
|
|
22
|
-
MatListModule,
|
|
23
|
-
MobileTimePickerComponent,
|
|
24
|
-
DesktopTimePickerComponent
|
|
25
|
-
],
|
|
26
|
-
providers: [provideNativeDateAdapter()],
|
|
27
|
-
templateUrl: './dialog-date-time-picker.component.html',
|
|
28
|
-
styleUrl: './dialog-date-time-picker.component.scss',
|
|
29
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
30
|
-
})
|
|
31
|
-
export class DialogDateTimePickerComponent implements OnInit {
|
|
32
|
-
|
|
33
|
-
public selectedHour = 0;
|
|
34
|
-
public selectedMinute = 0;
|
|
35
|
-
public selectedSecond = 0;
|
|
36
|
-
public initialDate: Date = null;
|
|
37
|
-
public selectedDate: Date = null;
|
|
38
|
-
public minimumDate = new Date();
|
|
39
|
-
public maximumDate = new Date();
|
|
40
|
-
public showSeconds: WritableSignal<boolean> = signal(false);
|
|
41
|
-
public showClearButton: boolean = true;
|
|
42
|
-
public showButtonIcons: boolean = true;
|
|
43
|
-
|
|
44
|
-
public hours = [...Array(24).keys()];
|
|
45
|
-
public minutes = [...Array(60).keys()];
|
|
46
|
-
public seconds = [...Array(60).keys()];
|
|
47
|
-
public showMobileUi: boolean = false;
|
|
48
|
-
|
|
49
|
-
public showTime: WritableSignal<boolean> = signal(true);
|
|
50
|
-
|
|
51
|
-
public disabled: DialogDateTimePickerDataDisabled = {
|
|
52
|
-
hours: true,
|
|
53
|
-
someHours: [],
|
|
54
|
-
minutes: true,
|
|
55
|
-
someMinutes: [],
|
|
56
|
-
seconds: true,
|
|
57
|
-
someSeconds: [],
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
private step: DialogDateTimePickerDataStep = {
|
|
61
|
-
hours: 1,
|
|
62
|
-
minutes: 1,
|
|
63
|
-
seconds: 1,
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
private readonly dialogRef = inject<MatDialogRef<DialogDateTimePickerComponent>>(MatDialogRef);
|
|
67
|
-
private readonly options = inject<DialogDateTimePickerOptions>(MAT_DIALOG_DATA);
|
|
68
|
-
|
|
69
|
-
public constructor() {
|
|
70
|
-
const options = this.options;
|
|
71
|
-
|
|
72
|
-
this.step = options.step || this.step;
|
|
73
|
-
this.showSeconds.set(options.showSeconds);
|
|
74
|
-
this.showButtonIcons = options.showButtonIcons ?? this.showButtonIcons;
|
|
75
|
-
this.showClearButton = options.showClearButton ?? this.showClearButton;
|
|
76
|
-
this.showTime.set(options.showTime ?? true);
|
|
77
|
-
this.setListHoursMinutes();
|
|
78
|
-
this.initialEachComponentValue(options);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
public ngOnInit(): void {
|
|
82
|
-
this.onWindowWithChange(window.innerWidth);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@HostListener('window:resize', ['$event'])
|
|
86
|
-
public onResize(event) {
|
|
87
|
-
this.onWindowWithChange(event.target.innerWidth);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
public dateChanged(date: Date): void {
|
|
91
|
-
if (date) {
|
|
92
|
-
this.selectedDate = date;
|
|
93
|
-
this.selectedDate.setHours(this.selectedHour);
|
|
94
|
-
this.selectedDate.setMinutes(this.selectedMinute);
|
|
95
|
-
this.selectedDate.setSeconds(this.selectedSecond);
|
|
96
|
-
this.disabled.hours = false;
|
|
97
|
-
this.disabled.someHours = this.hours.filter(hour => this.hourOfSelectedDateIsDisabled(hour));
|
|
98
|
-
} else {
|
|
99
|
-
this.selectedDate = null;
|
|
100
|
-
this.disabled.hours = true;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
public hourChanged(hour: number): void {
|
|
105
|
-
if (this.disabled.hours || this.disabled.someHours.includes(hour)) return;
|
|
106
|
-
|
|
107
|
-
this.selectedHour = hour;
|
|
108
|
-
this.selectedDate.setHours(hour);
|
|
109
|
-
this.disabled.minutes = false;
|
|
110
|
-
this.disabled.someMinutes = this.minutes.filter(minute => this.minuteOfSelectedDateIsDisabled(minute));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
public minuteChanged(minute: number): void {
|
|
114
|
-
if (this.disabled.minutes || this.disabled.someMinutes.includes(minute)) return;
|
|
115
|
-
|
|
116
|
-
this.selectedMinute = minute;
|
|
117
|
-
this.selectedDate.setMinutes(minute);
|
|
118
|
-
this.disabled.seconds = false;
|
|
119
|
-
this.disabled.someSeconds = this.seconds.filter(second => this.secondOfSelectedDateIsDisabled(second));
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
public secondChanged(second: number): void {
|
|
123
|
-
if (this.disabled.seconds || this.disabled.someSeconds.includes(second)) return;
|
|
124
|
-
|
|
125
|
-
this.selectedSecond = second;
|
|
126
|
-
this.selectedDate.setSeconds(second);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
public clear(): void {
|
|
130
|
-
this.dialogRef.close({
|
|
131
|
-
value: null
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
public cancel(): void {
|
|
136
|
-
this.dialogRef.close({
|
|
137
|
-
value: this.initialDate
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
public confirm(): void {
|
|
142
|
-
this.dialogRef.close({
|
|
143
|
-
value: this.selectedDate
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
private onWindowWithChange(width: number): void {
|
|
148
|
-
this.showMobileUi = width && width <= 555;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
private hourOfSelectedDateIsDisabled(hour: number): boolean {
|
|
152
|
-
if (this.selectedDateIsTheMinimumDate()) {
|
|
153
|
-
return hour < this.minimumDate.getHours();
|
|
154
|
-
} else if (this.selectedDateIsTheMaximumDate()) {
|
|
155
|
-
return hour > this.maximumDate.getHours();
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return false;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
private minuteOfSelectedDateIsDisabled(minute: number): boolean {
|
|
162
|
-
if (
|
|
163
|
-
this.selectedDateIsTheMinimumDate() &&
|
|
164
|
-
this.selectedDate.getHours() === this.minimumDate.getHours()
|
|
165
|
-
) {
|
|
166
|
-
return minute < this.minimumDate.getMinutes();
|
|
167
|
-
} else if (
|
|
168
|
-
this.selectedDateIsTheMaximumDate() &&
|
|
169
|
-
this.selectedDate.getHours() === this.maximumDate.getHours()
|
|
170
|
-
) {
|
|
171
|
-
return minute > this.maximumDate.getMinutes();
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
private secondOfSelectedDateIsDisabled(second: number): boolean {
|
|
178
|
-
if (
|
|
179
|
-
this.selectedDateIsTheMinimumDate() &&
|
|
180
|
-
this.selectedDate.getHours() === this.minimumDate.getHours() &&
|
|
181
|
-
this.selectedDate.getMinutes() === this.minimumDate.getMinutes()
|
|
182
|
-
) {
|
|
183
|
-
return second < this.minimumDate.getSeconds();
|
|
184
|
-
} else if (
|
|
185
|
-
this.selectedDateIsTheMaximumDate() &&
|
|
186
|
-
this.selectedDate.getMinutes() === this.maximumDate.getMinutes()
|
|
187
|
-
) {
|
|
188
|
-
return second > this.maximumDate.getSeconds();
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return false;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
private initialEachComponentValue(options: DialogDateTimePickerOptions): void {
|
|
195
|
-
this.initialDate = options.selectedDate ? new Date(options.selectedDate) : null;
|
|
196
|
-
this.minimumDate = options.minimumDate ? new Date(options.minimumDate) : null;
|
|
197
|
-
this.maximumDate = options.maximumDate ? new Date(options.maximumDate) : null;
|
|
198
|
-
this.selectedDate = options.selectedDate ? new Date(options.selectedDate) : new Date();
|
|
199
|
-
this.dateChanged(options.selectedDate ? new Date(options.selectedDate) : null);
|
|
200
|
-
this.hourChanged(options.selectedDate ? new Date(options.selectedDate).getHours() : 0);
|
|
201
|
-
this.minuteChanged(options.selectedDate ? new Date(options.selectedDate).getMinutes() : 0);
|
|
202
|
-
this.secondChanged(options.selectedDate ? new Date(options.selectedDate).getSeconds() : 0);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
private selectedDateIsTheMinimumDate(): boolean {
|
|
206
|
-
return (
|
|
207
|
-
this.minimumDate &&
|
|
208
|
-
this.selectedDate.getFullYear() === this.minimumDate.getFullYear() &&
|
|
209
|
-
this.selectedDate.getMonth() === this.minimumDate.getMonth() &&
|
|
210
|
-
this.selectedDate.getDate() === this.minimumDate.getDate()
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
private selectedDateIsTheMaximumDate(): boolean {
|
|
215
|
-
return (
|
|
216
|
-
this.maximumDate &&
|
|
217
|
-
this.selectedDate.getFullYear() === this.maximumDate.getFullYear() &&
|
|
218
|
-
this.selectedDate.getMonth() === this.maximumDate.getMonth() &&
|
|
219
|
-
this.selectedDate.getDate() === this.maximumDate.getDate()
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
private setListHoursMinutes(): void {
|
|
224
|
-
this.hours = this.hours.filter(hour => hour % this.step.hours === 0);
|
|
225
|
-
this.minutes = this.minutes.filter(minute => minute % this.step.minutes === 0);
|
|
226
|
-
this.seconds = this.seconds.filter(seconde => seconde % this.step.seconds === 0);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
align-items: center;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
height: 70px;
|
|
7
|
-
font-family: var(--mat-form-field-container-text-font);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.mat-mdc-icon-button {
|
|
11
|
-
height: 24px;
|
|
12
|
-
width: 24px;
|
|
13
|
-
line-height: 24px;
|
|
14
|
-
padding: 0;
|
|
15
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
|
2
|
-
import { HarnessLoader } from '@angular/cdk/testing';
|
|
3
|
-
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
|
4
|
-
import { MatButtonHarness } from '@angular/material/button/testing';
|
|
5
|
-
|
|
6
|
-
import { MobileTimePickerComponent } from './mobile-time-picker.component';
|
|
7
|
-
|
|
8
|
-
const someOptions = [
|
|
9
|
-
0, 1, 2
|
|
10
|
-
];
|
|
11
|
-
const someFirstOption = 0;
|
|
12
|
-
const someLastOption = 2;
|
|
13
|
-
|
|
14
|
-
describe('MobileTimePickerComponent', () => {
|
|
15
|
-
let component: MobileTimePickerComponent;
|
|
16
|
-
let fixture: ComponentFixture<MobileTimePickerComponent>;
|
|
17
|
-
let loader: HarnessLoader;
|
|
18
|
-
|
|
19
|
-
beforeEach(async () => {
|
|
20
|
-
await TestBed.configureTestingModule({
|
|
21
|
-
imports: [MobileTimePickerComponent]
|
|
22
|
-
})
|
|
23
|
-
.compileComponents();
|
|
24
|
-
|
|
25
|
-
fixture = TestBed.createComponent(MobileTimePickerComponent);
|
|
26
|
-
loader = TestbedHarnessEnvironment.loader(fixture);
|
|
27
|
-
component = fixture.componentInstance;
|
|
28
|
-
fixture.componentRef.setInput('options', someOptions);
|
|
29
|
-
fixture.componentRef.setInput('value', 0);
|
|
30
|
-
fixture.detectChanges();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('should create', () => {
|
|
34
|
-
expect(component).toBeTruthy();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('should emit valueChange when clicking Up arrow', fakeAsync(async () => {
|
|
38
|
-
const spy = spyOn(component.valueChange, 'emit');
|
|
39
|
-
const button = await loader.getHarnessOrNull(MatButtonHarness);
|
|
40
|
-
|
|
41
|
-
button.click();
|
|
42
|
-
tick();
|
|
43
|
-
|
|
44
|
-
expect(spy).toHaveBeenCalled();
|
|
45
|
-
}));
|
|
46
|
-
|
|
47
|
-
it('should change for next value when clicking Up arrow', fakeAsync(async () => {
|
|
48
|
-
fixture.componentRef.setInput('value', someFirstOption);
|
|
49
|
-
const spy = spyOn(component.valueChange, 'emit');
|
|
50
|
-
const button = await loader.getHarnessOrNull(MatButtonHarness);
|
|
51
|
-
|
|
52
|
-
button.click();
|
|
53
|
-
tick();
|
|
54
|
-
|
|
55
|
-
expect(spy).toHaveBeenCalledWith(someFirstOption + 1);
|
|
56
|
-
}));
|
|
57
|
-
|
|
58
|
-
it('should return to first value when clicking Up arrow and at the last value is selected', fakeAsync(async () => {
|
|
59
|
-
fixture.componentRef.setInput('value', someLastOption);
|
|
60
|
-
const spy = spyOn(component.valueChange, 'emit');
|
|
61
|
-
const button = await loader.getHarnessOrNull(MatButtonHarness);
|
|
62
|
-
|
|
63
|
-
await button.click();
|
|
64
|
-
tick();
|
|
65
|
-
fixture.detectChanges();
|
|
66
|
-
|
|
67
|
-
expect(spy).toHaveBeenCalledWith(someFirstOption);
|
|
68
|
-
}));
|
|
69
|
-
|
|
70
|
-
it('should emit valueChange when clicking Down arrow', fakeAsync(async () => {
|
|
71
|
-
const spy = spyOn(component.valueChange, 'emit');
|
|
72
|
-
const buttons = await loader.getAllHarnesses(MatButtonHarness);
|
|
73
|
-
const button = buttons[buttons.length - 1];
|
|
74
|
-
|
|
75
|
-
button.click();
|
|
76
|
-
tick();
|
|
77
|
-
|
|
78
|
-
expect(spy).toHaveBeenCalled();
|
|
79
|
-
}));
|
|
80
|
-
|
|
81
|
-
it('should change for next value when clicking Down arrow', fakeAsync(async () => {
|
|
82
|
-
fixture.componentRef.setInput('value', someLastOption);
|
|
83
|
-
const spy = spyOn(component.valueChange, 'emit');
|
|
84
|
-
const buttons = await loader.getAllHarnesses(MatButtonHarness);
|
|
85
|
-
const button = buttons[buttons.length - 1];
|
|
86
|
-
|
|
87
|
-
await button.click();
|
|
88
|
-
tick();
|
|
89
|
-
fixture.detectChanges();
|
|
90
|
-
|
|
91
|
-
expect(spy).toHaveBeenCalledWith(someLastOption - 1);
|
|
92
|
-
}));
|
|
93
|
-
|
|
94
|
-
it('should return to last value when clicking Down arrow and at the first value is selected', fakeAsync(async () => {
|
|
95
|
-
fixture.componentRef.setInput('value', someFirstOption);
|
|
96
|
-
const spy = spyOn(component.valueChange, 'emit');
|
|
97
|
-
const buttons = await loader.getAllHarnesses(MatButtonHarness);
|
|
98
|
-
const button = buttons[buttons.length - 1];
|
|
99
|
-
|
|
100
|
-
button.click();
|
|
101
|
-
tick();
|
|
102
|
-
|
|
103
|
-
expect(spy).toHaveBeenCalledWith(someLastOption);
|
|
104
|
-
}));
|
|
105
|
-
});
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';
|
|
2
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
3
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
4
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
5
|
-
import { MatInputModule } from '@angular/material/input';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'cauca-mobile-time-picker',
|
|
9
|
-
imports: [
|
|
10
|
-
MatButtonModule,
|
|
11
|
-
MatIconModule,
|
|
12
|
-
MatFormFieldModule,
|
|
13
|
-
MatInputModule
|
|
14
|
-
],
|
|
15
|
-
templateUrl: './mobile-time-picker.component.html',
|
|
16
|
-
styleUrl: './mobile-time-picker.component.scss',
|
|
17
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
18
|
-
})
|
|
19
|
-
export class MobileTimePickerComponent {
|
|
20
|
-
public value = input.required<number>();
|
|
21
|
-
public options = input.required<number[]>();
|
|
22
|
-
|
|
23
|
-
public valueChange = output<number>();
|
|
24
|
-
|
|
25
|
-
public valueUp(): void {
|
|
26
|
-
const currentIndex = this.options().indexOf(this.value());
|
|
27
|
-
let newValue = 0;
|
|
28
|
-
if (currentIndex === this.options().length - 1) {
|
|
29
|
-
newValue = this.options()[0];
|
|
30
|
-
} else {
|
|
31
|
-
newValue = this.options()[currentIndex + 1];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
this.valueChange.emit(newValue);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public valueDown(): void {
|
|
38
|
-
const currentIndex = this.options().indexOf(this.value());
|
|
39
|
-
let newValue = 0;
|
|
40
|
-
if (currentIndex === 0) {
|
|
41
|
-
newValue = this.options()[this.options().length - 1];
|
|
42
|
-
} else {
|
|
43
|
-
newValue = this.options()[currentIndex - 1];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
this.valueChange.emit(newValue);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export interface DialogDateTimePickerDataStep {
|
|
2
|
-
hours: number,
|
|
3
|
-
minutes: number,
|
|
4
|
-
seconds: number,
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface DialogDateTimePickerDataDisabled {
|
|
8
|
-
hours: boolean,
|
|
9
|
-
someHours: number[],
|
|
10
|
-
minutes: boolean,
|
|
11
|
-
someMinutes: number[],
|
|
12
|
-
seconds: boolean,
|
|
13
|
-
someSeconds: number[],
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface DialogDateTimePickerOptions {
|
|
17
|
-
selectedDate: Date,
|
|
18
|
-
minimumDate: Date | null,
|
|
19
|
-
maximumDate: Date | null,
|
|
20
|
-
showSeconds: boolean,
|
|
21
|
-
showClearButton: boolean,
|
|
22
|
-
showButtonIcons: boolean,
|
|
23
|
-
showTime: boolean,
|
|
24
|
-
step: DialogDateTimePickerDataStep,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface DialogDateTimePickerValue {
|
|
28
|
-
value: Date,
|
|
29
|
-
}
|
package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.html
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<button mat-raised-button (click)="openDialog($event)">
|
|
2
|
-
@if (icon) {
|
|
3
|
-
<mat-icon>{{icon}}</mat-icon>
|
|
4
|
-
}
|
|
5
|
-
@if (text) {
|
|
6
|
-
<span>{{text}}</span>
|
|
7
|
-
}
|
|
8
|
-
</button>
|
|
9
|
-
@if (multiple) {
|
|
10
|
-
<input #file type="file" (change)="onSelectFile($event)" [accept]="accept" multiple="multiple" />
|
|
11
|
-
} @else {
|
|
12
|
-
<input #file type="file" (change)="onSelectFile($event)" [accept]="accept" />
|
|
13
|
-
}
|
|
14
|
-
|
package/src/lib/components/deprecated-components/cauca-input-file/cauca-input-file.component.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild, inject } from '@angular/core';
|
|
2
|
-
import { MatDialog } from '@angular/material/dialog';
|
|
3
|
-
import { TranslateService } from '@cauca-911/core';
|
|
4
|
-
import { CaucaSimpleDialogComponent } from '../cauca-simple-dialog/cauca-simple-dialog.component';
|
|
5
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
-
import { MatIcon } from '@angular/material/icon';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'cauca-input-file',
|
|
10
|
-
templateUrl: './cauca-input-file.component.html',
|
|
11
|
-
styleUrls: ['./cauca-input-file.component.scss'],
|
|
12
|
-
imports: [MatButtonModule, MatIcon]
|
|
13
|
-
})
|
|
14
|
-
export class CaucaInputFileComponent implements OnInit {
|
|
15
|
-
|
|
16
|
-
@ViewChild('file', {static: false})
|
|
17
|
-
public file: ElementRef;
|
|
18
|
-
@Output()
|
|
19
|
-
public readend = new EventEmitter();
|
|
20
|
-
@Input()
|
|
21
|
-
public accept = '';
|
|
22
|
-
@Input()
|
|
23
|
-
public multiple = false;
|
|
24
|
-
@Input()
|
|
25
|
-
public icon = '';
|
|
26
|
-
@Input()
|
|
27
|
-
public text = '';
|
|
28
|
-
|
|
29
|
-
private labels: any = {};
|
|
30
|
-
private readonly translateService = inject(TranslateService);
|
|
31
|
-
private readonly dialog = inject(MatDialog);
|
|
32
|
-
|
|
33
|
-
public ngOnInit(): void {
|
|
34
|
-
if (!this.icon && !this.text) {
|
|
35
|
-
this.translateService.get(
|
|
36
|
-
['material.select', 'material.dialogTitle', 'material.dialogMessage']
|
|
37
|
-
).subscribe((labels: any) => {
|
|
38
|
-
this.labels = labels;
|
|
39
|
-
this.text = labels['material.select'];
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public onSelectFile(e: any): void {
|
|
45
|
-
for (let i = 0, j = e.target.files.length; i < j; i++) {
|
|
46
|
-
const file = e.target.files[i];
|
|
47
|
-
const reader = new FileReader();
|
|
48
|
-
reader.onerror = ((error: any) => this.onError(error));
|
|
49
|
-
reader.onload = ((event: any) => this.onReadEnd(file, event));
|
|
50
|
-
reader.readAsDataURL(file);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (e.target.files.length) {
|
|
54
|
-
this.dialog.open(CaucaSimpleDialogComponent, {
|
|
55
|
-
width: '250px',
|
|
56
|
-
disableClose: true,
|
|
57
|
-
data: {
|
|
58
|
-
title: this.labels['material.dialogTitle'],
|
|
59
|
-
message: this.labels['material.dialogMessage']
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
public openDialog(event: any): void {
|
|
66
|
-
if (this.file) {
|
|
67
|
-
this.file.nativeElement.click();
|
|
68
|
-
}
|
|
69
|
-
event.stopPropagation();
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
private onError(error: any): void {
|
|
73
|
-
throw error;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
private onReadEnd(file: any, e: any): void {
|
|
77
|
-
this.dialog.closeAll();
|
|
78
|
-
this.readend.emit({
|
|
79
|
-
name: file.name,
|
|
80
|
-
size: file.size,
|
|
81
|
-
type: file.type,
|
|
82
|
-
lastModifiedDate: file.lastModifiedDate,
|
|
83
|
-
content: e.target['result'],
|
|
84
|
-
file,
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<mat-tab-group [selectedIndex]="selectedIndex" (selectedIndexChange)="onTagChanged($event)">
|
|
2
|
-
@for (lang of labels; track lang; let i = $index) {
|
|
3
|
-
<mat-tab [label]="lang">
|
|
4
|
-
<mat-form-field hideRequiredMarker="never">
|
|
5
|
-
<input matInput [placeholder]="lang" [formControl]="forms[i]" required="required">
|
|
6
|
-
@if (forms[i].invalid) {
|
|
7
|
-
<mat-error>{{getErrorMessage(i) | translate}}</mat-error>
|
|
8
|
-
}
|
|
9
|
-
</mat-form-field>
|
|
10
|
-
</mat-tab>
|
|
11
|
-
}
|
|
12
|
-
</mat-tab-group>
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
}
|