@angular/material 10.0.0-rc.3 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (627) hide show
  1. package/_theming.scss +17 -17
  2. package/autocomplete/index.metadata.json +1 -1
  3. package/autocomplete/testing/autocomplete-harness.d.ts +2 -0
  4. package/bundles/material-autocomplete-testing.umd.js +11 -0
  5. package/bundles/material-autocomplete-testing.umd.js.map +1 -1
  6. package/bundles/material-autocomplete-testing.umd.min.js +2 -2
  7. package/bundles/material-autocomplete-testing.umd.min.js.map +1 -1
  8. package/bundles/material-autocomplete.umd.js +3 -1
  9. package/bundles/material-autocomplete.umd.js.map +1 -1
  10. package/bundles/material-autocomplete.umd.min.js +5 -5
  11. package/bundles/material-autocomplete.umd.min.js.map +1 -1
  12. package/bundles/material-badge-testing.umd.min.js +1 -1
  13. package/bundles/material-badge-testing.umd.min.js.map +1 -1
  14. package/bundles/material-bottom-sheet-testing.umd.min.js +1 -1
  15. package/bundles/material-bottom-sheet-testing.umd.min.js.map +1 -1
  16. package/bundles/material-button-testing.umd.js +11 -0
  17. package/bundles/material-button-testing.umd.js.map +1 -1
  18. package/bundles/material-button-testing.umd.min.js +2 -2
  19. package/bundles/material-button-testing.umd.min.js.map +1 -1
  20. package/bundles/material-button-toggle-testing.umd.js +11 -0
  21. package/bundles/material-button-toggle-testing.umd.js.map +1 -1
  22. package/bundles/material-button-toggle-testing.umd.min.js +3 -3
  23. package/bundles/material-button-toggle-testing.umd.min.js.map +1 -1
  24. package/bundles/material-button-toggle.umd.js +12 -3
  25. package/bundles/material-button-toggle.umd.js.map +1 -1
  26. package/bundles/material-button-toggle.umd.min.js +2 -2
  27. package/bundles/material-button-toggle.umd.min.js.map +1 -1
  28. package/bundles/material-button.umd.js +7 -2
  29. package/bundles/material-button.umd.js.map +1 -1
  30. package/bundles/material-button.umd.min.js +4 -4
  31. package/bundles/material-button.umd.min.js.map +1 -1
  32. package/bundles/material-card-testing.umd.js +335 -0
  33. package/bundles/material-card-testing.umd.js.map +1 -0
  34. package/bundles/material-card-testing.umd.min.js +44 -0
  35. package/bundles/material-card-testing.umd.min.js.map +1 -0
  36. package/bundles/material-checkbox-testing.umd.js +11 -0
  37. package/bundles/material-checkbox-testing.umd.js.map +1 -1
  38. package/bundles/material-checkbox-testing.umd.min.js +3 -3
  39. package/bundles/material-checkbox-testing.umd.min.js.map +1 -1
  40. package/bundles/material-checkbox.umd.js.map +1 -1
  41. package/bundles/material-chips.umd.js +36 -12
  42. package/bundles/material-chips.umd.js.map +1 -1
  43. package/bundles/material-chips.umd.min.js +4 -4
  44. package/bundles/material-chips.umd.min.js.map +1 -1
  45. package/bundles/material-core-testing.umd.min.js +1 -1
  46. package/bundles/material-core-testing.umd.min.js.map +1 -1
  47. package/bundles/material-core.umd.js +11 -3
  48. package/bundles/material-core.umd.js.map +1 -1
  49. package/bundles/material-core.umd.min.js +11 -11
  50. package/bundles/material-core.umd.min.js.map +1 -1
  51. package/bundles/material-datepicker.umd.js +20 -11
  52. package/bundles/material-datepicker.umd.js.map +1 -1
  53. package/bundles/material-datepicker.umd.min.js +5 -5
  54. package/bundles/material-datepicker.umd.min.js.map +1 -1
  55. package/bundles/material-dialog-testing.umd.min.js +1 -1
  56. package/bundles/material-dialog-testing.umd.min.js.map +1 -1
  57. package/bundles/material-dialog.umd.js +45 -8
  58. package/bundles/material-dialog.umd.js.map +1 -1
  59. package/bundles/material-dialog.umd.min.js +14 -7
  60. package/bundles/material-dialog.umd.min.js.map +1 -1
  61. package/bundles/material-divider-testing.umd.min.js +1 -1
  62. package/bundles/material-divider-testing.umd.min.js.map +1 -1
  63. package/bundles/material-expansion-testing.umd.js +11 -0
  64. package/bundles/material-expansion-testing.umd.js.map +1 -1
  65. package/bundles/material-expansion-testing.umd.min.js +3 -3
  66. package/bundles/material-expansion-testing.umd.min.js.map +1 -1
  67. package/bundles/material-form-field-testing.umd.js +32 -0
  68. package/bundles/material-form-field-testing.umd.js.map +1 -1
  69. package/bundles/material-form-field-testing.umd.min.js +4 -4
  70. package/bundles/material-form-field-testing.umd.min.js.map +1 -1
  71. package/bundles/material-form-field.umd.js +47 -21
  72. package/bundles/material-form-field.umd.js.map +1 -1
  73. package/bundles/material-form-field.umd.min.js +5 -5
  74. package/bundles/material-form-field.umd.min.js.map +1 -1
  75. package/bundles/material-grid-list-testing.umd.min.js +1 -1
  76. package/bundles/material-grid-list-testing.umd.min.js.map +1 -1
  77. package/bundles/material-grid-list.umd.js +2 -2
  78. package/bundles/material-grid-list.umd.js.map +1 -1
  79. package/bundles/material-grid-list.umd.min.js +2 -2
  80. package/bundles/material-grid-list.umd.min.js.map +1 -1
  81. package/bundles/material-input-testing.umd.js +23 -6
  82. package/bundles/material-input-testing.umd.js.map +1 -1
  83. package/bundles/material-input-testing.umd.min.js +3 -3
  84. package/bundles/material-input-testing.umd.min.js.map +1 -1
  85. package/bundles/material-input.umd.js +28 -3
  86. package/bundles/material-input.umd.js.map +1 -1
  87. package/bundles/material-input.umd.min.js +3 -3
  88. package/bundles/material-input.umd.min.js.map +1 -1
  89. package/bundles/material-list-testing.umd.js +33 -0
  90. package/bundles/material-list-testing.umd.js.map +1 -1
  91. package/bundles/material-list-testing.umd.min.js +2 -2
  92. package/bundles/material-list-testing.umd.min.js.map +1 -1
  93. package/bundles/material-list.umd.js +3 -3
  94. package/bundles/material-list.umd.min.js +1 -1
  95. package/bundles/material-list.umd.min.js.map +1 -1
  96. package/bundles/material-menu-testing.umd.js +22 -0
  97. package/bundles/material-menu-testing.umd.js.map +1 -1
  98. package/bundles/material-menu-testing.umd.min.js +2 -2
  99. package/bundles/material-menu-testing.umd.min.js.map +1 -1
  100. package/bundles/material-menu.umd.js +13 -2
  101. package/bundles/material-menu.umd.js.map +1 -1
  102. package/bundles/material-menu.umd.min.js +4 -4
  103. package/bundles/material-menu.umd.min.js.map +1 -1
  104. package/bundles/material-paginator-testing.umd.min.js +1 -1
  105. package/bundles/material-paginator-testing.umd.min.js.map +1 -1
  106. package/bundles/material-progress-bar-testing.umd.min.js +1 -1
  107. package/bundles/material-progress-bar-testing.umd.min.js.map +1 -1
  108. package/bundles/material-progress-spinner-testing.umd.js +1 -1
  109. package/bundles/material-progress-spinner-testing.umd.js.map +1 -1
  110. package/bundles/material-progress-spinner-testing.umd.min.js +2 -2
  111. package/bundles/material-progress-spinner-testing.umd.min.js.map +1 -1
  112. package/bundles/material-progress-spinner.umd.js +2 -2
  113. package/bundles/material-progress-spinner.umd.min.js +3 -3
  114. package/bundles/material-progress-spinner.umd.min.js.map +1 -1
  115. package/bundles/material-radio-testing.umd.js +11 -0
  116. package/bundles/material-radio-testing.umd.js.map +1 -1
  117. package/bundles/material-radio-testing.umd.min.js +3 -3
  118. package/bundles/material-radio-testing.umd.min.js.map +1 -1
  119. package/bundles/material-radio.umd.js +15 -5
  120. package/bundles/material-radio.umd.js.map +1 -1
  121. package/bundles/material-radio.umd.min.js +2 -2
  122. package/bundles/material-radio.umd.min.js.map +1 -1
  123. package/bundles/material-select-testing.umd.js +11 -0
  124. package/bundles/material-select-testing.umd.js.map +1 -1
  125. package/bundles/material-select-testing.umd.min.js +2 -2
  126. package/bundles/material-select-testing.umd.min.js.map +1 -1
  127. package/bundles/material-select.umd.js +11 -3
  128. package/bundles/material-select.umd.js.map +1 -1
  129. package/bundles/material-select.umd.min.js +4 -4
  130. package/bundles/material-select.umd.min.js.map +1 -1
  131. package/bundles/material-sidenav-testing.umd.min.js +1 -1
  132. package/bundles/material-sidenav-testing.umd.min.js.map +1 -1
  133. package/bundles/material-sidenav.umd.js +41 -17
  134. package/bundles/material-sidenav.umd.js.map +1 -1
  135. package/bundles/material-sidenav.umd.min.js +2 -2
  136. package/bundles/material-sidenav.umd.min.js.map +1 -1
  137. package/bundles/material-slide-toggle-testing.umd.js +11 -0
  138. package/bundles/material-slide-toggle-testing.umd.js.map +1 -1
  139. package/bundles/material-slide-toggle-testing.umd.min.js +2 -2
  140. package/bundles/material-slide-toggle-testing.umd.min.js.map +1 -1
  141. package/bundles/material-slide-toggle.umd.js.map +1 -1
  142. package/bundles/material-slider-testing.umd.js +11 -0
  143. package/bundles/material-slider-testing.umd.js.map +1 -1
  144. package/bundles/material-slider-testing.umd.min.js +2 -2
  145. package/bundles/material-slider-testing.umd.min.js.map +1 -1
  146. package/bundles/material-snack-bar-testing.umd.min.js +1 -1
  147. package/bundles/material-snack-bar-testing.umd.min.js.map +1 -1
  148. package/bundles/material-snack-bar.umd.js +47 -39
  149. package/bundles/material-snack-bar.umd.js.map +1 -1
  150. package/bundles/material-snack-bar.umd.min.js +2 -2
  151. package/bundles/material-snack-bar.umd.min.js.map +1 -1
  152. package/bundles/material-sort-testing.umd.js +10 -10
  153. package/bundles/material-sort-testing.umd.js.map +1 -1
  154. package/bundles/material-sort-testing.umd.min.js +3 -3
  155. package/bundles/material-sort-testing.umd.min.js.map +1 -1
  156. package/bundles/material-sort.umd.js +25 -12
  157. package/bundles/material-sort.umd.js.map +1 -1
  158. package/bundles/material-sort.umd.min.js +5 -5
  159. package/bundles/material-sort.umd.min.js.map +1 -1
  160. package/bundles/material-table-testing.umd.min.js +1 -1
  161. package/bundles/material-table-testing.umd.min.js.map +1 -1
  162. package/bundles/material-table.umd.min.js +2 -2
  163. package/bundles/material-table.umd.min.js.map +1 -1
  164. package/bundles/material-tabs-testing.umd.min.js +1 -1
  165. package/bundles/material-tabs-testing.umd.min.js.map +1 -1
  166. package/bundles/material-tabs.umd.js +23 -4
  167. package/bundles/material-tabs.umd.js.map +1 -1
  168. package/bundles/material-tabs.umd.min.js +5 -12
  169. package/bundles/material-tabs.umd.min.js.map +1 -1
  170. package/bundles/material-toolbar-testing.umd.js +330 -0
  171. package/bundles/material-toolbar-testing.umd.js.map +1 -0
  172. package/bundles/material-toolbar-testing.umd.min.js +44 -0
  173. package/bundles/material-toolbar-testing.umd.min.js.map +1 -0
  174. package/bundles/material-tooltip-testing.umd.min.js +1 -1
  175. package/bundles/material-tooltip-testing.umd.min.js.map +1 -1
  176. package/bundles/material-tooltip.umd.js +14 -1
  177. package/bundles/material-tooltip.umd.js.map +1 -1
  178. package/bundles/material-tooltip.umd.min.js +3 -3
  179. package/bundles/material-tooltip.umd.min.js.map +1 -1
  180. package/bundles/material-tree.umd.js.map +1 -1
  181. package/button/_button-base.scss +1 -1
  182. package/button/_button-theme.scss +8 -8
  183. package/button/index.metadata.json +1 -1
  184. package/button/testing/button-harness.d.ts +2 -0
  185. package/button-toggle/button-toggle.d.ts +10 -3
  186. package/button-toggle/index.metadata.json +1 -1
  187. package/button-toggle/testing/button-toggle-harness.d.ts +2 -0
  188. package/card/testing/card-harness-filters.d.ts +17 -0
  189. package/card/testing/card-harness.d.ts +36 -0
  190. package/card/testing/index.d.ts +8 -0
  191. package/card/testing/package.json +9 -0
  192. package/card/testing/public-api.d.ts +9 -0
  193. package/checkbox/index.metadata.json +1 -1
  194. package/checkbox/testing/checkbox-harness.d.ts +2 -0
  195. package/chips/chip.d.ts +19 -1
  196. package/chips/index.metadata.json +1 -1
  197. package/core/focus-indicators/_focus-indicators.scss +6 -6
  198. package/core/index.metadata.json +1 -1
  199. package/core/option/optgroup.d.ts +7 -0
  200. package/core/ripple/ripple-ref.d.ts +21 -2
  201. package/core/ripple/ripple-renderer.d.ts +1 -19
  202. package/core/ripple/ripple.d.ts +2 -2
  203. package/core/style/_list-common.scss +1 -1
  204. package/datepicker/date-range-input-parts.d.ts +2 -4
  205. package/datepicker/date-range-input.d.ts +4 -4
  206. package/datepicker/date-range-picker.d.ts +10 -3
  207. package/datepicker/datepicker.d.ts +2 -3
  208. package/datepicker/index.metadata.json +1 -1
  209. package/datepicker/public-api.d.ts +1 -1
  210. package/dialog/dialog-container.d.ts +9 -2
  211. package/dialog/dialog-content-directives.d.ts +1 -0
  212. package/dialog/dialog-ref.d.ts +7 -0
  213. package/dialog/index.metadata.json +1 -1
  214. package/esm2015/autocomplete/autocomplete-module.js +18 -22
  215. package/esm2015/autocomplete/autocomplete-origin.js +16 -20
  216. package/esm2015/autocomplete/autocomplete-trigger.js +519 -521
  217. package/esm2015/autocomplete/autocomplete.js +126 -130
  218. package/esm2015/autocomplete/testing/autocomplete-harness.js +99 -97
  219. package/esm2015/badge/badge-module.js +13 -17
  220. package/esm2015/badge/badge.js +184 -188
  221. package/esm2015/badge/testing/badge-harness.js +74 -78
  222. package/esm2015/bottom-sheet/bottom-sheet-container.js +161 -165
  223. package/esm2015/bottom-sheet/bottom-sheet-module.js +15 -19
  224. package/esm2015/bottom-sheet/bottom-sheet.js +124 -128
  225. package/esm2015/bottom-sheet/testing/bottom-sheet-harness.js +29 -33
  226. package/esm2015/button/button-module.js +20 -24
  227. package/esm2015/button/button.js +111 -114
  228. package/esm2015/button/testing/button-harness.js +60 -58
  229. package/esm2015/button-toggle/button-toggle-module.js +10 -14
  230. package/esm2015/button-toggle/button-toggle.js +368 -368
  231. package/esm2015/button-toggle/testing/button-toggle-group-harness.js +42 -46
  232. package/esm2015/button-toggle/testing/button-toggle-harness.js +113 -111
  233. package/esm2015/card/card-module.js +30 -34
  234. package/esm2015/card/card.js +147 -203
  235. package/esm2015/card/testing/card-harness-filters.js +8 -0
  236. package/esm2015/card/testing/card-harness.js +52 -0
  237. package/esm2015/card/testing/index.js +9 -0
  238. package/esm2015/card/testing/public-api.js +10 -0
  239. package/esm2015/card/testing/testing.externs.js +0 -0
  240. package/esm2015/checkbox/checkbox-module.js +21 -29
  241. package/esm2015/checkbox/checkbox-required-validator.js +9 -13
  242. package/esm2015/checkbox/checkbox.js +315 -319
  243. package/esm2015/checkbox/testing/checkbox-harness.js +150 -148
  244. package/esm2015/chips/chip-input.js +119 -123
  245. package/esm2015/chips/chip-list.js +572 -576
  246. package/esm2015/chips/chip.js +333 -328
  247. package/esm2015/chips/chips-module.js +16 -20
  248. package/esm2015/core/animation/animation.js +12 -20
  249. package/esm2015/core/common-behaviors/common-module.js +91 -95
  250. package/esm2015/core/datetime/index.js +19 -27
  251. package/esm2015/core/datetime/native-date-adapter.js +202 -206
  252. package/esm2015/core/error/error-options.js +16 -24
  253. package/esm2015/core/line/line.js +18 -26
  254. package/esm2015/core/option/index.js +10 -14
  255. package/esm2015/core/option/optgroup.js +36 -33
  256. package/esm2015/core/option/option.js +181 -185
  257. package/esm2015/core/ripple/index.js +10 -14
  258. package/esm2015/core/ripple/ripple-ref.js +1 -1
  259. package/esm2015/core/ripple/ripple-renderer.js +1 -1
  260. package/esm2015/core/ripple/ripple.js +102 -106
  261. package/esm2015/core/selection/index.js +9 -13
  262. package/esm2015/core/selection/pseudo-checkbox/pseudo-checkbox.js +32 -36
  263. package/esm2015/core/testing/optgroup-harness.js +39 -43
  264. package/esm2015/core/testing/option-harness.js +51 -55
  265. package/esm2015/core/version.js +1 -1
  266. package/esm2015/datepicker/calendar-body.js +214 -218
  267. package/esm2015/datepicker/calendar.js +295 -303
  268. package/esm2015/datepicker/date-range-input-parts.js +214 -229
  269. package/esm2015/datepicker/date-range-input.js +244 -242
  270. package/esm2015/datepicker/date-range-picker.js +19 -23
  271. package/esm2015/datepicker/date-range-selection-strategy.js +31 -35
  272. package/esm2015/datepicker/date-selection-model.js +110 -122
  273. package/esm2015/datepicker/datepicker-base.js +418 -426
  274. package/esm2015/datepicker/datepicker-input-base.js +227 -224
  275. package/esm2015/datepicker/datepicker-input.js +111 -115
  276. package/esm2015/datepicker/datepicker-intl.js +37 -41
  277. package/esm2015/datepicker/datepicker-module.js +62 -66
  278. package/esm2015/datepicker/datepicker-toggle.js +81 -89
  279. package/esm2015/datepicker/datepicker.js +13 -17
  280. package/esm2015/datepicker/month-view.js +283 -287
  281. package/esm2015/datepicker/multi-year-view.js +198 -202
  282. package/esm2015/datepicker/public-api.js +2 -2
  283. package/esm2015/datepicker/year-view.js +220 -224
  284. package/esm2015/dialog/dialog-container.js +175 -164
  285. package/esm2015/dialog/dialog-content-directives.js +105 -114
  286. package/esm2015/dialog/dialog-module.js +32 -36
  287. package/esm2015/dialog/dialog-ref.js +17 -3
  288. package/esm2015/dialog/dialog.js +236 -240
  289. package/esm2015/dialog/testing/dialog-harness.js +58 -62
  290. package/esm2015/divider/divider-module.js +10 -14
  291. package/esm2015/divider/divider.js +33 -37
  292. package/esm2015/divider/testing/divider-harness.js +16 -20
  293. package/esm2015/expansion/accordion.js +73 -77
  294. package/esm2015/expansion/expansion-module.js +26 -30
  295. package/esm2015/expansion/expansion-panel-content.js +13 -17
  296. package/esm2015/expansion/expansion-panel-header.js +168 -180
  297. package/esm2015/expansion/expansion-panel.js +144 -152
  298. package/esm2015/expansion/testing/accordion-harness.js +24 -28
  299. package/esm2015/expansion/testing/expansion-harness.js +136 -134
  300. package/esm2015/form-field/error.js +26 -23
  301. package/esm2015/form-field/form-field-control.js +6 -10
  302. package/esm2015/form-field/form-field-module.js +31 -35
  303. package/esm2015/form-field/form-field.js +407 -409
  304. package/esm2015/form-field/hint.js +35 -29
  305. package/esm2015/form-field/label.js +8 -12
  306. package/esm2015/form-field/placeholder.js +8 -12
  307. package/esm2015/form-field/prefix.js +16 -13
  308. package/esm2015/form-field/suffix.js +16 -13
  309. package/esm2015/form-field/testing/form-field-harness.js +220 -206
  310. package/esm2015/grid-list/grid-list-module.js +26 -30
  311. package/esm2015/grid-list/grid-list.js +108 -112
  312. package/esm2015/grid-list/grid-tile.js +91 -111
  313. package/esm2015/grid-list/testing/grid-list-harness.js +62 -66
  314. package/esm2015/grid-list/testing/grid-tile-harness.js +69 -73
  315. package/esm2015/grid-list/tile-styler.js +1 -1
  316. package/esm2015/icon/icon-module.js +10 -14
  317. package/esm2015/icon/icon-registry.js +406 -410
  318. package/esm2015/icon/icon.js +228 -232
  319. package/esm2015/icon/testing/fake-icon-registry.js +66 -74
  320. package/esm2015/input/autosize.js +30 -34
  321. package/esm2015/input/input-module.js +21 -25
  322. package/esm2015/input/input.js +305 -284
  323. package/esm2015/input/testing/input-harness.js +129 -123
  324. package/esm2015/list/list-module.js +32 -36
  325. package/esm2015/list/list.js +165 -189
  326. package/esm2015/list/selection-list.js +503 -511
  327. package/esm2015/list/testing/action-list-harness.js +55 -57
  328. package/esm2015/list/testing/list-harness.js +31 -39
  329. package/esm2015/list/testing/list-item-harness-base.js +13 -17
  330. package/esm2015/list/testing/nav-list-harness.js +62 -64
  331. package/esm2015/list/testing/selection-list-harness.js +136 -138
  332. package/esm2015/menu/menu-content.js +74 -71
  333. package/esm2015/menu/menu-item.js +119 -123
  334. package/esm2015/menu/menu-module.js +29 -37
  335. package/esm2015/menu/menu-panel.js +1 -1
  336. package/esm2015/menu/menu-trigger.js +402 -405
  337. package/esm2015/menu/menu.js +329 -339
  338. package/esm2015/menu/testing/menu-harness.js +193 -189
  339. package/esm2015/paginator/paginator-intl.js +36 -40
  340. package/esm2015/paginator/paginator-module.js +16 -20
  341. package/esm2015/paginator/paginator.js +205 -209
  342. package/esm2015/paginator/testing/paginator-harness.js +91 -95
  343. package/esm2015/progress-bar/progress-bar-module.js +10 -14
  344. package/esm2015/progress-bar/progress-bar.js +114 -118
  345. package/esm2015/progress-bar/testing/progress-bar-harness.js +27 -31
  346. package/esm2015/progress-spinner/progress-spinner-module.js +17 -21
  347. package/esm2015/progress-spinner/progress-spinner.js +181 -189
  348. package/esm2015/progress-spinner/testing/progress-spinner-harness.js +28 -32
  349. package/esm2015/radio/radio-module.js +10 -14
  350. package/esm2015/radio/radio.js +437 -444
  351. package/esm2015/radio/testing/radio-harness.js +241 -243
  352. package/esm2015/select/select-module.js +23 -27
  353. package/esm2015/select/select.js +917 -918
  354. package/esm2015/select/testing/select-harness.js +138 -136
  355. package/esm2015/sidenav/drawer.js +632 -620
  356. package/esm2015/sidenav/sidenav-module.js +31 -35
  357. package/esm2015/sidenav/sidenav.js +104 -116
  358. package/esm2015/sidenav/testing/drawer-harness.js +40 -44
  359. package/esm2015/sidenav/testing/sidenav-harness.js +20 -24
  360. package/esm2015/slide-toggle/slide-toggle-module.js +27 -35
  361. package/esm2015/slide-toggle/slide-toggle-required-validator.js +9 -13
  362. package/esm2015/slide-toggle/slide-toggle.js +184 -188
  363. package/esm2015/slide-toggle/testing/slide-toggle-harness.js +123 -121
  364. package/esm2015/slider/slider-module.js +10 -14
  365. package/esm2015/slider/slider.js +640 -644
  366. package/esm2015/slider/testing/slider-harness.js +129 -127
  367. package/esm2015/snack-bar/simple-snack-bar.js +32 -36
  368. package/esm2015/snack-bar/snack-bar-container.js +144 -148
  369. package/esm2015/snack-bar/snack-bar-module.js +17 -21
  370. package/esm2015/snack-bar/snack-bar-ref.js +1 -1
  371. package/esm2015/snack-bar/snack-bar.js +208 -205
  372. package/esm2015/snack-bar/testing/snack-bar-harness.js +112 -116
  373. package/esm2015/sort/sort-header-intl.js +21 -21
  374. package/esm2015/sort/sort-header.js +200 -194
  375. package/esm2015/sort/sort-module.js +11 -15
  376. package/esm2015/sort/sort.js +92 -96
  377. package/esm2015/sort/testing/sort-harness.js +28 -32
  378. package/esm2015/sort/testing/sort-header-harness.js +66 -67
  379. package/esm2015/stepper/step-header.js +78 -82
  380. package/esm2015/stepper/step-label.js +8 -12
  381. package/esm2015/stepper/stepper-button.js +23 -31
  382. package/esm2015/stepper/stepper-icon.js +16 -20
  383. package/esm2015/stepper/stepper-intl.js +15 -19
  384. package/esm2015/stepper/stepper-module.js +40 -44
  385. package/esm2015/stepper/stepper.js +139 -155
  386. package/esm2015/table/cell.js +94 -122
  387. package/esm2015/table/row.js +90 -118
  388. package/esm2015/table/table-module.js +13 -17
  389. package/esm2015/table/table.js +26 -30
  390. package/esm2015/table/testing/cell-harness.js +56 -68
  391. package/esm2015/table/testing/row-harness.js +90 -102
  392. package/esm2015/table/testing/table-harness.js +65 -69
  393. package/esm2015/table/text-column.js +17 -21
  394. package/esm2015/tabs/index.js +4 -2
  395. package/esm2015/tabs/ink-bar.js +55 -59
  396. package/esm2015/tabs/paginated-tab-header.js +415 -419
  397. package/esm2015/tabs/tab-body.js +179 -191
  398. package/esm2015/tabs/tab-content.js +21 -16
  399. package/esm2015/tabs/tab-group.js +263 -271
  400. package/esm2015/tabs/tab-header.js +69 -77
  401. package/esm2015/tabs/tab-label-wrapper.js +29 -33
  402. package/esm2015/tabs/tab-label.js +16 -13
  403. package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +199 -215
  404. package/esm2015/tabs/tab.js +80 -83
  405. package/esm2015/tabs/tabs-module.js +38 -42
  406. package/esm2015/tabs/testing/tab-group-harness.js +52 -56
  407. package/esm2015/tabs/testing/tab-harness.js +78 -82
  408. package/esm2015/toolbar/testing/index.js +9 -0
  409. package/esm2015/toolbar/testing/public-api.js +10 -0
  410. package/esm2015/toolbar/testing/testing.externs.js +0 -0
  411. package/esm2015/toolbar/testing/toolbar-harness-filters.js +8 -0
  412. package/esm2015/toolbar/testing/toolbar-harness.js +47 -0
  413. package/esm2015/toolbar/toolbar-module.js +10 -14
  414. package/esm2015/toolbar/toolbar.js +61 -69
  415. package/esm2015/tooltip/testing/tooltip-harness.js +43 -47
  416. package/esm2015/tooltip/tooltip-module.js +17 -21
  417. package/esm2015/tooltip/tooltip.js +502 -497
  418. package/esm2015/tree/data-source/flat-data-source.js +1 -1
  419. package/esm2015/tree/node.js +99 -111
  420. package/esm2015/tree/outlet.js +19 -23
  421. package/esm2015/tree/padding.js +13 -17
  422. package/esm2015/tree/toggle.js +15 -19
  423. package/esm2015/tree/tree-module.js +10 -14
  424. package/esm2015/tree/tree.js +23 -27
  425. package/expansion/testing/expansion-harness.d.ts +2 -0
  426. package/fesm2015/autocomplete/testing.js +98 -95
  427. package/fesm2015/autocomplete/testing.js.map +1 -1
  428. package/fesm2015/autocomplete.js +677 -687
  429. package/fesm2015/autocomplete.js.map +1 -1
  430. package/fesm2015/badge/testing.js +73 -76
  431. package/fesm2015/badge/testing.js.map +1 -1
  432. package/fesm2015/badge.js +195 -201
  433. package/fesm2015/badge.js.map +1 -1
  434. package/fesm2015/bottom-sheet/testing.js +28 -31
  435. package/fesm2015/bottom-sheet/testing.js.map +1 -1
  436. package/fesm2015/bottom-sheet.js +297 -306
  437. package/fesm2015/bottom-sheet.js.map +1 -1
  438. package/fesm2015/button/testing.js +59 -56
  439. package/fesm2015/button/testing.js.map +1 -1
  440. package/fesm2015/button-toggle/testing.js +155 -155
  441. package/fesm2015/button-toggle/testing.js.map +1 -1
  442. package/fesm2015/button-toggle.js +377 -378
  443. package/fesm2015/button-toggle.js.map +1 -1
  444. package/fesm2015/button.js +129 -133
  445. package/fesm2015/button.js.map +1 -1
  446. package/fesm2015/card/testing.js +79 -0
  447. package/fesm2015/card/testing.js.map +1 -0
  448. package/fesm2015/card.js +175 -220
  449. package/fesm2015/card.js.map +1 -1
  450. package/fesm2015/checkbox/testing.js +149 -146
  451. package/fesm2015/checkbox/testing.js.map +1 -1
  452. package/fesm2015/checkbox.js +342 -354
  453. package/fesm2015/checkbox.js.map +1 -1
  454. package/fesm2015/chips.js +1039 -1039
  455. package/fesm2015/chips.js.map +1 -1
  456. package/fesm2015/core/testing.js +88 -94
  457. package/fesm2015/core/testing.js.map +1 -1
  458. package/fesm2015/core.js +729 -773
  459. package/fesm2015/core.js.map +1 -1
  460. package/fesm2015/datepicker.js +2821 -2884
  461. package/fesm2015/datepicker.js.map +1 -1
  462. package/fesm2015/dialog/testing.js +57 -60
  463. package/fesm2015/dialog/testing.js.map +1 -1
  464. package/fesm2015/dialog.js +564 -549
  465. package/fesm2015/dialog.js.map +1 -1
  466. package/fesm2015/divider/testing.js +15 -18
  467. package/fesm2015/divider/testing.js.map +1 -1
  468. package/fesm2015/divider.js +41 -47
  469. package/fesm2015/divider.js.map +1 -1
  470. package/fesm2015/expansion/testing.js +159 -159
  471. package/fesm2015/expansion/testing.js.map +1 -1
  472. package/fesm2015/expansion.js +422 -446
  473. package/fesm2015/expansion.js.map +1 -1
  474. package/fesm2015/form-field/testing.js +219 -204
  475. package/fesm2015/form-field/testing.js.map +1 -1
  476. package/fesm2015/form-field.js +538 -532
  477. package/fesm2015/form-field.js.map +1 -1
  478. package/fesm2015/grid-list/testing.js +129 -135
  479. package/fesm2015/grid-list/testing.js.map +1 -1
  480. package/fesm2015/grid-list.js +221 -242
  481. package/fesm2015/grid-list.js.map +1 -1
  482. package/fesm2015/icon/testing.js +65 -71
  483. package/fesm2015/icon/testing.js.map +1 -1
  484. package/fesm2015/icon.js +660 -669
  485. package/fesm2015/icon.js.map +1 -1
  486. package/fesm2015/input/testing.js +128 -121
  487. package/fesm2015/input/testing.js.map +1 -1
  488. package/fesm2015/input.js +353 -337
  489. package/fesm2015/input.js.map +1 -1
  490. package/fesm2015/list/testing.js +298 -307
  491. package/fesm2015/list/testing.js.map +1 -1
  492. package/fesm2015/list.js +698 -725
  493. package/fesm2015/list.js.map +1 -1
  494. package/fesm2015/menu/testing.js +192 -186
  495. package/fesm2015/menu/testing.js.map +1 -1
  496. package/fesm2015/menu.js +948 -962
  497. package/fesm2015/menu.js.map +1 -1
  498. package/fesm2015/paginator/testing.js +90 -93
  499. package/fesm2015/paginator/testing.js.map +1 -1
  500. package/fesm2015/paginator.js +247 -256
  501. package/fesm2015/paginator.js.map +1 -1
  502. package/fesm2015/progress-bar/testing.js +26 -29
  503. package/fesm2015/progress-bar/testing.js.map +1 -1
  504. package/fesm2015/progress-bar.js +122 -128
  505. package/fesm2015/progress-bar.js.map +1 -1
  506. package/fesm2015/progress-spinner/testing.js +27 -30
  507. package/fesm2015/progress-spinner/testing.js.map +1 -1
  508. package/fesm2015/progress-spinner.js +196 -205
  509. package/fesm2015/progress-spinner.js.map +1 -1
  510. package/fesm2015/radio/testing.js +240 -240
  511. package/fesm2015/radio/testing.js.map +1 -1
  512. package/fesm2015/radio.js +447 -453
  513. package/fesm2015/radio.js.map +1 -1
  514. package/fesm2015/select/testing.js +137 -134
  515. package/fesm2015/select/testing.js.map +1 -1
  516. package/fesm2015/select.js +939 -941
  517. package/fesm2015/select.js.map +1 -1
  518. package/fesm2015/sidenav/testing.js +58 -64
  519. package/fesm2015/sidenav/testing.js.map +1 -1
  520. package/fesm2015/sidenav.js +765 -762
  521. package/fesm2015/sidenav.js.map +1 -1
  522. package/fesm2015/slide-toggle/testing.js +122 -119
  523. package/fesm2015/slide-toggle/testing.js.map +1 -1
  524. package/fesm2015/slide-toggle.js +217 -229
  525. package/fesm2015/slide-toggle.js.map +1 -1
  526. package/fesm2015/slider/testing.js +128 -125
  527. package/fesm2015/slider/testing.js.map +1 -1
  528. package/fesm2015/slider.js +648 -654
  529. package/fesm2015/slider.js.map +1 -1
  530. package/fesm2015/snack-bar/testing.js +111 -114
  531. package/fesm2015/snack-bar/testing.js.map +1 -1
  532. package/fesm2015/snack-bar.js +426 -431
  533. package/fesm2015/snack-bar.js.map +1 -1
  534. package/fesm2015/sort/testing.js +92 -95
  535. package/fesm2015/sort/testing.js.map +1 -1
  536. package/fesm2015/sort.js +320 -318
  537. package/fesm2015/sort.js.map +1 -1
  538. package/fesm2015/stepper.js +312 -345
  539. package/fesm2015/stepper.js.map +1 -1
  540. package/fesm2015/table/testing.js +208 -229
  541. package/fesm2015/table/testing.js.map +1 -1
  542. package/fesm2015/table.js +235 -286
  543. package/fesm2015/table.js.map +1 -1
  544. package/fesm2015/tabs/testing.js +128 -134
  545. package/fesm2015/tabs/testing.js.map +1 -1
  546. package/fesm2015/tabs.js +1362 -1399
  547. package/fesm2015/tabs.js.map +1 -1
  548. package/fesm2015/toolbar/testing.js +74 -0
  549. package/fesm2015/toolbar/testing.js.map +1 -0
  550. package/fesm2015/toolbar.js +69 -78
  551. package/fesm2015/toolbar.js.map +1 -1
  552. package/fesm2015/tooltip/testing.js +42 -45
  553. package/fesm2015/tooltip/testing.js.map +1 -1
  554. package/fesm2015/tooltip.js +517 -513
  555. package/fesm2015/tooltip.js.map +1 -1
  556. package/fesm2015/tree.js +173 -197
  557. package/fesm2015/tree.js.map +1 -1
  558. package/form-field/error.d.ts +7 -0
  559. package/form-field/hint.d.ts +10 -0
  560. package/form-field/index.metadata.json +1 -1
  561. package/form-field/prefix.d.ts +7 -0
  562. package/form-field/suffix.d.ts +7 -0
  563. package/form-field/testing/form-field-harness.d.ts +8 -0
  564. package/grid-list/grid-list.d.ts +2 -1
  565. package/grid-list/index.metadata.json +1 -1
  566. package/grid-list/tile-styler.d.ts +10 -5
  567. package/input/_input-theme.scss +2 -2
  568. package/input/index.metadata.json +1 -1
  569. package/input/input.d.ts +6 -2
  570. package/input/testing/input-harness.d.ts +2 -0
  571. package/list/index.metadata.json +1 -1
  572. package/list/testing/action-list-harness.d.ts +2 -0
  573. package/list/testing/nav-list-harness.d.ts +2 -0
  574. package/list/testing/selection-list-harness.d.ts +2 -0
  575. package/menu/index.metadata.json +1 -1
  576. package/menu/menu-content.d.ts +7 -1
  577. package/menu/menu-panel.d.ts +1 -0
  578. package/menu/menu.d.ts +4 -0
  579. package/menu/testing/menu-harness.d.ts +4 -0
  580. package/package.json +6 -6
  581. package/prebuilt-themes/deeppurple-amber.css +1 -1
  582. package/prebuilt-themes/indigo-pink.css +1 -1
  583. package/prebuilt-themes/pink-bluegrey.css +1 -1
  584. package/prebuilt-themes/purple-green.css +1 -1
  585. package/progress-spinner/index.metadata.json +1 -1
  586. package/radio/index.metadata.json +1 -1
  587. package/radio/radio.d.ts +6 -0
  588. package/radio/testing/radio-harness.d.ts +2 -0
  589. package/schematics/migration.json +5 -0
  590. package/schematics/ng-add/index.js +2 -2
  591. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +3 -3
  592. package/schematics/ng-generate/navigation/schema.json +5 -0
  593. package/schematics/ng-update/data/index.js +1 -1
  594. package/schematics/ng-update/index.d.ts +2 -0
  595. package/schematics/ng-update/index.js +7 -2
  596. package/schematics/ng-update/migrations/hammer-gestures-v9/hammer-gestures-migration.js +639 -639
  597. package/schematics/ng-update/migrations/misc-ripples-v7/ripple-speed-factor-migration.js +1 -1
  598. package/select/index.metadata.json +1 -1
  599. package/select/select.d.ts +6 -0
  600. package/select/testing/select-harness.d.ts +2 -0
  601. package/sidenav/drawer.d.ts +15 -3
  602. package/sidenav/index.metadata.json +1 -1
  603. package/slide-toggle/index.metadata.json +1 -1
  604. package/slide-toggle/testing/slide-toggle-harness.d.ts +2 -0
  605. package/slider/testing/slider-harness.d.ts +2 -0
  606. package/snack-bar/index.metadata.json +1 -1
  607. package/snack-bar/simple-snack-bar.d.ts +13 -1
  608. package/snack-bar/snack-bar-container.d.ts +16 -3
  609. package/snack-bar/snack-bar-ref.d.ts +3 -3
  610. package/snack-bar/snack-bar.d.ts +10 -3
  611. package/sort/index.metadata.json +1 -1
  612. package/sort/sort-header-intl.d.ts +5 -1
  613. package/sort/sort-header.d.ts +3 -1
  614. package/sort/testing/sort-header-harness.d.ts +6 -2
  615. package/tabs/index.d.ts +3 -1
  616. package/tabs/index.metadata.json +1 -1
  617. package/tabs/tab-content.d.ts +7 -1
  618. package/tabs/tab-label.d.ts +7 -0
  619. package/toolbar/testing/index.d.ts +8 -0
  620. package/toolbar/testing/package.json +9 -0
  621. package/toolbar/testing/public-api.d.ts +9 -0
  622. package/toolbar/testing/toolbar-harness-filters.d.ts +13 -0
  623. package/toolbar/testing/toolbar-harness.d.ts +31 -0
  624. package/tooltip/index.metadata.json +1 -1
  625. package/tooltip/tooltip.d.ts +1 -0
  626. package/tree/data-source/flat-data-source.d.ts +4 -4
  627. package/tree/index.metadata.json +1 -1
package/fesm2015/tabs.js CHANGED
@@ -41,66 +41,63 @@ function _MAT_INK_BAR_POSITIONER_FACTORY() {
41
41
  * The ink-bar is used to display and animate the line underneath the current active tab label.
42
42
  * @docs-private
43
43
  */
44
- let MatInkBar = /** @class */ (() => {
45
- class MatInkBar {
46
- constructor(_elementRef, _ngZone, _inkBarPositioner, _animationMode) {
47
- this._elementRef = _elementRef;
48
- this._ngZone = _ngZone;
49
- this._inkBarPositioner = _inkBarPositioner;
50
- this._animationMode = _animationMode;
51
- }
52
- /**
53
- * Calculates the styles from the provided element in order to align the ink-bar to that element.
54
- * Shows the ink bar if previously set as hidden.
55
- * @param element
56
- */
57
- alignToElement(element) {
58
- this.show();
59
- if (typeof requestAnimationFrame !== 'undefined') {
60
- this._ngZone.runOutsideAngular(() => {
61
- requestAnimationFrame(() => this._setStyles(element));
62
- });
63
- }
64
- else {
65
- this._setStyles(element);
66
- }
67
- }
68
- /** Shows the ink bar. */
69
- show() {
70
- this._elementRef.nativeElement.style.visibility = 'visible';
44
+ class MatInkBar {
45
+ constructor(_elementRef, _ngZone, _inkBarPositioner, _animationMode) {
46
+ this._elementRef = _elementRef;
47
+ this._ngZone = _ngZone;
48
+ this._inkBarPositioner = _inkBarPositioner;
49
+ this._animationMode = _animationMode;
50
+ }
51
+ /**
52
+ * Calculates the styles from the provided element in order to align the ink-bar to that element.
53
+ * Shows the ink bar if previously set as hidden.
54
+ * @param element
55
+ */
56
+ alignToElement(element) {
57
+ this.show();
58
+ if (typeof requestAnimationFrame !== 'undefined') {
59
+ this._ngZone.runOutsideAngular(() => {
60
+ requestAnimationFrame(() => this._setStyles(element));
61
+ });
71
62
  }
72
- /** Hides the ink bar. */
73
- hide() {
74
- this._elementRef.nativeElement.style.visibility = 'hidden';
75
- }
76
- /**
77
- * Sets the proper styles to the ink bar element.
78
- * @param element
79
- */
80
- _setStyles(element) {
81
- const positions = this._inkBarPositioner(element);
82
- const inkBar = this._elementRef.nativeElement;
83
- inkBar.style.left = positions.left;
84
- inkBar.style.width = positions.width;
63
+ else {
64
+ this._setStyles(element);
85
65
  }
86
66
  }
87
- MatInkBar.decorators = [
88
- { type: Directive, args: [{
89
- selector: 'mat-ink-bar',
90
- host: {
91
- 'class': 'mat-ink-bar',
92
- '[class._mat-animation-noopable]': `_animationMode === 'NoopAnimations'`,
93
- },
94
- },] }
95
- ];
96
- MatInkBar.ctorParameters = () => [
97
- { type: ElementRef },
98
- { type: NgZone },
99
- { type: undefined, decorators: [{ type: Inject, args: [_MAT_INK_BAR_POSITIONER,] }] },
100
- { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
101
- ];
102
- return MatInkBar;
103
- })();
67
+ /** Shows the ink bar. */
68
+ show() {
69
+ this._elementRef.nativeElement.style.visibility = 'visible';
70
+ }
71
+ /** Hides the ink bar. */
72
+ hide() {
73
+ this._elementRef.nativeElement.style.visibility = 'hidden';
74
+ }
75
+ /**
76
+ * Sets the proper styles to the ink bar element.
77
+ * @param element
78
+ */
79
+ _setStyles(element) {
80
+ const positions = this._inkBarPositioner(element);
81
+ const inkBar = this._elementRef.nativeElement;
82
+ inkBar.style.left = positions.left;
83
+ inkBar.style.width = positions.width;
84
+ }
85
+ }
86
+ MatInkBar.decorators = [
87
+ { type: Directive, args: [{
88
+ selector: 'mat-ink-bar',
89
+ host: {
90
+ 'class': 'mat-ink-bar',
91
+ '[class._mat-animation-noopable]': `_animationMode === 'NoopAnimations'`,
92
+ },
93
+ },] }
94
+ ];
95
+ MatInkBar.ctorParameters = () => [
96
+ { type: ElementRef },
97
+ { type: NgZone },
98
+ { type: undefined, decorators: [{ type: Inject, args: [_MAT_INK_BAR_POSITIONER,] }] },
99
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
100
+ ];
104
101
 
105
102
  /**
106
103
  * @license
@@ -109,21 +106,27 @@ let MatInkBar = /** @class */ (() => {
109
106
  * Use of this source code is governed by an MIT-style license that can be
110
107
  * found in the LICENSE file at https://angular.io/license
111
108
  */
109
+ /**
110
+ * Injection token that can be used to reference instances of `MatTabContent`. It serves as
111
+ * alternative token to the actual `MatTabContent` class which could cause unnecessary
112
+ * retention of the class and its directive metadata.
113
+ */
114
+ const MAT_TAB_CONTENT = new InjectionToken('MatTabContent');
112
115
  /** Decorates the `ng-template` tags and reads out the template from it. */
113
- let MatTabContent = /** @class */ (() => {
114
- class MatTabContent {
115
- constructor(template) {
116
- this.template = template;
117
- }
116
+ class MatTabContent {
117
+ constructor(template) {
118
+ this.template = template;
118
119
  }
119
- MatTabContent.decorators = [
120
- { type: Directive, args: [{ selector: '[matTabContent]' },] }
121
- ];
122
- MatTabContent.ctorParameters = () => [
123
- { type: TemplateRef }
124
- ];
125
- return MatTabContent;
126
- })();
120
+ }
121
+ MatTabContent.decorators = [
122
+ { type: Directive, args: [{
123
+ selector: '[matTabContent]',
124
+ providers: [{ provide: MAT_TAB_CONTENT, useExisting: MatTabContent }],
125
+ },] }
126
+ ];
127
+ MatTabContent.ctorParameters = () => [
128
+ { type: TemplateRef }
129
+ ];
127
130
 
128
131
  /**
129
132
  * @license
@@ -132,17 +135,21 @@ let MatTabContent = /** @class */ (() => {
132
135
  * Use of this source code is governed by an MIT-style license that can be
133
136
  * found in the LICENSE file at https://angular.io/license
134
137
  */
138
+ /**
139
+ * Injection token that can be used to reference instances of `MatTabLabel`. It serves as
140
+ * alternative token to the actual `MatTabLabel` class which could cause unnecessary
141
+ * retention of the class and its directive metadata.
142
+ */
143
+ const MAT_TAB_LABEL = new InjectionToken('MatTabLabel');
135
144
  /** Used to flag tab labels for use with the portal directive */
136
- let MatTabLabel = /** @class */ (() => {
137
- class MatTabLabel extends CdkPortal {
138
- }
139
- MatTabLabel.decorators = [
140
- { type: Directive, args: [{
141
- selector: '[mat-tab-label], [matTabLabel]',
142
- },] }
143
- ];
144
- return MatTabLabel;
145
- })();
145
+ class MatTabLabel extends CdkPortal {
146
+ }
147
+ MatTabLabel.decorators = [
148
+ { type: Directive, args: [{
149
+ selector: '[mat-tab-label], [matTabLabel]',
150
+ providers: [{ provide: MAT_TAB_LABEL, useExisting: MatTabLabel }],
151
+ },] }
152
+ ];
146
153
 
147
154
  /**
148
155
  * @license
@@ -161,90 +168,88 @@ const _MatTabMixinBase = mixinDisabled(MatTabBase);
161
168
  * @docs-private
162
169
  */
163
170
  const MAT_TAB_GROUP = new InjectionToken('MAT_TAB_GROUP');
164
- let MatTab = /** @class */ (() => {
165
- class MatTab extends _MatTabMixinBase {
166
- constructor(_viewContainerRef,
171
+ class MatTab extends _MatTabMixinBase {
172
+ constructor(_viewContainerRef,
173
+ /**
174
+ * @deprecated `_closestTabGroup` parameter to become required.
175
+ * @breaking-change 10.0.0
176
+ */
177
+ _closestTabGroup) {
178
+ super();
179
+ this._viewContainerRef = _viewContainerRef;
180
+ this._closestTabGroup = _closestTabGroup;
181
+ /** Plain text label for the tab, used when there is no template label. */
182
+ this.textLabel = '';
183
+ /** Portal that will be the hosted content of the tab */
184
+ this._contentPortal = null;
185
+ /** Emits whenever the internal state of the tab changes. */
186
+ this._stateChanges = new Subject();
167
187
  /**
168
- * @deprecated `_closestTabGroup` parameter to become required.
169
- * @breaking-change 10.0.0
188
+ * The relatively indexed position where 0 represents the center, negative is left, and positive
189
+ * represents the right.
170
190
  */
171
- _closestTabGroup) {
172
- super();
173
- this._viewContainerRef = _viewContainerRef;
174
- this._closestTabGroup = _closestTabGroup;
175
- /** Plain text label for the tab, used when there is no template label. */
176
- this.textLabel = '';
177
- /** Portal that will be the hosted content of the tab */
178
- this._contentPortal = null;
179
- /** Emits whenever the internal state of the tab changes. */
180
- this._stateChanges = new Subject();
181
- /**
182
- * The relatively indexed position where 0 represents the center, negative is left, and positive
183
- * represents the right.
184
- */
185
- this.position = null;
186
- /**
187
- * The initial relatively index origin of the tab if it was created and selected after there
188
- * was already a selected tab. Provides context of what position the tab should originate from.
189
- */
190
- this.origin = null;
191
- /**
192
- * Whether the tab is currently active.
193
- */
194
- this.isActive = false;
195
- }
196
- /** Content for the tab label given by `<ng-template mat-tab-label>`. */
197
- get templateLabel() { return this._templateLabel; }
198
- set templateLabel(value) {
199
- // Only update the templateLabel via query if there is actually
200
- // a MatTabLabel found. This works around an issue where a user may have
201
- // manually set `templateLabel` during creation mode, which would then get clobbered
202
- // by `undefined` when this query resolves.
203
- if (value) {
204
- this._templateLabel = value;
205
- }
206
- }
207
- /** @docs-private */
208
- get content() {
209
- return this._contentPortal;
210
- }
211
- ngOnChanges(changes) {
212
- if (changes.hasOwnProperty('textLabel') || changes.hasOwnProperty('disabled')) {
213
- this._stateChanges.next();
214
- }
215
- }
216
- ngOnDestroy() {
217
- this._stateChanges.complete();
191
+ this.position = null;
192
+ /**
193
+ * The initial relatively index origin of the tab if it was created and selected after there
194
+ * was already a selected tab. Provides context of what position the tab should originate from.
195
+ */
196
+ this.origin = null;
197
+ /**
198
+ * Whether the tab is currently active.
199
+ */
200
+ this.isActive = false;
201
+ }
202
+ // TODO: Remove cast once https://github.com/angular/angular/pull/37506 is available.
203
+ /** Content for the tab label given by `<ng-template mat-tab-label>`. */
204
+ get templateLabel() { return this._templateLabel; }
205
+ set templateLabel(value) {
206
+ // Only update the templateLabel via query if there is actually
207
+ // a MatTabLabel found. This works around an issue where a user may have
208
+ // manually set `templateLabel` during creation mode, which would then get clobbered
209
+ // by `undefined` when this query resolves.
210
+ if (value) {
211
+ this._templateLabel = value;
218
212
  }
219
- ngOnInit() {
220
- this._contentPortal = new TemplatePortal(this._explicitContent || this._implicitContent, this._viewContainerRef);
213
+ }
214
+ /** @docs-private */
215
+ get content() {
216
+ return this._contentPortal;
217
+ }
218
+ ngOnChanges(changes) {
219
+ if (changes.hasOwnProperty('textLabel') || changes.hasOwnProperty('disabled')) {
220
+ this._stateChanges.next();
221
221
  }
222
222
  }
223
- MatTab.decorators = [
224
- { type: Component, args: [{
225
- selector: 'mat-tab',
226
- template: "<!-- Create a template for the content of the <mat-tab> so that we can grab a reference to this\n TemplateRef and use it in a Portal to render the tab content in the appropriate place in the\n tab-group. -->\n<ng-template><ng-content></ng-content></ng-template>\n",
227
- inputs: ['disabled'],
228
- // tslint:disable-next-line:validate-decorators
229
- changeDetection: ChangeDetectionStrategy.Default,
230
- encapsulation: ViewEncapsulation.None,
231
- exportAs: 'matTab'
232
- },] }
233
- ];
234
- MatTab.ctorParameters = () => [
235
- { type: ViewContainerRef },
236
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_TAB_GROUP,] }] }
237
- ];
238
- MatTab.propDecorators = {
239
- templateLabel: [{ type: ContentChild, args: [MatTabLabel,] }],
240
- _explicitContent: [{ type: ContentChild, args: [MatTabContent, { read: TemplateRef, static: true },] }],
241
- _implicitContent: [{ type: ViewChild, args: [TemplateRef, { static: true },] }],
242
- textLabel: [{ type: Input, args: ['label',] }],
243
- ariaLabel: [{ type: Input, args: ['aria-label',] }],
244
- ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }]
245
- };
246
- return MatTab;
247
- })();
223
+ ngOnDestroy() {
224
+ this._stateChanges.complete();
225
+ }
226
+ ngOnInit() {
227
+ this._contentPortal = new TemplatePortal(this._explicitContent || this._implicitContent, this._viewContainerRef);
228
+ }
229
+ }
230
+ MatTab.decorators = [
231
+ { type: Component, args: [{
232
+ selector: 'mat-tab',
233
+ template: "<!-- Create a template for the content of the <mat-tab> so that we can grab a reference to this\n TemplateRef and use it in a Portal to render the tab content in the appropriate place in the\n tab-group. -->\n<ng-template><ng-content></ng-content></ng-template>\n",
234
+ inputs: ['disabled'],
235
+ // tslint:disable-next-line:validate-decorators
236
+ changeDetection: ChangeDetectionStrategy.Default,
237
+ encapsulation: ViewEncapsulation.None,
238
+ exportAs: 'matTab'
239
+ },] }
240
+ ];
241
+ MatTab.ctorParameters = () => [
242
+ { type: ViewContainerRef },
243
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_TAB_GROUP,] }] }
244
+ ];
245
+ MatTab.propDecorators = {
246
+ templateLabel: [{ type: ContentChild, args: [MAT_TAB_LABEL,] }],
247
+ _explicitContent: [{ type: ContentChild, args: [MAT_TAB_CONTENT, { read: TemplateRef, static: true },] }],
248
+ _implicitContent: [{ type: ViewChild, args: [TemplateRef, { static: true },] }],
249
+ textLabel: [{ type: Input, args: ['label',] }],
250
+ ariaLabel: [{ type: Input, args: ['aria-label',] }],
251
+ ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }]
252
+ };
248
253
 
249
254
  /**
250
255
  * @license
@@ -291,213 +296,204 @@ const matTabsAnimations = {
291
296
  * The portal host directive for the contents of the tab.
292
297
  * @docs-private
293
298
  */
294
- let MatTabBodyPortal = /** @class */ (() => {
295
- class MatTabBodyPortal extends CdkPortalOutlet {
296
- constructor(componentFactoryResolver, viewContainerRef, _host,
297
- /**
298
- * @deprecated `_document` parameter to be made required.
299
- * @breaking-change 9.0.0
300
- */
301
- _document) {
302
- super(componentFactoryResolver, viewContainerRef, _document);
303
- this._host = _host;
304
- /** Subscription to events for when the tab body begins centering. */
305
- this._centeringSub = Subscription.EMPTY;
306
- /** Subscription to events for when the tab body finishes leaving from center position. */
307
- this._leavingSub = Subscription.EMPTY;
308
- }
309
- /** Set initial visibility or set up subscription for changing visibility. */
310
- ngOnInit() {
311
- super.ngOnInit();
312
- this._centeringSub = this._host._beforeCentering
313
- .pipe(startWith(this._host._isCenterPosition(this._host._position)))
314
- .subscribe((isCentering) => {
315
- if (isCentering && !this.hasAttached()) {
316
- this.attach(this._host._content);
317
- }
318
- });
319
- this._leavingSub = this._host._afterLeavingCenter.subscribe(() => {
320
- this.detach();
321
- });
322
- }
323
- /** Clean up centering subscription. */
324
- ngOnDestroy() {
325
- super.ngOnDestroy();
326
- this._centeringSub.unsubscribe();
327
- this._leavingSub.unsubscribe();
328
- }
299
+ class MatTabBodyPortal extends CdkPortalOutlet {
300
+ constructor(componentFactoryResolver, viewContainerRef, _host,
301
+ /**
302
+ * @deprecated `_document` parameter to be made required.
303
+ * @breaking-change 9.0.0
304
+ */
305
+ _document) {
306
+ super(componentFactoryResolver, viewContainerRef, _document);
307
+ this._host = _host;
308
+ /** Subscription to events for when the tab body begins centering. */
309
+ this._centeringSub = Subscription.EMPTY;
310
+ /** Subscription to events for when the tab body finishes leaving from center position. */
311
+ this._leavingSub = Subscription.EMPTY;
312
+ }
313
+ /** Set initial visibility or set up subscription for changing visibility. */
314
+ ngOnInit() {
315
+ super.ngOnInit();
316
+ this._centeringSub = this._host._beforeCentering
317
+ .pipe(startWith(this._host._isCenterPosition(this._host._position)))
318
+ .subscribe((isCentering) => {
319
+ if (isCentering && !this.hasAttached()) {
320
+ this.attach(this._host._content);
321
+ }
322
+ });
323
+ this._leavingSub = this._host._afterLeavingCenter.subscribe(() => {
324
+ this.detach();
325
+ });
329
326
  }
330
- MatTabBodyPortal.decorators = [
331
- { type: Directive, args: [{
332
- selector: '[matTabBodyHost]'
333
- },] }
334
- ];
335
- MatTabBodyPortal.ctorParameters = () => [
336
- { type: ComponentFactoryResolver },
337
- { type: ViewContainerRef },
338
- { type: MatTabBody, decorators: [{ type: Inject, args: [forwardRef(() => MatTabBody),] }] },
339
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
340
- ];
341
- return MatTabBodyPortal;
342
- })();
327
+ /** Clean up centering subscription. */
328
+ ngOnDestroy() {
329
+ super.ngOnDestroy();
330
+ this._centeringSub.unsubscribe();
331
+ this._leavingSub.unsubscribe();
332
+ }
333
+ }
334
+ MatTabBodyPortal.decorators = [
335
+ { type: Directive, args: [{
336
+ selector: '[matTabBodyHost]'
337
+ },] }
338
+ ];
339
+ MatTabBodyPortal.ctorParameters = () => [
340
+ { type: ComponentFactoryResolver },
341
+ { type: ViewContainerRef },
342
+ { type: MatTabBody, decorators: [{ type: Inject, args: [forwardRef(() => MatTabBody),] }] },
343
+ { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
344
+ ];
343
345
  /**
344
346
  * Base class with all of the `MatTabBody` functionality.
345
347
  * @docs-private
346
348
  */
347
- let _MatTabBodyBase = /** @class */ (() => {
348
- class _MatTabBodyBase {
349
- constructor(_elementRef, _dir, changeDetectorRef) {
350
- this._elementRef = _elementRef;
351
- this._dir = _dir;
352
- /** Subscription to the directionality change observable. */
353
- this._dirChangeSubscription = Subscription.EMPTY;
354
- /** Emits when an animation on the tab is complete. */
355
- this._translateTabComplete = new Subject();
356
- /** Event emitted when the tab begins to animate towards the center as the active tab. */
357
- this._onCentering = new EventEmitter();
358
- /** Event emitted before the centering of the tab begins. */
359
- this._beforeCentering = new EventEmitter();
360
- /** Event emitted before the centering of the tab begins. */
361
- this._afterLeavingCenter = new EventEmitter();
362
- /** Event emitted when the tab completes its animation towards the center. */
363
- this._onCentered = new EventEmitter(true);
364
- // Note that the default value will always be overwritten by `MatTabBody`, but we need one
365
- // anyway to prevent the animations module from throwing an error if the body is used on its own.
366
- /** Duration for the tab's animation. */
367
- this.animationDuration = '500ms';
368
- if (_dir) {
369
- this._dirChangeSubscription = _dir.change.subscribe((dir) => {
370
- this._computePositionAnimationState(dir);
371
- changeDetectorRef.markForCheck();
372
- });
373
- }
374
- // Ensure that we get unique animation events, because the `.done` callback can get
375
- // invoked twice in some browsers. See https://github.com/angular/angular/issues/24084.
376
- this._translateTabComplete.pipe(distinctUntilChanged((x, y) => {
377
- return x.fromState === y.fromState && x.toState === y.toState;
378
- })).subscribe(event => {
379
- // If the transition to the center is complete, emit an event.
380
- if (this._isCenterPosition(event.toState) && this._isCenterPosition(this._position)) {
381
- this._onCentered.emit();
382
- }
383
- if (this._isCenterPosition(event.fromState) && !this._isCenterPosition(this._position)) {
384
- this._afterLeavingCenter.emit();
385
- }
349
+ class _MatTabBodyBase {
350
+ constructor(_elementRef, _dir, changeDetectorRef) {
351
+ this._elementRef = _elementRef;
352
+ this._dir = _dir;
353
+ /** Subscription to the directionality change observable. */
354
+ this._dirChangeSubscription = Subscription.EMPTY;
355
+ /** Emits when an animation on the tab is complete. */
356
+ this._translateTabComplete = new Subject();
357
+ /** Event emitted when the tab begins to animate towards the center as the active tab. */
358
+ this._onCentering = new EventEmitter();
359
+ /** Event emitted before the centering of the tab begins. */
360
+ this._beforeCentering = new EventEmitter();
361
+ /** Event emitted before the centering of the tab begins. */
362
+ this._afterLeavingCenter = new EventEmitter();
363
+ /** Event emitted when the tab completes its animation towards the center. */
364
+ this._onCentered = new EventEmitter(true);
365
+ // Note that the default value will always be overwritten by `MatTabBody`, but we need one
366
+ // anyway to prevent the animations module from throwing an error if the body is used on its own.
367
+ /** Duration for the tab's animation. */
368
+ this.animationDuration = '500ms';
369
+ if (_dir) {
370
+ this._dirChangeSubscription = _dir.change.subscribe((dir) => {
371
+ this._computePositionAnimationState(dir);
372
+ changeDetectorRef.markForCheck();
386
373
  });
387
374
  }
388
- /** The shifted index position of the tab body, where zero represents the active center tab. */
389
- set position(position) {
390
- this._positionIndex = position;
391
- this._computePositionAnimationState();
392
- }
393
- /**
394
- * After initialized, check if the content is centered and has an origin. If so, set the
395
- * special position states that transition the tab from the left or right before centering.
396
- */
397
- ngOnInit() {
398
- if (this._position == 'center' && this.origin != null) {
399
- this._position = this._computePositionFromOrigin(this.origin);
375
+ // Ensure that we get unique animation events, because the `.done` callback can get
376
+ // invoked twice in some browsers. See https://github.com/angular/angular/issues/24084.
377
+ this._translateTabComplete.pipe(distinctUntilChanged((x, y) => {
378
+ return x.fromState === y.fromState && x.toState === y.toState;
379
+ })).subscribe(event => {
380
+ // If the transition to the center is complete, emit an event.
381
+ if (this._isCenterPosition(event.toState) && this._isCenterPosition(this._position)) {
382
+ this._onCentered.emit();
400
383
  }
401
- }
402
- ngOnDestroy() {
403
- this._dirChangeSubscription.unsubscribe();
404
- this._translateTabComplete.complete();
405
- }
406
- _onTranslateTabStarted(event) {
407
- const isCentering = this._isCenterPosition(event.toState);
408
- this._beforeCentering.emit(isCentering);
409
- if (isCentering) {
410
- this._onCentering.emit(this._elementRef.nativeElement.clientHeight);
384
+ if (this._isCenterPosition(event.fromState) && !this._isCenterPosition(this._position)) {
385
+ this._afterLeavingCenter.emit();
411
386
  }
387
+ });
388
+ }
389
+ /** The shifted index position of the tab body, where zero represents the active center tab. */
390
+ set position(position) {
391
+ this._positionIndex = position;
392
+ this._computePositionAnimationState();
393
+ }
394
+ /**
395
+ * After initialized, check if the content is centered and has an origin. If so, set the
396
+ * special position states that transition the tab from the left or right before centering.
397
+ */
398
+ ngOnInit() {
399
+ if (this._position == 'center' && this.origin != null) {
400
+ this._position = this._computePositionFromOrigin(this.origin);
412
401
  }
413
- /** The text direction of the containing app. */
414
- _getLayoutDirection() {
415
- return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
402
+ }
403
+ ngOnDestroy() {
404
+ this._dirChangeSubscription.unsubscribe();
405
+ this._translateTabComplete.complete();
406
+ }
407
+ _onTranslateTabStarted(event) {
408
+ const isCentering = this._isCenterPosition(event.toState);
409
+ this._beforeCentering.emit(isCentering);
410
+ if (isCentering) {
411
+ this._onCentering.emit(this._elementRef.nativeElement.clientHeight);
416
412
  }
417
- /** Whether the provided position state is considered center, regardless of origin. */
418
- _isCenterPosition(position) {
419
- return position == 'center' ||
420
- position == 'left-origin-center' ||
421
- position == 'right-origin-center';
413
+ }
414
+ /** The text direction of the containing app. */
415
+ _getLayoutDirection() {
416
+ return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
417
+ }
418
+ /** Whether the provided position state is considered center, regardless of origin. */
419
+ _isCenterPosition(position) {
420
+ return position == 'center' ||
421
+ position == 'left-origin-center' ||
422
+ position == 'right-origin-center';
423
+ }
424
+ /** Computes the position state that will be used for the tab-body animation trigger. */
425
+ _computePositionAnimationState(dir = this._getLayoutDirection()) {
426
+ if (this._positionIndex < 0) {
427
+ this._position = dir == 'ltr' ? 'left' : 'right';
422
428
  }
423
- /** Computes the position state that will be used for the tab-body animation trigger. */
424
- _computePositionAnimationState(dir = this._getLayoutDirection()) {
425
- if (this._positionIndex < 0) {
426
- this._position = dir == 'ltr' ? 'left' : 'right';
427
- }
428
- else if (this._positionIndex > 0) {
429
- this._position = dir == 'ltr' ? 'right' : 'left';
430
- }
431
- else {
432
- this._position = 'center';
433
- }
429
+ else if (this._positionIndex > 0) {
430
+ this._position = dir == 'ltr' ? 'right' : 'left';
434
431
  }
435
- /**
436
- * Computes the position state based on the specified origin position. This is used if the
437
- * tab is becoming visible immediately after creation.
438
- */
439
- _computePositionFromOrigin(origin) {
440
- const dir = this._getLayoutDirection();
441
- if ((dir == 'ltr' && origin <= 0) || (dir == 'rtl' && origin > 0)) {
442
- return 'left-origin-center';
443
- }
444
- return 'right-origin-center';
432
+ else {
433
+ this._position = 'center';
445
434
  }
446
435
  }
447
- _MatTabBodyBase.decorators = [
448
- { type: Directive }
449
- ];
450
- _MatTabBodyBase.ctorParameters = () => [
451
- { type: ElementRef },
452
- { type: Directionality, decorators: [{ type: Optional }] },
453
- { type: ChangeDetectorRef }
454
- ];
455
- _MatTabBodyBase.propDecorators = {
456
- _onCentering: [{ type: Output }],
457
- _beforeCentering: [{ type: Output }],
458
- _afterLeavingCenter: [{ type: Output }],
459
- _onCentered: [{ type: Output }],
460
- _content: [{ type: Input, args: ['content',] }],
461
- origin: [{ type: Input }],
462
- animationDuration: [{ type: Input }],
463
- position: [{ type: Input }]
464
- };
465
- return _MatTabBodyBase;
466
- })();
436
+ /**
437
+ * Computes the position state based on the specified origin position. This is used if the
438
+ * tab is becoming visible immediately after creation.
439
+ */
440
+ _computePositionFromOrigin(origin) {
441
+ const dir = this._getLayoutDirection();
442
+ if ((dir == 'ltr' && origin <= 0) || (dir == 'rtl' && origin > 0)) {
443
+ return 'left-origin-center';
444
+ }
445
+ return 'right-origin-center';
446
+ }
447
+ }
448
+ _MatTabBodyBase.decorators = [
449
+ { type: Directive }
450
+ ];
451
+ _MatTabBodyBase.ctorParameters = () => [
452
+ { type: ElementRef },
453
+ { type: Directionality, decorators: [{ type: Optional }] },
454
+ { type: ChangeDetectorRef }
455
+ ];
456
+ _MatTabBodyBase.propDecorators = {
457
+ _onCentering: [{ type: Output }],
458
+ _beforeCentering: [{ type: Output }],
459
+ _afterLeavingCenter: [{ type: Output }],
460
+ _onCentered: [{ type: Output }],
461
+ _content: [{ type: Input, args: ['content',] }],
462
+ origin: [{ type: Input }],
463
+ animationDuration: [{ type: Input }],
464
+ position: [{ type: Input }]
465
+ };
467
466
  /**
468
467
  * Wrapper for the contents of a tab.
469
468
  * @docs-private
470
469
  */
471
- let MatTabBody = /** @class */ (() => {
472
- class MatTabBody extends _MatTabBodyBase {
473
- constructor(elementRef, dir, changeDetectorRef) {
474
- super(elementRef, dir, changeDetectorRef);
475
- }
470
+ class MatTabBody extends _MatTabBodyBase {
471
+ constructor(elementRef, dir, changeDetectorRef) {
472
+ super(elementRef, dir, changeDetectorRef);
476
473
  }
477
- MatTabBody.decorators = [
478
- { type: Component, args: [{
479
- selector: 'mat-tab-body',
480
- template: "<div class=\"mat-tab-body-content\" #content\n [@translateTab]=\"{\n value: _position,\n params: {animationDuration: animationDuration}\n }\"\n (@translateTab.start)=\"_onTranslateTabStarted($event)\"\n (@translateTab.done)=\"_translateTabComplete.next($event)\">\n <ng-template matTabBodyHost></ng-template>\n</div>\n",
481
- encapsulation: ViewEncapsulation.None,
482
- // tslint:disable-next-line:validate-decorators
483
- changeDetection: ChangeDetectionStrategy.Default,
484
- animations: [matTabsAnimations.translateTab],
485
- host: {
486
- 'class': 'mat-tab-body',
487
- },
488
- styles: [".mat-tab-body-content{height:100%;overflow:auto}.mat-tab-group-dynamic-height .mat-tab-body-content{overflow:hidden}\n"]
489
- },] }
490
- ];
491
- MatTabBody.ctorParameters = () => [
492
- { type: ElementRef },
493
- { type: Directionality, decorators: [{ type: Optional }] },
494
- { type: ChangeDetectorRef }
495
- ];
496
- MatTabBody.propDecorators = {
497
- _portalHost: [{ type: ViewChild, args: [PortalHostDirective,] }]
498
- };
499
- return MatTabBody;
500
- })();
474
+ }
475
+ MatTabBody.decorators = [
476
+ { type: Component, args: [{
477
+ selector: 'mat-tab-body',
478
+ template: "<div class=\"mat-tab-body-content\" #content\n [@translateTab]=\"{\n value: _position,\n params: {animationDuration: animationDuration}\n }\"\n (@translateTab.start)=\"_onTranslateTabStarted($event)\"\n (@translateTab.done)=\"_translateTabComplete.next($event)\">\n <ng-template matTabBodyHost></ng-template>\n</div>\n",
479
+ encapsulation: ViewEncapsulation.None,
480
+ // tslint:disable-next-line:validate-decorators
481
+ changeDetection: ChangeDetectionStrategy.Default,
482
+ animations: [matTabsAnimations.translateTab],
483
+ host: {
484
+ 'class': 'mat-tab-body',
485
+ },
486
+ styles: [".mat-tab-body-content{height:100%;overflow:auto}.mat-tab-group-dynamic-height .mat-tab-body-content{overflow:hidden}\n"]
487
+ },] }
488
+ ];
489
+ MatTabBody.ctorParameters = () => [
490
+ { type: ElementRef },
491
+ { type: Directionality, decorators: [{ type: Optional }] },
492
+ { type: ChangeDetectorRef }
493
+ ];
494
+ MatTabBody.propDecorators = {
495
+ _portalHost: [{ type: ViewChild, args: [PortalHostDirective,] }]
496
+ };
501
497
 
502
498
  /**
503
499
  * @license
@@ -533,298 +529,292 @@ const _MatTabGroupMixinBase = mixinColor(mixinDisableRipple(MatTabGroupMixinBase
533
529
  * Base class with all of the `MatTabGroupBase` functionality.
534
530
  * @docs-private
535
531
  */
536
- let _MatTabGroupBase = /** @class */ (() => {
537
- class _MatTabGroupBase extends _MatTabGroupMixinBase {
538
- constructor(elementRef, _changeDetectorRef, defaultConfig, _animationMode) {
539
- super(elementRef);
540
- this._changeDetectorRef = _changeDetectorRef;
541
- this._animationMode = _animationMode;
542
- /** All of the tabs that belong to the group. */
543
- this._tabs = new QueryList();
544
- /** The tab index that should be selected after the content has been checked. */
545
- this._indexToSelect = 0;
546
- /** Snapshot of the height of the tab body wrapper before another tab is activated. */
547
- this._tabBodyWrapperHeight = 0;
548
- /** Subscription to tabs being added/removed. */
549
- this._tabsSubscription = Subscription.EMPTY;
550
- /** Subscription to changes in the tab labels. */
551
- this._tabLabelSubscription = Subscription.EMPTY;
552
- this._dynamicHeight = false;
553
- this._selectedIndex = null;
554
- /** Position of the tab header. */
555
- this.headerPosition = 'above';
556
- /** Output to enable support for two-way binding on `[(selectedIndex)]` */
557
- this.selectedIndexChange = new EventEmitter();
558
- /** Event emitted when focus has changed within a tab group. */
559
- this.focusChange = new EventEmitter();
560
- /** Event emitted when the body animation has completed */
561
- this.animationDone = new EventEmitter();
562
- /** Event emitted when the tab selection has changed. */
563
- this.selectedTabChange = new EventEmitter(true);
564
- this._groupId = nextId++;
565
- this.animationDuration = defaultConfig && defaultConfig.animationDuration ?
566
- defaultConfig.animationDuration : '500ms';
567
- this.disablePagination = defaultConfig && defaultConfig.disablePagination != null ?
568
- defaultConfig.disablePagination : false;
569
- }
570
- /** Whether the tab group should grow to the size of the active tab. */
571
- get dynamicHeight() { return this._dynamicHeight; }
572
- set dynamicHeight(value) { this._dynamicHeight = coerceBooleanProperty(value); }
573
- /** The index of the active tab. */
574
- get selectedIndex() { return this._selectedIndex; }
575
- set selectedIndex(value) {
576
- this._indexToSelect = coerceNumberProperty(value, null);
577
- }
578
- /** Duration for the tab animation. Will be normalized to milliseconds if no units are set. */
579
- get animationDuration() { return this._animationDuration; }
580
- set animationDuration(value) {
581
- this._animationDuration = /^\d+$/.test(value) ? value + 'ms' : value;
582
- }
583
- /** Background color of the tab group. */
584
- get backgroundColor() { return this._backgroundColor; }
585
- set backgroundColor(value) {
586
- const nativeElement = this._elementRef.nativeElement;
587
- nativeElement.classList.remove(`mat-background-${this.backgroundColor}`);
588
- if (value) {
589
- nativeElement.classList.add(`mat-background-${value}`);
532
+ class _MatTabGroupBase extends _MatTabGroupMixinBase {
533
+ constructor(elementRef, _changeDetectorRef, defaultConfig, _animationMode) {
534
+ super(elementRef);
535
+ this._changeDetectorRef = _changeDetectorRef;
536
+ this._animationMode = _animationMode;
537
+ /** All of the tabs that belong to the group. */
538
+ this._tabs = new QueryList();
539
+ /** The tab index that should be selected after the content has been checked. */
540
+ this._indexToSelect = 0;
541
+ /** Snapshot of the height of the tab body wrapper before another tab is activated. */
542
+ this._tabBodyWrapperHeight = 0;
543
+ /** Subscription to tabs being added/removed. */
544
+ this._tabsSubscription = Subscription.EMPTY;
545
+ /** Subscription to changes in the tab labels. */
546
+ this._tabLabelSubscription = Subscription.EMPTY;
547
+ this._dynamicHeight = false;
548
+ this._selectedIndex = null;
549
+ /** Position of the tab header. */
550
+ this.headerPosition = 'above';
551
+ /** Output to enable support for two-way binding on `[(selectedIndex)]` */
552
+ this.selectedIndexChange = new EventEmitter();
553
+ /** Event emitted when focus has changed within a tab group. */
554
+ this.focusChange = new EventEmitter();
555
+ /** Event emitted when the body animation has completed */
556
+ this.animationDone = new EventEmitter();
557
+ /** Event emitted when the tab selection has changed. */
558
+ this.selectedTabChange = new EventEmitter(true);
559
+ this._groupId = nextId++;
560
+ this.animationDuration = defaultConfig && defaultConfig.animationDuration ?
561
+ defaultConfig.animationDuration : '500ms';
562
+ this.disablePagination = defaultConfig && defaultConfig.disablePagination != null ?
563
+ defaultConfig.disablePagination : false;
564
+ }
565
+ /** Whether the tab group should grow to the size of the active tab. */
566
+ get dynamicHeight() { return this._dynamicHeight; }
567
+ set dynamicHeight(value) { this._dynamicHeight = coerceBooleanProperty(value); }
568
+ /** The index of the active tab. */
569
+ get selectedIndex() { return this._selectedIndex; }
570
+ set selectedIndex(value) {
571
+ this._indexToSelect = coerceNumberProperty(value, null);
572
+ }
573
+ /** Duration for the tab animation. Will be normalized to milliseconds if no units are set. */
574
+ get animationDuration() { return this._animationDuration; }
575
+ set animationDuration(value) {
576
+ this._animationDuration = /^\d+$/.test(value) ? value + 'ms' : value;
577
+ }
578
+ /** Background color of the tab group. */
579
+ get backgroundColor() { return this._backgroundColor; }
580
+ set backgroundColor(value) {
581
+ const nativeElement = this._elementRef.nativeElement;
582
+ nativeElement.classList.remove(`mat-background-${this.backgroundColor}`);
583
+ if (value) {
584
+ nativeElement.classList.add(`mat-background-${value}`);
585
+ }
586
+ this._backgroundColor = value;
587
+ }
588
+ /**
589
+ * After the content is checked, this component knows what tabs have been defined
590
+ * and what the selected index should be. This is where we can know exactly what position
591
+ * each tab should be in according to the new selected index, and additionally we know how
592
+ * a new selected tab should transition in (from the left or right).
593
+ */
594
+ ngAfterContentChecked() {
595
+ // Don't clamp the `indexToSelect` immediately in the setter because it can happen that
596
+ // the amount of tabs changes before the actual change detection runs.
597
+ const indexToSelect = this._indexToSelect = this._clampTabIndex(this._indexToSelect);
598
+ // If there is a change in selected index, emit a change event. Should not trigger if
599
+ // the selected index has not yet been initialized.
600
+ if (this._selectedIndex != indexToSelect) {
601
+ const isFirstRun = this._selectedIndex == null;
602
+ if (!isFirstRun) {
603
+ this.selectedTabChange.emit(this._createChangeEvent(indexToSelect));
590
604
  }
591
- this._backgroundColor = value;
592
- }
593
- /**
594
- * After the content is checked, this component knows what tabs have been defined
595
- * and what the selected index should be. This is where we can know exactly what position
596
- * each tab should be in according to the new selected index, and additionally we know how
597
- * a new selected tab should transition in (from the left or right).
598
- */
599
- ngAfterContentChecked() {
600
- // Don't clamp the `indexToSelect` immediately in the setter because it can happen that
601
- // the amount of tabs changes before the actual change detection runs.
602
- const indexToSelect = this._indexToSelect = this._clampTabIndex(this._indexToSelect);
603
- // If there is a change in selected index, emit a change event. Should not trigger if
604
- // the selected index has not yet been initialized.
605
- if (this._selectedIndex != indexToSelect) {
606
- const isFirstRun = this._selectedIndex == null;
605
+ // Changing these values after change detection has run
606
+ // since the checked content may contain references to them.
607
+ Promise.resolve().then(() => {
608
+ this._tabs.forEach((tab, index) => tab.isActive = index === indexToSelect);
607
609
  if (!isFirstRun) {
608
- this.selectedTabChange.emit(this._createChangeEvent(indexToSelect));
609
- }
610
- // Changing these values after change detection has run
611
- // since the checked content may contain references to them.
612
- Promise.resolve().then(() => {
613
- this._tabs.forEach((tab, index) => tab.isActive = index === indexToSelect);
614
- if (!isFirstRun) {
615
- this.selectedIndexChange.emit(indexToSelect);
616
- }
617
- });
618
- }
619
- // Setup the position for each tab and optionally setup an origin on the next selected tab.
620
- this._tabs.forEach((tab, index) => {
621
- tab.position = index - indexToSelect;
622
- // If there is already a selected tab, then set up an origin for the next selected tab
623
- // if it doesn't have one already.
624
- if (this._selectedIndex != null && tab.position == 0 && !tab.origin) {
625
- tab.origin = indexToSelect - this._selectedIndex;
610
+ this.selectedIndexChange.emit(indexToSelect);
626
611
  }
627
612
  });
628
- if (this._selectedIndex !== indexToSelect) {
629
- this._selectedIndex = indexToSelect;
630
- this._changeDetectorRef.markForCheck();
613
+ }
614
+ // Setup the position for each tab and optionally setup an origin on the next selected tab.
615
+ this._tabs.forEach((tab, index) => {
616
+ tab.position = index - indexToSelect;
617
+ // If there is already a selected tab, then set up an origin for the next selected tab
618
+ // if it doesn't have one already.
619
+ if (this._selectedIndex != null && tab.position == 0 && !tab.origin) {
620
+ tab.origin = indexToSelect - this._selectedIndex;
631
621
  }
622
+ });
623
+ if (this._selectedIndex !== indexToSelect) {
624
+ this._selectedIndex = indexToSelect;
625
+ this._changeDetectorRef.markForCheck();
632
626
  }
633
- ngAfterContentInit() {
634
- this._subscribeToAllTabChanges();
635
- this._subscribeToTabLabels();
636
- // Subscribe to changes in the amount of tabs, in order to be
637
- // able to re-render the content as new tabs are added or removed.
638
- this._tabsSubscription = this._tabs.changes.subscribe(() => {
639
- const indexToSelect = this._clampTabIndex(this._indexToSelect);
640
- // Maintain the previously-selected tab if a new tab is added or removed and there is no
641
- // explicit change that selects a different tab.
642
- if (indexToSelect === this._selectedIndex) {
643
- const tabs = this._tabs.toArray();
644
- for (let i = 0; i < tabs.length; i++) {
645
- if (tabs[i].isActive) {
646
- // Assign both to the `_indexToSelect` and `_selectedIndex` so we don't fire a changed
647
- // event, otherwise the consumer may end up in an infinite loop in some edge cases like
648
- // adding a tab within the `selectedIndexChange` event.
649
- this._indexToSelect = this._selectedIndex = i;
650
- break;
651
- }
627
+ }
628
+ ngAfterContentInit() {
629
+ this._subscribeToAllTabChanges();
630
+ this._subscribeToTabLabels();
631
+ // Subscribe to changes in the amount of tabs, in order to be
632
+ // able to re-render the content as new tabs are added or removed.
633
+ this._tabsSubscription = this._tabs.changes.subscribe(() => {
634
+ const indexToSelect = this._clampTabIndex(this._indexToSelect);
635
+ // Maintain the previously-selected tab if a new tab is added or removed and there is no
636
+ // explicit change that selects a different tab.
637
+ if (indexToSelect === this._selectedIndex) {
638
+ const tabs = this._tabs.toArray();
639
+ for (let i = 0; i < tabs.length; i++) {
640
+ if (tabs[i].isActive) {
641
+ // Assign both to the `_indexToSelect` and `_selectedIndex` so we don't fire a changed
642
+ // event, otherwise the consumer may end up in an infinite loop in some edge cases like
643
+ // adding a tab within the `selectedIndexChange` event.
644
+ this._indexToSelect = this._selectedIndex = i;
645
+ break;
652
646
  }
653
647
  }
654
- this._changeDetectorRef.markForCheck();
655
- });
656
- }
657
- /** Listens to changes in all of the tabs. */
658
- _subscribeToAllTabChanges() {
659
- // Since we use a query with `descendants: true` to pick up the tabs, we may end up catching
660
- // some that are inside of nested tab groups. We filter them out manually by checking that
661
- // the closest group to the tab is the current one.
662
- this._allTabs.changes
663
- .pipe(startWith(this._allTabs))
664
- .subscribe((tabs) => {
665
- this._tabs.reset(tabs.filter(tab => {
666
- // @breaking-change 10.0.0 Remove null check for `_closestTabGroup`
667
- // once it becomes a required parameter in MatTab.
668
- return !tab._closestTabGroup || tab._closestTabGroup === this;
669
- }));
670
- this._tabs.notifyOnChanges();
671
- });
672
- }
673
- ngOnDestroy() {
674
- this._tabs.destroy();
675
- this._tabsSubscription.unsubscribe();
676
- this._tabLabelSubscription.unsubscribe();
677
- }
678
- /** Re-aligns the ink bar to the selected tab element. */
679
- realignInkBar() {
680
- if (this._tabHeader) {
681
- this._tabHeader._alignInkBarToSelectedTab();
682
- }
683
- }
684
- _focusChanged(index) {
685
- this.focusChange.emit(this._createChangeEvent(index));
686
- }
687
- _createChangeEvent(index) {
688
- const event = new MatTabChangeEvent;
689
- event.index = index;
690
- if (this._tabs && this._tabs.length) {
691
- event.tab = this._tabs.toArray()[index];
692
648
  }
693
- return event;
694
- }
695
- /**
696
- * Subscribes to changes in the tab labels. This is needed, because the @Input for the label is
697
- * on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
698
- * binding to be updated, we need to subscribe to changes in it and trigger change detection
699
- * manually.
700
- */
701
- _subscribeToTabLabels() {
702
- if (this._tabLabelSubscription) {
703
- this._tabLabelSubscription.unsubscribe();
704
- }
705
- this._tabLabelSubscription = merge(...this._tabs.map(tab => tab._stateChanges))
706
- .subscribe(() => this._changeDetectorRef.markForCheck());
707
- }
708
- /** Clamps the given index to the bounds of 0 and the tabs length. */
709
- _clampTabIndex(index) {
710
- // Note the `|| 0`, which ensures that values like NaN can't get through
711
- // and which would otherwise throw the component into an infinite loop
712
- // (since Math.max(NaN, 0) === NaN).
713
- return Math.min(this._tabs.length - 1, Math.max(index || 0, 0));
714
- }
715
- /** Returns a unique id for each tab label element */
716
- _getTabLabelId(i) {
717
- return `mat-tab-label-${this._groupId}-${i}`;
649
+ this._changeDetectorRef.markForCheck();
650
+ });
651
+ }
652
+ /** Listens to changes in all of the tabs. */
653
+ _subscribeToAllTabChanges() {
654
+ // Since we use a query with `descendants: true` to pick up the tabs, we may end up catching
655
+ // some that are inside of nested tab groups. We filter them out manually by checking that
656
+ // the closest group to the tab is the current one.
657
+ this._allTabs.changes
658
+ .pipe(startWith(this._allTabs))
659
+ .subscribe((tabs) => {
660
+ this._tabs.reset(tabs.filter(tab => {
661
+ // @breaking-change 10.0.0 Remove null check for `_closestTabGroup`
662
+ // once it becomes a required parameter in MatTab.
663
+ return !tab._closestTabGroup || tab._closestTabGroup === this;
664
+ }));
665
+ this._tabs.notifyOnChanges();
666
+ });
667
+ }
668
+ ngOnDestroy() {
669
+ this._tabs.destroy();
670
+ this._tabsSubscription.unsubscribe();
671
+ this._tabLabelSubscription.unsubscribe();
672
+ }
673
+ /** Re-aligns the ink bar to the selected tab element. */
674
+ realignInkBar() {
675
+ if (this._tabHeader) {
676
+ this._tabHeader._alignInkBarToSelectedTab();
718
677
  }
719
- /** Returns a unique id for each tab content element */
720
- _getTabContentId(i) {
721
- return `mat-tab-content-${this._groupId}-${i}`;
678
+ }
679
+ _focusChanged(index) {
680
+ this.focusChange.emit(this._createChangeEvent(index));
681
+ }
682
+ _createChangeEvent(index) {
683
+ const event = new MatTabChangeEvent;
684
+ event.index = index;
685
+ if (this._tabs && this._tabs.length) {
686
+ event.tab = this._tabs.toArray()[index];
722
687
  }
723
- /**
724
- * Sets the height of the body wrapper to the height of the activating tab if dynamic
725
- * height property is true.
726
- */
727
- _setTabBodyWrapperHeight(tabHeight) {
728
- if (!this._dynamicHeight || !this._tabBodyWrapperHeight) {
729
- return;
730
- }
731
- const wrapper = this._tabBodyWrapper.nativeElement;
732
- wrapper.style.height = this._tabBodyWrapperHeight + 'px';
733
- // This conditional forces the browser to paint the height so that
734
- // the animation to the new height can have an origin.
735
- if (this._tabBodyWrapper.nativeElement.offsetHeight) {
736
- wrapper.style.height = tabHeight + 'px';
737
- }
688
+ return event;
689
+ }
690
+ /**
691
+ * Subscribes to changes in the tab labels. This is needed, because the @Input for the label is
692
+ * on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
693
+ * binding to be updated, we need to subscribe to changes in it and trigger change detection
694
+ * manually.
695
+ */
696
+ _subscribeToTabLabels() {
697
+ if (this._tabLabelSubscription) {
698
+ this._tabLabelSubscription.unsubscribe();
738
699
  }
739
- /** Removes the height of the tab body wrapper. */
740
- _removeTabBodyWrapperHeight() {
741
- const wrapper = this._tabBodyWrapper.nativeElement;
742
- this._tabBodyWrapperHeight = wrapper.clientHeight;
743
- wrapper.style.height = '';
744
- this.animationDone.emit();
700
+ this._tabLabelSubscription = merge(...this._tabs.map(tab => tab._stateChanges))
701
+ .subscribe(() => this._changeDetectorRef.markForCheck());
702
+ }
703
+ /** Clamps the given index to the bounds of 0 and the tabs length. */
704
+ _clampTabIndex(index) {
705
+ // Note the `|| 0`, which ensures that values like NaN can't get through
706
+ // and which would otherwise throw the component into an infinite loop
707
+ // (since Math.max(NaN, 0) === NaN).
708
+ return Math.min(this._tabs.length - 1, Math.max(index || 0, 0));
709
+ }
710
+ /** Returns a unique id for each tab label element */
711
+ _getTabLabelId(i) {
712
+ return `mat-tab-label-${this._groupId}-${i}`;
713
+ }
714
+ /** Returns a unique id for each tab content element */
715
+ _getTabContentId(i) {
716
+ return `mat-tab-content-${this._groupId}-${i}`;
717
+ }
718
+ /**
719
+ * Sets the height of the body wrapper to the height of the activating tab if dynamic
720
+ * height property is true.
721
+ */
722
+ _setTabBodyWrapperHeight(tabHeight) {
723
+ if (!this._dynamicHeight || !this._tabBodyWrapperHeight) {
724
+ return;
725
+ }
726
+ const wrapper = this._tabBodyWrapper.nativeElement;
727
+ wrapper.style.height = this._tabBodyWrapperHeight + 'px';
728
+ // This conditional forces the browser to paint the height so that
729
+ // the animation to the new height can have an origin.
730
+ if (this._tabBodyWrapper.nativeElement.offsetHeight) {
731
+ wrapper.style.height = tabHeight + 'px';
745
732
  }
746
- /** Handle click events, setting new selected index if appropriate. */
747
- _handleClick(tab, tabHeader, index) {
748
- if (!tab.disabled) {
749
- this.selectedIndex = tabHeader.focusIndex = index;
750
- }
733
+ }
734
+ /** Removes the height of the tab body wrapper. */
735
+ _removeTabBodyWrapperHeight() {
736
+ const wrapper = this._tabBodyWrapper.nativeElement;
737
+ this._tabBodyWrapperHeight = wrapper.clientHeight;
738
+ wrapper.style.height = '';
739
+ this.animationDone.emit();
740
+ }
741
+ /** Handle click events, setting new selected index if appropriate. */
742
+ _handleClick(tab, tabHeader, index) {
743
+ if (!tab.disabled) {
744
+ this.selectedIndex = tabHeader.focusIndex = index;
751
745
  }
752
- /** Retrieves the tabindex for the tab. */
753
- _getTabIndex(tab, idx) {
754
- if (tab.disabled) {
755
- return null;
756
- }
757
- return this.selectedIndex === idx ? 0 : -1;
746
+ }
747
+ /** Retrieves the tabindex for the tab. */
748
+ _getTabIndex(tab, idx) {
749
+ if (tab.disabled) {
750
+ return null;
758
751
  }
752
+ return this.selectedIndex === idx ? 0 : -1;
759
753
  }
760
- _MatTabGroupBase.decorators = [
761
- { type: Directive }
762
- ];
763
- _MatTabGroupBase.ctorParameters = () => [
764
- { type: ElementRef },
765
- { type: ChangeDetectorRef },
766
- { type: undefined, decorators: [{ type: Inject, args: [MAT_TABS_CONFIG,] }, { type: Optional }] },
767
- { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
768
- ];
769
- _MatTabGroupBase.propDecorators = {
770
- dynamicHeight: [{ type: Input }],
771
- selectedIndex: [{ type: Input }],
772
- headerPosition: [{ type: Input }],
773
- animationDuration: [{ type: Input }],
774
- disablePagination: [{ type: Input }],
775
- backgroundColor: [{ type: Input }],
776
- selectedIndexChange: [{ type: Output }],
777
- focusChange: [{ type: Output }],
778
- animationDone: [{ type: Output }],
779
- selectedTabChange: [{ type: Output }]
780
- };
781
- return _MatTabGroupBase;
782
- })();
754
+ }
755
+ _MatTabGroupBase.decorators = [
756
+ { type: Directive }
757
+ ];
758
+ _MatTabGroupBase.ctorParameters = () => [
759
+ { type: ElementRef },
760
+ { type: ChangeDetectorRef },
761
+ { type: undefined, decorators: [{ type: Inject, args: [MAT_TABS_CONFIG,] }, { type: Optional }] },
762
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
763
+ ];
764
+ _MatTabGroupBase.propDecorators = {
765
+ dynamicHeight: [{ type: Input }],
766
+ selectedIndex: [{ type: Input }],
767
+ headerPosition: [{ type: Input }],
768
+ animationDuration: [{ type: Input }],
769
+ disablePagination: [{ type: Input }],
770
+ backgroundColor: [{ type: Input }],
771
+ selectedIndexChange: [{ type: Output }],
772
+ focusChange: [{ type: Output }],
773
+ animationDone: [{ type: Output }],
774
+ selectedTabChange: [{ type: Output }]
775
+ };
783
776
  /**
784
777
  * Material design tab-group component. Supports basic tab pairs (label + content) and includes
785
778
  * animated ink-bar, keyboard navigation, and screen reader.
786
779
  * See: https://material.io/design/components/tabs.html
787
780
  */
788
- let MatTabGroup = /** @class */ (() => {
789
- class MatTabGroup extends _MatTabGroupBase {
790
- constructor(elementRef, changeDetectorRef, defaultConfig, animationMode) {
791
- super(elementRef, changeDetectorRef, defaultConfig, animationMode);
792
- }
781
+ class MatTabGroup extends _MatTabGroupBase {
782
+ constructor(elementRef, changeDetectorRef, defaultConfig, animationMode) {
783
+ super(elementRef, changeDetectorRef, defaultConfig, animationMode);
793
784
  }
794
- MatTabGroup.decorators = [
795
- { type: Component, args: [{
796
- selector: 'mat-tab-group',
797
- exportAs: 'matTabGroup',
798
- template: "<mat-tab-header #tabHeader\n [selectedIndex]=\"selectedIndex || 0\"\n [disableRipple]=\"disableRipple\"\n [disablePagination]=\"disablePagination\"\n (indexFocused)=\"_focusChanged($event)\"\n (selectFocusedIndex)=\"selectedIndex = $event\">\n <div class=\"mat-tab-label mat-focus-indicator\" role=\"tab\" matTabLabelWrapper mat-ripple cdkMonitorElementFocus\n *ngFor=\"let tab of _tabs; let i = index\"\n [id]=\"_getTabLabelId(i)\"\n [attr.tabIndex]=\"_getTabIndex(tab, i)\"\n [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"_tabs.length\"\n [attr.aria-controls]=\"_getTabContentId(i)\"\n [attr.aria-selected]=\"selectedIndex == i\"\n [attr.aria-label]=\"tab.ariaLabel || null\"\n [attr.aria-labelledby]=\"(!tab.ariaLabel && tab.ariaLabelledby) ? tab.ariaLabelledby : null\"\n [class.mat-tab-label-active]=\"selectedIndex == i\"\n [disabled]=\"tab.disabled\"\n [matRippleDisabled]=\"tab.disabled || disableRipple\"\n (click)=\"_handleClick(tab, tabHeader, i)\">\n\n\n <div class=\"mat-tab-label-content\">\n <!-- If there is a label template, use it. -->\n <ng-template [ngIf]=\"tab.templateLabel\">\n <ng-template [cdkPortalOutlet]=\"tab.templateLabel\"></ng-template>\n </ng-template>\n\n <!-- If there is not a label template, fall back to the text label. -->\n <ng-template [ngIf]=\"!tab.templateLabel\">{{tab.textLabel}}</ng-template>\n </div>\n </div>\n</mat-tab-header>\n\n<div\n class=\"mat-tab-body-wrapper\"\n [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\"\n #tabBodyWrapper>\n <mat-tab-body role=\"tabpanel\"\n *ngFor=\"let tab of _tabs; let i = index\"\n [id]=\"_getTabContentId(i)\"\n [attr.aria-labelledby]=\"_getTabLabelId(i)\"\n [class.mat-tab-body-active]=\"selectedIndex == i\"\n [content]=\"tab.content!\"\n [position]=\"tab.position!\"\n [origin]=\"tab.origin\"\n [animationDuration]=\"animationDuration\"\n (_onCentered)=\"_removeTabBodyWrapperHeight()\"\n (_onCentering)=\"_setTabBodyWrapperHeight($event)\">\n </mat-tab-body>\n</div>\n",
799
- encapsulation: ViewEncapsulation.None,
800
- // tslint:disable-next-line:validate-decorators
801
- changeDetection: ChangeDetectionStrategy.Default,
802
- inputs: ['color', 'disableRipple'],
803
- providers: [{
804
- provide: MAT_TAB_GROUP,
805
- useExisting: MatTabGroup
806
- }],
807
- host: {
808
- 'class': 'mat-tab-group',
809
- '[class.mat-tab-group-dynamic-height]': 'dynamicHeight',
810
- '[class.mat-tab-group-inverted-header]': 'headerPosition === "below"',
811
- },
812
- styles: [".mat-tab-group{display:flex;flex-direction:column}.mat-tab-group.mat-tab-group-inverted-header{flex-direction:column-reverse}.mat-tab-label{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;position:relative}.mat-tab-label:focus{outline:none}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-label:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-label.mat-tab-disabled{cursor:default}.cdk-high-contrast-active .mat-tab-label.mat-tab-disabled{opacity:.5}.mat-tab-label .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.cdk-high-contrast-active .mat-tab-label{opacity:1}@media(max-width: 599px){.mat-tab-label{padding:0 12px}}@media(max-width: 959px){.mat-tab-label{padding:0 12px}}.mat-tab-group[mat-stretch-tabs]>.mat-tab-header .mat-tab-label{flex-basis:0;flex-grow:1}.mat-tab-body-wrapper{position:relative;overflow:hidden;display:flex;transition:height 500ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable.mat-tab-body-wrapper{transition:none;animation:none}.mat-tab-body{top:0;left:0;right:0;bottom:0;position:absolute;display:block;overflow:hidden;flex-basis:100%}.mat-tab-body.mat-tab-body-active{position:relative;overflow-x:hidden;overflow-y:auto;z-index:1;flex-grow:1}.mat-tab-group.mat-tab-group-dynamic-height .mat-tab-body.mat-tab-body-active{overflow-y:hidden}\n"]
813
- },] }
814
- ];
815
- MatTabGroup.ctorParameters = () => [
816
- { type: ElementRef },
817
- { type: ChangeDetectorRef },
818
- { type: undefined, decorators: [{ type: Inject, args: [MAT_TABS_CONFIG,] }, { type: Optional }] },
819
- { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
820
- ];
821
- MatTabGroup.propDecorators = {
822
- _allTabs: [{ type: ContentChildren, args: [MatTab, { descendants: true },] }],
823
- _tabBodyWrapper: [{ type: ViewChild, args: ['tabBodyWrapper',] }],
824
- _tabHeader: [{ type: ViewChild, args: ['tabHeader',] }]
825
- };
826
- return MatTabGroup;
827
- })();
785
+ }
786
+ MatTabGroup.decorators = [
787
+ { type: Component, args: [{
788
+ selector: 'mat-tab-group',
789
+ exportAs: 'matTabGroup',
790
+ template: "<mat-tab-header #tabHeader\n [selectedIndex]=\"selectedIndex || 0\"\n [disableRipple]=\"disableRipple\"\n [disablePagination]=\"disablePagination\"\n (indexFocused)=\"_focusChanged($event)\"\n (selectFocusedIndex)=\"selectedIndex = $event\">\n <div class=\"mat-tab-label mat-focus-indicator\" role=\"tab\" matTabLabelWrapper mat-ripple cdkMonitorElementFocus\n *ngFor=\"let tab of _tabs; let i = index\"\n [id]=\"_getTabLabelId(i)\"\n [attr.tabIndex]=\"_getTabIndex(tab, i)\"\n [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"_tabs.length\"\n [attr.aria-controls]=\"_getTabContentId(i)\"\n [attr.aria-selected]=\"selectedIndex == i\"\n [attr.aria-label]=\"tab.ariaLabel || null\"\n [attr.aria-labelledby]=\"(!tab.ariaLabel && tab.ariaLabelledby) ? tab.ariaLabelledby : null\"\n [class.mat-tab-label-active]=\"selectedIndex == i\"\n [disabled]=\"tab.disabled\"\n [matRippleDisabled]=\"tab.disabled || disableRipple\"\n (click)=\"_handleClick(tab, tabHeader, i)\">\n\n\n <div class=\"mat-tab-label-content\">\n <!-- If there is a label template, use it. -->\n <ng-template [ngIf]=\"tab.templateLabel\">\n <ng-template [cdkPortalOutlet]=\"tab.templateLabel\"></ng-template>\n </ng-template>\n\n <!-- If there is not a label template, fall back to the text label. -->\n <ng-template [ngIf]=\"!tab.templateLabel\">{{tab.textLabel}}</ng-template>\n </div>\n </div>\n</mat-tab-header>\n\n<div\n class=\"mat-tab-body-wrapper\"\n [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\"\n #tabBodyWrapper>\n <mat-tab-body role=\"tabpanel\"\n *ngFor=\"let tab of _tabs; let i = index\"\n [id]=\"_getTabContentId(i)\"\n [attr.aria-labelledby]=\"_getTabLabelId(i)\"\n [class.mat-tab-body-active]=\"selectedIndex == i\"\n [content]=\"tab.content!\"\n [position]=\"tab.position!\"\n [origin]=\"tab.origin\"\n [animationDuration]=\"animationDuration\"\n (_onCentered)=\"_removeTabBodyWrapperHeight()\"\n (_onCentering)=\"_setTabBodyWrapperHeight($event)\">\n </mat-tab-body>\n</div>\n",
791
+ encapsulation: ViewEncapsulation.None,
792
+ // tslint:disable-next-line:validate-decorators
793
+ changeDetection: ChangeDetectionStrategy.Default,
794
+ inputs: ['color', 'disableRipple'],
795
+ providers: [{
796
+ provide: MAT_TAB_GROUP,
797
+ useExisting: MatTabGroup
798
+ }],
799
+ host: {
800
+ 'class': 'mat-tab-group',
801
+ '[class.mat-tab-group-dynamic-height]': 'dynamicHeight',
802
+ '[class.mat-tab-group-inverted-header]': 'headerPosition === "below"',
803
+ },
804
+ styles: [".mat-tab-group{display:flex;flex-direction:column}.mat-tab-group.mat-tab-group-inverted-header{flex-direction:column-reverse}.mat-tab-label{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;position:relative}.mat-tab-label:focus{outline:none}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-label:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-label.mat-tab-disabled{cursor:default}.cdk-high-contrast-active .mat-tab-label.mat-tab-disabled{opacity:.5}.mat-tab-label .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.cdk-high-contrast-active .mat-tab-label{opacity:1}@media(max-width: 599px){.mat-tab-label{padding:0 12px}}@media(max-width: 959px){.mat-tab-label{padding:0 12px}}.mat-tab-group[mat-stretch-tabs]>.mat-tab-header .mat-tab-label{flex-basis:0;flex-grow:1}.mat-tab-body-wrapper{position:relative;overflow:hidden;display:flex;transition:height 500ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable.mat-tab-body-wrapper{transition:none;animation:none}.mat-tab-body{top:0;left:0;right:0;bottom:0;position:absolute;display:block;overflow:hidden;flex-basis:100%}.mat-tab-body.mat-tab-body-active{position:relative;overflow-x:hidden;overflow-y:auto;z-index:1;flex-grow:1}.mat-tab-group.mat-tab-group-dynamic-height .mat-tab-body.mat-tab-body-active{overflow-y:hidden}\n"]
805
+ },] }
806
+ ];
807
+ MatTabGroup.ctorParameters = () => [
808
+ { type: ElementRef },
809
+ { type: ChangeDetectorRef },
810
+ { type: undefined, decorators: [{ type: Inject, args: [MAT_TABS_CONFIG,] }, { type: Optional }] },
811
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
812
+ ];
813
+ MatTabGroup.propDecorators = {
814
+ _allTabs: [{ type: ContentChildren, args: [MatTab, { descendants: true },] }],
815
+ _tabBodyWrapper: [{ type: ViewChild, args: ['tabBodyWrapper',] }],
816
+ _tabHeader: [{ type: ViewChild, args: ['tabHeader',] }]
817
+ };
828
818
 
829
819
  /**
830
820
  * @license
@@ -842,38 +832,35 @@ const _MatTabLabelWrapperMixinBase = mixinDisabled(MatTabLabelWrapperBase);
842
832
  * Used in the `mat-tab-group` view to display tab labels.
843
833
  * @docs-private
844
834
  */
845
- let MatTabLabelWrapper = /** @class */ (() => {
846
- class MatTabLabelWrapper extends _MatTabLabelWrapperMixinBase {
847
- constructor(elementRef) {
848
- super();
849
- this.elementRef = elementRef;
850
- }
851
- /** Sets focus on the wrapper element */
852
- focus() {
853
- this.elementRef.nativeElement.focus();
854
- }
855
- getOffsetLeft() {
856
- return this.elementRef.nativeElement.offsetLeft;
857
- }
858
- getOffsetWidth() {
859
- return this.elementRef.nativeElement.offsetWidth;
860
- }
835
+ class MatTabLabelWrapper extends _MatTabLabelWrapperMixinBase {
836
+ constructor(elementRef) {
837
+ super();
838
+ this.elementRef = elementRef;
861
839
  }
862
- MatTabLabelWrapper.decorators = [
863
- { type: Directive, args: [{
864
- selector: '[matTabLabelWrapper]',
865
- inputs: ['disabled'],
866
- host: {
867
- '[class.mat-tab-disabled]': 'disabled',
868
- '[attr.aria-disabled]': '!!disabled',
869
- }
870
- },] }
871
- ];
872
- MatTabLabelWrapper.ctorParameters = () => [
873
- { type: ElementRef }
874
- ];
875
- return MatTabLabelWrapper;
876
- })();
840
+ /** Sets focus on the wrapper element */
841
+ focus() {
842
+ this.elementRef.nativeElement.focus();
843
+ }
844
+ getOffsetLeft() {
845
+ return this.elementRef.nativeElement.offsetLeft;
846
+ }
847
+ getOffsetWidth() {
848
+ return this.elementRef.nativeElement.offsetWidth;
849
+ }
850
+ }
851
+ MatTabLabelWrapper.decorators = [
852
+ { type: Directive, args: [{
853
+ selector: '[matTabLabelWrapper]',
854
+ inputs: ['disabled'],
855
+ host: {
856
+ '[class.mat-tab-disabled]': 'disabled',
857
+ '[attr.aria-disabled]': '!!disabled',
858
+ }
859
+ },] }
860
+ ];
861
+ MatTabLabelWrapper.ctorParameters = () => [
862
+ { type: ElementRef }
863
+ ];
877
864
 
878
865
  /**
879
866
  * @license
@@ -903,459 +890,456 @@ const HEADER_SCROLL_INTERVAL = 100;
903
890
  * Base class for a tab header that supported pagination.
904
891
  * @docs-private
905
892
  */
906
- let MatPaginatedTabHeader = /** @class */ (() => {
907
- class MatPaginatedTabHeader {
908
- constructor(_elementRef, _changeDetectorRef, _viewportRuler, _dir, _ngZone,
893
+ class MatPaginatedTabHeader {
894
+ constructor(_elementRef, _changeDetectorRef, _viewportRuler, _dir, _ngZone,
895
+ /**
896
+ * @deprecated @breaking-change 9.0.0 `_platform` and `_animationMode`
897
+ * parameters to become required.
898
+ */
899
+ _platform, _animationMode) {
900
+ this._elementRef = _elementRef;
901
+ this._changeDetectorRef = _changeDetectorRef;
902
+ this._viewportRuler = _viewportRuler;
903
+ this._dir = _dir;
904
+ this._ngZone = _ngZone;
905
+ this._platform = _platform;
906
+ this._animationMode = _animationMode;
907
+ /** The distance in pixels that the tab labels should be translated to the left. */
908
+ this._scrollDistance = 0;
909
+ /** Whether the header should scroll to the selected index after the view has been checked. */
910
+ this._selectedIndexChanged = false;
911
+ /** Emits when the component is destroyed. */
912
+ this._destroyed = new Subject();
913
+ /** Whether the controls for pagination should be displayed */
914
+ this._showPaginationControls = false;
915
+ /** Whether the tab list can be scrolled more towards the end of the tab label list. */
916
+ this._disableScrollAfter = true;
917
+ /** Whether the tab list can be scrolled more towards the beginning of the tab label list. */
918
+ this._disableScrollBefore = true;
919
+ /** Stream that will stop the automated scrolling. */
920
+ this._stopScrolling = new Subject();
909
921
  /**
910
- * @deprecated @breaking-change 9.0.0 `_platform` and `_animationMode`
911
- * parameters to become required.
922
+ * Whether pagination should be disabled. This can be used to avoid unnecessary
923
+ * layout recalculations if it's known that pagination won't be required.
912
924
  */
913
- _platform, _animationMode) {
914
- this._elementRef = _elementRef;
915
- this._changeDetectorRef = _changeDetectorRef;
916
- this._viewportRuler = _viewportRuler;
917
- this._dir = _dir;
918
- this._ngZone = _ngZone;
919
- this._platform = _platform;
920
- this._animationMode = _animationMode;
921
- /** The distance in pixels that the tab labels should be translated to the left. */
922
- this._scrollDistance = 0;
923
- /** Whether the header should scroll to the selected index after the view has been checked. */
924
- this._selectedIndexChanged = false;
925
- /** Emits when the component is destroyed. */
926
- this._destroyed = new Subject();
927
- /** Whether the controls for pagination should be displayed */
928
- this._showPaginationControls = false;
929
- /** Whether the tab list can be scrolled more towards the end of the tab label list. */
930
- this._disableScrollAfter = true;
931
- /** Whether the tab list can be scrolled more towards the beginning of the tab label list. */
932
- this._disableScrollBefore = true;
933
- /** Stream that will stop the automated scrolling. */
934
- this._stopScrolling = new Subject();
935
- /**
936
- * Whether pagination should be disabled. This can be used to avoid unnecessary
937
- * layout recalculations if it's known that pagination won't be required.
938
- */
939
- this.disablePagination = false;
940
- this._selectedIndex = 0;
941
- /** Event emitted when the option is selected. */
942
- this.selectFocusedIndex = new EventEmitter();
943
- /** Event emitted when a label is focused. */
944
- this.indexFocused = new EventEmitter();
945
- // Bind the `mouseleave` event on the outside since it doesn't change anything in the view.
946
- _ngZone.runOutsideAngular(() => {
947
- fromEvent(_elementRef.nativeElement, 'mouseleave')
948
- .pipe(takeUntil(this._destroyed))
949
- .subscribe(() => {
950
- this._stopInterval();
951
- });
952
- });
953
- }
954
- /** The index of the active tab. */
955
- get selectedIndex() { return this._selectedIndex; }
956
- set selectedIndex(value) {
957
- value = coerceNumberProperty(value);
958
- if (this._selectedIndex != value) {
959
- this._selectedIndexChanged = true;
960
- this._selectedIndex = value;
961
- if (this._keyManager) {
962
- this._keyManager.updateActiveItem(value);
963
- }
964
- }
965
- }
966
- ngAfterViewInit() {
967
- // We need to handle these events manually, because we want to bind passive event listeners.
968
- fromEvent(this._previousPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
925
+ this.disablePagination = false;
926
+ this._selectedIndex = 0;
927
+ /** Event emitted when the option is selected. */
928
+ this.selectFocusedIndex = new EventEmitter();
929
+ /** Event emitted when a label is focused. */
930
+ this.indexFocused = new EventEmitter();
931
+ // Bind the `mouseleave` event on the outside since it doesn't change anything in the view.
932
+ _ngZone.runOutsideAngular(() => {
933
+ fromEvent(_elementRef.nativeElement, 'mouseleave')
969
934
  .pipe(takeUntil(this._destroyed))
970
935
  .subscribe(() => {
971
- this._handlePaginatorPress('before');
972
- });
973
- fromEvent(this._nextPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
974
- .pipe(takeUntil(this._destroyed))
975
- .subscribe(() => {
976
- this._handlePaginatorPress('after');
977
- });
978
- }
979
- ngAfterContentInit() {
980
- const dirChange = this._dir ? this._dir.change : of(null);
981
- const resize = this._viewportRuler.change(150);
982
- const realign = () => {
983
- this.updatePagination();
984
- this._alignInkBarToSelectedTab();
985
- };
986
- this._keyManager = new FocusKeyManager(this._items)
987
- .withHorizontalOrientation(this._getLayoutDirection())
988
- .withWrap();
989
- this._keyManager.updateActiveItem(0);
990
- // Defer the first call in order to allow for slower browsers to lay out the elements.
991
- // This helps in cases where the user lands directly on a page with paginated tabs.
992
- typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(realign) : realign();
993
- // On dir change or window resize, realign the ink bar and update the orientation of
994
- // the key manager if the direction has changed.
995
- merge(dirChange, resize, this._items.changes).pipe(takeUntil(this._destroyed)).subscribe(() => {
996
- // We need to defer this to give the browser some time to recalculate the element dimensions.
997
- Promise.resolve().then(realign);
998
- this._keyManager.withHorizontalOrientation(this._getLayoutDirection());
936
+ this._stopInterval();
999
937
  });
1000
- // If there is a change in the focus key manager we need to emit the `indexFocused`
1001
- // event in order to provide a public event that notifies about focus changes. Also we realign
1002
- // the tabs container by scrolling the new focused tab into the visible section.
1003
- this._keyManager.change.pipe(takeUntil(this._destroyed)).subscribe(newFocusIndex => {
1004
- this.indexFocused.emit(newFocusIndex);
1005
- this._setTabFocus(newFocusIndex);
1006
- });
1007
- }
1008
- ngAfterContentChecked() {
1009
- // If the number of tab labels have changed, check if scrolling should be enabled
1010
- if (this._tabLabelCount != this._items.length) {
1011
- this.updatePagination();
1012
- this._tabLabelCount = this._items.length;
1013
- this._changeDetectorRef.markForCheck();
1014
- }
1015
- // If the selected index has changed, scroll to the label and check if the scrolling controls
1016
- // should be disabled.
1017
- if (this._selectedIndexChanged) {
1018
- this._scrollToLabel(this._selectedIndex);
1019
- this._checkScrollingControls();
1020
- this._alignInkBarToSelectedTab();
1021
- this._selectedIndexChanged = false;
1022
- this._changeDetectorRef.markForCheck();
1023
- }
1024
- // If the scroll distance has been changed (tab selected, focused, scroll controls activated),
1025
- // then translate the header to reflect this.
1026
- if (this._scrollDistanceChanged) {
1027
- this._updateTabScrollPosition();
1028
- this._scrollDistanceChanged = false;
1029
- this._changeDetectorRef.markForCheck();
1030
- }
1031
- }
1032
- ngOnDestroy() {
1033
- this._destroyed.next();
1034
- this._destroyed.complete();
1035
- this._stopScrolling.complete();
1036
- }
1037
- /** Handles keyboard events on the header. */
1038
- _handleKeydown(event) {
1039
- // We don't handle any key bindings with a modifier key.
1040
- if (hasModifierKey(event)) {
1041
- return;
1042
- }
1043
- switch (event.keyCode) {
1044
- case HOME:
1045
- this._keyManager.setFirstItemActive();
1046
- event.preventDefault();
1047
- break;
1048
- case END:
1049
- this._keyManager.setLastItemActive();
1050
- event.preventDefault();
1051
- break;
1052
- case ENTER:
1053
- case SPACE:
1054
- if (this.focusIndex !== this.selectedIndex) {
1055
- this.selectFocusedIndex.emit(this.focusIndex);
1056
- this._itemSelected(event);
1057
- }
1058
- break;
1059
- default:
1060
- this._keyManager.onKeydown(event);
1061
- }
1062
- }
1063
- /**
1064
- * Callback for when the MutationObserver detects that the content has changed.
1065
- */
1066
- _onContentChanges() {
1067
- const textContent = this._elementRef.nativeElement.textContent;
1068
- // We need to diff the text content of the header, because the MutationObserver callback
1069
- // will fire even if the text content didn't change which is inefficient and is prone
1070
- // to infinite loops if a poorly constructed expression is passed in (see #14249).
1071
- if (textContent !== this._currentTextContent) {
1072
- this._currentTextContent = textContent || '';
1073
- // The content observer runs outside the `NgZone` by default, which
1074
- // means that we need to bring the callback back in ourselves.
1075
- this._ngZone.run(() => {
1076
- this.updatePagination();
1077
- this._alignInkBarToSelectedTab();
1078
- this._changeDetectorRef.markForCheck();
1079
- });
938
+ });
939
+ }
940
+ /** The index of the active tab. */
941
+ get selectedIndex() { return this._selectedIndex; }
942
+ set selectedIndex(value) {
943
+ value = coerceNumberProperty(value);
944
+ if (this._selectedIndex != value) {
945
+ this._selectedIndexChanged = true;
946
+ this._selectedIndex = value;
947
+ if (this._keyManager) {
948
+ this._keyManager.updateActiveItem(value);
1080
949
  }
1081
950
  }
1082
- /**
1083
- * Updates the view whether pagination should be enabled or not.
1084
- *
1085
- * WARNING: Calling this method can be very costly in terms of performance. It should be called
1086
- * as infrequently as possible from outside of the Tabs component as it causes a reflow of the
1087
- * page.
1088
- */
1089
- updatePagination() {
1090
- this._checkPaginationEnabled();
951
+ }
952
+ ngAfterViewInit() {
953
+ // We need to handle these events manually, because we want to bind passive event listeners.
954
+ fromEvent(this._previousPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
955
+ .pipe(takeUntil(this._destroyed))
956
+ .subscribe(() => {
957
+ this._handlePaginatorPress('before');
958
+ });
959
+ fromEvent(this._nextPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
960
+ .pipe(takeUntil(this._destroyed))
961
+ .subscribe(() => {
962
+ this._handlePaginatorPress('after');
963
+ });
964
+ }
965
+ ngAfterContentInit() {
966
+ const dirChange = this._dir ? this._dir.change : of(null);
967
+ const resize = this._viewportRuler.change(150);
968
+ const realign = () => {
969
+ this.updatePagination();
970
+ this._alignInkBarToSelectedTab();
971
+ };
972
+ this._keyManager = new FocusKeyManager(this._items)
973
+ .withHorizontalOrientation(this._getLayoutDirection())
974
+ .withWrap();
975
+ this._keyManager.updateActiveItem(0);
976
+ // Defer the first call in order to allow for slower browsers to lay out the elements.
977
+ // This helps in cases where the user lands directly on a page with paginated tabs.
978
+ typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(realign) : realign();
979
+ // On dir change or window resize, realign the ink bar and update the orientation of
980
+ // the key manager if the direction has changed.
981
+ merge(dirChange, resize, this._items.changes).pipe(takeUntil(this._destroyed)).subscribe(() => {
982
+ // We need to defer this to give the browser some time to recalculate the element dimensions.
983
+ Promise.resolve().then(realign);
984
+ this._keyManager.withHorizontalOrientation(this._getLayoutDirection());
985
+ });
986
+ // If there is a change in the focus key manager we need to emit the `indexFocused`
987
+ // event in order to provide a public event that notifies about focus changes. Also we realign
988
+ // the tabs container by scrolling the new focused tab into the visible section.
989
+ this._keyManager.change.pipe(takeUntil(this._destroyed)).subscribe(newFocusIndex => {
990
+ this.indexFocused.emit(newFocusIndex);
991
+ this._setTabFocus(newFocusIndex);
992
+ });
993
+ }
994
+ ngAfterContentChecked() {
995
+ // If the number of tab labels have changed, check if scrolling should be enabled
996
+ if (this._tabLabelCount != this._items.length) {
997
+ this.updatePagination();
998
+ this._tabLabelCount = this._items.length;
999
+ this._changeDetectorRef.markForCheck();
1000
+ }
1001
+ // If the selected index has changed, scroll to the label and check if the scrolling controls
1002
+ // should be disabled.
1003
+ if (this._selectedIndexChanged) {
1004
+ this._scrollToLabel(this._selectedIndex);
1091
1005
  this._checkScrollingControls();
1092
- this._updateTabScrollPosition();
1093
- }
1094
- /** Tracks which element has focus; used for keyboard navigation */
1095
- get focusIndex() {
1096
- return this._keyManager ? this._keyManager.activeItemIndex : 0;
1097
- }
1098
- /** When the focus index is set, we must manually send focus to the correct label */
1099
- set focusIndex(value) {
1100
- if (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {
1101
- return;
1102
- }
1103
- this._keyManager.setActiveItem(value);
1006
+ this._alignInkBarToSelectedTab();
1007
+ this._selectedIndexChanged = false;
1008
+ this._changeDetectorRef.markForCheck();
1104
1009
  }
1105
- /**
1106
- * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
1107
- * providing a valid index and return true.
1108
- */
1109
- _isValidIndex(index) {
1110
- if (!this._items) {
1111
- return true;
1112
- }
1113
- const tab = this._items ? this._items.toArray()[index] : null;
1114
- return !!tab && !tab.disabled;
1010
+ // If the scroll distance has been changed (tab selected, focused, scroll controls activated),
1011
+ // then translate the header to reflect this.
1012
+ if (this._scrollDistanceChanged) {
1013
+ this._updateTabScrollPosition();
1014
+ this._scrollDistanceChanged = false;
1015
+ this._changeDetectorRef.markForCheck();
1115
1016
  }
1116
- /**
1117
- * Sets focus on the HTML element for the label wrapper and scrolls it into the view if
1118
- * scrolling is enabled.
1119
- */
1120
- _setTabFocus(tabIndex) {
1121
- if (this._showPaginationControls) {
1122
- this._scrollToLabel(tabIndex);
1123
- }
1124
- if (this._items && this._items.length) {
1125
- this._items.toArray()[tabIndex].focus();
1126
- // Do not let the browser manage scrolling to focus the element, this will be handled
1127
- // by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width
1128
- // should be the full width minus the offset width.
1129
- const containerEl = this._tabListContainer.nativeElement;
1130
- const dir = this._getLayoutDirection();
1131
- if (dir == 'ltr') {
1132
- containerEl.scrollLeft = 0;
1133
- }
1134
- else {
1135
- containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;
1017
+ }
1018
+ ngOnDestroy() {
1019
+ this._destroyed.next();
1020
+ this._destroyed.complete();
1021
+ this._stopScrolling.complete();
1022
+ }
1023
+ /** Handles keyboard events on the header. */
1024
+ _handleKeydown(event) {
1025
+ // We don't handle any key bindings with a modifier key.
1026
+ if (hasModifierKey(event)) {
1027
+ return;
1028
+ }
1029
+ switch (event.keyCode) {
1030
+ case HOME:
1031
+ this._keyManager.setFirstItemActive();
1032
+ event.preventDefault();
1033
+ break;
1034
+ case END:
1035
+ this._keyManager.setLastItemActive();
1036
+ event.preventDefault();
1037
+ break;
1038
+ case ENTER:
1039
+ case SPACE:
1040
+ if (this.focusIndex !== this.selectedIndex) {
1041
+ this.selectFocusedIndex.emit(this.focusIndex);
1042
+ this._itemSelected(event);
1136
1043
  }
1137
- }
1138
- }
1139
- /** The layout direction of the containing app. */
1140
- _getLayoutDirection() {
1141
- return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
1142
- }
1143
- /** Performs the CSS transformation on the tab list that will cause the list to scroll. */
1144
- _updateTabScrollPosition() {
1145
- if (this.disablePagination) {
1146
- return;
1147
- }
1148
- const scrollDistance = this.scrollDistance;
1149
- const platform = this._platform;
1150
- const translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
1151
- // Don't use `translate3d` here because we don't want to create a new layer. A new layer
1152
- // seems to cause flickering and overflow in Internet Explorer. For example, the ink bar
1153
- // and ripples will exceed the boundaries of the visible tab bar.
1154
- // See: https://github.com/angular/components/issues/10276
1155
- // We round the `transform` here, because transforms with sub-pixel precision cause some
1156
- // browsers to blur the content of the element.
1157
- this._tabList.nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;
1158
- // Setting the `transform` on IE will change the scroll offset of the parent, causing the
1159
- // position to be thrown off in some cases. We have to reset it ourselves to ensure that
1160
- // it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing
1161
- // with the scroll position throws off Chrome 71+ in RTL mode (see #14689).
1162
- // @breaking-change 9.0.0 Remove null check for `platform` after it can no longer be undefined.
1163
- if (platform && (platform.TRIDENT || platform.EDGE)) {
1164
- this._tabListContainer.nativeElement.scrollLeft = 0;
1165
- }
1044
+ break;
1045
+ default:
1046
+ this._keyManager.onKeydown(event);
1166
1047
  }
1167
- /** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
1168
- get scrollDistance() { return this._scrollDistance; }
1169
- set scrollDistance(value) {
1170
- this._scrollTo(value);
1171
- }
1172
- /**
1173
- * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
1174
- * the end of the list, respectively). The distance to scroll is computed to be a third of the
1175
- * length of the tab list view window.
1176
- *
1177
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1178
- * should be called sparingly.
1179
- */
1180
- _scrollHeader(direction) {
1181
- const viewLength = this._tabListContainer.nativeElement.offsetWidth;
1182
- // Move the scroll distance one-third the length of the tab list's viewport.
1183
- const scrollAmount = (direction == 'before' ? -1 : 1) * viewLength / 3;
1184
- return this._scrollTo(this._scrollDistance + scrollAmount);
1048
+ }
1049
+ /**
1050
+ * Callback for when the MutationObserver detects that the content has changed.
1051
+ */
1052
+ _onContentChanges() {
1053
+ const textContent = this._elementRef.nativeElement.textContent;
1054
+ // We need to diff the text content of the header, because the MutationObserver callback
1055
+ // will fire even if the text content didn't change which is inefficient and is prone
1056
+ // to infinite loops if a poorly constructed expression is passed in (see #14249).
1057
+ if (textContent !== this._currentTextContent) {
1058
+ this._currentTextContent = textContent || '';
1059
+ // The content observer runs outside the `NgZone` by default, which
1060
+ // means that we need to bring the callback back in ourselves.
1061
+ this._ngZone.run(() => {
1062
+ this.updatePagination();
1063
+ this._alignInkBarToSelectedTab();
1064
+ this._changeDetectorRef.markForCheck();
1065
+ });
1185
1066
  }
1186
- /** Handles click events on the pagination arrows. */
1187
- _handlePaginatorClick(direction) {
1188
- this._stopInterval();
1189
- this._scrollHeader(direction);
1067
+ }
1068
+ /**
1069
+ * Updates the view whether pagination should be enabled or not.
1070
+ *
1071
+ * WARNING: Calling this method can be very costly in terms of performance. It should be called
1072
+ * as infrequently as possible from outside of the Tabs component as it causes a reflow of the
1073
+ * page.
1074
+ */
1075
+ updatePagination() {
1076
+ this._checkPaginationEnabled();
1077
+ this._checkScrollingControls();
1078
+ this._updateTabScrollPosition();
1079
+ }
1080
+ /** Tracks which element has focus; used for keyboard navigation */
1081
+ get focusIndex() {
1082
+ return this._keyManager ? this._keyManager.activeItemIndex : 0;
1083
+ }
1084
+ /** When the focus index is set, we must manually send focus to the correct label */
1085
+ set focusIndex(value) {
1086
+ if (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {
1087
+ return;
1190
1088
  }
1191
- /**
1192
- * Moves the tab list such that the desired tab label (marked by index) is moved into view.
1193
- *
1194
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1195
- * should be called sparingly.
1196
- */
1197
- _scrollToLabel(labelIndex) {
1198
- if (this.disablePagination) {
1199
- return;
1200
- }
1201
- const selectedLabel = this._items ? this._items.toArray()[labelIndex] : null;
1202
- if (!selectedLabel) {
1203
- return;
1204
- }
1205
- // The view length is the visible width of the tab labels.
1206
- const viewLength = this._tabListContainer.nativeElement.offsetWidth;
1207
- const { offsetLeft, offsetWidth } = selectedLabel.elementRef.nativeElement;
1208
- let labelBeforePos, labelAfterPos;
1209
- if (this._getLayoutDirection() == 'ltr') {
1210
- labelBeforePos = offsetLeft;
1211
- labelAfterPos = labelBeforePos + offsetWidth;
1089
+ this._keyManager.setActiveItem(value);
1090
+ }
1091
+ /**
1092
+ * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
1093
+ * providing a valid index and return true.
1094
+ */
1095
+ _isValidIndex(index) {
1096
+ if (!this._items) {
1097
+ return true;
1098
+ }
1099
+ const tab = this._items ? this._items.toArray()[index] : null;
1100
+ return !!tab && !tab.disabled;
1101
+ }
1102
+ /**
1103
+ * Sets focus on the HTML element for the label wrapper and scrolls it into the view if
1104
+ * scrolling is enabled.
1105
+ */
1106
+ _setTabFocus(tabIndex) {
1107
+ if (this._showPaginationControls) {
1108
+ this._scrollToLabel(tabIndex);
1109
+ }
1110
+ if (this._items && this._items.length) {
1111
+ this._items.toArray()[tabIndex].focus();
1112
+ // Do not let the browser manage scrolling to focus the element, this will be handled
1113
+ // by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width
1114
+ // should be the full width minus the offset width.
1115
+ const containerEl = this._tabListContainer.nativeElement;
1116
+ const dir = this._getLayoutDirection();
1117
+ if (dir == 'ltr') {
1118
+ containerEl.scrollLeft = 0;
1212
1119
  }
1213
1120
  else {
1214
- labelAfterPos = this._tabList.nativeElement.offsetWidth - offsetLeft;
1215
- labelBeforePos = labelAfterPos - offsetWidth;
1216
- }
1217
- const beforeVisiblePos = this.scrollDistance;
1218
- const afterVisiblePos = this.scrollDistance + viewLength;
1219
- if (labelBeforePos < beforeVisiblePos) {
1220
- // Scroll header to move label to the before direction
1221
- this.scrollDistance -= beforeVisiblePos - labelBeforePos + EXAGGERATED_OVERSCROLL;
1222
- }
1223
- else if (labelAfterPos > afterVisiblePos) {
1224
- // Scroll header to move label to the after direction
1225
- this.scrollDistance += labelAfterPos - afterVisiblePos + EXAGGERATED_OVERSCROLL;
1121
+ containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;
1226
1122
  }
1227
1123
  }
1228
- /**
1229
- * Evaluate whether the pagination controls should be displayed. If the scroll width of the
1230
- * tab list is wider than the size of the header container, then the pagination controls should
1231
- * be shown.
1232
- *
1233
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1234
- * should be called sparingly.
1235
- */
1236
- _checkPaginationEnabled() {
1237
- if (this.disablePagination) {
1238
- this._showPaginationControls = false;
1239
- }
1240
- else {
1241
- const isEnabled = this._tabList.nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;
1242
- if (!isEnabled) {
1243
- this.scrollDistance = 0;
1244
- }
1245
- if (isEnabled !== this._showPaginationControls) {
1246
- this._changeDetectorRef.markForCheck();
1247
- }
1248
- this._showPaginationControls = isEnabled;
1249
- }
1124
+ }
1125
+ /** The layout direction of the containing app. */
1126
+ _getLayoutDirection() {
1127
+ return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
1128
+ }
1129
+ /** Performs the CSS transformation on the tab list that will cause the list to scroll. */
1130
+ _updateTabScrollPosition() {
1131
+ if (this.disablePagination) {
1132
+ return;
1133
+ }
1134
+ const scrollDistance = this.scrollDistance;
1135
+ const platform = this._platform;
1136
+ const translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
1137
+ // Don't use `translate3d` here because we don't want to create a new layer. A new layer
1138
+ // seems to cause flickering and overflow in Internet Explorer. For example, the ink bar
1139
+ // and ripples will exceed the boundaries of the visible tab bar.
1140
+ // See: https://github.com/angular/components/issues/10276
1141
+ // We round the `transform` here, because transforms with sub-pixel precision cause some
1142
+ // browsers to blur the content of the element.
1143
+ this._tabList.nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;
1144
+ // Setting the `transform` on IE will change the scroll offset of the parent, causing the
1145
+ // position to be thrown off in some cases. We have to reset it ourselves to ensure that
1146
+ // it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing
1147
+ // with the scroll position throws off Chrome 71+ in RTL mode (see #14689).
1148
+ // @breaking-change 9.0.0 Remove null check for `platform` after it can no longer be undefined.
1149
+ if (platform && (platform.TRIDENT || platform.EDGE)) {
1150
+ this._tabListContainer.nativeElement.scrollLeft = 0;
1250
1151
  }
1251
- /**
1252
- * Evaluate whether the before and after controls should be enabled or disabled.
1253
- * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
1254
- * before button. If the header is at the end of the list (scroll distance is equal to the
1255
- * maximum distance we can scroll), then disable the after button.
1256
- *
1257
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1258
- * should be called sparingly.
1259
- */
1260
- _checkScrollingControls() {
1261
- if (this.disablePagination) {
1262
- this._disableScrollAfter = this._disableScrollBefore = true;
1263
- }
1264
- else {
1265
- // Check if the pagination arrows should be activated.
1266
- this._disableScrollBefore = this.scrollDistance == 0;
1267
- this._disableScrollAfter = this.scrollDistance == this._getMaxScrollDistance();
1268
- this._changeDetectorRef.markForCheck();
1269
- }
1152
+ }
1153
+ /** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
1154
+ get scrollDistance() { return this._scrollDistance; }
1155
+ set scrollDistance(value) {
1156
+ this._scrollTo(value);
1157
+ }
1158
+ /**
1159
+ * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
1160
+ * the end of the list, respectively). The distance to scroll is computed to be a third of the
1161
+ * length of the tab list view window.
1162
+ *
1163
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1164
+ * should be called sparingly.
1165
+ */
1166
+ _scrollHeader(direction) {
1167
+ const viewLength = this._tabListContainer.nativeElement.offsetWidth;
1168
+ // Move the scroll distance one-third the length of the tab list's viewport.
1169
+ const scrollAmount = (direction == 'before' ? -1 : 1) * viewLength / 3;
1170
+ return this._scrollTo(this._scrollDistance + scrollAmount);
1171
+ }
1172
+ /** Handles click events on the pagination arrows. */
1173
+ _handlePaginatorClick(direction) {
1174
+ this._stopInterval();
1175
+ this._scrollHeader(direction);
1176
+ }
1177
+ /**
1178
+ * Moves the tab list such that the desired tab label (marked by index) is moved into view.
1179
+ *
1180
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1181
+ * should be called sparingly.
1182
+ */
1183
+ _scrollToLabel(labelIndex) {
1184
+ if (this.disablePagination) {
1185
+ return;
1186
+ }
1187
+ const selectedLabel = this._items ? this._items.toArray()[labelIndex] : null;
1188
+ if (!selectedLabel) {
1189
+ return;
1190
+ }
1191
+ // The view length is the visible width of the tab labels.
1192
+ const viewLength = this._tabListContainer.nativeElement.offsetWidth;
1193
+ const { offsetLeft, offsetWidth } = selectedLabel.elementRef.nativeElement;
1194
+ let labelBeforePos, labelAfterPos;
1195
+ if (this._getLayoutDirection() == 'ltr') {
1196
+ labelBeforePos = offsetLeft;
1197
+ labelAfterPos = labelBeforePos + offsetWidth;
1198
+ }
1199
+ else {
1200
+ labelAfterPos = this._tabList.nativeElement.offsetWidth - offsetLeft;
1201
+ labelBeforePos = labelAfterPos - offsetWidth;
1202
+ }
1203
+ const beforeVisiblePos = this.scrollDistance;
1204
+ const afterVisiblePos = this.scrollDistance + viewLength;
1205
+ if (labelBeforePos < beforeVisiblePos) {
1206
+ // Scroll header to move label to the before direction
1207
+ this.scrollDistance -= beforeVisiblePos - labelBeforePos + EXAGGERATED_OVERSCROLL;
1208
+ }
1209
+ else if (labelAfterPos > afterVisiblePos) {
1210
+ // Scroll header to move label to the after direction
1211
+ this.scrollDistance += labelAfterPos - afterVisiblePos + EXAGGERATED_OVERSCROLL;
1270
1212
  }
1271
- /**
1272
- * Determines what is the maximum length in pixels that can be set for the scroll distance. This
1273
- * is equal to the difference in width between the tab list container and tab header container.
1274
- *
1275
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1276
- * should be called sparingly.
1277
- */
1278
- _getMaxScrollDistance() {
1279
- const lengthOfTabList = this._tabList.nativeElement.scrollWidth;
1280
- const viewLength = this._tabListContainer.nativeElement.offsetWidth;
1281
- return (lengthOfTabList - viewLength) || 0;
1213
+ }
1214
+ /**
1215
+ * Evaluate whether the pagination controls should be displayed. If the scroll width of the
1216
+ * tab list is wider than the size of the header container, then the pagination controls should
1217
+ * be shown.
1218
+ *
1219
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1220
+ * should be called sparingly.
1221
+ */
1222
+ _checkPaginationEnabled() {
1223
+ if (this.disablePagination) {
1224
+ this._showPaginationControls = false;
1282
1225
  }
1283
- /** Tells the ink-bar to align itself to the current label wrapper */
1284
- _alignInkBarToSelectedTab() {
1285
- const selectedItem = this._items && this._items.length ?
1286
- this._items.toArray()[this.selectedIndex] : null;
1287
- const selectedLabelWrapper = selectedItem ? selectedItem.elementRef.nativeElement : null;
1288
- if (selectedLabelWrapper) {
1289
- this._inkBar.alignToElement(selectedLabelWrapper);
1226
+ else {
1227
+ const isEnabled = this._tabList.nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;
1228
+ if (!isEnabled) {
1229
+ this.scrollDistance = 0;
1290
1230
  }
1291
- else {
1292
- this._inkBar.hide();
1231
+ if (isEnabled !== this._showPaginationControls) {
1232
+ this._changeDetectorRef.markForCheck();
1293
1233
  }
1234
+ this._showPaginationControls = isEnabled;
1294
1235
  }
1295
- /** Stops the currently-running paginator interval. */
1296
- _stopInterval() {
1297
- this._stopScrolling.next();
1236
+ }
1237
+ /**
1238
+ * Evaluate whether the before and after controls should be enabled or disabled.
1239
+ * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
1240
+ * before button. If the header is at the end of the list (scroll distance is equal to the
1241
+ * maximum distance we can scroll), then disable the after button.
1242
+ *
1243
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1244
+ * should be called sparingly.
1245
+ */
1246
+ _checkScrollingControls() {
1247
+ if (this.disablePagination) {
1248
+ this._disableScrollAfter = this._disableScrollBefore = true;
1249
+ }
1250
+ else {
1251
+ // Check if the pagination arrows should be activated.
1252
+ this._disableScrollBefore = this.scrollDistance == 0;
1253
+ this._disableScrollAfter = this.scrollDistance == this._getMaxScrollDistance();
1254
+ this._changeDetectorRef.markForCheck();
1298
1255
  }
1299
- /**
1300
- * Handles the user pressing down on one of the paginators.
1301
- * Starts scrolling the header after a certain amount of time.
1302
- * @param direction In which direction the paginator should be scrolled.
1303
- */
1304
- _handlePaginatorPress(direction, mouseEvent) {
1305
- // Don't start auto scrolling for right mouse button clicks. Note that we shouldn't have to
1306
- // null check the `button`, but we do it so we don't break tests that use fake events.
1307
- if (mouseEvent && mouseEvent.button != null && mouseEvent.button !== 0) {
1308
- return;
1309
- }
1310
- // Avoid overlapping timers.
1311
- this._stopInterval();
1312
- // Start a timer after the delay and keep firing based on the interval.
1313
- timer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)
1314
- // Keep the timer going until something tells it to stop or the component is destroyed.
1315
- .pipe(takeUntil(merge(this._stopScrolling, this._destroyed)))
1316
- .subscribe(() => {
1317
- const { maxScrollDistance, distance } = this._scrollHeader(direction);
1318
- // Stop the timer if we've reached the start or the end.
1319
- if (distance === 0 || distance >= maxScrollDistance) {
1320
- this._stopInterval();
1321
- }
1322
- });
1256
+ }
1257
+ /**
1258
+ * Determines what is the maximum length in pixels that can be set for the scroll distance. This
1259
+ * is equal to the difference in width between the tab list container and tab header container.
1260
+ *
1261
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1262
+ * should be called sparingly.
1263
+ */
1264
+ _getMaxScrollDistance() {
1265
+ const lengthOfTabList = this._tabList.nativeElement.scrollWidth;
1266
+ const viewLength = this._tabListContainer.nativeElement.offsetWidth;
1267
+ return (lengthOfTabList - viewLength) || 0;
1268
+ }
1269
+ /** Tells the ink-bar to align itself to the current label wrapper */
1270
+ _alignInkBarToSelectedTab() {
1271
+ const selectedItem = this._items && this._items.length ?
1272
+ this._items.toArray()[this.selectedIndex] : null;
1273
+ const selectedLabelWrapper = selectedItem ? selectedItem.elementRef.nativeElement : null;
1274
+ if (selectedLabelWrapper) {
1275
+ this._inkBar.alignToElement(selectedLabelWrapper);
1276
+ }
1277
+ else {
1278
+ this._inkBar.hide();
1323
1279
  }
1324
- /**
1325
- * Scrolls the header to a given position.
1326
- * @param position Position to which to scroll.
1327
- * @returns Information on the current scroll distance and the maximum.
1328
- */
1329
- _scrollTo(position) {
1330
- if (this.disablePagination) {
1331
- return { maxScrollDistance: 0, distance: 0 };
1280
+ }
1281
+ /** Stops the currently-running paginator interval. */
1282
+ _stopInterval() {
1283
+ this._stopScrolling.next();
1284
+ }
1285
+ /**
1286
+ * Handles the user pressing down on one of the paginators.
1287
+ * Starts scrolling the header after a certain amount of time.
1288
+ * @param direction In which direction the paginator should be scrolled.
1289
+ */
1290
+ _handlePaginatorPress(direction, mouseEvent) {
1291
+ // Don't start auto scrolling for right mouse button clicks. Note that we shouldn't have to
1292
+ // null check the `button`, but we do it so we don't break tests that use fake events.
1293
+ if (mouseEvent && mouseEvent.button != null && mouseEvent.button !== 0) {
1294
+ return;
1295
+ }
1296
+ // Avoid overlapping timers.
1297
+ this._stopInterval();
1298
+ // Start a timer after the delay and keep firing based on the interval.
1299
+ timer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)
1300
+ // Keep the timer going until something tells it to stop or the component is destroyed.
1301
+ .pipe(takeUntil(merge(this._stopScrolling, this._destroyed)))
1302
+ .subscribe(() => {
1303
+ const { maxScrollDistance, distance } = this._scrollHeader(direction);
1304
+ // Stop the timer if we've reached the start or the end.
1305
+ if (distance === 0 || distance >= maxScrollDistance) {
1306
+ this._stopInterval();
1332
1307
  }
1333
- const maxScrollDistance = this._getMaxScrollDistance();
1334
- this._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));
1335
- // Mark that the scroll distance has changed so that after the view is checked, the CSS
1336
- // transformation can move the header.
1337
- this._scrollDistanceChanged = true;
1338
- this._checkScrollingControls();
1339
- return { maxScrollDistance, distance: this._scrollDistance };
1340
- }
1308
+ });
1309
+ }
1310
+ /**
1311
+ * Scrolls the header to a given position.
1312
+ * @param position Position to which to scroll.
1313
+ * @returns Information on the current scroll distance and the maximum.
1314
+ */
1315
+ _scrollTo(position) {
1316
+ if (this.disablePagination) {
1317
+ return { maxScrollDistance: 0, distance: 0 };
1318
+ }
1319
+ const maxScrollDistance = this._getMaxScrollDistance();
1320
+ this._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));
1321
+ // Mark that the scroll distance has changed so that after the view is checked, the CSS
1322
+ // transformation can move the header.
1323
+ this._scrollDistanceChanged = true;
1324
+ this._checkScrollingControls();
1325
+ return { maxScrollDistance, distance: this._scrollDistance };
1341
1326
  }
1342
- MatPaginatedTabHeader.decorators = [
1343
- { type: Directive }
1344
- ];
1345
- MatPaginatedTabHeader.ctorParameters = () => [
1346
- { type: ElementRef },
1347
- { type: ChangeDetectorRef },
1348
- { type: ViewportRuler },
1349
- { type: Directionality, decorators: [{ type: Optional }] },
1350
- { type: NgZone },
1351
- { type: Platform },
1352
- { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1353
- ];
1354
- MatPaginatedTabHeader.propDecorators = {
1355
- disablePagination: [{ type: Input }]
1356
- };
1357
- return MatPaginatedTabHeader;
1358
- })();
1327
+ }
1328
+ MatPaginatedTabHeader.decorators = [
1329
+ { type: Directive }
1330
+ ];
1331
+ MatPaginatedTabHeader.ctorParameters = () => [
1332
+ { type: ElementRef },
1333
+ { type: ChangeDetectorRef },
1334
+ { type: ViewportRuler },
1335
+ { type: Directionality, decorators: [{ type: Optional }] },
1336
+ { type: NgZone },
1337
+ { type: Platform },
1338
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1339
+ ];
1340
+ MatPaginatedTabHeader.propDecorators = {
1341
+ disablePagination: [{ type: Input }]
1342
+ };
1359
1343
 
1360
1344
  /**
1361
1345
  * @license
@@ -1368,38 +1352,35 @@ let MatPaginatedTabHeader = /** @class */ (() => {
1368
1352
  * Base class with all of the `MatTabHeader` functionality.
1369
1353
  * @docs-private
1370
1354
  */
1371
- let _MatTabHeaderBase = /** @class */ (() => {
1372
- class _MatTabHeaderBase extends MatPaginatedTabHeader {
1373
- constructor(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform,
1374
- // @breaking-change 9.0.0 `_animationMode` parameter to be made required.
1375
- animationMode) {
1376
- super(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode);
1377
- this._disableRipple = false;
1378
- }
1379
- /** Whether the ripple effect is disabled or not. */
1380
- get disableRipple() { return this._disableRipple; }
1381
- set disableRipple(value) { this._disableRipple = coerceBooleanProperty(value); }
1382
- _itemSelected(event) {
1383
- event.preventDefault();
1384
- }
1355
+ class _MatTabHeaderBase extends MatPaginatedTabHeader {
1356
+ constructor(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform,
1357
+ // @breaking-change 9.0.0 `_animationMode` parameter to be made required.
1358
+ animationMode) {
1359
+ super(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode);
1360
+ this._disableRipple = false;
1385
1361
  }
1386
- _MatTabHeaderBase.decorators = [
1387
- { type: Directive }
1388
- ];
1389
- _MatTabHeaderBase.ctorParameters = () => [
1390
- { type: ElementRef },
1391
- { type: ChangeDetectorRef },
1392
- { type: ViewportRuler },
1393
- { type: Directionality, decorators: [{ type: Optional }] },
1394
- { type: NgZone },
1395
- { type: Platform },
1396
- { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1397
- ];
1398
- _MatTabHeaderBase.propDecorators = {
1399
- disableRipple: [{ type: Input }]
1400
- };
1401
- return _MatTabHeaderBase;
1402
- })();
1362
+ /** Whether the ripple effect is disabled or not. */
1363
+ get disableRipple() { return this._disableRipple; }
1364
+ set disableRipple(value) { this._disableRipple = coerceBooleanProperty(value); }
1365
+ _itemSelected(event) {
1366
+ event.preventDefault();
1367
+ }
1368
+ }
1369
+ _MatTabHeaderBase.decorators = [
1370
+ { type: Directive }
1371
+ ];
1372
+ _MatTabHeaderBase.ctorParameters = () => [
1373
+ { type: ElementRef },
1374
+ { type: ChangeDetectorRef },
1375
+ { type: ViewportRuler },
1376
+ { type: Directionality, decorators: [{ type: Optional }] },
1377
+ { type: NgZone },
1378
+ { type: Platform },
1379
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1380
+ ];
1381
+ _MatTabHeaderBase.propDecorators = {
1382
+ disableRipple: [{ type: Input }]
1383
+ };
1403
1384
  /**
1404
1385
  * The header of the tab group which displays a list of all the tabs in the tab group. Includes
1405
1386
  * an ink bar that follows the currently selected tab. When the tabs list's width exceeds the
@@ -1407,50 +1388,47 @@ let _MatTabHeaderBase = /** @class */ (() => {
1407
1388
  * left and right across the header.
1408
1389
  * @docs-private
1409
1390
  */
1410
- let MatTabHeader = /** @class */ (() => {
1411
- class MatTabHeader extends _MatTabHeaderBase {
1412
- constructor(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform,
1413
- // @breaking-change 9.0.0 `_animationMode` parameter to be made required.
1414
- animationMode) {
1415
- super(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode);
1416
- }
1391
+ class MatTabHeader extends _MatTabHeaderBase {
1392
+ constructor(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform,
1393
+ // @breaking-change 9.0.0 `_animationMode` parameter to be made required.
1394
+ animationMode) {
1395
+ super(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode);
1417
1396
  }
1418
- MatTabHeader.decorators = [
1419
- { type: Component, args: [{
1420
- selector: 'mat-tab-header',
1421
- template: "<div class=\"mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4\"\n #previousPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollBefore || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollBefore\"\n (click)=\"_handlePaginatorClick('before')\"\n (mousedown)=\"_handlePaginatorPress('before', $event)\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n\n<div class=\"mat-tab-label-container\" #tabListContainer (keydown)=\"_handleKeydown($event)\">\n <div\n #tabList\n class=\"mat-tab-list\"\n [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\"\n role=\"tablist\"\n (cdkObserveContent)=\"_onContentChanges()\">\n <div class=\"mat-tab-labels\">\n <ng-content></ng-content>\n </div>\n <mat-ink-bar></mat-ink-bar>\n </div>\n</div>\n\n<div class=\"mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4\"\n #nextPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollAfter || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollAfter\"\n (mousedown)=\"_handlePaginatorPress('after', $event)\"\n (click)=\"_handlePaginatorClick('after')\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n",
1422
- inputs: ['selectedIndex'],
1423
- outputs: ['selectFocusedIndex', 'indexFocused'],
1424
- encapsulation: ViewEncapsulation.None,
1425
- // tslint:disable-next-line:validate-decorators
1426
- changeDetection: ChangeDetectionStrategy.Default,
1427
- host: {
1428
- 'class': 'mat-tab-header',
1429
- '[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',
1430
- '[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'",
1431
- },
1432
- styles: [".mat-tab-header{display:flex;overflow:hidden;position:relative;flex-shrink:0}.mat-tab-header-pagination{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:none;justify-content:center;align-items:center;min-width:32px;cursor:pointer;z-index:2;-webkit-tap-highlight-color:transparent;touch-action:none}.mat-tab-header-pagination-controls-enabled .mat-tab-header-pagination{display:flex}.mat-tab-header-pagination-before,.mat-tab-header-rtl .mat-tab-header-pagination-after{padding-left:4px}.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(-135deg)}.mat-tab-header-rtl .mat-tab-header-pagination-before,.mat-tab-header-pagination-after{padding-right:4px}.mat-tab-header-rtl .mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(45deg)}.mat-tab-header-pagination-chevron{border-style:solid;border-width:2px 2px 0 0;content:\"\";height:8px;width:8px}.mat-tab-header-pagination-disabled{box-shadow:none;cursor:default}.mat-tab-list{flex-grow:1;position:relative;transition:transform 500ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:500ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable.mat-ink-bar{transition:none;animation:none}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}.cdk-high-contrast-active .mat-ink-bar{outline:solid 2px;height:0}.mat-tab-labels{display:flex}[mat-align-tabs=center]>.mat-tab-header .mat-tab-labels{justify-content:center}[mat-align-tabs=end]>.mat-tab-header .mat-tab-labels{justify-content:flex-end}.mat-tab-label-container{display:flex;flex-grow:1;overflow:hidden;z-index:1}._mat-animation-noopable.mat-tab-list{transition:none;animation:none}.mat-tab-label{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;position:relative}.mat-tab-label:focus{outline:none}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-label:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-label.mat-tab-disabled{cursor:default}.cdk-high-contrast-active .mat-tab-label.mat-tab-disabled{opacity:.5}.mat-tab-label .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.cdk-high-contrast-active .mat-tab-label{opacity:1}@media(max-width: 599px){.mat-tab-label{min-width:72px}}\n"]
1433
- },] }
1434
- ];
1435
- MatTabHeader.ctorParameters = () => [
1436
- { type: ElementRef },
1437
- { type: ChangeDetectorRef },
1438
- { type: ViewportRuler },
1439
- { type: Directionality, decorators: [{ type: Optional }] },
1440
- { type: NgZone },
1441
- { type: Platform },
1442
- { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1443
- ];
1444
- MatTabHeader.propDecorators = {
1445
- _items: [{ type: ContentChildren, args: [MatTabLabelWrapper, { descendants: false },] }],
1446
- _inkBar: [{ type: ViewChild, args: [MatInkBar, { static: true },] }],
1447
- _tabListContainer: [{ type: ViewChild, args: ['tabListContainer', { static: true },] }],
1448
- _tabList: [{ type: ViewChild, args: ['tabList', { static: true },] }],
1449
- _nextPaginator: [{ type: ViewChild, args: ['nextPaginator',] }],
1450
- _previousPaginator: [{ type: ViewChild, args: ['previousPaginator',] }]
1451
- };
1452
- return MatTabHeader;
1453
- })();
1397
+ }
1398
+ MatTabHeader.decorators = [
1399
+ { type: Component, args: [{
1400
+ selector: 'mat-tab-header',
1401
+ template: "<div class=\"mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4\"\n #previousPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollBefore || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollBefore\"\n (click)=\"_handlePaginatorClick('before')\"\n (mousedown)=\"_handlePaginatorPress('before', $event)\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n\n<div class=\"mat-tab-label-container\" #tabListContainer (keydown)=\"_handleKeydown($event)\">\n <div\n #tabList\n class=\"mat-tab-list\"\n [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\"\n role=\"tablist\"\n (cdkObserveContent)=\"_onContentChanges()\">\n <div class=\"mat-tab-labels\">\n <ng-content></ng-content>\n </div>\n <mat-ink-bar></mat-ink-bar>\n </div>\n</div>\n\n<div class=\"mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4\"\n #nextPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollAfter || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollAfter\"\n (mousedown)=\"_handlePaginatorPress('after', $event)\"\n (click)=\"_handlePaginatorClick('after')\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n",
1402
+ inputs: ['selectedIndex'],
1403
+ outputs: ['selectFocusedIndex', 'indexFocused'],
1404
+ encapsulation: ViewEncapsulation.None,
1405
+ // tslint:disable-next-line:validate-decorators
1406
+ changeDetection: ChangeDetectionStrategy.Default,
1407
+ host: {
1408
+ 'class': 'mat-tab-header',
1409
+ '[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',
1410
+ '[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'",
1411
+ },
1412
+ styles: [".mat-tab-header{display:flex;overflow:hidden;position:relative;flex-shrink:0}.mat-tab-header-pagination{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:none;justify-content:center;align-items:center;min-width:32px;cursor:pointer;z-index:2;-webkit-tap-highlight-color:transparent;touch-action:none}.mat-tab-header-pagination-controls-enabled .mat-tab-header-pagination{display:flex}.mat-tab-header-pagination-before,.mat-tab-header-rtl .mat-tab-header-pagination-after{padding-left:4px}.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(-135deg)}.mat-tab-header-rtl .mat-tab-header-pagination-before,.mat-tab-header-pagination-after{padding-right:4px}.mat-tab-header-rtl .mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(45deg)}.mat-tab-header-pagination-chevron{border-style:solid;border-width:2px 2px 0 0;content:\"\";height:8px;width:8px}.mat-tab-header-pagination-disabled{box-shadow:none;cursor:default}.mat-tab-list{flex-grow:1;position:relative;transition:transform 500ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:500ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable.mat-ink-bar{transition:none;animation:none}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}.cdk-high-contrast-active .mat-ink-bar{outline:solid 2px;height:0}.mat-tab-labels{display:flex}[mat-align-tabs=center]>.mat-tab-header .mat-tab-labels{justify-content:center}[mat-align-tabs=end]>.mat-tab-header .mat-tab-labels{justify-content:flex-end}.mat-tab-label-container{display:flex;flex-grow:1;overflow:hidden;z-index:1}._mat-animation-noopable.mat-tab-list{transition:none;animation:none}.mat-tab-label{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;position:relative}.mat-tab-label:focus{outline:none}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-label:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-label.mat-tab-disabled{cursor:default}.cdk-high-contrast-active .mat-tab-label.mat-tab-disabled{opacity:.5}.mat-tab-label .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.cdk-high-contrast-active .mat-tab-label{opacity:1}@media(max-width: 599px){.mat-tab-label{min-width:72px}}\n"]
1413
+ },] }
1414
+ ];
1415
+ MatTabHeader.ctorParameters = () => [
1416
+ { type: ElementRef },
1417
+ { type: ChangeDetectorRef },
1418
+ { type: ViewportRuler },
1419
+ { type: Directionality, decorators: [{ type: Optional }] },
1420
+ { type: NgZone },
1421
+ { type: Platform },
1422
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1423
+ ];
1424
+ MatTabHeader.propDecorators = {
1425
+ _items: [{ type: ContentChildren, args: [MatTabLabelWrapper, { descendants: false },] }],
1426
+ _inkBar: [{ type: ViewChild, args: [MatInkBar, { static: true },] }],
1427
+ _tabListContainer: [{ type: ViewChild, args: ['tabListContainer', { static: true },] }],
1428
+ _tabList: [{ type: ViewChild, args: ['tabList', { static: true },] }],
1429
+ _nextPaginator: [{ type: ViewChild, args: ['nextPaginator',] }],
1430
+ _previousPaginator: [{ type: ViewChild, args: ['previousPaginator',] }]
1431
+ };
1454
1432
 
1455
1433
  /**
1456
1434
  * @license
@@ -1463,239 +1441,227 @@ let MatTabHeader = /** @class */ (() => {
1463
1441
  * Base class with all of the `MatTabNav` functionality.
1464
1442
  * @docs-private
1465
1443
  */
1466
- let _MatTabNavBase = /** @class */ (() => {
1467
- class _MatTabNavBase extends MatPaginatedTabHeader {
1468
- constructor(elementRef, dir, ngZone, changeDetectorRef, viewportRuler,
1469
- /**
1470
- * @deprecated @breaking-change 9.0.0 `platform` parameter to become required.
1471
- */
1472
- platform, animationMode) {
1473
- super(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode);
1474
- this._disableRipple = false;
1475
- /** Theme color of the nav bar. */
1476
- this.color = 'primary';
1477
- }
1478
- /** Background color of the tab nav. */
1479
- get backgroundColor() { return this._backgroundColor; }
1480
- set backgroundColor(value) {
1481
- const classList = this._elementRef.nativeElement.classList;
1482
- classList.remove(`mat-background-${this.backgroundColor}`);
1483
- if (value) {
1484
- classList.add(`mat-background-${value}`);
1485
- }
1486
- this._backgroundColor = value;
1487
- }
1488
- /** Whether the ripple effect is disabled or not. */
1489
- get disableRipple() { return this._disableRipple; }
1490
- set disableRipple(value) { this._disableRipple = coerceBooleanProperty(value); }
1491
- _itemSelected() {
1492
- // noop
1493
- }
1494
- ngAfterContentInit() {
1495
- // We need this to run before the `changes` subscription in parent to ensure that the
1496
- // selectedIndex is up-to-date by the time the super class starts looking for it.
1497
- this._items.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => {
1498
- this.updateActiveLink();
1499
- });
1500
- super.ngAfterContentInit();
1501
- }
1502
- /**
1503
- * Notifies the component that the active link has been changed.
1504
- * @breaking-change 8.0.0 `element` parameter to be removed.
1505
- */
1506
- updateActiveLink(_element) {
1507
- if (!this._items) {
1444
+ class _MatTabNavBase extends MatPaginatedTabHeader {
1445
+ constructor(elementRef, dir, ngZone, changeDetectorRef, viewportRuler,
1446
+ /**
1447
+ * @deprecated @breaking-change 9.0.0 `platform` parameter to become required.
1448
+ */
1449
+ platform, animationMode) {
1450
+ super(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode);
1451
+ this._disableRipple = false;
1452
+ /** Theme color of the nav bar. */
1453
+ this.color = 'primary';
1454
+ }
1455
+ /** Background color of the tab nav. */
1456
+ get backgroundColor() { return this._backgroundColor; }
1457
+ set backgroundColor(value) {
1458
+ const classList = this._elementRef.nativeElement.classList;
1459
+ classList.remove(`mat-background-${this.backgroundColor}`);
1460
+ if (value) {
1461
+ classList.add(`mat-background-${value}`);
1462
+ }
1463
+ this._backgroundColor = value;
1464
+ }
1465
+ /** Whether the ripple effect is disabled or not. */
1466
+ get disableRipple() { return this._disableRipple; }
1467
+ set disableRipple(value) { this._disableRipple = coerceBooleanProperty(value); }
1468
+ _itemSelected() {
1469
+ // noop
1470
+ }
1471
+ ngAfterContentInit() {
1472
+ // We need this to run before the `changes` subscription in parent to ensure that the
1473
+ // selectedIndex is up-to-date by the time the super class starts looking for it.
1474
+ this._items.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => {
1475
+ this.updateActiveLink();
1476
+ });
1477
+ super.ngAfterContentInit();
1478
+ }
1479
+ /**
1480
+ * Notifies the component that the active link has been changed.
1481
+ * @breaking-change 8.0.0 `element` parameter to be removed.
1482
+ */
1483
+ updateActiveLink(_element) {
1484
+ if (!this._items) {
1485
+ return;
1486
+ }
1487
+ const items = this._items.toArray();
1488
+ for (let i = 0; i < items.length; i++) {
1489
+ if (items[i].active) {
1490
+ this.selectedIndex = i;
1491
+ this._changeDetectorRef.markForCheck();
1508
1492
  return;
1509
1493
  }
1510
- const items = this._items.toArray();
1511
- for (let i = 0; i < items.length; i++) {
1512
- if (items[i].active) {
1513
- this.selectedIndex = i;
1514
- this._changeDetectorRef.markForCheck();
1515
- return;
1516
- }
1517
- }
1518
- // The ink bar should hide itself if no items are active.
1519
- this.selectedIndex = -1;
1520
- this._inkBar.hide();
1521
1494
  }
1495
+ // The ink bar should hide itself if no items are active.
1496
+ this.selectedIndex = -1;
1497
+ this._inkBar.hide();
1522
1498
  }
1523
- _MatTabNavBase.decorators = [
1524
- { type: Directive }
1525
- ];
1526
- _MatTabNavBase.ctorParameters = () => [
1527
- { type: ElementRef },
1528
- { type: Directionality, decorators: [{ type: Optional }] },
1529
- { type: NgZone },
1530
- { type: ChangeDetectorRef },
1531
- { type: ViewportRuler },
1532
- { type: Platform, decorators: [{ type: Optional }] },
1533
- { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1534
- ];
1535
- _MatTabNavBase.propDecorators = {
1536
- backgroundColor: [{ type: Input }],
1537
- disableRipple: [{ type: Input }],
1538
- color: [{ type: Input }]
1539
- };
1540
- return _MatTabNavBase;
1541
- })();
1499
+ }
1500
+ _MatTabNavBase.decorators = [
1501
+ { type: Directive }
1502
+ ];
1503
+ _MatTabNavBase.ctorParameters = () => [
1504
+ { type: ElementRef },
1505
+ { type: Directionality, decorators: [{ type: Optional }] },
1506
+ { type: NgZone },
1507
+ { type: ChangeDetectorRef },
1508
+ { type: ViewportRuler },
1509
+ { type: Platform, decorators: [{ type: Optional }] },
1510
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1511
+ ];
1512
+ _MatTabNavBase.propDecorators = {
1513
+ backgroundColor: [{ type: Input }],
1514
+ disableRipple: [{ type: Input }],
1515
+ color: [{ type: Input }]
1516
+ };
1542
1517
  /**
1543
1518
  * Navigation component matching the styles of the tab group header.
1544
1519
  * Provides anchored navigation with animated ink bar.
1545
1520
  */
1546
- let MatTabNav = /** @class */ (() => {
1547
- class MatTabNav extends _MatTabNavBase {
1548
- constructor(elementRef, dir, ngZone, changeDetectorRef, viewportRuler,
1549
- /**
1550
- * @deprecated @breaking-change 9.0.0 `platform` parameter to become required.
1551
- */
1552
- platform, animationMode) {
1553
- super(elementRef, dir, ngZone, changeDetectorRef, viewportRuler, platform, animationMode);
1554
- }
1521
+ class MatTabNav extends _MatTabNavBase {
1522
+ constructor(elementRef, dir, ngZone, changeDetectorRef, viewportRuler,
1523
+ /**
1524
+ * @deprecated @breaking-change 9.0.0 `platform` parameter to become required.
1525
+ */
1526
+ platform, animationMode) {
1527
+ super(elementRef, dir, ngZone, changeDetectorRef, viewportRuler, platform, animationMode);
1555
1528
  }
1556
- MatTabNav.decorators = [
1557
- { type: Component, args: [{
1558
- selector: '[mat-tab-nav-bar]',
1559
- exportAs: 'matTabNavBar, matTabNav',
1560
- inputs: ['color'],
1561
- template: "<div class=\"mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4\"\n #previousPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollBefore || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollBefore\"\n (click)=\"_handlePaginatorClick('before')\"\n (mousedown)=\"_handlePaginatorPress('before', $event)\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n\n<div class=\"mat-tab-link-container\" #tabListContainer (keydown)=\"_handleKeydown($event)\">\n <div\n class=\"mat-tab-list\"\n [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\"\n #tabList\n (cdkObserveContent)=\"_onContentChanges()\">\n <div class=\"mat-tab-links\">\n <ng-content></ng-content>\n </div>\n <mat-ink-bar></mat-ink-bar>\n </div>\n</div>\n\n<div class=\"mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4\"\n #nextPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollAfter || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollAfter\"\n (mousedown)=\"_handlePaginatorPress('after', $event)\"\n (click)=\"_handlePaginatorClick('after')\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n",
1562
- host: {
1563
- 'class': 'mat-tab-nav-bar mat-tab-header',
1564
- '[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',
1565
- '[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'",
1566
- '[class.mat-primary]': 'color !== "warn" && color !== "accent"',
1567
- '[class.mat-accent]': 'color === "accent"',
1568
- '[class.mat-warn]': 'color === "warn"',
1569
- },
1570
- encapsulation: ViewEncapsulation.None,
1571
- // tslint:disable-next-line:validate-decorators
1572
- changeDetection: ChangeDetectionStrategy.Default,
1573
- styles: [".mat-tab-header{display:flex;overflow:hidden;position:relative;flex-shrink:0}.mat-tab-header-pagination{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:none;justify-content:center;align-items:center;min-width:32px;cursor:pointer;z-index:2;-webkit-tap-highlight-color:transparent;touch-action:none}.mat-tab-header-pagination-controls-enabled .mat-tab-header-pagination{display:flex}.mat-tab-header-pagination-before,.mat-tab-header-rtl .mat-tab-header-pagination-after{padding-left:4px}.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(-135deg)}.mat-tab-header-rtl .mat-tab-header-pagination-before,.mat-tab-header-pagination-after{padding-right:4px}.mat-tab-header-rtl .mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(45deg)}.mat-tab-header-pagination-chevron{border-style:solid;border-width:2px 2px 0 0;content:\"\";height:8px;width:8px}.mat-tab-header-pagination-disabled{box-shadow:none;cursor:default}.mat-tab-list{flex-grow:1;position:relative;transition:transform 500ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-tab-links{display:flex}[mat-align-tabs=center]>.mat-tab-link-container .mat-tab-links{justify-content:center}[mat-align-tabs=end]>.mat-tab-link-container .mat-tab-links{justify-content:flex-end}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:500ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable.mat-ink-bar{transition:none;animation:none}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}.cdk-high-contrast-active .mat-ink-bar{outline:solid 2px;height:0}.mat-tab-link-container{display:flex;flex-grow:1;overflow:hidden;z-index:1}.mat-tab-link{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;vertical-align:top;text-decoration:none;position:relative;overflow:hidden;-webkit-tap-highlight-color:transparent}.mat-tab-link:focus{outline:none}.mat-tab-link:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-link:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-link.mat-tab-disabled{cursor:default}.cdk-high-contrast-active .mat-tab-link.mat-tab-disabled{opacity:.5}.mat-tab-link .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.cdk-high-contrast-active .mat-tab-link{opacity:1}[mat-stretch-tabs] .mat-tab-link{flex-basis:0;flex-grow:1}.mat-tab-link.mat-tab-disabled{pointer-events:none}@media(max-width: 599px){.mat-tab-link{min-width:72px}}\n"]
1574
- },] }
1575
- ];
1576
- MatTabNav.ctorParameters = () => [
1577
- { type: ElementRef },
1578
- { type: Directionality, decorators: [{ type: Optional }] },
1579
- { type: NgZone },
1580
- { type: ChangeDetectorRef },
1581
- { type: ViewportRuler },
1582
- { type: Platform, decorators: [{ type: Optional }] },
1583
- { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1584
- ];
1585
- MatTabNav.propDecorators = {
1586
- _items: [{ type: ContentChildren, args: [forwardRef(() => MatTabLink), { descendants: true },] }],
1587
- _inkBar: [{ type: ViewChild, args: [MatInkBar, { static: true },] }],
1588
- _tabListContainer: [{ type: ViewChild, args: ['tabListContainer', { static: true },] }],
1589
- _tabList: [{ type: ViewChild, args: ['tabList', { static: true },] }],
1590
- _nextPaginator: [{ type: ViewChild, args: ['nextPaginator',] }],
1591
- _previousPaginator: [{ type: ViewChild, args: ['previousPaginator',] }]
1592
- };
1593
- return MatTabNav;
1594
- })();
1529
+ }
1530
+ MatTabNav.decorators = [
1531
+ { type: Component, args: [{
1532
+ selector: '[mat-tab-nav-bar]',
1533
+ exportAs: 'matTabNavBar, matTabNav',
1534
+ inputs: ['color'],
1535
+ template: "<div class=\"mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4\"\n #previousPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollBefore || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollBefore\"\n (click)=\"_handlePaginatorClick('before')\"\n (mousedown)=\"_handlePaginatorPress('before', $event)\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n\n<div class=\"mat-tab-link-container\" #tabListContainer (keydown)=\"_handleKeydown($event)\">\n <div\n class=\"mat-tab-list\"\n [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\"\n #tabList\n (cdkObserveContent)=\"_onContentChanges()\">\n <div class=\"mat-tab-links\">\n <ng-content></ng-content>\n </div>\n <mat-ink-bar></mat-ink-bar>\n </div>\n</div>\n\n<div class=\"mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4\"\n #nextPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollAfter || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollAfter\"\n (mousedown)=\"_handlePaginatorPress('after', $event)\"\n (click)=\"_handlePaginatorClick('after')\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n",
1536
+ host: {
1537
+ 'class': 'mat-tab-nav-bar mat-tab-header',
1538
+ '[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',
1539
+ '[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'",
1540
+ '[class.mat-primary]': 'color !== "warn" && color !== "accent"',
1541
+ '[class.mat-accent]': 'color === "accent"',
1542
+ '[class.mat-warn]': 'color === "warn"',
1543
+ },
1544
+ encapsulation: ViewEncapsulation.None,
1545
+ // tslint:disable-next-line:validate-decorators
1546
+ changeDetection: ChangeDetectionStrategy.Default,
1547
+ styles: [".mat-tab-header{display:flex;overflow:hidden;position:relative;flex-shrink:0}.mat-tab-header-pagination{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:none;justify-content:center;align-items:center;min-width:32px;cursor:pointer;z-index:2;-webkit-tap-highlight-color:transparent;touch-action:none}.mat-tab-header-pagination-controls-enabled .mat-tab-header-pagination{display:flex}.mat-tab-header-pagination-before,.mat-tab-header-rtl .mat-tab-header-pagination-after{padding-left:4px}.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(-135deg)}.mat-tab-header-rtl .mat-tab-header-pagination-before,.mat-tab-header-pagination-after{padding-right:4px}.mat-tab-header-rtl .mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(45deg)}.mat-tab-header-pagination-chevron{border-style:solid;border-width:2px 2px 0 0;content:\"\";height:8px;width:8px}.mat-tab-header-pagination-disabled{box-shadow:none;cursor:default}.mat-tab-list{flex-grow:1;position:relative;transition:transform 500ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-tab-links{display:flex}[mat-align-tabs=center]>.mat-tab-link-container .mat-tab-links{justify-content:center}[mat-align-tabs=end]>.mat-tab-link-container .mat-tab-links{justify-content:flex-end}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:500ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable.mat-ink-bar{transition:none;animation:none}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}.cdk-high-contrast-active .mat-ink-bar{outline:solid 2px;height:0}.mat-tab-link-container{display:flex;flex-grow:1;overflow:hidden;z-index:1}.mat-tab-link{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;vertical-align:top;text-decoration:none;position:relative;overflow:hidden;-webkit-tap-highlight-color:transparent}.mat-tab-link:focus{outline:none}.mat-tab-link:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-link:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-link.mat-tab-disabled{cursor:default}.cdk-high-contrast-active .mat-tab-link.mat-tab-disabled{opacity:.5}.mat-tab-link .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.cdk-high-contrast-active .mat-tab-link{opacity:1}[mat-stretch-tabs] .mat-tab-link{flex-basis:0;flex-grow:1}.mat-tab-link.mat-tab-disabled{pointer-events:none}@media(max-width: 599px){.mat-tab-link{min-width:72px}}\n"]
1548
+ },] }
1549
+ ];
1550
+ MatTabNav.ctorParameters = () => [
1551
+ { type: ElementRef },
1552
+ { type: Directionality, decorators: [{ type: Optional }] },
1553
+ { type: NgZone },
1554
+ { type: ChangeDetectorRef },
1555
+ { type: ViewportRuler },
1556
+ { type: Platform, decorators: [{ type: Optional }] },
1557
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1558
+ ];
1559
+ MatTabNav.propDecorators = {
1560
+ _items: [{ type: ContentChildren, args: [forwardRef(() => MatTabLink), { descendants: true },] }],
1561
+ _inkBar: [{ type: ViewChild, args: [MatInkBar, { static: true },] }],
1562
+ _tabListContainer: [{ type: ViewChild, args: ['tabListContainer', { static: true },] }],
1563
+ _tabList: [{ type: ViewChild, args: ['tabList', { static: true },] }],
1564
+ _nextPaginator: [{ type: ViewChild, args: ['nextPaginator',] }],
1565
+ _previousPaginator: [{ type: ViewChild, args: ['previousPaginator',] }]
1566
+ };
1595
1567
  // Boilerplate for applying mixins to MatTabLink.
1596
1568
  class MatTabLinkMixinBase {
1597
1569
  }
1598
1570
  const _MatTabLinkMixinBase = mixinTabIndex(mixinDisableRipple(mixinDisabled(MatTabLinkMixinBase)));
1599
1571
  /** Base class with all of the `MatTabLink` functionality. */
1600
- let _MatTabLinkBase = /** @class */ (() => {
1601
- class _MatTabLinkBase extends _MatTabLinkMixinBase {
1602
- constructor(_tabNavBar, elementRef, globalRippleOptions, tabIndex, _focusMonitor, animationMode) {
1603
- super();
1604
- this._tabNavBar = _tabNavBar;
1605
- this.elementRef = elementRef;
1606
- this._focusMonitor = _focusMonitor;
1607
- /** Whether the tab link is active or not. */
1608
- this._isActive = false;
1609
- this.rippleConfig = globalRippleOptions || {};
1610
- this.tabIndex = parseInt(tabIndex) || 0;
1611
- if (animationMode === 'NoopAnimations') {
1612
- this.rippleConfig.animation = { enterDuration: 0, exitDuration: 0 };
1613
- }
1572
+ class _MatTabLinkBase extends _MatTabLinkMixinBase {
1573
+ constructor(_tabNavBar, elementRef, globalRippleOptions, tabIndex, _focusMonitor, animationMode) {
1574
+ super();
1575
+ this._tabNavBar = _tabNavBar;
1576
+ this.elementRef = elementRef;
1577
+ this._focusMonitor = _focusMonitor;
1578
+ /** Whether the tab link is active or not. */
1579
+ this._isActive = false;
1580
+ this.rippleConfig = globalRippleOptions || {};
1581
+ this.tabIndex = parseInt(tabIndex) || 0;
1582
+ if (animationMode === 'NoopAnimations') {
1583
+ this.rippleConfig.animation = { enterDuration: 0, exitDuration: 0 };
1614
1584
  }
1615
- /** Whether the link is active. */
1616
- get active() { return this._isActive; }
1617
- set active(value) {
1618
- if (value !== this._isActive) {
1619
- this._isActive = value;
1620
- this._tabNavBar.updateActiveLink(this.elementRef);
1621
- }
1622
- }
1623
- /**
1624
- * Whether ripples are disabled on interaction.
1625
- * @docs-private
1626
- */
1627
- get rippleDisabled() {
1628
- return this.disabled || this.disableRipple || this._tabNavBar.disableRipple ||
1629
- !!this.rippleConfig.disabled;
1630
- }
1631
- focus() {
1632
- this.elementRef.nativeElement.focus();
1633
- }
1634
- ngAfterViewInit() {
1635
- this._focusMonitor.monitor(this.elementRef);
1636
- }
1637
- ngOnDestroy() {
1638
- this._focusMonitor.stopMonitoring(this.elementRef);
1585
+ }
1586
+ /** Whether the link is active. */
1587
+ get active() { return this._isActive; }
1588
+ set active(value) {
1589
+ if (value !== this._isActive) {
1590
+ this._isActive = value;
1591
+ this._tabNavBar.updateActiveLink(this.elementRef);
1639
1592
  }
1640
1593
  }
1641
- _MatTabLinkBase.decorators = [
1642
- { type: Directive }
1643
- ];
1644
- _MatTabLinkBase.ctorParameters = () => [
1645
- { type: _MatTabNavBase },
1646
- { type: ElementRef },
1647
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RIPPLE_GLOBAL_OPTIONS,] }] },
1648
- { type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
1649
- { type: FocusMonitor },
1650
- { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1651
- ];
1652
- _MatTabLinkBase.propDecorators = {
1653
- active: [{ type: Input }]
1654
- };
1655
- return _MatTabLinkBase;
1656
- })();
1594
+ /**
1595
+ * Whether ripples are disabled on interaction.
1596
+ * @docs-private
1597
+ */
1598
+ get rippleDisabled() {
1599
+ return this.disabled || this.disableRipple || this._tabNavBar.disableRipple ||
1600
+ !!this.rippleConfig.disabled;
1601
+ }
1602
+ focus() {
1603
+ this.elementRef.nativeElement.focus();
1604
+ }
1605
+ ngAfterViewInit() {
1606
+ this._focusMonitor.monitor(this.elementRef);
1607
+ }
1608
+ ngOnDestroy() {
1609
+ this._focusMonitor.stopMonitoring(this.elementRef);
1610
+ }
1611
+ }
1612
+ _MatTabLinkBase.decorators = [
1613
+ { type: Directive }
1614
+ ];
1615
+ _MatTabLinkBase.ctorParameters = () => [
1616
+ { type: _MatTabNavBase },
1617
+ { type: ElementRef },
1618
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RIPPLE_GLOBAL_OPTIONS,] }] },
1619
+ { type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
1620
+ { type: FocusMonitor },
1621
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1622
+ ];
1623
+ _MatTabLinkBase.propDecorators = {
1624
+ active: [{ type: Input }]
1625
+ };
1657
1626
  /**
1658
1627
  * Link inside of a `mat-tab-nav-bar`.
1659
1628
  */
1660
- let MatTabLink = /** @class */ (() => {
1661
- class MatTabLink extends _MatTabLinkBase {
1662
- constructor(tabNavBar, elementRef, ngZone, platform, globalRippleOptions, tabIndex, focusMonitor, animationMode) {
1663
- super(tabNavBar, elementRef, globalRippleOptions, tabIndex, focusMonitor, animationMode);
1664
- this._tabLinkRipple = new RippleRenderer(this, ngZone, elementRef, platform);
1665
- this._tabLinkRipple.setupTriggerEvents(elementRef.nativeElement);
1666
- }
1667
- ngOnDestroy() {
1668
- super.ngOnDestroy();
1669
- this._tabLinkRipple._removeTriggerEvents();
1670
- }
1629
+ class MatTabLink extends _MatTabLinkBase {
1630
+ constructor(tabNavBar, elementRef, ngZone, platform, globalRippleOptions, tabIndex, focusMonitor, animationMode) {
1631
+ super(tabNavBar, elementRef, globalRippleOptions, tabIndex, focusMonitor, animationMode);
1632
+ this._tabLinkRipple = new RippleRenderer(this, ngZone, elementRef, platform);
1633
+ this._tabLinkRipple.setupTriggerEvents(elementRef.nativeElement);
1671
1634
  }
1672
- MatTabLink.decorators = [
1673
- { type: Directive, args: [{
1674
- selector: '[mat-tab-link], [matTabLink]',
1675
- exportAs: 'matTabLink',
1676
- inputs: ['disabled', 'disableRipple', 'tabIndex'],
1677
- host: {
1678
- 'class': 'mat-tab-link mat-focus-indicator',
1679
- '[attr.aria-current]': 'active ? "page" : null',
1680
- '[attr.aria-disabled]': 'disabled',
1681
- '[attr.tabIndex]': 'tabIndex',
1682
- '[class.mat-tab-disabled]': 'disabled',
1683
- '[class.mat-tab-label-active]': 'active',
1684
- }
1685
- },] }
1686
- ];
1687
- MatTabLink.ctorParameters = () => [
1688
- { type: MatTabNav },
1689
- { type: ElementRef },
1690
- { type: NgZone },
1691
- { type: Platform },
1692
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RIPPLE_GLOBAL_OPTIONS,] }] },
1693
- { type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
1694
- { type: FocusMonitor },
1695
- { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1696
- ];
1697
- return MatTabLink;
1698
- })();
1635
+ ngOnDestroy() {
1636
+ super.ngOnDestroy();
1637
+ this._tabLinkRipple._removeTriggerEvents();
1638
+ }
1639
+ }
1640
+ MatTabLink.decorators = [
1641
+ { type: Directive, args: [{
1642
+ selector: '[mat-tab-link], [matTabLink]',
1643
+ exportAs: 'matTabLink',
1644
+ inputs: ['disabled', 'disableRipple', 'tabIndex'],
1645
+ host: {
1646
+ 'class': 'mat-tab-link mat-focus-indicator',
1647
+ '[attr.aria-current]': 'active ? "page" : null',
1648
+ '[attr.aria-disabled]': 'disabled',
1649
+ '[attr.tabIndex]': 'tabIndex',
1650
+ '[class.mat-tab-disabled]': 'disabled',
1651
+ '[class.mat-tab-label-active]': 'active',
1652
+ }
1653
+ },] }
1654
+ ];
1655
+ MatTabLink.ctorParameters = () => [
1656
+ { type: MatTabNav },
1657
+ { type: ElementRef },
1658
+ { type: NgZone },
1659
+ { type: Platform },
1660
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RIPPLE_GLOBAL_OPTIONS,] }] },
1661
+ { type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
1662
+ { type: FocusMonitor },
1663
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1664
+ ];
1699
1665
 
1700
1666
  /**
1701
1667
  * @license
@@ -1704,46 +1670,43 @@ let MatTabLink = /** @class */ (() => {
1704
1670
  * Use of this source code is governed by an MIT-style license that can be
1705
1671
  * found in the LICENSE file at https://angular.io/license
1706
1672
  */
1707
- let MatTabsModule = /** @class */ (() => {
1708
- class MatTabsModule {
1709
- }
1710
- MatTabsModule.decorators = [
1711
- { type: NgModule, args: [{
1712
- imports: [
1713
- CommonModule,
1714
- MatCommonModule,
1715
- PortalModule,
1716
- MatRippleModule,
1717
- ObserversModule,
1718
- A11yModule,
1719
- ],
1720
- // Don't export all components because some are only to be used internally.
1721
- exports: [
1722
- MatCommonModule,
1723
- MatTabGroup,
1724
- MatTabLabel,
1725
- MatTab,
1726
- MatTabNav,
1727
- MatTabLink,
1728
- MatTabContent,
1729
- ],
1730
- declarations: [
1731
- MatTabGroup,
1732
- MatTabLabel,
1733
- MatTab,
1734
- MatInkBar,
1735
- MatTabLabelWrapper,
1736
- MatTabNav,
1737
- MatTabLink,
1738
- MatTabBody,
1739
- MatTabBodyPortal,
1740
- MatTabHeader,
1741
- MatTabContent,
1742
- ],
1743
- },] }
1744
- ];
1745
- return MatTabsModule;
1746
- })();
1673
+ class MatTabsModule {
1674
+ }
1675
+ MatTabsModule.decorators = [
1676
+ { type: NgModule, args: [{
1677
+ imports: [
1678
+ CommonModule,
1679
+ MatCommonModule,
1680
+ PortalModule,
1681
+ MatRippleModule,
1682
+ ObserversModule,
1683
+ A11yModule,
1684
+ ],
1685
+ // Don't export all components because some are only to be used internally.
1686
+ exports: [
1687
+ MatCommonModule,
1688
+ MatTabGroup,
1689
+ MatTabLabel,
1690
+ MatTab,
1691
+ MatTabNav,
1692
+ MatTabLink,
1693
+ MatTabContent,
1694
+ ],
1695
+ declarations: [
1696
+ MatTabGroup,
1697
+ MatTabLabel,
1698
+ MatTab,
1699
+ MatInkBar,
1700
+ MatTabLabelWrapper,
1701
+ MatTabNav,
1702
+ MatTabLink,
1703
+ MatTabBody,
1704
+ MatTabBodyPortal,
1705
+ MatTabHeader,
1706
+ MatTabContent,
1707
+ ],
1708
+ },] }
1709
+ ];
1747
1710
 
1748
1711
  /**
1749
1712
  * @license
@@ -1765,5 +1728,5 @@ let MatTabsModule = /** @class */ (() => {
1765
1728
  * Generated bundle index. Do not edit.
1766
1729
  */
1767
1730
 
1768
- export { MAT_TABS_CONFIG, MAT_TAB_GROUP, MatInkBar, MatTab, MatTabBody, MatTabBodyPortal, MatTabChangeEvent, MatTabContent, MatTabGroup, MatTabHeader, MatTabLabel, MatTabLabelWrapper, MatTabLink, MatTabNav, MatTabsModule, _MAT_INK_BAR_POSITIONER, _MatTabBodyBase, _MatTabGroupBase, _MatTabHeaderBase, _MatTabLinkBase, _MatTabNavBase, matTabsAnimations, _MAT_INK_BAR_POSITIONER_FACTORY as ɵangular_material_src_material_tabs_tabs_a, MatPaginatedTabHeader as ɵangular_material_src_material_tabs_tabs_b };
1731
+ export { MAT_TABS_CONFIG, MAT_TAB_GROUP, MatInkBar, MatTab, MatTabBody, MatTabBodyPortal, MatTabChangeEvent, MatTabContent, MatTabGroup, MatTabHeader, MatTabLabel, MatTabLabelWrapper, MatTabLink, MatTabNav, MatTabsModule, _MAT_INK_BAR_POSITIONER, _MatTabBodyBase, _MatTabGroupBase, _MatTabHeaderBase, _MatTabLinkBase, _MatTabNavBase, matTabsAnimations, _MAT_INK_BAR_POSITIONER_FACTORY as ɵangular_material_src_material_tabs_tabs_a, MAT_TAB_LABEL as ɵangular_material_src_material_tabs_tabs_b, MAT_TAB_CONTENT as ɵangular_material_src_material_tabs_tabs_c, MatPaginatedTabHeader as ɵangular_material_src_material_tabs_tabs_d };
1769
1732
  //# sourceMappingURL=tabs.js.map