@angular/material 2.0.0-alpha.9-3 → 2.0.0-beta.11
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/LICENSE +21 -0
- package/README.md +4 -145
- package/_theming.scss +3872 -0
- package/autocomplete/index.d.ts +8 -0
- package/autocomplete/index.metadata.json +11 -0
- package/autocomplete/package.json +7 -0
- package/autocomplete/typings/autocomplete-module.d.ts +2 -0
- package/autocomplete/typings/autocomplete-trigger.d.ts +159 -0
- package/autocomplete/typings/autocomplete.d.ts +55 -0
- package/autocomplete/typings/index.d.ts +4 -0
- package/autocomplete/typings/index.metadata.json +1 -0
- package/autocomplete/typings/mat-exports.d.ts +17 -0
- package/autocomplete/typings/public_api.d.ts +11 -0
- package/autocomplete.d.ts +8 -0
- package/autocomplete.metadata.json +11 -0
- package/bundles/material-autocomplete.umd.js +3293 -0
- package/bundles/material-autocomplete.umd.js.map +1 -0
- package/bundles/material-autocomplete.umd.min.js +10 -0
- package/bundles/material-autocomplete.umd.min.js.map +1 -0
- package/bundles/material-button-toggle.umd.js +2689 -0
- package/bundles/material-button-toggle.umd.js.map +1 -0
- package/bundles/material-button-toggle.umd.min.js +10 -0
- package/bundles/material-button-toggle.umd.min.js.map +1 -0
- package/bundles/material-button.umd.js +2503 -0
- package/bundles/material-button.umd.js.map +1 -0
- package/bundles/material-button.umd.min.js +10 -0
- package/bundles/material-button.umd.min.js.map +1 -0
- package/bundles/material-card.umd.js +2438 -0
- package/bundles/material-card.umd.js.map +1 -0
- package/bundles/material-card.umd.min.js +10 -0
- package/bundles/material-card.umd.min.js.map +1 -0
- package/bundles/material-checkbox.umd.js +2692 -0
- package/bundles/material-checkbox.umd.js.map +1 -0
- package/bundles/material-checkbox.umd.min.js +10 -0
- package/bundles/material-checkbox.umd.min.js.map +1 -0
- package/bundles/material-chips.umd.js +4121 -0
- package/bundles/material-chips.umd.js.map +1 -0
- package/bundles/material-chips.umd.min.js +11 -0
- package/bundles/material-chips.umd.min.js.map +1 -0
- package/bundles/material-core.umd.js +2505 -0
- package/bundles/material-core.umd.js.map +1 -0
- package/bundles/material-core.umd.min.js +10 -0
- package/bundles/material-core.umd.min.js.map +1 -0
- package/bundles/material-datepicker.umd.js +6568 -0
- package/bundles/material-datepicker.umd.js.map +1 -0
- package/bundles/material-datepicker.umd.min.js +12 -0
- package/bundles/material-datepicker.umd.min.js.map +1 -0
- package/bundles/material-dialog.umd.js +2980 -0
- package/bundles/material-dialog.umd.js.map +1 -0
- package/bundles/material-dialog.umd.min.js +10 -0
- package/bundles/material-dialog.umd.min.js.map +1 -0
- package/bundles/material-examples.umd.js +3627 -0
- package/bundles/material-examples.umd.js.map +1 -0
- package/bundles/material-examples.umd.min.js +12 -0
- package/bundles/material-examples.umd.min.js.map +1 -0
- package/bundles/material-expansion.umd.js +2678 -0
- package/bundles/material-expansion.umd.js.map +1 -0
- package/bundles/material-expansion.umd.min.js +10 -0
- package/bundles/material-expansion.umd.min.js.map +1 -0
- package/bundles/material-form-field.umd.js +2629 -0
- package/bundles/material-form-field.umd.js.map +1 -0
- package/bundles/material-form-field.umd.min.js +10 -0
- package/bundles/material-form-field.umd.min.js.map +1 -0
- package/bundles/material-grid-list.umd.js +3000 -0
- package/bundles/material-grid-list.umd.js.map +1 -0
- package/bundles/material-grid-list.umd.min.js +10 -0
- package/bundles/material-grid-list.umd.min.js.map +1 -0
- package/bundles/material-icon.umd.js +2862 -0
- package/bundles/material-icon.umd.js.map +1 -0
- package/bundles/material-icon.umd.min.js +10 -0
- package/bundles/material-icon.umd.min.js.map +1 -0
- package/bundles/material-input.umd.js +3214 -0
- package/bundles/material-input.umd.js.map +1 -0
- package/bundles/material-input.umd.min.js +10 -0
- package/bundles/material-input.umd.min.js.map +1 -0
- package/bundles/material-list.umd.js +2908 -0
- package/bundles/material-list.umd.js.map +1 -0
- package/bundles/material-list.umd.min.js +11 -0
- package/bundles/material-list.umd.min.js.map +1 -0
- package/bundles/material-menu.umd.js +3016 -0
- package/bundles/material-menu.umd.js.map +1 -0
- package/bundles/material-menu.umd.min.js +10 -0
- package/bundles/material-menu.umd.min.js.map +1 -0
- package/bundles/material-paginator.umd.js +4990 -0
- package/bundles/material-paginator.umd.js.map +1 -0
- package/bundles/material-paginator.umd.min.js +11 -0
- package/bundles/material-paginator.umd.min.js.map +1 -0
- package/bundles/material-progress-bar.umd.js +2204 -0
- package/bundles/material-progress-bar.umd.js.map +1 -0
- package/bundles/material-progress-bar.umd.min.js +10 -0
- package/bundles/material-progress-bar.umd.min.js.map +1 -0
- package/bundles/material-progress-spinner.umd.js +2594 -0
- package/bundles/material-progress-spinner.umd.js.map +1 -0
- package/bundles/material-progress-spinner.umd.min.js +10 -0
- package/bundles/material-progress-spinner.umd.min.js.map +1 -0
- package/bundles/material-radio.umd.js +2936 -0
- package/bundles/material-radio.umd.js.map +1 -0
- package/bundles/material-radio.umd.min.js +10 -0
- package/bundles/material-radio.umd.min.js.map +1 -0
- package/bundles/material-select.umd.js +3611 -0
- package/bundles/material-select.umd.js.map +1 -0
- package/bundles/material-select.umd.min.js +10 -0
- package/bundles/material-select.umd.min.js.map +1 -0
- package/bundles/material-sidenav.umd.js +2781 -0
- package/bundles/material-sidenav.umd.js.map +1 -0
- package/bundles/material-sidenav.umd.min.js +10 -0
- package/bundles/material-sidenav.umd.min.js.map +1 -0
- package/bundles/material-slide-toggle.umd.js +2657 -0
- package/bundles/material-slide-toggle.umd.js.map +1 -0
- package/bundles/material-slide-toggle.umd.min.js +10 -0
- package/bundles/material-slide-toggle.umd.min.js.map +1 -0
- package/bundles/material-slider.umd.js +3043 -0
- package/bundles/material-slider.umd.js.map +1 -0
- package/bundles/material-slider.umd.min.js +10 -0
- package/bundles/material-slider.umd.min.js.map +1 -0
- package/bundles/material-snack-bar.umd.js +2717 -0
- package/bundles/material-snack-bar.umd.js.map +1 -0
- package/bundles/material-snack-bar.umd.min.js +10 -0
- package/bundles/material-snack-bar.umd.min.js.map +1 -0
- package/bundles/material-sort.umd.js +2479 -0
- package/bundles/material-sort.umd.js.map +1 -0
- package/bundles/material-sort.umd.min.js +10 -0
- package/bundles/material-sort.umd.min.js.map +1 -0
- package/bundles/material-stepper.umd.js +3598 -0
- package/bundles/material-stepper.umd.js.map +1 -0
- package/bundles/material-stepper.umd.min.js +11 -0
- package/bundles/material-stepper.umd.min.js.map +1 -0
- package/bundles/material-table.umd.js +2458 -0
- package/bundles/material-table.umd.js.map +1 -0
- package/bundles/material-table.umd.min.js +10 -0
- package/bundles/material-table.umd.min.js.map +1 -0
- package/bundles/material-tabs.umd.js +3742 -0
- package/bundles/material-tabs.umd.js.map +1 -0
- package/bundles/material-tabs.umd.min.js +10 -0
- package/bundles/material-tabs.umd.min.js.map +1 -0
- package/bundles/material-toolbar.umd.js +2211 -0
- package/bundles/material-toolbar.umd.js.map +1 -0
- package/bundles/material-toolbar.umd.min.js +9 -0
- package/bundles/material-toolbar.umd.min.js.map +1 -0
- package/bundles/material-tooltip.umd.js +2821 -0
- package/bundles/material-tooltip.umd.js.map +1 -0
- package/bundles/material-tooltip.umd.min.js +10 -0
- package/bundles/material-tooltip.umd.min.js.map +1 -0
- package/bundles/material.umd.js +23785 -0
- package/bundles/material.umd.js.map +1 -0
- package/bundles/material.umd.min.js +23 -0
- package/bundles/material.umd.min.js.map +1 -0
- package/button/index.d.ts +8 -1
- package/button/index.metadata.json +11 -1
- package/button/package.json +7 -0
- package/button/typings/button-module.d.ts +2 -0
- package/button/typings/button.d.ts +80 -0
- package/button/typings/index.d.ts +4 -0
- package/button/typings/index.metadata.json +1 -0
- package/button/typings/mat-exports.d.ts +18 -0
- package/button/typings/public_api.d.ts +10 -0
- package/button-toggle/index.d.ts +8 -1
- package/button-toggle/index.metadata.json +11 -1
- package/button-toggle/package.json +7 -0
- package/button-toggle/typings/button-toggle-module.d.ts +2 -0
- package/button-toggle/typings/button-toggle.d.ts +156 -0
- package/button-toggle/typings/index.d.ts +4 -0
- package/button-toggle/typings/index.metadata.json +1 -0
- package/button-toggle/typings/mat-exports.d.ts +16 -0
- package/button-toggle/typings/public_api.d.ts +10 -0
- package/button-toggle.d.ts +8 -0
- package/button-toggle.metadata.json +11 -0
- package/button.d.ts +8 -0
- package/button.metadata.json +11 -0
- package/card/index.d.ts +8 -1
- package/card/index.metadata.json +11 -1
- package/card/package.json +7 -0
- package/card/typings/card-module.d.ts +2 -0
- package/card/typings/card.d.ts +95 -0
- package/card/typings/index.d.ts +4 -0
- package/card/typings/index.metadata.json +1 -0
- package/card/typings/mat-exports.d.ts +24 -0
- package/card/typings/public_api.d.ts +10 -0
- package/card.d.ts +8 -0
- package/card.metadata.json +11 -0
- package/checkbox/index.d.ts +8 -1
- package/checkbox/index.metadata.json +11 -1
- package/checkbox/package.json +7 -0
- package/checkbox/typings/checkbox-module.d.ts +2 -0
- package/checkbox/typings/checkbox-required-validator.d.ts +18 -0
- package/checkbox/typings/checkbox.d.ts +159 -0
- package/checkbox/typings/index.d.ts +4 -0
- package/checkbox/typings/index.metadata.json +1 -0
- package/checkbox/typings/mat-exports.d.ts +17 -0
- package/checkbox/typings/public_api.d.ts +11 -0
- package/checkbox.d.ts +8 -0
- package/checkbox.metadata.json +11 -0
- package/chips/index.d.ts +8 -0
- package/chips/index.metadata.json +11 -0
- package/chips/package.json +7 -0
- package/chips/typings/chip-input.d.ts +54 -0
- package/chips/typings/chip-list.d.ts +219 -0
- package/chips/typings/chip.d.ts +123 -0
- package/chips/typings/chips-module.d.ts +2 -0
- package/chips/typings/index.d.ts +4 -0
- package/chips/typings/index.metadata.json +1 -0
- package/chips/typings/mat-exports.d.ts +21 -0
- package/chips/typings/public_api.d.ts +12 -0
- package/chips.d.ts +8 -0
- package/chips.metadata.json +11 -0
- package/core/index.d.ts +8 -1
- package/core/index.metadata.json +11 -1
- package/core/package.json +7 -0
- package/core/typings/a11y/index.d.ts +8 -0
- package/core/typings/animation/animation.d.ts +20 -0
- package/core/typings/bidi/index.d.ts +8 -0
- package/core/typings/common-behaviors/color.d.ts +22 -0
- package/core/typings/common-behaviors/common-module.d.ts +24 -0
- package/core/typings/common-behaviors/constructor.d.ts +9 -0
- package/core/typings/common-behaviors/disable-ripple.d.ts +7 -0
- package/core/typings/common-behaviors/disabled.d.ts +7 -0
- package/core/typings/common-behaviors/index.d.ts +12 -0
- package/core/typings/common-behaviors/tabindex.d.ts +15 -0
- package/core/typings/compatibility/compatibility.d.ts +40 -0
- package/core/typings/coordination/unique-selection-dispatcher.d.ts +40 -0
- package/core/typings/datetime/date-adapter.d.ts +198 -0
- package/core/typings/datetime/date-formats.d.ts +20 -0
- package/core/typings/datetime/index.d.ts +8 -0
- package/core/typings/datetime/native-date-adapter.d.ts +50 -0
- package/core/typings/datetime/native-date-formats.d.ts +9 -0
- package/core/typings/error/error-options.d.ts +19 -0
- package/core/typings/gestures/gesture-annotations.d.ts +51 -0
- package/core/typings/gestures/gesture-config.d.ts +23 -0
- package/core/typings/index.d.ts +5 -0
- package/core/typings/index.metadata.json +1 -0
- package/core/typings/keyboard/keycodes.d.ts +8 -0
- package/core/typings/line/line.d.ts +30 -0
- package/core/typings/mat-exports.d.ts +36 -0
- package/core/typings/option/index.d.ts +4 -0
- package/core/typings/option/optgroup.d.ts +14 -0
- package/core/typings/option/option.d.ts +97 -0
- package/core/typings/overlay/index.d.ts +8 -0
- package/core/typings/placeholder/placeholder-options.d.ts +15 -0
- package/core/typings/platform/features.d.ts +8 -0
- package/core/typings/platform/index.d.ts +10 -0
- package/core/typings/platform/platform.d.ts +8 -0
- package/core/typings/portal/dom-portal-host.d.ts +8 -0
- package/core/typings/portal/portal-directives.d.ts +8 -0
- package/core/typings/portal/portal-injector.d.ts +19 -0
- package/core/typings/portal/portal.d.ts +8 -0
- package/core/typings/public_api.d.ts +34 -0
- package/core/typings/ripple/index.d.ts +5 -0
- package/core/typings/ripple/ripple-ref.d.ts +28 -0
- package/core/typings/ripple/ripple-renderer.d.ts +64 -0
- package/core/typings/ripple/ripple.d.ts +73 -0
- package/core/typings/rxjs/index.d.ts +9 -0
- package/core/typings/rxjs/rx-chain.d.ts +8 -0
- package/core/typings/rxjs/rx-operators.d.ts +8 -0
- package/core/typings/selection/index.d.ts +3 -0
- package/core/typings/selection/pseudo-checkbox/pseudo-checkbox.d.ts +20 -0
- package/core/typings/style/apply-transform.d.ts +13 -0
- package/core/typings/style/index.d.ts +5 -0
- package/core/typings/testing/month-constants.d.ts +12 -0
- package/core/typings/util/object-extend.d.ts +15 -0
- package/core.d.ts +7 -0
- package/core.metadata.json +11 -1
- package/datepicker/index.d.ts +8 -0
- package/datepicker/index.metadata.json +11 -0
- package/datepicker/package.json +7 -0
- package/datepicker/typings/calendar-body.d.ts +52 -0
- package/datepicker/typings/calendar.d.ts +90 -0
- package/datepicker/typings/coerce-date-property.d.ts +19 -0
- package/datepicker/typings/datepicker-errors.d.ts +9 -0
- package/datepicker/typings/datepicker-input.d.ts +94 -0
- package/datepicker/typings/datepicker-intl.d.ts +25 -0
- package/datepicker/typings/datepicker-module.d.ts +2 -0
- package/datepicker/typings/datepicker-toggle.d.ts +24 -0
- package/datepicker/typings/datepicker.d.ts +117 -0
- package/datepicker/typings/index.d.ts +4 -0
- package/datepicker/typings/index.metadata.json +1 -0
- package/datepicker/typings/mat-exports.d.ts +33 -0
- package/datepicker/typings/month-view.d.ts +65 -0
- package/datepicker/typings/public_api.d.ts +18 -0
- package/datepicker/typings/year-view.d.ts +54 -0
- package/datepicker.d.ts +8 -0
- package/datepicker.metadata.json +11 -0
- package/dialog/index.d.ts +8 -4
- package/dialog/index.metadata.json +11 -1
- package/dialog/package.json +7 -0
- package/dialog/typings/dialog-config.d.ts +54 -0
- package/dialog/typings/dialog-container.d.ts +68 -0
- package/dialog/typings/dialog-content-directives.d.ts +45 -0
- package/dialog/typings/dialog-module.d.ts +2 -0
- package/dialog/typings/dialog-ref.d.ts +68 -0
- package/dialog/typings/dialog.d.ts +108 -0
- package/dialog/typings/index.d.ts +4 -0
- package/dialog/typings/index.metadata.json +1 -0
- package/dialog/typings/mat-exports.d.ts +26 -0
- package/dialog/typings/public_api.d.ts +14 -0
- package/dialog.d.ts +8 -0
- package/dialog.metadata.json +11 -0
- package/esm2015/autocomplete.js +661 -0
- package/esm2015/autocomplete.js.map +1 -0
- package/esm2015/button-toggle.js +567 -0
- package/esm2015/button-toggle.js.map +1 -0
- package/esm2015/button.js +323 -0
- package/esm2015/button.js.map +1 -0
- package/esm2015/card.js +312 -0
- package/esm2015/card.js.map +1 -0
- package/esm2015/checkbox.js +504 -0
- package/esm2015/checkbox.js.map +1 -0
- package/esm2015/chips.js +1332 -0
- package/esm2015/chips.js.map +1 -0
- package/esm2015/core.js +2316 -0
- package/esm2015/core.js.map +1 -0
- package/esm2015/datepicker.js +1808 -0
- package/esm2015/datepicker.js.map +1 -0
- package/esm2015/dialog.js +849 -0
- package/esm2015/dialog.js.map +1 -0
- package/esm2015/expansion.js +581 -0
- package/esm2015/expansion.js.map +1 -0
- package/esm2015/form-field.js +522 -0
- package/esm2015/form-field.js.map +1 -0
- package/esm2015/grid-list.js +825 -0
- package/esm2015/grid-list.js.map +1 -0
- package/esm2015/icon.js +733 -0
- package/esm2015/icon.js.map +1 -0
- package/esm2015/input.js +568 -0
- package/esm2015/input.js.map +1 -0
- package/esm2015/list.js +666 -0
- package/esm2015/list.js.map +1 -0
- package/esm2015/material.js +51 -0
- package/esm2015/material.js.map +1 -0
- package/esm2015/menu.js +917 -0
- package/esm2015/menu.js.map +1 -0
- package/esm2015/paginator.js +304 -0
- package/esm2015/paginator.js.map +1 -0
- package/esm2015/progress-bar.js +132 -0
- package/esm2015/progress-bar.js.map +1 -0
- package/esm2015/progress-spinner.js +438 -0
- package/esm2015/progress-spinner.js.map +1 -0
- package/esm2015/radio.js +707 -0
- package/esm2015/radio.js.map +1 -0
- package/esm2015/select.js +1378 -0
- package/esm2015/select.js.map +1 -0
- package/esm2015/sidenav.js +666 -0
- package/esm2015/sidenav.js.map +1 -0
- package/esm2015/slide-toggle.js +429 -0
- package/esm2015/slide-toggle.js.map +1 -0
- package/esm2015/slider.js +833 -0
- package/esm2015/slider.js.map +1 -0
- package/esm2015/snack-bar.js +606 -0
- package/esm2015/snack-bar.js.map +1 -0
- package/esm2015/sort.js +387 -0
- package/esm2015/sort.js.map +1 -0
- package/esm2015/stepper.js +330 -0
- package/esm2015/stepper.js.map +1 -0
- package/esm2015/table.js +312 -0
- package/esm2015/table.js.map +1 -0
- package/esm2015/tabs.js +1477 -0
- package/esm2015/tabs.js.map +1 -0
- package/esm2015/toolbar.js +88 -0
- package/esm2015/toolbar.js.map +1 -0
- package/esm2015/tooltip.js +701 -0
- package/esm2015/tooltip.js.map +1 -0
- package/esm5/autocomplete.es5.js +691 -0
- package/esm5/autocomplete.es5.js.map +1 -0
- package/esm5/button-toggle.es5.js +619 -0
- package/esm5/button-toggle.es5.js.map +1 -0
- package/esm5/button.es5.js +341 -0
- package/esm5/button.es5.js.map +1 -0
- package/esm5/card.es5.js +349 -0
- package/esm5/card.es5.js.map +1 -0
- package/esm5/checkbox.es5.js +534 -0
- package/esm5/checkbox.es5.js.map +1 -0
- package/esm5/chips.es5.js +1466 -0
- package/esm5/chips.es5.js.map +1 -0
- package/esm5/core.es5.js +2316 -0
- package/esm5/core.es5.js.map +1 -0
- package/esm5/datepicker.es5.js +1936 -0
- package/esm5/datepicker.es5.js.map +1 -0
- package/esm5/dialog.es5.js +877 -0
- package/esm5/dialog.es5.js.map +1 -0
- package/esm5/expansion.es5.js +608 -0
- package/esm5/expansion.es5.js.map +1 -0
- package/esm5/form-field.es5.js +556 -0
- package/esm5/form-field.es5.js.map +1 -0
- package/esm5/grid-list.es5.js +877 -0
- package/esm5/grid-list.es5.js.map +1 -0
- package/esm5/icon.es5.js +746 -0
- package/esm5/icon.es5.js.map +1 -0
- package/esm5/input.es5.js +606 -0
- package/esm5/input.es5.js.map +1 -0
- package/esm5/list.es5.js +726 -0
- package/esm5/list.es5.js.map +1 -0
- package/esm5/material.es5.js +48 -0
- package/esm5/material.es5.js.map +1 -0
- package/esm5/menu.es5.js +953 -0
- package/esm5/menu.es5.js.map +1 -0
- package/esm5/paginator.es5.js +324 -0
- package/esm5/paginator.es5.js.map +1 -0
- package/esm5/progress-bar.es5.js +142 -0
- package/esm5/progress-bar.es5.js.map +1 -0
- package/esm5/progress-spinner.es5.js +474 -0
- package/esm5/progress-spinner.es5.js.map +1 -0
- package/esm5/radio.es5.js +779 -0
- package/esm5/radio.es5.js.map +1 -0
- package/esm5/select.es5.js +1444 -0
- package/esm5/select.es5.js.map +1 -0
- package/esm5/sidenav.es5.js +719 -0
- package/esm5/sidenav.es5.js.map +1 -0
- package/esm5/slide-toggle.es5.js +451 -0
- package/esm5/slide-toggle.es5.js.map +1 -0
- package/esm5/slider.es5.js +932 -0
- package/esm5/slider.es5.js.map +1 -0
- package/esm5/snack-bar.es5.js +623 -0
- package/esm5/snack-bar.es5.js.map +1 -0
- package/esm5/sort.es5.js +418 -0
- package/esm5/sort.es5.js.map +1 -0
- package/esm5/stepper.es5.js +376 -0
- package/esm5/stepper.es5.js.map +1 -0
- package/esm5/table.es5.js +370 -0
- package/esm5/table.es5.js.map +1 -0
- package/esm5/tabs.es5.js +1576 -0
- package/esm5/tabs.es5.js.map +1 -0
- package/esm5/toolbar.es5.js +94 -0
- package/esm5/toolbar.es5.js.map +1 -0
- package/esm5/tooltip.es5.js +759 -0
- package/esm5/tooltip.es5.js.map +1 -0
- package/expansion/index.d.ts +8 -0
- package/expansion/index.metadata.json +11 -0
- package/expansion/package.json +7 -0
- package/expansion/typings/accordion-item.d.ts +41 -0
- package/expansion/typings/accordion.d.ts +29 -0
- package/expansion/typings/expansion-module.d.ts +2 -0
- package/expansion/typings/expansion-panel-header.d.ts +56 -0
- package/expansion/typings/expansion-panel.d.ts +39 -0
- package/expansion/typings/index.d.ts +5 -0
- package/expansion/typings/index.metadata.json +1 -0
- package/expansion/typings/mat-exports.d.ts +20 -0
- package/expansion/typings/public_api.d.ts +13 -0
- package/expansion.d.ts +8 -0
- package/expansion.metadata.json +11 -0
- package/form-field/index.d.ts +8 -0
- package/form-field/index.metadata.json +11 -0
- package/form-field/package.json +7 -0
- package/form-field/typings/error.d.ts +4 -0
- package/form-field/typings/form-field-control.d.ts +39 -0
- package/form-field/typings/form-field-errors.d.ts +13 -0
- package/form-field/typings/form-field-module.d.ts +2 -0
- package/form-field/typings/form-field.d.ts +77 -0
- package/form-field/typings/hint.d.ts +7 -0
- package/form-field/typings/index.d.ts +4 -0
- package/form-field/typings/index.metadata.json +1 -0
- package/form-field/typings/mat-exports.d.ts +23 -0
- package/form-field/typings/placeholder.d.ts +3 -0
- package/form-field/typings/prefix.d.ts +3 -0
- package/form-field/typings/public_api.d.ts +17 -0
- package/form-field/typings/suffix.d.ts +3 -0
- package/form-field.d.ts +8 -0
- package/form-field.metadata.json +11 -0
- package/grid-list/index.d.ts +8 -1
- package/grid-list/index.metadata.json +11 -1
- package/grid-list/package.json +7 -0
- package/grid-list/typings/grid-list-measure.d.ts +17 -0
- package/grid-list/typings/grid-list-module.d.ts +2 -0
- package/grid-list/typings/grid-list.d.ts +53 -0
- package/grid-list/typings/grid-tile.d.ts +55 -0
- package/grid-list/typings/index.d.ts +5 -0
- package/grid-list/typings/index.metadata.json +1 -0
- package/grid-list/typings/mat-exports.d.ts +13 -0
- package/grid-list/typings/public_api.d.ts +11 -0
- package/grid-list/typings/tile-coordinator.d.ts +64 -0
- package/grid-list/typings/tile-styler.d.ts +129 -0
- package/grid-list.d.ts +8 -0
- package/grid-list.metadata.json +11 -0
- package/icon/index.d.ts +8 -1
- package/icon/index.metadata.json +11 -1
- package/icon/package.json +7 -0
- package/icon/typings/icon-module.d.ts +2 -0
- package/icon/typings/icon-registry.d.ts +194 -0
- package/icon/typings/icon.d.ts +76 -0
- package/icon/typings/index.d.ts +4 -0
- package/icon/typings/index.metadata.json +1 -0
- package/icon/typings/mat-exports.d.ts +14 -0
- package/icon/typings/public_api.d.ts +11 -0
- package/icon.d.ts +8 -0
- package/icon.metadata.json +11 -0
- package/input/index.d.ts +8 -1
- package/input/index.metadata.json +11 -1
- package/input/package.json +7 -0
- package/input/typings/autosize.d.ts +45 -0
- package/input/typings/index.d.ts +4 -0
- package/input/typings/index.metadata.json +1 -0
- package/input/typings/input-errors.d.ts +9 -0
- package/input/typings/input-module.d.ts +2 -0
- package/input/typings/input.d.ts +78 -0
- package/input/typings/mat-exports.d.ts +13 -0
- package/input/typings/public_api.d.ts +12 -0
- package/input.d.ts +8 -0
- package/input.metadata.json +11 -0
- package/list/index.d.ts +8 -1
- package/list/index.metadata.json +11 -1
- package/list/package.json +7 -0
- package/list/typings/index.d.ts +4 -0
- package/list/typings/index.metadata.json +1 -0
- package/list/typings/list-module.d.ts +2 -0
- package/list/typings/list.d.ts +78 -0
- package/list/typings/mat-exports.d.ts +27 -0
- package/list/typings/public_api.d.ts +11 -0
- package/list/typings/selection-list.d.ts +112 -0
- package/list.d.ts +8 -0
- package/list.metadata.json +11 -0
- package/material.d.ts +39 -0
- package/material.metadata.json +102 -0
- package/menu/index.d.ts +8 -1
- package/menu/index.metadata.json +11 -1
- package/menu/package.json +7 -0
- package/menu/typings/index.d.ts +6 -0
- package/menu/typings/index.metadata.json +1 -0
- package/menu/typings/mat-exports.d.ts +16 -0
- package/menu/typings/menu-animations.d.ts +27 -0
- package/menu/typings/menu-directive.d.ts +86 -0
- package/menu/typings/menu-errors.d.ts +24 -0
- package/menu/typings/menu-item.d.ts +40 -0
- package/menu/typings/menu-module.d.ts +2 -0
- package/menu/typings/menu-panel.d.ts +22 -0
- package/menu/typings/menu-positions.d.ts +9 -0
- package/menu/typings/menu-trigger.d.ts +116 -0
- package/menu/typings/menu.d.ts +12 -0
- package/menu/typings/public_api.d.ts +12 -0
- package/menu.d.ts +8 -0
- package/menu.metadata.json +11 -0
- package/package.json +10 -8
- package/paginator/index.d.ts +8 -0
- package/paginator/index.metadata.json +11 -0
- package/paginator/package.json +7 -0
- package/paginator/typings/index.d.ts +4 -0
- package/paginator/typings/index.metadata.json +1 -0
- package/paginator/typings/mat-exports.d.ts +13 -0
- package/paginator/typings/paginator-intl.d.ts +20 -0
- package/paginator/typings/paginator-module.d.ts +2 -0
- package/paginator/typings/paginator.d.ts +75 -0
- package/paginator/typings/public_api.d.ts +11 -0
- package/paginator.d.ts +8 -0
- package/paginator.metadata.json +11 -0
- package/prebuilt-themes/deeppurple-amber.css +1 -0
- package/prebuilt-themes/indigo-pink.css +1 -0
- package/prebuilt-themes/pink-bluegrey.css +1 -0
- package/prebuilt-themes/purple-green.css +1 -0
- package/progress-bar/index.d.ts +8 -1
- package/progress-bar/index.metadata.json +11 -1
- package/progress-bar/package.json +7 -0
- package/progress-bar/typings/index.d.ts +4 -0
- package/progress-bar/typings/index.metadata.json +1 -0
- package/progress-bar/typings/mat-exports.d.ts +11 -0
- package/progress-bar/typings/progress-bar-module.d.ts +2 -0
- package/progress-bar/typings/progress-bar.d.ts +32 -0
- package/progress-bar/typings/public_api.d.ts +10 -0
- package/progress-bar.d.ts +8 -0
- package/progress-bar.metadata.json +11 -0
- package/progress-spinner/index.d.ts +8 -0
- package/progress-spinner/index.metadata.json +11 -0
- package/progress-spinner/package.json +7 -0
- package/progress-spinner/typings/index.d.ts +4 -0
- package/progress-spinner/typings/index.metadata.json +1 -0
- package/progress-spinner/typings/mat-exports.d.ts +14 -0
- package/progress-spinner/typings/progress-spinner-module.d.ts +2 -0
- package/progress-spinner/typings/progress-spinner.d.ts +98 -0
- package/progress-spinner/typings/public_api.d.ts +10 -0
- package/progress-spinner.d.ts +8 -0
- package/progress-spinner.metadata.json +11 -0
- package/radio/index.d.ts +8 -1
- package/radio/index.metadata.json +11 -1
- package/radio/package.json +7 -0
- package/radio/typings/index.d.ts +4 -0
- package/radio/typings/index.metadata.json +1 -0
- package/radio/typings/mat-exports.d.ts +16 -0
- package/radio/typings/public_api.d.ts +10 -0
- package/radio/typings/radio-module.d.ts +2 -0
- package/radio/typings/radio.d.ts +217 -0
- package/radio.d.ts +8 -0
- package/radio.metadata.json +11 -0
- package/select/index.d.ts +8 -5
- package/select/index.metadata.json +11 -1
- package/select/package.json +7 -0
- package/select/typings/index.d.ts +4 -0
- package/select/typings/index.metadata.json +1 -0
- package/select/typings/mat-exports.d.ts +17 -0
- package/select/typings/public_api.d.ts +11 -0
- package/select/typings/select-animations.d.ts +36 -0
- package/select/typings/select-errors.d.ts +26 -0
- package/select/typings/select-module.d.ts +2 -0
- package/select/typings/select.d.ts +412 -0
- package/select.d.ts +8 -0
- package/select.metadata.json +11 -0
- package/sidenav/index.d.ts +8 -1
- package/sidenav/index.metadata.json +11 -1
- package/sidenav/package.json +7 -0
- package/sidenav/typings/drawer.d.ts +178 -0
- package/sidenav/typings/index.d.ts +4 -0
- package/sidenav/typings/index.metadata.json +1 -0
- package/sidenav/typings/mat-exports.d.ts +16 -0
- package/sidenav/typings/public_api.d.ts +11 -0
- package/sidenav/typings/sidenav-module.d.ts +2 -0
- package/sidenav/typings/sidenav.d.ts +6 -0
- package/sidenav.d.ts +8 -0
- package/sidenav.metadata.json +11 -0
- package/slide-toggle/index.d.ts +8 -1
- package/slide-toggle/index.metadata.json +11 -1
- package/slide-toggle/package.json +7 -0
- package/slide-toggle/typings/index.d.ts +4 -0
- package/slide-toggle/typings/index.metadata.json +1 -0
- package/slide-toggle/typings/mat-exports.d.ts +14 -0
- package/slide-toggle/typings/public_api.d.ts +10 -0
- package/slide-toggle/typings/slide-toggle-module.d.ts +2 -0
- package/slide-toggle/typings/slide-toggle.d.ts +93 -0
- package/slide-toggle.d.ts +8 -0
- package/slide-toggle.metadata.json +11 -0
- package/slider/index.d.ts +8 -1
- package/slider/index.metadata.json +11 -1
- package/slider/package.json +7 -0
- package/slider/typings/index.d.ts +4 -0
- package/slider/typings/index.metadata.json +1 -0
- package/slider/typings/mat-exports.d.ts +14 -0
- package/slider/typings/public_api.d.ts +10 -0
- package/slider/typings/slider-module.d.ts +2 -0
- package/slider/typings/slider.d.ts +207 -0
- package/slider.d.ts +8 -0
- package/slider.metadata.json +11 -0
- package/snack-bar/index.d.ts +8 -4
- package/snack-bar/index.metadata.json +11 -1
- package/snack-bar/package.json +7 -0
- package/snack-bar/typings/index.d.ts +4 -0
- package/snack-bar/typings/index.metadata.json +1 -0
- package/snack-bar/typings/mat-exports.d.ts +18 -0
- package/snack-bar/typings/public_api.d.ts +14 -0
- package/snack-bar/typings/simple-snack-bar.d.ts +18 -0
- package/snack-bar/typings/snack-bar-config.d.ts +38 -0
- package/snack-bar/typings/snack-bar-container.d.ts +61 -0
- package/snack-bar/typings/snack-bar-module.d.ts +2 -0
- package/snack-bar/typings/snack-bar-ref.d.ts +51 -0
- package/snack-bar/typings/snack-bar.d.ts +70 -0
- package/snack-bar.d.ts +8 -0
- package/snack-bar.metadata.json +11 -0
- package/sort/index.d.ts +8 -0
- package/sort/index.metadata.json +11 -0
- package/sort/package.json +7 -0
- package/sort/typings/index.d.ts +4 -0
- package/sort/typings/index.metadata.json +1 -0
- package/sort/typings/mat-exports.d.ts +16 -0
- package/sort/typings/public_api.d.ts +13 -0
- package/sort/typings/sort-direction.d.ts +8 -0
- package/sort/typings/sort-errors.d.ts +13 -0
- package/sort/typings/sort-header-intl.d.ts +17 -0
- package/sort/typings/sort-header.d.ts +44 -0
- package/sort/typings/sort-module.d.ts +2 -0
- package/sort/typings/sort.d.ts +59 -0
- package/sort.d.ts +8 -0
- package/sort.metadata.json +11 -0
- package/stepper/index.d.ts +8 -0
- package/stepper/index.metadata.json +11 -0
- package/stepper/package.json +7 -0
- package/stepper/typings/index.d.ts +4 -0
- package/stepper/typings/index.metadata.json +1 -0
- package/stepper/typings/mat-exports.d.ts +21 -0
- package/stepper/typings/public_api.d.ts +13 -0
- package/stepper/typings/step-header.d.ts +23 -0
- package/stepper/typings/step-label.d.ts +14 -0
- package/stepper/typings/stepper-button.d.ts +10 -0
- package/stepper/typings/stepper-module.d.ts +2 -0
- package/stepper/typings/stepper.d.ts +27 -0
- package/stepper.d.ts +8 -0
- package/stepper.metadata.json +11 -0
- package/table/index.d.ts +8 -0
- package/table/index.metadata.json +11 -0
- package/table/package.json +7 -0
- package/table/typings/cell.d.ts +44 -0
- package/table/typings/index.d.ts +4 -0
- package/table/typings/index.metadata.json +1 -0
- package/table/typings/mat-exports.d.ts +20 -0
- package/table/typings/public_api.d.ts +12 -0
- package/table/typings/row.d.ts +30 -0
- package/table/typings/table-module.d.ts +2 -0
- package/table/typings/table.d.ts +8 -0
- package/table.d.ts +8 -0
- package/table.metadata.json +11 -0
- package/tabs/index.d.ts +8 -1
- package/tabs/index.metadata.json +11 -1
- package/tabs/package.json +7 -0
- package/tabs/typings/index.d.ts +8 -0
- package/tabs/typings/index.metadata.json +1 -0
- package/tabs/typings/ink-bar.d.ts +33 -0
- package/tabs/typings/mat-exports.d.ts +31 -0
- package/tabs/typings/public_api.d.ts +17 -0
- package/tabs/typings/tab-body.d.ts +69 -0
- package/tabs/typings/tab-group.d.ts +100 -0
- package/tabs/typings/tab-header.d.ts +156 -0
- package/tabs/typings/tab-label-wrapper.d.ts +25 -0
- package/tabs/typings/tab-label.d.ts +15 -0
- package/tabs/typings/tab-nav-bar/index.d.ts +8 -0
- package/tabs/typings/tab-nav-bar/tab-nav-bar.d.ts +77 -0
- package/tabs/typings/tab.d.ts +50 -0
- package/tabs/typings/tabs-module.d.ts +2 -0
- package/tabs.d.ts +8 -0
- package/tabs.metadata.json +11 -0
- package/toolbar/index.d.ts +8 -1
- package/toolbar/index.metadata.json +11 -1
- package/toolbar/package.json +7 -0
- package/toolbar/typings/index.d.ts +4 -0
- package/toolbar/typings/index.metadata.json +1 -0
- package/toolbar/typings/mat-exports.d.ts +13 -0
- package/toolbar/typings/public_api.d.ts +10 -0
- package/toolbar/typings/toolbar-module.d.ts +2 -0
- package/toolbar/typings/toolbar.d.ts +21 -0
- package/toolbar.d.ts +8 -0
- package/toolbar.metadata.json +11 -0
- package/tooltip/index.d.ts +8 -1
- package/tooltip/index.metadata.json +11 -1
- package/tooltip/package.json +7 -0
- package/tooltip/typings/index.d.ts +4 -0
- package/tooltip/typings/index.metadata.json +1 -0
- package/tooltip/typings/mat-exports.d.ts +14 -0
- package/tooltip/typings/public_api.d.ts +10 -0
- package/tooltip/typings/tooltip-module.d.ts +2 -0
- package/tooltip/typings/tooltip.d.ts +177 -0
- package/tooltip.d.ts +8 -0
- package/tooltip.metadata.json +11 -0
- package/typings/autocomplete/autocomplete-module.d.ts +2 -0
- package/typings/autocomplete/autocomplete-trigger.d.ts +159 -0
- package/typings/autocomplete/autocomplete.d.ts +55 -0
- package/typings/autocomplete/index.d.ts +4 -0
- package/typings/autocomplete/index.metadata.json +1 -0
- package/typings/autocomplete/mat-exports.d.ts +17 -0
- package/typings/autocomplete/public_api.d.ts +11 -0
- package/typings/button/button-module.d.ts +2 -0
- package/typings/button/button.d.ts +80 -0
- package/typings/button/index.d.ts +4 -0
- package/typings/button/index.metadata.json +1 -0
- package/typings/button/mat-exports.d.ts +18 -0
- package/typings/button/public_api.d.ts +10 -0
- package/typings/button-toggle/button-toggle-module.d.ts +2 -0
- package/typings/button-toggle/button-toggle.d.ts +156 -0
- package/typings/button-toggle/index.d.ts +4 -0
- package/typings/button-toggle/index.metadata.json +1 -0
- package/typings/button-toggle/mat-exports.d.ts +16 -0
- package/typings/button-toggle/public_api.d.ts +10 -0
- package/typings/card/card-module.d.ts +2 -0
- package/typings/card/card.d.ts +95 -0
- package/typings/card/index.d.ts +4 -0
- package/typings/card/index.metadata.json +1 -0
- package/typings/card/mat-exports.d.ts +24 -0
- package/typings/card/public_api.d.ts +10 -0
- package/typings/checkbox/checkbox-module.d.ts +2 -0
- package/typings/checkbox/checkbox-required-validator.d.ts +18 -0
- package/typings/checkbox/checkbox.d.ts +159 -0
- package/typings/checkbox/index.d.ts +4 -0
- package/typings/checkbox/index.metadata.json +1 -0
- package/typings/checkbox/mat-exports.d.ts +17 -0
- package/typings/checkbox/public_api.d.ts +11 -0
- package/typings/chips/chip-input.d.ts +54 -0
- package/typings/chips/chip-list.d.ts +219 -0
- package/typings/chips/chip.d.ts +123 -0
- package/typings/chips/chips-module.d.ts +2 -0
- package/typings/chips/index.d.ts +4 -0
- package/typings/chips/index.metadata.json +1 -0
- package/typings/chips/mat-exports.d.ts +21 -0
- package/typings/chips/public_api.d.ts +12 -0
- package/typings/core/a11y/index.d.ts +8 -0
- package/typings/core/animation/animation.d.ts +20 -0
- package/typings/core/bidi/index.d.ts +8 -0
- package/typings/core/common-behaviors/color.d.ts +22 -0
- package/typings/core/common-behaviors/common-module.d.ts +24 -0
- package/typings/core/common-behaviors/constructor.d.ts +9 -0
- package/typings/core/common-behaviors/disable-ripple.d.ts +7 -0
- package/typings/core/common-behaviors/disabled.d.ts +7 -0
- package/typings/core/common-behaviors/index.d.ts +12 -0
- package/typings/core/common-behaviors/tabindex.d.ts +15 -0
- package/typings/core/compatibility/compatibility.d.ts +40 -0
- package/typings/core/coordination/unique-selection-dispatcher.d.ts +40 -0
- package/typings/core/datetime/date-adapter.d.ts +198 -0
- package/typings/core/datetime/date-formats.d.ts +20 -0
- package/typings/core/datetime/index.d.ts +8 -0
- package/typings/core/datetime/native-date-adapter.d.ts +50 -0
- package/typings/core/datetime/native-date-formats.d.ts +9 -0
- package/typings/core/error/error-options.d.ts +19 -0
- package/typings/core/gestures/gesture-annotations.d.ts +51 -0
- package/typings/core/gestures/gesture-config.d.ts +23 -0
- package/typings/core/index.d.ts +5 -0
- package/typings/core/index.metadata.json +1 -0
- package/typings/core/keyboard/keycodes.d.ts +8 -0
- package/typings/core/line/line.d.ts +30 -0
- package/typings/core/mat-exports.d.ts +36 -0
- package/typings/core/option/index.d.ts +4 -0
- package/typings/core/option/optgroup.d.ts +14 -0
- package/typings/core/option/option.d.ts +97 -0
- package/typings/core/overlay/index.d.ts +8 -0
- package/typings/core/placeholder/placeholder-options.d.ts +15 -0
- package/typings/core/platform/features.d.ts +8 -0
- package/typings/core/platform/index.d.ts +10 -0
- package/typings/core/platform/platform.d.ts +8 -0
- package/typings/core/portal/dom-portal-host.d.ts +8 -0
- package/typings/core/portal/portal-directives.d.ts +8 -0
- package/typings/core/portal/portal-injector.d.ts +19 -0
- package/typings/core/portal/portal.d.ts +8 -0
- package/typings/core/public_api.d.ts +34 -0
- package/typings/core/ripple/index.d.ts +5 -0
- package/typings/core/ripple/ripple-ref.d.ts +28 -0
- package/typings/core/ripple/ripple-renderer.d.ts +64 -0
- package/typings/core/ripple/ripple.d.ts +73 -0
- package/typings/core/rxjs/index.d.ts +9 -0
- package/typings/core/rxjs/rx-chain.d.ts +8 -0
- package/typings/core/rxjs/rx-operators.d.ts +8 -0
- package/typings/core/selection/index.d.ts +3 -0
- package/typings/core/selection/pseudo-checkbox/pseudo-checkbox.d.ts +20 -0
- package/typings/core/style/apply-transform.d.ts +13 -0
- package/typings/core/style/index.d.ts +5 -0
- package/typings/core/testing/month-constants.d.ts +12 -0
- package/typings/core/util/object-extend.d.ts +15 -0
- package/typings/datepicker/calendar-body.d.ts +52 -0
- package/typings/datepicker/calendar.d.ts +90 -0
- package/typings/datepicker/coerce-date-property.d.ts +19 -0
- package/typings/datepicker/datepicker-errors.d.ts +9 -0
- package/typings/datepicker/datepicker-input.d.ts +94 -0
- package/typings/datepicker/datepicker-intl.d.ts +25 -0
- package/typings/datepicker/datepicker-module.d.ts +2 -0
- package/typings/datepicker/datepicker-toggle.d.ts +24 -0
- package/typings/datepicker/datepicker.d.ts +117 -0
- package/typings/datepicker/index.d.ts +4 -0
- package/typings/datepicker/index.metadata.json +1 -0
- package/typings/datepicker/mat-exports.d.ts +33 -0
- package/typings/datepicker/month-view.d.ts +65 -0
- package/typings/datepicker/public_api.d.ts +18 -0
- package/typings/datepicker/year-view.d.ts +54 -0
- package/typings/dialog/dialog-config.d.ts +54 -0
- package/typings/dialog/dialog-container.d.ts +68 -0
- package/typings/dialog/dialog-content-directives.d.ts +45 -0
- package/typings/dialog/dialog-module.d.ts +2 -0
- package/typings/dialog/dialog-ref.d.ts +68 -0
- package/typings/dialog/dialog.d.ts +108 -0
- package/typings/dialog/index.d.ts +4 -0
- package/typings/dialog/index.metadata.json +1 -0
- package/typings/dialog/mat-exports.d.ts +26 -0
- package/typings/dialog/public_api.d.ts +14 -0
- package/typings/expansion/accordion-item.d.ts +41 -0
- package/typings/expansion/accordion.d.ts +29 -0
- package/typings/expansion/expansion-module.d.ts +2 -0
- package/typings/expansion/expansion-panel-header.d.ts +56 -0
- package/typings/expansion/expansion-panel.d.ts +39 -0
- package/typings/expansion/index.d.ts +5 -0
- package/typings/expansion/index.metadata.json +1 -0
- package/typings/expansion/mat-exports.d.ts +20 -0
- package/typings/expansion/public_api.d.ts +13 -0
- package/typings/form-field/error.d.ts +4 -0
- package/typings/form-field/form-field-control.d.ts +39 -0
- package/typings/form-field/form-field-errors.d.ts +13 -0
- package/typings/form-field/form-field-module.d.ts +2 -0
- package/typings/form-field/form-field.d.ts +77 -0
- package/typings/form-field/hint.d.ts +7 -0
- package/typings/form-field/index.d.ts +4 -0
- package/typings/form-field/index.metadata.json +1 -0
- package/typings/form-field/mat-exports.d.ts +23 -0
- package/typings/form-field/placeholder.d.ts +3 -0
- package/typings/form-field/prefix.d.ts +3 -0
- package/typings/form-field/public_api.d.ts +17 -0
- package/typings/form-field/suffix.d.ts +3 -0
- package/typings/grid-list/grid-list-measure.d.ts +17 -0
- package/typings/grid-list/grid-list-module.d.ts +2 -0
- package/typings/grid-list/grid-list.d.ts +53 -0
- package/typings/grid-list/grid-tile.d.ts +55 -0
- package/typings/grid-list/index.d.ts +5 -0
- package/typings/grid-list/index.metadata.json +1 -0
- package/typings/grid-list/mat-exports.d.ts +13 -0
- package/typings/grid-list/public_api.d.ts +11 -0
- package/typings/grid-list/tile-coordinator.d.ts +64 -0
- package/typings/grid-list/tile-styler.d.ts +129 -0
- package/typings/icon/icon-module.d.ts +2 -0
- package/typings/icon/icon-registry.d.ts +194 -0
- package/typings/icon/icon.d.ts +76 -0
- package/typings/icon/index.d.ts +4 -0
- package/typings/icon/index.metadata.json +1 -0
- package/typings/icon/mat-exports.d.ts +14 -0
- package/typings/icon/public_api.d.ts +11 -0
- package/typings/index.d.ts +4 -0
- package/typings/index.metadata.json +26 -0
- package/typings/input/autosize.d.ts +45 -0
- package/typings/input/index.d.ts +4 -0
- package/typings/input/index.metadata.json +1 -0
- package/typings/input/input-errors.d.ts +9 -0
- package/typings/input/input-module.d.ts +2 -0
- package/typings/input/input.d.ts +78 -0
- package/typings/input/mat-exports.d.ts +13 -0
- package/typings/input/public_api.d.ts +12 -0
- package/typings/list/index.d.ts +4 -0
- package/typings/list/index.metadata.json +1 -0
- package/typings/list/list-module.d.ts +2 -0
- package/typings/list/list.d.ts +78 -0
- package/typings/list/mat-exports.d.ts +27 -0
- package/typings/list/public_api.d.ts +11 -0
- package/typings/list/selection-list.d.ts +112 -0
- package/typings/menu/index.d.ts +6 -0
- package/typings/menu/index.metadata.json +1 -0
- package/typings/menu/mat-exports.d.ts +16 -0
- package/typings/menu/menu-animations.d.ts +27 -0
- package/typings/menu/menu-directive.d.ts +86 -0
- package/typings/menu/menu-errors.d.ts +24 -0
- package/typings/menu/menu-item.d.ts +40 -0
- package/typings/menu/menu-module.d.ts +2 -0
- package/typings/menu/menu-panel.d.ts +22 -0
- package/typings/menu/menu-positions.d.ts +9 -0
- package/typings/menu/menu-trigger.d.ts +116 -0
- package/typings/menu/menu.d.ts +12 -0
- package/typings/menu/public_api.d.ts +12 -0
- package/typings/paginator/index.d.ts +4 -0
- package/typings/paginator/index.metadata.json +1 -0
- package/typings/paginator/mat-exports.d.ts +13 -0
- package/typings/paginator/paginator-intl.d.ts +20 -0
- package/typings/paginator/paginator-module.d.ts +2 -0
- package/typings/paginator/paginator.d.ts +75 -0
- package/typings/paginator/public_api.d.ts +11 -0
- package/typings/progress-bar/index.d.ts +4 -0
- package/typings/progress-bar/index.metadata.json +1 -0
- package/typings/progress-bar/mat-exports.d.ts +11 -0
- package/typings/progress-bar/progress-bar-module.d.ts +2 -0
- package/typings/progress-bar/progress-bar.d.ts +32 -0
- package/typings/progress-bar/public_api.d.ts +10 -0
- package/typings/progress-spinner/index.d.ts +4 -0
- package/typings/progress-spinner/index.metadata.json +1 -0
- package/typings/progress-spinner/mat-exports.d.ts +14 -0
- package/typings/progress-spinner/progress-spinner-module.d.ts +2 -0
- package/typings/progress-spinner/progress-spinner.d.ts +98 -0
- package/typings/progress-spinner/public_api.d.ts +10 -0
- package/typings/public_api.d.ts +39 -0
- package/typings/radio/index.d.ts +4 -0
- package/typings/radio/index.metadata.json +1 -0
- package/typings/radio/mat-exports.d.ts +16 -0
- package/typings/radio/public_api.d.ts +10 -0
- package/typings/radio/radio-module.d.ts +2 -0
- package/typings/radio/radio.d.ts +217 -0
- package/typings/select/index.d.ts +4 -0
- package/typings/select/index.metadata.json +1 -0
- package/typings/select/mat-exports.d.ts +17 -0
- package/typings/select/public_api.d.ts +11 -0
- package/typings/select/select-animations.d.ts +36 -0
- package/typings/select/select-errors.d.ts +26 -0
- package/typings/select/select-module.d.ts +2 -0
- package/typings/select/select.d.ts +412 -0
- package/typings/sidenav/drawer.d.ts +178 -0
- package/typings/sidenav/index.d.ts +4 -0
- package/typings/sidenav/index.metadata.json +1 -0
- package/typings/sidenav/mat-exports.d.ts +16 -0
- package/typings/sidenav/public_api.d.ts +11 -0
- package/typings/sidenav/sidenav-module.d.ts +2 -0
- package/typings/sidenav/sidenav.d.ts +6 -0
- package/typings/slide-toggle/index.d.ts +4 -0
- package/typings/slide-toggle/index.metadata.json +1 -0
- package/typings/slide-toggle/mat-exports.d.ts +14 -0
- package/typings/slide-toggle/public_api.d.ts +10 -0
- package/typings/slide-toggle/slide-toggle-module.d.ts +2 -0
- package/typings/slide-toggle/slide-toggle.d.ts +93 -0
- package/typings/slider/index.d.ts +4 -0
- package/typings/slider/index.metadata.json +1 -0
- package/typings/slider/mat-exports.d.ts +14 -0
- package/typings/slider/public_api.d.ts +10 -0
- package/typings/slider/slider-module.d.ts +2 -0
- package/typings/slider/slider.d.ts +207 -0
- package/typings/snack-bar/index.d.ts +4 -0
- package/typings/snack-bar/index.metadata.json +1 -0
- package/typings/snack-bar/mat-exports.d.ts +18 -0
- package/typings/snack-bar/public_api.d.ts +14 -0
- package/typings/snack-bar/simple-snack-bar.d.ts +18 -0
- package/typings/snack-bar/snack-bar-config.d.ts +38 -0
- package/typings/snack-bar/snack-bar-container.d.ts +61 -0
- package/typings/snack-bar/snack-bar-module.d.ts +2 -0
- package/typings/snack-bar/snack-bar-ref.d.ts +51 -0
- package/typings/snack-bar/snack-bar.d.ts +70 -0
- package/typings/sort/index.d.ts +4 -0
- package/typings/sort/index.metadata.json +1 -0
- package/typings/sort/mat-exports.d.ts +16 -0
- package/typings/sort/public_api.d.ts +13 -0
- package/typings/sort/sort-direction.d.ts +8 -0
- package/typings/sort/sort-errors.d.ts +13 -0
- package/typings/sort/sort-header-intl.d.ts +17 -0
- package/typings/sort/sort-header.d.ts +44 -0
- package/typings/sort/sort-module.d.ts +2 -0
- package/typings/sort/sort.d.ts +59 -0
- package/typings/stepper/index.d.ts +4 -0
- package/typings/stepper/index.metadata.json +1 -0
- package/typings/stepper/mat-exports.d.ts +21 -0
- package/typings/stepper/public_api.d.ts +13 -0
- package/typings/stepper/step-header.d.ts +23 -0
- package/typings/stepper/step-label.d.ts +14 -0
- package/typings/stepper/stepper-button.d.ts +10 -0
- package/typings/stepper/stepper-module.d.ts +2 -0
- package/typings/stepper/stepper.d.ts +27 -0
- package/typings/table/cell.d.ts +44 -0
- package/typings/table/index.d.ts +4 -0
- package/typings/table/index.metadata.json +1 -0
- package/typings/table/mat-exports.d.ts +20 -0
- package/typings/table/public_api.d.ts +12 -0
- package/typings/table/row.d.ts +30 -0
- package/typings/table/table-module.d.ts +2 -0
- package/typings/table/table.d.ts +8 -0
- package/typings/tabs/index.d.ts +8 -0
- package/typings/tabs/index.metadata.json +1 -0
- package/typings/tabs/ink-bar.d.ts +33 -0
- package/typings/tabs/mat-exports.d.ts +31 -0
- package/typings/tabs/public_api.d.ts +17 -0
- package/typings/tabs/tab-body.d.ts +69 -0
- package/typings/tabs/tab-group.d.ts +100 -0
- package/typings/tabs/tab-header.d.ts +156 -0
- package/typings/tabs/tab-label-wrapper.d.ts +25 -0
- package/typings/tabs/tab-label.d.ts +15 -0
- package/typings/tabs/tab-nav-bar/index.d.ts +8 -0
- package/typings/tabs/tab-nav-bar/tab-nav-bar.d.ts +77 -0
- package/typings/tabs/tab.d.ts +50 -0
- package/typings/tabs/tabs-module.d.ts +2 -0
- package/typings/toolbar/index.d.ts +4 -0
- package/typings/toolbar/index.metadata.json +1 -0
- package/typings/toolbar/mat-exports.d.ts +13 -0
- package/typings/toolbar/public_api.d.ts +10 -0
- package/typings/toolbar/toolbar-module.d.ts +2 -0
- package/typings/toolbar/toolbar.d.ts +21 -0
- package/typings/tooltip/index.d.ts +4 -0
- package/typings/tooltip/index.metadata.json +1 -0
- package/typings/tooltip/mat-exports.d.ts +14 -0
- package/typings/tooltip/public_api.d.ts +10 -0
- package/typings/tooltip/tooltip-module.d.ts +2 -0
- package/typings/tooltip/tooltip.d.ts +177 -0
- package/typings/version.d.ts +10 -0
- package/button/README.md +0 -115
- package/button/_button-base.scss +0 -116
- package/button/_button-theme.scss +0 -85
- package/button/button.css +0 -101
- package/button/button.css.map +0 -1
- package/button/button.d.ts +0 -35
- package/button/button.html +0 -6
- package/button/button.js +0 -196
- package/button/button.js.map +0 -1
- package/button/button.metadata.json +0 -1
- package/button/button.scss +0 -72
- package/button/index.js +0 -3
- package/button/index.js.map +0 -1
- package/button-toggle/README.md +0 -149
- package/button-toggle/_button-toggle-theme.scss +0 -14
- package/button-toggle/button-toggle.css +0 -24
- package/button-toggle/button-toggle.css.map +0 -1
- package/button-toggle/button-toggle.d.ts +0 -110
- package/button-toggle/button-toggle.html +0 -14
- package/button-toggle/button-toggle.js +0 -436
- package/button-toggle/button-toggle.js.map +0 -1
- package/button-toggle/button-toggle.metadata.json +0 -1
- package/button-toggle/button-toggle.scss +0 -34
- package/button-toggle/index.js +0 -3
- package/button-toggle/index.js.map +0 -1
- package/card/README.md +0 -116
- package/card/_card-theme.scss +0 -17
- package/card/card-header.html +0 -5
- package/card/card-title-group.html +0 -5
- package/card/card.css +0 -140
- package/card/card.css.map +0 -1
- package/card/card.d.ts +0 -35
- package/card/card.html +0 -1
- package/card/card.js +0 -187
- package/card/card.js.map +0 -1
- package/card/card.metadata.json +0 -1
- package/card/card.scss +0 -226
- package/card/index.js +0 -3
- package/card/index.js.map +0 -1
- package/checkbox/README.md +0 -79
- package/checkbox/_checkbox-theme.scss +0 -69
- package/checkbox/checkbox.css +0 -241
- package/checkbox/checkbox.css.map +0 -1
- package/checkbox/checkbox.d.ts +0 -127
- package/checkbox/checkbox.html +0 -37
- package/checkbox/checkbox.js +0 -344
- package/checkbox/checkbox.js.map +0 -1
- package/checkbox/checkbox.metadata.json +0 -1
- package/checkbox/checkbox.scss +0 -412
- package/checkbox/index.js +0 -3
- package/checkbox/index.js.map +0 -1
- package/core/README.md +0 -2
- package/core/_core.scss +0 -27
- package/core/a11y/README.md +0 -30
- package/core/a11y/_a11y.scss +0 -13
- package/core/a11y/focus-trap.d.ts +0 -23
- package/core/a11y/focus-trap.js +0 -82
- package/core/a11y/focus-trap.js.map +0 -1
- package/core/a11y/focus-trap.metadata.json +0 -1
- package/core/a11y/index.d.ts +0 -10
- package/core/a11y/index.js +0 -37
- package/core/a11y/index.js.map +0 -1
- package/core/a11y/index.metadata.json +0 -1
- package/core/a11y/interactivity-checker.d.ts +0 -31
- package/core/a11y/interactivity-checker.js +0 -122
- package/core/a11y/interactivity-checker.js.map +0 -1
- package/core/a11y/interactivity-checker.metadata.json +0 -1
- package/core/a11y/live-announcer.d.ts +0 -13
- package/core/a11y/live-announcer.js +0 -56
- package/core/a11y/live-announcer.js.map +0 -1
- package/core/a11y/live-announcer.metadata.json +0 -1
- package/core/annotations/field-value.d.ts +0 -16
- package/core/annotations/field-value.js +0 -30
- package/core/annotations/field-value.js.map +0 -1
- package/core/async/promise-completer.d.ts +0 -6
- package/core/async/promise-completer.js +0 -12
- package/core/async/promise-completer.js.map +0 -1
- package/core/coordination/unique-selection-dispatcher.d.ts +0 -17
- package/core/coordination/unique-selection-dispatcher.js +0 -42
- package/core/coordination/unique-selection-dispatcher.js.map +0 -1
- package/core/coordination/unique-selection-dispatcher.metadata.json +0 -1
- package/core/core.d.ts +0 -28
- package/core/core.js +0 -71
- package/core/core.js.map +0 -1
- package/core/core.metadata.json +0 -1
- package/core/errors/error.d.ts +0 -6
- package/core/errors/error.js +0 -19
- package/core/errors/error.js.map +0 -1
- package/core/gestures/MdGestureConfig.d.ts +0 -7
- package/core/gestures/MdGestureConfig.js +0 -84
- package/core/gestures/MdGestureConfig.js.map +0 -1
- package/core/gestures/MdGestureConfig.metadata.json +0 -1
- package/core/index.js +0 -3
- package/core/index.js.map +0 -1
- package/core/keyboard/keycodes.d.ts +0 -6
- package/core/keyboard/keycodes.js +0 -12
- package/core/keyboard/keycodes.js.map +0 -1
- package/core/keyboard/keycodes.metadata.json +0 -1
- package/core/line/line.d.ts +0 -19
- package/core/line/line.js +0 -65
- package/core/line/line.js.map +0 -1
- package/core/line/line.metadata.json +0 -1
- package/core/overlay/generic-component-type.d.ts +0 -3
- package/core/overlay/generic-component-type.js +0 -3
- package/core/overlay/generic-component-type.js.map +0 -1
- package/core/overlay/overlay-container.d.ts +0 -19
- package/core/overlay/overlay-container.js +0 -33
- package/core/overlay/overlay-container.js.map +0 -1
- package/core/overlay/overlay-directives.d.ts +0 -36
- package/core/overlay/overlay-directives.js +0 -120
- package/core/overlay/overlay-directives.js.map +0 -1
- package/core/overlay/overlay-directives.metadata.json +0 -1
- package/core/overlay/overlay-ref.d.ts +0 -28
- package/core/overlay/overlay-ref.js +0 -82
- package/core/overlay/overlay-ref.js.map +0 -1
- package/core/overlay/overlay-state.d.ts +0 -11
- package/core/overlay/overlay-state.js +0 -13
- package/core/overlay/overlay-state.js.map +0 -1
- package/core/overlay/overlay.css +0 -2
- package/core/overlay/overlay.css.map +0 -1
- package/core/overlay/overlay.d.ts +0 -51
- package/core/overlay/overlay.js +0 -93
- package/core/overlay/overlay.js.map +0 -1
- package/core/overlay/overlay.metadata.json +0 -1
- package/core/overlay/overlay.scss +0 -55
- package/core/overlay/position/connected-position-strategy.d.ts +0 -69
- package/core/overlay/position/connected-position-strategy.js +0 -164
- package/core/overlay/position/connected-position-strategy.js.map +0 -1
- package/core/overlay/position/connected-position.d.ts +0 -22
- package/core/overlay/position/connected-position.js +0 -12
- package/core/overlay/position/connected-position.js.map +0 -1
- package/core/overlay/position/global-position-strategy.d.ts +0 -45
- package/core/overlay/position/global-position-strategy.js +0 -102
- package/core/overlay/position/global-position-strategy.js.map +0 -1
- package/core/overlay/position/overlay-position-builder.d.ts +0 -14
- package/core/overlay/position/overlay-position-builder.js +0 -34
- package/core/overlay/position/overlay-position-builder.js.map +0 -1
- package/core/overlay/position/overlay-position-builder.metadata.json +0 -1
- package/core/overlay/position/position-strategy.d.ts +0 -5
- package/core/overlay/position/position-strategy.js +0 -3
- package/core/overlay/position/position-strategy.js.map +0 -1
- package/core/overlay/position/relative-position-strategy.d.ts +0 -7
- package/core/overlay/position/relative-position-strategy.js +0 -12
- package/core/overlay/position/relative-position-strategy.js.map +0 -1
- package/core/overlay/position/viewport-ruler.d.ts +0 -16
- package/core/overlay/position/viewport-ruler.js +0 -71
- package/core/overlay/position/viewport-ruler.js.map +0 -1
- package/core/overlay/position/viewport-ruler.metadata.json +0 -1
- package/core/portal/README.md +0 -72
- package/core/portal/dom-portal-host.d.ts +0 -17
- package/core/portal/dom-portal-host.js +0 -56
- package/core/portal/dom-portal-host.js.map +0 -1
- package/core/portal/portal-directives.d.ts +0 -38
- package/core/portal/portal-directives.js +0 -124
- package/core/portal/portal-directives.js.map +0 -1
- package/core/portal/portal-directives.metadata.json +0 -1
- package/core/portal/portal-errors.d.ts +0 -29
- package/core/portal/portal-errors.js +0 -66
- package/core/portal/portal-errors.js.map +0 -1
- package/core/portal/portal.d.ts +0 -85
- package/core/portal/portal.js +0 -155
- package/core/portal/portal.js.map +0 -1
- package/core/ripple/README.md +0 -27
- package/core/ripple/_ripple.scss +0 -106
- package/core/ripple/ripple-renderer.d.ts +0 -65
- package/core/ripple/ripple-renderer.js +0 -149
- package/core/ripple/ripple-renderer.js.map +0 -1
- package/core/ripple/ripple-renderer.metadata.json +0 -1
- package/core/ripple/ripple.d.ts +0 -75
- package/core/ripple/ripple.js +0 -179
- package/core/ripple/ripple.js.map +0 -1
- package/core/ripple/ripple.metadata.json +0 -1
- package/core/rtl/dir.d.ts +0 -17
- package/core/rtl/dir.js +0 -83
- package/core/rtl/dir.js.map +0 -1
- package/core/rtl/dir.metadata.json +0 -1
- package/core/style/_button-common.scss +0 -7
- package/core/style/_elevation.scss +0 -174
- package/core/style/_list-common.scss +0 -49
- package/core/style/_sidenav-common.scss +0 -8
- package/core/style/_variables.scss +0 -55
- package/core/style/apply-transform.d.ts +0 -6
- package/core/style/apply-transform.js +0 -14
- package/core/style/apply-transform.js.map +0 -1
- package/core/theming/_all-theme.scss +0 -46
- package/core/theming/_palette.scss +0 -694
- package/core/theming/_theming.scss +0 -84
- package/core/theming/prebuilt/deeppurple-amber.css +0 -446
- package/core/theming/prebuilt/deeppurple-amber.css.map +0 -1
- package/core/theming/prebuilt/deeppurple-amber.scss +0 -14
- package/core/theming/prebuilt/indigo-pink.css +0 -446
- package/core/theming/prebuilt/indigo-pink.css.map +0 -1
- package/core/theming/prebuilt/indigo-pink.scss +0 -14
- package/core/theming/prebuilt/pink-bluegrey.css +0 -446
- package/core/theming/prebuilt/pink-bluegrey.css.map +0 -1
- package/core/theming/prebuilt/pink-bluegrey.scss +0 -14
- package/core/theming/prebuilt/purple-green.css +0 -446
- package/core/theming/prebuilt/purple-green.css.map +0 -1
- package/core/theming/prebuilt/purple-green.scss +0 -14
- package/core/typography/_typography.scss +0 -6
- package/core.js +0 -3
- package/core.js.map +0 -1
- package/dialog/README.md +0 -0
- package/dialog/_dialog-theme.scss +0 -11
- package/dialog/dialog-config.d.ts +0 -11
- package/dialog/dialog-config.js +0 -12
- package/dialog/dialog-config.js.map +0 -1
- package/dialog/dialog-container.css +0 -7
- package/dialog/dialog-container.css.map +0 -1
- package/dialog/dialog-container.d.ts +0 -29
- package/dialog/dialog-container.html +0 -3
- package/dialog/dialog-container.js +0 -88
- package/dialog/dialog-container.js.map +0 -1
- package/dialog/dialog-container.metadata.json +0 -1
- package/dialog/dialog-container.scss +0 -12
- package/dialog/dialog-errors.d.ts +0 -5
- package/dialog/dialog-errors.js +0 -16
- package/dialog/dialog-errors.js.map +0 -1
- package/dialog/dialog-injector.d.ts +0 -9
- package/dialog/dialog-injector.js +0 -17
- package/dialog/dialog-injector.js.map +0 -1
- package/dialog/dialog-ref.d.ts +0 -20
- package/dialog/dialog-ref.js +0 -29
- package/dialog/dialog-ref.js.map +0 -1
- package/dialog/dialog.d.ts +0 -51
- package/dialog/dialog.js +0 -128
- package/dialog/dialog.js.map +0 -1
- package/dialog/dialog.metadata.json +0 -1
- package/dialog/index.js +0 -6
- package/dialog/index.js.map +0 -1
- package/grid-list/README.md +0 -118
- package/grid-list/_grid-list-theme.scss +0 -6
- package/grid-list/grid-list-errors.d.ts +0 -19
- package/grid-list/grid-list-errors.js +0 -38
- package/grid-list/grid-list-errors.js.map +0 -1
- package/grid-list/grid-list-measure.d.ts +0 -10
- package/grid-list/grid-list-measure.js +0 -16
- package/grid-list/grid-list-measure.js.map +0 -1
- package/grid-list/grid-list-measure.metadata.json +0 -1
- package/grid-list/grid-list.css +0 -78
- package/grid-list/grid-list.css.map +0 -1
- package/grid-list/grid-list.d.ts +0 -49
- package/grid-list/grid-list.html +0 -3
- package/grid-list/grid-list.js +0 -165
- package/grid-list/grid-list.js.map +0 -1
- package/grid-list/grid-list.metadata.json +0 -1
- package/grid-list/grid-list.scss +0 -91
- package/grid-list/grid-tile-text.html +0 -3
- package/grid-list/grid-tile.d.ts +0 -28
- package/grid-list/grid-tile.html +0 -4
- package/grid-list/grid-tile.js +0 -87
- package/grid-list/grid-tile.js.map +0 -1
- package/grid-list/grid-tile.metadata.json +0 -1
- package/grid-list/index.js +0 -3
- package/grid-list/index.js.map +0 -1
- package/grid-list/tile-coordinator.d.ts +0 -51
- package/grid-list/tile-coordinator.js +0 -124
- package/grid-list/tile-coordinator.js.map +0 -1
- package/grid-list/tile-styler.d.ts +0 -88
- package/grid-list/tile-styler.js +0 -190
- package/grid-list/tile-styler.js.map +0 -1
- package/icon/README.md +0 -116
- package/icon/_icon-theme.scss +0 -6
- package/icon/fake-svgs.d.ts +0 -5
- package/icon/fake-svgs.js +0 -29
- package/icon/fake-svgs.js.map +0 -1
- package/icon/icon-registry.d.ts +0 -148
- package/icon/icon-registry.js +0 -375
- package/icon/icon-registry.js.map +0 -1
- package/icon/icon-registry.metadata.json +0 -1
- package/icon/icon.css +0 -8
- package/icon/icon.css.map +0 -1
- package/icon/icon.d.ts +0 -85
- package/icon/icon.js +0 -252
- package/icon/icon.js.map +0 -1
- package/icon/icon.metadata.json +0 -1
- package/icon/icon.scss +0 -13
- package/icon/index.js +0 -3
- package/icon/index.js.map +0 -1
- package/index.d.ts +0 -23
- package/index.js +0 -25
- package/index.js.map +0 -1
- package/index.metadata.json +0 -1
- package/input/README.md +0 -121
- package/input/_input-theme.scss +0 -64
- package/input/index.js +0 -3
- package/input/index.js.map +0 -1
- package/input/input.css +0 -109
- package/input/input.css.map +0 -1
- package/input/input.d.ts +0 -134
- package/input/input.html +0 -65
- package/input/input.js +0 -471
- package/input/input.js.map +0 -1
- package/input/input.metadata.json +0 -1
- package/input/input.scss +0 -198
- package/list/README.md +0 -167
- package/list/_list-theme.scss +0 -28
- package/list/index.js +0 -3
- package/list/index.js.map +0 -1
- package/list/list-item.html +0 -5
- package/list/list.css +0 -139
- package/list/list.css.map +0 -1
- package/list/list.d.ts +0 -24
- package/list/list.js +0 -113
- package/list/list.js.map +0 -1
- package/list/list.metadata.json +0 -1
- package/list/list.scss +0 -168
- package/material.umd.js +0 -9017
- package/material.umd.js.map +0 -1
- package/menu/README.md +0 -164
- package/menu/_menu-theme.scss +0 -25
- package/menu/index.js +0 -3
- package/menu/index.js.map +0 -1
- package/menu/menu-directive.d.ts +0 -54
- package/menu/menu-directive.js +0 -158
- package/menu/menu-directive.js.map +0 -1
- package/menu/menu-directive.metadata.json +0 -1
- package/menu/menu-errors.d.ts +0 -21
- package/menu/menu-errors.js +0 -40
- package/menu/menu-errors.js.map +0 -1
- package/menu/menu-item.d.ts +0 -18
- package/menu/menu-item.js +0 -74
- package/menu/menu-item.js.map +0 -1
- package/menu/menu-item.metadata.json +0 -1
- package/menu/menu-positions.d.ts +0 -2
- package/menu/menu-positions.js +0 -3
- package/menu/menu-positions.js.map +0 -1
- package/menu/menu-trigger.d.ts +0 -62
- package/menu/menu-trigger.js +0 -169
- package/menu/menu-trigger.js.map +0 -1
- package/menu/menu-trigger.metadata.json +0 -1
- package/menu/menu.css +0 -41
- package/menu/menu.css.map +0 -1
- package/menu/menu.d.ts +0 -7
- package/menu/menu.html +0 -6
- package/menu/menu.js +0 -39
- package/menu/menu.js.map +0 -1
- package/menu/menu.metadata.json +0 -1
- package/menu/menu.scss +0 -59
- package/module.d.ts +0 -6
- package/module.js +0 -117
- package/module.js.map +0 -1
- package/module.metadata.json +0 -1
- package/progress-bar/README.md +0 -54
- package/progress-bar/_progress-bar-theme.scss +0 -78
- package/progress-bar/index.js +0 -3
- package/progress-bar/index.js.map +0 -1
- package/progress-bar/progress-bar.css +0 -114
- package/progress-bar/progress-bar.css.map +0 -1
- package/progress-bar/progress-bar.d.ts +0 -34
- package/progress-bar/progress-bar.html +0 -5
- package/progress-bar/progress-bar.js +0 -122
- package/progress-bar/progress-bar.js.map +0 -1
- package/progress-bar/progress-bar.metadata.json +0 -1
- package/progress-bar/progress-bar.scss +0 -229
- package/progress-circle/README.md +0 -51
- package/progress-circle/_progress-circle-theme.scss +0 -23
- package/progress-circle/index.d.ts +0 -1
- package/progress-circle/index.js +0 -3
- package/progress-circle/index.js.map +0 -1
- package/progress-circle/index.metadata.json +0 -1
- package/progress-circle/progress-circle.css +0 -43
- package/progress-circle/progress-circle.css.map +0 -1
- package/progress-circle/progress-circle.d.ts +0 -76
- package/progress-circle/progress-circle.html +0 -9
- package/progress-circle/progress-circle.js +0 -315
- package/progress-circle/progress-circle.js.map +0 -1
- package/progress-circle/progress-circle.metadata.json +0 -1
- package/progress-circle/progress-circle.scss +0 -67
- package/radio/README.md +0 -79
- package/radio/_radio-theme.scss +0 -36
- package/radio/index.js +0 -3
- package/radio/index.js.map +0 -1
- package/radio/radio.css +0 -82
- package/radio/radio.css.map +0 -1
- package/radio/radio.d.ts +0 -127
- package/radio/radio.html +0 -27
- package/radio/radio.js +0 -445
- package/radio/radio.js.map +0 -1
- package/radio/radio.metadata.json +0 -1
- package/radio/radio.scss +0 -92
- package/select/index.js +0 -33
- package/select/index.js.map +0 -1
- package/select/select.css +0 -2
- package/select/select.css.map +0 -1
- package/select/select.d.ts +0 -2
- package/select/select.html +0 -1
- package/select/select.js +0 -25
- package/select/select.js.map +0 -1
- package/select/select.metadata.json +0 -1
- package/select/select.scss +0 -0
- package/sidenav/README.md +0 -83
- package/sidenav/_sidenav-theme.scss +0 -37
- package/sidenav/index.js +0 -3
- package/sidenav/index.js.map +0 -1
- package/sidenav/sidenav-transitions.css +0 -10
- package/sidenav/sidenav-transitions.css.map +0 -1
- package/sidenav/sidenav-transitions.scss +0 -14
- package/sidenav/sidenav.css +0 -111
- package/sidenav/sidenav.css.map +0 -1
- package/sidenav/sidenav.d.ts +0 -141
- package/sidenav/sidenav.html +0 -8
- package/sidenav/sidenav.js +0 -479
- package/sidenav/sidenav.js.map +0 -1
- package/sidenav/sidenav.metadata.json +0 -1
- package/sidenav/sidenav.scss +0 -133
- package/slide-toggle/README.md +0 -66
- package/slide-toggle/_slide-toggle-theme.scss +0 -77
- package/slide-toggle/index.js +0 -3
- package/slide-toggle/index.js.map +0 -1
- package/slide-toggle/slide-toggle.css +0 -88
- package/slide-toggle/slide-toggle.css.map +0 -1
- package/slide-toggle/slide-toggle.d.ts +0 -74
- package/slide-toggle/slide-toggle.html +0 -33
- package/slide-toggle/slide-toggle.js +0 -317
- package/slide-toggle/slide-toggle.js.map +0 -1
- package/slide-toggle/slide-toggle.metadata.json +0 -1
- package/slide-toggle/slide-toggle.scss +0 -140
- package/slider/README.md +0 -97
- package/slider/_slider-theme.scss +0 -33
- package/slider/index.js +0 -3
- package/slider/index.js.map +0 -1
- package/slider/slider.css +0 -122
- package/slider/slider.css.map +0 -1
- package/slider/slider.d.ts +0 -155
- package/slider/slider.html +0 -21
- package/slider/slider.js +0 -433
- package/slider/slider.js.map +0 -1
- package/slider/slider.metadata.json +0 -1
- package/slider/slider.scss +0 -186
- package/slider/test-gesture-config.d.ts +0 -21
- package/slider/test-gesture-config.js +0 -59
- package/slider/test-gesture-config.js.map +0 -1
- package/slider/test-gesture-config.metadata.json +0 -1
- package/snack-bar/README.md +0 -38
- package/snack-bar/index.js +0 -6
- package/snack-bar/index.js.map +0 -1
- package/snack-bar/simple-snack-bar.css +0 -27
- package/snack-bar/simple-snack-bar.css.map +0 -1
- package/snack-bar/simple-snack-bar.d.ts +0 -17
- package/snack-bar/simple-snack-bar.html +0 -3
- package/snack-bar/simple-snack-bar.js +0 -38
- package/snack-bar/simple-snack-bar.js.map +0 -1
- package/snack-bar/simple-snack-bar.metadata.json +0 -1
- package/snack-bar/simple-snack-bar.scss +0 -28
- package/snack-bar/snack-bar-config.d.ts +0 -11
- package/snack-bar/snack-bar-config.js +0 -10
- package/snack-bar/snack-bar-config.js.map +0 -1
- package/snack-bar/snack-bar-container.css +0 -12
- package/snack-bar/snack-bar-container.css.map +0 -1
- package/snack-bar/snack-bar-container.d.ts +0 -15
- package/snack-bar/snack-bar-container.html +0 -1
- package/snack-bar/snack-bar-container.js +0 -53
- package/snack-bar/snack-bar-container.js.map +0 -1
- package/snack-bar/snack-bar-container.metadata.json +0 -1
- package/snack-bar/snack-bar-container.scss +0 -19
- package/snack-bar/snack-bar-errors.d.ts +0 -4
- package/snack-bar/snack-bar-errors.js +0 -15
- package/snack-bar/snack-bar-errors.js.map +0 -1
- package/snack-bar/snack-bar-ref.d.ts +0 -17
- package/snack-bar/snack-bar-ref.js +0 -28
- package/snack-bar/snack-bar-ref.js.map +0 -1
- package/snack-bar/snack-bar.d.ts +0 -41
- package/snack-bar/snack-bar.js +0 -110
- package/snack-bar/snack-bar.js.map +0 -1
- package/snack-bar/snack-bar.metadata.json +0 -1
- package/tabs/README.md +0 -47
- package/tabs/_tabs-theme.scss +0 -23
- package/tabs/index.js +0 -3
- package/tabs/index.js.map +0 -1
- package/tabs/ink-bar.d.ts +0 -24
- package/tabs/ink-bar.js +0 -50
- package/tabs/ink-bar.js.map +0 -1
- package/tabs/ink-bar.metadata.json +0 -1
- package/tabs/tab-content.d.ts +0 -6
- package/tabs/tab-content.js +0 -32
- package/tabs/tab-content.js.map +0 -1
- package/tabs/tab-content.metadata.json +0 -1
- package/tabs/tab-group.css +0 -55
- package/tabs/tab-group.css.map +0 -1
- package/tabs/tab-group.html +0 -27
- package/tabs/tab-group.scss +0 -72
- package/tabs/tab-label-wrapper.d.ts +0 -10
- package/tabs/tab-label-wrapper.js +0 -31
- package/tabs/tab-label-wrapper.js.map +0 -1
- package/tabs/tab-label-wrapper.metadata.json +0 -1
- package/tabs/tab-label.d.ts +0 -6
- package/tabs/tab-label.js +0 -32
- package/tabs/tab-label.js.map +0 -1
- package/tabs/tab-label.metadata.json +0 -1
- package/tabs/tabs.d.ts +0 -79
- package/tabs/tabs.js +0 -290
- package/tabs/tabs.js.map +0 -1
- package/tabs/tabs.metadata.json +0 -1
- package/toolbar/README.md +0 -68
- package/toolbar/_toolbar-theme.scss +0 -33
- package/toolbar/index.js +0 -3
- package/toolbar/index.js.map +0 -1
- package/toolbar/toolbar.css +0 -19
- package/toolbar/toolbar.css.map +0 -1
- package/toolbar/toolbar.d.ts +0 -17
- package/toolbar/toolbar.html +0 -6
- package/toolbar/toolbar.js +0 -83
- package/toolbar/toolbar.js.map +0 -1
- package/toolbar/toolbar.metadata.json +0 -1
- package/toolbar/toolbar.scss +0 -36
- package/tooltip/README.md +0 -32
- package/tooltip/_tooltip-theme.scss +0 -9
- package/tooltip/index.js +0 -3
- package/tooltip/index.js.map +0 -1
- package/tooltip/tooltip.css +0 -14
- package/tooltip/tooltip.css.map +0 -1
- package/tooltip/tooltip.d.ts +0 -67
- package/tooltip/tooltip.html +0 -0
- package/tooltip/tooltip.js +0 -210
- package/tooltip/tooltip.js.map +0 -1
- package/tooltip/tooltip.metadata.json +0 -1
- package/tooltip/tooltip.scss +0 -21
- package/tsconfig-spec.json +0 -33
- package/tsconfig.json +0 -33
- package/typings.d.ts +0 -1
|
@@ -0,0 +1,3611 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
(function (global, factory) {
|
|
9
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/cdk/a11y'), require('@angular/cdk/bidi'), require('@angular/cdk/coercion'), require('@angular/cdk/collections'), require('@angular/cdk/keycodes'), require('@angular/cdk/overlay'), require('@angular/cdk/platform'), require('@angular/cdk/rxjs'), require('@angular/forms'), require('@angular/platform-browser'), require('rxjs/Subject'), require('@angular/cdk/scrolling'), require('@angular/cdk/portal'), require('rxjs/observable/merge'), require('rxjs/Subscription'), require('@angular/animations')) :
|
|
10
|
+
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', '@angular/cdk/a11y', '@angular/cdk/bidi', '@angular/cdk/coercion', '@angular/cdk/collections', '@angular/cdk/keycodes', '@angular/cdk/overlay', '@angular/cdk/platform', '@angular/cdk/rxjs', '@angular/forms', '@angular/platform-browser', 'rxjs/Subject', '@angular/cdk/scrolling', '@angular/cdk/portal', 'rxjs/observable/merge', 'rxjs/Subscription', '@angular/animations'], factory) :
|
|
11
|
+
(factory((global.ng = global.ng || {}, global.ng.material = global.ng.material || {}, global.ng.material.select = global.ng.material.select || {}),global.ng.core,global.ng.common,global.ng.cdk.a11y,global.ng.cdk.bidi,global.ng.cdk.coercion,global.ng.cdk.collections,global.ng.cdk.keycodes,global.ng.cdk.overlay,global.ng.cdk.platform,global.ng.cdk.rxjs,global.ng.forms,global.ng.platformBrowser,global.Rx,global.ng.cdk.scrolling,global.ng.cdk.portal,global.Rx.Observable,global.Rx,global.ng.animations));
|
|
12
|
+
}(this, (function (exports,_angular_core,_angular_common,_angular_cdk_a11y,_angular_cdk_bidi,_angular_cdk_coercion,_angular_cdk_collections,_angular_cdk_keycodes,_angular_cdk_overlay,_angular_cdk_platform,_angular_cdk_rxjs,_angular_forms,_angular_platformBrowser,rxjs_Subject,_angular_cdk_scrolling,_angular_cdk_portal,rxjs_observable_merge,rxjs_Subscription,_angular_animations) { 'use strict';
|
|
13
|
+
|
|
14
|
+
/*! *****************************************************************************
|
|
15
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
16
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
17
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
18
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
|
|
20
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
21
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
22
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
23
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
24
|
+
|
|
25
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
26
|
+
and limitations under the License.
|
|
27
|
+
***************************************************************************** */
|
|
28
|
+
/* global Reflect, Promise */
|
|
29
|
+
|
|
30
|
+
var extendStatics = Object.setPrototypeOf ||
|
|
31
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
32
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
33
|
+
|
|
34
|
+
function __extends(d, b) {
|
|
35
|
+
extendStatics(d, b);
|
|
36
|
+
function __() { this.constructor = d; }
|
|
37
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* \@docs-private
|
|
42
|
+
*/
|
|
43
|
+
var AnimationCurves = (function () {
|
|
44
|
+
function AnimationCurves() {
|
|
45
|
+
}
|
|
46
|
+
return AnimationCurves;
|
|
47
|
+
}());
|
|
48
|
+
AnimationCurves.STANDARD_CURVE = 'cubic-bezier(0.4,0.0,0.2,1)';
|
|
49
|
+
AnimationCurves.DECELERATION_CURVE = 'cubic-bezier(0.0,0.0,0.2,1)';
|
|
50
|
+
AnimationCurves.ACCELERATION_CURVE = 'cubic-bezier(0.4,0.0,1,1)';
|
|
51
|
+
AnimationCurves.SHARP_CURVE = 'cubic-bezier(0.4,0.0,0.6,1)';
|
|
52
|
+
/**
|
|
53
|
+
* \@docs-private
|
|
54
|
+
*/
|
|
55
|
+
var AnimationDurations = (function () {
|
|
56
|
+
function AnimationDurations() {
|
|
57
|
+
}
|
|
58
|
+
return AnimationDurations;
|
|
59
|
+
}());
|
|
60
|
+
AnimationDurations.COMPLEX = '375ms';
|
|
61
|
+
AnimationDurations.ENTERING = '225ms';
|
|
62
|
+
AnimationDurations.EXITING = '195ms';
|
|
63
|
+
var MATERIAL_COMPATIBILITY_MODE = new _angular_core.InjectionToken('md-compatibility-mode');
|
|
64
|
+
/**
|
|
65
|
+
* Returns an exception to be thrown if the consumer has used
|
|
66
|
+
* an invalid Material prefix on a component.
|
|
67
|
+
* \@docs-private
|
|
68
|
+
* @param {?} prefix
|
|
69
|
+
* @param {?} nodeName
|
|
70
|
+
* @return {?}
|
|
71
|
+
*/
|
|
72
|
+
function getMdCompatibilityInvalidPrefixError(prefix, nodeName) {
|
|
73
|
+
return Error("The \"" + prefix + "-\" prefix cannot be used in ng-material v1 compatibility mode. " +
|
|
74
|
+
("It was used on an \"" + nodeName.toLowerCase() + "\" element."));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Selector that matches all elements that may have style collisions with AngularJS Material.
|
|
78
|
+
*/
|
|
79
|
+
var MAT_ELEMENTS_SELECTOR = "\n [mat-button],\n [mat-fab],\n [mat-icon-button],\n [mat-mini-fab],\n [mat-raised-button],\n [matCardSubtitle],\n [matCardTitle],\n [matCellDef],\n [matColumnDef],\n [matDialogActions],\n [matDialogClose],\n [matDialogContent],\n [matDialogTitle],\n [matHeaderCellDef],\n [matHeaderRowDef],\n [matLine],\n [matRowDef],\n [matStepLabel],\n [matStepperNext],\n [matStepperPrevious],\n [matTabLabel],\n [matTabLink],\n [matTabNav],\n [matTooltip],\n [matInput],\n [matPrefix],\n [matSuffix],\n mat-autocomplete,\n mat-button-toggle,\n mat-button-toggle,\n mat-button-toggle-group,\n mat-card,\n mat-card-actions,\n mat-card-content,\n mat-card-footer,\n mat-card-header,\n mat-card-subtitle,\n mat-card-title,\n mat-card-title-group,\n mat-cell,\n mat-checkbox,\n mat-chip,\n mat-dialog-actions,\n mat-dialog-container,\n mat-dialog-content,\n mat-divider,\n mat-error,\n mat-grid-list,\n mat-grid-tile,\n mat-grid-tile-footer,\n mat-grid-tile-header,\n mat-header-cell,\n mat-header-row,\n mat-hint,\n mat-horizontal-stepper,\n mat-icon,\n mat-input-container,\n mat-form-field,\n mat-list,\n mat-list-item,\n mat-menu,\n mat-nav-list,\n mat-option,\n mat-placeholder,\n mat-progress-bar,\n mat-pseudo-checkbox,\n mat-radio-button,\n mat-radio-group,\n mat-row,\n mat-select,\n mat-sidenav,\n mat-sidenav-container,\n mat-slider,\n mat-spinner,\n mat-step,\n mat-tab,\n mat-table,\n mat-tab-group,\n mat-toolbar,\n mat-vertical-stepper";
|
|
80
|
+
/**
|
|
81
|
+
* Selector that matches all elements that may have style collisions with AngularJS Material.
|
|
82
|
+
*/
|
|
83
|
+
var MD_ELEMENTS_SELECTOR = "\n [md-button],\n [md-fab],\n [md-icon-button],\n [md-mini-fab],\n [md-raised-button],\n [mdCardSubtitle],\n [mdCardTitle],\n [mdCellDef],\n [mdColumnDef],\n [mdDialogActions],\n [mdDialogClose],\n [mdDialogContent],\n [mdDialogTitle],\n [mdHeaderCellDef],\n [mdHeaderRowDef],\n [mdLine],\n [mdRowDef],\n [mdStepLabel],\n [mdStepperNext],\n [mdStepperPrevious],\n [mdTabLabel],\n [mdTabLink],\n [mdTabNav],\n [mdTooltip],\n [mdInput],\n [mdPrefix],\n [mdSuffix],\n md-autocomplete,\n md-button-toggle,\n md-button-toggle,\n md-button-toggle-group,\n md-card,\n md-card-actions,\n md-card-content,\n md-card-footer,\n md-card-header,\n md-card-subtitle,\n md-card-title,\n md-card-title-group,\n md-cell,\n md-checkbox,\n md-chip,\n md-dialog-actions,\n md-dialog-container,\n md-dialog-content,\n md-divider,\n md-error,\n md-grid-list,\n md-grid-tile,\n md-grid-tile-footer,\n md-grid-tile-header,\n md-header-cell,\n md-header-row,\n md-hint,\n md-horizontal-stepper,\n md-icon,\n md-input-container,\n md-form-field,\n md-list,\n md-list-item,\n md-menu,\n md-nav-list,\n md-option,\n md-placeholder,\n md-progress-bar,\n md-pseudo-checkbox,\n md-radio-button,\n md-radio-group,\n md-row,\n md-select,\n md-sidenav,\n md-sidenav-container,\n md-slider,\n md-spinner,\n md-step,\n md-tab,\n md-table,\n md-tab-group,\n md-toolbar,\n md-vertical-stepper";
|
|
84
|
+
/**
|
|
85
|
+
* Directive that enforces that the `mat-` prefix cannot be used.
|
|
86
|
+
*/
|
|
87
|
+
var MatPrefixRejector = (function () {
|
|
88
|
+
/**
|
|
89
|
+
* @param {?} isCompatibilityMode
|
|
90
|
+
* @param {?} elementRef
|
|
91
|
+
*/
|
|
92
|
+
function MatPrefixRejector(isCompatibilityMode, elementRef) {
|
|
93
|
+
if (!isCompatibilityMode) {
|
|
94
|
+
throw getMdCompatibilityInvalidPrefixError('mat', elementRef.nativeElement.nodeName);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return MatPrefixRejector;
|
|
98
|
+
}());
|
|
99
|
+
MatPrefixRejector.decorators = [
|
|
100
|
+
{ type: _angular_core.Directive, args: [{ selector: MAT_ELEMENTS_SELECTOR },] },
|
|
101
|
+
];
|
|
102
|
+
/**
|
|
103
|
+
* @nocollapse
|
|
104
|
+
*/
|
|
105
|
+
MatPrefixRejector.ctorParameters = function () { return [
|
|
106
|
+
{ type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [MATERIAL_COMPATIBILITY_MODE,] },] },
|
|
107
|
+
{ type: _angular_core.ElementRef, },
|
|
108
|
+
]; };
|
|
109
|
+
/**
|
|
110
|
+
* Directive that enforces that the `md-` prefix cannot be used.
|
|
111
|
+
*/
|
|
112
|
+
var MdPrefixRejector = (function () {
|
|
113
|
+
/**
|
|
114
|
+
* @param {?} isCompatibilityMode
|
|
115
|
+
* @param {?} elementRef
|
|
116
|
+
*/
|
|
117
|
+
function MdPrefixRejector(isCompatibilityMode, elementRef) {
|
|
118
|
+
if (isCompatibilityMode) {
|
|
119
|
+
throw getMdCompatibilityInvalidPrefixError('md', elementRef.nativeElement.nodeName);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return MdPrefixRejector;
|
|
123
|
+
}());
|
|
124
|
+
MdPrefixRejector.decorators = [
|
|
125
|
+
{ type: _angular_core.Directive, args: [{ selector: MD_ELEMENTS_SELECTOR },] },
|
|
126
|
+
];
|
|
127
|
+
/**
|
|
128
|
+
* @nocollapse
|
|
129
|
+
*/
|
|
130
|
+
MdPrefixRejector.ctorParameters = function () { return [
|
|
131
|
+
{ type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [MATERIAL_COMPATIBILITY_MODE,] },] },
|
|
132
|
+
{ type: _angular_core.ElementRef, },
|
|
133
|
+
]; };
|
|
134
|
+
/**
|
|
135
|
+
* Module that enforces the default compatibility mode settings. When this module is loaded
|
|
136
|
+
* without NoConflictStyleCompatibilityMode also being imported, it will throw an error if
|
|
137
|
+
* there are any uses of the `mat-` prefix.
|
|
138
|
+
*/
|
|
139
|
+
var CompatibilityModule = (function () {
|
|
140
|
+
function CompatibilityModule() {
|
|
141
|
+
}
|
|
142
|
+
return CompatibilityModule;
|
|
143
|
+
}());
|
|
144
|
+
CompatibilityModule.decorators = [
|
|
145
|
+
{ type: _angular_core.NgModule, args: [{
|
|
146
|
+
declarations: [MatPrefixRejector, MdPrefixRejector],
|
|
147
|
+
exports: [MatPrefixRejector, MdPrefixRejector],
|
|
148
|
+
},] },
|
|
149
|
+
];
|
|
150
|
+
/**
|
|
151
|
+
* @nocollapse
|
|
152
|
+
*/
|
|
153
|
+
CompatibilityModule.ctorParameters = function () { return []; };
|
|
154
|
+
/**
|
|
155
|
+
* Module that enforces "no-conflict" compatibility mode settings. When this module is loaded,
|
|
156
|
+
* it will throw an error if there are any uses of the `md-` prefix.
|
|
157
|
+
*/
|
|
158
|
+
var NoConflictStyleCompatibilityMode = (function () {
|
|
159
|
+
function NoConflictStyleCompatibilityMode() {
|
|
160
|
+
}
|
|
161
|
+
return NoConflictStyleCompatibilityMode;
|
|
162
|
+
}());
|
|
163
|
+
NoConflictStyleCompatibilityMode.decorators = [
|
|
164
|
+
{ type: _angular_core.NgModule, args: [{
|
|
165
|
+
providers: [{
|
|
166
|
+
provide: MATERIAL_COMPATIBILITY_MODE, useValue: true,
|
|
167
|
+
}],
|
|
168
|
+
},] },
|
|
169
|
+
];
|
|
170
|
+
/**
|
|
171
|
+
* @nocollapse
|
|
172
|
+
*/
|
|
173
|
+
NoConflictStyleCompatibilityMode.ctorParameters = function () { return []; };
|
|
174
|
+
/**
|
|
175
|
+
* Injection token that configures whether the Material sanity checks are enabled.
|
|
176
|
+
*/
|
|
177
|
+
var MATERIAL_SANITY_CHECKS = new _angular_core.InjectionToken('md-sanity-checks');
|
|
178
|
+
/**
|
|
179
|
+
* Module that captures anything that should be loaded and/or run for *all* Angular Material
|
|
180
|
+
* components. This includes Bidi, compatibility mode, etc.
|
|
181
|
+
*
|
|
182
|
+
* This module should be imported to each top-level component module (e.g., MdTabsModule).
|
|
183
|
+
*/
|
|
184
|
+
var MdCommonModule = (function () {
|
|
185
|
+
/**
|
|
186
|
+
* @param {?} _document
|
|
187
|
+
* @param {?} _sanityChecksEnabled
|
|
188
|
+
*/
|
|
189
|
+
function MdCommonModule(_document, _sanityChecksEnabled) {
|
|
190
|
+
this._document = _document;
|
|
191
|
+
/**
|
|
192
|
+
* Whether we've done the global sanity checks (e.g. a theme is loaded, there is a doctype).
|
|
193
|
+
*/
|
|
194
|
+
this._hasDoneGlobalChecks = false;
|
|
195
|
+
if (_sanityChecksEnabled && !this._hasDoneGlobalChecks && _document && _angular_core.isDevMode()) {
|
|
196
|
+
this._checkDoctype();
|
|
197
|
+
this._checkTheme();
|
|
198
|
+
this._hasDoneGlobalChecks = true;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* @return {?}
|
|
203
|
+
*/
|
|
204
|
+
MdCommonModule.prototype._checkDoctype = function () {
|
|
205
|
+
if (!this._document.doctype) {
|
|
206
|
+
console.warn('Current document does not have a doctype. This may cause ' +
|
|
207
|
+
'some Angular Material components not to behave as expected.');
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* @return {?}
|
|
212
|
+
*/
|
|
213
|
+
MdCommonModule.prototype._checkTheme = function () {
|
|
214
|
+
if (typeof getComputedStyle === 'function') {
|
|
215
|
+
var /** @type {?} */ testElement = this._document.createElement('div');
|
|
216
|
+
testElement.classList.add('mat-theme-loaded-marker');
|
|
217
|
+
this._document.body.appendChild(testElement);
|
|
218
|
+
if (getComputedStyle(testElement).display !== 'none') {
|
|
219
|
+
console.warn('Could not find Angular Material core theme. Most Material ' +
|
|
220
|
+
'components may not work as expected. For more info refer ' +
|
|
221
|
+
'to the theming guide: https://material.angular.io/guide/theming');
|
|
222
|
+
}
|
|
223
|
+
this._document.body.removeChild(testElement);
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
return MdCommonModule;
|
|
227
|
+
}());
|
|
228
|
+
MdCommonModule.decorators = [
|
|
229
|
+
{ type: _angular_core.NgModule, args: [{
|
|
230
|
+
imports: [CompatibilityModule, _angular_cdk_bidi.BidiModule],
|
|
231
|
+
exports: [CompatibilityModule, _angular_cdk_bidi.BidiModule],
|
|
232
|
+
providers: [{
|
|
233
|
+
provide: MATERIAL_SANITY_CHECKS, useValue: true,
|
|
234
|
+
}],
|
|
235
|
+
},] },
|
|
236
|
+
];
|
|
237
|
+
/**
|
|
238
|
+
* @nocollapse
|
|
239
|
+
*/
|
|
240
|
+
MdCommonModule.ctorParameters = function () { return [
|
|
241
|
+
{ type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [_angular_platformBrowser.DOCUMENT,] },] },
|
|
242
|
+
{ type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [MATERIAL_SANITY_CHECKS,] },] },
|
|
243
|
+
]; };
|
|
244
|
+
/**
|
|
245
|
+
* Mixin to augment a directive with a `disabled` property.
|
|
246
|
+
* @template T
|
|
247
|
+
* @param {?} base
|
|
248
|
+
* @return {?}
|
|
249
|
+
*/
|
|
250
|
+
function mixinDisabled(base) {
|
|
251
|
+
return (function (_super) {
|
|
252
|
+
__extends(class_1, _super);
|
|
253
|
+
/**
|
|
254
|
+
* @param {...?} args
|
|
255
|
+
*/
|
|
256
|
+
function class_1() {
|
|
257
|
+
var args = [];
|
|
258
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
259
|
+
args[_i] = arguments[_i];
|
|
260
|
+
}
|
|
261
|
+
var _this = _super.apply(this, args) || this;
|
|
262
|
+
_this._disabled = false;
|
|
263
|
+
return _this;
|
|
264
|
+
}
|
|
265
|
+
Object.defineProperty(class_1.prototype, "disabled", {
|
|
266
|
+
/**
|
|
267
|
+
* @return {?}
|
|
268
|
+
*/
|
|
269
|
+
get: function () { return this._disabled; },
|
|
270
|
+
/**
|
|
271
|
+
* @param {?} value
|
|
272
|
+
* @return {?}
|
|
273
|
+
*/
|
|
274
|
+
set: function (value) { this._disabled = _angular_cdk_coercion.coerceBooleanProperty(value); },
|
|
275
|
+
enumerable: true,
|
|
276
|
+
configurable: true
|
|
277
|
+
});
|
|
278
|
+
return class_1;
|
|
279
|
+
}(base));
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Mixin to augment a directive with a `color` property.
|
|
283
|
+
* @template T
|
|
284
|
+
* @param {?} base
|
|
285
|
+
* @param {?=} defaultColor
|
|
286
|
+
* @return {?}
|
|
287
|
+
*/
|
|
288
|
+
function mixinColor(base, defaultColor) {
|
|
289
|
+
return (function (_super) {
|
|
290
|
+
__extends(class_2, _super);
|
|
291
|
+
/**
|
|
292
|
+
* @param {...?} args
|
|
293
|
+
*/
|
|
294
|
+
function class_2() {
|
|
295
|
+
var args = [];
|
|
296
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
297
|
+
args[_i] = arguments[_i];
|
|
298
|
+
}
|
|
299
|
+
var _this = _super.apply(this, args) || this;
|
|
300
|
+
// Set the default color that can be specified from the mixin.
|
|
301
|
+
_this.color = defaultColor;
|
|
302
|
+
return _this;
|
|
303
|
+
}
|
|
304
|
+
Object.defineProperty(class_2.prototype, "color", {
|
|
305
|
+
/**
|
|
306
|
+
* @return {?}
|
|
307
|
+
*/
|
|
308
|
+
get: function () { return this._color; },
|
|
309
|
+
/**
|
|
310
|
+
* @param {?} value
|
|
311
|
+
* @return {?}
|
|
312
|
+
*/
|
|
313
|
+
set: function (value) {
|
|
314
|
+
var /** @type {?} */ colorPalette = value || defaultColor;
|
|
315
|
+
if (colorPalette !== this._color) {
|
|
316
|
+
if (this._color) {
|
|
317
|
+
this._renderer.removeClass(this._elementRef.nativeElement, "mat-" + this._color);
|
|
318
|
+
}
|
|
319
|
+
if (colorPalette) {
|
|
320
|
+
this._renderer.addClass(this._elementRef.nativeElement, "mat-" + colorPalette);
|
|
321
|
+
}
|
|
322
|
+
this._color = colorPalette;
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
enumerable: true,
|
|
326
|
+
configurable: true
|
|
327
|
+
});
|
|
328
|
+
return class_2;
|
|
329
|
+
}(base));
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Mixin to augment a directive with a `tabIndex` property.
|
|
333
|
+
* @template T
|
|
334
|
+
* @param {?} base
|
|
335
|
+
* @param {?=} defaultTabIndex
|
|
336
|
+
* @return {?}
|
|
337
|
+
*/
|
|
338
|
+
function mixinTabIndex(base, defaultTabIndex) {
|
|
339
|
+
if (defaultTabIndex === void 0) { defaultTabIndex = 0; }
|
|
340
|
+
return (function (_super) {
|
|
341
|
+
__extends(class_4, _super);
|
|
342
|
+
/**
|
|
343
|
+
* @param {...?} args
|
|
344
|
+
*/
|
|
345
|
+
function class_4() {
|
|
346
|
+
var args = [];
|
|
347
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
348
|
+
args[_i] = arguments[_i];
|
|
349
|
+
}
|
|
350
|
+
var _this = _super.apply(this, args) || this;
|
|
351
|
+
_this._tabIndex = defaultTabIndex;
|
|
352
|
+
return _this;
|
|
353
|
+
}
|
|
354
|
+
Object.defineProperty(class_4.prototype, "tabIndex", {
|
|
355
|
+
/**
|
|
356
|
+
* @return {?}
|
|
357
|
+
*/
|
|
358
|
+
get: function () { return this.disabled ? -1 : this._tabIndex; },
|
|
359
|
+
/**
|
|
360
|
+
* @param {?} value
|
|
361
|
+
* @return {?}
|
|
362
|
+
*/
|
|
363
|
+
set: function (value) {
|
|
364
|
+
// If the specified tabIndex value is null or undefined, fall back to the default value.
|
|
365
|
+
this._tabIndex = value != null ? value : defaultTabIndex;
|
|
366
|
+
},
|
|
367
|
+
enumerable: true,
|
|
368
|
+
configurable: true
|
|
369
|
+
});
|
|
370
|
+
return class_4;
|
|
371
|
+
}(base));
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Class to coordinate unique selection based on name.
|
|
375
|
+
* Intended to be consumed as an Angular service.
|
|
376
|
+
* This service is needed because native radio change events are only fired on the item currently
|
|
377
|
+
* being selected, and we still need to uncheck the previous selection.
|
|
378
|
+
*
|
|
379
|
+
* This service does not *store* any IDs and names because they may change at any time, so it is
|
|
380
|
+
* less error-prone if they are simply passed through when the events occur.
|
|
381
|
+
*/
|
|
382
|
+
var UniqueSelectionDispatcher = (function () {
|
|
383
|
+
function UniqueSelectionDispatcher() {
|
|
384
|
+
this._listeners = [];
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Notify other items that selection for the given name has been set.
|
|
388
|
+
* @param {?} id ID of the item.
|
|
389
|
+
* @param {?} name Name of the item.
|
|
390
|
+
* @return {?}
|
|
391
|
+
*/
|
|
392
|
+
UniqueSelectionDispatcher.prototype.notify = function (id, name) {
|
|
393
|
+
for (var _i = 0, _a = this._listeners; _i < _a.length; _i++) {
|
|
394
|
+
var listener = _a[_i];
|
|
395
|
+
listener(id, name);
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Listen for future changes to item selection.
|
|
400
|
+
* @param {?} listener
|
|
401
|
+
* @return {?} Function used to deregister listener
|
|
402
|
+
*
|
|
403
|
+
*/
|
|
404
|
+
UniqueSelectionDispatcher.prototype.listen = function (listener) {
|
|
405
|
+
var _this = this;
|
|
406
|
+
this._listeners.push(listener);
|
|
407
|
+
return function () {
|
|
408
|
+
_this._listeners = _this._listeners.filter(function (registered) {
|
|
409
|
+
return listener !== registered;
|
|
410
|
+
});
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
return UniqueSelectionDispatcher;
|
|
414
|
+
}());
|
|
415
|
+
UniqueSelectionDispatcher.decorators = [
|
|
416
|
+
{ type: _angular_core.Injectable },
|
|
417
|
+
];
|
|
418
|
+
/**
|
|
419
|
+
* @nocollapse
|
|
420
|
+
*/
|
|
421
|
+
UniqueSelectionDispatcher.ctorParameters = function () { return []; };
|
|
422
|
+
/**
|
|
423
|
+
* \@docs-private
|
|
424
|
+
* @param {?} parentDispatcher
|
|
425
|
+
* @return {?}
|
|
426
|
+
*/
|
|
427
|
+
function UNIQUE_SELECTION_DISPATCHER_PROVIDER_FACTORY(parentDispatcher) {
|
|
428
|
+
return parentDispatcher || new UniqueSelectionDispatcher();
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* \@docs-private
|
|
432
|
+
*/
|
|
433
|
+
var UNIQUE_SELECTION_DISPATCHER_PROVIDER = {
|
|
434
|
+
// If there is already a dispatcher available, use that. Otherwise, provide a new one.
|
|
435
|
+
provide: UniqueSelectionDispatcher,
|
|
436
|
+
deps: [[new _angular_core.Optional(), new _angular_core.SkipSelf(), UniqueSelectionDispatcher]],
|
|
437
|
+
useFactory: UNIQUE_SELECTION_DISPATCHER_PROVIDER_FACTORY
|
|
438
|
+
};
|
|
439
|
+
/**
|
|
440
|
+
* InjectionToken for datepicker that can be used to override default locale code.
|
|
441
|
+
*/
|
|
442
|
+
var MAT_DATE_LOCALE = new _angular_core.InjectionToken('MAT_DATE_LOCALE');
|
|
443
|
+
/**
|
|
444
|
+
* Provider for MAT_DATE_LOCALE injection token.
|
|
445
|
+
*/
|
|
446
|
+
var MAT_DATE_LOCALE_PROVIDER = { provide: MAT_DATE_LOCALE, useExisting: _angular_core.LOCALE_ID };
|
|
447
|
+
/**
|
|
448
|
+
* Adapts type `D` to be usable as a date by cdk-based components that work with dates.
|
|
449
|
+
* @abstract
|
|
450
|
+
*/
|
|
451
|
+
var DateAdapter = (function () {
|
|
452
|
+
function DateAdapter() {
|
|
453
|
+
this._localeChanges = new rxjs_Subject.Subject();
|
|
454
|
+
}
|
|
455
|
+
Object.defineProperty(DateAdapter.prototype, "localeChanges", {
|
|
456
|
+
/**
|
|
457
|
+
* A stream that emits when the locale changes.
|
|
458
|
+
* @return {?}
|
|
459
|
+
*/
|
|
460
|
+
get: function () { return this._localeChanges; },
|
|
461
|
+
enumerable: true,
|
|
462
|
+
configurable: true
|
|
463
|
+
});
|
|
464
|
+
/**
|
|
465
|
+
* Gets the year component of the given date.
|
|
466
|
+
* @abstract
|
|
467
|
+
* @param {?} date The date to extract the year from.
|
|
468
|
+
* @return {?} The year component.
|
|
469
|
+
*/
|
|
470
|
+
DateAdapter.prototype.getYear = function (date) { };
|
|
471
|
+
/**
|
|
472
|
+
* Gets the month component of the given date.
|
|
473
|
+
* @abstract
|
|
474
|
+
* @param {?} date The date to extract the month from.
|
|
475
|
+
* @return {?} The month component (0-indexed, 0 = January).
|
|
476
|
+
*/
|
|
477
|
+
DateAdapter.prototype.getMonth = function (date) { };
|
|
478
|
+
/**
|
|
479
|
+
* Gets the date of the month component of the given date.
|
|
480
|
+
* @abstract
|
|
481
|
+
* @param {?} date The date to extract the date of the month from.
|
|
482
|
+
* @return {?} The month component (1-indexed, 1 = first of month).
|
|
483
|
+
*/
|
|
484
|
+
DateAdapter.prototype.getDate = function (date) { };
|
|
485
|
+
/**
|
|
486
|
+
* Gets the day of the week component of the given date.
|
|
487
|
+
* @abstract
|
|
488
|
+
* @param {?} date The date to extract the day of the week from.
|
|
489
|
+
* @return {?} The month component (0-indexed, 0 = Sunday).
|
|
490
|
+
*/
|
|
491
|
+
DateAdapter.prototype.getDayOfWeek = function (date) { };
|
|
492
|
+
/**
|
|
493
|
+
* Gets a list of names for the months.
|
|
494
|
+
* @abstract
|
|
495
|
+
* @param {?} style The naming style (e.g. long = 'January', short = 'Jan', narrow = 'J').
|
|
496
|
+
* @return {?} An ordered list of all month names, starting with January.
|
|
497
|
+
*/
|
|
498
|
+
DateAdapter.prototype.getMonthNames = function (style$$1) { };
|
|
499
|
+
/**
|
|
500
|
+
* Gets a list of names for the dates of the month.
|
|
501
|
+
* @abstract
|
|
502
|
+
* @return {?} An ordered list of all date of the month names, starting with '1'.
|
|
503
|
+
*/
|
|
504
|
+
DateAdapter.prototype.getDateNames = function () { };
|
|
505
|
+
/**
|
|
506
|
+
* Gets a list of names for the days of the week.
|
|
507
|
+
* @abstract
|
|
508
|
+
* @param {?} style The naming style (e.g. long = 'Sunday', short = 'Sun', narrow = 'S').
|
|
509
|
+
* @return {?} An ordered list of all weekday names, starting with Sunday.
|
|
510
|
+
*/
|
|
511
|
+
DateAdapter.prototype.getDayOfWeekNames = function (style$$1) { };
|
|
512
|
+
/**
|
|
513
|
+
* Gets the name for the year of the given date.
|
|
514
|
+
* @abstract
|
|
515
|
+
* @param {?} date The date to get the year name for.
|
|
516
|
+
* @return {?} The name of the given year (e.g. '2017').
|
|
517
|
+
*/
|
|
518
|
+
DateAdapter.prototype.getYearName = function (date) { };
|
|
519
|
+
/**
|
|
520
|
+
* Gets the first day of the week.
|
|
521
|
+
* @abstract
|
|
522
|
+
* @return {?} The first day of the week (0-indexed, 0 = Sunday).
|
|
523
|
+
*/
|
|
524
|
+
DateAdapter.prototype.getFirstDayOfWeek = function () { };
|
|
525
|
+
/**
|
|
526
|
+
* Gets the number of days in the month of the given date.
|
|
527
|
+
* @abstract
|
|
528
|
+
* @param {?} date The date whose month should be checked.
|
|
529
|
+
* @return {?} The number of days in the month of the given date.
|
|
530
|
+
*/
|
|
531
|
+
DateAdapter.prototype.getNumDaysInMonth = function (date) { };
|
|
532
|
+
/**
|
|
533
|
+
* Clones the given date.
|
|
534
|
+
* @abstract
|
|
535
|
+
* @param {?} date The date to clone
|
|
536
|
+
* @return {?} A new date equal to the given date.
|
|
537
|
+
*/
|
|
538
|
+
DateAdapter.prototype.clone = function (date) { };
|
|
539
|
+
/**
|
|
540
|
+
* Creates a date with the given year, month, and date. Does not allow over/under-flow of the
|
|
541
|
+
* month and date.
|
|
542
|
+
* @abstract
|
|
543
|
+
* @param {?} year The full year of the date. (e.g. 89 means the year 89, not the year 1989).
|
|
544
|
+
* @param {?} month The month of the date (0-indexed, 0 = January). Must be an integer 0 - 11.
|
|
545
|
+
* @param {?} date The date of month of the date. Must be an integer 1 - length of the given month.
|
|
546
|
+
* @return {?} The new date, or null if invalid.
|
|
547
|
+
*/
|
|
548
|
+
DateAdapter.prototype.createDate = function (year, month, date) { };
|
|
549
|
+
/**
|
|
550
|
+
* Gets today's date.
|
|
551
|
+
* @abstract
|
|
552
|
+
* @return {?} Today's date.
|
|
553
|
+
*/
|
|
554
|
+
DateAdapter.prototype.today = function () { };
|
|
555
|
+
/**
|
|
556
|
+
* Parses a date from a value.
|
|
557
|
+
* @abstract
|
|
558
|
+
* @param {?} value The value to parse.
|
|
559
|
+
* @param {?} parseFormat The expected format of the value being parsed
|
|
560
|
+
* (type is implementation-dependent).
|
|
561
|
+
* @return {?} The parsed date.
|
|
562
|
+
*/
|
|
563
|
+
DateAdapter.prototype.parse = function (value, parseFormat) { };
|
|
564
|
+
/**
|
|
565
|
+
* Formats a date as a string.
|
|
566
|
+
* @abstract
|
|
567
|
+
* @param {?} date The value to format.
|
|
568
|
+
* @param {?} displayFormat The format to use to display the date as a string.
|
|
569
|
+
* @return {?} The formatted date string.
|
|
570
|
+
*/
|
|
571
|
+
DateAdapter.prototype.format = function (date, displayFormat) { };
|
|
572
|
+
/**
|
|
573
|
+
* Adds the given number of years to the date. Years are counted as if flipping 12 pages on the
|
|
574
|
+
* calendar for each year and then finding the closest date in the new month. For example when
|
|
575
|
+
* adding 1 year to Feb 29, 2016, the resulting date will be Feb 28, 2017.
|
|
576
|
+
* @abstract
|
|
577
|
+
* @param {?} date The date to add years to.
|
|
578
|
+
* @param {?} years The number of years to add (may be negative).
|
|
579
|
+
* @return {?} A new date equal to the given one with the specified number of years added.
|
|
580
|
+
*/
|
|
581
|
+
DateAdapter.prototype.addCalendarYears = function (date, years) { };
|
|
582
|
+
/**
|
|
583
|
+
* Adds the given number of months to the date. Months are counted as if flipping a page on the
|
|
584
|
+
* calendar for each month and then finding the closest date in the new month. For example when
|
|
585
|
+
* adding 1 month to Jan 31, 2017, the resulting date will be Feb 28, 2017.
|
|
586
|
+
* @abstract
|
|
587
|
+
* @param {?} date The date to add months to.
|
|
588
|
+
* @param {?} months The number of months to add (may be negative).
|
|
589
|
+
* @return {?} A new date equal to the given one with the specified number of months added.
|
|
590
|
+
*/
|
|
591
|
+
DateAdapter.prototype.addCalendarMonths = function (date, months) { };
|
|
592
|
+
/**
|
|
593
|
+
* Adds the given number of days to the date. Days are counted as if moving one cell on the
|
|
594
|
+
* calendar for each day.
|
|
595
|
+
* @abstract
|
|
596
|
+
* @param {?} date The date to add days to.
|
|
597
|
+
* @param {?} days The number of days to add (may be negative).
|
|
598
|
+
* @return {?} A new date equal to the given one with the specified number of days added.
|
|
599
|
+
*/
|
|
600
|
+
DateAdapter.prototype.addCalendarDays = function (date, days) { };
|
|
601
|
+
/**
|
|
602
|
+
* Gets the RFC 3339 compatible string (https://tools.ietf.org/html/rfc3339) for the given date.
|
|
603
|
+
* @abstract
|
|
604
|
+
* @param {?} date The date to get the ISO date string for.
|
|
605
|
+
* @return {?} The ISO date string date string.
|
|
606
|
+
*/
|
|
607
|
+
DateAdapter.prototype.toIso8601 = function (date) { };
|
|
608
|
+
/**
|
|
609
|
+
* Creates a date from an RFC 3339 compatible string (https://tools.ietf.org/html/rfc3339).
|
|
610
|
+
* @abstract
|
|
611
|
+
* @param {?} iso8601String The ISO date string to create a date from
|
|
612
|
+
* @return {?} The date created from the ISO date string.
|
|
613
|
+
*/
|
|
614
|
+
DateAdapter.prototype.fromIso8601 = function (iso8601String) { };
|
|
615
|
+
/**
|
|
616
|
+
* Checks whether the given object is considered a date instance by this DateAdapter.
|
|
617
|
+
* @abstract
|
|
618
|
+
* @param {?} obj The object to check
|
|
619
|
+
* @return {?} Whether the object is a date instance.
|
|
620
|
+
*/
|
|
621
|
+
DateAdapter.prototype.isDateInstance = function (obj) { };
|
|
622
|
+
/**
|
|
623
|
+
* Checks whether the given date is valid.
|
|
624
|
+
* @abstract
|
|
625
|
+
* @param {?} date The date to check.
|
|
626
|
+
* @return {?} Whether the date is valid.
|
|
627
|
+
*/
|
|
628
|
+
DateAdapter.prototype.isValid = function (date) { };
|
|
629
|
+
/**
|
|
630
|
+
* Sets the locale used for all dates.
|
|
631
|
+
* @param {?} locale The new locale.
|
|
632
|
+
* @return {?}
|
|
633
|
+
*/
|
|
634
|
+
DateAdapter.prototype.setLocale = function (locale) {
|
|
635
|
+
this.locale = locale;
|
|
636
|
+
this._localeChanges.next();
|
|
637
|
+
};
|
|
638
|
+
/**
|
|
639
|
+
* Compares two dates.
|
|
640
|
+
* @param {?} first The first date to compare.
|
|
641
|
+
* @param {?} second The second date to compare.
|
|
642
|
+
* @return {?} 0 if the dates are equal, a number less than 0 if the first date is earlier,
|
|
643
|
+
* a number greater than 0 if the first date is later.
|
|
644
|
+
*/
|
|
645
|
+
DateAdapter.prototype.compareDate = function (first$$1, second) {
|
|
646
|
+
return this.getYear(first$$1) - this.getYear(second) ||
|
|
647
|
+
this.getMonth(first$$1) - this.getMonth(second) ||
|
|
648
|
+
this.getDate(first$$1) - this.getDate(second);
|
|
649
|
+
};
|
|
650
|
+
/**
|
|
651
|
+
* Checks if two dates are equal.
|
|
652
|
+
* @param {?} first The first date to check.
|
|
653
|
+
* @param {?} second The second date to check.
|
|
654
|
+
* Null dates are considered equal to other null dates.
|
|
655
|
+
* @return {?}
|
|
656
|
+
*/
|
|
657
|
+
DateAdapter.prototype.sameDate = function (first$$1, second) {
|
|
658
|
+
return first$$1 && second ? !this.compareDate(first$$1, second) : first$$1 == second;
|
|
659
|
+
};
|
|
660
|
+
/**
|
|
661
|
+
* Clamp the given date between min and max dates.
|
|
662
|
+
* @param {?} date The date to clamp.
|
|
663
|
+
* @param {?=} min The minimum value to allow. If null or omitted no min is enforced.
|
|
664
|
+
* @param {?=} max The maximum value to allow. If null or omitted no max is enforced.
|
|
665
|
+
* @return {?} `min` if `date` is less than `min`, `max` if date is greater than `max`,
|
|
666
|
+
* otherwise `date`.
|
|
667
|
+
*/
|
|
668
|
+
DateAdapter.prototype.clampDate = function (date, min, max) {
|
|
669
|
+
if (min && this.compareDate(date, min) < 0) {
|
|
670
|
+
return min;
|
|
671
|
+
}
|
|
672
|
+
if (max && this.compareDate(date, max) > 0) {
|
|
673
|
+
return max;
|
|
674
|
+
}
|
|
675
|
+
return date;
|
|
676
|
+
};
|
|
677
|
+
return DateAdapter;
|
|
678
|
+
}());
|
|
679
|
+
/**
|
|
680
|
+
* Extends an object with the *enumerable* and *own* properties of one or more source objects,
|
|
681
|
+
* similar to Object.assign.
|
|
682
|
+
*
|
|
683
|
+
* @param {?} dest The object which will have properties copied to it.
|
|
684
|
+
* @param {...?} sources The source objects from which properties will be copied.
|
|
685
|
+
* @return {?}
|
|
686
|
+
*/
|
|
687
|
+
function extendObject(dest) {
|
|
688
|
+
var sources = [];
|
|
689
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
690
|
+
sources[_i - 1] = arguments[_i];
|
|
691
|
+
}
|
|
692
|
+
if (dest == null) {
|
|
693
|
+
throw TypeError('Cannot convert undefined or null to object');
|
|
694
|
+
}
|
|
695
|
+
for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) {
|
|
696
|
+
var source = sources_1[_a];
|
|
697
|
+
if (source != null) {
|
|
698
|
+
for (var /** @type {?} */ key in source) {
|
|
699
|
+
if (source.hasOwnProperty(key)) {
|
|
700
|
+
dest[key] = source[key];
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
return dest;
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Whether the browser supports the Intl API.
|
|
709
|
+
*/
|
|
710
|
+
var SUPPORTS_INTL_API = typeof Intl != 'undefined';
|
|
711
|
+
/**
|
|
712
|
+
* The default month names to use if Intl API is not available.
|
|
713
|
+
*/
|
|
714
|
+
var DEFAULT_MONTH_NAMES = {
|
|
715
|
+
'long': [
|
|
716
|
+
'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',
|
|
717
|
+
'October', 'November', 'December'
|
|
718
|
+
],
|
|
719
|
+
'short': ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
|
720
|
+
'narrow': ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D']
|
|
721
|
+
};
|
|
722
|
+
/**
|
|
723
|
+
* The default date names to use if Intl API is not available.
|
|
724
|
+
*/
|
|
725
|
+
var DEFAULT_DATE_NAMES = range(31, function (i) { return String(i + 1); });
|
|
726
|
+
/**
|
|
727
|
+
* The default day of the week names to use if Intl API is not available.
|
|
728
|
+
*/
|
|
729
|
+
var DEFAULT_DAY_OF_WEEK_NAMES = {
|
|
730
|
+
'long': ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
|
731
|
+
'short': ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
732
|
+
'narrow': ['S', 'M', 'T', 'W', 'T', 'F', 'S']
|
|
733
|
+
};
|
|
734
|
+
/**
|
|
735
|
+
* Matches strings that have the form of a valid RFC 3339 string
|
|
736
|
+
* (https://tools.ietf.org/html/rfc3339). Note that the string may not actually be a valid date
|
|
737
|
+
* because the regex will match strings an with out of bounds month, date, etc.
|
|
738
|
+
*/
|
|
739
|
+
var ISO_8601_REGEX = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;
|
|
740
|
+
/**
|
|
741
|
+
* Creates an array and fills it with values.
|
|
742
|
+
* @template T
|
|
743
|
+
* @param {?} length
|
|
744
|
+
* @param {?} valueFunction
|
|
745
|
+
* @return {?}
|
|
746
|
+
*/
|
|
747
|
+
function range(length, valueFunction) {
|
|
748
|
+
var /** @type {?} */ valuesArray = Array(length);
|
|
749
|
+
for (var /** @type {?} */ i = 0; i < length; i++) {
|
|
750
|
+
valuesArray[i] = valueFunction(i);
|
|
751
|
+
}
|
|
752
|
+
return valuesArray;
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Adapts the native JS Date for use with cdk-based components that work with dates.
|
|
756
|
+
*/
|
|
757
|
+
var NativeDateAdapter = (function (_super) {
|
|
758
|
+
__extends(NativeDateAdapter, _super);
|
|
759
|
+
/**
|
|
760
|
+
* @param {?} matDateLocale
|
|
761
|
+
*/
|
|
762
|
+
function NativeDateAdapter(matDateLocale) {
|
|
763
|
+
var _this = _super.call(this) || this;
|
|
764
|
+
/**
|
|
765
|
+
* Whether to use `timeZone: 'utc'` with `Intl.DateTimeFormat` when formatting dates.
|
|
766
|
+
* Without this `Intl.DateTimeFormat` sometimes chooses the wrong timeZone, which can throw off
|
|
767
|
+
* the result. (e.g. in the en-US locale `new Date(1800, 7, 14).toLocaleDateString()`
|
|
768
|
+
* will produce `'8/13/1800'`.
|
|
769
|
+
*/
|
|
770
|
+
_this.useUtcForDisplay = true;
|
|
771
|
+
_super.prototype.setLocale.call(_this, matDateLocale);
|
|
772
|
+
return _this;
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* @param {?} date
|
|
776
|
+
* @return {?}
|
|
777
|
+
*/
|
|
778
|
+
NativeDateAdapter.prototype.getYear = function (date) {
|
|
779
|
+
return date.getFullYear();
|
|
780
|
+
};
|
|
781
|
+
/**
|
|
782
|
+
* @param {?} date
|
|
783
|
+
* @return {?}
|
|
784
|
+
*/
|
|
785
|
+
NativeDateAdapter.prototype.getMonth = function (date) {
|
|
786
|
+
return date.getMonth();
|
|
787
|
+
};
|
|
788
|
+
/**
|
|
789
|
+
* @param {?} date
|
|
790
|
+
* @return {?}
|
|
791
|
+
*/
|
|
792
|
+
NativeDateAdapter.prototype.getDate = function (date) {
|
|
793
|
+
return date.getDate();
|
|
794
|
+
};
|
|
795
|
+
/**
|
|
796
|
+
* @param {?} date
|
|
797
|
+
* @return {?}
|
|
798
|
+
*/
|
|
799
|
+
NativeDateAdapter.prototype.getDayOfWeek = function (date) {
|
|
800
|
+
return date.getDay();
|
|
801
|
+
};
|
|
802
|
+
/**
|
|
803
|
+
* @param {?} style
|
|
804
|
+
* @return {?}
|
|
805
|
+
*/
|
|
806
|
+
NativeDateAdapter.prototype.getMonthNames = function (style$$1) {
|
|
807
|
+
var _this = this;
|
|
808
|
+
if (SUPPORTS_INTL_API) {
|
|
809
|
+
var /** @type {?} */ dtf_1 = new Intl.DateTimeFormat(this.locale, { month: style$$1 });
|
|
810
|
+
return range(12, function (i) { return _this._stripDirectionalityCharacters(dtf_1.format(new Date(2017, i, 1))); });
|
|
811
|
+
}
|
|
812
|
+
return DEFAULT_MONTH_NAMES[style$$1];
|
|
813
|
+
};
|
|
814
|
+
/**
|
|
815
|
+
* @return {?}
|
|
816
|
+
*/
|
|
817
|
+
NativeDateAdapter.prototype.getDateNames = function () {
|
|
818
|
+
var _this = this;
|
|
819
|
+
if (SUPPORTS_INTL_API) {
|
|
820
|
+
var /** @type {?} */ dtf_2 = new Intl.DateTimeFormat(this.locale, { day: 'numeric' });
|
|
821
|
+
return range(31, function (i) { return _this._stripDirectionalityCharacters(dtf_2.format(new Date(2017, 0, i + 1))); });
|
|
822
|
+
}
|
|
823
|
+
return DEFAULT_DATE_NAMES;
|
|
824
|
+
};
|
|
825
|
+
/**
|
|
826
|
+
* @param {?} style
|
|
827
|
+
* @return {?}
|
|
828
|
+
*/
|
|
829
|
+
NativeDateAdapter.prototype.getDayOfWeekNames = function (style$$1) {
|
|
830
|
+
var _this = this;
|
|
831
|
+
if (SUPPORTS_INTL_API) {
|
|
832
|
+
var /** @type {?} */ dtf_3 = new Intl.DateTimeFormat(this.locale, { weekday: style$$1 });
|
|
833
|
+
return range(7, function (i) { return _this._stripDirectionalityCharacters(dtf_3.format(new Date(2017, 0, i + 1))); });
|
|
834
|
+
}
|
|
835
|
+
return DEFAULT_DAY_OF_WEEK_NAMES[style$$1];
|
|
836
|
+
};
|
|
837
|
+
/**
|
|
838
|
+
* @param {?} date
|
|
839
|
+
* @return {?}
|
|
840
|
+
*/
|
|
841
|
+
NativeDateAdapter.prototype.getYearName = function (date) {
|
|
842
|
+
if (SUPPORTS_INTL_API) {
|
|
843
|
+
var /** @type {?} */ dtf = new Intl.DateTimeFormat(this.locale, { year: 'numeric' });
|
|
844
|
+
return this._stripDirectionalityCharacters(dtf.format(date));
|
|
845
|
+
}
|
|
846
|
+
return String(this.getYear(date));
|
|
847
|
+
};
|
|
848
|
+
/**
|
|
849
|
+
* @return {?}
|
|
850
|
+
*/
|
|
851
|
+
NativeDateAdapter.prototype.getFirstDayOfWeek = function () {
|
|
852
|
+
// We can't tell using native JS Date what the first day of the week is, we default to Sunday.
|
|
853
|
+
return 0;
|
|
854
|
+
};
|
|
855
|
+
/**
|
|
856
|
+
* @param {?} date
|
|
857
|
+
* @return {?}
|
|
858
|
+
*/
|
|
859
|
+
NativeDateAdapter.prototype.getNumDaysInMonth = function (date) {
|
|
860
|
+
return this.getDate(this._createDateWithOverflow(this.getYear(date), this.getMonth(date) + 1, 0));
|
|
861
|
+
};
|
|
862
|
+
/**
|
|
863
|
+
* @param {?} date
|
|
864
|
+
* @return {?}
|
|
865
|
+
*/
|
|
866
|
+
NativeDateAdapter.prototype.clone = function (date) {
|
|
867
|
+
return this.createDate(this.getYear(date), this.getMonth(date), this.getDate(date));
|
|
868
|
+
};
|
|
869
|
+
/**
|
|
870
|
+
* @param {?} year
|
|
871
|
+
* @param {?} month
|
|
872
|
+
* @param {?} date
|
|
873
|
+
* @return {?}
|
|
874
|
+
*/
|
|
875
|
+
NativeDateAdapter.prototype.createDate = function (year, month, date) {
|
|
876
|
+
// Check for invalid month and date (except upper bound on date which we have to check after
|
|
877
|
+
// creating the Date).
|
|
878
|
+
if (month < 0 || month > 11) {
|
|
879
|
+
throw Error("Invalid month index \"" + month + "\". Month index has to be between 0 and 11.");
|
|
880
|
+
}
|
|
881
|
+
if (date < 1) {
|
|
882
|
+
throw Error("Invalid date \"" + date + "\". Date has to be greater than 0.");
|
|
883
|
+
}
|
|
884
|
+
var /** @type {?} */ result = this._createDateWithOverflow(year, month, date);
|
|
885
|
+
// Check that the date wasn't above the upper bound for the month, causing the month to overflow
|
|
886
|
+
if (result.getMonth() != month) {
|
|
887
|
+
throw Error("Invalid date \"" + date + "\" for month with index \"" + month + "\".");
|
|
888
|
+
}
|
|
889
|
+
return result;
|
|
890
|
+
};
|
|
891
|
+
/**
|
|
892
|
+
* @return {?}
|
|
893
|
+
*/
|
|
894
|
+
NativeDateAdapter.prototype.today = function () {
|
|
895
|
+
return new Date();
|
|
896
|
+
};
|
|
897
|
+
/**
|
|
898
|
+
* @param {?} value
|
|
899
|
+
* @return {?}
|
|
900
|
+
*/
|
|
901
|
+
NativeDateAdapter.prototype.parse = function (value) {
|
|
902
|
+
// We have no way using the native JS Date to set the parse format or locale, so we ignore these
|
|
903
|
+
// parameters.
|
|
904
|
+
if (typeof value == 'number') {
|
|
905
|
+
return new Date(value);
|
|
906
|
+
}
|
|
907
|
+
return value ? new Date(Date.parse(value)) : null;
|
|
908
|
+
};
|
|
909
|
+
/**
|
|
910
|
+
* @param {?} date
|
|
911
|
+
* @param {?} displayFormat
|
|
912
|
+
* @return {?}
|
|
913
|
+
*/
|
|
914
|
+
NativeDateAdapter.prototype.format = function (date, displayFormat) {
|
|
915
|
+
if (!this.isValid(date)) {
|
|
916
|
+
throw Error('NativeDateAdapter: Cannot format invalid date.');
|
|
917
|
+
}
|
|
918
|
+
if (SUPPORTS_INTL_API) {
|
|
919
|
+
if (this.useUtcForDisplay) {
|
|
920
|
+
date = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
|
921
|
+
displayFormat = extendObject({}, displayFormat, { timeZone: 'utc' });
|
|
922
|
+
}
|
|
923
|
+
var /** @type {?} */ dtf = new Intl.DateTimeFormat(this.locale, displayFormat);
|
|
924
|
+
return this._stripDirectionalityCharacters(dtf.format(date));
|
|
925
|
+
}
|
|
926
|
+
return this._stripDirectionalityCharacters(date.toDateString());
|
|
927
|
+
};
|
|
928
|
+
/**
|
|
929
|
+
* @param {?} date
|
|
930
|
+
* @param {?} years
|
|
931
|
+
* @return {?}
|
|
932
|
+
*/
|
|
933
|
+
NativeDateAdapter.prototype.addCalendarYears = function (date, years) {
|
|
934
|
+
return this.addCalendarMonths(date, years * 12);
|
|
935
|
+
};
|
|
936
|
+
/**
|
|
937
|
+
* @param {?} date
|
|
938
|
+
* @param {?} months
|
|
939
|
+
* @return {?}
|
|
940
|
+
*/
|
|
941
|
+
NativeDateAdapter.prototype.addCalendarMonths = function (date, months) {
|
|
942
|
+
var /** @type {?} */ newDate = this._createDateWithOverflow(this.getYear(date), this.getMonth(date) + months, this.getDate(date));
|
|
943
|
+
// It's possible to wind up in the wrong month if the original month has more days than the new
|
|
944
|
+
// month. In this case we want to go to the last day of the desired month.
|
|
945
|
+
// Note: the additional + 12 % 12 ensures we end up with a positive number, since JS % doesn't
|
|
946
|
+
// guarantee this.
|
|
947
|
+
if (this.getMonth(newDate) != ((this.getMonth(date) + months) % 12 + 12) % 12) {
|
|
948
|
+
newDate = this._createDateWithOverflow(this.getYear(newDate), this.getMonth(newDate), 0);
|
|
949
|
+
}
|
|
950
|
+
return newDate;
|
|
951
|
+
};
|
|
952
|
+
/**
|
|
953
|
+
* @param {?} date
|
|
954
|
+
* @param {?} days
|
|
955
|
+
* @return {?}
|
|
956
|
+
*/
|
|
957
|
+
NativeDateAdapter.prototype.addCalendarDays = function (date, days) {
|
|
958
|
+
return this._createDateWithOverflow(this.getYear(date), this.getMonth(date), this.getDate(date) + days);
|
|
959
|
+
};
|
|
960
|
+
/**
|
|
961
|
+
* @param {?} date
|
|
962
|
+
* @return {?}
|
|
963
|
+
*/
|
|
964
|
+
NativeDateAdapter.prototype.toIso8601 = function (date) {
|
|
965
|
+
return [
|
|
966
|
+
date.getUTCFullYear(),
|
|
967
|
+
this._2digit(date.getUTCMonth() + 1),
|
|
968
|
+
this._2digit(date.getUTCDate())
|
|
969
|
+
].join('-');
|
|
970
|
+
};
|
|
971
|
+
/**
|
|
972
|
+
* @param {?} iso8601String
|
|
973
|
+
* @return {?}
|
|
974
|
+
*/
|
|
975
|
+
NativeDateAdapter.prototype.fromIso8601 = function (iso8601String) {
|
|
976
|
+
// The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the
|
|
977
|
+
// string is the right format first.
|
|
978
|
+
if (ISO_8601_REGEX.test(iso8601String)) {
|
|
979
|
+
var /** @type {?} */ d = new Date(iso8601String);
|
|
980
|
+
if (this.isValid(d)) {
|
|
981
|
+
return d;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
return null;
|
|
985
|
+
};
|
|
986
|
+
/**
|
|
987
|
+
* @param {?} obj
|
|
988
|
+
* @return {?}
|
|
989
|
+
*/
|
|
990
|
+
NativeDateAdapter.prototype.isDateInstance = function (obj) {
|
|
991
|
+
return obj instanceof Date;
|
|
992
|
+
};
|
|
993
|
+
/**
|
|
994
|
+
* @param {?} date
|
|
995
|
+
* @return {?}
|
|
996
|
+
*/
|
|
997
|
+
NativeDateAdapter.prototype.isValid = function (date) {
|
|
998
|
+
return !isNaN(date.getTime());
|
|
999
|
+
};
|
|
1000
|
+
/**
|
|
1001
|
+
* Creates a date but allows the month and date to overflow.
|
|
1002
|
+
* @param {?} year
|
|
1003
|
+
* @param {?} month
|
|
1004
|
+
* @param {?} date
|
|
1005
|
+
* @return {?}
|
|
1006
|
+
*/
|
|
1007
|
+
NativeDateAdapter.prototype._createDateWithOverflow = function (year, month, date) {
|
|
1008
|
+
var /** @type {?} */ result = new Date(year, month, date);
|
|
1009
|
+
// We need to correct for the fact that JS native Date treats years in range [0, 99] as
|
|
1010
|
+
// abbreviations for 19xx.
|
|
1011
|
+
if (year >= 0 && year < 100) {
|
|
1012
|
+
result.setFullYear(this.getYear(result) - 1900);
|
|
1013
|
+
}
|
|
1014
|
+
return result;
|
|
1015
|
+
};
|
|
1016
|
+
/**
|
|
1017
|
+
* Pads a number to make it two digits.
|
|
1018
|
+
* @param {?} n The number to pad.
|
|
1019
|
+
* @return {?} The padded number.
|
|
1020
|
+
*/
|
|
1021
|
+
NativeDateAdapter.prototype._2digit = function (n) {
|
|
1022
|
+
return ('00' + n).slice(-2);
|
|
1023
|
+
};
|
|
1024
|
+
/**
|
|
1025
|
+
* Strip out unicode LTR and RTL characters. Edge and IE insert these into formatted dates while
|
|
1026
|
+
* other browsers do not. We remove them to make output consistent and because they interfere with
|
|
1027
|
+
* date parsing.
|
|
1028
|
+
* @param {?} str The string to strip direction characters from.
|
|
1029
|
+
* @return {?} The stripped string.
|
|
1030
|
+
*/
|
|
1031
|
+
NativeDateAdapter.prototype._stripDirectionalityCharacters = function (str) {
|
|
1032
|
+
return str.replace(/[\u200e\u200f]/g, '');
|
|
1033
|
+
};
|
|
1034
|
+
return NativeDateAdapter;
|
|
1035
|
+
}(DateAdapter));
|
|
1036
|
+
NativeDateAdapter.decorators = [
|
|
1037
|
+
{ type: _angular_core.Injectable },
|
|
1038
|
+
];
|
|
1039
|
+
/**
|
|
1040
|
+
* @nocollapse
|
|
1041
|
+
*/
|
|
1042
|
+
NativeDateAdapter.ctorParameters = function () { return [
|
|
1043
|
+
{ type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [MAT_DATE_LOCALE,] },] },
|
|
1044
|
+
]; };
|
|
1045
|
+
var MD_DATE_FORMATS = new _angular_core.InjectionToken('md-date-formats');
|
|
1046
|
+
var MD_NATIVE_DATE_FORMATS = {
|
|
1047
|
+
parse: {
|
|
1048
|
+
dateInput: null,
|
|
1049
|
+
},
|
|
1050
|
+
display: {
|
|
1051
|
+
dateInput: { year: 'numeric', month: 'numeric', day: 'numeric' },
|
|
1052
|
+
monthYearLabel: { year: 'numeric', month: 'short' },
|
|
1053
|
+
dateA11yLabel: { year: 'numeric', month: 'long', day: 'numeric' },
|
|
1054
|
+
monthYearA11yLabel: { year: 'numeric', month: 'long' },
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
var NativeDateModule = (function () {
|
|
1058
|
+
function NativeDateModule() {
|
|
1059
|
+
}
|
|
1060
|
+
return NativeDateModule;
|
|
1061
|
+
}());
|
|
1062
|
+
NativeDateModule.decorators = [
|
|
1063
|
+
{ type: _angular_core.NgModule, args: [{
|
|
1064
|
+
providers: [
|
|
1065
|
+
{ provide: DateAdapter, useClass: NativeDateAdapter },
|
|
1066
|
+
MAT_DATE_LOCALE_PROVIDER
|
|
1067
|
+
],
|
|
1068
|
+
},] },
|
|
1069
|
+
];
|
|
1070
|
+
/**
|
|
1071
|
+
* @nocollapse
|
|
1072
|
+
*/
|
|
1073
|
+
NativeDateModule.ctorParameters = function () { return []; };
|
|
1074
|
+
var MdNativeDateModule = (function () {
|
|
1075
|
+
function MdNativeDateModule() {
|
|
1076
|
+
}
|
|
1077
|
+
return MdNativeDateModule;
|
|
1078
|
+
}());
|
|
1079
|
+
MdNativeDateModule.decorators = [
|
|
1080
|
+
{ type: _angular_core.NgModule, args: [{
|
|
1081
|
+
imports: [NativeDateModule],
|
|
1082
|
+
providers: [{ provide: MD_DATE_FORMATS, useValue: MD_NATIVE_DATE_FORMATS }],
|
|
1083
|
+
},] },
|
|
1084
|
+
];
|
|
1085
|
+
/**
|
|
1086
|
+
* @nocollapse
|
|
1087
|
+
*/
|
|
1088
|
+
MdNativeDateModule.ctorParameters = function () { return []; };
|
|
1089
|
+
/**
|
|
1090
|
+
* Injection token that can be used to specify the global error options.
|
|
1091
|
+
*/
|
|
1092
|
+
var MD_ERROR_GLOBAL_OPTIONS = new _angular_core.InjectionToken('md-error-global-options');
|
|
1093
|
+
var GestureConfig = (function (_super) {
|
|
1094
|
+
__extends(GestureConfig, _super);
|
|
1095
|
+
function GestureConfig() {
|
|
1096
|
+
var _this = _super.call(this) || this;
|
|
1097
|
+
_this._hammer = typeof window !== 'undefined' ? ((window)).Hammer : null;
|
|
1098
|
+
/* List of new event names to add to the gesture support list */
|
|
1099
|
+
_this.events = _this._hammer ? [
|
|
1100
|
+
'longpress',
|
|
1101
|
+
'slide',
|
|
1102
|
+
'slidestart',
|
|
1103
|
+
'slideend',
|
|
1104
|
+
'slideright',
|
|
1105
|
+
'slideleft'
|
|
1106
|
+
] : [];
|
|
1107
|
+
if (!_this._hammer && _angular_core.isDevMode()) {
|
|
1108
|
+
console.warn('Could not find HammerJS. Certain Angular Material ' +
|
|
1109
|
+
'components may not work correctly.');
|
|
1110
|
+
}
|
|
1111
|
+
return _this;
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Builds Hammer instance manually to add custom recognizers that match the Material Design spec.
|
|
1115
|
+
*
|
|
1116
|
+
* Our gesture names come from the Material Design gestures spec:
|
|
1117
|
+
* https://www.google.com/design/spec/patterns/gestures.html#gestures-touch-mechanics
|
|
1118
|
+
*
|
|
1119
|
+
* More information on default recognizers can be found in Hammer docs:
|
|
1120
|
+
* http://hammerjs.github.io/recognizer-pan/
|
|
1121
|
+
* http://hammerjs.github.io/recognizer-press/
|
|
1122
|
+
*
|
|
1123
|
+
* @param {?} element Element to which to assign the new HammerJS gestures.
|
|
1124
|
+
* @return {?} Newly-created HammerJS instance.
|
|
1125
|
+
*/
|
|
1126
|
+
GestureConfig.prototype.buildHammer = function (element) {
|
|
1127
|
+
var /** @type {?} */ mc = new this._hammer(element);
|
|
1128
|
+
// Default Hammer Recognizers.
|
|
1129
|
+
var /** @type {?} */ pan = new this._hammer.Pan();
|
|
1130
|
+
var /** @type {?} */ swipe = new this._hammer.Swipe();
|
|
1131
|
+
var /** @type {?} */ press = new this._hammer.Press();
|
|
1132
|
+
// Notice that a HammerJS recognizer can only depend on one other recognizer once.
|
|
1133
|
+
// Otherwise the previous `recognizeWith` will be dropped.
|
|
1134
|
+
// TODO: Confirm threshold numbers with Material Design UX Team
|
|
1135
|
+
var /** @type {?} */ slide = this._createRecognizer(pan, { event: 'slide', threshold: 0 }, swipe);
|
|
1136
|
+
var /** @type {?} */ longpress = this._createRecognizer(press, { event: 'longpress', time: 500 });
|
|
1137
|
+
// Overwrite the default `pan` event to use the swipe event.
|
|
1138
|
+
pan.recognizeWith(swipe);
|
|
1139
|
+
// Add customized gestures to Hammer manager
|
|
1140
|
+
mc.add([swipe, press, pan, slide, longpress]);
|
|
1141
|
+
return (mc);
|
|
1142
|
+
};
|
|
1143
|
+
/**
|
|
1144
|
+
* Creates a new recognizer, without affecting the default recognizers of HammerJS
|
|
1145
|
+
* @param {?} base
|
|
1146
|
+
* @param {?} options
|
|
1147
|
+
* @param {...?} inheritances
|
|
1148
|
+
* @return {?}
|
|
1149
|
+
*/
|
|
1150
|
+
GestureConfig.prototype._createRecognizer = function (base, options) {
|
|
1151
|
+
var inheritances = [];
|
|
1152
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
1153
|
+
inheritances[_i - 2] = arguments[_i];
|
|
1154
|
+
}
|
|
1155
|
+
var /** @type {?} */ recognizer = new ((base.constructor))(options);
|
|
1156
|
+
inheritances.push(base);
|
|
1157
|
+
inheritances.forEach(function (item) { return recognizer.recognizeWith(item); });
|
|
1158
|
+
return recognizer;
|
|
1159
|
+
};
|
|
1160
|
+
return GestureConfig;
|
|
1161
|
+
}(_angular_platformBrowser.HammerGestureConfig));
|
|
1162
|
+
GestureConfig.decorators = [
|
|
1163
|
+
{ type: _angular_core.Injectable },
|
|
1164
|
+
];
|
|
1165
|
+
/**
|
|
1166
|
+
* @nocollapse
|
|
1167
|
+
*/
|
|
1168
|
+
GestureConfig.ctorParameters = function () { return []; };
|
|
1169
|
+
/**
|
|
1170
|
+
* Shared directive to count lines inside a text area, such as a list item.
|
|
1171
|
+
* Line elements can be extracted with a \@ContentChildren(MdLine) query, then
|
|
1172
|
+
* counted by checking the query list's length.
|
|
1173
|
+
*/
|
|
1174
|
+
var MdLine = (function () {
|
|
1175
|
+
function MdLine() {
|
|
1176
|
+
}
|
|
1177
|
+
return MdLine;
|
|
1178
|
+
}());
|
|
1179
|
+
MdLine.decorators = [
|
|
1180
|
+
{ type: _angular_core.Directive, args: [{
|
|
1181
|
+
selector: '[md-line], [mat-line], [mdLine], [matLine]',
|
|
1182
|
+
host: { 'class': 'mat-line' }
|
|
1183
|
+
},] },
|
|
1184
|
+
];
|
|
1185
|
+
/**
|
|
1186
|
+
* @nocollapse
|
|
1187
|
+
*/
|
|
1188
|
+
MdLine.ctorParameters = function () { return []; };
|
|
1189
|
+
var MdLineModule = (function () {
|
|
1190
|
+
function MdLineModule() {
|
|
1191
|
+
}
|
|
1192
|
+
return MdLineModule;
|
|
1193
|
+
}());
|
|
1194
|
+
MdLineModule.decorators = [
|
|
1195
|
+
{ type: _angular_core.NgModule, args: [{
|
|
1196
|
+
imports: [MdCommonModule],
|
|
1197
|
+
exports: [MdLine, MdCommonModule],
|
|
1198
|
+
declarations: [MdLine],
|
|
1199
|
+
},] },
|
|
1200
|
+
];
|
|
1201
|
+
/**
|
|
1202
|
+
* @nocollapse
|
|
1203
|
+
*/
|
|
1204
|
+
MdLineModule.ctorParameters = function () { return []; };
|
|
1205
|
+
var RippleState = {};
|
|
1206
|
+
RippleState.FADING_IN = 0;
|
|
1207
|
+
RippleState.VISIBLE = 1;
|
|
1208
|
+
RippleState.FADING_OUT = 2;
|
|
1209
|
+
RippleState.HIDDEN = 3;
|
|
1210
|
+
RippleState[RippleState.FADING_IN] = "FADING_IN";
|
|
1211
|
+
RippleState[RippleState.VISIBLE] = "VISIBLE";
|
|
1212
|
+
RippleState[RippleState.FADING_OUT] = "FADING_OUT";
|
|
1213
|
+
RippleState[RippleState.HIDDEN] = "HIDDEN";
|
|
1214
|
+
/**
|
|
1215
|
+
* Reference to a previously launched ripple element.
|
|
1216
|
+
*/
|
|
1217
|
+
var RippleRef = (function () {
|
|
1218
|
+
/**
|
|
1219
|
+
* @param {?} _renderer
|
|
1220
|
+
* @param {?} element
|
|
1221
|
+
* @param {?} config
|
|
1222
|
+
*/
|
|
1223
|
+
function RippleRef(_renderer, element, config) {
|
|
1224
|
+
this._renderer = _renderer;
|
|
1225
|
+
this.element = element;
|
|
1226
|
+
this.config = config;
|
|
1227
|
+
/**
|
|
1228
|
+
* Current state of the ripple reference.
|
|
1229
|
+
*/
|
|
1230
|
+
this.state = RippleState.HIDDEN;
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Fades out the ripple element.
|
|
1234
|
+
* @return {?}
|
|
1235
|
+
*/
|
|
1236
|
+
RippleRef.prototype.fadeOut = function () {
|
|
1237
|
+
this._renderer.fadeOutRipple(this);
|
|
1238
|
+
};
|
|
1239
|
+
return RippleRef;
|
|
1240
|
+
}());
|
|
1241
|
+
/**
|
|
1242
|
+
* Fade-in duration for the ripples. Can be modified with the speedFactor option.
|
|
1243
|
+
*/
|
|
1244
|
+
var RIPPLE_FADE_IN_DURATION = 450;
|
|
1245
|
+
/**
|
|
1246
|
+
* Fade-out duration for the ripples in milliseconds. This can't be modified by the speedFactor.
|
|
1247
|
+
*/
|
|
1248
|
+
var RIPPLE_FADE_OUT_DURATION = 400;
|
|
1249
|
+
/**
|
|
1250
|
+
* Helper service that performs DOM manipulations. Not intended to be used outside this module.
|
|
1251
|
+
* The constructor takes a reference to the ripple directive's host element and a map of DOM
|
|
1252
|
+
* event handlers to be installed on the element that triggers ripple animations.
|
|
1253
|
+
* This will eventually become a custom renderer once Angular support exists.
|
|
1254
|
+
* \@docs-private
|
|
1255
|
+
*/
|
|
1256
|
+
var RippleRenderer = (function () {
|
|
1257
|
+
/**
|
|
1258
|
+
* @param {?} elementRef
|
|
1259
|
+
* @param {?} _ngZone
|
|
1260
|
+
* @param {?} _ruler
|
|
1261
|
+
* @param {?} platform
|
|
1262
|
+
*/
|
|
1263
|
+
function RippleRenderer(elementRef, _ngZone, _ruler, platform) {
|
|
1264
|
+
this._ngZone = _ngZone;
|
|
1265
|
+
this._ruler = _ruler;
|
|
1266
|
+
/**
|
|
1267
|
+
* Whether the mouse is currently down or not.
|
|
1268
|
+
*/
|
|
1269
|
+
this._isMousedown = false;
|
|
1270
|
+
/**
|
|
1271
|
+
* Events to be registered on the trigger element.
|
|
1272
|
+
*/
|
|
1273
|
+
this._triggerEvents = new Map();
|
|
1274
|
+
/**
|
|
1275
|
+
* Set of currently active ripple references.
|
|
1276
|
+
*/
|
|
1277
|
+
this._activeRipples = new Set();
|
|
1278
|
+
/**
|
|
1279
|
+
* Ripple config for all ripples created by events.
|
|
1280
|
+
*/
|
|
1281
|
+
this.rippleConfig = {};
|
|
1282
|
+
/**
|
|
1283
|
+
* Whether mouse ripples should be created or not.
|
|
1284
|
+
*/
|
|
1285
|
+
this.rippleDisabled = false;
|
|
1286
|
+
// Only do anything if we're on the browser.
|
|
1287
|
+
if (platform.isBrowser) {
|
|
1288
|
+
this._containerElement = elementRef.nativeElement;
|
|
1289
|
+
// Specify events which need to be registered on the trigger.
|
|
1290
|
+
this._triggerEvents.set('mousedown', this.onMousedown.bind(this));
|
|
1291
|
+
this._triggerEvents.set('mouseup', this.onMouseup.bind(this));
|
|
1292
|
+
this._triggerEvents.set('mouseleave', this.onMouseLeave.bind(this));
|
|
1293
|
+
// By default use the host element as trigger element.
|
|
1294
|
+
this.setTriggerElement(this._containerElement);
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
/**
|
|
1298
|
+
* Fades in a ripple at the given coordinates.
|
|
1299
|
+
* @param {?} pageX
|
|
1300
|
+
* @param {?} pageY
|
|
1301
|
+
* @param {?=} config
|
|
1302
|
+
* @return {?}
|
|
1303
|
+
*/
|
|
1304
|
+
RippleRenderer.prototype.fadeInRipple = function (pageX, pageY, config) {
|
|
1305
|
+
var _this = this;
|
|
1306
|
+
if (config === void 0) { config = {}; }
|
|
1307
|
+
var /** @type {?} */ containerRect = this._containerElement.getBoundingClientRect();
|
|
1308
|
+
if (config.centered) {
|
|
1309
|
+
pageX = containerRect.left + containerRect.width / 2;
|
|
1310
|
+
pageY = containerRect.top + containerRect.height / 2;
|
|
1311
|
+
}
|
|
1312
|
+
else {
|
|
1313
|
+
// Subtract scroll values from the coordinates because calculations below
|
|
1314
|
+
// are always relative to the viewport rectangle.
|
|
1315
|
+
var /** @type {?} */ scrollPosition = this._ruler.getViewportScrollPosition();
|
|
1316
|
+
pageX -= scrollPosition.left;
|
|
1317
|
+
pageY -= scrollPosition.top;
|
|
1318
|
+
}
|
|
1319
|
+
var /** @type {?} */ radius = config.radius || distanceToFurthestCorner(pageX, pageY, containerRect);
|
|
1320
|
+
var /** @type {?} */ duration = RIPPLE_FADE_IN_DURATION * (1 / (config.speedFactor || 1));
|
|
1321
|
+
var /** @type {?} */ offsetX = pageX - containerRect.left;
|
|
1322
|
+
var /** @type {?} */ offsetY = pageY - containerRect.top;
|
|
1323
|
+
var /** @type {?} */ ripple = document.createElement('div');
|
|
1324
|
+
ripple.classList.add('mat-ripple-element');
|
|
1325
|
+
ripple.style.left = offsetX - radius + "px";
|
|
1326
|
+
ripple.style.top = offsetY - radius + "px";
|
|
1327
|
+
ripple.style.height = radius * 2 + "px";
|
|
1328
|
+
ripple.style.width = radius * 2 + "px";
|
|
1329
|
+
// If the color is not set, the default CSS color will be used.
|
|
1330
|
+
ripple.style.backgroundColor = config.color || null;
|
|
1331
|
+
ripple.style.transitionDuration = duration + "ms";
|
|
1332
|
+
this._containerElement.appendChild(ripple);
|
|
1333
|
+
// By default the browser does not recalculate the styles of dynamically created
|
|
1334
|
+
// ripple elements. This is critical because then the `scale` would not animate properly.
|
|
1335
|
+
enforceStyleRecalculation(ripple);
|
|
1336
|
+
ripple.style.transform = 'scale(1)';
|
|
1337
|
+
// Exposed reference to the ripple that will be returned.
|
|
1338
|
+
var /** @type {?} */ rippleRef = new RippleRef(this, ripple, config);
|
|
1339
|
+
rippleRef.state = RippleState.FADING_IN;
|
|
1340
|
+
// Add the ripple reference to the list of all active ripples.
|
|
1341
|
+
this._activeRipples.add(rippleRef);
|
|
1342
|
+
// Wait for the ripple element to be completely faded in.
|
|
1343
|
+
// Once it's faded in, the ripple can be hidden immediately if the mouse is released.
|
|
1344
|
+
this.runTimeoutOutsideZone(function () {
|
|
1345
|
+
rippleRef.state = RippleState.VISIBLE;
|
|
1346
|
+
if (!config.persistent && !_this._isMousedown) {
|
|
1347
|
+
rippleRef.fadeOut();
|
|
1348
|
+
}
|
|
1349
|
+
}, duration);
|
|
1350
|
+
return rippleRef;
|
|
1351
|
+
};
|
|
1352
|
+
/**
|
|
1353
|
+
* Fades out a ripple reference.
|
|
1354
|
+
* @param {?} rippleRef
|
|
1355
|
+
* @return {?}
|
|
1356
|
+
*/
|
|
1357
|
+
RippleRenderer.prototype.fadeOutRipple = function (rippleRef) {
|
|
1358
|
+
// For ripples that are not active anymore, don't re-un the fade-out animation.
|
|
1359
|
+
if (!this._activeRipples.delete(rippleRef)) {
|
|
1360
|
+
return;
|
|
1361
|
+
}
|
|
1362
|
+
var /** @type {?} */ rippleEl = rippleRef.element;
|
|
1363
|
+
rippleEl.style.transitionDuration = RIPPLE_FADE_OUT_DURATION + "ms";
|
|
1364
|
+
rippleEl.style.opacity = '0';
|
|
1365
|
+
rippleRef.state = RippleState.FADING_OUT;
|
|
1366
|
+
// Once the ripple faded out, the ripple can be safely removed from the DOM.
|
|
1367
|
+
this.runTimeoutOutsideZone(function () {
|
|
1368
|
+
rippleRef.state = RippleState.HIDDEN; /** @type {?} */
|
|
1369
|
+
((rippleEl.parentNode)).removeChild(rippleEl);
|
|
1370
|
+
}, RIPPLE_FADE_OUT_DURATION);
|
|
1371
|
+
};
|
|
1372
|
+
/**
|
|
1373
|
+
* Fades out all currently active ripples.
|
|
1374
|
+
* @return {?}
|
|
1375
|
+
*/
|
|
1376
|
+
RippleRenderer.prototype.fadeOutAll = function () {
|
|
1377
|
+
this._activeRipples.forEach(function (ripple) { return ripple.fadeOut(); });
|
|
1378
|
+
};
|
|
1379
|
+
/**
|
|
1380
|
+
* Sets the trigger element and registers the mouse events.
|
|
1381
|
+
* @param {?} element
|
|
1382
|
+
* @return {?}
|
|
1383
|
+
*/
|
|
1384
|
+
RippleRenderer.prototype.setTriggerElement = function (element) {
|
|
1385
|
+
var _this = this;
|
|
1386
|
+
// Remove all previously register event listeners from the trigger element.
|
|
1387
|
+
if (this._triggerElement) {
|
|
1388
|
+
this._triggerEvents.forEach(function (fn, type) {
|
|
1389
|
+
((_this._triggerElement)).removeEventListener(type, fn);
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
if (element) {
|
|
1393
|
+
// If the element is not null, register all event listeners on the trigger element.
|
|
1394
|
+
this._ngZone.runOutsideAngular(function () {
|
|
1395
|
+
_this._triggerEvents.forEach(function (fn, type) { return element.addEventListener(type, fn); });
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
this._triggerElement = element;
|
|
1399
|
+
};
|
|
1400
|
+
/**
|
|
1401
|
+
* Listener being called on mousedown event.
|
|
1402
|
+
* @param {?} event
|
|
1403
|
+
* @return {?}
|
|
1404
|
+
*/
|
|
1405
|
+
RippleRenderer.prototype.onMousedown = function (event) {
|
|
1406
|
+
if (!this.rippleDisabled) {
|
|
1407
|
+
this._isMousedown = true;
|
|
1408
|
+
this.fadeInRipple(event.pageX, event.pageY, this.rippleConfig);
|
|
1409
|
+
}
|
|
1410
|
+
};
|
|
1411
|
+
/**
|
|
1412
|
+
* Listener being called on mouseup event.
|
|
1413
|
+
* @return {?}
|
|
1414
|
+
*/
|
|
1415
|
+
RippleRenderer.prototype.onMouseup = function () {
|
|
1416
|
+
this._isMousedown = false;
|
|
1417
|
+
// Fade-out all ripples that are completely visible and not persistent.
|
|
1418
|
+
this._activeRipples.forEach(function (ripple) {
|
|
1419
|
+
if (!ripple.config.persistent && ripple.state === RippleState.VISIBLE) {
|
|
1420
|
+
ripple.fadeOut();
|
|
1421
|
+
}
|
|
1422
|
+
});
|
|
1423
|
+
};
|
|
1424
|
+
/**
|
|
1425
|
+
* Listener being called on mouseleave event.
|
|
1426
|
+
* @return {?}
|
|
1427
|
+
*/
|
|
1428
|
+
RippleRenderer.prototype.onMouseLeave = function () {
|
|
1429
|
+
if (this._isMousedown) {
|
|
1430
|
+
this.onMouseup();
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
/**
|
|
1434
|
+
* Runs a timeout outside of the Angular zone to avoid triggering the change detection.
|
|
1435
|
+
* @param {?} fn
|
|
1436
|
+
* @param {?=} delay
|
|
1437
|
+
* @return {?}
|
|
1438
|
+
*/
|
|
1439
|
+
RippleRenderer.prototype.runTimeoutOutsideZone = function (fn, delay) {
|
|
1440
|
+
if (delay === void 0) { delay = 0; }
|
|
1441
|
+
this._ngZone.runOutsideAngular(function () { return setTimeout(fn, delay); });
|
|
1442
|
+
};
|
|
1443
|
+
return RippleRenderer;
|
|
1444
|
+
}());
|
|
1445
|
+
/**
|
|
1446
|
+
* @param {?} element
|
|
1447
|
+
* @return {?}
|
|
1448
|
+
*/
|
|
1449
|
+
function enforceStyleRecalculation(element) {
|
|
1450
|
+
// Enforce a style recalculation by calling `getComputedStyle` and accessing any property.
|
|
1451
|
+
// Calling `getPropertyValue` is important to let optimizers know that this is not a noop.
|
|
1452
|
+
// See: https://gist.github.com/paulirish/5d52fb081b3570c81e3a
|
|
1453
|
+
window.getComputedStyle(element).getPropertyValue('opacity');
|
|
1454
|
+
}
|
|
1455
|
+
/**
|
|
1456
|
+
* Returns the distance from the point (x, y) to the furthest corner of a rectangle.
|
|
1457
|
+
* @param {?} x
|
|
1458
|
+
* @param {?} y
|
|
1459
|
+
* @param {?} rect
|
|
1460
|
+
* @return {?}
|
|
1461
|
+
*/
|
|
1462
|
+
function distanceToFurthestCorner(x, y, rect) {
|
|
1463
|
+
var /** @type {?} */ distX = Math.max(Math.abs(x - rect.left), Math.abs(x - rect.right));
|
|
1464
|
+
var /** @type {?} */ distY = Math.max(Math.abs(y - rect.top), Math.abs(y - rect.bottom));
|
|
1465
|
+
return Math.sqrt(distX * distX + distY * distY);
|
|
1466
|
+
}
|
|
1467
|
+
/**
|
|
1468
|
+
* Injection token that can be used to specify the global ripple options.
|
|
1469
|
+
*/
|
|
1470
|
+
var MD_RIPPLE_GLOBAL_OPTIONS = new _angular_core.InjectionToken('md-ripple-global-options');
|
|
1471
|
+
var MdRipple = (function () {
|
|
1472
|
+
/**
|
|
1473
|
+
* @param {?} elementRef
|
|
1474
|
+
* @param {?} ngZone
|
|
1475
|
+
* @param {?} ruler
|
|
1476
|
+
* @param {?} platform
|
|
1477
|
+
* @param {?} globalOptions
|
|
1478
|
+
*/
|
|
1479
|
+
function MdRipple(elementRef, ngZone, ruler, platform, globalOptions) {
|
|
1480
|
+
/**
|
|
1481
|
+
* If set, the radius in pixels of foreground ripples when fully expanded. If unset, the radius
|
|
1482
|
+
* will be the distance from the center of the ripple to the furthest corner of the host element's
|
|
1483
|
+
* bounding rectangle.
|
|
1484
|
+
*/
|
|
1485
|
+
this.radius = 0;
|
|
1486
|
+
/**
|
|
1487
|
+
* If set, the normal duration of ripple animations is divided by this value. For example,
|
|
1488
|
+
* setting it to 0.5 will cause the animations to take twice as long.
|
|
1489
|
+
* A changed speedFactor will not modify the fade-out duration of the ripples.
|
|
1490
|
+
*/
|
|
1491
|
+
this.speedFactor = 1;
|
|
1492
|
+
this._rippleRenderer = new RippleRenderer(elementRef, ngZone, ruler, platform);
|
|
1493
|
+
this._globalOptions = globalOptions ? globalOptions : {};
|
|
1494
|
+
this._updateRippleRenderer();
|
|
1495
|
+
}
|
|
1496
|
+
Object.defineProperty(MdRipple.prototype, "_matRippleTrigger", {
|
|
1497
|
+
/**
|
|
1498
|
+
* @return {?}
|
|
1499
|
+
*/
|
|
1500
|
+
get: function () { return this.trigger; },
|
|
1501
|
+
/**
|
|
1502
|
+
* @param {?} v
|
|
1503
|
+
* @return {?}
|
|
1504
|
+
*/
|
|
1505
|
+
set: function (v) { this.trigger = v; },
|
|
1506
|
+
enumerable: true,
|
|
1507
|
+
configurable: true
|
|
1508
|
+
});
|
|
1509
|
+
Object.defineProperty(MdRipple.prototype, "_matRippleCentered", {
|
|
1510
|
+
/**
|
|
1511
|
+
* @return {?}
|
|
1512
|
+
*/
|
|
1513
|
+
get: function () { return this.centered; },
|
|
1514
|
+
/**
|
|
1515
|
+
* @param {?} v
|
|
1516
|
+
* @return {?}
|
|
1517
|
+
*/
|
|
1518
|
+
set: function (v) { this.centered = v; },
|
|
1519
|
+
enumerable: true,
|
|
1520
|
+
configurable: true
|
|
1521
|
+
});
|
|
1522
|
+
Object.defineProperty(MdRipple.prototype, "_matRippleDisabled", {
|
|
1523
|
+
/**
|
|
1524
|
+
* @return {?}
|
|
1525
|
+
*/
|
|
1526
|
+
get: function () { return this.disabled; },
|
|
1527
|
+
/**
|
|
1528
|
+
* @param {?} v
|
|
1529
|
+
* @return {?}
|
|
1530
|
+
*/
|
|
1531
|
+
set: function (v) { this.disabled = v; },
|
|
1532
|
+
enumerable: true,
|
|
1533
|
+
configurable: true
|
|
1534
|
+
});
|
|
1535
|
+
Object.defineProperty(MdRipple.prototype, "_matRippleRadius", {
|
|
1536
|
+
/**
|
|
1537
|
+
* @return {?}
|
|
1538
|
+
*/
|
|
1539
|
+
get: function () { return this.radius; },
|
|
1540
|
+
/**
|
|
1541
|
+
* @param {?} v
|
|
1542
|
+
* @return {?}
|
|
1543
|
+
*/
|
|
1544
|
+
set: function (v) { this.radius = v; },
|
|
1545
|
+
enumerable: true,
|
|
1546
|
+
configurable: true
|
|
1547
|
+
});
|
|
1548
|
+
Object.defineProperty(MdRipple.prototype, "_matRippleSpeedFactor", {
|
|
1549
|
+
/**
|
|
1550
|
+
* @return {?}
|
|
1551
|
+
*/
|
|
1552
|
+
get: function () { return this.speedFactor; },
|
|
1553
|
+
/**
|
|
1554
|
+
* @param {?} v
|
|
1555
|
+
* @return {?}
|
|
1556
|
+
*/
|
|
1557
|
+
set: function (v) { this.speedFactor = v; },
|
|
1558
|
+
enumerable: true,
|
|
1559
|
+
configurable: true
|
|
1560
|
+
});
|
|
1561
|
+
Object.defineProperty(MdRipple.prototype, "_matRippleColor", {
|
|
1562
|
+
/**
|
|
1563
|
+
* @return {?}
|
|
1564
|
+
*/
|
|
1565
|
+
get: function () { return this.color; },
|
|
1566
|
+
/**
|
|
1567
|
+
* @param {?} v
|
|
1568
|
+
* @return {?}
|
|
1569
|
+
*/
|
|
1570
|
+
set: function (v) { this.color = v; },
|
|
1571
|
+
enumerable: true,
|
|
1572
|
+
configurable: true
|
|
1573
|
+
});
|
|
1574
|
+
Object.defineProperty(MdRipple.prototype, "_matRippleUnbounded", {
|
|
1575
|
+
/**
|
|
1576
|
+
* @return {?}
|
|
1577
|
+
*/
|
|
1578
|
+
get: function () { return this.unbounded; },
|
|
1579
|
+
/**
|
|
1580
|
+
* @param {?} v
|
|
1581
|
+
* @return {?}
|
|
1582
|
+
*/
|
|
1583
|
+
set: function (v) { this.unbounded = v; },
|
|
1584
|
+
enumerable: true,
|
|
1585
|
+
configurable: true
|
|
1586
|
+
});
|
|
1587
|
+
/**
|
|
1588
|
+
* @param {?} changes
|
|
1589
|
+
* @return {?}
|
|
1590
|
+
*/
|
|
1591
|
+
MdRipple.prototype.ngOnChanges = function (changes) {
|
|
1592
|
+
if ((changes['trigger'] || changes['_matRippleTrigger']) && this.trigger) {
|
|
1593
|
+
this._rippleRenderer.setTriggerElement(this.trigger);
|
|
1594
|
+
}
|
|
1595
|
+
this._updateRippleRenderer();
|
|
1596
|
+
};
|
|
1597
|
+
/**
|
|
1598
|
+
* @return {?}
|
|
1599
|
+
*/
|
|
1600
|
+
MdRipple.prototype.ngOnDestroy = function () {
|
|
1601
|
+
// Set the trigger element to null to cleanup all listeners.
|
|
1602
|
+
this._rippleRenderer.setTriggerElement(null);
|
|
1603
|
+
};
|
|
1604
|
+
/**
|
|
1605
|
+
* Launches a manual ripple at the specified position.
|
|
1606
|
+
* @param {?} pageX
|
|
1607
|
+
* @param {?} pageY
|
|
1608
|
+
* @param {?=} config
|
|
1609
|
+
* @return {?}
|
|
1610
|
+
*/
|
|
1611
|
+
MdRipple.prototype.launch = function (pageX, pageY, config) {
|
|
1612
|
+
if (config === void 0) { config = this.rippleConfig; }
|
|
1613
|
+
return this._rippleRenderer.fadeInRipple(pageX, pageY, config);
|
|
1614
|
+
};
|
|
1615
|
+
/**
|
|
1616
|
+
* Fades out all currently showing ripple elements.
|
|
1617
|
+
* @return {?}
|
|
1618
|
+
*/
|
|
1619
|
+
MdRipple.prototype.fadeOutAll = function () {
|
|
1620
|
+
this._rippleRenderer.fadeOutAll();
|
|
1621
|
+
};
|
|
1622
|
+
Object.defineProperty(MdRipple.prototype, "rippleConfig", {
|
|
1623
|
+
/**
|
|
1624
|
+
* Ripple configuration from the directive's input values.
|
|
1625
|
+
* @return {?}
|
|
1626
|
+
*/
|
|
1627
|
+
get: function () {
|
|
1628
|
+
return {
|
|
1629
|
+
centered: this.centered,
|
|
1630
|
+
speedFactor: this.speedFactor * (this._globalOptions.baseSpeedFactor || 1),
|
|
1631
|
+
radius: this.radius,
|
|
1632
|
+
color: this.color
|
|
1633
|
+
};
|
|
1634
|
+
},
|
|
1635
|
+
enumerable: true,
|
|
1636
|
+
configurable: true
|
|
1637
|
+
});
|
|
1638
|
+
/**
|
|
1639
|
+
* Updates the ripple renderer with the latest ripple configuration.
|
|
1640
|
+
* @return {?}
|
|
1641
|
+
*/
|
|
1642
|
+
MdRipple.prototype._updateRippleRenderer = function () {
|
|
1643
|
+
this._rippleRenderer.rippleDisabled = this._globalOptions.disabled || this.disabled;
|
|
1644
|
+
this._rippleRenderer.rippleConfig = this.rippleConfig;
|
|
1645
|
+
};
|
|
1646
|
+
return MdRipple;
|
|
1647
|
+
}());
|
|
1648
|
+
MdRipple.decorators = [
|
|
1649
|
+
{ type: _angular_core.Directive, args: [{
|
|
1650
|
+
selector: '[md-ripple], [mat-ripple], [mdRipple], [matRipple]',
|
|
1651
|
+
exportAs: 'mdRipple, matRipple',
|
|
1652
|
+
host: {
|
|
1653
|
+
'class': 'mat-ripple',
|
|
1654
|
+
'[class.mat-ripple-unbounded]': 'unbounded'
|
|
1655
|
+
}
|
|
1656
|
+
},] },
|
|
1657
|
+
];
|
|
1658
|
+
/**
|
|
1659
|
+
* @nocollapse
|
|
1660
|
+
*/
|
|
1661
|
+
MdRipple.ctorParameters = function () { return [
|
|
1662
|
+
{ type: _angular_core.ElementRef, },
|
|
1663
|
+
{ type: _angular_core.NgZone, },
|
|
1664
|
+
{ type: _angular_cdk_scrolling.ViewportRuler, },
|
|
1665
|
+
{ type: _angular_cdk_platform.Platform, },
|
|
1666
|
+
{ type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [MD_RIPPLE_GLOBAL_OPTIONS,] },] },
|
|
1667
|
+
]; };
|
|
1668
|
+
MdRipple.propDecorators = {
|
|
1669
|
+
'trigger': [{ type: _angular_core.Input, args: ['mdRippleTrigger',] },],
|
|
1670
|
+
'centered': [{ type: _angular_core.Input, args: ['mdRippleCentered',] },],
|
|
1671
|
+
'disabled': [{ type: _angular_core.Input, args: ['mdRippleDisabled',] },],
|
|
1672
|
+
'radius': [{ type: _angular_core.Input, args: ['mdRippleRadius',] },],
|
|
1673
|
+
'speedFactor': [{ type: _angular_core.Input, args: ['mdRippleSpeedFactor',] },],
|
|
1674
|
+
'color': [{ type: _angular_core.Input, args: ['mdRippleColor',] },],
|
|
1675
|
+
'unbounded': [{ type: _angular_core.Input, args: ['mdRippleUnbounded',] },],
|
|
1676
|
+
'_matRippleTrigger': [{ type: _angular_core.Input, args: ['matRippleTrigger',] },],
|
|
1677
|
+
'_matRippleCentered': [{ type: _angular_core.Input, args: ['matRippleCentered',] },],
|
|
1678
|
+
'_matRippleDisabled': [{ type: _angular_core.Input, args: ['matRippleDisabled',] },],
|
|
1679
|
+
'_matRippleRadius': [{ type: _angular_core.Input, args: ['matRippleRadius',] },],
|
|
1680
|
+
'_matRippleSpeedFactor': [{ type: _angular_core.Input, args: ['matRippleSpeedFactor',] },],
|
|
1681
|
+
'_matRippleColor': [{ type: _angular_core.Input, args: ['matRippleColor',] },],
|
|
1682
|
+
'_matRippleUnbounded': [{ type: _angular_core.Input, args: ['matRippleUnbounded',] },],
|
|
1683
|
+
};
|
|
1684
|
+
var MdRippleModule = (function () {
|
|
1685
|
+
function MdRippleModule() {
|
|
1686
|
+
}
|
|
1687
|
+
return MdRippleModule;
|
|
1688
|
+
}());
|
|
1689
|
+
MdRippleModule.decorators = [
|
|
1690
|
+
{ type: _angular_core.NgModule, args: [{
|
|
1691
|
+
imports: [MdCommonModule, _angular_cdk_platform.PlatformModule, _angular_cdk_scrolling.ScrollDispatchModule],
|
|
1692
|
+
exports: [MdRipple, MdCommonModule],
|
|
1693
|
+
declarations: [MdRipple],
|
|
1694
|
+
providers: [_angular_cdk_scrolling.VIEWPORT_RULER_PROVIDER],
|
|
1695
|
+
},] },
|
|
1696
|
+
];
|
|
1697
|
+
/**
|
|
1698
|
+
* @nocollapse
|
|
1699
|
+
*/
|
|
1700
|
+
MdRippleModule.ctorParameters = function () { return []; };
|
|
1701
|
+
/**
|
|
1702
|
+
* Component that shows a simplified checkbox without including any kind of "real" checkbox.
|
|
1703
|
+
* Meant to be used when the checkbox is purely decorative and a large number of them will be
|
|
1704
|
+
* included, such as for the options in a multi-select. Uses no SVGs or complex animations.
|
|
1705
|
+
* Note that theming is meant to be handled by the parent element, e.g.
|
|
1706
|
+
* `mat-primary .mat-pseudo-checkbox`.
|
|
1707
|
+
*
|
|
1708
|
+
* Note that this component will be completely invisible to screen-reader users. This is *not*
|
|
1709
|
+
* interchangeable with <md-checkbox> and should *not* be used if the user would directly interact
|
|
1710
|
+
* with the checkbox. The pseudo-checkbox should only be used as an implementation detail of
|
|
1711
|
+
* more complex components that appropriately handle selected / checked state.
|
|
1712
|
+
* \@docs-private
|
|
1713
|
+
*/
|
|
1714
|
+
var MdPseudoCheckbox = (function () {
|
|
1715
|
+
function MdPseudoCheckbox() {
|
|
1716
|
+
/**
|
|
1717
|
+
* Display state of the checkbox.
|
|
1718
|
+
*/
|
|
1719
|
+
this.state = 'unchecked';
|
|
1720
|
+
/**
|
|
1721
|
+
* Whether the checkbox is disabled.
|
|
1722
|
+
*/
|
|
1723
|
+
this.disabled = false;
|
|
1724
|
+
}
|
|
1725
|
+
return MdPseudoCheckbox;
|
|
1726
|
+
}());
|
|
1727
|
+
MdPseudoCheckbox.decorators = [
|
|
1728
|
+
{ type: _angular_core.Component, args: [{ encapsulation: _angular_core.ViewEncapsulation.None,
|
|
1729
|
+
preserveWhitespaces: false,
|
|
1730
|
+
changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
|
|
1731
|
+
selector: 'md-pseudo-checkbox, mat-pseudo-checkbox',
|
|
1732
|
+
styles: [".mat-pseudo-checkbox{width:20px;height:20px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0,0,.2,.1),background-color 90ms cubic-bezier(0,0,.2,.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:'';border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0,0,.2,.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:9px;left:2px;width:16px;opacity:1}.mat-pseudo-checkbox-checked::after{top:5px;left:3px;width:12px;height:5px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1}"],
|
|
1733
|
+
template: '',
|
|
1734
|
+
host: {
|
|
1735
|
+
'class': 'mat-pseudo-checkbox',
|
|
1736
|
+
'[class.mat-pseudo-checkbox-indeterminate]': 'state === "indeterminate"',
|
|
1737
|
+
'[class.mat-pseudo-checkbox-checked]': 'state === "checked"',
|
|
1738
|
+
'[class.mat-pseudo-checkbox-disabled]': 'disabled',
|
|
1739
|
+
},
|
|
1740
|
+
},] },
|
|
1741
|
+
];
|
|
1742
|
+
/**
|
|
1743
|
+
* @nocollapse
|
|
1744
|
+
*/
|
|
1745
|
+
MdPseudoCheckbox.ctorParameters = function () { return []; };
|
|
1746
|
+
MdPseudoCheckbox.propDecorators = {
|
|
1747
|
+
'state': [{ type: _angular_core.Input },],
|
|
1748
|
+
'disabled': [{ type: _angular_core.Input },],
|
|
1749
|
+
};
|
|
1750
|
+
var MdPseudoCheckboxModule = (function () {
|
|
1751
|
+
function MdPseudoCheckboxModule() {
|
|
1752
|
+
}
|
|
1753
|
+
return MdPseudoCheckboxModule;
|
|
1754
|
+
}());
|
|
1755
|
+
MdPseudoCheckboxModule.decorators = [
|
|
1756
|
+
{ type: _angular_core.NgModule, args: [{
|
|
1757
|
+
exports: [MdPseudoCheckbox],
|
|
1758
|
+
declarations: [MdPseudoCheckbox]
|
|
1759
|
+
},] },
|
|
1760
|
+
];
|
|
1761
|
+
/**
|
|
1762
|
+
* @nocollapse
|
|
1763
|
+
*/
|
|
1764
|
+
MdPseudoCheckboxModule.ctorParameters = function () { return []; };
|
|
1765
|
+
/**
|
|
1766
|
+
* \@docs-private
|
|
1767
|
+
*/
|
|
1768
|
+
var MdOptgroupBase = (function () {
|
|
1769
|
+
function MdOptgroupBase() {
|
|
1770
|
+
}
|
|
1771
|
+
return MdOptgroupBase;
|
|
1772
|
+
}());
|
|
1773
|
+
var _MdOptgroupMixinBase = mixinDisabled(MdOptgroupBase);
|
|
1774
|
+
// Counter for unique group ids.
|
|
1775
|
+
var _uniqueOptgroupIdCounter = 0;
|
|
1776
|
+
/**
|
|
1777
|
+
* Component that is used to group instances of `md-option`.
|
|
1778
|
+
*/
|
|
1779
|
+
var MdOptgroup = (function (_super) {
|
|
1780
|
+
__extends(MdOptgroup, _super);
|
|
1781
|
+
function MdOptgroup() {
|
|
1782
|
+
var _this = _super.apply(this, arguments) || this;
|
|
1783
|
+
/**
|
|
1784
|
+
* Unique id for the underlying label.
|
|
1785
|
+
*/
|
|
1786
|
+
_this._labelId = "mat-optgroup-label-" + _uniqueOptgroupIdCounter++;
|
|
1787
|
+
return _this;
|
|
1788
|
+
}
|
|
1789
|
+
return MdOptgroup;
|
|
1790
|
+
}(_MdOptgroupMixinBase));
|
|
1791
|
+
MdOptgroup.decorators = [
|
|
1792
|
+
{ type: _angular_core.Component, args: [{ selector: 'md-optgroup, mat-optgroup',
|
|
1793
|
+
template: "<label class=\"mat-optgroup-label\" [id]=\"_labelId\">{{ label }}</label><ng-content select=\"md-option, mat-option\"></ng-content>",
|
|
1794
|
+
encapsulation: _angular_core.ViewEncapsulation.None,
|
|
1795
|
+
preserveWhitespaces: false,
|
|
1796
|
+
changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
|
|
1797
|
+
inputs: ['disabled'],
|
|
1798
|
+
host: {
|
|
1799
|
+
'class': 'mat-optgroup',
|
|
1800
|
+
'role': 'group',
|
|
1801
|
+
'[class.mat-optgroup-disabled]': 'disabled',
|
|
1802
|
+
'[attr.aria-disabled]': 'disabled.toString()',
|
|
1803
|
+
'[attr.aria-labelledby]': '_labelId',
|
|
1804
|
+
}
|
|
1805
|
+
},] },
|
|
1806
|
+
];
|
|
1807
|
+
/**
|
|
1808
|
+
* @nocollapse
|
|
1809
|
+
*/
|
|
1810
|
+
MdOptgroup.ctorParameters = function () { return []; };
|
|
1811
|
+
MdOptgroup.propDecorators = {
|
|
1812
|
+
'label': [{ type: _angular_core.Input },],
|
|
1813
|
+
};
|
|
1814
|
+
/**
|
|
1815
|
+
* Option IDs need to be unique across components, so this counter exists outside of
|
|
1816
|
+
* the component definition.
|
|
1817
|
+
*/
|
|
1818
|
+
var _uniqueIdCounter = 0;
|
|
1819
|
+
/**
|
|
1820
|
+
* Event object emitted by MdOption when selected or deselected.
|
|
1821
|
+
*/
|
|
1822
|
+
var MdOptionSelectionChange = (function () {
|
|
1823
|
+
/**
|
|
1824
|
+
* @param {?} source
|
|
1825
|
+
* @param {?=} isUserInput
|
|
1826
|
+
*/
|
|
1827
|
+
function MdOptionSelectionChange(source, isUserInput) {
|
|
1828
|
+
if (isUserInput === void 0) { isUserInput = false; }
|
|
1829
|
+
this.source = source;
|
|
1830
|
+
this.isUserInput = isUserInput;
|
|
1831
|
+
}
|
|
1832
|
+
return MdOptionSelectionChange;
|
|
1833
|
+
}());
|
|
1834
|
+
/**
|
|
1835
|
+
* Single option inside of a `<md-select>` element.
|
|
1836
|
+
*/
|
|
1837
|
+
var MdOption = (function () {
|
|
1838
|
+
/**
|
|
1839
|
+
* @param {?} _element
|
|
1840
|
+
* @param {?} _changeDetectorRef
|
|
1841
|
+
* @param {?} group
|
|
1842
|
+
*/
|
|
1843
|
+
function MdOption(_element, _changeDetectorRef, group) {
|
|
1844
|
+
this._element = _element;
|
|
1845
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
1846
|
+
this.group = group;
|
|
1847
|
+
this._selected = false;
|
|
1848
|
+
this._active = false;
|
|
1849
|
+
this._multiple = false;
|
|
1850
|
+
this._disableRipple = false;
|
|
1851
|
+
/**
|
|
1852
|
+
* Whether the option is disabled.
|
|
1853
|
+
*/
|
|
1854
|
+
this._disabled = false;
|
|
1855
|
+
this._id = "md-option-" + _uniqueIdCounter++;
|
|
1856
|
+
/**
|
|
1857
|
+
* Event emitted when the option is selected or deselected.
|
|
1858
|
+
*/
|
|
1859
|
+
this.onSelectionChange = new _angular_core.EventEmitter();
|
|
1860
|
+
}
|
|
1861
|
+
Object.defineProperty(MdOption.prototype, "multiple", {
|
|
1862
|
+
/**
|
|
1863
|
+
* Whether the wrapping component is in multiple selection mode.
|
|
1864
|
+
* @return {?}
|
|
1865
|
+
*/
|
|
1866
|
+
get: function () { return this._multiple; },
|
|
1867
|
+
/**
|
|
1868
|
+
* @param {?} value
|
|
1869
|
+
* @return {?}
|
|
1870
|
+
*/
|
|
1871
|
+
set: function (value) {
|
|
1872
|
+
if (value !== this._multiple) {
|
|
1873
|
+
this._multiple = value;
|
|
1874
|
+
this._changeDetectorRef.markForCheck();
|
|
1875
|
+
}
|
|
1876
|
+
},
|
|
1877
|
+
enumerable: true,
|
|
1878
|
+
configurable: true
|
|
1879
|
+
});
|
|
1880
|
+
Object.defineProperty(MdOption.prototype, "id", {
|
|
1881
|
+
/**
|
|
1882
|
+
* The unique ID of the option.
|
|
1883
|
+
* @return {?}
|
|
1884
|
+
*/
|
|
1885
|
+
get: function () { return this._id; },
|
|
1886
|
+
enumerable: true,
|
|
1887
|
+
configurable: true
|
|
1888
|
+
});
|
|
1889
|
+
Object.defineProperty(MdOption.prototype, "selected", {
|
|
1890
|
+
/**
|
|
1891
|
+
* Whether or not the option is currently selected.
|
|
1892
|
+
* @return {?}
|
|
1893
|
+
*/
|
|
1894
|
+
get: function () { return this._selected; },
|
|
1895
|
+
enumerable: true,
|
|
1896
|
+
configurable: true
|
|
1897
|
+
});
|
|
1898
|
+
Object.defineProperty(MdOption.prototype, "disabled", {
|
|
1899
|
+
/**
|
|
1900
|
+
* Whether the option is disabled.
|
|
1901
|
+
* @return {?}
|
|
1902
|
+
*/
|
|
1903
|
+
get: function () { return (this.group && this.group.disabled) || this._disabled; },
|
|
1904
|
+
/**
|
|
1905
|
+
* @param {?} value
|
|
1906
|
+
* @return {?}
|
|
1907
|
+
*/
|
|
1908
|
+
set: function (value) { this._disabled = _angular_cdk_coercion.coerceBooleanProperty(value); },
|
|
1909
|
+
enumerable: true,
|
|
1910
|
+
configurable: true
|
|
1911
|
+
});
|
|
1912
|
+
Object.defineProperty(MdOption.prototype, "disableRipple", {
|
|
1913
|
+
/**
|
|
1914
|
+
* Whether ripples for the option are disabled.
|
|
1915
|
+
* @return {?}
|
|
1916
|
+
*/
|
|
1917
|
+
get: function () { return this._disableRipple; },
|
|
1918
|
+
/**
|
|
1919
|
+
* @param {?} value
|
|
1920
|
+
* @return {?}
|
|
1921
|
+
*/
|
|
1922
|
+
set: function (value) {
|
|
1923
|
+
this._disableRipple = value;
|
|
1924
|
+
this._changeDetectorRef.markForCheck();
|
|
1925
|
+
},
|
|
1926
|
+
enumerable: true,
|
|
1927
|
+
configurable: true
|
|
1928
|
+
});
|
|
1929
|
+
Object.defineProperty(MdOption.prototype, "active", {
|
|
1930
|
+
/**
|
|
1931
|
+
* Whether or not the option is currently active and ready to be selected.
|
|
1932
|
+
* An active option displays styles as if it is focused, but the
|
|
1933
|
+
* focus is actually retained somewhere else. This comes in handy
|
|
1934
|
+
* for components like autocomplete where focus must remain on the input.
|
|
1935
|
+
* @return {?}
|
|
1936
|
+
*/
|
|
1937
|
+
get: function () {
|
|
1938
|
+
return this._active;
|
|
1939
|
+
},
|
|
1940
|
+
enumerable: true,
|
|
1941
|
+
configurable: true
|
|
1942
|
+
});
|
|
1943
|
+
Object.defineProperty(MdOption.prototype, "viewValue", {
|
|
1944
|
+
/**
|
|
1945
|
+
* The displayed value of the option. It is necessary to show the selected option in the
|
|
1946
|
+
* select's trigger.
|
|
1947
|
+
* @return {?}
|
|
1948
|
+
*/
|
|
1949
|
+
get: function () {
|
|
1950
|
+
// TODO(kara): Add input property alternative for node envs.
|
|
1951
|
+
return (this._getHostElement().textContent || '').trim();
|
|
1952
|
+
},
|
|
1953
|
+
enumerable: true,
|
|
1954
|
+
configurable: true
|
|
1955
|
+
});
|
|
1956
|
+
/**
|
|
1957
|
+
* Selects the option.
|
|
1958
|
+
* @return {?}
|
|
1959
|
+
*/
|
|
1960
|
+
MdOption.prototype.select = function () {
|
|
1961
|
+
this._selected = true;
|
|
1962
|
+
this._changeDetectorRef.markForCheck();
|
|
1963
|
+
this._emitSelectionChangeEvent();
|
|
1964
|
+
};
|
|
1965
|
+
/**
|
|
1966
|
+
* Deselects the option.
|
|
1967
|
+
* @return {?}
|
|
1968
|
+
*/
|
|
1969
|
+
MdOption.prototype.deselect = function () {
|
|
1970
|
+
this._selected = false;
|
|
1971
|
+
this._changeDetectorRef.markForCheck();
|
|
1972
|
+
this._emitSelectionChangeEvent();
|
|
1973
|
+
};
|
|
1974
|
+
/**
|
|
1975
|
+
* Sets focus onto this option.
|
|
1976
|
+
* @return {?}
|
|
1977
|
+
*/
|
|
1978
|
+
MdOption.prototype.focus = function () {
|
|
1979
|
+
var /** @type {?} */ element = this._getHostElement();
|
|
1980
|
+
if (typeof element.focus === 'function') {
|
|
1981
|
+
element.focus();
|
|
1982
|
+
}
|
|
1983
|
+
};
|
|
1984
|
+
/**
|
|
1985
|
+
* This method sets display styles on the option to make it appear
|
|
1986
|
+
* active. This is used by the ActiveDescendantKeyManager so key
|
|
1987
|
+
* events will display the proper options as active on arrow key events.
|
|
1988
|
+
* @return {?}
|
|
1989
|
+
*/
|
|
1990
|
+
MdOption.prototype.setActiveStyles = function () {
|
|
1991
|
+
if (!this._active) {
|
|
1992
|
+
this._active = true;
|
|
1993
|
+
this._changeDetectorRef.markForCheck();
|
|
1994
|
+
}
|
|
1995
|
+
};
|
|
1996
|
+
/**
|
|
1997
|
+
* This method removes display styles on the option that made it appear
|
|
1998
|
+
* active. This is used by the ActiveDescendantKeyManager so key
|
|
1999
|
+
* events will display the proper options as active on arrow key events.
|
|
2000
|
+
* @return {?}
|
|
2001
|
+
*/
|
|
2002
|
+
MdOption.prototype.setInactiveStyles = function () {
|
|
2003
|
+
if (this._active) {
|
|
2004
|
+
this._active = false;
|
|
2005
|
+
this._changeDetectorRef.markForCheck();
|
|
2006
|
+
}
|
|
2007
|
+
};
|
|
2008
|
+
/**
|
|
2009
|
+
* Gets the label to be used when determining whether the option should be focused.
|
|
2010
|
+
* @return {?}
|
|
2011
|
+
*/
|
|
2012
|
+
MdOption.prototype.getLabel = function () {
|
|
2013
|
+
return this.viewValue;
|
|
2014
|
+
};
|
|
2015
|
+
/**
|
|
2016
|
+
* Ensures the option is selected when activated from the keyboard.
|
|
2017
|
+
* @param {?} event
|
|
2018
|
+
* @return {?}
|
|
2019
|
+
*/
|
|
2020
|
+
MdOption.prototype._handleKeydown = function (event) {
|
|
2021
|
+
if (event.keyCode === _angular_cdk_keycodes.ENTER || event.keyCode === _angular_cdk_keycodes.SPACE) {
|
|
2022
|
+
this._selectViaInteraction();
|
|
2023
|
+
// Prevent the page from scrolling down and form submits.
|
|
2024
|
+
event.preventDefault();
|
|
2025
|
+
}
|
|
2026
|
+
};
|
|
2027
|
+
/**
|
|
2028
|
+
* Selects the option while indicating the selection came from the user. Used to
|
|
2029
|
+
* determine if the select's view -> model callback should be invoked.
|
|
2030
|
+
* @return {?}
|
|
2031
|
+
*/
|
|
2032
|
+
MdOption.prototype._selectViaInteraction = function () {
|
|
2033
|
+
if (!this.disabled) {
|
|
2034
|
+
this._selected = this.multiple ? !this._selected : true;
|
|
2035
|
+
this._changeDetectorRef.markForCheck();
|
|
2036
|
+
this._emitSelectionChangeEvent(true);
|
|
2037
|
+
}
|
|
2038
|
+
};
|
|
2039
|
+
/**
|
|
2040
|
+
* Returns the correct tabindex for the option depending on disabled state.
|
|
2041
|
+
* @return {?}
|
|
2042
|
+
*/
|
|
2043
|
+
MdOption.prototype._getTabIndex = function () {
|
|
2044
|
+
return this.disabled ? '-1' : '0';
|
|
2045
|
+
};
|
|
2046
|
+
/**
|
|
2047
|
+
* Gets the host DOM element.
|
|
2048
|
+
* @return {?}
|
|
2049
|
+
*/
|
|
2050
|
+
MdOption.prototype._getHostElement = function () {
|
|
2051
|
+
return this._element.nativeElement;
|
|
2052
|
+
};
|
|
2053
|
+
/**
|
|
2054
|
+
* Emits the selection change event.
|
|
2055
|
+
* @param {?=} isUserInput
|
|
2056
|
+
* @return {?}
|
|
2057
|
+
*/
|
|
2058
|
+
MdOption.prototype._emitSelectionChangeEvent = function (isUserInput) {
|
|
2059
|
+
if (isUserInput === void 0) { isUserInput = false; }
|
|
2060
|
+
this.onSelectionChange.emit(new MdOptionSelectionChange(this, isUserInput));
|
|
2061
|
+
};
|
|
2062
|
+
/**
|
|
2063
|
+
* Counts the amount of option group labels that precede the specified option.
|
|
2064
|
+
* @param {?} optionIndex Index of the option at which to start counting.
|
|
2065
|
+
* @param {?} options Flat list of all of the options.
|
|
2066
|
+
* @param {?} optionGroups Flat list of all of the option groups.
|
|
2067
|
+
* @return {?}
|
|
2068
|
+
*/
|
|
2069
|
+
MdOption.countGroupLabelsBeforeOption = function (optionIndex, options, optionGroups) {
|
|
2070
|
+
if (optionGroups.length) {
|
|
2071
|
+
var /** @type {?} */ optionsArray = options.toArray();
|
|
2072
|
+
var /** @type {?} */ groups = optionGroups.toArray();
|
|
2073
|
+
var /** @type {?} */ groupCounter = 0;
|
|
2074
|
+
for (var /** @type {?} */ i = 0; i < optionIndex + 1; i++) {
|
|
2075
|
+
if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {
|
|
2076
|
+
groupCounter++;
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
return groupCounter;
|
|
2080
|
+
}
|
|
2081
|
+
return 0;
|
|
2082
|
+
};
|
|
2083
|
+
return MdOption;
|
|
2084
|
+
}());
|
|
2085
|
+
MdOption.decorators = [
|
|
2086
|
+
{ type: _angular_core.Component, args: [{ selector: 'md-option, mat-option',
|
|
2087
|
+
host: {
|
|
2088
|
+
'role': 'option',
|
|
2089
|
+
'[attr.tabindex]': '_getTabIndex()',
|
|
2090
|
+
'[class.mat-selected]': 'selected',
|
|
2091
|
+
'[class.mat-option-multiple]': 'multiple',
|
|
2092
|
+
'[class.mat-active]': 'active',
|
|
2093
|
+
'[id]': 'id',
|
|
2094
|
+
'[attr.aria-selected]': 'selected.toString()',
|
|
2095
|
+
'[attr.aria-disabled]': 'disabled.toString()',
|
|
2096
|
+
'[class.mat-option-disabled]': 'disabled',
|
|
2097
|
+
'(click)': '_selectViaInteraction()',
|
|
2098
|
+
'(keydown)': '_handleKeydown($event)',
|
|
2099
|
+
'class': 'mat-option',
|
|
2100
|
+
},
|
|
2101
|
+
template: "<span *ngIf=\"multiple\"><mat-pseudo-checkbox class=\"mat-option-pseudo-checkbox\" [state]=\"selected ? 'checked' : ''\" [disabled]=\"disabled\"></mat-pseudo-checkbox></span><ng-content></ng-content><div class=\"mat-option-ripple\" mat-ripple [matRippleTrigger]=\"_getHostElement()\" [matRippleDisabled]=\"disabled || disableRipple\"></div>",
|
|
2102
|
+
encapsulation: _angular_core.ViewEncapsulation.None,
|
|
2103
|
+
preserveWhitespaces: false,
|
|
2104
|
+
changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
|
|
2105
|
+
viewProviders: [{ provide: MATERIAL_COMPATIBILITY_MODE, useValue: true }],
|
|
2106
|
+
},] },
|
|
2107
|
+
];
|
|
2108
|
+
/**
|
|
2109
|
+
* @nocollapse
|
|
2110
|
+
*/
|
|
2111
|
+
MdOption.ctorParameters = function () { return [
|
|
2112
|
+
{ type: _angular_core.ElementRef, },
|
|
2113
|
+
{ type: _angular_core.ChangeDetectorRef, },
|
|
2114
|
+
{ type: MdOptgroup, decorators: [{ type: _angular_core.Optional },] },
|
|
2115
|
+
]; };
|
|
2116
|
+
MdOption.propDecorators = {
|
|
2117
|
+
'value': [{ type: _angular_core.Input },],
|
|
2118
|
+
'disabled': [{ type: _angular_core.Input },],
|
|
2119
|
+
'onSelectionChange': [{ type: _angular_core.Output },],
|
|
2120
|
+
};
|
|
2121
|
+
var MdOptionModule = (function () {
|
|
2122
|
+
function MdOptionModule() {
|
|
2123
|
+
}
|
|
2124
|
+
return MdOptionModule;
|
|
2125
|
+
}());
|
|
2126
|
+
MdOptionModule.decorators = [
|
|
2127
|
+
{ type: _angular_core.NgModule, args: [{
|
|
2128
|
+
imports: [MdRippleModule, _angular_common.CommonModule, MdPseudoCheckboxModule],
|
|
2129
|
+
exports: [MdOption, MdOptgroup],
|
|
2130
|
+
declarations: [MdOption, MdOptgroup]
|
|
2131
|
+
},] },
|
|
2132
|
+
];
|
|
2133
|
+
/**
|
|
2134
|
+
* @nocollapse
|
|
2135
|
+
*/
|
|
2136
|
+
MdOptionModule.ctorParameters = function () { return []; };
|
|
2137
|
+
/**
|
|
2138
|
+
* InjectionToken that can be used to specify the global placeholder options.
|
|
2139
|
+
*/
|
|
2140
|
+
var MD_PLACEHOLDER_GLOBAL_OPTIONS = new _angular_core.InjectionToken('md-placeholder-global-options');
|
|
2141
|
+
/**
|
|
2142
|
+
* @deprecated
|
|
2143
|
+
*/
|
|
2144
|
+
var StyleModule = (function () {
|
|
2145
|
+
function StyleModule() {
|
|
2146
|
+
}
|
|
2147
|
+
return StyleModule;
|
|
2148
|
+
}());
|
|
2149
|
+
StyleModule.decorators = [
|
|
2150
|
+
{ type: _angular_core.NgModule, args: [{
|
|
2151
|
+
imports: [_angular_cdk_a11y.A11yModule],
|
|
2152
|
+
exports: [_angular_cdk_a11y.A11yModule],
|
|
2153
|
+
},] },
|
|
2154
|
+
];
|
|
2155
|
+
/**
|
|
2156
|
+
* @nocollapse
|
|
2157
|
+
*/
|
|
2158
|
+
StyleModule.ctorParameters = function () { return []; };
|
|
2159
|
+
|
|
2160
|
+
/**
|
|
2161
|
+
* This animation shrinks the placeholder text to 75% of its normal size and translates
|
|
2162
|
+
* it to either the top left corner (ltr) or top right corner (rtl) of the trigger,
|
|
2163
|
+
* depending on the text direction of the application.
|
|
2164
|
+
*/
|
|
2165
|
+
var transformPlaceholder = _angular_animations.trigger('transformPlaceholder', [
|
|
2166
|
+
_angular_animations.state('floating-ltr', _angular_animations.style({
|
|
2167
|
+
top: '-22px',
|
|
2168
|
+
left: '-2px',
|
|
2169
|
+
transform: 'scale(0.75)'
|
|
2170
|
+
})),
|
|
2171
|
+
_angular_animations.state('floating-rtl', _angular_animations.style({
|
|
2172
|
+
top: '-22px',
|
|
2173
|
+
left: '2px',
|
|
2174
|
+
transform: 'scale(0.75)'
|
|
2175
|
+
})),
|
|
2176
|
+
_angular_animations.transition('* => *', _angular_animations.animate('400ms cubic-bezier(0.25, 0.8, 0.25, 1)'))
|
|
2177
|
+
]);
|
|
2178
|
+
/**
|
|
2179
|
+
* This animation transforms the select's overlay panel on and off the page.
|
|
2180
|
+
*
|
|
2181
|
+
* When the panel is attached to the DOM, it expands its width by the amount of padding, scales it
|
|
2182
|
+
* up to 100% on the Y axis, fades in its border, and translates slightly up and to the
|
|
2183
|
+
* side to ensure the option text correctly overlaps the trigger text.
|
|
2184
|
+
*
|
|
2185
|
+
* When the panel is removed from the DOM, it simply fades out linearly.
|
|
2186
|
+
*/
|
|
2187
|
+
var transformPanel = _angular_animations.trigger('transformPanel', [
|
|
2188
|
+
_angular_animations.state('showing', _angular_animations.style({
|
|
2189
|
+
opacity: 1,
|
|
2190
|
+
minWidth: 'calc(100% + 32px)',
|
|
2191
|
+
transform: 'scaleY(1)'
|
|
2192
|
+
})),
|
|
2193
|
+
_angular_animations.state('showing-multiple', _angular_animations.style({
|
|
2194
|
+
opacity: 1,
|
|
2195
|
+
minWidth: 'calc(100% + 64px)',
|
|
2196
|
+
transform: 'scaleY(1)'
|
|
2197
|
+
})),
|
|
2198
|
+
_angular_animations.transition('void => *', [
|
|
2199
|
+
_angular_animations.style({
|
|
2200
|
+
opacity: 0,
|
|
2201
|
+
minWidth: '100%',
|
|
2202
|
+
transform: 'scaleY(0)'
|
|
2203
|
+
}),
|
|
2204
|
+
_angular_animations.animate('150ms cubic-bezier(0.25, 0.8, 0.25, 1)')
|
|
2205
|
+
]),
|
|
2206
|
+
_angular_animations.transition('* => void', [
|
|
2207
|
+
_angular_animations.animate('250ms 100ms linear', _angular_animations.style({ opacity: 0 }))
|
|
2208
|
+
])
|
|
2209
|
+
]);
|
|
2210
|
+
/**
|
|
2211
|
+
* This animation fades in the background color and text content of the
|
|
2212
|
+
* select's options. It is time delayed to occur 100ms after the overlay
|
|
2213
|
+
* panel has transformed in.
|
|
2214
|
+
*/
|
|
2215
|
+
var fadeInContent = _angular_animations.trigger('fadeInContent', [
|
|
2216
|
+
_angular_animations.state('showing', _angular_animations.style({ opacity: 1 })),
|
|
2217
|
+
_angular_animations.transition('void => showing', [
|
|
2218
|
+
_angular_animations.style({ opacity: 0 }),
|
|
2219
|
+
_angular_animations.animate('150ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)')
|
|
2220
|
+
])
|
|
2221
|
+
]);
|
|
2222
|
+
/**
|
|
2223
|
+
* Returns an exception to be thrown when attempting to change a select's `multiple` option
|
|
2224
|
+
* after initialization.
|
|
2225
|
+
* \@docs-private
|
|
2226
|
+
* @return {?}
|
|
2227
|
+
*/
|
|
2228
|
+
function getMdSelectDynamicMultipleError() {
|
|
2229
|
+
return Error('Cannot change `multiple` mode of select after initialization.');
|
|
2230
|
+
}
|
|
2231
|
+
/**
|
|
2232
|
+
* Returns an exception to be thrown when attempting to assign a non-array value to a select
|
|
2233
|
+
* in `multiple` mode. Note that `undefined` and `null` are still valid values to allow for
|
|
2234
|
+
* resetting the value.
|
|
2235
|
+
* \@docs-private
|
|
2236
|
+
* @return {?}
|
|
2237
|
+
*/
|
|
2238
|
+
function getMdSelectNonArrayValueError() {
|
|
2239
|
+
return Error('Cannot assign truthy non-array value to select in `multiple` mode.');
|
|
2240
|
+
}
|
|
2241
|
+
/**
|
|
2242
|
+
* Returns an exception to be thrown when assigning a non-function value to the comparator
|
|
2243
|
+
* used to determine if a value corresponds to an option. Note that whether the function
|
|
2244
|
+
* actually takes two values and returns a boolean is not checked.
|
|
2245
|
+
* @return {?}
|
|
2246
|
+
*/
|
|
2247
|
+
function getMdSelectNonFunctionValueError() {
|
|
2248
|
+
return Error('Cannot assign a non-function value to `compareWith`.');
|
|
2249
|
+
}
|
|
2250
|
+
/**
|
|
2251
|
+
* The fixed height of every option element (option, group header etc.).
|
|
2252
|
+
*/
|
|
2253
|
+
var SELECT_ITEM_HEIGHT = 48;
|
|
2254
|
+
/**
|
|
2255
|
+
* The max height of the select's overlay panel
|
|
2256
|
+
*/
|
|
2257
|
+
var SELECT_PANEL_MAX_HEIGHT = 256;
|
|
2258
|
+
/**
|
|
2259
|
+
* The max number of options visible at once in the select panel.
|
|
2260
|
+
*/
|
|
2261
|
+
var SELECT_MAX_OPTIONS_DISPLAYED = Math.floor(SELECT_PANEL_MAX_HEIGHT / SELECT_ITEM_HEIGHT);
|
|
2262
|
+
/**
|
|
2263
|
+
* The fixed height of the select's trigger element.
|
|
2264
|
+
*/
|
|
2265
|
+
var SELECT_TRIGGER_HEIGHT = 30;
|
|
2266
|
+
/**
|
|
2267
|
+
* Must adjust for the difference in height between the option and the trigger,
|
|
2268
|
+
* so the text will align on the y axis.
|
|
2269
|
+
*/
|
|
2270
|
+
var SELECT_OPTION_HEIGHT_ADJUSTMENT = (SELECT_ITEM_HEIGHT - SELECT_TRIGGER_HEIGHT) / 2;
|
|
2271
|
+
/**
|
|
2272
|
+
* The panel's padding on the x-axis
|
|
2273
|
+
*/
|
|
2274
|
+
var SELECT_PANEL_PADDING_X = 16;
|
|
2275
|
+
/**
|
|
2276
|
+
* The panel's x axis padding if it is indented (e.g. there is an option group).
|
|
2277
|
+
*/
|
|
2278
|
+
var SELECT_PANEL_INDENT_PADDING_X = SELECT_PANEL_PADDING_X * 2;
|
|
2279
|
+
/**
|
|
2280
|
+
* Distance between the panel edge and the option text in
|
|
2281
|
+
* multi-selection mode.
|
|
2282
|
+
*
|
|
2283
|
+
* (SELECT_PADDING * 1.75) + 20 = 48
|
|
2284
|
+
* The padding is multiplied by 1.75 because the checkbox's margin is half the padding, and
|
|
2285
|
+
* the browser adds ~4px, because we're using inline elements.
|
|
2286
|
+
* The checkbox width is 20px.
|
|
2287
|
+
*/
|
|
2288
|
+
var SELECT_MULTIPLE_PANEL_PADDING_X = SELECT_PANEL_PADDING_X * 1.75 + 20;
|
|
2289
|
+
/**
|
|
2290
|
+
* The panel's padding on the y-axis. This padding indicates there are more
|
|
2291
|
+
* options available if you scroll.
|
|
2292
|
+
*/
|
|
2293
|
+
var SELECT_PANEL_PADDING_Y = 16;
|
|
2294
|
+
/**
|
|
2295
|
+
* The select panel will only "fit" inside the viewport if it is positioned at
|
|
2296
|
+
* this value or more away from the viewport boundary.
|
|
2297
|
+
*/
|
|
2298
|
+
var SELECT_PANEL_VIEWPORT_PADDING = 8;
|
|
2299
|
+
/**
|
|
2300
|
+
* Default minimum width of the trigger based on the CSS.
|
|
2301
|
+
* Used as a fallback for server-side rendering.
|
|
2302
|
+
* \@docs-private
|
|
2303
|
+
*/
|
|
2304
|
+
var SELECT_TRIGGER_MIN_WIDTH = 112;
|
|
2305
|
+
/**
|
|
2306
|
+
* Injection token that determines the scroll handling while a select is open.
|
|
2307
|
+
*/
|
|
2308
|
+
var MD_SELECT_SCROLL_STRATEGY = new _angular_core.InjectionToken('md-select-scroll-strategy');
|
|
2309
|
+
/**
|
|
2310
|
+
* \@docs-private
|
|
2311
|
+
* @param {?} overlay
|
|
2312
|
+
* @return {?}
|
|
2313
|
+
*/
|
|
2314
|
+
function MD_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
|
|
2315
|
+
return function () { return overlay.scrollStrategies.reposition(); };
|
|
2316
|
+
}
|
|
2317
|
+
/**
|
|
2318
|
+
* \@docs-private
|
|
2319
|
+
*/
|
|
2320
|
+
var MD_SELECT_SCROLL_STRATEGY_PROVIDER = {
|
|
2321
|
+
provide: MD_SELECT_SCROLL_STRATEGY,
|
|
2322
|
+
deps: [_angular_cdk_overlay.Overlay],
|
|
2323
|
+
useFactory: MD_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY,
|
|
2324
|
+
};
|
|
2325
|
+
/**
|
|
2326
|
+
* Change event object that is emitted when the select value has changed.
|
|
2327
|
+
*/
|
|
2328
|
+
var MdSelectChange = (function () {
|
|
2329
|
+
/**
|
|
2330
|
+
* @param {?} source
|
|
2331
|
+
* @param {?} value
|
|
2332
|
+
*/
|
|
2333
|
+
function MdSelectChange(source, value) {
|
|
2334
|
+
this.source = source;
|
|
2335
|
+
this.value = value;
|
|
2336
|
+
}
|
|
2337
|
+
return MdSelectChange;
|
|
2338
|
+
}());
|
|
2339
|
+
/**
|
|
2340
|
+
* \@docs-private
|
|
2341
|
+
*/
|
|
2342
|
+
var MdSelectBase = (function () {
|
|
2343
|
+
/**
|
|
2344
|
+
* @param {?} _renderer
|
|
2345
|
+
* @param {?} _elementRef
|
|
2346
|
+
*/
|
|
2347
|
+
function MdSelectBase(_renderer, _elementRef) {
|
|
2348
|
+
this._renderer = _renderer;
|
|
2349
|
+
this._elementRef = _elementRef;
|
|
2350
|
+
}
|
|
2351
|
+
return MdSelectBase;
|
|
2352
|
+
}());
|
|
2353
|
+
var _MdSelectMixinBase = mixinTabIndex(mixinColor(mixinDisabled(MdSelectBase), 'primary'));
|
|
2354
|
+
/**
|
|
2355
|
+
* Allows the user to customize the trigger that is displayed when the select has a value.
|
|
2356
|
+
*/
|
|
2357
|
+
var MdSelectTrigger = (function () {
|
|
2358
|
+
function MdSelectTrigger() {
|
|
2359
|
+
}
|
|
2360
|
+
return MdSelectTrigger;
|
|
2361
|
+
}());
|
|
2362
|
+
MdSelectTrigger.decorators = [
|
|
2363
|
+
{ type: _angular_core.Directive, args: [{
|
|
2364
|
+
selector: 'md-select-trigger, mat-select-trigger'
|
|
2365
|
+
},] },
|
|
2366
|
+
];
|
|
2367
|
+
/**
|
|
2368
|
+
* @nocollapse
|
|
2369
|
+
*/
|
|
2370
|
+
MdSelectTrigger.ctorParameters = function () { return []; };
|
|
2371
|
+
var MdSelect = (function (_super) {
|
|
2372
|
+
__extends(MdSelect, _super);
|
|
2373
|
+
/**
|
|
2374
|
+
* @param {?} _viewportRuler
|
|
2375
|
+
* @param {?} _changeDetectorRef
|
|
2376
|
+
* @param {?} _platform
|
|
2377
|
+
* @param {?} renderer
|
|
2378
|
+
* @param {?} elementRef
|
|
2379
|
+
* @param {?} _dir
|
|
2380
|
+
* @param {?} _parentForm
|
|
2381
|
+
* @param {?} _parentFormGroup
|
|
2382
|
+
* @param {?} _control
|
|
2383
|
+
* @param {?} tabIndex
|
|
2384
|
+
* @param {?} placeholderOptions
|
|
2385
|
+
* @param {?} _scrollStrategyFactory
|
|
2386
|
+
*/
|
|
2387
|
+
function MdSelect(_viewportRuler, _changeDetectorRef, _platform, renderer, elementRef, _dir, _parentForm, _parentFormGroup, _control, tabIndex, placeholderOptions, _scrollStrategyFactory) {
|
|
2388
|
+
var _this = _super.call(this, renderer, elementRef) || this;
|
|
2389
|
+
_this._viewportRuler = _viewportRuler;
|
|
2390
|
+
_this._changeDetectorRef = _changeDetectorRef;
|
|
2391
|
+
_this._platform = _platform;
|
|
2392
|
+
_this._dir = _dir;
|
|
2393
|
+
_this._parentForm = _parentForm;
|
|
2394
|
+
_this._parentFormGroup = _parentFormGroup;
|
|
2395
|
+
_this._control = _control;
|
|
2396
|
+
_this._scrollStrategyFactory = _scrollStrategyFactory;
|
|
2397
|
+
/**
|
|
2398
|
+
* Whether or not the overlay panel is open.
|
|
2399
|
+
*/
|
|
2400
|
+
_this._panelOpen = false;
|
|
2401
|
+
/**
|
|
2402
|
+
* Subscriptions to option events.
|
|
2403
|
+
*/
|
|
2404
|
+
_this._optionSubscription = rxjs_Subscription.Subscription.EMPTY;
|
|
2405
|
+
/**
|
|
2406
|
+
* Subscription to changes in the option list.
|
|
2407
|
+
*/
|
|
2408
|
+
_this._changeSubscription = rxjs_Subscription.Subscription.EMPTY;
|
|
2409
|
+
/**
|
|
2410
|
+
* Subscription to tab events while overlay is focused.
|
|
2411
|
+
*/
|
|
2412
|
+
_this._tabSubscription = rxjs_Subscription.Subscription.EMPTY;
|
|
2413
|
+
/**
|
|
2414
|
+
* Whether filling out the select is required in the form.
|
|
2415
|
+
*/
|
|
2416
|
+
_this._required = false;
|
|
2417
|
+
/**
|
|
2418
|
+
* The scroll position of the overlay panel, calculated to center the selected option.
|
|
2419
|
+
*/
|
|
2420
|
+
_this._scrollTop = 0;
|
|
2421
|
+
/**
|
|
2422
|
+
* Whether the component is in multiple selection mode.
|
|
2423
|
+
*/
|
|
2424
|
+
_this._multiple = false;
|
|
2425
|
+
/**
|
|
2426
|
+
* Comparison function to specify which option is displayed. Defaults to object equality.
|
|
2427
|
+
*/
|
|
2428
|
+
_this._compareWith = function (o1, o2) { return o1 === o2; };
|
|
2429
|
+
/**
|
|
2430
|
+
* The animation state of the placeholder.
|
|
2431
|
+
*/
|
|
2432
|
+
_this._placeholderState = '';
|
|
2433
|
+
/**
|
|
2434
|
+
* View -> model callback called when value changes
|
|
2435
|
+
*/
|
|
2436
|
+
_this._onChange = function () { };
|
|
2437
|
+
/**
|
|
2438
|
+
* View -> model callback called when select has been touched
|
|
2439
|
+
*/
|
|
2440
|
+
_this._onTouched = function () { };
|
|
2441
|
+
/**
|
|
2442
|
+
* The IDs of child options to be passed to the aria-owns attribute.
|
|
2443
|
+
*/
|
|
2444
|
+
_this._optionIds = '';
|
|
2445
|
+
/**
|
|
2446
|
+
* The value of the select panel's transform-origin property.
|
|
2447
|
+
*/
|
|
2448
|
+
_this._transformOrigin = 'top';
|
|
2449
|
+
/**
|
|
2450
|
+
* Whether the panel's animation is done.
|
|
2451
|
+
*/
|
|
2452
|
+
_this._panelDoneAnimating = false;
|
|
2453
|
+
/**
|
|
2454
|
+
* Strategy that will be used to handle scrolling while the select panel is open.
|
|
2455
|
+
*/
|
|
2456
|
+
_this._scrollStrategy = _this._scrollStrategyFactory();
|
|
2457
|
+
/**
|
|
2458
|
+
* The y-offset of the overlay panel in relation to the trigger's top start corner.
|
|
2459
|
+
* This must be adjusted to align the selected option text over the trigger text.
|
|
2460
|
+
* when the panel opens. Will change based on the y-position of the selected option.
|
|
2461
|
+
*/
|
|
2462
|
+
_this._offsetY = 0;
|
|
2463
|
+
/**
|
|
2464
|
+
* This position config ensures that the top "start" corner of the overlay
|
|
2465
|
+
* is aligned with with the top "start" of the origin by default (overlapping
|
|
2466
|
+
* the trigger completely). If the panel cannot fit below the trigger, it
|
|
2467
|
+
* will fall back to a position above the trigger.
|
|
2468
|
+
*/
|
|
2469
|
+
_this._positions = [
|
|
2470
|
+
{
|
|
2471
|
+
originX: 'start',
|
|
2472
|
+
originY: 'top',
|
|
2473
|
+
overlayX: 'start',
|
|
2474
|
+
overlayY: 'top',
|
|
2475
|
+
},
|
|
2476
|
+
{
|
|
2477
|
+
originX: 'start',
|
|
2478
|
+
originY: 'bottom',
|
|
2479
|
+
overlayX: 'start',
|
|
2480
|
+
overlayY: 'bottom',
|
|
2481
|
+
},
|
|
2482
|
+
];
|
|
2483
|
+
_this._disableRipple = false;
|
|
2484
|
+
/**
|
|
2485
|
+
* Aria label of the select. If not specified, the placeholder will be used as label.
|
|
2486
|
+
*/
|
|
2487
|
+
_this.ariaLabel = '';
|
|
2488
|
+
/**
|
|
2489
|
+
* Input that can be used to specify the `aria-labelledby` attribute.
|
|
2490
|
+
*/
|
|
2491
|
+
_this.ariaLabelledby = '';
|
|
2492
|
+
/**
|
|
2493
|
+
* Event emitted when the select has been opened.
|
|
2494
|
+
*/
|
|
2495
|
+
_this.onOpen = new _angular_core.EventEmitter();
|
|
2496
|
+
/**
|
|
2497
|
+
* Event emitted when the select has been closed.
|
|
2498
|
+
*/
|
|
2499
|
+
_this.onClose = new _angular_core.EventEmitter();
|
|
2500
|
+
/**
|
|
2501
|
+
* Event emitted when the selected value has been changed by the user.
|
|
2502
|
+
*/
|
|
2503
|
+
_this.change = new _angular_core.EventEmitter();
|
|
2504
|
+
/**
|
|
2505
|
+
* Event that emits whenever the raw value of the select changes. This is here primarily
|
|
2506
|
+
* to facilitate the two-way binding for the `value` input.
|
|
2507
|
+
* \@docs-private
|
|
2508
|
+
*/
|
|
2509
|
+
_this.valueChange = new _angular_core.EventEmitter();
|
|
2510
|
+
if (_this._control) {
|
|
2511
|
+
_this._control.valueAccessor = _this;
|
|
2512
|
+
}
|
|
2513
|
+
_this.tabIndex = parseInt(tabIndex) || 0;
|
|
2514
|
+
_this._placeholderOptions = placeholderOptions ? placeholderOptions : {};
|
|
2515
|
+
_this.floatPlaceholder = _this._placeholderOptions.float || 'auto';
|
|
2516
|
+
return _this;
|
|
2517
|
+
}
|
|
2518
|
+
Object.defineProperty(MdSelect.prototype, "placeholder", {
|
|
2519
|
+
/**
|
|
2520
|
+
* Placeholder to be shown if no value has been selected.
|
|
2521
|
+
* @return {?}
|
|
2522
|
+
*/
|
|
2523
|
+
get: function () { return this._placeholder; },
|
|
2524
|
+
/**
|
|
2525
|
+
* @param {?} value
|
|
2526
|
+
* @return {?}
|
|
2527
|
+
*/
|
|
2528
|
+
set: function (value) {
|
|
2529
|
+
var _this = this;
|
|
2530
|
+
this._placeholder = value;
|
|
2531
|
+
// Must wait to record the trigger width to ensure placeholder width is included.
|
|
2532
|
+
Promise.resolve(null).then(function () { return _this._setTriggerWidth(); });
|
|
2533
|
+
},
|
|
2534
|
+
enumerable: true,
|
|
2535
|
+
configurable: true
|
|
2536
|
+
});
|
|
2537
|
+
Object.defineProperty(MdSelect.prototype, "required", {
|
|
2538
|
+
/**
|
|
2539
|
+
* Whether the component is required.
|
|
2540
|
+
* @return {?}
|
|
2541
|
+
*/
|
|
2542
|
+
get: function () { return this._required; },
|
|
2543
|
+
/**
|
|
2544
|
+
* @param {?} value
|
|
2545
|
+
* @return {?}
|
|
2546
|
+
*/
|
|
2547
|
+
set: function (value) { this._required = _angular_cdk_coercion.coerceBooleanProperty(value); },
|
|
2548
|
+
enumerable: true,
|
|
2549
|
+
configurable: true
|
|
2550
|
+
});
|
|
2551
|
+
Object.defineProperty(MdSelect.prototype, "multiple", {
|
|
2552
|
+
/**
|
|
2553
|
+
* Whether the user should be allowed to select multiple options.
|
|
2554
|
+
* @return {?}
|
|
2555
|
+
*/
|
|
2556
|
+
get: function () { return this._multiple; },
|
|
2557
|
+
/**
|
|
2558
|
+
* @param {?} value
|
|
2559
|
+
* @return {?}
|
|
2560
|
+
*/
|
|
2561
|
+
set: function (value) {
|
|
2562
|
+
if (this._selectionModel) {
|
|
2563
|
+
throw getMdSelectDynamicMultipleError();
|
|
2564
|
+
}
|
|
2565
|
+
this._multiple = _angular_cdk_coercion.coerceBooleanProperty(value);
|
|
2566
|
+
},
|
|
2567
|
+
enumerable: true,
|
|
2568
|
+
configurable: true
|
|
2569
|
+
});
|
|
2570
|
+
Object.defineProperty(MdSelect.prototype, "compareWith", {
|
|
2571
|
+
/**
|
|
2572
|
+
* A function to compare the option values with the selected values. The first argument
|
|
2573
|
+
* is a value from an option. The second is a value from the selection. A boolean
|
|
2574
|
+
* should be returned.
|
|
2575
|
+
* @return {?}
|
|
2576
|
+
*/
|
|
2577
|
+
get: function () { return this._compareWith; },
|
|
2578
|
+
/**
|
|
2579
|
+
* @param {?} fn
|
|
2580
|
+
* @return {?}
|
|
2581
|
+
*/
|
|
2582
|
+
set: function (fn) {
|
|
2583
|
+
if (typeof fn !== 'function') {
|
|
2584
|
+
throw getMdSelectNonFunctionValueError();
|
|
2585
|
+
}
|
|
2586
|
+
this._compareWith = fn;
|
|
2587
|
+
if (this._selectionModel) {
|
|
2588
|
+
// A different comparator means the selection could change.
|
|
2589
|
+
this._initializeSelection();
|
|
2590
|
+
}
|
|
2591
|
+
},
|
|
2592
|
+
enumerable: true,
|
|
2593
|
+
configurable: true
|
|
2594
|
+
});
|
|
2595
|
+
Object.defineProperty(MdSelect.prototype, "floatPlaceholder", {
|
|
2596
|
+
/**
|
|
2597
|
+
* Whether to float the placeholder text.
|
|
2598
|
+
* @return {?}
|
|
2599
|
+
*/
|
|
2600
|
+
get: function () { return this._floatPlaceholder; },
|
|
2601
|
+
/**
|
|
2602
|
+
* @param {?} value
|
|
2603
|
+
* @return {?}
|
|
2604
|
+
*/
|
|
2605
|
+
set: function (value) {
|
|
2606
|
+
this._floatPlaceholder = value || this._placeholderOptions.float || 'auto';
|
|
2607
|
+
},
|
|
2608
|
+
enumerable: true,
|
|
2609
|
+
configurable: true
|
|
2610
|
+
});
|
|
2611
|
+
Object.defineProperty(MdSelect.prototype, "value", {
|
|
2612
|
+
/**
|
|
2613
|
+
* Value of the select control.
|
|
2614
|
+
* @return {?}
|
|
2615
|
+
*/
|
|
2616
|
+
get: function () { return this._value; },
|
|
2617
|
+
/**
|
|
2618
|
+
* @param {?} newValue
|
|
2619
|
+
* @return {?}
|
|
2620
|
+
*/
|
|
2621
|
+
set: function (newValue) {
|
|
2622
|
+
this.writeValue(newValue);
|
|
2623
|
+
this._value = newValue;
|
|
2624
|
+
},
|
|
2625
|
+
enumerable: true,
|
|
2626
|
+
configurable: true
|
|
2627
|
+
});
|
|
2628
|
+
Object.defineProperty(MdSelect.prototype, "disableRipple", {
|
|
2629
|
+
/**
|
|
2630
|
+
* Whether ripples for all options in the select are disabled.
|
|
2631
|
+
* @return {?}
|
|
2632
|
+
*/
|
|
2633
|
+
get: function () { return this._disableRipple; },
|
|
2634
|
+
/**
|
|
2635
|
+
* @param {?} value
|
|
2636
|
+
* @return {?}
|
|
2637
|
+
*/
|
|
2638
|
+
set: function (value) {
|
|
2639
|
+
this._disableRipple = _angular_cdk_coercion.coerceBooleanProperty(value);
|
|
2640
|
+
this._setOptionDisableRipple();
|
|
2641
|
+
},
|
|
2642
|
+
enumerable: true,
|
|
2643
|
+
configurable: true
|
|
2644
|
+
});
|
|
2645
|
+
Object.defineProperty(MdSelect.prototype, "optionSelectionChanges", {
|
|
2646
|
+
/**
|
|
2647
|
+
* Combined stream of all of the child options' change events.
|
|
2648
|
+
* @return {?}
|
|
2649
|
+
*/
|
|
2650
|
+
get: function () {
|
|
2651
|
+
return rxjs_observable_merge.merge.apply(void 0, this.options.map(function (option) { return option.onSelectionChange; }));
|
|
2652
|
+
},
|
|
2653
|
+
enumerable: true,
|
|
2654
|
+
configurable: true
|
|
2655
|
+
});
|
|
2656
|
+
/**
|
|
2657
|
+
* @return {?}
|
|
2658
|
+
*/
|
|
2659
|
+
MdSelect.prototype.ngOnInit = function () {
|
|
2660
|
+
this._selectionModel = new _angular_cdk_collections.SelectionModel(this.multiple, undefined, false);
|
|
2661
|
+
};
|
|
2662
|
+
/**
|
|
2663
|
+
* @return {?}
|
|
2664
|
+
*/
|
|
2665
|
+
MdSelect.prototype.ngAfterContentInit = function () {
|
|
2666
|
+
var _this = this;
|
|
2667
|
+
this._initKeyManager();
|
|
2668
|
+
this._changeSubscription = _angular_cdk_rxjs.startWith.call(this.options.changes, null).subscribe(function () {
|
|
2669
|
+
_this._resetOptions();
|
|
2670
|
+
_this._initializeSelection();
|
|
2671
|
+
});
|
|
2672
|
+
};
|
|
2673
|
+
/**
|
|
2674
|
+
* @return {?}
|
|
2675
|
+
*/
|
|
2676
|
+
MdSelect.prototype.ngOnDestroy = function () {
|
|
2677
|
+
this._dropSubscriptions();
|
|
2678
|
+
this._changeSubscription.unsubscribe();
|
|
2679
|
+
this._tabSubscription.unsubscribe();
|
|
2680
|
+
};
|
|
2681
|
+
/**
|
|
2682
|
+
* Toggles the overlay panel open or closed.
|
|
2683
|
+
* @return {?}
|
|
2684
|
+
*/
|
|
2685
|
+
MdSelect.prototype.toggle = function () {
|
|
2686
|
+
this.panelOpen ? this.close() : this.open();
|
|
2687
|
+
};
|
|
2688
|
+
/**
|
|
2689
|
+
* Opens the overlay panel.
|
|
2690
|
+
* @return {?}
|
|
2691
|
+
*/
|
|
2692
|
+
MdSelect.prototype.open = function () {
|
|
2693
|
+
if (this.disabled || !this.options.length) {
|
|
2694
|
+
return;
|
|
2695
|
+
}
|
|
2696
|
+
if (!this._triggerWidth) {
|
|
2697
|
+
this._setTriggerWidth();
|
|
2698
|
+
}
|
|
2699
|
+
this._calculateOverlayPosition();
|
|
2700
|
+
this._placeholderState = this._floatPlaceholderState();
|
|
2701
|
+
this._panelOpen = true;
|
|
2702
|
+
this._changeDetectorRef.markForCheck();
|
|
2703
|
+
};
|
|
2704
|
+
/**
|
|
2705
|
+
* Closes the overlay panel and focuses the host element.
|
|
2706
|
+
* @return {?}
|
|
2707
|
+
*/
|
|
2708
|
+
MdSelect.prototype.close = function () {
|
|
2709
|
+
if (this._panelOpen) {
|
|
2710
|
+
this._panelOpen = false;
|
|
2711
|
+
if (this._selectionModel.isEmpty()) {
|
|
2712
|
+
this._placeholderState = '';
|
|
2713
|
+
}
|
|
2714
|
+
this._changeDetectorRef.markForCheck();
|
|
2715
|
+
this.focus();
|
|
2716
|
+
}
|
|
2717
|
+
};
|
|
2718
|
+
/**
|
|
2719
|
+
* Sets the select's value. Part of the ControlValueAccessor interface
|
|
2720
|
+
* required to integrate with Angular's core forms API.
|
|
2721
|
+
*
|
|
2722
|
+
* @param {?} value New value to be written to the model.
|
|
2723
|
+
* @return {?}
|
|
2724
|
+
*/
|
|
2725
|
+
MdSelect.prototype.writeValue = function (value) {
|
|
2726
|
+
if (this.options) {
|
|
2727
|
+
this._setSelectionByValue(value);
|
|
2728
|
+
}
|
|
2729
|
+
};
|
|
2730
|
+
/**
|
|
2731
|
+
* Saves a callback function to be invoked when the select's value
|
|
2732
|
+
* changes from user input. Part of the ControlValueAccessor interface
|
|
2733
|
+
* required to integrate with Angular's core forms API.
|
|
2734
|
+
*
|
|
2735
|
+
* @param {?} fn Callback to be triggered when the value changes.
|
|
2736
|
+
* @return {?}
|
|
2737
|
+
*/
|
|
2738
|
+
MdSelect.prototype.registerOnChange = function (fn) {
|
|
2739
|
+
this._onChange = fn;
|
|
2740
|
+
};
|
|
2741
|
+
/**
|
|
2742
|
+
* Saves a callback function to be invoked when the select is blurred
|
|
2743
|
+
* by the user. Part of the ControlValueAccessor interface required
|
|
2744
|
+
* to integrate with Angular's core forms API.
|
|
2745
|
+
*
|
|
2746
|
+
* @param {?} fn Callback to be triggered when the component has been touched.
|
|
2747
|
+
* @return {?}
|
|
2748
|
+
*/
|
|
2749
|
+
MdSelect.prototype.registerOnTouched = function (fn) {
|
|
2750
|
+
this._onTouched = fn;
|
|
2751
|
+
};
|
|
2752
|
+
/**
|
|
2753
|
+
* Disables the select. Part of the ControlValueAccessor interface required
|
|
2754
|
+
* to integrate with Angular's core forms API.
|
|
2755
|
+
*
|
|
2756
|
+
* @param {?} isDisabled Sets whether the component is disabled.
|
|
2757
|
+
* @return {?}
|
|
2758
|
+
*/
|
|
2759
|
+
MdSelect.prototype.setDisabledState = function (isDisabled) {
|
|
2760
|
+
this.disabled = isDisabled;
|
|
2761
|
+
this._changeDetectorRef.markForCheck();
|
|
2762
|
+
};
|
|
2763
|
+
Object.defineProperty(MdSelect.prototype, "panelOpen", {
|
|
2764
|
+
/**
|
|
2765
|
+
* Whether or not the overlay panel is open.
|
|
2766
|
+
* @return {?}
|
|
2767
|
+
*/
|
|
2768
|
+
get: function () {
|
|
2769
|
+
return this._panelOpen;
|
|
2770
|
+
},
|
|
2771
|
+
enumerable: true,
|
|
2772
|
+
configurable: true
|
|
2773
|
+
});
|
|
2774
|
+
Object.defineProperty(MdSelect.prototype, "selected", {
|
|
2775
|
+
/**
|
|
2776
|
+
* The currently selected option.
|
|
2777
|
+
* @return {?}
|
|
2778
|
+
*/
|
|
2779
|
+
get: function () {
|
|
2780
|
+
return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];
|
|
2781
|
+
},
|
|
2782
|
+
enumerable: true,
|
|
2783
|
+
configurable: true
|
|
2784
|
+
});
|
|
2785
|
+
Object.defineProperty(MdSelect.prototype, "triggerValue", {
|
|
2786
|
+
/**
|
|
2787
|
+
* The value displayed in the trigger.
|
|
2788
|
+
* @return {?}
|
|
2789
|
+
*/
|
|
2790
|
+
get: function () {
|
|
2791
|
+
if (!this._selectionModel || this._selectionModel.isEmpty()) {
|
|
2792
|
+
return '';
|
|
2793
|
+
}
|
|
2794
|
+
if (this._multiple) {
|
|
2795
|
+
var /** @type {?} */ selectedOptions = this._selectionModel.selected.map(function (option) { return option.viewValue; });
|
|
2796
|
+
if (this._isRtl()) {
|
|
2797
|
+
selectedOptions.reverse();
|
|
2798
|
+
}
|
|
2799
|
+
// TODO(crisbeto): delimiter should be configurable for proper localization.
|
|
2800
|
+
return selectedOptions.join(', ');
|
|
2801
|
+
}
|
|
2802
|
+
return this._selectionModel.selected[0].viewValue;
|
|
2803
|
+
},
|
|
2804
|
+
enumerable: true,
|
|
2805
|
+
configurable: true
|
|
2806
|
+
});
|
|
2807
|
+
/**
|
|
2808
|
+
* Whether the element is in RTL mode.
|
|
2809
|
+
* @return {?}
|
|
2810
|
+
*/
|
|
2811
|
+
MdSelect.prototype._isRtl = function () {
|
|
2812
|
+
return this._dir ? this._dir.value === 'rtl' : false;
|
|
2813
|
+
};
|
|
2814
|
+
/**
|
|
2815
|
+
* Sets the width of the trigger element. This is necessary to match
|
|
2816
|
+
* the overlay width to the trigger width.
|
|
2817
|
+
* @return {?}
|
|
2818
|
+
*/
|
|
2819
|
+
MdSelect.prototype._setTriggerWidth = function () {
|
|
2820
|
+
this._triggerWidth = this._platform.isBrowser ? this._getTriggerRect().width :
|
|
2821
|
+
SELECT_TRIGGER_MIN_WIDTH;
|
|
2822
|
+
this._changeDetectorRef.markForCheck();
|
|
2823
|
+
};
|
|
2824
|
+
/**
|
|
2825
|
+
* Handles the keyboard interactions of a closed select.
|
|
2826
|
+
* @param {?} event
|
|
2827
|
+
* @return {?}
|
|
2828
|
+
*/
|
|
2829
|
+
MdSelect.prototype._handleClosedKeydown = function (event) {
|
|
2830
|
+
if (!this.disabled) {
|
|
2831
|
+
if (event.keyCode === _angular_cdk_keycodes.ENTER || event.keyCode === _angular_cdk_keycodes.SPACE) {
|
|
2832
|
+
event.preventDefault(); // prevents the page from scrolling down when pressing space
|
|
2833
|
+
this.open();
|
|
2834
|
+
}
|
|
2835
|
+
else if (event.keyCode === _angular_cdk_keycodes.UP_ARROW || event.keyCode === _angular_cdk_keycodes.DOWN_ARROW) {
|
|
2836
|
+
this._handleArrowKey(event);
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
};
|
|
2840
|
+
/**
|
|
2841
|
+
* Handles keypresses inside the panel.
|
|
2842
|
+
* @param {?} event
|
|
2843
|
+
* @return {?}
|
|
2844
|
+
*/
|
|
2845
|
+
MdSelect.prototype._handlePanelKeydown = function (event) {
|
|
2846
|
+
if (event.keyCode === _angular_cdk_keycodes.HOME || event.keyCode === _angular_cdk_keycodes.END) {
|
|
2847
|
+
event.preventDefault();
|
|
2848
|
+
event.keyCode === _angular_cdk_keycodes.HOME ? this._keyManager.setFirstItemActive() :
|
|
2849
|
+
this._keyManager.setLastItemActive();
|
|
2850
|
+
}
|
|
2851
|
+
else {
|
|
2852
|
+
this._keyManager.onKeydown(event);
|
|
2853
|
+
}
|
|
2854
|
+
};
|
|
2855
|
+
/**
|
|
2856
|
+
* When the panel element is finished transforming in (though not fading in), it
|
|
2857
|
+
* emits an event and focuses an option if the panel is open.
|
|
2858
|
+
* @return {?}
|
|
2859
|
+
*/
|
|
2860
|
+
MdSelect.prototype._onPanelDone = function () {
|
|
2861
|
+
if (this.panelOpen) {
|
|
2862
|
+
this._focusCorrectOption();
|
|
2863
|
+
this.onOpen.emit();
|
|
2864
|
+
}
|
|
2865
|
+
else {
|
|
2866
|
+
this.onClose.emit();
|
|
2867
|
+
this._panelDoneAnimating = false;
|
|
2868
|
+
this.overlayDir.offsetX = 0;
|
|
2869
|
+
this._changeDetectorRef.markForCheck();
|
|
2870
|
+
}
|
|
2871
|
+
};
|
|
2872
|
+
/**
|
|
2873
|
+
* When the panel content is done fading in, the _panelDoneAnimating property is
|
|
2874
|
+
* set so the proper class can be added to the panel.
|
|
2875
|
+
* @return {?}
|
|
2876
|
+
*/
|
|
2877
|
+
MdSelect.prototype._onFadeInDone = function () {
|
|
2878
|
+
this._panelDoneAnimating = this.panelOpen;
|
|
2879
|
+
this._changeDetectorRef.markForCheck();
|
|
2880
|
+
};
|
|
2881
|
+
/**
|
|
2882
|
+
* Calls the touched callback only if the panel is closed. Otherwise, the trigger will
|
|
2883
|
+
* "blur" to the panel when it opens, causing a false positive.
|
|
2884
|
+
* @return {?}
|
|
2885
|
+
*/
|
|
2886
|
+
MdSelect.prototype._onBlur = function () {
|
|
2887
|
+
if (!this.disabled && !this.panelOpen) {
|
|
2888
|
+
this._onTouched();
|
|
2889
|
+
this._changeDetectorRef.markForCheck();
|
|
2890
|
+
}
|
|
2891
|
+
};
|
|
2892
|
+
/**
|
|
2893
|
+
* Callback that is invoked when the overlay panel has been attached.
|
|
2894
|
+
* @return {?}
|
|
2895
|
+
*/
|
|
2896
|
+
MdSelect.prototype._onAttached = function () {
|
|
2897
|
+
this._calculateOverlayOffsetX();
|
|
2898
|
+
this._setScrollTop();
|
|
2899
|
+
};
|
|
2900
|
+
/**
|
|
2901
|
+
* Whether the select has a value.
|
|
2902
|
+
* @return {?}
|
|
2903
|
+
*/
|
|
2904
|
+
MdSelect.prototype._hasValue = function () {
|
|
2905
|
+
return this._selectionModel && this._selectionModel.hasValue();
|
|
2906
|
+
};
|
|
2907
|
+
/**
|
|
2908
|
+
* Whether the select is in an error state.
|
|
2909
|
+
* @return {?}
|
|
2910
|
+
*/
|
|
2911
|
+
MdSelect.prototype._isErrorState = function () {
|
|
2912
|
+
var /** @type {?} */ isInvalid = this._control && this._control.invalid;
|
|
2913
|
+
var /** @type {?} */ isTouched = this._control && this._control.touched;
|
|
2914
|
+
var /** @type {?} */ isSubmitted = (this._parentFormGroup && this._parentFormGroup.submitted) ||
|
|
2915
|
+
(this._parentForm && this._parentForm.submitted);
|
|
2916
|
+
return !!(isInvalid && (isTouched || isSubmitted));
|
|
2917
|
+
};
|
|
2918
|
+
/**
|
|
2919
|
+
* Sets the scroll position of the scroll container. This must be called after
|
|
2920
|
+
* the overlay pane is attached or the scroll container element will not yet be
|
|
2921
|
+
* present in the DOM.
|
|
2922
|
+
* @return {?}
|
|
2923
|
+
*/
|
|
2924
|
+
MdSelect.prototype._setScrollTop = function () {
|
|
2925
|
+
var /** @type {?} */ scrollContainer = this.overlayDir.overlayRef.overlayElement.querySelector('.mat-select-panel'); /** @type {?} */
|
|
2926
|
+
((scrollContainer)).scrollTop = this._scrollTop;
|
|
2927
|
+
};
|
|
2928
|
+
/**
|
|
2929
|
+
* @return {?}
|
|
2930
|
+
*/
|
|
2931
|
+
MdSelect.prototype._initializeSelection = function () {
|
|
2932
|
+
var _this = this;
|
|
2933
|
+
// Defer setting the value in order to avoid the "Expression
|
|
2934
|
+
// has changed after it was checked" errors from Angular.
|
|
2935
|
+
Promise.resolve().then(function () {
|
|
2936
|
+
_this._setSelectionByValue(_this._control ? _this._control.value : _this._value);
|
|
2937
|
+
});
|
|
2938
|
+
};
|
|
2939
|
+
/**
|
|
2940
|
+
* Sets the selected option based on a value. If no option can be
|
|
2941
|
+
* found with the designated value, the select trigger is cleared.
|
|
2942
|
+
* @param {?} value
|
|
2943
|
+
* @param {?=} isUserInput
|
|
2944
|
+
* @return {?}
|
|
2945
|
+
*/
|
|
2946
|
+
MdSelect.prototype._setSelectionByValue = function (value, isUserInput) {
|
|
2947
|
+
var _this = this;
|
|
2948
|
+
if (isUserInput === void 0) { isUserInput = false; }
|
|
2949
|
+
var /** @type {?} */ isArray = Array.isArray(value);
|
|
2950
|
+
if (this.multiple && value && !isArray) {
|
|
2951
|
+
throw getMdSelectNonArrayValueError();
|
|
2952
|
+
}
|
|
2953
|
+
this._clearSelection();
|
|
2954
|
+
if (isArray) {
|
|
2955
|
+
value.forEach(function (currentValue) { return _this._selectValue(currentValue, isUserInput); });
|
|
2956
|
+
this._sortValues();
|
|
2957
|
+
}
|
|
2958
|
+
else {
|
|
2959
|
+
var /** @type {?} */ correspondingOption = this._selectValue(value, isUserInput);
|
|
2960
|
+
// Shift focus to the active item. Note that we shouldn't do this in multiple
|
|
2961
|
+
// mode, because we don't know what option the user interacted with last.
|
|
2962
|
+
if (correspondingOption) {
|
|
2963
|
+
this._keyManager.setActiveItem(this.options.toArray().indexOf(correspondingOption));
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
2966
|
+
this._setValueWidth();
|
|
2967
|
+
if (this._selectionModel.isEmpty()) {
|
|
2968
|
+
this._placeholderState = '';
|
|
2969
|
+
}
|
|
2970
|
+
this._changeDetectorRef.markForCheck();
|
|
2971
|
+
};
|
|
2972
|
+
/**
|
|
2973
|
+
* Finds and selects and option based on its value.
|
|
2974
|
+
* @param {?} value
|
|
2975
|
+
* @param {?=} isUserInput
|
|
2976
|
+
* @return {?} Option that has the corresponding value.
|
|
2977
|
+
*/
|
|
2978
|
+
MdSelect.prototype._selectValue = function (value, isUserInput) {
|
|
2979
|
+
var _this = this;
|
|
2980
|
+
if (isUserInput === void 0) { isUserInput = false; }
|
|
2981
|
+
var /** @type {?} */ correspondingOption = this.options.find(function (option) {
|
|
2982
|
+
try {
|
|
2983
|
+
// Treat null as a special reset value.
|
|
2984
|
+
return option.value != null && _this._compareWith(option.value, value);
|
|
2985
|
+
}
|
|
2986
|
+
catch (error) {
|
|
2987
|
+
if (_angular_core.isDevMode()) {
|
|
2988
|
+
// Notify developers of errors in their comparator.
|
|
2989
|
+
console.warn(error);
|
|
2990
|
+
}
|
|
2991
|
+
return false;
|
|
2992
|
+
}
|
|
2993
|
+
});
|
|
2994
|
+
if (correspondingOption) {
|
|
2995
|
+
isUserInput ? correspondingOption._selectViaInteraction() : correspondingOption.select();
|
|
2996
|
+
this._selectionModel.select(correspondingOption);
|
|
2997
|
+
}
|
|
2998
|
+
return correspondingOption;
|
|
2999
|
+
};
|
|
3000
|
+
/**
|
|
3001
|
+
* Clears the select trigger and deselects every option in the list.
|
|
3002
|
+
* @param {?=} skip Option that should not be deselected.
|
|
3003
|
+
* @return {?}
|
|
3004
|
+
*/
|
|
3005
|
+
MdSelect.prototype._clearSelection = function (skip) {
|
|
3006
|
+
this._selectionModel.clear();
|
|
3007
|
+
this.options.forEach(function (option) {
|
|
3008
|
+
if (option !== skip) {
|
|
3009
|
+
option.deselect();
|
|
3010
|
+
}
|
|
3011
|
+
});
|
|
3012
|
+
};
|
|
3013
|
+
/**
|
|
3014
|
+
* @return {?}
|
|
3015
|
+
*/
|
|
3016
|
+
MdSelect.prototype._getTriggerRect = function () {
|
|
3017
|
+
return this.trigger.nativeElement.getBoundingClientRect();
|
|
3018
|
+
};
|
|
3019
|
+
/**
|
|
3020
|
+
* Sets up a key manager to listen to keyboard events on the overlay panel.
|
|
3021
|
+
* @return {?}
|
|
3022
|
+
*/
|
|
3023
|
+
MdSelect.prototype._initKeyManager = function () {
|
|
3024
|
+
var _this = this;
|
|
3025
|
+
this._keyManager = new _angular_cdk_a11y.FocusKeyManager(this.options).withTypeAhead();
|
|
3026
|
+
this._tabSubscription = this._keyManager.tabOut.subscribe(function () { return _this.close(); });
|
|
3027
|
+
};
|
|
3028
|
+
/**
|
|
3029
|
+
* Drops current option subscriptions and IDs and resets from scratch.
|
|
3030
|
+
* @return {?}
|
|
3031
|
+
*/
|
|
3032
|
+
MdSelect.prototype._resetOptions = function () {
|
|
3033
|
+
this._dropSubscriptions();
|
|
3034
|
+
this._listenToOptions();
|
|
3035
|
+
this._setOptionIds();
|
|
3036
|
+
this._setOptionMultiple();
|
|
3037
|
+
this._setOptionDisableRipple();
|
|
3038
|
+
};
|
|
3039
|
+
/**
|
|
3040
|
+
* Listens to user-generated selection events on each option.
|
|
3041
|
+
* @return {?}
|
|
3042
|
+
*/
|
|
3043
|
+
MdSelect.prototype._listenToOptions = function () {
|
|
3044
|
+
var _this = this;
|
|
3045
|
+
this._optionSubscription = _angular_cdk_rxjs.filter.call(this.optionSelectionChanges, function (event) { return event.isUserInput; }).subscribe(function (event) {
|
|
3046
|
+
_this._onSelect(event.source);
|
|
3047
|
+
_this._setValueWidth();
|
|
3048
|
+
if (!_this.multiple) {
|
|
3049
|
+
_this.close();
|
|
3050
|
+
}
|
|
3051
|
+
});
|
|
3052
|
+
};
|
|
3053
|
+
/**
|
|
3054
|
+
* Invoked when an option is clicked.
|
|
3055
|
+
* @param {?} option
|
|
3056
|
+
* @return {?}
|
|
3057
|
+
*/
|
|
3058
|
+
MdSelect.prototype._onSelect = function (option) {
|
|
3059
|
+
var /** @type {?} */ wasSelected = this._selectionModel.isSelected(option);
|
|
3060
|
+
// TODO(crisbeto): handle blank/null options inside multi-select.
|
|
3061
|
+
if (this.multiple) {
|
|
3062
|
+
this._selectionModel.toggle(option);
|
|
3063
|
+
wasSelected ? option.deselect() : option.select();
|
|
3064
|
+
this._sortValues();
|
|
3065
|
+
}
|
|
3066
|
+
else {
|
|
3067
|
+
this._clearSelection(option.value == null ? undefined : option);
|
|
3068
|
+
if (option.value == null) {
|
|
3069
|
+
this._propagateChanges(option.value);
|
|
3070
|
+
}
|
|
3071
|
+
else {
|
|
3072
|
+
this._selectionModel.select(option);
|
|
3073
|
+
}
|
|
3074
|
+
}
|
|
3075
|
+
if (wasSelected !== this._selectionModel.isSelected(option)) {
|
|
3076
|
+
this._propagateChanges();
|
|
3077
|
+
}
|
|
3078
|
+
};
|
|
3079
|
+
/**
|
|
3080
|
+
* Sorts the model values, ensuring that they keep the same
|
|
3081
|
+
* order that they have in the panel.
|
|
3082
|
+
* @return {?}
|
|
3083
|
+
*/
|
|
3084
|
+
MdSelect.prototype._sortValues = function () {
|
|
3085
|
+
var _this = this;
|
|
3086
|
+
if (this._multiple) {
|
|
3087
|
+
this._selectionModel.clear();
|
|
3088
|
+
this.options.forEach(function (option) {
|
|
3089
|
+
if (option.selected) {
|
|
3090
|
+
_this._selectionModel.select(option);
|
|
3091
|
+
}
|
|
3092
|
+
});
|
|
3093
|
+
}
|
|
3094
|
+
};
|
|
3095
|
+
/**
|
|
3096
|
+
* Unsubscribes from all option subscriptions.
|
|
3097
|
+
* @return {?}
|
|
3098
|
+
*/
|
|
3099
|
+
MdSelect.prototype._dropSubscriptions = function () {
|
|
3100
|
+
this._optionSubscription.unsubscribe();
|
|
3101
|
+
};
|
|
3102
|
+
/**
|
|
3103
|
+
* Emits change event to set the model value.
|
|
3104
|
+
* @param {?=} fallbackValue
|
|
3105
|
+
* @return {?}
|
|
3106
|
+
*/
|
|
3107
|
+
MdSelect.prototype._propagateChanges = function (fallbackValue) {
|
|
3108
|
+
var /** @type {?} */ valueToEmit = null;
|
|
3109
|
+
if (Array.isArray(this.selected)) {
|
|
3110
|
+
valueToEmit = this.selected.map(function (option) { return option.value; });
|
|
3111
|
+
}
|
|
3112
|
+
else {
|
|
3113
|
+
valueToEmit = this.selected ? this.selected.value : fallbackValue;
|
|
3114
|
+
}
|
|
3115
|
+
this._value = valueToEmit;
|
|
3116
|
+
this._onChange(valueToEmit);
|
|
3117
|
+
this.change.emit(new MdSelectChange(this, valueToEmit));
|
|
3118
|
+
this.valueChange.emit(valueToEmit);
|
|
3119
|
+
};
|
|
3120
|
+
/**
|
|
3121
|
+
* Records option IDs to pass to the aria-owns property.
|
|
3122
|
+
* @return {?}
|
|
3123
|
+
*/
|
|
3124
|
+
MdSelect.prototype._setOptionIds = function () {
|
|
3125
|
+
this._optionIds = this.options.map(function (option) { return option.id; }).join(' ');
|
|
3126
|
+
};
|
|
3127
|
+
/**
|
|
3128
|
+
* Sets the `multiple` property on each option. The promise is necessary
|
|
3129
|
+
* in order to avoid Angular errors when modifying the property after init.
|
|
3130
|
+
* @return {?}
|
|
3131
|
+
*/
|
|
3132
|
+
MdSelect.prototype._setOptionMultiple = function () {
|
|
3133
|
+
var _this = this;
|
|
3134
|
+
if (this.multiple) {
|
|
3135
|
+
Promise.resolve(null).then(function () {
|
|
3136
|
+
_this.options.forEach(function (option) { return option.multiple = _this.multiple; });
|
|
3137
|
+
});
|
|
3138
|
+
}
|
|
3139
|
+
};
|
|
3140
|
+
/**
|
|
3141
|
+
* Sets the `disableRipple` property on each option.
|
|
3142
|
+
* @return {?}
|
|
3143
|
+
*/
|
|
3144
|
+
MdSelect.prototype._setOptionDisableRipple = function () {
|
|
3145
|
+
var _this = this;
|
|
3146
|
+
if (this.options) {
|
|
3147
|
+
this.options.forEach(function (option) { return option.disableRipple = _this.disableRipple; });
|
|
3148
|
+
}
|
|
3149
|
+
};
|
|
3150
|
+
/**
|
|
3151
|
+
* Must set the width of the selected option's value programmatically
|
|
3152
|
+
* because it is absolutely positioned and otherwise will not clip
|
|
3153
|
+
* overflow. The selection arrow is 9px wide, add 4px of padding = 13
|
|
3154
|
+
* @return {?}
|
|
3155
|
+
*/
|
|
3156
|
+
MdSelect.prototype._setValueWidth = function () {
|
|
3157
|
+
this._selectedValueWidth = this._triggerWidth - 13;
|
|
3158
|
+
this._changeDetectorRef.markForCheck();
|
|
3159
|
+
};
|
|
3160
|
+
/**
|
|
3161
|
+
* Focuses the selected item. If no option is selected, it will focus
|
|
3162
|
+
* the first item instead.
|
|
3163
|
+
* @return {?}
|
|
3164
|
+
*/
|
|
3165
|
+
MdSelect.prototype._focusCorrectOption = function () {
|
|
3166
|
+
if (this._selectionModel.isEmpty()) {
|
|
3167
|
+
this._keyManager.setFirstItemActive();
|
|
3168
|
+
}
|
|
3169
|
+
else {
|
|
3170
|
+
this._keyManager.setActiveItem(/** @type {?} */ ((this._getOptionIndex(this._selectionModel.selected[0]))));
|
|
3171
|
+
}
|
|
3172
|
+
};
|
|
3173
|
+
/**
|
|
3174
|
+
* Focuses the select element.
|
|
3175
|
+
* @return {?}
|
|
3176
|
+
*/
|
|
3177
|
+
MdSelect.prototype.focus = function () {
|
|
3178
|
+
this._elementRef.nativeElement.focus();
|
|
3179
|
+
};
|
|
3180
|
+
/**
|
|
3181
|
+
* Gets the index of the provided option in the option list.
|
|
3182
|
+
* @param {?} option
|
|
3183
|
+
* @return {?}
|
|
3184
|
+
*/
|
|
3185
|
+
MdSelect.prototype._getOptionIndex = function (option) {
|
|
3186
|
+
return this.options.reduce(function (result, current, index) {
|
|
3187
|
+
return result === undefined ? (option === current ? index : undefined) : result;
|
|
3188
|
+
}, undefined);
|
|
3189
|
+
};
|
|
3190
|
+
/**
|
|
3191
|
+
* Calculates the scroll position and x- and y-offsets of the overlay panel.
|
|
3192
|
+
* @return {?}
|
|
3193
|
+
*/
|
|
3194
|
+
MdSelect.prototype._calculateOverlayPosition = function () {
|
|
3195
|
+
var /** @type {?} */ items = this._getItemCount();
|
|
3196
|
+
var /** @type {?} */ panelHeight = Math.min(items * SELECT_ITEM_HEIGHT, SELECT_PANEL_MAX_HEIGHT);
|
|
3197
|
+
var /** @type {?} */ scrollContainerHeight = items * SELECT_ITEM_HEIGHT;
|
|
3198
|
+
// The farthest the panel can be scrolled before it hits the bottom
|
|
3199
|
+
var /** @type {?} */ maxScroll = scrollContainerHeight - panelHeight;
|
|
3200
|
+
if (this._hasValue()) {
|
|
3201
|
+
var /** @type {?} */ selectedOptionOffset = ((this._getOptionIndex(this._selectionModel.selected[0])));
|
|
3202
|
+
selectedOptionOffset += MdOption.countGroupLabelsBeforeOption(selectedOptionOffset, this.options, this.optionGroups);
|
|
3203
|
+
// We must maintain a scroll buffer so the selected option will be scrolled to the
|
|
3204
|
+
// center of the overlay panel rather than the top.
|
|
3205
|
+
var /** @type {?} */ scrollBuffer = panelHeight / 2;
|
|
3206
|
+
this._scrollTop = this._calculateOverlayScroll(selectedOptionOffset, scrollBuffer, maxScroll);
|
|
3207
|
+
this._offsetY = this._calculateOverlayOffsetY(selectedOptionOffset, scrollBuffer, maxScroll);
|
|
3208
|
+
}
|
|
3209
|
+
else {
|
|
3210
|
+
// If no option is selected, the panel centers on the first option. In this case,
|
|
3211
|
+
// we must only adjust for the height difference between the option element
|
|
3212
|
+
// and the trigger element, then multiply it by -1 to ensure the panel moves
|
|
3213
|
+
// in the correct direction up the page.
|
|
3214
|
+
var /** @type {?} */ groupLabels = MdOption.countGroupLabelsBeforeOption(0, this.options, this.optionGroups);
|
|
3215
|
+
this._offsetY = (SELECT_ITEM_HEIGHT - SELECT_TRIGGER_HEIGHT) / 2 * -1 -
|
|
3216
|
+
(groupLabels * SELECT_ITEM_HEIGHT);
|
|
3217
|
+
}
|
|
3218
|
+
this._checkOverlayWithinViewport(maxScroll);
|
|
3219
|
+
};
|
|
3220
|
+
/**
|
|
3221
|
+
* Calculates the scroll position of the select's overlay panel.
|
|
3222
|
+
*
|
|
3223
|
+
* Attempts to center the selected option in the panel. If the option is
|
|
3224
|
+
* too high or too low in the panel to be scrolled to the center, it clamps the
|
|
3225
|
+
* scroll position to the min or max scroll positions respectively.
|
|
3226
|
+
* @param {?} selectedIndex
|
|
3227
|
+
* @param {?} scrollBuffer
|
|
3228
|
+
* @param {?} maxScroll
|
|
3229
|
+
* @return {?}
|
|
3230
|
+
*/
|
|
3231
|
+
MdSelect.prototype._calculateOverlayScroll = function (selectedIndex, scrollBuffer, maxScroll) {
|
|
3232
|
+
var /** @type {?} */ optionOffsetFromScrollTop = SELECT_ITEM_HEIGHT * selectedIndex;
|
|
3233
|
+
var /** @type {?} */ halfOptionHeight = SELECT_ITEM_HEIGHT / 2;
|
|
3234
|
+
// Starts at the optionOffsetFromScrollTop, which scrolls the option to the top of the
|
|
3235
|
+
// scroll container, then subtracts the scroll buffer to scroll the option down to
|
|
3236
|
+
// the center of the overlay panel. Half the option height must be re-added to the
|
|
3237
|
+
// scrollTop so the option is centered based on its middle, not its top edge.
|
|
3238
|
+
var /** @type {?} */ optimalScrollPosition = optionOffsetFromScrollTop - scrollBuffer + halfOptionHeight;
|
|
3239
|
+
return clampValue(0, optimalScrollPosition, maxScroll);
|
|
3240
|
+
};
|
|
3241
|
+
/**
|
|
3242
|
+
* Figures out the appropriate animation state for the placeholder.
|
|
3243
|
+
* @return {?}
|
|
3244
|
+
*/
|
|
3245
|
+
MdSelect.prototype._getPlaceholderAnimationState = function () {
|
|
3246
|
+
if (this.floatPlaceholder === 'never') {
|
|
3247
|
+
return '';
|
|
3248
|
+
}
|
|
3249
|
+
if (this.floatPlaceholder === 'always') {
|
|
3250
|
+
return this._floatPlaceholderState();
|
|
3251
|
+
}
|
|
3252
|
+
return this._placeholderState;
|
|
3253
|
+
};
|
|
3254
|
+
/**
|
|
3255
|
+
* Determines the CSS `opacity` of the placeholder element.
|
|
3256
|
+
* @return {?}
|
|
3257
|
+
*/
|
|
3258
|
+
MdSelect.prototype._getPlaceholderOpacity = function () {
|
|
3259
|
+
return (this.floatPlaceholder !== 'never' || this._selectionModel.isEmpty()) ? '1' : '0';
|
|
3260
|
+
};
|
|
3261
|
+
Object.defineProperty(MdSelect.prototype, "_ariaLabel", {
|
|
3262
|
+
/**
|
|
3263
|
+
* Returns the aria-label of the select component.
|
|
3264
|
+
* @return {?}
|
|
3265
|
+
*/
|
|
3266
|
+
get: function () {
|
|
3267
|
+
// If an ariaLabelledby value has been set, the select should not overwrite the
|
|
3268
|
+
// `aria-labelledby` value by setting the ariaLabel to the placeholder.
|
|
3269
|
+
return this.ariaLabelledby ? null : this.ariaLabel || this.placeholder;
|
|
3270
|
+
},
|
|
3271
|
+
enumerable: true,
|
|
3272
|
+
configurable: true
|
|
3273
|
+
});
|
|
3274
|
+
/**
|
|
3275
|
+
* Sets the x-offset of the overlay panel in relation to the trigger's top start corner.
|
|
3276
|
+
* This must be adjusted to align the selected option text over the trigger text when
|
|
3277
|
+
* the panel opens. Will change based on LTR or RTL text direction. Note that the offset
|
|
3278
|
+
* can't be calculated until the panel has been attached, because we need to know the
|
|
3279
|
+
* content width in order to constrain the panel within the viewport.
|
|
3280
|
+
* @return {?}
|
|
3281
|
+
*/
|
|
3282
|
+
MdSelect.prototype._calculateOverlayOffsetX = function () {
|
|
3283
|
+
var /** @type {?} */ overlayRect = this.overlayDir.overlayRef.overlayElement.getBoundingClientRect();
|
|
3284
|
+
var /** @type {?} */ viewportRect = this._viewportRuler.getViewportRect();
|
|
3285
|
+
var /** @type {?} */ isRtl = this._isRtl();
|
|
3286
|
+
var /** @type {?} */ paddingWidth = this.multiple ? SELECT_MULTIPLE_PANEL_PADDING_X + SELECT_PANEL_PADDING_X :
|
|
3287
|
+
SELECT_PANEL_PADDING_X * 2;
|
|
3288
|
+
var /** @type {?} */ offsetX;
|
|
3289
|
+
// Adjust the offset, depending on the option padding.
|
|
3290
|
+
if (this.multiple) {
|
|
3291
|
+
offsetX = SELECT_MULTIPLE_PANEL_PADDING_X;
|
|
3292
|
+
}
|
|
3293
|
+
else {
|
|
3294
|
+
var /** @type {?} */ selected = this._selectionModel.selected[0] || this.options.first;
|
|
3295
|
+
offsetX = selected && selected.group ? SELECT_PANEL_INDENT_PADDING_X : SELECT_PANEL_PADDING_X;
|
|
3296
|
+
}
|
|
3297
|
+
// Invert the offset in LTR.
|
|
3298
|
+
if (!isRtl) {
|
|
3299
|
+
offsetX *= -1;
|
|
3300
|
+
}
|
|
3301
|
+
// Determine how much the select overflows on each side.
|
|
3302
|
+
var /** @type {?} */ leftOverflow = 0 - (overlayRect.left + offsetX - (isRtl ? paddingWidth : 0));
|
|
3303
|
+
var /** @type {?} */ rightOverflow = overlayRect.right + offsetX - viewportRect.width
|
|
3304
|
+
+ (isRtl ? 0 : paddingWidth);
|
|
3305
|
+
// If the element overflows on either side, reduce the offset to allow it to fit.
|
|
3306
|
+
if (leftOverflow > 0) {
|
|
3307
|
+
offsetX += leftOverflow + SELECT_PANEL_VIEWPORT_PADDING;
|
|
3308
|
+
}
|
|
3309
|
+
else if (rightOverflow > 0) {
|
|
3310
|
+
offsetX -= rightOverflow + SELECT_PANEL_VIEWPORT_PADDING;
|
|
3311
|
+
}
|
|
3312
|
+
// Set the offset directly in order to avoid having to go through change detection and
|
|
3313
|
+
// potentially triggering "changed after it was checked" errors.
|
|
3314
|
+
this.overlayDir.offsetX = offsetX;
|
|
3315
|
+
this.overlayDir.overlayRef.updatePosition();
|
|
3316
|
+
};
|
|
3317
|
+
/**
|
|
3318
|
+
* Calculates the y-offset of the select's overlay panel in relation to the
|
|
3319
|
+
* top start corner of the trigger. It has to be adjusted in order for the
|
|
3320
|
+
* selected option to be aligned over the trigger when the panel opens.
|
|
3321
|
+
* @param {?} selectedIndex
|
|
3322
|
+
* @param {?} scrollBuffer
|
|
3323
|
+
* @param {?} maxScroll
|
|
3324
|
+
* @return {?}
|
|
3325
|
+
*/
|
|
3326
|
+
MdSelect.prototype._calculateOverlayOffsetY = function (selectedIndex, scrollBuffer, maxScroll) {
|
|
3327
|
+
var /** @type {?} */ optionOffsetFromPanelTop;
|
|
3328
|
+
if (this._scrollTop === 0) {
|
|
3329
|
+
optionOffsetFromPanelTop = selectedIndex * SELECT_ITEM_HEIGHT;
|
|
3330
|
+
}
|
|
3331
|
+
else if (this._scrollTop === maxScroll) {
|
|
3332
|
+
var /** @type {?} */ firstDisplayedIndex = this._getItemCount() - SELECT_MAX_OPTIONS_DISPLAYED;
|
|
3333
|
+
var /** @type {?} */ selectedDisplayIndex = selectedIndex - firstDisplayedIndex;
|
|
3334
|
+
// Because the panel height is longer than the height of the options alone,
|
|
3335
|
+
// there is always extra padding at the top or bottom of the panel. When
|
|
3336
|
+
// scrolled to the very bottom, this padding is at the top of the panel and
|
|
3337
|
+
// must be added to the offset.
|
|
3338
|
+
optionOffsetFromPanelTop =
|
|
3339
|
+
selectedDisplayIndex * SELECT_ITEM_HEIGHT + SELECT_PANEL_PADDING_Y;
|
|
3340
|
+
}
|
|
3341
|
+
else {
|
|
3342
|
+
// If the option was scrolled to the middle of the panel using a scroll buffer,
|
|
3343
|
+
// its offset will be the scroll buffer minus the half height that was added to
|
|
3344
|
+
// center it.
|
|
3345
|
+
optionOffsetFromPanelTop = scrollBuffer - SELECT_ITEM_HEIGHT / 2;
|
|
3346
|
+
}
|
|
3347
|
+
// The final offset is the option's offset from the top, adjusted for the height
|
|
3348
|
+
// difference, multiplied by -1 to ensure that the overlay moves in the correct
|
|
3349
|
+
// direction up the page.
|
|
3350
|
+
return optionOffsetFromPanelTop * -1 - SELECT_OPTION_HEIGHT_ADJUSTMENT;
|
|
3351
|
+
};
|
|
3352
|
+
/**
|
|
3353
|
+
* Checks that the attempted overlay position will fit within the viewport.
|
|
3354
|
+
* If it will not fit, tries to adjust the scroll position and the associated
|
|
3355
|
+
* y-offset so the panel can open fully on-screen. If it still won't fit,
|
|
3356
|
+
* sets the offset back to 0 to allow the fallback position to take over.
|
|
3357
|
+
* @param {?} maxScroll
|
|
3358
|
+
* @return {?}
|
|
3359
|
+
*/
|
|
3360
|
+
MdSelect.prototype._checkOverlayWithinViewport = function (maxScroll) {
|
|
3361
|
+
var /** @type {?} */ viewportRect = this._viewportRuler.getViewportRect();
|
|
3362
|
+
var /** @type {?} */ triggerRect = this._getTriggerRect();
|
|
3363
|
+
var /** @type {?} */ topSpaceAvailable = triggerRect.top - SELECT_PANEL_VIEWPORT_PADDING;
|
|
3364
|
+
var /** @type {?} */ bottomSpaceAvailable = viewportRect.height - triggerRect.bottom - SELECT_PANEL_VIEWPORT_PADDING;
|
|
3365
|
+
var /** @type {?} */ panelHeightTop = Math.abs(this._offsetY);
|
|
3366
|
+
var /** @type {?} */ totalPanelHeight = Math.min(this._getItemCount() * SELECT_ITEM_HEIGHT, SELECT_PANEL_MAX_HEIGHT);
|
|
3367
|
+
var /** @type {?} */ panelHeightBottom = totalPanelHeight - panelHeightTop - triggerRect.height;
|
|
3368
|
+
if (panelHeightBottom > bottomSpaceAvailable) {
|
|
3369
|
+
this._adjustPanelUp(panelHeightBottom, bottomSpaceAvailable);
|
|
3370
|
+
}
|
|
3371
|
+
else if (panelHeightTop > topSpaceAvailable) {
|
|
3372
|
+
this._adjustPanelDown(panelHeightTop, topSpaceAvailable, maxScroll);
|
|
3373
|
+
}
|
|
3374
|
+
else {
|
|
3375
|
+
this._transformOrigin = this._getOriginBasedOnOption();
|
|
3376
|
+
}
|
|
3377
|
+
};
|
|
3378
|
+
/**
|
|
3379
|
+
* Adjusts the overlay panel up to fit in the viewport.
|
|
3380
|
+
* @param {?} panelHeightBottom
|
|
3381
|
+
* @param {?} bottomSpaceAvailable
|
|
3382
|
+
* @return {?}
|
|
3383
|
+
*/
|
|
3384
|
+
MdSelect.prototype._adjustPanelUp = function (panelHeightBottom, bottomSpaceAvailable) {
|
|
3385
|
+
var /** @type {?} */ distanceBelowViewport = panelHeightBottom - bottomSpaceAvailable;
|
|
3386
|
+
// Scrolls the panel up by the distance it was extending past the boundary, then
|
|
3387
|
+
// adjusts the offset by that amount to move the panel up into the viewport.
|
|
3388
|
+
this._scrollTop -= distanceBelowViewport;
|
|
3389
|
+
this._offsetY -= distanceBelowViewport;
|
|
3390
|
+
this._transformOrigin = this._getOriginBasedOnOption();
|
|
3391
|
+
// If the panel is scrolled to the very top, it won't be able to fit the panel
|
|
3392
|
+
// by scrolling, so set the offset to 0 to allow the fallback position to take
|
|
3393
|
+
// effect.
|
|
3394
|
+
if (this._scrollTop <= 0) {
|
|
3395
|
+
this._scrollTop = 0;
|
|
3396
|
+
this._offsetY = 0;
|
|
3397
|
+
this._transformOrigin = "50% bottom 0px";
|
|
3398
|
+
}
|
|
3399
|
+
};
|
|
3400
|
+
/**
|
|
3401
|
+
* Adjusts the overlay panel down to fit in the viewport.
|
|
3402
|
+
* @param {?} panelHeightTop
|
|
3403
|
+
* @param {?} topSpaceAvailable
|
|
3404
|
+
* @param {?} maxScroll
|
|
3405
|
+
* @return {?}
|
|
3406
|
+
*/
|
|
3407
|
+
MdSelect.prototype._adjustPanelDown = function (panelHeightTop, topSpaceAvailable, maxScroll) {
|
|
3408
|
+
var /** @type {?} */ distanceAboveViewport = panelHeightTop - topSpaceAvailable;
|
|
3409
|
+
// Scrolls the panel down by the distance it was extending past the boundary, then
|
|
3410
|
+
// adjusts the offset by that amount to move the panel down into the viewport.
|
|
3411
|
+
this._scrollTop += distanceAboveViewport;
|
|
3412
|
+
this._offsetY += distanceAboveViewport;
|
|
3413
|
+
this._transformOrigin = this._getOriginBasedOnOption();
|
|
3414
|
+
// If the panel is scrolled to the very bottom, it won't be able to fit the
|
|
3415
|
+
// panel by scrolling, so set the offset to 0 to allow the fallback position
|
|
3416
|
+
// to take effect.
|
|
3417
|
+
if (this._scrollTop >= maxScroll) {
|
|
3418
|
+
this._scrollTop = maxScroll;
|
|
3419
|
+
this._offsetY = 0;
|
|
3420
|
+
this._transformOrigin = "50% top 0px";
|
|
3421
|
+
return;
|
|
3422
|
+
}
|
|
3423
|
+
};
|
|
3424
|
+
/**
|
|
3425
|
+
* Sets the transform origin point based on the selected option.
|
|
3426
|
+
* @return {?}
|
|
3427
|
+
*/
|
|
3428
|
+
MdSelect.prototype._getOriginBasedOnOption = function () {
|
|
3429
|
+
var /** @type {?} */ originY = Math.abs(this._offsetY) - SELECT_OPTION_HEIGHT_ADJUSTMENT + SELECT_ITEM_HEIGHT / 2;
|
|
3430
|
+
return "50% " + originY + "px 0px";
|
|
3431
|
+
};
|
|
3432
|
+
/**
|
|
3433
|
+
* Figures out the floating placeholder state value.
|
|
3434
|
+
* @return {?}
|
|
3435
|
+
*/
|
|
3436
|
+
MdSelect.prototype._floatPlaceholderState = function () {
|
|
3437
|
+
return this._isRtl() ? 'floating-rtl' : 'floating-ltr';
|
|
3438
|
+
};
|
|
3439
|
+
/**
|
|
3440
|
+
* Handles the user pressing the arrow keys on a closed select.
|
|
3441
|
+
* @param {?} event
|
|
3442
|
+
* @return {?}
|
|
3443
|
+
*/
|
|
3444
|
+
MdSelect.prototype._handleArrowKey = function (event) {
|
|
3445
|
+
if (this._multiple) {
|
|
3446
|
+
event.preventDefault();
|
|
3447
|
+
this.open();
|
|
3448
|
+
}
|
|
3449
|
+
else {
|
|
3450
|
+
var /** @type {?} */ prevActiveItem = this._keyManager.activeItem;
|
|
3451
|
+
// Cycle though the select options even when the select is closed,
|
|
3452
|
+
// matching the behavior of the native select element.
|
|
3453
|
+
// TODO(crisbeto): native selects also cycle through the options with left/right arrows,
|
|
3454
|
+
// however the key manager only supports up/down at the moment.
|
|
3455
|
+
this._keyManager.onKeydown(event);
|
|
3456
|
+
var /** @type {?} */ currentActiveItem = (this._keyManager.activeItem);
|
|
3457
|
+
if (currentActiveItem !== prevActiveItem) {
|
|
3458
|
+
this._clearSelection();
|
|
3459
|
+
this._setSelectionByValue(currentActiveItem.value, true);
|
|
3460
|
+
this._propagateChanges();
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
};
|
|
3464
|
+
/**
|
|
3465
|
+
* Calculates the amount of items in the select. This includes options and group labels.
|
|
3466
|
+
* @return {?}
|
|
3467
|
+
*/
|
|
3468
|
+
MdSelect.prototype._getItemCount = function () {
|
|
3469
|
+
return this.options.length + this.optionGroups.length;
|
|
3470
|
+
};
|
|
3471
|
+
return MdSelect;
|
|
3472
|
+
}(_MdSelectMixinBase));
|
|
3473
|
+
MdSelect.decorators = [
|
|
3474
|
+
{ type: _angular_core.Component, args: [{ selector: 'md-select, mat-select',
|
|
3475
|
+
template: "<div cdk-overlay-origin class=\"mat-select-trigger\" aria-hidden=\"true\" (click)=\"toggle()\" #origin=\"cdkOverlayOrigin\" #trigger><span class=\"mat-select-placeholder\" [class.mat-floating-placeholder]=\"_hasValue()\" [@transformPlaceholder]=\"_getPlaceholderAnimationState()\" [style.opacity]=\"_getPlaceholderOpacity()\" [style.width.px]=\"_selectedValueWidth\">{{ placeholder }}</span> <span class=\"mat-select-value\" *ngIf=\"_hasValue()\"><span class=\"mat-select-value-text\" [ngSwitch]=\"!!customTrigger\"><span *ngSwitchDefault>{{ triggerValue }}</span><ng-content select=\"md-select-trigger, mat-select-trigger\" *ngSwitchCase=\"true\"></ng-content></span></span><span class=\"mat-select-arrow\"></span> <span class=\"mat-select-underline\"></span></div><ng-template cdk-connected-overlay hasBackdrop backdropClass=\"cdk-overlay-transparent-backdrop\" [scrollStrategy]=\"_scrollStrategy\" [origin]=\"origin\" [open]=\"panelOpen\" [positions]=\"_positions\" [minWidth]=\"_triggerWidth\" [offsetY]=\"_offsetY\" (backdropClick)=\"close()\" (attach)=\"_onAttached()\" (detach)=\"close()\"><div class=\"mat-select-panel {{ 'mat-' + color }}\" [ngClass]=\"panelClass\" [@transformPanel]=\"multiple ? 'showing-multiple' : 'showing'\" (@transformPanel.done)=\"_onPanelDone()\" (keydown)=\"_handlePanelKeydown($event)\" [style.transformOrigin]=\"_transformOrigin\" [class.mat-select-panel-done-animating]=\"_panelDoneAnimating\"><div class=\"mat-select-content\" [@fadeInContent]=\"'showing'\" (@fadeInContent.done)=\"_onFadeInDone()\"><ng-content></ng-content></div></div></ng-template>",
|
|
3476
|
+
styles: [".mat-select{display:inline-block;outline:0}.mat-select-trigger{display:flex;align-items:center;height:30px;min-width:112px;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-underline{position:absolute;bottom:0;left:0;right:0;height:1px}.mat-select:focus .mat-select-underline{height:2px}.mat-select-disabled .mat-select-underline{background-color:transparent;background-position:0 bottom}.mat-select-placeholder{position:relative;padding:0 2px;transform-origin:left top;flex-grow:1}.mat-select-placeholder.mat-floating-placeholder{top:-22px;left:-2px;text-align:left;transform:scale(.75)}[dir=rtl] .mat-select-placeholder{transform-origin:right top}[dir=rtl] .mat-select-placeholder.mat-floating-placeholder{left:2px;text-align:right}.mat-select-required .mat-select-placeholder::after{content:' *'}.mat-select-value{position:absolute;max-width:calc(100% - 18px);flex-grow:1;top:0;left:0;bottom:0;display:flex;align-items:center}[dir=rtl] .mat-select-value{left:auto;right:0}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:30px}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%}.mat-select-panel:not([class*=mat-elevation-z]){box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}@media screen and (-ms-high-contrast:active){.mat-select-panel{outline:solid 1px}}"],
|
|
3477
|
+
inputs: ['color', 'disabled', 'tabIndex'],
|
|
3478
|
+
encapsulation: _angular_core.ViewEncapsulation.None,
|
|
3479
|
+
preserveWhitespaces: false,
|
|
3480
|
+
changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
|
|
3481
|
+
host: {
|
|
3482
|
+
'role': 'listbox',
|
|
3483
|
+
'[attr.tabindex]': 'tabIndex',
|
|
3484
|
+
'[attr.aria-label]': '_ariaLabel',
|
|
3485
|
+
'[attr.aria-labelledby]': 'ariaLabelledby',
|
|
3486
|
+
'[attr.aria-required]': 'required.toString()',
|
|
3487
|
+
'[attr.aria-disabled]': 'disabled.toString()',
|
|
3488
|
+
'[attr.aria-invalid]': '_isErrorState()',
|
|
3489
|
+
'[attr.aria-owns]': '_optionIds',
|
|
3490
|
+
'[attr.aria-multiselectable]': 'multiple',
|
|
3491
|
+
'[class.mat-select-disabled]': 'disabled',
|
|
3492
|
+
'[class.mat-select-invalid]': '_isErrorState()',
|
|
3493
|
+
'[class.mat-select-required]': 'required',
|
|
3494
|
+
'class': 'mat-select',
|
|
3495
|
+
'(keydown)': '_handleClosedKeydown($event)',
|
|
3496
|
+
'(blur)': '_onBlur()',
|
|
3497
|
+
},
|
|
3498
|
+
animations: [
|
|
3499
|
+
transformPlaceholder,
|
|
3500
|
+
transformPanel,
|
|
3501
|
+
fadeInContent
|
|
3502
|
+
],
|
|
3503
|
+
exportAs: 'mdSelect, matSelect',
|
|
3504
|
+
},] },
|
|
3505
|
+
];
|
|
3506
|
+
/**
|
|
3507
|
+
* @nocollapse
|
|
3508
|
+
*/
|
|
3509
|
+
MdSelect.ctorParameters = function () { return [
|
|
3510
|
+
{ type: _angular_cdk_overlay.ViewportRuler, },
|
|
3511
|
+
{ type: _angular_core.ChangeDetectorRef, },
|
|
3512
|
+
{ type: _angular_cdk_platform.Platform, },
|
|
3513
|
+
{ type: _angular_core.Renderer2, },
|
|
3514
|
+
{ type: _angular_core.ElementRef, },
|
|
3515
|
+
{ type: _angular_cdk_bidi.Directionality, decorators: [{ type: _angular_core.Optional },] },
|
|
3516
|
+
{ type: _angular_forms.NgForm, decorators: [{ type: _angular_core.Optional },] },
|
|
3517
|
+
{ type: _angular_forms.FormGroupDirective, decorators: [{ type: _angular_core.Optional },] },
|
|
3518
|
+
{ type: _angular_forms.NgControl, decorators: [{ type: _angular_core.Self }, { type: _angular_core.Optional },] },
|
|
3519
|
+
{ type: undefined, decorators: [{ type: _angular_core.Attribute, args: ['tabindex',] },] },
|
|
3520
|
+
{ type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [MD_PLACEHOLDER_GLOBAL_OPTIONS,] },] },
|
|
3521
|
+
{ type: undefined, decorators: [{ type: _angular_core.Inject, args: [MD_SELECT_SCROLL_STRATEGY,] },] },
|
|
3522
|
+
]; };
|
|
3523
|
+
MdSelect.propDecorators = {
|
|
3524
|
+
'trigger': [{ type: _angular_core.ViewChild, args: ['trigger',] },],
|
|
3525
|
+
'overlayDir': [{ type: _angular_core.ViewChild, args: [_angular_cdk_overlay.ConnectedOverlayDirective,] },],
|
|
3526
|
+
'options': [{ type: _angular_core.ContentChildren, args: [MdOption, { descendants: true },] },],
|
|
3527
|
+
'optionGroups': [{ type: _angular_core.ContentChildren, args: [MdOptgroup,] },],
|
|
3528
|
+
'panelClass': [{ type: _angular_core.Input },],
|
|
3529
|
+
'customTrigger': [{ type: _angular_core.ContentChild, args: [MdSelectTrigger,] },],
|
|
3530
|
+
'placeholder': [{ type: _angular_core.Input },],
|
|
3531
|
+
'required': [{ type: _angular_core.Input },],
|
|
3532
|
+
'multiple': [{ type: _angular_core.Input },],
|
|
3533
|
+
'compareWith': [{ type: _angular_core.Input },],
|
|
3534
|
+
'floatPlaceholder': [{ type: _angular_core.Input },],
|
|
3535
|
+
'value': [{ type: _angular_core.Input },],
|
|
3536
|
+
'disableRipple': [{ type: _angular_core.Input },],
|
|
3537
|
+
'ariaLabel': [{ type: _angular_core.Input, args: ['aria-label',] },],
|
|
3538
|
+
'ariaLabelledby': [{ type: _angular_core.Input, args: ['aria-labelledby',] },],
|
|
3539
|
+
'onOpen': [{ type: _angular_core.Output },],
|
|
3540
|
+
'onClose': [{ type: _angular_core.Output },],
|
|
3541
|
+
'change': [{ type: _angular_core.Output },],
|
|
3542
|
+
'valueChange': [{ type: _angular_core.Output },],
|
|
3543
|
+
};
|
|
3544
|
+
/**
|
|
3545
|
+
* Clamps a value n between min and max values.
|
|
3546
|
+
* @param {?} min
|
|
3547
|
+
* @param {?} n
|
|
3548
|
+
* @param {?} max
|
|
3549
|
+
* @return {?}
|
|
3550
|
+
*/
|
|
3551
|
+
function clampValue(min, n, max) {
|
|
3552
|
+
return Math.min(Math.max(min, n), max);
|
|
3553
|
+
}
|
|
3554
|
+
var MdSelectModule = (function () {
|
|
3555
|
+
function MdSelectModule() {
|
|
3556
|
+
}
|
|
3557
|
+
return MdSelectModule;
|
|
3558
|
+
}());
|
|
3559
|
+
MdSelectModule.decorators = [
|
|
3560
|
+
{ type: _angular_core.NgModule, args: [{
|
|
3561
|
+
imports: [
|
|
3562
|
+
_angular_common.CommonModule,
|
|
3563
|
+
_angular_cdk_overlay.OverlayModule,
|
|
3564
|
+
MdOptionModule,
|
|
3565
|
+
MdCommonModule,
|
|
3566
|
+
],
|
|
3567
|
+
exports: [MdSelect, MdSelectTrigger, MdOptionModule, MdCommonModule],
|
|
3568
|
+
declarations: [MdSelect, MdSelectTrigger],
|
|
3569
|
+
providers: [MD_SELECT_SCROLL_STRATEGY_PROVIDER]
|
|
3570
|
+
},] },
|
|
3571
|
+
];
|
|
3572
|
+
/**
|
|
3573
|
+
* @nocollapse
|
|
3574
|
+
*/
|
|
3575
|
+
MdSelectModule.ctorParameters = function () { return []; };
|
|
3576
|
+
|
|
3577
|
+
exports.fadeInContent = fadeInContent;
|
|
3578
|
+
exports.transformPanel = transformPanel;
|
|
3579
|
+
exports.transformPlaceholder = transformPlaceholder;
|
|
3580
|
+
exports.MdSelectModule = MdSelectModule;
|
|
3581
|
+
exports.SELECT_ITEM_HEIGHT = SELECT_ITEM_HEIGHT;
|
|
3582
|
+
exports.SELECT_PANEL_MAX_HEIGHT = SELECT_PANEL_MAX_HEIGHT;
|
|
3583
|
+
exports.SELECT_MAX_OPTIONS_DISPLAYED = SELECT_MAX_OPTIONS_DISPLAYED;
|
|
3584
|
+
exports.SELECT_TRIGGER_HEIGHT = SELECT_TRIGGER_HEIGHT;
|
|
3585
|
+
exports.SELECT_OPTION_HEIGHT_ADJUSTMENT = SELECT_OPTION_HEIGHT_ADJUSTMENT;
|
|
3586
|
+
exports.SELECT_PANEL_PADDING_X = SELECT_PANEL_PADDING_X;
|
|
3587
|
+
exports.SELECT_PANEL_INDENT_PADDING_X = SELECT_PANEL_INDENT_PADDING_X;
|
|
3588
|
+
exports.SELECT_MULTIPLE_PANEL_PADDING_X = SELECT_MULTIPLE_PANEL_PADDING_X;
|
|
3589
|
+
exports.SELECT_PANEL_PADDING_Y = SELECT_PANEL_PADDING_Y;
|
|
3590
|
+
exports.SELECT_PANEL_VIEWPORT_PADDING = SELECT_PANEL_VIEWPORT_PADDING;
|
|
3591
|
+
exports.MD_SELECT_SCROLL_STRATEGY = MD_SELECT_SCROLL_STRATEGY;
|
|
3592
|
+
exports.MD_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY = MD_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY;
|
|
3593
|
+
exports.MD_SELECT_SCROLL_STRATEGY_PROVIDER = MD_SELECT_SCROLL_STRATEGY_PROVIDER;
|
|
3594
|
+
exports.MdSelectChange = MdSelectChange;
|
|
3595
|
+
exports.MdSelectBase = MdSelectBase;
|
|
3596
|
+
exports._MdSelectMixinBase = _MdSelectMixinBase;
|
|
3597
|
+
exports.MdSelectTrigger = MdSelectTrigger;
|
|
3598
|
+
exports.MdSelect = MdSelect;
|
|
3599
|
+
exports.MAT_SELECT_SCROLL_STRATEGY = MD_SELECT_SCROLL_STRATEGY;
|
|
3600
|
+
exports.MAT_SELECT_SCROLL_STRATEGY_PROVIDER = MD_SELECT_SCROLL_STRATEGY_PROVIDER;
|
|
3601
|
+
exports.MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY = MD_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY;
|
|
3602
|
+
exports.MatSelect = MdSelect;
|
|
3603
|
+
exports.MatSelectBase = MdSelectBase;
|
|
3604
|
+
exports.MatSelectChange = MdSelectChange;
|
|
3605
|
+
exports.MatSelectModule = MdSelectModule;
|
|
3606
|
+
exports.MatSelectTrigger = MdSelectTrigger;
|
|
3607
|
+
|
|
3608
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3609
|
+
|
|
3610
|
+
})));
|
|
3611
|
+
//# sourceMappingURL=material-select.umd.js.map
|