Skip to content

Commit 3d830de

Browse files
committed
refactor: update to MDC 4.0.0 stable
Updates the repo to MDC 4.0.0 stable and fixes the breaking changes.
1 parent 5c92c06 commit 3d830de

File tree

6 files changed

+516
-504
lines changed

6 files changed

+516
-504
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"version": "9.0.0-rc.0",
4444
"requiredAngularVersion": "^9.0.0-0 || ^10.0.0-0",
45-
"requiredMDCVersion": "^4.0.0-canary.062ade5c0.0",
45+
"requiredMDCVersion": "^4.0.0",
4646
"dependencies": {
4747
"@angular/animations": "^9.0.0-rc.0",
4848
"@angular/common": "^9.0.0-rc.0",
@@ -55,7 +55,7 @@
5555
"@types/youtube": "^0.0.38",
5656
"@webcomponents/custom-elements": "^1.1.0",
5757
"core-js": "^2.6.9",
58-
"material-components-web": "^4.0.0-canary.062ade5c0.0",
58+
"material-components-web": "^4.0.0",
5959
"rxjs": "^6.5.3",
6060
"systemjs": "0.19.43",
6161
"tsickle": "^0.37.0",

packages.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# all in-sync. This map is passed to each ng_package rule to stamp out the appropriate
33
# version for the placeholders.
44
ANGULAR_PACKAGE_VERSION = "^9.0.0-0 || ^10.0.0-0"
5-
MDC_PACKAGE_VERSION = "^4.0.0-canary.062ade5c0.0"
5+
MDC_PACKAGE_VERSION = "^4.0.0"
66
VERSION_PLACEHOLDER_REPLACEMENTS = {
77
"0.0.0-MDC": MDC_PACKAGE_VERSION,
88
"0.0.0-NG": ANGULAR_PACKAGE_VERSION,

src/material-experimental/mdc-menu/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ sass_binary(
4747
"external/npm/node_modules",
4848
],
4949
deps = [
50+
"//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
5051
"//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
5152
"//src/material/core:core_scss_lib",
5253
],

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@import '../../material/core/style/menu-common';
55
@import '../../material/core/style/button-common';
66
@import '../../cdk/a11y/a11y';
7+
@import '../mdc-helpers/mdc-helpers';
78

89
@include mdc-menu-surface-core-styles($query: structure);
910

@@ -28,13 +29,20 @@
2829
}
2930

3031
.mat-mdc-menu-item {
32+
$height: mdc-density-prop-value(
33+
$density-config: $mdc-list-single-line-density-config,
34+
$density-scale: $mdc-list-single-line-density-scale,
35+
$property-name: height,
36+
);
37+
3138
// Note that we include this private mixin, because the public
3239
// one adds a bunch of styles that we aren't using for the menu.
3340
@include mdc-list-item-base_;
3441

3542
// MDC's menu items are `<li>` nodes which don't need resets, however ours
3643
// can be anything, including buttons, so we need to do the reset ourselves.
3744
@include mat-button-reset;
45+
@include mdc-list-single-line-height($height, $query: $mat-base-styles-query);
3846
cursor: pointer;
3947
width: 100%;
4048
text-align: left;

src/material-experimental/mdc-progress-bar/progress-bar.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,13 @@ export class MatProgressBar extends _MatProgressBarMixinBase implements AfterVie
8181
addClass: (className: string) => this._rootElement.classList.add(className),
8282
getBuffer: () => this._bufferBar,
8383
getPrimaryBar: () => this._primaryBar,
84-
// TODO(crisbeto): remove the ` as MDCLinearProgressAdapter` below once this is released:
85-
// tslint:disable-next-line:max-line-length
86-
// https://github.com/material-components/material-components-web/commit/062ade5c052cf00cefeee6e8e0acf7d16c4ce338
87-
// We add `forceLayout` before the code requiring it is in the canary
88-
// release so that our cronjob that runs against master doesn't fail.
8984
forceLayout: () => this._platform.isBrowser && this._rootElement.offsetWidth,
9085
hasClass: (className: string) => this._rootElement.classList.contains(className),
9186
removeClass: (className: string) => this._rootElement.classList.remove(className),
9287
setStyle: (el: HTMLElement, styleProperty: string, value: string) => {
9388
(el.style as any)[styleProperty] = value;
9489
}
95-
} as MDCLinearProgressAdapter;
90+
};
9691

9792
/** Flag that indicates whether NoopAnimations mode is set to true. */
9893
_isNoopAnimation = false;

0 commit comments

Comments
 (0)