"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/chips/chip-list.ts" between
material2-7.3.6.tar.gz and material2-7.3.7.tar.gz

About: material2 offers Material Design components for Angular.

chip-list.ts  (material2-7.3.6):chip-list.ts  (material2-7.3.7)
skipping to change at line 175 skipping to change at line 175
get role(): string | null { return this.empty ? null : 'listbox'; } get role(): string | null { return this.empty ? null : 'listbox'; }
/** An object used to control when error messages are shown. */ /** An object used to control when error messages are shown. */
@Input() errorStateMatcher: ErrorStateMatcher; @Input() errorStateMatcher: ErrorStateMatcher;
/** Whether the user should be allowed to select multiple chips. */ /** Whether the user should be allowed to select multiple chips. */
@Input() @Input()
get multiple(): boolean { return this._multiple; } get multiple(): boolean { return this._multiple; }
set multiple(value: boolean) { set multiple(value: boolean) {
this._multiple = coerceBooleanProperty(value); this._multiple = coerceBooleanProperty(value);
this._syncChipsState();
} }
private _multiple: boolean = false; private _multiple: boolean = false;
/** /**
* A function to compare the option values with the selected values. The first argument * A function to compare the option values with the selected values. The first argument
* is a value from an option. The second is a value from the selection. A bool ean * is a value from an option. The second is a value from the selection. A bool ean
* should be returned. * should be returned.
*/ */
@Input() @Input()
get compareWith(): (o1: any, o2: any) => boolean { return this._compareWith; } get compareWith(): (o1: any, o2: any) => boolean { return this._compareWith; }
skipping to change at line 267 skipping to change at line 268
get shouldLabelFloat(): boolean { return !this.empty || this.focused; } get shouldLabelFloat(): boolean { return !this.empty || this.focused; }
/** /**
* Implemented as part of MatFormFieldControl. * Implemented as part of MatFormFieldControl.
* @docs-private * @docs-private
*/ */
@Input() @Input()
get disabled(): boolean { return this.ngControl ? !!this.ngControl.disabled : this._disabled; } get disabled(): boolean { return this.ngControl ? !!this.ngControl.disabled : this._disabled; }
set disabled(value: boolean) { set disabled(value: boolean) {
this._disabled = coerceBooleanProperty(value); this._disabled = coerceBooleanProperty(value);
this._syncChipsDisabledState(); this._syncChipsState();
} }
protected _disabled: boolean = false; protected _disabled: boolean = false;
/** Orientation of the chip list. */ /** Orientation of the chip list. */
@Input('aria-orientation') ariaOrientation: 'horizontal' | 'vertical' = 'horiz ontal'; @Input('aria-orientation') ariaOrientation: 'horizontal' | 'vertical' = 'horiz ontal';
/** /**
* Whether or not this chip list is selectable. When a chip list is not select able, * Whether or not this chip list is selectable. When a chip list is not select able,
* the selected states for all the chips inside the chip list are always ignor ed. * the selected states for all the chips inside the chip list are always ignor ed.
*/ */
skipping to change at line 371 skipping to change at line 372
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
}); });
}); });
// When the list changes, re-subscribe // When the list changes, re-subscribe
this.chips.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscri be(() => { this.chips.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscri be(() => {
if (this.disabled) { if (this.disabled) {
// Since this happens after the content has been // Since this happens after the content has been
// checked, we need to defer it to the next tick. // checked, we need to defer it to the next tick.
Promise.resolve().then(() => { Promise.resolve().then(() => {
this._syncChipsDisabledState(); this._syncChipsState();
}); });
} }
this._resetChips(); this._resetChips();
// Reset chips selected/deselected status // Reset chips selected/deselected status
this._initializeSelection(); this._initializeSelection();
// Check to see if we need to update our tab index // Check to see if we need to update our tab index
this._updateTabIndex(); this._updateTabIndex();
skipping to change at line 779 skipping to change at line 780
} }
return false; return false;
} }
/** Checks whether any of the chips is focused. */ /** Checks whether any of the chips is focused. */
private _hasFocusedChip() { private _hasFocusedChip() {
return this.chips.some(chip => chip._hasFocus); return this.chips.some(chip => chip._hasFocus);
} }
/** Syncs the list's disabled state with the individual chips. */ /** Syncs the list's state with the individual chips. */
private _syncChipsDisabledState() { private _syncChipsState() {
if (this.chips) { if (this.chips) {
this.chips.forEach(chip => { this.chips.forEach(chip => {
chip.disabled = this._disabled; chip.disabled = this._disabled;
chip._chipListMultiple = this.multiple;
}); });
} }
} }
} }
 End of changes. 5 change blocks. 
4 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)