timepicker.component.d.ts 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
  2. import { ControlValueAccessor } from '@angular/forms';
  3. import { TimepickerActions } from './reducer/timepicker.actions';
  4. import { TimepickerStore } from './reducer/timepicker.store';
  5. import { TimepickerConfig } from './timepicker.config';
  6. import { TimeChangeSource, TimepickerComponentState, TimepickerControls } from './timepicker.models';
  7. import { Subscription } from 'rxjs';
  8. import { ControlValueAccessorModel } from './models';
  9. export declare const TIMEPICKER_CONTROL_VALUE_ACCESSOR: ControlValueAccessorModel;
  10. export declare class TimepickerComponent implements ControlValueAccessor, TimepickerComponentState, TimepickerControls, OnChanges, OnDestroy {
  11. private _cd;
  12. private _store;
  13. private _timepickerActions;
  14. /** hours change step */
  15. hourStep: number;
  16. /** hours change step */
  17. minuteStep: number;
  18. /** seconds change step */
  19. secondsStep: number;
  20. /** if true hours and minutes fields will be readonly */
  21. readonlyInput: boolean;
  22. /** if true hours and minutes fields will be disabled */
  23. disabled: boolean;
  24. /** if true scroll inside hours and minutes inputs will change time */
  25. mousewheel: boolean;
  26. /** if true the values of hours and minutes can be changed using the up/down arrow keys on the keyboard */
  27. arrowkeys: boolean;
  28. /** if true spinner arrows above and below the inputs will be shown */
  29. showSpinners: boolean;
  30. /** if true meridian button will be shown */
  31. showMeridian: boolean;
  32. /** show minutes in timepicker */
  33. showMinutes: boolean;
  34. /** show seconds in timepicker */
  35. showSeconds: boolean;
  36. /** meridian labels based on locale */
  37. meridians: string[];
  38. /** minimum time user can select */
  39. min: Date;
  40. /** maximum time user can select */
  41. max: Date;
  42. /** placeholder for hours field in timepicker */
  43. hoursPlaceholder: string;
  44. /** placeholder for minutes field in timepicker */
  45. minutesPlaceholder: string;
  46. /** placeholder for seconds field in timepicker */
  47. secondsPlaceholder: string;
  48. /** emits true if value is a valid date */
  49. isValid: EventEmitter<boolean>;
  50. hours: string;
  51. minutes: string;
  52. seconds: string;
  53. meridian: string;
  54. /** @deprecated - please use `isEditable` instead */
  55. readonly isSpinnersVisible: boolean;
  56. readonly isEditable: boolean;
  57. invalidHours: boolean;
  58. invalidMinutes: boolean;
  59. invalidSeconds: boolean;
  60. canIncrementHours: boolean;
  61. canIncrementMinutes: boolean;
  62. canIncrementSeconds: boolean;
  63. canDecrementHours: boolean;
  64. canDecrementMinutes: boolean;
  65. canDecrementSeconds: boolean;
  66. canToggleMeridian: boolean;
  67. onChange: Function;
  68. onTouched: Function;
  69. timepickerSub: Subscription;
  70. constructor(_config: TimepickerConfig, _cd: ChangeDetectorRef, _store: TimepickerStore, _timepickerActions: TimepickerActions);
  71. resetValidation(): void;
  72. isPM(): boolean;
  73. prevDef($event: Event): void;
  74. wheelSign($event: WheelEventInit): number;
  75. ngOnChanges(changes: SimpleChanges): void;
  76. changeHours(step: number, source?: TimeChangeSource): void;
  77. changeMinutes(step: number, source?: TimeChangeSource): void;
  78. changeSeconds(step: number, source?: TimeChangeSource): void;
  79. updateHours(hours: string): void;
  80. updateMinutes(minutes: string): void;
  81. updateSeconds(seconds: string): void;
  82. isValidLimit(): boolean;
  83. _updateTime(): void;
  84. toggleMeridian(): void;
  85. /**
  86. * Write a new value to the element.
  87. */
  88. writeValue(obj: string | null | undefined | Date): void;
  89. /**
  90. * Set the function to be called when the control receives a change event.
  91. */
  92. registerOnChange(fn: (_: any) => {}): void;
  93. /**
  94. * Set the function to be called when the control receives a touch event.
  95. */
  96. registerOnTouched(fn: () => {}): void;
  97. /**
  98. * This function is called when the control status changes to or from "disabled".
  99. * Depending on the value, it will enable or disable the appropriate DOM element.
  100. *
  101. * @param isDisabled
  102. */
  103. setDisabledState(isDisabled: boolean): void;
  104. ngOnDestroy(): void;
  105. private _renderTime;
  106. }