@cauca-911/material 17.1.1 → 17.1.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/esm2022/lib/cauca-date-time-picker/cauca-date-time-picker.component.mjs +21 -6
- package/esm2022/lib/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.mjs +81 -54
- package/esm2022/lib/cauca-date-time-picker/models/dialog-date-time-picker-data.mjs +1 -1
- package/fesm2022/cauca-911-material.mjs +100 -58
- package/fesm2022/cauca-911-material.mjs.map +1 -1
- package/lib/cauca-date-time-picker/cauca-date-time-picker.component.d.ts +3 -1
- package/lib/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.d.ts +2 -0
- package/lib/cauca-date-time-picker/models/dialog-date-time-picker-data.d.ts +2 -0
- package/package.json +1 -1
|
@@ -846,47 +846,47 @@ class CaucaMaterialModule {
|
|
|
846
846
|
CaucaSlideshowComponent] }); })();
|
|
847
847
|
|
|
848
848
|
function DialogDateTimePickerComponent_For_7_Template(rf, ctx) { if (rf & 1) {
|
|
849
|
-
const
|
|
850
|
-
i0.ɵɵelementStart(0, "mat-list-item",
|
|
851
|
-
i0.ɵɵlistener("click", function DialogDateTimePickerComponent_For_7_Template_mat_list_item_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(
|
|
849
|
+
const _r12 = i0.ɵɵgetCurrentView();
|
|
850
|
+
i0.ɵɵelementStart(0, "mat-list-item", 12);
|
|
851
|
+
i0.ɵɵlistener("click", function DialogDateTimePickerComponent_For_7_Template_mat_list_item_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r12); const hour_r6 = restoredCtx.$implicit; const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.hourChanged(hour_r6)); });
|
|
852
852
|
i0.ɵɵtext(1);
|
|
853
853
|
i0.ɵɵelementEnd();
|
|
854
854
|
} if (rf & 2) {
|
|
855
|
-
const
|
|
855
|
+
const hour_r6 = ctx.$implicit;
|
|
856
856
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
857
|
-
i0.ɵɵproperty("activated", ctx_r0.selectedHour ===
|
|
857
|
+
i0.ɵɵproperty("activated", ctx_r0.selectedHour === hour_r6)("disabled", ctx_r0.disabled.someHours.includes(hour_r6));
|
|
858
858
|
i0.ɵɵadvance(1);
|
|
859
|
-
i0.ɵɵtextInterpolate((
|
|
859
|
+
i0.ɵɵtextInterpolate((hour_r6 < 10 ? "0" : "") + hour_r6);
|
|
860
860
|
} }
|
|
861
861
|
function DialogDateTimePickerComponent_For_11_Template(rf, ctx) { if (rf & 1) {
|
|
862
|
-
const
|
|
863
|
-
i0.ɵɵelementStart(0, "mat-list-item",
|
|
864
|
-
i0.ɵɵlistener("click", function DialogDateTimePickerComponent_For_11_Template_mat_list_item_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(
|
|
862
|
+
const _r19 = i0.ɵɵgetCurrentView();
|
|
863
|
+
i0.ɵɵelementStart(0, "mat-list-item", 12);
|
|
864
|
+
i0.ɵɵlistener("click", function DialogDateTimePickerComponent_For_11_Template_mat_list_item_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r19); const minute_r13 = restoredCtx.$implicit; const ctx_r18 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r18.minuteChanged(minute_r13)); });
|
|
865
865
|
i0.ɵɵtext(1);
|
|
866
866
|
i0.ɵɵelementEnd();
|
|
867
867
|
} if (rf & 2) {
|
|
868
|
-
const
|
|
868
|
+
const minute_r13 = ctx.$implicit;
|
|
869
869
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
870
|
-
i0.ɵɵproperty("activated", ctx_r1.selectedMinute ===
|
|
870
|
+
i0.ɵɵproperty("activated", ctx_r1.selectedMinute === minute_r13)("disabled", ctx_r1.disabled.someMinutes.includes(minute_r13));
|
|
871
871
|
i0.ɵɵadvance(1);
|
|
872
|
-
i0.ɵɵtextInterpolate((
|
|
872
|
+
i0.ɵɵtextInterpolate((minute_r13 < 10 ? "0" : "") + minute_r13);
|
|
873
873
|
} }
|
|
874
874
|
function DialogDateTimePickerComponent_div_12_For_3_Template(rf, ctx) { if (rf & 1) {
|
|
875
|
-
const
|
|
876
|
-
i0.ɵɵelementStart(0, "mat-list-item",
|
|
877
|
-
i0.ɵɵlistener("click", function DialogDateTimePickerComponent_div_12_For_3_Template_mat_list_item_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(
|
|
875
|
+
const _r27 = i0.ɵɵgetCurrentView();
|
|
876
|
+
i0.ɵɵelementStart(0, "mat-list-item", 12);
|
|
877
|
+
i0.ɵɵlistener("click", function DialogDateTimePickerComponent_div_12_For_3_Template_mat_list_item_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r27); const second_r21 = restoredCtx.$implicit; const ctx_r26 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r26.secondChanged(second_r21)); });
|
|
878
878
|
i0.ɵɵtext(1);
|
|
879
879
|
i0.ɵɵelementEnd();
|
|
880
880
|
} if (rf & 2) {
|
|
881
|
-
const
|
|
882
|
-
const
|
|
883
|
-
i0.ɵɵproperty("activated",
|
|
881
|
+
const second_r21 = ctx.$implicit;
|
|
882
|
+
const ctx_r20 = i0.ɵɵnextContext(2);
|
|
883
|
+
i0.ɵɵproperty("activated", ctx_r20.selectedSecond === second_r21)("disabled", ctx_r20.disabled.someSeconds.includes(second_r21));
|
|
884
884
|
i0.ɵɵadvance(1);
|
|
885
|
-
i0.ɵɵtextInterpolate((
|
|
885
|
+
i0.ɵɵtextInterpolate((second_r21 < 10 ? "0" : "") + second_r21);
|
|
886
886
|
} }
|
|
887
887
|
function DialogDateTimePickerComponent_div_12_Template(rf, ctx) { if (rf & 1) {
|
|
888
|
-
i0.ɵɵelementStart(0, "div",
|
|
889
|
-
i0.ɵɵrepeaterCreate(2, DialogDateTimePickerComponent_div_12_For_3_Template, 2, 3, "mat-list-item",
|
|
888
|
+
i0.ɵɵelementStart(0, "div", 13)(1, "mat-list", 4);
|
|
889
|
+
i0.ɵɵrepeaterCreate(2, DialogDateTimePickerComponent_div_12_For_3_Template, 2, 3, "mat-list-item", 14, i0.ɵɵrepeaterTrackByIdentity);
|
|
890
890
|
i0.ɵɵelementEnd()();
|
|
891
891
|
} if (rf & 2) {
|
|
892
892
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
@@ -895,6 +895,36 @@ function DialogDateTimePickerComponent_div_12_Template(rf, ctx) { if (rf & 1) {
|
|
|
895
895
|
i0.ɵɵadvance(1);
|
|
896
896
|
i0.ɵɵrepeater(ctx_r2.seconds);
|
|
897
897
|
} }
|
|
898
|
+
function DialogDateTimePickerComponent_button_14_mat_icon_1_Template(rf, ctx) { if (rf & 1) {
|
|
899
|
+
i0.ɵɵelementStart(0, "mat-icon");
|
|
900
|
+
i0.ɵɵtext(1, "clear");
|
|
901
|
+
i0.ɵɵelementEnd();
|
|
902
|
+
} }
|
|
903
|
+
function DialogDateTimePickerComponent_button_14_Template(rf, ctx) { if (rf & 1) {
|
|
904
|
+
const _r30 = i0.ɵɵgetCurrentView();
|
|
905
|
+
i0.ɵɵelementStart(0, "button", 9);
|
|
906
|
+
i0.ɵɵlistener("click", function DialogDateTimePickerComponent_button_14_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r30); const ctx_r29 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r29.clear()); });
|
|
907
|
+
i0.ɵɵtemplate(1, DialogDateTimePickerComponent_button_14_mat_icon_1_Template, 2, 0, "mat-icon", 10);
|
|
908
|
+
i0.ɵɵtext(2);
|
|
909
|
+
i0.ɵɵpipe(3, "translate");
|
|
910
|
+
i0.ɵɵelementEnd();
|
|
911
|
+
} if (rf & 2) {
|
|
912
|
+
const ctx_r3 = i0.ɵɵnextContext();
|
|
913
|
+
i0.ɵɵadvance(1);
|
|
914
|
+
i0.ɵɵproperty("ngIf", ctx_r3.showButtonIcons);
|
|
915
|
+
i0.ɵɵadvance(1);
|
|
916
|
+
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "material.clear"), " ");
|
|
917
|
+
} }
|
|
918
|
+
function DialogDateTimePickerComponent_mat_icon_16_Template(rf, ctx) { if (rf & 1) {
|
|
919
|
+
i0.ɵɵelementStart(0, "mat-icon");
|
|
920
|
+
i0.ɵɵtext(1, "cancel");
|
|
921
|
+
i0.ɵɵelementEnd();
|
|
922
|
+
} }
|
|
923
|
+
function DialogDateTimePickerComponent_mat_icon_20_Template(rf, ctx) { if (rf & 1) {
|
|
924
|
+
i0.ɵɵelementStart(0, "mat-icon");
|
|
925
|
+
i0.ɵɵtext(1, "check");
|
|
926
|
+
i0.ɵɵelementEnd();
|
|
927
|
+
} }
|
|
898
928
|
class DialogDateTimePickerComponent {
|
|
899
929
|
constructor(dialogRef, options) {
|
|
900
930
|
this.dialogRef = dialogRef;
|
|
@@ -907,6 +937,8 @@ class DialogDateTimePickerComponent {
|
|
|
907
937
|
this.minimumDate = new Date();
|
|
908
938
|
this.maximumDate = new Date();
|
|
909
939
|
this.showSeconds = false;
|
|
940
|
+
this.showClearButton = true;
|
|
941
|
+
this.showButtonIcons = true;
|
|
910
942
|
this.hours = [...Array(24).keys()];
|
|
911
943
|
this.minutes = [...Array(60).keys()];
|
|
912
944
|
this.seconds = [...Array(60).keys()];
|
|
@@ -925,6 +957,8 @@ class DialogDateTimePickerComponent {
|
|
|
925
957
|
};
|
|
926
958
|
this.step = options.step || this.step;
|
|
927
959
|
this.showSeconds = options.showSeconds;
|
|
960
|
+
this.showButtonIcons = options.showButtonIcons ?? this.showButtonIcons;
|
|
961
|
+
this.showClearButton = options.showClearButton ?? this.showClearButton;
|
|
928
962
|
this.setListHoursMinutes();
|
|
929
963
|
this.initialEachComponentValue(options);
|
|
930
964
|
}
|
|
@@ -1020,7 +1054,6 @@ class DialogDateTimePickerComponent {
|
|
|
1020
1054
|
this.hourChanged(options.selectedDate ? new Date(options.selectedDate).getHours() : 0);
|
|
1021
1055
|
this.minuteChanged(options.selectedDate ? new Date(options.selectedDate).getMinutes() : 0);
|
|
1022
1056
|
this.secondChanged(options.selectedDate ? new Date(options.selectedDate).getSeconds() : 0);
|
|
1023
|
-
console.log(this.selectedDate);
|
|
1024
1057
|
}
|
|
1025
1058
|
selectedDateIsTheMinimumDate() {
|
|
1026
1059
|
return (this.minimumDate &&
|
|
@@ -1040,41 +1073,31 @@ class DialogDateTimePickerComponent {
|
|
|
1040
1073
|
this.seconds = this.seconds.filter(seconde => seconde % this.step.seconds === 0);
|
|
1041
1074
|
}
|
|
1042
1075
|
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:
|
|
1076
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DialogDateTimePickerComponent, selectors: [["cauca-dialog-date-time-picker"]], standalone: true, features: [i0.ɵɵStandaloneFeature], decls: 23, 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", 4, "ngIf"], ["mat-stroked-button", "", 3, "click"], [4, "ngIf"], ["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
1077
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div")(3, "mat-calendar", 2);
|
|
1045
1078
|
i0.ɵɵlistener("selectedChange", function DialogDateTimePickerComponent_Template_mat_calendar_selectedChange_3_listener($event) { return ctx.dateChanged($event); });
|
|
1046
1079
|
i0.ɵɵelementEnd()();
|
|
1047
1080
|
i0.ɵɵelementStart(4, "div", 3)(5, "mat-list", 4);
|
|
1048
|
-
i0.ɵɵrepeaterCreate(6, DialogDateTimePickerComponent_For_7_Template, 2, 3, "mat-list-item",
|
|
1081
|
+
i0.ɵɵrepeaterCreate(6, DialogDateTimePickerComponent_For_7_Template, 2, 3, "mat-list-item", 14, i0.ɵɵrepeaterTrackByIdentity);
|
|
1049
1082
|
i0.ɵɵelementEnd()();
|
|
1050
1083
|
i0.ɵɵelementStart(8, "div", 5)(9, "mat-list", 4);
|
|
1051
|
-
i0.ɵɵrepeaterCreate(10, DialogDateTimePickerComponent_For_11_Template, 2, 3, "mat-list-item",
|
|
1084
|
+
i0.ɵɵrepeaterCreate(10, DialogDateTimePickerComponent_For_11_Template, 2, 3, "mat-list-item", 14, i0.ɵɵrepeaterTrackByIdentity);
|
|
1052
1085
|
i0.ɵɵelementEnd()();
|
|
1053
1086
|
i0.ɵɵtemplate(12, DialogDateTimePickerComponent_div_12_Template, 4, 1, "div", 6);
|
|
1054
1087
|
i0.ɵɵelementEnd()();
|
|
1055
|
-
i0.ɵɵelementStart(13, "div", 7)
|
|
1056
|
-
i0.ɵɵ
|
|
1057
|
-
i0.ɵɵelementStart(15, "
|
|
1058
|
-
i0.ɵɵ
|
|
1059
|
-
i0.ɵɵ
|
|
1088
|
+
i0.ɵɵelementStart(13, "div", 7);
|
|
1089
|
+
i0.ɵɵtemplate(14, DialogDateTimePickerComponent_button_14_Template, 4, 4, "button", 8);
|
|
1090
|
+
i0.ɵɵelementStart(15, "button", 9);
|
|
1091
|
+
i0.ɵɵlistener("click", function DialogDateTimePickerComponent_Template_button_click_15_listener() { return ctx.cancel(); });
|
|
1092
|
+
i0.ɵɵtemplate(16, DialogDateTimePickerComponent_mat_icon_16_Template, 2, 0, "mat-icon", 10);
|
|
1060
1093
|
i0.ɵɵtext(17);
|
|
1061
1094
|
i0.ɵɵpipe(18, "translate");
|
|
1062
1095
|
i0.ɵɵelementEnd();
|
|
1063
|
-
i0.ɵɵelementStart(19, "button",
|
|
1064
|
-
i0.ɵɵlistener("click", function DialogDateTimePickerComponent_Template_button_click_19_listener() { return ctx.
|
|
1065
|
-
i0.ɵɵ
|
|
1066
|
-
i0.ɵɵtext(21
|
|
1067
|
-
i0.ɵɵ
|
|
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");
|
|
1096
|
+
i0.ɵɵelementStart(19, "button", 11);
|
|
1097
|
+
i0.ɵɵlistener("click", function DialogDateTimePickerComponent_Template_button_click_19_listener() { return ctx.confirm(); });
|
|
1098
|
+
i0.ɵɵtemplate(20, DialogDateTimePickerComponent_mat_icon_20_Template, 2, 0, "mat-icon", 10);
|
|
1099
|
+
i0.ɵɵtext(21);
|
|
1100
|
+
i0.ɵɵpipe(22, "translate");
|
|
1078
1101
|
i0.ɵɵelementEnd()();
|
|
1079
1102
|
} if (rf & 2) {
|
|
1080
1103
|
i0.ɵɵadvance(3);
|
|
@@ -1089,13 +1112,17 @@ class DialogDateTimePickerComponent {
|
|
|
1089
1112
|
i0.ɵɵrepeater(ctx.minutes);
|
|
1090
1113
|
i0.ɵɵadvance(2);
|
|
1091
1114
|
i0.ɵɵproperty("ngIf", ctx.showSeconds);
|
|
1092
|
-
i0.ɵɵadvance(
|
|
1093
|
-
i0.ɵɵ
|
|
1094
|
-
i0.ɵɵadvance(
|
|
1095
|
-
i0.ɵɵ
|
|
1096
|
-
i0.ɵɵadvance(
|
|
1097
|
-
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(
|
|
1098
|
-
|
|
1115
|
+
i0.ɵɵadvance(2);
|
|
1116
|
+
i0.ɵɵproperty("ngIf", ctx.showClearButton);
|
|
1117
|
+
i0.ɵɵadvance(2);
|
|
1118
|
+
i0.ɵɵproperty("ngIf", ctx.showButtonIcons);
|
|
1119
|
+
i0.ɵɵadvance(1);
|
|
1120
|
+
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(18, 11, "material.cancel"), " ");
|
|
1121
|
+
i0.ɵɵadvance(3);
|
|
1122
|
+
i0.ɵɵproperty("ngIf", ctx.showButtonIcons);
|
|
1123
|
+
i0.ɵɵadvance(1);
|
|
1124
|
+
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(22, 13, "material.ok"), " ");
|
|
1125
|
+
} }, 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:8px;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
1126
|
}
|
|
1100
1127
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DialogDateTimePickerComponent, [{
|
|
1101
1128
|
type: Component,
|
|
@@ -1107,7 +1134,7 @@ class DialogDateTimePickerComponent {
|
|
|
1107
1134
|
MatIconModule,
|
|
1108
1135
|
MatListModule,
|
|
1109
1136
|
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.
|
|
1137
|
+
], 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\n<div mat-dialog-actions align=\"end\">\n <button mat-stroked-button (click)=\"clear()\" *ngIf=\"showClearButton\">\n <mat-icon *ngIf=\"showButtonIcons\">clear</mat-icon>\n {{'material.clear' | translate}}\n </button>\n <button mat-stroked-button (click)=\"cancel()\">\n <mat-icon *ngIf=\"showButtonIcons\">cancel</mat-icon>\n {{'material.cancel' | translate}}\n </button>\n <button color=\"primary\" mat-raised-button cdkFocusInitial (click)=\"confirm()\">\n <mat-icon *ngIf=\"showButtonIcons\">check</mat-icon>\n {{'material.ok' | translate}}\n </button>\n</div>", styles: ["div[mat-dialog-actions]{padding:8px;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
1138
|
}], () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
|
|
1112
1139
|
type: Inject,
|
|
1113
1140
|
args: [MAT_DIALOG_DATA]
|
|
@@ -1126,6 +1153,8 @@ class CaucaDateTimePickerComponent {
|
|
|
1126
1153
|
this.maximumDate = null;
|
|
1127
1154
|
this.showSeconds = false;
|
|
1128
1155
|
this.showFormat = 'yyyy/MM/dd, HH:mm';
|
|
1156
|
+
this.showClearButton = true;
|
|
1157
|
+
this.showButtonIcons = true;
|
|
1129
1158
|
this.selectedChange = new EventEmitter();
|
|
1130
1159
|
this.stringDate = '';
|
|
1131
1160
|
}
|
|
@@ -1154,6 +1183,8 @@ class CaucaDateTimePickerComponent {
|
|
|
1154
1183
|
minimumDate: this.minimumDate,
|
|
1155
1184
|
maximumDate: this.maximumDate,
|
|
1156
1185
|
showSeconds: this.showSeconds,
|
|
1186
|
+
showClearButton: this.showClearButton,
|
|
1187
|
+
showButtonIcons: this.showButtonIcons,
|
|
1157
1188
|
step: {
|
|
1158
1189
|
hours: this.stepHours,
|
|
1159
1190
|
minutes: this.stepMinutes,
|
|
@@ -1168,16 +1199,23 @@ class CaucaDateTimePickerComponent {
|
|
|
1168
1199
|
const rect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
1169
1200
|
const top = rect.y + rect.height - 22;
|
|
1170
1201
|
const bottom = window.innerHeight - rect.y;
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
}
|
|
1202
|
+
const minimumScreenSize = 800;
|
|
1203
|
+
if (window.innerHeight < minimumScreenSize || window.innerWidth < minimumScreenSize) {
|
|
1204
|
+
return null;
|
|
1205
|
+
}
|
|
1206
|
+
else if (window.innerHeight > (top + 350)) {
|
|
1207
|
+
return {
|
|
1208
|
+
left: `${rect.x}px`,
|
|
1209
|
+
top: `${top}px`,
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
return {
|
|
1175
1213
|
left: `${rect.x}px`,
|
|
1176
1214
|
bottom: `${bottom}px`,
|
|
1177
1215
|
};
|
|
1178
1216
|
}
|
|
1179
1217
|
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([
|
|
1218
|
+
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", showClearButton: "showClearButton", showButtonIcons: "showButtonIcons", value: "value" }, outputs: { selectedChange: "selectedChange" }, standalone: true, features: [i0.ɵɵProvidersFeature([
|
|
1181
1219
|
DatePipe,
|
|
1182
1220
|
]), 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
1221
|
i0.ɵɵelementStart(0, "mat-form-field");
|
|
@@ -1215,6 +1253,10 @@ class CaucaDateTimePickerComponent {
|
|
|
1215
1253
|
type: Input
|
|
1216
1254
|
}], showFormat: [{
|
|
1217
1255
|
type: Input
|
|
1256
|
+
}], showClearButton: [{
|
|
1257
|
+
type: Input
|
|
1258
|
+
}], showButtonIcons: [{
|
|
1259
|
+
type: Input
|
|
1218
1260
|
}], selectedChange: [{
|
|
1219
1261
|
type: Output
|
|
1220
1262
|
}], value: [{
|