@ng-matero/extensions 14.4.1 → 14.6.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.
Files changed (61) hide show
  1. package/alert/alert.component.d.ts +4 -4
  2. package/core/datetime/datetime-adapter.d.ts +1 -1
  3. package/datetimepicker/_datetimepicker-theme.scss +38 -12
  4. package/datetimepicker/calendar.d.ts +28 -17
  5. package/datetimepicker/calendar.scss +68 -92
  6. package/datetimepicker/clock.d.ts +3 -2
  7. package/datetimepicker/clock.scss +1 -1
  8. package/datetimepicker/datetimepicker-content.scss +21 -6
  9. package/datetimepicker/datetimepicker-intl.d.ts +51 -0
  10. package/datetimepicker/datetimepicker-module.d.ts +13 -12
  11. package/datetimepicker/datetimepicker-toggle.d.ts +6 -4
  12. package/datetimepicker/datetimepicker-types.d.ts +4 -0
  13. package/datetimepicker/datetimepicker.d.ts +14 -3
  14. package/datetimepicker/public-api.d.ts +1 -0
  15. package/datetimepicker/time.d.ts +130 -0
  16. package/datetimepicker/time.scss +78 -0
  17. package/esm2020/alert/alert.component.mjs +5 -5
  18. package/esm2020/core/datetime/datetime-adapter.mjs +1 -1
  19. package/esm2020/datetimepicker/calendar-body.mjs +3 -3
  20. package/esm2020/datetimepicker/calendar.mjs +81 -33
  21. package/esm2020/datetimepicker/clock.mjs +14 -8
  22. package/esm2020/datetimepicker/datetimepicker-intl.mjs +63 -0
  23. package/esm2020/datetimepicker/datetimepicker-module.mjs +8 -1
  24. package/esm2020/datetimepicker/datetimepicker-toggle.mjs +9 -6
  25. package/esm2020/datetimepicker/datetimepicker-types.mjs +1 -1
  26. package/esm2020/datetimepicker/datetimepicker.mjs +50 -19
  27. package/esm2020/datetimepicker/public-api.mjs +2 -1
  28. package/esm2020/datetimepicker/time.mjs +453 -0
  29. package/esm2020/grid/cell.component.mjs +1 -1
  30. package/esm2020/grid/grid.component.mjs +84 -23
  31. package/esm2020/grid/grid.interface.mjs +1 -1
  32. package/esm2020/loader/loader.component.mjs +10 -4
  33. package/esm2020/progress/progress.component.mjs +5 -5
  34. package/fesm2015/mtxAlert.mjs +4 -4
  35. package/fesm2015/mtxAlert.mjs.map +1 -1
  36. package/fesm2015/mtxCore.mjs.map +1 -1
  37. package/fesm2015/mtxDatetimepicker.mjs +663 -65
  38. package/fesm2015/mtxDatetimepicker.mjs.map +1 -1
  39. package/fesm2015/mtxGrid.mjs +83 -22
  40. package/fesm2015/mtxGrid.mjs.map +1 -1
  41. package/fesm2015/mtxLoader.mjs +9 -3
  42. package/fesm2015/mtxLoader.mjs.map +1 -1
  43. package/fesm2015/mtxProgress.mjs +4 -4
  44. package/fesm2015/mtxProgress.mjs.map +1 -1
  45. package/fesm2020/mtxAlert.mjs +4 -4
  46. package/fesm2020/mtxAlert.mjs.map +1 -1
  47. package/fesm2020/mtxCore.mjs.map +1 -1
  48. package/fesm2020/mtxDatetimepicker.mjs +660 -65
  49. package/fesm2020/mtxDatetimepicker.mjs.map +1 -1
  50. package/fesm2020/mtxGrid.mjs +83 -22
  51. package/fesm2020/mtxGrid.mjs.map +1 -1
  52. package/fesm2020/mtxLoader.mjs +9 -3
  53. package/fesm2020/mtxLoader.mjs.map +1 -1
  54. package/fesm2020/mtxProgress.mjs +4 -4
  55. package/fesm2020/mtxProgress.mjs.map +1 -1
  56. package/grid/cell.component.d.ts +1 -1
  57. package/grid/grid.component.d.ts +89 -11
  58. package/grid/grid.interface.d.ts +2 -2
  59. package/loader/loader.component.d.ts +9 -3
  60. package/package.json +1 -1
  61. package/progress/progress.component.d.ts +8 -8
@@ -4,21 +4,20 @@ import * as i4$1 from '@angular/cdk/overlay';
4
4
  import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
5
5
  import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
6
6
  import * as i2 from '@angular/common';
7
- import { CommonModule } from '@angular/common';
7
+ import { DOCUMENT, CommonModule } from '@angular/common';
8
8
  import * as i0 from '@angular/core';
9
- import { EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, Optional, Inject, InjectionToken, ViewChild, forwardRef, Directive, ContentChild, NgModule } from '@angular/core';
9
+ import { EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, Optional, Inject, Injectable, Directive, ElementRef, ViewChild, InjectionToken, inject, forwardRef, ContentChild, NgModule } from '@angular/core';
10
10
  import * as i4 from '@angular/material/button';
11
11
  import { MatButtonModule } from '@angular/material/button';
12
- import { ENTER, PAGE_DOWN, PAGE_UP, END, HOME, DOWN_ARROW, UP_ARROW, RIGHT_ARROW, LEFT_ARROW, ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
13
- import { coerceBooleanProperty, coerceStringArray } from '@angular/cdk/coercion';
12
+ import { UP_ARROW, DOWN_ARROW, ENTER, PAGE_DOWN, PAGE_UP, END, HOME, RIGHT_ARROW, LEFT_ARROW, ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
13
+ import { coerceNumberProperty, coerceBooleanProperty, coerceStringArray } from '@angular/cdk/coercion';
14
14
  import { first, take, filter } from 'rxjs/operators';
15
15
  import * as i1 from '@ng-matero/extensions/core';
16
16
  import { MTX_DATETIME_FORMATS } from '@ng-matero/extensions/core';
17
17
  import { trigger, transition, animate, keyframes, style, state } from '@angular/animations';
18
- import * as i1$1 from '@angular/material/datepicker';
18
+ import { Subject, Subscription, merge, of } from 'rxjs';
19
19
  import { _getFocusedElementPierceShadowDom } from '@angular/cdk/platform';
20
20
  import { mixinColor } from '@angular/material/core';
21
- import { Subject, Subscription, merge, of } from 'rxjs';
22
21
  import * as i6 from '@angular/cdk/bidi';
23
22
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators } from '@angular/forms';
24
23
  import { MAT_INPUT_VALUE_ACCESSOR } from '@angular/material/input';
@@ -130,12 +129,12 @@ class MtxCalendarBody {
130
129
  }
131
130
  }
132
131
  /** @nocollapse */ MtxCalendarBody.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxCalendarBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
133
- /** @nocollapse */ MtxCalendarBody.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: { label: "label", rows: "rows", todayValue: "todayValue", selectedValue: "selectedValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", allowDisabledSelection: "allowDisabledSelection", activeCell: "activeCell" }, outputs: { selectedValueChange: "selectedValueChange" }, host: { classAttribute: "mtx-calendar-body" }, exportAs: ["mtxCalendarBody"], ngImport: i0, template: "<!--\n If there's not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don't want it to be read out as one of the weeks in the month.\n-->\n<tr *ngIf=\"_firstRowOffset < labelMinRequiredCells\" aria-hidden=\"true\">\n <td [attr.colspan]=\"numCols\" class=\"mtx-calendar-body-label\">{{ label }}</td>\n</tr>\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\" role=\"row\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n -->\n <td *ngIf=\"rowIndex === 0 && _firstRowOffset\"\n [attr.colspan]=\"_firstRowOffset\"\n aria-hidden=\"true\"\n class=\"mtx-calendar-body-label\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n <td *ngFor=\"let item of row; let colIndex = index\"\n role=\"gridcell\"\n class=\"mtx-calendar-body-cell\"\n [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [attr.data-mat-row]=\"rowIndex\"\n [attr.data-mat-col]=\"colIndex\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n [class.mtx-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\"\n [class.mtx-calendar-body-disabled]=\"!item.enabled\"\n (click)=\"_cellClicked(item)\">\n <div [attr.aria-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-today]=\"todayValue === item.value\"\n class=\"mtx-calendar-body-cell-content\">\n {{ item.displayValue }}\n </div>\n </td>\n</tr>\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%}[dir=rtl] .mtx-calendar-body-label{text-align:right}.mtx-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:7.1428571429% 0;text-align:center;outline:none;cursor:pointer}.mtx-calendar-body-disabled{cursor:default;pointer-events:none}.mtx-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid transparent;border-radius:999px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
132
+ /** @nocollapse */ MtxCalendarBody.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: { label: "label", rows: "rows", todayValue: "todayValue", selectedValue: "selectedValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", allowDisabledSelection: "allowDisabledSelection", activeCell: "activeCell" }, outputs: { selectedValueChange: "selectedValueChange" }, host: { classAttribute: "mtx-calendar-body" }, exportAs: ["mtxCalendarBody"], ngImport: i0, template: "<!--\n If there's not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don't want it to be read out as one of the weeks in the month.\n-->\n<tr *ngIf=\"_firstRowOffset < labelMinRequiredCells\" aria-hidden=\"true\">\n <td class=\"mtx-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\n</tr>\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\" role=\"row\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n -->\n <td *ngIf=\"rowIndex === 0 && _firstRowOffset\"\n class=\"mtx-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" aria-hidden=\"true\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n <td *ngFor=\"let item of row; let colIndex = index\"\n role=\"gridcell\"\n class=\"mtx-calendar-body-cell\"\n [class.mtx-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\"\n [class.mtx-calendar-body-disabled]=\"!item.enabled\"\n [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [attr.data-mat-row]=\"rowIndex\"\n [attr.data-mat-col]=\"colIndex\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n (click)=\"_cellClicked(item)\">\n <div class=\"mtx-calendar-body-cell-content\"\n [class.mtx-calendar-body-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-today]=\"todayValue === item.value\"\n [attr.aria-selected]=\"selectedValue === item.value\">\n {{ item.displayValue }}\n </div>\n </td>\n</tr>\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%}[dir=rtl] .mtx-calendar-body-label{text-align:right}.mtx-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:7.1428571429% 0;text-align:center;outline:none;cursor:pointer}.mtx-calendar-body-disabled{cursor:default;pointer-events:none}.mtx-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid transparent;border-radius:999px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
134
133
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxCalendarBody, decorators: [{
135
134
  type: Component,
136
135
  args: [{ selector: '[mtx-calendar-body]', host: {
137
136
  class: 'mtx-calendar-body',
138
- }, exportAs: 'mtxCalendarBody', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n If there's not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don't want it to be read out as one of the weeks in the month.\n-->\n<tr *ngIf=\"_firstRowOffset < labelMinRequiredCells\" aria-hidden=\"true\">\n <td [attr.colspan]=\"numCols\" class=\"mtx-calendar-body-label\">{{ label }}</td>\n</tr>\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\" role=\"row\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n -->\n <td *ngIf=\"rowIndex === 0 && _firstRowOffset\"\n [attr.colspan]=\"_firstRowOffset\"\n aria-hidden=\"true\"\n class=\"mtx-calendar-body-label\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n <td *ngFor=\"let item of row; let colIndex = index\"\n role=\"gridcell\"\n class=\"mtx-calendar-body-cell\"\n [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [attr.data-mat-row]=\"rowIndex\"\n [attr.data-mat-col]=\"colIndex\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n [class.mtx-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\"\n [class.mtx-calendar-body-disabled]=\"!item.enabled\"\n (click)=\"_cellClicked(item)\">\n <div [attr.aria-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-today]=\"todayValue === item.value\"\n class=\"mtx-calendar-body-cell-content\">\n {{ item.displayValue }}\n </div>\n </td>\n</tr>\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%}[dir=rtl] .mtx-calendar-body-label{text-align:right}.mtx-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:7.1428571429% 0;text-align:center;outline:none;cursor:pointer}.mtx-calendar-body-disabled{cursor:default;pointer-events:none}.mtx-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid transparent;border-radius:999px}\n"] }]
137
+ }, exportAs: 'mtxCalendarBody', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n If there's not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don't want it to be read out as one of the weeks in the month.\n-->\n<tr *ngIf=\"_firstRowOffset < labelMinRequiredCells\" aria-hidden=\"true\">\n <td class=\"mtx-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\n</tr>\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\" role=\"row\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n -->\n <td *ngIf=\"rowIndex === 0 && _firstRowOffset\"\n class=\"mtx-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" aria-hidden=\"true\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n <td *ngFor=\"let item of row; let colIndex = index\"\n role=\"gridcell\"\n class=\"mtx-calendar-body-cell\"\n [class.mtx-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\"\n [class.mtx-calendar-body-disabled]=\"!item.enabled\"\n [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [attr.data-mat-row]=\"rowIndex\"\n [attr.data-mat-col]=\"colIndex\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n (click)=\"_cellClicked(item)\">\n <div class=\"mtx-calendar-body-cell-content\"\n [class.mtx-calendar-body-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-today]=\"todayValue === item.value\"\n [attr.aria-selected]=\"selectedValue === item.value\">\n {{ item.displayValue }}\n </div>\n </td>\n</tr>\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%}[dir=rtl] .mtx-calendar-body-label{text-align:right}.mtx-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:7.1428571429% 0;text-align:center;outline:none;cursor:pointer}.mtx-calendar-body-disabled{cursor:default;pointer-events:none}.mtx-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid transparent;border-radius:999px}\n"] }]
139
138
  }], propDecorators: { label: [{
140
139
  type: Input
141
140
  }], rows: [{
@@ -362,6 +361,66 @@ function euclideanModulo(a, b) {
362
361
  return ((a % b) + b) % b;
363
362
  }
364
363
 
364
+ class MtxDatetimepickerIntl {
365
+ constructor() {
366
+ /**
367
+ * Stream to emit from when labels are changed. Use this to notify components when the labels have
368
+ * changed after initialization.
369
+ */
370
+ this.changes = new Subject();
371
+ /** A label for the calendar popup (used by screen readers). */
372
+ this.calendarLabel = 'Calendar';
373
+ /** A label for the button used to open the calendar popup (used by screen readers). */
374
+ this.openCalendarLabel = 'Open calendar';
375
+ /** Label for the button used to close the calendar popup. */
376
+ this.closeCalendarLabel = 'Close calendar';
377
+ /** A label for the previous month button (used by screen readers). */
378
+ this.prevMonthLabel = 'Previous month';
379
+ /** A label for the next month button (used by screen readers). */
380
+ this.nextMonthLabel = 'Next month';
381
+ /** A label for the previous year button (used by screen readers). */
382
+ this.prevYearLabel = 'Previous year';
383
+ /** A label for the next year button (used by screen readers). */
384
+ this.nextYearLabel = 'Next year';
385
+ /** A label for the previous multi-year button (used by screen readers). */
386
+ this.prevMultiYearLabel = 'Previous 24 years';
387
+ /** A label for the next multi-year button (used by screen readers). */
388
+ this.nextMultiYearLabel = 'Next 24 years';
389
+ /** A label for the 'switch to month view' button (used by screen readers). */
390
+ this.switchToMonthViewLabel = 'Choose date';
391
+ /** A label for the 'switch to year view' button (used by screen readers). */
392
+ this.switchToYearViewLabel = 'Choose month';
393
+ /** A label for the 'switch to multi-year view' button (used by screen readers). */
394
+ this.switchToMultiYearViewLabel = 'Choose month and year';
395
+ /** A label for the first date of a range of dates (used by screen readers). */
396
+ this.startDateLabel = 'Start date';
397
+ /** A label for the last date of a range of dates (used by screen readers). */
398
+ this.endDateLabel = 'End date';
399
+ /** A label for the 'switch to clock hour view' button (used by screen readers). */
400
+ this.switchToClockHourViewLabel = 'Choose hour';
401
+ /** A label for the 'switch to clock minute view' button (used by screen readers). */
402
+ this.switchToClockMinuteViewLabel = 'Choose minute';
403
+ /** Label used for ok button within the manual time input. */
404
+ this.okLabel = 'OK';
405
+ /** Label used for cancel button within the manual time input. */
406
+ this.cancelLabel = 'Cancel';
407
+ }
408
+ /** Formats a range of years (used for visuals). */
409
+ formatYearRange(start, end) {
410
+ return `${start} \u2013 ${end}`;
411
+ }
412
+ /** Formats a label for a range of years (used by screen readers). */
413
+ formatYearRangeLabel(start, end) {
414
+ return `${start} to ${end}`;
415
+ }
416
+ }
417
+ /** @nocollapse */ MtxDatetimepickerIntl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
418
+ /** @nocollapse */ MtxDatetimepickerIntl.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerIntl, providedIn: 'root' });
419
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerIntl, decorators: [{
420
+ type: Injectable,
421
+ args: [{ providedIn: 'root' }]
422
+ }] });
423
+
365
424
  const CLOCK_RADIUS = 50;
366
425
  const CLOCK_INNER_RADIUS = 27.5;
367
426
  const CLOCK_OUTER_RADIUS = 41.25;
@@ -371,9 +430,10 @@ const CLOCK_TICK_RADIUS = 7.0833;
371
430
  * @docs-private
372
431
  */
373
432
  class MtxClock {
374
- constructor(_element, _adapter) {
433
+ constructor(_element, _adapter, _cdr) {
375
434
  this._element = _element;
376
435
  this._adapter = _adapter;
436
+ this._cdr = _cdr;
377
437
  /** Step over minutes. */
378
438
  this.interval = 1;
379
439
  /** Whether the clock uses 12 hour format. */
@@ -479,8 +539,12 @@ class MtxClock {
479
539
  this.setTime(event);
480
540
  document.addEventListener('mousemove', this.mouseMoveListener);
481
541
  document.addEventListener('touchmove', this.mouseMoveListener);
482
- document.addEventListener('mouseup', this.mouseUpListener);
483
- document.addEventListener('touchend', this.mouseUpListener);
542
+ document.addEventListener('mouseup', this.mouseUpListener, {
543
+ passive: true,
544
+ });
545
+ document.addEventListener('touchend', this.mouseUpListener, {
546
+ passive: true,
547
+ });
484
548
  }
485
549
  _handleMousemove(event) {
486
550
  event.preventDefault();
@@ -600,19 +664,20 @@ class MtxClock {
600
664
  }
601
665
  this._timeChanged = true;
602
666
  this.activeDate = date;
667
+ this._cdr.markForCheck();
603
668
  this.activeDateChange.emit(this.activeDate);
604
669
  }
605
670
  }
606
- /** @nocollapse */ MtxClock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxClock, deps: [{ token: i0.ElementRef }, { token: i1.DatetimeAdapter }], target: i0.ɵɵFactoryTarget.Component });
607
- /** @nocollapse */ MtxClock.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxClock, selector: "mtx-clock", inputs: { dateFilter: "dateFilter", interval: "interval", twelvehour: "twelvehour", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", startView: "startView" }, outputs: { selectedChange: "selectedChange", activeDateChange: "activeDateChange", _userSelection: "_userSelection" }, host: { attributes: { "role": "clock" }, listeners: { "mousedown": "_handleMousedown($event)" }, properties: { "class.mtx-clock": "true" } }, exportAs: ["mtxClock"], ngImport: i0, template: "<div class=\"mtx-clock-wrapper\">\n <div class=\"mtx-clock-center\"></div>\n <div [ngStyle]=\"_hand\" class=\"mtx-clock-hand\"></div>\n <div [class.active]=\"_hourView\" class=\"mtx-clock-hours\">\n <div *ngFor=\"let item of _hours\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedHour === item.value\"\n [style.fontSize]=\"item.fontSize\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\"\n class=\"mtx-clock-cell\">{{ item.displayValue }}</div>\n </div>\n <div [class.active]=\"!_hourView\" class=\"mtx-clock-minutes\">\n <div *ngFor=\"let item of _minutes\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedMinute === item.value\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\"\n class=\"mtx-clock-cell\">{{ item.displayValue }}</div>\n </div>\n</div>\n", styles: [".mtx-clock{position:relative;display:block;min-width:224px;margin:8px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%}.mtx-clock-hand{position:absolute;top:0;right:0;bottom:0;left:0;width:1px;margin:0 auto;transform-origin:bottom}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%}.mtx-clock-hours,.mtx-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.mtx-clock-hours.active,.mtx-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.mtx-clock-minutes{transform:scale(.8)}.mtx-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], encapsulation: i0.ViewEncapsulation.None });
671
+ /** @nocollapse */ MtxClock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxClock, deps: [{ token: i0.ElementRef }, { token: i1.DatetimeAdapter }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
672
+ /** @nocollapse */ MtxClock.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxClock, selector: "mtx-clock", inputs: { dateFilter: "dateFilter", interval: "interval", twelvehour: "twelvehour", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", startView: "startView" }, outputs: { selectedChange: "selectedChange", activeDateChange: "activeDateChange", _userSelection: "_userSelection" }, host: { attributes: { "role": "clock" }, listeners: { "mousedown": "_handleMousedown($event)" }, properties: { "class.mtx-clock": "true" } }, exportAs: ["mtxClock"], ngImport: i0, template: "<div class=\"mtx-clock-wrapper\">\n <div class=\"mtx-clock-center\"></div>\n <div class=\"mtx-clock-hand\" [ngStyle]=\"_hand\"></div>\n <div class=\"mtx-clock-hours\" [class.active]=\"_hourView\">\n <div *ngFor=\"let item of _hours\"\n class=\"mtx-clock-cell\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedHour === item.value\"\n [style.fontSize]=\"item.fontSize\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\">{{ item.displayValue }}</div>\n </div>\n <div [class.active]=\"!_hourView\" class=\"mtx-clock-minutes\">\n <div *ngFor=\"let item of _minutes\"\n class=\"mtx-clock-cell\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedMinute === item.value\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\">{{ item.displayValue }}</div>\n </div>\n</div>\n", styles: [".mtx-clock{position:relative;display:block;min-width:224px;margin:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%}.mtx-clock-hand{position:absolute;top:0;right:0;bottom:0;left:0;width:1px;margin:0 auto;transform-origin:bottom}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%}.mtx-clock-hours,.mtx-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.mtx-clock-hours.active,.mtx-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.mtx-clock-minutes{transform:scale(.8)}.mtx-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], encapsulation: i0.ViewEncapsulation.None });
608
673
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxClock, decorators: [{
609
674
  type: Component,
610
675
  args: [{ selector: 'mtx-clock', host: {
611
676
  '[class.mtx-clock]': 'true',
612
677
  'role': 'clock',
613
678
  '(mousedown)': '_handleMousedown($event)',
614
- }, exportAs: 'mtxClock', encapsulation: ViewEncapsulation.None, template: "<div class=\"mtx-clock-wrapper\">\n <div class=\"mtx-clock-center\"></div>\n <div [ngStyle]=\"_hand\" class=\"mtx-clock-hand\"></div>\n <div [class.active]=\"_hourView\" class=\"mtx-clock-hours\">\n <div *ngFor=\"let item of _hours\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedHour === item.value\"\n [style.fontSize]=\"item.fontSize\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\"\n class=\"mtx-clock-cell\">{{ item.displayValue }}</div>\n </div>\n <div [class.active]=\"!_hourView\" class=\"mtx-clock-minutes\">\n <div *ngFor=\"let item of _minutes\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedMinute === item.value\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\"\n class=\"mtx-clock-cell\">{{ item.displayValue }}</div>\n </div>\n</div>\n", styles: [".mtx-clock{position:relative;display:block;min-width:224px;margin:8px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%}.mtx-clock-hand{position:absolute;top:0;right:0;bottom:0;left:0;width:1px;margin:0 auto;transform-origin:bottom}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%}.mtx-clock-hours,.mtx-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.mtx-clock-hours.active,.mtx-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.mtx-clock-minutes{transform:scale(.8)}.mtx-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none}\n"] }]
615
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter }]; }, propDecorators: { dateFilter: [{
679
+ }, exportAs: 'mtxClock', encapsulation: ViewEncapsulation.None, template: "<div class=\"mtx-clock-wrapper\">\n <div class=\"mtx-clock-center\"></div>\n <div class=\"mtx-clock-hand\" [ngStyle]=\"_hand\"></div>\n <div class=\"mtx-clock-hours\" [class.active]=\"_hourView\">\n <div *ngFor=\"let item of _hours\"\n class=\"mtx-clock-cell\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedHour === item.value\"\n [style.fontSize]=\"item.fontSize\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\">{{ item.displayValue }}</div>\n </div>\n <div [class.active]=\"!_hourView\" class=\"mtx-clock-minutes\">\n <div *ngFor=\"let item of _minutes\"\n class=\"mtx-clock-cell\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedMinute === item.value\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\">{{ item.displayValue }}</div>\n </div>\n</div>\n", styles: [".mtx-clock{position:relative;display:block;min-width:224px;margin:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%}.mtx-clock-hand{position:absolute;top:0;right:0;bottom:0;left:0;width:1px;margin:0 auto;transform-origin:bottom}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%}.mtx-clock-hours,.mtx-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.mtx-clock-hours.active,.mtx-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.mtx-clock-minutes{transform:scale(.8)}.mtx-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none}\n"] }]
680
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { dateFilter: [{
616
681
  type: Input
617
682
  }], interval: [{
618
683
  type: Input
@@ -636,6 +701,450 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
636
701
  type: Input
637
702
  }] } });
638
703
 
704
+ function pad(num, size) {
705
+ num = String(num);
706
+ while (num.length < size)
707
+ num = '0' + num;
708
+ return num;
709
+ }
710
+ class MtxTimeInput {
711
+ constructor(element, cdr) {
712
+ this.element = element;
713
+ this.cdr = cdr;
714
+ this._interval = 1;
715
+ this._min = 0;
716
+ this._max = Infinity;
717
+ this.timeValueChanged = new EventEmitter();
718
+ this.keyDownListener = this.keyDownHandler.bind(this);
719
+ this.keyPressListener = this.keyPressHandler.bind(this);
720
+ this.inputEventListener = this.inputChangedHandler.bind(this);
721
+ this.inputElement.addEventListener('keydown', this.keyDownListener, {
722
+ passive: true,
723
+ });
724
+ // Do not passive since we want to be able to preventDefault()
725
+ this.inputElement.addEventListener('keypress', this.keyPressListener);
726
+ this.inputElement.addEventListener('input', this.inputEventListener, {
727
+ passive: true,
728
+ });
729
+ }
730
+ set timeInterval(value) {
731
+ this._interval = coerceNumberProperty(value);
732
+ }
733
+ set timeMin(value) {
734
+ this._min = coerceNumberProperty(value);
735
+ }
736
+ set timeMax(value) {
737
+ this._max = coerceNumberProperty(value);
738
+ }
739
+ set timeValue(value) {
740
+ this._value = coerceNumberProperty(value);
741
+ if (!this.hasFocus) {
742
+ this.writeValue(this._value);
743
+ }
744
+ this.writePlaceholder(this._value);
745
+ }
746
+ get hasFocus() {
747
+ return this.element.nativeElement && this.element?.nativeElement === document?.activeElement;
748
+ }
749
+ get inputElement() {
750
+ return this.element.nativeElement;
751
+ }
752
+ // We look here at the placeholder value, because we write '' into the value on focus
753
+ // placeholder should always be up to date with "currentValue"
754
+ get valid() {
755
+ // At the start _value is undefined therefore this would result in not valid and
756
+ // make a ugly warning border afterwards we can safely check
757
+ if (this._value) {
758
+ const currentValue = String(this.inputElement.value);
759
+ // It can be that currentValue is empty due to we removing the value on focus,
760
+ // if that is the case we should check previous value which should be in the placeholder
761
+ if (currentValue.length) {
762
+ return this._value == this.inputElement.value;
763
+ }
764
+ else {
765
+ return this._value == this.inputElement.placeholder;
766
+ }
767
+ }
768
+ return true;
769
+ }
770
+ get invalid() {
771
+ return !this.valid;
772
+ }
773
+ blur() {
774
+ this.writeValue(this._value);
775
+ this.writePlaceholder(this._value);
776
+ this.timeValueChanged.emit(this._value);
777
+ }
778
+ focus() {
779
+ this.writeValue('');
780
+ }
781
+ /**
782
+ * Write value to inputElement
783
+ * @param value NumberInput
784
+ */
785
+ writeValue(value) {
786
+ if (value !== '') {
787
+ this.inputElement.value = pad(value, 2);
788
+ }
789
+ else {
790
+ this.inputElement.value = '';
791
+ }
792
+ this.cdr.markForCheck();
793
+ }
794
+ /**
795
+ * Writes value to placeholder
796
+ * @param value NumberInput
797
+ */
798
+ writePlaceholder(value) {
799
+ this.inputElement.placeholder = pad(value, 2);
800
+ this.cdr.markForCheck();
801
+ }
802
+ keyDownHandler(event) {
803
+ if (String(this.inputElement.value).length > 0) {
804
+ let value = null;
805
+ if (event.keyCode === UP_ARROW) {
806
+ value = coerceNumberProperty(this._value);
807
+ value += this._interval;
808
+ event.stopPropagation();
809
+ }
810
+ else if (event.keyCode === DOWN_ARROW) {
811
+ value = coerceNumberProperty(this._value);
812
+ value -= this._interval;
813
+ event.stopPropagation();
814
+ }
815
+ // if value has changed
816
+ if (typeof value === 'number') {
817
+ this.writeValue(value);
818
+ this.writePlaceholder(value);
819
+ this.clampInputValue();
820
+ this.timeValueChanged.emit(this._value);
821
+ }
822
+ }
823
+ }
824
+ /**
825
+ * Prevent non number inputs in the inputElement with the exception of Enter/BackSpace
826
+ * @param event KeyboardEvent
827
+ */
828
+ keyPressHandler(event) {
829
+ const key = event?.key ?? null;
830
+ if (isNaN(Number(key)) && key !== 'Enter') {
831
+ event.preventDefault();
832
+ }
833
+ }
834
+ inputChangedHandler() {
835
+ this.clampInputValue();
836
+ this.timeValueChanged.emit(this._value);
837
+ }
838
+ clampInputValue() {
839
+ if (this.inputElement?.value === '') {
840
+ return;
841
+ }
842
+ const value = coerceNumberProperty(this.inputElement?.value ?? null);
843
+ if (value) {
844
+ const clampedValue = Math.min(Math.max(value, this._min), this._max);
845
+ if (clampedValue !== value) {
846
+ this.writeValue(clampedValue);
847
+ this.writePlaceholder(clampedValue);
848
+ }
849
+ this._value = clampedValue;
850
+ }
851
+ }
852
+ /**
853
+ * Remove event listeners on destruction
854
+ */
855
+ ngOnDestroy() {
856
+ this.inputElement.removeEventListener('keydown', this.keyDownListener);
857
+ this.inputElement.removeEventListener('keypress', this.keyPressListener);
858
+ this.inputElement.removeEventListener('input', this.inputEventListener);
859
+ }
860
+ }
861
+ /** @nocollapse */ MtxTimeInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxTimeInput, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
862
+ /** @nocollapse */ MtxTimeInput.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: MtxTimeInput, selector: "input.mtx-time-input", inputs: { timeInterval: "timeInterval", timeMin: "timeMin", timeMax: "timeMax", timeValue: "timeValue" }, outputs: { timeValueChanged: "timeValueChanged" }, host: { listeners: { "blur": "blur($event)", "focus": "focus($event)" } }, exportAs: ["mtxTimeInput"], ngImport: i0 });
863
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxTimeInput, decorators: [{
864
+ type: Directive,
865
+ args: [{
866
+ selector: 'input.mtx-time-input',
867
+ host: {
868
+ '(blur)': 'blur($event)',
869
+ '(focus)': 'focus($event)',
870
+ },
871
+ exportAs: 'mtxTimeInput',
872
+ }]
873
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { timeInterval: [{
874
+ type: Input,
875
+ args: ['timeInterval']
876
+ }], timeMin: [{
877
+ type: Input,
878
+ args: ['timeMin']
879
+ }], timeMax: [{
880
+ type: Input,
881
+ args: ['timeMax']
882
+ }], timeValue: [{
883
+ type: Input,
884
+ args: ['timeValue']
885
+ }], timeValueChanged: [{
886
+ type: Output
887
+ }] } });
888
+ class MtxTime {
889
+ constructor(_adapter, _changeDetectorRef, _datetimepickerIntl) {
890
+ this._adapter = _adapter;
891
+ this._changeDetectorRef = _changeDetectorRef;
892
+ this._datetimepickerIntl = _datetimepickerIntl;
893
+ /** Emits when the currently selected date changes. */
894
+ this.selectedChange = new EventEmitter();
895
+ /** Emits when any date changes. */
896
+ this.activeDateChange = new EventEmitter();
897
+ /** Emits when any date is selected. */
898
+ this._userSelection = new EventEmitter();
899
+ /** Emits when AM/PM button are clicked. */
900
+ this.ampmChange = new EventEmitter();
901
+ /** Emits when AM/PM button are clicked. */
902
+ this.clockViewChange = new EventEmitter();
903
+ /** Step over minutes. */
904
+ this.interval = 1;
905
+ this._twelvehour = false;
906
+ /** Whether the time is now in AM or PM. */
907
+ this.AMPM = 'AM';
908
+ /** Whether the clock is in hour view. */
909
+ this._clockView = 'hour';
910
+ this.datetimepickerIntlChangesSubscription = this._datetimepickerIntl.changes.subscribe(() => {
911
+ this._changeDetectorRef.detectChanges();
912
+ });
913
+ }
914
+ /** Whether the clock uses 12 hour format. */
915
+ get twelvehour() {
916
+ return this._twelvehour;
917
+ }
918
+ set twelvehour(value) {
919
+ this._twelvehour = coerceBooleanProperty(value);
920
+ }
921
+ /**
922
+ * The date to display in this clock view.
923
+ */
924
+ get activeDate() {
925
+ return this._activeDate;
926
+ }
927
+ set activeDate(value) {
928
+ this._activeDate = this._adapter.clampDate(value, this.minDate, this.maxDate);
929
+ }
930
+ /** The currently selected date. */
931
+ get selected() {
932
+ return this._selected;
933
+ }
934
+ set selected(value) {
935
+ this._selected = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
936
+ if (this._selected) {
937
+ this.activeDate = this._selected;
938
+ }
939
+ }
940
+ /** The minimum selectable date. */
941
+ get minDate() {
942
+ return this._minDate;
943
+ }
944
+ set minDate(value) {
945
+ this._minDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
946
+ }
947
+ /** The maximum selectable date. */
948
+ get maxDate() {
949
+ return this._maxDate;
950
+ }
951
+ set maxDate(value) {
952
+ this._maxDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
953
+ }
954
+ /** Whether the clock should be started in hour or minute view. */
955
+ get clockView() {
956
+ return this._clockView;
957
+ }
958
+ set clockView(value) {
959
+ this._clockView = value;
960
+ }
961
+ get isHourView() {
962
+ return this._clockView === 'hour';
963
+ }
964
+ get isMinuteView() {
965
+ return this._clockView === 'hour';
966
+ }
967
+ get hour() {
968
+ if (!this.activeDate) {
969
+ if (this.twelvehour) {
970
+ return '12';
971
+ }
972
+ else {
973
+ return '00';
974
+ }
975
+ }
976
+ const hour = Number(this._adapter.getHour(this.activeDate));
977
+ if (!this.twelvehour) {
978
+ return this.prefixWithZero(hour);
979
+ }
980
+ if (hour === 0) {
981
+ return '12';
982
+ }
983
+ else {
984
+ return this.prefixWithZero(hour > 12 ? hour - 12 : hour);
985
+ }
986
+ }
987
+ get minute() {
988
+ if (this.activeDate) {
989
+ return this.prefixWithZero(this._adapter.getMinute(this.activeDate));
990
+ }
991
+ return '00';
992
+ }
993
+ prefixWithZero(value) {
994
+ if (value < 10) {
995
+ return '0' + String(value);
996
+ }
997
+ return String(value);
998
+ }
999
+ ngOnChanges(changes) {
1000
+ // when clockView changes by input we should focus the correct input
1001
+ if (changes.clockView) {
1002
+ if (changes.clockView.currentValue !== changes.clockView.previousValue) {
1003
+ this.focusInputElement();
1004
+ }
1005
+ }
1006
+ }
1007
+ ngAfterViewInit() {
1008
+ this.focusInputElement();
1009
+ }
1010
+ focusInputElement() {
1011
+ if (this.clockView === 'hour') {
1012
+ if (this.hourInputElement) {
1013
+ this.hourInputElement.nativeElement.focus();
1014
+ }
1015
+ }
1016
+ else {
1017
+ if (this.minuteInputElement) {
1018
+ this.minuteInputElement.nativeElement.focus();
1019
+ }
1020
+ }
1021
+ }
1022
+ handleHourInputChange(value) {
1023
+ const hour = coerceNumberProperty(value);
1024
+ if (hour || hour === 0) {
1025
+ const newValue = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), this.updateHourForAmPm(hour), this._adapter.getMinute(this.activeDate));
1026
+ this._activeDate = this._adapter.clampDate(newValue, this.minDate, this.maxDate);
1027
+ this.activeDateChange.emit(this.activeDate);
1028
+ // If previously we did set [mtxValue]="13" and the input changed to 6, and the clamping will make it "13" again
1029
+ // then the hourInputDirective will not have been updated since "13" === "13" same reference so no change detected
1030
+ // by directly setting it within this handler, we handle this usecase
1031
+ if (this.hourInputDirective) {
1032
+ this.hourInputDirective.timeValue = this.hour;
1033
+ }
1034
+ }
1035
+ }
1036
+ updateHourForAmPm(value) {
1037
+ if (!this.twelvehour) {
1038
+ return value;
1039
+ }
1040
+ // value should be between 1-12
1041
+ if (this.AMPM === 'AM') {
1042
+ if (value === 0 || value === 12) {
1043
+ return 0;
1044
+ }
1045
+ return value;
1046
+ }
1047
+ // PM
1048
+ else {
1049
+ if (value === 0 || value === 12) {
1050
+ return 12;
1051
+ }
1052
+ // other cases, we should add 12 to the value aka 3:00 PM = 3 + 12 = 15:00
1053
+ return value + 12;
1054
+ }
1055
+ }
1056
+ handleMinuteInputChange(value) {
1057
+ const minute = coerceNumberProperty(value);
1058
+ if (minute || minute === 0) {
1059
+ const newValue = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), this._adapter.getHour(this._activeDate), minute);
1060
+ this._activeDate = this._adapter.clampDate(newValue, this.minDate, this.maxDate);
1061
+ this.activeDateChange.emit(this.activeDate);
1062
+ // If previously we did set [mtxValue]="40" and the input changed to 30, and the clamping will make it "40" again
1063
+ // then the minuteInputDirective will not have been updated since "40" === "40" same reference so no change detected
1064
+ // by directly setting it within this handler, we handle this usecase
1065
+ if (this.minuteInputDirective) {
1066
+ this.minuteInputDirective.timeValue = this.minute;
1067
+ }
1068
+ }
1069
+ }
1070
+ handleFocus(clockView) {
1071
+ this.clockView = clockView;
1072
+ this.clockViewChange.emit(clockView);
1073
+ }
1074
+ _timeSelected(date) {
1075
+ if (this.clockView === 'hour') {
1076
+ this.clockView = 'minute';
1077
+ }
1078
+ this._activeDate = this.selected = date;
1079
+ }
1080
+ _onActiveDateChange(date) {
1081
+ this._activeDate = date;
1082
+ this.activeDateChange.emit(date);
1083
+ }
1084
+ handleOk() {
1085
+ if (this._selected) {
1086
+ this.selectedChange.emit(this._selected);
1087
+ }
1088
+ this._userSelection.emit();
1089
+ }
1090
+ handleCancel() {
1091
+ this._userSelection.emit();
1092
+ }
1093
+ ngOnDestroy() {
1094
+ if (this.datetimepickerIntlChangesSubscription) {
1095
+ this.datetimepickerIntlChangesSubscription.unsubscribe();
1096
+ }
1097
+ }
1098
+ }
1099
+ /** @nocollapse */ MtxTime.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxTime, deps: [{ token: i1.DatetimeAdapter }, { token: i0.ChangeDetectorRef }, { token: MtxDatetimepickerIntl }], target: i0.ɵɵFactoryTarget.Component });
1100
+ /** @nocollapse */ MtxTime.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxTime, selector: "mtx-time", inputs: { dateFilter: "dateFilter", interval: "interval", twelvehour: "twelvehour", AMPM: "AMPM", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", clockView: "clockView" }, outputs: { selectedChange: "selectedChange", activeDateChange: "activeDateChange", _userSelection: "_userSelection", ampmChange: "ampmChange", clockViewChange: "clockViewChange" }, host: { classAttribute: "mtx-time" }, viewQueries: [{ propertyName: "hourInputElement", first: true, predicate: ["hourInput"], descendants: true, read: (ElementRef) }, { propertyName: "hourInputDirective", first: true, predicate: ["hourInput"], descendants: true, read: MtxTimeInput }, { propertyName: "minuteInputElement", first: true, predicate: ["minuteInput"], descendants: true, read: (ElementRef) }, { propertyName: "minuteInputDirective", first: true, predicate: ["minuteInput"], descendants: true, read: MtxTimeInput }], exportAs: ["mtxTime"], usesOnChanges: true, ngImport: i0, template: "<div class=\"mtx-time-input-wrapper\">\n <div class=\"mtx-time-input-inner\">\n <input class=\"mtx-time-input\"\n [class.mtx-time-input-active]=\"clockView === 'hour'\"\n [class.mtx-time-input-warning]=\"!hourInput.valid\"\n #hourInput=\"mtxTimeInput\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n [timeMin]=\"twelvehour ? 1 : 0\"\n [timeMax]=\"twelvehour ? 12 : 23\"\n [timeValue]=\"hour\"\n (timeValueChanged)=\"handleHourInputChange($event)\"\n (focus)=\"handleFocus('hour')\" />\n\n <div class=\"mtx-time-seperator\">:</div>\n\n <input class=\"mtx-time-input\"\n [class.mtx-time-input-active]=\"clockView === 'minute'\"\n [class.mtx-time-input-warning]=\"!minuteInput.valid\"\n #minuteInput=\"mtxTimeInput\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n [timeMin]=\"0\"\n [timeMax]=\"59\"\n [timeValue]=\"minute\"\n (timeValueChanged)=\"handleMinuteInputChange($event)\"\n [timeInterval]=\"interval\"\n (focus)=\"handleFocus('minute')\" />\n\n <div *ngIf=\"twelvehour\" class=\"mtx-time-ampm\">\n <button mat-button type=\"button\" class=\"mtx-time-am\"\n [class.mtx-time-ampm-active]=\"AMPM === 'AM'\" aria-label=\"AM\"\n (keydown)=\"$event.stopPropagation()\"\n (click)=\"ampmChange.emit('AM')\">AM</button>\n <button mat-button type=\"button\" class=\"mtx-time-pm\"\n [class.mtx-time-ampm-active]=\"AMPM === 'PM'\" aria-label=\"PM\"\n (keydown)=\"$event.stopPropagation()\"\n (click)=\"ampmChange.emit('PM')\">PM</button>\n </div>\n </div>\n</div>\n\n<mtx-clock (selectedChange)=\"_timeSelected($event)\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"interval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected\"\n [startView]=\"clockView\"\n [twelvehour]=\"twelvehour\">\n</mtx-clock>\n\n<div class=\"mtx-time-button-wrapper\">\n <button class=\"mtx-time-cancel-button\" mat-button type=\"button\" (click)=\"handleCancel()\">\n {{ _datetimepickerIntl.cancelLabel }}\n </button>\n <button class=\"mtx-time-ok-button\" mat-button type=\"button\" (click)=\"handleOk()\"\n [disabled]=\"minuteInputDirective?.invalid || hourInputDirective?.invalid\">\n {{ _datetimepickerIntl.okLabel }}\n </button>\n</div>\n", styles: [".mtx-time{display:block;outline:none;-webkit-user-select:none;user-select:none}.mtx-time-input-wrapper{padding:8px 0;text-align:center}.mtx-time-input-inner{display:inline-flex;height:56px}.mtx-time-input{width:72px;font-size:36px;text-align:center;border-radius:8px;border:2px solid transparent;-webkit-appearance:none;appearance:none;outline:none}.mtx-time-seperator{display:inline-flex;justify-content:center;align-items:center;width:24px;font-size:36px}.mtx-time-ampm{display:inline-flex;flex-direction:column;margin-left:12px}[dir=rtl] .mtx-time-ampm{margin-left:auto;margin-right:12px}.mtx-time-am.mat-button,.mtx-time-pm.mat-button{flex:1;width:40px;min-width:auto;padding:0;line-height:normal;border-width:1px;border-style:solid}.mtx-time-am.mat-button{border-radius:8px 8px 0 0}.mtx-time-pm.mat-button{border-radius:0 0 8px 8px;border-top:none}.mtx-time-button-wrapper{display:flex;justify-content:flex-end;padding-top:8px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: MtxClock, selector: "mtx-clock", inputs: ["dateFilter", "interval", "twelvehour", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["selectedChange", "activeDateChange", "_userSelection"], exportAs: ["mtxClock"] }, { kind: "directive", type: MtxTimeInput, selector: "input.mtx-time-input", inputs: ["timeInterval", "timeMin", "timeMax", "timeValue"], outputs: ["timeValueChanged"], exportAs: ["mtxTimeInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxTime, decorators: [{
1102
+ type: Component,
1103
+ args: [{ selector: 'mtx-time', exportAs: 'mtxTime', host: {
1104
+ class: 'mtx-time',
1105
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mtx-time-input-wrapper\">\n <div class=\"mtx-time-input-inner\">\n <input class=\"mtx-time-input\"\n [class.mtx-time-input-active]=\"clockView === 'hour'\"\n [class.mtx-time-input-warning]=\"!hourInput.valid\"\n #hourInput=\"mtxTimeInput\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n [timeMin]=\"twelvehour ? 1 : 0\"\n [timeMax]=\"twelvehour ? 12 : 23\"\n [timeValue]=\"hour\"\n (timeValueChanged)=\"handleHourInputChange($event)\"\n (focus)=\"handleFocus('hour')\" />\n\n <div class=\"mtx-time-seperator\">:</div>\n\n <input class=\"mtx-time-input\"\n [class.mtx-time-input-active]=\"clockView === 'minute'\"\n [class.mtx-time-input-warning]=\"!minuteInput.valid\"\n #minuteInput=\"mtxTimeInput\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n [timeMin]=\"0\"\n [timeMax]=\"59\"\n [timeValue]=\"minute\"\n (timeValueChanged)=\"handleMinuteInputChange($event)\"\n [timeInterval]=\"interval\"\n (focus)=\"handleFocus('minute')\" />\n\n <div *ngIf=\"twelvehour\" class=\"mtx-time-ampm\">\n <button mat-button type=\"button\" class=\"mtx-time-am\"\n [class.mtx-time-ampm-active]=\"AMPM === 'AM'\" aria-label=\"AM\"\n (keydown)=\"$event.stopPropagation()\"\n (click)=\"ampmChange.emit('AM')\">AM</button>\n <button mat-button type=\"button\" class=\"mtx-time-pm\"\n [class.mtx-time-ampm-active]=\"AMPM === 'PM'\" aria-label=\"PM\"\n (keydown)=\"$event.stopPropagation()\"\n (click)=\"ampmChange.emit('PM')\">PM</button>\n </div>\n </div>\n</div>\n\n<mtx-clock (selectedChange)=\"_timeSelected($event)\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"interval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected\"\n [startView]=\"clockView\"\n [twelvehour]=\"twelvehour\">\n</mtx-clock>\n\n<div class=\"mtx-time-button-wrapper\">\n <button class=\"mtx-time-cancel-button\" mat-button type=\"button\" (click)=\"handleCancel()\">\n {{ _datetimepickerIntl.cancelLabel }}\n </button>\n <button class=\"mtx-time-ok-button\" mat-button type=\"button\" (click)=\"handleOk()\"\n [disabled]=\"minuteInputDirective?.invalid || hourInputDirective?.invalid\">\n {{ _datetimepickerIntl.okLabel }}\n </button>\n</div>\n", styles: [".mtx-time{display:block;outline:none;-webkit-user-select:none;user-select:none}.mtx-time-input-wrapper{padding:8px 0;text-align:center}.mtx-time-input-inner{display:inline-flex;height:56px}.mtx-time-input{width:72px;font-size:36px;text-align:center;border-radius:8px;border:2px solid transparent;-webkit-appearance:none;appearance:none;outline:none}.mtx-time-seperator{display:inline-flex;justify-content:center;align-items:center;width:24px;font-size:36px}.mtx-time-ampm{display:inline-flex;flex-direction:column;margin-left:12px}[dir=rtl] .mtx-time-ampm{margin-left:auto;margin-right:12px}.mtx-time-am.mat-button,.mtx-time-pm.mat-button{flex:1;width:40px;min-width:auto;padding:0;line-height:normal;border-width:1px;border-style:solid}.mtx-time-am.mat-button{border-radius:8px 8px 0 0}.mtx-time-pm.mat-button{border-radius:0 0 8px 8px;border-top:none}.mtx-time-button-wrapper{display:flex;justify-content:flex-end;padding-top:8px}\n"] }]
1106
+ }], ctorParameters: function () { return [{ type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }, { type: MtxDatetimepickerIntl }]; }, propDecorators: { selectedChange: [{
1107
+ type: Output
1108
+ }], activeDateChange: [{
1109
+ type: Output
1110
+ }], _userSelection: [{
1111
+ type: Output
1112
+ }], ampmChange: [{
1113
+ type: Output
1114
+ }], clockViewChange: [{
1115
+ type: Output
1116
+ }], dateFilter: [{
1117
+ type: Input
1118
+ }], interval: [{
1119
+ type: Input
1120
+ }], hourInputElement: [{
1121
+ type: ViewChild,
1122
+ args: ['hourInput', { read: (ElementRef) }]
1123
+ }], hourInputDirective: [{
1124
+ type: ViewChild,
1125
+ args: ['hourInput', { read: MtxTimeInput }]
1126
+ }], minuteInputElement: [{
1127
+ type: ViewChild,
1128
+ args: ['minuteInput', { read: (ElementRef) }]
1129
+ }], minuteInputDirective: [{
1130
+ type: ViewChild,
1131
+ args: ['minuteInput', { read: MtxTimeInput }]
1132
+ }], twelvehour: [{
1133
+ type: Input
1134
+ }], AMPM: [{
1135
+ type: Input
1136
+ }], activeDate: [{
1137
+ type: Input
1138
+ }], selected: [{
1139
+ type: Input
1140
+ }], minDate: [{
1141
+ type: Input
1142
+ }], maxDate: [{
1143
+ type: Input
1144
+ }], clockView: [{
1145
+ type: Input
1146
+ }] } });
1147
+
639
1148
  const DAYS_PER_WEEK = 7;
640
1149
  /**
641
1150
  * An internal component used to display a single month in the datetimepicker.
@@ -910,7 +1419,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
910
1419
  * @docs-private
911
1420
  */
912
1421
  class MtxCalendar {
913
- constructor(_elementRef, _intl, _ngZone, _adapter, _dateFormats, changeDetectorRef) {
1422
+ constructor(_elementRef, _intl, _ngZone, _adapter, _dateFormats, _changeDetectorRef) {
914
1423
  this._elementRef = _elementRef;
915
1424
  this._intl = _intl;
916
1425
  this._ngZone = _ngZone;
@@ -931,6 +1440,7 @@ class MtxCalendar {
931
1440
  this._userSelection = new EventEmitter();
932
1441
  this._clockView = 'hour';
933
1442
  this._type = 'date';
1443
+ this._timeInput = false;
934
1444
  /** Date filter for the month and year views. */
935
1445
  this._dateFilterForViews = (date) => {
936
1446
  return (!!date &&
@@ -944,7 +1454,7 @@ class MtxCalendar {
944
1454
  if (!this._dateFormats) {
945
1455
  throw createMissingDateImplError('MTX_DATETIME_FORMATS');
946
1456
  }
947
- this._intlChanges = _intl.changes.subscribe(() => changeDetectorRef.markForCheck());
1457
+ this._intlChanges = _intl.changes.subscribe(() => _changeDetectorRef.markForCheck());
948
1458
  }
949
1459
  /** Whether to show multi-year view. */
950
1460
  get multiYearSelector() {
@@ -977,6 +1487,17 @@ class MtxCalendar {
977
1487
  set startAt(value) {
978
1488
  this._startAt = this._adapter.getValidDateOrNull(value);
979
1489
  }
1490
+ /**
1491
+ * Whether the calendar is in time mode. In time mode the calendar clock gets time input elements rather then just clock
1492
+ *
1493
+ * When touchUi is enabled this will be disabled
1494
+ */
1495
+ get timeInput() {
1496
+ return this._timeInput;
1497
+ }
1498
+ set timeInput(value) {
1499
+ this._timeInput = coerceBooleanProperty(value);
1500
+ }
980
1501
  /** The currently selected date. */
981
1502
  get selected() {
982
1503
  return this._selected;
@@ -1028,11 +1549,7 @@ class MtxCalendar {
1028
1549
  this._currentView = view;
1029
1550
  this.viewChanged.emit(view);
1030
1551
  }
1031
- /** The label for the current calendar view. */
1032
- get _yearLabel() {
1033
- return this._adapter.getYearName(this._activeDate);
1034
- }
1035
- get _monthYearLabel() {
1552
+ get _yearPeriodText() {
1036
1553
  if (this.currentView === 'multi-year') {
1037
1554
  // The offset from the active year to the "slot" for the starting year is the
1038
1555
  // *actual* first rendered year in the multi-year view, and the last year is
@@ -1048,7 +1565,15 @@ class MtxCalendar {
1048
1565
  ? this._adapter.getMonthNames('long')[this._adapter.getMonth(this._activeDate)]
1049
1566
  : this._adapter.getYearName(this._activeDate);
1050
1567
  }
1051
- get _dateLabel() {
1568
+ get _yearButtonText() {
1569
+ return this._adapter.getYearName(this._activeDate);
1570
+ }
1571
+ get _yearButtonLabel() {
1572
+ return this.multiYearSelector
1573
+ ? this._intl.switchToMultiYearViewLabel
1574
+ : this._intl.switchToYearViewLabel;
1575
+ }
1576
+ get _dateButtonText() {
1052
1577
  switch (this.type) {
1053
1578
  case 'month':
1054
1579
  return this._adapter.getMonthNames('long')[this._adapter.getMonth(this._activeDate)];
@@ -1056,7 +1581,10 @@ class MtxCalendar {
1056
1581
  return this._adapter.format(this._activeDate, this._dateFormats.display.popupHeaderDateLabel);
1057
1582
  }
1058
1583
  }
1059
- get _hoursLabel() {
1584
+ get _dateButtonLabel() {
1585
+ return this._intl.switchToMonthViewLabel;
1586
+ }
1587
+ get _hoursButtonText() {
1060
1588
  let hour = this._adapter.getHour(this._activeDate);
1061
1589
  if (this.twelvehour) {
1062
1590
  if (hour === 0) {
@@ -1066,29 +1594,35 @@ class MtxCalendar {
1066
1594
  }
1067
1595
  return this._2digit(hour);
1068
1596
  }
1069
- get _minutesLabel() {
1597
+ get _hourButtonLabel() {
1598
+ return this._intl.switchToClockHourViewLabel;
1599
+ }
1600
+ get _minutesButtonText() {
1070
1601
  return this._2digit(this._adapter.getMinute(this._activeDate));
1071
1602
  }
1072
- get _ariaLabelNext() {
1603
+ get _minuteButtonLabel() {
1604
+ return this._intl.switchToClockMinuteViewLabel;
1605
+ }
1606
+ get _prevButtonLabel() {
1073
1607
  switch (this._currentView) {
1074
1608
  case 'month':
1075
- return this._intl.nextMonthLabel;
1609
+ return this._intl.prevMonthLabel;
1076
1610
  case 'year':
1077
- return this._intl.nextYearLabel;
1611
+ return this._intl.prevYearLabel;
1078
1612
  case 'multi-year':
1079
- return this._intl.nextMultiYearLabel;
1613
+ return this._intl.prevMultiYearLabel;
1080
1614
  default:
1081
1615
  return '';
1082
1616
  }
1083
1617
  }
1084
- get _ariaLabelPrev() {
1618
+ get _nextButtonLabel() {
1085
1619
  switch (this._currentView) {
1086
1620
  case 'month':
1087
- return this._intl.prevMonthLabel;
1621
+ return this._intl.nextMonthLabel;
1088
1622
  case 'year':
1089
- return this._intl.prevYearLabel;
1623
+ return this._intl.nextYearLabel;
1090
1624
  case 'multi-year':
1091
- return this._intl.prevMultiYearLabel;
1625
+ return this._intl.nextMultiYearLabel;
1092
1626
  default:
1093
1627
  return '';
1094
1628
  }
@@ -1155,6 +1689,12 @@ class MtxCalendar {
1155
1689
  }
1156
1690
  }
1157
1691
  _timeSelected(date) {
1692
+ this._activeDate = this._updateDate(date);
1693
+ if (!this._adapter.sameDatetime(date, this.selected) || !this.preventSameDateTimeSelection) {
1694
+ this.selectedChange.emit(date);
1695
+ }
1696
+ }
1697
+ _dialTimeSelected(date) {
1158
1698
  if (this._clockView !== 'minute') {
1159
1699
  this._activeDate = this._updateDate(date);
1160
1700
  this._clockView = 'minute';
@@ -1183,7 +1723,8 @@ class MtxCalendar {
1183
1723
  return date;
1184
1724
  }
1185
1725
  _selectAMPM(date) {
1186
- if (this._adapter.getHour(date) > 11) {
1726
+ const hour = this._adapter.getHour(date);
1727
+ if (hour > 11) {
1187
1728
  this._AMPM = 'PM';
1188
1729
  }
1189
1730
  else {
@@ -1191,16 +1732,22 @@ class MtxCalendar {
1191
1732
  }
1192
1733
  }
1193
1734
  _ampmClicked(source) {
1735
+ this._currentView = 'clock';
1194
1736
  if (source === this._AMPM) {
1195
1737
  return;
1196
1738
  }
1197
1739
  this._AMPM = source;
1740
+ // if AMPM changed from PM to AM substract 12 hours
1741
+ const currentHour = this._adapter.getHour(this._activeDate);
1742
+ let newHourValue;
1198
1743
  if (this._AMPM === 'AM') {
1199
- this._activeDate = this._adapter.addCalendarHours(this._activeDate, -12);
1744
+ newHourValue = currentHour >= 12 ? this._adapter.getHour(this._activeDate) - 12 : 12;
1200
1745
  }
1746
+ // otherwise add 12 hours
1201
1747
  else {
1202
- this._activeDate = this._adapter.addCalendarHours(this._activeDate, 12);
1748
+ newHourValue = (currentHour + 12) % 24;
1203
1749
  }
1750
+ this._activeDate = this._adapter.createDatetime(this._adapter.getYear(this._activeDate), this._adapter.getMonth(this._activeDate), this._adapter.getDate(this._activeDate), newHourValue, this._adapter.getMinute(this._activeDate));
1204
1751
  }
1205
1752
  _yearClicked() {
1206
1753
  if (this.type === 'year' || this.multiYearSelector) {
@@ -1417,16 +1964,22 @@ class MtxCalendar {
1417
1964
  this._activeDate =
1418
1965
  this._clockView === 'hour'
1419
1966
  ? this._adapter.addCalendarHours(this._activeDate, 1)
1420
- : this._adapter.addCalendarMinutes(this._activeDate, 1);
1967
+ : this._adapter.addCalendarMinutes(this._activeDate, this.timeInterval);
1968
+ // if the hours changed the am/pm we should update the AM/PM
1969
+ this._selectAMPM(this._activeDate);
1421
1970
  break;
1422
1971
  case DOWN_ARROW:
1423
1972
  this._activeDate =
1424
1973
  this._clockView === 'hour'
1425
1974
  ? this._adapter.addCalendarHours(this._activeDate, -1)
1426
- : this._adapter.addCalendarMinutes(this._activeDate, -1);
1975
+ : this._adapter.addCalendarMinutes(this._activeDate, -this.timeInterval);
1976
+ // if the hours changed the am/pm we should update the AM/PM
1977
+ this._selectAMPM(this._activeDate);
1427
1978
  break;
1428
1979
  case ENTER:
1429
- this._timeSelected(this._activeDate);
1980
+ if (!this.timeInput) {
1981
+ this._dialTimeSelected(this._activeDate);
1982
+ }
1430
1983
  return;
1431
1984
  default:
1432
1985
  // Don't prevent default or focus active cell on keys that we don't explicitly handle.
@@ -1462,16 +2015,17 @@ class MtxCalendar {
1462
2015
  return ('00' + n).slice(-2);
1463
2016
  }
1464
2017
  }
1465
- /** @nocollapse */ MtxCalendar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxCalendar, deps: [{ token: i0.ElementRef }, { token: i1$1.MatDatepickerIntl }, { token: i0.NgZone }, { token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1466
- /** @nocollapse */ MtxCalendar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxCalendar, selector: "mtx-calendar", inputs: { multiYearSelector: "multiYearSelector", twelvehour: "twelvehour", startView: "startView", timeInterval: "timeInterval", dateFilter: "dateFilter", preventSameDateTimeSelection: "preventSameDateTimeSelection", type: "type", startAt: "startAt", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", viewChanged: "viewChanged", _userSelection: "_userSelection" }, host: { attributes: { "tabindex": "0" }, listeners: { "keydown": "_handleCalendarBodyKeydown($event)" }, classAttribute: "mtx-calendar" }, exportAs: ["mtxCalendar"], ngImport: i0, template: "<div class=\"mtx-calendar-header\">\n <div (click)=\"_yearClicked()\" *ngIf=\"type !== 'time'\"\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-calendar-header-year\" role=\"button\">\n <span>{{ _yearLabel }}</span>\n <svg *ngIf=\"multiYearSelector || type === 'year'\"\n class=\"mtx-calendar-header-year-dropdown\"\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\n </svg>\n </div>\n <div class=\"mtx-calendar-header-date-time\">\n <span (click)=\"_dateClicked()\" *ngIf=\"type !== 'time' && type !== 'year'\"\n [class.active]=\"currentView === 'month'\"\n [class.not-clickable]=\"type === 'month'\"\n class=\"mtx-calendar-header-date\"\n role=\"button\">{{ _dateLabel }}</span>\n <span *ngIf=\"type.endsWith('time')\"\n [class.active]=\"currentView === 'clock'\"\n class=\"mtx-calendar-header-time\">\n <span class=\"mtx-calendar-header-hour-minute-container\">\n <span (click)=\"_hoursClicked()\"\n [class.active]=\"_clockView === 'hour'\"\n class=\"mtx-calendar-header-hours\"\n role=\"button\">{{ _hoursLabel }}</span>\n <span class=\"mtx-calendar-header-hour-minute-separator\">:</span>\n <span (click)=\"_minutesClicked()\"\n [class.active]=\"_clockView === 'minute'\"\n class=\"mtx-calendar-header-minutes\"\n role=\"button\">{{ _minutesLabel }}</span>\n </span>\n <span *ngIf=\"twelvehour\" class=\"mtx-calendar-header-ampm-container\">\n <span (click)=\"_ampmClicked('AM')\"\n [class.active]=\"_AMPM === 'AM'\"\n class=\"mtx-calendar-header-ampm\" role=\"button\">AM</span>\n <span (click)=\"_ampmClicked('PM')\"\n [class.active]=\"_AMPM === 'PM'\"\n class=\"mtx-calendar-header-ampm\" role=\"button\">PM</span>\n </span>\n </span>\n </div>\n</div>\n<div class=\"mtx-calendar-content\" [ngSwitch]=\"currentView\">\n <div *ngIf=\"currentView === 'month' || currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-month-content\">\n <div class=\"mtx-calendar-controls\">\n <button mat-icon-button type=\"button\" (click)=\"_previousClicked()\"\n [attr.aria-disabled]=\"!_previousEnabled()\"\n [attr.aria-label]=\"_ariaLabelPrev\"\n [class.disabled]=\"!_previousEnabled()\"\n class=\"mtx-calendar-previous-button\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\n </svg>\n </button>\n <div [@slideCalendar]=\"_calendarState\"\n (@slideCalendar.done)=\"_calendarStateDone()\"\n class=\"mtx-calendar-period-button\">\n <strong>{{ _monthYearLabel }}</strong>\n </div>\n <button mat-icon-button type=\"button\" (click)=\"_nextClicked()\"\n [attr.aria-disabled]=\"!_nextEnabled()\"\n [attr.aria-label]=\"_ariaLabelNext\"\n [class.disabled]=\"!_nextEnabled()\"\n class=\"mtx-calendar-next-button\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"></path>\n </svg>\n </button>\n </div>\n </div>\n <mtx-month-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n *ngSwitchCase=\"'month'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n <mtx-year-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n *ngSwitchCase=\"'year'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n <mtx-multi-year-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_yearSelected($event)\"\n *ngSwitchCase=\"'multi-year'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-multi-year-view>\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_timeSelected($event)\"\n *ngSwitchDefault\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\"\n [startView]=\"_clockView\"\n [twelvehour]=\"twelvehour\">\n </mtx-clock>\n</div>\n", styles: [".mtx-calendar{display:block;outline:none}.mtx-calendar[mode=landscape]{display:flex}.mtx-calendar-header{padding:16px;box-sizing:border-box;border-radius:4px 4px 0 0}[mode=landscape] .mtx-calendar-header{width:150px;min-width:150px;border-radius:4px 0 0 4px}[dir=rtl] [mode=landscape] .mtx-calendar-header{border-radius:0 4px 4px 0}.mtx-calendar-header-year,.mtx-calendar-header-date-time{width:100%;white-space:nowrap}.mtx-calendar-header-year{line-height:24px}.mtx-calendar-header-year>*{vertical-align:middle}.mtx-calendar-header-year+.mtx-calendar-header-date-time{margin-top:4px}.mtx-calendar-header-date-time{line-height:36px}[mode=landscape] .mtx-calendar-header-date-time{white-space:normal;word-wrap:break-word}.mtx-calendar-header-year:not(.active),.mtx-calendar-header-date:not(.active),.mtx-calendar-header-hours:not(.active),.mtx-calendar-header-minutes:not(.active),.mtx-calendar-header-ampm:not(.active){cursor:pointer;opacity:.6}.mtx-calendar-header-year.not-clickable,.mtx-calendar-header-date.not-clickable,.mtx-calendar-header-hours.not-clickable,.mtx-calendar-header-minutes.not-clickable,.mtx-calendar-header-ampm.not-clickable{cursor:initial}.mtx-calendar-header-time{display:inline-flex}.mtx-calendar-header-time:not(.active){opacity:.6}.mtx-calendar-header-time:not(.active) .mtx-calendar-header-hours,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-minutes,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-ampm{cursor:pointer;opacity:1}[mode=landscape] .mtx-calendar-header-time{display:flex;flex-direction:column}.mtx-calendar-header-hour-minute-container{padding:0 8px}[mode=landscape] .mtx-calendar-header-hour-minute-container{padding:0}.mtx-calendar-header-hour-minute-separator{display:inline-block;width:8px;text-align:center}.mtx-calendar-header-ampm-container{display:inline-flex;flex-direction:column;line-height:18px}[mode=landscape] .mtx-calendar-header-ampm-container{flex-direction:row}[mode=landscape] .mtx-calendar-header-ampm{padding:4px}.mtx-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.mtx-calendar-controls{display:flex;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.mtx-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mtx-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:transparent;box-sizing:border-box}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0}@media all and (orientation: landscape){.mtx-calendar[mode=auto]{display:flex}.mtx-calendar[mode=auto] .mtx-calendar-header{width:150px;min-width:150px;border-radius:4px 0 0 4px}[dir=rtl] .mtx-calendar[mode=auto] .mtx-calendar-header{border-radius:0 4px 4px 0}.mtx-calendar[mode=auto] .mtx-calendar-header-date-time{white-space:normal;word-wrap:break-word}.mtx-calendar[mode=auto] .mtx-calendar-header-time{display:flex;flex-direction:column}.mtx-calendar[mode=auto] .mtx-calendar-header-hour-minute-container{padding:0}.mtx-calendar[mode=auto] .mtx-calendar-header-ampm-container{flex-direction:row}.mtx-calendar[mode=auto] .mtx-calendar-header-ampm{padding:4px}}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: MtxClock, selector: "mtx-clock", inputs: ["dateFilter", "interval", "twelvehour", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["selectedChange", "activeDateChange", "_userSelection"], exportAs: ["mtxClock"] }, { kind: "component", type: MtxMonthView, selector: "mtx-month-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxMonthView"] }, { kind: "component", type: MtxYearView, selector: "mtx-year-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxYearView"] }, { kind: "component", type: MtxMultiYearView, selector: "mtx-multi-year-view", inputs: ["type", "dateFilter", "activeDate", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxMultiYearView"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2018
+ /** @nocollapse */ MtxCalendar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxCalendar, deps: [{ token: i0.ElementRef }, { token: MtxDatetimepickerIntl }, { token: i0.NgZone }, { token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2019
+ /** @nocollapse */ MtxCalendar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxCalendar, selector: "mtx-calendar", inputs: { multiYearSelector: "multiYearSelector", twelvehour: "twelvehour", startView: "startView", timeInterval: "timeInterval", dateFilter: "dateFilter", preventSameDateTimeSelection: "preventSameDateTimeSelection", type: "type", startAt: "startAt", timeInput: "timeInput", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", viewChanged: "viewChanged", _userSelection: "_userSelection" }, host: { attributes: { "tabindex": "0" }, listeners: { "keydown": "_handleCalendarBodyKeydown($event)" }, properties: { "class.mtx-calendar-with-time-input": "timeInput" }, classAttribute: "mtx-calendar" }, exportAs: ["mtxCalendar"], ngImport: i0, template: "<div class=\"mtx-calendar-header\">\n <button *ngIf=\"type !== 'time'\"\n mat-button type=\"button\" class=\"mtx-calendar-header-year\"\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\"\n [attr.aria-label]=\"_yearButtonLabel\"\n (click)=\"_yearClicked()\">\n <span>{{ _yearButtonText }}</span>\n <svg *ngIf=\"multiYearSelector || type === 'year'\"\n class=\"mtx-calendar-header-year-dropdown\"\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\n </svg>\n </button>\n <div *ngIf=\"type !== 'year'\" class=\"mtx-calendar-header-date-time\">\n <button *ngIf=\"type !== 'time'\"\n mat-button type=\"button\" class=\"mtx-calendar-header-date\"\n [class.active]=\"currentView === 'month'\"\n [class.not-clickable]=\"type === 'month'\"\n [attr.aria-label]=\"_dateButtonLabel\"\n (click)=\"_dateClicked()\">{{ _dateButtonText }}</button>\n <span *ngIf=\"type.endsWith('time')\" class=\"mtx-calendar-header-time\"\n [class.active]=\"currentView === 'clock'\">\n <span class=\"mtx-calendar-header-hour-minute-container\">\n <button mat-button type=\"button\" class=\"mtx-calendar-header-hours\"\n [class.active]=\"_clockView === 'hour'\"\n [attr.aria-label]=\"_hourButtonLabel\"\n (click)=\"_hoursClicked()\">{{ _hoursButtonText }}</button>\n <span class=\"mtx-calendar-header-hour-minute-separator\">:</span>\n <button mat-button type=\"button\" class=\"mtx-calendar-header-minutes\"\n [class.active]=\"_clockView === 'minute'\"\n [attr.aria-label]=\"_minuteButtonLabel\"\n (click)=\"_minutesClicked()\">{{ _minutesButtonText }}</button>\n </span>\n <span *ngIf=\"twelvehour\" class=\"mtx-calendar-header-ampm-container\">\n <button mat-button type=\"button\" class=\"mtx-calendar-header-ampm\"\n [class.active]=\"_AMPM === 'AM'\" aria-label=\"AM\"\n (click)=\"_ampmClicked('AM')\">AM</button>\n <button mat-button type=\"button\" class=\"mtx-calendar-header-ampm\"\n [class.active]=\"_AMPM === 'PM'\" aria-label=\"PM\"\n (click)=\"_ampmClicked('PM')\">PM</button>\n </span>\n </span>\n </div>\n</div>\n\n<div class=\"mtx-calendar-content\" [ngSwitch]=\"currentView\">\n <div *ngIf=\"currentView === 'month' || currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-month-content\">\n <div class=\"mtx-calendar-controls\">\n <button mat-icon-button type=\"button\"\n class=\"mtx-calendar-previous-button\"\n [class.disabled]=\"!_previousEnabled()\"\n [attr.aria-disabled]=\"!_previousEnabled()\"\n [attr.aria-label]=\"_prevButtonLabel\"\n (click)=\"_previousClicked()\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\n </svg>\n </button>\n <div class=\"mtx-calendar-period-button\"\n [@slideCalendar]=\"_calendarState\"\n (@slideCalendar.done)=\"_calendarStateDone()\">\n <strong>{{ _yearPeriodText }}</strong>\n </div>\n <button mat-icon-button type=\"button\"\n class=\"mtx-calendar-next-button\"\n [class.disabled]=\"!_nextEnabled()\"\n [attr.aria-disabled]=\"!_nextEnabled()\"\n [attr.aria-label]=\"_nextButtonLabel\"\n (click)=\"_nextClicked()\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"></path>\n </svg>\n </button>\n </div>\n </div>\n <mtx-month-view *ngSwitchCase=\"'month'\"\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n <mtx-year-view *ngSwitchCase=\"'year'\"\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n <mtx-multi-year-view *ngSwitchCase=\"'multi-year'\"\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_yearSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-multi-year-view>\n\n <ng-container *ngSwitchDefault>\n <mtx-time *ngIf=\"timeInput; else clock\"\n (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_timeSelected($event)\"\n [AMPM]=\"_AMPM\"\n (ampmChange)=\"_ampmClicked($event)\"\n [clockView]=\"_clockView\"\n (clockViewChange)=\"_clockView = $event\"\n [twelvehour]=\"twelvehour\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\">\n </mtx-time>\n\n <ng-template #clock>\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_dialTimeSelected($event)\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\"\n [startView]=\"_clockView\"\n [twelvehour]=\"twelvehour\">\n </mtx-clock>\n </ng-template>\n </ng-container>\n</div>\n", styles: [".mtx-calendar{display:block;outline:none}.mtx-calendar-header{box-sizing:border-box;padding:8px;border-radius:4px 4px 0 0}.mtx-calendar-header .mat-button{min-width:auto;padding:0 4px;text-align:inherit;line-height:inherit;font-size:inherit;font-weight:inherit;white-space:normal;word-break:break-word}.mtx-calendar-header-year.mat-button{line-height:24px}.mtx-calendar-header-date-time{font-size:24px;line-height:36px}.mtx-calendar-header-year:not(.active),.mtx-calendar-header-date:not(.active),.mtx-calendar-header-hours:not(.active),.mtx-calendar-header-minutes:not(.active),.mtx-calendar-header-ampm:not(.active){opacity:.6}.mtx-calendar-header-year.not-clickable,.mtx-calendar-header-date.not-clickable,.mtx-calendar-header-hours.not-clickable,.mtx-calendar-header-minutes.not-clickable,.mtx-calendar-header-ampm.not-clickable{cursor:initial}.mtx-calendar-header-time{display:inline-flex}.mtx-calendar-header-time:not(.active){opacity:.6}.mtx-calendar-header-time:not(.active) .mtx-calendar-header-hours,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-minutes,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-ampm{opacity:1}.mtx-calendar-header-hour-minute-separator{display:inline-block;width:8px;text-align:center}.mtx-calendar-header-ampm-container{display:inline-flex;flex-direction:column;line-height:18px;font-size:12px}[mode=landscape] .mtx-calendar{display:flex}[mode=landscape] .mtx-calendar .mtx-calendar-header{width:150px;min-width:150px;padding:16px 8px;border-radius:4px 0 0 4px}[dir=rtl] [mode=landscape] .mtx-calendar .mtx-calendar-header{border-radius:0 4px 4px 0}[mode=landscape] .mtx-calendar .mtx-calendar-header-year+.mtx-calendar-header-date-time,[mode=landscape] .mtx-calendar .mtx-calendar-header-date+.mtx-calendar-header-time{margin-top:4px}[mode=landscape] .mtx-calendar .mtx-calendar-header-date-time{font-size:28px}[mode=landscape] .mtx-calendar .mtx-calendar-header-time{display:flex;flex-direction:column}[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mat-button{width:40px;text-align:center}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm-container{flex-direction:row;font-size:20px}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm{padding:4px}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm+.mtx-calendar-header-ampm{margin:0 8px}@media all and (orientation: landscape){[mode=auto] .mtx-calendar{display:flex}[mode=auto] .mtx-calendar .mtx-calendar-header{width:150px;min-width:150px;padding:16px 8px;border-radius:4px 0 0 4px}[dir=rtl] [mode=auto] .mtx-calendar .mtx-calendar-header{border-radius:0 4px 4px 0}[mode=auto] .mtx-calendar .mtx-calendar-header-year+.mtx-calendar-header-date-time,[mode=auto] .mtx-calendar .mtx-calendar-header-date+.mtx-calendar-header-time{margin-top:4px}[mode=auto] .mtx-calendar .mtx-calendar-header-date-time{font-size:28px}[mode=auto] .mtx-calendar .mtx-calendar-header-time{display:flex;flex-direction:column}[mode=auto] .mtx-calendar .mtx-calendar-header-time .mat-button{width:40px;text-align:center}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm-container{flex-direction:row;font-size:20px}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm{padding:4px}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm+.mtx-calendar-header-ampm{margin:0 8px}}.mtx-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.mtx-calendar-controls{display:flex;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.mtx-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mtx-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:transparent;box-sizing:border-box}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: MtxClock, selector: "mtx-clock", inputs: ["dateFilter", "interval", "twelvehour", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["selectedChange", "activeDateChange", "_userSelection"], exportAs: ["mtxClock"] }, { kind: "component", type: MtxTime, selector: "mtx-time", inputs: ["dateFilter", "interval", "twelvehour", "AMPM", "activeDate", "selected", "minDate", "maxDate", "clockView"], outputs: ["selectedChange", "activeDateChange", "_userSelection", "ampmChange", "clockViewChange"], exportAs: ["mtxTime"] }, { kind: "component", type: MtxMonthView, selector: "mtx-month-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxMonthView"] }, { kind: "component", type: MtxYearView, selector: "mtx-year-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxYearView"] }, { kind: "component", type: MtxMultiYearView, selector: "mtx-multi-year-view", inputs: ["type", "dateFilter", "activeDate", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxMultiYearView"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1467
2020
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxCalendar, decorators: [{
1468
2021
  type: Component,
1469
2022
  args: [{ selector: 'mtx-calendar', host: {
1470
2023
  'class': 'mtx-calendar',
2024
+ '[class.mtx-calendar-with-time-input]': 'timeInput',
1471
2025
  'tabindex': '0',
1472
2026
  '(keydown)': '_handleCalendarBodyKeydown($event)',
1473
- }, exportAs: 'mtxCalendar', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mtx-calendar-header\">\n <div (click)=\"_yearClicked()\" *ngIf=\"type !== 'time'\"\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-calendar-header-year\" role=\"button\">\n <span>{{ _yearLabel }}</span>\n <svg *ngIf=\"multiYearSelector || type === 'year'\"\n class=\"mtx-calendar-header-year-dropdown\"\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\n </svg>\n </div>\n <div class=\"mtx-calendar-header-date-time\">\n <span (click)=\"_dateClicked()\" *ngIf=\"type !== 'time' && type !== 'year'\"\n [class.active]=\"currentView === 'month'\"\n [class.not-clickable]=\"type === 'month'\"\n class=\"mtx-calendar-header-date\"\n role=\"button\">{{ _dateLabel }}</span>\n <span *ngIf=\"type.endsWith('time')\"\n [class.active]=\"currentView === 'clock'\"\n class=\"mtx-calendar-header-time\">\n <span class=\"mtx-calendar-header-hour-minute-container\">\n <span (click)=\"_hoursClicked()\"\n [class.active]=\"_clockView === 'hour'\"\n class=\"mtx-calendar-header-hours\"\n role=\"button\">{{ _hoursLabel }}</span>\n <span class=\"mtx-calendar-header-hour-minute-separator\">:</span>\n <span (click)=\"_minutesClicked()\"\n [class.active]=\"_clockView === 'minute'\"\n class=\"mtx-calendar-header-minutes\"\n role=\"button\">{{ _minutesLabel }}</span>\n </span>\n <span *ngIf=\"twelvehour\" class=\"mtx-calendar-header-ampm-container\">\n <span (click)=\"_ampmClicked('AM')\"\n [class.active]=\"_AMPM === 'AM'\"\n class=\"mtx-calendar-header-ampm\" role=\"button\">AM</span>\n <span (click)=\"_ampmClicked('PM')\"\n [class.active]=\"_AMPM === 'PM'\"\n class=\"mtx-calendar-header-ampm\" role=\"button\">PM</span>\n </span>\n </span>\n </div>\n</div>\n<div class=\"mtx-calendar-content\" [ngSwitch]=\"currentView\">\n <div *ngIf=\"currentView === 'month' || currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-month-content\">\n <div class=\"mtx-calendar-controls\">\n <button mat-icon-button type=\"button\" (click)=\"_previousClicked()\"\n [attr.aria-disabled]=\"!_previousEnabled()\"\n [attr.aria-label]=\"_ariaLabelPrev\"\n [class.disabled]=\"!_previousEnabled()\"\n class=\"mtx-calendar-previous-button\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\n </svg>\n </button>\n <div [@slideCalendar]=\"_calendarState\"\n (@slideCalendar.done)=\"_calendarStateDone()\"\n class=\"mtx-calendar-period-button\">\n <strong>{{ _monthYearLabel }}</strong>\n </div>\n <button mat-icon-button type=\"button\" (click)=\"_nextClicked()\"\n [attr.aria-disabled]=\"!_nextEnabled()\"\n [attr.aria-label]=\"_ariaLabelNext\"\n [class.disabled]=\"!_nextEnabled()\"\n class=\"mtx-calendar-next-button\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"></path>\n </svg>\n </button>\n </div>\n </div>\n <mtx-month-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n *ngSwitchCase=\"'month'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n <mtx-year-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n *ngSwitchCase=\"'year'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n <mtx-multi-year-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_yearSelected($event)\"\n *ngSwitchCase=\"'multi-year'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-multi-year-view>\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_timeSelected($event)\"\n *ngSwitchDefault\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\"\n [startView]=\"_clockView\"\n [twelvehour]=\"twelvehour\">\n </mtx-clock>\n</div>\n", styles: [".mtx-calendar{display:block;outline:none}.mtx-calendar[mode=landscape]{display:flex}.mtx-calendar-header{padding:16px;box-sizing:border-box;border-radius:4px 4px 0 0}[mode=landscape] .mtx-calendar-header{width:150px;min-width:150px;border-radius:4px 0 0 4px}[dir=rtl] [mode=landscape] .mtx-calendar-header{border-radius:0 4px 4px 0}.mtx-calendar-header-year,.mtx-calendar-header-date-time{width:100%;white-space:nowrap}.mtx-calendar-header-year{line-height:24px}.mtx-calendar-header-year>*{vertical-align:middle}.mtx-calendar-header-year+.mtx-calendar-header-date-time{margin-top:4px}.mtx-calendar-header-date-time{line-height:36px}[mode=landscape] .mtx-calendar-header-date-time{white-space:normal;word-wrap:break-word}.mtx-calendar-header-year:not(.active),.mtx-calendar-header-date:not(.active),.mtx-calendar-header-hours:not(.active),.mtx-calendar-header-minutes:not(.active),.mtx-calendar-header-ampm:not(.active){cursor:pointer;opacity:.6}.mtx-calendar-header-year.not-clickable,.mtx-calendar-header-date.not-clickable,.mtx-calendar-header-hours.not-clickable,.mtx-calendar-header-minutes.not-clickable,.mtx-calendar-header-ampm.not-clickable{cursor:initial}.mtx-calendar-header-time{display:inline-flex}.mtx-calendar-header-time:not(.active){opacity:.6}.mtx-calendar-header-time:not(.active) .mtx-calendar-header-hours,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-minutes,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-ampm{cursor:pointer;opacity:1}[mode=landscape] .mtx-calendar-header-time{display:flex;flex-direction:column}.mtx-calendar-header-hour-minute-container{padding:0 8px}[mode=landscape] .mtx-calendar-header-hour-minute-container{padding:0}.mtx-calendar-header-hour-minute-separator{display:inline-block;width:8px;text-align:center}.mtx-calendar-header-ampm-container{display:inline-flex;flex-direction:column;line-height:18px}[mode=landscape] .mtx-calendar-header-ampm-container{flex-direction:row}[mode=landscape] .mtx-calendar-header-ampm{padding:4px}.mtx-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.mtx-calendar-controls{display:flex;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.mtx-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mtx-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:transparent;box-sizing:border-box}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0}@media all and (orientation: landscape){.mtx-calendar[mode=auto]{display:flex}.mtx-calendar[mode=auto] .mtx-calendar-header{width:150px;min-width:150px;border-radius:4px 0 0 4px}[dir=rtl] .mtx-calendar[mode=auto] .mtx-calendar-header{border-radius:0 4px 4px 0}.mtx-calendar[mode=auto] .mtx-calendar-header-date-time{white-space:normal;word-wrap:break-word}.mtx-calendar[mode=auto] .mtx-calendar-header-time{display:flex;flex-direction:column}.mtx-calendar[mode=auto] .mtx-calendar-header-hour-minute-container{padding:0}.mtx-calendar[mode=auto] .mtx-calendar-header-ampm-container{flex-direction:row}.mtx-calendar[mode=auto] .mtx-calendar-header-ampm{padding:4px}}\n"] }]
1474
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.MatDatepickerIntl }, { type: i0.NgZone }, { type: i1.DatetimeAdapter, decorators: [{
2027
+ }, exportAs: 'mtxCalendar', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mtx-calendar-header\">\n <button *ngIf=\"type !== 'time'\"\n mat-button type=\"button\" class=\"mtx-calendar-header-year\"\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\"\n [attr.aria-label]=\"_yearButtonLabel\"\n (click)=\"_yearClicked()\">\n <span>{{ _yearButtonText }}</span>\n <svg *ngIf=\"multiYearSelector || type === 'year'\"\n class=\"mtx-calendar-header-year-dropdown\"\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\n </svg>\n </button>\n <div *ngIf=\"type !== 'year'\" class=\"mtx-calendar-header-date-time\">\n <button *ngIf=\"type !== 'time'\"\n mat-button type=\"button\" class=\"mtx-calendar-header-date\"\n [class.active]=\"currentView === 'month'\"\n [class.not-clickable]=\"type === 'month'\"\n [attr.aria-label]=\"_dateButtonLabel\"\n (click)=\"_dateClicked()\">{{ _dateButtonText }}</button>\n <span *ngIf=\"type.endsWith('time')\" class=\"mtx-calendar-header-time\"\n [class.active]=\"currentView === 'clock'\">\n <span class=\"mtx-calendar-header-hour-minute-container\">\n <button mat-button type=\"button\" class=\"mtx-calendar-header-hours\"\n [class.active]=\"_clockView === 'hour'\"\n [attr.aria-label]=\"_hourButtonLabel\"\n (click)=\"_hoursClicked()\">{{ _hoursButtonText }}</button>\n <span class=\"mtx-calendar-header-hour-minute-separator\">:</span>\n <button mat-button type=\"button\" class=\"mtx-calendar-header-minutes\"\n [class.active]=\"_clockView === 'minute'\"\n [attr.aria-label]=\"_minuteButtonLabel\"\n (click)=\"_minutesClicked()\">{{ _minutesButtonText }}</button>\n </span>\n <span *ngIf=\"twelvehour\" class=\"mtx-calendar-header-ampm-container\">\n <button mat-button type=\"button\" class=\"mtx-calendar-header-ampm\"\n [class.active]=\"_AMPM === 'AM'\" aria-label=\"AM\"\n (click)=\"_ampmClicked('AM')\">AM</button>\n <button mat-button type=\"button\" class=\"mtx-calendar-header-ampm\"\n [class.active]=\"_AMPM === 'PM'\" aria-label=\"PM\"\n (click)=\"_ampmClicked('PM')\">PM</button>\n </span>\n </span>\n </div>\n</div>\n\n<div class=\"mtx-calendar-content\" [ngSwitch]=\"currentView\">\n <div *ngIf=\"currentView === 'month' || currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-month-content\">\n <div class=\"mtx-calendar-controls\">\n <button mat-icon-button type=\"button\"\n class=\"mtx-calendar-previous-button\"\n [class.disabled]=\"!_previousEnabled()\"\n [attr.aria-disabled]=\"!_previousEnabled()\"\n [attr.aria-label]=\"_prevButtonLabel\"\n (click)=\"_previousClicked()\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\n </svg>\n </button>\n <div class=\"mtx-calendar-period-button\"\n [@slideCalendar]=\"_calendarState\"\n (@slideCalendar.done)=\"_calendarStateDone()\">\n <strong>{{ _yearPeriodText }}</strong>\n </div>\n <button mat-icon-button type=\"button\"\n class=\"mtx-calendar-next-button\"\n [class.disabled]=\"!_nextEnabled()\"\n [attr.aria-disabled]=\"!_nextEnabled()\"\n [attr.aria-label]=\"_nextButtonLabel\"\n (click)=\"_nextClicked()\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"></path>\n </svg>\n </button>\n </div>\n </div>\n <mtx-month-view *ngSwitchCase=\"'month'\"\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n <mtx-year-view *ngSwitchCase=\"'year'\"\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n <mtx-multi-year-view *ngSwitchCase=\"'multi-year'\"\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_yearSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-multi-year-view>\n\n <ng-container *ngSwitchDefault>\n <mtx-time *ngIf=\"timeInput; else clock\"\n (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_timeSelected($event)\"\n [AMPM]=\"_AMPM\"\n (ampmChange)=\"_ampmClicked($event)\"\n [clockView]=\"_clockView\"\n (clockViewChange)=\"_clockView = $event\"\n [twelvehour]=\"twelvehour\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\">\n </mtx-time>\n\n <ng-template #clock>\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_dialTimeSelected($event)\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\"\n [startView]=\"_clockView\"\n [twelvehour]=\"twelvehour\">\n </mtx-clock>\n </ng-template>\n </ng-container>\n</div>\n", styles: [".mtx-calendar{display:block;outline:none}.mtx-calendar-header{box-sizing:border-box;padding:8px;border-radius:4px 4px 0 0}.mtx-calendar-header .mat-button{min-width:auto;padding:0 4px;text-align:inherit;line-height:inherit;font-size:inherit;font-weight:inherit;white-space:normal;word-break:break-word}.mtx-calendar-header-year.mat-button{line-height:24px}.mtx-calendar-header-date-time{font-size:24px;line-height:36px}.mtx-calendar-header-year:not(.active),.mtx-calendar-header-date:not(.active),.mtx-calendar-header-hours:not(.active),.mtx-calendar-header-minutes:not(.active),.mtx-calendar-header-ampm:not(.active){opacity:.6}.mtx-calendar-header-year.not-clickable,.mtx-calendar-header-date.not-clickable,.mtx-calendar-header-hours.not-clickable,.mtx-calendar-header-minutes.not-clickable,.mtx-calendar-header-ampm.not-clickable{cursor:initial}.mtx-calendar-header-time{display:inline-flex}.mtx-calendar-header-time:not(.active){opacity:.6}.mtx-calendar-header-time:not(.active) .mtx-calendar-header-hours,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-minutes,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-ampm{opacity:1}.mtx-calendar-header-hour-minute-separator{display:inline-block;width:8px;text-align:center}.mtx-calendar-header-ampm-container{display:inline-flex;flex-direction:column;line-height:18px;font-size:12px}[mode=landscape] .mtx-calendar{display:flex}[mode=landscape] .mtx-calendar .mtx-calendar-header{width:150px;min-width:150px;padding:16px 8px;border-radius:4px 0 0 4px}[dir=rtl] [mode=landscape] .mtx-calendar .mtx-calendar-header{border-radius:0 4px 4px 0}[mode=landscape] .mtx-calendar .mtx-calendar-header-year+.mtx-calendar-header-date-time,[mode=landscape] .mtx-calendar .mtx-calendar-header-date+.mtx-calendar-header-time{margin-top:4px}[mode=landscape] .mtx-calendar .mtx-calendar-header-date-time{font-size:28px}[mode=landscape] .mtx-calendar .mtx-calendar-header-time{display:flex;flex-direction:column}[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mat-button{width:40px;text-align:center}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm-container{flex-direction:row;font-size:20px}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm{padding:4px}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm+.mtx-calendar-header-ampm{margin:0 8px}@media all and (orientation: landscape){[mode=auto] .mtx-calendar{display:flex}[mode=auto] .mtx-calendar .mtx-calendar-header{width:150px;min-width:150px;padding:16px 8px;border-radius:4px 0 0 4px}[dir=rtl] [mode=auto] .mtx-calendar .mtx-calendar-header{border-radius:0 4px 4px 0}[mode=auto] .mtx-calendar .mtx-calendar-header-year+.mtx-calendar-header-date-time,[mode=auto] .mtx-calendar .mtx-calendar-header-date+.mtx-calendar-header-time{margin-top:4px}[mode=auto] .mtx-calendar .mtx-calendar-header-date-time{font-size:28px}[mode=auto] .mtx-calendar .mtx-calendar-header-time{display:flex;flex-direction:column}[mode=auto] .mtx-calendar .mtx-calendar-header-time .mat-button{width:40px;text-align:center}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm-container{flex-direction:row;font-size:20px}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm{padding:4px}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm+.mtx-calendar-header-ampm{margin:0 8px}}.mtx-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.mtx-calendar-controls{display:flex;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.mtx-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mtx-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:transparent;box-sizing:border-box}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0}\n"] }]
2028
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MtxDatetimepickerIntl }, { type: i0.NgZone }, { type: i1.DatetimeAdapter, decorators: [{
1475
2029
  type: Optional
1476
2030
  }] }, { type: undefined, decorators: [{
1477
2031
  type: Optional
@@ -1500,6 +2054,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
1500
2054
  type: Input
1501
2055
  }], startAt: [{
1502
2056
  type: Input
2057
+ }], timeInput: [{
2058
+ type: Input
1503
2059
  }], selected: [{
1504
2060
  type: Input
1505
2061
  }], minDate: [{
@@ -1540,6 +2096,8 @@ class MtxDatetimepickerContent extends _MtxDatetimepickerContentBase {
1540
2096
  this._changeDetectorRef = _changeDetectorRef;
1541
2097
  /** Emits when an animation has finished. */
1542
2098
  this._animationDone = new Subject();
2099
+ /** Id of the label for the `role="dialog"` element. */
2100
+ this._dialogLabelId = null;
1543
2101
  }
1544
2102
  ngOnInit() {
1545
2103
  this._animationState = this.datetimepicker.touchUi ? 'enter-dialog' : 'enter-dropdown';
@@ -1556,7 +2114,7 @@ class MtxDatetimepickerContent extends _MtxDatetimepickerContentBase {
1556
2114
  }
1557
2115
  }
1558
2116
  /** @nocollapse */ MtxDatetimepickerContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerContent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1559
- /** @nocollapse */ MtxDatetimepickerContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxDatetimepickerContent, selector: "mtx-datetimepicker-content", inputs: { color: "color" }, host: { listeners: { "@transformPanel.done": "_animationDone.next()" }, properties: { "class.mtx-datetimepicker-content-touch": "datetimepicker?.touchUi", "attr.mode": "datetimepicker.mode", "@transformPanel": "_animationState" }, classAttribute: "mtx-datetimepicker-content" }, viewQueries: [{ propertyName: "_calendar", first: true, predicate: MtxCalendar, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div cdkTrapFocus\n class=\"mtx-datetimepicker-content-container\"\n [attr.mode]=\"datetimepicker.mode\">\n <mtx-calendar [id]=\"datetimepicker.id\"\n [ngClass]=\"datetimepicker.panelClass\"\n [attr.mode]=\"datetimepicker.mode\"\n [type]=\"datetimepicker.type\"\n [startAt]=\"datetimepicker.startAt\"\n [startView]=\"datetimepicker.startView\"\n [maxDate]=\"datetimepicker._maxDate\"\n [minDate]=\"datetimepicker._minDate\"\n [dateFilter]=\"datetimepicker._dateFilter\"\n [multiYearSelector]=\"datetimepicker.multiYearSelector\"\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\n [timeInterval]=\"datetimepicker.timeInterval\"\n [twelvehour]=\"datetimepicker.twelvehour\"\n [selected]=\"datetimepicker._selected\"\n [@fadeInCalendar]=\"'enter'\"\n (selectedChange)=\"datetimepicker._select($event)\"\n (viewChanged)=\"datetimepicker._viewChanged($event)\"\n (_userSelection)=\"datetimepicker.close()\">\n </mtx-calendar>\n</div>\n", styles: [".mtx-datetimepicker-content{display:block;border-radius:4px}.mtx-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mtx-datetimepicker-content .mtx-calendar{width:296px;height:424px}.mtx-datetimepicker-content .mtx-calendar[mode=landscape]{width:446px;height:328px}@media all and (orientation: landscape){.mtx-datetimepicker-content .mtx-calendar[mode=auto]{width:446px;height:328px}}.mtx-datetimepicker-content-touch{display:block;max-height:80vh;position:relative;overflow:visible}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.mtx-datetimepicker-content-touch .mtx-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:120vh;height:80vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}}@media all and (orientation: portrait){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container-with-actions{height:135vw}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: MtxCalendar, selector: "mtx-calendar", inputs: ["multiYearSelector", "twelvehour", "startView", "timeInterval", "dateFilter", "preventSameDateTimeSelection", "type", "startAt", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "viewChanged", "_userSelection"], exportAs: ["mtxCalendar"] }], animations: [
2117
+ /** @nocollapse */ MtxDatetimepickerContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxDatetimepickerContent, selector: "mtx-datetimepicker-content", inputs: { color: "color" }, host: { listeners: { "@transformPanel.done": "_animationDone.next()" }, properties: { "class.mtx-datetimepicker-content-touch": "datetimepicker?.touchUi", "attr.mode": "datetimepicker.mode", "@transformPanel": "_animationState" }, classAttribute: "mtx-datetimepicker-content" }, viewQueries: [{ propertyName: "_calendar", first: true, predicate: MtxCalendar, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div cdkTrapFocus\n role=\"dialog\"\n [attr.aria-modal]=\"true\"\n [attr.aria-labelledby]=\"_dialogLabelId ?? undefined\"\n [attr.mode]=\"datetimepicker.mode\"\n class=\"mtx-datetimepicker-content-container\">\n <mtx-calendar [id]=\"datetimepicker.id\"\n [ngClass]=\"datetimepicker.panelClass\"\n [attr.mode]=\"datetimepicker.mode\"\n [type]=\"datetimepicker.type\"\n [startAt]=\"datetimepicker.startAt\"\n [startView]=\"datetimepicker.startView\"\n [maxDate]=\"datetimepicker._maxDate\"\n [minDate]=\"datetimepicker._minDate\"\n [dateFilter]=\"datetimepicker._dateFilter\"\n [multiYearSelector]=\"datetimepicker.multiYearSelector\"\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\n [timeInterval]=\"datetimepicker.timeInterval\"\n [twelvehour]=\"datetimepicker.twelvehour\"\n [selected]=\"datetimepicker._selected\"\n [timeInput]=\"datetimepicker.timeInput\"\n (selectedChange)=\"datetimepicker._select($event)\"\n (viewChanged)=\"datetimepicker._viewChanged($event)\"\n (_userSelection)=\"datetimepicker.close()\"\n [@fadeInCalendar]=\"'enter'\">\n </mtx-calendar>\n</div>\n", styles: [".mtx-datetimepicker-content{display:block;border-radius:4px}.mtx-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mtx-datetimepicker-content .mtx-calendar{width:296px;height:424px}.mtx-datetimepicker-content .mtx-calendar.mtx-calendar-with-time-input{height:490px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar{width:446px;height:328px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar.mtx-calendar-with-time-input{height:412px}@media all and (orientation: landscape){.mtx-datetimepicker-content[mode=auto] .mtx-calendar{width:446px;height:328px}.mtx-datetimepicker-content[mode=auto] .mtx-calendar.mtx-calendar-with-time-input{height:412px}}.mtx-datetimepicker-content-touch{display:block;max-height:80vh;position:relative;overflow:visible}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.mtx-datetimepicker-content-touch .mtx-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:120vh;height:80vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}}@media all and (orientation: portrait){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container-with-actions{height:135vw}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: MtxCalendar, selector: "mtx-calendar", inputs: ["multiYearSelector", "twelvehour", "startView", "timeInterval", "dateFilter", "preventSameDateTimeSelection", "type", "startAt", "timeInput", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "viewChanged", "_userSelection"], exportAs: ["mtxCalendar"] }], animations: [
1560
2118
  mtxDatetimepickerAnimations.transformPanel,
1561
2119
  mtxDatetimepickerAnimations.fadeInCalendar,
1562
2120
  ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
@@ -1571,7 +2129,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
1571
2129
  }, animations: [
1572
2130
  mtxDatetimepickerAnimations.transformPanel,
1573
2131
  mtxDatetimepickerAnimations.fadeInCalendar,
1574
- ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['color'], template: "<div cdkTrapFocus\n class=\"mtx-datetimepicker-content-container\"\n [attr.mode]=\"datetimepicker.mode\">\n <mtx-calendar [id]=\"datetimepicker.id\"\n [ngClass]=\"datetimepicker.panelClass\"\n [attr.mode]=\"datetimepicker.mode\"\n [type]=\"datetimepicker.type\"\n [startAt]=\"datetimepicker.startAt\"\n [startView]=\"datetimepicker.startView\"\n [maxDate]=\"datetimepicker._maxDate\"\n [minDate]=\"datetimepicker._minDate\"\n [dateFilter]=\"datetimepicker._dateFilter\"\n [multiYearSelector]=\"datetimepicker.multiYearSelector\"\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\n [timeInterval]=\"datetimepicker.timeInterval\"\n [twelvehour]=\"datetimepicker.twelvehour\"\n [selected]=\"datetimepicker._selected\"\n [@fadeInCalendar]=\"'enter'\"\n (selectedChange)=\"datetimepicker._select($event)\"\n (viewChanged)=\"datetimepicker._viewChanged($event)\"\n (_userSelection)=\"datetimepicker.close()\">\n </mtx-calendar>\n</div>\n", styles: [".mtx-datetimepicker-content{display:block;border-radius:4px}.mtx-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mtx-datetimepicker-content .mtx-calendar{width:296px;height:424px}.mtx-datetimepicker-content .mtx-calendar[mode=landscape]{width:446px;height:328px}@media all and (orientation: landscape){.mtx-datetimepicker-content .mtx-calendar[mode=auto]{width:446px;height:328px}}.mtx-datetimepicker-content-touch{display:block;max-height:80vh;position:relative;overflow:visible}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.mtx-datetimepicker-content-touch .mtx-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:120vh;height:80vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}}@media all and (orientation: portrait){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container-with-actions{height:135vw}}\n"] }]
2132
+ ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['color'], template: "<div cdkTrapFocus\n role=\"dialog\"\n [attr.aria-modal]=\"true\"\n [attr.aria-labelledby]=\"_dialogLabelId ?? undefined\"\n [attr.mode]=\"datetimepicker.mode\"\n class=\"mtx-datetimepicker-content-container\">\n <mtx-calendar [id]=\"datetimepicker.id\"\n [ngClass]=\"datetimepicker.panelClass\"\n [attr.mode]=\"datetimepicker.mode\"\n [type]=\"datetimepicker.type\"\n [startAt]=\"datetimepicker.startAt\"\n [startView]=\"datetimepicker.startView\"\n [maxDate]=\"datetimepicker._maxDate\"\n [minDate]=\"datetimepicker._minDate\"\n [dateFilter]=\"datetimepicker._dateFilter\"\n [multiYearSelector]=\"datetimepicker.multiYearSelector\"\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\n [timeInterval]=\"datetimepicker.timeInterval\"\n [twelvehour]=\"datetimepicker.twelvehour\"\n [selected]=\"datetimepicker._selected\"\n [timeInput]=\"datetimepicker.timeInput\"\n (selectedChange)=\"datetimepicker._select($event)\"\n (viewChanged)=\"datetimepicker._viewChanged($event)\"\n (_userSelection)=\"datetimepicker.close()\"\n [@fadeInCalendar]=\"'enter'\">\n </mtx-calendar>\n</div>\n", styles: [".mtx-datetimepicker-content{display:block;border-radius:4px}.mtx-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mtx-datetimepicker-content .mtx-calendar{width:296px;height:424px}.mtx-datetimepicker-content .mtx-calendar.mtx-calendar-with-time-input{height:490px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar{width:446px;height:328px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar.mtx-calendar-with-time-input{height:412px}@media all and (orientation: landscape){.mtx-datetimepicker-content[mode=auto] .mtx-calendar{width:446px;height:328px}.mtx-datetimepicker-content[mode=auto] .mtx-calendar.mtx-calendar-with-time-input{height:412px}}.mtx-datetimepicker-content-touch{display:block;max-height:80vh;position:relative;overflow:visible}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.mtx-datetimepicker-content-touch .mtx-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:120vh;height:80vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}}@media all and (orientation: portrait){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container-with-actions{height:135vw}}\n"] }]
1575
2133
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { _calendar: [{
1576
2134
  type: ViewChild,
1577
2135
  args: [MtxCalendar, { static: true }]
@@ -1584,6 +2142,7 @@ class MtxDatetimepicker {
1584
2142
  this._scrollStrategy = _scrollStrategy;
1585
2143
  this._dateAdapter = _dateAdapter;
1586
2144
  this._dir = _dir;
2145
+ this._document = inject(DOCUMENT);
1587
2146
  this._multiYearSelector = false;
1588
2147
  this._twelvehour = false;
1589
2148
  /** The view that the calendar should start in. */
@@ -1616,8 +2175,9 @@ class MtxDatetimepicker {
1616
2175
  /** Unique class that will be added to the backdrop so that the test harnesses can look it up. */
1617
2176
  this._backdropHarnessClass = `${this.id}-backdrop`;
1618
2177
  this._inputStateChanges = Subscription.EMPTY;
1619
- this._type = 'date';
2178
+ this._type = 'datetime';
1620
2179
  this._touchUi = false;
2180
+ this._timeInput = false;
1621
2181
  /** Preferred position of the datetimepicker in the X axis. */
1622
2182
  this.xPosition = 'start';
1623
2183
  /** Preferred position of the datetimepicker in the Y axis. */
@@ -1680,7 +2240,7 @@ class MtxDatetimepicker {
1680
2240
  return this._type;
1681
2241
  }
1682
2242
  set type(value) {
1683
- this._type = value || 'date';
2243
+ this._type = value || 'datetime';
1684
2244
  }
1685
2245
  /**
1686
2246
  * Whether the calendar UI is in touch mode. In touch mode the calendar opens in a dialog rather
@@ -1692,6 +2252,16 @@ class MtxDatetimepicker {
1692
2252
  set touchUi(value) {
1693
2253
  this._touchUi = coerceBooleanProperty(value);
1694
2254
  }
2255
+ /**
2256
+ * Whether the calendar is in time mode. In time mode the calendar clock gets time input
2257
+ * elements rather then just clock. When `touchUi` is enabled this will be disabled.
2258
+ */
2259
+ get timeInput() {
2260
+ return this._timeInput && !this.touchUi;
2261
+ }
2262
+ set timeInput(value) {
2263
+ this._timeInput = coerceBooleanProperty(value);
2264
+ }
1695
2265
  /** Whether the datetimepicker pop-up should be disabled. */
1696
2266
  get disabled() {
1697
2267
  return this._disabled === undefined && this.datetimepickerInput
@@ -1780,27 +2350,40 @@ class MtxDatetimepicker {
1780
2350
  if (!this._opened) {
1781
2351
  return;
1782
2352
  }
1783
- if (this._componentRef) {
1784
- this._destroyOverlay();
1785
- }
2353
+ const canRestoreFocus = this._restoreFocus &&
2354
+ this._focusedElementBeforeOpen &&
2355
+ typeof this._focusedElementBeforeOpen.focus === 'function';
1786
2356
  const completeClose = () => {
1787
2357
  // The `_opened` could've been reset already if
1788
2358
  // we got two events in quick succession.
1789
2359
  if (this._opened) {
1790
2360
  this._opened = false;
1791
2361
  this.closedStream.emit();
1792
- this._focusedElementBeforeOpen = null;
1793
2362
  }
1794
2363
  };
1795
- if (this._restoreFocus &&
1796
- this._focusedElementBeforeOpen &&
1797
- typeof this._focusedElementBeforeOpen.focus === 'function') {
2364
+ if (this._componentRef) {
2365
+ const { instance, location } = this._componentRef;
2366
+ instance._startExitAnimation();
2367
+ instance._animationDone.pipe(take(1)).subscribe(() => {
2368
+ const activeElement = this._document.activeElement;
2369
+ // Since we restore focus after the exit animation, we have to check that
2370
+ // the user didn't move focus themselves inside the `close` handler.
2371
+ if (canRestoreFocus &&
2372
+ (!activeElement ||
2373
+ activeElement === this._document.activeElement ||
2374
+ location.nativeElement.contains(activeElement))) {
2375
+ this._focusedElementBeforeOpen.focus();
2376
+ }
2377
+ this._focusedElementBeforeOpen = null;
2378
+ this._destroyOverlay();
2379
+ });
2380
+ }
2381
+ if (canRestoreFocus) {
1798
2382
  // Because IE moves focus asynchronously, we can't count on it being restored before we've
1799
- // marked the datetimepicker as closed. If the event fires out of sequence and the element
1800
- // that we're refocusing opens the datetimepicker on focus, the user could be stuck with not
1801
- // being able to close the calendar at all. We work around it by making the logic, that marks
1802
- // the datetimepicker as closed, async as well.
1803
- this._focusedElementBeforeOpen.focus();
2383
+ // marked the datepicker as closed. If the event fires out of sequence and the element that
2384
+ // we're refocusing opens the datepicker on focus, the user could be stuck with not being
2385
+ // able to close the calendar at all. We work around it by making the logic, that marks
2386
+ // the datepicker as closed, async as well.
1804
2387
  setTimeout(completeClose);
1805
2388
  }
1806
2389
  else {
@@ -1814,6 +2397,7 @@ class MtxDatetimepicker {
1814
2397
  _forwardContentValues(instance) {
1815
2398
  instance.datetimepicker = this;
1816
2399
  instance.color = this.color;
2400
+ instance._dialogLabelId = this.datetimepickerInput.getOverlayLabelId();
1817
2401
  }
1818
2402
  /** Opens the overlay with the calendar. */
1819
2403
  _openOverlay() {
@@ -1922,7 +2506,7 @@ class MtxDatetimepicker {
1922
2506
  }
1923
2507
  }
1924
2508
  /** @nocollapse */ MtxDatetimepicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepicker, deps: [{ token: i4$1.Overlay }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: MTX_DATETIMEPICKER_SCROLL_STRATEGY }, { token: i1.DatetimeAdapter, optional: true }, { token: i6.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1925
- /** @nocollapse */ MtxDatetimepicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxDatetimepicker, selector: "mtx-datetimepicker", inputs: { multiYearSelector: "multiYearSelector", twelvehour: "twelvehour", startView: "startView", mode: "mode", timeInterval: "timeInterval", preventSameDateTimeSelection: "preventSameDateTimeSelection", panelClass: "panelClass", opened: "opened", color: "color", startAt: "startAt", type: "type", touchUi: "touchUi", disabled: "disabled", xPosition: "xPosition", yPosition: "yPosition", restoreFocus: "restoreFocus" }, outputs: { selectedChanged: "selectedChanged", openedStream: "opened", closedStream: "closed", viewChanged: "viewChanged" }, exportAs: ["mtxDatetimepicker"], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2509
+ /** @nocollapse */ MtxDatetimepicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxDatetimepicker, selector: "mtx-datetimepicker", inputs: { multiYearSelector: "multiYearSelector", twelvehour: "twelvehour", startView: "startView", mode: "mode", timeInterval: "timeInterval", preventSameDateTimeSelection: "preventSameDateTimeSelection", panelClass: "panelClass", opened: "opened", color: "color", startAt: "startAt", type: "type", touchUi: "touchUi", timeInput: "timeInput", disabled: "disabled", xPosition: "xPosition", yPosition: "yPosition", restoreFocus: "restoreFocus" }, outputs: { selectedChanged: "selectedChanged", openedStream: "opened", closedStream: "closed", viewChanged: "viewChanged" }, exportAs: ["mtxDatetimepicker"], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1926
2510
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepicker, decorators: [{
1927
2511
  type: Component,
1928
2512
  args: [{
@@ -1974,6 +2558,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
1974
2558
  type: Input
1975
2559
  }], touchUi: [{
1976
2560
  type: Input
2561
+ }], timeInput: [{
2562
+ type: Input
1977
2563
  }], disabled: [{
1978
2564
  type: Input
1979
2565
  }], xPosition: [{
@@ -2377,8 +2963,8 @@ class MtxDatetimepickerToggle {
2377
2963
  ]).subscribe(() => this._changeDetectorRef.markForCheck());
2378
2964
  }
2379
2965
  }
2380
- /** @nocollapse */ MtxDatetimepickerToggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerToggle, deps: [{ token: i1$1.MatDatepickerIntl }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2381
- /** @nocollapse */ MtxDatetimepickerToggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxDatetimepickerToggle, selector: "mtx-datetimepicker-toggle", inputs: { datetimepicker: ["for", "datetimepicker"], tabIndex: "tabIndex", disabled: "disabled", disableRipple: "disableRipple" }, host: { listeners: { "focus": "_button.focus()" }, properties: { "attr.tabindex": "disabled ? null : -1", "class.mtx-datetimepicker-toggle-active": "datetimepicker && datetimepicker.opened", "class.mat-accent": "datetimepicker && datetimepicker.color === \"accent\"", "class.mat-warn": "datetimepicker && datetimepicker.color === \"warn\"" }, classAttribute: "mtx-datetimepicker-toggle" }, queries: [{ propertyName: "_customIcon", first: true, predicate: MtxDatetimepickerToggleIcon, descendants: true }], viewQueries: [{ propertyName: "_button", first: true, predicate: ["button"], descendants: true }], exportAs: ["mtxDatetimepickerToggle"], usesOnChanges: true, ngImport: i0, template: "<button #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datetimepicker ? 'dialog' : null\"\n [attr.aria-label]=\"_intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n (click)=\"_open($event)\">\n\n <ng-container *ngIf=\"!_customIcon\" [ngSwitch]=\"datetimepicker.type\">\n <svg *ngSwitchCase=\"'time'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z\">\n </path>\n </svg>\n <svg *ngSwitchCase=\"'datetime'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\">\n </path>\n </svg>\n <svg *ngSwitchDefault\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\" />\n </svg>\n </ng-container>\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mat-form-field-appearance-legacy .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mtx-datetimepicker-toggle-default-icon{margin:auto}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2966
+ /** @nocollapse */ MtxDatetimepickerToggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerToggle, deps: [{ token: MtxDatetimepickerIntl }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2967
+ /** @nocollapse */ MtxDatetimepickerToggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MtxDatetimepickerToggle, selector: "mtx-datetimepicker-toggle", inputs: { datetimepicker: ["for", "datetimepicker"], tabIndex: "tabIndex", ariaLabel: ["aria-label", "ariaLabel"], disabled: "disabled", disableRipple: "disableRipple" }, host: { listeners: { "focus": "_button.focus()" }, properties: { "attr.tabindex": "disabled ? null : -1", "class.mtx-datetimepicker-toggle-active": "datetimepicker && datetimepicker.opened", "class.mat-accent": "datetimepicker && datetimepicker.color === \"accent\"", "class.mat-warn": "datetimepicker && datetimepicker.color === \"warn\"" }, classAttribute: "mtx-datetimepicker-toggle" }, queries: [{ propertyName: "_customIcon", first: true, predicate: MtxDatetimepickerToggleIcon, descendants: true }], viewQueries: [{ propertyName: "_button", first: true, predicate: ["button"], descendants: true }], exportAs: ["mtxDatetimepickerToggle"], usesOnChanges: true, ngImport: i0, template: "<button #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datetimepicker ? 'dialog' : null\"\n [attr.aria-label]=\"ariaLabel || _intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n (click)=\"_open($event)\">\n\n <ng-container *ngIf=\"!_customIcon\" [ngSwitch]=\"datetimepicker.type\">\n <svg *ngSwitchCase=\"'time'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z\">\n </path>\n </svg>\n <svg *ngSwitchCase=\"'datetime'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\">\n </path>\n </svg>\n <svg *ngSwitchDefault\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\" />\n </svg>\n </ng-container>\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mat-form-field-appearance-legacy .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mtx-datetimepicker-toggle-default-icon{margin:auto}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2382
2968
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerToggle, decorators: [{
2383
2969
  type: Component,
2384
2970
  args: [{ selector: 'mtx-datetimepicker-toggle', host: {
@@ -2390,12 +2976,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
2390
2976
  '[class.mat-accent]': 'datetimepicker && datetimepicker.color === "accent"',
2391
2977
  '[class.mat-warn]': 'datetimepicker && datetimepicker.color === "warn"',
2392
2978
  '(focus)': '_button.focus()',
2393
- }, exportAs: 'mtxDatetimepickerToggle', encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<button #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datetimepicker ? 'dialog' : null\"\n [attr.aria-label]=\"_intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n (click)=\"_open($event)\">\n\n <ng-container *ngIf=\"!_customIcon\" [ngSwitch]=\"datetimepicker.type\">\n <svg *ngSwitchCase=\"'time'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z\">\n </path>\n </svg>\n <svg *ngSwitchCase=\"'datetime'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\">\n </path>\n </svg>\n <svg *ngSwitchDefault\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\" />\n </svg>\n </ng-container>\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mat-form-field-appearance-legacy .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mtx-datetimepicker-toggle-default-icon{margin:auto}\n"] }]
2394
- }], ctorParameters: function () { return [{ type: i1$1.MatDatepickerIntl }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { datetimepicker: [{
2979
+ }, exportAs: 'mtxDatetimepickerToggle', encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<button #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datetimepicker ? 'dialog' : null\"\n [attr.aria-label]=\"ariaLabel || _intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n (click)=\"_open($event)\">\n\n <ng-container *ngIf=\"!_customIcon\" [ngSwitch]=\"datetimepicker.type\">\n <svg *ngSwitchCase=\"'time'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z\">\n </path>\n </svg>\n <svg *ngSwitchCase=\"'datetime'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\">\n </path>\n </svg>\n <svg *ngSwitchDefault\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\" />\n </svg>\n </ng-container>\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mat-form-field-appearance-legacy .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mtx-datetimepicker-toggle-default-icon{margin:auto}\n"] }]
2980
+ }], ctorParameters: function () { return [{ type: MtxDatetimepickerIntl }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { datetimepicker: [{
2395
2981
  type: Input,
2396
2982
  args: ['for']
2397
2983
  }], tabIndex: [{
2398
2984
  type: Input
2985
+ }], ariaLabel: [{
2986
+ type: Input,
2987
+ args: ['aria-label']
2399
2988
  }], disabled: [{
2400
2989
  type: Input
2401
2990
  }], disableRipple: [{
@@ -2414,6 +3003,8 @@ class MtxDatetimepickerModule {
2414
3003
  /** @nocollapse */ MtxDatetimepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerModule, declarations: [MtxCalendar,
2415
3004
  MtxCalendarBody,
2416
3005
  MtxClock,
3006
+ MtxTime,
3007
+ MtxTimeInput,
2417
3008
  MtxDatetimepicker,
2418
3009
  MtxDatetimepickerToggle,
2419
3010
  MtxDatetimepickerToggleIcon,
@@ -2424,6 +3015,7 @@ class MtxDatetimepickerModule {
2424
3015
  MtxMultiYearView], imports: [CommonModule, MatButtonModule, OverlayModule, A11yModule, PortalModule], exports: [MtxCalendar,
2425
3016
  MtxCalendarBody,
2426
3017
  MtxClock,
3018
+ MtxTime,
2427
3019
  MtxDatetimepicker,
2428
3020
  MtxDatetimepickerToggle,
2429
3021
  MtxDatetimepickerToggleIcon,
@@ -2441,6 +3033,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
2441
3033
  MtxCalendar,
2442
3034
  MtxCalendarBody,
2443
3035
  MtxClock,
3036
+ MtxTime,
3037
+ MtxTimeInput,
2444
3038
  MtxDatetimepicker,
2445
3039
  MtxDatetimepickerToggle,
2446
3040
  MtxDatetimepickerToggleIcon,
@@ -2454,6 +3048,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
2454
3048
  MtxCalendar,
2455
3049
  MtxCalendarBody,
2456
3050
  MtxClock,
3051
+ MtxTime,
2457
3052
  MtxDatetimepicker,
2458
3053
  MtxDatetimepickerToggle,
2459
3054
  MtxDatetimepickerToggleIcon,
@@ -2471,5 +3066,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
2471
3066
  * Generated bundle index. Do not edit.
2472
3067
  */
2473
3068
 
2474
- export { CLOCK_INNER_RADIUS, CLOCK_OUTER_RADIUS, CLOCK_RADIUS, CLOCK_TICK_RADIUS, MAT_DATETIMEPICKER_VALIDATORS, MAT_DATETIMEPICKER_VALUE_ACCESSOR, MTX_DATETIMEPICKER_SCROLL_STRATEGY, MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY, MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER, MtxCalendar, MtxCalendarBody, MtxCalendarCell, MtxClock, MtxDatetimepicker, MtxDatetimepickerContent, MtxDatetimepickerFilterType, MtxDatetimepickerInput, MtxDatetimepickerInputEvent, MtxDatetimepickerModule, MtxDatetimepickerToggle, MtxDatetimepickerToggleIcon, MtxMonthView, MtxMultiYearView, MtxYearView, getActiveOffset, isSameMultiYearView, mtxDatetimepickerAnimations, yearsPerPage, yearsPerRow };
3069
+ export { CLOCK_INNER_RADIUS, CLOCK_OUTER_RADIUS, CLOCK_RADIUS, CLOCK_TICK_RADIUS, MAT_DATETIMEPICKER_VALIDATORS, MAT_DATETIMEPICKER_VALUE_ACCESSOR, MTX_DATETIMEPICKER_SCROLL_STRATEGY, MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY, MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER, MtxCalendar, MtxCalendarBody, MtxCalendarCell, MtxClock, MtxDatetimepicker, MtxDatetimepickerContent, MtxDatetimepickerFilterType, MtxDatetimepickerInput, MtxDatetimepickerInputEvent, MtxDatetimepickerModule, MtxDatetimepickerToggle, MtxDatetimepickerToggleIcon, MtxMonthView, MtxMultiYearView, MtxTime, MtxTimeInput, MtxYearView, getActiveOffset, isSameMultiYearView, mtxDatetimepickerAnimations, yearsPerPage, yearsPerRow };
2475
3070
  //# sourceMappingURL=mtxDatetimepicker.mjs.map