@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.
- package/alert/alert.component.d.ts +4 -4
- package/core/datetime/datetime-adapter.d.ts +1 -1
- package/datetimepicker/_datetimepicker-theme.scss +38 -12
- package/datetimepicker/calendar.d.ts +28 -17
- package/datetimepicker/calendar.scss +68 -92
- package/datetimepicker/clock.d.ts +3 -2
- package/datetimepicker/clock.scss +1 -1
- package/datetimepicker/datetimepicker-content.scss +21 -6
- package/datetimepicker/datetimepicker-intl.d.ts +51 -0
- package/datetimepicker/datetimepicker-module.d.ts +13 -12
- package/datetimepicker/datetimepicker-toggle.d.ts +6 -4
- package/datetimepicker/datetimepicker-types.d.ts +4 -0
- package/datetimepicker/datetimepicker.d.ts +14 -3
- package/datetimepicker/public-api.d.ts +1 -0
- package/datetimepicker/time.d.ts +130 -0
- package/datetimepicker/time.scss +78 -0
- package/esm2020/alert/alert.component.mjs +5 -5
- package/esm2020/core/datetime/datetime-adapter.mjs +1 -1
- package/esm2020/datetimepicker/calendar-body.mjs +3 -3
- package/esm2020/datetimepicker/calendar.mjs +81 -33
- package/esm2020/datetimepicker/clock.mjs +14 -8
- package/esm2020/datetimepicker/datetimepicker-intl.mjs +63 -0
- package/esm2020/datetimepicker/datetimepicker-module.mjs +8 -1
- package/esm2020/datetimepicker/datetimepicker-toggle.mjs +9 -6
- package/esm2020/datetimepicker/datetimepicker-types.mjs +1 -1
- package/esm2020/datetimepicker/datetimepicker.mjs +50 -19
- package/esm2020/datetimepicker/public-api.mjs +2 -1
- package/esm2020/datetimepicker/time.mjs +453 -0
- package/esm2020/grid/cell.component.mjs +1 -1
- package/esm2020/grid/grid.component.mjs +84 -23
- package/esm2020/grid/grid.interface.mjs +1 -1
- package/esm2020/loader/loader.component.mjs +10 -4
- package/esm2020/progress/progress.component.mjs +5 -5
- package/fesm2015/mtxAlert.mjs +4 -4
- package/fesm2015/mtxAlert.mjs.map +1 -1
- package/fesm2015/mtxCore.mjs.map +1 -1
- package/fesm2015/mtxDatetimepicker.mjs +663 -65
- package/fesm2015/mtxDatetimepicker.mjs.map +1 -1
- package/fesm2015/mtxGrid.mjs +83 -22
- package/fesm2015/mtxGrid.mjs.map +1 -1
- package/fesm2015/mtxLoader.mjs +9 -3
- package/fesm2015/mtxLoader.mjs.map +1 -1
- package/fesm2015/mtxProgress.mjs +4 -4
- package/fesm2015/mtxProgress.mjs.map +1 -1
- package/fesm2020/mtxAlert.mjs +4 -4
- package/fesm2020/mtxAlert.mjs.map +1 -1
- package/fesm2020/mtxCore.mjs.map +1 -1
- package/fesm2020/mtxDatetimepicker.mjs +660 -65
- package/fesm2020/mtxDatetimepicker.mjs.map +1 -1
- package/fesm2020/mtxGrid.mjs +83 -22
- package/fesm2020/mtxGrid.mjs.map +1 -1
- package/fesm2020/mtxLoader.mjs +9 -3
- package/fesm2020/mtxLoader.mjs.map +1 -1
- package/fesm2020/mtxProgress.mjs +4 -4
- package/fesm2020/mtxProgress.mjs.map +1 -1
- package/grid/cell.component.d.ts +1 -1
- package/grid/grid.component.d.ts +89 -11
- package/grid/grid.interface.d.ts +2 -2
- package/loader/loader.component.d.ts +9 -3
- package/package.json +1 -1
- 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,
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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: [{
|
|
@@ -364,6 +363,66 @@ function euclideanModulo(a, b) {
|
|
|
364
363
|
return ((a % b) + b) % b;
|
|
365
364
|
}
|
|
366
365
|
|
|
366
|
+
class MtxDatetimepickerIntl {
|
|
367
|
+
constructor() {
|
|
368
|
+
/**
|
|
369
|
+
* Stream to emit from when labels are changed. Use this to notify components when the labels have
|
|
370
|
+
* changed after initialization.
|
|
371
|
+
*/
|
|
372
|
+
this.changes = new Subject();
|
|
373
|
+
/** A label for the calendar popup (used by screen readers). */
|
|
374
|
+
this.calendarLabel = 'Calendar';
|
|
375
|
+
/** A label for the button used to open the calendar popup (used by screen readers). */
|
|
376
|
+
this.openCalendarLabel = 'Open calendar';
|
|
377
|
+
/** Label for the button used to close the calendar popup. */
|
|
378
|
+
this.closeCalendarLabel = 'Close calendar';
|
|
379
|
+
/** A label for the previous month button (used by screen readers). */
|
|
380
|
+
this.prevMonthLabel = 'Previous month';
|
|
381
|
+
/** A label for the next month button (used by screen readers). */
|
|
382
|
+
this.nextMonthLabel = 'Next month';
|
|
383
|
+
/** A label for the previous year button (used by screen readers). */
|
|
384
|
+
this.prevYearLabel = 'Previous year';
|
|
385
|
+
/** A label for the next year button (used by screen readers). */
|
|
386
|
+
this.nextYearLabel = 'Next year';
|
|
387
|
+
/** A label for the previous multi-year button (used by screen readers). */
|
|
388
|
+
this.prevMultiYearLabel = 'Previous 24 years';
|
|
389
|
+
/** A label for the next multi-year button (used by screen readers). */
|
|
390
|
+
this.nextMultiYearLabel = 'Next 24 years';
|
|
391
|
+
/** A label for the 'switch to month view' button (used by screen readers). */
|
|
392
|
+
this.switchToMonthViewLabel = 'Choose date';
|
|
393
|
+
/** A label for the 'switch to year view' button (used by screen readers). */
|
|
394
|
+
this.switchToYearViewLabel = 'Choose month';
|
|
395
|
+
/** A label for the 'switch to multi-year view' button (used by screen readers). */
|
|
396
|
+
this.switchToMultiYearViewLabel = 'Choose month and year';
|
|
397
|
+
/** A label for the first date of a range of dates (used by screen readers). */
|
|
398
|
+
this.startDateLabel = 'Start date';
|
|
399
|
+
/** A label for the last date of a range of dates (used by screen readers). */
|
|
400
|
+
this.endDateLabel = 'End date';
|
|
401
|
+
/** A label for the 'switch to clock hour view' button (used by screen readers). */
|
|
402
|
+
this.switchToClockHourViewLabel = 'Choose hour';
|
|
403
|
+
/** A label for the 'switch to clock minute view' button (used by screen readers). */
|
|
404
|
+
this.switchToClockMinuteViewLabel = 'Choose minute';
|
|
405
|
+
/** Label used for ok button within the manual time input. */
|
|
406
|
+
this.okLabel = 'OK';
|
|
407
|
+
/** Label used for cancel button within the manual time input. */
|
|
408
|
+
this.cancelLabel = 'Cancel';
|
|
409
|
+
}
|
|
410
|
+
/** Formats a range of years (used for visuals). */
|
|
411
|
+
formatYearRange(start, end) {
|
|
412
|
+
return `${start} \u2013 ${end}`;
|
|
413
|
+
}
|
|
414
|
+
/** Formats a label for a range of years (used by screen readers). */
|
|
415
|
+
formatYearRangeLabel(start, end) {
|
|
416
|
+
return `${start} to ${end}`;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
/** @nocollapse */ MtxDatetimepickerIntl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
420
|
+
/** @nocollapse */ MtxDatetimepickerIntl.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerIntl, providedIn: 'root' });
|
|
421
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerIntl, decorators: [{
|
|
422
|
+
type: Injectable,
|
|
423
|
+
args: [{ providedIn: 'root' }]
|
|
424
|
+
}] });
|
|
425
|
+
|
|
367
426
|
const CLOCK_RADIUS = 50;
|
|
368
427
|
const CLOCK_INNER_RADIUS = 27.5;
|
|
369
428
|
const CLOCK_OUTER_RADIUS = 41.25;
|
|
@@ -373,9 +432,10 @@ const CLOCK_TICK_RADIUS = 7.0833;
|
|
|
373
432
|
* @docs-private
|
|
374
433
|
*/
|
|
375
434
|
class MtxClock {
|
|
376
|
-
constructor(_element, _adapter) {
|
|
435
|
+
constructor(_element, _adapter, _cdr) {
|
|
377
436
|
this._element = _element;
|
|
378
437
|
this._adapter = _adapter;
|
|
438
|
+
this._cdr = _cdr;
|
|
379
439
|
/** Step over minutes. */
|
|
380
440
|
this.interval = 1;
|
|
381
441
|
/** Whether the clock uses 12 hour format. */
|
|
@@ -481,8 +541,12 @@ class MtxClock {
|
|
|
481
541
|
this.setTime(event);
|
|
482
542
|
document.addEventListener('mousemove', this.mouseMoveListener);
|
|
483
543
|
document.addEventListener('touchmove', this.mouseMoveListener);
|
|
484
|
-
document.addEventListener('mouseup', this.mouseUpListener
|
|
485
|
-
|
|
544
|
+
document.addEventListener('mouseup', this.mouseUpListener, {
|
|
545
|
+
passive: true,
|
|
546
|
+
});
|
|
547
|
+
document.addEventListener('touchend', this.mouseUpListener, {
|
|
548
|
+
passive: true,
|
|
549
|
+
});
|
|
486
550
|
}
|
|
487
551
|
_handleMousemove(event) {
|
|
488
552
|
event.preventDefault();
|
|
@@ -602,19 +666,20 @@ class MtxClock {
|
|
|
602
666
|
}
|
|
603
667
|
this._timeChanged = true;
|
|
604
668
|
this.activeDate = date;
|
|
669
|
+
this._cdr.markForCheck();
|
|
605
670
|
this.activeDateChange.emit(this.activeDate);
|
|
606
671
|
}
|
|
607
672
|
}
|
|
608
|
-
/** @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 });
|
|
609
|
-
/** @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-
|
|
673
|
+
/** @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 });
|
|
674
|
+
/** @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 });
|
|
610
675
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxClock, decorators: [{
|
|
611
676
|
type: Component,
|
|
612
677
|
args: [{ selector: 'mtx-clock', host: {
|
|
613
678
|
'[class.mtx-clock]': 'true',
|
|
614
679
|
'role': 'clock',
|
|
615
680
|
'(mousedown)': '_handleMousedown($event)',
|
|
616
|
-
}, 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-
|
|
617
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter }]; }, propDecorators: { dateFilter: [{
|
|
681
|
+
}, 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"] }]
|
|
682
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { dateFilter: [{
|
|
618
683
|
type: Input
|
|
619
684
|
}], interval: [{
|
|
620
685
|
type: Input
|
|
@@ -638,6 +703,453 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
638
703
|
type: Input
|
|
639
704
|
}] } });
|
|
640
705
|
|
|
706
|
+
function pad(num, size) {
|
|
707
|
+
num = String(num);
|
|
708
|
+
while (num.length < size)
|
|
709
|
+
num = '0' + num;
|
|
710
|
+
return num;
|
|
711
|
+
}
|
|
712
|
+
class MtxTimeInput {
|
|
713
|
+
constructor(element, cdr) {
|
|
714
|
+
this.element = element;
|
|
715
|
+
this.cdr = cdr;
|
|
716
|
+
this._interval = 1;
|
|
717
|
+
this._min = 0;
|
|
718
|
+
this._max = Infinity;
|
|
719
|
+
this.timeValueChanged = new EventEmitter();
|
|
720
|
+
this.keyDownListener = this.keyDownHandler.bind(this);
|
|
721
|
+
this.keyPressListener = this.keyPressHandler.bind(this);
|
|
722
|
+
this.inputEventListener = this.inputChangedHandler.bind(this);
|
|
723
|
+
this.inputElement.addEventListener('keydown', this.keyDownListener, {
|
|
724
|
+
passive: true,
|
|
725
|
+
});
|
|
726
|
+
// Do not passive since we want to be able to preventDefault()
|
|
727
|
+
this.inputElement.addEventListener('keypress', this.keyPressListener);
|
|
728
|
+
this.inputElement.addEventListener('input', this.inputEventListener, {
|
|
729
|
+
passive: true,
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
set timeInterval(value) {
|
|
733
|
+
this._interval = coerceNumberProperty(value);
|
|
734
|
+
}
|
|
735
|
+
set timeMin(value) {
|
|
736
|
+
this._min = coerceNumberProperty(value);
|
|
737
|
+
}
|
|
738
|
+
set timeMax(value) {
|
|
739
|
+
this._max = coerceNumberProperty(value);
|
|
740
|
+
}
|
|
741
|
+
set timeValue(value) {
|
|
742
|
+
this._value = coerceNumberProperty(value);
|
|
743
|
+
if (!this.hasFocus) {
|
|
744
|
+
this.writeValue(this._value);
|
|
745
|
+
}
|
|
746
|
+
this.writePlaceholder(this._value);
|
|
747
|
+
}
|
|
748
|
+
get hasFocus() {
|
|
749
|
+
var _a;
|
|
750
|
+
return this.element.nativeElement && ((_a = this.element) === null || _a === void 0 ? void 0 : _a.nativeElement) === (document === null || document === void 0 ? void 0 : document.activeElement);
|
|
751
|
+
}
|
|
752
|
+
get inputElement() {
|
|
753
|
+
return this.element.nativeElement;
|
|
754
|
+
}
|
|
755
|
+
// We look here at the placeholder value, because we write '' into the value on focus
|
|
756
|
+
// placeholder should always be up to date with "currentValue"
|
|
757
|
+
get valid() {
|
|
758
|
+
// At the start _value is undefined therefore this would result in not valid and
|
|
759
|
+
// make a ugly warning border afterwards we can safely check
|
|
760
|
+
if (this._value) {
|
|
761
|
+
const currentValue = String(this.inputElement.value);
|
|
762
|
+
// It can be that currentValue is empty due to we removing the value on focus,
|
|
763
|
+
// if that is the case we should check previous value which should be in the placeholder
|
|
764
|
+
if (currentValue.length) {
|
|
765
|
+
return this._value == this.inputElement.value;
|
|
766
|
+
}
|
|
767
|
+
else {
|
|
768
|
+
return this._value == this.inputElement.placeholder;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
return true;
|
|
772
|
+
}
|
|
773
|
+
get invalid() {
|
|
774
|
+
return !this.valid;
|
|
775
|
+
}
|
|
776
|
+
blur() {
|
|
777
|
+
this.writeValue(this._value);
|
|
778
|
+
this.writePlaceholder(this._value);
|
|
779
|
+
this.timeValueChanged.emit(this._value);
|
|
780
|
+
}
|
|
781
|
+
focus() {
|
|
782
|
+
this.writeValue('');
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Write value to inputElement
|
|
786
|
+
* @param value NumberInput
|
|
787
|
+
*/
|
|
788
|
+
writeValue(value) {
|
|
789
|
+
if (value !== '') {
|
|
790
|
+
this.inputElement.value = pad(value, 2);
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
this.inputElement.value = '';
|
|
794
|
+
}
|
|
795
|
+
this.cdr.markForCheck();
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Writes value to placeholder
|
|
799
|
+
* @param value NumberInput
|
|
800
|
+
*/
|
|
801
|
+
writePlaceholder(value) {
|
|
802
|
+
this.inputElement.placeholder = pad(value, 2);
|
|
803
|
+
this.cdr.markForCheck();
|
|
804
|
+
}
|
|
805
|
+
keyDownHandler(event) {
|
|
806
|
+
if (String(this.inputElement.value).length > 0) {
|
|
807
|
+
let value = null;
|
|
808
|
+
if (event.keyCode === UP_ARROW) {
|
|
809
|
+
value = coerceNumberProperty(this._value);
|
|
810
|
+
value += this._interval;
|
|
811
|
+
event.stopPropagation();
|
|
812
|
+
}
|
|
813
|
+
else if (event.keyCode === DOWN_ARROW) {
|
|
814
|
+
value = coerceNumberProperty(this._value);
|
|
815
|
+
value -= this._interval;
|
|
816
|
+
event.stopPropagation();
|
|
817
|
+
}
|
|
818
|
+
// if value has changed
|
|
819
|
+
if (typeof value === 'number') {
|
|
820
|
+
this.writeValue(value);
|
|
821
|
+
this.writePlaceholder(value);
|
|
822
|
+
this.clampInputValue();
|
|
823
|
+
this.timeValueChanged.emit(this._value);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* Prevent non number inputs in the inputElement with the exception of Enter/BackSpace
|
|
829
|
+
* @param event KeyboardEvent
|
|
830
|
+
*/
|
|
831
|
+
keyPressHandler(event) {
|
|
832
|
+
var _a;
|
|
833
|
+
const key = (_a = event === null || event === void 0 ? void 0 : event.key) !== null && _a !== void 0 ? _a : null;
|
|
834
|
+
if (isNaN(Number(key)) && key !== 'Enter') {
|
|
835
|
+
event.preventDefault();
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
inputChangedHandler() {
|
|
839
|
+
this.clampInputValue();
|
|
840
|
+
this.timeValueChanged.emit(this._value);
|
|
841
|
+
}
|
|
842
|
+
clampInputValue() {
|
|
843
|
+
var _a, _b, _c;
|
|
844
|
+
if (((_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value) === '') {
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
const value = coerceNumberProperty((_c = (_b = this.inputElement) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null);
|
|
848
|
+
if (value) {
|
|
849
|
+
const clampedValue = Math.min(Math.max(value, this._min), this._max);
|
|
850
|
+
if (clampedValue !== value) {
|
|
851
|
+
this.writeValue(clampedValue);
|
|
852
|
+
this.writePlaceholder(clampedValue);
|
|
853
|
+
}
|
|
854
|
+
this._value = clampedValue;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Remove event listeners on destruction
|
|
859
|
+
*/
|
|
860
|
+
ngOnDestroy() {
|
|
861
|
+
this.inputElement.removeEventListener('keydown', this.keyDownListener);
|
|
862
|
+
this.inputElement.removeEventListener('keypress', this.keyPressListener);
|
|
863
|
+
this.inputElement.removeEventListener('input', this.inputEventListener);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
/** @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 });
|
|
867
|
+
/** @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 });
|
|
868
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxTimeInput, decorators: [{
|
|
869
|
+
type: Directive,
|
|
870
|
+
args: [{
|
|
871
|
+
selector: 'input.mtx-time-input',
|
|
872
|
+
host: {
|
|
873
|
+
'(blur)': 'blur($event)',
|
|
874
|
+
'(focus)': 'focus($event)',
|
|
875
|
+
},
|
|
876
|
+
exportAs: 'mtxTimeInput',
|
|
877
|
+
}]
|
|
878
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { timeInterval: [{
|
|
879
|
+
type: Input,
|
|
880
|
+
args: ['timeInterval']
|
|
881
|
+
}], timeMin: [{
|
|
882
|
+
type: Input,
|
|
883
|
+
args: ['timeMin']
|
|
884
|
+
}], timeMax: [{
|
|
885
|
+
type: Input,
|
|
886
|
+
args: ['timeMax']
|
|
887
|
+
}], timeValue: [{
|
|
888
|
+
type: Input,
|
|
889
|
+
args: ['timeValue']
|
|
890
|
+
}], timeValueChanged: [{
|
|
891
|
+
type: Output
|
|
892
|
+
}] } });
|
|
893
|
+
class MtxTime {
|
|
894
|
+
constructor(_adapter, _changeDetectorRef, _datetimepickerIntl) {
|
|
895
|
+
this._adapter = _adapter;
|
|
896
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
897
|
+
this._datetimepickerIntl = _datetimepickerIntl;
|
|
898
|
+
/** Emits when the currently selected date changes. */
|
|
899
|
+
this.selectedChange = new EventEmitter();
|
|
900
|
+
/** Emits when any date changes. */
|
|
901
|
+
this.activeDateChange = new EventEmitter();
|
|
902
|
+
/** Emits when any date is selected. */
|
|
903
|
+
this._userSelection = new EventEmitter();
|
|
904
|
+
/** Emits when AM/PM button are clicked. */
|
|
905
|
+
this.ampmChange = new EventEmitter();
|
|
906
|
+
/** Emits when AM/PM button are clicked. */
|
|
907
|
+
this.clockViewChange = new EventEmitter();
|
|
908
|
+
/** Step over minutes. */
|
|
909
|
+
this.interval = 1;
|
|
910
|
+
this._twelvehour = false;
|
|
911
|
+
/** Whether the time is now in AM or PM. */
|
|
912
|
+
this.AMPM = 'AM';
|
|
913
|
+
/** Whether the clock is in hour view. */
|
|
914
|
+
this._clockView = 'hour';
|
|
915
|
+
this.datetimepickerIntlChangesSubscription = this._datetimepickerIntl.changes.subscribe(() => {
|
|
916
|
+
this._changeDetectorRef.detectChanges();
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
/** Whether the clock uses 12 hour format. */
|
|
920
|
+
get twelvehour() {
|
|
921
|
+
return this._twelvehour;
|
|
922
|
+
}
|
|
923
|
+
set twelvehour(value) {
|
|
924
|
+
this._twelvehour = coerceBooleanProperty(value);
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* The date to display in this clock view.
|
|
928
|
+
*/
|
|
929
|
+
get activeDate() {
|
|
930
|
+
return this._activeDate;
|
|
931
|
+
}
|
|
932
|
+
set activeDate(value) {
|
|
933
|
+
this._activeDate = this._adapter.clampDate(value, this.minDate, this.maxDate);
|
|
934
|
+
}
|
|
935
|
+
/** The currently selected date. */
|
|
936
|
+
get selected() {
|
|
937
|
+
return this._selected;
|
|
938
|
+
}
|
|
939
|
+
set selected(value) {
|
|
940
|
+
this._selected = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
|
|
941
|
+
if (this._selected) {
|
|
942
|
+
this.activeDate = this._selected;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
/** The minimum selectable date. */
|
|
946
|
+
get minDate() {
|
|
947
|
+
return this._minDate;
|
|
948
|
+
}
|
|
949
|
+
set minDate(value) {
|
|
950
|
+
this._minDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
|
|
951
|
+
}
|
|
952
|
+
/** The maximum selectable date. */
|
|
953
|
+
get maxDate() {
|
|
954
|
+
return this._maxDate;
|
|
955
|
+
}
|
|
956
|
+
set maxDate(value) {
|
|
957
|
+
this._maxDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
|
|
958
|
+
}
|
|
959
|
+
/** Whether the clock should be started in hour or minute view. */
|
|
960
|
+
get clockView() {
|
|
961
|
+
return this._clockView;
|
|
962
|
+
}
|
|
963
|
+
set clockView(value) {
|
|
964
|
+
this._clockView = value;
|
|
965
|
+
}
|
|
966
|
+
get isHourView() {
|
|
967
|
+
return this._clockView === 'hour';
|
|
968
|
+
}
|
|
969
|
+
get isMinuteView() {
|
|
970
|
+
return this._clockView === 'hour';
|
|
971
|
+
}
|
|
972
|
+
get hour() {
|
|
973
|
+
if (!this.activeDate) {
|
|
974
|
+
if (this.twelvehour) {
|
|
975
|
+
return '12';
|
|
976
|
+
}
|
|
977
|
+
else {
|
|
978
|
+
return '00';
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
const hour = Number(this._adapter.getHour(this.activeDate));
|
|
982
|
+
if (!this.twelvehour) {
|
|
983
|
+
return this.prefixWithZero(hour);
|
|
984
|
+
}
|
|
985
|
+
if (hour === 0) {
|
|
986
|
+
return '12';
|
|
987
|
+
}
|
|
988
|
+
else {
|
|
989
|
+
return this.prefixWithZero(hour > 12 ? hour - 12 : hour);
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
get minute() {
|
|
993
|
+
if (this.activeDate) {
|
|
994
|
+
return this.prefixWithZero(this._adapter.getMinute(this.activeDate));
|
|
995
|
+
}
|
|
996
|
+
return '00';
|
|
997
|
+
}
|
|
998
|
+
prefixWithZero(value) {
|
|
999
|
+
if (value < 10) {
|
|
1000
|
+
return '0' + String(value);
|
|
1001
|
+
}
|
|
1002
|
+
return String(value);
|
|
1003
|
+
}
|
|
1004
|
+
ngOnChanges(changes) {
|
|
1005
|
+
// when clockView changes by input we should focus the correct input
|
|
1006
|
+
if (changes.clockView) {
|
|
1007
|
+
if (changes.clockView.currentValue !== changes.clockView.previousValue) {
|
|
1008
|
+
this.focusInputElement();
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
ngAfterViewInit() {
|
|
1013
|
+
this.focusInputElement();
|
|
1014
|
+
}
|
|
1015
|
+
focusInputElement() {
|
|
1016
|
+
if (this.clockView === 'hour') {
|
|
1017
|
+
if (this.hourInputElement) {
|
|
1018
|
+
this.hourInputElement.nativeElement.focus();
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
else {
|
|
1022
|
+
if (this.minuteInputElement) {
|
|
1023
|
+
this.minuteInputElement.nativeElement.focus();
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
handleHourInputChange(value) {
|
|
1028
|
+
const hour = coerceNumberProperty(value);
|
|
1029
|
+
if (hour || hour === 0) {
|
|
1030
|
+
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));
|
|
1031
|
+
this._activeDate = this._adapter.clampDate(newValue, this.minDate, this.maxDate);
|
|
1032
|
+
this.activeDateChange.emit(this.activeDate);
|
|
1033
|
+
// If previously we did set [mtxValue]="13" and the input changed to 6, and the clamping will make it "13" again
|
|
1034
|
+
// then the hourInputDirective will not have been updated since "13" === "13" same reference so no change detected
|
|
1035
|
+
// by directly setting it within this handler, we handle this usecase
|
|
1036
|
+
if (this.hourInputDirective) {
|
|
1037
|
+
this.hourInputDirective.timeValue = this.hour;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
updateHourForAmPm(value) {
|
|
1042
|
+
if (!this.twelvehour) {
|
|
1043
|
+
return value;
|
|
1044
|
+
}
|
|
1045
|
+
// value should be between 1-12
|
|
1046
|
+
if (this.AMPM === 'AM') {
|
|
1047
|
+
if (value === 0 || value === 12) {
|
|
1048
|
+
return 0;
|
|
1049
|
+
}
|
|
1050
|
+
return value;
|
|
1051
|
+
}
|
|
1052
|
+
// PM
|
|
1053
|
+
else {
|
|
1054
|
+
if (value === 0 || value === 12) {
|
|
1055
|
+
return 12;
|
|
1056
|
+
}
|
|
1057
|
+
// other cases, we should add 12 to the value aka 3:00 PM = 3 + 12 = 15:00
|
|
1058
|
+
return value + 12;
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
handleMinuteInputChange(value) {
|
|
1062
|
+
const minute = coerceNumberProperty(value);
|
|
1063
|
+
if (minute || minute === 0) {
|
|
1064
|
+
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);
|
|
1065
|
+
this._activeDate = this._adapter.clampDate(newValue, this.minDate, this.maxDate);
|
|
1066
|
+
this.activeDateChange.emit(this.activeDate);
|
|
1067
|
+
// If previously we did set [mtxValue]="40" and the input changed to 30, and the clamping will make it "40" again
|
|
1068
|
+
// then the minuteInputDirective will not have been updated since "40" === "40" same reference so no change detected
|
|
1069
|
+
// by directly setting it within this handler, we handle this usecase
|
|
1070
|
+
if (this.minuteInputDirective) {
|
|
1071
|
+
this.minuteInputDirective.timeValue = this.minute;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
handleFocus(clockView) {
|
|
1076
|
+
this.clockView = clockView;
|
|
1077
|
+
this.clockViewChange.emit(clockView);
|
|
1078
|
+
}
|
|
1079
|
+
_timeSelected(date) {
|
|
1080
|
+
if (this.clockView === 'hour') {
|
|
1081
|
+
this.clockView = 'minute';
|
|
1082
|
+
}
|
|
1083
|
+
this._activeDate = this.selected = date;
|
|
1084
|
+
}
|
|
1085
|
+
_onActiveDateChange(date) {
|
|
1086
|
+
this._activeDate = date;
|
|
1087
|
+
this.activeDateChange.emit(date);
|
|
1088
|
+
}
|
|
1089
|
+
handleOk() {
|
|
1090
|
+
if (this._selected) {
|
|
1091
|
+
this.selectedChange.emit(this._selected);
|
|
1092
|
+
}
|
|
1093
|
+
this._userSelection.emit();
|
|
1094
|
+
}
|
|
1095
|
+
handleCancel() {
|
|
1096
|
+
this._userSelection.emit();
|
|
1097
|
+
}
|
|
1098
|
+
ngOnDestroy() {
|
|
1099
|
+
if (this.datetimepickerIntlChangesSubscription) {
|
|
1100
|
+
this.datetimepickerIntlChangesSubscription.unsubscribe();
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
/** @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 });
|
|
1105
|
+
/** @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 });
|
|
1106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxTime, decorators: [{
|
|
1107
|
+
type: Component,
|
|
1108
|
+
args: [{ selector: 'mtx-time', exportAs: 'mtxTime', host: {
|
|
1109
|
+
class: 'mtx-time',
|
|
1110
|
+
}, 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"] }]
|
|
1111
|
+
}], ctorParameters: function () { return [{ type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }, { type: MtxDatetimepickerIntl }]; }, propDecorators: { selectedChange: [{
|
|
1112
|
+
type: Output
|
|
1113
|
+
}], activeDateChange: [{
|
|
1114
|
+
type: Output
|
|
1115
|
+
}], _userSelection: [{
|
|
1116
|
+
type: Output
|
|
1117
|
+
}], ampmChange: [{
|
|
1118
|
+
type: Output
|
|
1119
|
+
}], clockViewChange: [{
|
|
1120
|
+
type: Output
|
|
1121
|
+
}], dateFilter: [{
|
|
1122
|
+
type: Input
|
|
1123
|
+
}], interval: [{
|
|
1124
|
+
type: Input
|
|
1125
|
+
}], hourInputElement: [{
|
|
1126
|
+
type: ViewChild,
|
|
1127
|
+
args: ['hourInput', { read: (ElementRef) }]
|
|
1128
|
+
}], hourInputDirective: [{
|
|
1129
|
+
type: ViewChild,
|
|
1130
|
+
args: ['hourInput', { read: MtxTimeInput }]
|
|
1131
|
+
}], minuteInputElement: [{
|
|
1132
|
+
type: ViewChild,
|
|
1133
|
+
args: ['minuteInput', { read: (ElementRef) }]
|
|
1134
|
+
}], minuteInputDirective: [{
|
|
1135
|
+
type: ViewChild,
|
|
1136
|
+
args: ['minuteInput', { read: MtxTimeInput }]
|
|
1137
|
+
}], twelvehour: [{
|
|
1138
|
+
type: Input
|
|
1139
|
+
}], AMPM: [{
|
|
1140
|
+
type: Input
|
|
1141
|
+
}], activeDate: [{
|
|
1142
|
+
type: Input
|
|
1143
|
+
}], selected: [{
|
|
1144
|
+
type: Input
|
|
1145
|
+
}], minDate: [{
|
|
1146
|
+
type: Input
|
|
1147
|
+
}], maxDate: [{
|
|
1148
|
+
type: Input
|
|
1149
|
+
}], clockView: [{
|
|
1150
|
+
type: Input
|
|
1151
|
+
}] } });
|
|
1152
|
+
|
|
641
1153
|
const DAYS_PER_WEEK = 7;
|
|
642
1154
|
/**
|
|
643
1155
|
* An internal component used to display a single month in the datetimepicker.
|
|
@@ -916,7 +1428,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
916
1428
|
* @docs-private
|
|
917
1429
|
*/
|
|
918
1430
|
class MtxCalendar {
|
|
919
|
-
constructor(_elementRef, _intl, _ngZone, _adapter, _dateFormats,
|
|
1431
|
+
constructor(_elementRef, _intl, _ngZone, _adapter, _dateFormats, _changeDetectorRef) {
|
|
920
1432
|
this._elementRef = _elementRef;
|
|
921
1433
|
this._intl = _intl;
|
|
922
1434
|
this._ngZone = _ngZone;
|
|
@@ -937,6 +1449,7 @@ class MtxCalendar {
|
|
|
937
1449
|
this._userSelection = new EventEmitter();
|
|
938
1450
|
this._clockView = 'hour';
|
|
939
1451
|
this._type = 'date';
|
|
1452
|
+
this._timeInput = false;
|
|
940
1453
|
/** Date filter for the month and year views. */
|
|
941
1454
|
this._dateFilterForViews = (date) => {
|
|
942
1455
|
return (!!date &&
|
|
@@ -950,7 +1463,7 @@ class MtxCalendar {
|
|
|
950
1463
|
if (!this._dateFormats) {
|
|
951
1464
|
throw createMissingDateImplError('MTX_DATETIME_FORMATS');
|
|
952
1465
|
}
|
|
953
|
-
this._intlChanges = _intl.changes.subscribe(() =>
|
|
1466
|
+
this._intlChanges = _intl.changes.subscribe(() => _changeDetectorRef.markForCheck());
|
|
954
1467
|
}
|
|
955
1468
|
/** Whether to show multi-year view. */
|
|
956
1469
|
get multiYearSelector() {
|
|
@@ -983,6 +1496,17 @@ class MtxCalendar {
|
|
|
983
1496
|
set startAt(value) {
|
|
984
1497
|
this._startAt = this._adapter.getValidDateOrNull(value);
|
|
985
1498
|
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Whether the calendar is in time mode. In time mode the calendar clock gets time input elements rather then just clock
|
|
1501
|
+
*
|
|
1502
|
+
* When touchUi is enabled this will be disabled
|
|
1503
|
+
*/
|
|
1504
|
+
get timeInput() {
|
|
1505
|
+
return this._timeInput;
|
|
1506
|
+
}
|
|
1507
|
+
set timeInput(value) {
|
|
1508
|
+
this._timeInput = coerceBooleanProperty(value);
|
|
1509
|
+
}
|
|
986
1510
|
/** The currently selected date. */
|
|
987
1511
|
get selected() {
|
|
988
1512
|
return this._selected;
|
|
@@ -1034,11 +1558,7 @@ class MtxCalendar {
|
|
|
1034
1558
|
this._currentView = view;
|
|
1035
1559
|
this.viewChanged.emit(view);
|
|
1036
1560
|
}
|
|
1037
|
-
|
|
1038
|
-
get _yearLabel() {
|
|
1039
|
-
return this._adapter.getYearName(this._activeDate);
|
|
1040
|
-
}
|
|
1041
|
-
get _monthYearLabel() {
|
|
1561
|
+
get _yearPeriodText() {
|
|
1042
1562
|
if (this.currentView === 'multi-year') {
|
|
1043
1563
|
// The offset from the active year to the "slot" for the starting year is the
|
|
1044
1564
|
// *actual* first rendered year in the multi-year view, and the last year is
|
|
@@ -1054,7 +1574,15 @@ class MtxCalendar {
|
|
|
1054
1574
|
? this._adapter.getMonthNames('long')[this._adapter.getMonth(this._activeDate)]
|
|
1055
1575
|
: this._adapter.getYearName(this._activeDate);
|
|
1056
1576
|
}
|
|
1057
|
-
get
|
|
1577
|
+
get _yearButtonText() {
|
|
1578
|
+
return this._adapter.getYearName(this._activeDate);
|
|
1579
|
+
}
|
|
1580
|
+
get _yearButtonLabel() {
|
|
1581
|
+
return this.multiYearSelector
|
|
1582
|
+
? this._intl.switchToMultiYearViewLabel
|
|
1583
|
+
: this._intl.switchToYearViewLabel;
|
|
1584
|
+
}
|
|
1585
|
+
get _dateButtonText() {
|
|
1058
1586
|
switch (this.type) {
|
|
1059
1587
|
case 'month':
|
|
1060
1588
|
return this._adapter.getMonthNames('long')[this._adapter.getMonth(this._activeDate)];
|
|
@@ -1062,7 +1590,10 @@ class MtxCalendar {
|
|
|
1062
1590
|
return this._adapter.format(this._activeDate, this._dateFormats.display.popupHeaderDateLabel);
|
|
1063
1591
|
}
|
|
1064
1592
|
}
|
|
1065
|
-
get
|
|
1593
|
+
get _dateButtonLabel() {
|
|
1594
|
+
return this._intl.switchToMonthViewLabel;
|
|
1595
|
+
}
|
|
1596
|
+
get _hoursButtonText() {
|
|
1066
1597
|
let hour = this._adapter.getHour(this._activeDate);
|
|
1067
1598
|
if (this.twelvehour) {
|
|
1068
1599
|
if (hour === 0) {
|
|
@@ -1072,29 +1603,35 @@ class MtxCalendar {
|
|
|
1072
1603
|
}
|
|
1073
1604
|
return this._2digit(hour);
|
|
1074
1605
|
}
|
|
1075
|
-
get
|
|
1606
|
+
get _hourButtonLabel() {
|
|
1607
|
+
return this._intl.switchToClockHourViewLabel;
|
|
1608
|
+
}
|
|
1609
|
+
get _minutesButtonText() {
|
|
1076
1610
|
return this._2digit(this._adapter.getMinute(this._activeDate));
|
|
1077
1611
|
}
|
|
1078
|
-
get
|
|
1612
|
+
get _minuteButtonLabel() {
|
|
1613
|
+
return this._intl.switchToClockMinuteViewLabel;
|
|
1614
|
+
}
|
|
1615
|
+
get _prevButtonLabel() {
|
|
1079
1616
|
switch (this._currentView) {
|
|
1080
1617
|
case 'month':
|
|
1081
|
-
return this._intl.
|
|
1618
|
+
return this._intl.prevMonthLabel;
|
|
1082
1619
|
case 'year':
|
|
1083
|
-
return this._intl.
|
|
1620
|
+
return this._intl.prevYearLabel;
|
|
1084
1621
|
case 'multi-year':
|
|
1085
|
-
return this._intl.
|
|
1622
|
+
return this._intl.prevMultiYearLabel;
|
|
1086
1623
|
default:
|
|
1087
1624
|
return '';
|
|
1088
1625
|
}
|
|
1089
1626
|
}
|
|
1090
|
-
get
|
|
1627
|
+
get _nextButtonLabel() {
|
|
1091
1628
|
switch (this._currentView) {
|
|
1092
1629
|
case 'month':
|
|
1093
|
-
return this._intl.
|
|
1630
|
+
return this._intl.nextMonthLabel;
|
|
1094
1631
|
case 'year':
|
|
1095
|
-
return this._intl.
|
|
1632
|
+
return this._intl.nextYearLabel;
|
|
1096
1633
|
case 'multi-year':
|
|
1097
|
-
return this._intl.
|
|
1634
|
+
return this._intl.nextMultiYearLabel;
|
|
1098
1635
|
default:
|
|
1099
1636
|
return '';
|
|
1100
1637
|
}
|
|
@@ -1161,6 +1698,12 @@ class MtxCalendar {
|
|
|
1161
1698
|
}
|
|
1162
1699
|
}
|
|
1163
1700
|
_timeSelected(date) {
|
|
1701
|
+
this._activeDate = this._updateDate(date);
|
|
1702
|
+
if (!this._adapter.sameDatetime(date, this.selected) || !this.preventSameDateTimeSelection) {
|
|
1703
|
+
this.selectedChange.emit(date);
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
_dialTimeSelected(date) {
|
|
1164
1707
|
if (this._clockView !== 'minute') {
|
|
1165
1708
|
this._activeDate = this._updateDate(date);
|
|
1166
1709
|
this._clockView = 'minute';
|
|
@@ -1189,7 +1732,8 @@ class MtxCalendar {
|
|
|
1189
1732
|
return date;
|
|
1190
1733
|
}
|
|
1191
1734
|
_selectAMPM(date) {
|
|
1192
|
-
|
|
1735
|
+
const hour = this._adapter.getHour(date);
|
|
1736
|
+
if (hour > 11) {
|
|
1193
1737
|
this._AMPM = 'PM';
|
|
1194
1738
|
}
|
|
1195
1739
|
else {
|
|
@@ -1197,16 +1741,22 @@ class MtxCalendar {
|
|
|
1197
1741
|
}
|
|
1198
1742
|
}
|
|
1199
1743
|
_ampmClicked(source) {
|
|
1744
|
+
this._currentView = 'clock';
|
|
1200
1745
|
if (source === this._AMPM) {
|
|
1201
1746
|
return;
|
|
1202
1747
|
}
|
|
1203
1748
|
this._AMPM = source;
|
|
1749
|
+
// if AMPM changed from PM to AM substract 12 hours
|
|
1750
|
+
const currentHour = this._adapter.getHour(this._activeDate);
|
|
1751
|
+
let newHourValue;
|
|
1204
1752
|
if (this._AMPM === 'AM') {
|
|
1205
|
-
|
|
1753
|
+
newHourValue = currentHour >= 12 ? this._adapter.getHour(this._activeDate) - 12 : 12;
|
|
1206
1754
|
}
|
|
1755
|
+
// otherwise add 12 hours
|
|
1207
1756
|
else {
|
|
1208
|
-
|
|
1757
|
+
newHourValue = (currentHour + 12) % 24;
|
|
1209
1758
|
}
|
|
1759
|
+
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));
|
|
1210
1760
|
}
|
|
1211
1761
|
_yearClicked() {
|
|
1212
1762
|
if (this.type === 'year' || this.multiYearSelector) {
|
|
@@ -1423,16 +1973,22 @@ class MtxCalendar {
|
|
|
1423
1973
|
this._activeDate =
|
|
1424
1974
|
this._clockView === 'hour'
|
|
1425
1975
|
? this._adapter.addCalendarHours(this._activeDate, 1)
|
|
1426
|
-
: this._adapter.addCalendarMinutes(this._activeDate,
|
|
1976
|
+
: this._adapter.addCalendarMinutes(this._activeDate, this.timeInterval);
|
|
1977
|
+
// if the hours changed the am/pm we should update the AM/PM
|
|
1978
|
+
this._selectAMPM(this._activeDate);
|
|
1427
1979
|
break;
|
|
1428
1980
|
case DOWN_ARROW:
|
|
1429
1981
|
this._activeDate =
|
|
1430
1982
|
this._clockView === 'hour'
|
|
1431
1983
|
? this._adapter.addCalendarHours(this._activeDate, -1)
|
|
1432
|
-
: this._adapter.addCalendarMinutes(this._activeDate, -
|
|
1984
|
+
: this._adapter.addCalendarMinutes(this._activeDate, -this.timeInterval);
|
|
1985
|
+
// if the hours changed the am/pm we should update the AM/PM
|
|
1986
|
+
this._selectAMPM(this._activeDate);
|
|
1433
1987
|
break;
|
|
1434
1988
|
case ENTER:
|
|
1435
|
-
|
|
1989
|
+
if (!this.timeInput) {
|
|
1990
|
+
this._dialTimeSelected(this._activeDate);
|
|
1991
|
+
}
|
|
1436
1992
|
return;
|
|
1437
1993
|
default:
|
|
1438
1994
|
// Don't prevent default or focus active cell on keys that we don't explicitly handle.
|
|
@@ -1468,17 +2024,18 @@ class MtxCalendar {
|
|
|
1468
2024
|
return ('00' + n).slice(-2);
|
|
1469
2025
|
}
|
|
1470
2026
|
}
|
|
1471
|
-
/** @nocollapse */ MtxCalendar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxCalendar, deps: [{ token: i0.ElementRef }, { token:
|
|
1472
|
-
/** @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 });
|
|
2027
|
+
/** @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 });
|
|
2028
|
+
/** @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 });
|
|
1473
2029
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxCalendar, decorators: [{
|
|
1474
2030
|
type: Component,
|
|
1475
2031
|
args: [{ selector: 'mtx-calendar', host: {
|
|
1476
2032
|
'class': 'mtx-calendar',
|
|
2033
|
+
'[class.mtx-calendar-with-time-input]': 'timeInput',
|
|
1477
2034
|
'tabindex': '0',
|
|
1478
2035
|
'(keydown)': '_handleCalendarBodyKeydown($event)',
|
|
1479
|
-
}, 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"] }]
|
|
2036
|
+
}, 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"] }]
|
|
1480
2037
|
}], ctorParameters: function () {
|
|
1481
|
-
return [{ type: i0.ElementRef }, { type:
|
|
2038
|
+
return [{ type: i0.ElementRef }, { type: MtxDatetimepickerIntl }, { type: i0.NgZone }, { type: i1.DatetimeAdapter, decorators: [{
|
|
1482
2039
|
type: Optional
|
|
1483
2040
|
}] }, { type: undefined, decorators: [{
|
|
1484
2041
|
type: Optional
|
|
@@ -1508,6 +2065,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1508
2065
|
type: Input
|
|
1509
2066
|
}], startAt: [{
|
|
1510
2067
|
type: Input
|
|
2068
|
+
}], timeInput: [{
|
|
2069
|
+
type: Input
|
|
1511
2070
|
}], selected: [{
|
|
1512
2071
|
type: Input
|
|
1513
2072
|
}], minDate: [{
|
|
@@ -1548,6 +2107,8 @@ class MtxDatetimepickerContent extends _MtxDatetimepickerContentBase {
|
|
|
1548
2107
|
this._changeDetectorRef = _changeDetectorRef;
|
|
1549
2108
|
/** Emits when an animation has finished. */
|
|
1550
2109
|
this._animationDone = new Subject();
|
|
2110
|
+
/** Id of the label for the `role="dialog"` element. */
|
|
2111
|
+
this._dialogLabelId = null;
|
|
1551
2112
|
}
|
|
1552
2113
|
ngOnInit() {
|
|
1553
2114
|
this._animationState = this.datetimepicker.touchUi ? 'enter-dialog' : 'enter-dropdown';
|
|
@@ -1564,7 +2125,7 @@ class MtxDatetimepickerContent extends _MtxDatetimepickerContentBase {
|
|
|
1564
2125
|
}
|
|
1565
2126
|
}
|
|
1566
2127
|
/** @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 });
|
|
1567
|
-
/** @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
|
|
2128
|
+
/** @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: [
|
|
1568
2129
|
mtxDatetimepickerAnimations.transformPanel,
|
|
1569
2130
|
mtxDatetimepickerAnimations.fadeInCalendar,
|
|
1570
2131
|
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
@@ -1579,7 +2140,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1579
2140
|
}, animations: [
|
|
1580
2141
|
mtxDatetimepickerAnimations.transformPanel,
|
|
1581
2142
|
mtxDatetimepickerAnimations.fadeInCalendar,
|
|
1582
|
-
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['color'], template: "<div cdkTrapFocus\n
|
|
2143
|
+
], 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"] }]
|
|
1583
2144
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { _calendar: [{
|
|
1584
2145
|
type: ViewChild,
|
|
1585
2146
|
args: [MtxCalendar, { static: true }]
|
|
@@ -1592,6 +2153,7 @@ class MtxDatetimepicker {
|
|
|
1592
2153
|
this._scrollStrategy = _scrollStrategy;
|
|
1593
2154
|
this._dateAdapter = _dateAdapter;
|
|
1594
2155
|
this._dir = _dir;
|
|
2156
|
+
this._document = inject(DOCUMENT);
|
|
1595
2157
|
this._multiYearSelector = false;
|
|
1596
2158
|
this._twelvehour = false;
|
|
1597
2159
|
/** The view that the calendar should start in. */
|
|
@@ -1624,8 +2186,9 @@ class MtxDatetimepicker {
|
|
|
1624
2186
|
/** Unique class that will be added to the backdrop so that the test harnesses can look it up. */
|
|
1625
2187
|
this._backdropHarnessClass = `${this.id}-backdrop`;
|
|
1626
2188
|
this._inputStateChanges = Subscription.EMPTY;
|
|
1627
|
-
this._type = '
|
|
2189
|
+
this._type = 'datetime';
|
|
1628
2190
|
this._touchUi = false;
|
|
2191
|
+
this._timeInput = false;
|
|
1629
2192
|
/** Preferred position of the datetimepicker in the X axis. */
|
|
1630
2193
|
this.xPosition = 'start';
|
|
1631
2194
|
/** Preferred position of the datetimepicker in the Y axis. */
|
|
@@ -1688,7 +2251,7 @@ class MtxDatetimepicker {
|
|
|
1688
2251
|
return this._type;
|
|
1689
2252
|
}
|
|
1690
2253
|
set type(value) {
|
|
1691
|
-
this._type = value || '
|
|
2254
|
+
this._type = value || 'datetime';
|
|
1692
2255
|
}
|
|
1693
2256
|
/**
|
|
1694
2257
|
* Whether the calendar UI is in touch mode. In touch mode the calendar opens in a dialog rather
|
|
@@ -1700,6 +2263,16 @@ class MtxDatetimepicker {
|
|
|
1700
2263
|
set touchUi(value) {
|
|
1701
2264
|
this._touchUi = coerceBooleanProperty(value);
|
|
1702
2265
|
}
|
|
2266
|
+
/**
|
|
2267
|
+
* Whether the calendar is in time mode. In time mode the calendar clock gets time input
|
|
2268
|
+
* elements rather then just clock. When `touchUi` is enabled this will be disabled.
|
|
2269
|
+
*/
|
|
2270
|
+
get timeInput() {
|
|
2271
|
+
return this._timeInput && !this.touchUi;
|
|
2272
|
+
}
|
|
2273
|
+
set timeInput(value) {
|
|
2274
|
+
this._timeInput = coerceBooleanProperty(value);
|
|
2275
|
+
}
|
|
1703
2276
|
/** Whether the datetimepicker pop-up should be disabled. */
|
|
1704
2277
|
get disabled() {
|
|
1705
2278
|
return this._disabled === undefined && this.datetimepickerInput
|
|
@@ -1788,27 +2361,40 @@ class MtxDatetimepicker {
|
|
|
1788
2361
|
if (!this._opened) {
|
|
1789
2362
|
return;
|
|
1790
2363
|
}
|
|
1791
|
-
|
|
1792
|
-
this.
|
|
1793
|
-
|
|
2364
|
+
const canRestoreFocus = this._restoreFocus &&
|
|
2365
|
+
this._focusedElementBeforeOpen &&
|
|
2366
|
+
typeof this._focusedElementBeforeOpen.focus === 'function';
|
|
1794
2367
|
const completeClose = () => {
|
|
1795
2368
|
// The `_opened` could've been reset already if
|
|
1796
2369
|
// we got two events in quick succession.
|
|
1797
2370
|
if (this._opened) {
|
|
1798
2371
|
this._opened = false;
|
|
1799
2372
|
this.closedStream.emit();
|
|
1800
|
-
this._focusedElementBeforeOpen = null;
|
|
1801
2373
|
}
|
|
1802
2374
|
};
|
|
1803
|
-
if (this.
|
|
1804
|
-
this.
|
|
1805
|
-
|
|
2375
|
+
if (this._componentRef) {
|
|
2376
|
+
const { instance, location } = this._componentRef;
|
|
2377
|
+
instance._startExitAnimation();
|
|
2378
|
+
instance._animationDone.pipe(take(1)).subscribe(() => {
|
|
2379
|
+
const activeElement = this._document.activeElement;
|
|
2380
|
+
// Since we restore focus after the exit animation, we have to check that
|
|
2381
|
+
// the user didn't move focus themselves inside the `close` handler.
|
|
2382
|
+
if (canRestoreFocus &&
|
|
2383
|
+
(!activeElement ||
|
|
2384
|
+
activeElement === this._document.activeElement ||
|
|
2385
|
+
location.nativeElement.contains(activeElement))) {
|
|
2386
|
+
this._focusedElementBeforeOpen.focus();
|
|
2387
|
+
}
|
|
2388
|
+
this._focusedElementBeforeOpen = null;
|
|
2389
|
+
this._destroyOverlay();
|
|
2390
|
+
});
|
|
2391
|
+
}
|
|
2392
|
+
if (canRestoreFocus) {
|
|
1806
2393
|
// Because IE moves focus asynchronously, we can't count on it being restored before we've
|
|
1807
|
-
// marked the
|
|
1808
|
-
//
|
|
1809
|
-
//
|
|
1810
|
-
// the
|
|
1811
|
-
this._focusedElementBeforeOpen.focus();
|
|
2394
|
+
// marked the datepicker as closed. If the event fires out of sequence and the element that
|
|
2395
|
+
// we're refocusing opens the datepicker on focus, the user could be stuck with not being
|
|
2396
|
+
// able to close the calendar at all. We work around it by making the logic, that marks
|
|
2397
|
+
// the datepicker as closed, async as well.
|
|
1812
2398
|
setTimeout(completeClose);
|
|
1813
2399
|
}
|
|
1814
2400
|
else {
|
|
@@ -1822,6 +2408,7 @@ class MtxDatetimepicker {
|
|
|
1822
2408
|
_forwardContentValues(instance) {
|
|
1823
2409
|
instance.datetimepicker = this;
|
|
1824
2410
|
instance.color = this.color;
|
|
2411
|
+
instance._dialogLabelId = this.datetimepickerInput.getOverlayLabelId();
|
|
1825
2412
|
}
|
|
1826
2413
|
/** Opens the overlay with the calendar. */
|
|
1827
2414
|
_openOverlay() {
|
|
@@ -1930,7 +2517,7 @@ class MtxDatetimepicker {
|
|
|
1930
2517
|
}
|
|
1931
2518
|
}
|
|
1932
2519
|
/** @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 });
|
|
1933
|
-
/** @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 });
|
|
2520
|
+
/** @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 });
|
|
1934
2521
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepicker, decorators: [{
|
|
1935
2522
|
type: Component,
|
|
1936
2523
|
args: [{
|
|
@@ -1984,6 +2571,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1984
2571
|
type: Input
|
|
1985
2572
|
}], touchUi: [{
|
|
1986
2573
|
type: Input
|
|
2574
|
+
}], timeInput: [{
|
|
2575
|
+
type: Input
|
|
1987
2576
|
}], disabled: [{
|
|
1988
2577
|
type: Input
|
|
1989
2578
|
}], xPosition: [{
|
|
@@ -2389,8 +2978,8 @@ class MtxDatetimepickerToggle {
|
|
|
2389
2978
|
]).subscribe(() => this._changeDetectorRef.markForCheck());
|
|
2390
2979
|
}
|
|
2391
2980
|
}
|
|
2392
|
-
/** @nocollapse */ MtxDatetimepickerToggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerToggle, deps: [{ token:
|
|
2393
|
-
/** @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 });
|
|
2981
|
+
/** @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 });
|
|
2982
|
+
/** @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 });
|
|
2394
2983
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerToggle, decorators: [{
|
|
2395
2984
|
type: Component,
|
|
2396
2985
|
args: [{ selector: 'mtx-datetimepicker-toggle', host: {
|
|
@@ -2402,12 +2991,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
2402
2991
|
'[class.mat-accent]': 'datetimepicker && datetimepicker.color === "accent"',
|
|
2403
2992
|
'[class.mat-warn]': 'datetimepicker && datetimepicker.color === "warn"',
|
|
2404
2993
|
'(focus)': '_button.focus()',
|
|
2405
|
-
}, 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"] }]
|
|
2406
|
-
}], ctorParameters: function () { return [{ type:
|
|
2994
|
+
}, 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"] }]
|
|
2995
|
+
}], ctorParameters: function () { return [{ type: MtxDatetimepickerIntl }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { datetimepicker: [{
|
|
2407
2996
|
type: Input,
|
|
2408
2997
|
args: ['for']
|
|
2409
2998
|
}], tabIndex: [{
|
|
2410
2999
|
type: Input
|
|
3000
|
+
}], ariaLabel: [{
|
|
3001
|
+
type: Input,
|
|
3002
|
+
args: ['aria-label']
|
|
2411
3003
|
}], disabled: [{
|
|
2412
3004
|
type: Input
|
|
2413
3005
|
}], disableRipple: [{
|
|
@@ -2426,6 +3018,8 @@ class MtxDatetimepickerModule {
|
|
|
2426
3018
|
/** @nocollapse */ MtxDatetimepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: MtxDatetimepickerModule, declarations: [MtxCalendar,
|
|
2427
3019
|
MtxCalendarBody,
|
|
2428
3020
|
MtxClock,
|
|
3021
|
+
MtxTime,
|
|
3022
|
+
MtxTimeInput,
|
|
2429
3023
|
MtxDatetimepicker,
|
|
2430
3024
|
MtxDatetimepickerToggle,
|
|
2431
3025
|
MtxDatetimepickerToggleIcon,
|
|
@@ -2436,6 +3030,7 @@ class MtxDatetimepickerModule {
|
|
|
2436
3030
|
MtxMultiYearView], imports: [CommonModule, MatButtonModule, OverlayModule, A11yModule, PortalModule], exports: [MtxCalendar,
|
|
2437
3031
|
MtxCalendarBody,
|
|
2438
3032
|
MtxClock,
|
|
3033
|
+
MtxTime,
|
|
2439
3034
|
MtxDatetimepicker,
|
|
2440
3035
|
MtxDatetimepickerToggle,
|
|
2441
3036
|
MtxDatetimepickerToggleIcon,
|
|
@@ -2453,6 +3048,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
2453
3048
|
MtxCalendar,
|
|
2454
3049
|
MtxCalendarBody,
|
|
2455
3050
|
MtxClock,
|
|
3051
|
+
MtxTime,
|
|
3052
|
+
MtxTimeInput,
|
|
2456
3053
|
MtxDatetimepicker,
|
|
2457
3054
|
MtxDatetimepickerToggle,
|
|
2458
3055
|
MtxDatetimepickerToggleIcon,
|
|
@@ -2466,6 +3063,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
2466
3063
|
MtxCalendar,
|
|
2467
3064
|
MtxCalendarBody,
|
|
2468
3065
|
MtxClock,
|
|
3066
|
+
MtxTime,
|
|
2469
3067
|
MtxDatetimepicker,
|
|
2470
3068
|
MtxDatetimepickerToggle,
|
|
2471
3069
|
MtxDatetimepickerToggleIcon,
|
|
@@ -2483,5 +3081,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
2483
3081
|
* Generated bundle index. Do not edit.
|
|
2484
3082
|
*/
|
|
2485
3083
|
|
|
2486
|
-
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 };
|
|
3084
|
+
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 };
|
|
2487
3085
|
//# sourceMappingURL=mtxDatetimepicker.mjs.map
|