import { Injector, Component, ViewChild, AfterViewInit, HostBinding, ElementRef, OnInit, Directive, HostListener, Input, Output, EventEmitter, ViewContainerRef } from "@angular/core"; import { AppComponentBase } from "@shared/common/app-component-base"; import { appModuleAnimation } from "@shared/animations/routerTransition"; import { LocalStorageService } from "@shared/utils/local-storage.service"; import { Router } from "@angular/router"; import { ModalDirective } from "ngx-bootstrap"; import { LazyLoadEvent } from "primeng/api"; import * as moment from 'moment'; import { ProfileServiceProxy, CurrentUserProfileEditDto, ClinicsServiceProxy, CreateOrEditClinicDto } from '@shared/service-proxies/service-proxies'; @Component({ selector: 'clinicScheduleFlyOutComponent', templateUrl: 'clinic-schedule-flyout.component.html', styleUrls: ['./clinic-schedule-flyout.component.less'], animations: [appModuleAnimation()] }) export class ClinicScheduleFlyOutComponent extends AppComponentBase implements OnInit, AfterViewInit { @HostBinding('id') id = 'kt_quick_sidebar'; @HostBinding('class') classes = 'kt-quick-panel'; @HostBinding('attr.mQuickSidebarOffcanvas') @HostBinding('style.overflow') styleOverflow: any = 'hidden'; mQuickSidebarOffcanvas: any; showAccountsIcon = false clinic: CreateOrEditClinicDto = new CreateOrEditClinicDto(); public userProfile: CurrentUserProfileEditDto; constructor( injector: Injector, private _localStorageService: LocalStorageService, private el: ElementRef, private router: Router, private _clinicsServiceProxy: ClinicsServiceProxy, private viewContainerRef: ViewContainerRef, private _profileService: ProfileServiceProxy ) { super(injector); } _isOpen: boolean; _pinned = false; getParentComponent() { return this.viewContainerRef['_data'].componentView.component.viewContainerRef['_view'].component } ngOnInit(): void { } ngAfterViewInit(): void { this.mQuickSidebarOffcanvas = new KTOffcanvas(this.el.nativeElement, { overlay: true, baseClass: 'kt-quick-panel', closeBy: 'controller-header-close', toggleBy: 'notes-toggle' }); this.mQuickSidebarOffcanvas.events.push({ name: 'afterHide', handler: () => { if (this._pinned) { this.mQuickSidebarOffcanvas.show(); } else { this.isOpen = false; } } }, { name: 'afterShow', handler: () => { this.isOpen = true; } }); } set pinned(newValue: boolean) { if (newValue === this._pinned) { return; } this._pinned = newValue; } get pinned(): boolean { return this._pinned; } reversePinned(): void { this.pinned = !this.pinned; } set isOpen(newValue: boolean) { if (newValue === this._isOpen) { return; } this._isOpen = newValue; } get isOpen(): boolean { return this._isOpen; } showFlyout(clinic: any): void { // var locationss = this.getParentComponent().locations; this.clinic = clinic; console.log(this.clinic); } saveNotes(): void { this._clinicsServiceProxy.createOrEdit(this.clinic) .pipe() .subscribe(() => { this.notify.info(this.l('SavedSuccessfully')); }); } }