Skip to content

Commit 8063e13

Browse files
committed
feat(material-experimental/mdc-slider): delete old code
* clearing the outdated code from mdc-slider * this will also make future commit messages easier to read
1 parent 55f2f27 commit 8063e13

File tree

13 files changed

+48
-2246
lines changed

13 files changed

+48
-2246
lines changed
Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +0,0 @@
1-
<h1>Default Slider</h1>
2-
Label <mat-slider #slidey aria-label="Basic slider"></mat-slider>
3-
{{slidey.value}}
4-
5-
<h1>Colors</h1>
6-
<mat-slider color="primary" value="50" thumbLabel aria-label="Primary color slider"></mat-slider>
7-
<mat-slider color="accent" value="50" thumbLabel aria-label="Accent color slider"></mat-slider>
8-
<mat-slider color="warn" value="50" thumbLabel aria-label="Warn color slider"></mat-slider>
9-
10-
<h1>Slider with Min and Max</h1>
11-
<input [(ngModel)]="min" type="number">
12-
<mat-slider [min]="min" [max]="max" tickInterval="5" #slider2 aria-label="Min & max slider">
13-
</mat-slider>
14-
{{slider2.value}}
15-
<input [(ngModel)]="max" type="number">
16-
17-
<h1>Disabled Slider</h1>
18-
<mat-slider disabled [(ngModel)]="disabledValue" [tickInterval]="1" aria-label="Disabled slider">
19-
</mat-slider>
20-
<input [(ngModel)]="disabledValue" type="number">
21-
22-
<h1>Slider with set value</h1>
23-
<mat-slider value="43" aria-label="Initial value slider"></mat-slider>
24-
25-
<h1>Slider with step defined</h1>
26-
<mat-slider min="1" max="100" step="20" #slider5 aria-label="Slider with step"></mat-slider>
27-
{{slider5.value}}
28-
29-
<h1>Slider with set tick interval</h1>
30-
<mat-slider tickInterval="auto" aria-label="Slider with auto ticks"></mat-slider>
31-
<mat-slider tickInterval="9" aria-label="Slider with ticks"></mat-slider>
32-
33-
<h1>Slider with Thumb Label</h1>
34-
<mat-slider thumbLabel aria-label="Slider with thumb label"></mat-slider>
35-
36-
<h1>Slider with one-way binding</h1>
37-
<mat-slider [value]="val" step="40" aria-label="Slider with value binding"></mat-slider>
38-
<input [(ngModel)]="val" type="number">
39-
40-
<h1>Slider with two-way binding</h1>
41-
<mat-slider [(ngModel)]="demo" step="40" aria-label="Slider with ngModel"></mat-slider>
42-
<input [(ngModel)]="demo" type="number">
43-
44-
<h1>Set/lost focus to show thumblabel programmatically</h1>
45-
<mat-slider #demoSlider="matSlider" thumbLabel aria-label="Slider with thumb label"></mat-slider>
46-
<button (click)="demoSlider.focus()">Focus Slider</button>
47-
<button (click)="demoSlider.blur()">Blur Slider</button>
48-
49-
<mat-tab-group>
50-
<mat-tab label="One">
51-
<mat-slider min="1" max="5" value="3" aria-label="Slider in a tab"></mat-slider>
52-
</mat-tab>
53-
</mat-tab-group>

src/dev-app/mdc-slider/mdc-slider-demo.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,4 @@ import {Component} from '@angular/core';
1313
selector: 'mdc-slider-demo',
1414
templateUrl: 'mdc-slider-demo.html',
1515
})
16-
export class MdcSliderDemo {
17-
demo: number;
18-
val: number = 50;
19-
min: number = 0;
20-
max: number = 100;
21-
disabledValue = 0;
22-
}
16+
export class MdcSliderDemo {}

src/material-experimental/mdc-slider/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ ng_e2e_test_library(
8484
name = "e2e_test_sources",
8585
srcs = glob(["**/*.e2e.spec.ts"]),
8686
deps = [
87+
":mdc-slider",
8788
"//src/cdk/testing/private/e2e",
8889
],
8990
)

src/material-experimental/mdc-slider/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {MatSlider} from './slider';
1313

1414
@NgModule({
1515
imports: [MatCommonModule, CommonModule],
16-
exports: [MatSlider, MatCommonModule],
16+
exports: [MatSlider],
1717
declarations: [MatSlider],
1818
})
1919
export class MatSliderModule {

src/material-experimental/mdc-slider/public-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
export * from './slider';
10-
export * from './module';
9+
export {MatSlider} from './slider';
10+
export {MatSliderModule} from './module';
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import {browser, by, element} from 'protractor';
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
28

3-
// TODO: disabled until we implement the new MDC slider.
4-
describe('mat-slider dummy' , () => it('', () => {}));
9+
/* tslint:disable-next-line:no-unused-variable */
10+
import {MatSlider} from './index';
511

6-
// tslint:disable-next-line:ban
7-
xdescribe('mat-slider', () => {
8-
beforeEach(async () => await browser.get('/mdc-slider'));
9-
10-
it('should show a slider', async () => {
11-
expect(await element(by.tagName('mat-slider')).isPresent()).toBe(true);
12-
});
12+
// TODO(wagnermaciel): Implement this in a separate PR
1313

14+
describe('MDC-based MatSlider' , () => {
15+
it('does nothing yet', async () => {});
1416
});
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
<!-- TODO: to be implemented as a part of the new MDC slider -->
Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +0,0 @@
1-
// TODO: disabled until we implement the new MDC slider.
2-
// @import '@material/slider/mixins.import';
3-
@import '../mdc-helpers/mdc-helpers';
4-
@import '../../cdk/a11y/a11y';
5-
6-
$mat-slider-min-size: 128px !default;
7-
$mat-slider-horizontal-margin: 8px !default;
8-
9-
// TODO: disabled until we implement the new MDC slider.
10-
// @include mdc-slider-core-styles($query: $mat-base-styles-without-animation-query);
11-
12-
// Overwrites the mdc-slider default styles to match the visual appearance of the
13-
// Angular Material standard slider. This involves making the slider an inline-block
14-
// element, aligning it in the vertical middle of a line, specifying a default minimum
15-
// width and adding horizontal margin.
16-
.mat-mdc-slider {
17-
display: inline-block;
18-
box-sizing: border-box;
19-
outline: none;
20-
vertical-align: middle;
21-
margin: {
22-
left: $mat-slider-horizontal-margin;
23-
right: $mat-slider-horizontal-margin;
24-
}
25-
26-
// Unset the default "width" property from the MDC slider class. We don't want
27-
// the slider to automatically expand horizontally for backwards compatibility.
28-
width: auto;
29-
min-width: $mat-slider-min-size - (2 * $mat-slider-horizontal-margin);
30-
31-
@include cdk-high-contrast(active, off) {
32-
// The slider track isn't visible in high contrast mode so we work
33-
// around it by setting an outline and removing the height to make it look solid.
34-
.mdc-slider__track-container {
35-
height: 0;
36-
outline: solid 2px;
37-
margin-top: 1px;
38-
}
39-
40-
// Adds an outline around the thumb label so it doesn't just float on top of the slider.
41-
.mdc-slider__pin-value-marker {
42-
outline: solid 1px;
43-
}
44-
}
45-
}
46-
47-
// In order to make it possible for developers to disable animations for a slider,
48-
// we only activate the MDC slider animation styles if animations are enabled.
49-
.mat-mdc-slider:not(._mat-animation-noopable) {
50-
// TODO: disabled until we implement the new MDC slider.
51-
// @include mdc-slider-core-styles($query: animation);
52-
}
53-
54-
// Sliders without a thumb label (aka non-discrete) currently cannot have ticks
55-
// enabled. This breaks backwards compatibility with the standard Angular Material
56-
// slider, so we manually ensure that ticks can be rendered.
57-
.mat-slider-has-ticks:not(.mat-slider-disabled) .mdc-slider__track-marker-container {
58-
visibility: visible;
59-
}

0 commit comments

Comments
 (0)