@angular/material 8.1.4 → 8.2.3

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 (358) hide show
  1. package/_theming.scss +13 -11
  2. package/autocomplete/typings/autocomplete-trigger.d.ts +5 -2
  3. package/autocomplete/typings/index.metadata.json +1 -1
  4. package/bundles/material-autocomplete.umd.js +48 -20
  5. package/bundles/material-autocomplete.umd.js.map +1 -1
  6. package/bundles/material-autocomplete.umd.min.js +1 -1
  7. package/bundles/material-autocomplete.umd.min.js.map +1 -1
  8. package/bundles/material-button.umd.js +5 -6
  9. package/bundles/material-button.umd.js.map +1 -1
  10. package/bundles/material-button.umd.min.js +1 -1
  11. package/bundles/material-button.umd.min.js.map +1 -1
  12. package/bundles/material-card.umd.js +1 -1
  13. package/bundles/material-card.umd.js.map +1 -1
  14. package/bundles/material-card.umd.min.js +1 -1
  15. package/bundles/material-card.umd.min.js.map +1 -1
  16. package/bundles/material-checkbox.umd.js +1 -1
  17. package/bundles/material-checkbox.umd.js.map +1 -1
  18. package/bundles/material-checkbox.umd.min.js.map +1 -1
  19. package/bundles/material-chips.umd.js +24 -4
  20. package/bundles/material-chips.umd.js.map +1 -1
  21. package/bundles/material-chips.umd.min.js +1 -1
  22. package/bundles/material-chips.umd.min.js.map +1 -1
  23. package/bundles/material-core.umd.js +20 -18
  24. package/bundles/material-core.umd.js.map +1 -1
  25. package/bundles/material-core.umd.min.js +2 -2
  26. package/bundles/material-core.umd.min.js.map +1 -1
  27. package/bundles/material-datepicker.umd.js +22 -2
  28. package/bundles/material-datepicker.umd.js.map +1 -1
  29. package/bundles/material-datepicker.umd.min.js +2 -2
  30. package/bundles/material-datepicker.umd.min.js.map +1 -1
  31. package/bundles/material-dialog.umd.js +28 -5
  32. package/bundles/material-dialog.umd.js.map +1 -1
  33. package/bundles/material-dialog.umd.min.js +1 -1
  34. package/bundles/material-dialog.umd.min.js.map +1 -1
  35. package/bundles/material-form-field.umd.js +15 -2
  36. package/bundles/material-form-field.umd.js.map +1 -1
  37. package/bundles/material-form-field.umd.min.js +1 -1
  38. package/bundles/material-form-field.umd.min.js.map +1 -1
  39. package/bundles/material-grid-list.umd.js +1 -1
  40. package/bundles/material-grid-list.umd.min.js +1 -1
  41. package/bundles/material-icon.umd.js +103 -42
  42. package/bundles/material-icon.umd.js.map +1 -1
  43. package/bundles/material-icon.umd.min.js +1 -1
  44. package/bundles/material-icon.umd.min.js.map +1 -1
  45. package/bundles/material-list.umd.js +4 -1
  46. package/bundles/material-list.umd.js.map +1 -1
  47. package/bundles/material-list.umd.min.js +1 -1
  48. package/bundles/material-list.umd.min.js.map +1 -1
  49. package/bundles/material-menu.umd.js +35 -19
  50. package/bundles/material-menu.umd.js.map +1 -1
  51. package/bundles/material-menu.umd.min.js +1 -1
  52. package/bundles/material-menu.umd.min.js.map +1 -1
  53. package/bundles/material-paginator.umd.js +1 -1
  54. package/bundles/material-paginator.umd.js.map +1 -1
  55. package/bundles/material-paginator.umd.min.js +1 -1
  56. package/bundles/material-paginator.umd.min.js.map +1 -1
  57. package/bundles/material-progress-spinner.umd.js +34 -23
  58. package/bundles/material-progress-spinner.umd.js.map +1 -1
  59. package/bundles/material-progress-spinner.umd.min.js +1 -1
  60. package/bundles/material-progress-spinner.umd.min.js.map +1 -1
  61. package/bundles/material-radio.umd.js +3 -0
  62. package/bundles/material-radio.umd.js.map +1 -1
  63. package/bundles/material-radio.umd.min.js +1 -1
  64. package/bundles/material-radio.umd.min.js.map +1 -1
  65. package/bundles/material-select.umd.js +14 -2
  66. package/bundles/material-select.umd.js.map +1 -1
  67. package/bundles/material-select.umd.min.js +1 -1
  68. package/bundles/material-select.umd.min.js.map +1 -1
  69. package/bundles/material-slide-toggle.umd.js +3 -1
  70. package/bundles/material-slide-toggle.umd.js.map +1 -1
  71. package/bundles/material-slide-toggle.umd.min.js +1 -1
  72. package/bundles/material-slide-toggle.umd.min.js.map +1 -1
  73. package/bundles/material-slider.umd.js +6 -3
  74. package/bundles/material-slider.umd.js.map +1 -1
  75. package/bundles/material-slider.umd.min.js +1 -1
  76. package/bundles/material-slider.umd.min.js.map +1 -1
  77. package/bundles/material-snack-bar.umd.js +7 -8
  78. package/bundles/material-snack-bar.umd.js.map +1 -1
  79. package/bundles/material-snack-bar.umd.min.js +1 -1
  80. package/bundles/material-snack-bar.umd.min.js.map +1 -1
  81. package/bundles/material-sort.umd.js +0 -1
  82. package/bundles/material-sort.umd.js.map +1 -1
  83. package/bundles/material-sort.umd.min.js +1 -1
  84. package/bundles/material-sort.umd.min.js.map +1 -1
  85. package/bundles/material-table.umd.js +14 -4
  86. package/bundles/material-table.umd.js.map +1 -1
  87. package/bundles/material-table.umd.min.js +1 -1
  88. package/bundles/material-table.umd.min.js.map +1 -1
  89. package/bundles/material-tabs.umd.js +1390 -1208
  90. package/bundles/material-tabs.umd.js.map +1 -1
  91. package/bundles/material-tabs.umd.min.js +2 -2
  92. package/bundles/material-tabs.umd.min.js.map +1 -1
  93. package/bundles/material-tooltip.umd.js +16 -1
  94. package/bundles/material-tooltip.umd.js.map +1 -1
  95. package/bundles/material-tooltip.umd.min.js +1 -1
  96. package/bundles/material-tooltip.umd.min.js.map +1 -1
  97. package/bundles/material.umd.js +1767 -1346
  98. package/bundles/material.umd.js.map +1 -1
  99. package/bundles/material.umd.min.js +19 -19
  100. package/bundles/material.umd.min.js.map +1 -1
  101. package/button/typings/button.d.ts +1 -1
  102. package/button/typings/index.metadata.json +1 -1
  103. package/card/typings/index.metadata.json +1 -1
  104. package/chips/typings/chip.d.ts +4 -2
  105. package/chips/typings/index.metadata.json +1 -1
  106. package/core/typings/common-behaviors/common-module.d.ts +2 -2
  107. package/core/typings/datetime/date-adapter.d.ts +1 -1
  108. package/core/typings/datetime/native-date-adapter.d.ts +1 -1
  109. package/core/typings/index.metadata.json +1 -1
  110. package/core/typings/ripple/ripple-renderer.d.ts +2 -2
  111. package/core/typings/ripple/ripple.d.ts +1 -1
  112. package/datepicker/typings/datepicker-intl.d.ts +2 -0
  113. package/datepicker/typings/index.metadata.json +1 -1
  114. package/dialog/typings/dialog-config.d.ts +9 -7
  115. package/dialog/typings/dialog-content-directives.d.ts +2 -0
  116. package/dialog/typings/dialog-ref.d.ts +10 -0
  117. package/dialog/typings/index.metadata.json +1 -1
  118. package/esm2015/autocomplete.js +44 -19
  119. package/esm2015/autocomplete.js.map +1 -1
  120. package/esm2015/button.js +3 -5
  121. package/esm2015/button.js.map +1 -1
  122. package/esm2015/card.js +1 -1
  123. package/esm2015/card.js.map +1 -1
  124. package/esm2015/checkbox.js +1 -1
  125. package/esm2015/checkbox.js.map +1 -1
  126. package/esm2015/chips.js +22 -5
  127. package/esm2015/chips.js.map +1 -1
  128. package/esm2015/core.js +19 -17
  129. package/esm2015/core.js.map +1 -1
  130. package/esm2015/datepicker.js +15 -2
  131. package/esm2015/datepicker.js.map +1 -1
  132. package/esm2015/dialog.js +23 -5
  133. package/esm2015/dialog.js.map +1 -1
  134. package/esm2015/form-field.js +15 -2
  135. package/esm2015/form-field.js.map +1 -1
  136. package/esm2015/grid-list.js +1 -1
  137. package/esm2015/icon.js +93 -40
  138. package/esm2015/icon.js.map +1 -1
  139. package/esm2015/list.js +4 -1
  140. package/esm2015/list.js.map +1 -1
  141. package/esm2015/material.js +3 -3
  142. package/esm2015/menu.js +31 -10
  143. package/esm2015/menu.js.map +1 -1
  144. package/esm2015/paginator.js +1 -1
  145. package/esm2015/paginator.js.map +1 -1
  146. package/esm2015/progress-spinner.js +31 -23
  147. package/esm2015/progress-spinner.js.map +1 -1
  148. package/esm2015/radio.js +3 -0
  149. package/esm2015/radio.js.map +1 -1
  150. package/esm2015/select.js +14 -2
  151. package/esm2015/select.js.map +1 -1
  152. package/esm2015/slide-toggle.js +3 -1
  153. package/esm2015/slide-toggle.js.map +1 -1
  154. package/esm2015/slider.js +6 -2
  155. package/esm2015/slider.js.map +1 -1
  156. package/esm2015/snack-bar.js +7 -8
  157. package/esm2015/snack-bar.js.map +1 -1
  158. package/esm2015/sort.js +0 -1
  159. package/esm2015/sort.js.map +1 -1
  160. package/esm2015/table.js +9 -4
  161. package/esm2015/table.js.map +1 -1
  162. package/esm2015/tabs.js +1094 -890
  163. package/esm2015/tabs.js.map +1 -1
  164. package/esm2015/tooltip.js +15 -1
  165. package/esm2015/tooltip.js.map +1 -1
  166. package/esm5/autocomplete.es5.js +48 -19
  167. package/esm5/autocomplete.es5.js.map +1 -1
  168. package/esm5/button.es5.js +5 -6
  169. package/esm5/button.es5.js.map +1 -1
  170. package/esm5/card.es5.js +1 -1
  171. package/esm5/card.es5.js.map +1 -1
  172. package/esm5/checkbox.es5.js +1 -1
  173. package/esm5/checkbox.es5.js.map +1 -1
  174. package/esm5/chips.es5.js +25 -5
  175. package/esm5/chips.es5.js.map +1 -1
  176. package/esm5/core.es5.js +21 -19
  177. package/esm5/core.es5.js.map +1 -1
  178. package/esm5/datepicker.es5.js +22 -2
  179. package/esm5/datepicker.es5.js.map +1 -1
  180. package/esm5/dialog.es5.js +28 -5
  181. package/esm5/dialog.es5.js.map +1 -1
  182. package/esm5/form-field.es5.js +15 -2
  183. package/esm5/form-field.es5.js.map +1 -1
  184. package/esm5/grid-list.es5.js +1 -1
  185. package/esm5/icon.es5.js +101 -40
  186. package/esm5/icon.es5.js.map +1 -1
  187. package/esm5/list.es5.js +4 -1
  188. package/esm5/list.es5.js.map +1 -1
  189. package/esm5/material.es5.js +3 -3
  190. package/esm5/menu.es5.js +33 -17
  191. package/esm5/menu.es5.js.map +1 -1
  192. package/esm5/paginator.es5.js +1 -1
  193. package/esm5/paginator.es5.js.map +1 -1
  194. package/esm5/progress-spinner.es5.js +34 -23
  195. package/esm5/progress-spinner.es5.js.map +1 -1
  196. package/esm5/radio.es5.js +3 -0
  197. package/esm5/radio.es5.js.map +1 -1
  198. package/esm5/select.es5.js +14 -2
  199. package/esm5/select.es5.js.map +1 -1
  200. package/esm5/slide-toggle.es5.js +3 -1
  201. package/esm5/slide-toggle.es5.js.map +1 -1
  202. package/esm5/slider.es5.js +6 -3
  203. package/esm5/slider.es5.js.map +1 -1
  204. package/esm5/snack-bar.es5.js +7 -8
  205. package/esm5/snack-bar.es5.js.map +1 -1
  206. package/esm5/sort.es5.js +0 -1
  207. package/esm5/sort.es5.js.map +1 -1
  208. package/esm5/table.es5.js +14 -4
  209. package/esm5/table.es5.js.map +1 -1
  210. package/esm5/tabs.es5.js +1384 -1207
  211. package/esm5/tabs.es5.js.map +1 -1
  212. package/esm5/tooltip.es5.js +16 -1
  213. package/esm5/tooltip.es5.js.map +1 -1
  214. package/form-field/typings/form-field.d.ts +2 -0
  215. package/form-field/typings/index.metadata.json +1 -1
  216. package/grid-list/typings/index.d.ts +1 -1
  217. package/grid-list/typings/index.metadata.json +1 -1
  218. package/icon/typings/icon-registry.d.ts +17 -11
  219. package/icon/typings/icon.d.ts +3 -2
  220. package/icon/typings/index.metadata.json +1 -1
  221. package/list/typings/index.metadata.json +1 -1
  222. package/menu/typings/index.d.ts +2 -2
  223. package/menu/typings/index.metadata.json +1 -1
  224. package/menu/typings/menu-trigger.d.ts +2 -5
  225. package/package.json +5 -5
  226. package/prebuilt-themes/deeppurple-amber.css +1 -1
  227. package/prebuilt-themes/indigo-pink.css +1 -1
  228. package/prebuilt-themes/pink-bluegrey.css +1 -1
  229. package/prebuilt-themes/purple-green.css +1 -1
  230. package/progress-spinner/typings/index.metadata.json +1 -1
  231. package/progress-spinner/typings/progress-spinner.d.ts +3 -2
  232. package/radio/typings/index.metadata.json +1 -1
  233. package/schematics/ng-add/setup-project.js +8 -8
  234. package/schematics/ng-add/setup-project.js.map +1 -1
  235. package/schematics/ng-add/theming/theming.js +6 -6
  236. package/schematics/ng-add/theming/theming.js.map +1 -1
  237. package/schematics/ng-update/index.js +2 -2
  238. package/schematics/ng-update/index.js.map +1 -1
  239. package/select/typings/index.metadata.json +1 -1
  240. package/select/typings/select.d.ts +2 -0
  241. package/slide-toggle/typings/index.metadata.json +1 -1
  242. package/slider/typings/index.metadata.json +1 -1
  243. package/slider/typings/slider.d.ts +2 -2
  244. package/snack-bar/typings/index.metadata.json +1 -1
  245. package/sort/typings/index.metadata.json +1 -1
  246. package/table/typings/index.metadata.json +1 -1
  247. package/table/typings/table-data-source.d.ts +5 -0
  248. package/tabs/typings/index.d.ts +2 -2
  249. package/tabs/typings/index.metadata.json +1 -1
  250. package/tabs/typings/paginated-tab-header.d.ts +8 -5
  251. package/tabs/typings/public-api.d.ts +4 -4
  252. package/tabs/typings/tab-body.d.ts +11 -3
  253. package/tabs/typings/tab-group.d.ts +24 -11
  254. package/tabs/typings/tab-header.d.ts +12 -5
  255. package/tabs/typings/tab-nav-bar/tab-nav-bar.d.ts +38 -19
  256. package/tooltip/typings/index.metadata.json +1 -1
  257. package/typings/autocomplete/autocomplete-trigger.d.ts +5 -2
  258. package/typings/autocomplete/index.metadata.json +1 -1
  259. package/typings/button/button.d.ts +1 -1
  260. package/typings/button/index.metadata.json +1 -1
  261. package/typings/card/index.metadata.json +1 -1
  262. package/typings/chips/chip.d.ts +4 -2
  263. package/typings/chips/index.metadata.json +1 -1
  264. package/typings/core/common-behaviors/common-module.d.ts +2 -2
  265. package/typings/core/datetime/date-adapter.d.ts +1 -1
  266. package/typings/core/datetime/native-date-adapter.d.ts +1 -1
  267. package/typings/core/index.metadata.json +1 -1
  268. package/typings/core/ripple/ripple-renderer.d.ts +2 -2
  269. package/typings/core/ripple/ripple.d.ts +1 -1
  270. package/typings/datepicker/datepicker-intl.d.ts +2 -0
  271. package/typings/datepicker/index.metadata.json +1 -1
  272. package/typings/dialog/dialog-config.d.ts +9 -7
  273. package/typings/dialog/dialog-content-directives.d.ts +2 -0
  274. package/typings/dialog/dialog-ref.d.ts +10 -0
  275. package/typings/dialog/index.metadata.json +1 -1
  276. package/typings/esm5/autocomplete/autocomplete-trigger.d.ts +5 -2
  277. package/typings/esm5/autocomplete/index.metadata.json +1 -1
  278. package/typings/esm5/button/button.d.ts +1 -1
  279. package/typings/esm5/button/index.metadata.json +1 -1
  280. package/typings/esm5/card/index.metadata.json +1 -1
  281. package/typings/esm5/chips/chip.d.ts +4 -2
  282. package/typings/esm5/chips/index.metadata.json +1 -1
  283. package/typings/esm5/core/common-behaviors/common-module.d.ts +2 -2
  284. package/typings/esm5/core/datetime/date-adapter.d.ts +1 -1
  285. package/typings/esm5/core/datetime/native-date-adapter.d.ts +1 -1
  286. package/typings/esm5/core/index.metadata.json +1 -1
  287. package/typings/esm5/core/ripple/ripple-renderer.d.ts +2 -2
  288. package/typings/esm5/core/ripple/ripple.d.ts +1 -1
  289. package/typings/esm5/datepicker/datepicker-intl.d.ts +2 -0
  290. package/typings/esm5/datepicker/index.metadata.json +1 -1
  291. package/typings/esm5/dialog/dialog-config.d.ts +9 -7
  292. package/typings/esm5/dialog/dialog-content-directives.d.ts +2 -0
  293. package/typings/esm5/dialog/dialog-ref.d.ts +10 -0
  294. package/typings/esm5/dialog/index.metadata.json +1 -1
  295. package/typings/esm5/form-field/form-field.d.ts +2 -0
  296. package/typings/esm5/form-field/index.metadata.json +1 -1
  297. package/typings/esm5/grid-list/index.d.ts +1 -1
  298. package/typings/esm5/grid-list/index.metadata.json +1 -1
  299. package/typings/esm5/icon/icon-registry.d.ts +17 -11
  300. package/typings/esm5/icon/icon.d.ts +3 -2
  301. package/typings/esm5/icon/index.metadata.json +1 -1
  302. package/typings/esm5/list/index.metadata.json +1 -1
  303. package/typings/esm5/menu/index.d.ts +2 -2
  304. package/typings/esm5/menu/index.metadata.json +1 -1
  305. package/typings/esm5/menu/menu-trigger.d.ts +2 -5
  306. package/typings/esm5/progress-spinner/index.metadata.json +1 -1
  307. package/typings/esm5/progress-spinner/progress-spinner.d.ts +3 -2
  308. package/typings/esm5/radio/index.metadata.json +1 -1
  309. package/typings/esm5/select/index.metadata.json +1 -1
  310. package/typings/esm5/select/select.d.ts +2 -0
  311. package/typings/esm5/slide-toggle/index.metadata.json +1 -1
  312. package/typings/esm5/slider/index.metadata.json +1 -1
  313. package/typings/esm5/slider/slider.d.ts +2 -2
  314. package/typings/esm5/snack-bar/index.metadata.json +1 -1
  315. package/typings/esm5/sort/index.metadata.json +1 -1
  316. package/typings/esm5/table/index.metadata.json +1 -1
  317. package/typings/esm5/table/table-data-source.d.ts +5 -0
  318. package/typings/esm5/tabs/index.d.ts +2 -2
  319. package/typings/esm5/tabs/index.metadata.json +1 -1
  320. package/typings/esm5/tabs/paginated-tab-header.d.ts +8 -5
  321. package/typings/esm5/tabs/public-api.d.ts +4 -4
  322. package/typings/esm5/tabs/tab-body.d.ts +11 -3
  323. package/typings/esm5/tabs/tab-group.d.ts +24 -11
  324. package/typings/esm5/tabs/tab-header.d.ts +12 -5
  325. package/typings/esm5/tabs/tab-nav-bar/tab-nav-bar.d.ts +38 -19
  326. package/typings/esm5/tooltip/index.metadata.json +1 -1
  327. package/typings/form-field/form-field.d.ts +2 -0
  328. package/typings/form-field/index.metadata.json +1 -1
  329. package/typings/grid-list/index.d.ts +1 -1
  330. package/typings/grid-list/index.metadata.json +1 -1
  331. package/typings/icon/icon-registry.d.ts +17 -11
  332. package/typings/icon/icon.d.ts +3 -2
  333. package/typings/icon/index.metadata.json +1 -1
  334. package/typings/list/index.metadata.json +1 -1
  335. package/typings/menu/index.d.ts +2 -2
  336. package/typings/menu/index.metadata.json +1 -1
  337. package/typings/menu/menu-trigger.d.ts +2 -5
  338. package/typings/progress-spinner/index.metadata.json +1 -1
  339. package/typings/progress-spinner/progress-spinner.d.ts +3 -2
  340. package/typings/radio/index.metadata.json +1 -1
  341. package/typings/select/index.metadata.json +1 -1
  342. package/typings/select/select.d.ts +2 -0
  343. package/typings/slide-toggle/index.metadata.json +1 -1
  344. package/typings/slider/index.metadata.json +1 -1
  345. package/typings/slider/slider.d.ts +2 -2
  346. package/typings/snack-bar/index.metadata.json +1 -1
  347. package/typings/sort/index.metadata.json +1 -1
  348. package/typings/table/index.metadata.json +1 -1
  349. package/typings/table/table-data-source.d.ts +5 -0
  350. package/typings/tabs/index.d.ts +2 -2
  351. package/typings/tabs/index.metadata.json +1 -1
  352. package/typings/tabs/paginated-tab-header.d.ts +8 -5
  353. package/typings/tabs/public-api.d.ts +4 -4
  354. package/typings/tabs/tab-body.d.ts +11 -3
  355. package/typings/tabs/tab-group.d.ts +24 -11
  356. package/typings/tabs/tab-header.d.ts +12 -5
  357. package/typings/tabs/tab-nav-bar/tab-nav-bar.d.ts +38 -19
  358. package/typings/tooltip/index.metadata.json +1 -1
package/esm5/tabs.es5.js CHANGED
@@ -14,7 +14,7 @@ import { Subject, Subscription, merge, of, timer, fromEvent } from 'rxjs';
14
14
  import { animate, state, style, transition, trigger } from '@angular/animations';
15
15
  import { Directionality } from '@angular/cdk/bidi';
16
16
  import { startWith, distinctUntilChanged, takeUntil } from 'rxjs/operators';
17
- import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
17
+ import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
18
18
  import { ViewportRuler } from '@angular/cdk/scrolling';
19
19
  import { FocusKeyManager, FocusMonitor, A11yModule } from '@angular/cdk/a11y';
20
20
  import { END, ENTER, HOME, SPACE, hasModifierKey } from '@angular/cdk/keycodes';
@@ -443,11 +443,12 @@ var MatTabBodyPortal = /** @class */ (function (_super) {
443
443
  return MatTabBodyPortal;
444
444
  }(CdkPortalOutlet));
445
445
  /**
446
- * Wrapper for the contents of a tab.
446
+ * Base class with all of the `MatTabBody` functionality.
447
447
  * \@docs-private
448
+ * @abstract
448
449
  */
449
- var MatTabBody = /** @class */ (function () {
450
- function MatTabBody(_elementRef, _dir, changeDetectorRef) {
450
+ var _MatTabBodyBase = /** @class */ (function () {
451
+ function _MatTabBodyBase(_elementRef, _dir, changeDetectorRef) {
451
452
  var _this = this;
452
453
  this._elementRef = _elementRef;
453
454
  this._dir = _dir;
@@ -514,7 +515,7 @@ var MatTabBody = /** @class */ (function () {
514
515
  }
515
516
  }));
516
517
  }
517
- Object.defineProperty(MatTabBody.prototype, "position", {
518
+ Object.defineProperty(_MatTabBodyBase.prototype, "position", {
518
519
  /** The shifted index position of the tab body, where zero represents the active center tab. */
519
520
  set: /**
520
521
  * The shifted index position of the tab body, where zero represents the active center tab.
@@ -537,7 +538,7 @@ var MatTabBody = /** @class */ (function () {
537
538
  * special position states that transition the tab from the left or right before centering.
538
539
  * @return {?}
539
540
  */
540
- MatTabBody.prototype.ngOnInit = /**
541
+ _MatTabBodyBase.prototype.ngOnInit = /**
541
542
  * After initialized, check if the content is centered and has an origin. If so, set the
542
543
  * special position states that transition the tab from the left or right before centering.
543
544
  * @return {?}
@@ -550,7 +551,7 @@ var MatTabBody = /** @class */ (function () {
550
551
  /**
551
552
  * @return {?}
552
553
  */
553
- MatTabBody.prototype.ngOnDestroy = /**
554
+ _MatTabBodyBase.prototype.ngOnDestroy = /**
554
555
  * @return {?}
555
556
  */
556
557
  function () {
@@ -561,7 +562,7 @@ var MatTabBody = /** @class */ (function () {
561
562
  * @param {?} event
562
563
  * @return {?}
563
564
  */
564
- MatTabBody.prototype._onTranslateTabStarted = /**
565
+ _MatTabBodyBase.prototype._onTranslateTabStarted = /**
565
566
  * @param {?} event
566
567
  * @return {?}
567
568
  */
@@ -578,7 +579,7 @@ var MatTabBody = /** @class */ (function () {
578
579
  * The text direction of the containing app.
579
580
  * @return {?}
580
581
  */
581
- MatTabBody.prototype._getLayoutDirection = /**
582
+ _MatTabBodyBase.prototype._getLayoutDirection = /**
582
583
  * The text direction of the containing app.
583
584
  * @return {?}
584
585
  */
@@ -591,7 +592,7 @@ var MatTabBody = /** @class */ (function () {
591
592
  * @param {?} position
592
593
  * @return {?}
593
594
  */
594
- MatTabBody.prototype._isCenterPosition = /**
595
+ _MatTabBodyBase.prototype._isCenterPosition = /**
595
596
  * Whether the provided position state is considered center, regardless of origin.
596
597
  * @param {?} position
597
598
  * @return {?}
@@ -608,7 +609,7 @@ var MatTabBody = /** @class */ (function () {
608
609
  * @param {?=} dir
609
610
  * @return {?}
610
611
  */
611
- MatTabBody.prototype._computePositionAnimationState = /**
612
+ _MatTabBodyBase.prototype._computePositionAnimationState = /**
612
613
  * Computes the position state that will be used for the tab-body animation trigger.
613
614
  * @private
614
615
  * @param {?=} dir
@@ -636,7 +637,7 @@ var MatTabBody = /** @class */ (function () {
636
637
  * @private
637
638
  * @return {?}
638
639
  */
639
- MatTabBody.prototype._computePositionFromOrigin = /**
640
+ _MatTabBodyBase.prototype._computePositionFromOrigin = /**
640
641
  * Computes the position state based on the specified origin position. This is used if the
641
642
  * tab is becoming visible immediately after creation.
642
643
  * @private
@@ -650,210 +651,175 @@ var MatTabBody = /** @class */ (function () {
650
651
  }
651
652
  return 'right-origin-center';
652
653
  };
653
- MatTabBody.decorators = [
654
- { type: Component, args: [{selector: 'mat-tab-body',
655
- template: "<div class=\"mat-tab-body-content\" #content [@translateTab]=\"{ value: _position, params: {animationDuration: animationDuration} }\" (@translateTab.start)=\"_onTranslateTabStarted($event)\" (@translateTab.done)=\"_translateTabComplete.next($event)\"><ng-template matTabBodyHost></ng-template></div>",
656
- styles: [".mat-tab-body-content{height:100%;overflow:auto}.mat-tab-group-dynamic-height .mat-tab-body-content{overflow:hidden}"],
657
- encapsulation: ViewEncapsulation.None,
658
- changeDetection: ChangeDetectionStrategy.OnPush,
659
- animations: [matTabsAnimations.translateTab],
660
- host: {
661
- 'class': 'mat-tab-body',
662
- },
654
+ _MatTabBodyBase.decorators = [
655
+ { type: Directive, args: [{
656
+ // TODO(crisbeto): this selector can be removed when we update to Angular 9.0.
657
+ selector: 'do-not-use-abstract-mat-tab-body-base'
663
658
  },] },
664
659
  ];
665
660
  /** @nocollapse */
666
- MatTabBody.ctorParameters = function () { return [
661
+ _MatTabBodyBase.ctorParameters = function () { return [
667
662
  { type: ElementRef },
668
663
  { type: Directionality, decorators: [{ type: Optional }] },
669
664
  { type: ChangeDetectorRef }
670
665
  ]; };
671
- MatTabBody.propDecorators = {
666
+ _MatTabBodyBase.propDecorators = {
672
667
  _onCentering: [{ type: Output }],
673
668
  _beforeCentering: [{ type: Output }],
674
669
  _afterLeavingCenter: [{ type: Output }],
675
670
  _onCentered: [{ type: Output }],
676
- _portalHost: [{ type: ViewChild, args: [PortalHostDirective, { static: false },] }],
677
671
  _content: [{ type: Input, args: ['content',] }],
678
672
  origin: [{ type: Input }],
679
673
  animationDuration: [{ type: Input }],
680
674
  position: [{ type: Input }]
681
675
  };
682
- return MatTabBody;
683
- }());
684
-
685
- /**
686
- * @fileoverview added by tsickle
687
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
688
- */
689
- // Boilerplate for applying mixins to MatTabLabelWrapper.
690
- /**
691
- * \@docs-private
692
- */
693
- var
694
- // Boilerplate for applying mixins to MatTabLabelWrapper.
695
- /**
696
- * \@docs-private
697
- */
698
- MatTabLabelWrapperBase = /** @class */ (function () {
699
- function MatTabLabelWrapperBase() {
700
- }
701
- return MatTabLabelWrapperBase;
676
+ return _MatTabBodyBase;
702
677
  }());
703
- /** @type {?} */
704
- var _MatTabLabelWrapperMixinBase = mixinDisabled(MatTabLabelWrapperBase);
705
678
  /**
706
- * Used in the `mat-tab-group` view to display tab labels.
679
+ * Wrapper for the contents of a tab.
707
680
  * \@docs-private
708
681
  */
709
- var MatTabLabelWrapper = /** @class */ (function (_super) {
710
- __extends(MatTabLabelWrapper, _super);
711
- function MatTabLabelWrapper(elementRef) {
712
- var _this = _super.call(this) || this;
713
- _this.elementRef = elementRef;
714
- return _this;
682
+ var MatTabBody = /** @class */ (function (_super) {
683
+ __extends(MatTabBody, _super);
684
+ function MatTabBody(elementRef, dir, changeDetectorRef) {
685
+ return _super.call(this, elementRef, dir, changeDetectorRef) || this;
715
686
  }
716
- /** Sets focus on the wrapper element */
717
- /**
718
- * Sets focus on the wrapper element
719
- * @return {?}
720
- */
721
- MatTabLabelWrapper.prototype.focus = /**
722
- * Sets focus on the wrapper element
723
- * @return {?}
724
- */
725
- function () {
726
- this.elementRef.nativeElement.focus();
727
- };
728
- /**
729
- * @return {?}
730
- */
731
- MatTabLabelWrapper.prototype.getOffsetLeft = /**
732
- * @return {?}
733
- */
734
- function () {
735
- return this.elementRef.nativeElement.offsetLeft;
736
- };
737
- /**
738
- * @return {?}
739
- */
740
- MatTabLabelWrapper.prototype.getOffsetWidth = /**
741
- * @return {?}
742
- */
743
- function () {
744
- return this.elementRef.nativeElement.offsetWidth;
745
- };
746
- MatTabLabelWrapper.decorators = [
747
- { type: Directive, args: [{
748
- selector: '[matTabLabelWrapper]',
749
- inputs: ['disabled'],
687
+ MatTabBody.decorators = [
688
+ { type: Component, args: [{selector: 'mat-tab-body',
689
+ template: "<div class=\"mat-tab-body-content\" #content [@translateTab]=\"{ value: _position, params: {animationDuration: animationDuration} }\" (@translateTab.start)=\"_onTranslateTabStarted($event)\" (@translateTab.done)=\"_translateTabComplete.next($event)\"><ng-template matTabBodyHost></ng-template></div>",
690
+ styles: [".mat-tab-body-content{height:100%;overflow:auto}.mat-tab-group-dynamic-height .mat-tab-body-content{overflow:hidden}"],
691
+ encapsulation: ViewEncapsulation.None,
692
+ changeDetection: ChangeDetectionStrategy.OnPush,
693
+ animations: [matTabsAnimations.translateTab],
750
694
  host: {
751
- '[class.mat-tab-disabled]': 'disabled',
752
- '[attr.aria-disabled]': '!!disabled',
695
+ 'class': 'mat-tab-body',
753
696
  }
754
697
  },] },
755
698
  ];
756
699
  /** @nocollapse */
757
- MatTabLabelWrapper.ctorParameters = function () { return [
758
- { type: ElementRef }
700
+ MatTabBody.ctorParameters = function () { return [
701
+ { type: ElementRef },
702
+ { type: Directionality, decorators: [{ type: Optional }] },
703
+ { type: ChangeDetectorRef }
759
704
  ]; };
760
- return MatTabLabelWrapper;
761
- }(_MatTabLabelWrapperMixinBase));
705
+ MatTabBody.propDecorators = {
706
+ _portalHost: [{ type: ViewChild, args: [PortalHostDirective, { static: false },] }]
707
+ };
708
+ return MatTabBody;
709
+ }(_MatTabBodyBase));
762
710
 
763
711
  /**
764
712
  * @fileoverview added by tsickle
765
713
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
766
714
  */
767
715
  /**
768
- * Config used to bind passive event listeners
716
+ * Used to generate unique ID's for each tab component
769
717
  * @type {?}
770
718
  */
771
- var passiveEventListenerOptions = (/** @type {?} */ (normalizePassiveListenerOptions({ passive: true })));
719
+ var nextId = 0;
772
720
  /**
773
- * The distance in pixels that will be overshot when scrolling a tab label into view. This helps
774
- * provide a small affordance to the label next to it.
775
- * @type {?}
721
+ * A simple change event emitted on focus or selection changes.
776
722
  */
777
- var EXAGGERATED_OVERSCROLL = 60;
723
+ var /**
724
+ * A simple change event emitted on focus or selection changes.
725
+ */
726
+ MatTabChangeEvent = /** @class */ (function () {
727
+ function MatTabChangeEvent() {
728
+ }
729
+ return MatTabChangeEvent;
730
+ }());
778
731
  /**
779
- * Amount of milliseconds to wait before starting to scroll the header automatically.
780
- * Set a little conservatively in order to handle fake events dispatched on touch devices.
732
+ * Injection token that can be used to provide the default options the tabs module.
781
733
  * @type {?}
782
734
  */
783
- var HEADER_SCROLL_DELAY = 650;
735
+ var MAT_TABS_CONFIG = new InjectionToken('MAT_TABS_CONFIG');
736
+ // Boilerplate for applying mixins to MatTabGroup.
784
737
  /**
785
- * Interval in milliseconds at which to scroll the header
786
- * while the user is holding their pointer.
787
- * @type {?}
738
+ * \@docs-private
788
739
  */
789
- var HEADER_SCROLL_INTERVAL = 100;
740
+ var
741
+ // Boilerplate for applying mixins to MatTabGroup.
790
742
  /**
791
- * Base class for a tab header that supported pagination.
792
- * @abstract
743
+ * \@docs-private
793
744
  */
794
- var MatPaginatedTabHeader = /** @class */ (function () {
795
- function MatPaginatedTabHeader(_elementRef, _changeDetectorRef, _viewportRuler, _dir, _ngZone, _platform, _animationMode) {
796
- var _this = this;
745
+ MatTabGroupMixinBase = /** @class */ (function () {
746
+ function MatTabGroupMixinBase(_elementRef) {
797
747
  this._elementRef = _elementRef;
798
- this._changeDetectorRef = _changeDetectorRef;
799
- this._viewportRuler = _viewportRuler;
800
- this._dir = _dir;
801
- this._ngZone = _ngZone;
802
- this._platform = _platform;
803
- this._animationMode = _animationMode;
748
+ }
749
+ return MatTabGroupMixinBase;
750
+ }());
751
+ /** @type {?} */
752
+ var _MatTabGroupMixinBase = mixinColor(mixinDisableRipple(MatTabGroupMixinBase), 'primary');
753
+ /**
754
+ * Base class with all of the `MatTabGroupBase` functionality.
755
+ * \@docs-private
756
+ * @abstract
757
+ */
758
+ var _MatTabGroupBase = /** @class */ (function (_super) {
759
+ __extends(_MatTabGroupBase, _super);
760
+ function _MatTabGroupBase(elementRef, _changeDetectorRef, defaultConfig, _animationMode) {
761
+ var _this = _super.call(this, elementRef) || this;
762
+ _this._changeDetectorRef = _changeDetectorRef;
763
+ _this._animationMode = _animationMode;
804
764
  /**
805
- * The distance in pixels that the tab labels should be translated to the left.
765
+ * The tab index that should be selected after the content has been checked.
806
766
  */
807
- this._scrollDistance = 0;
767
+ _this._indexToSelect = 0;
808
768
  /**
809
- * Whether the header should scroll to the selected index after the view has been checked.
769
+ * Snapshot of the height of the tab body wrapper before another tab is activated.
810
770
  */
811
- this._selectedIndexChanged = false;
771
+ _this._tabBodyWrapperHeight = 0;
812
772
  /**
813
- * Emits when the component is destroyed.
773
+ * Subscription to tabs being added/removed.
814
774
  */
815
- this._destroyed = new Subject();
775
+ _this._tabsSubscription = Subscription.EMPTY;
816
776
  /**
817
- * Whether the controls for pagination should be displayed
777
+ * Subscription to changes in the tab labels.
818
778
  */
819
- this._showPaginationControls = false;
779
+ _this._tabLabelSubscription = Subscription.EMPTY;
780
+ _this._dynamicHeight = false;
781
+ _this._selectedIndex = null;
820
782
  /**
821
- * Whether the tab list can be scrolled more towards the end of the tab label list.
783
+ * Position of the tab header.
822
784
  */
823
- this._disableScrollAfter = true;
785
+ _this.headerPosition = 'above';
824
786
  /**
825
- * Whether the tab list can be scrolled more towards the beginning of the tab label list.
787
+ * Output to enable support for two-way binding on `[(selectedIndex)]`
826
788
  */
827
- this._disableScrollBefore = true;
789
+ _this.selectedIndexChange = new EventEmitter();
828
790
  /**
829
- * Stream that will stop the automated scrolling.
791
+ * Event emitted when focus has changed within a tab group.
830
792
  */
831
- this._stopScrolling = new Subject();
832
- this._selectedIndex = 0;
793
+ _this.focusChange = new EventEmitter();
833
794
  /**
834
- * Event emitted when the option is selected.
795
+ * Event emitted when the body animation has completed
835
796
  */
836
- this.selectFocusedIndex = new EventEmitter();
797
+ _this.animationDone = new EventEmitter();
837
798
  /**
838
- * Event emitted when a label is focused.
799
+ * Event emitted when the tab selection has changed.
839
800
  */
840
- this.indexFocused = new EventEmitter();
841
- // Bind the `mouseleave` event on the outside since it doesn't change anything in the view.
842
- _ngZone.runOutsideAngular((/**
801
+ _this.selectedTabChange = new EventEmitter(true);
802
+ _this._groupId = nextId++;
803
+ _this.animationDuration = defaultConfig && defaultConfig.animationDuration ?
804
+ defaultConfig.animationDuration : '500ms';
805
+ return _this;
806
+ }
807
+ Object.defineProperty(_MatTabGroupBase.prototype, "dynamicHeight", {
808
+ /** Whether the tab group should grow to the size of the active tab. */
809
+ get: /**
810
+ * Whether the tab group should grow to the size of the active tab.
843
811
  * @return {?}
844
812
  */
845
- function () {
846
- fromEvent(_elementRef.nativeElement, 'mouseleave')
847
- .pipe(takeUntil(_this._destroyed))
848
- .subscribe((/**
849
- * @return {?}
850
- */
851
- function () {
852
- _this._stopInterval();
853
- }));
854
- }));
855
- }
856
- Object.defineProperty(MatPaginatedTabHeader.prototype, "selectedIndex", {
813
+ function () { return this._dynamicHeight; },
814
+ set: /**
815
+ * @param {?} value
816
+ * @return {?}
817
+ */
818
+ function (value) { this._dynamicHeight = coerceBooleanProperty(value); },
819
+ enumerable: true,
820
+ configurable: true
821
+ });
822
+ Object.defineProperty(_MatTabGroupBase.prototype, "selectedIndex", {
857
823
  /** The index of the active tab. */
858
824
  get: /**
859
825
  * The index of the active tab.
@@ -865,890 +831,617 @@ var MatPaginatedTabHeader = /** @class */ (function () {
865
831
  * @return {?}
866
832
  */
867
833
  function (value) {
868
- value = coerceNumberProperty(value);
869
- if (this._selectedIndex != value) {
870
- this._selectedIndexChanged = true;
871
- this._selectedIndex = value;
872
- if (this._keyManager) {
873
- this._keyManager.updateActiveItemIndex(value);
874
- }
875
- }
834
+ this._indexToSelect = coerceNumberProperty(value, null);
876
835
  },
877
836
  enumerable: true,
878
837
  configurable: true
879
838
  });
880
- /**
881
- * @return {?}
882
- */
883
- MatPaginatedTabHeader.prototype.ngAfterViewInit = /**
884
- * @return {?}
885
- */
886
- function () {
887
- var _this = this;
888
- // We need to handle these events manually, because we want to bind passive event listeners.
889
- fromEvent(this._previousPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
890
- .pipe(takeUntil(this._destroyed))
891
- .subscribe((/**
839
+ Object.defineProperty(_MatTabGroupBase.prototype, "animationDuration", {
840
+ /** Duration for the tab animation. Will be normalized to milliseconds if no units are set. */
841
+ get: /**
842
+ * Duration for the tab animation. Will be normalized to milliseconds if no units are set.
892
843
  * @return {?}
893
844
  */
894
- function () {
895
- _this._handlePaginatorPress('before');
896
- }));
897
- fromEvent(this._nextPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
898
- .pipe(takeUntil(this._destroyed))
899
- .subscribe((/**
845
+ function () { return this._animationDuration; },
846
+ set: /**
847
+ * @param {?} value
900
848
  * @return {?}
901
849
  */
902
- function () {
903
- _this._handlePaginatorPress('after');
904
- }));
905
- };
850
+ function (value) {
851
+ this._animationDuration = /^\d+$/.test(value) ? value + 'ms' : value;
852
+ },
853
+ enumerable: true,
854
+ configurable: true
855
+ });
856
+ Object.defineProperty(_MatTabGroupBase.prototype, "backgroundColor", {
857
+ /** Background color of the tab group. */
858
+ get: /**
859
+ * Background color of the tab group.
860
+ * @return {?}
861
+ */
862
+ function () { return this._backgroundColor; },
863
+ set: /**
864
+ * @param {?} value
865
+ * @return {?}
866
+ */
867
+ function (value) {
868
+ /** @type {?} */
869
+ var nativeElement = this._elementRef.nativeElement;
870
+ nativeElement.classList.remove("mat-background-" + this.backgroundColor);
871
+ if (value) {
872
+ nativeElement.classList.add("mat-background-" + value);
873
+ }
874
+ this._backgroundColor = value;
875
+ },
876
+ enumerable: true,
877
+ configurable: true
878
+ });
879
+ /**
880
+ * After the content is checked, this component knows what tabs have been defined
881
+ * and what the selected index should be. This is where we can know exactly what position
882
+ * each tab should be in according to the new selected index, and additionally we know how
883
+ * a new selected tab should transition in (from the left or right).
884
+ */
906
885
  /**
886
+ * After the content is checked, this component knows what tabs have been defined
887
+ * and what the selected index should be. This is where we can know exactly what position
888
+ * each tab should be in according to the new selected index, and additionally we know how
889
+ * a new selected tab should transition in (from the left or right).
907
890
  * @return {?}
908
891
  */
909
- MatPaginatedTabHeader.prototype.ngAfterContentInit = /**
892
+ _MatTabGroupBase.prototype.ngAfterContentChecked = /**
893
+ * After the content is checked, this component knows what tabs have been defined
894
+ * and what the selected index should be. This is where we can know exactly what position
895
+ * each tab should be in according to the new selected index, and additionally we know how
896
+ * a new selected tab should transition in (from the left or right).
910
897
  * @return {?}
911
898
  */
912
899
  function () {
913
900
  var _this = this;
901
+ // Don't clamp the `indexToSelect` immediately in the setter because it can happen that
902
+ // the amount of tabs changes before the actual change detection runs.
914
903
  /** @type {?} */
915
- var dirChange = this._dir ? this._dir.change : of(null);
916
- /** @type {?} */
917
- var resize = this._viewportRuler.change(150);
918
- /** @type {?} */
919
- var realign = (/**
920
- * @return {?}
921
- */
922
- function () {
923
- _this.updatePagination();
924
- _this._alignInkBarToSelectedTab();
925
- });
926
- this._keyManager = new FocusKeyManager(this._items)
927
- .withHorizontalOrientation(this._getLayoutDirection())
928
- .withWrap();
929
- this._keyManager.updateActiveItem(0);
930
- // Defer the first call in order to allow for slower browsers to lay out the elements.
931
- // This helps in cases where the user lands directly on a page with paginated tabs.
932
- typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(realign) : realign();
933
- // On dir change or window resize, realign the ink bar and update the orientation of
934
- // the key manager if the direction has changed.
935
- merge(dirChange, resize, this._items.changes).pipe(takeUntil(this._destroyed)).subscribe((/**
904
+ var indexToSelect = this._indexToSelect = this._clampTabIndex(this._indexToSelect);
905
+ // If there is a change in selected index, emit a change event. Should not trigger if
906
+ // the selected index has not yet been initialized.
907
+ if (this._selectedIndex != indexToSelect) {
908
+ /** @type {?} */
909
+ var isFirstRun_1 = this._selectedIndex == null;
910
+ if (!isFirstRun_1) {
911
+ this.selectedTabChange.emit(this._createChangeEvent(indexToSelect));
912
+ }
913
+ // Changing these values after change detection has run
914
+ // since the checked content may contain references to them.
915
+ Promise.resolve().then((/**
916
+ * @return {?}
917
+ */
918
+ function () {
919
+ _this._tabs.forEach((/**
920
+ * @param {?} tab
921
+ * @param {?} index
922
+ * @return {?}
923
+ */
924
+ function (tab, index) { return tab.isActive = index === indexToSelect; }));
925
+ if (!isFirstRun_1) {
926
+ _this.selectedIndexChange.emit(indexToSelect);
927
+ }
928
+ }));
929
+ }
930
+ // Setup the position for each tab and optionally setup an origin on the next selected tab.
931
+ this._tabs.forEach((/**
932
+ * @param {?} tab
933
+ * @param {?} index
936
934
  * @return {?}
937
935
  */
938
- function () {
939
- realign();
940
- _this._keyManager.withHorizontalOrientation(_this._getLayoutDirection());
936
+ function (tab, index) {
937
+ tab.position = index - indexToSelect;
938
+ // If there is already a selected tab, then set up an origin for the next selected tab
939
+ // if it doesn't have one already.
940
+ if (_this._selectedIndex != null && tab.position == 0 && !tab.origin) {
941
+ tab.origin = indexToSelect - _this._selectedIndex;
942
+ }
941
943
  }));
942
- // If there is a change in the focus key manager we need to emit the `indexFocused`
943
- // event in order to provide a public event that notifies about focus changes. Also we realign
944
- // the tabs container by scrolling the new focused tab into the visible section.
945
- this._keyManager.change.pipe(takeUntil(this._destroyed)).subscribe((/**
946
- * @param {?} newFocusIndex
944
+ if (this._selectedIndex !== indexToSelect) {
945
+ this._selectedIndex = indexToSelect;
946
+ this._changeDetectorRef.markForCheck();
947
+ }
948
+ };
949
+ /**
950
+ * @return {?}
951
+ */
952
+ _MatTabGroupBase.prototype.ngAfterContentInit = /**
953
+ * @return {?}
954
+ */
955
+ function () {
956
+ var _this = this;
957
+ this._subscribeToTabLabels();
958
+ // Subscribe to changes in the amount of tabs, in order to be
959
+ // able to re-render the content as new tabs are added or removed.
960
+ this._tabsSubscription = this._tabs.changes.subscribe((/**
947
961
  * @return {?}
948
962
  */
949
- function (newFocusIndex) {
950
- _this.indexFocused.emit(newFocusIndex);
951
- _this._setTabFocus(newFocusIndex);
963
+ function () {
964
+ /** @type {?} */
965
+ var indexToSelect = _this._clampTabIndex(_this._indexToSelect);
966
+ // Maintain the previously-selected tab if a new tab is added or removed and there is no
967
+ // explicit change that selects a different tab.
968
+ if (indexToSelect === _this._selectedIndex) {
969
+ /** @type {?} */
970
+ var tabs = _this._tabs.toArray();
971
+ for (var i = 0; i < tabs.length; i++) {
972
+ if (tabs[i].isActive) {
973
+ // Assign both to the `_indexToSelect` and `_selectedIndex` so we don't fire a changed
974
+ // event, otherwise the consumer may end up in an infinite loop in some edge cases like
975
+ // adding a tab within the `selectedIndexChange` event.
976
+ _this._indexToSelect = _this._selectedIndex = i;
977
+ break;
978
+ }
979
+ }
980
+ }
981
+ _this._subscribeToTabLabels();
982
+ _this._changeDetectorRef.markForCheck();
952
983
  }));
953
984
  };
954
985
  /**
955
986
  * @return {?}
956
987
  */
957
- MatPaginatedTabHeader.prototype.ngAfterContentChecked = /**
988
+ _MatTabGroupBase.prototype.ngOnDestroy = /**
958
989
  * @return {?}
959
990
  */
960
991
  function () {
961
- // If the number of tab labels have changed, check if scrolling should be enabled
962
- if (this._tabLabelCount != this._items.length) {
963
- this.updatePagination();
964
- this._tabLabelCount = this._items.length;
965
- this._changeDetectorRef.markForCheck();
966
- }
967
- // If the selected index has changed, scroll to the label and check if the scrolling controls
968
- // should be disabled.
969
- if (this._selectedIndexChanged) {
970
- this._scrollToLabel(this._selectedIndex);
971
- this._checkScrollingControls();
972
- this._alignInkBarToSelectedTab();
973
- this._selectedIndexChanged = false;
974
- this._changeDetectorRef.markForCheck();
975
- }
976
- // If the scroll distance has been changed (tab selected, focused, scroll controls activated),
977
- // then translate the header to reflect this.
978
- if (this._scrollDistanceChanged) {
979
- this._updateTabScrollPosition();
980
- this._scrollDistanceChanged = false;
981
- this._changeDetectorRef.markForCheck();
982
- }
992
+ this._tabsSubscription.unsubscribe();
993
+ this._tabLabelSubscription.unsubscribe();
983
994
  };
995
+ /** Re-aligns the ink bar to the selected tab element. */
984
996
  /**
997
+ * Re-aligns the ink bar to the selected tab element.
985
998
  * @return {?}
986
999
  */
987
- MatPaginatedTabHeader.prototype.ngOnDestroy = /**
1000
+ _MatTabGroupBase.prototype.realignInkBar = /**
1001
+ * Re-aligns the ink bar to the selected tab element.
988
1002
  * @return {?}
989
1003
  */
990
1004
  function () {
991
- this._destroyed.next();
992
- this._destroyed.complete();
993
- this._stopScrolling.complete();
1005
+ if (this._tabHeader) {
1006
+ this._tabHeader._alignInkBarToSelectedTab();
1007
+ }
994
1008
  };
995
- /** Handles keyboard events on the header. */
996
1009
  /**
997
- * Handles keyboard events on the header.
998
- * @param {?} event
1010
+ * @param {?} index
999
1011
  * @return {?}
1000
1012
  */
1001
- MatPaginatedTabHeader.prototype._handleKeydown = /**
1002
- * Handles keyboard events on the header.
1003
- * @param {?} event
1013
+ _MatTabGroupBase.prototype._focusChanged = /**
1014
+ * @param {?} index
1004
1015
  * @return {?}
1005
1016
  */
1006
- function (event) {
1007
- // We don't handle any key bindings with a modifier key.
1008
- if (hasModifierKey(event)) {
1009
- return;
1010
- }
1011
- switch (event.keyCode) {
1012
- case HOME:
1013
- this._keyManager.setFirstItemActive();
1014
- event.preventDefault();
1015
- break;
1016
- case END:
1017
- this._keyManager.setLastItemActive();
1018
- event.preventDefault();
1019
- break;
1020
- case ENTER:
1021
- case SPACE:
1022
- this.selectFocusedIndex.emit(this.focusIndex);
1023
- this._itemSelected(event);
1024
- break;
1025
- default:
1026
- this._keyManager.onKeydown(event);
1017
+ function (index) {
1018
+ this.focusChange.emit(this._createChangeEvent(index));
1019
+ };
1020
+ /**
1021
+ * @private
1022
+ * @param {?} index
1023
+ * @return {?}
1024
+ */
1025
+ _MatTabGroupBase.prototype._createChangeEvent = /**
1026
+ * @private
1027
+ * @param {?} index
1028
+ * @return {?}
1029
+ */
1030
+ function (index) {
1031
+ /** @type {?} */
1032
+ var event = new MatTabChangeEvent;
1033
+ event.index = index;
1034
+ if (this._tabs && this._tabs.length) {
1035
+ event.tab = this._tabs.toArray()[index];
1027
1036
  }
1037
+ return event;
1028
1038
  };
1029
1039
  /**
1030
- * Callback for when the MutationObserver detects that the content has changed.
1040
+ * Subscribes to changes in the tab labels. This is needed, because the @Input for the label is
1041
+ * on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
1042
+ * binding to be updated, we need to subscribe to changes in it and trigger change detection
1043
+ * manually.
1031
1044
  */
1032
1045
  /**
1033
- * Callback for when the MutationObserver detects that the content has changed.
1046
+ * Subscribes to changes in the tab labels. This is needed, because the \@Input for the label is
1047
+ * on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
1048
+ * binding to be updated, we need to subscribe to changes in it and trigger change detection
1049
+ * manually.
1050
+ * @private
1034
1051
  * @return {?}
1035
1052
  */
1036
- MatPaginatedTabHeader.prototype._onContentChanges = /**
1037
- * Callback for when the MutationObserver detects that the content has changed.
1053
+ _MatTabGroupBase.prototype._subscribeToTabLabels = /**
1054
+ * Subscribes to changes in the tab labels. This is needed, because the \@Input for the label is
1055
+ * on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
1056
+ * binding to be updated, we need to subscribe to changes in it and trigger change detection
1057
+ * manually.
1058
+ * @private
1038
1059
  * @return {?}
1039
1060
  */
1040
1061
  function () {
1041
1062
  var _this = this;
1042
- /** @type {?} */
1043
- var textContent = this._elementRef.nativeElement.textContent;
1044
- // We need to diff the text content of the header, because the MutationObserver callback
1045
- // will fire even if the text content didn't change which is inefficient and is prone
1046
- // to infinite loops if a poorly constructed expression is passed in (see #14249).
1047
- if (textContent !== this._currentTextContent) {
1048
- this._currentTextContent = textContent || '';
1049
- // The content observer runs outside the `NgZone` by default, which
1050
- // means that we need to bring the callback back in ourselves.
1051
- this._ngZone.run((/**
1052
- * @return {?}
1053
- */
1054
- function () {
1055
- _this.updatePagination();
1056
- _this._alignInkBarToSelectedTab();
1057
- _this._changeDetectorRef.markForCheck();
1058
- }));
1063
+ if (this._tabLabelSubscription) {
1064
+ this._tabLabelSubscription.unsubscribe();
1059
1065
  }
1060
- };
1061
- /**
1062
- * Updates the view whether pagination should be enabled or not.
1063
- *
1064
- * WARNING: Calling this method can be very costly in terms of performance. It should be called
1065
- * as infrequently as possible from outside of the Tabs component as it causes a reflow of the
1066
- * page.
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
- * @return {?}
1075
- */
1076
- MatPaginatedTabHeader.prototype.updatePagination = /**
1077
- * Updates the view whether pagination should be enabled or not.
1078
- *
1079
- * WARNING: Calling this method can be very costly in terms of performance. It should be called
1080
- * as infrequently as possible from outside of the Tabs component as it causes a reflow of the
1081
- * page.
1082
- * @return {?}
1083
- */
1084
- function () {
1085
- this._checkPaginationEnabled();
1086
- this._checkScrollingControls();
1087
- this._updateTabScrollPosition();
1088
- };
1089
- Object.defineProperty(MatPaginatedTabHeader.prototype, "focusIndex", {
1090
- /** Tracks which element has focus; used for keyboard navigation */
1091
- get: /**
1092
- * Tracks which element has focus; used for keyboard navigation
1066
+ this._tabLabelSubscription = merge.apply(void 0, this._tabs.map((/**
1067
+ * @param {?} tab
1093
1068
  * @return {?}
1094
1069
  */
1095
- function () {
1096
- return this._keyManager ? (/** @type {?} */ (this._keyManager.activeItemIndex)) : 0;
1097
- },
1098
- /** When the focus index is set, we must manually send focus to the correct label */
1099
- set: /**
1100
- * When the focus index is set, we must manually send focus to the correct label
1101
- * @param {?} value
1070
+ function (tab) { return tab._stateChanges; }))).subscribe((/**
1102
1071
  * @return {?}
1103
1072
  */
1104
- function (value) {
1105
- if (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {
1106
- return;
1107
- }
1108
- this._keyManager.setActiveItem(value);
1109
- },
1110
- enumerable: true,
1111
- configurable: true
1112
- });
1113
- /**
1114
- * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
1115
- * providing a valid index and return true.
1116
- */
1073
+ function () { return _this._changeDetectorRef.markForCheck(); }));
1074
+ };
1075
+ /** Clamps the given index to the bounds of 0 and the tabs length. */
1117
1076
  /**
1118
- * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
1119
- * providing a valid index and return true.
1077
+ * Clamps the given index to the bounds of 0 and the tabs length.
1078
+ * @private
1120
1079
  * @param {?} index
1121
1080
  * @return {?}
1122
1081
  */
1123
- MatPaginatedTabHeader.prototype._isValidIndex = /**
1124
- * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
1125
- * providing a valid index and return true.
1082
+ _MatTabGroupBase.prototype._clampTabIndex = /**
1083
+ * Clamps the given index to the bounds of 0 and the tabs length.
1084
+ * @private
1126
1085
  * @param {?} index
1127
1086
  * @return {?}
1128
1087
  */
1129
1088
  function (index) {
1130
- if (!this._items) {
1131
- return true;
1132
- }
1133
- /** @type {?} */
1134
- var tab = this._items ? this._items.toArray()[index] : null;
1135
- return !!tab && !tab.disabled;
1089
+ // Note the `|| 0`, which ensures that values like NaN can't get through
1090
+ // and which would otherwise throw the component into an infinite loop
1091
+ // (since Math.max(NaN, 0) === NaN).
1092
+ return Math.min(this._tabs.length - 1, Math.max(index || 0, 0));
1136
1093
  };
1094
+ /** Returns a unique id for each tab label element */
1137
1095
  /**
1138
- * Sets focus on the HTML element for the label wrapper and scrolls it into the view if
1139
- * scrolling is enabled.
1140
- */
1141
- /**
1142
- * Sets focus on the HTML element for the label wrapper and scrolls it into the view if
1143
- * scrolling is enabled.
1144
- * @param {?} tabIndex
1096
+ * Returns a unique id for each tab label element
1097
+ * @param {?} i
1145
1098
  * @return {?}
1146
1099
  */
1147
- MatPaginatedTabHeader.prototype._setTabFocus = /**
1148
- * Sets focus on the HTML element for the label wrapper and scrolls it into the view if
1149
- * scrolling is enabled.
1150
- * @param {?} tabIndex
1100
+ _MatTabGroupBase.prototype._getTabLabelId = /**
1101
+ * Returns a unique id for each tab label element
1102
+ * @param {?} i
1151
1103
  * @return {?}
1152
1104
  */
1153
- function (tabIndex) {
1154
- if (this._showPaginationControls) {
1155
- this._scrollToLabel(tabIndex);
1156
- }
1157
- if (this._items && this._items.length) {
1158
- this._items.toArray()[tabIndex].focus();
1159
- // Do not let the browser manage scrolling to focus the element, this will be handled
1160
- // by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width
1161
- // should be the full width minus the offset width.
1162
- /** @type {?} */
1163
- var containerEl = this._tabListContainer.nativeElement;
1164
- /** @type {?} */
1165
- var dir = this._getLayoutDirection();
1166
- if (dir == 'ltr') {
1167
- containerEl.scrollLeft = 0;
1168
- }
1169
- else {
1170
- containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;
1171
- }
1172
- }
1105
+ function (i) {
1106
+ return "mat-tab-label-" + this._groupId + "-" + i;
1173
1107
  };
1174
- /** The layout direction of the containing app. */
1108
+ /** Returns a unique id for each tab content element */
1175
1109
  /**
1176
- * The layout direction of the containing app.
1110
+ * Returns a unique id for each tab content element
1111
+ * @param {?} i
1177
1112
  * @return {?}
1178
1113
  */
1179
- MatPaginatedTabHeader.prototype._getLayoutDirection = /**
1180
- * The layout direction of the containing app.
1114
+ _MatTabGroupBase.prototype._getTabContentId = /**
1115
+ * Returns a unique id for each tab content element
1116
+ * @param {?} i
1181
1117
  * @return {?}
1182
1118
  */
1183
- function () {
1184
- return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
1119
+ function (i) {
1120
+ return "mat-tab-content-" + this._groupId + "-" + i;
1185
1121
  };
1186
- /** Performs the CSS transformation on the tab list that will cause the list to scroll. */
1187
1122
  /**
1188
- * Performs the CSS transformation on the tab list that will cause the list to scroll.
1123
+ * Sets the height of the body wrapper to the height of the activating tab if dynamic
1124
+ * height property is true.
1125
+ */
1126
+ /**
1127
+ * Sets the height of the body wrapper to the height of the activating tab if dynamic
1128
+ * height property is true.
1129
+ * @param {?} tabHeight
1189
1130
  * @return {?}
1190
1131
  */
1191
- MatPaginatedTabHeader.prototype._updateTabScrollPosition = /**
1192
- * Performs the CSS transformation on the tab list that will cause the list to scroll.
1132
+ _MatTabGroupBase.prototype._setTabBodyWrapperHeight = /**
1133
+ * Sets the height of the body wrapper to the height of the activating tab if dynamic
1134
+ * height property is true.
1135
+ * @param {?} tabHeight
1193
1136
  * @return {?}
1194
1137
  */
1195
- function () {
1196
- /** @type {?} */
1197
- var scrollDistance = this.scrollDistance;
1198
- /** @type {?} */
1199
- var platform = this._platform;
1138
+ function (tabHeight) {
1139
+ if (!this._dynamicHeight || !this._tabBodyWrapperHeight) {
1140
+ return;
1141
+ }
1200
1142
  /** @type {?} */
1201
- var translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
1202
- // Don't use `translate3d` here because we don't want to create a new layer. A new layer
1203
- // seems to cause flickering and overflow in Internet Explorer. For example, the ink bar
1204
- // and ripples will exceed the boundaries of the visible tab bar.
1205
- // See: https://github.com/angular/components/issues/10276
1206
- // We round the `transform` here, because transforms with sub-pixel precision cause some
1207
- // browsers to blur the content of the element.
1208
- this._tabList.nativeElement.style.transform = "translateX(" + Math.round(translateX) + "px)";
1209
- // Setting the `transform` on IE will change the scroll offset of the parent, causing the
1210
- // position to be thrown off in some cases. We have to reset it ourselves to ensure that
1211
- // it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing
1212
- // with the scroll position throws off Chrome 71+ in RTL mode (see #14689).
1213
- // @breaking-change 9.0.0 Remove null check for `platform` after it can no longer be undefined.
1214
- if (platform && (platform.TRIDENT || platform.EDGE)) {
1215
- this._tabListContainer.nativeElement.scrollLeft = 0;
1143
+ var wrapper = this._tabBodyWrapper.nativeElement;
1144
+ wrapper.style.height = this._tabBodyWrapperHeight + 'px';
1145
+ // This conditional forces the browser to paint the height so that
1146
+ // the animation to the new height can have an origin.
1147
+ if (this._tabBodyWrapper.nativeElement.offsetHeight) {
1148
+ wrapper.style.height = tabHeight + 'px';
1216
1149
  }
1217
1150
  };
1218
- Object.defineProperty(MatPaginatedTabHeader.prototype, "scrollDistance", {
1219
- /** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
1220
- get: /**
1221
- * Sets the distance in pixels that the tab header should be transformed in the X-axis.
1222
- * @return {?}
1223
- */
1224
- function () { return this._scrollDistance; },
1225
- set: /**
1226
- * @param {?} value
1227
- * @return {?}
1228
- */
1229
- function (value) {
1230
- this._scrollTo(value);
1231
- },
1232
- enumerable: true,
1233
- configurable: true
1234
- });
1235
- /**
1236
- * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
1237
- * the end of the list, respectively). The distance to scroll is computed to be a third of the
1238
- * length of the tab list view window.
1239
- *
1240
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1241
- * should be called sparingly.
1242
- */
1151
+ /** Removes the height of the tab body wrapper. */
1243
1152
  /**
1244
- * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
1245
- * the end of the list, respectively). The distance to scroll is computed to be a third of the
1246
- * length of the tab list view window.
1247
- *
1248
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1249
- * should be called sparingly.
1250
- * @param {?} direction
1153
+ * Removes the height of the tab body wrapper.
1251
1154
  * @return {?}
1252
1155
  */
1253
- MatPaginatedTabHeader.prototype._scrollHeader = /**
1254
- * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
1255
- * the end of the list, respectively). The distance to scroll is computed to be a third of the
1256
- * length of the tab list view window.
1257
- *
1258
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1259
- * should be called sparingly.
1260
- * @param {?} direction
1156
+ _MatTabGroupBase.prototype._removeTabBodyWrapperHeight = /**
1157
+ * Removes the height of the tab body wrapper.
1261
1158
  * @return {?}
1262
1159
  */
1263
- function (direction) {
1264
- /** @type {?} */
1265
- var viewLength = this._tabListContainer.nativeElement.offsetWidth;
1266
- // Move the scroll distance one-third the length of the tab list's viewport.
1160
+ function () {
1267
1161
  /** @type {?} */
1268
- var scrollAmount = (direction == 'before' ? -1 : 1) * viewLength / 3;
1269
- return this._scrollTo(this._scrollDistance + scrollAmount);
1162
+ var wrapper = this._tabBodyWrapper.nativeElement;
1163
+ this._tabBodyWrapperHeight = wrapper.clientHeight;
1164
+ wrapper.style.height = '';
1165
+ this.animationDone.emit();
1270
1166
  };
1271
- /** Handles click events on the pagination arrows. */
1167
+ /** Handle click events, setting new selected index if appropriate. */
1272
1168
  /**
1273
- * Handles click events on the pagination arrows.
1274
- * @param {?} direction
1169
+ * Handle click events, setting new selected index if appropriate.
1170
+ * @param {?} tab
1171
+ * @param {?} tabHeader
1172
+ * @param {?} index
1275
1173
  * @return {?}
1276
1174
  */
1277
- MatPaginatedTabHeader.prototype._handlePaginatorClick = /**
1278
- * Handles click events on the pagination arrows.
1279
- * @param {?} direction
1280
- * @return {?}
1281
- */
1282
- function (direction) {
1283
- this._stopInterval();
1284
- this._scrollHeader(direction);
1285
- };
1286
- /**
1287
- * Moves the tab list such that the desired tab label (marked by index) is moved into view.
1288
- *
1289
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1290
- * should be called sparingly.
1291
- */
1292
- /**
1293
- * Moves the tab list such that the desired tab label (marked by index) is moved into view.
1294
- *
1295
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1296
- * should be called sparingly.
1297
- * @param {?} labelIndex
1298
- * @return {?}
1299
- */
1300
- MatPaginatedTabHeader.prototype._scrollToLabel = /**
1301
- * Moves the tab list such that the desired tab label (marked by index) is moved into view.
1302
- *
1303
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1304
- * should be called sparingly.
1305
- * @param {?} labelIndex
1175
+ _MatTabGroupBase.prototype._handleClick = /**
1176
+ * Handle click events, setting new selected index if appropriate.
1177
+ * @param {?} tab
1178
+ * @param {?} tabHeader
1179
+ * @param {?} index
1306
1180
  * @return {?}
1307
1181
  */
1308
- function (labelIndex) {
1309
- /** @type {?} */
1310
- var selectedLabel = this._items ? this._items.toArray()[labelIndex] : null;
1311
- if (!selectedLabel) {
1312
- return;
1313
- }
1314
- // The view length is the visible width of the tab labels.
1315
- /** @type {?} */
1316
- var viewLength = this._tabListContainer.nativeElement.offsetWidth;
1317
- var _a = selectedLabel.elementRef.nativeElement, offsetLeft = _a.offsetLeft, offsetWidth = _a.offsetWidth;
1318
- /** @type {?} */
1319
- var labelBeforePos;
1320
- /** @type {?} */
1321
- var labelAfterPos;
1322
- if (this._getLayoutDirection() == 'ltr') {
1323
- labelBeforePos = offsetLeft;
1324
- labelAfterPos = labelBeforePos + offsetWidth;
1325
- }
1326
- else {
1327
- labelAfterPos = this._tabList.nativeElement.offsetWidth - offsetLeft;
1328
- labelBeforePos = labelAfterPos - offsetWidth;
1329
- }
1330
- /** @type {?} */
1331
- var beforeVisiblePos = this.scrollDistance;
1332
- /** @type {?} */
1333
- var afterVisiblePos = this.scrollDistance + viewLength;
1334
- if (labelBeforePos < beforeVisiblePos) {
1335
- // Scroll header to move label to the before direction
1336
- this.scrollDistance -= beforeVisiblePos - labelBeforePos + EXAGGERATED_OVERSCROLL;
1337
- }
1338
- else if (labelAfterPos > afterVisiblePos) {
1339
- // Scroll header to move label to the after direction
1340
- this.scrollDistance += labelAfterPos - afterVisiblePos + EXAGGERATED_OVERSCROLL;
1182
+ function (tab, tabHeader, index) {
1183
+ if (!tab.disabled) {
1184
+ this.selectedIndex = tabHeader.focusIndex = index;
1341
1185
  }
1342
1186
  };
1187
+ /** Retrieves the tabindex for the tab. */
1343
1188
  /**
1344
- * Evaluate whether the pagination controls should be displayed. If the scroll width of the
1345
- * tab list is wider than the size of the header container, then the pagination controls should
1346
- * be shown.
1347
- *
1348
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1349
- * should be called sparingly.
1350
- */
1351
- /**
1352
- * Evaluate whether the pagination controls should be displayed. If the scroll width of the
1353
- * tab list is wider than the size of the header container, then the pagination controls should
1354
- * be shown.
1355
- *
1356
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1357
- * should be called sparingly.
1189
+ * Retrieves the tabindex for the tab.
1190
+ * @param {?} tab
1191
+ * @param {?} idx
1358
1192
  * @return {?}
1359
1193
  */
1360
- MatPaginatedTabHeader.prototype._checkPaginationEnabled = /**
1361
- * Evaluate whether the pagination controls should be displayed. If the scroll width of the
1362
- * tab list is wider than the size of the header container, then the pagination controls should
1363
- * be shown.
1364
- *
1365
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1366
- * should be called sparingly.
1194
+ _MatTabGroupBase.prototype._getTabIndex = /**
1195
+ * Retrieves the tabindex for the tab.
1196
+ * @param {?} tab
1197
+ * @param {?} idx
1367
1198
  * @return {?}
1368
1199
  */
1369
- function () {
1370
- /** @type {?} */
1371
- var isEnabled = this._tabList.nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;
1372
- if (!isEnabled) {
1373
- this.scrollDistance = 0;
1374
- }
1375
- if (isEnabled !== this._showPaginationControls) {
1376
- this._changeDetectorRef.markForCheck();
1200
+ function (tab, idx) {
1201
+ if (tab.disabled) {
1202
+ return null;
1377
1203
  }
1378
- this._showPaginationControls = isEnabled;
1204
+ return this.selectedIndex === idx ? 0 : -1;
1379
1205
  };
1206
+ _MatTabGroupBase.decorators = [
1207
+ { type: Directive, args: [{
1208
+ // TODO(crisbeto): this selector can be removed when we update to Angular 9.0.
1209
+ selector: 'do-not-use-abstract-mat-tab-group-base'
1210
+ },] },
1211
+ ];
1212
+ /** @nocollapse */
1213
+ _MatTabGroupBase.ctorParameters = function () { return [
1214
+ { type: ElementRef },
1215
+ { type: ChangeDetectorRef },
1216
+ { type: undefined, decorators: [{ type: Inject, args: [MAT_TABS_CONFIG,] }, { type: Optional }] },
1217
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1218
+ ]; };
1219
+ _MatTabGroupBase.propDecorators = {
1220
+ dynamicHeight: [{ type: Input }],
1221
+ selectedIndex: [{ type: Input }],
1222
+ headerPosition: [{ type: Input }],
1223
+ animationDuration: [{ type: Input }],
1224
+ backgroundColor: [{ type: Input }],
1225
+ selectedIndexChange: [{ type: Output }],
1226
+ focusChange: [{ type: Output }],
1227
+ animationDone: [{ type: Output }],
1228
+ selectedTabChange: [{ type: Output }]
1229
+ };
1230
+ return _MatTabGroupBase;
1231
+ }(_MatTabGroupMixinBase));
1232
+ /**
1233
+ * Material design tab-group component. Supports basic tab pairs (label + content) and includes
1234
+ * animated ink-bar, keyboard navigation, and screen reader.
1235
+ * See: https://material.io/design/components/tabs.html
1236
+ */
1237
+ var MatTabGroup = /** @class */ (function (_super) {
1238
+ __extends(MatTabGroup, _super);
1239
+ function MatTabGroup(elementRef, changeDetectorRef, defaultConfig, animationMode) {
1240
+ return _super.call(this, elementRef, changeDetectorRef, defaultConfig, animationMode) || this;
1241
+ }
1242
+ MatTabGroup.decorators = [
1243
+ { type: Component, args: [{selector: 'mat-tab-group',
1244
+ exportAs: 'matTabGroup',
1245
+ template: "<mat-tab-header #tabHeader [selectedIndex]=\"selectedIndex\" [disableRipple]=\"disableRipple\" (indexFocused)=\"_focusChanged($event)\" (selectFocusedIndex)=\"selectedIndex = $event\"><div class=\"mat-tab-label\" role=\"tab\" matTabLabelWrapper mat-ripple cdkMonitorElementFocus *ngFor=\"let tab of _tabs; let i = index\" [id]=\"_getTabLabelId(i)\" [attr.tabIndex]=\"_getTabIndex(tab, i)\" [attr.aria-posinset]=\"i + 1\" [attr.aria-setsize]=\"_tabs.length\" [attr.aria-controls]=\"_getTabContentId(i)\" [attr.aria-selected]=\"selectedIndex == i\" [attr.aria-label]=\"tab.ariaLabel || null\" [attr.aria-labelledby]=\"(!tab.ariaLabel && tab.ariaLabelledby) ? tab.ariaLabelledby : null\" [class.mat-tab-label-active]=\"selectedIndex == i\" [disabled]=\"tab.disabled\" [matRippleDisabled]=\"tab.disabled || disableRipple\" (click)=\"_handleClick(tab, tabHeader, i)\"><div class=\"mat-tab-label-content\"><ng-template [ngIf]=\"tab.templateLabel\"><ng-template [cdkPortalOutlet]=\"tab.templateLabel\"></ng-template></ng-template><ng-template [ngIf]=\"!tab.templateLabel\">{{tab.textLabel}}</ng-template></div></div></mat-tab-header><div class=\"mat-tab-body-wrapper\" [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\" #tabBodyWrapper><mat-tab-body role=\"tabpanel\" *ngFor=\"let tab of _tabs; let i = index\" [id]=\"_getTabContentId(i)\" [attr.aria-labelledby]=\"_getTabLabelId(i)\" [class.mat-tab-body-active]=\"selectedIndex == i\" [content]=\"tab.content\" [position]=\"tab.position\" [origin]=\"tab.origin\" [animationDuration]=\"animationDuration\" (_onCentered)=\"_removeTabBodyWrapperHeight()\" (_onCentering)=\"_setTabBodyWrapperHeight($event)\"></mat-tab-body></div>",
1246
+ 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:0}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}@media (-ms-high-contrast:active){.mat-tab-label:focus{outline:dotted 2px}}.mat-tab-label.mat-tab-disabled{cursor:default}@media (-ms-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}@media (-ms-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 .5s cubic-bezier(.35,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}"],
1247
+ encapsulation: ViewEncapsulation.None,
1248
+ changeDetection: ChangeDetectionStrategy.OnPush,
1249
+ inputs: ['color', 'disableRipple'],
1250
+ host: {
1251
+ 'class': 'mat-tab-group',
1252
+ '[class.mat-tab-group-dynamic-height]': 'dynamicHeight',
1253
+ '[class.mat-tab-group-inverted-header]': 'headerPosition === "below"',
1254
+ },
1255
+ },] },
1256
+ ];
1257
+ /** @nocollapse */
1258
+ MatTabGroup.ctorParameters = function () { return [
1259
+ { type: ElementRef },
1260
+ { type: ChangeDetectorRef },
1261
+ { type: undefined, decorators: [{ type: Inject, args: [MAT_TABS_CONFIG,] }, { type: Optional }] },
1262
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1263
+ ]; };
1264
+ MatTabGroup.propDecorators = {
1265
+ _tabs: [{ type: ContentChildren, args: [MatTab,] }],
1266
+ _tabBodyWrapper: [{ type: ViewChild, args: ['tabBodyWrapper', { static: false },] }],
1267
+ _tabHeader: [{ type: ViewChild, args: ['tabHeader', { static: false },] }]
1268
+ };
1269
+ return MatTabGroup;
1270
+ }(_MatTabGroupBase));
1271
+
1272
+ /**
1273
+ * @fileoverview added by tsickle
1274
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1275
+ */
1276
+ // Boilerplate for applying mixins to MatTabLabelWrapper.
1277
+ /**
1278
+ * \@docs-private
1279
+ */
1280
+ var
1281
+ // Boilerplate for applying mixins to MatTabLabelWrapper.
1282
+ /**
1283
+ * \@docs-private
1284
+ */
1285
+ MatTabLabelWrapperBase = /** @class */ (function () {
1286
+ function MatTabLabelWrapperBase() {
1287
+ }
1288
+ return MatTabLabelWrapperBase;
1289
+ }());
1290
+ /** @type {?} */
1291
+ var _MatTabLabelWrapperMixinBase = mixinDisabled(MatTabLabelWrapperBase);
1292
+ /**
1293
+ * Used in the `mat-tab-group` view to display tab labels.
1294
+ * \@docs-private
1295
+ */
1296
+ var MatTabLabelWrapper = /** @class */ (function (_super) {
1297
+ __extends(MatTabLabelWrapper, _super);
1298
+ function MatTabLabelWrapper(elementRef) {
1299
+ var _this = _super.call(this) || this;
1300
+ _this.elementRef = elementRef;
1301
+ return _this;
1302
+ }
1303
+ /** Sets focus on the wrapper element */
1380
1304
  /**
1381
- * Evaluate whether the before and after controls should be enabled or disabled.
1382
- * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
1383
- * before button. If the header is at the end of the list (scroll distance is equal to the
1384
- * maximum distance we can scroll), then disable the after button.
1385
- *
1386
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1387
- * should be called sparingly.
1388
- */
1389
- /**
1390
- * Evaluate whether the before and after controls should be enabled or disabled.
1391
- * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
1392
- * before button. If the header is at the end of the list (scroll distance is equal to the
1393
- * maximum distance we can scroll), then disable the after button.
1394
- *
1395
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1396
- * should be called sparingly.
1305
+ * Sets focus on the wrapper element
1397
1306
  * @return {?}
1398
1307
  */
1399
- MatPaginatedTabHeader.prototype._checkScrollingControls = /**
1400
- * Evaluate whether the before and after controls should be enabled or disabled.
1401
- * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
1402
- * before button. If the header is at the end of the list (scroll distance is equal to the
1403
- * maximum distance we can scroll), then disable the after button.
1404
- *
1405
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1406
- * should be called sparingly.
1308
+ MatTabLabelWrapper.prototype.focus = /**
1309
+ * Sets focus on the wrapper element
1407
1310
  * @return {?}
1408
1311
  */
1409
1312
  function () {
1410
- // Check if the pagination arrows should be activated.
1411
- this._disableScrollBefore = this.scrollDistance == 0;
1412
- this._disableScrollAfter = this.scrollDistance == this._getMaxScrollDistance();
1413
- this._changeDetectorRef.markForCheck();
1313
+ this.elementRef.nativeElement.focus();
1414
1314
  };
1415
1315
  /**
1416
- * Determines what is the maximum length in pixels that can be set for the scroll distance. This
1417
- * is equal to the difference in width between the tab list container and tab header container.
1418
- *
1419
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1420
- * should be called sparingly.
1421
- */
1422
- /**
1423
- * Determines what is the maximum length in pixels that can be set for the scroll distance. This
1424
- * is equal to the difference in width between the tab list container and tab header container.
1425
- *
1426
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1427
- * should be called sparingly.
1428
1316
  * @return {?}
1429
1317
  */
1430
- MatPaginatedTabHeader.prototype._getMaxScrollDistance = /**
1431
- * Determines what is the maximum length in pixels that can be set for the scroll distance. This
1432
- * is equal to the difference in width between the tab list container and tab header container.
1433
- *
1434
- * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1435
- * should be called sparingly.
1318
+ MatTabLabelWrapper.prototype.getOffsetLeft = /**
1436
1319
  * @return {?}
1437
1320
  */
1438
1321
  function () {
1439
- /** @type {?} */
1440
- var lengthOfTabList = this._tabList.nativeElement.scrollWidth;
1441
- /** @type {?} */
1442
- var viewLength = this._tabListContainer.nativeElement.offsetWidth;
1443
- return (lengthOfTabList - viewLength) || 0;
1322
+ return this.elementRef.nativeElement.offsetLeft;
1444
1323
  };
1445
- /** Tells the ink-bar to align itself to the current label wrapper */
1446
1324
  /**
1447
- * Tells the ink-bar to align itself to the current label wrapper
1448
1325
  * @return {?}
1449
1326
  */
1450
- MatPaginatedTabHeader.prototype._alignInkBarToSelectedTab = /**
1451
- * Tells the ink-bar to align itself to the current label wrapper
1327
+ MatTabLabelWrapper.prototype.getOffsetWidth = /**
1452
1328
  * @return {?}
1453
1329
  */
1454
1330
  function () {
1455
- /** @type {?} */
1456
- var selectedItem = this._items && this._items.length ?
1457
- this._items.toArray()[this.selectedIndex] : null;
1458
- /** @type {?} */
1459
- var selectedLabelWrapper = selectedItem ? selectedItem.elementRef.nativeElement : null;
1460
- if (selectedLabelWrapper) {
1461
- this._inkBar.alignToElement(selectedLabelWrapper);
1462
- }
1463
- else {
1464
- this._inkBar.hide();
1465
- }
1466
- };
1467
- /** Stops the currently-running paginator interval. */
1468
- /**
1469
- * Stops the currently-running paginator interval.
1470
- * @return {?}
1471
- */
1472
- MatPaginatedTabHeader.prototype._stopInterval = /**
1473
- * Stops the currently-running paginator interval.
1474
- * @return {?}
1475
- */
1476
- function () {
1477
- this._stopScrolling.next();
1478
- };
1479
- /**
1480
- * Handles the user pressing down on one of the paginators.
1481
- * Starts scrolling the header after a certain amount of time.
1482
- * @param direction In which direction the paginator should be scrolled.
1483
- */
1484
- /**
1485
- * Handles the user pressing down on one of the paginators.
1486
- * Starts scrolling the header after a certain amount of time.
1487
- * @param {?} direction In which direction the paginator should be scrolled.
1488
- * @return {?}
1489
- */
1490
- MatPaginatedTabHeader.prototype._handlePaginatorPress = /**
1491
- * Handles the user pressing down on one of the paginators.
1492
- * Starts scrolling the header after a certain amount of time.
1493
- * @param {?} direction In which direction the paginator should be scrolled.
1494
- * @return {?}
1495
- */
1496
- function (direction) {
1497
- var _this = this;
1498
- // Avoid overlapping timers.
1499
- this._stopInterval();
1500
- // Start a timer after the delay and keep firing based on the interval.
1501
- timer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)
1502
- // Keep the timer going until something tells it to stop or the component is destroyed.
1503
- .pipe(takeUntil(merge(this._stopScrolling, this._destroyed)))
1504
- .subscribe((/**
1505
- * @return {?}
1506
- */
1507
- function () {
1508
- var _a = _this._scrollHeader(direction), maxScrollDistance = _a.maxScrollDistance, distance = _a.distance;
1509
- // Stop the timer if we've reached the start or the end.
1510
- if (distance === 0 || distance >= maxScrollDistance) {
1511
- _this._stopInterval();
1512
- }
1513
- }));
1514
- };
1515
- /**
1516
- * Scrolls the header to a given position.
1517
- * @param position Position to which to scroll.
1518
- * @returns Information on the current scroll distance and the maximum.
1519
- */
1520
- /**
1521
- * Scrolls the header to a given position.
1522
- * @private
1523
- * @param {?} position Position to which to scroll.
1524
- * @return {?} Information on the current scroll distance and the maximum.
1525
- */
1526
- MatPaginatedTabHeader.prototype._scrollTo = /**
1527
- * Scrolls the header to a given position.
1528
- * @private
1529
- * @param {?} position Position to which to scroll.
1530
- * @return {?} Information on the current scroll distance and the maximum.
1531
- */
1532
- function (position) {
1533
- /** @type {?} */
1534
- var maxScrollDistance = this._getMaxScrollDistance();
1535
- this._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));
1536
- // Mark that the scroll distance has changed so that after the view is checked, the CSS
1537
- // transformation can move the header.
1538
- this._scrollDistanceChanged = true;
1539
- this._checkScrollingControls();
1540
- return { maxScrollDistance: maxScrollDistance, distance: this._scrollDistance };
1541
- };
1542
- /** @nocollapse */
1543
- MatPaginatedTabHeader.ctorParameters = function () { return [
1544
- { type: ElementRef },
1545
- { type: ChangeDetectorRef },
1546
- { type: ViewportRuler },
1547
- { type: Directionality, decorators: [{ type: Optional }] },
1548
- { type: NgZone },
1549
- { type: Platform },
1550
- { type: String }
1551
- ]; };
1552
- return MatPaginatedTabHeader;
1553
- }());
1554
-
1555
- /**
1556
- * @fileoverview added by tsickle
1557
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1558
- */
1559
- /**
1560
- * The header of the tab group which displays a list of all the tabs in the tab group. Includes
1561
- * an ink bar that follows the currently selected tab. When the tabs list's width exceeds the
1562
- * width of the header container, then arrows will be displayed to allow the user to scroll
1563
- * left and right across the header.
1564
- * \@docs-private
1565
- */
1566
- var MatTabHeader = /** @class */ (function (_super) {
1567
- __extends(MatTabHeader, _super);
1568
- function MatTabHeader(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform,
1569
- // @breaking-change 9.0.0 `_animationMode` parameter to be made required.
1570
- animationMode) {
1571
- var _this = _super.call(this, elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode) || this;
1572
- _this._disableRipple = false;
1573
- return _this;
1574
- }
1575
- Object.defineProperty(MatTabHeader.prototype, "disableRipple", {
1576
- /** Whether the ripple effect is disabled or not. */
1577
- get: /**
1578
- * Whether the ripple effect is disabled or not.
1579
- * @return {?}
1580
- */
1581
- function () { return this._disableRipple; },
1582
- set: /**
1583
- * @param {?} value
1584
- * @return {?}
1585
- */
1586
- function (value) { this._disableRipple = coerceBooleanProperty(value); },
1587
- enumerable: true,
1588
- configurable: true
1589
- });
1590
- /**
1591
- * @protected
1592
- * @param {?} event
1593
- * @return {?}
1594
- */
1595
- MatTabHeader.prototype._itemSelected = /**
1596
- * @protected
1597
- * @param {?} event
1598
- * @return {?}
1599
- */
1600
- function (event) {
1601
- event.preventDefault();
1331
+ return this.elementRef.nativeElement.offsetWidth;
1602
1332
  };
1603
- MatTabHeader.decorators = [
1604
- { type: Component, args: [{selector: 'mat-tab-header',
1605
- template: "<div class=\"mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4\" #previousPaginator aria-hidden=\"true\" mat-ripple [matRippleDisabled]=\"_disableScrollBefore || disableRipple\" [class.mat-tab-header-pagination-disabled]=\"_disableScrollBefore\" (click)=\"_handlePaginatorClick('before')\" (mousedown)=\"_handlePaginatorPress('before')\" (touchend)=\"_stopInterval()\"><div class=\"mat-tab-header-pagination-chevron\"></div></div><div class=\"mat-tab-label-container\" #tabListContainer (keydown)=\"_handleKeydown($event)\"><div #tabList class=\"mat-tab-list\" [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\" role=\"tablist\" (cdkObserveContent)=\"_onContentChanges()\"><div class=\"mat-tab-labels\"><ng-content></ng-content></div><mat-ink-bar></mat-ink-bar></div></div><div class=\"mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4\" #nextPaginator aria-hidden=\"true\" mat-ripple [matRippleDisabled]=\"_disableScrollAfter || disableRipple\" [class.mat-tab-header-pagination-disabled]=\"_disableScrollAfter\" (mousedown)=\"_handlePaginatorPress('after')\" (click)=\"_handlePaginatorClick('after')\" (touchend)=\"_stopInterval()\"><div class=\"mat-tab-header-pagination-chevron\"></div></div>",
1606
- 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-pagination-after,.mat-tab-header-rtl .mat-tab-header-pagination-before{padding-right:4px}.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-before .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 .5s cubic-bezier(.35,0,.25,1)}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:.5s cubic-bezier(.35,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}@media (-ms-high-contrast:active){.mat-ink-bar{outline:solid 2px;height:0}}.mat-tab-labels{display:flex}[mat-align-tabs=center] .mat-tab-labels{justify-content:center}[mat-align-tabs=end] .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:0}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}@media (-ms-high-contrast:active){.mat-tab-label:focus{outline:dotted 2px}}.mat-tab-label.mat-tab-disabled{cursor:default}@media (-ms-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}@media (-ms-high-contrast:active){.mat-tab-label{opacity:1}}@media (max-width:599px){.mat-tab-label{min-width:72px}}"],
1607
- inputs: ['selectedIndex'],
1608
- outputs: ['selectFocusedIndex', 'indexFocused'],
1609
- encapsulation: ViewEncapsulation.None,
1610
- changeDetection: ChangeDetectionStrategy.OnPush,
1333
+ MatTabLabelWrapper.decorators = [
1334
+ { type: Directive, args: [{
1335
+ selector: '[matTabLabelWrapper]',
1336
+ inputs: ['disabled'],
1611
1337
  host: {
1612
- 'class': 'mat-tab-header',
1613
- '[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',
1614
- '[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'",
1615
- },
1338
+ '[class.mat-tab-disabled]': 'disabled',
1339
+ '[attr.aria-disabled]': '!!disabled',
1340
+ }
1616
1341
  },] },
1617
1342
  ];
1618
1343
  /** @nocollapse */
1619
- MatTabHeader.ctorParameters = function () { return [
1620
- { type: ElementRef },
1621
- { type: ChangeDetectorRef },
1622
- { type: ViewportRuler },
1623
- { type: Directionality, decorators: [{ type: Optional }] },
1624
- { type: NgZone },
1625
- { type: Platform },
1626
- { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
1344
+ MatTabLabelWrapper.ctorParameters = function () { return [
1345
+ { type: ElementRef }
1627
1346
  ]; };
1628
- MatTabHeader.propDecorators = {
1629
- _items: [{ type: ContentChildren, args: [MatTabLabelWrapper,] }],
1630
- _inkBar: [{ type: ViewChild, args: [MatInkBar, { static: true },] }],
1631
- _tabListContainer: [{ type: ViewChild, args: ['tabListContainer', { static: true },] }],
1632
- _tabList: [{ type: ViewChild, args: ['tabList', { static: true },] }],
1633
- _nextPaginator: [{ type: ViewChild, args: ['nextPaginator', { static: false },] }],
1634
- _previousPaginator: [{ type: ViewChild, args: ['previousPaginator', { static: false },] }],
1635
- disableRipple: [{ type: Input }]
1636
- };
1637
- return MatTabHeader;
1638
- }(MatPaginatedTabHeader));
1347
+ return MatTabLabelWrapper;
1348
+ }(_MatTabLabelWrapperMixinBase));
1639
1349
 
1640
1350
  /**
1641
1351
  * @fileoverview added by tsickle
1642
1352
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1643
1353
  */
1644
1354
  /**
1645
- * Used to generate unique ID's for each tab component
1355
+ * Config used to bind passive event listeners
1646
1356
  * @type {?}
1647
1357
  */
1648
- var nextId = 0;
1358
+ var passiveEventListenerOptions = (/** @type {?} */ (normalizePassiveListenerOptions({ passive: true })));
1649
1359
  /**
1650
- * A simple change event emitted on focus or selection changes.
1651
- */
1652
- var /**
1653
- * A simple change event emitted on focus or selection changes.
1360
+ * The distance in pixels that will be overshot when scrolling a tab label into view. This helps
1361
+ * provide a small affordance to the label next to it.
1362
+ * @type {?}
1654
1363
  */
1655
- MatTabChangeEvent = /** @class */ (function () {
1656
- function MatTabChangeEvent() {
1657
- }
1658
- return MatTabChangeEvent;
1659
- }());
1364
+ var EXAGGERATED_OVERSCROLL = 60;
1660
1365
  /**
1661
- * Injection token that can be used to provide the default options the tabs module.
1366
+ * Amount of milliseconds to wait before starting to scroll the header automatically.
1367
+ * Set a little conservatively in order to handle fake events dispatched on touch devices.
1662
1368
  * @type {?}
1663
1369
  */
1664
- var MAT_TABS_CONFIG = new InjectionToken('MAT_TABS_CONFIG');
1665
- // Boilerplate for applying mixins to MatTabGroup.
1370
+ var HEADER_SCROLL_DELAY = 650;
1666
1371
  /**
1667
- * \@docs-private
1372
+ * Interval in milliseconds at which to scroll the header
1373
+ * while the user is holding their pointer.
1374
+ * @type {?}
1668
1375
  */
1669
- var
1670
- // Boilerplate for applying mixins to MatTabGroup.
1376
+ var HEADER_SCROLL_INTERVAL = 100;
1671
1377
  /**
1378
+ * Base class for a tab header that supported pagination.
1672
1379
  * \@docs-private
1380
+ * @abstract
1673
1381
  */
1674
- MatTabGroupBase = /** @class */ (function () {
1675
- function MatTabGroupBase(_elementRef) {
1382
+ var MatPaginatedTabHeader = /** @class */ (function () {
1383
+ function MatPaginatedTabHeader(_elementRef, _changeDetectorRef, _viewportRuler, _dir, _ngZone, _platform, _animationMode) {
1384
+ var _this = this;
1676
1385
  this._elementRef = _elementRef;
1677
- }
1678
- return MatTabGroupBase;
1679
- }());
1680
- /** @type {?} */
1681
- var _MatTabGroupMixinBase = mixinColor(mixinDisableRipple(MatTabGroupBase), 'primary');
1682
- /**
1683
- * Material design tab-group component. Supports basic tab pairs (label + content) and includes
1684
- * animated ink-bar, keyboard navigation, and screen reader.
1685
- * See: https://material.io/design/components/tabs.html
1686
- */
1687
- var MatTabGroup = /** @class */ (function (_super) {
1688
- __extends(MatTabGroup, _super);
1689
- function MatTabGroup(elementRef, _changeDetectorRef, defaultConfig, _animationMode) {
1690
- var _this = _super.call(this, elementRef) || this;
1691
- _this._changeDetectorRef = _changeDetectorRef;
1692
- _this._animationMode = _animationMode;
1386
+ this._changeDetectorRef = _changeDetectorRef;
1387
+ this._viewportRuler = _viewportRuler;
1388
+ this._dir = _dir;
1389
+ this._ngZone = _ngZone;
1390
+ this._platform = _platform;
1391
+ this._animationMode = _animationMode;
1693
1392
  /**
1694
- * The tab index that should be selected after the content has been checked.
1393
+ * The distance in pixels that the tab labels should be translated to the left.
1695
1394
  */
1696
- _this._indexToSelect = 0;
1395
+ this._scrollDistance = 0;
1697
1396
  /**
1698
- * Snapshot of the height of the tab body wrapper before another tab is activated.
1397
+ * Whether the header should scroll to the selected index after the view has been checked.
1699
1398
  */
1700
- _this._tabBodyWrapperHeight = 0;
1399
+ this._selectedIndexChanged = false;
1701
1400
  /**
1702
- * Subscription to tabs being added/removed.
1401
+ * Emits when the component is destroyed.
1703
1402
  */
1704
- _this._tabsSubscription = Subscription.EMPTY;
1403
+ this._destroyed = new Subject();
1705
1404
  /**
1706
- * Subscription to changes in the tab labels.
1405
+ * Whether the controls for pagination should be displayed
1707
1406
  */
1708
- _this._tabLabelSubscription = Subscription.EMPTY;
1709
- _this._dynamicHeight = false;
1710
- _this._selectedIndex = null;
1407
+ this._showPaginationControls = false;
1711
1408
  /**
1712
- * Position of the tab header.
1409
+ * Whether the tab list can be scrolled more towards the end of the tab label list.
1713
1410
  */
1714
- _this.headerPosition = 'above';
1411
+ this._disableScrollAfter = true;
1715
1412
  /**
1716
- * Output to enable support for two-way binding on `[(selectedIndex)]`
1413
+ * Whether the tab list can be scrolled more towards the beginning of the tab label list.
1717
1414
  */
1718
- _this.selectedIndexChange = new EventEmitter();
1415
+ this._disableScrollBefore = true;
1719
1416
  /**
1720
- * Event emitted when focus has changed within a tab group.
1417
+ * Stream that will stop the automated scrolling.
1721
1418
  */
1722
- _this.focusChange = new EventEmitter();
1419
+ this._stopScrolling = new Subject();
1420
+ this._selectedIndex = 0;
1723
1421
  /**
1724
- * Event emitted when the body animation has completed
1422
+ * Event emitted when the option is selected.
1725
1423
  */
1726
- _this.animationDone = new EventEmitter();
1424
+ this.selectFocusedIndex = new EventEmitter();
1727
1425
  /**
1728
- * Event emitted when the tab selection has changed.
1729
- */
1730
- _this.selectedTabChange = new EventEmitter(true);
1731
- _this._groupId = nextId++;
1732
- _this.animationDuration = defaultConfig && defaultConfig.animationDuration ?
1733
- defaultConfig.animationDuration : '500ms';
1734
- return _this;
1735
- }
1736
- Object.defineProperty(MatTabGroup.prototype, "dynamicHeight", {
1737
- /** Whether the tab group should grow to the size of the active tab. */
1738
- get: /**
1739
- * Whether the tab group should grow to the size of the active tab.
1740
- * @return {?}
1426
+ * Event emitted when a label is focused.
1741
1427
  */
1742
- function () { return this._dynamicHeight; },
1743
- set: /**
1744
- * @param {?} value
1428
+ this.indexFocused = new EventEmitter();
1429
+ // Bind the `mouseleave` event on the outside since it doesn't change anything in the view.
1430
+ _ngZone.runOutsideAngular((/**
1745
1431
  * @return {?}
1746
1432
  */
1747
- function (value) { this._dynamicHeight = coerceBooleanProperty(value); },
1748
- enumerable: true,
1749
- configurable: true
1750
- });
1751
- Object.defineProperty(MatTabGroup.prototype, "selectedIndex", {
1433
+ function () {
1434
+ fromEvent(_elementRef.nativeElement, 'mouseleave')
1435
+ .pipe(takeUntil(_this._destroyed))
1436
+ .subscribe((/**
1437
+ * @return {?}
1438
+ */
1439
+ function () {
1440
+ _this._stopInterval();
1441
+ }));
1442
+ }));
1443
+ }
1444
+ Object.defineProperty(MatPaginatedTabHeader.prototype, "selectedIndex", {
1752
1445
  /** The index of the active tab. */
1753
1446
  get: /**
1754
1447
  * The index of the active tab.
@@ -1760,428 +1453,828 @@ var MatTabGroup = /** @class */ (function (_super) {
1760
1453
  * @return {?}
1761
1454
  */
1762
1455
  function (value) {
1763
- this._indexToSelect = coerceNumberProperty(value, null);
1764
- },
1765
- enumerable: true,
1766
- configurable: true
1767
- });
1768
- Object.defineProperty(MatTabGroup.prototype, "animationDuration", {
1769
- /** Duration for the tab animation. Will be normalized to milliseconds if no units are set. */
1770
- get: /**
1771
- * Duration for the tab animation. Will be normalized to milliseconds if no units are set.
1772
- * @return {?}
1773
- */
1774
- function () { return this._animationDuration; },
1775
- set: /**
1776
- * @param {?} value
1777
- * @return {?}
1778
- */
1779
- function (value) {
1780
- this._animationDuration = /^\d+$/.test(value) ? value + 'ms' : value;
1456
+ value = coerceNumberProperty(value);
1457
+ if (this._selectedIndex != value) {
1458
+ this._selectedIndexChanged = true;
1459
+ this._selectedIndex = value;
1460
+ if (this._keyManager) {
1461
+ this._keyManager.updateActiveItemIndex(value);
1462
+ }
1463
+ }
1781
1464
  },
1782
1465
  enumerable: true,
1783
1466
  configurable: true
1784
1467
  });
1785
- Object.defineProperty(MatTabGroup.prototype, "backgroundColor", {
1786
- /** Background color of the tab group. */
1787
- get: /**
1788
- * Background color of the tab group.
1468
+ /**
1469
+ * @return {?}
1470
+ */
1471
+ MatPaginatedTabHeader.prototype.ngAfterViewInit = /**
1472
+ * @return {?}
1473
+ */
1474
+ function () {
1475
+ var _this = this;
1476
+ // We need to handle these events manually, because we want to bind passive event listeners.
1477
+ fromEvent(this._previousPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
1478
+ .pipe(takeUntil(this._destroyed))
1479
+ .subscribe((/**
1789
1480
  * @return {?}
1790
1481
  */
1791
- function () { return this._backgroundColor; },
1792
- set: /**
1793
- * @param {?} value
1482
+ function () {
1483
+ _this._handlePaginatorPress('before');
1484
+ }));
1485
+ fromEvent(this._nextPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
1486
+ .pipe(takeUntil(this._destroyed))
1487
+ .subscribe((/**
1794
1488
  * @return {?}
1795
1489
  */
1796
- function (value) {
1797
- /** @type {?} */
1798
- var nativeElement = this._elementRef.nativeElement;
1799
- nativeElement.classList.remove("mat-background-" + this.backgroundColor);
1800
- if (value) {
1801
- nativeElement.classList.add("mat-background-" + value);
1802
- }
1803
- this._backgroundColor = value;
1804
- },
1805
- enumerable: true,
1806
- configurable: true
1807
- });
1808
- /**
1809
- * After the content is checked, this component knows what tabs have been defined
1810
- * and what the selected index should be. This is where we can know exactly what position
1811
- * each tab should be in according to the new selected index, and additionally we know how
1812
- * a new selected tab should transition in (from the left or right).
1813
- */
1490
+ function () {
1491
+ _this._handlePaginatorPress('after');
1492
+ }));
1493
+ };
1814
1494
  /**
1815
- * After the content is checked, this component knows what tabs have been defined
1816
- * and what the selected index should be. This is where we can know exactly what position
1817
- * each tab should be in according to the new selected index, and additionally we know how
1818
- * a new selected tab should transition in (from the left or right).
1819
1495
  * @return {?}
1820
1496
  */
1821
- MatTabGroup.prototype.ngAfterContentChecked = /**
1822
- * After the content is checked, this component knows what tabs have been defined
1823
- * and what the selected index should be. This is where we can know exactly what position
1824
- * each tab should be in according to the new selected index, and additionally we know how
1825
- * a new selected tab should transition in (from the left or right).
1497
+ MatPaginatedTabHeader.prototype.ngAfterContentInit = /**
1826
1498
  * @return {?}
1827
1499
  */
1828
1500
  function () {
1829
1501
  var _this = this;
1830
- // Don't clamp the `indexToSelect` immediately in the setter because it can happen that
1831
- // the amount of tabs changes before the actual change detection runs.
1832
1502
  /** @type {?} */
1833
- var indexToSelect = this._indexToSelect = this._clampTabIndex(this._indexToSelect);
1834
- // If there is a change in selected index, emit a change event. Should not trigger if
1835
- // the selected index has not yet been initialized.
1836
- if (this._selectedIndex != indexToSelect) {
1837
- /** @type {?} */
1838
- var isFirstRun_1 = this._selectedIndex == null;
1839
- if (!isFirstRun_1) {
1840
- this.selectedTabChange.emit(this._createChangeEvent(indexToSelect));
1841
- }
1842
- // Changing these values after change detection has run
1843
- // since the checked content may contain references to them.
1844
- Promise.resolve().then((/**
1845
- * @return {?}
1846
- */
1847
- function () {
1848
- _this._tabs.forEach((/**
1849
- * @param {?} tab
1850
- * @param {?} index
1851
- * @return {?}
1852
- */
1853
- function (tab, index) { return tab.isActive = index === indexToSelect; }));
1854
- if (!isFirstRun_1) {
1855
- _this.selectedIndexChange.emit(indexToSelect);
1856
- }
1857
- }));
1858
- }
1859
- // Setup the position for each tab and optionally setup an origin on the next selected tab.
1860
- this._tabs.forEach((/**
1861
- * @param {?} tab
1862
- * @param {?} index
1503
+ var dirChange = this._dir ? this._dir.change : of(null);
1504
+ /** @type {?} */
1505
+ var resize = this._viewportRuler.change(150);
1506
+ /** @type {?} */
1507
+ var realign = (/**
1863
1508
  * @return {?}
1864
1509
  */
1865
- function (tab, index) {
1866
- tab.position = index - indexToSelect;
1867
- // If there is already a selected tab, then set up an origin for the next selected tab
1868
- // if it doesn't have one already.
1869
- if (_this._selectedIndex != null && tab.position == 0 && !tab.origin) {
1870
- tab.origin = indexToSelect - _this._selectedIndex;
1871
- }
1510
+ function () {
1511
+ _this.updatePagination();
1512
+ _this._alignInkBarToSelectedTab();
1513
+ });
1514
+ this._keyManager = new FocusKeyManager(this._items)
1515
+ .withHorizontalOrientation(this._getLayoutDirection())
1516
+ .withWrap();
1517
+ this._keyManager.updateActiveItem(0);
1518
+ // Defer the first call in order to allow for slower browsers to lay out the elements.
1519
+ // This helps in cases where the user lands directly on a page with paginated tabs.
1520
+ typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(realign) : realign();
1521
+ // On dir change or window resize, realign the ink bar and update the orientation of
1522
+ // the key manager if the direction has changed.
1523
+ merge(dirChange, resize, this._items.changes).pipe(takeUntil(this._destroyed)).subscribe((/**
1524
+ * @return {?}
1525
+ */
1526
+ function () {
1527
+ realign();
1528
+ _this._keyManager.withHorizontalOrientation(_this._getLayoutDirection());
1872
1529
  }));
1873
- if (this._selectedIndex !== indexToSelect) {
1874
- this._selectedIndex = indexToSelect;
1530
+ // If there is a change in the focus key manager we need to emit the `indexFocused`
1531
+ // event in order to provide a public event that notifies about focus changes. Also we realign
1532
+ // the tabs container by scrolling the new focused tab into the visible section.
1533
+ this._keyManager.change.pipe(takeUntil(this._destroyed)).subscribe((/**
1534
+ * @param {?} newFocusIndex
1535
+ * @return {?}
1536
+ */
1537
+ function (newFocusIndex) {
1538
+ _this.indexFocused.emit(newFocusIndex);
1539
+ _this._setTabFocus(newFocusIndex);
1540
+ }));
1541
+ };
1542
+ /**
1543
+ * @return {?}
1544
+ */
1545
+ MatPaginatedTabHeader.prototype.ngAfterContentChecked = /**
1546
+ * @return {?}
1547
+ */
1548
+ function () {
1549
+ // If the number of tab labels have changed, check if scrolling should be enabled
1550
+ if (this._tabLabelCount != this._items.length) {
1551
+ this.updatePagination();
1552
+ this._tabLabelCount = this._items.length;
1553
+ this._changeDetectorRef.markForCheck();
1554
+ }
1555
+ // If the selected index has changed, scroll to the label and check if the scrolling controls
1556
+ // should be disabled.
1557
+ if (this._selectedIndexChanged) {
1558
+ this._scrollToLabel(this._selectedIndex);
1559
+ this._checkScrollingControls();
1560
+ this._alignInkBarToSelectedTab();
1561
+ this._selectedIndexChanged = false;
1562
+ this._changeDetectorRef.markForCheck();
1563
+ }
1564
+ // If the scroll distance has been changed (tab selected, focused, scroll controls activated),
1565
+ // then translate the header to reflect this.
1566
+ if (this._scrollDistanceChanged) {
1567
+ this._updateTabScrollPosition();
1568
+ this._scrollDistanceChanged = false;
1875
1569
  this._changeDetectorRef.markForCheck();
1876
1570
  }
1877
1571
  };
1878
1572
  /**
1879
1573
  * @return {?}
1880
1574
  */
1881
- MatTabGroup.prototype.ngAfterContentInit = /**
1575
+ MatPaginatedTabHeader.prototype.ngOnDestroy = /**
1882
1576
  * @return {?}
1883
1577
  */
1884
1578
  function () {
1885
- var _this = this;
1886
- this._subscribeToTabLabels();
1887
- // Subscribe to changes in the amount of tabs, in order to be
1888
- // able to re-render the content as new tabs are added or removed.
1889
- this._tabsSubscription = this._tabs.changes.subscribe((/**
1890
- * @return {?}
1891
- */
1892
- function () {
1893
- /** @type {?} */
1894
- var indexToSelect = _this._clampTabIndex(_this._indexToSelect);
1895
- // Maintain the previously-selected tab if a new tab is added or removed and there is no
1896
- // explicit change that selects a different tab.
1897
- if (indexToSelect === _this._selectedIndex) {
1898
- /** @type {?} */
1899
- var tabs = _this._tabs.toArray();
1900
- for (var i = 0; i < tabs.length; i++) {
1901
- if (tabs[i].isActive) {
1902
- // Assign both to the `_indexToSelect` and `_selectedIndex` so we don't fire a changed
1903
- // event, otherwise the consumer may end up in an infinite loop in some edge cases like
1904
- // adding a tab within the `selectedIndexChange` event.
1905
- _this._indexToSelect = _this._selectedIndex = i;
1906
- break;
1907
- }
1908
- }
1579
+ this._destroyed.next();
1580
+ this._destroyed.complete();
1581
+ this._stopScrolling.complete();
1582
+ };
1583
+ /** Handles keyboard events on the header. */
1584
+ /**
1585
+ * Handles keyboard events on the header.
1586
+ * @param {?} event
1587
+ * @return {?}
1588
+ */
1589
+ MatPaginatedTabHeader.prototype._handleKeydown = /**
1590
+ * Handles keyboard events on the header.
1591
+ * @param {?} event
1592
+ * @return {?}
1593
+ */
1594
+ function (event) {
1595
+ // We don't handle any key bindings with a modifier key.
1596
+ if (hasModifierKey(event)) {
1597
+ return;
1598
+ }
1599
+ switch (event.keyCode) {
1600
+ case HOME:
1601
+ this._keyManager.setFirstItemActive();
1602
+ event.preventDefault();
1603
+ break;
1604
+ case END:
1605
+ this._keyManager.setLastItemActive();
1606
+ event.preventDefault();
1607
+ break;
1608
+ case ENTER:
1609
+ case SPACE:
1610
+ this.selectFocusedIndex.emit(this.focusIndex);
1611
+ this._itemSelected(event);
1612
+ break;
1613
+ default:
1614
+ this._keyManager.onKeydown(event);
1615
+ }
1616
+ };
1617
+ /**
1618
+ * Callback for when the MutationObserver detects that the content has changed.
1619
+ */
1620
+ /**
1621
+ * Callback for when the MutationObserver detects that the content has changed.
1622
+ * @return {?}
1623
+ */
1624
+ MatPaginatedTabHeader.prototype._onContentChanges = /**
1625
+ * Callback for when the MutationObserver detects that the content has changed.
1626
+ * @return {?}
1627
+ */
1628
+ function () {
1629
+ var _this = this;
1630
+ /** @type {?} */
1631
+ var textContent = this._elementRef.nativeElement.textContent;
1632
+ // We need to diff the text content of the header, because the MutationObserver callback
1633
+ // will fire even if the text content didn't change which is inefficient and is prone
1634
+ // to infinite loops if a poorly constructed expression is passed in (see #14249).
1635
+ if (textContent !== this._currentTextContent) {
1636
+ this._currentTextContent = textContent || '';
1637
+ // The content observer runs outside the `NgZone` by default, which
1638
+ // means that we need to bring the callback back in ourselves.
1639
+ this._ngZone.run((/**
1640
+ * @return {?}
1641
+ */
1642
+ function () {
1643
+ _this.updatePagination();
1644
+ _this._alignInkBarToSelectedTab();
1645
+ _this._changeDetectorRef.markForCheck();
1646
+ }));
1647
+ }
1648
+ };
1649
+ /**
1650
+ * Updates the view whether pagination should be enabled or not.
1651
+ *
1652
+ * WARNING: Calling this method can be very costly in terms of performance. It should be called
1653
+ * as infrequently as possible from outside of the Tabs component as it causes a reflow of the
1654
+ * page.
1655
+ */
1656
+ /**
1657
+ * Updates the view whether pagination should be enabled or not.
1658
+ *
1659
+ * WARNING: Calling this method can be very costly in terms of performance. It should be called
1660
+ * as infrequently as possible from outside of the Tabs component as it causes a reflow of the
1661
+ * page.
1662
+ * @return {?}
1663
+ */
1664
+ MatPaginatedTabHeader.prototype.updatePagination = /**
1665
+ * Updates the view whether pagination should be enabled or not.
1666
+ *
1667
+ * WARNING: Calling this method can be very costly in terms of performance. It should be called
1668
+ * as infrequently as possible from outside of the Tabs component as it causes a reflow of the
1669
+ * page.
1670
+ * @return {?}
1671
+ */
1672
+ function () {
1673
+ this._checkPaginationEnabled();
1674
+ this._checkScrollingControls();
1675
+ this._updateTabScrollPosition();
1676
+ };
1677
+ Object.defineProperty(MatPaginatedTabHeader.prototype, "focusIndex", {
1678
+ /** Tracks which element has focus; used for keyboard navigation */
1679
+ get: /**
1680
+ * Tracks which element has focus; used for keyboard navigation
1681
+ * @return {?}
1682
+ */
1683
+ function () {
1684
+ return this._keyManager ? (/** @type {?} */ (this._keyManager.activeItemIndex)) : 0;
1685
+ },
1686
+ /** When the focus index is set, we must manually send focus to the correct label */
1687
+ set: /**
1688
+ * When the focus index is set, we must manually send focus to the correct label
1689
+ * @param {?} value
1690
+ * @return {?}
1691
+ */
1692
+ function (value) {
1693
+ if (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {
1694
+ return;
1909
1695
  }
1910
- _this._subscribeToTabLabels();
1911
- _this._changeDetectorRef.markForCheck();
1912
- }));
1696
+ this._keyManager.setActiveItem(value);
1697
+ },
1698
+ enumerable: true,
1699
+ configurable: true
1700
+ });
1701
+ /**
1702
+ * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
1703
+ * providing a valid index and return true.
1704
+ */
1705
+ /**
1706
+ * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
1707
+ * providing a valid index and return true.
1708
+ * @param {?} index
1709
+ * @return {?}
1710
+ */
1711
+ MatPaginatedTabHeader.prototype._isValidIndex = /**
1712
+ * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
1713
+ * providing a valid index and return true.
1714
+ * @param {?} index
1715
+ * @return {?}
1716
+ */
1717
+ function (index) {
1718
+ if (!this._items) {
1719
+ return true;
1720
+ }
1721
+ /** @type {?} */
1722
+ var tab = this._items ? this._items.toArray()[index] : null;
1723
+ return !!tab && !tab.disabled;
1724
+ };
1725
+ /**
1726
+ * Sets focus on the HTML element for the label wrapper and scrolls it into the view if
1727
+ * scrolling is enabled.
1728
+ */
1729
+ /**
1730
+ * Sets focus on the HTML element for the label wrapper and scrolls it into the view if
1731
+ * scrolling is enabled.
1732
+ * @param {?} tabIndex
1733
+ * @return {?}
1734
+ */
1735
+ MatPaginatedTabHeader.prototype._setTabFocus = /**
1736
+ * Sets focus on the HTML element for the label wrapper and scrolls it into the view if
1737
+ * scrolling is enabled.
1738
+ * @param {?} tabIndex
1739
+ * @return {?}
1740
+ */
1741
+ function (tabIndex) {
1742
+ if (this._showPaginationControls) {
1743
+ this._scrollToLabel(tabIndex);
1744
+ }
1745
+ if (this._items && this._items.length) {
1746
+ this._items.toArray()[tabIndex].focus();
1747
+ // Do not let the browser manage scrolling to focus the element, this will be handled
1748
+ // by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width
1749
+ // should be the full width minus the offset width.
1750
+ /** @type {?} */
1751
+ var containerEl = this._tabListContainer.nativeElement;
1752
+ /** @type {?} */
1753
+ var dir = this._getLayoutDirection();
1754
+ if (dir == 'ltr') {
1755
+ containerEl.scrollLeft = 0;
1756
+ }
1757
+ else {
1758
+ containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;
1759
+ }
1760
+ }
1761
+ };
1762
+ /** The layout direction of the containing app. */
1763
+ /**
1764
+ * The layout direction of the containing app.
1765
+ * @return {?}
1766
+ */
1767
+ MatPaginatedTabHeader.prototype._getLayoutDirection = /**
1768
+ * The layout direction of the containing app.
1769
+ * @return {?}
1770
+ */
1771
+ function () {
1772
+ return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
1773
+ };
1774
+ /** Performs the CSS transformation on the tab list that will cause the list to scroll. */
1775
+ /**
1776
+ * Performs the CSS transformation on the tab list that will cause the list to scroll.
1777
+ * @return {?}
1778
+ */
1779
+ MatPaginatedTabHeader.prototype._updateTabScrollPosition = /**
1780
+ * Performs the CSS transformation on the tab list that will cause the list to scroll.
1781
+ * @return {?}
1782
+ */
1783
+ function () {
1784
+ /** @type {?} */
1785
+ var scrollDistance = this.scrollDistance;
1786
+ /** @type {?} */
1787
+ var platform = this._platform;
1788
+ /** @type {?} */
1789
+ var translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
1790
+ // Don't use `translate3d` here because we don't want to create a new layer. A new layer
1791
+ // seems to cause flickering and overflow in Internet Explorer. For example, the ink bar
1792
+ // and ripples will exceed the boundaries of the visible tab bar.
1793
+ // See: https://github.com/angular/components/issues/10276
1794
+ // We round the `transform` here, because transforms with sub-pixel precision cause some
1795
+ // browsers to blur the content of the element.
1796
+ this._tabList.nativeElement.style.transform = "translateX(" + Math.round(translateX) + "px)";
1797
+ // Setting the `transform` on IE will change the scroll offset of the parent, causing the
1798
+ // position to be thrown off in some cases. We have to reset it ourselves to ensure that
1799
+ // it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing
1800
+ // with the scroll position throws off Chrome 71+ in RTL mode (see #14689).
1801
+ // @breaking-change 9.0.0 Remove null check for `platform` after it can no longer be undefined.
1802
+ if (platform && (platform.TRIDENT || platform.EDGE)) {
1803
+ this._tabListContainer.nativeElement.scrollLeft = 0;
1804
+ }
1805
+ };
1806
+ Object.defineProperty(MatPaginatedTabHeader.prototype, "scrollDistance", {
1807
+ /** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
1808
+ get: /**
1809
+ * Sets the distance in pixels that the tab header should be transformed in the X-axis.
1810
+ * @return {?}
1811
+ */
1812
+ function () { return this._scrollDistance; },
1813
+ set: /**
1814
+ * @param {?} value
1815
+ * @return {?}
1816
+ */
1817
+ function (value) {
1818
+ this._scrollTo(value);
1819
+ },
1820
+ enumerable: true,
1821
+ configurable: true
1822
+ });
1823
+ /**
1824
+ * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
1825
+ * the end of the list, respectively). The distance to scroll is computed to be a third of the
1826
+ * length of the tab list view window.
1827
+ *
1828
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1829
+ * should be called sparingly.
1830
+ */
1831
+ /**
1832
+ * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
1833
+ * the end of the list, respectively). The distance to scroll is computed to be a third of the
1834
+ * length of the tab list view window.
1835
+ *
1836
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1837
+ * should be called sparingly.
1838
+ * @param {?} direction
1839
+ * @return {?}
1840
+ */
1841
+ MatPaginatedTabHeader.prototype._scrollHeader = /**
1842
+ * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
1843
+ * the end of the list, respectively). The distance to scroll is computed to be a third of the
1844
+ * length of the tab list view window.
1845
+ *
1846
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1847
+ * should be called sparingly.
1848
+ * @param {?} direction
1849
+ * @return {?}
1850
+ */
1851
+ function (direction) {
1852
+ /** @type {?} */
1853
+ var viewLength = this._tabListContainer.nativeElement.offsetWidth;
1854
+ // Move the scroll distance one-third the length of the tab list's viewport.
1855
+ /** @type {?} */
1856
+ var scrollAmount = (direction == 'before' ? -1 : 1) * viewLength / 3;
1857
+ return this._scrollTo(this._scrollDistance + scrollAmount);
1858
+ };
1859
+ /** Handles click events on the pagination arrows. */
1860
+ /**
1861
+ * Handles click events on the pagination arrows.
1862
+ * @param {?} direction
1863
+ * @return {?}
1864
+ */
1865
+ MatPaginatedTabHeader.prototype._handlePaginatorClick = /**
1866
+ * Handles click events on the pagination arrows.
1867
+ * @param {?} direction
1868
+ * @return {?}
1869
+ */
1870
+ function (direction) {
1871
+ this._stopInterval();
1872
+ this._scrollHeader(direction);
1873
+ };
1874
+ /**
1875
+ * Moves the tab list such that the desired tab label (marked by index) is moved into view.
1876
+ *
1877
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1878
+ * should be called sparingly.
1879
+ */
1880
+ /**
1881
+ * Moves the tab list such that the desired tab label (marked by index) is moved into view.
1882
+ *
1883
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1884
+ * should be called sparingly.
1885
+ * @param {?} labelIndex
1886
+ * @return {?}
1887
+ */
1888
+ MatPaginatedTabHeader.prototype._scrollToLabel = /**
1889
+ * Moves the tab list such that the desired tab label (marked by index) is moved into view.
1890
+ *
1891
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1892
+ * should be called sparingly.
1893
+ * @param {?} labelIndex
1894
+ * @return {?}
1895
+ */
1896
+ function (labelIndex) {
1897
+ /** @type {?} */
1898
+ var selectedLabel = this._items ? this._items.toArray()[labelIndex] : null;
1899
+ if (!selectedLabel) {
1900
+ return;
1901
+ }
1902
+ // The view length is the visible width of the tab labels.
1903
+ /** @type {?} */
1904
+ var viewLength = this._tabListContainer.nativeElement.offsetWidth;
1905
+ var _a = selectedLabel.elementRef.nativeElement, offsetLeft = _a.offsetLeft, offsetWidth = _a.offsetWidth;
1906
+ /** @type {?} */
1907
+ var labelBeforePos;
1908
+ /** @type {?} */
1909
+ var labelAfterPos;
1910
+ if (this._getLayoutDirection() == 'ltr') {
1911
+ labelBeforePos = offsetLeft;
1912
+ labelAfterPos = labelBeforePos + offsetWidth;
1913
+ }
1914
+ else {
1915
+ labelAfterPos = this._tabList.nativeElement.offsetWidth - offsetLeft;
1916
+ labelBeforePos = labelAfterPos - offsetWidth;
1917
+ }
1918
+ /** @type {?} */
1919
+ var beforeVisiblePos = this.scrollDistance;
1920
+ /** @type {?} */
1921
+ var afterVisiblePos = this.scrollDistance + viewLength;
1922
+ if (labelBeforePos < beforeVisiblePos) {
1923
+ // Scroll header to move label to the before direction
1924
+ this.scrollDistance -= beforeVisiblePos - labelBeforePos + EXAGGERATED_OVERSCROLL;
1925
+ }
1926
+ else if (labelAfterPos > afterVisiblePos) {
1927
+ // Scroll header to move label to the after direction
1928
+ this.scrollDistance += labelAfterPos - afterVisiblePos + EXAGGERATED_OVERSCROLL;
1929
+ }
1913
1930
  };
1914
1931
  /**
1915
- * @return {?}
1916
- */
1917
- MatTabGroup.prototype.ngOnDestroy = /**
1918
- * @return {?}
1932
+ * Evaluate whether the pagination controls should be displayed. If the scroll width of the
1933
+ * tab list is wider than the size of the header container, then the pagination controls should
1934
+ * be shown.
1935
+ *
1936
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1937
+ * should be called sparingly.
1919
1938
  */
1920
- function () {
1921
- this._tabsSubscription.unsubscribe();
1922
- this._tabLabelSubscription.unsubscribe();
1923
- };
1924
- /** Re-aligns the ink bar to the selected tab element. */
1925
1939
  /**
1926
- * Re-aligns the ink bar to the selected tab element.
1940
+ * Evaluate whether the pagination controls should be displayed. If the scroll width of the
1941
+ * tab list is wider than the size of the header container, then the pagination controls should
1942
+ * be shown.
1943
+ *
1944
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1945
+ * should be called sparingly.
1927
1946
  * @return {?}
1928
1947
  */
1929
- MatTabGroup.prototype.realignInkBar = /**
1930
- * Re-aligns the ink bar to the selected tab element.
1948
+ MatPaginatedTabHeader.prototype._checkPaginationEnabled = /**
1949
+ * Evaluate whether the pagination controls should be displayed. If the scroll width of the
1950
+ * tab list is wider than the size of the header container, then the pagination controls should
1951
+ * be shown.
1952
+ *
1953
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1954
+ * should be called sparingly.
1931
1955
  * @return {?}
1932
1956
  */
1933
1957
  function () {
1934
- if (this._tabHeader) {
1935
- this._tabHeader._alignInkBarToSelectedTab();
1958
+ /** @type {?} */
1959
+ var isEnabled = this._tabList.nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;
1960
+ if (!isEnabled) {
1961
+ this.scrollDistance = 0;
1936
1962
  }
1963
+ if (isEnabled !== this._showPaginationControls) {
1964
+ this._changeDetectorRef.markForCheck();
1965
+ }
1966
+ this._showPaginationControls = isEnabled;
1937
1967
  };
1938
1968
  /**
1939
- * @param {?} index
1940
- * @return {?}
1941
- */
1942
- MatTabGroup.prototype._focusChanged = /**
1943
- * @param {?} index
1944
- * @return {?}
1969
+ * Evaluate whether the before and after controls should be enabled or disabled.
1970
+ * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
1971
+ * before button. If the header is at the end of the list (scroll distance is equal to the
1972
+ * maximum distance we can scroll), then disable the after button.
1973
+ *
1974
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1975
+ * should be called sparingly.
1945
1976
  */
1946
- function (index) {
1947
- this.focusChange.emit(this._createChangeEvent(index));
1948
- };
1949
1977
  /**
1950
- * @private
1951
- * @param {?} index
1978
+ * Evaluate whether the before and after controls should be enabled or disabled.
1979
+ * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
1980
+ * before button. If the header is at the end of the list (scroll distance is equal to the
1981
+ * maximum distance we can scroll), then disable the after button.
1982
+ *
1983
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1984
+ * should be called sparingly.
1952
1985
  * @return {?}
1953
1986
  */
1954
- MatTabGroup.prototype._createChangeEvent = /**
1955
- * @private
1956
- * @param {?} index
1987
+ MatPaginatedTabHeader.prototype._checkScrollingControls = /**
1988
+ * Evaluate whether the before and after controls should be enabled or disabled.
1989
+ * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
1990
+ * before button. If the header is at the end of the list (scroll distance is equal to the
1991
+ * maximum distance we can scroll), then disable the after button.
1992
+ *
1993
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
1994
+ * should be called sparingly.
1957
1995
  * @return {?}
1958
1996
  */
1959
- function (index) {
1960
- /** @type {?} */
1961
- var event = new MatTabChangeEvent;
1962
- event.index = index;
1963
- if (this._tabs && this._tabs.length) {
1964
- event.tab = this._tabs.toArray()[index];
1965
- }
1966
- return event;
1997
+ function () {
1998
+ // Check if the pagination arrows should be activated.
1999
+ this._disableScrollBefore = this.scrollDistance == 0;
2000
+ this._disableScrollAfter = this.scrollDistance == this._getMaxScrollDistance();
2001
+ this._changeDetectorRef.markForCheck();
1967
2002
  };
1968
2003
  /**
1969
- * Subscribes to changes in the tab labels. This is needed, because the @Input for the label is
1970
- * on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
1971
- * binding to be updated, we need to subscribe to changes in it and trigger change detection
1972
- * manually.
2004
+ * Determines what is the maximum length in pixels that can be set for the scroll distance. This
2005
+ * is equal to the difference in width between the tab list container and tab header container.
2006
+ *
2007
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
2008
+ * should be called sparingly.
1973
2009
  */
1974
2010
  /**
1975
- * Subscribes to changes in the tab labels. This is needed, because the \@Input for the label is
1976
- * on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
1977
- * binding to be updated, we need to subscribe to changes in it and trigger change detection
1978
- * manually.
1979
- * @private
2011
+ * Determines what is the maximum length in pixels that can be set for the scroll distance. This
2012
+ * is equal to the difference in width between the tab list container and tab header container.
2013
+ *
2014
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
2015
+ * should be called sparingly.
1980
2016
  * @return {?}
1981
2017
  */
1982
- MatTabGroup.prototype._subscribeToTabLabels = /**
1983
- * Subscribes to changes in the tab labels. This is needed, because the \@Input for the label is
1984
- * on the MatTab component, whereas the data binding is inside the MatTabGroup. In order for the
1985
- * binding to be updated, we need to subscribe to changes in it and trigger change detection
1986
- * manually.
1987
- * @private
2018
+ MatPaginatedTabHeader.prototype._getMaxScrollDistance = /**
2019
+ * Determines what is the maximum length in pixels that can be set for the scroll distance. This
2020
+ * is equal to the difference in width between the tab list container and tab header container.
2021
+ *
2022
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
2023
+ * should be called sparingly.
1988
2024
  * @return {?}
1989
2025
  */
1990
2026
  function () {
1991
- var _this = this;
1992
- if (this._tabLabelSubscription) {
1993
- this._tabLabelSubscription.unsubscribe();
1994
- }
1995
- this._tabLabelSubscription = merge.apply(void 0, this._tabs.map((/**
1996
- * @param {?} tab
1997
- * @return {?}
1998
- */
1999
- function (tab) { return tab._stateChanges; }))).subscribe((/**
2000
- * @return {?}
2001
- */
2002
- function () { return _this._changeDetectorRef.markForCheck(); }));
2003
- };
2004
- /** Clamps the given index to the bounds of 0 and the tabs length. */
2005
- /**
2006
- * Clamps the given index to the bounds of 0 and the tabs length.
2007
- * @private
2008
- * @param {?} index
2009
- * @return {?}
2010
- */
2011
- MatTabGroup.prototype._clampTabIndex = /**
2012
- * Clamps the given index to the bounds of 0 and the tabs length.
2013
- * @private
2014
- * @param {?} index
2015
- * @return {?}
2016
- */
2017
- function (index) {
2018
- // Note the `|| 0`, which ensures that values like NaN can't get through
2019
- // and which would otherwise throw the component into an infinite loop
2020
- // (since Math.max(NaN, 0) === NaN).
2021
- return Math.min(this._tabs.length - 1, Math.max(index || 0, 0));
2027
+ /** @type {?} */
2028
+ var lengthOfTabList = this._tabList.nativeElement.scrollWidth;
2029
+ /** @type {?} */
2030
+ var viewLength = this._tabListContainer.nativeElement.offsetWidth;
2031
+ return (lengthOfTabList - viewLength) || 0;
2022
2032
  };
2023
- /** Returns a unique id for each tab label element */
2033
+ /** Tells the ink-bar to align itself to the current label wrapper */
2024
2034
  /**
2025
- * Returns a unique id for each tab label element
2026
- * @param {?} i
2035
+ * Tells the ink-bar to align itself to the current label wrapper
2027
2036
  * @return {?}
2028
2037
  */
2029
- MatTabGroup.prototype._getTabLabelId = /**
2030
- * Returns a unique id for each tab label element
2031
- * @param {?} i
2038
+ MatPaginatedTabHeader.prototype._alignInkBarToSelectedTab = /**
2039
+ * Tells the ink-bar to align itself to the current label wrapper
2032
2040
  * @return {?}
2033
2041
  */
2034
- function (i) {
2035
- return "mat-tab-label-" + this._groupId + "-" + i;
2042
+ function () {
2043
+ /** @type {?} */
2044
+ var selectedItem = this._items && this._items.length ?
2045
+ this._items.toArray()[this.selectedIndex] : null;
2046
+ /** @type {?} */
2047
+ var selectedLabelWrapper = selectedItem ? selectedItem.elementRef.nativeElement : null;
2048
+ if (selectedLabelWrapper) {
2049
+ this._inkBar.alignToElement(selectedLabelWrapper);
2050
+ }
2051
+ else {
2052
+ this._inkBar.hide();
2053
+ }
2036
2054
  };
2037
- /** Returns a unique id for each tab content element */
2055
+ /** Stops the currently-running paginator interval. */
2038
2056
  /**
2039
- * Returns a unique id for each tab content element
2040
- * @param {?} i
2057
+ * Stops the currently-running paginator interval.
2041
2058
  * @return {?}
2042
2059
  */
2043
- MatTabGroup.prototype._getTabContentId = /**
2044
- * Returns a unique id for each tab content element
2045
- * @param {?} i
2060
+ MatPaginatedTabHeader.prototype._stopInterval = /**
2061
+ * Stops the currently-running paginator interval.
2046
2062
  * @return {?}
2047
2063
  */
2048
- function (i) {
2049
- return "mat-tab-content-" + this._groupId + "-" + i;
2064
+ function () {
2065
+ this._stopScrolling.next();
2050
2066
  };
2051
2067
  /**
2052
- * Sets the height of the body wrapper to the height of the activating tab if dynamic
2053
- * height property is true.
2068
+ * Handles the user pressing down on one of the paginators.
2069
+ * Starts scrolling the header after a certain amount of time.
2070
+ * @param direction In which direction the paginator should be scrolled.
2054
2071
  */
2055
2072
  /**
2056
- * Sets the height of the body wrapper to the height of the activating tab if dynamic
2057
- * height property is true.
2058
- * @param {?} tabHeight
2073
+ * Handles the user pressing down on one of the paginators.
2074
+ * Starts scrolling the header after a certain amount of time.
2075
+ * @param {?} direction In which direction the paginator should be scrolled.
2059
2076
  * @return {?}
2060
2077
  */
2061
- MatTabGroup.prototype._setTabBodyWrapperHeight = /**
2062
- * Sets the height of the body wrapper to the height of the activating tab if dynamic
2063
- * height property is true.
2064
- * @param {?} tabHeight
2078
+ MatPaginatedTabHeader.prototype._handlePaginatorPress = /**
2079
+ * Handles the user pressing down on one of the paginators.
2080
+ * Starts scrolling the header after a certain amount of time.
2081
+ * @param {?} direction In which direction the paginator should be scrolled.
2065
2082
  * @return {?}
2066
2083
  */
2067
- function (tabHeight) {
2068
- if (!this._dynamicHeight || !this._tabBodyWrapperHeight) {
2069
- return;
2070
- }
2071
- /** @type {?} */
2072
- var wrapper = this._tabBodyWrapper.nativeElement;
2073
- wrapper.style.height = this._tabBodyWrapperHeight + 'px';
2074
- // This conditional forces the browser to paint the height so that
2075
- // the animation to the new height can have an origin.
2076
- if (this._tabBodyWrapper.nativeElement.offsetHeight) {
2077
- wrapper.style.height = tabHeight + 'px';
2078
- }
2084
+ function (direction) {
2085
+ var _this = this;
2086
+ // Avoid overlapping timers.
2087
+ this._stopInterval();
2088
+ // Start a timer after the delay and keep firing based on the interval.
2089
+ timer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)
2090
+ // Keep the timer going until something tells it to stop or the component is destroyed.
2091
+ .pipe(takeUntil(merge(this._stopScrolling, this._destroyed)))
2092
+ .subscribe((/**
2093
+ * @return {?}
2094
+ */
2095
+ function () {
2096
+ var _a = _this._scrollHeader(direction), maxScrollDistance = _a.maxScrollDistance, distance = _a.distance;
2097
+ // Stop the timer if we've reached the start or the end.
2098
+ if (distance === 0 || distance >= maxScrollDistance) {
2099
+ _this._stopInterval();
2100
+ }
2101
+ }));
2079
2102
  };
2080
- /** Removes the height of the tab body wrapper. */
2081
2103
  /**
2082
- * Removes the height of the tab body wrapper.
2083
- * @return {?}
2084
- */
2085
- MatTabGroup.prototype._removeTabBodyWrapperHeight = /**
2086
- * Removes the height of the tab body wrapper.
2087
- * @return {?}
2088
- */
2089
- function () {
2090
- /** @type {?} */
2091
- var wrapper = this._tabBodyWrapper.nativeElement;
2092
- this._tabBodyWrapperHeight = wrapper.clientHeight;
2093
- wrapper.style.height = '';
2094
- this.animationDone.emit();
2095
- };
2096
- /** Handle click events, setting new selected index if appropriate. */
2104
+ * Scrolls the header to a given position.
2105
+ * @param position Position to which to scroll.
2106
+ * @returns Information on the current scroll distance and the maximum.
2107
+ */
2097
2108
  /**
2098
- * Handle click events, setting new selected index if appropriate.
2099
- * @param {?} tab
2100
- * @param {?} tabHeader
2101
- * @param {?} index
2102
- * @return {?}
2109
+ * Scrolls the header to a given position.
2110
+ * @private
2111
+ * @param {?} position Position to which to scroll.
2112
+ * @return {?} Information on the current scroll distance and the maximum.
2103
2113
  */
2104
- MatTabGroup.prototype._handleClick = /**
2105
- * Handle click events, setting new selected index if appropriate.
2106
- * @param {?} tab
2107
- * @param {?} tabHeader
2108
- * @param {?} index
2109
- * @return {?}
2114
+ MatPaginatedTabHeader.prototype._scrollTo = /**
2115
+ * Scrolls the header to a given position.
2116
+ * @private
2117
+ * @param {?} position Position to which to scroll.
2118
+ * @return {?} Information on the current scroll distance and the maximum.
2110
2119
  */
2111
- function (tab, tabHeader, index) {
2112
- if (!tab.disabled) {
2113
- this.selectedIndex = tabHeader.focusIndex = index;
2114
- }
2120
+ function (position) {
2121
+ /** @type {?} */
2122
+ var maxScrollDistance = this._getMaxScrollDistance();
2123
+ this._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));
2124
+ // Mark that the scroll distance has changed so that after the view is checked, the CSS
2125
+ // transformation can move the header.
2126
+ this._scrollDistanceChanged = true;
2127
+ this._checkScrollingControls();
2128
+ return { maxScrollDistance: maxScrollDistance, distance: this._scrollDistance };
2115
2129
  };
2116
- /** Retrieves the tabindex for the tab. */
2130
+ MatPaginatedTabHeader.decorators = [
2131
+ { type: Directive, args: [{
2132
+ // TODO(crisbeto): this selector can be removed when we update to Angular 9.0.
2133
+ selector: 'do-not-use-abstract-mat-paginated-tab-header'
2134
+ },] },
2135
+ ];
2136
+ /** @nocollapse */
2137
+ MatPaginatedTabHeader.ctorParameters = function () { return [
2138
+ { type: ElementRef },
2139
+ { type: ChangeDetectorRef },
2140
+ { type: ViewportRuler },
2141
+ { type: Directionality, decorators: [{ type: Optional }] },
2142
+ { type: NgZone },
2143
+ { type: Platform },
2144
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
2145
+ ]; };
2146
+ return MatPaginatedTabHeader;
2147
+ }());
2148
+
2149
+ /**
2150
+ * @fileoverview added by tsickle
2151
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2152
+ */
2153
+ /**
2154
+ * Base class with all of the `MatTabHeader` functionality.
2155
+ * \@docs-private
2156
+ * @abstract
2157
+ */
2158
+ var _MatTabHeaderBase = /** @class */ (function (_super) {
2159
+ __extends(_MatTabHeaderBase, _super);
2160
+ function _MatTabHeaderBase(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform,
2161
+ // @breaking-change 9.0.0 `_animationMode` parameter to be made required.
2162
+ animationMode) {
2163
+ var _this = _super.call(this, elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode) || this;
2164
+ _this._disableRipple = false;
2165
+ return _this;
2166
+ }
2167
+ Object.defineProperty(_MatTabHeaderBase.prototype, "disableRipple", {
2168
+ /** Whether the ripple effect is disabled or not. */
2169
+ get: /**
2170
+ * Whether the ripple effect is disabled or not.
2171
+ * @return {?}
2172
+ */
2173
+ function () { return this._disableRipple; },
2174
+ set: /**
2175
+ * @param {?} value
2176
+ * @return {?}
2177
+ */
2178
+ function (value) { this._disableRipple = coerceBooleanProperty(value); },
2179
+ enumerable: true,
2180
+ configurable: true
2181
+ });
2117
2182
  /**
2118
- * Retrieves the tabindex for the tab.
2119
- * @param {?} tab
2120
- * @param {?} idx
2183
+ * @protected
2184
+ * @param {?} event
2121
2185
  * @return {?}
2122
2186
  */
2123
- MatTabGroup.prototype._getTabIndex = /**
2124
- * Retrieves the tabindex for the tab.
2125
- * @param {?} tab
2126
- * @param {?} idx
2187
+ _MatTabHeaderBase.prototype._itemSelected = /**
2188
+ * @protected
2189
+ * @param {?} event
2127
2190
  * @return {?}
2128
2191
  */
2129
- function (tab, idx) {
2130
- if (tab.disabled) {
2131
- return null;
2132
- }
2133
- return this.selectedIndex === idx ? 0 : -1;
2192
+ function (event) {
2193
+ event.preventDefault();
2134
2194
  };
2135
- MatTabGroup.decorators = [
2136
- { type: Component, args: [{selector: 'mat-tab-group',
2137
- exportAs: 'matTabGroup',
2138
- template: "<mat-tab-header #tabHeader [selectedIndex]=\"selectedIndex\" [disableRipple]=\"disableRipple\" (indexFocused)=\"_focusChanged($event)\" (selectFocusedIndex)=\"selectedIndex = $event\"><div class=\"mat-tab-label\" role=\"tab\" matTabLabelWrapper mat-ripple cdkMonitorElementFocus *ngFor=\"let tab of _tabs; let i = index\" [id]=\"_getTabLabelId(i)\" [attr.tabIndex]=\"_getTabIndex(tab, i)\" [attr.aria-posinset]=\"i + 1\" [attr.aria-setsize]=\"_tabs.length\" [attr.aria-controls]=\"_getTabContentId(i)\" [attr.aria-selected]=\"selectedIndex == i\" [attr.aria-label]=\"tab.ariaLabel || null\" [attr.aria-labelledby]=\"(!tab.ariaLabel && tab.ariaLabelledby) ? tab.ariaLabelledby : null\" [class.mat-tab-label-active]=\"selectedIndex == i\" [disabled]=\"tab.disabled\" [matRippleDisabled]=\"tab.disabled || disableRipple\" (click)=\"_handleClick(tab, tabHeader, i)\"><div class=\"mat-tab-label-content\"><ng-template [ngIf]=\"tab.templateLabel\"><ng-template [cdkPortalOutlet]=\"tab.templateLabel\"></ng-template></ng-template><ng-template [ngIf]=\"!tab.templateLabel\">{{tab.textLabel}}</ng-template></div></div></mat-tab-header><div class=\"mat-tab-body-wrapper\" [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\" #tabBodyWrapper><mat-tab-body role=\"tabpanel\" *ngFor=\"let tab of _tabs; let i = index\" [id]=\"_getTabContentId(i)\" [attr.aria-labelledby]=\"_getTabLabelId(i)\" [class.mat-tab-body-active]=\"selectedIndex == i\" [content]=\"tab.content\" [position]=\"tab.position\" [origin]=\"tab.origin\" [animationDuration]=\"animationDuration\" (_onCentered)=\"_removeTabBodyWrapperHeight()\" (_onCentering)=\"_setTabBodyWrapperHeight($event)\"></mat-tab-body></div>",
2139
- 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:0}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}@media (-ms-high-contrast:active){.mat-tab-label:focus{outline:dotted 2px}}.mat-tab-label.mat-tab-disabled{cursor:default}@media (-ms-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}@media (-ms-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 .5s cubic-bezier(.35,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}"],
2195
+ _MatTabHeaderBase.decorators = [
2196
+ { type: Directive, args: [{
2197
+ // TODO(crisbeto): this selector can be removed when we update to Angular 9.0.
2198
+ selector: 'do-not-use-abstract-mat-tab-header-base'
2199
+ },] },
2200
+ ];
2201
+ /** @nocollapse */
2202
+ _MatTabHeaderBase.ctorParameters = function () { return [
2203
+ { type: ElementRef },
2204
+ { type: ChangeDetectorRef },
2205
+ { type: ViewportRuler },
2206
+ { type: Directionality, decorators: [{ type: Optional }] },
2207
+ { type: NgZone },
2208
+ { type: Platform },
2209
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
2210
+ ]; };
2211
+ _MatTabHeaderBase.propDecorators = {
2212
+ disableRipple: [{ type: Input }]
2213
+ };
2214
+ return _MatTabHeaderBase;
2215
+ }(MatPaginatedTabHeader));
2216
+ /**
2217
+ * The header of the tab group which displays a list of all the tabs in the tab group. Includes
2218
+ * an ink bar that follows the currently selected tab. When the tabs list's width exceeds the
2219
+ * width of the header container, then arrows will be displayed to allow the user to scroll
2220
+ * left and right across the header.
2221
+ * \@docs-private
2222
+ */
2223
+ var MatTabHeader = /** @class */ (function (_super) {
2224
+ __extends(MatTabHeader, _super);
2225
+ function MatTabHeader(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform,
2226
+ // @breaking-change 9.0.0 `_animationMode` parameter to be made required.
2227
+ animationMode) {
2228
+ return _super.call(this, elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode) || this;
2229
+ }
2230
+ MatTabHeader.decorators = [
2231
+ { type: Component, args: [{selector: 'mat-tab-header',
2232
+ template: "<div class=\"mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4\" #previousPaginator aria-hidden=\"true\" mat-ripple [matRippleDisabled]=\"_disableScrollBefore || disableRipple\" [class.mat-tab-header-pagination-disabled]=\"_disableScrollBefore\" (click)=\"_handlePaginatorClick('before')\" (mousedown)=\"_handlePaginatorPress('before')\" (touchend)=\"_stopInterval()\"><div class=\"mat-tab-header-pagination-chevron\"></div></div><div class=\"mat-tab-label-container\" #tabListContainer (keydown)=\"_handleKeydown($event)\"><div #tabList class=\"mat-tab-list\" [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\" role=\"tablist\" (cdkObserveContent)=\"_onContentChanges()\"><div class=\"mat-tab-labels\"><ng-content></ng-content></div><mat-ink-bar></mat-ink-bar></div></div><div class=\"mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4\" #nextPaginator aria-hidden=\"true\" mat-ripple [matRippleDisabled]=\"_disableScrollAfter || disableRipple\" [class.mat-tab-header-pagination-disabled]=\"_disableScrollAfter\" (mousedown)=\"_handlePaginatorPress('after')\" (click)=\"_handlePaginatorClick('after')\" (touchend)=\"_stopInterval()\"><div class=\"mat-tab-header-pagination-chevron\"></div></div>",
2233
+ 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-pagination-after,.mat-tab-header-rtl .mat-tab-header-pagination-before{padding-right:4px}.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-before .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 .5s cubic-bezier(.35,0,.25,1)}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:.5s cubic-bezier(.35,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}@media (-ms-high-contrast:active){.mat-ink-bar{outline:solid 2px;height:0}}.mat-tab-labels{display:flex}[mat-align-tabs=center] .mat-tab-labels{justify-content:center}[mat-align-tabs=end] .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:0}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}@media (-ms-high-contrast:active){.mat-tab-label:focus{outline:dotted 2px}}.mat-tab-label.mat-tab-disabled{cursor:default}@media (-ms-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}@media (-ms-high-contrast:active){.mat-tab-label{opacity:1}}@media (max-width:599px){.mat-tab-label{min-width:72px}}"],
2234
+ inputs: ['selectedIndex'],
2235
+ outputs: ['selectFocusedIndex', 'indexFocused'],
2140
2236
  encapsulation: ViewEncapsulation.None,
2141
2237
  changeDetection: ChangeDetectionStrategy.OnPush,
2142
- inputs: ['color', 'disableRipple'],
2143
2238
  host: {
2144
- 'class': 'mat-tab-group',
2145
- '[class.mat-tab-group-dynamic-height]': 'dynamicHeight',
2146
- '[class.mat-tab-group-inverted-header]': 'headerPosition === "below"',
2239
+ 'class': 'mat-tab-header',
2240
+ '[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',
2241
+ '[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'",
2147
2242
  },
2148
2243
  },] },
2149
2244
  ];
2150
2245
  /** @nocollapse */
2151
- MatTabGroup.ctorParameters = function () { return [
2246
+ MatTabHeader.ctorParameters = function () { return [
2152
2247
  { type: ElementRef },
2153
2248
  { type: ChangeDetectorRef },
2154
- { type: undefined, decorators: [{ type: Inject, args: [MAT_TABS_CONFIG,] }, { type: Optional }] },
2249
+ { type: ViewportRuler },
2250
+ { type: Directionality, decorators: [{ type: Optional }] },
2251
+ { type: NgZone },
2252
+ { type: Platform },
2155
2253
  { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
2156
2254
  ]; };
2157
- MatTabGroup.propDecorators = {
2158
- _tabs: [{ type: ContentChildren, args: [MatTab,] }],
2159
- _tabBodyWrapper: [{ type: ViewChild, args: ['tabBodyWrapper', { static: false },] }],
2160
- _tabHeader: [{ type: ViewChild, args: ['tabHeader', { static: false },] }],
2161
- dynamicHeight: [{ type: Input }],
2162
- selectedIndex: [{ type: Input }],
2163
- headerPosition: [{ type: Input }],
2164
- animationDuration: [{ type: Input }],
2165
- backgroundColor: [{ type: Input }],
2166
- selectedIndexChange: [{ type: Output }],
2167
- focusChange: [{ type: Output }],
2168
- animationDone: [{ type: Output }],
2169
- selectedTabChange: [{ type: Output }]
2255
+ MatTabHeader.propDecorators = {
2256
+ _items: [{ type: ContentChildren, args: [MatTabLabelWrapper,] }],
2257
+ _inkBar: [{ type: ViewChild, args: [MatInkBar, { static: true },] }],
2258
+ _tabListContainer: [{ type: ViewChild, args: ['tabListContainer', { static: true },] }],
2259
+ _tabList: [{ type: ViewChild, args: ['tabList', { static: true },] }],
2260
+ _nextPaginator: [{ type: ViewChild, args: ['nextPaginator', { static: false },] }],
2261
+ _previousPaginator: [{ type: ViewChild, args: ['previousPaginator', { static: false },] }]
2170
2262
  };
2171
- return MatTabGroup;
2172
- }(_MatTabGroupMixinBase));
2263
+ return MatTabHeader;
2264
+ }(_MatTabHeaderBase));
2173
2265
 
2174
2266
  /**
2175
2267
  * @fileoverview added by tsickle
2176
2268
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2177
2269
  */
2178
2270
  /**
2179
- * Navigation component matching the styles of the tab group header.
2180
- * Provides anchored navigation with animated ink bar.
2271
+ * Base class with all of the `MatTabNav` functionality.
2272
+ * \@docs-private
2273
+ * @abstract
2181
2274
  */
2182
- var MatTabNav = /** @class */ (function (_super) {
2183
- __extends(MatTabNav, _super);
2184
- function MatTabNav(elementRef, dir, ngZone, changeDetectorRef, viewportRuler,
2275
+ var _MatTabNavBase = /** @class */ (function (_super) {
2276
+ __extends(_MatTabNavBase, _super);
2277
+ function _MatTabNavBase(elementRef, dir, ngZone, changeDetectorRef, viewportRuler,
2185
2278
  /**
2186
2279
  * @deprecated @breaking-change 9.0.0 `platform` parameter to become required.
2187
2280
  */
@@ -2194,7 +2287,7 @@ var MatTabNav = /** @class */ (function (_super) {
2194
2287
  _this.color = 'primary';
2195
2288
  return _this;
2196
2289
  }
2197
- Object.defineProperty(MatTabNav.prototype, "backgroundColor", {
2290
+ Object.defineProperty(_MatTabNavBase.prototype, "backgroundColor", {
2198
2291
  /** Background color of the tab nav. */
2199
2292
  get: /**
2200
2293
  * Background color of the tab nav.
@@ -2217,7 +2310,7 @@ var MatTabNav = /** @class */ (function (_super) {
2217
2310
  enumerable: true,
2218
2311
  configurable: true
2219
2312
  });
2220
- Object.defineProperty(MatTabNav.prototype, "disableRipple", {
2313
+ Object.defineProperty(_MatTabNavBase.prototype, "disableRipple", {
2221
2314
  /** Whether the ripple effect is disabled or not. */
2222
2315
  get: /**
2223
2316
  * Whether the ripple effect is disabled or not.
@@ -2236,7 +2329,7 @@ var MatTabNav = /** @class */ (function (_super) {
2236
2329
  * @protected
2237
2330
  * @return {?}
2238
2331
  */
2239
- MatTabNav.prototype._itemSelected = /**
2332
+ _MatTabNavBase.prototype._itemSelected = /**
2240
2333
  * @protected
2241
2334
  * @return {?}
2242
2335
  */
@@ -2246,11 +2339,19 @@ var MatTabNav = /** @class */ (function (_super) {
2246
2339
  /**
2247
2340
  * @return {?}
2248
2341
  */
2249
- MatTabNav.prototype.ngAfterContentInit = /**
2342
+ _MatTabNavBase.prototype.ngAfterContentInit = /**
2250
2343
  * @return {?}
2251
2344
  */
2252
2345
  function () {
2253
- this.updateActiveLink();
2346
+ var _this = this;
2347
+ // We need this to run before the `changes` subscription in parent to ensure that the
2348
+ // selectedIndex is up-to-date by the time the super class starts looking for it.
2349
+ this._items.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe((/**
2350
+ * @return {?}
2351
+ */
2352
+ function () {
2353
+ _this.updateActiveLink();
2354
+ }));
2254
2355
  _super.prototype.ngAfterContentInit.call(this);
2255
2356
  };
2256
2357
  /**
@@ -2263,7 +2364,7 @@ var MatTabNav = /** @class */ (function (_super) {
2263
2364
  * @param {?=} _element
2264
2365
  * @return {?}
2265
2366
  */
2266
- MatTabNav.prototype.updateActiveLink = /**
2367
+ _MatTabNavBase.prototype.updateActiveLink = /**
2267
2368
  * Notifies the component that the active link has been changed.
2268
2369
  * \@breaking-change 8.0.0 `element` parameter to be removed.
2269
2370
  * @param {?=} _element
@@ -2286,6 +2387,42 @@ var MatTabNav = /** @class */ (function (_super) {
2286
2387
  this.selectedIndex = -1;
2287
2388
  this._inkBar.hide();
2288
2389
  };
2390
+ _MatTabNavBase.decorators = [
2391
+ { type: Directive, args: [{
2392
+ // TODO(crisbeto): this selector can be removed when we update to Angular 9.0.
2393
+ selector: 'do-not-use-abstract-mat-tab-nav-base'
2394
+ },] },
2395
+ ];
2396
+ /** @nocollapse */
2397
+ _MatTabNavBase.ctorParameters = function () { return [
2398
+ { type: ElementRef },
2399
+ { type: Directionality, decorators: [{ type: Optional }] },
2400
+ { type: NgZone },
2401
+ { type: ChangeDetectorRef },
2402
+ { type: ViewportRuler },
2403
+ { type: Platform, decorators: [{ type: Optional }] },
2404
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
2405
+ ]; };
2406
+ _MatTabNavBase.propDecorators = {
2407
+ backgroundColor: [{ type: Input }],
2408
+ disableRipple: [{ type: Input }],
2409
+ color: [{ type: Input }]
2410
+ };
2411
+ return _MatTabNavBase;
2412
+ }(MatPaginatedTabHeader));
2413
+ /**
2414
+ * Navigation component matching the styles of the tab group header.
2415
+ * Provides anchored navigation with animated ink bar.
2416
+ */
2417
+ var MatTabNav = /** @class */ (function (_super) {
2418
+ __extends(MatTabNav, _super);
2419
+ function MatTabNav(elementRef, dir, ngZone, changeDetectorRef, viewportRuler,
2420
+ /**
2421
+ * @deprecated @breaking-change 9.0.0 `platform` parameter to become required.
2422
+ */
2423
+ platform, animationMode) {
2424
+ return _super.call(this, elementRef, dir, ngZone, changeDetectorRef, viewportRuler, platform, animationMode) || this;
2425
+ }
2289
2426
  MatTabNav.decorators = [
2290
2427
  { type: Component, args: [{selector: '[mat-tab-nav-bar]',
2291
2428
  exportAs: 'matTabNavBar, matTabNav',
@@ -2323,29 +2460,26 @@ var MatTabNav = /** @class */ (function (_super) {
2323
2460
  _tabListContainer: [{ type: ViewChild, args: ['tabListContainer', { static: true },] }],
2324
2461
  _tabList: [{ type: ViewChild, args: ['tabList', { static: true },] }],
2325
2462
  _nextPaginator: [{ type: ViewChild, args: ['nextPaginator', { static: false },] }],
2326
- _previousPaginator: [{ type: ViewChild, args: ['previousPaginator', { static: false },] }],
2327
- backgroundColor: [{ type: Input }],
2328
- disableRipple: [{ type: Input }],
2329
- color: [{ type: Input }]
2463
+ _previousPaginator: [{ type: ViewChild, args: ['previousPaginator', { static: false },] }]
2330
2464
  };
2331
2465
  return MatTabNav;
2332
- }(MatPaginatedTabHeader));
2466
+ }(_MatTabNavBase));
2333
2467
  // Boilerplate for applying mixins to MatTabLink.
2334
2468
  var
2335
2469
  // Boilerplate for applying mixins to MatTabLink.
2336
- MatTabLinkBase = /** @class */ (function () {
2337
- function MatTabLinkBase() {
2470
+ MatTabLinkMixinBase = /** @class */ (function () {
2471
+ function MatTabLinkMixinBase() {
2338
2472
  }
2339
- return MatTabLinkBase;
2473
+ return MatTabLinkMixinBase;
2340
2474
  }());
2341
2475
  /** @type {?} */
2342
- var _MatTabLinkMixinBase = mixinTabIndex(mixinDisableRipple(mixinDisabled(MatTabLinkBase)));
2476
+ var _MatTabLinkMixinBase = mixinTabIndex(mixinDisableRipple(mixinDisabled(MatTabLinkMixinBase)));
2343
2477
  /**
2344
- * Link inside of a `mat-tab-nav-bar`.
2478
+ * Base class with all of the `MatTabLink` functionality.
2345
2479
  */
2346
- var MatTabLink = /** @class */ (function (_super) {
2347
- __extends(MatTabLink, _super);
2348
- function MatTabLink(_tabNavBar, elementRef, ngZone, platform, globalRippleOptions, tabIndex, _focusMonitor, animationMode) {
2480
+ var _MatTabLinkBase = /** @class */ (function (_super) {
2481
+ __extends(_MatTabLinkBase, _super);
2482
+ function _MatTabLinkBase(_tabNavBar, elementRef, globalRippleOptions, tabIndex, _focusMonitor, animationMode) {
2349
2483
  var _this = _super.call(this) || this;
2350
2484
  _this._tabNavBar = _tabNavBar;
2351
2485
  _this.elementRef = elementRef;
@@ -2354,8 +2488,6 @@ var MatTabLink = /** @class */ (function (_super) {
2354
2488
  * Whether the tab link is active or not.
2355
2489
  */
2356
2490
  _this._isActive = false;
2357
- _this._tabLinkRipple = new RippleRenderer(_this, ngZone, elementRef, platform);
2358
- _this._tabLinkRipple.setupTriggerEvents(elementRef.nativeElement);
2359
2491
  _this.rippleConfig = globalRippleOptions || {};
2360
2492
  _this.tabIndex = parseInt(tabIndex) || 0;
2361
2493
  if (animationMode === 'NoopAnimations') {
@@ -2364,7 +2496,7 @@ var MatTabLink = /** @class */ (function (_super) {
2364
2496
  _focusMonitor.monitor(elementRef);
2365
2497
  return _this;
2366
2498
  }
2367
- Object.defineProperty(MatTabLink.prototype, "active", {
2499
+ Object.defineProperty(_MatTabLinkBase.prototype, "active", {
2368
2500
  /** Whether the link is active. */
2369
2501
  get: /**
2370
2502
  * Whether the link is active.
@@ -2384,7 +2516,7 @@ var MatTabLink = /** @class */ (function (_super) {
2384
2516
  enumerable: true,
2385
2517
  configurable: true
2386
2518
  });
2387
- Object.defineProperty(MatTabLink.prototype, "rippleDisabled", {
2519
+ Object.defineProperty(_MatTabLinkBase.prototype, "rippleDisabled", {
2388
2520
  /**
2389
2521
  * Whether ripples are disabled on interaction.
2390
2522
  * @docs-private
@@ -2404,12 +2536,52 @@ var MatTabLink = /** @class */ (function (_super) {
2404
2536
  /**
2405
2537
  * @return {?}
2406
2538
  */
2407
- MatTabLink.prototype.focus = /**
2539
+ _MatTabLinkBase.prototype.focus = /**
2408
2540
  * @return {?}
2409
2541
  */
2410
2542
  function () {
2411
2543
  this.elementRef.nativeElement.focus();
2412
2544
  };
2545
+ /**
2546
+ * @return {?}
2547
+ */
2548
+ _MatTabLinkBase.prototype.ngOnDestroy = /**
2549
+ * @return {?}
2550
+ */
2551
+ function () {
2552
+ this._focusMonitor.stopMonitoring(this.elementRef);
2553
+ };
2554
+ _MatTabLinkBase.decorators = [
2555
+ { type: Directive, args: [{
2556
+ // TODO(crisbeto): this selector can be removed when we update to Angular 9.0.
2557
+ selector: 'do-not-use-abstract-mat-tab-link-base'
2558
+ },] },
2559
+ ];
2560
+ /** @nocollapse */
2561
+ _MatTabLinkBase.ctorParameters = function () { return [
2562
+ { type: _MatTabNavBase },
2563
+ { type: ElementRef },
2564
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RIPPLE_GLOBAL_OPTIONS,] }] },
2565
+ { type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
2566
+ { type: FocusMonitor },
2567
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
2568
+ ]; };
2569
+ _MatTabLinkBase.propDecorators = {
2570
+ active: [{ type: Input }]
2571
+ };
2572
+ return _MatTabLinkBase;
2573
+ }(_MatTabLinkMixinBase));
2574
+ /**
2575
+ * Link inside of a `mat-tab-nav-bar`.
2576
+ */
2577
+ var MatTabLink = /** @class */ (function (_super) {
2578
+ __extends(MatTabLink, _super);
2579
+ function MatTabLink(tabNavBar, elementRef, ngZone, platform, globalRippleOptions, tabIndex, focusMonitor, animationMode) {
2580
+ var _this = _super.call(this, tabNavBar, elementRef, globalRippleOptions, tabIndex, focusMonitor, animationMode) || this;
2581
+ _this._tabLinkRipple = new RippleRenderer(_this, ngZone, elementRef, platform);
2582
+ _this._tabLinkRipple.setupTriggerEvents(elementRef.nativeElement);
2583
+ return _this;
2584
+ }
2413
2585
  /**
2414
2586
  * @return {?}
2415
2587
  */
@@ -2417,8 +2589,8 @@ var MatTabLink = /** @class */ (function (_super) {
2417
2589
  * @return {?}
2418
2590
  */
2419
2591
  function () {
2592
+ _super.prototype.ngOnDestroy.call(this);
2420
2593
  this._tabLinkRipple._removeTriggerEvents();
2421
- this._focusMonitor.stopMonitoring(this.elementRef);
2422
2594
  };
2423
2595
  MatTabLink.decorators = [
2424
2596
  { type: Directive, args: [{
@@ -2446,11 +2618,8 @@ var MatTabLink = /** @class */ (function (_super) {
2446
2618
  { type: FocusMonitor },
2447
2619
  { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
2448
2620
  ]; };
2449
- MatTabLink.propDecorators = {
2450
- active: [{ type: Input }]
2451
- };
2452
2621
  return MatTabLink;
2453
- }(_MatTabLinkMixinBase));
2622
+ }(_MatTabLinkBase));
2454
2623
 
2455
2624
  /**
2456
2625
  * @fileoverview added by tsickle
@@ -2491,6 +2660,14 @@ var MatTabsModule = /** @class */ (function () {
2491
2660
  MatTabBodyPortal,
2492
2661
  MatTabHeader,
2493
2662
  MatTabContent,
2663
+ (/** @type {?} */ (
2664
+ // TODO(crisbeto): these can be removed once they're turned into selector-less directives.
2665
+ MatPaginatedTabHeader)),
2666
+ (/** @type {?} */ (_MatTabGroupBase)),
2667
+ (/** @type {?} */ (_MatTabNavBase)),
2668
+ (/** @type {?} */ (_MatTabBodyBase)),
2669
+ (/** @type {?} */ (_MatTabHeaderBase)),
2670
+ (/** @type {?} */ (_MatTabLinkBase)),
2494
2671
  ],
2495
2672
  },] },
2496
2673
  ];
@@ -2512,5 +2689,5 @@ var MatTabsModule = /** @class */ (function () {
2512
2689
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2513
2690
  */
2514
2691
 
2515
- export { MatInkBar, _MAT_INK_BAR_POSITIONER, MatTabBody, MatTabBodyPortal, MatTabHeader, MatTabLabelWrapper, MatTab, MatTabLabel, MatTabNav, MatTabLink, MatTabContent, MatTabsModule, MatTabChangeEvent, MAT_TABS_CONFIG, MatTabGroup, matTabsAnimations, _MAT_INK_BAR_POSITIONER_FACTORY as ɵa23, MatPaginatedTabHeader as ɵb23 };
2692
+ export { MatTabsModule, MatInkBar, _MAT_INK_BAR_POSITIONER, MatTabBody, _MatTabBodyBase, MatTabBodyPortal, MatTabHeader, _MatTabHeaderBase, MatTabLabelWrapper, MatTab, MatTabLabel, MatTabNav, MatTabLink, _MatTabNavBase, _MatTabLinkBase, MatTabContent, MatTabChangeEvent, MAT_TABS_CONFIG, _MatTabGroupBase, MatTabGroup, matTabsAnimations, _MAT_INK_BAR_POSITIONER_FACTORY as ɵa24, MatPaginatedTabHeader as ɵb24 };
2516
2693
  //# sourceMappingURL=tabs.es5.js.map