diff --git a/src/lib/button-toggle/button-toggle.ts b/src/lib/button-toggle/button-toggle.ts index a88b510f2e4..b74de147c58 100644 --- a/src/lib/button-toggle/button-toggle.ts +++ b/src/lib/button-toggle/button-toggle.ts @@ -34,6 +34,7 @@ export type ToggleType = 'checkbox' | 'radio'; /** * Provider Expression that allows md-button-toggle-group to register as a ControlValueAccessor. * This allows it to support [(ngModel)]. + * @docs-private */ export const MD_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -43,7 +44,7 @@ export const MD_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR: any = { var _uniqueIdCounter = 0; -/** A simple change event emitted by either MdButtonToggle or MdButtonToggleGroup. */ +/** Change event object emitted by MdButtonToggle. */ export class MdButtonToggleChange { source: MdButtonToggle; value: any; diff --git a/src/lib/button/button.html b/src/lib/button/button.html index a82eb530bbf..281f5f5101e 100644 --- a/src/lib/button/button.html +++ b/src/lib/button/button.html @@ -1,8 +1,8 @@
diff --git a/src/lib/button/button.ts b/src/lib/button/button.ts index 890ea7df356..d3129c2752d 100644 --- a/src/lib/button/button.ts +++ b/src/lib/button/button.ts @@ -47,24 +47,22 @@ export class MdButton { private _disableRipple: boolean = false; private _disabled: boolean = null; + /** Whether the ripple effect for this button is disabled. */ @Input() get disableRipple() { return this._disableRipple; } set disableRipple(v) { this._disableRipple = coerceBooleanProperty(v); } + /** Whether the button is disabled. */ @Input() get disabled() { return this._disabled; } set disabled(value: boolean) { this._disabled = coerceBooleanProperty(value) ? true : null; } constructor(private _elementRef: ElementRef, private _renderer: Renderer) { } + /** The color of the button. Can be `primary`, `accent`, or `warn`. */ @Input() - get color(): string { - return this._color; - } - - set color(value: string) { - this._updateColor(value); - } + get color(): string { return this._color; } + set color(value: string) { this._updateColor(value); } _setMousedown() { // We only *show* the focus style when focus has come to the button via the keyboard. @@ -95,16 +93,16 @@ export class MdButton { this._isKeyboardFocused = false; } - /** TODO(hansl): e2e test this function. */ - focus() { + /** Focuses the button. */ + focus(): void { this._renderer.invokeElementMethod(this._elementRef.nativeElement, 'focus'); } - getHostElement() { + _getHostElement() { return this._elementRef.nativeElement; } - isRoundButton() { + _isRoundButton() { const el = this._elementRef.nativeElement; return el.hasAttribute('md-icon-button') || el.hasAttribute('md-fab') || @@ -122,6 +120,7 @@ export class MdButton { inputs: ['color', 'disabled', 'disableRipple'], host: { '[attr.disabled]': 'disabled', + '[attr.aria-disabled]': '_isAriaDisabled', '[class.md-button-focus]': '_isKeyboardFocused', '(mousedown)': '_setMousedown()', '(focus)': '_setKeyboardFocus()', @@ -137,14 +136,13 @@ export class MdAnchor extends MdButton { super(elementRef, renderer); } + /** @docs-private */ @HostBinding('tabIndex') get tabIndex(): number { return this.disabled ? -1 : 0; } - /** Gets the aria-disabled value for the component, which must be a string for Dart. */ - @HostBinding('attr.aria-disabled') - get isAriaDisabled(): string { + get _isAriaDisabled(): string { return this.disabled ? 'true' : 'false'; } diff --git a/src/lib/checkbox/checkbox.html b/src/lib/checkbox/checkbox.html index fba084ce10a..b67f3aae244 100644 --- a/src/lib/checkbox/checkbox.html +++ b/src/lib/checkbox/checkbox.html @@ -16,7 +16,7 @@ (change)="_onInteractionEvent($event)" (click)="_onInputClick($event)"> diff --git a/src/lib/checkbox/checkbox.ts b/src/lib/checkbox/checkbox.ts index 89d8d01b36a..ad133211732 100644 --- a/src/lib/checkbox/checkbox.ts +++ b/src/lib/checkbox/checkbox.ts @@ -20,14 +20,13 @@ import {MdRippleModule, DefaultStyleCompatibilityModeModule} from '../core'; import {ViewportRuler} from '../core/overlay/position/viewport-ruler'; -/** - * Monotonically increasing integer used to auto-generate unique ids for checkbox components. - */ +/** Monotonically increasing integer used to auto-generate unique ids for checkbox components. */ let nextId = 0; /** - * Provider Expression that allows md-checkbox to register as a ControlValueAccessor. This allows it - * to support [(ngModel)]. + * Provider Expression that allows md-checkbox to register as a ControlValueAccessor. + * This allows it to support [(ngModel)]. + * @docs-private */ export const MD_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -37,6 +36,7 @@ export const MD_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = { /** * Represents the different states that require custom transitions between them. + * @docs-private */ export enum TransitionCheckState { /** The initial state of the component before any user interaction. */ @@ -49,7 +49,7 @@ export enum TransitionCheckState { Indeterminate } -// A simple change event emitted by the MdCheckbox component. +/** Change event object emitted by MdCheckbox. */ export class MdCheckboxChange { source: MdCheckbox; checked: boolean; @@ -73,7 +73,7 @@ export class MdCheckboxChange { '[class.md-checkbox-checked]': 'checked', '[class.md-checkbox-disabled]': 'disabled', '[class.md-checkbox-align-end]': 'align == "end"', - '[class.md-checkbox-focused]': 'hasFocus', + '[class.md-checkbox-focused]': '_hasFocus', }, providers: [MD_CHECKBOX_CONTROL_VALUE_ACCESSOR], encapsulation: ViewEncapsulation.None, @@ -97,18 +97,19 @@ export class MdCheckbox implements ControlValueAccessor { /** Whether the ripple effect on click should be disabled. */ private _disableRipple: boolean; + /** Whether the ripple effect for this checkbox is disabled. */ @Input() get disableRipple(): boolean { return this._disableRipple; } set disableRipple(value) { this._disableRipple = coerceBooleanProperty(value); } - /** ID to be applied to the `input` element */ + /** ID of the native input element inside `