Skip to content

Commit 0612364

Browse files
committed
4. Move src/material-experimental/mdc-dialog to src/material/dialog
Perform the following steps to complete the move and fix all references: 1. Look at `src/material-experimental/mdc-dialog/BUILD` to see if this component has dependencies on other MDC components that need to be moved out of experimental first. Note: all MDC components depend on `@angular/material-experimental/mdc-core` for `MatCommonModule`. However, this is a direct re-export from `@angular/material/core`, so the import can simply be updated to `import {MatCommonModule} from '@angular/material/core';`. More generally, the import can just be switched for anything that's a direct re-export from `@angular/material/*` 2. Move directory `src/material-experimental/mdc-dialog` to `src/material/dialog` 3. Global find & replace `@angular/material-experimental/mdc-dialog` with `@angular/material/dialog` 4. Global find & replace `src/material-experimental/mdc-dialog` with `src/material/dialog` 5. Global find & replace `mdc_dialog_scss_lib` with `dialog_scss_lib` 6. Under `src/material-experimental` regex replace `@(use|forward|import) '(.?./)+mdc-dialog[^;]*;.*\n` with `` 7. Under `src/material/dialog` search for "material-experimental" and fix any occurrences 8. Under `src/material/dialog` clean up sass references to `@use '@angular/material'` Some common symbols that need to be updated include: - mat.get-color-config -> theming.get-color-config - mat.get-density-config -> theming.get-density-config - mat.get-typography-config -> theming.get-typography-config - mat.private-legacy-get-theme -> theming.private-legacy-get-theme - mat.private-check-duplicate-theme-styles -> theming.private-check-duplicate-theme-styles - mat.private-using-mdc-theme -> mdc-helpers.using-mdc-theme 9. In `src/material/dialog/BUILD`, change the rule named `mdc-dialog` to `dialog` 10. In `src/material-experimental/mdc-core/theming/_all-theme.scss`, change `dialog-theme.theme` to `mat.dialog-theme` 11. In `src/material/_index.scss`, find the line that says `@forward './legacy-dialog/dialog-theme'`, duplicate it, and remove the `legacy-`. 12. In `.ng-dev/commit-message.mts` change `material-experimental/mdc-dialog` to `material/dialog` 13. In `src/material-experimental/config.bzl`, remove `mdc-dialog` and `mdc-dialog/testing` from the `entryPoints` list 14. In `src/material/config.bzl`, add `dialog` and `dialog/testing` to the `entryPoints` list. 15. Copy the `overview` and `source-files` rules from `src/material/legacy-dialog/BUILD` to `src/material/dialog/BUILD` (you'll need to add `markdown_to_html` to the list of rules loaded from `//tools:defaults.bzl`) 16. Copy `src/material/legacy-dialog/dialog.md` to `src/material/dialog/dialog.md` 17. Approve new api golds: `touch tools/public_api_guard/material/dialog.md tools/public_api_guard/material/dialog-testing.md; yarn approve-api dialog; yarn approve-api dialog/testing` 18. Run `yarn format`
1 parent f9deba4 commit 0612364

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+458
-70
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
/src/material-experimental/mdc-checkbox/** @mmalerba
116116
/src/material-experimental/mdc-chips/** @mmalerba
117117
/src/material-experimental/mdc-core/** @crisbeto
118-
/src/material-experimental/mdc-dialog/** @devversion
118+
/src/material/dialog/** @devversion
119119
/src/material/form-field/** @devversion @mmalerba
120120
/src/material-experimental/mdc-list/** @mmalerba @devversion
121121
/src/material-experimental/mdc-menu/** @crisbeto

.ng-dev/commit-message.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const commitMessage: CommitMessageConfig = {
4646
'material-experimental/mdc-checkbox',
4747
'material-experimental/mdc-chips',
4848
'material-experimental/mdc-core',
49-
'material-experimental/mdc-dialog',
49+
'material/dialog',
5050
'material/form-field',
5151
'material/input',
5252
'material-experimental/mdc-list',

src/dev-app/mdc-dialog/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ ng_module(
1313
"//src/cdk/drag-drop",
1414
"//src/material-experimental/mdc-button",
1515
"//src/material-experimental/mdc-checkbox",
16-
"//src/material-experimental/mdc-dialog",
1716
"//src/material-experimental/mdc-select",
1817
"//src/material/card",
18+
"//src/material/dialog",
1919
"//src/material/form-field",
2020
"//src/material/input",
2121
],

src/dev-app/mdc-dialog/mdc-dialog-demo.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use '@angular/material-experimental' as experimental;
1+
@use '@angular/material' as mat;
22

33
.demo-dialog-card {
44
max-width: 600px;
@@ -24,5 +24,5 @@
2424
}
2525

2626
.demo-dialog-legacy-padding {
27-
@include experimental.mdc-dialog-legacy-padding();
27+
@include mat.dialog-legacy-padding();
2828
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
MatLegacyDialogConfig,
1515
MatDialogRef,
1616
MatDialogModule,
17-
} from '@angular/material-experimental/mdc-dialog';
17+
} from '@angular/material/dialog';
1818
import {FormsModule} from '@angular/forms';
1919
import {MatButtonModule} from '@angular/material-experimental/mdc-button';
2020
import {MatCardModule} from '@angular/material/card';

src/e2e-app/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ ng_module(
4545
"//src/material-experimental/mdc-button",
4646
"//src/material-experimental/mdc-checkbox",
4747
"//src/material-experimental/mdc-chips",
48-
"//src/material-experimental/mdc-dialog",
4948
"//src/material-experimental/mdc-menu",
5049
"//src/material-experimental/mdc-progress-spinner",
5150
"//src/material-experimental/mdc-radio",
@@ -57,6 +56,7 @@ ng_module(
5756
"//src/material/card",
5857
"//src/material/checkbox",
5958
"//src/material/core",
59+
"//src/material/dialog",
6060
"//src/material/grid-list",
6161
"//src/material/icon",
6262
"//src/material/input",

src/e2e-app/mdc-dialog/mdc-dialog-e2e-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {NgModule} from '@angular/core';
10-
import {MatDialogModule} from '@angular/material-experimental/mdc-dialog';
10+
import {MatDialogModule} from '@angular/material/dialog';
1111
import {MdcDialogE2E, TestDialog} from './mdc-dialog-e2e';
1212

1313
@NgModule({

src/e2e-app/mdc-dialog/mdc-dialog-e2e.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import {Component, ViewChild, TemplateRef} from '@angular/core';
2-
import {
3-
MatDialog,
4-
MatDialogRef,
5-
MatLegacyDialogConfig,
6-
} from '@angular/material-experimental/mdc-dialog';
2+
import {MatDialog, MatDialogRef, MatLegacyDialogConfig} from '@angular/material/dialog';
73

84
@Component({
95
selector: 'mdc-dialog-e2e',

src/material-experimental/_index.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
mdc-checkbox-typography, mdc-checkbox-density, mdc-checkbox-theme;
3030
@forward './mdc-chips/chips-theme' as mdc-chips-* show mdc-chips-color, mdc-chips-typography,
3131
mdc-chips-density, mdc-chips-theme;
32-
@forward './mdc-dialog/dialog-theme' as mdc-dialog-* show mdc-dialog-color, mdc-dialog-typography,
33-
mdc-dialog-density, mdc-dialog-theme;
3432
@forward './mdc-list/list-theme' as mdc-list-* show mdc-list-color, mdc-list-typography,
3533
mdc-list-density, mdc-list-theme;
3634
@forward './mdc-menu/menu-theme' as mdc-menu-* show mdc-menu-color, mdc-menu-typography,
@@ -56,4 +54,3 @@
5654
mdc-tabs-density, mdc-tabs-theme;
5755

5856
// Additional public APIs for individual components
59-
@forward './mdc-dialog/dialog-legacy-padding' as mdc-dialog-* show mdc-dialog-legacy-padding;

src/material-experimental/config.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ entryPoints = [
99
"mdc-chips",
1010
"mdc-chips/testing",
1111
"mdc-core",
12-
"mdc-dialog",
13-
"mdc-dialog/testing",
1412
"mdc-list",
1513
"mdc-list/testing",
1614
"mdc-menu",

src/material-experimental/mdc-core/color/_all-color.import.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ $mat-mdc-table-mdc-data-table-stroke-color, $mat-mdc-table-mdc-data-table-table-
5252
@forward '../../mdc-paginator/paginator-variables' as mat-mdc-paginator-*;
5353
@forward '../core-theme.import';
5454
@forward '../../mdc-autocomplete/autocomplete-theme' as mat-mdc-autocomplete-*;
55-
@forward '../../mdc-dialog/dialog-theme' as mat-mdc-dialog-*;
5655
@forward '../../mdc-list/interactive-list-theme' as mat-mdc-*;
5756
@forward '../../mdc-list/list-option-theme' as mat-mdc-*;
5857
@forward '../../mdc-list/list-theme' as mat-mdc-list-*;

src/material-experimental/mdc-core/density/_all-density.import.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ $mat-mdc-table-mdc-data-table-stroke-color, $mat-mdc-table-mdc-data-table-table-
5252
@forward '../../mdc-paginator/paginator-variables' as mat-mdc-paginator-*;
5353
@forward '../core-theme.import';
5454
@forward '../../mdc-autocomplete/autocomplete-theme' as mat-mdc-autocomplete-*;
55-
@forward '../../mdc-dialog/dialog-theme' as mat-mdc-dialog-*;
5655
@forward '../../mdc-list/interactive-list-theme' as mat-mdc-*;
5756
@forward '../../mdc-list/list-option-theme' as mat-mdc-*;
5857
@forward '../../mdc-list/list-theme' as mat-mdc-list-*;

src/material-experimental/mdc-core/theming/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ sass_library(
2525
"//src/material-experimental/mdc-checkbox:mdc_checkbox_scss_lib",
2626
"//src/material-experimental/mdc-chips:mdc_chips_scss_lib",
2727
"//src/material-experimental/mdc-core:mdc_core_scss_lib",
28-
"//src/material-experimental/mdc-dialog:mdc_dialog_scss_lib",
2928
"//src/material-experimental/mdc-list:mdc_list_scss_lib",
3029
"//src/material-experimental/mdc-menu:mdc_menu_scss_lib",
3130
"//src/material-experimental/mdc-paginator:mdc_paginator_scss_lib",
@@ -38,6 +37,7 @@ sass_library(
3837
"//src/material-experimental/mdc-table:mdc_table_scss_lib",
3938
"//src/material-experimental/mdc-tabs:mdc_tabs_scss_lib",
4039
"//src/material/card:card_scss_lib",
40+
"//src/material/dialog:dialog_scss_lib",
4141
"//src/material/form-field:form_field_scss_lib",
4242
"//src/material/input:input_scss_lib",
4343
"//src/material/progress-bar:progress_bar_scss_lib",

src/material-experimental/mdc-core/theming/_all-theme.import.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ $mat-mdc-table-mdc-data-table-stroke-color, $mat-mdc-table-mdc-data-table-table-
5252
@forward '../../mdc-paginator/paginator-variables' as mat-mdc-paginator-*;
5353
@forward '../core-theme.import';
5454
@forward '../../mdc-autocomplete/autocomplete-theme' as mat-mdc-autocomplete-*;
55-
@forward '../../mdc-dialog/dialog-theme' as mat-mdc-dialog-*;
5655
@forward '../../mdc-list/interactive-list-theme' as mat-mdc-*;
5756
@forward '../../mdc-list/list-option-theme' as mat-mdc-*;
5857
@forward '../../mdc-list/list-theme' as mat-mdc-list-*;
@@ -66,7 +65,6 @@ $mat-mdc-table-mdc-data-table-stroke-color, $mat-mdc-table-mdc-data-table-table-
6665
@import '../../mdc-button/button-theme';
6766
@import '../../mdc-checkbox/checkbox-theme';
6867
@import '../../mdc-chips/chips-theme';
69-
@import '../../mdc-dialog/dialog-theme';
7068
@import '../../mdc-list/list-theme';
7169
@import '../../mdc-menu/menu-theme';
7270
@import '../../mdc-radio/radio-theme';

src/material-experimental/mdc-core/theming/_all-theme.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
@use '../../mdc-button/icon-button-theme';
88
@use '../../mdc-checkbox/checkbox-theme';
99
@use '../../mdc-chips/chips-theme';
10-
@use '../../mdc-dialog/dialog-theme';
1110
@use '../../mdc-list/list-theme';
1211
@use '../../mdc-menu/menu-theme';
1312
@use '../../mdc-radio/radio-theme';
@@ -26,7 +25,7 @@
2625
@include core-theme.theme($theme-or-color-config);
2726
@include autocomplete-theme.theme($theme-or-color-config);
2827
@include button-theme.theme($theme-or-color-config);
29-
@include dialog-theme.theme($theme-or-color-config);
28+
@include mat.dialog-theme($theme-or-color-config);
3029
@include fab-theme.theme($theme-or-color-config);
3130
@include icon-button-theme.theme($theme-or-color-config);
3231
@include mat.card-theme($theme-or-color-config);

src/material-experimental/mdc-core/typography/_all-typography.import.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ $mat-mdc-table-mdc-data-table-stroke-color, $mat-mdc-table-mdc-data-table-table-
5252
@forward '../../mdc-paginator/paginator-variables' as mat-mdc-paginator-*;
5353
@forward '../core-theme.import';
5454
@forward '../../mdc-autocomplete/autocomplete-theme' as mat-mdc-autocomplete-*;
55-
@forward '../../mdc-dialog/dialog-theme' as mat-mdc-dialog-*;
5655
@forward '../../mdc-list/interactive-list-theme' as mat-mdc-*;
5756
@forward '../../mdc-list/list-option-theme' as mat-mdc-*;
5857
@forward '../../mdc-list/list-theme' as mat-mdc-list-*;

src/material/_index.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
@forward './datepicker/datepicker-theme' as datepicker-* show datepicker-theme, datepicker-color,
9090
datepicker-typography, datepicker-date-range-colors;
9191
@forward './legacy-dialog/dialog-theme' as legacy-dialog-* show legacy-dialog-theme, legacy-dialog-color, legacy-dialog-typography;
92+
@forward './dialog/dialog-theme' as dialog-* show dialog-theme, dialog-color, dialog-typography;
93+
@forward './dialog/dialog-legacy-padding' as dialog-* show dialog-legacy-padding;
9294
@forward './divider/divider-theme' as divider-* show divider-theme, divider-color,
9395
divider-typography;
9496
@forward './expansion/expansion-theme' as expansion-* show expansion-theme, expansion-color,

src/material/config.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ entryPoints = [
2525
"datepicker/testing",
2626
"legacy-dialog",
2727
"legacy-dialog/testing",
28+
"dialog",
29+
"dialog/testing",
2830
"divider",
2931
"divider/testing",
3032
"expansion",

src/material-experimental/mdc-dialog/BUILD.bazel renamed to src/material/dialog/BUILD.bazel

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
load("//src/e2e-app:test_suite.bzl", "e2e_test_suite")
22
load(
33
"//tools:defaults.bzl",
4+
"markdown_to_html",
45
"ng_e2e_test_library",
56
"ng_module",
67
"ng_test_library",
@@ -12,7 +13,7 @@ load(
1213
package(default_visibility = ["//visibility:public"])
1314

1415
ng_module(
15-
name = "mdc-dialog",
16+
name = "dialog",
1617
srcs = glob(
1718
["**/*.ts"],
1819
exclude = ["**/*.spec.ts"],
@@ -28,11 +29,10 @@ ng_module(
2829
)
2930

3031
sass_library(
31-
name = "mdc_dialog_scss_lib",
32+
name = "dialog_scss_lib",
3233
srcs = glob(["**/_*.scss"]),
3334
deps = [
3435
"//:mdc_sass_lib",
35-
"//src/material:sass_lib",
3636
"//src/material/core:core_scss_lib",
3737
],
3838
)
@@ -41,9 +41,8 @@ sass_binary(
4141
name = "dialog_scss",
4242
src = "dialog.scss",
4343
deps = [
44-
":mdc_dialog_scss_lib",
44+
":dialog_scss_lib",
4545
"//:mdc_sass_lib",
46-
"//src/material:sass_lib",
4746
"//src/material/core:core_scss_lib",
4847
],
4948
)
@@ -97,3 +96,13 @@ e2e_test_suite(
9796
"//src/cdk/testing/private/e2e",
9897
],
9998
)
99+
100+
markdown_to_html(
101+
name = "overview",
102+
srcs = [":dialog.md"],
103+
)
104+
105+
filegroup(
106+
name = "source-files",
107+
srcs = glob(["**/*.ts"]),
108+
)

src/material-experimental/mdc-dialog/README.md renamed to src/material/dialog/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ experimental and should not be used in production.
77
Assuming your application is already up and running using Angular Material, you can add this
88
component by following these steps:
99

10-
1. Install `@angular/material-experimental` and MDC Web:
10+
1. Install `@angular/material` and MDC Web:
1111

1212
```bash
13-
npm i material-components-web @angular/material-experimental
13+
npm i material-components-web @angular/material
1414
```
1515

1616
2. In your `angular.json`, make sure `node_modules/` is listed as a Sass include path. This is
@@ -33,7 +33,7 @@ component by following these steps:
3333
component:
3434

3535
```ts
36-
import {MatDialogModule} from '@angular/material-experimental/mdc-dialog';
36+
import {MatDialogModule} from '@angular/material/dialog';
3737

3838
@NgModule({
3939
declarations: [MyComponent],
@@ -45,9 +45,9 @@ component by following these steps:
4545
4. Use the `MatDialog` service in your components by injecting the service, just like you would
4646
use the normal dialog.
4747

48-
5. Ensure color and typography styles for `@angular/material-experimental` are set up. Either
49-
use a custom theme and use the `mat-mdc-dialog-theme` mixin, or use a prebuilt theme
50-
from `@angular/material/core/theming/prebuilt`.
48+
5. Ensure color and typography styles for `@angular/material` are set up. Either
49+
use a custom theme and use the `mat-dialog-theme` mixin, or use a prebuilt theme
50+
from `@angular/material/mdc-core/theming/prebuilt`.
5151

5252
## API differences
5353

@@ -68,7 +68,7 @@ directly through CSS, or move them into one of the defined sections the Angular
6868
provides.
6969

7070
```scss
71-
@use '@angular/material-experimental' as experimental;
71+
@use '@angular/material' as mat;
7272

73-
@include experimental.mdc-dialog-legacy-padding();
73+
@include mat.dialog-legacy-padding();
7474
```

src/material-experimental/mdc-dialog/_dialog-theme.scss renamed to src/material/dialog/_dialog-theme.scss

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
@use 'sass:map';
2-
@use '@angular/material' as mat;
32
@use '@material/dialog' as mdc-dialog;
43
@use '@material/dialog/dialog-theme' as mdc-dialog-theme;
54
@use '@material/theme/theme-color' as mdc-theme-color;
65
@use '@material/typography' as mdc-typography;
6+
@use '../core/theming/theming';
7+
@use '../core/mdc-helpers/mdc-helpers';
8+
@use '../core/typography/typography';
79

810
@mixin color($config-or-theme) {
9-
$config: mat.get-color-config($config-or-theme);
11+
$config: theming.get-color-config($config-or-theme);
1012

11-
@include mat.private-using-mdc-theme($config) {
13+
@include mdc-helpers.using-mdc-theme($config) {
1214
.mat-mdc-dialog-container {
1315
$surface: mdc-theme-color.$surface;
1416
$on-surface: mdc-theme-color.$on-surface;
@@ -28,9 +30,9 @@
2830
}
2931

3032
@mixin typography($config-or-theme) {
31-
$config: mat.private-typography-to-2018-config(
32-
mat.get-typography-config($config-or-theme));
33-
@include mat.private-using-mdc-typography($config) {
33+
$config: typography.private-typography-to-2018-config(
34+
theming.get-typography-config($config-or-theme));
35+
@include mdc-helpers.using-mdc-typography($config) {
3436
.mat-mdc-dialog-container {
3537
$styles: mdc-typography.$styles;
3638
$headline6: map.get($styles, headline6);
@@ -53,15 +55,15 @@
5355
}
5456

5557
@mixin density($config-or-theme) {
56-
$density-scale: mat.get-density-config($config-or-theme);
58+
$density-scale: theming.get-density-config($config-or-theme);
5759
}
5860

5961
@mixin theme($theme-or-color-config) {
60-
$theme: mat.private-legacy-get-theme($theme-or-color-config);
61-
@include mat.private-check-duplicate-theme-styles($theme, 'mat-mdc-dialog') {
62-
$color: mat.get-color-config($theme);
63-
$density: mat.get-density-config($theme);
64-
$typography: mat.get-typography-config($theme);
62+
$theme: theming.private-legacy-get-theme($theme-or-color-config);
63+
@include theming.private-check-duplicate-theme-styles($theme, 'mat-mdc-dialog') {
64+
$color: theming.get-color-config($theme);
65+
$density: theming.get-density-config($theme);
66+
$typography: theming.get-typography-config($theme);
6567

6668
@if $color != null {
6769
@include color($color);

0 commit comments

Comments
 (0)