Skip to content

Commit

Permalink
feat(components/forms): change SkyCheckboxChange type to an interface
Browse files Browse the repository at this point in the history
change the `SkyCheckboxChange` type from a class to an interface

BREAKING CHANGE: This change updates the `SkyCheckboxChange` type to be an interface instead of a
class. To address this, remove any instances of instantiating the `SkyCheckboxChange` class and
instead create an object that uses the interface type.
  • Loading branch information
Blackbaud-ErikaMcVey committed Sep 29, 2022
1 parent 1a31f5b commit 6542564
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SkyCheckboxComponent } from './checkbox.component';
/**
* Fires when users select or deselect the checkbox.
*/
export class SkyCheckboxChange {
public source: SkyCheckboxComponent | undefined;
public checked: boolean | undefined;
export interface SkyCheckboxChange {
source: SkyCheckboxComponent | undefined;
checked: boolean | undefined;
}
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,7 @@ export class SkyCheckboxComponent implements ControlValueAccessor, OnInit {
#controlValueAccessorChangeFn: (value: any) => void = (value) => {};

#emitChangeEvent(): void {
const event = new SkyCheckboxChange();
event.source = this;
event.checked = this.#_checked;
const event: SkyCheckboxChange = { source: this, checked: this.#_checked };

this.#controlValueAccessorChangeFn(this.#_checked);
this.change.emit(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class ListViewChecklistToolbarTestComponent {
}

public changeVisibleItems(checked: boolean): void {
const checkbox = new SkyCheckboxChange();
const checkbox = { checked } as SkyCheckboxChange;
checkbox.checked = checked;
this.checklist.changeVisibleItems(checkbox);
}
Expand Down

0 comments on commit 6542564

Please sign in to comment.