UNPKG

@progress/kendo-angular-inputs

Version:

Kendo UI for Angular Inputs Package - Everything you need to build professional form functionality (Checkbox, ColorGradient, ColorPalette, ColorPicker, FlatColorPicker, FormField, MaskedTextBox, NumericTextBox, RadioButton, RangeSlider, Slider, Switch, Te

206 lines (205 loc) 11.4 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, Input, Output, EventEmitter, TemplateRef, ViewChild } from '@angular/core'; import { LocalizationService } from '@progress/kendo-angular-l10n'; import { checkIcon, xIcon } from '@progress/kendo-svg-icons'; import { ActionSheetComponent, ActionSheetTemplateDirective } from '@progress/kendo-angular-navigation'; import { NgIf, NgTemplateOutlet } from '@angular/common'; import { ButtonComponent } from '@progress/kendo-angular-buttons'; import { TextBoxComponent } from '../../textbox/textbox.component'; import { animationDuration } from '../models/adaptive-mode'; import { AdaptiveCloseButtonComponent } from './adaptive-close-button.component'; import * as i0 from "@angular/core"; import * as i1 from "@progress/kendo-angular-l10n"; /** * @hidden */ export class AdaptiveRendererComponent { localization; title; subtitle; actionSheetTemplate; isActionSheetExpanded; preview; actionSheetClose = new EventEmitter(); onExpand = new EventEmitter(); onCollapse = new EventEmitter(); onApply = new EventEmitter(); onCancel = new EventEmitter(); actionSheet; actionSheetSearchBar; cancelButton; applyButton; constructor(localization) { this.localization = localization; } animationDuration = animationDuration; xIcon = xIcon; checkIcon = checkIcon; messageFor(key) { return this.localization.get(key); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AdaptiveRendererComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AdaptiveRendererComponent, isStandalone: true, selector: "kendo-adaptive-renderer", inputs: { title: "title", subtitle: "subtitle", actionSheetTemplate: "actionSheetTemplate", isActionSheetExpanded: "isActionSheetExpanded", preview: "preview" }, outputs: { actionSheetClose: "actionSheetClose", onExpand: "onExpand", onCollapse: "onCollapse", onApply: "onApply", onCancel: "onCancel" }, viewQueries: [{ propertyName: "actionSheet", first: true, predicate: ActionSheetComponent, descendants: true }, { propertyName: "actionSheetSearchBar", first: true, predicate: ["actionSheetSearchBar"], descendants: true }, { propertyName: "cancelButton", first: true, predicate: ["cancel"], descendants: true }, { propertyName: "applyButton", first: true, predicate: ["apply"], descendants: true }], ngImport: i0, template: ` <kendo-actionsheet #actionSheet [animation]="{ duration: animationDuration }" [expanded]="isActionSheetExpanded" (overlayClick)="actionSheetClose.emit()" (expand)="onExpand.emit()" (collapse)="onCollapse.emit()" > <ng-template kendoActionSheetTemplate> <div class="k-text-center k-actionsheet-titlebar"> <div class="k-actionsheet-titlebar-group k-hbox"> <div class="k-actionsheet-title"> <div class="k-text-center">{{ messageFor('adaptiveTitle') }}</div> <div class="k-actionsheet-subtitle k-text-center"></div> </div> <div *ngIf="!preview" class="k-actionsheet-actions"> <kendo-adaptive-close-button icon="check" color="primary" [title]="messageFor('closeButton')" [svgIcon]="checkIcon" (close)="onApply.emit($event)"> </kendo-adaptive-close-button> </div> <div *ngIf="preview" class="k-actionsheet-actions"> <kendo-adaptive-close-button icon="x" [title]="messageFor('closeButton')" [svgIcon]="xIcon" (close)="actionSheetClose.emit($event)"> </kendo-adaptive-close-button> </div> </div> </div> <div class="k-actionsheet-content !k-overflow-hidden"> <ng-container *ngTemplateOutlet="actionSheetTemplate"></ng-container> </div> <div *ngIf="preview" class="k-actions k-actions-stretched k-actions-horizontal k-actionsheet-footer"> <button #cancel kendoButton size="large" (click)="onCancel.emit($event)" [title]="messageFor('cancelButton')"> {{messageFor('cancelButton')}} </button> <button #apply kendoButton size="large" themeColor="primary" (click)="onApply.emit()" [title]="messageFor('applyButton')"> {{messageFor('applyButton')}} </button> </div> </ng-template> </kendo-actionsheet> `, isInline: true, dependencies: [{ kind: "component", type: ActionSheetComponent, selector: "kendo-actionsheet", inputs: ["title", "subtitle", "items", "cssClass", "animation", "expanded", "titleId"], outputs: ["expandedChange", "expand", "collapse", "itemClick", "overlayClick"], exportAs: ["kendoActionSheet"] }, { kind: "directive", type: ActionSheetTemplateDirective, selector: "[kendoActionSheetTemplate]" }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AdaptiveCloseButtonComponent, selector: "kendo-adaptive-close-button", inputs: ["title", "icon", "svgIcon", "color"], outputs: ["close"] }] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AdaptiveRendererComponent, decorators: [{ type: Component, args: [{ selector: 'kendo-adaptive-renderer', template: ` <kendo-actionsheet #actionSheet [animation]="{ duration: animationDuration }" [expanded]="isActionSheetExpanded" (overlayClick)="actionSheetClose.emit()" (expand)="onExpand.emit()" (collapse)="onCollapse.emit()" > <ng-template kendoActionSheetTemplate> <div class="k-text-center k-actionsheet-titlebar"> <div class="k-actionsheet-titlebar-group k-hbox"> <div class="k-actionsheet-title"> <div class="k-text-center">{{ messageFor('adaptiveTitle') }}</div> <div class="k-actionsheet-subtitle k-text-center"></div> </div> <div *ngIf="!preview" class="k-actionsheet-actions"> <kendo-adaptive-close-button icon="check" color="primary" [title]="messageFor('closeButton')" [svgIcon]="checkIcon" (close)="onApply.emit($event)"> </kendo-adaptive-close-button> </div> <div *ngIf="preview" class="k-actionsheet-actions"> <kendo-adaptive-close-button icon="x" [title]="messageFor('closeButton')" [svgIcon]="xIcon" (close)="actionSheetClose.emit($event)"> </kendo-adaptive-close-button> </div> </div> </div> <div class="k-actionsheet-content !k-overflow-hidden"> <ng-container *ngTemplateOutlet="actionSheetTemplate"></ng-container> </div> <div *ngIf="preview" class="k-actions k-actions-stretched k-actions-horizontal k-actionsheet-footer"> <button #cancel kendoButton size="large" (click)="onCancel.emit($event)" [title]="messageFor('cancelButton')"> {{messageFor('cancelButton')}} </button> <button #apply kendoButton size="large" themeColor="primary" (click)="onApply.emit()" [title]="messageFor('applyButton')"> {{messageFor('applyButton')}} </button> </div> </ng-template> </kendo-actionsheet> `, standalone: true, imports: [ActionSheetComponent, ActionSheetTemplateDirective, ButtonComponent, NgIf, NgTemplateOutlet, AdaptiveCloseButtonComponent] }] }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { title: [{ type: Input }], subtitle: [{ type: Input }], actionSheetTemplate: [{ type: Input }], isActionSheetExpanded: [{ type: Input }], preview: [{ type: Input }], actionSheetClose: [{ type: Output }], onExpand: [{ type: Output }], onCollapse: [{ type: Output }], onApply: [{ type: Output }], onCancel: [{ type: Output }], actionSheet: [{ type: ViewChild, args: [ActionSheetComponent] }], actionSheetSearchBar: [{ type: ViewChild, args: ['actionSheetSearchBar'] }], cancelButton: [{ type: ViewChild, args: ['cancel'] }], applyButton: [{ type: ViewChild, args: ['apply'] }] } });