@ng-matero/extensions 15.5.0 → 16.0.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 (325) hide show
  1. package/alert/alert.d.ts +1 -1
  2. package/button/button-loading.d.ts +1 -1
  3. package/checkbox-group/checkbox-group.d.ts +1 -1
  4. package/colorpicker/colorpicker-input.d.ts +1 -1
  5. package/colorpicker/colorpicker-toggle.d.ts +1 -1
  6. package/colorpicker/colorpicker.d.ts +2 -2
  7. package/datetimepicker/calendar-body.d.ts +1 -1
  8. package/datetimepicker/calendar.d.ts +1 -1
  9. package/datetimepicker/clock.d.ts +1 -1
  10. package/datetimepicker/clock.scss +1 -4
  11. package/datetimepicker/datetimepicker-input.d.ts +1 -1
  12. package/datetimepicker/datetimepicker-toggle.d.ts +1 -1
  13. package/datetimepicker/datetimepicker.d.ts +2 -2
  14. package/datetimepicker/month-view.d.ts +1 -1
  15. package/datetimepicker/multi-year-view.d.ts +1 -1
  16. package/datetimepicker/time.d.ts +2 -2
  17. package/datetimepicker/year-view.d.ts +1 -1
  18. package/esm2022/alert/alert-module.mjs +19 -0
  19. package/esm2022/alert/alert.mjs +53 -0
  20. package/esm2022/button/button-loading.mjs +77 -0
  21. package/esm2022/button/button-module.mjs +21 -0
  22. package/esm2022/checkbox-group/checkbox-group-module.mjs +22 -0
  23. package/esm2022/checkbox-group/checkbox-group.mjs +234 -0
  24. package/esm2022/colorpicker/colorpicker-input.mjs +229 -0
  25. package/esm2022/colorpicker/colorpicker-module.mjs +64 -0
  26. package/esm2022/colorpicker/colorpicker-toggle.mjs +103 -0
  27. package/esm2022/colorpicker/colorpicker.mjs +367 -0
  28. package/esm2022/column-resize/column-resize-directives/column-resize-flex.mjs +46 -0
  29. package/esm2022/column-resize/column-resize-directives/column-resize.mjs +46 -0
  30. package/esm2022/column-resize/column-resize-module.mjs +29 -0
  31. package/esm2022/column-resize/column-resize-notifier.mjs +49 -0
  32. package/esm2022/column-resize/column-resize.mjs +83 -0
  33. package/esm2022/column-resize/column-size-store.mjs +21 -0
  34. package/esm2022/column-resize/event-dispatcher.mjs +68 -0
  35. package/esm2022/column-resize/overlay-handle.mjs +147 -0
  36. package/esm2022/column-resize/resizable.mjs +200 -0
  37. package/esm2022/column-resize/resize-strategy.mjs +235 -0
  38. package/{esm2020 → esm2022}/core/datetime/datetime-adapter.mjs +1 -1
  39. package/esm2022/core/datetime/datetime.module.mjs +44 -0
  40. package/esm2022/core/datetime/native-datetime-adapter.mjs +139 -0
  41. package/esm2022/core/pipes/is-template-ref.pipe.mjs +15 -0
  42. package/esm2022/core/pipes/pipes.module.mjs +20 -0
  43. package/esm2022/core/pipes/to-observable.pipe.mjs +16 -0
  44. package/esm2022/datetimepicker/calendar-body.mjs +79 -0
  45. package/esm2022/datetimepicker/calendar.mjs +672 -0
  46. package/esm2022/datetimepicker/clock.mjs +354 -0
  47. package/esm2022/datetimepicker/datetimepicker-input.mjs +350 -0
  48. package/esm2022/datetimepicker/datetimepicker-intl.mjs +64 -0
  49. package/esm2022/datetimepicker/datetimepicker-module.mjs +83 -0
  50. package/esm2022/datetimepicker/datetimepicker-toggle.mjs +106 -0
  51. package/esm2022/datetimepicker/datetimepicker.mjs +529 -0
  52. package/esm2022/datetimepicker/month-view.mjs +149 -0
  53. package/esm2022/datetimepicker/multi-year-view.mjs +215 -0
  54. package/esm2022/datetimepicker/time.mjs +458 -0
  55. package/esm2022/datetimepicker/year-view.mjs +139 -0
  56. package/esm2022/dialog/dialog-container.mjs +36 -0
  57. package/esm2022/dialog/dialog-module.mjs +25 -0
  58. package/esm2022/dialog/dialog.mjs +75 -0
  59. package/esm2022/drawer/drawer-container.mjs +253 -0
  60. package/esm2022/drawer/drawer-module.mjs +23 -0
  61. package/esm2022/drawer/drawer.mjs +167 -0
  62. package/esm2022/grid/cell.mjs +117 -0
  63. package/{esm2020 → esm2022}/grid/column-menu.mjs +6 -5
  64. package/esm2022/grid/column-resize/column-resize-directives/column-resize-flex.mjs +38 -0
  65. package/esm2022/grid/column-resize/column-resize-directives/column-resize.mjs +38 -0
  66. package/esm2022/grid/column-resize/column-resize-module.mjs +44 -0
  67. package/esm2022/grid/column-resize/overlay-handle.mjs +61 -0
  68. package/esm2022/grid/column-resize/resizable-directives/resizable.mjs +63 -0
  69. package/esm2022/grid/column-resize/resize-strategy.mjs +43 -0
  70. package/esm2022/grid/expansion-toggle.mjs +65 -0
  71. package/esm2022/grid/grid-module.mjs +137 -0
  72. package/esm2022/grid/grid-pipes.mjs +113 -0
  73. package/esm2022/grid/grid-utils.mjs +64 -0
  74. package/esm2022/grid/grid.mjs +630 -0
  75. package/esm2022/loader/loader-module.mjs +21 -0
  76. package/esm2022/loader/loader.mjs +70 -0
  77. package/esm2022/popover/popover-content.mjs +92 -0
  78. package/esm2022/popover/popover-module.mjs +25 -0
  79. package/esm2022/popover/popover-target.mjs +18 -0
  80. package/esm2022/popover/popover-trigger.mjs +472 -0
  81. package/esm2022/popover/popover.mjs +384 -0
  82. package/esm2022/progress/progress-module.mjs +19 -0
  83. package/esm2022/progress/progress.mjs +56 -0
  84. package/esm2022/select/option.mjs +58 -0
  85. package/esm2022/select/select-module.mjs +75 -0
  86. package/esm2022/select/select.mjs +561 -0
  87. package/esm2022/select/templates.mjs +135 -0
  88. package/esm2022/slider/slider-module.mjs +20 -0
  89. package/esm2022/slider/slider.mjs +1116 -0
  90. package/esm2022/split/split-module.mjs +20 -0
  91. package/esm2022/split/split-pane.mjs +150 -0
  92. package/esm2022/split/split.mjs +635 -0
  93. package/esm2022/tooltip/tooltip-module.mjs +25 -0
  94. package/esm2022/tooltip/tooltip.mjs +930 -0
  95. package/{fesm2020 → fesm2022}/mtxAlert.mjs +7 -7
  96. package/{fesm2020 → fesm2022}/mtxAlert.mjs.map +1 -1
  97. package/{fesm2020 → fesm2022}/mtxButton.mjs +7 -7
  98. package/{fesm2015 → fesm2022}/mtxButton.mjs.map +1 -1
  99. package/{fesm2020 → fesm2022}/mtxCheckboxGroup.mjs +13 -13
  100. package/{fesm2020 → fesm2022}/mtxCheckboxGroup.mjs.map +1 -1
  101. package/{fesm2020 → fesm2022}/mtxColorpicker.mjs +41 -41
  102. package/{fesm2020 → fesm2022}/mtxColorpicker.mjs.map +1 -1
  103. package/{fesm2020 → fesm2022}/mtxColumnResize.mjs +46 -46
  104. package/{fesm2015 → fesm2022}/mtxColumnResize.mjs.map +1 -1
  105. package/{fesm2020 → fesm2022}/mtxCore.mjs +26 -26
  106. package/fesm2022/mtxCore.mjs.map +1 -0
  107. package/{fesm2020 → fesm2022}/mtxDatetimepicker.mjs +84 -80
  108. package/fesm2022/mtxDatetimepicker.mjs.map +1 -0
  109. package/{fesm2020 → fesm2022}/mtxDialog.mjs +10 -10
  110. package/{fesm2015 → fesm2022}/mtxDialog.mjs.map +1 -1
  111. package/{fesm2020 → fesm2022}/mtxDrawer.mjs +10 -10
  112. package/{fesm2020 → fesm2022}/mtxDrawer.mjs.map +1 -1
  113. package/{fesm2020 → fesm2022}/mtxGrid.mjs +120 -120
  114. package/{fesm2020 → fesm2022}/mtxGrid.mjs.map +1 -1
  115. package/{fesm2020 → fesm2022}/mtxLoader.mjs +7 -7
  116. package/{fesm2020 → fesm2022}/mtxLoader.mjs.map +1 -1
  117. package/{fesm2020 → fesm2022}/mtxPopover.mjs +19 -19
  118. package/{fesm2020 → fesm2022}/mtxPopover.mjs.map +1 -1
  119. package/{fesm2020 → fesm2022}/mtxProgress.mjs +7 -7
  120. package/{fesm2015 → fesm2022}/mtxProgress.mjs.map +1 -1
  121. package/{fesm2020 → fesm2022}/mtxSelect.mjs +68 -68
  122. package/{fesm2015 → fesm2022}/mtxSelect.mjs.map +1 -1
  123. package/{fesm2020 → fesm2022}/mtxSlider.mjs +7 -7
  124. package/{fesm2020 → fesm2022}/mtxSlider.mjs.map +1 -1
  125. package/{fesm2020 → fesm2022}/mtxSplit.mjs +10 -10
  126. package/{fesm2020 → fesm2022}/mtxSplit.mjs.map +1 -1
  127. package/{fesm2020 → fesm2022}/mtxTooltip.mjs +16 -16
  128. package/{fesm2015 → fesm2022}/mtxTooltip.mjs.map +1 -1
  129. package/grid/cell.d.ts +1 -1
  130. package/grid/column-menu.d.ts +1 -1
  131. package/grid/column-resize/resizable-directives/resizable.d.ts +1 -1
  132. package/grid/expansion-toggle.d.ts +1 -1
  133. package/grid/grid.d.ts +2 -2
  134. package/loader/loader.d.ts +1 -1
  135. package/package.json +69 -109
  136. package/popover/popover-trigger.d.ts +1 -1
  137. package/popover/popover.d.ts +1 -1
  138. package/progress/progress.d.ts +1 -1
  139. package/select/option.d.ts +1 -1
  140. package/select/select.d.ts +1 -1
  141. package/select/select.scss +0 -7
  142. package/slider/slider.d.ts +1 -1
  143. package/split/split-pane.d.ts +1 -1
  144. package/split/split.d.ts +1 -1
  145. package/tooltip/tooltip.d.ts +1 -1
  146. package/tooltip/tooltip.scss +1 -4
  147. package/esm2020/alert/alert-module.mjs +0 -18
  148. package/esm2020/alert/alert.mjs +0 -52
  149. package/esm2020/button/button-loading.mjs +0 -76
  150. package/esm2020/button/button-module.mjs +0 -20
  151. package/esm2020/checkbox-group/checkbox-group-module.mjs +0 -21
  152. package/esm2020/checkbox-group/checkbox-group.mjs +0 -233
  153. package/esm2020/colorpicker/colorpicker-input.mjs +0 -228
  154. package/esm2020/colorpicker/colorpicker-module.mjs +0 -63
  155. package/esm2020/colorpicker/colorpicker-toggle.mjs +0 -101
  156. package/esm2020/colorpicker/colorpicker.mjs +0 -365
  157. package/esm2020/column-resize/column-resize-directives/column-resize-flex.mjs +0 -45
  158. package/esm2020/column-resize/column-resize-directives/column-resize.mjs +0 -45
  159. package/esm2020/column-resize/column-resize-module.mjs +0 -28
  160. package/esm2020/column-resize/column-resize-notifier.mjs +0 -47
  161. package/esm2020/column-resize/column-resize.mjs +0 -82
  162. package/esm2020/column-resize/column-size-store.mjs +0 -20
  163. package/esm2020/column-resize/event-dispatcher.mjs +0 -67
  164. package/esm2020/column-resize/overlay-handle.mjs +0 -146
  165. package/esm2020/column-resize/resizable.mjs +0 -199
  166. package/esm2020/column-resize/resize-strategy.mjs +0 -232
  167. package/esm2020/core/datetime/datetime.module.mjs +0 -42
  168. package/esm2020/core/datetime/native-datetime-adapter.mjs +0 -138
  169. package/esm2020/core/pipes/is-template-ref.pipe.mjs +0 -14
  170. package/esm2020/core/pipes/pipes.module.mjs +0 -19
  171. package/esm2020/core/pipes/to-observable.pipe.mjs +0 -15
  172. package/esm2020/datetimepicker/calendar-body.mjs +0 -78
  173. package/esm2020/datetimepicker/calendar.mjs +0 -671
  174. package/esm2020/datetimepicker/clock.mjs +0 -349
  175. package/esm2020/datetimepicker/datetimepicker-input.mjs +0 -349
  176. package/esm2020/datetimepicker/datetimepicker-intl.mjs +0 -63
  177. package/esm2020/datetimepicker/datetimepicker-module.mjs +0 -82
  178. package/esm2020/datetimepicker/datetimepicker-toggle.mjs +0 -104
  179. package/esm2020/datetimepicker/datetimepicker.mjs +0 -527
  180. package/esm2020/datetimepicker/month-view.mjs +0 -148
  181. package/esm2020/datetimepicker/multi-year-view.mjs +0 -214
  182. package/esm2020/datetimepicker/time.mjs +0 -456
  183. package/esm2020/datetimepicker/year-view.mjs +0 -138
  184. package/esm2020/dialog/dialog-container.mjs +0 -35
  185. package/esm2020/dialog/dialog-module.mjs +0 -24
  186. package/esm2020/dialog/dialog.mjs +0 -74
  187. package/esm2020/drawer/drawer-container.mjs +0 -252
  188. package/esm2020/drawer/drawer-module.mjs +0 -22
  189. package/esm2020/drawer/drawer.mjs +0 -166
  190. package/esm2020/grid/cell.mjs +0 -116
  191. package/esm2020/grid/column-resize/column-resize-directives/column-resize-flex.mjs +0 -37
  192. package/esm2020/grid/column-resize/column-resize-directives/column-resize.mjs +0 -37
  193. package/esm2020/grid/column-resize/column-resize-module.mjs +0 -42
  194. package/esm2020/grid/column-resize/overlay-handle.mjs +0 -60
  195. package/esm2020/grid/column-resize/resizable-directives/resizable.mjs +0 -62
  196. package/esm2020/grid/column-resize/resize-strategy.mjs +0 -42
  197. package/esm2020/grid/expansion-toggle.mjs +0 -64
  198. package/esm2020/grid/grid-module.mjs +0 -136
  199. package/esm2020/grid/grid-pipes.mjs +0 -108
  200. package/esm2020/grid/grid-utils.mjs +0 -63
  201. package/esm2020/grid/grid.mjs +0 -628
  202. package/esm2020/loader/loader-module.mjs +0 -20
  203. package/esm2020/loader/loader.mjs +0 -69
  204. package/esm2020/popover/popover-content.mjs +0 -90
  205. package/esm2020/popover/popover-module.mjs +0 -24
  206. package/esm2020/popover/popover-target.mjs +0 -17
  207. package/esm2020/popover/popover-trigger.mjs +0 -471
  208. package/esm2020/popover/popover.mjs +0 -383
  209. package/esm2020/progress/progress-module.mjs +0 -18
  210. package/esm2020/progress/progress.mjs +0 -55
  211. package/esm2020/select/option.mjs +0 -57
  212. package/esm2020/select/select-module.mjs +0 -74
  213. package/esm2020/select/select.mjs +0 -560
  214. package/esm2020/select/templates.mjs +0 -124
  215. package/esm2020/slider/slider-module.mjs +0 -19
  216. package/esm2020/slider/slider.mjs +0 -1115
  217. package/esm2020/split/split-module.mjs +0 -19
  218. package/esm2020/split/split-pane.mjs +0 -149
  219. package/esm2020/split/split.mjs +0 -634
  220. package/esm2020/tooltip/tooltip-module.mjs +0 -24
  221. package/esm2020/tooltip/tooltip.mjs +0 -926
  222. package/fesm2015/mtxAlert.mjs +0 -74
  223. package/fesm2015/mtxAlert.mjs.map +0 -1
  224. package/fesm2015/mtxButton.mjs +0 -99
  225. package/fesm2015/mtxCheckboxGroup.mjs +0 -256
  226. package/fesm2015/mtxCheckboxGroup.mjs.map +0 -1
  227. package/fesm2015/mtxColorpicker.mjs +0 -767
  228. package/fesm2015/mtxColorpicker.mjs.map +0 -1
  229. package/fesm2015/mtxColumnResize.mjs +0 -959
  230. package/fesm2015/mtxCore.mjs +0 -374
  231. package/fesm2015/mtxCore.mjs.map +0 -1
  232. package/fesm2015/mtxDatetimepicker.mjs +0 -3164
  233. package/fesm2015/mtxDatetimepicker.mjs.map +0 -1
  234. package/fesm2015/mtxDialog.mjs +0 -130
  235. package/fesm2015/mtxDrawer.mjs +0 -578
  236. package/fesm2015/mtxDrawer.mjs.map +0 -1
  237. package/fesm2015/mtxGrid.mjs +0 -1514
  238. package/fesm2015/mtxGrid.mjs.map +0 -1
  239. package/fesm2015/mtxLoader.mjs +0 -93
  240. package/fesm2015/mtxLoader.mjs.map +0 -1
  241. package/fesm2015/mtxPopover.mjs +0 -1027
  242. package/fesm2015/mtxPopover.mjs.map +0 -1
  243. package/fesm2015/mtxProgress.mjs +0 -77
  244. package/fesm2015/mtxSelect.mjs +0 -814
  245. package/fesm2015/mtxSlider.mjs +0 -1139
  246. package/fesm2015/mtxSlider.mjs.map +0 -1
  247. package/fesm2015/mtxSplit.mjs +0 -1025
  248. package/fesm2015/mtxSplit.mjs.map +0 -1
  249. package/fesm2015/mtxTooltip.mjs +0 -982
  250. package/fesm2020/mtxButton.mjs.map +0 -1
  251. package/fesm2020/mtxColumnResize.mjs.map +0 -1
  252. package/fesm2020/mtxCore.mjs.map +0 -1
  253. package/fesm2020/mtxDatetimepicker.mjs.map +0 -1
  254. package/fesm2020/mtxDialog.mjs.map +0 -1
  255. package/fesm2020/mtxProgress.mjs.map +0 -1
  256. package/fesm2020/mtxSelect.mjs.map +0 -1
  257. package/fesm2020/mtxTooltip.mjs.map +0 -1
  258. package/fesm2020/ng-matero-extensions.mjs +0 -9
  259. package/fesm2020/ng-matero-extensions.mjs.map +0 -1
  260. /package/{esm2020 → esm2022}/alert/mtxAlert.mjs +0 -0
  261. /package/{esm2020 → esm2022}/alert/public-api.mjs +0 -0
  262. /package/{esm2020 → esm2022}/button/mtxButton.mjs +0 -0
  263. /package/{esm2020 → esm2022}/button/public-api.mjs +0 -0
  264. /package/{esm2020 → esm2022}/checkbox-group/interfaces.mjs +0 -0
  265. /package/{esm2020 → esm2022}/checkbox-group/mtxCheckboxGroup.mjs +0 -0
  266. /package/{esm2020 → esm2022}/checkbox-group/public-api.mjs +0 -0
  267. /package/{esm2020 → esm2022}/colorpicker/colorpicker-animations.mjs +0 -0
  268. /package/{esm2020 → esm2022}/colorpicker/mtxColorpicker.mjs +0 -0
  269. /package/{esm2020 → esm2022}/colorpicker/public-api.mjs +0 -0
  270. /package/{esm2020 → esm2022}/column-resize/column-resize-directives/constants.mjs +0 -0
  271. /package/{esm2020 → esm2022}/column-resize/mtxColumnResize.mjs +0 -0
  272. /package/{esm2020 → esm2022}/column-resize/polyfill.mjs +0 -0
  273. /package/{esm2020 → esm2022}/column-resize/public-api.mjs +0 -0
  274. /package/{esm2020 → esm2022}/column-resize/resize-ref.mjs +0 -0
  275. /package/{esm2020 → esm2022}/column-resize/selectors.mjs +0 -0
  276. /package/{esm2020 → esm2022}/core/datetime/datetime-formats.mjs +0 -0
  277. /package/{esm2020 → esm2022}/core/datetime/index.mjs +0 -0
  278. /package/{esm2020 → esm2022}/core/datetime/native-datetime-formats.mjs +0 -0
  279. /package/{esm2020 → esm2022}/core/mtxCore.mjs +0 -0
  280. /package/{esm2020 → esm2022}/core/pipes/index.mjs +0 -0
  281. /package/{esm2020 → esm2022}/core/public-api.mjs +0 -0
  282. /package/{esm2020 → esm2022}/datetimepicker/datetimepicker-animations.mjs +0 -0
  283. /package/{esm2020 → esm2022}/datetimepicker/datetimepicker-errors.mjs +0 -0
  284. /package/{esm2020 → esm2022}/datetimepicker/datetimepicker-filtertype.mjs +0 -0
  285. /package/{esm2020 → esm2022}/datetimepicker/datetimepicker-types.mjs +0 -0
  286. /package/{esm2020 → esm2022}/datetimepicker/mtxDatetimepicker.mjs +0 -0
  287. /package/{esm2020 → esm2022}/datetimepicker/public-api.mjs +0 -0
  288. /package/{esm2020 → esm2022}/dialog/dialog-config.mjs +0 -0
  289. /package/{esm2020 → esm2022}/dialog/mtxDialog.mjs +0 -0
  290. /package/{esm2020 → esm2022}/dialog/public-api.mjs +0 -0
  291. /package/{esm2020 → esm2022}/drawer/drawer-animation.mjs +0 -0
  292. /package/{esm2020 → esm2022}/drawer/drawer-config.mjs +0 -0
  293. /package/{esm2020 → esm2022}/drawer/drawer-ref.mjs +0 -0
  294. /package/{esm2020 → esm2022}/drawer/mtxDrawer.mjs +0 -0
  295. /package/{esm2020 → esm2022}/drawer/public-api.mjs +0 -0
  296. /package/{esm2020 → esm2022}/grid/column-resize/column-resize-directives/common.mjs +0 -0
  297. /package/{esm2020 → esm2022}/grid/column-resize/resizable-directives/common.mjs +0 -0
  298. /package/{esm2020 → esm2022}/grid/interfaces.mjs +0 -0
  299. /package/{esm2020 → esm2022}/grid/mtxGrid.mjs +0 -0
  300. /package/{esm2020 → esm2022}/grid/public-api.mjs +0 -0
  301. /package/{esm2020 → esm2022}/loader/mtxLoader.mjs +0 -0
  302. /package/{esm2020 → esm2022}/loader/public-api.mjs +0 -0
  303. /package/{esm2020 → esm2022}/ng-matero-extensions.mjs +0 -0
  304. /package/{esm2020 → esm2022}/popover/mtxPopover.mjs +0 -0
  305. /package/{esm2020 → esm2022}/popover/popover-animations.mjs +0 -0
  306. /package/{esm2020 → esm2022}/popover/popover-errors.mjs +0 -0
  307. /package/{esm2020 → esm2022}/popover/popover-interfaces.mjs +0 -0
  308. /package/{esm2020 → esm2022}/popover/popover-types.mjs +0 -0
  309. /package/{esm2020 → esm2022}/popover/public-api.mjs +0 -0
  310. /package/{esm2020 → esm2022}/progress/mtxProgress.mjs +0 -0
  311. /package/{esm2020 → esm2022}/progress/public-api.mjs +0 -0
  312. /package/{esm2020 → esm2022}/public-api.mjs +0 -0
  313. /package/{esm2020 → esm2022}/select/mtxSelect.mjs +0 -0
  314. /package/{esm2020 → esm2022}/select/public-api.mjs +0 -0
  315. /package/{esm2020 → esm2022}/slider/mtxSlider.mjs +0 -0
  316. /package/{esm2020 → esm2022}/slider/public-api.mjs +0 -0
  317. /package/{esm2020 → esm2022}/split/interfaces.mjs +0 -0
  318. /package/{esm2020 → esm2022}/split/mtxSplit.mjs +0 -0
  319. /package/{esm2020 → esm2022}/split/public-api.mjs +0 -0
  320. /package/{esm2020 → esm2022}/split/utils.mjs +0 -0
  321. /package/{esm2020 → esm2022}/tooltip/mtxTooltip.mjs +0 -0
  322. /package/{esm2020 → esm2022}/tooltip/public-api.mjs +0 -0
  323. /package/{esm2020 → esm2022}/tooltip/tooltip-animations.mjs +0 -0
  324. /package/{fesm2015 → fesm2022}/ng-matero-extensions.mjs +0 -0
  325. /package/{fesm2015 → fesm2022}/ng-matero-extensions.mjs.map +0 -0
@@ -1,3164 +0,0 @@
1
- import * as i2$1 from '@angular/cdk/a11y';
2
- import { A11yModule } from '@angular/cdk/a11y';
3
- import * as i4$1 from '@angular/cdk/overlay';
4
- import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
5
- import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
6
- import * as i2 from '@angular/common';
7
- import { DOCUMENT, CommonModule } from '@angular/common';
8
- 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';
12
- import { UP_ARROW, DOWN_ARROW, ENTER, PAGE_DOWN, PAGE_UP, END, HOME, RIGHT_ARROW, LEFT_ARROW, ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
13
- import { coerceNumberProperty, coerceBooleanProperty, coerceStringArray } from '@angular/cdk/coercion';
14
- import { first, take, filter } from 'rxjs/operators';
15
- import * as i1 from '@ng-matero/extensions/core';
16
- 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';
19
- import { normalizePassiveListenerOptions, _getFocusedElementPierceShadowDom } from '@angular/cdk/platform';
20
- import { mixinColor } from '@angular/material/core';
21
- import * as i6 from '@angular/cdk/bidi';
22
- import { NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators } from '@angular/forms';
23
- 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
- }
75
-
76
- var MtxDatetimepickerFilterType;
77
- (function (MtxDatetimepickerFilterType) {
78
- MtxDatetimepickerFilterType[MtxDatetimepickerFilterType["DATE"] = 0] = "DATE";
79
- MtxDatetimepickerFilterType[MtxDatetimepickerFilterType["HOUR"] = 1] = "HOUR";
80
- MtxDatetimepickerFilterType[MtxDatetimepickerFilterType["MINUTE"] = 2] = "MINUTE";
81
- })(MtxDatetimepickerFilterType || (MtxDatetimepickerFilterType = {}));
82
-
83
- /**
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
- }
131
- /** @nocollapse */ MtxCalendarBody.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxCalendarBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
132
- /** @nocollapse */ MtxCalendarBody.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: { label: "label", rows: "rows", todayValue: "todayValue", selectedValue: "selectedValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", allowDisabledSelection: "allowDisabledSelection", activeCell: "activeCell" }, outputs: { selectedValueChange: "selectedValueChange" }, host: { classAttribute: "mtx-calendar-body" }, exportAs: ["mtxCalendarBody"], ngImport: i0, template: "<!--\n If there's not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don't want it to be read out as one of the weeks in the month.\n-->\n<tr *ngIf=\"_firstRowOffset < labelMinRequiredCells\" aria-hidden=\"true\">\n <td class=\"mtx-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\n</tr>\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\" role=\"row\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n -->\n <td *ngIf=\"rowIndex === 0 && _firstRowOffset\"\n class=\"mtx-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" aria-hidden=\"true\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n <td *ngFor=\"let item of row; let colIndex = index\"\n role=\"gridcell\"\n class=\"mtx-calendar-body-cell\"\n [class.mtx-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\"\n [class.mtx-calendar-body-disabled]=\"!item.enabled\"\n [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [attr.data-mat-row]=\"rowIndex\"\n [attr.data-mat-col]=\"colIndex\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n (click)=\"_cellClicked(item)\">\n <div class=\"mtx-calendar-body-cell-content\"\n [class.mtx-calendar-body-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-today]=\"todayValue === item.value\"\n [attr.aria-selected]=\"selectedValue === item.value\">\n {{ item.displayValue }}\n </div>\n </td>\n</tr>\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%}[dir=rtl] .mtx-calendar-body-label{text-align:right}.mtx-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:7.1428571429% 0;text-align:center;outline:none;cursor:pointer}.mtx-calendar-body-disabled{cursor:default;pointer-events:none}.mtx-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid transparent;border-radius:999px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", 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-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%}[dir=rtl] .mtx-calendar-body-label{text-align:right}.mtx-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:7.1428571429% 0;text-align:center;outline:none;cursor:pointer}.mtx-calendar-body-disabled{cursor:default;pointer-events:none}.mtx-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid transparent;border-radius:999px}\n"] }]
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.
162
- * @docs-private
163
- */
164
- class MtxMultiYearView {
165
- constructor(_adapter, _dateFormats) {
166
- this._adapter = _adapter;
167
- this._dateFormats = _dateFormats;
168
- this.type = 'date';
169
- /** Emits when a new month is selected. */
170
- this.selectedChange = new EventEmitter();
171
- /** Emits when any date is selected. */
172
- 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();
180
- }
181
- /** The date to display in this multi year view */
182
- get activeDate() {
183
- return this._activeDate;
184
- }
185
- set activeDate(value) {
186
- 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)) {
191
- this._init();
192
- }
193
- }
194
- /** The currently selected date. */
195
- get selected() {
196
- return this._selected;
197
- }
198
- set selected(value) {
199
- this._selected = value;
200
- this._selectedYear = this._selected && this._adapter.getYear(this._selected);
201
- }
202
- /** The minimum selectable date. */
203
- get minDate() {
204
- return this._minDate;
205
- }
206
- set minDate(value) {
207
- this._minDate = this._getValidDateOrNull(this._adapter.deserialize(value));
208
- }
209
- /** The maximum selectable date. */
210
- get maxDate() {
211
- return this._maxDate;
212
- }
213
- set maxDate(value) {
214
- this._maxDate = this._getValidDateOrNull(this._adapter.deserialize(value));
215
- }
216
- ngAfterContentInit() {
217
- this._init();
218
- }
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();
226
- }
227
- }
228
- _getActiveCell() {
229
- return getActiveOffset(this._adapter, this.activeDate, this.minDate, this.maxDate);
230
- }
231
- _calendarStateDone() {
232
- this._calendarState = '';
233
- }
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
- }
247
- }
248
- }
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));
253
- }
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;
266
- }
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;
272
- }
273
- }
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;
290
- }
291
- /**
292
- * @param obj The object to check.
293
- * @returns The given object if it is both a date instance and valid, otherwise null.
294
- */
295
- _getValidDateOrNull(obj) {
296
- return this._adapter.isDateInstance(obj) && this._adapter.isValid(obj) ? obj : null;
297
- }
298
- }
299
- /** @nocollapse */ MtxMultiYearView.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxMultiYearView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
300
- /** @nocollapse */ MtxMultiYearView.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", 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 });
301
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxMultiYearView, decorators: [{
302
- 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 () {
305
- return [{ type: i1.DatetimeAdapter, decorators: [{
306
- type: Optional
307
- }] }, { type: undefined, decorators: [{
308
- type: Optional
309
- }, {
310
- type: Inject,
311
- args: [MTX_DATETIME_FORMATS]
312
- }] }];
313
- }, propDecorators: { type: [{
314
- type: Input
315
- }], dateFilter: [{
316
- type: Input
317
- }], selectedChange: [{
318
- type: Output
319
- }], _userSelection: [{
320
- type: Output
321
- }], activeDate: [{
322
- type: Input
323
- }], selected: [{
324
- type: Input
325
- }], minDate: [{
326
- type: Input
327
- }], maxDate: [{
328
- type: Input
329
- }] } });
330
- function isSameMultiYearView(dateAdapter, date1, date2, minDate, maxDate) {
331
- const year1 = dateAdapter.getYear(date1);
332
- const year2 = dateAdapter.getYear(date2);
333
- const startingYear = getStartingYear(dateAdapter, minDate, maxDate);
334
- return (Math.floor((year1 - startingYear) / yearsPerPage) ===
335
- Math.floor((year2 - startingYear) / yearsPerPage));
336
- }
337
- /**
338
- * When the multi-year view is first opened, the active year will be in view.
339
- * So we compute how many years are between the active year and the *slot* where our
340
- * "startingYear" will render when paged into view.
341
- */
342
- function getActiveOffset(dateAdapter, activeDate, minDate, maxDate) {
343
- const activeYear = dateAdapter.getYear(activeDate);
344
- return euclideanModulo(activeYear - getStartingYear(dateAdapter, minDate, maxDate), yearsPerPage);
345
- }
346
- /**
347
- * We pick a "starting" year such that either the maximum year would be at the end
348
- * or the minimum year would be at the beginning of a page.
349
- */
350
- function getStartingYear(dateAdapter, minDate, maxDate) {
351
- let startingYear = 0;
352
- if (maxDate) {
353
- const maxYear = dateAdapter.getYear(maxDate);
354
- startingYear = maxYear - yearsPerPage + 1;
355
- }
356
- else if (minDate) {
357
- startingYear = dateAdapter.getYear(minDate);
358
- }
359
- return startingYear;
360
- }
361
- /** Gets remainder that is non-negative, even if first number is negative */
362
- function euclideanModulo(a, b) {
363
- return ((a % b) + b) % b;
364
- }
365
-
366
- class MtxDatetimepickerIntl {
367
- constructor() {
368
- /**
369
- * Stream to emit from when labels are changed. Use this to notify components when the labels have
370
- * changed after initialization.
371
- */
372
- this.changes = new Subject();
373
- /** A label for the calendar popup (used by screen readers). */
374
- this.calendarLabel = 'Calendar';
375
- /** A label for the button used to open the calendar popup (used by screen readers). */
376
- this.openCalendarLabel = 'Open calendar';
377
- /** Label for the button used to close the calendar popup. */
378
- this.closeCalendarLabel = 'Close calendar';
379
- /** A label for the previous month button (used by screen readers). */
380
- this.prevMonthLabel = 'Previous month';
381
- /** A label for the next month button (used by screen readers). */
382
- this.nextMonthLabel = 'Next month';
383
- /** A label for the previous year button (used by screen readers). */
384
- this.prevYearLabel = 'Previous year';
385
- /** A label for the next year button (used by screen readers). */
386
- this.nextYearLabel = 'Next year';
387
- /** A label for the previous multi-year button (used by screen readers). */
388
- this.prevMultiYearLabel = 'Previous 24 years';
389
- /** A label for the next multi-year button (used by screen readers). */
390
- this.nextMultiYearLabel = 'Next 24 years';
391
- /** A label for the 'switch to month view' button (used by screen readers). */
392
- this.switchToMonthViewLabel = 'Choose date';
393
- /** A label for the 'switch to year view' button (used by screen readers). */
394
- this.switchToYearViewLabel = 'Choose month';
395
- /** A label for the 'switch to multi-year view' button (used by screen readers). */
396
- this.switchToMultiYearViewLabel = 'Choose month and year';
397
- /** A label for the first date of a range of dates (used by screen readers). */
398
- this.startDateLabel = 'Start date';
399
- /** A label for the last date of a range of dates (used by screen readers). */
400
- this.endDateLabel = 'End date';
401
- /** A label for the 'switch to clock hour view' button (used by screen readers). */
402
- this.switchToClockHourViewLabel = 'Choose hour';
403
- /** A label for the 'switch to clock minute view' button (used by screen readers). */
404
- this.switchToClockMinuteViewLabel = 'Choose minute';
405
- /** Label used for ok button within the manual time input. */
406
- this.okLabel = 'OK';
407
- /** Label used for cancel button within the manual time input. */
408
- this.cancelLabel = 'Cancel';
409
- }
410
- /** Formats a range of years (used for visuals). */
411
- formatYearRange(start, end) {
412
- return `${start} \u2013 ${end}`;
413
- }
414
- /** Formats a label for a range of years (used by screen readers). */
415
- formatYearRangeLabel(start, end) {
416
- return `${start} to ${end}`;
417
- }
418
- }
419
- /** @nocollapse */ MtxDatetimepickerIntl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
420
- /** @nocollapse */ MtxDatetimepickerIntl.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerIntl, providedIn: 'root' });
421
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerIntl, decorators: [{
422
- type: Injectable,
423
- args: [{ providedIn: 'root' }]
424
- }] });
425
-
426
- const activeEventOptions = normalizePassiveListenerOptions({ passive: false });
427
- const CLOCK_RADIUS = 50;
428
- const CLOCK_INNER_RADIUS = 27.5;
429
- const CLOCK_OUTER_RADIUS = 41.25;
430
- const CLOCK_TICK_RADIUS = 7.0833;
431
- /**
432
- * A clock that is used as part of the datetimepicker.
433
- * @docs-private
434
- */
435
- class MtxClock {
436
- constructor(_elementRef, _adapter, _changeDetectorRef, _document) {
437
- this._elementRef = _elementRef;
438
- this._adapter = _adapter;
439
- this._changeDetectorRef = _changeDetectorRef;
440
- this._document = _document;
441
- /** Step over minutes. */
442
- this.interval = 1;
443
- /** Whether the clock uses 12 hour format. */
444
- this.twelvehour = false;
445
- /** Whether the time is now in AM or PM. */
446
- this.AMPM = 'AM';
447
- /** Emits when the currently selected date changes. */
448
- this.selectedChange = new EventEmitter();
449
- /** Emits when any date is activated. */
450
- this.activeDateChange = new EventEmitter();
451
- /** Emits when any date is selected. */
452
- this._userSelection = new EventEmitter();
453
- /** Whether the clock is in hour view. */
454
- this._hourView = true;
455
- this._hours = [];
456
- this._minutes = [];
457
- this._timeChanged = false;
458
- /** Called when the user has put their pointer down on the clock. */
459
- this._pointerDown = (event) => {
460
- this._timeChanged = false;
461
- this.setTime(event);
462
- this._bindGlobalEvents(event);
463
- };
464
- /**
465
- * Called when the user has moved their pointer after
466
- * starting to drag. Bound on the document level.
467
- */
468
- this._pointerMove = (event) => {
469
- if (event.cancelable) {
470
- event.preventDefault();
471
- }
472
- this.setTime(event);
473
- };
474
- /** Called when the user has lifted their pointer. Bound on the document level. */
475
- this._pointerUp = (event) => {
476
- if (event.cancelable) {
477
- event.preventDefault();
478
- }
479
- this._removeGlobalEvents();
480
- if (this._timeChanged) {
481
- this.selectedChange.emit(this.activeDate);
482
- if (!this._hourView) {
483
- this._userSelection.emit();
484
- }
485
- }
486
- };
487
- }
488
- /**
489
- * The date to display in this clock view.
490
- */
491
- get activeDate() {
492
- return this._activeDate;
493
- }
494
- set activeDate(value) {
495
- const oldActiveDate = this._activeDate;
496
- this._activeDate = this._adapter.clampDate(value, this.minDate, this.maxDate);
497
- if (!this._adapter.sameMinute(oldActiveDate, this._activeDate)) {
498
- this._init();
499
- }
500
- }
501
- /** The currently selected date. */
502
- get selected() {
503
- return this._selected;
504
- }
505
- set selected(value) {
506
- this._selected = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
507
- if (this._selected) {
508
- this.activeDate = this._selected;
509
- }
510
- }
511
- /** The minimum selectable date. */
512
- get minDate() {
513
- return this._minDate;
514
- }
515
- set minDate(value) {
516
- this._minDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
517
- }
518
- /** The maximum selectable date. */
519
- get maxDate() {
520
- return this._maxDate;
521
- }
522
- set maxDate(value) {
523
- this._maxDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
524
- }
525
- /** Whether the clock should be started in hour or minute view. */
526
- set startView(value) {
527
- this._hourView = value !== 'minute';
528
- }
529
- get _hand() {
530
- const hour = this._adapter.getHour(this.activeDate);
531
- this._selectedHour = hour;
532
- this._selectedMinute = this._adapter.getMinute(this.activeDate);
533
- let deg = 0;
534
- let radius = CLOCK_OUTER_RADIUS;
535
- if (this._hourView) {
536
- const outer = this._selectedHour > 0 && this._selectedHour < 13;
537
- radius = outer ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
538
- if (this.twelvehour) {
539
- radius = CLOCK_OUTER_RADIUS;
540
- }
541
- deg = Math.round(this._selectedHour * (360 / (24 / 2)));
542
- }
543
- else {
544
- deg = Math.round(this._selectedMinute * (360 / 60));
545
- }
546
- return {
547
- height: `${radius}%`,
548
- marginTop: `${50 - radius}%`,
549
- transform: `rotate(${deg}deg)`,
550
- };
551
- }
552
- ngAfterContentInit() {
553
- this.activeDate = this._activeDate || this._adapter.today();
554
- this._init();
555
- }
556
- ngOnDestroy() {
557
- this._removeGlobalEvents();
558
- }
559
- ngOnChanges() {
560
- this._init();
561
- }
562
- /** Binds our global move and end events. */
563
- _bindGlobalEvents(triggerEvent) {
564
- // Note that we bind the events to the `document`, because it allows us to capture
565
- // drag cancel events where the user's pointer is outside the browser window.
566
- const document = this._document;
567
- const isTouch = isTouchEvent(triggerEvent);
568
- const moveEventName = isTouch ? 'touchmove' : 'mousemove';
569
- const endEventName = isTouch ? 'touchend' : 'mouseup';
570
- document.addEventListener(moveEventName, this._pointerMove, activeEventOptions);
571
- document.addEventListener(endEventName, this._pointerUp, activeEventOptions);
572
- if (isTouch) {
573
- document.addEventListener('touchcancel', this._pointerUp, activeEventOptions);
574
- }
575
- }
576
- /** Removes any global event listeners that we may have added. */
577
- _removeGlobalEvents() {
578
- const document = this._document;
579
- document.removeEventListener('mousemove', this._pointerMove, activeEventOptions);
580
- document.removeEventListener('mouseup', this._pointerUp, activeEventOptions);
581
- document.removeEventListener('touchmove', this._pointerMove, activeEventOptions);
582
- document.removeEventListener('touchend', this._pointerUp, activeEventOptions);
583
- document.removeEventListener('touchcancel', this._pointerUp, activeEventOptions);
584
- }
585
- /** Initializes this clock view. */
586
- _init() {
587
- this._hours.length = 0;
588
- this._minutes.length = 0;
589
- const hourNames = this._adapter.getHourNames();
590
- const minuteNames = this._adapter.getMinuteNames();
591
- if (this.twelvehour) {
592
- const hours = [];
593
- for (let i = 0; i < hourNames.length; i++) {
594
- const radian = (i / 6) * Math.PI;
595
- const radius = CLOCK_OUTER_RADIUS;
596
- const hour = i;
597
- const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), hour, 0);
598
- // Check if the date is enabled, no need to respect the minute setting here
599
- const enabled = (!this.minDate || this._adapter.compareDatetime(date, this.minDate, false) >= 0) &&
600
- (!this.maxDate || this._adapter.compareDatetime(date, this.maxDate, false) <= 0) &&
601
- (!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.HOUR));
602
- // display value for twelvehour clock should be from 1-12 not including 0 and not above 12
603
- hours.push({
604
- value: i,
605
- displayValue: i % 12 === 0 ? '12' : hourNames[i % 12],
606
- enabled,
607
- top: CLOCK_RADIUS - Math.cos(radian) * radius - CLOCK_TICK_RADIUS,
608
- left: CLOCK_RADIUS + Math.sin(radian) * radius - CLOCK_TICK_RADIUS,
609
- });
610
- }
611
- // filter out AM or PM hours based on AMPM
612
- if (this.AMPM === 'AM') {
613
- this._hours = hours.filter(x => x.value < 12);
614
- }
615
- else {
616
- this._hours = hours.filter(x => x.value >= 12);
617
- }
618
- }
619
- else {
620
- for (let i = 0; i < hourNames.length; i++) {
621
- const radian = (i / 6) * Math.PI;
622
- const outer = i > 0 && i < 13;
623
- const radius = outer ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
624
- const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), i, 0);
625
- // Check if the date is enabled, no need to respect the minute setting here
626
- const enabled = (!this.minDate || this._adapter.compareDatetime(date, this.minDate, false) >= 0) &&
627
- (!this.maxDate || this._adapter.compareDatetime(date, this.maxDate, false) <= 0) &&
628
- (!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.HOUR));
629
- this._hours.push({
630
- value: i,
631
- displayValue: i === 0 ? '00' : hourNames[i],
632
- enabled,
633
- top: CLOCK_RADIUS - Math.cos(radian) * radius - CLOCK_TICK_RADIUS,
634
- left: CLOCK_RADIUS + Math.sin(radian) * radius - CLOCK_TICK_RADIUS,
635
- fontSize: i > 0 && i < 13 ? '' : '80%',
636
- });
637
- }
638
- }
639
- for (let i = 0; i < minuteNames.length; i += 5) {
640
- const radian = (i / 30) * Math.PI;
641
- 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);
642
- const enabled = (!this.minDate || this._adapter.compareDatetime(date, this.minDate) >= 0) &&
643
- (!this.maxDate || this._adapter.compareDatetime(date, this.maxDate) <= 0) &&
644
- (!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.MINUTE));
645
- this._minutes.push({
646
- value: i,
647
- displayValue: i === 0 ? '00' : minuteNames[i],
648
- enabled,
649
- top: CLOCK_RADIUS - Math.cos(radian) * CLOCK_OUTER_RADIUS - CLOCK_TICK_RADIUS,
650
- left: CLOCK_RADIUS + Math.sin(radian) * CLOCK_OUTER_RADIUS - CLOCK_TICK_RADIUS,
651
- });
652
- }
653
- }
654
- /**
655
- * Set Time
656
- * @param event
657
- */
658
- setTime(event) {
659
- const trigger = this._elementRef.nativeElement;
660
- const triggerRect = trigger.getBoundingClientRect();
661
- const width = trigger.offsetWidth;
662
- const height = trigger.offsetHeight;
663
- const { pageX, pageY } = getPointerPositionOnPage(event);
664
- const x = width / 2 - (pageX - triggerRect.left - window.pageXOffset);
665
- const y = height / 2 - (pageY - triggerRect.top - window.pageYOffset);
666
- let radian = Math.atan2(-x, y);
667
- const unit = Math.PI / (this._hourView ? 6 : this.interval ? 30 / this.interval : 30);
668
- const z = Math.sqrt(x * x + y * y);
669
- const outer = this._hourView &&
670
- z > (width * (CLOCK_OUTER_RADIUS / 100) + width * (CLOCK_INNER_RADIUS / 100)) / 2;
671
- if (radian < 0) {
672
- radian = Math.PI * 2 + radian;
673
- }
674
- let value = Math.round(radian / unit);
675
- let date;
676
- if (this._hourView) {
677
- if (this.twelvehour) {
678
- if (this.AMPM === 'AM') {
679
- value = value === 0 ? 12 : value;
680
- }
681
- else {
682
- // if we chosen 12 in PM, the value should be 0 for 0:00,
683
- // else we can safely add 12 to the final value
684
- value = value === 12 ? 0 : value + 12;
685
- }
686
- }
687
- else {
688
- if (value === 12) {
689
- value = 0;
690
- }
691
- value = outer ? (value === 0 ? 12 : value) : value === 0 ? 0 : value + 12;
692
- }
693
- 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));
694
- }
695
- else {
696
- if (this.interval) {
697
- value *= this.interval;
698
- }
699
- if (value === 60) {
700
- value = 0;
701
- }
702
- 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);
703
- }
704
- this._timeChanged = true;
705
- this.activeDate = date;
706
- this._changeDetectorRef.markForCheck();
707
- this.activeDateChange.emit(this.activeDate);
708
- }
709
- }
710
- /** @nocollapse */ MtxClock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxClock, deps: [{ token: i0.ElementRef }, { token: i1.DatetimeAdapter }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
711
- /** @nocollapse */ MtxClock.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", 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}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%}.mtx-clock-hand{position:absolute;inset:0;width:1px;margin:0 auto;transform-origin:bottom}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%}.mtx-clock-hours,.mtx-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.mtx-clock-hours.active,.mtx-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.mtx-clock-minutes{transform:scale(.8)}.mtx-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
712
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxClock, decorators: [{
713
- type: Component,
714
- args: [{ selector: 'mtx-clock', host: {
715
- 'role': 'clock',
716
- 'class': 'mtx-clock',
717
- '(mousedown)': '_pointerDown($event)',
718
- '(touchstart)': '_pointerDown($event)',
719
- }, 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}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%}.mtx-clock-hand{position:absolute;inset:0;width:1px;margin:0 auto;transform-origin:bottom}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%}.mtx-clock-hours,.mtx-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.mtx-clock-hours.active,.mtx-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.mtx-clock-minutes{transform:scale(.8)}.mtx-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none}\n"] }]
720
- }], ctorParameters: function () {
721
- return [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
722
- type: Inject,
723
- args: [DOCUMENT]
724
- }] }];
725
- }, propDecorators: { dateFilter: [{
726
- type: Input
727
- }], interval: [{
728
- type: Input
729
- }], twelvehour: [{
730
- type: Input
731
- }], AMPM: [{
732
- type: Input
733
- }], selectedChange: [{
734
- type: Output
735
- }], activeDateChange: [{
736
- type: Output
737
- }], _userSelection: [{
738
- type: Output
739
- }], activeDate: [{
740
- type: Input
741
- }], selected: [{
742
- type: Input
743
- }], minDate: [{
744
- type: Input
745
- }], maxDate: [{
746
- type: Input
747
- }], startView: [{
748
- type: Input
749
- }] } });
750
- /** Returns whether an event is a touch event. */
751
- function isTouchEvent(event) {
752
- // This function is called for every pixel that the user has dragged so we need it to be
753
- // as fast as possible. Since we only bind mouse events and touch events, we can assume
754
- // that if the event's name starts with `t`, it's a touch event.
755
- return event.type[0] === 't';
756
- }
757
- /** Gets the coordinates of a touch or mouse event relative to the document. */
758
- function getPointerPositionOnPage(event) {
759
- let point;
760
- if (isTouchEvent(event)) {
761
- // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.
762
- point = event.touches[0] || event.changedTouches[0];
763
- }
764
- else {
765
- point = event;
766
- }
767
- return point;
768
- }
769
-
770
- function pad(num, size) {
771
- num = String(num);
772
- while (num.length < size)
773
- num = '0' + num;
774
- return num;
775
- }
776
- class MtxTimeInput {
777
- set timeInterval(value) {
778
- this._interval = coerceNumberProperty(value);
779
- }
780
- set timeMin(value) {
781
- this._min = coerceNumberProperty(value);
782
- }
783
- set timeMax(value) {
784
- this._max = coerceNumberProperty(value);
785
- }
786
- set timeValue(value) {
787
- this._value = coerceNumberProperty(value);
788
- if (!this.hasFocus) {
789
- this.writeValue(this._value);
790
- }
791
- this.writePlaceholder(this._value);
792
- }
793
- constructor(element, cdr) {
794
- this.element = element;
795
- this.cdr = cdr;
796
- this._interval = 1;
797
- this._min = 0;
798
- this._max = Infinity;
799
- this.timeValueChanged = new EventEmitter();
800
- this.keyDownListener = this.keyDownHandler.bind(this);
801
- this.keyPressListener = this.keyPressHandler.bind(this);
802
- this.inputEventListener = this.inputChangedHandler.bind(this);
803
- this.inputElement.addEventListener('keydown', this.keyDownListener, {
804
- passive: true,
805
- });
806
- // Do not passive since we want to be able to preventDefault()
807
- this.inputElement.addEventListener('keypress', this.keyPressListener);
808
- this.inputElement.addEventListener('input', this.inputEventListener, {
809
- passive: true,
810
- });
811
- }
812
- get hasFocus() {
813
- var _a;
814
- return this.element.nativeElement && ((_a = this.element) === null || _a === void 0 ? void 0 : _a.nativeElement) === (document === null || document === void 0 ? void 0 : document.activeElement);
815
- }
816
- get inputElement() {
817
- return this.element.nativeElement;
818
- }
819
- // We look here at the placeholder value, because we write '' into the value on focus
820
- // placeholder should always be up to date with "currentValue"
821
- get valid() {
822
- // At the start _value is undefined therefore this would result in not valid and
823
- // make a ugly warning border afterwards we can safely check
824
- if (this._value) {
825
- const currentValue = String(this.inputElement.value);
826
- // It can be that currentValue is empty due to we removing the value on focus,
827
- // if that is the case we should check previous value which should be in the placeholder
828
- if (currentValue.length) {
829
- return this._value == this.inputElement.value;
830
- }
831
- else {
832
- return this._value == this.inputElement.placeholder;
833
- }
834
- }
835
- return true;
836
- }
837
- get invalid() {
838
- return !this.valid;
839
- }
840
- blur() {
841
- this.writeValue(this._value);
842
- this.writePlaceholder(this._value);
843
- this.timeValueChanged.emit(this._value);
844
- }
845
- focus() {
846
- this.writeValue('');
847
- }
848
- /**
849
- * Write value to inputElement
850
- * @param value NumberInput
851
- */
852
- writeValue(value) {
853
- if (value !== '') {
854
- this.inputElement.value = pad(value, 2);
855
- }
856
- else {
857
- this.inputElement.value = '';
858
- }
859
- this.cdr.markForCheck();
860
- }
861
- /**
862
- * Writes value to placeholder
863
- * @param value NumberInput
864
- */
865
- writePlaceholder(value) {
866
- this.inputElement.placeholder = pad(value, 2);
867
- this.cdr.markForCheck();
868
- }
869
- keyDownHandler(event) {
870
- if (String(this.inputElement.value).length > 0) {
871
- let value = null;
872
- if (event.keyCode === UP_ARROW) {
873
- value = coerceNumberProperty(this._value);
874
- value += this._interval;
875
- event.stopPropagation();
876
- }
877
- else if (event.keyCode === DOWN_ARROW) {
878
- value = coerceNumberProperty(this._value);
879
- value -= this._interval;
880
- event.stopPropagation();
881
- }
882
- // if value has changed
883
- if (typeof value === 'number') {
884
- this.writeValue(value);
885
- this.writePlaceholder(value);
886
- this.clampInputValue();
887
- this.timeValueChanged.emit(this._value);
888
- }
889
- }
890
- }
891
- /**
892
- * Prevent non number inputs in the inputElement with the exception of Enter/BackSpace
893
- * @param event KeyboardEvent
894
- */
895
- keyPressHandler(event) {
896
- var _a;
897
- const key = (_a = event === null || event === void 0 ? void 0 : event.key) !== null && _a !== void 0 ? _a : null;
898
- if (isNaN(Number(key)) && key !== 'Enter') {
899
- event.preventDefault();
900
- }
901
- }
902
- inputChangedHandler() {
903
- this.clampInputValue();
904
- this.timeValueChanged.emit(this._value);
905
- }
906
- clampInputValue() {
907
- var _a, _b, _c;
908
- if (((_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value) === '') {
909
- return;
910
- }
911
- const value = coerceNumberProperty((_c = (_b = this.inputElement) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null);
912
- // if this._min === 0, we should allow 0
913
- if (value || (this._min === 0 && value === 0)) {
914
- const clampedValue = Math.min(Math.max(value, this._min), this._max);
915
- if (clampedValue !== value) {
916
- this.writeValue(clampedValue);
917
- this.writePlaceholder(clampedValue);
918
- }
919
- this._value = clampedValue;
920
- }
921
- }
922
- /**
923
- * Remove event listeners on destruction
924
- */
925
- ngOnDestroy() {
926
- this.inputElement.removeEventListener('keydown', this.keyDownListener);
927
- this.inputElement.removeEventListener('keypress', this.keyPressListener);
928
- this.inputElement.removeEventListener('input', this.inputEventListener);
929
- }
930
- }
931
- /** @nocollapse */ MtxTimeInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxTimeInput, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
932
- /** @nocollapse */ MtxTimeInput.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.1", 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 });
933
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxTimeInput, decorators: [{
934
- type: Directive,
935
- args: [{
936
- selector: 'input.mtx-time-input',
937
- host: {
938
- '(blur)': 'blur($event)',
939
- '(focus)': 'focus($event)',
940
- },
941
- exportAs: 'mtxTimeInput',
942
- }]
943
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { timeInterval: [{
944
- type: Input,
945
- args: ['timeInterval']
946
- }], timeMin: [{
947
- type: Input,
948
- args: ['timeMin']
949
- }], timeMax: [{
950
- type: Input,
951
- args: ['timeMax']
952
- }], timeValue: [{
953
- type: Input,
954
- args: ['timeValue']
955
- }], timeValueChanged: [{
956
- type: Output
957
- }] } });
958
- class MtxTime {
959
- /** Whether the clock uses 12 hour format. */
960
- get twelvehour() {
961
- return this._twelvehour;
962
- }
963
- set twelvehour(value) {
964
- this._twelvehour = coerceBooleanProperty(value);
965
- }
966
- /**
967
- * The date to display in this clock view.
968
- */
969
- get activeDate() {
970
- return this._activeDate;
971
- }
972
- set activeDate(value) {
973
- this._activeDate = this._adapter.clampDate(value, this.minDate, this.maxDate);
974
- }
975
- /** The currently selected date. */
976
- get selected() {
977
- return this._selected;
978
- }
979
- set selected(value) {
980
- this._selected = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
981
- if (this._selected) {
982
- this.activeDate = this._selected;
983
- }
984
- }
985
- /** The minimum selectable date. */
986
- get minDate() {
987
- return this._minDate;
988
- }
989
- set minDate(value) {
990
- this._minDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
991
- }
992
- /** The maximum selectable date. */
993
- get maxDate() {
994
- return this._maxDate;
995
- }
996
- set maxDate(value) {
997
- this._maxDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
998
- }
999
- /** Whether the clock should be started in hour or minute view. */
1000
- get clockView() {
1001
- return this._clockView;
1002
- }
1003
- set clockView(value) {
1004
- this._clockView = value;
1005
- }
1006
- get isHourView() {
1007
- return this._clockView === 'hour';
1008
- }
1009
- get isMinuteView() {
1010
- return this._clockView === 'hour';
1011
- }
1012
- get hour() {
1013
- if (!this.activeDate) {
1014
- if (this.twelvehour) {
1015
- return '12';
1016
- }
1017
- else {
1018
- return '00';
1019
- }
1020
- }
1021
- const hour = Number(this._adapter.getHour(this.activeDate));
1022
- if (!this.twelvehour) {
1023
- return this.prefixWithZero(hour);
1024
- }
1025
- if (hour === 0) {
1026
- return '12';
1027
- }
1028
- else {
1029
- return this.prefixWithZero(hour > 12 ? hour - 12 : hour);
1030
- }
1031
- }
1032
- get minute() {
1033
- if (this.activeDate) {
1034
- return this.prefixWithZero(this._adapter.getMinute(this.activeDate));
1035
- }
1036
- return '00';
1037
- }
1038
- prefixWithZero(value) {
1039
- if (value < 10) {
1040
- return '0' + String(value);
1041
- }
1042
- return String(value);
1043
- }
1044
- constructor(_adapter, _changeDetectorRef, _datetimepickerIntl) {
1045
- this._adapter = _adapter;
1046
- this._changeDetectorRef = _changeDetectorRef;
1047
- this._datetimepickerIntl = _datetimepickerIntl;
1048
- /** Emits when the currently selected date changes. */
1049
- this.selectedChange = new EventEmitter();
1050
- /** Emits when any date changes. */
1051
- this.activeDateChange = new EventEmitter();
1052
- /** Emits when any date is selected. */
1053
- this._userSelection = new EventEmitter();
1054
- /** Emits when AM/PM button are clicked. */
1055
- this.ampmChange = new EventEmitter();
1056
- /** Emits when AM/PM button are clicked. */
1057
- this.clockViewChange = new EventEmitter();
1058
- /** Step over minutes. */
1059
- this.interval = 1;
1060
- this._twelvehour = false;
1061
- /** Whether the time is now in AM or PM. */
1062
- this.AMPM = 'AM';
1063
- /** Whether the clock is in hour view. */
1064
- this._clockView = 'hour';
1065
- this.datetimepickerIntlChangesSubscription = this._datetimepickerIntl.changes.subscribe(() => {
1066
- this._changeDetectorRef.detectChanges();
1067
- });
1068
- }
1069
- ngOnChanges(changes) {
1070
- // when clockView changes by input we should focus the correct input
1071
- if (changes.clockView) {
1072
- if (changes.clockView.currentValue !== changes.clockView.previousValue) {
1073
- this.focusInputElement();
1074
- }
1075
- }
1076
- }
1077
- ngAfterViewInit() {
1078
- this.focusInputElement();
1079
- }
1080
- focusInputElement() {
1081
- if (this.clockView === 'hour') {
1082
- if (this.hourInputElement) {
1083
- this.hourInputElement.nativeElement.focus();
1084
- }
1085
- }
1086
- else {
1087
- if (this.minuteInputElement) {
1088
- this.minuteInputElement.nativeElement.focus();
1089
- }
1090
- }
1091
- }
1092
- handleHourInputChange(value) {
1093
- const hour = coerceNumberProperty(value);
1094
- if (hour || hour === 0) {
1095
- const newValue = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), this.updateHourForAmPm(hour), this._adapter.getMinute(this.activeDate));
1096
- this._activeDate = this._adapter.clampDate(newValue, this.minDate, this.maxDate);
1097
- this.activeDateChange.emit(this.activeDate);
1098
- // If previously we did set [mtxValue]="13" and the input changed to 6, and the clamping
1099
- // will make it "13" again then the hourInputDirective will not have been updated
1100
- // since "13" === "13" same reference so no change detected by directly setting it within
1101
- // this handler, we handle this usecase
1102
- if (this.hourInputDirective) {
1103
- this.hourInputDirective.timeValue = this.hour;
1104
- }
1105
- }
1106
- }
1107
- updateHourForAmPm(value) {
1108
- if (!this.twelvehour) {
1109
- return value;
1110
- }
1111
- // value should be between 1-12
1112
- if (this.AMPM === 'AM') {
1113
- if (value === 0 || value === 12) {
1114
- return 0;
1115
- }
1116
- return value;
1117
- }
1118
- // PM
1119
- else {
1120
- if (value === 0 || value === 12) {
1121
- return 12;
1122
- }
1123
- // other cases, we should add 12 to the value aka 3:00 PM = 3 + 12 = 15:00
1124
- return value + 12;
1125
- }
1126
- }
1127
- handleMinuteInputChange(value) {
1128
- const minute = coerceNumberProperty(value);
1129
- if (minute || minute === 0) {
1130
- const newValue = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), this._adapter.getDate(this.activeDate), this._adapter.getHour(this._activeDate), minute);
1131
- this._activeDate = this._adapter.clampDate(newValue, this.minDate, this.maxDate);
1132
- this.activeDateChange.emit(this.activeDate);
1133
- // If previously we did set [mtxValue]="40" and the input changed to 30, and the clamping
1134
- // will make it "40" again then the minuteInputDirective will not have been updated
1135
- // since "40" === "40" same reference so no change detected by directly setting it within
1136
- // this handler, we handle this usecase
1137
- if (this.minuteInputDirective) {
1138
- this.minuteInputDirective.timeValue = this.minute;
1139
- }
1140
- }
1141
- }
1142
- handleFocus(clockView) {
1143
- this.clockView = clockView;
1144
- this.clockViewChange.emit(clockView);
1145
- }
1146
- _timeSelected(date) {
1147
- if (this.clockView === 'hour') {
1148
- this.clockView = 'minute';
1149
- }
1150
- this._activeDate = this.selected = date;
1151
- }
1152
- _onActiveDateChange(date) {
1153
- this._activeDate = date;
1154
- this.activeDateChange.emit(date);
1155
- }
1156
- handleOk() {
1157
- if (this._selected) {
1158
- this.selectedChange.emit(this._selected);
1159
- }
1160
- this._userSelection.emit();
1161
- }
1162
- handleCancel() {
1163
- this._userSelection.emit();
1164
- }
1165
- ngOnDestroy() {
1166
- if (this.datetimepickerIntlChangesSubscription) {
1167
- this.datetimepickerIntlChangesSubscription.unsubscribe();
1168
- }
1169
- }
1170
- }
1171
- /** @nocollapse */ MtxTime.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxTime, deps: [{ token: i1.DatetimeAdapter }, { token: i0.ChangeDetectorRef }, { token: MtxDatetimepickerIntl }], target: i0.ɵɵFactoryTarget.Component });
1172
- /** @nocollapse */ MtxTime.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", 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}.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;flex:1;width:40px;min-width:auto;border-width:1px;border-style:solid}.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 });
1173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxTime, decorators: [{
1174
- type: Component,
1175
- args: [{ selector: 'mtx-time', exportAs: 'mtxTime', host: {
1176
- class: 'mtx-time',
1177
- }, 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}.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;flex:1;width:40px;min-width:auto;border-width:1px;border-style:solid}.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"] }]
1178
- }], ctorParameters: function () { return [{ type: i1.DatetimeAdapter }, { type: i0.ChangeDetectorRef }, { type: MtxDatetimepickerIntl }]; }, propDecorators: { selectedChange: [{
1179
- type: Output
1180
- }], activeDateChange: [{
1181
- type: Output
1182
- }], _userSelection: [{
1183
- type: Output
1184
- }], ampmChange: [{
1185
- type: Output
1186
- }], clockViewChange: [{
1187
- type: Output
1188
- }], dateFilter: [{
1189
- type: Input
1190
- }], interval: [{
1191
- type: Input
1192
- }], hourInputElement: [{
1193
- type: ViewChild,
1194
- args: ['hourInput', { read: (ElementRef) }]
1195
- }], hourInputDirective: [{
1196
- type: ViewChild,
1197
- args: ['hourInput', { read: MtxTimeInput }]
1198
- }], minuteInputElement: [{
1199
- type: ViewChild,
1200
- args: ['minuteInput', { read: (ElementRef) }]
1201
- }], minuteInputDirective: [{
1202
- type: ViewChild,
1203
- args: ['minuteInput', { read: MtxTimeInput }]
1204
- }], twelvehour: [{
1205
- type: Input
1206
- }], AMPM: [{
1207
- type: Input
1208
- }], activeDate: [{
1209
- type: Input
1210
- }], selected: [{
1211
- type: Input
1212
- }], minDate: [{
1213
- type: Input
1214
- }], maxDate: [{
1215
- type: Input
1216
- }], clockView: [{
1217
- type: Input
1218
- }] } });
1219
-
1220
- const DAYS_PER_WEEK = 7;
1221
- /**
1222
- * An internal component used to display a single month in the datetimepicker.
1223
- * @docs-private
1224
- */
1225
- class MtxMonthView {
1226
- constructor(_adapter, _dateFormats) {
1227
- this._adapter = _adapter;
1228
- this._dateFormats = _dateFormats;
1229
- this.type = 'date';
1230
- /** Emits when a new date is selected. */
1231
- this.selectedChange = new EventEmitter();
1232
- /** Emits when any date is selected. */
1233
- this._userSelection = new EventEmitter();
1234
- if (!this._adapter) {
1235
- throw createMissingDateImplError('DatetimeAdapter');
1236
- }
1237
- if (!this._dateFormats) {
1238
- throw createMissingDateImplError('MTX_DATETIME_FORMATS');
1239
- }
1240
- const firstDayOfWeek = this._adapter.getFirstDayOfWeek();
1241
- const narrowWeekdays = this._adapter.getDayOfWeekNames('narrow');
1242
- const longWeekdays = this._adapter.getDayOfWeekNames('long');
1243
- // Rotate the labels for days of the week based on the configured first day of the week.
1244
- const weekdays = longWeekdays.map((long, i) => {
1245
- return { long, narrow: narrowWeekdays[i] };
1246
- });
1247
- this._weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek));
1248
- this._activeDate = this._adapter.today();
1249
- }
1250
- /**
1251
- * The date to display in this month view (everything other than the month and year is ignored).
1252
- */
1253
- get activeDate() {
1254
- return this._activeDate;
1255
- }
1256
- set activeDate(value) {
1257
- const oldActiveDate = this._activeDate;
1258
- this._activeDate = value || this._adapter.today();
1259
- if (oldActiveDate &&
1260
- this._activeDate &&
1261
- !this._adapter.sameMonthAndYear(oldActiveDate, this._activeDate)) {
1262
- this._init();
1263
- if (this._adapter.isInNextMonth(oldActiveDate, this._activeDate)) {
1264
- this.calendarState('right');
1265
- }
1266
- else {
1267
- this.calendarState('left');
1268
- }
1269
- }
1270
- }
1271
- /** The currently selected date. */
1272
- get selected() {
1273
- return this._selected;
1274
- }
1275
- set selected(value) {
1276
- this._selected = value;
1277
- this._selectedDate = this._getDateInCurrentMonth(this.selected);
1278
- }
1279
- ngAfterContentInit() {
1280
- this._init();
1281
- }
1282
- /** Handles when a new date is selected. */
1283
- _dateSelected(date) {
1284
- 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)));
1285
- if (this.type === 'date') {
1286
- this._userSelection.emit();
1287
- }
1288
- }
1289
- _calendarStateDone() {
1290
- this._calendarState = '';
1291
- }
1292
- /** Initializes this month view. */
1293
- _init() {
1294
- this._selectedDate = this._getDateInCurrentMonth(this.selected);
1295
- this._todayDate = this._getDateInCurrentMonth(this._adapter.today());
1296
- 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));
1297
- this._firstWeekOffset =
1298
- (DAYS_PER_WEEK +
1299
- this._adapter.getDayOfWeek(firstOfMonth) -
1300
- this._adapter.getFirstDayOfWeek()) %
1301
- DAYS_PER_WEEK;
1302
- this._createWeekCells();
1303
- }
1304
- /** Creates MdCalendarCells for the dates in this month. */
1305
- _createWeekCells() {
1306
- const daysInMonth = this._adapter.getNumDaysInMonth(this.activeDate);
1307
- const dateNames = this._adapter.getDateNames();
1308
- this._weeks = [[]];
1309
- for (let i = 0, cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {
1310
- if (cell === DAYS_PER_WEEK) {
1311
- this._weeks.push([]);
1312
- cell = 0;
1313
- }
1314
- 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));
1315
- const enabled = !this.dateFilter || this.dateFilter(date);
1316
- const ariaLabel = this._adapter.format(date, this._dateFormats.display.dateA11yLabel);
1317
- this._weeks[this._weeks.length - 1].push(new MtxCalendarCell(i + 1, dateNames[i], ariaLabel, enabled));
1318
- }
1319
- }
1320
- /**
1321
- * Gets the date in this month that the given Date falls on.
1322
- * Returns null if the given Date is in another month.
1323
- */
1324
- _getDateInCurrentMonth(date) {
1325
- return this._adapter.sameMonthAndYear(date, this.activeDate)
1326
- ? this._adapter.getDate(date)
1327
- : null;
1328
- }
1329
- calendarState(direction) {
1330
- this._calendarState = direction;
1331
- }
1332
- }
1333
- /** @nocollapse */ MtxMonthView.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxMonthView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1334
- /** @nocollapse */ MtxMonthView.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", 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 });
1335
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxMonthView, decorators: [{
1336
- type: Component,
1337
- 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" }]
1338
- }], ctorParameters: function () {
1339
- return [{ type: i1.DatetimeAdapter, decorators: [{
1340
- type: Optional
1341
- }] }, { type: undefined, decorators: [{
1342
- type: Optional
1343
- }, {
1344
- type: Inject,
1345
- args: [MTX_DATETIME_FORMATS]
1346
- }] }];
1347
- }, propDecorators: { type: [{
1348
- type: Input
1349
- }], dateFilter: [{
1350
- type: Input
1351
- }], selectedChange: [{
1352
- type: Output
1353
- }], _userSelection: [{
1354
- type: Output
1355
- }], activeDate: [{
1356
- type: Input
1357
- }], selected: [{
1358
- type: Input
1359
- }] } });
1360
-
1361
- /**
1362
- * An internal component used to display a single year in the datetimepicker.
1363
- * @docs-private
1364
- */
1365
- class MtxYearView {
1366
- constructor(_adapter, _dateFormats) {
1367
- this._adapter = _adapter;
1368
- this._dateFormats = _dateFormats;
1369
- this.type = 'date';
1370
- /** Emits when a new month is selected. */
1371
- this.selectedChange = new EventEmitter();
1372
- /** Emits when any date is selected. */
1373
- this._userSelection = new EventEmitter();
1374
- if (!this._adapter) {
1375
- throw createMissingDateImplError('DatetimeAdapter');
1376
- }
1377
- if (!this._dateFormats) {
1378
- throw createMissingDateImplError('MTX_DATETIME_FORMATS');
1379
- }
1380
- this._activeDate = this._adapter.today();
1381
- }
1382
- /** The date to display in this year view (everything other than the year is ignored). */
1383
- get activeDate() {
1384
- return this._activeDate;
1385
- }
1386
- set activeDate(value) {
1387
- const oldActiveDate = this._activeDate;
1388
- this._activeDate = value || this._adapter.today();
1389
- if (oldActiveDate &&
1390
- this._activeDate &&
1391
- !this._adapter.sameYear(oldActiveDate, this._activeDate)) {
1392
- this._init();
1393
- // if (oldActiveDate < this._activeDate) {
1394
- // this.calendarState('right');
1395
- // } else {
1396
- // this.calendarState('left');
1397
- // }
1398
- }
1399
- }
1400
- /** The currently selected date. */
1401
- get selected() {
1402
- return this._selected;
1403
- }
1404
- set selected(value) {
1405
- this._selected = value;
1406
- this._selectedMonth = this._getMonthInCurrentYear(this.selected);
1407
- }
1408
- ngAfterContentInit() {
1409
- this._init();
1410
- }
1411
- /** Handles when a new month is selected. */
1412
- _monthSelected(month) {
1413
- const normalizedDate = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), month, 1, 0, 0);
1414
- this.selectedChange.emit(this._adapter.createDatetime(this._adapter.getYear(this.activeDate), month, Math.min(this._adapter.getDate(this.activeDate), this._adapter.getNumDaysInMonth(normalizedDate)), this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)));
1415
- if (this.type === 'month') {
1416
- this._userSelection.emit();
1417
- }
1418
- }
1419
- _calendarStateDone() {
1420
- this._calendarState = '';
1421
- }
1422
- /** Initializes this month view. */
1423
- _init() {
1424
- this._selectedMonth = this._getMonthInCurrentYear(this.selected);
1425
- this._todayMonth = this._getMonthInCurrentYear(this._adapter.today());
1426
- this._yearLabel = this._adapter.getYearName(this.activeDate);
1427
- const monthNames = this._adapter.getMonthNames('short');
1428
- // First row of months only contains 5 elements so we can fit the year label on the same row.
1429
- this._months = [
1430
- [0, 1, 2, 3],
1431
- [4, 5, 6, 7],
1432
- [8, 9, 10, 11],
1433
- ].map(row => row.map(month => this._createCellForMonth(month, monthNames[month])));
1434
- }
1435
- /**
1436
- * Gets the month in this year that the given Date falls on.
1437
- * Returns null if the given Date is in another year.
1438
- */
1439
- _getMonthInCurrentYear(date) {
1440
- return this._adapter.sameYear(date, this.activeDate) ? this._adapter.getMonth(date) : null;
1441
- }
1442
- /** Creates an MdCalendarCell for the given month. */
1443
- _createCellForMonth(month, monthName) {
1444
- const ariaLabel = this._adapter.format(this._adapter.createDatetime(this._adapter.getYear(this.activeDate), month, 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)), this._dateFormats.display.monthYearA11yLabel);
1445
- return new MtxCalendarCell(month, monthName.toLocaleUpperCase(), ariaLabel, this._isMonthEnabled(month));
1446
- }
1447
- // private calendarState(direction: string): void {
1448
- // this._calendarState = direction;
1449
- // }
1450
- /** Whether the given month is enabled. */
1451
- _isMonthEnabled(month) {
1452
- if (!this.dateFilter) {
1453
- return true;
1454
- }
1455
- const firstOfMonth = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), month, 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
1456
- // If any date in the month is enabled count the month as enabled.
1457
- for (let date = firstOfMonth; this._adapter.getMonth(date) === month; date = this._adapter.addCalendarDays(date, 1)) {
1458
- if (this.dateFilter(date)) {
1459
- return true;
1460
- }
1461
- }
1462
- return false;
1463
- }
1464
- }
1465
- /** @nocollapse */ MtxYearView.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxYearView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1466
- /** @nocollapse */ MtxYearView.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", 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 });
1467
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxYearView, decorators: [{
1468
- type: Component,
1469
- 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" }]
1470
- }], ctorParameters: function () {
1471
- return [{ type: i1.DatetimeAdapter, decorators: [{
1472
- type: Optional
1473
- }] }, { type: undefined, decorators: [{
1474
- type: Optional
1475
- }, {
1476
- type: Inject,
1477
- args: [MTX_DATETIME_FORMATS]
1478
- }] }];
1479
- }, propDecorators: { type: [{
1480
- type: Input
1481
- }], dateFilter: [{
1482
- type: Input
1483
- }], selectedChange: [{
1484
- type: Output
1485
- }], _userSelection: [{
1486
- type: Output
1487
- }], activeDate: [{
1488
- type: Input
1489
- }], selected: [{
1490
- type: Input
1491
- }] } });
1492
-
1493
- /**
1494
- * A calendar that is used as part of the datetimepicker.
1495
- * @docs-private
1496
- */
1497
- class MtxCalendar {
1498
- /** Whether to show multi-year view. */
1499
- get multiYearSelector() {
1500
- return this._multiYearSelector;
1501
- }
1502
- set multiYearSelector(value) {
1503
- this._multiYearSelector = coerceBooleanProperty(value);
1504
- }
1505
- /** Whether the clock uses 12 hour format. */
1506
- get twelvehour() {
1507
- return this._twelvehour;
1508
- }
1509
- set twelvehour(value) {
1510
- this._twelvehour = coerceBooleanProperty(value);
1511
- }
1512
- constructor(_elementRef, _intl, _ngZone, _adapter, _dateFormats, _changeDetectorRef) {
1513
- this._elementRef = _elementRef;
1514
- this._intl = _intl;
1515
- this._ngZone = _ngZone;
1516
- this._adapter = _adapter;
1517
- this._dateFormats = _dateFormats;
1518
- this._multiYearSelector = false;
1519
- this._twelvehour = false;
1520
- /** Whether the calendar should be started in month or year view. */
1521
- this.startView = 'month';
1522
- /** Step over minutes. */
1523
- this.timeInterval = 1;
1524
- /** Prevent user to select same date time */
1525
- this.preventSameDateTimeSelection = false;
1526
- /** Emits when the currently selected date changes. */
1527
- this.selectedChange = new EventEmitter();
1528
- /** Emits when the view has been changed. */
1529
- this.viewChanged = new EventEmitter();
1530
- this._userSelection = new EventEmitter();
1531
- this._clockView = 'hour';
1532
- this._type = 'date';
1533
- this._timeInput = false;
1534
- /** Date filter for the month and year views. */
1535
- this._dateFilterForViews = (date) => {
1536
- return (!!date &&
1537
- (!this.dateFilter || this.dateFilter(date, MtxDatetimepickerFilterType.DATE)) &&
1538
- (!this.minDate || this._adapter.compareDate(date, this.minDate) >= 0) &&
1539
- (!this.maxDate || this._adapter.compareDate(date, this.maxDate) <= 0));
1540
- };
1541
- if (!this._adapter) {
1542
- throw createMissingDateImplError('DatetimeAdapter');
1543
- }
1544
- if (!this._dateFormats) {
1545
- throw createMissingDateImplError('MTX_DATETIME_FORMATS');
1546
- }
1547
- this._intlChanges = _intl.changes.subscribe(() => _changeDetectorRef.markForCheck());
1548
- }
1549
- /** The display type of datetimepicker. */
1550
- get type() {
1551
- return this._type;
1552
- }
1553
- set type(value) {
1554
- this._type = value || 'date';
1555
- if (this.type === 'year') {
1556
- this.multiYearSelector = true;
1557
- }
1558
- }
1559
- /** A date representing the period (month or year) to start the calendar in. */
1560
- get startAt() {
1561
- return this._startAt;
1562
- }
1563
- set startAt(value) {
1564
- this._startAt = this._adapter.getValidDateOrNull(value);
1565
- }
1566
- /**
1567
- * Whether the calendar is in time mode. In time mode the calendar clock gets time input elements
1568
- * rather then just clock. When touchUi is enabled this will be disabled
1569
- */
1570
- get timeInput() {
1571
- return this._timeInput;
1572
- }
1573
- set timeInput(value) {
1574
- this._timeInput = coerceBooleanProperty(value);
1575
- }
1576
- /** The currently selected date. */
1577
- get selected() {
1578
- return this._selected;
1579
- }
1580
- set selected(value) {
1581
- this._selected = this._adapter.getValidDateOrNull(value);
1582
- }
1583
- /** The minimum selectable date. */
1584
- get minDate() {
1585
- return this._minDate;
1586
- }
1587
- set minDate(value) {
1588
- this._minDate = this._adapter.getValidDateOrNull(value);
1589
- }
1590
- /** The maximum selectable date. */
1591
- get maxDate() {
1592
- return this._maxDate;
1593
- }
1594
- set maxDate(value) {
1595
- this._maxDate = this._adapter.getValidDateOrNull(value);
1596
- }
1597
- /**
1598
- * The current active date. This determines which time period is shown and which date is
1599
- * highlighted when using keyboard navigation.
1600
- */
1601
- get _activeDate() {
1602
- return this._clampedActiveDate;
1603
- }
1604
- set _activeDate(value) {
1605
- const oldActiveDate = this._clampedActiveDate;
1606
- this._clampedActiveDate = this._adapter.clampDate(value, this.minDate, this.maxDate);
1607
- // whenever active date changed, and possibly got clamped we should adjust the am/pm setting
1608
- this._selectAMPM(this._clampedActiveDate);
1609
- if (oldActiveDate &&
1610
- this._clampedActiveDate &&
1611
- this.currentView === 'month' &&
1612
- !this._adapter.sameMonthAndYear(oldActiveDate, this._clampedActiveDate)) {
1613
- if (this._adapter.isInNextMonth(oldActiveDate, this._clampedActiveDate)) {
1614
- this.calendarState('right');
1615
- }
1616
- else {
1617
- this.calendarState('left');
1618
- }
1619
- }
1620
- }
1621
- /** Whether the calendar is in month view. */
1622
- get currentView() {
1623
- return this._currentView;
1624
- }
1625
- set currentView(view) {
1626
- this._currentView = view;
1627
- this.viewChanged.emit(view);
1628
- }
1629
- get _yearPeriodText() {
1630
- if (this.currentView === 'multi-year') {
1631
- // The offset from the active year to the "slot" for the starting year is the
1632
- // *actual* first rendered year in the multi-year view, and the last year is
1633
- // just yearsPerPage - 1 away.
1634
- const activeYear = this._adapter.getYear(this._activeDate);
1635
- const minYearOfPage = activeYear - getActiveOffset(this._adapter, this._activeDate, this.minDate, this.maxDate);
1636
- const maxYearOfPage = minYearOfPage + yearsPerPage - 1;
1637
- const minYearName = this._adapter.getYearName(this._adapter.createDate(minYearOfPage, 0, 1));
1638
- const maxYearName = this._adapter.getYearName(this._adapter.createDate(maxYearOfPage, 0, 1));
1639
- return this._intl.formatYearRange(minYearName, maxYearName);
1640
- }
1641
- return this.currentView === 'month'
1642
- ? this._adapter.getMonthNames('long')[this._adapter.getMonth(this._activeDate)]
1643
- : this._adapter.getYearName(this._activeDate);
1644
- }
1645
- get _yearButtonText() {
1646
- return this._adapter.getYearName(this._activeDate);
1647
- }
1648
- get _yearButtonLabel() {
1649
- return this.multiYearSelector
1650
- ? this._intl.switchToMultiYearViewLabel
1651
- : this._intl.switchToYearViewLabel;
1652
- }
1653
- get _dateButtonText() {
1654
- switch (this.type) {
1655
- case 'month':
1656
- return this._adapter.getMonthNames('long')[this._adapter.getMonth(this._activeDate)];
1657
- default:
1658
- return this._adapter.format(this._activeDate, this._dateFormats.display.popupHeaderDateLabel);
1659
- }
1660
- }
1661
- get _dateButtonLabel() {
1662
- return this._intl.switchToMonthViewLabel;
1663
- }
1664
- get _hoursButtonText() {
1665
- let hour = this._adapter.getHour(this._activeDate);
1666
- if (this.twelvehour) {
1667
- if (hour === 0) {
1668
- hour = 24;
1669
- }
1670
- hour = hour > 12 ? hour - 12 : hour;
1671
- }
1672
- return this._2digit(hour);
1673
- }
1674
- get _hourButtonLabel() {
1675
- return this._intl.switchToClockHourViewLabel;
1676
- }
1677
- get _minutesButtonText() {
1678
- return this._2digit(this._adapter.getMinute(this._activeDate));
1679
- }
1680
- get _minuteButtonLabel() {
1681
- return this._intl.switchToClockMinuteViewLabel;
1682
- }
1683
- get _prevButtonLabel() {
1684
- switch (this._currentView) {
1685
- case 'month':
1686
- return this._intl.prevMonthLabel;
1687
- case 'year':
1688
- return this._intl.prevYearLabel;
1689
- case 'multi-year':
1690
- return this._intl.prevMultiYearLabel;
1691
- default:
1692
- return '';
1693
- }
1694
- }
1695
- get _nextButtonLabel() {
1696
- switch (this._currentView) {
1697
- case 'month':
1698
- return this._intl.nextMonthLabel;
1699
- case 'year':
1700
- return this._intl.nextYearLabel;
1701
- case 'multi-year':
1702
- return this._intl.nextMultiYearLabel;
1703
- default:
1704
- return '';
1705
- }
1706
- }
1707
- _userSelected() {
1708
- this._userSelection.emit();
1709
- }
1710
- ngAfterContentInit() {
1711
- this._activeDate = this.startAt || this._adapter.today();
1712
- this._selectAMPM(this._activeDate);
1713
- if (this.type === 'year') {
1714
- this.currentView = 'multi-year';
1715
- }
1716
- else if (this.type === 'month') {
1717
- this.currentView = 'year';
1718
- }
1719
- else if (this.type === 'time') {
1720
- this.currentView = 'clock';
1721
- }
1722
- else {
1723
- this.currentView = this.startView || 'month';
1724
- }
1725
- }
1726
- ngOnDestroy() {
1727
- this._intlChanges.unsubscribe();
1728
- }
1729
- /** Handles date selection in the month view. */
1730
- _dateSelected(date) {
1731
- if (this.type === 'date') {
1732
- if (!this._adapter.sameDate(date, this.selected) || !this.preventSameDateTimeSelection) {
1733
- this.selectedChange.emit(date);
1734
- }
1735
- }
1736
- else {
1737
- this._activeDate = date;
1738
- this.currentView = 'clock';
1739
- }
1740
- }
1741
- /** Handles month selection in the year view. */
1742
- _monthSelected(month) {
1743
- if (this.type === 'month') {
1744
- if (!this._adapter.sameMonthAndYear(month, this.selected) ||
1745
- !this.preventSameDateTimeSelection) {
1746
- this.selectedChange.emit(this._adapter.getFirstDateOfMonth(month));
1747
- }
1748
- }
1749
- else {
1750
- this._activeDate = month;
1751
- this.currentView = 'month';
1752
- this._clockView = 'hour';
1753
- }
1754
- }
1755
- /** Handles year selection in the multi year view. */
1756
- _yearSelected(year) {
1757
- if (this.type === 'year') {
1758
- if (!this._adapter.sameYear(year, this.selected) || !this.preventSameDateTimeSelection) {
1759
- const normalizedDate = this._adapter.createDatetime(this._adapter.getYear(year), 0, 1, 0, 0);
1760
- this.selectedChange.emit(normalizedDate);
1761
- }
1762
- }
1763
- else {
1764
- this._activeDate = year;
1765
- this.currentView = 'year';
1766
- }
1767
- }
1768
- _timeSelected(date) {
1769
- this._activeDate = this._updateDate(date);
1770
- if (!this._adapter.sameDatetime(date, this.selected) || !this.preventSameDateTimeSelection) {
1771
- this.selectedChange.emit(date);
1772
- }
1773
- }
1774
- _dialTimeSelected(date) {
1775
- if (this._clockView !== 'minute') {
1776
- this._activeDate = this._updateDate(date);
1777
- this._clockView = 'minute';
1778
- }
1779
- else {
1780
- if (!this._adapter.sameDatetime(date, this.selected) || !this.preventSameDateTimeSelection) {
1781
- this.selectedChange.emit(date);
1782
- }
1783
- }
1784
- }
1785
- _onActiveDateChange(date) {
1786
- this._activeDate = date;
1787
- }
1788
- _updateDate(date) {
1789
- if (this.twelvehour) {
1790
- const HOUR = this._adapter.getHour(date);
1791
- if (HOUR === 12) {
1792
- if (this._AMPM === 'AM') {
1793
- return this._adapter.addCalendarHours(date, -12);
1794
- }
1795
- }
1796
- else if (this._AMPM === 'PM') {
1797
- return this._adapter.addCalendarHours(date, 12);
1798
- }
1799
- }
1800
- return date;
1801
- }
1802
- _selectAMPM(date) {
1803
- const hour = this._adapter.getHour(date);
1804
- if (hour > 11) {
1805
- this._AMPM = 'PM';
1806
- }
1807
- else {
1808
- this._AMPM = 'AM';
1809
- }
1810
- }
1811
- _ampmClicked(source) {
1812
- this._currentView = 'clock';
1813
- if (source === this._AMPM) {
1814
- return;
1815
- }
1816
- // if AMPM changed from PM to AM substract 12 hours
1817
- const currentHour = this._adapter.getHour(this._activeDate);
1818
- let newHourValue;
1819
- if (source === 'AM') {
1820
- newHourValue = currentHour >= 12 ? this._adapter.getHour(this._activeDate) - 12 : 12;
1821
- }
1822
- // otherwise add 12 hours
1823
- else {
1824
- newHourValue = (currentHour + 12) % 24;
1825
- }
1826
- const newActiveDate = this._adapter.clampDate(this._adapter.createDatetime(this._adapter.getYear(this._activeDate), this._adapter.getMonth(this._activeDate), this._adapter.getDate(this._activeDate), newHourValue, this._adapter.getMinute(this._activeDate)), this.minDate, this.maxDate);
1827
- // only if our clamped date is not changed, we know we can apply the newActiveDate to the
1828
- // activeDate
1829
- if (this._adapter.getHour(newActiveDate) === newHourValue) {
1830
- this._activeDate = newActiveDate;
1831
- this._AMPM = source;
1832
- }
1833
- }
1834
- _yearClicked() {
1835
- if (this.type === 'year' || this.multiYearSelector) {
1836
- this.currentView = 'multi-year';
1837
- return;
1838
- }
1839
- this.currentView = 'year';
1840
- }
1841
- _dateClicked() {
1842
- if (this.type !== 'month') {
1843
- this.currentView = 'month';
1844
- }
1845
- }
1846
- _hoursClicked() {
1847
- this.currentView = 'clock';
1848
- this._clockView = 'hour';
1849
- }
1850
- _minutesClicked() {
1851
- this.currentView = 'clock';
1852
- this._clockView = 'minute';
1853
- }
1854
- /** Handles user clicks on the previous button. */
1855
- _previousClicked() {
1856
- this._activeDate =
1857
- this.currentView === 'month'
1858
- ? this._adapter.addCalendarMonths(this._activeDate, -1)
1859
- : this._adapter.addCalendarYears(this._activeDate, this.currentView === 'year' ? -1 : -yearsPerPage);
1860
- }
1861
- /** Handles user clicks on the next button. */
1862
- _nextClicked() {
1863
- this._activeDate =
1864
- this.currentView === 'month'
1865
- ? this._adapter.addCalendarMonths(this._activeDate, 1)
1866
- : this._adapter.addCalendarYears(this._activeDate, this.currentView === 'year' ? 1 : yearsPerPage);
1867
- }
1868
- /** Whether the previous period button is enabled. */
1869
- _previousEnabled() {
1870
- if (!this.minDate) {
1871
- return true;
1872
- }
1873
- return !this.minDate || !this._isSameView(this._activeDate, this.minDate);
1874
- }
1875
- /** Whether the next period button is enabled. */
1876
- _nextEnabled() {
1877
- return !this.maxDate || !this._isSameView(this._activeDate, this.maxDate);
1878
- }
1879
- /** Handles keydown events on the calendar body. */
1880
- _handleCalendarBodyKeydown(event) {
1881
- // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent
1882
- // disabled ones from being selected. This may not be ideal, we should look into whether
1883
- // navigation should skip over disabled dates, and if so, how to implement that efficiently.
1884
- if (this.currentView === 'month') {
1885
- this._handleCalendarBodyKeydownInMonthView(event);
1886
- }
1887
- else if (this.currentView === 'year') {
1888
- this._handleCalendarBodyKeydownInYearView(event);
1889
- }
1890
- else if (this.currentView === 'multi-year') {
1891
- this._handleCalendarBodyKeydownInMultiYearView(event);
1892
- }
1893
- else {
1894
- this._handleCalendarBodyKeydownInClockView(event);
1895
- }
1896
- }
1897
- _focusActiveCell() {
1898
- this._ngZone.runOutsideAngular(() => {
1899
- this._ngZone.onStable
1900
- .asObservable()
1901
- .pipe(first())
1902
- .subscribe(() => {
1903
- this._elementRef.nativeElement.focus();
1904
- });
1905
- });
1906
- }
1907
- _calendarStateDone() {
1908
- this._calendarState = '';
1909
- }
1910
- /** Whether the two dates represent the same view in the current view mode (month or year). */
1911
- _isSameView(date1, date2) {
1912
- if (this.currentView === 'month') {
1913
- return (this._adapter.getYear(date1) === this._adapter.getYear(date2) &&
1914
- this._adapter.getMonth(date1) === this._adapter.getMonth(date2));
1915
- }
1916
- if (this.currentView === 'year') {
1917
- return this._adapter.getYear(date1) === this._adapter.getYear(date2);
1918
- }
1919
- // Otherwise we are in 'multi-year' view.
1920
- return isSameMultiYearView(this._adapter, date1, date2, this.minDate, this.maxDate);
1921
- }
1922
- /** Handles keydown events on the calendar body when calendar is in month view. */
1923
- _handleCalendarBodyKeydownInMonthView(event) {
1924
- switch (event.keyCode) {
1925
- case LEFT_ARROW:
1926
- this._activeDate = this._adapter.addCalendarDays(this._activeDate, -1);
1927
- break;
1928
- case RIGHT_ARROW:
1929
- this._activeDate = this._adapter.addCalendarDays(this._activeDate, 1);
1930
- break;
1931
- case UP_ARROW:
1932
- this._activeDate = this._adapter.addCalendarDays(this._activeDate, -7);
1933
- break;
1934
- case DOWN_ARROW:
1935
- this._activeDate = this._adapter.addCalendarDays(this._activeDate, 7);
1936
- break;
1937
- case HOME:
1938
- this._activeDate = this._adapter.addCalendarDays(this._activeDate, 1 - this._adapter.getDate(this._activeDate));
1939
- break;
1940
- case END:
1941
- this._activeDate = this._adapter.addCalendarDays(this._activeDate, this._adapter.getNumDaysInMonth(this._activeDate) -
1942
- this._adapter.getDate(this._activeDate));
1943
- break;
1944
- case PAGE_UP:
1945
- this._activeDate = event.altKey
1946
- ? this._adapter.addCalendarYears(this._activeDate, -1)
1947
- : this._adapter.addCalendarMonths(this._activeDate, -1);
1948
- break;
1949
- case PAGE_DOWN:
1950
- this._activeDate = event.altKey
1951
- ? this._adapter.addCalendarYears(this._activeDate, 1)
1952
- : this._adapter.addCalendarMonths(this._activeDate, 1);
1953
- break;
1954
- case ENTER:
1955
- if (this._dateFilterForViews(this._activeDate)) {
1956
- this._dateSelected(this._activeDate);
1957
- // Prevent unexpected default actions such as form submission.
1958
- event.preventDefault();
1959
- }
1960
- return;
1961
- default:
1962
- // Don't prevent default or focus active cell on keys that we don't explicitly handle.
1963
- return;
1964
- }
1965
- // Prevent unexpected default actions such as form submission.
1966
- event.preventDefault();
1967
- }
1968
- /** Handles keydown events on the calendar body when calendar is in year view. */
1969
- _handleCalendarBodyKeydownInYearView(event) {
1970
- switch (event.keyCode) {
1971
- case LEFT_ARROW:
1972
- this._activeDate = this._adapter.addCalendarMonths(this._activeDate, -1);
1973
- break;
1974
- case RIGHT_ARROW:
1975
- this._activeDate = this._adapter.addCalendarMonths(this._activeDate, 1);
1976
- break;
1977
- case UP_ARROW:
1978
- this._activeDate = this._prevMonthInSameCol(this._activeDate);
1979
- break;
1980
- case DOWN_ARROW:
1981
- this._activeDate = this._nextMonthInSameCol(this._activeDate);
1982
- break;
1983
- case HOME:
1984
- this._activeDate = this._adapter.addCalendarMonths(this._activeDate, -this._adapter.getMonth(this._activeDate));
1985
- break;
1986
- case END:
1987
- this._activeDate = this._adapter.addCalendarMonths(this._activeDate, 11 - this._adapter.getMonth(this._activeDate));
1988
- break;
1989
- case PAGE_UP:
1990
- this._activeDate = this._adapter.addCalendarYears(this._activeDate, event.altKey ? -10 : -1);
1991
- break;
1992
- case PAGE_DOWN:
1993
- this._activeDate = this._adapter.addCalendarYears(this._activeDate, event.altKey ? 10 : 1);
1994
- break;
1995
- case ENTER:
1996
- this._monthSelected(this._activeDate);
1997
- break;
1998
- default:
1999
- // Don't prevent default or focus active cell on keys that we don't explicitly handle.
2000
- return;
2001
- }
2002
- // Prevent unexpected default actions such as form submission.
2003
- event.preventDefault();
2004
- }
2005
- /** Handles keydown events on the calendar body when calendar is in multi-year view. */
2006
- _handleCalendarBodyKeydownInMultiYearView(event) {
2007
- switch (event.keyCode) {
2008
- case LEFT_ARROW:
2009
- this._activeDate = this._adapter.addCalendarYears(this._activeDate, -1);
2010
- break;
2011
- case RIGHT_ARROW:
2012
- this._activeDate = this._adapter.addCalendarYears(this._activeDate, 1);
2013
- break;
2014
- case UP_ARROW:
2015
- this._activeDate = this._adapter.addCalendarYears(this._activeDate, -yearsPerRow);
2016
- break;
2017
- case DOWN_ARROW:
2018
- this._activeDate = this._adapter.addCalendarYears(this._activeDate, yearsPerRow);
2019
- break;
2020
- case HOME:
2021
- this._activeDate = this._adapter.addCalendarYears(this._activeDate, -getActiveOffset(this._adapter, this._activeDate, this.minDate, this.maxDate));
2022
- break;
2023
- case END:
2024
- this._activeDate = this._adapter.addCalendarYears(this._activeDate, yearsPerPage -
2025
- getActiveOffset(this._adapter, this._activeDate, this.minDate, this.maxDate) -
2026
- 1);
2027
- break;
2028
- case PAGE_UP:
2029
- this._activeDate = this._adapter.addCalendarYears(this._activeDate, event.altKey ? -yearsPerPage * 10 : -yearsPerPage);
2030
- break;
2031
- case PAGE_DOWN:
2032
- this._activeDate = this._adapter.addCalendarYears(this._activeDate, event.altKey ? yearsPerPage * 10 : yearsPerPage);
2033
- break;
2034
- case ENTER:
2035
- this._yearSelected(this._activeDate);
2036
- break;
2037
- default:
2038
- // Don't prevent default or focus active cell on keys that we don't explicitly handle.
2039
- return;
2040
- }
2041
- }
2042
- /** Handles keydown events on the calendar body when calendar is in month view. */
2043
- _handleCalendarBodyKeydownInClockView(event) {
2044
- switch (event.keyCode) {
2045
- case UP_ARROW:
2046
- this._activeDate =
2047
- this._clockView === 'hour'
2048
- ? this._adapter.addCalendarHours(this._activeDate, 1)
2049
- : this._adapter.addCalendarMinutes(this._activeDate, this.timeInterval);
2050
- break;
2051
- case DOWN_ARROW:
2052
- this._activeDate =
2053
- this._clockView === 'hour'
2054
- ? this._adapter.addCalendarHours(this._activeDate, -1)
2055
- : this._adapter.addCalendarMinutes(this._activeDate, -this.timeInterval);
2056
- break;
2057
- case ENTER:
2058
- if (!this.timeInput) {
2059
- this._dialTimeSelected(this._activeDate);
2060
- }
2061
- return;
2062
- default:
2063
- // Don't prevent default or focus active cell on keys that we don't explicitly handle.
2064
- return;
2065
- }
2066
- // Prevent unexpected default actions such as form submission.
2067
- event.preventDefault();
2068
- }
2069
- /**
2070
- * Determine the date for the month that comes before the given month in the same column in the
2071
- * calendar table.
2072
- */
2073
- _prevMonthInSameCol(date) {
2074
- // Determine how many months to jump forward given that there are 2 empty slots at the beginning
2075
- // of each year.
2076
- const increment = this._adapter.getMonth(date) <= 4 ? -5 : this._adapter.getMonth(date) >= 7 ? -7 : -12;
2077
- return this._adapter.addCalendarMonths(date, increment);
2078
- }
2079
- /**
2080
- * Determine the date for the month that comes after the given month in the same column in the
2081
- * calendar table.
2082
- */
2083
- _nextMonthInSameCol(date) {
2084
- // Determine how many months to jump forward given that there are 2 empty slots at the beginning
2085
- // of each year.
2086
- const increment = this._adapter.getMonth(date) <= 4 ? 7 : this._adapter.getMonth(date) >= 7 ? 5 : 12;
2087
- return this._adapter.addCalendarMonths(date, increment);
2088
- }
2089
- calendarState(direction) {
2090
- this._calendarState = direction;
2091
- }
2092
- _2digit(n) {
2093
- return ('00' + n).slice(-2);
2094
- }
2095
- }
2096
- /** @nocollapse */ MtxCalendar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", 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 });
2097
- /** @nocollapse */ MtxCalendar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", 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}.mtx-calendar-header{box-sizing:border-box;padding:8px;border-radius:4px 4px 0 0}.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}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-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 });
2098
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxCalendar, decorators: [{
2099
- type: Component,
2100
- args: [{ selector: 'mtx-calendar', host: {
2101
- 'class': 'mtx-calendar',
2102
- '[class.mtx-calendar-with-time-input]': 'timeInput',
2103
- 'tabindex': '0',
2104
- '(keydown)': '_handleCalendarBodyKeydown($event)',
2105
- }, 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}.mtx-calendar-header{box-sizing:border-box;padding:8px;border-radius:4px 4px 0 0}.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}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0}\n"] }]
2106
- }], ctorParameters: function () {
2107
- return [{ type: i0.ElementRef }, { type: MtxDatetimepickerIntl }, { type: i0.NgZone }, { type: i1.DatetimeAdapter, decorators: [{
2108
- type: Optional
2109
- }] }, { type: undefined, decorators: [{
2110
- type: Optional
2111
- }, {
2112
- type: Inject,
2113
- args: [MTX_DATETIME_FORMATS]
2114
- }] }, { type: i0.ChangeDetectorRef }];
2115
- }, propDecorators: { multiYearSelector: [{
2116
- type: Input
2117
- }], twelvehour: [{
2118
- type: Input
2119
- }], startView: [{
2120
- type: Input
2121
- }], timeInterval: [{
2122
- type: Input
2123
- }], dateFilter: [{
2124
- type: Input
2125
- }], preventSameDateTimeSelection: [{
2126
- type: Input
2127
- }], selectedChange: [{
2128
- type: Output
2129
- }], viewChanged: [{
2130
- type: Output
2131
- }], _userSelection: [{
2132
- type: Output
2133
- }], type: [{
2134
- type: Input
2135
- }], startAt: [{
2136
- type: Input
2137
- }], timeInput: [{
2138
- type: Input
2139
- }], selected: [{
2140
- type: Input
2141
- }], minDate: [{
2142
- type: Input
2143
- }], maxDate: [{
2144
- type: Input
2145
- }] } });
2146
-
2147
- /** Used to generate a unique ID for each datetimepicker instance. */
2148
- let datetimepickerUid = 0;
2149
- /** Injection token that determines the scroll handling while the calendar is open. */
2150
- const MTX_DATETIMEPICKER_SCROLL_STRATEGY = new InjectionToken('mtx-datetimepicker-scroll-strategy');
2151
- function MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY(overlay) {
2152
- return () => overlay.scrollStrategies.reposition();
2153
- }
2154
- const MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = {
2155
- provide: MTX_DATETIMEPICKER_SCROLL_STRATEGY,
2156
- deps: [Overlay],
2157
- useFactory: MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY,
2158
- };
2159
- // Boilerplate for applying mixins to MtxDatetimepickerContent.
2160
- /** @docs-private */
2161
- const _MtxDatetimepickerContentBase = mixinColor(class {
2162
- constructor(_elementRef) {
2163
- this._elementRef = _elementRef;
2164
- }
2165
- });
2166
- /**
2167
- * Component used as the content for the datetimepicker dialog and popup. We use this instead of
2168
- * using MtxCalendar directly as the content so we can control the initial focus. This also gives us
2169
- * a place to put additional features of the popup that are not part of the calendar itself in the
2170
- * future. (e.g. confirmation buttons).
2171
- * @docs-private
2172
- */
2173
- class MtxDatetimepickerContent extends _MtxDatetimepickerContentBase {
2174
- constructor(elementRef, _changeDetectorRef) {
2175
- super(elementRef);
2176
- this._changeDetectorRef = _changeDetectorRef;
2177
- /** Emits when an animation has finished. */
2178
- this._animationDone = new Subject();
2179
- /** Id of the label for the `role="dialog"` element. */
2180
- this._dialogLabelId = null;
2181
- }
2182
- ngOnInit() {
2183
- this._animationState = this.datetimepicker.touchUi ? 'enter-dialog' : 'enter-dropdown';
2184
- }
2185
- ngAfterContentInit() {
2186
- this._calendar._focusActiveCell();
2187
- }
2188
- _startExitAnimation() {
2189
- this._animationState = 'void';
2190
- this._changeDetectorRef.markForCheck();
2191
- }
2192
- ngOnDestroy() {
2193
- this._animationDone.complete();
2194
- }
2195
- }
2196
- /** @nocollapse */ MtxDatetimepickerContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerContent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2197
- /** @nocollapse */ MtxDatetimepickerContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: MtxDatetimepickerContent, selector: "mtx-datetimepicker-content", inputs: { color: "color" }, host: { listeners: { "@transformPanel.done": "_animationDone.next()" }, properties: { "class.mtx-datetimepicker-content-touch": "datetimepicker?.touchUi", "attr.mode": "datetimepicker.mode", "@transformPanel": "_animationState" }, classAttribute: "mtx-datetimepicker-content" }, viewQueries: [{ propertyName: "_calendar", first: true, predicate: MtxCalendar, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div cdkTrapFocus\n role=\"dialog\"\n [attr.aria-modal]=\"true\"\n [attr.aria-labelledby]=\"_dialogLabelId ?? undefined\"\n [attr.mode]=\"datetimepicker.mode\"\n class=\"mtx-datetimepicker-content-container\">\n <mtx-calendar [id]=\"datetimepicker.id\"\n [ngClass]=\"datetimepicker.panelClass\"\n [attr.mode]=\"datetimepicker.mode\"\n [type]=\"datetimepicker.type\"\n [startAt]=\"datetimepicker.startAt\"\n [startView]=\"datetimepicker.startView\"\n [maxDate]=\"datetimepicker._maxDate\"\n [minDate]=\"datetimepicker._minDate\"\n [dateFilter]=\"datetimepicker._dateFilter\"\n [multiYearSelector]=\"datetimepicker.multiYearSelector\"\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\n [timeInterval]=\"datetimepicker.timeInterval\"\n [twelvehour]=\"datetimepicker.twelvehour\"\n [selected]=\"datetimepicker._selected\"\n [timeInput]=\"datetimepicker.timeInput\"\n (selectedChange)=\"datetimepicker._select($event)\"\n (viewChanged)=\"datetimepicker._viewChanged($event)\"\n (_userSelection)=\"datetimepicker.close()\"\n [@fadeInCalendar]=\"'enter'\">\n </mtx-calendar>\n</div>\n", styles: [".mtx-datetimepicker-content{display:block;border-radius:4px}.mtx-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mtx-datetimepicker-content .mtx-calendar{width:296px;height:424px}.mtx-datetimepicker-content .mtx-calendar.mtx-calendar-with-time-input{height:490px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar{width: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: [
2198
- mtxDatetimepickerAnimations.transformPanel,
2199
- mtxDatetimepickerAnimations.fadeInCalendar,
2200
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2201
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerContent, decorators: [{
2202
- type: Component,
2203
- args: [{ selector: 'mtx-datetimepicker-content', host: {
2204
- 'class': 'mtx-datetimepicker-content',
2205
- '[class.mtx-datetimepicker-content-touch]': 'datetimepicker?.touchUi',
2206
- '[attr.mode]': 'datetimepicker.mode',
2207
- '[@transformPanel]': '_animationState',
2208
- '(@transformPanel.done)': '_animationDone.next()',
2209
- }, animations: [
2210
- mtxDatetimepickerAnimations.transformPanel,
2211
- mtxDatetimepickerAnimations.fadeInCalendar,
2212
- ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['color'], template: "<div cdkTrapFocus\n role=\"dialog\"\n [attr.aria-modal]=\"true\"\n [attr.aria-labelledby]=\"_dialogLabelId ?? undefined\"\n [attr.mode]=\"datetimepicker.mode\"\n class=\"mtx-datetimepicker-content-container\">\n <mtx-calendar [id]=\"datetimepicker.id\"\n [ngClass]=\"datetimepicker.panelClass\"\n [attr.mode]=\"datetimepicker.mode\"\n [type]=\"datetimepicker.type\"\n [startAt]=\"datetimepicker.startAt\"\n [startView]=\"datetimepicker.startView\"\n [maxDate]=\"datetimepicker._maxDate\"\n [minDate]=\"datetimepicker._minDate\"\n [dateFilter]=\"datetimepicker._dateFilter\"\n [multiYearSelector]=\"datetimepicker.multiYearSelector\"\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\n [timeInterval]=\"datetimepicker.timeInterval\"\n [twelvehour]=\"datetimepicker.twelvehour\"\n [selected]=\"datetimepicker._selected\"\n [timeInput]=\"datetimepicker.timeInput\"\n (selectedChange)=\"datetimepicker._select($event)\"\n (viewChanged)=\"datetimepicker._viewChanged($event)\"\n (_userSelection)=\"datetimepicker.close()\"\n [@fadeInCalendar]=\"'enter'\">\n </mtx-calendar>\n</div>\n", styles: [".mtx-datetimepicker-content{display:block;border-radius:4px}.mtx-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mtx-datetimepicker-content .mtx-calendar{width:296px;height:424px}.mtx-datetimepicker-content .mtx-calendar.mtx-calendar-with-time-input{height:490px}.mtx-datetimepicker-content[mode=landscape] .mtx-calendar{width: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"] }]
2213
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { _calendar: [{
2214
- type: ViewChild,
2215
- args: [MtxCalendar, { static: true }]
2216
- }] } });
2217
- class MtxDatetimepicker {
2218
- /** Whether to show multi-year view. */
2219
- get multiYearSelector() {
2220
- return this._multiYearSelector;
2221
- }
2222
- set multiYearSelector(value) {
2223
- this._multiYearSelector = coerceBooleanProperty(value);
2224
- }
2225
- /** Whether the clock uses 12 hour format. */
2226
- get twelvehour() {
2227
- return this._twelvehour;
2228
- }
2229
- set twelvehour(value) {
2230
- this._twelvehour = coerceBooleanProperty(value);
2231
- }
2232
- /**
2233
- * Classes to be passed to the date picker panel.
2234
- * Supports string and string array values, similar to `ngClass`.
2235
- */
2236
- get panelClass() {
2237
- return this._panelClass;
2238
- }
2239
- set panelClass(value) {
2240
- this._panelClass = coerceStringArray(value);
2241
- }
2242
- /** Whether the calendar is open. */
2243
- get opened() {
2244
- return this._opened;
2245
- }
2246
- set opened(value) {
2247
- coerceBooleanProperty(value) ? this.open() : this.close();
2248
- }
2249
- /** Color palette to use on the datetimepicker's calendar. */
2250
- get color() {
2251
- return (this._color ||
2252
- (this.datetimepickerInput ? this.datetimepickerInput.getThemePalette() : undefined));
2253
- }
2254
- set color(value) {
2255
- this._color = value;
2256
- }
2257
- constructor(_overlay, _ngZone, _viewContainerRef, _scrollStrategy, _dateAdapter, _dir) {
2258
- this._overlay = _overlay;
2259
- this._ngZone = _ngZone;
2260
- this._viewContainerRef = _viewContainerRef;
2261
- this._scrollStrategy = _scrollStrategy;
2262
- this._dateAdapter = _dateAdapter;
2263
- this._dir = _dir;
2264
- this._document = inject(DOCUMENT);
2265
- this._multiYearSelector = false;
2266
- this._twelvehour = false;
2267
- /** The view that the calendar should start in. */
2268
- this.startView = 'month';
2269
- /** The display mode of datetimepicker. */
2270
- this.mode = 'auto';
2271
- /** Step over minutes. */
2272
- this.timeInterval = 1;
2273
- /** Prevent user to select same date time */
2274
- this.preventSameDateTimeSelection = false;
2275
- /**
2276
- * Emits new selected date when selected date changes.
2277
- * @deprecated Switch to the `dateChange` and `dateInput` binding on the input element.
2278
- */
2279
- this.selectedChanged = new EventEmitter();
2280
- /** Emits when the datetimepicker has been opened. */
2281
- this.openedStream = new EventEmitter();
2282
- /** Emits when the datetimepicker has been closed. */
2283
- this.closedStream = new EventEmitter();
2284
- /** Emits when the view has been changed. */
2285
- this.viewChanged = new EventEmitter();
2286
- this._opened = false;
2287
- /** The id for the datetimepicker calendar. */
2288
- this.id = `mtx-datetimepicker-${datetimepickerUid++}`;
2289
- /** Emits when the datetimepicker is disabled. */
2290
- this._disabledChange = new Subject();
2291
- this._validSelected = null;
2292
- /** The element that was focused before the datetimepicker was opened. */
2293
- this._focusedElementBeforeOpen = null;
2294
- /** Unique class that will be added to the backdrop so that the test harnesses can look it up. */
2295
- this._backdropHarnessClass = `${this.id}-backdrop`;
2296
- this._inputStateChanges = Subscription.EMPTY;
2297
- this._type = 'datetime';
2298
- this._touchUi = false;
2299
- this._timeInput = false;
2300
- /** Preferred position of the datetimepicker in the X axis. */
2301
- this.xPosition = 'start';
2302
- /** Preferred position of the datetimepicker in the Y axis. */
2303
- this.yPosition = 'below';
2304
- this._restoreFocus = true;
2305
- if (!this._dateAdapter) {
2306
- throw createMissingDateImplError('DateAdapter');
2307
- }
2308
- }
2309
- /** The date to open the calendar to initially. */
2310
- get startAt() {
2311
- // If an explicit startAt is set we start there, otherwise we start at whatever the currently
2312
- // selected value is.
2313
- return this._startAt || (this.datetimepickerInput ? this.datetimepickerInput.value : null);
2314
- }
2315
- set startAt(date) {
2316
- this._startAt = this._dateAdapter.getValidDateOrNull(date);
2317
- }
2318
- /** The display type of datetimepicker. */
2319
- get type() {
2320
- return this._type;
2321
- }
2322
- set type(value) {
2323
- this._type = value || 'datetime';
2324
- }
2325
- /**
2326
- * Whether the calendar UI is in touch mode. In touch mode the calendar opens in a dialog rather
2327
- * than a popup and elements have more padding to allow for bigger touch targets.
2328
- */
2329
- get touchUi() {
2330
- return this._touchUi;
2331
- }
2332
- set touchUi(value) {
2333
- this._touchUi = coerceBooleanProperty(value);
2334
- }
2335
- /**
2336
- * Whether the calendar is in time mode. In time mode the calendar clock gets time input
2337
- * elements rather then just clock. When `touchUi` is enabled this will be disabled.
2338
- */
2339
- get timeInput() {
2340
- return this._timeInput && !this.touchUi;
2341
- }
2342
- set timeInput(value) {
2343
- this._timeInput = coerceBooleanProperty(value);
2344
- }
2345
- /** Whether the datetimepicker pop-up should be disabled. */
2346
- get disabled() {
2347
- return this._disabled === undefined && this.datetimepickerInput
2348
- ? this.datetimepickerInput.disabled
2349
- : !!this._disabled;
2350
- }
2351
- set disabled(value) {
2352
- const newValue = coerceBooleanProperty(value);
2353
- if (newValue !== this._disabled) {
2354
- this._disabled = newValue;
2355
- this._disabledChange.next(newValue);
2356
- }
2357
- }
2358
- /**
2359
- * Whether to restore focus to the previously-focused element when the panel is closed.
2360
- * Note that automatic focus restoration is an accessibility feature and it is recommended that
2361
- * you provide your own equivalent, if you decide to turn it off.
2362
- */
2363
- get restoreFocus() {
2364
- return this._restoreFocus;
2365
- }
2366
- set restoreFocus(value) {
2367
- this._restoreFocus = coerceBooleanProperty(value);
2368
- }
2369
- /** The currently selected date. */
2370
- get _selected() {
2371
- return this._validSelected;
2372
- }
2373
- set _selected(value) {
2374
- this._validSelected = value;
2375
- }
2376
- /** The minimum selectable date. */
2377
- get _minDate() {
2378
- return this.datetimepickerInput && this.datetimepickerInput.min;
2379
- }
2380
- /** The maximum selectable date. */
2381
- get _maxDate() {
2382
- return this.datetimepickerInput && this.datetimepickerInput.max;
2383
- }
2384
- get _dateFilter() {
2385
- return this.datetimepickerInput && this.datetimepickerInput._dateFilter;
2386
- }
2387
- _viewChanged(type) {
2388
- this.viewChanged.emit(type);
2389
- }
2390
- ngOnDestroy() {
2391
- this._destroyOverlay();
2392
- this.close();
2393
- this._inputStateChanges.unsubscribe();
2394
- this._disabledChange.complete();
2395
- }
2396
- /** Selects the given date */
2397
- _select(date) {
2398
- const oldValue = this._selected;
2399
- this._selected = date;
2400
- if (!this._dateAdapter.sameDatetime(oldValue, this._selected)) {
2401
- this.selectedChanged.emit(date);
2402
- }
2403
- }
2404
- /**
2405
- * Register an input with this datetimepicker.
2406
- * @param input The datetimepicker input to register with this datetimepicker.
2407
- */
2408
- _registerInput(input) {
2409
- if (this.datetimepickerInput) {
2410
- throw Error('A MtxDatetimepicker can only be associated with a single input.');
2411
- }
2412
- this.datetimepickerInput = input;
2413
- this._inputStateChanges = this.datetimepickerInput._valueChange.subscribe((value) => (this._selected = value));
2414
- }
2415
- /** Open the calendar. */
2416
- open() {
2417
- if (this._opened || this.disabled) {
2418
- return;
2419
- }
2420
- if (!this.datetimepickerInput) {
2421
- throw Error('Attempted to open an MtxDatetimepicker with no associated input.');
2422
- }
2423
- this._focusedElementBeforeOpen = _getFocusedElementPierceShadowDom();
2424
- this._openOverlay();
2425
- this._opened = true;
2426
- this.openedStream.emit();
2427
- }
2428
- /** Close the calendar. */
2429
- close() {
2430
- if (!this._opened) {
2431
- return;
2432
- }
2433
- const canRestoreFocus = this._restoreFocus &&
2434
- this._focusedElementBeforeOpen &&
2435
- typeof this._focusedElementBeforeOpen.focus === 'function';
2436
- const completeClose = () => {
2437
- // The `_opened` could've been reset already if
2438
- // we got two events in quick succession.
2439
- if (this._opened) {
2440
- this._opened = false;
2441
- this.closedStream.emit();
2442
- }
2443
- };
2444
- if (this._componentRef) {
2445
- const { instance, location } = this._componentRef;
2446
- instance._startExitAnimation();
2447
- instance._animationDone.pipe(take(1)).subscribe(() => {
2448
- const activeElement = this._document.activeElement;
2449
- // Since we restore focus after the exit animation, we have to check that
2450
- // the user didn't move focus themselves inside the `close` handler.
2451
- if (canRestoreFocus &&
2452
- (!activeElement ||
2453
- activeElement === this._document.activeElement ||
2454
- location.nativeElement.contains(activeElement))) {
2455
- this._focusedElementBeforeOpen.focus();
2456
- }
2457
- this._focusedElementBeforeOpen = null;
2458
- this._destroyOverlay();
2459
- });
2460
- }
2461
- if (canRestoreFocus) {
2462
- // Because IE moves focus asynchronously, we can't count on it being restored before we've
2463
- // marked the datepicker as closed. If the event fires out of sequence and the element that
2464
- // we're refocusing opens the datepicker on focus, the user could be stuck with not being
2465
- // able to close the calendar at all. We work around it by making the logic, that marks
2466
- // the datepicker as closed, async as well.
2467
- setTimeout(completeClose);
2468
- }
2469
- else {
2470
- completeClose();
2471
- }
2472
- }
2473
- /**
2474
- * Forwards relevant values from the datetimepicker to the
2475
- * datetimepicker content inside the overlay.
2476
- */
2477
- _forwardContentValues(instance) {
2478
- instance.datetimepicker = this;
2479
- instance.color = this.color;
2480
- instance._dialogLabelId = this.datetimepickerInput.getOverlayLabelId();
2481
- }
2482
- /** Opens the overlay with the calendar. */
2483
- _openOverlay() {
2484
- this._destroyOverlay();
2485
- const isDialog = this.touchUi;
2486
- const labelId = this.datetimepickerInput.getOverlayLabelId();
2487
- const portal = new ComponentPortal(MtxDatetimepickerContent, this._viewContainerRef);
2488
- const overlayRef = (this._overlayRef = this._overlay.create(new OverlayConfig({
2489
- positionStrategy: isDialog ? this._getDialogStrategy() : this._getDropdownStrategy(),
2490
- hasBackdrop: true,
2491
- backdropClass: [
2492
- isDialog ? 'cdk-overlay-dark-backdrop' : 'mat-overlay-transparent-backdrop',
2493
- this._backdropHarnessClass,
2494
- ],
2495
- direction: this._dir,
2496
- scrollStrategy: isDialog ? this._overlay.scrollStrategies.block() : this._scrollStrategy(),
2497
- panelClass: `mtx-datetimepicker-${isDialog ? 'dialog' : 'popup'}`,
2498
- })));
2499
- const overlayElement = overlayRef.overlayElement;
2500
- overlayElement.setAttribute('role', 'dialog');
2501
- if (labelId) {
2502
- overlayElement.setAttribute('aria-labelledby', labelId);
2503
- }
2504
- if (isDialog) {
2505
- overlayElement.setAttribute('aria-modal', 'true');
2506
- }
2507
- this._getCloseStream(overlayRef).subscribe(event => {
2508
- if (event) {
2509
- event.preventDefault();
2510
- }
2511
- this.close();
2512
- });
2513
- this._componentRef = overlayRef.attach(portal);
2514
- this._forwardContentValues(this._componentRef.instance);
2515
- // Update the position once the calendar has rendered. Only relevant in dropdown mode.
2516
- if (!isDialog) {
2517
- this._ngZone.onStable.pipe(take(1)).subscribe(() => overlayRef.updatePosition());
2518
- }
2519
- }
2520
- /** Destroys the current overlay. */
2521
- _destroyOverlay() {
2522
- if (this._overlayRef) {
2523
- this._overlayRef.dispose();
2524
- this._overlayRef = this._componentRef = null;
2525
- }
2526
- }
2527
- /** Gets a position strategy that will open the calendar as a dropdown. */
2528
- _getDialogStrategy() {
2529
- return this._overlay.position().global().centerHorizontally().centerVertically();
2530
- }
2531
- /** Gets a position strategy that will open the calendar as a dropdown. */
2532
- _getDropdownStrategy() {
2533
- const strategy = this._overlay
2534
- .position()
2535
- .flexibleConnectedTo(this.datetimepickerInput.getConnectedOverlayOrigin())
2536
- .withTransformOriginOn('.mtx-datetimepicker-content')
2537
- .withFlexibleDimensions(false)
2538
- .withViewportMargin(8)
2539
- .withLockedPosition();
2540
- return this._setConnectedPositions(strategy);
2541
- }
2542
- /**
2543
- * Sets the positions of the datetimepicker in dropdown mode based on the current configuration.
2544
- */
2545
- _setConnectedPositions(strategy) {
2546
- const primaryX = this.xPosition === 'end' ? 'end' : 'start';
2547
- const secondaryX = primaryX === 'start' ? 'end' : 'start';
2548
- const primaryY = this.yPosition === 'above' ? 'bottom' : 'top';
2549
- const secondaryY = primaryY === 'top' ? 'bottom' : 'top';
2550
- return strategy.withPositions([
2551
- {
2552
- originX: primaryX,
2553
- originY: secondaryY,
2554
- overlayX: primaryX,
2555
- overlayY: primaryY,
2556
- },
2557
- {
2558
- originX: primaryX,
2559
- originY: primaryY,
2560
- overlayX: primaryX,
2561
- overlayY: secondaryY,
2562
- },
2563
- {
2564
- originX: secondaryX,
2565
- originY: secondaryY,
2566
- overlayX: secondaryX,
2567
- overlayY: primaryY,
2568
- },
2569
- {
2570
- originX: secondaryX,
2571
- originY: primaryY,
2572
- overlayX: secondaryX,
2573
- overlayY: secondaryY,
2574
- },
2575
- ]);
2576
- }
2577
- /** Gets an observable that will emit when the overlay is supposed to be closed. */
2578
- _getCloseStream(overlayRef) {
2579
- return merge(overlayRef.backdropClick(), overlayRef.detachments(), overlayRef.keydownEvents().pipe(filter(event => {
2580
- // Closing on alt + up is only valid when there's an input associated with the
2581
- // datetimepicker.
2582
- return ((event.keyCode === ESCAPE && !hasModifierKey(event)) ||
2583
- (this.datetimepickerInput &&
2584
- hasModifierKey(event, 'altKey') &&
2585
- event.keyCode === UP_ARROW));
2586
- })));
2587
- }
2588
- }
2589
- /** @nocollapse */ MtxDatetimepicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", 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 });
2590
- /** @nocollapse */ MtxDatetimepicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", 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 });
2591
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepicker, decorators: [{
2592
- type: Component,
2593
- args: [{
2594
- selector: 'mtx-datetimepicker',
2595
- exportAs: 'mtxDatetimepicker',
2596
- template: '',
2597
- changeDetection: ChangeDetectionStrategy.OnPush,
2598
- encapsulation: ViewEncapsulation.None,
2599
- preserveWhitespaces: false,
2600
- }]
2601
- }], ctorParameters: function () {
2602
- return [{ type: i4$1.Overlay }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
2603
- type: Inject,
2604
- args: [MTX_DATETIMEPICKER_SCROLL_STRATEGY]
2605
- }] }, { type: i1.DatetimeAdapter, decorators: [{
2606
- type: Optional
2607
- }] }, { type: i6.Directionality, decorators: [{
2608
- type: Optional
2609
- }] }];
2610
- }, propDecorators: { multiYearSelector: [{
2611
- type: Input
2612
- }], twelvehour: [{
2613
- type: Input
2614
- }], startView: [{
2615
- type: Input
2616
- }], mode: [{
2617
- type: Input
2618
- }], timeInterval: [{
2619
- type: Input
2620
- }], preventSameDateTimeSelection: [{
2621
- type: Input
2622
- }], selectedChanged: [{
2623
- type: Output
2624
- }], openedStream: [{
2625
- type: Output,
2626
- args: ['opened']
2627
- }], closedStream: [{
2628
- type: Output,
2629
- args: ['closed']
2630
- }], viewChanged: [{
2631
- type: Output
2632
- }], panelClass: [{
2633
- type: Input
2634
- }], opened: [{
2635
- type: Input
2636
- }], color: [{
2637
- type: Input
2638
- }], startAt: [{
2639
- type: Input
2640
- }], type: [{
2641
- type: Input
2642
- }], touchUi: [{
2643
- type: Input
2644
- }], timeInput: [{
2645
- type: Input
2646
- }], disabled: [{
2647
- type: Input
2648
- }], xPosition: [{
2649
- type: Input
2650
- }], yPosition: [{
2651
- type: Input
2652
- }], restoreFocus: [{
2653
- type: Input
2654
- }] } });
2655
-
2656
- const MAT_DATETIMEPICKER_VALUE_ACCESSOR = {
2657
- provide: NG_VALUE_ACCESSOR,
2658
- useExisting: forwardRef(() => MtxDatetimepickerInput),
2659
- multi: true,
2660
- };
2661
- const MAT_DATETIMEPICKER_VALIDATORS = {
2662
- provide: NG_VALIDATORS,
2663
- useExisting: forwardRef(() => MtxDatetimepickerInput),
2664
- multi: true,
2665
- };
2666
- /**
2667
- * An event used for datetimepicker input and change events. We don't always have access to a native
2668
- * input or change event because the event may have been triggered by the user clicking on the
2669
- * calendar popup. For consistency, we always use MtxDatetimepickerInputEvent instead.
2670
- */
2671
- class MtxDatetimepickerInputEvent {
2672
- constructor(target, targetElement) {
2673
- this.target = target;
2674
- this.targetElement = targetElement;
2675
- this.value = this.target.value;
2676
- }
2677
- }
2678
- /** Directive used to connect an input to a MtxDatetimepicker. */
2679
- class MtxDatetimepickerInput {
2680
- constructor(_elementRef, _dateAdapter, _dateFormats, _formField) {
2681
- this._elementRef = _elementRef;
2682
- this._dateAdapter = _dateAdapter;
2683
- this._dateFormats = _dateFormats;
2684
- this._formField = _formField;
2685
- /** Emits when a `change` event is fired on this `<input>`. */
2686
- this.dateChange = new EventEmitter();
2687
- /** Emits when an `input` event is fired on this `<input>`. */
2688
- this.dateInput = new EventEmitter();
2689
- /** Emits when the value changes (either due to user input or programmatic change). */
2690
- this._valueChange = new EventEmitter();
2691
- /** Emits when the disabled state has changed */
2692
- this._disabledChange = new EventEmitter();
2693
- this._datetimepickerSubscription = Subscription.EMPTY;
2694
- this._localeSubscription = Subscription.EMPTY;
2695
- /** Whether the last value set on the input was valid. */
2696
- this._lastValueValid = false;
2697
- this._onTouched = () => { };
2698
- this._cvaOnChange = () => { };
2699
- this._validatorOnChange = () => { };
2700
- /** The form control validator for whether the input parses. */
2701
- this._parseValidator = () => {
2702
- return this._lastValueValid
2703
- ? null
2704
- : { mtxDatetimepickerParse: { text: this._elementRef.nativeElement.value } };
2705
- };
2706
- /** The form control validator for the min date. */
2707
- this._minValidator = (control) => {
2708
- const controlValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));
2709
- return !this.min ||
2710
- !controlValue ||
2711
- this._dateAdapter.compareDatetime(this.min, controlValue) <= 0
2712
- ? null
2713
- : { mtxDatetimepickerMin: { min: this.min, actual: controlValue } };
2714
- };
2715
- /** The form control validator for the max date. */
2716
- this._maxValidator = (control) => {
2717
- const controlValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));
2718
- return !this.max ||
2719
- !controlValue ||
2720
- this._dateAdapter.compareDatetime(this.max, controlValue) >= 0
2721
- ? null
2722
- : { mtxDatetimepickerMax: { max: this.max, actual: controlValue } };
2723
- };
2724
- /** The form control validator for the date filter. */
2725
- this._filterValidator = (control) => {
2726
- const controlValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));
2727
- return !this._dateFilter ||
2728
- !controlValue ||
2729
- this._dateFilter(controlValue, MtxDatetimepickerFilterType.DATE)
2730
- ? null
2731
- : { mtxDatetimepickerFilter: true };
2732
- };
2733
- /** The combined form control validator for this input. */
2734
- this._validator = Validators.compose([
2735
- this._parseValidator,
2736
- this._minValidator,
2737
- this._maxValidator,
2738
- this._filterValidator,
2739
- ]);
2740
- if (!this._dateAdapter) {
2741
- throw createMissingDateImplError('DatetimeAdapter');
2742
- }
2743
- if (!this._dateFormats) {
2744
- throw createMissingDateImplError('MTX_DATETIME_FORMATS');
2745
- }
2746
- // Update the displayed date when the locale changes.
2747
- this._localeSubscription = _dateAdapter.localeChanges.subscribe(() => {
2748
- this.value = this._dateAdapter.deserialize(this.value);
2749
- });
2750
- }
2751
- /** The datetimepicker that this input is associated with. */
2752
- set mtxDatetimepicker(value) {
2753
- this.registerDatetimepicker(value);
2754
- }
2755
- set mtxDatetimepickerFilter(filter) {
2756
- this._dateFilter = filter;
2757
- this._validatorOnChange();
2758
- }
2759
- /** The value of the input. */
2760
- get value() {
2761
- return this._value;
2762
- }
2763
- set value(value) {
2764
- value = this._dateAdapter.deserialize(value);
2765
- this._lastValueValid = !value || this._dateAdapter.isValid(value);
2766
- value = this._dateAdapter.getValidDateOrNull(value);
2767
- const oldDate = this.value;
2768
- this._value = value;
2769
- this._formatValue(value);
2770
- // use timeout to ensure the datetimepicker is instantiated and we get the correct format
2771
- setTimeout(() => {
2772
- if (!this._dateAdapter.sameDatetime(oldDate, value)) {
2773
- this._valueChange.emit(value);
2774
- }
2775
- });
2776
- }
2777
- /** The minimum valid date. */
2778
- get min() {
2779
- return this._min;
2780
- }
2781
- set min(value) {
2782
- this._min = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));
2783
- this._validatorOnChange();
2784
- }
2785
- /** The maximum valid date. */
2786
- get max() {
2787
- return this._max;
2788
- }
2789
- set max(value) {
2790
- this._max = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));
2791
- this._validatorOnChange();
2792
- }
2793
- /** Whether the datetimepicker-input is disabled. */
2794
- get disabled() {
2795
- return !!this._disabled;
2796
- }
2797
- set disabled(value) {
2798
- const newValue = coerceBooleanProperty(value);
2799
- if (this._disabled !== newValue) {
2800
- this._disabled = newValue;
2801
- this._disabledChange.emit(newValue);
2802
- }
2803
- }
2804
- ngAfterContentInit() {
2805
- if (this._datetimepicker) {
2806
- this._datetimepickerSubscription = this._datetimepicker.selectedChanged.subscribe((selected) => {
2807
- this.value = selected;
2808
- this._cvaOnChange(selected);
2809
- this._onTouched();
2810
- this.dateInput.emit(new MtxDatetimepickerInputEvent(this, this._elementRef.nativeElement));
2811
- this.dateChange.emit(new MtxDatetimepickerInputEvent(this, this._elementRef.nativeElement));
2812
- });
2813
- }
2814
- }
2815
- ngOnDestroy() {
2816
- this._datetimepickerSubscription.unsubscribe();
2817
- this._localeSubscription.unsubscribe();
2818
- this._valueChange.complete();
2819
- this._disabledChange.complete();
2820
- }
2821
- registerOnValidatorChange(fn) {
2822
- this._validatorOnChange = fn;
2823
- }
2824
- validate(c) {
2825
- return this._validator ? this._validator(c) : null;
2826
- }
2827
- /**
2828
- * Gets the element that the datetimepicker popup should be connected to.
2829
- * @return The element to connect the popup to.
2830
- */
2831
- getConnectedOverlayOrigin() {
2832
- return this._formField ? this._formField.getConnectedOverlayOrigin() : this._elementRef;
2833
- }
2834
- /** Gets the ID of an element that should be used a description for the calendar overlay. */
2835
- getOverlayLabelId() {
2836
- if (this._formField) {
2837
- return this._formField.getLabelId();
2838
- }
2839
- return this._elementRef.nativeElement.getAttribute('aria-labelledby');
2840
- }
2841
- // Implemented as part of ControlValueAccessor
2842
- writeValue(value) {
2843
- this.value = value;
2844
- }
2845
- // Implemented as part of ControlValueAccessor
2846
- registerOnChange(fn) {
2847
- this._cvaOnChange = fn;
2848
- }
2849
- // Implemented as part of ControlValueAccessor
2850
- registerOnTouched(fn) {
2851
- this._onTouched = fn;
2852
- }
2853
- // Implemented as part of ControlValueAccessor
2854
- setDisabledState(disabled) {
2855
- this.disabled = disabled;
2856
- }
2857
- _onKeydown(event) {
2858
- if (event.altKey && event.keyCode === DOWN_ARROW) {
2859
- this._datetimepicker.open();
2860
- event.preventDefault();
2861
- }
2862
- }
2863
- _onInput(value) {
2864
- let date = this._dateAdapter.parse(value, this.getParseFormat());
2865
- this._lastValueValid = !date || this._dateAdapter.isValid(date);
2866
- date = this._dateAdapter.getValidDateOrNull(date);
2867
- this._value = date;
2868
- this._cvaOnChange(date);
2869
- this._valueChange.emit(date);
2870
- this.dateInput.emit(new MtxDatetimepickerInputEvent(this, this._elementRef.nativeElement));
2871
- }
2872
- _onChange() {
2873
- this.dateChange.emit(new MtxDatetimepickerInputEvent(this, this._elementRef.nativeElement));
2874
- }
2875
- /** Handles blur events on the input. */
2876
- _onBlur() {
2877
- // Reformat the input only if we have a valid value.
2878
- if (this.value) {
2879
- this._formatValue(this.value);
2880
- }
2881
- this._onTouched();
2882
- }
2883
- registerDatetimepicker(value) {
2884
- if (value) {
2885
- this._datetimepicker = value;
2886
- this._datetimepicker._registerInput(this);
2887
- }
2888
- }
2889
- getDisplayFormat() {
2890
- switch (this._datetimepicker.type) {
2891
- case 'date':
2892
- return this._dateFormats.display.dateInput;
2893
- case 'datetime':
2894
- return this._dateFormats.display.datetimeInput;
2895
- case 'time':
2896
- return this._dateFormats.display.timeInput;
2897
- case 'month':
2898
- return this._dateFormats.display.monthInput;
2899
- case 'year':
2900
- return this._dateFormats.display.yearInput;
2901
- }
2902
- }
2903
- getParseFormat() {
2904
- let parseFormat;
2905
- switch (this._datetimepicker.type) {
2906
- case 'date':
2907
- parseFormat = this._dateFormats.parse.dateInput;
2908
- break;
2909
- case 'datetime':
2910
- parseFormat = this._dateFormats.parse.datetimeInput;
2911
- break;
2912
- case 'time':
2913
- parseFormat = this._dateFormats.parse.timeInput;
2914
- break;
2915
- case 'month':
2916
- parseFormat = this._dateFormats.parse.monthInput;
2917
- break;
2918
- case 'year':
2919
- parseFormat = this._dateFormats.parse.yearInput;
2920
- break;
2921
- }
2922
- if (!parseFormat) {
2923
- parseFormat = this._dateFormats.parse.dateInput;
2924
- }
2925
- return parseFormat;
2926
- }
2927
- /** Formats a value and sets it on the input element. */
2928
- _formatValue(value) {
2929
- this._elementRef.nativeElement.value = value
2930
- ? this._dateAdapter.format(value, this.getDisplayFormat())
2931
- : '';
2932
- }
2933
- /** Returns the palette used by the input's form field, if any. */
2934
- getThemePalette() {
2935
- return this._formField ? this._formField.color : undefined;
2936
- }
2937
- }
2938
- /** @nocollapse */ MtxDatetimepickerInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", 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 });
2939
- /** @nocollapse */ MtxDatetimepickerInput.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.1", 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: [
2940
- MAT_DATETIMEPICKER_VALUE_ACCESSOR,
2941
- MAT_DATETIMEPICKER_VALIDATORS,
2942
- { provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: MtxDatetimepickerInput },
2943
- ], exportAs: ["mtxDatetimepickerInput"], ngImport: i0 });
2944
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerInput, decorators: [{
2945
- type: Directive,
2946
- args: [{
2947
- selector: 'input[mtxDatetimepicker]',
2948
- providers: [
2949
- MAT_DATETIMEPICKER_VALUE_ACCESSOR,
2950
- MAT_DATETIMEPICKER_VALIDATORS,
2951
- { provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: MtxDatetimepickerInput },
2952
- ],
2953
- host: {
2954
- '[attr.aria-haspopup]': 'true',
2955
- '[attr.aria-owns]': '(_datetimepicker?.opened && _datetimepicker.id) || null',
2956
- '[attr.min]': 'min ? _dateAdapter.toIso8601(min) : null',
2957
- '[attr.max]': 'max ? _dateAdapter.toIso8601(max) : null',
2958
- '[disabled]': 'disabled',
2959
- '(input)': '_onInput($event.target.value)',
2960
- '(change)': '_onChange()',
2961
- '(blur)': '_onBlur()',
2962
- '(keydown)': '_onKeydown($event)',
2963
- },
2964
- exportAs: 'mtxDatetimepickerInput',
2965
- }]
2966
- }], ctorParameters: function () {
2967
- return [{ type: i0.ElementRef }, { type: i1.DatetimeAdapter, decorators: [{
2968
- type: Optional
2969
- }] }, { type: undefined, decorators: [{
2970
- type: Optional
2971
- }, {
2972
- type: Inject,
2973
- args: [MTX_DATETIME_FORMATS]
2974
- }] }, { type: i2$2.MatFormField, decorators: [{
2975
- type: Optional
2976
- }] }];
2977
- }, propDecorators: { dateChange: [{
2978
- type: Output
2979
- }], dateInput: [{
2980
- type: Output
2981
- }], mtxDatetimepicker: [{
2982
- type: Input
2983
- }], mtxDatetimepickerFilter: [{
2984
- type: Input
2985
- }], value: [{
2986
- type: Input
2987
- }], min: [{
2988
- type: Input
2989
- }], max: [{
2990
- type: Input
2991
- }], disabled: [{
2992
- type: Input
2993
- }] } });
2994
-
2995
- /** Can be used to override the icon of a `mtxDatetimepickerToggle`. */
2996
- class MtxDatetimepickerToggleIcon {
2997
- }
2998
- /** @nocollapse */ MtxDatetimepickerToggleIcon.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerToggleIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2999
- /** @nocollapse */ MtxDatetimepickerToggleIcon.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.1", type: MtxDatetimepickerToggleIcon, selector: "[mtxDatetimepickerToggleIcon]", ngImport: i0 });
3000
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerToggleIcon, decorators: [{
3001
- type: Directive,
3002
- args: [{
3003
- selector: '[mtxDatetimepickerToggleIcon]',
3004
- }]
3005
- }] });
3006
- class MtxDatetimepickerToggle {
3007
- /** Whether the toggle button is disabled. */
3008
- get disabled() {
3009
- return this._disabled === undefined ? this.datetimepicker.disabled : !!this._disabled;
3010
- }
3011
- set disabled(value) {
3012
- this._disabled = coerceBooleanProperty(value);
3013
- }
3014
- constructor(_intl, _changeDetectorRef, defaultTabIndex) {
3015
- this._intl = _intl;
3016
- this._changeDetectorRef = _changeDetectorRef;
3017
- this._stateChanges = Subscription.EMPTY;
3018
- const parsedTabIndex = Number(defaultTabIndex);
3019
- this.tabIndex = parsedTabIndex || parsedTabIndex === 0 ? parsedTabIndex : null;
3020
- }
3021
- ngOnChanges(changes) {
3022
- if (changes.datetimepicker) {
3023
- this._watchStateChanges();
3024
- }
3025
- }
3026
- ngOnDestroy() {
3027
- this._stateChanges.unsubscribe();
3028
- }
3029
- ngAfterContentInit() {
3030
- this._watchStateChanges();
3031
- }
3032
- _open(event) {
3033
- if (this.datetimepicker && !this.disabled) {
3034
- this.datetimepicker.open();
3035
- event.stopPropagation();
3036
- }
3037
- }
3038
- _watchStateChanges() {
3039
- const datetimepickerDisabled = this.datetimepicker
3040
- ? this.datetimepicker._disabledChange
3041
- : of();
3042
- const inputDisabled = this.datetimepicker && this.datetimepicker.datetimepickerInput
3043
- ? this.datetimepicker.datetimepickerInput._disabledChange
3044
- : of();
3045
- const datetimepickerToggled = this.datetimepicker
3046
- ? merge(this.datetimepicker.openedStream, this.datetimepicker.closedStream)
3047
- : of();
3048
- this._stateChanges.unsubscribe();
3049
- this._stateChanges = merge(this._intl.changes, datetimepickerDisabled, inputDisabled, datetimepickerToggled).subscribe(() => this._changeDetectorRef.markForCheck());
3050
- }
3051
- }
3052
- /** @nocollapse */ MtxDatetimepickerToggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerToggle, deps: [{ token: MtxDatetimepickerIntl }, { token: i0.ChangeDetectorRef }, { token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component });
3053
- /** @nocollapse */ MtxDatetimepickerToggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", 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: [".mat-form-field-appearance-legacy .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mtx-datetimepicker-toggle-default-icon{margin:auto}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
3054
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerToggle, decorators: [{
3055
- type: Component,
3056
- args: [{ selector: 'mtx-datetimepicker-toggle', host: {
3057
- 'class': 'mtx-datetimepicker-toggle',
3058
- '[attr.tabindex]': 'null',
3059
- '[class.mtx-datetimepicker-toggle-active]': 'datetimepicker && datetimepicker.opened',
3060
- '[class.mat-accent]': 'datetimepicker && datetimepicker.color === "accent"',
3061
- '[class.mat-warn]': 'datetimepicker && datetimepicker.color === "warn"',
3062
- // Used by the test harness to tie this toggle to its datetimepicker.
3063
- '[attr.data-mtx-calendar]': 'datetimepicker ? datetimepicker.id : null',
3064
- // Bind the `click` on the host, rather than the inner `button`, so that we can call
3065
- // `stopPropagation` on it without affecting the user's `click` handlers. We need to stop
3066
- // it so that the input doesn't get focused automatically by the form field (See #21836).
3067
- '(click)': '_open($event)',
3068
- }, 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: [".mat-form-field-appearance-legacy .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mtx-datetimepicker-toggle-default-icon{margin:auto}\n"] }]
3069
- }], ctorParameters: function () {
3070
- return [{ type: MtxDatetimepickerIntl }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
3071
- type: Attribute,
3072
- args: ['tabindex']
3073
- }] }];
3074
- }, propDecorators: { datetimepicker: [{
3075
- type: Input,
3076
- args: ['for']
3077
- }], tabIndex: [{
3078
- type: Input
3079
- }], ariaLabel: [{
3080
- type: Input,
3081
- args: ['aria-label']
3082
- }], disabled: [{
3083
- type: Input
3084
- }], disableRipple: [{
3085
- type: Input
3086
- }], _customIcon: [{
3087
- type: ContentChild,
3088
- args: [MtxDatetimepickerToggleIcon]
3089
- }], _button: [{
3090
- type: ViewChild,
3091
- args: ['button']
3092
- }] } });
3093
-
3094
- class MtxDatetimepickerModule {
3095
- }
3096
- /** @nocollapse */ MtxDatetimepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3097
- /** @nocollapse */ MtxDatetimepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerModule, declarations: [MtxCalendar,
3098
- MtxCalendarBody,
3099
- MtxClock,
3100
- MtxTime,
3101
- MtxTimeInput,
3102
- MtxDatetimepicker,
3103
- MtxDatetimepickerToggle,
3104
- MtxDatetimepickerToggleIcon,
3105
- MtxDatetimepickerInput,
3106
- MtxDatetimepickerContent,
3107
- MtxMonthView,
3108
- MtxYearView,
3109
- MtxMultiYearView], imports: [CommonModule, MatButtonModule, OverlayModule, A11yModule, PortalModule], exports: [MtxCalendar,
3110
- MtxCalendarBody,
3111
- MtxClock,
3112
- MtxTime,
3113
- MtxDatetimepicker,
3114
- MtxDatetimepickerToggle,
3115
- MtxDatetimepickerToggleIcon,
3116
- MtxDatetimepickerInput,
3117
- MtxDatetimepickerContent,
3118
- MtxMonthView,
3119
- MtxYearView,
3120
- MtxMultiYearView] });
3121
- /** @nocollapse */ MtxDatetimepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerModule, providers: [MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [CommonModule, MatButtonModule, OverlayModule, A11yModule, PortalModule] });
3122
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: MtxDatetimepickerModule, decorators: [{
3123
- type: NgModule,
3124
- args: [{
3125
- imports: [CommonModule, MatButtonModule, OverlayModule, A11yModule, PortalModule],
3126
- declarations: [
3127
- MtxCalendar,
3128
- MtxCalendarBody,
3129
- MtxClock,
3130
- MtxTime,
3131
- MtxTimeInput,
3132
- MtxDatetimepicker,
3133
- MtxDatetimepickerToggle,
3134
- MtxDatetimepickerToggleIcon,
3135
- MtxDatetimepickerInput,
3136
- MtxDatetimepickerContent,
3137
- MtxMonthView,
3138
- MtxYearView,
3139
- MtxMultiYearView,
3140
- ],
3141
- exports: [
3142
- MtxCalendar,
3143
- MtxCalendarBody,
3144
- MtxClock,
3145
- MtxTime,
3146
- MtxDatetimepicker,
3147
- MtxDatetimepickerToggle,
3148
- MtxDatetimepickerToggleIcon,
3149
- MtxDatetimepickerInput,
3150
- MtxDatetimepickerContent,
3151
- MtxMonthView,
3152
- MtxYearView,
3153
- MtxMultiYearView,
3154
- ],
3155
- providers: [MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER],
3156
- }]
3157
- }] });
3158
-
3159
- /**
3160
- * Generated bundle index. Do not edit.
3161
- */
3162
-
3163
- export { CLOCK_INNER_RADIUS, CLOCK_OUTER_RADIUS, CLOCK_RADIUS, CLOCK_TICK_RADIUS, MAT_DATETIMEPICKER_VALIDATORS, MAT_DATETIMEPICKER_VALUE_ACCESSOR, MTX_DATETIMEPICKER_SCROLL_STRATEGY, MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY, MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER, MtxCalendar, MtxCalendarBody, MtxCalendarCell, MtxClock, MtxDatetimepicker, MtxDatetimepickerContent, MtxDatetimepickerFilterType, MtxDatetimepickerInput, MtxDatetimepickerInputEvent, MtxDatetimepickerIntl, MtxDatetimepickerModule, MtxDatetimepickerToggle, MtxDatetimepickerToggleIcon, MtxMonthView, MtxMultiYearView, MtxTime, MtxTimeInput, MtxYearView, getActiveOffset, isSameMultiYearView, mtxDatetimepickerAnimations, yearsPerPage, yearsPerRow };
3164
- //# sourceMappingURL=mtxDatetimepicker.mjs.map