Skip to content

Commit bf52a19

Browse files
crisbetommalerba
authored andcommitted
docs: add descriptions to properties initialized through the constructor (#8803)
Adds the missing docs to some of the properties that are declared through the constructor params. Fixes #8789.
1 parent 0b2757c commit bf52a19

File tree

12 files changed

+52
-10
lines changed

12 files changed

+52
-10
lines changed

src/lib/autocomplete/autocomplete.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ let _uniqueAutocompleteIdCounter = 0;
3333

3434
/** Event object that is emitted when an autocomplete option is selected */
3535
export class MatAutocompleteSelectedEvent {
36-
constructor(public source: MatAutocomplete, public option: MatOption) { }
36+
constructor(
37+
/** Reference to the autocomplete panel that emitted the event. */
38+
public source: MatAutocomplete,
39+
/** Option that was selected. */
40+
public option: MatOption) { }
3741
}
3842

3943

src/lib/chips/chip-input.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ export class MatChipInput {
6969
@Output('matChipInputTokenEnd')
7070
chipEnd = new EventEmitter<MatChipInputEvent>();
7171

72+
/** The input's placeholder text. */
7273
@Input() placeholder: string = '';
7374

75+
/** Whether the input is empty. */
7476
get empty(): boolean {
7577
let value: string | null = this._inputElement.value;
7678
return (value == null || value === '');

src/lib/chips/chip-list.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ let nextUniqueId = 0;
6060

6161
/** Change event object that is emitted when the chip list value has changed. */
6262
export class MatChipListChange {
63-
constructor(public source: MatChipList, public value: any) { }
63+
constructor(
64+
/** Chip list that emitted the event. */
65+
public source: MatChipList,
66+
/** Value of the chip list when the event was emitted. */
67+
public value: any) { }
6468
}
6569

6670

src/lib/chips/chip.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ export interface MatChipEvent {
2929

3030
/** Event object emitted by MatChip when selected or deselected. */
3131
export class MatChipSelectionChange {
32-
constructor(public source: MatChip, public selected: boolean, public isUserInput = false) { }
32+
constructor(
33+
/** Reference to the chip that emitted the event. */
34+
public source: MatChip,
35+
/** Whether the chip that emitted the event is selected. */
36+
public selected: boolean,
37+
/** Whether the selection change was a result of a user interaction. */
38+
public isUserInput = false) { }
3339
}
3440

3541

src/lib/core/option/option.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ let _uniqueIdCounter = 0;
3232

3333
/** Event object emitted by MatOption when selected or deselected. */
3434
export class MatOptionSelectionChange {
35-
constructor(public source: MatOption, public isUserInput = false) { }
35+
constructor(
36+
/** Reference to the option that emitted the event. */
37+
public source: MatOption,
38+
/** Whether the change in the option's value was a result of a user action. */
39+
public isUserInput = false) { }
3640
}
3741

3842
/**

src/lib/datepicker/datepicker-input.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ export class MatDatepickerInputEvent<D> {
6161
/** The new value for the target datepicker input. */
6262
value: D | null;
6363

64-
constructor(public target: MatDatepickerInput<D>, public targetElement: HTMLElement) {
64+
constructor(
65+
/** Reference to the datepicker input component that emitted the event. */
66+
public target: MatDatepickerInput<D>,
67+
/** Reference to the native input element associated with the datepicker input. */
68+
public targetElement: HTMLElement) {
6569
this.value = this.target.value;
6670
}
6771
}
@@ -104,7 +108,9 @@ export class MatDatepickerInput<D> implements AfterContentInit, ControlValueAcce
104108
}
105109
}
106110

107-
@Input() set matDatepickerFilter(filter: (date: D | null) => boolean) {
111+
/** Function that can be used to filter out dates within the datepicker. */
112+
@Input()
113+
set matDatepickerFilter(filter: (date: D | null) => boolean) {
108114
this._dateFilter = filter;
109115
this._validatorOnChange();
110116
}

src/lib/input/autosize.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ export class MatTextareaAutosize implements AfterViewInit, DoCheck {
2929
private _minRows: number;
3030
private _maxRows: number;
3131

32+
/** Minimum amount of rows in the textarea. */
3233
@Input('matAutosizeMinRows')
3334
get minRows() { return this._minRows; }
34-
3535
set minRows(value: number) {
3636
this._minRows = value;
3737
this._setMinHeight();
3838
}
3939

40+
/** Maximum amount of rows in the textarea. */
4041
@Input('matAutosizeMaxRows')
4142
get maxRows() { return this._maxRows; }
4243
set maxRows(value: number) {

src/lib/menu/menu-directive.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export class MatMenu implements AfterContentInit, MatMenuPanel, OnDestroy {
122122
this.setPositionClasses();
123123
}
124124

125+
/** @docs-private */
125126
@ViewChild(TemplateRef) templateRef: TemplateRef<any>;
126127

127128
/** List of the items inside of a menu. */

src/lib/select/select.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ export const MAT_SELECT_SCROLL_STRATEGY_PROVIDER = {
137137

138138
/** Change event object that is emitted when the select value has changed. */
139139
export class MatSelectChange {
140-
constructor(public source: MatSelect, public value: any) { }
140+
constructor(
141+
/** Reference to the select that emitted the change event. */
142+
public source: MatSelect,
143+
/** Current value of the select that emitted the event. */
144+
public value: any) { }
141145
}
142146

143147
// Boilerplate for applying mixins to MatSelect.

src/lib/sidenav/drawer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ export function throwMatDuplicatedDrawerError(position: string) {
5353
* @deprecated
5454
*/
5555
export class MatDrawerToggleResult {
56-
constructor(public type: 'open' | 'close', public animationFinished: boolean) {}
56+
constructor(
57+
/** Whether the drawer is opened or closed. */
58+
public type: 'open' | 'close',
59+
/** Whether the drawer animation is finished. */
60+
public animationFinished: boolean) {}
5761
}
5862

5963
/** Configures whether drawers should use auto sizing by default. */

src/lib/tabs/tab-group.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ let nextId = 0;
4141

4242
/** A simple change event emitted on focus or selection changes. */
4343
export class MatTabChangeEvent {
44+
/** Index of the currently-selected tab. */
4445
index: number;
46+
/** Reference to the currently-selected tab. */
4547
tab: MatTab;
4648
}
4749

src/lib/tabs/tab.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ export class MatTab extends _MatTabMixinBase implements OnInit, CanDisable, OnCh
5353

5454
/** The portal that will be the hosted content of the tab */
5555
private _contentPortal: TemplatePortal<any> | null = null;
56-
get content(): TemplatePortal<any> | null { return this._contentPortal; }
56+
57+
/** @docs-private */
58+
get content(): TemplatePortal<any> | null {
59+
return this._contentPortal;
60+
}
5761

5862
/** Emits whenever the label changes. */
5963
_labelChange = new Subject<void>();

0 commit comments

Comments
 (0)