@progress/kendo-angular-grid
Version:
Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.
103 lines (102 loc) • 5.23 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 } from '@angular/core';
import { DialogActionsComponent, DialogContentBase, DialogRef } from '@progress/kendo-angular-dialog';
import { FormComponent } from './form.component';
import { FormGroup } from '@angular/forms';
import { KENDO_BUTTON } from '@progress/kendo-angular-buttons';
import { cancelIcon, saveIcon } from '@progress/kendo-svg-icons';
import { LocalizationService } from '@progress/kendo-angular-l10n';
import * as i0 from "@angular/core";
import * as i1 from "@progress/kendo-angular-dialog";
import * as i2 from "@progress/kendo-angular-l10n";
import * as i3 from "@progress/kendo-angular-buttons";
/**
* @hidden
*/
export class DialogFormComponent extends DialogContentBase {
localization;
controls;
formGroup;
formSettings;
saveIcon = saveIcon;
cancelIcon = cancelIcon;
constructor(dialogRef, localization) {
super(dialogRef);
this.localization = localization;
}
save() {
this.dialog.close({ text: this.localization.get('externalEditingSaveText') });
}
cancel() {
this.dialog.close({ text: this.localization.get('externalEditingCancelText') });
}
messageFor(key) {
return this.localization.get(key);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogFormComponent, deps: [{ token: i1.DialogRef }, { token: i2.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DialogFormComponent, isStandalone: true, selector: "kendo-grid-dialog-form", inputs: { controls: "controls", formGroup: "formGroup", formSettings: "formSettings" }, usesInheritance: true, ngImport: i0, template: `
<kendo-grid-external-form
[controls]="controls"
[formGroup]="formGroup"
[formSettings]="formSettings"
[actionButtons]="false"></kendo-grid-external-form>
<kendo-dialog-actions [layout]="this.dialog?.dialog?.instance?.actionsLayout">
<button
kendoButton
themeColor="primary"
[svgIcon]="saveIcon"
[disabled]="!formGroup.valid"
(click)="save()"
>
{{messageFor('externalEditingSaveText')}}
</button>
<button
kendoButton
[svgIcon]="cancelIcon"
(click)="cancel()">
{{messageFor('externalEditingCancelText')}}
</button>
</kendo-dialog-actions>
`, isInline: true, dependencies: [{ kind: "component", type: FormComponent, selector: "kendo-grid-external-form", inputs: ["controls", "formSettings", "formGroup", "actionButtons"], outputs: ["formSubmit"] }, { kind: "component", type: DialogActionsComponent, selector: "kendo-dialog-actions", inputs: ["actions", "layout"], outputs: ["action"] }, { kind: "component", type: i3.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: DialogFormComponent, decorators: [{
type: Component,
args: [{
selector: 'kendo-grid-dialog-form',
standalone: true,
imports: [FormComponent, DialogActionsComponent, KENDO_BUTTON],
template: `
<kendo-grid-external-form
[controls]="controls"
[formGroup]="formGroup"
[formSettings]="formSettings"
[actionButtons]="false"></kendo-grid-external-form>
<kendo-dialog-actions [layout]="this.dialog?.dialog?.instance?.actionsLayout">
<button
kendoButton
themeColor="primary"
[svgIcon]="saveIcon"
[disabled]="!formGroup.valid"
(click)="save()"
>
{{messageFor('externalEditingSaveText')}}
</button>
<button
kendoButton
[svgIcon]="cancelIcon"
(click)="cancel()">
{{messageFor('externalEditingCancelText')}}
</button>
</kendo-dialog-actions>
`
}]
}], ctorParameters: function () { return [{ type: i1.DialogRef }, { type: i2.LocalizationService }]; }, propDecorators: { controls: [{
type: Input
}], formGroup: [{
type: Input
}], formSettings: [{
type: Input
}] } });