@angular/material 10.0.0-rc.3 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (627) hide show
  1. package/_theming.scss +17 -17
  2. package/autocomplete/index.metadata.json +1 -1
  3. package/autocomplete/testing/autocomplete-harness.d.ts +2 -0
  4. package/bundles/material-autocomplete-testing.umd.js +11 -0
  5. package/bundles/material-autocomplete-testing.umd.js.map +1 -1
  6. package/bundles/material-autocomplete-testing.umd.min.js +2 -2
  7. package/bundles/material-autocomplete-testing.umd.min.js.map +1 -1
  8. package/bundles/material-autocomplete.umd.js +3 -1
  9. package/bundles/material-autocomplete.umd.js.map +1 -1
  10. package/bundles/material-autocomplete.umd.min.js +5 -5
  11. package/bundles/material-autocomplete.umd.min.js.map +1 -1
  12. package/bundles/material-badge-testing.umd.min.js +1 -1
  13. package/bundles/material-badge-testing.umd.min.js.map +1 -1
  14. package/bundles/material-bottom-sheet-testing.umd.min.js +1 -1
  15. package/bundles/material-bottom-sheet-testing.umd.min.js.map +1 -1
  16. package/bundles/material-button-testing.umd.js +11 -0
  17. package/bundles/material-button-testing.umd.js.map +1 -1
  18. package/bundles/material-button-testing.umd.min.js +2 -2
  19. package/bundles/material-button-testing.umd.min.js.map +1 -1
  20. package/bundles/material-button-toggle-testing.umd.js +11 -0
  21. package/bundles/material-button-toggle-testing.umd.js.map +1 -1
  22. package/bundles/material-button-toggle-testing.umd.min.js +3 -3
  23. package/bundles/material-button-toggle-testing.umd.min.js.map +1 -1
  24. package/bundles/material-button-toggle.umd.js +12 -3
  25. package/bundles/material-button-toggle.umd.js.map +1 -1
  26. package/bundles/material-button-toggle.umd.min.js +2 -2
  27. package/bundles/material-button-toggle.umd.min.js.map +1 -1
  28. package/bundles/material-button.umd.js +7 -2
  29. package/bundles/material-button.umd.js.map +1 -1
  30. package/bundles/material-button.umd.min.js +4 -4
  31. package/bundles/material-button.umd.min.js.map +1 -1
  32. package/bundles/material-card-testing.umd.js +335 -0
  33. package/bundles/material-card-testing.umd.js.map +1 -0
  34. package/bundles/material-card-testing.umd.min.js +44 -0
  35. package/bundles/material-card-testing.umd.min.js.map +1 -0
  36. package/bundles/material-checkbox-testing.umd.js +11 -0
  37. package/bundles/material-checkbox-testing.umd.js.map +1 -1
  38. package/bundles/material-checkbox-testing.umd.min.js +3 -3
  39. package/bundles/material-checkbox-testing.umd.min.js.map +1 -1
  40. package/bundles/material-checkbox.umd.js.map +1 -1
  41. package/bundles/material-chips.umd.js +36 -12
  42. package/bundles/material-chips.umd.js.map +1 -1
  43. package/bundles/material-chips.umd.min.js +4 -4
  44. package/bundles/material-chips.umd.min.js.map +1 -1
  45. package/bundles/material-core-testing.umd.min.js +1 -1
  46. package/bundles/material-core-testing.umd.min.js.map +1 -1
  47. package/bundles/material-core.umd.js +11 -3
  48. package/bundles/material-core.umd.js.map +1 -1
  49. package/bundles/material-core.umd.min.js +11 -11
  50. package/bundles/material-core.umd.min.js.map +1 -1
  51. package/bundles/material-datepicker.umd.js +20 -11
  52. package/bundles/material-datepicker.umd.js.map +1 -1
  53. package/bundles/material-datepicker.umd.min.js +5 -5
  54. package/bundles/material-datepicker.umd.min.js.map +1 -1
  55. package/bundles/material-dialog-testing.umd.min.js +1 -1
  56. package/bundles/material-dialog-testing.umd.min.js.map +1 -1
  57. package/bundles/material-dialog.umd.js +45 -8
  58. package/bundles/material-dialog.umd.js.map +1 -1
  59. package/bundles/material-dialog.umd.min.js +14 -7
  60. package/bundles/material-dialog.umd.min.js.map +1 -1
  61. package/bundles/material-divider-testing.umd.min.js +1 -1
  62. package/bundles/material-divider-testing.umd.min.js.map +1 -1
  63. package/bundles/material-expansion-testing.umd.js +11 -0
  64. package/bundles/material-expansion-testing.umd.js.map +1 -1
  65. package/bundles/material-expansion-testing.umd.min.js +3 -3
  66. package/bundles/material-expansion-testing.umd.min.js.map +1 -1
  67. package/bundles/material-form-field-testing.umd.js +32 -0
  68. package/bundles/material-form-field-testing.umd.js.map +1 -1
  69. package/bundles/material-form-field-testing.umd.min.js +4 -4
  70. package/bundles/material-form-field-testing.umd.min.js.map +1 -1
  71. package/bundles/material-form-field.umd.js +47 -21
  72. package/bundles/material-form-field.umd.js.map +1 -1
  73. package/bundles/material-form-field.umd.min.js +5 -5
  74. package/bundles/material-form-field.umd.min.js.map +1 -1
  75. package/bundles/material-grid-list-testing.umd.min.js +1 -1
  76. package/bundles/material-grid-list-testing.umd.min.js.map +1 -1
  77. package/bundles/material-grid-list.umd.js +2 -2
  78. package/bundles/material-grid-list.umd.js.map +1 -1
  79. package/bundles/material-grid-list.umd.min.js +2 -2
  80. package/bundles/material-grid-list.umd.min.js.map +1 -1
  81. package/bundles/material-input-testing.umd.js +23 -6
  82. package/bundles/material-input-testing.umd.js.map +1 -1
  83. package/bundles/material-input-testing.umd.min.js +3 -3
  84. package/bundles/material-input-testing.umd.min.js.map +1 -1
  85. package/bundles/material-input.umd.js +28 -3
  86. package/bundles/material-input.umd.js.map +1 -1
  87. package/bundles/material-input.umd.min.js +3 -3
  88. package/bundles/material-input.umd.min.js.map +1 -1
  89. package/bundles/material-list-testing.umd.js +33 -0
  90. package/bundles/material-list-testing.umd.js.map +1 -1
  91. package/bundles/material-list-testing.umd.min.js +2 -2
  92. package/bundles/material-list-testing.umd.min.js.map +1 -1
  93. package/bundles/material-list.umd.js +3 -3
  94. package/bundles/material-list.umd.min.js +1 -1
  95. package/bundles/material-list.umd.min.js.map +1 -1
  96. package/bundles/material-menu-testing.umd.js +22 -0
  97. package/bundles/material-menu-testing.umd.js.map +1 -1
  98. package/bundles/material-menu-testing.umd.min.js +2 -2
  99. package/bundles/material-menu-testing.umd.min.js.map +1 -1
  100. package/bundles/material-menu.umd.js +13 -2
  101. package/bundles/material-menu.umd.js.map +1 -1
  102. package/bundles/material-menu.umd.min.js +4 -4
  103. package/bundles/material-menu.umd.min.js.map +1 -1
  104. package/bundles/material-paginator-testing.umd.min.js +1 -1
  105. package/bundles/material-paginator-testing.umd.min.js.map +1 -1
  106. package/bundles/material-progress-bar-testing.umd.min.js +1 -1
  107. package/bundles/material-progress-bar-testing.umd.min.js.map +1 -1
  108. package/bundles/material-progress-spinner-testing.umd.js +1 -1
  109. package/bundles/material-progress-spinner-testing.umd.js.map +1 -1
  110. package/bundles/material-progress-spinner-testing.umd.min.js +2 -2
  111. package/bundles/material-progress-spinner-testing.umd.min.js.map +1 -1
  112. package/bundles/material-progress-spinner.umd.js +2 -2
  113. package/bundles/material-progress-spinner.umd.min.js +3 -3
  114. package/bundles/material-progress-spinner.umd.min.js.map +1 -1
  115. package/bundles/material-radio-testing.umd.js +11 -0
  116. package/bundles/material-radio-testing.umd.js.map +1 -1
  117. package/bundles/material-radio-testing.umd.min.js +3 -3
  118. package/bundles/material-radio-testing.umd.min.js.map +1 -1
  119. package/bundles/material-radio.umd.js +15 -5
  120. package/bundles/material-radio.umd.js.map +1 -1
  121. package/bundles/material-radio.umd.min.js +2 -2
  122. package/bundles/material-radio.umd.min.js.map +1 -1
  123. package/bundles/material-select-testing.umd.js +11 -0
  124. package/bundles/material-select-testing.umd.js.map +1 -1
  125. package/bundles/material-select-testing.umd.min.js +2 -2
  126. package/bundles/material-select-testing.umd.min.js.map +1 -1
  127. package/bundles/material-select.umd.js +11 -3
  128. package/bundles/material-select.umd.js.map +1 -1
  129. package/bundles/material-select.umd.min.js +4 -4
  130. package/bundles/material-select.umd.min.js.map +1 -1
  131. package/bundles/material-sidenav-testing.umd.min.js +1 -1
  132. package/bundles/material-sidenav-testing.umd.min.js.map +1 -1
  133. package/bundles/material-sidenav.umd.js +41 -17
  134. package/bundles/material-sidenav.umd.js.map +1 -1
  135. package/bundles/material-sidenav.umd.min.js +2 -2
  136. package/bundles/material-sidenav.umd.min.js.map +1 -1
  137. package/bundles/material-slide-toggle-testing.umd.js +11 -0
  138. package/bundles/material-slide-toggle-testing.umd.js.map +1 -1
  139. package/bundles/material-slide-toggle-testing.umd.min.js +2 -2
  140. package/bundles/material-slide-toggle-testing.umd.min.js.map +1 -1
  141. package/bundles/material-slide-toggle.umd.js.map +1 -1
  142. package/bundles/material-slider-testing.umd.js +11 -0
  143. package/bundles/material-slider-testing.umd.js.map +1 -1
  144. package/bundles/material-slider-testing.umd.min.js +2 -2
  145. package/bundles/material-slider-testing.umd.min.js.map +1 -1
  146. package/bundles/material-snack-bar-testing.umd.min.js +1 -1
  147. package/bundles/material-snack-bar-testing.umd.min.js.map +1 -1
  148. package/bundles/material-snack-bar.umd.js +47 -39
  149. package/bundles/material-snack-bar.umd.js.map +1 -1
  150. package/bundles/material-snack-bar.umd.min.js +2 -2
  151. package/bundles/material-snack-bar.umd.min.js.map +1 -1
  152. package/bundles/material-sort-testing.umd.js +10 -10
  153. package/bundles/material-sort-testing.umd.js.map +1 -1
  154. package/bundles/material-sort-testing.umd.min.js +3 -3
  155. package/bundles/material-sort-testing.umd.min.js.map +1 -1
  156. package/bundles/material-sort.umd.js +25 -12
  157. package/bundles/material-sort.umd.js.map +1 -1
  158. package/bundles/material-sort.umd.min.js +5 -5
  159. package/bundles/material-sort.umd.min.js.map +1 -1
  160. package/bundles/material-table-testing.umd.min.js +1 -1
  161. package/bundles/material-table-testing.umd.min.js.map +1 -1
  162. package/bundles/material-table.umd.min.js +2 -2
  163. package/bundles/material-table.umd.min.js.map +1 -1
  164. package/bundles/material-tabs-testing.umd.min.js +1 -1
  165. package/bundles/material-tabs-testing.umd.min.js.map +1 -1
  166. package/bundles/material-tabs.umd.js +23 -4
  167. package/bundles/material-tabs.umd.js.map +1 -1
  168. package/bundles/material-tabs.umd.min.js +5 -12
  169. package/bundles/material-tabs.umd.min.js.map +1 -1
  170. package/bundles/material-toolbar-testing.umd.js +330 -0
  171. package/bundles/material-toolbar-testing.umd.js.map +1 -0
  172. package/bundles/material-toolbar-testing.umd.min.js +44 -0
  173. package/bundles/material-toolbar-testing.umd.min.js.map +1 -0
  174. package/bundles/material-tooltip-testing.umd.min.js +1 -1
  175. package/bundles/material-tooltip-testing.umd.min.js.map +1 -1
  176. package/bundles/material-tooltip.umd.js +14 -1
  177. package/bundles/material-tooltip.umd.js.map +1 -1
  178. package/bundles/material-tooltip.umd.min.js +3 -3
  179. package/bundles/material-tooltip.umd.min.js.map +1 -1
  180. package/bundles/material-tree.umd.js.map +1 -1
  181. package/button/_button-base.scss +1 -1
  182. package/button/_button-theme.scss +8 -8
  183. package/button/index.metadata.json +1 -1
  184. package/button/testing/button-harness.d.ts +2 -0
  185. package/button-toggle/button-toggle.d.ts +10 -3
  186. package/button-toggle/index.metadata.json +1 -1
  187. package/button-toggle/testing/button-toggle-harness.d.ts +2 -0
  188. package/card/testing/card-harness-filters.d.ts +17 -0
  189. package/card/testing/card-harness.d.ts +36 -0
  190. package/card/testing/index.d.ts +8 -0
  191. package/card/testing/package.json +9 -0
  192. package/card/testing/public-api.d.ts +9 -0
  193. package/checkbox/index.metadata.json +1 -1
  194. package/checkbox/testing/checkbox-harness.d.ts +2 -0
  195. package/chips/chip.d.ts +19 -1
  196. package/chips/index.metadata.json +1 -1
  197. package/core/focus-indicators/_focus-indicators.scss +6 -6
  198. package/core/index.metadata.json +1 -1
  199. package/core/option/optgroup.d.ts +7 -0
  200. package/core/ripple/ripple-ref.d.ts +21 -2
  201. package/core/ripple/ripple-renderer.d.ts +1 -19
  202. package/core/ripple/ripple.d.ts +2 -2
  203. package/core/style/_list-common.scss +1 -1
  204. package/datepicker/date-range-input-parts.d.ts +2 -4
  205. package/datepicker/date-range-input.d.ts +4 -4
  206. package/datepicker/date-range-picker.d.ts +10 -3
  207. package/datepicker/datepicker.d.ts +2 -3
  208. package/datepicker/index.metadata.json +1 -1
  209. package/datepicker/public-api.d.ts +1 -1
  210. package/dialog/dialog-container.d.ts +9 -2
  211. package/dialog/dialog-content-directives.d.ts +1 -0
  212. package/dialog/dialog-ref.d.ts +7 -0
  213. package/dialog/index.metadata.json +1 -1
  214. package/esm2015/autocomplete/autocomplete-module.js +18 -22
  215. package/esm2015/autocomplete/autocomplete-origin.js +16 -20
  216. package/esm2015/autocomplete/autocomplete-trigger.js +519 -521
  217. package/esm2015/autocomplete/autocomplete.js +126 -130
  218. package/esm2015/autocomplete/testing/autocomplete-harness.js +99 -97
  219. package/esm2015/badge/badge-module.js +13 -17
  220. package/esm2015/badge/badge.js +184 -188
  221. package/esm2015/badge/testing/badge-harness.js +74 -78
  222. package/esm2015/bottom-sheet/bottom-sheet-container.js +161 -165
  223. package/esm2015/bottom-sheet/bottom-sheet-module.js +15 -19
  224. package/esm2015/bottom-sheet/bottom-sheet.js +124 -128
  225. package/esm2015/bottom-sheet/testing/bottom-sheet-harness.js +29 -33
  226. package/esm2015/button/button-module.js +20 -24
  227. package/esm2015/button/button.js +111 -114
  228. package/esm2015/button/testing/button-harness.js +60 -58
  229. package/esm2015/button-toggle/button-toggle-module.js +10 -14
  230. package/esm2015/button-toggle/button-toggle.js +368 -368
  231. package/esm2015/button-toggle/testing/button-toggle-group-harness.js +42 -46
  232. package/esm2015/button-toggle/testing/button-toggle-harness.js +113 -111
  233. package/esm2015/card/card-module.js +30 -34
  234. package/esm2015/card/card.js +147 -203
  235. package/esm2015/card/testing/card-harness-filters.js +8 -0
  236. package/esm2015/card/testing/card-harness.js +52 -0
  237. package/esm2015/card/testing/index.js +9 -0
  238. package/esm2015/card/testing/public-api.js +10 -0
  239. package/esm2015/card/testing/testing.externs.js +0 -0
  240. package/esm2015/checkbox/checkbox-module.js +21 -29
  241. package/esm2015/checkbox/checkbox-required-validator.js +9 -13
  242. package/esm2015/checkbox/checkbox.js +315 -319
  243. package/esm2015/checkbox/testing/checkbox-harness.js +150 -148
  244. package/esm2015/chips/chip-input.js +119 -123
  245. package/esm2015/chips/chip-list.js +572 -576
  246. package/esm2015/chips/chip.js +333 -328
  247. package/esm2015/chips/chips-module.js +16 -20
  248. package/esm2015/core/animation/animation.js +12 -20
  249. package/esm2015/core/common-behaviors/common-module.js +91 -95
  250. package/esm2015/core/datetime/index.js +19 -27
  251. package/esm2015/core/datetime/native-date-adapter.js +202 -206
  252. package/esm2015/core/error/error-options.js +16 -24
  253. package/esm2015/core/line/line.js +18 -26
  254. package/esm2015/core/option/index.js +10 -14
  255. package/esm2015/core/option/optgroup.js +36 -33
  256. package/esm2015/core/option/option.js +181 -185
  257. package/esm2015/core/ripple/index.js +10 -14
  258. package/esm2015/core/ripple/ripple-ref.js +1 -1
  259. package/esm2015/core/ripple/ripple-renderer.js +1 -1
  260. package/esm2015/core/ripple/ripple.js +102 -106
  261. package/esm2015/core/selection/index.js +9 -13
  262. package/esm2015/core/selection/pseudo-checkbox/pseudo-checkbox.js +32 -36
  263. package/esm2015/core/testing/optgroup-harness.js +39 -43
  264. package/esm2015/core/testing/option-harness.js +51 -55
  265. package/esm2015/core/version.js +1 -1
  266. package/esm2015/datepicker/calendar-body.js +214 -218
  267. package/esm2015/datepicker/calendar.js +295 -303
  268. package/esm2015/datepicker/date-range-input-parts.js +214 -229
  269. package/esm2015/datepicker/date-range-input.js +244 -242
  270. package/esm2015/datepicker/date-range-picker.js +19 -23
  271. package/esm2015/datepicker/date-range-selection-strategy.js +31 -35
  272. package/esm2015/datepicker/date-selection-model.js +110 -122
  273. package/esm2015/datepicker/datepicker-base.js +418 -426
  274. package/esm2015/datepicker/datepicker-input-base.js +227 -224
  275. package/esm2015/datepicker/datepicker-input.js +111 -115
  276. package/esm2015/datepicker/datepicker-intl.js +37 -41
  277. package/esm2015/datepicker/datepicker-module.js +62 -66
  278. package/esm2015/datepicker/datepicker-toggle.js +81 -89
  279. package/esm2015/datepicker/datepicker.js +13 -17
  280. package/esm2015/datepicker/month-view.js +283 -287
  281. package/esm2015/datepicker/multi-year-view.js +198 -202
  282. package/esm2015/datepicker/public-api.js +2 -2
  283. package/esm2015/datepicker/year-view.js +220 -224
  284. package/esm2015/dialog/dialog-container.js +175 -164
  285. package/esm2015/dialog/dialog-content-directives.js +105 -114
  286. package/esm2015/dialog/dialog-module.js +32 -36
  287. package/esm2015/dialog/dialog-ref.js +17 -3
  288. package/esm2015/dialog/dialog.js +236 -240
  289. package/esm2015/dialog/testing/dialog-harness.js +58 -62
  290. package/esm2015/divider/divider-module.js +10 -14
  291. package/esm2015/divider/divider.js +33 -37
  292. package/esm2015/divider/testing/divider-harness.js +16 -20
  293. package/esm2015/expansion/accordion.js +73 -77
  294. package/esm2015/expansion/expansion-module.js +26 -30
  295. package/esm2015/expansion/expansion-panel-content.js +13 -17
  296. package/esm2015/expansion/expansion-panel-header.js +168 -180
  297. package/esm2015/expansion/expansion-panel.js +144 -152
  298. package/esm2015/expansion/testing/accordion-harness.js +24 -28
  299. package/esm2015/expansion/testing/expansion-harness.js +136 -134
  300. package/esm2015/form-field/error.js +26 -23
  301. package/esm2015/form-field/form-field-control.js +6 -10
  302. package/esm2015/form-field/form-field-module.js +31 -35
  303. package/esm2015/form-field/form-field.js +407 -409
  304. package/esm2015/form-field/hint.js +35 -29
  305. package/esm2015/form-field/label.js +8 -12
  306. package/esm2015/form-field/placeholder.js +8 -12
  307. package/esm2015/form-field/prefix.js +16 -13
  308. package/esm2015/form-field/suffix.js +16 -13
  309. package/esm2015/form-field/testing/form-field-harness.js +220 -206
  310. package/esm2015/grid-list/grid-list-module.js +26 -30
  311. package/esm2015/grid-list/grid-list.js +108 -112
  312. package/esm2015/grid-list/grid-tile.js +91 -111
  313. package/esm2015/grid-list/testing/grid-list-harness.js +62 -66
  314. package/esm2015/grid-list/testing/grid-tile-harness.js +69 -73
  315. package/esm2015/grid-list/tile-styler.js +1 -1
  316. package/esm2015/icon/icon-module.js +10 -14
  317. package/esm2015/icon/icon-registry.js +406 -410
  318. package/esm2015/icon/icon.js +228 -232
  319. package/esm2015/icon/testing/fake-icon-registry.js +66 -74
  320. package/esm2015/input/autosize.js +30 -34
  321. package/esm2015/input/input-module.js +21 -25
  322. package/esm2015/input/input.js +305 -284
  323. package/esm2015/input/testing/input-harness.js +129 -123
  324. package/esm2015/list/list-module.js +32 -36
  325. package/esm2015/list/list.js +165 -189
  326. package/esm2015/list/selection-list.js +503 -511
  327. package/esm2015/list/testing/action-list-harness.js +55 -57
  328. package/esm2015/list/testing/list-harness.js +31 -39
  329. package/esm2015/list/testing/list-item-harness-base.js +13 -17
  330. package/esm2015/list/testing/nav-list-harness.js +62 -64
  331. package/esm2015/list/testing/selection-list-harness.js +136 -138
  332. package/esm2015/menu/menu-content.js +74 -71
  333. package/esm2015/menu/menu-item.js +119 -123
  334. package/esm2015/menu/menu-module.js +29 -37
  335. package/esm2015/menu/menu-panel.js +1 -1
  336. package/esm2015/menu/menu-trigger.js +402 -405
  337. package/esm2015/menu/menu.js +329 -339
  338. package/esm2015/menu/testing/menu-harness.js +193 -189
  339. package/esm2015/paginator/paginator-intl.js +36 -40
  340. package/esm2015/paginator/paginator-module.js +16 -20
  341. package/esm2015/paginator/paginator.js +205 -209
  342. package/esm2015/paginator/testing/paginator-harness.js +91 -95
  343. package/esm2015/progress-bar/progress-bar-module.js +10 -14
  344. package/esm2015/progress-bar/progress-bar.js +114 -118
  345. package/esm2015/progress-bar/testing/progress-bar-harness.js +27 -31
  346. package/esm2015/progress-spinner/progress-spinner-module.js +17 -21
  347. package/esm2015/progress-spinner/progress-spinner.js +181 -189
  348. package/esm2015/progress-spinner/testing/progress-spinner-harness.js +28 -32
  349. package/esm2015/radio/radio-module.js +10 -14
  350. package/esm2015/radio/radio.js +437 -444
  351. package/esm2015/radio/testing/radio-harness.js +241 -243
  352. package/esm2015/select/select-module.js +23 -27
  353. package/esm2015/select/select.js +917 -918
  354. package/esm2015/select/testing/select-harness.js +138 -136
  355. package/esm2015/sidenav/drawer.js +632 -620
  356. package/esm2015/sidenav/sidenav-module.js +31 -35
  357. package/esm2015/sidenav/sidenav.js +104 -116
  358. package/esm2015/sidenav/testing/drawer-harness.js +40 -44
  359. package/esm2015/sidenav/testing/sidenav-harness.js +20 -24
  360. package/esm2015/slide-toggle/slide-toggle-module.js +27 -35
  361. package/esm2015/slide-toggle/slide-toggle-required-validator.js +9 -13
  362. package/esm2015/slide-toggle/slide-toggle.js +184 -188
  363. package/esm2015/slide-toggle/testing/slide-toggle-harness.js +123 -121
  364. package/esm2015/slider/slider-module.js +10 -14
  365. package/esm2015/slider/slider.js +640 -644
  366. package/esm2015/slider/testing/slider-harness.js +129 -127
  367. package/esm2015/snack-bar/simple-snack-bar.js +32 -36
  368. package/esm2015/snack-bar/snack-bar-container.js +144 -148
  369. package/esm2015/snack-bar/snack-bar-module.js +17 -21
  370. package/esm2015/snack-bar/snack-bar-ref.js +1 -1
  371. package/esm2015/snack-bar/snack-bar.js +208 -205
  372. package/esm2015/snack-bar/testing/snack-bar-harness.js +112 -116
  373. package/esm2015/sort/sort-header-intl.js +21 -21
  374. package/esm2015/sort/sort-header.js +200 -194
  375. package/esm2015/sort/sort-module.js +11 -15
  376. package/esm2015/sort/sort.js +92 -96
  377. package/esm2015/sort/testing/sort-harness.js +28 -32
  378. package/esm2015/sort/testing/sort-header-harness.js +66 -67
  379. package/esm2015/stepper/step-header.js +78 -82
  380. package/esm2015/stepper/step-label.js +8 -12
  381. package/esm2015/stepper/stepper-button.js +23 -31
  382. package/esm2015/stepper/stepper-icon.js +16 -20
  383. package/esm2015/stepper/stepper-intl.js +15 -19
  384. package/esm2015/stepper/stepper-module.js +40 -44
  385. package/esm2015/stepper/stepper.js +139 -155
  386. package/esm2015/table/cell.js +94 -122
  387. package/esm2015/table/row.js +90 -118
  388. package/esm2015/table/table-module.js +13 -17
  389. package/esm2015/table/table.js +26 -30
  390. package/esm2015/table/testing/cell-harness.js +56 -68
  391. package/esm2015/table/testing/row-harness.js +90 -102
  392. package/esm2015/table/testing/table-harness.js +65 -69
  393. package/esm2015/table/text-column.js +17 -21
  394. package/esm2015/tabs/index.js +4 -2
  395. package/esm2015/tabs/ink-bar.js +55 -59
  396. package/esm2015/tabs/paginated-tab-header.js +415 -419
  397. package/esm2015/tabs/tab-body.js +179 -191
  398. package/esm2015/tabs/tab-content.js +21 -16
  399. package/esm2015/tabs/tab-group.js +263 -271
  400. package/esm2015/tabs/tab-header.js +69 -77
  401. package/esm2015/tabs/tab-label-wrapper.js +29 -33
  402. package/esm2015/tabs/tab-label.js +16 -13
  403. package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +199 -215
  404. package/esm2015/tabs/tab.js +80 -83
  405. package/esm2015/tabs/tabs-module.js +38 -42
  406. package/esm2015/tabs/testing/tab-group-harness.js +52 -56
  407. package/esm2015/tabs/testing/tab-harness.js +78 -82
  408. package/esm2015/toolbar/testing/index.js +9 -0
  409. package/esm2015/toolbar/testing/public-api.js +10 -0
  410. package/esm2015/toolbar/testing/testing.externs.js +0 -0
  411. package/esm2015/toolbar/testing/toolbar-harness-filters.js +8 -0
  412. package/esm2015/toolbar/testing/toolbar-harness.js +47 -0
  413. package/esm2015/toolbar/toolbar-module.js +10 -14
  414. package/esm2015/toolbar/toolbar.js +61 -69
  415. package/esm2015/tooltip/testing/tooltip-harness.js +43 -47
  416. package/esm2015/tooltip/tooltip-module.js +17 -21
  417. package/esm2015/tooltip/tooltip.js +502 -497
  418. package/esm2015/tree/data-source/flat-data-source.js +1 -1
  419. package/esm2015/tree/node.js +99 -111
  420. package/esm2015/tree/outlet.js +19 -23
  421. package/esm2015/tree/padding.js +13 -17
  422. package/esm2015/tree/toggle.js +15 -19
  423. package/esm2015/tree/tree-module.js +10 -14
  424. package/esm2015/tree/tree.js +23 -27
  425. package/expansion/testing/expansion-harness.d.ts +2 -0
  426. package/fesm2015/autocomplete/testing.js +98 -95
  427. package/fesm2015/autocomplete/testing.js.map +1 -1
  428. package/fesm2015/autocomplete.js +677 -687
  429. package/fesm2015/autocomplete.js.map +1 -1
  430. package/fesm2015/badge/testing.js +73 -76
  431. package/fesm2015/badge/testing.js.map +1 -1
  432. package/fesm2015/badge.js +195 -201
  433. package/fesm2015/badge.js.map +1 -1
  434. package/fesm2015/bottom-sheet/testing.js +28 -31
  435. package/fesm2015/bottom-sheet/testing.js.map +1 -1
  436. package/fesm2015/bottom-sheet.js +297 -306
  437. package/fesm2015/bottom-sheet.js.map +1 -1
  438. package/fesm2015/button/testing.js +59 -56
  439. package/fesm2015/button/testing.js.map +1 -1
  440. package/fesm2015/button-toggle/testing.js +155 -155
  441. package/fesm2015/button-toggle/testing.js.map +1 -1
  442. package/fesm2015/button-toggle.js +377 -378
  443. package/fesm2015/button-toggle.js.map +1 -1
  444. package/fesm2015/button.js +129 -133
  445. package/fesm2015/button.js.map +1 -1
  446. package/fesm2015/card/testing.js +79 -0
  447. package/fesm2015/card/testing.js.map +1 -0
  448. package/fesm2015/card.js +175 -220
  449. package/fesm2015/card.js.map +1 -1
  450. package/fesm2015/checkbox/testing.js +149 -146
  451. package/fesm2015/checkbox/testing.js.map +1 -1
  452. package/fesm2015/checkbox.js +342 -354
  453. package/fesm2015/checkbox.js.map +1 -1
  454. package/fesm2015/chips.js +1039 -1039
  455. package/fesm2015/chips.js.map +1 -1
  456. package/fesm2015/core/testing.js +88 -94
  457. package/fesm2015/core/testing.js.map +1 -1
  458. package/fesm2015/core.js +729 -773
  459. package/fesm2015/core.js.map +1 -1
  460. package/fesm2015/datepicker.js +2821 -2884
  461. package/fesm2015/datepicker.js.map +1 -1
  462. package/fesm2015/dialog/testing.js +57 -60
  463. package/fesm2015/dialog/testing.js.map +1 -1
  464. package/fesm2015/dialog.js +564 -549
  465. package/fesm2015/dialog.js.map +1 -1
  466. package/fesm2015/divider/testing.js +15 -18
  467. package/fesm2015/divider/testing.js.map +1 -1
  468. package/fesm2015/divider.js +41 -47
  469. package/fesm2015/divider.js.map +1 -1
  470. package/fesm2015/expansion/testing.js +159 -159
  471. package/fesm2015/expansion/testing.js.map +1 -1
  472. package/fesm2015/expansion.js +422 -446
  473. package/fesm2015/expansion.js.map +1 -1
  474. package/fesm2015/form-field/testing.js +219 -204
  475. package/fesm2015/form-field/testing.js.map +1 -1
  476. package/fesm2015/form-field.js +538 -532
  477. package/fesm2015/form-field.js.map +1 -1
  478. package/fesm2015/grid-list/testing.js +129 -135
  479. package/fesm2015/grid-list/testing.js.map +1 -1
  480. package/fesm2015/grid-list.js +221 -242
  481. package/fesm2015/grid-list.js.map +1 -1
  482. package/fesm2015/icon/testing.js +65 -71
  483. package/fesm2015/icon/testing.js.map +1 -1
  484. package/fesm2015/icon.js +660 -669
  485. package/fesm2015/icon.js.map +1 -1
  486. package/fesm2015/input/testing.js +128 -121
  487. package/fesm2015/input/testing.js.map +1 -1
  488. package/fesm2015/input.js +353 -337
  489. package/fesm2015/input.js.map +1 -1
  490. package/fesm2015/list/testing.js +298 -307
  491. package/fesm2015/list/testing.js.map +1 -1
  492. package/fesm2015/list.js +698 -725
  493. package/fesm2015/list.js.map +1 -1
  494. package/fesm2015/menu/testing.js +192 -186
  495. package/fesm2015/menu/testing.js.map +1 -1
  496. package/fesm2015/menu.js +948 -962
  497. package/fesm2015/menu.js.map +1 -1
  498. package/fesm2015/paginator/testing.js +90 -93
  499. package/fesm2015/paginator/testing.js.map +1 -1
  500. package/fesm2015/paginator.js +247 -256
  501. package/fesm2015/paginator.js.map +1 -1
  502. package/fesm2015/progress-bar/testing.js +26 -29
  503. package/fesm2015/progress-bar/testing.js.map +1 -1
  504. package/fesm2015/progress-bar.js +122 -128
  505. package/fesm2015/progress-bar.js.map +1 -1
  506. package/fesm2015/progress-spinner/testing.js +27 -30
  507. package/fesm2015/progress-spinner/testing.js.map +1 -1
  508. package/fesm2015/progress-spinner.js +196 -205
  509. package/fesm2015/progress-spinner.js.map +1 -1
  510. package/fesm2015/radio/testing.js +240 -240
  511. package/fesm2015/radio/testing.js.map +1 -1
  512. package/fesm2015/radio.js +447 -453
  513. package/fesm2015/radio.js.map +1 -1
  514. package/fesm2015/select/testing.js +137 -134
  515. package/fesm2015/select/testing.js.map +1 -1
  516. package/fesm2015/select.js +939 -941
  517. package/fesm2015/select.js.map +1 -1
  518. package/fesm2015/sidenav/testing.js +58 -64
  519. package/fesm2015/sidenav/testing.js.map +1 -1
  520. package/fesm2015/sidenav.js +765 -762
  521. package/fesm2015/sidenav.js.map +1 -1
  522. package/fesm2015/slide-toggle/testing.js +122 -119
  523. package/fesm2015/slide-toggle/testing.js.map +1 -1
  524. package/fesm2015/slide-toggle.js +217 -229
  525. package/fesm2015/slide-toggle.js.map +1 -1
  526. package/fesm2015/slider/testing.js +128 -125
  527. package/fesm2015/slider/testing.js.map +1 -1
  528. package/fesm2015/slider.js +648 -654
  529. package/fesm2015/slider.js.map +1 -1
  530. package/fesm2015/snack-bar/testing.js +111 -114
  531. package/fesm2015/snack-bar/testing.js.map +1 -1
  532. package/fesm2015/snack-bar.js +426 -431
  533. package/fesm2015/snack-bar.js.map +1 -1
  534. package/fesm2015/sort/testing.js +92 -95
  535. package/fesm2015/sort/testing.js.map +1 -1
  536. package/fesm2015/sort.js +320 -318
  537. package/fesm2015/sort.js.map +1 -1
  538. package/fesm2015/stepper.js +312 -345
  539. package/fesm2015/stepper.js.map +1 -1
  540. package/fesm2015/table/testing.js +208 -229
  541. package/fesm2015/table/testing.js.map +1 -1
  542. package/fesm2015/table.js +235 -286
  543. package/fesm2015/table.js.map +1 -1
  544. package/fesm2015/tabs/testing.js +128 -134
  545. package/fesm2015/tabs/testing.js.map +1 -1
  546. package/fesm2015/tabs.js +1362 -1399
  547. package/fesm2015/tabs.js.map +1 -1
  548. package/fesm2015/toolbar/testing.js +74 -0
  549. package/fesm2015/toolbar/testing.js.map +1 -0
  550. package/fesm2015/toolbar.js +69 -78
  551. package/fesm2015/toolbar.js.map +1 -1
  552. package/fesm2015/tooltip/testing.js +42 -45
  553. package/fesm2015/tooltip/testing.js.map +1 -1
  554. package/fesm2015/tooltip.js +517 -513
  555. package/fesm2015/tooltip.js.map +1 -1
  556. package/fesm2015/tree.js +173 -197
  557. package/fesm2015/tree.js.map +1 -1
  558. package/form-field/error.d.ts +7 -0
  559. package/form-field/hint.d.ts +10 -0
  560. package/form-field/index.metadata.json +1 -1
  561. package/form-field/prefix.d.ts +7 -0
  562. package/form-field/suffix.d.ts +7 -0
  563. package/form-field/testing/form-field-harness.d.ts +8 -0
  564. package/grid-list/grid-list.d.ts +2 -1
  565. package/grid-list/index.metadata.json +1 -1
  566. package/grid-list/tile-styler.d.ts +10 -5
  567. package/input/_input-theme.scss +2 -2
  568. package/input/index.metadata.json +1 -1
  569. package/input/input.d.ts +6 -2
  570. package/input/testing/input-harness.d.ts +2 -0
  571. package/list/index.metadata.json +1 -1
  572. package/list/testing/action-list-harness.d.ts +2 -0
  573. package/list/testing/nav-list-harness.d.ts +2 -0
  574. package/list/testing/selection-list-harness.d.ts +2 -0
  575. package/menu/index.metadata.json +1 -1
  576. package/menu/menu-content.d.ts +7 -1
  577. package/menu/menu-panel.d.ts +1 -0
  578. package/menu/menu.d.ts +4 -0
  579. package/menu/testing/menu-harness.d.ts +4 -0
  580. package/package.json +6 -6
  581. package/prebuilt-themes/deeppurple-amber.css +1 -1
  582. package/prebuilt-themes/indigo-pink.css +1 -1
  583. package/prebuilt-themes/pink-bluegrey.css +1 -1
  584. package/prebuilt-themes/purple-green.css +1 -1
  585. package/progress-spinner/index.metadata.json +1 -1
  586. package/radio/index.metadata.json +1 -1
  587. package/radio/radio.d.ts +6 -0
  588. package/radio/testing/radio-harness.d.ts +2 -0
  589. package/schematics/migration.json +5 -0
  590. package/schematics/ng-add/index.js +2 -2
  591. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +3 -3
  592. package/schematics/ng-generate/navigation/schema.json +5 -0
  593. package/schematics/ng-update/data/index.js +1 -1
  594. package/schematics/ng-update/index.d.ts +2 -0
  595. package/schematics/ng-update/index.js +7 -2
  596. package/schematics/ng-update/migrations/hammer-gestures-v9/hammer-gestures-migration.js +639 -639
  597. package/schematics/ng-update/migrations/misc-ripples-v7/ripple-speed-factor-migration.js +1 -1
  598. package/select/index.metadata.json +1 -1
  599. package/select/select.d.ts +6 -0
  600. package/select/testing/select-harness.d.ts +2 -0
  601. package/sidenav/drawer.d.ts +15 -3
  602. package/sidenav/index.metadata.json +1 -1
  603. package/slide-toggle/index.metadata.json +1 -1
  604. package/slide-toggle/testing/slide-toggle-harness.d.ts +2 -0
  605. package/slider/testing/slider-harness.d.ts +2 -0
  606. package/snack-bar/index.metadata.json +1 -1
  607. package/snack-bar/simple-snack-bar.d.ts +13 -1
  608. package/snack-bar/snack-bar-container.d.ts +16 -3
  609. package/snack-bar/snack-bar-ref.d.ts +3 -3
  610. package/snack-bar/snack-bar.d.ts +10 -3
  611. package/sort/index.metadata.json +1 -1
  612. package/sort/sort-header-intl.d.ts +5 -1
  613. package/sort/sort-header.d.ts +3 -1
  614. package/sort/testing/sort-header-harness.d.ts +6 -2
  615. package/tabs/index.d.ts +3 -1
  616. package/tabs/index.metadata.json +1 -1
  617. package/tabs/tab-content.d.ts +7 -1
  618. package/tabs/tab-label.d.ts +7 -0
  619. package/toolbar/testing/index.d.ts +8 -0
  620. package/toolbar/testing/package.json +9 -0
  621. package/toolbar/testing/public-api.d.ts +9 -0
  622. package/toolbar/testing/toolbar-harness-filters.d.ts +13 -0
  623. package/toolbar/testing/toolbar-harness.d.ts +31 -0
  624. package/tooltip/index.metadata.json +1 -1
  625. package/tooltip/tooltip.d.ts +1 -0
  626. package/tree/data-source/flat-data-source.d.ts +4 -4
  627. package/tree/index.metadata.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"paginator__testing.js","sources":["../../../../../../src/material/paginator/testing/paginator-harness.ts","../../../../../../src/material/paginator/testing/paginator-harness-filters.ts","../../../../../../src/material/paginator/testing/public-api.ts","../../../../../../src/material/paginator/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} from '@angular/cdk/testing';\nimport {MatSelectHarness} from '@angular/material/select/testing';\nimport {coerceNumberProperty} from '@angular/cdk/coercion';\nimport {PaginatorHarnessFilters} from './paginator-harness-filters';\n\n\n/** Harness for interacting with a standard mat-paginator in tests. */\nexport class MatPaginatorHarness extends ComponentHarness {\n /** Selector used to find paginator instances. */\n static hostSelector = '.mat-paginator';\n private _nextButton = this.locatorFor('.mat-paginator-navigation-next');\n private _previousButton = this.locatorFor('.mat-paginator-navigation-previous');\n private _firstPageButton = this.locatorForOptional('.mat-paginator-navigation-first');\n private _lastPageButton = this.locatorForOptional('.mat-paginator-navigation-last');\n private _select = this.locatorForOptional(MatSelectHarness.with({\n ancestor: '.mat-paginator-page-size'\n }));\n private _pageSizeFallback = this.locatorFor('.mat-paginator-page-size-value');\n private _rangeLabel = this.locatorFor('.mat-paginator-range-label');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatPaginatorHarness` that meets\n * certain criteria.\n * @param options Options for filtering which paginator instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: PaginatorHarnessFilters = {}): HarnessPredicate<MatPaginatorHarness> {\n return new HarnessPredicate(MatPaginatorHarness, options);\n }\n\n /** Goes to the next page in the paginator. */\n async goToNextPage(): Promise<void> {\n return (await this._nextButton()).click();\n }\n\n /** Goes to the previous page in the paginator. */\n async goToPreviousPage(): Promise<void> {\n return (await this._previousButton()).click();\n }\n\n /** Goes to the first page in the paginator. */\n async goToFirstPage(): Promise<void> {\n const button = await this._firstPageButton();\n\n // The first page button isn't enabled by default so we need to check for it.\n if (!button) {\n throw Error('Could not find first page button inside paginator. ' +\n 'Make sure that `showFirstLastButtons` is enabled.');\n }\n\n return button.click();\n }\n\n /** Goes to the last page in the paginator. */\n async goToLastPage(): Promise<void> {\n const button = await this._lastPageButton();\n\n // The last page button isn't enabled by default so we need to check for it.\n if (!button) {\n throw Error('Could not find last page button inside paginator. ' +\n 'Make sure that `showFirstLastButtons` is enabled.');\n }\n\n return button.click();\n }\n\n /**\n * Sets the page size of the paginator.\n * @param size Page size that should be select.\n */\n async setPageSize(size: number): Promise<void> {\n const select = await this._select();\n\n // The select is only available if the `pageSizeOptions` are\n // set to an array with more than one item.\n if (!select) {\n throw Error('Cannot find page size selector in paginator. ' +\n 'Make sure that the `pageSizeOptions` have been configured.');\n }\n\n return select.clickOptions({text: `${size}`});\n }\n\n /** Gets the page size of the paginator. */\n async getPageSize(): Promise<number> {\n const select = await this._select();\n const value = select ? select.getValueText() : (await this._pageSizeFallback()).text();\n return coerceNumberProperty(await value);\n }\n\n /** Gets the text of the range labe of the paginator. */\n async getRangeLabel(): Promise<string> {\n return (await this._rangeLabel()).text();\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 `MatPaginatorHarness` instances. */\nexport interface PaginatorHarnessFilters extends BaseHarnessFilters {\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 './paginator-harness';\nexport * from './paginator-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;;;;;;;AAcA;AACA;IAAA,MAAa,mBAAoB,SAAQ,gBAAgB;QAAzD;;YAGU,gBAAW,GAAG,IAAI,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC;YAChE,oBAAe,GAAG,IAAI,CAAC,UAAU,CAAC,oCAAoC,CAAC,CAAC;YACxE,qBAAgB,GAAG,IAAI,CAAC,kBAAkB,CAAC,iCAAiC,CAAC,CAAC;YAC9E,oBAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,gCAAgC,CAAC,CAAC;YAC5E,YAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,CAAC;gBAC9D,QAAQ,EAAE,0BAA0B;aACrC,CAAC,CAAC,CAAC;YACI,sBAAiB,GAAG,IAAI,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC;YACtE,gBAAW,GAAG,IAAI,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC;SA4ErE;;;;;;;QApEC,OAAO,IAAI,CAAC,UAAmC,EAAE;YAC/C,OAAO,IAAI,gBAAgB,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;SAC3D;;QAGK,YAAY;;gBAChB,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC;aAC3C;SAAA;;QAGK,gBAAgB;;gBACpB,OAAO,CAAC,MAAM,IAAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,CAAC;aAC/C;SAAA;;QAGK,aAAa;;gBACjB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;;gBAG7C,IAAI,CAAC,MAAM,EAAE;oBACX,MAAM,KAAK,CAAC,qDAAqD;wBACrD,mDAAmD,CAAC,CAAC;iBAClE;gBAED,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;aACvB;SAAA;;QAGK,YAAY;;gBAChB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;;gBAG5C,IAAI,CAAC,MAAM,EAAE;oBACX,MAAM,KAAK,CAAC,oDAAoD;wBACpD,mDAAmD,CAAC,CAAC;iBAClE;gBAED,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;aACvB;SAAA;;;;;QAMK,WAAW,CAAC,IAAY;;gBAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;;;gBAIpC,IAAI,CAAC,MAAM,EAAE;oBACX,MAAM,KAAK,CAAC,+CAA+C;wBAC/C,4DAA4D,CAAC,CAAC;iBAC3E;gBAED,OAAO,MAAM,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,GAAG,IAAI,EAAE,EAAC,CAAC,CAAC;aAC/C;SAAA;;QAGK,WAAW;;gBACf,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;gBACpC,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,CAAC;gBACvF,OAAO,oBAAoB,CAAC,MAAM,KAAK,CAAC,CAAC;aAC1C;SAAA;;QAGK,aAAa;;gBACjB,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC;aAC1C;SAAA;;;IApFM,gCAAY,GAAG,gBAAgB,CAAC;IAqFzC,0BAAC;;;ACtGD;;;;;;GAMG;;ACNH;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
1
+ {"version":3,"file":"paginator__testing.js","sources":["../../../../../../src/material/paginator/testing/paginator-harness.ts","../../../../../../src/material/paginator/testing/paginator-harness-filters.ts","../../../../../../src/material/paginator/testing/public-api.ts","../../../../../../src/material/paginator/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} from '@angular/cdk/testing';\nimport {MatSelectHarness} from '@angular/material/select/testing';\nimport {coerceNumberProperty} from '@angular/cdk/coercion';\nimport {PaginatorHarnessFilters} from './paginator-harness-filters';\n\n\n/** Harness for interacting with a standard mat-paginator in tests. */\nexport class MatPaginatorHarness extends ComponentHarness {\n /** Selector used to find paginator instances. */\n static hostSelector = '.mat-paginator';\n private _nextButton = this.locatorFor('.mat-paginator-navigation-next');\n private _previousButton = this.locatorFor('.mat-paginator-navigation-previous');\n private _firstPageButton = this.locatorForOptional('.mat-paginator-navigation-first');\n private _lastPageButton = this.locatorForOptional('.mat-paginator-navigation-last');\n private _select = this.locatorForOptional(MatSelectHarness.with({\n ancestor: '.mat-paginator-page-size'\n }));\n private _pageSizeFallback = this.locatorFor('.mat-paginator-page-size-value');\n private _rangeLabel = this.locatorFor('.mat-paginator-range-label');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatPaginatorHarness` that meets\n * certain criteria.\n * @param options Options for filtering which paginator instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: PaginatorHarnessFilters = {}): HarnessPredicate<MatPaginatorHarness> {\n return new HarnessPredicate(MatPaginatorHarness, options);\n }\n\n /** Goes to the next page in the paginator. */\n async goToNextPage(): Promise<void> {\n return (await this._nextButton()).click();\n }\n\n /** Goes to the previous page in the paginator. */\n async goToPreviousPage(): Promise<void> {\n return (await this._previousButton()).click();\n }\n\n /** Goes to the first page in the paginator. */\n async goToFirstPage(): Promise<void> {\n const button = await this._firstPageButton();\n\n // The first page button isn't enabled by default so we need to check for it.\n if (!button) {\n throw Error('Could not find first page button inside paginator. ' +\n 'Make sure that `showFirstLastButtons` is enabled.');\n }\n\n return button.click();\n }\n\n /** Goes to the last page in the paginator. */\n async goToLastPage(): Promise<void> {\n const button = await this._lastPageButton();\n\n // The last page button isn't enabled by default so we need to check for it.\n if (!button) {\n throw Error('Could not find last page button inside paginator. ' +\n 'Make sure that `showFirstLastButtons` is enabled.');\n }\n\n return button.click();\n }\n\n /**\n * Sets the page size of the paginator.\n * @param size Page size that should be select.\n */\n async setPageSize(size: number): Promise<void> {\n const select = await this._select();\n\n // The select is only available if the `pageSizeOptions` are\n // set to an array with more than one item.\n if (!select) {\n throw Error('Cannot find page size selector in paginator. ' +\n 'Make sure that the `pageSizeOptions` have been configured.');\n }\n\n return select.clickOptions({text: `${size}`});\n }\n\n /** Gets the page size of the paginator. */\n async getPageSize(): Promise<number> {\n const select = await this._select();\n const value = select ? select.getValueText() : (await this._pageSizeFallback()).text();\n return coerceNumberProperty(await value);\n }\n\n /** Gets the text of the range labe of the paginator. */\n async getRangeLabel(): Promise<string> {\n return (await this._rangeLabel()).text();\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 `MatPaginatorHarness` instances. */\nexport interface PaginatorHarnessFilters extends BaseHarnessFilters {\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 './paginator-harness';\nexport * from './paginator-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;;;;;;;AAcA;AACA,MAAa,mBAAoB,SAAQ,gBAAgB;IAAzD;;QAGU,gBAAW,GAAG,IAAI,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC;QAChE,oBAAe,GAAG,IAAI,CAAC,UAAU,CAAC,oCAAoC,CAAC,CAAC;QACxE,qBAAgB,GAAG,IAAI,CAAC,kBAAkB,CAAC,iCAAiC,CAAC,CAAC;QAC9E,oBAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,gCAAgC,CAAC,CAAC;QAC5E,YAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,CAAC;YAC9D,QAAQ,EAAE,0BAA0B;SACrC,CAAC,CAAC,CAAC;QACI,sBAAiB,GAAG,IAAI,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC;QACtE,gBAAW,GAAG,IAAI,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC;KA4ErE;;;;;;;IApEC,OAAO,IAAI,CAAC,UAAmC,EAAE;QAC/C,OAAO,IAAI,gBAAgB,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;KAC3D;;IAGK,YAAY;;YAChB,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC;SAC3C;KAAA;;IAGK,gBAAgB;;YACpB,OAAO,CAAC,MAAM,IAAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,CAAC;SAC/C;KAAA;;IAGK,aAAa;;YACjB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;;YAG7C,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM,KAAK,CAAC,qDAAqD;oBACrD,mDAAmD,CAAC,CAAC;aAClE;YAED,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;SACvB;KAAA;;IAGK,YAAY;;YAChB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;;YAG5C,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM,KAAK,CAAC,oDAAoD;oBACpD,mDAAmD,CAAC,CAAC;aAClE;YAED,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;SACvB;KAAA;;;;;IAMK,WAAW,CAAC,IAAY;;YAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;;;YAIpC,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM,KAAK,CAAC,+CAA+C;oBAC/C,4DAA4D,CAAC,CAAC;aAC3E;YAED,OAAO,MAAM,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,GAAG,IAAI,EAAE,EAAC,CAAC,CAAC;SAC/C;KAAA;;IAGK,WAAW;;YACf,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;YACpC,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,CAAC;YACvF,OAAO,oBAAoB,CAAC,MAAM,KAAK,CAAC,CAAC;SAC1C;KAAA;;IAGK,aAAa;;YACjB,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC;SAC1C;KAAA;;;AApFM,gCAAY,GAAG,gBAAgB,CAAC;;ACjBzC;;;;;;GAMG;;ACNH;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
@@ -18,45 +18,42 @@ import { mixinDisabled, mixinInitialized } from '@angular/material/core';
18
18
  * To modify the labels and text displayed, create a new instance of MatPaginatorIntl and
19
19
  * include it in a custom provider
20
20
  */
21
- let MatPaginatorIntl = /** @class */ (() => {
22
- class MatPaginatorIntl {
23
- constructor() {
24
- /**
25
- * Stream to emit from when labels are changed. Use this to notify components when the labels have
26
- * changed after initialization.
27
- */
28
- this.changes = new Subject();
29
- /** A label for the page size selector. */
30
- this.itemsPerPageLabel = 'Items per page:';
31
- /** A label for the button that increments the current page. */
32
- this.nextPageLabel = 'Next page';
33
- /** A label for the button that decrements the current page. */
34
- this.previousPageLabel = 'Previous page';
35
- /** A label for the button that moves to the first page. */
36
- this.firstPageLabel = 'First page';
37
- /** A label for the button that moves to the last page. */
38
- this.lastPageLabel = 'Last page';
39
- /** A label for the range of items within the current page and the length of the whole list. */
40
- this.getRangeLabel = (page, pageSize, length) => {
41
- if (length == 0 || pageSize == 0) {
42
- return `0 of ${length}`;
43
- }
44
- length = Math.max(length, 0);
45
- const startIndex = page * pageSize;
46
- // If the start index exceeds the list length, do not try and fix the end index to the end.
47
- const endIndex = startIndex < length ?
48
- Math.min(startIndex + pageSize, length) :
49
- startIndex + pageSize;
50
- return `${startIndex + 1} – ${endIndex} of ${length}`;
51
- };
52
- }
21
+ class MatPaginatorIntl {
22
+ constructor() {
23
+ /**
24
+ * Stream to emit from when labels are changed. Use this to notify components when the labels have
25
+ * changed after initialization.
26
+ */
27
+ this.changes = new Subject();
28
+ /** A label for the page size selector. */
29
+ this.itemsPerPageLabel = 'Items per page:';
30
+ /** A label for the button that increments the current page. */
31
+ this.nextPageLabel = 'Next page';
32
+ /** A label for the button that decrements the current page. */
33
+ this.previousPageLabel = 'Previous page';
34
+ /** A label for the button that moves to the first page. */
35
+ this.firstPageLabel = 'First page';
36
+ /** A label for the button that moves to the last page. */
37
+ this.lastPageLabel = 'Last page';
38
+ /** A label for the range of items within the current page and the length of the whole list. */
39
+ this.getRangeLabel = (page, pageSize, length) => {
40
+ if (length == 0 || pageSize == 0) {
41
+ return `0 of ${length}`;
42
+ }
43
+ length = Math.max(length, 0);
44
+ const startIndex = page * pageSize;
45
+ // If the start index exceeds the list length, do not try and fix the end index to the end.
46
+ const endIndex = startIndex < length ?
47
+ Math.min(startIndex + pageSize, length) :
48
+ startIndex + pageSize;
49
+ return `${startIndex + 1} – ${endIndex} of ${length}`;
50
+ };
53
51
  }
54
- MatPaginatorIntl.ɵprov = ɵɵdefineInjectable({ factory: function MatPaginatorIntl_Factory() { return new MatPaginatorIntl(); }, token: MatPaginatorIntl, providedIn: "root" });
55
- MatPaginatorIntl.decorators = [
56
- { type: Injectable, args: [{ providedIn: 'root' },] }
57
- ];
58
- return MatPaginatorIntl;
59
- })();
52
+ }
53
+ MatPaginatorIntl.ɵprov = ɵɵdefineInjectable({ factory: function MatPaginatorIntl_Factory() { return new MatPaginatorIntl(); }, token: MatPaginatorIntl, providedIn: "root" });
54
+ MatPaginatorIntl.decorators = [
55
+ { type: Injectable, args: [{ providedIn: 'root' },] }
56
+ ];
60
57
  /** @docs-private */
61
58
  function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl) {
62
59
  return parentIntl || new MatPaginatorIntl();
@@ -96,220 +93,217 @@ const _MatPaginatorBase = mixinDisabled(mixinInitialized(MatPaginatorBase));
96
93
  * page, user-selectable options to change that size, what items are being shown, and
97
94
  * navigational button to go to the previous or next page.
98
95
  */
99
- let MatPaginator = /** @class */ (() => {
100
- class MatPaginator extends _MatPaginatorBase {
101
- constructor(_intl, _changeDetectorRef, defaults) {
102
- super();
103
- this._intl = _intl;
104
- this._changeDetectorRef = _changeDetectorRef;
105
- this._pageIndex = 0;
106
- this._length = 0;
107
- this._pageSizeOptions = [];
108
- this._hidePageSize = false;
109
- this._showFirstLastButtons = false;
110
- /** Event emitted when the paginator changes the page size or page index. */
111
- this.page = new EventEmitter();
112
- this._intlChanges = _intl.changes.subscribe(() => this._changeDetectorRef.markForCheck());
113
- if (defaults) {
114
- const { pageSize, pageSizeOptions, hidePageSize, showFirstLastButtons } = defaults;
115
- if (pageSize != null) {
116
- this._pageSize = pageSize;
117
- }
118
- if (pageSizeOptions != null) {
119
- this._pageSizeOptions = pageSizeOptions;
120
- }
121
- if (hidePageSize != null) {
122
- this._hidePageSize = hidePageSize;
123
- }
124
- if (showFirstLastButtons != null) {
125
- this._showFirstLastButtons = showFirstLastButtons;
126
- }
96
+ class MatPaginator extends _MatPaginatorBase {
97
+ constructor(_intl, _changeDetectorRef, defaults) {
98
+ super();
99
+ this._intl = _intl;
100
+ this._changeDetectorRef = _changeDetectorRef;
101
+ this._pageIndex = 0;
102
+ this._length = 0;
103
+ this._pageSizeOptions = [];
104
+ this._hidePageSize = false;
105
+ this._showFirstLastButtons = false;
106
+ /** Event emitted when the paginator changes the page size or page index. */
107
+ this.page = new EventEmitter();
108
+ this._intlChanges = _intl.changes.subscribe(() => this._changeDetectorRef.markForCheck());
109
+ if (defaults) {
110
+ const { pageSize, pageSizeOptions, hidePageSize, showFirstLastButtons } = defaults;
111
+ if (pageSize != null) {
112
+ this._pageSize = pageSize;
127
113
  }
128
- }
129
- /** The zero-based page index of the displayed list of items. Defaulted to 0. */
130
- get pageIndex() { return this._pageIndex; }
131
- set pageIndex(value) {
132
- this._pageIndex = Math.max(coerceNumberProperty(value), 0);
133
- this._changeDetectorRef.markForCheck();
134
- }
135
- /** The length of the total number of items that are being paginated. Defaulted to 0. */
136
- get length() { return this._length; }
137
- set length(value) {
138
- this._length = coerceNumberProperty(value);
139
- this._changeDetectorRef.markForCheck();
140
- }
141
- /** Number of items to display on a page. By default set to 50. */
142
- get pageSize() { return this._pageSize; }
143
- set pageSize(value) {
144
- this._pageSize = Math.max(coerceNumberProperty(value), 0);
145
- this._updateDisplayedPageSizeOptions();
146
- }
147
- /** The set of provided page size options to display to the user. */
148
- get pageSizeOptions() { return this._pageSizeOptions; }
149
- set pageSizeOptions(value) {
150
- this._pageSizeOptions = (value || []).map(p => coerceNumberProperty(p));
151
- this._updateDisplayedPageSizeOptions();
152
- }
153
- /** Whether to hide the page size selection UI from the user. */
154
- get hidePageSize() { return this._hidePageSize; }
155
- set hidePageSize(value) {
156
- this._hidePageSize = coerceBooleanProperty(value);
157
- }
158
- /** Whether to show the first/last buttons UI to the user. */
159
- get showFirstLastButtons() { return this._showFirstLastButtons; }
160
- set showFirstLastButtons(value) {
161
- this._showFirstLastButtons = coerceBooleanProperty(value);
162
- }
163
- ngOnInit() {
164
- this._initialized = true;
165
- this._updateDisplayedPageSizeOptions();
166
- this._markInitialized();
167
- }
168
- ngOnDestroy() {
169
- this._intlChanges.unsubscribe();
170
- }
171
- /** Advances to the next page if it exists. */
172
- nextPage() {
173
- if (!this.hasNextPage()) {
174
- return;
175
- }
176
- const previousPageIndex = this.pageIndex;
177
- this.pageIndex++;
178
- this._emitPageEvent(previousPageIndex);
179
- }
180
- /** Move back to the previous page if it exists. */
181
- previousPage() {
182
- if (!this.hasPreviousPage()) {
183
- return;
114
+ if (pageSizeOptions != null) {
115
+ this._pageSizeOptions = pageSizeOptions;
184
116
  }
185
- const previousPageIndex = this.pageIndex;
186
- this.pageIndex--;
187
- this._emitPageEvent(previousPageIndex);
188
- }
189
- /** Move to the first page if not already there. */
190
- firstPage() {
191
- // hasPreviousPage being false implies at the start
192
- if (!this.hasPreviousPage()) {
193
- return;
117
+ if (hidePageSize != null) {
118
+ this._hidePageSize = hidePageSize;
194
119
  }
195
- const previousPageIndex = this.pageIndex;
196
- this.pageIndex = 0;
197
- this._emitPageEvent(previousPageIndex);
198
- }
199
- /** Move to the last page if not already there. */
200
- lastPage() {
201
- // hasNextPage being false implies at the end
202
- if (!this.hasNextPage()) {
203
- return;
120
+ if (showFirstLastButtons != null) {
121
+ this._showFirstLastButtons = showFirstLastButtons;
204
122
  }
205
- const previousPageIndex = this.pageIndex;
206
- this.pageIndex = this.getNumberOfPages() - 1;
207
- this._emitPageEvent(previousPageIndex);
208
123
  }
209
- /** Whether there is a previous page. */
210
- hasPreviousPage() {
211
- return this.pageIndex >= 1 && this.pageSize != 0;
124
+ }
125
+ /** The zero-based page index of the displayed list of items. Defaulted to 0. */
126
+ get pageIndex() { return this._pageIndex; }
127
+ set pageIndex(value) {
128
+ this._pageIndex = Math.max(coerceNumberProperty(value), 0);
129
+ this._changeDetectorRef.markForCheck();
130
+ }
131
+ /** The length of the total number of items that are being paginated. Defaulted to 0. */
132
+ get length() { return this._length; }
133
+ set length(value) {
134
+ this._length = coerceNumberProperty(value);
135
+ this._changeDetectorRef.markForCheck();
136
+ }
137
+ /** Number of items to display on a page. By default set to 50. */
138
+ get pageSize() { return this._pageSize; }
139
+ set pageSize(value) {
140
+ this._pageSize = Math.max(coerceNumberProperty(value), 0);
141
+ this._updateDisplayedPageSizeOptions();
142
+ }
143
+ /** The set of provided page size options to display to the user. */
144
+ get pageSizeOptions() { return this._pageSizeOptions; }
145
+ set pageSizeOptions(value) {
146
+ this._pageSizeOptions = (value || []).map(p => coerceNumberProperty(p));
147
+ this._updateDisplayedPageSizeOptions();
148
+ }
149
+ /** Whether to hide the page size selection UI from the user. */
150
+ get hidePageSize() { return this._hidePageSize; }
151
+ set hidePageSize(value) {
152
+ this._hidePageSize = coerceBooleanProperty(value);
153
+ }
154
+ /** Whether to show the first/last buttons UI to the user. */
155
+ get showFirstLastButtons() { return this._showFirstLastButtons; }
156
+ set showFirstLastButtons(value) {
157
+ this._showFirstLastButtons = coerceBooleanProperty(value);
158
+ }
159
+ ngOnInit() {
160
+ this._initialized = true;
161
+ this._updateDisplayedPageSizeOptions();
162
+ this._markInitialized();
163
+ }
164
+ ngOnDestroy() {
165
+ this._intlChanges.unsubscribe();
166
+ }
167
+ /** Advances to the next page if it exists. */
168
+ nextPage() {
169
+ if (!this.hasNextPage()) {
170
+ return;
212
171
  }
213
- /** Whether there is a next page. */
214
- hasNextPage() {
215
- const maxPageIndex = this.getNumberOfPages() - 1;
216
- return this.pageIndex < maxPageIndex && this.pageSize != 0;
172
+ const previousPageIndex = this.pageIndex;
173
+ this.pageIndex++;
174
+ this._emitPageEvent(previousPageIndex);
175
+ }
176
+ /** Move back to the previous page if it exists. */
177
+ previousPage() {
178
+ if (!this.hasPreviousPage()) {
179
+ return;
217
180
  }
218
- /** Calculate the number of pages */
219
- getNumberOfPages() {
220
- if (!this.pageSize) {
221
- return 0;
222
- }
223
- return Math.ceil(this.length / this.pageSize);
181
+ const previousPageIndex = this.pageIndex;
182
+ this.pageIndex--;
183
+ this._emitPageEvent(previousPageIndex);
184
+ }
185
+ /** Move to the first page if not already there. */
186
+ firstPage() {
187
+ // hasPreviousPage being false implies at the start
188
+ if (!this.hasPreviousPage()) {
189
+ return;
224
190
  }
225
- /**
226
- * Changes the page size so that the first item displayed on the page will still be
227
- * displayed using the new page size.
228
- *
229
- * For example, if the page size is 10 and on the second page (items indexed 10-19) then
230
- * switching so that the page size is 5 will set the third page as the current page so
231
- * that the 10th item will still be displayed.
232
- */
233
- _changePageSize(pageSize) {
234
- // Current page needs to be updated to reflect the new page size. Navigate to the page
235
- // containing the previous page's first item.
236
- const startIndex = this.pageIndex * this.pageSize;
237
- const previousPageIndex = this.pageIndex;
238
- this.pageIndex = Math.floor(startIndex / pageSize) || 0;
239
- this.pageSize = pageSize;
240
- this._emitPageEvent(previousPageIndex);
191
+ const previousPageIndex = this.pageIndex;
192
+ this.pageIndex = 0;
193
+ this._emitPageEvent(previousPageIndex);
194
+ }
195
+ /** Move to the last page if not already there. */
196
+ lastPage() {
197
+ // hasNextPage being false implies at the end
198
+ if (!this.hasNextPage()) {
199
+ return;
241
200
  }
242
- /** Checks whether the buttons for going forwards should be disabled. */
243
- _nextButtonsDisabled() {
244
- return this.disabled || !this.hasNextPage();
201
+ const previousPageIndex = this.pageIndex;
202
+ this.pageIndex = this.getNumberOfPages() - 1;
203
+ this._emitPageEvent(previousPageIndex);
204
+ }
205
+ /** Whether there is a previous page. */
206
+ hasPreviousPage() {
207
+ return this.pageIndex >= 1 && this.pageSize != 0;
208
+ }
209
+ /** Whether there is a next page. */
210
+ hasNextPage() {
211
+ const maxPageIndex = this.getNumberOfPages() - 1;
212
+ return this.pageIndex < maxPageIndex && this.pageSize != 0;
213
+ }
214
+ /** Calculate the number of pages */
215
+ getNumberOfPages() {
216
+ if (!this.pageSize) {
217
+ return 0;
245
218
  }
246
- /** Checks whether the buttons for going backwards should be disabled. */
247
- _previousButtonsDisabled() {
248
- return this.disabled || !this.hasPreviousPage();
219
+ return Math.ceil(this.length / this.pageSize);
220
+ }
221
+ /**
222
+ * Changes the page size so that the first item displayed on the page will still be
223
+ * displayed using the new page size.
224
+ *
225
+ * For example, if the page size is 10 and on the second page (items indexed 10-19) then
226
+ * switching so that the page size is 5 will set the third page as the current page so
227
+ * that the 10th item will still be displayed.
228
+ */
229
+ _changePageSize(pageSize) {
230
+ // Current page needs to be updated to reflect the new page size. Navigate to the page
231
+ // containing the previous page's first item.
232
+ const startIndex = this.pageIndex * this.pageSize;
233
+ const previousPageIndex = this.pageIndex;
234
+ this.pageIndex = Math.floor(startIndex / pageSize) || 0;
235
+ this.pageSize = pageSize;
236
+ this._emitPageEvent(previousPageIndex);
237
+ }
238
+ /** Checks whether the buttons for going forwards should be disabled. */
239
+ _nextButtonsDisabled() {
240
+ return this.disabled || !this.hasNextPage();
241
+ }
242
+ /** Checks whether the buttons for going backwards should be disabled. */
243
+ _previousButtonsDisabled() {
244
+ return this.disabled || !this.hasPreviousPage();
245
+ }
246
+ /**
247
+ * Updates the list of page size options to display to the user. Includes making sure that
248
+ * the page size is an option and that the list is sorted.
249
+ */
250
+ _updateDisplayedPageSizeOptions() {
251
+ if (!this._initialized) {
252
+ return;
249
253
  }
250
- /**
251
- * Updates the list of page size options to display to the user. Includes making sure that
252
- * the page size is an option and that the list is sorted.
253
- */
254
- _updateDisplayedPageSizeOptions() {
255
- if (!this._initialized) {
256
- return;
257
- }
258
- // If no page size is provided, use the first page size option or the default page size.
259
- if (!this.pageSize) {
260
- this._pageSize = this.pageSizeOptions.length != 0 ?
261
- this.pageSizeOptions[0] :
262
- DEFAULT_PAGE_SIZE;
263
- }
264
- this._displayedPageSizeOptions = this.pageSizeOptions.slice();
265
- if (this._displayedPageSizeOptions.indexOf(this.pageSize) === -1) {
266
- this._displayedPageSizeOptions.push(this.pageSize);
267
- }
268
- // Sort the numbers using a number-specific sort function.
269
- this._displayedPageSizeOptions.sort((a, b) => a - b);
270
- this._changeDetectorRef.markForCheck();
254
+ // If no page size is provided, use the first page size option or the default page size.
255
+ if (!this.pageSize) {
256
+ this._pageSize = this.pageSizeOptions.length != 0 ?
257
+ this.pageSizeOptions[0] :
258
+ DEFAULT_PAGE_SIZE;
271
259
  }
272
- /** Emits an event notifying that a change of the paginator's properties has been triggered. */
273
- _emitPageEvent(previousPageIndex) {
274
- this.page.emit({
275
- previousPageIndex,
276
- pageIndex: this.pageIndex,
277
- pageSize: this.pageSize,
278
- length: this.length
279
- });
260
+ this._displayedPageSizeOptions = this.pageSizeOptions.slice();
261
+ if (this._displayedPageSizeOptions.indexOf(this.pageSize) === -1) {
262
+ this._displayedPageSizeOptions.push(this.pageSize);
280
263
  }
264
+ // Sort the numbers using a number-specific sort function.
265
+ this._displayedPageSizeOptions.sort((a, b) => a - b);
266
+ this._changeDetectorRef.markForCheck();
267
+ }
268
+ /** Emits an event notifying that a change of the paginator's properties has been triggered. */
269
+ _emitPageEvent(previousPageIndex) {
270
+ this.page.emit({
271
+ previousPageIndex,
272
+ pageIndex: this.pageIndex,
273
+ pageSize: this.pageSize,
274
+ length: this.length
275
+ });
281
276
  }
282
- MatPaginator.decorators = [
283
- { type: Component, args: [{
284
- selector: 'mat-paginator',
285
- exportAs: 'matPaginator',
286
- template: "<div class=\"mat-paginator-outer-container\">\n <div class=\"mat-paginator-container\">\n <div class=\"mat-paginator-page-size\" *ngIf=\"!hidePageSize\">\n <div class=\"mat-paginator-page-size-label\">\n {{_intl.itemsPerPageLabel}}\n </div>\n\n <mat-form-field\n *ngIf=\"_displayedPageSizeOptions.length > 1\"\n [color]=\"color\"\n class=\"mat-paginator-page-size-select\">\n <mat-select\n [value]=\"pageSize\"\n [disabled]=\"disabled\"\n [aria-label]=\"_intl.itemsPerPageLabel\"\n (selectionChange)=\"_changePageSize($event.value)\">\n <mat-option *ngFor=\"let pageSizeOption of _displayedPageSizeOptions\" [value]=\"pageSizeOption\">\n {{pageSizeOption}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <div\n class=\"mat-paginator-page-size-value\"\n *ngIf=\"_displayedPageSizeOptions.length <= 1\">{{pageSize}}</div>\n </div>\n\n <div class=\"mat-paginator-range-actions\">\n <div class=\"mat-paginator-range-label\">\n {{_intl.getRangeLabel(pageIndex, pageSize, length)}}\n </div>\n\n <button mat-icon-button type=\"button\"\n class=\"mat-paginator-navigation-first\"\n (click)=\"firstPage()\"\n [attr.aria-label]=\"_intl.firstPageLabel\"\n [matTooltip]=\"_intl.firstPageLabel\"\n [matTooltipDisabled]=\"_previousButtonsDisabled()\"\n [matTooltipPosition]=\"'above'\"\n [disabled]=\"_previousButtonsDisabled()\"\n *ngIf=\"showFirstLastButtons\">\n <svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\">\n <path d=\"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z\"/>\n </svg>\n </button>\n <button mat-icon-button type=\"button\"\n class=\"mat-paginator-navigation-previous\"\n (click)=\"previousPage()\"\n [attr.aria-label]=\"_intl.previousPageLabel\"\n [matTooltip]=\"_intl.previousPageLabel\"\n [matTooltipDisabled]=\"_previousButtonsDisabled()\"\n [matTooltipPosition]=\"'above'\"\n [disabled]=\"_previousButtonsDisabled()\">\n <svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/>\n </svg>\n </button>\n <button mat-icon-button type=\"button\"\n class=\"mat-paginator-navigation-next\"\n (click)=\"nextPage()\"\n [attr.aria-label]=\"_intl.nextPageLabel\"\n [matTooltip]=\"_intl.nextPageLabel\"\n [matTooltipDisabled]=\"_nextButtonsDisabled()\"\n [matTooltipPosition]=\"'above'\"\n [disabled]=\"_nextButtonsDisabled()\">\n <svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"/>\n </svg>\n </button>\n <button mat-icon-button type=\"button\"\n class=\"mat-paginator-navigation-last\"\n (click)=\"lastPage()\"\n [attr.aria-label]=\"_intl.lastPageLabel\"\n [matTooltip]=\"_intl.lastPageLabel\"\n [matTooltipDisabled]=\"_nextButtonsDisabled()\"\n [matTooltipPosition]=\"'above'\"\n [disabled]=\"_nextButtonsDisabled()\"\n *ngIf=\"showFirstLastButtons\">\n <svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\">\n <path d=\"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z\"/>\n </svg>\n </button>\n </div>\n </div>\n</div>\n",
287
- inputs: ['disabled'],
288
- host: {
289
- 'class': 'mat-paginator',
290
- },
291
- changeDetection: ChangeDetectionStrategy.OnPush,
292
- encapsulation: ViewEncapsulation.None,
293
- styles: [".mat-paginator{display:block}.mat-paginator-outer-container{display:flex}.mat-paginator-container{display:flex;align-items:center;justify-content:flex-end;padding:0 8px;flex-wrap:wrap-reverse;width:100%}.mat-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-paginator-page-size{margin-right:0;margin-left:8px}.mat-paginator-page-size-label{margin:0 4px}.mat-paginator-page-size-select{margin:6px 4px 0 4px;width:56px}.mat-paginator-page-size-select.mat-form-field-appearance-outline{width:64px}.mat-paginator-page-size-select.mat-form-field-appearance-fill{width:64px}.mat-paginator-range-label{margin:0 32px 0 24px}.mat-paginator-range-actions{display:flex;align-items:center}.mat-paginator-icon{width:28px;fill:currentColor}[dir=rtl] .mat-paginator-icon{transform:rotate(180deg)}\n"]
294
- },] }
295
- ];
296
- MatPaginator.ctorParameters = () => [
297
- { type: MatPaginatorIntl },
298
- { type: ChangeDetectorRef },
299
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_PAGINATOR_DEFAULT_OPTIONS,] }] }
300
- ];
301
- MatPaginator.propDecorators = {
302
- color: [{ type: Input }],
303
- pageIndex: [{ type: Input }],
304
- length: [{ type: Input }],
305
- pageSize: [{ type: Input }],
306
- pageSizeOptions: [{ type: Input }],
307
- hidePageSize: [{ type: Input }],
308
- showFirstLastButtons: [{ type: Input }],
309
- page: [{ type: Output }]
310
- };
311
- return MatPaginator;
312
- })();
277
+ }
278
+ MatPaginator.decorators = [
279
+ { type: Component, args: [{
280
+ selector: 'mat-paginator',
281
+ exportAs: 'matPaginator',
282
+ template: "<div class=\"mat-paginator-outer-container\">\n <div class=\"mat-paginator-container\">\n <div class=\"mat-paginator-page-size\" *ngIf=\"!hidePageSize\">\n <div class=\"mat-paginator-page-size-label\">\n {{_intl.itemsPerPageLabel}}\n </div>\n\n <mat-form-field\n *ngIf=\"_displayedPageSizeOptions.length > 1\"\n [color]=\"color\"\n class=\"mat-paginator-page-size-select\">\n <mat-select\n [value]=\"pageSize\"\n [disabled]=\"disabled\"\n [aria-label]=\"_intl.itemsPerPageLabel\"\n (selectionChange)=\"_changePageSize($event.value)\">\n <mat-option *ngFor=\"let pageSizeOption of _displayedPageSizeOptions\" [value]=\"pageSizeOption\">\n {{pageSizeOption}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <div\n class=\"mat-paginator-page-size-value\"\n *ngIf=\"_displayedPageSizeOptions.length <= 1\">{{pageSize}}</div>\n </div>\n\n <div class=\"mat-paginator-range-actions\">\n <div class=\"mat-paginator-range-label\">\n {{_intl.getRangeLabel(pageIndex, pageSize, length)}}\n </div>\n\n <button mat-icon-button type=\"button\"\n class=\"mat-paginator-navigation-first\"\n (click)=\"firstPage()\"\n [attr.aria-label]=\"_intl.firstPageLabel\"\n [matTooltip]=\"_intl.firstPageLabel\"\n [matTooltipDisabled]=\"_previousButtonsDisabled()\"\n [matTooltipPosition]=\"'above'\"\n [disabled]=\"_previousButtonsDisabled()\"\n *ngIf=\"showFirstLastButtons\">\n <svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\">\n <path d=\"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z\"/>\n </svg>\n </button>\n <button mat-icon-button type=\"button\"\n class=\"mat-paginator-navigation-previous\"\n (click)=\"previousPage()\"\n [attr.aria-label]=\"_intl.previousPageLabel\"\n [matTooltip]=\"_intl.previousPageLabel\"\n [matTooltipDisabled]=\"_previousButtonsDisabled()\"\n [matTooltipPosition]=\"'above'\"\n [disabled]=\"_previousButtonsDisabled()\">\n <svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/>\n </svg>\n </button>\n <button mat-icon-button type=\"button\"\n class=\"mat-paginator-navigation-next\"\n (click)=\"nextPage()\"\n [attr.aria-label]=\"_intl.nextPageLabel\"\n [matTooltip]=\"_intl.nextPageLabel\"\n [matTooltipDisabled]=\"_nextButtonsDisabled()\"\n [matTooltipPosition]=\"'above'\"\n [disabled]=\"_nextButtonsDisabled()\">\n <svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"/>\n </svg>\n </button>\n <button mat-icon-button type=\"button\"\n class=\"mat-paginator-navigation-last\"\n (click)=\"lastPage()\"\n [attr.aria-label]=\"_intl.lastPageLabel\"\n [matTooltip]=\"_intl.lastPageLabel\"\n [matTooltipDisabled]=\"_nextButtonsDisabled()\"\n [matTooltipPosition]=\"'above'\"\n [disabled]=\"_nextButtonsDisabled()\"\n *ngIf=\"showFirstLastButtons\">\n <svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\">\n <path d=\"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z\"/>\n </svg>\n </button>\n </div>\n </div>\n</div>\n",
283
+ inputs: ['disabled'],
284
+ host: {
285
+ 'class': 'mat-paginator',
286
+ },
287
+ changeDetection: ChangeDetectionStrategy.OnPush,
288
+ encapsulation: ViewEncapsulation.None,
289
+ styles: [".mat-paginator{display:block}.mat-paginator-outer-container{display:flex}.mat-paginator-container{display:flex;align-items:center;justify-content:flex-end;padding:0 8px;flex-wrap:wrap-reverse;width:100%}.mat-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-paginator-page-size{margin-right:0;margin-left:8px}.mat-paginator-page-size-label{margin:0 4px}.mat-paginator-page-size-select{margin:6px 4px 0 4px;width:56px}.mat-paginator-page-size-select.mat-form-field-appearance-outline{width:64px}.mat-paginator-page-size-select.mat-form-field-appearance-fill{width:64px}.mat-paginator-range-label{margin:0 32px 0 24px}.mat-paginator-range-actions{display:flex;align-items:center}.mat-paginator-icon{width:28px;fill:currentColor}[dir=rtl] .mat-paginator-icon{transform:rotate(180deg)}\n"]
290
+ },] }
291
+ ];
292
+ MatPaginator.ctorParameters = () => [
293
+ { type: MatPaginatorIntl },
294
+ { type: ChangeDetectorRef },
295
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_PAGINATOR_DEFAULT_OPTIONS,] }] }
296
+ ];
297
+ MatPaginator.propDecorators = {
298
+ color: [{ type: Input }],
299
+ pageIndex: [{ type: Input }],
300
+ length: [{ type: Input }],
301
+ pageSize: [{ type: Input }],
302
+ pageSizeOptions: [{ type: Input }],
303
+ hidePageSize: [{ type: Input }],
304
+ showFirstLastButtons: [{ type: Input }],
305
+ page: [{ type: Output }]
306
+ };
313
307
 
314
308
  /**
315
309
  * @license
@@ -318,24 +312,21 @@ let MatPaginator = /** @class */ (() => {
318
312
  * Use of this source code is governed by an MIT-style license that can be
319
313
  * found in the LICENSE file at https://angular.io/license
320
314
  */
321
- let MatPaginatorModule = /** @class */ (() => {
322
- class MatPaginatorModule {
323
- }
324
- MatPaginatorModule.decorators = [
325
- { type: NgModule, args: [{
326
- imports: [
327
- CommonModule,
328
- MatButtonModule,
329
- MatSelectModule,
330
- MatTooltipModule,
331
- ],
332
- exports: [MatPaginator],
333
- declarations: [MatPaginator],
334
- providers: [MAT_PAGINATOR_INTL_PROVIDER],
335
- },] }
336
- ];
337
- return MatPaginatorModule;
338
- })();
315
+ class MatPaginatorModule {
316
+ }
317
+ MatPaginatorModule.decorators = [
318
+ { type: NgModule, args: [{
319
+ imports: [
320
+ CommonModule,
321
+ MatButtonModule,
322
+ MatSelectModule,
323
+ MatTooltipModule,
324
+ ],
325
+ exports: [MatPaginator],
326
+ declarations: [MatPaginator],
327
+ providers: [MAT_PAGINATOR_INTL_PROVIDER],
328
+ },] }
329
+ ];
339
330
 
340
331
  /**
341
332
  * @license