@angular/material 9.2.0 → 9.2.4

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 (365) hide show
  1. package/_theming.scss +19 -4
  2. package/autocomplete/index.metadata.json +1 -1
  3. package/autocomplete/testing/autocomplete-harness.d.ts +4 -1
  4. package/badge/index.metadata.json +1 -1
  5. package/bottom-sheet/bottom-sheet.d.ts +2 -1
  6. package/bundles/material-autocomplete-testing.umd.js +55 -8
  7. package/bundles/material-autocomplete-testing.umd.js.map +1 -1
  8. package/bundles/material-autocomplete-testing.umd.min.js +4 -5
  9. package/bundles/material-autocomplete-testing.umd.min.js.map +1 -1
  10. package/bundles/material-autocomplete.umd.js +28 -27
  11. package/bundles/material-autocomplete.umd.js.map +1 -1
  12. package/bundles/material-autocomplete.umd.min.js +5 -5
  13. package/bundles/material-autocomplete.umd.min.js.map +1 -1
  14. package/bundles/material-badge.umd.js +1 -1
  15. package/bundles/material-badge.umd.js.map +1 -1
  16. package/bundles/material-badge.umd.min.js +1 -1
  17. package/bundles/material-badge.umd.min.js.map +1 -1
  18. package/bundles/material-bottom-sheet.umd.js +3 -2
  19. package/bundles/material-bottom-sheet.umd.js.map +1 -1
  20. package/bundles/material-bottom-sheet.umd.min.js +1 -1
  21. package/bundles/material-bottom-sheet.umd.min.js.map +1 -1
  22. package/bundles/material-button-toggle.umd.js +16 -6
  23. package/bundles/material-button-toggle.umd.js.map +1 -1
  24. package/bundles/material-button-toggle.umd.min.js +3 -3
  25. package/bundles/material-button-toggle.umd.min.js.map +1 -1
  26. package/bundles/material-chips.umd.js +19 -3
  27. package/bundles/material-chips.umd.js.map +1 -1
  28. package/bundles/material-chips.umd.min.js +4 -4
  29. package/bundles/material-chips.umd.min.js.map +1 -1
  30. package/bundles/material-core.umd.js +95 -71
  31. package/bundles/material-core.umd.js.map +1 -1
  32. package/bundles/material-core.umd.min.js +9 -9
  33. package/bundles/material-core.umd.min.js.map +1 -1
  34. package/bundles/material-datepicker.umd.js +23 -10
  35. package/bundles/material-datepicker.umd.js.map +1 -1
  36. package/bundles/material-datepicker.umd.min.js +7 -7
  37. package/bundles/material-datepicker.umd.min.js.map +1 -1
  38. package/bundles/material-dialog.umd.js +46 -27
  39. package/bundles/material-dialog.umd.js.map +1 -1
  40. package/bundles/material-dialog.umd.min.js +6 -6
  41. package/bundles/material-dialog.umd.min.js.map +1 -1
  42. package/bundles/material-expansion.umd.js +3 -3
  43. package/bundles/material-expansion.umd.js.map +1 -1
  44. package/bundles/material-expansion.umd.min.js +1 -1
  45. package/bundles/material-expansion.umd.min.js.map +1 -1
  46. package/bundles/material-form-field.umd.js +6 -4
  47. package/bundles/material-form-field.umd.js.map +1 -1
  48. package/bundles/material-form-field.umd.min.js +3 -3
  49. package/bundles/material-form-field.umd.min.js.map +1 -1
  50. package/bundles/material-icon.umd.js +9 -5
  51. package/bundles/material-icon.umd.js.map +1 -1
  52. package/bundles/material-icon.umd.min.js +3 -3
  53. package/bundles/material-icon.umd.min.js.map +1 -1
  54. package/bundles/material-input.umd.js +18 -14
  55. package/bundles/material-input.umd.js.map +1 -1
  56. package/bundles/material-input.umd.min.js +1 -1
  57. package/bundles/material-input.umd.min.js.map +1 -1
  58. package/bundles/material-list.umd.js +4 -4
  59. package/bundles/material-list.umd.js.map +1 -1
  60. package/bundles/material-list.umd.min.js +2 -2
  61. package/bundles/material-list.umd.min.js.map +1 -1
  62. package/bundles/material-menu.umd.js +5 -5
  63. package/bundles/material-menu.umd.js.map +1 -1
  64. package/bundles/material-menu.umd.min.js +6 -6
  65. package/bundles/material-menu.umd.min.js.map +1 -1
  66. package/bundles/material-radio.umd.js +62 -47
  67. package/bundles/material-radio.umd.js.map +1 -1
  68. package/bundles/material-radio.umd.min.js +10 -2
  69. package/bundles/material-radio.umd.min.js.map +1 -1
  70. package/bundles/material-select-testing.umd.js +45 -10
  71. package/bundles/material-select-testing.umd.js.map +1 -1
  72. package/bundles/material-select-testing.umd.min.js +2 -3
  73. package/bundles/material-select-testing.umd.min.js.map +1 -1
  74. package/bundles/material-select.umd.js +23 -14
  75. package/bundles/material-select.umd.js.map +1 -1
  76. package/bundles/material-select.umd.min.js +3 -3
  77. package/bundles/material-select.umd.min.js.map +1 -1
  78. package/bundles/material-sidenav.umd.js +2 -1
  79. package/bundles/material-sidenav.umd.js.map +1 -1
  80. package/bundles/material-sidenav.umd.min.js +2 -2
  81. package/bundles/material-sidenav.umd.min.js.map +1 -1
  82. package/bundles/material-slider.umd.js +14 -12
  83. package/bundles/material-slider.umd.js.map +1 -1
  84. package/bundles/material-slider.umd.min.js +1 -1
  85. package/bundles/material-slider.umd.min.js.map +1 -1
  86. package/bundles/material-table.umd.js +1 -1
  87. package/bundles/material-table.umd.js.map +1 -1
  88. package/bundles/material-table.umd.min.js +1 -1
  89. package/bundles/material-table.umd.min.js.map +1 -1
  90. package/bundles/material-tabs.umd.js +9 -6
  91. package/bundles/material-tabs.umd.js.map +1 -1
  92. package/bundles/material-tabs.umd.min.js +1 -1
  93. package/bundles/material-tabs.umd.min.js.map +1 -1
  94. package/bundles/material-tooltip.umd.js +5 -5
  95. package/bundles/material-tooltip.umd.js.map +1 -1
  96. package/bundles/material-tooltip.umd.min.js +3 -3
  97. package/bundles/material-tooltip.umd.min.js.map +1 -1
  98. package/bundles/material-tree.umd.js +1 -1
  99. package/bundles/material-tree.umd.js.map +1 -1
  100. package/bundles/material-tree.umd.min.js +1 -1
  101. package/bundles/material-tree.umd.min.js.map +1 -1
  102. package/button-toggle/index.metadata.json +1 -1
  103. package/chips/chip.d.ts +10 -3
  104. package/chips/index.metadata.json +1 -1
  105. package/core/index.metadata.json +1 -1
  106. package/core/ripple/ripple-renderer.d.ts +10 -3
  107. package/core/ripple/ripple.d.ts +2 -1
  108. package/datepicker/datepicker-input.d.ts +5 -2
  109. package/datepicker/index.metadata.json +1 -1
  110. package/dialog/dialog-container.d.ts +9 -2
  111. package/dialog/dialog-ref.d.ts +5 -0
  112. package/dialog/index.metadata.json +1 -1
  113. package/esm2015/autocomplete/autocomplete-module.js +3 -1
  114. package/esm2015/autocomplete/autocomplete-trigger.js +25 -24
  115. package/esm2015/autocomplete/testing/autocomplete-harness.js +18 -7
  116. package/esm2015/badge/badge-module.js +2 -2
  117. package/esm2015/bottom-sheet/bottom-sheet.js +5 -3
  118. package/esm2015/button-toggle/button-toggle.js +18 -7
  119. package/esm2015/chips/chip-list.js +5 -2
  120. package/esm2015/chips/chip.js +34 -4
  121. package/esm2015/core/common-behaviors/common-module.js +1 -1
  122. package/esm2015/core/ripple/ripple-renderer.js +140 -119
  123. package/esm2015/core/ripple/ripple.js +10 -7
  124. package/esm2015/core/version.js +1 -1
  125. package/esm2015/datepicker/calendar-body.js +3 -3
  126. package/esm2015/datepicker/calendar.js +3 -3
  127. package/esm2015/datepicker/datepicker-input.js +17 -2
  128. package/esm2015/datepicker/datepicker-module.js +3 -1
  129. package/esm2015/datepicker/datepicker.js +8 -2
  130. package/esm2015/dialog/dialog-container.js +37 -17
  131. package/esm2015/dialog/dialog-ref.js +24 -6
  132. package/esm2015/dialog/dialog.js +1 -12
  133. package/esm2015/expansion/expansion-panel-header.js +3 -3
  134. package/esm2015/expansion/expansion-panel.js +1 -1
  135. package/esm2015/form-field/form-field-module.js +5 -2
  136. package/esm2015/icon/icon.js +15 -2
  137. package/esm2015/input/input.js +26 -23
  138. package/esm2015/list/selection-list.js +8 -6
  139. package/esm2015/menu/menu-module.js +3 -2
  140. package/esm2015/radio/public-api.js +2 -2
  141. package/esm2015/radio/radio.js +70 -59
  142. package/esm2015/select/select-module.js +10 -2
  143. package/esm2015/select/select.js +12 -10
  144. package/esm2015/select/testing/select-harness.js +11 -6
  145. package/esm2015/sidenav/sidenav-module.js +4 -3
  146. package/esm2015/slider/slider.js +17 -15
  147. package/esm2015/snack-bar/snack-bar.js +1 -1
  148. package/esm2015/table/table-module.js +2 -2
  149. package/esm2015/tabs/paginated-tab-header.js +7 -4
  150. package/esm2015/tabs/tab-header.js +1 -1
  151. package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +3 -3
  152. package/esm2015/tooltip/tooltip-module.js +3 -2
  153. package/esm2015/tree/tree-module.js +2 -2
  154. package/esm5/autocomplete/autocomplete-module.js +3 -1
  155. package/esm5/autocomplete/autocomplete-trigger.js +24 -24
  156. package/esm5/autocomplete/testing/autocomplete-harness.js +56 -9
  157. package/esm5/badge/badge-module.js +2 -2
  158. package/esm5/bottom-sheet/bottom-sheet.js +4 -3
  159. package/esm5/button-toggle/button-toggle.js +17 -7
  160. package/esm5/chips/chip-list.js +5 -2
  161. package/esm5/chips/chip.js +17 -4
  162. package/esm5/core/common-behaviors/common-module.js +1 -1
  163. package/esm5/core/ripple/ripple-renderer.js +91 -65
  164. package/esm5/core/ripple/ripple.js +4 -6
  165. package/esm5/core/version.js +1 -1
  166. package/esm5/datepicker/calendar-body.js +3 -3
  167. package/esm5/datepicker/calendar.js +3 -3
  168. package/esm5/datepicker/datepicker-input.js +8 -2
  169. package/esm5/datepicker/datepicker-module.js +3 -1
  170. package/esm5/datepicker/datepicker.js +8 -2
  171. package/esm5/dialog/dialog-container.js +29 -15
  172. package/esm5/dialog/dialog-ref.js +19 -6
  173. package/esm5/dialog/dialog.js +1 -9
  174. package/esm5/expansion/expansion-panel-header.js +3 -3
  175. package/esm5/expansion/expansion-panel.js +1 -1
  176. package/esm5/form-field/form-field-module.js +5 -2
  177. package/esm5/icon/icon.js +7 -2
  178. package/esm5/input/input.js +20 -16
  179. package/esm5/list/selection-list.js +5 -5
  180. package/esm5/menu/menu-module.js +3 -2
  181. package/esm5/radio/radio.js +63 -48
  182. package/esm5/select/select-module.js +10 -2
  183. package/esm5/select/select.js +12 -10
  184. package/esm5/select/testing/select-harness.js +46 -11
  185. package/esm5/sidenav/sidenav-module.js +4 -3
  186. package/esm5/slider/slider.js +15 -13
  187. package/esm5/table/table-module.js +2 -2
  188. package/esm5/tabs/paginated-tab-header.js +7 -4
  189. package/esm5/tabs/tab-header.js +1 -1
  190. package/esm5/tabs/tab-nav-bar/tab-nav-bar.js +3 -3
  191. package/esm5/tooltip/tooltip-module.js +3 -2
  192. package/esm5/tree/tree-module.js +2 -2
  193. package/expansion/index.metadata.json +1 -1
  194. package/fesm2015/autocomplete/testing.js +17 -6
  195. package/fesm2015/autocomplete/testing.js.map +1 -1
  196. package/fesm2015/autocomplete.js +26 -24
  197. package/fesm2015/autocomplete.js.map +1 -1
  198. package/fesm2015/badge.js +1 -1
  199. package/fesm2015/badge.js.map +1 -1
  200. package/fesm2015/bottom-sheet.js +4 -2
  201. package/fesm2015/bottom-sheet.js.map +1 -1
  202. package/fesm2015/button-toggle.js +17 -6
  203. package/fesm2015/button-toggle.js.map +1 -1
  204. package/fesm2015/chips.js +37 -4
  205. package/fesm2015/chips.js.map +1 -1
  206. package/fesm2015/core.js +150 -126
  207. package/fesm2015/core.js.map +1 -1
  208. package/fesm2015/datepicker.js +29 -6
  209. package/fesm2015/datepicker.js.map +1 -1
  210. package/fesm2015/dialog.js +59 -32
  211. package/fesm2015/dialog.js.map +1 -1
  212. package/fesm2015/expansion.js +3 -3
  213. package/fesm2015/expansion.js.map +1 -1
  214. package/fesm2015/form-field.js +4 -2
  215. package/fesm2015/form-field.js.map +1 -1
  216. package/fesm2015/icon.js +14 -2
  217. package/fesm2015/icon.js.map +1 -1
  218. package/fesm2015/input.js +25 -22
  219. package/fesm2015/input.js.map +1 -1
  220. package/fesm2015/list.js +7 -5
  221. package/fesm2015/list.js.map +1 -1
  222. package/fesm2015/menu.js +2 -1
  223. package/fesm2015/menu.js.map +1 -1
  224. package/fesm2015/radio.js +71 -60
  225. package/fesm2015/radio.js.map +1 -1
  226. package/fesm2015/select/testing.js +10 -5
  227. package/fesm2015/select/testing.js.map +1 -1
  228. package/fesm2015/select.js +20 -11
  229. package/fesm2015/select.js.map +1 -1
  230. package/fesm2015/sidenav.js +3 -2
  231. package/fesm2015/sidenav.js.map +1 -1
  232. package/fesm2015/slider.js +16 -14
  233. package/fesm2015/slider.js.map +1 -1
  234. package/fesm2015/table.js +1 -1
  235. package/fesm2015/table.js.map +1 -1
  236. package/fesm2015/tabs.js +9 -6
  237. package/fesm2015/tabs.js.map +1 -1
  238. package/fesm2015/tooltip.js +2 -2
  239. package/fesm2015/tooltip.js.map +1 -1
  240. package/fesm2015/tree.js +1 -1
  241. package/fesm2015/tree.js.map +1 -1
  242. package/fesm5/autocomplete/testing.js +55 -8
  243. package/fesm5/autocomplete/testing.js.map +1 -1
  244. package/fesm5/autocomplete.js +25 -24
  245. package/fesm5/autocomplete.js.map +1 -1
  246. package/fesm5/badge.js +1 -1
  247. package/fesm5/badge.js.map +1 -1
  248. package/fesm5/bottom-sheet.js +3 -2
  249. package/fesm5/bottom-sheet.js.map +1 -1
  250. package/fesm5/button-toggle.js +16 -6
  251. package/fesm5/button-toggle.js.map +1 -1
  252. package/fesm5/chips.js +20 -4
  253. package/fesm5/chips.js.map +1 -1
  254. package/fesm5/core.js +95 -71
  255. package/fesm5/core.js.map +1 -1
  256. package/fesm5/datepicker.js +20 -6
  257. package/fesm5/datepicker.js.map +1 -1
  258. package/fesm5/dialog.js +46 -27
  259. package/fesm5/dialog.js.map +1 -1
  260. package/fesm5/expansion.js +3 -3
  261. package/fesm5/expansion.js.map +1 -1
  262. package/fesm5/form-field.js +4 -2
  263. package/fesm5/form-field.js.map +1 -1
  264. package/fesm5/icon.js +6 -2
  265. package/fesm5/icon.js.map +1 -1
  266. package/fesm5/input.js +19 -15
  267. package/fesm5/input.js.map +1 -1
  268. package/fesm5/list.js +4 -4
  269. package/fesm5/list.js.map +1 -1
  270. package/fesm5/menu.js +2 -1
  271. package/fesm5/menu.js.map +1 -1
  272. package/fesm5/radio.js +63 -49
  273. package/fesm5/radio.js.map +1 -1
  274. package/fesm5/select/testing.js +45 -10
  275. package/fesm5/select/testing.js.map +1 -1
  276. package/fesm5/select.js +20 -11
  277. package/fesm5/select.js.map +1 -1
  278. package/fesm5/sidenav.js +3 -2
  279. package/fesm5/sidenav.js.map +1 -1
  280. package/fesm5/slider.js +14 -12
  281. package/fesm5/slider.js.map +1 -1
  282. package/fesm5/table.js +1 -1
  283. package/fesm5/table.js.map +1 -1
  284. package/fesm5/tabs.js +9 -6
  285. package/fesm5/tabs.js.map +1 -1
  286. package/fesm5/tooltip.js +2 -2
  287. package/fesm5/tooltip.js.map +1 -1
  288. package/fesm5/tree.js +1 -1
  289. package/fesm5/tree.js.map +1 -1
  290. package/form-field/index.metadata.json +1 -1
  291. package/icon/icon.d.ts +2 -0
  292. package/icon/index.metadata.json +1 -1
  293. package/input/index.metadata.json +1 -1
  294. package/input/input.d.ts +4 -4
  295. package/list/index.metadata.json +1 -1
  296. package/menu/index.metadata.json +1 -1
  297. package/package.json +2 -2
  298. package/prebuilt-themes/deeppurple-amber.css +1 -1
  299. package/prebuilt-themes/indigo-pink.css +1 -1
  300. package/prebuilt-themes/pink-bluegrey.css +1 -1
  301. package/prebuilt-themes/purple-green.css +1 -1
  302. package/radio/index.metadata.json +1 -1
  303. package/radio/radio.d.ts +8 -2
  304. package/schematics/collection.json +0 -7
  305. package/schematics/ng-add/index.js +1 -1
  306. package/schematics/ng-update/index.js +23 -23
  307. package/schematics/ng-update/{upgrade-rules → migrations}/hammer-gestures-v9/find-hammer-script-tags.d.ts +1 -1
  308. package/schematics/ng-update/migrations/hammer-gestures-v9/find-hammer-script-tags.js +51 -0
  309. package/schematics/ng-update/{upgrade-rules → migrations}/hammer-gestures-v9/find-main-module.d.ts +1 -1
  310. package/schematics/ng-update/migrations/hammer-gestures-v9/find-main-module.js +41 -0
  311. package/schematics/ng-update/{upgrade-rules → migrations}/hammer-gestures-v9/gesture-config.template +0 -0
  312. package/schematics/ng-update/{upgrade-rules/hammer-gestures-v9/hammer-gestures-rule.d.ts → migrations/hammer-gestures-v9/hammer-gestures-migration.d.ts} +6 -6
  313. package/schematics/ng-update/migrations/hammer-gestures-v9/hammer-gestures-migration.js +784 -0
  314. package/schematics/ng-update/{upgrade-rules → migrations}/hammer-gestures-v9/hammer-template-check.d.ts +1 -1
  315. package/schematics/ng-update/migrations/hammer-gestures-v9/hammer-template-check.js +65 -0
  316. package/schematics/ng-update/{upgrade-rules → migrations}/hammer-gestures-v9/import-manager.d.ts +4 -4
  317. package/schematics/ng-update/migrations/hammer-gestures-v9/import-manager.js +379 -0
  318. package/schematics/ng-update/{upgrade-rules → migrations}/hammer-gestures-v9/remove-array-element.d.ts +1 -1
  319. package/schematics/ng-update/migrations/hammer-gestures-v9/remove-array-element.js +75 -0
  320. package/schematics/ng-update/{upgrade-rules → migrations}/hammer-gestures-v9/remove-element-from-html.d.ts +1 -1
  321. package/schematics/ng-update/migrations/hammer-gestures-v9/remove-element-from-html.js +37 -0
  322. package/schematics/ng-update/migrations/misc-checks/misc-class-inheritance.d.ts +19 -0
  323. package/schematics/ng-update/migrations/misc-checks/misc-class-inheritance.js +57 -0
  324. package/schematics/ng-update/{upgrade-rules/misc-checks/misc-class-names-rule.d.ts → migrations/misc-checks/misc-class-names.d.ts} +5 -5
  325. package/schematics/ng-update/migrations/misc-checks/misc-class-names.js +52 -0
  326. package/schematics/ng-update/{upgrade-rules/misc-checks/misc-imports-rule.d.ts → migrations/misc-checks/misc-imports.d.ts} +5 -5
  327. package/schematics/ng-update/migrations/misc-checks/misc-imports.js +63 -0
  328. package/schematics/ng-update/{upgrade-rules/misc-checks/misc-property-names-rule.d.ts → migrations/misc-checks/misc-property-names.d.ts} +5 -5
  329. package/schematics/ng-update/migrations/misc-checks/misc-property-names.js +56 -0
  330. package/schematics/ng-update/migrations/misc-checks/misc-template.d.ts +17 -0
  331. package/schematics/ng-update/migrations/misc-checks/misc-template.js +69 -0
  332. package/schematics/ng-update/{upgrade-rules/misc-ripples-v7/ripple-speed-factor-rule.d.ts → migrations/misc-ripples-v7/ripple-speed-factor-migration.d.ts} +5 -5
  333. package/schematics/ng-update/migrations/misc-ripples-v7/ripple-speed-factor-migration.js +147 -0
  334. package/schematics/ng-update/{upgrade-rules → migrations}/misc-ripples-v7/ripple-speed-factor.d.ts +1 -1
  335. package/schematics/ng-update/migrations/misc-ripples-v7/ripple-speed-factor.js +39 -0
  336. package/schematics/ng-update/{upgrade-rules → migrations}/package-imports-v8/material-symbols.json +0 -0
  337. package/schematics/ng-update/{upgrade-rules/package-imports-v8/secondary-entry-points-rule.d.ts → migrations/package-imports-v8/secondary-entry-points-migration.d.ts} +5 -5
  338. package/schematics/ng-update/migrations/package-imports-v8/secondary-entry-points-migration.js +177 -0
  339. package/schematics/ng-update/upgrade-data.d.ts +2 -2
  340. package/schematics/ng-update/upgrade-data.js +1 -1
  341. package/select/index.metadata.json +1 -1
  342. package/select/testing/select-harness.d.ts +2 -1
  343. package/sidenav/index.metadata.json +1 -1
  344. package/table/index.metadata.json +1 -1
  345. package/tabs/_tabs-common.scss +5 -3
  346. package/tabs/index.metadata.json +1 -1
  347. package/tooltip/index.metadata.json +1 -1
  348. package/tree/index.metadata.json +1 -1
  349. package/schematics/ng-update/upgrade-rules/hammer-gestures-v9/find-hammer-script-tags.js +0 -51
  350. package/schematics/ng-update/upgrade-rules/hammer-gestures-v9/find-main-module.js +0 -41
  351. package/schematics/ng-update/upgrade-rules/hammer-gestures-v9/hammer-gestures-rule.js +0 -781
  352. package/schematics/ng-update/upgrade-rules/hammer-gestures-v9/hammer-template-check.js +0 -65
  353. package/schematics/ng-update/upgrade-rules/hammer-gestures-v9/import-manager.js +0 -379
  354. package/schematics/ng-update/upgrade-rules/hammer-gestures-v9/remove-array-element.js +0 -75
  355. package/schematics/ng-update/upgrade-rules/hammer-gestures-v9/remove-element-from-html.js +0 -37
  356. package/schematics/ng-update/upgrade-rules/misc-checks/misc-class-inheritance-rule.d.ts +0 -19
  357. package/schematics/ng-update/upgrade-rules/misc-checks/misc-class-inheritance-rule.js +0 -57
  358. package/schematics/ng-update/upgrade-rules/misc-checks/misc-class-names-rule.js +0 -52
  359. package/schematics/ng-update/upgrade-rules/misc-checks/misc-imports-rule.js +0 -63
  360. package/schematics/ng-update/upgrade-rules/misc-checks/misc-property-names-rule.js +0 -56
  361. package/schematics/ng-update/upgrade-rules/misc-checks/misc-template-rule.d.ts +0 -17
  362. package/schematics/ng-update/upgrade-rules/misc-checks/misc-template-rule.js +0 -69
  363. package/schematics/ng-update/upgrade-rules/misc-ripples-v7/ripple-speed-factor-rule.js +0 -147
  364. package/schematics/ng-update/upgrade-rules/misc-ripples-v7/ripple-speed-factor.js +0 -39
  365. package/schematics/ng-update/upgrade-rules/package-imports-v8/secondary-entry-points-rule.js +0 -177
package/fesm5/radio.js CHANGED
@@ -1,4 +1,4 @@
1
- import { InjectionToken, forwardRef, EventEmitter, Directive, ChangeDetectorRef, Output, ContentChildren, Input, Component, ViewEncapsulation, ChangeDetectionStrategy, Optional, ElementRef, Inject, ViewChild, NgModule } from '@angular/core';
1
+ import { InjectionToken, forwardRef, EventEmitter, Directive, ChangeDetectorRef, Output, ContentChildren, Input, Optional, ElementRef, Inject, ViewChild, Component, ViewEncapsulation, ChangeDetectionStrategy, NgModule } from '@angular/core';
2
2
  import { mixinDisableRipple, mixinTabIndex, MatRippleModule, MatCommonModule } from '@angular/material/core';
3
3
  import { __extends } from 'tslib';
4
4
  import { FocusMonitor } from '@angular/cdk/a11y';
@@ -287,11 +287,12 @@ var MatRadioButtonBase = /** @class */ (function () {
287
287
  // palette by default. https://material.io/guidelines/components/selection-controls.html
288
288
  var _MatRadioButtonMixinBase = mixinDisableRipple(mixinTabIndex(MatRadioButtonBase));
289
289
  /**
290
- * A Material design radio-button. Typically placed inside of `<mat-radio-group>` elements.
290
+ * Base class with all of the `MatRadioButton` functionality.
291
+ * @docs-private
291
292
  */
292
- var MatRadioButton = /** @class */ (function (_super) {
293
- __extends(MatRadioButton, _super);
294
- function MatRadioButton(radioGroup, elementRef, _changeDetector, _focusMonitor, _radioDispatcher, _animationMode, _providerOverride) {
293
+ var _MatRadioButtonBase = /** @class */ (function (_super) {
294
+ __extends(_MatRadioButtonBase, _super);
295
+ function _MatRadioButtonBase(radioGroup, elementRef, _changeDetector, _focusMonitor, _radioDispatcher, _animationMode, _providerOverride) {
295
296
  var _this = _super.call(this, elementRef) || this;
296
297
  _this._changeDetector = _changeDetector;
297
298
  _this._focusMonitor = _focusMonitor;
@@ -324,7 +325,7 @@ var MatRadioButton = /** @class */ (function (_super) {
324
325
  });
325
326
  return _this;
326
327
  }
327
- Object.defineProperty(MatRadioButton.prototype, "checked", {
328
+ Object.defineProperty(_MatRadioButtonBase.prototype, "checked", {
328
329
  /** Whether this radio button is checked. */
329
330
  get: function () { return this._checked; },
330
331
  set: function (value) {
@@ -349,7 +350,7 @@ var MatRadioButton = /** @class */ (function (_super) {
349
350
  enumerable: true,
350
351
  configurable: true
351
352
  });
352
- Object.defineProperty(MatRadioButton.prototype, "value", {
353
+ Object.defineProperty(_MatRadioButtonBase.prototype, "value", {
353
354
  /** The value of this radio button. */
354
355
  get: function () { return this._value; },
355
356
  set: function (value) {
@@ -369,7 +370,7 @@ var MatRadioButton = /** @class */ (function (_super) {
369
370
  enumerable: true,
370
371
  configurable: true
371
372
  });
372
- Object.defineProperty(MatRadioButton.prototype, "labelPosition", {
373
+ Object.defineProperty(_MatRadioButtonBase.prototype, "labelPosition", {
373
374
  /** Whether the label should appear after or before the radio button. Defaults to 'after' */
374
375
  get: function () {
375
376
  return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';
@@ -380,7 +381,7 @@ var MatRadioButton = /** @class */ (function (_super) {
380
381
  enumerable: true,
381
382
  configurable: true
382
383
  });
383
- Object.defineProperty(MatRadioButton.prototype, "disabled", {
384
+ Object.defineProperty(_MatRadioButtonBase.prototype, "disabled", {
384
385
  /** Whether the radio button is disabled. */
385
386
  get: function () {
386
387
  return this._disabled || (this.radioGroup !== null && this.radioGroup.disabled);
@@ -391,7 +392,7 @@ var MatRadioButton = /** @class */ (function (_super) {
391
392
  enumerable: true,
392
393
  configurable: true
393
394
  });
394
- Object.defineProperty(MatRadioButton.prototype, "required", {
395
+ Object.defineProperty(_MatRadioButtonBase.prototype, "required", {
395
396
  /** Whether the radio button is required. */
396
397
  get: function () {
397
398
  return this._required || (this.radioGroup && this.radioGroup.required);
@@ -402,7 +403,7 @@ var MatRadioButton = /** @class */ (function (_super) {
402
403
  enumerable: true,
403
404
  configurable: true
404
405
  });
405
- Object.defineProperty(MatRadioButton.prototype, "color", {
406
+ Object.defineProperty(_MatRadioButtonBase.prototype, "color", {
406
407
  /** Theme color of the radio button. */
407
408
  get: function () {
408
409
  return this._color ||
@@ -413,14 +414,14 @@ var MatRadioButton = /** @class */ (function (_super) {
413
414
  enumerable: true,
414
415
  configurable: true
415
416
  });
416
- Object.defineProperty(MatRadioButton.prototype, "inputId", {
417
+ Object.defineProperty(_MatRadioButtonBase.prototype, "inputId", {
417
418
  /** ID of the native input element inside `<mat-radio-button>` */
418
419
  get: function () { return (this.id || this._uniqueId) + "-input"; },
419
420
  enumerable: true,
420
421
  configurable: true
421
422
  });
422
423
  /** Focuses the radio button. */
423
- MatRadioButton.prototype.focus = function (options) {
424
+ _MatRadioButtonBase.prototype.focus = function (options) {
424
425
  this._focusMonitor.focusVia(this._inputElement, 'keyboard', options);
425
426
  };
426
427
  /**
@@ -428,12 +429,12 @@ var MatRadioButton = /** @class */ (function (_super) {
428
429
  * This method is exposed because the parent radio group will directly
429
430
  * update bound properties of the radio button.
430
431
  */
431
- MatRadioButton.prototype._markForCheck = function () {
432
+ _MatRadioButtonBase.prototype._markForCheck = function () {
432
433
  // When group value changes, the button will not be notified. Use `markForCheck` to explicit
433
434
  // update radio button's status
434
435
  this._changeDetector.markForCheck();
435
436
  };
436
- MatRadioButton.prototype.ngOnInit = function () {
437
+ _MatRadioButtonBase.prototype.ngOnInit = function () {
437
438
  if (this.radioGroup) {
438
439
  // If the radio is inside a radio group, determine if it should be checked
439
440
  this.checked = this.radioGroup.value === this._value;
@@ -441,7 +442,7 @@ var MatRadioButton = /** @class */ (function (_super) {
441
442
  this.name = this.radioGroup.name;
442
443
  }
443
444
  };
444
- MatRadioButton.prototype.ngAfterViewInit = function () {
445
+ _MatRadioButtonBase.prototype.ngAfterViewInit = function () {
445
446
  var _this = this;
446
447
  this._focusMonitor
447
448
  .monitor(this._elementRef, true)
@@ -451,18 +452,18 @@ var MatRadioButton = /** @class */ (function (_super) {
451
452
  }
452
453
  });
453
454
  };
454
- MatRadioButton.prototype.ngOnDestroy = function () {
455
+ _MatRadioButtonBase.prototype.ngOnDestroy = function () {
455
456
  this._focusMonitor.stopMonitoring(this._elementRef);
456
457
  this._removeUniqueSelectionListener();
457
458
  };
458
459
  /** Dispatch change event with current value. */
459
- MatRadioButton.prototype._emitChangeEvent = function () {
460
+ _MatRadioButtonBase.prototype._emitChangeEvent = function () {
460
461
  this.change.emit(new MatRadioChange(this, this._value));
461
462
  };
462
- MatRadioButton.prototype._isRippleDisabled = function () {
463
+ _MatRadioButtonBase.prototype._isRippleDisabled = function () {
463
464
  return this.disableRipple || this.disabled;
464
465
  };
465
- MatRadioButton.prototype._onInputClick = function (event) {
466
+ _MatRadioButtonBase.prototype._onInputClick = function (event) {
466
467
  // We have to stop propagation for click events on the visual hidden input element.
467
468
  // By default, when a user clicks on a label element, a generated click event will be
468
469
  // dispatched on the associated input element. Since we are using a label element as our
@@ -476,7 +477,7 @@ var MatRadioButton = /** @class */ (function (_super) {
476
477
  * Triggered when the radio button received a click or the input recognized any change.
477
478
  * Clicking on a label element, will trigger a change event on the associated input.
478
479
  */
479
- MatRadioButton.prototype._onInputChange = function (event) {
480
+ _MatRadioButtonBase.prototype._onInputChange = function (event) {
480
481
  // We always have to stop propagation on the change event.
481
482
  // Otherwise the change event, from the input element, will bubble up and
482
483
  // emit its event object to the `change` output.
@@ -492,12 +493,50 @@ var MatRadioButton = /** @class */ (function (_super) {
492
493
  }
493
494
  };
494
495
  /** Sets the disabled state and marks for check if a change occurred. */
495
- MatRadioButton.prototype._setDisabled = function (value) {
496
+ _MatRadioButtonBase.prototype._setDisabled = function (value) {
496
497
  if (this._disabled !== value) {
497
498
  this._disabled = value;
498
499
  this._changeDetector.markForCheck();
499
500
  }
500
501
  };
502
+ _MatRadioButtonBase.decorators = [
503
+ { type: Directive }
504
+ ];
505
+ /** @nocollapse */
506
+ _MatRadioButtonBase.ctorParameters = function () { return [
507
+ { type: MatRadioGroup, decorators: [{ type: Optional }] },
508
+ { type: ElementRef },
509
+ { type: ChangeDetectorRef },
510
+ { type: FocusMonitor },
511
+ { type: UniqueSelectionDispatcher },
512
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] },
513
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RADIO_DEFAULT_OPTIONS,] }] }
514
+ ]; };
515
+ _MatRadioButtonBase.propDecorators = {
516
+ id: [{ type: Input }],
517
+ name: [{ type: Input }],
518
+ ariaLabel: [{ type: Input, args: ['aria-label',] }],
519
+ ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
520
+ ariaDescribedby: [{ type: Input, args: ['aria-describedby',] }],
521
+ checked: [{ type: Input }],
522
+ value: [{ type: Input }],
523
+ labelPosition: [{ type: Input }],
524
+ disabled: [{ type: Input }],
525
+ required: [{ type: Input }],
526
+ color: [{ type: Input }],
527
+ change: [{ type: Output }],
528
+ _inputElement: [{ type: ViewChild, args: ['input',] }]
529
+ };
530
+ return _MatRadioButtonBase;
531
+ }(_MatRadioButtonMixinBase));
532
+ /**
533
+ * A Material design radio-button. Typically placed inside of `<mat-radio-group>` elements.
534
+ */
535
+ var MatRadioButton = /** @class */ (function (_super) {
536
+ __extends(MatRadioButton, _super);
537
+ function MatRadioButton() {
538
+ return _super !== null && _super.apply(this, arguments) || this;
539
+ }
501
540
  MatRadioButton.decorators = [
502
541
  { type: Component, args: [{
503
542
  selector: 'mat-radio-button',
@@ -528,33 +567,8 @@ var MatRadioButton = /** @class */ (function (_super) {
528
567
  styles: [".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;height:20px;left:0;position:absolute;top:0;transition:transform ease 280ms,background-color ease 280ms;width:20px;transform:scale(0.001)}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5)}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"]
529
568
  }] }
530
569
  ];
531
- /** @nocollapse */
532
- MatRadioButton.ctorParameters = function () { return [
533
- { type: MatRadioGroup, decorators: [{ type: Optional }] },
534
- { type: ElementRef },
535
- { type: ChangeDetectorRef },
536
- { type: FocusMonitor },
537
- { type: UniqueSelectionDispatcher },
538
- { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] },
539
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RADIO_DEFAULT_OPTIONS,] }] }
540
- ]; };
541
- MatRadioButton.propDecorators = {
542
- id: [{ type: Input }],
543
- name: [{ type: Input }],
544
- ariaLabel: [{ type: Input, args: ['aria-label',] }],
545
- ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
546
- ariaDescribedby: [{ type: Input, args: ['aria-describedby',] }],
547
- checked: [{ type: Input }],
548
- value: [{ type: Input }],
549
- labelPosition: [{ type: Input }],
550
- disabled: [{ type: Input }],
551
- required: [{ type: Input }],
552
- color: [{ type: Input }],
553
- change: [{ type: Output }],
554
- _inputElement: [{ type: ViewChild, args: ['input',] }]
555
- };
556
570
  return MatRadioButton;
557
- }(_MatRadioButtonMixinBase));
571
+ }(_MatRadioButtonBase));
558
572
 
559
573
  /**
560
574
  * @license
@@ -588,5 +602,5 @@ var MatRadioModule = /** @class */ (function () {
588
602
  * Generated bundle index. Do not edit.
589
603
  */
590
604
 
591
- export { MAT_RADIO_DEFAULT_OPTIONS, MAT_RADIO_DEFAULT_OPTIONS_FACTORY, MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, MatRadioButton, MatRadioChange, MatRadioGroup, MatRadioModule };
605
+ export { MAT_RADIO_DEFAULT_OPTIONS, MAT_RADIO_DEFAULT_OPTIONS_FACTORY, MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, MatRadioButton, MatRadioChange, MatRadioGroup, MatRadioModule, _MatRadioButtonBase };
592
606
  //# sourceMappingURL=radio.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio.js","sources":["../../../../../../src/material/radio/radio.ts","../../../../../../src/material/radio/radio-module.ts","../../../../../../src/material/radio/public-api.ts","../../../../../../src/material/radio/index.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 {FocusMonitor} from '@angular/cdk/a11y';\nimport {BooleanInput, 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 static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_required: BooleanInput;\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 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 this._setDisabled(coerceBooleanProperty(value));\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') _inputElement: ElementRef<HTMLInputElement>;\n\n constructor(@Optional() radioGroup: MatRadioGroup,\n elementRef: ElementRef,\n protected _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 /** Sets the disabled state and marks for check if a change occurred. */\n protected _setDisabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._changeDetector.markForCheck();\n }\n }\n\n static ngAcceptInputType_checked: BooleanInput;\n static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_required: BooleanInput;\n static ngAcceptInputType_disableRipple: BooleanInput;\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 {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatRadioButton, MatRadioGroup} from './radio';\n\n\n@NgModule({\n imports: [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\nexport * from './radio-module';\nexport * from './radio';\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;IAkDa,yBAAyB,GACpC,IAAI,cAAc,CAAyB,2BAA2B,EAAE;IACxE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,iCAAiC;CAC3C,CAAC,CAAC;AAEH,SAAgB,iCAAiC;IAC/C,OAAO;QACL,KAAK,EAAE,QAAQ;KAChB,CAAC;CACH;;AAGD,IAAI,YAAY,GAAG,CAAC,CAAC;;;;;;AAOrB,IAAa,sCAAsC,GAAQ;IACzD,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,aAAa,GAAA,CAAC;IAC5C,KAAK,EAAE,IAAI;CACZ,CAAC;;AAGF;IACE;;IAES,MAAsB;;IAEtB,KAAU;QAFV,WAAM,GAAN,MAAM,CAAgB;QAEtB,UAAK,GAAL,KAAK,CAAK;KAAI;IACzB,qBAAC;CAAA,IAAA;AAED;;;AAGA;IA4HE,uBAAoB,eAAkC;QAAlC,oBAAe,GAAf,eAAe,CAAmB;;QAjH9C,WAAM,GAAQ,IAAI,CAAC;;QAGnB,U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AI;wBACjB,mBAAmB,EAAE,MAAM;wBAC3B,wBAAwB,EAAE,MAAM;wBAChC,yBAAyB,EAAE,MAAM;;;;wBAIjC,SAAS,EAAE,qCAAqC;qBACjD;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;;iBAChD;;;;gBAoIqC,aAAa,uBAApC,QAAQ;gBAxdrB,UAAU;gBAJV,iBAAiB;gBAPX,YAAY;gBAEZ,yBAAyB;6CAselB,QAAQ,YAAI,MAAM,SAAC,qBAAqB;gDACtC,QAAQ,YAAI,MAAM,SAAC,yBAAyB;;;qBAnI1D,KAAK;uBAGL,KAAK;4BAGL,KAAK,SAAC,YAAY;iCAGlB,KAAK,SAAC,iBAAiB;kCAGvB,KAAK,SAAC,kBAAkB;0BAGxB,KAAK;wBAwBL,KAAK;gCAkBL,KAAK;2BAUL,KAAK;2BASL,KAAK;wBASL,KAAK;yBAcL,MAAM;gCAwBN,SAAS,SAAC,OAAO;;IAsHpB,qBAAC;CAAA,CAvPmC,wBAAwB;;ACxW5D;;;;;;;AAQA;IAKA;KAK8B;;gBAL7B,QAAQ,SAAC;oBACR,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;oBAC3C,OAAO,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,CAAC;oBACzD,YAAY,EAAE,CAAC,aAAa,EAAE,cAAc,CAAC;iBAC9C;;IAC4B,qBAAC;CAL9B;;ACbA;;;;;;GAMG;;ACNH;;GAEG;;;;"}
1
+ {"version":3,"file":"radio.js","sources":["../../../../../../src/material/radio/radio.ts","../../../../../../src/material/radio/radio-module.ts","../../../../../../src/material/radio/public-api.ts","../../../../../../src/material/radio/index.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 {FocusMonitor} from '@angular/cdk/a11y';\nimport {BooleanInput, 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 static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_required: BooleanInput;\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 * Base class with all of the `MatRadioButton` functionality.\n * @docs-private\n */\n@Directive()\n// tslint:disable-next-line:class-name\nexport abstract class _MatRadioButtonBase extends _MatRadioButtonMixinBase implements OnInit,\n 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 this._setDisabled(coerceBooleanProperty(value));\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') _inputElement: ElementRef<HTMLInputElement>;\n\n constructor(@Optional() radioGroup: MatRadioGroup,\n elementRef: ElementRef,\n protected _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 /** Sets the disabled state and marks for check if a change occurred. */\n protected _setDisabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._changeDetector.markForCheck();\n }\n }\n\n static ngAcceptInputType_checked: BooleanInput;\n static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_required: BooleanInput;\n static ngAcceptInputType_disableRipple: BooleanInput;\n}\n\n\n/**\n * A Material design radio-button. Typically placed inside of `<mat-radio-group>` elements.\n */\n@Component({\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 _MatRadioButtonBase {\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 {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatRadioButton, MatRadioGroup} from './radio';\n\n\n@NgModule({\n imports: [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\nexport * from './radio-module';\nexport * from './radio';\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;IAkDa,yBAAyB,GACpC,IAAI,cAAc,CAAyB,2BAA2B,EAAE;IACxE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,iCAAiC;CAC3C,CAAC,CAAC;AAEH,SAAgB,iCAAiC;IAC/C,OAAO;QACL,KAAK,EAAE,QAAQ;KAChB,CAAC;CACH;;AAGD,IAAI,YAAY,GAAG,CAAC,CAAC;;;;;;AAOrB,IAAa,sCAAsC,GAAQ;IACzD,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,aAAa,GAAA,CAAC;IAC5C,KAAK,EAAE,IAAI;CACZ,CAAC;;AAGF;IACE;;IAES,MAAsB;;IAEtB,KAAU;QAFV,WAAM,GAAN,MAAM,CAAgB;QAEtB,UAAK,GAAL,KAAK,CAAK;KAAI;IACzB,qBAAC;CAAA,IAAA;AAED;;;AAGA;IA4HE,uBAAoB,eAAkC;QAAlC,oBAAe,GAAf,eAAe,CAAmB;;QAjH9C,WAAM,GAAQ,IAAI,CAAC;;QAGnB,UAAK,GAAW,qBAAmB,YAAY,EAAI,CAAC;;QAGpD,cAAS,GAA0B,IAAI,CAAC;;QAGxC,mBAAc,GAAY,KAAK,CAAC;;QAGhC,mBAAc,GAAuB,OAAO,CAAC;;QAG7C,cAAS,GAAY,KAAK,CAAC;;QAG3B,cAAS,GAAY,KAAK,CAAC;;QAGnC,kCAA6B,GAAyB,eAAQ,CAAC;;;;;QAM/D,cAAS,GAAc,eAAQ,CAAC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EAAE,kBAAkB;wBAC3B,2BAA2B,EAAE,SAAS;wBACtC,4BAA4B,EAAE,UAAU;wBACxC,iCAAiC,EAAE,qCAAqC;wBACxE,qBAAqB,EAAE,qBAAqB;wBAC5C,oBAAoB,EAAE,oBAAoB;wBAC1C,kBAAkB,EAAE,kBAAkB;;wBAEtC,iBAAiB,EAAE,IAAI;wBACvB,WAAW,EAAE,IAAI;wBACjB,mBAAmB,EAAE,MAAM;wBAC3B,wBAAwB,EAAE,MAAM;wBAChC,yBAAyB,EAAE,MAAM;;;;wBAIjC,SAAS,EAAE,qCAAqC;qBACjD;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;;iBAChD;;IAED,qBAAC;CAAA,CADmC,mBAAmB;;ACxmBvD;;;;;;;AAQA;IAKA;KAK8B;;gBAL7B,QAAQ,SAAC;oBACR,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;oBAC3C,OAAO,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,CAAC;oBACzD,YAAY,EAAE,CAAC,aAAa,EAAE,cAAc,CAAC;iBAC9C;;IAC4B,qBAAC;CAL9B;;ACbA;;;;;;GAMG;;ACNH;;GAEG;;;;"}
@@ -10,7 +10,6 @@ import { MatOptionHarness, MatOptgroupHarness } from '@angular/material/core/tes
10
10
  * Use of this source code is governed by an MIT-style license that can be
11
11
  * found in the LICENSE file at https://angular.io/license
12
12
  */
13
- var PANEL_SELECTOR = '.mat-select-panel';
14
13
  /** Harness for interacting with a standard mat-select in tests. */
15
14
  var MatSelectHarness = /** @class */ (function (_super) {
16
15
  __extends(MatSelectHarness, _super);
@@ -18,7 +17,6 @@ var MatSelectHarness = /** @class */ (function (_super) {
18
17
  var _this = _super !== null && _super.apply(this, arguments) || this;
19
18
  _this._documentRootLocator = _this.documentRootLocatorFactory();
20
19
  _this._backdrop = _this._documentRootLocator.locatorFor('.cdk-overlay-backdrop');
21
- _this._optionalPanel = _this._documentRootLocator.locatorForOptional(PANEL_SELECTOR);
22
20
  _this._trigger = _this.locatorFor('.mat-select-trigger');
23
21
  _this._value = _this.locatorFor('.mat-select-value');
24
22
  return _this;
@@ -130,8 +128,17 @@ var MatSelectHarness = /** @class */ (function (_super) {
130
128
  MatSelectHarness.prototype.getOptions = function (filter) {
131
129
  if (filter === void 0) { filter = {}; }
132
130
  return __awaiter(this, void 0, void 0, function () {
133
- return __generator(this, function (_a) {
134
- return [2 /*return*/, this._documentRootLocator.locatorForAll(MatOptionHarness.with(__assign(__assign({}, filter), { ancestor: PANEL_SELECTOR })))()];
131
+ var _a, _b, _c, _d, _e, _f;
132
+ return __generator(this, function (_g) {
133
+ switch (_g.label) {
134
+ case 0:
135
+ _b = (_a = this._documentRootLocator).locatorForAll;
136
+ _d = (_c = MatOptionHarness).with;
137
+ _e = [__assign({}, filter)];
138
+ _f = {};
139
+ return [4 /*yield*/, this._getPanelSelector()];
140
+ case 1: return [2 /*return*/, _b.apply(_a, [_d.apply(_c, [__assign.apply(void 0, _e.concat([(_f.ancestor = _g.sent(), _f)]))])])()];
141
+ }
135
142
  });
136
143
  });
137
144
  };
@@ -139,18 +146,31 @@ var MatSelectHarness = /** @class */ (function (_super) {
139
146
  MatSelectHarness.prototype.getOptionGroups = function (filter) {
140
147
  if (filter === void 0) { filter = {}; }
141
148
  return __awaiter(this, void 0, void 0, function () {
142
- return __generator(this, function (_a) {
143
- return [2 /*return*/, this._documentRootLocator.locatorForAll(MatOptgroupHarness.with(__assign(__assign({}, filter), { ancestor: PANEL_SELECTOR })))()];
149
+ var _a, _b, _c, _d, _e, _f;
150
+ return __generator(this, function (_g) {
151
+ switch (_g.label) {
152
+ case 0:
153
+ _b = (_a = this._documentRootLocator).locatorForAll;
154
+ _d = (_c = MatOptgroupHarness).with;
155
+ _e = [__assign({}, filter)];
156
+ _f = {};
157
+ return [4 /*yield*/, this._getPanelSelector()];
158
+ case 1: return [2 /*return*/, _b.apply(_a, [_d.apply(_c, [__assign.apply(void 0, _e.concat([(_f.ancestor = _g.sent(), _f)]))])])()];
159
+ }
144
160
  });
145
161
  });
146
162
  };
147
163
  /** Gets whether the select is open. */
148
164
  MatSelectHarness.prototype.isOpen = function () {
149
165
  return __awaiter(this, void 0, void 0, function () {
150
- return __generator(this, function (_a) {
151
- switch (_a.label) {
152
- case 0: return [4 /*yield*/, this._optionalPanel()];
153
- case 1: return [2 /*return*/, !!(_a.sent())];
166
+ var _a, _b;
167
+ return __generator(this, function (_c) {
168
+ switch (_c.label) {
169
+ case 0:
170
+ _b = (_a = this._documentRootLocator).locatorForOptional;
171
+ return [4 /*yield*/, this._getPanelSelector()];
172
+ case 1: return [4 /*yield*/, _b.apply(_a, [_c.sent()])()];
173
+ case 2: return [2 /*return*/, !!(_c.sent())];
154
174
  }
155
175
  });
156
176
  });
@@ -222,6 +242,21 @@ var MatSelectHarness = /** @class */ (function (_super) {
222
242
  });
223
243
  });
224
244
  };
245
+ /** Gets the selector that should be used to find this select's panel. */
246
+ MatSelectHarness.prototype._getPanelSelector = function () {
247
+ return __awaiter(this, void 0, void 0, function () {
248
+ var id;
249
+ return __generator(this, function (_a) {
250
+ switch (_a.label) {
251
+ case 0: return [4 /*yield*/, this.host()];
252
+ case 1: return [4 /*yield*/, (_a.sent()).getAttribute('id')];
253
+ case 2:
254
+ id = _a.sent();
255
+ return [2 /*return*/, "#" + id + "-panel"];
256
+ }
257
+ });
258
+ });
259
+ };
225
260
  MatSelectHarness.hostSelector = '.mat-select';
226
261
  return MatSelectHarness;
227
262
  }(MatFormFieldControlHarness));
@@ -1 +1 @@
1
- {"version":3,"file":"select__testing.js","sources":["../../../../../../../src/material/select/testing/select-harness.ts","../../../../../../../src/material/select/testing/public-api.ts","../../../../../../../src/material/select/testing/index.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 {HarnessPredicate} from '@angular/cdk/testing';\nimport {MatFormFieldControlHarness} from '@angular/material/form-field/testing/control';\nimport {\n MatOptionHarness,\n MatOptgroupHarness,\n OptionHarnessFilters,\n OptgroupHarnessFilters,\n} from '@angular/material/core/testing';\nimport {SelectHarnessFilters} from './select-harness-filters';\n\nconst PANEL_SELECTOR = '.mat-select-panel';\n\n/** Harness for interacting with a standard mat-select in tests. */\nexport class MatSelectHarness extends MatFormFieldControlHarness {\n private _documentRootLocator = this.documentRootLocatorFactory();\n private _backdrop = this._documentRootLocator.locatorFor('.cdk-overlay-backdrop');\n private _optionalPanel = this._documentRootLocator.locatorForOptional(PANEL_SELECTOR);\n private _trigger = this.locatorFor('.mat-select-trigger');\n private _value = this.locatorFor('.mat-select-value');\n\n static hostSelector = '.mat-select';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatSelectHarness` that meets\n * certain criteria.\n * @param options Options for filtering which select instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: SelectHarnessFilters = {}): HarnessPredicate<MatSelectHarness> {\n return new HarnessPredicate(MatSelectHarness, options);\n }\n\n /** Gets a boolean promise indicating if the select is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).hasClass('mat-select-disabled');\n }\n\n /** Gets a boolean promise indicating if the select is valid. */\n async isValid(): Promise<boolean> {\n return !(await (await this.host()).hasClass('ng-invalid'));\n }\n\n /** Gets a boolean promise indicating if the select is required. */\n async isRequired(): Promise<boolean> {\n return (await this.host()).hasClass('mat-select-required');\n }\n\n /** Gets a boolean promise indicating if the select is empty (no value is selected). */\n async isEmpty(): Promise<boolean> {\n return (await this.host()).hasClass('mat-select-empty');\n }\n\n /** Gets a boolean promise indicating if the select is in multi-selection mode. */\n async isMultiple(): Promise<boolean> {\n const ariaMultiselectable = (await this.host()).getAttribute('aria-multiselectable');\n return (await ariaMultiselectable) === 'true';\n }\n\n /** Gets a promise for the select's value text. */\n async getValueText(): Promise<string> {\n return (await this._value()).text();\n }\n\n /** Focuses the select and returns a void promise that indicates when the action is complete. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the select and returns a void promise that indicates when the action is complete. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Gets the options inside the select panel. */\n async getOptions(filter: Omit<OptionHarnessFilters, 'ancestor'> = {}):\n Promise<MatOptionHarness[]> {\n return this._documentRootLocator.locatorForAll(MatOptionHarness.with({\n ...filter,\n ancestor: PANEL_SELECTOR\n }))();\n }\n\n /** Gets the groups of options inside the panel. */\n async getOptionGroups(filter: Omit<OptgroupHarnessFilters, 'ancestor'> = {}):\n Promise<MatOptgroupHarness[]> {\n return this._documentRootLocator.locatorForAll(MatOptgroupHarness.with({\n ...filter,\n ancestor: PANEL_SELECTOR\n }))();\n }\n\n /** Gets whether the select is open. */\n async isOpen(): Promise<boolean> {\n return !!(await this._optionalPanel());\n }\n\n /** Opens the select's panel. */\n async open(): Promise<void> {\n if (!await this.isOpen()) {\n return (await this._trigger()).click();\n }\n }\n\n /**\n * Clicks the options that match the passed-in filter. If the select is in multi-selection\n * mode all options will be clicked, otherwise the harness will pick the first matching option.\n */\n async clickOptions(filter: OptionHarnessFilters = {}): Promise<void> {\n await this.open();\n\n const [isMultiple, options] = await Promise.all([this.isMultiple(), this.getOptions(filter)]);\n\n if (options.length === 0) {\n throw Error('Select does not have options matching the specified filter');\n }\n\n if (isMultiple) {\n await Promise.all(options.map(option => option.click()));\n } else {\n await options[0].click();\n }\n }\n\n /** Closes the select's panel. */\n async close(): Promise<void> {\n if (await this.isOpen()) {\n // This is the most consistent way that works both in both single and multi-select modes,\n // but it assumes that only one overlay is open at a time. We should be able to make it\n // a bit more precise after #16645 where we can dispatch an ESCAPE press to the host instead.\n return (await this._backdrop()).click();\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\nexport * from './select-harness';\nexport * from './select-harness-filters';\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\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;AAkBA,IAAM,cAAc,GAAG,mBAAmB,CAAC;;AAG3C;IAAsC,oCAA0B;IAAhE;QAAA,qEAuHC;QAtHS,0BAAoB,GAAG,KAAI,CAAC,0BAA0B,EAAE,CAAC;QACzD,eAAS,GAAG,KAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;QAC1E,oBAAc,GAAG,KAAI,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;QAC9E,cAAQ,GAAG,KAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;QAClD,YAAM,GAAG,KAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;;KAkHvD;;;;;;;IAxGQ,qBAAI,GAAX,UAAY,OAAkC;QAAlC,wBAAA,EAAA,YAAkC;QAC5C,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;KACxD;;IAGK,qCAAU,GAAhB;;;;4BACU,qBAAM,IAAI,CAAC,IAAI,EAAE,EAAA;4BAAzB,sBAAO,CAAC,SAAiB,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EAAC;;;;KAC5D;;IAGK,kCAAO,GAAb;;;;4BACkB,qBAAM,IAAI,CAAC,IAAI,EAAE,EAAA;4BAAxB,qBAAM,CAAC,SAAiB,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAA;4BAAzD,sBAAO,EAAE,SAAgD,CAAC,EAAC;;;;KAC5D;;IAGK,qCAAU,GAAhB;;;;4BACU,qBAAM,IAAI,CAAC,IAAI,EAAE,EAAA;4BAAzB,sBAAO,CAAC,SAAiB,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EAAC;;;;KAC5D;;IAGK,kCAAO,GAAb;;;;4BACU,qBAAM,IAAI,CAAC,IAAI,EAA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AA,CAvHqC,0BAA0B;;ACrBhE;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
1
+ {"version":3,"file":"select__testing.js","sources":["../../../../../../../src/material/select/testing/select-harness.ts","../../../../../../../src/material/select/testing/public-api.ts","../../../../../../../src/material/select/testing/index.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 {HarnessPredicate} from '@angular/cdk/testing';\nimport {MatFormFieldControlHarness} from '@angular/material/form-field/testing/control';\nimport {\n MatOptionHarness,\n MatOptgroupHarness,\n OptionHarnessFilters,\n OptgroupHarnessFilters,\n} from '@angular/material/core/testing';\nimport {SelectHarnessFilters} from './select-harness-filters';\n\n\n/** Harness for interacting with a standard mat-select in tests. */\nexport class MatSelectHarness extends MatFormFieldControlHarness {\n private _documentRootLocator = this.documentRootLocatorFactory();\n private _backdrop = this._documentRootLocator.locatorFor('.cdk-overlay-backdrop');\n private _trigger = this.locatorFor('.mat-select-trigger');\n private _value = this.locatorFor('.mat-select-value');\n\n static hostSelector = '.mat-select';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatSelectHarness` that meets\n * certain criteria.\n * @param options Options for filtering which select instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: SelectHarnessFilters = {}): HarnessPredicate<MatSelectHarness> {\n return new HarnessPredicate(MatSelectHarness, options);\n }\n\n /** Gets a boolean promise indicating if the select is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).hasClass('mat-select-disabled');\n }\n\n /** Gets a boolean promise indicating if the select is valid. */\n async isValid(): Promise<boolean> {\n return !(await (await this.host()).hasClass('ng-invalid'));\n }\n\n /** Gets a boolean promise indicating if the select is required. */\n async isRequired(): Promise<boolean> {\n return (await this.host()).hasClass('mat-select-required');\n }\n\n /** Gets a boolean promise indicating if the select is empty (no value is selected). */\n async isEmpty(): Promise<boolean> {\n return (await this.host()).hasClass('mat-select-empty');\n }\n\n /** Gets a boolean promise indicating if the select is in multi-selection mode. */\n async isMultiple(): Promise<boolean> {\n const ariaMultiselectable = (await this.host()).getAttribute('aria-multiselectable');\n return (await ariaMultiselectable) === 'true';\n }\n\n /** Gets a promise for the select's value text. */\n async getValueText(): Promise<string> {\n return (await this._value()).text();\n }\n\n /** Focuses the select and returns a void promise that indicates when the action is complete. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the select and returns a void promise that indicates when the action is complete. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Gets the options inside the select panel. */\n async getOptions(filter: Omit<OptionHarnessFilters, 'ancestor'> = {}):\n Promise<MatOptionHarness[]> {\n return this._documentRootLocator.locatorForAll(MatOptionHarness.with({\n ...filter,\n ancestor: await this._getPanelSelector()\n }))();\n }\n\n /** Gets the groups of options inside the panel. */\n async getOptionGroups(filter: Omit<OptgroupHarnessFilters, 'ancestor'> = {}):\n Promise<MatOptgroupHarness[]> {\n return this._documentRootLocator.locatorForAll(MatOptgroupHarness.with({\n ...filter,\n ancestor: await this._getPanelSelector()\n }))();\n }\n\n /** Gets whether the select is open. */\n async isOpen(): Promise<boolean> {\n return !!await this._documentRootLocator.locatorForOptional(await this._getPanelSelector())();\n }\n\n /** Opens the select's panel. */\n async open(): Promise<void> {\n if (!await this.isOpen()) {\n return (await this._trigger()).click();\n }\n }\n\n /**\n * Clicks the options that match the passed-in filter. If the select is in multi-selection\n * mode all options will be clicked, otherwise the harness will pick the first matching option.\n */\n async clickOptions(filter: OptionHarnessFilters = {}): Promise<void> {\n await this.open();\n\n const [isMultiple, options] = await Promise.all([this.isMultiple(), this.getOptions(filter)]);\n\n if (options.length === 0) {\n throw Error('Select does not have options matching the specified filter');\n }\n\n if (isMultiple) {\n await Promise.all(options.map(option => option.click()));\n } else {\n await options[0].click();\n }\n }\n\n /** Closes the select's panel. */\n async close(): Promise<void> {\n if (await this.isOpen()) {\n // This is the most consistent way that works both in both single and multi-select modes,\n // but it assumes that only one overlay is open at a time. We should be able to make it\n // a bit more precise after #16645 where we can dispatch an ESCAPE press to the host instead.\n return (await this._backdrop()).click();\n }\n }\n\n /** Gets the selector that should be used to find this select's panel. */\n private async _getPanelSelector(): Promise<string> {\n const id = await (await this.host()).getAttribute('id');\n return `#${id}-panel`;\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\nexport * from './select-harness';\nexport * from './select-harness-filters';\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\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;AAmBA;AACA;IAAsC,oCAA0B;IAAhE;QAAA,qEA4HC;QA3HS,0BAAoB,GAAG,KAAI,CAAC,0BAA0B,EAAE,CAAC;QACzD,eAAS,GAAG,KAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;QAC1E,cAAQ,GAAG,KAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;QAClD,YAAM,GAAG,KAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;;KAwHvD;;;;;;;IA9GQ,qBAAI,GAAX,UAAY,OAAkC;QAAlC,wBAAA,EAAA,YAAkC;QAC5C,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;KACxD;;IAGK,qCAAU,GAAhB;;;;4BACU,qBAAM,IAAI,CAAC,IAAI,EAAE,EAAA;4BAAzB,sBAAO,CAAC,SAAiB,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EAAC;;;;KAC5D;;IAGK,kCAAO,GAAb;;;;4BACkB,qBAAM,IAAI,CAAC,IAAI,EAAE,EAAA;4BAAxB,qBAAM,CAAC,SAAiB,EAAE,QAAQ,CAAC,YAA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AAO,CAAC,MAAM,KAAK,CAAC,EAAE;4BACxB,MAAM,KAAK,CAAC,4DAA4D,CAAC,CAAC;yBAC3E;6BAEG,UAAU,EAAV,wBAAU;wBACZ,qBAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,UAAA,MAAM,IAAI,OAAA,MAAM,CAAC,KAAK,EAAE,GAAA,CAAC,CAAC,EAAA;;wBAAxD,SAAwD,CAAC;;4BAEzD,qBAAM,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAA;;wBAAxB,SAAwB,CAAC;;;;;;KAE5B;;IAGK,gCAAK,GAAX;;;;4BACM,qBAAM,IAAI,CAAC,MAAM,EAAE,EAAA;;6BAAnB,SAAmB,EAAnB,wBAAmB;wBAIb,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;;;;oBAA9B,sBAAO,CAAC,SAAsB,EAAE,KAAK,EAAE,EAAC;;;;;KAE3C;;IAGa,4CAAiB,GAA/B;;;;;4BACoB,qBAAM,IAAI,CAAC,IAAI,EAAE,EAAA;4BAAxB,qBAAM,CAAC,SAAiB,EAAE,YAAY,CAAC,IAAI,CAAC,EAAA;;wBAAjD,EAAE,GAAG,SAA4C;wBACvD,sBAAO,MAAI,EAAE,WAAQ,EAAC;;;;KACvB;IArHM,6BAAY,GAAG,aAAa,CAAC;IAsHtC,uBAAC;CAAA,CA5HqC,0BAA0B;;ACpBhE;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
package/fesm5/select.js CHANGED
@@ -3,13 +3,13 @@ import { CommonModule } from '@angular/common';
3
3
  import { InjectionToken, Directive, EventEmitter, isDevMode, Component, ViewEncapsulation, ChangeDetectionStrategy, ChangeDetectorRef, NgZone, ElementRef, Optional, Inject, Self, Attribute, ViewChild, ContentChildren, Input, ContentChild, Output, NgModule } from '@angular/core';
4
4
  import { mixinDisableRipple, mixinTabIndex, mixinDisabled, mixinErrorState, _countGroupLabelsBeforeOption, _getOptionScrollPosition, MAT_OPTION_PARENT_COMPONENT, ErrorStateMatcher, MatOption, MatOptgroup, MatOptionModule, MatCommonModule } from '@angular/material/core';
5
5
  import { MatFormFieldControl, MatFormField, MAT_FORM_FIELD, MatFormFieldModule } from '@angular/material/form-field';
6
+ import { ViewportRuler, CdkScrollableModule } from '@angular/cdk/scrolling';
6
7
  import { __extends, __spread } from 'tslib';
7
8
  import { ActiveDescendantKeyManager, LiveAnnouncer } from '@angular/cdk/a11y';
8
9
  import { Directionality } from '@angular/cdk/bidi';
9
10
  import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
10
11
  import { SelectionModel } from '@angular/cdk/collections';
11
12
  import { DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW, ENTER, SPACE, hasModifierKey, HOME, END, A } from '@angular/cdk/keycodes';
12
- import { ViewportRuler } from '@angular/cdk/scrolling';
13
13
  import { NgForm, FormGroupDirective, NgControl } from '@angular/forms';
14
14
  import { Subject, defer, merge } from 'rxjs';
15
15
  import { startWith, switchMap, take, filter, map, distinctUntilChanged, takeUntil } from 'rxjs/operators';
@@ -772,15 +772,17 @@ var MatSelect = /** @class */ (function (_super) {
772
772
  .withHorizontalOrientation(this._isRtl() ? 'rtl' : 'ltr')
773
773
  .withAllowedModifierKeys(['shiftKey']);
774
774
  this._keyManager.tabOut.pipe(takeUntil(this._destroy)).subscribe(function () {
775
- // Select the active item when tabbing away. This is consistent with how the native
776
- // select behaves. Note that we only want to do this in single selection mode.
777
- if (!_this.multiple && _this._keyManager.activeItem) {
778
- _this._keyManager.activeItem._selectViaInteraction();
775
+ if (_this.panelOpen) {
776
+ // Select the active item when tabbing away. This is consistent with how the native
777
+ // select behaves. Note that we only want to do this in single selection mode.
778
+ if (!_this.multiple && _this._keyManager.activeItem) {
779
+ _this._keyManager.activeItem._selectViaInteraction();
780
+ }
781
+ // Restore focus to the trigger before closing. Ensures that the focus
782
+ // position won't be lost if the user got focus into the overlay.
783
+ _this.focus();
784
+ _this.close();
779
785
  }
780
- // Restore focus to the trigger before closing. Ensures that the focus
781
- // position won't be lost if the user got focus into the overlay.
782
- _this.focus();
783
- _this.close();
784
786
  });
785
787
  this._keyManager.change.pipe(takeUntil(this._destroy)).subscribe(function () {
786
788
  if (_this._panelOpen && _this.panel) {
@@ -1158,7 +1160,7 @@ var MatSelect = /** @class */ (function (_super) {
1158
1160
  { type: Component, args: [{
1159
1161
  selector: 'mat-select',
1160
1162
  exportAs: 'matSelect',
1161
- template: "<div cdk-overlay-origin\n class=\"mat-select-trigger\"\n aria-hidden=\"true\"\n (click)=\"toggle()\"\n #origin=\"cdkOverlayOrigin\"\n #trigger>\n <div class=\"mat-select-value\" [ngSwitch]=\"empty\">\n <span class=\"mat-select-placeholder\" *ngSwitchCase=\"true\">{{placeholder || '\\u00A0'}}</span>\n <span class=\"mat-select-value-text\" *ngSwitchCase=\"false\" [ngSwitch]=\"!!customTrigger\">\n <span *ngSwitchDefault>{{triggerValue || '\\u00A0'}}</span>\n <ng-content select=\"mat-select-trigger\" *ngSwitchCase=\"true\"></ng-content>\n </span>\n </div>\n\n <div class=\"mat-select-arrow-wrapper\"><div class=\"mat-select-arrow\"></div></div>\n</div>\n\n<ng-template\n cdk-connected-overlay\n cdkConnectedOverlayLockPosition\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayScrollStrategy]=\"_scrollStrategy\"\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayPositions]=\"_positions\"\n [cdkConnectedOverlayMinWidth]=\"_triggerRect?.width\"\n [cdkConnectedOverlayOffsetY]=\"_offsetY\"\n (backdropClick)=\"close()\"\n (attach)=\"_onAttached()\"\n (detach)=\"close()\">\n <div class=\"mat-select-panel-wrap\" [@transformPanelWrap]>\n <div\n #panel\n class=\"mat-select-panel {{ _getPanelTheme() }}\"\n [ngClass]=\"panelClass\"\n [@transformPanel]=\"multiple ? 'showing-multiple' : 'showing'\"\n (@transformPanel.done)=\"_panelDoneAnimatingStream.next($event.toState)\"\n [style.transformOrigin]=\"_transformOrigin\"\n [style.font-size.px]=\"_triggerFontSize\"\n (keydown)=\"_handleKeydown($event)\">\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>\n",
1163
+ template: "<div cdk-overlay-origin\n class=\"mat-select-trigger\"\n aria-hidden=\"true\"\n (click)=\"toggle()\"\n #origin=\"cdkOverlayOrigin\"\n #trigger>\n <div class=\"mat-select-value\" [ngSwitch]=\"empty\">\n <span class=\"mat-select-placeholder\" *ngSwitchCase=\"true\">{{placeholder || '\\u00A0'}}</span>\n <span class=\"mat-select-value-text\" *ngSwitchCase=\"false\" [ngSwitch]=\"!!customTrigger\">\n <span *ngSwitchDefault>{{triggerValue || '\\u00A0'}}</span>\n <ng-content select=\"mat-select-trigger\" *ngSwitchCase=\"true\"></ng-content>\n </span>\n </div>\n\n <div class=\"mat-select-arrow-wrapper\"><div class=\"mat-select-arrow\"></div></div>\n</div>\n\n<ng-template\n cdk-connected-overlay\n cdkConnectedOverlayLockPosition\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayScrollStrategy]=\"_scrollStrategy\"\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayPositions]=\"_positions\"\n [cdkConnectedOverlayMinWidth]=\"_triggerRect?.width\"\n [cdkConnectedOverlayOffsetY]=\"_offsetY\"\n (backdropClick)=\"close()\"\n (attach)=\"_onAttached()\"\n (detach)=\"close()\">\n <div class=\"mat-select-panel-wrap\" [@transformPanelWrap]>\n <div\n #panel\n [attr.id]=\"id + '-panel'\"\n class=\"mat-select-panel {{ _getPanelTheme() }}\"\n [ngClass]=\"panelClass\"\n [@transformPanel]=\"multiple ? 'showing-multiple' : 'showing'\"\n (@transformPanel.done)=\"_panelDoneAnimatingStream.next($event.toState)\"\n [style.transformOrigin]=\"_transformOrigin\"\n [style.font-size.px]=\"_triggerFontSize\"\n (keydown)=\"_handleKeydown($event)\">\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>\n",
1162
1164
  inputs: ['disabled', 'disableRipple', 'tabIndex'],
1163
1165
  encapsulation: ViewEncapsulation.None,
1164
1166
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -1259,7 +1261,14 @@ var MatSelectModule = /** @class */ (function () {
1259
1261
  MatOptionModule,
1260
1262
  MatCommonModule,
1261
1263
  ],
1262
- exports: [MatFormFieldModule, MatSelect, MatSelectTrigger, MatOptionModule, MatCommonModule],
1264
+ exports: [
1265
+ CdkScrollableModule,
1266
+ MatFormFieldModule,
1267
+ MatSelect,
1268
+ MatSelectTrigger,
1269
+ MatOptionModule,
1270
+ MatCommonModule
1271
+ ],
1263
1272
  declarations: [MatSelect, MatSelectTrigger],
1264
1273
  providers: [MAT_SELECT_SCROLL_STRATEGY_PROVIDER]
1265
1274
  },] }