"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/list/selection-list.ts" between
material2-7.3.4.tar.gz and material2-7.3.5.tar.gz

About: material2 offers Material Design components for Angular.

selection-list.ts  (material2-7.3.4):selection-list.ts  (material2-7.3.5)
skipping to change at line 289 skipping to change at line 289
*/ */
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'mat-selection-list', selector: 'mat-selection-list',
exportAs: 'matSelectionList', exportAs: 'matSelectionList',
inputs: ['disableRipple'], inputs: ['disableRipple'],
host: { host: {
'role': 'listbox', 'role': 'listbox',
'[tabIndex]': 'tabIndex', '[tabIndex]': 'tabIndex',
'class': 'mat-selection-list mat-list-base', 'class': 'mat-selection-list mat-list-base',
'(focus)': 'focus()',
'(blur)': '_onTouched()', '(blur)': '_onTouched()',
'(keydown)': '_keydown($event)', '(keydown)': '_keydown($event)',
'aria-multiselectable': 'true', 'aria-multiselectable': 'true',
'[attr.aria-disabled]': 'disabled.toString()', '[attr.aria-disabled]': 'disabled.toString()',
}, },
template: '<ng-content></ng-content>', template: '<ng-content></ng-content>',
styleUrls: ['list.css'], styleUrls: ['list.css'],
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,
providers: [MAT_SELECTION_LIST_VALUE_ACCESSOR], providers: [MAT_SELECTION_LIST_VALUE_ACCESSOR],
changeDetection: ChangeDetectionStrategy.OnPush changeDetection: ChangeDetectionStrategy.OnPush
skipping to change at line 400 skipping to change at line 399
if (disableRippleChanges && !disableRippleChanges.firstChange) { if (disableRippleChanges && !disableRippleChanges.firstChange) {
this._markOptionsForCheck(); this._markOptionsForCheck();
} }
} }
ngOnDestroy() { ngOnDestroy() {
this._modelChanges.unsubscribe(); this._modelChanges.unsubscribe();
} }
/** Focuses the last active list option. */ /** Focuses the selection list. */
focus() { focus() {
this._element.nativeElement.focus(); this._element.nativeElement.focus();
} }
/** Selects all of the options. */ /** Selects all of the options. */
selectAll() { selectAll() {
this._setAllOptionsSelected(true); this._setAllOptionsSelected(true);
} }
/** Deselects all of the options. */ /** Deselects all of the options. */
skipping to change at line 430 skipping to change at line 429
/** /**
* Removes an option from the selection list and updates the active item. * Removes an option from the selection list and updates the active item.
* @returns Currently-active item. * @returns Currently-active item.
*/ */
_removeOptionFromList(option: MatListOption): MatListOption | null { _removeOptionFromList(option: MatListOption): MatListOption | null {
const optionIndex = this._getOptionIndex(option); const optionIndex = this._getOptionIndex(option);
if (optionIndex > -1 && this._keyManager.activeItemIndex === optionIndex) { if (optionIndex > -1 && this._keyManager.activeItemIndex === optionIndex) {
// Check whether the option is the last item // Check whether the option is the last item
if (optionIndex > 0) { if (optionIndex > 0) {
this._keyManager.updateActiveItemIndex(optionIndex - 1); this._keyManager.updateActiveItem(optionIndex - 1);
} else if (optionIndex === 0 && this.options.length > 1) { } else if (optionIndex === 0 && this.options.length > 1) {
this._keyManager.updateActiveItemIndex(Math.min(optionIndex + 1, this.op tions.length - 1)); this._keyManager.updateActiveItem(Math.min(optionIndex + 1, this.options .length - 1));
} }
} }
return this._keyManager.activeItem; return this._keyManager.activeItem;
} }
/** Passes relevant key presses to our key manager. */ /** Passes relevant key presses to our key manager. */
_keydown(event: KeyboardEvent) { _keydown(event: KeyboardEvent) {
const keyCode = event.keyCode; const keyCode = event.keyCode;
const manager = this._keyManager; const manager = this._keyManager;
 End of changes. 4 change blocks. 
4 lines changed or deleted 3 lines changed or added

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