Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Nov 17, 2023
1 parent b4028d9 commit ee2b462
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 14 deletions.
4 changes: 0 additions & 4 deletions src/app/components/listbox/listbox.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ export interface ListboxSelectAllChangeEvent {
* Boolean value indicates whether all data is selected.
*/
checked: boolean;
/**
* Method to invoke on model value change.
*/
updateModel?: (value?: any, event?: Event) => void;
}
/**
* Custom filter event.
Expand Down
3 changes: 1 addition & 2 deletions src/app/components/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -865,8 +865,7 @@ export class Listbox implements AfterContentInit, OnInit, ControlValueAccessor,
if(this.selectAll !== null) {
this.onSelectAllChange.emit({
originalEvent: event,
checked: !this.allSelected(),
updateModel: this.updateModel.bind(this)
checked: !this.allSelected()
})
} else {
const value = this.allSelected()
Expand Down
4 changes: 0 additions & 4 deletions src/app/components/multiselect/multiselect.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ export interface MultiSelectSelectAllChangeEvent {
* Boolean value indicates whether all data is selected.
*/
checked: boolean;
/**
* Method to invoke on model value change.
*/
updateModel?: (value?: any, event?: Event) => void;
}
/**
* Custom filter event.
Expand Down
3 changes: 1 addition & 2 deletions src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1770,8 +1770,7 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
if(this.selectAll !== null) {
this.onSelectAllChange.emit({
originalEvent: event,
checked: !this.allSelected(),
updateModel: this.updateModel.bind(this)
checked: !this.allSelected()
})
} else {
const value = this.allSelected()
Expand Down
1 change: 0 additions & 1 deletion src/app/showcase/doc/listbox/virtualscrolldoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export class VirtualScrollDoc {
onSelectAllChange(event) {
this.selectedItems = event.checked ? [...this.items] : [];
this.selectAll = event.checked;
event.updateModel(this.selectedItems, event.originalEvent);
}

onChange(event) {
Expand Down
1 change: 0 additions & 1 deletion src/app/showcase/doc/multiselect/virtualscrolldoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export class VirtualScrollDoc {
onSelectAllChange(event) {
this.selectedItems = event.checked ? [...this.items] : [];
this.selectAll = event.checked;
event.updateModel(this.selectedItems, event.originalEvent);
}

onChange(event) {
Expand Down

0 comments on commit ee2b462

Please sign in to comment.