Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): rename master to main #25151

Merged
merged 1 commit into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Checkbox Column -->
<ng-container matColumnDef="select">
<th mat-header-cell *matHeaderCellDef>
<mat-checkbox (change)="$event ? masterToggle() : null"
<mat-checkbox (change)="$event ? toggleAllRows() : null"
[checked]="selection.hasValue() && isAllSelected()"
[indeterminate]="selection.hasValue() && !isAllSelected()"
[aria-label]="checkboxLabel()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class TableSelectionExample {
}

/** Selects all rows if they are not all selected; otherwise clear selection. */
masterToggle() {
toggleAllRows() {
if (this.isAllSelected()) {
this.selection.clear();
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Checkbox Column -->
<ng-container matColumnDef="select">
<th mat-header-cell *matHeaderCellDef>
<mat-checkbox (change)="$event ? masterToggle() : null"
<mat-checkbox (change)="$event ? toggleAllRows() : null"
[checked]="selection.hasValue() && isAllSelected()"
[indeterminate]="selection.hasValue() && !isAllSelected()"
[aria-label]="checkboxLabel()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class TableSelectionExample {
}

/** Selects all rows if they are not all selected; otherwise clear selection. */
masterToggle() {
toggleAllRows() {
if (this.isAllSelected()) {
this.selection.clear();
return;
Expand Down
2 changes: 1 addition & 1 deletion src/material/core/style/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $xsmall: 'max-width: 599px';
$small: 'max-width: 959px';

// TODO: Revisit all z-indices before beta
// z-index master list
// z-index main list

$z-index-fab: 20 !default;
$z-index-drawer: 100 !default;
Expand Down
8 changes: 4 additions & 4 deletions src/material/table/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,14 @@ this.selection = new SelectionModel<MyDataType>(allowMultiSelect, initialSelecti

##### 2. Define a selection column

Add a column definition for displaying the row checkboxes, including a master toggle checkbox for
Add a column definition for displaying the row checkboxes, including a main toggle checkbox for
the header. The column name should be added to the list of displayed columns provided to the
header and data row.

```html
<ng-container matColumnDef="select">
<th mat-header-cell *matHeaderCellDef>
<mat-checkbox (change)="$event ? masterToggle() : null"
<mat-checkbox (change)="$event ? toggleAllRows() : null"
[checked]="selection.hasValue() && isAllSelected()"
[indeterminate]="selection.hasValue() && !isAllSelected()">
</mat-checkbox>
Expand All @@ -281,7 +281,7 @@ header and data row.

##### 3. Add event handling logic

Implement the behavior in your component's logic to handle the header's master toggle and checking
Implement the behavior in your component's logic to handle the header's main toggle and checking
if all rows are selected.

```js
Expand All @@ -293,7 +293,7 @@ isAllSelected() {
}

/** Selects all rows if they are not all selected; otherwise clear selection. */
masterToggle() {
toggleAllRows() {
this.isAllSelected() ?
this.selection.clear() :
this.dataSource.data.forEach(row => this.selection.select(row));
Expand Down