Skip to content

Commit 6bda718

Browse files
opozojelbourn
authored andcommitted
feat(material-experimental/mdc-snackbar): add skeleton (#17161)
1 parent bc58e79 commit 6bda718

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
@@ -104,6 +104,7 @@
104104
/src/material-experimental/mdc-progress-bar/** @andrewseguin
105105
# Note to implementer: please repossess
106106
/src/material-experimental/mdc-radio/** @mmalerba
107+
/src/material-experimental/mdc-snackbar/** @opozo
107108
/src/material-experimental/mdc-slide-toggle/** @crisbeto
108109
/src/material-experimental/mdc-slider/** @devversion
109110
/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
@@ -184,6 +184,8 @@ System.config({
184184
'dist/packages/material-experimental/mdc-menu/index.js',
185185
'@angular/material-experimental/mdc-radio':
186186
'dist/packages/material-experimental/mdc-radio/index.js',
187+
'@angular/material-experimental/mdc-snackbar':
188+
'dist/packages/material-experimental/mdc-snackbar/index.js',
187189
'@angular/material-experimental/mdc-slide-toggle':
188190
'dist/packages/material-experimental/mdc-slide-toggle/index.js',
189191
'@angular/material-experimental/mdc-slider':

0 commit comments

Comments
 (0)