UNPKG

@progress/kendo-angular-dialog

Version:
103 lines (102 loc) 5.3 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Component, ElementRef, HostBinding, HostListener, Input, Optional, NgZone, Renderer2 } from "@angular/core"; import { NgIf, NgClass } from "@angular/common"; import { Button } from '@progress/kendo-angular-buttons'; import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n'; import { xIcon } from '@progress/kendo-svg-icons'; import { IconWrapperComponent } from "@progress/kendo-angular-icons"; import { DragResizeService } from '../drag-resize.service'; import * as i0 from "@angular/core"; import * as i1 from "../drag-resize.service"; import * as i2 from "@progress/kendo-angular-l10n"; export class WindowCloseActionDirective extends Button { /** * @hidden */ window; /** * @hidden */ xIcon = xIcon; buttonType = 'button'; buttonClass = true; constructor(el, renderer, _service, localization, ngZone) { super(el, renderer, null, localization, ngZone); this.window = _service; this.fillMode = 'flat'; this.icon = 'x'; } /** * @hidden */ onClick() { if (!this.isDisabled) { this.window.closeAction(); } } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WindowCloseActionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.DragResizeService, optional: true }, { token: i2.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: WindowCloseActionDirective, isStandalone: true, selector: "button[kendoWindowCloseAction]", inputs: { window: "window" }, host: { listeners: { "click": "onClick()" }, properties: { "attr.type": "this.buttonType", "class.k-window-titlebar-action": "this.buttonClass" } }, providers: [ LocalizationService, { provide: L10N_PREFIX, useValue: 'kendo.button' } ], exportAs: ["kendoWindowCloseAction"], usesInheritance: true, ngImport: i0, template: ` <kendo-icon-wrapper *ngIf="!imageUrl && !iconClass" innerCssClass="k-button-icon" name="close" [svgIcon]="xIcon"> </kendo-icon-wrapper> <span *ngIf="imageUrl" class="k-button-icon k-icon"> <img [src]="imageUrl" class="k-image" role="presentation" /> </span> <span *ngIf="iconClass" class="k-button-icon" [ngClass]="iconClass"></span> <span class="k-button-text"><ng-content></ng-content></span> `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WindowCloseActionDirective, decorators: [{ type: Component, args: [{ exportAs: 'kendoWindowCloseAction', providers: [ LocalizationService, { provide: L10N_PREFIX, useValue: 'kendo.button' } ], selector: 'button[kendoWindowCloseAction]', template: ` <kendo-icon-wrapper *ngIf="!imageUrl && !iconClass" innerCssClass="k-button-icon" name="close" [svgIcon]="xIcon"> </kendo-icon-wrapper> <span *ngIf="imageUrl" class="k-button-icon k-icon"> <img [src]="imageUrl" class="k-image" role="presentation" /> </span> <span *ngIf="iconClass" class="k-button-icon" [ngClass]="iconClass"></span> <span class="k-button-text"><ng-content></ng-content></span> `, standalone: true, imports: [NgIf, IconWrapperComponent, NgClass] }] }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.DragResizeService, decorators: [{ type: Optional }] }, { type: i2.LocalizationService }, { type: i0.NgZone }]; }, propDecorators: { window: [{ type: Input }], buttonType: [{ type: HostBinding, args: ['attr.type'] }], buttonClass: [{ type: HostBinding, args: ['class.k-window-titlebar-action'] }], onClick: [{ type: HostListener, args: ['click'] }] } });