@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
@@ -1 +1 @@
1
- {"version":3,"file":"paginator.es5.js","sources":["../../../src/material/paginator/paginator-module.ts","../../../src/material/paginator/paginator.ts","../../../src/material/paginator/paginator-intl.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatButtonModule} from '@angular/material/button';\nimport {MatSelectModule} from '@angular/material/select';\nimport {MatTooltipModule} from '@angular/material/tooltip';\nimport {MatPaginator} from './paginator';\nimport {MAT_PAGINATOR_INTL_PROVIDER} from './paginator-intl';\n\n\n@NgModule({\n imports: [\n CommonModule,\n MatButtonModule,\n MatSelectModule,\n MatTooltipModule,\n ],\n exports: [MatPaginator],\n declarations: [MatPaginator],\n providers: [MAT_PAGINATOR_INTL_PROVIDER],\n})\nexport class MatPaginatorModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceNumberProperty, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {MatPaginatorIntl} from './paginator-intl';\nimport {\n HasInitialized,\n HasInitializedCtor,\n mixinInitialized,\n ThemePalette,\n mixinDisabled,\n CanDisableCtor,\n CanDisable,\n} from '@angular/material/core';\n\n/** The default page size if there is no page size and there are no provided page size options. */\nconst DEFAULT_PAGE_SIZE = 50;\n\n/**\n * Change event object that is emitted when the user selects a\n * different page size or navigates to another page.\n */\nexport class PageEvent {\n /** The current page index. */\n pageIndex: number;\n\n /**\n * Index of the page that was selected previously.\n * @breaking-change 8.0.0 To be made into a required property.\n */\n previousPageIndex?: number;\n\n /** The current page size */\n pageSize: number;\n\n /** The current total number of items being paged */\n length: number;\n}\n\n// Boilerplate for applying mixins to MatPaginator.\n/** @docs-private */\nclass MatPaginatorBase {}\nconst _MatPaginatorBase: CanDisableCtor & HasInitializedCtor & typeof MatPaginatorBase =\n mixinDisabled(mixinInitialized(MatPaginatorBase));\n\n/**\n * Component to provide navigation between paged information. Displays the size of the current\n * page, user-selectable options to change that size, what items are being shown, and\n * navigational button to go to the previous or next page.\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-paginator',\n exportAs: 'matPaginator',\n templateUrl: 'paginator.html',\n styleUrls: ['paginator.css'],\n inputs: ['disabled'],\n host: {\n 'class': 'mat-paginator',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy, CanDisable,\n HasInitialized {\n private _initialized: boolean;\n private _intlChanges: Subscription;\n\n /** Theme color to be used for the underlying form controls. */\n @Input() color: ThemePalette;\n\n /** The zero-based page index of the displayed list of items. Defaulted to 0. */\n @Input()\n get pageIndex(): number { return this._pageIndex; }\n set pageIndex(value: number) {\n this._pageIndex = Math.max(coerceNumberProperty(value), 0);\n this._changeDetectorRef.markForCheck();\n }\n private _pageIndex = 0;\n\n /** The length of the total number of items that are being paginated. Defaulted to 0. */\n @Input()\n get length(): number { return this._length; }\n set length(value: number) {\n this._length = coerceNumberProperty(value);\n this._changeDetectorRef.markForCheck();\n }\n private _length = 0;\n\n /** Number of items to display on a page. By default set to 50. */\n @Input()\n get pageSize(): number { return this._pageSize; }\n set pageSize(value: number) {\n this._pageSize = Math.max(coerceNumberProperty(value), 0);\n this._updateDisplayedPageSizeOptions();\n }\n private _pageSize: number;\n\n /** The set of provided page size options to display to the user. */\n @Input()\n get pageSizeOptions(): number[] { return this._pageSizeOptions; }\n set pageSizeOptions(value: number[]) {\n this._pageSizeOptions = (value || []).map(p => coerceNumberProperty(p));\n this._updateDisplayedPageSizeOptions();\n }\n private _pageSizeOptions: number[] = [];\n\n /** Whether to hide the page size selection UI from the user. */\n @Input()\n get hidePageSize(): boolean { return this._hidePageSize; }\n set hidePageSize(value: boolean) {\n this._hidePageSize = coerceBooleanProperty(value);\n }\n private _hidePageSize = false;\n\n\n /** Whether to show the first/last buttons UI to the user. */\n @Input()\n get showFirstLastButtons(): boolean { return this._showFirstLastButtons; }\n set showFirstLastButtons(value: boolean) {\n this._showFirstLastButtons = coerceBooleanProperty(value);\n }\n private _showFirstLastButtons = false;\n\n /** Event emitted when the paginator changes the page size or page index. */\n @Output() readonly page: EventEmitter<PageEvent> = new EventEmitter<PageEvent>();\n\n /** Displayed set of page size options. Will be sorted and include current page size. */\n _displayedPageSizeOptions: number[];\n\n constructor(public _intl: MatPaginatorIntl,\n private _changeDetectorRef: ChangeDetectorRef) {\n super();\n this._intlChanges = _intl.changes.subscribe(() => this._changeDetectorRef.markForCheck());\n }\n\n ngOnInit() {\n this._initialized = true;\n this._updateDisplayedPageSizeOptions();\n this._markInitialized();\n }\n\n ngOnDestroy() {\n this._intlChanges.unsubscribe();\n }\n\n /** Advances to the next page if it exists. */\n nextPage(): void {\n if (!this.hasNextPage()) { return; }\n\n const previousPageIndex = this.pageIndex;\n this.pageIndex++;\n this._emitPageEvent(previousPageIndex);\n }\n\n /** Move back to the previous page if it exists. */\n previousPage(): void {\n if (!this.hasPreviousPage()) { return; }\n\n const previousPageIndex = this.pageIndex;\n this.pageIndex--;\n this._emitPageEvent(previousPageIndex);\n }\n\n /** Move to the first page if not already there. */\n firstPage(): void {\n // hasPreviousPage being false implies at the start\n if (!this.hasPreviousPage()) { return; }\n\n const previousPageIndex = this.pageIndex;\n this.pageIndex = 0;\n this._emitPageEvent(previousPageIndex);\n }\n\n /** Move to the last page if not already there. */\n lastPage(): void {\n // hasNextPage being false implies at the end\n if (!this.hasNextPage()) { return; }\n\n const previousPageIndex = this.pageIndex;\n this.pageIndex = this.getNumberOfPages() - 1;\n this._emitPageEvent(previousPageIndex);\n }\n\n /** Whether there is a previous page. */\n hasPreviousPage(): boolean {\n return this.pageIndex >= 1 && this.pageSize != 0;\n }\n\n /** Whether there is a next page. */\n hasNextPage(): boolean {\n const maxPageIndex = this.getNumberOfPages() - 1;\n return this.pageIndex < maxPageIndex && this.pageSize != 0;\n }\n\n /** Calculate the number of pages */\n getNumberOfPages(): number {\n if (!this.pageSize) {\n return 0;\n }\n\n return Math.ceil(this.length / this.pageSize);\n }\n\n\n /**\n * Changes the page size so that the first item displayed on the page will still be\n * displayed using the new page size.\n *\n * For example, if the page size is 10 and on the second page (items indexed 10-19) then\n * switching so that the page size is 5 will set the third page as the current page so\n * that the 10th item will still be displayed.\n */\n _changePageSize(pageSize: number) {\n // Current page needs to be updated to reflect the new page size. Navigate to the page\n // containing the previous page's first item.\n const startIndex = this.pageIndex * this.pageSize;\n const previousPageIndex = this.pageIndex;\n\n this.pageIndex = Math.floor(startIndex / pageSize) || 0;\n this.pageSize = pageSize;\n this._emitPageEvent(previousPageIndex);\n }\n\n /** Checks whether the buttons for going forwards should be disabled. */\n _nextButtonsDisabled() {\n return this.disabled || !this.hasNextPage();\n }\n\n /** Checks whether the buttons for going backwards should be disabled. */\n _previousButtonsDisabled() {\n return this.disabled || !this.hasPreviousPage();\n }\n\n /**\n * Updates the list of page size options to display to the user. Includes making sure that\n * the page size is an option and that the list is sorted.\n */\n private _updateDisplayedPageSizeOptions() {\n if (!this._initialized) { return; }\n\n // If no page size is provided, use the first page size option or the default page size.\n if (!this.pageSize) {\n this._pageSize = this.pageSizeOptions.length != 0 ?\n this.pageSizeOptions[0] :\n DEFAULT_PAGE_SIZE;\n }\n\n this._displayedPageSizeOptions = this.pageSizeOptions.slice();\n\n if (this._displayedPageSizeOptions.indexOf(this.pageSize) === -1) {\n this._displayedPageSizeOptions.push(this.pageSize);\n }\n\n // Sort the numbers using a number-specific sort function.\n this._displayedPageSizeOptions.sort((a, b) => a - b);\n this._changeDetectorRef.markForCheck();\n }\n\n /** Emits an event notifying that a change of the paginator's properties has been triggered. */\n private _emitPageEvent(previousPageIndex: number) {\n this.page.emit({\n previousPageIndex,\n pageIndex: this.pageIndex,\n pageSize: this.pageSize,\n length: this.length\n });\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable, Optional, SkipSelf} from '@angular/core';\nimport {Subject} from 'rxjs';\n\n\n/**\n * To modify the labels and text displayed, create a new instance of MatPaginatorIntl and\n * include it in a custom provider\n */\n@Injectable({providedIn: 'root'})\nexport class MatPaginatorIntl {\n /**\n * Stream to emit from when labels are changed. Use this to notify components when the labels have\n * changed after initialization.\n */\n readonly changes: Subject<void> = new Subject<void>();\n\n /** A label for the page size selector. */\n itemsPerPageLabel: string = 'Items per page:';\n\n /** A label for the button that increments the current page. */\n nextPageLabel: string = 'Next page';\n\n /** A label for the button that decrements the current page. */\n previousPageLabel: string = 'Previous page';\n\n /** A label for the button that moves to the first page. */\n firstPageLabel: string = 'First page';\n\n /** A label for the button that moves to the last page. */\n lastPageLabel: string = 'Last page';\n\n /** A label for the range of items within the current page and the length of the whole list. */\n getRangeLabel = (page: number, pageSize: number, length: number) => {\n if (length == 0 || pageSize == 0) { return `0 of ${length}`; }\n\n length = Math.max(length, 0);\n\n const startIndex = page * pageSize;\n\n // If the start index exceeds the list length, do not try and fix the end index to the end.\n const endIndex = startIndex < length ?\n Math.min(startIndex + pageSize, length) :\n startIndex + pageSize;\n\n return `${startIndex + 1} - ${endIndex} of ${length}`;\n }\n}\n\n/** @docs-private */\nexport function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl: MatPaginatorIntl) {\n return parentIntl || new MatPaginatorIntl();\n}\n\n/** @docs-private */\nexport const MAT_PAGINATOR_INTL_PROVIDER = {\n // If there is already an MatPaginatorIntl available, use that. Otherwise, provide a new one.\n provide: MatPaginatorIntl,\n deps: [[new Optional(), new SkipSelf(), MatPaginatorIntl]],\n useFactory: MAT_PAGINATOR_INTL_PROVIDER_FACTORY\n};\n"],"names":["tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AEgBA,AAAA,IAAA,gBAAA,kBAAA,YAAA;IAAA,SAAA,gBAAA,GAAA;;;;;QAMW,IAAX,CAAA,OAAkB,GAAkB,IAAI,OAAO,EAAQ,CAAC;;;;QAGtD,IAAF,CAAA,iBAAmB,GAAW,iBAAiB,CAAC;;;;QAG9C,IAAF,CAAA,aAAe,GAAW,WAAW,CAAC;;;;QAGpC,IAAF,CAAA,iBAAmB,GAAW,eAAe,CAAC;;;;QAG5C,IAAF,CAAA,cAAgB,GAAW,YAAY,CAAC;;;;QAGtC,IAAF,CAAA,aAAe,GAAW,WAAW,CAAC;;;;QAGpC,IAAF,CAAA,aAAe;;;;;;QAAG,UAAC,IAAY,EAAE,QAAgB,EAAE,MAAc,EAAjE;YACI,IAAI,MAAM,IAAI,CAAC,IAAI,QAAQ,IAAI,CAAC,EAAE;gBAAE,OAAO,OAA/C,GAAuD,MAAQ,CAAC;aAAE;YAE9D,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;;YAEjC,IAAU,UAAU,GAAG,IAAI,GAAG,QAAQ,CAAtC;;;YAGA,IAAU,QAAQ,GAAG,UAAU,GAAG,MAAM;gBAChC,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,QAAQ,EAAE,MAAM,CAAC;gBACvC,UAAU,GAAG,QAAQ,CAA7B;Y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CAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"paginator.es5.js","sources":["../../../src/material/paginator/paginator-module.ts","../../../src/material/paginator/paginator.ts","../../../src/material/paginator/paginator-intl.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatButtonModule} from '@angular/material/button';\nimport {MatSelectModule} from '@angular/material/select';\nimport {MatTooltipModule} from '@angular/material/tooltip';\nimport {MatPaginator} from './paginator';\nimport {MAT_PAGINATOR_INTL_PROVIDER} from './paginator-intl';\n\n\n@NgModule({\n imports: [\n CommonModule,\n MatButtonModule,\n MatSelectModule,\n MatTooltipModule,\n ],\n exports: [MatPaginator],\n declarations: [MatPaginator],\n providers: [MAT_PAGINATOR_INTL_PROVIDER],\n})\nexport class MatPaginatorModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceNumberProperty, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {MatPaginatorIntl} from './paginator-intl';\nimport {\n HasInitialized,\n HasInitializedCtor,\n mixinInitialized,\n ThemePalette,\n mixinDisabled,\n CanDisableCtor,\n CanDisable,\n} from '@angular/material/core';\n\n/** The default page size if there is no page size and there are no provided page size options. */\nconst DEFAULT_PAGE_SIZE = 50;\n\n/**\n * Change event object that is emitted when the user selects a\n * different page size or navigates to another page.\n */\nexport class PageEvent {\n /** The current page index. */\n pageIndex: number;\n\n /**\n * Index of the page that was selected previously.\n * @breaking-change 8.0.0 To be made into a required property.\n */\n previousPageIndex?: number;\n\n /** The current page size */\n pageSize: number;\n\n /** The current total number of items being paged */\n length: number;\n}\n\n// Boilerplate for applying mixins to MatPaginator.\n/** @docs-private */\nclass MatPaginatorBase {}\nconst _MatPaginatorBase: CanDisableCtor & HasInitializedCtor & typeof MatPaginatorBase =\n mixinDisabled(mixinInitialized(MatPaginatorBase));\n\n/**\n * Component to provide navigation between paged information. Displays the size of the current\n * page, user-selectable options to change that size, what items are being shown, and\n * navigational button to go to the previous or next page.\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-paginator',\n exportAs: 'matPaginator',\n templateUrl: 'paginator.html',\n styleUrls: ['paginator.css'],\n inputs: ['disabled'],\n host: {\n 'class': 'mat-paginator',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy, CanDisable,\n HasInitialized {\n private _initialized: boolean;\n private _intlChanges: Subscription;\n\n /** Theme color to be used for the underlying form controls. */\n @Input() color: ThemePalette;\n\n /** The zero-based page index of the displayed list of items. Defaulted to 0. */\n @Input()\n get pageIndex(): number { return this._pageIndex; }\n set pageIndex(value: number) {\n this._pageIndex = Math.max(coerceNumberProperty(value), 0);\n this._changeDetectorRef.markForCheck();\n }\n private _pageIndex = 0;\n\n /** The length of the total number of items that are being paginated. Defaulted to 0. */\n @Input()\n get length(): number { return this._length; }\n set length(value: number) {\n this._length = coerceNumberProperty(value);\n this._changeDetectorRef.markForCheck();\n }\n private _length = 0;\n\n /** Number of items to display on a page. By default set to 50. */\n @Input()\n get pageSize(): number { return this._pageSize; }\n set pageSize(value: number) {\n this._pageSize = Math.max(coerceNumberProperty(value), 0);\n this._updateDisplayedPageSizeOptions();\n }\n private _pageSize: number;\n\n /** The set of provided page size options to display to the user. */\n @Input()\n get pageSizeOptions(): number[] { return this._pageSizeOptions; }\n set pageSizeOptions(value: number[]) {\n this._pageSizeOptions = (value || []).map(p => coerceNumberProperty(p));\n this._updateDisplayedPageSizeOptions();\n }\n private _pageSizeOptions: number[] = [];\n\n /** Whether to hide the page size selection UI from the user. */\n @Input()\n get hidePageSize(): boolean { return this._hidePageSize; }\n set hidePageSize(value: boolean) {\n this._hidePageSize = coerceBooleanProperty(value);\n }\n private _hidePageSize = false;\n\n\n /** Whether to show the first/last buttons UI to the user. */\n @Input()\n get showFirstLastButtons(): boolean { return this._showFirstLastButtons; }\n set showFirstLastButtons(value: boolean) {\n this._showFirstLastButtons = coerceBooleanProperty(value);\n }\n private _showFirstLastButtons = false;\n\n /** Event emitted when the paginator changes the page size or page index. */\n @Output() readonly page: EventEmitter<PageEvent> = new EventEmitter<PageEvent>();\n\n /** Displayed set of page size options. Will be sorted and include current page size. */\n _displayedPageSizeOptions: number[];\n\n constructor(public _intl: MatPaginatorIntl,\n private _changeDetectorRef: ChangeDetectorRef) {\n super();\n this._intlChanges = _intl.changes.subscribe(() => this._changeDetectorRef.markForCheck());\n }\n\n ngOnInit() {\n this._initialized = true;\n this._updateDisplayedPageSizeOptions();\n this._markInitialized();\n }\n\n ngOnDestroy() {\n this._intlChanges.unsubscribe();\n }\n\n /** Advances to the next page if it exists. */\n nextPage(): void {\n if (!this.hasNextPage()) { return; }\n\n const previousPageIndex = this.pageIndex;\n this.pageIndex++;\n this._emitPageEvent(previousPageIndex);\n }\n\n /** Move back to the previous page if it exists. */\n previousPage(): void {\n if (!this.hasPreviousPage()) { return; }\n\n const previousPageIndex = this.pageIndex;\n this.pageIndex--;\n this._emitPageEvent(previousPageIndex);\n }\n\n /** Move to the first page if not already there. */\n firstPage(): void {\n // hasPreviousPage being false implies at the start\n if (!this.hasPreviousPage()) { return; }\n\n const previousPageIndex = this.pageIndex;\n this.pageIndex = 0;\n this._emitPageEvent(previousPageIndex);\n }\n\n /** Move to the last page if not already there. */\n lastPage(): void {\n // hasNextPage being false implies at the end\n if (!this.hasNextPage()) { return; }\n\n const previousPageIndex = this.pageIndex;\n this.pageIndex = this.getNumberOfPages() - 1;\n this._emitPageEvent(previousPageIndex);\n }\n\n /** Whether there is a previous page. */\n hasPreviousPage(): boolean {\n return this.pageIndex >= 1 && this.pageSize != 0;\n }\n\n /** Whether there is a next page. */\n hasNextPage(): boolean {\n const maxPageIndex = this.getNumberOfPages() - 1;\n return this.pageIndex < maxPageIndex && this.pageSize != 0;\n }\n\n /** Calculate the number of pages */\n getNumberOfPages(): number {\n if (!this.pageSize) {\n return 0;\n }\n\n return Math.ceil(this.length / this.pageSize);\n }\n\n\n /**\n * Changes the page size so that the first item displayed on the page will still be\n * displayed using the new page size.\n *\n * For example, if the page size is 10 and on the second page (items indexed 10-19) then\n * switching so that the page size is 5 will set the third page as the current page so\n * that the 10th item will still be displayed.\n */\n _changePageSize(pageSize: number) {\n // Current page needs to be updated to reflect the new page size. Navigate to the page\n // containing the previous page's first item.\n const startIndex = this.pageIndex * this.pageSize;\n const previousPageIndex = this.pageIndex;\n\n this.pageIndex = Math.floor(startIndex / pageSize) || 0;\n this.pageSize = pageSize;\n this._emitPageEvent(previousPageIndex);\n }\n\n /** Checks whether the buttons for going forwards should be disabled. */\n _nextButtonsDisabled() {\n return this.disabled || !this.hasNextPage();\n }\n\n /** Checks whether the buttons for going backwards should be disabled. */\n _previousButtonsDisabled() {\n return this.disabled || !this.hasPreviousPage();\n }\n\n /**\n * Updates the list of page size options to display to the user. Includes making sure that\n * the page size is an option and that the list is sorted.\n */\n private _updateDisplayedPageSizeOptions() {\n if (!this._initialized) { return; }\n\n // If no page size is provided, use the first page size option or the default page size.\n if (!this.pageSize) {\n this._pageSize = this.pageSizeOptions.length != 0 ?\n this.pageSizeOptions[0] :\n DEFAULT_PAGE_SIZE;\n }\n\n this._displayedPageSizeOptions = this.pageSizeOptions.slice();\n\n if (this._displayedPageSizeOptions.indexOf(this.pageSize) === -1) {\n this._displayedPageSizeOptions.push(this.pageSize);\n }\n\n // Sort the numbers using a number-specific sort function.\n this._displayedPageSizeOptions.sort((a, b) => a - b);\n this._changeDetectorRef.markForCheck();\n }\n\n /** Emits an event notifying that a change of the paginator's properties has been triggered. */\n private _emitPageEvent(previousPageIndex: number) {\n this.page.emit({\n previousPageIndex,\n pageIndex: this.pageIndex,\n pageSize: this.pageSize,\n length: this.length\n });\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable, Optional, SkipSelf} from '@angular/core';\nimport {Subject} from 'rxjs';\n\n\n/**\n * To modify the labels and text displayed, create a new instance of MatPaginatorIntl and\n * include it in a custom provider\n */\n@Injectable({providedIn: 'root'})\nexport class MatPaginatorIntl {\n /**\n * Stream to emit from when labels are changed. Use this to notify components when the labels have\n * changed after initialization.\n */\n readonly changes: Subject<void> = new Subject<void>();\n\n /** A label for the page size selector. */\n itemsPerPageLabel: string = 'Items per page:';\n\n /** A label for the button that increments the current page. */\n nextPageLabel: string = 'Next page';\n\n /** A label for the button that decrements the current page. */\n previousPageLabel: string = 'Previous page';\n\n /** A label for the button that moves to the first page. */\n firstPageLabel: string = 'First page';\n\n /** A label for the button that moves to the last page. */\n lastPageLabel: string = 'Last page';\n\n /** A label for the range of items within the current page and the length of the whole list. */\n getRangeLabel = (page: number, pageSize: number, length: number) => {\n if (length == 0 || pageSize == 0) { return `0 of ${length}`; }\n\n length = Math.max(length, 0);\n\n const startIndex = page * pageSize;\n\n // If the start index exceeds the list length, do not try and fix the end index to the end.\n const endIndex = startIndex < length ?\n Math.min(startIndex + pageSize, length) :\n startIndex + pageSize;\n\n return `${startIndex + 1} – ${endIndex} of ${length}`;\n }\n}\n\n/** @docs-private */\nexport function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl: MatPaginatorIntl) {\n return parentIntl || new MatPaginatorIntl();\n}\n\n/** @docs-private */\nexport const MAT_PAGINATOR_INTL_PROVIDER = {\n // If there is already an MatPaginatorIntl available, use that. Otherwise, provide a new one.\n provide: MatPaginatorIntl,\n deps: [[new Optional(), new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A,EAAA,eAAA;qBACA;oBACA,eAAA,EAAA,uBAAA,CAAA,MAAA;oBACA,aAAA,EAAA,iBAAA,CAAA,IAAA;iBACA,EAAA,EAAA;KACA,CAAA;;;;;KAzDA,CAAA,EAAA,CAAA;IAVA,YAAE,CAAF,cAAA,GAAA;;;QA2EA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA;QAGA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA;QASA,eAAA,EAAG,CAAH,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA;QASA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA;QASA,oBAAA,EAAA,CAAA,EAAA,IAAA,EAAQ,KAAR,EAAA,CAAA;QASA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAG,CAAH;KASA,CAAA;IAQA,OAAA,YAAG,CAAH;;;;;;;AD7HA,IAAA,kBAAA,kBAAA,YAAA;IAAA,SAAA,kBAAA,GAAA;KAWkC;;QAXlC,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,OAAO,EAAE;wBACP,YAAY;wBACZ,eAAe;wBACf,eAAe;wBACf,gBAAgB;qBACjB;oBACD,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,CAAC,YAAY,CAAC;oBAC5B,SAAS,EAAE,CAAC,2BAA2B,CAAC;iBACzC,EAAD,EAAA;;IACiC,OAAjC,kBAAkC,CAAlC;CAAkC,EAAlC,CAAA;;;;;;;;;;;;;;"}
@@ -90,7 +90,6 @@ var MatProgressSpinner = /** @class */ (function (_super) {
90
90
  if (!trackedDiameters.has(_document.head)) {
91
91
  trackedDiameters.set(_document.head, new Set([BASE_SIZE]));
92
92
  }
93
- _this._styleRoot = _getShadowRoot(_elementRef.nativeElement, _document) || _document.head;
94
93
  _this._fallbackAnimation = platform.EDGE || platform.TRIDENT;
95
94
  _this._noopAnimations = animationMode === 'NoopAnimations' &&
96
95
  (!!defaults && !defaults._forceAnimations);
@@ -102,11 +101,6 @@ var MatProgressSpinner = /** @class */ (function (_super) {
102
101
  _this.strokeWidth = defaults.strokeWidth;
103
102
  }
104
103
  }
105
- // On IE and Edge, we can't animate the `stroke-dashoffset`
106
- // reliably so we fall back to a non-spec animation.
107
- /** @type {?} */
108
- var animationClass = "mat-progress-spinner-indeterminate" + (_this._fallbackAnimation ? '-fallback' : '') + "-animation";
109
- _elementRef.nativeElement.classList.add(animationClass);
110
104
  return _this;
111
105
  }
112
106
  Object.defineProperty(MatProgressSpinner.prototype, "diameter", {
@@ -122,14 +116,9 @@ var MatProgressSpinner = /** @class */ (function (_super) {
122
116
  */
123
117
  function (size) {
124
118
  this._diameter = coerceNumberProperty(size);
125
- if (!this._fallbackAnimation) {
126
- /** @type {?} */
127
- var trackedDiameters = MatProgressSpinner._diameters;
128
- /** @type {?} */
129
- var diametersForElement = trackedDiameters.get(this._styleRoot);
130
- if (!diametersForElement || !diametersForElement.has(this._diameter)) {
131
- this._attachStyleNode();
132
- }
119
+ // If this is set before `ngOnInit`, the style root may not have been resolved yet.
120
+ if (!this._fallbackAnimation && this._styleRoot) {
121
+ this._attachStyleNode();
133
122
  }
134
123
  },
135
124
  enumerable: true,
@@ -173,6 +162,26 @@ var MatProgressSpinner = /** @class */ (function (_super) {
173
162
  enumerable: true,
174
163
  configurable: true
175
164
  });
165
+ /**
166
+ * @return {?}
167
+ */
168
+ MatProgressSpinner.prototype.ngOnInit = /**
169
+ * @return {?}
170
+ */
171
+ function () {
172
+ /** @type {?} */
173
+ var element = this._elementRef.nativeElement;
174
+ // Note that we need to look up the root node in ngOnInit, rather than the constructor, because
175
+ // Angular seems to create the element outside the shadow root and then moves it inside, if the
176
+ // node is inside an `ngIf` and a ShadowDom-encapsulated component.
177
+ this._styleRoot = _getShadowRoot(element, this._document) || this._document.head;
178
+ this._attachStyleNode();
179
+ // On IE and Edge, we can't animate the `stroke-dashoffset`
180
+ // reliably so we fall back to a non-spec animation.
181
+ /** @type {?} */
182
+ var animationClass = "mat-progress-spinner-indeterminate" + (this._fallbackAnimation ? '-fallback' : '') + "-animation";
183
+ element.classList.add(animationClass);
184
+ };
176
185
  Object.defineProperty(MatProgressSpinner.prototype, "_circleRadius", {
177
186
  /** The radius of the spinner, adjusted for stroke width. */
178
187
  get: /**
@@ -254,8 +263,6 @@ var MatProgressSpinner = /** @class */ (function (_super) {
254
263
  * @return {?}
255
264
  */
256
265
  function () {
257
- /** @type {?} */
258
- var styleTag = this._document.createElement('style');
259
266
  /** @type {?} */
260
267
  var styleRoot = this._styleRoot;
261
268
  /** @type {?} */
@@ -264,14 +271,18 @@ var MatProgressSpinner = /** @class */ (function (_super) {
264
271
  var diameters = MatProgressSpinner._diameters;
265
272
  /** @type {?} */
266
273
  var diametersForElement = diameters.get(styleRoot);
267
- styleTag.setAttribute('mat-spinner-animation', currentDiameter + '');
268
- styleTag.textContent = this._getAnimationText();
269
- styleRoot.appendChild(styleTag);
270
- if (!diametersForElement) {
271
- diametersForElement = new Set();
272
- diameters.set(styleRoot, diametersForElement);
274
+ if (!diametersForElement || !diametersForElement.has(currentDiameter)) {
275
+ /** @type {?} */
276
+ var styleTag = this._document.createElement('style');
277
+ styleTag.setAttribute('mat-spinner-animation', currentDiameter + '');
278
+ styleTag.textContent = this._getAnimationText();
279
+ styleRoot.appendChild(styleTag);
280
+ if (!diametersForElement) {
281
+ diametersForElement = new Set();
282
+ diameters.set(styleRoot, diametersForElement);
283
+ }
284
+ diametersForElement.add(currentDiameter);
273
285
  }
274
- diametersForElement.add(currentDiameter);
275
286
  };
276
287
  /** Generates animation styles adjusted for the spinner's diameter. */
277
288
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"progress-spinner.es5.js","sources":["../../../src/material/progress-spinner/progress-spinner-module.ts","../../../src/material/progress-spinner/progress-spinner.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatProgressSpinner, MatSpinner} from './progress-spinner';\n\n\n@NgModule({\n imports: [MatCommonModule, CommonModule],\n exports: [\n MatProgressSpinner,\n MatSpinner,\n MatCommonModule\n ],\n declarations: [\n MatProgressSpinner,\n MatSpinner\n ],\n})\nclass MatProgressSpinnerModule {}\n\nexport {MatProgressSpinnerModule};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceNumberProperty} from '@angular/cdk/coercion';\nimport {Platform} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n InjectionToken,\n Input,\n Optional,\n ViewEncapsulation,\n} from '@angular/core';\nimport {CanColor, CanColorCtor, mixinColor} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n\n/** Possible mode for a progress spinner. */\nexport type ProgressSpinnerMode = 'determinate' | 'indeterminate';\n\n/**\n * Base reference size of the spinner.\n * @docs-private\n */\nconst BASE_SIZE = 100;\n\n/**\n * Base reference stroke width of the spinner.\n * @docs-private\n */\nconst BASE_STROKE_WIDTH = 10;\n\n// Boilerplate for applying mixins to MatProgressSpinner.\n/** @docs-private */\nclass MatProgressSpinnerBase {\n constructor(public _elementRef: ElementRef) {}\n}\nconst _MatProgressSpinnerMixinBase: CanColorCtor & typeof MatProgressSpinnerBase =\n mixinColor(MatProgressSpinnerBase, 'primary');\n\n/** Default `mat-progress-spinner` options that can be overridden. */\nexport interface MatProgressSpinnerDefaultOptions {\n /** Diameter of the spinner. */\n diameter?: number;\n /** Width of the spinner's stroke. */\n strokeWidth?: number;\n /**\n * Whether the animations should be force to be enabled, ignoring if the current environment is\n * using NoopAnimationsModule.\n */\n _forceAnimations?: boolean;\n}\n\n/** Injection token to be used to override the default options for `mat-progress-spinner`. */\nexport const MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS =\n new InjectionToken<MatProgressSpinnerDefaultOptions>('mat-progress-spinner-default-options', {\n providedIn: 'root',\n factory: MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY,\n });\n\n/** @docs-private */\nexport function MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY(): MatProgressSpinnerDefaultOptions {\n return {diameter: BASE_SIZE};\n}\n\n// .0001 percentage difference is necessary in order to avoid unwanted animation frames\n// for example because the animation duration is 4 seconds, .1% accounts to 4ms\n// which are enough to see the flicker described in\n// https://github.com/angular/components/issues/8984\nconst INDETERMINATE_ANIMATION_TEMPLATE = `\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n`;\n\n/**\n * `<mat-progress-spinner>` component.\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-progress-spinner',\n exportAs: 'matProgressSpinner',\n host: {\n 'role': 'progressbar',\n 'class': 'mat-progress-spinner',\n '[class._mat-animation-noopable]': `_noopAnimations`,\n '[style.width.px]': 'diameter',\n '[style.height.px]': 'diameter',\n '[attr.aria-valuemin]': 'mode === \"determinate\" ? 0 : null',\n '[attr.aria-valuemax]': 'mode === \"determinate\" ? 100 : null',\n '[attr.aria-valuenow]': 'mode === \"determinate\" ? value : null',\n '[attr.mode]': 'mode',\n },\n inputs: ['color'],\n templateUrl: 'progress-spinner.html',\n styleUrls: ['progress-spinner.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements CanColor {\n private _diameter = BASE_SIZE;\n private _value = 0;\n private _strokeWidth: number;\n private _fallbackAnimation = false;\n\n /**\n * Element to which we should add the generated style tags for the indeterminate animation.\n * For most elements this is the document, but for the ones in the Shadow DOM we need to\n * use the shadow root.\n */\n private _styleRoot: Node;\n\n /**\n * Tracks diameters of existing instances to de-dupe generated styles (default d = 100).\n * We need to keep track of which elements the diameters were attached to, because for\n * elements in the Shadow DOM the style tags are attached to the shadow root, rather\n * than the document head.\n */\n private static _diameters = new WeakMap<Node, Set<number>>();\n\n /** Whether the _mat-animation-noopable class should be applied, disabling animations. */\n _noopAnimations: boolean;\n\n /** The diameter of the progress spinner (will set width and height of svg). */\n @Input()\n get diameter(): number { return this._diameter; }\n set diameter(size: number) {\n this._diameter = coerceNumberProperty(size);\n\n if (!this._fallbackAnimation) {\n const trackedDiameters = MatProgressSpinner._diameters;\n const diametersForElement = trackedDiameters.get(this._styleRoot);\n\n if (!diametersForElement || !diametersForElement.has(this._diameter)) {\n this._attachStyleNode();\n }\n }\n }\n\n /** Stroke width of the progress spinner. */\n @Input()\n get strokeWidth(): number {\n return this._strokeWidth || this.diameter / 10;\n }\n set strokeWidth(value: number) {\n this._strokeWidth = coerceNumberProperty(value);\n }\n\n /** Mode of the progress circle */\n @Input() mode: ProgressSpinnerMode = 'determinate';\n\n /** Value of the progress circle. */\n @Input()\n get value(): number {\n return this.mode === 'determinate' ? this._value : 0;\n }\n set value(newValue: number) {\n this._value = Math.max(0, Math.min(100, coerceNumberProperty(newValue)));\n }\n\n constructor(public _elementRef: ElementRef<HTMLElement>,\n platform: Platform,\n @Optional() @Inject(DOCUMENT) private _document: any,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode: string,\n @Inject(MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS)\n defaults?: MatProgressSpinnerDefaultOptions) {\n\n super(_elementRef);\n\n const trackedDiameters = MatProgressSpinner._diameters;\n\n // The base size is already inserted via the component's structural styles. We still\n // need to track it so we don't end up adding the same styles again.\n if (!trackedDiameters.has(_document.head)) {\n trackedDiameters.set(_document.head, new Set<number>([BASE_SIZE]));\n }\n\n this._styleRoot = _getShadowRoot(_elementRef.nativeElement, _document) || _document.head;\n this._fallbackAnimation = platform.EDGE || platform.TRIDENT;\n this._noopAnimations = animationMode === 'NoopAnimations' &&\n (!!defaults && !defaults._forceAnimations);\n\n if (defaults) {\n if (defaults.diameter) {\n this.diameter = defaults.diameter;\n }\n\n if (defaults.strokeWidth) {\n this.strokeWidth = defaults.strokeWidth;\n }\n }\n\n // On IE and Edge, we can't animate the `stroke-dashoffset`\n // reliably so we fall back to a non-spec animation.\n const animationClass =\n `mat-progress-spinner-indeterminate${this._fallbackAnimation ? '-fallback' : ''}-animation`;\n\n _elementRef.nativeElement.classList.add(animationClass);\n }\n\n /** The radius of the spinner, adjusted for stroke width. */\n get _circleRadius() {\n return (this.diameter - BASE_STROKE_WIDTH) / 2;\n }\n\n /** The view box of the spinner's svg element. */\n get _viewBox() {\n const viewBox = this._circleRadius * 2 + this.strokeWidth;\n return `0 0 ${viewBox} ${viewBox}`;\n }\n\n /** The stroke circumference of the svg circle. */\n get _strokeCircumference(): number {\n return 2 * Math.PI * this._circleRadius;\n }\n\n /** The dash offset of the svg circle. */\n get _strokeDashOffset() {\n if (this.mode === 'determinate') {\n return this._strokeCircumference * (100 - this._value) / 100;\n }\n\n // In fallback mode set the circle to 80% and rotate it with CSS.\n if (this._fallbackAnimation && this.mode === 'indeterminate') {\n return this._strokeCircumference * 0.2;\n }\n\n return null;\n }\n\n /** Stroke width of the circle in percent. */\n get _circleStrokeWidth() {\n return this.strokeWidth / this.diameter * 100;\n }\n\n /** Dynamically generates a style tag containing the correct animation for this diameter. */\n private _attachStyleNode(): void {\n const styleTag: HTMLStyleElement = this._document.createElement('style');\n const styleRoot = this._styleRoot;\n const currentDiameter = this._diameter;\n const diameters = MatProgressSpinner._diameters;\n let diametersForElement = diameters.get(styleRoot);\n\n styleTag.setAttribute('mat-spinner-animation', currentDiameter + '');\n styleTag.textContent = this._getAnimationText();\n styleRoot.appendChild(styleTag);\n\n if (!diametersForElement) {\n diametersForElement = new Set<number>();\n diameters.set(styleRoot, diametersForElement);\n }\n\n diametersForElement.add(currentDiameter);\n }\n\n /** Generates animation styles adjusted for the spinner's diameter. */\n private _getAnimationText(): string {\n return INDETERMINATE_ANIMATION_TEMPLATE\n // Animation should begin at 5% and end at 80%\n .replace(/START_VALUE/g, `${0.95 * this._strokeCircumference}`)\n .replace(/END_VALUE/g, `${0.2 * this._strokeCircumference}`)\n .replace(/DIAMETER/g, `${this.diameter}`);\n }\n}\n\n\n/**\n * `<mat-spinner>` component.\n *\n * This is a component definition to be used as a convenience reference to create an\n * indeterminate `<mat-progress-spinner>` instance.\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-spinner',\n host: {\n 'role': 'progressbar',\n 'mode': 'indeterminate',\n 'class': 'mat-spinner mat-progress-spinner',\n '[class._mat-animation-noopable]': `_noopAnimations`,\n '[style.width.px]': 'diameter',\n '[style.height.px]': 'diameter',\n },\n inputs: ['color'],\n templateUrl: 'progress-spinner.html',\n styleUrls: ['progress-spinner.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatSpinner extends MatProgressSpinner {\n constructor(elementRef: ElementRef<HTMLElement>, platform: Platform,\n @Optional() @Inject(DOCUMENT) document: any,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode: string,\n @Inject(MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS)\n defaults?: MatProgressSpinnerDefaultOptions) {\n super(elementRef, platform, document, animationMode, defaults);\n this.mode = 'indeterminate';\n }\n}\n\n\n/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */\nexport function _getShadowRoot(element: HTMLElement, _document: Document): Node | null {\n // TODO(crisbeto): see whether we should move this into the CDK\n // feature detection utilities once #15616 gets merged in.\n if (typeof window !== 'undefined') {\n const head = _document.head;\n\n // Check whether the browser supports Shadow DOM.\n if (head && ((head as any).createShadowRoot || head.attachShadow)) {\n const rootNode = element.getRootNode ? element.getRootNode() : null;\n\n // We need to take the `ShadowRoot` off of `window`, because the built-in types are\n // incorrect. See https://github.com/Microsoft/TypeScript/issues/27929.\n if (rootNode instanceof (window as any).ShadowRoot) {\n return rootNode;\n }\n }\n }\n\n return null;\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;ACgCA,IAAM,SAAS,GAAG,GAAG,CAArB;;;;;;AAMA,IAAM,iBAAiB,GAAG,EAAE,CAA5B;;;;;AAIA;;;;;;IACE,SAAF,sBAAA,CAAqB,WAAuB,EAA5C;QAAqB,IAArB,CAAA,WAAgC,GAAX,WAAW,CAAY;KAAI;IAChD,OAAA,sBAAC,CAAD;CAAC,EAAD,CAAA,CAAC;;AACD,IAAM,4BAA4B,GAC9B,UAAU,CAAC,sBAAsB,E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/material/progress-spinner/progress-spinner-module.ts","../../../src/material/progress-spinner/progress-spinner.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatProgressSpinner, MatSpinner} from './progress-spinner';\n\n\n@NgModule({\n imports: [MatCommonModule, CommonModule],\n exports: [\n MatProgressSpinner,\n MatSpinner,\n MatCommonModule\n ],\n declarations: [\n MatProgressSpinner,\n MatSpinner\n ],\n})\nclass MatProgressSpinnerModule {}\n\nexport {MatProgressSpinnerModule};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceNumberProperty} from '@angular/cdk/coercion';\nimport {Platform} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n InjectionToken,\n Input,\n Optional,\n ViewEncapsulation,\n OnInit,\n} from '@angular/core';\nimport {CanColor, CanColorCtor, mixinColor} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n\n/** Possible mode for a progress spinner. */\nexport type ProgressSpinnerMode = 'determinate' | 'indeterminate';\n\n/**\n * Base reference size of the spinner.\n * @docs-private\n */\nconst BASE_SIZE = 100;\n\n/**\n * Base reference stroke width of the spinner.\n * @docs-private\n */\nconst BASE_STROKE_WIDTH = 10;\n\n// Boilerplate for applying mixins to MatProgressSpinner.\n/** @docs-private */\nclass MatProgressSpinnerBase {\n constructor(public _elementRef: ElementRef) {}\n}\nconst _MatProgressSpinnerMixinBase: CanColorCtor & typeof MatProgressSpinnerBase =\n mixinColor(MatProgressSpinnerBase, 'primary');\n\n/** Default `mat-progress-spinner` options that can be overridden. */\nexport interface MatProgressSpinnerDefaultOptions {\n /** Diameter of the spinner. */\n diameter?: number;\n /** Width of the spinner's stroke. */\n strokeWidth?: number;\n /**\n * Whether the animations should be force to be enabled, ignoring if the current environment is\n * using NoopAnimationsModule.\n */\n _forceAnimations?: boolean;\n}\n\n/** Injection token to be used to override the default options for `mat-progress-spinner`. */\nexport const MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS =\n new InjectionToken<MatProgressSpinnerDefaultOptions>('mat-progress-spinner-default-options', {\n providedIn: 'root',\n factory: MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY,\n });\n\n/** @docs-private */\nexport function MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY(): MatProgressSpinnerDefaultOptions {\n return {diameter: BASE_SIZE};\n}\n\n// .0001 percentage difference is necessary in order to avoid unwanted animation frames\n// for example because the animation duration is 4 seconds, .1% accounts to 4ms\n// which are enough to see the flicker described in\n// https://github.com/angular/components/issues/8984\nconst INDETERMINATE_ANIMATION_TEMPLATE = `\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n`;\n\n/**\n * `<mat-progress-spinner>` component.\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-progress-spinner',\n exportAs: 'matProgressSpinner',\n host: {\n 'role': 'progressbar',\n 'class': 'mat-progress-spinner',\n '[class._mat-animation-noopable]': `_noopAnimations`,\n '[style.width.px]': 'diameter',\n '[style.height.px]': 'diameter',\n '[attr.aria-valuemin]': 'mode === \"determinate\" ? 0 : null',\n '[attr.aria-valuemax]': 'mode === \"determinate\" ? 100 : null',\n '[attr.aria-valuenow]': 'mode === \"determinate\" ? value : null',\n '[attr.mode]': 'mode',\n },\n inputs: ['color'],\n templateUrl: 'progress-spinner.html',\n styleUrls: ['progress-spinner.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements OnInit, CanColor {\n private _diameter = BASE_SIZE;\n private _value = 0;\n private _strokeWidth: number;\n private _fallbackAnimation = false;\n\n /**\n * Element to which we should add the generated style tags for the indeterminate animation.\n * For most elements this is the document, but for the ones in the Shadow DOM we need to\n * use the shadow root.\n */\n private _styleRoot: Node;\n\n /**\n * Tracks diameters of existing instances to de-dupe generated styles (default d = 100).\n * We need to keep track of which elements the diameters were attached to, because for\n * elements in the Shadow DOM the style tags are attached to the shadow root, rather\n * than the document head.\n */\n private static _diameters = new WeakMap<Node, Set<number>>();\n\n /** Whether the _mat-animation-noopable class should be applied, disabling animations. */\n _noopAnimations: boolean;\n\n /** The diameter of the progress spinner (will set width and height of svg). */\n @Input()\n get diameter(): number { return this._diameter; }\n set diameter(size: number) {\n this._diameter = coerceNumberProperty(size);\n\n // If this is set before `ngOnInit`, the style root may not have been resolved yet.\n if (!this._fallbackAnimation && this._styleRoot) {\n this._attachStyleNode();\n }\n }\n\n /** Stroke width of the progress spinner. */\n @Input()\n get strokeWidth(): number {\n return this._strokeWidth || this.diameter / 10;\n }\n set strokeWidth(value: number) {\n this._strokeWidth = coerceNumberProperty(value);\n }\n\n /** Mode of the progress circle */\n @Input() mode: ProgressSpinnerMode = 'determinate';\n\n /** Value of the progress circle. */\n @Input()\n get value(): number {\n return this.mode === 'determinate' ? this._value : 0;\n }\n set value(newValue: number) {\n this._value = Math.max(0, Math.min(100, coerceNumberProperty(newValue)));\n }\n\n constructor(public _elementRef: ElementRef<HTMLElement>,\n platform: Platform,\n @Optional() @Inject(DOCUMENT) private _document: any,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode: string,\n @Inject(MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS)\n defaults?: MatProgressSpinnerDefaultOptions) {\n\n super(_elementRef);\n\n const trackedDiameters = MatProgressSpinner._diameters;\n\n // The base size is already inserted via the component's structural styles. We still\n // need to track it so we don't end up adding the same styles again.\n if (!trackedDiameters.has(_document.head)) {\n trackedDiameters.set(_document.head, new Set<number>([BASE_SIZE]));\n }\n\n this._fallbackAnimation = platform.EDGE || platform.TRIDENT;\n this._noopAnimations = animationMode === 'NoopAnimations' &&\n (!!defaults && !defaults._forceAnimations);\n\n if (defaults) {\n if (defaults.diameter) {\n this.diameter = defaults.diameter;\n }\n\n if (defaults.strokeWidth) {\n this.strokeWidth = defaults.strokeWidth;\n }\n }\n }\n\n ngOnInit() {\n const element = this._elementRef.nativeElement;\n\n // Note that we need to look up the root node in ngOnInit, rather than the constructor, because\n // Angular seems to create the element outside the shadow root and then moves it inside, if the\n // node is inside an `ngIf` and a ShadowDom-encapsulated component.\n this._styleRoot = _getShadowRoot(element, this._document) || this._document.head;\n this._attachStyleNode();\n\n // On IE and Edge, we can't animate the `stroke-dashoffset`\n // reliably so we fall back to a non-spec animation.\n const animationClass =\n `mat-progress-spinner-indeterminate${this._fallbackAnimation ? '-fallback' : ''}-animation`;\n\n element.classList.add(animationClass);\n }\n\n /** The radius of the spinner, adjusted for stroke width. */\n get _circleRadius() {\n return (this.diameter - BASE_STROKE_WIDTH) / 2;\n }\n\n /** The view box of the spinner's svg element. */\n get _viewBox() {\n const viewBox = this._circleRadius * 2 + this.strokeWidth;\n return `0 0 ${viewBox} ${viewBox}`;\n }\n\n /** The stroke circumference of the svg circle. */\n get _strokeCircumference(): number {\n return 2 * Math.PI * this._circleRadius;\n }\n\n /** The dash offset of the svg circle. */\n get _strokeDashOffset() {\n if (this.mode === 'determinate') {\n return this._strokeCircumference * (100 - this._value) / 100;\n }\n\n // In fallback mode set the circle to 80% and rotate it with CSS.\n if (this._fallbackAnimation && this.mode === 'indeterminate') {\n return this._strokeCircumference * 0.2;\n }\n\n return null;\n }\n\n /** Stroke width of the circle in percent. */\n get _circleStrokeWidth() {\n return this.strokeWidth / this.diameter * 100;\n }\n\n /** Dynamically generates a style tag containing the correct animation for this diameter. */\n private _attachStyleNode(): void {\n const styleRoot = this._styleRoot;\n const currentDiameter = this._diameter;\n const diameters = MatProgressSpinner._diameters;\n let diametersForElement = diameters.get(styleRoot);\n\n if (!diametersForElement || !diametersForElement.has(currentDiameter)) {\n const styleTag: HTMLStyleElement = this._document.createElement('style');\n styleTag.setAttribute('mat-spinner-animation', currentDiameter + '');\n styleTag.textContent = this._getAnimationText();\n styleRoot.appendChild(styleTag);\n\n if (!diametersForElement) {\n diametersForElement = new Set<number>();\n diameters.set(styleRoot, diametersForElement);\n }\n\n diametersForElement.add(currentDiameter);\n }\n }\n\n /** Generates animation styles adjusted for the spinner's diameter. */\n private _getAnimationText(): string {\n return INDETERMINATE_ANIMATION_TEMPLATE\n // Animation should begin at 5% and end at 80%\n .replace(/START_VALUE/g, `${0.95 * this._strokeCircumference}`)\n .replace(/END_VALUE/g, `${0.2 * this._strokeCircumference}`)\n .replace(/DIAMETER/g, `${this.diameter}`);\n }\n}\n\n\n/**\n * `<mat-spinner>` component.\n *\n * This is a component definition to be used as a convenience reference to create an\n * indeterminate `<mat-progress-spinner>` instance.\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-spinner',\n host: {\n 'role': 'progressbar',\n 'mode': 'indeterminate',\n 'class': 'mat-spinner mat-progress-spinner',\n '[class._mat-animation-noopable]': `_noopAnimations`,\n '[style.width.px]': 'diameter',\n '[style.height.px]': 'diameter',\n },\n inputs: ['color'],\n templateUrl: 'progress-spinner.html',\n styleUrls: ['progress-spinner.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatSpinner extends MatProgressSpinner {\n constructor(elementRef: ElementRef<HTMLElement>, platform: Platform,\n @Optional() @Inject(DOCUMENT) document: any,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode: string,\n @Inject(MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS)\n defaults?: MatProgressSpinnerDefaultOptions) {\n super(elementRef, platform, document, animationMode, defaults);\n this.mode = 'indeterminate';\n }\n}\n\n\n/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */\nexport function _getShadowRoot(element: HTMLElement, _document: Document): Node | null {\n // TODO(crisbeto): see whether we should move this into the CDK\n // feature detection utilities once #15616 gets merged in.\n if (typeof window !== 'undefined') {\n const head = _document.head;\n\n // Check whether the browser supports Shadow DOM.\n if (head && ((head as any).createShadowRoot || head.attachShadow)) {\n const rootNode = element.getRootNode ? element.getRootNode() : null;\n\n // We need to take the `ShadowRoot` off of `window`, because the built-in types are\n // incorrect. See https://github.com/Microsoft/TypeScript/issues/27929.\n if (rootNode instanceof (window as any).ShadowRoot) {\n return rootNode;\n }\n }\n }\n\n return null;\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;ACiCA,IAAM,SAAS,GAAG,GAAG,CAAr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oBACR,OAAO,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC;oBACxC,OAAO,EAAE;wBACP,kBAAkB;wBAClB,UAAU;wBACV,eAAe;qBAChB;oBACD,YAAY,EAAE;wBACZ,kBAAkB;wBAClB,UAAU;qBACX;iBACF,EAAD,EAAA;;IACgC,OAAhC,wBAAiC,CAAjC;CAAiC,EAAjC,CAAA;;;;;;;;;;;;;;"}
package/esm5/radio.es5.js CHANGED
@@ -879,6 +879,9 @@ var MatRadioButton = /** @class */ (function (_super) {
879
879
  // Needs to be -1 so the `focus` event still fires.
880
880
  '[attr.tabindex]': '-1',
881
881
  '[attr.id]': 'id',
882
+ '[attr.aria-label]': 'null',
883
+ '[attr.aria-labelledby]': 'null',
884
+ '[attr.aria-describedby]': 'null',
882
885
  // Note: under normal conditions focus shouldn't land on this element, however it may be
883
886
  // programmatically set, for example inside of a focus trap, in this case we want to forward
884
887
  // the focus to the native element.
@@ -1 +1 @@
1
- {"version":3,"file":"radio.es5.js","sources":["../../../src/material/radio/radio-module.ts","../../../src/material/radio/radio.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatRadioButton, MatRadioGroup} from './radio';\n\n\n@NgModule({\n imports: [CommonModule, MatRippleModule, MatCommonModule],\n exports: [MatRadioGroup, MatRadioButton, MatCommonModule],\n declarations: [MatRadioGroup, MatRadioButton],\n})\nexport class MatRadioModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusMonitor} from '@angular/cdk/a11y';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n EventEmitter,\n forwardRef,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {\n CanDisableRipple,\n CanDisableRippleCtor,\n HasTabIndex,\n HasTabIndexCtor,\n mixinDisableRipple,\n mixinTabIndex,\n ThemePalette,\n} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n\nexport interface MatRadioDefaultOptions {\n color: ThemePalette;\n}\n\nexport const MAT_RADIO_DEFAULT_OPTIONS =\n new InjectionToken<MatRadioDefaultOptions>('mat-radio-default-options', {\n providedIn: 'root',\n factory: MAT_RADIO_DEFAULT_OPTIONS_FACTORY\n});\n\nexport function MAT_RADIO_DEFAULT_OPTIONS_FACTORY(): MatRadioDefaultOptions {\n return {\n color: 'accent'\n };\n}\n\n// Increasing integer for generating unique ids for radio components.\nlet nextUniqueId = 0;\n\n/**\n * Provider Expression that allows mat-radio-group to register as a ControlValueAccessor. This\n * allows it to support [(ngModel)] and ngControl.\n * @docs-private\n */\nexport const MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatRadioGroup),\n multi: true\n};\n\n/** Change event object emitted by MatRadio and MatRadioGroup. */\nexport class MatRadioChange {\n constructor(\n /** The MatRadioButton that emits the change event. */\n public source: MatRadioButton,\n /** The value of the MatRadioButton. */\n public value: any) {}\n}\n\n/**\n * A group of radio buttons. May contain one or more `<mat-radio-button>` elements.\n */\n@Directive({\n selector: 'mat-radio-group',\n exportAs: 'matRadioGroup',\n providers: [MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR],\n host: {\n 'role': 'radiogroup',\n 'class': 'mat-radio-group',\n },\n})\nexport class MatRadioGroup implements AfterContentInit, ControlValueAccessor {\n /** Selected value for the radio group. */\n private _value: any = null;\n\n /** The HTML name attribute applied to radio buttons in this group. */\n private _name: string = `mat-radio-group-${nextUniqueId++}`;\n\n /** The currently selected radio button. Should match value. */\n private _selected: MatRadioButton | null = null;\n\n /** Whether the `value` has been set to its initial value. */\n private _isInitialized: boolean = false;\n\n /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */\n private _labelPosition: 'before' | 'after' = 'after';\n\n /** Whether the radio group is disabled. */\n private _disabled: boolean = false;\n\n /** Whether the radio group is required. */\n private _required: boolean = false;\n\n /** The method to be called in order to update ngModel */\n _controlValueAccessorChangeFn: (value: any) => void = () => {};\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n * @docs-private\n */\n onTouched: () => any = () => {};\n\n /**\n * Event emitted when the group value changes.\n * Change events are only emitted when the value changes due to user interaction with\n * a radio button (the same behavior as `<input type-\"radio\">`).\n */\n @Output() readonly change: EventEmitter<MatRadioChange> = new EventEmitter<MatRadioChange>();\n\n /** Child radio buttons. */\n @ContentChildren(forwardRef(() => MatRadioButton), { descendants: true })\n _radios: QueryList<MatRadioButton>;\n\n /** Theme color for all of the radio buttons in the group. */\n @Input() color: ThemePalette;\n\n /** Name of the radio button group. All radio buttons inside this group will use this name. */\n @Input()\n get name(): string { return this._name; }\n set name(value: string) {\n this._name = value;\n this._updateRadioButtonNames();\n }\n\n /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */\n @Input()\n get labelPosition(): 'before' | 'after' {\n return this._labelPosition;\n }\n set labelPosition(v) {\n this._labelPosition = v === 'before' ? 'before' : 'after';\n this._markRadiosForCheck();\n }\n\n /**\n * Value for the radio-group. Should equal the value of the selected radio button if there is\n * a corresponding radio button with a matching value. If there is not such a corresponding\n * radio button, this value persists to be applied in case a new radio button is added with a\n * matching value.\n */\n @Input()\n get value(): any { return this._value; }\n set value(newValue: any) {\n if (this._value !== newValue) {\n // Set this before proceeding to ensure no circular loop occurs with selection.\n this._value = newValue;\n\n this._updateSelectedRadioFromValue();\n this._checkSelectedRadioButton();\n }\n }\n\n _checkSelectedRadioButton() {\n if (this._selected && !this._selected.checked) {\n this._selected.checked = true;\n }\n }\n\n /**\n * The currently selected radio button. If set to a new radio button, the radio group value\n * will be updated to match the new selected button.\n */\n @Input()\n get selected() { return this._selected; }\n set selected(selected: MatRadioButton | null) {\n this._selected = selected;\n this.value = selected ? selected.value : null;\n this._checkSelectedRadioButton();\n }\n\n /** Whether the radio group is disabled */\n @Input()\n get disabled(): boolean { return this._disabled; }\n set disabled(value) {\n this._disabled = coerceBooleanProperty(value);\n this._markRadiosForCheck();\n }\n\n /** Whether the radio group is required */\n @Input()\n get required(): boolean { return this._required; }\n set required(value: boolean) {\n this._required = coerceBooleanProperty(value);\n this._markRadiosForCheck();\n }\n\n constructor(private _changeDetector: ChangeDetectorRef) { }\n\n /**\n * Initialize properties once content children are available.\n * This allows us to propagate relevant attributes to associated buttons.\n */\n ngAfterContentInit() {\n // Mark this component as initialized in AfterContentInit because the initial value can\n // possibly be set by NgModel on MatRadioGroup, and it is possible that the OnInit of the\n // NgModel occurs *after* the OnInit of the MatRadioGroup.\n this._isInitialized = true;\n }\n\n /**\n * Mark this group as being \"touched\" (for ngModel). Meant to be called by the contained\n * radio buttons upon their blur.\n */\n _touch() {\n if (this.onTouched) {\n this.onTouched();\n }\n }\n\n private _updateRadioButtonNames(): void {\n if (this._radios) {\n this._radios.forEach(radio => {\n radio.name = this.name;\n radio._markForCheck();\n });\n }\n }\n\n /** Updates the `selected` radio button from the internal _value state. */\n private _updateSelectedRadioFromValue(): void {\n // If the value already matches the selected radio, do nothing.\n const isAlreadySelected = this._selected !== null && this._selected.value === this._value;\n\n if (this._radios && !isAlreadySelected) {\n this._selected = null;\n this._radios.forEach(radio => {\n radio.checked = this.value === radio.value;\n if (radio.checked) {\n this._selected = radio;\n }\n });\n }\n }\n\n /** Dispatch change event with current selection and group value. */\n _emitChangeEvent(): void {\n if (this._isInitialized) {\n this.change.emit(new MatRadioChange(this._selected!, this._value));\n }\n }\n\n _markRadiosForCheck() {\n if (this._radios) {\n this._radios.forEach(radio => radio._markForCheck());\n }\n }\n\n /**\n * Sets the model value. Implemented as part of ControlValueAccessor.\n * @param value\n */\n writeValue(value: any) {\n this.value = value;\n this._changeDetector.markForCheck();\n }\n\n /**\n * Registers a callback to be triggered when the model value changes.\n * Implemented as part of ControlValueAccessor.\n * @param fn Callback to be registered.\n */\n registerOnChange(fn: (value: any) => void) {\n this._controlValueAccessorChangeFn = fn;\n }\n\n /**\n * Registers a callback to be triggered when the control is touched.\n * Implemented as part of ControlValueAccessor.\n * @param fn Callback to be registered.\n */\n registerOnTouched(fn: any) {\n this.onTouched = fn;\n }\n\n /**\n * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.\n * @param isDisabled Whether the control should be disabled.\n */\n setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled;\n this._changeDetector.markForCheck();\n }\n}\n\n// Boilerplate for applying mixins to MatRadioButton.\n/** @docs-private */\nclass MatRadioButtonBase {\n // Since the disabled property is manually defined for the MatRadioButton and isn't set up in\n // the mixin base class. To be able to use the tabindex mixin, a disabled property must be\n // defined to properly work.\n disabled: boolean;\n\n constructor(public _elementRef: ElementRef) {}\n}\n// As per Material design specifications the selection control radio should use the accent color\n// palette by default. https://material.io/guidelines/components/selection-controls.html\nconst _MatRadioButtonMixinBase:\n CanDisableRippleCtor & HasTabIndexCtor & typeof MatRadioButtonBase =\n mixinDisableRipple(mixinTabIndex(MatRadioButtonBase));\n\n/**\n * A Material design radio-button. Typically placed inside of `<mat-radio-group>` elements.\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-radio-button',\n templateUrl: 'radio.html',\n styleUrls: ['radio.css'],\n inputs: ['disableRipple', 'tabIndex'],\n encapsulation: ViewEncapsulation.None,\n exportAs: 'matRadioButton',\n host: {\n 'class': 'mat-radio-button',\n '[class.mat-radio-checked]': 'checked',\n '[class.mat-radio-disabled]': 'disabled',\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n '[class.mat-primary]': 'color === \"primary\"',\n '[class.mat-accent]': 'color === \"accent\"',\n '[class.mat-warn]': 'color === \"warn\"',\n // Needs to be -1 so the `focus` event still fires.\n '[attr.tabindex]': '-1',\n '[attr.id]': 'id',\n // Note: under normal conditions focus shouldn't land on this element, however it may be\n // programmatically set, for example inside of a focus trap, in this case we want to forward\n // the focus to the native element.\n '(focus)': '_inputElement.nativeElement.focus()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatRadioButton extends _MatRadioButtonMixinBase\n implements OnInit, AfterViewInit, OnDestroy, CanDisableRipple, HasTabIndex {\n\n private _uniqueId: string = `mat-radio-${++nextUniqueId}`;\n\n /** The unique ID for the radio button. */\n @Input() id: string = this._uniqueId;\n\n /** Analog to HTML 'name' attribute used to group radios for unique selection. */\n @Input() name: string;\n\n /** Used to set the 'aria-label' attribute on the underlying input element. */\n @Input('aria-label') ariaLabel: string;\n\n /** The 'aria-labelledby' attribute takes precedence as the element's text alternative. */\n @Input('aria-labelledby') ariaLabelledby: string;\n\n /** The 'aria-describedby' attribute is read after the element's label and field type. */\n @Input('aria-describedby') ariaDescribedby: string;\n\n /** Whether this radio button is checked. */\n @Input()\n get checked(): boolean { return this._checked; }\n set checked(value: boolean) {\n const newCheckedState = coerceBooleanProperty(value);\n if (this._checked !== newCheckedState) {\n this._checked = newCheckedState;\n if (newCheckedState && this.radioGroup && this.radioGroup.value !== this.value) {\n this.radioGroup.selected = this;\n } else if (!newCheckedState && this.radioGroup && this.radioGroup.value === this.value) {\n\n // When unchecking the selected radio button, update the selected radio\n // property on the group.\n this.radioGroup.selected = null;\n }\n\n if (newCheckedState) {\n // Notify all radio buttons with the same name to un-check.\n this._radioDispatcher.notify(this.id, this.name);\n }\n this._changeDetector.markForCheck();\n }\n }\n\n /** The value of this radio button. */\n @Input()\n get value(): any { return this._value; }\n set value(value: any) {\n if (this._value !== value) {\n this._value = value;\n if (this.radioGroup !== null) {\n if (!this.checked) {\n // Update checked when the value changed to match the radio group's value\n this.checked = this.radioGroup.value === value;\n }\n if (this.checked) {\n this.radioGroup.selected = this;\n }\n }\n }\n }\n\n /** Whether the label should appear after or before the radio button. Defaults to 'after' */\n @Input()\n get labelPosition(): 'before' | 'after' {\n return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';\n }\n set labelPosition(value) {\n this._labelPosition = value;\n }\n private _labelPosition: 'before' | 'after';\n\n /** Whether the radio button is disabled. */\n @Input()\n get disabled(): boolean {\n return this._disabled || (this.radioGroup !== null && this.radioGroup.disabled);\n }\n set disabled(value: boolean) {\n const newDisabledState = coerceBooleanProperty(value);\n if (this._disabled !== newDisabledState) {\n this._disabled = newDisabledState;\n this._changeDetector.markForCheck();\n }\n }\n\n /** Whether the radio button is required. */\n @Input()\n get required(): boolean {\n return this._required || (this.radioGroup && this.radioGroup.required);\n }\n set required(value: boolean) {\n this._required = coerceBooleanProperty(value);\n }\n\n /** Theme color of the radio button. */\n @Input()\n get color(): ThemePalette {\n return this._color ||\n (this.radioGroup && this.radioGroup.color) ||\n this._providerOverride && this._providerOverride.color || 'accent';\n }\n set color(newValue: ThemePalette) { this._color = newValue; }\n private _color: ThemePalette;\n\n /**\n * Event emitted when the checked state of this radio button changes.\n * Change events are only emitted when the value changes due to user interaction with\n * the radio button (the same behavior as `<input type-\"radio\">`).\n */\n @Output() readonly change: EventEmitter<MatRadioChange> = new EventEmitter<MatRadioChange>();\n\n /** The parent radio group. May or may not be present. */\n radioGroup: MatRadioGroup;\n\n /** ID of the native input element inside `<mat-radio-button>` */\n get inputId(): string { return `${this.id || this._uniqueId}-input`; }\n\n /** Whether this radio is checked. */\n private _checked: boolean = false;\n\n /** Whether this radio is disabled. */\n private _disabled: boolean;\n\n /** Whether this radio is required. */\n private _required: boolean;\n\n /** Value assigned to this radio. */\n private _value: any = null;\n\n /** Unregister function for _radioDispatcher */\n private _removeUniqueSelectionListener: () => void = () => {};\n\n /** The native `<input type=radio>` element */\n @ViewChild('input', {static: false}) _inputElement: ElementRef<HTMLInputElement>;\n\n constructor(@Optional() radioGroup: MatRadioGroup,\n elementRef: ElementRef,\n private _changeDetector: ChangeDetectorRef,\n private _focusMonitor: FocusMonitor,\n private _radioDispatcher: UniqueSelectionDispatcher,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string,\n @Optional() @Inject(MAT_RADIO_DEFAULT_OPTIONS)\n private _providerOverride?: MatRadioDefaultOptions) {\n super(elementRef);\n\n // Assertions. Ideally these should be stripped out by the compiler.\n // TODO(jelbourn): Assert that there's no name binding AND a parent radio group.\n this.radioGroup = radioGroup;\n\n this._removeUniqueSelectionListener =\n _radioDispatcher.listen((id: string, name: string) => {\n if (id !== this.id && name === this.name) {\n this.checked = false;\n }\n });\n }\n\n /** Focuses the radio button. */\n focus(options?: FocusOptions): void {\n this._focusMonitor.focusVia(this._inputElement, 'keyboard', options);\n }\n\n /**\n * Marks the radio button as needing checking for change detection.\n * This method is exposed because the parent radio group will directly\n * update bound properties of the radio button.\n */\n _markForCheck() {\n // When group value changes, the button will not be notified. Use `markForCheck` to explicit\n // update radio button's status\n this._changeDetector.markForCheck();\n }\n\n ngOnInit() {\n if (this.radioGroup) {\n // If the radio is inside a radio group, determine if it should be checked\n this.checked = this.radioGroup.value === this._value;\n // Copy name from parent radio group\n this.name = this.radioGroup.name;\n }\n }\n\n ngAfterViewInit() {\n this._focusMonitor\n .monitor(this._elementRef, true)\n .subscribe(focusOrigin => {\n if (!focusOrigin && this.radioGroup) {\n this.radioGroup._touch();\n }\n });\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n this._removeUniqueSelectionListener();\n }\n\n /** Dispatch change event with current value. */\n private _emitChangeEvent(): void {\n this.change.emit(new MatRadioChange(this, this._value));\n }\n\n _isRippleDisabled() {\n return this.disableRipple || this.disabled;\n }\n\n _onInputClick(event: Event) {\n // We have to stop propagation for click events on the visual hidden input element.\n // By default, when a user clicks on a label element, a generated click event will be\n // dispatched on the associated input element. Since we are using a label element as our\n // root container, the click event on the `radio-button` will be executed twice.\n // The real click event will bubble up, and the generated click event also tries to bubble up.\n // This will lead to multiple click events.\n // Preventing bubbling for the second event will solve that issue.\n event.stopPropagation();\n }\n\n /**\n * Triggered when the radio button received a click or the input recognized any change.\n * Clicking on a label element, will trigger a change event on the associated input.\n */\n _onInputChange(event: Event) {\n // We always have to stop propagation on the change event.\n // Otherwise the change event, from the input element, will bubble up and\n // emit its event object to the `change` output.\n event.stopPropagation();\n\n const groupValueChanged = this.radioGroup && this.value !== this.radioGroup.value;\n this.checked = true;\n this._emitChangeEvent();\n\n if (this.radioGroup) {\n this.radioGroup._controlValueAccessorChangeFn(this.value);\n if (groupValueChanged) {\n this.radioGroup._emitChangeEvent();\n }\n }\n }\n\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;ACkDA,AAAA,IAAa,yBAAyB,GACpC,IAAI,cAAc,CAAyB,2BAA2B,EAAE;IACxE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,iCAAiC;CAC3C,CAAC,CAAF;;;;AAEA,AAAA,SAAgB,iCAAiC,GAAjD;IACE,OAAO;QACL,KAAK,EAAE,QAAQ;KAChB,CAAC;CACH;;;AAGD,IAAI,YAAY,GAAG,CAAC,CAApB;;;;;;;AAOA,AAAA,IAAa,sCAAsC,GAAQ;IACzD,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU;;;IAAC,YAA1B,EAAgC,OAAA,aAAa,CAA7C,EAA6C,EAAC;IAC5C,KAAK,EAAE,IAAI;CACZ,CAAD;;;;AAGA,AAAA,IAAA;;;;IACE,SAAF,cAAA,CAEW,MAAsB,EAEtB,KAAU,EAJrB;QAEW,IAAX,CAAA,MAAiB,GAAN,MAAM,CAAgB;QAEtB,IAAX,CAAA,KAAg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A,YAAA;IAAA,SAAA,cAAA,GAAA;KAK8B;;QAL9B,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,eAAe,CAAC;oBACzD,OAAO,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,CAAC;oBACzD,YAAY,EAAE,CAAC,aAAa,EAAE,cAAc,CAAC;iBAC9C,EAAD,EAAA;;IAC6B,OAA7B,cAA8B,CAA9B;CAA8B,EAA9B,CAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"radio.es5.js","sources":["../../../src/material/radio/radio-module.ts","../../../src/material/radio/radio.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatRadioButton, MatRadioGroup} from './radio';\n\n\n@NgModule({\n imports: [CommonModule, MatRippleModule, MatCommonModule],\n exports: [MatRadioGroup, MatRadioButton, MatCommonModule],\n declarations: [MatRadioGroup, MatRadioButton],\n})\nexport class MatRadioModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusMonitor} from '@angular/cdk/a11y';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n EventEmitter,\n forwardRef,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {\n CanDisableRipple,\n CanDisableRippleCtor,\n HasTabIndex,\n HasTabIndexCtor,\n mixinDisableRipple,\n mixinTabIndex,\n ThemePalette,\n} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n\nexport interface MatRadioDefaultOptions {\n color: ThemePalette;\n}\n\nexport const MAT_RADIO_DEFAULT_OPTIONS =\n new InjectionToken<MatRadioDefaultOptions>('mat-radio-default-options', {\n providedIn: 'root',\n factory: MAT_RADIO_DEFAULT_OPTIONS_FACTORY\n});\n\nexport function MAT_RADIO_DEFAULT_OPTIONS_FACTORY(): MatRadioDefaultOptions {\n return {\n color: 'accent'\n };\n}\n\n// Increasing integer for generating unique ids for radio components.\nlet nextUniqueId = 0;\n\n/**\n * Provider Expression that allows mat-radio-group to register as a ControlValueAccessor. This\n * allows it to support [(ngModel)] and ngControl.\n * @docs-private\n */\nexport const MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatRadioGroup),\n multi: true\n};\n\n/** Change event object emitted by MatRadio and MatRadioGroup. */\nexport class MatRadioChange {\n constructor(\n /** The MatRadioButton that emits the change event. */\n public source: MatRadioButton,\n /** The value of the MatRadioButton. */\n public value: any) {}\n}\n\n/**\n * A group of radio buttons. May contain one or more `<mat-radio-button>` elements.\n */\n@Directive({\n selector: 'mat-radio-group',\n exportAs: 'matRadioGroup',\n providers: [MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR],\n host: {\n 'role': 'radiogroup',\n 'class': 'mat-radio-group',\n },\n})\nexport class MatRadioGroup implements AfterContentInit, ControlValueAccessor {\n /** Selected value for the radio group. */\n private _value: any = null;\n\n /** The HTML name attribute applied to radio buttons in this group. */\n private _name: string = `mat-radio-group-${nextUniqueId++}`;\n\n /** The currently selected radio button. Should match value. */\n private _selected: MatRadioButton | null = null;\n\n /** Whether the `value` has been set to its initial value. */\n private _isInitialized: boolean = false;\n\n /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */\n private _labelPosition: 'before' | 'after' = 'after';\n\n /** Whether the radio group is disabled. */\n private _disabled: boolean = false;\n\n /** Whether the radio group is required. */\n private _required: boolean = false;\n\n /** The method to be called in order to update ngModel */\n _controlValueAccessorChangeFn: (value: any) => void = () => {};\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n * @docs-private\n */\n onTouched: () => any = () => {};\n\n /**\n * Event emitted when the group value changes.\n * Change events are only emitted when the value changes due to user interaction with\n * a radio button (the same behavior as `<input type-\"radio\">`).\n */\n @Output() readonly change: EventEmitter<MatRadioChange> = new EventEmitter<MatRadioChange>();\n\n /** Child radio buttons. */\n @ContentChildren(forwardRef(() => MatRadioButton), { descendants: true })\n _radios: QueryList<MatRadioButton>;\n\n /** Theme color for all of the radio buttons in the group. */\n @Input() color: ThemePalette;\n\n /** Name of the radio button group. All radio buttons inside this group will use this name. */\n @Input()\n get name(): string { return this._name; }\n set name(value: string) {\n this._name = value;\n this._updateRadioButtonNames();\n }\n\n /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */\n @Input()\n get labelPosition(): 'before' | 'after' {\n return this._labelPosition;\n }\n set labelPosition(v) {\n this._labelPosition = v === 'before' ? 'before' : 'after';\n this._markRadiosForCheck();\n }\n\n /**\n * Value for the radio-group. Should equal the value of the selected radio button if there is\n * a corresponding radio button with a matching value. If there is not such a corresponding\n * radio button, this value persists to be applied in case a new radio button is added with a\n * matching value.\n */\n @Input()\n get value(): any { return this._value; }\n set value(newValue: any) {\n if (this._value !== newValue) {\n // Set this before proceeding to ensure no circular loop occurs with selection.\n this._value = newValue;\n\n this._updateSelectedRadioFromValue();\n this._checkSelectedRadioButton();\n }\n }\n\n _checkSelectedRadioButton() {\n if (this._selected && !this._selected.checked) {\n this._selected.checked = true;\n }\n }\n\n /**\n * The currently selected radio button. If set to a new radio button, the radio group value\n * will be updated to match the new selected button.\n */\n @Input()\n get selected() { return this._selected; }\n set selected(selected: MatRadioButton | null) {\n this._selected = selected;\n this.value = selected ? selected.value : null;\n this._checkSelectedRadioButton();\n }\n\n /** Whether the radio group is disabled */\n @Input()\n get disabled(): boolean { return this._disabled; }\n set disabled(value) {\n this._disabled = coerceBooleanProperty(value);\n this._markRadiosForCheck();\n }\n\n /** Whether the radio group is required */\n @Input()\n get required(): boolean { return this._required; }\n set required(value: boolean) {\n this._required = coerceBooleanProperty(value);\n this._markRadiosForCheck();\n }\n\n constructor(private _changeDetector: ChangeDetectorRef) { }\n\n /**\n * Initialize properties once content children are available.\n * This allows us to propagate relevant attributes to associated buttons.\n */\n ngAfterContentInit() {\n // Mark this component as initialized in AfterContentInit because the initial value can\n // possibly be set by NgModel on MatRadioGroup, and it is possible that the OnInit of the\n // NgModel occurs *after* the OnInit of the MatRadioGroup.\n this._isInitialized = true;\n }\n\n /**\n * Mark this group as being \"touched\" (for ngModel). Meant to be called by the contained\n * radio buttons upon their blur.\n */\n _touch() {\n if (this.onTouched) {\n this.onTouched();\n }\n }\n\n private _updateRadioButtonNames(): void {\n if (this._radios) {\n this._radios.forEach(radio => {\n radio.name = this.name;\n radio._markForCheck();\n });\n }\n }\n\n /** Updates the `selected` radio button from the internal _value state. */\n private _updateSelectedRadioFromValue(): void {\n // If the value already matches the selected radio, do nothing.\n const isAlreadySelected = this._selected !== null && this._selected.value === this._value;\n\n if (this._radios && !isAlreadySelected) {\n this._selected = null;\n this._radios.forEach(radio => {\n radio.checked = this.value === radio.value;\n if (radio.checked) {\n this._selected = radio;\n }\n });\n }\n }\n\n /** Dispatch change event with current selection and group value. */\n _emitChangeEvent(): void {\n if (this._isInitialized) {\n this.change.emit(new MatRadioChange(this._selected!, this._value));\n }\n }\n\n _markRadiosForCheck() {\n if (this._radios) {\n this._radios.forEach(radio => radio._markForCheck());\n }\n }\n\n /**\n * Sets the model value. Implemented as part of ControlValueAccessor.\n * @param value\n */\n writeValue(value: any) {\n this.value = value;\n this._changeDetector.markForCheck();\n }\n\n /**\n * Registers a callback to be triggered when the model value changes.\n * Implemented as part of ControlValueAccessor.\n * @param fn Callback to be registered.\n */\n registerOnChange(fn: (value: any) => void) {\n this._controlValueAccessorChangeFn = fn;\n }\n\n /**\n * Registers a callback to be triggered when the control is touched.\n * Implemented as part of ControlValueAccessor.\n * @param fn Callback to be registered.\n */\n registerOnTouched(fn: any) {\n this.onTouched = fn;\n }\n\n /**\n * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.\n * @param isDisabled Whether the control should be disabled.\n */\n setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled;\n this._changeDetector.markForCheck();\n }\n}\n\n// Boilerplate for applying mixins to MatRadioButton.\n/** @docs-private */\nclass MatRadioButtonBase {\n // Since the disabled property is manually defined for the MatRadioButton and isn't set up in\n // the mixin base class. To be able to use the tabindex mixin, a disabled property must be\n // defined to properly work.\n disabled: boolean;\n\n constructor(public _elementRef: ElementRef) {}\n}\n// As per Material design specifications the selection control radio should use the accent color\n// palette by default. https://material.io/guidelines/components/selection-controls.html\nconst _MatRadioButtonMixinBase:\n CanDisableRippleCtor & HasTabIndexCtor & typeof MatRadioButtonBase =\n mixinDisableRipple(mixinTabIndex(MatRadioButtonBase));\n\n/**\n * A Material design radio-button. Typically placed inside of `<mat-radio-group>` elements.\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-radio-button',\n templateUrl: 'radio.html',\n styleUrls: ['radio.css'],\n inputs: ['disableRipple', 'tabIndex'],\n encapsulation: ViewEncapsulation.None,\n exportAs: 'matRadioButton',\n host: {\n 'class': 'mat-radio-button',\n '[class.mat-radio-checked]': 'checked',\n '[class.mat-radio-disabled]': 'disabled',\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n '[class.mat-primary]': 'color === \"primary\"',\n '[class.mat-accent]': 'color === \"accent\"',\n '[class.mat-warn]': 'color === \"warn\"',\n // Needs to be -1 so the `focus` event still fires.\n '[attr.tabindex]': '-1',\n '[attr.id]': 'id',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[attr.aria-describedby]': 'null',\n // Note: under normal conditions focus shouldn't land on this element, however it may be\n // programmatically set, for example inside of a focus trap, in this case we want to forward\n // the focus to the native element.\n '(focus)': '_inputElement.nativeElement.focus()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatRadioButton extends _MatRadioButtonMixinBase\n implements OnInit, AfterViewInit, OnDestroy, CanDisableRipple, HasTabIndex {\n\n private _uniqueId: string = `mat-radio-${++nextUniqueId}`;\n\n /** The unique ID for the radio button. */\n @Input() id: string = this._uniqueId;\n\n /** Analog to HTML 'name' attribute used to group radios for unique selection. */\n @Input() name: string;\n\n /** Used to set the 'aria-label' attribute on the underlying input element. */\n @Input('aria-label') ariaLabel: string;\n\n /** The 'aria-labelledby' attribute takes precedence as the element's text alternative. */\n @Input('aria-labelledby') ariaLabelledby: string;\n\n /** The 'aria-describedby' attribute is read after the element's label and field type. */\n @Input('aria-describedby') ariaDescribedby: string;\n\n /** Whether this radio button is checked. */\n @Input()\n get checked(): boolean { return this._checked; }\n set checked(value: boolean) {\n const newCheckedState = coerceBooleanProperty(value);\n if (this._checked !== newCheckedState) {\n this._checked = newCheckedState;\n if (newCheckedState && this.radioGroup && this.radioGroup.value !== this.value) {\n this.radioGroup.selected = this;\n } else if (!newCheckedState && this.radioGroup && this.radioGroup.value === this.value) {\n\n // When unchecking the selected radio button, update the selected radio\n // property on the group.\n this.radioGroup.selected = null;\n }\n\n if (newCheckedState) {\n // Notify all radio buttons with the same name to un-check.\n this._radioDispatcher.notify(this.id, this.name);\n }\n this._changeDetector.markForCheck();\n }\n }\n\n /** The value of this radio button. */\n @Input()\n get value(): any { return this._value; }\n set value(value: any) {\n if (this._value !== value) {\n this._value = value;\n if (this.radioGroup !== null) {\n if (!this.checked) {\n // Update checked when the value changed to match the radio group's value\n this.checked = this.radioGroup.value === value;\n }\n if (this.checked) {\n this.radioGroup.selected = this;\n }\n }\n }\n }\n\n /** Whether the label should appear after or before the radio button. Defaults to 'after' */\n @Input()\n get labelPosition(): 'before' | 'after' {\n return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';\n }\n set labelPosition(value) {\n this._labelPosition = value;\n }\n private _labelPosition: 'before' | 'after';\n\n /** Whether the radio button is disabled. */\n @Input()\n get disabled(): boolean {\n return this._disabled || (this.radioGroup !== null && this.radioGroup.disabled);\n }\n set disabled(value: boolean) {\n const newDisabledState = coerceBooleanProperty(value);\n if (this._disabled !== newDisabledState) {\n this._disabled = newDisabledState;\n this._changeDetector.markForCheck();\n }\n }\n\n /** Whether the radio button is required. */\n @Input()\n get required(): boolean {\n return this._required || (this.radioGroup && this.radioGroup.required);\n }\n set required(value: boolean) {\n this._required = coerceBooleanProperty(value);\n }\n\n /** Theme color of the radio button. */\n @Input()\n get color(): ThemePalette {\n return this._color ||\n (this.radioGroup && this.radioGroup.color) ||\n this._providerOverride && this._providerOverride.color || 'accent';\n }\n set color(newValue: ThemePalette) { this._color = newValue; }\n private _color: ThemePalette;\n\n /**\n * Event emitted when the checked state of this radio button changes.\n * Change events are only emitted when the value changes due to user interaction with\n * the radio button (the same behavior as `<input type-\"radio\">`).\n */\n @Output() readonly change: EventEmitter<MatRadioChange> = new EventEmitter<MatRadioChange>();\n\n /** The parent radio group. May or may not be present. */\n radioGroup: MatRadioGroup;\n\n /** ID of the native input element inside `<mat-radio-button>` */\n get inputId(): string { return `${this.id || this._uniqueId}-input`; }\n\n /** Whether this radio is checked. */\n private _checked: boolean = false;\n\n /** Whether this radio is disabled. */\n private _disabled: boolean;\n\n /** Whether this radio is required. */\n private _required: boolean;\n\n /** Value assigned to this radio. */\n private _value: any = null;\n\n /** Unregister function for _radioDispatcher */\n private _removeUniqueSelectionListener: () => void = () => {};\n\n /** The native `<input type=radio>` element */\n @ViewChild('input', {static: false}) _inputElement: ElementRef<HTMLInputElement>;\n\n constructor(@Optional() radioGroup: MatRadioGroup,\n elementRef: ElementRef,\n private _changeDetector: ChangeDetectorRef,\n private _focusMonitor: FocusMonitor,\n private _radioDispatcher: UniqueSelectionDispatcher,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string,\n @Optional() @Inject(MAT_RADIO_DEFAULT_OPTIONS)\n private _providerOverride?: MatRadioDefaultOptions) {\n super(elementRef);\n\n // Assertions. Ideally these should be stripped out by the compiler.\n // TODO(jelbourn): Assert that there's no name binding AND a parent radio group.\n this.radioGroup = radioGroup;\n\n this._removeUniqueSelectionListener =\n _radioDispatcher.listen((id: string, name: string) => {\n if (id !== this.id && name === this.name) {\n this.checked = false;\n }\n });\n }\n\n /** Focuses the radio button. */\n focus(options?: FocusOptions): void {\n this._focusMonitor.focusVia(this._inputElement, 'keyboard', options);\n }\n\n /**\n * Marks the radio button as needing checking for change detection.\n * This method is exposed because the parent radio group will directly\n * update bound properties of the radio button.\n */\n _markForCheck() {\n // When group value changes, the button will not be notified. Use `markForCheck` to explicit\n // update radio button's status\n this._changeDetector.markForCheck();\n }\n\n ngOnInit() {\n if (this.radioGroup) {\n // If the radio is inside a radio group, determine if it should be checked\n this.checked = this.radioGroup.value === this._value;\n // Copy name from parent radio group\n this.name = this.radioGroup.name;\n }\n }\n\n ngAfterViewInit() {\n this._focusMonitor\n .monitor(this._elementRef, true)\n .subscribe(focusOrigin => {\n if (!focusOrigin && this.radioGroup) {\n this.radioGroup._touch();\n }\n });\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n this._removeUniqueSelectionListener();\n }\n\n /** Dispatch change event with current value. */\n private _emitChangeEvent(): void {\n this.change.emit(new MatRadioChange(this, this._value));\n }\n\n _isRippleDisabled() {\n return this.disableRipple || this.disabled;\n }\n\n _onInputClick(event: Event) {\n // We have to stop propagation for click events on the visual hidden input element.\n // By default, when a user clicks on a label element, a generated click event will be\n // dispatched on the associated input element. Since we are using a label element as our\n // root container, the click event on the `radio-button` will be executed twice.\n // The real click event will bubble up, and the generated click event also tries to bubble up.\n // This will lead to multiple click events.\n // Preventing bubbling for the second event will solve that issue.\n event.stopPropagation();\n }\n\n /**\n * Triggered when the radio button received a click or the input recognized any change.\n * Clicking on a label element, will trigger a change event on the associated input.\n */\n _onInputChange(event: Event) {\n // We always have to stop propagation on the change event.\n // Otherwise the change event, from the input element, will bubble up and\n // emit its event object to the `change` output.\n event.stopPropagation();\n\n const groupValueChanged = this.radioGroup && this.value !== this.radioGroup.value;\n this.checked = true;\n this._emitChangeEvent();\n\n if (this.radioGroup) {\n this.radioGroup._controlValueAccessorChangeFn(this.value);\n if (groupValueChanged) {\n this.radioGroup._emitChangeEvent();\n }\n }\n }\n\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;ACkDA,AAAA,IAAa,yBAAyB,GACpC,IAAI,cAAc,CAAyB,2BAA2B,EAAE;IACxE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,iCAAiC;CAC3C,CAAC,CAAF;;;;AAEA,AAAA,SAAgB,iCAAiC,GAAjD;IACE,OAAO;QACL,KAAK,EAAE,QAAQ;KAChB,CAAC;CACH;;;AAGD,IAAI,YAAY,GAAG,CAAC,CAApB;;;;;;;AAOA,AAAA,IAAa,sCAAsC,GAAQ;IACzD,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU;;;IAAC,YAA1B,EAAgC,OAAA,aAAa,CAA7C,EAA6C,EAAC;IAC5C,KAAK,EAAE,IAAI;CACZ,CAAD;;;;AAGA,AAAA,IAAA;;;;IACE,SAAF,cAAA,CAEW,MAAsB,EAEtB,KAAU,EAJrB;QAEW,IAAX,CAAA,MAAiB,GAAN,MAAM,CAAgB;QAEtB,IAAX,CAAA,KAAgB,GAAL,KAAK,CAAK;KAAI;IACzB,OAAA,cAAC,CAAD;CAAC,EAAD,CAAA,CAAC;;;;AAKD,AAAA,IAAA,aAAA,kBAAA,YAAA;IA4HE,SAAF,aAAA,CAAsB,eAAkC,EAAxD;QAAsB,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AAA,EAAA,CAAU;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,eAAe,CAAC;oBACzD,OAAO,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,CAAC;oBACzD,YAAY,EAAE,CAAC,aAAa,EAAE,cAAc,CAAC;iBAC9C,EAAD,EAAA;;IAC6B,OAA7B,cAA8B,CAA9B;CAA8B,EAA9B,CAAA;;;;;;;;;;;;;;"}
@@ -705,6 +705,9 @@ var MatSelect = /** @class */ (function (_super) {
705
705
  if (changes['disabled']) {
706
706
  this.stateChanges.next();
707
707
  }
708
+ if (changes['typeaheadDebounceInterval'] && this._keyManager) {
709
+ this._keyManager.withTypeAhead(this.typeaheadDebounceInterval);
710
+ }
708
711
  };
709
712
  /**
710
713
  * @return {?}
@@ -1214,6 +1217,11 @@ var MatSelect = /** @class */ (function (_super) {
1214
1217
  if (correspondingOption) {
1215
1218
  this._keyManager.setActiveItem(correspondingOption);
1216
1219
  }
1220
+ else if (!this.panelOpen) {
1221
+ // Otherwise reset the highlighted option. Note that we only want to do this while
1222
+ // closed, because doing it while open can shift the user's focus unnecessarily.
1223
+ this._keyManager.setActiveItem(-1);
1224
+ }
1217
1225
  }
1218
1226
  this._changeDetectorRef.markForCheck();
1219
1227
  };
@@ -1272,7 +1280,7 @@ var MatSelect = /** @class */ (function (_super) {
1272
1280
  function () {
1273
1281
  var _this = this;
1274
1282
  this._keyManager = new ActiveDescendantKeyManager(this.options)
1275
- .withTypeAhead()
1283
+ .withTypeAhead(this.typeaheadDebounceInterval)
1276
1284
  .withVerticalOrientation()
1277
1285
  .withHorizontalOrientation(this._isRtl() ? 'rtl' : 'ltr')
1278
1286
  .withAllowedModifierKeys(['shiftKey']);
@@ -1363,7 +1371,10 @@ var MatSelect = /** @class */ (function (_super) {
1363
1371
  this._propagateChanges(option.value);
1364
1372
  }
1365
1373
  else {
1366
- option.selected ? this._selectionModel.select(option) : this._selectionModel.deselect(option);
1374
+ if (wasSelected !== option.selected) {
1375
+ option.selected ? this._selectionModel.select(option) :
1376
+ this._selectionModel.deselect(option);
1377
+ }
1367
1378
  if (isUserInput) {
1368
1379
  this._keyManager.setActiveItem(option);
1369
1380
  }
@@ -2100,6 +2111,7 @@ var MatSelect = /** @class */ (function (_super) {
2100
2111
  ariaLabel: [{ type: Input, args: ['aria-label',] }],
2101
2112
  ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
2102
2113
  errorStateMatcher: [{ type: Input }],
2114
+ typeaheadDebounceInterval: [{ type: Input }],
2103
2115
  sortComparator: [{ type: Input }],
2104
2116
  id: [{ type: Input }],
2105
2117
  openedChange: [{ type: Output }],