@angular/material-experimental 14.2.2 → 15.0.0-next.1
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 +0 -69
- package/column-resize/index.d.ts +7 -7
- package/esm2020/column-resize/column-resize-directives/column-resize-flex.mjs +4 -4
- package/esm2020/column-resize/column-resize-directives/column-resize.mjs +4 -4
- package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize-flex.mjs +4 -4
- package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize.mjs +4 -4
- package/esm2020/column-resize/column-resize-module.mjs +13 -13
- package/esm2020/column-resize/overlay-handle.mjs +4 -4
- package/esm2020/column-resize/resizable-directives/default-enabled-resizable.mjs +4 -4
- package/esm2020/column-resize/resizable-directives/resizable.mjs +4 -4
- package/esm2020/column-resize/resize-strategy.mjs +4 -4
- package/esm2020/menubar/menubar-item.mjs +4 -4
- package/esm2020/menubar/menubar-module.mjs +5 -5
- package/esm2020/menubar/menubar.mjs +4 -4
- package/esm2020/popover-edit/lens-directives.mjs +10 -10
- package/esm2020/popover-edit/popover-edit-module.mjs +5 -5
- package/esm2020/popover-edit/table-directives.mjs +13 -13
- package/esm2020/selection/row-selection.mjs +4 -4
- package/esm2020/selection/select-all.mjs +4 -4
- package/esm2020/selection/selection-column.mjs +12 -12
- package/esm2020/selection/selection-module.mjs +8 -8
- package/esm2020/selection/selection-toggle.mjs +4 -4
- package/esm2020/selection/selection.mjs +4 -4
- package/esm2020/version.mjs +1 -1
- package/fesm2015/column-resize.mjs +36 -36
- package/fesm2015/column-resize.mjs.map +1 -1
- package/fesm2015/material-experimental.mjs +1 -1
- package/fesm2015/material-experimental.mjs.map +1 -1
- package/fesm2015/menubar.mjs +10 -10
- package/fesm2015/menubar.mjs.map +1 -1
- package/fesm2015/popover-edit.mjs +25 -25
- package/fesm2015/popover-edit.mjs.map +1 -1
- package/fesm2015/selection.mjs +29 -29
- package/fesm2015/selection.mjs.map +1 -1
- package/fesm2020/column-resize.mjs +36 -36
- package/fesm2020/column-resize.mjs.map +1 -1
- package/fesm2020/material-experimental.mjs +1 -1
- package/fesm2020/material-experimental.mjs.map +1 -1
- package/fesm2020/menubar.mjs +10 -10
- package/fesm2020/menubar.mjs.map +1 -1
- package/fesm2020/popover-edit.mjs +25 -25
- package/fesm2020/popover-edit.mjs.map +1 -1
- package/fesm2020/selection.mjs +29 -29
- package/fesm2020/selection.mjs.map +1 -1
- package/menubar/index.d.ts +2 -2
- package/package.json +55 -422
- package/popover-edit/index.d.ts +7 -7
- package/selection/index.d.ts +9 -9
- package/esm2020/mdc-autocomplete/animations.mjs +0 -25
- package/esm2020/mdc-autocomplete/autocomplete-origin.mjs +0 -26
- package/esm2020/mdc-autocomplete/autocomplete-trigger.mjs +0 -54
- package/esm2020/mdc-autocomplete/autocomplete.mjs +0 -35
- package/esm2020/mdc-autocomplete/index.mjs +0 -9
- package/esm2020/mdc-autocomplete/mdc-autocomplete_public_index.mjs +0 -5
- package/esm2020/mdc-autocomplete/module.mjs +0 -46
- package/esm2020/mdc-autocomplete/public-api.mjs +0 -14
- package/esm2020/mdc-autocomplete/testing/autocomplete-harness-filters.mjs +0 -9
- package/esm2020/mdc-autocomplete/testing/autocomplete-harness.mjs +0 -31
- package/esm2020/mdc-autocomplete/testing/index.mjs +0 -9
- package/esm2020/mdc-autocomplete/testing/public-api.mjs +0 -10
- package/esm2020/mdc-button/button-base.mjs +0 -152
- package/esm2020/mdc-button/button.mjs +0 -69
- package/esm2020/mdc-button/fab.mjs +0 -175
- package/esm2020/mdc-button/icon-button.mjs +0 -57
- package/esm2020/mdc-button/index.mjs +0 -9
- package/esm2020/mdc-button/mdc-button_public_index.mjs +0 -5
- package/esm2020/mdc-button/module.mjs +0 -61
- package/esm2020/mdc-button/public-api.mjs +0 -12
- package/esm2020/mdc-button/testing/button-harness.mjs +0 -50
- package/esm2020/mdc-button/testing/index.mjs +0 -9
- package/esm2020/mdc-button/testing/public-api.mjs +0 -9
- package/esm2020/mdc-card/card.mjs +0 -261
- package/esm2020/mdc-card/index.mjs +0 -9
- package/esm2020/mdc-card/mdc-card_public_index.mjs +0 -5
- package/esm2020/mdc-card/module.mjs +0 -68
- package/esm2020/mdc-card/public-api.mjs +0 -10
- package/esm2020/mdc-card/testing/card-harness-filters.mjs +0 -9
- package/esm2020/mdc-card/testing/card-harness.mjs +0 -42
- package/esm2020/mdc-card/testing/index.mjs +0 -9
- package/esm2020/mdc-card/testing/public-api.mjs +0 -10
- package/esm2020/mdc-checkbox/checkbox.mjs +0 -93
- package/esm2020/mdc-checkbox/index.mjs +0 -9
- package/esm2020/mdc-checkbox/mdc-checkbox_public_index.mjs +0 -5
- package/esm2020/mdc-checkbox/module.mjs +0 -26
- package/esm2020/mdc-checkbox/public-api.mjs +0 -11
- package/esm2020/mdc-checkbox/testing/checkbox-harness.mjs +0 -41
- package/esm2020/mdc-checkbox/testing/index.mjs +0 -9
- package/esm2020/mdc-checkbox/testing/public-api.mjs +0 -9
- package/esm2020/mdc-chips/chip-action.mjs +0 -90
- package/esm2020/mdc-chips/chip-edit-input.mjs +0 -60
- package/esm2020/mdc-chips/chip-grid.mjs +0 -407
- package/esm2020/mdc-chips/chip-icons.mjs +0 -110
- package/esm2020/mdc-chips/chip-input.mjs +0 -212
- package/esm2020/mdc-chips/chip-listbox.mjs +0 -332
- package/esm2020/mdc-chips/chip-option.mjs +0 -160
- package/esm2020/mdc-chips/chip-row.mjs +0 -176
- package/esm2020/mdc-chips/chip-set.mjs +0 -271
- package/esm2020/mdc-chips/chip-text-control.mjs +0 -9
- package/esm2020/mdc-chips/chip.mjs +0 -287
- package/esm2020/mdc-chips/index.mjs +0 -9
- package/esm2020/mdc-chips/mdc-chips_public_index.mjs +0 -5
- package/esm2020/mdc-chips/module.mjs +0 -87
- package/esm2020/mdc-chips/public-api.mjs +0 -20
- package/esm2020/mdc-chips/testing/chip-avatar-harness.mjs +0 -22
- package/esm2020/mdc-chips/testing/chip-grid-harness.mjs +0 -43
- package/esm2020/mdc-chips/testing/chip-harness-filters.mjs +0 -9
- package/esm2020/mdc-chips/testing/chip-harness.mjs +0 -58
- package/esm2020/mdc-chips/testing/chip-input-harness.mjs +0 -82
- package/esm2020/mdc-chips/testing/chip-listbox-harness.mjs +0 -59
- package/esm2020/mdc-chips/testing/chip-option-harness.mjs +0 -45
- package/esm2020/mdc-chips/testing/chip-remove-harness.mjs +0 -26
- package/esm2020/mdc-chips/testing/chip-row-harness.mjs +0 -22
- package/esm2020/mdc-chips/testing/chip-set-harness.mjs +0 -26
- package/esm2020/mdc-chips/testing/index.mjs +0 -9
- package/esm2020/mdc-chips/testing/public-api.mjs +0 -18
- package/esm2020/mdc-chips/tokens.mjs +0 -33
- package/esm2020/mdc-core/index.mjs +0 -9
- package/esm2020/mdc-core/mdc-core_public_index.mjs +0 -5
- package/esm2020/mdc-core/option/index.mjs +0 -30
- package/esm2020/mdc-core/option/optgroup.mjs +0 -46
- package/esm2020/mdc-core/option/option.mjs +0 -52
- package/esm2020/mdc-core/public-api.mjs +0 -10
- package/esm2020/mdc-core/testing/index.mjs +0 -9
- package/esm2020/mdc-core/testing/optgroup-harness-filters.mjs +0 -9
- package/esm2020/mdc-core/testing/optgroup-harness.mjs +0 -43
- package/esm2020/mdc-core/testing/option-harness-filters.mjs +0 -9
- package/esm2020/mdc-core/testing/option-harness.mjs +0 -53
- package/esm2020/mdc-core/testing/public-api.mjs +0 -12
- package/esm2020/mdc-dialog/dialog-container.mjs +0 -171
- package/esm2020/mdc-dialog/dialog-content-directives.mjs +0 -179
- package/esm2020/mdc-dialog/dialog-ref.mjs +0 -14
- package/esm2020/mdc-dialog/dialog.mjs +0 -82
- package/esm2020/mdc-dialog/index.mjs +0 -9
- package/esm2020/mdc-dialog/mdc-dialog_public_index.mjs +0 -5
- package/esm2020/mdc-dialog/module.mjs +0 -53
- package/esm2020/mdc-dialog/public-api.mjs +0 -14
- package/esm2020/mdc-dialog/testing/dialog-harness.mjs +0 -29
- package/esm2020/mdc-dialog/testing/dialog-opener.mjs +0 -45
- package/esm2020/mdc-dialog/testing/index.mjs +0 -9
- package/esm2020/mdc-dialog/testing/public-api.mjs +0 -10
- package/esm2020/mdc-form-field/directives/error.mjs +0 -47
- package/esm2020/mdc-form-field/directives/floating-label.mjs +0 -73
- package/esm2020/mdc-form-field/directives/hint.mjs +0 -39
- package/esm2020/mdc-form-field/directives/label.mjs +0 -21
- package/esm2020/mdc-form-field/directives/line-ripple.mjs +0 -59
- package/esm2020/mdc-form-field/directives/notched-outline.mjs +0 -68
- package/esm2020/mdc-form-field/directives/prefix.mjs +0 -32
- package/esm2020/mdc-form-field/directives/suffix.mjs +0 -32
- package/esm2020/mdc-form-field/form-field.mjs +0 -608
- package/esm2020/mdc-form-field/index.mjs +0 -9
- package/esm2020/mdc-form-field/mdc-form-field_public_index.mjs +0 -5
- package/esm2020/mdc-form-field/module.mjs +0 -53
- package/esm2020/mdc-form-field/public-api.mjs +0 -16
- package/esm2020/mdc-form-field/testing/form-field-harness.mjs +0 -58
- package/esm2020/mdc-form-field/testing/index.mjs +0 -9
- package/esm2020/mdc-form-field/testing/public-api.mjs +0 -13
- package/esm2020/mdc-input/index.mjs +0 -9
- package/esm2020/mdc-input/input.mjs +0 -55
- package/esm2020/mdc-input/mdc-input_public_index.mjs +0 -5
- package/esm2020/mdc-input/module.mjs +0 -27
- package/esm2020/mdc-input/public-api.mjs +0 -11
- package/esm2020/mdc-input/testing/index.mjs +0 -9
- package/esm2020/mdc-input/testing/public-api.mjs +0 -9
- package/esm2020/mdc-list/action-list.mjs +0 -31
- package/esm2020/mdc-list/index.mjs +0 -9
- package/esm2020/mdc-list/list-base.mjs +0 -272
- package/esm2020/mdc-list/list-item-sections.mjs +0 -138
- package/esm2020/mdc-list/list-option-types.mjs +0 -16
- package/esm2020/mdc-list/list-option.mjs +0 -253
- package/esm2020/mdc-list/list.mjs +0 -82
- package/esm2020/mdc-list/mdc-list_public_index.mjs +0 -5
- package/esm2020/mdc-list/module.mjs +0 -98
- package/esm2020/mdc-list/nav-list.mjs +0 -31
- package/esm2020/mdc-list/public-api.mjs +0 -18
- package/esm2020/mdc-list/selection-list.mjs +0 -338
- package/esm2020/mdc-list/subheader.mjs +0 -27
- package/esm2020/mdc-list/testing/action-list-harness.mjs +0 -59
- package/esm2020/mdc-list/testing/index.mjs +0 -9
- package/esm2020/mdc-list/testing/list-harness-base.mjs +0 -95
- package/esm2020/mdc-list/testing/list-harness-filters.mjs +0 -9
- package/esm2020/mdc-list/testing/list-harness.mjs +0 -41
- package/esm2020/mdc-list/testing/list-item-harness-base.mjs +0 -150
- package/esm2020/mdc-list/testing/nav-list-harness.mjs +0 -69
- package/esm2020/mdc-list/testing/public-api.mjs +0 -14
- package/esm2020/mdc-list/testing/selection-list-harness.mjs +0 -117
- package/esm2020/mdc-menu/directives.mjs +0 -38
- package/esm2020/mdc-menu/index.mjs +0 -9
- package/esm2020/mdc-menu/mdc-menu_public_index.mjs +0 -5
- package/esm2020/mdc-menu/menu-item.mjs +0 -36
- package/esm2020/mdc-menu/menu.mjs +0 -43
- package/esm2020/mdc-menu/module.mjs +0 -44
- package/esm2020/mdc-menu/public-api.mjs +0 -13
- package/esm2020/mdc-menu/testing/index.mjs +0 -9
- package/esm2020/mdc-menu/testing/menu-harness.mjs +0 -46
- package/esm2020/mdc-menu/testing/public-api.mjs +0 -9
- package/esm2020/mdc-paginator/index.mjs +0 -9
- package/esm2020/mdc-paginator/mdc-paginator_public_index.mjs +0 -5
- package/esm2020/mdc-paginator/module.mjs +0 -30
- package/esm2020/mdc-paginator/paginator.mjs +0 -48
- package/esm2020/mdc-paginator/public-api.mjs +0 -11
- package/esm2020/mdc-paginator/testing/index.mjs +0 -9
- package/esm2020/mdc-paginator/testing/paginator-harness.mjs +0 -36
- package/esm2020/mdc-paginator/testing/public-api.mjs +0 -9
- package/esm2020/mdc-progress-bar/index.mjs +0 -9
- package/esm2020/mdc-progress-bar/mdc-progress-bar_public_index.mjs +0 -5
- package/esm2020/mdc-progress-bar/module.mjs +0 -24
- package/esm2020/mdc-progress-bar/progress-bar.mjs +0 -152
- package/esm2020/mdc-progress-bar/public-api.mjs +0 -11
- package/esm2020/mdc-progress-bar/testing/index.mjs +0 -9
- package/esm2020/mdc-progress-bar/testing/progress-bar-harness.mjs +0 -33
- package/esm2020/mdc-progress-bar/testing/public-api.mjs +0 -9
- package/esm2020/mdc-progress-bar/testing/testing_public_index.mjs +0 -5
- package/esm2020/mdc-progress-spinner/index.mjs +0 -9
- package/esm2020/mdc-progress-spinner/mdc-progress-spinner_public_index.mjs +0 -5
- package/esm2020/mdc-progress-spinner/module.mjs +0 -26
- package/esm2020/mdc-progress-spinner/progress-spinner.mjs +0 -151
- package/esm2020/mdc-progress-spinner/public-api.mjs +0 -11
- package/esm2020/mdc-progress-spinner/testing/index.mjs +0 -9
- package/esm2020/mdc-progress-spinner/testing/progress-spinner-harness.mjs +0 -35
- package/esm2020/mdc-progress-spinner/testing/public-api.mjs +0 -9
- package/esm2020/mdc-progress-spinner/testing/testing_public_index.mjs +0 -5
- package/esm2020/mdc-radio/index.mjs +0 -9
- package/esm2020/mdc-radio/mdc-radio_public_index.mjs +0 -5
- package/esm2020/mdc-radio/module.mjs +0 -26
- package/esm2020/mdc-radio/public-api.mjs +0 -11
- package/esm2020/mdc-radio/radio.mjs +0 -111
- package/esm2020/mdc-radio/testing/index.mjs +0 -9
- package/esm2020/mdc-radio/testing/public-api.mjs +0 -9
- package/esm2020/mdc-radio/testing/radio-harness.mjs +0 -50
- package/esm2020/mdc-select/index.mjs +0 -9
- package/esm2020/mdc-select/mdc-select_public_index.mjs +0 -5
- package/esm2020/mdc-select/module.mjs +0 -46
- package/esm2020/mdc-select/public-api.mjs +0 -12
- package/esm2020/mdc-select/select-animations.mjs +0 -38
- package/esm2020/mdc-select/select-errors.mjs +0 -35
- package/esm2020/mdc-select/select.mjs +0 -172
- package/esm2020/mdc-select/testing/index.mjs +0 -9
- package/esm2020/mdc-select/testing/public-api.mjs +0 -10
- package/esm2020/mdc-select/testing/select-harness-filters.mjs +0 -9
- package/esm2020/mdc-select/testing/select-harness.mjs +0 -29
- package/esm2020/mdc-slide-toggle/index.mjs +0 -9
- package/esm2020/mdc-slide-toggle/mdc-slide-toggle_public_index.mjs +0 -5
- package/esm2020/mdc-slide-toggle/module.mjs +0 -27
- package/esm2020/mdc-slide-toggle/public-api.mjs +0 -12
- package/esm2020/mdc-slide-toggle/slide-toggle-config.mjs +0 -14
- package/esm2020/mdc-slide-toggle/slide-toggle.mjs +0 -99
- package/esm2020/mdc-slide-toggle/testing/index.mjs +0 -9
- package/esm2020/mdc-slide-toggle/testing/public-api.mjs +0 -9
- package/esm2020/mdc-slide-toggle/testing/slide-toggle-harness.mjs +0 -47
- package/esm2020/mdc-slider/global-change-and-input-listener.mjs +0 -59
- package/esm2020/mdc-slider/index.mjs +0 -9
- package/esm2020/mdc-slider/mdc-slider_public_index.mjs +0 -5
- package/esm2020/mdc-slider/module.mjs +0 -26
- package/esm2020/mdc-slider/public-api.mjs +0 -10
- package/esm2020/mdc-slider/slider.mjs +0 -1094
- package/esm2020/mdc-slider/testing/index.mjs +0 -9
- package/esm2020/mdc-slider/testing/public-api.mjs +0 -11
- package/esm2020/mdc-slider/testing/slider-harness-filters.mjs +0 -2
- package/esm2020/mdc-slider/testing/slider-harness.mjs +0 -62
- package/esm2020/mdc-slider/testing/slider-thumb-harness.mjs +0 -94
- package/esm2020/mdc-snack-bar/index.mjs +0 -9
- package/esm2020/mdc-snack-bar/mdc-snack-bar_public_index.mjs +0 -5
- package/esm2020/mdc-snack-bar/module.mjs +0 -51
- package/esm2020/mdc-snack-bar/public-api.mjs +0 -14
- package/esm2020/mdc-snack-bar/simple-snack-bar.mjs +0 -40
- package/esm2020/mdc-snack-bar/snack-bar-container.mjs +0 -41
- package/esm2020/mdc-snack-bar/snack-bar-content.mjs +0 -52
- package/esm2020/mdc-snack-bar/snack-bar.mjs +0 -45
- package/esm2020/mdc-snack-bar/testing/index.mjs +0 -9
- package/esm2020/mdc-snack-bar/testing/public-api.mjs +0 -9
- package/esm2020/mdc-snack-bar/testing/snack-bar-harness.mjs +0 -34
- package/esm2020/mdc-table/cell.mjs +0 -141
- package/esm2020/mdc-table/index.mjs +0 -9
- package/esm2020/mdc-table/mdc-table_public_index.mjs +0 -5
- package/esm2020/mdc-table/module.mjs +0 -94
- package/esm2020/mdc-table/public-api.mjs +0 -14
- package/esm2020/mdc-table/row.mjs +0 -143
- package/esm2020/mdc-table/table-data-source.mjs +0 -24
- package/esm2020/mdc-table/table.mjs +0 -74
- package/esm2020/mdc-table/testing/cell-harness.mjs +0 -50
- package/esm2020/mdc-table/testing/index.mjs +0 -9
- package/esm2020/mdc-table/testing/public-api.mjs +0 -11
- package/esm2020/mdc-table/testing/row-harness.mjs +0 -64
- package/esm2020/mdc-table/testing/table-harness.mjs +0 -30
- package/esm2020/mdc-table/text-column.mjs +0 -58
- package/esm2020/mdc-tabs/index.mjs +0 -9
- package/esm2020/mdc-tabs/ink-bar.mjs +0 -130
- package/esm2020/mdc-tabs/mdc-tabs_public_index.mjs +0 -5
- package/esm2020/mdc-tabs/module.mjs +0 -93
- package/esm2020/mdc-tabs/public-api.mjs +0 -19
- package/esm2020/mdc-tabs/tab-body.mjs +0 -60
- package/esm2020/mdc-tabs/tab-content.mjs +0 -20
- package/esm2020/mdc-tabs/tab-group.mjs +0 -98
- package/esm2020/mdc-tabs/tab-header.mjs +0 -73
- package/esm2020/mdc-tabs/tab-label-wrapper.mjs +0 -32
- package/esm2020/mdc-tabs/tab-label.mjs +0 -22
- package/esm2020/mdc-tabs/tab-nav-bar/tab-nav-bar.mjs +0 -202
- package/esm2020/mdc-tabs/tab.mjs +0 -34
- package/esm2020/mdc-tabs/testing/index.mjs +0 -9
- package/esm2020/mdc-tabs/testing/public-api.mjs +0 -13
- package/esm2020/mdc-tabs/testing/tab-group-harness.mjs +0 -56
- package/esm2020/mdc-tabs/testing/tab-harness-filters.mjs +0 -2
- package/esm2020/mdc-tabs/testing/tab-harness.mjs +0 -64
- package/esm2020/mdc-tabs/testing/tab-link-harness.mjs +0 -40
- package/esm2020/mdc-tabs/testing/tab-nav-bar-harness.mjs +0 -66
- package/esm2020/mdc-tabs/testing/tab-nav-panel-harness.mjs +0 -27
- package/esm2020/mdc-tooltip/index.mjs +0 -9
- package/esm2020/mdc-tooltip/mdc-tooltip_public_index.mjs +0 -5
- package/esm2020/mdc-tooltip/module.mjs +0 -31
- package/esm2020/mdc-tooltip/public-api.mjs +0 -12
- package/esm2020/mdc-tooltip/testing/index.mjs +0 -9
- package/esm2020/mdc-tooltip/testing/public-api.mjs +0 -9
- package/esm2020/mdc-tooltip/testing/tooltip-harness.mjs +0 -30
- package/esm2020/mdc-tooltip/tooltip-animations.mjs +0 -24
- package/esm2020/mdc-tooltip/tooltip.mjs +0 -132
- package/fesm2015/mdc-autocomplete/testing.mjs +0 -50
- package/fesm2015/mdc-autocomplete/testing.mjs.map +0 -1
- package/fesm2015/mdc-autocomplete.mjs +0 -196
- package/fesm2015/mdc-autocomplete.mjs.map +0 -1
- package/fesm2015/mdc-button/testing.mjs +0 -75
- package/fesm2015/mdc-button/testing.mjs.map +0 -1
- package/fesm2015/mdc-button.mjs +0 -490
- package/fesm2015/mdc-button.mjs.map +0 -1
- package/fesm2015/mdc-card/testing.mjs +0 -63
- package/fesm2015/mdc-card/testing.mjs.map +0 -1
- package/fesm2015/mdc-card.mjs +0 -351
- package/fesm2015/mdc-card.mjs.map +0 -1
- package/fesm2015/mdc-checkbox/testing.mjs +0 -56
- package/fesm2015/mdc-checkbox/testing.mjs.map +0 -1
- package/fesm2015/mdc-checkbox.mjs +0 -142
- package/fesm2015/mdc-checkbox.mjs.map +0 -1
- package/fesm2015/mdc-chips/testing.mjs +0 -394
- package/fesm2015/mdc-chips/testing.mjs.map +0 -1
- package/fesm2015/mdc-chips.mjs +0 -2169
- package/fesm2015/mdc-chips.mjs.map +0 -1
- package/fesm2015/mdc-core/testing.mjs +0 -118
- package/fesm2015/mdc-core/testing.mjs.map +0 -1
- package/fesm2015/mdc-core.mjs +0 -141
- package/fesm2015/mdc-core.mjs.map +0 -1
- package/fesm2015/mdc-dialog/testing.mjs +0 -90
- package/fesm2015/mdc-dialog/testing.mjs.map +0 -1
- package/fesm2015/mdc-dialog.mjs +0 -500
- package/fesm2015/mdc-dialog.mjs.map +0 -1
- package/fesm2015/mdc-form-field/testing.mjs +0 -78
- package/fesm2015/mdc-form-field/testing.mjs.map +0 -1
- package/fesm2015/mdc-form-field.mjs +0 -1018
- package/fesm2015/mdc-form-field.mjs.map +0 -1
- package/fesm2015/mdc-input/testing.mjs +0 -18
- package/fesm2015/mdc-input/testing.mjs.map +0 -1
- package/fesm2015/mdc-input.mjs +0 -103
- package/fesm2015/mdc-input.mjs.map +0 -1
- package/fesm2015/mdc-list/testing.mjs +0 -574
- package/fesm2015/mdc-list/testing.mjs.map +0 -1
- package/fesm2015/mdc-list.mjs +0 -1264
- package/fesm2015/mdc-list.mjs.map +0 -1
- package/fesm2015/mdc-menu/testing.mjs +0 -59
- package/fesm2015/mdc-menu/testing.mjs.map +0 -1
- package/fesm2015/mdc-menu.mjs +0 -174
- package/fesm2015/mdc-menu.mjs.map +0 -1
- package/fesm2015/mdc-paginator/testing.mjs +0 -55
- package/fesm2015/mdc-paginator/testing.mjs.map +0 -1
- package/fesm2015/mdc-paginator.mjs +0 -100
- package/fesm2015/mdc-paginator.mjs.map +0 -1
- package/fesm2015/mdc-progress-bar/testing.mjs +0 -54
- package/fesm2015/mdc-progress-bar/testing.mjs.map +0 -1
- package/fesm2015/mdc-progress-bar.mjs +0 -198
- package/fesm2015/mdc-progress-bar.mjs.map +0 -1
- package/fesm2015/mdc-progress-spinner/testing.mjs +0 -56
- package/fesm2015/mdc-progress-spinner/testing.mjs.map +0 -1
- package/fesm2015/mdc-progress-spinner.mjs +0 -200
- package/fesm2015/mdc-progress-spinner.mjs.map +0 -1
- package/fesm2015/mdc-radio/testing.mjs +0 -63
- package/fesm2015/mdc-radio/testing.mjs.map +0 -1
- package/fesm2015/mdc-radio.mjs +0 -155
- package/fesm2015/mdc-radio.mjs.map +0 -1
- package/fesm2015/mdc-select/testing.mjs +0 -48
- package/fesm2015/mdc-select/testing.mjs.map +0 -1
- package/fesm2015/mdc-select.mjs +0 -273
- package/fesm2015/mdc-select.mjs.map +0 -1
- package/fesm2015/mdc-slide-toggle/testing.mjs +0 -66
- package/fesm2015/mdc-slide-toggle/testing.mjs.map +0 -1
- package/fesm2015/mdc-slide-toggle.mjs +0 -159
- package/fesm2015/mdc-slide-toggle.mjs.map +0 -1
- package/fesm2015/mdc-slider/testing.mjs +0 -199
- package/fesm2015/mdc-slider/testing.mjs.map +0 -1
- package/fesm2015/mdc-slider.mjs +0 -1212
- package/fesm2015/mdc-slider.mjs.map +0 -1
- package/fesm2015/mdc-snack-bar/testing.mjs +0 -49
- package/fesm2015/mdc-snack-bar/testing.mjs.map +0 -1
- package/fesm2015/mdc-snack-bar.mjs +0 -229
- package/fesm2015/mdc-snack-bar.mjs.map +0 -1
- package/fesm2015/mdc-table/testing.mjs +0 -158
- package/fesm2015/mdc-table/testing.mjs.map +0 -1
- package/fesm2015/mdc-table.mjs +0 -540
- package/fesm2015/mdc-table.mjs.map +0 -1
- package/fesm2015/mdc-tabs/testing.mjs +0 -273
- package/fesm2015/mdc-tabs/testing.mjs.map +0 -1
- package/fesm2015/mdc-tabs.mjs +0 -737
- package/fesm2015/mdc-tabs.mjs.map +0 -1
- package/fesm2015/mdc-tooltip/testing.mjs +0 -49
- package/fesm2015/mdc-tooltip/testing.mjs.map +0 -1
- package/fesm2015/mdc-tooltip.mjs +0 -206
- package/fesm2015/mdc-tooltip.mjs.map +0 -1
- package/fesm2020/mdc-autocomplete/testing.mjs +0 -58
- package/fesm2020/mdc-autocomplete/testing.mjs.map +0 -1
- package/fesm2020/mdc-autocomplete.mjs +0 -196
- package/fesm2020/mdc-autocomplete.mjs.map +0 -1
- package/fesm2020/mdc-button/testing.mjs +0 -69
- package/fesm2020/mdc-button/testing.mjs.map +0 -1
- package/fesm2020/mdc-button.mjs +0 -510
- package/fesm2020/mdc-button.mjs.map +0 -1
- package/fesm2020/mdc-card/testing.mjs +0 -69
- package/fesm2020/mdc-card/testing.mjs.map +0 -1
- package/fesm2020/mdc-card.mjs +0 -349
- package/fesm2020/mdc-card.mjs.map +0 -1
- package/fesm2020/mdc-checkbox/testing.mjs +0 -60
- package/fesm2020/mdc-checkbox/testing.mjs.map +0 -1
- package/fesm2020/mdc-checkbox.mjs +0 -139
- package/fesm2020/mdc-checkbox.mjs.map +0 -1
- package/fesm2020/mdc-chips/testing.mjs +0 -395
- package/fesm2020/mdc-chips/testing.mjs.map +0 -1
- package/fesm2020/mdc-chips.mjs +0 -2161
- package/fesm2020/mdc-chips.mjs.map +0 -1
- package/fesm2020/mdc-core/testing.mjs +0 -129
- package/fesm2020/mdc-core/testing.mjs.map +0 -1
- package/fesm2020/mdc-core.mjs +0 -139
- package/fesm2020/mdc-core.mjs.map +0 -1
- package/fesm2020/mdc-dialog/testing.mjs +0 -90
- package/fesm2020/mdc-dialog/testing.mjs.map +0 -1
- package/fesm2020/mdc-dialog.mjs +0 -499
- package/fesm2020/mdc-dialog.mjs.map +0 -1
- package/fesm2020/mdc-form-field/testing.mjs +0 -78
- package/fesm2020/mdc-form-field/testing.mjs.map +0 -1
- package/fesm2020/mdc-form-field.mjs +0 -1014
- package/fesm2020/mdc-form-field.mjs.map +0 -1
- package/fesm2020/mdc-input/testing.mjs +0 -18
- package/fesm2020/mdc-input/testing.mjs.map +0 -1
- package/fesm2020/mdc-input.mjs +0 -103
- package/fesm2020/mdc-input.mjs.map +0 -1
- package/fesm2020/mdc-list/testing.mjs +0 -544
- package/fesm2020/mdc-list/testing.mjs.map +0 -1
- package/fesm2020/mdc-list.mjs +0 -1260
- package/fesm2020/mdc-list.mjs.map +0 -1
- package/fesm2020/mdc-menu/testing.mjs +0 -65
- package/fesm2020/mdc-menu/testing.mjs.map +0 -1
- package/fesm2020/mdc-menu.mjs +0 -172
- package/fesm2020/mdc-menu.mjs.map +0 -1
- package/fesm2020/mdc-paginator/testing.mjs +0 -55
- package/fesm2020/mdc-paginator/testing.mjs.map +0 -1
- package/fesm2020/mdc-paginator.mjs +0 -98
- package/fesm2020/mdc-paginator.mjs.map +0 -1
- package/fesm2020/mdc-progress-bar/testing.mjs +0 -56
- package/fesm2020/mdc-progress-bar/testing.mjs.map +0 -1
- package/fesm2020/mdc-progress-bar.mjs +0 -196
- package/fesm2020/mdc-progress-bar.mjs.map +0 -1
- package/fesm2020/mdc-progress-spinner/testing.mjs +0 -58
- package/fesm2020/mdc-progress-spinner/testing.mjs.map +0 -1
- package/fesm2020/mdc-progress-spinner.mjs +0 -197
- package/fesm2020/mdc-progress-spinner.mjs.map +0 -1
- package/fesm2020/mdc-radio/testing.mjs +0 -69
- package/fesm2020/mdc-radio/testing.mjs.map +0 -1
- package/fesm2020/mdc-radio.mjs +0 -153
- package/fesm2020/mdc-radio.mjs.map +0 -1
- package/fesm2020/mdc-select/testing.mjs +0 -56
- package/fesm2020/mdc-select/testing.mjs.map +0 -1
- package/fesm2020/mdc-select.mjs +0 -273
- package/fesm2020/mdc-select.mjs.map +0 -1
- package/fesm2020/mdc-slide-toggle/testing.mjs +0 -66
- package/fesm2020/mdc-slide-toggle/testing.mjs.map +0 -1
- package/fesm2020/mdc-slide-toggle.mjs +0 -157
- package/fesm2020/mdc-slide-toggle.mjs.map +0 -1
- package/fesm2020/mdc-slider/testing.mjs +0 -172
- package/fesm2020/mdc-slider/testing.mjs.map +0 -1
- package/fesm2020/mdc-slider.mjs +0 -1191
- package/fesm2020/mdc-slider.mjs.map +0 -1
- package/fesm2020/mdc-snack-bar/testing.mjs +0 -53
- package/fesm2020/mdc-snack-bar/testing.mjs.map +0 -1
- package/fesm2020/mdc-snack-bar.mjs +0 -232
- package/fesm2020/mdc-snack-bar.mjs.map +0 -1
- package/fesm2020/mdc-table/testing.mjs +0 -158
- package/fesm2020/mdc-table/testing.mjs.map +0 -1
- package/fesm2020/mdc-table.mjs +0 -539
- package/fesm2020/mdc-table.mjs.map +0 -1
- package/fesm2020/mdc-tabs/testing.mjs +0 -265
- package/fesm2020/mdc-tabs/testing.mjs.map +0 -1
- package/fesm2020/mdc-tabs.mjs +0 -723
- package/fesm2020/mdc-tabs.mjs.map +0 -1
- package/fesm2020/mdc-tooltip/testing.mjs +0 -49
- package/fesm2020/mdc-tooltip/testing.mjs.map +0 -1
- package/fesm2020/mdc-tooltip.mjs +0 -202
- package/fesm2020/mdc-tooltip.mjs.map +0 -1
- package/mdc-autocomplete/_autocomplete-theme.import.scss +0 -5
- package/mdc-autocomplete/_autocomplete-theme.scss +0 -48
- package/mdc-autocomplete/index.d.ts +0 -97
- package/mdc-autocomplete/testing/index.d.ts +0 -32
- package/mdc-button/_button-base.import.scss +0 -4
- package/mdc-button/_button-base.scss +0 -95
- package/mdc-button/_button-theme-private.scss +0 -62
- package/mdc-button/_button-theme.import.scss +0 -16
- package/mdc-button/_button-theme.scss +0 -224
- package/mdc-button/_fab-theme.scss +0 -90
- package/mdc-button/_icon-button-theme.scss +0 -76
- package/mdc-button/index.d.ts +0 -216
- package/mdc-button/testing/index.d.ts +0 -41
- package/mdc-card/_card-theme.import.scss +0 -7
- package/mdc-card/_card-theme.scss +0 -74
- package/mdc-card/index.d.ts +0 -194
- package/mdc-card/testing/index.d.ts +0 -44
- package/mdc-checkbox/_checkbox-private.scss +0 -53
- package/mdc-checkbox/_checkbox-theme.import.scss +0 -15
- package/mdc-checkbox/_checkbox-theme.scss +0 -122
- package/mdc-checkbox/index.d.ts +0 -87
- package/mdc-checkbox/testing/index.d.ts +0 -28
- package/mdc-chips/_chips-theme.import.scss +0 -8
- package/mdc-chips/_chips-theme.scss +0 -117
- package/mdc-chips/index.d.ts +0 -979
- package/mdc-chips/testing/index.d.ts +0 -232
- package/mdc-core/_core-theme.import.scss +0 -10
- package/mdc-core/_core-theme.scss +0 -78
- package/mdc-core/_elevation.scss +0 -38
- package/mdc-core/color/_all-color.scss +0 -25
- package/mdc-core/density/_all-density.scss +0 -25
- package/mdc-core/index.d.ts +0 -206
- package/mdc-core/mdc-helpers/_focus-indicators-theme.scss +0 -39
- package/mdc-core/mdc-helpers/_focus-indicators.import.scss +0 -10
- package/mdc-core/mdc-helpers/_focus-indicators.scss +0 -15
- package/mdc-core/mdc-helpers/_mdc-helpers.import.scss +0 -8
- package/mdc-core/mdc-helpers/_mdc-helpers.scss +0 -221
- package/mdc-core/option/_optgroup-theme.import.scss +0 -7
- package/mdc-core/option/_optgroup-theme.scss +0 -44
- package/mdc-core/option/_option-theme.import.scss +0 -7
- package/mdc-core/option/_option-theme.scss +0 -87
- package/mdc-core/testing/index.d.ts +0 -64
- package/mdc-core/theming/_all-theme.scss +0 -61
- package/mdc-core/theming/prebuilt/deeppurple-amber.css +0 -1
- package/mdc-core/theming/prebuilt/indigo-pink.css +0 -1
- package/mdc-core/theming/prebuilt/pink-bluegrey.css +0 -1
- package/mdc-core/theming/prebuilt/purple-green.css +0 -1
- package/mdc-core/typography/_all-typography.scss +0 -99
- package/mdc-dialog/_dialog-legacy-padding.import.scss +0 -1
- package/mdc-dialog/_dialog-legacy-padding.scss +0 -31
- package/mdc-dialog/_dialog-theme.import.scss +0 -5
- package/mdc-dialog/_dialog-theme.scss +0 -78
- package/mdc-dialog/_mdc-dialog-structure-overrides.import.scss +0 -1
- package/mdc-dialog/_mdc-dialog-structure-overrides.scss +0 -56
- package/mdc-dialog/index.d.ts +0 -217
- package/mdc-dialog/testing/index.d.ts +0 -47
- package/mdc-form-field/_form-field-density.scss +0 -119
- package/mdc-form-field/_form-field-focus-overlay.scss +0 -34
- package/mdc-form-field/_form-field-high-contrast.scss +0 -39
- package/mdc-form-field/_form-field-native-select.scss +0 -133
- package/mdc-form-field/_form-field-sizing.scss +0 -40
- package/mdc-form-field/_form-field-subscript.scss +0 -83
- package/mdc-form-field/_form-field-theme.scss +0 -148
- package/mdc-form-field/_mdc-text-field-structure-overrides.scss +0 -129
- package/mdc-form-field/_mdc-text-field-textarea-overrides.scss +0 -36
- package/mdc-form-field/_mdc-text-field-theme-variable-refresh.scss +0 -63
- package/mdc-form-field/index.d.ts +0 -431
- package/mdc-form-field/testing/index.d.ts +0 -48
- package/mdc-input/_input-theme.import.scss +0 -5
- package/mdc-input/_input-theme.scss +0 -35
- package/mdc-input/index.d.ts +0 -30
- package/mdc-input/testing/index.d.ts +0 -20
- package/mdc-list/_interactive-list-theme.import.scss +0 -5
- package/mdc-list/_interactive-list-theme.scss +0 -40
- package/mdc-list/_list-option-theme.import.scss +0 -13
- package/mdc-list/_list-option-theme.scss +0 -28
- package/mdc-list/_list-option-trailing-avatar-compat.scss +0 -58
- package/mdc-list/_list-theme.import.scss +0 -17
- package/mdc-list/_list-theme.scss +0 -81
- package/mdc-list/index.d.ts +0 -534
- package/mdc-list/testing/index.d.ts +0 -372
- package/mdc-menu/_menu-theme.import.scss +0 -5
- package/mdc-menu/_menu-theme.scss +0 -88
- package/mdc-menu/index.d.ts +0 -110
- package/mdc-menu/testing/index.d.ts +0 -38
- package/mdc-paginator/_paginator-theme.import.scss +0 -9
- package/mdc-paginator/_paginator-theme.scss +0 -106
- package/mdc-paginator/_paginator-variables.import.scss +0 -1
- package/mdc-paginator/_paginator-variables.scss +0 -13
- package/mdc-paginator/index.d.ts +0 -72
- package/mdc-paginator/testing/index.d.ts +0 -30
- package/mdc-progress-bar/_progress-bar-theme.import.scss +0 -6
- package/mdc-progress-bar/_progress-bar-theme.scss +0 -57
- package/mdc-progress-bar/index.d.ts +0 -98
- package/mdc-progress-bar/testing/index.d.ts +0 -24
- package/mdc-progress-spinner/_progress-spinner-theme.import.scss +0 -6
- package/mdc-progress-spinner/_progress-spinner-theme.scss +0 -48
- package/mdc-progress-spinner/index.d.ts +0 -90
- package/mdc-progress-spinner/testing/index.d.ts +0 -26
- package/mdc-radio/_radio-theme.import.scss +0 -7
- package/mdc-radio/_radio-theme.scss +0 -110
- package/mdc-radio/index.d.ts +0 -72
- package/mdc-radio/testing/index.d.ts +0 -43
- package/mdc-select/_select-theme.import.scss +0 -10
- package/mdc-select/_select-theme.scss +0 -100
- package/mdc-select/index.d.ts +0 -111
- package/mdc-select/testing/index.d.ts +0 -28
- package/mdc-slide-toggle/_slide-toggle-theme.import.scss +0 -11
- package/mdc-slide-toggle/_slide-toggle-theme.scss +0 -140
- package/mdc-slide-toggle/index.d.ts +0 -83
- package/mdc-slide-toggle/testing/index.d.ts +0 -27
- package/mdc-slider/_slider-theme.import.scss +0 -5
- package/mdc-slider/_slider-theme.scss +0 -125
- package/mdc-slider/index.d.ts +0 -435
- package/mdc-slider/testing/index.d.ts +0 -92
- package/mdc-snack-bar/_snack-bar-theme.import.scss +0 -8
- package/mdc-snack-bar/_snack-bar-theme.scss +0 -81
- package/mdc-snack-bar/index.d.ts +0 -136
- package/mdc-snack-bar/testing/index.d.ts +0 -23
- package/mdc-table/_table-theme.import.scss +0 -11
- package/mdc-table/_table-theme.scss +0 -78
- package/mdc-table/index.d.ts +0 -238
- package/mdc-table/testing/index.d.ts +0 -118
- package/mdc-tabs/_tabs-common.import.scss +0 -14
- package/mdc-tabs/_tabs-common.scss +0 -196
- package/mdc-tabs/_tabs-theme.import.scss +0 -8
- package/mdc-tabs/_tabs-theme.scss +0 -146
- package/mdc-tabs/index.d.ts +0 -307
- package/mdc-tabs/testing/index.d.ts +0 -151
- package/mdc-tooltip/_tooltip-theme.import.scss +0 -5
- package/mdc-tooltip/_tooltip-theme.scss +0 -49
- package/mdc-tooltip/index.d.ts +0 -118
- package/mdc-tooltip/testing/index.d.ts +0 -26
package/fesm2015/mdc-slider.mjs
DELETED
|
@@ -1,1212 +0,0 @@
|
|
|
1
|
-
import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
|
-
import * as i3 from '@angular/cdk/platform';
|
|
3
|
-
import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
|
|
4
|
-
import * as i1 from '@angular/common';
|
|
5
|
-
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
6
|
-
import * as i0 from '@angular/core';
|
|
7
|
-
import { Injectable, Inject, forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ViewChild, EventEmitter, Directive, Output, Optional, ViewChildren, ContentChildren, NgModule } from '@angular/core';
|
|
8
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
|
-
import { MatRipple, mixinColor, mixinDisableRipple, MAT_RIPPLE_GLOBAL_OPTIONS } from '@angular/material/core';
|
|
10
|
-
import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
|
|
11
|
-
import { Thumb, MDCSliderFoundation, TickMark } from '@material/slider';
|
|
12
|
-
import { Subject, fromEvent, Subscription } from 'rxjs';
|
|
13
|
-
import * as i2 from '@angular/material-experimental/mdc-core';
|
|
14
|
-
import { MatCommonModule, MatRippleModule } from '@angular/material-experimental/mdc-core';
|
|
15
|
-
import { takeUntil, finalize, share } from 'rxjs/operators';
|
|
16
|
-
import * as i5 from '@angular/cdk/bidi';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @license
|
|
20
|
-
* Copyright Google LLC All Rights Reserved.
|
|
21
|
-
*
|
|
22
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
23
|
-
* found in the LICENSE file at https://angular.io/license
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* Handles listening for all change and input events that occur on the document.
|
|
27
|
-
*
|
|
28
|
-
* This service exposes a single method #listen to allow users to subscribe to change and input
|
|
29
|
-
* events that occur on the document. Since listening for these events can be expensive, we use
|
|
30
|
-
* #fromEvent which will lazily attach a listener when the first subscription is made and remove the
|
|
31
|
-
* listener once the last observer unsubscribes.
|
|
32
|
-
*/
|
|
33
|
-
class GlobalChangeAndInputListener {
|
|
34
|
-
constructor(document, _ngZone) {
|
|
35
|
-
this._ngZone = _ngZone;
|
|
36
|
-
/** Stores the subjects that emit the events that occur on the global document. */
|
|
37
|
-
this._observables = new Map();
|
|
38
|
-
/** The notifier that triggers the global event observables to stop emitting and complete. */
|
|
39
|
-
this._destroyed = new Subject();
|
|
40
|
-
this._document = document;
|
|
41
|
-
}
|
|
42
|
-
ngOnDestroy() {
|
|
43
|
-
this._destroyed.next();
|
|
44
|
-
this._destroyed.complete();
|
|
45
|
-
this._observables.clear();
|
|
46
|
-
}
|
|
47
|
-
/** Returns a subscription to global change or input events. */
|
|
48
|
-
listen(type, callback) {
|
|
49
|
-
// If this is the first time we are listening to this event, create the observable for it.
|
|
50
|
-
if (!this._observables.has(type)) {
|
|
51
|
-
this._observables.set(type, this._createGlobalEventObservable(type));
|
|
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: "14.2.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: "14.2.0", ngImport: i0, type: GlobalChangeAndInputListener, providedIn: 'root' });
|
|
64
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: GlobalChangeAndInputListener, decorators: [{
|
|
65
|
-
type: Injectable,
|
|
66
|
-
args: [{ providedIn: 'root' }]
|
|
67
|
-
}], ctorParameters: function () {
|
|
68
|
-
return [{ type: undefined, decorators: [{
|
|
69
|
-
type: Inject,
|
|
70
|
-
args: [DOCUMENT]
|
|
71
|
-
}] }, { type: i0.NgZone }];
|
|
72
|
-
} });
|
|
73
|
-
|
|
74
|
-
/** Options used to bind passive event listeners. */
|
|
75
|
-
const passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
76
|
-
/**
|
|
77
|
-
* The visual slider thumb.
|
|
78
|
-
*
|
|
79
|
-
* Handles the slider thumb ripple states (hover, focus, and active),
|
|
80
|
-
* and displaying the value tooltip on discrete sliders.
|
|
81
|
-
* @docs-private
|
|
82
|
-
*/
|
|
83
|
-
class MatSliderVisualThumb {
|
|
84
|
-
constructor(_ngZone, _slider, _elementRef) {
|
|
85
|
-
this._ngZone = _ngZone;
|
|
86
|
-
this._slider = _slider;
|
|
87
|
-
this._elementRef = _elementRef;
|
|
88
|
-
/** Whether ripples on the slider thumb should be disabled. */
|
|
89
|
-
this.disableRipple = false;
|
|
90
|
-
/** Whether the slider thumb is currently being pressed. */
|
|
91
|
-
this._isActive = false;
|
|
92
|
-
/** Whether the slider thumb is currently being hovered. */
|
|
93
|
-
this._isHovered = false;
|
|
94
|
-
this._onMouseEnter = () => {
|
|
95
|
-
this._isHovered = true;
|
|
96
|
-
// We don't want to show the hover ripple on top of the focus ripple.
|
|
97
|
-
// This can happen if the user tabs to a thumb and then the user moves their cursor over it.
|
|
98
|
-
if (!this._isShowingRipple(this._focusRippleRef)) {
|
|
99
|
-
this._showHoverRipple();
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
this._onMouseLeave = () => {
|
|
103
|
-
var _a;
|
|
104
|
-
this._isHovered = false;
|
|
105
|
-
(_a = this._hoverRippleRef) === null || _a === void 0 ? void 0 : _a.fadeOut();
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
ngAfterViewInit() {
|
|
109
|
-
this._ripple.radius = 24;
|
|
110
|
-
this._sliderInput = this._slider._getInput(this.thumbPosition);
|
|
111
|
-
// Note that we don't unsubscribe from these, because they're complete on destroy.
|
|
112
|
-
this._sliderInput.dragStart.subscribe(event => this._onDragStart(event));
|
|
113
|
-
this._sliderInput.dragEnd.subscribe(event => this._onDragEnd(event));
|
|
114
|
-
this._sliderInput._focus.subscribe(() => this._onFocus());
|
|
115
|
-
this._sliderInput._blur.subscribe(() => this._onBlur());
|
|
116
|
-
// These two listeners don't update any data bindings so we bind them
|
|
117
|
-
// outside of the NgZone to prevent Angular from needlessly running change detection.
|
|
118
|
-
this._ngZone.runOutsideAngular(() => {
|
|
119
|
-
this._elementRef.nativeElement.addEventListener('mouseenter', this._onMouseEnter);
|
|
120
|
-
this._elementRef.nativeElement.addEventListener('mouseleave', this._onMouseLeave);
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
ngOnDestroy() {
|
|
124
|
-
this._elementRef.nativeElement.removeEventListener('mouseenter', this._onMouseEnter);
|
|
125
|
-
this._elementRef.nativeElement.removeEventListener('mouseleave', this._onMouseLeave);
|
|
126
|
-
}
|
|
127
|
-
/** Used to append a class to indicate when the value indicator text is short. */
|
|
128
|
-
_isShortValue() {
|
|
129
|
-
var _a;
|
|
130
|
-
return ((_a = this.valueIndicatorText) === null || _a === void 0 ? void 0 : _a.length) <= 2;
|
|
131
|
-
}
|
|
132
|
-
_onFocus() {
|
|
133
|
-
var _a;
|
|
134
|
-
// We don't want to show the hover ripple on top of the focus ripple.
|
|
135
|
-
// Happen when the users cursor is over a thumb and then the user tabs to it.
|
|
136
|
-
(_a = this._hoverRippleRef) === null || _a === void 0 ? void 0 : _a.fadeOut();
|
|
137
|
-
this._showFocusRipple();
|
|
138
|
-
}
|
|
139
|
-
_onBlur() {
|
|
140
|
-
var _a;
|
|
141
|
-
// Happens when the user tabs away while still dragging a thumb.
|
|
142
|
-
if (!this._isActive) {
|
|
143
|
-
(_a = this._focusRippleRef) === null || _a === void 0 ? void 0 : _a.fadeOut();
|
|
144
|
-
}
|
|
145
|
-
// Happens when the user tabs away from a thumb but their cursor is still over it.
|
|
146
|
-
if (this._isHovered) {
|
|
147
|
-
this._showHoverRipple();
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
_onDragStart(event) {
|
|
151
|
-
if (event.source._thumbPosition === this.thumbPosition) {
|
|
152
|
-
this._isActive = true;
|
|
153
|
-
this._showActiveRipple();
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
_onDragEnd(event) {
|
|
157
|
-
var _a, _b;
|
|
158
|
-
if (event.source._thumbPosition === this.thumbPosition) {
|
|
159
|
-
this._isActive = false;
|
|
160
|
-
(_a = this._activeRippleRef) === null || _a === void 0 ? void 0 : _a.fadeOut();
|
|
161
|
-
// Happens when the user starts dragging a thumb, tabs away, and then stops dragging.
|
|
162
|
-
if (!this._sliderInput._isFocused()) {
|
|
163
|
-
(_b = this._focusRippleRef) === null || _b === void 0 ? void 0 : _b.fadeOut();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
/** Handles displaying the hover ripple. */
|
|
168
|
-
_showHoverRipple() {
|
|
169
|
-
var _a;
|
|
170
|
-
if (!this._isShowingRipple(this._hoverRippleRef)) {
|
|
171
|
-
this._hoverRippleRef = this._showRipple({ enterDuration: 0, exitDuration: 0 });
|
|
172
|
-
(_a = this._hoverRippleRef) === null || _a === void 0 ? void 0 : _a.element.classList.add('mat-mdc-slider-hover-ripple');
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
/** Handles displaying the focus ripple. */
|
|
176
|
-
_showFocusRipple() {
|
|
177
|
-
var _a;
|
|
178
|
-
// Show the focus ripple event if noop animations are enabled.
|
|
179
|
-
if (!this._isShowingRipple(this._focusRippleRef)) {
|
|
180
|
-
this._focusRippleRef = this._showRipple({ enterDuration: 0, exitDuration: 0 });
|
|
181
|
-
(_a = this._focusRippleRef) === null || _a === void 0 ? void 0 : _a.element.classList.add('mat-mdc-slider-focus-ripple');
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
/** Handles displaying the active ripple. */
|
|
185
|
-
_showActiveRipple() {
|
|
186
|
-
var _a;
|
|
187
|
-
if (!this._isShowingRipple(this._activeRippleRef)) {
|
|
188
|
-
this._activeRippleRef = this._showRipple({ enterDuration: 225, exitDuration: 400 });
|
|
189
|
-
(_a = this._activeRippleRef) === null || _a === void 0 ? void 0 : _a.element.classList.add('mat-mdc-slider-active-ripple');
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
/** Whether the given rippleRef is currently fading in or visible. */
|
|
193
|
-
_isShowingRipple(rippleRef) {
|
|
194
|
-
return (rippleRef === null || rippleRef === void 0 ? void 0 : rippleRef.state) === 0 /* RippleState.FADING_IN */ || (rippleRef === null || rippleRef === void 0 ? void 0 : rippleRef.state) === 1 /* RippleState.VISIBLE */;
|
|
195
|
-
}
|
|
196
|
-
/** Manually launches the slider thumb ripple using the specified ripple animation config. */
|
|
197
|
-
_showRipple(animation) {
|
|
198
|
-
if (this.disableRipple) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
return this._ripple.launch({
|
|
202
|
-
animation: this._slider._noopAnimations ? { enterDuration: 0, exitDuration: 0 } : animation,
|
|
203
|
-
centered: true,
|
|
204
|
-
persistent: true,
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
/** Gets the hosts native HTML element. */
|
|
208
|
-
_getHostElement() {
|
|
209
|
-
return this._elementRef.nativeElement;
|
|
210
|
-
}
|
|
211
|
-
/** Gets the native HTML element of the slider thumb knob. */
|
|
212
|
-
_getKnob() {
|
|
213
|
-
return this._knob.nativeElement;
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Gets the native HTML element of the slider thumb value indicator
|
|
217
|
-
* container.
|
|
218
|
-
*/
|
|
219
|
-
_getValueIndicatorContainer() {
|
|
220
|
-
return this._valueIndicatorContainer.nativeElement;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
MatSliderVisualThumb.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MatSliderVisualThumb, deps: [{ token: i0.NgZone }, { token: forwardRef(() => MatSlider) }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
224
|
-
MatSliderVisualThumb.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MatSliderVisualThumb, selector: "mat-slider-visual-thumb", inputs: { discrete: "discrete", thumbPosition: "thumbPosition", valueIndicatorText: "valueIndicatorText", disableRipple: "disableRipple" }, host: { properties: { "class.mdc-slider__thumb--short-value": "_isShortValue()" }, classAttribute: "mdc-slider__thumb mat-mdc-slider-visual-thumb" }, 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\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%}"], dependencies: [{ kind: "directive", type: i1.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 });
|
|
225
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MatSliderVisualThumb, decorators: [{
|
|
226
|
-
type: Component,
|
|
227
|
-
args: [{ selector: 'mat-slider-visual-thumb', host: {
|
|
228
|
-
'class': 'mdc-slider__thumb mat-mdc-slider-visual-thumb',
|
|
229
|
-
// NOTE: This class is used internally.
|
|
230
|
-
// TODO(wagnermaciel): Remove this once it is handled by the mdc foundation (cl/388828896).
|
|
231
|
-
'[class.mdc-slider__thumb--short-value]': '_isShortValue()',
|
|
232
|
-
}, 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%}"] }]
|
|
233
|
-
}], ctorParameters: function () {
|
|
234
|
-
return [{ type: i0.NgZone }, { type: MatSlider, decorators: [{
|
|
235
|
-
type: Inject,
|
|
236
|
-
args: [forwardRef(() => MatSlider)]
|
|
237
|
-
}] }, { type: i0.ElementRef }];
|
|
238
|
-
}, propDecorators: { discrete: [{
|
|
239
|
-
type: Input
|
|
240
|
-
}], thumbPosition: [{
|
|
241
|
-
type: Input
|
|
242
|
-
}], valueIndicatorText: [{
|
|
243
|
-
type: Input
|
|
244
|
-
}], disableRipple: [{
|
|
245
|
-
type: Input
|
|
246
|
-
}], _ripple: [{
|
|
247
|
-
type: ViewChild,
|
|
248
|
-
args: [MatRipple]
|
|
249
|
-
}], _knob: [{
|
|
250
|
-
type: ViewChild,
|
|
251
|
-
args: ['knob']
|
|
252
|
-
}], _valueIndicatorContainer: [{
|
|
253
|
-
type: ViewChild,
|
|
254
|
-
args: ['valueIndicatorContainer']
|
|
255
|
-
}] } });
|
|
256
|
-
/**
|
|
257
|
-
* Directive that adds slider-specific behaviors to an input element inside `<mat-slider>`.
|
|
258
|
-
* Up to two may be placed inside of a `<mat-slider>`.
|
|
259
|
-
*
|
|
260
|
-
* If one is used, the selector `matSliderThumb` must be used, and the outcome will be a normal
|
|
261
|
-
* slider. If two are used, the selectors `matSliderStartThumb` and `matSliderEndThumb` must be
|
|
262
|
-
* used, and the outcome will be a range slider with two slider thumbs.
|
|
263
|
-
*/
|
|
264
|
-
class MatSliderThumb {
|
|
265
|
-
constructor(document, _slider, _elementRef) {
|
|
266
|
-
this._slider = _slider;
|
|
267
|
-
this._elementRef = _elementRef;
|
|
268
|
-
/**
|
|
269
|
-
* Emits when the raw value of the slider changes. This is here primarily
|
|
270
|
-
* to facilitate the two-way binding for the `value` input.
|
|
271
|
-
* @docs-private
|
|
272
|
-
*/
|
|
273
|
-
this.valueChange = new EventEmitter();
|
|
274
|
-
/** Event emitted when the slider thumb starts being dragged. */
|
|
275
|
-
this.dragStart = new EventEmitter();
|
|
276
|
-
/** Event emitted when the slider thumb stops being dragged. */
|
|
277
|
-
this.dragEnd = new EventEmitter();
|
|
278
|
-
/** Event emitted every time the MatSliderThumb is blurred. */
|
|
279
|
-
this._blur = new EventEmitter();
|
|
280
|
-
/** Event emitted every time the MatSliderThumb is focused. */
|
|
281
|
-
this._focus = new EventEmitter();
|
|
282
|
-
/**
|
|
283
|
-
* Used to determine the disabled state of the MatSlider (ControlValueAccessor).
|
|
284
|
-
* For ranged sliders, the disabled state of the MatSlider depends on the combined state of the
|
|
285
|
-
* start and end inputs. See MatSlider._updateDisabled.
|
|
286
|
-
*/
|
|
287
|
-
this._disabled = false;
|
|
288
|
-
/**
|
|
289
|
-
* A callback function that is called when the
|
|
290
|
-
* control's value changes in the UI (ControlValueAccessor).
|
|
291
|
-
*/
|
|
292
|
-
this._onChange = () => { };
|
|
293
|
-
/**
|
|
294
|
-
* A callback function that is called by the forms API on
|
|
295
|
-
* initialization to update the form model on blur (ControlValueAccessor).
|
|
296
|
-
*/
|
|
297
|
-
this._onTouched = () => { };
|
|
298
|
-
/** Indicates which slider thumb this input corresponds to. */
|
|
299
|
-
this._thumbPosition = this._elementRef.nativeElement.hasAttribute('matSliderStartThumb')
|
|
300
|
-
? Thumb.START
|
|
301
|
-
: Thumb.END;
|
|
302
|
-
this._document = document;
|
|
303
|
-
this._hostElement = _elementRef.nativeElement;
|
|
304
|
-
}
|
|
305
|
-
// ** IMPORTANT NOTE **
|
|
306
|
-
//
|
|
307
|
-
// The way `value` is implemented for MatSliderThumb doesn't follow typical Angular conventions.
|
|
308
|
-
// Normally we would define a private variable `_value` as the source of truth for the value of
|
|
309
|
-
// the slider thumb input. The source of truth for the value of the slider inputs has already
|
|
310
|
-
// been decided for us by MDC to be the value attribute on the slider thumb inputs. This is
|
|
311
|
-
// because the MDC foundation and adapter expect that the value attribute is the source of truth
|
|
312
|
-
// for the slider inputs.
|
|
313
|
-
//
|
|
314
|
-
// Also, note that the value attribute is completely disconnected from the value property.
|
|
315
|
-
/** The current value of this slider input. */
|
|
316
|
-
get value() {
|
|
317
|
-
return coerceNumberProperty(this._hostElement.getAttribute('value'));
|
|
318
|
-
}
|
|
319
|
-
set value(v) {
|
|
320
|
-
const value = coerceNumberProperty(v);
|
|
321
|
-
// If the foundation has already been initialized, we need to
|
|
322
|
-
// relay any value updates to it so that it can update the UI.
|
|
323
|
-
if (this._slider._initialized) {
|
|
324
|
-
this._slider._setValue(value, this._thumbPosition);
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
// Setup for the MDC foundation.
|
|
328
|
-
this._hostElement.setAttribute('value', `${value}`);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
ngOnInit() {
|
|
332
|
-
// By calling this in ngOnInit() we guarantee that the sibling sliders initial value by
|
|
333
|
-
// has already been set by the time we reach ngAfterViewInit().
|
|
334
|
-
this._initializeInputValueAttribute();
|
|
335
|
-
this._initializeAriaValueText();
|
|
336
|
-
}
|
|
337
|
-
ngAfterViewInit() {
|
|
338
|
-
this._initializeInputState();
|
|
339
|
-
this._initializeInputValueProperty();
|
|
340
|
-
// Setup for the MDC foundation.
|
|
341
|
-
if (this._slider.disabled) {
|
|
342
|
-
this._hostElement.disabled = true;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
ngOnDestroy() {
|
|
346
|
-
this.dragStart.complete();
|
|
347
|
-
this.dragEnd.complete();
|
|
348
|
-
this._focus.complete();
|
|
349
|
-
this._blur.complete();
|
|
350
|
-
this.valueChange.complete();
|
|
351
|
-
}
|
|
352
|
-
_onBlur() {
|
|
353
|
-
this._onTouched();
|
|
354
|
-
this._blur.emit();
|
|
355
|
-
}
|
|
356
|
-
_emitFakeEvent(type) {
|
|
357
|
-
const event = new Event(type);
|
|
358
|
-
event._matIsHandled = true;
|
|
359
|
-
this._hostElement.dispatchEvent(event);
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* Sets the model value. Implemented as part of ControlValueAccessor.
|
|
363
|
-
* @param value
|
|
364
|
-
*/
|
|
365
|
-
writeValue(value) {
|
|
366
|
-
this.value = value;
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Registers a callback to be triggered when the value has changed.
|
|
370
|
-
* Implemented as part of ControlValueAccessor.
|
|
371
|
-
* @param fn Callback to be registered.
|
|
372
|
-
*/
|
|
373
|
-
registerOnChange(fn) {
|
|
374
|
-
this._onChange = fn;
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Registers a callback to be triggered when the component is touched.
|
|
378
|
-
* Implemented as part of ControlValueAccessor.
|
|
379
|
-
* @param fn Callback to be registered.
|
|
380
|
-
*/
|
|
381
|
-
registerOnTouched(fn) {
|
|
382
|
-
this._onTouched = fn;
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Sets whether the component should be disabled.
|
|
386
|
-
* Implemented as part of ControlValueAccessor.
|
|
387
|
-
* @param isDisabled
|
|
388
|
-
*/
|
|
389
|
-
setDisabledState(isDisabled) {
|
|
390
|
-
this._disabled = isDisabled;
|
|
391
|
-
this._slider._updateDisabled();
|
|
392
|
-
}
|
|
393
|
-
focus() {
|
|
394
|
-
this._hostElement.focus();
|
|
395
|
-
}
|
|
396
|
-
blur() {
|
|
397
|
-
this._hostElement.blur();
|
|
398
|
-
}
|
|
399
|
-
/** Returns true if this slider input currently has focus. */
|
|
400
|
-
_isFocused() {
|
|
401
|
-
return this._document.activeElement === this._hostElement;
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* Sets the min, max, and step properties on the slider thumb input.
|
|
405
|
-
*
|
|
406
|
-
* Must be called AFTER the sibling slider thumb input is guaranteed to have had its value
|
|
407
|
-
* attribute value set. For a range slider, the min and max of the slider thumb input depends on
|
|
408
|
-
* the value of its sibling slider thumb inputs value.
|
|
409
|
-
*
|
|
410
|
-
* Must be called BEFORE the value property is set. In the case where the min and max have not
|
|
411
|
-
* yet been set and we are setting the input value property to a value outside of the native
|
|
412
|
-
* inputs default min or max. The value property would not be set to our desired value, but
|
|
413
|
-
* instead be capped at either the default min or max.
|
|
414
|
-
*
|
|
415
|
-
*/
|
|
416
|
-
_initializeInputState() {
|
|
417
|
-
const min = this._hostElement.hasAttribute('matSliderEndThumb')
|
|
418
|
-
? this._slider._getInput(Thumb.START).value
|
|
419
|
-
: this._slider.min;
|
|
420
|
-
const max = this._hostElement.hasAttribute('matSliderStartThumb')
|
|
421
|
-
? this._slider._getInput(Thumb.END).value
|
|
422
|
-
: this._slider.max;
|
|
423
|
-
this._hostElement.min = `${min}`;
|
|
424
|
-
this._hostElement.max = `${max}`;
|
|
425
|
-
this._hostElement.step = `${this._slider.step}`;
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Sets the value property on the slider thumb input.
|
|
429
|
-
*
|
|
430
|
-
* Must be called AFTER the min and max have been set. In the case where the min and max have not
|
|
431
|
-
* yet been set and we are setting the input value property to a value outside of the native
|
|
432
|
-
* inputs default min or max. The value property would not be set to our desired value, but
|
|
433
|
-
* instead be capped at either the default min or max.
|
|
434
|
-
*/
|
|
435
|
-
_initializeInputValueProperty() {
|
|
436
|
-
this._hostElement.value = `${this.value}`;
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* Ensures the value attribute is initialized.
|
|
440
|
-
*
|
|
441
|
-
* Must be called BEFORE the min and max are set. For a range slider, the min and max of the
|
|
442
|
-
* slider thumb input depends on the value of its sibling slider thumb inputs value.
|
|
443
|
-
*/
|
|
444
|
-
_initializeInputValueAttribute() {
|
|
445
|
-
// Only set the default value if an initial value has not already been provided.
|
|
446
|
-
if (!this._hostElement.hasAttribute('value')) {
|
|
447
|
-
this.value = this._hostElement.hasAttribute('matSliderEndThumb')
|
|
448
|
-
? this._slider.max
|
|
449
|
-
: this._slider.min;
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* Initializes the aria-valuetext attribute.
|
|
454
|
-
*
|
|
455
|
-
* Must be called AFTER the value attribute is set. This is because the slider's parent
|
|
456
|
-
* `displayWith` function is used to set the `aria-valuetext` attribute.
|
|
457
|
-
*/
|
|
458
|
-
_initializeAriaValueText() {
|
|
459
|
-
this._hostElement.setAttribute('aria-valuetext', this._slider.displayWith(this.value));
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
MatSliderThumb.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MatSliderThumb, deps: [{ token: DOCUMENT }, { token: forwardRef(() => MatSlider) }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
463
|
-
MatSliderThumb.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.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: [
|
|
464
|
-
{
|
|
465
|
-
provide: NG_VALUE_ACCESSOR,
|
|
466
|
-
useExisting: MatSliderThumb,
|
|
467
|
-
multi: true,
|
|
468
|
-
},
|
|
469
|
-
], exportAs: ["matSliderThumb"], ngImport: i0 });
|
|
470
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MatSliderThumb, decorators: [{
|
|
471
|
-
type: Directive,
|
|
472
|
-
args: [{
|
|
473
|
-
selector: 'input[matSliderThumb], input[matSliderStartThumb], input[matSliderEndThumb]',
|
|
474
|
-
exportAs: 'matSliderThumb',
|
|
475
|
-
host: {
|
|
476
|
-
'class': 'mdc-slider__input',
|
|
477
|
-
'type': 'range',
|
|
478
|
-
'(blur)': '_onBlur()',
|
|
479
|
-
'(focus)': '_focus.emit()',
|
|
480
|
-
},
|
|
481
|
-
providers: [
|
|
482
|
-
{
|
|
483
|
-
provide: NG_VALUE_ACCESSOR,
|
|
484
|
-
useExisting: MatSliderThumb,
|
|
485
|
-
multi: true,
|
|
486
|
-
},
|
|
487
|
-
],
|
|
488
|
-
}]
|
|
489
|
-
}], ctorParameters: function () {
|
|
490
|
-
return [{ type: undefined, decorators: [{
|
|
491
|
-
type: Inject,
|
|
492
|
-
args: [DOCUMENT]
|
|
493
|
-
}] }, { type: MatSlider, decorators: [{
|
|
494
|
-
type: Inject,
|
|
495
|
-
args: [forwardRef(() => MatSlider)]
|
|
496
|
-
}] }, { type: i0.ElementRef }];
|
|
497
|
-
}, propDecorators: { value: [{
|
|
498
|
-
type: Input
|
|
499
|
-
}], valueChange: [{
|
|
500
|
-
type: Output
|
|
501
|
-
}], dragStart: [{
|
|
502
|
-
type: Output
|
|
503
|
-
}], dragEnd: [{
|
|
504
|
-
type: Output
|
|
505
|
-
}], _blur: [{
|
|
506
|
-
type: Output
|
|
507
|
-
}], _focus: [{
|
|
508
|
-
type: Output
|
|
509
|
-
}] } });
|
|
510
|
-
// Boilerplate for applying mixins to MatSlider.
|
|
511
|
-
const _MatSliderMixinBase = mixinColor(mixinDisableRipple(class {
|
|
512
|
-
constructor(_elementRef) {
|
|
513
|
-
this._elementRef = _elementRef;
|
|
514
|
-
}
|
|
515
|
-
}), 'primary');
|
|
516
|
-
/**
|
|
517
|
-
* Allows users to select from a range of values by moving the slider thumb. It is similar in
|
|
518
|
-
* behavior to the native `<input type="range">` element.
|
|
519
|
-
*/
|
|
520
|
-
class MatSlider extends _MatSliderMixinBase {
|
|
521
|
-
constructor(_ngZone, _cdr, elementRef, _platform, _globalChangeAndInputListener, document, _dir, _globalRippleOptions, animationMode) {
|
|
522
|
-
super(elementRef);
|
|
523
|
-
this._ngZone = _ngZone;
|
|
524
|
-
this._cdr = _cdr;
|
|
525
|
-
this._platform = _platform;
|
|
526
|
-
this._globalChangeAndInputListener = _globalChangeAndInputListener;
|
|
527
|
-
this._dir = _dir;
|
|
528
|
-
this._globalRippleOptions = _globalRippleOptions;
|
|
529
|
-
this._disabled = false;
|
|
530
|
-
this._discrete = false;
|
|
531
|
-
this._showTickMarks = false;
|
|
532
|
-
this._min = 0;
|
|
533
|
-
this._max = 100;
|
|
534
|
-
this._step = 1;
|
|
535
|
-
/**
|
|
536
|
-
* Function that will be used to format the value before it is displayed
|
|
537
|
-
* in the thumb label. Can be used to format very large number in order
|
|
538
|
-
* for them to fit into the slider thumb.
|
|
539
|
-
*/
|
|
540
|
-
this.displayWith = (value) => `${value}`;
|
|
541
|
-
/** Instance of the MDC slider foundation for this slider. */
|
|
542
|
-
this._foundation = new MDCSliderFoundation(new SliderAdapter(this));
|
|
543
|
-
/** Whether the foundation has been initialized. */
|
|
544
|
-
this._initialized = false;
|
|
545
|
-
/**
|
|
546
|
-
* Whether the browser supports pointer events.
|
|
547
|
-
*
|
|
548
|
-
* We exclude iOS to mirror the MDC Foundation. The MDC Foundation cannot use pointer events on
|
|
549
|
-
* iOS because of this open bug - https://bugs.webkit.org/show_bug.cgi?id=220196.
|
|
550
|
-
*/
|
|
551
|
-
this._SUPPORTS_POINTER_EVENTS = typeof PointerEvent !== 'undefined' && !!PointerEvent && !this._platform.IOS;
|
|
552
|
-
/** Wrapper function for calling layout (needed for adding & removing an event listener). */
|
|
553
|
-
this._layout = () => this._foundation.layout();
|
|
554
|
-
this._document = document;
|
|
555
|
-
this._window = this._document.defaultView || window;
|
|
556
|
-
this._noopAnimations = animationMode === 'NoopAnimations';
|
|
557
|
-
this._dirChangeSubscription = this._dir.change.subscribe(() => this._onDirChange());
|
|
558
|
-
this._attachUISyncEventListener();
|
|
559
|
-
}
|
|
560
|
-
/** Whether the slider is disabled. */
|
|
561
|
-
get disabled() {
|
|
562
|
-
return this._disabled;
|
|
563
|
-
}
|
|
564
|
-
set disabled(v) {
|
|
565
|
-
this._setDisabled(coerceBooleanProperty(v));
|
|
566
|
-
this._updateInputsDisabledState();
|
|
567
|
-
}
|
|
568
|
-
/** Whether the slider displays a numeric value label upon pressing the thumb. */
|
|
569
|
-
get discrete() {
|
|
570
|
-
return this._discrete;
|
|
571
|
-
}
|
|
572
|
-
set discrete(v) {
|
|
573
|
-
this._discrete = coerceBooleanProperty(v);
|
|
574
|
-
}
|
|
575
|
-
/** Whether the slider displays tick marks along the slider track. */
|
|
576
|
-
get showTickMarks() {
|
|
577
|
-
return this._showTickMarks;
|
|
578
|
-
}
|
|
579
|
-
set showTickMarks(v) {
|
|
580
|
-
this._showTickMarks = coerceBooleanProperty(v);
|
|
581
|
-
}
|
|
582
|
-
/** The minimum value that the slider can have. */
|
|
583
|
-
get min() {
|
|
584
|
-
return this._min;
|
|
585
|
-
}
|
|
586
|
-
set min(v) {
|
|
587
|
-
this._min = coerceNumberProperty(v, this._min);
|
|
588
|
-
this._reinitialize();
|
|
589
|
-
}
|
|
590
|
-
/** The maximum value that the slider can have. */
|
|
591
|
-
get max() {
|
|
592
|
-
return this._max;
|
|
593
|
-
}
|
|
594
|
-
set max(v) {
|
|
595
|
-
this._max = coerceNumberProperty(v, this._max);
|
|
596
|
-
this._reinitialize();
|
|
597
|
-
}
|
|
598
|
-
/** The values at which the thumb will snap. */
|
|
599
|
-
get step() {
|
|
600
|
-
return this._step;
|
|
601
|
-
}
|
|
602
|
-
set step(v) {
|
|
603
|
-
this._step = coerceNumberProperty(v, this._step);
|
|
604
|
-
this._reinitialize();
|
|
605
|
-
}
|
|
606
|
-
ngAfterViewInit() {
|
|
607
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
608
|
-
_validateThumbs(this._isRange(), this._getThumb(Thumb.START), this._getThumb(Thumb.END));
|
|
609
|
-
_validateInputs(this._isRange(), this._getInputElement(Thumb.START), this._getInputElement(Thumb.END));
|
|
610
|
-
}
|
|
611
|
-
if (this._platform.isBrowser) {
|
|
612
|
-
this._foundation.init();
|
|
613
|
-
this._foundation.layout();
|
|
614
|
-
this._initialized = true;
|
|
615
|
-
this._observeHostResize();
|
|
616
|
-
}
|
|
617
|
-
// The MDC foundation requires access to the view and content children of the MatSlider. In
|
|
618
|
-
// order to access the view and content children of MatSlider we need to wait until change
|
|
619
|
-
// detection runs and materializes them. That is why we call init() and layout() in
|
|
620
|
-
// ngAfterViewInit().
|
|
621
|
-
//
|
|
622
|
-
// The MDC foundation then uses the information it gathers from the DOM to compute an initial
|
|
623
|
-
// value for the tickMarks array. It then tries to update the component data, but because it is
|
|
624
|
-
// updating the component data AFTER change detection already ran, we will get a changed after
|
|
625
|
-
// checked error. Because of this, we need to force change detection to update the UI with the
|
|
626
|
-
// new state.
|
|
627
|
-
this._cdr.detectChanges();
|
|
628
|
-
}
|
|
629
|
-
ngOnDestroy() {
|
|
630
|
-
var _a;
|
|
631
|
-
if (this._platform.isBrowser) {
|
|
632
|
-
this._foundation.destroy();
|
|
633
|
-
}
|
|
634
|
-
this._dirChangeSubscription.unsubscribe();
|
|
635
|
-
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
636
|
-
this._resizeObserver = null;
|
|
637
|
-
clearTimeout(this._resizeTimer);
|
|
638
|
-
this._removeUISyncEventListener();
|
|
639
|
-
}
|
|
640
|
-
/** Returns true if the language direction for this slider element is right to left. */
|
|
641
|
-
_isRTL() {
|
|
642
|
-
return this._dir && this._dir.value === 'rtl';
|
|
643
|
-
}
|
|
644
|
-
/**
|
|
645
|
-
* Attaches an event listener that keeps sync the slider UI and the foundation in sync.
|
|
646
|
-
*
|
|
647
|
-
* Because the MDC Foundation stores the value of the bounding client rect when layout is called,
|
|
648
|
-
* we need to keep calling layout to avoid the position of the slider getting out of sync with
|
|
649
|
-
* what the foundation has stored. If we don't do this, the foundation will not be able to
|
|
650
|
-
* correctly calculate the slider value on click/slide.
|
|
651
|
-
*/
|
|
652
|
-
_attachUISyncEventListener() {
|
|
653
|
-
// Implementation detail: It may seem weird that we are using "mouseenter" instead of
|
|
654
|
-
// "mousedown" as the default for when a browser does not support pointer events. While we
|
|
655
|
-
// would prefer to use "mousedown" as the default, for some reason it does not work (the
|
|
656
|
-
// callback is never triggered).
|
|
657
|
-
if (this._SUPPORTS_POINTER_EVENTS) {
|
|
658
|
-
this._elementRef.nativeElement.addEventListener('pointerdown', this._layout);
|
|
659
|
-
}
|
|
660
|
-
else {
|
|
661
|
-
this._elementRef.nativeElement.addEventListener('mouseenter', this._layout);
|
|
662
|
-
this._elementRef.nativeElement.addEventListener('touchstart', this._layout, passiveEventListenerOptions);
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
/** Removes the event listener that keeps sync the slider UI and the foundation in sync. */
|
|
666
|
-
_removeUISyncEventListener() {
|
|
667
|
-
if (this._SUPPORTS_POINTER_EVENTS) {
|
|
668
|
-
this._elementRef.nativeElement.removeEventListener('pointerdown', this._layout);
|
|
669
|
-
}
|
|
670
|
-
else {
|
|
671
|
-
this._elementRef.nativeElement.removeEventListener('mouseenter', this._layout);
|
|
672
|
-
this._elementRef.nativeElement.removeEventListener('touchstart', this._layout, passiveEventListenerOptions);
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
/**
|
|
676
|
-
* Reinitializes the slider foundation and input state(s).
|
|
677
|
-
*
|
|
678
|
-
* The MDC Foundation does not support changing some slider attributes after it has been
|
|
679
|
-
* initialized (e.g. min, max, and step). To continue supporting this feature, we need to
|
|
680
|
-
* destroy the foundation and re-initialize everything whenever we make these changes.
|
|
681
|
-
*/
|
|
682
|
-
_reinitialize() {
|
|
683
|
-
if (this._initialized) {
|
|
684
|
-
this._foundation.destroy();
|
|
685
|
-
if (this._isRange()) {
|
|
686
|
-
this._getInput(Thumb.START)._initializeInputState();
|
|
687
|
-
}
|
|
688
|
-
this._getInput(Thumb.END)._initializeInputState();
|
|
689
|
-
this._foundation.init();
|
|
690
|
-
this._foundation.layout();
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
/** Handles updating the slider foundation after a dir change. */
|
|
694
|
-
_onDirChange() {
|
|
695
|
-
this._ngZone.runOutsideAngular(() => {
|
|
696
|
-
// We need to call layout() a few milliseconds after the dir change callback
|
|
697
|
-
// because we need to wait until the bounding client rect of the slider has updated.
|
|
698
|
-
setTimeout(() => this._foundation.layout(), 10);
|
|
699
|
-
});
|
|
700
|
-
}
|
|
701
|
-
/** Sets the value of a slider thumb. */
|
|
702
|
-
_setValue(value, thumbPosition) {
|
|
703
|
-
thumbPosition === Thumb.START
|
|
704
|
-
? this._foundation.setValueStart(value)
|
|
705
|
-
: this._foundation.setValue(value);
|
|
706
|
-
}
|
|
707
|
-
/** Sets the disabled state of the MatSlider. */
|
|
708
|
-
_setDisabled(value) {
|
|
709
|
-
this._disabled = value;
|
|
710
|
-
// If we want to disable the slider after the foundation has been initialized,
|
|
711
|
-
// we need to inform the foundation by calling `setDisabled`. Also, we can't call
|
|
712
|
-
// this before initializing the foundation because it will throw errors.
|
|
713
|
-
if (this._initialized) {
|
|
714
|
-
this._foundation.setDisabled(value);
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
/** Sets the disabled state of the individual slider thumb(s) (ControlValueAccessor). */
|
|
718
|
-
_updateInputsDisabledState() {
|
|
719
|
-
if (this._initialized) {
|
|
720
|
-
this._getInput(Thumb.END)._disabled = true;
|
|
721
|
-
if (this._isRange()) {
|
|
722
|
-
this._getInput(Thumb.START)._disabled = true;
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
/** Whether this is a ranged slider. */
|
|
727
|
-
_isRange() {
|
|
728
|
-
return this._inputs.length === 2;
|
|
729
|
-
}
|
|
730
|
-
/** Sets the disabled state based on the disabled state of the inputs (ControlValueAccessor). */
|
|
731
|
-
_updateDisabled() {
|
|
732
|
-
var _a;
|
|
733
|
-
const disabled = ((_a = this._inputs) === null || _a === void 0 ? void 0 : _a.some(input => input._disabled)) || false;
|
|
734
|
-
this._setDisabled(disabled);
|
|
735
|
-
}
|
|
736
|
-
/** Gets the slider thumb input of the given thumb position. */
|
|
737
|
-
_getInput(thumbPosition) {
|
|
738
|
-
var _a, _b;
|
|
739
|
-
return thumbPosition === Thumb.END ? (_a = this._inputs) === null || _a === void 0 ? void 0 : _a.last : (_b = this._inputs) === null || _b === void 0 ? void 0 : _b.first;
|
|
740
|
-
}
|
|
741
|
-
/** Gets the slider thumb HTML input element of the given thumb position. */
|
|
742
|
-
_getInputElement(thumbPosition) {
|
|
743
|
-
var _a;
|
|
744
|
-
return (_a = this._getInput(thumbPosition)) === null || _a === void 0 ? void 0 : _a._hostElement;
|
|
745
|
-
}
|
|
746
|
-
_getThumb(thumbPosition) {
|
|
747
|
-
var _a, _b;
|
|
748
|
-
return thumbPosition === Thumb.END ? (_a = this._thumbs) === null || _a === void 0 ? void 0 : _a.last : (_b = this._thumbs) === null || _b === void 0 ? void 0 : _b.first;
|
|
749
|
-
}
|
|
750
|
-
/** Gets the slider thumb HTML element of the given thumb position. */
|
|
751
|
-
_getThumbElement(thumbPosition) {
|
|
752
|
-
var _a;
|
|
753
|
-
return (_a = this._getThumb(thumbPosition)) === null || _a === void 0 ? void 0 : _a._getHostElement();
|
|
754
|
-
}
|
|
755
|
-
/** Gets the slider knob HTML element of the given thumb position. */
|
|
756
|
-
_getKnobElement(thumbPosition) {
|
|
757
|
-
var _a;
|
|
758
|
-
return (_a = this._getThumb(thumbPosition)) === null || _a === void 0 ? void 0 : _a._getKnob();
|
|
759
|
-
}
|
|
760
|
-
/**
|
|
761
|
-
* Gets the slider value indicator container HTML element of the given thumb
|
|
762
|
-
* position.
|
|
763
|
-
*/
|
|
764
|
-
_getValueIndicatorContainerElement(thumbPosition) {
|
|
765
|
-
return this._getThumb(thumbPosition)._getValueIndicatorContainer();
|
|
766
|
-
}
|
|
767
|
-
/**
|
|
768
|
-
* Sets the value indicator text of the given thumb position using the given value.
|
|
769
|
-
*
|
|
770
|
-
* Uses the `displayWith` function if one has been provided. Otherwise, it just uses the
|
|
771
|
-
* numeric value as a string.
|
|
772
|
-
*/
|
|
773
|
-
_setValueIndicatorText(value, thumbPosition) {
|
|
774
|
-
thumbPosition === Thumb.START
|
|
775
|
-
? (this._startValueIndicatorText = this.displayWith(value))
|
|
776
|
-
: (this._endValueIndicatorText = this.displayWith(value));
|
|
777
|
-
this._cdr.markForCheck();
|
|
778
|
-
}
|
|
779
|
-
/** Gets the value indicator text for the given thumb position. */
|
|
780
|
-
_getValueIndicatorText(thumbPosition) {
|
|
781
|
-
return thumbPosition === Thumb.START
|
|
782
|
-
? this._startValueIndicatorText
|
|
783
|
-
: this._endValueIndicatorText;
|
|
784
|
-
}
|
|
785
|
-
/** Determines the class name for a HTML element. */
|
|
786
|
-
_getTickMarkClass(tickMark) {
|
|
787
|
-
return tickMark === TickMark.ACTIVE
|
|
788
|
-
? 'mdc-slider__tick-mark--active'
|
|
789
|
-
: 'mdc-slider__tick-mark--inactive';
|
|
790
|
-
}
|
|
791
|
-
/** Whether the slider thumb ripples should be disabled. */
|
|
792
|
-
_isRippleDisabled() {
|
|
793
|
-
var _a;
|
|
794
|
-
return this.disabled || this.disableRipple || !!((_a = this._globalRippleOptions) === null || _a === void 0 ? void 0 : _a.disabled);
|
|
795
|
-
}
|
|
796
|
-
/** Gets the dimensions of the host element. */
|
|
797
|
-
_getHostDimensions() {
|
|
798
|
-
return this._cachedHostRect || this._elementRef.nativeElement.getBoundingClientRect();
|
|
799
|
-
}
|
|
800
|
-
/** Starts observing and updating the slider if the host changes its size. */
|
|
801
|
-
_observeHostResize() {
|
|
802
|
-
if (typeof ResizeObserver === 'undefined' || !ResizeObserver) {
|
|
803
|
-
return;
|
|
804
|
-
}
|
|
805
|
-
// MDC only updates the slider when the window is resized which
|
|
806
|
-
// doesn't capture changes of the container itself. We use a resize
|
|
807
|
-
// observer to ensure that the layout is correct (see #24590 and #25286).
|
|
808
|
-
this._ngZone.runOutsideAngular(() => {
|
|
809
|
-
this._resizeObserver = new ResizeObserver(entries => {
|
|
810
|
-
// Triggering a layout while the user is dragging can throw off the alignment.
|
|
811
|
-
if (this._isActive()) {
|
|
812
|
-
return;
|
|
813
|
-
}
|
|
814
|
-
clearTimeout(this._resizeTimer);
|
|
815
|
-
this._resizeTimer = setTimeout(() => {
|
|
816
|
-
var _a;
|
|
817
|
-
// The `layout` call is going to call `getBoundingClientRect` to update the dimensions
|
|
818
|
-
// of the host. Since the `ResizeObserver` already calculated them, we can save some
|
|
819
|
-
// work by returning them instead of having to check the DOM again.
|
|
820
|
-
if (!this._isActive()) {
|
|
821
|
-
this._cachedHostRect = (_a = entries[0]) === null || _a === void 0 ? void 0 : _a.contentRect;
|
|
822
|
-
this._layout();
|
|
823
|
-
this._cachedHostRect = null;
|
|
824
|
-
}
|
|
825
|
-
}, 50);
|
|
826
|
-
});
|
|
827
|
-
this._resizeObserver.observe(this._elementRef.nativeElement);
|
|
828
|
-
});
|
|
829
|
-
}
|
|
830
|
-
/** Whether any of the thumbs are currently active. */
|
|
831
|
-
_isActive() {
|
|
832
|
-
return this._getThumb(Thumb.START)._isActive || this._getThumb(Thumb.END)._isActive;
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
MatSlider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MatSlider, deps: [{ token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i3.Platform }, { token: GlobalChangeAndInputListener }, { token: DOCUMENT }, { token: i5.Directionality, optional: true }, { token: MAT_RIPPLE_GLOBAL_OPTIONS, optional: true }, { token: ANIMATION_MODULE_TYPE, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
836
|
-
MatSlider.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.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{height:4px;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{border-radius:3px;height:6px;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{border-radius:2px;height:4px;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;height:48px;left:-24px;outline:none;position:absolute;user-select:none;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{border:10px solid;border-radius:50%;box-sizing:border-box;height:20px;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);width:20px}.mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded--background-focused::before,.mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms}.mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms}.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 .mdc-slider__tick-mark--active,.mdc-slider .mdc-slider__tick-mark--inactive{border-radius:50%;height:2px;width:2px}.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._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 });
|
|
837
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MatSlider, decorators: [{
|
|
838
|
-
type: Component,
|
|
839
|
-
args: [{ selector: 'mat-slider', host: {
|
|
840
|
-
'class': 'mat-mdc-slider mdc-slider',
|
|
841
|
-
'[class.mdc-slider--range]': '_isRange()',
|
|
842
|
-
'[class.mdc-slider--disabled]': 'disabled',
|
|
843
|
-
'[class.mdc-slider--discrete]': 'discrete',
|
|
844
|
-
'[class.mdc-slider--tick-marks]': 'showTickMarks',
|
|
845
|
-
'[class._mat-animation-noopable]': '_noopAnimations',
|
|
846
|
-
}, 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{height:4px;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{border-radius:3px;height:6px;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{border-radius:2px;height:4px;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;height:48px;left:-24px;outline:none;position:absolute;user-select:none;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{border:10px solid;border-radius:50%;box-sizing:border-box;height:20px;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);width:20px}.mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded--background-focused::before,.mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms}.mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms}.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 .mdc-slider__tick-mark--active,.mdc-slider .mdc-slider__tick-mark--inactive{border-radius:50%;height:2px;width:2px}.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._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:\"\"}"] }]
|
|
847
|
-
}], ctorParameters: function () {
|
|
848
|
-
return [{ type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i3.Platform }, { type: GlobalChangeAndInputListener }, { type: undefined, decorators: [{
|
|
849
|
-
type: Inject,
|
|
850
|
-
args: [DOCUMENT]
|
|
851
|
-
}] }, { type: i5.Directionality, decorators: [{
|
|
852
|
-
type: Optional
|
|
853
|
-
}] }, { type: undefined, decorators: [{
|
|
854
|
-
type: Optional
|
|
855
|
-
}, {
|
|
856
|
-
type: Inject,
|
|
857
|
-
args: [MAT_RIPPLE_GLOBAL_OPTIONS]
|
|
858
|
-
}] }, { type: undefined, decorators: [{
|
|
859
|
-
type: Optional
|
|
860
|
-
}, {
|
|
861
|
-
type: Inject,
|
|
862
|
-
args: [ANIMATION_MODULE_TYPE]
|
|
863
|
-
}] }];
|
|
864
|
-
}, propDecorators: { _thumbs: [{
|
|
865
|
-
type: ViewChildren,
|
|
866
|
-
args: [MatSliderVisualThumb]
|
|
867
|
-
}], _trackActive: [{
|
|
868
|
-
type: ViewChild,
|
|
869
|
-
args: ['trackActive']
|
|
870
|
-
}], _inputs: [{
|
|
871
|
-
type: ContentChildren,
|
|
872
|
-
args: [MatSliderThumb, { descendants: false }]
|
|
873
|
-
}], disabled: [{
|
|
874
|
-
type: Input
|
|
875
|
-
}], discrete: [{
|
|
876
|
-
type: Input
|
|
877
|
-
}], showTickMarks: [{
|
|
878
|
-
type: Input
|
|
879
|
-
}], min: [{
|
|
880
|
-
type: Input
|
|
881
|
-
}], max: [{
|
|
882
|
-
type: Input
|
|
883
|
-
}], step: [{
|
|
884
|
-
type: Input
|
|
885
|
-
}], displayWith: [{
|
|
886
|
-
type: Input
|
|
887
|
-
}] } });
|
|
888
|
-
/** The MDCSliderAdapter implementation. */
|
|
889
|
-
class SliderAdapter {
|
|
890
|
-
constructor(_delegate) {
|
|
891
|
-
this._delegate = _delegate;
|
|
892
|
-
/** The global event listener subscription used to handle events on the slider inputs. */
|
|
893
|
-
this._globalEventSubscriptions = new Subscription();
|
|
894
|
-
// We manually assign functions instead of using prototype methods because
|
|
895
|
-
// MDC clobbers the values otherwise.
|
|
896
|
-
// See https://github.com/material-components/material-components-web/pull/6256
|
|
897
|
-
this.hasClass = (className) => {
|
|
898
|
-
return this._delegate._elementRef.nativeElement.classList.contains(className);
|
|
899
|
-
};
|
|
900
|
-
this.addClass = (className) => {
|
|
901
|
-
this._delegate._elementRef.nativeElement.classList.add(className);
|
|
902
|
-
};
|
|
903
|
-
this.removeClass = (className) => {
|
|
904
|
-
this._delegate._elementRef.nativeElement.classList.remove(className);
|
|
905
|
-
};
|
|
906
|
-
this.getAttribute = (attribute) => {
|
|
907
|
-
return this._delegate._elementRef.nativeElement.getAttribute(attribute);
|
|
908
|
-
};
|
|
909
|
-
this.addThumbClass = (className, thumbPosition) => {
|
|
910
|
-
this._delegate._getThumbElement(thumbPosition).classList.add(className);
|
|
911
|
-
};
|
|
912
|
-
this.removeThumbClass = (className, thumbPosition) => {
|
|
913
|
-
this._delegate._getThumbElement(thumbPosition).classList.remove(className);
|
|
914
|
-
};
|
|
915
|
-
this.getInputValue = (thumbPosition) => {
|
|
916
|
-
return this._delegate._getInputElement(thumbPosition).value;
|
|
917
|
-
};
|
|
918
|
-
this.setInputValue = (value, thumbPosition) => {
|
|
919
|
-
this._delegate._getInputElement(thumbPosition).value = value;
|
|
920
|
-
};
|
|
921
|
-
this.getInputAttribute = (attribute, thumbPosition) => {
|
|
922
|
-
return this._delegate._getInputElement(thumbPosition).getAttribute(attribute);
|
|
923
|
-
};
|
|
924
|
-
this.setInputAttribute = (attribute, value, thumbPosition) => {
|
|
925
|
-
const input = this._delegate._getInputElement(thumbPosition);
|
|
926
|
-
// TODO(wagnermaciel): remove this check once this component is
|
|
927
|
-
// added to the internal allowlist for calling setAttribute.
|
|
928
|
-
// Explicitly check the attribute we are setting to prevent xss.
|
|
929
|
-
switch (attribute) {
|
|
930
|
-
case 'aria-valuetext':
|
|
931
|
-
input.setAttribute('aria-valuetext', value);
|
|
932
|
-
break;
|
|
933
|
-
case 'disabled':
|
|
934
|
-
input.setAttribute('disabled', value);
|
|
935
|
-
break;
|
|
936
|
-
case 'min':
|
|
937
|
-
input.setAttribute('min', value);
|
|
938
|
-
break;
|
|
939
|
-
case 'max':
|
|
940
|
-
input.setAttribute('max', value);
|
|
941
|
-
break;
|
|
942
|
-
case 'value':
|
|
943
|
-
input.setAttribute('value', value);
|
|
944
|
-
break;
|
|
945
|
-
case 'step':
|
|
946
|
-
input.setAttribute('step', value);
|
|
947
|
-
break;
|
|
948
|
-
default:
|
|
949
|
-
throw Error(`Tried to set invalid attribute ${attribute} on the mdc-slider.`);
|
|
950
|
-
}
|
|
951
|
-
};
|
|
952
|
-
this.removeInputAttribute = (attribute, thumbPosition) => {
|
|
953
|
-
this._delegate._getInputElement(thumbPosition).removeAttribute(attribute);
|
|
954
|
-
};
|
|
955
|
-
this.focusInput = (thumbPosition) => {
|
|
956
|
-
this._delegate._getInputElement(thumbPosition).focus();
|
|
957
|
-
};
|
|
958
|
-
this.isInputFocused = (thumbPosition) => {
|
|
959
|
-
return this._delegate._getInput(thumbPosition)._isFocused();
|
|
960
|
-
};
|
|
961
|
-
this.getThumbKnobWidth = (thumbPosition) => {
|
|
962
|
-
return this._delegate._getKnobElement(thumbPosition).getBoundingClientRect().width;
|
|
963
|
-
};
|
|
964
|
-
this.getThumbBoundingClientRect = (thumbPosition) => {
|
|
965
|
-
return this._delegate._getThumbElement(thumbPosition).getBoundingClientRect();
|
|
966
|
-
};
|
|
967
|
-
this.getBoundingClientRect = () => {
|
|
968
|
-
return this._delegate._getHostDimensions();
|
|
969
|
-
};
|
|
970
|
-
this.getValueIndicatorContainerWidth = (thumbPosition) => {
|
|
971
|
-
return this._delegate._getValueIndicatorContainerElement(thumbPosition).getBoundingClientRect()
|
|
972
|
-
.width;
|
|
973
|
-
};
|
|
974
|
-
this.isRTL = () => {
|
|
975
|
-
return this._delegate._isRTL();
|
|
976
|
-
};
|
|
977
|
-
this.setThumbStyleProperty = (propertyName, value, thumbPosition) => {
|
|
978
|
-
this._delegate._getThumbElement(thumbPosition).style.setProperty(propertyName, value);
|
|
979
|
-
};
|
|
980
|
-
this.removeThumbStyleProperty = (propertyName, thumbPosition) => {
|
|
981
|
-
this._delegate._getThumbElement(thumbPosition).style.removeProperty(propertyName);
|
|
982
|
-
};
|
|
983
|
-
this.setTrackActiveStyleProperty = (propertyName, value) => {
|
|
984
|
-
this._delegate._trackActive.nativeElement.style.setProperty(propertyName, value);
|
|
985
|
-
};
|
|
986
|
-
this.removeTrackActiveStyleProperty = (propertyName) => {
|
|
987
|
-
this._delegate._trackActive.nativeElement.style.removeProperty(propertyName);
|
|
988
|
-
};
|
|
989
|
-
this.setValueIndicatorText = (value, thumbPosition) => {
|
|
990
|
-
this._delegate._setValueIndicatorText(value, thumbPosition);
|
|
991
|
-
};
|
|
992
|
-
this.getValueToAriaValueTextFn = () => {
|
|
993
|
-
return this._delegate.displayWith;
|
|
994
|
-
};
|
|
995
|
-
this.updateTickMarks = (tickMarks) => {
|
|
996
|
-
this._delegate._tickMarks = tickMarks;
|
|
997
|
-
this._delegate._cdr.markForCheck();
|
|
998
|
-
};
|
|
999
|
-
this.setPointerCapture = (pointerId) => {
|
|
1000
|
-
this._delegate._elementRef.nativeElement.setPointerCapture(pointerId);
|
|
1001
|
-
};
|
|
1002
|
-
this.emitChangeEvent = (value, thumbPosition) => {
|
|
1003
|
-
// We block all real slider input change events and emit fake change events from here, instead.
|
|
1004
|
-
// We do this because the mdc implementation of the slider does not trigger real change events
|
|
1005
|
-
// on pointer up (only on left or right arrow key down).
|
|
1006
|
-
//
|
|
1007
|
-
// By stopping real change events from reaching users, and dispatching fake change events
|
|
1008
|
-
// (which we allow to reach the user) the slider inputs change events are triggered at the
|
|
1009
|
-
// appropriate times. This allows users to listen for change events directly on the slider
|
|
1010
|
-
// input as they would with a native range input.
|
|
1011
|
-
const input = this._delegate._getInput(thumbPosition);
|
|
1012
|
-
input._emitFakeEvent('change');
|
|
1013
|
-
input._onChange(value);
|
|
1014
|
-
input.valueChange.emit(value);
|
|
1015
|
-
};
|
|
1016
|
-
this.emitInputEvent = (value, thumbPosition) => {
|
|
1017
|
-
this._delegate._getInput(thumbPosition)._emitFakeEvent('input');
|
|
1018
|
-
};
|
|
1019
|
-
this.emitDragStartEvent = (value, thumbPosition) => {
|
|
1020
|
-
const input = this._delegate._getInput(thumbPosition);
|
|
1021
|
-
input.dragStart.emit({ source: input, parent: this._delegate, value });
|
|
1022
|
-
};
|
|
1023
|
-
this.emitDragEndEvent = (value, thumbPosition) => {
|
|
1024
|
-
const input = this._delegate._getInput(thumbPosition);
|
|
1025
|
-
input.dragEnd.emit({ source: input, parent: this._delegate, value });
|
|
1026
|
-
};
|
|
1027
|
-
this.registerEventHandler = (evtType, handler) => {
|
|
1028
|
-
this._delegate._elementRef.nativeElement.addEventListener(evtType, handler);
|
|
1029
|
-
};
|
|
1030
|
-
this.deregisterEventHandler = (evtType, handler) => {
|
|
1031
|
-
this._delegate._elementRef.nativeElement.removeEventListener(evtType, handler);
|
|
1032
|
-
};
|
|
1033
|
-
this.registerThumbEventHandler = (thumbPosition, evtType, handler) => {
|
|
1034
|
-
this._delegate._getThumbElement(thumbPosition).addEventListener(evtType, handler);
|
|
1035
|
-
};
|
|
1036
|
-
this.deregisterThumbEventHandler = (thumbPosition, evtType, handler) => {
|
|
1037
|
-
var _a;
|
|
1038
|
-
(_a = this._delegate._getThumbElement(thumbPosition)) === null || _a === void 0 ? void 0 : _a.removeEventListener(evtType, handler);
|
|
1039
|
-
};
|
|
1040
|
-
this.registerInputEventHandler = (thumbPosition, evtType, handler) => {
|
|
1041
|
-
var _a;
|
|
1042
|
-
if (evtType === 'change') {
|
|
1043
|
-
this._saveChangeEventHandler(thumbPosition, handler);
|
|
1044
|
-
}
|
|
1045
|
-
else {
|
|
1046
|
-
(_a = this._delegate._getInputElement(thumbPosition)) === null || _a === void 0 ? void 0 : _a.addEventListener(evtType, handler);
|
|
1047
|
-
}
|
|
1048
|
-
};
|
|
1049
|
-
this.deregisterInputEventHandler = (thumbPosition, evtType, handler) => {
|
|
1050
|
-
var _a;
|
|
1051
|
-
if (evtType === 'change') {
|
|
1052
|
-
this._globalEventSubscriptions.unsubscribe();
|
|
1053
|
-
}
|
|
1054
|
-
else {
|
|
1055
|
-
(_a = this._delegate._getInputElement(thumbPosition)) === null || _a === void 0 ? void 0 : _a.removeEventListener(evtType, handler);
|
|
1056
|
-
}
|
|
1057
|
-
};
|
|
1058
|
-
this.registerBodyEventHandler = (evtType, handler) => {
|
|
1059
|
-
this._delegate._document.body.addEventListener(evtType, handler);
|
|
1060
|
-
};
|
|
1061
|
-
this.deregisterBodyEventHandler = (evtType, handler) => {
|
|
1062
|
-
this._delegate._document.body.removeEventListener(evtType, handler);
|
|
1063
|
-
};
|
|
1064
|
-
this.registerWindowEventHandler = (evtType, handler) => {
|
|
1065
|
-
this._delegate._window.addEventListener(evtType, handler);
|
|
1066
|
-
};
|
|
1067
|
-
this.deregisterWindowEventHandler = (evtType, handler) => {
|
|
1068
|
-
this._delegate._window.removeEventListener(evtType, handler);
|
|
1069
|
-
};
|
|
1070
|
-
this._globalEventSubscriptions.add(this._subscribeToSliderInputEvents('change'));
|
|
1071
|
-
this._globalEventSubscriptions.add(this._subscribeToSliderInputEvents('input'));
|
|
1072
|
-
}
|
|
1073
|
-
/**
|
|
1074
|
-
* Handles "change" and "input" events on the slider inputs.
|
|
1075
|
-
*
|
|
1076
|
-
* Exposes a callback to allow the MDC Foundations "change" event handler to be called for "real"
|
|
1077
|
-
* events.
|
|
1078
|
-
*
|
|
1079
|
-
* ** IMPORTANT NOTE **
|
|
1080
|
-
*
|
|
1081
|
-
* We block all "real" change and input events and emit fake events from #emitChangeEvent and
|
|
1082
|
-
* #emitInputEvent, instead. We do this because interacting with the MDC slider won't trigger all
|
|
1083
|
-
* of the correct change and input events, but it will call #emitChangeEvent and #emitInputEvent
|
|
1084
|
-
* at the correct times. This allows users to listen for these events directly on the slider
|
|
1085
|
-
* input as they would with a native range input.
|
|
1086
|
-
*/
|
|
1087
|
-
_subscribeToSliderInputEvents(type) {
|
|
1088
|
-
return this._delegate._globalChangeAndInputListener.listen(type, (event) => {
|
|
1089
|
-
const thumbPosition = this._getInputThumbPosition(event.target);
|
|
1090
|
-
// Do nothing if the event isn't from a thumb input.
|
|
1091
|
-
if (thumbPosition === null) {
|
|
1092
|
-
return;
|
|
1093
|
-
}
|
|
1094
|
-
// Do nothing if the event is "fake".
|
|
1095
|
-
if (event._matIsHandled) {
|
|
1096
|
-
return;
|
|
1097
|
-
}
|
|
1098
|
-
// Prevent "real" events from reaching end users.
|
|
1099
|
-
event.stopImmediatePropagation();
|
|
1100
|
-
// Relay "real" change events to the MDC Foundation.
|
|
1101
|
-
if (type === 'change') {
|
|
1102
|
-
this._callChangeEventHandler(event, thumbPosition);
|
|
1103
|
-
}
|
|
1104
|
-
});
|
|
1105
|
-
}
|
|
1106
|
-
/** Calls the MDC Foundations change event handler for the specified thumb position. */
|
|
1107
|
-
_callChangeEventHandler(event, thumbPosition) {
|
|
1108
|
-
if (thumbPosition === Thumb.START) {
|
|
1109
|
-
this._startInputChangeEventHandler(event);
|
|
1110
|
-
}
|
|
1111
|
-
else {
|
|
1112
|
-
this._endInputChangeEventHandler(event);
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
/** Save the event handler so it can be used in our global change event listener subscription. */
|
|
1116
|
-
_saveChangeEventHandler(thumbPosition, handler) {
|
|
1117
|
-
if (thumbPosition === Thumb.START) {
|
|
1118
|
-
this._startInputChangeEventHandler = handler;
|
|
1119
|
-
}
|
|
1120
|
-
else {
|
|
1121
|
-
this._endInputChangeEventHandler = handler;
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
/**
|
|
1125
|
-
* Returns the thumb position of the given event target.
|
|
1126
|
-
* Returns null if the given event target does not correspond to a slider thumb input.
|
|
1127
|
-
*/
|
|
1128
|
-
_getInputThumbPosition(target) {
|
|
1129
|
-
if (target === this._delegate._getInputElement(Thumb.END)) {
|
|
1130
|
-
return Thumb.END;
|
|
1131
|
-
}
|
|
1132
|
-
if (this._delegate._isRange() && target === this._delegate._getInputElement(Thumb.START)) {
|
|
1133
|
-
return Thumb.START;
|
|
1134
|
-
}
|
|
1135
|
-
return null;
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
|
-
/** Ensures that there is not an invalid configuration for the slider thumb inputs. */
|
|
1139
|
-
function _validateInputs(isRange, startInputElement, endInputElement) {
|
|
1140
|
-
const startValid = !isRange || startInputElement.hasAttribute('matSliderStartThumb');
|
|
1141
|
-
const endValid = endInputElement.hasAttribute(isRange ? 'matSliderEndThumb' : 'matSliderThumb');
|
|
1142
|
-
if (!startValid || !endValid) {
|
|
1143
|
-
_throwInvalidInputConfigurationError();
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
/** Validates that the slider has the correct set of thumbs. */
|
|
1147
|
-
function _validateThumbs(isRange, start, end) {
|
|
1148
|
-
if (!end && (!isRange || !start)) {
|
|
1149
|
-
_throwInvalidInputConfigurationError();
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
function _throwInvalidInputConfigurationError() {
|
|
1153
|
-
throw Error(`Invalid slider thumb input configuration!
|
|
1154
|
-
|
|
1155
|
-
Valid configurations are as follows:
|
|
1156
|
-
|
|
1157
|
-
<mat-slider>
|
|
1158
|
-
<input matSliderThumb>
|
|
1159
|
-
</mat-slider>
|
|
1160
|
-
|
|
1161
|
-
or
|
|
1162
|
-
|
|
1163
|
-
<mat-slider>
|
|
1164
|
-
<input matSliderStartThumb>
|
|
1165
|
-
<input matSliderEndThumb>
|
|
1166
|
-
</mat-slider>
|
|
1167
|
-
`);
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
/**
|
|
1171
|
-
* @license
|
|
1172
|
-
* Copyright Google LLC All Rights Reserved.
|
|
1173
|
-
*
|
|
1174
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1175
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1176
|
-
*/
|
|
1177
|
-
class MatSliderModule {
|
|
1178
|
-
}
|
|
1179
|
-
MatSliderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MatSliderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1180
|
-
MatSliderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: MatSliderModule, declarations: [MatSlider, MatSliderThumb, MatSliderVisualThumb], imports: [MatCommonModule, CommonModule, MatRippleModule], exports: [MatSlider, MatSliderThumb] });
|
|
1181
|
-
MatSliderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MatSliderModule, imports: [MatCommonModule, CommonModule, MatRippleModule] });
|
|
1182
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MatSliderModule, decorators: [{
|
|
1183
|
-
type: NgModule,
|
|
1184
|
-
args: [{
|
|
1185
|
-
imports: [MatCommonModule, CommonModule, MatRippleModule],
|
|
1186
|
-
exports: [MatSlider, MatSliderThumb],
|
|
1187
|
-
declarations: [MatSlider, MatSliderThumb, MatSliderVisualThumb],
|
|
1188
|
-
}]
|
|
1189
|
-
}] });
|
|
1190
|
-
|
|
1191
|
-
/**
|
|
1192
|
-
* @license
|
|
1193
|
-
* Copyright Google LLC All Rights Reserved.
|
|
1194
|
-
*
|
|
1195
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1196
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1197
|
-
*/
|
|
1198
|
-
|
|
1199
|
-
/**
|
|
1200
|
-
* @license
|
|
1201
|
-
* Copyright Google LLC All Rights Reserved.
|
|
1202
|
-
*
|
|
1203
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1204
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1205
|
-
*/
|
|
1206
|
-
|
|
1207
|
-
/**
|
|
1208
|
-
* Generated bundle index. Do not edit.
|
|
1209
|
-
*/
|
|
1210
|
-
|
|
1211
|
-
export { MatSlider, MatSliderModule, MatSliderThumb };
|
|
1212
|
-
//# sourceMappingURL=mdc-slider.mjs.map
|