@progress/kendo-angular-dropdowns
Version:
A wide variety of native Angular dropdown components including AutoComplete, ComboBox, DropDownList, DropDownTree, MultiColumnComboBox, MultiSelect, and MultiSelectTree
276 lines (273 loc) • 14.5 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 { Component, Input, Output, EventEmitter, TemplateRef, ViewChild } from '@angular/core';
import { LocalizationService } from '@progress/kendo-angular-l10n';
import { animationDuration } from './util';
import { IconComponent } from '@progress/kendo-angular-icons';
import { xIcon } from '@progress/kendo-svg-icons';
import { ActionSheetComponent, ActionSheetTemplateDirective } from '@progress/kendo-angular-navigation';
import { TextBoxComponent, TextBoxPrefixTemplateDirective } from '@progress/kendo-angular-inputs';
import { NgIf, NgTemplateOutlet } from '@angular/common';
import { ButtonComponent } from '@progress/kendo-angular-buttons';
import * as i0 from "@angular/core";
import * as i1 from "@progress/kendo-angular-l10n";
/**
* @hidden
*/
export class ResponsiveRendererComponent {
localization;
title;
showActionButtons;
subtitle;
size;
showTextInput;
sharedPopupActionSheetTemplate;
isActionSheetExpanded;
text;
placeholder;
closePopup = new EventEmitter();
textInputChange = new EventEmitter();
navigate = new EventEmitter();
onExpand = new EventEmitter();
onCollapse = new EventEmitter();
onApply = new EventEmitter();
onCancel = new EventEmitter();
actionSheet;
actionSheetSearchBar;
constructor(localization) {
this.localization = localization;
}
searchBarValue = '';
animationDuration = animationDuration;
xIcon = xIcon;
expanded = false;
messageFor(key) {
return this.localization.get(key);
}
onValueChange(value) {
this.searchBarValue = value;
this.textInputChange.emit(value);
}
onOverlayClick() {
if (this.expanded) {
this.handleClose();
}
}
handleExpand() {
this.onExpand.emit();
this.expanded = true;
}
handleClose() {
this.closePopup.emit();
this.expanded = false;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ResponsiveRendererComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ResponsiveRendererComponent, isStandalone: true, selector: "responsive-renderer", inputs: { title: "title", showActionButtons: "showActionButtons", subtitle: "subtitle", size: "size", showTextInput: "showTextInput", sharedPopupActionSheetTemplate: "sharedPopupActionSheetTemplate", isActionSheetExpanded: "isActionSheetExpanded", text: "text", placeholder: "placeholder" }, outputs: { closePopup: "closePopup", textInputChange: "textInputChange", navigate: "navigate", 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 }], ngImport: i0, template: `
<kendo-actionsheet
[ ]="{ duration: animationDuration }"
[ ]="isActionSheetExpanded"
(overlayClick)="onOverlayClick()"
(keydown)="navigate.emit($event)"
(expand)="handleExpand()"
(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">{{ title }}</div>
<div class="k-actionsheet-subtitle k-text-center">{{ subtitle }}</div>
</div>
<div class="k-actionsheet-actions">
<button
kendoButton
icon="x"
type="button"
[ ]="messageFor('clearTitle')"
[ ]="xIcon"
fillMode="flat"
[ ]="size"
[ ]="-1"
aria-hidden="true"
innerCssClass="k-button-icon"
(click)="handleClose()"
></button>
</div>
</div>
<div class="k-actionsheet-titlebar-group k-actionsheet-filter">
<kendo-textbox
*ngIf="showTextInput"
[ ]="searchBarValue"
[ ]="size"
placeholder="Filter"
class="k-searchbox"
autocomplete="off"
(valueChange)="onValueChange($event)"
>
<ng-template kendoTextBoxPrefixTemplate>
<kendo-icon name="search"></kendo-icon>
</ng-template>
</kendo-textbox>
</div>
</div>
<div class="k-actionsheet-content !k-overflow-hidden">
<div class="k-list-container">
<ng-container *ngTemplateOutlet="sharedPopupActionSheetTemplate"></ng-container>
</div>
</div>
<div *ngIf="showActionButtons" class="k-actionsheet-footer k-actions k-actions-stretched">
<button kendoButton
tabindex="0"
aria-disabled="false"
type="button"
[ ]="size"
themeColor="base"
(click)="onCancel.emit()"
(keydown.enter)="$event.stopImmediatePropagation()">
{{messageFor('cancelButton')}}
</button>
<button kendoButton
tabindex="0"
aria-disabled="false"
type="button"
[ ]="size"
themeColor="primary"
(click)="onApply.emit()"
(keydown.enter)="$event.stopImmediatePropagation()">
{{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: "component", type: TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "type", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "successSvgIcon", "errorIcon", "errorSvgIcon", "clearButtonIcon", "clearButtonSvgIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength", "inputAttributes"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }, { kind: "directive", type: TextBoxPrefixTemplateDirective, selector: "[kendoTextBoxPrefixTemplate]", inputs: ["showSeparator"] }, { kind: "component", type: IconComponent, selector: "kendo-icon", inputs: ["name"], exportAs: ["kendoIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ResponsiveRendererComponent, decorators: [{
type: Component,
args: [{
selector: 'responsive-renderer',
template: `
<kendo-actionsheet
[ ]="{ duration: animationDuration }"
[ ]="isActionSheetExpanded"
(overlayClick)="onOverlayClick()"
(keydown)="navigate.emit($event)"
(expand)="handleExpand()"
(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">{{ title }}</div>
<div class="k-actionsheet-subtitle k-text-center">{{ subtitle }}</div>
</div>
<div class="k-actionsheet-actions">
<button
kendoButton
icon="x"
type="button"
[ ]="messageFor('clearTitle')"
[ ]="xIcon"
fillMode="flat"
[ ]="size"
[ ]="-1"
aria-hidden="true"
innerCssClass="k-button-icon"
(click)="handleClose()"
></button>
</div>
</div>
<div class="k-actionsheet-titlebar-group k-actionsheet-filter">
<kendo-textbox
*ngIf="showTextInput"
[ ]="searchBarValue"
[ ]="size"
placeholder="Filter"
class="k-searchbox"
autocomplete="off"
(valueChange)="onValueChange($event)"
>
<ng-template kendoTextBoxPrefixTemplate>
<kendo-icon name="search"></kendo-icon>
</ng-template>
</kendo-textbox>
</div>
</div>
<div class="k-actionsheet-content !k-overflow-hidden">
<div class="k-list-container">
<ng-container *ngTemplateOutlet="sharedPopupActionSheetTemplate"></ng-container>
</div>
</div>
<div *ngIf="showActionButtons" class="k-actionsheet-footer k-actions k-actions-stretched">
<button kendoButton
tabindex="0"
aria-disabled="false"
type="button"
[ ]="size"
themeColor="base"
(click)="onCancel.emit()"
(keydown.enter)="$event.stopImmediatePropagation()">
{{messageFor('cancelButton')}}
</button>
<button kendoButton
tabindex="0"
aria-disabled="false"
type="button"
[ ]="size"
themeColor="primary"
(click)="onApply.emit()"
(keydown.enter)="$event.stopImmediatePropagation()">
{{messageFor('applyButton')}}
</button>
</div>
</ng-template>
</kendo-actionsheet>
`,
standalone: true,
imports: [ActionSheetComponent, ActionSheetTemplateDirective, ButtonComponent, NgIf, TextBoxComponent, TextBoxPrefixTemplateDirective, IconComponent, NgTemplateOutlet]
}]
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { title: [{
type: Input
}], showActionButtons: [{
type: Input
}], subtitle: [{
type: Input
}], size: [{
type: Input
}], showTextInput: [{
type: Input
}], sharedPopupActionSheetTemplate: [{
type: Input
}], isActionSheetExpanded: [{
type: Input
}], text: [{
type: Input
}], placeholder: [{
type: Input
}], closePopup: [{
type: Output
}], textInputChange: [{
type: Output
}], navigate: [{
type: Output
}], onExpand: [{
type: Output
}], onCollapse: [{
type: Output
}], onApply: [{
type: Output
}], onCancel: [{
type: Output
}], actionSheet: [{
type: ViewChild,
args: [ActionSheetComponent]
}], actionSheetSearchBar: [{
type: ViewChild,
args: ['actionSheetSearchBar']
}] } });