@progress/kendo-angular-grid 18.4.1-develop.2 → 18.5.0-develop.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/column-menu/column-chooser.component.d.ts +0 -4
- package/column-menu/column-menu-item.component.d.ts +3 -4
- package/columns/column-base.d.ts +3 -2
- package/columns/column.component.d.ts +5 -5
- package/common/dom-events.service.d.ts +1 -0
- package/common/field-datatype.d.ts +9 -0
- package/directives.d.ts +5 -3
- package/editing/form/dialog-form.component.d.ts +27 -0
- package/editing/form/form-formfield.component.d.ts +24 -0
- package/editing/form/form.component.d.ts +28 -0
- package/editing/form/index.d.ts +8 -0
- package/editing/form/models.d.ts +196 -0
- package/editing-directives/editing-directive-base.d.ts +10 -3
- package/editing-directives/external-editing.directive.d.ts +46 -0
- package/esm2022/column-menu/column-chooser.component.mjs +2 -13
- package/esm2022/column-menu/column-list.component.mjs +53 -33
- package/esm2022/column-menu/column-menu-item.component.mjs +3 -4
- package/esm2022/columns/column-base.mjs +4 -0
- package/esm2022/columns/column.component.mjs +0 -4
- package/esm2022/common/dom-events.service.mjs +1 -0
- package/esm2022/common/field-datatype.mjs +5 -0
- package/esm2022/directives.mjs +8 -1
- package/esm2022/editing/edit.service.mjs +1 -1
- package/esm2022/editing/form/dialog-form.component.mjs +102 -0
- package/esm2022/editing/form/form-formfield.component.mjs +161 -0
- package/esm2022/editing/form/form.component.mjs +153 -0
- package/esm2022/editing/form/index.mjs +8 -0
- package/esm2022/editing/form/models.mjs +5 -0
- package/esm2022/editing-directives/editing-directive-base.mjs +33 -5
- package/esm2022/editing-directives/external-editing.directive.mjs +130 -0
- package/esm2022/filtering/cell/filter-cell-host.directive.mjs +5 -5
- package/esm2022/filtering/filter-host.directive.mjs +5 -7
- package/esm2022/filtering/menu/filter-menu-host.directive.mjs +5 -5
- package/esm2022/grid.component.mjs +78 -14
- package/esm2022/grid.module.mjs +15 -11
- package/esm2022/index.mjs +1 -0
- package/esm2022/localization/messages.mjs +62 -1
- package/esm2022/navigation/navigation.service.mjs +46 -16
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/rendering/footer/footer.component.mjs +12 -5
- package/esm2022/rendering/table-body.component.mjs +1 -1
- package/esm2022/selection/cell-selection.service.mjs +12 -4
- package/esm2022/selection/marquee.directive.mjs +7 -2
- package/esm2022/selection/selection.service.mjs +10 -6
- package/esm2022/utils.mjs +10 -1
- package/fesm2022/progress-kendo-angular-grid.mjs +858 -141
- package/filtering/cell/filter-cell-host.directive.d.ts +2 -2
- package/filtering/filter-host.directive.d.ts +2 -3
- package/filtering/menu/filter-menu-host.directive.d.ts +2 -2
- package/grid.component.d.ts +0 -6
- package/grid.module.d.ts +15 -11
- package/index.d.ts +3 -0
- package/localization/messages.d.ts +46 -1
- package/navigation/navigation.service.d.ts +2 -0
- package/package.json +19 -19
- package/rendering/footer/footer.component.d.ts +3 -1
- package/schematics/ngAdd/index.js +4 -4
- package/selection/cell-selection.service.d.ts +1 -1
- package/selection/selection.service.d.ts +2 -2
- package/selection/types.d.ts +5 -0
- package/utils.d.ts +5 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
6
|
+
import { ReactiveFormsModule, FormGroup } from '@angular/forms';
|
|
7
|
+
import { NgFor, NgIf, NgTemplateOutlet } from '@angular/common';
|
|
8
|
+
import { KENDO_BUTTON } from '@progress/kendo-angular-buttons';
|
|
9
|
+
import { cancelIcon, saveIcon } from '@progress/kendo-svg-icons';
|
|
10
|
+
import { FormFormFieldComponent } from './form-formfield.component';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
import * as i1 from "@angular/forms";
|
|
13
|
+
import * as i2 from "@progress/kendo-angular-buttons";
|
|
14
|
+
let idx = 0;
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export class FormComponent {
|
|
19
|
+
controls = [];
|
|
20
|
+
set formSettings(value) {
|
|
21
|
+
this._formSettings = { ...this._formSettings, ...value };
|
|
22
|
+
}
|
|
23
|
+
get formSettings() {
|
|
24
|
+
return this._formSettings;
|
|
25
|
+
}
|
|
26
|
+
formGroup;
|
|
27
|
+
set actionButtons(value) {
|
|
28
|
+
if (typeof value === 'boolean') {
|
|
29
|
+
this.normalizeActionButtonSettings(value);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this._actionButtons = value;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
get actionButtons() {
|
|
36
|
+
return this._actionButtons;
|
|
37
|
+
}
|
|
38
|
+
formSubmit = new EventEmitter();
|
|
39
|
+
get componentIndex() {
|
|
40
|
+
return idx++;
|
|
41
|
+
}
|
|
42
|
+
_formSettings = {
|
|
43
|
+
orientation: 'vertical',
|
|
44
|
+
showErrors: true,
|
|
45
|
+
floatingLabels: false
|
|
46
|
+
};
|
|
47
|
+
defaultActionButtons = [{
|
|
48
|
+
actionType: 'submit',
|
|
49
|
+
text: 'Submit',
|
|
50
|
+
svgIcon: saveIcon,
|
|
51
|
+
icon: 'save',
|
|
52
|
+
themeColor: 'primary'
|
|
53
|
+
}, {
|
|
54
|
+
actionType: 'reset',
|
|
55
|
+
svgIcon: cancelIcon,
|
|
56
|
+
text: 'Reset',
|
|
57
|
+
icon: 'cancel'
|
|
58
|
+
}];
|
|
59
|
+
_actionButtons = this.defaultActionButtons;
|
|
60
|
+
ngOnInit() {
|
|
61
|
+
idx++;
|
|
62
|
+
}
|
|
63
|
+
normalizeActionButtonSettings(value) {
|
|
64
|
+
this._actionButtons = value ? this.defaultActionButtons : [];
|
|
65
|
+
}
|
|
66
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
67
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FormComponent, isStandalone: true, selector: "kendo-grid-external-form", inputs: { controls: "controls", formSettings: "formSettings", formGroup: "formGroup", actionButtons: "actionButtons" }, outputs: { formSubmit: "formSubmit" }, ngImport: i0, template: `
|
|
68
|
+
<div role="form"
|
|
69
|
+
class="k-form k-form-md"
|
|
70
|
+
[class.k-form-horizontal]="formSettings.orientation === 'horizontal'"
|
|
71
|
+
[formGroup]="formGroup"
|
|
72
|
+
(ngSubmit)="formSubmit.next({originalEvent: $event, formGroup})"
|
|
73
|
+
(reset)="$event.preventDefault()">
|
|
74
|
+
<ng-container *ngFor="let control of controls; let idx = index;">
|
|
75
|
+
<ng-container *ngIf="!control.template; else template">
|
|
76
|
+
<kendo-form-formfield
|
|
77
|
+
[control]="control"
|
|
78
|
+
[showError]="formSettings.showErrors"
|
|
79
|
+
[floatingLabel]="formSettings.floatingLabels"></kendo-form-formfield>
|
|
80
|
+
</ng-container>
|
|
81
|
+
<ng-template #template>
|
|
82
|
+
<ng-container
|
|
83
|
+
[ngTemplateOutlet]="control.template"
|
|
84
|
+
[ngTemplateOutletContext]="control.templateContext"></ng-container>
|
|
85
|
+
</ng-template>
|
|
86
|
+
</ng-container>
|
|
87
|
+
<div class="k-form-buttons" *ngIf="$any(actionButtons).length">
|
|
88
|
+
<button kendoButton *ngFor="let button of $any(actionButtons)"
|
|
89
|
+
[class.k-form-submit]="button.actionType === 'submit'"
|
|
90
|
+
[size]="button.size"
|
|
91
|
+
[themeColor]="button.themeColor || button.actionType === 'submit' ? 'primary' : undefined"
|
|
92
|
+
[rounded]="button.rounded"
|
|
93
|
+
[attr.type]="button.actionType"
|
|
94
|
+
[svgIcon]="button.svgIcon"
|
|
95
|
+
[icon]="button.icon">
|
|
96
|
+
{{button.text}}
|
|
97
|
+
</button>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: FormFormFieldComponent, selector: "kendo-form-formfield", inputs: ["control", "floatingLabel", "showError"] }, { kind: "component", type: i2.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"] }] });
|
|
101
|
+
}
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormComponent, decorators: [{
|
|
103
|
+
type: Component,
|
|
104
|
+
args: [{
|
|
105
|
+
selector: 'kendo-grid-external-form',
|
|
106
|
+
standalone: true,
|
|
107
|
+
template: `
|
|
108
|
+
<div role="form"
|
|
109
|
+
class="k-form k-form-md"
|
|
110
|
+
[class.k-form-horizontal]="formSettings.orientation === 'horizontal'"
|
|
111
|
+
[formGroup]="formGroup"
|
|
112
|
+
(ngSubmit)="formSubmit.next({originalEvent: $event, formGroup})"
|
|
113
|
+
(reset)="$event.preventDefault()">
|
|
114
|
+
<ng-container *ngFor="let control of controls; let idx = index;">
|
|
115
|
+
<ng-container *ngIf="!control.template; else template">
|
|
116
|
+
<kendo-form-formfield
|
|
117
|
+
[control]="control"
|
|
118
|
+
[showError]="formSettings.showErrors"
|
|
119
|
+
[floatingLabel]="formSettings.floatingLabels"></kendo-form-formfield>
|
|
120
|
+
</ng-container>
|
|
121
|
+
<ng-template #template>
|
|
122
|
+
<ng-container
|
|
123
|
+
[ngTemplateOutlet]="control.template"
|
|
124
|
+
[ngTemplateOutletContext]="control.templateContext"></ng-container>
|
|
125
|
+
</ng-template>
|
|
126
|
+
</ng-container>
|
|
127
|
+
<div class="k-form-buttons" *ngIf="$any(actionButtons).length">
|
|
128
|
+
<button kendoButton *ngFor="let button of $any(actionButtons)"
|
|
129
|
+
[class.k-form-submit]="button.actionType === 'submit'"
|
|
130
|
+
[size]="button.size"
|
|
131
|
+
[themeColor]="button.themeColor || button.actionType === 'submit' ? 'primary' : undefined"
|
|
132
|
+
[rounded]="button.rounded"
|
|
133
|
+
[attr.type]="button.actionType"
|
|
134
|
+
[svgIcon]="button.svgIcon"
|
|
135
|
+
[icon]="button.icon">
|
|
136
|
+
{{button.text}}
|
|
137
|
+
</button>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
`,
|
|
141
|
+
imports: [NgFor, NgIf, NgTemplateOutlet, ReactiveFormsModule, FormFormFieldComponent, KENDO_BUTTON],
|
|
142
|
+
}]
|
|
143
|
+
}], propDecorators: { controls: [{
|
|
144
|
+
type: Input
|
|
145
|
+
}], formSettings: [{
|
|
146
|
+
type: Input
|
|
147
|
+
}], formGroup: [{
|
|
148
|
+
type: Input
|
|
149
|
+
}], actionButtons: [{
|
|
150
|
+
type: Input
|
|
151
|
+
}], formSubmit: [{
|
|
152
|
+
type: Output
|
|
153
|
+
}] } });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
export * from './models';
|
|
6
|
+
export * from './form.component';
|
|
7
|
+
export * from './dialog-form.component';
|
|
8
|
+
export * from './form-formfield.component';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
export {};
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Input, Directive } from '@angular/core';
|
|
5
|
+
import { Input, Directive, inject } from '@angular/core';
|
|
6
6
|
import { GridComponent } from '../grid.component';
|
|
7
7
|
import { LocalEditService } from './local-edit.service';
|
|
8
|
-
import { Subscription, Observable } from 'rxjs';
|
|
8
|
+
import { Subscription, Observable, Subject } from 'rxjs';
|
|
9
9
|
import { LocalDataChangesService } from '../editing/local-data-changes.service';
|
|
10
10
|
import { take } from 'rxjs/operators';
|
|
11
|
+
import { DialogService } from '@progress/kendo-angular-dialog';
|
|
12
|
+
import { checkIcon, xIcon } from '@progress/kendo-svg-icons';
|
|
13
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
11
14
|
import * as i0 from "@angular/core";
|
|
12
15
|
import * as i1 from "../grid.component";
|
|
13
16
|
import * as i2 from "../editing/local-data-changes.service";
|
|
@@ -28,10 +31,32 @@ export class EditingDirectiveBase {
|
|
|
28
31
|
get editService() {
|
|
29
32
|
return this.userEditService || this.defaultEditService;
|
|
30
33
|
}
|
|
34
|
+
removeConfirmationSubject = new Subject();
|
|
35
|
+
dialogService;
|
|
36
|
+
localization;
|
|
37
|
+
defaultRemoveConfirmation = (_item) => {
|
|
38
|
+
const dialog = this.dialogService.open({
|
|
39
|
+
title: this.localization.get('removeConfirmationDialogTitle'),
|
|
40
|
+
content: this.localization.get('removeConfirmationDialogContent'),
|
|
41
|
+
actions: [{
|
|
42
|
+
text: this.localization.get('removeConfirmationDialogConfirmText'),
|
|
43
|
+
themeColor: 'primary',
|
|
44
|
+
svgIcon: checkIcon,
|
|
45
|
+
icon: 'check'
|
|
46
|
+
}, {
|
|
47
|
+
text: this.localization.get('removeConfirmationDialogRejectText'),
|
|
48
|
+
svgIcon: xIcon,
|
|
49
|
+
icon: 'x'
|
|
50
|
+
}],
|
|
51
|
+
});
|
|
52
|
+
dialog.result.pipe(take(1)).subscribe((e) => this.removeConfirmationSubject.next(e.text === this.localization.get('removeConfirmationDialogConfirmText')));
|
|
53
|
+
return this.removeConfirmationSubject;
|
|
54
|
+
};
|
|
31
55
|
/**
|
|
32
56
|
* A function that is called to confirm if the `dataItem` will be removed.
|
|
57
|
+
* Setting to `true` will result in displaying a default confirmation dialog.
|
|
33
58
|
*/
|
|
34
|
-
removeConfirmation;
|
|
59
|
+
removeConfirmation = false;
|
|
35
60
|
subscriptions = new Subscription();
|
|
36
61
|
defaultEditService;
|
|
37
62
|
userEditService;
|
|
@@ -39,6 +64,8 @@ export class EditingDirectiveBase {
|
|
|
39
64
|
this.grid = grid;
|
|
40
65
|
this.localDataChangesService = localDataChangesService;
|
|
41
66
|
this.defaultEditService = this.createDefaultService();
|
|
67
|
+
this.dialogService = inject(DialogService);
|
|
68
|
+
this.localization = inject(LocalizationService);
|
|
42
69
|
}
|
|
43
70
|
/**
|
|
44
71
|
* @hidden
|
|
@@ -59,7 +86,7 @@ export class EditingDirectiveBase {
|
|
|
59
86
|
createDefaultService() {
|
|
60
87
|
return new LocalEditService(this.grid, this.localDataChangesService);
|
|
61
88
|
}
|
|
62
|
-
addHandler() {
|
|
89
|
+
addHandler(_args) {
|
|
63
90
|
this.grid.addRow(this.createModel({ isNew: true }));
|
|
64
91
|
}
|
|
65
92
|
saveHandler(args) {
|
|
@@ -84,7 +111,8 @@ export class EditingDirectiveBase {
|
|
|
84
111
|
}
|
|
85
112
|
};
|
|
86
113
|
if (this.removeConfirmation) {
|
|
87
|
-
const
|
|
114
|
+
const confirmationCallback = typeof this.removeConfirmation === 'boolean' ? this.defaultRemoveConfirmation : this.removeConfirmation;
|
|
115
|
+
const result = confirmationCallback(dataItem);
|
|
88
116
|
if (result instanceof Promise) {
|
|
89
117
|
result.then(removeItem);
|
|
90
118
|
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive, Input } from '@angular/core';
|
|
6
|
+
import { GridComponent } from '../grid.component';
|
|
7
|
+
import { LocalDataChangesService } from '../editing/local-data-changes.service';
|
|
8
|
+
import { markAllAsTouched } from './utils';
|
|
9
|
+
import { EditingDirectiveBase } from './editing-directive-base';
|
|
10
|
+
import { DialogFormComponent } from '../editing/form';
|
|
11
|
+
import { isPresent } from '@progress/kendo-angular-common';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
import * as i1 from "../grid.component";
|
|
14
|
+
import * as i2 from "../editing/local-data-changes.service";
|
|
15
|
+
/**
|
|
16
|
+
* A directive which encapsulates the editing operations of the Grid when using the
|
|
17
|
+
* External Form ([see example](slug:editing_directives_grid#external-editing)).
|
|
18
|
+
*/
|
|
19
|
+
export class ExternalEditingDirective extends EditingDirectiveBase {
|
|
20
|
+
grid;
|
|
21
|
+
localDataChangesService;
|
|
22
|
+
/**
|
|
23
|
+
* The function that creates the `FormGroup` for the edited model.
|
|
24
|
+
*/
|
|
25
|
+
createFormGroup;
|
|
26
|
+
/**
|
|
27
|
+
* Allows you to customize form orientation, hints, labels and error messages.
|
|
28
|
+
*/
|
|
29
|
+
formSettings;
|
|
30
|
+
/**
|
|
31
|
+
* Allows you to customize the Dialog that contains the edit form.
|
|
32
|
+
*/
|
|
33
|
+
dialogSettings;
|
|
34
|
+
constructor(grid, localDataChangesService) {
|
|
35
|
+
super(grid, localDataChangesService);
|
|
36
|
+
this.grid = grid;
|
|
37
|
+
this.localDataChangesService = localDataChangesService;
|
|
38
|
+
}
|
|
39
|
+
ngOnInit() {
|
|
40
|
+
super.ngOnInit();
|
|
41
|
+
this.subscriptions
|
|
42
|
+
.add(this.grid.edit.subscribe(this.editHandler.bind(this)));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @hidden
|
|
46
|
+
* Opens a Dialog that contains the edit form.
|
|
47
|
+
*/
|
|
48
|
+
openEditFormDialog(editEventArgs, formGroup, formSettings) {
|
|
49
|
+
const settings = { content: DialogFormComponent, title: this.localization.get('externalEditingTitle'), ...this.dialogSettings };
|
|
50
|
+
const dialog = this.dialogService.open(settings);
|
|
51
|
+
const formControls = this.normalizeFormSettings(formGroup, editEventArgs);
|
|
52
|
+
dialog.content.setInput('controls', formControls);
|
|
53
|
+
formSettings && dialog.content.setInput('formSettings', formSettings);
|
|
54
|
+
dialog.content.setInput('formGroup', formGroup);
|
|
55
|
+
dialog.result.subscribe((r) => {
|
|
56
|
+
const resultType = r['text'];
|
|
57
|
+
if (resultType === this.localization.get('externalEditingSaveText')) {
|
|
58
|
+
this.saveHandler({ ...editEventArgs, formGroup });
|
|
59
|
+
}
|
|
60
|
+
dialog.close();
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
createModel(args) {
|
|
64
|
+
return this.createFormGroup(args);
|
|
65
|
+
}
|
|
66
|
+
editHandler(args) {
|
|
67
|
+
const formGroup = this.createModel(args);
|
|
68
|
+
this.openEditFormDialog(args, formGroup, this.formSettings);
|
|
69
|
+
}
|
|
70
|
+
saveModel({ dataItem, formGroup, isNew }) {
|
|
71
|
+
if (!formGroup.dirty && !isNew) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (formGroup.valid) {
|
|
75
|
+
const item = dataItem || [];
|
|
76
|
+
this.editService.assignValues(item, formGroup.value);
|
|
77
|
+
return item;
|
|
78
|
+
}
|
|
79
|
+
markAllAsTouched(formGroup);
|
|
80
|
+
}
|
|
81
|
+
addHandler(args) {
|
|
82
|
+
const formGroup = this.createModel(args);
|
|
83
|
+
this.openEditFormDialog(args, formGroup, this.formSettings);
|
|
84
|
+
}
|
|
85
|
+
normalizeFormSettings(args, editEventArgs) {
|
|
86
|
+
const editableColumnFields = this.grid.columns.toArray().filter(c => c.field && c.editable && isPresent(args.get(c.field))).map(c => c.field);
|
|
87
|
+
const settings = editableColumnFields.map(k => {
|
|
88
|
+
const column = this.grid.columns.toArray().find(c => c.field === k);
|
|
89
|
+
const title = column.title || k;
|
|
90
|
+
const template = column.editTemplateRef;
|
|
91
|
+
const templateContext = template ? {
|
|
92
|
+
$implicit: args,
|
|
93
|
+
isNew: editEventArgs.isNew,
|
|
94
|
+
column,
|
|
95
|
+
dataItem: editEventArgs.dataItem,
|
|
96
|
+
formGroup: args,
|
|
97
|
+
rowIndex: editEventArgs.rowIndex
|
|
98
|
+
} : null;
|
|
99
|
+
const customSettings = this.formSettings?.fields?.[k];
|
|
100
|
+
return {
|
|
101
|
+
name: k,
|
|
102
|
+
label: customSettings?.label || title,
|
|
103
|
+
hint: customSettings?.hint,
|
|
104
|
+
errors: customSettings?.errors,
|
|
105
|
+
formControl: args.get(k),
|
|
106
|
+
dataType: column.editor,
|
|
107
|
+
orientation: this.formSettings?.orientation || 'vertical',
|
|
108
|
+
template: template,
|
|
109
|
+
templateContext: templateContext
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
return settings.filter(item => isPresent(item));
|
|
113
|
+
}
|
|
114
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ExternalEditingDirective, deps: [{ token: i1.GridComponent }, { token: i2.LocalDataChangesService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
115
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ExternalEditingDirective, isStandalone: true, selector: "[kendoGridExternalEditing]", inputs: { createFormGroup: ["kendoGridExternalEditing", "createFormGroup"], formSettings: "formSettings", dialogSettings: "dialogSettings" }, usesInheritance: true, ngImport: i0 });
|
|
116
|
+
}
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ExternalEditingDirective, decorators: [{
|
|
118
|
+
type: Directive,
|
|
119
|
+
args: [{
|
|
120
|
+
selector: '[kendoGridExternalEditing]',
|
|
121
|
+
standalone: true
|
|
122
|
+
}]
|
|
123
|
+
}], ctorParameters: function () { return [{ type: i1.GridComponent }, { type: i2.LocalDataChangesService }]; }, propDecorators: { createFormGroup: [{
|
|
124
|
+
type: Input,
|
|
125
|
+
args: ['kendoGridExternalEditing']
|
|
126
|
+
}], formSettings: [{
|
|
127
|
+
type: Input
|
|
128
|
+
}], dialogSettings: [{
|
|
129
|
+
type: Input
|
|
130
|
+
}] } });
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, ViewContainerRef
|
|
5
|
+
import { Directive, ViewContainerRef } from "@angular/core";
|
|
6
6
|
import { FilterHostDirective } from "../filter-host.directive";
|
|
7
7
|
import { isNullOrEmptyString } from "../../utils";
|
|
8
8
|
import { filterComponentFactory } from "./filter-cell-component.factory";
|
|
@@ -12,8 +12,8 @@ import * as i0 from "@angular/core";
|
|
|
12
12
|
* @hidden
|
|
13
13
|
*/
|
|
14
14
|
export class FilterCellHostDirective extends FilterHostDirective {
|
|
15
|
-
constructor(host
|
|
16
|
-
super(host
|
|
15
|
+
constructor(host) {
|
|
16
|
+
super(host);
|
|
17
17
|
}
|
|
18
18
|
componentType() {
|
|
19
19
|
if (!isNullOrEmptyString(this.column.filter)) {
|
|
@@ -21,7 +21,7 @@ export class FilterCellHostDirective extends FilterHostDirective {
|
|
|
21
21
|
}
|
|
22
22
|
return StringFilterCellComponent;
|
|
23
23
|
}
|
|
24
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterCellHostDirective, deps: [{ token: i0.ViewContainerRef }
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterCellHostDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
25
25
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FilterCellHostDirective, isStandalone: true, selector: "[kendoFilterCellHost]", usesInheritance: true, ngImport: i0 });
|
|
26
26
|
}
|
|
27
27
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterCellHostDirective, decorators: [{
|
|
@@ -30,4 +30,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
30
30
|
selector: '[kendoFilterCellHost]',
|
|
31
31
|
standalone: true
|
|
32
32
|
}]
|
|
33
|
-
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }
|
|
33
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; } });
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Input, ViewContainerRef,
|
|
5
|
+
import { Input, ViewContainerRef, Directive } from '@angular/core';
|
|
6
6
|
import { ColumnComponent } from '../columns/column.component';
|
|
7
7
|
import { anyChanged } from '../utils';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
@@ -11,16 +11,14 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
*/
|
|
12
12
|
export class FilterHostDirective {
|
|
13
13
|
host;
|
|
14
|
-
resolver;
|
|
15
14
|
column;
|
|
16
15
|
filter;
|
|
17
16
|
component;
|
|
18
|
-
constructor(host
|
|
17
|
+
constructor(host) {
|
|
19
18
|
this.host = host;
|
|
20
|
-
this.resolver = resolver;
|
|
21
19
|
}
|
|
22
20
|
ngOnInit() {
|
|
23
|
-
this.component = this.host.createComponent(this.
|
|
21
|
+
this.component = this.host.createComponent(this.componentType());
|
|
24
22
|
this.initComponent({
|
|
25
23
|
column: this.column,
|
|
26
24
|
filter: this.filter
|
|
@@ -45,7 +43,7 @@ export class FilterHostDirective {
|
|
|
45
43
|
instance.column = column;
|
|
46
44
|
instance.filter = filter;
|
|
47
45
|
}
|
|
48
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterHostDirective, deps: [{ token: i0.ViewContainerRef }
|
|
46
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterHostDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
49
47
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FilterHostDirective, selector: "[kendoGridFilterHostBase]", inputs: { column: "column", filter: "filter" }, usesOnChanges: true, ngImport: i0 });
|
|
50
48
|
}
|
|
51
49
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterHostDirective, decorators: [{
|
|
@@ -53,7 +51,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
53
51
|
args: [{
|
|
54
52
|
selector: '[kendoGridFilterHostBase]'
|
|
55
53
|
}]
|
|
56
|
-
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }
|
|
54
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { column: [{
|
|
57
55
|
type: Input
|
|
58
56
|
}], filter: [{
|
|
59
57
|
type: Input
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { MenuTabbingService } from './menu-tabbing.service';
|
|
6
|
-
import { Directive, ViewContainerRef,
|
|
6
|
+
import { Directive, ViewContainerRef, Input } from "@angular/core";
|
|
7
7
|
import { FilterHostDirective } from "../filter-host.directive";
|
|
8
8
|
import { isNullOrEmptyString, isPresent } from "../../utils";
|
|
9
9
|
import { filterMenuComponentFactory } from "./filter-menu-component.factory";
|
|
@@ -16,8 +16,8 @@ import * as i0 from "@angular/core";
|
|
|
16
16
|
export class FilterMenuHostDirective extends FilterHostDirective {
|
|
17
17
|
filterService;
|
|
18
18
|
menuTabbingService;
|
|
19
|
-
constructor(host
|
|
20
|
-
super(host
|
|
19
|
+
constructor(host) {
|
|
20
|
+
super(host);
|
|
21
21
|
}
|
|
22
22
|
componentType() {
|
|
23
23
|
if (isPresent(this.column) && !isNullOrEmptyString(this.column.filter)) {
|
|
@@ -30,7 +30,7 @@ export class FilterMenuHostDirective extends FilterHostDirective {
|
|
|
30
30
|
this.component.instance.filterService = this.filterService;
|
|
31
31
|
this.component.instance.menuTabbingService = this.menuTabbingService;
|
|
32
32
|
}
|
|
33
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterMenuHostDirective, deps: [{ token: i0.ViewContainerRef }
|
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterMenuHostDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
34
34
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FilterMenuHostDirective, isStandalone: true, selector: "[kendoFilterMenuHost]", inputs: { filterService: "filterService", menuTabbingService: "menuTabbingService" }, usesInheritance: true, ngImport: i0 });
|
|
35
35
|
}
|
|
36
36
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterMenuHostDirective, decorators: [{
|
|
@@ -39,7 +39,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
39
39
|
selector: '[kendoFilterMenuHost]',
|
|
40
40
|
standalone: true
|
|
41
41
|
}]
|
|
42
|
-
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }
|
|
42
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { filterService: [{
|
|
43
43
|
type: Input
|
|
44
44
|
}], menuTabbingService: [{
|
|
45
45
|
type: Input
|