Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/material-experimental/mdc-slider/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ ng_module(
["**/*.ts"],
exclude = ["**/*.spec.ts"],
),
assets = [":slider_scss"] + glob(["**/*.html"]),
assets = [
":slider_scss",
":slider_thumb_scss",
] + glob(["**/*.html"]),
module_name = "@angular/material-experimental/mdc-slider",
deps = [
"//src/cdk/bidi",
Expand Down Expand Up @@ -50,6 +53,11 @@ sass_binary(
],
)

sass_binary(
name = "slider_thumb_scss",
src = "slider-thumb.scss",
)

###########
# Testing
###########
Expand Down
6 changes: 6 additions & 0 deletions src/material-experimental/mdc-slider/_slider-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,10 @@
base: mdc-theme-prop-value($color)
),
));
.mat-mdc-slider-hover-ripple {
background-color: rgba(mdc-theme-prop-value($color), 0.05);
}
.mat-mdc-slider-focus-ripple, .mat-mdc-slider-active-ripple {
background-color: rgba(mdc-theme-prop-value($color), 0.2);
}
}
7 changes: 4 additions & 3 deletions src/material-experimental/mdc-slider/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@

import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {MatCommonModule} from '@angular/material-experimental/mdc-core';
import {MatSlider, MatSliderThumb} from './slider';
import {MatCommonModule, MatRippleModule} from '@angular/material-experimental/mdc-core';
import {MatSlider, MatSliderThumb, MatSliderVisualThumb} from './slider';

@NgModule({
imports: [MatCommonModule, CommonModule],
imports: [MatCommonModule, CommonModule, MatRippleModule],
exports: [MatSlider, MatSliderThumb],
declarations: [
MatSlider,
MatSliderThumb,
MatSliderVisualThumb,
],
})
export class MatSliderModule {
Expand Down
7 changes: 7 additions & 0 deletions src/material-experimental/mdc-slider/slider-thumb.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="mdc-slider__value-indicator-container" *ngIf="discrete">
<div class="mdc-slider__value-indicator">
<span class="mdc-slider__value-indicator-text">{{valueIndicatorText}}</span>
</div>
</div>
<div class="mdc-slider__thumb-knob" #knob></div>
<div matRipple></div>
4 changes: 4 additions & 0 deletions src/material-experimental/mdc-slider/slider-thumb.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.mat-mdc-slider-visual-thumb .mat-ripple {
height: 100%;
width: 100%;
}
14 changes: 6 additions & 8 deletions src/material-experimental/mdc-slider/slider.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
</div>

<!-- Thumbs -->
<div class="mdc-slider__thumb" *ngFor="let thumb of _getThumbTypes()" #thumb>
<div class="mdc-slider__value-indicator-container" *ngIf="discrete">
<div class="mdc-slider__value-indicator">
<span class="mdc-slider__value-indicator-text">{{_getValueIndicatorText(thumb)}}</span>
</div>
</div>
<div class="mdc-slider__thumb-knob" #knob></div>
</div>
<mat-slider-visual-thumb
*ngFor="let thumb of _inputs"
[discrete]="discrete"
[thumbPosition]="thumb._thumbPosition"
[valueIndicatorText]="_getValueIndicatorText(thumb._thumbPosition)">
</mat-slider-visual-thumb>
2 changes: 1 addition & 1 deletion src/material-experimental/mdc-slider/slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

@include mdc-slider.without-ripple($query: $mat-base-styles-query);

.mdc-slider {
.mat-mdc-slider {
display: block;
}
Loading