Skip to content

Commit e97c69c

Browse files
committed
chore: hide internal properties from selection-list api doc
* Recently with the NgModel support for the selection list, the `onTouched` property has been added. This one needs to be prefixed with an underscore to be hidden in the docs. * Since the initial implementation of the selection-list the `selectionList` variable has been initialized publically in the constructor of the `MatListOption` and therefore shows up in the docs. This property has been made private now.
1 parent 230b297 commit e97c69c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/lib/list/selection-list.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ export class MatListOption extends _MatListOptionMixinBase
126126

127127
/** Whether the option is disabled. */
128128
@Input()
129-
get disabled() { return (this.selectionList && this.selectionList.disabled) || this._disabled; }
129+
get disabled() {
130+
return this._disabled || this.selectionList && this.selectionList.disabled;
131+
}
130132
set disabled(value: any) {
131133
const newValue = coerceBooleanProperty(value);
132134

@@ -157,7 +159,7 @@ export class MatListOption extends _MatListOptionMixinBase
157159

158160
constructor(private _element: ElementRef,
159161
private _changeDetector: ChangeDetectorRef,
160-
@Optional() @Inject(forwardRef(() => MatSelectionList))
162+
/** @docs-private */ @Optional() @Inject(forwardRef(() => MatSelectionList))
161163
public selectionList: MatSelectionList) {
162164
super();
163165
}
@@ -215,7 +217,7 @@ export class MatListOption extends _MatListOptionMixinBase
215217

216218
_handleBlur() {
217219
this._hasFocus = false;
218-
this.selectionList.onTouched();
220+
this.selectionList._onTouched();
219221
}
220222

221223
/** Retrieves the DOM element of the component host. */
@@ -261,7 +263,7 @@ export class MatListOption extends _MatListOptionMixinBase
261263
'[tabIndex]': 'tabIndex',
262264
'class': 'mat-selection-list',
263265
'(focus)': 'focus()',
264-
'(blur)': 'onTouched()',
266+
'(blur)': '_onTouched()',
265267
'(keydown)': '_keydown($event)',
266268
'[attr.aria-disabled]': 'disabled.toString()'},
267269
template: '<ng-content></ng-content>',
@@ -291,7 +293,7 @@ export class MatSelectionList extends _MatSelectionListMixinBase implements Focu
291293
private _onChange: (value: any) => void = (_: any) => {};
292294

293295
/** View to model callback that should be called if the list or its options lost focus. */
294-
onTouched: () => void = () => {};
296+
_onTouched: () => void = () => {};
295297

296298
constructor(private _element: ElementRef, @Attribute('tabindex') tabIndex: string) {
297299
super();
@@ -386,7 +388,7 @@ export class MatSelectionList extends _MatSelectionListMixinBase implements Focu
386388

387389
/** Implemented as part of ControlValueAccessor. */
388390
registerOnTouched(fn: () => void): void {
389-
this.onTouched = fn;
391+
this._onTouched = fn;
390392
}
391393

392394
/** Returns the option with the specified value. */

0 commit comments

Comments
 (0)