Skip to content

Commit 2076785

Browse files
committed
feat(material-experimental/mdc-snackbar): Add skeleton.
1 parent 7f6972f commit 2076785

File tree

11 files changed

+117
-0
lines changed

11 files changed

+117
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
/src/material-experimental/mdc-progress-bar/** @andrewseguin
104104
# Note to implementer: please repossess
105105
/src/material-experimental/mdc-radio/** @mmalerba
106+
/src/material-experimental/mdc-snackbar/** @opozo
106107
/src/material-experimental/mdc-slide-toggle/** @crisbeto
107108
/src/material-experimental/mdc-slider/** @devversion
108109
/src/material-experimental/mdc-tabs/** @crisbeto
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library")
4+
load("//:packages.bzl", "CDK_TARGETS", "MATERIAL_TARGETS")
5+
load("//tools:defaults.bzl", "ng_module")
6+
7+
ng_module(
8+
name = "mdc-snackbar",
9+
srcs = glob(
10+
["**/*.ts"],
11+
exclude = ["**/*.spec.ts"],
12+
),
13+
assets = [":snackbar_scss"] + glob(["**/*.html"]),
14+
module_name = "@angular/material-experimental/mdc-snackbar",
15+
deps = [
16+
"@npm//material-components-web",
17+
] + CDK_TARGETS + MATERIAL_TARGETS,
18+
)
19+
20+
sass_library(
21+
name = "snackbar_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 = "snackbar_scss",
31+
src = "snackbar.scss",
32+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@mixin mat-snackbar-theme-mdc($theme) {
2+
}
3+
4+
@mixin mat-snackbar-typography-mdc($config) {
5+
}
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 {MatSnackbar} from './snackbar';
13+
14+
@NgModule({
15+
imports: [MatCommonModule, CommonModule],
16+
exports: [MatSnackbar, MatCommonModule],
17+
declarations: [MatSnackbar],
18+
})
19+
export class MatSnackbarModule {
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 './snackbar';
10+
export * from './module';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- WIP: MDC-based snackbar -->
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// WIP: MDC-based snackbar
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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-snackbar',
14+
templateUrl: 'snackbar.html',
15+
styleUrls: ['snackbar.css'],
16+
exportAs: 'matSnackbar',
17+
encapsulation: ViewEncapsulation.None,
18+
changeDetection: ChangeDetectionStrategy.OnPush,
19+
})
20+
export class MatSnackbar {
21+
}
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-snackbar",
12+
"skipTemplateCodegen": true,
13+
"fullTemplateTypeCheck": true
14+
}
15+
}

test/karma-system-config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ System.config({
174174
'dist/packages/material-experimental/mdc-menu/index.js',
175175
'@angular/material-experimental/mdc-radio':
176176
'dist/packages/material-experimental/mdc-radio/index.js',
177+
'@angular/material-experimental/mdc-snackbar':
178+
'dist/packages/material-experimental/mdc-snackbar/index.js',
177179
'@angular/material-experimental/mdc-slide-toggle':
178180
'dist/packages/material-experimental/mdc-slide-toggle/index.js',
179181
'@angular/material-experimental/mdc-slider':

0 commit comments

Comments
 (0)