@cauca-911/material 17.0.0 → 17.1.0
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/assets/i18n/cauca/en-material.json +2 -0
- package/assets/i18n/cauca/es-material.json +2 -0
- package/assets/i18n/cauca/fr-material.json +2 -0
- package/esm2022/lib/cauca-date-time-picker/cauca-date-time-picker.component.mjs +103 -0
- package/esm2022/lib/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.mjs +255 -0
- package/esm2022/lib/cauca-date-time-picker/models/dialog-date-time-picker-data.mjs +2 -0
- package/esm2022/lib/cauca-material.module.mjs +4 -4
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/cauca-911-material.mjs +338 -4
- package/fesm2022/cauca-911-material.mjs.map +1 -1
- package/lib/cauca-date-time-picker/cauca-date-time-picker.component.d.ts +24 -0
- package/lib/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.d.ts +36 -0
- package/lib/cauca-date-time-picker/models/dialog-date-time-picker-data.d.ts +20 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -2,7 +2,7 @@ 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';
|
|
5
|
+
import { CommonModule, DatePipe } from '@angular/common';
|
|
6
6
|
import * as i3$1 from '@angular/forms';
|
|
7
7
|
import { Validators, UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
8
8
|
import * as i3 from '@angular/material/button';
|
|
@@ -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 i4$1 from '@angular/material/datepicker';
|
|
29
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
30
|
+
import * as i6$1 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)(); }; }
|
|
@@ -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,335 @@ 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 = new Date();
|
|
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
|
+
cancel() {
|
|
968
|
+
this.dialogRef.close(null);
|
|
969
|
+
}
|
|
970
|
+
confirm() {
|
|
971
|
+
this.dialogRef.close(this.selectedDate);
|
|
972
|
+
}
|
|
973
|
+
hourOfSelectedDateIsDisabled(hour) {
|
|
974
|
+
if (this.selectedDateIsTheMinimumDate()) {
|
|
975
|
+
return hour < this.minimumDate.getHours();
|
|
976
|
+
}
|
|
977
|
+
else if (this.selectedDateIsTheMaximumDate()) {
|
|
978
|
+
return hour > this.maximumDate.getHours();
|
|
979
|
+
}
|
|
980
|
+
return false;
|
|
981
|
+
}
|
|
982
|
+
minuteOfSelectedDateIsDisabled(minute) {
|
|
983
|
+
if (this.selectedDateIsTheMinimumDate() &&
|
|
984
|
+
this.selectedDate.getHours() === this.minimumDate.getHours()) {
|
|
985
|
+
return minute < this.minimumDate.getMinutes();
|
|
986
|
+
}
|
|
987
|
+
else if (this.selectedDateIsTheMaximumDate() &&
|
|
988
|
+
this.selectedDate.getHours() === this.maximumDate.getHours()) {
|
|
989
|
+
return minute > this.maximumDate.getMinutes();
|
|
990
|
+
}
|
|
991
|
+
return false;
|
|
992
|
+
}
|
|
993
|
+
secondOfSelectedDateIsDisabled(second) {
|
|
994
|
+
if (this.selectedDateIsTheMinimumDate() &&
|
|
995
|
+
this.selectedDate.getHours() === this.minimumDate.getHours() &&
|
|
996
|
+
this.selectedDate.getMinutes() === this.minimumDate.getMinutes()) {
|
|
997
|
+
return second < this.minimumDate.getSeconds();
|
|
998
|
+
}
|
|
999
|
+
else if (this.selectedDateIsTheMaximumDate() &&
|
|
1000
|
+
this.selectedDate.getMinutes() === this.maximumDate.getMinutes()) {
|
|
1001
|
+
return second > this.maximumDate.getSeconds();
|
|
1002
|
+
}
|
|
1003
|
+
return false;
|
|
1004
|
+
}
|
|
1005
|
+
initialEachComponentValue(options) {
|
|
1006
|
+
this.initialDate = options.selectedDate ? new Date(options.selectedDate) : new Date();
|
|
1007
|
+
this.minimumDate = options.minimumDate ? new Date(options.minimumDate) : null;
|
|
1008
|
+
this.maximumDate = options.maximumDate ? new Date(options.maximumDate) : null;
|
|
1009
|
+
this.dateChanged(options.selectedDate ? new Date(options.selectedDate) : null);
|
|
1010
|
+
this.hourChanged(options.selectedDate ? new Date(options.selectedDate).getHours() : 0);
|
|
1011
|
+
this.minuteChanged(options.selectedDate ? new Date(options.selectedDate).getMinutes() : 0);
|
|
1012
|
+
this.secondChanged(options.selectedDate ? new Date(options.selectedDate).getSeconds() : 0);
|
|
1013
|
+
}
|
|
1014
|
+
selectedDateIsTheMinimumDate() {
|
|
1015
|
+
return (this.minimumDate &&
|
|
1016
|
+
this.selectedDate.getFullYear() === this.minimumDate.getFullYear() &&
|
|
1017
|
+
this.selectedDate.getMonth() === this.minimumDate.getMonth() &&
|
|
1018
|
+
this.selectedDate.getDate() === this.minimumDate.getDate());
|
|
1019
|
+
}
|
|
1020
|
+
selectedDateIsTheMaximumDate() {
|
|
1021
|
+
return (this.maximumDate &&
|
|
1022
|
+
this.selectedDate.getFullYear() === this.maximumDate.getFullYear() &&
|
|
1023
|
+
this.selectedDate.getMonth() === this.maximumDate.getMonth() &&
|
|
1024
|
+
this.selectedDate.getDate() === this.maximumDate.getDate());
|
|
1025
|
+
}
|
|
1026
|
+
setListHoursMinutes() {
|
|
1027
|
+
this.hours = this.hours.filter(hour => hour % this.step.hours === 0);
|
|
1028
|
+
this.minutes = this.minutes.filter(minute => minute % this.step.minutes === 0);
|
|
1029
|
+
this.seconds = this.seconds.filter(seconde => seconde % this.step.seconds === 0);
|
|
1030
|
+
}
|
|
1031
|
+
static { this.ɵfac = function DialogDateTimePickerComponent_Factory(t) { return new (t || DialogDateTimePickerComponent)(i0.ɵɵdirectiveInject(i1$1.MatDialogRef), i0.ɵɵdirectiveInject(MAT_DIALOG_DATA)); }; }
|
|
1032
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DialogDateTimePickerComponent, selectors: [["cauca-dialog-date-time-picker"]], standalone: true, features: [i0.ɵɵStandaloneFeature], decls: 20, vars: 6, 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-icon-button", "", 3, "click"], ["mat-icon-button", "", "cdkFocusInitial", "", 3, "click"], [3, "activated", "disabled", "click"], [1, "seconds"], [3, "activated", "disabled"]], template: function DialogDateTimePickerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1033
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div")(3, "mat-calendar", 2);
|
|
1034
|
+
i0.ɵɵlistener("selectedChange", function DialogDateTimePickerComponent_Template_mat_calendar_selectedChange_3_listener($event) { return ctx.dateChanged($event); });
|
|
1035
|
+
i0.ɵɵelementEnd()();
|
|
1036
|
+
i0.ɵɵelementStart(4, "div", 3)(5, "mat-list", 4);
|
|
1037
|
+
i0.ɵɵrepeaterCreate(6, DialogDateTimePickerComponent_For_7_Template, 2, 3, "mat-list-item", 12, i0.ɵɵrepeaterTrackByIdentity);
|
|
1038
|
+
i0.ɵɵelementEnd()();
|
|
1039
|
+
i0.ɵɵelementStart(8, "div", 5)(9, "mat-list", 4);
|
|
1040
|
+
i0.ɵɵrepeaterCreate(10, DialogDateTimePickerComponent_For_11_Template, 2, 3, "mat-list-item", 12, i0.ɵɵrepeaterTrackByIdentity);
|
|
1041
|
+
i0.ɵɵelementEnd()();
|
|
1042
|
+
i0.ɵɵtemplate(12, DialogDateTimePickerComponent_div_12_Template, 4, 1, "div", 6);
|
|
1043
|
+
i0.ɵɵelementEnd()();
|
|
1044
|
+
i0.ɵɵelementStart(13, "div", 7)(14, "button", 8);
|
|
1045
|
+
i0.ɵɵlistener("click", function DialogDateTimePickerComponent_Template_button_click_14_listener() { return ctx.cancel(); });
|
|
1046
|
+
i0.ɵɵelementStart(15, "mat-icon");
|
|
1047
|
+
i0.ɵɵtext(16, "cancel");
|
|
1048
|
+
i0.ɵɵelementEnd()();
|
|
1049
|
+
i0.ɵɵelementStart(17, "button", 9);
|
|
1050
|
+
i0.ɵɵlistener("click", function DialogDateTimePickerComponent_Template_button_click_17_listener() { return ctx.confirm(); });
|
|
1051
|
+
i0.ɵɵelementStart(18, "mat-icon");
|
|
1052
|
+
i0.ɵɵtext(19, "check");
|
|
1053
|
+
i0.ɵɵelementEnd()()();
|
|
1054
|
+
} if (rf & 2) {
|
|
1055
|
+
i0.ɵɵadvance(3);
|
|
1056
|
+
i0.ɵɵproperty("minDate", ctx.minimumDate)("maxDate", ctx.maximumDate)("selected", ctx.selectedDate);
|
|
1057
|
+
i0.ɵɵadvance(2);
|
|
1058
|
+
i0.ɵɵproperty("disabled", ctx.disabled.hours);
|
|
1059
|
+
i0.ɵɵadvance(1);
|
|
1060
|
+
i0.ɵɵrepeater(ctx.hours);
|
|
1061
|
+
i0.ɵɵadvance(3);
|
|
1062
|
+
i0.ɵɵproperty("disabled", ctx.disabled.minutes);
|
|
1063
|
+
i0.ɵɵadvance(1);
|
|
1064
|
+
i0.ɵɵrepeater(ctx.minutes);
|
|
1065
|
+
i0.ɵɵadvance(2);
|
|
1066
|
+
i0.ɵɵproperty("ngIf", ctx.showSeconds);
|
|
1067
|
+
} }, dependencies: [CommonModule, i2.NgIf, CaucaCoreForChildModule,
|
|
1068
|
+
MatButtonModule, i3.MatIconButton, MatDatepickerModule, i4$1.MatCalendar, MatIconModule, i5.MatIcon, MatListModule, i6$1.MatList, i6$1.MatListItem, MatNativeDateModule], styles: ["div[mat-dialog-actions][_ngcontent-%COMP%]{padding:10px 0;border-top:1px solid #ccc}.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)}"] }); }
|
|
1069
|
+
}
|
|
1070
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DialogDateTimePickerComponent, [{
|
|
1071
|
+
type: Component,
|
|
1072
|
+
args: [{ selector: 'cauca-dialog-date-time-picker', standalone: true, imports: [
|
|
1073
|
+
CommonModule,
|
|
1074
|
+
CaucaCoreForChildModule,
|
|
1075
|
+
MatButtonModule,
|
|
1076
|
+
MatDatepickerModule,
|
|
1077
|
+
MatIconModule,
|
|
1078
|
+
MatListModule,
|
|
1079
|
+
MatNativeDateModule,
|
|
1080
|
+
], 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-icon-button (click)=\"cancel()\"><mat-icon>cancel</mat-icon></button>\n <button mat-icon-button cdkFocusInitial (click)=\"confirm()\"><mat-icon>check</mat-icon></button>\n</div>", styles: ["div[mat-dialog-actions]{padding:10px 0;border-top:1px solid #ccc}.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"] }]
|
|
1081
|
+
}], () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
|
|
1082
|
+
type: Inject,
|
|
1083
|
+
args: [MAT_DIALOG_DATA]
|
|
1084
|
+
}] }], null); })();
|
|
1085
|
+
(() => { (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 }); })();
|
|
1086
|
+
|
|
1087
|
+
class CaucaDateTimePickerComponent {
|
|
1088
|
+
constructor(dialog, datePipe) {
|
|
1089
|
+
this.dialog = dialog;
|
|
1090
|
+
this.datePipe = datePipe;
|
|
1091
|
+
this.stepHours = 1;
|
|
1092
|
+
this.stepMinutes = 1;
|
|
1093
|
+
this.stepSecondes = 1;
|
|
1094
|
+
this.minimumDate = null;
|
|
1095
|
+
this.maximumDate = null;
|
|
1096
|
+
this.showSeconds = false;
|
|
1097
|
+
this.showFormat = 'yyyy/MM/dd, HH:mm';
|
|
1098
|
+
this.selectedChange = new EventEmitter();
|
|
1099
|
+
this.stringDate = '';
|
|
1100
|
+
}
|
|
1101
|
+
set value(value) {
|
|
1102
|
+
if (value) {
|
|
1103
|
+
this.stringDate = this.stringifyDate(value);
|
|
1104
|
+
this.selectedDate = value;
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
showDialog() {
|
|
1108
|
+
const options = {
|
|
1109
|
+
selectedDate: this.selectedDate,
|
|
1110
|
+
minimumDate: this.minimumDate,
|
|
1111
|
+
maximumDate: this.maximumDate,
|
|
1112
|
+
showSeconds: this.showSeconds,
|
|
1113
|
+
step: {
|
|
1114
|
+
hours: this.stepHours,
|
|
1115
|
+
minutes: this.stepMinutes,
|
|
1116
|
+
seconds: this.stepSecondes,
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
const dialogRef = this.dialog.open(DialogDateTimePickerComponent, {
|
|
1120
|
+
data: options,
|
|
1121
|
+
});
|
|
1122
|
+
dialogRef.afterClosed().subscribe((date) => {
|
|
1123
|
+
this.stringDate = this.stringifyDate(date);
|
|
1124
|
+
this.selectedDate = date;
|
|
1125
|
+
this.selectedChange.emit(date);
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
stringifyDate(date) {
|
|
1129
|
+
return this.datePipe.transform(date, this.showFormat);
|
|
1130
|
+
}
|
|
1131
|
+
static { this.ɵfac = function CaucaDateTimePickerComponent_Factory(t) { return new (t || CaucaDateTimePickerComponent)(i0.ɵɵdirectiveInject(i1$1.MatDialog), i0.ɵɵdirectiveInject(i2.DatePipe)); }; }
|
|
1132
|
+
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([
|
|
1133
|
+
DatePipe,
|
|
1134
|
+
]), i0.ɵɵStandaloneFeature], decls: 5, vars: 1, consts: [[1, "example-full-width"], ["matInput", "", "readonly", "readonly", 3, "value"], ["matSuffix", "", "mat-icon-button", "", 3, "click"]], template: function CaucaDateTimePickerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1135
|
+
i0.ɵɵelementStart(0, "mat-form-field", 0);
|
|
1136
|
+
i0.ɵɵelement(1, "input", 1);
|
|
1137
|
+
i0.ɵɵelementStart(2, "button", 2);
|
|
1138
|
+
i0.ɵɵlistener("click", function CaucaDateTimePickerComponent_Template_button_click_2_listener() { return ctx.showDialog(); });
|
|
1139
|
+
i0.ɵɵelementStart(3, "mat-icon");
|
|
1140
|
+
i0.ɵɵtext(4, "calendar_month");
|
|
1141
|
+
i0.ɵɵelementEnd()()();
|
|
1142
|
+
} if (rf & 2) {
|
|
1143
|
+
i0.ɵɵadvance(1);
|
|
1144
|
+
i0.ɵɵproperty("value", ctx.stringDate);
|
|
1145
|
+
} }, dependencies: [MatButtonModule, i3.MatIconButton, MatIconModule, i5.MatIcon, MatInputModule, i5$1.MatInput, i4.MatFormField, i4.MatSuffix] }); }
|
|
1146
|
+
}
|
|
1147
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaDateTimePickerComponent, [{
|
|
1148
|
+
type: Component,
|
|
1149
|
+
args: [{ selector: 'cauca-date-time-picker', standalone: true, imports: [
|
|
1150
|
+
MatButtonModule,
|
|
1151
|
+
MatIconModule,
|
|
1152
|
+
MatInputModule,
|
|
1153
|
+
], providers: [
|
|
1154
|
+
DatePipe,
|
|
1155
|
+
], template: "<mat-form-field class=\"example-full-width\">\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>" }]
|
|
1156
|
+
}], () => [{ type: i1$1.MatDialog }, { type: i2.DatePipe }], { stepHours: [{
|
|
1157
|
+
type: Input
|
|
1158
|
+
}], stepMinutes: [{
|
|
1159
|
+
type: Input
|
|
1160
|
+
}], stepSecondes: [{
|
|
1161
|
+
type: Input
|
|
1162
|
+
}], minimumDate: [{
|
|
1163
|
+
type: Input
|
|
1164
|
+
}], maximumDate: [{
|
|
1165
|
+
type: Input
|
|
1166
|
+
}], showSeconds: [{
|
|
1167
|
+
type: Input
|
|
1168
|
+
}], showFormat: [{
|
|
1169
|
+
type: Input
|
|
1170
|
+
}], selectedChange: [{
|
|
1171
|
+
type: Output
|
|
1172
|
+
}], value: [{
|
|
1173
|
+
type: Input
|
|
1174
|
+
}] }); })();
|
|
1175
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaucaDateTimePickerComponent, { className: "CaucaDateTimePickerComponent", filePath: "lib/cauca-date-time-picker/cauca-date-time-picker.component.ts", lineNumber: 24 }); })();
|
|
1176
|
+
|
|
843
1177
|
class MenuItem {
|
|
844
1178
|
constructor(label, path, icon = '') {
|
|
845
1179
|
this.label = label;
|
|
@@ -857,5 +1191,5 @@ class MenuItem {
|
|
|
857
1191
|
* Generated bundle index. Do not edit.
|
|
858
1192
|
*/
|
|
859
1193
|
|
|
860
|
-
export { CaucaInputFileComponent, CaucaInputMultipleLangueComponent, CaucaMaterialComponent, CaucaMaterialModule, CaucaMaterialService, CaucaMenuSidebarComponent, CaucaMenuVerticalComponent, CaucaSimpleDialogComponent, CaucaSlideshowComponent, MenuItem };
|
|
1194
|
+
export { CaucaDateTimePickerComponent, CaucaInputFileComponent, CaucaInputMultipleLangueComponent, CaucaMaterialComponent, CaucaMaterialModule, CaucaMaterialService, CaucaMenuSidebarComponent, CaucaMenuVerticalComponent, CaucaSimpleDialogComponent, CaucaSlideshowComponent, MenuItem };
|
|
861
1195
|
//# sourceMappingURL=cauca-911-material.mjs.map
|