@angular/material 10.1.1 → 10.2.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.
- package/_theming.scss +46 -20
- package/autocomplete/autocomplete-origin.d.ts +8 -5
- package/autocomplete/autocomplete-trigger.d.ts +23 -17
- package/autocomplete/autocomplete.d.ts +23 -12
- package/autocomplete/index.metadata.json +1 -1
- package/badge/badge.d.ts +3 -1
- package/badge/index.metadata.json +1 -1
- package/bottom-sheet/index.metadata.json +1 -1
- package/bundles/material-autocomplete-testing.umd.js +316 -256
- package/bundles/material-autocomplete-testing.umd.js.map +1 -1
- package/bundles/material-autocomplete-testing.umd.min.js +2 -16
- package/bundles/material-autocomplete-testing.umd.min.js.map +1 -1
- package/bundles/material-autocomplete.umd.js +553 -436
- package/bundles/material-autocomplete.umd.js.map +1 -1
- package/bundles/material-autocomplete.umd.min.js +3 -25
- package/bundles/material-autocomplete.umd.min.js.map +1 -1
- package/bundles/material-badge-testing.umd.js +301 -243
- package/bundles/material-badge-testing.umd.js.map +1 -1
- package/bundles/material-badge-testing.umd.min.js +2 -16
- package/bundles/material-badge-testing.umd.min.js.map +1 -1
- package/bundles/material-badge.umd.js +356 -282
- package/bundles/material-badge.umd.js.map +1 -1
- package/bundles/material-badge.umd.min.js +2 -2
- package/bundles/material-badge.umd.min.js.map +1 -1
- package/bundles/material-bottom-sheet-testing.umd.js +302 -244
- package/bundles/material-bottom-sheet-testing.umd.js.map +1 -1
- package/bundles/material-bottom-sheet-testing.umd.min.js +2 -16
- package/bundles/material-bottom-sheet-testing.umd.min.js.map +1 -1
- package/bundles/material-bottom-sheet.umd.js +376 -302
- package/bundles/material-bottom-sheet.umd.js.map +1 -1
- package/bundles/material-bottom-sheet.umd.min.js +17 -2
- package/bundles/material-bottom-sheet.umd.min.js.map +1 -1
- package/bundles/material-button-testing.umd.js +310 -252
- package/bundles/material-button-testing.umd.js.map +1 -1
- package/bundles/material-button-testing.umd.min.js +2 -16
- package/bundles/material-button-testing.umd.min.js.map +1 -1
- package/bundles/material-button-toggle-testing.umd.js +304 -261
- package/bundles/material-button-toggle-testing.umd.js.map +1 -1
- package/bundles/material-button-toggle-testing.umd.min.js +2 -31
- package/bundles/material-button-toggle-testing.umd.min.js.map +1 -1
- package/bundles/material-button-toggle.umd.js +388 -322
- package/bundles/material-button-toggle.umd.js.map +1 -1
- package/bundles/material-button-toggle.umd.min.js +2 -10
- package/bundles/material-button-toggle.umd.min.js.map +1 -1
- package/bundles/material-button.umd.js +375 -309
- package/bundles/material-button.umd.js.map +1 -1
- package/bundles/material-button.umd.min.js +2 -10
- package/bundles/material-button.umd.min.js.map +1 -1
- package/bundles/material-card-testing.umd.js +306 -250
- package/bundles/material-card-testing.umd.js.map +1 -1
- package/bundles/material-card-testing.umd.min.js +2 -16
- package/bundles/material-card-testing.umd.min.js.map +1 -1
- package/bundles/material-card.umd.js +139 -139
- package/bundles/material-card.umd.js.map +1 -1
- package/bundles/material-card.umd.min.js +2 -2
- package/bundles/material-card.umd.min.js.map +1 -1
- package/bundles/material-checkbox-testing.umd.js +302 -244
- package/bundles/material-checkbox-testing.umd.js.map +1 -1
- package/bundles/material-checkbox-testing.umd.min.js +2 -16
- package/bundles/material-checkbox-testing.umd.min.js.map +1 -1
- package/bundles/material-checkbox.umd.js +371 -312
- package/bundles/material-checkbox.umd.js.map +1 -1
- package/bundles/material-checkbox.umd.min.js +2 -9
- package/bundles/material-checkbox.umd.min.js.map +1 -1
- package/bundles/material-chips-testing.umd.js +802 -0
- package/bundles/material-chips-testing.umd.js.map +1 -0
- package/bundles/material-chips-testing.umd.min.js +30 -0
- package/bundles/material-chips-testing.umd.min.js.map +1 -0
- package/bundles/material-chips.umd.js +598 -551
- package/bundles/material-chips.umd.js.map +1 -1
- package/bundles/material-chips.umd.min.js +18 -3
- package/bundles/material-chips.umd.min.js.map +1 -1
- package/bundles/material-core-testing.umd.js +304 -261
- package/bundles/material-core-testing.umd.js.map +1 -1
- package/bundles/material-core-testing.umd.min.js +2 -31
- package/bundles/material-core-testing.umd.min.js.map +1 -1
- package/bundles/material-core.umd.js +605 -540
- package/bundles/material-core.umd.js.map +1 -1
- package/bundles/material-core.umd.min.js +37 -12
- package/bundles/material-core.umd.min.js.map +1 -1
- package/bundles/material-datepicker-testing.umd.js +1342 -0
- package/bundles/material-datepicker-testing.umd.js.map +1 -0
- package/bundles/material-datepicker-testing.umd.min.js +30 -0
- package/bundles/material-datepicker-testing.umd.min.js.map +1 -0
- package/bundles/material-datepicker.umd.js +1014 -981
- package/bundles/material-datepicker.umd.js.map +1 -1
- package/bundles/material-datepicker.umd.min.js +43 -9
- package/bundles/material-datepicker.umd.min.js.map +1 -1
- package/bundles/material-dialog-testing.umd.js +303 -245
- package/bundles/material-dialog-testing.umd.js.map +1 -1
- package/bundles/material-dialog-testing.umd.min.js +2 -16
- package/bundles/material-dialog-testing.umd.min.js.map +1 -1
- package/bundles/material-dialog.umd.js +597 -476
- package/bundles/material-dialog.umd.js.map +1 -1
- package/bundles/material-dialog.umd.min.js +10 -8
- package/bundles/material-dialog.umd.min.js.map +1 -1
- package/bundles/material-divider-testing.umd.js +300 -242
- package/bundles/material-divider-testing.umd.js.map +1 -1
- package/bundles/material-divider-testing.umd.min.js +2 -16
- package/bundles/material-divider-testing.umd.min.js.map +1 -1
- package/bundles/material-divider.umd.js +28 -28
- package/bundles/material-divider.umd.js.map +1 -1
- package/bundles/material-divider.umd.min.js +2 -9
- package/bundles/material-divider.umd.min.js.map +1 -1
- package/bundles/material-expansion-testing.umd.js +303 -254
- package/bundles/material-expansion-testing.umd.js.map +1 -1
- package/bundles/material-expansion-testing.umd.min.js +2 -17
- package/bundles/material-expansion-testing.umd.min.js.map +1 -1
- package/bundles/material-expansion.umd.js +471 -433
- package/bundles/material-expansion.umd.js.map +1 -1
- package/bundles/material-expansion.umd.min.js +12 -4
- package/bundles/material-expansion.umd.min.js.map +1 -1
- package/bundles/material-form-field-testing-control.umd.js +299 -233
- package/bundles/material-form-field-testing-control.umd.js.map +1 -1
- package/bundles/material-form-field-testing-control.umd.min.js.map +1 -1
- package/bundles/material-form-field-testing.umd.js +301 -243
- package/bundles/material-form-field-testing.umd.js.map +1 -1
- package/bundles/material-form-field-testing.umd.min.js +3 -17
- package/bundles/material-form-field-testing.umd.min.js.map +1 -1
- package/bundles/material-form-field.umd.js +480 -417
- package/bundles/material-form-field.umd.js.map +1 -1
- package/bundles/material-form-field.umd.min.js +51 -4
- package/bundles/material-form-field.umd.min.js.map +1 -1
- package/bundles/material-grid-list-testing.umd.js +311 -260
- package/bundles/material-grid-list-testing.umd.js.map +1 -1
- package/bundles/material-grid-list-testing.umd.min.js +2 -24
- package/bundles/material-grid-list-testing.umd.min.js.map +1 -1
- package/bundles/material-grid-list.umd.js +414 -340
- package/bundles/material-grid-list.umd.js.map +1 -1
- package/bundles/material-grid-list.umd.min.js +20 -5
- package/bundles/material-grid-list.umd.min.js.map +1 -1
- package/bundles/material-icon-testing.umd.js +409 -12
- package/bundles/material-icon-testing.umd.js.map +1 -1
- package/bundles/material-icon-testing.umd.min.js +18 -3
- package/bundles/material-icon-testing.umd.min.js.map +1 -1
- package/bundles/material-icon.umd.js +404 -336
- package/bundles/material-icon.umd.js.map +1 -1
- package/bundles/material-icon.umd.min.js +2 -9
- package/bundles/material-icon.umd.min.js.map +1 -1
- package/bundles/material-input-testing.umd.js +309 -262
- package/bundles/material-input-testing.umd.js.map +1 -1
- package/bundles/material-input-testing.umd.min.js +2 -16
- package/bundles/material-input-testing.umd.min.js.map +1 -1
- package/bundles/material-input.umd.js +399 -333
- package/bundles/material-input.umd.js.map +1 -1
- package/bundles/material-input.umd.min.js +5 -18
- package/bundles/material-input.umd.min.js.map +1 -1
- package/bundles/material-list-testing.umd.js +333 -311
- package/bundles/material-list-testing.umd.js.map +1 -1
- package/bundles/material-list-testing.umd.min.js +1 -9
- package/bundles/material-list-testing.umd.min.js.map +1 -1
- package/bundles/material-list.umd.js +527 -466
- package/bundles/material-list.umd.js.map +1 -1
- package/bundles/material-list.umd.min.js +2 -10
- package/bundles/material-list.umd.min.js.map +1 -1
- package/bundles/material-menu-testing.umd.js +305 -247
- package/bundles/material-menu-testing.umd.js.map +1 -1
- package/bundles/material-menu-testing.umd.min.js +2 -17
- package/bundles/material-menu-testing.umd.min.js.map +1 -1
- package/bundles/material-menu.umd.js +476 -429
- package/bundles/material-menu.umd.js.map +1 -1
- package/bundles/material-menu.umd.min.js +3 -17
- package/bundles/material-menu.umd.min.js.map +1 -1
- package/bundles/material-paginator-testing.umd.js +302 -244
- package/bundles/material-paginator-testing.umd.js.map +1 -1
- package/bundles/material-paginator-testing.umd.min.js +2 -16
- package/bundles/material-paginator-testing.umd.min.js.map +1 -1
- package/bundles/material-paginator.umd.js +349 -280
- package/bundles/material-paginator.umd.js.map +1 -1
- package/bundles/material-paginator.umd.min.js +2 -9
- package/bundles/material-paginator.umd.min.js.map +1 -1
- package/bundles/material-progress-bar-testing.umd.js +301 -243
- package/bundles/material-progress-bar-testing.umd.js.map +1 -1
- package/bundles/material-progress-bar-testing.umd.min.js +2 -16
- package/bundles/material-progress-bar-testing.umd.min.js.map +1 -1
- package/bundles/material-progress-bar.umd.js +339 -266
- package/bundles/material-progress-bar.umd.js.map +1 -1
- package/bundles/material-progress-bar.umd.min.js +4 -3
- package/bundles/material-progress-bar.umd.min.js.map +1 -1
- package/bundles/material-progress-spinner-testing.umd.js +301 -243
- package/bundles/material-progress-spinner-testing.umd.js.map +1 -1
- package/bundles/material-progress-spinner-testing.umd.min.js +2 -16
- package/bundles/material-progress-spinner-testing.umd.min.js.map +1 -1
- package/bundles/material-progress-spinner.umd.js +420 -365
- package/bundles/material-progress-spinner.umd.js.map +1 -1
- package/bundles/material-progress-spinner.umd.min.js +3 -11
- package/bundles/material-progress-spinner.umd.min.js.map +1 -1
- package/bundles/material-radio-testing.umd.js +304 -246
- package/bundles/material-radio-testing.umd.js.map +1 -1
- package/bundles/material-radio-testing.umd.min.js +2 -17
- package/bundles/material-radio-testing.umd.min.js.map +1 -1
- package/bundles/material-radio.umd.js +405 -339
- package/bundles/material-radio.umd.js.map +1 -1
- package/bundles/material-radio.umd.min.js +2 -10
- package/bundles/material-radio.umd.min.js.map +1 -1
- package/bundles/material-select-testing.umd.js +316 -260
- package/bundles/material-select-testing.umd.js.map +1 -1
- package/bundles/material-select-testing.umd.min.js +2 -16
- package/bundles/material-select-testing.umd.min.js.map +1 -1
- package/bundles/material-select.umd.js +469 -389
- package/bundles/material-select.umd.js.map +1 -1
- package/bundles/material-select.umd.min.js +5 -12
- package/bundles/material-select.umd.min.js.map +1 -1
- package/bundles/material-sidenav-testing.umd.js +303 -252
- package/bundles/material-sidenav-testing.umd.js.map +1 -1
- package/bundles/material-sidenav-testing.umd.min.js +1 -23
- package/bundles/material-sidenav-testing.umd.min.js.map +1 -1
- package/bundles/material-sidenav.umd.js +535 -496
- package/bundles/material-sidenav.umd.js.map +1 -1
- package/bundles/material-sidenav.umd.min.js +3 -3
- package/bundles/material-sidenav.umd.min.js.map +1 -1
- package/bundles/material-slide-toggle-testing.umd.js +302 -244
- package/bundles/material-slide-toggle-testing.umd.js.map +1 -1
- package/bundles/material-slide-toggle-testing.umd.min.js +2 -16
- package/bundles/material-slide-toggle-testing.umd.min.js.map +1 -1
- package/bundles/material-slide-toggle.umd.js +373 -314
- package/bundles/material-slide-toggle.umd.js.map +1 -1
- package/bundles/material-slide-toggle.umd.min.js +2 -9
- package/bundles/material-slide-toggle.umd.min.js.map +1 -1
- package/bundles/material-slider-testing.umd.js +302 -236
- package/bundles/material-slider-testing.umd.js.map +1 -1
- package/bundles/material-slider-testing.umd.min.js +2 -9
- package/bundles/material-slider-testing.umd.min.js.map +1 -1
- package/bundles/material-slider.umd.js +479 -448
- package/bundles/material-slider.umd.js.map +1 -1
- package/bundles/material-slider.umd.min.js +4 -3
- package/bundles/material-slider.umd.min.js.map +1 -1
- package/bundles/material-snack-bar-testing.umd.js +304 -246
- package/bundles/material-snack-bar-testing.umd.js.map +1 -1
- package/bundles/material-snack-bar-testing.umd.min.js +2 -16
- package/bundles/material-snack-bar-testing.umd.min.js.map +1 -1
- package/bundles/material-snack-bar.umd.js +394 -317
- package/bundles/material-snack-bar.umd.js.map +1 -1
- package/bundles/material-snack-bar.umd.min.js +26 -2
- package/bundles/material-snack-bar.umd.min.js.map +1 -1
- package/bundles/material-sort-testing.umd.js +302 -243
- package/bundles/material-sort-testing.umd.js.map +1 -1
- package/bundles/material-sort-testing.umd.min.js +2 -17
- package/bundles/material-sort-testing.umd.min.js.map +1 -1
- package/bundles/material-sort.umd.js +383 -326
- package/bundles/material-sort.umd.js.map +1 -1
- package/bundles/material-sort.umd.min.js +3 -33
- package/bundles/material-sort.umd.min.js.map +1 -1
- package/bundles/material-stepper-testing.umd.js +727 -0
- package/bundles/material-stepper-testing.umd.js.map +1 -0
- package/bundles/material-stepper-testing.umd.min.js +30 -0
- package/bundles/material-stepper-testing.umd.min.js.map +1 -0
- package/bundles/material-stepper.umd.js +496 -446
- package/bundles/material-stepper.umd.js.map +1 -1
- package/bundles/material-stepper.umd.min.js +4 -11
- package/bundles/material-stepper.umd.min.js.map +1 -1
- package/bundles/material-table-testing.umd.js +317 -265
- package/bundles/material-table-testing.umd.js.map +1 -1
- package/bundles/material-table-testing.umd.min.js +2 -24
- package/bundles/material-table-testing.umd.min.js.map +1 -1
- package/bundles/material-table.umd.js +521 -465
- package/bundles/material-table.umd.js.map +1 -1
- package/bundles/material-table.umd.min.js +4 -11
- package/bundles/material-table.umd.min.js.map +1 -1
- package/bundles/material-tabs-testing.umd.js +303 -244
- package/bundles/material-tabs-testing.umd.js.map +1 -1
- package/bundles/material-tabs-testing.umd.min.js +1 -16
- package/bundles/material-tabs-testing.umd.min.js.map +1 -1
- package/bundles/material-tabs.umd.js +677 -646
- package/bundles/material-tabs.umd.js.map +1 -1
- package/bundles/material-tabs.umd.min.js +29 -4
- package/bundles/material-tabs.umd.min.js.map +1 -1
- package/bundles/material-toolbar-testing.umd.js +301 -243
- package/bundles/material-toolbar-testing.umd.js.map +1 -1
- package/bundles/material-toolbar-testing.umd.min.js +2 -16
- package/bundles/material-toolbar-testing.umd.min.js.map +1 -1
- package/bundles/material-toolbar.umd.js +350 -286
- package/bundles/material-toolbar.umd.js.map +1 -1
- package/bundles/material-toolbar.umd.min.js +4 -3
- package/bundles/material-toolbar.umd.min.js.map +1 -1
- package/bundles/material-tooltip-testing.umd.js +301 -243
- package/bundles/material-tooltip-testing.umd.js.map +1 -1
- package/bundles/material-tooltip-testing.umd.min.js +2 -16
- package/bundles/material-tooltip-testing.umd.min.js.map +1 -1
- package/bundles/material-tooltip.umd.js +424 -324
- package/bundles/material-tooltip.umd.js.map +1 -1
- package/bundles/material-tooltip.umd.min.js +11 -3
- package/bundles/material-tooltip.umd.min.js.map +1 -1
- package/bundles/material-tree.umd.js +446 -385
- package/bundles/material-tree.umd.js.map +1 -1
- package/bundles/material-tree.umd.min.js +3 -3
- package/bundles/material-tree.umd.min.js.map +1 -1
- package/button/index.metadata.json +1 -1
- package/chips/chip-default-options.d.ts +1 -1
- package/chips/chip-input.d.ts +1 -1
- package/chips/chip.d.ts +2 -2
- package/chips/index.metadata.json +1 -1
- package/chips/testing/chip-harness-filters.d.ts +28 -0
- package/chips/testing/chip-harness.d.ts +41 -0
- package/chips/testing/chip-input-harness.d.ts +47 -0
- package/chips/testing/chip-list-harness.d.ts +49 -0
- package/chips/testing/chip-remove-harness.d.ts +22 -0
- package/chips/testing/index.d.ts +8 -0
- package/chips/testing/package.json +9 -0
- package/chips/testing/public-api.d.ts +12 -0
- package/core/common-behaviors/color.d.ts +2 -0
- package/core/common-behaviors/constructor.d.ts +7 -0
- package/core/common-behaviors/disable-ripple.d.ts +2 -2
- package/core/common-behaviors/tabindex.d.ts +4 -2
- package/core/datetime/date-adapter.d.ts +9 -2
- package/core/index.metadata.json +1 -1
- package/core/option/optgroup.d.ts +8 -6
- package/core/option/option.d.ts +12 -9
- package/core/style/_vendor-prefixes.scss +5 -0
- package/datepicker/_datepicker-theme.scss +42 -21
- package/datepicker/calendar-body.d.ts +15 -4
- package/datepicker/calendar.d.ts +2 -7
- package/datepicker/date-range-input.d.ts +0 -5
- package/datepicker/date-range-selection-strategy.d.ts +5 -1
- package/datepicker/datepicker-base.d.ts +9 -11
- package/datepicker/datepicker-input-base.d.ts +0 -5
- package/datepicker/index.d.ts +4 -3
- package/datepicker/index.metadata.json +1 -1
- package/datepicker/month-view.d.ts +5 -9
- package/datepicker/multi-year-view.d.ts +3 -6
- package/datepicker/public-api.d.ts +1 -1
- package/datepicker/testing/calendar-cell-harness.d.ts +64 -0
- package/datepicker/testing/calendar-harness.d.ts +53 -0
- package/datepicker/testing/date-range-input-harness.d.ts +59 -0
- package/datepicker/testing/datepicker-harness-filters.d.ts +45 -0
- package/datepicker/testing/datepicker-input-harness-base.d.ts +43 -0
- package/datepicker/testing/datepicker-input-harness.d.ts +36 -0
- package/datepicker/testing/datepicker-toggle-harness.d.ts +28 -0
- package/datepicker/testing/datepicker-trigger-harness-base.d.ts +44 -0
- package/datepicker/testing/index.d.ts +8 -0
- package/datepicker/testing/package.json +9 -0
- package/datepicker/testing/public-api.d.ts +13 -0
- package/datepicker/year-view.d.ts +3 -6
- package/dialog/dialog-config.d.ts +1 -1
- package/dialog/dialog-container.d.ts +39 -22
- package/dialog/dialog-ref.d.ts +3 -3
- package/dialog/dialog.d.ts +25 -14
- package/dialog/index.metadata.json +1 -1
- package/esm2015/autocomplete/autocomplete-module.js +10 -5
- package/esm2015/autocomplete/autocomplete-origin.js +15 -9
- package/esm2015/autocomplete/autocomplete-trigger.js +73 -53
- package/esm2015/autocomplete/autocomplete.js +35 -22
- package/esm2015/autocomplete/testing/autocomplete-harness-filters.js +1 -0
- package/esm2015/badge/badge.js +15 -7
- package/esm2015/badge/testing/badge-harness-filters.js +1 -0
- package/esm2015/bottom-sheet/bottom-sheet-container.js +2 -2
- package/esm2015/bottom-sheet/bottom-sheet-ref.js +3 -3
- package/esm2015/bottom-sheet/bottom-sheet.js +14 -13
- package/esm2015/bottom-sheet/testing/bottom-sheet-harness-filters.js +1 -0
- package/esm2015/button/button.js +3 -3
- package/esm2015/button/testing/button-harness-filters.js +1 -0
- package/esm2015/button-toggle/button-toggle.js +2 -2
- package/esm2015/button-toggle/testing/button-toggle-group-harness-filters.js +1 -0
- package/esm2015/button-toggle/testing/button-toggle-group-harness.js +2 -2
- package/esm2015/button-toggle/testing/button-toggle-harness-filters.js +1 -0
- package/esm2015/button-toggle/testing/button-toggle-harness.js +2 -2
- package/esm2015/card/testing/card-harness-filters.js +1 -0
- package/esm2015/card/testing/card-harness.js +2 -2
- package/esm2015/checkbox/checkbox.js +2 -2
- package/esm2015/checkbox/testing/checkbox-harness-filters.js +1 -0
- package/esm2015/checkbox/testing/checkbox-harness.js +2 -2
- package/esm2015/chips/chip-default-options.js +1 -1
- package/esm2015/chips/chip-input.js +3 -8
- package/esm2015/chips/chip-list.js +7 -13
- package/esm2015/chips/chip-text-control.js +1 -0
- package/esm2015/chips/chip.js +1 -2
- package/esm2015/chips/testing/chip-harness-filters.js +2 -0
- package/esm2015/chips/testing/chip-harness.js +82 -0
- package/esm2015/chips/testing/chip-input-harness.js +101 -0
- package/esm2015/chips/testing/chip-list-harness.js +94 -0
- package/esm2015/chips/testing/chip-remove-harness.js +29 -0
- package/esm2015/chips/testing/index.js +9 -0
- package/esm2015/chips/testing/public-api.js +13 -0
- package/esm2015/chips/testing/testing.externs.js +0 -0
- package/esm2015/core/common-behaviors/color.js +3 -2
- package/esm2015/core/common-behaviors/common-module.js +6 -2
- package/esm2015/core/common-behaviors/constructor.js +2 -1
- package/esm2015/core/common-behaviors/disable-ripple.js +7 -3
- package/esm2015/core/common-behaviors/initialized.js +2 -2
- package/esm2015/core/common-behaviors/tabindex.js +11 -4
- package/esm2015/core/datetime/date-adapter.js +12 -3
- package/esm2015/core/datetime/native-date-adapter.js +11 -9
- package/esm2015/core/option/optgroup.js +16 -11
- package/esm2015/core/option/option.js +29 -16
- package/esm2015/core/testing/optgroup-harness-filters.js +1 -0
- package/esm2015/core/testing/option-harness-filters.js +1 -0
- package/esm2015/core/version.js +1 -1
- package/esm2015/datepicker/calendar-body.js +20 -5
- package/esm2015/datepicker/calendar.js +13 -18
- package/esm2015/datepicker/date-range-input-parts.js +5 -5
- package/esm2015/datepicker/date-range-input.js +15 -16
- package/esm2015/datepicker/date-range-picker.js +6 -2
- package/esm2015/datepicker/date-range-selection-strategy.js +12 -2
- package/esm2015/datepicker/date-selection-model.js +2 -2
- package/esm2015/datepicker/datepicker-base.js +17 -19
- package/esm2015/datepicker/datepicker-input-base.js +13 -18
- package/esm2015/datepicker/datepicker-input.js +7 -3
- package/esm2015/datepicker/datepicker-module.js +2 -7
- package/esm2015/datepicker/datepicker-toggle.js +3 -1
- package/esm2015/datepicker/index.js +5 -4
- package/esm2015/datepicker/month-view.js +19 -18
- package/esm2015/datepicker/multi-year-view.js +12 -16
- package/esm2015/datepicker/public-api.js +2 -2
- package/esm2015/datepicker/testing/calendar-cell-harness.js +181 -0
- package/esm2015/datepicker/testing/calendar-harness.js +91 -0
- package/esm2015/datepicker/testing/date-range-input-harness.js +116 -0
- package/esm2015/datepicker/testing/datepicker-harness-filters.js +9 -0
- package/esm2015/datepicker/testing/datepicker-input-harness-base.js +100 -0
- package/esm2015/datepicker/testing/datepicker-input-harness.js +69 -0
- package/esm2015/datepicker/testing/datepicker-toggle-harness.js +48 -0
- package/esm2015/datepicker/testing/datepicker-trigger-harness-base.js +77 -0
- package/esm2015/datepicker/testing/index.js +9 -0
- package/esm2015/datepicker/testing/public-api.js +14 -0
- package/esm2015/datepicker/testing/testing.externs.js +0 -0
- package/esm2015/datepicker/year-view.js +18 -20
- package/esm2015/dialog/dialog-config.js +1 -1
- package/esm2015/dialog/dialog-container.js +73 -50
- package/esm2015/dialog/dialog-content-directives.js +9 -3
- package/esm2015/dialog/dialog-ref.js +8 -8
- package/esm2015/dialog/dialog.js +58 -29
- package/esm2015/dialog/testing/dialog-harness-filters.js +1 -0
- package/esm2015/divider/testing/divider-harness-filters.js +1 -0
- package/esm2015/divider/testing/divider-harness.js +2 -2
- package/esm2015/expansion/accordion.js +3 -20
- package/esm2015/expansion/expansion-panel-header.js +7 -13
- package/esm2015/expansion/expansion-panel.js +7 -6
- package/esm2015/expansion/testing/expansion-harness-filters.js +1 -0
- package/esm2015/form-field/form-field-control.js +1 -1
- package/esm2015/form-field/form-field.js +26 -17
- package/esm2015/form-field/testing/form-field-harness-filters.js +1 -0
- package/esm2015/grid-list/grid-list.js +2 -2
- package/esm2015/grid-list/testing/grid-list-harness-filters.js +1 -0
- package/esm2015/grid-list/tile-coordinator.js +2 -2
- package/esm2015/grid-list/tile-styler.js +4 -3
- package/esm2015/icon/icon-registry.js +44 -52
- package/esm2015/icon/icon.js +13 -2
- package/esm2015/icon/testing/icon-harness-filters.js +9 -0
- package/esm2015/icon/testing/icon-harness.js +63 -0
- package/esm2015/icon/testing/public-api.js +3 -1
- package/esm2015/input/input.js +17 -10
- package/esm2015/input/testing/input-harness-filters.js +1 -0
- package/esm2015/input/testing/input-harness.js +7 -7
- package/esm2015/list/list.js +2 -2
- package/esm2015/list/selection-list.js +33 -31
- package/esm2015/list/testing/action-list-harness.js +2 -2
- package/esm2015/list/testing/list-harness-filters.js +1 -0
- package/esm2015/list/testing/list-harness.js +2 -2
- package/esm2015/list/testing/list-item-harness-base.js +2 -2
- package/esm2015/list/testing/nav-list-harness.js +2 -2
- package/esm2015/list/testing/selection-list-harness.js +3 -3
- package/esm2015/menu/menu-positions.js +1 -0
- package/esm2015/menu/menu-trigger.js +12 -6
- package/esm2015/menu/menu.js +11 -14
- package/esm2015/menu/testing/menu-harness-filters.js +1 -0
- package/esm2015/paginator/paginator.js +6 -3
- package/esm2015/paginator/testing/paginator-harness-filters.js +1 -0
- package/esm2015/progress-bar/testing/progress-bar-harness-filters.js +1 -0
- package/esm2015/progress-bar/testing/progress-bar-harness.js +2 -2
- package/esm2015/progress-spinner/progress-spinner.js +25 -16
- package/esm2015/progress-spinner/testing/progress-spinner-harness-filters.js +1 -0
- package/esm2015/progress-spinner/testing/progress-spinner-harness.js +2 -2
- package/esm2015/radio/radio.js +1 -1
- package/esm2015/radio/testing/radio-harness-filters.js +1 -0
- package/esm2015/radio/testing/radio-harness.js +3 -3
- package/esm2015/select/select.js +71 -57
- package/esm2015/select/testing/select-harness-filters.js +1 -0
- package/esm2015/select/testing/select-harness.js +2 -3
- package/esm2015/sidenav/drawer.js +23 -28
- package/esm2015/sidenav/testing/drawer-harness-filters.js +1 -0
- package/esm2015/slide-toggle/testing/slide-toggle-harness-filters.js +1 -0
- package/esm2015/slide-toggle/testing/slide-toggle-harness.js +2 -2
- package/esm2015/slider/slider.js +28 -31
- package/esm2015/slider/testing/slider-harness-filters.js +1 -0
- package/esm2015/slider/testing/slider-harness.js +2 -2
- package/esm2015/snack-bar/snack-bar-container.js +3 -3
- package/esm2015/snack-bar/snack-bar-ref.js +3 -3
- package/esm2015/snack-bar/snack-bar.js +13 -9
- package/esm2015/snack-bar/testing/snack-bar-harness-filters.js +1 -0
- package/esm2015/sort/sort-direction.js +1 -0
- package/esm2015/sort/sort-header.js +6 -3
- package/esm2015/sort/sort.js +11 -8
- package/esm2015/sort/testing/sort-harness-filters.js +1 -0
- package/esm2015/stepper/step-header.js +2 -2
- package/esm2015/stepper/stepper-button.js +3 -1
- package/esm2015/stepper/stepper.js +7 -4
- package/esm2015/stepper/testing/index.js +9 -0
- package/esm2015/stepper/testing/public-api.js +12 -0
- package/esm2015/stepper/testing/step-harness-filters.js +2 -0
- package/esm2015/stepper/testing/step-harness.js +132 -0
- package/esm2015/stepper/testing/stepper-button-harnesses.js +55 -0
- package/esm2015/stepper/testing/stepper-harness.js +57 -0
- package/esm2015/stepper/testing/testing.externs.js +0 -0
- package/esm2015/table/cell.js +15 -26
- package/esm2015/table/table-data-source.js +14 -1
- package/esm2015/table/table.js +11 -4
- package/esm2015/table/testing/table-harness-filters.js +1 -0
- package/esm2015/tabs/paginated-tab-header.js +3 -10
- package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +3 -3
- package/esm2015/tabs/tab.js +17 -10
- package/esm2015/tabs/testing/tab-harness-filters.js +1 -0
- package/esm2015/toolbar/testing/toolbar-harness-filters.js +1 -0
- package/esm2015/toolbar/testing/toolbar-harness.js +2 -2
- package/esm2015/toolbar/toolbar.js +15 -17
- package/esm2015/tooltip/testing/tooltip-harness-filters.js +1 -0
- package/esm2015/tooltip/tooltip.js +53 -31
- package/esm2015/tree/node.js +2 -2
- package/esm2015/tree/padding.js +7 -1
- package/esm2015/tree/toggle.js +8 -4
- package/expansion/expansion-panel-header.d.ts +6 -12
- package/expansion/expansion-panel.d.ts +5 -4
- package/expansion/index.metadata.json +1 -1
- package/fesm2015/autocomplete.js +128 -84
- package/fesm2015/autocomplete.js.map +1 -1
- package/fesm2015/badge.js +14 -6
- package/fesm2015/badge.js.map +1 -1
- package/fesm2015/bottom-sheet.js +17 -16
- package/fesm2015/bottom-sheet.js.map +1 -1
- package/fesm2015/button-toggle/testing.js +2 -2
- package/fesm2015/button-toggle/testing.js.map +1 -1
- package/fesm2015/button-toggle.js +1 -1
- package/fesm2015/button-toggle.js.map +1 -1
- package/fesm2015/button.js +2 -2
- package/fesm2015/button.js.map +1 -1
- package/fesm2015/card/testing.js +1 -1
- package/fesm2015/card/testing.js.map +1 -1
- package/fesm2015/checkbox/testing.js +1 -1
- package/fesm2015/checkbox/testing.js.map +1 -1
- package/fesm2015/checkbox.js +1 -1
- package/fesm2015/checkbox.js.map +1 -1
- package/fesm2015/chips/testing.js +316 -0
- package/fesm2015/chips/testing.js.map +1 -0
- package/fesm2015/chips.js +7 -19
- package/fesm2015/chips.js.map +1 -1
- package/fesm2015/core.js +87 -42
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/datepicker/testing.js +690 -0
- package/fesm2015/datepicker/testing.js.map +1 -0
- package/fesm2015/datepicker.js +146 -134
- package/fesm2015/datepicker.js.map +1 -1
- package/fesm2015/dialog.js +143 -85
- package/fesm2015/dialog.js.map +1 -1
- package/fesm2015/divider/testing.js +1 -1
- package/fesm2015/divider/testing.js.map +1 -1
- package/fesm2015/expansion.js +9 -30
- package/fesm2015/expansion.js.map +1 -1
- package/fesm2015/form-field.js +25 -16
- package/fesm2015/form-field.js.map +1 -1
- package/fesm2015/grid-list.js +5 -4
- package/fesm2015/grid-list.js.map +1 -1
- package/fesm2015/icon/testing.js +72 -1
- package/fesm2015/icon/testing.js.map +1 -1
- package/fesm2015/icon.js +56 -53
- package/fesm2015/icon.js.map +1 -1
- package/fesm2015/input/testing.js +6 -6
- package/fesm2015/input/testing.js.map +1 -1
- package/fesm2015/input.js +15 -8
- package/fesm2015/input.js.map +1 -1
- package/fesm2015/list/testing.js +6 -6
- package/fesm2015/list/testing.js.map +1 -1
- package/fesm2015/list.js +33 -31
- package/fesm2015/list.js.map +1 -1
- package/fesm2015/menu.js +20 -17
- package/fesm2015/menu.js.map +1 -1
- package/fesm2015/paginator.js +5 -2
- package/fesm2015/paginator.js.map +1 -1
- package/fesm2015/progress-bar/testing.js +1 -1
- package/fesm2015/progress-bar/testing.js.map +1 -1
- package/fesm2015/progress-spinner/testing.js +1 -1
- package/fesm2015/progress-spinner/testing.js.map +1 -1
- package/fesm2015/progress-spinner.js +24 -15
- package/fesm2015/progress-spinner.js.map +1 -1
- package/fesm2015/radio/testing.js +2 -2
- package/fesm2015/radio/testing.js.map +1 -1
- package/fesm2015/radio.js.map +1 -1
- package/fesm2015/select/testing.js +1 -2
- package/fesm2015/select/testing.js.map +1 -1
- package/fesm2015/select.js +70 -56
- package/fesm2015/select.js.map +1 -1
- package/fesm2015/sidenav.js +22 -27
- package/fesm2015/sidenav.js.map +1 -1
- package/fesm2015/slide-toggle/testing.js +1 -1
- package/fesm2015/slide-toggle/testing.js.map +1 -1
- package/fesm2015/slider/testing.js +1 -1
- package/fesm2015/slider/testing.js.map +1 -1
- package/fesm2015/slider.js +27 -30
- package/fesm2015/slider.js.map +1 -1
- package/fesm2015/snack-bar.js +17 -13
- package/fesm2015/snack-bar.js.map +1 -1
- package/fesm2015/sort.js +15 -9
- package/fesm2015/sort.js.map +1 -1
- package/fesm2015/stepper/testing.js +258 -0
- package/fesm2015/stepper/testing.js.map +1 -0
- package/fesm2015/stepper.js +10 -5
- package/fesm2015/stepper.js.map +1 -1
- package/fesm2015/table.js +37 -28
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/tabs.js +20 -20
- package/fesm2015/tabs.js.map +1 -1
- package/fesm2015/toolbar/testing.js +1 -1
- package/fesm2015/toolbar/testing.js.map +1 -1
- package/fesm2015/toolbar.js +14 -16
- package/fesm2015/toolbar.js.map +1 -1
- package/fesm2015/tooltip.js +52 -30
- package/fesm2015/tooltip.js.map +1 -1
- package/fesm2015/tree.js +13 -4
- package/fesm2015/tree.js.map +1 -1
- package/form-field/form-field-control.d.ts +5 -0
- package/form-field/form-field.d.ts +8 -5
- package/form-field/index.metadata.json +1 -1
- package/icon/icon-registry.d.ts +4 -6
- package/icon/icon.d.ts +3 -1
- package/icon/index.metadata.json +1 -1
- package/icon/testing/icon-harness-filters.d.ts +22 -0
- package/icon/testing/icon-harness.d.ts +29 -0
- package/icon/testing/index.metadata.json +1 -1
- package/icon/testing/public-api.d.ts +2 -0
- package/input/index.metadata.json +1 -1
- package/input/input.d.ts +6 -3
- package/list/index.metadata.json +1 -1
- package/list/selection-list.d.ts +3 -7
- package/menu/index.metadata.json +1 -1
- package/package.json +2 -2
- package/paginator/index.metadata.json +1 -1
- package/paginator/paginator.d.ts +5 -0
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/progress-spinner/index.metadata.json +1 -1
- package/progress-spinner/progress-spinner.d.ts +9 -5
- package/radio/index.metadata.json +1 -1
- package/radio/radio.d.ts +2 -2
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +1 -1
- package/schematics/ng-update/data/index.js +1 -1
- package/select/index.metadata.json +1 -1
- package/select/select.d.ts +9 -8
- package/sidenav/drawer.d.ts +5 -5
- package/sidenav/index.metadata.json +1 -1
- package/slider/index.metadata.json +1 -1
- package/slider/slider.d.ts +8 -10
- package/snack-bar/index.metadata.json +1 -1
- package/sort/index.metadata.json +1 -1
- package/stepper/index.metadata.json +1 -1
- package/stepper/stepper.d.ts +3 -1
- package/stepper/testing/index.d.ts +8 -0
- package/stepper/testing/package.json +9 -0
- package/stepper/testing/public-api.d.ts +11 -0
- package/stepper/testing/step-harness-filters.d.ts +37 -0
- package/stepper/testing/step-harness.d.ts +57 -0
- package/stepper/testing/stepper-button-harnesses.d.ts +41 -0
- package/stepper/testing/stepper-harness.d.ts +35 -0
- package/table/cell.d.ts +9 -5
- package/table/index.metadata.json +1 -1
- package/table/table.d.ts +2 -0
- package/tabs/index.metadata.json +1 -1
- package/tabs/tab.d.ts +8 -1
- package/toolbar/index.metadata.json +1 -1
- package/tooltip/index.metadata.json +1 -1
- package/tooltip/tooltip.d.ts +6 -2
- package/tree/index.metadata.json +1 -1
- package/tree/padding.d.ts +4 -2
- package/tree/toggle.d.ts +2 -1
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
2
|
+
import { HarnessPredicate, ComponentHarness, TestKey } from '@angular/cdk/testing';
|
|
3
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright Google LLC All Rights Reserved.
|
|
8
|
+
*
|
|
9
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
10
|
+
* found in the LICENSE file at https://angular.io/license
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright Google LLC All Rights Reserved.
|
|
16
|
+
*
|
|
17
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
18
|
+
* found in the LICENSE file at https://angular.io/license
|
|
19
|
+
*/
|
|
20
|
+
/** Sets up the filter predicates for a datepicker input harness. */
|
|
21
|
+
function getInputPredicate(type, options) {
|
|
22
|
+
return new HarnessPredicate(type, options)
|
|
23
|
+
.addOption('value', options.value, (harness, value) => {
|
|
24
|
+
return HarnessPredicate.stringMatches(harness.getValue(), value);
|
|
25
|
+
})
|
|
26
|
+
.addOption('placeholder', options.placeholder, (harness, placeholder) => {
|
|
27
|
+
return HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** Base class for datepicker input harnesses. */
|
|
31
|
+
class MatDatepickerInputHarnessBase extends ComponentHarness {
|
|
32
|
+
/** Whether the input is disabled. */
|
|
33
|
+
isDisabled() {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
return (yield this.host()).getProperty('disabled');
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** Whether the input is required. */
|
|
39
|
+
isRequired() {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
return (yield this.host()).getProperty('required');
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** Gets the value of the input. */
|
|
45
|
+
getValue() {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
// The "value" property of the native input is always defined.
|
|
48
|
+
return (yield (yield this.host()).getProperty('value'));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Sets the value of the input. The value will be set by simulating
|
|
53
|
+
* keypresses that correspond to the given value.
|
|
54
|
+
*/
|
|
55
|
+
setValue(newValue) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const inputEl = yield this.host();
|
|
58
|
+
yield inputEl.clear();
|
|
59
|
+
// We don't want to send keys for the value if the value is an empty
|
|
60
|
+
// string in order to clear the value. Sending keys with an empty string
|
|
61
|
+
// still results in unnecessary focus events.
|
|
62
|
+
if (newValue) {
|
|
63
|
+
yield inputEl.sendKeys(newValue);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** Gets the placeholder of the input. */
|
|
68
|
+
getPlaceholder() {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
return (yield (yield this.host()).getProperty('placeholder'));
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Focuses the input and returns a promise that indicates when the
|
|
75
|
+
* action is complete.
|
|
76
|
+
*/
|
|
77
|
+
focus() {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
return (yield this.host()).focus();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Blurs the input and returns a promise that indicates when the
|
|
84
|
+
* action is complete.
|
|
85
|
+
*/
|
|
86
|
+
blur() {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
return (yield this.host()).blur();
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/** Whether the input is focused. */
|
|
92
|
+
isFocused() {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
return (yield this.host()).isFocused();
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/** Gets the formatted minimum date for the input's value. */
|
|
98
|
+
getMin() {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
return (yield this.host()).getAttribute('min');
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/** Gets the formatted maximum date for the input's value. */
|
|
104
|
+
getMax() {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
return (yield this.host()).getAttribute('max');
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @license
|
|
113
|
+
* Copyright Google LLC All Rights Reserved.
|
|
114
|
+
*
|
|
115
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
116
|
+
* found in the LICENSE file at https://angular.io/license
|
|
117
|
+
*/
|
|
118
|
+
/** Harness for interacting with a standard Material calendar cell in tests. */
|
|
119
|
+
class MatCalendarCellHarness extends ComponentHarness {
|
|
120
|
+
constructor() {
|
|
121
|
+
super(...arguments);
|
|
122
|
+
/** Reference to the inner content element inside the cell. */
|
|
123
|
+
this._content = this.locatorFor('.mat-calendar-body-cell-content');
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Gets a `HarnessPredicate` that can be used to search for a `MatCalendarCellHarness`
|
|
127
|
+
* that meets certain criteria.
|
|
128
|
+
* @param options Options for filtering which cell instances are considered a match.
|
|
129
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
130
|
+
*/
|
|
131
|
+
static with(options = {}) {
|
|
132
|
+
return new HarnessPredicate(MatCalendarCellHarness, options)
|
|
133
|
+
.addOption('text', options.text, (harness, text) => {
|
|
134
|
+
return HarnessPredicate.stringMatches(harness.getText(), text);
|
|
135
|
+
})
|
|
136
|
+
.addOption('selected', options.selected, (harness, selected) => __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
return (yield harness.isSelected()) === selected;
|
|
138
|
+
}))
|
|
139
|
+
.addOption('active', options.active, (harness, active) => __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
return (yield harness.isActive()) === active;
|
|
141
|
+
}))
|
|
142
|
+
.addOption('disabled', options.disabled, (harness, disabled) => __awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
return (yield harness.isDisabled()) === disabled;
|
|
144
|
+
}))
|
|
145
|
+
.addOption('today', options.today, (harness, today) => __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
return (yield harness.isToday()) === today;
|
|
147
|
+
}))
|
|
148
|
+
.addOption('inRange', options.inRange, (harness, inRange) => __awaiter(this, void 0, void 0, function* () {
|
|
149
|
+
return (yield harness.isInRange()) === inRange;
|
|
150
|
+
}))
|
|
151
|
+
.addOption('inComparisonRange', options.inComparisonRange, (harness, inComparisonRange) => __awaiter(this, void 0, void 0, function* () {
|
|
152
|
+
return (yield harness.isInComparisonRange()) === inComparisonRange;
|
|
153
|
+
}))
|
|
154
|
+
.addOption('inPreviewRange', options.inPreviewRange, (harness, inPreviewRange) => __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
return (yield harness.isInPreviewRange()) === inPreviewRange;
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
/** Gets the text of the calendar cell. */
|
|
159
|
+
getText() {
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
return (yield this._content()).text();
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/** Gets the aria-label of the calendar cell. */
|
|
165
|
+
getAriaLabel() {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
// We're guaranteed for the `aria-label` to be defined
|
|
168
|
+
// since this is a private element that we control.
|
|
169
|
+
return (yield this.host()).getAttribute('aria-label');
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
/** Whether the cell is selected. */
|
|
173
|
+
isSelected() {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
const host = yield this.host();
|
|
176
|
+
return (yield host.getAttribute('aria-selected')) === 'true';
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
/** Whether the cell is disabled. */
|
|
180
|
+
isDisabled() {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
return this._hasState('disabled');
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
/** Whether the cell is currently activated using keyboard navigation. */
|
|
186
|
+
isActive() {
|
|
187
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
return this._hasState('active');
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/** Whether the cell represents today's date. */
|
|
192
|
+
isToday() {
|
|
193
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
194
|
+
return (yield this._content()).hasClass('mat-calendar-body-today');
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/** Selects the calendar cell. Won't do anything if the cell is disabled. */
|
|
198
|
+
select() {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
return (yield this.host()).click();
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/** Hovers over the calendar cell. */
|
|
204
|
+
hover() {
|
|
205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
return (yield this.host()).hover();
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/** Moves the mouse away from the calendar cell. */
|
|
210
|
+
mouseAway() {
|
|
211
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
212
|
+
return (yield this.host()).mouseAway();
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
/** Focuses the calendar cell. */
|
|
216
|
+
focus() {
|
|
217
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
218
|
+
return (yield this.host()).focus();
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/** Removes focus from the calendar cell. */
|
|
222
|
+
blur() {
|
|
223
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
return (yield this.host()).blur();
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
/** Whether the cell is the start of the main range. */
|
|
228
|
+
isRangeStart() {
|
|
229
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
230
|
+
return this._hasState('range-start');
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
/** Whether the cell is the end of the main range. */
|
|
234
|
+
isRangeEnd() {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
+
return this._hasState('range-end');
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/** Whether the cell is part of the main range. */
|
|
240
|
+
isInRange() {
|
|
241
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
242
|
+
return this._hasState('in-range');
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
/** Whether the cell is the start of the comparison range. */
|
|
246
|
+
isComparisonRangeStart() {
|
|
247
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
248
|
+
return this._hasState('comparison-start');
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
/** Whether the cell is the end of the comparison range. */
|
|
252
|
+
isComparisonRangeEnd() {
|
|
253
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
254
|
+
return this._hasState('comparison-end');
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/** Whether the cell is inside of the comparison range. */
|
|
258
|
+
isInComparisonRange() {
|
|
259
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
+
return this._hasState('in-comparison-range');
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
/** Whether the cell is the start of the preview range. */
|
|
264
|
+
isPreviewRangeStart() {
|
|
265
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
266
|
+
return this._hasState('preview-start');
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
/** Whether the cell is the end of the preview range. */
|
|
270
|
+
isPreviewRangeEnd() {
|
|
271
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
272
|
+
return this._hasState('preview-end');
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
/** Whether the cell is inside of the preview range. */
|
|
276
|
+
isInPreviewRange() {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
return this._hasState('in-preview');
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
/** Returns whether the cell has a particular CSS class-based state. */
|
|
282
|
+
_hasState(name) {
|
|
283
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
284
|
+
return (yield this.host()).hasClass(`mat-calendar-body-${name}`);
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
MatCalendarCellHarness.hostSelector = '.mat-calendar-body-cell';
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* @license
|
|
292
|
+
* Copyright Google LLC All Rights Reserved.
|
|
293
|
+
*
|
|
294
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
295
|
+
* found in the LICENSE file at https://angular.io/license
|
|
296
|
+
*/
|
|
297
|
+
/** Harness for interacting with a standard Material calendar in tests. */
|
|
298
|
+
class MatCalendarHarness extends ComponentHarness {
|
|
299
|
+
constructor() {
|
|
300
|
+
super(...arguments);
|
|
301
|
+
/** Queries for the calendar's period toggle button. */
|
|
302
|
+
this._periodButton = this.locatorFor('.mat-calendar-period-button');
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Gets a `HarnessPredicate` that can be used to search for a `MatCalendarHarness`
|
|
306
|
+
* that meets certain criteria.
|
|
307
|
+
* @param options Options for filtering which calendar instances are considered a match.
|
|
308
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
309
|
+
*/
|
|
310
|
+
static with(options = {}) {
|
|
311
|
+
return new HarnessPredicate(MatCalendarHarness, options);
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Gets a list of cells inside the calendar.
|
|
315
|
+
* @param filter Optionally filters which cells are included.
|
|
316
|
+
*/
|
|
317
|
+
getCells(filter = {}) {
|
|
318
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
319
|
+
return this.locatorForAll(MatCalendarCellHarness.with(filter))();
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
/** Gets the current view that is being shown inside the calendar. */
|
|
323
|
+
getCurrentView() {
|
|
324
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
325
|
+
if (yield this.locatorForOptional('mat-multi-year-view')()) {
|
|
326
|
+
return 2 /* MULTI_YEAR */;
|
|
327
|
+
}
|
|
328
|
+
if (yield this.locatorForOptional('mat-year-view')()) {
|
|
329
|
+
return 1 /* YEAR */;
|
|
330
|
+
}
|
|
331
|
+
return 0 /* MONTH */;
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
/** Gets the label of the current calendar view. */
|
|
335
|
+
getCurrentViewLabel() {
|
|
336
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
337
|
+
return (yield this._periodButton()).text();
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
/** Changes the calendar view by clicking on the view toggle button. */
|
|
341
|
+
changeView() {
|
|
342
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
343
|
+
return (yield this._periodButton()).click();
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
/** Goes to the next page of the current view (e.g. next month when inside the month view). */
|
|
347
|
+
next() {
|
|
348
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
349
|
+
return (yield this.locatorFor('.mat-calendar-next-button')()).click();
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Goes to the previous page of the current view
|
|
354
|
+
* (e.g. previous month when inside the month view).
|
|
355
|
+
*/
|
|
356
|
+
previous() {
|
|
357
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
358
|
+
return (yield this.locatorFor('.mat-calendar-previous-button')()).click();
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Selects a cell in the current calendar view.
|
|
363
|
+
* @param filter An optional filter to apply to the cells. The first cell matching the filter
|
|
364
|
+
* will be selected.
|
|
365
|
+
*/
|
|
366
|
+
selectCell(filter = {}) {
|
|
367
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
368
|
+
const cells = yield this.getCells(filter);
|
|
369
|
+
if (!cells.length) {
|
|
370
|
+
throw Error(`Cannot find calendar cell matching filter ${JSON.stringify(filter)}`);
|
|
371
|
+
}
|
|
372
|
+
yield cells[0].select();
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
MatCalendarHarness.hostSelector = '.mat-calendar';
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* @license
|
|
380
|
+
* Copyright Google LLC All Rights Reserved.
|
|
381
|
+
*
|
|
382
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
383
|
+
* found in the LICENSE file at https://angular.io/license
|
|
384
|
+
*/
|
|
385
|
+
/** Base class for harnesses that can trigger a calendar. */
|
|
386
|
+
class DatepickerTriggerHarnessBase extends ComponentHarness {
|
|
387
|
+
/** Opens the calendar if the trigger is enabled and it has a calendar. */
|
|
388
|
+
openCalendar() {
|
|
389
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
390
|
+
const [isDisabled, hasCalendar] = yield Promise.all([this.isDisabled(), this.hasCalendar()]);
|
|
391
|
+
if (!isDisabled && hasCalendar) {
|
|
392
|
+
return this._openCalendar();
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
/** Closes the calendar if it is open. */
|
|
397
|
+
closeCalendar() {
|
|
398
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
399
|
+
if (yield this.isCalendarOpen()) {
|
|
400
|
+
yield closeCalendar(getCalendarId(this.host()), this.documentRootLocatorFactory());
|
|
401
|
+
// This is necessary so that we wait for the closing animation to finish in touch UI mode.
|
|
402
|
+
yield this.forceStabilize();
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
/** Gets whether there is a calendar associated with the trigger. */
|
|
407
|
+
hasCalendar() {
|
|
408
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
409
|
+
return (yield getCalendarId(this.host())) != null;
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Gets the `MatCalendarHarness` that is associated with the trigger.
|
|
414
|
+
* @param filter Optionally filters which calendar is included.
|
|
415
|
+
*/
|
|
416
|
+
getCalendar(filter = {}) {
|
|
417
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
418
|
+
return getCalendar(filter, this.host(), this.documentRootLocatorFactory());
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
/** Gets the ID of the calendar that a particular test element can trigger. */
|
|
423
|
+
function getCalendarId(host) {
|
|
424
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
425
|
+
return (yield host).getAttribute('data-mat-calendar');
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
/** Closes the calendar with a specific ID. */
|
|
429
|
+
function closeCalendar(calendarId, documentLocator) {
|
|
430
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
431
|
+
// We close the calendar by clicking on the backdrop, even though all datepicker variants
|
|
432
|
+
// have the ability to close by pressing escape. The backdrop is preferrable, because the
|
|
433
|
+
// escape key has multiple functions inside a range picker (either cancel the current range
|
|
434
|
+
// or close the calendar). Since we don't have access to set the ID on the backdrop in all
|
|
435
|
+
// cases, we set a unique class instead which is the same as the calendar's ID and suffixed
|
|
436
|
+
// with `-backdrop`.
|
|
437
|
+
const backdropSelector = `.${yield calendarId}-backdrop`;
|
|
438
|
+
return (yield documentLocator.locatorFor(backdropSelector)()).click();
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
/** Gets the test harness for a calendar associated with a particular host. */
|
|
442
|
+
function getCalendar(filter, host, documentLocator) {
|
|
443
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
444
|
+
const calendarId = yield getCalendarId(host);
|
|
445
|
+
if (!calendarId) {
|
|
446
|
+
throw Error(`Element is not associated with a calendar`);
|
|
447
|
+
}
|
|
448
|
+
return documentLocator.locatorFor(MatCalendarHarness.with(Object.assign(Object.assign({}, filter), { selector: `#${calendarId}` })))();
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* @license
|
|
454
|
+
* Copyright Google LLC All Rights Reserved.
|
|
455
|
+
*
|
|
456
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
457
|
+
* found in the LICENSE file at https://angular.io/license
|
|
458
|
+
*/
|
|
459
|
+
/** Harness for interacting with a standard Material datepicker inputs in tests. */
|
|
460
|
+
class MatDatepickerInputHarness extends MatDatepickerInputHarnessBase {
|
|
461
|
+
/**
|
|
462
|
+
* Gets a `HarnessPredicate` that can be used to search for a `MatDatepickerInputHarness`
|
|
463
|
+
* that meets certain criteria.
|
|
464
|
+
* @param options Options for filtering which input instances are considered a match.
|
|
465
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
466
|
+
*/
|
|
467
|
+
static with(options = {}) {
|
|
468
|
+
return getInputPredicate(MatDatepickerInputHarness, options);
|
|
469
|
+
}
|
|
470
|
+
/** Gets whether the calendar associated with the input is open. */
|
|
471
|
+
isCalendarOpen() {
|
|
472
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
473
|
+
// `aria-owns` is set only if there's an open datepicker so we can use it as an indicator.
|
|
474
|
+
const host = yield this.host();
|
|
475
|
+
return (yield host.getAttribute('aria-owns')) != null;
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
/** Opens the calendar associated with the input. */
|
|
479
|
+
openCalendar() {
|
|
480
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
481
|
+
const [isDisabled, hasCalendar] = yield Promise.all([this.isDisabled(), this.hasCalendar()]);
|
|
482
|
+
if (!isDisabled && hasCalendar) {
|
|
483
|
+
// Alt + down arrow is the combination for opening the calendar with the keyboard.
|
|
484
|
+
const host = yield this.host();
|
|
485
|
+
return host.sendKeys({ alt: true }, TestKey.DOWN_ARROW);
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
/** Closes the calendar associated with the input. */
|
|
490
|
+
closeCalendar() {
|
|
491
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
492
|
+
if (yield this.isCalendarOpen()) {
|
|
493
|
+
yield closeCalendar(getCalendarId(this.host()), this.documentRootLocatorFactory());
|
|
494
|
+
// This is necessary so that we wait for the closing animation to finish in touch UI mode.
|
|
495
|
+
yield this.forceStabilize();
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
/** Whether a calendar is associated with the input. */
|
|
500
|
+
hasCalendar() {
|
|
501
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
502
|
+
return (yield getCalendarId(this.host())) != null;
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Gets the `MatCalendarHarness` that is associated with the trigger.
|
|
507
|
+
* @param filter Optionally filters which calendar is included.
|
|
508
|
+
*/
|
|
509
|
+
getCalendar(filter = {}) {
|
|
510
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
511
|
+
return getCalendar(filter, this.host(), this.documentRootLocatorFactory());
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
MatDatepickerInputHarness.hostSelector = '.mat-datepicker-input';
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* @license
|
|
519
|
+
* Copyright Google LLC All Rights Reserved.
|
|
520
|
+
*
|
|
521
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
522
|
+
* found in the LICENSE file at https://angular.io/license
|
|
523
|
+
*/
|
|
524
|
+
/** Harness for interacting with a standard Material datepicker toggle in tests. */
|
|
525
|
+
class MatDatepickerToggleHarness extends DatepickerTriggerHarnessBase {
|
|
526
|
+
constructor() {
|
|
527
|
+
super(...arguments);
|
|
528
|
+
/** The clickable button inside the toggle. */
|
|
529
|
+
this._button = this.locatorFor('button');
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Gets a `HarnessPredicate` that can be used to search for a `MatDatepickerToggleHarness` that
|
|
533
|
+
* meets certain criteria.
|
|
534
|
+
* @param options Options for filtering which datepicker toggle instances are considered a match.
|
|
535
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
536
|
+
*/
|
|
537
|
+
static with(options = {}) {
|
|
538
|
+
return new HarnessPredicate(MatDatepickerToggleHarness, options);
|
|
539
|
+
}
|
|
540
|
+
/** Gets whether the calendar associated with the toggle is open. */
|
|
541
|
+
isCalendarOpen() {
|
|
542
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
543
|
+
return (yield this.host()).hasClass('mat-datepicker-toggle-active');
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
/** Whether the toggle is disabled. */
|
|
547
|
+
isDisabled() {
|
|
548
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
549
|
+
const button = yield this._button();
|
|
550
|
+
return coerceBooleanProperty(yield button.getAttribute('disabled'));
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
_openCalendar() {
|
|
554
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
555
|
+
return (yield this._button()).click();
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
MatDatepickerToggleHarness.hostSelector = '.mat-datepicker-toggle';
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* @license
|
|
563
|
+
* Copyright Google LLC All Rights Reserved.
|
|
564
|
+
*
|
|
565
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
566
|
+
* found in the LICENSE file at https://angular.io/license
|
|
567
|
+
*/
|
|
568
|
+
/** Harness for interacting with a standard Material date range start input in tests. */
|
|
569
|
+
class MatStartDateHarness extends MatDatepickerInputHarnessBase {
|
|
570
|
+
/**
|
|
571
|
+
* Gets a `HarnessPredicate` that can be used to search for a `MatStartDateHarness`
|
|
572
|
+
* that meets certain criteria.
|
|
573
|
+
* @param options Options for filtering which input instances are considered a match.
|
|
574
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
575
|
+
*/
|
|
576
|
+
static with(options = {}) {
|
|
577
|
+
return getInputPredicate(MatStartDateHarness, options);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
MatStartDateHarness.hostSelector = '.mat-start-date';
|
|
581
|
+
/** Harness for interacting with a standard Material date range end input in tests. */
|
|
582
|
+
class MatEndDateHarness extends MatDatepickerInputHarnessBase {
|
|
583
|
+
/**
|
|
584
|
+
* Gets a `HarnessPredicate` that can be used to search for a `MatEndDateHarness`
|
|
585
|
+
* that meets certain criteria.
|
|
586
|
+
* @param options Options for filtering which input instances are considered a match.
|
|
587
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
588
|
+
*/
|
|
589
|
+
static with(options = {}) {
|
|
590
|
+
return getInputPredicate(MatEndDateHarness, options);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
MatEndDateHarness.hostSelector = '.mat-end-date';
|
|
594
|
+
/** Harness for interacting with a standard Material date range input in tests. */
|
|
595
|
+
class MatDateRangeInputHarness extends DatepickerTriggerHarnessBase {
|
|
596
|
+
/**
|
|
597
|
+
* Gets a `HarnessPredicate` that can be used to search for a `MatDateRangeInputHarness`
|
|
598
|
+
* that meets certain criteria.
|
|
599
|
+
* @param options Options for filtering which input instances are considered a match.
|
|
600
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
601
|
+
*/
|
|
602
|
+
static with(options = {}) {
|
|
603
|
+
return new HarnessPredicate(MatDateRangeInputHarness, options)
|
|
604
|
+
.addOption('value', options.value, (harness, value) => HarnessPredicate.stringMatches(harness.getValue(), value));
|
|
605
|
+
}
|
|
606
|
+
/** Gets the combined value of the start and end inputs, including the separator. */
|
|
607
|
+
getValue() {
|
|
608
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
609
|
+
const [start, end, separator] = yield Promise.all([
|
|
610
|
+
this.getStartInput().then(input => input.getValue()),
|
|
611
|
+
this.getEndInput().then(input => input.getValue()),
|
|
612
|
+
this.getSeparator()
|
|
613
|
+
]);
|
|
614
|
+
return start + `${end ? ` ${separator} ${end}` : ''}`;
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
/** Gets the inner start date input inside the range input. */
|
|
618
|
+
getStartInput() {
|
|
619
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
620
|
+
// Don't pass in filters here since the start input is required and there can only be one.
|
|
621
|
+
return this.locatorFor(MatStartDateHarness)();
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
/** Gets the inner start date input inside the range input. */
|
|
625
|
+
getEndInput() {
|
|
626
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
627
|
+
// Don't pass in filters here since the end input is required and there can only be one.
|
|
628
|
+
return this.locatorFor(MatEndDateHarness)();
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
/** Gets the separator text between the values of the two inputs. */
|
|
632
|
+
getSeparator() {
|
|
633
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
634
|
+
return (yield this.locatorFor('.mat-date-range-input-separator')()).text();
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
/** Gets whether the range input is disabled. */
|
|
638
|
+
isDisabled() {
|
|
639
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
640
|
+
// We consider the input as disabled if both of the sub-inputs are disabled.
|
|
641
|
+
const [startDisabled, endDisabled] = yield Promise.all([
|
|
642
|
+
this.getStartInput().then(input => input.isDisabled()),
|
|
643
|
+
this.getEndInput().then(input => input.isDisabled())
|
|
644
|
+
]);
|
|
645
|
+
return startDisabled && endDisabled;
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
/** Gets whether the range input is required. */
|
|
649
|
+
isRequired() {
|
|
650
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
651
|
+
return (yield this.host()).hasClass('mat-date-range-input-required');
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
/** Opens the calendar associated with the input. */
|
|
655
|
+
isCalendarOpen() {
|
|
656
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
657
|
+
// `aria-owns` is set on both inputs only if there's an
|
|
658
|
+
// open range picker so we can use it as an indicator.
|
|
659
|
+
const startHost = yield (yield this.getStartInput()).host();
|
|
660
|
+
return (yield startHost.getAttribute('aria-owns')) != null;
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
_openCalendar() {
|
|
664
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
665
|
+
// Alt + down arrow is the combination for opening the calendar with the keyboard.
|
|
666
|
+
const startHost = yield (yield this.getStartInput()).host();
|
|
667
|
+
return startHost.sendKeys({ alt: true }, TestKey.DOWN_ARROW);
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
MatDateRangeInputHarness.hostSelector = '.mat-date-range-input';
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* @license
|
|
675
|
+
* Copyright Google LLC All Rights Reserved.
|
|
676
|
+
*
|
|
677
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
678
|
+
* found in the LICENSE file at https://angular.io/license
|
|
679
|
+
*/
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* @license
|
|
683
|
+
* Copyright Google LLC All Rights Reserved.
|
|
684
|
+
*
|
|
685
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
686
|
+
* found in the LICENSE file at https://angular.io/license
|
|
687
|
+
*/
|
|
688
|
+
|
|
689
|
+
export { MatCalendarCellHarness, MatCalendarHarness, MatDateRangeInputHarness, MatDatepickerInputHarness, MatDatepickerToggleHarness, MatEndDateHarness, MatStartDateHarness };
|
|
690
|
+
//# sourceMappingURL=testing.js.map
|