Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(list): remove 6.0.0 deletion targets #10398

Merged
merged 1 commit into from
Mar 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions src/lib/list/selection-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {By} from '@angular/platform-browser';
import {
MatListModule,
MatListOption,
MatListOptionChange,
MatSelectionList,
MatSelectionListChange
} from './index';
Expand Down Expand Up @@ -91,22 +90,6 @@ describe('MatSelectionList without forms', () => {
expect(fixture.componentInstance.onValueChange).toHaveBeenCalledTimes(1);
});

it('should emit a deprecated selectionChange event on the list option that got clicked', () => {
const optionInstance = listOptions[2].componentInstance as MatListOption;
let lastChangeEvent: MatListOptionChange | null = null;

optionInstance.selectionChange.subscribe(ev => lastChangeEvent = ev);

expect(lastChangeEvent).toBeNull();

dispatchFakeEvent(listOptions[2].nativeElement, 'click');
fixture.detectChanges();

expect(lastChangeEvent).not.toBeNull();
expect(lastChangeEvent!.source).toBe(optionInstance);
expect(lastChangeEvent!.selected).toBe(true);
});

it('should be able to dispatch one selected item', () => {
let testListItem = listOptions[2].injector.get<MatListOption>(MatListOption);
let selectList =
Expand Down
33 changes: 0 additions & 33 deletions src/lib/list/selection-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,6 @@ export const MAT_SELECTION_LIST_VALUE_ACCESSOR: any = {
multi: true
};

/**
* Change event object emitted by MatListOption whenever the selected state changes.
* @deprecated Use the `MatSelectionListChange` event on the selection list instead.
* @deletion-target 6.0.0
*/
export class MatListOptionChange {
constructor(
/** Reference to the list option that changed. */
public source: MatListOption,
/** The new selected state of the option. */
public selected: boolean) {}
}

/** Change event that is being fired whenever the selected state of an option changes. */
export class MatSelectionListChange {
constructor(
Expand Down Expand Up @@ -148,14 +135,6 @@ export class MatListOption extends _MatListOptionMixinBase
}
}

/**
* Emits a change event whenever the selected state of an option changes.
* @deprecated Use the `selectionChange` event on the `<mat-selection-list>` instead.
* @deletion-target 6.0.0
*/
@Output() readonly selectionChange: EventEmitter<MatListOptionChange> =
new EventEmitter<MatListOptionChange>();

constructor(private _element: ElementRef,
private _changeDetector: ChangeDetectorRef,
/** @docs-private */
Expand Down Expand Up @@ -224,9 +203,6 @@ export class MatListOption extends _MatListOptionMixinBase

// Emit a change event if the selected state of the option changed through user interaction.
this.selectionList._emitChangeEvent(this);

// TODO: the `selectionChange` event on the option is deprecated. Remove that in the future.
this._emitDeprecatedChangeEvent();
}
}

Expand Down Expand Up @@ -261,12 +237,6 @@ export class MatListOption extends _MatListOptionMixinBase

this._changeDetector.markForCheck();
}

/** Emits a selectionChange event for this option. */
_emitDeprecatedChangeEvent() {
// TODO: the `selectionChange` event on the option is deprecated. Remove that in the future.
this.selectionChange.emit(new MatListOptionChange(this, this.selected));
}
}


Expand Down Expand Up @@ -492,9 +462,6 @@ export class MatSelectionList extends _MatSelectionListMixinBase implements Focu
// Emit a change event because the focused option changed its state through user
// interaction.
this._emitChangeEvent(focusedOption);

// TODO: the `selectionChange` event on the option is deprecated. Remove that in the future.
focusedOption._emitDeprecatedChangeEvent();
}
}
}
Expand Down