@ng-matero/extensions 17.0.0 → 17.1.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/_index.scss +24 -12
- package/alert/alert-module.d.ts +3 -3
- package/alert/alert.d.ts +1 -1
- package/checkbox-group/checkbox-group-module.d.ts +6 -6
- package/checkbox-group/checkbox-group.d.ts +1 -1
- package/colorpicker/colorpicker-input.d.ts +1 -1
- package/colorpicker/colorpicker-module.d.ts +10 -10
- package/colorpicker/colorpicker-toggle.d.ts +2 -2
- package/colorpicker/colorpicker.d.ts +3 -3
- package/column-resize/column-resize-directives/column-resize-flex.d.ts +1 -1
- package/column-resize/column-resize-directives/column-resize.d.ts +1 -1
- package/column-resize/column-resize-module.d.ts +1 -1
- package/core/color/_all-color.scss +3 -3
- package/core/datetime/datetime.module.d.ts +4 -1
- package/core/density/_all-density.scss +2 -2
- package/core/pipes/is-template-ref.pipe.d.ts +1 -1
- package/core/pipes/pipes.module.d.ts +4 -4
- package/core/pipes/to-observable.pipe.d.ts +1 -1
- package/core/tokens/m2/mdc/_plain-tooltip.scss +6 -6
- package/core/tokens/m2/mtx/_select.scss +1 -42
- package/core/typography/_all-typography.scss +2 -2
- package/datetimepicker/calendar-body.d.ts +1 -1
- package/datetimepicker/calendar.d.ts +1 -1
- package/datetimepicker/clock.d.ts +1 -1
- package/datetimepicker/datetimepicker-input.d.ts +1 -1
- package/datetimepicker/datetimepicker-module.d.ts +16 -16
- package/datetimepicker/datetimepicker-toggle.d.ts +2 -2
- package/datetimepicker/datetimepicker.d.ts +3 -3
- package/datetimepicker/month-view.d.ts +1 -1
- package/datetimepicker/multi-year-view.d.ts +1 -1
- package/datetimepicker/time.d.ts +3 -3
- package/datetimepicker/year-view.d.ts +1 -1
- package/dialog/dialog-container.d.ts +1 -1
- package/dialog/dialog-module.d.ts +7 -7
- package/drawer/drawer-container.d.ts +1 -1
- package/drawer/drawer-module.d.ts +5 -5
- package/esm2022/alert/alert-module.mjs +6 -7
- package/esm2022/alert/alert.mjs +5 -5
- package/esm2022/button/button-loading.mjs +4 -4
- package/esm2022/button/button-module.mjs +4 -4
- package/esm2022/checkbox-group/checkbox-group-module.mjs +6 -7
- package/esm2022/checkbox-group/checkbox-group.mjs +9 -10
- package/esm2022/colorpicker/colorpicker-input.mjs +5 -4
- package/esm2022/colorpicker/colorpicker-module.mjs +20 -19
- package/esm2022/colorpicker/colorpicker-toggle.mjs +10 -9
- package/esm2022/colorpicker/colorpicker.mjs +25 -18
- package/esm2022/column-resize/column-resize-directives/column-resize-flex.mjs +5 -4
- package/esm2022/column-resize/column-resize-directives/column-resize.mjs +5 -4
- package/esm2022/column-resize/column-resize-module.mjs +6 -6
- package/esm2022/column-resize/column-resize-notifier.mjs +6 -6
- package/esm2022/column-resize/column-resize.mjs +4 -4
- package/esm2022/column-resize/column-size-store.mjs +3 -3
- package/esm2022/column-resize/event-dispatcher.mjs +4 -4
- package/esm2022/column-resize/overlay-handle.mjs +4 -4
- package/esm2022/column-resize/polyfill.mjs +1 -1
- package/esm2022/column-resize/resizable.mjs +4 -4
- package/esm2022/column-resize/resize-strategy.mjs +10 -10
- package/esm2022/core/datetime/datetime-adapter.mjs +1 -1
- package/esm2022/core/datetime/datetime.module.mjs +19 -23
- package/esm2022/core/datetime/native-datetime-adapter.mjs +4 -4
- package/esm2022/core/pipes/is-template-ref.pipe.mjs +5 -5
- package/esm2022/core/pipes/pipes.module.mjs +6 -7
- package/esm2022/core/pipes/to-observable.pipe.mjs +5 -5
- package/esm2022/datetimepicker/calendar-body.mjs +5 -5
- package/esm2022/datetimepicker/calendar.mjs +19 -12
- package/esm2022/datetimepicker/clock.mjs +6 -7
- package/esm2022/datetimepicker/datetimepicker-errors.mjs +4 -3
- package/esm2022/datetimepicker/datetimepicker-input.mjs +6 -5
- package/esm2022/datetimepicker/datetimepicker-intl.mjs +3 -3
- package/esm2022/datetimepicker/datetimepicker-module.mjs +28 -11
- package/esm2022/datetimepicker/datetimepicker-toggle.mjs +10 -9
- package/esm2022/datetimepicker/datetimepicker.mjs +23 -19
- package/esm2022/datetimepicker/month-view.mjs +6 -7
- package/esm2022/datetimepicker/multi-year-view.mjs +6 -7
- package/esm2022/datetimepicker/time.mjs +11 -10
- package/esm2022/datetimepicker/year-view.mjs +6 -7
- package/esm2022/dialog/dialog-container.mjs +19 -10
- package/esm2022/dialog/dialog-module.mjs +23 -7
- package/esm2022/dialog/dialog.mjs +6 -5
- package/esm2022/drawer/drawer-container.mjs +5 -6
- package/esm2022/drawer/drawer-module.mjs +6 -7
- package/esm2022/drawer/drawer-ref.mjs +1 -1
- package/esm2022/drawer/drawer.mjs +6 -5
- package/esm2022/grid/cell.mjs +35 -13
- package/esm2022/grid/column-menu.mjs +31 -15
- package/esm2022/grid/column-resize/column-resize-directives/column-resize-flex.mjs +5 -4
- package/esm2022/grid/column-resize/column-resize-directives/column-resize.mjs +5 -4
- package/esm2022/grid/column-resize/column-resize-module.mjs +14 -14
- package/esm2022/grid/column-resize/index.mjs +8 -0
- package/esm2022/grid/column-resize/overlay-handle.mjs +5 -4
- package/esm2022/grid/column-resize/resizable-directives/resizable.mjs +5 -4
- package/esm2022/grid/column-resize/resize-strategy.mjs +3 -3
- package/esm2022/grid/expansion-toggle.mjs +5 -4
- package/esm2022/grid/grid-module.mjs +39 -37
- package/esm2022/grid/grid-pipes.mjs +29 -29
- package/esm2022/grid/grid-utils.mjs +6 -5
- package/esm2022/grid/grid.mjs +108 -76
- package/esm2022/loader/loader-module.mjs +6 -7
- package/esm2022/loader/loader.mjs +7 -7
- package/esm2022/photoviewer/photoviewer-module.mjs +6 -7
- package/esm2022/photoviewer/photoviewer.mjs +5 -4
- package/esm2022/popover/popover-content.mjs +8 -7
- package/esm2022/popover/popover-module.mjs +22 -7
- package/esm2022/popover/popover-target.mjs +5 -4
- package/esm2022/popover/popover-trigger.mjs +13 -6
- package/esm2022/popover/popover.mjs +7 -7
- package/esm2022/progress/progress-module.mjs +6 -7
- package/esm2022/progress/progress.mjs +6 -6
- package/esm2022/select/option.mjs +5 -4
- package/esm2022/select/select-module.mjs +20 -9
- package/esm2022/select/select.mjs +11 -11
- package/esm2022/select/templates.mjs +45 -45
- package/esm2022/split/split-module.mjs +6 -7
- package/esm2022/split/split-pane.mjs +5 -4
- package/esm2022/split/split.mjs +6 -6
- package/esm2022/split/utils.mjs +1 -1
- package/esm2022/tooltip/tooltip-module.mjs +24 -7
- package/esm2022/tooltip/tooltip.mjs +101 -114
- package/fesm2022/mtxAlert.mjs +9 -10
- package/fesm2022/mtxAlert.mjs.map +1 -1
- package/fesm2022/mtxButton.mjs +7 -7
- package/fesm2022/mtxButton.mjs.map +1 -1
- package/fesm2022/mtxCheckboxGroup.mjs +12 -16
- package/fesm2022/mtxCheckboxGroup.mjs.map +1 -1
- package/fesm2022/mtxColorpicker.mjs +462 -454
- package/fesm2022/mtxColorpicker.mjs.map +1 -1
- package/fesm2022/mtxColumnResize.mjs +43 -41
- package/fesm2022/mtxColumnResize.mjs.map +1 -1
- package/fesm2022/mtxCore.mjs +34 -39
- package/fesm2022/mtxCore.mjs.map +1 -1
- package/fesm2022/mtxDatetimepicker.mjs +814 -781
- package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
- package/fesm2022/mtxDialog.mjs +44 -22
- package/fesm2022/mtxDialog.mjs.map +1 -1
- package/fesm2022/mtxDrawer.mjs +14 -15
- package/fesm2022/mtxDrawer.mjs.map +1 -1
- package/fesm2022/mtxGrid.mjs +249 -180
- package/fesm2022/mtxGrid.mjs.map +1 -1
- package/fesm2022/mtxLoader.mjs +11 -14
- package/fesm2022/mtxLoader.mjs.map +1 -1
- package/fesm2022/mtxPhotoviewer.mjs +9 -9
- package/fesm2022/mtxPhotoviewer.mjs.map +1 -1
- package/fesm2022/mtxPopover.mjs +52 -29
- package/fesm2022/mtxPopover.mjs.map +1 -1
- package/fesm2022/mtxProgress.mjs +10 -12
- package/fesm2022/mtxProgress.mjs.map +1 -1
- package/fesm2022/mtxSelect.mjs +75 -64
- package/fesm2022/mtxSelect.mjs.map +1 -1
- package/fesm2022/mtxSplit.mjs +14 -15
- package/fesm2022/mtxSplit.mjs.map +1 -1
- package/fesm2022/mtxTooltip.mjs +124 -121
- package/fesm2022/mtxTooltip.mjs.map +1 -1
- package/grid/cell.d.ts +1 -1
- package/grid/column-menu.d.ts +1 -1
- package/grid/column-resize/column-resize-directives/column-resize-flex.d.ts +1 -1
- package/grid/column-resize/column-resize-directives/column-resize.d.ts +1 -1
- package/grid/column-resize/column-resize-module.d.ts +7 -6
- package/grid/column-resize/index.d.ts +7 -0
- package/grid/column-resize/overlay-handle.d.ts +1 -1
- package/grid/column-resize/resizable-directives/resizable.d.ts +1 -1
- package/grid/expansion-toggle.d.ts +1 -1
- package/grid/grid-module.d.ts +25 -25
- package/grid/grid-pipes.d.ts +7 -7
- package/grid/grid.d.ts +24 -24
- package/loader/loader-module.d.ts +5 -5
- package/loader/loader.d.ts +1 -1
- package/package.json +6 -6
- package/photoviewer/photoviewer-module.d.ts +1 -1
- package/photoviewer/photoviewer.d.ts +1 -1
- package/popover/popover-content.d.ts +1 -1
- package/popover/popover-module.d.ts +8 -8
- package/popover/popover-target.d.ts +1 -1
- package/popover/popover-trigger.d.ts +1 -1
- package/popover/popover.d.ts +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/progress/progress-module.d.ts +3 -3
- package/progress/progress.d.ts +1 -1
- package/select/option.d.ts +1 -1
- package/select/select-module.d.ts +7 -7
- package/select/select.d.ts +1 -1
- package/select/select.scss +9 -10
- package/select/templates.d.ts +11 -11
- package/split/split-module.d.ts +4 -4
- package/split/split-pane.d.ts +1 -1
- package/split/split.d.ts +1 -1
- package/tooltip/tooltip-module.d.ts +7 -7
- package/tooltip/tooltip.d.ts +30 -44
- package/tooltip/tooltip.scss +2 -4
- package/core/mdc-helpers/_mdc-helpers.scss +0 -31
- package/core/style/_validation.scss +0 -43
- package/core/theming/_inspection.scss +0 -303
- package/core/theming/_m2-inspection.scss +0 -266
|
@@ -1,77 +1,24 @@
|
|
|
1
|
-
import * as i2$1 from '@angular/cdk/a11y';
|
|
2
1
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
3
|
-
import * as
|
|
2
|
+
import * as i1$1 from '@angular/cdk/overlay';
|
|
4
3
|
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
5
4
|
import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
6
|
-
import
|
|
7
|
-
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
5
|
+
import { DOCUMENT, NgStyle, NgClass, CommonModule } from '@angular/common';
|
|
8
6
|
import * as i0 from '@angular/core';
|
|
9
|
-
import { EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, Optional,
|
|
10
|
-
import
|
|
11
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
7
|
+
import { EventEmitter, booleanAttribute, Component, ViewEncapsulation, ChangeDetectionStrategy, Inject, Input, Output, Optional, Injectable, Directive, ElementRef, ViewChild, inject, InjectionToken, forwardRef, Attribute, ContentChild, NgModule } from '@angular/core';
|
|
8
|
+
import { MatButton, MatIconButton, MatButtonModule } from '@angular/material/button';
|
|
12
9
|
import { UP_ARROW, DOWN_ARROW, ENTER, PAGE_DOWN, PAGE_UP, END, HOME, RIGHT_ARROW, LEFT_ARROW, ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
|
|
13
10
|
import * as i1 from '@ng-matero/extensions/core';
|
|
14
11
|
import { MTX_DATETIME_FORMATS } from '@ng-matero/extensions/core';
|
|
15
12
|
import { first, take, filter } from 'rxjs/operators';
|
|
16
|
-
import { style, keyframes, animate, transition, trigger, state } from '@angular/animations';
|
|
17
|
-
import { Subject, Subscription, merge, of } from 'rxjs';
|
|
18
13
|
import { normalizePassiveListenerOptions, _getFocusedElementPierceShadowDom } from '@angular/cdk/platform';
|
|
14
|
+
import { style, keyframes, animate, transition, trigger, state } from '@angular/animations';
|
|
19
15
|
import { coerceNumberProperty, coerceStringArray } from '@angular/cdk/coercion';
|
|
16
|
+
import { Subject, Subscription, merge, of } from 'rxjs';
|
|
20
17
|
import { mixinColor } from '@angular/material/core';
|
|
21
|
-
import * as
|
|
18
|
+
import * as i3 from '@angular/cdk/bidi';
|
|
22
19
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators } from '@angular/forms';
|
|
23
20
|
import { MAT_INPUT_VALUE_ACCESSOR } from '@angular/material/input';
|
|
24
|
-
import * as i2
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Animations used by the Material datepicker.
|
|
28
|
-
* @docs-private
|
|
29
|
-
*/
|
|
30
|
-
const mtxDatetimepickerAnimations = {
|
|
31
|
-
/** Transforms the height of the datepicker's calendar. */
|
|
32
|
-
transformPanel: trigger('transformPanel', [
|
|
33
|
-
transition('void => enter-dropdown', animate('120ms cubic-bezier(0, 0, 0.2, 1)', keyframes([
|
|
34
|
-
style({ opacity: 0, transform: 'scale(1, 0.8)' }),
|
|
35
|
-
style({ opacity: 1, transform: 'scale(1, 1)' }),
|
|
36
|
-
]))),
|
|
37
|
-
transition('void => enter-dialog', animate('150ms cubic-bezier(0, 0, 0.2, 1)', keyframes([
|
|
38
|
-
style({ opacity: 0, transform: 'scale(0.7)' }),
|
|
39
|
-
style({ transform: 'none', opacity: 1 }),
|
|
40
|
-
]))),
|
|
41
|
-
transition('* => void', animate('100ms linear', style({ opacity: 0 }))),
|
|
42
|
-
]),
|
|
43
|
-
/** Fades in the content of the calendar. */
|
|
44
|
-
fadeInCalendar: trigger('fadeInCalendar', [
|
|
45
|
-
state('void', style({ opacity: 0 })),
|
|
46
|
-
state('enter', style({ opacity: 1 })),
|
|
47
|
-
// TODO(crisbeto): this animation should be removed since it isn't quite on spec, but we
|
|
48
|
-
// need to keep it until #12440 gets in, otherwise the exit animation will look glitchy.
|
|
49
|
-
transition('void => *', animate('120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)')),
|
|
50
|
-
]),
|
|
51
|
-
slideCalendar: trigger('slideCalendar', [
|
|
52
|
-
transition('* => left', [
|
|
53
|
-
animate(180, keyframes([
|
|
54
|
-
style({ transform: 'translateX(100%)', offset: 0.5 }),
|
|
55
|
-
style({ transform: 'translateX(-100%)', offset: 0.51 }),
|
|
56
|
-
style({ transform: 'translateX(0)', offset: 1 }),
|
|
57
|
-
])),
|
|
58
|
-
]),
|
|
59
|
-
transition('* => right', [
|
|
60
|
-
animate(180, keyframes([
|
|
61
|
-
style({ transform: 'translateX(-100%)', offset: 0.5 }),
|
|
62
|
-
style({ transform: 'translateX(100%)', offset: 0.51 }),
|
|
63
|
-
style({ transform: 'translateX(0)', offset: 1 }),
|
|
64
|
-
])),
|
|
65
|
-
]),
|
|
66
|
-
]),
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
/** @docs-private */
|
|
70
|
-
function createMissingDateImplError(provider) {
|
|
71
|
-
return Error(`MtxDatetimepicker: No provider found for ${provider}. You must import one of the following ` +
|
|
72
|
-
`modules at your application root: MtxNativeDatetimeModule, MtxMomentDatetimeModule, or provide a ` +
|
|
73
|
-
`custom implementation.`);
|
|
74
|
-
}
|
|
21
|
+
import * as i2 from '@angular/material/form-field';
|
|
75
22
|
|
|
76
23
|
var MtxDatetimepickerFilterType;
|
|
77
24
|
(function (MtxDatetimepickerFilterType) {
|
|
@@ -80,114 +27,78 @@ var MtxDatetimepickerFilterType;
|
|
|
80
27
|
MtxDatetimepickerFilterType[MtxDatetimepickerFilterType["MINUTE"] = 2] = "MINUTE";
|
|
81
28
|
})(MtxDatetimepickerFilterType || (MtxDatetimepickerFilterType = {}));
|
|
82
29
|
|
|
30
|
+
const activeEventOptions = normalizePassiveListenerOptions({ passive: false });
|
|
31
|
+
const CLOCK_RADIUS = 50;
|
|
32
|
+
const CLOCK_INNER_RADIUS = 27.5;
|
|
33
|
+
const CLOCK_OUTER_RADIUS = 41.25;
|
|
34
|
+
const CLOCK_TICK_RADIUS = 7.0833;
|
|
83
35
|
/**
|
|
84
|
-
*
|
|
85
|
-
* @docs-private
|
|
86
|
-
*/
|
|
87
|
-
class MtxCalendarCell {
|
|
88
|
-
constructor(value, displayValue, ariaLabel, enabled) {
|
|
89
|
-
this.value = value;
|
|
90
|
-
this.displayValue = displayValue;
|
|
91
|
-
this.ariaLabel = ariaLabel;
|
|
92
|
-
this.enabled = enabled;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* An internal component used to display calendar data in a table.
|
|
97
|
-
* @docs-private
|
|
98
|
-
*/
|
|
99
|
-
class MtxCalendarBody {
|
|
100
|
-
constructor() {
|
|
101
|
-
/** The number of columns in the table. */
|
|
102
|
-
this.numCols = 7;
|
|
103
|
-
/** Whether to allow selection of disabled cells. */
|
|
104
|
-
this.allowDisabledSelection = false;
|
|
105
|
-
/** The cell number of the active cell in the table. */
|
|
106
|
-
this.activeCell = 0;
|
|
107
|
-
/** Emits when a new value is selected. */
|
|
108
|
-
this.selectedValueChange = new EventEmitter();
|
|
109
|
-
}
|
|
110
|
-
/** The number of blank cells to put at the beginning for the first row. */
|
|
111
|
-
get _firstRowOffset() {
|
|
112
|
-
return this.rows && this.rows.length && this.rows[0].length
|
|
113
|
-
? this.numCols - this.rows[0].length
|
|
114
|
-
: 0;
|
|
115
|
-
}
|
|
116
|
-
_cellClicked(cell) {
|
|
117
|
-
if (!this.allowDisabledSelection && !cell.enabled) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
this.selectedValueChange.emit(cell.value);
|
|
121
|
-
}
|
|
122
|
-
_isActiveCell(rowIndex, colIndex) {
|
|
123
|
-
let cellNumber = rowIndex * this.numCols + colIndex;
|
|
124
|
-
// Account for the fact that the first row may not have as many cells.
|
|
125
|
-
if (rowIndex) {
|
|
126
|
-
cellNumber -= this._firstRowOffset;
|
|
127
|
-
}
|
|
128
|
-
return cellNumber === this.activeCell;
|
|
129
|
-
}
|
|
130
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: MtxCalendarBody, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
131
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.7", 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@if (_firstRowOffset < labelMinRequiredCells) {\n <tr aria-hidden=\"true\">\n <td class=\"mtx-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\n </tr>\n}\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n@for (row of rows; track row; let rowIndex = $index) {\n <tr 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 @if (rowIndex === 0 && _firstRowOffset) {\n <td\n class=\"mtx-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" aria-hidden=\"true\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n }\n @for (item of row; track item; let colIndex = $index) {\n <td\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 }\n </tr>\n}\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-today-outline-color)}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%;font-size:var(--mtx-datetimepicker-calendar-body-label-text-size);font-weight:var(--mtx-datetimepicker-calendar-body-label-text-weight);color:var(--mtx-datetimepicker-calendar-body-label-text-color)}[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-disabled>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.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;color:var(--mtx-datetimepicker-calendar-date-text-color);border-color:var(--mtx-datetimepicker-calendar-date-outline-color)}.mtx-calendar-body-active>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-focus-state-background-color)}@media (hover: hover){.mtx-calendar-body-cell:not(.mtx-calendar-body-disabled):hover>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-hover-state-background-color)}}.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-state-background-color);color:var(--mtx-datetimepicker-calendar-date-selected-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-disabled-state-background-color)}.mtx-calendar-body-selected.mtx-calendar-body-today{box-shadow:inset 0 0 0 1px var(--mtx-datetimepicker-calendar-date-today-selected-state-outline-color)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
132
|
-
}
|
|
133
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: MtxCalendarBody, decorators: [{
|
|
134
|
-
type: Component,
|
|
135
|
-
args: [{ selector: '[mtx-calendar-body]', host: {
|
|
136
|
-
class: 'mtx-calendar-body',
|
|
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@if (_firstRowOffset < labelMinRequiredCells) {\n <tr aria-hidden=\"true\">\n <td class=\"mtx-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\n </tr>\n}\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n@for (row of rows; track row; let rowIndex = $index) {\n <tr 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 @if (rowIndex === 0 && _firstRowOffset) {\n <td\n class=\"mtx-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" aria-hidden=\"true\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n }\n @for (item of row; track item; let colIndex = $index) {\n <td\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 }\n </tr>\n}\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-today-outline-color)}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%;font-size:var(--mtx-datetimepicker-calendar-body-label-text-size);font-weight:var(--mtx-datetimepicker-calendar-body-label-text-weight);color:var(--mtx-datetimepicker-calendar-body-label-text-color)}[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-disabled>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.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;color:var(--mtx-datetimepicker-calendar-date-text-color);border-color:var(--mtx-datetimepicker-calendar-date-outline-color)}.mtx-calendar-body-active>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-focus-state-background-color)}@media (hover: hover){.mtx-calendar-body-cell:not(.mtx-calendar-body-disabled):hover>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-hover-state-background-color)}}.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-state-background-color);color:var(--mtx-datetimepicker-calendar-date-selected-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-disabled-state-background-color)}.mtx-calendar-body-selected.mtx-calendar-body-today{box-shadow:inset 0 0 0 1px var(--mtx-datetimepicker-calendar-date-today-selected-state-outline-color)}\n"] }]
|
|
138
|
-
}], propDecorators: { label: [{
|
|
139
|
-
type: Input
|
|
140
|
-
}], rows: [{
|
|
141
|
-
type: Input
|
|
142
|
-
}], todayValue: [{
|
|
143
|
-
type: Input
|
|
144
|
-
}], selectedValue: [{
|
|
145
|
-
type: Input
|
|
146
|
-
}], labelMinRequiredCells: [{
|
|
147
|
-
type: Input
|
|
148
|
-
}], numCols: [{
|
|
149
|
-
type: Input
|
|
150
|
-
}], allowDisabledSelection: [{
|
|
151
|
-
type: Input
|
|
152
|
-
}], activeCell: [{
|
|
153
|
-
type: Input
|
|
154
|
-
}], selectedValueChange: [{
|
|
155
|
-
type: Output
|
|
156
|
-
}] } });
|
|
157
|
-
|
|
158
|
-
const yearsPerPage = 24;
|
|
159
|
-
const yearsPerRow = 4;
|
|
160
|
-
/**
|
|
161
|
-
* An internal component used to display multiple years in the datetimepicker.
|
|
36
|
+
* A clock that is used as part of the datetimepicker.
|
|
162
37
|
* @docs-private
|
|
163
38
|
*/
|
|
164
|
-
class
|
|
165
|
-
constructor(_adapter,
|
|
39
|
+
class MtxClock {
|
|
40
|
+
constructor(_elementRef, _adapter, _changeDetectorRef, _document) {
|
|
41
|
+
this._elementRef = _elementRef;
|
|
166
42
|
this._adapter = _adapter;
|
|
167
|
-
this.
|
|
168
|
-
this.
|
|
169
|
-
/**
|
|
43
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
44
|
+
this._document = _document;
|
|
45
|
+
/** Step over minutes. */
|
|
46
|
+
this.interval = 1;
|
|
47
|
+
/** Whether the clock uses 12 hour format. */
|
|
48
|
+
this.twelvehour = false;
|
|
49
|
+
/** Whether the time is now in AM or PM. */
|
|
50
|
+
this.AMPM = 'AM';
|
|
51
|
+
/** Emits when the currently selected date changes. */
|
|
170
52
|
this.selectedChange = new EventEmitter();
|
|
53
|
+
/** Emits when any date is activated. */
|
|
54
|
+
this.activeDateChange = new EventEmitter();
|
|
171
55
|
/** Emits when any date is selected. */
|
|
172
56
|
this._userSelection = new EventEmitter();
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
this.
|
|
57
|
+
/** Whether the clock is in hour view. */
|
|
58
|
+
this._hourView = true;
|
|
59
|
+
this._hours = [];
|
|
60
|
+
this._minutes = [];
|
|
61
|
+
this._timeChanged = false;
|
|
62
|
+
/** Called when the user has put their pointer down on the clock. */
|
|
63
|
+
this._pointerDown = (event) => {
|
|
64
|
+
this._timeChanged = false;
|
|
65
|
+
this.setTime(event);
|
|
66
|
+
this._bindGlobalEvents(event);
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Called when the user has moved their pointer after
|
|
70
|
+
* starting to drag. Bound on the document level.
|
|
71
|
+
*/
|
|
72
|
+
this._pointerMove = (event) => {
|
|
73
|
+
if (event.cancelable) {
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
}
|
|
76
|
+
this.setTime(event);
|
|
77
|
+
};
|
|
78
|
+
/** Called when the user has lifted their pointer. Bound on the document level. */
|
|
79
|
+
this._pointerUp = (event) => {
|
|
80
|
+
if (event.cancelable) {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
}
|
|
83
|
+
this._removeGlobalEvents();
|
|
84
|
+
if (this._timeChanged) {
|
|
85
|
+
this.selectedChange.emit(this.activeDate);
|
|
86
|
+
if (!this._hourView) {
|
|
87
|
+
this._userSelection.emit();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
180
91
|
}
|
|
181
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* The date to display in this clock view.
|
|
94
|
+
*/
|
|
182
95
|
get activeDate() {
|
|
183
96
|
return this._activeDate;
|
|
184
97
|
}
|
|
185
98
|
set activeDate(value) {
|
|
186
99
|
const oldActiveDate = this._activeDate;
|
|
187
|
-
this._activeDate = value
|
|
188
|
-
if (oldActiveDate
|
|
189
|
-
this._activeDate &&
|
|
190
|
-
!isSameMultiYearView(this._adapter, oldActiveDate, this._activeDate, this.minDate, this.maxDate)) {
|
|
100
|
+
this._activeDate = this._adapter.clampDate(value, this.minDate, this.maxDate);
|
|
101
|
+
if (!this._adapter.sameMinute(oldActiveDate, this._activeDate)) {
|
|
191
102
|
this._init();
|
|
192
103
|
}
|
|
193
104
|
}
|
|
@@ -196,124 +107,246 @@ class MtxMultiYearView {
|
|
|
196
107
|
return this._selected;
|
|
197
108
|
}
|
|
198
109
|
set selected(value) {
|
|
199
|
-
this._selected = value;
|
|
200
|
-
|
|
110
|
+
this._selected = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
|
|
111
|
+
if (this._selected) {
|
|
112
|
+
this.activeDate = this._selected;
|
|
113
|
+
}
|
|
201
114
|
}
|
|
202
115
|
/** The minimum selectable date. */
|
|
203
116
|
get minDate() {
|
|
204
117
|
return this._minDate;
|
|
205
118
|
}
|
|
206
119
|
set minDate(value) {
|
|
207
|
-
this._minDate = this.
|
|
120
|
+
this._minDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
|
|
208
121
|
}
|
|
209
122
|
/** The maximum selectable date. */
|
|
210
123
|
get maxDate() {
|
|
211
124
|
return this._maxDate;
|
|
212
125
|
}
|
|
213
126
|
set maxDate(value) {
|
|
214
|
-
this._maxDate = this.
|
|
127
|
+
this._maxDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
|
|
215
128
|
}
|
|
216
|
-
|
|
217
|
-
|
|
129
|
+
/** Whether the clock should be started in hour or minute view. */
|
|
130
|
+
set startView(value) {
|
|
131
|
+
this._hourView = value !== 'minute';
|
|
218
132
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
133
|
+
get _hand() {
|
|
134
|
+
const hour = this._adapter.getHour(this.activeDate);
|
|
135
|
+
this._selectedHour = hour;
|
|
136
|
+
this._selectedMinute = this._adapter.getMinute(this.activeDate);
|
|
137
|
+
let deg = 0;
|
|
138
|
+
let radius = CLOCK_OUTER_RADIUS;
|
|
139
|
+
if (this._hourView) {
|
|
140
|
+
const outer = this._selectedHour > 0 && this._selectedHour < 13;
|
|
141
|
+
radius = outer ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
|
|
142
|
+
if (this.twelvehour) {
|
|
143
|
+
radius = CLOCK_OUTER_RADIUS;
|
|
144
|
+
}
|
|
145
|
+
deg = Math.round(this._selectedHour * (360 / (24 / 2)));
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
deg = Math.round(this._selectedMinute * (360 / 60));
|
|
226
149
|
}
|
|
150
|
+
return {
|
|
151
|
+
height: `${radius}%`,
|
|
152
|
+
marginTop: `${50 - radius}%`,
|
|
153
|
+
transform: `rotate(${deg}deg)`,
|
|
154
|
+
};
|
|
227
155
|
}
|
|
228
|
-
|
|
229
|
-
|
|
156
|
+
ngAfterContentInit() {
|
|
157
|
+
this.activeDate = this._activeDate || this._adapter.today();
|
|
158
|
+
this._init();
|
|
230
159
|
}
|
|
231
|
-
|
|
232
|
-
this.
|
|
160
|
+
ngOnDestroy() {
|
|
161
|
+
this._removeGlobalEvents();
|
|
233
162
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
163
|
+
ngOnChanges() {
|
|
164
|
+
this._init();
|
|
165
|
+
}
|
|
166
|
+
/** Binds our global move and end events. */
|
|
167
|
+
_bindGlobalEvents(triggerEvent) {
|
|
168
|
+
// Note that we bind the events to the `document`, because it allows us to capture
|
|
169
|
+
// drag cancel events where the user's pointer is outside the browser window.
|
|
170
|
+
const document = this._document;
|
|
171
|
+
const isTouch = isTouchEvent(triggerEvent);
|
|
172
|
+
const moveEventName = isTouch ? 'touchmove' : 'mousemove';
|
|
173
|
+
const endEventName = isTouch ? 'touchend' : 'mouseup';
|
|
174
|
+
document.addEventListener(moveEventName, this._pointerMove, activeEventOptions);
|
|
175
|
+
document.addEventListener(endEventName, this._pointerUp, activeEventOptions);
|
|
176
|
+
if (isTouch) {
|
|
177
|
+
document.addEventListener('touchcancel', this._pointerUp, activeEventOptions);
|
|
247
178
|
}
|
|
248
179
|
}
|
|
249
|
-
/**
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
|
|
180
|
+
/** Removes any global event listeners that we may have added. */
|
|
181
|
+
_removeGlobalEvents() {
|
|
182
|
+
const document = this._document;
|
|
183
|
+
document.removeEventListener('mousemove', this._pointerMove, activeEventOptions);
|
|
184
|
+
document.removeEventListener('mouseup', this._pointerUp, activeEventOptions);
|
|
185
|
+
document.removeEventListener('touchmove', this._pointerMove, activeEventOptions);
|
|
186
|
+
document.removeEventListener('touchend', this._pointerUp, activeEventOptions);
|
|
187
|
+
document.removeEventListener('touchcancel', this._pointerUp, activeEventOptions);
|
|
253
188
|
}
|
|
254
|
-
/**
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
189
|
+
/** Initializes this clock view. */
|
|
190
|
+
_init() {
|
|
191
|
+
this._hours.length = 0;
|
|
192
|
+
this._minutes.length = 0;
|
|
193
|
+
const hourNames = this._adapter.getHourNames();
|
|
194
|
+
const minuteNames = this._adapter.getMinuteNames();
|
|
195
|
+
if (this.twelvehour) {
|
|
196
|
+
const hours = [];
|
|
197
|
+
for (let i = 0; i < hourNames.length; i++) {
|
|
198
|
+
const radian = (i / 6) * Math.PI;
|
|
199
|
+
const radius = CLOCK_OUTER_RADIUS;
|
|
200
|
+
const hour = i;
|
|
201
|
+
const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), hour, 0);
|
|
202
|
+
// Check if the date is enabled, no need to respect the minute setting here
|
|
203
|
+
const enabled = (!this.minDate ||
|
|
204
|
+
this._adapter.compareDatetime(date, this.minDate, false) >= 0) &&
|
|
205
|
+
(!this.maxDate ||
|
|
206
|
+
this._adapter.compareDatetime(date, this.maxDate, false) <= 0) &&
|
|
207
|
+
(!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.HOUR));
|
|
208
|
+
// display value for twelvehour clock should be from 1-12 not including 0 and not above 12
|
|
209
|
+
hours.push({
|
|
210
|
+
value: i,
|
|
211
|
+
displayValue: i % 12 === 0 ? '12' : hourNames[i % 12],
|
|
212
|
+
enabled,
|
|
213
|
+
top: CLOCK_RADIUS - Math.cos(radian) * radius - CLOCK_TICK_RADIUS,
|
|
214
|
+
left: CLOCK_RADIUS + Math.sin(radian) * radius - CLOCK_TICK_RADIUS,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
// filter out AM or PM hours based on AMPM
|
|
218
|
+
if (this.AMPM === 'AM') {
|
|
219
|
+
this._hours = hours.filter(x => x.value < 12);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
this._hours = hours.filter(x => x.value >= 12);
|
|
223
|
+
}
|
|
266
224
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
225
|
+
else {
|
|
226
|
+
for (let i = 0; i < hourNames.length; i++) {
|
|
227
|
+
const radian = (i / 6) * Math.PI;
|
|
228
|
+
const outer = i > 0 && i < 13;
|
|
229
|
+
const radius = outer ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
|
|
230
|
+
const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), i, 0);
|
|
231
|
+
// Check if the date is enabled, no need to respect the minute setting here
|
|
232
|
+
const enabled = (!this.minDate ||
|
|
233
|
+
this._adapter.compareDatetime(date, this.minDate, false) >= 0) &&
|
|
234
|
+
(!this.maxDate ||
|
|
235
|
+
this._adapter.compareDatetime(date, this.maxDate, false) <= 0) &&
|
|
236
|
+
(!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.HOUR));
|
|
237
|
+
this._hours.push({
|
|
238
|
+
value: i,
|
|
239
|
+
displayValue: i === 0 ? '00' : hourNames[i],
|
|
240
|
+
enabled,
|
|
241
|
+
top: CLOCK_RADIUS - Math.cos(radian) * radius - CLOCK_TICK_RADIUS,
|
|
242
|
+
left: CLOCK_RADIUS + Math.sin(radian) * radius - CLOCK_TICK_RADIUS,
|
|
243
|
+
fontSize: i > 0 && i < 13 ? '' : '80%',
|
|
244
|
+
});
|
|
272
245
|
}
|
|
273
246
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
_isInRange(year) {
|
|
289
|
-
return true;
|
|
247
|
+
for (let i = 0; i < minuteNames.length; i += 5) {
|
|
248
|
+
const radian = (i / 30) * Math.PI;
|
|
249
|
+
const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), this._adapter.getHour(this.activeDate), i);
|
|
250
|
+
const enabled = (!this.minDate || this._adapter.compareDatetime(date, this.minDate) >= 0) &&
|
|
251
|
+
(!this.maxDate || this._adapter.compareDatetime(date, this.maxDate) <= 0) &&
|
|
252
|
+
(!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.MINUTE));
|
|
253
|
+
this._minutes.push({
|
|
254
|
+
value: i,
|
|
255
|
+
displayValue: i === 0 ? '00' : minuteNames[i],
|
|
256
|
+
enabled,
|
|
257
|
+
top: CLOCK_RADIUS - Math.cos(radian) * CLOCK_OUTER_RADIUS - CLOCK_TICK_RADIUS,
|
|
258
|
+
left: CLOCK_RADIUS + Math.sin(radian) * CLOCK_OUTER_RADIUS - CLOCK_TICK_RADIUS,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
290
261
|
}
|
|
291
262
|
/**
|
|
292
|
-
*
|
|
293
|
-
* @
|
|
263
|
+
* Set Time
|
|
264
|
+
* @param event
|
|
294
265
|
*/
|
|
295
|
-
|
|
296
|
-
|
|
266
|
+
setTime(event) {
|
|
267
|
+
const trigger = this._elementRef.nativeElement;
|
|
268
|
+
const triggerRect = trigger.getBoundingClientRect();
|
|
269
|
+
const width = trigger.offsetWidth;
|
|
270
|
+
const height = trigger.offsetHeight;
|
|
271
|
+
const { pageX, pageY } = getPointerPositionOnPage(event);
|
|
272
|
+
const x = width / 2 - (pageX - triggerRect.left - window.pageXOffset);
|
|
273
|
+
const y = height / 2 - (pageY - triggerRect.top - window.pageYOffset);
|
|
274
|
+
let radian = Math.atan2(-x, y);
|
|
275
|
+
const unit = Math.PI / (this._hourView ? 6 : this.interval ? 30 / this.interval : 30);
|
|
276
|
+
const z = Math.sqrt(x * x + y * y);
|
|
277
|
+
const outer = this._hourView &&
|
|
278
|
+
z > (width * (CLOCK_OUTER_RADIUS / 100) + width * (CLOCK_INNER_RADIUS / 100)) / 2;
|
|
279
|
+
if (radian < 0) {
|
|
280
|
+
radian = Math.PI * 2 + radian;
|
|
281
|
+
}
|
|
282
|
+
let value = Math.round(radian / unit);
|
|
283
|
+
let date;
|
|
284
|
+
if (this._hourView) {
|
|
285
|
+
if (this.twelvehour) {
|
|
286
|
+
if (this.AMPM === 'AM') {
|
|
287
|
+
value = value === 0 ? 12 : value;
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
// if we chosen 12 in PM, the value should be 0 for 0:00,
|
|
291
|
+
// else we can safely add 12 to the final value
|
|
292
|
+
value = value === 12 ? 0 : value + 12;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
if (value === 12) {
|
|
297
|
+
value = 0;
|
|
298
|
+
}
|
|
299
|
+
value = outer ? (value === 0 ? 12 : value) : value === 0 ? 0 : value + 12;
|
|
300
|
+
}
|
|
301
|
+
date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), value, this._adapter.getMinute(this.activeDate));
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
if (this.interval) {
|
|
305
|
+
value *= this.interval;
|
|
306
|
+
}
|
|
307
|
+
if (value === 60) {
|
|
308
|
+
value = 0;
|
|
309
|
+
}
|
|
310
|
+
date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), this._adapter.getHour(this.activeDate), value);
|
|
311
|
+
}
|
|
312
|
+
// if there is a dateFilter, check if the date is allowed if it is not then do not set/emit new date
|
|
313
|
+
// https://github.com/ng-matero/extensions/issues/244
|
|
314
|
+
if (this.dateFilter &&
|
|
315
|
+
!this.dateFilter(date, this._hourView ? MtxDatetimepickerFilterType.HOUR : MtxDatetimepickerFilterType.MINUTE)) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
this._timeChanged = true;
|
|
319
|
+
this.activeDate = date;
|
|
320
|
+
this._changeDetectorRef.markForCheck();
|
|
321
|
+
this.activeDateChange.emit(this.activeDate);
|
|
297
322
|
}
|
|
298
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0
|
|
299
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
323
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxClock, deps: [{ token: i0.ElementRef }, { token: i1.DatetimeAdapter }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
324
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0", type: MtxClock, isStandalone: true, selector: "mtx-clock", inputs: { dateFilter: "dateFilter", interval: "interval", twelvehour: ["twelvehour", "twelvehour", booleanAttribute], AMPM: "AMPM", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", startView: "startView" }, outputs: { selectedChange: "selectedChange", activeDateChange: "activeDateChange", _userSelection: "_userSelection" }, host: { attributes: { "role": "clock" }, listeners: { "mousedown": "_pointerDown($event)", "touchstart": "_pointerDown($event)" }, classAttribute: "mtx-clock" }, exportAs: ["mtxClock"], usesOnChanges: true, 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 @for (item of _hours; track item) {\n <div\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 }\n </div>\n <div class=\"mtx-clock-minutes\" [class.active]=\"!_hourView\">\n @for (item of _minutes; track item) {\n <div\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 }\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;touch-action:none;font-size:var(--mtx-datetimepicker-clock-text-size)}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-dial-background-color)}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hand{position:absolute;inset:0;width:1px;margin:0 auto;transform-origin:bottom;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.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;color:var(--mtx-datetimepicker-clock-cell-text-color)}.mtx-clock-cell.mtx-clock-cell-selected{color:#fff;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-cell:not(.mtx-clock-cell-selected,.mtx-clock-cell-disabled):hover{background-color:var(--mtx-datetimepicker-clock-cell-hover-state-background-color)}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none;color:var(--mtx-datetimepicker-clock-cell-disabled-state-text-color)}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
300
325
|
}
|
|
301
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
326
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxClock, decorators: [{
|
|
302
327
|
type: Component,
|
|
303
|
-
args: [{ selector: 'mtx-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
328
|
+
args: [{ selector: 'mtx-clock', host: {
|
|
329
|
+
'role': 'clock',
|
|
330
|
+
'class': 'mtx-clock',
|
|
331
|
+
'(mousedown)': '_pointerDown($event)',
|
|
332
|
+
'(touchstart)': '_pointerDown($event)',
|
|
333
|
+
}, exportAs: 'mtxClock', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgStyle], 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 @for (item of _hours; track item) {\n <div\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 }\n </div>\n <div class=\"mtx-clock-minutes\" [class.active]=\"!_hourView\">\n @for (item of _minutes; track item) {\n <div\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 }\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;touch-action:none;font-size:var(--mtx-datetimepicker-clock-text-size)}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-dial-background-color)}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hand{position:absolute;inset:0;width:1px;margin:0 auto;transform-origin:bottom;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.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;color:var(--mtx-datetimepicker-clock-cell-text-color)}.mtx-clock-cell.mtx-clock-cell-selected{color:#fff;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-cell:not(.mtx-clock-cell-selected,.mtx-clock-cell-disabled):hover{background-color:var(--mtx-datetimepicker-clock-cell-hover-state-background-color)}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none;color:var(--mtx-datetimepicker-clock-cell-disabled-state-text-color)}\n"] }]
|
|
334
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
309
335
|
type: Inject,
|
|
310
|
-
args: [
|
|
311
|
-
}] }], propDecorators: {
|
|
336
|
+
args: [DOCUMENT]
|
|
337
|
+
}] }], propDecorators: { dateFilter: [{
|
|
312
338
|
type: Input
|
|
313
|
-
}],
|
|
339
|
+
}], interval: [{
|
|
340
|
+
type: Input
|
|
341
|
+
}], twelvehour: [{
|
|
342
|
+
type: Input,
|
|
343
|
+
args: [{ transform: booleanAttribute }]
|
|
344
|
+
}], AMPM: [{
|
|
314
345
|
type: Input
|
|
315
346
|
}], selectedChange: [{
|
|
316
347
|
type: Output
|
|
348
|
+
}], activeDateChange: [{
|
|
349
|
+
type: Output
|
|
317
350
|
}], _userSelection: [{
|
|
318
351
|
type: Output
|
|
319
352
|
}], activeDate: [{
|
|
@@ -324,176 +357,204 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImpor
|
|
|
324
357
|
type: Input
|
|
325
358
|
}], maxDate: [{
|
|
326
359
|
type: Input
|
|
360
|
+
}], startView: [{
|
|
361
|
+
type: Input
|
|
327
362
|
}] } });
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
363
|
+
/** Returns whether an event is a touch event. */
|
|
364
|
+
function isTouchEvent(event) {
|
|
365
|
+
// This function is called for every pixel that the user has dragged so we need it to be
|
|
366
|
+
// as fast as possible. Since we only bind mouse events and touch events, we can assume
|
|
367
|
+
// that if the event's name starts with `t`, it's a touch event.
|
|
368
|
+
return event.type[0] === 't';
|
|
334
369
|
}
|
|
370
|
+
/** Gets the coordinates of a touch or mouse event relative to the document. */
|
|
371
|
+
function getPointerPositionOnPage(event) {
|
|
372
|
+
let point;
|
|
373
|
+
if (isTouchEvent(event)) {
|
|
374
|
+
// `touches` will be empty for start/end events so we have to fall back to `changedTouches`.
|
|
375
|
+
point = event.touches[0] || event.changedTouches[0];
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
point = event;
|
|
379
|
+
}
|
|
380
|
+
return point;
|
|
381
|
+
}
|
|
382
|
+
|
|
335
383
|
/**
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
* "startingYear" will render when paged into view.
|
|
384
|
+
* Animations used by the Material datepicker.
|
|
385
|
+
* @docs-private
|
|
339
386
|
*/
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
387
|
+
const mtxDatetimepickerAnimations = {
|
|
388
|
+
/** Transforms the height of the datepicker's calendar. */
|
|
389
|
+
transformPanel: trigger('transformPanel', [
|
|
390
|
+
transition('void => enter-dropdown', animate('120ms cubic-bezier(0, 0, 0.2, 1)', keyframes([
|
|
391
|
+
style({ opacity: 0, transform: 'scale(1, 0.8)' }),
|
|
392
|
+
style({ opacity: 1, transform: 'scale(1, 1)' }),
|
|
393
|
+
]))),
|
|
394
|
+
transition('void => enter-dialog', animate('150ms cubic-bezier(0, 0, 0.2, 1)', keyframes([
|
|
395
|
+
style({ opacity: 0, transform: 'scale(0.7)' }),
|
|
396
|
+
style({ transform: 'none', opacity: 1 }),
|
|
397
|
+
]))),
|
|
398
|
+
transition('* => void', animate('100ms linear', style({ opacity: 0 }))),
|
|
399
|
+
]),
|
|
400
|
+
/** Fades in the content of the calendar. */
|
|
401
|
+
fadeInCalendar: trigger('fadeInCalendar', [
|
|
402
|
+
state('void', style({ opacity: 0 })),
|
|
403
|
+
state('enter', style({ opacity: 1 })),
|
|
404
|
+
// TODO(crisbeto): this animation should be removed since it isn't quite on spec, but we
|
|
405
|
+
// need to keep it until #12440 gets in, otherwise the exit animation will look glitchy.
|
|
406
|
+
transition('void => *', animate('120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)')),
|
|
407
|
+
]),
|
|
408
|
+
slideCalendar: trigger('slideCalendar', [
|
|
409
|
+
transition('* => left', [
|
|
410
|
+
animate(180, keyframes([
|
|
411
|
+
style({ transform: 'translateX(100%)', offset: 0.5 }),
|
|
412
|
+
style({ transform: 'translateX(-100%)', offset: 0.51 }),
|
|
413
|
+
style({ transform: 'translateX(0)', offset: 1 }),
|
|
414
|
+
])),
|
|
415
|
+
]),
|
|
416
|
+
transition('* => right', [
|
|
417
|
+
animate(180, keyframes([
|
|
418
|
+
style({ transform: 'translateX(-100%)', offset: 0.5 }),
|
|
419
|
+
style({ transform: 'translateX(100%)', offset: 0.51 }),
|
|
420
|
+
style({ transform: 'translateX(0)', offset: 1 }),
|
|
421
|
+
])),
|
|
422
|
+
]),
|
|
423
|
+
]),
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
/** @docs-private */
|
|
427
|
+
function createMissingDateImplError(provider) {
|
|
428
|
+
return Error(`MtxDatetimepicker: No provider found for ${provider}. You must add one of the following ` +
|
|
429
|
+
`to your app config: provideNativeDatetimeAdapter, provideDateFnsDatetimeAdapter,` +
|
|
430
|
+
`provideLuxonDatetimeAdapter, provideMomentDatetimeAdapter, or provide a ` +
|
|
431
|
+
`custom implementation.`);
|
|
343
432
|
}
|
|
433
|
+
|
|
344
434
|
/**
|
|
345
|
-
*
|
|
346
|
-
*
|
|
435
|
+
* An internal class that represents the data corresponding to a single calendar cell.
|
|
436
|
+
* @docs-private
|
|
347
437
|
*/
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
else if (minDate) {
|
|
355
|
-
startingYear = dateAdapter.getYear(minDate);
|
|
438
|
+
class MtxCalendarCell {
|
|
439
|
+
constructor(value, displayValue, ariaLabel, enabled) {
|
|
440
|
+
this.value = value;
|
|
441
|
+
this.displayValue = displayValue;
|
|
442
|
+
this.ariaLabel = ariaLabel;
|
|
443
|
+
this.enabled = enabled;
|
|
356
444
|
}
|
|
357
|
-
return startingYear;
|
|
358
|
-
}
|
|
359
|
-
/** Gets remainder that is non-negative, even if first number is negative */
|
|
360
|
-
function euclideanModulo(a, b) {
|
|
361
|
-
return ((a % b) + b) % b;
|
|
362
445
|
}
|
|
363
|
-
|
|
364
|
-
|
|
446
|
+
/**
|
|
447
|
+
* An internal component used to display calendar data in a table.
|
|
448
|
+
* @docs-private
|
|
449
|
+
*/
|
|
450
|
+
class MtxCalendarBody {
|
|
365
451
|
constructor() {
|
|
366
|
-
/**
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
this.openCalendarLabel = 'Open calendar';
|
|
375
|
-
/** Label for the button used to close the calendar popup. */
|
|
376
|
-
this.closeCalendarLabel = 'Close calendar';
|
|
377
|
-
/** A label for the previous month button (used by screen readers). */
|
|
378
|
-
this.prevMonthLabel = 'Previous month';
|
|
379
|
-
/** A label for the next month button (used by screen readers). */
|
|
380
|
-
this.nextMonthLabel = 'Next month';
|
|
381
|
-
/** A label for the previous year button (used by screen readers). */
|
|
382
|
-
this.prevYearLabel = 'Previous year';
|
|
383
|
-
/** A label for the next year button (used by screen readers). */
|
|
384
|
-
this.nextYearLabel = 'Next year';
|
|
385
|
-
/** A label for the previous multi-year button (used by screen readers). */
|
|
386
|
-
this.prevMultiYearLabel = 'Previous 24 years';
|
|
387
|
-
/** A label for the next multi-year button (used by screen readers). */
|
|
388
|
-
this.nextMultiYearLabel = 'Next 24 years';
|
|
389
|
-
/** A label for the 'switch to month view' button (used by screen readers). */
|
|
390
|
-
this.switchToMonthViewLabel = 'Choose date';
|
|
391
|
-
/** A label for the 'switch to year view' button (used by screen readers). */
|
|
392
|
-
this.switchToYearViewLabel = 'Choose month';
|
|
393
|
-
/** A label for the 'switch to multi-year view' button (used by screen readers). */
|
|
394
|
-
this.switchToMultiYearViewLabel = 'Choose month and year';
|
|
395
|
-
/** A label for the first date of a range of dates (used by screen readers). */
|
|
396
|
-
this.startDateLabel = 'Start date';
|
|
397
|
-
/** A label for the last date of a range of dates (used by screen readers). */
|
|
398
|
-
this.endDateLabel = 'End date';
|
|
399
|
-
/** A label for the 'switch to clock hour view' button (used by screen readers). */
|
|
400
|
-
this.switchToClockHourViewLabel = 'Choose hour';
|
|
401
|
-
/** A label for the 'switch to clock minute view' button (used by screen readers). */
|
|
402
|
-
this.switchToClockMinuteViewLabel = 'Choose minute';
|
|
403
|
-
/** Label used for ok button within the manual time input. */
|
|
404
|
-
this.okLabel = 'OK';
|
|
405
|
-
/** Label used for cancel button within the manual time input. */
|
|
406
|
-
this.cancelLabel = 'Cancel';
|
|
452
|
+
/** The number of columns in the table. */
|
|
453
|
+
this.numCols = 7;
|
|
454
|
+
/** Whether to allow selection of disabled cells. */
|
|
455
|
+
this.allowDisabledSelection = false;
|
|
456
|
+
/** The cell number of the active cell in the table. */
|
|
457
|
+
this.activeCell = 0;
|
|
458
|
+
/** Emits when a new value is selected. */
|
|
459
|
+
this.selectedValueChange = new EventEmitter();
|
|
407
460
|
}
|
|
408
|
-
/**
|
|
409
|
-
|
|
410
|
-
return
|
|
461
|
+
/** The number of blank cells to put at the beginning for the first row. */
|
|
462
|
+
get _firstRowOffset() {
|
|
463
|
+
return this.rows && this.rows.length && this.rows[0].length
|
|
464
|
+
? this.numCols - this.rows[0].length
|
|
465
|
+
: 0;
|
|
411
466
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
467
|
+
_cellClicked(cell) {
|
|
468
|
+
if (!this.allowDisabledSelection && !cell.enabled) {
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
this.selectedValueChange.emit(cell.value);
|
|
472
|
+
}
|
|
473
|
+
_isActiveCell(rowIndex, colIndex) {
|
|
474
|
+
let cellNumber = rowIndex * this.numCols + colIndex;
|
|
475
|
+
// Account for the fact that the first row may not have as many cells.
|
|
476
|
+
if (rowIndex) {
|
|
477
|
+
cellNumber -= this._firstRowOffset;
|
|
478
|
+
}
|
|
479
|
+
return cellNumber === this.activeCell;
|
|
415
480
|
}
|
|
416
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0
|
|
417
|
-
/** @nocollapse */ static { this.ɵ
|
|
481
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxCalendarBody, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
482
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0", type: MtxCalendarBody, isStandalone: true, 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@if (_firstRowOffset < labelMinRequiredCells) {\n <tr aria-hidden=\"true\">\n <td class=\"mtx-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\n </tr>\n}\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n@for (row of rows; track row; let rowIndex = $index) {\n <tr 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 @if (rowIndex === 0 && _firstRowOffset) {\n <td\n class=\"mtx-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" aria-hidden=\"true\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n }\n @for (item of row; track item; let colIndex = $index) {\n <td\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 }\n </tr>\n}\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-today-outline-color)}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%;font-size:var(--mtx-datetimepicker-calendar-body-label-text-size);font-weight:var(--mtx-datetimepicker-calendar-body-label-text-weight);color:var(--mtx-datetimepicker-calendar-body-label-text-color)}[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-disabled>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.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;color:var(--mtx-datetimepicker-calendar-date-text-color);border-color:var(--mtx-datetimepicker-calendar-date-outline-color)}.mtx-calendar-body-active>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-focus-state-background-color)}@media (hover: hover){.mtx-calendar-body-cell:not(.mtx-calendar-body-disabled):hover>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-hover-state-background-color)}}.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-state-background-color);color:var(--mtx-datetimepicker-calendar-date-selected-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-disabled-state-background-color)}.mtx-calendar-body-selected.mtx-calendar-body-today{box-shadow:inset 0 0 0 1px var(--mtx-datetimepicker-calendar-date-today-selected-state-outline-color)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
418
483
|
}
|
|
419
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
420
|
-
type:
|
|
421
|
-
args: [{
|
|
422
|
-
|
|
484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxCalendarBody, decorators: [{
|
|
485
|
+
type: Component,
|
|
486
|
+
args: [{ selector: '[mtx-calendar-body]', host: {
|
|
487
|
+
class: 'mtx-calendar-body',
|
|
488
|
+
}, exportAs: 'mtxCalendarBody', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, 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@if (_firstRowOffset < labelMinRequiredCells) {\n <tr aria-hidden=\"true\">\n <td class=\"mtx-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\n </tr>\n}\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n@for (row of rows; track row; let rowIndex = $index) {\n <tr 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 @if (rowIndex === 0 && _firstRowOffset) {\n <td\n class=\"mtx-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" aria-hidden=\"true\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n }\n @for (item of row; track item; let colIndex = $index) {\n <td\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 }\n </tr>\n}\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-today-outline-color)}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%;font-size:var(--mtx-datetimepicker-calendar-body-label-text-size);font-weight:var(--mtx-datetimepicker-calendar-body-label-text-weight);color:var(--mtx-datetimepicker-calendar-body-label-text-color)}[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-disabled>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.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;color:var(--mtx-datetimepicker-calendar-date-text-color);border-color:var(--mtx-datetimepicker-calendar-date-outline-color)}.mtx-calendar-body-active>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-focus-state-background-color)}@media (hover: hover){.mtx-calendar-body-cell:not(.mtx-calendar-body-disabled):hover>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-hover-state-background-color)}}.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-state-background-color);color:var(--mtx-datetimepicker-calendar-date-selected-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-disabled-state-background-color)}.mtx-calendar-body-selected.mtx-calendar-body-today{box-shadow:inset 0 0 0 1px var(--mtx-datetimepicker-calendar-date-today-selected-state-outline-color)}\n"] }]
|
|
489
|
+
}], propDecorators: { label: [{
|
|
490
|
+
type: Input
|
|
491
|
+
}], rows: [{
|
|
492
|
+
type: Input
|
|
493
|
+
}], todayValue: [{
|
|
494
|
+
type: Input
|
|
495
|
+
}], selectedValue: [{
|
|
496
|
+
type: Input
|
|
497
|
+
}], labelMinRequiredCells: [{
|
|
498
|
+
type: Input
|
|
499
|
+
}], numCols: [{
|
|
500
|
+
type: Input
|
|
501
|
+
}], allowDisabledSelection: [{
|
|
502
|
+
type: Input
|
|
503
|
+
}], activeCell: [{
|
|
504
|
+
type: Input
|
|
505
|
+
}], selectedValueChange: [{
|
|
506
|
+
type: Output
|
|
507
|
+
}] } });
|
|
423
508
|
|
|
424
|
-
const
|
|
425
|
-
const CLOCK_RADIUS = 50;
|
|
426
|
-
const CLOCK_INNER_RADIUS = 27.5;
|
|
427
|
-
const CLOCK_OUTER_RADIUS = 41.25;
|
|
428
|
-
const CLOCK_TICK_RADIUS = 7.0833;
|
|
509
|
+
const DAYS_PER_WEEK = 7;
|
|
429
510
|
/**
|
|
430
|
-
*
|
|
511
|
+
* An internal component used to display a single month in the datetimepicker.
|
|
431
512
|
* @docs-private
|
|
432
513
|
*/
|
|
433
|
-
class
|
|
434
|
-
constructor(
|
|
435
|
-
this._elementRef = _elementRef;
|
|
514
|
+
class MtxMonthView {
|
|
515
|
+
constructor(_adapter, _dateFormats) {
|
|
436
516
|
this._adapter = _adapter;
|
|
437
|
-
this.
|
|
438
|
-
this.
|
|
439
|
-
/**
|
|
440
|
-
this.interval = 1;
|
|
441
|
-
/** Whether the clock uses 12 hour format. */
|
|
442
|
-
this.twelvehour = false;
|
|
443
|
-
/** Whether the time is now in AM or PM. */
|
|
444
|
-
this.AMPM = 'AM';
|
|
445
|
-
/** Emits when the currently selected date changes. */
|
|
517
|
+
this._dateFormats = _dateFormats;
|
|
518
|
+
this.type = 'date';
|
|
519
|
+
/** Emits when a new date is selected. */
|
|
446
520
|
this.selectedChange = new EventEmitter();
|
|
447
|
-
/** Emits when any date is activated. */
|
|
448
|
-
this.activeDateChange = new EventEmitter();
|
|
449
521
|
/** Emits when any date is selected. */
|
|
450
522
|
this._userSelection = new EventEmitter();
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
this.
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
this._pointerMove = (event) => {
|
|
467
|
-
if (event.cancelable) {
|
|
468
|
-
event.preventDefault();
|
|
469
|
-
}
|
|
470
|
-
this.setTime(event);
|
|
471
|
-
};
|
|
472
|
-
/** Called when the user has lifted their pointer. Bound on the document level. */
|
|
473
|
-
this._pointerUp = (event) => {
|
|
474
|
-
if (event.cancelable) {
|
|
475
|
-
event.preventDefault();
|
|
476
|
-
}
|
|
477
|
-
this._removeGlobalEvents();
|
|
478
|
-
if (this._timeChanged) {
|
|
479
|
-
this.selectedChange.emit(this.activeDate);
|
|
480
|
-
if (!this._hourView) {
|
|
481
|
-
this._userSelection.emit();
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
};
|
|
523
|
+
if (!this._adapter) {
|
|
524
|
+
throw createMissingDateImplError('DatetimeAdapter');
|
|
525
|
+
}
|
|
526
|
+
if (!this._dateFormats) {
|
|
527
|
+
throw createMissingDateImplError('MTX_DATETIME_FORMATS');
|
|
528
|
+
}
|
|
529
|
+
const firstDayOfWeek = this._adapter.getFirstDayOfWeek();
|
|
530
|
+
const narrowWeekdays = this._adapter.getDayOfWeekNames('narrow');
|
|
531
|
+
const longWeekdays = this._adapter.getDayOfWeekNames('long');
|
|
532
|
+
// Rotate the labels for days of the week based on the configured first day of the week.
|
|
533
|
+
const weekdays = longWeekdays.map((long, i) => {
|
|
534
|
+
return { long, narrow: narrowWeekdays[i] };
|
|
535
|
+
});
|
|
536
|
+
this._weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek));
|
|
537
|
+
this._activeDate = this._adapter.today();
|
|
485
538
|
}
|
|
486
539
|
/**
|
|
487
|
-
* The date to display in this
|
|
540
|
+
* The date to display in this month view (everything other than the month and year is ignored).
|
|
488
541
|
*/
|
|
489
542
|
get activeDate() {
|
|
490
543
|
return this._activeDate;
|
|
491
544
|
}
|
|
492
545
|
set activeDate(value) {
|
|
493
546
|
const oldActiveDate = this._activeDate;
|
|
494
|
-
this._activeDate = this._adapter.
|
|
495
|
-
if (
|
|
547
|
+
this._activeDate = value || this._adapter.today();
|
|
548
|
+
if (oldActiveDate &&
|
|
549
|
+
this._activeDate &&
|
|
550
|
+
!this._adapter.sameMonthAndYear(oldActiveDate, this._activeDate)) {
|
|
496
551
|
this._init();
|
|
552
|
+
if (this._adapter.isInNextMonth(oldActiveDate, this._activeDate)) {
|
|
553
|
+
this.calendarState('right');
|
|
554
|
+
}
|
|
555
|
+
else {
|
|
556
|
+
this.calendarState('left');
|
|
557
|
+
}
|
|
497
558
|
}
|
|
498
559
|
}
|
|
499
560
|
/** The currently selected date. */
|
|
@@ -501,246 +562,248 @@ class MtxClock {
|
|
|
501
562
|
return this._selected;
|
|
502
563
|
}
|
|
503
564
|
set selected(value) {
|
|
504
|
-
this._selected =
|
|
505
|
-
|
|
506
|
-
|
|
565
|
+
this._selected = value;
|
|
566
|
+
this._selectedDate = this._getDateInCurrentMonth(this.selected);
|
|
567
|
+
}
|
|
568
|
+
ngAfterContentInit() {
|
|
569
|
+
this._init();
|
|
570
|
+
}
|
|
571
|
+
/** Handles when a new date is selected. */
|
|
572
|
+
_dateSelected(date) {
|
|
573
|
+
this.selectedChange.emit(this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), date, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)));
|
|
574
|
+
if (this.type === 'date') {
|
|
575
|
+
this._userSelection.emit();
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
_calendarStateDone() {
|
|
579
|
+
this._calendarState = '';
|
|
580
|
+
}
|
|
581
|
+
/** Initializes this month view. */
|
|
582
|
+
_init() {
|
|
583
|
+
this._selectedDate = this._getDateInCurrentMonth(this.selected);
|
|
584
|
+
this._todayDate = this._getDateInCurrentMonth(this._adapter.today());
|
|
585
|
+
const firstOfMonth = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
|
|
586
|
+
this._firstWeekOffset =
|
|
587
|
+
(DAYS_PER_WEEK +
|
|
588
|
+
this._adapter.getDayOfWeek(firstOfMonth) -
|
|
589
|
+
this._adapter.getFirstDayOfWeek()) %
|
|
590
|
+
DAYS_PER_WEEK;
|
|
591
|
+
this._createWeekCells();
|
|
592
|
+
}
|
|
593
|
+
/** Creates MdCalendarCells for the dates in this month. */
|
|
594
|
+
_createWeekCells() {
|
|
595
|
+
const daysInMonth = this._adapter.getNumDaysInMonth(this.activeDate);
|
|
596
|
+
const dateNames = this._adapter.getDateNames();
|
|
597
|
+
this._weeks = [[]];
|
|
598
|
+
for (let i = 0, cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {
|
|
599
|
+
if (cell === DAYS_PER_WEEK) {
|
|
600
|
+
this._weeks.push([]);
|
|
601
|
+
cell = 0;
|
|
602
|
+
}
|
|
603
|
+
const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), i + 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
|
|
604
|
+
const enabled = !this.dateFilter || this.dateFilter(date);
|
|
605
|
+
const ariaLabel = this._adapter.format(date, this._dateFormats.display.dateA11yLabel);
|
|
606
|
+
this._weeks[this._weeks.length - 1].push(new MtxCalendarCell(i + 1, dateNames[i], ariaLabel, enabled));
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Gets the date in this month that the given Date falls on.
|
|
611
|
+
* Returns null if the given Date is in another month.
|
|
612
|
+
*/
|
|
613
|
+
_getDateInCurrentMonth(date) {
|
|
614
|
+
return this._adapter.sameMonthAndYear(date, this.activeDate)
|
|
615
|
+
? this._adapter.getDate(date)
|
|
616
|
+
: null;
|
|
617
|
+
}
|
|
618
|
+
calendarState(direction) {
|
|
619
|
+
this._calendarState = direction;
|
|
620
|
+
}
|
|
621
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxMonthView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
622
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0", type: MtxMonthView, isStandalone: true, selector: "mtx-month-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxMonthView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\">\n <tr>\n @for (day of _weekdays; track day) {\n <th [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\n }\n </tr>\n </thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [rows]=\"_weeks\"\n [todayValue]=\"_todayDate!\"\n [activeCell]=\"_adapter.getDate(activeDate) - 1\"\n [selectedValue]=\"_selectedDate!\"\n (selectedValueChange)=\"_dateSelected($event)\"></tbody>\n</table>\n", dependencies: [{ kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
623
|
+
}
|
|
624
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxMonthView, decorators: [{
|
|
625
|
+
type: Component,
|
|
626
|
+
args: [{ selector: 'mtx-month-view', exportAs: 'mtxMonthView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MtxCalendarBody], template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\">\n <tr>\n @for (day of _weekdays; track day) {\n <th [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\n }\n </tr>\n </thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [rows]=\"_weeks\"\n [todayValue]=\"_todayDate!\"\n [activeCell]=\"_adapter.getDate(activeDate) - 1\"\n [selectedValue]=\"_selectedDate!\"\n (selectedValueChange)=\"_dateSelected($event)\"></tbody>\n</table>\n" }]
|
|
627
|
+
}], ctorParameters: () => [{ type: i1.DatetimeAdapter, decorators: [{
|
|
628
|
+
type: Optional
|
|
629
|
+
}] }, { type: undefined, decorators: [{
|
|
630
|
+
type: Optional
|
|
631
|
+
}, {
|
|
632
|
+
type: Inject,
|
|
633
|
+
args: [MTX_DATETIME_FORMATS]
|
|
634
|
+
}] }], propDecorators: { type: [{
|
|
635
|
+
type: Input
|
|
636
|
+
}], dateFilter: [{
|
|
637
|
+
type: Input
|
|
638
|
+
}], selectedChange: [{
|
|
639
|
+
type: Output
|
|
640
|
+
}], _userSelection: [{
|
|
641
|
+
type: Output
|
|
642
|
+
}], activeDate: [{
|
|
643
|
+
type: Input
|
|
644
|
+
}], selected: [{
|
|
645
|
+
type: Input
|
|
646
|
+
}] } });
|
|
647
|
+
|
|
648
|
+
const yearsPerPage = 24;
|
|
649
|
+
const yearsPerRow = 4;
|
|
650
|
+
/**
|
|
651
|
+
* An internal component used to display multiple years in the datetimepicker.
|
|
652
|
+
* @docs-private
|
|
653
|
+
*/
|
|
654
|
+
class MtxMultiYearView {
|
|
655
|
+
constructor(_adapter, _dateFormats) {
|
|
656
|
+
this._adapter = _adapter;
|
|
657
|
+
this._dateFormats = _dateFormats;
|
|
658
|
+
this.type = 'date';
|
|
659
|
+
/** Emits when a new month is selected. */
|
|
660
|
+
this.selectedChange = new EventEmitter();
|
|
661
|
+
/** Emits when any date is selected. */
|
|
662
|
+
this._userSelection = new EventEmitter();
|
|
663
|
+
if (!this._adapter) {
|
|
664
|
+
throw createMissingDateImplError('DatetimeAdapter');
|
|
665
|
+
}
|
|
666
|
+
if (!this._dateFormats) {
|
|
667
|
+
throw createMissingDateImplError('MTX_DATETIME_FORMATS');
|
|
668
|
+
}
|
|
669
|
+
this._activeDate = this._adapter.today();
|
|
670
|
+
}
|
|
671
|
+
/** The date to display in this multi year view */
|
|
672
|
+
get activeDate() {
|
|
673
|
+
return this._activeDate;
|
|
674
|
+
}
|
|
675
|
+
set activeDate(value) {
|
|
676
|
+
const oldActiveDate = this._activeDate;
|
|
677
|
+
this._activeDate = value || this._adapter.today();
|
|
678
|
+
if (oldActiveDate &&
|
|
679
|
+
this._activeDate &&
|
|
680
|
+
!isSameMultiYearView(this._adapter, oldActiveDate, this._activeDate, this.minDate, this.maxDate)) {
|
|
681
|
+
this._init();
|
|
507
682
|
}
|
|
508
683
|
}
|
|
684
|
+
/** The currently selected date. */
|
|
685
|
+
get selected() {
|
|
686
|
+
return this._selected;
|
|
687
|
+
}
|
|
688
|
+
set selected(value) {
|
|
689
|
+
this._selected = value;
|
|
690
|
+
this._selectedYear = this._selected && this._adapter.getYear(this._selected);
|
|
691
|
+
}
|
|
509
692
|
/** The minimum selectable date. */
|
|
510
693
|
get minDate() {
|
|
511
694
|
return this._minDate;
|
|
512
695
|
}
|
|
513
696
|
set minDate(value) {
|
|
514
|
-
this._minDate = this.
|
|
697
|
+
this._minDate = this._getValidDateOrNull(this._adapter.deserialize(value));
|
|
515
698
|
}
|
|
516
699
|
/** The maximum selectable date. */
|
|
517
700
|
get maxDate() {
|
|
518
701
|
return this._maxDate;
|
|
519
702
|
}
|
|
520
703
|
set maxDate(value) {
|
|
521
|
-
this._maxDate = this.
|
|
522
|
-
}
|
|
523
|
-
/** Whether the clock should be started in hour or minute view. */
|
|
524
|
-
set startView(value) {
|
|
525
|
-
this._hourView = value !== 'minute';
|
|
526
|
-
}
|
|
527
|
-
get _hand() {
|
|
528
|
-
const hour = this._adapter.getHour(this.activeDate);
|
|
529
|
-
this._selectedHour = hour;
|
|
530
|
-
this._selectedMinute = this._adapter.getMinute(this.activeDate);
|
|
531
|
-
let deg = 0;
|
|
532
|
-
let radius = CLOCK_OUTER_RADIUS;
|
|
533
|
-
if (this._hourView) {
|
|
534
|
-
const outer = this._selectedHour > 0 && this._selectedHour < 13;
|
|
535
|
-
radius = outer ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
|
|
536
|
-
if (this.twelvehour) {
|
|
537
|
-
radius = CLOCK_OUTER_RADIUS;
|
|
538
|
-
}
|
|
539
|
-
deg = Math.round(this._selectedHour * (360 / (24 / 2)));
|
|
540
|
-
}
|
|
541
|
-
else {
|
|
542
|
-
deg = Math.round(this._selectedMinute * (360 / 60));
|
|
543
|
-
}
|
|
544
|
-
return {
|
|
545
|
-
height: `${radius}%`,
|
|
546
|
-
marginTop: `${50 - radius}%`,
|
|
547
|
-
transform: `rotate(${deg}deg)`,
|
|
548
|
-
};
|
|
704
|
+
this._maxDate = this._getValidDateOrNull(this._adapter.deserialize(value));
|
|
549
705
|
}
|
|
550
706
|
ngAfterContentInit() {
|
|
551
|
-
this.activeDate = this._activeDate || this._adapter.today();
|
|
552
|
-
this._init();
|
|
553
|
-
}
|
|
554
|
-
ngOnDestroy() {
|
|
555
|
-
this._removeGlobalEvents();
|
|
556
|
-
}
|
|
557
|
-
ngOnChanges() {
|
|
558
707
|
this._init();
|
|
559
708
|
}
|
|
560
|
-
/**
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
const endEventName = isTouch ? 'touchend' : 'mouseup';
|
|
568
|
-
document.addEventListener(moveEventName, this._pointerMove, activeEventOptions);
|
|
569
|
-
document.addEventListener(endEventName, this._pointerUp, activeEventOptions);
|
|
570
|
-
if (isTouch) {
|
|
571
|
-
document.addEventListener('touchcancel', this._pointerUp, activeEventOptions);
|
|
709
|
+
/** Handles when a new year is selected. */
|
|
710
|
+
_yearSelected(year) {
|
|
711
|
+
const month = this._adapter.getMonth(this.activeDate);
|
|
712
|
+
const normalizedDate = this._adapter.createDatetime(year, month, 1, 0, 0);
|
|
713
|
+
this.selectedChange.emit(this._adapter.createDatetime(year, month, Math.min(this._adapter.getDate(this.activeDate), this._adapter.getNumDaysInMonth(normalizedDate)), this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)));
|
|
714
|
+
if (this.type === 'year') {
|
|
715
|
+
this._userSelection.emit();
|
|
572
716
|
}
|
|
573
717
|
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
const document = this._document;
|
|
577
|
-
document.removeEventListener('mousemove', this._pointerMove, activeEventOptions);
|
|
578
|
-
document.removeEventListener('mouseup', this._pointerUp, activeEventOptions);
|
|
579
|
-
document.removeEventListener('touchmove', this._pointerMove, activeEventOptions);
|
|
580
|
-
document.removeEventListener('touchend', this._pointerUp, activeEventOptions);
|
|
581
|
-
document.removeEventListener('touchcancel', this._pointerUp, activeEventOptions);
|
|
718
|
+
_getActiveCell() {
|
|
719
|
+
return getActiveOffset(this._adapter, this.activeDate, this.minDate, this.maxDate);
|
|
582
720
|
}
|
|
583
|
-
|
|
721
|
+
_calendarStateDone() {
|
|
722
|
+
this._calendarState = '';
|
|
723
|
+
}
|
|
724
|
+
/** Initializes this year view. */
|
|
584
725
|
_init() {
|
|
585
|
-
this.
|
|
586
|
-
this.
|
|
587
|
-
const
|
|
588
|
-
const
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), hour, 0);
|
|
596
|
-
// Check if the date is enabled, no need to respect the minute setting here
|
|
597
|
-
const enabled = (!this.minDate ||
|
|
598
|
-
this._adapter.compareDatetime(date, this.minDate, false) >= 0) &&
|
|
599
|
-
(!this.maxDate ||
|
|
600
|
-
this._adapter.compareDatetime(date, this.maxDate, false) <= 0) &&
|
|
601
|
-
(!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.HOUR));
|
|
602
|
-
// display value for twelvehour clock should be from 1-12 not including 0 and not above 12
|
|
603
|
-
hours.push({
|
|
604
|
-
value: i,
|
|
605
|
-
displayValue: i % 12 === 0 ? '12' : hourNames[i % 12],
|
|
606
|
-
enabled,
|
|
607
|
-
top: CLOCK_RADIUS - Math.cos(radian) * radius - CLOCK_TICK_RADIUS,
|
|
608
|
-
left: CLOCK_RADIUS + Math.sin(radian) * radius - CLOCK_TICK_RADIUS,
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
// filter out AM or PM hours based on AMPM
|
|
612
|
-
if (this.AMPM === 'AM') {
|
|
613
|
-
this._hours = hours.filter(x => x.value < 12);
|
|
614
|
-
}
|
|
615
|
-
else {
|
|
616
|
-
this._hours = hours.filter(x => x.value >= 12);
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
for (let i = 0; i < hourNames.length; i++) {
|
|
621
|
-
const radian = (i / 6) * Math.PI;
|
|
622
|
-
const outer = i > 0 && i < 13;
|
|
623
|
-
const radius = outer ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
|
|
624
|
-
const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), i, 0);
|
|
625
|
-
// Check if the date is enabled, no need to respect the minute setting here
|
|
626
|
-
const enabled = (!this.minDate ||
|
|
627
|
-
this._adapter.compareDatetime(date, this.minDate, false) >= 0) &&
|
|
628
|
-
(!this.maxDate ||
|
|
629
|
-
this._adapter.compareDatetime(date, this.maxDate, false) <= 0) &&
|
|
630
|
-
(!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.HOUR));
|
|
631
|
-
this._hours.push({
|
|
632
|
-
value: i,
|
|
633
|
-
displayValue: i === 0 ? '00' : hourNames[i],
|
|
634
|
-
enabled,
|
|
635
|
-
top: CLOCK_RADIUS - Math.cos(radian) * radius - CLOCK_TICK_RADIUS,
|
|
636
|
-
left: CLOCK_RADIUS + Math.sin(radian) * radius - CLOCK_TICK_RADIUS,
|
|
637
|
-
fontSize: i > 0 && i < 13 ? '' : '80%',
|
|
638
|
-
});
|
|
726
|
+
this._todayYear = this._adapter.getYear(this._adapter.today());
|
|
727
|
+
this._yearLabel = this._adapter.getYearName(this.activeDate);
|
|
728
|
+
const activeYear = this._adapter.getYear(this.activeDate);
|
|
729
|
+
const minYearOfPage = activeYear - getActiveOffset(this._adapter, this.activeDate, this.minDate, this.maxDate);
|
|
730
|
+
this._years = [];
|
|
731
|
+
for (let i = 0, row = []; i < yearsPerPage; i++) {
|
|
732
|
+
row.push(minYearOfPage + i);
|
|
733
|
+
if (row.length === yearsPerRow) {
|
|
734
|
+
this._years.push(row.map(year => this._createCellForYear(year)));
|
|
735
|
+
row = [];
|
|
639
736
|
}
|
|
640
737
|
}
|
|
641
|
-
for (let i = 0; i < minuteNames.length; i += 5) {
|
|
642
|
-
const radian = (i / 30) * Math.PI;
|
|
643
|
-
const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), this._adapter.getHour(this.activeDate), i);
|
|
644
|
-
const enabled = (!this.minDate || this._adapter.compareDatetime(date, this.minDate) >= 0) &&
|
|
645
|
-
(!this.maxDate || this._adapter.compareDatetime(date, this.maxDate) <= 0) &&
|
|
646
|
-
(!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.MINUTE));
|
|
647
|
-
this._minutes.push({
|
|
648
|
-
value: i,
|
|
649
|
-
displayValue: i === 0 ? '00' : minuteNames[i],
|
|
650
|
-
enabled,
|
|
651
|
-
top: CLOCK_RADIUS - Math.cos(radian) * CLOCK_OUTER_RADIUS - CLOCK_TICK_RADIUS,
|
|
652
|
-
left: CLOCK_RADIUS + Math.sin(radian) * CLOCK_OUTER_RADIUS - CLOCK_TICK_RADIUS,
|
|
653
|
-
});
|
|
654
|
-
}
|
|
655
738
|
}
|
|
656
|
-
/**
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
const unit = Math.PI / (this._hourView ? 6 : this.interval ? 30 / this.interval : 30);
|
|
670
|
-
const z = Math.sqrt(x * x + y * y);
|
|
671
|
-
const outer = this._hourView &&
|
|
672
|
-
z > (width * (CLOCK_OUTER_RADIUS / 100) + width * (CLOCK_INNER_RADIUS / 100)) / 2;
|
|
673
|
-
if (radian < 0) {
|
|
674
|
-
radian = Math.PI * 2 + radian;
|
|
739
|
+
/** Creates an MtxCalendarCell for the given year. */
|
|
740
|
+
_createCellForYear(year) {
|
|
741
|
+
const yearName = this._adapter.getYearName(this._adapter.createDate(year, 0, 1));
|
|
742
|
+
return new MtxCalendarCell(year, yearName, yearName, this._shouldEnableYear(year));
|
|
743
|
+
}
|
|
744
|
+
/** Whether the given year is enabled. */
|
|
745
|
+
_shouldEnableYear(year) {
|
|
746
|
+
// disable if the year is greater than maxDate lower than minDate
|
|
747
|
+
if (year === undefined ||
|
|
748
|
+
year === null ||
|
|
749
|
+
(this.maxDate && year > this._adapter.getYear(this.maxDate)) ||
|
|
750
|
+
(this.minDate && year < this._adapter.getYear(this.minDate))) {
|
|
751
|
+
return false;
|
|
675
752
|
}
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
if (this.twelvehour) {
|
|
680
|
-
if (this.AMPM === 'AM') {
|
|
681
|
-
value = value === 0 ? 12 : value;
|
|
682
|
-
}
|
|
683
|
-
else {
|
|
684
|
-
// if we chosen 12 in PM, the value should be 0 for 0:00,
|
|
685
|
-
// else we can safely add 12 to the final value
|
|
686
|
-
value = value === 12 ? 0 : value + 12;
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
else {
|
|
690
|
-
if (value === 12) {
|
|
691
|
-
value = 0;
|
|
692
|
-
}
|
|
693
|
-
value = outer ? (value === 0 ? 12 : value) : value === 0 ? 0 : value + 12;
|
|
694
|
-
}
|
|
695
|
-
date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), value, this._adapter.getMinute(this.activeDate));
|
|
753
|
+
// enable if it reaches here and there's no filter defined
|
|
754
|
+
if (!this.dateFilter) {
|
|
755
|
+
return true;
|
|
696
756
|
}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
value = 0;
|
|
757
|
+
const firstOfYear = this._adapter.createDate(year, 0, 1);
|
|
758
|
+
// If any date in the year is enabled count the year as enabled.
|
|
759
|
+
for (let date = firstOfYear; this._adapter.getYear(date) === year; date = this._adapter.addCalendarDays(date, 1)) {
|
|
760
|
+
if (this.dateFilter(date)) {
|
|
761
|
+
return true;
|
|
703
762
|
}
|
|
704
|
-
date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), this._adapter.getHour(this.activeDate), value);
|
|
705
|
-
}
|
|
706
|
-
// if there is a dateFilter, check if the date is allowed if it is not then do not set/emit new date
|
|
707
|
-
// https://github.com/ng-matero/extensions/issues/244
|
|
708
|
-
if (this.dateFilter &&
|
|
709
|
-
!this.dateFilter(date, this._hourView ? MtxDatetimepickerFilterType.HOUR : MtxDatetimepickerFilterType.MINUTE)) {
|
|
710
|
-
return;
|
|
711
763
|
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
764
|
+
return false;
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Gets the year in this years range that the given Date falls on.
|
|
768
|
+
* Returns null if the given Date is not in this range.
|
|
769
|
+
*/
|
|
770
|
+
_getYearInCurrentRange(date) {
|
|
771
|
+
const year = this._adapter.getYear(date);
|
|
772
|
+
return this._isInRange(year) ? year : null;
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* Validate if the current year is in the current range
|
|
776
|
+
* Returns true if is in range else returns false
|
|
777
|
+
*/
|
|
778
|
+
_isInRange(year) {
|
|
779
|
+
return true;
|
|
716
780
|
}
|
|
717
|
-
/**
|
|
718
|
-
|
|
781
|
+
/**
|
|
782
|
+
* @param obj The object to check.
|
|
783
|
+
* @returns The given object if it is both a date instance and valid, otherwise null.
|
|
784
|
+
*/
|
|
785
|
+
_getValidDateOrNull(obj) {
|
|
786
|
+
return this._adapter.isDateInstance(obj) && this._adapter.isValid(obj) ? obj : null;
|
|
787
|
+
}
|
|
788
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxMultiYearView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
789
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0", type: MtxMultiYearView, isStandalone: true, selector: "mtx-multi-year-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxMultiYearView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [todayValue]=\"_todayYear\"\n [rows]=\"_years\"\n [numCols]=\"4\"\n [activeCell]=\"_getActiveCell()\"\n [allowDisabledSelection]=\"true\"\n [selectedValue]=\"_selectedYear!\"\n (selectedValueChange)=\"_yearSelected($event)\"></tbody>\n</table>\n", dependencies: [{ kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
719
790
|
}
|
|
720
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
791
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxMultiYearView, decorators: [{
|
|
721
792
|
type: Component,
|
|
722
|
-
args: [{ selector: 'mtx-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
793
|
+
args: [{ selector: 'mtx-multi-year-view', exportAs: 'mtxMultiYearView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MtxCalendarBody], template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [todayValue]=\"_todayYear\"\n [rows]=\"_years\"\n [numCols]=\"4\"\n [activeCell]=\"_getActiveCell()\"\n [allowDisabledSelection]=\"true\"\n [selectedValue]=\"_selectedYear!\"\n (selectedValueChange)=\"_yearSelected($event)\"></tbody>\n</table>\n" }]
|
|
794
|
+
}], ctorParameters: () => [{ type: i1.DatetimeAdapter, decorators: [{
|
|
795
|
+
type: Optional
|
|
796
|
+
}] }, { type: undefined, decorators: [{
|
|
797
|
+
type: Optional
|
|
798
|
+
}, {
|
|
729
799
|
type: Inject,
|
|
730
|
-
args: [
|
|
731
|
-
}] }], propDecorators: {
|
|
732
|
-
type: Input
|
|
733
|
-
}], interval: [{
|
|
800
|
+
args: [MTX_DATETIME_FORMATS]
|
|
801
|
+
}] }], propDecorators: { type: [{
|
|
734
802
|
type: Input
|
|
735
|
-
}],
|
|
736
|
-
type: Input,
|
|
737
|
-
args: [{ transform: booleanAttribute }]
|
|
738
|
-
}], AMPM: [{
|
|
803
|
+
}], dateFilter: [{
|
|
739
804
|
type: Input
|
|
740
805
|
}], selectedChange: [{
|
|
741
806
|
type: Output
|
|
742
|
-
}], activeDateChange: [{
|
|
743
|
-
type: Output
|
|
744
807
|
}], _userSelection: [{
|
|
745
808
|
type: Output
|
|
746
809
|
}], activeDate: [{
|
|
@@ -751,28 +814,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImpor
|
|
|
751
814
|
type: Input
|
|
752
815
|
}], maxDate: [{
|
|
753
816
|
type: Input
|
|
754
|
-
}], startView: [{
|
|
755
|
-
type: Input
|
|
756
817
|
}] } });
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
818
|
+
function isSameMultiYearView(dateAdapter, date1, date2, minDate, maxDate) {
|
|
819
|
+
const year1 = dateAdapter.getYear(date1);
|
|
820
|
+
const year2 = dateAdapter.getYear(date2);
|
|
821
|
+
const startingYear = getStartingYear(dateAdapter, minDate, maxDate);
|
|
822
|
+
return (Math.floor((year1 - startingYear) / yearsPerPage) ===
|
|
823
|
+
Math.floor((year2 - startingYear) / yearsPerPage));
|
|
763
824
|
}
|
|
764
|
-
/**
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
825
|
+
/**
|
|
826
|
+
* When the multi-year view is first opened, the active year will be in view.
|
|
827
|
+
* So we compute how many years are between the active year and the *slot* where our
|
|
828
|
+
* "startingYear" will render when paged into view.
|
|
829
|
+
*/
|
|
830
|
+
function getActiveOffset(dateAdapter, activeDate, minDate, maxDate) {
|
|
831
|
+
const activeYear = dateAdapter.getYear(activeDate);
|
|
832
|
+
return euclideanModulo(activeYear - getStartingYear(dateAdapter, minDate, maxDate), yearsPerPage);
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* We pick a "starting" year such that either the maximum year would be at the end
|
|
836
|
+
* or the minimum year would be at the beginning of a page.
|
|
837
|
+
*/
|
|
838
|
+
function getStartingYear(dateAdapter, minDate, maxDate) {
|
|
839
|
+
let startingYear = 0;
|
|
840
|
+
if (maxDate) {
|
|
841
|
+
const maxYear = dateAdapter.getYear(maxDate);
|
|
842
|
+
startingYear = maxYear - yearsPerPage + 1;
|
|
770
843
|
}
|
|
771
|
-
else {
|
|
772
|
-
|
|
844
|
+
else if (minDate) {
|
|
845
|
+
startingYear = dateAdapter.getYear(minDate);
|
|
773
846
|
}
|
|
774
|
-
return
|
|
847
|
+
return startingYear;
|
|
848
|
+
}
|
|
849
|
+
/** Gets remainder that is non-negative, even if first number is negative */
|
|
850
|
+
function euclideanModulo(a, b) {
|
|
851
|
+
return ((a % b) + b) % b;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
class MtxDatetimepickerIntl {
|
|
855
|
+
constructor() {
|
|
856
|
+
/**
|
|
857
|
+
* Stream to emit from when labels are changed. Use this to notify components when the labels have
|
|
858
|
+
* changed after initialization.
|
|
859
|
+
*/
|
|
860
|
+
this.changes = new Subject();
|
|
861
|
+
/** A label for the calendar popup (used by screen readers). */
|
|
862
|
+
this.calendarLabel = 'Calendar';
|
|
863
|
+
/** A label for the button used to open the calendar popup (used by screen readers). */
|
|
864
|
+
this.openCalendarLabel = 'Open calendar';
|
|
865
|
+
/** Label for the button used to close the calendar popup. */
|
|
866
|
+
this.closeCalendarLabel = 'Close calendar';
|
|
867
|
+
/** A label for the previous month button (used by screen readers). */
|
|
868
|
+
this.prevMonthLabel = 'Previous month';
|
|
869
|
+
/** A label for the next month button (used by screen readers). */
|
|
870
|
+
this.nextMonthLabel = 'Next month';
|
|
871
|
+
/** A label for the previous year button (used by screen readers). */
|
|
872
|
+
this.prevYearLabel = 'Previous year';
|
|
873
|
+
/** A label for the next year button (used by screen readers). */
|
|
874
|
+
this.nextYearLabel = 'Next year';
|
|
875
|
+
/** A label for the previous multi-year button (used by screen readers). */
|
|
876
|
+
this.prevMultiYearLabel = 'Previous 24 years';
|
|
877
|
+
/** A label for the next multi-year button (used by screen readers). */
|
|
878
|
+
this.nextMultiYearLabel = 'Next 24 years';
|
|
879
|
+
/** A label for the 'switch to month view' button (used by screen readers). */
|
|
880
|
+
this.switchToMonthViewLabel = 'Choose date';
|
|
881
|
+
/** A label for the 'switch to year view' button (used by screen readers). */
|
|
882
|
+
this.switchToYearViewLabel = 'Choose month';
|
|
883
|
+
/** A label for the 'switch to multi-year view' button (used by screen readers). */
|
|
884
|
+
this.switchToMultiYearViewLabel = 'Choose month and year';
|
|
885
|
+
/** A label for the first date of a range of dates (used by screen readers). */
|
|
886
|
+
this.startDateLabel = 'Start date';
|
|
887
|
+
/** A label for the last date of a range of dates (used by screen readers). */
|
|
888
|
+
this.endDateLabel = 'End date';
|
|
889
|
+
/** A label for the 'switch to clock hour view' button (used by screen readers). */
|
|
890
|
+
this.switchToClockHourViewLabel = 'Choose hour';
|
|
891
|
+
/** A label for the 'switch to clock minute view' button (used by screen readers). */
|
|
892
|
+
this.switchToClockMinuteViewLabel = 'Choose minute';
|
|
893
|
+
/** Label used for ok button within the manual time input. */
|
|
894
|
+
this.okLabel = 'OK';
|
|
895
|
+
/** Label used for cancel button within the manual time input. */
|
|
896
|
+
this.cancelLabel = 'Cancel';
|
|
897
|
+
}
|
|
898
|
+
/** Formats a range of years (used for visuals). */
|
|
899
|
+
formatYearRange(start, end) {
|
|
900
|
+
return `${start} \u2013 ${end}`;
|
|
901
|
+
}
|
|
902
|
+
/** Formats a label for a range of years (used by screen readers). */
|
|
903
|
+
formatYearRangeLabel(start, end) {
|
|
904
|
+
return `${start} to ${end}`;
|
|
905
|
+
}
|
|
906
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
907
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerIntl, providedIn: 'root' }); }
|
|
775
908
|
}
|
|
909
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerIntl, decorators: [{
|
|
910
|
+
type: Injectable,
|
|
911
|
+
args: [{ providedIn: 'root' }]
|
|
912
|
+
}] });
|
|
776
913
|
|
|
777
914
|
function pad(num, size) {
|
|
778
915
|
num = String(num);
|
|
@@ -931,10 +1068,10 @@ class MtxTimeInput {
|
|
|
931
1068
|
this.inputElement.removeEventListener('keypress', this.keyPressListener);
|
|
932
1069
|
this.inputElement.removeEventListener('input', this.inputEventListener);
|
|
933
1070
|
}
|
|
934
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0
|
|
935
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0
|
|
1071
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxTimeInput, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1072
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0", type: MtxTimeInput, isStandalone: true, 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 }); }
|
|
936
1073
|
}
|
|
937
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
1074
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxTimeInput, decorators: [{
|
|
938
1075
|
type: Directive,
|
|
939
1076
|
args: [{
|
|
940
1077
|
selector: 'input.mtx-time-input',
|
|
@@ -943,6 +1080,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImpor
|
|
|
943
1080
|
'(focus)': 'focus($event)',
|
|
944
1081
|
},
|
|
945
1082
|
exportAs: 'mtxTimeInput',
|
|
1083
|
+
standalone: true,
|
|
946
1084
|
}]
|
|
947
1085
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { timeInterval: [{
|
|
948
1086
|
type: Input,
|
|
@@ -1165,14 +1303,14 @@ class MtxTime {
|
|
|
1165
1303
|
this.datetimepickerIntlChangesSubscription.unsubscribe();
|
|
1166
1304
|
}
|
|
1167
1305
|
}
|
|
1168
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0
|
|
1169
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0
|
|
1306
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxTime, deps: [{ token: i1.DatetimeAdapter }, { token: i0.ChangeDetectorRef }, { token: MtxDatetimepickerIntl }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1307
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0", type: MtxTime, isStandalone: true, selector: "mtx-time", inputs: { dateFilter: "dateFilter", interval: "interval", twelvehour: ["twelvehour", "twelvehour", booleanAttribute], 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 @if (twelvehour) {\n <div 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 }\n </div>\n</div>\n\n<mtx-clock (selectedChange)=\"_timeSelected($event)\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n [AMPM]=\"AMPM\"\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{box-sizing:border-box;width:72px;height:100%;padding:0;font-size:36px;text-align:center;border-radius:8px;border:2px solid transparent;appearance:none;outline:none;background-color:var(--mtx-datetimepicker-time-input-background-color);color:var(--mtx-datetimepicker-time-input-text-color)}.mtx-time-input.mtx-time-input-active{background-color:var(--mtx-datetimepicker-time-input-active-state-background-color);color:var(--mtx-datetimepicker-time-input-active-state-text-color)}.mtx-time-input.mtx-time-input-active:focus{border-color:var(--mtx-datetimepicker-time-input-focus-state-border-color);background-color:var(--mtx-datetimepicker-time-input-focus-state-background-color)}.mtx-time-input.mtx-time-input-active:focus::placeholder{color:var(--mtx-datetimepicker-time-input-focus-state-placeholder-text-color)}.mtx-time-input.mtx-time-input-warning{border-color:var(--mtx-datetimepicker-time-input-warn-state-border-color)}.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-ampm .mtx-time-am,.mtx-time-ampm .mtx-time-pm{--mdc-text-button-label-text-weight: 400;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-text-color);border-color:var(--mtx-datetimepicker-time-ampm-border-color);flex:1;width:40px;min-width:auto;border-width:1px;border-style:solid}.mtx-time-ampm .mtx-time-am.mtx-time-ampm-active,.mtx-time-ampm .mtx-time-pm.mtx-time-ampm-active{--mdc-text-button-label-text-weight: 500;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-selected-state-text-color);background-color:var(--mtx-datetimepicker-time-ampm-selected-state-background-color)}.mtx-time-ampm .mtx-time-am .mat-mdc-button-touch-target,.mtx-time-ampm .mtx-time-pm .mat-mdc-button-touch-target{height:100%}.mtx-time-ampm .mtx-time-am{border-radius:8px 8px 0 0}.mtx-time-ampm .mtx-time-pm{border-radius:0 0 8px 8px;border-top:none}.mtx-time-button-wrapper{display:flex;justify-content:flex-end;padding-top:8px}.mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: MtxClock, selector: "mtx-clock", inputs: ["dateFilter", "interval", "twelvehour", "AMPM", "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 }); }
|
|
1170
1308
|
}
|
|
1171
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
1309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxTime, decorators: [{
|
|
1172
1310
|
type: Component,
|
|
1173
1311
|
args: [{ selector: 'mtx-time', exportAs: 'mtxTime', host: {
|
|
1174
1312
|
class: 'mtx-time',
|
|
1175
|
-
}, 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 @if (twelvehour) {\n <div 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 }\n </div>\n</div>\n\n<mtx-clock (selectedChange)=\"_timeSelected($event)\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n [AMPM]=\"AMPM\"\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{box-sizing:border-box;width:72px;height:100%;padding:0;font-size:36px;text-align:center;border-radius:8px;border:2px solid transparent;appearance:none;outline:none;background-color:var(--mtx-datetimepicker-time-input-background-color);color:var(--mtx-datetimepicker-time-input-text-color)}.mtx-time-input.mtx-time-input-active{background-color:var(--mtx-datetimepicker-time-input-active-state-background-color);color:var(--mtx-datetimepicker-time-input-active-state-text-color)}.mtx-time-input.mtx-time-input-active:focus{border-color:var(--mtx-datetimepicker-time-input-focus-state-border-color);background-color:var(--mtx-datetimepicker-time-input-focus-state-background-color)}.mtx-time-input.mtx-time-input-active:focus::placeholder{color:var(--mtx-datetimepicker-time-input-focus-state-placeholder-text-color)}.mtx-time-input.mtx-time-input-warning{border-color:var(--mtx-datetimepicker-time-input-warn-state-border-color)}.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-ampm .mtx-time-am,.mtx-time-ampm .mtx-time-pm{--mdc-text-button-label-text-weight: 400;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-text-color);border-color:var(--mtx-datetimepicker-time-ampm-border-color);flex:1;width:40px;min-width:auto;border-width:1px;border-style:solid}.mtx-time-ampm .mtx-time-am.mtx-time-ampm-active,.mtx-time-ampm .mtx-time-pm.mtx-time-ampm-active{--mdc-text-button-label-text-weight: 500;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-selected-state-text-color);background-color:var(--mtx-datetimepicker-time-ampm-selected-state-background-color)}.mtx-time-ampm .mtx-time-am .mat-mdc-button-touch-target,.mtx-time-ampm .mtx-time-pm .mat-mdc-button-touch-target{height:100%}.mtx-time-ampm .mtx-time-am{border-radius:8px 8px 0 0}.mtx-time-ampm .mtx-time-pm{border-radius:0 0 8px 8px;border-top:none}.mtx-time-button-wrapper{display:flex;justify-content:flex-end;padding-top:8px}.mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"] }]
|
|
1313
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatButton, MtxClock, MtxTimeInput], 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 @if (twelvehour) {\n <div 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 }\n </div>\n</div>\n\n<mtx-clock (selectedChange)=\"_timeSelected($event)\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n [AMPM]=\"AMPM\"\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{box-sizing:border-box;width:72px;height:100%;padding:0;font-size:36px;text-align:center;border-radius:8px;border:2px solid transparent;appearance:none;outline:none;background-color:var(--mtx-datetimepicker-time-input-background-color);color:var(--mtx-datetimepicker-time-input-text-color)}.mtx-time-input.mtx-time-input-active{background-color:var(--mtx-datetimepicker-time-input-active-state-background-color);color:var(--mtx-datetimepicker-time-input-active-state-text-color)}.mtx-time-input.mtx-time-input-active:focus{border-color:var(--mtx-datetimepicker-time-input-focus-state-border-color);background-color:var(--mtx-datetimepicker-time-input-focus-state-background-color)}.mtx-time-input.mtx-time-input-active:focus::placeholder{color:var(--mtx-datetimepicker-time-input-focus-state-placeholder-text-color)}.mtx-time-input.mtx-time-input-warning{border-color:var(--mtx-datetimepicker-time-input-warn-state-border-color)}.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-ampm .mtx-time-am,.mtx-time-ampm .mtx-time-pm{--mdc-text-button-label-text-weight: 400;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-text-color);border-color:var(--mtx-datetimepicker-time-ampm-border-color);flex:1;width:40px;min-width:auto;border-width:1px;border-style:solid}.mtx-time-ampm .mtx-time-am.mtx-time-ampm-active,.mtx-time-ampm .mtx-time-pm.mtx-time-ampm-active{--mdc-text-button-label-text-weight: 500;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-selected-state-text-color);background-color:var(--mtx-datetimepicker-time-ampm-selected-state-background-color)}.mtx-time-ampm .mtx-time-am .mat-mdc-button-touch-target,.mtx-time-ampm .mtx-time-pm .mat-mdc-button-touch-target{height:100%}.mtx-time-ampm .mtx-time-am{border-radius:8px 8px 0 0}.mtx-time-ampm .mtx-time-pm{border-radius:0 0 8px 8px;border-top:none}.mtx-time-button-wrapper{display:flex;justify-content:flex-end;padding-top:8px}.mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"] }]
|
|
1176
1314
|
}], ctorParameters: () => [{ type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }, { type: MtxDatetimepickerIntl }], propDecorators: { selectedChange: [{
|
|
1177
1315
|
type: Output
|
|
1178
1316
|
}], activeDateChange: [{
|
|
@@ -1216,145 +1354,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImpor
|
|
|
1216
1354
|
type: Input
|
|
1217
1355
|
}] } });
|
|
1218
1356
|
|
|
1219
|
-
const DAYS_PER_WEEK = 7;
|
|
1220
|
-
/**
|
|
1221
|
-
* An internal component used to display a single month in the datetimepicker.
|
|
1222
|
-
* @docs-private
|
|
1223
|
-
*/
|
|
1224
|
-
class MtxMonthView {
|
|
1225
|
-
constructor(_adapter, _dateFormats) {
|
|
1226
|
-
this._adapter = _adapter;
|
|
1227
|
-
this._dateFormats = _dateFormats;
|
|
1228
|
-
this.type = 'date';
|
|
1229
|
-
/** Emits when a new date is selected. */
|
|
1230
|
-
this.selectedChange = new EventEmitter();
|
|
1231
|
-
/** Emits when any date is selected. */
|
|
1232
|
-
this._userSelection = new EventEmitter();
|
|
1233
|
-
if (!this._adapter) {
|
|
1234
|
-
throw createMissingDateImplError('DatetimeAdapter');
|
|
1235
|
-
}
|
|
1236
|
-
if (!this._dateFormats) {
|
|
1237
|
-
throw createMissingDateImplError('MTX_DATETIME_FORMATS');
|
|
1238
|
-
}
|
|
1239
|
-
const firstDayOfWeek = this._adapter.getFirstDayOfWeek();
|
|
1240
|
-
const narrowWeekdays = this._adapter.getDayOfWeekNames('narrow');
|
|
1241
|
-
const longWeekdays = this._adapter.getDayOfWeekNames('long');
|
|
1242
|
-
// Rotate the labels for days of the week based on the configured first day of the week.
|
|
1243
|
-
const weekdays = longWeekdays.map((long, i) => {
|
|
1244
|
-
return { long, narrow: narrowWeekdays[i] };
|
|
1245
|
-
});
|
|
1246
|
-
this._weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek));
|
|
1247
|
-
this._activeDate = this._adapter.today();
|
|
1248
|
-
}
|
|
1249
|
-
/**
|
|
1250
|
-
* The date to display in this month view (everything other than the month and year is ignored).
|
|
1251
|
-
*/
|
|
1252
|
-
get activeDate() {
|
|
1253
|
-
return this._activeDate;
|
|
1254
|
-
}
|
|
1255
|
-
set activeDate(value) {
|
|
1256
|
-
const oldActiveDate = this._activeDate;
|
|
1257
|
-
this._activeDate = value || this._adapter.today();
|
|
1258
|
-
if (oldActiveDate &&
|
|
1259
|
-
this._activeDate &&
|
|
1260
|
-
!this._adapter.sameMonthAndYear(oldActiveDate, this._activeDate)) {
|
|
1261
|
-
this._init();
|
|
1262
|
-
if (this._adapter.isInNextMonth(oldActiveDate, this._activeDate)) {
|
|
1263
|
-
this.calendarState('right');
|
|
1264
|
-
}
|
|
1265
|
-
else {
|
|
1266
|
-
this.calendarState('left');
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
/** The currently selected date. */
|
|
1271
|
-
get selected() {
|
|
1272
|
-
return this._selected;
|
|
1273
|
-
}
|
|
1274
|
-
set selected(value) {
|
|
1275
|
-
this._selected = value;
|
|
1276
|
-
this._selectedDate = this._getDateInCurrentMonth(this.selected);
|
|
1277
|
-
}
|
|
1278
|
-
ngAfterContentInit() {
|
|
1279
|
-
this._init();
|
|
1280
|
-
}
|
|
1281
|
-
/** Handles when a new date is selected. */
|
|
1282
|
-
_dateSelected(date) {
|
|
1283
|
-
this.selectedChange.emit(this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), date, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)));
|
|
1284
|
-
if (this.type === 'date') {
|
|
1285
|
-
this._userSelection.emit();
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
_calendarStateDone() {
|
|
1289
|
-
this._calendarState = '';
|
|
1290
|
-
}
|
|
1291
|
-
/** Initializes this month view. */
|
|
1292
|
-
_init() {
|
|
1293
|
-
this._selectedDate = this._getDateInCurrentMonth(this.selected);
|
|
1294
|
-
this._todayDate = this._getDateInCurrentMonth(this._adapter.today());
|
|
1295
|
-
const firstOfMonth = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
|
|
1296
|
-
this._firstWeekOffset =
|
|
1297
|
-
(DAYS_PER_WEEK +
|
|
1298
|
-
this._adapter.getDayOfWeek(firstOfMonth) -
|
|
1299
|
-
this._adapter.getFirstDayOfWeek()) %
|
|
1300
|
-
DAYS_PER_WEEK;
|
|
1301
|
-
this._createWeekCells();
|
|
1302
|
-
}
|
|
1303
|
-
/** Creates MdCalendarCells for the dates in this month. */
|
|
1304
|
-
_createWeekCells() {
|
|
1305
|
-
const daysInMonth = this._adapter.getNumDaysInMonth(this.activeDate);
|
|
1306
|
-
const dateNames = this._adapter.getDateNames();
|
|
1307
|
-
this._weeks = [[]];
|
|
1308
|
-
for (let i = 0, cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {
|
|
1309
|
-
if (cell === DAYS_PER_WEEK) {
|
|
1310
|
-
this._weeks.push([]);
|
|
1311
|
-
cell = 0;
|
|
1312
|
-
}
|
|
1313
|
-
const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), i + 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
|
|
1314
|
-
const enabled = !this.dateFilter || this.dateFilter(date);
|
|
1315
|
-
const ariaLabel = this._adapter.format(date, this._dateFormats.display.dateA11yLabel);
|
|
1316
|
-
this._weeks[this._weeks.length - 1].push(new MtxCalendarCell(i + 1, dateNames[i], ariaLabel, enabled));
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
/**
|
|
1320
|
-
* Gets the date in this month that the given Date falls on.
|
|
1321
|
-
* Returns null if the given Date is in another month.
|
|
1322
|
-
*/
|
|
1323
|
-
_getDateInCurrentMonth(date) {
|
|
1324
|
-
return this._adapter.sameMonthAndYear(date, this.activeDate)
|
|
1325
|
-
? this._adapter.getDate(date)
|
|
1326
|
-
: null;
|
|
1327
|
-
}
|
|
1328
|
-
calendarState(direction) {
|
|
1329
|
-
this._calendarState = direction;
|
|
1330
|
-
}
|
|
1331
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: MtxMonthView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1332
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.7", type: MtxMonthView, selector: "mtx-month-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxMonthView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\">\n <tr>\n @for (day of _weekdays; track day) {\n <th [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\n }\n </tr>\n </thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [rows]=\"_weeks\"\n [todayValue]=\"_todayDate!\"\n [activeCell]=\"_adapter.getDate(activeDate) - 1\"\n [selectedValue]=\"_selectedDate!\"\n (selectedValueChange)=\"_dateSelected($event)\"></tbody>\n</table>\n", dependencies: [{ kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1333
|
-
}
|
|
1334
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: MtxMonthView, decorators: [{
|
|
1335
|
-
type: Component,
|
|
1336
|
-
args: [{ selector: 'mtx-month-view', exportAs: 'mtxMonthView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\">\n <tr>\n @for (day of _weekdays; track day) {\n <th [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\n }\n </tr>\n </thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [rows]=\"_weeks\"\n [todayValue]=\"_todayDate!\"\n [activeCell]=\"_adapter.getDate(activeDate) - 1\"\n [selectedValue]=\"_selectedDate!\"\n (selectedValueChange)=\"_dateSelected($event)\"></tbody>\n</table>\n" }]
|
|
1337
|
-
}], ctorParameters: () => [{ type: i1.DatetimeAdapter, decorators: [{
|
|
1338
|
-
type: Optional
|
|
1339
|
-
}] }, { type: undefined, decorators: [{
|
|
1340
|
-
type: Optional
|
|
1341
|
-
}, {
|
|
1342
|
-
type: Inject,
|
|
1343
|
-
args: [MTX_DATETIME_FORMATS]
|
|
1344
|
-
}] }], propDecorators: { type: [{
|
|
1345
|
-
type: Input
|
|
1346
|
-
}], dateFilter: [{
|
|
1347
|
-
type: Input
|
|
1348
|
-
}], selectedChange: [{
|
|
1349
|
-
type: Output
|
|
1350
|
-
}], _userSelection: [{
|
|
1351
|
-
type: Output
|
|
1352
|
-
}], activeDate: [{
|
|
1353
|
-
type: Input
|
|
1354
|
-
}], selected: [{
|
|
1355
|
-
type: Input
|
|
1356
|
-
}] } });
|
|
1357
|
-
|
|
1358
1357
|
/**
|
|
1359
1358
|
* An internal component used to display a single year in the datetimepicker.
|
|
1360
1359
|
* @docs-private
|
|
@@ -1458,12 +1457,12 @@ class MtxYearView {
|
|
|
1458
1457
|
}
|
|
1459
1458
|
return false;
|
|
1460
1459
|
}
|
|
1461
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0
|
|
1462
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0
|
|
1460
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxYearView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1461
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0", type: MtxYearView, isStandalone: true, selector: "mtx-year-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxYearView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [activeCell]=\"_adapter.getMonth(activeDate)\"\n [selectedValue]=\"_selectedMonth!\"\n (selectedValueChange)=\"_monthSelected($event)\"\n [allowDisabledSelection]=\"true\"></tbody>\n</table>\n", dependencies: [{ kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1463
1462
|
}
|
|
1464
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
1463
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxYearView, decorators: [{
|
|
1465
1464
|
type: Component,
|
|
1466
|
-
args: [{ selector: 'mtx-year-view', exportAs: 'mtxYearView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [activeCell]=\"_adapter.getMonth(activeDate)\"\n [selectedValue]=\"_selectedMonth!\"\n (selectedValueChange)=\"_monthSelected($event)\"\n [allowDisabledSelection]=\"true\"></tbody>\n</table>\n" }]
|
|
1465
|
+
args: [{ selector: 'mtx-year-view', exportAs: 'mtxYearView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MtxCalendarBody], template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [activeCell]=\"_adapter.getMonth(activeDate)\"\n [selectedValue]=\"_selectedMonth!\"\n (selectedValueChange)=\"_monthSelected($event)\"\n [allowDisabledSelection]=\"true\"></tbody>\n</table>\n" }]
|
|
1467
1466
|
}], ctorParameters: () => [{ type: i1.DatetimeAdapter, decorators: [{
|
|
1468
1467
|
type: Optional
|
|
1469
1468
|
}] }, { type: undefined, decorators: [{
|
|
@@ -2069,17 +2068,25 @@ class MtxCalendar {
|
|
|
2069
2068
|
_2digit(n) {
|
|
2070
2069
|
return ('00' + n).slice(-2);
|
|
2071
2070
|
}
|
|
2072
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0
|
|
2073
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.7", type: MtxCalendar, selector: "mtx-calendar", inputs: { multiYearSelector: ["multiYearSelector", "multiYearSelector", booleanAttribute], twelvehour: ["twelvehour", "twelvehour", booleanAttribute], startView: "startView", timeInterval: "timeInterval", dateFilter: "dateFilter", preventSameDateTimeSelection: "preventSameDateTimeSelection", type: "type", startAt: "startAt", timeInput: ["timeInput", "timeInput", booleanAttribute], 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 @if (type !== 'time') {\n <button\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 @if (multiYearSelector || type === 'year') {\n <svg\n class=\"mtx-calendar-header-year-dropdown\" matButtonIcon iconPositionEnd\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\" />\n </svg>\n }\n </button>\n }\n @if (type !== 'year') {\n <div class=\"mtx-calendar-header-date-time\">\n @if (type !== 'time') {\n <button\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 }\n @if (type.endsWith('time')) {\n <span class=\"mtx-calendar-header-time\" [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 @if (twelvehour) {\n <span 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 }\n </span>\n }\n </div>\n }\n</div>\n\n<div class=\"mtx-calendar-content\">\n @if (currentView === 'month' || currentView === 'year' || currentView === 'multi-year') {\n <div 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\" />\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\" />\n </svg>\n </button>\n </div>\n </div>\n }\n\n @switch (currentView) {\n @case ('month') {\n <mtx-month-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n }\n @case ('year') {\n <mtx-year-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n }\n @case ('multi-year') {\n <mtx-multi-year-view\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 @default {\n @if (timeInput) {\n <mtx-time\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 } @else {\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_dialTimeSelected($event)\"\n [AMPM]=\"_AMPM\"\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 }\n }\n }\n</div>\n", styles: [".mtx-calendar{display:block;outline:none;font-family:var(--mtx-datetimepicker-calendar-text-font);font-size:var(--mtx-datetimepicker-calendar-text-size)}.mtx-calendar-header{box-sizing:border-box;padding:8px;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-top-right-radius:var(--mtx-datetimepicker-container-shape);background-color:var(--mtx-datetimepicker-calendar-header-background-color);color:var(--mtx-datetimepicker-calendar-header-text-color)}.mtx-calendar-header .mtx-calendar-header-year,.mtx-calendar-header .mtx-calendar-header-date,.mtx-calendar-header .mtx-calendar-header-hours,.mtx-calendar-header .mtx-calendar-header-minutes,.mtx-calendar-header .mtx-calendar-header-ampm{height:auto;min-width:auto;padding:0 4px;text-align:inherit;line-height:inherit;color:inherit;font-size:inherit;font-weight:inherit;letter-spacing:normal;white-space:normal;word-break:break-word}.mtx-calendar-header .mtx-calendar-header-year .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-date .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-hours .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-minutes .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-ampm .mat-mdc-button-touch-target{height:100%}.mtx-calendar-header .mtx-calendar-header-year{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:144px;min-width:144px;padding:16px 8px;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-bottom-left-radius:var(--mtx-datetimepicker-container-shape)}[dir=rtl] [mode=landscape] .mtx-calendar .mtx-calendar-header{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mtx-datetimepicker-container-shape);border-bottom-right-radius:var(--mtx-datetimepicker-container-shape)}[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 .mtx-calendar-header-hours,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{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:144px;min-width:144px;padding:16px 8px;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-bottom-left-radius:var(--mtx-datetimepicker-container-shape)}[dir=rtl] [mode=auto] .mtx-calendar .mtx-calendar-header{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mtx-datetimepicker-container-shape);border-bottom-right-radius:var(--mtx-datetimepicker-container-shape)}[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 .mtx-calendar-header-hours,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{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;align-items:center;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;font-size:var(--mtx-datetimepicker-calendar-period-button-text-size);font-weight:var(--mtx-datetimepicker-calendar-period-button-text-weight)}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none;color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.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;color:var(--mtx-datetimepicker-calendar-table-header-text-color);font-size:var(--mtx-datetimepicker-calendar-table-header-text-size);font-weight:var(--mtx-datetimepicker-calendar-table-header-text-weight)}\n"], dependencies: [{ kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MtxClock, selector: "mtx-clock", inputs: ["dateFilter", "interval", "twelvehour", "AMPM", "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 }); }
|
|
2071
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.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 }); }
|
|
2072
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0", type: MtxCalendar, isStandalone: true, selector: "mtx-calendar", inputs: { multiYearSelector: ["multiYearSelector", "multiYearSelector", booleanAttribute], twelvehour: ["twelvehour", "twelvehour", booleanAttribute], startView: "startView", timeInterval: "timeInterval", dateFilter: "dateFilter", preventSameDateTimeSelection: "preventSameDateTimeSelection", type: "type", startAt: "startAt", timeInput: ["timeInput", "timeInput", booleanAttribute], 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 @if (type !== 'time') {\n <button\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 @if (multiYearSelector || type === 'year') {\n <svg\n class=\"mtx-calendar-header-year-dropdown\" matButtonIcon iconPositionEnd\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\" />\n </svg>\n }\n </button>\n }\n @if (type !== 'year') {\n <div class=\"mtx-calendar-header-date-time\">\n @if (type !== 'time') {\n <button\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 }\n @if (type.endsWith('time')) {\n <span class=\"mtx-calendar-header-time\" [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 @if (twelvehour) {\n <span 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 }\n </span>\n }\n </div>\n }\n</div>\n\n<div class=\"mtx-calendar-content\">\n @if (currentView === 'month' || currentView === 'year' || currentView === 'multi-year') {\n <div 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\" />\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\" />\n </svg>\n </button>\n </div>\n </div>\n }\n\n @switch (currentView) {\n @case ('month') {\n <mtx-month-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n }\n @case ('year') {\n <mtx-year-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n }\n @case ('multi-year') {\n <mtx-multi-year-view\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 @default {\n @if (timeInput) {\n <mtx-time\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 } @else {\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_dialTimeSelected($event)\"\n [AMPM]=\"_AMPM\"\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 }\n }\n }\n</div>\n", styles: [".mtx-calendar{display:block;outline:none;font-family:var(--mtx-datetimepicker-calendar-text-font);font-size:var(--mtx-datetimepicker-calendar-text-size)}.mtx-calendar-header{box-sizing:border-box;padding:8px;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-top-right-radius:var(--mtx-datetimepicker-container-shape);background-color:var(--mtx-datetimepicker-calendar-header-background-color);color:var(--mtx-datetimepicker-calendar-header-text-color)}.mtx-calendar-header .mtx-calendar-header-year,.mtx-calendar-header .mtx-calendar-header-date,.mtx-calendar-header .mtx-calendar-header-hours,.mtx-calendar-header .mtx-calendar-header-minutes,.mtx-calendar-header .mtx-calendar-header-ampm{height:auto;min-width:auto;padding:0 4px;text-align:inherit;line-height:inherit;color:inherit;font-size:inherit;font-weight:inherit;letter-spacing:normal;white-space:normal;word-break:break-word}.mtx-calendar-header .mtx-calendar-header-year .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-date .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-hours .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-minutes .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-ampm .mat-mdc-button-touch-target{height:100%}.mtx-calendar-header .mtx-calendar-header-year{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:144px;min-width:144px;padding:16px 8px;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-bottom-left-radius:var(--mtx-datetimepicker-container-shape)}[dir=rtl] [mode=landscape] .mtx-calendar .mtx-calendar-header{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mtx-datetimepicker-container-shape);border-bottom-right-radius:var(--mtx-datetimepicker-container-shape)}[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 .mtx-calendar-header-hours,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{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:144px;min-width:144px;padding:16px 8px;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-bottom-left-radius:var(--mtx-datetimepicker-container-shape)}[dir=rtl] [mode=auto] .mtx-calendar .mtx-calendar-header{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mtx-datetimepicker-container-shape);border-bottom-right-radius:var(--mtx-datetimepicker-container-shape)}[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 .mtx-calendar-header-hours,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{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;align-items:center;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;font-size:var(--mtx-datetimepicker-calendar-period-button-text-size);font-weight:var(--mtx-datetimepicker-calendar-period-button-text-weight)}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none;color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.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;color:var(--mtx-datetimepicker-calendar-table-header-text-color);font-size:var(--mtx-datetimepicker-calendar-table-header-text-size);font-weight:var(--mtx-datetimepicker-calendar-table-header-text-weight)}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { 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"] }, { 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: MtxClock, selector: "mtx-clock", inputs: ["dateFilter", "interval", "twelvehour", "AMPM", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["selectedChange", "activeDateChange", "_userSelection"], exportAs: ["mtxClock"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2074
2073
|
}
|
|
2075
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
2074
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxCalendar, decorators: [{
|
|
2076
2075
|
type: Component,
|
|
2077
2076
|
args: [{ selector: 'mtx-calendar', host: {
|
|
2078
2077
|
'class': 'mtx-calendar',
|
|
2079
2078
|
'[class.mtx-calendar-with-time-input]': 'timeInput',
|
|
2080
2079
|
'tabindex': '0',
|
|
2081
2080
|
'(keydown)': '_handleCalendarBodyKeydown($event)',
|
|
2082
|
-
}, exportAs: 'mtxCalendar', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mtx-calendar-header\">\n @if (type !== 'time') {\n <button\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 @if (multiYearSelector || type === 'year') {\n <svg\n class=\"mtx-calendar-header-year-dropdown\" matButtonIcon iconPositionEnd\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\" />\n </svg>\n }\n </button>\n }\n @if (type !== 'year') {\n <div class=\"mtx-calendar-header-date-time\">\n @if (type !== 'time') {\n <button\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 }\n @if (type.endsWith('time')) {\n <span class=\"mtx-calendar-header-time\" [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 @if (twelvehour) {\n <span 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 }\n </span>\n }\n </div>\n }\n</div>\n\n<div class=\"mtx-calendar-content\">\n @if (currentView === 'month' || currentView === 'year' || currentView === 'multi-year') {\n <div 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\" />\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\" />\n </svg>\n </button>\n </div>\n </div>\n }\n\n @switch (currentView) {\n @case ('month') {\n <mtx-month-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n }\n @case ('year') {\n <mtx-year-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n }\n @case ('multi-year') {\n <mtx-multi-year-view\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 @default {\n @if (timeInput) {\n <mtx-time\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 } @else {\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_dialTimeSelected($event)\"\n [AMPM]=\"_AMPM\"\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 }\n }\n }\n</div>\n", styles: [".mtx-calendar{display:block;outline:none;font-family:var(--mtx-datetimepicker-calendar-text-font);font-size:var(--mtx-datetimepicker-calendar-text-size)}.mtx-calendar-header{box-sizing:border-box;padding:8px;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-top-right-radius:var(--mtx-datetimepicker-container-shape);background-color:var(--mtx-datetimepicker-calendar-header-background-color);color:var(--mtx-datetimepicker-calendar-header-text-color)}.mtx-calendar-header .mtx-calendar-header-year,.mtx-calendar-header .mtx-calendar-header-date,.mtx-calendar-header .mtx-calendar-header-hours,.mtx-calendar-header .mtx-calendar-header-minutes,.mtx-calendar-header .mtx-calendar-header-ampm{height:auto;min-width:auto;padding:0 4px;text-align:inherit;line-height:inherit;color:inherit;font-size:inherit;font-weight:inherit;letter-spacing:normal;white-space:normal;word-break:break-word}.mtx-calendar-header .mtx-calendar-header-year .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-date .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-hours .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-minutes .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-ampm .mat-mdc-button-touch-target{height:100%}.mtx-calendar-header .mtx-calendar-header-year{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:144px;min-width:144px;padding:16px 8px;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-bottom-left-radius:var(--mtx-datetimepicker-container-shape)}[dir=rtl] [mode=landscape] .mtx-calendar .mtx-calendar-header{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mtx-datetimepicker-container-shape);border-bottom-right-radius:var(--mtx-datetimepicker-container-shape)}[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 .mtx-calendar-header-hours,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{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:144px;min-width:144px;padding:16px 8px;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-bottom-left-radius:var(--mtx-datetimepicker-container-shape)}[dir=rtl] [mode=auto] .mtx-calendar .mtx-calendar-header{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mtx-datetimepicker-container-shape);border-bottom-right-radius:var(--mtx-datetimepicker-container-shape)}[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 .mtx-calendar-header-hours,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{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;align-items:center;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;font-size:var(--mtx-datetimepicker-calendar-period-button-text-size);font-weight:var(--mtx-datetimepicker-calendar-period-button-text-weight)}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none;color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.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;color:var(--mtx-datetimepicker-calendar-table-header-text-color);font-size:var(--mtx-datetimepicker-calendar-table-header-text-size);font-weight:var(--mtx-datetimepicker-calendar-table-header-text-weight)}\n"] }]
|
|
2081
|
+
}, exportAs: 'mtxCalendar', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
2082
|
+
MatButton,
|
|
2083
|
+
MatIconButton,
|
|
2084
|
+
MtxMonthView,
|
|
2085
|
+
MtxYearView,
|
|
2086
|
+
MtxMultiYearView,
|
|
2087
|
+
MtxTime,
|
|
2088
|
+
MtxClock,
|
|
2089
|
+
], template: "<div class=\"mtx-calendar-header\">\n @if (type !== 'time') {\n <button\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 @if (multiYearSelector || type === 'year') {\n <svg\n class=\"mtx-calendar-header-year-dropdown\" matButtonIcon iconPositionEnd\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\" />\n </svg>\n }\n </button>\n }\n @if (type !== 'year') {\n <div class=\"mtx-calendar-header-date-time\">\n @if (type !== 'time') {\n <button\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 }\n @if (type.endsWith('time')) {\n <span class=\"mtx-calendar-header-time\" [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 @if (twelvehour) {\n <span 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 }\n </span>\n }\n </div>\n }\n</div>\n\n<div class=\"mtx-calendar-content\">\n @if (currentView === 'month' || currentView === 'year' || currentView === 'multi-year') {\n <div 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\" />\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\" />\n </svg>\n </button>\n </div>\n </div>\n }\n\n @switch (currentView) {\n @case ('month') {\n <mtx-month-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n }\n @case ('year') {\n <mtx-year-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n }\n @case ('multi-year') {\n <mtx-multi-year-view\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 @default {\n @if (timeInput) {\n <mtx-time\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 } @else {\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_dialTimeSelected($event)\"\n [AMPM]=\"_AMPM\"\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 }\n }\n }\n</div>\n", styles: [".mtx-calendar{display:block;outline:none;font-family:var(--mtx-datetimepicker-calendar-text-font);font-size:var(--mtx-datetimepicker-calendar-text-size)}.mtx-calendar-header{box-sizing:border-box;padding:8px;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-top-right-radius:var(--mtx-datetimepicker-container-shape);background-color:var(--mtx-datetimepicker-calendar-header-background-color);color:var(--mtx-datetimepicker-calendar-header-text-color)}.mtx-calendar-header .mtx-calendar-header-year,.mtx-calendar-header .mtx-calendar-header-date,.mtx-calendar-header .mtx-calendar-header-hours,.mtx-calendar-header .mtx-calendar-header-minutes,.mtx-calendar-header .mtx-calendar-header-ampm{height:auto;min-width:auto;padding:0 4px;text-align:inherit;line-height:inherit;color:inherit;font-size:inherit;font-weight:inherit;letter-spacing:normal;white-space:normal;word-break:break-word}.mtx-calendar-header .mtx-calendar-header-year .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-date .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-hours .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-minutes .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-ampm .mat-mdc-button-touch-target{height:100%}.mtx-calendar-header .mtx-calendar-header-year{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:144px;min-width:144px;padding:16px 8px;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-bottom-left-radius:var(--mtx-datetimepicker-container-shape)}[dir=rtl] [mode=landscape] .mtx-calendar .mtx-calendar-header{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mtx-datetimepicker-container-shape);border-bottom-right-radius:var(--mtx-datetimepicker-container-shape)}[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 .mtx-calendar-header-hours,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{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:144px;min-width:144px;padding:16px 8px;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-bottom-left-radius:var(--mtx-datetimepicker-container-shape)}[dir=rtl] [mode=auto] .mtx-calendar .mtx-calendar-header{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mtx-datetimepicker-container-shape);border-bottom-right-radius:var(--mtx-datetimepicker-container-shape)}[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 .mtx-calendar-header-hours,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{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;align-items:center;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;font-size:var(--mtx-datetimepicker-calendar-period-button-text-size);font-weight:var(--mtx-datetimepicker-calendar-period-button-text-weight)}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none;color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.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;color:var(--mtx-datetimepicker-calendar-table-header-text-color);font-size:var(--mtx-datetimepicker-calendar-table-header-text-size);font-weight:var(--mtx-datetimepicker-calendar-table-header-text-weight)}\n"] }]
|
|
2083
2090
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: MtxDatetimepickerIntl }, { type: i0.NgZone }, { type: i1.DatetimeAdapter, decorators: [{
|
|
2084
2091
|
type: Optional
|
|
2085
2092
|
}] }, { type: undefined, decorators: [{
|
|
@@ -2125,7 +2132,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImpor
|
|
|
2125
2132
|
/** Used to generate a unique ID for each datetimepicker instance. */
|
|
2126
2133
|
let datetimepickerUid = 0;
|
|
2127
2134
|
/** Injection token that determines the scroll handling while the calendar is open. */
|
|
2128
|
-
const MTX_DATETIMEPICKER_SCROLL_STRATEGY = new InjectionToken('mtx-datetimepicker-scroll-strategy'
|
|
2135
|
+
const MTX_DATETIMEPICKER_SCROLL_STRATEGY = new InjectionToken('mtx-datetimepicker-scroll-strategy', {
|
|
2136
|
+
providedIn: 'root',
|
|
2137
|
+
factory: () => {
|
|
2138
|
+
const overlay = inject(Overlay);
|
|
2139
|
+
return () => overlay.scrollStrategies.reposition();
|
|
2140
|
+
},
|
|
2141
|
+
});
|
|
2129
2142
|
function MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY(overlay) {
|
|
2130
2143
|
return () => overlay.scrollStrategies.reposition();
|
|
2131
2144
|
}
|
|
@@ -2170,13 +2183,13 @@ class MtxDatetimepickerContent extends _MtxDatetimepickerContentBase {
|
|
|
2170
2183
|
ngOnDestroy() {
|
|
2171
2184
|
this._animationDone.complete();
|
|
2172
2185
|
}
|
|
2173
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0
|
|
2174
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0
|
|
2186
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerContent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2187
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0", type: MtxDatetimepickerContent, isStandalone: true, 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;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;border-radius:var(--mtx-datetimepicker-container-shape);background-color:var(--mtx-datetimepicker-calendar-container-background-color);color:var(--mtx-datetimepicker-calendar-container-text-color)}.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:432px;height:328px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar.mtx-calendar-with-time-input{height:404px}@media all and (orientation: landscape){.mtx-datetimepicker-content[mode=auto] .mtx-calendar{width:432px;height:328px}.mtx-datetimepicker-content[mode=auto] .mtx-calendar.mtx-calendar-with-time-input{height:404px}}.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: "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"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [
|
|
2175
2188
|
mtxDatetimepickerAnimations.transformPanel,
|
|
2176
2189
|
mtxDatetimepickerAnimations.fadeInCalendar,
|
|
2177
2190
|
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2178
2191
|
}
|
|
2179
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
2192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerContent, decorators: [{
|
|
2180
2193
|
type: Component,
|
|
2181
2194
|
args: [{ selector: 'mtx-datetimepicker-content', host: {
|
|
2182
2195
|
'class': 'mtx-datetimepicker-content',
|
|
@@ -2187,7 +2200,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImpor
|
|
|
2187
2200
|
}, animations: [
|
|
2188
2201
|
mtxDatetimepickerAnimations.transformPanel,
|
|
2189
2202
|
mtxDatetimepickerAnimations.fadeInCalendar,
|
|
2190
|
-
], 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;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;border-radius:var(--mtx-datetimepicker-container-shape);background-color:var(--mtx-datetimepicker-calendar-container-background-color);color:var(--mtx-datetimepicker-calendar-container-text-color)}.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:432px;height:328px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar.mtx-calendar-with-time-input{height:404px}@media all and (orientation: landscape){.mtx-datetimepicker-content[mode=auto] .mtx-calendar{width:432px;height:328px}.mtx-datetimepicker-content[mode=auto] .mtx-calendar.mtx-calendar-with-time-input{height:404px}}.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"] }]
|
|
2203
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['color'], standalone: true, imports: [MtxCalendar, NgClass], 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;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;border-radius:var(--mtx-datetimepicker-container-shape);background-color:var(--mtx-datetimepicker-calendar-container-background-color);color:var(--mtx-datetimepicker-calendar-container-text-color)}.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:432px;height:328px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar.mtx-calendar-with-time-input{height:404px}@media all and (orientation: landscape){.mtx-datetimepicker-content[mode=auto] .mtx-calendar{width:432px;height:328px}.mtx-datetimepicker-content[mode=auto] .mtx-calendar.mtx-calendar-with-time-input{height:404px}}.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"] }]
|
|
2191
2204
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { _calendar: [{
|
|
2192
2205
|
type: ViewChild,
|
|
2193
2206
|
args: [MtxCalendar, { static: true }]
|
|
@@ -2532,10 +2545,10 @@ class MtxDatetimepicker {
|
|
|
2532
2545
|
event.keyCode === UP_ARROW));
|
|
2533
2546
|
})));
|
|
2534
2547
|
}
|
|
2535
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0
|
|
2536
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.0
|
|
2548
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepicker, deps: [{ token: i1$1.Overlay }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: MTX_DATETIMEPICKER_SCROLL_STRATEGY }, { token: i1.DatetimeAdapter, optional: true }, { token: i3.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2549
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.1.0", type: MtxDatetimepicker, isStandalone: true, selector: "mtx-datetimepicker", inputs: { multiYearSelector: ["multiYearSelector", "multiYearSelector", booleanAttribute], twelvehour: ["twelvehour", "twelvehour", booleanAttribute], startView: "startView", mode: "mode", timeInterval: "timeInterval", preventSameDateTimeSelection: ["preventSameDateTimeSelection", "preventSameDateTimeSelection", booleanAttribute], panelClass: "panelClass", opened: ["opened", "opened", booleanAttribute], color: "color", startAt: "startAt", type: "type", touchUi: ["touchUi", "touchUi", booleanAttribute], timeInput: ["timeInput", "timeInput", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], xPosition: "xPosition", yPosition: "yPosition", restoreFocus: ["restoreFocus", "restoreFocus", booleanAttribute] }, outputs: { selectedChanged: "selectedChanged", openedStream: "opened", closedStream: "closed", viewChanged: "viewChanged" }, exportAs: ["mtxDatetimepicker"], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2537
2550
|
}
|
|
2538
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
2551
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepicker, decorators: [{
|
|
2539
2552
|
type: Component,
|
|
2540
2553
|
args: [{
|
|
2541
2554
|
selector: 'mtx-datetimepicker',
|
|
@@ -2544,13 +2557,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImpor
|
|
|
2544
2557
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2545
2558
|
encapsulation: ViewEncapsulation.None,
|
|
2546
2559
|
preserveWhitespaces: false,
|
|
2560
|
+
standalone: true,
|
|
2547
2561
|
}]
|
|
2548
|
-
}], ctorParameters: () => [{ type:
|
|
2562
|
+
}], ctorParameters: () => [{ type: i1$1.Overlay }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
|
|
2549
2563
|
type: Inject,
|
|
2550
2564
|
args: [MTX_DATETIMEPICKER_SCROLL_STRATEGY]
|
|
2551
2565
|
}] }, { type: i1.DatetimeAdapter, decorators: [{
|
|
2552
2566
|
type: Optional
|
|
2553
|
-
}] }, { type:
|
|
2567
|
+
}] }, { type: i3.Directionality, decorators: [{
|
|
2554
2568
|
type: Optional
|
|
2555
2569
|
}] }], propDecorators: { multiYearSelector: [{
|
|
2556
2570
|
type: Input,
|
|
@@ -2886,14 +2900,14 @@ class MtxDatetimepickerInput {
|
|
|
2886
2900
|
getThemePalette() {
|
|
2887
2901
|
return this._formField ? this._formField.color : undefined;
|
|
2888
2902
|
}
|
|
2889
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0
|
|
2890
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.0
|
|
2903
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerInput, deps: [{ token: i0.ElementRef }, { token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }, { token: i2.MatFormField, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2904
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.1.0", type: MtxDatetimepickerInput, isStandalone: true, selector: "input[mtxDatetimepicker]", inputs: { mtxDatetimepicker: "mtxDatetimepicker", mtxDatetimepickerFilter: "mtxDatetimepickerFilter", value: "value", min: "min", max: "max", disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { dateChange: "dateChange", dateInput: "dateInput" }, host: { listeners: { "input": "_onInput($event.target.value)", "change": "_onChange()", "blur": "_onBlur()", "keydown": "_onKeydown($event)" }, properties: { "attr.aria-haspopup": "true", "attr.aria-owns": "(_datetimepicker?.opened && _datetimepicker.id) || null", "attr.min": "min ? _dateAdapter.toIso8601(min) : null", "attr.max": "max ? _dateAdapter.toIso8601(max) : null", "disabled": "disabled" } }, providers: [
|
|
2891
2905
|
MAT_DATETIMEPICKER_VALUE_ACCESSOR,
|
|
2892
2906
|
MAT_DATETIMEPICKER_VALIDATORS,
|
|
2893
2907
|
{ provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: MtxDatetimepickerInput },
|
|
2894
2908
|
], exportAs: ["mtxDatetimepickerInput"], ngImport: i0 }); }
|
|
2895
2909
|
}
|
|
2896
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
2910
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerInput, decorators: [{
|
|
2897
2911
|
type: Directive,
|
|
2898
2912
|
args: [{
|
|
2899
2913
|
selector: 'input[mtxDatetimepicker]',
|
|
@@ -2914,6 +2928,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImpor
|
|
|
2914
2928
|
'(keydown)': '_onKeydown($event)',
|
|
2915
2929
|
},
|
|
2916
2930
|
exportAs: 'mtxDatetimepickerInput',
|
|
2931
|
+
standalone: true,
|
|
2917
2932
|
}]
|
|
2918
2933
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter, decorators: [{
|
|
2919
2934
|
type: Optional
|
|
@@ -2922,7 +2937,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImpor
|
|
|
2922
2937
|
}, {
|
|
2923
2938
|
type: Inject,
|
|
2924
2939
|
args: [MTX_DATETIME_FORMATS]
|
|
2925
|
-
}] }, { type: i2
|
|
2940
|
+
}] }, { type: i2.MatFormField, decorators: [{
|
|
2926
2941
|
type: Optional
|
|
2927
2942
|
}] }], propDecorators: { dateChange: [{
|
|
2928
2943
|
type: Output
|
|
@@ -2945,13 +2960,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImpor
|
|
|
2945
2960
|
|
|
2946
2961
|
/** Can be used to override the icon of a `mtxDatetimepickerToggle`. */
|
|
2947
2962
|
class MtxDatetimepickerToggleIcon {
|
|
2948
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0
|
|
2949
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0
|
|
2963
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerToggleIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2964
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0", type: MtxDatetimepickerToggleIcon, isStandalone: true, selector: "[mtxDatetimepickerToggleIcon]", ngImport: i0 }); }
|
|
2950
2965
|
}
|
|
2951
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
2966
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerToggleIcon, decorators: [{
|
|
2952
2967
|
type: Directive,
|
|
2953
2968
|
args: [{
|
|
2954
2969
|
selector: '[mtxDatetimepickerToggleIcon]',
|
|
2970
|
+
standalone: true,
|
|
2955
2971
|
}]
|
|
2956
2972
|
}] });
|
|
2957
2973
|
class MtxDatetimepickerToggle {
|
|
@@ -2999,10 +3015,10 @@ class MtxDatetimepickerToggle {
|
|
|
2999
3015
|
this._stateChanges.unsubscribe();
|
|
3000
3016
|
this._stateChanges = merge(this._intl.changes, datetimepickerDisabled, inputDisabled, datetimepickerToggled).subscribe(() => this._changeDetectorRef.markForCheck());
|
|
3001
3017
|
}
|
|
3002
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0
|
|
3003
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0
|
|
3018
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerToggle, deps: [{ token: MtxDatetimepickerIntl }, { token: i0.ChangeDetectorRef }, { token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3019
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0", type: MtxDatetimepickerToggle, isStandalone: true, selector: "mtx-datetimepicker-toggle", inputs: { datetimepicker: ["for", "datetimepicker"], tabIndex: "tabIndex", ariaLabel: ["aria-label", "ariaLabel"], disabled: ["disabled", "disabled", booleanAttribute], disableRipple: ["disableRipple", "disableRipple", booleanAttribute] }, host: { listeners: { "click": "_open($event)" }, properties: { "attr.tabindex": "null", "class.mtx-datetimepicker-toggle-active": "datetimepicker && datetimepicker.opened", "class.mat-accent": "datetimepicker && datetimepicker.color === \"accent\"", "class.mat-warn": "datetimepicker && datetimepicker.color === \"warn\"", "attr.data-mtx-calendar": "datetimepicker ? datetimepicker.id : null" }, 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\n @if (!_customIcon) {\n @switch (datetimepicker.type) {\n @case ('time') {\n <svg\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=\"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 </svg>\n }\n @case ('datetime') {\n <svg\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=\"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 </svg>\n }\n @default {\n <svg\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 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 }\n }\n }\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mtx-datetimepicker-toggle{pointer-events:auto;color:var(--mtx-datetimepicker-toggle-icon-color)}.mtx-datetimepicker-toggle-active{color:var(--mtx-datetimepicker-toggle-active-state-icon-color)}.cdk-high-contrast-active .mtx-datetimepicker-toggle-default-icon{color:CanvasText}\n"], dependencies: [{ kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
3004
3020
|
}
|
|
3005
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
3021
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerToggle, decorators: [{
|
|
3006
3022
|
type: Component,
|
|
3007
3023
|
args: [{ selector: 'mtx-datetimepicker-toggle', host: {
|
|
3008
3024
|
'class': 'mtx-datetimepicker-toggle',
|
|
@@ -3016,7 +3032,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImpor
|
|
|
3016
3032
|
// `stopPropagation` on it without affecting the user's `click` handlers. We need to stop
|
|
3017
3033
|
// it so that the input doesn't get focused automatically by the form field (See #21836).
|
|
3018
3034
|
'(click)': '_open($event)',
|
|
3019
|
-
}, 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\n @if (!_customIcon) {\n @switch (datetimepicker.type) {\n @case ('time') {\n <svg\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=\"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 </svg>\n }\n @case ('datetime') {\n <svg\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=\"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 </svg>\n }\n @default {\n <svg\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 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 }\n }\n }\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mtx-datetimepicker-toggle{pointer-events:auto;color:var(--mtx-datetimepicker-toggle-icon-color)}.mtx-datetimepicker-toggle-active{color:var(--mtx-datetimepicker-toggle-active-state-icon-color)}.cdk-high-contrast-active .mtx-datetimepicker-toggle-default-icon{color:CanvasText}\n"] }]
|
|
3035
|
+
}, exportAs: 'mtxDatetimepickerToggle', encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatIconButton], 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\n @if (!_customIcon) {\n @switch (datetimepicker.type) {\n @case ('time') {\n <svg\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=\"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 </svg>\n }\n @case ('datetime') {\n <svg\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=\"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 </svg>\n }\n @default {\n <svg\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 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 }\n }\n }\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mtx-datetimepicker-toggle{pointer-events:auto;color:var(--mtx-datetimepicker-toggle-icon-color)}.mtx-datetimepicker-toggle-active{color:var(--mtx-datetimepicker-toggle-active-state-icon-color)}.cdk-high-contrast-active .mtx-datetimepicker-toggle-default-icon{color:CanvasText}\n"] }]
|
|
3020
3036
|
}], ctorParameters: () => [{ type: MtxDatetimepickerIntl }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
3021
3037
|
type: Attribute,
|
|
3022
3038
|
args: ['tabindex']
|
|
@@ -3043,8 +3059,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImpor
|
|
|
3043
3059
|
}] } });
|
|
3044
3060
|
|
|
3045
3061
|
class MtxDatetimepickerModule {
|
|
3046
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0
|
|
3047
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0
|
|
3062
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3063
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerModule, imports: [CommonModule,
|
|
3064
|
+
OverlayModule,
|
|
3065
|
+
A11yModule,
|
|
3066
|
+
PortalModule,
|
|
3067
|
+
MatButtonModule,
|
|
3068
|
+
MtxCalendar,
|
|
3048
3069
|
MtxCalendarBody,
|
|
3049
3070
|
MtxClock,
|
|
3050
3071
|
MtxTime,
|
|
@@ -3056,7 +3077,7 @@ class MtxDatetimepickerModule {
|
|
|
3056
3077
|
MtxDatetimepickerContent,
|
|
3057
3078
|
MtxMonthView,
|
|
3058
3079
|
MtxYearView,
|
|
3059
|
-
MtxMultiYearView],
|
|
3080
|
+
MtxMultiYearView], exports: [MtxCalendar,
|
|
3060
3081
|
MtxCalendarBody,
|
|
3061
3082
|
MtxClock,
|
|
3062
3083
|
MtxTime,
|
|
@@ -3068,13 +3089,25 @@ class MtxDatetimepickerModule {
|
|
|
3068
3089
|
MtxMonthView,
|
|
3069
3090
|
MtxYearView,
|
|
3070
3091
|
MtxMultiYearView] }); }
|
|
3071
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0
|
|
3092
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerModule, providers: [MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [CommonModule,
|
|
3093
|
+
OverlayModule,
|
|
3094
|
+
A11yModule,
|
|
3095
|
+
PortalModule,
|
|
3096
|
+
MatButtonModule,
|
|
3097
|
+
MtxCalendar,
|
|
3098
|
+
MtxTime,
|
|
3099
|
+
MtxDatetimepickerToggle,
|
|
3100
|
+
MtxDatetimepickerContent] }); }
|
|
3072
3101
|
}
|
|
3073
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0
|
|
3102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerModule, decorators: [{
|
|
3074
3103
|
type: NgModule,
|
|
3075
3104
|
args: [{
|
|
3076
|
-
imports: [
|
|
3077
|
-
|
|
3105
|
+
imports: [
|
|
3106
|
+
CommonModule,
|
|
3107
|
+
OverlayModule,
|
|
3108
|
+
A11yModule,
|
|
3109
|
+
PortalModule,
|
|
3110
|
+
MatButtonModule,
|
|
3078
3111
|
MtxCalendar,
|
|
3079
3112
|
MtxCalendarBody,
|
|
3080
3113
|
MtxClock,
|