@candidosales/material-time-picker
Version:
Time Picker for Angular
106 lines (100 loc) • 4.55 kB
TypeScript
import * as i0 from '@angular/core';
import { OnChanges, EventEmitter, OnInit } from '@angular/core';
import { BreakpointObserver } from '@angular/cdk/layout';
import { Subject } from 'rxjs';
import { MatDialogRef, MatDialog } from '@angular/material/dialog';
declare enum CLOCK_TYPE {
HOURS = 1,
MINUTES = 2
}
type TimeFormat = 12 | 24;
interface ITime {
hour: any;
minute: any;
meriden: 'PM' | 'AM';
format: TimeFormat;
}
declare class WClockComponent implements OnChanges {
userTime: ITime;
userTimeChange: EventEmitter<ITime>;
currentView: CLOCK_TYPE;
viewChange: EventEmitter<CLOCK_TYPE>;
color: string;
steps: number[];
selectedTimePart: any;
private STEP_DEG;
ngOnChanges(): void;
private setupUI;
getPointerStyle(): {
'-webkit-transform': string;
'-ms-transform': string;
transform: string;
};
getTimeValueClass(step: number, index: number): string;
changeTimeValue(step: number): void;
static ɵfac: i0.ɵɵFactoryDeclaration<WClockComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<WClockComponent, "w-clock", never, { "userTime": { "alias": "userTime"; "required": false; }; "currentView": { "alias": "currentView"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, { "userTimeChange": "userTimeChange"; "viewChange": "viewChange"; }, never, never, true, never>;
}
declare class WTimeComponent implements OnInit {
destroyed: Subject<void>;
userTime: ITime;
userTimeChange: EventEmitter<ITime>;
revertLabel: string;
submitLabel: string;
onRevert: EventEmitter<null>;
onSubmit: EventEmitter<ITime>;
color: string;
VIEW_HOURS: CLOCK_TYPE;
VIEW_MINUTES: CLOCK_TYPE;
currentView: CLOCK_TYPE;
currentClassScreenSize: string;
constructor(breakpointObserver: BreakpointObserver);
ngOnInit(): void;
formatHour(format: any, hour: any): string;
formatMinute(minute: any): string;
setCurrentView(type: CLOCK_TYPE): void;
setMeridien(m: 'PM' | 'AM'): void;
revert(): void;
submit(): void;
emituserTimeChange(event: any): void;
static ɵfac: i0.ɵɵFactoryDeclaration<WTimeComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<WTimeComponent, "w-time", never, { "userTime": { "alias": "userTime"; "required": false; }; "revertLabel": { "alias": "revertLabel"; "required": false; }; "submitLabel": { "alias": "submitLabel"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, { "userTimeChange": "userTimeChange"; "onRevert": "onRevert"; "onSubmit": "onSubmit"; }, never, never, true, never>;
}
declare class WTimeDialogComponent {
private dialogRef;
data: any;
userTime: ITime;
color: string;
private VIEW_HOURS;
private VIEW_MINUTES;
private currentView;
constructor(dialogRef: MatDialogRef<WTimeDialogComponent>, data: any);
revert(): void;
submit(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<WTimeDialogComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<WTimeDialogComponent, "ng-component", never, {}, {}, never, never, true, never>;
}
declare class MaterialTimePickerComponent implements OnInit {
private dialog;
label: string;
appearance: string;
userTime: ITime;
color: string;
revertLabel: string;
submitLabel: string;
disabled: boolean;
readonly: boolean;
/**
* Class to put in the form-field
*/
classFormField: string;
change: EventEmitter<ITime>;
constructor(dialog: MatDialog);
ngOnInit(): void;
time(): string;
showPicker(): boolean;
private emitChange;
static ɵfac: i0.ɵɵFactoryDeclaration<MaterialTimePickerComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<MaterialTimePickerComponent, "material-timepicker", never, { "label": { "alias": "label"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "userTime": { "alias": "userTime"; "required": false; }; "color": { "alias": "color"; "required": false; }; "revertLabel": { "alias": "revertLabel"; "required": false; }; "submitLabel": { "alias": "submitLabel"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "classFormField": { "alias": "classFormField"; "required": false; }; }, { "change": "change"; }, never, never, true, never>;
}
export { MaterialTimePickerComponent, WClockComponent, WTimeComponent, WTimeDialogComponent };