@progress/kendo-angular-buttons
Version:
Buttons Package for Angular
99 lines (98 loc) • 4.72 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 { 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: "18.2.14", ngImport: i0, type: DialListComponent, deps: [{ token: i1.FocusService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", 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: `
@for (item of dialItems; track item; let idx = $index) {
<li
kendoButtonFocusable
kendoDialItem
[]="dialItems[idx]"
[]="idx"
[]="dialItemTemplate"
[]="isFocused(idx)"
[]='item.cssClass'
[]='item.cssStyle'
[]="align"
>
</li>
}
`, isInline: true, dependencies: [{ 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: "18.2.14", ngImport: i0, type: DialListComponent, decorators: [{
type: Component,
args: [{
// eslint-disable-next-line @angular-eslint/component-selector
selector: '[kendoDialList]',
template: `
@for (item of dialItems; track item; let idx = $index) {
<li
kendoButtonFocusable
kendoDialItem
[]="dialItems[idx]"
[]="idx"
[]="dialItemTemplate"
[]="isFocused(idx)"
[]='item.cssClass'
[]='item.cssStyle'
[]="align"
>
</li>
}
`,
standalone: true,
imports: [FocusableDirective, DialItemComponent, NgClass, NgStyle]
}]
}], ctorParameters: () => [{ 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
}] } });