@dhutaryan/ngx-mat-timepicker 20.0.0 → 21.0.0

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dhutaryan/ngx-mat-timepicker",
3
3
  "description": "Angular timepicker to add time which is based on material design and Angular material.",
4
4
  "homepage": "https://dhutaryan.github.io/ngx-mat-timepicker/",
5
- "version": "20.0.0",
5
+ "version": "21.0.0",
6
6
  "license": "MIT",
7
7
  "author": {
8
8
  "name": "Dzmitry Hutaryan"
@@ -27,9 +27,9 @@
27
27
  "timepicker input"
28
28
  ],
29
29
  "peerDependencies": {
30
- "@angular/common": ">=19.0.0",
31
- "@angular/core": ">=19.0.0",
32
- "@angular/material": ">=19.0.0"
30
+ "@angular/common": ">=21.0.0",
31
+ "@angular/core": ">=21.0.0",
32
+ "@angular/material": ">=21.0.0"
33
33
  },
34
34
  "dependencies": {
35
35
  "tslib": ">=2.0.0"
@@ -37,7 +37,7 @@
37
37
  "exports": {
38
38
  ".": {
39
39
  "sass": "./_index.scss",
40
- "types": "./index.d.ts",
40
+ "types": "./types/dhutaryan-ngx-mat-timepicker.d.ts",
41
41
  "default": "./fesm2022/dhutaryan-ngx-mat-timepicker.mjs"
42
42
  },
43
43
  "./package.json": {
@@ -46,5 +46,5 @@
46
46
  },
47
47
  "sideEffects": false,
48
48
  "module": "fesm2022/dhutaryan-ngx-mat-timepicker.mjs",
49
- "typings": "index.d.ts"
49
+ "typings": "types/dhutaryan-ngx-mat-timepicker.d.ts"
50
50
  }
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, InjectionToken, Provider, OnDestroy, AfterContentInit, AfterViewChecked, OnInit, NgZone, ElementRef, ChangeDetectorRef, AfterViewInit, OnChanges, ViewContainerRef, SimpleChanges, TemplateRef } from '@angular/core';
2
+ import { InjectionToken, Provider, OnDestroy, AfterContentInit, AfterViewChecked, EventEmitter, ElementRef, ChangeDetectorRef, AfterViewInit, OnChanges, ViewContainerRef, Injector, SimpleChanges, OnInit, TemplateRef } from '@angular/core';
3
3
  import * as i1$1 from '@angular/cdk/overlay';
4
4
  import { Overlay, ScrollStrategy } from '@angular/cdk/overlay';
5
5
  import * as i2 from '@angular/cdk/portal';
@@ -8,7 +8,6 @@ import * as i3 from '@angular/cdk/a11y';
8
8
  import { ThemePalette } from '@angular/material/core';
9
9
  import { BooleanInput } from '@angular/cdk/coercion';
10
10
  import { Subject, Observable } from 'rxjs';
11
- import { AnimationEvent } from '@angular/animations';
12
11
  import { ControlValueAccessor, Validator, ValidatorFn, AbstractControl, ValidationErrors } from '@angular/forms';
13
12
  import { MatFormField } from '@angular/material/form-field';
14
13
  import * as i15 from '@angular/cdk/scrolling';
@@ -47,22 +46,16 @@ declare class MatTimepickerIntl {
47
46
  type MatTimePeriodType = 'am' | 'pm';
48
47
  declare class MatTimePeriod {
49
48
  _intl: MatTimepickerIntl;
50
- /** Whether the time period is vertically aligned. */
51
- get vertical(): boolean;
52
- set vertical(value: BooleanInput);
53
- private _vertical;
54
- get period(): MatTimePeriodType;
55
- set period(value: MatTimePeriodType);
56
- private _period;
57
- get disabledPeriod(): MatTimePeriodType | null;
58
- set disabledPeriod(value: MatTimePeriodType | null);
59
- private _disabledPeriod;
60
- periodChanged: EventEmitter<MatTimePeriodType>;
49
+ readonly vertical: i0.InputSignalWithTransform<boolean, unknown>;
50
+ readonly period: i0.InputSignal<MatTimePeriodType>;
51
+ readonly disabledPeriod: i0.InputSignal<MatTimePeriodType | null>;
52
+ readonly periodChanged: i0.OutputEmitterRef<MatTimePeriodType>;
53
+ readonly _currentPeriod: i0.WritableSignal<MatTimePeriodType>;
61
54
  constructor(_intl: MatTimepickerIntl);
62
55
  setPeriod(event: Event, period: MatTimePeriodType): void;
63
56
  _isPeriodDisabled(period: MatTimePeriodType): boolean;
64
57
  static ɵfac: i0.ɵɵFactoryDeclaration<MatTimePeriod, never>;
65
- static ɵcmp: i0.ɵɵComponentDeclaration<MatTimePeriod, "mat-time-period", never, { "vertical": { "alias": "vertical"; "required": false; }; "period": { "alias": "period"; "required": false; }; "disabledPeriod": { "alias": "disabledPeriod"; "required": false; }; }, { "periodChanged": "periodChanged"; }, never, never, true, never>;
58
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatTimePeriod, "mat-time-period", never, { "vertical": { "alias": "vertical"; "required": false; "isSignal": true; }; "period": { "alias": "period"; "required": false; "isSignal": true; }; "disabledPeriod": { "alias": "disabledPeriod"; "required": false; "isSignal": true; }; }, { "periodChanged": "periodChanged"; }, never, never, true, never>;
66
59
  }
67
60
 
68
61
  /** InjectionToken for timepicker that can be used to override default locale code. */
@@ -325,11 +318,9 @@ declare abstract class MatTimeFaceBase<T> implements AfterContentInit, AfterView
325
318
  availableMinutes: number[];
326
319
  availableHours: number[];
327
320
  /**
328
- * Used for scheduling that focus should be moved to the active cell on the next tick.
329
- * We need to schedule it, rather than do it immediately, because we have to wait
330
- * for Angular to re-evaluate the view children.
321
+ * Used to focus the active cell after change detection has run.
331
322
  */
332
- private _moveFocusOnNextTick;
323
+ private _focusActiveCellAfterViewChecked;
333
324
  constructor(_timeAdapter: TimeAdapter<T>);
334
325
  ngAfterContentInit(): void;
335
326
  ngAfterViewChecked(): void;
@@ -378,6 +369,8 @@ declare abstract class MatTimeFaceBase<T> implements AfterContentInit, AfterView
378
369
  private _setMaxMinute;
379
370
  /** Sets disabled period. */
380
371
  private _setDisabledPeriod;
372
+ /** Schedules focus to be moved to the active cell on the next tick. */
373
+ private _scheduleFocusActiveCellAfterViewChecked;
381
374
  static ɵfac: i0.ɵɵFactoryDeclaration<MatTimeFaceBase<any>, [{ optional: true; }]>;
382
375
  static ɵdir: i0.ɵɵDirectiveDeclaration<MatTimeFaceBase<any>, never, never, { "selected": { "alias": "selected"; "required": false; }; "minTime": { "alias": "minTime"; "required": false; }; "maxTime": { "alias": "maxTime"; "required": false; }; "minuteInterval": { "alias": "minuteInterval"; "required": false; }; "isMeridiem": { "alias": "isMeridiem"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, { "_userSelection": "_userSelection"; "selectedChange": "selectedChange"; }, never, never, true, never>;
383
376
  }
@@ -386,22 +379,22 @@ declare abstract class MatTimeFaceBase<T> implements AfterContentInit, AfterView
386
379
  type TimepickerOrientation = 'horizontal' | 'vertical';
387
380
 
388
381
  type MatDialView = 'hours' | 'minutes';
389
- declare class MatClockDials<T> extends MatTimeFaceBase<T> implements OnInit, OnDestroy {
382
+ declare class MatClockDials<T> extends MatTimeFaceBase<T> {
390
383
  _intl: MatTimepickerIntl;
391
- private _ngZone;
392
384
  private _elementRef;
393
385
  private _cdr;
394
386
  /** Layout orientation. */
395
- orientation: TimepickerOrientation;
387
+ readonly orientation: i0.InputSignal<TimepickerOrientation>;
396
388
  /** Whether the timepicker UI is in touch mode. */
397
- touchUi: boolean;
398
- isHoursView: boolean;
389
+ readonly touchUi: i0.InputSignal<boolean>;
390
+ /** Whether the current view for the timepicker. */
391
+ readonly currentView: i0.InputSignal<MatDialView>;
392
+ /** Emits when the view is changed. */
393
+ readonly viewChanged: i0.OutputEmitterRef<MatDialView>;
394
+ readonly isHoursView: i0.Signal<boolean>;
399
395
  /** Specifies the view of clock dial. */
400
396
  private readonly _view;
401
- private _viewSubscription;
402
- constructor(_intl: MatTimepickerIntl, _timeAdapter: TimeAdapter<T>, _ngZone: NgZone, _elementRef: ElementRef, _cdr: ChangeDetectorRef);
403
- ngOnInit(): void;
404
- ngOnDestroy(): void;
397
+ constructor(_intl: MatTimepickerIntl, _timeAdapter: TimeAdapter<T>, _elementRef: ElementRef, _cdr: ChangeDetectorRef);
405
398
  /** Changes clock dial view. */
406
399
  onViewChange(event: Event, view: MatDialView): void;
407
400
  focusActiveCell(): void;
@@ -412,8 +405,8 @@ declare class MatClockDials<T> extends MatTimeFaceBase<T> implements OnInit, OnD
412
405
  hour: number;
413
406
  changeView?: boolean;
414
407
  }): void;
415
- static ɵfac: i0.ɵɵFactoryDeclaration<MatClockDials<any>, [null, { optional: true; }, null, null, null]>;
416
- static ɵcmp: i0.ɵɵComponentDeclaration<MatClockDials<any>, "mat-clock-dials", ["matClockDials"], { "orientation": { "alias": "orientation"; "required": false; }; "touchUi": { "alias": "touchUi"; "required": false; }; }, {}, never, never, true, never>;
408
+ static ɵfac: i0.ɵɵFactoryDeclaration<MatClockDials<any>, [null, { optional: true; }, null, null]>;
409
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatClockDials<any>, "mat-clock-dials", ["matClockDials"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "touchUi": { "alias": "touchUi"; "required": false; "isSignal": true; }; "currentView": { "alias": "currentView"; "required": false; "isSignal": true; }; }, { "viewChanged": "viewChanged"; }, never, never, true, never>;
417
410
  }
418
411
 
419
412
  declare const MAT_TIMEPICKER_INPUTS_KEYDOWN_HANDLER: InjectionToken<(event: KeyboardEvent) => void>;
@@ -471,20 +464,19 @@ declare class MatMinuteInput extends MatTimeInputBase {
471
464
  }
472
465
  declare class MatTimeInputs<T> extends MatTimeFaceBase<T> {
473
466
  _intl: MatTimepickerIntl;
474
- private _ngZone;
475
467
  private _elementRef;
476
- constructor(_intl: MatTimepickerIntl, _timeAdapter: TimeAdapter<T>, _ngZone: NgZone, _elementRef: ElementRef);
468
+ constructor(_intl: MatTimepickerIntl, _timeAdapter: TimeAdapter<T>, _elementRef: ElementRef);
477
469
  /**
478
470
  * Using for skipping that focus shouldn't be moved to the active cell on the next tick.
479
471
  * We need to use it to avoid focusing input for input mode.
480
472
  */
481
473
  private _skipNextTickFocus;
482
474
  focusActiveCell(): void;
483
- static ɵfac: i0.ɵɵFactoryDeclaration<MatTimeInputs<any>, [null, { optional: true; }, null, null]>;
475
+ static ɵfac: i0.ɵɵFactoryDeclaration<MatTimeInputs<any>, [null, { optional: true; }, null]>;
484
476
  static ɵcmp: i0.ɵɵComponentDeclaration<MatTimeInputs<any>, "mat-time-inputs", never, {}, {}, never, never, true, never>;
485
477
  }
486
478
 
487
- declare class MatTimepickerContent<S, T = ExtractTimeTypeFromSelection<S>> implements OnInit, AfterViewInit {
479
+ declare class MatTimepickerContent<S, T = ExtractTimeTypeFromSelection<S>> implements AfterViewInit {
488
480
  private _globalModel;
489
481
  private _changeDetectorRef;
490
482
  /** Reference to the internal clock dials component. */
@@ -495,8 +487,8 @@ declare class MatTimepickerContent<S, T = ExtractTimeTypeFromSelection<S>> imple
495
487
  timepicker: MatTimepickerBase<any, S, T>;
496
488
  /** Display mode. */
497
489
  mode: TimepickerMode;
498
- /** Current state of the animation. */
499
- _animationState: 'enter-dropdown' | 'enter-dialog' | 'void';
490
+ /** Whether the animation is disabled. */
491
+ protected _animationsDisabled: boolean | undefined;
500
492
  /** Whether the clock uses 12 hour format. */
501
493
  isMeridiem: boolean;
502
494
  /** Whether should toggle face button be shown. */
@@ -522,15 +514,18 @@ declare class MatTimepickerContent<S, T = ExtractTimeTypeFromSelection<S>> imple
522
514
  color: ThemePalette;
523
515
  /** Emits when an animation has finished. */
524
516
  readonly _animationDone: Subject<void>;
517
+ protected _elementRef: ElementRef<HTMLElement>;
518
+ private _ngZone;
525
519
  private _model;
526
- private _subscriptions;
527
- constructor(intl: MatTimepickerIntl, _globalModel: MatTimeSelectionModel<S, T>, _changeDetectorRef: ChangeDetectorRef);
528
- ngOnInit(): void;
520
+ private _stateChanges;
521
+ private _eventCleanups;
522
+ private _animationFallback;
523
+ constructor(_globalModel: MatTimeSelectionModel<S, T>, _changeDetectorRef: ChangeDetectorRef);
529
524
  ngAfterViewInit(): void;
530
525
  ngOnDestroy(): void;
531
526
  /** Changes animation state while closing timepicker content. */
532
527
  _startExitAnimation(): void;
533
- _handleAnimationEvent(event: AnimationEvent): void;
528
+ private _handleAnimationEvent;
534
529
  onToggleMode(mode: TimepickerMode): void;
535
530
  _getSelected(): T | null;
536
531
  /** Applies the current pending selection to the global model. */
@@ -570,6 +565,10 @@ interface MatTimepickerControl<T> {
570
565
  }
571
566
  /** A timepicker that can be attached to a {@link MatTimepickerControl}. */
572
567
  interface MatTimepickerPanel<C extends MatTimepickerControl<T>, S, T = ExtractTimeTypeFromSelection<S>> {
568
+ /** The id for the timepicker's. */
569
+ id: string;
570
+ /** Whether the timepicker is open. */
571
+ opened: boolean;
573
572
  /** Stream that emits whenever the timepicker is opened. */
574
573
  openedStream: EventEmitter<void>;
575
574
  /** Stream that emits whenever the timepicker is closed. */
@@ -607,7 +606,7 @@ declare const MAT_TIMEPICKER_DEFAULT_OPTIONS: InjectionToken<MatTimepickerDefaul
607
606
  declare abstract class MatTimepickerBase<C extends MatTimepickerControl<T>, S, T = ExtractTimeTypeFromSelection<S>> implements OnChanges {
608
607
  private _viewContainerRef;
609
608
  private _overlay;
610
- private _ngZone;
609
+ private readonly _injector;
611
610
  private _defaultActionsComponent;
612
611
  private _model;
613
612
  private _defaults?;
@@ -690,7 +689,7 @@ declare abstract class MatTimepickerBase<C extends MatTimepickerControl<T>, S, T
690
689
  _getMinTime(): T | null;
691
690
  /** The maximum selectable time. */
692
691
  _getMaxTime(): T | null;
693
- constructor(_viewContainerRef: ViewContainerRef, _overlay: Overlay, _ngZone: NgZone, scrollStrategy: any, _defaultActionsComponent: ComponentType<any>, _model: MatTimeSelectionModel<S, T>, _defaults?: MatTimepickerDefaultOptions | undefined);
692
+ constructor(_viewContainerRef: ViewContainerRef, _overlay: Overlay, _injector: Injector, scrollStrategy: any, _defaultActionsComponent: ComponentType<any>, _model: MatTimeSelectionModel<S, T>, _defaults?: MatTimepickerDefaultOptions | undefined);
694
693
  ngOnChanges(changes: SimpleChanges): void;
695
694
  ngOnDestroy(): void;
696
695
  /** Opens the timepicker. */
@@ -839,7 +838,7 @@ declare abstract class MatTimepickerInputBase<S, T = ExtractTimeTypeFromSelectio
839
838
  ngOnDestroy(): void;
840
839
  /** Registers a time selection model with the input. */
841
840
  _registerModel(model: MatTimeSelectionModel<S, T>): void;
842
- _onInput(value: string): void;
841
+ _onInput(event: Event): void;
843
842
  /** Handles change event on the input. */
844
843
  _onChange(): void;
845
844
  /** Handles blur event on the input. */