@angular/material 15.0.0-rc.0 → 15.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_index.scss +1 -1
- package/checkbox/_checkbox-private.scss +1 -1
- package/chips/_chips-theme.scss +11 -19
- package/chips/index.d.ts +0 -2
- package/core/density/private/_all-density.scss +5 -9
- package/core/theming/_all-theme.scss +14 -18
- package/core/typography/_all-typography.scss +15 -19
- package/core/typography/_typography-deprecated.scss +1 -1
- package/core/typography/_typography.scss +130 -0
- package/esm2020/autocomplete/autocomplete-origin.mjs +6 -6
- package/esm2020/autocomplete/autocomplete-trigger.mjs +6 -6
- package/esm2020/autocomplete/autocomplete.mjs +6 -6
- package/esm2020/autocomplete/module.mjs +4 -4
- package/esm2020/badge/badge-module.mjs +4 -4
- package/esm2020/badge/badge.mjs +3 -3
- package/esm2020/bottom-sheet/bottom-sheet-container.mjs +3 -3
- package/esm2020/bottom-sheet/bottom-sheet-module.mjs +4 -4
- package/esm2020/bottom-sheet/bottom-sheet.mjs +3 -3
- package/esm2020/button/button-base.mjs +6 -6
- package/esm2020/button/button.mjs +8 -8
- package/esm2020/button/fab.mjs +16 -16
- package/esm2020/button/icon-button.mjs +6 -6
- package/esm2020/button/module.mjs +4 -4
- package/esm2020/button-toggle/button-toggle-module.mjs +4 -4
- package/esm2020/button-toggle/button-toggle.mjs +6 -6
- package/esm2020/card/card.mjs +42 -42
- package/esm2020/card/module.mjs +4 -4
- package/esm2020/checkbox/checkbox-required-validator.mjs +3 -3
- package/esm2020/checkbox/checkbox.mjs +6 -6
- package/esm2020/checkbox/module.mjs +8 -8
- package/esm2020/chips/chip-action.mjs +3 -3
- package/esm2020/chips/chip-edit-input.mjs +3 -3
- package/esm2020/chips/chip-grid.mjs +3 -3
- package/esm2020/chips/chip-icons.mjs +9 -9
- package/esm2020/chips/chip-input.mjs +3 -3
- package/esm2020/chips/chip-listbox.mjs +3 -3
- package/esm2020/chips/chip-option.mjs +7 -13
- package/esm2020/chips/chip-row.mjs +5 -5
- package/esm2020/chips/chip-set.mjs +3 -3
- package/esm2020/chips/chip.mjs +4 -4
- package/esm2020/chips/module.mjs +4 -4
- package/esm2020/core/common-behaviors/common-module.mjs +4 -4
- package/esm2020/core/datetime/index.mjs +8 -8
- package/esm2020/core/datetime/native-date-adapter.mjs +3 -3
- package/esm2020/core/error/error-options.mjs +6 -6
- package/esm2020/core/line/line.mjs +7 -7
- package/esm2020/core/option/index.mjs +4 -4
- package/esm2020/core/option/optgroup.mjs +6 -6
- package/esm2020/core/option/option.mjs +6 -6
- package/esm2020/core/ripple/index.mjs +4 -4
- package/esm2020/core/ripple/ripple.mjs +3 -3
- package/esm2020/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +4 -4
- package/esm2020/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +3 -3
- package/esm2020/core/version.mjs +1 -1
- package/esm2020/datepicker/calendar-body.mjs +3 -3
- package/esm2020/datepicker/calendar.mjs +6 -6
- package/esm2020/datepicker/date-range-input-parts.mjs +12 -12
- package/esm2020/datepicker/date-range-input.mjs +3 -3
- package/esm2020/datepicker/date-range-picker.mjs +3 -3
- package/esm2020/datepicker/date-range-selection-strategy.mjs +3 -3
- package/esm2020/datepicker/date-selection-model.mjs +9 -9
- package/esm2020/datepicker/datepicker-actions.mjs +9 -9
- package/esm2020/datepicker/datepicker-base.mjs +6 -6
- package/esm2020/datepicker/datepicker-input-base.mjs +3 -3
- package/esm2020/datepicker/datepicker-input.mjs +3 -3
- package/esm2020/datepicker/datepicker-intl.mjs +3 -3
- package/esm2020/datepicker/datepicker-module.mjs +4 -4
- package/esm2020/datepicker/datepicker-toggle.mjs +6 -6
- package/esm2020/datepicker/datepicker.mjs +3 -3
- package/esm2020/datepicker/month-view.mjs +3 -3
- package/esm2020/datepicker/multi-year-view.mjs +3 -3
- package/esm2020/datepicker/year-view.mjs +3 -3
- package/esm2020/dialog/dialog-container.mjs +7 -7
- package/esm2020/dialog/dialog-content-directives.mjs +12 -12
- package/esm2020/dialog/dialog.mjs +6 -6
- package/esm2020/dialog/module.mjs +4 -4
- package/esm2020/divider/divider-module.mjs +4 -4
- package/esm2020/divider/divider.mjs +3 -3
- package/esm2020/expansion/accordion.mjs +3 -3
- package/esm2020/expansion/expansion-module.mjs +4 -4
- package/esm2020/expansion/expansion-panel-content.mjs +3 -3
- package/esm2020/expansion/expansion-panel-header.mjs +9 -9
- package/esm2020/expansion/expansion-panel.mjs +6 -6
- package/esm2020/form-field/directives/error.mjs +3 -3
- package/esm2020/form-field/directives/floating-label.mjs +3 -3
- package/esm2020/form-field/directives/hint.mjs +3 -3
- package/esm2020/form-field/directives/label.mjs +3 -3
- package/esm2020/form-field/directives/line-ripple.mjs +3 -3
- package/esm2020/form-field/directives/notched-outline.mjs +3 -3
- package/esm2020/form-field/directives/prefix.mjs +3 -3
- package/esm2020/form-field/directives/suffix.mjs +3 -3
- package/esm2020/form-field/form-field-control.mjs +3 -3
- package/esm2020/form-field/form-field.mjs +3 -3
- package/esm2020/form-field/module.mjs +4 -4
- package/esm2020/grid-list/grid-list-module.mjs +4 -4
- package/esm2020/grid-list/grid-list.mjs +3 -3
- package/esm2020/grid-list/grid-tile.mjs +15 -15
- package/esm2020/icon/icon-module.mjs +4 -4
- package/esm2020/icon/icon-registry.mjs +3 -3
- package/esm2020/icon/icon.mjs +3 -3
- package/esm2020/icon/testing/fake-icon-registry.mjs +7 -7
- package/esm2020/input/input.mjs +3 -3
- package/esm2020/input/module.mjs +4 -4
- package/esm2020/legacy-autocomplete/autocomplete-module.mjs +4 -4
- package/esm2020/legacy-autocomplete/autocomplete-origin.mjs +3 -3
- package/esm2020/legacy-autocomplete/autocomplete-trigger.mjs +3 -3
- package/esm2020/legacy-autocomplete/autocomplete.mjs +3 -3
- package/esm2020/legacy-button/button-module.mjs +4 -4
- package/esm2020/legacy-button/button.mjs +6 -6
- package/esm2020/legacy-card/card-module.mjs +4 -4
- package/esm2020/legacy-card/card.mjs +42 -42
- package/esm2020/legacy-checkbox/checkbox-module.mjs +4 -4
- package/esm2020/legacy-checkbox/checkbox.mjs +3 -3
- package/esm2020/legacy-chips/chip-input.mjs +3 -3
- package/esm2020/legacy-chips/chip-list.mjs +3 -3
- package/esm2020/legacy-chips/chip.mjs +12 -12
- package/esm2020/legacy-chips/chips-module.mjs +4 -4
- package/esm2020/legacy-core/option/index.mjs +4 -4
- package/esm2020/legacy-core/option/optgroup.mjs +3 -3
- package/esm2020/legacy-core/option/option.mjs +3 -3
- package/esm2020/legacy-dialog/dialog-container.mjs +3 -3
- package/esm2020/legacy-dialog/dialog-content-directives.mjs +12 -12
- package/esm2020/legacy-dialog/dialog-module.mjs +4 -4
- package/esm2020/legacy-dialog/dialog.mjs +3 -3
- package/esm2020/legacy-form-field/error.mjs +3 -3
- package/esm2020/legacy-form-field/form-field-module.mjs +4 -4
- package/esm2020/legacy-form-field/form-field.mjs +3 -3
- package/esm2020/legacy-form-field/hint.mjs +3 -3
- package/esm2020/legacy-form-field/label.mjs +3 -3
- package/esm2020/legacy-form-field/placeholder.mjs +3 -3
- package/esm2020/legacy-form-field/prefix.mjs +3 -3
- package/esm2020/legacy-form-field/suffix.mjs +3 -3
- package/esm2020/legacy-input/input-module.mjs +4 -4
- package/esm2020/legacy-input/input.mjs +3 -3
- package/esm2020/legacy-list/list-module.mjs +4 -4
- package/esm2020/legacy-list/list.mjs +18 -18
- package/esm2020/legacy-list/selection-list.mjs +6 -6
- package/esm2020/legacy-menu/menu-content.mjs +3 -3
- package/esm2020/legacy-menu/menu-item.mjs +3 -3
- package/esm2020/legacy-menu/menu-module.mjs +4 -4
- package/esm2020/legacy-menu/menu-trigger.mjs +3 -3
- package/esm2020/legacy-menu/menu.mjs +3 -3
- package/esm2020/legacy-paginator/paginator-module.mjs +4 -4
- package/esm2020/legacy-paginator/paginator.mjs +3 -3
- package/esm2020/legacy-progress-bar/progress-bar-module.mjs +4 -4
- package/esm2020/legacy-progress-bar/progress-bar.mjs +3 -3
- package/esm2020/legacy-progress-spinner/progress-spinner-module.mjs +4 -4
- package/esm2020/legacy-progress-spinner/progress-spinner.mjs +3 -3
- package/esm2020/legacy-radio/radio-module.mjs +4 -4
- package/esm2020/legacy-radio/radio.mjs +6 -6
- package/esm2020/legacy-select/select-module.mjs +4 -4
- package/esm2020/legacy-select/select.mjs +6 -6
- package/esm2020/legacy-slide-toggle/slide-toggle-module.mjs +4 -4
- package/esm2020/legacy-slide-toggle/slide-toggle.mjs +3 -3
- package/esm2020/legacy-slider/slider-module.mjs +4 -4
- package/esm2020/legacy-slider/slider.mjs +3 -3
- package/esm2020/legacy-snack-bar/simple-snack-bar.mjs +3 -3
- package/esm2020/legacy-snack-bar/snack-bar-container.mjs +3 -3
- package/esm2020/legacy-snack-bar/snack-bar-module.mjs +4 -4
- package/esm2020/legacy-snack-bar/snack-bar.mjs +3 -3
- package/esm2020/legacy-table/cell.mjs +21 -21
- package/esm2020/legacy-table/row.mjs +21 -21
- package/esm2020/legacy-table/table-module.mjs +4 -4
- package/esm2020/legacy-table/table.mjs +6 -6
- package/esm2020/legacy-table/text-column.mjs +3 -3
- package/esm2020/legacy-tabs/ink-bar.mjs +3 -3
- package/esm2020/legacy-tabs/tab-body.mjs +6 -6
- package/esm2020/legacy-tabs/tab-content.mjs +3 -3
- package/esm2020/legacy-tabs/tab-group.mjs +3 -3
- package/esm2020/legacy-tabs/tab-header.mjs +3 -3
- package/esm2020/legacy-tabs/tab-label-wrapper.mjs +3 -3
- package/esm2020/legacy-tabs/tab-label.mjs +3 -3
- package/esm2020/legacy-tabs/tab-nav-bar/tab-nav-bar.mjs +9 -9
- package/esm2020/legacy-tabs/tab.mjs +3 -3
- package/esm2020/legacy-tabs/tabs-module.mjs +4 -4
- package/esm2020/legacy-tooltip/tooltip-module.mjs +4 -4
- package/esm2020/legacy-tooltip/tooltip.mjs +6 -6
- package/esm2020/list/action-list.mjs +3 -3
- package/esm2020/list/list-base.mjs +6 -6
- package/esm2020/list/list-item-sections.mjs +18 -18
- package/esm2020/list/list-module.mjs +4 -4
- package/esm2020/list/list-option.mjs +3 -3
- package/esm2020/list/list.mjs +6 -6
- package/esm2020/list/nav-list.mjs +3 -3
- package/esm2020/list/selection-list.mjs +16 -6
- package/esm2020/list/subheader.mjs +3 -3
- package/esm2020/menu/menu-content.mjs +6 -6
- package/esm2020/menu/menu-item.mjs +3 -3
- package/esm2020/menu/menu-trigger.mjs +6 -6
- package/esm2020/menu/menu.mjs +6 -6
- package/esm2020/menu/module.mjs +4 -4
- package/esm2020/paginator/module.mjs +4 -4
- package/esm2020/paginator/paginator-intl.mjs +3 -3
- package/esm2020/paginator/paginator.mjs +6 -6
- package/esm2020/progress-bar/module.mjs +4 -4
- package/esm2020/progress-bar/progress-bar.mjs +3 -3
- package/esm2020/progress-spinner/module.mjs +4 -4
- package/esm2020/progress-spinner/progress-spinner.mjs +3 -3
- package/esm2020/radio/module.mjs +4 -4
- package/esm2020/radio/radio.mjs +12 -12
- package/esm2020/select/module.mjs +4 -4
- package/esm2020/select/select.mjs +9 -9
- package/esm2020/sidenav/drawer.mjs +9 -9
- package/esm2020/sidenav/sidenav-module.mjs +4 -4
- package/esm2020/sidenav/sidenav.mjs +9 -9
- package/esm2020/slide-toggle/module.mjs +8 -8
- package/esm2020/slide-toggle/slide-toggle-required-validator.mjs +3 -3
- package/esm2020/slide-toggle/slide-toggle.mjs +7 -7
- package/esm2020/slider/module.mjs +10 -8
- package/esm2020/slider/public-api.mjs +4 -2
- package/esm2020/slider/slider-input.mjs +611 -0
- package/esm2020/slider/slider-interface.mjs +34 -0
- package/esm2020/slider/slider-thumb.mjs +229 -0
- package/esm2020/slider/slider.mjs +523 -925
- package/esm2020/snack-bar/module.mjs +4 -4
- package/esm2020/snack-bar/simple-snack-bar.mjs +3 -3
- package/esm2020/snack-bar/snack-bar-container.mjs +8 -8
- package/esm2020/snack-bar/snack-bar-content.mjs +9 -9
- package/esm2020/snack-bar/snack-bar.mjs +6 -6
- package/esm2020/sort/sort-header-intl.mjs +3 -3
- package/esm2020/sort/sort-header.mjs +3 -3
- package/esm2020/sort/sort-module.mjs +4 -4
- package/esm2020/sort/sort.mjs +3 -3
- package/esm2020/stepper/step-content.mjs +3 -3
- package/esm2020/stepper/step-header.mjs +4 -4
- package/esm2020/stepper/step-label.mjs +3 -3
- package/esm2020/stepper/stepper-button.mjs +6 -6
- package/esm2020/stepper/stepper-icon.mjs +3 -3
- package/esm2020/stepper/stepper-intl.mjs +3 -3
- package/esm2020/stepper/stepper-module.mjs +4 -4
- package/esm2020/stepper/stepper.mjs +8 -8
- package/esm2020/table/cell.mjs +21 -21
- package/esm2020/table/module.mjs +4 -4
- package/esm2020/table/row.mjs +21 -21
- package/esm2020/table/table.mjs +8 -8
- package/esm2020/table/text-column.mjs +3 -3
- package/esm2020/tabs/module.mjs +4 -4
- package/esm2020/tabs/paginated-tab-header.mjs +3 -3
- package/esm2020/tabs/tab-body.mjs +9 -9
- package/esm2020/tabs/tab-content.mjs +3 -3
- package/esm2020/tabs/tab-group.mjs +6 -6
- package/esm2020/tabs/tab-header.mjs +7 -7
- package/esm2020/tabs/tab-label-wrapper.mjs +6 -6
- package/esm2020/tabs/tab-label.mjs +3 -3
- package/esm2020/tabs/tab-nav-bar/tab-nav-bar.mjs +106 -106
- package/esm2020/tabs/tab.mjs +6 -6
- package/esm2020/toolbar/toolbar-module.mjs +4 -4
- package/esm2020/toolbar/toolbar.mjs +6 -6
- package/esm2020/tooltip/module.mjs +4 -4
- package/esm2020/tooltip/tooltip.mjs +12 -12
- package/esm2020/tree/node.mjs +9 -9
- package/esm2020/tree/outlet.mjs +3 -3
- package/esm2020/tree/padding.mjs +3 -3
- package/esm2020/tree/toggle.mjs +3 -3
- package/esm2020/tree/tree-module.mjs +4 -4
- package/esm2020/tree/tree.mjs +3 -3
- package/fesm2015/autocomplete.mjs +22 -22
- package/fesm2015/badge.mjs +7 -7
- package/fesm2015/bottom-sheet.mjs +10 -10
- package/fesm2015/button-toggle.mjs +10 -10
- package/fesm2015/button.mjs +40 -40
- package/fesm2015/button.mjs.map +1 -1
- package/fesm2015/card.mjs +46 -46
- package/fesm2015/checkbox.mjs +17 -17
- package/fesm2015/chips.mjs +46 -52
- package/fesm2015/chips.mjs.map +1 -1
- package/fesm2015/core.mjs +59 -59
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/datepicker.mjs +84 -84
- package/fesm2015/datepicker.mjs.map +1 -1
- package/fesm2015/dialog.mjs +29 -29
- package/fesm2015/dialog.mjs.map +1 -1
- package/fesm2015/divider.mjs +7 -7
- package/fesm2015/expansion.mjs +25 -25
- package/fesm2015/form-field.mjs +34 -34
- package/fesm2015/grid-list.mjs +22 -22
- package/fesm2015/icon/testing.mjs +7 -7
- package/fesm2015/icon.mjs +10 -10
- package/fesm2015/input.mjs +7 -7
- package/fesm2015/legacy-autocomplete.mjs +13 -13
- package/fesm2015/legacy-button.mjs +10 -10
- package/fesm2015/legacy-card.mjs +46 -46
- package/fesm2015/legacy-checkbox.mjs +7 -7
- package/fesm2015/legacy-chips.mjs +22 -22
- package/fesm2015/legacy-core.mjs +10 -10
- package/fesm2015/legacy-dialog.mjs +22 -22
- package/fesm2015/legacy-form-field.mjs +25 -25
- package/fesm2015/legacy-input.mjs +7 -7
- package/fesm2015/legacy-list.mjs +28 -28
- package/fesm2015/legacy-menu.mjs +16 -16
- package/fesm2015/legacy-paginator.mjs +7 -7
- package/fesm2015/legacy-progress-bar.mjs +7 -7
- package/fesm2015/legacy-progress-spinner.mjs +7 -7
- package/fesm2015/legacy-radio.mjs +10 -10
- package/fesm2015/legacy-select.mjs +10 -10
- package/fesm2015/legacy-slide-toggle.mjs +7 -7
- package/fesm2015/legacy-slider.mjs +7 -7
- package/fesm2015/legacy-snack-bar.mjs +13 -13
- package/fesm2015/legacy-table.mjs +55 -55
- package/fesm2015/legacy-tabs.mjs +40 -40
- package/fesm2015/legacy-tooltip.mjs +10 -10
- package/fesm2015/list.mjs +61 -51
- package/fesm2015/list.mjs.map +1 -1
- package/fesm2015/menu.mjs +25 -25
- package/fesm2015/paginator.mjs +13 -13
- package/fesm2015/progress-bar.mjs +7 -7
- package/fesm2015/progress-spinner.mjs +7 -7
- package/fesm2015/radio.mjs +16 -16
- package/fesm2015/select.mjs +13 -13
- package/fesm2015/sidenav.mjs +22 -22
- package/fesm2015/slide-toggle.mjs +18 -18
- package/fesm2015/slide-toggle.mjs.map +1 -1
- package/fesm2015/slider.mjs +1300 -902
- package/fesm2015/slider.mjs.map +1 -1
- package/fesm2015/snack-bar.mjs +29 -29
- package/fesm2015/snack-bar.mjs.map +1 -1
- package/fesm2015/sort.mjs +13 -13
- package/fesm2015/stepper.mjs +33 -33
- package/fesm2015/stepper.mjs.map +1 -1
- package/fesm2015/table.mjs +57 -57
- package/fesm2015/table.mjs.map +1 -1
- package/fesm2015/tabs.mjs +161 -161
- package/fesm2015/tabs.mjs.map +1 -1
- package/fesm2015/toolbar.mjs +10 -10
- package/fesm2015/tooltip.mjs +16 -16
- package/fesm2015/tree.mjs +25 -25
- package/fesm2020/autocomplete.mjs +22 -22
- package/fesm2020/badge.mjs +7 -7
- package/fesm2020/bottom-sheet.mjs +10 -10
- package/fesm2020/button-toggle.mjs +10 -10
- package/fesm2020/button.mjs +40 -40
- package/fesm2020/button.mjs.map +1 -1
- package/fesm2020/card.mjs +46 -46
- package/fesm2020/checkbox.mjs +17 -17
- package/fesm2020/chips.mjs +46 -52
- package/fesm2020/chips.mjs.map +1 -1
- package/fesm2020/core.mjs +59 -59
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/datepicker.mjs +84 -84
- package/fesm2020/datepicker.mjs.map +1 -1
- package/fesm2020/dialog.mjs +29 -29
- package/fesm2020/dialog.mjs.map +1 -1
- package/fesm2020/divider.mjs +7 -7
- package/fesm2020/expansion.mjs +25 -25
- package/fesm2020/form-field.mjs +34 -34
- package/fesm2020/grid-list.mjs +22 -22
- package/fesm2020/icon/testing.mjs +7 -7
- package/fesm2020/icon.mjs +10 -10
- package/fesm2020/input.mjs +7 -7
- package/fesm2020/legacy-autocomplete.mjs +13 -13
- package/fesm2020/legacy-button.mjs +10 -10
- package/fesm2020/legacy-card.mjs +46 -46
- package/fesm2020/legacy-checkbox.mjs +7 -7
- package/fesm2020/legacy-chips.mjs +22 -22
- package/fesm2020/legacy-core.mjs +10 -10
- package/fesm2020/legacy-dialog.mjs +22 -22
- package/fesm2020/legacy-form-field.mjs +25 -25
- package/fesm2020/legacy-input.mjs +7 -7
- package/fesm2020/legacy-list.mjs +28 -28
- package/fesm2020/legacy-menu.mjs +16 -16
- package/fesm2020/legacy-paginator.mjs +7 -7
- package/fesm2020/legacy-progress-bar.mjs +7 -7
- package/fesm2020/legacy-progress-spinner.mjs +7 -7
- package/fesm2020/legacy-radio.mjs +10 -10
- package/fesm2020/legacy-select.mjs +10 -10
- package/fesm2020/legacy-slide-toggle.mjs +7 -7
- package/fesm2020/legacy-slider.mjs +7 -7
- package/fesm2020/legacy-snack-bar.mjs +13 -13
- package/fesm2020/legacy-table.mjs +55 -55
- package/fesm2020/legacy-tabs.mjs +40 -40
- package/fesm2020/legacy-tooltip.mjs +10 -10
- package/fesm2020/list.mjs +61 -51
- package/fesm2020/list.mjs.map +1 -1
- package/fesm2020/menu.mjs +25 -25
- package/fesm2020/paginator.mjs +13 -13
- package/fesm2020/progress-bar.mjs +7 -7
- package/fesm2020/progress-spinner.mjs +7 -7
- package/fesm2020/radio.mjs +16 -16
- package/fesm2020/select.mjs +13 -13
- package/fesm2020/sidenav.mjs +22 -22
- package/fesm2020/slide-toggle.mjs +18 -18
- package/fesm2020/slide-toggle.mjs.map +1 -1
- package/fesm2020/slider.mjs +1289 -882
- package/fesm2020/slider.mjs.map +1 -1
- package/fesm2020/snack-bar.mjs +29 -29
- package/fesm2020/snack-bar.mjs.map +1 -1
- package/fesm2020/sort.mjs +13 -13
- package/fesm2020/stepper.mjs +33 -33
- package/fesm2020/stepper.mjs.map +1 -1
- package/fesm2020/table.mjs +57 -57
- package/fesm2020/table.mjs.map +1 -1
- package/fesm2020/tabs.mjs +159 -159
- package/fesm2020/tabs.mjs.map +1 -1
- package/fesm2020/toolbar.mjs +10 -10
- package/fesm2020/tooltip.mjs +16 -16
- package/fesm2020/tree.mjs +25 -25
- package/legacy-core/density/private/_all-density.scss +10 -2
- package/legacy-core/theming/_all-theme.scss +29 -2
- package/legacy-core/typography/_all-typography.scss +31 -2
- package/legacy-prebuilt-themes/legacy-deeppurple-amber.css +1 -1
- package/legacy-prebuilt-themes/legacy-indigo-pink.css +1 -1
- package/legacy-prebuilt-themes/legacy-pink-bluegrey.css +1 -1
- package/legacy-prebuilt-themes/legacy-purple-green.css +1 -1
- package/list/index.d.ts +4 -1
- package/package.json +49 -49
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/radio/_radio-theme.scss +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/mdc-migration/index_bundled.js +320 -47
- package/schematics/ng-generate/mdc-migration/index_bundled.js.map +3 -3
- package/schematics/ng-generate/mdc-migration/mdc_migration_bundle_metadata.json +1 -1
- package/schematics/ng-update/index_bundled.js +2 -1
- package/schematics/ng-update/index_bundled.js.map +2 -2
- package/schematics/ng-update/ng_update_index_metadata.json +1 -1
- package/slider/index.d.ts +443 -235
- package/tabs/index.d.ts +1 -1
- package/esm2020/slider/global-change-and-input-listener.mjs +0 -59
package/fesm2020/slider.mjs
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
4
|
-
import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
|
|
5
|
-
import * as i1 from '@angular/common';
|
|
6
|
-
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
1
|
+
import * as i2$1 from '@angular/cdk/bidi';
|
|
2
|
+
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
3
|
+
import * as i1 from '@angular/cdk/platform';
|
|
7
4
|
import * as i0 from '@angular/core';
|
|
8
|
-
import {
|
|
9
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import { InjectionToken, Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, Input, ViewChild, Optional, ViewChildren, ContentChild, ContentChildren, forwardRef, EventEmitter, Directive, Output, NgModule } from '@angular/core';
|
|
10
6
|
import * as i2 from '@angular/material/core';
|
|
11
7
|
import { MatRipple, mixinColor, mixinDisableRipple, MAT_RIPPLE_GLOBAL_OPTIONS, MatCommonModule, MatRippleModule } from '@angular/material/core';
|
|
12
8
|
import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
9
|
+
import * as i3 from '@angular/common';
|
|
10
|
+
import { CommonModule } from '@angular/common';
|
|
11
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
12
|
+
import { Subject } from 'rxjs';
|
|
17
13
|
|
|
18
14
|
/**
|
|
19
15
|
* @license
|
|
@@ -23,51 +19,30 @@ import { takeUntil, finalize, share } from 'rxjs/operators';
|
|
|
23
19
|
* found in the LICENSE file at https://angular.io/license
|
|
24
20
|
*/
|
|
25
21
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* #fromEvent which will lazily attach a listener when the first subscription is made and remove the
|
|
31
|
-
* listener once the last observer unsubscribes.
|
|
22
|
+
* Injection token that can be used for a `MatSlider` to provide itself as a
|
|
23
|
+
* parent to the `MatSliderThumb` and `MatSliderRangeThumb`.
|
|
24
|
+
* Used primarily to avoid circular imports.
|
|
25
|
+
* @docs-private
|
|
32
26
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
return this._ngZone.runOutsideAngular(() => this._observables
|
|
54
|
-
.get(type)
|
|
55
|
-
.subscribe((event) => this._ngZone.run(() => callback(event))));
|
|
56
|
-
}
|
|
57
|
-
/** Creates an observable that emits all events of the given type. */
|
|
58
|
-
_createGlobalEventObservable(type) {
|
|
59
|
-
return fromEvent(this._document, type, { capture: true, passive: true }).pipe(takeUntil(this._destroyed), finalize(() => this._observables.delete(type)), share());
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
GlobalChangeAndInputListener.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.0", ngImport: i0, type: GlobalChangeAndInputListener, deps: [{ token: DOCUMENT }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
63
|
-
GlobalChangeAndInputListener.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.0", ngImport: i0, type: GlobalChangeAndInputListener, providedIn: 'root' });
|
|
64
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.0", ngImport: i0, type: GlobalChangeAndInputListener, decorators: [{
|
|
65
|
-
type: Injectable,
|
|
66
|
-
args: [{ providedIn: 'root' }]
|
|
67
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
68
|
-
type: Inject,
|
|
69
|
-
args: [DOCUMENT]
|
|
70
|
-
}] }, { type: i0.NgZone }]; } });
|
|
27
|
+
const MAT_SLIDER = new InjectionToken('_MatSlider');
|
|
28
|
+
/**
|
|
29
|
+
* Injection token that can be used to query for a `MatSliderThumb`.
|
|
30
|
+
* Used primarily to avoid circular imports.
|
|
31
|
+
* @docs-private
|
|
32
|
+
*/
|
|
33
|
+
const MAT_SLIDER_THUMB = new InjectionToken('_MatSliderThumb');
|
|
34
|
+
/**
|
|
35
|
+
* Injection token that can be used to query for a `MatSliderRangeThumb`.
|
|
36
|
+
* Used primarily to avoid circular imports.
|
|
37
|
+
* @docs-private
|
|
38
|
+
*/
|
|
39
|
+
const MAT_SLIDER_RANGE_THUMB = new InjectionToken('_MatSliderRangeThumb');
|
|
40
|
+
/**
|
|
41
|
+
* Injection token that can be used to query for a `MatSliderVisualThumb`.
|
|
42
|
+
* Used primarily to avoid circular imports.
|
|
43
|
+
* @docs-private
|
|
44
|
+
*/
|
|
45
|
+
const MAT_SLIDER_VISUAL_THUMB = new InjectionToken('_MatSliderVisualThumb');
|
|
71
46
|
|
|
72
47
|
/**
|
|
73
48
|
* @license
|
|
@@ -76,8 +51,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.0", ng
|
|
|
76
51
|
* Use of this source code is governed by an MIT-style license that can be
|
|
77
52
|
* found in the LICENSE file at https://angular.io/license
|
|
78
53
|
*/
|
|
79
|
-
/** Options used to bind passive event listeners. */
|
|
80
|
-
const passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
81
54
|
/**
|
|
82
55
|
* The visual slider thumb.
|
|
83
56
|
*
|
|
@@ -86,83 +59,90 @@ const passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: t
|
|
|
86
59
|
* @docs-private
|
|
87
60
|
*/
|
|
88
61
|
class MatSliderVisualThumb {
|
|
89
|
-
constructor(_ngZone,
|
|
62
|
+
constructor(_cdr, _ngZone, _elementRef, _slider) {
|
|
63
|
+
this._cdr = _cdr;
|
|
90
64
|
this._ngZone = _ngZone;
|
|
91
65
|
this._slider = _slider;
|
|
92
|
-
this._elementRef = _elementRef;
|
|
93
|
-
/** Whether ripples on the slider thumb should be disabled. */
|
|
94
|
-
this.disableRipple = false;
|
|
95
|
-
/** Whether the slider thumb is currently being pressed. */
|
|
96
|
-
this._isActive = false;
|
|
97
66
|
/** Whether the slider thumb is currently being hovered. */
|
|
98
67
|
this._isHovered = false;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
68
|
+
/** Whether the slider thumb is currently being pressed. */
|
|
69
|
+
this._isActive = false;
|
|
70
|
+
/** Whether the value indicator tooltip is visible. */
|
|
71
|
+
this._isValueIndicatorVisible = false;
|
|
72
|
+
this._onPointerMove = (event) => {
|
|
73
|
+
if (this._sliderInput._isFocused) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const rect = this._hostElement.getBoundingClientRect();
|
|
77
|
+
const isHovered = this._isSliderThumbHovered(event, rect);
|
|
78
|
+
this._isHovered = isHovered;
|
|
79
|
+
if (isHovered) {
|
|
104
80
|
this._showHoverRipple();
|
|
105
81
|
}
|
|
82
|
+
else {
|
|
83
|
+
this._hideRipple(this._hoverRippleRef);
|
|
84
|
+
}
|
|
106
85
|
};
|
|
107
86
|
this._onMouseLeave = () => {
|
|
108
87
|
this._isHovered = false;
|
|
109
|
-
this._hoverRippleRef
|
|
88
|
+
this._hideRipple(this._hoverRippleRef);
|
|
89
|
+
};
|
|
90
|
+
this._onFocus = () => {
|
|
91
|
+
// We don't want to show the hover ripple on top of the focus ripple.
|
|
92
|
+
// Happen when the users cursor is over a thumb and then the user tabs to it.
|
|
93
|
+
this._hideRipple(this._hoverRippleRef);
|
|
94
|
+
this._showFocusRipple();
|
|
95
|
+
this._hostElement.classList.add('mdc-slider__thumb--focused');
|
|
96
|
+
};
|
|
97
|
+
this._onBlur = () => {
|
|
98
|
+
// Happens when the user tabs away while still dragging a thumb.
|
|
99
|
+
if (!this._isActive) {
|
|
100
|
+
this._hideRipple(this._focusRippleRef);
|
|
101
|
+
}
|
|
102
|
+
// Happens when the user tabs away from a thumb but their cursor is still over it.
|
|
103
|
+
if (this._isHovered) {
|
|
104
|
+
this._showHoverRipple();
|
|
105
|
+
}
|
|
106
|
+
this._hostElement.classList.remove('mdc-slider__thumb--focused');
|
|
107
|
+
};
|
|
108
|
+
this._onDragStart = () => {
|
|
109
|
+
this._isActive = true;
|
|
110
|
+
this._showActiveRipple();
|
|
111
|
+
};
|
|
112
|
+
this._onDragEnd = () => {
|
|
113
|
+
this._isActive = false;
|
|
114
|
+
this._hideRipple(this._activeRippleRef);
|
|
115
|
+
// Happens when the user starts dragging a thumb, tabs away, and then stops dragging.
|
|
116
|
+
if (!this._sliderInput._isFocused) {
|
|
117
|
+
this._hideRipple(this._focusRippleRef);
|
|
118
|
+
}
|
|
110
119
|
};
|
|
120
|
+
this._hostElement = _elementRef.nativeElement;
|
|
111
121
|
}
|
|
112
122
|
ngAfterViewInit() {
|
|
113
123
|
this._ripple.radius = 24;
|
|
114
124
|
this._sliderInput = this._slider._getInput(this.thumbPosition);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
this._sliderInput._blur.subscribe(() => this._onBlur());
|
|
120
|
-
// These two listeners don't update any data bindings so we bind them
|
|
121
|
-
// outside of the NgZone to prevent Angular from needlessly running change detection.
|
|
125
|
+
this._sliderInputEl = this._sliderInput._hostElement;
|
|
126
|
+
const input = this._sliderInputEl;
|
|
127
|
+
// These listeners don't update any data bindings so we bind them outside
|
|
128
|
+
// of the NgZone to prevent Angular from needlessly running change detection.
|
|
122
129
|
this._ngZone.runOutsideAngular(() => {
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
input.addEventListener('pointermove', this._onPointerMove);
|
|
131
|
+
input.addEventListener('pointerdown', this._onDragStart);
|
|
132
|
+
input.addEventListener('pointerup', this._onDragEnd);
|
|
133
|
+
input.addEventListener('pointerleave', this._onMouseLeave);
|
|
134
|
+
input.addEventListener('focus', this._onFocus);
|
|
135
|
+
input.addEventListener('blur', this._onBlur);
|
|
125
136
|
});
|
|
126
137
|
}
|
|
127
138
|
ngOnDestroy() {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
_onFocus() {
|
|
136
|
-
// We don't want to show the hover ripple on top of the focus ripple.
|
|
137
|
-
// Happen when the users cursor is over a thumb and then the user tabs to it.
|
|
138
|
-
this._hoverRippleRef?.fadeOut();
|
|
139
|
-
this._showFocusRipple();
|
|
140
|
-
}
|
|
141
|
-
_onBlur() {
|
|
142
|
-
// Happens when the user tabs away while still dragging a thumb.
|
|
143
|
-
if (!this._isActive) {
|
|
144
|
-
this._focusRippleRef?.fadeOut();
|
|
145
|
-
}
|
|
146
|
-
// Happens when the user tabs away from a thumb but their cursor is still over it.
|
|
147
|
-
if (this._isHovered) {
|
|
148
|
-
this._showHoverRipple();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
_onDragStart(event) {
|
|
152
|
-
if (event.source._thumbPosition === this.thumbPosition) {
|
|
153
|
-
this._isActive = true;
|
|
154
|
-
this._showActiveRipple();
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
_onDragEnd(event) {
|
|
158
|
-
if (event.source._thumbPosition === this.thumbPosition) {
|
|
159
|
-
this._isActive = false;
|
|
160
|
-
this._activeRippleRef?.fadeOut();
|
|
161
|
-
// Happens when the user starts dragging a thumb, tabs away, and then stops dragging.
|
|
162
|
-
if (!this._sliderInput._isFocused()) {
|
|
163
|
-
this._focusRippleRef?.fadeOut();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
139
|
+
const input = this._sliderInputEl;
|
|
140
|
+
input.removeEventListener('pointermove', this._onPointerMove);
|
|
141
|
+
input.removeEventListener('pointerdown', this._onDragStart);
|
|
142
|
+
input.removeEventListener('pointerup', this._onDragEnd);
|
|
143
|
+
input.removeEventListener('pointerleave', this._onMouseLeave);
|
|
144
|
+
input.removeEventListener('focus', this._onFocus);
|
|
145
|
+
input.removeEventListener('blur', this._onBlur);
|
|
166
146
|
}
|
|
167
147
|
/** Handles displaying the hover ripple. */
|
|
168
148
|
_showHoverRipple() {
|
|
@@ -175,7 +155,7 @@ class MatSliderVisualThumb {
|
|
|
175
155
|
_showFocusRipple() {
|
|
176
156
|
// Show the focus ripple event if noop animations are enabled.
|
|
177
157
|
if (!this._isShowingRipple(this._focusRippleRef)) {
|
|
178
|
-
this._focusRippleRef = this._showRipple({ enterDuration: 0, exitDuration: 0 });
|
|
158
|
+
this._focusRippleRef = this._showRipple({ enterDuration: 0, exitDuration: 0 }, true);
|
|
179
159
|
this._focusRippleRef?.element.classList.add('mat-mdc-slider-focus-ripple');
|
|
180
160
|
}
|
|
181
161
|
}
|
|
@@ -191,8 +171,16 @@ class MatSliderVisualThumb {
|
|
|
191
171
|
return rippleRef?.state === 0 /* RippleState.FADING_IN */ || rippleRef?.state === 1 /* RippleState.VISIBLE */;
|
|
192
172
|
}
|
|
193
173
|
/** Manually launches the slider thumb ripple using the specified ripple animation config. */
|
|
194
|
-
_showRipple(animation) {
|
|
195
|
-
if (this.
|
|
174
|
+
_showRipple(animation, ignoreGlobalRippleConfig) {
|
|
175
|
+
if (this._slider.disabled) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
this._showValueIndicator();
|
|
179
|
+
if (this._slider._isRange) {
|
|
180
|
+
const sibling = this._slider._getThumb(this.thumbPosition === 1 /* _MatThumb.START */ ? 2 /* _MatThumb.END */ : 1 /* _MatThumb.START */);
|
|
181
|
+
sibling._showValueIndicator();
|
|
182
|
+
}
|
|
183
|
+
if (this._slider._globalRippleOptions?.disabled && !ignoreGlobalRippleConfig) {
|
|
196
184
|
return;
|
|
197
185
|
}
|
|
198
186
|
return this._ripple.launch({
|
|
@@ -201,43 +189,73 @@ class MatSliderVisualThumb {
|
|
|
201
189
|
persistent: true,
|
|
202
190
|
});
|
|
203
191
|
}
|
|
204
|
-
/**
|
|
205
|
-
|
|
206
|
-
|
|
192
|
+
/**
|
|
193
|
+
* Fades out the given ripple.
|
|
194
|
+
* Also hides the value indicator if no ripple is showing.
|
|
195
|
+
*/
|
|
196
|
+
_hideRipple(rippleRef) {
|
|
197
|
+
rippleRef?.fadeOut();
|
|
198
|
+
if (this._isShowingAnyRipple()) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (!this._slider._isRange) {
|
|
202
|
+
this._hideValueIndicator();
|
|
203
|
+
}
|
|
204
|
+
const sibling = this._getSibling();
|
|
205
|
+
if (!sibling._isShowingAnyRipple()) {
|
|
206
|
+
this._hideValueIndicator();
|
|
207
|
+
sibling._hideValueIndicator();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/** Shows the value indicator ui. */
|
|
211
|
+
_showValueIndicator() {
|
|
212
|
+
this._hostElement.classList.add('mdc-slider__thumb--with-indicator');
|
|
213
|
+
}
|
|
214
|
+
/** Hides the value indicator ui. */
|
|
215
|
+
_hideValueIndicator() {
|
|
216
|
+
this._hostElement.classList.remove('mdc-slider__thumb--with-indicator');
|
|
217
|
+
}
|
|
218
|
+
_getSibling() {
|
|
219
|
+
return this._slider._getThumb(this.thumbPosition === 1 /* _MatThumb.START */ ? 2 /* _MatThumb.END */ : 1 /* _MatThumb.START */);
|
|
220
|
+
}
|
|
221
|
+
/** Gets the value indicator container's native HTML element. */
|
|
222
|
+
_getValueIndicatorContainer() {
|
|
223
|
+
return this._valueIndicatorContainer?.nativeElement;
|
|
207
224
|
}
|
|
208
225
|
/** Gets the native HTML element of the slider thumb knob. */
|
|
209
226
|
_getKnob() {
|
|
210
227
|
return this._knob.nativeElement;
|
|
211
228
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
229
|
+
_isShowingAnyRipple() {
|
|
230
|
+
return (this._isShowingRipple(this._hoverRippleRef) ||
|
|
231
|
+
this._isShowingRipple(this._focusRippleRef) ||
|
|
232
|
+
this._isShowingRipple(this._activeRippleRef));
|
|
233
|
+
}
|
|
234
|
+
_isSliderThumbHovered(event, rect) {
|
|
235
|
+
const radius = rect.width / 2;
|
|
236
|
+
const centerX = rect.x + radius;
|
|
237
|
+
const centerY = rect.y + radius;
|
|
238
|
+
const dx = event.clientX - centerX;
|
|
239
|
+
const dy = event.clientY - centerY;
|
|
240
|
+
return Math.pow(dx, 2) + Math.pow(dy, 2) < Math.pow(radius, 2);
|
|
218
241
|
}
|
|
219
242
|
}
|
|
220
|
-
MatSliderVisualThumb.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
221
|
-
MatSliderVisualThumb.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
222
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
243
|
+
MatSliderVisualThumb.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.1", ngImport: i0, type: MatSliderVisualThumb, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: MAT_SLIDER }], target: i0.ɵɵFactoryTarget.Component });
|
|
244
|
+
MatSliderVisualThumb.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0-rc.1", type: MatSliderVisualThumb, selector: "mat-slider-visual-thumb", inputs: { discrete: "discrete", thumbPosition: "thumbPosition", valueIndicatorText: "valueIndicatorText" }, host: { classAttribute: "mdc-slider__thumb mat-mdc-slider-visual-thumb" }, providers: [{ provide: MAT_SLIDER_VISUAL_THUMB, useExisting: MatSliderVisualThumb }], viewQueries: [{ propertyName: "_ripple", first: true, predicate: MatRipple, descendants: true }, { propertyName: "_knob", first: true, predicate: ["knob"], descendants: true }, { propertyName: "_valueIndicatorContainer", first: true, predicate: ["valueIndicatorContainer"], descendants: true }], ngImport: i0, template: "<div class=\"mdc-slider__value-indicator-container\" *ngIf=\"discrete\" #valueIndicatorContainer>\n <div class=\"mdc-slider__value-indicator\">\n <span class=\"mdc-slider__value-indicator-text\">{{valueIndicatorText}}</span>\n </div>\n</div>\n<div class=\"mdc-slider__thumb-knob\" #knob></div>\n<div matRipple class=\"mat-mdc-focus-indicator\" [matRippleDisabled]=\"true\"></div>\n", styles: [".mat-mdc-slider-visual-thumb .mat-ripple{height:100%;width:100%}.mat-mdc-slider .mdc-slider__tick-marks{justify-content:start}.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--inactive{position:absolute;left:2px}"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.1", ngImport: i0, type: MatSliderVisualThumb, decorators: [{
|
|
223
246
|
type: Component,
|
|
224
247
|
args: [{ selector: 'mat-slider-visual-thumb', host: {
|
|
225
248
|
'class': 'mdc-slider__thumb mat-mdc-slider-visual-thumb',
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
'[class.mdc-slider__thumb--short-value]': '_isShortValue()',
|
|
229
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"mdc-slider__value-indicator-container\" *ngIf=\"discrete\" #valueIndicatorContainer>\n <div class=\"mdc-slider__value-indicator\">\n <span class=\"mdc-slider__value-indicator-text\">{{valueIndicatorText}}</span>\n </div>\n</div>\n<div class=\"mdc-slider__thumb-knob\" #knob></div>\n<div\n matRipple\n class=\"mat-mdc-focus-indicator\"\n [matRippleDisabled]=\"true\"></div>\n", styles: [".mat-mdc-slider-visual-thumb .mat-ripple{height:100%;width:100%}"] }]
|
|
230
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: MatSlider, decorators: [{
|
|
249
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [{ provide: MAT_SLIDER_VISUAL_THUMB, useExisting: MatSliderVisualThumb }], template: "<div class=\"mdc-slider__value-indicator-container\" *ngIf=\"discrete\" #valueIndicatorContainer>\n <div class=\"mdc-slider__value-indicator\">\n <span class=\"mdc-slider__value-indicator-text\">{{valueIndicatorText}}</span>\n </div>\n</div>\n<div class=\"mdc-slider__thumb-knob\" #knob></div>\n<div matRipple class=\"mat-mdc-focus-indicator\" [matRippleDisabled]=\"true\"></div>\n", styles: [".mat-mdc-slider-visual-thumb .mat-ripple{height:100%;width:100%}.mat-mdc-slider .mdc-slider__tick-marks{justify-content:start}.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--inactive{position:absolute;left:2px}"] }]
|
|
250
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
231
251
|
type: Inject,
|
|
232
|
-
args: [
|
|
233
|
-
}] }
|
|
252
|
+
args: [MAT_SLIDER]
|
|
253
|
+
}] }]; }, propDecorators: { discrete: [{
|
|
234
254
|
type: Input
|
|
235
255
|
}], thumbPosition: [{
|
|
236
256
|
type: Input
|
|
237
257
|
}], valueIndicatorText: [{
|
|
238
258
|
type: Input
|
|
239
|
-
}], disableRipple: [{
|
|
240
|
-
type: Input
|
|
241
259
|
}], _ripple: [{
|
|
242
260
|
type: ViewChild,
|
|
243
261
|
args: [MatRipple]
|
|
@@ -248,258 +266,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.0", ng
|
|
|
248
266
|
type: ViewChild,
|
|
249
267
|
args: ['valueIndicatorContainer']
|
|
250
268
|
}] } });
|
|
269
|
+
|
|
251
270
|
/**
|
|
252
|
-
*
|
|
253
|
-
*
|
|
271
|
+
* @license
|
|
272
|
+
* Copyright Google LLC All Rights Reserved.
|
|
254
273
|
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
* used, and the outcome will be a range slider with two slider thumbs.
|
|
274
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
275
|
+
* found in the LICENSE file at https://angular.io/license
|
|
258
276
|
*/
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Emits when the raw value of the slider changes. This is here primarily
|
|
265
|
-
* to facilitate the two-way binding for the `value` input.
|
|
266
|
-
* @docs-private
|
|
267
|
-
*/
|
|
268
|
-
this.valueChange = new EventEmitter();
|
|
269
|
-
/** Event emitted when the slider thumb starts being dragged. */
|
|
270
|
-
this.dragStart = new EventEmitter();
|
|
271
|
-
/** Event emitted when the slider thumb stops being dragged. */
|
|
272
|
-
this.dragEnd = new EventEmitter();
|
|
273
|
-
/** Event emitted every time the MatSliderThumb is blurred. */
|
|
274
|
-
this._blur = new EventEmitter();
|
|
275
|
-
/** Event emitted every time the MatSliderThumb is focused. */
|
|
276
|
-
this._focus = new EventEmitter();
|
|
277
|
-
/**
|
|
278
|
-
* Used to determine the disabled state of the MatSlider (ControlValueAccessor).
|
|
279
|
-
* For ranged sliders, the disabled state of the MatSlider depends on the combined state of the
|
|
280
|
-
* start and end inputs. See MatSlider._updateDisabled.
|
|
281
|
-
*/
|
|
282
|
-
this._disabled = false;
|
|
283
|
-
/**
|
|
284
|
-
* A callback function that is called when the
|
|
285
|
-
* control's value changes in the UI (ControlValueAccessor).
|
|
286
|
-
*/
|
|
287
|
-
this._onChange = () => { };
|
|
288
|
-
/**
|
|
289
|
-
* A callback function that is called by the forms API on
|
|
290
|
-
* initialization to update the form model on blur (ControlValueAccessor).
|
|
291
|
-
*/
|
|
292
|
-
this._onTouched = () => { };
|
|
293
|
-
/** Indicates which slider thumb this input corresponds to. */
|
|
294
|
-
this._thumbPosition = this._elementRef.nativeElement.hasAttribute('matSliderStartThumb')
|
|
295
|
-
? Thumb.START
|
|
296
|
-
: Thumb.END;
|
|
297
|
-
this._document = document;
|
|
298
|
-
this._hostElement = _elementRef.nativeElement;
|
|
299
|
-
}
|
|
300
|
-
// ** IMPORTANT NOTE **
|
|
301
|
-
//
|
|
302
|
-
// The way `value` is implemented for MatSliderThumb doesn't follow typical Angular conventions.
|
|
303
|
-
// Normally we would define a private variable `_value` as the source of truth for the value of
|
|
304
|
-
// the slider thumb input. The source of truth for the value of the slider inputs has already
|
|
305
|
-
// been decided for us by MDC to be the value attribute on the slider thumb inputs. This is
|
|
306
|
-
// because the MDC foundation and adapter expect that the value attribute is the source of truth
|
|
307
|
-
// for the slider inputs.
|
|
308
|
-
//
|
|
309
|
-
// Also, note that the value attribute is completely disconnected from the value property.
|
|
310
|
-
/** The current value of this slider input. */
|
|
311
|
-
get value() {
|
|
312
|
-
return coerceNumberProperty(this._hostElement.getAttribute('value'));
|
|
313
|
-
}
|
|
314
|
-
set value(v) {
|
|
315
|
-
const value = coerceNumberProperty(v);
|
|
316
|
-
// If the foundation has already been initialized, we need to
|
|
317
|
-
// relay any value updates to it so that it can update the UI.
|
|
318
|
-
if (this._slider._initialized) {
|
|
319
|
-
this._slider._setValue(value, this._thumbPosition);
|
|
320
|
-
}
|
|
321
|
-
else {
|
|
322
|
-
// Setup for the MDC foundation.
|
|
323
|
-
this._hostElement.setAttribute('value', `${value}`);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
ngOnInit() {
|
|
327
|
-
// By calling this in ngOnInit() we guarantee that the sibling sliders initial value by
|
|
328
|
-
// has already been set by the time we reach ngAfterViewInit().
|
|
329
|
-
this._initializeInputValueAttribute();
|
|
330
|
-
this._initializeAriaValueText();
|
|
331
|
-
}
|
|
332
|
-
ngAfterViewInit() {
|
|
333
|
-
this._initializeInputState();
|
|
334
|
-
this._initializeInputValueProperty();
|
|
335
|
-
// Setup for the MDC foundation.
|
|
336
|
-
if (this._slider.disabled) {
|
|
337
|
-
this._hostElement.disabled = true;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
ngOnDestroy() {
|
|
341
|
-
this.dragStart.complete();
|
|
342
|
-
this.dragEnd.complete();
|
|
343
|
-
this._focus.complete();
|
|
344
|
-
this._blur.complete();
|
|
345
|
-
this.valueChange.complete();
|
|
346
|
-
}
|
|
347
|
-
_onBlur() {
|
|
348
|
-
this._onTouched();
|
|
349
|
-
this._blur.emit();
|
|
350
|
-
}
|
|
351
|
-
_emitFakeEvent(type) {
|
|
352
|
-
const event = new Event(type);
|
|
353
|
-
event._matIsHandled = true;
|
|
354
|
-
this._hostElement.dispatchEvent(event);
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Sets the model value. Implemented as part of ControlValueAccessor.
|
|
358
|
-
* @param value
|
|
359
|
-
*/
|
|
360
|
-
writeValue(value) {
|
|
361
|
-
this.value = value;
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* Registers a callback to be triggered when the value has changed.
|
|
365
|
-
* Implemented as part of ControlValueAccessor.
|
|
366
|
-
* @param fn Callback to be registered.
|
|
367
|
-
*/
|
|
368
|
-
registerOnChange(fn) {
|
|
369
|
-
this._onChange = fn;
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* Registers a callback to be triggered when the component is touched.
|
|
373
|
-
* Implemented as part of ControlValueAccessor.
|
|
374
|
-
* @param fn Callback to be registered.
|
|
375
|
-
*/
|
|
376
|
-
registerOnTouched(fn) {
|
|
377
|
-
this._onTouched = fn;
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Sets whether the component should be disabled.
|
|
381
|
-
* Implemented as part of ControlValueAccessor.
|
|
382
|
-
* @param isDisabled
|
|
383
|
-
*/
|
|
384
|
-
setDisabledState(isDisabled) {
|
|
385
|
-
this._disabled = isDisabled;
|
|
386
|
-
this._slider._updateDisabled();
|
|
387
|
-
}
|
|
388
|
-
focus() {
|
|
389
|
-
this._hostElement.focus();
|
|
390
|
-
}
|
|
391
|
-
blur() {
|
|
392
|
-
this._hostElement.blur();
|
|
393
|
-
}
|
|
394
|
-
/** Returns true if this slider input currently has focus. */
|
|
395
|
-
_isFocused() {
|
|
396
|
-
return this._document.activeElement === this._hostElement;
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Sets the min, max, and step properties on the slider thumb input.
|
|
400
|
-
*
|
|
401
|
-
* Must be called AFTER the sibling slider thumb input is guaranteed to have had its value
|
|
402
|
-
* attribute value set. For a range slider, the min and max of the slider thumb input depends on
|
|
403
|
-
* the value of its sibling slider thumb inputs value.
|
|
404
|
-
*
|
|
405
|
-
* Must be called BEFORE the value property is set. In the case where the min and max have not
|
|
406
|
-
* yet been set and we are setting the input value property to a value outside of the native
|
|
407
|
-
* inputs default min or max. The value property would not be set to our desired value, but
|
|
408
|
-
* instead be capped at either the default min or max.
|
|
409
|
-
*
|
|
410
|
-
*/
|
|
411
|
-
_initializeInputState() {
|
|
412
|
-
const min = this._hostElement.hasAttribute('matSliderEndThumb')
|
|
413
|
-
? this._slider._getInput(Thumb.START).value
|
|
414
|
-
: this._slider.min;
|
|
415
|
-
const max = this._hostElement.hasAttribute('matSliderStartThumb')
|
|
416
|
-
? this._slider._getInput(Thumb.END).value
|
|
417
|
-
: this._slider.max;
|
|
418
|
-
this._hostElement.min = `${min}`;
|
|
419
|
-
this._hostElement.max = `${max}`;
|
|
420
|
-
this._hostElement.step = `${this._slider.step}`;
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* Sets the value property on the slider thumb input.
|
|
424
|
-
*
|
|
425
|
-
* Must be called AFTER the min and max have been set. In the case where the min and max have not
|
|
426
|
-
* yet been set and we are setting the input value property to a value outside of the native
|
|
427
|
-
* inputs default min or max. The value property would not be set to our desired value, but
|
|
428
|
-
* instead be capped at either the default min or max.
|
|
429
|
-
*/
|
|
430
|
-
_initializeInputValueProperty() {
|
|
431
|
-
this._hostElement.value = `${this.value}`;
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* Ensures the value attribute is initialized.
|
|
435
|
-
*
|
|
436
|
-
* Must be called BEFORE the min and max are set. For a range slider, the min and max of the
|
|
437
|
-
* slider thumb input depends on the value of its sibling slider thumb inputs value.
|
|
438
|
-
*/
|
|
439
|
-
_initializeInputValueAttribute() {
|
|
440
|
-
// Only set the default value if an initial value has not already been provided.
|
|
441
|
-
if (!this._hostElement.hasAttribute('value')) {
|
|
442
|
-
this.value = this._hostElement.hasAttribute('matSliderEndThumb')
|
|
443
|
-
? this._slider.max
|
|
444
|
-
: this._slider.min;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
/**
|
|
448
|
-
* Initializes the aria-valuetext attribute.
|
|
449
|
-
*
|
|
450
|
-
* Must be called AFTER the value attribute is set. This is because the slider's parent
|
|
451
|
-
* `displayWith` function is used to set the `aria-valuetext` attribute.
|
|
452
|
-
*/
|
|
453
|
-
_initializeAriaValueText() {
|
|
454
|
-
this._hostElement.setAttribute('aria-valuetext', this._slider.displayWith(this.value));
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
MatSliderThumb.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.0", ngImport: i0, type: MatSliderThumb, deps: [{ token: DOCUMENT }, { token: forwardRef(() => MatSlider) }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
458
|
-
MatSliderThumb.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.0", type: MatSliderThumb, selector: "input[matSliderThumb], input[matSliderStartThumb], input[matSliderEndThumb]", inputs: { value: "value" }, outputs: { valueChange: "valueChange", dragStart: "dragStart", dragEnd: "dragEnd", _blur: "_blur", _focus: "_focus" }, host: { attributes: { "type": "range" }, listeners: { "blur": "_onBlur()", "focus": "_focus.emit()" }, classAttribute: "mdc-slider__input" }, providers: [
|
|
459
|
-
{
|
|
460
|
-
provide: NG_VALUE_ACCESSOR,
|
|
461
|
-
useExisting: MatSliderThumb,
|
|
462
|
-
multi: true,
|
|
463
|
-
},
|
|
464
|
-
], exportAs: ["matSliderThumb"], ngImport: i0 });
|
|
465
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.0", ngImport: i0, type: MatSliderThumb, decorators: [{
|
|
466
|
-
type: Directive,
|
|
467
|
-
args: [{
|
|
468
|
-
selector: 'input[matSliderThumb], input[matSliderStartThumb], input[matSliderEndThumb]',
|
|
469
|
-
exportAs: 'matSliderThumb',
|
|
470
|
-
host: {
|
|
471
|
-
'class': 'mdc-slider__input',
|
|
472
|
-
'type': 'range',
|
|
473
|
-
'(blur)': '_onBlur()',
|
|
474
|
-
'(focus)': '_focus.emit()',
|
|
475
|
-
},
|
|
476
|
-
providers: [
|
|
477
|
-
{
|
|
478
|
-
provide: NG_VALUE_ACCESSOR,
|
|
479
|
-
useExisting: MatSliderThumb,
|
|
480
|
-
multi: true,
|
|
481
|
-
},
|
|
482
|
-
],
|
|
483
|
-
}]
|
|
484
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
485
|
-
type: Inject,
|
|
486
|
-
args: [DOCUMENT]
|
|
487
|
-
}] }, { type: MatSlider, decorators: [{
|
|
488
|
-
type: Inject,
|
|
489
|
-
args: [forwardRef(() => MatSlider)]
|
|
490
|
-
}] }, { type: i0.ElementRef }]; }, propDecorators: { value: [{
|
|
491
|
-
type: Input
|
|
492
|
-
}], valueChange: [{
|
|
493
|
-
type: Output
|
|
494
|
-
}], dragStart: [{
|
|
495
|
-
type: Output
|
|
496
|
-
}], dragEnd: [{
|
|
497
|
-
type: Output
|
|
498
|
-
}], _blur: [{
|
|
499
|
-
type: Output
|
|
500
|
-
}], _focus: [{
|
|
501
|
-
type: Output
|
|
502
|
-
}] } });
|
|
277
|
+
// TODO(wagnermaciel): maybe handle the following edge case:
|
|
278
|
+
// 1. start dragging discrete slider
|
|
279
|
+
// 2. tab to disable checkbox
|
|
280
|
+
// 3. without ending drag, disable the slider
|
|
503
281
|
// Boilerplate for applying mixins to MatSlider.
|
|
504
282
|
const _MatSliderMixinBase = mixinColor(mixinDisableRipple(class {
|
|
505
283
|
constructor(_elementRef) {
|
|
@@ -511,12 +289,11 @@ const _MatSliderMixinBase = mixinColor(mixinDisableRipple(class {
|
|
|
511
289
|
* behavior to the native `<input type="range">` element.
|
|
512
290
|
*/
|
|
513
291
|
class MatSlider extends _MatSliderMixinBase {
|
|
514
|
-
constructor(_ngZone, _cdr,
|
|
292
|
+
constructor(_ngZone, _cdr, _platform, elementRef, _dir, _globalRippleOptions, animationMode) {
|
|
515
293
|
super(elementRef);
|
|
516
294
|
this._ngZone = _ngZone;
|
|
517
295
|
this._cdr = _cdr;
|
|
518
296
|
this._platform = _platform;
|
|
519
|
-
this._globalChangeAndInputListener = _globalChangeAndInputListener;
|
|
520
297
|
this._dir = _dir;
|
|
521
298
|
this._globalRippleOptions = _globalRippleOptions;
|
|
522
299
|
this._disabled = false;
|
|
@@ -524,39 +301,49 @@ class MatSlider extends _MatSliderMixinBase {
|
|
|
524
301
|
this._showTickMarks = false;
|
|
525
302
|
this._min = 0;
|
|
526
303
|
this._max = 100;
|
|
527
|
-
this._step =
|
|
304
|
+
this._step = 0;
|
|
528
305
|
/**
|
|
529
306
|
* Function that will be used to format the value before it is displayed
|
|
530
307
|
* in the thumb label. Can be used to format very large number in order
|
|
531
308
|
* for them to fit into the slider thumb.
|
|
532
309
|
*/
|
|
533
310
|
this.displayWith = (value) => `${value}`;
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
this.
|
|
311
|
+
this._rippleRadius = 24;
|
|
312
|
+
// The value indicator tooltip text for the visual slider thumb(s).
|
|
313
|
+
this.startValueIndicatorText = '';
|
|
314
|
+
this.endValueIndicatorText = '';
|
|
315
|
+
this._isRange = false;
|
|
316
|
+
/** Whether the slider is rtl. */
|
|
317
|
+
this._isRtl = false;
|
|
538
318
|
/**
|
|
539
|
-
*
|
|
540
|
-
*
|
|
541
|
-
* We exclude iOS to mirror the MDC Foundation. The MDC Foundation cannot use pointer events on
|
|
542
|
-
* iOS because of this open bug - https://bugs.webkit.org/show_bug.cgi?id=220196.
|
|
319
|
+
* The width of the tick mark track.
|
|
320
|
+
* The tick mark track width is different from full track width
|
|
543
321
|
*/
|
|
544
|
-
this.
|
|
545
|
-
|
|
546
|
-
this.
|
|
547
|
-
this.
|
|
548
|
-
this.
|
|
322
|
+
this._tickMarkTrackWidth = 0;
|
|
323
|
+
this._hasAnimation = false;
|
|
324
|
+
this._resizeTimer = null;
|
|
325
|
+
/** The radius of the native slider's knob. AFAIK there is no way to avoid hardcoding this. */
|
|
326
|
+
this._knobRadius = 8;
|
|
327
|
+
/** Whether or not the slider thumbs overlap. */
|
|
328
|
+
this._thumbsOverlap = false;
|
|
549
329
|
this._noopAnimations = animationMode === 'NoopAnimations';
|
|
550
330
|
this._dirChangeSubscription = this._dir.change.subscribe(() => this._onDirChange());
|
|
551
|
-
this.
|
|
331
|
+
this._isRtl = this._dir.value === 'rtl';
|
|
552
332
|
}
|
|
553
333
|
/** Whether the slider is disabled. */
|
|
554
334
|
get disabled() {
|
|
555
335
|
return this._disabled;
|
|
556
336
|
}
|
|
557
337
|
set disabled(v) {
|
|
558
|
-
this.
|
|
559
|
-
this.
|
|
338
|
+
this._disabled = coerceBooleanProperty(v);
|
|
339
|
+
const endInput = this._getInput(2 /* _MatThumb.END */);
|
|
340
|
+
const startInput = this._getInput(1 /* _MatThumb.START */);
|
|
341
|
+
if (endInput) {
|
|
342
|
+
endInput.disabled = this._disabled;
|
|
343
|
+
}
|
|
344
|
+
if (startInput) {
|
|
345
|
+
startInput.disabled = this._disabled;
|
|
346
|
+
}
|
|
560
347
|
}
|
|
561
348
|
/** Whether the slider displays a numeric value label upon pressing the thumb. */
|
|
562
349
|
get discrete() {
|
|
@@ -577,261 +364,526 @@ class MatSlider extends _MatSliderMixinBase {
|
|
|
577
364
|
return this._min;
|
|
578
365
|
}
|
|
579
366
|
set min(v) {
|
|
580
|
-
|
|
581
|
-
this.
|
|
367
|
+
const min = coerceNumberProperty(v, this._min);
|
|
368
|
+
if (this._min !== min) {
|
|
369
|
+
this._updateMin(min);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
_updateMin(min) {
|
|
373
|
+
const prevMin = this._min;
|
|
374
|
+
this._min = min;
|
|
375
|
+
this._isRange ? this._updateMinRange({ old: prevMin, new: min }) : this._updateMinNonRange(min);
|
|
376
|
+
this._onMinMaxOrStepChange();
|
|
377
|
+
}
|
|
378
|
+
_updateMinRange(min) {
|
|
379
|
+
const endInput = this._getInput(2 /* _MatThumb.END */);
|
|
380
|
+
const startInput = this._getInput(1 /* _MatThumb.START */);
|
|
381
|
+
const oldEndValue = endInput.value;
|
|
382
|
+
const oldStartValue = startInput.value;
|
|
383
|
+
startInput.min = min.new;
|
|
384
|
+
endInput.min = Math.max(min.new, startInput.value);
|
|
385
|
+
startInput.max = Math.min(endInput.max, endInput.value);
|
|
386
|
+
startInput._updateWidthInactive();
|
|
387
|
+
endInput._updateWidthInactive();
|
|
388
|
+
min.new < min.old
|
|
389
|
+
? this._onTranslateXChangeBySideEffect(endInput, startInput)
|
|
390
|
+
: this._onTranslateXChangeBySideEffect(startInput, endInput);
|
|
391
|
+
if (oldEndValue !== endInput.value) {
|
|
392
|
+
this._onValueChange(endInput);
|
|
393
|
+
}
|
|
394
|
+
if (oldStartValue !== startInput.value) {
|
|
395
|
+
this._onValueChange(startInput);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
_updateMinNonRange(min) {
|
|
399
|
+
const input = this._getInput(2 /* _MatThumb.END */);
|
|
400
|
+
if (input) {
|
|
401
|
+
const oldValue = input.value;
|
|
402
|
+
input.min = min;
|
|
403
|
+
input._updateThumbUIByValue();
|
|
404
|
+
this._updateTrackUI(input);
|
|
405
|
+
if (oldValue !== input.value) {
|
|
406
|
+
this._onValueChange(input);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
582
409
|
}
|
|
583
410
|
/** The maximum value that the slider can have. */
|
|
584
411
|
get max() {
|
|
585
412
|
return this._max;
|
|
586
413
|
}
|
|
587
414
|
set max(v) {
|
|
588
|
-
|
|
589
|
-
this.
|
|
415
|
+
const max = coerceNumberProperty(v, this._max);
|
|
416
|
+
if (this._max !== max) {
|
|
417
|
+
this._updateMax(max);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
_updateMax(max) {
|
|
421
|
+
const prevMax = this._max;
|
|
422
|
+
this._max = max;
|
|
423
|
+
this._isRange ? this._updateMaxRange({ old: prevMax, new: max }) : this._updateMaxNonRange(max);
|
|
424
|
+
this._onMinMaxOrStepChange();
|
|
425
|
+
}
|
|
426
|
+
_updateMaxRange(max) {
|
|
427
|
+
const endInput = this._getInput(2 /* _MatThumb.END */);
|
|
428
|
+
const startInput = this._getInput(1 /* _MatThumb.START */);
|
|
429
|
+
const oldEndValue = endInput.value;
|
|
430
|
+
const oldStartValue = startInput.value;
|
|
431
|
+
endInput.max = max.new;
|
|
432
|
+
startInput.max = Math.min(max.new, endInput.value);
|
|
433
|
+
endInput.min = startInput.value;
|
|
434
|
+
endInput._updateWidthInactive();
|
|
435
|
+
startInput._updateWidthInactive();
|
|
436
|
+
max.new > max.old
|
|
437
|
+
? this._onTranslateXChangeBySideEffect(startInput, endInput)
|
|
438
|
+
: this._onTranslateXChangeBySideEffect(endInput, startInput);
|
|
439
|
+
if (oldEndValue !== endInput.value) {
|
|
440
|
+
this._onValueChange(endInput);
|
|
441
|
+
}
|
|
442
|
+
if (oldStartValue !== startInput.value) {
|
|
443
|
+
this._onValueChange(startInput);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
_updateMaxNonRange(max) {
|
|
447
|
+
const input = this._getInput(2 /* _MatThumb.END */);
|
|
448
|
+
if (input) {
|
|
449
|
+
const oldValue = input.value;
|
|
450
|
+
input.max = max;
|
|
451
|
+
input._updateThumbUIByValue();
|
|
452
|
+
this._updateTrackUI(input);
|
|
453
|
+
if (oldValue !== input.value) {
|
|
454
|
+
this._onValueChange(input);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
590
457
|
}
|
|
591
458
|
/** The values at which the thumb will snap. */
|
|
592
459
|
get step() {
|
|
593
460
|
return this._step;
|
|
594
461
|
}
|
|
595
462
|
set step(v) {
|
|
596
|
-
|
|
597
|
-
this.
|
|
463
|
+
const step = coerceNumberProperty(v, this._step);
|
|
464
|
+
if (this._step !== step) {
|
|
465
|
+
this._updateStep(step);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
_updateStep(step) {
|
|
469
|
+
this._step = step;
|
|
470
|
+
this._isRange ? this._updateStepRange() : this._updateStepNonRange();
|
|
471
|
+
this._onMinMaxOrStepChange();
|
|
472
|
+
}
|
|
473
|
+
_updateStepRange() {
|
|
474
|
+
const endInput = this._getInput(2 /* _MatThumb.END */);
|
|
475
|
+
const startInput = this._getInput(1 /* _MatThumb.START */);
|
|
476
|
+
const oldEndValue = endInput.value;
|
|
477
|
+
const oldStartValue = startInput.value;
|
|
478
|
+
const prevStartValue = startInput.value;
|
|
479
|
+
endInput.min = this._min;
|
|
480
|
+
startInput.max = this._max;
|
|
481
|
+
endInput.step = this._step;
|
|
482
|
+
startInput.step = this._step;
|
|
483
|
+
if (this._platform.SAFARI) {
|
|
484
|
+
endInput.value = endInput.value;
|
|
485
|
+
startInput.value = startInput.value;
|
|
486
|
+
}
|
|
487
|
+
endInput.min = Math.max(this._min, startInput.value);
|
|
488
|
+
startInput.max = Math.min(this._max, endInput.value);
|
|
489
|
+
startInput._updateWidthInactive();
|
|
490
|
+
endInput._updateWidthInactive();
|
|
491
|
+
endInput.value < prevStartValue
|
|
492
|
+
? this._onTranslateXChangeBySideEffect(startInput, endInput)
|
|
493
|
+
: this._onTranslateXChangeBySideEffect(endInput, startInput);
|
|
494
|
+
if (oldEndValue !== endInput.value) {
|
|
495
|
+
this._onValueChange(endInput);
|
|
496
|
+
}
|
|
497
|
+
if (oldStartValue !== startInput.value) {
|
|
498
|
+
this._onValueChange(startInput);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
_updateStepNonRange() {
|
|
502
|
+
const input = this._getInput(2 /* _MatThumb.END */);
|
|
503
|
+
if (input) {
|
|
504
|
+
const oldValue = input.value;
|
|
505
|
+
input.step = this._step;
|
|
506
|
+
if (this._platform.SAFARI) {
|
|
507
|
+
input.value = input.value;
|
|
508
|
+
}
|
|
509
|
+
input._updateThumbUIByValue();
|
|
510
|
+
if (oldValue !== input.value) {
|
|
511
|
+
this._onValueChange(input);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
598
514
|
}
|
|
599
515
|
ngAfterViewInit() {
|
|
516
|
+
if (this._platform.isBrowser) {
|
|
517
|
+
this._updateDimensions();
|
|
518
|
+
}
|
|
519
|
+
const eInput = this._getInput(2 /* _MatThumb.END */);
|
|
520
|
+
const sInput = this._getInput(1 /* _MatThumb.START */);
|
|
521
|
+
this._isRange = !!eInput && !!sInput;
|
|
600
522
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
601
|
-
|
|
602
|
-
_validateInputs(this._isRange(), this._getInputElement(Thumb.START), this._getInputElement(Thumb.END));
|
|
523
|
+
_validateInputs(this._isRange, this._getInput(2 /* _MatThumb.END */), this._getInput(1 /* _MatThumb.START */));
|
|
603
524
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
525
|
+
const thumb = this._getThumb(2 /* _MatThumb.END */);
|
|
526
|
+
this._rippleRadius = thumb._ripple.radius;
|
|
527
|
+
this._inputPadding = this._rippleRadius - this._knobRadius;
|
|
528
|
+
this._inputOffset = this._knobRadius;
|
|
529
|
+
if (eInput) {
|
|
530
|
+
eInput.initProps();
|
|
531
|
+
eInput.initUI();
|
|
532
|
+
}
|
|
533
|
+
if (sInput) {
|
|
534
|
+
sInput.initProps();
|
|
535
|
+
sInput.initUI();
|
|
536
|
+
}
|
|
537
|
+
if (this._isRange) {
|
|
538
|
+
eInput._updateMinMax();
|
|
539
|
+
sInput._updateMinMax();
|
|
540
|
+
}
|
|
541
|
+
this._updateTrackUI(eInput);
|
|
542
|
+
this._updateTickMarkUI();
|
|
543
|
+
this._updateTickMarkTrackUI();
|
|
544
|
+
this._observeHostResize();
|
|
620
545
|
this._cdr.detectChanges();
|
|
621
546
|
}
|
|
622
547
|
ngOnDestroy() {
|
|
623
|
-
if (this._platform.isBrowser) {
|
|
624
|
-
this._foundation.destroy();
|
|
625
|
-
}
|
|
626
548
|
this._dirChangeSubscription.unsubscribe();
|
|
627
549
|
this._resizeObserver?.disconnect();
|
|
628
550
|
this._resizeObserver = null;
|
|
629
|
-
clearTimeout(this._resizeTimer);
|
|
630
|
-
this._removeUISyncEventListener();
|
|
631
|
-
}
|
|
632
|
-
/** Returns true if the language direction for this slider element is right to left. */
|
|
633
|
-
_isRTL() {
|
|
634
|
-
return this._dir && this._dir.value === 'rtl';
|
|
635
551
|
}
|
|
636
|
-
/**
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
552
|
+
/** Handles updating the slider ui after a dir change. */
|
|
553
|
+
_onDirChange() {
|
|
554
|
+
this._isRtl = this._dir.value === 'rtl';
|
|
555
|
+
this._isRange ? this._onDirChangeRange() : this._onDirChangeNonRange();
|
|
556
|
+
this._updateTickMarkUI();
|
|
557
|
+
}
|
|
558
|
+
_onDirChangeRange() {
|
|
559
|
+
const endInput = this._getInput(2 /* _MatThumb.END */);
|
|
560
|
+
const startInput = this._getInput(1 /* _MatThumb.START */);
|
|
561
|
+
endInput._setIsLeftThumb();
|
|
562
|
+
startInput._setIsLeftThumb();
|
|
563
|
+
endInput.translateX = endInput._calcTranslateXByValue();
|
|
564
|
+
startInput.translateX = startInput._calcTranslateXByValue();
|
|
565
|
+
endInput._updateStaticStyles();
|
|
566
|
+
startInput._updateStaticStyles();
|
|
567
|
+
endInput._updateWidthInactive();
|
|
568
|
+
startInput._updateWidthInactive();
|
|
569
|
+
endInput._updateThumbUIByValue();
|
|
570
|
+
startInput._updateThumbUIByValue();
|
|
571
|
+
}
|
|
572
|
+
_onDirChangeNonRange() {
|
|
573
|
+
const input = this._getInput(2 /* _MatThumb.END */);
|
|
574
|
+
input._updateThumbUIByValue();
|
|
656
575
|
}
|
|
657
|
-
/**
|
|
658
|
-
|
|
659
|
-
if (
|
|
660
|
-
|
|
661
|
-
}
|
|
662
|
-
else {
|
|
663
|
-
this._elementRef.nativeElement.removeEventListener('mouseenter', this._layout);
|
|
664
|
-
this._elementRef.nativeElement.removeEventListener('touchstart', this._layout, passiveEventListenerOptions);
|
|
576
|
+
/** Starts observing and updating the slider if the host changes its size. */
|
|
577
|
+
_observeHostResize() {
|
|
578
|
+
if (typeof ResizeObserver === 'undefined' || !ResizeObserver) {
|
|
579
|
+
return;
|
|
665
580
|
}
|
|
666
|
-
}
|
|
667
|
-
/**
|
|
668
|
-
* Reinitializes the slider foundation and input state(s).
|
|
669
|
-
*
|
|
670
|
-
* The MDC Foundation does not support changing some slider attributes after it has been
|
|
671
|
-
* initialized (e.g. min, max, and step). To continue supporting this feature, we need to
|
|
672
|
-
* destroy the foundation and re-initialize everything whenever we make these changes.
|
|
673
|
-
*/
|
|
674
|
-
_reinitialize() {
|
|
675
|
-
if (this._initialized) {
|
|
676
|
-
this._foundation.destroy();
|
|
677
|
-
if (this._isRange()) {
|
|
678
|
-
this._getInput(Thumb.START)._initializeInputState();
|
|
679
|
-
}
|
|
680
|
-
this._getInput(Thumb.END)._initializeInputState();
|
|
681
|
-
this._foundation.init();
|
|
682
|
-
this._foundation.layout();
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
/** Handles updating the slider foundation after a dir change. */
|
|
686
|
-
_onDirChange() {
|
|
687
581
|
this._ngZone.runOutsideAngular(() => {
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
582
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
583
|
+
if (this._isActive()) {
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
if (this._resizeTimer) {
|
|
587
|
+
clearTimeout(this._resizeTimer);
|
|
588
|
+
}
|
|
589
|
+
this._onResize();
|
|
590
|
+
});
|
|
591
|
+
this._resizeObserver.observe(this._elementRef.nativeElement);
|
|
691
592
|
});
|
|
692
593
|
}
|
|
693
|
-
/**
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
? this._foundation.setValueStart(value)
|
|
697
|
-
: this._foundation.setValue(value);
|
|
698
|
-
}
|
|
699
|
-
/** Sets the disabled state of the MatSlider. */
|
|
700
|
-
_setDisabled(value) {
|
|
701
|
-
this._disabled = value;
|
|
702
|
-
// If we want to disable the slider after the foundation has been initialized,
|
|
703
|
-
// we need to inform the foundation by calling `setDisabled`. Also, we can't call
|
|
704
|
-
// this before initializing the foundation because it will throw errors.
|
|
705
|
-
if (this._initialized) {
|
|
706
|
-
this._foundation.setDisabled(value);
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
/** Sets the disabled state of the individual slider thumb(s) (ControlValueAccessor). */
|
|
710
|
-
_updateInputsDisabledState() {
|
|
711
|
-
if (this._initialized) {
|
|
712
|
-
this._getInput(Thumb.END)._disabled = true;
|
|
713
|
-
if (this._isRange()) {
|
|
714
|
-
this._getInput(Thumb.START)._disabled = true;
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
/** Whether this is a ranged slider. */
|
|
719
|
-
_isRange() {
|
|
720
|
-
return this._inputs.length === 2;
|
|
721
|
-
}
|
|
722
|
-
/** Sets the disabled state based on the disabled state of the inputs (ControlValueAccessor). */
|
|
723
|
-
_updateDisabled() {
|
|
724
|
-
const disabled = this._inputs?.some(input => input._disabled) || false;
|
|
725
|
-
this._setDisabled(disabled);
|
|
726
|
-
}
|
|
727
|
-
/** Gets the slider thumb input of the given thumb position. */
|
|
728
|
-
_getInput(thumbPosition) {
|
|
729
|
-
return thumbPosition === Thumb.END ? this._inputs?.last : this._inputs?.first;
|
|
730
|
-
}
|
|
731
|
-
/** Gets the slider thumb HTML input element of the given thumb position. */
|
|
732
|
-
_getInputElement(thumbPosition) {
|
|
733
|
-
return this._getInput(thumbPosition)?._hostElement;
|
|
594
|
+
/** Whether any of the thumbs are currently active. */
|
|
595
|
+
_isActive() {
|
|
596
|
+
return this._getThumb(1 /* _MatThumb.START */)._isActive || this._getThumb(2 /* _MatThumb.END */)._isActive;
|
|
734
597
|
}
|
|
735
|
-
|
|
736
|
-
|
|
598
|
+
_getValue(thumbPosition = 2 /* _MatThumb.END */) {
|
|
599
|
+
const input = this._getInput(thumbPosition);
|
|
600
|
+
if (!input) {
|
|
601
|
+
return this.min;
|
|
602
|
+
}
|
|
603
|
+
return input.value;
|
|
604
|
+
}
|
|
605
|
+
_skipUpdate() {
|
|
606
|
+
return !!(this._getInput(1 /* _MatThumb.START */)?._skipUIUpdate || this._getInput(2 /* _MatThumb.END */)?._skipUIUpdate);
|
|
607
|
+
}
|
|
608
|
+
/** Stores the slider dimensions. */
|
|
609
|
+
_updateDimensions() {
|
|
610
|
+
const rect = this._elementRef.nativeElement.getBoundingClientRect();
|
|
611
|
+
this._cachedWidth = rect.width;
|
|
612
|
+
this._cachedLeft = rect.left;
|
|
613
|
+
}
|
|
614
|
+
/** Sets the styles for the active portion of the track. */
|
|
615
|
+
_setTrackActiveStyles(styles) {
|
|
616
|
+
const trackStyle = this._trackActive.nativeElement.style;
|
|
617
|
+
trackStyle.left = styles.left;
|
|
618
|
+
trackStyle.right = styles.right;
|
|
619
|
+
trackStyle.transform = styles.transform;
|
|
620
|
+
trackStyle.transformOrigin = styles.transformOrigin;
|
|
621
|
+
}
|
|
622
|
+
/** Returns the translateX positioning for a tick mark based on it's index. */
|
|
623
|
+
_calcTickMarkTransform(index) {
|
|
624
|
+
// TODO(wagnermaciel): See if we can avoid doing this and just using flex to position these.
|
|
625
|
+
const translateX = index * (this._tickMarkTrackWidth / (this._tickMarks.length - 1));
|
|
626
|
+
return `translateX(${translateX}px`;
|
|
627
|
+
}
|
|
628
|
+
// Handlers for updating the slider ui.
|
|
629
|
+
_onTranslateXChange(source) {
|
|
630
|
+
this._updateThumbUI(source);
|
|
631
|
+
this._updateTrackUI(source);
|
|
632
|
+
this._updateOverlappingThumbUI(source);
|
|
633
|
+
}
|
|
634
|
+
_onTranslateXChangeBySideEffect(input1, input2) {
|
|
635
|
+
input1._updateThumbUIByValue();
|
|
636
|
+
input2._updateThumbUIByValue();
|
|
637
|
+
}
|
|
638
|
+
_onValueChange(source) {
|
|
639
|
+
this._updateValueIndicatorUI(source);
|
|
640
|
+
this._updateTickMarkUI();
|
|
641
|
+
this._cdr.detectChanges();
|
|
737
642
|
}
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
643
|
+
_onMinMaxOrStepChange() {
|
|
644
|
+
this._updateTickMarkUI();
|
|
645
|
+
this._updateTickMarkTrackUI();
|
|
646
|
+
this._cdr.markForCheck();
|
|
741
647
|
}
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
648
|
+
_onResize() {
|
|
649
|
+
this._updateDimensions();
|
|
650
|
+
if (this._isRange) {
|
|
651
|
+
const eInput = this._getInput(2 /* _MatThumb.END */);
|
|
652
|
+
const sInput = this._getInput(1 /* _MatThumb.START */);
|
|
653
|
+
eInput._updateThumbUIByValue();
|
|
654
|
+
sInput._updateThumbUIByValue();
|
|
655
|
+
eInput._updateStaticStyles();
|
|
656
|
+
sInput._updateStaticStyles();
|
|
657
|
+
eInput._updateMinMax();
|
|
658
|
+
sInput._updateMinMax();
|
|
659
|
+
eInput._updateWidthInactive();
|
|
660
|
+
sInput._updateWidthInactive();
|
|
661
|
+
}
|
|
662
|
+
else {
|
|
663
|
+
const eInput = this._getInput(2 /* _MatThumb.END */);
|
|
664
|
+
if (eInput) {
|
|
665
|
+
eInput._updateThumbUIByValue();
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
this._updateTickMarkUI();
|
|
669
|
+
this._updateTickMarkTrackUI();
|
|
670
|
+
this._cdr.detectChanges();
|
|
745
671
|
}
|
|
746
|
-
/**
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
672
|
+
/** Returns true if the slider knobs are overlapping one another. */
|
|
673
|
+
_areThumbsOverlapping() {
|
|
674
|
+
const startInput = this._getInput(1 /* _MatThumb.START */);
|
|
675
|
+
const endInput = this._getInput(2 /* _MatThumb.END */);
|
|
676
|
+
if (!startInput || !endInput) {
|
|
677
|
+
return false;
|
|
678
|
+
}
|
|
679
|
+
return endInput.translateX - startInput.translateX < 20;
|
|
752
680
|
}
|
|
753
681
|
/**
|
|
754
|
-
*
|
|
755
|
-
*
|
|
756
|
-
* Uses the `displayWith` function if one has been provided. Otherwise, it just uses the
|
|
757
|
-
* numeric value as a string.
|
|
682
|
+
* Updates the class names of overlapping slider thumbs so
|
|
683
|
+
* that the current active thumb is styled to be on "top".
|
|
758
684
|
*/
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
685
|
+
_updateOverlappingThumbClassNames(source) {
|
|
686
|
+
const sibling = source.getSibling();
|
|
687
|
+
const sourceThumb = this._getThumb(source.thumbPosition);
|
|
688
|
+
const siblingThumb = this._getThumb(sibling.thumbPosition);
|
|
689
|
+
siblingThumb._hostElement.classList.remove('mdc-slider__thumb--top');
|
|
690
|
+
sourceThumb._hostElement.classList.toggle('mdc-slider__thumb--top', this._thumbsOverlap);
|
|
691
|
+
}
|
|
692
|
+
/** Updates the UI of slider thumbs when they begin or stop overlapping. */
|
|
693
|
+
_updateOverlappingThumbUI(source) {
|
|
694
|
+
if (!this._isRange || this._skipUpdate()) {
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
if (this._thumbsOverlap !== this._areThumbsOverlapping()) {
|
|
698
|
+
this._thumbsOverlap = !this._thumbsOverlap;
|
|
699
|
+
this._updateOverlappingThumbClassNames(source);
|
|
700
|
+
}
|
|
764
701
|
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
702
|
+
// _MatThumb styles update conditions
|
|
703
|
+
//
|
|
704
|
+
// 1. TranslateX, resize, or dir change
|
|
705
|
+
// - Reason: The thumb styles need to be updated according to the new translateX.
|
|
706
|
+
// 2. Min, max, or step
|
|
707
|
+
// - Reason: The value may have silently changed.
|
|
708
|
+
/** Updates the translateX of the given thumb. */
|
|
709
|
+
_updateThumbUI(source) {
|
|
710
|
+
if (this._skipUpdate()) {
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
const thumb = this._getThumb(source.thumbPosition === 2 /* _MatThumb.END */ ? 2 /* _MatThumb.END */ : 1 /* _MatThumb.START */);
|
|
714
|
+
thumb._hostElement.style.transform = `translateX(${source.translateX}px)`;
|
|
770
715
|
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
716
|
+
// Value indicator text update conditions
|
|
717
|
+
//
|
|
718
|
+
// 1. Value
|
|
719
|
+
// - Reason: The value displayed needs to be updated.
|
|
720
|
+
// 2. Min, max, or step
|
|
721
|
+
// - Reason: The value may have silently changed.
|
|
722
|
+
/** Updates the value indicator tooltip ui for the given thumb. */
|
|
723
|
+
_updateValueIndicatorUI(source) {
|
|
724
|
+
if (this._skipUpdate()) {
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
const valuetext = this.displayWith(source.value);
|
|
728
|
+
source._valuetext = valuetext;
|
|
729
|
+
if (this.discrete) {
|
|
730
|
+
source.thumbPosition === 1 /* _MatThumb.START */
|
|
731
|
+
? (this.startValueIndicatorText = valuetext)
|
|
732
|
+
: (this.endValueIndicatorText = valuetext);
|
|
733
|
+
const visualThumb = this._getThumb(source.thumbPosition);
|
|
734
|
+
valuetext.length < 3
|
|
735
|
+
? visualThumb._hostElement.classList.add('mdc-slider__thumb--short-value')
|
|
736
|
+
: visualThumb._hostElement.classList.remove('mdc-slider__thumb--short-value');
|
|
737
|
+
}
|
|
776
738
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
739
|
+
// Update Tick Mark Track Width
|
|
740
|
+
//
|
|
741
|
+
// 1. Min, max, or step
|
|
742
|
+
// - Reason: The maximum reachable value may have changed.
|
|
743
|
+
// - Side note: The maximum reachable value is different from the maximum value set by the
|
|
744
|
+
// user. For example, a slider with [min: 5, max: 100, step: 10] would have a maximum
|
|
745
|
+
// reachable value of 95.
|
|
746
|
+
// 2. Resize
|
|
747
|
+
// - Reason: The position for the maximum reachable value needs to be recalculated.
|
|
748
|
+
/** Updates the width of the tick mark track. */
|
|
749
|
+
_updateTickMarkTrackUI() {
|
|
750
|
+
if (this._skipUpdate()) {
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
const step = this._step && this._step > 0 ? this._step : 1;
|
|
754
|
+
const maxValue = Math.floor(this.max / step) * step;
|
|
755
|
+
const percentage = (maxValue - this.min) / (this.max - this.min);
|
|
756
|
+
this._tickMarkTrackWidth = this._cachedWidth * percentage - 6;
|
|
780
757
|
}
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
758
|
+
// Track active update conditions
|
|
759
|
+
//
|
|
760
|
+
// 1. TranslateX
|
|
761
|
+
// - Reason: The track active should line up with the new thumb position.
|
|
762
|
+
// 2. Min or max
|
|
763
|
+
// - Reason #1: The 'active' percentage needs to be recalculated.
|
|
764
|
+
// - Reason #2: The value may have silently changed.
|
|
765
|
+
// 3. Step
|
|
766
|
+
// - Reason: The value may have silently changed causing the thumb(s) to shift.
|
|
767
|
+
// 4. Dir change
|
|
768
|
+
// - Reason: The track active will need to be updated according to the new thumb position(s).
|
|
769
|
+
// 5. Resize
|
|
770
|
+
// - Reason: The total width the 'active' tracks translateX is based on has changed.
|
|
771
|
+
/** Updates the scale on the active portion of the track. */
|
|
772
|
+
_updateTrackUI(source) {
|
|
773
|
+
if (this._skipUpdate()) {
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
776
|
+
this._isRange
|
|
777
|
+
? this._updateTrackUIRange(source)
|
|
778
|
+
: this._updateTrackUINonRange(source);
|
|
784
779
|
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
if (
|
|
780
|
+
_updateTrackUIRange(source) {
|
|
781
|
+
const sibling = source.getSibling();
|
|
782
|
+
if (!sibling || !this._cachedWidth) {
|
|
788
783
|
return;
|
|
789
784
|
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
return;
|
|
798
|
-
}
|
|
799
|
-
clearTimeout(this._resizeTimer);
|
|
800
|
-
this._resizeTimer = setTimeout(() => {
|
|
801
|
-
// The `layout` call is going to call `getBoundingClientRect` to update the dimensions
|
|
802
|
-
// of the host. Since the `ResizeObserver` already calculated them, we can save some
|
|
803
|
-
// work by returning them instead of having to check the DOM again.
|
|
804
|
-
if (!this._isActive()) {
|
|
805
|
-
this._cachedHostRect = entries[0]?.contentRect;
|
|
806
|
-
this._layout();
|
|
807
|
-
this._cachedHostRect = null;
|
|
808
|
-
}
|
|
809
|
-
}, 50);
|
|
785
|
+
const activePercentage = Math.abs(sibling.translateX - source.translateX) / this._cachedWidth;
|
|
786
|
+
if (source._isLeftThumb && this._cachedWidth) {
|
|
787
|
+
this._setTrackActiveStyles({
|
|
788
|
+
left: 'auto',
|
|
789
|
+
right: `${this._cachedWidth - sibling.translateX}px`,
|
|
790
|
+
transformOrigin: 'right',
|
|
791
|
+
transform: `scaleX(${activePercentage})`,
|
|
810
792
|
});
|
|
811
|
-
|
|
812
|
-
|
|
793
|
+
}
|
|
794
|
+
else {
|
|
795
|
+
this._setTrackActiveStyles({
|
|
796
|
+
left: `${sibling.translateX}px`,
|
|
797
|
+
right: 'auto',
|
|
798
|
+
transformOrigin: 'left',
|
|
799
|
+
transform: `scaleX(${activePercentage})`,
|
|
800
|
+
});
|
|
801
|
+
}
|
|
813
802
|
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
803
|
+
_updateTrackUINonRange(source) {
|
|
804
|
+
this._isRtl
|
|
805
|
+
? this._setTrackActiveStyles({
|
|
806
|
+
left: 'auto',
|
|
807
|
+
right: '0px',
|
|
808
|
+
transformOrigin: 'right',
|
|
809
|
+
transform: `scaleX(${1 - source.fillPercentage})`,
|
|
810
|
+
})
|
|
811
|
+
: this._setTrackActiveStyles({
|
|
812
|
+
left: '0px',
|
|
813
|
+
right: 'auto',
|
|
814
|
+
transformOrigin: 'left',
|
|
815
|
+
transform: `scaleX(${source.fillPercentage})`,
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
// Tick mark update conditions
|
|
819
|
+
//
|
|
820
|
+
// 1. Value
|
|
821
|
+
// - Reason: a tick mark which was once active might now be inactive or vice versa.
|
|
822
|
+
// 2. Min, max, or step
|
|
823
|
+
// - Reason #1: the number of tick marks may have changed.
|
|
824
|
+
// - Reason #2: The value may have silently changed.
|
|
825
|
+
/** Updates the dots along the slider track. */
|
|
826
|
+
_updateTickMarkUI() {
|
|
827
|
+
if (this.step === undefined || this.min === undefined || this.max === undefined) {
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
830
|
+
const step = this.step > 0 ? this.step : 1;
|
|
831
|
+
this._isRange ? this._updateTickMarkUIRange(step) : this._updateTickMarkUINonRange(step);
|
|
832
|
+
if (this._isRtl) {
|
|
833
|
+
this._tickMarks.reverse();
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
_updateTickMarkUINonRange(step) {
|
|
837
|
+
const value = this._getValue();
|
|
838
|
+
let numActive = Math.max(Math.round((value - this.min) / step), 0);
|
|
839
|
+
let numInactive = Math.max(Math.round((this.max - value) / step), 0);
|
|
840
|
+
this._isRtl ? numActive++ : numInactive++;
|
|
841
|
+
this._tickMarks = Array(numActive)
|
|
842
|
+
.fill(0 /* _MatTickMark.ACTIVE */)
|
|
843
|
+
.concat(Array(numInactive).fill(1 /* _MatTickMark.INACTIVE */));
|
|
844
|
+
}
|
|
845
|
+
_updateTickMarkUIRange(step) {
|
|
846
|
+
const endValue = this._getValue();
|
|
847
|
+
const startValue = this._getValue(1 /* _MatThumb.START */);
|
|
848
|
+
const numInactiveBeforeStartThumb = Math.max(Math.floor((startValue - this.min) / step), 0);
|
|
849
|
+
const numActive = Math.max(Math.floor((endValue - startValue) / step) + 1, 0);
|
|
850
|
+
const numInactiveAfterEndThumb = Math.max(Math.floor((this.max - endValue) / step), 0);
|
|
851
|
+
this._tickMarks = Array(numInactiveBeforeStartThumb)
|
|
852
|
+
.fill(1 /* _MatTickMark.INACTIVE */)
|
|
853
|
+
.concat(Array(numActive).fill(0 /* _MatTickMark.ACTIVE */), Array(numInactiveAfterEndThumb).fill(1 /* _MatTickMark.INACTIVE */));
|
|
854
|
+
}
|
|
855
|
+
/** Gets the slider thumb input of the given thumb position. */
|
|
856
|
+
_getInput(thumbPosition) {
|
|
857
|
+
if (thumbPosition === 2 /* _MatThumb.END */ && this._input) {
|
|
858
|
+
return this._input;
|
|
859
|
+
}
|
|
860
|
+
if (this._inputs?.length) {
|
|
861
|
+
return thumbPosition === 1 /* _MatThumb.START */ ? this._inputs.first : this._inputs.last;
|
|
862
|
+
}
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
/** Gets the slider thumb HTML input element of the given thumb position. */
|
|
866
|
+
_getThumb(thumbPosition) {
|
|
867
|
+
return thumbPosition === 2 /* _MatThumb.END */ ? this._thumbs?.last : this._thumbs?.first;
|
|
868
|
+
}
|
|
869
|
+
_setTransition(withAnimation) {
|
|
870
|
+
this._hasAnimation = withAnimation && !this._noopAnimations;
|
|
871
|
+
this._elementRef.nativeElement.classList.toggle('mat-mdc-slider-with-animation', this._hasAnimation);
|
|
817
872
|
}
|
|
818
873
|
}
|
|
819
|
-
MatSlider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
820
|
-
MatSlider.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0-rc.0", type: MatSlider, selector: "mat-slider", inputs: { color: "color", disableRipple: "disableRipple", disabled: "disabled", discrete: "discrete", showTickMarks: "showTickMarks", min: "min", max: "max", step: "step", displayWith: "displayWith" }, host: { properties: { "class.mdc-slider--range": "_isRange()", "class.mdc-slider--disabled": "disabled", "class.mdc-slider--discrete": "discrete", "class.mdc-slider--tick-marks": "showTickMarks", "class._mat-animation-noopable": "_noopAnimations" }, classAttribute: "mat-mdc-slider mdc-slider" }, queries: [{ propertyName: "_inputs", predicate: MatSliderThumb }], viewQueries: [{ propertyName: "_trackActive", first: true, predicate: ["trackActive"], descendants: true }, { propertyName: "_thumbs", predicate: MatSliderVisualThumb, descendants: true }], exportAs: ["matSlider"], usesInheritance: true, ngImport: i0, template: "<!-- Inputs -->\n<ng-content></ng-content>\n\n<!-- Track -->\n<div class=\"mdc-slider__track\">\n <div class=\"mdc-slider__track--inactive\"></div>\n <div class=\"mdc-slider__track--active\">\n <div class=\"mdc-slider__track--active_fill\" #trackActive></div>\n </div>\n <div *ngIf=\"showTickMarks\" class=\"mdc-slider__tick-marks\" #tickMarkContainer>\n <div *ngFor=\"let tickMark of _tickMarks\" [class]=\"_getTickMarkClass(tickMark)\"></div>\n </div>\n</div>\n\n<!-- Thumbs -->\n<mat-slider-visual-thumb\n *ngFor=\"let thumb of _inputs\"\n [discrete]=\"discrete\"\n [disableRipple]=\"_isRippleDisabled()\"\n [thumbPosition]=\"thumb._thumbPosition\"\n [valueIndicatorText]=\"_getValueIndicatorText(thumb._thumbPosition)\">\n</mat-slider-visual-thumb>\n", styles: [".mdc-slider{cursor:pointer;height:48px;margin:0 24px;position:relative;touch-action:pan-y}.mdc-slider .mdc-slider__track{position:absolute;top:50%;transform:translateY(-50%);width:100%}.mdc-slider .mdc-slider__track--active,.mdc-slider .mdc-slider__track--inactive{display:flex;height:100%;position:absolute;width:100%}.mdc-slider .mdc-slider__track--active{overflow:hidden;top:-1px}.mdc-slider .mdc-slider__track--active_fill{border-top:6px solid;box-sizing:border-box;height:100%;width:100%;position:relative;-webkit-transform-origin:left;transform-origin:left}[dir=rtl] .mdc-slider .mdc-slider__track--active_fill,.mdc-slider .mdc-slider__track--active_fill[dir=rtl]{-webkit-transform-origin:right;transform-origin:right}.mdc-slider .mdc-slider__track--inactive{left:0;top:0}.mdc-slider .mdc-slider__track--inactive::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}@media screen and (forced-colors: active){.mdc-slider .mdc-slider__track--inactive::before{border-color:CanvasText}}.mdc-slider .mdc-slider__value-indicator-container{bottom:44px;left:var(--slider-value-indicator-container-left, 50%);pointer-events:none;position:absolute;right:var(--slider-value-indicator-container-right);transform:var(--slider-value-indicator-container-transform, translateX(-50%))}.mdc-slider .mdc-slider__value-indicator{transition:transform 100ms 0ms cubic-bezier(0.4, 0, 1, 1);align-items:center;border-radius:4px;display:flex;height:32px;padding:0 12px;transform:scale(0);transform-origin:bottom}.mdc-slider .mdc-slider__value-indicator::before{border-left:6px solid rgba(0,0,0,0);border-right:6px solid rgba(0,0,0,0);border-top:6px solid;bottom:-5px;content:\"\";height:0;left:var(--slider-value-indicator-caret-left, 50%);position:absolute;right:var(--slider-value-indicator-caret-right);transform:var(--slider-value-indicator-caret-transform, translateX(-50%));width:0}.mdc-slider .mdc-slider__value-indicator::after{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}@media screen and (forced-colors: active){.mdc-slider .mdc-slider__value-indicator::after{border-color:CanvasText}}.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator-container{pointer-events:auto}.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:transform 100ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale(1)}@media(prefers-reduced-motion){.mdc-slider .mdc-slider__value-indicator,.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:none}}.mdc-slider .mdc-slider__thumb{display:flex;left:-24px;outline:none;position:absolute;user-select:none;height:48px;width:48px}.mdc-slider .mdc-slider__thumb--top{z-index:1}.mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-style:solid;border-width:1px;box-sizing:content-box}.mdc-slider .mdc-slider__thumb-knob{box-sizing:border-box;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%)}.mdc-slider .mdc-slider__tick-marks{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding:0 1px;position:absolute;width:100%}.mdc-slider--discrete .mdc-slider__thumb,.mdc-slider--discrete .mdc-slider__track--active_fill{transition:transform 80ms ease}@media(prefers-reduced-motion){.mdc-slider--discrete .mdc-slider__thumb,.mdc-slider--discrete .mdc-slider__track--active_fill{transition:none}}.mdc-slider--disabled{cursor:auto}.mdc-slider--disabled .mdc-slider__thumb{pointer-events:none}.mdc-slider__input{cursor:pointer;left:0;margin:0;height:100%;opacity:0;pointer-events:none;position:absolute;top:0;width:100%}.mat-mdc-slider{display:inline-block;box-sizing:border-box;outline:none;vertical-align:middle;margin-left:8px;margin-right:8px;width:auto;min-width:112px}.mat-mdc-slider .mdc-slider__thumb-knob{background-color:var(--mdc-slider-handle-color, var(--mdc-theme-primary, #6200ee));border-color:var(--mdc-slider-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb-knob{background-color:var(--mdc-slider-disabled-handle-color, var(--mdc-theme-on-surface, #000));border-color:var(--mdc-slider-disabled-handle-color, var(--mdc-theme-on-surface, #000))}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb::before,.mat-mdc-slider .mdc-slider__thumb::after{background-color:var(--mdc-slider-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb:hover::before,.mat-mdc-slider .mdc-slider__thumb.mdc-ripple-surface--hover::before{opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mat-mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded--background-focused::before,.mat-mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mat-mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mat-mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mat-mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mat-mdc-slider .mdc-slider__track--active_fill{border-color:var(--mdc-slider-active-track-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__track--active_fill{border-color:var(--mdc-slider-disabled-active-track-color, var(--mdc-theme-on-surface, #000))}.mat-mdc-slider .mdc-slider__track--inactive{background-color:var(--mdc-slider-inactive-track-color, var(--mdc-theme-primary, #6200ee));opacity:.24}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__track--inactive{background-color:var(--mdc-slider-disabled-inactive-track-color, var(--mdc-theme-on-surface, #000));opacity:.24}.mat-mdc-slider .mdc-slider__tick-mark--active{background-color:var(--mdc-slider-with-tick-marks-active-container-color, var(--mdc-theme-on-primary, #fff));opacity:var(--mdc-slider-with-tick-marks-active-container-opacity, 0.6)}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__tick-mark--active{background-color:var(--mdc-slider-with-tick-marks-active-container-color, var(--mdc-theme-on-primary, #fff));opacity:var(--mdc-slider-with-tick-marks-active-container-opacity, 0.6)}.mat-mdc-slider .mdc-slider__tick-mark--inactive{background-color:var(--mdc-slider-with-tick-marks-inactive-container-color, var(--mdc-theme-primary, #6200ee));opacity:var(--mdc-slider-with-tick-marks-inactive-container-opacity, 0.6)}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__tick-mark--inactive{background-color:var(--mdc-slider-with-tick-marks-disabled-container-color, var(--mdc-theme-on-surface, #000));opacity:var(--mdc-slider-with-tick-marks-inactive-container-opacity, 0.6)}.mat-mdc-slider .mdc-slider__value-indicator{background-color:var(--mdc-slider-label-container-color, #666666);opacity:1}.mat-mdc-slider .mdc-slider__value-indicator::before{border-top-color:var(--mdc-slider-label-container-color, #666666)}.mat-mdc-slider .mdc-slider__value-indicator{color:var(--mdc-slider-label-label-text-color, var(--mdc-theme-on-primary, #fff))}.mat-mdc-slider .mdc-slider__track{height:var(--mdc-slider-inactive-track-height, 4px)}.mat-mdc-slider .mdc-slider__track--active{height:var(--mdc-slider-active-track-height, 6px)}.mat-mdc-slider .mdc-slider__track--inactive{height:var(--mdc-slider-inactive-track-height, 4px)}.mat-mdc-slider .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-mark--inactive{height:var(--mdc-slider-with-tick-marks-container-size, 2px);width:var(--mdc-slider-with-tick-marks-container-size, 2px)}.mat-mdc-slider.mdc-slider--disabled{opacity:0.38}.mat-mdc-slider .mdc-slider__value-indicator-text{letter-spacing:var(--mdc-slider-label-label-text-tracking, 0.0071428571em);font-size:var(--mdc-slider-label-label-text-font-size, 0.875rem);font-family:var(--mdc-slider-label-label-text-font, Roboto, sans-serif);font-weight:var(--mdc-slider-label-label-text-weight, 500);line-height:var(--mdc-slider-label-label-text-line-height, 1.375rem)}.mat-mdc-slider .mdc-slider__track--active{border-radius:var(--mdc-slider-active-track-shape, 9999px)}.mat-mdc-slider .mdc-slider__track--inactive{border-radius:var(--mdc-slider-inactive-track-shape, 9999px)}.mat-mdc-slider .mdc-slider__thumb-knob{border-radius:var(--mdc-slider-handle-shape, 50%);width:var(--mdc-slider-handle-width, 20px);height:var(--mdc-slider-handle-height, 20px);border-style:solid;border-width:calc(var(--mdc-slider-handle-height, 20px) / 2) calc(var(--mdc-slider-handle-width, 20px) / 2)}.mat-mdc-slider .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-mark--inactive{border-radius:var(--mdc-slider-with-tick-marks-container-shape, 50%)}.mat-mdc-slider .mdc-slider__thumb-knob{--mdc-elevation-box-shadow-for-gss:0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-slider-handle-elevation, var(--mdc-elevation-box-shadow-for-gss))}.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb-knob{background-color:var(--mdc-slider-hover-handle-color, var(--mdc-theme-primary, #6200ee));border-color:var(--mdc-slider-hover-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb-knob{background-color:var(--mdc-slider-focus-handle-color, var(--mdc-theme-primary, #6200ee));border-color:var(--mdc-slider-focus-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb:not(:disabled):active .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:not(:disabled):active .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:not(:disabled):active .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:var(--mdc-slider-with-overlap-handle-outline-color, #fff);border-width:var(--mdc-slider-with-overlap-handle-outline-width, 1px)}.mat-mdc-slider .mdc-slider__value-indicator{opacity:var(--mat-mdc-slider-value-indicator-opacity, 1)}.mat-mdc-slider .mat-ripple .mat-ripple-element{background-color:var(--mat-mdc-slider-ripple-color, transparent)}.mat-mdc-slider .mat-ripple .mat-mdc-slider-hover-ripple{background-color:var(--mat-mdc-slider-hover-ripple-color, transparent)}.mat-mdc-slider .mat-ripple .mat-mdc-slider-focus-ripple,.mat-mdc-slider .mat-ripple .mat-mdc-slider-active-ripple{background-color:var(--mat-mdc-slider-focus-ripple-color, transparent)}.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__thumb,.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__track--active_fill,.mat-mdc-slider._mat-animation-noopable .mdc-slider__value-indicator{transition:none}.mat-mdc-slider .mat-mdc-focus-indicator::before{border-radius:50%}.mdc-slider__thumb--focused .mat-mdc-focus-indicator::before{content:\"\"}"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatSliderVisualThumb, selector: "mat-slider-visual-thumb", inputs: ["discrete", "thumbPosition", "valueIndicatorText", "disableRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
821
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
874
|
+
MatSlider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.1", ngImport: i0, type: MatSlider, deps: [{ token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i1.Platform }, { token: i0.ElementRef }, { token: i2$1.Directionality, optional: true }, { token: MAT_RIPPLE_GLOBAL_OPTIONS, optional: true }, { token: ANIMATION_MODULE_TYPE, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
875
|
+
MatSlider.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0-rc.1", type: MatSlider, selector: "mat-slider", inputs: { color: "color", disableRipple: "disableRipple", disabled: "disabled", discrete: "discrete", showTickMarks: "showTickMarks", min: "min", max: "max", step: "step", displayWith: "displayWith" }, host: { properties: { "class.mdc-slider--range": "_isRange", "class.mdc-slider--disabled": "disabled", "class.mdc-slider--discrete": "discrete", "class.mdc-slider--tick-marks": "showTickMarks", "class._mat-animation-noopable": "_noopAnimations" }, classAttribute: "mat-mdc-slider mdc-slider" }, providers: [{ provide: MAT_SLIDER, useExisting: MatSlider }], queries: [{ propertyName: "_input", first: true, predicate: MAT_SLIDER_THUMB, descendants: true }, { propertyName: "_inputs", predicate: MAT_SLIDER_RANGE_THUMB }], viewQueries: [{ propertyName: "_trackActive", first: true, predicate: ["trackActive"], descendants: true }, { propertyName: "_thumbs", predicate: MAT_SLIDER_VISUAL_THUMB, descendants: true }], exportAs: ["matSlider"], usesInheritance: true, ngImport: i0, template: "<!-- Inputs -->\n<ng-content></ng-content>\n\n<!-- Track -->\n<div class=\"mdc-slider__track\">\n <div class=\"mdc-slider__track--inactive\"></div>\n <div class=\"mdc-slider__track--active\">\n <div #trackActive class=\"mdc-slider__track--active_fill\"></div>\n </div>\n <div *ngIf=\"showTickMarks\" class=\"mdc-slider__tick-marks\" #tickMarkContainer>\n <ng-container *ngIf=\"_cachedWidth\">\n <div\n *ngFor=\"let tickMark of _tickMarks; let i = index\"\n [class]=\"tickMark === 0 ? 'mdc-slider__tick-mark--active' : 'mdc-slider__tick-mark--inactive'\"\n [style.transform]=\"_calcTickMarkTransform(i)\"></div>\n </ng-container>\n </div>\n</div>\n\n<!-- Thumbs -->\n<mat-slider-visual-thumb\n *ngIf=\"_isRange\"\n [discrete]=\"discrete\"\n [thumbPosition]=\"1\"\n [valueIndicatorText]=\"startValueIndicatorText\">\n</mat-slider-visual-thumb>\n\n<mat-slider-visual-thumb\n [discrete]=\"discrete\"\n [thumbPosition]=\"2\"\n [valueIndicatorText]=\"endValueIndicatorText\">\n</mat-slider-visual-thumb>\n", styles: [".mdc-slider{cursor:pointer;height:48px;margin:0 24px;position:relative;touch-action:pan-y}.mdc-slider .mdc-slider__track{position:absolute;top:50%;transform:translateY(-50%);width:100%}.mdc-slider .mdc-slider__track--active,.mdc-slider .mdc-slider__track--inactive{display:flex;height:100%;position:absolute;width:100%}.mdc-slider .mdc-slider__track--active{overflow:hidden;top:-1px}.mdc-slider .mdc-slider__track--active_fill{border-top:6px solid;box-sizing:border-box;height:100%;width:100%;position:relative;-webkit-transform-origin:left;transform-origin:left}[dir=rtl] .mdc-slider .mdc-slider__track--active_fill,.mdc-slider .mdc-slider__track--active_fill[dir=rtl]{-webkit-transform-origin:right;transform-origin:right}.mdc-slider .mdc-slider__track--inactive{left:0;top:0}.mdc-slider .mdc-slider__track--inactive::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}@media screen and (forced-colors: active){.mdc-slider .mdc-slider__track--inactive::before{border-color:CanvasText}}.mdc-slider .mdc-slider__value-indicator-container{bottom:44px;left:var(--slider-value-indicator-container-left, 50%);pointer-events:none;position:absolute;right:var(--slider-value-indicator-container-right);transform:var(--slider-value-indicator-container-transform, translateX(-50%))}.mdc-slider .mdc-slider__value-indicator{transition:transform 100ms 0ms cubic-bezier(0.4, 0, 1, 1);align-items:center;border-radius:4px;display:flex;height:32px;padding:0 12px;transform:scale(0);transform-origin:bottom}.mdc-slider .mdc-slider__value-indicator::before{border-left:6px solid rgba(0,0,0,0);border-right:6px solid rgba(0,0,0,0);border-top:6px solid;bottom:-5px;content:\"\";height:0;left:var(--slider-value-indicator-caret-left, 50%);position:absolute;right:var(--slider-value-indicator-caret-right);transform:var(--slider-value-indicator-caret-transform, translateX(-50%));width:0}.mdc-slider .mdc-slider__value-indicator::after{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}@media screen and (forced-colors: active){.mdc-slider .mdc-slider__value-indicator::after{border-color:CanvasText}}.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator-container{pointer-events:auto}.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:transform 100ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale(1)}@media(prefers-reduced-motion){.mdc-slider .mdc-slider__value-indicator,.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:none}}.mdc-slider .mdc-slider__thumb{display:flex;left:-24px;outline:none;position:absolute;user-select:none;height:48px;width:48px}.mdc-slider .mdc-slider__thumb--top{z-index:1}.mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-style:solid;border-width:1px;box-sizing:content-box}.mdc-slider .mdc-slider__thumb-knob{box-sizing:border-box;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%)}.mdc-slider .mdc-slider__tick-marks{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding:0 1px;position:absolute;width:100%}.mdc-slider--discrete .mdc-slider__thumb,.mdc-slider--discrete .mdc-slider__track--active_fill{transition:transform 80ms ease}@media(prefers-reduced-motion){.mdc-slider--discrete .mdc-slider__thumb,.mdc-slider--discrete .mdc-slider__track--active_fill{transition:none}}.mdc-slider--disabled{cursor:auto}.mdc-slider--disabled .mdc-slider__thumb{pointer-events:none}.mdc-slider__input{cursor:pointer;left:0;margin:0;height:100%;opacity:0;pointer-events:none;position:absolute;top:0;width:100%}.mat-mdc-slider{display:inline-block;box-sizing:border-box;outline:none;vertical-align:middle;margin-left:8px;margin-right:8px;width:auto;min-width:112px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-slider .mdc-slider__thumb-knob{background-color:var(--mdc-slider-handle-color, var(--mdc-theme-primary, #6200ee));border-color:var(--mdc-slider-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb-knob{background-color:var(--mdc-slider-disabled-handle-color, var(--mdc-theme-on-surface, #000));border-color:var(--mdc-slider-disabled-handle-color, var(--mdc-theme-on-surface, #000))}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb::before,.mat-mdc-slider .mdc-slider__thumb::after{background-color:var(--mdc-slider-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb:hover::before,.mat-mdc-slider .mdc-slider__thumb.mdc-ripple-surface--hover::before{opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mat-mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded--background-focused::before,.mat-mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mat-mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mat-mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mat-mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mat-mdc-slider .mdc-slider__track--active_fill{border-color:var(--mdc-slider-active-track-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__track--active_fill{border-color:var(--mdc-slider-disabled-active-track-color, var(--mdc-theme-on-surface, #000))}.mat-mdc-slider .mdc-slider__track--inactive{background-color:var(--mdc-slider-inactive-track-color, var(--mdc-theme-primary, #6200ee));opacity:.24}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__track--inactive{background-color:var(--mdc-slider-disabled-inactive-track-color, var(--mdc-theme-on-surface, #000));opacity:.24}.mat-mdc-slider .mdc-slider__tick-mark--active{background-color:var(--mdc-slider-with-tick-marks-active-container-color, var(--mdc-theme-on-primary, #fff));opacity:var(--mdc-slider-with-tick-marks-active-container-opacity, 0.6)}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__tick-mark--active{background-color:var(--mdc-slider-with-tick-marks-active-container-color, var(--mdc-theme-on-primary, #fff));opacity:var(--mdc-slider-with-tick-marks-active-container-opacity, 0.6)}.mat-mdc-slider .mdc-slider__tick-mark--inactive{background-color:var(--mdc-slider-with-tick-marks-inactive-container-color, var(--mdc-theme-primary, #6200ee));opacity:var(--mdc-slider-with-tick-marks-inactive-container-opacity, 0.6)}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__tick-mark--inactive{background-color:var(--mdc-slider-with-tick-marks-disabled-container-color, var(--mdc-theme-on-surface, #000));opacity:var(--mdc-slider-with-tick-marks-inactive-container-opacity, 0.6)}.mat-mdc-slider .mdc-slider__value-indicator{background-color:var(--mdc-slider-label-container-color, #666666);opacity:1}.mat-mdc-slider .mdc-slider__value-indicator::before{border-top-color:var(--mdc-slider-label-container-color, #666666)}.mat-mdc-slider .mdc-slider__value-indicator{color:var(--mdc-slider-label-label-text-color, var(--mdc-theme-on-primary, #fff))}.mat-mdc-slider .mdc-slider__track{height:var(--mdc-slider-inactive-track-height, 4px)}.mat-mdc-slider .mdc-slider__track--active{height:var(--mdc-slider-active-track-height, 6px)}.mat-mdc-slider .mdc-slider__track--inactive{height:var(--mdc-slider-inactive-track-height, 4px)}.mat-mdc-slider .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-mark--inactive{height:var(--mdc-slider-with-tick-marks-container-size, 2px);width:var(--mdc-slider-with-tick-marks-container-size, 2px)}.mat-mdc-slider.mdc-slider--disabled{opacity:0.38}.mat-mdc-slider .mdc-slider__value-indicator-text{letter-spacing:var(--mdc-slider-label-label-text-tracking, 0.0071428571em);font-size:var(--mdc-slider-label-label-text-font-size, 0.875rem);font-family:var(--mdc-slider-label-label-text-font, Roboto, sans-serif);font-weight:var(--mdc-slider-label-label-text-weight, 500);line-height:var(--mdc-slider-label-label-text-line-height, 1.375rem)}.mat-mdc-slider .mdc-slider__track--active{border-radius:var(--mdc-slider-active-track-shape, 9999px)}.mat-mdc-slider .mdc-slider__track--inactive{border-radius:var(--mdc-slider-inactive-track-shape, 9999px)}.mat-mdc-slider .mdc-slider__thumb-knob{border-radius:var(--mdc-slider-handle-shape, 50%);width:var(--mdc-slider-handle-width, 20px);height:var(--mdc-slider-handle-height, 20px);border-style:solid;border-width:calc(var(--mdc-slider-handle-height, 20px) / 2) calc(var(--mdc-slider-handle-width, 20px) / 2)}.mat-mdc-slider .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-mark--inactive{border-radius:var(--mdc-slider-with-tick-marks-container-shape, 50%)}.mat-mdc-slider .mdc-slider__thumb-knob{box-shadow:var(--mdc-slider-handle-elevation, 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb-knob{background-color:var(--mdc-slider-hover-handle-color, var(--mdc-theme-primary, #6200ee));border-color:var(--mdc-slider-hover-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb-knob{background-color:var(--mdc-slider-focus-handle-color, var(--mdc-theme-primary, #6200ee));border-color:var(--mdc-slider-focus-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb:not(:disabled):active .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:not(:disabled):active .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:not(:disabled):active .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:var(--mdc-slider-with-overlap-handle-outline-color, #fff);border-width:var(--mdc-slider-with-overlap-handle-outline-width, 1px)}.mat-mdc-slider .mdc-slider__input{pointer-events:auto}.mat-mdc-slider .mdc-slider__input.mat-mdc-slider-input-no-pointer-events{pointer-events:none}.mat-mdc-slider .mdc-slider__input.mat-slider__right-input{left:auto;right:0}.mat-mdc-slider .mdc-slider__thumb,.mat-mdc-slider .mdc-slider__track--active_fill{transition-duration:0ms}.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__thumb,.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__track--active_fill{transition-duration:80ms}.mat-mdc-slider.mdc-slider--discrete .mdc-slider__thumb,.mat-mdc-slider.mdc-slider--discrete .mdc-slider__track--active_fill{transition-duration:0ms}.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__thumb,.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__track--active_fill{transition-duration:80ms}.mat-mdc-slider .mdc-slider__track,.mat-mdc-slider .mdc-slider__thumb{pointer-events:none}.mat-mdc-slider .mdc-slider__value-indicator{opacity:var(--mat-mdc-slider-value-indicator-opacity, 1)}.mat-mdc-slider .mat-ripple .mat-ripple-element{background-color:var(--mat-mdc-slider-ripple-color, transparent)}.mat-mdc-slider .mat-ripple .mat-mdc-slider-hover-ripple{background-color:var(--mat-mdc-slider-hover-ripple-color, transparent)}.mat-mdc-slider .mat-ripple .mat-mdc-slider-focus-ripple,.mat-mdc-slider .mat-ripple .mat-mdc-slider-active-ripple{background-color:var(--mat-mdc-slider-focus-ripple-color, transparent)}.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__thumb,.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__track--active_fill,.mat-mdc-slider._mat-animation-noopable .mdc-slider__value-indicator{transition:none}.mat-mdc-slider .mat-mdc-focus-indicator::before{border-radius:50%}.mdc-slider__thumb--focused .mat-mdc-focus-indicator::before{content:\"\"}"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatSliderVisualThumb, selector: "mat-slider-visual-thumb", inputs: ["discrete", "thumbPosition", "valueIndicatorText"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
876
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.1", ngImport: i0, type: MatSlider, decorators: [{
|
|
822
877
|
type: Component,
|
|
823
878
|
args: [{ selector: 'mat-slider', host: {
|
|
824
879
|
'class': 'mat-mdc-slider mdc-slider',
|
|
825
|
-
'[class.mdc-slider--range]': '_isRange
|
|
880
|
+
'[class.mdc-slider--range]': '_isRange',
|
|
826
881
|
'[class.mdc-slider--disabled]': 'disabled',
|
|
827
882
|
'[class.mdc-slider--discrete]': 'discrete',
|
|
828
883
|
'[class.mdc-slider--tick-marks]': 'showTickMarks',
|
|
829
884
|
'[class._mat-animation-noopable]': '_noopAnimations',
|
|
830
|
-
}, exportAs: 'matSlider', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, inputs: ['color', 'disableRipple'], template: "<!-- Inputs -->\n<ng-content></ng-content>\n\n<!-- Track -->\n<div class=\"mdc-slider__track\">\n <div class=\"mdc-slider__track--inactive\"></div>\n <div class=\"mdc-slider__track--active\">\n <div class=\"mdc-slider__track--active_fill\" #trackActive></div>\n </div>\n <div *ngIf=\"showTickMarks\" class=\"mdc-slider__tick-marks\" #tickMarkContainer>\n <div *ngFor=\"let tickMark of _tickMarks\" [class]=\"_getTickMarkClass(tickMark)\"></div>\n </div>\n</div>\n\n<!-- Thumbs -->\n<mat-slider-visual-thumb\n *ngFor=\"let thumb of _inputs\"\n [discrete]=\"discrete\"\n [disableRipple]=\"_isRippleDisabled()\"\n [thumbPosition]=\"thumb._thumbPosition\"\n [valueIndicatorText]=\"_getValueIndicatorText(thumb._thumbPosition)\">\n</mat-slider-visual-thumb>\n", styles: [".mdc-slider{cursor:pointer;height:48px;margin:0 24px;position:relative;touch-action:pan-y}.mdc-slider .mdc-slider__track{position:absolute;top:50%;transform:translateY(-50%);width:100%}.mdc-slider .mdc-slider__track--active,.mdc-slider .mdc-slider__track--inactive{display:flex;height:100%;position:absolute;width:100%}.mdc-slider .mdc-slider__track--active{overflow:hidden;top:-1px}.mdc-slider .mdc-slider__track--active_fill{border-top:6px solid;box-sizing:border-box;height:100%;width:100%;position:relative;-webkit-transform-origin:left;transform-origin:left}[dir=rtl] .mdc-slider .mdc-slider__track--active_fill,.mdc-slider .mdc-slider__track--active_fill[dir=rtl]{-webkit-transform-origin:right;transform-origin:right}.mdc-slider .mdc-slider__track--inactive{left:0;top:0}.mdc-slider .mdc-slider__track--inactive::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}@media screen and (forced-colors: active){.mdc-slider .mdc-slider__track--inactive::before{border-color:CanvasText}}.mdc-slider .mdc-slider__value-indicator-container{bottom:44px;left:var(--slider-value-indicator-container-left, 50%);pointer-events:none;position:absolute;right:var(--slider-value-indicator-container-right);transform:var(--slider-value-indicator-container-transform, translateX(-50%))}.mdc-slider .mdc-slider__value-indicator{transition:transform 100ms 0ms cubic-bezier(0.4, 0, 1, 1);align-items:center;border-radius:4px;display:flex;height:32px;padding:0 12px;transform:scale(0);transform-origin:bottom}.mdc-slider .mdc-slider__value-indicator::before{border-left:6px solid rgba(0,0,0,0);border-right:6px solid rgba(0,0,0,0);border-top:6px solid;bottom:-5px;content:\"\";height:0;left:var(--slider-value-indicator-caret-left, 50%);position:absolute;right:var(--slider-value-indicator-caret-right);transform:var(--slider-value-indicator-caret-transform, translateX(-50%));width:0}.mdc-slider .mdc-slider__value-indicator::after{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}@media screen and (forced-colors: active){.mdc-slider .mdc-slider__value-indicator::after{border-color:CanvasText}}.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator-container{pointer-events:auto}.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:transform 100ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale(1)}@media(prefers-reduced-motion){.mdc-slider .mdc-slider__value-indicator,.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:none}}.mdc-slider .mdc-slider__thumb{display:flex;left:-24px;outline:none;position:absolute;user-select:none;height:48px;width:48px}.mdc-slider .mdc-slider__thumb--top{z-index:1}.mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-style:solid;border-width:1px;box-sizing:content-box}.mdc-slider .mdc-slider__thumb-knob{box-sizing:border-box;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%)}.mdc-slider .mdc-slider__tick-marks{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding:0 1px;position:absolute;width:100%}.mdc-slider--discrete .mdc-slider__thumb,.mdc-slider--discrete .mdc-slider__track--active_fill{transition:transform 80ms ease}@media(prefers-reduced-motion){.mdc-slider--discrete .mdc-slider__thumb,.mdc-slider--discrete .mdc-slider__track--active_fill{transition:none}}.mdc-slider--disabled{cursor:auto}.mdc-slider--disabled .mdc-slider__thumb{pointer-events:none}.mdc-slider__input{cursor:pointer;left:0;margin:0;height:100%;opacity:0;pointer-events:none;position:absolute;top:0;width:100%}.mat-mdc-slider{display:inline-block;box-sizing:border-box;outline:none;vertical-align:middle;margin-left:8px;margin-right:8px;width:auto;min-width:112px}.mat-mdc-slider .mdc-slider__thumb-knob{background-color:var(--mdc-slider-handle-color, var(--mdc-theme-primary, #6200ee));border-color:var(--mdc-slider-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb-knob{background-color:var(--mdc-slider-disabled-handle-color, var(--mdc-theme-on-surface, #000));border-color:var(--mdc-slider-disabled-handle-color, var(--mdc-theme-on-surface, #000))}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb::before,.mat-mdc-slider .mdc-slider__thumb::after{background-color:var(--mdc-slider-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb:hover::before,.mat-mdc-slider .mdc-slider__thumb.mdc-ripple-surface--hover::before{opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mat-mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded--background-focused::before,.mat-mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mat-mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mat-mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mat-mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mat-mdc-slider .mdc-slider__track--active_fill{border-color:var(--mdc-slider-active-track-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__track--active_fill{border-color:var(--mdc-slider-disabled-active-track-color, var(--mdc-theme-on-surface, #000))}.mat-mdc-slider .mdc-slider__track--inactive{background-color:var(--mdc-slider-inactive-track-color, var(--mdc-theme-primary, #6200ee));opacity:.24}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__track--inactive{background-color:var(--mdc-slider-disabled-inactive-track-color, var(--mdc-theme-on-surface, #000));opacity:.24}.mat-mdc-slider .mdc-slider__tick-mark--active{background-color:var(--mdc-slider-with-tick-marks-active-container-color, var(--mdc-theme-on-primary, #fff));opacity:var(--mdc-slider-with-tick-marks-active-container-opacity, 0.6)}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__tick-mark--active{background-color:var(--mdc-slider-with-tick-marks-active-container-color, var(--mdc-theme-on-primary, #fff));opacity:var(--mdc-slider-with-tick-marks-active-container-opacity, 0.6)}.mat-mdc-slider .mdc-slider__tick-mark--inactive{background-color:var(--mdc-slider-with-tick-marks-inactive-container-color, var(--mdc-theme-primary, #6200ee));opacity:var(--mdc-slider-with-tick-marks-inactive-container-opacity, 0.6)}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__tick-mark--inactive{background-color:var(--mdc-slider-with-tick-marks-disabled-container-color, var(--mdc-theme-on-surface, #000));opacity:var(--mdc-slider-with-tick-marks-inactive-container-opacity, 0.6)}.mat-mdc-slider .mdc-slider__value-indicator{background-color:var(--mdc-slider-label-container-color, #666666);opacity:1}.mat-mdc-slider .mdc-slider__value-indicator::before{border-top-color:var(--mdc-slider-label-container-color, #666666)}.mat-mdc-slider .mdc-slider__value-indicator{color:var(--mdc-slider-label-label-text-color, var(--mdc-theme-on-primary, #fff))}.mat-mdc-slider .mdc-slider__track{height:var(--mdc-slider-inactive-track-height, 4px)}.mat-mdc-slider .mdc-slider__track--active{height:var(--mdc-slider-active-track-height, 6px)}.mat-mdc-slider .mdc-slider__track--inactive{height:var(--mdc-slider-inactive-track-height, 4px)}.mat-mdc-slider .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-mark--inactive{height:var(--mdc-slider-with-tick-marks-container-size, 2px);width:var(--mdc-slider-with-tick-marks-container-size, 2px)}.mat-mdc-slider.mdc-slider--disabled{opacity:0.38}.mat-mdc-slider .mdc-slider__value-indicator-text{letter-spacing:var(--mdc-slider-label-label-text-tracking, 0.0071428571em);font-size:var(--mdc-slider-label-label-text-font-size, 0.875rem);font-family:var(--mdc-slider-label-label-text-font, Roboto, sans-serif);font-weight:var(--mdc-slider-label-label-text-weight, 500);line-height:var(--mdc-slider-label-label-text-line-height, 1.375rem)}.mat-mdc-slider .mdc-slider__track--active{border-radius:var(--mdc-slider-active-track-shape, 9999px)}.mat-mdc-slider .mdc-slider__track--inactive{border-radius:var(--mdc-slider-inactive-track-shape, 9999px)}.mat-mdc-slider .mdc-slider__thumb-knob{border-radius:var(--mdc-slider-handle-shape, 50%);width:var(--mdc-slider-handle-width, 20px);height:var(--mdc-slider-handle-height, 20px);border-style:solid;border-width:calc(var(--mdc-slider-handle-height, 20px) / 2) calc(var(--mdc-slider-handle-width, 20px) / 2)}.mat-mdc-slider .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-mark--inactive{border-radius:var(--mdc-slider-with-tick-marks-container-shape, 50%)}.mat-mdc-slider .mdc-slider__thumb-knob{--mdc-elevation-box-shadow-for-gss:0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-slider-handle-elevation, var(--mdc-elevation-box-shadow-for-gss))}.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb-knob{background-color:var(--mdc-slider-hover-handle-color, var(--mdc-theme-primary, #6200ee));border-color:var(--mdc-slider-hover-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb-knob{background-color:var(--mdc-slider-focus-handle-color, var(--mdc-theme-primary, #6200ee));border-color:var(--mdc-slider-focus-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb:not(:disabled):active .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:not(:disabled):active .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:not(:disabled):active .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:var(--mdc-slider-with-overlap-handle-outline-color, #fff);border-width:var(--mdc-slider-with-overlap-handle-outline-width, 1px)}.mat-mdc-slider .mdc-slider__value-indicator{opacity:var(--mat-mdc-slider-value-indicator-opacity, 1)}.mat-mdc-slider .mat-ripple .mat-ripple-element{background-color:var(--mat-mdc-slider-ripple-color, transparent)}.mat-mdc-slider .mat-ripple .mat-mdc-slider-hover-ripple{background-color:var(--mat-mdc-slider-hover-ripple-color, transparent)}.mat-mdc-slider .mat-ripple .mat-mdc-slider-focus-ripple,.mat-mdc-slider .mat-ripple .mat-mdc-slider-active-ripple{background-color:var(--mat-mdc-slider-focus-ripple-color, transparent)}.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__thumb,.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__track--active_fill,.mat-mdc-slider._mat-animation-noopable .mdc-slider__value-indicator{transition:none}.mat-mdc-slider .mat-mdc-focus-indicator::before{border-radius:50%}.mdc-slider__thumb--focused .mat-mdc-focus-indicator::before{content:\"\"}"] }]
|
|
831
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type:
|
|
832
|
-
type: Inject,
|
|
833
|
-
args: [DOCUMENT]
|
|
834
|
-
}] }, { type: i5.Directionality, decorators: [{
|
|
885
|
+
}, exportAs: 'matSlider', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, inputs: ['color', 'disableRipple'], providers: [{ provide: MAT_SLIDER, useExisting: MatSlider }], template: "<!-- Inputs -->\n<ng-content></ng-content>\n\n<!-- Track -->\n<div class=\"mdc-slider__track\">\n <div class=\"mdc-slider__track--inactive\"></div>\n <div class=\"mdc-slider__track--active\">\n <div #trackActive class=\"mdc-slider__track--active_fill\"></div>\n </div>\n <div *ngIf=\"showTickMarks\" class=\"mdc-slider__tick-marks\" #tickMarkContainer>\n <ng-container *ngIf=\"_cachedWidth\">\n <div\n *ngFor=\"let tickMark of _tickMarks; let i = index\"\n [class]=\"tickMark === 0 ? 'mdc-slider__tick-mark--active' : 'mdc-slider__tick-mark--inactive'\"\n [style.transform]=\"_calcTickMarkTransform(i)\"></div>\n </ng-container>\n </div>\n</div>\n\n<!-- Thumbs -->\n<mat-slider-visual-thumb\n *ngIf=\"_isRange\"\n [discrete]=\"discrete\"\n [thumbPosition]=\"1\"\n [valueIndicatorText]=\"startValueIndicatorText\">\n</mat-slider-visual-thumb>\n\n<mat-slider-visual-thumb\n [discrete]=\"discrete\"\n [thumbPosition]=\"2\"\n [valueIndicatorText]=\"endValueIndicatorText\">\n</mat-slider-visual-thumb>\n", styles: [".mdc-slider{cursor:pointer;height:48px;margin:0 24px;position:relative;touch-action:pan-y}.mdc-slider .mdc-slider__track{position:absolute;top:50%;transform:translateY(-50%);width:100%}.mdc-slider .mdc-slider__track--active,.mdc-slider .mdc-slider__track--inactive{display:flex;height:100%;position:absolute;width:100%}.mdc-slider .mdc-slider__track--active{overflow:hidden;top:-1px}.mdc-slider .mdc-slider__track--active_fill{border-top:6px solid;box-sizing:border-box;height:100%;width:100%;position:relative;-webkit-transform-origin:left;transform-origin:left}[dir=rtl] .mdc-slider .mdc-slider__track--active_fill,.mdc-slider .mdc-slider__track--active_fill[dir=rtl]{-webkit-transform-origin:right;transform-origin:right}.mdc-slider .mdc-slider__track--inactive{left:0;top:0}.mdc-slider .mdc-slider__track--inactive::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}@media screen and (forced-colors: active){.mdc-slider .mdc-slider__track--inactive::before{border-color:CanvasText}}.mdc-slider .mdc-slider__value-indicator-container{bottom:44px;left:var(--slider-value-indicator-container-left, 50%);pointer-events:none;position:absolute;right:var(--slider-value-indicator-container-right);transform:var(--slider-value-indicator-container-transform, translateX(-50%))}.mdc-slider .mdc-slider__value-indicator{transition:transform 100ms 0ms cubic-bezier(0.4, 0, 1, 1);align-items:center;border-radius:4px;display:flex;height:32px;padding:0 12px;transform:scale(0);transform-origin:bottom}.mdc-slider .mdc-slider__value-indicator::before{border-left:6px solid rgba(0,0,0,0);border-right:6px solid rgba(0,0,0,0);border-top:6px solid;bottom:-5px;content:\"\";height:0;left:var(--slider-value-indicator-caret-left, 50%);position:absolute;right:var(--slider-value-indicator-caret-right);transform:var(--slider-value-indicator-caret-transform, translateX(-50%));width:0}.mdc-slider .mdc-slider__value-indicator::after{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}@media screen and (forced-colors: active){.mdc-slider .mdc-slider__value-indicator::after{border-color:CanvasText}}.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator-container{pointer-events:auto}.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:transform 100ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale(1)}@media(prefers-reduced-motion){.mdc-slider .mdc-slider__value-indicator,.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:none}}.mdc-slider .mdc-slider__thumb{display:flex;left:-24px;outline:none;position:absolute;user-select:none;height:48px;width:48px}.mdc-slider .mdc-slider__thumb--top{z-index:1}.mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-style:solid;border-width:1px;box-sizing:content-box}.mdc-slider .mdc-slider__thumb-knob{box-sizing:border-box;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%)}.mdc-slider .mdc-slider__tick-marks{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding:0 1px;position:absolute;width:100%}.mdc-slider--discrete .mdc-slider__thumb,.mdc-slider--discrete .mdc-slider__track--active_fill{transition:transform 80ms ease}@media(prefers-reduced-motion){.mdc-slider--discrete .mdc-slider__thumb,.mdc-slider--discrete .mdc-slider__track--active_fill{transition:none}}.mdc-slider--disabled{cursor:auto}.mdc-slider--disabled .mdc-slider__thumb{pointer-events:none}.mdc-slider__input{cursor:pointer;left:0;margin:0;height:100%;opacity:0;pointer-events:none;position:absolute;top:0;width:100%}.mat-mdc-slider{display:inline-block;box-sizing:border-box;outline:none;vertical-align:middle;margin-left:8px;margin-right:8px;width:auto;min-width:112px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-slider .mdc-slider__thumb-knob{background-color:var(--mdc-slider-handle-color, var(--mdc-theme-primary, #6200ee));border-color:var(--mdc-slider-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb-knob{background-color:var(--mdc-slider-disabled-handle-color, var(--mdc-theme-on-surface, #000));border-color:var(--mdc-slider-disabled-handle-color, var(--mdc-theme-on-surface, #000))}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb::before,.mat-mdc-slider .mdc-slider__thumb::after{background-color:var(--mdc-slider-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb:hover::before,.mat-mdc-slider .mdc-slider__thumb.mdc-ripple-surface--hover::before{opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mat-mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded--background-focused::before,.mat-mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mat-mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mat-mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mat-mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mat-mdc-slider .mdc-slider__track--active_fill{border-color:var(--mdc-slider-active-track-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__track--active_fill{border-color:var(--mdc-slider-disabled-active-track-color, var(--mdc-theme-on-surface, #000))}.mat-mdc-slider .mdc-slider__track--inactive{background-color:var(--mdc-slider-inactive-track-color, var(--mdc-theme-primary, #6200ee));opacity:.24}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__track--inactive{background-color:var(--mdc-slider-disabled-inactive-track-color, var(--mdc-theme-on-surface, #000));opacity:.24}.mat-mdc-slider .mdc-slider__tick-mark--active{background-color:var(--mdc-slider-with-tick-marks-active-container-color, var(--mdc-theme-on-primary, #fff));opacity:var(--mdc-slider-with-tick-marks-active-container-opacity, 0.6)}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__tick-mark--active{background-color:var(--mdc-slider-with-tick-marks-active-container-color, var(--mdc-theme-on-primary, #fff));opacity:var(--mdc-slider-with-tick-marks-active-container-opacity, 0.6)}.mat-mdc-slider .mdc-slider__tick-mark--inactive{background-color:var(--mdc-slider-with-tick-marks-inactive-container-color, var(--mdc-theme-primary, #6200ee));opacity:var(--mdc-slider-with-tick-marks-inactive-container-opacity, 0.6)}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__tick-mark--inactive{background-color:var(--mdc-slider-with-tick-marks-disabled-container-color, var(--mdc-theme-on-surface, #000));opacity:var(--mdc-slider-with-tick-marks-inactive-container-opacity, 0.6)}.mat-mdc-slider .mdc-slider__value-indicator{background-color:var(--mdc-slider-label-container-color, #666666);opacity:1}.mat-mdc-slider .mdc-slider__value-indicator::before{border-top-color:var(--mdc-slider-label-container-color, #666666)}.mat-mdc-slider .mdc-slider__value-indicator{color:var(--mdc-slider-label-label-text-color, var(--mdc-theme-on-primary, #fff))}.mat-mdc-slider .mdc-slider__track{height:var(--mdc-slider-inactive-track-height, 4px)}.mat-mdc-slider .mdc-slider__track--active{height:var(--mdc-slider-active-track-height, 6px)}.mat-mdc-slider .mdc-slider__track--inactive{height:var(--mdc-slider-inactive-track-height, 4px)}.mat-mdc-slider .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-mark--inactive{height:var(--mdc-slider-with-tick-marks-container-size, 2px);width:var(--mdc-slider-with-tick-marks-container-size, 2px)}.mat-mdc-slider.mdc-slider--disabled{opacity:0.38}.mat-mdc-slider .mdc-slider__value-indicator-text{letter-spacing:var(--mdc-slider-label-label-text-tracking, 0.0071428571em);font-size:var(--mdc-slider-label-label-text-font-size, 0.875rem);font-family:var(--mdc-slider-label-label-text-font, Roboto, sans-serif);font-weight:var(--mdc-slider-label-label-text-weight, 500);line-height:var(--mdc-slider-label-label-text-line-height, 1.375rem)}.mat-mdc-slider .mdc-slider__track--active{border-radius:var(--mdc-slider-active-track-shape, 9999px)}.mat-mdc-slider .mdc-slider__track--inactive{border-radius:var(--mdc-slider-inactive-track-shape, 9999px)}.mat-mdc-slider .mdc-slider__thumb-knob{border-radius:var(--mdc-slider-handle-shape, 50%);width:var(--mdc-slider-handle-width, 20px);height:var(--mdc-slider-handle-height, 20px);border-style:solid;border-width:calc(var(--mdc-slider-handle-height, 20px) / 2) calc(var(--mdc-slider-handle-width, 20px) / 2)}.mat-mdc-slider .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-mark--inactive{border-radius:var(--mdc-slider-with-tick-marks-container-shape, 50%)}.mat-mdc-slider .mdc-slider__thumb-knob{box-shadow:var(--mdc-slider-handle-elevation, 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb-knob{background-color:var(--mdc-slider-hover-handle-color, var(--mdc-theme-primary, #6200ee));border-color:var(--mdc-slider-hover-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:hover .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb-knob{background-color:var(--mdc-slider-focus-handle-color, var(--mdc-theme-primary, #6200ee));border-color:var(--mdc-slider-focus-handle-color, var(--mdc-theme-primary, #6200ee))}.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--focused .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb:not(:disabled):active .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:not(:disabled):active .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb:not(:disabled):active .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mat-mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mat-mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:var(--mdc-slider-with-overlap-handle-outline-color, #fff);border-width:var(--mdc-slider-with-overlap-handle-outline-width, 1px)}.mat-mdc-slider .mdc-slider__input{pointer-events:auto}.mat-mdc-slider .mdc-slider__input.mat-mdc-slider-input-no-pointer-events{pointer-events:none}.mat-mdc-slider .mdc-slider__input.mat-slider__right-input{left:auto;right:0}.mat-mdc-slider .mdc-slider__thumb,.mat-mdc-slider .mdc-slider__track--active_fill{transition-duration:0ms}.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__thumb,.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__track--active_fill{transition-duration:80ms}.mat-mdc-slider.mdc-slider--discrete .mdc-slider__thumb,.mat-mdc-slider.mdc-slider--discrete .mdc-slider__track--active_fill{transition-duration:0ms}.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__thumb,.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__track--active_fill{transition-duration:80ms}.mat-mdc-slider .mdc-slider__track,.mat-mdc-slider .mdc-slider__thumb{pointer-events:none}.mat-mdc-slider .mdc-slider__value-indicator{opacity:var(--mat-mdc-slider-value-indicator-opacity, 1)}.mat-mdc-slider .mat-ripple .mat-ripple-element{background-color:var(--mat-mdc-slider-ripple-color, transparent)}.mat-mdc-slider .mat-ripple .mat-mdc-slider-hover-ripple{background-color:var(--mat-mdc-slider-hover-ripple-color, transparent)}.mat-mdc-slider .mat-ripple .mat-mdc-slider-focus-ripple,.mat-mdc-slider .mat-ripple .mat-mdc-slider-active-ripple{background-color:var(--mat-mdc-slider-focus-ripple-color, transparent)}.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__thumb,.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__track--active_fill,.mat-mdc-slider._mat-animation-noopable .mdc-slider__value-indicator{transition:none}.mat-mdc-slider .mat-mdc-focus-indicator::before{border-radius:50%}.mdc-slider__thumb--focused .mat-mdc-focus-indicator::before{content:\"\"}"] }]
|
|
886
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i1.Platform }, { type: i0.ElementRef }, { type: i2$1.Directionality, decorators: [{
|
|
835
887
|
type: Optional
|
|
836
888
|
}] }, { type: undefined, decorators: [{
|
|
837
889
|
type: Optional
|
|
@@ -843,15 +895,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.0", ng
|
|
|
843
895
|
}, {
|
|
844
896
|
type: Inject,
|
|
845
897
|
args: [ANIMATION_MODULE_TYPE]
|
|
846
|
-
}] }]; }, propDecorators: {
|
|
847
|
-
type: ViewChildren,
|
|
848
|
-
args: [MatSliderVisualThumb]
|
|
849
|
-
}], _trackActive: [{
|
|
898
|
+
}] }]; }, propDecorators: { _trackActive: [{
|
|
850
899
|
type: ViewChild,
|
|
851
900
|
args: ['trackActive']
|
|
901
|
+
}], _thumbs: [{
|
|
902
|
+
type: ViewChildren,
|
|
903
|
+
args: [MAT_SLIDER_VISUAL_THUMB]
|
|
904
|
+
}], _input: [{
|
|
905
|
+
type: ContentChild,
|
|
906
|
+
args: [MAT_SLIDER_THUMB]
|
|
852
907
|
}], _inputs: [{
|
|
853
908
|
type: ContentChildren,
|
|
854
|
-
args: [
|
|
909
|
+
args: [MAT_SLIDER_RANGE_THUMB, { descendants: false }]
|
|
855
910
|
}], disabled: [{
|
|
856
911
|
type: Input
|
|
857
912
|
}], discrete: [{
|
|
@@ -867,284 +922,636 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.0", ng
|
|
|
867
922
|
}], displayWith: [{
|
|
868
923
|
type: Input
|
|
869
924
|
}] } });
|
|
870
|
-
/**
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
// We manually assign functions instead of using prototype methods because
|
|
877
|
-
// MDC clobbers the values otherwise.
|
|
878
|
-
// See https://github.com/material-components/material-components-web/pull/6256
|
|
879
|
-
this.hasClass = (className) => {
|
|
880
|
-
return this._delegate._elementRef.nativeElement.classList.contains(className);
|
|
881
|
-
};
|
|
882
|
-
this.addClass = (className) => {
|
|
883
|
-
this._delegate._elementRef.nativeElement.classList.add(className);
|
|
884
|
-
};
|
|
885
|
-
this.removeClass = (className) => {
|
|
886
|
-
this._delegate._elementRef.nativeElement.classList.remove(className);
|
|
887
|
-
};
|
|
888
|
-
this.getAttribute = (attribute) => {
|
|
889
|
-
return this._delegate._elementRef.nativeElement.getAttribute(attribute);
|
|
890
|
-
};
|
|
891
|
-
this.addThumbClass = (className, thumbPosition) => {
|
|
892
|
-
this._delegate._getThumbElement(thumbPosition).classList.add(className);
|
|
893
|
-
};
|
|
894
|
-
this.removeThumbClass = (className, thumbPosition) => {
|
|
895
|
-
this._delegate._getThumbElement(thumbPosition).classList.remove(className);
|
|
896
|
-
};
|
|
897
|
-
this.getInputValue = (thumbPosition) => {
|
|
898
|
-
return this._delegate._getInputElement(thumbPosition).value;
|
|
899
|
-
};
|
|
900
|
-
this.setInputValue = (value, thumbPosition) => {
|
|
901
|
-
this._delegate._getInputElement(thumbPosition).value = value;
|
|
902
|
-
};
|
|
903
|
-
this.getInputAttribute = (attribute, thumbPosition) => {
|
|
904
|
-
return this._delegate._getInputElement(thumbPosition).getAttribute(attribute);
|
|
905
|
-
};
|
|
906
|
-
this.setInputAttribute = (attribute, value, thumbPosition) => {
|
|
907
|
-
const input = this._delegate._getInputElement(thumbPosition);
|
|
908
|
-
// TODO(wagnermaciel): remove this check once this component is
|
|
909
|
-
// added to the internal allowlist for calling setAttribute.
|
|
910
|
-
// Explicitly check the attribute we are setting to prevent xss.
|
|
911
|
-
switch (attribute) {
|
|
912
|
-
case 'aria-valuetext':
|
|
913
|
-
input.setAttribute('aria-valuetext', value);
|
|
914
|
-
break;
|
|
915
|
-
case 'disabled':
|
|
916
|
-
input.setAttribute('disabled', value);
|
|
917
|
-
break;
|
|
918
|
-
case 'min':
|
|
919
|
-
input.setAttribute('min', value);
|
|
920
|
-
break;
|
|
921
|
-
case 'max':
|
|
922
|
-
input.setAttribute('max', value);
|
|
923
|
-
break;
|
|
924
|
-
case 'value':
|
|
925
|
-
input.setAttribute('value', value);
|
|
926
|
-
break;
|
|
927
|
-
case 'step':
|
|
928
|
-
input.setAttribute('step', value);
|
|
929
|
-
break;
|
|
930
|
-
default:
|
|
931
|
-
throw Error(`Tried to set invalid attribute ${attribute} on the mdc-slider.`);
|
|
932
|
-
}
|
|
933
|
-
};
|
|
934
|
-
this.removeInputAttribute = (attribute, thumbPosition) => {
|
|
935
|
-
this._delegate._getInputElement(thumbPosition).removeAttribute(attribute);
|
|
936
|
-
};
|
|
937
|
-
this.focusInput = (thumbPosition) => {
|
|
938
|
-
this._delegate._getInputElement(thumbPosition).focus();
|
|
939
|
-
};
|
|
940
|
-
this.isInputFocused = (thumbPosition) => {
|
|
941
|
-
return this._delegate._getInput(thumbPosition)._isFocused();
|
|
942
|
-
};
|
|
943
|
-
this.getThumbKnobWidth = (thumbPosition) => {
|
|
944
|
-
return this._delegate._getKnobElement(thumbPosition).getBoundingClientRect().width;
|
|
945
|
-
};
|
|
946
|
-
this.getThumbBoundingClientRect = (thumbPosition) => {
|
|
947
|
-
return this._delegate._getThumbElement(thumbPosition).getBoundingClientRect();
|
|
948
|
-
};
|
|
949
|
-
this.getBoundingClientRect = () => {
|
|
950
|
-
return this._delegate._getHostDimensions();
|
|
951
|
-
};
|
|
952
|
-
this.getValueIndicatorContainerWidth = (thumbPosition) => {
|
|
953
|
-
return this._delegate._getValueIndicatorContainerElement(thumbPosition).getBoundingClientRect()
|
|
954
|
-
.width;
|
|
955
|
-
};
|
|
956
|
-
this.isRTL = () => {
|
|
957
|
-
return this._delegate._isRTL();
|
|
958
|
-
};
|
|
959
|
-
this.setThumbStyleProperty = (propertyName, value, thumbPosition) => {
|
|
960
|
-
this._delegate._getThumbElement(thumbPosition).style.setProperty(propertyName, value);
|
|
961
|
-
};
|
|
962
|
-
this.removeThumbStyleProperty = (propertyName, thumbPosition) => {
|
|
963
|
-
this._delegate._getThumbElement(thumbPosition).style.removeProperty(propertyName);
|
|
964
|
-
};
|
|
965
|
-
this.setTrackActiveStyleProperty = (propertyName, value) => {
|
|
966
|
-
this._delegate._trackActive.nativeElement.style.setProperty(propertyName, value);
|
|
967
|
-
};
|
|
968
|
-
this.removeTrackActiveStyleProperty = (propertyName) => {
|
|
969
|
-
this._delegate._trackActive.nativeElement.style.removeProperty(propertyName);
|
|
970
|
-
};
|
|
971
|
-
this.setValueIndicatorText = (value, thumbPosition) => {
|
|
972
|
-
this._delegate._setValueIndicatorText(value, thumbPosition);
|
|
973
|
-
};
|
|
974
|
-
this.getValueToAriaValueTextFn = () => {
|
|
975
|
-
return this._delegate.displayWith;
|
|
976
|
-
};
|
|
977
|
-
this.updateTickMarks = (tickMarks) => {
|
|
978
|
-
this._delegate._tickMarks = tickMarks;
|
|
979
|
-
this._delegate._cdr.markForCheck();
|
|
980
|
-
};
|
|
981
|
-
this.setPointerCapture = (pointerId) => {
|
|
982
|
-
this._delegate._elementRef.nativeElement.setPointerCapture(pointerId);
|
|
983
|
-
};
|
|
984
|
-
this.emitChangeEvent = (value, thumbPosition) => {
|
|
985
|
-
// We block all real slider input change events and emit fake change events from here, instead.
|
|
986
|
-
// We do this because the mdc implementation of the slider does not trigger real change events
|
|
987
|
-
// on pointer up (only on left or right arrow key down).
|
|
988
|
-
//
|
|
989
|
-
// By stopping real change events from reaching users, and dispatching fake change events
|
|
990
|
-
// (which we allow to reach the user) the slider inputs change events are triggered at the
|
|
991
|
-
// appropriate times. This allows users to listen for change events directly on the slider
|
|
992
|
-
// input as they would with a native range input.
|
|
993
|
-
const input = this._delegate._getInput(thumbPosition);
|
|
994
|
-
input._emitFakeEvent('change');
|
|
995
|
-
input._onChange(value);
|
|
996
|
-
input.valueChange.emit(value);
|
|
997
|
-
};
|
|
998
|
-
this.emitInputEvent = (value, thumbPosition) => {
|
|
999
|
-
this._delegate._getInput(thumbPosition)._emitFakeEvent('input');
|
|
1000
|
-
};
|
|
1001
|
-
this.emitDragStartEvent = (value, thumbPosition) => {
|
|
1002
|
-
const input = this._delegate._getInput(thumbPosition);
|
|
1003
|
-
input.dragStart.emit({ source: input, parent: this._delegate, value });
|
|
1004
|
-
};
|
|
1005
|
-
this.emitDragEndEvent = (value, thumbPosition) => {
|
|
1006
|
-
const input = this._delegate._getInput(thumbPosition);
|
|
1007
|
-
input.dragEnd.emit({ source: input, parent: this._delegate, value });
|
|
1008
|
-
};
|
|
1009
|
-
this.registerEventHandler = (evtType, handler) => {
|
|
1010
|
-
this._delegate._elementRef.nativeElement.addEventListener(evtType, handler);
|
|
1011
|
-
};
|
|
1012
|
-
this.deregisterEventHandler = (evtType, handler) => {
|
|
1013
|
-
this._delegate._elementRef.nativeElement.removeEventListener(evtType, handler);
|
|
1014
|
-
};
|
|
1015
|
-
this.registerThumbEventHandler = (thumbPosition, evtType, handler) => {
|
|
1016
|
-
this._delegate._getThumbElement(thumbPosition).addEventListener(evtType, handler);
|
|
1017
|
-
};
|
|
1018
|
-
this.deregisterThumbEventHandler = (thumbPosition, evtType, handler) => {
|
|
1019
|
-
this._delegate._getThumbElement(thumbPosition)?.removeEventListener(evtType, handler);
|
|
1020
|
-
};
|
|
1021
|
-
this.registerInputEventHandler = (thumbPosition, evtType, handler) => {
|
|
1022
|
-
if (evtType === 'change') {
|
|
1023
|
-
this._saveChangeEventHandler(thumbPosition, handler);
|
|
1024
|
-
}
|
|
1025
|
-
else {
|
|
1026
|
-
this._delegate._getInputElement(thumbPosition)?.addEventListener(evtType, handler);
|
|
1027
|
-
}
|
|
1028
|
-
};
|
|
1029
|
-
this.deregisterInputEventHandler = (thumbPosition, evtType, handler) => {
|
|
1030
|
-
if (evtType === 'change') {
|
|
1031
|
-
this._globalEventSubscriptions.unsubscribe();
|
|
1032
|
-
}
|
|
1033
|
-
else {
|
|
1034
|
-
this._delegate._getInputElement(thumbPosition)?.removeEventListener(evtType, handler);
|
|
1035
|
-
}
|
|
1036
|
-
};
|
|
1037
|
-
this.registerBodyEventHandler = (evtType, handler) => {
|
|
1038
|
-
this._delegate._document.body.addEventListener(evtType, handler);
|
|
1039
|
-
};
|
|
1040
|
-
this.deregisterBodyEventHandler = (evtType, handler) => {
|
|
1041
|
-
this._delegate._document.body.removeEventListener(evtType, handler);
|
|
1042
|
-
};
|
|
1043
|
-
this.registerWindowEventHandler = (evtType, handler) => {
|
|
1044
|
-
this._delegate._window.addEventListener(evtType, handler);
|
|
1045
|
-
};
|
|
1046
|
-
this.deregisterWindowEventHandler = (evtType, handler) => {
|
|
1047
|
-
this._delegate._window.removeEventListener(evtType, handler);
|
|
1048
|
-
};
|
|
1049
|
-
this._globalEventSubscriptions.add(this._subscribeToSliderInputEvents('change'));
|
|
1050
|
-
this._globalEventSubscriptions.add(this._subscribeToSliderInputEvents('input'));
|
|
925
|
+
/** Ensures that there is not an invalid configuration for the slider thumb inputs. */
|
|
926
|
+
function _validateInputs(isRange, endInputElement, startInputElement) {
|
|
927
|
+
const startValid = !isRange || startInputElement?._hostElement.hasAttribute('matSliderStartThumb');
|
|
928
|
+
const endValid = endInputElement._hostElement.hasAttribute(isRange ? 'matSliderEndThumb' : 'matSliderThumb');
|
|
929
|
+
if (!startValid || !endValid) {
|
|
930
|
+
_throwInvalidInputConfigurationError();
|
|
1051
931
|
}
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
932
|
+
}
|
|
933
|
+
function _throwInvalidInputConfigurationError() {
|
|
934
|
+
throw Error(`Invalid slider thumb input configuration!
|
|
935
|
+
|
|
936
|
+
Valid configurations are as follows:
|
|
937
|
+
|
|
938
|
+
<mat-slider>
|
|
939
|
+
<input matSliderThumb>
|
|
940
|
+
</mat-slider>
|
|
941
|
+
|
|
942
|
+
or
|
|
943
|
+
|
|
944
|
+
<mat-slider>
|
|
945
|
+
<input matSliderStartThumb>
|
|
946
|
+
<input matSliderEndThumb>
|
|
947
|
+
</mat-slider>
|
|
948
|
+
`);
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* @license
|
|
953
|
+
* Copyright Google LLC All Rights Reserved.
|
|
954
|
+
*
|
|
955
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
956
|
+
* found in the LICENSE file at https://angular.io/license
|
|
957
|
+
*/
|
|
958
|
+
/**
|
|
959
|
+
* Provider that allows the slider thumb to register as a ControlValueAccessor.
|
|
960
|
+
* @docs-private
|
|
961
|
+
*/
|
|
962
|
+
const MAT_SLIDER_THUMB_VALUE_ACCESSOR = {
|
|
963
|
+
provide: NG_VALUE_ACCESSOR,
|
|
964
|
+
useExisting: forwardRef(() => MatSliderThumb),
|
|
965
|
+
multi: true,
|
|
966
|
+
};
|
|
967
|
+
/**
|
|
968
|
+
* Provider that allows the range slider thumb to register as a ControlValueAccessor.
|
|
969
|
+
* @docs-private
|
|
970
|
+
*/
|
|
971
|
+
const MAT_SLIDER_RANGE_THUMB_VALUE_ACCESSOR = {
|
|
972
|
+
provide: NG_VALUE_ACCESSOR,
|
|
973
|
+
useExisting: forwardRef(() => MatSliderRangeThumb),
|
|
974
|
+
multi: true,
|
|
975
|
+
};
|
|
976
|
+
/**
|
|
977
|
+
* Directive that adds slider-specific behaviors to an input element inside `<mat-slider>`.
|
|
978
|
+
* Up to two may be placed inside of a `<mat-slider>`.
|
|
979
|
+
*
|
|
980
|
+
* If one is used, the selector `matSliderThumb` must be used, and the outcome will be a normal
|
|
981
|
+
* slider. If two are used, the selectors `matSliderStartThumb` and `matSliderEndThumb` must be
|
|
982
|
+
* used, and the outcome will be a range slider with two slider thumbs.
|
|
983
|
+
*/
|
|
984
|
+
class MatSliderThumb {
|
|
985
|
+
constructor(_ngZone, _elementRef, _cdr, _slider) {
|
|
986
|
+
this._ngZone = _ngZone;
|
|
987
|
+
this._elementRef = _elementRef;
|
|
988
|
+
this._cdr = _cdr;
|
|
989
|
+
this._slider = _slider;
|
|
990
|
+
this.valueChange = new EventEmitter();
|
|
991
|
+
/** Event emitted when the slider thumb starts being dragged. */
|
|
992
|
+
this.dragStart = new EventEmitter();
|
|
993
|
+
/** Event emitted when the slider thumb stops being dragged. */
|
|
994
|
+
this.dragEnd = new EventEmitter();
|
|
995
|
+
/** Indicates whether this thumb is the start or end thumb. */
|
|
996
|
+
this.thumbPosition = 2 /* _MatThumb.END */;
|
|
997
|
+
/** The radius of a native html slider's knob. */
|
|
998
|
+
this._knobRadius = 8;
|
|
999
|
+
/** Whether user's cursor is currently in a mouse down state on the input. */
|
|
1000
|
+
this._isActive = false;
|
|
1001
|
+
/** Whether the input is currently focused (either by tab or after clicking). */
|
|
1002
|
+
this._isFocused = false;
|
|
1003
|
+
/**
|
|
1004
|
+
* Whether the initial value has been set.
|
|
1005
|
+
* This exists because the initial value cannot be immediately set because the min and max
|
|
1006
|
+
* must first be relayed from the parent MatSlider component, which can only happen later
|
|
1007
|
+
* in the component lifecycle.
|
|
1008
|
+
*/
|
|
1009
|
+
this._hasSetInitialValue = false;
|
|
1010
|
+
/** Emits when the component is destroyed. */
|
|
1011
|
+
this._destroyed = new Subject();
|
|
1012
|
+
/**
|
|
1013
|
+
* Indicates whether UI updates should be skipped.
|
|
1014
|
+
*
|
|
1015
|
+
* This flag is used to avoid flickering
|
|
1016
|
+
* when correcting values on pointer up/down.
|
|
1017
|
+
*/
|
|
1018
|
+
this._skipUIUpdate = false;
|
|
1019
|
+
/** Callback called when the slider input value changes. */
|
|
1020
|
+
this._onChangeFn = () => { };
|
|
1021
|
+
/** Callback called when the slider input has been touched. */
|
|
1022
|
+
this._onTouchedFn = () => { };
|
|
1023
|
+
this._hostElement = _elementRef.nativeElement;
|
|
1024
|
+
this._ngZone.runOutsideAngular(() => {
|
|
1025
|
+
this._hostElement.addEventListener('pointerdown', this._onPointerDown.bind(this));
|
|
1026
|
+
this._hostElement.addEventListener('pointermove', this._onPointerMove.bind(this));
|
|
1027
|
+
this._hostElement.addEventListener('pointerup', this._onPointerUp.bind(this));
|
|
1083
1028
|
});
|
|
1084
1029
|
}
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1030
|
+
get value() {
|
|
1031
|
+
return coerceNumberProperty(this._hostElement.value);
|
|
1032
|
+
}
|
|
1033
|
+
set value(v) {
|
|
1034
|
+
const val = coerceNumberProperty(v).toString();
|
|
1035
|
+
if (!this._hasSetInitialValue) {
|
|
1036
|
+
this._initialValue = val;
|
|
1037
|
+
return;
|
|
1089
1038
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1039
|
+
if (this._isActive) {
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
this._hostElement.value = val;
|
|
1043
|
+
this._updateThumbUIByValue();
|
|
1044
|
+
this._slider._onValueChange(this);
|
|
1045
|
+
this._cdr.detectChanges();
|
|
1046
|
+
}
|
|
1047
|
+
/** The current translateX in px of the slider visual thumb. */
|
|
1048
|
+
get translateX() {
|
|
1049
|
+
if (this._slider.min >= this._slider.max) {
|
|
1050
|
+
this._translateX = 0;
|
|
1051
|
+
return this._translateX;
|
|
1052
|
+
}
|
|
1053
|
+
if (this._translateX === undefined) {
|
|
1054
|
+
this._translateX = this._calcTranslateXByValue();
|
|
1055
|
+
}
|
|
1056
|
+
return this._translateX;
|
|
1057
|
+
}
|
|
1058
|
+
set translateX(v) {
|
|
1059
|
+
this._translateX = v;
|
|
1060
|
+
}
|
|
1061
|
+
get min() {
|
|
1062
|
+
return coerceNumberProperty(this._hostElement.min);
|
|
1063
|
+
}
|
|
1064
|
+
set min(v) {
|
|
1065
|
+
this._hostElement.min = coerceNumberProperty(v).toString();
|
|
1066
|
+
this._cdr.detectChanges();
|
|
1067
|
+
}
|
|
1068
|
+
get max() {
|
|
1069
|
+
return coerceNumberProperty(this._hostElement.max);
|
|
1070
|
+
}
|
|
1071
|
+
set max(v) {
|
|
1072
|
+
this._hostElement.max = coerceNumberProperty(v).toString();
|
|
1073
|
+
this._cdr.detectChanges();
|
|
1074
|
+
}
|
|
1075
|
+
get step() {
|
|
1076
|
+
return coerceNumberProperty(this._hostElement.step);
|
|
1077
|
+
}
|
|
1078
|
+
set step(v) {
|
|
1079
|
+
this._hostElement.step = coerceNumberProperty(v).toString();
|
|
1080
|
+
this._cdr.detectChanges();
|
|
1081
|
+
}
|
|
1082
|
+
get disabled() {
|
|
1083
|
+
return coerceBooleanProperty(this._hostElement.disabled);
|
|
1084
|
+
}
|
|
1085
|
+
set disabled(v) {
|
|
1086
|
+
this._hostElement.disabled = coerceBooleanProperty(v);
|
|
1087
|
+
this._cdr.detectChanges();
|
|
1088
|
+
if (this._slider.disabled !== this.disabled) {
|
|
1089
|
+
this._slider.disabled = this.disabled;
|
|
1092
1090
|
}
|
|
1093
1091
|
}
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1092
|
+
get percentage() {
|
|
1093
|
+
if (this._slider.min >= this._slider.max) {
|
|
1094
|
+
return this._slider._isRtl ? 1 : 0;
|
|
1095
|
+
}
|
|
1096
|
+
return (this.value - this._slider.min) / (this._slider.max - this._slider.min);
|
|
1097
|
+
}
|
|
1098
|
+
get fillPercentage() {
|
|
1099
|
+
if (!this._slider._cachedWidth) {
|
|
1100
|
+
return this._slider._isRtl ? 1 : 0;
|
|
1101
|
+
}
|
|
1102
|
+
if (this._translateX === 0) {
|
|
1103
|
+
return 0;
|
|
1104
|
+
}
|
|
1105
|
+
return this.translateX / this._slider._cachedWidth;
|
|
1106
|
+
}
|
|
1107
|
+
/** Used to relay updates to _isFocused to the slider visual thumbs. */
|
|
1108
|
+
_setIsFocused(v) {
|
|
1109
|
+
this._isFocused = v;
|
|
1110
|
+
}
|
|
1111
|
+
ngOnDestroy() {
|
|
1112
|
+
this._hostElement.removeEventListener('pointerdown', this._onPointerDown);
|
|
1113
|
+
this._hostElement.removeEventListener('pointermove', this._onPointerMove);
|
|
1114
|
+
this._hostElement.removeEventListener('pointerup', this._onPointerUp);
|
|
1115
|
+
this._destroyed.next();
|
|
1116
|
+
this._destroyed.complete();
|
|
1117
|
+
this.dragStart.complete();
|
|
1118
|
+
this.dragEnd.complete();
|
|
1119
|
+
}
|
|
1120
|
+
initProps() {
|
|
1121
|
+
this._updateWidthInactive();
|
|
1122
|
+
this.disabled = this._slider.disabled;
|
|
1123
|
+
this.step = this._slider.step;
|
|
1124
|
+
this.min = this._slider.min;
|
|
1125
|
+
this.max = this._slider.max;
|
|
1126
|
+
this._initValue();
|
|
1127
|
+
}
|
|
1128
|
+
initUI() {
|
|
1129
|
+
this._updateThumbUIByValue();
|
|
1130
|
+
}
|
|
1131
|
+
_initValue() {
|
|
1132
|
+
this._hasSetInitialValue = true;
|
|
1133
|
+
if (this._initialValue === undefined) {
|
|
1134
|
+
this.value = this._getDefaultValue();
|
|
1098
1135
|
}
|
|
1099
1136
|
else {
|
|
1100
|
-
this.
|
|
1137
|
+
this._hostElement.value = this._initialValue;
|
|
1138
|
+
this._updateThumbUIByValue();
|
|
1139
|
+
this._slider._onValueChange(this);
|
|
1140
|
+
this._cdr.detectChanges();
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
_getDefaultValue() {
|
|
1144
|
+
return this.min;
|
|
1145
|
+
}
|
|
1146
|
+
_onBlur() {
|
|
1147
|
+
this._setIsFocused(false);
|
|
1148
|
+
this._onTouchedFn();
|
|
1149
|
+
}
|
|
1150
|
+
_onFocus() {
|
|
1151
|
+
this._setIsFocused(true);
|
|
1152
|
+
}
|
|
1153
|
+
_onChange() {
|
|
1154
|
+
// only used to handle the edge case where user
|
|
1155
|
+
// mousedown on the slider then uses arrow keys.
|
|
1156
|
+
if (this._isActive) {
|
|
1157
|
+
this._updateThumbUIByValue({ withAnimation: true });
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
_onInput() {
|
|
1161
|
+
this.valueChange.emit(this.value);
|
|
1162
|
+
this._onChangeFn(this.value);
|
|
1163
|
+
// handles arrowing and updating the value when
|
|
1164
|
+
// a step is defined.
|
|
1165
|
+
if (this._slider.step || !this._isActive) {
|
|
1166
|
+
this._updateThumbUIByValue({ withAnimation: true });
|
|
1167
|
+
}
|
|
1168
|
+
this._slider._onValueChange(this);
|
|
1169
|
+
}
|
|
1170
|
+
_onNgControlValueChange() {
|
|
1171
|
+
// only used to handle when the value change
|
|
1172
|
+
// originates outside of the slider.
|
|
1173
|
+
if (!this._isActive || !this._isFocused) {
|
|
1174
|
+
this._slider._onValueChange(this);
|
|
1175
|
+
this._updateThumbUIByValue();
|
|
1176
|
+
}
|
|
1177
|
+
this._slider.disabled = this._formControl.disabled;
|
|
1178
|
+
}
|
|
1179
|
+
_onPointerDown(event) {
|
|
1180
|
+
if (this.disabled || event.button !== 0) {
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
this._isActive = true;
|
|
1184
|
+
this._setIsFocused(true);
|
|
1185
|
+
this._updateWidthActive();
|
|
1186
|
+
this._slider._updateDimensions();
|
|
1187
|
+
// Does nothing if a step is defined because we
|
|
1188
|
+
// want the value to snap to the values on input.
|
|
1189
|
+
if (!this._slider.step) {
|
|
1190
|
+
this._updateThumbUIByPointerEvent(event, { withAnimation: true });
|
|
1191
|
+
}
|
|
1192
|
+
if (!this.disabled) {
|
|
1193
|
+
this._handleValueCorrection(event);
|
|
1101
1194
|
}
|
|
1102
1195
|
}
|
|
1103
1196
|
/**
|
|
1104
|
-
*
|
|
1105
|
-
*
|
|
1197
|
+
* Corrects the value of the slider on pointer up/down.
|
|
1198
|
+
*
|
|
1199
|
+
* Called on pointer down and up because the value is set based
|
|
1200
|
+
* on the inactive width instead of the active width.
|
|
1106
1201
|
*/
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1202
|
+
_handleValueCorrection(event) {
|
|
1203
|
+
// Don't update the UI with the current value! The value on pointerdown
|
|
1204
|
+
// and pointerup is calculated in the split second before the input(s)
|
|
1205
|
+
// resize. See _updateWidthInactive() and _updateWidthActive() for more
|
|
1206
|
+
// details.
|
|
1207
|
+
this._skipUIUpdate = true;
|
|
1208
|
+
// Note that this function gets triggered before the actual value of the
|
|
1209
|
+
// slider is updated. This means if we were to set the value here, it
|
|
1210
|
+
// would immediately be overwritten. Using setTimeout ensures the setting
|
|
1211
|
+
// of the value happens after the value has been updated by the
|
|
1212
|
+
// pointerdown event.
|
|
1213
|
+
setTimeout(() => {
|
|
1214
|
+
this._skipUIUpdate = false;
|
|
1215
|
+
this._fixValue(event);
|
|
1216
|
+
}, 0);
|
|
1217
|
+
}
|
|
1218
|
+
/** Corrects the value of the slider based on the pointer event's position. */
|
|
1219
|
+
_fixValue(event) {
|
|
1220
|
+
const xPos = event.clientX - this._slider._cachedLeft;
|
|
1221
|
+
const width = this._slider._cachedWidth;
|
|
1222
|
+
const step = this._slider.step === 0 ? 1 : this._slider.step;
|
|
1223
|
+
const numSteps = Math.floor((this._slider.max - this._slider.min) / step);
|
|
1224
|
+
const percentage = this._slider._isRtl ? 1 - xPos / width : xPos / width;
|
|
1225
|
+
// To ensure the percentage is rounded to the necessary number of decimals.
|
|
1226
|
+
const fixedPercentage = Math.round(percentage * numSteps) / numSteps;
|
|
1227
|
+
const impreciseValue = fixedPercentage * (this._slider.max - this._slider.min) + this._slider.min;
|
|
1228
|
+
const value = Math.round(impreciseValue / step) * step;
|
|
1229
|
+
const prevValue = this.value;
|
|
1230
|
+
const dragEvent = { source: this, parent: this._slider, value: value };
|
|
1231
|
+
this._isActive ? this.dragStart.emit(dragEvent) : this.dragEnd.emit(dragEvent);
|
|
1232
|
+
if (value === prevValue) {
|
|
1233
|
+
// Because we prevented UI updates, if it turns out that the race
|
|
1234
|
+
// condition didn't happen and the value is already correct, we
|
|
1235
|
+
// have to apply the ui updates now.
|
|
1236
|
+
this._slider._onValueChange(this);
|
|
1237
|
+
this._slider.step > 0
|
|
1238
|
+
? this._updateThumbUIByValue()
|
|
1239
|
+
: this._updateThumbUIByPointerEvent(event, { withAnimation: this._slider._hasAnimation });
|
|
1240
|
+
return;
|
|
1110
1241
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1242
|
+
this.value = value;
|
|
1243
|
+
this.valueChange.emit(this.value);
|
|
1244
|
+
this._onChangeFn(this.value);
|
|
1245
|
+
this._slider._onValueChange(this);
|
|
1246
|
+
this._slider.step > 0
|
|
1247
|
+
? this._updateThumbUIByValue()
|
|
1248
|
+
: this._updateThumbUIByPointerEvent(event, { withAnimation: this._slider._hasAnimation });
|
|
1249
|
+
}
|
|
1250
|
+
_onPointerMove(event) {
|
|
1251
|
+
// Again, does nothing if a step is defined because
|
|
1252
|
+
// we want the value to snap to the values on input.
|
|
1253
|
+
if (!this._slider.step && this._isActive) {
|
|
1254
|
+
this._updateThumbUIByPointerEvent(event);
|
|
1113
1255
|
}
|
|
1114
|
-
return null;
|
|
1115
1256
|
}
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
_throwInvalidInputConfigurationError();
|
|
1257
|
+
_onPointerUp(event) {
|
|
1258
|
+
this._isActive = false;
|
|
1259
|
+
this._updateWidthInactive();
|
|
1260
|
+
if (!this.disabled) {
|
|
1261
|
+
this._handleValueCorrection(event);
|
|
1262
|
+
}
|
|
1123
1263
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1264
|
+
_clamp(v) {
|
|
1265
|
+
return Math.max(Math.min(v, this._slider._cachedWidth), 0);
|
|
1266
|
+
}
|
|
1267
|
+
_calcTranslateXByValue() {
|
|
1268
|
+
if (this._slider._isRtl) {
|
|
1269
|
+
return (1 - this.percentage) * this._slider._cachedWidth;
|
|
1270
|
+
}
|
|
1271
|
+
return this.percentage * this._slider._cachedWidth;
|
|
1272
|
+
}
|
|
1273
|
+
_calcTranslateXByPointerEvent(event) {
|
|
1274
|
+
return event.clientX - this._slider._cachedLeft;
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Used to set the slider width to the correct
|
|
1278
|
+
* dimensions while the user is dragging.
|
|
1279
|
+
*/
|
|
1280
|
+
_updateWidthActive() {
|
|
1281
|
+
this._hostElement.style.padding = `0 ${this._slider._inputPadding}px`;
|
|
1282
|
+
this._hostElement.style.width = `calc(100% + ${this._slider._inputPadding}px)`;
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* Sets the slider input to disproportionate dimensions to allow for touch
|
|
1286
|
+
* events to be captured on touch devices.
|
|
1287
|
+
*/
|
|
1288
|
+
_updateWidthInactive() {
|
|
1289
|
+
this._hostElement.style.padding = '0px';
|
|
1290
|
+
this._hostElement.style.width = 'calc(100% + 48px)';
|
|
1291
|
+
this._hostElement.style.left = '-24px';
|
|
1292
|
+
}
|
|
1293
|
+
_updateThumbUIByValue(options) {
|
|
1294
|
+
this.translateX = this._clamp(this._calcTranslateXByValue());
|
|
1295
|
+
this._updateThumbUI(options);
|
|
1296
|
+
}
|
|
1297
|
+
_updateThumbUIByPointerEvent(event, options) {
|
|
1298
|
+
this.translateX = this._clamp(this._calcTranslateXByPointerEvent(event));
|
|
1299
|
+
this._updateThumbUI(options);
|
|
1300
|
+
}
|
|
1301
|
+
_updateThumbUI(options) {
|
|
1302
|
+
this._slider._setTransition(!!options?.withAnimation);
|
|
1303
|
+
this._slider._onTranslateXChange(this);
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Sets the input's value.
|
|
1307
|
+
* @param value The new value of the input
|
|
1308
|
+
* @docs-private
|
|
1309
|
+
*/
|
|
1310
|
+
writeValue(value) {
|
|
1311
|
+
this.value = value;
|
|
1312
|
+
}
|
|
1313
|
+
/**
|
|
1314
|
+
* Registers a callback to be invoked when the input's value changes from user input.
|
|
1315
|
+
* @param fn The callback to register
|
|
1316
|
+
* @docs-private
|
|
1317
|
+
*/
|
|
1318
|
+
registerOnChange(fn) {
|
|
1319
|
+
this._onChangeFn = fn;
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Registers a callback to be invoked when the input is blurred by the user.
|
|
1323
|
+
* @param fn The callback to register
|
|
1324
|
+
* @docs-private
|
|
1325
|
+
*/
|
|
1326
|
+
registerOnTouched(fn) {
|
|
1327
|
+
this._onTouchedFn = fn;
|
|
1328
|
+
}
|
|
1329
|
+
/**
|
|
1330
|
+
* Sets the disabled state of the slider.
|
|
1331
|
+
* @param isDisabled The new disabled state
|
|
1332
|
+
* @docs-private
|
|
1333
|
+
*/
|
|
1334
|
+
setDisabledState(isDisabled) {
|
|
1335
|
+
this.disabled = isDisabled;
|
|
1336
|
+
}
|
|
1337
|
+
focus() {
|
|
1338
|
+
this._hostElement.focus();
|
|
1339
|
+
}
|
|
1340
|
+
blur() {
|
|
1341
|
+
this._hostElement.blur();
|
|
1129
1342
|
}
|
|
1130
1343
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1344
|
+
MatSliderThumb.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.1", ngImport: i0, type: MatSliderThumb, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: MAT_SLIDER }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1345
|
+
MatSliderThumb.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.1", type: MatSliderThumb, selector: "input[matSliderThumb]", inputs: { value: "value" }, outputs: { valueChange: "valueChange", dragStart: "dragStart", dragEnd: "dragEnd" }, host: { attributes: { "type": "range" }, listeners: { "change": "_onChange()", "input": "_onInput()", "blur": "_onBlur()", "focus": "_onFocus()" }, properties: { "attr.aria-valuetext": "_valuetext" }, classAttribute: "mdc-slider__input" }, providers: [
|
|
1346
|
+
MAT_SLIDER_THUMB_VALUE_ACCESSOR,
|
|
1347
|
+
{ provide: MAT_SLIDER_THUMB, useExisting: MatSliderThumb },
|
|
1348
|
+
], exportAs: ["matSliderThumb"], ngImport: i0 });
|
|
1349
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.1", ngImport: i0, type: MatSliderThumb, decorators: [{
|
|
1350
|
+
type: Directive,
|
|
1351
|
+
args: [{
|
|
1352
|
+
selector: 'input[matSliderThumb]',
|
|
1353
|
+
exportAs: 'matSliderThumb',
|
|
1354
|
+
host: {
|
|
1355
|
+
'class': 'mdc-slider__input',
|
|
1356
|
+
'type': 'range',
|
|
1357
|
+
'[attr.aria-valuetext]': '_valuetext',
|
|
1358
|
+
'(change)': '_onChange()',
|
|
1359
|
+
'(input)': '_onInput()',
|
|
1360
|
+
// TODO(wagnermaciel): Consider using a global event listener instead.
|
|
1361
|
+
// Reason: I have found a semi-consistent way to mouse up without triggering this event.
|
|
1362
|
+
'(blur)': '_onBlur()',
|
|
1363
|
+
'(focus)': '_onFocus()',
|
|
1364
|
+
},
|
|
1365
|
+
providers: [
|
|
1366
|
+
MAT_SLIDER_THUMB_VALUE_ACCESSOR,
|
|
1367
|
+
{ provide: MAT_SLIDER_THUMB, useExisting: MatSliderThumb },
|
|
1368
|
+
],
|
|
1369
|
+
}]
|
|
1370
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
1371
|
+
type: Inject,
|
|
1372
|
+
args: [MAT_SLIDER]
|
|
1373
|
+
}] }]; }, propDecorators: { value: [{
|
|
1374
|
+
type: Input
|
|
1375
|
+
}], valueChange: [{
|
|
1376
|
+
type: Output
|
|
1377
|
+
}], dragStart: [{
|
|
1378
|
+
type: Output
|
|
1379
|
+
}], dragEnd: [{
|
|
1380
|
+
type: Output
|
|
1381
|
+
}] } });
|
|
1382
|
+
class MatSliderRangeThumb extends MatSliderThumb {
|
|
1383
|
+
constructor(_ngZone, _slider, _elementRef, _cdr) {
|
|
1384
|
+
super(_ngZone, _elementRef, _cdr, _slider);
|
|
1385
|
+
this._cdr = _cdr;
|
|
1386
|
+
this._isEndThumb = this._hostElement.hasAttribute('matSliderEndThumb');
|
|
1387
|
+
this._setIsLeftThumb();
|
|
1388
|
+
this.thumbPosition = this._isEndThumb ? 2 /* _MatThumb.END */ : 1 /* _MatThumb.START */;
|
|
1389
|
+
}
|
|
1390
|
+
getSibling() {
|
|
1391
|
+
if (!this._sibling) {
|
|
1392
|
+
this._sibling = this._slider._getInput(this._isEndThumb ? 1 /* _MatThumb.START */ : 2 /* _MatThumb.END */);
|
|
1393
|
+
}
|
|
1394
|
+
return this._sibling;
|
|
1395
|
+
}
|
|
1396
|
+
/** Returns the minimum translateX position allowed for this slider input's visual thumb. */
|
|
1397
|
+
getMinPos() {
|
|
1398
|
+
const sibling = this.getSibling();
|
|
1399
|
+
if (!this._isLeftThumb && sibling) {
|
|
1400
|
+
return sibling.translateX;
|
|
1401
|
+
}
|
|
1402
|
+
return 0;
|
|
1403
|
+
}
|
|
1404
|
+
/** Returns the maximum translateX position allowed for this slider input's visual thumb. */
|
|
1405
|
+
getMaxPos() {
|
|
1406
|
+
const sibling = this.getSibling();
|
|
1407
|
+
if (this._isLeftThumb && sibling) {
|
|
1408
|
+
return sibling.translateX;
|
|
1409
|
+
}
|
|
1410
|
+
return this._slider._cachedWidth;
|
|
1411
|
+
}
|
|
1412
|
+
_setIsLeftThumb() {
|
|
1413
|
+
this._isLeftThumb =
|
|
1414
|
+
(this._isEndThumb && this._slider._isRtl) || (!this._isEndThumb && !this._slider._isRtl);
|
|
1415
|
+
}
|
|
1416
|
+
_getDefaultValue() {
|
|
1417
|
+
return this._isEndThumb && this._slider._isRange ? this.max : this.min;
|
|
1418
|
+
}
|
|
1419
|
+
_onInput() {
|
|
1420
|
+
super._onInput();
|
|
1421
|
+
this._updateSibling();
|
|
1422
|
+
if (!this._isActive) {
|
|
1423
|
+
this._updateWidthInactive();
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
_onNgControlValueChange() {
|
|
1427
|
+
super._onNgControlValueChange();
|
|
1428
|
+
this.getSibling()?._updateMinMax();
|
|
1429
|
+
}
|
|
1430
|
+
_onPointerDown(event) {
|
|
1431
|
+
if (this.disabled) {
|
|
1432
|
+
return;
|
|
1433
|
+
}
|
|
1434
|
+
if (this._sibling) {
|
|
1435
|
+
this._sibling._updateWidthActive();
|
|
1436
|
+
this._sibling._hostElement.classList.add('mat-mdc-slider-input-no-pointer-events');
|
|
1437
|
+
}
|
|
1438
|
+
super._onPointerDown(event);
|
|
1439
|
+
}
|
|
1440
|
+
_onPointerUp(event) {
|
|
1441
|
+
super._onPointerUp(event);
|
|
1442
|
+
if (this._sibling) {
|
|
1443
|
+
this._sibling._updateWidthInactive();
|
|
1444
|
+
this._sibling._hostElement.classList.remove('mat-mdc-slider-input-no-pointer-events');
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
_onPointerMove(event) {
|
|
1448
|
+
super._onPointerMove(event);
|
|
1449
|
+
if (!this._slider.step && this._isActive) {
|
|
1450
|
+
this._updateSibling();
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
_fixValue(event) {
|
|
1454
|
+
super._fixValue(event);
|
|
1455
|
+
this._sibling?._updateMinMax();
|
|
1456
|
+
}
|
|
1457
|
+
_clamp(v) {
|
|
1458
|
+
return Math.max(Math.min(v, this.getMaxPos()), this.getMinPos());
|
|
1459
|
+
}
|
|
1460
|
+
_updateMinMax() {
|
|
1461
|
+
const sibling = this.getSibling();
|
|
1462
|
+
if (!sibling) {
|
|
1463
|
+
return;
|
|
1464
|
+
}
|
|
1465
|
+
if (this._isEndThumb) {
|
|
1466
|
+
this.min = Math.max(this._slider.min, sibling.value);
|
|
1467
|
+
this.max = this._slider.max;
|
|
1468
|
+
}
|
|
1469
|
+
else {
|
|
1470
|
+
this.min = this._slider.min;
|
|
1471
|
+
this.max = Math.min(this._slider.max, sibling.value);
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
_updateWidthActive() {
|
|
1475
|
+
const minWidth = this._slider._rippleRadius * 2 - this._slider._inputPadding * 2;
|
|
1476
|
+
const maxWidth = this._slider._cachedWidth + this._slider._inputPadding - minWidth;
|
|
1477
|
+
const percentage = this._slider.min < this._slider.max
|
|
1478
|
+
? (this.max - this.min) / (this._slider.max - this._slider.min)
|
|
1479
|
+
: 1;
|
|
1480
|
+
const width = maxWidth * percentage + minWidth;
|
|
1481
|
+
this._hostElement.style.width = `${width}px`;
|
|
1482
|
+
this._hostElement.style.padding = `0 ${this._slider._inputPadding}px`;
|
|
1483
|
+
}
|
|
1484
|
+
_updateWidthInactive() {
|
|
1485
|
+
const sibling = this.getSibling();
|
|
1486
|
+
if (!sibling) {
|
|
1487
|
+
return;
|
|
1488
|
+
}
|
|
1489
|
+
const maxWidth = this._slider._cachedWidth;
|
|
1490
|
+
const midValue = this._isEndThumb
|
|
1491
|
+
? this.value - (this.value - sibling.value) / 2
|
|
1492
|
+
: this.value + (sibling.value - this.value) / 2;
|
|
1493
|
+
const _percentage = this._isEndThumb
|
|
1494
|
+
? (this.max - midValue) / (this._slider.max - this._slider.min)
|
|
1495
|
+
: (midValue - this.min) / (this._slider.max - this._slider.min);
|
|
1496
|
+
const percentage = this._slider.min < this._slider.max ? _percentage : 1;
|
|
1497
|
+
const width = maxWidth * percentage + 24;
|
|
1498
|
+
this._hostElement.style.width = `${width}px`;
|
|
1499
|
+
this._hostElement.style.padding = '0px';
|
|
1500
|
+
if (this._isLeftThumb) {
|
|
1501
|
+
this._hostElement.style.left = '-24px';
|
|
1502
|
+
this._hostElement.style.right = 'auto';
|
|
1503
|
+
}
|
|
1504
|
+
else {
|
|
1505
|
+
this._hostElement.style.left = 'auto';
|
|
1506
|
+
this._hostElement.style.right = '-24px';
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
_updateStaticStyles() {
|
|
1510
|
+
this._hostElement.classList.toggle('mat-slider__right-input', !this._isLeftThumb);
|
|
1511
|
+
}
|
|
1512
|
+
_updateSibling() {
|
|
1513
|
+
const sibling = this.getSibling();
|
|
1514
|
+
if (!sibling) {
|
|
1515
|
+
return;
|
|
1516
|
+
}
|
|
1517
|
+
sibling._updateMinMax();
|
|
1518
|
+
if (this._isActive) {
|
|
1519
|
+
sibling._updateWidthActive();
|
|
1520
|
+
}
|
|
1521
|
+
else {
|
|
1522
|
+
sibling._updateWidthInactive();
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Sets the input's value.
|
|
1527
|
+
* @param value The new value of the input
|
|
1528
|
+
* @docs-private
|
|
1529
|
+
*/
|
|
1530
|
+
writeValue(value) {
|
|
1531
|
+
this.value = value;
|
|
1532
|
+
this._updateWidthInactive();
|
|
1533
|
+
this._updateSibling();
|
|
1534
|
+
}
|
|
1147
1535
|
}
|
|
1536
|
+
MatSliderRangeThumb.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.1", ngImport: i0, type: MatSliderRangeThumb, deps: [{ token: i0.NgZone }, { token: MAT_SLIDER }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1537
|
+
MatSliderRangeThumb.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.1", type: MatSliderRangeThumb, selector: "input[matSliderStartThumb], input[matSliderEndThumb]", providers: [
|
|
1538
|
+
MAT_SLIDER_RANGE_THUMB_VALUE_ACCESSOR,
|
|
1539
|
+
{ provide: MAT_SLIDER_RANGE_THUMB, useExisting: MatSliderRangeThumb },
|
|
1540
|
+
], exportAs: ["matSliderRangeThumb"], usesInheritance: true, ngImport: i0 });
|
|
1541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.1", ngImport: i0, type: MatSliderRangeThumb, decorators: [{
|
|
1542
|
+
type: Directive,
|
|
1543
|
+
args: [{
|
|
1544
|
+
selector: 'input[matSliderStartThumb], input[matSliderEndThumb]',
|
|
1545
|
+
exportAs: 'matSliderRangeThumb',
|
|
1546
|
+
providers: [
|
|
1547
|
+
MAT_SLIDER_RANGE_THUMB_VALUE_ACCESSOR,
|
|
1548
|
+
{ provide: MAT_SLIDER_RANGE_THUMB, useExisting: MatSliderRangeThumb },
|
|
1549
|
+
],
|
|
1550
|
+
}]
|
|
1551
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: undefined, decorators: [{
|
|
1552
|
+
type: Inject,
|
|
1553
|
+
args: [MAT_SLIDER]
|
|
1554
|
+
}] }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; } });
|
|
1148
1555
|
|
|
1149
1556
|
/**
|
|
1150
1557
|
* @license
|
|
@@ -1155,15 +1562,15 @@ function _throwInvalidInputConfigurationError() {
|
|
|
1155
1562
|
*/
|
|
1156
1563
|
class MatSliderModule {
|
|
1157
1564
|
}
|
|
1158
|
-
MatSliderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1159
|
-
MatSliderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
1160
|
-
MatSliderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
1565
|
+
MatSliderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.1", ngImport: i0, type: MatSliderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1566
|
+
MatSliderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.1", ngImport: i0, type: MatSliderModule, declarations: [MatSlider, MatSliderThumb, MatSliderRangeThumb, MatSliderVisualThumb], imports: [MatCommonModule, CommonModule, MatRippleModule], exports: [MatSlider, MatSliderThumb, MatSliderRangeThumb] });
|
|
1567
|
+
MatSliderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.1", ngImport: i0, type: MatSliderModule, imports: [MatCommonModule, CommonModule, MatRippleModule] });
|
|
1568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.1", ngImport: i0, type: MatSliderModule, decorators: [{
|
|
1162
1569
|
type: NgModule,
|
|
1163
1570
|
args: [{
|
|
1164
1571
|
imports: [MatCommonModule, CommonModule, MatRippleModule],
|
|
1165
|
-
exports: [MatSlider, MatSliderThumb],
|
|
1166
|
-
declarations: [MatSlider, MatSliderThumb, MatSliderVisualThumb],
|
|
1572
|
+
exports: [MatSlider, MatSliderThumb, MatSliderRangeThumb],
|
|
1573
|
+
declarations: [MatSlider, MatSliderThumb, MatSliderRangeThumb, MatSliderVisualThumb],
|
|
1167
1574
|
}]
|
|
1168
1575
|
}] });
|
|
1169
1576
|
|
|
@@ -1187,5 +1594,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.0", ng
|
|
|
1187
1594
|
* Generated bundle index. Do not edit.
|
|
1188
1595
|
*/
|
|
1189
1596
|
|
|
1190
|
-
export { MatSlider, MatSliderModule, MatSliderThumb };
|
|
1597
|
+
export { MatSlider, MatSliderModule, MatSliderRangeThumb, MatSliderThumb, MatSliderVisualThumb };
|
|
1191
1598
|
//# sourceMappingURL=slider.mjs.map
|