UNPKG

@cauca-911/material

Version:

Run `npm install @cauca-911/material --save` to add this library to your project

731 lines (724 loc) 306 kB
import * as i0 from '@angular/core'; import { Injectable, Component, EventEmitter, Output, Input, signal, inject, HostListener, Injector, ElementRef, forwardRef, input, computed, output, Directive, ChangeDetectionStrategy, Inject, HostBinding, model, TemplateRef, Optional, Self, ContentChild, ViewChild, NgModule } from '@angular/core'; import * as i1 from '@ngx-translate/core'; import { TranslateModule, TranslatePipe, TranslateService } from '@ngx-translate/core'; import * as i1$6 from '@angular/material/dialog'; import { MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatDialogModule, MatDialogTitle, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import * as i1$1 from '@angular/material/icon'; import { MatIconModule, MatIcon } from '@angular/material/icon'; import * as i3 from '@angular/material/input'; import { MatInputModule, MatInput } from '@angular/material/input'; import { provideNativeDateAdapter } from '@angular/material/core'; import * as i2$1 from '@angular/material/datepicker'; import { MatDatepickerModule } from '@angular/material/datepicker'; import * as i1$2 from '@angular/material/list'; import { MatListModule } from '@angular/material/list'; import { CaucaCoreForChildModule, toLowerCaseAndWithoutDiacritics, TranslateService as TranslateService$1, CaucaCoreService } from '@cauca-911/core'; import * as i2 from '@angular/material/button'; import { MatButtonModule, MatButton, MatIconButton } from '@angular/material/button'; import * as i1$3 from '@angular/common'; import { CommonModule, DatePipe, NgClass } from '@angular/common'; import * as i1$4 from '@angular/material/form-field'; import { MatFormFieldModule, MatFormFieldControl } from '@angular/material/form-field'; import * as i1$7 from '@angular/forms'; import { Validators, NgControl, FormControlName, ControlContainer, FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule, FormGroup, FormControlDirective, UntypedFormControl } from '@angular/forms'; import * as i1$5 from '@angular/cdk/clipboard'; import { MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; import { firstValueFrom, of, tap, mergeMap, catchError, finalize, throwError, filter, Subject, startWith, map, ReplaySubject, switchMap, EMPTY, combineLatest, distinctUntilChanged } from 'rxjs'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import * as i2$2 from '@angular/cdk/layout'; import * as i5 from '@angular/cdk/text-field'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import * as i1$8 from '@angular/material/chips'; import { MatChipsModule, MatChipGrid, MatChip, MatChipRemove, MatChipInput } from '@angular/material/chips'; import * as i1$9 from '@fortawesome/angular-fontawesome'; import { FontAwesomeModule, FaIconComponent } from '@fortawesome/angular-fontawesome'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; import * as i2$3 from '@angular/material/autocomplete'; import { MatAutocompleteModule, MatAutocompleteTrigger } from '@angular/material/autocomplete'; import * as i1$a from '@angular/router'; import { RouterModule, Router, NavigationEnd } from '@angular/router'; import { MatTabGroup, MatTab } from '@angular/material/tabs'; import { trigger, state, transition, style, animate } from '@angular/animations'; class CaucaMaterialService { static { this.ɵfac = function CaucaMaterialService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaucaMaterialService)(); }; } static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaucaMaterialService, factory: CaucaMaterialService.ɵfac, providedIn: 'root' }); } } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaMaterialService, [{ type: Injectable, args: [{ providedIn: 'root' }] }], null, null); })(); class CaucaMaterialComponent { static { this.ɵfac = function CaucaMaterialComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaucaMaterialComponent)(); }; } static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaucaMaterialComponent, selectors: [["cauca-material"]], decls: 3, vars: 3, template: function CaucaMaterialComponent_Template(rf, ctx) { if (rf & 1) { i0.ɵɵdomElementStart(0, "div"); i0.ɵɵtext(1); i0.ɵɵpipe(2, "translate"); i0.ɵɵdomElementEnd(); } if (rf & 2) { i0.ɵɵadvance(); i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "core.noGenericComponentOnThisLibrary")); } }, dependencies: [TranslateModule, i1.TranslatePipe], encapsulation: 2 }); } } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaMaterialComponent, [{ type: Component, args: [{ selector: 'cauca-material', imports: [TranslateModule], template: "<div>{{'core.noGenericComponentOnThisLibrary' | translate}}</div>" }] }], null, null); })(); (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaucaMaterialComponent, { className: "CaucaMaterialComponent", filePath: "lib/cauca-material.component.ts", lineNumber: 10 }); })(); class MobileTimePickerComponent { constructor() { this.valueChange = new EventEmitter(); } valueUp() { const currentIndex = this.options.indexOf(this.value); let newValue = 0; if (currentIndex === this.options.length - 1) { newValue = this.options[0]; } else { newValue = this.options[currentIndex + 1]; } this.valueChange.emit(newValue); } valueDown() { const currentIndex = this.options.indexOf(this.value); let newValue = 0; if (currentIndex === 0) { newValue = this.options[this.options.length - 1]; } else { newValue = this.options[currentIndex - 1]; } this.valueChange.emit(newValue); } static { this.ɵfac = function MobileTimePickerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MobileTimePickerComponent)(); }; } static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MobileTimePickerComponent, selectors: [["cauca-mobile-time-picker"]], inputs: { value: "value", options: "options" }, outputs: { valueChange: "valueChange" }, decls: 8, vars: 1, consts: [["mat-icon-button", "", 3, "click"]], template: function MobileTimePickerComponent_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "button", 0); i0.ɵɵlistener("click", function MobileTimePickerComponent_Template_button_click_0_listener() { return ctx.valueUp(); }); i0.ɵɵelementStart(1, "mat-icon"); i0.ɵɵtext(2, "keyboard_arrow_up"); i0.ɵɵelementEnd()(); i0.ɵɵelementStart(3, "div"); i0.ɵɵtext(4); i0.ɵɵelementEnd(); i0.ɵɵelementStart(5, "button", 0); i0.ɵɵlistener("click", function MobileTimePickerComponent_Template_button_click_5_listener() { return ctx.valueDown(); }); i0.ɵɵelementStart(6, "mat-icon"); i0.ɵɵtext(7, "keyboard_arrow_down"); i0.ɵɵelementEnd()(); } if (rf & 2) { i0.ɵɵadvance(4); i0.ɵɵtextInterpolate1("\n", (ctx.value < 10 ? "0" : "") + ctx.value, "\n"); } }, dependencies: [MatButtonModule, i2.MatIconButton, MatIconModule, i1$1.MatIcon, MatFormFieldModule, MatInputModule], styles: ["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:70px;font-family:var(--mat-form-field-container-text-font)}.mat-mdc-icon-button[_ngcontent-%COMP%]{height:24px;width:24px;line-height:24px;padding:0}"] }); } } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MobileTimePickerComponent, [{ type: Component, args: [{ selector: 'cauca-mobile-time-picker', imports: [ MatButtonModule, MatIconModule, MatFormFieldModule, MatInputModule ], template: "<button mat-icon-button (click)=\"valueUp()\">\n <mat-icon>keyboard_arrow_up</mat-icon>\n</button>\n<div>\n{{(value < 10 ? '0' : '' ) + value}}\n</div>\n<button mat-icon-button (click)=\"valueDown()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n</button>\n", styles: [":host{display:flex;flex-direction:column;align-items:center;justify-content:center;height:70px;font-family:var(--mat-form-field-container-text-font)}.mat-mdc-icon-button{height:24px;width:24px;line-height:24px;padding:0}\n"] }] }], null, { value: [{ type: Input, args: [{ required: true }] }], options: [{ type: Input, args: [{ required: true }] }], valueChange: [{ type: Output }] }); })(); (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MobileTimePickerComponent, { className: "MobileTimePickerComponent", filePath: "lib/components/cauca-date-time-picker/components/mobile-time-picker/mobile-time-picker.component.ts", lineNumber: 18 }); })(); function DesktopTimePickerComponent_For_2_Template(rf, ctx) { if (rf & 1) { const _r1 = i0.ɵɵgetCurrentView(); i0.ɵɵelementStart(0, "mat-list-item", 2); i0.ɵɵlistener("click", function DesktopTimePickerComponent_For_2_Template_mat_list_item_click_0_listener() { const option_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.valueChange.emit(option_r2)); }); i0.ɵɵtext(1); i0.ɵɵelementEnd(); } if (rf & 2) { const option_r2 = ctx.$implicit; const ctx_r2 = i0.ɵɵnextContext(); i0.ɵɵproperty("activated", ctx_r2.value === option_r2)("disabled", ctx_r2.disabled == null ? null : ctx_r2.disabled.someOptions.includes(option_r2)); i0.ɵɵadvance(); i0.ɵɵtextInterpolate((option_r2 < 10 ? "0" : "") + option_r2); } } class DesktopTimePickerComponent { constructor() { this.options = []; this.valueChange = new EventEmitter(); } static { this.ɵfac = function DesktopTimePickerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DesktopTimePickerComponent)(); }; } static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DesktopTimePickerComponent, selectors: [["cauca-desktop-time-picker"]], inputs: { options: "options", value: "value", disabled: "disabled" }, outputs: { valueChange: "valueChange" }, decls: 3, vars: 1, consts: [[3, "disabled"], [3, "activated", "disabled"], [3, "click", "activated", "disabled"]], template: function DesktopTimePickerComponent_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "mat-list", 0); i0.ɵɵrepeaterCreate(1, DesktopTimePickerComponent_For_2_Template, 2, 3, "mat-list-item", 1, i0.ɵɵrepeaterTrackByIdentity); i0.ɵɵelementEnd(); } if (rf & 2) { i0.ɵɵproperty("disabled", ctx.disabled == null ? null : ctx.disabled.all); i0.ɵɵadvance(); i0.ɵɵrepeater(ctx.options); } }, dependencies: [MatListModule, i1$2.MatList, i1$2.MatListItem], styles: ["mat-list[_ngcontent-%COMP%]{width:50px;padding:0}mat-list[_ngcontent-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%]:not(.mat-mdc-list-item-interactive){cursor:pointer} > div[_ngcontent-%COMP%]::-webkit-scrollbar{display:none} .mdc-list-item__primary-text{font-family:var(--mat-datepicker-calendar-text-font);font-size:var(--mat-datepicker-calendar-text-size)} .mdc-list-item--activated{background-color:var(--mat-datepicker-calendar-date-selected-state-background-color)} .mdc-list-item--activated .mdc-list-item__primary-text{color:var(--mat-datepicker-calendar-date-selected-state-text-color)}"] }); } } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DesktopTimePickerComponent, [{ type: Component, args: [{ selector: 'cauca-desktop-time-picker', imports: [ MatListModule ], template: "<mat-list [disabled]=\"disabled?.all\">\n @for (option of options; track option) {\n <mat-list-item [activated]=\"value === option\" [disabled]=\"disabled?.someOptions.includes(option)\"\n (click)=\"valueChange.emit(option)\">{{(option < 10 ? '0' : '' ) + option}}</mat-list-item>\n }\n</mat-list>", styles: ["mat-list{width:50px;padding:0}mat-list .mat-mdc-list-item:not(.mat-mdc-list-item-interactive){cursor:pointer}>div::-webkit-scrollbar{display:none}::ng-deep .mdc-list-item__primary-text{font-family:var(--mat-datepicker-calendar-text-font);font-size:var(--mat-datepicker-calendar-text-size)}::ng-deep .mdc-list-item--activated{background-color:var(--mat-datepicker-calendar-date-selected-state-background-color)}::ng-deep .mdc-list-item--activated .mdc-list-item__primary-text{color:var(--mat-datepicker-calendar-date-selected-state-text-color)}\n"] }] }], null, { options: [{ type: Input }], value: [{ type: Input }], disabled: [{ type: Input }], valueChange: [{ type: Output }] }); })(); (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DesktopTimePickerComponent, { className: "DesktopTimePickerComponent", filePath: "lib/components/cauca-date-time-picker/components/desktop-time-picker/desktop-time-picker.component.ts", lineNumber: 12 }); })(); const _c0$b = (a0, a1) => ({ all: a0, someOptions: a1 }); function DialogDateTimePickerComponent_Conditional_4_div_0_Template(rf, ctx) { if (rf & 1) { const _r1 = i0.ɵɵgetCurrentView(); i0.ɵɵelementStart(0, "div", 14)(1, "cauca-desktop-time-picker", 15); i0.ɵɵlistener("valueChange", function DialogDateTimePickerComponent_Conditional_4_div_0_Template_cauca_desktop_time_picker_valueChange_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.hourChanged($event)); }); i0.ɵɵelementEnd()(); } if (rf & 2) { const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵadvance(); i0.ɵɵproperty("disabled", i0.ɵɵpureFunction2(3, _c0$b, ctx_r1.disabled.hours, ctx_r1.disabled.someHours))("options", ctx_r1.hours)("value", ctx_r1.selectedHour); } } function DialogDateTimePickerComponent_Conditional_4_div_1_Template(rf, ctx) { if (rf & 1) { const _r3 = i0.ɵɵgetCurrentView(); i0.ɵɵelementStart(0, "div", 14)(1, "cauca-mobile-time-picker", 16); i0.ɵɵlistener("valueChange", function DialogDateTimePickerComponent_Conditional_4_div_1_Template_cauca_mobile_time_picker_valueChange_1_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.hourChanged($event)); }); i0.ɵɵelementEnd()(); } if (rf & 2) { const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵadvance(); i0.ɵɵproperty("options", ctx_r1.hours)("value", ctx_r1.selectedHour); } } function DialogDateTimePickerComponent_Conditional_4_div_2_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "div", 17); i0.ɵɵtext(1, ":"); i0.ɵɵelementEnd(); } } function DialogDateTimePickerComponent_Conditional_4_div_3_Template(rf, ctx) { if (rf & 1) { const _r4 = i0.ɵɵgetCurrentView(); i0.ɵɵelementStart(0, "div", 18)(1, "cauca-desktop-time-picker", 15); i0.ɵɵlistener("valueChange", function DialogDateTimePickerComponent_Conditional_4_div_3_Template_cauca_desktop_time_picker_valueChange_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.minuteChanged($event)); }); i0.ɵɵelementEnd()(); } if (rf & 2) { const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵadvance(); i0.ɵɵproperty("disabled", i0.ɵɵpureFunction2(3, _c0$b, ctx_r1.disabled.minutes, ctx_r1.disabled.someMinutes))("options", ctx_r1.minutes)("value", ctx_r1.selectedMinute); } } function DialogDateTimePickerComponent_Conditional_4_div_4_Template(rf, ctx) { if (rf & 1) { const _r5 = i0.ɵɵgetCurrentView(); i0.ɵɵelementStart(0, "div", 18)(1, "cauca-mobile-time-picker", 16); i0.ɵɵlistener("valueChange", function DialogDateTimePickerComponent_Conditional_4_div_4_Template_cauca_mobile_time_picker_valueChange_1_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.minuteChanged($event)); }); i0.ɵɵelementEnd()(); } if (rf & 2) { const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵadvance(); i0.ɵɵproperty("options", ctx_r1.minutes)("value", ctx_r1.selectedMinute); } } function DialogDateTimePickerComponent_Conditional_4_div_5_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "div", 19); i0.ɵɵtext(1, ":"); i0.ɵɵelementEnd(); } } function DialogDateTimePickerComponent_Conditional_4_div_6_Template(rf, ctx) { if (rf & 1) { const _r6 = i0.ɵɵgetCurrentView(); i0.ɵɵelementStart(0, "div", 20)(1, "cauca-desktop-time-picker", 15); i0.ɵɵlistener("valueChange", function DialogDateTimePickerComponent_Conditional_4_div_6_Template_cauca_desktop_time_picker_valueChange_1_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.secondChanged($event)); }); i0.ɵɵelementEnd()(); } if (rf & 2) { const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵadvance(); i0.ɵɵproperty("disabled", i0.ɵɵpureFunction2(3, _c0$b, ctx_r1.disabled.seconds, ctx_r1.disabled.someSeconds))("options", ctx_r1.seconds)("value", ctx_r1.selectedSecond); } } function DialogDateTimePickerComponent_Conditional_4_div_7_Template(rf, ctx) { if (rf & 1) { const _r7 = i0.ɵɵgetCurrentView(); i0.ɵɵelementStart(0, "div", 20)(1, "cauca-mobile-time-picker", 16); i0.ɵɵlistener("valueChange", function DialogDateTimePickerComponent_Conditional_4_div_7_Template_cauca_mobile_time_picker_valueChange_1_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.secondChanged($event)); }); i0.ɵɵelementEnd()(); } if (rf & 2) { const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵadvance(); i0.ɵɵproperty("options", ctx_r1.seconds)("value", ctx_r1.selectedSecond); } } function DialogDateTimePickerComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) { i0.ɵɵtemplate(0, DialogDateTimePickerComponent_Conditional_4_div_0_Template, 2, 6, "div", 9)(1, DialogDateTimePickerComponent_Conditional_4_div_1_Template, 2, 2, "div", 9)(2, DialogDateTimePickerComponent_Conditional_4_div_2_Template, 2, 0, "div", 10)(3, DialogDateTimePickerComponent_Conditional_4_div_3_Template, 2, 6, "div", 11)(4, DialogDateTimePickerComponent_Conditional_4_div_4_Template, 2, 2, "div", 11)(5, DialogDateTimePickerComponent_Conditional_4_div_5_Template, 2, 0, "div", 12)(6, DialogDateTimePickerComponent_Conditional_4_div_6_Template, 2, 6, "div", 13)(7, DialogDateTimePickerComponent_Conditional_4_div_7_Template, 2, 2, "div", 13); } if (rf & 2) { const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵproperty("ngIf", !ctx_r1.showMobileUi); i0.ɵɵadvance(); i0.ɵɵproperty("ngIf", ctx_r1.showMobileUi); i0.ɵɵadvance(); i0.ɵɵproperty("ngIf", ctx_r1.showMobileUi); i0.ɵɵadvance(); i0.ɵɵproperty("ngIf", !ctx_r1.showMobileUi); i0.ɵɵadvance(); i0.ɵɵproperty("ngIf", ctx_r1.showMobileUi); i0.ɵɵadvance(); i0.ɵɵproperty("ngIf", ctx_r1.showSeconds && ctx_r1.showMobileUi); i0.ɵɵadvance(); i0.ɵɵproperty("ngIf", ctx_r1.showSeconds && !ctx_r1.showMobileUi); i0.ɵɵadvance(); i0.ɵɵproperty("ngIf", ctx_r1.showSeconds && ctx_r1.showMobileUi); } } function DialogDateTimePickerComponent_button_6_mat_icon_1_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "mat-icon"); i0.ɵɵtext(1, "clear"); i0.ɵɵelementEnd(); } } function DialogDateTimePickerComponent_button_6_Template(rf, ctx) { if (rf & 1) { const _r8 = i0.ɵɵgetCurrentView(); i0.ɵɵelementStart(0, "button", 21); i0.ɵɵlistener("click", function DialogDateTimePickerComponent_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.clear()); }); i0.ɵɵtemplate(1, DialogDateTimePickerComponent_button_6_mat_icon_1_Template, 2, 0, "mat-icon", 7); i0.ɵɵtext(2); i0.ɵɵpipe(3, "translate"); i0.ɵɵelementEnd(); } if (rf & 2) { const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵadvance(); i0.ɵɵproperty("ngIf", ctx_r1.showButtonIcons); i0.ɵɵadvance(); i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "material.clear"), " "); } } function DialogDateTimePickerComponent_mat_icon_8_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "mat-icon"); i0.ɵɵtext(1, "cancel"); i0.ɵɵelementEnd(); } } function DialogDateTimePickerComponent_mat_icon_12_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "mat-icon"); i0.ɵɵtext(1, "check"); i0.ɵɵelementEnd(); } } class DialogDateTimePickerComponent { constructor() { this.selectedHour = 0; this.selectedMinute = 0; this.selectedSecond = 0; this.initialDate = null; this.selectedDate = null; this.minimumDate = new Date(); this.maximumDate = new Date(); this.showSeconds = false; this.showClearButton = true; this.showButtonIcons = true; this.hours = [...Array(24).keys()]; this.minutes = [...Array(60).keys()]; this.seconds = [...Array(60).keys()]; this.showMobileUi = false; this.showTime = signal(true, ...(ngDevMode ? [{ debugName: "showTime" }] : [])); this.disabled = { hours: true, someHours: [], minutes: true, someMinutes: [], seconds: true, someSeconds: [], }; this.step = { hours: 1, minutes: 1, seconds: 1, }; this.dialogRef = inject(MatDialogRef); this.options = inject(MAT_DIALOG_DATA); const options = this.options; this.step = options.step || this.step; this.showSeconds = options.showSeconds; this.showButtonIcons = options.showButtonIcons ?? this.showButtonIcons; this.showClearButton = options.showClearButton ?? this.showClearButton; this.showTime.set(options.showTime ?? true); this.setListHoursMinutes(); this.initialEachComponentValue(options); } ngOnInit() { this.onWindowWithChange(window.innerWidth); } onResize(event) { this.onWindowWithChange(event.target.innerWidth); } dateChanged(date) { if (date) { this.selectedDate = date; this.selectedDate.setHours(this.selectedHour); this.selectedDate.setMinutes(this.selectedMinute); this.selectedDate.setSeconds(this.selectedSecond); this.disabled.hours = false; this.disabled.someHours = this.hours.filter(hour => this.hourOfSelectedDateIsDisabled(hour)); } else { this.selectedDate = null; this.disabled.hours = true; } } hourChanged(hour) { if (this.disabled.hours || this.disabled.someHours.includes(hour)) return; this.selectedHour = hour; this.selectedDate.setHours(hour); this.disabled.minutes = false; this.disabled.someMinutes = this.minutes.filter(minute => this.minuteOfSelectedDateIsDisabled(minute)); } minuteChanged(minute) { if (this.disabled.minutes || this.disabled.someMinutes.includes(minute)) return; this.selectedMinute = minute; this.selectedDate.setMinutes(minute); this.disabled.seconds = false; this.disabled.someSeconds = this.seconds.filter(second => this.secondOfSelectedDateIsDisabled(second)); } secondChanged(second) { if (this.disabled.seconds || this.disabled.someSeconds.includes(second)) return; this.selectedSecond = second; this.selectedDate.setSeconds(second); } clear() { this.dialogRef.close({ value: null }); } cancel() { this.dialogRef.close({ value: this.initialDate }); } confirm() { this.dialogRef.close({ value: this.selectedDate }); } onWindowWithChange(width) { this.showMobileUi = width && width <= 555; } hourOfSelectedDateIsDisabled(hour) { if (this.selectedDateIsTheMinimumDate()) { return hour < this.minimumDate.getHours(); } else if (this.selectedDateIsTheMaximumDate()) { return hour > this.maximumDate.getHours(); } return false; } minuteOfSelectedDateIsDisabled(minute) { if (this.selectedDateIsTheMinimumDate() && this.selectedDate.getHours() === this.minimumDate.getHours()) { return minute < this.minimumDate.getMinutes(); } else if (this.selectedDateIsTheMaximumDate() && this.selectedDate.getHours() === this.maximumDate.getHours()) { return minute > this.maximumDate.getMinutes(); } return false; } secondOfSelectedDateIsDisabled(second) { if (this.selectedDateIsTheMinimumDate() && this.selectedDate.getHours() === this.minimumDate.getHours() && this.selectedDate.getMinutes() === this.minimumDate.getMinutes()) { return second < this.minimumDate.getSeconds(); } else if (this.selectedDateIsTheMaximumDate() && this.selectedDate.getMinutes() === this.maximumDate.getMinutes()) { return second > this.maximumDate.getSeconds(); } return false; } initialEachComponentValue(options) { this.initialDate = options.selectedDate ? new Date(options.selectedDate) : null; this.minimumDate = options.minimumDate ? new Date(options.minimumDate) : null; this.maximumDate = options.maximumDate ? new Date(options.maximumDate) : null; this.selectedDate = options.selectedDate ? new Date(options.selectedDate) : new Date(); this.dateChanged(options.selectedDate ? new Date(options.selectedDate) : null); this.hourChanged(options.selectedDate ? new Date(options.selectedDate).getHours() : 0); this.minuteChanged(options.selectedDate ? new Date(options.selectedDate).getMinutes() : 0); this.secondChanged(options.selectedDate ? new Date(options.selectedDate).getSeconds() : 0); } selectedDateIsTheMinimumDate() { return (this.minimumDate && this.selectedDate.getFullYear() === this.minimumDate.getFullYear() && this.selectedDate.getMonth() === this.minimumDate.getMonth() && this.selectedDate.getDate() === this.minimumDate.getDate()); } selectedDateIsTheMaximumDate() { return (this.maximumDate && this.selectedDate.getFullYear() === this.maximumDate.getFullYear() && this.selectedDate.getMonth() === this.maximumDate.getMonth() && this.selectedDate.getDate() === this.maximumDate.getDate()); } setListHoursMinutes() { this.hours = this.hours.filter(hour => hour % this.step.hours === 0); this.minutes = this.minutes.filter(minute => minute % this.step.minutes === 0); this.seconds = this.seconds.filter(seconde => seconde % this.step.seconds === 0); } static { this.ɵfac = function DialogDateTimePickerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DialogDateTimePickerComponent)(); }; } static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DialogDateTimePickerComponent, selectors: [["cauca-dialog-date-time-picker"]], hostBindings: function DialogDateTimePickerComponent_HostBindings(rf, ctx) { if (rf & 1) { i0.ɵɵlistener("resize", function DialogDateTimePickerComponent_resize_HostBindingHandler($event) { return ctx.onResize($event); }, i0.ɵɵresolveWindow); } }, features: [i0.ɵɵProvidersFeature([provideNativeDateAdapter()])], decls: 15, vars: 14, consts: [["mat-dialog-content", ""], [1, "date-time-picker", 3, "ngClass"], [1, "calendar"], [3, "selectedChange", "minDate", "maxDate", "selected"], ["mat-dialog-actions", "", "align", "end"], ["mat-stroked-button", "", 3, "click", 4, "ngIf"], ["color", "primary", "mat-stroked-button", "", 3, "click"], [4, "ngIf"], ["color", "primary", "mat-raised-button", "", "cdkFocusInitial", "", 3, "click"], ["class", "hours", 4, "ngIf"], ["class", "hour-and-minute-separator", 4, "ngIf"], ["class", "minutes", 4, "ngIf"], ["class", "minute-and-second-separator", 4, "ngIf"], ["class", "seconds", 4, "ngIf"], [1, "hours"], [3, "valueChange", "disabled", "options", "value"], [3, "valueChange", "options", "value"], [1, "hour-and-minute-separator"], [1, "minutes"], [1, "minute-and-second-separator"], [1, "seconds"], ["mat-stroked-button", "", 3, "click"]], template: function DialogDateTimePickerComponent_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "mat-calendar", 3); i0.ɵɵlistener("selectedChange", function DialogDateTimePickerComponent_Template_mat_calendar_selectedChange_3_listener($event) { return ctx.dateChanged($event); }); i0.ɵɵelementEnd()(); i0.ɵɵconditionalCreate(4, DialogDateTimePickerComponent_Conditional_4_Template, 8, 8); i0.ɵɵelementEnd()(); i0.ɵɵelementStart(5, "div", 4); i0.ɵɵtemplate(6, DialogDateTimePickerComponent_button_6_Template, 4, 4, "button", 5); i0.ɵɵelementStart(7, "button", 6); i0.ɵɵlistener("click", function DialogDateTimePickerComponent_Template_button_click_7_listener() { return ctx.cancel(); }); i0.ɵɵtemplate(8, DialogDateTimePickerComponent_mat_icon_8_Template, 2, 0, "mat-icon", 7); i0.ɵɵtext(9); i0.ɵɵpipe(10, "translate"); i0.ɵɵelementEnd(); i0.ɵɵelementStart(11, "button", 8); i0.ɵɵlistener("click", function DialogDateTimePickerComponent_Template_button_click_11_listener() { return ctx.confirm(); }); i0.ɵɵtemplate(12, DialogDateTimePickerComponent_mat_icon_12_Template, 2, 0, "mat-icon", 7); i0.ɵɵtext(13); i0.ɵɵpipe(14, "translate"); i0.ɵɵelementEnd()(); } if (rf & 2) { i0.ɵɵadvance(); i0.ɵɵproperty("ngClass", ctx.showSeconds ? "show-seconds" : "hide-seconds"); i0.ɵɵadvance(2); i0.ɵɵproperty("minDate", ctx.minimumDate)("maxDate", ctx.maximumDate)("selected", ctx.selectedDate); i0.ɵɵadvance(); i0.ɵɵconditional(ctx.showTime() ? 4 : -1); i0.ɵɵadvance(2); i0.ɵɵproperty("ngIf", ctx.showClearButton); i0.ɵɵadvance(2); i0.ɵɵproperty("ngIf", ctx.showButtonIcons); i0.ɵɵadvance(); i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(10, 10, "material.cancel"), " "); i0.ɵɵadvance(3); i0.ɵɵproperty("ngIf", ctx.showButtonIcons); i0.ɵɵadvance(); i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(14, 12, "material.ok"), " "); } }, dependencies: [CommonModule, i1$3.NgClass, i1$3.NgIf, CaucaCoreForChildModule, MatButtonModule, i2.MatButton, MatDatepickerModule, i2$1.MatCalendar, MatIconModule, i1$1.MatIcon, MatListModule, MobileTimePickerComponent, DesktopTimePickerComponent, i1.TranslatePipe], 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:grid;grid-template-areas:\"calendar hours minutes seconds\";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%]: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;height:350px}.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)}.calendar[_ngcontent-%COMP%]{grid-area:calendar}.hours[_ngcontent-%COMP%]{grid-area:hours}.minutes[_ngcontent-%COMP%]{grid-area:minutes}.seconds[_ngcontent-%COMP%]{grid-area:seconds}.hour-and-minute-separator[_ngcontent-%COMP%]{grid-area:hour-and-minute-separator;display:flex;align-items:center;justify-content:center;font-weight:700}.minute-and-second-separator[_ngcontent-%COMP%]{grid-area:minute-and-second-separator;display:flex;align-items:center;justify-content:center;font-weight:700}@media only screen and (max-width: 555px){.show-seconds[_ngcontent-%COMP%]{grid-template-areas:\"calendar calendar calendar calendar calendar calendar calendar\" \". hours hour-and-minute-separator minutes minute-and-second-separator seconds .\";grid-template-columns:auto 40px 2px 40px 2px 40px auto}.hide-seconds[_ngcontent-%COMP%]{grid-template-areas:\"calendar calendar calendar calendar calendar\" \". hours hour-and-minute-separator minutes .\";grid-template-columns:auto 40px 2px 40px auto}.date-time-picker[_ngcontent-%COMP%]{grid-template-rows:auto auto;height:450px}.date-time-picker[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{border-left:none}.date-time-picker[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:not(:first-child){height:70px}.date-time-picker[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:first-child{overflow:initial;flex:4;max-width:290px;border-left:none}}"] }); } } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DialogDateTimePickerComponent, [{ type: Component, args: [{ selector: 'cauca-dialog-date-time-picker', imports: [ CommonModule, CaucaCoreForChildModule, MatButtonModule, MatDatepickerModule, MatIconModule, MatListModule, MobileTimePickerComponent, DesktopTimePickerComponent ], providers: [provideNativeDateAdapter()], template: "<div mat-dialog-content>\n <div [ngClass]=\"showSeconds ? 'show-seconds' : 'hide-seconds'\" class=\"date-time-picker\">\n <div class=\"calendar\">\n <mat-calendar\n [minDate]=\"minimumDate\"\n [maxDate]=\"maximumDate\"\n [selected]=\"selectedDate\"\n (selectedChange)=\"dateChanged($event)\"\n ></mat-calendar>\n </div>\n\n @if (showTime()) {\n <div class=\"hours\" *ngIf=\"!showMobileUi\">\n <cauca-desktop-time-picker [disabled]=\"{all: disabled.hours, someOptions: disabled.someHours}\" (valueChange)=\"hourChanged($event)\" [options]=\"hours\" [value]=\"selectedHour\"/>\n </div>\n <div class=\"hours\" *ngIf=\"showMobileUi\">\n <cauca-mobile-time-picker (valueChange)=\"hourChanged($event)\" [options]=\"hours\" [value]=\"selectedHour\" />\n </div>\n \n <div class=\"hour-and-minute-separator\" *ngIf=\"showMobileUi\">:</div>\n \n <div class=\"minutes\" *ngIf=\"!showMobileUi\">\n <cauca-desktop-time-picker [disabled]=\"{all: disabled.minutes, someOptions: disabled.someMinutes}\" (valueChange)=\"minuteChanged($event)\" [options]=\"minutes\" [value]=\"selectedMinute\"/>\n </div>\n <div class=\"minutes\" *ngIf=\"showMobileUi\">\n <cauca-mobile-time-picker (valueChange)=\"minuteChanged($event)\" [options]=\"minutes\" [value]=\"selectedMinute\" />\n </div>\n \n <div class=\"minute-and-second-separator\" *ngIf=\"showSeconds && showMobileUi\">:</div>\n <div class=\"seconds\" *ngIf=\"showSeconds && !showMobileUi\">\n <cauca-desktop-time-picker [disabled]=\"{all: disabled.seconds, someOptions: disabled.someSeconds}\" (valueChange)=\"secondChanged($event)\" [options]=\"seconds\" [value]=\"selectedSecond\"/>\n </div>\n <div class=\"seconds\" *ngIf=\"showSeconds && showMobileUi\">\n <cauca-mobile-time-picker (valueChange)=\"secondChanged($event)\" [options]=\"seconds\" [value]=\"selectedSecond\" />\n </div>\n }\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 color=\"primary\" 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:grid;grid-template-areas:\"calendar hours minutes seconds\";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:first-child{flex:4;max-width:290px;border-left:none}.date-time-picker>div:first-child mat-calendar{width:290px;height:350px}.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)}.calendar{grid-area:calendar}.hours{grid-area:hours}.minutes{grid-area:minutes}.seconds{grid-area:seconds}.hour-and-minute-separator{grid-area:hour-and-minute-separator;display:flex;align-items:center;justify-content:center;font-weight:700}.minute-and-second-separator{grid-area:minute-and-second-separator;display:flex;align-items:center;justify-content:center;font-weight:700}@media only screen and (max-width: 555px){.show-seconds{grid-template-areas:\"calendar calendar calendar calendar calendar calendar calendar\" \". hours hour-and-minute-separator minutes minute-and-second-separator seconds .\";grid-template-columns:auto 40px 2px 40px 2px 40px auto}.hide-seconds{grid-template-areas:\"calendar calendar calendar calendar calendar\" \". hours hour-and-minute-separator minutes .\";grid-template-columns:auto 40px 2px 40px auto}.date-time-picker{grid-template-rows:auto auto;height:450px}.date-time-picker>div{border-left:none}.date-time-picker>div:not(:first-child){height:70px}.date-time-picker>div:first-child{overflow:initial;flex:4;max-width:290px;border-left:none}}\n"] }] }], () => [], { onResize: [{ type: HostListener, args: ['window:resize', ['$event']] }] }); })(); (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DialogDateTimePickerComponent, { className: "DialogDateTimePickerComponent", filePath: "lib/components/cauca-date-time-picker/components/dialog-date-time-picker/dialog-date-time-picker.component.ts", lineNumber: 30 }); })(); function CaucaDateTimePickerComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "mat-label"); i0.ɵɵtext(1); i0.ɵɵpipe(2, "translate"); i0.ɵɵelementEnd(); } if (rf & 2) { const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵadvance(); i0.ɵɵtextInterpolate2("", ctx_r0.translateLabel ? i0.ɵɵpipeBind1(2, 2, ctx_r0.label) : ctx_r0.label, "", ctx_r0.isRequired ? "*" : ""); } } class CaucaDateTimePickerComponent { constructor() { this.subscriptSizing = 'fixed'; this.showTime = true; this.label = ''; this.translateLabel = true; this.stepHours = 1; this.stepMinutes = 1; this.stepSecondes = 1; this.minimumDate = null; this.maximumDate = null; this.showSeconds = false; this.showFormat = 'yyyy/MM/dd, HH:mm'; this.showClearButton = true; this.showButtonIcons = true; this.selectedChange = new EventEmitter(); this.stringDate = ''; this.injector = inject(Injector); this.elementRef = inject(ElementRef); this.dialog = inject(MatDialog); this.datePipe = inject(DatePipe); this.onChange = (value) => value; this.onTouched = () => { }; } set value(value) { if (value) { this.stringDate = this.stringifyDate(value); this.selectedDate = value; } } get isRequired() { return Boolean(this.control?.hasValidator(Validators.required)); } ngOnInit() { const ngControl = this.injector.get(NgControl, null, { self: true, optional: true }); if (ngControl instanceof FormControlName) { const container = this.injector.get(ControlContainer).control; this.control = container.controls[ngControl.name]; } else { this.control = new FormControl(); } } showDialog() { const dialogRef = this.dialog.open(DialogDateTimePickerComponent, { position: this.getDialogPosition(), data: this.getDateTimePickerOptions(), maxWidth: '100vw', }); dialogRef.afterClosed().subscribe((data) => { if (data) { this.stringDate = this.stringifyDate(data.value); this.selectedDate = data.value; this.selectedChange.emit(data.value); this.onChange(data.value); } }); } writeValue(date) { this.value = date; } registerOnChange(fn) { this.onChange = fn; } registerOnTouched(fn) { this.onTouched = fn; } getDateTimePickerOptions() { return { selectedDate: this.selectedDate, minimumDate: this.minimumDate, maximumDate: this.maximumDate, showSeconds: this.showSeconds, showClearButton: this.showClearButton, showButtonIcons: this.showButtonIcons, showTime: this.showTime, step: { hours: this.stepHours, minutes: this.stepMinutes, seconds: this.stepSecondes, } }; } stringifyDate(date) { return this.datePipe.transform(date, this.showFormat); } getDialogPosition() { const rect = this.elementRef.nativeElement.getBoundingClientRect(); const top = rect.y + rect.height - 22; const bottom = window.innerHeight - rect.y; const minimumDialogHeight = 400; const minimumScreenSize = 800; if (window.innerHeight < minimumScreenSize || window.innerWidth < minimumScreenSize) { return null; } else if (window.innerHeight > (top + minimumDialogHeight)) { return { left: `${rect.x}px`, top: `${top}px`, }; } return { left: `${rect.x}px`, bottom: `${bottom}px`, }; } static { this.ɵfac = function CaucaDateTimePickerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaucaDateTimePickerComponent)(); }; } static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaucaDateTimePickerComponent, selectors: [["cauca-date-time-picker"]], inputs: { subscriptSizing: "subscriptSizing", showTime: "showTime", label: "label", translateLabel: "translateLabel", stepHours: "stepHours", stepMinutes: "stepMinutes", stepSecondes: "stepSecondes", minimumDate: "minimumDate", maximumDate: "maximumDate", showSeconds: "showSeconds", showFormat: "showFormat", showClearButton: "showClearButton", showButtonIcons: "showButtonIcons", value: "value" }, outputs: { selectedChange: "selectedChange" }, features: [i0.ɵɵProvidersFeature([ DatePipe, { provide: NG_VALUE_ACCESSOR, multi: true, useExisting: forwardRef(() => CaucaDateTimePickerComponent), } ])], decls: 6, vars: 3, consts: [[3, "subscriptSizing"], ["matInput", "", "readonly", "readonly", 3, "focusout", "value"], ["matSuffix", "", "mat-icon-button", "", 3, "click"]], template: function CaucaDateTimePickerComponent_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "mat-form-field", 0); i0.ɵɵconditionalCreate(1, CaucaDateTimePickerComponent_Conditional_1_Template, 3, 4, "mat-label"); i0.ɵɵelementStart(2, "input", 1); i0.ɵɵlistener("focusout", function CaucaDateTimePickerComponent_Template_input_focusout_2_listener() { return ctx.onTouched(); }); i0.ɵɵelementEnd(); i0.ɵɵelementStart(3, "button", 2); i0.ɵɵlistener("click", function CaucaDateTimePickerComponent_Template_button_click_3_listener() { return ctx.showDialog(); }); i0.ɵɵelementStart(4, "mat-icon"); i0.ɵɵtext(5, "calendar_month"); i0.ɵɵelementEnd()()(); } if (rf & 2) { i0.ɵɵproperty("subscriptSizing", ctx.subscriptSizing); i0.ɵɵadvance(); i0.ɵɵconditional(ctx.label ? 1 : -1); i0.ɵɵadvance(); i0.ɵɵproperty("value", ctx.stringDate); } }, dependencies: [TranslateModule, MatButtonModule, i2.MatIconButton, MatIconModule, i1$1.MatIcon, MatInputModule, i3.MatInput, i1$4.MatFormField, i1$4.MatLabel, i1$4.MatSuffix, MatFormFieldModule, i1.TranslatePipe], styles: ["[_nghost-%COMP%]{display:block}mat-form-field[_ngcontent-%COMP%]{width:100%}"] }); } } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaDateTimePickerComponent, [{ type: Component, args: [{ selector: 'cauca-date-time-picker', imports: [ TranslateModule, MatButtonModule, MatIconModule, MatInputModule, MatFormFieldModule ], providers: [ DatePipe, { provide: NG_VALUE_ACCESSOR, multi: true, useExisting: forwardRef(() => CaucaDateTimePickerComponent), } ], template: "<mat-form-field [subscriptSizing]=\"subscriptSizing\">\n @if (label) {\n <mat-label>{{ translateLabel ? (label | translate) : label }}{{isRequired ? '*' : ''}}</mat-label>\n }\n <input (focusout)=\"onTouched()\" 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"] }] }], null, { subscriptSizing: [{ type: Input }], showTime: [{ type: Input }], label: [{ type: Input }], translateLabel: [{ type: Input }], stepHours: [{ type: Input }], stepMinutes: [{ type: Input }], stepSecondes: [{ type: Input }], minimumDate: [{ type: Input }], maximumDate: [{ type: Input }], showSeconds: [{ type: Input }], showFormat: [{ type: Input }], showClearButton: [{ type: Input }], showButtonIcons: [{ type: Input }], selectedChange: [{ type: Output }], value: [{ type: Input }] }); })(); (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaucaDateTimePickerComponent, { className: "CaucaDateTimePickerComponent", filePath: "lib/components/cauca-date-time-picker/cauca-date-time-picker.component.ts", lineNumber: 33 }); })(); class BaseButton { constructor() { this.colorOnHover = input(undefined, ...(ngDevMode ? [{ debugName: "colorOnHover" }] : [])); this.color = input(undefined, ...(ngDevMode ? [{ debugName: "color" }] : [])); this.icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : [])); this.iconAlignment = input('left', ...(ngDevMode ? [{ debugName: "iconAlignment" }] : [])); this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : [])); this.isInProgress = input(false, ...(ngDevMode ? [{ debugName: "isInProgress" }] : [])); this.iconColor = computed(() => this.isHovered() ? this.colorOnHover() || this.color() : this.color(), ...(ngDevMode ? [{ debugName: "iconColor" }] : [])); this.showIcon = computed(() => !!this.icon() || this.isInProgress(), ...(ngDevMode ? [{ debugName: "showIcon" }] : [])); this.iconToShow = computed(() => this.isInProgress() ? 'update' : this.icon(), .