UNPKG

@progress/kendo-angular-listbox

Version:
29 lines (28 loc) 1.35 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { EventEmitter, Injectable } from "@angular/core"; import * as i0 from "@angular/core"; /** * @hidden */ export class ListBoxSelectionService { onSelect = new EventEmitter(); selectedIndex = null; select(index) { this.onSelect.next({ index: index, prevIndex: this.selectedIndex }); this.selectedIndex = index; } isSelected(index) { return index === this.selectedIndex; } clearSelection() { this.selectedIndex = null; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ListBoxSelectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ListBoxSelectionService }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ListBoxSelectionService, decorators: [{ type: Injectable }] });