@angular/material 11.0.4 → 11.1.2
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 +354 -337
- package/autocomplete/_autocomplete-theme.scss +4 -5
- package/autocomplete/autocomplete.d.ts +7 -1
- package/autocomplete/index.metadata.json +1 -1
- package/autocomplete/testing/autocomplete-harness.d.ts +29 -15
- package/badge/_badge-theme.scss +2 -3
- package/bottom-sheet/_bottom-sheet-theme.scss +4 -5
- package/bundles/material-autocomplete-testing.umd.js +54 -36
- package/bundles/material-autocomplete-testing.umd.js.map +1 -1
- package/bundles/material-autocomplete-testing.umd.min.js +2 -2
- package/bundles/material-autocomplete-testing.umd.min.js.map +1 -1
- package/bundles/material-autocomplete.umd.js +31 -9
- package/bundles/material-autocomplete.umd.js.map +1 -1
- package/bundles/material-autocomplete.umd.min.js +3 -3
- package/bundles/material-autocomplete.umd.min.js.map +1 -1
- package/bundles/material-badge-testing.umd.js +9 -1
- package/bundles/material-badge-testing.umd.js.map +1 -1
- package/bundles/material-badge-testing.umd.min.js +1 -1
- package/bundles/material-badge-testing.umd.min.js.map +1 -1
- package/bundles/material-badge.umd.js +9 -1
- package/bundles/material-badge.umd.js.map +1 -1
- package/bundles/material-badge.umd.min.js +3 -3
- package/bundles/material-badge.umd.min.js.map +1 -1
- package/bundles/material-bottom-sheet-testing.umd.js +9 -1
- package/bundles/material-bottom-sheet-testing.umd.js.map +1 -1
- package/bundles/material-bottom-sheet-testing.umd.min.js +1 -1
- package/bundles/material-bottom-sheet-testing.umd.min.js.map +1 -1
- package/bundles/material-bottom-sheet.umd.js +9 -1
- package/bundles/material-bottom-sheet.umd.js.map +1 -1
- package/bundles/material-bottom-sheet.umd.min.js +1 -1
- package/bundles/material-bottom-sheet.umd.min.js.map +1 -1
- package/bundles/material-button-testing.umd.js +9 -1
- package/bundles/material-button-testing.umd.js.map +1 -1
- package/bundles/material-button-testing.umd.min.js +1 -1
- package/bundles/material-button-testing.umd.min.js.map +1 -1
- package/bundles/material-button-toggle-testing.umd.js +9 -1
- package/bundles/material-button-toggle-testing.umd.js.map +1 -1
- package/bundles/material-button-toggle-testing.umd.min.js +1 -1
- package/bundles/material-button-toggle-testing.umd.min.js.map +1 -1
- package/bundles/material-button-toggle.umd.js +9 -1
- package/bundles/material-button-toggle.umd.js.map +1 -1
- package/bundles/material-button-toggle.umd.min.js +1 -1
- package/bundles/material-button-toggle.umd.min.js.map +1 -1
- package/bundles/material-button.umd.js +17 -5
- package/bundles/material-button.umd.js.map +1 -1
- package/bundles/material-button.umd.min.js +1 -1
- package/bundles/material-button.umd.min.js.map +1 -1
- package/bundles/material-card-testing.umd.js +9 -1
- package/bundles/material-card-testing.umd.js.map +1 -1
- package/bundles/material-card-testing.umd.min.js +1 -1
- package/bundles/material-card-testing.umd.min.js.map +1 -1
- package/bundles/material-checkbox-testing.umd.js +73 -64
- package/bundles/material-checkbox-testing.umd.js.map +1 -1
- package/bundles/material-checkbox-testing.umd.min.js +2 -2
- package/bundles/material-checkbox-testing.umd.min.js.map +1 -1
- package/bundles/material-checkbox.umd.js +15 -3
- package/bundles/material-checkbox.umd.js.map +1 -1
- package/bundles/material-checkbox.umd.min.js +2 -2
- package/bundles/material-checkbox.umd.min.js.map +1 -1
- package/bundles/material-chips-testing.umd.js +189 -29
- package/bundles/material-chips-testing.umd.js.map +1 -1
- package/bundles/material-chips-testing.umd.min.js +2 -2
- package/bundles/material-chips-testing.umd.min.js.map +1 -1
- package/bundles/material-chips.umd.js +9 -1
- package/bundles/material-chips.umd.js.map +1 -1
- package/bundles/material-chips.umd.min.js +4 -4
- package/bundles/material-chips.umd.min.js.map +1 -1
- package/bundles/material-core-testing.umd.js +14 -3
- package/bundles/material-core-testing.umd.js.map +1 -1
- package/bundles/material-core-testing.umd.min.js +1 -1
- package/bundles/material-core-testing.umd.min.js.map +1 -1
- package/bundles/material-core.umd.js +55 -14
- package/bundles/material-core.umd.js.map +1 -1
- package/bundles/material-core.umd.min.js +16 -8
- package/bundles/material-core.umd.min.js.map +1 -1
- package/bundles/material-datepicker-testing.umd.js +24 -12
- package/bundles/material-datepicker-testing.umd.js.map +1 -1
- package/bundles/material-datepicker-testing.umd.min.js +1 -1
- package/bundles/material-datepicker-testing.umd.min.js.map +1 -1
- package/bundles/material-datepicker.umd.js +250 -80
- package/bundles/material-datepicker.umd.js.map +1 -1
- package/bundles/material-datepicker.umd.min.js +20 -12
- package/bundles/material-datepicker.umd.min.js.map +1 -1
- package/bundles/material-dialog-testing.umd.js +9 -1
- package/bundles/material-dialog-testing.umd.js.map +1 -1
- package/bundles/material-dialog-testing.umd.min.js +1 -1
- package/bundles/material-dialog-testing.umd.min.js.map +1 -1
- package/bundles/material-dialog.umd.js +10 -2
- package/bundles/material-dialog.umd.js.map +1 -1
- package/bundles/material-dialog.umd.min.js +8 -8
- package/bundles/material-dialog.umd.min.js.map +1 -1
- package/bundles/material-divider-testing.umd.js +9 -1
- package/bundles/material-divider-testing.umd.js.map +1 -1
- package/bundles/material-divider-testing.umd.min.js +2 -2
- package/bundles/material-divider-testing.umd.min.js.map +1 -1
- package/bundles/material-expansion-testing.umd.js +9 -1
- package/bundles/material-expansion-testing.umd.js.map +1 -1
- package/bundles/material-expansion-testing.umd.min.js +1 -1
- package/bundles/material-expansion-testing.umd.min.js.map +1 -1
- package/bundles/material-expansion.umd.js +16 -4
- package/bundles/material-expansion.umd.js.map +1 -1
- package/bundles/material-expansion.umd.min.js +6 -6
- package/bundles/material-expansion.umd.min.js.map +1 -1
- package/bundles/material-form-field-testing-control.umd.js +9 -1
- package/bundles/material-form-field-testing-control.umd.js.map +1 -1
- package/bundles/material-form-field-testing-control.umd.min.js +1 -1
- package/bundles/material-form-field-testing-control.umd.min.js.map +1 -1
- package/bundles/material-form-field-testing.umd.js +41 -30
- package/bundles/material-form-field-testing.umd.js.map +1 -1
- package/bundles/material-form-field-testing.umd.min.js +3 -3
- package/bundles/material-form-field-testing.umd.min.js.map +1 -1
- package/bundles/material-form-field.umd.js +11 -3
- package/bundles/material-form-field.umd.js.map +1 -1
- package/bundles/material-form-field.umd.min.js +2 -2
- package/bundles/material-form-field.umd.min.js.map +1 -1
- package/bundles/material-grid-list-testing.umd.js +15 -5
- package/bundles/material-grid-list-testing.umd.js.map +1 -1
- package/bundles/material-grid-list-testing.umd.min.js +2 -2
- package/bundles/material-grid-list-testing.umd.min.js.map +1 -1
- package/bundles/material-grid-list.umd.js +156 -146
- package/bundles/material-grid-list.umd.js.map +1 -1
- package/bundles/material-grid-list.umd.min.js +12 -19
- package/bundles/material-grid-list.umd.min.js.map +1 -1
- package/bundles/material-icon-testing.umd.js +12 -2
- package/bundles/material-icon-testing.umd.js.map +1 -1
- package/bundles/material-icon-testing.umd.min.js +2 -2
- package/bundles/material-icon-testing.umd.min.js.map +1 -1
- package/bundles/material-icon.umd.js +46 -2
- package/bundles/material-icon.umd.js.map +1 -1
- package/bundles/material-icon.umd.min.js +3 -3
- package/bundles/material-icon.umd.min.js.map +1 -1
- package/bundles/material-input-testing.umd.js +19 -8
- package/bundles/material-input-testing.umd.js.map +1 -1
- package/bundles/material-input-testing.umd.min.js +1 -1
- package/bundles/material-input-testing.umd.min.js.map +1 -1
- package/bundles/material-input.umd.js +9 -1
- package/bundles/material-input.umd.js.map +1 -1
- package/bundles/material-input.umd.min.js +1 -1
- package/bundles/material-input.umd.min.js.map +1 -1
- package/bundles/material-list-testing.umd.js +62 -57
- package/bundles/material-list-testing.umd.js.map +1 -1
- package/bundles/material-list-testing.umd.min.js +1 -1
- package/bundles/material-list-testing.umd.min.js.map +1 -1
- package/bundles/material-list.umd.js +9 -1
- package/bundles/material-list.umd.js.map +1 -1
- package/bundles/material-list.umd.min.js +1 -1
- package/bundles/material-list.umd.min.js.map +1 -1
- package/bundles/material-menu-testing.umd.js +94 -67
- package/bundles/material-menu-testing.umd.js.map +1 -1
- package/bundles/material-menu-testing.umd.min.js +2 -2
- package/bundles/material-menu-testing.umd.min.js.map +1 -1
- package/bundles/material-menu.umd.js +24 -28
- package/bundles/material-menu.umd.js.map +1 -1
- package/bundles/material-menu.umd.min.js +3 -3
- package/bundles/material-menu.umd.min.js.map +1 -1
- package/bundles/material-paginator-testing.umd.js +50 -34
- package/bundles/material-paginator-testing.umd.js.map +1 -1
- package/bundles/material-paginator-testing.umd.min.js +2 -2
- package/bundles/material-paginator-testing.umd.min.js.map +1 -1
- package/bundles/material-paginator.umd.js +9 -1
- package/bundles/material-paginator.umd.js.map +1 -1
- package/bundles/material-paginator.umd.min.js +1 -1
- package/bundles/material-paginator.umd.min.js.map +1 -1
- package/bundles/material-progress-bar-testing.umd.js +9 -1
- package/bundles/material-progress-bar-testing.umd.js.map +1 -1
- package/bundles/material-progress-bar-testing.umd.min.js +1 -1
- package/bundles/material-progress-bar-testing.umd.min.js.map +1 -1
- package/bundles/material-progress-bar.umd.js +9 -1
- package/bundles/material-progress-bar.umd.js.map +1 -1
- package/bundles/material-progress-bar.umd.min.js +1 -1
- package/bundles/material-progress-bar.umd.min.js.map +1 -1
- package/bundles/material-progress-spinner-testing.umd.js +9 -1
- package/bundles/material-progress-spinner-testing.umd.js.map +1 -1
- package/bundles/material-progress-spinner-testing.umd.min.js +1 -1
- package/bundles/material-progress-spinner-testing.umd.min.js.map +1 -1
- package/bundles/material-progress-spinner.umd.js +9 -1
- package/bundles/material-progress-spinner.umd.js.map +1 -1
- package/bundles/material-progress-spinner.umd.min.js +2 -2
- package/bundles/material-progress-spinner.umd.min.js.map +1 -1
- package/bundles/material-radio-testing.umd.js +88 -63
- package/bundles/material-radio-testing.umd.js.map +1 -1
- package/bundles/material-radio-testing.umd.min.js +2 -2
- package/bundles/material-radio-testing.umd.min.js.map +1 -1
- package/bundles/material-radio.umd.js +18 -5
- package/bundles/material-radio.umd.js.map +1 -1
- package/bundles/material-radio.umd.min.js +1 -1
- package/bundles/material-radio.umd.min.js.map +1 -1
- package/bundles/material-select-testing.umd.js +73 -51
- package/bundles/material-select-testing.umd.js.map +1 -1
- package/bundles/material-select-testing.umd.min.js +2 -2
- package/bundles/material-select-testing.umd.min.js.map +1 -1
- package/bundles/material-select.umd.js +14 -3
- package/bundles/material-select.umd.js.map +1 -1
- package/bundles/material-select.umd.min.js +5 -5
- package/bundles/material-select.umd.min.js.map +1 -1
- package/bundles/material-sidenav-testing.umd.js +175 -28
- package/bundles/material-sidenav-testing.umd.js.map +1 -1
- package/bundles/material-sidenav-testing.umd.min.js +2 -2
- package/bundles/material-sidenav-testing.umd.min.js.map +1 -1
- package/bundles/material-sidenav.umd.js +9 -1
- package/bundles/material-sidenav.umd.js.map +1 -1
- package/bundles/material-sidenav.umd.min.js +1 -1
- package/bundles/material-sidenav.umd.min.js.map +1 -1
- package/bundles/material-slide-toggle-testing.umd.js +9 -1
- package/bundles/material-slide-toggle-testing.umd.js.map +1 -1
- package/bundles/material-slide-toggle-testing.umd.min.js +1 -1
- package/bundles/material-slide-toggle-testing.umd.min.js.map +1 -1
- package/bundles/material-slide-toggle.umd.js +16 -3
- package/bundles/material-slide-toggle.umd.js.map +1 -1
- package/bundles/material-slide-toggle.umd.min.js +3 -3
- package/bundles/material-slide-toggle.umd.min.js.map +1 -1
- package/bundles/material-slider-testing.umd.js +15 -4
- package/bundles/material-slider-testing.umd.js.map +1 -1
- package/bundles/material-slider-testing.umd.min.js +2 -2
- package/bundles/material-slider-testing.umd.min.js.map +1 -1
- package/bundles/material-slider.umd.js +9 -1
- package/bundles/material-slider.umd.js.map +1 -1
- package/bundles/material-slider.umd.min.js +1 -1
- package/bundles/material-slider.umd.min.js.map +1 -1
- package/bundles/material-snack-bar-testing.umd.js +29 -12
- package/bundles/material-snack-bar-testing.umd.js.map +1 -1
- package/bundles/material-snack-bar-testing.umd.min.js +2 -2
- package/bundles/material-snack-bar-testing.umd.min.js.map +1 -1
- package/bundles/material-snack-bar.umd.js +20 -2
- package/bundles/material-snack-bar.umd.js.map +1 -1
- package/bundles/material-snack-bar.umd.min.js +1 -1
- package/bundles/material-snack-bar.umd.min.js.map +1 -1
- package/bundles/material-sort-testing.umd.js +9 -1
- package/bundles/material-sort-testing.umd.js.map +1 -1
- package/bundles/material-sort-testing.umd.min.js +1 -1
- package/bundles/material-sort-testing.umd.min.js.map +1 -1
- package/bundles/material-sort.umd.js +9 -1
- package/bundles/material-sort.umd.js.map +1 -1
- package/bundles/material-sort.umd.min.js +3 -3
- package/bundles/material-sort.umd.min.js.map +1 -1
- package/bundles/material-stepper-testing.umd.js +9 -1
- package/bundles/material-stepper-testing.umd.js.map +1 -1
- package/bundles/material-stepper-testing.umd.min.js +2 -2
- package/bundles/material-stepper-testing.umd.min.js.map +1 -1
- package/bundles/material-stepper.umd.js +16 -3
- package/bundles/material-stepper.umd.js.map +1 -1
- package/bundles/material-stepper.umd.min.js +3 -3
- package/bundles/material-stepper.umd.min.js.map +1 -1
- package/bundles/material-table-testing.umd.js +26 -17
- package/bundles/material-table-testing.umd.js.map +1 -1
- package/bundles/material-table-testing.umd.min.js +2 -2
- package/bundles/material-table-testing.umd.min.js.map +1 -1
- package/bundles/material-table.umd.js +65 -38
- package/bundles/material-table.umd.js.map +1 -1
- package/bundles/material-table.umd.min.js +3 -3
- package/bundles/material-table.umd.min.js.map +1 -1
- package/bundles/material-tabs-testing.umd.js +11 -3
- package/bundles/material-tabs-testing.umd.js.map +1 -1
- package/bundles/material-tabs-testing.umd.min.js +1 -1
- package/bundles/material-tabs-testing.umd.min.js.map +1 -1
- package/bundles/material-tabs.umd.js +10 -2
- package/bundles/material-tabs.umd.js.map +1 -1
- package/bundles/material-tabs.umd.min.js +5 -5
- package/bundles/material-tabs.umd.min.js.map +1 -1
- package/bundles/material-toolbar-testing.umd.js +11 -2
- package/bundles/material-toolbar-testing.umd.js.map +1 -1
- package/bundles/material-toolbar-testing.umd.min.js +2 -2
- package/bundles/material-toolbar-testing.umd.min.js.map +1 -1
- package/bundles/material-toolbar.umd.js +9 -1
- package/bundles/material-toolbar.umd.js.map +1 -1
- package/bundles/material-toolbar.umd.min.js +2 -2
- package/bundles/material-toolbar.umd.min.js.map +1 -1
- package/bundles/material-tooltip-testing.umd.js +9 -1
- package/bundles/material-tooltip-testing.umd.js.map +1 -1
- package/bundles/material-tooltip-testing.umd.min.js +1 -1
- package/bundles/material-tooltip-testing.umd.min.js.map +1 -1
- package/bundles/material-tooltip.umd.js +35 -7
- package/bundles/material-tooltip.umd.js.map +1 -1
- package/bundles/material-tooltip.umd.min.js +3 -3
- package/bundles/material-tooltip.umd.min.js.map +1 -1
- package/bundles/material-tree-testing.umd.js +10 -2
- package/bundles/material-tree-testing.umd.js.map +1 -1
- package/bundles/material-tree-testing.umd.min.js +1 -1
- package/bundles/material-tree-testing.umd.min.js.map +1 -1
- package/bundles/material-tree.umd.js +9 -1
- 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/_button-base.scss +2 -2
- package/button/_button-theme.scss +10 -11
- package/button/index.metadata.json +1 -1
- package/button-toggle/_button-toggle-theme.scss +9 -10
- package/card/_card-theme.scss +5 -6
- package/checkbox/_checkbox-theme.scss +2 -3
- package/checkbox/testing/checkbox-harness.d.ts +21 -16
- package/chips/_chips-theme.scss +4 -5
- package/chips/testing/chip-harness-filters.d.ts +11 -3
- package/chips/testing/chip-harness.d.ts +5 -5
- package/chips/testing/chip-list-harness.d.ts +15 -12
- package/chips/testing/chip-listbox-harness.d.ts +34 -0
- package/chips/testing/chip-option-harness.d.ts +29 -0
- package/chips/testing/public-api.d.ts +3 -1
- package/core/_core.scss +6 -6
- package/core/color/_all-color.scss +2 -1
- package/core/datetime/date-formats.d.ts +1 -0
- package/core/density/private/_all-density.scss +34 -0
- package/core/density/{_index.scss → private/_compatibility.scss} +11 -8
- package/core/focus-indicators/_focus-indicators.scss +3 -4
- package/core/index.metadata.json +1 -1
- package/core/option/_optgroup-theme.scss +2 -3
- package/core/option/_option-theme.scss +2 -3
- package/core/option/index.d.ts +1 -0
- package/core/option/optgroup.d.ts +4 -0
- package/core/option/option-parent.d.ts +22 -0
- package/core/option/option.d.ts +2 -14
- package/core/ripple/_ripple.scss +2 -3
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +2 -3
- package/core/style/_elevation.scss +2 -18
- package/core/style/_form-common.scss +2 -2
- package/core/style/_private.scss +40 -0
- package/core/testing/option-harness.d.ts +2 -0
- package/core/theming/_all-theme.scss +3 -2
- package/core/theming/_theming.scss +148 -38
- package/core/typography/_all-typography.scss +1 -1
- package/datepicker/_datepicker-theme.scss +5 -6
- package/datepicker/date-range-input-parts.d.ts +2 -3
- package/datepicker/date-range-input.d.ts +5 -4
- package/datepicker/date-selection-model.d.ts +10 -0
- package/datepicker/datepicker-actions.d.ts +33 -0
- package/datepicker/datepicker-base.d.ts +52 -9
- package/datepicker/datepicker-input-base.d.ts +5 -10
- package/datepicker/datepicker-input.d.ts +9 -8
- package/datepicker/datepicker-toggle.d.ts +4 -2
- package/datepicker/index.metadata.json +1 -1
- package/datepicker/public-api.d.ts +1 -0
- package/dialog/_dialog-theme.scss +4 -5
- package/divider/_divider-theme.scss +2 -3
- package/esm2015/autocomplete/autocomplete-trigger.js +10 -2
- package/esm2015/autocomplete/autocomplete.js +11 -4
- package/esm2015/autocomplete/testing/autocomplete-harness.js +27 -19
- package/esm2015/button/button.js +10 -5
- package/esm2015/checkbox/checkbox.js +8 -3
- package/esm2015/checkbox/testing/checkbox-harness.js +31 -36
- package/esm2015/chips/testing/chip-harness-filters.js +1 -1
- package/esm2015/chips/testing/chip-harness.js +6 -6
- package/esm2015/chips/testing/chip-list-harness.js +19 -16
- package/esm2015/chips/testing/chip-listbox-harness.js +49 -0
- package/esm2015/chips/testing/chip-option-harness.js +54 -0
- package/esm2015/chips/testing/public-api.js +4 -2
- package/esm2015/core/common-behaviors/common-module.js +1 -1
- package/esm2015/core/datetime/date-formats.js +1 -1
- package/esm2015/core/option/index.js +2 -1
- package/esm2015/core/option/optgroup.js +32 -7
- package/esm2015/core/option/option-parent.js +13 -0
- package/esm2015/core/option/option.js +5 -8
- package/esm2015/core/testing/option-harness.js +7 -2
- package/esm2015/core/version.js +1 -1
- package/esm2015/datepicker/date-range-input-parts.js +10 -14
- package/esm2015/datepicker/date-range-input.js +11 -4
- package/esm2015/datepicker/date-range-picker.js +3 -2
- package/esm2015/datepicker/date-selection-model.js +24 -1
- package/esm2015/datepicker/datepicker-actions.js +89 -0
- package/esm2015/datepicker/datepicker-base.js +66 -25
- package/esm2015/datepicker/datepicker-input-base.js +15 -27
- package/esm2015/datepicker/datepicker-input.js +11 -5
- package/esm2015/datepicker/datepicker-module.js +8 -1
- package/esm2015/datepicker/datepicker-toggle.js +7 -10
- package/esm2015/datepicker/datepicker.js +5 -2
- package/esm2015/datepicker/month-view.js +6 -3
- package/esm2015/datepicker/public-api.js +2 -1
- package/esm2015/datepicker/testing/date-range-input-harness.js +4 -4
- package/esm2015/datepicker/testing/datepicker-input-harness.js +3 -3
- package/esm2015/datepicker/testing/datepicker-trigger-harness-base.js +3 -3
- package/esm2015/dialog/dialog-ref.js +2 -2
- package/esm2015/expansion/expansion-panel-header.js +9 -4
- package/esm2015/expansion/expansion-panel.js +1 -1
- package/esm2015/form-field/form-field-animations.js +2 -2
- package/esm2015/form-field/form-field.js +2 -2
- package/esm2015/form-field/testing/form-field-harness.js +14 -9
- package/esm2015/grid-list/public-api.js +3 -2
- package/esm2015/grid-list/testing/grid-list-harness.js +6 -5
- package/esm2015/icon/icon-registry.js +39 -3
- package/esm2015/icon/testing/fake-icon-registry.js +4 -2
- package/esm2015/input/testing/input-harness.js +3 -3
- package/esm2015/input/testing/native-select-harness.js +7 -5
- package/esm2015/list/selection-list.js +1 -1
- package/esm2015/list/testing/list-harness-base.js +5 -4
- package/esm2015/list/testing/list-item-harness-base.js +5 -4
- package/esm2015/list/testing/selection-list-harness.js +8 -5
- package/esm2015/menu/menu-item.js +3 -3
- package/esm2015/menu/menu-trigger.js +15 -25
- package/esm2015/menu/menu.js +2 -2
- package/esm2015/menu/testing/menu-harness.js +44 -32
- package/esm2015/paginator/testing/paginator-harness.js +27 -25
- package/esm2015/radio/radio.js +10 -5
- package/esm2015/radio/testing/radio-harness.js +40 -29
- package/esm2015/select/select.js +6 -3
- package/esm2015/select/testing/select-harness.js +36 -28
- package/esm2015/sidenav/testing/drawer-container-harness.js +41 -0
- package/esm2015/sidenav/testing/drawer-content-harness.js +23 -0
- package/esm2015/sidenav/testing/drawer-harness-filters.js +1 -1
- package/esm2015/sidenav/testing/drawer-harness.js +19 -13
- package/esm2015/sidenav/testing/public-api.js +6 -2
- package/esm2015/sidenav/testing/sidenav-container-harness.js +41 -0
- package/esm2015/sidenav/testing/sidenav-content-harness.js +23 -0
- package/esm2015/sidenav/testing/sidenav-harness.js +4 -4
- package/esm2015/slide-toggle/slide-toggle.js +8 -3
- package/esm2015/slider/testing/slider-harness.js +5 -5
- package/esm2015/snack-bar/snack-bar-container.js +12 -2
- package/esm2015/snack-bar/testing/snack-bar-harness.js +19 -12
- package/esm2015/stepper/step-header.js +8 -3
- package/esm2015/table/table-data-source.js +34 -21
- package/esm2015/table/testing/cell-harness.js +3 -3
- package/esm2015/table/testing/row-harness.js +5 -5
- package/esm2015/table/testing/table-harness.js +8 -8
- package/esm2015/tabs/tab-body.js +3 -3
- package/esm2015/tabs/testing/tab-group-harness.js +3 -3
- package/esm2015/tabs/testing/tab-nav-bar-harness.js +3 -3
- package/esm2015/toolbar/testing/toolbar-harness.js +3 -3
- package/esm2015/tooltip/tooltip.js +28 -7
- package/esm2015/tree/testing/tree-harness.js +2 -2
- package/expansion/_expansion-mixins.scss +11 -0
- package/expansion/_expansion-theme.scss +13 -19
- package/expansion/index.metadata.json +1 -1
- package/fesm2015/autocomplete/testing.js +26 -18
- package/fesm2015/autocomplete/testing.js.map +1 -1
- package/fesm2015/autocomplete.js +19 -5
- package/fesm2015/autocomplete.js.map +1 -1
- package/fesm2015/button.js +9 -4
- package/fesm2015/button.js.map +1 -1
- package/fesm2015/checkbox/testing.js +30 -35
- package/fesm2015/checkbox/testing.js.map +1 -1
- package/fesm2015/checkbox.js +7 -2
- package/fesm2015/checkbox.js.map +1 -1
- package/fesm2015/chips/testing.js +120 -21
- package/fesm2015/chips/testing.js.map +1 -1
- package/fesm2015/core/testing.js +6 -1
- package/fesm2015/core/testing.js.map +1 -1
- package/fesm2015/core.js +45 -13
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/datepicker/testing.js +5 -5
- package/fesm2015/datepicker/testing.js.map +1 -1
- package/fesm2015/datepicker.js +275 -116
- package/fesm2015/datepicker.js.map +1 -1
- package/fesm2015/dialog.js +1 -1
- package/fesm2015/dialog.js.map +1 -1
- package/fesm2015/expansion.js +8 -3
- package/fesm2015/expansion.js.map +1 -1
- package/fesm2015/form-field/testing.js +13 -8
- package/fesm2015/form-field/testing.js.map +1 -1
- package/fesm2015/form-field.js +2 -2
- package/fesm2015/form-field.js.map +1 -1
- package/fesm2015/grid-list/testing.js +5 -4
- package/fesm2015/grid-list/testing.js.map +1 -1
- package/fesm2015/grid-list.js +128 -126
- package/fesm2015/grid-list.js.map +1 -1
- package/fesm2015/icon/testing.js +3 -1
- package/fesm2015/icon/testing.js.map +1 -1
- package/fesm2015/icon.js +38 -2
- package/fesm2015/icon.js.map +1 -1
- package/fesm2015/input/testing.js +7 -5
- package/fesm2015/input/testing.js.map +1 -1
- package/fesm2015/list/testing.js +13 -8
- package/fesm2015/list/testing.js.map +1 -1
- package/fesm2015/list.js.map +1 -1
- package/fesm2015/menu/testing.js +45 -33
- package/fesm2015/menu/testing.js.map +1 -1
- package/fesm2015/menu.js +17 -27
- package/fesm2015/menu.js.map +1 -1
- package/fesm2015/paginator/testing.js +26 -24
- package/fesm2015/paginator/testing.js.map +1 -1
- package/fesm2015/paginator.js.map +1 -1
- package/fesm2015/progress-spinner.js.map +1 -1
- package/fesm2015/radio/testing.js +39 -28
- package/fesm2015/radio/testing.js.map +1 -1
- package/fesm2015/radio.js +9 -4
- package/fesm2015/radio.js.map +1 -1
- package/fesm2015/select/testing.js +36 -28
- package/fesm2015/select/testing.js.map +1 -1
- package/fesm2015/select.js +5 -2
- package/fesm2015/select.js.map +1 -1
- package/fesm2015/sidenav/testing.js +139 -15
- package/fesm2015/sidenav/testing.js.map +1 -1
- package/fesm2015/sidenav.js.map +1 -1
- package/fesm2015/slide-toggle.js +7 -2
- package/fesm2015/slide-toggle.js.map +1 -1
- package/fesm2015/slider/testing.js +4 -4
- package/fesm2015/slider/testing.js.map +1 -1
- package/fesm2015/snack-bar/testing.js +18 -11
- package/fesm2015/snack-bar/testing.js.map +1 -1
- package/fesm2015/snack-bar.js +11 -1
- package/fesm2015/snack-bar.js.map +1 -1
- package/fesm2015/stepper.js +7 -2
- package/fesm2015/stepper.js.map +1 -1
- package/fesm2015/table/testing.js +11 -11
- package/fesm2015/table/testing.js.map +1 -1
- package/fesm2015/table.js +34 -21
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/tabs/testing.js +3 -3
- package/fesm2015/tabs/testing.js.map +1 -1
- package/fesm2015/tabs.js +2 -2
- package/fesm2015/tabs.js.map +1 -1
- package/fesm2015/toolbar/testing.js +2 -2
- package/fesm2015/toolbar/testing.js.map +1 -1
- package/fesm2015/tooltip.js +27 -7
- package/fesm2015/tooltip.js.map +1 -1
- package/fesm2015/tree/testing.js +1 -1
- package/fesm2015/tree/testing.js.map +1 -1
- package/form-field/_form-field-fill-theme.scss +4 -5
- package/form-field/_form-field-legacy-theme.scss +5 -6
- package/form-field/_form-field-outline-theme.scss +4 -5
- package/form-field/_form-field-standard-theme.scss +5 -6
- package/form-field/_form-field-theme.scss +8 -9
- package/form-field/index.metadata.json +1 -1
- package/grid-list/_grid-list-theme.scss +2 -3
- package/grid-list/index.metadata.json +1 -1
- package/grid-list/public-api.d.ts +2 -1
- package/icon/_icon-theme.scss +2 -3
- package/icon/icon-registry.d.ts +23 -0
- package/icon/index.metadata.json +1 -1
- package/icon/testing/fake-icon-registry.d.ts +1 -0
- package/icon/testing/index.metadata.json +1 -1
- package/input/_input-theme.scss +3 -4
- package/list/_list-theme.scss +2 -3
- package/list/index.metadata.json +1 -1
- package/list/selection-list.d.ts +6 -1
- package/list/testing/list-harness-base.d.ts +1 -1
- package/list/testing/list-item-harness-base.d.ts +2 -2
- package/list/testing/selection-list-harness.d.ts +2 -1
- package/menu/_menu-theme.scss +4 -5
- package/menu/index.metadata.json +1 -1
- package/menu/menu-trigger.d.ts +1 -3
- package/menu/menu.d.ts +4 -2
- package/menu/testing/menu-harness.d.ts +39 -26
- package/package.json +2 -2
- package/paginator/_paginator-theme.scss +7 -8
- package/paginator/testing/paginator-harness.d.ts +32 -19
- 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-bar/_progress-bar-theme.scss +2 -3
- package/progress-spinner/_progress-spinner-theme.scss +2 -3
- package/radio/_radio-theme.scss +2 -3
- package/radio/index.metadata.json +1 -1
- package/radio/radio.d.ts +2 -2
- package/radio/testing/radio-harness.d.ts +39 -24
- package/schematics/ng-add/fonts/material-fonts.js +7 -5
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/setup-project.js +4 -3
- package/select/_select-theme.scss +5 -6
- package/select/index.metadata.json +1 -1
- package/select/testing/select-harness.d.ts +28 -16
- package/sidenav/_sidenav-theme.scss +4 -5
- package/sidenav/testing/drawer-container-harness.d.ts +30 -0
- package/sidenav/testing/drawer-content-harness.d.ts +21 -0
- package/sidenav/testing/drawer-harness-filters.d.ts +6 -0
- package/sidenav/testing/drawer-harness.d.ts +13 -7
- package/sidenav/testing/public-api.d.ts +5 -1
- package/sidenav/testing/sidenav-container-harness.d.ts +30 -0
- package/sidenav/testing/sidenav-content-harness.d.ts +21 -0
- package/sidenav/testing/sidenav-harness.d.ts +3 -3
- package/slide-toggle/_slide-toggle-theme.scss +4 -5
- package/slide-toggle/slide-toggle.d.ts +2 -2
- package/slider/_slider-theme.scss +2 -3
- package/snack-bar/_snack-bar-theme.scss +4 -5
- package/snack-bar/index.metadata.json +1 -1
- package/snack-bar/snack-bar-container.d.ts +5 -0
- package/snack-bar/testing/snack-bar-harness.d.ts +7 -4
- package/sort/_sort-theme.scss +2 -3
- package/stepper/_stepper-theme.scss +7 -8
- package/stepper/step-header.d.ts +2 -2
- package/table/_table-theme.scss +2 -3
- package/table/index.metadata.json +1 -1
- package/table/table-data-source.d.ts +31 -20
- package/table/testing/cell-harness.d.ts +2 -2
- package/tabs/_tabs-common.scss +2 -2
- package/tabs/_tabs-theme.scss +14 -9
- package/tabs/index.metadata.json +1 -1
- package/tabs/tab-body.d.ts +3 -3
- package/toolbar/_toolbar-theme.scss +8 -9
- package/tooltip/_tooltip-theme.scss +2 -3
- package/tooltip/index.metadata.json +1 -1
- package/tooltip/tooltip.d.ts +10 -1
- package/tree/_tree-theme.scss +7 -8
- package/core/density/_all-density.scss +0 -19
- package/core/style/_noop-animation.scss +0 -22
- package/core/theming/_check-duplicate-styles.scss +0 -106
package/fesm2015/datepicker.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
2
2
|
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
3
|
-
import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
3
|
+
import { ComponentPortal, TemplatePortal, PortalModule } from '@angular/cdk/portal';
|
|
4
4
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
5
|
-
import { ɵɵdefineInjectable, Injectable, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, ElementRef, NgZone, Input, Output, Directive, Optional, SkipSelf, InjectionToken, ChangeDetectorRef, Inject, ViewChild, forwardRef, ViewContainerRef, Attribute, ContentChild, InjectFlags, Injector, Self, NgModule } from '@angular/core';
|
|
5
|
+
import { ɵɵdefineInjectable, Injectable, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, ElementRef, NgZone, Input, Output, Directive, Optional, SkipSelf, InjectionToken, ChangeDetectorRef, Inject, ViewChild, forwardRef, ViewContainerRef, Attribute, ContentChild, InjectFlags, Injector, Self, TemplateRef, NgModule } from '@angular/core';
|
|
6
6
|
import { MatButtonModule } from '@angular/material/button';
|
|
7
7
|
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
|
8
8
|
import { CdkScrollableModule } from '@angular/cdk/scrolling';
|
|
@@ -415,6 +415,17 @@ class MatDateSelectionModel {
|
|
|
415
415
|
_isValidDateInstance(date) {
|
|
416
416
|
return this._adapter.isDateInstance(date) && this._adapter.isValid(date);
|
|
417
417
|
}
|
|
418
|
+
/**
|
|
419
|
+
* Clones the selection model.
|
|
420
|
+
* @deprecated To be turned into an abstract method.
|
|
421
|
+
* @breaking-change 12.0.0
|
|
422
|
+
*/
|
|
423
|
+
clone() {
|
|
424
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
425
|
+
throw Error('Not implemented');
|
|
426
|
+
}
|
|
427
|
+
return null;
|
|
428
|
+
}
|
|
418
429
|
}
|
|
419
430
|
MatDateSelectionModel.decorators = [
|
|
420
431
|
{ type: Directive }
|
|
@@ -446,6 +457,12 @@ class MatSingleDateSelectionModel extends MatDateSelectionModel {
|
|
|
446
457
|
isComplete() {
|
|
447
458
|
return this.selection != null;
|
|
448
459
|
}
|
|
460
|
+
/** Clones the selection model. */
|
|
461
|
+
clone() {
|
|
462
|
+
const clone = new MatSingleDateSelectionModel(this._adapter);
|
|
463
|
+
clone.updateSelection(this.selection, this);
|
|
464
|
+
return clone;
|
|
465
|
+
}
|
|
449
466
|
}
|
|
450
467
|
MatSingleDateSelectionModel.decorators = [
|
|
451
468
|
{ type: Injectable }
|
|
@@ -500,6 +517,12 @@ class MatRangeDateSelectionModel extends MatDateSelectionModel {
|
|
|
500
517
|
isComplete() {
|
|
501
518
|
return this.selection.start != null && this.selection.end != null;
|
|
502
519
|
}
|
|
520
|
+
/** Clones the selection model. */
|
|
521
|
+
clone() {
|
|
522
|
+
const clone = new MatRangeDateSelectionModel(this._adapter);
|
|
523
|
+
clone.updateSelection(this.selection, this);
|
|
524
|
+
return clone;
|
|
525
|
+
}
|
|
503
526
|
}
|
|
504
527
|
MatRangeDateSelectionModel.decorators = [
|
|
505
528
|
{ type: Injectable }
|
|
@@ -685,6 +708,8 @@ class MatMonthView {
|
|
|
685
708
|
this.selectedChange.emit(selectedDate);
|
|
686
709
|
}
|
|
687
710
|
this._userSelection.emit({ value: selectedDate, event: event.event });
|
|
711
|
+
this._previewStart = this._previewEnd = null;
|
|
712
|
+
this._changeDetectorRef.markForCheck();
|
|
688
713
|
}
|
|
689
714
|
/** Handles keydown events on the calendar body when calendar is in month view. */
|
|
690
715
|
_handleCalendarBodyKeydown(event) {
|
|
@@ -756,8 +781,9 @@ class MatMonthView {
|
|
|
756
781
|
_init() {
|
|
757
782
|
this._setRanges(this.selected);
|
|
758
783
|
this._todayDate = this._getCellCompareValue(this._dateAdapter.today());
|
|
759
|
-
this._monthLabel =
|
|
760
|
-
this._dateAdapter.
|
|
784
|
+
this._monthLabel = this._dateFormats.display.monthLabel
|
|
785
|
+
? this._dateAdapter.format(this.activeDate, this._dateFormats.display.monthLabel)
|
|
786
|
+
: this._dateAdapter.getMonthNames('short')[this._dateAdapter.getMonth(this.activeDate)]
|
|
761
787
|
.toLocaleUpperCase();
|
|
762
788
|
let firstOfMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), 1);
|
|
763
789
|
this._firstWeekOffset =
|
|
@@ -1802,7 +1828,7 @@ const _MatDatepickerContentMixinBase = mixinColor(MatDatepickerContentBase);
|
|
|
1802
1828
|
* @docs-private
|
|
1803
1829
|
*/
|
|
1804
1830
|
class MatDatepickerContent extends _MatDatepickerContentMixinBase {
|
|
1805
|
-
constructor(elementRef, _changeDetectorRef,
|
|
1831
|
+
constructor(elementRef, _changeDetectorRef, _globalModel, _dateAdapter, _rangeSelectionStrategy,
|
|
1806
1832
|
/**
|
|
1807
1833
|
* @deprecated `intl` argument to become required.
|
|
1808
1834
|
* @breaking-change 12.0.0
|
|
@@ -1810,7 +1836,7 @@ class MatDatepickerContent extends _MatDatepickerContentMixinBase {
|
|
|
1810
1836
|
intl) {
|
|
1811
1837
|
super(elementRef);
|
|
1812
1838
|
this._changeDetectorRef = _changeDetectorRef;
|
|
1813
|
-
this.
|
|
1839
|
+
this._globalModel = _globalModel;
|
|
1814
1840
|
this._dateAdapter = _dateAdapter;
|
|
1815
1841
|
this._rangeSelectionStrategy = _rangeSelectionStrategy;
|
|
1816
1842
|
this._subscriptions = new Subscription();
|
|
@@ -1818,11 +1844,19 @@ class MatDatepickerContent extends _MatDatepickerContentMixinBase {
|
|
|
1818
1844
|
this._animationState = 'enter';
|
|
1819
1845
|
/** Emits when an animation has finished. */
|
|
1820
1846
|
this._animationDone = new Subject();
|
|
1847
|
+
/** Portal with projected action buttons. */
|
|
1848
|
+
this._actionsPortal = null;
|
|
1821
1849
|
// @breaking-change 12.0.0 Remove fallback for `intl`.
|
|
1822
1850
|
this._closeButtonText = (intl === null || intl === void 0 ? void 0 : intl.closeCalendarLabel) || 'Close calendar';
|
|
1823
1851
|
}
|
|
1852
|
+
ngOnInit() {
|
|
1853
|
+
// If we have actions, clone the model so that we have the ability to cancel the selection,
|
|
1854
|
+
// otherwise update the global model directly. Note that we want to assign this as soon as
|
|
1855
|
+
// possible, but `_actionsPortal` isn't available in the constructor so we do it in `ngOnInit`.
|
|
1856
|
+
this._model = this._actionsPortal ? this._globalModel.clone() : this._globalModel;
|
|
1857
|
+
}
|
|
1824
1858
|
ngAfterViewInit() {
|
|
1825
|
-
this._subscriptions.add(this.datepicker.
|
|
1859
|
+
this._subscriptions.add(this.datepicker.stateChanges.subscribe(() => {
|
|
1826
1860
|
this._changeDetectorRef.markForCheck();
|
|
1827
1861
|
}));
|
|
1828
1862
|
this._calendar.focusActiveCell();
|
|
@@ -1848,7 +1882,8 @@ class MatDatepickerContent extends _MatDatepickerContentMixinBase {
|
|
|
1848
1882
|
!this._dateAdapter.sameDate(value, selection))) {
|
|
1849
1883
|
this._model.add(value);
|
|
1850
1884
|
}
|
|
1851
|
-
|
|
1885
|
+
// Delegate closing the popup to the actions.
|
|
1886
|
+
if ((!this._model || this._model.isComplete()) && !this._actionsPortal) {
|
|
1852
1887
|
this.datepicker.close();
|
|
1853
1888
|
}
|
|
1854
1889
|
}
|
|
@@ -1859,11 +1894,17 @@ class MatDatepickerContent extends _MatDatepickerContentMixinBase {
|
|
|
1859
1894
|
_getSelected() {
|
|
1860
1895
|
return this._model.selection;
|
|
1861
1896
|
}
|
|
1897
|
+
/** Applies the current pending selection to the global model. */
|
|
1898
|
+
_applyPendingSelection() {
|
|
1899
|
+
if (this._model !== this._globalModel) {
|
|
1900
|
+
this._globalModel.updateSelection(this._model.selection, this);
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1862
1903
|
}
|
|
1863
1904
|
MatDatepickerContent.decorators = [
|
|
1864
1905
|
{ type: Component, args: [{
|
|
1865
1906
|
selector: 'mat-datepicker-content',
|
|
1866
|
-
template: "<div
|
|
1907
|
+
template: "<div\n cdkTrapFocus\n class=\"mat-datepicker-content-container\"\n [class.mat-datepicker-content-container-with-actions]=\"_actionsPortal\">\n <mat-calendar\n [id]=\"datepicker.id\"\n [ngClass]=\"datepicker.panelClass\"\n [startAt]=\"datepicker.startAt\"\n [startView]=\"datepicker.startView\"\n [minDate]=\"datepicker._getMinDate()\"\n [maxDate]=\"datepicker._getMaxDate()\"\n [dateFilter]=\"datepicker._getDateFilter()\"\n [headerComponent]=\"datepicker.calendarHeaderComponent\"\n [selected]=\"_getSelected()\"\n [dateClass]=\"datepicker.dateClass\"\n [comparisonStart]=\"comparisonStart\"\n [comparisonEnd]=\"comparisonEnd\"\n [@fadeInCalendar]=\"'enter'\"\n (yearSelected)=\"datepicker._selectYear($event)\"\n (monthSelected)=\"datepicker._selectMonth($event)\"\n (viewChanged)=\"datepicker._viewChanged($event)\"\n (_userSelection)=\"_handleUserSelection($event)\"></mat-calendar>\n\n <ng-template [cdkPortalOutlet]=\"_actionsPortal\"></ng-template>\n\n <!-- Invisible close button for screen reader users. -->\n <button\n type=\"button\"\n mat-raised-button\n [color]=\"color || 'primary'\"\n class=\"mat-datepicker-close-button\"\n [class.cdk-visually-hidden]=\"!_closeButtonFocused\"\n (focus)=\"_closeButtonFocused = true\"\n (blur)=\"_closeButtonFocused = false\"\n (click)=\"datepicker.close()\">{{ _closeButtonText }}</button>\n</div>\n",
|
|
1867
1908
|
host: {
|
|
1868
1909
|
'class': 'mat-datepicker-content',
|
|
1869
1910
|
'[@transformPanel]': '_animationState',
|
|
@@ -1878,7 +1919,7 @@ MatDatepickerContent.decorators = [
|
|
|
1878
1919
|
encapsulation: ViewEncapsulation.None,
|
|
1879
1920
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1880
1921
|
inputs: ['color'],
|
|
1881
|
-
styles: [".mat-datepicker-content{display:block;border-radius:4px}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.ng-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-touch{display:block;max-height:80vh;overflow:auto;margin:-24px}.mat-datepicker-content-touch .mat-
|
|
1922
|
+
styles: [".mat-datepicker-content{display:block;border-radius:4px}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.ng-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mat-datepicker-content-touch{display:block;max-height:80vh;overflow:auto;margin:-24px}.mat-datepicker-content-touch .mat-datepicker-content-container{min-height:312px;max-height:788px;min-width:250px;max-width:750px}.mat-datepicker-content-touch .mat-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-datepicker-content-container{width:64vh;height:80vh}}@media all and (orientation: portrait){.mat-datepicker-content-touch .mat-datepicker-content-container{width:80vw;height:100vw}.mat-datepicker-content-touch .mat-datepicker-content-container-with-actions{height:115vw}}\n"]
|
|
1882
1923
|
},] }
|
|
1883
1924
|
];
|
|
1884
1925
|
MatDatepickerContent.ctorParameters = () => [
|
|
@@ -1937,7 +1978,7 @@ class MatDatepickerBase {
|
|
|
1937
1978
|
/** Unique class that will be added to the backdrop so that the test harnesses can look it up. */
|
|
1938
1979
|
this._backdropHarnessClass = `${this.id}-backdrop`;
|
|
1939
1980
|
/** Emits when the datepicker's state changes. */
|
|
1940
|
-
this.
|
|
1981
|
+
this.stateChanges = new Subject();
|
|
1941
1982
|
if (!this._dateAdapter && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1942
1983
|
throw createMissingDateImplError('DateAdapter');
|
|
1943
1984
|
}
|
|
@@ -1947,7 +1988,7 @@ class MatDatepickerBase {
|
|
|
1947
1988
|
get startAt() {
|
|
1948
1989
|
// If an explicit startAt is set we start there, otherwise we start at whatever the currently
|
|
1949
1990
|
// selected value is.
|
|
1950
|
-
return this._startAt || (this.
|
|
1991
|
+
return this._startAt || (this.datepickerInput ? this.datepickerInput.getStartValue() : null);
|
|
1951
1992
|
}
|
|
1952
1993
|
set startAt(value) {
|
|
1953
1994
|
this._startAt = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));
|
|
@@ -1955,7 +1996,7 @@ class MatDatepickerBase {
|
|
|
1955
1996
|
/** Color palette to use on the datepicker's calendar. */
|
|
1956
1997
|
get color() {
|
|
1957
1998
|
return this._color ||
|
|
1958
|
-
(this.
|
|
1999
|
+
(this.datepickerInput ? this.datepickerInput.getThemePalette() : undefined);
|
|
1959
2000
|
}
|
|
1960
2001
|
set color(value) {
|
|
1961
2002
|
this._color = value;
|
|
@@ -1970,14 +2011,14 @@ class MatDatepickerBase {
|
|
|
1970
2011
|
}
|
|
1971
2012
|
/** Whether the datepicker pop-up should be disabled. */
|
|
1972
2013
|
get disabled() {
|
|
1973
|
-
return this._disabled === undefined && this.
|
|
1974
|
-
this.
|
|
2014
|
+
return this._disabled === undefined && this.datepickerInput ?
|
|
2015
|
+
this.datepickerInput.disabled : !!this._disabled;
|
|
1975
2016
|
}
|
|
1976
2017
|
set disabled(value) {
|
|
1977
2018
|
const newValue = coerceBooleanProperty(value);
|
|
1978
2019
|
if (newValue !== this._disabled) {
|
|
1979
2020
|
this._disabled = newValue;
|
|
1980
|
-
this.
|
|
2021
|
+
this.stateChanges.next(undefined);
|
|
1981
2022
|
}
|
|
1982
2023
|
}
|
|
1983
2024
|
/**
|
|
@@ -1995,14 +2036,14 @@ class MatDatepickerBase {
|
|
|
1995
2036
|
}
|
|
1996
2037
|
/** The minimum selectable date. */
|
|
1997
2038
|
_getMinDate() {
|
|
1998
|
-
return this.
|
|
2039
|
+
return this.datepickerInput && this.datepickerInput.min;
|
|
1999
2040
|
}
|
|
2000
2041
|
/** The maximum selectable date. */
|
|
2001
2042
|
_getMaxDate() {
|
|
2002
|
-
return this.
|
|
2043
|
+
return this.datepickerInput && this.datepickerInput.max;
|
|
2003
2044
|
}
|
|
2004
2045
|
_getDateFilter() {
|
|
2005
|
-
return this.
|
|
2046
|
+
return this.datepickerInput && this.datepickerInput.dateFilter;
|
|
2006
2047
|
}
|
|
2007
2048
|
ngOnChanges(changes) {
|
|
2008
2049
|
const positionChange = changes['xPosition'] || changes['yPosition'];
|
|
@@ -2012,13 +2053,13 @@ class MatDatepickerBase {
|
|
|
2012
2053
|
this._popupRef.updatePosition();
|
|
2013
2054
|
}
|
|
2014
2055
|
}
|
|
2015
|
-
this.
|
|
2056
|
+
this.stateChanges.next(undefined);
|
|
2016
2057
|
}
|
|
2017
2058
|
ngOnDestroy() {
|
|
2018
2059
|
this._destroyPopup();
|
|
2019
2060
|
this.close();
|
|
2020
2061
|
this._inputStateChanges.unsubscribe();
|
|
2021
|
-
this.
|
|
2062
|
+
this.stateChanges.complete();
|
|
2022
2063
|
}
|
|
2023
2064
|
/** Selects the given date */
|
|
2024
2065
|
select(date) {
|
|
@@ -2041,22 +2082,41 @@ class MatDatepickerBase {
|
|
|
2041
2082
|
* @param input The datepicker input to register with this datepicker.
|
|
2042
2083
|
* @returns Selection model that the input should hook itself up to.
|
|
2043
2084
|
*/
|
|
2044
|
-
|
|
2045
|
-
if (this.
|
|
2085
|
+
registerInput(input) {
|
|
2086
|
+
if (this.datepickerInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
2046
2087
|
throw Error('A MatDatepicker can only be associated with a single input.');
|
|
2047
2088
|
}
|
|
2048
2089
|
this._inputStateChanges.unsubscribe();
|
|
2049
|
-
this.
|
|
2090
|
+
this.datepickerInput = input;
|
|
2050
2091
|
this._inputStateChanges =
|
|
2051
|
-
input.stateChanges.subscribe(() => this.
|
|
2092
|
+
input.stateChanges.subscribe(() => this.stateChanges.next(undefined));
|
|
2052
2093
|
return this._model;
|
|
2053
2094
|
}
|
|
2095
|
+
/**
|
|
2096
|
+
* Registers a portal containing action buttons with the datepicker.
|
|
2097
|
+
* @param portal Portal to be registered.
|
|
2098
|
+
*/
|
|
2099
|
+
registerActions(portal) {
|
|
2100
|
+
if (this._actionsPortal && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
2101
|
+
throw Error('A MatDatepicker can only be associated with a single actions row.');
|
|
2102
|
+
}
|
|
2103
|
+
this._actionsPortal = portal;
|
|
2104
|
+
}
|
|
2105
|
+
/**
|
|
2106
|
+
* Removes a portal containing action buttons from the datepicker.
|
|
2107
|
+
* @param portal Portal to be removed.
|
|
2108
|
+
*/
|
|
2109
|
+
removeActions(portal) {
|
|
2110
|
+
if (portal === this._actionsPortal) {
|
|
2111
|
+
this._actionsPortal = null;
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2054
2114
|
/** Open the calendar. */
|
|
2055
2115
|
open() {
|
|
2056
2116
|
if (this._opened || this.disabled) {
|
|
2057
2117
|
return;
|
|
2058
2118
|
}
|
|
2059
|
-
if (!this.
|
|
2119
|
+
if (!this.datepickerInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
2060
2120
|
throw Error('Attempted to open an MatDatepicker with no associated input.');
|
|
2061
2121
|
}
|
|
2062
2122
|
if (this._document) {
|
|
@@ -2103,6 +2163,12 @@ class MatDatepickerBase {
|
|
|
2103
2163
|
completeClose();
|
|
2104
2164
|
}
|
|
2105
2165
|
}
|
|
2166
|
+
/** Applies the current pending selection on the popup to the model. */
|
|
2167
|
+
_applyPendingSelection() {
|
|
2168
|
+
var _a, _b;
|
|
2169
|
+
const instance = ((_a = this._popupComponentRef) === null || _a === void 0 ? void 0 : _a.instance) || ((_b = this._dialogRef) === null || _b === void 0 ? void 0 : _b.componentInstance);
|
|
2170
|
+
instance === null || instance === void 0 ? void 0 : instance._applyPendingSelection();
|
|
2171
|
+
}
|
|
2106
2172
|
/** Open the calendar as a dialog. */
|
|
2107
2173
|
_openAsDialog() {
|
|
2108
2174
|
// Usually this would be handled by `open` which ensures that we can only have one overlay
|
|
@@ -2158,11 +2224,12 @@ class MatDatepickerBase {
|
|
|
2158
2224
|
_forwardContentValues(instance) {
|
|
2159
2225
|
instance.datepicker = this;
|
|
2160
2226
|
instance.color = this.color;
|
|
2227
|
+
instance._actionsPortal = this._actionsPortal;
|
|
2161
2228
|
}
|
|
2162
2229
|
/** Create the popup. */
|
|
2163
2230
|
_createPopup() {
|
|
2164
2231
|
const positionStrategy = this._overlay.position()
|
|
2165
|
-
.flexibleConnectedTo(this.
|
|
2232
|
+
.flexibleConnectedTo(this.datepickerInput.getConnectedOverlayOrigin())
|
|
2166
2233
|
.withTransformOriginOn('.mat-datepicker-content')
|
|
2167
2234
|
.withFlexibleDimensions(false)
|
|
2168
2235
|
.withViewportMargin(8)
|
|
@@ -2179,7 +2246,7 @@ class MatDatepickerBase {
|
|
|
2179
2246
|
this._popupRef.overlayElement.setAttribute('role', 'dialog');
|
|
2180
2247
|
merge(this._popupRef.backdropClick(), this._popupRef.detachments(), this._popupRef.keydownEvents().pipe(filter(event => {
|
|
2181
2248
|
// Closing on alt + up is only valid when there's an input associated with the datepicker.
|
|
2182
|
-
return (event.keyCode === ESCAPE && !hasModifierKey(event)) || (this.
|
|
2249
|
+
return (event.keyCode === ESCAPE && !hasModifierKey(event)) || (this.datepickerInput &&
|
|
2183
2250
|
hasModifierKey(event, 'altKey') && event.keyCode === UP_ARROW);
|
|
2184
2251
|
}))).subscribe(event => {
|
|
2185
2252
|
if (event) {
|
|
@@ -2282,7 +2349,10 @@ MatDatepicker.decorators = [
|
|
|
2282
2349
|
exportAs: 'matDatepicker',
|
|
2283
2350
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2284
2351
|
encapsulation: ViewEncapsulation.None,
|
|
2285
|
-
providers: [
|
|
2352
|
+
providers: [
|
|
2353
|
+
MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER,
|
|
2354
|
+
{ provide: MatDatepickerBase, useExisting: MatDatepicker },
|
|
2355
|
+
]
|
|
2286
2356
|
},] }
|
|
2287
2357
|
];
|
|
2288
2358
|
|
|
@@ -2319,8 +2389,6 @@ class MatDatepickerInputBase {
|
|
|
2319
2389
|
this.dateChange = new EventEmitter();
|
|
2320
2390
|
/** Emits when an `input` event is fired on this `<input>`. */
|
|
2321
2391
|
this.dateInput = new EventEmitter();
|
|
2322
|
-
/** Emits when the value changes (either due to user input or programmatic change). */
|
|
2323
|
-
this._valueChange = new EventEmitter();
|
|
2324
2392
|
/** Emits when the internal state has changed */
|
|
2325
2393
|
this.stateChanges = new Subject();
|
|
2326
2394
|
this._onTouched = () => { };
|
|
@@ -2367,7 +2435,7 @@ class MatDatepickerInputBase {
|
|
|
2367
2435
|
}
|
|
2368
2436
|
// Update the displayed date when the locale changes.
|
|
2369
2437
|
this._localeSubscription = _dateAdapter.localeChanges.subscribe(() => {
|
|
2370
|
-
this.
|
|
2438
|
+
this._assignValueProgrammatically(this.value);
|
|
2371
2439
|
});
|
|
2372
2440
|
}
|
|
2373
2441
|
/** The value of the input. */
|
|
@@ -2375,15 +2443,7 @@ class MatDatepickerInputBase {
|
|
|
2375
2443
|
return this._model ? this._getValueFromModel(this._model.selection) : this._pendingValue;
|
|
2376
2444
|
}
|
|
2377
2445
|
set value(value) {
|
|
2378
|
-
|
|
2379
|
-
this._lastValueValid = this._isValidValue(value);
|
|
2380
|
-
value = this._dateAdapter.getValidDateOrNull(value);
|
|
2381
|
-
const oldDate = this.value;
|
|
2382
|
-
this._assignValue(value);
|
|
2383
|
-
this._formatValue(value);
|
|
2384
|
-
if (!this._dateAdapter.sameDate(oldDate, value)) {
|
|
2385
|
-
this._valueChange.emit(value);
|
|
2386
|
-
}
|
|
2446
|
+
this._assignValueProgrammatically(value);
|
|
2387
2447
|
}
|
|
2388
2448
|
/** Whether the datepicker-input is disabled. */
|
|
2389
2449
|
get disabled() { return !!this._disabled || this._parentDisabled(); }
|
|
@@ -2417,22 +2477,14 @@ class MatDatepickerInputBase {
|
|
|
2417
2477
|
this._assignValue(this._pendingValue);
|
|
2418
2478
|
}
|
|
2419
2479
|
this._valueChangesSubscription = this._model.selectionChanged.subscribe(event => {
|
|
2420
|
-
if (event
|
|
2480
|
+
if (this._shouldHandleChangeEvent(event)) {
|
|
2421
2481
|
const value = this._getValueFromModel(event.selection);
|
|
2422
2482
|
this._lastValueValid = this._isValidValue(value);
|
|
2423
2483
|
this._cvaOnChange(value);
|
|
2424
2484
|
this._onTouched();
|
|
2425
2485
|
this._formatValue(value);
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
// good way of distinguishing it at the moment.
|
|
2429
|
-
if (this._canEmitChangeEvent(event)) {
|
|
2430
|
-
this.dateInput.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
|
|
2431
|
-
this.dateChange.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
|
|
2432
|
-
}
|
|
2433
|
-
if (this._outsideValueChanged) {
|
|
2434
|
-
this._outsideValueChanged();
|
|
2435
|
-
}
|
|
2486
|
+
this.dateInput.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
|
|
2487
|
+
this.dateChange.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
|
|
2436
2488
|
}
|
|
2437
2489
|
});
|
|
2438
2490
|
}
|
|
@@ -2447,7 +2499,6 @@ class MatDatepickerInputBase {
|
|
|
2447
2499
|
ngOnDestroy() {
|
|
2448
2500
|
this._valueChangesSubscription.unsubscribe();
|
|
2449
2501
|
this._localeSubscription.unsubscribe();
|
|
2450
|
-
this._valueChange.complete();
|
|
2451
2502
|
this.stateChanges.complete();
|
|
2452
2503
|
}
|
|
2453
2504
|
/** @docs-private */
|
|
@@ -2460,7 +2511,7 @@ class MatDatepickerInputBase {
|
|
|
2460
2511
|
}
|
|
2461
2512
|
// Implemented as part of ControlValueAccessor.
|
|
2462
2513
|
writeValue(value) {
|
|
2463
|
-
this.value
|
|
2514
|
+
this._assignValueProgrammatically(value);
|
|
2464
2515
|
}
|
|
2465
2516
|
// Implemented as part of ControlValueAccessor.
|
|
2466
2517
|
registerOnChange(fn) {
|
|
@@ -2489,7 +2540,6 @@ class MatDatepickerInputBase {
|
|
|
2489
2540
|
if (!this._dateAdapter.sameDate(date, this.value)) {
|
|
2490
2541
|
this._assignValue(date);
|
|
2491
2542
|
this._cvaOnChange(date);
|
|
2492
|
-
this._valueChange.emit(date);
|
|
2493
2543
|
this.dateInput.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
|
|
2494
2544
|
}
|
|
2495
2545
|
else {
|
|
@@ -2542,6 +2592,14 @@ class MatDatepickerInputBase {
|
|
|
2542
2592
|
_parentDisabled() {
|
|
2543
2593
|
return false;
|
|
2544
2594
|
}
|
|
2595
|
+
/** Programmatically assigns a value to the input. */
|
|
2596
|
+
_assignValueProgrammatically(value) {
|
|
2597
|
+
value = this._dateAdapter.deserialize(value);
|
|
2598
|
+
this._lastValueValid = this._isValidValue(value);
|
|
2599
|
+
value = this._dateAdapter.getValidDateOrNull(value);
|
|
2600
|
+
this._assignValue(value);
|
|
2601
|
+
this._formatValue(value);
|
|
2602
|
+
}
|
|
2545
2603
|
/** Gets whether a value matches the current date filter. */
|
|
2546
2604
|
_matchesFilter(value) {
|
|
2547
2605
|
const filter = this._getDateFilter();
|
|
@@ -2606,13 +2664,15 @@ class MatDatepickerInput extends MatDatepickerInputBase {
|
|
|
2606
2664
|
constructor(elementRef, dateAdapter, dateFormats, _formField) {
|
|
2607
2665
|
super(elementRef, dateAdapter, dateFormats);
|
|
2608
2666
|
this._formField = _formField;
|
|
2667
|
+
this._closedSubscription = Subscription.EMPTY;
|
|
2609
2668
|
this._validator = Validators.compose(super._getValidators());
|
|
2610
2669
|
}
|
|
2611
2670
|
/** The datepicker that this input is associated with. */
|
|
2612
2671
|
set matDatepicker(datepicker) {
|
|
2613
2672
|
if (datepicker) {
|
|
2614
2673
|
this._datepicker = datepicker;
|
|
2615
|
-
this.
|
|
2674
|
+
this._closedSubscription = datepicker.closedStream.subscribe(() => this._onTouched());
|
|
2675
|
+
this._registerModel(datepicker.registerInput(this));
|
|
2616
2676
|
}
|
|
2617
2677
|
}
|
|
2618
2678
|
/** The minimum valid date. */
|
|
@@ -2657,6 +2717,10 @@ class MatDatepickerInput extends MatDatepickerInputBase {
|
|
|
2657
2717
|
getStartValue() {
|
|
2658
2718
|
return this.value;
|
|
2659
2719
|
}
|
|
2720
|
+
ngOnDestroy() {
|
|
2721
|
+
super.ngOnDestroy();
|
|
2722
|
+
this._closedSubscription.unsubscribe();
|
|
2723
|
+
}
|
|
2660
2724
|
/** Opens the associated datepicker. */
|
|
2661
2725
|
_openPopup() {
|
|
2662
2726
|
if (this._datepicker) {
|
|
@@ -2683,8 +2747,8 @@ class MatDatepickerInput extends MatDatepickerInputBase {
|
|
|
2683
2747
|
_getDateFilter() {
|
|
2684
2748
|
return this._dateFilter;
|
|
2685
2749
|
}
|
|
2686
|
-
|
|
2687
|
-
return
|
|
2750
|
+
_shouldHandleChangeEvent(event) {
|
|
2751
|
+
return event.source !== this;
|
|
2688
2752
|
}
|
|
2689
2753
|
}
|
|
2690
2754
|
MatDatepickerInput.decorators = [
|
|
@@ -2777,9 +2841,9 @@ class MatDatepickerToggle {
|
|
|
2777
2841
|
}
|
|
2778
2842
|
}
|
|
2779
2843
|
_watchStateChanges() {
|
|
2780
|
-
const datepickerStateChanged = this.datepicker ? this.datepicker.
|
|
2781
|
-
const inputStateChanged = this.datepicker && this.datepicker.
|
|
2782
|
-
this.datepicker.
|
|
2844
|
+
const datepickerStateChanged = this.datepicker ? this.datepicker.stateChanges : of();
|
|
2845
|
+
const inputStateChanged = this.datepicker && this.datepicker.datepickerInput ?
|
|
2846
|
+
this.datepicker.datepickerInput.stateChanges : of();
|
|
2783
2847
|
const datepickerToggled = this.datepicker ?
|
|
2784
2848
|
merge(this.datepicker.openedStream, this.datepicker.closedStream) :
|
|
2785
2849
|
of();
|
|
@@ -2790,18 +2854,15 @@ class MatDatepickerToggle {
|
|
|
2790
2854
|
MatDatepickerToggle.decorators = [
|
|
2791
2855
|
{ type: Component, args: [{
|
|
2792
2856
|
selector: 'mat-datepicker-toggle',
|
|
2793
|
-
template: "<button\n #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datepicker ? 'dialog' : null\"\n [attr.aria-label]=\"_intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n (click)=\"_open($event)\">\n\n <svg\n *ngIf=\"!_customIcon\"\n class=\"mat-datepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\"/>\n </svg>\n\n <ng-content select=\"[matDatepickerToggleIcon]\"></ng-content>\n</button>\n",
|
|
2857
|
+
template: "<button\n #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datepicker ? 'dialog' : null\"\n [attr.aria-label]=\"ariaLabel || _intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n (click)=\"_open($event)\">\n\n <svg\n *ngIf=\"!_customIcon\"\n class=\"mat-datepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\"/>\n </svg>\n\n <ng-content select=\"[matDatepickerToggleIcon]\"></ng-content>\n</button>\n",
|
|
2794
2858
|
host: {
|
|
2795
2859
|
'class': 'mat-datepicker-toggle',
|
|
2796
|
-
|
|
2797
|
-
// consumer may have provided, while still being able to receive focus.
|
|
2798
|
-
'[attr.tabindex]': 'disabled ? null : -1',
|
|
2860
|
+
'[attr.tabindex]': 'null',
|
|
2799
2861
|
'[class.mat-datepicker-toggle-active]': 'datepicker && datepicker.opened',
|
|
2800
2862
|
'[class.mat-accent]': 'datepicker && datepicker.color === "accent"',
|
|
2801
2863
|
'[class.mat-warn]': 'datepicker && datepicker.color === "warn"',
|
|
2802
2864
|
// Used by the test harness to tie this toggle to its datepicker.
|
|
2803
2865
|
'[attr.data-mat-calendar]': 'datepicker ? datepicker.id : null',
|
|
2804
|
-
'(focus)': '_button.focus()',
|
|
2805
2866
|
},
|
|
2806
2867
|
exportAs: 'matDatepickerToggle',
|
|
2807
2868
|
encapsulation: ViewEncapsulation.None,
|
|
@@ -2817,6 +2878,7 @@ MatDatepickerToggle.ctorParameters = () => [
|
|
|
2817
2878
|
MatDatepickerToggle.propDecorators = {
|
|
2818
2879
|
datepicker: [{ type: Input, args: ['for',] }],
|
|
2819
2880
|
tabIndex: [{ type: Input }],
|
|
2881
|
+
ariaLabel: [{ type: Input, args: ['aria-label',] }],
|
|
2820
2882
|
disabled: [{ type: Input }],
|
|
2821
2883
|
disableRipple: [{ type: Input }],
|
|
2822
2884
|
_customIcon: [{ type: ContentChild, args: [MatDatepickerToggleIcon,] }],
|
|
@@ -2846,11 +2908,6 @@ class MatDateRangeInputPartBase extends MatDatepickerInputBase {
|
|
|
2846
2908
|
this._injector = _injector;
|
|
2847
2909
|
this._parentForm = _parentForm;
|
|
2848
2910
|
this._parentFormGroup = _parentFormGroup;
|
|
2849
|
-
this._outsideValueChanged = () => {
|
|
2850
|
-
// Whenever the value changes outside the input we need to revalidate, because
|
|
2851
|
-
// the validation state of each of the inputs depends on the other one.
|
|
2852
|
-
this._validatorOnChange();
|
|
2853
|
-
};
|
|
2854
2911
|
}
|
|
2855
2912
|
ngOnInit() {
|
|
2856
2913
|
// We need the date input to provide itself as a `ControlValueAccessor` and a `Validator`, while
|
|
@@ -2908,6 +2965,15 @@ class MatDateRangeInputPartBase extends MatDatepickerInputBase {
|
|
|
2908
2965
|
_parentDisabled() {
|
|
2909
2966
|
return this._rangeInput._groupDisabled;
|
|
2910
2967
|
}
|
|
2968
|
+
_shouldHandleChangeEvent({ source }) {
|
|
2969
|
+
return source !== this._rangeInput._startInput && source !== this._rangeInput._endInput;
|
|
2970
|
+
}
|
|
2971
|
+
_assignValueProgrammatically(value) {
|
|
2972
|
+
super._assignValueProgrammatically(value);
|
|
2973
|
+
const opposite = (this === this._rangeInput._startInput ? this._rangeInput._endInput :
|
|
2974
|
+
this._rangeInput._startInput);
|
|
2975
|
+
opposite === null || opposite === void 0 ? void 0 : opposite._validatorOnChange();
|
|
2976
|
+
}
|
|
2911
2977
|
}
|
|
2912
2978
|
MatDateRangeInputPartBase.decorators = [
|
|
2913
2979
|
{ type: Directive }
|
|
@@ -2941,9 +3007,6 @@ class MatStartDate extends _MatDateRangeInputBase {
|
|
|
2941
3007
|
null : { 'matStartDateInvalid': { 'end': end, 'actual': start } };
|
|
2942
3008
|
};
|
|
2943
3009
|
this._validator = Validators.compose([...super._getValidators(), this._startValidator]);
|
|
2944
|
-
this._canEmitChangeEvent = (event) => {
|
|
2945
|
-
return event.source !== this._rangeInput._endInput;
|
|
2946
|
-
};
|
|
2947
3010
|
}
|
|
2948
3011
|
ngOnInit() {
|
|
2949
3012
|
// Normally this happens automatically, but it seems to break if not added explicitly when all
|
|
@@ -2970,7 +3033,6 @@ class MatStartDate extends _MatDateRangeInputBase {
|
|
|
2970
3033
|
if (this._model) {
|
|
2971
3034
|
const range = new DateRange(value, this._model.selection.end);
|
|
2972
3035
|
this._model.updateSelection(range, this);
|
|
2973
|
-
this._cvaOnChange(value);
|
|
2974
3036
|
}
|
|
2975
3037
|
}
|
|
2976
3038
|
_formatValue(value) {
|
|
@@ -3038,9 +3100,6 @@ class MatEndDate extends _MatDateRangeInputBase {
|
|
|
3038
3100
|
null : { 'matEndDateInvalid': { 'start': start, 'actual': end } };
|
|
3039
3101
|
};
|
|
3040
3102
|
this._validator = Validators.compose([...super._getValidators(), this._endValidator]);
|
|
3041
|
-
this._canEmitChangeEvent = (event) => {
|
|
3042
|
-
return event.source !== this._rangeInput._startInput;
|
|
3043
|
-
};
|
|
3044
3103
|
}
|
|
3045
3104
|
ngOnInit() {
|
|
3046
3105
|
// Normally this happens automatically, but it seems to break if not added explicitly when all
|
|
@@ -3067,7 +3126,6 @@ class MatEndDate extends _MatDateRangeInputBase {
|
|
|
3067
3126
|
if (this._model) {
|
|
3068
3127
|
const range = new DateRange(this._model.selection.start, value);
|
|
3069
3128
|
this._model.updateSelection(range, this);
|
|
3070
|
-
this._cvaOnChange(value);
|
|
3071
3129
|
}
|
|
3072
3130
|
}
|
|
3073
3131
|
_onKeydown(event) {
|
|
@@ -3115,41 +3173,6 @@ MatEndDate.ctorParameters = () => [
|
|
|
3115
3173
|
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DATE_FORMATS,] }] }
|
|
3116
3174
|
];
|
|
3117
3175
|
|
|
3118
|
-
/**
|
|
3119
|
-
* @license
|
|
3120
|
-
* Copyright Google LLC All Rights Reserved.
|
|
3121
|
-
*
|
|
3122
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
3123
|
-
* found in the LICENSE file at https://angular.io/license
|
|
3124
|
-
*/
|
|
3125
|
-
// TODO(mmalerba): We use a component instead of a directive here so the user can use implicit
|
|
3126
|
-
// template reference variables (e.g. #d vs #d="matDateRangePicker"). We can change this to a
|
|
3127
|
-
// directive if angular adds support for `exportAs: '$implicit'` on directives.
|
|
3128
|
-
/** Component responsible for managing the date range picker popup/dialog. */
|
|
3129
|
-
class MatDateRangePicker extends MatDatepickerBase {
|
|
3130
|
-
_forwardContentValues(instance) {
|
|
3131
|
-
super._forwardContentValues(instance);
|
|
3132
|
-
const input = this._datepickerInput;
|
|
3133
|
-
if (input) {
|
|
3134
|
-
instance.comparisonStart = input.comparisonStart;
|
|
3135
|
-
instance.comparisonEnd = input.comparisonEnd;
|
|
3136
|
-
}
|
|
3137
|
-
}
|
|
3138
|
-
}
|
|
3139
|
-
MatDateRangePicker.decorators = [
|
|
3140
|
-
{ type: Component, args: [{
|
|
3141
|
-
selector: 'mat-date-range-picker',
|
|
3142
|
-
template: '',
|
|
3143
|
-
exportAs: 'matDateRangePicker',
|
|
3144
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3145
|
-
encapsulation: ViewEncapsulation.None,
|
|
3146
|
-
providers: [
|
|
3147
|
-
MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER,
|
|
3148
|
-
MAT_CALENDAR_RANGE_STRATEGY_PROVIDER,
|
|
3149
|
-
]
|
|
3150
|
-
},] }
|
|
3151
|
-
];
|
|
3152
|
-
|
|
3153
3176
|
/**
|
|
3154
3177
|
* @license
|
|
3155
3178
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -3164,6 +3187,7 @@ class MatDateRangeInput {
|
|
|
3164
3187
|
this._elementRef = _elementRef;
|
|
3165
3188
|
this._dateAdapter = _dateAdapter;
|
|
3166
3189
|
this._formField = _formField;
|
|
3190
|
+
this._closedSubscription = Subscription.EMPTY;
|
|
3167
3191
|
/** Unique ID for the input. */
|
|
3168
3192
|
this.id = `mat-date-range-input-${nextUniqueId++}`;
|
|
3169
3193
|
/** Whether the control is focused. */
|
|
@@ -3210,8 +3234,14 @@ class MatDateRangeInput {
|
|
|
3210
3234
|
get rangePicker() { return this._rangePicker; }
|
|
3211
3235
|
set rangePicker(rangePicker) {
|
|
3212
3236
|
if (rangePicker) {
|
|
3213
|
-
this._model = rangePicker.
|
|
3237
|
+
this._model = rangePicker.registerInput(this);
|
|
3214
3238
|
this._rangePicker = rangePicker;
|
|
3239
|
+
this._closedSubscription.unsubscribe();
|
|
3240
|
+
this._closedSubscription = rangePicker.closedStream.subscribe(() => {
|
|
3241
|
+
var _a, _b;
|
|
3242
|
+
(_a = this._startInput) === null || _a === void 0 ? void 0 : _a._onTouched();
|
|
3243
|
+
(_b = this._endInput) === null || _b === void 0 ? void 0 : _b._onTouched();
|
|
3244
|
+
});
|
|
3215
3245
|
this._registerModel(this._model);
|
|
3216
3246
|
}
|
|
3217
3247
|
}
|
|
@@ -3324,6 +3354,7 @@ class MatDateRangeInput {
|
|
|
3324
3354
|
}
|
|
3325
3355
|
}
|
|
3326
3356
|
ngOnDestroy() {
|
|
3357
|
+
this._closedSubscription.unsubscribe();
|
|
3327
3358
|
this.stateChanges.complete();
|
|
3328
3359
|
}
|
|
3329
3360
|
/** Gets the date at which the calendar should start. */
|
|
@@ -3432,6 +3463,128 @@ MatDateRangeInput.propDecorators = {
|
|
|
3432
3463
|
_endInput: [{ type: ContentChild, args: [MatEndDate,] }]
|
|
3433
3464
|
};
|
|
3434
3465
|
|
|
3466
|
+
/**
|
|
3467
|
+
* @license
|
|
3468
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3469
|
+
*
|
|
3470
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3471
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3472
|
+
*/
|
|
3473
|
+
// TODO(mmalerba): We use a component instead of a directive here so the user can use implicit
|
|
3474
|
+
// template reference variables (e.g. #d vs #d="matDateRangePicker"). We can change this to a
|
|
3475
|
+
// directive if angular adds support for `exportAs: '$implicit'` on directives.
|
|
3476
|
+
/** Component responsible for managing the date range picker popup/dialog. */
|
|
3477
|
+
class MatDateRangePicker extends MatDatepickerBase {
|
|
3478
|
+
_forwardContentValues(instance) {
|
|
3479
|
+
super._forwardContentValues(instance);
|
|
3480
|
+
const input = this.datepickerInput;
|
|
3481
|
+
if (input) {
|
|
3482
|
+
instance.comparisonStart = input.comparisonStart;
|
|
3483
|
+
instance.comparisonEnd = input.comparisonEnd;
|
|
3484
|
+
}
|
|
3485
|
+
}
|
|
3486
|
+
}
|
|
3487
|
+
MatDateRangePicker.decorators = [
|
|
3488
|
+
{ type: Component, args: [{
|
|
3489
|
+
selector: 'mat-date-range-picker',
|
|
3490
|
+
template: '',
|
|
3491
|
+
exportAs: 'matDateRangePicker',
|
|
3492
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3493
|
+
encapsulation: ViewEncapsulation.None,
|
|
3494
|
+
providers: [
|
|
3495
|
+
MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER,
|
|
3496
|
+
MAT_CALENDAR_RANGE_STRATEGY_PROVIDER,
|
|
3497
|
+
{ provide: MatDatepickerBase, useExisting: MatDateRangePicker },
|
|
3498
|
+
]
|
|
3499
|
+
},] }
|
|
3500
|
+
];
|
|
3501
|
+
|
|
3502
|
+
/**
|
|
3503
|
+
* @license
|
|
3504
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3505
|
+
*
|
|
3506
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3507
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3508
|
+
*/
|
|
3509
|
+
/** Button that will close the datepicker and assign the current selection to the data model. */
|
|
3510
|
+
class MatDatepickerApply {
|
|
3511
|
+
constructor(_datepicker) {
|
|
3512
|
+
this._datepicker = _datepicker;
|
|
3513
|
+
}
|
|
3514
|
+
_applySelection() {
|
|
3515
|
+
this._datepicker._applyPendingSelection();
|
|
3516
|
+
this._datepicker.close();
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
MatDatepickerApply.decorators = [
|
|
3520
|
+
{ type: Directive, args: [{
|
|
3521
|
+
selector: '[matDatepickerApply], [matDateRangePickerApply]',
|
|
3522
|
+
host: { '(click)': '_applySelection()' }
|
|
3523
|
+
},] }
|
|
3524
|
+
];
|
|
3525
|
+
MatDatepickerApply.ctorParameters = () => [
|
|
3526
|
+
{ type: MatDatepickerBase }
|
|
3527
|
+
];
|
|
3528
|
+
/** Button that will close the datepicker and discard the current selection. */
|
|
3529
|
+
class MatDatepickerCancel {
|
|
3530
|
+
constructor(_datepicker) {
|
|
3531
|
+
this._datepicker = _datepicker;
|
|
3532
|
+
}
|
|
3533
|
+
}
|
|
3534
|
+
MatDatepickerCancel.decorators = [
|
|
3535
|
+
{ type: Directive, args: [{
|
|
3536
|
+
selector: '[matDatepickerCancel], [matDateRangePickerCancel]',
|
|
3537
|
+
host: { '(click)': '_datepicker.close()' }
|
|
3538
|
+
},] }
|
|
3539
|
+
];
|
|
3540
|
+
MatDatepickerCancel.ctorParameters = () => [
|
|
3541
|
+
{ type: MatDatepickerBase }
|
|
3542
|
+
];
|
|
3543
|
+
/**
|
|
3544
|
+
* Container that can be used to project a row of action buttons
|
|
3545
|
+
* to the bottom of a datepicker or date range picker.
|
|
3546
|
+
*/
|
|
3547
|
+
class MatDatepickerActions {
|
|
3548
|
+
constructor(_datepicker, _viewContainerRef) {
|
|
3549
|
+
this._datepicker = _datepicker;
|
|
3550
|
+
this._viewContainerRef = _viewContainerRef;
|
|
3551
|
+
}
|
|
3552
|
+
ngAfterViewInit() {
|
|
3553
|
+
this._portal = new TemplatePortal(this._template, this._viewContainerRef);
|
|
3554
|
+
this._datepicker.registerActions(this._portal);
|
|
3555
|
+
}
|
|
3556
|
+
ngOnDestroy() {
|
|
3557
|
+
var _a;
|
|
3558
|
+
this._datepicker.removeActions(this._portal);
|
|
3559
|
+
// Needs to be null checked since we initialize it in `ngAfterViewInit`.
|
|
3560
|
+
if (this._portal && this._portal.isAttached) {
|
|
3561
|
+
(_a = this._portal) === null || _a === void 0 ? void 0 : _a.detach();
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
}
|
|
3565
|
+
MatDatepickerActions.decorators = [
|
|
3566
|
+
{ type: Component, args: [{
|
|
3567
|
+
selector: 'mat-datepicker-actions, mat-date-range-picker-actions',
|
|
3568
|
+
template: `
|
|
3569
|
+
<ng-template>
|
|
3570
|
+
<div class="mat-datepicker-actions">
|
|
3571
|
+
<ng-content></ng-content>
|
|
3572
|
+
</div>
|
|
3573
|
+
</ng-template>
|
|
3574
|
+
`,
|
|
3575
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3576
|
+
encapsulation: ViewEncapsulation.None,
|
|
3577
|
+
styles: [".mat-datepicker-actions{display:flex;justify-content:flex-end;align-items:center;padding:0 8px 8px 8px}.mat-datepicker-actions .mat-button-base+.mat-button-base{margin-left:8px}[dir=rtl] .mat-datepicker-actions .mat-button-base+.mat-button-base{margin-left:0;margin-right:8px}\n"]
|
|
3578
|
+
},] }
|
|
3579
|
+
];
|
|
3580
|
+
MatDatepickerActions.ctorParameters = () => [
|
|
3581
|
+
{ type: MatDatepickerBase },
|
|
3582
|
+
{ type: ViewContainerRef }
|
|
3583
|
+
];
|
|
3584
|
+
MatDatepickerActions.propDecorators = {
|
|
3585
|
+
_template: [{ type: ViewChild, args: [TemplateRef,] }]
|
|
3586
|
+
};
|
|
3587
|
+
|
|
3435
3588
|
/**
|
|
3436
3589
|
* @license
|
|
3437
3590
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -3469,6 +3622,9 @@ MatDatepickerModule.decorators = [
|
|
|
3469
3622
|
MatStartDate,
|
|
3470
3623
|
MatEndDate,
|
|
3471
3624
|
MatDateRangePicker,
|
|
3625
|
+
MatDatepickerActions,
|
|
3626
|
+
MatDatepickerCancel,
|
|
3627
|
+
MatDatepickerApply
|
|
3472
3628
|
],
|
|
3473
3629
|
declarations: [
|
|
3474
3630
|
MatCalendar,
|
|
@@ -3486,6 +3642,9 @@ MatDatepickerModule.decorators = [
|
|
|
3486
3642
|
MatStartDate,
|
|
3487
3643
|
MatEndDate,
|
|
3488
3644
|
MatDateRangePicker,
|
|
3645
|
+
MatDatepickerActions,
|
|
3646
|
+
MatDatepickerCancel,
|
|
3647
|
+
MatDatepickerApply
|
|
3489
3648
|
],
|
|
3490
3649
|
providers: [
|
|
3491
3650
|
MatDatepickerIntl,
|
|
@@ -3510,5 +3669,5 @@ MatDatepickerModule.decorators = [
|
|
|
3510
3669
|
* Generated bundle index. Do not edit.
|
|
3511
3670
|
*/
|
|
3512
3671
|
|
|
3513
|
-
export { DateRange, DefaultMatCalendarRangeStrategy, MAT_DATEPICKER_SCROLL_STRATEGY, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER, MAT_DATEPICKER_VALIDATORS, MAT_DATEPICKER_VALUE_ACCESSOR, MAT_DATE_RANGE_SELECTION_STRATEGY, MAT_RANGE_DATE_SELECTION_MODEL_FACTORY, MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER, MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY, MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER, MatCalendar, MatCalendarBody, MatCalendarCell, MatCalendarHeader, MatDateRangeInput, MatDateRangePicker, MatDateSelectionModel, MatDatepicker, MatDatepickerContent, MatDatepickerInput, MatDatepickerInputEvent, MatDatepickerIntl, MatDatepickerModule, MatDatepickerToggle, MatDatepickerToggleIcon, MatEndDate, MatMonthView, MatMultiYearView, MatRangeDateSelectionModel, MatSingleDateSelectionModel, MatStartDate, MatYearView, matDatepickerAnimations, yearsPerPage, yearsPerRow, MAT_CALENDAR_RANGE_STRATEGY_PROVIDER_FACTORY as ɵangular_material_src_material_datepicker_datepicker_a, MAT_CALENDAR_RANGE_STRATEGY_PROVIDER as ɵangular_material_src_material_datepicker_datepicker_b, MatDatepickerBase as ɵangular_material_src_material_datepicker_datepicker_c, MatDatepickerInputBase as ɵangular_material_src_material_datepicker_datepicker_d, MAT_DATE_RANGE_INPUT_PARENT as ɵangular_material_src_material_datepicker_datepicker_e };
|
|
3672
|
+
export { DateRange, DefaultMatCalendarRangeStrategy, MAT_DATEPICKER_SCROLL_STRATEGY, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER, MAT_DATEPICKER_VALIDATORS, MAT_DATEPICKER_VALUE_ACCESSOR, MAT_DATE_RANGE_SELECTION_STRATEGY, MAT_RANGE_DATE_SELECTION_MODEL_FACTORY, MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER, MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY, MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER, MatCalendar, MatCalendarBody, MatCalendarCell, MatCalendarHeader, MatDateRangeInput, MatDateRangePicker, MatDateSelectionModel, MatDatepicker, MatDatepickerActions, MatDatepickerApply, MatDatepickerCancel, MatDatepickerContent, MatDatepickerInput, MatDatepickerInputEvent, MatDatepickerIntl, MatDatepickerModule, MatDatepickerToggle, MatDatepickerToggleIcon, MatEndDate, MatMonthView, MatMultiYearView, MatRangeDateSelectionModel, MatSingleDateSelectionModel, MatStartDate, MatYearView, matDatepickerAnimations, yearsPerPage, yearsPerRow, MAT_CALENDAR_RANGE_STRATEGY_PROVIDER_FACTORY as ɵangular_material_src_material_datepicker_datepicker_a, MAT_CALENDAR_RANGE_STRATEGY_PROVIDER as ɵangular_material_src_material_datepicker_datepicker_b, MatDatepickerBase as ɵangular_material_src_material_datepicker_datepicker_c, MatDatepickerInputBase as ɵangular_material_src_material_datepicker_datepicker_d, MAT_DATE_RANGE_INPUT_PARENT as ɵangular_material_src_material_datepicker_datepicker_e };
|
|
3514
3673
|
//# sourceMappingURL=datepicker.js.map
|