@cauca-911/material 17.0.0 → 17.1.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.
@@ -2,12 +2,12 @@ import * as i0 from '@angular/core';
2
2
  import { Injectable, Component, Inject, EventEmitter, ViewChild, Output, Input, HostListener, NgModule } from '@angular/core';
3
3
  import * as i1 from '@ngx-translate/core';
4
4
  import * as i2 from '@angular/common';
5
- import { CommonModule } from '@angular/common';
6
- import * as i3$1 from '@angular/forms';
5
+ import { CommonModule, DatePipe } from '@angular/common';
6
+ import * as i3 from '@angular/forms';
7
7
  import { Validators, UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
8
- import * as i3 from '@angular/material/button';
8
+ import * as i4 from '@angular/material/button';
9
9
  import { MatButtonModule } from '@angular/material/button';
10
- import * as i4 from '@angular/material/form-field';
10
+ import * as i4$1 from '@angular/material/form-field';
11
11
  import { MatFormFieldModule } from '@angular/material/form-field';
12
12
  import * as i5 from '@angular/material/icon';
13
13
  import { MatIconModule } from '@angular/material/icon';
@@ -15,7 +15,7 @@ import * as i5$1 from '@angular/material/input';
15
15
  import { MatInputModule } from '@angular/material/input';
16
16
  import * as i6 from '@angular/material/tabs';
17
17
  import { MatTabsModule } from '@angular/material/tabs';
18
- import * as i3$2 from '@fortawesome/angular-fontawesome';
18
+ import * as i3$1 from '@fortawesome/angular-fontawesome';
19
19
  import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
20
20
  import * as i1$2 from '@cauca-911/core';
21
21
  import { CaucaCoreForChildModule } from '@cauca-911/core';
@@ -24,6 +24,11 @@ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
24
24
  import * as i1$3 from '@angular/router';
25
25
  import { NavigationEnd } from '@angular/router';
26
26
  import { style, state, animate, transition, trigger } from '@angular/animations';
27
+ import { MatNativeDateModule } from '@angular/material/core';
28
+ import * as i5$2 from '@angular/material/datepicker';
29
+ import { MatDatepickerModule } from '@angular/material/datepicker';
30
+ import * as i7 from '@angular/material/list';
31
+ import { MatListModule } from '@angular/material/list';
27
32
 
28
33
  class CaucaMaterialService {
29
34
  static { this.ɵfac = function CaucaMaterialService_Factory(t) { return new (t || CaucaMaterialService)(); }; }
@@ -104,7 +109,7 @@ class CaucaSimpleDialogComponent {
104
109
  i0.ɵɵproperty("innerHTML", ctx.data.message, i0.ɵɵsanitizeHtml);
105
110
  i0.ɵɵadvance(1);
106
111
  i0.ɵɵproperty("ngIf", ctx.data.buttons);
107
- } }, dependencies: [i2.NgForOf, i2.NgIf, i3.MatButton, i1$1.MatDialogTitle, i1$1.MatDialogActions, i1$1.MatDialogContent], styles: ["div[mat-dialog-actions][_ngcontent-%COMP%]{margin-top:20px;text-align:center}"] }); }
112
+ } }, dependencies: [i2.NgForOf, i2.NgIf, i4.MatButton, i1$1.MatDialogTitle, i1$1.MatDialogActions, i1$1.MatDialogContent], styles: ["div[mat-dialog-actions][_ngcontent-%COMP%]{margin-top:20px;text-align:center}"] }); }
108
113
  }
109
114
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaSimpleDialogComponent, [{
110
115
  type: Component,
@@ -233,7 +238,7 @@ class CaucaInputFileComponent {
233
238
  i0.ɵɵproperty("ngIf", ctx.text);
234
239
  i0.ɵɵadvance(1);
235
240
  i0.ɵɵproperty("ngIf", ctx.multiple)("ngIfElse", _r4);
236
- } }, dependencies: [i2.NgIf, i3.MatButton, i5.MatIcon], styles: ["[_nghost-%COMP%] input[_ngcontent-%COMP%]{display:none}"] }); }
241
+ } }, dependencies: [i2.NgIf, i4.MatButton, i5.MatIcon], styles: ["[_nghost-%COMP%] input[_ngcontent-%COMP%]{display:none}"] }); }
237
242
  }
238
243
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaInputFileComponent, [{
239
244
  type: Component,
@@ -321,7 +326,7 @@ class CaucaInputMultipleLangueComponent {
321
326
  i0.ɵɵproperty("selectedIndex", ctx.selectedIndex);
322
327
  i0.ɵɵadvance(1);
323
328
  i0.ɵɵproperty("ngForOf", ctx.labels);
324
- } }, dependencies: [i2.NgForOf, i2.NgIf, i3$1.DefaultValueAccessor, i3$1.NgControlStatus, i3$1.RequiredValidator, i3$1.FormControlDirective, i4.MatFormField, i4.MatError, i5$1.MatInput, i6.MatTab, i6.MatTabGroup, i1.TranslatePipe], styles: [".mat-mdc-form-field[_ngcontent-%COMP%]{width:100%}"] }); }
329
+ } }, dependencies: [i2.NgForOf, i2.NgIf, i3.DefaultValueAccessor, i3.NgControlStatus, i3.RequiredValidator, i3.FormControlDirective, i4$1.MatFormField, i4$1.MatError, i5$1.MatInput, i6.MatTab, i6.MatTabGroup, i1.TranslatePipe], styles: [".mat-mdc-form-field[_ngcontent-%COMP%]{width:100%}"] }); }
325
330
  }
326
331
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaInputMultipleLangueComponent, [{
327
332
  type: Component,
@@ -478,7 +483,7 @@ class CaucaMenuVerticalComponent {
478
483
  i0.ɵɵtemplate(0, CaucaMenuVerticalComponent_h4_0_Template, 5, 5, "h4", 0);
479
484
  } if (rf & 2) {
480
485
  i0.ɵɵproperty("ngForOf", ctx.menuItems);
481
- } }, dependencies: [i2.NgForOf, i2.NgIf, i3$2.FaIconComponent, i1.TranslatePipe], styles: [".menu[_ngcontent-%COMP%], .submenu[_ngcontent-%COMP%]{cursor:pointer}h4[_ngcontent-%COMP%]{margin:0;padding:0}h4[_ngcontent-%COMP%] .menu[_ngcontent-%COMP%]{padding:1em 0;display:flex;flex-direction:row}h4[_ngcontent-%COMP%] .menu[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:1 1 auto;align-self:center}.menu-dot[_ngcontent-%COMP%]{max-width:1.1em;text-align:center;margin-right:.5em;font-size:2em}.menu-icon[_ngcontent-%COMP%]{max-width:60px;text-align:center;margin-right:.5em}.submenu[_ngcontent-%COMP%]{margin-left:1em}.submenu[_ngcontent-%COMP%] .menu[_ngcontent-%COMP%]{padding:0;font-size:.9em;line-height:2.2em}.submenu[_ngcontent-%COMP%] .menu[_ngcontent-%COMP%]:before{content:\"\";margin-left:1.1em;width:.1em;height:2.5em;position:relative;background:#ffffff;margin-right:-1.17em}"] }); }
486
+ } }, dependencies: [i2.NgForOf, i2.NgIf, i3$1.FaIconComponent, i1.TranslatePipe], styles: [".menu[_ngcontent-%COMP%], .submenu[_ngcontent-%COMP%]{cursor:pointer}h4[_ngcontent-%COMP%]{margin:0;padding:0}h4[_ngcontent-%COMP%] .menu[_ngcontent-%COMP%]{padding:1em 0;display:flex;flex-direction:row}h4[_ngcontent-%COMP%] .menu[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:1 1 auto;align-self:center}.menu-dot[_ngcontent-%COMP%]{max-width:1.1em;text-align:center;margin-right:.5em;font-size:2em}.menu-icon[_ngcontent-%COMP%]{max-width:60px;text-align:center;margin-right:.5em}.submenu[_ngcontent-%COMP%]{margin-left:1em}.submenu[_ngcontent-%COMP%] .menu[_ngcontent-%COMP%]{padding:0;font-size:.9em;line-height:2.2em}.submenu[_ngcontent-%COMP%] .menu[_ngcontent-%COMP%]:before{content:\"\";margin-left:1.1em;width:.1em;height:2.5em;position:relative;background:#ffffff;margin-right:-1.17em}"] }); }
482
487
  }
483
488
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaMenuVerticalComponent, [{
484
489
  type: Component,
@@ -614,7 +619,7 @@ class CaucaMenuSidebarComponent {
614
619
  i0.ɵɵproperty("menuItems", ctx.menuItems);
615
620
  i0.ɵɵadvance(5);
616
621
  i0.ɵɵproperty("ngIf", ctx.version);
617
- } }, dependencies: [i2.NgIf, i3.MatIconButton, i5.MatIcon, CaucaMenuVerticalComponent, i1.TranslatePipe], styles: ["[_nghost-%COMP%]{height:100%;flex-direction:column;display:flex;transition:all .1s ease-out;overflow:hidden;scrollbar-width:5px;scrollbar-color:rgba(0,0,0,.1) rgba(0,0,0,.2)}[_ngcontent-%COMP%]::-webkit-scrollbar{width:5px}[_ngcontent-%COMP%]::-webkit-scrollbar-track{border-radius:5px;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.1)}[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:5px;background-color:#0003;outline:1px solid slategrey}[_nghost-%COMP%] > div[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%] > .header[_ngcontent-%COMP%], [_nghost-%COMP%] > .footer[_ngcontent-%COMP%]{flex:0 0 auto}[_nghost-%COMP%] > .content[_ngcontent-%COMP%]{flex-grow:1;overflow:hidden auto}[_nghost-%COMP%] > .version[_ngcontent-%COMP%]{max-height:1em}.hidden[_nghost-%COMP%]{width:0;min-width:0;max-width:0}.mobile[_nghost-%COMP%]{width:275px;min-width:275px;max-width:275px;position:absolute;z-index:10}.collapsed[_nghost-%COMP%]{width:75px;min-width:75px;max-width:75px}.expanded[_nghost-%COMP%]{width:275px;min-width:275px;max-width:275px}[_nghost-%COMP%] .close[_ngcontent-%COMP%]{display:none}.mobile[_nghost-%COMP%] .close[_ngcontent-%COMP%]{right:0;display:inline-block;position:absolute}.double-arrow[_ngcontent-%COMP%]{height:3em;line-height:3em;cursor:pointer;position:fixed;opacity:.25;margin-top:-1em}.double-arrow[_ngcontent-%COMP%]:hover{opacity:1}.expanded[_nghost-%COMP%] .double-arrow[_ngcontent-%COMP%]:before, .collapsed[_nghost-%COMP%] .double-arrow[_ngcontent-%COMP%]:before{font-family:Material Icons;content:\"double_arrow\";font-size:3em;text-align:right}.collapsed[_nghost-%COMP%] .double-arrow[_ngcontent-%COMP%]{margin-left:10px}.expanded[_nghost-%COMP%] .double-arrow[_ngcontent-%COMP%]{margin-left:200px}.collapsed[_nghost-%COMP%] .menu-caption, .collapsed[_nghost-%COMP%] .submenu{display:none}.keepExpanded[_nghost-%COMP%] .double-arrow[_ngcontent-%COMP%]{transform:rotate(180deg);opacity:1}.version[_ngcontent-%COMP%]{bottom:0;padding:1em}.full[_ngcontent-%COMP%], .abbr[_ngcontent-%COMP%]{display:none}.collapsed[_nghost-%COMP%] .abbr[_ngcontent-%COMP%]{display:inline}.mobile[_nghost-%COMP%] .full[_ngcontent-%COMP%], .expanded[_nghost-%COMP%] .full[_ngcontent-%COMP%]{display:inline}@media only screen and (max-width: 1000px){.double-arrow[_ngcontent-%COMP%]{display:none}}"] }); }
622
+ } }, dependencies: [i2.NgIf, i4.MatIconButton, i5.MatIcon, CaucaMenuVerticalComponent, i1.TranslatePipe], styles: ["[_nghost-%COMP%]{height:100%;flex-direction:column;display:flex;transition:all .1s ease-out;overflow:hidden;scrollbar-width:5px;scrollbar-color:rgba(0,0,0,.1) rgba(0,0,0,.2)}[_ngcontent-%COMP%]::-webkit-scrollbar{width:5px}[_ngcontent-%COMP%]::-webkit-scrollbar-track{border-radius:5px;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.1)}[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:5px;background-color:#0003;outline:1px solid slategrey}[_nghost-%COMP%] > div[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%] > .header[_ngcontent-%COMP%], [_nghost-%COMP%] > .footer[_ngcontent-%COMP%]{flex:0 0 auto}[_nghost-%COMP%] > .content[_ngcontent-%COMP%]{flex-grow:1;overflow:hidden auto}[_nghost-%COMP%] > .version[_ngcontent-%COMP%]{max-height:1em}.hidden[_nghost-%COMP%]{width:0;min-width:0;max-width:0}.mobile[_nghost-%COMP%]{width:275px;min-width:275px;max-width:275px;position:absolute;z-index:10}.collapsed[_nghost-%COMP%]{width:75px;min-width:75px;max-width:75px}.expanded[_nghost-%COMP%]{width:275px;min-width:275px;max-width:275px}[_nghost-%COMP%] .close[_ngcontent-%COMP%]{display:none}.mobile[_nghost-%COMP%] .close[_ngcontent-%COMP%]{right:0;display:inline-block;position:absolute}.double-arrow[_ngcontent-%COMP%]{height:3em;line-height:3em;cursor:pointer;position:fixed;opacity:.25;margin-top:-1em}.double-arrow[_ngcontent-%COMP%]:hover{opacity:1}.expanded[_nghost-%COMP%] .double-arrow[_ngcontent-%COMP%]:before, .collapsed[_nghost-%COMP%] .double-arrow[_ngcontent-%COMP%]:before{font-family:Material Icons;content:\"double_arrow\";font-size:3em;text-align:right}.collapsed[_nghost-%COMP%] .double-arrow[_ngcontent-%COMP%]{margin-left:10px}.expanded[_nghost-%COMP%] .double-arrow[_ngcontent-%COMP%]{margin-left:200px}.collapsed[_nghost-%COMP%] .menu-caption, .collapsed[_nghost-%COMP%] .submenu{display:none}.keepExpanded[_nghost-%COMP%] .double-arrow[_ngcontent-%COMP%]{transform:rotate(180deg);opacity:1}.version[_ngcontent-%COMP%]{bottom:0;padding:1em}.full[_ngcontent-%COMP%], .abbr[_ngcontent-%COMP%]{display:none}.collapsed[_nghost-%COMP%] .abbr[_ngcontent-%COMP%]{display:inline}.mobile[_nghost-%COMP%] .full[_ngcontent-%COMP%], .expanded[_nghost-%COMP%] .full[_ngcontent-%COMP%]{display:inline}@media only screen and (max-width: 1000px){.double-arrow[_ngcontent-%COMP%]{display:none}}"] }); }
618
623
  }
619
624
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaMenuSidebarComponent, [{
620
625
  type: Component,
@@ -803,7 +808,7 @@ class CaucaMaterialModule {
803
808
  MatIconModule,
804
809
  MatInputModule,
805
810
  MatTabsModule,
806
- MatDialogModule
811
+ MatDialogModule,
807
812
  ],
808
813
  exports: [
809
814
  CaucaMaterialComponent,
@@ -813,7 +818,7 @@ class CaucaMaterialModule {
813
818
  CaucaMenuVerticalComponent,
814
819
  CaucaSimpleDialogComponent,
815
820
  CaucaSlideshowComponent,
816
- ]
821
+ ],
817
822
  }]
818
823
  }], null, null); })();
819
824
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CaucaMaterialModule, { declarations: [CaucaMaterialComponent,
@@ -840,6 +845,383 @@ class CaucaMaterialModule {
840
845
  CaucaSimpleDialogComponent,
841
846
  CaucaSlideshowComponent] }); })();
842
847
 
848
+ function DialogDateTimePickerComponent_For_7_Template(rf, ctx) { if (rf & 1) {
849
+ const _r9 = i0.ɵɵgetCurrentView();
850
+ i0.ɵɵelementStart(0, "mat-list-item", 10);
851
+ i0.ɵɵlistener("click", function DialogDateTimePickerComponent_For_7_Template_mat_list_item_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r9); const hour_r3 = restoredCtx.$implicit; const ctx_r8 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r8.hourChanged(hour_r3)); });
852
+ i0.ɵɵtext(1);
853
+ i0.ɵɵelementEnd();
854
+ } if (rf & 2) {
855
+ const hour_r3 = ctx.$implicit;
856
+ const ctx_r0 = i0.ɵɵnextContext();
857
+ i0.ɵɵproperty("activated", ctx_r0.selectedHour === hour_r3)("disabled", ctx_r0.disabled.someHours.includes(hour_r3));
858
+ i0.ɵɵadvance(1);
859
+ i0.ɵɵtextInterpolate((hour_r3 < 10 ? "0" : "") + hour_r3);
860
+ } }
861
+ function DialogDateTimePickerComponent_For_11_Template(rf, ctx) { if (rf & 1) {
862
+ const _r16 = i0.ɵɵgetCurrentView();
863
+ i0.ɵɵelementStart(0, "mat-list-item", 10);
864
+ i0.ɵɵlistener("click", function DialogDateTimePickerComponent_For_11_Template_mat_list_item_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r16); const minute_r10 = restoredCtx.$implicit; const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.minuteChanged(minute_r10)); });
865
+ i0.ɵɵtext(1);
866
+ i0.ɵɵelementEnd();
867
+ } if (rf & 2) {
868
+ const minute_r10 = ctx.$implicit;
869
+ const ctx_r1 = i0.ɵɵnextContext();
870
+ i0.ɵɵproperty("activated", ctx_r1.selectedMinute === minute_r10)("disabled", ctx_r1.disabled.someMinutes.includes(minute_r10));
871
+ i0.ɵɵadvance(1);
872
+ i0.ɵɵtextInterpolate((minute_r10 < 10 ? "0" : "") + minute_r10);
873
+ } }
874
+ function DialogDateTimePickerComponent_div_12_For_3_Template(rf, ctx) { if (rf & 1) {
875
+ const _r24 = i0.ɵɵgetCurrentView();
876
+ i0.ɵɵelementStart(0, "mat-list-item", 10);
877
+ i0.ɵɵlistener("click", function DialogDateTimePickerComponent_div_12_For_3_Template_mat_list_item_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r24); const second_r18 = restoredCtx.$implicit; const ctx_r23 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r23.secondChanged(second_r18)); });
878
+ i0.ɵɵtext(1);
879
+ i0.ɵɵelementEnd();
880
+ } if (rf & 2) {
881
+ const second_r18 = ctx.$implicit;
882
+ const ctx_r17 = i0.ɵɵnextContext(2);
883
+ i0.ɵɵproperty("activated", ctx_r17.selectedSecond === second_r18)("disabled", ctx_r17.disabled.someSeconds.includes(second_r18));
884
+ i0.ɵɵadvance(1);
885
+ i0.ɵɵtextInterpolate((second_r18 < 10 ? "0" : "") + second_r18);
886
+ } }
887
+ function DialogDateTimePickerComponent_div_12_Template(rf, ctx) { if (rf & 1) {
888
+ i0.ɵɵelementStart(0, "div", 11)(1, "mat-list", 4);
889
+ i0.ɵɵrepeaterCreate(2, DialogDateTimePickerComponent_div_12_For_3_Template, 2, 3, "mat-list-item", 12, i0.ɵɵrepeaterTrackByIdentity);
890
+ i0.ɵɵelementEnd()();
891
+ } if (rf & 2) {
892
+ const ctx_r2 = i0.ɵɵnextContext();
893
+ i0.ɵɵadvance(1);
894
+ i0.ɵɵproperty("disabled", ctx_r2.disabled.seconds);
895
+ i0.ɵɵadvance(1);
896
+ i0.ɵɵrepeater(ctx_r2.seconds);
897
+ } }
898
+ class DialogDateTimePickerComponent {
899
+ constructor(dialogRef, options) {
900
+ this.dialogRef = dialogRef;
901
+ this.options = options;
902
+ this.selectedHour = 0;
903
+ this.selectedMinute = 0;
904
+ this.selectedSecond = 0;
905
+ this.initialDate = null;
906
+ this.selectedDate = null;
907
+ this.minimumDate = new Date();
908
+ this.maximumDate = new Date();
909
+ this.showSeconds = false;
910
+ this.hours = [...Array(24).keys()];
911
+ this.minutes = [...Array(60).keys()];
912
+ this.seconds = [...Array(60).keys()];
913
+ this.disabled = {
914
+ hours: true,
915
+ someHours: [],
916
+ minutes: true,
917
+ someMinutes: [],
918
+ seconds: true,
919
+ someSeconds: [],
920
+ };
921
+ this.step = {
922
+ hours: 1,
923
+ minutes: 1,
924
+ seconds: 1,
925
+ };
926
+ this.step = options.step || this.step;
927
+ this.showSeconds = options.showSeconds;
928
+ this.setListHoursMinutes();
929
+ this.initialEachComponentValue(options);
930
+ }
931
+ dateChanged(date) {
932
+ if (date) {
933
+ this.selectedDate = date;
934
+ this.selectedDate.setHours(this.selectedHour);
935
+ this.selectedDate.setMinutes(this.selectedMinute);
936
+ this.selectedDate.setSeconds(this.selectedSecond);
937
+ this.disabled.hours = false;
938
+ this.disabled.someHours = this.hours.filter(hour => this.hourOfSelectedDateIsDisabled(hour));
939
+ }
940
+ else {
941
+ this.selectedDate = null;
942
+ this.disabled.hours = true;
943
+ }
944
+ }
945
+ hourChanged(hour) {
946
+ if (this.disabled.hours || this.disabled.someHours.includes(hour))
947
+ return;
948
+ this.selectedHour = hour;
949
+ this.selectedDate.setHours(hour);
950
+ this.disabled.minutes = false;
951
+ this.disabled.someMinutes = this.minutes.filter(minute => this.minuteOfSelectedDateIsDisabled(minute));
952
+ }
953
+ minuteChanged(minute) {
954
+ if (this.disabled.minutes || this.disabled.someMinutes.includes(minute))
955
+ return;
956
+ this.selectedMinute = minute;
957
+ this.selectedDate.setMinutes(minute);
958
+ this.disabled.seconds = false;
959
+ this.disabled.someSeconds = this.seconds.filter(second => this.secondOfSelectedDateIsDisabled(second));
960
+ }
961
+ secondChanged(second) {
962
+ if (this.disabled.seconds || this.disabled.someSeconds.includes(second))
963
+ return;
964
+ this.selectedSecond = second;
965
+ this.selectedDate.setSeconds(second);
966
+ }
967
+ clear() {
968
+ this.dialogRef.close({
969
+ value: null
970
+ });
971
+ }
972
+ cancel() {
973
+ this.dialogRef.close({
974
+ value: this.initialDate
975
+ });
976
+ }
977
+ confirm() {
978
+ this.dialogRef.close({
979
+ value: this.selectedDate
980
+ });
981
+ }
982
+ hourOfSelectedDateIsDisabled(hour) {
983
+ if (this.selectedDateIsTheMinimumDate()) {
984
+ return hour < this.minimumDate.getHours();
985
+ }
986
+ else if (this.selectedDateIsTheMaximumDate()) {
987
+ return hour > this.maximumDate.getHours();
988
+ }
989
+ return false;
990
+ }
991
+ minuteOfSelectedDateIsDisabled(minute) {
992
+ if (this.selectedDateIsTheMinimumDate() &&
993
+ this.selectedDate.getHours() === this.minimumDate.getHours()) {
994
+ return minute < this.minimumDate.getMinutes();
995
+ }
996
+ else if (this.selectedDateIsTheMaximumDate() &&
997
+ this.selectedDate.getHours() === this.maximumDate.getHours()) {
998
+ return minute > this.maximumDate.getMinutes();
999
+ }
1000
+ return false;
1001
+ }
1002
+ secondOfSelectedDateIsDisabled(second) {
1003
+ if (this.selectedDateIsTheMinimumDate() &&
1004
+ this.selectedDate.getHours() === this.minimumDate.getHours() &&
1005
+ this.selectedDate.getMinutes() === this.minimumDate.getMinutes()) {
1006
+ return second < this.minimumDate.getSeconds();
1007
+ }
1008
+ else if (this.selectedDateIsTheMaximumDate() &&
1009
+ this.selectedDate.getMinutes() === this.maximumDate.getMinutes()) {
1010
+ return second > this.maximumDate.getSeconds();
1011
+ }
1012
+ return false;
1013
+ }
1014
+ initialEachComponentValue(options) {
1015
+ this.initialDate = options.selectedDate ? new Date(options.selectedDate) : null;
1016
+ this.minimumDate = options.minimumDate ? new Date(options.minimumDate) : null;
1017
+ this.maximumDate = options.maximumDate ? new Date(options.maximumDate) : null;
1018
+ this.selectedDate = options.selectedDate ? new Date(options.selectedDate) : new Date();
1019
+ this.dateChanged(options.selectedDate ? new Date(options.selectedDate) : null);
1020
+ this.hourChanged(options.selectedDate ? new Date(options.selectedDate).getHours() : 0);
1021
+ this.minuteChanged(options.selectedDate ? new Date(options.selectedDate).getMinutes() : 0);
1022
+ this.secondChanged(options.selectedDate ? new Date(options.selectedDate).getSeconds() : 0);
1023
+ console.log(this.selectedDate);
1024
+ }
1025
+ selectedDateIsTheMinimumDate() {
1026
+ return (this.minimumDate &&
1027
+ this.selectedDate.getFullYear() === this.minimumDate.getFullYear() &&
1028
+ this.selectedDate.getMonth() === this.minimumDate.getMonth() &&
1029
+ this.selectedDate.getDate() === this.minimumDate.getDate());
1030
+ }
1031
+ selectedDateIsTheMaximumDate() {
1032
+ return (this.maximumDate &&
1033
+ this.selectedDate.getFullYear() === this.maximumDate.getFullYear() &&
1034
+ this.selectedDate.getMonth() === this.maximumDate.getMonth() &&
1035
+ this.selectedDate.getDate() === this.maximumDate.getDate());
1036
+ }
1037
+ setListHoursMinutes() {
1038
+ this.hours = this.hours.filter(hour => hour % this.step.hours === 0);
1039
+ this.minutes = this.minutes.filter(minute => minute % this.step.minutes === 0);
1040
+ this.seconds = this.seconds.filter(seconde => seconde % this.step.seconds === 0);
1041
+ }
1042
+ static { this.ɵfac = function DialogDateTimePickerComponent_Factory(t) { return new (t || DialogDateTimePickerComponent)(i0.ɵɵdirectiveInject(i1$1.MatDialogRef), i0.ɵɵdirectiveInject(MAT_DIALOG_DATA)); }; }
1043
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DialogDateTimePickerComponent, selectors: [["cauca-dialog-date-time-picker"]], standalone: true, features: [i0.ɵɵStandaloneFeature], decls: 29, vars: 15, consts: [["mat-dialog-content", ""], [1, "date-time-picker"], [3, "minDate", "maxDate", "selected", "selectedChange"], [1, "hours"], [3, "disabled"], [1, "minutes"], ["class", "seconds", 4, "ngIf"], ["mat-dialog-actions", "", "align", "end"], ["mat-stroked-button", "", 3, "click"], ["color", "primary", "mat-raised-button", "", "cdkFocusInitial", "", 3, "click"], [3, "activated", "disabled", "click"], [1, "seconds"], [3, "activated", "disabled"]], template: function DialogDateTimePickerComponent_Template(rf, ctx) { if (rf & 1) {
1044
+ i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div")(3, "mat-calendar", 2);
1045
+ i0.ɵɵlistener("selectedChange", function DialogDateTimePickerComponent_Template_mat_calendar_selectedChange_3_listener($event) { return ctx.dateChanged($event); });
1046
+ i0.ɵɵelementEnd()();
1047
+ i0.ɵɵelementStart(4, "div", 3)(5, "mat-list", 4);
1048
+ i0.ɵɵrepeaterCreate(6, DialogDateTimePickerComponent_For_7_Template, 2, 3, "mat-list-item", 12, i0.ɵɵrepeaterTrackByIdentity);
1049
+ i0.ɵɵelementEnd()();
1050
+ i0.ɵɵelementStart(8, "div", 5)(9, "mat-list", 4);
1051
+ i0.ɵɵrepeaterCreate(10, DialogDateTimePickerComponent_For_11_Template, 2, 3, "mat-list-item", 12, i0.ɵɵrepeaterTrackByIdentity);
1052
+ i0.ɵɵelementEnd()();
1053
+ i0.ɵɵtemplate(12, DialogDateTimePickerComponent_div_12_Template, 4, 1, "div", 6);
1054
+ i0.ɵɵelementEnd()();
1055
+ i0.ɵɵelementStart(13, "div", 7)(14, "button", 8);
1056
+ i0.ɵɵlistener("click", function DialogDateTimePickerComponent_Template_button_click_14_listener() { return ctx.clear(); });
1057
+ i0.ɵɵelementStart(15, "mat-icon");
1058
+ i0.ɵɵtext(16, "clear");
1059
+ i0.ɵɵelementEnd();
1060
+ i0.ɵɵtext(17);
1061
+ i0.ɵɵpipe(18, "translate");
1062
+ i0.ɵɵelementEnd();
1063
+ i0.ɵɵelementStart(19, "button", 8);
1064
+ i0.ɵɵlistener("click", function DialogDateTimePickerComponent_Template_button_click_19_listener() { return ctx.cancel(); });
1065
+ i0.ɵɵelementStart(20, "mat-icon");
1066
+ i0.ɵɵtext(21, "cancel");
1067
+ i0.ɵɵelementEnd();
1068
+ i0.ɵɵtext(22);
1069
+ i0.ɵɵpipe(23, "translate");
1070
+ i0.ɵɵelementEnd();
1071
+ i0.ɵɵelementStart(24, "button", 9);
1072
+ i0.ɵɵlistener("click", function DialogDateTimePickerComponent_Template_button_click_24_listener() { return ctx.confirm(); });
1073
+ i0.ɵɵelementStart(25, "mat-icon");
1074
+ i0.ɵɵtext(26, "check");
1075
+ i0.ɵɵelementEnd();
1076
+ i0.ɵɵtext(27);
1077
+ i0.ɵɵpipe(28, "translate");
1078
+ i0.ɵɵelementEnd()();
1079
+ } if (rf & 2) {
1080
+ i0.ɵɵadvance(3);
1081
+ i0.ɵɵproperty("minDate", ctx.minimumDate)("maxDate", ctx.maximumDate)("selected", ctx.selectedDate);
1082
+ i0.ɵɵadvance(2);
1083
+ i0.ɵɵproperty("disabled", ctx.disabled.hours);
1084
+ i0.ɵɵadvance(1);
1085
+ i0.ɵɵrepeater(ctx.hours);
1086
+ i0.ɵɵadvance(3);
1087
+ i0.ɵɵproperty("disabled", ctx.disabled.minutes);
1088
+ i0.ɵɵadvance(1);
1089
+ i0.ɵɵrepeater(ctx.minutes);
1090
+ i0.ɵɵadvance(2);
1091
+ i0.ɵɵproperty("ngIf", ctx.showSeconds);
1092
+ i0.ɵɵadvance(5);
1093
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(18, 9, "material.clear"), " ");
1094
+ i0.ɵɵadvance(5);
1095
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(23, 11, "material.cancel"), " ");
1096
+ i0.ɵɵadvance(5);
1097
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(28, 13, "material.apply"), " ");
1098
+ } }, dependencies: [CommonModule, i2.NgIf, CaucaCoreForChildModule, i1.TranslatePipe, MatButtonModule, i4.MatButton, MatDatepickerModule, i5$2.MatCalendar, MatIconModule, i5.MatIcon, MatListModule, i7.MatList, i7.MatListItem, MatNativeDateModule], styles: ["div[mat-dialog-actions][_ngcontent-%COMP%]{padding:10px 0;border-top:1px solid #ccc}div[mat-dialog-actions][_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin:2px}.date-time-picker[_ngcontent-%COMP%]{display:flex;height:350px;overflow:hidden;justify-content:center}.date-time-picker[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{overflow:auto;flex:1;max-width:50px;scrollbar-width:none;border-left:1px solid #ccc}.date-time-picker[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > mat-list[_ngcontent-%COMP%]{width:50px;padding:0}.date-time-picker[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > mat-list[_ngcontent-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%]:not(.mat-mdc-list-item-interactive){cursor:pointer}.date-time-picker[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:first-child{flex:4;max-width:290px;border-left:none}.date-time-picker[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:first-child mat-calendar[_ngcontent-%COMP%]{width:290px}.date-time-picker[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.date-time-picker[_ngcontent-%COMP%] .mdc-list-item__primary-text{font-family:var(--mat-datepicker-calendar-text-font);font-size:var(--mat-datepicker-calendar-text-size)}.date-time-picker[_ngcontent-%COMP%] .mdc-list-item--activated{background-color:var(--mat-datepicker-calendar-date-selected-state-background-color)}.date-time-picker[_ngcontent-%COMP%] .mdc-list-item--activated .mdc-list-item__primary-text{color:var(--mat-datepicker-calendar-date-selected-state-text-color)}"] }); }
1099
+ }
1100
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DialogDateTimePickerComponent, [{
1101
+ type: Component,
1102
+ args: [{ selector: 'cauca-dialog-date-time-picker', standalone: true, imports: [
1103
+ CommonModule,
1104
+ CaucaCoreForChildModule,
1105
+ MatButtonModule,
1106
+ MatDatepickerModule,
1107
+ MatIconModule,
1108
+ MatListModule,
1109
+ MatNativeDateModule,
1110
+ ], template: "<div mat-dialog-content>\n <div class=\"date-time-picker\">\n <div>\n <mat-calendar\n [minDate]=\"minimumDate\"\n [maxDate]=\"maximumDate\"\n [selected]=\"selectedDate\"\n (selectedChange)=\"dateChanged($event)\"\n ></mat-calendar>\n </div>\n <div class=\"hours\">\n <mat-list [disabled]=\"disabled.hours\">\n @for (hour of hours; track hour) {\n <mat-list-item\n [activated]=\"selectedHour === hour\"\n [disabled]=\"disabled.someHours.includes(hour)\"\n (click)=\"hourChanged(hour)\"\n >{{(hour < 10 ? '0' : '') + hour}}</mat-list-item>\n }\n </mat-list>\n </div>\n <div class=\"minutes\">\n <mat-list [disabled]=\"disabled.minutes\">\n @for (minute of minutes; track minute) {\n <mat-list-item\n [activated]=\"selectedMinute === minute\"\n [disabled]=\"disabled.someMinutes.includes(minute)\"\n (click)=\"minuteChanged(minute)\"\n >{{(minute < 10 ? '0' : '') + minute}}</mat-list-item>\n }\n </mat-list>\n </div>\n <div class=\"seconds\" *ngIf=\"showSeconds\">\n <mat-list [disabled]=\"disabled.seconds\">\n @for (second of seconds; track second) {\n <mat-list-item\n [activated]=\"selectedSecond === second\"\n [disabled]=\"disabled.someSeconds.includes(second)\"\n (click)=\"secondChanged(second)\"\n >{{(second < 10 ? '0' : '') + second}}</mat-list-item>\n }\n </mat-list>\n </div>\n </div>\n</div>\n<div mat-dialog-actions align=\"end\">\n <button mat-stroked-button (click)=\"clear()\">\n <mat-icon>clear</mat-icon>\n {{'material.clear' | translate}}\n </button>\n <button mat-stroked-button (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon>\n {{'material.cancel' | translate}}\n </button>\n <button color=\"primary\" mat-raised-button cdkFocusInitial (click)=\"confirm()\">\n <mat-icon>check</mat-icon>\n {{'material.apply' | translate}}\n </button>\n</div>", styles: ["div[mat-dialog-actions]{padding:10px 0;border-top:1px solid #ccc}div[mat-dialog-actions] button{margin:2px}.date-time-picker{display:flex;height:350px;overflow:hidden;justify-content:center}.date-time-picker>div{overflow:auto;flex:1;max-width:50px;scrollbar-width:none;border-left:1px solid #ccc}.date-time-picker>div>mat-list{width:50px;padding:0}.date-time-picker>div>mat-list .mat-mdc-list-item:not(.mat-mdc-list-item-interactive){cursor:pointer}.date-time-picker>div:first-child{flex:4;max-width:290px;border-left:none}.date-time-picker>div:first-child mat-calendar{width:290px}.date-time-picker>div::-webkit-scrollbar{display:none}.date-time-picker ::ng-deep .mdc-list-item__primary-text{font-family:var(--mat-datepicker-calendar-text-font);font-size:var(--mat-datepicker-calendar-text-size)}.date-time-picker ::ng-deep .mdc-list-item--activated{background-color:var(--mat-datepicker-calendar-date-selected-state-background-color)}.date-time-picker ::ng-deep .mdc-list-item--activated .mdc-list-item__primary-text{color:var(--mat-datepicker-calendar-date-selected-state-text-color)}\n"] }]
1111
+ }], () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
1112
+ type: Inject,
1113
+ args: [MAT_DIALOG_DATA]
1114
+ }] }], null); })();
1115
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DialogDateTimePickerComponent, { className: "DialogDateTimePickerComponent", filePath: "lib/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.ts", lineNumber: 27 }); })();
1116
+
1117
+ class CaucaDateTimePickerComponent {
1118
+ constructor(elementRef, dialog, datePipe) {
1119
+ this.elementRef = elementRef;
1120
+ this.dialog = dialog;
1121
+ this.datePipe = datePipe;
1122
+ this.stepHours = 1;
1123
+ this.stepMinutes = 1;
1124
+ this.stepSecondes = 1;
1125
+ this.minimumDate = null;
1126
+ this.maximumDate = null;
1127
+ this.showSeconds = false;
1128
+ this.showFormat = 'yyyy/MM/dd, HH:mm';
1129
+ this.selectedChange = new EventEmitter();
1130
+ this.stringDate = '';
1131
+ }
1132
+ set value(value) {
1133
+ if (value) {
1134
+ this.stringDate = this.stringifyDate(value);
1135
+ this.selectedDate = value;
1136
+ }
1137
+ }
1138
+ showDialog() {
1139
+ const dialogRef = this.dialog.open(DialogDateTimePickerComponent, {
1140
+ position: this.getDialogPosition(),
1141
+ data: this.getDateTimePickerOptions(),
1142
+ });
1143
+ dialogRef.afterClosed().subscribe((data) => {
1144
+ if (data) {
1145
+ this.stringDate = this.stringifyDate(data.value);
1146
+ this.selectedDate = data.value;
1147
+ this.selectedChange.emit(data.value);
1148
+ }
1149
+ });
1150
+ }
1151
+ getDateTimePickerOptions() {
1152
+ return {
1153
+ selectedDate: this.selectedDate,
1154
+ minimumDate: this.minimumDate,
1155
+ maximumDate: this.maximumDate,
1156
+ showSeconds: this.showSeconds,
1157
+ step: {
1158
+ hours: this.stepHours,
1159
+ minutes: this.stepMinutes,
1160
+ seconds: this.stepSecondes,
1161
+ }
1162
+ };
1163
+ }
1164
+ stringifyDate(date) {
1165
+ return this.datePipe.transform(date, this.showFormat);
1166
+ }
1167
+ getDialogPosition() {
1168
+ const rect = this.elementRef.nativeElement.getBoundingClientRect();
1169
+ const top = rect.y + rect.height - 22;
1170
+ const bottom = window.innerHeight - rect.y;
1171
+ return window.innerHeight > (top + 350) ? {
1172
+ left: `${rect.x}px`,
1173
+ top: `${top}px`,
1174
+ } : {
1175
+ left: `${rect.x}px`,
1176
+ bottom: `${bottom}px`,
1177
+ };
1178
+ }
1179
+ static { this.ɵfac = function CaucaDateTimePickerComponent_Factory(t) { return new (t || CaucaDateTimePickerComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1$1.MatDialog), i0.ɵɵdirectiveInject(i2.DatePipe)); }; }
1180
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaucaDateTimePickerComponent, selectors: [["cauca-date-time-picker"]], inputs: { stepHours: "stepHours", stepMinutes: "stepMinutes", stepSecondes: "stepSecondes", minimumDate: "minimumDate", maximumDate: "maximumDate", showSeconds: "showSeconds", showFormat: "showFormat", value: "value" }, outputs: { selectedChange: "selectedChange" }, standalone: true, features: [i0.ɵɵProvidersFeature([
1181
+ DatePipe,
1182
+ ]), i0.ɵɵStandaloneFeature], decls: 5, vars: 1, consts: [["matInput", "", "readonly", "readonly", 3, "value"], ["matSuffix", "", "mat-icon-button", "", 3, "click"]], template: function CaucaDateTimePickerComponent_Template(rf, ctx) { if (rf & 1) {
1183
+ i0.ɵɵelementStart(0, "mat-form-field");
1184
+ i0.ɵɵelement(1, "input", 0);
1185
+ i0.ɵɵelementStart(2, "button", 1);
1186
+ i0.ɵɵlistener("click", function CaucaDateTimePickerComponent_Template_button_click_2_listener() { return ctx.showDialog(); });
1187
+ i0.ɵɵelementStart(3, "mat-icon");
1188
+ i0.ɵɵtext(4, "calendar_month");
1189
+ i0.ɵɵelementEnd()()();
1190
+ } if (rf & 2) {
1191
+ i0.ɵɵadvance(1);
1192
+ i0.ɵɵproperty("value", ctx.stringDate);
1193
+ } }, dependencies: [MatButtonModule, i4.MatIconButton, MatIconModule, i5.MatIcon, MatInputModule, i5$1.MatInput, i4$1.MatFormField, i4$1.MatSuffix], styles: ["[_nghost-%COMP%]{display:block}mat-form-field[_ngcontent-%COMP%]{width:100%}"] }); }
1194
+ }
1195
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaDateTimePickerComponent, [{
1196
+ type: Component,
1197
+ args: [{ selector: 'cauca-date-time-picker', standalone: true, imports: [
1198
+ MatButtonModule,
1199
+ MatIconModule,
1200
+ MatInputModule,
1201
+ ], providers: [
1202
+ DatePipe,
1203
+ ], template: "<mat-form-field>\n <input matInput [value]=\"stringDate\" readonly=\"readonly\">\n <button matSuffix mat-icon-button (click)=\"showDialog()\">\n <mat-icon>calendar_month</mat-icon>\n </button>\n</mat-form-field>", styles: [":host{display:block}mat-form-field{width:100%}\n"] }]
1204
+ }], () => [{ type: i0.ElementRef }, { type: i1$1.MatDialog }, { type: i2.DatePipe }], { stepHours: [{
1205
+ type: Input
1206
+ }], stepMinutes: [{
1207
+ type: Input
1208
+ }], stepSecondes: [{
1209
+ type: Input
1210
+ }], minimumDate: [{
1211
+ type: Input
1212
+ }], maximumDate: [{
1213
+ type: Input
1214
+ }], showSeconds: [{
1215
+ type: Input
1216
+ }], showFormat: [{
1217
+ type: Input
1218
+ }], selectedChange: [{
1219
+ type: Output
1220
+ }], value: [{
1221
+ type: Input
1222
+ }] }); })();
1223
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaucaDateTimePickerComponent, { className: "CaucaDateTimePickerComponent", filePath: "lib/cauca-date-time-picker/cauca-date-time-picker.component.ts", lineNumber: 24 }); })();
1224
+
843
1225
  class MenuItem {
844
1226
  constructor(label, path, icon = '') {
845
1227
  this.label = label;
@@ -857,5 +1239,5 @@ class MenuItem {
857
1239
  * Generated bundle index. Do not edit.
858
1240
  */
859
1241
 
860
- export { CaucaInputFileComponent, CaucaInputMultipleLangueComponent, CaucaMaterialComponent, CaucaMaterialModule, CaucaMaterialService, CaucaMenuSidebarComponent, CaucaMenuVerticalComponent, CaucaSimpleDialogComponent, CaucaSlideshowComponent, MenuItem };
1242
+ export { CaucaDateTimePickerComponent, CaucaInputFileComponent, CaucaInputMultipleLangueComponent, CaucaMaterialComponent, CaucaMaterialModule, CaucaMaterialService, CaucaMenuSidebarComponent, CaucaMenuVerticalComponent, CaucaSimpleDialogComponent, CaucaSlideshowComponent, MenuItem };
861
1243
  //# sourceMappingURL=cauca-911-material.mjs.map