@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
|
@@ -131,6 +131,17 @@ export class ColumnListComponent {
|
|
|
131
131
|
if (e.keyCode !== Keys.Tab) {
|
|
132
132
|
e.preventDefault();
|
|
133
133
|
}
|
|
134
|
+
if (e.key === 'Tab' && !e.shiftKey && this.autoSync) {
|
|
135
|
+
e.preventDefault();
|
|
136
|
+
}
|
|
137
|
+
if (e.key === 'Tab' && e.shiftKey) {
|
|
138
|
+
this.ngZone.run(() => {
|
|
139
|
+
if (e.target.matches('.k-column-list-item')) {
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
this.resetButton?.nativeElement.focus();
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
134
145
|
if (e.keyCode === Keys.ArrowDown) {
|
|
135
146
|
this.listNavigationService.next();
|
|
136
147
|
}
|
|
@@ -145,19 +156,23 @@ export class ColumnListComponent {
|
|
|
145
156
|
if (this.allowHideAll && !this.hasLocked) {
|
|
146
157
|
return;
|
|
147
158
|
}
|
|
148
|
-
|
|
159
|
+
// Cache visible columns to avoid repeated checks
|
|
160
|
+
const visibleColumns = [];
|
|
161
|
+
const columnMap = new Map();
|
|
149
162
|
this.checkboxes.forEach((checkbox, index) => {
|
|
163
|
+
// Reset all disabled states first
|
|
164
|
+
this.setDisabledState(checkbox, false);
|
|
150
165
|
if (checkbox.checkedState) {
|
|
151
|
-
|
|
166
|
+
visibleColumns.push({ checkbox, index });
|
|
167
|
+
columnMap.set(index, this.columns[index]);
|
|
152
168
|
}
|
|
153
|
-
this.setDisabledState(checkbox, false);
|
|
154
169
|
});
|
|
155
|
-
|
|
156
|
-
|
|
170
|
+
// Only apply disabled states where needed
|
|
171
|
+
if (!this.allowHideAll && visibleColumns.length === 1 && !this.hasFiltered) {
|
|
172
|
+
this.setDisabledState(visibleColumns[0].checkbox, true);
|
|
157
173
|
}
|
|
158
174
|
else if (this.hasLocked && !this.hasUnlockedFiltered) {
|
|
159
|
-
const
|
|
160
|
-
const checkedUnlocked = checkedItems.filter(item => !columns[item.index].locked);
|
|
175
|
+
const checkedUnlocked = visibleColumns.filter(item => !columnMap.get(item.index).locked);
|
|
161
176
|
if (checkedUnlocked.length === 1) {
|
|
162
177
|
this.setDisabledState(checkedUnlocked[0].checkbox, true);
|
|
163
178
|
}
|
|
@@ -178,34 +193,32 @@ export class ColumnListComponent {
|
|
|
178
193
|
}
|
|
179
194
|
}
|
|
180
195
|
setDisabledState(checkbox, disabled) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
196
|
+
if (checkbox.disabled !== disabled) {
|
|
197
|
+
this.ngZone.runOutsideAngular(() => {
|
|
198
|
+
checkbox.disabled = disabled;
|
|
199
|
+
const checkboxElement = checkbox.hostElement.nativeElement;
|
|
200
|
+
const parentElement = checkboxElement.parentElement;
|
|
201
|
+
if (disabled) {
|
|
202
|
+
this.renderer.addClass(parentElement, 'k-disabled');
|
|
203
|
+
this.renderer.setAttribute(parentElement, 'aria-disabled', 'true');
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
this.renderer.removeClass(parentElement, 'k-disabled');
|
|
207
|
+
this.renderer.removeAttribute(parentElement, 'aria-disabled');
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
188
211
|
}
|
|
189
212
|
handleCheckBoxClick = (e) => {
|
|
190
213
|
const closestItem = e.target.closest('.k-column-list-item');
|
|
191
214
|
if (closestItem) {
|
|
192
215
|
const checkboxElement = closestItem.querySelector('.k-checkbox-wrap');
|
|
193
|
-
const checkbox = this.checkboxes.find(checkBox => checkBox.hostElement.nativeElement === checkboxElement);
|
|
194
216
|
const index = parseInt(checkboxElement.firstElementChild.getAttribute('data-index'), 10);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
217
|
+
const checkbox = this.checkboxes.toArray()[index];
|
|
218
|
+
if (e.target === checkbox.input.nativeElement) {
|
|
219
|
+
closestItem.focus();
|
|
220
|
+
e.target.classList.remove('k-focus');
|
|
199
221
|
}
|
|
200
|
-
if (checkboxElement.contains(e.target)) {
|
|
201
|
-
const checkboxInputElement = checkboxElement.firstElementChild;
|
|
202
|
-
checkboxInputElement.blur();
|
|
203
|
-
checkboxInputElement.classList.remove('k-focus');
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
this.listNavigationService.toggleCheckedState();
|
|
207
|
-
}
|
|
208
|
-
closestItem.focus();
|
|
209
222
|
if (this.autoSync) {
|
|
210
223
|
if (!this.columns[index]) {
|
|
211
224
|
return;
|
|
@@ -213,14 +226,21 @@ export class ColumnListComponent {
|
|
|
213
226
|
const column = this.columns[index];
|
|
214
227
|
const hidden = !checkbox.checkedState;
|
|
215
228
|
if (Boolean(column.hidden) !== hidden) {
|
|
216
|
-
this.ngZone.
|
|
229
|
+
this.ngZone.runOutsideAngular(() => {
|
|
217
230
|
column.hidden = hidden;
|
|
218
|
-
this.
|
|
231
|
+
this.ngZone.run(() => {
|
|
232
|
+
this.columnChange.emit([column]);
|
|
233
|
+
});
|
|
219
234
|
});
|
|
220
235
|
}
|
|
221
236
|
}
|
|
222
237
|
else {
|
|
223
|
-
this.updateDisabled();
|
|
238
|
+
this.ngZone.run(() => this.updateDisabled());
|
|
239
|
+
}
|
|
240
|
+
if (index !== this.listNavigationService.activeIndex) {
|
|
241
|
+
this.listNavigationService.toggle(this.listNavigationService.activeIndex, false);
|
|
242
|
+
this.listNavigationService.activeIndex = index;
|
|
243
|
+
this.listNavigationService.toggle(index, true);
|
|
224
244
|
}
|
|
225
245
|
}
|
|
226
246
|
};
|
|
@@ -238,9 +258,9 @@ export class ColumnListComponent {
|
|
|
238
258
|
role="option">
|
|
239
259
|
<kendo-checkbox
|
|
240
260
|
[inputAttributes]="{'data-index': index.toString()}"
|
|
261
|
+
[tabindex]="-1"
|
|
241
262
|
[checkedState]="!column.hidden"
|
|
242
263
|
[disabled]="isDisabled(column)"
|
|
243
|
-
[tabindex]="-1"
|
|
244
264
|
></kendo-checkbox>
|
|
245
265
|
<span class="k-checkbox-label">{{ column.displayTitle }}</span>
|
|
246
266
|
</label>
|
|
@@ -282,9 +302,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
282
302
|
role="option">
|
|
283
303
|
<kendo-checkbox
|
|
284
304
|
[inputAttributes]="{'data-index': index.toString()}"
|
|
305
|
+
[tabindex]="-1"
|
|
285
306
|
[checkedState]="!column.hidden"
|
|
286
307
|
[disabled]="isDisabled(column)"
|
|
287
|
-
[tabindex]="-1"
|
|
288
308
|
></kendo-checkbox>
|
|
289
309
|
<span class="k-checkbox-label">{{ column.displayTitle }}</span>
|
|
290
310
|
</label>
|
|
@@ -38,13 +38,12 @@ export class ColumnMenuItemComponent {
|
|
|
38
38
|
*/
|
|
39
39
|
collapse = new EventEmitter();
|
|
40
40
|
/**
|
|
41
|
-
* Specifies the name of the [font icon](slug:
|
|
42
|
-
* that will be rendered
|
|
41
|
+
* Specifies the name of the [font icon](slug:icon_list)
|
|
42
|
+
* that will be rendered within the item.
|
|
43
43
|
*/
|
|
44
44
|
icon;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
47
|
-
* that will be rendered for the item.
|
|
46
|
+
* Defines the [SVG icon](slug:svgicon_list) to be rendered within the item.
|
|
48
47
|
*/
|
|
49
48
|
svgIcon;
|
|
50
49
|
/**
|
|
@@ -354,6 +354,10 @@ export class ColumnBase {
|
|
|
354
354
|
throw new Error(ColumnConfigurationErrorMessages.columnNested);
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
+
ngAfterViewInit() {
|
|
358
|
+
this.initialMaxResizableWidth = this.maxResizableWidth;
|
|
359
|
+
this.initialMinResizableWidth = this.minResizableWidth;
|
|
360
|
+
}
|
|
357
361
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnBase, deps: [{ token: ColumnBase }, { token: i1.IdService }], target: i0.ɵɵFactoryTarget.Component });
|
|
358
362
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ColumnBase, selector: "kendo-grid-column-base", inputs: { resizable: "resizable", reorderable: "reorderable", minResizableWidth: "minResizableWidth", maxResizableWidth: "maxResizableWidth", title: "title", width: "width", autoSize: "autoSize", locked: "locked", sticky: "sticky", hidden: "hidden", media: "media", lockable: "lockable", stickable: "stickable", columnMenu: "columnMenu", includeInChooser: "includeInChooser", tableCellsRole: "tableCellsRole", style: "style", headerStyle: "headerStyle", filterStyle: "filterStyle", footerStyle: "footerStyle", cssClass: ["class", "cssClass"], headerClass: "headerClass", filterClass: "filterClass", footerClass: "footerClass", cellRowspan: "cellRowspan" }, queries: [{ propertyName: "footerTemplate", first: true, predicate: FooterTemplateDirective, descendants: true }, { propertyName: "headerTemplates", predicate: HeaderTemplateDirective }, { propertyName: "columnMenuTemplates", predicate: ColumnMenuTemplateDirective }], ngImport: i0, template: ``, isInline: true });
|
|
359
363
|
}
|
|
@@ -116,10 +116,6 @@ export class ColumnComponent extends ColumnBase {
|
|
|
116
116
|
get displayTitle() {
|
|
117
117
|
return this.title === undefined ? this.field : this.title;
|
|
118
118
|
}
|
|
119
|
-
ngAfterViewInit() {
|
|
120
|
-
this.initialMaxResizableWidth = this.maxResizableWidth;
|
|
121
|
-
this.initialMinResizableWidth = this.minResizableWidth;
|
|
122
|
-
}
|
|
123
119
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnComponent, deps: [{ token: i1.ColumnBase, host: true, optional: true, skipSelf: true }, { token: i2.IdService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
124
120
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ColumnComponent, isStandalone: true, selector: "kendo-grid-column", inputs: { field: "field", format: "format", sortable: "sortable", groupable: "groupable", editor: "editor", filter: "filter", filterable: "filterable", editable: "editable" }, providers: [
|
|
125
121
|
{
|
|
@@ -13,6 +13,7 @@ export class DomEventsService {
|
|
|
13
13
|
cellMouseup = new EventEmitter();
|
|
14
14
|
click = new EventEmitter();
|
|
15
15
|
keydown = new EventEmitter();
|
|
16
|
+
shiftKeyup = new EventEmitter();
|
|
16
17
|
focus = new EventEmitter();
|
|
17
18
|
focusIn = new EventEmitter();
|
|
18
19
|
focusOut = new EventEmitter();
|
|
@@ -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 {};
|
package/esm2022/directives.mjs
CHANGED
|
@@ -130,6 +130,7 @@ import { SelectionDirective } from "./selection/selection.directive";
|
|
|
130
130
|
import { TemplateEditingDirective } from "./editing-directives/template-editing.directive";
|
|
131
131
|
import { ReactiveEditingDirective } from "./editing-directives/reactive-editing.directive";
|
|
132
132
|
import { InCellEditingDirective } from "./editing-directives/in-cell-editing.directive";
|
|
133
|
+
import { ExternalEditingDirective } from "./editing-directives/external-editing.directive";
|
|
133
134
|
import { ExpandDetailsDirective } from "./rendering/details-expand.directive";
|
|
134
135
|
import { ExpandGroupDirective } from "./rendering/groups-expand.directive";
|
|
135
136
|
import { GroupBindingDirective } from "./grouping/group-scroll-binding.directive";
|
|
@@ -145,6 +146,7 @@ import { ExcelCommandToolbarDirective } from "./excel/excel-command-tool.directi
|
|
|
145
146
|
import { AddCommandToolbarDirective } from "./editing/add-command-tool.directive";
|
|
146
147
|
import { RowDragHandleTemplateDirective } from "./row-reordering/drag-handle-template.directive";
|
|
147
148
|
import { RowDragHintTemplateDirective } from "./row-reordering/drag-hint-template.directive";
|
|
149
|
+
import { DialogFormComponent, FormComponent, FormFormFieldComponent } from "./editing/form";
|
|
148
150
|
/**
|
|
149
151
|
* @hidden
|
|
150
152
|
*
|
|
@@ -383,6 +385,7 @@ export const KENDO_GRID_DECLARATIONS = [
|
|
|
383
385
|
TemplateEditingDirective,
|
|
384
386
|
ReactiveEditingDirective,
|
|
385
387
|
InCellEditingDirective,
|
|
388
|
+
ExternalEditingDirective,
|
|
386
389
|
ExpandDetailsDirective,
|
|
387
390
|
ExpandGroupDirective,
|
|
388
391
|
GroupBindingDirective,
|
|
@@ -391,7 +394,10 @@ export const KENDO_GRID_DECLARATIONS = [
|
|
|
391
394
|
GridToolbarFocusableDirective,
|
|
392
395
|
StatusBarComponent,
|
|
393
396
|
StatusBarTemplateDirective,
|
|
394
|
-
GridClipboardDirective
|
|
397
|
+
GridClipboardDirective,
|
|
398
|
+
FormComponent,
|
|
399
|
+
DialogFormComponent,
|
|
400
|
+
FormFormFieldComponent
|
|
395
401
|
];
|
|
396
402
|
/**
|
|
397
403
|
* @hidden
|
|
@@ -411,6 +417,7 @@ export const KENDO_GRID_EXPORTS = [
|
|
|
411
417
|
TemplateEditingDirective,
|
|
412
418
|
ReactiveEditingDirective,
|
|
413
419
|
InCellEditingDirective,
|
|
420
|
+
ExternalEditingDirective,
|
|
414
421
|
ExpandDetailsDirective,
|
|
415
422
|
ExpandGroupDirective,
|
|
416
423
|
GridToolbarFocusableDirective,
|
|
@@ -153,7 +153,7 @@ export class EditService {
|
|
|
153
153
|
this.changes.emit({ action: 'edit', rowIndex });
|
|
154
154
|
}
|
|
155
155
|
beginAdd() {
|
|
156
|
-
this.changes.emit({ action: 'add' });
|
|
156
|
+
this.changes.emit({ action: 'add', isNew: true });
|
|
157
157
|
}
|
|
158
158
|
endEdit(rowIndex) {
|
|
159
159
|
const { group: formGroup } = this.context(rowIndex);
|
|
@@ -0,0 +1,102 @@
|
|
|
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, Input } from '@angular/core';
|
|
6
|
+
import { DialogActionsComponent, DialogContentBase, DialogRef } from '@progress/kendo-angular-dialog';
|
|
7
|
+
import { FormComponent } from './form.component';
|
|
8
|
+
import { FormGroup } from '@angular/forms';
|
|
9
|
+
import { KENDO_BUTTON } from '@progress/kendo-angular-buttons';
|
|
10
|
+
import { cancelIcon, saveIcon } from '@progress/kendo-svg-icons';
|
|
11
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
import * as i1 from "@progress/kendo-angular-dialog";
|
|
14
|
+
import * as i2 from "@progress/kendo-angular-l10n";
|
|
15
|
+
import * as i3 from "@progress/kendo-angular-buttons";
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export class DialogFormComponent extends DialogContentBase {
|
|
20
|
+
localization;
|
|
21
|
+
controls;
|
|
22
|
+
formGroup;
|
|
23
|
+
formSettings;
|
|
24
|
+
saveIcon = saveIcon;
|
|
25
|
+
cancelIcon = cancelIcon;
|
|
26
|
+
constructor(dialogRef, localization) {
|
|
27
|
+
super(dialogRef);
|
|
28
|
+
this.localization = localization;
|
|
29
|
+
}
|
|
30
|
+
save() {
|
|
31
|
+
this.dialog.close({ text: this.localization.get('externalEditingSaveText') });
|
|
32
|
+
}
|
|
33
|
+
cancel() {
|
|
34
|
+
this.dialog.close({ text: this.localization.get('externalEditingCancelText') });
|
|
35
|
+
}
|
|
36
|
+
messageFor(key) {
|
|
37
|
+
return this.localization.get(key);
|
|
38
|
+
}
|
|
39
|
+
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 });
|
|
40
|
+
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: `
|
|
41
|
+
<kendo-grid-external-form
|
|
42
|
+
[controls]="controls"
|
|
43
|
+
[formGroup]="formGroup"
|
|
44
|
+
[formSettings]="formSettings"
|
|
45
|
+
[actionButtons]="false"></kendo-grid-external-form>
|
|
46
|
+
<kendo-dialog-actions [layout]="this.dialog?.dialog?.instance?.actionsLayout">
|
|
47
|
+
<button
|
|
48
|
+
kendoButton
|
|
49
|
+
themeColor="primary"
|
|
50
|
+
[svgIcon]="saveIcon"
|
|
51
|
+
[disabled]="!formGroup.valid"
|
|
52
|
+
(click)="save()"
|
|
53
|
+
>
|
|
54
|
+
{{messageFor('externalEditingSaveText')}}
|
|
55
|
+
</button>
|
|
56
|
+
<button
|
|
57
|
+
kendoButton
|
|
58
|
+
[svgIcon]="cancelIcon"
|
|
59
|
+
(click)="cancel()">
|
|
60
|
+
{{messageFor('externalEditingCancelText')}}
|
|
61
|
+
</button>
|
|
62
|
+
</kendo-dialog-actions>
|
|
63
|
+
`, 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"] }] });
|
|
64
|
+
}
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogFormComponent, decorators: [{
|
|
66
|
+
type: Component,
|
|
67
|
+
args: [{
|
|
68
|
+
selector: 'kendo-grid-dialog-form',
|
|
69
|
+
standalone: true,
|
|
70
|
+
imports: [FormComponent, DialogActionsComponent, KENDO_BUTTON],
|
|
71
|
+
template: `
|
|
72
|
+
<kendo-grid-external-form
|
|
73
|
+
[controls]="controls"
|
|
74
|
+
[formGroup]="formGroup"
|
|
75
|
+
[formSettings]="formSettings"
|
|
76
|
+
[actionButtons]="false"></kendo-grid-external-form>
|
|
77
|
+
<kendo-dialog-actions [layout]="this.dialog?.dialog?.instance?.actionsLayout">
|
|
78
|
+
<button
|
|
79
|
+
kendoButton
|
|
80
|
+
themeColor="primary"
|
|
81
|
+
[svgIcon]="saveIcon"
|
|
82
|
+
[disabled]="!formGroup.valid"
|
|
83
|
+
(click)="save()"
|
|
84
|
+
>
|
|
85
|
+
{{messageFor('externalEditingSaveText')}}
|
|
86
|
+
</button>
|
|
87
|
+
<button
|
|
88
|
+
kendoButton
|
|
89
|
+
[svgIcon]="cancelIcon"
|
|
90
|
+
(click)="cancel()">
|
|
91
|
+
{{messageFor('externalEditingCancelText')}}
|
|
92
|
+
</button>
|
|
93
|
+
</kendo-dialog-actions>
|
|
94
|
+
`
|
|
95
|
+
}]
|
|
96
|
+
}], ctorParameters: function () { return [{ type: i1.DialogRef }, { type: i2.LocalizationService }]; }, propDecorators: { controls: [{
|
|
97
|
+
type: Input
|
|
98
|
+
}], formGroup: [{
|
|
99
|
+
type: Input
|
|
100
|
+
}], formSettings: [{
|
|
101
|
+
type: Input
|
|
102
|
+
}] } });
|
|
@@ -0,0 +1,161 @@
|
|
|
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 { KeyValuePipe, NgFor, NgIf } from '@angular/common';
|
|
6
|
+
import { ChangeDetectorRef, Component, Input, ViewChild } from '@angular/core';
|
|
7
|
+
import { KENDO_BUTTON } from '@progress/kendo-angular-buttons';
|
|
8
|
+
import { KENDO_DATEPICKER } from '@progress/kendo-angular-dateinputs';
|
|
9
|
+
import { KENDO_CHECKBOX, KENDO_FORMFIELD, KENDO_NUMERICTEXTBOX, KENDO_TEXTBOX } from '@progress/kendo-angular-inputs';
|
|
10
|
+
import { KENDO_LABELS } from '@progress/kendo-angular-label';
|
|
11
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
12
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
13
|
+
import { replaceMessagePlaceholder } from '../../utils';
|
|
14
|
+
import * as i0 from "@angular/core";
|
|
15
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
16
|
+
import * as i2 from "@angular/forms";
|
|
17
|
+
import * as i3 from "@progress/kendo-angular-label";
|
|
18
|
+
import * as i4 from "@progress/kendo-angular-inputs";
|
|
19
|
+
import * as i5 from "@progress/kendo-angular-dateinputs";
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export class FormFormFieldComponent {
|
|
24
|
+
localization;
|
|
25
|
+
cdr;
|
|
26
|
+
control;
|
|
27
|
+
floatingLabel;
|
|
28
|
+
showError;
|
|
29
|
+
input;
|
|
30
|
+
constructor(localization, cdr) {
|
|
31
|
+
this.localization = localization;
|
|
32
|
+
this.cdr = cdr;
|
|
33
|
+
}
|
|
34
|
+
// required to avoid ExpressionChangedAfterItHasBeenCheckedError caused by
|
|
35
|
+
// binding to the label's 'for' attribute dynamically
|
|
36
|
+
ngAfterContentInit() {
|
|
37
|
+
this.cdr.detectChanges();
|
|
38
|
+
}
|
|
39
|
+
messageFor(key, errorName, field) {
|
|
40
|
+
return replaceMessagePlaceholder(replaceMessagePlaceholder(this.localization.get(key), 'fieldName', field), 'errorName', errorName);
|
|
41
|
+
}
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormFormFieldComponent, deps: [{ token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
43
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FormFormFieldComponent, isStandalone: true, selector: "kendo-form-formfield", inputs: { control: "control", floatingLabel: "floatingLabel", showError: "showError" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: `
|
|
44
|
+
<kendo-formfield
|
|
45
|
+
[orientation]="control.orientation">
|
|
46
|
+
<kendo-floatinglabel
|
|
47
|
+
*ngIf="control.label && floatingLabel && $any(control.dataType) !== 'boolean'"
|
|
48
|
+
labelCssClass="k-form-label"
|
|
49
|
+
[text]="control.label">
|
|
50
|
+
<kendo-textbox
|
|
51
|
+
*ngIf="$any(control.dataType) === 'text'"
|
|
52
|
+
[formControl]="control.formControl"></kendo-textbox>
|
|
53
|
+
<kendo-numerictextbox
|
|
54
|
+
*ngIf="$any(control.dataType) === 'numeric'"
|
|
55
|
+
[formControl]="control.formControl"></kendo-numerictextbox>
|
|
56
|
+
<kendo-datepicker
|
|
57
|
+
*ngIf="$any(control.dataType) === 'date'"
|
|
58
|
+
[formControl]="control.formControl"></kendo-datepicker>
|
|
59
|
+
</kendo-floatinglabel>
|
|
60
|
+
<kendo-label [style.align-items]="'start'"
|
|
61
|
+
*ngIf="control.label && !floatingLabel && $any(control.dataType) !== 'boolean'"
|
|
62
|
+
labelCssClass="k-form-label"
|
|
63
|
+
[text]="control.label"
|
|
64
|
+
[for]="input">
|
|
65
|
+
</kendo-label>
|
|
66
|
+
<kendo-textbox #input
|
|
67
|
+
*ngIf="!floatingLabel && (control.dataType) === 'text'"
|
|
68
|
+
[formControl]="control.formControl"></kendo-textbox>
|
|
69
|
+
<kendo-numerictextbox #input
|
|
70
|
+
*ngIf="!floatingLabel && $any(control.dataType) === 'numeric'"
|
|
71
|
+
[formControl]="control.formControl"></kendo-numerictextbox>
|
|
72
|
+
<kendo-datepicker #input
|
|
73
|
+
*ngIf="!floatingLabel && $any(control.dataType) === 'date'"
|
|
74
|
+
[formControl]="control.formControl"></kendo-datepicker>
|
|
75
|
+
<div
|
|
76
|
+
*ngIf="control.label && $any(control.dataType) === 'boolean'"
|
|
77
|
+
class="k-form-field-checkbox-wrap">
|
|
78
|
+
<kendo-checkbox #cb [formControl]="control.formControl"></kendo-checkbox>
|
|
79
|
+
<kendo-label
|
|
80
|
+
*ngIf="control.label"
|
|
81
|
+
class="k-checkbox-label"
|
|
82
|
+
[for]="cb"
|
|
83
|
+
[text]="control.label">
|
|
84
|
+
</kendo-label>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<kendo-formhint *ngIf="control?.hint">{{control.hint}}</kendo-formhint>
|
|
88
|
+
<ng-container *ngIf="showError && control.formControl?.invalid && control.formControl.touched">
|
|
89
|
+
<kendo-formerror *ngFor="let err of control?.formControl?.errors | keyvalue">{{control.errors ? control.errors[err.key] : messageFor('formValidationError', err.key, control.name)}}</kendo-formerror>
|
|
90
|
+
</ng-container>
|
|
91
|
+
</kendo-formfield>
|
|
92
|
+
`, isInline: true, dependencies: [{ kind: "pipe", type: KeyValuePipe, name: "keyvalue" }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3.LabelComponent, selector: "kendo-label", inputs: ["text", "for", "optional", "labelCssStyle", "labelCssClass"], exportAs: ["kendoLabel"] }, { kind: "component", type: i3.FloatingLabelComponent, selector: "kendo-floatinglabel", inputs: ["labelCssStyle", "labelCssClass", "id", "text", "optional"], outputs: ["positionChange"], exportAs: ["kendoFloatingLabel"] }, { kind: "component", type: i4.FormFieldComponent, selector: "kendo-formfield", inputs: ["showHints", "orientation", "showErrors"] }, { kind: "component", type: i4.HintComponent, selector: "kendo-formhint", inputs: ["align"] }, { kind: "component", type: i4.ErrorComponent, selector: "kendo-formerror", inputs: ["align"] }, { kind: "component", type: i4.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: "component", type: i4.NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode", "inputAttributes"], outputs: ["valueChange", "focus", "blur", "inputFocus", "inputBlur"], exportAs: ["kendoNumericTextBox"] }, { kind: "component", type: i4.CheckBoxComponent, selector: "kendo-checkbox", inputs: ["checkedState", "rounded"], outputs: ["checkedStateChange"], exportAs: ["kendoCheckBox"] }, { kind: "component", type: i5.DatePickerComponent, selector: "kendo-datepicker", inputs: ["focusableId", "cellTemplate", "clearButton", "inputAttributes", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "headerTemplate", "footerTemplate", "footer", "navigationItemTemplate", "weekDaysFormat", "showOtherMonthDays", "activeView", "bottomView", "topView", "calendarType", "animateCalendarNavigation", "disabled", "readonly", "readOnlyInput", "popupSettings", "navigation", "min", "max", "incompleteDateValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "enableMouseWheel", "allowCaretMode", "autoFill", "focusedDate", "value", "format", "twoDigitYearMax", "formatPlaceholder", "placeholder", "tabindex", "tabIndex", "disabledDates", "title", "subtitle", "rangeValidation", "disabledDatesValidation", "weekNumber", "size", "rounded", "fillMode", "adaptiveMode"], outputs: ["valueChange", "focus", "blur", "open", "close", "escape"], exportAs: ["kendo-datepicker"] }] });
|
|
93
|
+
}
|
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormFormFieldComponent, decorators: [{
|
|
95
|
+
type: Component,
|
|
96
|
+
args: [{
|
|
97
|
+
selector: 'kendo-form-formfield',
|
|
98
|
+
standalone: true,
|
|
99
|
+
imports: [KeyValuePipe, NgFor, NgIf, ReactiveFormsModule,
|
|
100
|
+
KENDO_LABELS, KENDO_FORMFIELD, KENDO_TEXTBOX, KENDO_NUMERICTEXTBOX, KENDO_BUTTON, KENDO_CHECKBOX, KENDO_DATEPICKER],
|
|
101
|
+
template: `
|
|
102
|
+
<kendo-formfield
|
|
103
|
+
[orientation]="control.orientation">
|
|
104
|
+
<kendo-floatinglabel
|
|
105
|
+
*ngIf="control.label && floatingLabel && $any(control.dataType) !== 'boolean'"
|
|
106
|
+
labelCssClass="k-form-label"
|
|
107
|
+
[text]="control.label">
|
|
108
|
+
<kendo-textbox
|
|
109
|
+
*ngIf="$any(control.dataType) === 'text'"
|
|
110
|
+
[formControl]="control.formControl"></kendo-textbox>
|
|
111
|
+
<kendo-numerictextbox
|
|
112
|
+
*ngIf="$any(control.dataType) === 'numeric'"
|
|
113
|
+
[formControl]="control.formControl"></kendo-numerictextbox>
|
|
114
|
+
<kendo-datepicker
|
|
115
|
+
*ngIf="$any(control.dataType) === 'date'"
|
|
116
|
+
[formControl]="control.formControl"></kendo-datepicker>
|
|
117
|
+
</kendo-floatinglabel>
|
|
118
|
+
<kendo-label [style.align-items]="'start'"
|
|
119
|
+
*ngIf="control.label && !floatingLabel && $any(control.dataType) !== 'boolean'"
|
|
120
|
+
labelCssClass="k-form-label"
|
|
121
|
+
[text]="control.label"
|
|
122
|
+
[for]="input">
|
|
123
|
+
</kendo-label>
|
|
124
|
+
<kendo-textbox #input
|
|
125
|
+
*ngIf="!floatingLabel && (control.dataType) === 'text'"
|
|
126
|
+
[formControl]="control.formControl"></kendo-textbox>
|
|
127
|
+
<kendo-numerictextbox #input
|
|
128
|
+
*ngIf="!floatingLabel && $any(control.dataType) === 'numeric'"
|
|
129
|
+
[formControl]="control.formControl"></kendo-numerictextbox>
|
|
130
|
+
<kendo-datepicker #input
|
|
131
|
+
*ngIf="!floatingLabel && $any(control.dataType) === 'date'"
|
|
132
|
+
[formControl]="control.formControl"></kendo-datepicker>
|
|
133
|
+
<div
|
|
134
|
+
*ngIf="control.label && $any(control.dataType) === 'boolean'"
|
|
135
|
+
class="k-form-field-checkbox-wrap">
|
|
136
|
+
<kendo-checkbox #cb [formControl]="control.formControl"></kendo-checkbox>
|
|
137
|
+
<kendo-label
|
|
138
|
+
*ngIf="control.label"
|
|
139
|
+
class="k-checkbox-label"
|
|
140
|
+
[for]="cb"
|
|
141
|
+
[text]="control.label">
|
|
142
|
+
</kendo-label>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<kendo-formhint *ngIf="control?.hint">{{control.hint}}</kendo-formhint>
|
|
146
|
+
<ng-container *ngIf="showError && control.formControl?.invalid && control.formControl.touched">
|
|
147
|
+
<kendo-formerror *ngFor="let err of control?.formControl?.errors | keyvalue">{{control.errors ? control.errors[err.key] : messageFor('formValidationError', err.key, control.name)}}</kendo-formerror>
|
|
148
|
+
</ng-container>
|
|
149
|
+
</kendo-formfield>
|
|
150
|
+
`
|
|
151
|
+
}]
|
|
152
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { control: [{
|
|
153
|
+
type: Input
|
|
154
|
+
}], floatingLabel: [{
|
|
155
|
+
type: Input
|
|
156
|
+
}], showError: [{
|
|
157
|
+
type: Input
|
|
158
|
+
}], input: [{
|
|
159
|
+
type: ViewChild,
|
|
160
|
+
args: ['input']
|
|
161
|
+
}] } });
|