Skip to content

Commit 859c595

Browse files
committed
feat(material-experimental): initial boilerplate for mdc-slider prototype
1 parent b385734 commit 859c595

File tree

11 files changed

+153
-0
lines changed

11 files changed

+153
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library")
4+
load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module", "ng_web_test_suite")
5+
load("//src/e2e-app:test_suite.bzl", "e2e_test_suite")
6+
7+
ng_module(
8+
name = "mdc-slider",
9+
srcs = glob(
10+
["**/*.ts"],
11+
exclude = ["**/*.spec.ts"],
12+
),
13+
assets = [":slider_scss"] + glob(["**/*.html"]),
14+
module_name = "@angular/material-experimental/mdc-slider",
15+
deps = [
16+
"//src/material/core",
17+
],
18+
)
19+
20+
sass_library(
21+
name = "slider_scss_lib",
22+
srcs = glob(["**/_*.scss"]),
23+
deps = [
24+
"//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
25+
"//src/material/core:core_scss_lib",
26+
],
27+
)
28+
29+
sass_binary(
30+
name = "slider_scss",
31+
src = "slider.scss",
32+
)
33+
34+
ng_web_test_suite(
35+
name = "unit_tests",
36+
static_files = ["@npm//:node_modules/@material/slider/dist/mdc.slider.js"],
37+
deps = [
38+
# TODO: add slider tests target here.
39+
"//src/material-experimental:mdc_require_config.js",
40+
],
41+
)
42+
43+
ng_e2e_test_library(
44+
name = "e2e_test_sources",
45+
srcs = glob(["**/*.e2e.spec.ts"]),
46+
deps = [
47+
"//src/cdk/private/testing/e2e",
48+
],
49+
)
50+
51+
e2e_test_suite(
52+
name = "e2e_tests",
53+
deps = [
54+
":e2e_test_sources",
55+
"//src/cdk/private/testing/e2e",
56+
],
57+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a placeholder for the MDC-based implementation of slider.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@import '../mdc-helpers/mdc-helpers';
2+
3+
@mixin mat-slider-theme-mdc($theme) {
4+
@include mat-using-mdc-theme($theme) {
5+
// TODO: MDC theme styles here.
6+
}
7+
}
8+
9+
@mixin mat-slider-typography-mdc($config) {
10+
@include mat-using-mdc-typography($config) {
11+
// TODO: MDC typography styles here.
12+
}
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
*/
8+
9+
export * from './public-api';
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
*/
8+
9+
import {CommonModule} from '@angular/common';
10+
import {NgModule} from '@angular/core';
11+
import {MatCommonModule} from '@angular/material/core';
12+
import {MatSlider} from './slider';
13+
14+
@NgModule({
15+
imports: [MatCommonModule, CommonModule],
16+
exports: [MatSlider, MatCommonModule],
17+
declarations: [MatSlider],
18+
})
19+
export class MatSliderModule {
20+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
*/
8+
9+
export * from './slider';
10+
export * from './module';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// TODO: copy tests from existing mat-slider, update as necessary to fix.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- TODO: MDC template here. -->
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// TODO: MDC core styles here.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
*/
8+
9+
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';
10+
11+
@Component({
12+
moduleId: module.id,
13+
selector: 'mat-slider',
14+
templateUrl: 'slider.html',
15+
styleUrls: ['slider.css'],
16+
host: {
17+
'class': 'mat-mdc-slider',
18+
},
19+
exportAs: 'matSlider',
20+
encapsulation: ViewEncapsulation.None,
21+
changeDetection: ChangeDetectionStrategy.OnPush,
22+
})
23+
export class MatSlider {
24+
// TODO: set up MDC foundation class.
25+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "../tsconfig-build",
3+
"files": [
4+
"public-api.ts",
5+
"../typings.d.ts"
6+
],
7+
"angularCompilerOptions": {
8+
"annotateForClosureCompiler": true,
9+
"strictMetadataEmit": true,
10+
"flatModuleOutFile": "index.js",
11+
"flatModuleId": "@angular/material-experimental/mdc-slider",
12+
"skipTemplateCodegen": true,
13+
"fullTemplateTypeCheck": true
14+
}
15+
}

0 commit comments

Comments
 (0)