@progress/kendo-angular-editor
Version:
Kendo UI Editor for Angular
115 lines (114 loc) • 5.88 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, ViewChild } from '@angular/core';
import { DialogRef, DialogContentBase, DialogActionsComponent, DialogTitleBarComponent } from '@progress/kendo-angular-dialog';
import { ButtonComponent } from '@progress/kendo-angular-buttons';
import { EditorLocalizationService } from '../localization/editor-localization.service';
import { FormatDropDownListComponent } from '../tools/format/editor-format-dropdownlist.component';
import * as i0 from "@angular/core";
import * as i1 from "@progress/kendo-angular-dialog";
import * as i2 from "../localization/editor-localization.service";
/**
* @hidden
*/
export class FormatDialogComponent extends DialogContentBase {
dialog;
localization;
editor;
formatDropDownList;
data = [];
defaultItem;
value;
itemDisabled;
constructor(dialog, localization) {
super(dialog);
this.dialog = dialog;
this.localization = localization;
}
onCancelAction() {
this.dialog.close();
}
onConfirmAction() {
if (this.value) {
this.editor.exec('format', { tag: this.value });
}
this.dialog.close();
}
setData(args) {
this.editor = args.editor;
this.data = args.data;
this.defaultItem = args.defaultItem;
this.value = args.value;
this.itemDisabled = args.itemDisabled;
}
textFor(key) {
return this.localization.get(key);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormatDialogComponent, deps: [{ token: i1.DialogRef }, { token: i2.EditorLocalizationService }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FormatDialogComponent, isStandalone: true, selector: "ng-component", inputs: { editor: "editor" }, viewQueries: [{ propertyName: "formatDropDownList", first: true, predicate: ["formatDropDownList"], descendants: true, read: FormatDropDownListComponent, static: true }], usesInheritance: true, ngImport: i0, template: `
<kendo-dialog-titlebar (close)="onCancelAction()">
{{ textFor('format') }}
</kendo-dialog-titlebar>
<div [style.text-align]="'center'">
<kendo-editor-format-dropdownlist
#formatDropDownList
[defaultItem]="defaultItem"
[data]="data"
[(value)]="value"
[itemDisabled]="itemDisabled"
>
</kendo-editor-format-dropdownlist>
</div>
<kendo-dialog-actions layout="start">
<button
kendoButton
[primary]="true"
(click)="onConfirmAction()"
>{{ textFor('dialogApply') }}</button>
<button
kendoButton
(click)="onCancelAction()"
>{{ textFor('dialogCancel') }}</button>
</kendo-dialog-actions>
`, isInline: true, dependencies: [{ kind: "component", type: DialogTitleBarComponent, selector: "kendo-dialog-titlebar", inputs: ["id", "closeTitle"], outputs: ["close"] }, { kind: "component", type: FormatDropDownListComponent, selector: "kendo-editor-format-dropdownlist", inputs: ["data", "value", "defaultItem", "itemDisabled", "title", "disabled", "tabindex"], outputs: ["valueChange"] }, { kind: "component", type: DialogActionsComponent, selector: "kendo-dialog-actions", inputs: ["actions", "layout"], outputs: ["action"] }, { 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"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormatDialogComponent, decorators: [{
type: Component,
args: [{
template: `
<kendo-dialog-titlebar (close)="onCancelAction()">
{{ textFor('format') }}
</kendo-dialog-titlebar>
<div [style.text-align]="'center'">
<kendo-editor-format-dropdownlist
#formatDropDownList
[defaultItem]="defaultItem"
[data]="data"
[(value)]="value"
[itemDisabled]="itemDisabled"
>
</kendo-editor-format-dropdownlist>
</div>
<kendo-dialog-actions layout="start">
<button
kendoButton
[primary]="true"
(click)="onConfirmAction()"
>{{ textFor('dialogApply') }}</button>
<button
kendoButton
(click)="onCancelAction()"
>{{ textFor('dialogCancel') }}</button>
</kendo-dialog-actions>
`,
standalone: true,
imports: [DialogTitleBarComponent, FormatDropDownListComponent, DialogActionsComponent, ButtonComponent]
}]
}], ctorParameters: function () { return [{ type: i1.DialogRef }, { type: i2.EditorLocalizationService }]; }, propDecorators: { editor: [{
type: Input
}], formatDropDownList: [{
type: ViewChild,
args: ['formatDropDownList', { read: FormatDropDownListComponent, static: true }]
}] } });