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,
|
||||
window,
|
||||
Element,
|
||||
Node;
|
||||
Node,
|
||||
KeyboardEvent,
|
||||
Event;
|
||||
|
||||
final _gc = context['gc'];
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import {Component, View, Attribute, PropertySetter} from 'angular2/angular2';
|
||||
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({
|
||||
selector: 'md-checkbox',
|
||||
|
@ -20,6 +21,9 @@ export class MdCheckbox {
|
|||
/** Whether this checkbox is checked. */
|
||||
checked_: boolean;
|
||||
|
||||
/** Whether this checkbox is disabled. */
|
||||
disabled_: boolean;
|
||||
|
||||
/** Setter for `aria-checked` attribute. */
|
||||
ariaCheckedSetter: Function;
|
||||
|
||||
|
@ -59,7 +63,7 @@ export class MdCheckbox {
|
|||
}
|
||||
|
||||
onKeydown(event: KeyboardEvent) {
|
||||
if (event.keyCode == KeyCodes.SPACE) {
|
||||
if (event.keyCode == KEY_SPACE) {
|
||||
event.preventDefault();
|
||||
this.toggle(event);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import {Component, View, onAllChangesDone, Parent} from 'angular2/angular2';
|
||||
import {onDestroy, onChange} from 'angular2/src/core/annotations/annotations';
|
||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {CONST} from 'angular2/src/facade/lang';
|
||||
import {isPresent, isString, NumberWrapper} from 'angular2/src/facade/lang';
|
||||
import {isPresent, isString, NumberWrapper, stringify} from 'angular2/src/facade/lang';
|
||||
import {PropertySetter} from 'angular2/src/core/annotations/di';
|
||||
|
||||
// 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 {
|
||||
/** List of tiles that are being rendered. */
|
||||
tiles: Array<MdGridTile>;
|
||||
tiles: List<MdGridTile>;
|
||||
|
||||
/** Number of columns being rendered. Can be either string or number */
|
||||
cols;
|
||||
|
@ -37,8 +36,8 @@ export class MdGridList {
|
|||
/** The amount of space between tiles. This will be something like '5px' or '2em'. */
|
||||
gutterSize: string;
|
||||
|
||||
/** Array used to track the amount of space available. */
|
||||
spaceTracker: Array<number>;
|
||||
/** List used to track the amount of space available. */
|
||||
spaceTracker: List<number>;
|
||||
|
||||
constructor() {
|
||||
this.tiles = [];
|
||||
|
@ -144,8 +143,8 @@ export class MdGridList {
|
|||
switch (this.rowHeightMode) {
|
||||
case 'fixed':
|
||||
// In fixed mode, simply use the given row height.
|
||||
tileStyle.top = getTilePosition(this.fixedRowHeight, rowIndex);
|
||||
tileStyle.height = getTileSize(this.fixedRowHeight, tile.rowspan);
|
||||
tileStyle.top = getTilePosition(stringify(this.fixedRowHeight), rowIndex);
|
||||
tileStyle.height = getTileSize(stringify(this.fixedRowHeight), tile.rowspan);
|
||||
break;
|
||||
|
||||
case 'ratio':
|
||||
|
@ -160,8 +159,6 @@ export class MdGridList {
|
|||
break;
|
||||
|
||||
case 'fit':
|
||||
var percentHeightPerTile;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import {Decorator} from 'angular2/angular2';
|
||||
import {PropertySetter} from 'angular2/src/core/annotations/di';
|
||||
|
||||
@Decorator({
|
||||
selector: 'md-input-container input'
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import {Component, View} from 'angular2/angular2';
|
||||
import {isPresent} from 'angular2/src/facade/lang';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'md-progress-circular'
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import {Component, View, Parent, Ancestor, Attribute, PropertySetter} from 'angular2/angular2';
|
||||
import {Optional} from 'angular2/src/di/annotations';
|
||||
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 {isPresent, StringWrapper} from 'angular2/src/facade/lang';
|
||||
import {ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
|
||||
import {Math} from 'angular2/src/facade/math';
|
||||
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
|
||||
// Disabled radio don't select
|
||||
|
@ -159,14 +159,14 @@ export class MdRadioButton {
|
|||
|
||||
this.checked = true;
|
||||
|
||||
if (this.radioGroup) {
|
||||
if (isPresent(this.radioGroup)) {
|
||||
this.radioGroup.updateValue(this.value, this.id);
|
||||
}
|
||||
}
|
||||
|
||||
/** Handles pressing the space key to select this focused radio button. */
|
||||
onKeydown(event: KeyboardEvent) {
|
||||
if (event.keyCode == KeyCodes.SPACE) {
|
||||
if (event.keyCode == KEY_SPACE) {
|
||||
event.preventDefault();
|
||||
this.select(event);
|
||||
}
|
||||
|
@ -293,13 +293,11 @@ export class MdRadioGroup {
|
|||
}
|
||||
|
||||
switch (event.keyCode) {
|
||||
//case KeyCodes.UP:
|
||||
case 38:
|
||||
case KEY_UP:
|
||||
this.stepSelectedRadio(-1);
|
||||
event.preventDefault();
|
||||
break;
|
||||
//case KeyCodes.DOWN:
|
||||
case 40:
|
||||
case KEY_DOWN:
|
||||
this.stepSelectedRadio(1);
|
||||
event.preventDefault();
|
||||
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.
|
||||
|
@ -6,7 +6,7 @@ import {ListWrapper} from 'angular2/src/facade/collection';
|
|||
*/
|
||||
export class MdRadioDispatcher {
|
||||
// TODO(jelbourn): Change this to TypeScript syntax when supported.
|
||||
listeners_: Array<Function>;
|
||||
listeners_: List<Function>;
|
||||
|
||||
constructor() {
|
||||
this.listeners_ = [];
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import {Component, View, Attribute, PropertySetter} from 'angular2/angular2';
|
||||
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.
|
||||
|
||||
|
@ -22,6 +23,9 @@ export class MdSwitch {
|
|||
/** Whether this switch is checked. */
|
||||
checked_: boolean;
|
||||
|
||||
/** Whether this switch is disabled. */
|
||||
disabled_: boolean;
|
||||
|
||||
/** Setter for `aria-checked` attribute. */
|
||||
ariaCheckedSetter: Function;
|
||||
|
||||
|
@ -61,7 +65,7 @@ export class MdSwitch {
|
|||
}
|
||||
|
||||
onKeydown(event: KeyboardEvent) {
|
||||
if (event.keyCode == KeyCodes.SPACE) {
|
||||
if (event.keyCode == KEY_SPACE) {
|
||||
event.preventDefault();
|
||||
this.toggle(event);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
// work in Dart. Switch to proper enums when we support them.
|
||||
//export var KeyCodes = {
|
||||
// SPACE: 32,
|
||||
// UP: 38,
|
||||
// DOWN: 40
|
||||
//};
|
||||
// Key codes
|
||||
export const KEY_SPACE = 32;
|
||||
export const KEY_UP = 38;
|
||||
export const KEY_DOWN = 40;
|
||||
|
|
|
@ -34,7 +34,7 @@ module.exports = function(gulp, plugins, config) {
|
|||
|
||||
function analyze(dirName, done) {
|
||||
// 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
|
||||
}));
|
||||
|
||||
|
|
Loading…
Reference in New Issue