@progress/kendo-angular-buttons
Version:
Buttons Package for Angular
99 lines (98 loc) • 4.98 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { ChangeDetectorRef, Component, HostBinding, Input, TemplateRef } from "@angular/core";
import { Subscription } from 'rxjs';
import { FocusService } from '../focusable/focus.service';
import { DialItemComponent } from "./dial-item.component";
import { FocusableDirective } from "../focusable/focusable.directive";
import { NgFor, NgClass, NgStyle } from "@angular/common";
import * as i0 from "@angular/core";
import * as i1 from "../focusable/focus.service";
/**
* @hidden
*/
export class DialListComponent {
focusService;
cdr;
hostClass = true;
get bottomClass() {
return this.align.vertical === 'top' || this.align.vertical === 'middle';
}
get topClass() {
return this.align.vertical === 'bottom';
}
dialItems;
dialItemTemplate;
align;
subscriptions = new Subscription();
constructor(focusService, cdr) {
this.focusService = focusService;
this.cdr = cdr;
this.subscriptions.add(this.focusService.onFocus.subscribe(() => this.cdr.detectChanges()));
}
isFocused(index) {
return this.focusService.isFocused(index);
}
ngOnDestroy() {
this.subscriptions.unsubscribe();
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialListComponent, deps: [{ token: i1.FocusService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DialListComponent, isStandalone: true, selector: "[kendoDialList]", inputs: { dialItems: "dialItems", dialItemTemplate: "dialItemTemplate", align: "align" }, host: { properties: { "class.k-fab-items": "this.hostClass", "class.k-fab-items-bottom": "this.bottomClass", "class.k-fab-items-top": "this.topClass" } }, ngImport: i0, template: `
<ng-container *ngFor='let item of dialItems; let idx = index'>
<li
kendoButtonFocusable
kendoDialItem
[item]="dialItems[idx]"
[index]="idx"
[dialItemTemplate]="dialItemTemplate"
[isFocused]="isFocused(idx)"
[ngClass]='item.cssClass'
[ngStyle]='item.cssStyle'
[align]="align"
>
</li>
</ng-container>
`, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: FocusableDirective, selector: "[kendoButtonFocusable]", inputs: ["index"] }, { kind: "component", type: DialItemComponent, selector: "[kendoDialItem]", inputs: ["cssClass", "cssStyle", "isFocused", "index", "item", "dialItemTemplate", "align"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialListComponent, decorators: [{
type: Component,
args: [{
// eslint-disable-next-line @angular-eslint/component-selector
selector: '[kendoDialList]',
template: `
<ng-container *ngFor='let item of dialItems; let idx = index'>
<li
kendoButtonFocusable
kendoDialItem
[item]="dialItems[idx]"
[index]="idx"
[dialItemTemplate]="dialItemTemplate"
[isFocused]="isFocused(idx)"
[ngClass]='item.cssClass'
[ngStyle]='item.cssStyle'
[align]="align"
>
</li>
</ng-container>
`,
standalone: true,
imports: [NgFor, FocusableDirective, DialItemComponent, NgClass, NgStyle]
}]
}], ctorParameters: function () { return [{ type: i1.FocusService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { hostClass: [{
type: HostBinding,
args: ['class.k-fab-items']
}], bottomClass: [{
type: HostBinding,
args: ['class.k-fab-items-bottom']
}], topClass: [{
type: HostBinding,
args: ['class.k-fab-items-top']
}], dialItems: [{
type: Input
}], dialItemTemplate: [{
type: Input
}], align: [{
type: Input
}] } });