Skip to content

Commit 0318b73

Browse files
committed
chore: initial boilerplate for mdc-based dialog
1 parent 695dde6 commit 0318b73

File tree

11 files changed

+149
-0
lines changed

11 files changed

+149
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
load("//src/e2e-app:test_suite.bzl", "e2e_test_suite")
4+
load(
5+
"//tools:defaults.bzl",
6+
"ng_e2e_test_library",
7+
"ng_module",
8+
"ng_test_library",
9+
"ng_web_test_suite",
10+
"sass_binary",
11+
"sass_library",
12+
)
13+
14+
ng_module(
15+
name = "mdc-dialog",
16+
srcs = glob(
17+
["**/*.ts"],
18+
exclude = ["**/*.spec.ts"],
19+
),
20+
assets = [":dialog_scss"] + glob(["**/*.html"]),
21+
module_name = "@angular/material-experimental/mdc-dialog",
22+
deps = [
23+
"//src/material/core",
24+
"@npm//@material/dialog",
25+
],
26+
)
27+
28+
sass_library(
29+
name = "mdc_dialog_scss_lib",
30+
srcs = glob(["**/_*.scss"]),
31+
deps = [
32+
"//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
33+
],
34+
)
35+
36+
sass_binary(
37+
name = "dialog_scss",
38+
src = "dialog.scss",
39+
include_paths = [
40+
"external/npm/node_modules",
41+
],
42+
deps = [
43+
"//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
44+
"//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
45+
],
46+
)
47+
48+
###########
49+
# Testing
50+
###########
51+
52+
ng_test_library(
53+
name = "dialog_tests_lib",
54+
srcs = glob(
55+
["**/*.spec.ts"],
56+
exclude = ["**/*.e2e.spec.ts"],
57+
),
58+
deps = [
59+
":mdc-dialog",
60+
"@npm//@angular/platform-browser",
61+
],
62+
)
63+
64+
ng_web_test_suite(
65+
name = "unit_tests",
66+
static_files = [
67+
"@npm//:node_modules/@material/dialog/dist/mdc.dialog.js",
68+
],
69+
deps = [
70+
":dialog_tests_lib",
71+
"//src/material-experimental:mdc_require_config.js",
72+
],
73+
)
74+
75+
ng_e2e_test_library(
76+
name = "e2e_test_sources",
77+
srcs = glob(["**/*.e2e.spec.ts"]),
78+
deps = [
79+
"//src/cdk/testing/private/e2e",
80+
],
81+
)
82+
83+
e2e_test_suite(
84+
name = "e2e_tests",
85+
deps = [
86+
":e2e_test_sources",
87+
"//src/cdk/testing/private/e2e",
88+
],
89+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a placeholder for the MDC-based implementation of dialog.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@import '../mdc-helpers/mdc-helpers';
2+
@import '@material/dialog/mixins.import';
3+
4+
@mixin mat-mdc-dialog-theme($theme) {
5+
@include mat-using-mdc-theme($theme) {
6+
}
7+
8+
@mixin mat-mdc-dialog-typography($config) {
9+
@include mat-using-mdc-typography($config) {
10+
}
11+
}

src/material-experimental/mdc-dialog/dialog.e2e.spec.ts

Whitespace-only changes.

src/material-experimental/mdc-dialog/dialog.html

Whitespace-only changes.

src/material-experimental/mdc-dialog/dialog.scss

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
describe('MDC-based MatDialog', () => {});
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 class MatDialog {}
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';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
13+
@NgModule({
14+
imports: [MatCommonModule, CommonModule],
15+
exports: [],
16+
declarations: [],
17+
})
18+
export class MatDialogModule {
19+
}
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 './dialog';
10+
export * from './module';

0 commit comments

Comments
 (0)