Skip to content

Commit fad4ef5

Browse files
authored
chore: remove all @internal to fix offline compile (#781)
1 parent 819c9ef commit fad4ef5

35 files changed

+220
-304
lines changed

src/components/button-toggle/button-toggle.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<label [attr.for]="inputId" class="md-button-toggle-label">
22
<input #input class="md-button-toggle-input"
3-
[type]="type"
3+
[type]="_type"
44
[id]="inputId"
55
[checked]="checked"
66
[disabled]="disabled"
77
[name]="name"
8-
(change)="onInputChange($event)">
8+
(change)="_onInputChange($event)">
99

1010
<div class="md-button-toggle-label-content">
1111
<ng-content></ng-content>

src/components/button-toggle/button-toggle.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class MdButtonToggleGroup implements ControlValueAccessor {
8181

8282
/** Child button toggle buttons. */
8383
@ContentChildren(forwardRef(() => MdButtonToggle))
84-
private _buttonToggles: QueryList<MdButtonToggle> = null;
84+
_buttonToggles: QueryList<MdButtonToggle> = null;
8585

8686
@Input()
8787
get name(): string {
@@ -219,11 +219,8 @@ export class MdButtonToggle implements OnInit {
219219
/** Whether or not this button toggle is checked. */
220220
private _checked: boolean = false;
221221

222-
/**
223-
* Type of the button toggle. Either 'radio' or 'checkbox'.
224-
* @internal
225-
*/
226-
type: ToggleType;
222+
/** Type of the button toggle. Either 'radio' or 'checkbox'. */
223+
_type: ToggleType;
227224

228225
/** The unique ID for this button toggle. */
229226
@HostBinding()
@@ -269,18 +266,17 @@ export class MdButtonToggle implements OnInit {
269266
}
270267
});
271268

272-
this.type = 'radio';
269+
this._type = 'radio';
273270
this.name = this.buttonToggleGroup.name;
274271
this._isSingleSelector = true;
275272
} else {
276273
// Even if there is no group at all, treat the button toggle as a checkbox so it can be
277274
// toggled on or off.
278-
this.type = 'checkbox';
275+
this._type = 'checkbox';
279276
this._isSingleSelector = false;
280277
}
281278
}
282279

283-
/** @internal */
284280
ngOnInit() {
285281
if (this.id == null) {
286282
this.id = `md-button-toggle-${_uniqueIdCounter++}`;
@@ -359,11 +355,8 @@ export class MdButtonToggle implements OnInit {
359355
this.checked = !this.checked;
360356
}
361357

362-
/**
363-
* Checks the button toggle due to an interaction with the underlying native input.
364-
* @internal
365-
*/
366-
onInputChange(event: Event) {
358+
/** Checks the button toggle due to an interaction with the underlying native input. */
359+
_onInputChange(event: Event) {
367360
event.stopPropagation();
368361

369362
if (this._isSingleSelector) {

src/components/button/button.ts

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import {
2121
inputs: ['color'],
2222
host: {
2323
'[class.md-button-focus]': 'isKeyboardFocused',
24-
'(mousedown)': 'setMousedown()',
25-
'(focus)': 'setKeyboardFocus()',
26-
'(blur)': 'removeKeyboardFocus()',
24+
'(mousedown)': '_setMousedown()',
25+
'(focus)': '_setKeyboardFocus()',
26+
'(blur)': '_removeKeyboardFocus()',
2727
},
2828
templateUrl: 'button.html',
2929
styleUrls: ['button.css'],
@@ -34,12 +34,12 @@ export class MdButton {
3434
private _color: string;
3535

3636
/** Whether the button has focus from the keyboard (not the mouse). Used for class binding. */
37-
isKeyboardFocused: boolean = false;
37+
_isKeyboardFocused: boolean = false;
3838

3939
/** Whether a mousedown has occurred on this element in the last 100ms. */
40-
isMouseDown: boolean = false;
40+
_isMouseDown: boolean = false;
4141

42-
constructor(private elementRef: ElementRef, private renderer: Renderer) { }
42+
constructor(private _elementRef: ElementRef, private _renderer: Renderer) { }
4343

4444
get color(): string {
4545
return this._color;
@@ -49,14 +49,13 @@ export class MdButton {
4949
this._updateColor(value);
5050
}
5151

52-
/** @internal */
53-
setMousedown() {
52+
_setMousedown() {
5453
// We only *show* the focus style when focus has come to the button via the keyboard.
5554
// The Material Design spec is silent on this topic, and without doing this, the
5655
// button continues to look :active after clicking.
5756
// @see http://marcysutton.com/button-focus-hell/
58-
this.isMouseDown = true;
59-
setTimeout(() => { this.isMouseDown = false; }, 100);
57+
this._isMouseDown = true;
58+
setTimeout(() => { this._isMouseDown = false; }, 100);
6059
}
6160

6261
_updateColor(newColor: string) {
@@ -67,23 +66,21 @@ export class MdButton {
6766

6867
_setElementColor(color: string, isAdd: boolean) {
6968
if (color != null && color != '') {
70-
this.renderer.setElementClass(this.elementRef.nativeElement, `md-${color}`, isAdd);
69+
this._renderer.setElementClass(this._elementRef.nativeElement, `md-${color}`, isAdd);
7170
}
7271
}
7372

74-
/** @internal */
75-
setKeyboardFocus() {
76-
this.isKeyboardFocused = !this.isMouseDown;
73+
_setKeyboardFocus() {
74+
this._isKeyboardFocused = !this._isMouseDown;
7775
}
7876

79-
/** @internal */
80-
removeKeyboardFocus() {
81-
this.isKeyboardFocused = false;
77+
_removeKeyboardFocus() {
78+
this._isKeyboardFocused = false;
8279
}
8380

8481
/** TODO(hansl): e2e test this function. */
8582
focus() {
86-
this.elementRef.nativeElement.focus();
83+
this._elementRef.nativeElement.focus();
8784
}
8885
}
8986

@@ -92,11 +89,11 @@ export class MdButton {
9289
selector: 'a[md-button], a[md-raised-button], a[md-icon-button], a[md-fab], a[md-mini-fab]',
9390
inputs: ['color'],
9491
host: {
95-
'[class.md-button-focus]': 'isKeyboardFocused',
96-
'(mousedown)': 'setMousedown()',
97-
'(focus)': 'setKeyboardFocus()',
98-
'(blur)': 'removeKeyboardFocus()',
99-
'(click)': 'haltDisabledEvents($event)',
92+
'[class.md-button-focus]': '_isKeyboardFocused',
93+
'(mousedown)': '_setMousedown()',
94+
'(focus)': '_setKeyboardFocus()',
95+
'(blur)': '_removeKeyboardFocus()',
96+
'(click)': '_haltDisabledEvents($event)',
10097
},
10198
templateUrl: 'button.html',
10299
styleUrls: ['button.css'],
@@ -129,8 +126,7 @@ export class MdAnchor extends MdButton {
129126
this._disabled = (value != null && value != false) ? true : null;
130127
}
131128

132-
/** @internal */
133-
haltDisabledEvents(event: Event) {
129+
_haltDisabledEvents(event: Event) {
134130
// A disabled button shouldn't apply any actions
135131
if (this.disabled) {
136132
event.preventDefault();

src/components/checkbox/checkbox.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
[indeterminate]="indeterminate"
1010
[attr.aria-label]="ariaLabel"
1111
[attr.aria-labelledby]="ariaLabelledby"
12-
(focus)="onInputFocus()"
13-
(blur)="onInputBlur()"
14-
(change)="onInteractionEvent($event)"
15-
(click)="onInputClick($event)">
12+
(focus)="_onInputFocus()"
13+
(blur)="_onInputBlur()"
14+
(change)="_onInteractionEvent($event)"
15+
(click)="_onInputClick($event)">
1616
<div class="md-ink-ripple"></div>
1717
<div class="md-checkbox-frame"></div>
1818
<div class="md-checkbox-background">

src/components/checkbox/checkbox.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ describe('MdCheckbox', () => {
122122
expect(checkboxInstance.checked).toBe(false);
123123
expect(checkboxInstance.indeterminate).toBe(true);
124124

125-
checkboxInstance.onInteractionEvent(<Event>{stopPropagation: () => {}});
125+
checkboxInstance._onInteractionEvent(<Event>{stopPropagation: () => {}});
126126

127127
expect(checkboxInstance.checked).toBe(true);
128128
expect(checkboxInstance.indeterminate).toBe(false);
129129

130-
checkboxInstance.onInteractionEvent(<Event>{stopPropagation: () => {}});
130+
checkboxInstance._onInteractionEvent(<Event>{stopPropagation: () => {}});
131131
fixture.detectChanges();
132132

133133
expect(checkboxInstance.checked).toBe(false);

src/components/checkbox/checkbox.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -237,19 +237,13 @@ export class MdCheckbox implements AfterContentInit, ControlValueAccessor {
237237
this.change.emit(event);
238238
}
239239

240-
/**
241-
* Informs the component when the input has focus so that we can style accordingly
242-
* @internal
243-
*/
244-
onInputFocus() {
240+
/** Informs the component when the input has focus so that we can style accordingly */
241+
_onInputFocus() {
245242
this.hasFocus = true;
246243
}
247244

248-
/**
249-
* Informs the component when we lose focus in order to style accordingly
250-
* @internal
251-
*/
252-
onInputBlur() {
245+
/** Informs the component when we lose focus in order to style accordingly */
246+
_onInputBlur() {
253247
this.hasFocus = false;
254248
this.onTouched();
255249
}
@@ -265,9 +259,8 @@ export class MdCheckbox implements AfterContentInit, ControlValueAccessor {
265259
* Event handler for checkbox input element.
266260
* Toggles checked state if element is not disabled.
267261
* @param event
268-
* @internal
269262
*/
270-
onInteractionEvent(event: Event) {
263+
_onInteractionEvent(event: Event) {
271264
// We always have to stop propagation on the change event.
272265
// Otherwise the change event, from the input element, will bubble up and
273266
// emit its event object to the `change` output.
@@ -278,8 +271,7 @@ export class MdCheckbox implements AfterContentInit, ControlValueAccessor {
278271
}
279272
}
280273

281-
/** @internal */
282-
onInputClick(event: Event) {
274+
_onInputClick(event: Event) {
283275
// We have to stop propagation for click events on the visual hidden input element.
284276
// By default, when a user clicks on a label element, a generated click event will be
285277
// dispatched on the associated input element. Since we are using a label element as our

src/components/grid-list/grid-list-measure.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

22
/**
33
* Converts values into strings. Falsy values become empty strings.
4-
* @internal
4+
* TODO: internal
55
*/
66
export function coerceToString(value: string | number): string {
77
return `${value || ''}`;
88
}
99

1010
/**
1111
* Converts a value that might be a string into a number.
12-
* @internal
12+
* TODO: internal
1313
*/
1414
export function coerceToNumber(value: string | number): number {
1515
return typeof value === 'string' ? parseInt(value, 10) : value;

src/components/grid-list/grid-list.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class MdGridList implements OnInit, AfterContentChecked {
5555
private _tileStyler: TileStyler;
5656

5757
/** Query list of tiles that are being rendered. */
58-
@ContentChildren(MdGridTile) private _tiles: QueryList<MdGridTile>;
58+
@ContentChildren(MdGridTile) _tiles: QueryList<MdGridTile>;
5959

6060
constructor(
6161
private _renderer: Renderer,
@@ -139,14 +139,11 @@ export class MdGridList implements OnInit, AfterContentChecked {
139139
let tile = tiles[i];
140140
this._tileStyler.setStyle(tile, pos.row, pos.col);
141141
}
142-
this.setListStyle(this._tileStyler.getComputedHeight());
142+
this._setListStyle(this._tileStyler.getComputedHeight());
143143
}
144144

145-
/**
146-
* Sets style on the main grid-list element, given the style name and value.
147-
* @internal
148-
*/
149-
setListStyle(style: [string, string]): void {
145+
/** Sets style on the main grid-list element, given the style name and value. */
146+
_setListStyle(style: [string, string]): void {
150147
if (style) {
151148
this._renderer.setElementStyle(this._element.nativeElement, style[0], style[1]);
152149
}

src/components/grid-list/grid-tile.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ export class MdGridTile {
4343
this._colspan = coerceToNumber(value);
4444
}
4545

46-
/** Sets the style of the grid-tile element. Needs to be set manually to avoid
46+
/**
47+
* Sets the style of the grid-tile element. Needs to be set manually to avoid
4748
* "Changed after checked" errors that would occur with HostBinding.
48-
* @internal
4949
*/
50-
setStyle(property: string, value: string): void {
50+
_setStyle(property: string, value: string): void {
5151
this._renderer.setElementStyle(this._element.nativeElement, property, value);
5252
}
5353

src/components/grid-list/tile-coordinator.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ export class TileCoordinator {
134134
}
135135
}
136136

137-
/** Simple data structure for tile position (row, col).
138-
* @internal
139-
*/
137+
/** Simple data structure for tile position (row, col). */
140138
export class TilePosition {
141139
constructor(public row: number, public col: number) {}
142140
}

0 commit comments

Comments
 (0)