@ng-matero/extensions 14.5.0 → 14.6.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/core/datetime/datetime-adapter.d.ts +1 -1
- package/datetimepicker/_datetimepicker-theme.scss +40 -12
- package/datetimepicker/calendar.d.ts +28 -17
- package/datetimepicker/calendar.scss +73 -91
- package/datetimepicker/clock.d.ts +27 -14
- package/datetimepicker/clock.scss +2 -1
- package/datetimepicker/datetimepicker-content.scss +21 -6
- package/datetimepicker/datetimepicker-intl.d.ts +51 -0
- package/datetimepicker/datetimepicker-module.d.ts +13 -12
- package/datetimepicker/datetimepicker-toggle.d.ts +6 -4
- package/datetimepicker/datetimepicker-types.d.ts +4 -0
- package/datetimepicker/datetimepicker.d.ts +13 -3
- package/datetimepicker/public-api.d.ts +1 -0
- package/datetimepicker/time.d.ts +130 -0
- package/datetimepicker/time.scss +81 -0
- package/esm2020/core/datetime/datetime-adapter.mjs +1 -1
- package/esm2020/datetimepicker/calendar-body.mjs +3 -3
- package/esm2020/datetimepicker/calendar.mjs +81 -33
- package/esm2020/datetimepicker/clock.mjs +96 -45
- package/esm2020/datetimepicker/datetimepicker-intl.mjs +63 -0
- package/esm2020/datetimepicker/datetimepicker-module.mjs +8 -1
- package/esm2020/datetimepicker/datetimepicker-toggle.mjs +9 -6
- package/esm2020/datetimepicker/datetimepicker-types.mjs +1 -1
- package/esm2020/datetimepicker/datetimepicker.mjs +22 -6
- package/esm2020/datetimepicker/public-api.mjs +2 -1
- package/esm2020/datetimepicker/time.mjs +453 -0
- package/esm2020/grid/grid.interface.mjs +1 -1
- package/fesm2015/mtxCore.mjs.map +1 -1
- package/fesm2015/mtxDatetimepicker.mjs +720 -91
- package/fesm2015/mtxDatetimepicker.mjs.map +1 -1
- package/fesm2020/mtxCore.mjs.map +1 -1
- package/fesm2020/mtxDatetimepicker.mjs +715 -91
- package/fesm2020/mtxDatetimepicker.mjs.map +1 -1
- package/grid/grid.interface.d.ts +0 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ export declare abstract class DatetimeAdapter<D> extends DateAdapter<D> {
|
|
|
9
9
|
abstract getHourNames(): string[];
|
|
10
10
|
abstract getMinuteNames(): string[];
|
|
11
11
|
abstract addCalendarHours(date: D, months: number): D;
|
|
12
|
-
abstract addCalendarMinutes(date: D,
|
|
12
|
+
abstract addCalendarMinutes(date: D, minutes: number): D;
|
|
13
13
|
abstract createDatetime(year: number, month: number, date: number, hour: number, minute: number): D;
|
|
14
14
|
getValidDateOrNull(obj: any): D | null;
|
|
15
15
|
compareDatetime(first: D, second: D, respectMinutePart?: boolean): number | boolean;
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
$selected-today-box-shadow-width: 1px;
|
|
9
9
|
$calendar-body-font-size: 13px !default;
|
|
10
10
|
$calendar-weekday-table-font-size: 11px !default;
|
|
11
|
-
$calendar-header-font-size: 28px !default;
|
|
12
11
|
$clock-font-size: 14px !default;
|
|
13
12
|
|
|
14
13
|
@mixin color($config-or-theme) {
|
|
15
14
|
$config: theming.get-color-config($config-or-theme);
|
|
16
15
|
$is-dark-theme: map.get($config, is-dark);
|
|
17
16
|
$primary: map.get($config, primary);
|
|
17
|
+
$accent: map.get($config, accent);
|
|
18
|
+
$warn: map.get($config, warn);
|
|
18
19
|
$background: map.get($config, background);
|
|
19
20
|
$foreground: map.get($config, foreground);
|
|
20
21
|
$disabled-color: theming.get-color-from-palette($foreground, disabled-text);
|
|
@@ -122,14 +123,49 @@ $clock-font-size: 14px !default;
|
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
.mtx-datetimepicker-toggle-active {
|
|
125
|
-
color: theming.get-color-from-palette(
|
|
126
|
+
color: theming.get-color-from-palette($primary);
|
|
126
127
|
|
|
127
128
|
&.mat-accent {
|
|
128
|
-
color: theming.get-color-from-palette(
|
|
129
|
+
color: theming.get-color-from-palette($accent);
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
&.mat-warn {
|
|
132
|
-
color: theming.get-color-from-palette(
|
|
133
|
+
color: theming.get-color-from-palette($warn);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.mtx-time-input {
|
|
138
|
+
color: theming.get-color-from-palette($foreground, text);
|
|
139
|
+
background-color: theming.get-color-from-palette($background, disabled-button);
|
|
140
|
+
|
|
141
|
+
&.mtx-time-input-active {
|
|
142
|
+
color: theming.get-color-from-palette($primary);
|
|
143
|
+
background-color: theming.get-color-from-palette($primary, .2);
|
|
144
|
+
|
|
145
|
+
&:focus {
|
|
146
|
+
border-color: theming.get-color-from-palette($primary);
|
|
147
|
+
background-color: theming.get-color-from-palette($background, background);
|
|
148
|
+
|
|
149
|
+
&::placeholder {
|
|
150
|
+
color: theming.get-color-from-palette($primary, .6);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&.mtx-time-input-warning {
|
|
156
|
+
border-color: theming.get-color-from-palette($warn);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.mtx-time-ampm {
|
|
161
|
+
.mtx-time-am,
|
|
162
|
+
.mtx-time-pm {
|
|
163
|
+
color: theming.get-color-from-palette($foreground, text);
|
|
164
|
+
border-color: theming.get-color-from-palette($foreground, hint-text);
|
|
165
|
+
|
|
166
|
+
&.mtx-time-ampm-active {
|
|
167
|
+
background-color: theming.get-color-from-palette($accent, .2);
|
|
168
|
+
}
|
|
133
169
|
}
|
|
134
170
|
}
|
|
135
171
|
}
|
|
@@ -162,14 +198,6 @@ $clock-font-size: 14px !default;
|
|
|
162
198
|
}
|
|
163
199
|
}
|
|
164
200
|
|
|
165
|
-
.mtx-calendar-header-date-time {
|
|
166
|
-
font-size: $calendar-header-font-size;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.mtx-calendar-header-ampm-container {
|
|
170
|
-
font-size: .65em;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
201
|
.mtx-clock {
|
|
174
202
|
font-size: $clock-font-size;
|
|
175
203
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnDestroy } from '@angular/core';
|
|
2
2
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
3
|
-
import { MatDatepickerIntl } from '@angular/material/datepicker';
|
|
4
3
|
import { DatetimeAdapter, MtxDatetimeFormats } from '@ng-matero/extensions/core';
|
|
5
4
|
import { MtxClockView } from './clock';
|
|
6
5
|
import { MtxDatetimepickerFilterType } from './datetimepicker-filtertype';
|
|
7
|
-
import { MtxDatetimepickerType } from './datetimepicker-types';
|
|
6
|
+
import { MtxAMPM, MtxCalendarView, MtxDatetimepickerType } from './datetimepicker-types';
|
|
7
|
+
import { MtxDatetimepickerIntl } from './datetimepicker-intl';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
|
-
/** Possible views for datetimepicker calendar. */
|
|
10
|
-
export declare type MtxCalendarView = 'clock' | 'month' | 'year' | 'multi-year';
|
|
11
9
|
/**
|
|
12
10
|
* A calendar that is used as part of the datetimepicker.
|
|
13
11
|
* @docs-private
|
|
@@ -39,12 +37,12 @@ export declare class MtxCalendar<D> implements AfterContentInit, OnDestroy {
|
|
|
39
37
|
/** Emits when the view has been changed. */
|
|
40
38
|
viewChanged: EventEmitter<MtxCalendarView>;
|
|
41
39
|
_userSelection: EventEmitter<void>;
|
|
42
|
-
_AMPM:
|
|
40
|
+
_AMPM: MtxAMPM;
|
|
43
41
|
_clockView: MtxClockView;
|
|
44
42
|
_calendarState: string;
|
|
45
43
|
private _intlChanges;
|
|
46
44
|
private _clampedActiveDate;
|
|
47
|
-
constructor(_elementRef: ElementRef, _intl:
|
|
45
|
+
constructor(_elementRef: ElementRef, _intl: MtxDatetimepickerIntl, _ngZone: NgZone, _adapter: DatetimeAdapter<D>, _dateFormats: MtxDatetimeFormats, _changeDetectorRef: ChangeDetectorRef);
|
|
48
46
|
/** The display type of datetimepicker. */
|
|
49
47
|
get type(): MtxDatetimepickerType;
|
|
50
48
|
set type(value: MtxDatetimepickerType);
|
|
@@ -53,6 +51,14 @@ export declare class MtxCalendar<D> implements AfterContentInit, OnDestroy {
|
|
|
53
51
|
get startAt(): D | null;
|
|
54
52
|
set startAt(value: D | null);
|
|
55
53
|
private _startAt;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the calendar is in time mode. In time mode the calendar clock gets time input elements rather then just clock
|
|
56
|
+
*
|
|
57
|
+
* When touchUi is enabled this will be disabled
|
|
58
|
+
*/
|
|
59
|
+
get timeInput(): boolean;
|
|
60
|
+
set timeInput(value: boolean);
|
|
61
|
+
private _timeInput;
|
|
56
62
|
/** The currently selected date. */
|
|
57
63
|
get selected(): D | null;
|
|
58
64
|
set selected(value: D | null);
|
|
@@ -74,15 +80,18 @@ export declare class MtxCalendar<D> implements AfterContentInit, OnDestroy {
|
|
|
74
80
|
/** Whether the calendar is in month view. */
|
|
75
81
|
get currentView(): MtxCalendarView;
|
|
76
82
|
set currentView(view: MtxCalendarView);
|
|
77
|
-
_currentView
|
|
78
|
-
|
|
79
|
-
get
|
|
80
|
-
get
|
|
81
|
-
get
|
|
82
|
-
get
|
|
83
|
-
get
|
|
84
|
-
get
|
|
85
|
-
get
|
|
83
|
+
private _currentView;
|
|
84
|
+
get _yearPeriodText(): string;
|
|
85
|
+
get _yearButtonText(): string;
|
|
86
|
+
get _yearButtonLabel(): string;
|
|
87
|
+
get _dateButtonText(): string;
|
|
88
|
+
get _dateButtonLabel(): string;
|
|
89
|
+
get _hoursButtonText(): string;
|
|
90
|
+
get _hourButtonLabel(): string;
|
|
91
|
+
get _minutesButtonText(): string;
|
|
92
|
+
get _minuteButtonLabel(): string;
|
|
93
|
+
get _prevButtonLabel(): string;
|
|
94
|
+
get _nextButtonLabel(): string;
|
|
86
95
|
/** Date filter for the month and year views. */
|
|
87
96
|
_dateFilterForViews: (date: D) => boolean;
|
|
88
97
|
_userSelected(): void;
|
|
@@ -95,10 +104,11 @@ export declare class MtxCalendar<D> implements AfterContentInit, OnDestroy {
|
|
|
95
104
|
/** Handles year selection in the multi year view. */
|
|
96
105
|
_yearSelected(year: D): void;
|
|
97
106
|
_timeSelected(date: D): void;
|
|
107
|
+
_dialTimeSelected(date: D): void;
|
|
98
108
|
_onActiveDateChange(date: D): void;
|
|
99
109
|
_updateDate(date: D): D;
|
|
100
110
|
_selectAMPM(date: D): void;
|
|
101
|
-
_ampmClicked(source:
|
|
111
|
+
_ampmClicked(source: MtxAMPM): void;
|
|
102
112
|
_yearClicked(): void;
|
|
103
113
|
_dateClicked(): void;
|
|
104
114
|
_hoursClicked(): void;
|
|
@@ -139,6 +149,7 @@ export declare class MtxCalendar<D> implements AfterContentInit, OnDestroy {
|
|
|
139
149
|
private _2digit;
|
|
140
150
|
static ngAcceptInputType_multiYearSelector: BooleanInput;
|
|
141
151
|
static ngAcceptInputType_twelvehour: BooleanInput;
|
|
152
|
+
static ngAcceptInputType_timeInput: BooleanInput;
|
|
142
153
|
static ɵfac: i0.ɵɵFactoryDeclaration<MtxCalendar<any>, [null, null, null, { optional: true; }, { optional: true; }, null]>;
|
|
143
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MtxCalendar<any>, "mtx-calendar", ["mtxCalendar"], { "multiYearSelector": "multiYearSelector"; "twelvehour": "twelvehour"; "startView": "startView"; "timeInterval": "timeInterval"; "dateFilter": "dateFilter"; "preventSameDateTimeSelection": "preventSameDateTimeSelection"; "type": "type"; "startAt": "startAt"; "selected": "selected"; "minDate": "minDate"; "maxDate": "maxDate"; }, { "selectedChange": "selectedChange"; "viewChanged": "viewChanged"; "_userSelection": "_userSelection"; }, never, never, false>;
|
|
154
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtxCalendar<any>, "mtx-calendar", ["mtxCalendar"], { "multiYearSelector": "multiYearSelector"; "twelvehour": "twelvehour"; "startView": "startView"; "timeInterval": "timeInterval"; "dateFilter": "dateFilter"; "preventSameDateTimeSelection": "preventSameDateTimeSelection"; "type": "type"; "startAt": "startAt"; "timeInput": "timeInput"; "selected": "selected"; "minDate": "minDate"; "maxDate": "maxDate"; }, { "selectedChange": "selectedChange"; "viewChanged": "viewChanged"; "_userSelection": "_userSelection"; }, never, never, false>;
|
|
144
155
|
}
|
|
@@ -12,56 +12,90 @@ $calendar-prev-next-icon-margin: 15.5px;
|
|
|
12
12
|
$calendar-prev-icon-transform: translateX(2px) rotate(-45deg);
|
|
13
13
|
$calendar-next-icon-transform: translateX(-2px) rotate(45deg);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
outline: none;
|
|
18
|
-
|
|
19
|
-
&[mode='landscape'] {
|
|
15
|
+
@mixin landscape-calendar-header {
|
|
16
|
+
.mtx-calendar {
|
|
20
17
|
display: flex;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
18
|
|
|
24
|
-
.mtx-calendar-header {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
.mtx-calendar-header {
|
|
20
|
+
width: 150px;
|
|
21
|
+
min-width: 150px;
|
|
22
|
+
padding: 16px 8px;
|
|
23
|
+
border-radius: 4px 0 0 4px;
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
[dir='rtl'] & {
|
|
26
|
+
border-radius: 0 4px 4px 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
33
29
|
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
.mtx-calendar-header-year + .mtx-calendar-header-date-time,
|
|
31
|
+
.mtx-calendar-header-date + .mtx-calendar-header-time {
|
|
32
|
+
margin-top: 4px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.mtx-calendar-header-date-time {
|
|
36
|
+
font-size: 28px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.mtx-calendar-header-time {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
|
|
43
|
+
.mtx-calendar-header-hours,
|
|
44
|
+
.mtx-calendar-header-minutes,
|
|
45
|
+
.mtx-calendar-header-ampm {
|
|
46
|
+
width: 40px;
|
|
47
|
+
text-align: center;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.mtx-calendar-header-ampm-container {
|
|
52
|
+
flex-direction: row;
|
|
53
|
+
font-size: 20px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.mtx-calendar-header-ampm {
|
|
57
|
+
padding: 4px;
|
|
58
|
+
|
|
59
|
+
+ .mtx-calendar-header-ampm {
|
|
60
|
+
margin: 0 8px;
|
|
61
|
+
}
|
|
36
62
|
}
|
|
37
63
|
}
|
|
38
64
|
}
|
|
39
65
|
|
|
40
|
-
.mtx-calendar
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
white-space: nowrap;
|
|
66
|
+
.mtx-calendar {
|
|
67
|
+
display: block;
|
|
68
|
+
outline: none;
|
|
44
69
|
}
|
|
45
70
|
|
|
46
|
-
.mtx-calendar-header
|
|
47
|
-
|
|
71
|
+
.mtx-calendar-header {
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
padding: 8px;
|
|
74
|
+
border-radius: 4px 4px 0 0;
|
|
48
75
|
|
|
49
|
-
|
|
50
|
-
|
|
76
|
+
.mtx-calendar-header-year,
|
|
77
|
+
.mtx-calendar-header-date,
|
|
78
|
+
.mtx-calendar-header-hours,
|
|
79
|
+
.mtx-calendar-header-minutes,
|
|
80
|
+
.mtx-calendar-header-ampm {
|
|
81
|
+
min-width: auto;
|
|
82
|
+
padding: 0 4px;
|
|
83
|
+
text-align: inherit;
|
|
84
|
+
line-height: inherit;
|
|
85
|
+
font-size: inherit;
|
|
86
|
+
font-weight: inherit;
|
|
87
|
+
white-space: normal;
|
|
88
|
+
word-break: break-word;
|
|
51
89
|
}
|
|
52
90
|
|
|
53
|
-
|
|
54
|
-
|
|
91
|
+
.mtx-calendar-header-year {
|
|
92
|
+
line-height: 24px;
|
|
55
93
|
}
|
|
56
94
|
}
|
|
57
95
|
|
|
58
96
|
.mtx-calendar-header-date-time {
|
|
97
|
+
font-size: 24px;
|
|
59
98
|
line-height: 36px;
|
|
60
|
-
|
|
61
|
-
[mode='landscape'] & {
|
|
62
|
-
white-space: normal;
|
|
63
|
-
word-wrap: break-word;
|
|
64
|
-
}
|
|
65
99
|
}
|
|
66
100
|
|
|
67
101
|
.mtx-calendar-header-year,
|
|
@@ -70,7 +104,6 @@ $calendar-next-icon-transform: translateX(-2px) rotate(45deg);
|
|
|
70
104
|
.mtx-calendar-header-minutes,
|
|
71
105
|
.mtx-calendar-header-ampm {
|
|
72
106
|
&:not(.active) {
|
|
73
|
-
cursor: pointer;
|
|
74
107
|
opacity: .6;
|
|
75
108
|
}
|
|
76
109
|
|
|
@@ -88,23 +121,9 @@ $calendar-next-icon-transform: translateX(-2px) rotate(45deg);
|
|
|
88
121
|
.mtx-calendar-header-hours,
|
|
89
122
|
.mtx-calendar-header-minutes,
|
|
90
123
|
.mtx-calendar-header-ampm {
|
|
91
|
-
cursor: pointer;
|
|
92
124
|
opacity: 1;
|
|
93
125
|
}
|
|
94
126
|
}
|
|
95
|
-
|
|
96
|
-
[mode='landscape'] & {
|
|
97
|
-
display: flex;
|
|
98
|
-
flex-direction: column;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.mtx-calendar-header-hour-minute-container {
|
|
103
|
-
padding: 0 8px;
|
|
104
|
-
|
|
105
|
-
[mode='landscape'] & {
|
|
106
|
-
padding: 0;
|
|
107
|
-
}
|
|
108
127
|
}
|
|
109
128
|
|
|
110
129
|
.mtx-calendar-header-hour-minute-separator {
|
|
@@ -117,15 +136,16 @@ $calendar-next-icon-transform: translateX(-2px) rotate(45deg);
|
|
|
117
136
|
display: inline-flex;
|
|
118
137
|
flex-direction: column;
|
|
119
138
|
line-height: 18px;
|
|
139
|
+
font-size: 12px;
|
|
140
|
+
}
|
|
120
141
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
142
|
+
[mode='landscape'] {
|
|
143
|
+
@include landscape-calendar-header;
|
|
124
144
|
}
|
|
125
145
|
|
|
126
|
-
|
|
127
|
-
[mode='
|
|
128
|
-
|
|
146
|
+
@media all and (orientation: landscape) {
|
|
147
|
+
[mode='auto'] {
|
|
148
|
+
@include landscape-calendar-header;
|
|
129
149
|
}
|
|
130
150
|
}
|
|
131
151
|
|
|
@@ -183,41 +203,3 @@ $calendar-next-icon-transform: translateX(-2px) rotate(45deg);
|
|
|
183
203
|
text-align: center;
|
|
184
204
|
padding: $calendar-padding 0;
|
|
185
205
|
}
|
|
186
|
-
|
|
187
|
-
@media all and (orientation: landscape) {
|
|
188
|
-
.mtx-calendar[mode='auto'] {
|
|
189
|
-
display: flex;
|
|
190
|
-
|
|
191
|
-
.mtx-calendar-header {
|
|
192
|
-
width: 150px;
|
|
193
|
-
min-width: 150px;
|
|
194
|
-
border-radius: 4px 0 0 4px;
|
|
195
|
-
|
|
196
|
-
[dir='rtl'] & {
|
|
197
|
-
border-radius: 0 4px 4px 0;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.mtx-calendar-header-date-time {
|
|
202
|
-
white-space: normal;
|
|
203
|
-
word-wrap: break-word;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.mtx-calendar-header-time {
|
|
207
|
-
display: flex;
|
|
208
|
-
flex-direction: column;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.mtx-calendar-header-hour-minute-container {
|
|
212
|
-
padding: 0;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.mtx-calendar-header-ampm-container {
|
|
216
|
-
flex-direction: row;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.mtx-calendar-header-ampm {
|
|
220
|
-
padding: 4px;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
-
import { AfterContentInit, ElementRef, EventEmitter } from '@angular/core';
|
|
2
|
+
import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy } from '@angular/core';
|
|
3
3
|
import { DatetimeAdapter } from '@ng-matero/extensions/core';
|
|
4
4
|
import { MtxDatetimepickerFilterType } from './datetimepicker-filtertype';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
@@ -13,9 +13,11 @@ export declare type MtxClockView = 'hour' | 'minute';
|
|
|
13
13
|
* A clock that is used as part of the datetimepicker.
|
|
14
14
|
* @docs-private
|
|
15
15
|
*/
|
|
16
|
-
export declare class MtxClock<D> implements AfterContentInit {
|
|
17
|
-
private
|
|
16
|
+
export declare class MtxClock<D> implements AfterContentInit, OnDestroy {
|
|
17
|
+
private _elementRef;
|
|
18
18
|
private _adapter;
|
|
19
|
+
private _changeDetectorRef;
|
|
20
|
+
private _document;
|
|
19
21
|
/** A function used to filter which dates are selectable. */
|
|
20
22
|
dateFilter: (date: D, type: MtxDatetimepickerFilterType) => boolean;
|
|
21
23
|
/** Step over minutes. */
|
|
@@ -28,17 +30,14 @@ export declare class MtxClock<D> implements AfterContentInit {
|
|
|
28
30
|
activeDateChange: EventEmitter<D>;
|
|
29
31
|
/** Emits when any date is selected. */
|
|
30
32
|
readonly _userSelection: EventEmitter<void>;
|
|
31
|
-
/** Hours and Minutes representing the clock view. */
|
|
32
|
-
_hours: any[];
|
|
33
|
-
_minutes: any[];
|
|
34
33
|
/** Whether the clock is in hour view. */
|
|
35
34
|
_hourView: boolean;
|
|
35
|
+
_hours: any[];
|
|
36
|
+
_minutes: any[];
|
|
36
37
|
_selectedHour: number;
|
|
37
38
|
_selectedMinute: number;
|
|
38
39
|
private _timeChanged;
|
|
39
|
-
|
|
40
|
-
private mouseUpListener;
|
|
41
|
-
constructor(_element: ElementRef, _adapter: DatetimeAdapter<D>);
|
|
40
|
+
constructor(_elementRef: ElementRef, _adapter: DatetimeAdapter<D>, _changeDetectorRef: ChangeDetectorRef, _document: any);
|
|
42
41
|
/**
|
|
43
42
|
* The date to display in this clock view.
|
|
44
43
|
*/
|
|
@@ -59,12 +58,26 @@ export declare class MtxClock<D> implements AfterContentInit {
|
|
|
59
58
|
private _maxDate;
|
|
60
59
|
/** Whether the clock should be started in hour or minute view. */
|
|
61
60
|
set startView(value: MtxClockView);
|
|
62
|
-
get _hand():
|
|
61
|
+
get _hand(): {
|
|
62
|
+
height: string;
|
|
63
|
+
marginTop: string;
|
|
64
|
+
transform: string;
|
|
65
|
+
};
|
|
63
66
|
ngAfterContentInit(): void;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
ngOnDestroy(): void;
|
|
68
|
+
/** Called when the user has put their pointer down on the clock. */
|
|
69
|
+
private _pointerDown;
|
|
70
|
+
/**
|
|
71
|
+
* Called when the user has moved their pointer after
|
|
72
|
+
* starting to drag. Bound on the document level.
|
|
73
|
+
*/
|
|
74
|
+
private _pointerMove;
|
|
75
|
+
/** Called when the user has lifted their pointer. Bound on the document level. */
|
|
76
|
+
private _pointerUp;
|
|
77
|
+
/** Binds our global move and end events. */
|
|
78
|
+
private _bindGlobalEvents;
|
|
79
|
+
/** Removes any global event listeners that we may have added. */
|
|
80
|
+
private _removeGlobalEvents;
|
|
68
81
|
/** Initializes this clock view. */
|
|
69
82
|
private _init;
|
|
70
83
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
$clock-min-size: 224px !default;
|
|
2
|
-
$clock-margin:
|
|
2
|
+
$clock-margin: 12px !default;
|
|
3
3
|
$clock-cell-size: 14.1666% !default;
|
|
4
4
|
|
|
5
5
|
.mtx-clock {
|
|
@@ -9,6 +9,7 @@ $clock-cell-size: 14.1666% !default;
|
|
|
9
9
|
margin: $clock-margin;
|
|
10
10
|
box-sizing: border-box;
|
|
11
11
|
user-select: none;
|
|
12
|
+
touch-action: none;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
.mtx-clock-wrapper {
|
|
@@ -4,6 +4,8 @@ $non-touch-calendar-portrait-width: $non-touch-calendar-cell-size * 7 + $calenda
|
|
|
4
4
|
$non-touch-calendar-portrait-height: 424px;
|
|
5
5
|
$non-touch-calendar-landscape-width: 446px;
|
|
6
6
|
$non-touch-calendar-landscape-height: 328px;
|
|
7
|
+
$non-touch-calendar-with-time-input-portrait-height: 490px;
|
|
8
|
+
$non-touch-calendar-with-time-input-landscape-height: 412px;
|
|
7
9
|
|
|
8
10
|
// Ideally the calendar would have a constant aspect ratio, no matter its size, and we would base
|
|
9
11
|
// these measurements off the aspect ratio. Unfortunately, the aspect ratio does change a little as
|
|
@@ -24,6 +26,17 @@ $touch-min-height: 300px;
|
|
|
24
26
|
$touch-max-width: 750px;
|
|
25
27
|
$touch-max-height: 850px;
|
|
26
28
|
|
|
29
|
+
@mixin landscape-calendar-size {
|
|
30
|
+
.mtx-calendar {
|
|
31
|
+
width: $non-touch-calendar-landscape-width;
|
|
32
|
+
height: $non-touch-calendar-landscape-height;
|
|
33
|
+
|
|
34
|
+
&.mtx-calendar-with-time-input {
|
|
35
|
+
height: $non-touch-calendar-with-time-input-landscape-height;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
27
40
|
.mtx-datetimepicker-content {
|
|
28
41
|
display: block;
|
|
29
42
|
border-radius: 4px;
|
|
@@ -41,16 +54,18 @@ $touch-max-height: 850px;
|
|
|
41
54
|
width: $non-touch-calendar-portrait-width;
|
|
42
55
|
height: $non-touch-calendar-portrait-height;
|
|
43
56
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
height: $non-touch-calendar-landscape-height;
|
|
57
|
+
&.mtx-calendar-with-time-input {
|
|
58
|
+
height: $non-touch-calendar-with-time-input-portrait-height;
|
|
47
59
|
}
|
|
48
60
|
}
|
|
49
61
|
|
|
62
|
+
.mtx-datetimepicker-content[mode='landscape'] {
|
|
63
|
+
@include landscape-calendar-size;
|
|
64
|
+
}
|
|
65
|
+
|
|
50
66
|
@media all and (orientation: landscape) {
|
|
51
|
-
.mtx-datetimepicker-content
|
|
52
|
-
|
|
53
|
-
height: $non-touch-calendar-landscape-height;
|
|
67
|
+
.mtx-datetimepicker-content[mode='auto'] {
|
|
68
|
+
@include landscape-calendar-size;
|
|
54
69
|
}
|
|
55
70
|
}
|
|
56
71
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Subject } from 'rxjs';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class MtxDatetimepickerIntl {
|
|
4
|
+
/**
|
|
5
|
+
* Stream to emit from when labels are changed. Use this to notify components when the labels have
|
|
6
|
+
* changed after initialization.
|
|
7
|
+
*/
|
|
8
|
+
readonly changes: Subject<void>;
|
|
9
|
+
/** A label for the calendar popup (used by screen readers). */
|
|
10
|
+
calendarLabel: string;
|
|
11
|
+
/** A label for the button used to open the calendar popup (used by screen readers). */
|
|
12
|
+
openCalendarLabel: string;
|
|
13
|
+
/** Label for the button used to close the calendar popup. */
|
|
14
|
+
closeCalendarLabel: string;
|
|
15
|
+
/** A label for the previous month button (used by screen readers). */
|
|
16
|
+
prevMonthLabel: string;
|
|
17
|
+
/** A label for the next month button (used by screen readers). */
|
|
18
|
+
nextMonthLabel: string;
|
|
19
|
+
/** A label for the previous year button (used by screen readers). */
|
|
20
|
+
prevYearLabel: string;
|
|
21
|
+
/** A label for the next year button (used by screen readers). */
|
|
22
|
+
nextYearLabel: string;
|
|
23
|
+
/** A label for the previous multi-year button (used by screen readers). */
|
|
24
|
+
prevMultiYearLabel: string;
|
|
25
|
+
/** A label for the next multi-year button (used by screen readers). */
|
|
26
|
+
nextMultiYearLabel: string;
|
|
27
|
+
/** A label for the 'switch to month view' button (used by screen readers). */
|
|
28
|
+
switchToMonthViewLabel: string;
|
|
29
|
+
/** A label for the 'switch to year view' button (used by screen readers). */
|
|
30
|
+
switchToYearViewLabel: string;
|
|
31
|
+
/** A label for the 'switch to multi-year view' button (used by screen readers). */
|
|
32
|
+
switchToMultiYearViewLabel: string;
|
|
33
|
+
/** A label for the first date of a range of dates (used by screen readers). */
|
|
34
|
+
startDateLabel: string;
|
|
35
|
+
/** A label for the last date of a range of dates (used by screen readers). */
|
|
36
|
+
endDateLabel: string;
|
|
37
|
+
/** Formats a range of years (used for visuals). */
|
|
38
|
+
formatYearRange(start: string, end: string): string;
|
|
39
|
+
/** Formats a label for a range of years (used by screen readers). */
|
|
40
|
+
formatYearRangeLabel(start: string, end: string): string;
|
|
41
|
+
/** A label for the 'switch to clock hour view' button (used by screen readers). */
|
|
42
|
+
switchToClockHourViewLabel: string;
|
|
43
|
+
/** A label for the 'switch to clock minute view' button (used by screen readers). */
|
|
44
|
+
switchToClockMinuteViewLabel: string;
|
|
45
|
+
/** Label used for ok button within the manual time input. */
|
|
46
|
+
okLabel: string;
|
|
47
|
+
/** Label used for cancel button within the manual time input. */
|
|
48
|
+
cancelLabel: string;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtxDatetimepickerIntl, never>;
|
|
50
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MtxDatetimepickerIntl>;
|
|
51
|
+
}
|
|
@@ -2,19 +2,20 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
import * as i1 from "./calendar";
|
|
3
3
|
import * as i2 from "./calendar-body";
|
|
4
4
|
import * as i3 from "./clock";
|
|
5
|
-
import * as i4 from "./
|
|
6
|
-
import * as i5 from "./datetimepicker
|
|
7
|
-
import * as i6 from "./datetimepicker-
|
|
8
|
-
import * as i7 from "./
|
|
9
|
-
import * as i8 from "./
|
|
10
|
-
import * as i9 from "./
|
|
11
|
-
import * as i10 from "
|
|
12
|
-
import * as i11 from "@angular/
|
|
13
|
-
import * as i12 from "@angular/
|
|
14
|
-
import * as i13 from "@angular/cdk/
|
|
15
|
-
import * as i14 from "@angular/cdk/
|
|
5
|
+
import * as i4 from "./time";
|
|
6
|
+
import * as i5 from "./datetimepicker";
|
|
7
|
+
import * as i6 from "./datetimepicker-toggle";
|
|
8
|
+
import * as i7 from "./datetimepicker-input";
|
|
9
|
+
import * as i8 from "./month-view";
|
|
10
|
+
import * as i9 from "./year-view";
|
|
11
|
+
import * as i10 from "./multi-year-view";
|
|
12
|
+
import * as i11 from "@angular/common";
|
|
13
|
+
import * as i12 from "@angular/material/button";
|
|
14
|
+
import * as i13 from "@angular/cdk/overlay";
|
|
15
|
+
import * as i14 from "@angular/cdk/a11y";
|
|
16
|
+
import * as i15 from "@angular/cdk/portal";
|
|
16
17
|
export declare class MtxDatetimepickerModule {
|
|
17
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<MtxDatetimepickerModule, never>;
|
|
18
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MtxDatetimepickerModule, [typeof i1.MtxCalendar, typeof i2.MtxCalendarBody, typeof i3.MtxClock, typeof i4.
|
|
19
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MtxDatetimepickerModule, [typeof i1.MtxCalendar, typeof i2.MtxCalendarBody, typeof i3.MtxClock, typeof i4.MtxTime, typeof i4.MtxTimeInput, typeof i5.MtxDatetimepicker, typeof i6.MtxDatetimepickerToggle, typeof i6.MtxDatetimepickerToggleIcon, typeof i7.MtxDatetimepickerInput, typeof i5.MtxDatetimepickerContent, typeof i8.MtxMonthView, typeof i9.MtxYearView, typeof i10.MtxMultiYearView], [typeof i11.CommonModule, typeof i12.MatButtonModule, typeof i13.OverlayModule, typeof i14.A11yModule, typeof i15.PortalModule], [typeof i1.MtxCalendar, typeof i2.MtxCalendarBody, typeof i3.MtxClock, typeof i4.MtxTime, typeof i5.MtxDatetimepicker, typeof i6.MtxDatetimepickerToggle, typeof i6.MtxDatetimepickerToggleIcon, typeof i7.MtxDatetimepickerInput, typeof i5.MtxDatetimepickerContent, typeof i8.MtxMonthView, typeof i9.MtxYearView, typeof i10.MtxMultiYearView]>;
|
|
19
20
|
static ɵinj: i0.ɵɵInjectorDeclaration<MtxDatetimepickerModule>;
|
|
20
21
|
}
|