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