Skip to content

Commit b0dff85

Browse files
Angular Material Teammmalerba
authored andcommitted
Project import generated by Copybara.
PiperOrigin-RevId: 351815658
1 parent ecb5663 commit b0dff85

File tree

10 files changed

+37
-122
lines changed

10 files changed

+37
-122
lines changed

src/material-experimental/mdc-autocomplete/animations.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
[ngClass]="_classList"
77
[attr.aria-label]="ariaLabel || null"
88
[attr.aria-labelledby]="_getPanelAriaLabelledby(formFieldId)"
9-
[@panelAnimation]="isOpen ? 'visible' : 'hidden'"
109
#panel>
1110
<ng-content></ng-content>
1211
</div>

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
max-height: 256px; // Prevents lists with a lot of option from growing too high.
1414
position: static; // MDC uses `absolute` by default which will throw off our positioning.
1515
visibility: hidden;
16-
// MDC sets the transform-origin programatically based on whether the dropdown is above or below
17-
// the input. We use our own positioning logic, so we need to set this ourselves.
18-
transform-origin: center top;
1916

2017
// Note that we include this private mixin, because the public
2118
// one adds a bunch of styles that we aren't using for the menu.
@@ -32,9 +29,6 @@
3229
.mat-mdc-autocomplete-panel-above & {
3330
border-bottom-left-radius: 0;
3431
border-bottom-right-radius: 0;
35-
// MDC sets the transform-origin programatically based on whether the dropdown is above or below
36-
// the input. We use our own positioning logic, so we need to set this ourselves.
37-
transform-origin: center bottom;
3832
}
3933

4034
// These classes are used to toggle the panel visibility depending on whether it has any options.

src/material-experimental/mdc-autocomplete/autocomplete.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
*/
88

99
import {
10-
ChangeDetectionStrategy,
1110
Component,
11+
ViewEncapsulation,
12+
ChangeDetectionStrategy,
1213
ContentChildren,
1314
QueryList,
14-
ViewEncapsulation,
1515
} from '@angular/core';
16+
import {_MatAutocompleteBase} from '@angular/material/autocomplete';
1617
import {
17-
MAT_OPTGROUP,
1818
MAT_OPTION_PARENT_COMPONENT,
19+
MAT_OPTGROUP,
1920
MatOptgroup,
2021
MatOption,
2122
} from '@angular/material-experimental/mdc-core';
22-
import {_MatAutocompleteBase} from '@angular/material/autocomplete';
23-
import {panelAnimation} from './animations';
23+
2424

2525
@Component({
2626
selector: 'mat-autocomplete',
@@ -35,8 +35,7 @@ import {panelAnimation} from './animations';
3535
},
3636
providers: [
3737
{provide: MAT_OPTION_PARENT_COMPONENT, useExisting: MatAutocomplete}
38-
],
39-
animations: [panelAnimation],
38+
]
4039
})
4140
export class MatAutocomplete extends _MatAutocompleteBase {
4241
@ContentChildren(MAT_OPTGROUP, {descendants: true}) optionGroups: QueryList<MatOptgroup>;

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,14 @@ export class MatProgressBar extends _MatProgressBarMixinBase implements AfterVie
199199
const direction = this._dir ? this._dir.value : 'ltr';
200200
const mode = this.mode;
201201

202-
foundation.setReverse(direction === 'rtl' ? mode !== 'query' : mode === 'query');
202+
const reverse = direction === 'rtl' ? mode !== 'query' : mode === 'query';
203+
const progressDirection = reverse ? 'rtl' : 'ltr';
204+
const currentDirection = this._rootElement.getAttribute('dir');
205+
if (currentDirection !== progressDirection) {
206+
this._rootElement.setAttribute('dir', progressDirection);
207+
foundation.restartAnimation();
208+
}
209+
203210
foundation.setDeterminate(mode !== 'indeterminate' && mode !== 'query');
204211

205212
// Divide by 100 because MDC deals with values between 0 and 1.

src/material-experimental/mdc-snack-bar/snack-bar-container.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,3 @@
2727
// declaration so the container doesn't collapse on IE11.
2828
flex: 1 1 auto;
2929
}
30-
31-
// Ensures that the snack bar stretches to full width in handset mode.
32-
.mat-mdc-snack-bar-handset .mdc-snackbar__surface {
33-
width: 100%;
34-
}

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,3 @@
2020
.mdc-data-table__table {
2121
table-layout: auto;
2222
}
23-
24-
// MDC table rows are styled with a top border, whereas our legacy flex table styles rows with
25-
// a bottom border. Remove the bottom border style from the rows and let MDC display its top
26-
// border.
27-
mat-row.mat-mdc-row, mat-header-row.mat-mdc-header-row, mat-footer-row.mat-mdc-footer-row {
28-
border-bottom: none;
29-
}

src/material-experimental/mdc-table/text-column.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import {CdkTextColumn} from '@angular/cdk/table';
1010
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';
11+
import {_MAT_TEXT_COLUMN_TEMPLATE} from '@angular/material/table';
1112

1213
/**
1314
* Column that simply shows text content for the header and row cells. Assumes that the table
@@ -20,16 +21,7 @@ import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/co
2021
*/
2122
@Component({
2223
selector: 'mat-text-column',
23-
template: `
24-
<ng-container matColumnDef>
25-
<th mat-header-cell *matHeaderCellDef [style.text-align]="justify">
26-
{{headerText}}
27-
</th>
28-
<td mat-cell *matCellDef="let data" [style.text-align]="justify">
29-
{{dataAccessor(data, name)}}
30-
</td>
31-
</ng-container>
32-
`,
24+
template: _MAT_TEXT_COLUMN_TEMPLATE,
3325
encapsulation: ViewEncapsulation.None,
3426
// Change detection is intentionally not set to OnPush. This component's template will be provided
3527
// to the table to be inserted into its view. This is problematic when change detection runs since

src/material/core/typography/_typography.scss

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -74,54 +74,24 @@
7474
@return map-get($config, headline-1) != null;
7575
}
7676

77-
// Whether a config is for the Material Design 2014 typography system.
78-
@function mat-private-typography-is-2014-config($config) {
79-
@return map-get($config, headline) != null;
80-
}
81-
8277
// Given a config for either the 2014 or 2018 Material Design typography system,
8378
// produces a normalized typography config for the 2014 Material Design typography system.
8479
// 2014 - https://material.io/archive/guidelines/style/typography.html#typography-styles
8580
// 2018 - https://material.io/design/typography/the-type-system.html#type-scale
86-
@function mat-private-typography-to-2014-config($config) {
81+
@function mat-private-typography-normalized-config($config) {
8782
@if mat-private-typography-is-2018-config($config) {
8883
@return mat-typography-config(
89-
$display-4: map-get($config, headline-1),
90-
$display-3: map-get($config, headline-2),
91-
$display-2: map-get($config, headline-3),
92-
$display-1: map-get($config, headline-4),
93-
$headline: map-get($config, headline-5),
94-
$title: map-get($config, headline-6),
95-
$subheading-2: map-get($config, subtitle-1),
96-
$subheading-1: map-get($config, subtitle-2),
84+
$display-3: map-get($config, display-1),
85+
$display-2: map-get($config, display-2),
86+
$display-1: map-get($config, display-3),
87+
$headline: map-get($config, headline-4),
88+
$title: map-get($config, subtitle-1),
89+
$subheading-2: map-get($config, subhead-1),
90+
$subheading-1: map-get($config, subhead-2),
9791
$body-2: map-get($config, body-1),
9892
$body-1: map-get($config, body-2),
99-
$button: map-get($config, button),
10093
$caption: map-get($config, caption),
101-
);
102-
}
103-
@return $config;
104-
}
105-
106-
// Given a config for either the 2014 or 2018 Material Design typography system,
107-
// produces a normalized typography config for the 2018 Material Design typography system.
108-
// 2014 - https://material.io/archive/guidelines/style/typography.html#typography-styles
109-
// 2018 - https://material.io/design/typography/the-type-system.html#type-scale
110-
@function mat-private-typography-to-2018-config($config) {
111-
@if mat-private-typography-is-2014-config($config) {
112-
@return (
113-
headline-1: map-get($config, display-4),
114-
headline-2: map-get($config, display-3),
115-
headline-3: map-get($config, display-2),
116-
headline-4: map-get($config, display-1),
117-
headline-5: map-get($config, headline),
118-
headline-6: map-get($config, title),
119-
subtitle-1: map-get($config, subheading-2),
120-
subtitle-2: map-get($config, subheading-1),
121-
body-1: map-get($config, body-2),
122-
body-2: map-get($config, body-1),
123-
button: map-get($config, button),
124-
caption: map-get($config, caption),
94+
$button: map-get($config, button),
12595
);
12696
}
12797
@return $config;

src/material/table/text-column.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@
99
import {CdkTextColumn} from '@angular/cdk/table';
1010
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';
1111

12+
export const _MAT_TEXT_COLUMN_TEMPLATE = `
13+
<ng-container matColumnDef>
14+
<th mat-header-cell *matHeaderCellDef [style.text-align]="justify">
15+
{{headerText}}
16+
</th>
17+
<td mat-cell *matCellDef="let data" [style.text-align]="justify">
18+
{{dataAccessor(data, name)}}
19+
</td>
20+
</ng-container>
21+
`;
22+
1223
/**
1324
* Column that simply shows text content for the header and row cells. Assumes that the table
1425
* is using the native table implementation (`<table>`).
@@ -20,16 +31,7 @@ import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/co
2031
*/
2132
@Component({
2233
selector: 'mat-text-column',
23-
template: `
24-
<ng-container matColumnDef>
25-
<th mat-header-cell *matHeaderCellDef [style.text-align]="justify">
26-
{{headerText}}
27-
</th>
28-
<td mat-cell *matCellDef="let data" [style.text-align]="justify">
29-
{{dataAccessor(data, name)}}
30-
</td>
31-
</ng-container>
32-
`,
34+
template: _MAT_TEXT_COLUMN_TEMPLATE,
3335
encapsulation: ViewEncapsulation.None,
3436
// Change detection is intentionally not set to OnPush. This component's template will be provided
3537
// to the table to be inserted into its view. This is problematic when change detection runs since

0 commit comments

Comments
 (0)