UNPKG

@progress/kendo-angular-dialog

Version:
109 lines (108 loc) 5.65 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 { windowRestoreIcon } 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 WindowRestoreActionDirective extends Button { /** * @hidden */ window; /** * @hidden */ windowRestoreIcon = windowRestoreIcon; buttonType = 'button'; buttonClass = true; constructor(el, renderer, _service, localization, ngZone) { super(el, renderer, null, localization, ngZone); this.window = _service; this.fillMode = 'flat'; this.icon = 'window-restore'; } /** * @hidden */ onClick() { if (!this.isDisabled) { this.window.restoreAction(); } } get visible() { return this.window.options.state === 'default' ? 'none' : 'inline-flex'; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: WindowRestoreActionDirective, 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: WindowRestoreActionDirective, isStandalone: true, selector: "button[kendoWindowRestoreAction]", inputs: { window: "window" }, host: { listeners: { "click": "onClick()" }, properties: { "attr.type": "this.buttonType", "class.k-window-titlebar-action": "this.buttonClass", "style.display": "this.visible" } }, providers: [ LocalizationService, { provide: L10N_PREFIX, useValue: 'kendo.button' } ], exportAs: ["kendoWindowRestoreAction"], usesInheritance: true, ngImport: i0, template: ` <kendo-icon-wrapper *ngIf="!imageUrl && !iconClass" innerCssClass="k-button-icon" name="window-restore" [svgIcon]="windowRestoreIcon"> </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: WindowRestoreActionDirective, decorators: [{ type: Component, args: [{ exportAs: 'kendoWindowRestoreAction', providers: [ LocalizationService, { provide: L10N_PREFIX, useValue: 'kendo.button' } ], selector: 'button[kendoWindowRestoreAction]', template: ` <kendo-icon-wrapper *ngIf="!imageUrl && !iconClass" innerCssClass="k-button-icon" name="window-restore" [svgIcon]="windowRestoreIcon"> </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'] }], visible: [{ type: HostBinding, args: ['style.display'] }] } });