chore(analysis): analyze everything in lib folders recursively; fix existing warnings
This commit is contained in:
parent
3dc4df2ffa
commit
2b4d30d931
@ -11,7 +11,9 @@ export 'dart:html' show
|
|||||||
location,
|
location,
|
||||||
window,
|
window,
|
||||||
Element,
|
Element,
|
||||||
Node;
|
Node,
|
||||||
|
KeyboardEvent,
|
||||||
|
Event;
|
||||||
|
|
||||||
final _gc = context['gc'];
|
final _gc = context['gc'];
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import {Component, View, Attribute, PropertySetter} from 'angular2/angular2';
|
import {Component, View, Attribute, PropertySetter} from 'angular2/angular2';
|
||||||
import {isPresent} from 'angular2/src/facade/lang';
|
import {isPresent} from 'angular2/src/facade/lang';
|
||||||
import {KeyCodes} from 'angular2_material/src/core/constants'
|
import {KEY_SPACE} from 'angular2_material/src/core/constants'
|
||||||
|
import {KeyboardEvent} from 'angular2/src/facade/browser';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'md-checkbox',
|
selector: 'md-checkbox',
|
||||||
@ -20,6 +21,9 @@ export class MdCheckbox {
|
|||||||
/** Whether this checkbox is checked. */
|
/** Whether this checkbox is checked. */
|
||||||
checked_: boolean;
|
checked_: boolean;
|
||||||
|
|
||||||
|
/** Whether this checkbox is disabled. */
|
||||||
|
disabled_: boolean;
|
||||||
|
|
||||||
/** Setter for `aria-checked` attribute. */
|
/** Setter for `aria-checked` attribute. */
|
||||||
ariaCheckedSetter: Function;
|
ariaCheckedSetter: Function;
|
||||||
|
|
||||||
@ -59,7 +63,7 @@ export class MdCheckbox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onKeydown(event: KeyboardEvent) {
|
onKeydown(event: KeyboardEvent) {
|
||||||
if (event.keyCode == KeyCodes.SPACE) {
|
if (event.keyCode == KEY_SPACE) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.toggle(event);
|
this.toggle(event);
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import {Component, View, onAllChangesDone, Parent} from 'angular2/angular2';
|
import {Component, View, onAllChangesDone, Parent} from 'angular2/angular2';
|
||||||
import {onDestroy, onChange} from 'angular2/src/core/annotations/annotations';
|
import {onDestroy, onChange} from 'angular2/src/core/annotations/annotations';
|
||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||||
import {CONST} from 'angular2/src/facade/lang';
|
import {isPresent, isString, NumberWrapper, stringify} from 'angular2/src/facade/lang';
|
||||||
import {isPresent, isString, NumberWrapper} from 'angular2/src/facade/lang';
|
|
||||||
import {PropertySetter} from 'angular2/src/core/annotations/di';
|
import {PropertySetter} from 'angular2/src/core/annotations/di';
|
||||||
|
|
||||||
// TODO(jelbourn): Set appropriate aria attributes for grid list elements.
|
// TODO(jelbourn): Set appropriate aria attributes for grid list elements.
|
||||||
@ -20,7 +19,7 @@ import {PropertySetter} from 'angular2/src/core/annotations/di';
|
|||||||
})
|
})
|
||||||
export class MdGridList {
|
export class MdGridList {
|
||||||
/** List of tiles that are being rendered. */
|
/** List of tiles that are being rendered. */
|
||||||
tiles: Array<MdGridTile>;
|
tiles: List<MdGridTile>;
|
||||||
|
|
||||||
/** Number of columns being rendered. Can be either string or number */
|
/** Number of columns being rendered. Can be either string or number */
|
||||||
cols;
|
cols;
|
||||||
@ -37,8 +36,8 @@ export class MdGridList {
|
|||||||
/** The amount of space between tiles. This will be something like '5px' or '2em'. */
|
/** The amount of space between tiles. This will be something like '5px' or '2em'. */
|
||||||
gutterSize: string;
|
gutterSize: string;
|
||||||
|
|
||||||
/** Array used to track the amount of space available. */
|
/** List used to track the amount of space available. */
|
||||||
spaceTracker: Array<number>;
|
spaceTracker: List<number>;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.tiles = [];
|
this.tiles = [];
|
||||||
@ -144,8 +143,8 @@ export class MdGridList {
|
|||||||
switch (this.rowHeightMode) {
|
switch (this.rowHeightMode) {
|
||||||
case 'fixed':
|
case 'fixed':
|
||||||
// In fixed mode, simply use the given row height.
|
// In fixed mode, simply use the given row height.
|
||||||
tileStyle.top = getTilePosition(this.fixedRowHeight, rowIndex);
|
tileStyle.top = getTilePosition(stringify(this.fixedRowHeight), rowIndex);
|
||||||
tileStyle.height = getTileSize(this.fixedRowHeight, tile.rowspan);
|
tileStyle.height = getTileSize(stringify(this.fixedRowHeight), tile.rowspan);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'ratio':
|
case 'ratio':
|
||||||
@ -160,8 +159,6 @@ export class MdGridList {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'fit':
|
case 'fit':
|
||||||
var percentHeightPerTile;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import {Decorator} from 'angular2/angular2';
|
import {Decorator} from 'angular2/angular2';
|
||||||
import {PropertySetter} from 'angular2/src/core/annotations/di';
|
|
||||||
|
|
||||||
@Decorator({
|
@Decorator({
|
||||||
selector: 'md-input-container input'
|
selector: 'md-input-container input'
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import {Component, View} from 'angular2/angular2';
|
import {Component, View} from 'angular2/angular2';
|
||||||
import {isPresent} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'md-progress-circular'
|
selector: 'md-progress-circular'
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import {Component, View, Parent, Ancestor, Attribute, PropertySetter} from 'angular2/angular2';
|
import {Component, View, Parent, Ancestor, Attribute, PropertySetter} from 'angular2/angular2';
|
||||||
import {Optional} from 'angular2/src/di/annotations';
|
import {Optional} from 'angular2/src/di/annotations';
|
||||||
import {MdRadioDispatcher} from 'angular2_material/src/components/radio/radio_dispatcher'
|
import {MdRadioDispatcher} from 'angular2_material/src/components/radio/radio_dispatcher'
|
||||||
import {MdTheme} from 'angular2_material/src/core/theme'
|
|
||||||
import {onChange} from 'angular2/src/core/annotations/annotations';
|
import {onChange} from 'angular2/src/core/annotations/annotations';
|
||||||
import {isPresent, StringWrapper} from 'angular2/src/facade/lang';
|
import {isPresent, StringWrapper} from 'angular2/src/facade/lang';
|
||||||
import {ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
|
import {ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
|
||||||
import {Math} from 'angular2/src/facade/math';
|
|
||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||||
|
import {KEY_UP, KEY_DOWN, KEY_SPACE} from 'angular2_material/src/core/constants'
|
||||||
|
import {Event, KeyboardEvent} from 'angular2/src/facade/browser';
|
||||||
|
|
||||||
// TODO(jelbourn): Behaviors to test
|
// TODO(jelbourn): Behaviors to test
|
||||||
// Disabled radio don't select
|
// Disabled radio don't select
|
||||||
@ -159,14 +159,14 @@ export class MdRadioButton {
|
|||||||
|
|
||||||
this.checked = true;
|
this.checked = true;
|
||||||
|
|
||||||
if (this.radioGroup) {
|
if (isPresent(this.radioGroup)) {
|
||||||
this.radioGroup.updateValue(this.value, this.id);
|
this.radioGroup.updateValue(this.value, this.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Handles pressing the space key to select this focused radio button. */
|
/** Handles pressing the space key to select this focused radio button. */
|
||||||
onKeydown(event: KeyboardEvent) {
|
onKeydown(event: KeyboardEvent) {
|
||||||
if (event.keyCode == KeyCodes.SPACE) {
|
if (event.keyCode == KEY_SPACE) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.select(event);
|
this.select(event);
|
||||||
}
|
}
|
||||||
@ -293,13 +293,11 @@ export class MdRadioGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (event.keyCode) {
|
switch (event.keyCode) {
|
||||||
//case KeyCodes.UP:
|
case KEY_UP:
|
||||||
case 38:
|
|
||||||
this.stepSelectedRadio(-1);
|
this.stepSelectedRadio(-1);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
//case KeyCodes.DOWN:
|
case KEY_DOWN:
|
||||||
case 40:
|
|
||||||
this.stepSelectedRadio(1);
|
this.stepSelectedRadio(1);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
import {List, ListWrapper} from 'angular2/src/facade/collection';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for radio buttons to coordinate unique selection based on name.
|
* Class for radio buttons to coordinate unique selection based on name.
|
||||||
@ -6,7 +6,7 @@ import {ListWrapper} from 'angular2/src/facade/collection';
|
|||||||
*/
|
*/
|
||||||
export class MdRadioDispatcher {
|
export class MdRadioDispatcher {
|
||||||
// TODO(jelbourn): Change this to TypeScript syntax when supported.
|
// TODO(jelbourn): Change this to TypeScript syntax when supported.
|
||||||
listeners_: Array<Function>;
|
listeners_: List<Function>;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.listeners_ = [];
|
this.listeners_ = [];
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import {Component, View, Attribute, PropertySetter} from 'angular2/angular2';
|
import {Component, View, Attribute, PropertySetter} from 'angular2/angular2';
|
||||||
import {isPresent} from 'angular2/src/facade/lang';
|
import {isPresent} from 'angular2/src/facade/lang';
|
||||||
import {KeyCodes} from 'angular2_material/src/core/constants'
|
import {KEY_SPACE} from 'angular2_material/src/core/constants'
|
||||||
|
import {KeyboardEvent} from 'angular2/src/facade/browser';
|
||||||
|
|
||||||
// TODO(jelbourn): without gesture support, this is identical to MdCheckbox.
|
// TODO(jelbourn): without gesture support, this is identical to MdCheckbox.
|
||||||
|
|
||||||
@ -22,6 +23,9 @@ export class MdSwitch {
|
|||||||
/** Whether this switch is checked. */
|
/** Whether this switch is checked. */
|
||||||
checked_: boolean;
|
checked_: boolean;
|
||||||
|
|
||||||
|
/** Whether this switch is disabled. */
|
||||||
|
disabled_: boolean;
|
||||||
|
|
||||||
/** Setter for `aria-checked` attribute. */
|
/** Setter for `aria-checked` attribute. */
|
||||||
ariaCheckedSetter: Function;
|
ariaCheckedSetter: Function;
|
||||||
|
|
||||||
@ -61,7 +65,7 @@ export class MdSwitch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onKeydown(event: KeyboardEvent) {
|
onKeydown(event: KeyboardEvent) {
|
||||||
if (event.keyCode == KeyCodes.SPACE) {
|
if (event.keyCode == KEY_SPACE) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.toggle(event);
|
this.toggle(event);
|
||||||
}
|
}
|
||||||
|
12
modules/angular2_material/src/core/constants.js
vendored
12
modules/angular2_material/src/core/constants.js
vendored
@ -1,8 +1,6 @@
|
|||||||
|
// TODO: switch to proper enums when we support them.
|
||||||
|
|
||||||
// TODO: this is not how TS&Dart enums are defined and it definitely won't
|
// Key codes
|
||||||
// work in Dart. Switch to proper enums when we support them.
|
export const KEY_SPACE = 32;
|
||||||
//export var KeyCodes = {
|
export const KEY_UP = 38;
|
||||||
// SPACE: 32,
|
export const KEY_DOWN = 40;
|
||||||
// UP: 38,
|
|
||||||
// DOWN: 40
|
|
||||||
//};
|
|
||||||
|
@ -34,7 +34,7 @@ module.exports = function(gulp, plugins, config) {
|
|||||||
|
|
||||||
function analyze(dirName, done) {
|
function analyze(dirName, done) {
|
||||||
// analyze files in lib directly – or you mess up package: urls
|
// analyze files in lib directly – or you mess up package: urls
|
||||||
var sources = [].slice.call(glob.sync('lib/*.dart', {
|
var sources = [].slice.call(glob.sync('lib/**/*.dart', {
|
||||||
cwd: dirName
|
cwd: dirName
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user