@ng-matero/extensions 16.3.2 → 17.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/_index.scss +26 -13
  2. package/alert/_alert-theme.scss +54 -24
  3. package/alert/alert-module.d.ts +3 -3
  4. package/alert/alert.d.ts +4 -7
  5. package/alert/alert.scss +3 -3
  6. package/button/_button-theme.scss +6 -4
  7. package/button/button-loading.d.ts +5 -10
  8. package/button/button-module.d.ts +5 -5
  9. package/checkbox-group/checkbox-group-module.d.ts +6 -6
  10. package/checkbox-group/checkbox-group.d.ts +5 -10
  11. package/colorpicker/_colorpicker-theme.scss +62 -34
  12. package/colorpicker/colorpicker-input.d.ts +2 -4
  13. package/colorpicker/colorpicker-module.d.ts +10 -10
  14. package/colorpicker/colorpicker-toggle.d.ts +4 -5
  15. package/colorpicker/colorpicker.d.ts +8 -9
  16. package/column-resize/column-resize-directives/column-resize-flex.d.ts +1 -1
  17. package/column-resize/column-resize-directives/column-resize.d.ts +1 -1
  18. package/column-resize/column-resize-module.d.ts +1 -1
  19. package/core/color/_all-color.scss +7 -18
  20. package/core/datetime/datetime.module.d.ts +4 -1
  21. package/core/density/_all-density.scss +17 -25
  22. package/core/pipes/is-template-ref.pipe.d.ts +1 -1
  23. package/core/pipes/pipes.module.d.ts +4 -4
  24. package/core/pipes/to-observable.pipe.d.ts +1 -1
  25. package/core/style/_sass-utils.scss +13 -1
  26. package/core/theming/_all-theme.scss +32 -17
  27. package/core/tokens/_token-utils.scss +4 -5
  28. package/core/tokens/m2/mdc/_plain-tooltip.scss +21 -29
  29. package/core/tokens/m2/mtx/_alert.scss +14 -15
  30. package/core/tokens/m2/mtx/_colorpicker.scss +8 -11
  31. package/core/tokens/m2/mtx/_datetimepicker.scss +38 -47
  32. package/core/tokens/m2/mtx/_drawer.scss +9 -10
  33. package/core/tokens/m2/mtx/_grid.scss +23 -22
  34. package/core/tokens/m2/mtx/_loader.scss +6 -6
  35. package/core/tokens/m2/mtx/_popover.scss +10 -11
  36. package/core/tokens/m2/mtx/_progress.scss +18 -17
  37. package/core/tokens/m2/mtx/_select.scss +23 -24
  38. package/core/tokens/m2/mtx/_split.scss +8 -11
  39. package/core/typography/_all-typography.scss +40 -0
  40. package/core/typography/_typography.scss +1 -579
  41. package/datetimepicker/_datetimepicker-theme.scss +75 -48
  42. package/datetimepicker/calendar-body.d.ts +1 -1
  43. package/datetimepicker/calendar.d.ts +8 -15
  44. package/datetimepicker/calendar.scss +16 -4
  45. package/datetimepicker/clock.d.ts +2 -3
  46. package/datetimepicker/datetimepicker-content.scss +3 -3
  47. package/datetimepicker/datetimepicker-input.d.ts +2 -3
  48. package/datetimepicker/datetimepicker-module.d.ts +16 -16
  49. package/datetimepicker/datetimepicker-toggle.d.ts +4 -5
  50. package/datetimepicker/datetimepicker.d.ts +16 -27
  51. package/datetimepicker/month-view.d.ts +2 -2
  52. package/datetimepicker/multi-year-view.d.ts +2 -2
  53. package/datetimepicker/time.d.ts +6 -8
  54. package/datetimepicker/time.scss +2 -2
  55. package/datetimepicker/year-view.d.ts +2 -2
  56. package/dialog/dialog-container.d.ts +1 -1
  57. package/dialog/dialog-module.d.ts +7 -7
  58. package/drawer/_drawer-theme.scss +55 -22
  59. package/drawer/drawer-container.d.ts +1 -1
  60. package/drawer/drawer-container.scss +25 -4
  61. package/drawer/drawer-module.d.ts +5 -5
  62. package/esm2022/alert/alert-module.mjs +6 -7
  63. package/esm2022/alert/alert.mjs +11 -18
  64. package/esm2022/button/button-loading.mjs +13 -23
  65. package/esm2022/button/button-module.mjs +6 -7
  66. package/esm2022/checkbox-group/checkbox-group-module.mjs +6 -7
  67. package/esm2022/checkbox-group/checkbox-group.mjs +19 -31
  68. package/esm2022/colorpicker/colorpicker-input.mjs +14 -14
  69. package/esm2022/colorpicker/colorpicker-module.mjs +20 -19
  70. package/esm2022/colorpicker/colorpicker-toggle.mjs +19 -18
  71. package/esm2022/colorpicker/colorpicker.mjs +46 -44
  72. package/esm2022/column-resize/column-resize-directives/column-resize-flex.mjs +6 -5
  73. package/esm2022/column-resize/column-resize-directives/column-resize.mjs +6 -5
  74. package/esm2022/column-resize/column-resize-module.mjs +6 -6
  75. package/esm2022/column-resize/column-resize-notifier.mjs +7 -7
  76. package/esm2022/column-resize/column-resize.mjs +4 -4
  77. package/esm2022/column-resize/column-size-store.mjs +3 -3
  78. package/esm2022/column-resize/event-dispatcher.mjs +5 -5
  79. package/esm2022/column-resize/overlay-handle.mjs +4 -4
  80. package/esm2022/column-resize/polyfill.mjs +1 -1
  81. package/esm2022/column-resize/resizable.mjs +4 -4
  82. package/esm2022/column-resize/resize-strategy.mjs +14 -14
  83. package/esm2022/core/datetime/datetime-adapter.mjs +1 -1
  84. package/esm2022/core/datetime/datetime.module.mjs +19 -23
  85. package/esm2022/core/datetime/native-datetime-adapter.mjs +6 -6
  86. package/esm2022/core/pipes/is-template-ref.pipe.mjs +5 -5
  87. package/esm2022/core/pipes/pipes.module.mjs +6 -7
  88. package/esm2022/core/pipes/to-observable.pipe.mjs +5 -5
  89. package/esm2022/datetimepicker/calendar-body.mjs +5 -6
  90. package/esm2022/datetimepicker/calendar.mjs +38 -48
  91. package/esm2022/datetimepicker/clock.mjs +11 -11
  92. package/esm2022/datetimepicker/datetimepicker-errors.mjs +4 -3
  93. package/esm2022/datetimepicker/datetimepicker-input.mjs +14 -14
  94. package/esm2022/datetimepicker/datetimepicker-intl.mjs +3 -3
  95. package/esm2022/datetimepicker/datetimepicker-module.mjs +28 -11
  96. package/esm2022/datetimepicker/datetimepicker-toggle.mjs +19 -18
  97. package/esm2022/datetimepicker/datetimepicker.mjs +70 -89
  98. package/esm2022/datetimepicker/month-view.mjs +8 -10
  99. package/esm2022/datetimepicker/multi-year-view.mjs +10 -11
  100. package/esm2022/datetimepicker/time.mjs +19 -24
  101. package/esm2022/datetimepicker/year-view.mjs +10 -11
  102. package/esm2022/dialog/dialog-container.mjs +21 -12
  103. package/esm2022/dialog/dialog-module.mjs +23 -7
  104. package/esm2022/dialog/dialog.mjs +7 -6
  105. package/esm2022/drawer/drawer-container.mjs +7 -8
  106. package/esm2022/drawer/drawer-module.mjs +6 -7
  107. package/esm2022/drawer/drawer-ref.mjs +1 -1
  108. package/esm2022/drawer/drawer.mjs +8 -7
  109. package/esm2022/grid/cell.mjs +36 -14
  110. package/esm2022/grid/column-menu.mjs +31 -15
  111. package/esm2022/grid/column-resize/column-resize-directives/column-resize-flex.mjs +6 -5
  112. package/esm2022/grid/column-resize/column-resize-directives/column-resize.mjs +6 -5
  113. package/esm2022/grid/column-resize/column-resize-module.mjs +14 -14
  114. package/esm2022/grid/column-resize/index.mjs +8 -0
  115. package/esm2022/grid/column-resize/overlay-handle.mjs +7 -6
  116. package/esm2022/grid/column-resize/resizable-directives/resizable.mjs +7 -6
  117. package/esm2022/grid/column-resize/resize-strategy.mjs +5 -5
  118. package/esm2022/grid/expansion-toggle.mjs +6 -5
  119. package/esm2022/grid/grid-module.mjs +39 -37
  120. package/esm2022/grid/grid-pipes.mjs +30 -30
  121. package/esm2022/grid/grid-utils.mjs +7 -6
  122. package/esm2022/grid/grid.mjs +175 -111
  123. package/esm2022/loader/loader-module.mjs +6 -7
  124. package/esm2022/loader/loader.mjs +17 -29
  125. package/esm2022/photoviewer/photoviewer-module.mjs +6 -7
  126. package/esm2022/photoviewer/photoviewer.mjs +8 -7
  127. package/esm2022/popover/popover-content.mjs +10 -9
  128. package/esm2022/popover/popover-module.mjs +22 -7
  129. package/esm2022/popover/popover-target.mjs +6 -5
  130. package/esm2022/popover/popover-trigger.mjs +15 -8
  131. package/esm2022/popover/popover.mjs +54 -139
  132. package/esm2022/progress/progress-module.mjs +6 -7
  133. package/esm2022/progress/progress.mjs +15 -26
  134. package/esm2022/select/option.mjs +12 -17
  135. package/esm2022/select/select-module.mjs +20 -9
  136. package/esm2022/select/select.mjs +19 -19
  137. package/esm2022/select/templates.mjs +56 -56
  138. package/esm2022/split/split-module.mjs +6 -7
  139. package/esm2022/split/split-pane.mjs +6 -5
  140. package/esm2022/split/split.mjs +8 -8
  141. package/esm2022/split/utils.mjs +1 -1
  142. package/esm2022/tooltip/tooltip-module.mjs +24 -7
  143. package/esm2022/tooltip/tooltip.mjs +104 -117
  144. package/fesm2022/mtxAlert.mjs +15 -23
  145. package/fesm2022/mtxAlert.mjs.map +1 -1
  146. package/fesm2022/mtxButton.mjs +17 -28
  147. package/fesm2022/mtxButton.mjs.map +1 -1
  148. package/fesm2022/mtxCheckboxGroup.mjs +22 -37
  149. package/fesm2022/mtxCheckboxGroup.mjs.map +1 -1
  150. package/fesm2022/mtxColorpicker.mjs +479 -474
  151. package/fesm2022/mtxColorpicker.mjs.map +1 -1
  152. package/fesm2022/mtxColumnResize.mjs +51 -49
  153. package/fesm2022/mtxColumnResize.mjs.map +1 -1
  154. package/fesm2022/mtxCore.mjs +36 -41
  155. package/fesm2022/mtxCore.mjs.map +1 -1
  156. package/fesm2022/mtxDatetimepicker.mjs +898 -905
  157. package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
  158. package/fesm2022/mtxDialog.mjs +47 -25
  159. package/fesm2022/mtxDialog.mjs.map +1 -1
  160. package/fesm2022/mtxDrawer.mjs +20 -21
  161. package/fesm2022/mtxDrawer.mjs.map +1 -1
  162. package/fesm2022/mtxGrid.mjs +330 -229
  163. package/fesm2022/mtxGrid.mjs.map +1 -1
  164. package/fesm2022/mtxLoader.mjs +21 -36
  165. package/fesm2022/mtxLoader.mjs.map +1 -1
  166. package/fesm2022/mtxPhotoviewer.mjs +12 -12
  167. package/fesm2022/mtxPhotoviewer.mjs.map +1 -1
  168. package/fesm2022/mtxPopover.mjs +103 -165
  169. package/fesm2022/mtxPopover.mjs.map +1 -1
  170. package/fesm2022/mtxProgress.mjs +19 -32
  171. package/fesm2022/mtxProgress.mjs.map +1 -1
  172. package/fesm2022/mtxSelect.mjs +99 -93
  173. package/fesm2022/mtxSelect.mjs.map +1 -1
  174. package/fesm2022/mtxSplit.mjs +17 -18
  175. package/fesm2022/mtxSplit.mjs.map +1 -1
  176. package/fesm2022/mtxTooltip.mjs +128 -125
  177. package/fesm2022/mtxTooltip.mjs.map +1 -1
  178. package/grid/_grid-theme.scss +58 -29
  179. package/grid/cell.d.ts +1 -1
  180. package/grid/column-menu.d.ts +1 -1
  181. package/grid/column-resize/column-resize-directives/column-resize-flex.d.ts +1 -1
  182. package/grid/column-resize/column-resize-directives/column-resize.d.ts +1 -1
  183. package/grid/column-resize/column-resize-module.d.ts +7 -6
  184. package/grid/column-resize/index.d.ts +7 -0
  185. package/grid/column-resize/overlay-handle.d.ts +1 -1
  186. package/grid/column-resize/resizable-directives/resizable.d.ts +1 -1
  187. package/grid/expansion-toggle.d.ts +1 -1
  188. package/grid/grid-module.d.ts +25 -25
  189. package/grid/grid-pipes.d.ts +7 -7
  190. package/grid/grid.d.ts +57 -25
  191. package/grid/grid.scss +8 -1
  192. package/loader/_loader-theme.scss +55 -22
  193. package/loader/loader-module.d.ts +5 -5
  194. package/loader/loader.d.ts +5 -10
  195. package/loader/loader.scss +1 -1
  196. package/package.json +13 -19
  197. package/photoviewer/photoviewer-module.d.ts +1 -1
  198. package/photoviewer/photoviewer.d.ts +2 -1
  199. package/popover/_popover-theme.scss +55 -22
  200. package/popover/popover-content.d.ts +1 -1
  201. package/popover/popover-module.d.ts +8 -8
  202. package/popover/popover-target.d.ts +1 -1
  203. package/popover/popover-trigger.d.ts +1 -1
  204. package/popover/popover.d.ts +24 -55
  205. package/popover/popover.scss +1 -1
  206. package/prebuilt-themes/deeppurple-amber.css +1 -1
  207. package/prebuilt-themes/indigo-pink.css +1 -1
  208. package/prebuilt-themes/pink-bluegrey.css +1 -1
  209. package/prebuilt-themes/purple-green.css +1 -1
  210. package/progress/_progress-theme.scss +60 -22
  211. package/progress/progress-module.d.ts +3 -3
  212. package/progress/progress.d.ts +5 -10
  213. package/progress/progress.scss +3 -3
  214. package/select/_select-theme.scss +66 -34
  215. package/select/option.d.ts +3 -6
  216. package/select/select-module.d.ts +7 -7
  217. package/select/select.d.ts +2 -4
  218. package/select/select.scss +109 -109
  219. package/select/templates.d.ts +11 -11
  220. package/split/_split-theme.scss +62 -32
  221. package/split/split-module.d.ts +4 -4
  222. package/split/split-pane.d.ts +1 -1
  223. package/split/split.d.ts +1 -1
  224. package/split/split.scss +2 -4
  225. package/tooltip/_tooltip-theme.scss +66 -34
  226. package/tooltip/tooltip-module.d.ts +7 -7
  227. package/tooltip/tooltip.d.ts +30 -44
  228. package/tooltip/tooltip.scss +2 -4
  229. package/_theming.scss +0 -16
  230. package/alert/_alert-theme.import.scss +0 -2
  231. package/button/_button-theme.import.scss +0 -2
  232. package/colorpicker/_colorpicker-theme.import.scss +0 -2
  233. package/core/density/_compatibility.scss +0 -74
  234. package/core/mdc-helpers/_mdc-helpers.scss +0 -242
  235. package/core/style/_elevation.scss +0 -91
  236. package/core/style/_private.scss +0 -32
  237. package/core/style/_variables.scss +0 -44
  238. package/core/style/_vendor-prefixes.scss +0 -46
  239. package/core/theming/_palette.scss +0 -746
  240. package/core/theming/_theming.scss +0 -497
  241. package/core/typography/_typography-utils.scss +0 -101
  242. package/datetimepicker/_datetimepicker-theme.import.scss +0 -4
  243. package/drawer/_drawer-theme.import.scss +0 -2
  244. package/grid/_grid-theme.import.scss +0 -2
  245. package/loader/_loader-theme.import.scss +0 -2
  246. package/popover/_popover-theme.import.scss +0 -2
  247. package/progress/_progress-theme.import.scss +0 -2
  248. package/select/_select-density.scss +0 -68
  249. package/select/_select-theme.import.scss +0 -3
  250. package/split/_split-theme.import.scss +0 -2
  251. package/tooltip/_tooltip-theme.import.scss +0 -1
@@ -1,77 +1,24 @@
1
- import * as i2$1 from '@angular/cdk/a11y';
2
1
  import { A11yModule } from '@angular/cdk/a11y';
3
- import * as i4$1 from '@angular/cdk/overlay';
2
+ import * as i1$1 from '@angular/cdk/overlay';
4
3
  import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
5
4
  import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
6
- import * as i2 from '@angular/common';
7
- import { DOCUMENT, CommonModule } from '@angular/common';
5
+ import { DOCUMENT, NgStyle, NgClass, CommonModule } from '@angular/common';
8
6
  import * as i0 from '@angular/core';
9
- import { EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, Optional, Inject, Injectable, Directive, ElementRef, ViewChild, InjectionToken, inject, forwardRef, Attribute, ContentChild, NgModule } from '@angular/core';
10
- import * as i4 from '@angular/material/button';
11
- import { MatButtonModule } from '@angular/material/button';
7
+ import { EventEmitter, booleanAttribute, Component, ViewEncapsulation, ChangeDetectionStrategy, Inject, Input, Output, Optional, Injectable, Directive, ElementRef, ViewChild, inject, InjectionToken, forwardRef, Attribute, ContentChild, NgModule } from '@angular/core';
8
+ import { MatButton, MatIconButton, MatButtonModule } from '@angular/material/button';
12
9
  import { UP_ARROW, DOWN_ARROW, ENTER, PAGE_DOWN, PAGE_UP, END, HOME, RIGHT_ARROW, LEFT_ARROW, ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
13
- import { coerceNumberProperty, coerceBooleanProperty, coerceStringArray } from '@angular/cdk/coercion';
14
- import { first, take, filter } from 'rxjs/operators';
15
10
  import * as i1 from '@ng-matero/extensions/core';
16
11
  import { MTX_DATETIME_FORMATS } from '@ng-matero/extensions/core';
17
- import { trigger, transition, animate, keyframes, style, state } from '@angular/animations';
18
- import { Subject, Subscription, merge, of } from 'rxjs';
12
+ import { first, take, filter } from 'rxjs/operators';
19
13
  import { normalizePassiveListenerOptions, _getFocusedElementPierceShadowDom } from '@angular/cdk/platform';
14
+ import { style, keyframes, animate, transition, trigger, state } from '@angular/animations';
15
+ import { coerceNumberProperty, coerceStringArray } from '@angular/cdk/coercion';
16
+ import { Subject, Subscription, merge, of } from 'rxjs';
20
17
  import { mixinColor } from '@angular/material/core';
21
- import * as i6 from '@angular/cdk/bidi';
18
+ import * as i3 from '@angular/cdk/bidi';
22
19
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators } from '@angular/forms';
23
20
  import { MAT_INPUT_VALUE_ACCESSOR } from '@angular/material/input';
24
- import * as i2$2 from '@angular/material/form-field';
25
-
26
- /**
27
- * Animations used by the Material datepicker.
28
- * @docs-private
29
- */
30
- const mtxDatetimepickerAnimations = {
31
- /** Transforms the height of the datepicker's calendar. */
32
- transformPanel: trigger('transformPanel', [
33
- transition('void => enter-dropdown', animate('120ms cubic-bezier(0, 0, 0.2, 1)', keyframes([
34
- style({ opacity: 0, transform: 'scale(1, 0.8)' }),
35
- style({ opacity: 1, transform: 'scale(1, 1)' }),
36
- ]))),
37
- transition('void => enter-dialog', animate('150ms cubic-bezier(0, 0, 0.2, 1)', keyframes([
38
- style({ opacity: 0, transform: 'scale(0.7)' }),
39
- style({ transform: 'none', opacity: 1 }),
40
- ]))),
41
- transition('* => void', animate('100ms linear', style({ opacity: 0 }))),
42
- ]),
43
- /** Fades in the content of the calendar. */
44
- fadeInCalendar: trigger('fadeInCalendar', [
45
- state('void', style({ opacity: 0 })),
46
- state('enter', style({ opacity: 1 })),
47
- // TODO(crisbeto): this animation should be removed since it isn't quite on spec, but we
48
- // need to keep it until #12440 gets in, otherwise the exit animation will look glitchy.
49
- transition('void => *', animate('120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)')),
50
- ]),
51
- slideCalendar: trigger('slideCalendar', [
52
- transition('* => left', [
53
- animate(180, keyframes([
54
- style({ transform: 'translateX(100%)', offset: 0.5 }),
55
- style({ transform: 'translateX(-100%)', offset: 0.51 }),
56
- style({ transform: 'translateX(0)', offset: 1 }),
57
- ])),
58
- ]),
59
- transition('* => right', [
60
- animate(180, keyframes([
61
- style({ transform: 'translateX(-100%)', offset: 0.5 }),
62
- style({ transform: 'translateX(100%)', offset: 0.51 }),
63
- style({ transform: 'translateX(0)', offset: 1 }),
64
- ])),
65
- ]),
66
- ]),
67
- };
68
-
69
- /** @docs-private */
70
- function createMissingDateImplError(provider) {
71
- return Error(`MtxDatetimepicker: No provider found for ${provider}. You must import one of the following ` +
72
- `modules at your application root: MtxNativeDatetimeModule, MtxMomentDatetimeModule, or provide a ` +
73
- `custom implementation.`);
74
- }
21
+ import * as i2 from '@angular/material/form-field';
75
22
 
76
23
  var MtxDatetimepickerFilterType;
77
24
  (function (MtxDatetimepickerFilterType) {
@@ -80,114 +27,78 @@ var MtxDatetimepickerFilterType;
80
27
  MtxDatetimepickerFilterType[MtxDatetimepickerFilterType["MINUTE"] = 2] = "MINUTE";
81
28
  })(MtxDatetimepickerFilterType || (MtxDatetimepickerFilterType = {}));
82
29
 
30
+ const activeEventOptions = normalizePassiveListenerOptions({ passive: false });
31
+ const CLOCK_RADIUS = 50;
32
+ const CLOCK_INNER_RADIUS = 27.5;
33
+ const CLOCK_OUTER_RADIUS = 41.25;
34
+ const CLOCK_TICK_RADIUS = 7.0833;
83
35
  /**
84
- * An internal class that represents the data corresponding to a single calendar cell.
85
- * @docs-private
86
- */
87
- class MtxCalendarCell {
88
- constructor(value, displayValue, ariaLabel, enabled) {
89
- this.value = value;
90
- this.displayValue = displayValue;
91
- this.ariaLabel = ariaLabel;
92
- this.enabled = enabled;
93
- }
94
- }
95
- /**
96
- * An internal component used to display calendar data in a table.
97
- * @docs-private
98
- */
99
- class MtxCalendarBody {
100
- constructor() {
101
- /** The number of columns in the table. */
102
- this.numCols = 7;
103
- /** Whether to allow selection of disabled cells. */
104
- this.allowDisabledSelection = false;
105
- /** The cell number of the active cell in the table. */
106
- this.activeCell = 0;
107
- /** Emits when a new value is selected. */
108
- this.selectedValueChange = new EventEmitter();
109
- }
110
- /** The number of blank cells to put at the beginning for the first row. */
111
- get _firstRowOffset() {
112
- return this.rows && this.rows.length && this.rows[0].length
113
- ? this.numCols - this.rows[0].length
114
- : 0;
115
- }
116
- _cellClicked(cell) {
117
- if (!this.allowDisabledSelection && !cell.enabled) {
118
- return;
119
- }
120
- this.selectedValueChange.emit(cell.value);
121
- }
122
- _isActiveCell(rowIndex, colIndex) {
123
- let cellNumber = rowIndex * this.numCols + colIndex;
124
- // Account for the fact that the first row may not have as many cells.
125
- if (rowIndex) {
126
- cellNumber -= this._firstRowOffset;
127
- }
128
- return cellNumber === this.activeCell;
129
- }
130
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxCalendarBody, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
131
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: { label: "label", rows: "rows", todayValue: "todayValue", selectedValue: "selectedValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", allowDisabledSelection: "allowDisabledSelection", activeCell: "activeCell" }, outputs: { selectedValueChange: "selectedValueChange" }, host: { classAttribute: "mtx-calendar-body" }, exportAs: ["mtxCalendarBody"], ngImport: i0, template: "<!--\n If there's not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don't want it to be read out as one of the weeks in the month.\n-->\n<tr *ngIf=\"_firstRowOffset < labelMinRequiredCells\" aria-hidden=\"true\">\n <td class=\"mtx-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\n</tr>\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\" role=\"row\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n -->\n <td *ngIf=\"rowIndex === 0 && _firstRowOffset\"\n class=\"mtx-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" aria-hidden=\"true\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n <td *ngFor=\"let item of row; let colIndex = index\"\n role=\"gridcell\"\n class=\"mtx-calendar-body-cell\"\n [class.mtx-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\"\n [class.mtx-calendar-body-disabled]=\"!item.enabled\"\n [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [attr.data-mat-row]=\"rowIndex\"\n [attr.data-mat-col]=\"colIndex\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n (click)=\"_cellClicked(item)\">\n <div class=\"mtx-calendar-body-cell-content\"\n [class.mtx-calendar-body-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-today]=\"todayValue === item.value\"\n [attr.aria-selected]=\"selectedValue === item.value\">\n {{ item.displayValue }}\n </div>\n </td>\n</tr>\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-today-outline-color)}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%;font-size:var(--mtx-datetimepicker-calendar-body-label-text-size);font-weight:var(--mtx-datetimepicker-calendar-body-label-text-weight);color:var(--mtx-datetimepicker-calendar-body-label-text-color)}[dir=rtl] .mtx-calendar-body-label{text-align:right}.mtx-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:7.1428571429% 0;text-align:center;outline:none;cursor:pointer}.mtx-calendar-body-disabled{cursor:default;pointer-events:none}.mtx-calendar-body-disabled>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid transparent;border-radius:999px;color:var(--mtx-datetimepicker-calendar-date-text-color);border-color:var(--mtx-datetimepicker-calendar-date-outline-color)}.mtx-calendar-body-active>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-focus-state-background-color)}@media (hover: hover){.mtx-calendar-body-cell:not(.mtx-calendar-body-disabled):hover>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-hover-state-background-color)}}.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-state-background-color);color:var(--mtx-datetimepicker-calendar-date-selected-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-disabled-state-background-color)}.mtx-calendar-body-selected.mtx-calendar-body-today{box-shadow:inset 0 0 0 1px var(--mtx-datetimepicker-calendar-date-today-selected-state-outline-color)}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
132
- }
133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxCalendarBody, decorators: [{
134
- type: Component,
135
- args: [{ selector: '[mtx-calendar-body]', host: {
136
- class: 'mtx-calendar-body',
137
- }, exportAs: 'mtxCalendarBody', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n If there's not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don't want it to be read out as one of the weeks in the month.\n-->\n<tr *ngIf=\"_firstRowOffset < labelMinRequiredCells\" aria-hidden=\"true\">\n <td class=\"mtx-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\n</tr>\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\" role=\"row\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n -->\n <td *ngIf=\"rowIndex === 0 && _firstRowOffset\"\n class=\"mtx-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" aria-hidden=\"true\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n <td *ngFor=\"let item of row; let colIndex = index\"\n role=\"gridcell\"\n class=\"mtx-calendar-body-cell\"\n [class.mtx-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\"\n [class.mtx-calendar-body-disabled]=\"!item.enabled\"\n [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [attr.data-mat-row]=\"rowIndex\"\n [attr.data-mat-col]=\"colIndex\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n (click)=\"_cellClicked(item)\">\n <div class=\"mtx-calendar-body-cell-content\"\n [class.mtx-calendar-body-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-today]=\"todayValue === item.value\"\n [attr.aria-selected]=\"selectedValue === item.value\">\n {{ item.displayValue }}\n </div>\n </td>\n</tr>\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-today-outline-color)}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%;font-size:var(--mtx-datetimepicker-calendar-body-label-text-size);font-weight:var(--mtx-datetimepicker-calendar-body-label-text-weight);color:var(--mtx-datetimepicker-calendar-body-label-text-color)}[dir=rtl] .mtx-calendar-body-label{text-align:right}.mtx-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:7.1428571429% 0;text-align:center;outline:none;cursor:pointer}.mtx-calendar-body-disabled{cursor:default;pointer-events:none}.mtx-calendar-body-disabled>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid transparent;border-radius:999px;color:var(--mtx-datetimepicker-calendar-date-text-color);border-color:var(--mtx-datetimepicker-calendar-date-outline-color)}.mtx-calendar-body-active>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-focus-state-background-color)}@media (hover: hover){.mtx-calendar-body-cell:not(.mtx-calendar-body-disabled):hover>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-hover-state-background-color)}}.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-state-background-color);color:var(--mtx-datetimepicker-calendar-date-selected-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-disabled-state-background-color)}.mtx-calendar-body-selected.mtx-calendar-body-today{box-shadow:inset 0 0 0 1px var(--mtx-datetimepicker-calendar-date-today-selected-state-outline-color)}\n"] }]
138
- }], propDecorators: { label: [{
139
- type: Input
140
- }], rows: [{
141
- type: Input
142
- }], todayValue: [{
143
- type: Input
144
- }], selectedValue: [{
145
- type: Input
146
- }], labelMinRequiredCells: [{
147
- type: Input
148
- }], numCols: [{
149
- type: Input
150
- }], allowDisabledSelection: [{
151
- type: Input
152
- }], activeCell: [{
153
- type: Input
154
- }], selectedValueChange: [{
155
- type: Output
156
- }] } });
157
-
158
- const yearsPerPage = 24;
159
- const yearsPerRow = 4;
160
- /**
161
- * An internal component used to display multiple years in the datetimepicker.
36
+ * A clock that is used as part of the datetimepicker.
162
37
  * @docs-private
163
38
  */
164
- class MtxMultiYearView {
165
- constructor(_adapter, _dateFormats) {
39
+ class MtxClock {
40
+ constructor(_elementRef, _adapter, _changeDetectorRef, _document) {
41
+ this._elementRef = _elementRef;
166
42
  this._adapter = _adapter;
167
- this._dateFormats = _dateFormats;
168
- this.type = 'date';
169
- /** Emits when a new month is selected. */
43
+ this._changeDetectorRef = _changeDetectorRef;
44
+ this._document = _document;
45
+ /** Step over minutes. */
46
+ this.interval = 1;
47
+ /** Whether the clock uses 12 hour format. */
48
+ this.twelvehour = false;
49
+ /** Whether the time is now in AM or PM. */
50
+ this.AMPM = 'AM';
51
+ /** Emits when the currently selected date changes. */
170
52
  this.selectedChange = new EventEmitter();
53
+ /** Emits when any date is activated. */
54
+ this.activeDateChange = new EventEmitter();
171
55
  /** Emits when any date is selected. */
172
56
  this._userSelection = new EventEmitter();
173
- if (!this._adapter) {
174
- throw createMissingDateImplError('DatetimeAdapter');
175
- }
176
- if (!this._dateFormats) {
177
- throw createMissingDateImplError('MTX_DATETIME_FORMATS');
178
- }
179
- this._activeDate = this._adapter.today();
57
+ /** Whether the clock is in hour view. */
58
+ this._hourView = true;
59
+ this._hours = [];
60
+ this._minutes = [];
61
+ this._timeChanged = false;
62
+ /** Called when the user has put their pointer down on the clock. */
63
+ this._pointerDown = (event) => {
64
+ this._timeChanged = false;
65
+ this.setTime(event);
66
+ this._bindGlobalEvents(event);
67
+ };
68
+ /**
69
+ * Called when the user has moved their pointer after
70
+ * starting to drag. Bound on the document level.
71
+ */
72
+ this._pointerMove = (event) => {
73
+ if (event.cancelable) {
74
+ event.preventDefault();
75
+ }
76
+ this.setTime(event);
77
+ };
78
+ /** Called when the user has lifted their pointer. Bound on the document level. */
79
+ this._pointerUp = (event) => {
80
+ if (event.cancelable) {
81
+ event.preventDefault();
82
+ }
83
+ this._removeGlobalEvents();
84
+ if (this._timeChanged) {
85
+ this.selectedChange.emit(this.activeDate);
86
+ if (!this._hourView) {
87
+ this._userSelection.emit();
88
+ }
89
+ }
90
+ };
180
91
  }
181
- /** The date to display in this multi year view */
92
+ /**
93
+ * The date to display in this clock view.
94
+ */
182
95
  get activeDate() {
183
96
  return this._activeDate;
184
97
  }
185
98
  set activeDate(value) {
186
99
  const oldActiveDate = this._activeDate;
187
- this._activeDate = value || this._adapter.today();
188
- if (oldActiveDate &&
189
- this._activeDate &&
190
- !isSameMultiYearView(this._adapter, oldActiveDate, this._activeDate, this.minDate, this.maxDate)) {
100
+ this._activeDate = this._adapter.clampDate(value, this.minDate, this.maxDate);
101
+ if (!this._adapter.sameMinute(oldActiveDate, this._activeDate)) {
191
102
  this._init();
192
103
  }
193
104
  }
@@ -196,124 +107,246 @@ class MtxMultiYearView {
196
107
  return this._selected;
197
108
  }
198
109
  set selected(value) {
199
- this._selected = value;
200
- this._selectedYear = this._selected && this._adapter.getYear(this._selected);
110
+ this._selected = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
111
+ if (this._selected) {
112
+ this.activeDate = this._selected;
113
+ }
201
114
  }
202
115
  /** The minimum selectable date. */
203
116
  get minDate() {
204
117
  return this._minDate;
205
118
  }
206
119
  set minDate(value) {
207
- this._minDate = this._getValidDateOrNull(this._adapter.deserialize(value));
120
+ this._minDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
208
121
  }
209
122
  /** The maximum selectable date. */
210
123
  get maxDate() {
211
124
  return this._maxDate;
212
125
  }
213
126
  set maxDate(value) {
214
- this._maxDate = this._getValidDateOrNull(this._adapter.deserialize(value));
127
+ this._maxDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
215
128
  }
216
- ngAfterContentInit() {
217
- this._init();
129
+ /** Whether the clock should be started in hour or minute view. */
130
+ set startView(value) {
131
+ this._hourView = value !== 'minute';
218
132
  }
219
- /** Handles when a new year is selected. */
220
- _yearSelected(year) {
221
- const month = this._adapter.getMonth(this.activeDate);
222
- const normalizedDate = this._adapter.createDatetime(year, month, 1, 0, 0);
223
- this.selectedChange.emit(this._adapter.createDatetime(year, month, Math.min(this._adapter.getDate(this.activeDate), this._adapter.getNumDaysInMonth(normalizedDate)), this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)));
224
- if (this.type === 'year') {
225
- this._userSelection.emit();
133
+ get _hand() {
134
+ const hour = this._adapter.getHour(this.activeDate);
135
+ this._selectedHour = hour;
136
+ this._selectedMinute = this._adapter.getMinute(this.activeDate);
137
+ let deg = 0;
138
+ let radius = CLOCK_OUTER_RADIUS;
139
+ if (this._hourView) {
140
+ const outer = this._selectedHour > 0 && this._selectedHour < 13;
141
+ radius = outer ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
142
+ if (this.twelvehour) {
143
+ radius = CLOCK_OUTER_RADIUS;
144
+ }
145
+ deg = Math.round(this._selectedHour * (360 / (24 / 2)));
146
+ }
147
+ else {
148
+ deg = Math.round(this._selectedMinute * (360 / 60));
226
149
  }
150
+ return {
151
+ height: `${radius}%`,
152
+ marginTop: `${50 - radius}%`,
153
+ transform: `rotate(${deg}deg)`,
154
+ };
227
155
  }
228
- _getActiveCell() {
229
- return getActiveOffset(this._adapter, this.activeDate, this.minDate, this.maxDate);
156
+ ngAfterContentInit() {
157
+ this.activeDate = this._activeDate || this._adapter.today();
158
+ this._init();
230
159
  }
231
- _calendarStateDone() {
232
- this._calendarState = '';
160
+ ngOnDestroy() {
161
+ this._removeGlobalEvents();
233
162
  }
234
- /** Initializes this year view. */
235
- _init() {
236
- this._todayYear = this._adapter.getYear(this._adapter.today());
237
- this._yearLabel = this._adapter.getYearName(this.activeDate);
238
- const activeYear = this._adapter.getYear(this.activeDate);
239
- const minYearOfPage = activeYear - getActiveOffset(this._adapter, this.activeDate, this.minDate, this.maxDate);
240
- this._years = [];
241
- for (let i = 0, row = []; i < yearsPerPage; i++) {
242
- row.push(minYearOfPage + i);
243
- if (row.length === yearsPerRow) {
244
- this._years.push(row.map(year => this._createCellForYear(year)));
245
- row = [];
246
- }
163
+ ngOnChanges() {
164
+ this._init();
165
+ }
166
+ /** Binds our global move and end events. */
167
+ _bindGlobalEvents(triggerEvent) {
168
+ // Note that we bind the events to the `document`, because it allows us to capture
169
+ // drag cancel events where the user's pointer is outside the browser window.
170
+ const document = this._document;
171
+ const isTouch = isTouchEvent(triggerEvent);
172
+ const moveEventName = isTouch ? 'touchmove' : 'mousemove';
173
+ const endEventName = isTouch ? 'touchend' : 'mouseup';
174
+ document.addEventListener(moveEventName, this._pointerMove, activeEventOptions);
175
+ document.addEventListener(endEventName, this._pointerUp, activeEventOptions);
176
+ if (isTouch) {
177
+ document.addEventListener('touchcancel', this._pointerUp, activeEventOptions);
247
178
  }
248
179
  }
249
- /** Creates an MtxCalendarCell for the given year. */
250
- _createCellForYear(year) {
251
- const yearName = this._adapter.getYearName(this._adapter.createDate(year, 0, 1));
252
- return new MtxCalendarCell(year, yearName, yearName, this._shouldEnableYear(year));
180
+ /** Removes any global event listeners that we may have added. */
181
+ _removeGlobalEvents() {
182
+ const document = this._document;
183
+ document.removeEventListener('mousemove', this._pointerMove, activeEventOptions);
184
+ document.removeEventListener('mouseup', this._pointerUp, activeEventOptions);
185
+ document.removeEventListener('touchmove', this._pointerMove, activeEventOptions);
186
+ document.removeEventListener('touchend', this._pointerUp, activeEventOptions);
187
+ document.removeEventListener('touchcancel', this._pointerUp, activeEventOptions);
253
188
  }
254
- /** Whether the given year is enabled. */
255
- _shouldEnableYear(year) {
256
- // disable if the year is greater than maxDate lower than minDate
257
- if (year === undefined ||
258
- year === null ||
259
- (this.maxDate && year > this._adapter.getYear(this.maxDate)) ||
260
- (this.minDate && year < this._adapter.getYear(this.minDate))) {
261
- return false;
262
- }
263
- // enable if it reaches here and there's no filter defined
264
- if (!this.dateFilter) {
265
- return true;
189
+ /** Initializes this clock view. */
190
+ _init() {
191
+ this._hours.length = 0;
192
+ this._minutes.length = 0;
193
+ const hourNames = this._adapter.getHourNames();
194
+ const minuteNames = this._adapter.getMinuteNames();
195
+ if (this.twelvehour) {
196
+ const hours = [];
197
+ for (let i = 0; i < hourNames.length; i++) {
198
+ const radian = (i / 6) * Math.PI;
199
+ const radius = CLOCK_OUTER_RADIUS;
200
+ const hour = i;
201
+ const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), hour, 0);
202
+ // Check if the date is enabled, no need to respect the minute setting here
203
+ const enabled = (!this.minDate ||
204
+ this._adapter.compareDatetime(date, this.minDate, false) >= 0) &&
205
+ (!this.maxDate ||
206
+ this._adapter.compareDatetime(date, this.maxDate, false) <= 0) &&
207
+ (!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.HOUR));
208
+ // display value for twelvehour clock should be from 1-12 not including 0 and not above 12
209
+ hours.push({
210
+ value: i,
211
+ displayValue: i % 12 === 0 ? '12' : hourNames[i % 12],
212
+ enabled,
213
+ top: CLOCK_RADIUS - Math.cos(radian) * radius - CLOCK_TICK_RADIUS,
214
+ left: CLOCK_RADIUS + Math.sin(radian) * radius - CLOCK_TICK_RADIUS,
215
+ });
216
+ }
217
+ // filter out AM or PM hours based on AMPM
218
+ if (this.AMPM === 'AM') {
219
+ this._hours = hours.filter(x => x.value < 12);
220
+ }
221
+ else {
222
+ this._hours = hours.filter(x => x.value >= 12);
223
+ }
266
224
  }
267
- const firstOfYear = this._adapter.createDate(year, 0, 1);
268
- // If any date in the year is enabled count the year as enabled.
269
- for (let date = firstOfYear; this._adapter.getYear(date) === year; date = this._adapter.addCalendarDays(date, 1)) {
270
- if (this.dateFilter(date)) {
271
- return true;
225
+ else {
226
+ for (let i = 0; i < hourNames.length; i++) {
227
+ const radian = (i / 6) * Math.PI;
228
+ const outer = i > 0 && i < 13;
229
+ const radius = outer ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
230
+ const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), i, 0);
231
+ // Check if the date is enabled, no need to respect the minute setting here
232
+ const enabled = (!this.minDate ||
233
+ this._adapter.compareDatetime(date, this.minDate, false) >= 0) &&
234
+ (!this.maxDate ||
235
+ this._adapter.compareDatetime(date, this.maxDate, false) <= 0) &&
236
+ (!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.HOUR));
237
+ this._hours.push({
238
+ value: i,
239
+ displayValue: i === 0 ? '00' : hourNames[i],
240
+ enabled,
241
+ top: CLOCK_RADIUS - Math.cos(radian) * radius - CLOCK_TICK_RADIUS,
242
+ left: CLOCK_RADIUS + Math.sin(radian) * radius - CLOCK_TICK_RADIUS,
243
+ fontSize: i > 0 && i < 13 ? '' : '80%',
244
+ });
272
245
  }
273
246
  }
274
- return false;
275
- }
276
- /**
277
- * Gets the year in this years range that the given Date falls on.
278
- * Returns null if the given Date is not in this range.
279
- */
280
- _getYearInCurrentRange(date) {
281
- const year = this._adapter.getYear(date);
282
- return this._isInRange(year) ? year : null;
283
- }
284
- /**
285
- * Validate if the current year is in the current range
286
- * Returns true if is in range else returns false
287
- */
288
- _isInRange(year) {
289
- return true;
247
+ for (let i = 0; i < minuteNames.length; i += 5) {
248
+ const radian = (i / 30) * Math.PI;
249
+ const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), this._adapter.getHour(this.activeDate), i);
250
+ const enabled = (!this.minDate || this._adapter.compareDatetime(date, this.minDate) >= 0) &&
251
+ (!this.maxDate || this._adapter.compareDatetime(date, this.maxDate) <= 0) &&
252
+ (!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.MINUTE));
253
+ this._minutes.push({
254
+ value: i,
255
+ displayValue: i === 0 ? '00' : minuteNames[i],
256
+ enabled,
257
+ top: CLOCK_RADIUS - Math.cos(radian) * CLOCK_OUTER_RADIUS - CLOCK_TICK_RADIUS,
258
+ left: CLOCK_RADIUS + Math.sin(radian) * CLOCK_OUTER_RADIUS - CLOCK_TICK_RADIUS,
259
+ });
260
+ }
290
261
  }
291
262
  /**
292
- * @param obj The object to check.
293
- * @returns The given object if it is both a date instance and valid, otherwise null.
263
+ * Set Time
264
+ * @param event
294
265
  */
295
- _getValidDateOrNull(obj) {
296
- return this._adapter.isDateInstance(obj) && this._adapter.isValid(obj) ? obj : null;
266
+ setTime(event) {
267
+ const trigger = this._elementRef.nativeElement;
268
+ const triggerRect = trigger.getBoundingClientRect();
269
+ const width = trigger.offsetWidth;
270
+ const height = trigger.offsetHeight;
271
+ const { pageX, pageY } = getPointerPositionOnPage(event);
272
+ const x = width / 2 - (pageX - triggerRect.left - window.pageXOffset);
273
+ const y = height / 2 - (pageY - triggerRect.top - window.pageYOffset);
274
+ let radian = Math.atan2(-x, y);
275
+ const unit = Math.PI / (this._hourView ? 6 : this.interval ? 30 / this.interval : 30);
276
+ const z = Math.sqrt(x * x + y * y);
277
+ const outer = this._hourView &&
278
+ z > (width * (CLOCK_OUTER_RADIUS / 100) + width * (CLOCK_INNER_RADIUS / 100)) / 2;
279
+ if (radian < 0) {
280
+ radian = Math.PI * 2 + radian;
281
+ }
282
+ let value = Math.round(radian / unit);
283
+ let date;
284
+ if (this._hourView) {
285
+ if (this.twelvehour) {
286
+ if (this.AMPM === 'AM') {
287
+ value = value === 0 ? 12 : value;
288
+ }
289
+ else {
290
+ // if we chosen 12 in PM, the value should be 0 for 0:00,
291
+ // else we can safely add 12 to the final value
292
+ value = value === 12 ? 0 : value + 12;
293
+ }
294
+ }
295
+ else {
296
+ if (value === 12) {
297
+ value = 0;
298
+ }
299
+ value = outer ? (value === 0 ? 12 : value) : value === 0 ? 0 : value + 12;
300
+ }
301
+ date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), value, this._adapter.getMinute(this.activeDate));
302
+ }
303
+ else {
304
+ if (this.interval) {
305
+ value *= this.interval;
306
+ }
307
+ if (value === 60) {
308
+ value = 0;
309
+ }
310
+ date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), this._adapter.getHour(this.activeDate), value);
311
+ }
312
+ // if there is a dateFilter, check if the date is allowed if it is not then do not set/emit new date
313
+ // https://github.com/ng-matero/extensions/issues/244
314
+ if (this.dateFilter &&
315
+ !this.dateFilter(date, this._hourView ? MtxDatetimepickerFilterType.HOUR : MtxDatetimepickerFilterType.MINUTE)) {
316
+ return;
317
+ }
318
+ this._timeChanged = true;
319
+ this.activeDate = date;
320
+ this._changeDetectorRef.markForCheck();
321
+ this.activeDateChange.emit(this.activeDate);
297
322
  }
298
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxMultiYearView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
299
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: MtxMultiYearView, selector: "mtx-multi-year-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxMultiYearView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [todayValue]=\"_todayYear\"\n [rows]=\"_years\"\n [numCols]=\"4\"\n [activeCell]=\"_getActiveCell()\"\n [allowDisabledSelection]=\"true\"\n [selectedValue]=\"_selectedYear!\"\n (selectedValueChange)=\"_yearSelected($event)\"></tbody>\n</table>\n", dependencies: [{ kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
323
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxClock, deps: [{ token: i0.ElementRef }, { token: i1.DatetimeAdapter }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
324
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0", type: MtxClock, isStandalone: true, selector: "mtx-clock", inputs: { dateFilter: "dateFilter", interval: "interval", twelvehour: ["twelvehour", "twelvehour", booleanAttribute], AMPM: "AMPM", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", startView: "startView" }, outputs: { selectedChange: "selectedChange", activeDateChange: "activeDateChange", _userSelection: "_userSelection" }, host: { attributes: { "role": "clock" }, listeners: { "mousedown": "_pointerDown($event)", "touchstart": "_pointerDown($event)" }, classAttribute: "mtx-clock" }, exportAs: ["mtxClock"], usesOnChanges: true, ngImport: i0, template: "<div class=\"mtx-clock-wrapper\">\n <div class=\"mtx-clock-center\"></div>\n <div class=\"mtx-clock-hand\" [ngStyle]=\"_hand\"></div>\n <div class=\"mtx-clock-hours\" [class.active]=\"_hourView\">\n @for (item of _hours; track item) {\n <div\n class=\"mtx-clock-cell\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedHour === item.value\"\n [style.fontSize]=\"item.fontSize\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\">{{ item.displayValue }}</div>\n }\n </div>\n <div class=\"mtx-clock-minutes\" [class.active]=\"!_hourView\">\n @for (item of _minutes; track item) {\n <div\n class=\"mtx-clock-cell\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedMinute === item.value\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\">{{ item.displayValue }}</div>\n }\n </div>\n</div>\n", styles: [".mtx-clock{position:relative;display:block;min-width:224px;margin:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none;touch-action:none;font-size:var(--mtx-datetimepicker-clock-text-size)}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-dial-background-color)}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hand{position:absolute;inset:0;width:1px;margin:0 auto;transform-origin:bottom;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hours,.mtx-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.mtx-clock-hours.active,.mtx-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.mtx-clock-minutes{transform:scale(.8)}.mtx-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer;color:var(--mtx-datetimepicker-clock-cell-text-color)}.mtx-clock-cell.mtx-clock-cell-selected{color:#fff;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-cell:not(.mtx-clock-cell-selected,.mtx-clock-cell-disabled):hover{background-color:var(--mtx-datetimepicker-clock-cell-hover-state-background-color)}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none;color:var(--mtx-datetimepicker-clock-cell-disabled-state-text-color)}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
300
325
  }
301
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxMultiYearView, decorators: [{
326
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxClock, decorators: [{
302
327
  type: Component,
303
- args: [{ selector: 'mtx-multi-year-view', exportAs: 'mtxMultiYearView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [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" }]
304
- }], ctorParameters: function () { return [{ type: i1.DatetimeAdapter, decorators: [{
305
- type: Optional
306
- }] }, { type: undefined, decorators: [{
307
- type: Optional
308
- }, {
328
+ args: [{ selector: 'mtx-clock', host: {
329
+ 'role': 'clock',
330
+ 'class': 'mtx-clock',
331
+ '(mousedown)': '_pointerDown($event)',
332
+ '(touchstart)': '_pointerDown($event)',
333
+ }, exportAs: 'mtxClock', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgStyle], template: "<div class=\"mtx-clock-wrapper\">\n <div class=\"mtx-clock-center\"></div>\n <div class=\"mtx-clock-hand\" [ngStyle]=\"_hand\"></div>\n <div class=\"mtx-clock-hours\" [class.active]=\"_hourView\">\n @for (item of _hours; track item) {\n <div\n class=\"mtx-clock-cell\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedHour === item.value\"\n [style.fontSize]=\"item.fontSize\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\">{{ item.displayValue }}</div>\n }\n </div>\n <div class=\"mtx-clock-minutes\" [class.active]=\"!_hourView\">\n @for (item of _minutes; track item) {\n <div\n class=\"mtx-clock-cell\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedMinute === item.value\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\">{{ item.displayValue }}</div>\n }\n </div>\n</div>\n", styles: [".mtx-clock{position:relative;display:block;min-width:224px;margin:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none;touch-action:none;font-size:var(--mtx-datetimepicker-clock-text-size)}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-dial-background-color)}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hand{position:absolute;inset:0;width:1px;margin:0 auto;transform-origin:bottom;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hours,.mtx-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.mtx-clock-hours.active,.mtx-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.mtx-clock-minutes{transform:scale(.8)}.mtx-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer;color:var(--mtx-datetimepicker-clock-cell-text-color)}.mtx-clock-cell.mtx-clock-cell-selected{color:#fff;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-cell:not(.mtx-clock-cell-selected,.mtx-clock-cell-disabled):hover{background-color:var(--mtx-datetimepicker-clock-cell-hover-state-background-color)}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none;color:var(--mtx-datetimepicker-clock-cell-disabled-state-text-color)}\n"] }]
334
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
309
335
  type: Inject,
310
- args: [MTX_DATETIME_FORMATS]
311
- }] }]; }, propDecorators: { type: [{
336
+ args: [DOCUMENT]
337
+ }] }], propDecorators: { dateFilter: [{
312
338
  type: Input
313
- }], dateFilter: [{
339
+ }], interval: [{
340
+ type: Input
341
+ }], twelvehour: [{
342
+ type: Input,
343
+ args: [{ transform: booleanAttribute }]
344
+ }], AMPM: [{
314
345
  type: Input
315
346
  }], selectedChange: [{
316
347
  type: Output
348
+ }], activeDateChange: [{
349
+ type: Output
317
350
  }], _userSelection: [{
318
351
  type: Output
319
352
  }], activeDate: [{
@@ -324,175 +357,327 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
324
357
  type: Input
325
358
  }], maxDate: [{
326
359
  type: Input
360
+ }], startView: [{
361
+ type: Input
327
362
  }] } });
328
- function isSameMultiYearView(dateAdapter, date1, date2, minDate, maxDate) {
329
- const year1 = dateAdapter.getYear(date1);
330
- const year2 = dateAdapter.getYear(date2);
331
- const startingYear = getStartingYear(dateAdapter, minDate, maxDate);
332
- return (Math.floor((year1 - startingYear) / yearsPerPage) ===
333
- Math.floor((year2 - startingYear) / yearsPerPage));
363
+ /** Returns whether an event is a touch event. */
364
+ function isTouchEvent(event) {
365
+ // This function is called for every pixel that the user has dragged so we need it to be
366
+ // as fast as possible. Since we only bind mouse events and touch events, we can assume
367
+ // that if the event's name starts with `t`, it's a touch event.
368
+ return event.type[0] === 't';
334
369
  }
335
- /**
336
- * When the multi-year view is first opened, the active year will be in view.
337
- * So we compute how many years are between the active year and the *slot* where our
338
- * "startingYear" will render when paged into view.
339
- */
340
- function getActiveOffset(dateAdapter, activeDate, minDate, maxDate) {
341
- const activeYear = dateAdapter.getYear(activeDate);
342
- return euclideanModulo(activeYear - getStartingYear(dateAdapter, minDate, maxDate), yearsPerPage);
370
+ /** Gets the coordinates of a touch or mouse event relative to the document. */
371
+ function getPointerPositionOnPage(event) {
372
+ let point;
373
+ if (isTouchEvent(event)) {
374
+ // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.
375
+ point = event.touches[0] || event.changedTouches[0];
376
+ }
377
+ else {
378
+ point = event;
379
+ }
380
+ return point;
343
381
  }
382
+
344
383
  /**
345
- * We pick a "starting" year such that either the maximum year would be at the end
346
- * or the minimum year would be at the beginning of a page.
384
+ * Animations used by the Material datepicker.
385
+ * @docs-private
347
386
  */
348
- function getStartingYear(dateAdapter, minDate, maxDate) {
349
- let startingYear = 0;
350
- if (maxDate) {
351
- const maxYear = dateAdapter.getYear(maxDate);
352
- startingYear = maxYear - yearsPerPage + 1;
353
- }
354
- else if (minDate) {
355
- startingYear = dateAdapter.getYear(minDate);
356
- }
357
- return startingYear;
358
- }
359
- /** Gets remainder that is non-negative, even if first number is negative */
360
- function euclideanModulo(a, b) {
361
- return ((a % b) + b) % b;
387
+ const mtxDatetimepickerAnimations = {
388
+ /** Transforms the height of the datepicker's calendar. */
389
+ transformPanel: trigger('transformPanel', [
390
+ transition('void => enter-dropdown', animate('120ms cubic-bezier(0, 0, 0.2, 1)', keyframes([
391
+ style({ opacity: 0, transform: 'scale(1, 0.8)' }),
392
+ style({ opacity: 1, transform: 'scale(1, 1)' }),
393
+ ]))),
394
+ transition('void => enter-dialog', animate('150ms cubic-bezier(0, 0, 0.2, 1)', keyframes([
395
+ style({ opacity: 0, transform: 'scale(0.7)' }),
396
+ style({ transform: 'none', opacity: 1 }),
397
+ ]))),
398
+ transition('* => void', animate('100ms linear', style({ opacity: 0 }))),
399
+ ]),
400
+ /** Fades in the content of the calendar. */
401
+ fadeInCalendar: trigger('fadeInCalendar', [
402
+ state('void', style({ opacity: 0 })),
403
+ state('enter', style({ opacity: 1 })),
404
+ // TODO(crisbeto): this animation should be removed since it isn't quite on spec, but we
405
+ // need to keep it until #12440 gets in, otherwise the exit animation will look glitchy.
406
+ transition('void => *', animate('120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)')),
407
+ ]),
408
+ slideCalendar: trigger('slideCalendar', [
409
+ transition('* => left', [
410
+ animate(180, keyframes([
411
+ style({ transform: 'translateX(100%)', offset: 0.5 }),
412
+ style({ transform: 'translateX(-100%)', offset: 0.51 }),
413
+ style({ transform: 'translateX(0)', offset: 1 }),
414
+ ])),
415
+ ]),
416
+ transition('* => right', [
417
+ animate(180, keyframes([
418
+ style({ transform: 'translateX(-100%)', offset: 0.5 }),
419
+ style({ transform: 'translateX(100%)', offset: 0.51 }),
420
+ style({ transform: 'translateX(0)', offset: 1 }),
421
+ ])),
422
+ ]),
423
+ ]),
424
+ };
425
+
426
+ /** @docs-private */
427
+ function createMissingDateImplError(provider) {
428
+ return Error(`MtxDatetimepicker: No provider found for ${provider}. You must add one of the following ` +
429
+ `to your app config: provideNativeDatetimeAdapter, provideDateFnsDatetimeAdapter,` +
430
+ `provideLuxonDatetimeAdapter, provideMomentDatetimeAdapter, or provide a ` +
431
+ `custom implementation.`);
362
432
  }
363
433
 
364
- class MtxDatetimepickerIntl {
434
+ /**
435
+ * An internal class that represents the data corresponding to a single calendar cell.
436
+ * @docs-private
437
+ */
438
+ class MtxCalendarCell {
439
+ constructor(value, displayValue, ariaLabel, enabled) {
440
+ this.value = value;
441
+ this.displayValue = displayValue;
442
+ this.ariaLabel = ariaLabel;
443
+ this.enabled = enabled;
444
+ }
445
+ }
446
+ /**
447
+ * An internal component used to display calendar data in a table.
448
+ * @docs-private
449
+ */
450
+ class MtxCalendarBody {
365
451
  constructor() {
366
- /**
367
- * Stream to emit from when labels are changed. Use this to notify components when the labels have
368
- * changed after initialization.
369
- */
370
- this.changes = new Subject();
371
- /** A label for the calendar popup (used by screen readers). */
372
- this.calendarLabel = 'Calendar';
373
- /** A label for the button used to open the calendar popup (used by screen readers). */
374
- this.openCalendarLabel = 'Open calendar';
375
- /** Label for the button used to close the calendar popup. */
376
- this.closeCalendarLabel = 'Close calendar';
377
- /** A label for the previous month button (used by screen readers). */
378
- this.prevMonthLabel = 'Previous month';
379
- /** A label for the next month button (used by screen readers). */
380
- this.nextMonthLabel = 'Next month';
381
- /** A label for the previous year button (used by screen readers). */
382
- this.prevYearLabel = 'Previous year';
383
- /** A label for the next year button (used by screen readers). */
384
- this.nextYearLabel = 'Next year';
385
- /** A label for the previous multi-year button (used by screen readers). */
386
- this.prevMultiYearLabel = 'Previous 24 years';
387
- /** A label for the next multi-year button (used by screen readers). */
388
- this.nextMultiYearLabel = 'Next 24 years';
389
- /** A label for the 'switch to month view' button (used by screen readers). */
390
- this.switchToMonthViewLabel = 'Choose date';
391
- /** A label for the 'switch to year view' button (used by screen readers). */
392
- this.switchToYearViewLabel = 'Choose month';
393
- /** A label for the 'switch to multi-year view' button (used by screen readers). */
394
- this.switchToMultiYearViewLabel = 'Choose month and year';
395
- /** A label for the first date of a range of dates (used by screen readers). */
396
- this.startDateLabel = 'Start date';
397
- /** A label for the last date of a range of dates (used by screen readers). */
398
- this.endDateLabel = 'End date';
399
- /** A label for the 'switch to clock hour view' button (used by screen readers). */
400
- this.switchToClockHourViewLabel = 'Choose hour';
401
- /** A label for the 'switch to clock minute view' button (used by screen readers). */
402
- this.switchToClockMinuteViewLabel = 'Choose minute';
403
- /** Label used for ok button within the manual time input. */
404
- this.okLabel = 'OK';
405
- /** Label used for cancel button within the manual time input. */
406
- this.cancelLabel = 'Cancel';
452
+ /** The number of columns in the table. */
453
+ this.numCols = 7;
454
+ /** Whether to allow selection of disabled cells. */
455
+ this.allowDisabledSelection = false;
456
+ /** The cell number of the active cell in the table. */
457
+ this.activeCell = 0;
458
+ /** Emits when a new value is selected. */
459
+ this.selectedValueChange = new EventEmitter();
407
460
  }
408
- /** Formats a range of years (used for visuals). */
409
- formatYearRange(start, end) {
410
- return `${start} \u2013 ${end}`;
461
+ /** The number of blank cells to put at the beginning for the first row. */
462
+ get _firstRowOffset() {
463
+ return this.rows && this.rows.length && this.rows[0].length
464
+ ? this.numCols - this.rows[0].length
465
+ : 0;
411
466
  }
412
- /** Formats a label for a range of years (used by screen readers). */
413
- formatYearRangeLabel(start, end) {
414
- return `${start} to ${end}`;
467
+ _cellClicked(cell) {
468
+ if (!this.allowDisabledSelection && !cell.enabled) {
469
+ return;
470
+ }
471
+ this.selectedValueChange.emit(cell.value);
415
472
  }
416
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
417
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerIntl, providedIn: 'root' }); }
473
+ _isActiveCell(rowIndex, colIndex) {
474
+ let cellNumber = rowIndex * this.numCols + colIndex;
475
+ // Account for the fact that the first row may not have as many cells.
476
+ if (rowIndex) {
477
+ cellNumber -= this._firstRowOffset;
478
+ }
479
+ return cellNumber === this.activeCell;
480
+ }
481
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxCalendarBody, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
482
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0", type: MtxCalendarBody, isStandalone: true, selector: "[mtx-calendar-body]", inputs: { label: "label", rows: "rows", todayValue: "todayValue", selectedValue: "selectedValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", allowDisabledSelection: "allowDisabledSelection", activeCell: "activeCell" }, outputs: { selectedValueChange: "selectedValueChange" }, host: { classAttribute: "mtx-calendar-body" }, exportAs: ["mtxCalendarBody"], ngImport: i0, template: "<!--\n If there's not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don't want it to be read out as one of the weeks in the month.\n-->\n@if (_firstRowOffset < labelMinRequiredCells) {\n <tr aria-hidden=\"true\">\n <td class=\"mtx-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\n </tr>\n}\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n@for (row of rows; track row; let rowIndex = $index) {\n <tr role=\"row\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n -->\n @if (rowIndex === 0 && _firstRowOffset) {\n <td\n class=\"mtx-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" aria-hidden=\"true\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n }\n @for (item of row; track item; let colIndex = $index) {\n <td\n role=\"gridcell\"\n class=\"mtx-calendar-body-cell\"\n [class.mtx-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\"\n [class.mtx-calendar-body-disabled]=\"!item.enabled\"\n [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [attr.data-mat-row]=\"rowIndex\"\n [attr.data-mat-col]=\"colIndex\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n (click)=\"_cellClicked(item)\">\n <div class=\"mtx-calendar-body-cell-content\"\n [class.mtx-calendar-body-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-today]=\"todayValue === item.value\"\n [attr.aria-selected]=\"selectedValue === item.value\">\n {{ item.displayValue }}\n </div>\n </td>\n }\n </tr>\n}\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-today-outline-color)}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%;font-size:var(--mtx-datetimepicker-calendar-body-label-text-size);font-weight:var(--mtx-datetimepicker-calendar-body-label-text-weight);color:var(--mtx-datetimepicker-calendar-body-label-text-color)}[dir=rtl] .mtx-calendar-body-label{text-align:right}.mtx-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:7.1428571429% 0;text-align:center;outline:none;cursor:pointer}.mtx-calendar-body-disabled{cursor:default;pointer-events:none}.mtx-calendar-body-disabled>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid transparent;border-radius:999px;color:var(--mtx-datetimepicker-calendar-date-text-color);border-color:var(--mtx-datetimepicker-calendar-date-outline-color)}.mtx-calendar-body-active>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-focus-state-background-color)}@media (hover: hover){.mtx-calendar-body-cell:not(.mtx-calendar-body-disabled):hover>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-hover-state-background-color)}}.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-state-background-color);color:var(--mtx-datetimepicker-calendar-date-selected-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-disabled-state-background-color)}.mtx-calendar-body-selected.mtx-calendar-body-today{box-shadow:inset 0 0 0 1px var(--mtx-datetimepicker-calendar-date-today-selected-state-outline-color)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
418
483
  }
419
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerIntl, decorators: [{
420
- type: Injectable,
421
- args: [{ providedIn: 'root' }]
422
- }] });
484
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxCalendarBody, decorators: [{
485
+ type: Component,
486
+ args: [{ selector: '[mtx-calendar-body]', host: {
487
+ class: 'mtx-calendar-body',
488
+ }, exportAs: 'mtxCalendarBody', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<!--\n If there's not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don't want it to be read out as one of the weeks in the month.\n-->\n@if (_firstRowOffset < labelMinRequiredCells) {\n <tr aria-hidden=\"true\">\n <td class=\"mtx-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\n </tr>\n}\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n@for (row of rows; track row; let rowIndex = $index) {\n <tr role=\"row\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n -->\n @if (rowIndex === 0 && _firstRowOffset) {\n <td\n class=\"mtx-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" aria-hidden=\"true\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n }\n @for (item of row; track item; let colIndex = $index) {\n <td\n role=\"gridcell\"\n class=\"mtx-calendar-body-cell\"\n [class.mtx-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\"\n [class.mtx-calendar-body-disabled]=\"!item.enabled\"\n [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [attr.data-mat-row]=\"rowIndex\"\n [attr.data-mat-col]=\"colIndex\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n (click)=\"_cellClicked(item)\">\n <div class=\"mtx-calendar-body-cell-content\"\n [class.mtx-calendar-body-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-today]=\"todayValue === item.value\"\n [attr.aria-selected]=\"selectedValue === item.value\">\n {{ item.displayValue }}\n </div>\n </td>\n }\n </tr>\n}\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-today-outline-color)}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%;font-size:var(--mtx-datetimepicker-calendar-body-label-text-size);font-weight:var(--mtx-datetimepicker-calendar-body-label-text-weight);color:var(--mtx-datetimepicker-calendar-body-label-text-color)}[dir=rtl] .mtx-calendar-body-label{text-align:right}.mtx-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:7.1428571429% 0;text-align:center;outline:none;cursor:pointer}.mtx-calendar-body-disabled{cursor:default;pointer-events:none}.mtx-calendar-body-disabled>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-today:not(.mtx-calendar-body-selected){border-color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid transparent;border-radius:999px;color:var(--mtx-datetimepicker-calendar-date-text-color);border-color:var(--mtx-datetimepicker-calendar-date-outline-color)}.mtx-calendar-body-active>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-focus-state-background-color)}@media (hover: hover){.mtx-calendar-body-cell:not(.mtx-calendar-body-disabled):hover>.mtx-calendar-body-cell-content:not(.mtx-calendar-body-selected){background-color:var(--mtx-datetimepicker-calendar-date-hover-state-background-color)}}.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-state-background-color);color:var(--mtx-datetimepicker-calendar-date-selected-state-text-color)}.mtx-calendar-body-disabled>.mtx-calendar-body-selected{background-color:var(--mtx-datetimepicker-calendar-date-selected-disabled-state-background-color)}.mtx-calendar-body-selected.mtx-calendar-body-today{box-shadow:inset 0 0 0 1px var(--mtx-datetimepicker-calendar-date-today-selected-state-outline-color)}\n"] }]
489
+ }], propDecorators: { label: [{
490
+ type: Input
491
+ }], rows: [{
492
+ type: Input
493
+ }], todayValue: [{
494
+ type: Input
495
+ }], selectedValue: [{
496
+ type: Input
497
+ }], labelMinRequiredCells: [{
498
+ type: Input
499
+ }], numCols: [{
500
+ type: Input
501
+ }], allowDisabledSelection: [{
502
+ type: Input
503
+ }], activeCell: [{
504
+ type: Input
505
+ }], selectedValueChange: [{
506
+ type: Output
507
+ }] } });
423
508
 
424
- const activeEventOptions = normalizePassiveListenerOptions({ passive: false });
425
- const CLOCK_RADIUS = 50;
426
- const CLOCK_INNER_RADIUS = 27.5;
427
- const CLOCK_OUTER_RADIUS = 41.25;
428
- const CLOCK_TICK_RADIUS = 7.0833;
509
+ const DAYS_PER_WEEK = 7;
429
510
  /**
430
- * A clock that is used as part of the datetimepicker.
511
+ * An internal component used to display a single month in the datetimepicker.
431
512
  * @docs-private
432
513
  */
433
- class MtxClock {
434
- constructor(_elementRef, _adapter, _changeDetectorRef, _document) {
435
- this._elementRef = _elementRef;
514
+ class MtxMonthView {
515
+ constructor(_adapter, _dateFormats) {
436
516
  this._adapter = _adapter;
437
- this._changeDetectorRef = _changeDetectorRef;
438
- this._document = _document;
439
- /** Step over minutes. */
440
- this.interval = 1;
441
- /** Whether the clock uses 12 hour format. */
442
- this.twelvehour = false;
443
- /** Whether the time is now in AM or PM. */
444
- this.AMPM = 'AM';
445
- /** Emits when the currently selected date changes. */
517
+ this._dateFormats = _dateFormats;
518
+ this.type = 'date';
519
+ /** Emits when a new date is selected. */
446
520
  this.selectedChange = new EventEmitter();
447
- /** Emits when any date is activated. */
448
- this.activeDateChange = new EventEmitter();
449
521
  /** Emits when any date is selected. */
450
522
  this._userSelection = new EventEmitter();
451
- /** Whether the clock is in hour view. */
452
- this._hourView = true;
453
- this._hours = [];
454
- this._minutes = [];
455
- this._timeChanged = false;
456
- /** Called when the user has put their pointer down on the clock. */
457
- this._pointerDown = (event) => {
458
- this._timeChanged = false;
459
- this.setTime(event);
460
- this._bindGlobalEvents(event);
461
- };
462
- /**
463
- * Called when the user has moved their pointer after
464
- * starting to drag. Bound on the document level.
465
- */
466
- this._pointerMove = (event) => {
467
- if (event.cancelable) {
468
- event.preventDefault();
523
+ if (!this._adapter) {
524
+ throw createMissingDateImplError('DatetimeAdapter');
525
+ }
526
+ if (!this._dateFormats) {
527
+ throw createMissingDateImplError('MTX_DATETIME_FORMATS');
528
+ }
529
+ const firstDayOfWeek = this._adapter.getFirstDayOfWeek();
530
+ const narrowWeekdays = this._adapter.getDayOfWeekNames('narrow');
531
+ const longWeekdays = this._adapter.getDayOfWeekNames('long');
532
+ // Rotate the labels for days of the week based on the configured first day of the week.
533
+ const weekdays = longWeekdays.map((long, i) => {
534
+ return { long, narrow: narrowWeekdays[i] };
535
+ });
536
+ this._weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek));
537
+ this._activeDate = this._adapter.today();
538
+ }
539
+ /**
540
+ * The date to display in this month view (everything other than the month and year is ignored).
541
+ */
542
+ get activeDate() {
543
+ return this._activeDate;
544
+ }
545
+ set activeDate(value) {
546
+ const oldActiveDate = this._activeDate;
547
+ this._activeDate = value || this._adapter.today();
548
+ if (oldActiveDate &&
549
+ this._activeDate &&
550
+ !this._adapter.sameMonthAndYear(oldActiveDate, this._activeDate)) {
551
+ this._init();
552
+ if (this._adapter.isInNextMonth(oldActiveDate, this._activeDate)) {
553
+ this.calendarState('right');
469
554
  }
470
- this.setTime(event);
471
- };
472
- /** Called when the user has lifted their pointer. Bound on the document level. */
473
- this._pointerUp = (event) => {
474
- if (event.cancelable) {
475
- event.preventDefault();
555
+ else {
556
+ this.calendarState('left');
476
557
  }
477
- this._removeGlobalEvents();
478
- if (this._timeChanged) {
479
- this.selectedChange.emit(this.activeDate);
480
- if (!this._hourView) {
481
- this._userSelection.emit();
482
- }
558
+ }
559
+ }
560
+ /** The currently selected date. */
561
+ get selected() {
562
+ return this._selected;
563
+ }
564
+ set selected(value) {
565
+ this._selected = value;
566
+ this._selectedDate = this._getDateInCurrentMonth(this.selected);
567
+ }
568
+ ngAfterContentInit() {
569
+ this._init();
570
+ }
571
+ /** Handles when a new date is selected. */
572
+ _dateSelected(date) {
573
+ this.selectedChange.emit(this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), date, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)));
574
+ if (this.type === 'date') {
575
+ this._userSelection.emit();
576
+ }
577
+ }
578
+ _calendarStateDone() {
579
+ this._calendarState = '';
580
+ }
581
+ /** Initializes this month view. */
582
+ _init() {
583
+ this._selectedDate = this._getDateInCurrentMonth(this.selected);
584
+ this._todayDate = this._getDateInCurrentMonth(this._adapter.today());
585
+ const firstOfMonth = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
586
+ this._firstWeekOffset =
587
+ (DAYS_PER_WEEK +
588
+ this._adapter.getDayOfWeek(firstOfMonth) -
589
+ this._adapter.getFirstDayOfWeek()) %
590
+ DAYS_PER_WEEK;
591
+ this._createWeekCells();
592
+ }
593
+ /** Creates MdCalendarCells for the dates in this month. */
594
+ _createWeekCells() {
595
+ const daysInMonth = this._adapter.getNumDaysInMonth(this.activeDate);
596
+ const dateNames = this._adapter.getDateNames();
597
+ this._weeks = [[]];
598
+ for (let i = 0, cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {
599
+ if (cell === DAYS_PER_WEEK) {
600
+ this._weeks.push([]);
601
+ cell = 0;
483
602
  }
484
- };
603
+ const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), i + 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
604
+ const enabled = !this.dateFilter || this.dateFilter(date);
605
+ const ariaLabel = this._adapter.format(date, this._dateFormats.display.dateA11yLabel);
606
+ this._weeks[this._weeks.length - 1].push(new MtxCalendarCell(i + 1, dateNames[i], ariaLabel, enabled));
607
+ }
485
608
  }
486
609
  /**
487
- * The date to display in this clock view.
610
+ * Gets the date in this month that the given Date falls on.
611
+ * Returns null if the given Date is in another month.
488
612
  */
613
+ _getDateInCurrentMonth(date) {
614
+ return this._adapter.sameMonthAndYear(date, this.activeDate)
615
+ ? this._adapter.getDate(date)
616
+ : null;
617
+ }
618
+ calendarState(direction) {
619
+ this._calendarState = direction;
620
+ }
621
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxMonthView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
622
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0", type: MtxMonthView, isStandalone: true, selector: "mtx-month-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxMonthView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\">\n <tr>\n @for (day of _weekdays; track day) {\n <th [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\n }\n </tr>\n </thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [rows]=\"_weeks\"\n [todayValue]=\"_todayDate!\"\n [activeCell]=\"_adapter.getDate(activeDate) - 1\"\n [selectedValue]=\"_selectedDate!\"\n (selectedValueChange)=\"_dateSelected($event)\"></tbody>\n</table>\n", dependencies: [{ kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
623
+ }
624
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxMonthView, decorators: [{
625
+ type: Component,
626
+ args: [{ selector: 'mtx-month-view', exportAs: 'mtxMonthView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MtxCalendarBody], template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\">\n <tr>\n @for (day of _weekdays; track day) {\n <th [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\n }\n </tr>\n </thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [rows]=\"_weeks\"\n [todayValue]=\"_todayDate!\"\n [activeCell]=\"_adapter.getDate(activeDate) - 1\"\n [selectedValue]=\"_selectedDate!\"\n (selectedValueChange)=\"_dateSelected($event)\"></tbody>\n</table>\n" }]
627
+ }], ctorParameters: () => [{ type: i1.DatetimeAdapter, decorators: [{
628
+ type: Optional
629
+ }] }, { type: undefined, decorators: [{
630
+ type: Optional
631
+ }, {
632
+ type: Inject,
633
+ args: [MTX_DATETIME_FORMATS]
634
+ }] }], propDecorators: { type: [{
635
+ type: Input
636
+ }], dateFilter: [{
637
+ type: Input
638
+ }], selectedChange: [{
639
+ type: Output
640
+ }], _userSelection: [{
641
+ type: Output
642
+ }], activeDate: [{
643
+ type: Input
644
+ }], selected: [{
645
+ type: Input
646
+ }] } });
647
+
648
+ const yearsPerPage = 24;
649
+ const yearsPerRow = 4;
650
+ /**
651
+ * An internal component used to display multiple years in the datetimepicker.
652
+ * @docs-private
653
+ */
654
+ class MtxMultiYearView {
655
+ constructor(_adapter, _dateFormats) {
656
+ this._adapter = _adapter;
657
+ this._dateFormats = _dateFormats;
658
+ this.type = 'date';
659
+ /** Emits when a new month is selected. */
660
+ this.selectedChange = new EventEmitter();
661
+ /** Emits when any date is selected. */
662
+ this._userSelection = new EventEmitter();
663
+ if (!this._adapter) {
664
+ throw createMissingDateImplError('DatetimeAdapter');
665
+ }
666
+ if (!this._dateFormats) {
667
+ throw createMissingDateImplError('MTX_DATETIME_FORMATS');
668
+ }
669
+ this._activeDate = this._adapter.today();
670
+ }
671
+ /** The date to display in this multi year view */
489
672
  get activeDate() {
490
673
  return this._activeDate;
491
674
  }
492
675
  set activeDate(value) {
493
676
  const oldActiveDate = this._activeDate;
494
- this._activeDate = this._adapter.clampDate(value, this.minDate, this.maxDate);
495
- if (!this._adapter.sameMinute(oldActiveDate, this._activeDate)) {
677
+ this._activeDate = value || this._adapter.today();
678
+ if (oldActiveDate &&
679
+ this._activeDate &&
680
+ !isSameMultiYearView(this._adapter, oldActiveDate, this._activeDate, this.minDate, this.maxDate)) {
496
681
  this._init();
497
682
  }
498
683
  }
@@ -501,245 +686,124 @@ class MtxClock {
501
686
  return this._selected;
502
687
  }
503
688
  set selected(value) {
504
- this._selected = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
505
- if (this._selected) {
506
- this.activeDate = this._selected;
507
- }
689
+ this._selected = value;
690
+ this._selectedYear = this._selected && this._adapter.getYear(this._selected);
508
691
  }
509
692
  /** The minimum selectable date. */
510
693
  get minDate() {
511
694
  return this._minDate;
512
695
  }
513
696
  set minDate(value) {
514
- this._minDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
697
+ this._minDate = this._getValidDateOrNull(this._adapter.deserialize(value));
515
698
  }
516
699
  /** The maximum selectable date. */
517
700
  get maxDate() {
518
701
  return this._maxDate;
519
702
  }
520
703
  set maxDate(value) {
521
- this._maxDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
522
- }
523
- /** Whether the clock should be started in hour or minute view. */
524
- set startView(value) {
525
- this._hourView = value !== 'minute';
526
- }
527
- get _hand() {
528
- const hour = this._adapter.getHour(this.activeDate);
529
- this._selectedHour = hour;
530
- this._selectedMinute = this._adapter.getMinute(this.activeDate);
531
- let deg = 0;
532
- let radius = CLOCK_OUTER_RADIUS;
533
- if (this._hourView) {
534
- const outer = this._selectedHour > 0 && this._selectedHour < 13;
535
- radius = outer ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
536
- if (this.twelvehour) {
537
- radius = CLOCK_OUTER_RADIUS;
538
- }
539
- deg = Math.round(this._selectedHour * (360 / (24 / 2)));
540
- }
541
- else {
542
- deg = Math.round(this._selectedMinute * (360 / 60));
543
- }
544
- return {
545
- height: `${radius}%`,
546
- marginTop: `${50 - radius}%`,
547
- transform: `rotate(${deg}deg)`,
548
- };
704
+ this._maxDate = this._getValidDateOrNull(this._adapter.deserialize(value));
549
705
  }
550
706
  ngAfterContentInit() {
551
- this.activeDate = this._activeDate || this._adapter.today();
552
707
  this._init();
553
708
  }
554
- ngOnDestroy() {
555
- this._removeGlobalEvents();
709
+ /** Handles when a new year is selected. */
710
+ _yearSelected(year) {
711
+ const month = this._adapter.getMonth(this.activeDate);
712
+ const normalizedDate = this._adapter.createDatetime(year, month, 1, 0, 0);
713
+ this.selectedChange.emit(this._adapter.createDatetime(year, month, Math.min(this._adapter.getDate(this.activeDate), this._adapter.getNumDaysInMonth(normalizedDate)), this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)));
714
+ if (this.type === 'year') {
715
+ this._userSelection.emit();
716
+ }
556
717
  }
557
- ngOnChanges() {
558
- this._init();
718
+ _getActiveCell() {
719
+ return getActiveOffset(this._adapter, this.activeDate, this.minDate, this.maxDate);
559
720
  }
560
- /** Binds our global move and end events. */
561
- _bindGlobalEvents(triggerEvent) {
562
- // Note that we bind the events to the `document`, because it allows us to capture
563
- // drag cancel events where the user's pointer is outside the browser window.
564
- const document = this._document;
565
- const isTouch = isTouchEvent(triggerEvent);
566
- const moveEventName = isTouch ? 'touchmove' : 'mousemove';
567
- const endEventName = isTouch ? 'touchend' : 'mouseup';
568
- document.addEventListener(moveEventName, this._pointerMove, activeEventOptions);
569
- document.addEventListener(endEventName, this._pointerUp, activeEventOptions);
570
- if (isTouch) {
571
- document.addEventListener('touchcancel', this._pointerUp, activeEventOptions);
721
+ _calendarStateDone() {
722
+ this._calendarState = '';
723
+ }
724
+ /** Initializes this year view. */
725
+ _init() {
726
+ this._todayYear = this._adapter.getYear(this._adapter.today());
727
+ this._yearLabel = this._adapter.getYearName(this.activeDate);
728
+ const activeYear = this._adapter.getYear(this.activeDate);
729
+ const minYearOfPage = activeYear - getActiveOffset(this._adapter, this.activeDate, this.minDate, this.maxDate);
730
+ this._years = [];
731
+ for (let i = 0, row = []; i < yearsPerPage; i++) {
732
+ row.push(minYearOfPage + i);
733
+ if (row.length === yearsPerRow) {
734
+ this._years.push(row.map(year => this._createCellForYear(year)));
735
+ row = [];
736
+ }
572
737
  }
573
738
  }
574
- /** Removes any global event listeners that we may have added. */
575
- _removeGlobalEvents() {
576
- const document = this._document;
577
- document.removeEventListener('mousemove', this._pointerMove, activeEventOptions);
578
- document.removeEventListener('mouseup', this._pointerUp, activeEventOptions);
579
- document.removeEventListener('touchmove', this._pointerMove, activeEventOptions);
580
- document.removeEventListener('touchend', this._pointerUp, activeEventOptions);
581
- document.removeEventListener('touchcancel', this._pointerUp, activeEventOptions);
739
+ /** Creates an MtxCalendarCell for the given year. */
740
+ _createCellForYear(year) {
741
+ const yearName = this._adapter.getYearName(this._adapter.createDate(year, 0, 1));
742
+ return new MtxCalendarCell(year, yearName, yearName, this._shouldEnableYear(year));
582
743
  }
583
- /** Initializes this clock view. */
584
- _init() {
585
- this._hours.length = 0;
586
- this._minutes.length = 0;
587
- const hourNames = this._adapter.getHourNames();
588
- const minuteNames = this._adapter.getMinuteNames();
589
- if (this.twelvehour) {
590
- const hours = [];
591
- for (let i = 0; i < hourNames.length; i++) {
592
- const radian = (i / 6) * Math.PI;
593
- const radius = CLOCK_OUTER_RADIUS;
594
- const hour = i;
595
- const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), hour, 0);
596
- // Check if the date is enabled, no need to respect the minute setting here
597
- const enabled = (!this.minDate ||
598
- this._adapter.compareDatetime(date, this.minDate, false) >= 0) &&
599
- (!this.maxDate ||
600
- this._adapter.compareDatetime(date, this.maxDate, false) <= 0) &&
601
- (!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.HOUR));
602
- // display value for twelvehour clock should be from 1-12 not including 0 and not above 12
603
- hours.push({
604
- value: i,
605
- displayValue: i % 12 === 0 ? '12' : hourNames[i % 12],
606
- enabled,
607
- top: CLOCK_RADIUS - Math.cos(radian) * radius - CLOCK_TICK_RADIUS,
608
- left: CLOCK_RADIUS + Math.sin(radian) * radius - CLOCK_TICK_RADIUS,
609
- });
610
- }
611
- // filter out AM or PM hours based on AMPM
612
- if (this.AMPM === 'AM') {
613
- this._hours = hours.filter(x => x.value < 12);
614
- }
615
- else {
616
- this._hours = hours.filter(x => x.value >= 12);
617
- }
744
+ /** Whether the given year is enabled. */
745
+ _shouldEnableYear(year) {
746
+ // disable if the year is greater than maxDate lower than minDate
747
+ if (year === undefined ||
748
+ year === null ||
749
+ (this.maxDate && year > this._adapter.getYear(this.maxDate)) ||
750
+ (this.minDate && year < this._adapter.getYear(this.minDate))) {
751
+ return false;
618
752
  }
619
- else {
620
- for (let i = 0; i < hourNames.length; i++) {
621
- const radian = (i / 6) * Math.PI;
622
- const outer = i > 0 && i < 13;
623
- const radius = outer ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
624
- const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), i, 0);
625
- // Check if the date is enabled, no need to respect the minute setting here
626
- const enabled = (!this.minDate ||
627
- this._adapter.compareDatetime(date, this.minDate, false) >= 0) &&
628
- (!this.maxDate ||
629
- this._adapter.compareDatetime(date, this.maxDate, false) <= 0) &&
630
- (!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.HOUR));
631
- this._hours.push({
632
- value: i,
633
- displayValue: i === 0 ? '00' : hourNames[i],
634
- enabled,
635
- top: CLOCK_RADIUS - Math.cos(radian) * radius - CLOCK_TICK_RADIUS,
636
- left: CLOCK_RADIUS + Math.sin(radian) * radius - CLOCK_TICK_RADIUS,
637
- fontSize: i > 0 && i < 13 ? '' : '80%',
638
- });
639
- }
753
+ // enable if it reaches here and there's no filter defined
754
+ if (!this.dateFilter) {
755
+ return true;
640
756
  }
641
- for (let i = 0; i < minuteNames.length; i += 5) {
642
- const radian = (i / 30) * Math.PI;
643
- const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), this._adapter.getHour(this.activeDate), i);
644
- const enabled = (!this.minDate || this._adapter.compareDatetime(date, this.minDate) >= 0) &&
645
- (!this.maxDate || this._adapter.compareDatetime(date, this.maxDate) <= 0) &&
646
- (!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.MINUTE));
647
- this._minutes.push({
648
- value: i,
649
- displayValue: i === 0 ? '00' : minuteNames[i],
650
- enabled,
651
- top: CLOCK_RADIUS - Math.cos(radian) * CLOCK_OUTER_RADIUS - CLOCK_TICK_RADIUS,
652
- left: CLOCK_RADIUS + Math.sin(radian) * CLOCK_OUTER_RADIUS - CLOCK_TICK_RADIUS,
653
- });
757
+ const firstOfYear = this._adapter.createDate(year, 0, 1);
758
+ // If any date in the year is enabled count the year as enabled.
759
+ for (let date = firstOfYear; this._adapter.getYear(date) === year; date = this._adapter.addCalendarDays(date, 1)) {
760
+ if (this.dateFilter(date)) {
761
+ return true;
762
+ }
654
763
  }
764
+ return false;
655
765
  }
656
766
  /**
657
- * Set Time
658
- * @param event
767
+ * Gets the year in this years range that the given Date falls on.
768
+ * Returns null if the given Date is not in this range.
659
769
  */
660
- setTime(event) {
661
- const trigger = this._elementRef.nativeElement;
662
- const triggerRect = trigger.getBoundingClientRect();
663
- const width = trigger.offsetWidth;
664
- const height = trigger.offsetHeight;
665
- const { pageX, pageY } = getPointerPositionOnPage(event);
666
- const x = width / 2 - (pageX - triggerRect.left - window.pageXOffset);
667
- const y = height / 2 - (pageY - triggerRect.top - window.pageYOffset);
668
- let radian = Math.atan2(-x, y);
669
- const unit = Math.PI / (this._hourView ? 6 : this.interval ? 30 / this.interval : 30);
670
- const z = Math.sqrt(x * x + y * y);
671
- const outer = this._hourView &&
672
- z > (width * (CLOCK_OUTER_RADIUS / 100) + width * (CLOCK_INNER_RADIUS / 100)) / 2;
673
- if (radian < 0) {
674
- radian = Math.PI * 2 + radian;
675
- }
676
- let value = Math.round(radian / unit);
677
- let date;
678
- if (this._hourView) {
679
- if (this.twelvehour) {
680
- if (this.AMPM === 'AM') {
681
- value = value === 0 ? 12 : value;
682
- }
683
- else {
684
- // if we chosen 12 in PM, the value should be 0 for 0:00,
685
- // else we can safely add 12 to the final value
686
- value = value === 12 ? 0 : value + 12;
687
- }
688
- }
689
- else {
690
- if (value === 12) {
691
- value = 0;
692
- }
693
- value = outer ? (value === 0 ? 12 : value) : value === 0 ? 0 : value + 12;
694
- }
695
- date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), value, this._adapter.getMinute(this.activeDate));
696
- }
697
- else {
698
- if (this.interval) {
699
- value *= this.interval;
700
- }
701
- if (value === 60) {
702
- value = 0;
703
- }
704
- date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), this._adapter.getHour(this.activeDate), value);
705
- }
706
- // if there is a dateFilter, check if the date is allowed if it is not then do not set/emit new date
707
- // https://github.com/ng-matero/extensions/issues/244
708
- if (this.dateFilter &&
709
- !this.dateFilter(date, this._hourView ? MtxDatetimepickerFilterType.HOUR : MtxDatetimepickerFilterType.MINUTE)) {
710
- return;
711
- }
712
- this._timeChanged = true;
713
- this.activeDate = date;
714
- this._changeDetectorRef.markForCheck();
715
- this.activeDateChange.emit(this.activeDate);
770
+ _getYearInCurrentRange(date) {
771
+ const year = this._adapter.getYear(date);
772
+ return this._isInRange(year) ? year : null;
773
+ }
774
+ /**
775
+ * Validate if the current year is in the current range
776
+ * Returns true if is in range else returns false
777
+ */
778
+ _isInRange(year) {
779
+ return true;
780
+ }
781
+ /**
782
+ * @param obj The object to check.
783
+ * @returns The given object if it is both a date instance and valid, otherwise null.
784
+ */
785
+ _getValidDateOrNull(obj) {
786
+ return this._adapter.isDateInstance(obj) && this._adapter.isValid(obj) ? obj : null;
716
787
  }
717
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxClock, deps: [{ token: i0.ElementRef }, { token: i1.DatetimeAdapter }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
718
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: MtxClock, selector: "mtx-clock", inputs: { dateFilter: "dateFilter", interval: "interval", twelvehour: "twelvehour", AMPM: "AMPM", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", startView: "startView" }, outputs: { selectedChange: "selectedChange", activeDateChange: "activeDateChange", _userSelection: "_userSelection" }, host: { attributes: { "role": "clock" }, listeners: { "mousedown": "_pointerDown($event)", "touchstart": "_pointerDown($event)" }, classAttribute: "mtx-clock" }, exportAs: ["mtxClock"], usesOnChanges: true, ngImport: i0, template: "<div class=\"mtx-clock-wrapper\">\n <div class=\"mtx-clock-center\"></div>\n <div class=\"mtx-clock-hand\" [ngStyle]=\"_hand\"></div>\n <div class=\"mtx-clock-hours\" [class.active]=\"_hourView\">\n <div *ngFor=\"let item of _hours\"\n class=\"mtx-clock-cell\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedHour === item.value\"\n [style.fontSize]=\"item.fontSize\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\">{{ item.displayValue }}</div>\n </div>\n <div class=\"mtx-clock-minutes\" [class.active]=\"!_hourView\">\n <div *ngFor=\"let item of _minutes\"\n class=\"mtx-clock-cell\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedMinute === item.value\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\">{{ item.displayValue }}</div>\n </div>\n</div>\n", styles: [".mtx-clock{position:relative;display:block;min-width:224px;margin:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none;touch-action:none;font-size:var(--mtx-datetimepicker-clock-text-size)}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-dial-background-color)}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hand{position:absolute;inset:0;width:1px;margin:0 auto;transform-origin:bottom;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hours,.mtx-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.mtx-clock-hours.active,.mtx-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.mtx-clock-minutes{transform:scale(.8)}.mtx-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer;color:var(--mtx-datetimepicker-clock-cell-text-color)}.mtx-clock-cell.mtx-clock-cell-selected{color:#fff;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-cell:not(.mtx-clock-cell-selected,.mtx-clock-cell-disabled):hover{background-color:var(--mtx-datetimepicker-clock-cell-hover-state-background-color)}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none;color:var(--mtx-datetimepicker-clock-cell-disabled-state-text-color)}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
788
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxMultiYearView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
789
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0", type: MtxMultiYearView, isStandalone: true, selector: "mtx-multi-year-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxMultiYearView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [todayValue]=\"_todayYear\"\n [rows]=\"_years\"\n [numCols]=\"4\"\n [activeCell]=\"_getActiveCell()\"\n [allowDisabledSelection]=\"true\"\n [selectedValue]=\"_selectedYear!\"\n (selectedValueChange)=\"_yearSelected($event)\"></tbody>\n</table>\n", dependencies: [{ kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
719
790
  }
720
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxClock, decorators: [{
791
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxMultiYearView, decorators: [{
721
792
  type: Component,
722
- args: [{ selector: 'mtx-clock', host: {
723
- 'role': 'clock',
724
- 'class': 'mtx-clock',
725
- '(mousedown)': '_pointerDown($event)',
726
- '(touchstart)': '_pointerDown($event)',
727
- }, exportAs: 'mtxClock', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mtx-clock-wrapper\">\n <div class=\"mtx-clock-center\"></div>\n <div class=\"mtx-clock-hand\" [ngStyle]=\"_hand\"></div>\n <div class=\"mtx-clock-hours\" [class.active]=\"_hourView\">\n <div *ngFor=\"let item of _hours\"\n class=\"mtx-clock-cell\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedHour === item.value\"\n [style.fontSize]=\"item.fontSize\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\">{{ item.displayValue }}</div>\n </div>\n <div class=\"mtx-clock-minutes\" [class.active]=\"!_hourView\">\n <div *ngFor=\"let item of _minutes\"\n class=\"mtx-clock-cell\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedMinute === item.value\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\">{{ item.displayValue }}</div>\n </div>\n</div>\n", styles: [".mtx-clock{position:relative;display:block;min-width:224px;margin:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none;touch-action:none;font-size:var(--mtx-datetimepicker-clock-text-size)}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-dial-background-color)}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hand{position:absolute;inset:0;width:1px;margin:0 auto;transform-origin:bottom;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-hours,.mtx-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.mtx-clock-hours.active,.mtx-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.mtx-clock-minutes{transform:scale(.8)}.mtx-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer;color:var(--mtx-datetimepicker-clock-cell-text-color)}.mtx-clock-cell.mtx-clock-cell-selected{color:#fff;background-color:var(--mtx-datetimepicker-clock-hand-background-color)}.mtx-clock-cell:not(.mtx-clock-cell-selected,.mtx-clock-cell-disabled):hover{background-color:var(--mtx-datetimepicker-clock-cell-hover-state-background-color)}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none;color:var(--mtx-datetimepicker-clock-cell-disabled-state-text-color)}\n"] }]
728
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
793
+ args: [{ selector: 'mtx-multi-year-view', exportAs: 'mtxMultiYearView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MtxCalendarBody], template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [todayValue]=\"_todayYear\"\n [rows]=\"_years\"\n [numCols]=\"4\"\n [activeCell]=\"_getActiveCell()\"\n [allowDisabledSelection]=\"true\"\n [selectedValue]=\"_selectedYear!\"\n (selectedValueChange)=\"_yearSelected($event)\"></tbody>\n</table>\n" }]
794
+ }], ctorParameters: () => [{ type: i1.DatetimeAdapter, decorators: [{
795
+ type: Optional
796
+ }] }, { type: undefined, decorators: [{
797
+ type: Optional
798
+ }, {
729
799
  type: Inject,
730
- args: [DOCUMENT]
731
- }] }]; }, propDecorators: { dateFilter: [{
732
- type: Input
733
- }], interval: [{
734
- type: Input
735
- }], twelvehour: [{
800
+ args: [MTX_DATETIME_FORMATS]
801
+ }] }], propDecorators: { type: [{
736
802
  type: Input
737
- }], AMPM: [{
803
+ }], dateFilter: [{
738
804
  type: Input
739
805
  }], selectedChange: [{
740
806
  type: Output
741
- }], activeDateChange: [{
742
- type: Output
743
807
  }], _userSelection: [{
744
808
  type: Output
745
809
  }], activeDate: [{
@@ -750,28 +814,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
750
814
  type: Input
751
815
  }], maxDate: [{
752
816
  type: Input
753
- }], startView: [{
754
- type: Input
755
817
  }] } });
756
- /** Returns whether an event is a touch event. */
757
- function isTouchEvent(event) {
758
- // This function is called for every pixel that the user has dragged so we need it to be
759
- // as fast as possible. Since we only bind mouse events and touch events, we can assume
760
- // that if the event's name starts with `t`, it's a touch event.
761
- return event.type[0] === 't';
818
+ function isSameMultiYearView(dateAdapter, date1, date2, minDate, maxDate) {
819
+ const year1 = dateAdapter.getYear(date1);
820
+ const year2 = dateAdapter.getYear(date2);
821
+ const startingYear = getStartingYear(dateAdapter, minDate, maxDate);
822
+ return (Math.floor((year1 - startingYear) / yearsPerPage) ===
823
+ Math.floor((year2 - startingYear) / yearsPerPage));
762
824
  }
763
- /** Gets the coordinates of a touch or mouse event relative to the document. */
764
- function getPointerPositionOnPage(event) {
765
- let point;
766
- if (isTouchEvent(event)) {
767
- // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.
768
- point = event.touches[0] || event.changedTouches[0];
825
+ /**
826
+ * When the multi-year view is first opened, the active year will be in view.
827
+ * So we compute how many years are between the active year and the *slot* where our
828
+ * "startingYear" will render when paged into view.
829
+ */
830
+ function getActiveOffset(dateAdapter, activeDate, minDate, maxDate) {
831
+ const activeYear = dateAdapter.getYear(activeDate);
832
+ return euclideanModulo(activeYear - getStartingYear(dateAdapter, minDate, maxDate), yearsPerPage);
833
+ }
834
+ /**
835
+ * We pick a "starting" year such that either the maximum year would be at the end
836
+ * or the minimum year would be at the beginning of a page.
837
+ */
838
+ function getStartingYear(dateAdapter, minDate, maxDate) {
839
+ let startingYear = 0;
840
+ if (maxDate) {
841
+ const maxYear = dateAdapter.getYear(maxDate);
842
+ startingYear = maxYear - yearsPerPage + 1;
843
+ }
844
+ else if (minDate) {
845
+ startingYear = dateAdapter.getYear(minDate);
846
+ }
847
+ return startingYear;
848
+ }
849
+ /** Gets remainder that is non-negative, even if first number is negative */
850
+ function euclideanModulo(a, b) {
851
+ return ((a % b) + b) % b;
852
+ }
853
+
854
+ class MtxDatetimepickerIntl {
855
+ constructor() {
856
+ /**
857
+ * Stream to emit from when labels are changed. Use this to notify components when the labels have
858
+ * changed after initialization.
859
+ */
860
+ this.changes = new Subject();
861
+ /** A label for the calendar popup (used by screen readers). */
862
+ this.calendarLabel = 'Calendar';
863
+ /** A label for the button used to open the calendar popup (used by screen readers). */
864
+ this.openCalendarLabel = 'Open calendar';
865
+ /** Label for the button used to close the calendar popup. */
866
+ this.closeCalendarLabel = 'Close calendar';
867
+ /** A label for the previous month button (used by screen readers). */
868
+ this.prevMonthLabel = 'Previous month';
869
+ /** A label for the next month button (used by screen readers). */
870
+ this.nextMonthLabel = 'Next month';
871
+ /** A label for the previous year button (used by screen readers). */
872
+ this.prevYearLabel = 'Previous year';
873
+ /** A label for the next year button (used by screen readers). */
874
+ this.nextYearLabel = 'Next year';
875
+ /** A label for the previous multi-year button (used by screen readers). */
876
+ this.prevMultiYearLabel = 'Previous 24 years';
877
+ /** A label for the next multi-year button (used by screen readers). */
878
+ this.nextMultiYearLabel = 'Next 24 years';
879
+ /** A label for the 'switch to month view' button (used by screen readers). */
880
+ this.switchToMonthViewLabel = 'Choose date';
881
+ /** A label for the 'switch to year view' button (used by screen readers). */
882
+ this.switchToYearViewLabel = 'Choose month';
883
+ /** A label for the 'switch to multi-year view' button (used by screen readers). */
884
+ this.switchToMultiYearViewLabel = 'Choose month and year';
885
+ /** A label for the first date of a range of dates (used by screen readers). */
886
+ this.startDateLabel = 'Start date';
887
+ /** A label for the last date of a range of dates (used by screen readers). */
888
+ this.endDateLabel = 'End date';
889
+ /** A label for the 'switch to clock hour view' button (used by screen readers). */
890
+ this.switchToClockHourViewLabel = 'Choose hour';
891
+ /** A label for the 'switch to clock minute view' button (used by screen readers). */
892
+ this.switchToClockMinuteViewLabel = 'Choose minute';
893
+ /** Label used for ok button within the manual time input. */
894
+ this.okLabel = 'OK';
895
+ /** Label used for cancel button within the manual time input. */
896
+ this.cancelLabel = 'Cancel';
769
897
  }
770
- else {
771
- point = event;
898
+ /** Formats a range of years (used for visuals). */
899
+ formatYearRange(start, end) {
900
+ return `${start} \u2013 ${end}`;
772
901
  }
773
- return point;
902
+ /** Formats a label for a range of years (used by screen readers). */
903
+ formatYearRangeLabel(start, end) {
904
+ return `${start} to ${end}`;
905
+ }
906
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
907
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerIntl, providedIn: 'root' }); }
774
908
  }
909
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerIntl, decorators: [{
910
+ type: Injectable,
911
+ args: [{ providedIn: 'root' }]
912
+ }] });
775
913
 
776
914
  function pad(num, size) {
777
915
  num = String(num);
@@ -930,10 +1068,10 @@ class MtxTimeInput {
930
1068
  this.inputElement.removeEventListener('keypress', this.keyPressListener);
931
1069
  this.inputElement.removeEventListener('input', this.inputEventListener);
932
1070
  }
933
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxTimeInput, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
934
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.7", type: MtxTimeInput, selector: "input.mtx-time-input", inputs: { timeInterval: "timeInterval", timeMin: "timeMin", timeMax: "timeMax", timeValue: "timeValue" }, outputs: { timeValueChanged: "timeValueChanged" }, host: { listeners: { "blur": "blur($event)", "focus": "focus($event)" } }, exportAs: ["mtxTimeInput"], ngImport: i0 }); }
1071
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxTimeInput, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1072
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0", type: MtxTimeInput, isStandalone: true, selector: "input.mtx-time-input", inputs: { timeInterval: "timeInterval", timeMin: "timeMin", timeMax: "timeMax", timeValue: "timeValue" }, outputs: { timeValueChanged: "timeValueChanged" }, host: { listeners: { "blur": "blur($event)", "focus": "focus($event)" } }, exportAs: ["mtxTimeInput"], ngImport: i0 }); }
935
1073
  }
936
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxTimeInput, decorators: [{
1074
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxTimeInput, decorators: [{
937
1075
  type: Directive,
938
1076
  args: [{
939
1077
  selector: 'input.mtx-time-input',
@@ -942,8 +1080,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
942
1080
  '(focus)': 'focus($event)',
943
1081
  },
944
1082
  exportAs: 'mtxTimeInput',
1083
+ standalone: true,
945
1084
  }]
946
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { timeInterval: [{
1085
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { timeInterval: [{
947
1086
  type: Input,
948
1087
  args: ['timeInterval']
949
1088
  }], timeMin: [{
@@ -959,13 +1098,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
959
1098
  type: Output
960
1099
  }] } });
961
1100
  class MtxTime {
962
- /** Whether the clock uses 12 hour format. */
963
- get twelvehour() {
964
- return this._twelvehour;
965
- }
966
- set twelvehour(value) {
967
- this._twelvehour = coerceBooleanProperty(value);
968
- }
969
1101
  /**
970
1102
  * The date to display in this clock view.
971
1103
  */
@@ -1060,7 +1192,8 @@ class MtxTime {
1060
1192
  this.clockViewChange = new EventEmitter();
1061
1193
  /** Step over minutes. */
1062
1194
  this.interval = 1;
1063
- this._twelvehour = false;
1195
+ /** Whether the clock uses 12 hour format. */
1196
+ this.twelvehour = false;
1064
1197
  /** Whether the time is now in AM or PM. */
1065
1198
  this.AMPM = 'AM';
1066
1199
  /** Whether the clock is in hour view. */
@@ -1170,15 +1303,15 @@ class MtxTime {
1170
1303
  this.datetimepickerIntlChangesSubscription.unsubscribe();
1171
1304
  }
1172
1305
  }
1173
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxTime, deps: [{ token: i1.DatetimeAdapter }, { token: i0.ChangeDetectorRef }, { token: MtxDatetimepickerIntl }], target: i0.ɵɵFactoryTarget.Component }); }
1174
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: MtxTime, selector: "mtx-time", inputs: { dateFilter: "dateFilter", interval: "interval", twelvehour: "twelvehour", AMPM: "AMPM", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", clockView: "clockView" }, outputs: { selectedChange: "selectedChange", activeDateChange: "activeDateChange", _userSelection: "_userSelection", ampmChange: "ampmChange", clockViewChange: "clockViewChange" }, host: { classAttribute: "mtx-time" }, viewQueries: [{ propertyName: "hourInputElement", first: true, predicate: ["hourInput"], descendants: true, read: (ElementRef) }, { propertyName: "hourInputDirective", first: true, predicate: ["hourInput"], descendants: true, read: MtxTimeInput }, { propertyName: "minuteInputElement", first: true, predicate: ["minuteInput"], descendants: true, read: (ElementRef) }, { propertyName: "minuteInputDirective", first: true, predicate: ["minuteInput"], descendants: true, read: MtxTimeInput }], exportAs: ["mtxTime"], usesOnChanges: true, ngImport: i0, template: "<div class=\"mtx-time-input-wrapper\">\n <div class=\"mtx-time-input-inner\">\n <input class=\"mtx-time-input\"\n [class.mtx-time-input-active]=\"clockView === 'hour'\"\n [class.mtx-time-input-warning]=\"!hourInput.valid\"\n #hourInput=\"mtxTimeInput\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n [timeMin]=\"twelvehour ? 1 : 0\"\n [timeMax]=\"twelvehour ? 12 : 23\"\n [timeValue]=\"hour\"\n (timeValueChanged)=\"handleHourInputChange($event)\"\n (focus)=\"handleFocus('hour')\" />\n\n <div class=\"mtx-time-seperator\">:</div>\n\n <input class=\"mtx-time-input\"\n [class.mtx-time-input-active]=\"clockView === 'minute'\"\n [class.mtx-time-input-warning]=\"!minuteInput.valid\"\n #minuteInput=\"mtxTimeInput\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n [timeMin]=\"0\"\n [timeMax]=\"59\"\n [timeValue]=\"minute\"\n (timeValueChanged)=\"handleMinuteInputChange($event)\"\n [timeInterval]=\"interval\"\n (focus)=\"handleFocus('minute')\" />\n\n <div *ngIf=\"twelvehour\" class=\"mtx-time-ampm\">\n <button mat-button type=\"button\" class=\"mtx-time-am\"\n [class.mtx-time-ampm-active]=\"AMPM === 'AM'\" aria-label=\"AM\"\n (keydown)=\"$event.stopPropagation()\"\n (click)=\"ampmChange.emit('AM')\">AM</button>\n <button mat-button type=\"button\" class=\"mtx-time-pm\"\n [class.mtx-time-ampm-active]=\"AMPM === 'PM'\" aria-label=\"PM\"\n (keydown)=\"$event.stopPropagation()\"\n (click)=\"ampmChange.emit('PM')\">PM</button>\n </div>\n </div>\n</div>\n\n<mtx-clock (selectedChange)=\"_timeSelected($event)\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n [AMPM]=\"AMPM\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"interval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected\"\n [startView]=\"clockView\"\n [twelvehour]=\"twelvehour\">\n</mtx-clock>\n\n<div class=\"mtx-time-button-wrapper\">\n <button class=\"mtx-time-cancel-button\" mat-button type=\"button\" (click)=\"handleCancel()\">\n {{ _datetimepickerIntl.cancelLabel }}\n </button>\n <button class=\"mtx-time-ok-button\" mat-button type=\"button\" (click)=\"handleOk()\"\n [disabled]=\"minuteInputDirective?.invalid || hourInputDirective?.invalid\">\n {{ _datetimepickerIntl.okLabel }}\n </button>\n</div>\n", styles: [".mtx-time{display:block;outline:none;-webkit-user-select:none;user-select:none}.mtx-time-input-wrapper{padding:8px 0;text-align:center}.mtx-time-input-inner{display:inline-flex;height:56px}.mtx-time-input{box-sizing:border-box;width:72px;height:100%;padding:0;font-size:36px;text-align:center;border-radius:8px;border:2px solid transparent;-webkit-appearance:none;appearance:none;outline:none;background-color:var(--mtx-datetimepicker-time-input-background-color);color:var(--mtx-datetimepicker-time-input-text-color)}.mtx-time-input.mtx-time-input-active{background-color:var(--mtx-datetimepicker-time-input-active-state-background-color);color:var(--mtx-datetimepicker-time-input-active-state-text-color)}.mtx-time-input.mtx-time-input-active:focus{border-color:var(--mtx-datetimepicker-time-input-focus-state-border-color);background-color:var(--mtx-datetimepicker-time-input-focus-state-background-color)}.mtx-time-input.mtx-time-input-active:focus::placeholder{color:var(--mtx-datetimepicker-time-input-focus-state-placeholder-text-color)}.mtx-time-input.mtx-time-input-warning{border-color:var(--mtx-datetimepicker-time-input-warn-state-border-color)}.mtx-time-seperator{display:inline-flex;justify-content:center;align-items:center;width:24px;font-size:36px}.mtx-time-ampm{display:inline-flex;flex-direction:column;margin-left:12px}[dir=rtl] .mtx-time-ampm{margin-left:auto;margin-right:12px}.mtx-time-ampm .mtx-time-am,.mtx-time-ampm .mtx-time-pm{--mdc-typography-button-font-weight: 400;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-text-color);border-color:var(--mtx-datetimepicker-time-ampm-border-color);flex:1;width:40px;min-width:auto;border-width:1px;border-style:solid}.mtx-time-ampm .mtx-time-am.mtx-time-ampm-active,.mtx-time-ampm .mtx-time-pm.mtx-time-ampm-active{--mdc-typography-button-font-weight: 500;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-selected-state-text-color);background-color:var(--mtx-datetimepicker-time-ampm-selected-state-background-color)}.mtx-time-ampm .mtx-time-am .mat-mdc-button-touch-target,.mtx-time-ampm .mtx-time-pm .mat-mdc-button-touch-target{height:100%}.mtx-time-ampm .mtx-time-am{border-radius:8px 8px 0 0}.mtx-time-ampm .mtx-time-pm{border-radius:0 0 8px 8px;border-top:none}.mtx-time-button-wrapper{display:flex;justify-content:flex-end;padding-top:8px}.mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: MtxClock, selector: "mtx-clock", inputs: ["dateFilter", "interval", "twelvehour", "AMPM", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["selectedChange", "activeDateChange", "_userSelection"], exportAs: ["mtxClock"] }, { kind: "directive", type: MtxTimeInput, selector: "input.mtx-time-input", inputs: ["timeInterval", "timeMin", "timeMax", "timeValue"], outputs: ["timeValueChanged"], exportAs: ["mtxTimeInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1306
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxTime, deps: [{ token: i1.DatetimeAdapter }, { token: i0.ChangeDetectorRef }, { token: MtxDatetimepickerIntl }], target: i0.ɵɵFactoryTarget.Component }); }
1307
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0", type: MtxTime, isStandalone: true, selector: "mtx-time", inputs: { dateFilter: "dateFilter", interval: "interval", twelvehour: ["twelvehour", "twelvehour", booleanAttribute], AMPM: "AMPM", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", clockView: "clockView" }, outputs: { selectedChange: "selectedChange", activeDateChange: "activeDateChange", _userSelection: "_userSelection", ampmChange: "ampmChange", clockViewChange: "clockViewChange" }, host: { classAttribute: "mtx-time" }, viewQueries: [{ propertyName: "hourInputElement", first: true, predicate: ["hourInput"], descendants: true, read: (ElementRef) }, { propertyName: "hourInputDirective", first: true, predicate: ["hourInput"], descendants: true, read: MtxTimeInput }, { propertyName: "minuteInputElement", first: true, predicate: ["minuteInput"], descendants: true, read: (ElementRef) }, { propertyName: "minuteInputDirective", first: true, predicate: ["minuteInput"], descendants: true, read: MtxTimeInput }], exportAs: ["mtxTime"], usesOnChanges: true, ngImport: i0, template: "<div class=\"mtx-time-input-wrapper\">\n <div class=\"mtx-time-input-inner\">\n <input class=\"mtx-time-input\"\n [class.mtx-time-input-active]=\"clockView === 'hour'\"\n [class.mtx-time-input-warning]=\"!hourInput.valid\"\n #hourInput=\"mtxTimeInput\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n [timeMin]=\"twelvehour ? 1 : 0\"\n [timeMax]=\"twelvehour ? 12 : 23\"\n [timeValue]=\"hour\"\n (timeValueChanged)=\"handleHourInputChange($event)\"\n (focus)=\"handleFocus('hour')\" />\n\n <div class=\"mtx-time-seperator\">:</div>\n\n <input class=\"mtx-time-input\"\n [class.mtx-time-input-active]=\"clockView === 'minute'\"\n [class.mtx-time-input-warning]=\"!minuteInput.valid\"\n #minuteInput=\"mtxTimeInput\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n [timeMin]=\"0\"\n [timeMax]=\"59\"\n [timeValue]=\"minute\"\n (timeValueChanged)=\"handleMinuteInputChange($event)\"\n [timeInterval]=\"interval\"\n (focus)=\"handleFocus('minute')\" />\n\n @if (twelvehour) {\n <div class=\"mtx-time-ampm\">\n <button mat-button type=\"button\" class=\"mtx-time-am\"\n [class.mtx-time-ampm-active]=\"AMPM === 'AM'\" aria-label=\"AM\"\n (keydown)=\"$event.stopPropagation()\"\n (click)=\"ampmChange.emit('AM')\">AM</button>\n <button mat-button type=\"button\" class=\"mtx-time-pm\"\n [class.mtx-time-ampm-active]=\"AMPM === 'PM'\" aria-label=\"PM\"\n (keydown)=\"$event.stopPropagation()\"\n (click)=\"ampmChange.emit('PM')\">PM</button>\n </div>\n }\n </div>\n</div>\n\n<mtx-clock (selectedChange)=\"_timeSelected($event)\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n [AMPM]=\"AMPM\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"interval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected\"\n [startView]=\"clockView\"\n [twelvehour]=\"twelvehour\">\n</mtx-clock>\n\n<div class=\"mtx-time-button-wrapper\">\n <button class=\"mtx-time-cancel-button\" mat-button type=\"button\" (click)=\"handleCancel()\">\n {{ _datetimepickerIntl.cancelLabel }}\n </button>\n <button class=\"mtx-time-ok-button\" mat-button type=\"button\" (click)=\"handleOk()\"\n [disabled]=\"minuteInputDirective?.invalid || hourInputDirective?.invalid\">\n {{ _datetimepickerIntl.okLabel }}\n </button>\n</div>\n", styles: [".mtx-time{display:block;outline:none;-webkit-user-select:none;user-select:none}.mtx-time-input-wrapper{padding:8px 0;text-align:center}.mtx-time-input-inner{display:inline-flex;height:56px}.mtx-time-input{box-sizing:border-box;width:72px;height:100%;padding:0;font-size:36px;text-align:center;border-radius:8px;border:2px solid transparent;appearance:none;outline:none;background-color:var(--mtx-datetimepicker-time-input-background-color);color:var(--mtx-datetimepicker-time-input-text-color)}.mtx-time-input.mtx-time-input-active{background-color:var(--mtx-datetimepicker-time-input-active-state-background-color);color:var(--mtx-datetimepicker-time-input-active-state-text-color)}.mtx-time-input.mtx-time-input-active:focus{border-color:var(--mtx-datetimepicker-time-input-focus-state-border-color);background-color:var(--mtx-datetimepicker-time-input-focus-state-background-color)}.mtx-time-input.mtx-time-input-active:focus::placeholder{color:var(--mtx-datetimepicker-time-input-focus-state-placeholder-text-color)}.mtx-time-input.mtx-time-input-warning{border-color:var(--mtx-datetimepicker-time-input-warn-state-border-color)}.mtx-time-seperator{display:inline-flex;justify-content:center;align-items:center;width:24px;font-size:36px}.mtx-time-ampm{display:inline-flex;flex-direction:column;margin-left:12px}[dir=rtl] .mtx-time-ampm{margin-left:auto;margin-right:12px}.mtx-time-ampm .mtx-time-am,.mtx-time-ampm .mtx-time-pm{--mdc-text-button-label-text-weight: 400;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-text-color);border-color:var(--mtx-datetimepicker-time-ampm-border-color);flex:1;width:40px;min-width:auto;border-width:1px;border-style:solid}.mtx-time-ampm .mtx-time-am.mtx-time-ampm-active,.mtx-time-ampm .mtx-time-pm.mtx-time-ampm-active{--mdc-text-button-label-text-weight: 500;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-selected-state-text-color);background-color:var(--mtx-datetimepicker-time-ampm-selected-state-background-color)}.mtx-time-ampm .mtx-time-am .mat-mdc-button-touch-target,.mtx-time-ampm .mtx-time-pm .mat-mdc-button-touch-target{height:100%}.mtx-time-ampm .mtx-time-am{border-radius:8px 8px 0 0}.mtx-time-ampm .mtx-time-pm{border-radius:0 0 8px 8px;border-top:none}.mtx-time-button-wrapper{display:flex;justify-content:flex-end;padding-top:8px}.mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: MtxClock, selector: "mtx-clock", inputs: ["dateFilter", "interval", "twelvehour", "AMPM", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["selectedChange", "activeDateChange", "_userSelection"], exportAs: ["mtxClock"] }, { kind: "directive", type: MtxTimeInput, selector: "input.mtx-time-input", inputs: ["timeInterval", "timeMin", "timeMax", "timeValue"], outputs: ["timeValueChanged"], exportAs: ["mtxTimeInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1175
1308
  }
1176
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxTime, decorators: [{
1309
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxTime, decorators: [{
1177
1310
  type: Component,
1178
1311
  args: [{ selector: 'mtx-time', exportAs: 'mtxTime', host: {
1179
1312
  class: 'mtx-time',
1180
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mtx-time-input-wrapper\">\n <div class=\"mtx-time-input-inner\">\n <input class=\"mtx-time-input\"\n [class.mtx-time-input-active]=\"clockView === 'hour'\"\n [class.mtx-time-input-warning]=\"!hourInput.valid\"\n #hourInput=\"mtxTimeInput\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n [timeMin]=\"twelvehour ? 1 : 0\"\n [timeMax]=\"twelvehour ? 12 : 23\"\n [timeValue]=\"hour\"\n (timeValueChanged)=\"handleHourInputChange($event)\"\n (focus)=\"handleFocus('hour')\" />\n\n <div class=\"mtx-time-seperator\">:</div>\n\n <input class=\"mtx-time-input\"\n [class.mtx-time-input-active]=\"clockView === 'minute'\"\n [class.mtx-time-input-warning]=\"!minuteInput.valid\"\n #minuteInput=\"mtxTimeInput\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n [timeMin]=\"0\"\n [timeMax]=\"59\"\n [timeValue]=\"minute\"\n (timeValueChanged)=\"handleMinuteInputChange($event)\"\n [timeInterval]=\"interval\"\n (focus)=\"handleFocus('minute')\" />\n\n <div *ngIf=\"twelvehour\" class=\"mtx-time-ampm\">\n <button mat-button type=\"button\" class=\"mtx-time-am\"\n [class.mtx-time-ampm-active]=\"AMPM === 'AM'\" aria-label=\"AM\"\n (keydown)=\"$event.stopPropagation()\"\n (click)=\"ampmChange.emit('AM')\">AM</button>\n <button mat-button type=\"button\" class=\"mtx-time-pm\"\n [class.mtx-time-ampm-active]=\"AMPM === 'PM'\" aria-label=\"PM\"\n (keydown)=\"$event.stopPropagation()\"\n (click)=\"ampmChange.emit('PM')\">PM</button>\n </div>\n </div>\n</div>\n\n<mtx-clock (selectedChange)=\"_timeSelected($event)\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n [AMPM]=\"AMPM\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"interval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected\"\n [startView]=\"clockView\"\n [twelvehour]=\"twelvehour\">\n</mtx-clock>\n\n<div class=\"mtx-time-button-wrapper\">\n <button class=\"mtx-time-cancel-button\" mat-button type=\"button\" (click)=\"handleCancel()\">\n {{ _datetimepickerIntl.cancelLabel }}\n </button>\n <button class=\"mtx-time-ok-button\" mat-button type=\"button\" (click)=\"handleOk()\"\n [disabled]=\"minuteInputDirective?.invalid || hourInputDirective?.invalid\">\n {{ _datetimepickerIntl.okLabel }}\n </button>\n</div>\n", styles: [".mtx-time{display:block;outline:none;-webkit-user-select:none;user-select:none}.mtx-time-input-wrapper{padding:8px 0;text-align:center}.mtx-time-input-inner{display:inline-flex;height:56px}.mtx-time-input{box-sizing:border-box;width:72px;height:100%;padding:0;font-size:36px;text-align:center;border-radius:8px;border:2px solid transparent;-webkit-appearance:none;appearance:none;outline:none;background-color:var(--mtx-datetimepicker-time-input-background-color);color:var(--mtx-datetimepicker-time-input-text-color)}.mtx-time-input.mtx-time-input-active{background-color:var(--mtx-datetimepicker-time-input-active-state-background-color);color:var(--mtx-datetimepicker-time-input-active-state-text-color)}.mtx-time-input.mtx-time-input-active:focus{border-color:var(--mtx-datetimepicker-time-input-focus-state-border-color);background-color:var(--mtx-datetimepicker-time-input-focus-state-background-color)}.mtx-time-input.mtx-time-input-active:focus::placeholder{color:var(--mtx-datetimepicker-time-input-focus-state-placeholder-text-color)}.mtx-time-input.mtx-time-input-warning{border-color:var(--mtx-datetimepicker-time-input-warn-state-border-color)}.mtx-time-seperator{display:inline-flex;justify-content:center;align-items:center;width:24px;font-size:36px}.mtx-time-ampm{display:inline-flex;flex-direction:column;margin-left:12px}[dir=rtl] .mtx-time-ampm{margin-left:auto;margin-right:12px}.mtx-time-ampm .mtx-time-am,.mtx-time-ampm .mtx-time-pm{--mdc-typography-button-font-weight: 400;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-text-color);border-color:var(--mtx-datetimepicker-time-ampm-border-color);flex:1;width:40px;min-width:auto;border-width:1px;border-style:solid}.mtx-time-ampm .mtx-time-am.mtx-time-ampm-active,.mtx-time-ampm .mtx-time-pm.mtx-time-ampm-active{--mdc-typography-button-font-weight: 500;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-selected-state-text-color);background-color:var(--mtx-datetimepicker-time-ampm-selected-state-background-color)}.mtx-time-ampm .mtx-time-am .mat-mdc-button-touch-target,.mtx-time-ampm .mtx-time-pm .mat-mdc-button-touch-target{height:100%}.mtx-time-ampm .mtx-time-am{border-radius:8px 8px 0 0}.mtx-time-ampm .mtx-time-pm{border-radius:0 0 8px 8px;border-top:none}.mtx-time-button-wrapper{display:flex;justify-content:flex-end;padding-top:8px}.mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"] }]
1181
- }], ctorParameters: function () { return [{ type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }, { type: MtxDatetimepickerIntl }]; }, propDecorators: { selectedChange: [{
1313
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatButton, MtxClock, MtxTimeInput], template: "<div class=\"mtx-time-input-wrapper\">\n <div class=\"mtx-time-input-inner\">\n <input class=\"mtx-time-input\"\n [class.mtx-time-input-active]=\"clockView === 'hour'\"\n [class.mtx-time-input-warning]=\"!hourInput.valid\"\n #hourInput=\"mtxTimeInput\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n [timeMin]=\"twelvehour ? 1 : 0\"\n [timeMax]=\"twelvehour ? 12 : 23\"\n [timeValue]=\"hour\"\n (timeValueChanged)=\"handleHourInputChange($event)\"\n (focus)=\"handleFocus('hour')\" />\n\n <div class=\"mtx-time-seperator\">:</div>\n\n <input class=\"mtx-time-input\"\n [class.mtx-time-input-active]=\"clockView === 'minute'\"\n [class.mtx-time-input-warning]=\"!minuteInput.valid\"\n #minuteInput=\"mtxTimeInput\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n [timeMin]=\"0\"\n [timeMax]=\"59\"\n [timeValue]=\"minute\"\n (timeValueChanged)=\"handleMinuteInputChange($event)\"\n [timeInterval]=\"interval\"\n (focus)=\"handleFocus('minute')\" />\n\n @if (twelvehour) {\n <div class=\"mtx-time-ampm\">\n <button mat-button type=\"button\" class=\"mtx-time-am\"\n [class.mtx-time-ampm-active]=\"AMPM === 'AM'\" aria-label=\"AM\"\n (keydown)=\"$event.stopPropagation()\"\n (click)=\"ampmChange.emit('AM')\">AM</button>\n <button mat-button type=\"button\" class=\"mtx-time-pm\"\n [class.mtx-time-ampm-active]=\"AMPM === 'PM'\" aria-label=\"PM\"\n (keydown)=\"$event.stopPropagation()\"\n (click)=\"ampmChange.emit('PM')\">PM</button>\n </div>\n }\n </div>\n</div>\n\n<mtx-clock (selectedChange)=\"_timeSelected($event)\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n [AMPM]=\"AMPM\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"interval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected\"\n [startView]=\"clockView\"\n [twelvehour]=\"twelvehour\">\n</mtx-clock>\n\n<div class=\"mtx-time-button-wrapper\">\n <button class=\"mtx-time-cancel-button\" mat-button type=\"button\" (click)=\"handleCancel()\">\n {{ _datetimepickerIntl.cancelLabel }}\n </button>\n <button class=\"mtx-time-ok-button\" mat-button type=\"button\" (click)=\"handleOk()\"\n [disabled]=\"minuteInputDirective?.invalid || hourInputDirective?.invalid\">\n {{ _datetimepickerIntl.okLabel }}\n </button>\n</div>\n", styles: [".mtx-time{display:block;outline:none;-webkit-user-select:none;user-select:none}.mtx-time-input-wrapper{padding:8px 0;text-align:center}.mtx-time-input-inner{display:inline-flex;height:56px}.mtx-time-input{box-sizing:border-box;width:72px;height:100%;padding:0;font-size:36px;text-align:center;border-radius:8px;border:2px solid transparent;appearance:none;outline:none;background-color:var(--mtx-datetimepicker-time-input-background-color);color:var(--mtx-datetimepicker-time-input-text-color)}.mtx-time-input.mtx-time-input-active{background-color:var(--mtx-datetimepicker-time-input-active-state-background-color);color:var(--mtx-datetimepicker-time-input-active-state-text-color)}.mtx-time-input.mtx-time-input-active:focus{border-color:var(--mtx-datetimepicker-time-input-focus-state-border-color);background-color:var(--mtx-datetimepicker-time-input-focus-state-background-color)}.mtx-time-input.mtx-time-input-active:focus::placeholder{color:var(--mtx-datetimepicker-time-input-focus-state-placeholder-text-color)}.mtx-time-input.mtx-time-input-warning{border-color:var(--mtx-datetimepicker-time-input-warn-state-border-color)}.mtx-time-seperator{display:inline-flex;justify-content:center;align-items:center;width:24px;font-size:36px}.mtx-time-ampm{display:inline-flex;flex-direction:column;margin-left:12px}[dir=rtl] .mtx-time-ampm{margin-left:auto;margin-right:12px}.mtx-time-ampm .mtx-time-am,.mtx-time-ampm .mtx-time-pm{--mdc-text-button-label-text-weight: 400;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-text-color);border-color:var(--mtx-datetimepicker-time-ampm-border-color);flex:1;width:40px;min-width:auto;border-width:1px;border-style:solid}.mtx-time-ampm .mtx-time-am.mtx-time-ampm-active,.mtx-time-ampm .mtx-time-pm.mtx-time-ampm-active{--mdc-text-button-label-text-weight: 500;--mdc-text-button-label-text-color: var(--mtx-datetimepicker-time-ampm-selected-state-text-color);background-color:var(--mtx-datetimepicker-time-ampm-selected-state-background-color)}.mtx-time-ampm .mtx-time-am .mat-mdc-button-touch-target,.mtx-time-ampm .mtx-time-pm .mat-mdc-button-touch-target{height:100%}.mtx-time-ampm .mtx-time-am{border-radius:8px 8px 0 0}.mtx-time-ampm .mtx-time-pm{border-radius:0 0 8px 8px;border-top:none}.mtx-time-button-wrapper{display:flex;justify-content:flex-end;padding-top:8px}.mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mtx-time-button-wrapper .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"] }]
1314
+ }], ctorParameters: () => [{ type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }, { type: MtxDatetimepickerIntl }], propDecorators: { selectedChange: [{
1182
1315
  type: Output
1183
1316
  }], activeDateChange: [{
1184
1317
  type: Output
@@ -1205,7 +1338,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
1205
1338
  type: ViewChild,
1206
1339
  args: ['minuteInput', { read: MtxTimeInput }]
1207
1340
  }], twelvehour: [{
1208
- type: Input
1341
+ type: Input,
1342
+ args: [{ transform: booleanAttribute }]
1209
1343
  }], AMPM: [{
1210
1344
  type: Input
1211
1345
  }], activeDate: [{
@@ -1220,145 +1354,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
1220
1354
  type: Input
1221
1355
  }] } });
1222
1356
 
1223
- const DAYS_PER_WEEK = 7;
1224
- /**
1225
- * An internal component used to display a single month in the datetimepicker.
1226
- * @docs-private
1227
- */
1228
- class MtxMonthView {
1229
- constructor(_adapter, _dateFormats) {
1230
- this._adapter = _adapter;
1231
- this._dateFormats = _dateFormats;
1232
- this.type = 'date';
1233
- /** Emits when a new date is selected. */
1234
- this.selectedChange = new EventEmitter();
1235
- /** Emits when any date is selected. */
1236
- this._userSelection = new EventEmitter();
1237
- if (!this._adapter) {
1238
- throw createMissingDateImplError('DatetimeAdapter');
1239
- }
1240
- if (!this._dateFormats) {
1241
- throw createMissingDateImplError('MTX_DATETIME_FORMATS');
1242
- }
1243
- const firstDayOfWeek = this._adapter.getFirstDayOfWeek();
1244
- const narrowWeekdays = this._adapter.getDayOfWeekNames('narrow');
1245
- const longWeekdays = this._adapter.getDayOfWeekNames('long');
1246
- // Rotate the labels for days of the week based on the configured first day of the week.
1247
- const weekdays = longWeekdays.map((long, i) => {
1248
- return { long, narrow: narrowWeekdays[i] };
1249
- });
1250
- this._weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek));
1251
- this._activeDate = this._adapter.today();
1252
- }
1253
- /**
1254
- * The date to display in this month view (everything other than the month and year is ignored).
1255
- */
1256
- get activeDate() {
1257
- return this._activeDate;
1258
- }
1259
- set activeDate(value) {
1260
- const oldActiveDate = this._activeDate;
1261
- this._activeDate = value || this._adapter.today();
1262
- if (oldActiveDate &&
1263
- this._activeDate &&
1264
- !this._adapter.sameMonthAndYear(oldActiveDate, this._activeDate)) {
1265
- this._init();
1266
- if (this._adapter.isInNextMonth(oldActiveDate, this._activeDate)) {
1267
- this.calendarState('right');
1268
- }
1269
- else {
1270
- this.calendarState('left');
1271
- }
1272
- }
1273
- }
1274
- /** The currently selected date. */
1275
- get selected() {
1276
- return this._selected;
1277
- }
1278
- set selected(value) {
1279
- this._selected = value;
1280
- this._selectedDate = this._getDateInCurrentMonth(this.selected);
1281
- }
1282
- ngAfterContentInit() {
1283
- this._init();
1284
- }
1285
- /** Handles when a new date is selected. */
1286
- _dateSelected(date) {
1287
- this.selectedChange.emit(this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), date, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)));
1288
- if (this.type === 'date') {
1289
- this._userSelection.emit();
1290
- }
1291
- }
1292
- _calendarStateDone() {
1293
- this._calendarState = '';
1294
- }
1295
- /** Initializes this month view. */
1296
- _init() {
1297
- this._selectedDate = this._getDateInCurrentMonth(this.selected);
1298
- this._todayDate = this._getDateInCurrentMonth(this._adapter.today());
1299
- const firstOfMonth = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
1300
- this._firstWeekOffset =
1301
- (DAYS_PER_WEEK +
1302
- this._adapter.getDayOfWeek(firstOfMonth) -
1303
- this._adapter.getFirstDayOfWeek()) %
1304
- DAYS_PER_WEEK;
1305
- this._createWeekCells();
1306
- }
1307
- /** Creates MdCalendarCells for the dates in this month. */
1308
- _createWeekCells() {
1309
- const daysInMonth = this._adapter.getNumDaysInMonth(this.activeDate);
1310
- const dateNames = this._adapter.getDateNames();
1311
- this._weeks = [[]];
1312
- for (let i = 0, cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {
1313
- if (cell === DAYS_PER_WEEK) {
1314
- this._weeks.push([]);
1315
- cell = 0;
1316
- }
1317
- const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), i + 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
1318
- const enabled = !this.dateFilter || this.dateFilter(date);
1319
- const ariaLabel = this._adapter.format(date, this._dateFormats.display.dateA11yLabel);
1320
- this._weeks[this._weeks.length - 1].push(new MtxCalendarCell(i + 1, dateNames[i], ariaLabel, enabled));
1321
- }
1322
- }
1323
- /**
1324
- * Gets the date in this month that the given Date falls on.
1325
- * Returns null if the given Date is in another month.
1326
- */
1327
- _getDateInCurrentMonth(date) {
1328
- return this._adapter.sameMonthAndYear(date, this.activeDate)
1329
- ? this._adapter.getDate(date)
1330
- : null;
1331
- }
1332
- calendarState(direction) {
1333
- this._calendarState = direction;
1334
- }
1335
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxMonthView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
1336
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: MtxMonthView, selector: "mtx-month-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxMonthView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\">\n <tr>\n <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", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1337
- }
1338
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxMonthView, decorators: [{
1339
- type: Component,
1340
- args: [{ selector: 'mtx-month-view', exportAs: 'mtxMonthView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\">\n <tr>\n <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" }]
1341
- }], ctorParameters: function () { return [{ type: i1.DatetimeAdapter, decorators: [{
1342
- type: Optional
1343
- }] }, { type: undefined, decorators: [{
1344
- type: Optional
1345
- }, {
1346
- type: Inject,
1347
- args: [MTX_DATETIME_FORMATS]
1348
- }] }]; }, propDecorators: { type: [{
1349
- type: Input
1350
- }], dateFilter: [{
1351
- type: Input
1352
- }], selectedChange: [{
1353
- type: Output
1354
- }], _userSelection: [{
1355
- type: Output
1356
- }], activeDate: [{
1357
- type: Input
1358
- }], selected: [{
1359
- type: Input
1360
- }] } });
1361
-
1362
1357
  /**
1363
1358
  * An internal component used to display a single year in the datetimepicker.
1364
1359
  * @docs-private
@@ -1462,20 +1457,20 @@ class MtxYearView {
1462
1457
  }
1463
1458
  return false;
1464
1459
  }
1465
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxYearView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
1466
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: MtxYearView, selector: "mtx-year-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxYearView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [activeCell]=\"_adapter.getMonth(activeDate)\"\n [selectedValue]=\"_selectedMonth!\"\n (selectedValueChange)=\"_monthSelected($event)\"\n [allowDisabledSelection]=\"true\"></tbody>\n</table>\n", dependencies: [{ kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1460
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxYearView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
1461
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0", type: MtxYearView, isStandalone: true, selector: "mtx-year-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxYearView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [activeCell]=\"_adapter.getMonth(activeDate)\"\n [selectedValue]=\"_selectedMonth!\"\n (selectedValueChange)=\"_monthSelected($event)\"\n [allowDisabledSelection]=\"true\"></tbody>\n</table>\n", dependencies: [{ kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1467
1462
  }
1468
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxYearView, decorators: [{
1463
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxYearView, decorators: [{
1469
1464
  type: Component,
1470
- args: [{ selector: 'mtx-year-view', exportAs: 'mtxYearView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [activeCell]=\"_adapter.getMonth(activeDate)\"\n [selectedValue]=\"_selectedMonth!\"\n (selectedValueChange)=\"_monthSelected($event)\"\n [allowDisabledSelection]=\"true\"></tbody>\n</table>\n" }]
1471
- }], ctorParameters: function () { return [{ type: i1.DatetimeAdapter, decorators: [{
1465
+ args: [{ selector: 'mtx-year-view', exportAs: 'mtxYearView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MtxCalendarBody], template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [activeCell]=\"_adapter.getMonth(activeDate)\"\n [selectedValue]=\"_selectedMonth!\"\n (selectedValueChange)=\"_monthSelected($event)\"\n [allowDisabledSelection]=\"true\"></tbody>\n</table>\n" }]
1466
+ }], ctorParameters: () => [{ type: i1.DatetimeAdapter, decorators: [{
1472
1467
  type: Optional
1473
1468
  }] }, { type: undefined, decorators: [{
1474
1469
  type: Optional
1475
1470
  }, {
1476
1471
  type: Inject,
1477
1472
  args: [MTX_DATETIME_FORMATS]
1478
- }] }]; }, propDecorators: { type: [{
1473
+ }] }], propDecorators: { type: [{
1479
1474
  type: Input
1480
1475
  }], dateFilter: [{
1481
1476
  type: Input
@@ -1494,28 +1489,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
1494
1489
  * @docs-private
1495
1490
  */
1496
1491
  class MtxCalendar {
1497
- /** Whether to show multi-year view. */
1498
- get multiYearSelector() {
1499
- return this._multiYearSelector;
1500
- }
1501
- set multiYearSelector(value) {
1502
- this._multiYearSelector = coerceBooleanProperty(value);
1503
- }
1504
- /** Whether the clock uses 12 hour format. */
1505
- get twelvehour() {
1506
- return this._twelvehour;
1507
- }
1508
- set twelvehour(value) {
1509
- this._twelvehour = coerceBooleanProperty(value);
1510
- }
1511
1492
  constructor(_elementRef, _intl, _ngZone, _adapter, _dateFormats, _changeDetectorRef) {
1512
1493
  this._elementRef = _elementRef;
1513
1494
  this._intl = _intl;
1514
1495
  this._ngZone = _ngZone;
1515
1496
  this._adapter = _adapter;
1516
1497
  this._dateFormats = _dateFormats;
1517
- this._multiYearSelector = false;
1518
- this._twelvehour = false;
1498
+ /** Whether to show multi-year view. */
1499
+ this.multiYearSelector = false;
1500
+ /** Whether the clock uses 12 hour format. */
1501
+ this.twelvehour = false;
1519
1502
  /** Whether the calendar should be started in month or year view. */
1520
1503
  this.startView = 'month';
1521
1504
  /** Step over minutes. */
@@ -1529,7 +1512,11 @@ class MtxCalendar {
1529
1512
  this._userSelection = new EventEmitter();
1530
1513
  this._clockView = 'hour';
1531
1514
  this._type = 'date';
1532
- this._timeInput = false;
1515
+ /**
1516
+ * Whether the calendar is in time mode. In time mode the calendar clock gets time input elements
1517
+ * rather then just clock. When touchUi is enabled this will be disabled
1518
+ */
1519
+ this.timeInput = false;
1533
1520
  /** Date filter for the month and year views. */
1534
1521
  this._dateFilterForViews = (date) => {
1535
1522
  return (!!date &&
@@ -1562,16 +1549,6 @@ class MtxCalendar {
1562
1549
  set startAt(value) {
1563
1550
  this._startAt = this._adapter.getValidDateOrNull(value);
1564
1551
  }
1565
- /**
1566
- * Whether the calendar is in time mode. In time mode the calendar clock gets time input elements
1567
- * rather then just clock. When touchUi is enabled this will be disabled
1568
- */
1569
- get timeInput() {
1570
- return this._timeInput;
1571
- }
1572
- set timeInput(value) {
1573
- this._timeInput = coerceBooleanProperty(value);
1574
- }
1575
1552
  /** The currently selected date. */
1576
1553
  get selected() {
1577
1554
  return this._selected;
@@ -2091,28 +2068,38 @@ class MtxCalendar {
2091
2068
  _2digit(n) {
2092
2069
  return ('00' + n).slice(-2);
2093
2070
  }
2094
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxCalendar, deps: [{ token: i0.ElementRef }, { token: MtxDatetimepickerIntl }, { token: i0.NgZone }, { token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
2095
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: MtxCalendar, selector: "mtx-calendar", inputs: { multiYearSelector: "multiYearSelector", twelvehour: "twelvehour", startView: "startView", timeInterval: "timeInterval", dateFilter: "dateFilter", preventSameDateTimeSelection: "preventSameDateTimeSelection", type: "type", startAt: "startAt", timeInput: "timeInput", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", viewChanged: "viewChanged", _userSelection: "_userSelection" }, host: { attributes: { "tabindex": "0" }, listeners: { "keydown": "_handleCalendarBodyKeydown($event)" }, properties: { "class.mtx-calendar-with-time-input": "timeInput" }, classAttribute: "mtx-calendar" }, exportAs: ["mtxCalendar"], ngImport: i0, template: "<div class=\"mtx-calendar-header\">\n <button *ngIf=\"type !== 'time'\"\n mat-button type=\"button\" class=\"mtx-calendar-header-year\"\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\"\n [attr.aria-label]=\"_yearButtonLabel\"\n (click)=\"_yearClicked()\">\n <span>{{ _yearButtonText }}</span>\n <svg *ngIf=\"multiYearSelector || type === 'year'\"\n class=\"mtx-calendar-header-year-dropdown\" matButtonIcon iconPositionEnd\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\n </svg>\n </button>\n <div *ngIf=\"type !== 'year'\" class=\"mtx-calendar-header-date-time\">\n <button *ngIf=\"type !== 'time'\"\n mat-button type=\"button\" class=\"mtx-calendar-header-date\"\n [class.active]=\"currentView === 'month'\"\n [class.not-clickable]=\"type === 'month'\"\n [attr.aria-label]=\"_dateButtonLabel\"\n (click)=\"_dateClicked()\">{{ _dateButtonText }}</button>\n <span *ngIf=\"type.endsWith('time')\" class=\"mtx-calendar-header-time\"\n [class.active]=\"currentView === 'clock'\">\n <span class=\"mtx-calendar-header-hour-minute-container\">\n <button mat-button type=\"button\" class=\"mtx-calendar-header-hours\"\n [class.active]=\"_clockView === 'hour'\"\n [attr.aria-label]=\"_hourButtonLabel\"\n (click)=\"_hoursClicked()\">{{ _hoursButtonText }}</button>\n <span class=\"mtx-calendar-header-hour-minute-separator\">:</span>\n <button mat-button type=\"button\" class=\"mtx-calendar-header-minutes\"\n [class.active]=\"_clockView === 'minute'\"\n [attr.aria-label]=\"_minuteButtonLabel\"\n (click)=\"_minutesClicked()\">{{ _minutesButtonText }}</button>\n </span>\n <span *ngIf=\"twelvehour\" class=\"mtx-calendar-header-ampm-container\">\n <button mat-button type=\"button\" class=\"mtx-calendar-header-ampm\"\n [class.active]=\"_AMPM === 'AM'\" aria-label=\"AM\"\n (click)=\"_ampmClicked('AM')\">AM</button>\n <button mat-button type=\"button\" class=\"mtx-calendar-header-ampm\"\n [class.active]=\"_AMPM === 'PM'\" aria-label=\"PM\"\n (click)=\"_ampmClicked('PM')\">PM</button>\n </span>\n </span>\n </div>\n</div>\n\n<div class=\"mtx-calendar-content\" [ngSwitch]=\"currentView\">\n <div *ngIf=\"currentView === 'month' || currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-month-content\">\n <div class=\"mtx-calendar-controls\">\n <button mat-icon-button type=\"button\"\n class=\"mtx-calendar-previous-button\"\n [class.disabled]=\"!_previousEnabled()\"\n [attr.aria-disabled]=\"!_previousEnabled()\"\n [attr.aria-label]=\"_prevButtonLabel\"\n (click)=\"_previousClicked()\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\n </svg>\n </button>\n <div class=\"mtx-calendar-period-button\"\n [@slideCalendar]=\"_calendarState\"\n (@slideCalendar.done)=\"_calendarStateDone()\">\n <strong>{{ _yearPeriodText }}</strong>\n </div>\n <button mat-icon-button type=\"button\"\n class=\"mtx-calendar-next-button\"\n [class.disabled]=\"!_nextEnabled()\"\n [attr.aria-disabled]=\"!_nextEnabled()\"\n [attr.aria-label]=\"_nextButtonLabel\"\n (click)=\"_nextClicked()\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"></path>\n </svg>\n </button>\n </div>\n </div>\n <mtx-month-view *ngSwitchCase=\"'month'\"\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n <mtx-year-view *ngSwitchCase=\"'year'\"\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n <mtx-multi-year-view *ngSwitchCase=\"'multi-year'\"\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_yearSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-multi-year-view>\n\n <ng-container *ngSwitchDefault>\n <mtx-time *ngIf=\"timeInput; else clock\"\n (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_timeSelected($event)\"\n [AMPM]=\"_AMPM\"\n (ampmChange)=\"_ampmClicked($event)\"\n [clockView]=\"_clockView\"\n (clockViewChange)=\"_clockView = $event\"\n [twelvehour]=\"twelvehour\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\">\n </mtx-time>\n\n <ng-template #clock>\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_dialTimeSelected($event)\"\n [AMPM]=\"_AMPM\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\"\n [startView]=\"_clockView\"\n [twelvehour]=\"twelvehour\">\n </mtx-clock>\n </ng-template>\n </ng-container>\n</div>\n", styles: [".mtx-calendar{display:block;outline:none;font-family:var(--mtx-datetimepicker-calendar-text-font);font-size:var(--mtx-datetimepicker-calendar-text-size)}.mtx-calendar-header{box-sizing:border-box;padding:8px;border-radius:4px 4px 0 0;background-color:var(--mtx-datetimepicker-calendar-header-background-color);color:var(--mtx-datetimepicker-calendar-header-text-color)}.mtx-calendar-header .mtx-calendar-header-year,.mtx-calendar-header .mtx-calendar-header-date,.mtx-calendar-header .mtx-calendar-header-hours,.mtx-calendar-header .mtx-calendar-header-minutes,.mtx-calendar-header .mtx-calendar-header-ampm{height:auto;min-width:auto;padding:0 4px;text-align:inherit;line-height:inherit;color:inherit;font-size:inherit;font-weight:inherit;letter-spacing:normal;white-space:normal;word-break:break-word}.mtx-calendar-header .mtx-calendar-header-year .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-date .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-hours .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-minutes .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-ampm .mat-mdc-button-touch-target{height:100%}.mtx-calendar-header .mtx-calendar-header-year{line-height:24px}.mtx-calendar-header-date-time{font-size:24px;line-height:36px}.mtx-calendar-header-year:not(.active),.mtx-calendar-header-date:not(.active),.mtx-calendar-header-hours:not(.active),.mtx-calendar-header-minutes:not(.active),.mtx-calendar-header-ampm:not(.active){opacity:.6}.mtx-calendar-header-year.not-clickable,.mtx-calendar-header-date.not-clickable,.mtx-calendar-header-hours.not-clickable,.mtx-calendar-header-minutes.not-clickable,.mtx-calendar-header-ampm.not-clickable{cursor:initial}.mtx-calendar-header-time{display:inline-flex}.mtx-calendar-header-time:not(.active){opacity:.6}.mtx-calendar-header-time:not(.active) .mtx-calendar-header-hours,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-minutes,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-ampm{opacity:1}.mtx-calendar-header-hour-minute-separator{display:inline-block;width:8px;text-align:center}.mtx-calendar-header-ampm-container{display:inline-flex;flex-direction:column;line-height:18px;font-size:12px}[mode=landscape] .mtx-calendar{display:flex}[mode=landscape] .mtx-calendar .mtx-calendar-header{width:144px;min-width:144px;padding:16px 8px;border-radius:4px 0 0 4px}[dir=rtl] [mode=landscape] .mtx-calendar .mtx-calendar-header{border-radius:0 4px 4px 0}[mode=landscape] .mtx-calendar .mtx-calendar-header-year+.mtx-calendar-header-date-time,[mode=landscape] .mtx-calendar .mtx-calendar-header-date+.mtx-calendar-header-time{margin-top:4px}[mode=landscape] .mtx-calendar .mtx-calendar-header-date-time{font-size:28px}[mode=landscape] .mtx-calendar .mtx-calendar-header-time{display:flex;flex-direction:column}[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-hours,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{width:40px;text-align:center}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm-container{flex-direction:row;font-size:20px}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm{padding:4px}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm+.mtx-calendar-header-ampm{margin:0 8px}@media all and (orientation: landscape){[mode=auto] .mtx-calendar{display:flex}[mode=auto] .mtx-calendar .mtx-calendar-header{width:144px;min-width:144px;padding:16px 8px;border-radius:4px 0 0 4px}[dir=rtl] [mode=auto] .mtx-calendar .mtx-calendar-header{border-radius:0 4px 4px 0}[mode=auto] .mtx-calendar .mtx-calendar-header-year+.mtx-calendar-header-date-time,[mode=auto] .mtx-calendar .mtx-calendar-header-date+.mtx-calendar-header-time{margin-top:4px}[mode=auto] .mtx-calendar .mtx-calendar-header-date-time{font-size:28px}[mode=auto] .mtx-calendar .mtx-calendar-header-time{display:flex;flex-direction:column}[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-hours,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{width:40px;text-align:center}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm-container{flex-direction:row;font-size:20px}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm{padding:4px}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm+.mtx-calendar-header-ampm{margin:0 8px}}.mtx-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.mtx-calendar-controls{display:flex;align-items:center;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.mtx-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mtx-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:transparent;box-sizing:border-box;font-size:var(--mtx-datetimepicker-calendar-period-button-text-size);font-weight:var(--mtx-datetimepicker-calendar-period-button-text-weight)}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none;color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0;color:var(--mtx-datetimepicker-calendar-table-header-text-color);font-size:var(--mtx-datetimepicker-calendar-table-header-text-size);font-weight:var(--mtx-datetimepicker-calendar-table-header-text-weight)}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: MtxClock, selector: "mtx-clock", inputs: ["dateFilter", "interval", "twelvehour", "AMPM", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["selectedChange", "activeDateChange", "_userSelection"], exportAs: ["mtxClock"] }, { kind: "component", type: MtxTime, selector: "mtx-time", inputs: ["dateFilter", "interval", "twelvehour", "AMPM", "activeDate", "selected", "minDate", "maxDate", "clockView"], outputs: ["selectedChange", "activeDateChange", "_userSelection", "ampmChange", "clockViewChange"], exportAs: ["mtxTime"] }, { kind: "component", type: MtxMonthView, selector: "mtx-month-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxMonthView"] }, { kind: "component", type: MtxYearView, selector: "mtx-year-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxYearView"] }, { kind: "component", type: MtxMultiYearView, selector: "mtx-multi-year-view", inputs: ["type", "dateFilter", "activeDate", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxMultiYearView"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
2071
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxCalendar, deps: [{ token: i0.ElementRef }, { token: MtxDatetimepickerIntl }, { token: i0.NgZone }, { token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
2072
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0", type: MtxCalendar, isStandalone: true, selector: "mtx-calendar", inputs: { multiYearSelector: ["multiYearSelector", "multiYearSelector", booleanAttribute], twelvehour: ["twelvehour", "twelvehour", booleanAttribute], startView: "startView", timeInterval: "timeInterval", dateFilter: "dateFilter", preventSameDateTimeSelection: "preventSameDateTimeSelection", type: "type", startAt: "startAt", timeInput: ["timeInput", "timeInput", booleanAttribute], selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", viewChanged: "viewChanged", _userSelection: "_userSelection" }, host: { attributes: { "tabindex": "0" }, listeners: { "keydown": "_handleCalendarBodyKeydown($event)" }, properties: { "class.mtx-calendar-with-time-input": "timeInput" }, classAttribute: "mtx-calendar" }, exportAs: ["mtxCalendar"], ngImport: i0, template: "<div class=\"mtx-calendar-header\">\n @if (type !== 'time') {\n <button\n mat-button type=\"button\" class=\"mtx-calendar-header-year\"\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\"\n [attr.aria-label]=\"_yearButtonLabel\"\n (click)=\"_yearClicked()\">\n <span>{{ _yearButtonText }}</span>\n @if (multiYearSelector || type === 'year') {\n <svg\n class=\"mtx-calendar-header-year-dropdown\" matButtonIcon iconPositionEnd\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\" />\n </svg>\n }\n </button>\n }\n @if (type !== 'year') {\n <div class=\"mtx-calendar-header-date-time\">\n @if (type !== 'time') {\n <button\n mat-button type=\"button\" class=\"mtx-calendar-header-date\"\n [class.active]=\"currentView === 'month'\"\n [class.not-clickable]=\"type === 'month'\"\n [attr.aria-label]=\"_dateButtonLabel\"\n (click)=\"_dateClicked()\">{{ _dateButtonText }}</button>\n }\n @if (type.endsWith('time')) {\n <span class=\"mtx-calendar-header-time\" [class.active]=\"currentView === 'clock'\">\n <span class=\"mtx-calendar-header-hour-minute-container\">\n <button mat-button type=\"button\" class=\"mtx-calendar-header-hours\"\n [class.active]=\"_clockView === 'hour'\"\n [attr.aria-label]=\"_hourButtonLabel\"\n (click)=\"_hoursClicked()\">{{ _hoursButtonText }}</button>\n <span class=\"mtx-calendar-header-hour-minute-separator\">:</span>\n <button mat-button type=\"button\" class=\"mtx-calendar-header-minutes\"\n [class.active]=\"_clockView === 'minute'\"\n [attr.aria-label]=\"_minuteButtonLabel\"\n (click)=\"_minutesClicked()\">{{ _minutesButtonText }}</button>\n </span>\n @if (twelvehour) {\n <span class=\"mtx-calendar-header-ampm-container\">\n <button mat-button type=\"button\" class=\"mtx-calendar-header-ampm\"\n [class.active]=\"_AMPM === 'AM'\" aria-label=\"AM\"\n (click)=\"_ampmClicked('AM')\">AM</button>\n <button mat-button type=\"button\" class=\"mtx-calendar-header-ampm\"\n [class.active]=\"_AMPM === 'PM'\" aria-label=\"PM\"\n (click)=\"_ampmClicked('PM')\">PM</button>\n </span>\n }\n </span>\n }\n </div>\n }\n</div>\n\n<div class=\"mtx-calendar-content\">\n @if (currentView === 'month' || currentView === 'year' || currentView === 'multi-year') {\n <div class=\"mtx-month-content\">\n <div class=\"mtx-calendar-controls\">\n <button mat-icon-button type=\"button\"\n class=\"mtx-calendar-previous-button\"\n [class.disabled]=\"!_previousEnabled()\"\n [attr.aria-disabled]=\"!_previousEnabled()\"\n [attr.aria-label]=\"_prevButtonLabel\"\n (click)=\"_previousClicked()\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\" />\n </svg>\n </button>\n <div class=\"mtx-calendar-period-button\"\n [@slideCalendar]=\"_calendarState\"\n (@slideCalendar.done)=\"_calendarStateDone()\">\n <strong>{{ _yearPeriodText }}</strong>\n </div>\n <button mat-icon-button type=\"button\"\n class=\"mtx-calendar-next-button\"\n [class.disabled]=\"!_nextEnabled()\"\n [attr.aria-disabled]=\"!_nextEnabled()\"\n [attr.aria-label]=\"_nextButtonLabel\"\n (click)=\"_nextClicked()\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\" />\n </svg>\n </button>\n </div>\n </div>\n }\n\n @switch (currentView) {\n @case ('month') {\n <mtx-month-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n }\n @case ('year') {\n <mtx-year-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n }\n @case ('multi-year') {\n <mtx-multi-year-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_yearSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-multi-year-view>\n }\n @default {\n @if (timeInput) {\n <mtx-time\n (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_timeSelected($event)\"\n [AMPM]=\"_AMPM\"\n (ampmChange)=\"_ampmClicked($event)\"\n [clockView]=\"_clockView\"\n (clockViewChange)=\"_clockView = $event\"\n [twelvehour]=\"twelvehour\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\">\n </mtx-time>\n } @else {\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_dialTimeSelected($event)\"\n [AMPM]=\"_AMPM\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\"\n [startView]=\"_clockView\"\n [twelvehour]=\"twelvehour\">\n </mtx-clock>\n }\n }\n }\n</div>\n", styles: [".mtx-calendar{display:block;outline:none;font-family:var(--mtx-datetimepicker-calendar-text-font);font-size:var(--mtx-datetimepicker-calendar-text-size)}.mtx-calendar-header{box-sizing:border-box;padding:8px;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-top-right-radius:var(--mtx-datetimepicker-container-shape);background-color:var(--mtx-datetimepicker-calendar-header-background-color);color:var(--mtx-datetimepicker-calendar-header-text-color)}.mtx-calendar-header .mtx-calendar-header-year,.mtx-calendar-header .mtx-calendar-header-date,.mtx-calendar-header .mtx-calendar-header-hours,.mtx-calendar-header .mtx-calendar-header-minutes,.mtx-calendar-header .mtx-calendar-header-ampm{height:auto;min-width:auto;padding:0 4px;text-align:inherit;line-height:inherit;color:inherit;font-size:inherit;font-weight:inherit;letter-spacing:normal;white-space:normal;word-break:break-word}.mtx-calendar-header .mtx-calendar-header-year .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-date .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-hours .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-minutes .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-ampm .mat-mdc-button-touch-target{height:100%}.mtx-calendar-header .mtx-calendar-header-year{line-height:24px}.mtx-calendar-header-date-time{font-size:24px;line-height:36px}.mtx-calendar-header-year:not(.active),.mtx-calendar-header-date:not(.active),.mtx-calendar-header-hours:not(.active),.mtx-calendar-header-minutes:not(.active),.mtx-calendar-header-ampm:not(.active){opacity:.6}.mtx-calendar-header-year.not-clickable,.mtx-calendar-header-date.not-clickable,.mtx-calendar-header-hours.not-clickable,.mtx-calendar-header-minutes.not-clickable,.mtx-calendar-header-ampm.not-clickable{cursor:initial}.mtx-calendar-header-time{display:inline-flex}.mtx-calendar-header-time:not(.active){opacity:.6}.mtx-calendar-header-time:not(.active) .mtx-calendar-header-hours,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-minutes,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-ampm{opacity:1}.mtx-calendar-header-hour-minute-separator{display:inline-block;width:8px;text-align:center}.mtx-calendar-header-ampm-container{display:inline-flex;flex-direction:column;line-height:18px;font-size:12px}[mode=landscape] .mtx-calendar{display:flex}[mode=landscape] .mtx-calendar .mtx-calendar-header{width:144px;min-width:144px;padding:16px 8px;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-bottom-left-radius:var(--mtx-datetimepicker-container-shape)}[dir=rtl] [mode=landscape] .mtx-calendar .mtx-calendar-header{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mtx-datetimepicker-container-shape);border-bottom-right-radius:var(--mtx-datetimepicker-container-shape)}[mode=landscape] .mtx-calendar .mtx-calendar-header-year+.mtx-calendar-header-date-time,[mode=landscape] .mtx-calendar .mtx-calendar-header-date+.mtx-calendar-header-time{margin-top:4px}[mode=landscape] .mtx-calendar .mtx-calendar-header-date-time{font-size:28px}[mode=landscape] .mtx-calendar .mtx-calendar-header-time{display:flex;flex-direction:column}[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-hours,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{width:40px;text-align:center}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm-container{flex-direction:row;font-size:20px}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm{padding:4px}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm+.mtx-calendar-header-ampm{margin:0 8px}@media all and (orientation: landscape){[mode=auto] .mtx-calendar{display:flex}[mode=auto] .mtx-calendar .mtx-calendar-header{width:144px;min-width:144px;padding:16px 8px;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-bottom-left-radius:var(--mtx-datetimepicker-container-shape)}[dir=rtl] [mode=auto] .mtx-calendar .mtx-calendar-header{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mtx-datetimepicker-container-shape);border-bottom-right-radius:var(--mtx-datetimepicker-container-shape)}[mode=auto] .mtx-calendar .mtx-calendar-header-year+.mtx-calendar-header-date-time,[mode=auto] .mtx-calendar .mtx-calendar-header-date+.mtx-calendar-header-time{margin-top:4px}[mode=auto] .mtx-calendar .mtx-calendar-header-date-time{font-size:28px}[mode=auto] .mtx-calendar .mtx-calendar-header-time{display:flex;flex-direction:column}[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-hours,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{width:40px;text-align:center}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm-container{flex-direction:row;font-size:20px}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm{padding:4px}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm+.mtx-calendar-header-ampm{margin:0 8px}}.mtx-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.mtx-calendar-controls{display:flex;align-items:center;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.mtx-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mtx-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:transparent;box-sizing:border-box;font-size:var(--mtx-datetimepicker-calendar-period-button-text-size);font-weight:var(--mtx-datetimepicker-calendar-period-button-text-weight)}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none;color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0;color:var(--mtx-datetimepicker-calendar-table-header-text-color);font-size:var(--mtx-datetimepicker-calendar-table-header-text-size);font-weight:var(--mtx-datetimepicker-calendar-table-header-text-weight)}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MtxMonthView, selector: "mtx-month-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxMonthView"] }, { kind: "component", type: MtxYearView, selector: "mtx-year-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxYearView"] }, { kind: "component", type: MtxMultiYearView, selector: "mtx-multi-year-view", inputs: ["type", "dateFilter", "activeDate", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxMultiYearView"] }, { kind: "component", type: MtxTime, selector: "mtx-time", inputs: ["dateFilter", "interval", "twelvehour", "AMPM", "activeDate", "selected", "minDate", "maxDate", "clockView"], outputs: ["selectedChange", "activeDateChange", "_userSelection", "ampmChange", "clockViewChange"], exportAs: ["mtxTime"] }, { kind: "component", type: MtxClock, selector: "mtx-clock", inputs: ["dateFilter", "interval", "twelvehour", "AMPM", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["selectedChange", "activeDateChange", "_userSelection"], exportAs: ["mtxClock"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
2096
2073
  }
2097
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxCalendar, decorators: [{
2074
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxCalendar, decorators: [{
2098
2075
  type: Component,
2099
2076
  args: [{ selector: 'mtx-calendar', host: {
2100
2077
  'class': 'mtx-calendar',
2101
2078
  '[class.mtx-calendar-with-time-input]': 'timeInput',
2102
2079
  'tabindex': '0',
2103
2080
  '(keydown)': '_handleCalendarBodyKeydown($event)',
2104
- }, exportAs: 'mtxCalendar', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mtx-calendar-header\">\n <button *ngIf=\"type !== 'time'\"\n mat-button type=\"button\" class=\"mtx-calendar-header-year\"\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\"\n [attr.aria-label]=\"_yearButtonLabel\"\n (click)=\"_yearClicked()\">\n <span>{{ _yearButtonText }}</span>\n <svg *ngIf=\"multiYearSelector || type === 'year'\"\n class=\"mtx-calendar-header-year-dropdown\" matButtonIcon iconPositionEnd\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\n </svg>\n </button>\n <div *ngIf=\"type !== 'year'\" class=\"mtx-calendar-header-date-time\">\n <button *ngIf=\"type !== 'time'\"\n mat-button type=\"button\" class=\"mtx-calendar-header-date\"\n [class.active]=\"currentView === 'month'\"\n [class.not-clickable]=\"type === 'month'\"\n [attr.aria-label]=\"_dateButtonLabel\"\n (click)=\"_dateClicked()\">{{ _dateButtonText }}</button>\n <span *ngIf=\"type.endsWith('time')\" class=\"mtx-calendar-header-time\"\n [class.active]=\"currentView === 'clock'\">\n <span class=\"mtx-calendar-header-hour-minute-container\">\n <button mat-button type=\"button\" class=\"mtx-calendar-header-hours\"\n [class.active]=\"_clockView === 'hour'\"\n [attr.aria-label]=\"_hourButtonLabel\"\n (click)=\"_hoursClicked()\">{{ _hoursButtonText }}</button>\n <span class=\"mtx-calendar-header-hour-minute-separator\">:</span>\n <button mat-button type=\"button\" class=\"mtx-calendar-header-minutes\"\n [class.active]=\"_clockView === 'minute'\"\n [attr.aria-label]=\"_minuteButtonLabel\"\n (click)=\"_minutesClicked()\">{{ _minutesButtonText }}</button>\n </span>\n <span *ngIf=\"twelvehour\" class=\"mtx-calendar-header-ampm-container\">\n <button mat-button type=\"button\" class=\"mtx-calendar-header-ampm\"\n [class.active]=\"_AMPM === 'AM'\" aria-label=\"AM\"\n (click)=\"_ampmClicked('AM')\">AM</button>\n <button mat-button type=\"button\" class=\"mtx-calendar-header-ampm\"\n [class.active]=\"_AMPM === 'PM'\" aria-label=\"PM\"\n (click)=\"_ampmClicked('PM')\">PM</button>\n </span>\n </span>\n </div>\n</div>\n\n<div class=\"mtx-calendar-content\" [ngSwitch]=\"currentView\">\n <div *ngIf=\"currentView === 'month' || currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-month-content\">\n <div class=\"mtx-calendar-controls\">\n <button mat-icon-button type=\"button\"\n class=\"mtx-calendar-previous-button\"\n [class.disabled]=\"!_previousEnabled()\"\n [attr.aria-disabled]=\"!_previousEnabled()\"\n [attr.aria-label]=\"_prevButtonLabel\"\n (click)=\"_previousClicked()\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\n </svg>\n </button>\n <div class=\"mtx-calendar-period-button\"\n [@slideCalendar]=\"_calendarState\"\n (@slideCalendar.done)=\"_calendarStateDone()\">\n <strong>{{ _yearPeriodText }}</strong>\n </div>\n <button mat-icon-button type=\"button\"\n class=\"mtx-calendar-next-button\"\n [class.disabled]=\"!_nextEnabled()\"\n [attr.aria-disabled]=\"!_nextEnabled()\"\n [attr.aria-label]=\"_nextButtonLabel\"\n (click)=\"_nextClicked()\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"></path>\n </svg>\n </button>\n </div>\n </div>\n <mtx-month-view *ngSwitchCase=\"'month'\"\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n <mtx-year-view *ngSwitchCase=\"'year'\"\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n <mtx-multi-year-view *ngSwitchCase=\"'multi-year'\"\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_yearSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-multi-year-view>\n\n <ng-container *ngSwitchDefault>\n <mtx-time *ngIf=\"timeInput; else clock\"\n (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_timeSelected($event)\"\n [AMPM]=\"_AMPM\"\n (ampmChange)=\"_ampmClicked($event)\"\n [clockView]=\"_clockView\"\n (clockViewChange)=\"_clockView = $event\"\n [twelvehour]=\"twelvehour\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\">\n </mtx-time>\n\n <ng-template #clock>\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_dialTimeSelected($event)\"\n [AMPM]=\"_AMPM\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\"\n [startView]=\"_clockView\"\n [twelvehour]=\"twelvehour\">\n </mtx-clock>\n </ng-template>\n </ng-container>\n</div>\n", styles: [".mtx-calendar{display:block;outline:none;font-family:var(--mtx-datetimepicker-calendar-text-font);font-size:var(--mtx-datetimepicker-calendar-text-size)}.mtx-calendar-header{box-sizing:border-box;padding:8px;border-radius:4px 4px 0 0;background-color:var(--mtx-datetimepicker-calendar-header-background-color);color:var(--mtx-datetimepicker-calendar-header-text-color)}.mtx-calendar-header .mtx-calendar-header-year,.mtx-calendar-header .mtx-calendar-header-date,.mtx-calendar-header .mtx-calendar-header-hours,.mtx-calendar-header .mtx-calendar-header-minutes,.mtx-calendar-header .mtx-calendar-header-ampm{height:auto;min-width:auto;padding:0 4px;text-align:inherit;line-height:inherit;color:inherit;font-size:inherit;font-weight:inherit;letter-spacing:normal;white-space:normal;word-break:break-word}.mtx-calendar-header .mtx-calendar-header-year .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-date .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-hours .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-minutes .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-ampm .mat-mdc-button-touch-target{height:100%}.mtx-calendar-header .mtx-calendar-header-year{line-height:24px}.mtx-calendar-header-date-time{font-size:24px;line-height:36px}.mtx-calendar-header-year:not(.active),.mtx-calendar-header-date:not(.active),.mtx-calendar-header-hours:not(.active),.mtx-calendar-header-minutes:not(.active),.mtx-calendar-header-ampm:not(.active){opacity:.6}.mtx-calendar-header-year.not-clickable,.mtx-calendar-header-date.not-clickable,.mtx-calendar-header-hours.not-clickable,.mtx-calendar-header-minutes.not-clickable,.mtx-calendar-header-ampm.not-clickable{cursor:initial}.mtx-calendar-header-time{display:inline-flex}.mtx-calendar-header-time:not(.active){opacity:.6}.mtx-calendar-header-time:not(.active) .mtx-calendar-header-hours,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-minutes,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-ampm{opacity:1}.mtx-calendar-header-hour-minute-separator{display:inline-block;width:8px;text-align:center}.mtx-calendar-header-ampm-container{display:inline-flex;flex-direction:column;line-height:18px;font-size:12px}[mode=landscape] .mtx-calendar{display:flex}[mode=landscape] .mtx-calendar .mtx-calendar-header{width:144px;min-width:144px;padding:16px 8px;border-radius:4px 0 0 4px}[dir=rtl] [mode=landscape] .mtx-calendar .mtx-calendar-header{border-radius:0 4px 4px 0}[mode=landscape] .mtx-calendar .mtx-calendar-header-year+.mtx-calendar-header-date-time,[mode=landscape] .mtx-calendar .mtx-calendar-header-date+.mtx-calendar-header-time{margin-top:4px}[mode=landscape] .mtx-calendar .mtx-calendar-header-date-time{font-size:28px}[mode=landscape] .mtx-calendar .mtx-calendar-header-time{display:flex;flex-direction:column}[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-hours,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{width:40px;text-align:center}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm-container{flex-direction:row;font-size:20px}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm{padding:4px}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm+.mtx-calendar-header-ampm{margin:0 8px}@media all and (orientation: landscape){[mode=auto] .mtx-calendar{display:flex}[mode=auto] .mtx-calendar .mtx-calendar-header{width:144px;min-width:144px;padding:16px 8px;border-radius:4px 0 0 4px}[dir=rtl] [mode=auto] .mtx-calendar .mtx-calendar-header{border-radius:0 4px 4px 0}[mode=auto] .mtx-calendar .mtx-calendar-header-year+.mtx-calendar-header-date-time,[mode=auto] .mtx-calendar .mtx-calendar-header-date+.mtx-calendar-header-time{margin-top:4px}[mode=auto] .mtx-calendar .mtx-calendar-header-date-time{font-size:28px}[mode=auto] .mtx-calendar .mtx-calendar-header-time{display:flex;flex-direction:column}[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-hours,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{width:40px;text-align:center}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm-container{flex-direction:row;font-size:20px}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm{padding:4px}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm+.mtx-calendar-header-ampm{margin:0 8px}}.mtx-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.mtx-calendar-controls{display:flex;align-items:center;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.mtx-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mtx-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:transparent;box-sizing:border-box;font-size:var(--mtx-datetimepicker-calendar-period-button-text-size);font-weight:var(--mtx-datetimepicker-calendar-period-button-text-weight)}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none;color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0;color:var(--mtx-datetimepicker-calendar-table-header-text-color);font-size:var(--mtx-datetimepicker-calendar-table-header-text-size);font-weight:var(--mtx-datetimepicker-calendar-table-header-text-weight)}\n"] }]
2105
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MtxDatetimepickerIntl }, { type: i0.NgZone }, { type: i1.DatetimeAdapter, decorators: [{
2081
+ }, exportAs: 'mtxCalendar', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
2082
+ MatButton,
2083
+ MatIconButton,
2084
+ MtxMonthView,
2085
+ MtxYearView,
2086
+ MtxMultiYearView,
2087
+ MtxTime,
2088
+ MtxClock,
2089
+ ], template: "<div class=\"mtx-calendar-header\">\n @if (type !== 'time') {\n <button\n mat-button type=\"button\" class=\"mtx-calendar-header-year\"\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\"\n [attr.aria-label]=\"_yearButtonLabel\"\n (click)=\"_yearClicked()\">\n <span>{{ _yearButtonText }}</span>\n @if (multiYearSelector || type === 'year') {\n <svg\n class=\"mtx-calendar-header-year-dropdown\" matButtonIcon iconPositionEnd\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\" />\n </svg>\n }\n </button>\n }\n @if (type !== 'year') {\n <div class=\"mtx-calendar-header-date-time\">\n @if (type !== 'time') {\n <button\n mat-button type=\"button\" class=\"mtx-calendar-header-date\"\n [class.active]=\"currentView === 'month'\"\n [class.not-clickable]=\"type === 'month'\"\n [attr.aria-label]=\"_dateButtonLabel\"\n (click)=\"_dateClicked()\">{{ _dateButtonText }}</button>\n }\n @if (type.endsWith('time')) {\n <span class=\"mtx-calendar-header-time\" [class.active]=\"currentView === 'clock'\">\n <span class=\"mtx-calendar-header-hour-minute-container\">\n <button mat-button type=\"button\" class=\"mtx-calendar-header-hours\"\n [class.active]=\"_clockView === 'hour'\"\n [attr.aria-label]=\"_hourButtonLabel\"\n (click)=\"_hoursClicked()\">{{ _hoursButtonText }}</button>\n <span class=\"mtx-calendar-header-hour-minute-separator\">:</span>\n <button mat-button type=\"button\" class=\"mtx-calendar-header-minutes\"\n [class.active]=\"_clockView === 'minute'\"\n [attr.aria-label]=\"_minuteButtonLabel\"\n (click)=\"_minutesClicked()\">{{ _minutesButtonText }}</button>\n </span>\n @if (twelvehour) {\n <span class=\"mtx-calendar-header-ampm-container\">\n <button mat-button type=\"button\" class=\"mtx-calendar-header-ampm\"\n [class.active]=\"_AMPM === 'AM'\" aria-label=\"AM\"\n (click)=\"_ampmClicked('AM')\">AM</button>\n <button mat-button type=\"button\" class=\"mtx-calendar-header-ampm\"\n [class.active]=\"_AMPM === 'PM'\" aria-label=\"PM\"\n (click)=\"_ampmClicked('PM')\">PM</button>\n </span>\n }\n </span>\n }\n </div>\n }\n</div>\n\n<div class=\"mtx-calendar-content\">\n @if (currentView === 'month' || currentView === 'year' || currentView === 'multi-year') {\n <div class=\"mtx-month-content\">\n <div class=\"mtx-calendar-controls\">\n <button mat-icon-button type=\"button\"\n class=\"mtx-calendar-previous-button\"\n [class.disabled]=\"!_previousEnabled()\"\n [attr.aria-disabled]=\"!_previousEnabled()\"\n [attr.aria-label]=\"_prevButtonLabel\"\n (click)=\"_previousClicked()\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\" />\n </svg>\n </button>\n <div class=\"mtx-calendar-period-button\"\n [@slideCalendar]=\"_calendarState\"\n (@slideCalendar.done)=\"_calendarStateDone()\">\n <strong>{{ _yearPeriodText }}</strong>\n </div>\n <button mat-icon-button type=\"button\"\n class=\"mtx-calendar-next-button\"\n [class.disabled]=\"!_nextEnabled()\"\n [attr.aria-disabled]=\"!_nextEnabled()\"\n [attr.aria-label]=\"_nextButtonLabel\"\n (click)=\"_nextClicked()\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\" />\n </svg>\n </button>\n </div>\n </div>\n }\n\n @switch (currentView) {\n @case ('month') {\n <mtx-month-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n }\n @case ('year') {\n <mtx-year-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n }\n @case ('multi-year') {\n <mtx-multi-year-view\n (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_yearSelected($event)\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-multi-year-view>\n }\n @default {\n @if (timeInput) {\n <mtx-time\n (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_timeSelected($event)\"\n [AMPM]=\"_AMPM\"\n (ampmChange)=\"_ampmClicked($event)\"\n [clockView]=\"_clockView\"\n (clockViewChange)=\"_clockView = $event\"\n [twelvehour]=\"twelvehour\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\">\n </mtx-time>\n } @else {\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_dialTimeSelected($event)\"\n [AMPM]=\"_AMPM\"\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\"\n [startView]=\"_clockView\"\n [twelvehour]=\"twelvehour\">\n </mtx-clock>\n }\n }\n }\n</div>\n", styles: [".mtx-calendar{display:block;outline:none;font-family:var(--mtx-datetimepicker-calendar-text-font);font-size:var(--mtx-datetimepicker-calendar-text-size)}.mtx-calendar-header{box-sizing:border-box;padding:8px;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-top-right-radius:var(--mtx-datetimepicker-container-shape);background-color:var(--mtx-datetimepicker-calendar-header-background-color);color:var(--mtx-datetimepicker-calendar-header-text-color)}.mtx-calendar-header .mtx-calendar-header-year,.mtx-calendar-header .mtx-calendar-header-date,.mtx-calendar-header .mtx-calendar-header-hours,.mtx-calendar-header .mtx-calendar-header-minutes,.mtx-calendar-header .mtx-calendar-header-ampm{height:auto;min-width:auto;padding:0 4px;text-align:inherit;line-height:inherit;color:inherit;font-size:inherit;font-weight:inherit;letter-spacing:normal;white-space:normal;word-break:break-word}.mtx-calendar-header .mtx-calendar-header-year .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-date .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-hours .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-minutes .mat-mdc-button-touch-target,.mtx-calendar-header .mtx-calendar-header-ampm .mat-mdc-button-touch-target{height:100%}.mtx-calendar-header .mtx-calendar-header-year{line-height:24px}.mtx-calendar-header-date-time{font-size:24px;line-height:36px}.mtx-calendar-header-year:not(.active),.mtx-calendar-header-date:not(.active),.mtx-calendar-header-hours:not(.active),.mtx-calendar-header-minutes:not(.active),.mtx-calendar-header-ampm:not(.active){opacity:.6}.mtx-calendar-header-year.not-clickable,.mtx-calendar-header-date.not-clickable,.mtx-calendar-header-hours.not-clickable,.mtx-calendar-header-minutes.not-clickable,.mtx-calendar-header-ampm.not-clickable{cursor:initial}.mtx-calendar-header-time{display:inline-flex}.mtx-calendar-header-time:not(.active){opacity:.6}.mtx-calendar-header-time:not(.active) .mtx-calendar-header-hours,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-minutes,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-ampm{opacity:1}.mtx-calendar-header-hour-minute-separator{display:inline-block;width:8px;text-align:center}.mtx-calendar-header-ampm-container{display:inline-flex;flex-direction:column;line-height:18px;font-size:12px}[mode=landscape] .mtx-calendar{display:flex}[mode=landscape] .mtx-calendar .mtx-calendar-header{width:144px;min-width:144px;padding:16px 8px;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-bottom-left-radius:var(--mtx-datetimepicker-container-shape)}[dir=rtl] [mode=landscape] .mtx-calendar .mtx-calendar-header{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mtx-datetimepicker-container-shape);border-bottom-right-radius:var(--mtx-datetimepicker-container-shape)}[mode=landscape] .mtx-calendar .mtx-calendar-header-year+.mtx-calendar-header-date-time,[mode=landscape] .mtx-calendar .mtx-calendar-header-date+.mtx-calendar-header-time{margin-top:4px}[mode=landscape] .mtx-calendar .mtx-calendar-header-date-time{font-size:28px}[mode=landscape] .mtx-calendar .mtx-calendar-header-time{display:flex;flex-direction:column}[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-hours,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=landscape] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{width:40px;text-align:center}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm-container{flex-direction:row;font-size:20px}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm{padding:4px}[mode=landscape] .mtx-calendar .mtx-calendar-header-ampm+.mtx-calendar-header-ampm{margin:0 8px}@media all and (orientation: landscape){[mode=auto] .mtx-calendar{display:flex}[mode=auto] .mtx-calendar .mtx-calendar-header{width:144px;min-width:144px;padding:16px 8px;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mtx-datetimepicker-container-shape);border-bottom-left-radius:var(--mtx-datetimepicker-container-shape)}[dir=rtl] [mode=auto] .mtx-calendar .mtx-calendar-header{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mtx-datetimepicker-container-shape);border-bottom-right-radius:var(--mtx-datetimepicker-container-shape)}[mode=auto] .mtx-calendar .mtx-calendar-header-year+.mtx-calendar-header-date-time,[mode=auto] .mtx-calendar .mtx-calendar-header-date+.mtx-calendar-header-time{margin-top:4px}[mode=auto] .mtx-calendar .mtx-calendar-header-date-time{font-size:28px}[mode=auto] .mtx-calendar .mtx-calendar-header-time{display:flex;flex-direction:column}[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-hours,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-minutes,[mode=auto] .mtx-calendar .mtx-calendar-header-time .mtx-calendar-header-ampm{width:40px;text-align:center}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm-container{flex-direction:row;font-size:20px}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm{padding:4px}[mode=auto] .mtx-calendar .mtx-calendar-header-ampm+.mtx-calendar-header-ampm{margin:0 8px}}.mtx-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.mtx-calendar-controls{display:flex;align-items:center;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.mtx-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mtx-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:transparent;box-sizing:border-box;font-size:var(--mtx-datetimepicker-calendar-period-button-text-size);font-weight:var(--mtx-datetimepicker-calendar-period-button-text-weight)}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none;color:var(--mtx-datetimepicker-calendar-date-disabled-state-text-color)}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0;color:var(--mtx-datetimepicker-calendar-table-header-text-color);font-size:var(--mtx-datetimepicker-calendar-table-header-text-size);font-weight:var(--mtx-datetimepicker-calendar-table-header-text-weight)}\n"] }]
2090
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: MtxDatetimepickerIntl }, { type: i0.NgZone }, { type: i1.DatetimeAdapter, decorators: [{
2106
2091
  type: Optional
2107
2092
  }] }, { type: undefined, decorators: [{
2108
2093
  type: Optional
2109
2094
  }, {
2110
2095
  type: Inject,
2111
2096
  args: [MTX_DATETIME_FORMATS]
2112
- }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { multiYearSelector: [{
2113
- type: Input
2097
+ }] }, { type: i0.ChangeDetectorRef }], propDecorators: { multiYearSelector: [{
2098
+ type: Input,
2099
+ args: [{ transform: booleanAttribute }]
2114
2100
  }], twelvehour: [{
2115
- type: Input
2101
+ type: Input,
2102
+ args: [{ transform: booleanAttribute }]
2116
2103
  }], startView: [{
2117
2104
  type: Input
2118
2105
  }], timeInterval: [{
@@ -2132,7 +2119,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
2132
2119
  }], startAt: [{
2133
2120
  type: Input
2134
2121
  }], timeInput: [{
2135
- type: Input
2122
+ type: Input,
2123
+ args: [{ transform: booleanAttribute }]
2136
2124
  }], selected: [{
2137
2125
  type: Input
2138
2126
  }], minDate: [{
@@ -2144,7 +2132,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
2144
2132
  /** Used to generate a unique ID for each datetimepicker instance. */
2145
2133
  let datetimepickerUid = 0;
2146
2134
  /** Injection token that determines the scroll handling while the calendar is open. */
2147
- const MTX_DATETIMEPICKER_SCROLL_STRATEGY = new InjectionToken('mtx-datetimepicker-scroll-strategy');
2135
+ const MTX_DATETIMEPICKER_SCROLL_STRATEGY = new InjectionToken('mtx-datetimepicker-scroll-strategy', {
2136
+ providedIn: 'root',
2137
+ factory: () => {
2138
+ const overlay = inject(Overlay);
2139
+ return () => overlay.scrollStrategies.reposition();
2140
+ },
2141
+ });
2148
2142
  function MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY(overlay) {
2149
2143
  return () => overlay.scrollStrategies.reposition();
2150
2144
  }
@@ -2189,13 +2183,13 @@ class MtxDatetimepickerContent extends _MtxDatetimepickerContentBase {
2189
2183
  ngOnDestroy() {
2190
2184
  this._animationDone.complete();
2191
2185
  }
2192
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerContent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
2193
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: MtxDatetimepickerContent, selector: "mtx-datetimepicker-content", inputs: { color: "color" }, host: { listeners: { "@transformPanel.done": "_animationDone.next()" }, properties: { "class.mtx-datetimepicker-content-touch": "datetimepicker?.touchUi", "attr.mode": "datetimepicker.mode", "@transformPanel": "_animationState" }, classAttribute: "mtx-datetimepicker-content" }, viewQueries: [{ propertyName: "_calendar", first: true, predicate: MtxCalendar, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div cdkTrapFocus\n role=\"dialog\"\n [attr.aria-modal]=\"true\"\n [attr.aria-labelledby]=\"_dialogLabelId ?? undefined\"\n [attr.mode]=\"datetimepicker.mode\"\n class=\"mtx-datetimepicker-content-container\">\n <mtx-calendar [id]=\"datetimepicker.id\"\n [ngClass]=\"datetimepicker.panelClass\"\n [attr.mode]=\"datetimepicker.mode\"\n [type]=\"datetimepicker.type\"\n [startAt]=\"datetimepicker.startAt\"\n [startView]=\"datetimepicker.startView\"\n [maxDate]=\"datetimepicker._maxDate\"\n [minDate]=\"datetimepicker._minDate\"\n [dateFilter]=\"datetimepicker._dateFilter\"\n [multiYearSelector]=\"datetimepicker.multiYearSelector\"\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\n [timeInterval]=\"datetimepicker.timeInterval\"\n [twelvehour]=\"datetimepicker.twelvehour\"\n [selected]=\"datetimepicker._selected\"\n [timeInput]=\"datetimepicker.timeInput\"\n (selectedChange)=\"datetimepicker._select($event)\"\n (viewChanged)=\"datetimepicker._viewChanged($event)\"\n (_userSelection)=\"datetimepicker.close()\"\n [@fadeInCalendar]=\"'enter'\">\n </mtx-calendar>\n</div>\n", styles: [".mtx-datetimepicker-content{display:block;border-radius:4px;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;background-color:var(--mtx-datetimepicker-calendar-container-background-color);color:var(--mtx-datetimepicker-calendar-container-text-color)}.mtx-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mtx-datetimepicker-content .mtx-calendar{width:296px;height:424px}.mtx-datetimepicker-content .mtx-calendar.mtx-calendar-with-time-input{height:490px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar{width:432px;height:328px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar.mtx-calendar-with-time-input{height:404px}@media all and (orientation: landscape){.mtx-datetimepicker-content[mode=auto] .mtx-calendar{width:432px;height:328px}.mtx-datetimepicker-content[mode=auto] .mtx-calendar.mtx-calendar-with-time-input{height:404px}}.mtx-datetimepicker-content-touch{display:block;max-height:80vh;position:relative;overflow:visible}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.mtx-datetimepicker-content-touch .mtx-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:120vh;height:80vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}}@media all and (orientation: portrait){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container-with-actions{height:135vw}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: MtxCalendar, selector: "mtx-calendar", inputs: ["multiYearSelector", "twelvehour", "startView", "timeInterval", "dateFilter", "preventSameDateTimeSelection", "type", "startAt", "timeInput", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "viewChanged", "_userSelection"], exportAs: ["mtxCalendar"] }], animations: [
2186
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerContent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
2187
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0", type: MtxDatetimepickerContent, isStandalone: true, selector: "mtx-datetimepicker-content", inputs: { color: "color" }, host: { listeners: { "@transformPanel.done": "_animationDone.next()" }, properties: { "class.mtx-datetimepicker-content-touch": "datetimepicker?.touchUi", "attr.mode": "datetimepicker.mode", "@transformPanel": "_animationState" }, classAttribute: "mtx-datetimepicker-content" }, viewQueries: [{ propertyName: "_calendar", first: true, predicate: MtxCalendar, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div cdkTrapFocus\n role=\"dialog\"\n [attr.aria-modal]=\"true\"\n [attr.aria-labelledby]=\"_dialogLabelId ?? undefined\"\n [attr.mode]=\"datetimepicker.mode\"\n class=\"mtx-datetimepicker-content-container\">\n <mtx-calendar [id]=\"datetimepicker.id\"\n [ngClass]=\"datetimepicker.panelClass\"\n [attr.mode]=\"datetimepicker.mode\"\n [type]=\"datetimepicker.type\"\n [startAt]=\"datetimepicker.startAt\"\n [startView]=\"datetimepicker.startView\"\n [maxDate]=\"datetimepicker._maxDate\"\n [minDate]=\"datetimepicker._minDate\"\n [dateFilter]=\"datetimepicker._dateFilter\"\n [multiYearSelector]=\"datetimepicker.multiYearSelector\"\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\n [timeInterval]=\"datetimepicker.timeInterval\"\n [twelvehour]=\"datetimepicker.twelvehour\"\n [selected]=\"datetimepicker._selected\"\n [timeInput]=\"datetimepicker.timeInput\"\n (selectedChange)=\"datetimepicker._select($event)\"\n (viewChanged)=\"datetimepicker._viewChanged($event)\"\n (_userSelection)=\"datetimepicker.close()\"\n [@fadeInCalendar]=\"'enter'\">\n </mtx-calendar>\n</div>\n", styles: [".mtx-datetimepicker-content{display:block;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;border-radius:var(--mtx-datetimepicker-container-shape);background-color:var(--mtx-datetimepicker-calendar-container-background-color);color:var(--mtx-datetimepicker-calendar-container-text-color)}.mtx-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mtx-datetimepicker-content .mtx-calendar{width:296px;height:424px}.mtx-datetimepicker-content .mtx-calendar.mtx-calendar-with-time-input{height:490px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar{width:432px;height:328px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar.mtx-calendar-with-time-input{height:404px}@media all and (orientation: landscape){.mtx-datetimepicker-content[mode=auto] .mtx-calendar{width:432px;height:328px}.mtx-datetimepicker-content[mode=auto] .mtx-calendar.mtx-calendar-with-time-input{height:404px}}.mtx-datetimepicker-content-touch{display:block;max-height:80vh;position:relative;overflow:visible}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.mtx-datetimepicker-content-touch .mtx-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:120vh;height:80vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}}@media all and (orientation: portrait){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container-with-actions{height:135vw}}\n"], dependencies: [{ kind: "component", type: MtxCalendar, selector: "mtx-calendar", inputs: ["multiYearSelector", "twelvehour", "startView", "timeInterval", "dateFilter", "preventSameDateTimeSelection", "type", "startAt", "timeInput", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "viewChanged", "_userSelection"], exportAs: ["mtxCalendar"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [
2194
2188
  mtxDatetimepickerAnimations.transformPanel,
2195
2189
  mtxDatetimepickerAnimations.fadeInCalendar,
2196
2190
  ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
2197
2191
  }
2198
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerContent, decorators: [{
2192
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerContent, decorators: [{
2199
2193
  type: Component,
2200
2194
  args: [{ selector: 'mtx-datetimepicker-content', host: {
2201
2195
  'class': 'mtx-datetimepicker-content',
@@ -2206,26 +2200,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
2206
2200
  }, animations: [
2207
2201
  mtxDatetimepickerAnimations.transformPanel,
2208
2202
  mtxDatetimepickerAnimations.fadeInCalendar,
2209
- ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['color'], template: "<div cdkTrapFocus\n role=\"dialog\"\n [attr.aria-modal]=\"true\"\n [attr.aria-labelledby]=\"_dialogLabelId ?? undefined\"\n [attr.mode]=\"datetimepicker.mode\"\n class=\"mtx-datetimepicker-content-container\">\n <mtx-calendar [id]=\"datetimepicker.id\"\n [ngClass]=\"datetimepicker.panelClass\"\n [attr.mode]=\"datetimepicker.mode\"\n [type]=\"datetimepicker.type\"\n [startAt]=\"datetimepicker.startAt\"\n [startView]=\"datetimepicker.startView\"\n [maxDate]=\"datetimepicker._maxDate\"\n [minDate]=\"datetimepicker._minDate\"\n [dateFilter]=\"datetimepicker._dateFilter\"\n [multiYearSelector]=\"datetimepicker.multiYearSelector\"\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\n [timeInterval]=\"datetimepicker.timeInterval\"\n [twelvehour]=\"datetimepicker.twelvehour\"\n [selected]=\"datetimepicker._selected\"\n [timeInput]=\"datetimepicker.timeInput\"\n (selectedChange)=\"datetimepicker._select($event)\"\n (viewChanged)=\"datetimepicker._viewChanged($event)\"\n (_userSelection)=\"datetimepicker.close()\"\n [@fadeInCalendar]=\"'enter'\">\n </mtx-calendar>\n</div>\n", styles: [".mtx-datetimepicker-content{display:block;border-radius:4px;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;background-color:var(--mtx-datetimepicker-calendar-container-background-color);color:var(--mtx-datetimepicker-calendar-container-text-color)}.mtx-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mtx-datetimepicker-content .mtx-calendar{width:296px;height:424px}.mtx-datetimepicker-content .mtx-calendar.mtx-calendar-with-time-input{height:490px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar{width:432px;height:328px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar.mtx-calendar-with-time-input{height:404px}@media all and (orientation: landscape){.mtx-datetimepicker-content[mode=auto] .mtx-calendar{width:432px;height:328px}.mtx-datetimepicker-content[mode=auto] .mtx-calendar.mtx-calendar-with-time-input{height:404px}}.mtx-datetimepicker-content-touch{display:block;max-height:80vh;position:relative;overflow:visible}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.mtx-datetimepicker-content-touch .mtx-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:120vh;height:80vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}}@media all and (orientation: portrait){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container-with-actions{height:135vw}}\n"] }]
2210
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { _calendar: [{
2203
+ ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['color'], standalone: true, imports: [MtxCalendar, NgClass], template: "<div cdkTrapFocus\n role=\"dialog\"\n [attr.aria-modal]=\"true\"\n [attr.aria-labelledby]=\"_dialogLabelId ?? undefined\"\n [attr.mode]=\"datetimepicker.mode\"\n class=\"mtx-datetimepicker-content-container\">\n <mtx-calendar [id]=\"datetimepicker.id\"\n [ngClass]=\"datetimepicker.panelClass\"\n [attr.mode]=\"datetimepicker.mode\"\n [type]=\"datetimepicker.type\"\n [startAt]=\"datetimepicker.startAt\"\n [startView]=\"datetimepicker.startView\"\n [maxDate]=\"datetimepicker._maxDate\"\n [minDate]=\"datetimepicker._minDate\"\n [dateFilter]=\"datetimepicker._dateFilter\"\n [multiYearSelector]=\"datetimepicker.multiYearSelector\"\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\n [timeInterval]=\"datetimepicker.timeInterval\"\n [twelvehour]=\"datetimepicker.twelvehour\"\n [selected]=\"datetimepicker._selected\"\n [timeInput]=\"datetimepicker.timeInput\"\n (selectedChange)=\"datetimepicker._select($event)\"\n (viewChanged)=\"datetimepicker._viewChanged($event)\"\n (_userSelection)=\"datetimepicker.close()\"\n [@fadeInCalendar]=\"'enter'\">\n </mtx-calendar>\n</div>\n", styles: [".mtx-datetimepicker-content{display:block;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;border-radius:var(--mtx-datetimepicker-container-shape);background-color:var(--mtx-datetimepicker-calendar-container-background-color);color:var(--mtx-datetimepicker-calendar-container-text-color)}.mtx-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mtx-datetimepicker-content .mtx-calendar{width:296px;height:424px}.mtx-datetimepicker-content .mtx-calendar.mtx-calendar-with-time-input{height:490px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar{width:432px;height:328px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar.mtx-calendar-with-time-input{height:404px}@media all and (orientation: landscape){.mtx-datetimepicker-content[mode=auto] .mtx-calendar{width:432px;height:328px}.mtx-datetimepicker-content[mode=auto] .mtx-calendar.mtx-calendar-with-time-input{height:404px}}.mtx-datetimepicker-content-touch{display:block;max-height:80vh;position:relative;overflow:visible}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.mtx-datetimepicker-content-touch .mtx-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:120vh;height:80vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}}@media all and (orientation: portrait){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container-with-actions{height:135vw}}\n"] }]
2204
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { _calendar: [{
2211
2205
  type: ViewChild,
2212
2206
  args: [MtxCalendar, { static: true }]
2213
2207
  }] } });
2214
2208
  class MtxDatetimepicker {
2215
- /** Whether to show multi-year view. */
2216
- get multiYearSelector() {
2217
- return this._multiYearSelector;
2218
- }
2219
- set multiYearSelector(value) {
2220
- this._multiYearSelector = coerceBooleanProperty(value);
2221
- }
2222
- /** Whether the clock uses 12 hour format. */
2223
- get twelvehour() {
2224
- return this._twelvehour;
2225
- }
2226
- set twelvehour(value) {
2227
- this._twelvehour = coerceBooleanProperty(value);
2228
- }
2229
2209
  /**
2230
2210
  * Classes to be passed to the date picker panel.
2231
2211
  * Supports string and string array values, similar to `ngClass`.
@@ -2241,7 +2221,7 @@ class MtxDatetimepicker {
2241
2221
  return this._opened;
2242
2222
  }
2243
2223
  set opened(value) {
2244
- coerceBooleanProperty(value) ? this.open() : this.close();
2224
+ value ? this.open() : this.close();
2245
2225
  }
2246
2226
  /** Color palette to use on the datetimepicker's calendar. */
2247
2227
  get color() {
@@ -2259,8 +2239,10 @@ class MtxDatetimepicker {
2259
2239
  this._dateAdapter = _dateAdapter;
2260
2240
  this._dir = _dir;
2261
2241
  this._document = inject(DOCUMENT);
2262
- this._multiYearSelector = false;
2263
- this._twelvehour = false;
2242
+ /** Whether to show multi-year view. */
2243
+ this.multiYearSelector = false;
2244
+ /** Whether the clock uses 12 hour format. */
2245
+ this.twelvehour = false;
2264
2246
  /** The view that the calendar should start in. */
2265
2247
  this.startView = 'month';
2266
2248
  /** The display mode of datetimepicker. */
@@ -2292,13 +2274,26 @@ class MtxDatetimepicker {
2292
2274
  this._backdropHarnessClass = `${this.id}-backdrop`;
2293
2275
  this._inputStateChanges = Subscription.EMPTY;
2294
2276
  this._type = 'datetime';
2295
- this._touchUi = false;
2296
- this._timeInput = false;
2277
+ /**
2278
+ * Whether the calendar UI is in touch mode. In touch mode the calendar opens in a dialog rather
2279
+ * than a popup and elements have more padding to allow for bigger touch targets.
2280
+ */
2281
+ this.touchUi = false;
2282
+ /**
2283
+ * Whether the calendar is in time mode. In time mode the calendar clock gets time input
2284
+ * elements rather then just clock. When `touchUi` is enabled this will be disabled.
2285
+ */
2286
+ this.timeInput = false;
2297
2287
  /** Preferred position of the datetimepicker in the X axis. */
2298
2288
  this.xPosition = 'start';
2299
2289
  /** Preferred position of the datetimepicker in the Y axis. */
2300
2290
  this.yPosition = 'below';
2301
- this._restoreFocus = true;
2291
+ /**
2292
+ * Whether to restore focus to the previously-focused element when the panel is closed.
2293
+ * Note that automatic focus restoration is an accessibility feature and it is recommended that
2294
+ * you provide your own equivalent, if you decide to turn it off.
2295
+ */
2296
+ this.restoreFocus = true;
2302
2297
  if (!this._dateAdapter) {
2303
2298
  throw createMissingDateImplError('DateAdapter');
2304
2299
  }
@@ -2319,26 +2314,6 @@ class MtxDatetimepicker {
2319
2314
  set type(value) {
2320
2315
  this._type = value || 'datetime';
2321
2316
  }
2322
- /**
2323
- * Whether the calendar UI is in touch mode. In touch mode the calendar opens in a dialog rather
2324
- * than a popup and elements have more padding to allow for bigger touch targets.
2325
- */
2326
- get touchUi() {
2327
- return this._touchUi;
2328
- }
2329
- set touchUi(value) {
2330
- this._touchUi = coerceBooleanProperty(value);
2331
- }
2332
- /**
2333
- * Whether the calendar is in time mode. In time mode the calendar clock gets time input
2334
- * elements rather then just clock. When `touchUi` is enabled this will be disabled.
2335
- */
2336
- get timeInput() {
2337
- return this._timeInput && !this.touchUi;
2338
- }
2339
- set timeInput(value) {
2340
- this._timeInput = coerceBooleanProperty(value);
2341
- }
2342
2317
  /** Whether the datetimepicker pop-up should be disabled. */
2343
2318
  get disabled() {
2344
2319
  return this._disabled === undefined && this.datetimepickerInput
@@ -2346,23 +2321,11 @@ class MtxDatetimepicker {
2346
2321
  : !!this._disabled;
2347
2322
  }
2348
2323
  set disabled(value) {
2349
- const newValue = coerceBooleanProperty(value);
2350
- if (newValue !== this._disabled) {
2351
- this._disabled = newValue;
2352
- this._disabledChange.next(newValue);
2324
+ if (value !== this._disabled) {
2325
+ this._disabled = value;
2326
+ this._disabledChange.next(value);
2353
2327
  }
2354
2328
  }
2355
- /**
2356
- * Whether to restore focus to the previously-focused element when the panel is closed.
2357
- * Note that automatic focus restoration is an accessibility feature and it is recommended that
2358
- * you provide your own equivalent, if you decide to turn it off.
2359
- */
2360
- get restoreFocus() {
2361
- return this._restoreFocus;
2362
- }
2363
- set restoreFocus(value) {
2364
- this._restoreFocus = coerceBooleanProperty(value);
2365
- }
2366
2329
  /** The currently selected date. */
2367
2330
  get _selected() {
2368
2331
  return this._validSelected;
@@ -2427,7 +2390,7 @@ class MtxDatetimepicker {
2427
2390
  if (!this._opened) {
2428
2391
  return;
2429
2392
  }
2430
- const canRestoreFocus = this._restoreFocus &&
2393
+ const canRestoreFocus = this.restoreFocus &&
2431
2394
  this._focusedElementBeforeOpen &&
2432
2395
  typeof this._focusedElementBeforeOpen.focus === 'function';
2433
2396
  const completeClose = () => {
@@ -2582,10 +2545,10 @@ class MtxDatetimepicker {
2582
2545
  event.keyCode === UP_ARROW));
2583
2546
  })));
2584
2547
  }
2585
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepicker, deps: [{ token: i4$1.Overlay }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: MTX_DATETIMEPICKER_SCROLL_STRATEGY }, { token: i1.DatetimeAdapter, optional: true }, { token: i6.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
2586
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: MtxDatetimepicker, selector: "mtx-datetimepicker", inputs: { multiYearSelector: "multiYearSelector", twelvehour: "twelvehour", startView: "startView", mode: "mode", timeInterval: "timeInterval", preventSameDateTimeSelection: "preventSameDateTimeSelection", panelClass: "panelClass", opened: "opened", color: "color", startAt: "startAt", type: "type", touchUi: "touchUi", timeInput: "timeInput", disabled: "disabled", xPosition: "xPosition", yPosition: "yPosition", restoreFocus: "restoreFocus" }, outputs: { selectedChanged: "selectedChanged", openedStream: "opened", closedStream: "closed", viewChanged: "viewChanged" }, exportAs: ["mtxDatetimepicker"], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
2548
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepicker, deps: [{ token: i1$1.Overlay }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: MTX_DATETIMEPICKER_SCROLL_STRATEGY }, { token: i1.DatetimeAdapter, optional: true }, { token: i3.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
2549
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.1.0", type: MtxDatetimepicker, isStandalone: true, selector: "mtx-datetimepicker", inputs: { multiYearSelector: ["multiYearSelector", "multiYearSelector", booleanAttribute], twelvehour: ["twelvehour", "twelvehour", booleanAttribute], startView: "startView", mode: "mode", timeInterval: "timeInterval", preventSameDateTimeSelection: ["preventSameDateTimeSelection", "preventSameDateTimeSelection", booleanAttribute], panelClass: "panelClass", opened: ["opened", "opened", booleanAttribute], color: "color", startAt: "startAt", type: "type", touchUi: ["touchUi", "touchUi", booleanAttribute], timeInput: ["timeInput", "timeInput", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], xPosition: "xPosition", yPosition: "yPosition", restoreFocus: ["restoreFocus", "restoreFocus", booleanAttribute] }, outputs: { selectedChanged: "selectedChanged", openedStream: "opened", closedStream: "closed", viewChanged: "viewChanged" }, exportAs: ["mtxDatetimepicker"], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
2587
2550
  }
2588
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepicker, decorators: [{
2551
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepicker, decorators: [{
2589
2552
  type: Component,
2590
2553
  args: [{
2591
2554
  selector: 'mtx-datetimepicker',
@@ -2594,18 +2557,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
2594
2557
  changeDetection: ChangeDetectionStrategy.OnPush,
2595
2558
  encapsulation: ViewEncapsulation.None,
2596
2559
  preserveWhitespaces: false,
2560
+ standalone: true,
2597
2561
  }]
2598
- }], ctorParameters: function () { return [{ type: i4$1.Overlay }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
2562
+ }], ctorParameters: () => [{ type: i1$1.Overlay }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
2599
2563
  type: Inject,
2600
2564
  args: [MTX_DATETIMEPICKER_SCROLL_STRATEGY]
2601
2565
  }] }, { type: i1.DatetimeAdapter, decorators: [{
2602
2566
  type: Optional
2603
- }] }, { type: i6.Directionality, decorators: [{
2567
+ }] }, { type: i3.Directionality, decorators: [{
2604
2568
  type: Optional
2605
- }] }]; }, propDecorators: { multiYearSelector: [{
2606
- type: Input
2569
+ }] }], propDecorators: { multiYearSelector: [{
2570
+ type: Input,
2571
+ args: [{ transform: booleanAttribute }]
2607
2572
  }], twelvehour: [{
2608
- type: Input
2573
+ type: Input,
2574
+ args: [{ transform: booleanAttribute }]
2609
2575
  }], startView: [{
2610
2576
  type: Input
2611
2577
  }], mode: [{
@@ -2613,7 +2579,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
2613
2579
  }], timeInterval: [{
2614
2580
  type: Input
2615
2581
  }], preventSameDateTimeSelection: [{
2616
- type: Input
2582
+ type: Input,
2583
+ args: [{ transform: booleanAttribute }]
2617
2584
  }], selectedChanged: [{
2618
2585
  type: Output
2619
2586
  }], openedStream: [{
@@ -2627,7 +2594,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
2627
2594
  }], panelClass: [{
2628
2595
  type: Input
2629
2596
  }], opened: [{
2630
- type: Input
2597
+ type: Input,
2598
+ args: [{ transform: booleanAttribute }]
2631
2599
  }], color: [{
2632
2600
  type: Input
2633
2601
  }], startAt: [{
@@ -2635,17 +2603,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
2635
2603
  }], type: [{
2636
2604
  type: Input
2637
2605
  }], touchUi: [{
2638
- type: Input
2606
+ type: Input,
2607
+ args: [{ transform: booleanAttribute }]
2639
2608
  }], timeInput: [{
2640
- type: Input
2609
+ type: Input,
2610
+ args: [{ transform: booleanAttribute }]
2641
2611
  }], disabled: [{
2642
- type: Input
2612
+ type: Input,
2613
+ args: [{ transform: booleanAttribute }]
2643
2614
  }], xPosition: [{
2644
2615
  type: Input
2645
2616
  }], yPosition: [{
2646
2617
  type: Input
2647
2618
  }], restoreFocus: [{
2648
- type: Input
2619
+ type: Input,
2620
+ args: [{ transform: booleanAttribute }]
2649
2621
  }] } });
2650
2622
 
2651
2623
  const MAT_DATETIMEPICKER_VALUE_ACCESSOR = {
@@ -2790,10 +2762,9 @@ class MtxDatetimepickerInput {
2790
2762
  return !!this._disabled;
2791
2763
  }
2792
2764
  set disabled(value) {
2793
- const newValue = coerceBooleanProperty(value);
2794
- if (this._disabled !== newValue) {
2795
- this._disabled = newValue;
2796
- this._disabledChange.emit(newValue);
2765
+ if (this._disabled !== value) {
2766
+ this._disabled = value;
2767
+ this._disabledChange.emit(value);
2797
2768
  }
2798
2769
  }
2799
2770
  ngAfterContentInit() {
@@ -2929,14 +2900,14 @@ class MtxDatetimepickerInput {
2929
2900
  getThemePalette() {
2930
2901
  return this._formField ? this._formField.color : undefined;
2931
2902
  }
2932
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerInput, deps: [{ token: i0.ElementRef }, { token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }, { token: i2$2.MatFormField, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2933
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.7", type: MtxDatetimepickerInput, selector: "input[mtxDatetimepicker]", inputs: { mtxDatetimepicker: "mtxDatetimepicker", mtxDatetimepickerFilter: "mtxDatetimepickerFilter", value: "value", min: "min", max: "max", disabled: "disabled" }, outputs: { dateChange: "dateChange", dateInput: "dateInput" }, host: { listeners: { "input": "_onInput($event.target.value)", "change": "_onChange()", "blur": "_onBlur()", "keydown": "_onKeydown($event)" }, properties: { "attr.aria-haspopup": "true", "attr.aria-owns": "(_datetimepicker?.opened && _datetimepicker.id) || null", "attr.min": "min ? _dateAdapter.toIso8601(min) : null", "attr.max": "max ? _dateAdapter.toIso8601(max) : null", "disabled": "disabled" } }, providers: [
2903
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerInput, deps: [{ token: i0.ElementRef }, { token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }, { token: i2.MatFormField, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2904
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.1.0", type: MtxDatetimepickerInput, isStandalone: true, selector: "input[mtxDatetimepicker]", inputs: { mtxDatetimepicker: "mtxDatetimepicker", mtxDatetimepickerFilter: "mtxDatetimepickerFilter", value: "value", min: "min", max: "max", disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { dateChange: "dateChange", dateInput: "dateInput" }, host: { listeners: { "input": "_onInput($event.target.value)", "change": "_onChange()", "blur": "_onBlur()", "keydown": "_onKeydown($event)" }, properties: { "attr.aria-haspopup": "true", "attr.aria-owns": "(_datetimepicker?.opened && _datetimepicker.id) || null", "attr.min": "min ? _dateAdapter.toIso8601(min) : null", "attr.max": "max ? _dateAdapter.toIso8601(max) : null", "disabled": "disabled" } }, providers: [
2934
2905
  MAT_DATETIMEPICKER_VALUE_ACCESSOR,
2935
2906
  MAT_DATETIMEPICKER_VALIDATORS,
2936
2907
  { provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: MtxDatetimepickerInput },
2937
2908
  ], exportAs: ["mtxDatetimepickerInput"], ngImport: i0 }); }
2938
2909
  }
2939
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerInput, decorators: [{
2910
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerInput, decorators: [{
2940
2911
  type: Directive,
2941
2912
  args: [{
2942
2913
  selector: 'input[mtxDatetimepicker]',
@@ -2957,17 +2928,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
2957
2928
  '(keydown)': '_onKeydown($event)',
2958
2929
  },
2959
2930
  exportAs: 'mtxDatetimepickerInput',
2931
+ standalone: true,
2960
2932
  }]
2961
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter, decorators: [{
2933
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter, decorators: [{
2962
2934
  type: Optional
2963
2935
  }] }, { type: undefined, decorators: [{
2964
2936
  type: Optional
2965
2937
  }, {
2966
2938
  type: Inject,
2967
2939
  args: [MTX_DATETIME_FORMATS]
2968
- }] }, { type: i2$2.MatFormField, decorators: [{
2940
+ }] }, { type: i2.MatFormField, decorators: [{
2969
2941
  type: Optional
2970
- }] }]; }, propDecorators: { dateChange: [{
2942
+ }] }], propDecorators: { dateChange: [{
2971
2943
  type: Output
2972
2944
  }], dateInput: [{
2973
2945
  type: Output
@@ -2982,18 +2954,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
2982
2954
  }], max: [{
2983
2955
  type: Input
2984
2956
  }], disabled: [{
2985
- type: Input
2957
+ type: Input,
2958
+ args: [{ transform: booleanAttribute }]
2986
2959
  }] } });
2987
2960
 
2988
2961
  /** Can be used to override the icon of a `mtxDatetimepickerToggle`. */
2989
2962
  class MtxDatetimepickerToggleIcon {
2990
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerToggleIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2991
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.7", type: MtxDatetimepickerToggleIcon, selector: "[mtxDatetimepickerToggleIcon]", ngImport: i0 }); }
2963
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerToggleIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2964
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0", type: MtxDatetimepickerToggleIcon, isStandalone: true, selector: "[mtxDatetimepickerToggleIcon]", ngImport: i0 }); }
2992
2965
  }
2993
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerToggleIcon, decorators: [{
2966
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerToggleIcon, decorators: [{
2994
2967
  type: Directive,
2995
2968
  args: [{
2996
2969
  selector: '[mtxDatetimepickerToggleIcon]',
2970
+ standalone: true,
2997
2971
  }]
2998
2972
  }] });
2999
2973
  class MtxDatetimepickerToggle {
@@ -3002,7 +2976,7 @@ class MtxDatetimepickerToggle {
3002
2976
  return this._disabled === undefined ? this.datetimepicker.disabled : !!this._disabled;
3003
2977
  }
3004
2978
  set disabled(value) {
3005
- this._disabled = coerceBooleanProperty(value);
2979
+ this._disabled = value;
3006
2980
  }
3007
2981
  constructor(_intl, _changeDetectorRef, defaultTabIndex) {
3008
2982
  this._intl = _intl;
@@ -3041,10 +3015,10 @@ class MtxDatetimepickerToggle {
3041
3015
  this._stateChanges.unsubscribe();
3042
3016
  this._stateChanges = merge(this._intl.changes, datetimepickerDisabled, inputDisabled, datetimepickerToggled).subscribe(() => this._changeDetectorRef.markForCheck());
3043
3017
  }
3044
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerToggle, deps: [{ token: MtxDatetimepickerIntl }, { token: i0.ChangeDetectorRef }, { token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component }); }
3045
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: MtxDatetimepickerToggle, selector: "mtx-datetimepicker-toggle", inputs: { datetimepicker: ["for", "datetimepicker"], tabIndex: "tabIndex", ariaLabel: ["aria-label", "ariaLabel"], disabled: "disabled", disableRipple: "disableRipple" }, host: { listeners: { "click": "_open($event)" }, properties: { "attr.tabindex": "null", "class.mtx-datetimepicker-toggle-active": "datetimepicker && datetimepicker.opened", "class.mat-accent": "datetimepicker && datetimepicker.color === \"accent\"", "class.mat-warn": "datetimepicker && datetimepicker.color === \"warn\"", "attr.data-mtx-calendar": "datetimepicker ? datetimepicker.id : null" }, classAttribute: "mtx-datetimepicker-toggle" }, queries: [{ propertyName: "_customIcon", first: true, predicate: MtxDatetimepickerToggleIcon, descendants: true }], viewQueries: [{ propertyName: "_button", first: true, predicate: ["button"], descendants: true }], exportAs: ["mtxDatetimepickerToggle"], usesOnChanges: true, ngImport: i0, template: "<button #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datetimepicker ? 'dialog' : null\"\n [attr.aria-label]=\"ariaLabel || _intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\">\n\n <ng-container *ngIf=\"!_customIcon\" [ngSwitch]=\"datetimepicker.type\">\n <svg *ngSwitchCase=\"'time'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z\">\n </path>\n </svg>\n <svg *ngSwitchCase=\"'datetime'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\">\n </path>\n </svg>\n <svg *ngSwitchDefault\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\" />\n </svg>\n </ng-container>\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mtx-datetimepicker-toggle{pointer-events:auto;color:var(--mtx-datetimepicker-toggle-icon-color)}.mtx-datetimepicker-toggle-active{color:var(--mtx-datetimepicker-toggle-active-state-icon-color)}.cdk-high-contrast-active .mtx-datetimepicker-toggle-default-icon{color:CanvasText}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
3018
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerToggle, deps: [{ token: MtxDatetimepickerIntl }, { token: i0.ChangeDetectorRef }, { token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component }); }
3019
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0", type: MtxDatetimepickerToggle, isStandalone: true, selector: "mtx-datetimepicker-toggle", inputs: { datetimepicker: ["for", "datetimepicker"], tabIndex: "tabIndex", ariaLabel: ["aria-label", "ariaLabel"], disabled: ["disabled", "disabled", booleanAttribute], disableRipple: ["disableRipple", "disableRipple", booleanAttribute] }, host: { listeners: { "click": "_open($event)" }, properties: { "attr.tabindex": "null", "class.mtx-datetimepicker-toggle-active": "datetimepicker && datetimepicker.opened", "class.mat-accent": "datetimepicker && datetimepicker.color === \"accent\"", "class.mat-warn": "datetimepicker && datetimepicker.color === \"warn\"", "attr.data-mtx-calendar": "datetimepicker ? datetimepicker.id : null" }, classAttribute: "mtx-datetimepicker-toggle" }, queries: [{ propertyName: "_customIcon", first: true, predicate: MtxDatetimepickerToggleIcon, descendants: true }], viewQueries: [{ propertyName: "_button", first: true, predicate: ["button"], descendants: true }], exportAs: ["mtxDatetimepickerToggle"], usesOnChanges: true, ngImport: i0, template: "<button #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datetimepicker ? 'dialog' : null\"\n [attr.aria-label]=\"ariaLabel || _intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\">\n\n @if (!_customIcon) {\n @switch (datetimepicker.type) {\n @case ('time') {\n <svg\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z\" />\n </svg>\n }\n @case ('datetime') {\n <svg\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\" />\n </svg>\n }\n @default {\n <svg\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\" />\n </svg>\n }\n }\n }\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mtx-datetimepicker-toggle{pointer-events:auto;color:var(--mtx-datetimepicker-toggle-icon-color)}.mtx-datetimepicker-toggle-active{color:var(--mtx-datetimepicker-toggle-active-state-icon-color)}.cdk-high-contrast-active .mtx-datetimepicker-toggle-default-icon{color:CanvasText}\n"], dependencies: [{ kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
3046
3020
  }
3047
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerToggle, decorators: [{
3021
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerToggle, decorators: [{
3048
3022
  type: Component,
3049
3023
  args: [{ selector: 'mtx-datetimepicker-toggle', host: {
3050
3024
  'class': 'mtx-datetimepicker-toggle',
@@ -3058,11 +3032,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
3058
3032
  // `stopPropagation` on it without affecting the user's `click` handlers. We need to stop
3059
3033
  // it so that the input doesn't get focused automatically by the form field (See #21836).
3060
3034
  '(click)': '_open($event)',
3061
- }, exportAs: 'mtxDatetimepickerToggle', encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<button #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datetimepicker ? 'dialog' : null\"\n [attr.aria-label]=\"ariaLabel || _intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\">\n\n <ng-container *ngIf=\"!_customIcon\" [ngSwitch]=\"datetimepicker.type\">\n <svg *ngSwitchCase=\"'time'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z\">\n </path>\n </svg>\n <svg *ngSwitchCase=\"'datetime'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\">\n </path>\n </svg>\n <svg *ngSwitchDefault\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\" />\n </svg>\n </ng-container>\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mtx-datetimepicker-toggle{pointer-events:auto;color:var(--mtx-datetimepicker-toggle-icon-color)}.mtx-datetimepicker-toggle-active{color:var(--mtx-datetimepicker-toggle-active-state-icon-color)}.cdk-high-contrast-active .mtx-datetimepicker-toggle-default-icon{color:CanvasText}\n"] }]
3062
- }], ctorParameters: function () { return [{ type: MtxDatetimepickerIntl }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
3035
+ }, exportAs: 'mtxDatetimepickerToggle', encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatIconButton], template: "<button #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datetimepicker ? 'dialog' : null\"\n [attr.aria-label]=\"ariaLabel || _intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\">\n\n @if (!_customIcon) {\n @switch (datetimepicker.type) {\n @case ('time') {\n <svg\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z\" />\n </svg>\n }\n @case ('datetime') {\n <svg\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\" />\n </svg>\n }\n @default {\n <svg\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\" />\n </svg>\n }\n }\n }\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mtx-datetimepicker-toggle{pointer-events:auto;color:var(--mtx-datetimepicker-toggle-icon-color)}.mtx-datetimepicker-toggle-active{color:var(--mtx-datetimepicker-toggle-active-state-icon-color)}.cdk-high-contrast-active .mtx-datetimepicker-toggle-default-icon{color:CanvasText}\n"] }]
3036
+ }], ctorParameters: () => [{ type: MtxDatetimepickerIntl }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
3063
3037
  type: Attribute,
3064
3038
  args: ['tabindex']
3065
- }] }]; }, propDecorators: { datetimepicker: [{
3039
+ }] }], propDecorators: { datetimepicker: [{
3066
3040
  type: Input,
3067
3041
  args: ['for']
3068
3042
  }], tabIndex: [{
@@ -3071,9 +3045,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
3071
3045
  type: Input,
3072
3046
  args: ['aria-label']
3073
3047
  }], disabled: [{
3074
- type: Input
3048
+ type: Input,
3049
+ args: [{ transform: booleanAttribute }]
3075
3050
  }], disableRipple: [{
3076
- type: Input
3051
+ type: Input,
3052
+ args: [{ transform: booleanAttribute }]
3077
3053
  }], _customIcon: [{
3078
3054
  type: ContentChild,
3079
3055
  args: [MtxDatetimepickerToggleIcon]
@@ -3083,8 +3059,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImpor
3083
3059
  }] } });
3084
3060
 
3085
3061
  class MtxDatetimepickerModule {
3086
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3087
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerModule, declarations: [MtxCalendar,
3062
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3063
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerModule, imports: [CommonModule,
3064
+ OverlayModule,
3065
+ A11yModule,
3066
+ PortalModule,
3067
+ MatButtonModule,
3068
+ MtxCalendar,
3088
3069
  MtxCalendarBody,
3089
3070
  MtxClock,
3090
3071
  MtxTime,
@@ -3096,7 +3077,7 @@ class MtxDatetimepickerModule {
3096
3077
  MtxDatetimepickerContent,
3097
3078
  MtxMonthView,
3098
3079
  MtxYearView,
3099
- MtxMultiYearView], imports: [CommonModule, MatButtonModule, OverlayModule, A11yModule, PortalModule], exports: [MtxCalendar,
3080
+ MtxMultiYearView], exports: [MtxCalendar,
3100
3081
  MtxCalendarBody,
3101
3082
  MtxClock,
3102
3083
  MtxTime,
@@ -3108,13 +3089,25 @@ class MtxDatetimepickerModule {
3108
3089
  MtxMonthView,
3109
3090
  MtxYearView,
3110
3091
  MtxMultiYearView] }); }
3111
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerModule, providers: [MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [CommonModule, MatButtonModule, OverlayModule, A11yModule, PortalModule] }); }
3092
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerModule, providers: [MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [CommonModule,
3093
+ OverlayModule,
3094
+ A11yModule,
3095
+ PortalModule,
3096
+ MatButtonModule,
3097
+ MtxCalendar,
3098
+ MtxTime,
3099
+ MtxDatetimepickerToggle,
3100
+ MtxDatetimepickerContent] }); }
3112
3101
  }
3113
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxDatetimepickerModule, decorators: [{
3102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: MtxDatetimepickerModule, decorators: [{
3114
3103
  type: NgModule,
3115
3104
  args: [{
3116
- imports: [CommonModule, MatButtonModule, OverlayModule, A11yModule, PortalModule],
3117
- declarations: [
3105
+ imports: [
3106
+ CommonModule,
3107
+ OverlayModule,
3108
+ A11yModule,
3109
+ PortalModule,
3110
+ MatButtonModule,
3118
3111
  MtxCalendar,
3119
3112
  MtxCalendarBody,
3120
3113
  MtxClock,