@angular/material 10.0.2 → 10.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (521) hide show
  1. package/_theming.scss +14 -9
  2. package/autocomplete/index.metadata.json +1 -1
  3. package/autocomplete/testing/autocomplete-harness.d.ts +2 -0
  4. package/bundles/material-autocomplete-testing.umd.js +327 -248
  5. package/bundles/material-autocomplete-testing.umd.js.map +1 -1
  6. package/bundles/material-autocomplete-testing.umd.min.js +2 -9
  7. package/bundles/material-autocomplete-testing.umd.min.js.map +1 -1
  8. package/bundles/material-autocomplete.umd.js +421 -355
  9. package/bundles/material-autocomplete.umd.js.map +1 -1
  10. package/bundles/material-autocomplete.umd.min.js +2 -24
  11. package/bundles/material-autocomplete.umd.min.js.map +1 -1
  12. package/bundles/material-badge-testing.umd.js +301 -235
  13. package/bundles/material-badge-testing.umd.js.map +1 -1
  14. package/bundles/material-badge-testing.umd.min.js +2 -9
  15. package/bundles/material-badge-testing.umd.min.js.map +1 -1
  16. package/bundles/material-badge.umd.js +344 -278
  17. package/bundles/material-badge.umd.js.map +1 -1
  18. package/bundles/material-badge.umd.min.js +3 -3
  19. package/bundles/material-badge.umd.min.js.map +1 -1
  20. package/bundles/material-bottom-sheet-testing.umd.js +302 -236
  21. package/bundles/material-bottom-sheet-testing.umd.js.map +1 -1
  22. package/bundles/material-bottom-sheet-testing.umd.min.js +2 -9
  23. package/bundles/material-bottom-sheet-testing.umd.min.js.map +1 -1
  24. package/bundles/material-bottom-sheet.umd.js +361 -288
  25. package/bundles/material-bottom-sheet.umd.js.map +1 -1
  26. package/bundles/material-bottom-sheet.umd.min.js +17 -2
  27. package/bundles/material-bottom-sheet.umd.min.js.map +1 -1
  28. package/bundles/material-button-testing.umd.js +321 -244
  29. package/bundles/material-button-testing.umd.js.map +1 -1
  30. package/bundles/material-button-testing.umd.min.js +2 -9
  31. package/bundles/material-button-testing.umd.min.js.map +1 -1
  32. package/bundles/material-button-toggle-testing.umd.js +315 -245
  33. package/bundles/material-button-toggle-testing.umd.js.map +1 -1
  34. package/bundles/material-button-toggle-testing.umd.min.js +3 -17
  35. package/bundles/material-button-toggle-testing.umd.min.js.map +1 -1
  36. package/bundles/material-button-toggle.umd.js +394 -318
  37. package/bundles/material-button-toggle.umd.js.map +1 -1
  38. package/bundles/material-button-toggle.umd.min.js +2 -10
  39. package/bundles/material-button-toggle.umd.min.js.map +1 -1
  40. package/bundles/material-button.umd.js +375 -304
  41. package/bundles/material-button.umd.js.map +1 -1
  42. package/bundles/material-button.umd.min.js +3 -11
  43. package/bundles/material-button.umd.min.js.map +1 -1
  44. package/bundles/material-card-testing.umd.js +399 -0
  45. package/bundles/material-card-testing.umd.js.map +1 -0
  46. package/bundles/material-card-testing.umd.min.js +37 -0
  47. package/bundles/material-card-testing.umd.min.js.map +1 -0
  48. package/bundles/material-card.umd.js +139 -139
  49. package/bundles/material-card.umd.js.map +1 -1
  50. package/bundles/material-card.umd.min.js +2 -2
  51. package/bundles/material-card.umd.min.js.map +1 -1
  52. package/bundles/material-checkbox-testing.umd.js +313 -236
  53. package/bundles/material-checkbox-testing.umd.js.map +1 -1
  54. package/bundles/material-checkbox-testing.umd.min.js +2 -9
  55. package/bundles/material-checkbox-testing.umd.min.js.map +1 -1
  56. package/bundles/material-checkbox.umd.js +370 -311
  57. package/bundles/material-checkbox.umd.js.map +1 -1
  58. package/bundles/material-checkbox.umd.min.js +2 -9
  59. package/bundles/material-checkbox.umd.min.js.map +1 -1
  60. package/bundles/material-chips.umd.js +625 -542
  61. package/bundles/material-chips.umd.js.map +1 -1
  62. package/bundles/material-chips.umd.min.js +19 -4
  63. package/bundles/material-chips.umd.min.js.map +1 -1
  64. package/bundles/material-core-testing.umd.js +304 -245
  65. package/bundles/material-core-testing.umd.js.map +1 -1
  66. package/bundles/material-core-testing.umd.min.js +3 -17
  67. package/bundles/material-core-testing.umd.min.js.map +1 -1
  68. package/bundles/material-core.umd.js +563 -510
  69. package/bundles/material-core.umd.js.map +1 -1
  70. package/bundles/material-core.umd.min.js +37 -12
  71. package/bundles/material-core.umd.min.js.map +1 -1
  72. package/bundles/material-datepicker.umd.js +935 -880
  73. package/bundles/material-datepicker.umd.js.map +1 -1
  74. package/bundles/material-datepicker.umd.min.js +44 -10
  75. package/bundles/material-datepicker.umd.min.js.map +1 -1
  76. package/bundles/material-dialog-testing.umd.js +303 -237
  77. package/bundles/material-dialog-testing.umd.js.map +1 -1
  78. package/bundles/material-dialog-testing.umd.min.js +2 -9
  79. package/bundles/material-dialog-testing.umd.min.js.map +1 -1
  80. package/bundles/material-dialog.umd.js +438 -376
  81. package/bundles/material-dialog.umd.js.map +1 -1
  82. package/bundles/material-dialog.umd.min.js +15 -14
  83. package/bundles/material-dialog.umd.min.js.map +1 -1
  84. package/bundles/material-divider-testing.umd.js +300 -234
  85. package/bundles/material-divider-testing.umd.js.map +1 -1
  86. package/bundles/material-divider-testing.umd.min.js +2 -9
  87. package/bundles/material-divider-testing.umd.min.js.map +1 -1
  88. package/bundles/material-divider.umd.js +28 -28
  89. package/bundles/material-divider.umd.js.map +1 -1
  90. package/bundles/material-divider.umd.min.js +2 -9
  91. package/bundles/material-divider.umd.min.js.map +1 -1
  92. package/bundles/material-expansion-testing.umd.js +314 -246
  93. package/bundles/material-expansion-testing.umd.js.map +1 -1
  94. package/bundles/material-expansion-testing.umd.min.js +2 -10
  95. package/bundles/material-expansion-testing.umd.min.js.map +1 -1
  96. package/bundles/material-expansion.umd.js +459 -400
  97. package/bundles/material-expansion.umd.js.map +1 -1
  98. package/bundles/material-expansion.umd.min.js +11 -3
  99. package/bundles/material-expansion.umd.min.js.map +1 -1
  100. package/bundles/material-form-field-testing-control.umd.js +299 -233
  101. package/bundles/material-form-field-testing-control.umd.js.map +1 -1
  102. package/bundles/material-form-field-testing-control.umd.min.js.map +1 -1
  103. package/bundles/material-form-field-testing.umd.js +301 -235
  104. package/bundles/material-form-field-testing.umd.js.map +1 -1
  105. package/bundles/material-form-field-testing.umd.min.js +3 -10
  106. package/bundles/material-form-field-testing.umd.min.js.map +1 -1
  107. package/bundles/material-form-field.umd.js +493 -406
  108. package/bundles/material-form-field.umd.js.map +1 -1
  109. package/bundles/material-form-field.umd.min.js +36 -5
  110. package/bundles/material-form-field.umd.min.js.map +1 -1
  111. package/bundles/material-grid-list-testing.umd.js +311 -252
  112. package/bundles/material-grid-list-testing.umd.js.map +1 -1
  113. package/bundles/material-grid-list-testing.umd.min.js +2 -17
  114. package/bundles/material-grid-list-testing.umd.min.js.map +1 -1
  115. package/bundles/material-grid-list.umd.js +409 -336
  116. package/bundles/material-grid-list.umd.js.map +1 -1
  117. package/bundles/material-grid-list.umd.min.js +19 -4
  118. package/bundles/material-grid-list.umd.min.js.map +1 -1
  119. package/bundles/material-icon-testing.umd.js +8 -8
  120. package/bundles/material-icon-testing.umd.js.map +1 -1
  121. package/bundles/material-icon-testing.umd.min.js +2 -2
  122. package/bundles/material-icon-testing.umd.min.js.map +1 -1
  123. package/bundles/material-icon.umd.js +349 -283
  124. package/bundles/material-icon.umd.js.map +1 -1
  125. package/bundles/material-icon.umd.min.js +2 -9
  126. package/bundles/material-icon.umd.min.js.map +1 -1
  127. package/bundles/material-input-testing.umd.js +326 -243
  128. package/bundles/material-input-testing.umd.js.map +1 -1
  129. package/bundles/material-input-testing.umd.min.js +2 -9
  130. package/bundles/material-input-testing.umd.min.js.map +1 -1
  131. package/bundles/material-input.umd.js +409 -326
  132. package/bundles/material-input.umd.js.map +1 -1
  133. package/bundles/material-input.umd.min.js +5 -19
  134. package/bundles/material-input.umd.min.js.map +1 -1
  135. package/bundles/material-list-testing.umd.js +366 -303
  136. package/bundles/material-list-testing.umd.js.map +1 -1
  137. package/bundles/material-list-testing.umd.min.js +2 -2
  138. package/bundles/material-list-testing.umd.min.js.map +1 -1
  139. package/bundles/material-list.umd.js +492 -433
  140. package/bundles/material-list.umd.js.map +1 -1
  141. package/bundles/material-list.umd.min.js +2 -10
  142. package/bundles/material-list.umd.min.js.map +1 -1
  143. package/bundles/material-menu-testing.umd.js +327 -239
  144. package/bundles/material-menu-testing.umd.js.map +1 -1
  145. package/bundles/material-menu-testing.umd.min.js +2 -10
  146. package/bundles/material-menu-testing.umd.min.js.map +1 -1
  147. package/bundles/material-menu.umd.js +483 -408
  148. package/bundles/material-menu.umd.js.map +1 -1
  149. package/bundles/material-menu.umd.min.js +5 -4
  150. package/bundles/material-menu.umd.min.js.map +1 -1
  151. package/bundles/material-paginator-testing.umd.js +302 -236
  152. package/bundles/material-paginator-testing.umd.js.map +1 -1
  153. package/bundles/material-paginator-testing.umd.min.js +2 -9
  154. package/bundles/material-paginator-testing.umd.min.js.map +1 -1
  155. package/bundles/material-paginator.umd.js +345 -279
  156. package/bundles/material-paginator.umd.js.map +1 -1
  157. package/bundles/material-paginator.umd.min.js +2 -9
  158. package/bundles/material-paginator.umd.min.js.map +1 -1
  159. package/bundles/material-progress-bar-testing.umd.js +301 -235
  160. package/bundles/material-progress-bar-testing.umd.js.map +1 -1
  161. package/bundles/material-progress-bar-testing.umd.min.js +2 -9
  162. package/bundles/material-progress-bar-testing.umd.min.js.map +1 -1
  163. package/bundles/material-progress-bar.umd.js +339 -266
  164. package/bundles/material-progress-bar.umd.js.map +1 -1
  165. package/bundles/material-progress-bar.umd.min.js +4 -3
  166. package/bundles/material-progress-bar.umd.min.js.map +1 -1
  167. package/bundles/material-progress-spinner-testing.umd.js +301 -235
  168. package/bundles/material-progress-spinner-testing.umd.js.map +1 -1
  169. package/bundles/material-progress-spinner-testing.umd.min.js +2 -9
  170. package/bundles/material-progress-spinner-testing.umd.min.js.map +1 -1
  171. package/bundles/material-progress-spinner.umd.js +411 -364
  172. package/bundles/material-progress-spinner.umd.js.map +1 -1
  173. package/bundles/material-progress-spinner.umd.min.js +2 -10
  174. package/bundles/material-progress-spinner.umd.min.js.map +1 -1
  175. package/bundles/material-radio-testing.umd.js +315 -238
  176. package/bundles/material-radio-testing.umd.js.map +1 -1
  177. package/bundles/material-radio-testing.umd.min.js +2 -10
  178. package/bundles/material-radio-testing.umd.min.js.map +1 -1
  179. package/bundles/material-radio.umd.js +412 -336
  180. package/bundles/material-radio.umd.js.map +1 -1
  181. package/bundles/material-radio.umd.min.js +2 -10
  182. package/bundles/material-radio.umd.min.js.map +1 -1
  183. package/bundles/material-select-testing.umd.js +326 -247
  184. package/bundles/material-select-testing.umd.js.map +1 -1
  185. package/bundles/material-select-testing.umd.min.js +2 -9
  186. package/bundles/material-select-testing.umd.min.js.map +1 -1
  187. package/bundles/material-select.umd.js +424 -348
  188. package/bundles/material-select.umd.js.map +1 -1
  189. package/bundles/material-select.umd.min.js +5 -12
  190. package/bundles/material-select.umd.min.js.map +1 -1
  191. package/bundles/material-sidenav-testing.umd.js +303 -244
  192. package/bundles/material-sidenav-testing.umd.js.map +1 -1
  193. package/bundles/material-sidenav-testing.umd.min.js +2 -16
  194. package/bundles/material-sidenav-testing.umd.min.js.map +1 -1
  195. package/bundles/material-sidenav.umd.js +528 -477
  196. package/bundles/material-sidenav.umd.js.map +1 -1
  197. package/bundles/material-sidenav.umd.min.js +3 -3
  198. package/bundles/material-sidenav.umd.min.js.map +1 -1
  199. package/bundles/material-slide-toggle-testing.umd.js +313 -236
  200. package/bundles/material-slide-toggle-testing.umd.js.map +1 -1
  201. package/bundles/material-slide-toggle-testing.umd.min.js +2 -9
  202. package/bundles/material-slide-toggle-testing.umd.min.js.map +1 -1
  203. package/bundles/material-slide-toggle.umd.js +373 -314
  204. package/bundles/material-slide-toggle.umd.js.map +1 -1
  205. package/bundles/material-slide-toggle.umd.min.js +2 -9
  206. package/bundles/material-slide-toggle.umd.min.js.map +1 -1
  207. package/bundles/material-slider-testing.umd.js +313 -236
  208. package/bundles/material-slider-testing.umd.js.map +1 -1
  209. package/bundles/material-slider-testing.umd.min.js +2 -9
  210. package/bundles/material-slider-testing.umd.min.js.map +1 -1
  211. package/bundles/material-slider.umd.js +476 -439
  212. package/bundles/material-slider.umd.js.map +1 -1
  213. package/bundles/material-slider.umd.min.js +4 -3
  214. package/bundles/material-slider.umd.min.js.map +1 -1
  215. package/bundles/material-snack-bar-testing.umd.js +304 -238
  216. package/bundles/material-snack-bar-testing.umd.js.map +1 -1
  217. package/bundles/material-snack-bar-testing.umd.min.js +2 -9
  218. package/bundles/material-snack-bar-testing.umd.min.js.map +1 -1
  219. package/bundles/material-snack-bar.umd.js +383 -308
  220. package/bundles/material-snack-bar.umd.js.map +1 -1
  221. package/bundles/material-snack-bar.umd.min.js +26 -2
  222. package/bundles/material-snack-bar.umd.min.js.map +1 -1
  223. package/bundles/material-sort-testing.umd.js +312 -253
  224. package/bundles/material-sort-testing.umd.js.map +1 -1
  225. package/bundles/material-sort-testing.umd.min.js +1 -16
  226. package/bundles/material-sort-testing.umd.min.js.map +1 -1
  227. package/bundles/material-sort.umd.js +391 -319
  228. package/bundles/material-sort.umd.js.map +1 -1
  229. package/bundles/material-sort.umd.min.js +4 -19
  230. package/bundles/material-sort.umd.min.js.map +1 -1
  231. package/bundles/material-stepper.umd.js +490 -445
  232. package/bundles/material-stepper.umd.js.map +1 -1
  233. package/bundles/material-stepper.umd.min.js +5 -12
  234. package/bundles/material-stepper.umd.min.js.map +1 -1
  235. package/bundles/material-table-testing.umd.js +317 -265
  236. package/bundles/material-table-testing.umd.js.map +1 -1
  237. package/bundles/material-table-testing.umd.min.js +2 -24
  238. package/bundles/material-table-testing.umd.min.js.map +1 -1
  239. package/bundles/material-table.umd.js +494 -461
  240. package/bundles/material-table.umd.js.map +1 -1
  241. package/bundles/material-table.umd.min.js +3 -10
  242. package/bundles/material-table.umd.min.js.map +1 -1
  243. package/bundles/material-tabs-testing.umd.js +303 -244
  244. package/bundles/material-tabs-testing.umd.js.map +1 -1
  245. package/bundles/material-tabs-testing.umd.min.js +1 -16
  246. package/bundles/material-tabs-testing.umd.min.js.map +1 -1
  247. package/bundles/material-tabs.umd.js +675 -625
  248. package/bundles/material-tabs.umd.js.map +1 -1
  249. package/bundles/material-tabs.umd.min.js +23 -5
  250. package/bundles/material-tabs.umd.min.js.map +1 -1
  251. package/bundles/material-toolbar-testing.umd.js +396 -0
  252. package/bundles/material-toolbar-testing.umd.js.map +1 -0
  253. package/bundles/material-toolbar-testing.umd.min.js +37 -0
  254. package/bundles/material-toolbar-testing.umd.min.js.map +1 -0
  255. package/bundles/material-toolbar.umd.js +337 -271
  256. package/bundles/material-toolbar.umd.js.map +1 -1
  257. package/bundles/material-toolbar.umd.min.js +4 -3
  258. package/bundles/material-toolbar.umd.min.js.map +1 -1
  259. package/bundles/material-tooltip-testing.umd.js +301 -235
  260. package/bundles/material-tooltip-testing.umd.js.map +1 -1
  261. package/bundles/material-tooltip-testing.umd.min.js +2 -9
  262. package/bundles/material-tooltip-testing.umd.min.js.map +1 -1
  263. package/bundles/material-tooltip.umd.js +427 -314
  264. package/bundles/material-tooltip.umd.js.map +1 -1
  265. package/bundles/material-tooltip.umd.min.js +11 -3
  266. package/bundles/material-tooltip.umd.min.js.map +1 -1
  267. package/bundles/material-tree.umd.js +421 -383
  268. package/bundles/material-tree.umd.js.map +1 -1
  269. package/bundles/material-tree.umd.min.js +3 -3
  270. package/bundles/material-tree.umd.min.js.map +1 -1
  271. package/button/_button-base.scss +1 -1
  272. package/button/_button-theme.scss +8 -8
  273. package/button/index.metadata.json +1 -1
  274. package/button/testing/button-harness.d.ts +2 -0
  275. package/button-toggle/button-toggle.d.ts +6 -0
  276. package/button-toggle/index.metadata.json +1 -1
  277. package/button-toggle/testing/button-toggle-harness.d.ts +2 -0
  278. package/card/testing/card-harness-filters.d.ts +17 -0
  279. package/card/testing/card-harness.d.ts +36 -0
  280. package/card/testing/index.d.ts +8 -0
  281. package/card/testing/package.json +9 -0
  282. package/card/testing/public-api.d.ts +9 -0
  283. package/checkbox/checkbox.d.ts +2 -1
  284. package/checkbox/testing/checkbox-harness.d.ts +2 -0
  285. package/chips/chip.d.ts +21 -2
  286. package/chips/index.metadata.json +1 -1
  287. package/core/focus-indicators/_focus-indicators.scss +1 -1
  288. package/core/index.metadata.json +1 -1
  289. package/core/option/optgroup.d.ts +13 -4
  290. package/core/option/option.d.ts +10 -7
  291. package/core/style/_vendor-prefixes.scss +5 -0
  292. package/datepicker/date-range-input-parts.d.ts +3 -1
  293. package/datepicker/date-range-input.d.ts +5 -4
  294. package/datepicker/datepicker-base.d.ts +8 -6
  295. package/datepicker/datepicker-input-base.d.ts +9 -5
  296. package/datepicker/datepicker-input.d.ts +1 -0
  297. package/datepicker/index.metadata.json +1 -1
  298. package/dialog/dialog.d.ts +1 -1
  299. package/dialog/index.metadata.json +1 -1
  300. package/esm2015/autocomplete/autocomplete.js +3 -3
  301. package/esm2015/autocomplete/testing/autocomplete-harness.js +7 -1
  302. package/esm2015/bottom-sheet/bottom-sheet.js +1 -1
  303. package/esm2015/button/button.js +8 -3
  304. package/esm2015/button/testing/button-harness.js +7 -1
  305. package/esm2015/button-toggle/button-toggle.js +12 -3
  306. package/esm2015/button-toggle/testing/button-toggle-harness.js +7 -1
  307. package/esm2015/card/testing/card-harness-filters.js +8 -0
  308. package/esm2015/card/testing/card-harness.js +52 -0
  309. package/esm2015/card/testing/index.js +9 -0
  310. package/esm2015/card/testing/public-api.js +10 -0
  311. package/esm2015/card/testing/testing.externs.js +0 -0
  312. package/esm2015/checkbox/checkbox.js +1 -1
  313. package/esm2015/checkbox/testing/checkbox-harness.js +7 -1
  314. package/esm2015/chips/chip-list.js +3 -3
  315. package/esm2015/chips/chip.js +32 -11
  316. package/esm2015/core/common-behaviors/common-module.js +1 -1
  317. package/esm2015/core/common-behaviors/tabindex.js +3 -2
  318. package/esm2015/core/option/optgroup.js +22 -9
  319. package/esm2015/core/option/option.js +29 -14
  320. package/esm2015/core/version.js +1 -1
  321. package/esm2015/datepicker/date-range-input-parts.js +7 -1
  322. package/esm2015/datepicker/date-range-input.js +14 -11
  323. package/esm2015/datepicker/datepicker-base.js +24 -10
  324. package/esm2015/datepicker/datepicker-input-base.js +16 -8
  325. package/esm2015/datepicker/datepicker-input.js +4 -1
  326. package/esm2015/datepicker/datepicker-toggle.js +5 -5
  327. package/esm2015/dialog/dialog.js +6 -6
  328. package/esm2015/expansion/testing/expansion-harness.js +7 -1
  329. package/esm2015/form-field/error.js +10 -3
  330. package/esm2015/form-field/form-field.js +17 -19
  331. package/esm2015/form-field/hint.js +13 -3
  332. package/esm2015/form-field/prefix.js +9 -2
  333. package/esm2015/form-field/suffix.js +9 -2
  334. package/esm2015/grid-list/grid-list.js +2 -2
  335. package/esm2015/grid-list/tile-styler.js +1 -1
  336. package/esm2015/input/input.js +29 -5
  337. package/esm2015/input/testing/input-harness.js +13 -3
  338. package/esm2015/list/testing/action-list-harness.js +7 -1
  339. package/esm2015/list/testing/nav-list-harness.js +7 -1
  340. package/esm2015/list/testing/selection-list-harness.js +7 -1
  341. package/esm2015/menu/menu-content.js +10 -3
  342. package/esm2015/menu/menu-errors.js +10 -1
  343. package/esm2015/menu/menu-panel.js +1 -1
  344. package/esm2015/menu/menu-trigger.js +8 -4
  345. package/esm2015/menu/menu.js +8 -6
  346. package/esm2015/menu/testing/menu-harness.js +13 -1
  347. package/esm2015/progress-spinner/progress-spinner.js +17 -16
  348. package/esm2015/radio/radio.js +15 -6
  349. package/esm2015/radio/testing/radio-harness.js +7 -1
  350. package/esm2015/select/select.js +21 -12
  351. package/esm2015/select/testing/select-harness.js +7 -1
  352. package/esm2015/sidenav/drawer.js +15 -16
  353. package/esm2015/slide-toggle/slide-toggle.js +1 -1
  354. package/esm2015/slide-toggle/testing/slide-toggle-harness.js +7 -1
  355. package/esm2015/slider/slider.js +25 -22
  356. package/esm2015/slider/testing/slider-harness.js +7 -1
  357. package/esm2015/snack-bar/snack-bar.js +5 -3
  358. package/esm2015/sort/sort-header-intl.js +6 -2
  359. package/esm2015/sort/sort-header.js +18 -8
  360. package/esm2015/sort/testing/sort-header-harness.js +10 -7
  361. package/esm2015/stepper/stepper.js +3 -3
  362. package/esm2015/table/cell.js +12 -26
  363. package/esm2015/table/table.js +7 -4
  364. package/esm2015/tabs/index.js +4 -2
  365. package/esm2015/tabs/tab-content.js +12 -3
  366. package/esm2015/tabs/tab-label.js +9 -2
  367. package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +1 -1
  368. package/esm2015/tabs/tab.js +6 -5
  369. package/esm2015/toolbar/testing/index.js +9 -0
  370. package/esm2015/toolbar/testing/public-api.js +10 -0
  371. package/esm2015/toolbar/testing/testing.externs.js +0 -0
  372. package/esm2015/toolbar/testing/toolbar-harness-filters.js +8 -0
  373. package/esm2015/toolbar/testing/toolbar-harness.js +47 -0
  374. package/esm2015/tooltip/tooltip.js +56 -21
  375. package/esm2015/tree/data-source/flat-data-source.js +1 -1
  376. package/esm2015/tree/node.js +2 -2
  377. package/expansion/testing/expansion-harness.d.ts +2 -0
  378. package/fesm2015/autocomplete/testing.js +6 -0
  379. package/fesm2015/autocomplete/testing.js.map +1 -1
  380. package/fesm2015/autocomplete.js +2 -2
  381. package/fesm2015/autocomplete.js.map +1 -1
  382. package/fesm2015/button/testing.js +6 -0
  383. package/fesm2015/button/testing.js.map +1 -1
  384. package/fesm2015/button-toggle/testing.js +6 -0
  385. package/fesm2015/button-toggle/testing.js.map +1 -1
  386. package/fesm2015/button-toggle.js +12 -3
  387. package/fesm2015/button-toggle.js.map +1 -1
  388. package/fesm2015/button.js +7 -2
  389. package/fesm2015/button.js.map +1 -1
  390. package/fesm2015/card/testing.js +79 -0
  391. package/fesm2015/card/testing.js.map +1 -0
  392. package/fesm2015/checkbox/testing.js +6 -0
  393. package/fesm2015/checkbox/testing.js.map +1 -1
  394. package/fesm2015/checkbox.js.map +1 -1
  395. package/fesm2015/chips.js +33 -12
  396. package/fesm2015/chips.js.map +1 -1
  397. package/fesm2015/core.js +51 -23
  398. package/fesm2015/core.js.map +1 -1
  399. package/fesm2015/datepicker.js +60 -26
  400. package/fesm2015/datepicker.js.map +1 -1
  401. package/fesm2015/dialog.js +5 -5
  402. package/fesm2015/dialog.js.map +1 -1
  403. package/fesm2015/expansion/testing.js +6 -0
  404. package/fesm2015/expansion/testing.js.map +1 -1
  405. package/fesm2015/form-field.js +47 -18
  406. package/fesm2015/form-field.js.map +1 -1
  407. package/fesm2015/grid-list.js.map +1 -1
  408. package/fesm2015/input/testing.js +12 -2
  409. package/fesm2015/input/testing.js.map +1 -1
  410. package/fesm2015/input.js +28 -4
  411. package/fesm2015/input.js.map +1 -1
  412. package/fesm2015/list/testing.js +18 -0
  413. package/fesm2015/list/testing.js.map +1 -1
  414. package/fesm2015/menu/testing.js +12 -0
  415. package/fesm2015/menu/testing.js.map +1 -1
  416. package/fesm2015/menu.js +29 -7
  417. package/fesm2015/menu.js.map +1 -1
  418. package/fesm2015/progress-spinner.js +16 -15
  419. package/fesm2015/progress-spinner.js.map +1 -1
  420. package/fesm2015/radio/testing.js +6 -0
  421. package/fesm2015/radio/testing.js.map +1 -1
  422. package/fesm2015/radio.js +16 -7
  423. package/fesm2015/radio.js.map +1 -1
  424. package/fesm2015/select/testing.js +6 -0
  425. package/fesm2015/select/testing.js.map +1 -1
  426. package/fesm2015/select.js +21 -12
  427. package/fesm2015/select.js.map +1 -1
  428. package/fesm2015/sidenav.js +15 -16
  429. package/fesm2015/sidenav.js.map +1 -1
  430. package/fesm2015/slide-toggle/testing.js +6 -0
  431. package/fesm2015/slide-toggle/testing.js.map +1 -1
  432. package/fesm2015/slide-toggle.js.map +1 -1
  433. package/fesm2015/slider/testing.js +6 -0
  434. package/fesm2015/slider/testing.js.map +1 -1
  435. package/fesm2015/slider.js +24 -21
  436. package/fesm2015/slider.js.map +1 -1
  437. package/fesm2015/snack-bar.js +4 -2
  438. package/fesm2015/snack-bar.js.map +1 -1
  439. package/fesm2015/sort/testing.js +9 -6
  440. package/fesm2015/sort/testing.js.map +1 -1
  441. package/fesm2015/sort.js +22 -8
  442. package/fesm2015/sort.js.map +1 -1
  443. package/fesm2015/stepper.js +2 -2
  444. package/fesm2015/stepper.js.map +1 -1
  445. package/fesm2015/table.js +17 -28
  446. package/fesm2015/table.js.map +1 -1
  447. package/fesm2015/tabs.js +21 -4
  448. package/fesm2015/tabs.js.map +1 -1
  449. package/fesm2015/toolbar/testing.js +74 -0
  450. package/fesm2015/toolbar/testing.js.map +1 -0
  451. package/fesm2015/tooltip.js +55 -20
  452. package/fesm2015/tooltip.js.map +1 -1
  453. package/fesm2015/tree.js +1 -1
  454. package/fesm2015/tree.js.map +1 -1
  455. package/form-field/error.d.ts +7 -0
  456. package/form-field/form-field.d.ts +2 -3
  457. package/form-field/hint.d.ts +10 -0
  458. package/form-field/index.metadata.json +1 -1
  459. package/form-field/prefix.d.ts +7 -0
  460. package/form-field/suffix.d.ts +7 -0
  461. package/grid-list/grid-list.d.ts +2 -1
  462. package/grid-list/index.metadata.json +1 -1
  463. package/grid-list/tile-styler.d.ts +10 -5
  464. package/input/index.metadata.json +1 -1
  465. package/input/input.d.ts +6 -2
  466. package/input/testing/input-harness.d.ts +2 -0
  467. package/list/testing/action-list-harness.d.ts +2 -0
  468. package/list/testing/nav-list-harness.d.ts +2 -0
  469. package/list/testing/selection-list-harness.d.ts +2 -0
  470. package/menu/index.metadata.json +1 -1
  471. package/menu/menu-content.d.ts +7 -1
  472. package/menu/menu-errors.d.ts +6 -0
  473. package/menu/menu-panel.d.ts +1 -0
  474. package/menu/menu.d.ts +4 -0
  475. package/menu/testing/menu-harness.d.ts +4 -0
  476. package/package.json +2 -2
  477. package/prebuilt-themes/deeppurple-amber.css +1 -1
  478. package/prebuilt-themes/indigo-pink.css +1 -1
  479. package/prebuilt-themes/pink-bluegrey.css +1 -1
  480. package/prebuilt-themes/purple-green.css +1 -1
  481. package/progress-spinner/index.metadata.json +1 -1
  482. package/progress-spinner/progress-spinner.d.ts +5 -5
  483. package/radio/index.metadata.json +1 -1
  484. package/radio/radio.d.ts +8 -1
  485. package/radio/testing/radio-harness.d.ts +2 -0
  486. package/schematics/ng-add/index.js +1 -1
  487. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +3 -3
  488. package/schematics/ng-generate/navigation/schema.json +5 -0
  489. package/select/index.metadata.json +1 -1
  490. package/select/select.d.ts +7 -0
  491. package/select/testing/select-harness.d.ts +2 -0
  492. package/sidenav/drawer.d.ts +3 -3
  493. package/sidenav/index.metadata.json +1 -1
  494. package/slide-toggle/slide-toggle.d.ts +2 -1
  495. package/slide-toggle/testing/slide-toggle-harness.d.ts +2 -0
  496. package/slider/index.metadata.json +1 -1
  497. package/slider/slider.d.ts +9 -8
  498. package/slider/testing/slider-harness.d.ts +2 -0
  499. package/sort/index.metadata.json +1 -1
  500. package/sort/sort-header-intl.d.ts +5 -1
  501. package/sort/sort-header.d.ts +3 -1
  502. package/sort/testing/sort-header-harness.d.ts +6 -2
  503. package/stepper/index.metadata.json +1 -1
  504. package/table/cell.d.ts +7 -4
  505. package/table/index.metadata.json +1 -1
  506. package/table/table.d.ts +2 -0
  507. package/tabs/index.d.ts +3 -1
  508. package/tabs/index.metadata.json +1 -1
  509. package/tabs/tab-content.d.ts +7 -1
  510. package/tabs/tab-label.d.ts +7 -0
  511. package/tabs/tab-nav-bar/tab-nav-bar.d.ts +2 -1
  512. package/toolbar/testing/index.d.ts +8 -0
  513. package/toolbar/testing/package.json +9 -0
  514. package/toolbar/testing/public-api.d.ts +9 -0
  515. package/toolbar/testing/toolbar-harness-filters.d.ts +13 -0
  516. package/toolbar/testing/toolbar-harness.d.ts +31 -0
  517. package/tooltip/index.metadata.json +1 -1
  518. package/tooltip/tooltip.d.ts +7 -2
  519. package/tree/data-source/flat-data-source.d.ts +4 -4
  520. package/tree/index.metadata.json +1 -1
  521. package/tree/node.d.ts +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"list__testing.js","sources":["../../../../../../src/material/list/testing/list-item-harness-base.ts","../../../../../../src/material/list/testing/list-harness-base.ts","../../../../../../src/material/list/testing/action-list-harness.ts","../../../../../../src/material/list/testing/list-harness.ts","../../../../../../src/material/list/testing/list-harness-filters.ts","../../../../../../src/material/list/testing/nav-list-harness.ts","../../../../../../src/material/list/testing/selection-list-harness.ts","../../../../../../src/material/list/testing/public-api.ts","../../../../../../src/material/list/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 {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessLoader,\n HarnessPredicate\n} from '@angular/cdk/testing';\nimport {BaseListItemHarnessFilters, SubheaderHarnessFilters} from './list-harness-filters';\n\n/**\n * Gets a `HarnessPredicate` that applies the given `BaseListItemHarnessFilters` to the given\n * list item harness.\n * @template H The type of list item harness to create a predicate for.\n * @param harnessType A constructor for a list item harness.\n * @param options An instance of `BaseListItemHarnessFilters` to apply.\n * @return A `HarnessPredicate` for the given harness type with the given options applied.\n */\nexport function getListItemPredicate<H extends MatListItemHarnessBase>(\n harnessType: ComponentHarnessConstructor<H>,\n options: BaseListItemHarnessFilters): HarnessPredicate<H> {\n return new HarnessPredicate(harnessType, options)\n .addOption('text', options.text,\n (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));\n}\n\n/** Harness for interacting with a list subheader. */\nexport class MatSubheaderHarness extends ComponentHarness {\n static hostSelector = '[mat-subheader], [matSubheader]';\n\n static with(options: SubheaderHarnessFilters = {}): HarnessPredicate<MatSubheaderHarness> {\n return new HarnessPredicate(MatSubheaderHarness, options)\n .addOption('text', options.text,\n (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));\n }\n\n /** Gets the full text content of the list item (including text from any font icons). */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n}\n\n/**\n * Shared behavior among the harnesses for the various `MatListItem` flavors.\n * @docs-private\n */\nexport class MatListItemHarnessBase extends ComponentHarness {\n private _lines = this.locatorForAll('[mat-line], [matLine]');\n private _avatar = this.locatorForOptional('[mat-list-avatar], [matListAvatar]');\n private _icon = this.locatorForOptional('[mat-list-icon], [matListIcon]');\n\n /** Gets the full text content of the list item (including text from any font icons). */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Gets the lines of text (`mat-line` elements) in this nav list item. */\n async getLinesText(): Promise<string[]> {\n return Promise.all((await this._lines()).map(l => l.text()));\n }\n\n /** Whether this list item has an avatar. */\n async hasAvatar(): Promise<boolean> {\n return !!await this._avatar();\n }\n\n /** Whether this list item has an icon. */\n async hasIcon(): Promise<boolean> {\n return !!await this._icon();\n }\n\n /** Gets a `HarnessLoader` used to get harnesses within the list item's content. */\n async getHarnessLoaderForContent(): Promise<HarnessLoader> {\n return this.locatorFactory.harnessLoaderFor('.mat-list-item-content');\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate\n} from '@angular/cdk/testing';\nimport {DividerHarnessFilters, MatDividerHarness} from '@angular/material/divider/testing';\nimport {BaseListItemHarnessFilters, SubheaderHarnessFilters} from './list-harness-filters';\nimport {MatSubheaderHarness} from './list-item-harness-base';\n\n/** Represents a section of a list falling under a specific header. */\nexport interface ListSection<I> {\n /** The heading for this list section. `undefined` if there is no heading. */\n heading?: string;\n\n /** The items in this list section. */\n items: I[];\n}\n\n/**\n * Shared behavior among the harnesses for the various `MatList` flavors.\n * @template T A constructor type for a list item harness type used by this list harness.\n * @template C The list item harness type that `T` constructs.\n * @template F The filter type used filter list item harness of type `C`.\n * @docs-private\n */\nexport class MatListHarnessBase\n <\n T extends (ComponentHarnessConstructor<C> & {with: (options?: F) => HarnessPredicate<C>}),\n C extends ComponentHarness,\n F extends BaseListItemHarnessFilters\n > extends ComponentHarness {\n protected _itemHarness: T;\n\n /**\n * Gets a list of harnesses representing the items in this list.\n * @param filters Optional filters used to narrow which harnesses are included\n * @return The list of items matching the given filters.\n */\n async getItems(filters?: F): Promise<C[]> {\n return this.locatorForAll(this._itemHarness.with(filters))();\n }\n\n /**\n * Gets a list of `ListSection` representing the list items grouped by subheaders. If the list has\n * no subheaders it is represented as a single `ListSection` with an undefined `heading` property.\n * @param filters Optional filters used to narrow which list item harnesses are included\n * @return The list of items matching the given filters, grouped into sections by subheader.\n */\n async getItemsGroupedBySubheader(filters?: F): Promise<ListSection<C>[]> {\n const listSections = [];\n let currentSection: ListSection<C> = {items: []};\n const itemsAndSubheaders =\n await this.getItemsWithSubheadersAndDividers({item: filters, divider: false});\n for (const itemOrSubheader of itemsAndSubheaders) {\n if (itemOrSubheader instanceof MatSubheaderHarness) {\n if (currentSection.heading !== undefined || currentSection.items.length) {\n listSections.push(currentSection);\n }\n currentSection = {heading: await itemOrSubheader.getText(), items: []};\n } else {\n currentSection.items.push(itemOrSubheader);\n }\n }\n if (currentSection.heading !== undefined || currentSection.items.length ||\n !listSections.length) {\n listSections.push(currentSection);\n }\n return listSections;\n }\n\n /**\n * Gets a list of sub-lists representing the list items grouped by dividers. If the list has no\n * dividers it is represented as a list with a single sub-list.\n * @param filters Optional filters used to narrow which list item harnesses are included\n * @return The list of items matching the given filters, grouped into sub-lists by divider.\n */\n async getItemsGroupedByDividers(filters?: F): Promise<C[][]> {\n const listSections: C[][] = [[]];\n const itemsAndDividers =\n await this.getItemsWithSubheadersAndDividers({item: filters, subheader: false});\n for (const itemOrDivider of itemsAndDividers) {\n if (itemOrDivider instanceof MatDividerHarness) {\n listSections.push([]);\n } else {\n listSections[listSections.length - 1].push(itemOrDivider);\n }\n }\n return listSections;\n }\n\n /**\n * Gets a list of harnesses representing all of the items, subheaders, and dividers\n * (in the order they appear in the list). Use `instanceof` to check which type of harness a given\n * item is.\n * @param filters Optional filters used to narrow which list items, subheaders, and dividers are\n * included. A value of `false` for the `item`, `subheader`, or `divider` properties indicates\n * that the respective harness type should be omitted completely.\n * @return The list of harnesses representing the items, subheaders, and dividers matching the\n * given filters.\n */\n getItemsWithSubheadersAndDividers(filters: {\n item: false,\n subheader: false,\n divider: false\n }): Promise<[]>;\n getItemsWithSubheadersAndDividers(filters: {\n item?: F | false,\n subheader: false,\n divider: false\n }): Promise<C[]>;\n getItemsWithSubheadersAndDividers(filters: {\n item: false,\n subheader?: SubheaderHarnessFilters | false,\n divider: false\n }): Promise<MatSubheaderHarness[]>;\n getItemsWithSubheadersAndDividers(filters: {\n item: false,\n subheader: false,\n divider?: DividerHarnessFilters | false\n }): Promise<MatDividerHarness[]>;\n getItemsWithSubheadersAndDividers(filters: {\n item?: F | false,\n subheader?: SubheaderHarnessFilters | false,\n divider: false\n }): Promise<(C | MatSubheaderHarness)[]>;\n getItemsWithSubheadersAndDividers(filters: {\n item?: F | false,\n subheader: false,\n divider?: false | DividerHarnessFilters\n }): Promise<(C | MatDividerHarness)[]>;\n getItemsWithSubheadersAndDividers(filters: {\n item: false,\n subheader?: false | SubheaderHarnessFilters,\n divider?: false | DividerHarnessFilters\n }): Promise<(MatSubheaderHarness | MatDividerHarness)[]>;\n getItemsWithSubheadersAndDividers(filters?: {\n item?: F | false,\n subheader?: SubheaderHarnessFilters | false,\n divider?: DividerHarnessFilters | false\n }): Promise<(C | MatSubheaderHarness | MatDividerHarness)[]>;\n async getItemsWithSubheadersAndDividers(filters: {\n item?: F | false,\n subheader?: SubheaderHarnessFilters | false,\n divider?: DividerHarnessFilters | false\n } = {}): Promise<(C | MatSubheaderHarness | MatDividerHarness)[]> {\n const query = [];\n if (filters.item !== false) {\n query.push(this._itemHarness.with(filters.item || {} as F));\n }\n if (filters.subheader !== false) {\n query.push(MatSubheaderHarness.with(filters.subheader));\n }\n if (filters.divider !== false) {\n query.push(MatDividerHarness.with(filters.divider));\n }\n return this.locatorForAll(...query)();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate} from '@angular/cdk/testing';\nimport {MatListHarnessBase} from './list-harness-base';\nimport {ActionListHarnessFilters, ActionListItemHarnessFilters} from './list-harness-filters';\nimport {getListItemPredicate, MatListItemHarnessBase} from './list-item-harness-base';\n\n/** Harness for interacting with a standard mat-action-list in tests. */\nexport class MatActionListHarness extends MatListHarnessBase<\n typeof MatActionListItemHarness, MatActionListItemHarness, ActionListItemHarnessFilters> {\n /** The selector for the host element of a `MatActionList` instance. */\n static hostSelector = 'mat-action-list';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatActionListHarness` that meets\n * certain criteria.\n * @param options Options for filtering which action list instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ActionListHarnessFilters = {}): HarnessPredicate<MatActionListHarness> {\n return new HarnessPredicate(MatActionListHarness, options);\n }\n\n _itemHarness = MatActionListItemHarness;\n}\n\n/** Harness for interacting with an action list item. */\nexport class MatActionListItemHarness extends MatListItemHarnessBase {\n /** The selector for the host element of a `MatListItem` instance. */\n static hostSelector = ['mat-list-item', 'a[mat-list-item]', 'button[mat-list-item]']\n .map(selector => `${MatActionListHarness.hostSelector} ${selector}`)\n .join(',');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatActionListItemHarness` that\n * meets certain criteria.\n * @param options Options for filtering which action list item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ActionListItemHarnessFilters = {}):\n HarnessPredicate<MatActionListItemHarness> {\n return getListItemPredicate(MatActionListItemHarness, options);\n }\n\n /** Clicks on the action list item. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Focuses the action list item. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the action list item. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate} from '@angular/cdk/testing';\nimport {MatListHarnessBase} from './list-harness-base';\nimport {ListHarnessFilters, ListItemHarnessFilters} from './list-harness-filters';\nimport {getListItemPredicate, MatListItemHarnessBase} from './list-item-harness-base';\n\n/** Harness for interacting with a standard mat-list in tests. */\nexport class MatListHarness extends\n MatListHarnessBase<typeof MatListItemHarness, MatListItemHarness, ListItemHarnessFilters> {\n /** The selector for the host element of a `MatList` instance. */\n static hostSelector = 'mat-list';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatListHarness` that meets certain\n * criteria.\n * @param options Options for filtering which list instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ListHarnessFilters = {}): HarnessPredicate<MatListHarness> {\n return new HarnessPredicate(MatListHarness, options);\n }\n\n _itemHarness = MatListItemHarness;\n}\n\n/** Harness for interacting with a list item. */\nexport class MatListItemHarness extends MatListItemHarnessBase {\n /** The selector for the host element of a `MatListItem` instance. */\n static hostSelector = ['mat-list-item', 'a[mat-list-item]', 'button[mat-list-item]']\n .map(selector => `${MatListHarness.hostSelector} ${selector}`)\n .join(',');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatListItemHarness` that meets\n * certain criteria.\n * @param options Options for filtering which list item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ListItemHarnessFilters = {}): HarnessPredicate<MatListItemHarness> {\n return getListItemPredicate(MatListItemHarness, options);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseHarnessFilters} from '@angular/cdk/testing';\n\nexport interface ListHarnessFilters extends BaseHarnessFilters {}\n\nexport interface ActionListHarnessFilters extends BaseHarnessFilters {}\n\nexport interface NavListHarnessFilters extends BaseHarnessFilters {}\n\nexport interface SelectionListHarnessFilters extends BaseHarnessFilters {}\n\nexport interface BaseListItemHarnessFilters extends BaseHarnessFilters {\n text?: string | RegExp;\n}\n\nexport interface ListItemHarnessFilters extends BaseListItemHarnessFilters {}\n\nexport interface ActionListItemHarnessFilters extends BaseListItemHarnessFilters {}\n\nexport interface NavListItemHarnessFilters extends BaseListItemHarnessFilters {\n href?: string | RegExp | null;\n}\n\nexport interface ListOptionHarnessFilters extends BaseListItemHarnessFilters {\n selected?: boolean;\n}\n\nexport interface SubheaderHarnessFilters extends BaseHarnessFilters {\n text?: string | RegExp;\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 {HarnessPredicate} from '@angular/cdk/testing';\nimport {MatListHarnessBase} from './list-harness-base';\nimport {NavListHarnessFilters, NavListItemHarnessFilters} from './list-harness-filters';\nimport {getListItemPredicate, MatListItemHarnessBase} from './list-item-harness-base';\n\n/** Harness for interacting with a standard mat-nav-list in tests. */\nexport class MatNavListHarness extends MatListHarnessBase<\n typeof MatNavListItemHarness, MatNavListItemHarness, NavListItemHarnessFilters> {\n /** The selector for the host element of a `MatNavList` instance. */\n static hostSelector = 'mat-nav-list';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatNavListHarness` that meets\n * certain criteria.\n * @param options Options for filtering which nav list instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: NavListHarnessFilters = {}): HarnessPredicate<MatNavListHarness> {\n return new HarnessPredicate(MatNavListHarness, options);\n }\n\n _itemHarness = MatNavListItemHarness;\n}\n\n/** Harness for interacting with a nav list item. */\nexport class MatNavListItemHarness extends MatListItemHarnessBase {\n /** The selector for the host element of a `MatListItem` instance. */\n static hostSelector = ['mat-list-item', 'a[mat-list-item]', 'button[mat-list-item]']\n .map(selector => `${MatNavListHarness.hostSelector} ${selector}`)\n .join(',');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatNavListItemHarness` that\n * meets certain criteria.\n * @param options Options for filtering which nav list item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: NavListItemHarnessFilters = {}): HarnessPredicate<MatNavListItemHarness> {\n return getListItemPredicate(MatNavListItemHarness, options)\n .addOption('href', options.href,\n async (harness, href) => HarnessPredicate.stringMatches(harness.getHref(), href));\n }\n\n /** Gets the href for this nav list item. */\n async getHref(): Promise<string | null> {\n return (await this.host()).getAttribute('href');\n }\n\n /** Clicks on the nav list item. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Focuses the nav list item. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the nav list item. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate} from '@angular/cdk/testing';\nimport {MatListHarnessBase} from './list-harness-base';\nimport {\n ListItemHarnessFilters,\n ListOptionHarnessFilters,\n SelectionListHarnessFilters\n} from './list-harness-filters';\nimport {getListItemPredicate, MatListItemHarnessBase} from './list-item-harness-base';\n\n/** Harness for interacting with a standard mat-selection-list in tests. */\nexport class MatSelectionListHarness extends MatListHarnessBase<\n typeof MatListOptionHarness, MatListOptionHarness, ListOptionHarnessFilters> {\n /** The selector for the host element of a `MatSelectionList` instance. */\n static hostSelector = 'mat-selection-list';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatSelectionListHarness` that meets\n * certain criteria.\n * @param options Options for filtering which selection list instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: SelectionListHarnessFilters = {}):\n HarnessPredicate<MatSelectionListHarness> {\n return new HarnessPredicate(MatSelectionListHarness, options);\n }\n\n _itemHarness = MatListOptionHarness;\n\n /** Whether the selection list is disabled. */\n async isDisabled(): Promise<boolean> {\n return await (await this.host()).getAttribute('aria-disabled') === 'true';\n }\n\n /**\n * Selects all items matching any of the given filters.\n * @param filters Filters that specify which items should be selected.\n */\n async selectItems(...filters: ListOptionHarnessFilters[]): Promise<void> {\n const items = await this._getItems(filters);\n await Promise.all(items.map(item => item.select()));\n }\n\n /**\n * Deselects all items matching any of the given filters.\n * @param filters Filters that specify which items should be deselected.\n */\n async deselectItems(...filters: ListItemHarnessFilters[]): Promise<void> {\n const items = await this._getItems(filters);\n await Promise.all(items.map(item => item.deselect()));\n }\n\n /** Gets all items matching the given list of filters. */\n private async _getItems(filters: ListOptionHarnessFilters[]): Promise<MatListOptionHarness[]> {\n if (!filters.length) {\n return this.getItems();\n }\n return ([] as MatListOptionHarness[]).concat(...await Promise.all(\n filters.map(filter => this.locatorForAll(MatListOptionHarness.with(filter))())));\n }\n}\n\n/** Harness for interacting with a list option. */\nexport class MatListOptionHarness extends MatListItemHarnessBase {\n /** The selector for the host element of a `MatListOption` instance. */\n static hostSelector = 'mat-list-option';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatListOptionHarness` that\n * meets certain criteria.\n * @param options Options for filtering which list option instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ListOptionHarnessFilters = {}): HarnessPredicate<MatListOptionHarness> {\n return getListItemPredicate(MatListOptionHarness, options)\n .addOption('is selected', options.selected,\n async (harness, selected) => await harness.isSelected() === selected);\n }\n\n private _itemContent = this.locatorFor('.mat-list-item-content');\n\n /** Gets the position of the checkbox relative to the list option content. */\n async getCheckboxPosition(): Promise<'before' | 'after'> {\n return await (await this._itemContent()).hasClass('mat-list-item-content-reverse') ?\n 'after' : 'before';\n }\n\n /** Whether the list option is selected. */\n async isSelected(): Promise<boolean> {\n return await (await this.host()).getAttribute('aria-selected') === 'true';\n }\n\n /** Whether the list option is disabled. */\n async isDisabled(): Promise<boolean> {\n return await (await this.host()).getAttribute('aria-disabled') === 'true';\n }\n\n /** Focuses the list option. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the list option. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Toggles the checked state of the checkbox. */\n async toggle() {\n return (await this.host()).click();\n }\n\n /**\n * Puts the list option in a checked state by toggling it if it is currently unchecked, or doing\n * nothing if it is already checked.\n */\n async select() {\n if (!await this.isSelected()) {\n return this.toggle();\n }\n }\n\n /**\n * Puts the list option in an unchecked state by toggling it if it is currently checked, or doing\n * nothing if it is already unchecked.\n */\n async deselect() {\n if (await this.isSelected()) {\n return this.toggle();\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 './action-list-harness';\nexport * from './list-harness';\nexport * from './list-harness-filters';\nexport * from './nav-list-harness';\nexport * from './selection-list-harness';\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;;;;;;;AAgBA;;;;;;;;AAQA,SAAgB,oBAAoB,CAChC,WAA2C,EAC3C,OAAmC;IACrC,OAAO,IAAI,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC;SAC5C,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAC3B,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;CACrF;;AAGD,MAAa,mBAAoB,SAAQ,gBAAgB;IAGvD,OAAO,IAAI,CAAC,UAAmC,EAAE;QAC/C,OAAO,IAAI,gBAAgB,CAAC,mBAAmB,EAAE,OAAO,CAAC;aACpD,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAC3B,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;KACrF;;IAGK,OAAO;;YACX,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;SACnC;KAAA;;AAXM,gCAAY,GAAG,iCAAiC,CAAC;;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,EAAE,QAAQ,CAAC,+BAA+B,CAAC;gBAC9E,OAAO,GAAG,QAAQ,CAAC;SACxB;KAAA;;IAGK,UAAU;;YACd,OAAO,CAAA,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,eAAe,CAAC,MAAK,MAAM,CAAC;SAC3E;KAAA;;IAGK,UAAU;;YACd,OAAO,CAAA,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,eAAe,CAAC,MAAK,MAAM,CAAC;SAC3E;KAAA;;IAGK,KAAK;;YACT,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC;SACpC;KAAA;;IAGK,IAAI;;YACR,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;SACnC;KAAA;;IAGK,MAAM;;YACV,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC;SACpC;KAAA;;;;;IAMK,MAAM;;YACV,IAAI,EAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA,EAAE;gBAC5B,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;aACtB;SACF;KAAA;;;;;IAMK,QAAQ;;YACZ,IAAI,MAAM,IAAI,CAAC,UAAU,EAAE,EAAE;gBAC3B,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;aACtB;SACF;KAAA;;;AAjEM,iCAAY,GAAG,iBAAiB,CAAC;;ACxE1C;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
1
+ {"version":3,"file":"list__testing.js","sources":["../../../../../../src/material/list/testing/list-item-harness-base.ts","../../../../../../src/material/list/testing/list-harness-base.ts","../../../../../../src/material/list/testing/action-list-harness.ts","../../../../../../src/material/list/testing/list-harness.ts","../../../../../../src/material/list/testing/list-harness-filters.ts","../../../../../../src/material/list/testing/nav-list-harness.ts","../../../../../../src/material/list/testing/selection-list-harness.ts","../../../../../../src/material/list/testing/public-api.ts","../../../../../../src/material/list/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 {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessLoader,\n HarnessPredicate\n} from '@angular/cdk/testing';\nimport {BaseListItemHarnessFilters, SubheaderHarnessFilters} from './list-harness-filters';\n\n/**\n * Gets a `HarnessPredicate` that applies the given `BaseListItemHarnessFilters` to the given\n * list item harness.\n * @template H The type of list item harness to create a predicate for.\n * @param harnessType A constructor for a list item harness.\n * @param options An instance of `BaseListItemHarnessFilters` to apply.\n * @return A `HarnessPredicate` for the given harness type with the given options applied.\n */\nexport function getListItemPredicate<H extends MatListItemHarnessBase>(\n harnessType: ComponentHarnessConstructor<H>,\n options: BaseListItemHarnessFilters): HarnessPredicate<H> {\n return new HarnessPredicate(harnessType, options)\n .addOption('text', options.text,\n (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));\n}\n\n/** Harness for interacting with a list subheader. */\nexport class MatSubheaderHarness extends ComponentHarness {\n static hostSelector = '[mat-subheader], [matSubheader]';\n\n static with(options: SubheaderHarnessFilters = {}): HarnessPredicate<MatSubheaderHarness> {\n return new HarnessPredicate(MatSubheaderHarness, options)\n .addOption('text', options.text,\n (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));\n }\n\n /** Gets the full text content of the list item (including text from any font icons). */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n}\n\n/**\n * Shared behavior among the harnesses for the various `MatListItem` flavors.\n * @docs-private\n */\nexport class MatListItemHarnessBase extends ComponentHarness {\n private _lines = this.locatorForAll('[mat-line], [matLine]');\n private _avatar = this.locatorForOptional('[mat-list-avatar], [matListAvatar]');\n private _icon = this.locatorForOptional('[mat-list-icon], [matListIcon]');\n\n /** Gets the full text content of the list item (including text from any font icons). */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Gets the lines of text (`mat-line` elements) in this nav list item. */\n async getLinesText(): Promise<string[]> {\n return Promise.all((await this._lines()).map(l => l.text()));\n }\n\n /** Whether this list item has an avatar. */\n async hasAvatar(): Promise<boolean> {\n return !!await this._avatar();\n }\n\n /** Whether this list item has an icon. */\n async hasIcon(): Promise<boolean> {\n return !!await this._icon();\n }\n\n /** Gets a `HarnessLoader` used to get harnesses within the list item's content. */\n async getHarnessLoaderForContent(): Promise<HarnessLoader> {\n return this.locatorFactory.harnessLoaderFor('.mat-list-item-content');\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate\n} from '@angular/cdk/testing';\nimport {DividerHarnessFilters, MatDividerHarness} from '@angular/material/divider/testing';\nimport {BaseListItemHarnessFilters, SubheaderHarnessFilters} from './list-harness-filters';\nimport {MatSubheaderHarness} from './list-item-harness-base';\n\n/** Represents a section of a list falling under a specific header. */\nexport interface ListSection<I> {\n /** The heading for this list section. `undefined` if there is no heading. */\n heading?: string;\n\n /** The items in this list section. */\n items: I[];\n}\n\n/**\n * Shared behavior among the harnesses for the various `MatList` flavors.\n * @template T A constructor type for a list item harness type used by this list harness.\n * @template C The list item harness type that `T` constructs.\n * @template F The filter type used filter list item harness of type `C`.\n * @docs-private\n */\nexport class MatListHarnessBase\n <\n T extends (ComponentHarnessConstructor<C> & {with: (options?: F) => HarnessPredicate<C>}),\n C extends ComponentHarness,\n F extends BaseListItemHarnessFilters\n > extends ComponentHarness {\n protected _itemHarness: T;\n\n /**\n * Gets a list of harnesses representing the items in this list.\n * @param filters Optional filters used to narrow which harnesses are included\n * @return The list of items matching the given filters.\n */\n async getItems(filters?: F): Promise<C[]> {\n return this.locatorForAll(this._itemHarness.with(filters))();\n }\n\n /**\n * Gets a list of `ListSection` representing the list items grouped by subheaders. If the list has\n * no subheaders it is represented as a single `ListSection` with an undefined `heading` property.\n * @param filters Optional filters used to narrow which list item harnesses are included\n * @return The list of items matching the given filters, grouped into sections by subheader.\n */\n async getItemsGroupedBySubheader(filters?: F): Promise<ListSection<C>[]> {\n const listSections = [];\n let currentSection: ListSection<C> = {items: []};\n const itemsAndSubheaders =\n await this.getItemsWithSubheadersAndDividers({item: filters, divider: false});\n for (const itemOrSubheader of itemsAndSubheaders) {\n if (itemOrSubheader instanceof MatSubheaderHarness) {\n if (currentSection.heading !== undefined || currentSection.items.length) {\n listSections.push(currentSection);\n }\n currentSection = {heading: await itemOrSubheader.getText(), items: []};\n } else {\n currentSection.items.push(itemOrSubheader);\n }\n }\n if (currentSection.heading !== undefined || currentSection.items.length ||\n !listSections.length) {\n listSections.push(currentSection);\n }\n return listSections;\n }\n\n /**\n * Gets a list of sub-lists representing the list items grouped by dividers. If the list has no\n * dividers it is represented as a list with a single sub-list.\n * @param filters Optional filters used to narrow which list item harnesses are included\n * @return The list of items matching the given filters, grouped into sub-lists by divider.\n */\n async getItemsGroupedByDividers(filters?: F): Promise<C[][]> {\n const listSections: C[][] = [[]];\n const itemsAndDividers =\n await this.getItemsWithSubheadersAndDividers({item: filters, subheader: false});\n for (const itemOrDivider of itemsAndDividers) {\n if (itemOrDivider instanceof MatDividerHarness) {\n listSections.push([]);\n } else {\n listSections[listSections.length - 1].push(itemOrDivider);\n }\n }\n return listSections;\n }\n\n /**\n * Gets a list of harnesses representing all of the items, subheaders, and dividers\n * (in the order they appear in the list). Use `instanceof` to check which type of harness a given\n * item is.\n * @param filters Optional filters used to narrow which list items, subheaders, and dividers are\n * included. A value of `false` for the `item`, `subheader`, or `divider` properties indicates\n * that the respective harness type should be omitted completely.\n * @return The list of harnesses representing the items, subheaders, and dividers matching the\n * given filters.\n */\n getItemsWithSubheadersAndDividers(filters: {\n item: false,\n subheader: false,\n divider: false\n }): Promise<[]>;\n getItemsWithSubheadersAndDividers(filters: {\n item?: F | false,\n subheader: false,\n divider: false\n }): Promise<C[]>;\n getItemsWithSubheadersAndDividers(filters: {\n item: false,\n subheader?: SubheaderHarnessFilters | false,\n divider: false\n }): Promise<MatSubheaderHarness[]>;\n getItemsWithSubheadersAndDividers(filters: {\n item: false,\n subheader: false,\n divider?: DividerHarnessFilters | false\n }): Promise<MatDividerHarness[]>;\n getItemsWithSubheadersAndDividers(filters: {\n item?: F | false,\n subheader?: SubheaderHarnessFilters | false,\n divider: false\n }): Promise<(C | MatSubheaderHarness)[]>;\n getItemsWithSubheadersAndDividers(filters: {\n item?: F | false,\n subheader: false,\n divider?: false | DividerHarnessFilters\n }): Promise<(C | MatDividerHarness)[]>;\n getItemsWithSubheadersAndDividers(filters: {\n item: false,\n subheader?: false | SubheaderHarnessFilters,\n divider?: false | DividerHarnessFilters\n }): Promise<(MatSubheaderHarness | MatDividerHarness)[]>;\n getItemsWithSubheadersAndDividers(filters?: {\n item?: F | false,\n subheader?: SubheaderHarnessFilters | false,\n divider?: DividerHarnessFilters | false\n }): Promise<(C | MatSubheaderHarness | MatDividerHarness)[]>;\n async getItemsWithSubheadersAndDividers(filters: {\n item?: F | false,\n subheader?: SubheaderHarnessFilters | false,\n divider?: DividerHarnessFilters | false\n } = {}): Promise<(C | MatSubheaderHarness | MatDividerHarness)[]> {\n const query = [];\n if (filters.item !== false) {\n query.push(this._itemHarness.with(filters.item || {} as F));\n }\n if (filters.subheader !== false) {\n query.push(MatSubheaderHarness.with(filters.subheader));\n }\n if (filters.divider !== false) {\n query.push(MatDividerHarness.with(filters.divider));\n }\n return this.locatorForAll(...query)();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate} from '@angular/cdk/testing';\nimport {MatListHarnessBase} from './list-harness-base';\nimport {ActionListHarnessFilters, ActionListItemHarnessFilters} from './list-harness-filters';\nimport {getListItemPredicate, MatListItemHarnessBase} from './list-item-harness-base';\n\n/** Harness for interacting with a standard mat-action-list in tests. */\nexport class MatActionListHarness extends MatListHarnessBase<\n typeof MatActionListItemHarness, MatActionListItemHarness, ActionListItemHarnessFilters> {\n /** The selector for the host element of a `MatActionList` instance. */\n static hostSelector = 'mat-action-list';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatActionListHarness` that meets\n * certain criteria.\n * @param options Options for filtering which action list instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ActionListHarnessFilters = {}): HarnessPredicate<MatActionListHarness> {\n return new HarnessPredicate(MatActionListHarness, options);\n }\n\n _itemHarness = MatActionListItemHarness;\n}\n\n/** Harness for interacting with an action list item. */\nexport class MatActionListItemHarness extends MatListItemHarnessBase {\n /** The selector for the host element of a `MatListItem` instance. */\n static hostSelector = ['mat-list-item', 'a[mat-list-item]', 'button[mat-list-item]']\n .map(selector => `${MatActionListHarness.hostSelector} ${selector}`)\n .join(',');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatActionListItemHarness` that\n * meets certain criteria.\n * @param options Options for filtering which action list item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ActionListItemHarnessFilters = {}):\n HarnessPredicate<MatActionListItemHarness> {\n return getListItemPredicate(MatActionListItemHarness, options);\n }\n\n /** Clicks on the action list item. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Focuses the action list item. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the action list item. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the action list item is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate} from '@angular/cdk/testing';\nimport {MatListHarnessBase} from './list-harness-base';\nimport {ListHarnessFilters, ListItemHarnessFilters} from './list-harness-filters';\nimport {getListItemPredicate, MatListItemHarnessBase} from './list-item-harness-base';\n\n/** Harness for interacting with a standard mat-list in tests. */\nexport class MatListHarness extends\n MatListHarnessBase<typeof MatListItemHarness, MatListItemHarness, ListItemHarnessFilters> {\n /** The selector for the host element of a `MatList` instance. */\n static hostSelector = 'mat-list';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatListHarness` that meets certain\n * criteria.\n * @param options Options for filtering which list instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ListHarnessFilters = {}): HarnessPredicate<MatListHarness> {\n return new HarnessPredicate(MatListHarness, options);\n }\n\n _itemHarness = MatListItemHarness;\n}\n\n/** Harness for interacting with a list item. */\nexport class MatListItemHarness extends MatListItemHarnessBase {\n /** The selector for the host element of a `MatListItem` instance. */\n static hostSelector = ['mat-list-item', 'a[mat-list-item]', 'button[mat-list-item]']\n .map(selector => `${MatListHarness.hostSelector} ${selector}`)\n .join(',');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatListItemHarness` that meets\n * certain criteria.\n * @param options Options for filtering which list item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ListItemHarnessFilters = {}): HarnessPredicate<MatListItemHarness> {\n return getListItemPredicate(MatListItemHarness, options);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseHarnessFilters} from '@angular/cdk/testing';\n\nexport interface ListHarnessFilters extends BaseHarnessFilters {}\n\nexport interface ActionListHarnessFilters extends BaseHarnessFilters {}\n\nexport interface NavListHarnessFilters extends BaseHarnessFilters {}\n\nexport interface SelectionListHarnessFilters extends BaseHarnessFilters {}\n\nexport interface BaseListItemHarnessFilters extends BaseHarnessFilters {\n text?: string | RegExp;\n}\n\nexport interface ListItemHarnessFilters extends BaseListItemHarnessFilters {}\n\nexport interface ActionListItemHarnessFilters extends BaseListItemHarnessFilters {}\n\nexport interface NavListItemHarnessFilters extends BaseListItemHarnessFilters {\n href?: string | RegExp | null;\n}\n\nexport interface ListOptionHarnessFilters extends BaseListItemHarnessFilters {\n selected?: boolean;\n}\n\nexport interface SubheaderHarnessFilters extends BaseHarnessFilters {\n text?: string | RegExp;\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 {HarnessPredicate} from '@angular/cdk/testing';\nimport {MatListHarnessBase} from './list-harness-base';\nimport {NavListHarnessFilters, NavListItemHarnessFilters} from './list-harness-filters';\nimport {getListItemPredicate, MatListItemHarnessBase} from './list-item-harness-base';\n\n/** Harness for interacting with a standard mat-nav-list in tests. */\nexport class MatNavListHarness extends MatListHarnessBase<\n typeof MatNavListItemHarness, MatNavListItemHarness, NavListItemHarnessFilters> {\n /** The selector for the host element of a `MatNavList` instance. */\n static hostSelector = 'mat-nav-list';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatNavListHarness` that meets\n * certain criteria.\n * @param options Options for filtering which nav list instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: NavListHarnessFilters = {}): HarnessPredicate<MatNavListHarness> {\n return new HarnessPredicate(MatNavListHarness, options);\n }\n\n _itemHarness = MatNavListItemHarness;\n}\n\n/** Harness for interacting with a nav list item. */\nexport class MatNavListItemHarness extends MatListItemHarnessBase {\n /** The selector for the host element of a `MatListItem` instance. */\n static hostSelector = ['mat-list-item', 'a[mat-list-item]', 'button[mat-list-item]']\n .map(selector => `${MatNavListHarness.hostSelector} ${selector}`)\n .join(',');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatNavListItemHarness` that\n * meets certain criteria.\n * @param options Options for filtering which nav list item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: NavListItemHarnessFilters = {}): HarnessPredicate<MatNavListItemHarness> {\n return getListItemPredicate(MatNavListItemHarness, options)\n .addOption('href', options.href,\n async (harness, href) => HarnessPredicate.stringMatches(harness.getHref(), href));\n }\n\n /** Gets the href for this nav list item. */\n async getHref(): Promise<string | null> {\n return (await this.host()).getAttribute('href');\n }\n\n /** Clicks on the nav list item. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Focuses the nav list item. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the nav list item. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the nav list item is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate} from '@angular/cdk/testing';\nimport {MatListHarnessBase} from './list-harness-base';\nimport {\n ListItemHarnessFilters,\n ListOptionHarnessFilters,\n SelectionListHarnessFilters\n} from './list-harness-filters';\nimport {getListItemPredicate, MatListItemHarnessBase} from './list-item-harness-base';\n\n/** Harness for interacting with a standard mat-selection-list in tests. */\nexport class MatSelectionListHarness extends MatListHarnessBase<\n typeof MatListOptionHarness, MatListOptionHarness, ListOptionHarnessFilters> {\n /** The selector for the host element of a `MatSelectionList` instance. */\n static hostSelector = 'mat-selection-list';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatSelectionListHarness` that meets\n * certain criteria.\n * @param options Options for filtering which selection list instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: SelectionListHarnessFilters = {}):\n HarnessPredicate<MatSelectionListHarness> {\n return new HarnessPredicate(MatSelectionListHarness, options);\n }\n\n _itemHarness = MatListOptionHarness;\n\n /** Whether the selection list is disabled. */\n async isDisabled(): Promise<boolean> {\n return await (await this.host()).getAttribute('aria-disabled') === 'true';\n }\n\n /**\n * Selects all items matching any of the given filters.\n * @param filters Filters that specify which items should be selected.\n */\n async selectItems(...filters: ListOptionHarnessFilters[]): Promise<void> {\n const items = await this._getItems(filters);\n await Promise.all(items.map(item => item.select()));\n }\n\n /**\n * Deselects all items matching any of the given filters.\n * @param filters Filters that specify which items should be deselected.\n */\n async deselectItems(...filters: ListItemHarnessFilters[]): Promise<void> {\n const items = await this._getItems(filters);\n await Promise.all(items.map(item => item.deselect()));\n }\n\n /** Gets all items matching the given list of filters. */\n private async _getItems(filters: ListOptionHarnessFilters[]): Promise<MatListOptionHarness[]> {\n if (!filters.length) {\n return this.getItems();\n }\n return ([] as MatListOptionHarness[]).concat(...await Promise.all(\n filters.map(filter => this.locatorForAll(MatListOptionHarness.with(filter))())));\n }\n}\n\n/** Harness for interacting with a list option. */\nexport class MatListOptionHarness extends MatListItemHarnessBase {\n /** The selector for the host element of a `MatListOption` instance. */\n static hostSelector = 'mat-list-option';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatListOptionHarness` that\n * meets certain criteria.\n * @param options Options for filtering which list option instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ListOptionHarnessFilters = {}): HarnessPredicate<MatListOptionHarness> {\n return getListItemPredicate(MatListOptionHarness, options)\n .addOption('is selected', options.selected,\n async (harness, selected) => await harness.isSelected() === selected);\n }\n\n private _itemContent = this.locatorFor('.mat-list-item-content');\n\n /** Gets the position of the checkbox relative to the list option content. */\n async getCheckboxPosition(): Promise<'before' | 'after'> {\n return await (await this._itemContent()).hasClass('mat-list-item-content-reverse') ?\n 'after' : 'before';\n }\n\n /** Whether the list option is selected. */\n async isSelected(): Promise<boolean> {\n return await (await this.host()).getAttribute('aria-selected') === 'true';\n }\n\n /** Whether the list option is disabled. */\n async isDisabled(): Promise<boolean> {\n return await (await this.host()).getAttribute('aria-disabled') === 'true';\n }\n\n /** Focuses the list option. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the list option. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the list option is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** Toggles the checked state of the checkbox. */\n async toggle() {\n return (await this.host()).click();\n }\n\n /**\n * Puts the list option in a checked state by toggling it if it is currently unchecked, or doing\n * nothing if it is already checked.\n */\n async select() {\n if (!await this.isSelected()) {\n return this.toggle();\n }\n }\n\n /**\n * Puts the list option in an unchecked state by toggling it if it is currently checked, or doing\n * nothing if it is already unchecked.\n */\n async deselect() {\n if (await this.isSelected()) {\n return this.toggle();\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 './action-list-harness';\nexport * from './list-harness';\nexport * from './list-harness-filters';\nexport * from './nav-list-harness';\nexport * from './selection-list-harness';\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;;;;;;;AAgBA;;;;;;;;AAQA,SAAgB,oBAAoB,CAChC,WAA2C,EAC3C,OAAmC;IACrC,OAAO,IAAI,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC;SAC5C,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAC3B,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;CACrF;;AAGD,MAAa,mBAAoB,SAAQ,gBAAgB;IAGvD,OAAO,IAAI,CAAC,UAAmC,EAAE;QAC/C,OAAO,IAAI,gBAAgB,CAAC,mBAAmB,EAAE,OAAO,CAAC;aACpD,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAC3B,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAA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IAMK,QAAQ;;YACZ,IAAI,MAAM,IAAI,CAAC,UAAU,EAAE,EAAE;gBAC3B,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;aACtB;SACF;KAAA;;;AAtEM,iCAAY,GAAG,iBAAiB,CAAC;;ACxE1C;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
@@ -57,6 +57,12 @@ class MatMenuHarness extends ComponentHarness {
57
57
  return (yield this.host()).blur();
58
58
  });
59
59
  }
60
+ /** Whether the menu is focused. */
61
+ isFocused() {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ return (yield this.host()).isFocused();
64
+ });
65
+ }
60
66
  /** Opens the menu. */
61
67
  open() {
62
68
  return __awaiter(this, void 0, void 0, function* () {
@@ -167,6 +173,12 @@ class MatMenuItemHarness extends ComponentHarness {
167
173
  return (yield this.host()).blur();
168
174
  });
169
175
  }
176
+ /** Whether the menu item is focused. */
177
+ isFocused() {
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ return (yield this.host()).isFocused();
180
+ });
181
+ }
170
182
  /** Clicks the menu item. */
171
183
  click() {
172
184
  return __awaiter(this, void 0, void 0, function* () {
@@ -1 +1 @@
1
- {"version":3,"file":"menu__testing.js","sources":["../../../../../../src/material/menu/testing/menu-harness.ts","../../../../../../src/material/menu/testing/menu-harness-filters.ts","../../../../../../src/material/menu/testing/public-api.ts","../../../../../../src/material/menu/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 {ComponentHarness, HarnessPredicate, TestElement, TestKey} from '@angular/cdk/testing';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {MenuHarnessFilters, MenuItemHarnessFilters} from './menu-harness-filters';\n\n/** Harness for interacting with a standard mat-menu in tests. */\nexport class MatMenuHarness extends ComponentHarness {\n /** The selector for the host element of a `MatMenu` instance. */\n static hostSelector = '.mat-menu-trigger';\n\n private _documentRootLocator = this.documentRootLocatorFactory();\n\n // TODO: potentially extend MatButtonHarness\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatMenuHarness` that meets certain\n * criteria.\n * @param options Options for filtering which menu instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: MenuHarnessFilters = {}): HarnessPredicate<MatMenuHarness> {\n return new HarnessPredicate(MatMenuHarness, options)\n .addOption('triggerText', options.triggerText,\n (harness, text) => HarnessPredicate.stringMatches(harness.getTriggerText(), text));\n }\n\n /** Whether the menu is disabled. */\n async isDisabled(): Promise<boolean> {\n const disabled = (await this.host()).getAttribute('disabled');\n return coerceBooleanProperty(await disabled);\n }\n\n /** Whether the menu is open. */\n async isOpen(): Promise<boolean> {\n return !!(await this._getMenuPanel());\n }\n\n /** Gets the text of the menu's trigger element. */\n async getTriggerText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Focuses the menu. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the menu. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Opens the menu. */\n async open(): Promise<void> {\n if (!await this.isOpen()) {\n return (await this.host()).click();\n }\n }\n\n /** Closes the menu. */\n async close(): Promise<void> {\n const panel = await this._getMenuPanel();\n if (panel) {\n return panel.sendKeys(TestKey.ESCAPE);\n }\n }\n\n /**\n * Gets a list of `MatMenuItemHarness` representing the items in the menu.\n * @param filters Optionally filters which menu items are included.\n */\n async getItems(filters: Omit<MenuItemHarnessFilters, 'ancestor'> = {}):\n Promise<MatMenuItemHarness[]> {\n const panelId = await this._getPanelId();\n if (panelId) {\n return this._documentRootLocator.locatorForAll(\n MatMenuItemHarness.with({...filters, ancestor: `#${panelId}`}))();\n }\n return [];\n }\n\n /**\n * Clicks an item in the menu, and optionally continues clicking items in subsequent sub-menus.\n * @param itemFilter A filter used to represent which item in the menu should be clicked. The\n * first matching menu item will be clicked.\n * @param subItemFilters A list of filters representing the items to click in any subsequent\n * sub-menus. The first item in the sub-menu matching the corresponding filter in\n * `subItemFilters` will be clicked.\n */\n async clickItem(\n itemFilter: Omit<MenuItemHarnessFilters, 'ancestor'>,\n ...subItemFilters: Omit<MenuItemHarnessFilters, 'ancestor'>[]): Promise<void> {\n await this.open();\n const items = await this.getItems(itemFilter);\n if (!items.length) {\n throw Error(`Could not find item matching ${JSON.stringify(itemFilter)}`);\n }\n\n if (!subItemFilters.length) {\n return await items[0].click();\n }\n\n const menu = await items[0].getSubmenu();\n if (!menu) {\n throw Error(`Item matching ${JSON.stringify(itemFilter)} does not have a submenu`);\n }\n return menu.clickItem(...subItemFilters as [Omit<MenuItemHarnessFilters, 'ancestor'>]);\n }\n\n /** Gets the menu panel associated with this menu. */\n private async _getMenuPanel(): Promise<TestElement | null> {\n const panelId = await this._getPanelId();\n return panelId ? this._documentRootLocator.locatorForOptional(`#${panelId}`)() : null;\n }\n\n /** Gets the id of the menu panel associated with this menu. */\n private async _getPanelId(): Promise<string | null> {\n const panelId = await (await this.host()).getAttribute('aria-controls');\n return panelId || null;\n }\n}\n\n\n/** Harness for interacting with a standard mat-menu-item in tests. */\nexport class MatMenuItemHarness extends ComponentHarness {\n /** The selector for the host element of a `MatMenuItem` instance. */\n static hostSelector = '.mat-menu-item';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatMenuItemHarness` that meets\n * certain criteria.\n * @param options Options for filtering which menu item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: MenuItemHarnessFilters = {}): HarnessPredicate<MatMenuItemHarness> {\n return new HarnessPredicate(MatMenuItemHarness, options)\n .addOption('text', options.text,\n (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('hasSubmenu', options.hasSubmenu,\n async (harness, hasSubmenu) => (await harness.hasSubmenu()) === hasSubmenu);\n }\n\n /** Whether the menu is disabled. */\n async isDisabled(): Promise<boolean> {\n const disabled = (await this.host()).getAttribute('disabled');\n return coerceBooleanProperty(await disabled);\n }\n\n /** Gets the text of the menu item. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Focuses the menu item. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the menu item. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Clicks the menu item. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Whether this item has a submenu. */\n async hasSubmenu(): Promise<boolean> {\n return (await this.host()).matchesSelector(MatMenuHarness.hostSelector);\n }\n\n /** Gets the submenu associated with this menu item, or null if none. */\n async getSubmenu(): Promise<MatMenuHarness | null> {\n if (await this.hasSubmenu()) {\n return new MatMenuHarness(this.locatorFactory);\n }\n return null;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseHarnessFilters} from '@angular/cdk/testing';\n\n/** A set of criteria that can be used to filter a list of `MatMenuHarness` instances. */\nexport interface MenuHarnessFilters extends BaseHarnessFilters {\n /** Only find instances whose trigger text matches the given value. */\n triggerText?: string | RegExp;\n}\n\n/** A set of criteria that can be used to filter a list of `MatMenuItemHarness` instances. */\nexport interface MenuItemHarnessFilters extends BaseHarnessFilters {\n /** Only find instances whose text matches the given value. */\n text?: string | RegExp;\n /** Only find instances that have a sub-menu. */\n hasSubmenu?: boolean;\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 './menu-harness';\nexport * from './menu-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;;;;;;;AAYA;AACA,MAAa,cAAe,SAAQ,gBAAgB;IAApD;;QAIU,yBAAoB,GAAG,IAAI,CAAC,0BAA0B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M,IAAI,CAAC,IAAI,EAAE,EAAE,eAAe,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;SACzE;KAAA;;IAGK,UAAU;;YACd,IAAI,MAAM,IAAI,CAAC,UAAU,EAAE,EAAE;gBAC3B,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aAChD;YACD,OAAO,IAAI,CAAC;SACb;KAAA;;;AArDM,+BAAY,GAAG,gBAAgB,CAAC;;ACrIzC;;;;;;GAMG;;ACNH;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
1
+ {"version":3,"file":"menu__testing.js","sources":["../../../../../../src/material/menu/testing/menu-harness.ts","../../../../../../src/material/menu/testing/menu-harness-filters.ts","../../../../../../src/material/menu/testing/public-api.ts","../../../../../../src/material/menu/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 {ComponentHarness, HarnessPredicate, TestElement, TestKey} from '@angular/cdk/testing';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {MenuHarnessFilters, MenuItemHarnessFilters} from './menu-harness-filters';\n\n/** Harness for interacting with a standard mat-menu in tests. */\nexport class MatMenuHarness extends ComponentHarness {\n /** The selector for the host element of a `MatMenu` instance. */\n static hostSelector = '.mat-menu-trigger';\n\n private _documentRootLocator = this.documentRootLocatorFactory();\n\n // TODO: potentially extend MatButtonHarness\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatMenuHarness` that meets certain\n * criteria.\n * @param options Options for filtering which menu instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: MenuHarnessFilters = {}): HarnessPredicate<MatMenuHarness> {\n return new HarnessPredicate(MatMenuHarness, options)\n .addOption('triggerText', options.triggerText,\n (harness, text) => HarnessPredicate.stringMatches(harness.getTriggerText(), text));\n }\n\n /** Whether the menu is disabled. */\n async isDisabled(): Promise<boolean> {\n const disabled = (await this.host()).getAttribute('disabled');\n return coerceBooleanProperty(await disabled);\n }\n\n /** Whether the menu is open. */\n async isOpen(): Promise<boolean> {\n return !!(await this._getMenuPanel());\n }\n\n /** Gets the text of the menu's trigger element. */\n async getTriggerText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Focuses the menu. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the menu. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the menu is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** Opens the menu. */\n async open(): Promise<void> {\n if (!await this.isOpen()) {\n return (await this.host()).click();\n }\n }\n\n /** Closes the menu. */\n async close(): Promise<void> {\n const panel = await this._getMenuPanel();\n if (panel) {\n return panel.sendKeys(TestKey.ESCAPE);\n }\n }\n\n /**\n * Gets a list of `MatMenuItemHarness` representing the items in the menu.\n * @param filters Optionally filters which menu items are included.\n */\n async getItems(filters: Omit<MenuItemHarnessFilters, 'ancestor'> = {}):\n Promise<MatMenuItemHarness[]> {\n const panelId = await this._getPanelId();\n if (panelId) {\n return this._documentRootLocator.locatorForAll(\n MatMenuItemHarness.with({...filters, ancestor: `#${panelId}`}))();\n }\n return [];\n }\n\n /**\n * Clicks an item in the menu, and optionally continues clicking items in subsequent sub-menus.\n * @param itemFilter A filter used to represent which item in the menu should be clicked. The\n * first matching menu item will be clicked.\n * @param subItemFilters A list of filters representing the items to click in any subsequent\n * sub-menus. The first item in the sub-menu matching the corresponding filter in\n * `subItemFilters` will be clicked.\n */\n async clickItem(\n itemFilter: Omit<MenuItemHarnessFilters, 'ancestor'>,\n ...subItemFilters: Omit<MenuItemHarnessFilters, 'ancestor'>[]): Promise<void> {\n await this.open();\n const items = await this.getItems(itemFilter);\n if (!items.length) {\n throw Error(`Could not find item matching ${JSON.stringify(itemFilter)}`);\n }\n\n if (!subItemFilters.length) {\n return await items[0].click();\n }\n\n const menu = await items[0].getSubmenu();\n if (!menu) {\n throw Error(`Item matching ${JSON.stringify(itemFilter)} does not have a submenu`);\n }\n return menu.clickItem(...subItemFilters as [Omit<MenuItemHarnessFilters, 'ancestor'>]);\n }\n\n /** Gets the menu panel associated with this menu. */\n private async _getMenuPanel(): Promise<TestElement | null> {\n const panelId = await this._getPanelId();\n return panelId ? this._documentRootLocator.locatorForOptional(`#${panelId}`)() : null;\n }\n\n /** Gets the id of the menu panel associated with this menu. */\n private async _getPanelId(): Promise<string | null> {\n const panelId = await (await this.host()).getAttribute('aria-controls');\n return panelId || null;\n }\n}\n\n\n/** Harness for interacting with a standard mat-menu-item in tests. */\nexport class MatMenuItemHarness extends ComponentHarness {\n /** The selector for the host element of a `MatMenuItem` instance. */\n static hostSelector = '.mat-menu-item';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatMenuItemHarness` that meets\n * certain criteria.\n * @param options Options for filtering which menu item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: MenuItemHarnessFilters = {}): HarnessPredicate<MatMenuItemHarness> {\n return new HarnessPredicate(MatMenuItemHarness, options)\n .addOption('text', options.text,\n (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('hasSubmenu', options.hasSubmenu,\n async (harness, hasSubmenu) => (await harness.hasSubmenu()) === hasSubmenu);\n }\n\n /** Whether the menu is disabled. */\n async isDisabled(): Promise<boolean> {\n const disabled = (await this.host()).getAttribute('disabled');\n return coerceBooleanProperty(await disabled);\n }\n\n /** Gets the text of the menu item. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Focuses the menu item. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the menu item. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the menu item is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** Clicks the menu item. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Whether this item has a submenu. */\n async hasSubmenu(): Promise<boolean> {\n return (await this.host()).matchesSelector(MatMenuHarness.hostSelector);\n }\n\n /** Gets the submenu associated with this menu item, or null if none. */\n async getSubmenu(): Promise<MatMenuHarness | null> {\n if (await this.hasSubmenu()) {\n return new MatMenuHarness(this.locatorFactory);\n }\n return null;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseHarnessFilters} from '@angular/cdk/testing';\n\n/** A set of criteria that can be used to filter a list of `MatMenuHarness` instances. */\nexport interface MenuHarnessFilters extends BaseHarnessFilters {\n /** Only find instances whose trigger text matches the given value. */\n triggerText?: string | RegExp;\n}\n\n/** A set of criteria that can be used to filter a list of `MatMenuItemHarness` instances. */\nexport interface MenuItemHarnessFilters extends BaseHarnessFilters {\n /** Only find instances whose text matches the given value. */\n text?: string | RegExp;\n /** Only find instances that have a sub-menu. */\n hasSubmenu?: boolean;\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 './menu-harness';\nexport * from './menu-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;;;;;;;AAYA;AACA,MAAa,cAAe,SAAQ,gBAAgB;IAApD;;QAIU,yBAAoB,GAAG,IAAI,CAAC,0BAA0B,EAAE,CAAC;KAmHlE;;;;;;;;IAzGC,OAAO,IAAI,CAAC,UAA8B,EAAE;QAC1C,OAAO,IAAI,gBAAgB,CAAC,cAAc,EAAE,OAAO,CAAC;aAC/C,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,EACzC,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAA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Ac,CAAC,YAAY,CAAC,CAAC;SACzE;KAAA;;IAGK,UAAU;;YACd,IAAI,MAAM,IAAI,CAAC,UAAU,EAAE,EAAE;gBAC3B,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aAChD;YACD,OAAO,IAAI,CAAC;SACb;KAAA;;;AA1DM,+BAAY,GAAG,gBAAgB,CAAC;;AC1IzC;;;;;;GAMG;;ACNH;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
package/fesm2015/menu.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { FocusMonitor, FocusKeyManager, isFakeMousedownFromScreenReader } from '@angular/cdk/a11y';
2
2
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
3
3
  import { UP_ARROW, DOWN_ARROW, END, hasModifierKey, HOME, RIGHT_ARROW, LEFT_ARROW, ESCAPE } from '@angular/cdk/keycodes';
4
- import { Directive, TemplateRef, ComponentFactoryResolver, ApplicationRef, Injector, ViewContainerRef, Inject, ChangeDetectorRef, InjectionToken, Component, ChangeDetectionStrategy, ViewEncapsulation, ElementRef, Optional, Input, HostListener, QueryList, EventEmitter, NgZone, ContentChildren, ViewChild, ContentChild, Output, Self, NgModule } from '@angular/core';
4
+ import { InjectionToken, Directive, TemplateRef, ComponentFactoryResolver, ApplicationRef, Injector, ViewContainerRef, Inject, ChangeDetectorRef, Component, ChangeDetectionStrategy, ViewEncapsulation, ElementRef, Optional, Input, HostListener, QueryList, EventEmitter, isDevMode, NgZone, ContentChildren, ViewChild, ContentChild, Output, Self, NgModule } from '@angular/core';
5
5
  import { Subject, Subscription, merge, of, asapScheduler } from 'rxjs';
6
6
  import { startWith, switchMap, take, filter, takeUntil, delay } from 'rxjs/operators';
7
7
  import { trigger, state, style, transition, group, query, animate } from '@angular/animations';
@@ -82,6 +82,12 @@ const transformMenu = matMenuAnimations.transformMenu;
82
82
  * Use of this source code is governed by an MIT-style license that can be
83
83
  * found in the LICENSE file at https://angular.io/license
84
84
  */
85
+ /**
86
+ * Injection token that can be used to reference instances of `MatMenuContent`. It serves
87
+ * as alternative token to the actual `MatMenuContent` class which could cause unnecessary
88
+ * retention of the class and its directive metadata.
89
+ */
90
+ const MAT_MENU_CONTENT = new InjectionToken('MatMenuContent');
85
91
  /**
86
92
  * Menu content that will be rendered lazily once the menu is opened.
87
93
  */
@@ -143,7 +149,8 @@ class MatMenuContent {
143
149
  }
144
150
  MatMenuContent.decorators = [
145
151
  { type: Directive, args: [{
146
- selector: 'ng-template[matMenuContent]'
152
+ selector: 'ng-template[matMenuContent]',
153
+ providers: [{ provide: MAT_MENU_CONTENT, useExisting: MatMenuContent }],
147
154
  },] }
148
155
  ];
149
156
  MatMenuContent.ctorParameters = () => [
@@ -192,6 +199,15 @@ function throwMatMenuInvalidPositionY() {
192
199
  throw Error(`yPosition value must be either 'above' or below'.
193
200
  Example: <mat-menu yPosition="above" #menu="matMenu"></mat-menu>`);
194
201
  }
202
+ /**
203
+ * Throws an exception for the case when a menu is assigned
204
+ * to a trigger that is placed inside the same menu.
205
+ * @docs-private
206
+ */
207
+ function throwMatMenuRecursiveError() {
208
+ throw Error(`matMenuTriggerFor: menu cannot contain its own trigger. Assign a menu that is ` +
209
+ `not a parent of the trigger or move the trigger outside of the menu.`);
210
+ }
195
211
 
196
212
  /**
197
213
  * @license
@@ -396,6 +412,8 @@ class _MatMenuBase {
396
412
  this._panelAnimationState = 'void';
397
413
  /** Emits whenever an animation on the menu completes. */
398
414
  this._animationDone = new Subject();
415
+ /** Class or list of classes to be added to the overlay panel. */
416
+ this.overlayPanelClass = this._defaultOptions.overlayPanelClass || '';
399
417
  /** Class to be added to the backdrop element. */
400
418
  this.backdropClass = this._defaultOptions.backdropClass;
401
419
  this._overlapTrigger = this._defaultOptions.overlapTrigger;
@@ -413,7 +431,7 @@ class _MatMenuBase {
413
431
  /** Position of the menu in the X axis. */
414
432
  get xPosition() { return this._xPosition; }
415
433
  set xPosition(value) {
416
- if (value !== 'before' && value !== 'after') {
434
+ if (isDevMode() && value !== 'before' && value !== 'after') {
417
435
  throwMatMenuInvalidPositionX();
418
436
  }
419
437
  this._xPosition = value;
@@ -422,7 +440,7 @@ class _MatMenuBase {
422
440
  /** Position of the menu in the Y axis. */
423
441
  get yPosition() { return this._yPosition; }
424
442
  set yPosition(value) {
425
- if (value !== 'above' && value !== 'below') {
443
+ if (isDevMode() && value !== 'above' && value !== 'below') {
426
444
  throwMatMenuInvalidPositionY();
427
445
  }
428
446
  this._yPosition = value;
@@ -681,7 +699,7 @@ _MatMenuBase.propDecorators = {
681
699
  yPosition: [{ type: Input }],
682
700
  templateRef: [{ type: ViewChild, args: [TemplateRef,] }],
683
701
  items: [{ type: ContentChildren, args: [MatMenuItem, { descendants: false },] }],
684
- lazyContent: [{ type: ContentChild, args: [MatMenuContent,] }],
702
+ lazyContent: [{ type: ContentChild, args: [MAT_MENU_CONTENT,] }],
685
703
  overlapTrigger: [{ type: Input }],
686
704
  hasBackdrop: [{ type: Input }],
687
705
  panelClass: [{ type: Input, args: ['class',] }],
@@ -832,6 +850,9 @@ class MatMenuTrigger {
832
850
  this._menu = menu;
833
851
  this._menuCloseSubscription.unsubscribe();
834
852
  if (menu) {
853
+ if (isDevMode() && menu === this._parentMenu) {
854
+ throwMatMenuRecursiveError();
855
+ }
835
856
  this._menuCloseSubscription = menu.close.asObservable().subscribe(reason => {
836
857
  this._destroyMenu();
837
858
  // If a click closed the menu, we should close the entire chain of nested menus.
@@ -995,7 +1016,7 @@ class MatMenuTrigger {
995
1016
  * matMenuTriggerFor. If not, an exception is thrown.
996
1017
  */
997
1018
  _checkMenu() {
998
- if (!this.menu) {
1019
+ if (isDevMode() && !this.menu) {
999
1020
  throwMatMenuMissingError();
1000
1021
  }
1001
1022
  }
@@ -1026,6 +1047,7 @@ class MatMenuTrigger {
1026
1047
  .withLockedPosition()
1027
1048
  .withTransformOriginOn('.mat-menu-panel, .mat-mdc-menu-panel'),
1028
1049
  backdropClass: this.menu.backdropClass || 'cdk-overlay-transparent-backdrop',
1050
+ panelClass: this.menu.overlayPanelClass,
1029
1051
  scrollStrategy: this._scrollStrategy(),
1030
1052
  direction: this._dir
1031
1053
  });
@@ -1261,5 +1283,5 @@ MatMenuModule.decorators = [
1261
1283
  * Generated bundle index. Do not edit.
1262
1284
  */
1263
1285
 
1264
- export { MAT_MENU_DEFAULT_OPTIONS, MAT_MENU_PANEL, MAT_MENU_SCROLL_STRATEGY, MatMenu, MatMenuContent, MatMenuItem, MatMenuModule, MatMenuTrigger, _MatMenu, _MatMenuBase, _MatMenuDirectivesModule, fadeInItems, matMenuAnimations, transformMenu, MAT_MENU_DEFAULT_OPTIONS_FACTORY as ɵangular_material_src_material_menu_menu_a, MAT_MENU_SCROLL_STRATEGY_FACTORY as ɵangular_material_src_material_menu_menu_b, MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER as ɵangular_material_src_material_menu_menu_c };
1286
+ export { MAT_MENU_CONTENT, MAT_MENU_DEFAULT_OPTIONS, MAT_MENU_PANEL, MAT_MENU_SCROLL_STRATEGY, MatMenu, MatMenuContent, MatMenuItem, MatMenuModule, MatMenuTrigger, _MatMenu, _MatMenuBase, _MatMenuDirectivesModule, fadeInItems, matMenuAnimations, transformMenu, MAT_MENU_DEFAULT_OPTIONS_FACTORY as ɵangular_material_src_material_menu_menu_a, MAT_MENU_SCROLL_STRATEGY_FACTORY as ɵangular_material_src_material_menu_menu_b, MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER as ɵangular_material_src_material_menu_menu_c };
1265
1287
  //# sourceMappingURL=menu.js.map