@ng-matero/extensions 12.5.3 → 12.7.1
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/_all-theme.scss +2 -0
- package/_index.scss +2 -0
- package/_theming.scss +2 -0
- package/bundles/extensions.umd.js +7 -7
- package/bundles/extensions.umd.js.map +1 -1
- package/bundles/mtxColorpicker.umd.js +1123 -0
- package/bundles/mtxColorpicker.umd.js.map +1 -0
- package/bundles/mtxDatetimepicker.umd.js +603 -148
- package/bundles/mtxDatetimepicker.umd.js.map +1 -1
- package/bundles/mtxDialog.umd.js +0 -2
- package/bundles/mtxDialog.umd.js.map +1 -1
- package/bundles/mtxFormGroup.umd.js +2 -9
- package/bundles/mtxFormGroup.umd.js.map +1 -1
- package/bundles/mtxLoader.umd.js +7 -4
- package/bundles/mtxLoader.umd.js.map +1 -1
- package/bundles/mtxPopover.umd.js +5 -8
- package/bundles/mtxPopover.umd.js.map +1 -1
- package/bundles/mtxSelect.umd.js +1 -0
- package/bundles/mtxSelect.umd.js.map +1 -1
- package/bundles/mtxSplit.umd.js +80 -81
- package/bundles/mtxSplit.umd.js.map +1 -1
- package/bundles/mtxText3d.umd.js +0 -8
- package/bundles/mtxText3d.umd.js.map +1 -1
- package/bundles/mtxTooltip.umd.js +2 -0
- package/bundles/mtxTooltip.umd.js.map +1 -1
- package/colorpicker/_colorpicker-theme.import.scss +2 -0
- package/colorpicker/_colorpicker-theme.scss +43 -0
- package/colorpicker/colorpicker-animations.d.ts +8 -0
- package/colorpicker/colorpicker-content.scss +4 -0
- package/colorpicker/colorpicker-input.d.ts +89 -0
- package/colorpicker/colorpicker-module.d.ts +2 -0
- package/colorpicker/colorpicker-toggle.d.ts +33 -0
- package/colorpicker/colorpicker-toggle.scss +23 -0
- package/colorpicker/colorpicker.d.ts +126 -0
- package/{color-picker/mtxColorPicker.d.ts → colorpicker/mtxColorpicker.d.ts} +0 -0
- package/colorpicker/mtxColorpicker.metadata.json +1 -0
- package/colorpicker/package.json +11 -0
- package/colorpicker/public-api.d.ts +5 -0
- package/datetimepicker/_datetimepicker-theme.scss +12 -0
- package/datetimepicker/calendar.d.ts +2 -10
- package/datetimepicker/clock.d.ts +10 -9
- package/datetimepicker/datetimepicker-animations.d.ts +7 -5
- package/datetimepicker/datetimepicker-input.d.ts +4 -2
- package/datetimepicker/{datetimepicker.module.d.ts → datetimepicker-module.d.ts} +0 -0
- package/datetimepicker/datetimepicker-toggle.d.ts +15 -2
- package/datetimepicker/datetimepicker-toggle.scss +23 -0
- package/datetimepicker/datetimepicker.d.ts +67 -24
- package/datetimepicker/month-view.d.ts +3 -3
- package/datetimepicker/mtxDatetimepicker.d.ts +0 -2
- package/datetimepicker/mtxDatetimepicker.metadata.json +1 -1
- package/datetimepicker/multi-year-view.d.ts +3 -3
- package/datetimepicker/public-api.d.ts +3 -1
- package/datetimepicker/year-view.d.ts +3 -3
- package/dialog/{dialog.config.d.ts → dialog-config.d.ts} +0 -0
- package/dialog/dialog.component.d.ts +1 -1
- package/dialog/dialog.d.ts +1 -1
- package/dialog/mtxDialog.metadata.json +1 -1
- package/dialog/public-api.d.ts +2 -2
- package/esm2015/colorpicker/colorpicker-animations.js +16 -0
- package/esm2015/colorpicker/colorpicker-input.js +228 -0
- package/esm2015/colorpicker/colorpicker-module.js +41 -0
- package/esm2015/colorpicker/colorpicker-toggle.js +97 -0
- package/esm2015/colorpicker/colorpicker.js +372 -0
- package/esm2015/colorpicker/mtxColorpicker.js +5 -0
- package/esm2015/colorpicker/public-api.js +6 -0
- package/esm2015/datetimepicker/calendar-body.js +2 -1
- package/esm2015/datetimepicker/calendar.js +14 -29
- package/esm2015/datetimepicker/clock.js +7 -7
- package/esm2015/datetimepicker/datetimepicker-animations.js +38 -24
- package/esm2015/datetimepicker/datetimepicker-input.js +6 -3
- package/esm2015/datetimepicker/datetimepicker-module.js +52 -0
- package/esm2015/datetimepicker/datetimepicker-toggle.js +30 -8
- package/esm2015/datetimepicker/datetimepicker.js +150 -71
- package/esm2015/datetimepicker/month-view.js +8 -7
- package/esm2015/datetimepicker/mtxDatetimepicker.js +1 -3
- package/esm2015/datetimepicker/multi-year-view.js +8 -7
- package/esm2015/datetimepicker/public-api.js +4 -2
- package/esm2015/datetimepicker/year-view.js +8 -7
- package/esm2015/dialog/{dialog.config.js → dialog-config.js} +1 -1
- package/esm2015/dialog/dialog.component.js +1 -1
- package/esm2015/dialog/dialog.js +1 -1
- package/esm2015/dialog/public-api.js +3 -3
- package/esm2015/extensions.module.js +3 -3
- package/esm2015/form-group/form-group.component.js +4 -11
- package/esm2015/loader/loader.component.js +8 -5
- package/esm2015/popover/popover.js +5 -9
- package/esm2015/public-api.js +2 -2
- package/esm2015/select/select.component.js +2 -1
- package/esm2015/split/split.component.js +13 -11
- package/esm2015/split/utils.js +1 -6
- package/esm2015/text3d/text3d.component.js +1 -9
- package/esm2015/tooltip/tooltip.js +3 -1
- package/extensions.metadata.json +1 -1
- package/fesm2015/extensions.js +3 -3
- package/fesm2015/extensions.js.map +1 -1
- package/fesm2015/mtxColorpicker.js +743 -0
- package/fesm2015/mtxColorpicker.js.map +1 -0
- package/fesm2015/mtxDatetimepicker.js +259 -146
- package/fesm2015/mtxDatetimepicker.js.map +1 -1
- package/fesm2015/mtxDialog.js +1 -1
- package/fesm2015/mtxDialog.js.map +1 -1
- package/fesm2015/mtxFormGroup.js +3 -10
- package/fesm2015/mtxFormGroup.js.map +1 -1
- package/fesm2015/mtxLoader.js +7 -4
- package/fesm2015/mtxLoader.js.map +1 -1
- package/fesm2015/mtxPopover.js +4 -8
- package/fesm2015/mtxPopover.js.map +1 -1
- package/fesm2015/mtxSelect.js +1 -0
- package/fesm2015/mtxSelect.js.map +1 -1
- package/fesm2015/mtxSplit.js +12 -15
- package/fesm2015/mtxSplit.js.map +1 -1
- package/fesm2015/mtxText3d.js +0 -8
- package/fesm2015/mtxText3d.js.map +1 -1
- package/fesm2015/mtxTooltip.js +2 -0
- package/fesm2015/mtxTooltip.js.map +1 -1
- package/form-group/form-group.component.d.ts +2 -4
- package/form-group/mtxFormGroup.metadata.json +1 -1
- package/loader/loader.component.d.ts +4 -1
- package/loader/mtxLoader.metadata.json +1 -1
- package/package.json +1 -1
- package/popover/popover.d.ts +0 -4
- package/public-api.d.ts +1 -1
- package/select/mtxSelect.metadata.json +1 -1
- package/split/_split-theme.scss +9 -2
- package/split/mtxSplit.metadata.json +1 -1
- package/split/split.component.d.ts +9 -1
- package/text3d/mtxText3d.metadata.json +1 -1
- package/text3d/text3d.component.d.ts +0 -1
- package/tooltip/mtxTooltip.metadata.json +1 -1
- package/bundles/mtxColorPicker.umd.js +0 -337
- package/bundles/mtxColorPicker.umd.js.map +0 -1
- package/color-picker/color-picker.component.d.ts +0 -120
- package/color-picker/color-picker.module.d.ts +0 -2
- package/color-picker/mtxColorPicker.metadata.json +0 -1
- package/color-picker/package.json +0 -11
- package/color-picker/public-api.d.ts +0 -2
- package/esm2015/color-picker/color-picker.component.js +0 -268
- package/esm2015/color-picker/color-picker.module.js +0 -26
- package/esm2015/color-picker/mtxColorPicker.js +0 -5
- package/esm2015/color-picker/public-api.js +0 -3
- package/esm2015/datetimepicker/datetimepicker.module.js +0 -49
- package/fesm2015/mtxColorPicker.js +0 -295
- package/fesm2015/mtxColorPicker.js.map +0 -1
|
@@ -1,37 +1,51 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/a11y'), require('@angular/cdk/overlay'), require('@angular/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@ng-matero/extensions/datetimepicker', ['exports', '@angular/cdk/a11y', '@angular/cdk/overlay', '@angular/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["ng-matero"] = global["ng-matero"] || {}, global["ng-matero"].extensions = global["ng-matero"].extensions || {}, global["ng-matero"].extensions.datetimepicker = {}), global.ng.cdk.a11y, global.ng.cdk.overlay, global.ng.
|
|
5
|
-
})(this, (function (exports, a11y, overlay, common, core, button,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/a11y'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/common'), require('@angular/core'), require('@angular/material/button'), require('@angular/cdk/keycodes'), require('@angular/cdk/coercion'), require('@angular/material/datepicker'), require('rxjs/operators'), require('@ng-matero/extensions/core'), require('@angular/animations'), require('@angular/cdk/bidi'), require('@angular/cdk/platform'), require('@angular/material/core'), require('rxjs'), require('@angular/forms'), require('@angular/material/input'), require('@angular/material/form-field')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@ng-matero/extensions/datetimepicker', ['exports', '@angular/cdk/a11y', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/common', '@angular/core', '@angular/material/button', '@angular/cdk/keycodes', '@angular/cdk/coercion', '@angular/material/datepicker', 'rxjs/operators', '@ng-matero/extensions/core', '@angular/animations', '@angular/cdk/bidi', '@angular/cdk/platform', '@angular/material/core', 'rxjs', '@angular/forms', '@angular/material/input', '@angular/material/form-field'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["ng-matero"] = global["ng-matero"] || {}, global["ng-matero"].extensions = global["ng-matero"].extensions || {}, global["ng-matero"].extensions.datetimepicker = {}), global.ng.cdk.a11y, global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.common, global.ng.core, global.ng.material.button, global.ng.cdk.keycodes, global.ng.cdk.coercion, global.ng.material.datepicker, global.rxjs.operators, global["ng-matero"].extensions.core, global.ng.animations, global.ng.cdk.bidi, global.ng.cdk.platform, global.ng.material.core, global.rxjs, global.ng.forms, global.ng.material.input, global.ng.material.formField));
|
|
5
|
+
})(this, (function (exports, a11y, overlay, portal, common, core, button, keycodes, coercion, datepicker, operators, core$1, animations, bidi, platform, core$2, rxjs, forms, input, formField) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* panel has transformed in.
|
|
8
|
+
* Animations used by the Material datepicker.
|
|
9
|
+
* @docs-private
|
|
11
10
|
*/
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
animations.
|
|
15
|
-
animations.
|
|
16
|
-
|
|
11
|
+
var mtxDatetimepickerAnimations = {
|
|
12
|
+
/** Transforms the height of the datepicker's calendar. */
|
|
13
|
+
transformPanel: animations.trigger('transformPanel', [
|
|
14
|
+
animations.transition('void => enter-dropdown', animations.animate('120ms cubic-bezier(0, 0, 0.2, 1)', animations.keyframes([
|
|
15
|
+
animations.style({ opacity: 0, transform: 'scale(1, 0.8)' }),
|
|
16
|
+
animations.style({ opacity: 1, transform: 'scale(1, 1)' }),
|
|
17
|
+
]))),
|
|
18
|
+
animations.transition('void => enter-dialog', animations.animate('150ms cubic-bezier(0, 0, 0.2, 1)', animations.keyframes([
|
|
19
|
+
animations.style({ opacity: 0, transform: 'scale(0.7)' }),
|
|
20
|
+
animations.style({ transform: 'none', opacity: 1 }),
|
|
21
|
+
]))),
|
|
22
|
+
animations.transition('* => void', animations.animate('100ms linear', animations.style({ opacity: 0 }))),
|
|
17
23
|
]),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
animations.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
])),
|
|
24
|
+
/** Fades in the content of the calendar. */
|
|
25
|
+
fadeInCalendar: animations.trigger('fadeInCalendar', [
|
|
26
|
+
animations.state('void', animations.style({ opacity: 0 })),
|
|
27
|
+
animations.state('enter', animations.style({ opacity: 1 })),
|
|
28
|
+
// TODO(crisbeto): this animation should be removed since it isn't quite on spec, but we
|
|
29
|
+
// need to keep it until #12440 gets in, otherwise the exit animation will look glitchy.
|
|
30
|
+
animations.transition('void => *', animations.animate('120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)')),
|
|
26
31
|
]),
|
|
27
|
-
animations.
|
|
28
|
-
animations.
|
|
29
|
-
animations.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
slideCalendar: animations.trigger('slideCalendar', [
|
|
33
|
+
animations.transition('* => left', [
|
|
34
|
+
animations.animate(180, animations.keyframes([
|
|
35
|
+
animations.style({ transform: 'translateX(100%)', offset: 0.5 }),
|
|
36
|
+
animations.style({ transform: 'translateX(-100%)', offset: 0.51 }),
|
|
37
|
+
animations.style({ transform: 'translateX(0)', offset: 1 }),
|
|
38
|
+
])),
|
|
39
|
+
]),
|
|
40
|
+
animations.transition('* => right', [
|
|
41
|
+
animations.animate(180, animations.keyframes([
|
|
42
|
+
animations.style({ transform: 'translateX(-100%)', offset: 0.5 }),
|
|
43
|
+
animations.style({ transform: 'translateX(100%)', offset: 0.51 }),
|
|
44
|
+
animations.style({ transform: 'translateX(0)', offset: 1 }),
|
|
45
|
+
])),
|
|
46
|
+
]),
|
|
33
47
|
]),
|
|
34
|
-
|
|
48
|
+
};
|
|
35
49
|
|
|
36
50
|
/** @docs-private */
|
|
37
51
|
function createMissingDateImplError(provider) {
|
|
@@ -109,6 +123,7 @@
|
|
|
109
123
|
host: {
|
|
110
124
|
class: 'mtx-calendar-body',
|
|
111
125
|
},
|
|
126
|
+
exportAs: 'mtxCalendarBody',
|
|
112
127
|
encapsulation: core.ViewEncapsulation.None,
|
|
113
128
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
114
129
|
styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%}[dir=rtl] .mtx-calendar-body-label{text-align:right}.mtx-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:7.1428571429% 0;text-align:center;outline:none;cursor:pointer}.mtx-calendar-body-disabled{cursor:default;pointer-events:none}.mtx-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid transparent;border-radius:999px}\n"]
|
|
@@ -137,10 +152,11 @@
|
|
|
137
152
|
function MtxMultiYearView(_adapter, _dateFormats) {
|
|
138
153
|
this._adapter = _adapter;
|
|
139
154
|
this._dateFormats = _dateFormats;
|
|
140
|
-
this._userSelection = new core.EventEmitter();
|
|
141
155
|
this.type = 'date';
|
|
142
156
|
/** Emits when a new month is selected. */
|
|
143
157
|
this.selectedChange = new core.EventEmitter();
|
|
158
|
+
/** Emits when any date is selected. */
|
|
159
|
+
this._userSelection = new core.EventEmitter();
|
|
144
160
|
if (!this._adapter) {
|
|
145
161
|
throw createMissingDateImplError('DatetimeAdapter');
|
|
146
162
|
}
|
|
@@ -290,7 +306,8 @@
|
|
|
290
306
|
{ type: core.Component, args: [{
|
|
291
307
|
selector: 'mtx-multi-year-view',
|
|
292
308
|
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",
|
|
293
|
-
|
|
309
|
+
exportAs: 'mtxMultiYearView',
|
|
310
|
+
animations: [mtxDatetimepickerAnimations.slideCalendar],
|
|
294
311
|
encapsulation: core.ViewEncapsulation.None,
|
|
295
312
|
changeDetection: core.ChangeDetectionStrategy.OnPush
|
|
296
313
|
},] }
|
|
@@ -308,10 +325,10 @@
|
|
|
308
325
|
]; };
|
|
309
326
|
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
310
327
|
MtxMultiYearView.propDecorators = {
|
|
311
|
-
_userSelection: [{ type: core.Output }],
|
|
312
328
|
type: [{ type: core.Input }],
|
|
313
329
|
dateFilter: [{ type: core.Input }],
|
|
314
330
|
selectedChange: [{ type: core.Output }],
|
|
331
|
+
_userSelection: [{ type: core.Output }],
|
|
315
332
|
activeDate: [{ type: core.Input }],
|
|
316
333
|
selected: [{ type: core.Input }],
|
|
317
334
|
minDate: [{ type: core.Input }],
|
|
@@ -365,25 +382,18 @@
|
|
|
365
382
|
this._ngZone = _ngZone;
|
|
366
383
|
this._adapter = _adapter;
|
|
367
384
|
this._dateFormats = _dateFormats;
|
|
368
|
-
this._userSelection = new core.EventEmitter();
|
|
369
385
|
this._multiYearSelector = false;
|
|
370
386
|
this._twelvehour = false;
|
|
371
387
|
/** Whether the calendar should be started in month or year view. */
|
|
372
388
|
this.startView = 'month';
|
|
373
389
|
this.timeInterval = 1;
|
|
374
|
-
this.ariaLabel = 'Use arrow keys to navigate';
|
|
375
|
-
this.ariaNextMonthLabel = 'Next month';
|
|
376
|
-
this.ariaPrevMonthLabel = 'Previous month';
|
|
377
|
-
this.ariaNextYearLabel = 'Next year';
|
|
378
|
-
this.ariaPrevYearLabel = 'Previous year';
|
|
379
|
-
this.ariaNextMultiYearLabel = 'Next year range';
|
|
380
|
-
this.ariaPrevMultiYearLabel = 'Previous year range';
|
|
381
390
|
/** Prevent user to select same date time */
|
|
382
391
|
this.preventSameDateTimeSelection = false;
|
|
383
392
|
/** Emits when the currently selected date changes. */
|
|
384
393
|
this.selectedChange = new core.EventEmitter();
|
|
385
394
|
/** Emits when the view has been changed. */
|
|
386
395
|
this.viewChanged = new core.EventEmitter();
|
|
396
|
+
this._userSelection = new core.EventEmitter();
|
|
387
397
|
this._clockView = 'hour';
|
|
388
398
|
this._type = 'date';
|
|
389
399
|
/** Date filter for the month and year views. */
|
|
@@ -582,11 +592,11 @@
|
|
|
582
592
|
get: function () {
|
|
583
593
|
switch (this._currentView) {
|
|
584
594
|
case 'month':
|
|
585
|
-
return this.
|
|
595
|
+
return this._intl.nextMonthLabel;
|
|
586
596
|
case 'year':
|
|
587
|
-
return this.
|
|
597
|
+
return this._intl.nextYearLabel;
|
|
588
598
|
case 'multi-year':
|
|
589
|
-
return this.
|
|
599
|
+
return this._intl.nextMultiYearLabel;
|
|
590
600
|
default:
|
|
591
601
|
return '';
|
|
592
602
|
}
|
|
@@ -598,11 +608,11 @@
|
|
|
598
608
|
get: function () {
|
|
599
609
|
switch (this._currentView) {
|
|
600
610
|
case 'month':
|
|
601
|
-
return this.
|
|
611
|
+
return this._intl.prevMonthLabel;
|
|
602
612
|
case 'year':
|
|
603
|
-
return this.
|
|
613
|
+
return this._intl.prevYearLabel;
|
|
604
614
|
case 'multi-year':
|
|
605
|
-
return this.
|
|
615
|
+
return this._intl.prevMultiYearLabel;
|
|
606
616
|
default:
|
|
607
617
|
return '';
|
|
608
618
|
}
|
|
@@ -985,14 +995,14 @@
|
|
|
985
995
|
MtxCalendar.decorators = [
|
|
986
996
|
{ type: core.Component, args: [{
|
|
987
997
|
selector: 'mtx-calendar',
|
|
988
|
-
template: "<div class=\"mtx-calendar-header\">\n <div (click)=\"_yearClicked()\"\n *ngIf=\"type !== 'time'\"\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-calendar-header-year\"\n role=\"button\">\n <span>{{ _yearLabel }}</span>\n <
|
|
998
|
+
template: "<div class=\"mtx-calendar-header\">\n <div (click)=\"_yearClicked()\"\n *ngIf=\"type !== 'time'\"\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-calendar-header-year\"\n role=\"button\">\n <span>{{ _yearLabel }}</span>\n <svg *ngIf=\"multiYearSelector || type === 'year'\"\n class=\"mtx-calendar-header-year-dropdown\"\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\n </svg>\n </div>\n <div class=\"mtx-calendar-header-date-time\">\n <span (click)=\"_dateClicked()\" *ngIf=\"type !== 'time' && type !== 'year'\"\n [class.active]=\"currentView === 'month'\"\n [class.not-clickable]=\"type === 'month'\"\n class=\"mtx-calendar-header-date\"\n role=\"button\">{{ _dateLabel }}</span>\n <span *ngIf=\"type.endsWith('time')\"\n [class.active]=\"currentView === 'clock'\"\n class=\"mtx-calendar-header-time\">\n <span (click)=\"_hoursClicked()\"\n [class.active]=\"_clockView === 'hour'\"\n class=\"mtx-calendar-header-hours\"\n role=\"button\">{{ _hoursLabel }}</span>:<span (click)=\"_minutesClicked()\"\n [class.active]=\"_clockView === 'minute'\"\n class=\"mtx-calendar-header-minutes\"\n role=\"button\">{{ _minutesLabel }}</span>\n <br />\n <span *ngIf=\"twelvehour\" class=\"mtx-calendar-header-ampm-container\">\n <span (click)=\"_ampmClicked('AM')\"\n [class.active]=\"_AMPM === 'AM'\"\n class=\"mtx-calendar-header-ampm\">AM</span>/<span\n (click)=\"_ampmClicked('PM')\"\n [class.active]=\"_AMPM === 'PM'\"\n class=\"mtx-calendar-header-ampm\">PM</span>\n </span>\n </span>\n </div>\n</div>\n<div class=\"mtx-calendar-content\" [ngSwitch]=\"currentView\">\n <div *ngIf=\"currentView === 'month' || currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-month-content\">\n <div class=\"mtx-calendar-controls\">\n <button mat-icon-button type=\"button\" (click)=\"_previousClicked()\"\n [attr.aria-disabled]=\"!_previousEnabled()\"\n [attr.aria-label]=\"_ariaLabelPrev\"\n [class.disabled]=\"!_previousEnabled()\"\n class=\"mtx-calendar-previous-button\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\n </svg>\n </button>\n <div [@slideCalendar]=\"_calendarState\"\n (@slideCalendar.done)=\"_calendarStateDone()\"\n class=\"mtx-calendar-period-button\">\n <strong>{{ _monthYearLabel }}</strong>\n </div>\n <button mat-icon-button type=\"button\" (click)=\"_nextClicked()\"\n [attr.aria-disabled]=\"!_nextEnabled()\"\n [attr.aria-label]=\"_ariaLabelNext\"\n [class.disabled]=\"!_nextEnabled()\"\n class=\"mtx-calendar-next-button\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"></path>\n </svg>\n </button>\n </div>\n </div>\n <mtx-month-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n *ngSwitchCase=\"'month'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n <mtx-year-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n *ngSwitchCase=\"'year'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n <mtx-multi-year-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_yearSelected($event)\"\n *ngSwitchCase=\"'multi-year'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-multi-year-view>\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_timeSelected($event)\"\n *ngSwitchDefault\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\"\n [startView]=\"_clockView\"\n [twelvehour]=\"twelvehour\">\n </mtx-clock>\n</div>\n",
|
|
989
999
|
host: {
|
|
990
1000
|
'class': 'mtx-calendar',
|
|
991
|
-
'[attr.aria-label]': 'ariaLabel',
|
|
992
1001
|
'tabindex': '0',
|
|
993
1002
|
'(keydown)': '_handleCalendarBodyKeydown($event)',
|
|
994
1003
|
},
|
|
995
|
-
|
|
1004
|
+
exportAs: 'mtxCalendar',
|
|
1005
|
+
animations: [mtxDatetimepickerAnimations.slideCalendar],
|
|
996
1006
|
encapsulation: core.ViewEncapsulation.None,
|
|
997
1007
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
998
1008
|
styles: [".mtx-calendar{display:block;outline:none}.mtx-calendar[mode=landscape]{display:flex}.mtx-calendar-header{padding:16px;box-sizing:border-box;border-radius:4px 4px 0 0}[mode=landscape] .mtx-calendar-header{width:150px;min-width:150px;border-radius:4px 0 0 4px}[dir=rtl] [mode=landscape] .mtx-calendar-header{border-radius:0 4px 4px 0}.mtx-calendar-header-year,.mtx-calendar-header-date-time{width:100%;white-space:nowrap}.mtx-calendar-header-year{height:32px;line-height:32px}.mtx-calendar-header-year>*{vertical-align:middle}.mtx-calendar-header-date-time{line-height:34px}[mode=landscape] .mtx-calendar-header-date-time{white-space:normal;word-wrap:break-word}.mtx-calendar-header-year:not(.active),.mtx-calendar-header-date:not(.active),.mtx-calendar-header-hours:not(.active),.mtx-calendar-header-minutes:not(.active),.mtx-calendar-header-ampm:not(.active){cursor:pointer;opacity:.6}.mtx-calendar-header-year.not-clickable,.mtx-calendar-header-date.not-clickable,.mtx-calendar-header-hours.not-clickable,.mtx-calendar-header-minutes.not-clickable,.mtx-calendar-header-ampm.not-clickable{cursor:initial}.mtx-calendar-header-time{display:inline-block;padding-left:8px}.mtx-calendar-header-time:not(.active){opacity:.6}.mtx-calendar-header-time:not(.active) .mtx-calendar-header-hours,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-minutes,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-ampm{cursor:pointer;opacity:1}[dir=rtl] .mtx-calendar-header-time{padding-right:8px}[mode=landscape] .mtx-calendar-header-time{display:block;padding:0}.mtx-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.mtx-calendar-controls{display:flex;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.mtx-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mtx-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:transparent;box-sizing:border-box}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0}@media all and (orientation: landscape){.mtx-calendar[mode=auto]{display:flex}.mtx-calendar[mode=auto] .mtx-calendar-header{width:150px;min-width:150px;border-radius:4px 0 0 4px}[dir=rtl] .mtx-calendar[mode=auto] .mtx-calendar-header{border-radius:0 4px 4px 0}.mtx-calendar[mode=auto] .mtx-calendar-header-date-time{white-space:normal;word-wrap:break-word}.mtx-calendar[mode=auto] .mtx-calendar-header-time{display:block;padding:0}}\n"]
|
|
@@ -1015,22 +1025,15 @@
|
|
|
1015
1025
|
]; };
|
|
1016
1026
|
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
1017
1027
|
MtxCalendar.propDecorators = {
|
|
1018
|
-
_userSelection: [{ type: core.Output }],
|
|
1019
1028
|
multiYearSelector: [{ type: core.Input }],
|
|
1020
1029
|
twelvehour: [{ type: core.Input }],
|
|
1021
1030
|
startView: [{ type: core.Input }],
|
|
1022
1031
|
timeInterval: [{ type: core.Input }],
|
|
1023
1032
|
dateFilter: [{ type: core.Input }],
|
|
1024
|
-
ariaLabel: [{ type: core.Input }],
|
|
1025
|
-
ariaNextMonthLabel: [{ type: core.Input }],
|
|
1026
|
-
ariaPrevMonthLabel: [{ type: core.Input }],
|
|
1027
|
-
ariaNextYearLabel: [{ type: core.Input }],
|
|
1028
|
-
ariaPrevYearLabel: [{ type: core.Input }],
|
|
1029
|
-
ariaNextMultiYearLabel: [{ type: core.Input }],
|
|
1030
|
-
ariaPrevMultiYearLabel: [{ type: core.Input }],
|
|
1031
1033
|
preventSameDateTimeSelection: [{ type: core.Input }],
|
|
1032
1034
|
selectedChange: [{ type: core.Output }],
|
|
1033
1035
|
viewChanged: [{ type: core.Output }],
|
|
1036
|
+
_userSelection: [{ type: core.Output }],
|
|
1034
1037
|
type: [{ type: core.Input }],
|
|
1035
1038
|
startAt: [{ type: core.Input }],
|
|
1036
1039
|
selected: [{ type: core.Input }],
|
|
@@ -1051,12 +1054,14 @@
|
|
|
1051
1054
|
var _this = this;
|
|
1052
1055
|
this._element = _element;
|
|
1053
1056
|
this._adapter = _adapter;
|
|
1054
|
-
this._userSelection = new core.EventEmitter();
|
|
1055
1057
|
this.interval = 1;
|
|
1056
1058
|
this.twelvehour = false;
|
|
1057
1059
|
/** Emits when the currently selected date changes. */
|
|
1058
1060
|
this.selectedChange = new core.EventEmitter();
|
|
1061
|
+
/** Emits when any date is activated. */
|
|
1059
1062
|
this.activeDateChange = new core.EventEmitter();
|
|
1063
|
+
/** Emits when any date is selected. */
|
|
1064
|
+
this._userSelection = new core.EventEmitter();
|
|
1060
1065
|
/** Hours and Minutes representing the clock view. */
|
|
1061
1066
|
this._hours = [];
|
|
1062
1067
|
this._minutes = [];
|
|
@@ -1170,10 +1175,7 @@
|
|
|
1170
1175
|
this.activeDate = this._activeDate || this._adapter.today();
|
|
1171
1176
|
this._init();
|
|
1172
1177
|
};
|
|
1173
|
-
/**
|
|
1174
|
-
* TODO: use `fromEvent` of rxjs.
|
|
1175
|
-
* Handles mousedown events on the clock body.
|
|
1176
|
-
*/
|
|
1178
|
+
/** Handles mousedown events on the clock body. */
|
|
1177
1179
|
MtxClock.prototype._handleMousedown = function (event) {
|
|
1178
1180
|
this._timeChanged = false;
|
|
1179
1181
|
this.setTime(event);
|
|
@@ -1314,6 +1316,7 @@
|
|
|
1314
1316
|
'role': 'clock',
|
|
1315
1317
|
'(mousedown)': '_handleMousedown($event)',
|
|
1316
1318
|
},
|
|
1319
|
+
exportAs: 'mtxClock',
|
|
1317
1320
|
encapsulation: core.ViewEncapsulation.None,
|
|
1318
1321
|
styles: [".mtx-clock{position:relative;display:block;min-width:224px;margin:8px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%}.mtx-clock-hand{position:absolute;top:0;right:0;bottom:0;left:0;width:1px;margin:0 auto;transform-origin:bottom}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%}.mtx-clock-hours,.mtx-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.mtx-clock-hours.active,.mtx-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.mtx-clock-minutes{transform:scale(.8)}.mtx-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none}\n"]
|
|
1319
1322
|
},] }
|
|
@@ -1331,12 +1334,12 @@
|
|
|
1331
1334
|
]; };
|
|
1332
1335
|
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
1333
1336
|
MtxClock.propDecorators = {
|
|
1334
|
-
_userSelection: [{ type: core.Output }],
|
|
1335
1337
|
dateFilter: [{ type: core.Input }],
|
|
1336
1338
|
interval: [{ type: core.Input }],
|
|
1337
1339
|
twelvehour: [{ type: core.Input }],
|
|
1338
1340
|
selectedChange: [{ type: core.Output }],
|
|
1339
1341
|
activeDateChange: [{ type: core.Output }],
|
|
1342
|
+
_userSelection: [{ type: core.Output }],
|
|
1340
1343
|
activeDate: [{ type: core.Input }],
|
|
1341
1344
|
selected: [{ type: core.Input }],
|
|
1342
1345
|
minDate: [{ type: core.Input }],
|
|
@@ -1344,8 +1347,344 @@
|
|
|
1344
1347
|
startView: [{ type: core.Input }]
|
|
1345
1348
|
};
|
|
1346
1349
|
|
|
1350
|
+
/*! *****************************************************************************
|
|
1351
|
+
Copyright (c) Microsoft Corporation.
|
|
1352
|
+
|
|
1353
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
1354
|
+
purpose with or without fee is hereby granted.
|
|
1355
|
+
|
|
1356
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1357
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1358
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1359
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1360
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1361
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1362
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
1363
|
+
***************************************************************************** */
|
|
1364
|
+
/* global Reflect, Promise */
|
|
1365
|
+
var extendStatics = function (d, b) {
|
|
1366
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1367
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1368
|
+
function (d, b) { for (var p in b)
|
|
1369
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
1370
|
+
d[p] = b[p]; };
|
|
1371
|
+
return extendStatics(d, b);
|
|
1372
|
+
};
|
|
1373
|
+
function __extends(d, b) {
|
|
1374
|
+
if (typeof b !== "function" && b !== null)
|
|
1375
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1376
|
+
extendStatics(d, b);
|
|
1377
|
+
function __() { this.constructor = d; }
|
|
1378
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1379
|
+
}
|
|
1380
|
+
var __assign = function () {
|
|
1381
|
+
__assign = Object.assign || function __assign(t) {
|
|
1382
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1383
|
+
s = arguments[i];
|
|
1384
|
+
for (var p in s)
|
|
1385
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1386
|
+
t[p] = s[p];
|
|
1387
|
+
}
|
|
1388
|
+
return t;
|
|
1389
|
+
};
|
|
1390
|
+
return __assign.apply(this, arguments);
|
|
1391
|
+
};
|
|
1392
|
+
function __rest(s, e) {
|
|
1393
|
+
var t = {};
|
|
1394
|
+
for (var p in s)
|
|
1395
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1396
|
+
t[p] = s[p];
|
|
1397
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1398
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1399
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1400
|
+
t[p[i]] = s[p[i]];
|
|
1401
|
+
}
|
|
1402
|
+
return t;
|
|
1403
|
+
}
|
|
1404
|
+
function __decorate(decorators, target, key, desc) {
|
|
1405
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1406
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1407
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1408
|
+
else
|
|
1409
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1410
|
+
if (d = decorators[i])
|
|
1411
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1412
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1413
|
+
}
|
|
1414
|
+
function __param(paramIndex, decorator) {
|
|
1415
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
1416
|
+
}
|
|
1417
|
+
function __metadata(metadataKey, metadataValue) {
|
|
1418
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1419
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
1420
|
+
}
|
|
1421
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
1422
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1423
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1424
|
+
function fulfilled(value) { try {
|
|
1425
|
+
step(generator.next(value));
|
|
1426
|
+
}
|
|
1427
|
+
catch (e) {
|
|
1428
|
+
reject(e);
|
|
1429
|
+
} }
|
|
1430
|
+
function rejected(value) { try {
|
|
1431
|
+
step(generator["throw"](value));
|
|
1432
|
+
}
|
|
1433
|
+
catch (e) {
|
|
1434
|
+
reject(e);
|
|
1435
|
+
} }
|
|
1436
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
1437
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
function __generator(thisArg, body) {
|
|
1441
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
1442
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
1443
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
1444
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
1445
|
+
function step(op) {
|
|
1446
|
+
if (f)
|
|
1447
|
+
throw new TypeError("Generator is already executing.");
|
|
1448
|
+
while (_)
|
|
1449
|
+
try {
|
|
1450
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
1451
|
+
return t;
|
|
1452
|
+
if (y = 0, t)
|
|
1453
|
+
op = [op[0] & 2, t.value];
|
|
1454
|
+
switch (op[0]) {
|
|
1455
|
+
case 0:
|
|
1456
|
+
case 1:
|
|
1457
|
+
t = op;
|
|
1458
|
+
break;
|
|
1459
|
+
case 4:
|
|
1460
|
+
_.label++;
|
|
1461
|
+
return { value: op[1], done: false };
|
|
1462
|
+
case 5:
|
|
1463
|
+
_.label++;
|
|
1464
|
+
y = op[1];
|
|
1465
|
+
op = [0];
|
|
1466
|
+
continue;
|
|
1467
|
+
case 7:
|
|
1468
|
+
op = _.ops.pop();
|
|
1469
|
+
_.trys.pop();
|
|
1470
|
+
continue;
|
|
1471
|
+
default:
|
|
1472
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1473
|
+
_ = 0;
|
|
1474
|
+
continue;
|
|
1475
|
+
}
|
|
1476
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
1477
|
+
_.label = op[1];
|
|
1478
|
+
break;
|
|
1479
|
+
}
|
|
1480
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
1481
|
+
_.label = t[1];
|
|
1482
|
+
t = op;
|
|
1483
|
+
break;
|
|
1484
|
+
}
|
|
1485
|
+
if (t && _.label < t[2]) {
|
|
1486
|
+
_.label = t[2];
|
|
1487
|
+
_.ops.push(op);
|
|
1488
|
+
break;
|
|
1489
|
+
}
|
|
1490
|
+
if (t[2])
|
|
1491
|
+
_.ops.pop();
|
|
1492
|
+
_.trys.pop();
|
|
1493
|
+
continue;
|
|
1494
|
+
}
|
|
1495
|
+
op = body.call(thisArg, _);
|
|
1496
|
+
}
|
|
1497
|
+
catch (e) {
|
|
1498
|
+
op = [6, e];
|
|
1499
|
+
y = 0;
|
|
1500
|
+
}
|
|
1501
|
+
finally {
|
|
1502
|
+
f = t = 0;
|
|
1503
|
+
}
|
|
1504
|
+
if (op[0] & 5)
|
|
1505
|
+
throw op[1];
|
|
1506
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
1510
|
+
if (k2 === undefined)
|
|
1511
|
+
k2 = k;
|
|
1512
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
1513
|
+
}) : (function (o, m, k, k2) {
|
|
1514
|
+
if (k2 === undefined)
|
|
1515
|
+
k2 = k;
|
|
1516
|
+
o[k2] = m[k];
|
|
1517
|
+
});
|
|
1518
|
+
function __exportStar(m, o) {
|
|
1519
|
+
for (var p in m)
|
|
1520
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
1521
|
+
__createBinding(o, m, p);
|
|
1522
|
+
}
|
|
1523
|
+
function __values(o) {
|
|
1524
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
1525
|
+
if (m)
|
|
1526
|
+
return m.call(o);
|
|
1527
|
+
if (o && typeof o.length === "number")
|
|
1528
|
+
return {
|
|
1529
|
+
next: function () {
|
|
1530
|
+
if (o && i >= o.length)
|
|
1531
|
+
o = void 0;
|
|
1532
|
+
return { value: o && o[i++], done: !o };
|
|
1533
|
+
}
|
|
1534
|
+
};
|
|
1535
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1536
|
+
}
|
|
1537
|
+
function __read(o, n) {
|
|
1538
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1539
|
+
if (!m)
|
|
1540
|
+
return o;
|
|
1541
|
+
var i = m.call(o), r, ar = [], e;
|
|
1542
|
+
try {
|
|
1543
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
1544
|
+
ar.push(r.value);
|
|
1545
|
+
}
|
|
1546
|
+
catch (error) {
|
|
1547
|
+
e = { error: error };
|
|
1548
|
+
}
|
|
1549
|
+
finally {
|
|
1550
|
+
try {
|
|
1551
|
+
if (r && !r.done && (m = i["return"]))
|
|
1552
|
+
m.call(i);
|
|
1553
|
+
}
|
|
1554
|
+
finally {
|
|
1555
|
+
if (e)
|
|
1556
|
+
throw e.error;
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
return ar;
|
|
1560
|
+
}
|
|
1561
|
+
/** @deprecated */
|
|
1562
|
+
function __spread() {
|
|
1563
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
1564
|
+
ar = ar.concat(__read(arguments[i]));
|
|
1565
|
+
return ar;
|
|
1566
|
+
}
|
|
1567
|
+
/** @deprecated */
|
|
1568
|
+
function __spreadArrays() {
|
|
1569
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
1570
|
+
s += arguments[i].length;
|
|
1571
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
1572
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
1573
|
+
r[k] = a[j];
|
|
1574
|
+
return r;
|
|
1575
|
+
}
|
|
1576
|
+
function __spreadArray(to, from, pack) {
|
|
1577
|
+
if (pack || arguments.length === 2)
|
|
1578
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1579
|
+
if (ar || !(i in from)) {
|
|
1580
|
+
if (!ar)
|
|
1581
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
1582
|
+
ar[i] = from[i];
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
return to.concat(ar || from);
|
|
1586
|
+
}
|
|
1587
|
+
function __await(v) {
|
|
1588
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
1589
|
+
}
|
|
1590
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
1591
|
+
if (!Symbol.asyncIterator)
|
|
1592
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1593
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
1594
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
1595
|
+
function verb(n) { if (g[n])
|
|
1596
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
1597
|
+
function resume(n, v) { try {
|
|
1598
|
+
step(g[n](v));
|
|
1599
|
+
}
|
|
1600
|
+
catch (e) {
|
|
1601
|
+
settle(q[0][3], e);
|
|
1602
|
+
} }
|
|
1603
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
1604
|
+
function fulfill(value) { resume("next", value); }
|
|
1605
|
+
function reject(value) { resume("throw", value); }
|
|
1606
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
1607
|
+
resume(q[0][0], q[0][1]); }
|
|
1608
|
+
}
|
|
1609
|
+
function __asyncDelegator(o) {
|
|
1610
|
+
var i, p;
|
|
1611
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
1612
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
1613
|
+
}
|
|
1614
|
+
function __asyncValues(o) {
|
|
1615
|
+
if (!Symbol.asyncIterator)
|
|
1616
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1617
|
+
var m = o[Symbol.asyncIterator], i;
|
|
1618
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
1619
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
1620
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
1621
|
+
}
|
|
1622
|
+
function __makeTemplateObject(cooked, raw) {
|
|
1623
|
+
if (Object.defineProperty) {
|
|
1624
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
1625
|
+
}
|
|
1626
|
+
else {
|
|
1627
|
+
cooked.raw = raw;
|
|
1628
|
+
}
|
|
1629
|
+
return cooked;
|
|
1630
|
+
}
|
|
1631
|
+
;
|
|
1632
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
1633
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1634
|
+
}) : function (o, v) {
|
|
1635
|
+
o["default"] = v;
|
|
1636
|
+
};
|
|
1637
|
+
function __importStar(mod) {
|
|
1638
|
+
if (mod && mod.__esModule)
|
|
1639
|
+
return mod;
|
|
1640
|
+
var result = {};
|
|
1641
|
+
if (mod != null)
|
|
1642
|
+
for (var k in mod)
|
|
1643
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
1644
|
+
__createBinding(result, mod, k);
|
|
1645
|
+
__setModuleDefault(result, mod);
|
|
1646
|
+
return result;
|
|
1647
|
+
}
|
|
1648
|
+
function __importDefault(mod) {
|
|
1649
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
1650
|
+
}
|
|
1651
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
1652
|
+
if (kind === "a" && !f)
|
|
1653
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
1654
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1655
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1656
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1657
|
+
}
|
|
1658
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
1659
|
+
if (kind === "m")
|
|
1660
|
+
throw new TypeError("Private method is not writable");
|
|
1661
|
+
if (kind === "a" && !f)
|
|
1662
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
1663
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1664
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1665
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1347
1668
|
/** Used to generate a unique ID for each datetimepicker instance. */
|
|
1348
1669
|
var datetimepickerUid = 0;
|
|
1670
|
+
/** Injection token that determines the scroll handling while the calendar is open. */
|
|
1671
|
+
var MTX_DATETIMEPICKER_SCROLL_STRATEGY = new core.InjectionToken('mtx-datetimepicker-scroll-strategy');
|
|
1672
|
+
function MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY(overlay) {
|
|
1673
|
+
return function () { return overlay.scrollStrategies.reposition(); };
|
|
1674
|
+
}
|
|
1675
|
+
var MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = {
|
|
1676
|
+
provide: MTX_DATETIMEPICKER_SCROLL_STRATEGY,
|
|
1677
|
+
deps: [overlay.Overlay],
|
|
1678
|
+
useFactory: MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY,
|
|
1679
|
+
};
|
|
1680
|
+
// Boilerplate for applying mixins to MtxDatetimepickerContent.
|
|
1681
|
+
/** @docs-private */
|
|
1682
|
+
var _MtxDatetimepickerContentBase = core$2.mixinColor(/** @class */ (function () {
|
|
1683
|
+
function class_1(_elementRef) {
|
|
1684
|
+
this._elementRef = _elementRef;
|
|
1685
|
+
}
|
|
1686
|
+
return class_1;
|
|
1687
|
+
}()));
|
|
1349
1688
|
/**
|
|
1350
1689
|
* Component used as the content for the datetimepicker dialog and popup. We use this instead of
|
|
1351
1690
|
* using MtxCalendar directly as the content so we can control the initial focus. This also gives us
|
|
@@ -1353,33 +1692,63 @@
|
|
|
1353
1692
|
* future. (e.g. confirmation buttons).
|
|
1354
1693
|
* @docs-private
|
|
1355
1694
|
*/
|
|
1356
|
-
var MtxDatetimepickerContent = /** @class */ (function () {
|
|
1357
|
-
|
|
1695
|
+
var MtxDatetimepickerContent = /** @class */ (function (_super) {
|
|
1696
|
+
__extends(MtxDatetimepickerContent, _super);
|
|
1697
|
+
function MtxDatetimepickerContent(elementRef, _changeDetectorRef) {
|
|
1698
|
+
var _this = _super.call(this, elementRef) || this;
|
|
1699
|
+
_this._changeDetectorRef = _changeDetectorRef;
|
|
1700
|
+
/** Emits when an animation has finished. */
|
|
1701
|
+
_this._animationDone = new rxjs.Subject();
|
|
1702
|
+
return _this;
|
|
1358
1703
|
}
|
|
1704
|
+
MtxDatetimepickerContent.prototype.ngOnInit = function () {
|
|
1705
|
+
this._animationState = this.datetimepicker.touchUi ? 'enter-dialog' : 'enter-dropdown';
|
|
1706
|
+
};
|
|
1359
1707
|
MtxDatetimepickerContent.prototype.ngAfterContentInit = function () {
|
|
1360
1708
|
this._calendar._focusActiveCell();
|
|
1361
1709
|
};
|
|
1362
|
-
MtxDatetimepickerContent.prototype.
|
|
1363
|
-
this.
|
|
1364
|
-
this.
|
|
1710
|
+
MtxDatetimepickerContent.prototype._startExitAnimation = function () {
|
|
1711
|
+
this._animationState = 'void';
|
|
1712
|
+
this._changeDetectorRef.markForCheck();
|
|
1713
|
+
};
|
|
1714
|
+
MtxDatetimepickerContent.prototype.ngOnDestroy = function () {
|
|
1715
|
+
this._animationDone.complete();
|
|
1365
1716
|
};
|
|
1366
1717
|
return MtxDatetimepickerContent;
|
|
1367
|
-
}());
|
|
1718
|
+
}(_MtxDatetimepickerContentBase));
|
|
1368
1719
|
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1369
1720
|
MtxDatetimepickerContent.decorators = [
|
|
1370
1721
|
{ type: core.Component, args: [{
|
|
1371
1722
|
selector: 'mtx-datetimepicker-content',
|
|
1372
|
-
template: "<div cdkTrapFocus\n class=\"mtx-datetimepicker-content-container\"\n [attr.mode]=\"datetimepicker.mode\">\n <mtx-calendar
|
|
1723
|
+
template: "<div cdkTrapFocus\n class=\"mtx-datetimepicker-content-container\"\n [attr.mode]=\"datetimepicker.mode\">\n <mtx-calendar [id]=\"datetimepicker.id\"\n [ngClass]=\"datetimepicker.panelClass\"\n [attr.mode]=\"datetimepicker.mode\"\n [type]=\"datetimepicker.type\"\n [startAt]=\"datetimepicker.startAt\"\n [startView]=\"datetimepicker.startView\"\n [maxDate]=\"datetimepicker._maxDate\"\n [minDate]=\"datetimepicker._minDate\"\n [dateFilter]=\"datetimepicker._dateFilter\"\n [multiYearSelector]=\"datetimepicker.multiYearSelector\"\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\n [timeInterval]=\"datetimepicker.timeInterval\"\n [twelvehour]=\"datetimepicker.twelvehour\"\n [selected]=\"datetimepicker._selected\"\n [@fadeInCalendar]=\"'enter'\"\n (selectedChange)=\"datetimepicker._select($event)\"\n (viewChanged)=\"datetimepicker._viewChanged($event)\"\n (_userSelection)=\"datetimepicker.close()\">\n </mtx-calendar>\n</div>\n",
|
|
1373
1724
|
host: {
|
|
1374
1725
|
'class': 'mtx-datetimepicker-content',
|
|
1375
1726
|
'[class.mtx-datetimepicker-content-touch]': 'datetimepicker?.touchUi',
|
|
1376
1727
|
'[attr.mode]': 'datetimepicker.mode',
|
|
1728
|
+
'[@transformPanel]': '_animationState',
|
|
1729
|
+
'(@transformPanel.done)': '_animationDone.next()',
|
|
1377
1730
|
},
|
|
1731
|
+
animations: [
|
|
1732
|
+
mtxDatetimepickerAnimations.transformPanel,
|
|
1733
|
+
mtxDatetimepickerAnimations.fadeInCalendar,
|
|
1734
|
+
],
|
|
1378
1735
|
encapsulation: core.ViewEncapsulation.None,
|
|
1379
1736
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
1737
|
+
inputs: ['color'],
|
|
1380
1738
|
styles: [".mtx-datetimepicker-content{display:block;border-radius:4px}.mtx-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mtx-datetimepicker-content .mtx-calendar{width:296px;height:404px}.mtx-datetimepicker-content .mtx-calendar[mode=landscape]{width:446px;height:328px}@media all and (orientation: landscape){.mtx-datetimepicker-content .mtx-calendar[mode=auto]{width:446px;height:328px}}.mtx-datetimepicker-content-touch{display:block;max-height:80vh;position:relative;overflow:visible}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.mtx-datetimepicker-content-touch .mtx-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:120vh;height:80vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}}@media all and (orientation: portrait){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container-with-actions{height:135vw}}\n"]
|
|
1381
1739
|
},] }
|
|
1382
1740
|
];
|
|
1741
|
+
/**
|
|
1742
|
+
* @type {function(): !Array<(null|{
|
|
1743
|
+
* type: ?,
|
|
1744
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
1745
|
+
* })>}
|
|
1746
|
+
* @nocollapse
|
|
1747
|
+
*/
|
|
1748
|
+
MtxDatetimepickerContent.ctorParameters = function () { return [
|
|
1749
|
+
{ type: core.ElementRef },
|
|
1750
|
+
{ type: core.ChangeDetectorRef }
|
|
1751
|
+
]; };
|
|
1383
1752
|
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
1384
1753
|
MtxDatetimepickerContent.propDecorators = {
|
|
1385
1754
|
_calendar: [{ type: core.ViewChild, args: [MtxCalendar, { static: true },] }]
|
|
@@ -1398,10 +1767,6 @@
|
|
|
1398
1767
|
this.startView = 'month';
|
|
1399
1768
|
this.mode = 'auto';
|
|
1400
1769
|
this.timeInterval = 1;
|
|
1401
|
-
this.ariaNextMonthLabel = 'Next month';
|
|
1402
|
-
this.ariaPrevMonthLabel = 'Previous month';
|
|
1403
|
-
this.ariaNextYearLabel = 'Next year';
|
|
1404
|
-
this.ariaPrevYearLabel = 'Previous year';
|
|
1405
1770
|
/** Prevent user to select same date time */
|
|
1406
1771
|
this.preventSameDateTimeSelection = false;
|
|
1407
1772
|
/**
|
|
@@ -1415,8 +1780,7 @@
|
|
|
1415
1780
|
this.closedStream = new core.EventEmitter();
|
|
1416
1781
|
/** Emits when the view has been changed. */
|
|
1417
1782
|
this.viewChanged = new core.EventEmitter();
|
|
1418
|
-
|
|
1419
|
-
this.opened = false;
|
|
1783
|
+
this._opened = false;
|
|
1420
1784
|
/** The id for the datetimepicker calendar. */
|
|
1421
1785
|
this.id = "mtx-datetimepicker-" + datetimepickerUid++;
|
|
1422
1786
|
/** Emits when the datetimepicker is disabled. */
|
|
@@ -1429,6 +1793,11 @@
|
|
|
1429
1793
|
this._inputStateChanges = rxjs.Subscription.EMPTY;
|
|
1430
1794
|
this._type = 'date';
|
|
1431
1795
|
this._touchUi = false;
|
|
1796
|
+
/** Preferred position of the datetimepicker in the X axis. */
|
|
1797
|
+
this.xPosition = 'start';
|
|
1798
|
+
/** Preferred position of the datetimepicker in the Y axis. */
|
|
1799
|
+
this.yPosition = 'below';
|
|
1800
|
+
this._restoreFocus = true;
|
|
1432
1801
|
if (!this._dateAdapter) {
|
|
1433
1802
|
throw createMissingDateImplError('DateAdapter');
|
|
1434
1803
|
}
|
|
@@ -1455,25 +1824,52 @@
|
|
|
1455
1824
|
enumerable: false,
|
|
1456
1825
|
configurable: true
|
|
1457
1826
|
});
|
|
1458
|
-
Object.defineProperty(MtxDatetimepicker.prototype, "
|
|
1459
|
-
/**
|
|
1827
|
+
Object.defineProperty(MtxDatetimepicker.prototype, "panelClass", {
|
|
1828
|
+
/**
|
|
1829
|
+
* Classes to be passed to the date picker panel.
|
|
1830
|
+
* Supports string and string array values, similar to `ngClass`.
|
|
1831
|
+
*/
|
|
1460
1832
|
get: function () {
|
|
1461
|
-
|
|
1462
|
-
// selected value is.
|
|
1463
|
-
return this._startAt || (this._datetimepickerInput ? this._datetimepickerInput.value : null);
|
|
1833
|
+
return this._panelClass;
|
|
1464
1834
|
},
|
|
1465
|
-
set: function (
|
|
1466
|
-
this.
|
|
1835
|
+
set: function (value) {
|
|
1836
|
+
this._panelClass = coercion.coerceStringArray(value);
|
|
1467
1837
|
},
|
|
1468
1838
|
enumerable: false,
|
|
1469
1839
|
configurable: true
|
|
1470
1840
|
});
|
|
1471
|
-
Object.defineProperty(MtxDatetimepicker.prototype, "
|
|
1841
|
+
Object.defineProperty(MtxDatetimepicker.prototype, "opened", {
|
|
1842
|
+
/** Whether the calendar is open. */
|
|
1472
1843
|
get: function () {
|
|
1473
|
-
return this.
|
|
1844
|
+
return this._opened;
|
|
1474
1845
|
},
|
|
1475
1846
|
set: function (value) {
|
|
1476
|
-
this.
|
|
1847
|
+
coercion.coerceBooleanProperty(value) ? this.open() : this.close();
|
|
1848
|
+
},
|
|
1849
|
+
enumerable: false,
|
|
1850
|
+
configurable: true
|
|
1851
|
+
});
|
|
1852
|
+
Object.defineProperty(MtxDatetimepicker.prototype, "color", {
|
|
1853
|
+
/** Color palette to use on the datetimepicker's calendar. */
|
|
1854
|
+
get: function () {
|
|
1855
|
+
return (this._color ||
|
|
1856
|
+
(this.datetimepickerInput ? this.datetimepickerInput.getThemePalette() : undefined));
|
|
1857
|
+
},
|
|
1858
|
+
set: function (value) {
|
|
1859
|
+
this._color = value;
|
|
1860
|
+
},
|
|
1861
|
+
enumerable: false,
|
|
1862
|
+
configurable: true
|
|
1863
|
+
});
|
|
1864
|
+
Object.defineProperty(MtxDatetimepicker.prototype, "startAt", {
|
|
1865
|
+
/** The date to open the calendar to initially. */
|
|
1866
|
+
get: function () {
|
|
1867
|
+
// If an explicit startAt is set we start there, otherwise we start at whatever the currently
|
|
1868
|
+
// selected value is.
|
|
1869
|
+
return this._startAt || (this.datetimepickerInput ? this.datetimepickerInput.value : null);
|
|
1870
|
+
},
|
|
1871
|
+
set: function (date) {
|
|
1872
|
+
this._startAt = this._dateAdapter.getValidDateOrNull(date);
|
|
1477
1873
|
},
|
|
1478
1874
|
enumerable: false,
|
|
1479
1875
|
configurable: true
|
|
@@ -1505,8 +1901,8 @@
|
|
|
1505
1901
|
Object.defineProperty(MtxDatetimepicker.prototype, "disabled", {
|
|
1506
1902
|
/** Whether the datetimepicker pop-up should be disabled. */
|
|
1507
1903
|
get: function () {
|
|
1508
|
-
return this._disabled === undefined && this.
|
|
1509
|
-
? this.
|
|
1904
|
+
return this._disabled === undefined && this.datetimepickerInput
|
|
1905
|
+
? this.datetimepickerInput.disabled
|
|
1510
1906
|
: !!this._disabled;
|
|
1511
1907
|
},
|
|
1512
1908
|
set: function (value) {
|
|
@@ -1519,6 +1915,21 @@
|
|
|
1519
1915
|
enumerable: false,
|
|
1520
1916
|
configurable: true
|
|
1521
1917
|
});
|
|
1918
|
+
Object.defineProperty(MtxDatetimepicker.prototype, "restoreFocus", {
|
|
1919
|
+
/**
|
|
1920
|
+
* Whether to restore focus to the previously-focused element when the panel is closed.
|
|
1921
|
+
* Note that automatic focus restoration is an accessibility feature and it is recommended that
|
|
1922
|
+
* you provide your own equivalent, if you decide to turn it off.
|
|
1923
|
+
*/
|
|
1924
|
+
get: function () {
|
|
1925
|
+
return this._restoreFocus;
|
|
1926
|
+
},
|
|
1927
|
+
set: function (value) {
|
|
1928
|
+
this._restoreFocus = coercion.coerceBooleanProperty(value);
|
|
1929
|
+
},
|
|
1930
|
+
enumerable: false,
|
|
1931
|
+
configurable: true
|
|
1932
|
+
});
|
|
1522
1933
|
Object.defineProperty(MtxDatetimepicker.prototype, "_selected", {
|
|
1523
1934
|
/** The currently selected date. */
|
|
1524
1935
|
get: function () {
|
|
@@ -1533,7 +1944,7 @@
|
|
|
1533
1944
|
Object.defineProperty(MtxDatetimepicker.prototype, "_minDate", {
|
|
1534
1945
|
/** The minimum selectable date. */
|
|
1535
1946
|
get: function () {
|
|
1536
|
-
return this.
|
|
1947
|
+
return this.datetimepickerInput && this.datetimepickerInput.min;
|
|
1537
1948
|
},
|
|
1538
1949
|
enumerable: false,
|
|
1539
1950
|
configurable: true
|
|
@@ -1541,14 +1952,14 @@
|
|
|
1541
1952
|
Object.defineProperty(MtxDatetimepicker.prototype, "_maxDate", {
|
|
1542
1953
|
/** The maximum selectable date. */
|
|
1543
1954
|
get: function () {
|
|
1544
|
-
return this.
|
|
1955
|
+
return this.datetimepickerInput && this.datetimepickerInput.max;
|
|
1545
1956
|
},
|
|
1546
1957
|
enumerable: false,
|
|
1547
1958
|
configurable: true
|
|
1548
1959
|
});
|
|
1549
1960
|
Object.defineProperty(MtxDatetimepicker.prototype, "_dateFilter", {
|
|
1550
1961
|
get: function () {
|
|
1551
|
-
return this.
|
|
1962
|
+
return this.datetimepickerInput && this.datetimepickerInput._dateFilter;
|
|
1552
1963
|
},
|
|
1553
1964
|
enumerable: false,
|
|
1554
1965
|
configurable: true
|
|
@@ -1562,10 +1973,7 @@
|
|
|
1562
1973
|
this._inputStateChanges.unsubscribe();
|
|
1563
1974
|
this._disabledChange.complete();
|
|
1564
1975
|
};
|
|
1565
|
-
/**
|
|
1566
|
-
* TODO: use model
|
|
1567
|
-
* Selects the given date
|
|
1568
|
-
*/
|
|
1976
|
+
/** Selects the given date */
|
|
1569
1977
|
MtxDatetimepicker.prototype._select = function (date) {
|
|
1570
1978
|
var oldValue = this._selected;
|
|
1571
1979
|
this._selected = date;
|
|
@@ -1579,29 +1987,29 @@
|
|
|
1579
1987
|
*/
|
|
1580
1988
|
MtxDatetimepicker.prototype._registerInput = function (input) {
|
|
1581
1989
|
var _this = this;
|
|
1582
|
-
if (this.
|
|
1990
|
+
if (this.datetimepickerInput) {
|
|
1583
1991
|
throw Error('A MtxDatetimepicker can only be associated with a single input.');
|
|
1584
1992
|
}
|
|
1585
|
-
this.
|
|
1586
|
-
this._inputStateChanges = this.
|
|
1993
|
+
this.datetimepickerInput = input;
|
|
1994
|
+
this._inputStateChanges = this.datetimepickerInput._valueChange.subscribe(function (value) { return (_this._selected = value); });
|
|
1587
1995
|
};
|
|
1588
1996
|
/** Open the calendar. */
|
|
1589
1997
|
MtxDatetimepicker.prototype.open = function () {
|
|
1590
|
-
if (this.
|
|
1998
|
+
if (this._opened || this.disabled) {
|
|
1591
1999
|
return;
|
|
1592
2000
|
}
|
|
1593
|
-
if (!this.
|
|
2001
|
+
if (!this.datetimepickerInput) {
|
|
1594
2002
|
throw Error('Attempted to open an MtxDatetimepicker with no associated input.');
|
|
1595
2003
|
}
|
|
1596
2004
|
this._focusedElementBeforeOpen = platform._getFocusedElementPierceShadowDom();
|
|
1597
2005
|
this._openOverlay();
|
|
1598
|
-
this.
|
|
2006
|
+
this._opened = true;
|
|
1599
2007
|
this.openedStream.emit();
|
|
1600
2008
|
};
|
|
1601
2009
|
/** Close the calendar. */
|
|
1602
2010
|
MtxDatetimepicker.prototype.close = function () {
|
|
1603
2011
|
var _this = this;
|
|
1604
|
-
if (!this.
|
|
2012
|
+
if (!this._opened) {
|
|
1605
2013
|
return;
|
|
1606
2014
|
}
|
|
1607
2015
|
if (this._componentRef) {
|
|
@@ -1610,13 +2018,14 @@
|
|
|
1610
2018
|
var completeClose = function () {
|
|
1611
2019
|
// The `_opened` could've been reset already if
|
|
1612
2020
|
// we got two events in quick succession.
|
|
1613
|
-
if (_this.
|
|
1614
|
-
_this.
|
|
2021
|
+
if (_this._opened) {
|
|
2022
|
+
_this._opened = false;
|
|
1615
2023
|
_this.closedStream.emit();
|
|
1616
2024
|
_this._focusedElementBeforeOpen = null;
|
|
1617
2025
|
}
|
|
1618
2026
|
};
|
|
1619
|
-
if (this.
|
|
2027
|
+
if (this._restoreFocus &&
|
|
2028
|
+
this._focusedElementBeforeOpen &&
|
|
1620
2029
|
typeof this._focusedElementBeforeOpen.focus === 'function') {
|
|
1621
2030
|
// Because IE moves focus asynchronously, we can't count on it being restored before we've
|
|
1622
2031
|
// marked the datetimepicker as closed. If the event fires out of sequence and the element
|
|
@@ -1631,19 +2040,19 @@
|
|
|
1631
2040
|
}
|
|
1632
2041
|
};
|
|
1633
2042
|
/**
|
|
1634
|
-
* TODO: add datetimepicker color
|
|
1635
2043
|
* Forwards relevant values from the datetimepicker to the
|
|
1636
2044
|
* datetimepicker content inside the overlay.
|
|
1637
2045
|
*/
|
|
1638
2046
|
MtxDatetimepicker.prototype._forwardContentValues = function (instance) {
|
|
1639
2047
|
instance.datetimepicker = this;
|
|
2048
|
+
instance.color = this.color;
|
|
1640
2049
|
};
|
|
1641
2050
|
/** Opens the overlay with the calendar. */
|
|
1642
2051
|
MtxDatetimepicker.prototype._openOverlay = function () {
|
|
1643
2052
|
var _this = this;
|
|
1644
2053
|
this._destroyOverlay();
|
|
1645
2054
|
var isDialog = this.touchUi;
|
|
1646
|
-
var labelId = this.
|
|
2055
|
+
var labelId = this.datetimepickerInput.getOverlayLabelId();
|
|
1647
2056
|
var portal$1 = new portal.ComponentPortal(MtxDatetimepickerContent, this._viewContainerRef);
|
|
1648
2057
|
var overlayRef = (this._overlayRef = this._overlay.create(new overlay.OverlayConfig({
|
|
1649
2058
|
positionStrategy: isDialog ? this._getDialogStrategy() : this._getDropdownStrategy(),
|
|
@@ -1692,7 +2101,7 @@
|
|
|
1692
2101
|
MtxDatetimepicker.prototype._getDropdownStrategy = function () {
|
|
1693
2102
|
var strategy = this._overlay
|
|
1694
2103
|
.position()
|
|
1695
|
-
.flexibleConnectedTo(this.
|
|
2104
|
+
.flexibleConnectedTo(this.datetimepickerInput.getConnectedOverlayOrigin())
|
|
1696
2105
|
.withTransformOriginOn('.mtx-datetimepicker-content')
|
|
1697
2106
|
.withFlexibleDimensions(false)
|
|
1698
2107
|
.withViewportMargin(8)
|
|
@@ -1700,34 +2109,37 @@
|
|
|
1700
2109
|
return this._setConnectedPositions(strategy);
|
|
1701
2110
|
};
|
|
1702
2111
|
/**
|
|
1703
|
-
* TODO: `xPosition` and `yPosition`
|
|
1704
2112
|
* Sets the positions of the datetimepicker in dropdown mode based on the current configuration.
|
|
1705
2113
|
*/
|
|
1706
2114
|
MtxDatetimepicker.prototype._setConnectedPositions = function (strategy) {
|
|
2115
|
+
var primaryX = this.xPosition === 'end' ? 'end' : 'start';
|
|
2116
|
+
var secondaryX = primaryX === 'start' ? 'end' : 'start';
|
|
2117
|
+
var primaryY = this.yPosition === 'above' ? 'bottom' : 'top';
|
|
2118
|
+
var secondaryY = primaryY === 'top' ? 'bottom' : 'top';
|
|
1707
2119
|
return strategy.withPositions([
|
|
1708
2120
|
{
|
|
1709
|
-
originX:
|
|
1710
|
-
originY:
|
|
1711
|
-
overlayX:
|
|
1712
|
-
overlayY:
|
|
2121
|
+
originX: primaryX,
|
|
2122
|
+
originY: secondaryY,
|
|
2123
|
+
overlayX: primaryX,
|
|
2124
|
+
overlayY: primaryY,
|
|
1713
2125
|
},
|
|
1714
2126
|
{
|
|
1715
|
-
originX:
|
|
1716
|
-
originY:
|
|
1717
|
-
overlayX:
|
|
1718
|
-
overlayY:
|
|
2127
|
+
originX: primaryX,
|
|
2128
|
+
originY: primaryY,
|
|
2129
|
+
overlayX: primaryX,
|
|
2130
|
+
overlayY: secondaryY,
|
|
1719
2131
|
},
|
|
1720
2132
|
{
|
|
1721
|
-
originX:
|
|
1722
|
-
originY:
|
|
1723
|
-
overlayX:
|
|
1724
|
-
overlayY:
|
|
2133
|
+
originX: secondaryX,
|
|
2134
|
+
originY: secondaryY,
|
|
2135
|
+
overlayX: secondaryX,
|
|
2136
|
+
overlayY: primaryY,
|
|
1725
2137
|
},
|
|
1726
2138
|
{
|
|
1727
|
-
originX:
|
|
1728
|
-
originY:
|
|
1729
|
-
overlayX:
|
|
1730
|
-
overlayY:
|
|
2139
|
+
originX: secondaryX,
|
|
2140
|
+
originY: primaryY,
|
|
2141
|
+
overlayX: secondaryX,
|
|
2142
|
+
overlayY: secondaryY,
|
|
1731
2143
|
},
|
|
1732
2144
|
]);
|
|
1733
2145
|
};
|
|
@@ -1737,7 +2149,7 @@
|
|
|
1737
2149
|
return rxjs.merge(overlayRef.backdropClick(), overlayRef.detachments(), overlayRef.keydownEvents().pipe(operators.filter(function (event) {
|
|
1738
2150
|
// Closing on alt + up is only valid when there's an input associated with the datetimepicker.
|
|
1739
2151
|
return ((event.keyCode === keycodes.ESCAPE && !keycodes.hasModifierKey(event)) ||
|
|
1740
|
-
(_this.
|
|
2152
|
+
(_this.datetimepickerInput &&
|
|
1741
2153
|
keycodes.hasModifierKey(event, 'altKey') &&
|
|
1742
2154
|
event.keyCode === keycodes.UP_ARROW));
|
|
1743
2155
|
})));
|
|
@@ -1766,7 +2178,7 @@
|
|
|
1766
2178
|
{ type: overlay.Overlay },
|
|
1767
2179
|
{ type: core.NgZone },
|
|
1768
2180
|
{ type: core.ViewContainerRef },
|
|
1769
|
-
{ type: undefined, decorators: [{ type: core.Inject, args: [
|
|
2181
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [MTX_DATETIMEPICKER_SCROLL_STRATEGY,] }] },
|
|
1770
2182
|
{ type: core$1.DatetimeAdapter, decorators: [{ type: core.Optional }] },
|
|
1771
2183
|
{ type: bidi.Directionality, decorators: [{ type: core.Optional }] }
|
|
1772
2184
|
]; };
|
|
@@ -1777,21 +2189,21 @@
|
|
|
1777
2189
|
startView: [{ type: core.Input }],
|
|
1778
2190
|
mode: [{ type: core.Input }],
|
|
1779
2191
|
timeInterval: [{ type: core.Input }],
|
|
1780
|
-
ariaNextMonthLabel: [{ type: core.Input }],
|
|
1781
|
-
ariaPrevMonthLabel: [{ type: core.Input }],
|
|
1782
|
-
ariaNextYearLabel: [{ type: core.Input }],
|
|
1783
|
-
ariaPrevYearLabel: [{ type: core.Input }],
|
|
1784
2192
|
preventSameDateTimeSelection: [{ type: core.Input }],
|
|
1785
2193
|
selectedChanged: [{ type: core.Output }],
|
|
1786
|
-
panelClass: [{ type: core.Input }],
|
|
1787
2194
|
openedStream: [{ type: core.Output, args: ['opened',] }],
|
|
1788
2195
|
closedStream: [{ type: core.Output, args: ['closed',] }],
|
|
1789
2196
|
viewChanged: [{ type: core.Output }],
|
|
2197
|
+
panelClass: [{ type: core.Input }],
|
|
2198
|
+
opened: [{ type: core.Input }],
|
|
2199
|
+
color: [{ type: core.Input }],
|
|
1790
2200
|
startAt: [{ type: core.Input }],
|
|
1791
|
-
openOnFocus: [{ type: core.Input }],
|
|
1792
2201
|
type: [{ type: core.Input }],
|
|
1793
2202
|
touchUi: [{ type: core.Input }],
|
|
1794
|
-
disabled: [{ type: core.Input }]
|
|
2203
|
+
disabled: [{ type: core.Input }],
|
|
2204
|
+
xPosition: [{ type: core.Input }],
|
|
2205
|
+
yPosition: [{ type: core.Input }],
|
|
2206
|
+
restoreFocus: [{ type: core.Input }]
|
|
1795
2207
|
};
|
|
1796
2208
|
|
|
1797
2209
|
var MAT_DATETIMEPICKER_VALUE_ACCESSOR = {
|
|
@@ -2094,6 +2506,10 @@
|
|
|
2094
2506
|
? this._dateAdapter.format(value, this.getDisplayFormat())
|
|
2095
2507
|
: '';
|
|
2096
2508
|
};
|
|
2509
|
+
/** Returns the palette used by the input's form field, if any. */
|
|
2510
|
+
MtxDatetimepickerInput.prototype.getThemePalette = function () {
|
|
2511
|
+
return this._formField ? this._formField.color : undefined;
|
|
2512
|
+
};
|
|
2097
2513
|
return MtxDatetimepickerInput;
|
|
2098
2514
|
}());
|
|
2099
2515
|
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
@@ -2144,6 +2560,18 @@
|
|
|
2144
2560
|
disabled: [{ type: core.Input }]
|
|
2145
2561
|
};
|
|
2146
2562
|
|
|
2563
|
+
/** Can be used to override the icon of a `mtxDatetimepickerToggle`. */
|
|
2564
|
+
var MtxDatetimepickerToggleIcon = /** @class */ (function () {
|
|
2565
|
+
function MtxDatetimepickerToggleIcon() {
|
|
2566
|
+
}
|
|
2567
|
+
return MtxDatetimepickerToggleIcon;
|
|
2568
|
+
}());
|
|
2569
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
2570
|
+
MtxDatetimepickerToggleIcon.decorators = [
|
|
2571
|
+
{ type: core.Directive, args: [{
|
|
2572
|
+
selector: '[mtxDatetimepickerToggleIcon]',
|
|
2573
|
+
},] }
|
|
2574
|
+
];
|
|
2147
2575
|
var MtxDatetimepickerToggle = /** @class */ (function () {
|
|
2148
2576
|
function MtxDatetimepickerToggle(_intl, _changeDetectorRef) {
|
|
2149
2577
|
this._intl = _intl;
|
|
@@ -2183,8 +2611,8 @@
|
|
|
2183
2611
|
var datetimepickerDisabled = this.datetimepicker
|
|
2184
2612
|
? this.datetimepicker._disabledChange
|
|
2185
2613
|
: rxjs.of();
|
|
2186
|
-
var inputDisabled = this.datetimepicker && this.datetimepicker.
|
|
2187
|
-
? this.datetimepicker.
|
|
2614
|
+
var inputDisabled = this.datetimepicker && this.datetimepicker.datetimepickerInput
|
|
2615
|
+
? this.datetimepicker.datetimepickerInput._disabledChange
|
|
2188
2616
|
: rxjs.of();
|
|
2189
2617
|
this._stateChanges.unsubscribe();
|
|
2190
2618
|
this._stateChanges = rxjs.merge([
|
|
@@ -2199,14 +2627,22 @@
|
|
|
2199
2627
|
MtxDatetimepickerToggle.decorators = [
|
|
2200
2628
|
{ type: core.Component, args: [{
|
|
2201
2629
|
selector: 'mtx-datetimepicker-toggle',
|
|
2202
|
-
template: "<button
|
|
2630
|
+
template: "<button #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datetimepicker ? 'dialog' : null\"\n [attr.aria-label]=\"_intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n (click)=\"_open($event)\">\n\n <ng-container *ngIf=\"!_customIcon\" [ngSwitch]=\"datetimepicker.type\">\n <svg *ngSwitchCase=\"'time'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z\">\n </path>\n </svg>\n <svg *ngSwitchCase=\"'datetime'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\">\n </path>\n </svg>\n <svg *ngSwitchDefault\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\" />\n </svg>\n </ng-container>\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n",
|
|
2203
2631
|
host: {
|
|
2204
|
-
class: 'mtx-datetimepicker-toggle',
|
|
2632
|
+
'class': 'mtx-datetimepicker-toggle',
|
|
2633
|
+
// Always set the tabindex to -1 so that it doesn't overlap with any custom tabindex the
|
|
2634
|
+
// consumer may have provided, while still being able to receive focus.
|
|
2635
|
+
'[attr.tabindex]': 'disabled ? null : -1',
|
|
2636
|
+
'[class.mtx-datetimepicker-toggle-active]': 'datetimepicker && datetimepicker.opened',
|
|
2637
|
+
'[class.mat-accent]': 'datetimepicker && datetimepicker.color === "accent"',
|
|
2638
|
+
'[class.mat-warn]': 'datetimepicker && datetimepicker.color === "warn"',
|
|
2639
|
+
'(focus)': '_button.focus()',
|
|
2205
2640
|
},
|
|
2206
2641
|
exportAs: 'mtxDatetimepickerToggle',
|
|
2207
2642
|
encapsulation: core.ViewEncapsulation.None,
|
|
2208
2643
|
preserveWhitespaces: false,
|
|
2209
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush
|
|
2644
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
2645
|
+
styles: [".mat-form-field-appearance-legacy .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mtx-datetimepicker-toggle-default-icon{margin:auto}\n"]
|
|
2210
2646
|
},] }
|
|
2211
2647
|
];
|
|
2212
2648
|
/**
|
|
@@ -2223,7 +2659,11 @@
|
|
|
2223
2659
|
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
2224
2660
|
MtxDatetimepickerToggle.propDecorators = {
|
|
2225
2661
|
datetimepicker: [{ type: core.Input, args: ['for',] }],
|
|
2226
|
-
|
|
2662
|
+
tabIndex: [{ type: core.Input }],
|
|
2663
|
+
disabled: [{ type: core.Input }],
|
|
2664
|
+
disableRipple: [{ type: core.Input }],
|
|
2665
|
+
_customIcon: [{ type: core.ContentChild, args: [MtxDatetimepickerToggleIcon,] }],
|
|
2666
|
+
_button: [{ type: core.ViewChild, args: ['button',] }]
|
|
2227
2667
|
};
|
|
2228
2668
|
|
|
2229
2669
|
var DAYS_PER_WEEK = 7;
|
|
@@ -2236,9 +2676,10 @@
|
|
|
2236
2676
|
this._adapter = _adapter;
|
|
2237
2677
|
this._dateFormats = _dateFormats;
|
|
2238
2678
|
this.type = 'date';
|
|
2239
|
-
this._userSelection = new core.EventEmitter();
|
|
2240
2679
|
/** Emits when a new date is selected. */
|
|
2241
2680
|
this.selectedChange = new core.EventEmitter();
|
|
2681
|
+
/** Emits when any date is selected. */
|
|
2682
|
+
this._userSelection = new core.EventEmitter();
|
|
2242
2683
|
if (!this._adapter) {
|
|
2243
2684
|
throw createMissingDateImplError('DatetimeAdapter');
|
|
2244
2685
|
}
|
|
@@ -2352,7 +2793,8 @@
|
|
|
2352
2793
|
{ type: core.Component, args: [{
|
|
2353
2794
|
selector: 'mtx-month-view',
|
|
2354
2795
|
template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\">\n <tr>\n <th *ngFor=\"let day of _weekdays\" [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\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",
|
|
2355
|
-
|
|
2796
|
+
exportAs: 'mtxMonthView',
|
|
2797
|
+
animations: [mtxDatetimepickerAnimations.slideCalendar],
|
|
2356
2798
|
encapsulation: core.ViewEncapsulation.None,
|
|
2357
2799
|
changeDetection: core.ChangeDetectionStrategy.OnPush
|
|
2358
2800
|
},] }
|
|
@@ -2371,9 +2813,9 @@
|
|
|
2371
2813
|
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
2372
2814
|
MtxMonthView.propDecorators = {
|
|
2373
2815
|
type: [{ type: core.Input }],
|
|
2374
|
-
_userSelection: [{ type: core.Output }],
|
|
2375
2816
|
dateFilter: [{ type: core.Input }],
|
|
2376
2817
|
selectedChange: [{ type: core.Output }],
|
|
2818
|
+
_userSelection: [{ type: core.Output }],
|
|
2377
2819
|
activeDate: [{ type: core.Input }],
|
|
2378
2820
|
selected: [{ type: core.Input }]
|
|
2379
2821
|
};
|
|
@@ -2386,10 +2828,11 @@
|
|
|
2386
2828
|
function MtxYearView(_adapter, _dateFormats) {
|
|
2387
2829
|
this._adapter = _adapter;
|
|
2388
2830
|
this._dateFormats = _dateFormats;
|
|
2389
|
-
this._userSelection = new core.EventEmitter();
|
|
2390
2831
|
this.type = 'date';
|
|
2391
2832
|
/** Emits when a new month is selected. */
|
|
2392
2833
|
this.selectedChange = new core.EventEmitter();
|
|
2834
|
+
/** Emits when any date is selected. */
|
|
2835
|
+
this._userSelection = new core.EventEmitter();
|
|
2393
2836
|
if (!this._adapter) {
|
|
2394
2837
|
throw createMissingDateImplError('DatetimeAdapter');
|
|
2395
2838
|
}
|
|
@@ -2496,7 +2939,8 @@
|
|
|
2496
2939
|
{ type: core.Component, args: [{
|
|
2497
2940
|
selector: 'mtx-year-view',
|
|
2498
2941
|
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",
|
|
2499
|
-
|
|
2942
|
+
exportAs: 'mtxYearView',
|
|
2943
|
+
animations: [mtxDatetimepickerAnimations.slideCalendar],
|
|
2500
2944
|
encapsulation: core.ViewEncapsulation.None,
|
|
2501
2945
|
changeDetection: core.ChangeDetectionStrategy.OnPush
|
|
2502
2946
|
},] }
|
|
@@ -2514,10 +2958,10 @@
|
|
|
2514
2958
|
]; };
|
|
2515
2959
|
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
2516
2960
|
MtxYearView.propDecorators = {
|
|
2517
|
-
_userSelection: [{ type: core.Output }],
|
|
2518
2961
|
type: [{ type: core.Input }],
|
|
2519
2962
|
dateFilter: [{ type: core.Input }],
|
|
2520
2963
|
selectedChange: [{ type: core.Output }],
|
|
2964
|
+
_userSelection: [{ type: core.Output }],
|
|
2521
2965
|
activeDate: [{ type: core.Input }],
|
|
2522
2966
|
selected: [{ type: core.Input }]
|
|
2523
2967
|
};
|
|
@@ -2530,14 +2974,14 @@
|
|
|
2530
2974
|
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
2531
2975
|
MtxDatetimepickerModule.decorators = [
|
|
2532
2976
|
{ type: core.NgModule, args: [{
|
|
2533
|
-
imports: [common.CommonModule, button.MatButtonModule,
|
|
2534
|
-
entryComponents: [MtxDatetimepickerContent],
|
|
2977
|
+
imports: [common.CommonModule, button.MatButtonModule, overlay.OverlayModule, a11y.A11yModule, portal.PortalModule],
|
|
2535
2978
|
declarations: [
|
|
2536
2979
|
MtxCalendar,
|
|
2537
2980
|
MtxCalendarBody,
|
|
2538
2981
|
MtxClock,
|
|
2539
2982
|
MtxDatetimepicker,
|
|
2540
2983
|
MtxDatetimepickerToggle,
|
|
2984
|
+
MtxDatetimepickerToggleIcon,
|
|
2541
2985
|
MtxDatetimepickerInput,
|
|
2542
2986
|
MtxDatetimepickerContent,
|
|
2543
2987
|
MtxMonthView,
|
|
@@ -2550,12 +2994,15 @@
|
|
|
2550
2994
|
MtxClock,
|
|
2551
2995
|
MtxDatetimepicker,
|
|
2552
2996
|
MtxDatetimepickerToggle,
|
|
2997
|
+
MtxDatetimepickerToggleIcon,
|
|
2553
2998
|
MtxDatetimepickerInput,
|
|
2554
2999
|
MtxDatetimepickerContent,
|
|
2555
3000
|
MtxMonthView,
|
|
2556
3001
|
MtxYearView,
|
|
2557
3002
|
MtxMultiYearView,
|
|
2558
3003
|
],
|
|
3004
|
+
providers: [MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER],
|
|
3005
|
+
entryComponents: [MtxDatetimepickerContent],
|
|
2559
3006
|
},] }
|
|
2560
3007
|
];
|
|
2561
3008
|
|
|
@@ -2569,6 +3016,9 @@
|
|
|
2569
3016
|
exports.CLOCK_TICK_RADIUS = CLOCK_TICK_RADIUS;
|
|
2570
3017
|
exports.MAT_DATETIMEPICKER_VALIDATORS = MAT_DATETIMEPICKER_VALIDATORS;
|
|
2571
3018
|
exports.MAT_DATETIMEPICKER_VALUE_ACCESSOR = MAT_DATETIMEPICKER_VALUE_ACCESSOR;
|
|
3019
|
+
exports.MTX_DATETIMEPICKER_SCROLL_STRATEGY = MTX_DATETIMEPICKER_SCROLL_STRATEGY;
|
|
3020
|
+
exports.MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY = MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY;
|
|
3021
|
+
exports.MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER;
|
|
2572
3022
|
exports.MtxCalendar = MtxCalendar;
|
|
2573
3023
|
exports.MtxCalendarBody = MtxCalendarBody;
|
|
2574
3024
|
exports.MtxCalendarCell = MtxCalendarCell;
|
|
@@ -2579,10 +3029,15 @@
|
|
|
2579
3029
|
exports.MtxDatetimepickerInputEvent = MtxDatetimepickerInputEvent;
|
|
2580
3030
|
exports.MtxDatetimepickerModule = MtxDatetimepickerModule;
|
|
2581
3031
|
exports.MtxDatetimepickerToggle = MtxDatetimepickerToggle;
|
|
3032
|
+
exports.MtxDatetimepickerToggleIcon = MtxDatetimepickerToggleIcon;
|
|
2582
3033
|
exports.MtxMonthView = MtxMonthView;
|
|
3034
|
+
exports.MtxMultiYearView = MtxMultiYearView;
|
|
2583
3035
|
exports.MtxYearView = MtxYearView;
|
|
2584
|
-
exports
|
|
2585
|
-
exports
|
|
3036
|
+
exports.getActiveOffset = getActiveOffset;
|
|
3037
|
+
exports.isSameMultiYearView = isSameMultiYearView;
|
|
3038
|
+
exports.mtxDatetimepickerAnimations = mtxDatetimepickerAnimations;
|
|
3039
|
+
exports.yearsPerPage = yearsPerPage;
|
|
3040
|
+
exports.yearsPerRow = yearsPerRow;
|
|
2586
3041
|
|
|
2587
3042
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2588
3043
|
|