Merge branch 'master' into 3.0

# Conflicts:
#	src/components/action-sheet/test/basic/pages/page-one/page-one.ts
#	src/components/alert/alert.ts
#	src/components/content/content.ts
#	src/components/datetime/datetime.ts
#	src/components/datetime/test/datetime.spec.ts
#	src/components/loading/loading.ts
#	src/components/modal/test/basic/app.module.ts
#	src/components/picker/picker-component.ts
#	src/components/toast/toast.ts
#	src/components/toolbar/toolbar.ios.scss
#	src/components/toolbar/toolbar.md.scss
#	src/components/toolbar/toolbar.wp.scss
#	src/components/virtual-scroll/test/basic/app.module.ts
#	src/util/util.ts
This commit is contained in:
Brandy Carney
2017-03-20 18:07:38 -04:00
77 changed files with 1789 additions and 633 deletions

View File

@ -390,6 +390,21 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
/**
* @hidden
*/
checkHasValue(inputValue: any) {
if (this._item) {
let hasValue: boolean;
if (Array.isArray(inputValue)) {
hasValue = inputValue.length > 0;
} else {
hasValue = !isBlank(inputValue);
}
this._item.setElementClass('input-has-value', hasValue);
}
}
/**
* @private
*/
@ContentChildren(Option)
set options(val: QueryList<Option>) {
this._options = val;
@ -445,6 +460,7 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
console.debug('select, writeValue', val);
this._values = (Array.isArray(val) ? val : isBlank(val) ? [] : [val]);
this._updOpts();
this.checkHasValue(val);
}
/**
@ -464,6 +480,7 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
fn(val);
this._values = (Array.isArray(val) ? val : isBlank(val) ? [] : [val]);
this._updOpts();
this.checkHasValue(val);
this.onTouched();
};
}
@ -481,6 +498,7 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
console.debug('select, onChange w/out formControlName', val);
this._values = (Array.isArray(val) ? val : isBlank(val) ? [] : [val]);
this._updOpts();
this.checkHasValue(val);
this.onTouched();
}