@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,155 +0,0 @@
|
|
|
1
|
-
import { Component, ElementRef, EventEmitter, forwardRef, inject, Injector, Input, OnInit, Output } from '@angular/core';
|
|
2
|
-
import { DialogPosition, MatDialog } from '@angular/material/dialog';
|
|
3
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
4
|
-
import { MatInputModule } from '@angular/material/input';
|
|
5
|
-
import { DialogDateTimePickerComponent } from './components/dialog-date-time-picker/dialog-date-time-picker.component';
|
|
6
|
-
import { DialogDateTimePickerOptions, DialogDateTimePickerValue } from './models/dialog-date-time-picker-data';
|
|
7
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
8
|
-
import { DatePipe } from '@angular/common';
|
|
9
|
-
import { AbstractControl, ControlContainer, ControlValueAccessor, FormControl, FormControlName, FormGroup, NG_VALUE_ACCESSOR, NgControl, Validators } from '@angular/forms';
|
|
10
|
-
import { MatFormFieldModule, SubscriptSizing } from '@angular/material/form-field';
|
|
11
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
12
|
-
|
|
13
|
-
@Component({
|
|
14
|
-
selector: 'cauca-date-time-picker',
|
|
15
|
-
imports: [
|
|
16
|
-
TranslateModule,
|
|
17
|
-
MatButtonModule,
|
|
18
|
-
MatIconModule,
|
|
19
|
-
MatInputModule,
|
|
20
|
-
MatFormFieldModule
|
|
21
|
-
],
|
|
22
|
-
providers: [
|
|
23
|
-
DatePipe,
|
|
24
|
-
{
|
|
25
|
-
provide: NG_VALUE_ACCESSOR,
|
|
26
|
-
multi: true,
|
|
27
|
-
useExisting: forwardRef(() => CaucaDateTimePickerComponent),
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
templateUrl: './cauca-date-time-picker.component.html',
|
|
31
|
-
styleUrl: './cauca-date-time-picker.component.scss'
|
|
32
|
-
})
|
|
33
|
-
export class CaucaDateTimePickerComponent implements ControlValueAccessor, OnInit {
|
|
34
|
-
|
|
35
|
-
@Input() public subscriptSizing: SubscriptSizing = 'fixed';
|
|
36
|
-
@Input() public showTime: boolean = true;
|
|
37
|
-
@Input() public label: string = '';
|
|
38
|
-
@Input() public translateLabel: boolean = true;
|
|
39
|
-
@Input() public stepHours = 1;
|
|
40
|
-
@Input() public stepMinutes = 1;
|
|
41
|
-
@Input() public stepSecondes = 1;
|
|
42
|
-
@Input() public minimumDate: Date = null;
|
|
43
|
-
@Input() public maximumDate: Date = null;
|
|
44
|
-
@Input() public showSeconds: boolean = false;
|
|
45
|
-
@Input() public showFormat: string = 'yyyy/MM/dd, HH:mm';
|
|
46
|
-
@Input() public showClearButton: boolean = true;
|
|
47
|
-
@Input() public showButtonIcons: boolean = true;
|
|
48
|
-
@Output() public selectedChange = new EventEmitter<Date>();
|
|
49
|
-
|
|
50
|
-
public control: AbstractControl;
|
|
51
|
-
public stringDate: string = '';
|
|
52
|
-
|
|
53
|
-
private readonly injector = inject(Injector);
|
|
54
|
-
private readonly elementRef = inject(ElementRef);
|
|
55
|
-
private readonly dialog = inject(MatDialog);
|
|
56
|
-
private readonly datePipe = inject(DatePipe);
|
|
57
|
-
private selectedDate: Date;
|
|
58
|
-
|
|
59
|
-
@Input()
|
|
60
|
-
public set value(value: Date) {
|
|
61
|
-
if (value) {
|
|
62
|
-
this.stringDate = this.stringifyDate(value);
|
|
63
|
-
this.selectedDate = value;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
public get isRequired(): boolean {
|
|
68
|
-
return Boolean(this.control?.hasValidator(Validators.required))
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
public ngOnInit(): void {
|
|
72
|
-
const ngControl = this.injector.get(NgControl, null, { self: true, optional: true });
|
|
73
|
-
if (ngControl instanceof FormControlName) {
|
|
74
|
-
const container = this.injector.get(ControlContainer).control as FormGroup;
|
|
75
|
-
this.control = container.controls[ngControl.name] as FormControl;
|
|
76
|
-
} else {
|
|
77
|
-
this.control = new FormControl();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
public showDialog(): void {
|
|
82
|
-
const dialogRef = this.dialog.open(DialogDateTimePickerComponent, {
|
|
83
|
-
position: this.getDialogPosition(),
|
|
84
|
-
data: this.getDateTimePickerOptions(),
|
|
85
|
-
maxWidth: '100vw',
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
dialogRef.afterClosed().subscribe((data: DialogDateTimePickerValue) => {
|
|
89
|
-
if (data) {
|
|
90
|
-
this.stringDate = this.stringifyDate(data.value);
|
|
91
|
-
this.selectedDate = data.value;
|
|
92
|
-
this.selectedChange.emit(data.value);
|
|
93
|
-
this.onChange(data.value);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
public writeValue(date: Date): void {
|
|
99
|
-
this.value = date;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
public registerOnChange(fn: any): void {
|
|
103
|
-
this.onChange = fn;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
public registerOnTouched(fn: any): void {
|
|
107
|
-
this.onTouched = fn;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
public onChange = (value: Date): Date => value;
|
|
111
|
-
|
|
112
|
-
public onTouched = (): void => {/* This method needs to be empty */ };
|
|
113
|
-
|
|
114
|
-
private getDateTimePickerOptions(): DialogDateTimePickerOptions {
|
|
115
|
-
return {
|
|
116
|
-
selectedDate: this.selectedDate,
|
|
117
|
-
minimumDate: this.minimumDate,
|
|
118
|
-
maximumDate: this.maximumDate,
|
|
119
|
-
showSeconds: this.showSeconds,
|
|
120
|
-
showClearButton: this.showClearButton,
|
|
121
|
-
showButtonIcons: this.showButtonIcons,
|
|
122
|
-
showTime: this.showTime,
|
|
123
|
-
step: {
|
|
124
|
-
hours: this.stepHours,
|
|
125
|
-
minutes: this.stepMinutes,
|
|
126
|
-
seconds: this.stepSecondes,
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
private stringifyDate(date: Date): string {
|
|
131
|
-
return this.datePipe.transform(date, this.showFormat);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
private getDialogPosition(): DialogPosition {
|
|
135
|
-
const rect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
136
|
-
const top = rect.y + rect.height - 22;
|
|
137
|
-
const bottom = window.innerHeight - rect.y;
|
|
138
|
-
const minimumDialogHeight = 400;
|
|
139
|
-
const minimumScreenSize = 800;
|
|
140
|
-
|
|
141
|
-
if (window.innerHeight < minimumScreenSize || window.innerWidth < minimumScreenSize) {
|
|
142
|
-
return null;
|
|
143
|
-
} else if (window.innerHeight > (top + minimumDialogHeight)) {
|
|
144
|
-
return {
|
|
145
|
-
left: `${rect.x}px`,
|
|
146
|
-
top: `${top}px`,
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return {
|
|
151
|
-
left: `${rect.x}px`,
|
|
152
|
-
bottom: `${bottom}px`,
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<mat-list [disabled]="disabled?.all">
|
|
2
|
-
@for (option of options; track option) {
|
|
3
|
-
<mat-list-item [activated]="value === option" [disabled]="disabled?.someOptions.includes(option)"
|
|
4
|
-
(click)="valueChange.emit(option)">{{(option < 10 ? '0' : '' ) + option}}</mat-list-item>
|
|
5
|
-
}
|
|
6
|
-
</mat-list>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
mat-list {
|
|
2
|
-
width: 50px;
|
|
3
|
-
padding: 0;
|
|
4
|
-
|
|
5
|
-
.mat-mdc-list-item:not(.mat-mdc-list-item-interactive) {
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
>div::-webkit-scrollbar {
|
|
11
|
-
display: none;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
::ng-deep .mdc-list-item__primary-text {
|
|
15
|
-
font-family: var(--mat-datepicker-calendar-text-font);
|
|
16
|
-
font-size: var(--mat-datepicker-calendar-text-size);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
::ng-deep .mdc-list-item--activated {
|
|
20
|
-
background-color: var(--mat-datepicker-calendar-date-selected-state-background-color);
|
|
21
|
-
|
|
22
|
-
.mdc-list-item__primary-text {
|
|
23
|
-
color: var(--mat-datepicker-calendar-date-selected-state-text-color);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { DesktopTimePickerComponent } from './desktop-time-picker.component';
|
|
4
|
-
|
|
5
|
-
describe('DesktopTimePickerComponent', () => {
|
|
6
|
-
let component: DesktopTimePickerComponent;
|
|
7
|
-
let fixture: ComponentFixture<DesktopTimePickerComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [DesktopTimePickerComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(DesktopTimePickerComponent);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
import { MatListModule } from '@angular/material/list';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'cauca-desktop-time-picker',
|
|
6
|
-
imports: [
|
|
7
|
-
MatListModule
|
|
8
|
-
],
|
|
9
|
-
templateUrl: './desktop-time-picker.component.html',
|
|
10
|
-
styleUrl: './desktop-time-picker.component.scss'
|
|
11
|
-
})
|
|
12
|
-
export class DesktopTimePickerComponent {
|
|
13
|
-
@Input() public options: number[] = [];
|
|
14
|
-
@Input() public value: number;
|
|
15
|
-
@Input() public disabled: DesktopTimePickerComponentDisabled;
|
|
16
|
-
|
|
17
|
-
@Output() public valueChange = new EventEmitter<number>();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface DesktopTimePickerComponentDisabled {
|
|
21
|
-
all: boolean;
|
|
22
|
-
someOptions: number[];
|
|
23
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
<div mat-dialog-content>
|
|
2
|
-
<div [ngClass]="showSeconds() ? 'show-seconds' : 'hide-seconds'" class="date-time-picker">
|
|
3
|
-
<div class="calendar">
|
|
4
|
-
<mat-calendar
|
|
5
|
-
[minDate]="minimumDate"
|
|
6
|
-
[maxDate]="maximumDate"
|
|
7
|
-
[selected]="selectedDate"
|
|
8
|
-
(selectedChange)="dateChanged($event)"
|
|
9
|
-
></mat-calendar>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
@if (showTime()) {
|
|
13
|
-
@if (!showMobileUi) {
|
|
14
|
-
<div class="hours">
|
|
15
|
-
<cauca-desktop-time-picker [disabled]="{all: disabled.hours, someOptions: disabled.someHours}" (valueChange)="hourChanged($event)" [options]="hours" [value]="selectedHour"/>
|
|
16
|
-
</div>
|
|
17
|
-
}
|
|
18
|
-
@if (showMobileUi) {
|
|
19
|
-
<div class="hours">
|
|
20
|
-
<cauca-mobile-time-picker (valueChange)="hourChanged($event)" [options]="hours" [value]="selectedHour" />
|
|
21
|
-
</div>
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@if (showMobileUi) {
|
|
25
|
-
<div class="hour-and-minute-separator">:</div>
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@if (!showMobileUi) {
|
|
29
|
-
<div class="minutes">
|
|
30
|
-
<cauca-desktop-time-picker [disabled]="{all: disabled.minutes, someOptions: disabled.someMinutes}" (valueChange)="minuteChanged($event)" [options]="minutes" [value]="selectedMinute"/>
|
|
31
|
-
</div>
|
|
32
|
-
}
|
|
33
|
-
@if (showMobileUi) {
|
|
34
|
-
<div class="minutes">
|
|
35
|
-
<cauca-mobile-time-picker (valueChange)="minuteChanged($event)" [options]="minutes" [value]="selectedMinute" />
|
|
36
|
-
</div>
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@if (showSeconds() && showMobileUi) {
|
|
40
|
-
<div class="minute-and-second-separator">:</div>
|
|
41
|
-
}
|
|
42
|
-
@if (showSeconds() && !showMobileUi) {
|
|
43
|
-
<div class="seconds">
|
|
44
|
-
<cauca-desktop-time-picker [disabled]="{all: disabled.seconds, someOptions: disabled.someSeconds}" (valueChange)="secondChanged($event)" [options]="seconds" [value]="selectedSecond"/>
|
|
45
|
-
</div>
|
|
46
|
-
}
|
|
47
|
-
@if (showSeconds() && showMobileUi) {
|
|
48
|
-
<div class="seconds">
|
|
49
|
-
<cauca-mobile-time-picker (valueChange)="secondChanged($event)" [options]="seconds" [value]="selectedSecond" />
|
|
50
|
-
</div>
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<div mat-dialog-actions align="end">
|
|
57
|
-
@if (showClearButton) {
|
|
58
|
-
<button mat-stroked-button (click)="clear()">
|
|
59
|
-
@if (showButtonIcons) {
|
|
60
|
-
<mat-icon>clear</mat-icon>
|
|
61
|
-
}
|
|
62
|
-
{{'material.clear' | translate}}
|
|
63
|
-
</button>
|
|
64
|
-
}
|
|
65
|
-
<button color="primary" mat-stroked-button (click)="cancel()">
|
|
66
|
-
@if (showButtonIcons) {
|
|
67
|
-
<mat-icon>cancel</mat-icon>
|
|
68
|
-
}
|
|
69
|
-
{{'material.cancel' | translate}}
|
|
70
|
-
</button>
|
|
71
|
-
<button color="primary" mat-raised-button cdkFocusInitial (click)="confirm()">
|
|
72
|
-
@if (showButtonIcons) {
|
|
73
|
-
<mat-icon>check</mat-icon>
|
|
74
|
-
}
|
|
75
|
-
{{'material.ok' | translate}}
|
|
76
|
-
</button>
|
|
77
|
-
</div>
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
@use '@angular/material' as mat;
|
|
2
|
-
|
|
3
|
-
div[mat-dialog-actions] {
|
|
4
|
-
padding: 8px;
|
|
5
|
-
border-top: 1px solid #ccc;
|
|
6
|
-
|
|
7
|
-
button {
|
|
8
|
-
margin: 2px;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.date-time-picker {
|
|
13
|
-
display: grid;
|
|
14
|
-
grid-template-areas:
|
|
15
|
-
"calendar hours minutes seconds";
|
|
16
|
-
height: 350px;
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
|
|
20
|
-
>div {
|
|
21
|
-
overflow: auto;
|
|
22
|
-
flex: 1;
|
|
23
|
-
max-width: 50px;
|
|
24
|
-
scrollbar-width: none;
|
|
25
|
-
border-left: 1px solid #ccc;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
>div:first-child {
|
|
29
|
-
flex: 4;
|
|
30
|
-
max-width: 290px;
|
|
31
|
-
border-left: none;
|
|
32
|
-
|
|
33
|
-
mat-calendar {
|
|
34
|
-
width: 290px;
|
|
35
|
-
height: 350px;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
>div::-webkit-scrollbar {
|
|
40
|
-
display: none;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
::ng-deep .mdc-list-item__primary-text {
|
|
44
|
-
font-family: var(--mat-datepicker-calendar-text-font);
|
|
45
|
-
font-size: var(--mat-datepicker-calendar-text-size);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
::ng-deep .mdc-list-item--activated {
|
|
49
|
-
background-color: var(--mat-datepicker-calendar-date-selected-state-background-color);
|
|
50
|
-
|
|
51
|
-
.mdc-list-item__primary-text {
|
|
52
|
-
color: var(--mat-datepicker-calendar-date-selected-state-text-color);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.calendar {
|
|
58
|
-
grid-area: calendar;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.hours {
|
|
62
|
-
grid-area: hours;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.minutes {
|
|
66
|
-
grid-area: minutes;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.seconds {
|
|
70
|
-
grid-area: seconds;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.hour-and-minute-separator {
|
|
74
|
-
grid-area: hour-and-minute-separator;
|
|
75
|
-
display: flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
justify-content: center;
|
|
78
|
-
font-weight: 700;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.minute-and-second-separator {
|
|
82
|
-
grid-area: minute-and-second-separator;
|
|
83
|
-
display: flex;
|
|
84
|
-
align-items: center;
|
|
85
|
-
justify-content: center;
|
|
86
|
-
font-weight: 700;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
@media only screen and (max-width: 555px) {
|
|
90
|
-
|
|
91
|
-
.show-seconds {
|
|
92
|
-
grid-template-areas:
|
|
93
|
-
"calendar calendar calendar calendar calendar calendar calendar"
|
|
94
|
-
". hours hour-and-minute-separator minutes minute-and-second-separator seconds .";
|
|
95
|
-
grid-template-columns: auto 40px 2px 40px 2px 40px auto;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.hide-seconds {
|
|
99
|
-
grid-template-areas:
|
|
100
|
-
"calendar calendar calendar calendar calendar"
|
|
101
|
-
". hours hour-and-minute-separator minutes .";
|
|
102
|
-
grid-template-columns: auto 40px 2px 40px auto;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.date-time-picker {
|
|
106
|
-
grid-template-rows: auto auto;
|
|
107
|
-
height: 450px;
|
|
108
|
-
|
|
109
|
-
>div {
|
|
110
|
-
border-left: none;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
>div:not(:first-child) {
|
|
114
|
-
height: 70px;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
>div:first-child {
|
|
118
|
-
overflow: initial;
|
|
119
|
-
flex: 4;
|
|
120
|
-
max-width: 290px;
|
|
121
|
-
border-left: none;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
|
3
|
-
import { DialogDateTimePickerComponent } from './dialog-date-time-picker.component';
|
|
4
|
-
import { TranslatePipe } from '@ngx-translate/core';
|
|
5
|
-
import { MockPipe } from 'ng-mocks';
|
|
6
|
-
|
|
7
|
-
describe('DialogDateTimePickerComponent', () => {
|
|
8
|
-
let component: DialogDateTimePickerComponent;
|
|
9
|
-
let fixture: ComponentFixture<DialogDateTimePickerComponent>;
|
|
10
|
-
|
|
11
|
-
beforeEach(async () => {
|
|
12
|
-
await TestBed.configureTestingModule({
|
|
13
|
-
imports: [
|
|
14
|
-
DialogDateTimePickerComponent,
|
|
15
|
-
MatDialogModule,
|
|
16
|
-
],
|
|
17
|
-
declarations: [MockPipe(TranslatePipe, key => key)],
|
|
18
|
-
providers: [{
|
|
19
|
-
provide: MatDialogRef,
|
|
20
|
-
useValue: {}
|
|
21
|
-
}, {
|
|
22
|
-
provide: MAT_DIALOG_DATA,
|
|
23
|
-
useValue: {}
|
|
24
|
-
}]
|
|
25
|
-
})
|
|
26
|
-
.compileComponents();
|
|
27
|
-
|
|
28
|
-
fixture = TestBed.createComponent(DialogDateTimePickerComponent);
|
|
29
|
-
component = fixture.componentInstance;
|
|
30
|
-
fixture.detectChanges();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('should create', () => {
|
|
34
|
-
expect(component).toBeTruthy();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('should not show the list of seconds when showSeconds is false', () => {
|
|
38
|
-
const divSeconds = fixture.nativeElement.querySelector('.seconds');
|
|
39
|
-
|
|
40
|
-
expect(divSeconds).toBeNull();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('should show the list of seconds when showSeconds is true', () => {
|
|
44
|
-
component.showSeconds.set(true);
|
|
45
|
-
fixture.detectChanges();
|
|
46
|
-
|
|
47
|
-
const divSeconds = fixture.nativeElement.querySelector('.seconds');
|
|
48
|
-
|
|
49
|
-
expect(divSeconds).not.toBeNull();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('should execute hourChanged when click on hours list', () => {
|
|
53
|
-
const hourChangedSpy = spyOn(component, 'hourChanged');
|
|
54
|
-
const hoursList = fixture.nativeElement.querySelector('.hours mat-list mat-list-item');
|
|
55
|
-
|
|
56
|
-
hoursList.click();
|
|
57
|
-
fixture.detectChanges();
|
|
58
|
-
|
|
59
|
-
expect(hourChangedSpy).toHaveBeenCalled();
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('should execute minuteChanged when click on minutes list', () => {
|
|
63
|
-
const minuteChangedSpy = spyOn(component, 'minuteChanged');
|
|
64
|
-
const minutesList = fixture.nativeElement.querySelector('.minutes mat-list mat-list-item');
|
|
65
|
-
|
|
66
|
-
minutesList.click();
|
|
67
|
-
fixture.detectChanges();
|
|
68
|
-
|
|
69
|
-
expect(minuteChangedSpy).toHaveBeenCalled();
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('should execute minuteChanged when click on minutes list', () => {
|
|
73
|
-
component.showSeconds.set(true);
|
|
74
|
-
fixture.detectChanges();
|
|
75
|
-
const secondChangedSpy = spyOn(component, 'secondChanged');
|
|
76
|
-
const secondsList = fixture.nativeElement.querySelector('.seconds mat-list mat-list-item');
|
|
77
|
-
|
|
78
|
-
secondsList.click();
|
|
79
|
-
fixture.detectChanges();
|
|
80
|
-
|
|
81
|
-
expect(secondChangedSpy).toHaveBeenCalled();
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('should not show time when showTime is false', () => {
|
|
85
|
-
component.showTime.set(false);
|
|
86
|
-
fixture.detectChanges();
|
|
87
|
-
|
|
88
|
-
const hoursDiv = fixture.nativeElement.querySelector('.hours');
|
|
89
|
-
const minutesDiv = fixture.nativeElement.querySelector('.minutes');
|
|
90
|
-
const secondsDiv = fixture.nativeElement.querySelector('.seconds');
|
|
91
|
-
|
|
92
|
-
expect(hoursDiv).toBeNull();
|
|
93
|
-
expect(minutesDiv).toBeNull();
|
|
94
|
-
expect(secondsDiv).toBeNull();
|
|
95
|
-
});
|
|
96
|
-
});
|