@angular/material 11.0.4 → 11.1.2

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 (583) hide show
  1. package/_theming.scss +354 -337
  2. package/autocomplete/_autocomplete-theme.scss +4 -5
  3. package/autocomplete/autocomplete.d.ts +7 -1
  4. package/autocomplete/index.metadata.json +1 -1
  5. package/autocomplete/testing/autocomplete-harness.d.ts +29 -15
  6. package/badge/_badge-theme.scss +2 -3
  7. package/bottom-sheet/_bottom-sheet-theme.scss +4 -5
  8. package/bundles/material-autocomplete-testing.umd.js +54 -36
  9. package/bundles/material-autocomplete-testing.umd.js.map +1 -1
  10. package/bundles/material-autocomplete-testing.umd.min.js +2 -2
  11. package/bundles/material-autocomplete-testing.umd.min.js.map +1 -1
  12. package/bundles/material-autocomplete.umd.js +31 -9
  13. package/bundles/material-autocomplete.umd.js.map +1 -1
  14. package/bundles/material-autocomplete.umd.min.js +3 -3
  15. package/bundles/material-autocomplete.umd.min.js.map +1 -1
  16. package/bundles/material-badge-testing.umd.js +9 -1
  17. package/bundles/material-badge-testing.umd.js.map +1 -1
  18. package/bundles/material-badge-testing.umd.min.js +1 -1
  19. package/bundles/material-badge-testing.umd.min.js.map +1 -1
  20. package/bundles/material-badge.umd.js +9 -1
  21. package/bundles/material-badge.umd.js.map +1 -1
  22. package/bundles/material-badge.umd.min.js +3 -3
  23. package/bundles/material-badge.umd.min.js.map +1 -1
  24. package/bundles/material-bottom-sheet-testing.umd.js +9 -1
  25. package/bundles/material-bottom-sheet-testing.umd.js.map +1 -1
  26. package/bundles/material-bottom-sheet-testing.umd.min.js +1 -1
  27. package/bundles/material-bottom-sheet-testing.umd.min.js.map +1 -1
  28. package/bundles/material-bottom-sheet.umd.js +9 -1
  29. package/bundles/material-bottom-sheet.umd.js.map +1 -1
  30. package/bundles/material-bottom-sheet.umd.min.js +1 -1
  31. package/bundles/material-bottom-sheet.umd.min.js.map +1 -1
  32. package/bundles/material-button-testing.umd.js +9 -1
  33. package/bundles/material-button-testing.umd.js.map +1 -1
  34. package/bundles/material-button-testing.umd.min.js +1 -1
  35. package/bundles/material-button-testing.umd.min.js.map +1 -1
  36. package/bundles/material-button-toggle-testing.umd.js +9 -1
  37. package/bundles/material-button-toggle-testing.umd.js.map +1 -1
  38. package/bundles/material-button-toggle-testing.umd.min.js +1 -1
  39. package/bundles/material-button-toggle-testing.umd.min.js.map +1 -1
  40. package/bundles/material-button-toggle.umd.js +9 -1
  41. package/bundles/material-button-toggle.umd.js.map +1 -1
  42. package/bundles/material-button-toggle.umd.min.js +1 -1
  43. package/bundles/material-button-toggle.umd.min.js.map +1 -1
  44. package/bundles/material-button.umd.js +17 -5
  45. package/bundles/material-button.umd.js.map +1 -1
  46. package/bundles/material-button.umd.min.js +1 -1
  47. package/bundles/material-button.umd.min.js.map +1 -1
  48. package/bundles/material-card-testing.umd.js +9 -1
  49. package/bundles/material-card-testing.umd.js.map +1 -1
  50. package/bundles/material-card-testing.umd.min.js +1 -1
  51. package/bundles/material-card-testing.umd.min.js.map +1 -1
  52. package/bundles/material-checkbox-testing.umd.js +73 -64
  53. package/bundles/material-checkbox-testing.umd.js.map +1 -1
  54. package/bundles/material-checkbox-testing.umd.min.js +2 -2
  55. package/bundles/material-checkbox-testing.umd.min.js.map +1 -1
  56. package/bundles/material-checkbox.umd.js +15 -3
  57. package/bundles/material-checkbox.umd.js.map +1 -1
  58. package/bundles/material-checkbox.umd.min.js +2 -2
  59. package/bundles/material-checkbox.umd.min.js.map +1 -1
  60. package/bundles/material-chips-testing.umd.js +189 -29
  61. package/bundles/material-chips-testing.umd.js.map +1 -1
  62. package/bundles/material-chips-testing.umd.min.js +2 -2
  63. package/bundles/material-chips-testing.umd.min.js.map +1 -1
  64. package/bundles/material-chips.umd.js +9 -1
  65. package/bundles/material-chips.umd.js.map +1 -1
  66. package/bundles/material-chips.umd.min.js +4 -4
  67. package/bundles/material-chips.umd.min.js.map +1 -1
  68. package/bundles/material-core-testing.umd.js +14 -3
  69. package/bundles/material-core-testing.umd.js.map +1 -1
  70. package/bundles/material-core-testing.umd.min.js +1 -1
  71. package/bundles/material-core-testing.umd.min.js.map +1 -1
  72. package/bundles/material-core.umd.js +55 -14
  73. package/bundles/material-core.umd.js.map +1 -1
  74. package/bundles/material-core.umd.min.js +16 -8
  75. package/bundles/material-core.umd.min.js.map +1 -1
  76. package/bundles/material-datepicker-testing.umd.js +24 -12
  77. package/bundles/material-datepicker-testing.umd.js.map +1 -1
  78. package/bundles/material-datepicker-testing.umd.min.js +1 -1
  79. package/bundles/material-datepicker-testing.umd.min.js.map +1 -1
  80. package/bundles/material-datepicker.umd.js +250 -80
  81. package/bundles/material-datepicker.umd.js.map +1 -1
  82. package/bundles/material-datepicker.umd.min.js +20 -12
  83. package/bundles/material-datepicker.umd.min.js.map +1 -1
  84. package/bundles/material-dialog-testing.umd.js +9 -1
  85. package/bundles/material-dialog-testing.umd.js.map +1 -1
  86. package/bundles/material-dialog-testing.umd.min.js +1 -1
  87. package/bundles/material-dialog-testing.umd.min.js.map +1 -1
  88. package/bundles/material-dialog.umd.js +10 -2
  89. package/bundles/material-dialog.umd.js.map +1 -1
  90. package/bundles/material-dialog.umd.min.js +8 -8
  91. package/bundles/material-dialog.umd.min.js.map +1 -1
  92. package/bundles/material-divider-testing.umd.js +9 -1
  93. package/bundles/material-divider-testing.umd.js.map +1 -1
  94. package/bundles/material-divider-testing.umd.min.js +2 -2
  95. package/bundles/material-divider-testing.umd.min.js.map +1 -1
  96. package/bundles/material-expansion-testing.umd.js +9 -1
  97. package/bundles/material-expansion-testing.umd.js.map +1 -1
  98. package/bundles/material-expansion-testing.umd.min.js +1 -1
  99. package/bundles/material-expansion-testing.umd.min.js.map +1 -1
  100. package/bundles/material-expansion.umd.js +16 -4
  101. package/bundles/material-expansion.umd.js.map +1 -1
  102. package/bundles/material-expansion.umd.min.js +6 -6
  103. package/bundles/material-expansion.umd.min.js.map +1 -1
  104. package/bundles/material-form-field-testing-control.umd.js +9 -1
  105. package/bundles/material-form-field-testing-control.umd.js.map +1 -1
  106. package/bundles/material-form-field-testing-control.umd.min.js +1 -1
  107. package/bundles/material-form-field-testing-control.umd.min.js.map +1 -1
  108. package/bundles/material-form-field-testing.umd.js +41 -30
  109. package/bundles/material-form-field-testing.umd.js.map +1 -1
  110. package/bundles/material-form-field-testing.umd.min.js +3 -3
  111. package/bundles/material-form-field-testing.umd.min.js.map +1 -1
  112. package/bundles/material-form-field.umd.js +11 -3
  113. package/bundles/material-form-field.umd.js.map +1 -1
  114. package/bundles/material-form-field.umd.min.js +2 -2
  115. package/bundles/material-form-field.umd.min.js.map +1 -1
  116. package/bundles/material-grid-list-testing.umd.js +15 -5
  117. package/bundles/material-grid-list-testing.umd.js.map +1 -1
  118. package/bundles/material-grid-list-testing.umd.min.js +2 -2
  119. package/bundles/material-grid-list-testing.umd.min.js.map +1 -1
  120. package/bundles/material-grid-list.umd.js +156 -146
  121. package/bundles/material-grid-list.umd.js.map +1 -1
  122. package/bundles/material-grid-list.umd.min.js +12 -19
  123. package/bundles/material-grid-list.umd.min.js.map +1 -1
  124. package/bundles/material-icon-testing.umd.js +12 -2
  125. package/bundles/material-icon-testing.umd.js.map +1 -1
  126. package/bundles/material-icon-testing.umd.min.js +2 -2
  127. package/bundles/material-icon-testing.umd.min.js.map +1 -1
  128. package/bundles/material-icon.umd.js +46 -2
  129. package/bundles/material-icon.umd.js.map +1 -1
  130. package/bundles/material-icon.umd.min.js +3 -3
  131. package/bundles/material-icon.umd.min.js.map +1 -1
  132. package/bundles/material-input-testing.umd.js +19 -8
  133. package/bundles/material-input-testing.umd.js.map +1 -1
  134. package/bundles/material-input-testing.umd.min.js +1 -1
  135. package/bundles/material-input-testing.umd.min.js.map +1 -1
  136. package/bundles/material-input.umd.js +9 -1
  137. package/bundles/material-input.umd.js.map +1 -1
  138. package/bundles/material-input.umd.min.js +1 -1
  139. package/bundles/material-input.umd.min.js.map +1 -1
  140. package/bundles/material-list-testing.umd.js +62 -57
  141. package/bundles/material-list-testing.umd.js.map +1 -1
  142. package/bundles/material-list-testing.umd.min.js +1 -1
  143. package/bundles/material-list-testing.umd.min.js.map +1 -1
  144. package/bundles/material-list.umd.js +9 -1
  145. package/bundles/material-list.umd.js.map +1 -1
  146. package/bundles/material-list.umd.min.js +1 -1
  147. package/bundles/material-list.umd.min.js.map +1 -1
  148. package/bundles/material-menu-testing.umd.js +94 -67
  149. package/bundles/material-menu-testing.umd.js.map +1 -1
  150. package/bundles/material-menu-testing.umd.min.js +2 -2
  151. package/bundles/material-menu-testing.umd.min.js.map +1 -1
  152. package/bundles/material-menu.umd.js +24 -28
  153. package/bundles/material-menu.umd.js.map +1 -1
  154. package/bundles/material-menu.umd.min.js +3 -3
  155. package/bundles/material-menu.umd.min.js.map +1 -1
  156. package/bundles/material-paginator-testing.umd.js +50 -34
  157. package/bundles/material-paginator-testing.umd.js.map +1 -1
  158. package/bundles/material-paginator-testing.umd.min.js +2 -2
  159. package/bundles/material-paginator-testing.umd.min.js.map +1 -1
  160. package/bundles/material-paginator.umd.js +9 -1
  161. package/bundles/material-paginator.umd.js.map +1 -1
  162. package/bundles/material-paginator.umd.min.js +1 -1
  163. package/bundles/material-paginator.umd.min.js.map +1 -1
  164. package/bundles/material-progress-bar-testing.umd.js +9 -1
  165. package/bundles/material-progress-bar-testing.umd.js.map +1 -1
  166. package/bundles/material-progress-bar-testing.umd.min.js +1 -1
  167. package/bundles/material-progress-bar-testing.umd.min.js.map +1 -1
  168. package/bundles/material-progress-bar.umd.js +9 -1
  169. package/bundles/material-progress-bar.umd.js.map +1 -1
  170. package/bundles/material-progress-bar.umd.min.js +1 -1
  171. package/bundles/material-progress-bar.umd.min.js.map +1 -1
  172. package/bundles/material-progress-spinner-testing.umd.js +9 -1
  173. package/bundles/material-progress-spinner-testing.umd.js.map +1 -1
  174. package/bundles/material-progress-spinner-testing.umd.min.js +1 -1
  175. package/bundles/material-progress-spinner-testing.umd.min.js.map +1 -1
  176. package/bundles/material-progress-spinner.umd.js +9 -1
  177. package/bundles/material-progress-spinner.umd.js.map +1 -1
  178. package/bundles/material-progress-spinner.umd.min.js +2 -2
  179. package/bundles/material-progress-spinner.umd.min.js.map +1 -1
  180. package/bundles/material-radio-testing.umd.js +88 -63
  181. package/bundles/material-radio-testing.umd.js.map +1 -1
  182. package/bundles/material-radio-testing.umd.min.js +2 -2
  183. package/bundles/material-radio-testing.umd.min.js.map +1 -1
  184. package/bundles/material-radio.umd.js +18 -5
  185. package/bundles/material-radio.umd.js.map +1 -1
  186. package/bundles/material-radio.umd.min.js +1 -1
  187. package/bundles/material-radio.umd.min.js.map +1 -1
  188. package/bundles/material-select-testing.umd.js +73 -51
  189. package/bundles/material-select-testing.umd.js.map +1 -1
  190. package/bundles/material-select-testing.umd.min.js +2 -2
  191. package/bundles/material-select-testing.umd.min.js.map +1 -1
  192. package/bundles/material-select.umd.js +14 -3
  193. package/bundles/material-select.umd.js.map +1 -1
  194. package/bundles/material-select.umd.min.js +5 -5
  195. package/bundles/material-select.umd.min.js.map +1 -1
  196. package/bundles/material-sidenav-testing.umd.js +175 -28
  197. package/bundles/material-sidenav-testing.umd.js.map +1 -1
  198. package/bundles/material-sidenav-testing.umd.min.js +2 -2
  199. package/bundles/material-sidenav-testing.umd.min.js.map +1 -1
  200. package/bundles/material-sidenav.umd.js +9 -1
  201. package/bundles/material-sidenav.umd.js.map +1 -1
  202. package/bundles/material-sidenav.umd.min.js +1 -1
  203. package/bundles/material-sidenav.umd.min.js.map +1 -1
  204. package/bundles/material-slide-toggle-testing.umd.js +9 -1
  205. package/bundles/material-slide-toggle-testing.umd.js.map +1 -1
  206. package/bundles/material-slide-toggle-testing.umd.min.js +1 -1
  207. package/bundles/material-slide-toggle-testing.umd.min.js.map +1 -1
  208. package/bundles/material-slide-toggle.umd.js +16 -3
  209. package/bundles/material-slide-toggle.umd.js.map +1 -1
  210. package/bundles/material-slide-toggle.umd.min.js +3 -3
  211. package/bundles/material-slide-toggle.umd.min.js.map +1 -1
  212. package/bundles/material-slider-testing.umd.js +15 -4
  213. package/bundles/material-slider-testing.umd.js.map +1 -1
  214. package/bundles/material-slider-testing.umd.min.js +2 -2
  215. package/bundles/material-slider-testing.umd.min.js.map +1 -1
  216. package/bundles/material-slider.umd.js +9 -1
  217. package/bundles/material-slider.umd.js.map +1 -1
  218. package/bundles/material-slider.umd.min.js +1 -1
  219. package/bundles/material-slider.umd.min.js.map +1 -1
  220. package/bundles/material-snack-bar-testing.umd.js +29 -12
  221. package/bundles/material-snack-bar-testing.umd.js.map +1 -1
  222. package/bundles/material-snack-bar-testing.umd.min.js +2 -2
  223. package/bundles/material-snack-bar-testing.umd.min.js.map +1 -1
  224. package/bundles/material-snack-bar.umd.js +20 -2
  225. package/bundles/material-snack-bar.umd.js.map +1 -1
  226. package/bundles/material-snack-bar.umd.min.js +1 -1
  227. package/bundles/material-snack-bar.umd.min.js.map +1 -1
  228. package/bundles/material-sort-testing.umd.js +9 -1
  229. package/bundles/material-sort-testing.umd.js.map +1 -1
  230. package/bundles/material-sort-testing.umd.min.js +1 -1
  231. package/bundles/material-sort-testing.umd.min.js.map +1 -1
  232. package/bundles/material-sort.umd.js +9 -1
  233. package/bundles/material-sort.umd.js.map +1 -1
  234. package/bundles/material-sort.umd.min.js +3 -3
  235. package/bundles/material-sort.umd.min.js.map +1 -1
  236. package/bundles/material-stepper-testing.umd.js +9 -1
  237. package/bundles/material-stepper-testing.umd.js.map +1 -1
  238. package/bundles/material-stepper-testing.umd.min.js +2 -2
  239. package/bundles/material-stepper-testing.umd.min.js.map +1 -1
  240. package/bundles/material-stepper.umd.js +16 -3
  241. package/bundles/material-stepper.umd.js.map +1 -1
  242. package/bundles/material-stepper.umd.min.js +3 -3
  243. package/bundles/material-stepper.umd.min.js.map +1 -1
  244. package/bundles/material-table-testing.umd.js +26 -17
  245. package/bundles/material-table-testing.umd.js.map +1 -1
  246. package/bundles/material-table-testing.umd.min.js +2 -2
  247. package/bundles/material-table-testing.umd.min.js.map +1 -1
  248. package/bundles/material-table.umd.js +65 -38
  249. package/bundles/material-table.umd.js.map +1 -1
  250. package/bundles/material-table.umd.min.js +3 -3
  251. package/bundles/material-table.umd.min.js.map +1 -1
  252. package/bundles/material-tabs-testing.umd.js +11 -3
  253. package/bundles/material-tabs-testing.umd.js.map +1 -1
  254. package/bundles/material-tabs-testing.umd.min.js +1 -1
  255. package/bundles/material-tabs-testing.umd.min.js.map +1 -1
  256. package/bundles/material-tabs.umd.js +10 -2
  257. package/bundles/material-tabs.umd.js.map +1 -1
  258. package/bundles/material-tabs.umd.min.js +5 -5
  259. package/bundles/material-tabs.umd.min.js.map +1 -1
  260. package/bundles/material-toolbar-testing.umd.js +11 -2
  261. package/bundles/material-toolbar-testing.umd.js.map +1 -1
  262. package/bundles/material-toolbar-testing.umd.min.js +2 -2
  263. package/bundles/material-toolbar-testing.umd.min.js.map +1 -1
  264. package/bundles/material-toolbar.umd.js +9 -1
  265. package/bundles/material-toolbar.umd.js.map +1 -1
  266. package/bundles/material-toolbar.umd.min.js +2 -2
  267. package/bundles/material-toolbar.umd.min.js.map +1 -1
  268. package/bundles/material-tooltip-testing.umd.js +9 -1
  269. package/bundles/material-tooltip-testing.umd.js.map +1 -1
  270. package/bundles/material-tooltip-testing.umd.min.js +1 -1
  271. package/bundles/material-tooltip-testing.umd.min.js.map +1 -1
  272. package/bundles/material-tooltip.umd.js +35 -7
  273. package/bundles/material-tooltip.umd.js.map +1 -1
  274. package/bundles/material-tooltip.umd.min.js +3 -3
  275. package/bundles/material-tooltip.umd.min.js.map +1 -1
  276. package/bundles/material-tree-testing.umd.js +10 -2
  277. package/bundles/material-tree-testing.umd.js.map +1 -1
  278. package/bundles/material-tree-testing.umd.min.js +1 -1
  279. package/bundles/material-tree-testing.umd.min.js.map +1 -1
  280. package/bundles/material-tree.umd.js +9 -1
  281. package/bundles/material-tree.umd.js.map +1 -1
  282. package/bundles/material-tree.umd.min.js +3 -3
  283. package/bundles/material-tree.umd.min.js.map +1 -1
  284. package/button/_button-base.scss +2 -2
  285. package/button/_button-theme.scss +10 -11
  286. package/button/index.metadata.json +1 -1
  287. package/button-toggle/_button-toggle-theme.scss +9 -10
  288. package/card/_card-theme.scss +5 -6
  289. package/checkbox/_checkbox-theme.scss +2 -3
  290. package/checkbox/testing/checkbox-harness.d.ts +21 -16
  291. package/chips/_chips-theme.scss +4 -5
  292. package/chips/testing/chip-harness-filters.d.ts +11 -3
  293. package/chips/testing/chip-harness.d.ts +5 -5
  294. package/chips/testing/chip-list-harness.d.ts +15 -12
  295. package/chips/testing/chip-listbox-harness.d.ts +34 -0
  296. package/chips/testing/chip-option-harness.d.ts +29 -0
  297. package/chips/testing/public-api.d.ts +3 -1
  298. package/core/_core.scss +6 -6
  299. package/core/color/_all-color.scss +2 -1
  300. package/core/datetime/date-formats.d.ts +1 -0
  301. package/core/density/private/_all-density.scss +34 -0
  302. package/core/density/{_index.scss → private/_compatibility.scss} +11 -8
  303. package/core/focus-indicators/_focus-indicators.scss +3 -4
  304. package/core/index.metadata.json +1 -1
  305. package/core/option/_optgroup-theme.scss +2 -3
  306. package/core/option/_option-theme.scss +2 -3
  307. package/core/option/index.d.ts +1 -0
  308. package/core/option/optgroup.d.ts +4 -0
  309. package/core/option/option-parent.d.ts +22 -0
  310. package/core/option/option.d.ts +2 -14
  311. package/core/ripple/_ripple.scss +2 -3
  312. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +2 -3
  313. package/core/style/_elevation.scss +2 -18
  314. package/core/style/_form-common.scss +2 -2
  315. package/core/style/_private.scss +40 -0
  316. package/core/testing/option-harness.d.ts +2 -0
  317. package/core/theming/_all-theme.scss +3 -2
  318. package/core/theming/_theming.scss +148 -38
  319. package/core/typography/_all-typography.scss +1 -1
  320. package/datepicker/_datepicker-theme.scss +5 -6
  321. package/datepicker/date-range-input-parts.d.ts +2 -3
  322. package/datepicker/date-range-input.d.ts +5 -4
  323. package/datepicker/date-selection-model.d.ts +10 -0
  324. package/datepicker/datepicker-actions.d.ts +33 -0
  325. package/datepicker/datepicker-base.d.ts +52 -9
  326. package/datepicker/datepicker-input-base.d.ts +5 -10
  327. package/datepicker/datepicker-input.d.ts +9 -8
  328. package/datepicker/datepicker-toggle.d.ts +4 -2
  329. package/datepicker/index.metadata.json +1 -1
  330. package/datepicker/public-api.d.ts +1 -0
  331. package/dialog/_dialog-theme.scss +4 -5
  332. package/divider/_divider-theme.scss +2 -3
  333. package/esm2015/autocomplete/autocomplete-trigger.js +10 -2
  334. package/esm2015/autocomplete/autocomplete.js +11 -4
  335. package/esm2015/autocomplete/testing/autocomplete-harness.js +27 -19
  336. package/esm2015/button/button.js +10 -5
  337. package/esm2015/checkbox/checkbox.js +8 -3
  338. package/esm2015/checkbox/testing/checkbox-harness.js +31 -36
  339. package/esm2015/chips/testing/chip-harness-filters.js +1 -1
  340. package/esm2015/chips/testing/chip-harness.js +6 -6
  341. package/esm2015/chips/testing/chip-list-harness.js +19 -16
  342. package/esm2015/chips/testing/chip-listbox-harness.js +49 -0
  343. package/esm2015/chips/testing/chip-option-harness.js +54 -0
  344. package/esm2015/chips/testing/public-api.js +4 -2
  345. package/esm2015/core/common-behaviors/common-module.js +1 -1
  346. package/esm2015/core/datetime/date-formats.js +1 -1
  347. package/esm2015/core/option/index.js +2 -1
  348. package/esm2015/core/option/optgroup.js +32 -7
  349. package/esm2015/core/option/option-parent.js +13 -0
  350. package/esm2015/core/option/option.js +5 -8
  351. package/esm2015/core/testing/option-harness.js +7 -2
  352. package/esm2015/core/version.js +1 -1
  353. package/esm2015/datepicker/date-range-input-parts.js +10 -14
  354. package/esm2015/datepicker/date-range-input.js +11 -4
  355. package/esm2015/datepicker/date-range-picker.js +3 -2
  356. package/esm2015/datepicker/date-selection-model.js +24 -1
  357. package/esm2015/datepicker/datepicker-actions.js +89 -0
  358. package/esm2015/datepicker/datepicker-base.js +66 -25
  359. package/esm2015/datepicker/datepicker-input-base.js +15 -27
  360. package/esm2015/datepicker/datepicker-input.js +11 -5
  361. package/esm2015/datepicker/datepicker-module.js +8 -1
  362. package/esm2015/datepicker/datepicker-toggle.js +7 -10
  363. package/esm2015/datepicker/datepicker.js +5 -2
  364. package/esm2015/datepicker/month-view.js +6 -3
  365. package/esm2015/datepicker/public-api.js +2 -1
  366. package/esm2015/datepicker/testing/date-range-input-harness.js +4 -4
  367. package/esm2015/datepicker/testing/datepicker-input-harness.js +3 -3
  368. package/esm2015/datepicker/testing/datepicker-trigger-harness-base.js +3 -3
  369. package/esm2015/dialog/dialog-ref.js +2 -2
  370. package/esm2015/expansion/expansion-panel-header.js +9 -4
  371. package/esm2015/expansion/expansion-panel.js +1 -1
  372. package/esm2015/form-field/form-field-animations.js +2 -2
  373. package/esm2015/form-field/form-field.js +2 -2
  374. package/esm2015/form-field/testing/form-field-harness.js +14 -9
  375. package/esm2015/grid-list/public-api.js +3 -2
  376. package/esm2015/grid-list/testing/grid-list-harness.js +6 -5
  377. package/esm2015/icon/icon-registry.js +39 -3
  378. package/esm2015/icon/testing/fake-icon-registry.js +4 -2
  379. package/esm2015/input/testing/input-harness.js +3 -3
  380. package/esm2015/input/testing/native-select-harness.js +7 -5
  381. package/esm2015/list/selection-list.js +1 -1
  382. package/esm2015/list/testing/list-harness-base.js +5 -4
  383. package/esm2015/list/testing/list-item-harness-base.js +5 -4
  384. package/esm2015/list/testing/selection-list-harness.js +8 -5
  385. package/esm2015/menu/menu-item.js +3 -3
  386. package/esm2015/menu/menu-trigger.js +15 -25
  387. package/esm2015/menu/menu.js +2 -2
  388. package/esm2015/menu/testing/menu-harness.js +44 -32
  389. package/esm2015/paginator/testing/paginator-harness.js +27 -25
  390. package/esm2015/radio/radio.js +10 -5
  391. package/esm2015/radio/testing/radio-harness.js +40 -29
  392. package/esm2015/select/select.js +6 -3
  393. package/esm2015/select/testing/select-harness.js +36 -28
  394. package/esm2015/sidenav/testing/drawer-container-harness.js +41 -0
  395. package/esm2015/sidenav/testing/drawer-content-harness.js +23 -0
  396. package/esm2015/sidenav/testing/drawer-harness-filters.js +1 -1
  397. package/esm2015/sidenav/testing/drawer-harness.js +19 -13
  398. package/esm2015/sidenav/testing/public-api.js +6 -2
  399. package/esm2015/sidenav/testing/sidenav-container-harness.js +41 -0
  400. package/esm2015/sidenav/testing/sidenav-content-harness.js +23 -0
  401. package/esm2015/sidenav/testing/sidenav-harness.js +4 -4
  402. package/esm2015/slide-toggle/slide-toggle.js +8 -3
  403. package/esm2015/slider/testing/slider-harness.js +5 -5
  404. package/esm2015/snack-bar/snack-bar-container.js +12 -2
  405. package/esm2015/snack-bar/testing/snack-bar-harness.js +19 -12
  406. package/esm2015/stepper/step-header.js +8 -3
  407. package/esm2015/table/table-data-source.js +34 -21
  408. package/esm2015/table/testing/cell-harness.js +3 -3
  409. package/esm2015/table/testing/row-harness.js +5 -5
  410. package/esm2015/table/testing/table-harness.js +8 -8
  411. package/esm2015/tabs/tab-body.js +3 -3
  412. package/esm2015/tabs/testing/tab-group-harness.js +3 -3
  413. package/esm2015/tabs/testing/tab-nav-bar-harness.js +3 -3
  414. package/esm2015/toolbar/testing/toolbar-harness.js +3 -3
  415. package/esm2015/tooltip/tooltip.js +28 -7
  416. package/esm2015/tree/testing/tree-harness.js +2 -2
  417. package/expansion/_expansion-mixins.scss +11 -0
  418. package/expansion/_expansion-theme.scss +13 -19
  419. package/expansion/index.metadata.json +1 -1
  420. package/fesm2015/autocomplete/testing.js +26 -18
  421. package/fesm2015/autocomplete/testing.js.map +1 -1
  422. package/fesm2015/autocomplete.js +19 -5
  423. package/fesm2015/autocomplete.js.map +1 -1
  424. package/fesm2015/button.js +9 -4
  425. package/fesm2015/button.js.map +1 -1
  426. package/fesm2015/checkbox/testing.js +30 -35
  427. package/fesm2015/checkbox/testing.js.map +1 -1
  428. package/fesm2015/checkbox.js +7 -2
  429. package/fesm2015/checkbox.js.map +1 -1
  430. package/fesm2015/chips/testing.js +120 -21
  431. package/fesm2015/chips/testing.js.map +1 -1
  432. package/fesm2015/core/testing.js +6 -1
  433. package/fesm2015/core/testing.js.map +1 -1
  434. package/fesm2015/core.js +45 -13
  435. package/fesm2015/core.js.map +1 -1
  436. package/fesm2015/datepicker/testing.js +5 -5
  437. package/fesm2015/datepicker/testing.js.map +1 -1
  438. package/fesm2015/datepicker.js +275 -116
  439. package/fesm2015/datepicker.js.map +1 -1
  440. package/fesm2015/dialog.js +1 -1
  441. package/fesm2015/dialog.js.map +1 -1
  442. package/fesm2015/expansion.js +8 -3
  443. package/fesm2015/expansion.js.map +1 -1
  444. package/fesm2015/form-field/testing.js +13 -8
  445. package/fesm2015/form-field/testing.js.map +1 -1
  446. package/fesm2015/form-field.js +2 -2
  447. package/fesm2015/form-field.js.map +1 -1
  448. package/fesm2015/grid-list/testing.js +5 -4
  449. package/fesm2015/grid-list/testing.js.map +1 -1
  450. package/fesm2015/grid-list.js +128 -126
  451. package/fesm2015/grid-list.js.map +1 -1
  452. package/fesm2015/icon/testing.js +3 -1
  453. package/fesm2015/icon/testing.js.map +1 -1
  454. package/fesm2015/icon.js +38 -2
  455. package/fesm2015/icon.js.map +1 -1
  456. package/fesm2015/input/testing.js +7 -5
  457. package/fesm2015/input/testing.js.map +1 -1
  458. package/fesm2015/list/testing.js +13 -8
  459. package/fesm2015/list/testing.js.map +1 -1
  460. package/fesm2015/list.js.map +1 -1
  461. package/fesm2015/menu/testing.js +45 -33
  462. package/fesm2015/menu/testing.js.map +1 -1
  463. package/fesm2015/menu.js +17 -27
  464. package/fesm2015/menu.js.map +1 -1
  465. package/fesm2015/paginator/testing.js +26 -24
  466. package/fesm2015/paginator/testing.js.map +1 -1
  467. package/fesm2015/paginator.js.map +1 -1
  468. package/fesm2015/progress-spinner.js.map +1 -1
  469. package/fesm2015/radio/testing.js +39 -28
  470. package/fesm2015/radio/testing.js.map +1 -1
  471. package/fesm2015/radio.js +9 -4
  472. package/fesm2015/radio.js.map +1 -1
  473. package/fesm2015/select/testing.js +36 -28
  474. package/fesm2015/select/testing.js.map +1 -1
  475. package/fesm2015/select.js +5 -2
  476. package/fesm2015/select.js.map +1 -1
  477. package/fesm2015/sidenav/testing.js +139 -15
  478. package/fesm2015/sidenav/testing.js.map +1 -1
  479. package/fesm2015/sidenav.js.map +1 -1
  480. package/fesm2015/slide-toggle.js +7 -2
  481. package/fesm2015/slide-toggle.js.map +1 -1
  482. package/fesm2015/slider/testing.js +4 -4
  483. package/fesm2015/slider/testing.js.map +1 -1
  484. package/fesm2015/snack-bar/testing.js +18 -11
  485. package/fesm2015/snack-bar/testing.js.map +1 -1
  486. package/fesm2015/snack-bar.js +11 -1
  487. package/fesm2015/snack-bar.js.map +1 -1
  488. package/fesm2015/stepper.js +7 -2
  489. package/fesm2015/stepper.js.map +1 -1
  490. package/fesm2015/table/testing.js +11 -11
  491. package/fesm2015/table/testing.js.map +1 -1
  492. package/fesm2015/table.js +34 -21
  493. package/fesm2015/table.js.map +1 -1
  494. package/fesm2015/tabs/testing.js +3 -3
  495. package/fesm2015/tabs/testing.js.map +1 -1
  496. package/fesm2015/tabs.js +2 -2
  497. package/fesm2015/tabs.js.map +1 -1
  498. package/fesm2015/toolbar/testing.js +2 -2
  499. package/fesm2015/toolbar/testing.js.map +1 -1
  500. package/fesm2015/tooltip.js +27 -7
  501. package/fesm2015/tooltip.js.map +1 -1
  502. package/fesm2015/tree/testing.js +1 -1
  503. package/fesm2015/tree/testing.js.map +1 -1
  504. package/form-field/_form-field-fill-theme.scss +4 -5
  505. package/form-field/_form-field-legacy-theme.scss +5 -6
  506. package/form-field/_form-field-outline-theme.scss +4 -5
  507. package/form-field/_form-field-standard-theme.scss +5 -6
  508. package/form-field/_form-field-theme.scss +8 -9
  509. package/form-field/index.metadata.json +1 -1
  510. package/grid-list/_grid-list-theme.scss +2 -3
  511. package/grid-list/index.metadata.json +1 -1
  512. package/grid-list/public-api.d.ts +2 -1
  513. package/icon/_icon-theme.scss +2 -3
  514. package/icon/icon-registry.d.ts +23 -0
  515. package/icon/index.metadata.json +1 -1
  516. package/icon/testing/fake-icon-registry.d.ts +1 -0
  517. package/icon/testing/index.metadata.json +1 -1
  518. package/input/_input-theme.scss +3 -4
  519. package/list/_list-theme.scss +2 -3
  520. package/list/index.metadata.json +1 -1
  521. package/list/selection-list.d.ts +6 -1
  522. package/list/testing/list-harness-base.d.ts +1 -1
  523. package/list/testing/list-item-harness-base.d.ts +2 -2
  524. package/list/testing/selection-list-harness.d.ts +2 -1
  525. package/menu/_menu-theme.scss +4 -5
  526. package/menu/index.metadata.json +1 -1
  527. package/menu/menu-trigger.d.ts +1 -3
  528. package/menu/menu.d.ts +4 -2
  529. package/menu/testing/menu-harness.d.ts +39 -26
  530. package/package.json +2 -2
  531. package/paginator/_paginator-theme.scss +7 -8
  532. package/paginator/testing/paginator-harness.d.ts +32 -19
  533. package/prebuilt-themes/deeppurple-amber.css +1 -1
  534. package/prebuilt-themes/indigo-pink.css +1 -1
  535. package/prebuilt-themes/pink-bluegrey.css +1 -1
  536. package/prebuilt-themes/purple-green.css +1 -1
  537. package/progress-bar/_progress-bar-theme.scss +2 -3
  538. package/progress-spinner/_progress-spinner-theme.scss +2 -3
  539. package/radio/_radio-theme.scss +2 -3
  540. package/radio/index.metadata.json +1 -1
  541. package/radio/radio.d.ts +2 -2
  542. package/radio/testing/radio-harness.d.ts +39 -24
  543. package/schematics/ng-add/fonts/material-fonts.js +7 -5
  544. package/schematics/ng-add/index.js +1 -1
  545. package/schematics/ng-add/setup-project.js +4 -3
  546. package/select/_select-theme.scss +5 -6
  547. package/select/index.metadata.json +1 -1
  548. package/select/testing/select-harness.d.ts +28 -16
  549. package/sidenav/_sidenav-theme.scss +4 -5
  550. package/sidenav/testing/drawer-container-harness.d.ts +30 -0
  551. package/sidenav/testing/drawer-content-harness.d.ts +21 -0
  552. package/sidenav/testing/drawer-harness-filters.d.ts +6 -0
  553. package/sidenav/testing/drawer-harness.d.ts +13 -7
  554. package/sidenav/testing/public-api.d.ts +5 -1
  555. package/sidenav/testing/sidenav-container-harness.d.ts +30 -0
  556. package/sidenav/testing/sidenav-content-harness.d.ts +21 -0
  557. package/sidenav/testing/sidenav-harness.d.ts +3 -3
  558. package/slide-toggle/_slide-toggle-theme.scss +4 -5
  559. package/slide-toggle/slide-toggle.d.ts +2 -2
  560. package/slider/_slider-theme.scss +2 -3
  561. package/snack-bar/_snack-bar-theme.scss +4 -5
  562. package/snack-bar/index.metadata.json +1 -1
  563. package/snack-bar/snack-bar-container.d.ts +5 -0
  564. package/snack-bar/testing/snack-bar-harness.d.ts +7 -4
  565. package/sort/_sort-theme.scss +2 -3
  566. package/stepper/_stepper-theme.scss +7 -8
  567. package/stepper/step-header.d.ts +2 -2
  568. package/table/_table-theme.scss +2 -3
  569. package/table/index.metadata.json +1 -1
  570. package/table/table-data-source.d.ts +31 -20
  571. package/table/testing/cell-harness.d.ts +2 -2
  572. package/tabs/_tabs-common.scss +2 -2
  573. package/tabs/_tabs-theme.scss +14 -9
  574. package/tabs/index.metadata.json +1 -1
  575. package/tabs/tab-body.d.ts +3 -3
  576. package/toolbar/_toolbar-theme.scss +8 -9
  577. package/tooltip/_tooltip-theme.scss +2 -3
  578. package/tooltip/index.metadata.json +1 -1
  579. package/tooltip/tooltip.d.ts +10 -1
  580. package/tree/_tree-theme.scss +7 -8
  581. package/core/density/_all-density.scss +0 -19
  582. package/core/style/_noop-animation.scss +0 -22
  583. package/core/theming/_check-duplicate-styles.scss +0 -106
@@ -1,8 +1,8 @@
1
1
  import { A11yModule } from '@angular/cdk/a11y';
2
2
  import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
3
- import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
3
+ import { ComponentPortal, TemplatePortal, PortalModule } from '@angular/cdk/portal';
4
4
  import { DOCUMENT, CommonModule } from '@angular/common';
5
- import { ɵɵdefineInjectable, Injectable, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, ElementRef, NgZone, Input, Output, Directive, Optional, SkipSelf, InjectionToken, ChangeDetectorRef, Inject, ViewChild, forwardRef, ViewContainerRef, Attribute, ContentChild, InjectFlags, Injector, Self, NgModule } from '@angular/core';
5
+ import { ɵɵdefineInjectable, Injectable, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, ElementRef, NgZone, Input, Output, Directive, Optional, SkipSelf, InjectionToken, ChangeDetectorRef, Inject, ViewChild, forwardRef, ViewContainerRef, Attribute, ContentChild, InjectFlags, Injector, Self, TemplateRef, NgModule } from '@angular/core';
6
6
  import { MatButtonModule } from '@angular/material/button';
7
7
  import { MatDialog, MatDialogModule } from '@angular/material/dialog';
8
8
  import { CdkScrollableModule } from '@angular/cdk/scrolling';
@@ -415,6 +415,17 @@ class MatDateSelectionModel {
415
415
  _isValidDateInstance(date) {
416
416
  return this._adapter.isDateInstance(date) && this._adapter.isValid(date);
417
417
  }
418
+ /**
419
+ * Clones the selection model.
420
+ * @deprecated To be turned into an abstract method.
421
+ * @breaking-change 12.0.0
422
+ */
423
+ clone() {
424
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
425
+ throw Error('Not implemented');
426
+ }
427
+ return null;
428
+ }
418
429
  }
419
430
  MatDateSelectionModel.decorators = [
420
431
  { type: Directive }
@@ -446,6 +457,12 @@ class MatSingleDateSelectionModel extends MatDateSelectionModel {
446
457
  isComplete() {
447
458
  return this.selection != null;
448
459
  }
460
+ /** Clones the selection model. */
461
+ clone() {
462
+ const clone = new MatSingleDateSelectionModel(this._adapter);
463
+ clone.updateSelection(this.selection, this);
464
+ return clone;
465
+ }
449
466
  }
450
467
  MatSingleDateSelectionModel.decorators = [
451
468
  { type: Injectable }
@@ -500,6 +517,12 @@ class MatRangeDateSelectionModel extends MatDateSelectionModel {
500
517
  isComplete() {
501
518
  return this.selection.start != null && this.selection.end != null;
502
519
  }
520
+ /** Clones the selection model. */
521
+ clone() {
522
+ const clone = new MatRangeDateSelectionModel(this._adapter);
523
+ clone.updateSelection(this.selection, this);
524
+ return clone;
525
+ }
503
526
  }
504
527
  MatRangeDateSelectionModel.decorators = [
505
528
  { type: Injectable }
@@ -685,6 +708,8 @@ class MatMonthView {
685
708
  this.selectedChange.emit(selectedDate);
686
709
  }
687
710
  this._userSelection.emit({ value: selectedDate, event: event.event });
711
+ this._previewStart = this._previewEnd = null;
712
+ this._changeDetectorRef.markForCheck();
688
713
  }
689
714
  /** Handles keydown events on the calendar body when calendar is in month view. */
690
715
  _handleCalendarBodyKeydown(event) {
@@ -756,8 +781,9 @@ class MatMonthView {
756
781
  _init() {
757
782
  this._setRanges(this.selected);
758
783
  this._todayDate = this._getCellCompareValue(this._dateAdapter.today());
759
- this._monthLabel =
760
- this._dateAdapter.getMonthNames('short')[this._dateAdapter.getMonth(this.activeDate)]
784
+ this._monthLabel = this._dateFormats.display.monthLabel
785
+ ? this._dateAdapter.format(this.activeDate, this._dateFormats.display.monthLabel)
786
+ : this._dateAdapter.getMonthNames('short')[this._dateAdapter.getMonth(this.activeDate)]
761
787
  .toLocaleUpperCase();
762
788
  let firstOfMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), 1);
763
789
  this._firstWeekOffset =
@@ -1802,7 +1828,7 @@ const _MatDatepickerContentMixinBase = mixinColor(MatDatepickerContentBase);
1802
1828
  * @docs-private
1803
1829
  */
1804
1830
  class MatDatepickerContent extends _MatDatepickerContentMixinBase {
1805
- constructor(elementRef, _changeDetectorRef, _model, _dateAdapter, _rangeSelectionStrategy,
1831
+ constructor(elementRef, _changeDetectorRef, _globalModel, _dateAdapter, _rangeSelectionStrategy,
1806
1832
  /**
1807
1833
  * @deprecated `intl` argument to become required.
1808
1834
  * @breaking-change 12.0.0
@@ -1810,7 +1836,7 @@ class MatDatepickerContent extends _MatDatepickerContentMixinBase {
1810
1836
  intl) {
1811
1837
  super(elementRef);
1812
1838
  this._changeDetectorRef = _changeDetectorRef;
1813
- this._model = _model;
1839
+ this._globalModel = _globalModel;
1814
1840
  this._dateAdapter = _dateAdapter;
1815
1841
  this._rangeSelectionStrategy = _rangeSelectionStrategy;
1816
1842
  this._subscriptions = new Subscription();
@@ -1818,11 +1844,19 @@ class MatDatepickerContent extends _MatDatepickerContentMixinBase {
1818
1844
  this._animationState = 'enter';
1819
1845
  /** Emits when an animation has finished. */
1820
1846
  this._animationDone = new Subject();
1847
+ /** Portal with projected action buttons. */
1848
+ this._actionsPortal = null;
1821
1849
  // @breaking-change 12.0.0 Remove fallback for `intl`.
1822
1850
  this._closeButtonText = (intl === null || intl === void 0 ? void 0 : intl.closeCalendarLabel) || 'Close calendar';
1823
1851
  }
1852
+ ngOnInit() {
1853
+ // If we have actions, clone the model so that we have the ability to cancel the selection,
1854
+ // otherwise update the global model directly. Note that we want to assign this as soon as
1855
+ // possible, but `_actionsPortal` isn't available in the constructor so we do it in `ngOnInit`.
1856
+ this._model = this._actionsPortal ? this._globalModel.clone() : this._globalModel;
1857
+ }
1824
1858
  ngAfterViewInit() {
1825
- this._subscriptions.add(this.datepicker._stateChanges.subscribe(() => {
1859
+ this._subscriptions.add(this.datepicker.stateChanges.subscribe(() => {
1826
1860
  this._changeDetectorRef.markForCheck();
1827
1861
  }));
1828
1862
  this._calendar.focusActiveCell();
@@ -1848,7 +1882,8 @@ class MatDatepickerContent extends _MatDatepickerContentMixinBase {
1848
1882
  !this._dateAdapter.sameDate(value, selection))) {
1849
1883
  this._model.add(value);
1850
1884
  }
1851
- if (!this._model || this._model.isComplete()) {
1885
+ // Delegate closing the popup to the actions.
1886
+ if ((!this._model || this._model.isComplete()) && !this._actionsPortal) {
1852
1887
  this.datepicker.close();
1853
1888
  }
1854
1889
  }
@@ -1859,11 +1894,17 @@ class MatDatepickerContent extends _MatDatepickerContentMixinBase {
1859
1894
  _getSelected() {
1860
1895
  return this._model.selection;
1861
1896
  }
1897
+ /** Applies the current pending selection to the global model. */
1898
+ _applyPendingSelection() {
1899
+ if (this._model !== this._globalModel) {
1900
+ this._globalModel.updateSelection(this._model.selection, this);
1901
+ }
1902
+ }
1862
1903
  }
1863
1904
  MatDatepickerContent.decorators = [
1864
1905
  { type: Component, args: [{
1865
1906
  selector: 'mat-datepicker-content',
1866
- template: "<div cdkTrapFocus>\n <mat-calendar\n [id]=\"datepicker.id\"\n [ngClass]=\"datepicker.panelClass\"\n [startAt]=\"datepicker.startAt\"\n [startView]=\"datepicker.startView\"\n [minDate]=\"datepicker._getMinDate()\"\n [maxDate]=\"datepicker._getMaxDate()\"\n [dateFilter]=\"datepicker._getDateFilter()\"\n [headerComponent]=\"datepicker.calendarHeaderComponent\"\n [selected]=\"_getSelected()\"\n [dateClass]=\"datepicker.dateClass\"\n [comparisonStart]=\"comparisonStart\"\n [comparisonEnd]=\"comparisonEnd\"\n [@fadeInCalendar]=\"'enter'\"\n (yearSelected)=\"datepicker._selectYear($event)\"\n (monthSelected)=\"datepicker._selectMonth($event)\"\n (viewChanged)=\"datepicker._viewChanged($event)\"\n (_userSelection)=\"_handleUserSelection($event)\"></mat-calendar>\n\n <!-- Invisible close button for screen reader users. -->\n <button\n type=\"button\"\n mat-raised-button\n [color]=\"color || 'primary'\"\n class=\"mat-datepicker-close-button\"\n [class.cdk-visually-hidden]=\"!_closeButtonFocused\"\n (focus)=\"_closeButtonFocused = true\"\n (blur)=\"_closeButtonFocused = false\"\n (click)=\"datepicker.close()\">{{ _closeButtonText }}</button>\n</div>\n",
1907
+ template: "<div\n cdkTrapFocus\n class=\"mat-datepicker-content-container\"\n [class.mat-datepicker-content-container-with-actions]=\"_actionsPortal\">\n <mat-calendar\n [id]=\"datepicker.id\"\n [ngClass]=\"datepicker.panelClass\"\n [startAt]=\"datepicker.startAt\"\n [startView]=\"datepicker.startView\"\n [minDate]=\"datepicker._getMinDate()\"\n [maxDate]=\"datepicker._getMaxDate()\"\n [dateFilter]=\"datepicker._getDateFilter()\"\n [headerComponent]=\"datepicker.calendarHeaderComponent\"\n [selected]=\"_getSelected()\"\n [dateClass]=\"datepicker.dateClass\"\n [comparisonStart]=\"comparisonStart\"\n [comparisonEnd]=\"comparisonEnd\"\n [@fadeInCalendar]=\"'enter'\"\n (yearSelected)=\"datepicker._selectYear($event)\"\n (monthSelected)=\"datepicker._selectMonth($event)\"\n (viewChanged)=\"datepicker._viewChanged($event)\"\n (_userSelection)=\"_handleUserSelection($event)\"></mat-calendar>\n\n <ng-template [cdkPortalOutlet]=\"_actionsPortal\"></ng-template>\n\n <!-- Invisible close button for screen reader users. -->\n <button\n type=\"button\"\n mat-raised-button\n [color]=\"color || 'primary'\"\n class=\"mat-datepicker-close-button\"\n [class.cdk-visually-hidden]=\"!_closeButtonFocused\"\n (focus)=\"_closeButtonFocused = true\"\n (blur)=\"_closeButtonFocused = false\"\n (click)=\"datepicker.close()\">{{ _closeButtonText }}</button>\n</div>\n",
1867
1908
  host: {
1868
1909
  'class': 'mat-datepicker-content',
1869
1910
  '[@transformPanel]': '_animationState',
@@ -1878,7 +1919,7 @@ MatDatepickerContent.decorators = [
1878
1919
  encapsulation: ViewEncapsulation.None,
1879
1920
  changeDetection: ChangeDetectionStrategy.OnPush,
1880
1921
  inputs: ['color'],
1881
- styles: [".mat-datepicker-content{display:block;border-radius:4px}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.ng-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-touch{display:block;max-height:80vh;overflow:auto;margin:-24px}.mat-datepicker-content-touch .mat-calendar{min-width:250px;min-height:312px;max-width:750px;max-height:788px}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-calendar{width:64vh;height:80vh}}@media all and (orientation: portrait){.mat-datepicker-content-touch .mat-calendar{width:80vw;height:100vw}}\n"]
1922
+ styles: [".mat-datepicker-content{display:block;border-radius:4px}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.ng-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mat-datepicker-content-touch{display:block;max-height:80vh;overflow:auto;margin:-24px}.mat-datepicker-content-touch .mat-datepicker-content-container{min-height:312px;max-height:788px;min-width:250px;max-width:750px}.mat-datepicker-content-touch .mat-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-datepicker-content-container{width:64vh;height:80vh}}@media all and (orientation: portrait){.mat-datepicker-content-touch .mat-datepicker-content-container{width:80vw;height:100vw}.mat-datepicker-content-touch .mat-datepicker-content-container-with-actions{height:115vw}}\n"]
1882
1923
  },] }
1883
1924
  ];
1884
1925
  MatDatepickerContent.ctorParameters = () => [
@@ -1937,7 +1978,7 @@ class MatDatepickerBase {
1937
1978
  /** Unique class that will be added to the backdrop so that the test harnesses can look it up. */
1938
1979
  this._backdropHarnessClass = `${this.id}-backdrop`;
1939
1980
  /** Emits when the datepicker's state changes. */
1940
- this._stateChanges = new Subject();
1981
+ this.stateChanges = new Subject();
1941
1982
  if (!this._dateAdapter && (typeof ngDevMode === 'undefined' || ngDevMode)) {
1942
1983
  throw createMissingDateImplError('DateAdapter');
1943
1984
  }
@@ -1947,7 +1988,7 @@ class MatDatepickerBase {
1947
1988
  get startAt() {
1948
1989
  // If an explicit startAt is set we start there, otherwise we start at whatever the currently
1949
1990
  // selected value is.
1950
- return this._startAt || (this._datepickerInput ? this._datepickerInput.getStartValue() : null);
1991
+ return this._startAt || (this.datepickerInput ? this.datepickerInput.getStartValue() : null);
1951
1992
  }
1952
1993
  set startAt(value) {
1953
1994
  this._startAt = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));
@@ -1955,7 +1996,7 @@ class MatDatepickerBase {
1955
1996
  /** Color palette to use on the datepicker's calendar. */
1956
1997
  get color() {
1957
1998
  return this._color ||
1958
- (this._datepickerInput ? this._datepickerInput.getThemePalette() : undefined);
1999
+ (this.datepickerInput ? this.datepickerInput.getThemePalette() : undefined);
1959
2000
  }
1960
2001
  set color(value) {
1961
2002
  this._color = value;
@@ -1970,14 +2011,14 @@ class MatDatepickerBase {
1970
2011
  }
1971
2012
  /** Whether the datepicker pop-up should be disabled. */
1972
2013
  get disabled() {
1973
- return this._disabled === undefined && this._datepickerInput ?
1974
- this._datepickerInput.disabled : !!this._disabled;
2014
+ return this._disabled === undefined && this.datepickerInput ?
2015
+ this.datepickerInput.disabled : !!this._disabled;
1975
2016
  }
1976
2017
  set disabled(value) {
1977
2018
  const newValue = coerceBooleanProperty(value);
1978
2019
  if (newValue !== this._disabled) {
1979
2020
  this._disabled = newValue;
1980
- this._stateChanges.next(undefined);
2021
+ this.stateChanges.next(undefined);
1981
2022
  }
1982
2023
  }
1983
2024
  /**
@@ -1995,14 +2036,14 @@ class MatDatepickerBase {
1995
2036
  }
1996
2037
  /** The minimum selectable date. */
1997
2038
  _getMinDate() {
1998
- return this._datepickerInput && this._datepickerInput.min;
2039
+ return this.datepickerInput && this.datepickerInput.min;
1999
2040
  }
2000
2041
  /** The maximum selectable date. */
2001
2042
  _getMaxDate() {
2002
- return this._datepickerInput && this._datepickerInput.max;
2043
+ return this.datepickerInput && this.datepickerInput.max;
2003
2044
  }
2004
2045
  _getDateFilter() {
2005
- return this._datepickerInput && this._datepickerInput.dateFilter;
2046
+ return this.datepickerInput && this.datepickerInput.dateFilter;
2006
2047
  }
2007
2048
  ngOnChanges(changes) {
2008
2049
  const positionChange = changes['xPosition'] || changes['yPosition'];
@@ -2012,13 +2053,13 @@ class MatDatepickerBase {
2012
2053
  this._popupRef.updatePosition();
2013
2054
  }
2014
2055
  }
2015
- this._stateChanges.next(undefined);
2056
+ this.stateChanges.next(undefined);
2016
2057
  }
2017
2058
  ngOnDestroy() {
2018
2059
  this._destroyPopup();
2019
2060
  this.close();
2020
2061
  this._inputStateChanges.unsubscribe();
2021
- this._stateChanges.complete();
2062
+ this.stateChanges.complete();
2022
2063
  }
2023
2064
  /** Selects the given date */
2024
2065
  select(date) {
@@ -2041,22 +2082,41 @@ class MatDatepickerBase {
2041
2082
  * @param input The datepicker input to register with this datepicker.
2042
2083
  * @returns Selection model that the input should hook itself up to.
2043
2084
  */
2044
- _registerInput(input) {
2045
- if (this._datepickerInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {
2085
+ registerInput(input) {
2086
+ if (this.datepickerInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {
2046
2087
  throw Error('A MatDatepicker can only be associated with a single input.');
2047
2088
  }
2048
2089
  this._inputStateChanges.unsubscribe();
2049
- this._datepickerInput = input;
2090
+ this.datepickerInput = input;
2050
2091
  this._inputStateChanges =
2051
- input.stateChanges.subscribe(() => this._stateChanges.next(undefined));
2092
+ input.stateChanges.subscribe(() => this.stateChanges.next(undefined));
2052
2093
  return this._model;
2053
2094
  }
2095
+ /**
2096
+ * Registers a portal containing action buttons with the datepicker.
2097
+ * @param portal Portal to be registered.
2098
+ */
2099
+ registerActions(portal) {
2100
+ if (this._actionsPortal && (typeof ngDevMode === 'undefined' || ngDevMode)) {
2101
+ throw Error('A MatDatepicker can only be associated with a single actions row.');
2102
+ }
2103
+ this._actionsPortal = portal;
2104
+ }
2105
+ /**
2106
+ * Removes a portal containing action buttons from the datepicker.
2107
+ * @param portal Portal to be removed.
2108
+ */
2109
+ removeActions(portal) {
2110
+ if (portal === this._actionsPortal) {
2111
+ this._actionsPortal = null;
2112
+ }
2113
+ }
2054
2114
  /** Open the calendar. */
2055
2115
  open() {
2056
2116
  if (this._opened || this.disabled) {
2057
2117
  return;
2058
2118
  }
2059
- if (!this._datepickerInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {
2119
+ if (!this.datepickerInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {
2060
2120
  throw Error('Attempted to open an MatDatepicker with no associated input.');
2061
2121
  }
2062
2122
  if (this._document) {
@@ -2103,6 +2163,12 @@ class MatDatepickerBase {
2103
2163
  completeClose();
2104
2164
  }
2105
2165
  }
2166
+ /** Applies the current pending selection on the popup to the model. */
2167
+ _applyPendingSelection() {
2168
+ var _a, _b;
2169
+ const instance = ((_a = this._popupComponentRef) === null || _a === void 0 ? void 0 : _a.instance) || ((_b = this._dialogRef) === null || _b === void 0 ? void 0 : _b.componentInstance);
2170
+ instance === null || instance === void 0 ? void 0 : instance._applyPendingSelection();
2171
+ }
2106
2172
  /** Open the calendar as a dialog. */
2107
2173
  _openAsDialog() {
2108
2174
  // Usually this would be handled by `open` which ensures that we can only have one overlay
@@ -2158,11 +2224,12 @@ class MatDatepickerBase {
2158
2224
  _forwardContentValues(instance) {
2159
2225
  instance.datepicker = this;
2160
2226
  instance.color = this.color;
2227
+ instance._actionsPortal = this._actionsPortal;
2161
2228
  }
2162
2229
  /** Create the popup. */
2163
2230
  _createPopup() {
2164
2231
  const positionStrategy = this._overlay.position()
2165
- .flexibleConnectedTo(this._datepickerInput.getConnectedOverlayOrigin())
2232
+ .flexibleConnectedTo(this.datepickerInput.getConnectedOverlayOrigin())
2166
2233
  .withTransformOriginOn('.mat-datepicker-content')
2167
2234
  .withFlexibleDimensions(false)
2168
2235
  .withViewportMargin(8)
@@ -2179,7 +2246,7 @@ class MatDatepickerBase {
2179
2246
  this._popupRef.overlayElement.setAttribute('role', 'dialog');
2180
2247
  merge(this._popupRef.backdropClick(), this._popupRef.detachments(), this._popupRef.keydownEvents().pipe(filter(event => {
2181
2248
  // Closing on alt + up is only valid when there's an input associated with the datepicker.
2182
- return (event.keyCode === ESCAPE && !hasModifierKey(event)) || (this._datepickerInput &&
2249
+ return (event.keyCode === ESCAPE && !hasModifierKey(event)) || (this.datepickerInput &&
2183
2250
  hasModifierKey(event, 'altKey') && event.keyCode === UP_ARROW);
2184
2251
  }))).subscribe(event => {
2185
2252
  if (event) {
@@ -2282,7 +2349,10 @@ MatDatepicker.decorators = [
2282
2349
  exportAs: 'matDatepicker',
2283
2350
  changeDetection: ChangeDetectionStrategy.OnPush,
2284
2351
  encapsulation: ViewEncapsulation.None,
2285
- providers: [MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER]
2352
+ providers: [
2353
+ MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER,
2354
+ { provide: MatDatepickerBase, useExisting: MatDatepicker },
2355
+ ]
2286
2356
  },] }
2287
2357
  ];
2288
2358
 
@@ -2319,8 +2389,6 @@ class MatDatepickerInputBase {
2319
2389
  this.dateChange = new EventEmitter();
2320
2390
  /** Emits when an `input` event is fired on this `<input>`. */
2321
2391
  this.dateInput = new EventEmitter();
2322
- /** Emits when the value changes (either due to user input or programmatic change). */
2323
- this._valueChange = new EventEmitter();
2324
2392
  /** Emits when the internal state has changed */
2325
2393
  this.stateChanges = new Subject();
2326
2394
  this._onTouched = () => { };
@@ -2367,7 +2435,7 @@ class MatDatepickerInputBase {
2367
2435
  }
2368
2436
  // Update the displayed date when the locale changes.
2369
2437
  this._localeSubscription = _dateAdapter.localeChanges.subscribe(() => {
2370
- this.value = this.value;
2438
+ this._assignValueProgrammatically(this.value);
2371
2439
  });
2372
2440
  }
2373
2441
  /** The value of the input. */
@@ -2375,15 +2443,7 @@ class MatDatepickerInputBase {
2375
2443
  return this._model ? this._getValueFromModel(this._model.selection) : this._pendingValue;
2376
2444
  }
2377
2445
  set value(value) {
2378
- value = this._dateAdapter.deserialize(value);
2379
- this._lastValueValid = this._isValidValue(value);
2380
- value = this._dateAdapter.getValidDateOrNull(value);
2381
- const oldDate = this.value;
2382
- this._assignValue(value);
2383
- this._formatValue(value);
2384
- if (!this._dateAdapter.sameDate(oldDate, value)) {
2385
- this._valueChange.emit(value);
2386
- }
2446
+ this._assignValueProgrammatically(value);
2387
2447
  }
2388
2448
  /** Whether the datepicker-input is disabled. */
2389
2449
  get disabled() { return !!this._disabled || this._parentDisabled(); }
@@ -2417,22 +2477,14 @@ class MatDatepickerInputBase {
2417
2477
  this._assignValue(this._pendingValue);
2418
2478
  }
2419
2479
  this._valueChangesSubscription = this._model.selectionChanged.subscribe(event => {
2420
- if (event.source !== this) {
2480
+ if (this._shouldHandleChangeEvent(event)) {
2421
2481
  const value = this._getValueFromModel(event.selection);
2422
2482
  this._lastValueValid = this._isValidValue(value);
2423
2483
  this._cvaOnChange(value);
2424
2484
  this._onTouched();
2425
2485
  this._formatValue(value);
2426
- // Note that we can't wrap the entire block with this logic, because for the range inputs
2427
- // we want to revalidate whenever either one of the inputs changes and we don't have a
2428
- // good way of distinguishing it at the moment.
2429
- if (this._canEmitChangeEvent(event)) {
2430
- this.dateInput.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
2431
- this.dateChange.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
2432
- }
2433
- if (this._outsideValueChanged) {
2434
- this._outsideValueChanged();
2435
- }
2486
+ this.dateInput.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
2487
+ this.dateChange.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
2436
2488
  }
2437
2489
  });
2438
2490
  }
@@ -2447,7 +2499,6 @@ class MatDatepickerInputBase {
2447
2499
  ngOnDestroy() {
2448
2500
  this._valueChangesSubscription.unsubscribe();
2449
2501
  this._localeSubscription.unsubscribe();
2450
- this._valueChange.complete();
2451
2502
  this.stateChanges.complete();
2452
2503
  }
2453
2504
  /** @docs-private */
@@ -2460,7 +2511,7 @@ class MatDatepickerInputBase {
2460
2511
  }
2461
2512
  // Implemented as part of ControlValueAccessor.
2462
2513
  writeValue(value) {
2463
- this.value = value;
2514
+ this._assignValueProgrammatically(value);
2464
2515
  }
2465
2516
  // Implemented as part of ControlValueAccessor.
2466
2517
  registerOnChange(fn) {
@@ -2489,7 +2540,6 @@ class MatDatepickerInputBase {
2489
2540
  if (!this._dateAdapter.sameDate(date, this.value)) {
2490
2541
  this._assignValue(date);
2491
2542
  this._cvaOnChange(date);
2492
- this._valueChange.emit(date);
2493
2543
  this.dateInput.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
2494
2544
  }
2495
2545
  else {
@@ -2542,6 +2592,14 @@ class MatDatepickerInputBase {
2542
2592
  _parentDisabled() {
2543
2593
  return false;
2544
2594
  }
2595
+ /** Programmatically assigns a value to the input. */
2596
+ _assignValueProgrammatically(value) {
2597
+ value = this._dateAdapter.deserialize(value);
2598
+ this._lastValueValid = this._isValidValue(value);
2599
+ value = this._dateAdapter.getValidDateOrNull(value);
2600
+ this._assignValue(value);
2601
+ this._formatValue(value);
2602
+ }
2545
2603
  /** Gets whether a value matches the current date filter. */
2546
2604
  _matchesFilter(value) {
2547
2605
  const filter = this._getDateFilter();
@@ -2606,13 +2664,15 @@ class MatDatepickerInput extends MatDatepickerInputBase {
2606
2664
  constructor(elementRef, dateAdapter, dateFormats, _formField) {
2607
2665
  super(elementRef, dateAdapter, dateFormats);
2608
2666
  this._formField = _formField;
2667
+ this._closedSubscription = Subscription.EMPTY;
2609
2668
  this._validator = Validators.compose(super._getValidators());
2610
2669
  }
2611
2670
  /** The datepicker that this input is associated with. */
2612
2671
  set matDatepicker(datepicker) {
2613
2672
  if (datepicker) {
2614
2673
  this._datepicker = datepicker;
2615
- this._registerModel(datepicker._registerInput(this));
2674
+ this._closedSubscription = datepicker.closedStream.subscribe(() => this._onTouched());
2675
+ this._registerModel(datepicker.registerInput(this));
2616
2676
  }
2617
2677
  }
2618
2678
  /** The minimum valid date. */
@@ -2657,6 +2717,10 @@ class MatDatepickerInput extends MatDatepickerInputBase {
2657
2717
  getStartValue() {
2658
2718
  return this.value;
2659
2719
  }
2720
+ ngOnDestroy() {
2721
+ super.ngOnDestroy();
2722
+ this._closedSubscription.unsubscribe();
2723
+ }
2660
2724
  /** Opens the associated datepicker. */
2661
2725
  _openPopup() {
2662
2726
  if (this._datepicker) {
@@ -2683,8 +2747,8 @@ class MatDatepickerInput extends MatDatepickerInputBase {
2683
2747
  _getDateFilter() {
2684
2748
  return this._dateFilter;
2685
2749
  }
2686
- _canEmitChangeEvent() {
2687
- return true;
2750
+ _shouldHandleChangeEvent(event) {
2751
+ return event.source !== this;
2688
2752
  }
2689
2753
  }
2690
2754
  MatDatepickerInput.decorators = [
@@ -2777,9 +2841,9 @@ class MatDatepickerToggle {
2777
2841
  }
2778
2842
  }
2779
2843
  _watchStateChanges() {
2780
- const datepickerStateChanged = this.datepicker ? this.datepicker._stateChanges : of();
2781
- const inputStateChanged = this.datepicker && this.datepicker._datepickerInput ?
2782
- this.datepicker._datepickerInput.stateChanges : of();
2844
+ const datepickerStateChanged = this.datepicker ? this.datepicker.stateChanges : of();
2845
+ const inputStateChanged = this.datepicker && this.datepicker.datepickerInput ?
2846
+ this.datepicker.datepickerInput.stateChanges : of();
2783
2847
  const datepickerToggled = this.datepicker ?
2784
2848
  merge(this.datepicker.openedStream, this.datepicker.closedStream) :
2785
2849
  of();
@@ -2790,18 +2854,15 @@ class MatDatepickerToggle {
2790
2854
  MatDatepickerToggle.decorators = [
2791
2855
  { type: Component, args: [{
2792
2856
  selector: 'mat-datepicker-toggle',
2793
- template: "<button\n #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datepicker ? '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 <svg\n *ngIf=\"!_customIcon\"\n class=\"mat-datepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\"/>\n </svg>\n\n <ng-content select=\"[matDatepickerToggleIcon]\"></ng-content>\n</button>\n",
2857
+ template: "<button\n #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datepicker ? 'dialog' : null\"\n [attr.aria-label]=\"ariaLabel || _intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n (click)=\"_open($event)\">\n\n <svg\n *ngIf=\"!_customIcon\"\n class=\"mat-datepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\"/>\n </svg>\n\n <ng-content select=\"[matDatepickerToggleIcon]\"></ng-content>\n</button>\n",
2794
2858
  host: {
2795
2859
  'class': 'mat-datepicker-toggle',
2796
- // Always set the tabindex to -1 so that it doesn't overlap with any custom tabindex the
2797
- // consumer may have provided, while still being able to receive focus.
2798
- '[attr.tabindex]': 'disabled ? null : -1',
2860
+ '[attr.tabindex]': 'null',
2799
2861
  '[class.mat-datepicker-toggle-active]': 'datepicker && datepicker.opened',
2800
2862
  '[class.mat-accent]': 'datepicker && datepicker.color === "accent"',
2801
2863
  '[class.mat-warn]': 'datepicker && datepicker.color === "warn"',
2802
2864
  // Used by the test harness to tie this toggle to its datepicker.
2803
2865
  '[attr.data-mat-calendar]': 'datepicker ? datepicker.id : null',
2804
- '(focus)': '_button.focus()',
2805
2866
  },
2806
2867
  exportAs: 'matDatepickerToggle',
2807
2868
  encapsulation: ViewEncapsulation.None,
@@ -2817,6 +2878,7 @@ MatDatepickerToggle.ctorParameters = () => [
2817
2878
  MatDatepickerToggle.propDecorators = {
2818
2879
  datepicker: [{ type: Input, args: ['for',] }],
2819
2880
  tabIndex: [{ type: Input }],
2881
+ ariaLabel: [{ type: Input, args: ['aria-label',] }],
2820
2882
  disabled: [{ type: Input }],
2821
2883
  disableRipple: [{ type: Input }],
2822
2884
  _customIcon: [{ type: ContentChild, args: [MatDatepickerToggleIcon,] }],
@@ -2846,11 +2908,6 @@ class MatDateRangeInputPartBase extends MatDatepickerInputBase {
2846
2908
  this._injector = _injector;
2847
2909
  this._parentForm = _parentForm;
2848
2910
  this._parentFormGroup = _parentFormGroup;
2849
- this._outsideValueChanged = () => {
2850
- // Whenever the value changes outside the input we need to revalidate, because
2851
- // the validation state of each of the inputs depends on the other one.
2852
- this._validatorOnChange();
2853
- };
2854
2911
  }
2855
2912
  ngOnInit() {
2856
2913
  // We need the date input to provide itself as a `ControlValueAccessor` and a `Validator`, while
@@ -2908,6 +2965,15 @@ class MatDateRangeInputPartBase extends MatDatepickerInputBase {
2908
2965
  _parentDisabled() {
2909
2966
  return this._rangeInput._groupDisabled;
2910
2967
  }
2968
+ _shouldHandleChangeEvent({ source }) {
2969
+ return source !== this._rangeInput._startInput && source !== this._rangeInput._endInput;
2970
+ }
2971
+ _assignValueProgrammatically(value) {
2972
+ super._assignValueProgrammatically(value);
2973
+ const opposite = (this === this._rangeInput._startInput ? this._rangeInput._endInput :
2974
+ this._rangeInput._startInput);
2975
+ opposite === null || opposite === void 0 ? void 0 : opposite._validatorOnChange();
2976
+ }
2911
2977
  }
2912
2978
  MatDateRangeInputPartBase.decorators = [
2913
2979
  { type: Directive }
@@ -2941,9 +3007,6 @@ class MatStartDate extends _MatDateRangeInputBase {
2941
3007
  null : { 'matStartDateInvalid': { 'end': end, 'actual': start } };
2942
3008
  };
2943
3009
  this._validator = Validators.compose([...super._getValidators(), this._startValidator]);
2944
- this._canEmitChangeEvent = (event) => {
2945
- return event.source !== this._rangeInput._endInput;
2946
- };
2947
3010
  }
2948
3011
  ngOnInit() {
2949
3012
  // Normally this happens automatically, but it seems to break if not added explicitly when all
@@ -2970,7 +3033,6 @@ class MatStartDate extends _MatDateRangeInputBase {
2970
3033
  if (this._model) {
2971
3034
  const range = new DateRange(value, this._model.selection.end);
2972
3035
  this._model.updateSelection(range, this);
2973
- this._cvaOnChange(value);
2974
3036
  }
2975
3037
  }
2976
3038
  _formatValue(value) {
@@ -3038,9 +3100,6 @@ class MatEndDate extends _MatDateRangeInputBase {
3038
3100
  null : { 'matEndDateInvalid': { 'start': start, 'actual': end } };
3039
3101
  };
3040
3102
  this._validator = Validators.compose([...super._getValidators(), this._endValidator]);
3041
- this._canEmitChangeEvent = (event) => {
3042
- return event.source !== this._rangeInput._startInput;
3043
- };
3044
3103
  }
3045
3104
  ngOnInit() {
3046
3105
  // Normally this happens automatically, but it seems to break if not added explicitly when all
@@ -3067,7 +3126,6 @@ class MatEndDate extends _MatDateRangeInputBase {
3067
3126
  if (this._model) {
3068
3127
  const range = new DateRange(this._model.selection.start, value);
3069
3128
  this._model.updateSelection(range, this);
3070
- this._cvaOnChange(value);
3071
3129
  }
3072
3130
  }
3073
3131
  _onKeydown(event) {
@@ -3115,41 +3173,6 @@ MatEndDate.ctorParameters = () => [
3115
3173
  { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DATE_FORMATS,] }] }
3116
3174
  ];
3117
3175
 
3118
- /**
3119
- * @license
3120
- * Copyright Google LLC All Rights Reserved.
3121
- *
3122
- * Use of this source code is governed by an MIT-style license that can be
3123
- * found in the LICENSE file at https://angular.io/license
3124
- */
3125
- // TODO(mmalerba): We use a component instead of a directive here so the user can use implicit
3126
- // template reference variables (e.g. #d vs #d="matDateRangePicker"). We can change this to a
3127
- // directive if angular adds support for `exportAs: '$implicit'` on directives.
3128
- /** Component responsible for managing the date range picker popup/dialog. */
3129
- class MatDateRangePicker extends MatDatepickerBase {
3130
- _forwardContentValues(instance) {
3131
- super._forwardContentValues(instance);
3132
- const input = this._datepickerInput;
3133
- if (input) {
3134
- instance.comparisonStart = input.comparisonStart;
3135
- instance.comparisonEnd = input.comparisonEnd;
3136
- }
3137
- }
3138
- }
3139
- MatDateRangePicker.decorators = [
3140
- { type: Component, args: [{
3141
- selector: 'mat-date-range-picker',
3142
- template: '',
3143
- exportAs: 'matDateRangePicker',
3144
- changeDetection: ChangeDetectionStrategy.OnPush,
3145
- encapsulation: ViewEncapsulation.None,
3146
- providers: [
3147
- MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER,
3148
- MAT_CALENDAR_RANGE_STRATEGY_PROVIDER,
3149
- ]
3150
- },] }
3151
- ];
3152
-
3153
3176
  /**
3154
3177
  * @license
3155
3178
  * Copyright Google LLC All Rights Reserved.
@@ -3164,6 +3187,7 @@ class MatDateRangeInput {
3164
3187
  this._elementRef = _elementRef;
3165
3188
  this._dateAdapter = _dateAdapter;
3166
3189
  this._formField = _formField;
3190
+ this._closedSubscription = Subscription.EMPTY;
3167
3191
  /** Unique ID for the input. */
3168
3192
  this.id = `mat-date-range-input-${nextUniqueId++}`;
3169
3193
  /** Whether the control is focused. */
@@ -3210,8 +3234,14 @@ class MatDateRangeInput {
3210
3234
  get rangePicker() { return this._rangePicker; }
3211
3235
  set rangePicker(rangePicker) {
3212
3236
  if (rangePicker) {
3213
- this._model = rangePicker._registerInput(this);
3237
+ this._model = rangePicker.registerInput(this);
3214
3238
  this._rangePicker = rangePicker;
3239
+ this._closedSubscription.unsubscribe();
3240
+ this._closedSubscription = rangePicker.closedStream.subscribe(() => {
3241
+ var _a, _b;
3242
+ (_a = this._startInput) === null || _a === void 0 ? void 0 : _a._onTouched();
3243
+ (_b = this._endInput) === null || _b === void 0 ? void 0 : _b._onTouched();
3244
+ });
3215
3245
  this._registerModel(this._model);
3216
3246
  }
3217
3247
  }
@@ -3324,6 +3354,7 @@ class MatDateRangeInput {
3324
3354
  }
3325
3355
  }
3326
3356
  ngOnDestroy() {
3357
+ this._closedSubscription.unsubscribe();
3327
3358
  this.stateChanges.complete();
3328
3359
  }
3329
3360
  /** Gets the date at which the calendar should start. */
@@ -3432,6 +3463,128 @@ MatDateRangeInput.propDecorators = {
3432
3463
  _endInput: [{ type: ContentChild, args: [MatEndDate,] }]
3433
3464
  };
3434
3465
 
3466
+ /**
3467
+ * @license
3468
+ * Copyright Google LLC All Rights Reserved.
3469
+ *
3470
+ * Use of this source code is governed by an MIT-style license that can be
3471
+ * found in the LICENSE file at https://angular.io/license
3472
+ */
3473
+ // TODO(mmalerba): We use a component instead of a directive here so the user can use implicit
3474
+ // template reference variables (e.g. #d vs #d="matDateRangePicker"). We can change this to a
3475
+ // directive if angular adds support for `exportAs: '$implicit'` on directives.
3476
+ /** Component responsible for managing the date range picker popup/dialog. */
3477
+ class MatDateRangePicker extends MatDatepickerBase {
3478
+ _forwardContentValues(instance) {
3479
+ super._forwardContentValues(instance);
3480
+ const input = this.datepickerInput;
3481
+ if (input) {
3482
+ instance.comparisonStart = input.comparisonStart;
3483
+ instance.comparisonEnd = input.comparisonEnd;
3484
+ }
3485
+ }
3486
+ }
3487
+ MatDateRangePicker.decorators = [
3488
+ { type: Component, args: [{
3489
+ selector: 'mat-date-range-picker',
3490
+ template: '',
3491
+ exportAs: 'matDateRangePicker',
3492
+ changeDetection: ChangeDetectionStrategy.OnPush,
3493
+ encapsulation: ViewEncapsulation.None,
3494
+ providers: [
3495
+ MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER,
3496
+ MAT_CALENDAR_RANGE_STRATEGY_PROVIDER,
3497
+ { provide: MatDatepickerBase, useExisting: MatDateRangePicker },
3498
+ ]
3499
+ },] }
3500
+ ];
3501
+
3502
+ /**
3503
+ * @license
3504
+ * Copyright Google LLC All Rights Reserved.
3505
+ *
3506
+ * Use of this source code is governed by an MIT-style license that can be
3507
+ * found in the LICENSE file at https://angular.io/license
3508
+ */
3509
+ /** Button that will close the datepicker and assign the current selection to the data model. */
3510
+ class MatDatepickerApply {
3511
+ constructor(_datepicker) {
3512
+ this._datepicker = _datepicker;
3513
+ }
3514
+ _applySelection() {
3515
+ this._datepicker._applyPendingSelection();
3516
+ this._datepicker.close();
3517
+ }
3518
+ }
3519
+ MatDatepickerApply.decorators = [
3520
+ { type: Directive, args: [{
3521
+ selector: '[matDatepickerApply], [matDateRangePickerApply]',
3522
+ host: { '(click)': '_applySelection()' }
3523
+ },] }
3524
+ ];
3525
+ MatDatepickerApply.ctorParameters = () => [
3526
+ { type: MatDatepickerBase }
3527
+ ];
3528
+ /** Button that will close the datepicker and discard the current selection. */
3529
+ class MatDatepickerCancel {
3530
+ constructor(_datepicker) {
3531
+ this._datepicker = _datepicker;
3532
+ }
3533
+ }
3534
+ MatDatepickerCancel.decorators = [
3535
+ { type: Directive, args: [{
3536
+ selector: '[matDatepickerCancel], [matDateRangePickerCancel]',
3537
+ host: { '(click)': '_datepicker.close()' }
3538
+ },] }
3539
+ ];
3540
+ MatDatepickerCancel.ctorParameters = () => [
3541
+ { type: MatDatepickerBase }
3542
+ ];
3543
+ /**
3544
+ * Container that can be used to project a row of action buttons
3545
+ * to the bottom of a datepicker or date range picker.
3546
+ */
3547
+ class MatDatepickerActions {
3548
+ constructor(_datepicker, _viewContainerRef) {
3549
+ this._datepicker = _datepicker;
3550
+ this._viewContainerRef = _viewContainerRef;
3551
+ }
3552
+ ngAfterViewInit() {
3553
+ this._portal = new TemplatePortal(this._template, this._viewContainerRef);
3554
+ this._datepicker.registerActions(this._portal);
3555
+ }
3556
+ ngOnDestroy() {
3557
+ var _a;
3558
+ this._datepicker.removeActions(this._portal);
3559
+ // Needs to be null checked since we initialize it in `ngAfterViewInit`.
3560
+ if (this._portal && this._portal.isAttached) {
3561
+ (_a = this._portal) === null || _a === void 0 ? void 0 : _a.detach();
3562
+ }
3563
+ }
3564
+ }
3565
+ MatDatepickerActions.decorators = [
3566
+ { type: Component, args: [{
3567
+ selector: 'mat-datepicker-actions, mat-date-range-picker-actions',
3568
+ template: `
3569
+ <ng-template>
3570
+ <div class="mat-datepicker-actions">
3571
+ <ng-content></ng-content>
3572
+ </div>
3573
+ </ng-template>
3574
+ `,
3575
+ changeDetection: ChangeDetectionStrategy.OnPush,
3576
+ encapsulation: ViewEncapsulation.None,
3577
+ styles: [".mat-datepicker-actions{display:flex;justify-content:flex-end;align-items:center;padding:0 8px 8px 8px}.mat-datepicker-actions .mat-button-base+.mat-button-base{margin-left:8px}[dir=rtl] .mat-datepicker-actions .mat-button-base+.mat-button-base{margin-left:0;margin-right:8px}\n"]
3578
+ },] }
3579
+ ];
3580
+ MatDatepickerActions.ctorParameters = () => [
3581
+ { type: MatDatepickerBase },
3582
+ { type: ViewContainerRef }
3583
+ ];
3584
+ MatDatepickerActions.propDecorators = {
3585
+ _template: [{ type: ViewChild, args: [TemplateRef,] }]
3586
+ };
3587
+
3435
3588
  /**
3436
3589
  * @license
3437
3590
  * Copyright Google LLC All Rights Reserved.
@@ -3469,6 +3622,9 @@ MatDatepickerModule.decorators = [
3469
3622
  MatStartDate,
3470
3623
  MatEndDate,
3471
3624
  MatDateRangePicker,
3625
+ MatDatepickerActions,
3626
+ MatDatepickerCancel,
3627
+ MatDatepickerApply
3472
3628
  ],
3473
3629
  declarations: [
3474
3630
  MatCalendar,
@@ -3486,6 +3642,9 @@ MatDatepickerModule.decorators = [
3486
3642
  MatStartDate,
3487
3643
  MatEndDate,
3488
3644
  MatDateRangePicker,
3645
+ MatDatepickerActions,
3646
+ MatDatepickerCancel,
3647
+ MatDatepickerApply
3489
3648
  ],
3490
3649
  providers: [
3491
3650
  MatDatepickerIntl,
@@ -3510,5 +3669,5 @@ MatDatepickerModule.decorators = [
3510
3669
  * Generated bundle index. Do not edit.
3511
3670
  */
3512
3671
 
3513
- export { DateRange, DefaultMatCalendarRangeStrategy, MAT_DATEPICKER_SCROLL_STRATEGY, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER, MAT_DATEPICKER_VALIDATORS, MAT_DATEPICKER_VALUE_ACCESSOR, MAT_DATE_RANGE_SELECTION_STRATEGY, MAT_RANGE_DATE_SELECTION_MODEL_FACTORY, MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER, MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY, MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER, MatCalendar, MatCalendarBody, MatCalendarCell, MatCalendarHeader, MatDateRangeInput, MatDateRangePicker, MatDateSelectionModel, MatDatepicker, MatDatepickerContent, MatDatepickerInput, MatDatepickerInputEvent, MatDatepickerIntl, MatDatepickerModule, MatDatepickerToggle, MatDatepickerToggleIcon, MatEndDate, MatMonthView, MatMultiYearView, MatRangeDateSelectionModel, MatSingleDateSelectionModel, MatStartDate, MatYearView, matDatepickerAnimations, yearsPerPage, yearsPerRow, MAT_CALENDAR_RANGE_STRATEGY_PROVIDER_FACTORY as ɵangular_material_src_material_datepicker_datepicker_a, MAT_CALENDAR_RANGE_STRATEGY_PROVIDER as ɵangular_material_src_material_datepicker_datepicker_b, MatDatepickerBase as ɵangular_material_src_material_datepicker_datepicker_c, MatDatepickerInputBase as ɵangular_material_src_material_datepicker_datepicker_d, MAT_DATE_RANGE_INPUT_PARENT as ɵangular_material_src_material_datepicker_datepicker_e };
3672
+ export { DateRange, DefaultMatCalendarRangeStrategy, MAT_DATEPICKER_SCROLL_STRATEGY, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER, MAT_DATEPICKER_VALIDATORS, MAT_DATEPICKER_VALUE_ACCESSOR, MAT_DATE_RANGE_SELECTION_STRATEGY, MAT_RANGE_DATE_SELECTION_MODEL_FACTORY, MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER, MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY, MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER, MatCalendar, MatCalendarBody, MatCalendarCell, MatCalendarHeader, MatDateRangeInput, MatDateRangePicker, MatDateSelectionModel, MatDatepicker, MatDatepickerActions, MatDatepickerApply, MatDatepickerCancel, MatDatepickerContent, MatDatepickerInput, MatDatepickerInputEvent, MatDatepickerIntl, MatDatepickerModule, MatDatepickerToggle, MatDatepickerToggleIcon, MatEndDate, MatMonthView, MatMultiYearView, MatRangeDateSelectionModel, MatSingleDateSelectionModel, MatStartDate, MatYearView, matDatepickerAnimations, yearsPerPage, yearsPerRow, MAT_CALENDAR_RANGE_STRATEGY_PROVIDER_FACTORY as ɵangular_material_src_material_datepicker_datepicker_a, MAT_CALENDAR_RANGE_STRATEGY_PROVIDER as ɵangular_material_src_material_datepicker_datepicker_b, MatDatepickerBase as ɵangular_material_src_material_datepicker_datepicker_c, MatDatepickerInputBase as ɵangular_material_src_material_datepicker_datepicker_d, MAT_DATE_RANGE_INPUT_PARENT as ɵangular_material_src_material_datepicker_datepicker_e };
3514
3673
  //# sourceMappingURL=datepicker.js.map